feat(opencode): native OpenCode plugin with per-turn injection, write reminders, compaction flush, session-idle gate and pwf tools
New npm package opencode-planning-with-files under .opencode/packages/opencode-planning-with-files/ (TypeScript, Vitest): - chat.message appends the framed active plan (plan head, normalized progress tail, findings pointer) to every user message, or a once-per-turn ambiguity notice when a direct child project carries its own live plan - tool.execute.after appends the progress reminder to write, edit, patch, multiedit and apply_patch output - experimental.session.compacting keeps the plan pointer and attestation hash in the compaction context - event session.idle runs the completion gate in gated mode and re-prompts the session with the gate reason through the SDK (Tier 2); child sessions are never re-prompted, the shared .stop_blocks and .gate_last_ledger counters and PWF_GATE_CAP bound it - tools pwf_init (root or .planning/<date>-<slug>/, mode autonomous or gated with the v3 markers and attestation), pwf_status, pwf_check The resolver, ambiguity rule, gate decision table, init markers, attestation check and frame format mirror resolve-plan-dir.sh, inject-plan.sh, check-complete.sh --gate, init-session.sh and the Hermes plugin. Each session resolves its plan from its own OpenCode directory. PWF_PLAN_ROOT fails closed, PLANNING_DISABLED silences every hook. Also: .opencode/commands/pwf.md and pwf-status.md in OpenCode's command format, a dogfood entry .opencode/plugins/planning-with-files.ts that loads the plugin from source when this repository is opened in OpenCode, .opencode/package.json tracked with the @opencode-ai/plugin dependency, and a vitest (OpenCode plugin) CI job. Verified live in OpenCode 1.18.21: plugin loaded, pwf_init/pwf_status/ pwf_check listed, /pwf and /pwf-status listed, a real session message received the framed plan as a synthetic part.
O
OthmanAdi committed
a9d9cccb045be79d7b531ace2b9de59edfe8b2fd
Parent: d417cc6