@lmctl-ai/lmctl 0.2.38 → 0.2.40

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.
Files changed (202) hide show
  1. package/README.md +16 -0
  2. package/bin/lmbee +2 -0
  3. package/bin/lmscript +3 -0
  4. package/build-info.json +1 -0
  5. package/dist/cli/index.js +485 -460
  6. package/dist/cli/schema.sql +0 -169
  7. package/dist/cli/script.js +246 -246
  8. package/dist/lmbee.js +960 -0
  9. package/dist/lmscript.js +388 -0
  10. package/dist/public/app.js +379 -0
  11. package/dist/public/index.html +78 -0
  12. package/dist/public/styles.css +160 -0
  13. package/dist/schema.sql +455 -0
  14. package/dist/vendor-webui/index.html +18 -0
  15. package/dist/vendor-webui/local.js +231 -0
  16. package/dist/vendor-webui/styles.css +1852 -0
  17. package/package.json +11 -7
  18. package/dist/cli/batch.d.ts +0 -2
  19. package/dist/cli/busy-evidence.d.ts +0 -27
  20. package/dist/cli/chat-cycle.d.ts +0 -59
  21. package/dist/cli/chat-exec.d.ts +0 -91
  22. package/dist/cli/chat-policy.d.ts +0 -22
  23. package/dist/cli/chat.d.ts +0 -14
  24. package/dist/cli/code-resolver.d.ts +0 -8
  25. package/dist/cli/common.d.ts +0 -57
  26. package/dist/cli/context.d.ts +0 -12
  27. package/dist/cli/cost.d.ts +0 -2
  28. package/dist/cli/export.d.ts +0 -2
  29. package/dist/cli/hello.d.ts +0 -10
  30. package/dist/cli/index.d.ts +0 -3
  31. package/dist/cli/infra.d.ts +0 -78
  32. package/dist/cli/init.d.ts +0 -8
  33. package/dist/cli/intent-input.d.ts +0 -16
  34. package/dist/cli/intent-match.d.ts +0 -30
  35. package/dist/cli/intent-sessions.d.ts +0 -24
  36. package/dist/cli/intent-team.d.ts +0 -25
  37. package/dist/cli/intent.d.ts +0 -22
  38. package/dist/cli/ls.d.ts +0 -2
  39. package/dist/cli/mailbox-cli.d.ts +0 -6
  40. package/dist/cli/managed.d.ts +0 -62
  41. package/dist/cli/mcp-install.d.ts +0 -23
  42. package/dist/cli/mcp.d.ts +0 -2
  43. package/dist/cli/model.d.ts +0 -21
  44. package/dist/cli/paths.d.ts +0 -50
  45. package/dist/cli/plan-wizard.d.ts +0 -42
  46. package/dist/cli/plan.d.ts +0 -20
  47. package/dist/cli/queue-delivery.d.ts +0 -122
  48. package/dist/cli/quickrun.d.ts +0 -14
  49. package/dist/cli/ratelimit.d.ts +0 -2
  50. package/dist/cli/remote-fetch.d.ts +0 -7
  51. package/dist/cli/run-queries.d.ts +0 -82
  52. package/dist/cli/running.d.ts +0 -5
  53. package/dist/cli/save-script.d.ts +0 -41
  54. package/dist/cli/script.d.ts +0 -6
  55. package/dist/cli/seed-flight.d.ts +0 -2
  56. package/dist/cli/self-identity.d.ts +0 -25
  57. package/dist/cli/session-idle.d.ts +0 -118
  58. package/dist/cli/status.d.ts +0 -22
  59. package/dist/cli/tail.d.ts +0 -18
  60. package/dist/cli/target-resolver.d.ts +0 -139
  61. package/dist/cli/team-status.d.ts +0 -91
  62. package/dist/cli/teamfile-compat.d.ts +0 -116
  63. package/dist/cli/teamfile-store.d.ts +0 -18
  64. package/dist/cli/teamfile-template.d.ts +0 -47
  65. package/dist/cli/template-env.d.ts +0 -25
  66. package/dist/cli/terminal-lock.d.ts +0 -25
  67. package/dist/cli/terminal.d.ts +0 -23
  68. package/dist/cli/time-filter.d.ts +0 -10
  69. package/dist/cli/update-notifier.d.ts +0 -11
  70. package/dist/cli/version-util.d.ts +0 -23
  71. package/dist/config/seed_templates.d.ts +0 -1
  72. package/dist/db/backfill-event-log.d.ts +0 -26
  73. package/dist/db/delegation.d.ts +0 -37
  74. package/dist/db/escalation_vocab.d.ts +0 -45
  75. package/dist/db/event-log.d.ts +0 -40
  76. package/dist/db/index.d.ts +0 -1213
  77. package/dist/db/inflight-acquire.d.ts +0 -70
  78. package/dist/db/invocation-event-projections.d.ts +0 -65
  79. package/dist/db/ledger-identity.test.d.ts +0 -1
  80. package/dist/db/live-event-projections.d.ts +0 -92
  81. package/dist/db/migrate.d.ts +0 -51
  82. package/dist/db/open-readonly.d.ts +0 -2
  83. package/dist/db/process-liveness.d.ts +0 -37
  84. package/dist/db/sqlite.d.ts +0 -53
  85. package/dist/db/sqlite.test.d.ts +0 -1
  86. package/dist/db/terminal-lock.d.ts +0 -14
  87. package/dist/db/tracked-invocation-reconcile.d.ts +0 -52
  88. package/dist/db/tracked-invocation.d.ts +0 -116
  89. package/dist/mcp/dispatch.d.ts +0 -45
  90. package/dist/mcp/mediation.d.ts +0 -128
  91. package/dist/mcp/path-warning.d.ts +0 -7
  92. package/dist/mcp/server.d.ts +0 -63
  93. package/dist/mcp/tools.d.ts +0 -24
  94. package/dist/providers/adapter.d.ts +0 -271
  95. package/dist/providers/adapters/agy-adapter.d.ts +0 -18
  96. package/dist/providers/adapters/claude-adapter.d.ts +0 -20
  97. package/dist/providers/adapters/codex-adapter.d.ts +0 -22
  98. package/dist/providers/adapters/copilot-adapter.d.ts +0 -16
  99. package/dist/providers/adapters/dsh-adapter.d.ts +0 -89
  100. package/dist/providers/adapters/gemini-adapter.d.ts +0 -44
  101. package/dist/providers/adapters/hermes-adapter.d.ts +0 -71
  102. package/dist/providers/adapters/index.d.ts +0 -35
  103. package/dist/providers/adapters/kimi-adapter.d.ts +0 -16
  104. package/dist/providers/adapters/lmplayer-adapter.d.ts +0 -14
  105. package/dist/providers/adapters/opencode-adapter.d.ts +0 -11
  106. package/dist/providers/adapters/pi-adapter.d.ts +0 -17
  107. package/dist/providers/adapters/print-turn.d.ts +0 -29
  108. package/dist/providers/adapters/qwen-adapter.d.ts +0 -11
  109. package/dist/providers/agy.d.ts +0 -32
  110. package/dist/providers/base-adapter.d.ts +0 -110
  111. package/dist/providers/base.d.ts +0 -12
  112. package/dist/providers/binary-check.d.ts +0 -102
  113. package/dist/providers/bundle.d.ts +0 -124
  114. package/dist/providers/claude-mock.d.ts +0 -90
  115. package/dist/providers/claude.d.ts +0 -21
  116. package/dist/providers/codex-config.d.ts +0 -15
  117. package/dist/providers/codex.d.ts +0 -25
  118. package/dist/providers/config/init-config.d.ts +0 -59
  119. package/dist/providers/config/init-edit.d.ts +0 -3
  120. package/dist/providers/config/init-file.d.ts +0 -20
  121. package/dist/providers/config/init-write.d.ts +0 -2
  122. package/dist/providers/config/model-selection-lint.d.ts +0 -70
  123. package/dist/providers/config/team-config.d.ts +0 -184
  124. package/dist/providers/config/types.d.ts +0 -146
  125. package/dist/providers/config/user-config.d.ts +0 -88
  126. package/dist/providers/copilot.d.ts +0 -21
  127. package/dist/providers/debug.d.ts +0 -128
  128. package/dist/providers/dsh-sidecar.d.ts +0 -65
  129. package/dist/providers/dsh-zstd.d.ts +0 -27
  130. package/dist/providers/dsh.d.ts +0 -37
  131. package/dist/providers/frontmatter.d.ts +0 -46
  132. package/dist/providers/gemini-session-reader.d.ts +0 -151
  133. package/dist/providers/gemini.d.ts +0 -39
  134. package/dist/providers/hermes.d.ts +0 -90
  135. package/dist/providers/index.d.ts +0 -423
  136. package/dist/providers/kimi.d.ts +0 -37
  137. package/dist/providers/model-catalog.d.ts +0 -145
  138. package/dist/providers/model-suggestions.d.ts +0 -4
  139. package/dist/providers/one-shot-timeout.d.ts +0 -1
  140. package/dist/providers/opencode-config.d.ts +0 -62
  141. package/dist/providers/opencode.d.ts +0 -40
  142. package/dist/providers/parsers/acp.d.ts +0 -71
  143. package/dist/providers/parsers/codex-app-server.d.ts +0 -60
  144. package/dist/providers/parsers/stream-json.d.ts +0 -57
  145. package/dist/providers/passive-readers/agy.d.ts +0 -155
  146. package/dist/providers/passive-readers/copilot.d.ts +0 -173
  147. package/dist/providers/passive-readers/dsh.d.ts +0 -34
  148. package/dist/providers/passive-readers/kimi.d.ts +0 -44
  149. package/dist/providers/passive-readers/opencode.d.ts +0 -89
  150. package/dist/providers/passive-readers/qwen.d.ts +0 -151
  151. package/dist/providers/passive-readers/shared.d.ts +0 -138
  152. package/dist/providers/passive-session-reader.d.ts +0 -188
  153. package/dist/providers/path-utils.d.ts +0 -1
  154. package/dist/providers/pi.d.ts +0 -32
  155. package/dist/providers/pricing.d.ts +0 -107
  156. package/dist/providers/qwen.d.ts +0 -22
  157. package/dist/providers/ratelimit/agy.d.ts +0 -22
  158. package/dist/providers/ratelimit/claude-auth.d.ts +0 -13
  159. package/dist/providers/ratelimit/claude.d.ts +0 -6
  160. package/dist/providers/ratelimit/codex.d.ts +0 -7
  161. package/dist/providers/ratelimit/kimi-auth.d.ts +0 -15
  162. package/dist/providers/ratelimit/kimi.d.ts +0 -6
  163. package/dist/providers/ratelimit/schema.d.ts +0 -28
  164. package/dist/providers/ratelimit-readings.d.ts +0 -19
  165. package/dist/providers/registry.d.ts +0 -31
  166. package/dist/providers/resume.d.ts +0 -43
  167. package/dist/providers/seed-instruction.d.ts +0 -3
  168. package/dist/providers/self-session-env.d.ts +0 -21
  169. package/dist/providers/session-limit.d.ts +0 -9
  170. package/dist/providers/strip-ansi.d.ts +0 -5
  171. package/dist/providers/transport-errors.d.ts +0 -94
  172. package/dist/providers/transport-lifecycle.d.ts +0 -63
  173. package/dist/providers/transport-wrappers.d.ts +0 -110
  174. package/dist/providers/transports/acp-profiles/config-option-step.d.ts +0 -24
  175. package/dist/providers/transports/acp-profiles/copilot.d.ts +0 -12
  176. package/dist/providers/transports/acp-profiles/gemini.d.ts +0 -22
  177. package/dist/providers/transports/acp-profiles/hermes.d.ts +0 -27
  178. package/dist/providers/transports/acp-profiles/index.d.ts +0 -19
  179. package/dist/providers/transports/acp-profiles/kimi.d.ts +0 -24
  180. package/dist/providers/transports/acp-profiles/opencode.d.ts +0 -26
  181. package/dist/providers/transports/acp-profiles/types.d.ts +0 -258
  182. package/dist/providers/transports/acp-rpc.d.ts +0 -18
  183. package/dist/providers/transports/acp.d.ts +0 -217
  184. package/dist/providers/transports/codex-app-server.d.ts +0 -190
  185. package/dist/providers/transports/hold-open.d.ts +0 -120
  186. package/dist/providers/transports/manager.d.ts +0 -21
  187. package/dist/providers/transports/stream-json.d.ts +0 -162
  188. package/dist/providers/transports/types.d.ts +0 -56
  189. package/dist/providers/types.d.ts +0 -154
  190. package/dist/providers/yolo-contract.d.ts +0 -131
  191. package/dist/script/adapter.d.ts +0 -107
  192. package/dist/script/batch-script.d.ts +0 -7
  193. package/dist/script/index.d.ts +0 -3
  194. package/dist/script/init-environment.d.ts +0 -8
  195. package/dist/script/lmbee-module.d.ts +0 -2
  196. package/dist/script/lmscript.d.ts +0 -647
  197. package/dist/shared/policy.d.ts +0 -74
  198. package/dist/shared-lib/db.d.ts +0 -25
  199. package/dist/shared-lib/passive-session-reader.d.ts +0 -2
  200. package/dist/shared-lib/provider-parse.d.ts +0 -6
  201. package/dist/templates/basedir.d.ts +0 -52
  202. package/dist/uri/lmctl_uri.d.ts +0 -38
