zcode-acp-server 0.11.9 → 0.14.1
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/README.md +144 -32
- package/dist/backend/client.d.ts.map +1 -1
- package/dist/backend/client.js +10 -0
- package/dist/backend/client.js.map +1 -1
- package/dist/backend/listener.d.ts.map +1 -1
- package/dist/backend/listener.js +6 -5
- package/dist/backend/listener.js.map +1 -1
- package/dist/backend/resolve.d.ts.map +1 -1
- package/dist/backend/resolve.js +35 -1
- package/dist/backend/resolve.js.map +1 -1
- package/dist/bin/hub.d.ts +3 -3
- package/dist/bin/hub.d.ts.map +1 -1
- package/dist/bin/hub.js +22 -12
- package/dist/bin/hub.js.map +1 -1
- package/dist/bin/quota.d.ts +14 -6
- package/dist/bin/quota.d.ts.map +1 -1
- package/dist/bin/quota.js +27 -19
- package/dist/bin/quota.js.map +1 -1
- package/dist/cli.d.ts +38 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +129 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/runtime-model.d.ts +10 -10
- package/dist/config/runtime-model.js +10 -10
- package/dist/handlers/account.d.ts +1 -1
- package/dist/handlers/account.js +1 -1
- package/dist/handlers/dispatch.d.ts.map +1 -1
- package/dist/handlers/dispatch.js +42 -36
- package/dist/handlers/dispatch.js.map +1 -1
- package/dist/handlers/io.d.ts.map +1 -1
- package/dist/handlers/io.js +19 -13
- package/dist/handlers/io.js.map +1 -1
- package/dist/handlers/session.d.ts +58 -4
- package/dist/handlers/session.d.ts.map +1 -1
- package/dist/handlers/session.js +288 -56
- package/dist/handlers/session.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -8
- package/dist/index.js.map +1 -1
- package/dist/interaction/adapter.d.ts +1 -0
- package/dist/interaction/adapter.d.ts.map +1 -1
- package/dist/interaction/adapter.js +5 -1
- package/dist/interaction/adapter.js.map +1 -1
- package/dist/quota/color.d.ts +4 -4
- package/dist/quota/color.d.ts.map +1 -1
- package/dist/quota/color.js +7 -5
- package/dist/quota/color.js.map +1 -1
- package/dist/quota/combined.d.ts +1 -1
- package/dist/quota/combined.js +4 -4
- package/dist/quota/combined.js.map +1 -1
- package/dist/quota/format.d.ts +1 -1
- package/dist/quota/opencode-go/format.d.ts.map +1 -1
- package/dist/quota/opencode-go/format.js +5 -1
- package/dist/quota/opencode-go/format.js.map +1 -1
- package/dist/quota/opencode-go/index.d.ts +1 -1
- package/dist/quota/opencode-go/index.js +1 -1
- package/dist/quota/opencode-go/types.d.ts +1 -1
- package/dist/quota/opencode-go/types.js +1 -1
- package/dist/quota/rounding.d.ts +8 -0
- package/dist/quota/rounding.d.ts.map +1 -0
- package/dist/quota/rounding.js +10 -0
- package/dist/quota/rounding.js.map +1 -0
- package/dist/remote/config.d.ts +1 -1
- package/dist/remote/config.d.ts.map +1 -1
- package/dist/remote/config.js +1 -1
- package/dist/remote/config.js.map +1 -1
- package/dist/remote/endpoint.d.ts +1 -1
- package/dist/remote/endpoint.js +1 -1
- package/dist/remote/hub-server.d.ts +1 -1
- package/dist/remote/hub-server.js +1 -1
- package/dist/repl/App.d.ts +108 -0
- package/dist/repl/App.d.ts.map +1 -0
- package/dist/repl/App.js +706 -0
- package/dist/repl/App.js.map +1 -0
- package/dist/repl/history.d.ts +25 -0
- package/dist/repl/history.d.ts.map +1 -0
- package/dist/repl/history.js +73 -0
- package/dist/repl/history.js.map +1 -0
- package/dist/repl/input-buffer.d.ts +77 -0
- package/dist/repl/input-buffer.d.ts.map +1 -0
- package/dist/repl/input-buffer.js +174 -0
- package/dist/repl/input-buffer.js.map +1 -0
- package/dist/repl/model.d.ts +275 -0
- package/dist/repl/model.d.ts.map +1 -0
- package/dist/repl/model.js +596 -0
- package/dist/repl/model.js.map +1 -0
- package/dist/repl/mouse.d.ts +49 -0
- package/dist/repl/mouse.d.ts.map +1 -0
- package/dist/repl/mouse.js +165 -0
- package/dist/repl/mouse.js.map +1 -0
- package/dist/repl/run.d.ts +12 -0
- package/dist/repl/run.d.ts.map +1 -0
- package/dist/repl/run.js +902 -0
- package/dist/repl/run.js.map +1 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +31 -3
- package/dist/server.js.map +1 -1
- package/dist/translators/tool-helpers.d.ts.map +1 -1
- package/dist/translators/tool-helpers.js +3 -0
- package/dist/translators/tool-helpers.js.map +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/BACKLOG.md +40 -21
- package/docs/REMOTE-CLIENTS.md +2 -2
- package/docs/TROUBLESHOOTING.md +1 -1
- package/docs/adr/0007-unified-cli-entry-and-bin-pruning.md +40 -0
- package/package.json +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/quota/opencode-go/format.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/quota/opencode-go/format.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAS7D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASlD;AAOD,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,SAAS,WAAW,EAAE,EAC/B,GAAG,GAAE,MAAmB,EACxB,KAAK,UAAQ,GACZ,eAAe,CAwCjB"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { pickOverlay, renderColorBar } from "../color.js";
|
|
10
10
|
import { formatResetTime, renderBar } from "../format.js";
|
|
11
|
+
import { roundTenth } from "../rounding.js";
|
|
11
12
|
/** Label + window-key metadata, in display order. */
|
|
12
13
|
const WINDOW_META = [
|
|
13
14
|
{ key: "rolling", label: "5h" },
|
|
@@ -78,9 +79,12 @@ export function formatGoSection(result, windows, now = Date.now(), color = false
|
|
|
78
79
|
return `${m.label.padEnd(5)} ${bar} · ${reset}`;
|
|
79
80
|
}
|
|
80
81
|
const bar = renderBar(w.usagePercent);
|
|
82
|
+
// The dashboard reports 0.1 steps (84.3); roundTenth caps the printed
|
|
83
|
+
// value there so raw floats never spill their full representation.
|
|
84
|
+
const pct = roundTenth(w.usagePercent);
|
|
81
85
|
// No leading indent — the bar lines align with GLM's so the two sections
|
|
82
86
|
// read as one card. The section header carries the ` Opencode Go` indent.
|
|
83
|
-
return `${m.label.padEnd(5)} ${bar} ${padPercent(
|
|
87
|
+
return `${m.label.padEnd(5)} ${bar} ${padPercent(pct)}% · ${reset}`;
|
|
84
88
|
});
|
|
85
89
|
return { header, body };
|
|
86
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/quota/opencode-go/format.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/quota/opencode-go/format.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,qDAAqD;AACrD,MAAM,WAAW,GAA+C;IAC9D,EAAE,GAAG,EAAE,SAAS,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AC;YACH,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,KAAK,EAAE,CAAC;QAClD,CAAC;QACD,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QACtC,sEAAsE;QACtE,mEAAmE;QACnE,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QACvC,yEAAyE;QACzE,0EAA0E;QAC1E,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,UAAU,CAAC,GAAG,CAAC,OAAO,KAAK,EAAE,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Opencode Go usage orchestration — the entry point used by the
|
|
3
|
-
* `zcode-quota` CLI.
|
|
3
|
+
* `zcode-acp quota` CLI.
|
|
4
4
|
*
|
|
5
5
|
* Flow: credentials (env + config file) → cache check → fetch → redirect/auth
|
|
6
6
|
* check → parse → cache write. Any thrown error degrades to `unavailable`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Opencode Go usage orchestration — the entry point used by the
|
|
3
|
-
* `zcode-quota` CLI.
|
|
3
|
+
* `zcode-acp quota` CLI.
|
|
4
4
|
*
|
|
5
5
|
* Flow: credentials (env + config file) → cache check → fetch → redirect/auth
|
|
6
6
|
* check → parse → cache write. Any thrown error degrades to `unavailable`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for the Opencode Go subscription usage feature.
|
|
3
3
|
*
|
|
4
|
-
* The `zcode-quota` CLI queries the opencode.ai web dashboard (there is no
|
|
4
|
+
* The `zcode-acp quota` CLI queries the opencode.ai web dashboard (there is no
|
|
5
5
|
* JSON API yet) by scraping the SolidJS SSR hydration payload embedded in
|
|
6
6
|
* `https://opencode.ai/workspace/<id>/go`. Usage is split into three windows:
|
|
7
7
|
* rolling (5h), weekly (7d), monthly (30d). Each window carries only a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for the Opencode Go subscription usage feature.
|
|
3
3
|
*
|
|
4
|
-
* The `zcode-quota` CLI queries the opencode.ai web dashboard (there is no
|
|
4
|
+
* The `zcode-acp quota` CLI queries the opencode.ai web dashboard (there is no
|
|
5
5
|
* JSON API yet) by scraping the SolidJS SSR hydration payload embedded in
|
|
6
6
|
* `https://opencode.ai/workspace/<id>/go`. Usage is split into three windows:
|
|
7
7
|
* rolling (5h), weekly (7d), monthly (30d). Each window carries only a
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared precision rule for quota percentage readouts: backends report usage
|
|
3
|
+
* in 0.1 steps (84.3), so cap the printed value at one fractional digit
|
|
4
|
+
* instead of letting raw floats spill their full representation. Callers own
|
|
5
|
+
* the surrounding rendering (bar overlay text vs padded table column).
|
|
6
|
+
*/
|
|
7
|
+
export declare function roundTenth(value: number): number;
|
|
8
|
+
//# sourceMappingURL=rounding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounding.d.ts","sourceRoot":"","sources":["../../src/quota/rounding.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared precision rule for quota percentage readouts: backends report usage
|
|
3
|
+
* in 0.1 steps (84.3), so cap the printed value at one fractional digit
|
|
4
|
+
* instead of letting raw floats spill their full representation. Callers own
|
|
5
|
+
* the surrounding rendering (bar overlay text vs padded table column).
|
|
6
|
+
*/
|
|
7
|
+
export function roundTenth(value) {
|
|
8
|
+
return Math.round(value * 10) / 10;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=rounding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounding.js","sourceRoot":"","sources":["../../src/quota/rounding.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;AACrC,CAAC"}
|
package/dist/remote/config.d.ts
CHANGED
|
@@ -27,6 +27,6 @@ export declare const DEFAULT_BRIDGE_PORT = 8378;
|
|
|
27
27
|
export declare const DEFAULT_HUB_HOST = "127.0.0.1";
|
|
28
28
|
/** Parse remote config; null = disabled (or misconfigured → warned). */
|
|
29
29
|
export declare function parseRemoteConfig(env?: NodeJS.ProcessEnv): RemoteConfig | null;
|
|
30
|
-
/** Parse hub-side config for the standalone `zcode-acp
|
|
30
|
+
/** Parse hub-side config for the standalone hub entry (`zcode-acp hub`). */
|
|
31
31
|
export declare function parseHubConfig(env?: NodeJS.ProcessEnv): RemoteConfig | null;
|
|
32
32
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/remote/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAY5C,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,YAAY,GAAG,IAAI,CAiB3F;AAED,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/remote/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAY5C,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,YAAY,GAAG,IAAI,CAiB3F;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,YAAY,GAAG,IAAI,CAYxF"}
|
package/dist/remote/config.js
CHANGED
|
@@ -48,7 +48,7 @@ export function parseRemoteConfig(env = process.env) {
|
|
|
48
48
|
bridgePort: parsePort(env.ZCODE_ACP_REMOTE_PORT, DEFAULT_BRIDGE_PORT, "ZCODE_ACP_REMOTE_PORT"),
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
/** Parse hub-side config for the standalone `zcode-acp
|
|
51
|
+
/** Parse hub-side config for the standalone hub entry (`zcode-acp hub`). */
|
|
52
52
|
export function parseHubConfig(env = process.env) {
|
|
53
53
|
const token = (env.ZCODE_ACP_REMOTE_TOKEN ?? "").trim();
|
|
54
54
|
if (!token) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/remote/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AASnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAA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broadcast registry, not
|
|
8
8
|
* here. This endpoint is intentionally NOT exposed to the network — the hub
|
|
9
|
-
* (`zcode-acp
|
|
9
|
+
* (`zcode-acp hub`) is the single public entry and proxies into it.
|
|
10
10
|
*
|
|
11
11
|
* The bridge also registers itself with the hub (spawning one if none is
|
|
12
12
|
* listening) and re-registers every 10s as a heartbeat carrying fresh session
|
package/dist/remote/endpoint.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* (SDK AcpServer transport). Each remote connection gets its own JSON-RPC id
|
|
7
7
|
* space; fan-out to all clients is handled by the broadcast registry, not
|
|
8
8
|
* here. This endpoint is intentionally NOT exposed to the network — the hub
|
|
9
|
-
* (`zcode-acp
|
|
9
|
+
* (`zcode-acp hub`) is the single public entry and proxies into it.
|
|
10
10
|
*
|
|
11
11
|
* The bridge also registers itself with the hub (spawning one if none is
|
|
12
12
|
* listening) and re-registers every 10s as a heartbeat carrying fresh session
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Hub daemon — machine-level singleton for remote access.
|
|
3
3
|
*
|
|
4
4
|
* The hub is the ONLY public entry point (the port a tunnel maps). It does
|
|
5
5
|
* token auth, instance discovery, and byte-level WebSocket proxying from a
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Hub daemon — machine-level singleton for remote access.
|
|
3
3
|
*
|
|
4
4
|
* The hub is the ONLY public entry point (the port a tunnel maps). It does
|
|
5
5
|
* token auth, instance discovery, and byte-level WebSocket proxying from a
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ink UI for the interactive REPL (bare `zcode-acp`).
|
|
3
|
+
*
|
|
4
|
+
* Rendering model: the whole app draws in a fixed-height frame managed by
|
|
5
|
+
* run.ts (full-screen mode) — the transcript is an in-app viewport, and the
|
|
6
|
+
* live turn (streaming text, thinking buffer, tool rows), prompt line, and
|
|
7
|
+
* pickers render inside it. A pending permission request takes over the
|
|
8
|
+
* input area with an arrow-key picker.
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactElement } from "react";
|
|
11
|
+
import { type ReplEntry, type ReplStatus, type SessionSummary, type TurnState } from "./model.js";
|
|
12
|
+
import { type LineEditor } from "./input-buffer.js";
|
|
13
|
+
/** A permission request awaiting the user's choice. */
|
|
14
|
+
export interface PermissionPrompt {
|
|
15
|
+
/** Box heading ("permission requested" / "plan approval"). */
|
|
16
|
+
heading: string;
|
|
17
|
+
title: string;
|
|
18
|
+
/** Long body shown under the title (e.g. the plan text for ExitPlanMode). */
|
|
19
|
+
detail?: string;
|
|
20
|
+
options: Array<{
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
/** A question awaiting the user's answer (AskUserQuestion via elicitation). */
|
|
26
|
+
export interface QuestionPrompt {
|
|
27
|
+
title: string;
|
|
28
|
+
multiSelect: boolean;
|
|
29
|
+
options: Array<{
|
|
30
|
+
value: string;
|
|
31
|
+
label: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
/** The interactive `/sessions` picker: resumable project sessions. */
|
|
35
|
+
export interface SessionPick {
|
|
36
|
+
items: SessionSummary[];
|
|
37
|
+
}
|
|
38
|
+
/** A picked question answer: chosen option values plus an optional custom text. */
|
|
39
|
+
export interface QuestionAnswer {
|
|
40
|
+
picked: string[];
|
|
41
|
+
custom: string;
|
|
42
|
+
}
|
|
43
|
+
/** Display state of the question picker (selection, toggles, custom typing). */
|
|
44
|
+
export interface PickerState {
|
|
45
|
+
index: number;
|
|
46
|
+
/** null = option list active; string = custom-answer input in progress. */
|
|
47
|
+
custom: string | null;
|
|
48
|
+
toggled: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface AppProps {
|
|
51
|
+
/** Completed transcript entries — printed once into native scrollback. */
|
|
52
|
+
entries: ReplEntry[];
|
|
53
|
+
/** Live turn in progress, null when idle. */
|
|
54
|
+
turn: TurnState | null;
|
|
55
|
+
/** Pending permission request, null when none. */
|
|
56
|
+
permission: PermissionPrompt | null;
|
|
57
|
+
/** Pending AskUserQuestion, null when none (renders instead of the input). */
|
|
58
|
+
question: QuestionPrompt | null;
|
|
59
|
+
/** Pending /sessions picker, null when closed. */
|
|
60
|
+
sessionPick: SessionPick | null;
|
|
61
|
+
/** Prompts accepted but waiting for the running turn to finish. */
|
|
62
|
+
queued: string[];
|
|
63
|
+
/** Session status: command menu + model/mode/thought selects. */
|
|
64
|
+
status: ReplStatus;
|
|
65
|
+
/** True while the bridge/session is starting up. */
|
|
66
|
+
busy: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* True while a /sessions resume is replaying history. Replayed updates
|
|
69
|
+
* fold silently into run.ts's buffers — rendering per message made big
|
|
70
|
+
* sessions freeze the UI, so App just shows this one-line progress hint.
|
|
71
|
+
*/
|
|
72
|
+
replaying: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The prompt line's editor state (text + caret), owned by run.ts's
|
|
75
|
+
* external store so submit paths can reset it and rerender snapshots
|
|
76
|
+
* stay pure functions of that state.
|
|
77
|
+
*/
|
|
78
|
+
editor: LineEditor;
|
|
79
|
+
/** Apply one pure editor op to the prompt line and repaint. */
|
|
80
|
+
applyEdit: (op: (e: LineEditor) => LineEditor) => void;
|
|
81
|
+
/** Compact plan-quota suffix for the status row (null = not fetched yet). */
|
|
82
|
+
quotaLine: string | null;
|
|
83
|
+
/**
|
|
84
|
+
* Live completion-menu visibility. InputLine mirrors it out of its React
|
|
85
|
+
* state on every render (same external-store rationale as the editor), so
|
|
86
|
+
* the app-level key handler can give the menu first claim on esc.
|
|
87
|
+
*/
|
|
88
|
+
isMenuOpen: () => boolean;
|
|
89
|
+
/** InputLine → external store: publish the current menu visibility. */
|
|
90
|
+
onMenuOpenChange: (open: boolean) => void;
|
|
91
|
+
onSubmit: (text: string) => void;
|
|
92
|
+
onCancelTurn: () => void;
|
|
93
|
+
onAnswerPermission: (optionId: string | null) => void;
|
|
94
|
+
onAnswerQuestion: (answer: QuestionAnswer | null) => void;
|
|
95
|
+
/** null = dismiss the picker without resuming. */
|
|
96
|
+
onPickSession: (sessionId: string | null) => void;
|
|
97
|
+
/** Prompt-history recall (ADR-0008); run.ts no-ops when nothing to walk. */
|
|
98
|
+
onHistoryUp: () => void;
|
|
99
|
+
onHistoryDown: () => void;
|
|
100
|
+
onExit: () => void;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Colorize markdown code fences: lines between ``` fences render cyan. Line
|
|
104
|
+
* level state machine — exported for unit tests.
|
|
105
|
+
*/
|
|
106
|
+
export declare function colorizeCodeFences(text: string): string;
|
|
107
|
+
export declare function App(props: AppProps): ReactElement;
|
|
108
|
+
//# sourceMappingURL=App.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/repl/App.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAA4C,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAGpF,OAAO,EAaL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,YAAY,CAAC;AACpB,OAAO,EAcL,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAE3B,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9C;AAED,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,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