opencode-copilot-delegate 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +14 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14193 -178
- package/dist/runtime/cancel-helper.d.ts +10 -0
- package/dist/runtime/envelope.d.ts +1 -1
- package/dist/runtime/notify.d.ts +10 -2
- package/dist/runtime/pid-file.d.ts +3 -0
- package/dist/runtime/rpc-contract.d.ts +39 -0
- package/dist/runtime/rpc-server.d.ts +32 -0
- package/dist/runtime/task-status.d.ts +9 -0
- package/dist/tui/__tests__/confirm-card.test.d.ts +2 -0
- package/dist/tui/__tests__/index.test.d.ts +1 -0
- package/dist/tui/__tests__/modal-list.test.d.ts +1 -0
- package/dist/tui/__tests__/rpc-client.test.d.ts +1 -0
- package/dist/tui/components/confirm-card.d.ts +14 -0
- package/dist/tui/components/modal-list.d.ts +19 -0
- package/dist/tui/components/row.d.ts +6 -0
- package/dist/tui/index.d.ts +7 -0
- package/dist/tui/index.js +14434 -0
- package/dist/tui/rpc-client.d.ts +43 -0
- package/package.json +32 -9
- package/src/tui/.gitkeep +1 -0
- package/src/tui/__tests__/confirm-card.test.tsx +500 -0
- package/src/tui/__tests__/index.test.ts +407 -0
- package/src/tui/__tests__/modal-list.test.tsx +536 -0
- package/src/tui/__tests__/rpc-client.test.ts +507 -0
- package/src/tui/components/confirm-card.tsx +276 -0
- package/src/tui/components/modal-list.tsx +389 -0
- package/src/tui/components/row.tsx +41 -0
- package/src/tui/index.tsx +63 -0
- package/src/tui/rpc-client.ts +379 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# opencode-copilot-delegate
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e84f127: Prepare the package for an optional Copilot status TUI by adding server and TUI plugin metadata plus dedicated package exports.
|
|
8
|
+
|
|
9
|
+
## 0.9.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 80b549e: Improve runtime observability and fix a silent failure in completion notifications.
|
|
14
|
+
|
|
15
|
+
- `killProcessTree` now classifies fkill failures by probing the process group with `process.kill(-pid, 0)`. ESRCH is reported as an already-gone group and the failure is suppressed; alive or unknown states preserve the original throw with a more accurate warning. The probe targets `-pid` (the process group) rather than the leader so children leaking after a leader exit are no longer misclassified as benign.
|
|
16
|
+
- `notifyCompletion`'s fallback `client.app.log` call now uses the structured SDK shape (`{ body: { service, level, message } }`) and is wrapped in `try/catch` so synchronous SDK throws can no longer escape the documented "never throws" contract.
|
|
17
|
+
- All runtime warnings now share the `[copilot-delegate]` prefix across `kill-tree`, `orphan-reaper`, `pid-file`, `task-registry`, and `task-status`, making operator log filtering predictable.
|
|
18
|
+
- Internal contract documentation: `setStatus` and `writeChains` carry JSDoc covering terminal-state transitions and the per-file serialize chain.
|
|
19
|
+
|
|
20
|
+
- 4f2e8b5: Harden PID file and orphan-reaper state path handling against same-user symlink attacks.
|
|
21
|
+
|
|
22
|
+
- Use no-follow PID file opens for read and truncate paths so symlinked `.pids` files are rejected instead of read or truncated.
|
|
23
|
+
- Reject symlinked PID file parent directories before orphan reaping, cleanup, and plugin init state-directory creation so `orphans/` scans and cleanup do not follow attacker-controlled links.
|
|
24
|
+
|
|
3
25
|
## 0.8.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -21,6 +21,17 @@ When the subprocess completes, a `<system-reminder>` notification is injected in
|
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
### Optional: install the TUI half
|
|
25
|
+
|
|
26
|
+
The server plugin works by itself. To enable the `/copilot-status` terminal UI, also install the TUI half in OpenCode's TUI config:
|
|
27
|
+
|
|
28
|
+
```jsonc
|
|
29
|
+
// tui.jsonc
|
|
30
|
+
{
|
|
31
|
+
"plugin": ["opencode-copilot-delegate/tui"]
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
24
35
|
Requires the `copilot` CLI to be on `PATH`. Install via:
|
|
25
36
|
|
|
26
37
|
```sh
|
|
@@ -81,11 +92,13 @@ Returns `{ cancelled: boolean; was_running: boolean }`.
|
|
|
81
92
|
|
|
82
93
|
Task state is in-memory inside a single OpenCode process. Calling `copilot_output` from a different OpenCode process returns `{ status: 'unknown', error: 'task_id not found in this OpenCode process' }`. Cross-process sharing is deferred to a future version.
|
|
83
94
|
|
|
84
|
-
## Known Limitations
|
|
95
|
+
## Known Limitations
|
|
85
96
|
|
|
86
97
|
- **Orphaned subprocesses (mitigated since v0.2.0):** If OpenCode crashes mid-delegation, the `copilot` subprocess becomes orphaned. A PID-file reaper now scans `<XDG_STATE_HOME>/opencode-copilot-delegate/orphans/` at every plugin init, probes the owning plugin's liveness, and reaps subprocesses whose plugin has exited. A strict identity gate (kernel-tracked `comm` + start time) prevents PID-reuse misfires.
|
|
87
98
|
- **Prompt visibility in `ps`:** The `copilot` CLI accepts the prompt as a command-line argument, which means the full prompt text appears in `ps` output for any user on the host. This is an upstream Copilot CLI behavior. Avoid delegating prompts that contain secrets or PII; pass sensitive material via files, env vars, or `--secret-env-vars` instead.
|
|
88
99
|
- **No subprocess lifetime cap:** A hung `copilot` subprocess stays in the registry as `running` indefinitely. Cancel manually via `copilot_cancel`. A configurable timeout is planned for v1.x.
|
|
100
|
+
- **TUI half is opt-in:** The package ships server and TUI entrypoints. Existing server-only installs continue to register the three tools; `/copilot-status` only appears when the TUI entrypoint is installed.
|
|
101
|
+
- **RPC server cleanup is best-effort:** The server half exposes a localhost-only RPC listener for the TUI and writes a per-session authenticated port file under `<XDG_CACHE_HOME or ~/.cache>/opencode/copilot-delegate/`. OpenCode's server plugin API has no dispose hook today, so cleanup is tied to process exit signals and the orphan-reaper posture covers missed shutdowns.
|
|
89
102
|
|
|
90
103
|
## Versioning
|
|
91
104
|
|
package/dist/index.d.ts
CHANGED