@@ -1,94 +0,0 @@
1
- /**
2
- * Named error taxonomy for the transport layer (claude stream-json,
3
- * codex app-server, ACP). Replaces the prior `new Error("RPC error: ...")`
4
- * string-dump pattern with typed classes that preserve structured fields
5
- * so downstream callers can branch on numeric codes / inspect the raw
6
- * line / read the original cause without re-parsing the message.
7
- *
8
- * Shape mirrors the claude-agent-sdk-python error hierarchy
9
- * (CLIConnectionError / CLINotFoundError / ProcessError /
10
- * CLIJSONDecodeError / MessageParseError) flagged in
11
- * `tasks/83-claude-sdk-research.md` §4 takeaway 3, and the
12
- * `createRpcError` helper that the codex-app-server transport
13
- * adopted from openai/codex-plugin-cc (research:
14
- * `tasks/83-codex-transport-compare.md`).
15
- *
16
- * All classes extend `TransportError`, which extends `Error` — every
17
- * instance still satisfies `instanceof Error` so existing
18
- * `try/catch (e: unknown)` sites continue to work without changes.
19
- * The added discriminator is `instanceof TransportError` (and the
20
- * specific subclasses) for callers who want the structured fields.
21
- *
22
- * The existing `TurnAbortError` (in `base-adapter.ts`) is a separate
23
- * concern — user-/idle-/provider-cancel reasons surfaced by the
24
- * higher-level chat orchestrator — and lives outside this taxonomy.
25
- */
26
- /**
27
- * Base class for transport-layer failures. Carries `name` set to the
28
- * concrete subclass name (so error messages on uncaught throws
29
- * identify the subtype) and propagates `cause` per the standard
30
- * Error options shape.
31
- */
32
- export declare class TransportError extends Error {
33
- constructor(message: string, options?: {
34
- cause?: unknown;
35
- });
36
- }
37
- /**
38
- * Failed to establish or maintain the subprocess/stdio channel.
39
- * Examples: `spawn` ENOENT, `spawn` permission denied, write to
40
- * already-closed stdin during a transport-level shutdown.
41
- */
42
- export declare class TransportConnectionError extends TransportError {
43
- }
44
- /**
45
- * The subprocess exited unexpectedly — either before the protocol
46
- * reached its terminal state, or with a non-zero exit code that the
47
- * transport considers an error condition.
48
- *
49
- * `exitCode` is `null` when the child was killed by signal without an
50
- * explicit exit code; `signal` carries the POSIX signal name in that
51
- * case (e.g. `"SIGKILL"`). `stderr` is best-effort — the transport
52
- * captures the tail of the child's stderr if it was piped.
53
- */
54
- export declare class TransportProcessError extends TransportError {
55
- readonly exitCode: number | null;
56
- readonly signal: string | null;
57
- readonly stderr?: string | undefined;
58
- constructor(message: string, exitCode: number | null, signal?: string | null, stderr?: string | undefined);
59
- }
60
- /**
61
- * A line read off the wire could not be JSON-parsed. The raw `line`
62
- * is preserved (truncated to a sane length by the caller before
63
- * construction if it could be very large) so investigators can see
64
- * exactly what the transport rejected. `cause` is the original
65
- * `SyntaxError` from `JSON.parse`.
66
- */
67
- export declare class TransportJsonError extends TransportError {
68
- readonly line: string;
69
- constructor(message: string, line: string, cause: unknown);
70
- }
71
- /**
72
- * The peer responded with a JSON-RPC error object. `rpcCode` is the
73
- * numeric code from the JSON-RPC `error.code` field when present, and
74
- * `rpcData` carries the entire `error` payload (including `message`,
75
- * `data`, and any provider-specific fields like
76
- * codex-plugin-cc's broker-busy sentinel `-32001`).
77
- *
78
- * Callers who care about specific codes branch on `err.rpcCode`;
79
- * generic catchers see a plain `Error` with a human-readable message.
80
- */
81
- export declare class TransportRpcError extends TransportError {
82
- readonly rpcCode?: number;
83
- readonly rpcData?: unknown;
84
- constructor(message: string, rpcCode?: number, rpcData?: unknown);
85
- }
86
- /**
87
- * Convenience constructor that mirrors the prior `createRpcError`
88
- * helper signature in `codex-app-server.ts`: pass the human message
89
- * plus the raw JSON-RPC error object, and the helper extracts
90
- * `code` (if numeric) and stores the whole object as `rpcData`.
91
- *
92
- * This is the migration target for `createRpcError` callers.
93
- */
94
- export declare function transportRpcErrorFromResponse(message: string, errorObj?: unknown): TransportRpcError;
@@ -1,63 +0,0 @@
1
- /**
2
- * Graceful-shutdown ladder for transport child processes.
3
- *
4
- * Replaces the prior `child.kill()` (synchronous, hard SIGTERM, no
5
- * grace) pattern across the claude / codex / ACP transports. The bug
6
- * this fixes is documented in the claude-agent-sdk-python transport
7
- * (`subprocess_cli.py:548-568` and the linked issue #625): when
8
- * `claude` is killed mid-flush its session JSONL loses the last
9
- * assistant message. The same risk class applies to any provider CLI
10
- * that persists state on shutdown — codex (`thread/*.jsonl`),
11
- * opencode (`opencode.db`), gemini (`~/.gemini/tmp/.../chats/`).
12
- *
13
- * Ladder:
14
- * 1. (optional) close stdin so the child observes EOF.
15
- * 2. wait `softDelayMs` for the child to exit on its own.
16
- * 3. send SIGTERM (or `taskkill /T /F /PID <pid>` on Windows) and
17
- * wait `killDelayMs`.
18
- * 4. send SIGKILL (no-op on Windows, taskkill is already hard).
19
- * 5. wait up to a fixed final grace for the exit event before
20
- * returning.
21
- *
22
- * Returns a `TerminateResult` describing which path actually ended
23
- * the child and total elapsed wall-clock — useful for tests and for
24
- * future telemetry on shutdown latency.
25
- */
26
- import type { ChildProcess } from "node:child_process";
27
- export interface TerminateOptions {
28
- /** Call `child.stdin?.end()` first to signal clean EOF. Default: true. */
29
- stdinEnd?: boolean;
30
- /** Wait ms for child to exit naturally after stdin.end. Default: 5000. */
31
- softDelayMs?: number;
32
- /** Wait ms after SIGTERM before SIGKILL. Default: 5000. */
33
- killDelayMs?: number;
34
- /**
35
- * Test seam — replace the Windows process-tree killer
36
- * (`taskkill /T /F /PID <pid>`) with a no-op or recorder. Defaults
37
- * to a real `spawnSync("taskkill", ...)` call on Windows; ignored
38
- * on Unix.
39
- */
40
- runTaskkill?: (pid: number) => void;
41
- /** Test seam — override `process.platform`. */
42
- platform?: NodeJS.Platform;
43
- }
44
- /** Which step in the ladder actually finished the child. */
45
- export type TerminateSignal = "natural" | "stdin" | "SIGTERM" | "SIGKILL" | "abandoned";
46
- export interface TerminateResult {
47
- signal: TerminateSignal;
48
- elapsedMs: number;
49
- }
50
- /**
51
- * Gracefully terminate a transport child process.
52
- *
53
- * Safe to call on an already-exited child (returns immediately with
54
- * `signal: "natural"`). Safe to call multiple times concurrently
55
- * — each call observes the same exit event independently.
56
- *
57
- * Errors are swallowed deliberately: this function is meant to be
58
- * called from cleanup paths (abort handlers, IIFE catch blocks,
59
- * timeout firings) where re-throwing would mask the original
60
- * failure. Failures during termination are reflected in the returned
61
- * `TerminateResult.signal` (`"abandoned"` is the only failure shape).
62
- */
63
- export declare function terminateGracefully(child: ChildProcess, opts?: TerminateOptions): Promise<TerminateResult>;
@@ -1,110 +0,0 @@
1
- /**
2
- * Transport wrappers for use by provider adapters.
3
- * These wrap the existing transport modules, mapping their result types
4
- * to the adapter's TurnResult.
5
- *
6
- * Each wrapper also classifies the transport's native event stream into
7
- * normalized ProgressEvents (see adapter.ts) so that downstream consumers
8
- * (idle timer, stderr printer) have a single format to deal with.
9
- */
10
- import { type AcpMode } from "./transports/acp.js";
11
- import type { ProgressEvent, TurnOptions, TurnResult } from "./adapter.js";
12
- import type { BundleSession, BundleSessionOpenOptions } from "./bundle.js";
13
- /**
14
- * Translate one stream-json event into zero or more ProgressEvents.
15
- * Stream-json uses Claude's native message format:
16
- * - {"type":"system","subtype":"init",...}
17
- * - {"type":"assistant","message":{"content":[{type:"text"|"tool_use"|"thinking"...}]}}
18
- * - {"type":"user","message":{"content":[{type:"tool_result",...}]}}
19
- * - {"type":"result",...}
20
- */
21
- /**
22
- * Stateful factory for classifyStreamJsonEvent. The returned closure
23
- * carries a per-turn id→startMs Map that lets it populate `elapsedMs`
24
- * on tool_result events by correlating against the matching tool_use
25
- * (Claude stream-json doesn't supply duration directly).
26
- *
27
- * Production callers (`streamJsonTurn`) instantiate ONCE per turn and
28
- * reuse across all events. Unit tests that exercise a single event in
29
- * isolation can keep using the bare `classifyStreamJsonEvent` free
30
- * function below — they just won't get elapsedMs populated, which is
31
- * fine because there's no matching pair to compute it from.
32
- */
33
- export declare function makeStreamJsonClassifier(): (event: Record<string, unknown>, emit: (e: ProgressEvent) => void) => void;
34
- export declare function classifyStreamJsonEvent(event: Record<string, unknown>, emit: (e: ProgressEvent) => void): void;
35
- export declare function streamJsonTurn(prompt: string, opts: TurnOptions & {
36
- binary: string;
37
- }): Promise<TurnResult>;
38
- /**
39
- * Open a persistent stream-json bundle session (batch bundle mode)
40
- * for the claude/qwen adapters' `openSession`. Bundle resume is strict:
41
- * the session file must exist and its header must carry the requested id.
42
- */
43
- export declare function openStreamJsonBundleSession(opts: BundleSessionOpenOptions & {
44
- binary: string;
45
- }): Promise<BundleSession>;
46
- /**
47
- * Classify ACP session/update notifications. ACP wraps everything in
48
- * {"method":"session/update","params":{"update":{"sessionUpdate":"<kind>",...}}}
49
- *
50
- * Common sessionUpdate kinds (per the ACP spec used by Zed and friends):
51
- * - agent_message_chunk → text (already streamed via onDelta)
52
- * - agent_thought_chunk → thinking
53
- * - tool_call → tool_use
54
- * - tool_call_update → tool_result (completed/failed), other "running…" (in_progress)
55
- * - plan → other
56
- */
57
- /**
58
- * Stateful factory for classifyAcpEvent. Same shape and rationale as
59
- * makeStreamJsonClassifier — see that doc. Carries per-turn id→startMs
60
- * for the tool_call → tool_call_update correlation that drives
61
- * `elapsedMs` on tool_result events.
62
- */
63
- export declare function makeAcpClassifier(): (event: Record<string, unknown>, emit: (e: ProgressEvent) => void) => void;
64
- export declare function classifyAcpEvent(event: Record<string, unknown>, emit: (e: ProgressEvent) => void): void;
65
- export declare function acpTurn(prompt: string, opts: TurnOptions & {
66
- binary: string;
67
- acpTool?: string;
68
- acpMode?: AcpMode;
69
- }): Promise<TurnResult>;
70
- /**
71
- * Open a persistent ACP bundle session (batch bundle mode) for a
72
- * provider adapter's `openSession` implementation. `acpTool`/`acpMode`
73
- * mirror `acpTurn`; the lifecycle contract is in
74
- * `src/providers/bundle.ts` and the engine in `transports/acp.ts`'s
75
- * `openAcpSession`.
76
- *
77
- * Bundle resume is ALWAYS strict: requireResume is forced and the loaded
78
- * session id must equal the requested id exactly.
79
- */
80
- export declare function openAcpBundleSession(opts: BundleSessionOpenOptions & {
81
- binary: string;
82
- acpTool?: string;
83
- acpMode?: AcpMode;
84
- }): Promise<BundleSession>;
85
- /**
86
- * Classify Codex app-server JSON-RPC notifications.
87
- *
88
- * Per codex-rs/app-server/README.md (Turn events / Items), the per-item
89
- * lifecycle is always: `item/started` → zero or more item-specific deltas
90
- * → `item/completed`. Items are a tagged union (`item.type`) including
91
- * `commandExecution`, `fileChange`, `mcpToolCall`, `webSearch`, `reasoning`,
92
- * `agentMessage`, etc.
93
- *
94
- * Item-specific deltas we care about:
95
- * - item/agentMessage/delta → text (already streamed via onDelta)
96
- * - item/reasoning/summaryTextDelta → thinking
97
- * - item/reasoning/textDelta → thinking
98
- * - item/commandExecution/outputDelta → text (suppressed; lifecycle covers it)
99
- */
100
- export declare function classifyCodexEvent(event: Record<string, unknown>, emit: (e: ProgressEvent) => void): void;
101
- export declare function codexAppServerTurn(prompt: string, opts: TurnOptions & {
102
- binary: string;
103
- }): Promise<TurnResult>;
104
- /**
105
- * Open a persistent codex app-server bundle session (batch bundle
106
- * mode) for the codex adapter's `openSession`. Bundle resume is
107
- * strict: thread/resume must succeed and return the exact requested
108
- * thread id; the thread/start fallback is disabled in bundle mode.
109
- */
110
- export declare function openCodexBundleSession(opts: BundleSessionOpenOptions): Promise<BundleSession>;
@@ -1,24 +0,0 @@
1
- /**
2
- * Shared `session/set_config_option` step factory for the profiles whose
3
- * per-session model/effort surface is an ACP config option (opencode, kimi).
4
- *
5
- * The failure semantics are NON-FATAL by contract (task #232): the turn
6
- * proceeds with whatever config was already active, and the drop is
7
- * recorded on all three channels — stderr line, `acp_config_option_failed`
8
- * errorLog record, and a warnings-channel entry that lands on
9
- * `AcpResult.warnings`.
10
- *
11
- * "_failed", not "_rejected": the driver's catch wraps `sendRpc`, so it
12
- * also fires on transport disconnect, not only on the provider rejecting
13
- * the value. Naming it "rejected" would conflate provider-validation noise
14
- * with channel failure — exactly the misreading these counts exist to
15
- * prevent.
16
- */
17
- import type { AcpSessionContext, AcpSessionStep } from "./types.js";
18
- export declare function setConfigOptionStep(opts: {
19
- id: string;
20
- provider: string;
21
- configId: string;
22
- /** The requested value; undefined ⇒ the step does not apply. */
23
- value: (ctx: AcpSessionContext) => string | undefined;
24
- }): AcpSessionStep;
@@ -1,12 +0,0 @@
1
- /**
2
- * Copilot ACP profile.
3
- *
4
- * Copilot's `--acp` mode has no plan-mode flag and no per-session model
5
- * selection surface (verified against copilot-cli 1.0.35). Both gaps are
6
- * surfaced once per spawn — a stderr line the user sees plus an
7
- * unconditional errorLog record fleet tooling can count — and the turn
8
- * proceeds on the yolo/default surface rather than hanging on permission
9
- * prompts it cannot answer.
10
- */
11
- import type { AcpProviderProfile } from "./types.js";
12
- export declare const copilotProfile: AcpProviderProfile;
@@ -1,22 +0,0 @@
1
- /**
2
- * Gemini ACP profile.
3
- *
4
- * Permission posture is argv-based: `-y` (yolo) works before or after
5
- * `--acp`, and the companion `--skip-trust` is passed unconditionally —
6
- * gemini's workspace-trust gate (~/.gemini/trustedFolders.json) downgrades
7
- * approval mode to "default" in untrusted folders, silently disarming
8
- * `-y`; `--skip-trust` is the per-invocation escape hatch (no-op in
9
- * already-trusted folders). Plan mode swaps the `-y` token for
10
- * `--approval-mode plan`, keeping companions intact.
11
- *
12
- * Caveat: gemini's `--approval-mode plan` only filters `write_file` by
13
- * workspace path — the agent can still escape via `run_shell_command`
14
- * (documented in yolo-contract.ts; a tighter sandbox is a follow-up).
15
- *
16
- * Gemini replays prior assistant chunks during `session/load` and
17
- * concatenates earlier image turns into the reply text; keeping only the
18
- * latest agent message is the output processor's job (parsers/acp.ts),
19
- * wired in via `isolateResult`.
20
- */
21
- import type { AcpProviderProfile } from "./types.js";
22
- export declare const geminiProfile: AcpProviderProfile;
@@ -1,27 +0,0 @@
1
- /**
2
- * Hermes (Hermes Agent) ACP profile.
3
- *
4
- * `hermes acp` IS the ACP stdio server (same launcher as the `hermes-acp`
5
- * console script); it takes no permission flag. The posture is two-part:
6
- *
7
- * 1. Shell gate: `HERMES_YOLO_MODE=1` on the process env (yolo mode only;
8
- * hermes REFUSES plan mode outright).
9
- * 2. Edit gate: ACP `session/set_mode` — Hermes's mode ladder
10
- * (`HermesACPAgent._MODES`, `acp_adapter/server.py:233-243`) governs
11
- * the file-EDIT approval gate, which `HERMES_YOLO_MODE` does NOT
12
- * approve. An unset mode leaves every edit waiting on a
13
- * `session/request_permission` round-trip lmctl cannot answer, so the
14
- * mode is applied after session/new|load, before the model, on EVERY
15
- * spawn (the mode lives on the in-memory session), FAIL-CLOSED.
16
- *
17
- * Model selection is `session/set_model` (also fail-closed), NOT
18
- * `session/set_config_option`: hermes's config-option handler stores an
19
- * unrecognized configId verbatim and applies nothing
20
- * (`acp_adapter/server.py:958-977`). Its model ids are the ENCODED
21
- * `provider:model` form it advertises in session/new
22
- * (`acp_adapter/model_catalog.py:146-152`) — a bare model name resolves
23
- * the wrong provider. An unchanged model is not re-set (avoids rebuilding
24
- * the Hermes agent).
25
- */
26
- import type { AcpProviderProfile } from "./types.js";
27
- export declare const hermesProfile: AcpProviderProfile;
@@ -1,19 +0,0 @@
1
- /**
2
- * ACP provider profile registry.
3
- *
4
- * The generic ACP engine (transports/acp.ts) looks up the profile for a
5
- * tool here; everything provider-specific lives in the profile modules.
6
- */
7
- import type { AcpProviderProfile } from "./types.js";
8
- export declare function acpProfileForTool(tool: string): AcpProviderProfile | undefined;
9
- /**
10
- * Read-only view of the per-profile `{ binary, baseArgs }` table for
11
- * tests that pin the per-provider argv shape (e.g. flag-position
12
- * regression checks). Production code reads the profiles directly; this
13
- * alias exists only so the test suite can import a frozen view without
14
- * making the table mutable from the outside.
15
- */
16
- export declare const ACP_TOOLS_FOR_TEST: Readonly<Record<string, Readonly<{
17
- binary: string;
18
- args: readonly string[];
19
- }>>>;
@@ -1,24 +0,0 @@
1
- /**
2
- * Kimi ACP profile.
3
- *
4
- * Kimi's ACP subcommand has no argv permission flag: the posture is
5
- * protocol-level (`session/set_config_option` with configId "mode"),
6
- * applied BEFORE any model config and BEFORE the first prompt, and it is
7
- * FAIL-CLOSED — lmctl cannot answer `session/request_permission`, so a
8
- * rejected mode change would leave the subprocess hung on its first tool
9
- * call. Ordering and policy are the `sessionSetup` data below.
10
- *
11
- * Kimi 0.28.x exposes only an on/off thinking toggle, so a declared
12
- * `effort=` cannot be honored here and is silently ignored.
13
- */
14
- import type { AcpProviderProfile } from "./types.js";
15
- export declare function detectKimiRuntimeDead(resultText: string): string | null;
16
- /**
17
- * Kimi logs a multi-line `Error handling notification … -32601 Method not
18
- * found` block for the mandatory `notifications/initialized` notification
19
- * on every spawn. It is routine, not a failure — strip exactly that block
20
- * (and only that block) from the stderr tail attached to a no-result
21
- * error report.
22
- */
23
- export declare function filterKimiExpectedStderr(stderr: string): string;
24
- export declare const kimiProfile: AcpProviderProfile;
@@ -1,26 +0,0 @@
1
- /**
2
- * OpenCode ACP profile.
3
- *
4
- * OpenCode's ACP mode rejects every permission-bypass argv flag
5
- * (`--dangerously-skip-permissions` is a `run`-subcommand-only flag,
6
- * verified empirically). YOLO is satisfied via
7
- * `<cwd>/.opencode/opencode.json` carrying `"permission": "allow"`,
8
- * installed defensively before every chat spawn (preSpawn) so even
9
- * pre-fix-seeded teams get the YOLO key without a re-create. The install
10
- * no longer writes lmctl MCP entries.
11
- *
12
- * The profile also owns `probeOpenCodeAcpConfig` — a separate probe entry
13
- * point (purpose "probe") used by lint/seed via teamfile-compat.ts. It
14
- * intentionally differs from the chat spawn: no runtime permission-config
15
- * install (initialize/session creation and config-option validation
16
- * cannot request tools or incur an LLM call), and a rejected model/effort
17
- * option is reported as probe evidence rather than absorbed as a warning.
18
- */
19
- import type { AcpProviderProfile, OpenCodeAcpConfigProbeOptions, OpenCodeAcpConfigProbeResult } from "./types.js";
20
- export declare const openCodeProfile: AcpProviderProfile;
21
- /**
22
- * Verify opencode's live per-session model/effort contract without prompting.
23
- * No project permission config is installed: initialize/session creation and
24
- * config-option validation cannot request tools or incur an LLM call.
25
- */
26
- export declare function probeOpenCodeAcpConfig(opts: OpenCodeAcpConfigProbeOptions): Promise<OpenCodeAcpConfigProbeResult>;