@di-code/coding-agent 0.1.7 → 0.1.9
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 +54 -567
- package/compositions/base.yml +54 -0
- package/compositions/interactive.yml +14 -0
- package/compositions/json.yml +6 -0
- package/compositions/print.yml +5 -0
- package/compositions/rpc.yml +12 -0
- package/compositions/webui.yml +9 -0
- package/dist/cli.d.ts +22 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +97 -3
- package/dist/cli.js.map +1 -1
- package/dist/composition-loader-entry.d.ts +11 -0
- package/dist/composition-loader-entry.d.ts.map +1 -0
- package/dist/composition-loader-entry.js +12 -0
- package/dist/composition-loader-entry.js.map +1 -0
- package/dist/compositions.d.ts +32 -0
- package/dist/compositions.d.ts.map +1 -0
- package/dist/compositions.js +173 -0
- package/dist/compositions.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +9 -2
- package/dist/core/session/session-manager.d.ts.map +1 -1
- package/dist/core/session/session-manager.js +28 -0
- package/dist/core/session/session-manager.js.map +1 -1
- package/dist/core/session/session-storage.d.ts.map +1 -1
- package/dist/core/session/session-storage.js +20 -3
- package/dist/core/session/session-storage.js.map +1 -1
- package/dist/core/session/types.d.ts +11 -2
- package/dist/core/session/types.d.ts.map +1 -1
- package/dist/core/session/types.js.map +1 -1
- package/dist/core/session-tools.d.ts +5 -0
- package/dist/core/session-tools.d.ts.map +1 -0
- package/dist/core/session-tools.js +17 -0
- package/dist/core/session-tools.js.map +1 -0
- package/dist/core/session.d.ts +19 -7
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +71 -39
- package/dist/core/session.js.map +1 -1
- package/dist/core/tools/bash.d.ts +1 -38
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +1 -207
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +1 -24
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +1 -135
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +1 -26
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +1 -140
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +1 -23
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/file-search.d.ts +1 -13
- package/dist/core/tools/file-search.d.ts.map +1 -1
- package/dist/core/tools/file-search.js +1 -98
- package/dist/core/tools/file-search.js.map +1 -1
- package/dist/core/tools/glob.d.ts +1 -10
- package/dist/core/tools/glob.d.ts.map +1 -1
- package/dist/core/tools/glob.js +1 -43
- package/dist/core/tools/glob.js.map +1 -1
- package/dist/core/tools/grep.d.ts +1 -12
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +1 -66
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/load-skill.d.ts +1 -9
- package/dist/core/tools/load-skill.d.ts.map +1 -1
- package/dist/core/tools/load-skill.js +1 -21
- package/dist/core/tools/load-skill.js.map +1 -1
- package/dist/core/tools/path-boundary.d.ts +1 -4
- package/dist/core/tools/path-boundary.d.ts.map +1 -1
- package/dist/core/tools/path-boundary.js +1 -65
- package/dist/core/tools/path-boundary.js.map +1 -1
- package/dist/core/tools/read.d.ts +1 -16
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -131
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts +1 -16
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +1 -44
- package/dist/core/tools/write.js.map +1 -1
- package/dist/entry.js +30 -28
- package/dist/entry.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/interactive/builtin.d.ts +17 -0
- package/dist/interactive/builtin.d.ts.map +1 -0
- package/dist/interactive/builtin.js +47 -0
- package/dist/interactive/builtin.js.map +1 -0
- package/dist/interactive/controller.d.ts +85 -0
- package/dist/interactive/controller.d.ts.map +1 -0
- package/dist/interactive/controller.js +211 -0
- package/dist/interactive/controller.js.map +1 -0
- package/dist/interactive/index.d.ts +3 -0
- package/dist/interactive/index.d.ts.map +1 -0
- package/dist/interactive/index.js +3 -0
- package/dist/interactive/index.js.map +1 -0
- package/dist/interactive-host-entry.d.ts +7 -0
- package/dist/interactive-host-entry.d.ts.map +1 -0
- package/dist/interactive-host-entry.js +123 -0
- package/dist/interactive-host-entry.js.map +1 -0
- package/dist/interactive-profile.d.ts +18 -0
- package/dist/interactive-profile.d.ts.map +1 -0
- package/dist/interactive-profile.js +290 -0
- package/dist/interactive-profile.js.map +1 -0
- package/dist/interactive-resources-entry.d.ts +7 -0
- package/dist/interactive-resources-entry.d.ts.map +1 -0
- package/dist/interactive-resources-entry.js +42 -0
- package/dist/interactive-resources-entry.js.map +1 -0
- package/dist/legacy-main.d.ts +39 -0
- package/dist/legacy-main.d.ts.map +1 -0
- package/dist/legacy-main.js +611 -0
- package/dist/legacy-main.js.map +1 -0
- package/dist/main.d.ts +15 -34
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +130 -518
- package/dist/main.js.map +1 -1
- package/dist/mcp/entries.d.ts +42 -0
- package/dist/mcp/entries.d.ts.map +1 -0
- package/dist/mcp/entries.js +98 -0
- package/dist/mcp/entries.js.map +1 -0
- package/dist/mcp-client-entry.d.ts +5 -0
- package/dist/mcp-client-entry.d.ts.map +1 -0
- package/dist/mcp-client-entry.js +6 -0
- package/dist/mcp-client-entry.js.map +1 -0
- package/dist/mcp-config-entry.d.ts +5 -0
- package/dist/mcp-config-entry.d.ts.map +1 -0
- package/dist/mcp-config-entry.js +6 -0
- package/dist/mcp-config-entry.js.map +1 -0
- package/dist/mcp-tools-entry.d.ts +5 -0
- package/dist/mcp-tools-entry.d.ts.map +1 -0
- package/dist/mcp-tools-entry.js +6 -0
- package/dist/mcp-tools-entry.js.map +1 -0
- package/dist/mcp-transport-entry.d.ts +5 -0
- package/dist/mcp-transport-entry.d.ts.map +1 -0
- package/dist/mcp-transport-entry.js +6 -0
- package/dist/mcp-transport-entry.js.map +1 -0
- package/dist/modes/interactive-entry.d.ts +18 -0
- package/dist/modes/interactive-entry.d.ts.map +1 -0
- package/dist/modes/interactive-entry.js +21 -0
- package/dist/modes/interactive-entry.js.map +1 -0
- package/dist/modes/interactive.d.ts +16 -6
- package/dist/modes/interactive.d.ts.map +1 -1
- package/dist/modes/interactive.js +81 -32
- package/dist/modes/interactive.js.map +1 -1
- package/dist/modes/json-entry.d.ts +13 -0
- package/dist/modes/json-entry.d.ts.map +1 -0
- package/dist/modes/json-entry.js +14 -0
- package/dist/modes/json-entry.js.map +1 -0
- package/dist/modes/json.d.ts +4 -1
- package/dist/modes/json.d.ts.map +1 -1
- package/dist/modes/json.js +3 -3
- package/dist/modes/json.js.map +1 -1
- package/dist/modes/print-entry.d.ts +10 -0
- package/dist/modes/print-entry.d.ts.map +1 -0
- package/dist/modes/print-entry.js +11 -0
- package/dist/modes/print-entry.js.map +1 -0
- package/dist/modes/tree-selector.d.ts.map +1 -1
- package/dist/modes/tree-selector.js +4 -0
- package/dist/modes/tree-selector.js.map +1 -1
- package/dist/plugin-dump-composition.d.ts +6 -0
- package/dist/plugin-dump-composition.d.ts.map +1 -0
- package/dist/plugin-dump-composition.js +7 -0
- package/dist/plugin-dump-composition.js.map +1 -0
- package/dist/plugin-inventory.d.ts +7 -0
- package/dist/plugin-inventory.d.ts.map +1 -0
- package/dist/plugin-inventory.js +8 -0
- package/dist/plugin-inventory.js.map +1 -0
- package/dist/plugin-manager.d.ts +6 -0
- package/dist/plugin-manager.d.ts.map +1 -0
- package/dist/plugin-manager.js +7 -0
- package/dist/plugin-manager.js.map +1 -0
- package/dist/plugin-trace.d.ts +6 -0
- package/dist/plugin-trace.d.ts.map +1 -0
- package/dist/plugin-trace.js +7 -0
- package/dist/plugin-trace.js.map +1 -0
- package/dist/plugins/dynamic-broker.d.ts +76 -0
- package/dist/plugins/dynamic-broker.d.ts.map +1 -0
- package/dist/plugins/dynamic-broker.js +852 -0
- package/dist/plugins/dynamic-broker.js.map +1 -0
- package/dist/plugins/profile.d.ts +15 -0
- package/dist/plugins/profile.d.ts.map +1 -0
- package/dist/plugins/profile.js +34 -0
- package/dist/plugins/profile.js.map +1 -0
- package/dist/plugins/runtime-host.d.ts +37 -0
- package/dist/plugins/runtime-host.d.ts.map +1 -0
- package/dist/plugins/runtime-host.js +95 -0
- package/dist/plugins/runtime-host.js.map +1 -0
- package/dist/plugins/trust.d.ts +8 -0
- package/dist/plugins/trust.d.ts.map +1 -0
- package/dist/plugins/trust.js +59 -0
- package/dist/plugins/trust.js.map +1 -0
- package/dist/project-trust-entry.d.ts +15 -0
- package/dist/project-trust-entry.d.ts.map +1 -0
- package/dist/project-trust-entry.js +15 -0
- package/dist/project-trust-entry.js.map +1 -0
- package/dist/rpc/client.d.ts +78 -6
- package/dist/rpc/client.d.ts.map +1 -1
- package/dist/rpc/client.js +172 -4
- package/dist/rpc/client.js.map +1 -1
- package/dist/rpc/dispatcher.d.ts +121 -0
- package/dist/rpc/dispatcher.d.ts.map +1 -0
- package/dist/rpc/dispatcher.js +994 -0
- package/dist/rpc/dispatcher.js.map +1 -0
- package/dist/rpc/index.d.ts +2 -0
- package/dist/rpc/index.d.ts.map +1 -1
- package/dist/rpc/index.js +2 -0
- package/dist/rpc/index.js.map +1 -1
- package/dist/rpc/lifecycle.d.ts +6 -0
- package/dist/rpc/lifecycle.d.ts.map +1 -0
- package/dist/rpc/lifecycle.js +24 -0
- package/dist/rpc/lifecycle.js.map +1 -0
- package/dist/rpc/protocol.d.ts +112 -31
- package/dist/rpc/protocol.d.ts.map +1 -1
- package/dist/rpc/protocol.js +569 -117
- package/dist/rpc/protocol.js.map +1 -1
- package/dist/rpc/server-service.d.ts +7 -0
- package/dist/rpc/server-service.d.ts.map +1 -0
- package/dist/rpc/server-service.js +3 -0
- package/dist/rpc/server-service.js.map +1 -0
- package/dist/rpc/server.d.ts +16 -19
- package/dist/rpc/server.d.ts.map +1 -1
- package/dist/rpc/server.js +59 -115
- package/dist/rpc/server.js.map +1 -1
- package/dist/rpc-client-sdk-entry.d.ts +12 -0
- package/dist/rpc-client-sdk-entry.d.ts.map +1 -0
- package/dist/rpc-client-sdk-entry.js +11 -0
- package/dist/rpc-client-sdk-entry.js.map +1 -0
- package/dist/rpc-entry.js +50 -18
- package/dist/rpc-entry.js.map +1 -1
- package/dist/rpc-server-entry.d.ts +8 -0
- package/dist/rpc-server-entry.d.ts.map +1 -0
- package/dist/rpc-server-entry.js +67 -0
- package/dist/rpc-server-entry.js.map +1 -0
- package/dist/runtime/attachment-store.d.ts +13 -0
- package/dist/runtime/attachment-store.d.ts.map +1 -0
- package/dist/runtime/attachment-store.js +93 -0
- package/dist/runtime/attachment-store.js.map +1 -0
- package/dist/runtime/bootstrap.d.ts +14 -0
- package/dist/runtime/bootstrap.d.ts.map +1 -0
- package/dist/runtime/bootstrap.js +29 -0
- package/dist/runtime/bootstrap.js.map +1 -0
- package/dist/runtime/interactive-host-service.d.ts +22 -0
- package/dist/runtime/interactive-host-service.d.ts.map +1 -0
- package/dist/runtime/interactive-host-service.js +2 -0
- package/dist/runtime/interactive-host-service.js.map +1 -0
- package/dist/runtime/interactive-resource-service.d.ts +11 -0
- package/dist/runtime/interactive-resource-service.d.ts.map +1 -0
- package/dist/runtime/interactive-resource-service.js +3 -0
- package/dist/runtime/interactive-resource-service.js.map +1 -0
- package/dist/runtime/plugin-inventory-entry.d.ts +5 -0
- package/dist/runtime/plugin-inventory-entry.d.ts.map +1 -0
- package/dist/runtime/plugin-inventory-entry.js +18 -0
- package/dist/runtime/plugin-inventory-entry.js.map +1 -0
- package/dist/runtime/plugin-inventory-service.d.ts +8 -0
- package/dist/runtime/plugin-inventory-service.d.ts.map +1 -0
- package/dist/runtime/plugin-inventory-service.js +3 -0
- package/dist/runtime/plugin-inventory-service.js.map +1 -0
- package/dist/runtime/plugin-manager-entry.d.ts +20 -0
- package/dist/runtime/plugin-manager-entry.d.ts.map +1 -0
- package/dist/runtime/plugin-manager-entry.js +96 -0
- package/dist/runtime/plugin-manager-entry.js.map +1 -0
- package/dist/runtime/plugin-observability-entry.d.ts +12 -0
- package/dist/runtime/plugin-observability-entry.d.ts.map +1 -0
- package/dist/runtime/plugin-observability-entry.js +73 -0
- package/dist/runtime/plugin-observability-entry.js.map +1 -0
- package/dist/runtime/product-host.d.ts +91 -0
- package/dist/runtime/product-host.d.ts.map +1 -0
- package/dist/runtime/product-host.js +529 -0
- package/dist/runtime/product-host.js.map +1 -0
- package/dist/runtime/session-factory.d.ts +17 -0
- package/dist/runtime/session-factory.d.ts.map +1 -0
- package/dist/runtime/session-factory.js +75 -0
- package/dist/runtime/session-factory.js.map +1 -0
- package/dist/runtime/session-host.d.ts +152 -0
- package/dist/runtime/session-host.d.ts.map +1 -0
- package/dist/runtime/session-host.js +895 -0
- package/dist/runtime/session-host.js.map +1 -0
- package/dist/runtime-core-entry.d.ts +11 -0
- package/dist/runtime-core-entry.d.ts.map +1 -0
- package/dist/runtime-core-entry.js +9 -0
- package/dist/runtime-core-entry.js.map +1 -0
- package/dist/session-factory-entry.d.ts +7 -0
- package/dist/session-factory-entry.d.ts.map +1 -0
- package/dist/session-factory-entry.js +9 -0
- package/dist/session-factory-entry.js.map +1 -0
- package/dist/session-store-jsonl-entry.d.ts +7 -0
- package/dist/session-store-jsonl-entry.d.ts.map +1 -0
- package/dist/session-store-jsonl-entry.js +33 -0
- package/dist/session-store-jsonl-entry.js.map +1 -0
- package/dist/startup.d.ts +12 -1
- package/dist/startup.d.ts.map +1 -1
- package/dist/startup.js +106 -15
- package/dist/startup.js.map +1 -1
- package/dist/subagents/index.d.ts +2 -0
- package/dist/subagents/index.d.ts.map +1 -0
- package/dist/subagents/index.js +2 -0
- package/dist/subagents/index.js.map +1 -0
- package/dist/subagents/service.d.ts +50 -0
- package/dist/subagents/service.d.ts.map +1 -0
- package/dist/subagents/service.js +521 -0
- package/dist/subagents/service.js.map +1 -0
- package/dist/ui-host.d.ts +125 -0
- package/dist/ui-host.d.ts.map +1 -0
- package/dist/ui-host.js +275 -0
- package/dist/ui-host.js.map +1 -0
- package/dist/web/assets/index-BwfuGMvv.css +1 -0
- package/dist/web/assets/index-DPUaJqFJ.js +41 -0
- package/dist/web/assets/index-DPUaJqFJ.js.map +1 -0
- package/dist/web/index.html +14 -0
- package/dist/web-command.d.ts +11 -0
- package/dist/web-command.d.ts.map +1 -0
- package/dist/web-command.js +114 -0
- package/dist/web-command.js.map +1 -0
- package/dist/web-frontend.d.ts +73 -0
- package/dist/web-frontend.d.ts.map +1 -0
- package/dist/web-frontend.js +249 -0
- package/dist/web-frontend.js.map +1 -0
- package/dist/web.d.ts +254 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +740 -0
- package/dist/web.js.map +1 -0
- package/dist/webui-entry.d.ts +3 -0
- package/dist/webui-entry.d.ts.map +1 -0
- package/dist/webui-entry.js +73 -0
- package/dist/webui-entry.js.map +1 -0
- package/dist/webui.d.ts +91 -0
- package/dist/webui.d.ts.map +1 -0
- package/dist/webui.js +882 -0
- package/dist/webui.js.map +1 -0
- package/package.json +89 -8
package/dist/modes/json.d.ts
CHANGED
|
@@ -10,5 +10,8 @@ export interface JsonRunner {
|
|
|
10
10
|
prompt(text: string): Promise<AssistantMessage>;
|
|
11
11
|
subscribe(listener: AgentListener): () => void;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export interface JsonRenderer {
|
|
14
|
+
render(event: AgentEvent): string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare function runJsonMode(prompt: string, runner: JsonRunner, io: PrintIo, renderer?: JsonRenderer): Promise<number>;
|
|
14
17
|
//# sourceMappingURL=json.d.ts.map
|
package/dist/modes/json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/modes/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,kBAAkB,EAAG,CAAU,CAAC;AAE7C,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,kBAAkB,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IAC1B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChD,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,IAAI,CAAC;CAC/C;AAMD,wBAAsB,WAAW,
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/modes/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,kBAAkB,EAAG,CAAU,CAAC;AAE7C,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,kBAAkB,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IAC1B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChD,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;CAC9C;AAMD,wBAAsB,WAAW,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,EAAE,EAAE,OAAO,EACX,QAAQ,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
|
package/dist/modes/json.js
CHANGED
|
@@ -2,10 +2,10 @@ export const JSON_EVENT_VERSION = 2;
|
|
|
2
2
|
function toError(cause) {
|
|
3
3
|
return cause instanceof Error ? cause : new Error(String(cause));
|
|
4
4
|
}
|
|
5
|
-
export async function runJsonMode(prompt, runner, io) {
|
|
5
|
+
export async function runJsonMode(prompt, runner, io, renderer) {
|
|
6
6
|
const unsubscribe = runner.subscribe((event) => {
|
|
7
|
-
const
|
|
8
|
-
io.stdout(`${
|
|
7
|
+
const rendered = renderer?.render(event) ?? JSON.stringify({ version: JSON_EVENT_VERSION, event });
|
|
8
|
+
io.stdout(`${rendered}\n`);
|
|
9
9
|
});
|
|
10
10
|
try {
|
|
11
11
|
const assistant = await runner.prompt(prompt);
|
package/dist/modes/json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/modes/json.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/modes/json.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAU,CAAC;AAgB7C,SAAS,OAAO,CAAC,KAAc;IAC9B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,MAAc,EACd,MAAkB,EAClB,EAAW,EACX,QAAuB;IAEvB,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9C,MAAM,QAAQ,GAAG,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAC;QACnG,EAAE,CAAC,MAAM,CAAC,GAAG,QAAQ,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC;QACJ,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,SAAS,CAAC,UAAU,KAAK,OAAO,IAAI,SAAS,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAC5E,EAAE,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,YAAY,IAAI,CAAC,CAAC;YACzC,OAAO,CAAC,CAAC;QACV,CAAC;QACD,OAAO,CAAC,CAAC;IACV,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,EAAE,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;QACzC,OAAO,CAAC,CAAC;IACV,CAAC;YAAS,CAAC;QACV,WAAW,EAAE,CAAC;IACf,CAAC;AACF,CAAC","sourcesContent":["import type { AgentEvent, AgentListener } from \"@di-code/agent\";\nimport type { AssistantMessage } from \"@di-code/ai\";\nimport type { PrintIo } from \"./print.ts\";\n\nexport const JSON_EVENT_VERSION = 2 as const;\n\nexport interface JsonEventRecord {\n\treadonly version: typeof JSON_EVENT_VERSION;\n\treadonly event: AgentEvent;\n}\n\nexport interface JsonRunner {\n\tprompt(text: string): Promise<AssistantMessage>;\n\tsubscribe(listener: AgentListener): () => void;\n}\n\nexport interface JsonRenderer {\n\trender(event: AgentEvent): string | undefined;\n}\n\nfunction toError(cause: unknown): Error {\n\treturn cause instanceof Error ? cause : new Error(String(cause));\n}\n\nexport async function runJsonMode(\n\tprompt: string,\n\trunner: JsonRunner,\n\tio: PrintIo,\n\trenderer?: JsonRenderer,\n): Promise<number> {\n\tconst unsubscribe = runner.subscribe((event) => {\n\t\tconst rendered = renderer?.render(event) ?? JSON.stringify({ version: JSON_EVENT_VERSION, event });\n\t\tio.stdout(`${rendered}\\n`);\n\t});\n\n\ttry {\n\t\tconst assistant = await runner.prompt(prompt);\n\t\tif (assistant.stopReason === \"error\" || assistant.stopReason === \"aborted\") {\n\t\t\tio.stderr(`${assistant.errorMessage}\\n`);\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t} catch (cause) {\n\t\tio.stderr(`${toError(cause).message}\\n`);\n\t\treturn 1;\n\t} finally {\n\t\tunsubscribe();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PrintIo, PromptRunner } from "./print.ts";
|
|
2
|
+
export interface PrintModeEntryOptions {
|
|
3
|
+
readonly prompt: string;
|
|
4
|
+
readonly runner: PromptRunner;
|
|
5
|
+
readonly io: PrintIo;
|
|
6
|
+
readonly onStart: () => void | Promise<void>;
|
|
7
|
+
readonly onStop: () => void | Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function runPrintModeEntry(options: PrintModeEntryOptions): Promise<number>;
|
|
10
|
+
//# sourceMappingURL=print-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-entry.d.ts","sourceRoot":"","sources":["../../src/modes/print-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGxD,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { runPrintMode } from "./print.js";
|
|
2
|
+
export async function runPrintModeEntry(options) {
|
|
3
|
+
await options.onStart();
|
|
4
|
+
try {
|
|
5
|
+
return await runPrintMode(options.prompt, options.runner, options.io);
|
|
6
|
+
}
|
|
7
|
+
finally {
|
|
8
|
+
await options.onStop();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=print-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-entry.js","sourceRoot":"","sources":["../../src/modes/print-entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAU1C,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAA8B;IACrE,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,IAAI,CAAC;QACJ,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;YAAS,CAAC;QACV,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;AACF,CAAC","sourcesContent":["import type { PrintIo, PromptRunner } from \"./print.ts\";\nimport { runPrintMode } from \"./print.ts\";\n\nexport interface PrintModeEntryOptions {\n\treadonly prompt: string;\n\treadonly runner: PromptRunner;\n\treadonly io: PrintIo;\n\treadonly onStart: () => void | Promise<void>;\n\treadonly onStop: () => void | Promise<void>;\n}\n\nexport async function runPrintModeEntry(options: PrintModeEntryOptions): Promise<number> {\n\tawait options.onStart();\n\ttry {\n\t\treturn await runPrintMode(options.prompt, options.runner, options.io);\n\t} finally {\n\t\tawait options.onStop();\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-selector.d.ts","sourceRoot":"","sources":["../../src/modes/tree-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAmC,MAAM,cAAc,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,YAAY,CAAC;AAyBpD,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACvC,MAAM,CAAC,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACnC,WAAW,CAAC,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,IAAI,IAAI,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"tree-selector.d.ts","sourceRoot":"","sources":["../../src/modes/tree-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAmC,MAAM,cAAc,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,YAAY,CAAC;AAyBpD,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACvC,MAAM,CAAC,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACnC,WAAW,CAAC,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,IAAI,IAAI,CAAC;CAClB;AA6FD,oHAAoH;AACpH,qBAAa,YAAa,YAAW,SAAS,EAAE,SAAS;IACxD,OAAO,UAAS;IAChB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;IAChD,OAAO,CAAC,aAAa,CAAK;gBAEd,OAAO,EAAE,mBAAmB;IAOxC,UAAU,IAAI,IAAI;IAElB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAwB/B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAwB/B,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,MAAM;CAOd"}
|
|
@@ -20,6 +20,8 @@ function singleLine(value) {
|
|
|
20
20
|
function textContent(entry) {
|
|
21
21
|
if (entry.type === "summary")
|
|
22
22
|
return singleLine(entry.summary);
|
|
23
|
+
if (entry.type === "plugin")
|
|
24
|
+
return singleLine(`plugin:${entry.pluginId}`);
|
|
23
25
|
return singleLine(entry.message.content
|
|
24
26
|
.filter((content) => content.type === "text")
|
|
25
27
|
.map((content) => content.text)
|
|
@@ -169,6 +171,8 @@ export class TreeSelector {
|
|
|
169
171
|
const text = textContent(entry);
|
|
170
172
|
if (entry.type === "summary")
|
|
171
173
|
return `${paint(YELLOW, "summary: ")}${text || paint(DIM, "(empty)")}`;
|
|
174
|
+
if (entry.type === "plugin")
|
|
175
|
+
return `${paint(DIM, "plugin: ")}${text || paint(DIM, "(empty)")}`;
|
|
172
176
|
if (entry.message.role === "user")
|
|
173
177
|
return `${paint(CYAN, "user: ")}${text || paint(DIM, "(empty)")}`;
|
|
174
178
|
if (entry.message.role === "assistant") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-selector.js","sourceRoot":"","sources":["../../src/modes/tree-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,GAAG,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE/F,OAAO,EAAe,SAAS,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,gBAAgB,GAAG,UAAU,CAAC;AACpC,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,KAAK,GAAG,gBAAgB,CAAC;AAC/B,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAChC,MAAM,GAAG,GAAG,gBAAgB,CAAC;AAC7B,MAAM,GAAG,GAAG,gBAAgB,CAAC;AAC7B,MAAM,iBAAiB,GAAG,EAAE,CAAC;AA2B7B,SAAS,KAAK,CAAC,KAAa,EAAE,IAAY;IACzC,8FAA8F;IAC9F,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,gBAAgB,EAAE,CAAC;AAC7C,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAChC,OAAO,KAAK;SACV,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC;SAC1B,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;AACV,CAAC;AAED,SAAS,WAAW,CAAC,KAAmB;IACvC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/D,OAAO,UAAU,CAChB,KAAK,CAAC,OAAO,CAAC,OAAO;SACnB,MAAM,CAAC,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CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC/F,CAAC;IAEO,MAAM,CAAC,MAAyC;QACvD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC;QACpD,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,IAAI,MAAM,KAAK,UAAU;YAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;aACvD,IAAI,MAAM,KAAK,MAAM;YAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;;YACpD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;CACD","sourcesContent":["import { type Component, type Focusable, Key, matchesKey, SelectionPanel } from \"@di-code/tui\";\nimport type { SessionEntry, SessionTreeNode } from \"../core/session/types.ts\";\nimport { type Locale, translate } from \"../i18n.ts\";\n\nconst RESET_FOREGROUND = \"\\x1b[39m\";\nconst CYAN = \"\\x1b[38;5;45m\";\nconst GREEN = \"\\x1b[38;5;114m\";\nconst YELLOW = \"\\x1b[38;5;222m\";\nconst RED = \"\\x1b[38;5;210m\";\nconst DIM = \"\\x1b[38;5;245m\";\nconst MAX_VISIBLE_NODES = 12;\n\ninterface FlatTreeNode {\n\treadonly entry: SessionEntry;\n\t/** Visual indentation only grows where the session graph actually branches. */\n\treadonly indent: number;\n\treadonly showConnector: boolean;\n\treadonly isLast: boolean;\n\treadonly gutters: readonly TreeGutter[];\n\treadonly isCurrentPath: boolean;\n}\n\ninterface TreeGutter {\n\treadonly level: number;\n\treadonly continues: boolean;\n}\n\nexport interface TreeSelectorOptions {\n\treadonly nodes: readonly SessionTreeNode[];\n\treadonly leafId?: string;\n\treadonly locale: Locale;\n\tonContinue?(entry: SessionEntry): void;\n\tonEdit?(entry: SessionEntry): void;\n\tonSummarize?(entry: SessionEntry): void;\n\tonCancel?(): void;\n}\n\nfunction paint(color: string, text: string): string {\n\t// Reset only the foreground so a selected row keeps its background across coloured fragments.\n\treturn `${color}${text}${RESET_FOREGROUND}`;\n}\n\nfunction singleLine(value: string): string {\n\treturn value\n\t\t.replace(/[\\r\\n\\t]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n}\n\nfunction textContent(entry: SessionEntry): string {\n\tif (entry.type === \"summary\") return singleLine(entry.summary);\n\treturn singleLine(\n\t\tentry.message.content\n\t\t\t.filter((content) => content.type === \"text\")\n\t\t\t.map((content) => content.text)\n\t\t\t.join(\" \"),\n\t);\n}\n\nfunction flattenTree(nodes: readonly SessionTreeNode[], leafId: string | undefined): FlatTreeNode[] {\n\tconst parents = new Map<string, string>();\n\tconst raw: Array<Omit<FlatTreeNode, \"isCurrentPath\">> = [];\n\ttype PendingNode = {\n\t\treadonly node: SessionTreeNode;\n\t\treadonly indent: number;\n\t\treadonly justBranched: boolean;\n\t\treadonly showConnector: boolean;\n\t\treadonly isLast: boolean;\n\t\treadonly gutters: readonly TreeGutter[];\n\t};\n\tconst stack: PendingNode[] = [];\n\tconst multipleRoots = nodes.length > 1;\n\n\tfor (let index = nodes.length - 1; index >= 0; index -= 1) {\n\t\tconst node = nodes[index];\n\t\tif (!node) continue;\n\t\tstack.push({\n\t\t\tnode,\n\t\t\tindent: multipleRoots ? 1 : 0,\n\t\t\tjustBranched: multipleRoots,\n\t\t\tshowConnector: multipleRoots,\n\t\t\tisLast: index === nodes.length - 1,\n\t\t\tgutters: [],\n\t\t});\n\t}\n\n\twhile (stack.length > 0) {\n\t\tconst current = stack.pop();\n\t\tif (!current) continue;\n\t\traw.push({\n\t\t\tentry: current.node.entry,\n\t\t\tindent: current.indent,\n\t\t\tshowConnector: current.showConnector,\n\t\t\tisLast: current.isLast,\n\t\t\tgutters: current.gutters,\n\t\t});\n\t\tconst children = current.node.children;\n\t\tconst multipleChildren = children.length > 1;\n\t\tconst childIndent = multipleChildren\n\t\t\t? current.indent + 1\n\t\t\t: current.justBranched && current.indent > 0\n\t\t\t\t? current.indent + 1\n\t\t\t\t: current.indent;\n\t\tconst childGutters =\n\t\t\tcurrent.showConnector && current.indent > 0\n\t\t\t\t? [...current.gutters, { level: current.indent - 1, continues: !current.isLast }]\n\t\t\t\t: current.gutters;\n\t\tfor (let index = children.length - 1; index >= 0; index -= 1) {\n\t\t\tconst child = children[index];\n\t\t\tif (!child) continue;\n\t\t\tparents.set(child.entry.id, current.node.entry.id);\n\t\t\tstack.push({\n\t\t\t\tnode: child,\n\t\t\t\tindent: childIndent,\n\t\t\t\tjustBranched: multipleChildren,\n\t\t\t\tshowConnector: multipleChildren,\n\t\t\t\tisLast: index === children.length - 1,\n\t\t\t\tgutters: childGutters,\n\t\t\t});\n\t\t}\n\t}\n\n\tconst currentPath = new Set<string>();\n\tfor (let current = leafId; current; current = parents.get(current)) currentPath.add(current);\n\treturn raw.map((node) => ({ ...node, isCurrentPath: currentPath.has(node.entry.id) }));\n}\n\n/** Compact, keyboard-driven session tree browser. It only renders and delegates all state changes to its caller. */\nexport class TreeSelector implements Component, Focusable {\n\tfocused = false;\n\tprivate readonly options: TreeSelectorOptions;\n\tprivate readonly nodes: readonly FlatTreeNode[];\n\tprivate selectedIndex = 0;\n\n\tconstructor(options: TreeSelectorOptions) {\n\t\tthis.options = options;\n\t\tthis.nodes = flattenTree(options.nodes, options.leafId);\n\t\tconst selected = this.nodes.findIndex((node) => node.entry.id === options.leafId);\n\t\tif (selected >= 0) this.selectedIndex = selected;\n\t}\n\n\tinvalidate(): void {}\n\n\trender(width: number): string[] {\n\t\tif (width <= 0) return [];\n\t\tif (this.nodes.length === 0)\n\t\t\treturn new SelectionPanel({ emptyText: translate(this.options.locale, \"treeEmpty\"), total: 0 }).render(width);\n\n\t\tconst start = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(MAX_VISIBLE_NODES / 2), this.nodes.length - MAX_VISIBLE_NODES),\n\t\t);\n\t\tconst end = Math.min(this.nodes.length, start + MAX_VISIBLE_NODES);\n\t\tconst rows: string[] = [];\n\t\tfor (let index = start; index < end; index += 1) {\n\t\t\tconst node = this.nodes[index];\n\t\t\tif (node) rows.push(this.renderNode(node));\n\t\t}\n\t\treturn new SelectionPanel({\n\t\t\trows,\n\t\t\tselectedIndex: this.selectedIndex - start,\n\t\t\tposition: this.selectedIndex + 1,\n\t\t\ttotal: this.nodes.length,\n\t\t\thint: this.actionHint(),\n\t\t}).render(width);\n\t}\n\n\thandleInput(data: string): void {\n\t\tif (matchesKey(data, Key.up)) {\n\t\t\tthis.move(-1);\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, Key.down)) {\n\t\t\tthis.move(1);\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, Key.enter)) {\n\t\t\tthis.select(\"continue\");\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, Key.escape) || matchesKey(data, Key.ctrl(\"c\"))) {\n\t\t\tthis.options.onCancel?.();\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, \"e\")) {\n\t\t\tthis.select(\"edit\");\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, \"s\")) this.select(\"summarize\");\n\t}\n\n\tprivate renderNode(node: FlatTreeNode): string {\n\t\tconst prefix = this.renderPrefix(node);\n\t\tconst currentPath = node.isCurrentPath ? paint(CYAN, \"• \") : \" \";\n\t\tconst content = this.entryDisplay(node.entry);\n\t\treturn `${prefix}${currentPath}${content}`;\n\t}\n\n\tprivate renderPrefix(node: FlatTreeNode): string {\n\t\tconst levels: string[] = [];\n\t\tfor (let level = 0; level < node.indent; level += 1) {\n\t\t\tconst gutter = node.gutters.find((candidate) => candidate.level === level);\n\t\t\tif (gutter) {\n\t\t\t\tlevels.push(paint(DIM, gutter.continues ? \"│ \" : \" \"));\n\t\t\t} else if (node.showConnector && level === node.indent - 1) {\n\t\t\t\tlevels.push(paint(DIM, node.isLast ? \"└─ \" : \"├─ \"));\n\t\t\t} else {\n\t\t\t\tlevels.push(\" \");\n\t\t\t}\n\t\t}\n\t\treturn levels.join(\"\");\n\t}\n\n\tprivate entryDisplay(entry: SessionEntry): string {\n\t\tconst text = textContent(entry);\n\t\tif (entry.type === \"summary\") return `${paint(YELLOW, \"summary: \")}${text || paint(DIM, \"(empty)\")}`;\n\t\tif (entry.message.role === \"user\") return `${paint(CYAN, \"user: \")}${text || paint(DIM, \"(empty)\")}`;\n\t\tif (entry.message.role === \"assistant\") {\n\t\t\tif (text) return `${paint(GREEN, \"assistant: \")}${text}`;\n\t\t\tif (entry.message.stopReason === \"aborted\") return `${paint(GREEN, \"assistant: \")}${paint(DIM, \"(aborted)\")}`;\n\t\t\tif (entry.message.stopReason === \"error\") return `${paint(GREEN, \"assistant: \")}${paint(RED, \"(error)\")}`;\n\t\t\treturn `${paint(GREEN, \"assistant: \")}${paint(DIM, \"(no text)\")}`;\n\t\t}\n\t\treturn `${paint(DIM, `${entry.message.toolName}: `)}${text || paint(DIM, \"(no text)\")}`;\n\t}\n\n\tprivate actionHint(): string {\n\t\treturn `Enter ${translate(this.options.locale, \"treeContinue\")} · e ${translate(this.options.locale, \"treeEdit\")} · s ${translate(this.options.locale, \"treeSummarize\")} · Esc ${translate(this.options.locale, \"treeCancel\")}`;\n\t}\n\n\tprivate move(direction: -1 | 1): void {\n\t\tif (this.nodes.length === 0) return;\n\t\tthis.selectedIndex = (this.selectedIndex + direction + this.nodes.length) % this.nodes.length;\n\t}\n\n\tprivate select(action: \"continue\" | \"edit\" | \"summarize\"): void {\n\t\tconst entry = this.nodes[this.selectedIndex]?.entry;\n\t\tif (!entry) return;\n\t\tif (action === \"continue\") this.options.onContinue?.(entry);\n\t\telse if (action === \"edit\") this.options.onEdit?.(entry);\n\t\telse this.options.onSummarize?.(entry);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tree-selector.js","sourceRoot":"","sources":["../../src/modes/tree-selector.ts"],"names":[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AK,CAAC,MAAM,CAAC;IAC/F,CAAC;IAEO,MAAM,CAAC,MAAyC;QACvD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC;QACpD,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,IAAI,MAAM,KAAK,UAAU;YAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;aACvD,IAAI,MAAM,KAAK,MAAM;YAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;;YACpD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;CACD","sourcesContent":["import { type Component, type Focusable, Key, matchesKey, SelectionPanel } from \"@di-code/tui\";\nimport type { SessionEntry, SessionTreeNode } from \"../core/session/types.ts\";\nimport { type Locale, translate } from \"../i18n.ts\";\n\nconst RESET_FOREGROUND = \"\\x1b[39m\";\nconst CYAN = \"\\x1b[38;5;45m\";\nconst GREEN = \"\\x1b[38;5;114m\";\nconst YELLOW = \"\\x1b[38;5;222m\";\nconst RED = \"\\x1b[38;5;210m\";\nconst DIM = \"\\x1b[38;5;245m\";\nconst MAX_VISIBLE_NODES = 12;\n\ninterface FlatTreeNode {\n\treadonly entry: SessionEntry;\n\t/** Visual indentation only grows where the session graph actually branches. */\n\treadonly indent: number;\n\treadonly showConnector: boolean;\n\treadonly isLast: boolean;\n\treadonly gutters: readonly TreeGutter[];\n\treadonly isCurrentPath: boolean;\n}\n\ninterface TreeGutter {\n\treadonly level: number;\n\treadonly continues: boolean;\n}\n\nexport interface TreeSelectorOptions {\n\treadonly nodes: readonly SessionTreeNode[];\n\treadonly leafId?: string;\n\treadonly locale: Locale;\n\tonContinue?(entry: SessionEntry): void;\n\tonEdit?(entry: SessionEntry): void;\n\tonSummarize?(entry: SessionEntry): void;\n\tonCancel?(): void;\n}\n\nfunction paint(color: string, text: string): string {\n\t// Reset only the foreground so a selected row keeps its background across coloured fragments.\n\treturn `${color}${text}${RESET_FOREGROUND}`;\n}\n\nfunction singleLine(value: string): string {\n\treturn value\n\t\t.replace(/[\\r\\n\\t]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n}\n\nfunction textContent(entry: SessionEntry): string {\n\tif (entry.type === \"summary\") return singleLine(entry.summary);\n\tif (entry.type === \"plugin\") return singleLine(`plugin:${entry.pluginId}`);\n\treturn singleLine(\n\t\tentry.message.content\n\t\t\t.filter((content) => content.type === \"text\")\n\t\t\t.map((content) => content.text)\n\t\t\t.join(\" \"),\n\t);\n}\n\nfunction flattenTree(nodes: readonly SessionTreeNode[], leafId: string | undefined): FlatTreeNode[] {\n\tconst parents = new Map<string, string>();\n\tconst raw: Array<Omit<FlatTreeNode, \"isCurrentPath\">> = [];\n\ttype PendingNode = {\n\t\treadonly node: SessionTreeNode;\n\t\treadonly indent: number;\n\t\treadonly justBranched: boolean;\n\t\treadonly showConnector: boolean;\n\t\treadonly isLast: boolean;\n\t\treadonly gutters: readonly TreeGutter[];\n\t};\n\tconst stack: PendingNode[] = [];\n\tconst multipleRoots = nodes.length > 1;\n\n\tfor (let index = nodes.length - 1; index >= 0; index -= 1) {\n\t\tconst node = nodes[index];\n\t\tif (!node) continue;\n\t\tstack.push({\n\t\t\tnode,\n\t\t\tindent: multipleRoots ? 1 : 0,\n\t\t\tjustBranched: multipleRoots,\n\t\t\tshowConnector: multipleRoots,\n\t\t\tisLast: index === nodes.length - 1,\n\t\t\tgutters: [],\n\t\t});\n\t}\n\n\twhile (stack.length > 0) {\n\t\tconst current = stack.pop();\n\t\tif (!current) continue;\n\t\traw.push({\n\t\t\tentry: current.node.entry,\n\t\t\tindent: current.indent,\n\t\t\tshowConnector: current.showConnector,\n\t\t\tisLast: current.isLast,\n\t\t\tgutters: current.gutters,\n\t\t});\n\t\tconst children = current.node.children;\n\t\tconst multipleChildren = children.length > 1;\n\t\tconst childIndent = multipleChildren\n\t\t\t? current.indent + 1\n\t\t\t: current.justBranched && current.indent > 0\n\t\t\t\t? current.indent + 1\n\t\t\t\t: current.indent;\n\t\tconst childGutters =\n\t\t\tcurrent.showConnector && current.indent > 0\n\t\t\t\t? [...current.gutters, { level: current.indent - 1, continues: !current.isLast }]\n\t\t\t\t: current.gutters;\n\t\tfor (let index = children.length - 1; index >= 0; index -= 1) {\n\t\t\tconst child = children[index];\n\t\t\tif (!child) continue;\n\t\t\tparents.set(child.entry.id, current.node.entry.id);\n\t\t\tstack.push({\n\t\t\t\tnode: child,\n\t\t\t\tindent: childIndent,\n\t\t\t\tjustBranched: multipleChildren,\n\t\t\t\tshowConnector: multipleChildren,\n\t\t\t\tisLast: index === children.length - 1,\n\t\t\t\tgutters: childGutters,\n\t\t\t});\n\t\t}\n\t}\n\n\tconst currentPath = new Set<string>();\n\tfor (let current = leafId; current; current = parents.get(current)) currentPath.add(current);\n\treturn raw.map((node) => ({ ...node, isCurrentPath: currentPath.has(node.entry.id) }));\n}\n\n/** Compact, keyboard-driven session tree browser. It only renders and delegates all state changes to its caller. */\nexport class TreeSelector implements Component, Focusable {\n\tfocused = false;\n\tprivate readonly options: TreeSelectorOptions;\n\tprivate readonly nodes: readonly FlatTreeNode[];\n\tprivate selectedIndex = 0;\n\n\tconstructor(options: TreeSelectorOptions) {\n\t\tthis.options = options;\n\t\tthis.nodes = flattenTree(options.nodes, options.leafId);\n\t\tconst selected = this.nodes.findIndex((node) => node.entry.id === options.leafId);\n\t\tif (selected >= 0) this.selectedIndex = selected;\n\t}\n\n\tinvalidate(): void {}\n\n\trender(width: number): string[] {\n\t\tif (width <= 0) return [];\n\t\tif (this.nodes.length === 0)\n\t\t\treturn new SelectionPanel({ emptyText: translate(this.options.locale, \"treeEmpty\"), total: 0 }).render(width);\n\n\t\tconst start = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(MAX_VISIBLE_NODES / 2), this.nodes.length - MAX_VISIBLE_NODES),\n\t\t);\n\t\tconst end = Math.min(this.nodes.length, start + MAX_VISIBLE_NODES);\n\t\tconst rows: string[] = [];\n\t\tfor (let index = start; index < end; index += 1) {\n\t\t\tconst node = this.nodes[index];\n\t\t\tif (node) rows.push(this.renderNode(node));\n\t\t}\n\t\treturn new SelectionPanel({\n\t\t\trows,\n\t\t\tselectedIndex: this.selectedIndex - start,\n\t\t\tposition: this.selectedIndex + 1,\n\t\t\ttotal: this.nodes.length,\n\t\t\thint: this.actionHint(),\n\t\t}).render(width);\n\t}\n\n\thandleInput(data: string): void {\n\t\tif (matchesKey(data, Key.up)) {\n\t\t\tthis.move(-1);\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, Key.down)) {\n\t\t\tthis.move(1);\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, Key.enter)) {\n\t\t\tthis.select(\"continue\");\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, Key.escape) || matchesKey(data, Key.ctrl(\"c\"))) {\n\t\t\tthis.options.onCancel?.();\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, \"e\")) {\n\t\t\tthis.select(\"edit\");\n\t\t\treturn;\n\t\t}\n\t\tif (matchesKey(data, \"s\")) this.select(\"summarize\");\n\t}\n\n\tprivate renderNode(node: FlatTreeNode): string {\n\t\tconst prefix = this.renderPrefix(node);\n\t\tconst currentPath = node.isCurrentPath ? paint(CYAN, \"• \") : \" \";\n\t\tconst content = this.entryDisplay(node.entry);\n\t\treturn `${prefix}${currentPath}${content}`;\n\t}\n\n\tprivate renderPrefix(node: FlatTreeNode): string {\n\t\tconst levels: string[] = [];\n\t\tfor (let level = 0; level < node.indent; level += 1) {\n\t\t\tconst gutter = node.gutters.find((candidate) => candidate.level === level);\n\t\t\tif (gutter) {\n\t\t\t\tlevels.push(paint(DIM, gutter.continues ? \"│ \" : \" \"));\n\t\t\t} else if (node.showConnector && level === node.indent - 1) {\n\t\t\t\tlevels.push(paint(DIM, node.isLast ? \"└─ \" : \"├─ \"));\n\t\t\t} else {\n\t\t\t\tlevels.push(\" \");\n\t\t\t}\n\t\t}\n\t\treturn levels.join(\"\");\n\t}\n\n\tprivate entryDisplay(entry: SessionEntry): string {\n\t\tconst text = textContent(entry);\n\t\tif (entry.type === \"summary\") return `${paint(YELLOW, \"summary: \")}${text || paint(DIM, \"(empty)\")}`;\n\t\tif (entry.type === \"plugin\") return `${paint(DIM, \"plugin: \")}${text || paint(DIM, \"(empty)\")}`;\n\t\tif (entry.message.role === \"user\") return `${paint(CYAN, \"user: \")}${text || paint(DIM, \"(empty)\")}`;\n\t\tif (entry.message.role === \"assistant\") {\n\t\t\tif (text) return `${paint(GREEN, \"assistant: \")}${text}`;\n\t\t\tif (entry.message.stopReason === \"aborted\") return `${paint(GREEN, \"assistant: \")}${paint(DIM, \"(aborted)\")}`;\n\t\t\tif (entry.message.stopReason === \"error\") return `${paint(GREEN, \"assistant: \")}${paint(RED, \"(error)\")}`;\n\t\t\treturn `${paint(GREEN, \"assistant: \")}${paint(DIM, \"(no text)\")}`;\n\t\t}\n\t\treturn `${paint(DIM, `${entry.message.toolName}: `)}${text || paint(DIM, \"(no text)\")}`;\n\t}\n\n\tprivate actionHint(): string {\n\t\treturn `Enter ${translate(this.options.locale, \"treeContinue\")} · e ${translate(this.options.locale, \"treeEdit\")} · s ${translate(this.options.locale, \"treeSummarize\")} · Esc ${translate(this.options.locale, \"treeCancel\")}`;\n\t}\n\n\tprivate move(direction: -1 | 1): void {\n\t\tif (this.nodes.length === 0) return;\n\t\tthis.selectedIndex = (this.selectedIndex + direction + this.nodes.length) % this.nodes.length;\n\t}\n\n\tprivate select(action: \"continue\" | \"edit\" | \"summarize\"): void {\n\t\tconst entry = this.nodes[this.selectedIndex]?.entry;\n\t\tif (!entry) return;\n\t\tif (action === \"continue\") this.options.onContinue?.(entry);\n\t\telse if (action === \"edit\") this.options.onEdit?.(entry);\n\t\telse this.options.onSummarize?.(entry);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { type PluginObservationService, pluginDumpComposition, pluginDumpCompositionKey, } from "./runtime/plugin-observability-entry.ts";
|
|
2
|
+
export declare const apiVersion: number | undefined;
|
|
3
|
+
export declare const name: string;
|
|
4
|
+
export declare const version: string | undefined;
|
|
5
|
+
export declare const apply: import("@di-code/plugin-runtime").PluginApply<unknown>;
|
|
6
|
+
//# sourceMappingURL=plugin-dump-composition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-dump-composition.d.ts","sourceRoot":"","sources":["../src/plugin-dump-composition.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,wBAAwB,GACxB,MAAM,yCAAyC,CAAC;AACjD,eAAO,MAAM,UAAU,oBAAmC,CAAC;AAC3D,eAAO,MAAM,IAAI,QAA6B,CAAC;AAC/C,eAAO,MAAM,OAAO,oBAAgC,CAAC;AACrD,eAAO,MAAM,KAAK,wDAA8B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { pluginDumpComposition } from "./runtime/plugin-observability-entry.js";
|
|
2
|
+
export { pluginDumpComposition, pluginDumpCompositionKey, } from "./runtime/plugin-observability-entry.js";
|
|
3
|
+
export const apiVersion = pluginDumpComposition.apiVersion;
|
|
4
|
+
export const name = pluginDumpComposition.name;
|
|
5
|
+
export const version = pluginDumpComposition.version;
|
|
6
|
+
export const apply = pluginDumpComposition.apply;
|
|
7
|
+
//# sourceMappingURL=plugin-dump-composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-dump-composition.js","sourceRoot":"","sources":["../src/plugin-dump-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF,OAAO,EAEN,qBAAqB,EACrB,wBAAwB,GACxB,MAAM,yCAAyC,CAAC;AACjD,MAAM,CAAC,MAAM,UAAU,GAAG,qBAAqB,CAAC,UAAU,CAAC;AAC3D,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;AAC/C,MAAM,CAAC,MAAM,OAAO,GAAG,qBAAqB,CAAC,OAAO,CAAC;AACrD,MAAM,CAAC,MAAM,KAAK,GAAG,qBAAqB,CAAC,KAAK,CAAC","sourcesContent":["import { pluginDumpComposition } from \"./runtime/plugin-observability-entry.ts\";\n\nexport {\n\ttype PluginObservationService,\n\tpluginDumpComposition,\n\tpluginDumpCompositionKey,\n} from \"./runtime/plugin-observability-entry.ts\";\nexport const apiVersion = pluginDumpComposition.apiVersion;\nexport const name = pluginDumpComposition.name;\nexport const version = pluginDumpComposition.version;\nexport const apply = pluginDumpComposition.apply;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { pluginInventory } from "./runtime/plugin-inventory-entry.ts";
|
|
2
|
+
export { type PluginInventoryService, pluginInventoryKey } from "./runtime/plugin-inventory-service.ts";
|
|
3
|
+
export declare const apiVersion: number | undefined;
|
|
4
|
+
export declare const name: string;
|
|
5
|
+
export declare const version: string | undefined;
|
|
6
|
+
export declare const apply: import("@di-code/plugin-runtime").PluginApply<unknown>;
|
|
7
|
+
//# sourceMappingURL=plugin-inventory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-inventory.d.ts","sourceRoot":"","sources":["../src/plugin-inventory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,KAAK,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACxG,eAAO,MAAM,UAAU,oBAA6B,CAAC;AACrD,eAAO,MAAM,IAAI,QAAuB,CAAC;AACzC,eAAO,MAAM,OAAO,oBAA0B,CAAC;AAC/C,eAAO,MAAM,KAAK,wDAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { pluginInventory } from "./runtime/plugin-inventory-entry.js";
|
|
2
|
+
export { pluginInventory } from "./runtime/plugin-inventory-entry.js";
|
|
3
|
+
export { pluginInventoryKey } from "./runtime/plugin-inventory-service.js";
|
|
4
|
+
export const apiVersion = pluginInventory.apiVersion;
|
|
5
|
+
export const name = pluginInventory.name;
|
|
6
|
+
export const version = pluginInventory.version;
|
|
7
|
+
export const apply = pluginInventory.apply;
|
|
8
|
+
//# sourceMappingURL=plugin-inventory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-inventory.js","sourceRoot":"","sources":["../src/plugin-inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAA+B,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACxG,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC;AACrD,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;AACzC,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC;AAC/C,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC","sourcesContent":["import { pluginInventory } from \"./runtime/plugin-inventory-entry.ts\";\n\nexport { pluginInventory } from \"./runtime/plugin-inventory-entry.ts\";\nexport { type PluginInventoryService, pluginInventoryKey } from \"./runtime/plugin-inventory-service.ts\";\nexport const apiVersion = pluginInventory.apiVersion;\nexport const name = pluginInventory.name;\nexport const version = pluginInventory.version;\nexport const apply = pluginInventory.apply;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { type PluginManagementAction, type PluginManagementCommand, type PluginManagerEntryConfig, type PluginManagerService, pluginManager, pluginManagerKey, } from "./runtime/plugin-manager-entry.ts";
|
|
2
|
+
export declare const apiVersion: number | undefined;
|
|
3
|
+
export declare const name: string;
|
|
4
|
+
export declare const version: string | undefined;
|
|
5
|
+
export declare const apply: import("@di-code/plugin-runtime").PluginApply<import("./runtime/plugin-manager-entry.ts").PluginManagerEntryConfig>;
|
|
6
|
+
//# sourceMappingURL=plugin-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-manager.d.ts","sourceRoot":"","sources":["../src/plugin-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,aAAa,EACb,gBAAgB,GAChB,MAAM,mCAAmC,CAAC;AAC3C,eAAO,MAAM,UAAU,oBAA2B,CAAC;AACnD,eAAO,MAAM,IAAI,QAAqB,CAAC;AACvC,eAAO,MAAM,OAAO,oBAAwB,CAAC;AAC7C,eAAO,MAAM,KAAK,qHAAsB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { pluginManager } from "./runtime/plugin-manager-entry.js";
|
|
2
|
+
export { pluginManager, pluginManagerKey, } from "./runtime/plugin-manager-entry.js";
|
|
3
|
+
export const apiVersion = pluginManager.apiVersion;
|
|
4
|
+
export const name = pluginManager.name;
|
|
5
|
+
export const version = pluginManager.version;
|
|
6
|
+
export const apply = pluginManager.apply;
|
|
7
|
+
//# sourceMappingURL=plugin-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-manager.js","sourceRoot":"","sources":["../src/plugin-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAKN,aAAa,EACb,gBAAgB,GAChB,MAAM,mCAAmC,CAAC;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;AACnD,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;AACvC,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;AAC7C,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC","sourcesContent":["import { pluginManager } from \"./runtime/plugin-manager-entry.ts\";\n\nexport {\n\ttype PluginManagementAction,\n\ttype PluginManagementCommand,\n\ttype PluginManagerEntryConfig,\n\ttype PluginManagerService,\n\tpluginManager,\n\tpluginManagerKey,\n} from \"./runtime/plugin-manager-entry.ts\";\nexport const apiVersion = pluginManager.apiVersion;\nexport const name = pluginManager.name;\nexport const version = pluginManager.version;\nexport const apply = pluginManager.apply;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { type PluginObservationService, pluginTrace, pluginTraceKey } from "./runtime/plugin-observability-entry.ts";
|
|
2
|
+
export declare const apiVersion: number | undefined;
|
|
3
|
+
export declare const name: string;
|
|
4
|
+
export declare const version: string | undefined;
|
|
5
|
+
export declare const apply: import("@di-code/plugin-runtime").PluginApply<unknown>;
|
|
6
|
+
//# sourceMappingURL=plugin-trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-trace.d.ts","sourceRoot":"","sources":["../src/plugin-trace.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,wBAAwB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACrH,eAAO,MAAM,UAAU,oBAAyB,CAAC;AACjD,eAAO,MAAM,IAAI,QAAmB,CAAC;AACrC,eAAO,MAAM,OAAO,oBAAsB,CAAC;AAC3C,eAAO,MAAM,KAAK,wDAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { pluginTrace } from "./runtime/plugin-observability-entry.js";
|
|
2
|
+
export { pluginTrace, pluginTraceKey } from "./runtime/plugin-observability-entry.js";
|
|
3
|
+
export const apiVersion = pluginTrace.apiVersion;
|
|
4
|
+
export const name = pluginTrace.name;
|
|
5
|
+
export const version = pluginTrace.version;
|
|
6
|
+
export const apply = pluginTrace.apply;
|
|
7
|
+
//# sourceMappingURL=plugin-trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-trace.js","sourceRoot":"","sources":["../src/plugin-trace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,OAAO,EAAiC,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACrH,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;AACjD,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;AACrC,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC","sourcesContent":["import { pluginTrace } from \"./runtime/plugin-observability-entry.ts\";\n\nexport { type PluginObservationService, pluginTrace, pluginTraceKey } from \"./runtime/plugin-observability-entry.ts\";\nexport const apiVersion = pluginTrace.apiVersion;\nexport const name = pluginTrace.name;\nexport const version = pluginTrace.version;\nexport const apply = pluginTrace.apply;\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { AgentContextProvider, AgentRequestContext, AgentTool } from "@di-code/agent";
|
|
2
|
+
import { type ActiveRunSnapshot, type DynamicPackageDefinition, type DynamicPackageSnapshot, type DynamicPluginContext as DynamicPluginContextWire, DynamicPluginRuntime } from "@di-code/plugin-runtime";
|
|
3
|
+
export interface DynamicPluginApproval {
|
|
4
|
+
readonly pluginId: string;
|
|
5
|
+
readonly version: string;
|
|
6
|
+
readonly capabilities: readonly string[];
|
|
7
|
+
readonly sourceHash: string;
|
|
8
|
+
readonly sourceBytes: number;
|
|
9
|
+
readonly impact: "executes-session-code";
|
|
10
|
+
}
|
|
11
|
+
export interface DynamicPluginBrokerOptions {
|
|
12
|
+
readonly cwd: string;
|
|
13
|
+
readonly mode: "interactive" | "print" | "json";
|
|
14
|
+
readonly model?: string;
|
|
15
|
+
readonly projectTrusted?: boolean;
|
|
16
|
+
readonly reservedToolNames?: readonly string[];
|
|
17
|
+
readonly allowDynamicPlugins?: boolean;
|
|
18
|
+
readonly confirmRun?: (approval: DynamicPluginApproval) => boolean | Promise<boolean>;
|
|
19
|
+
readonly onDiagnostic?: (diagnostic: DynamicPluginDiagnostic) => void;
|
|
20
|
+
readonly killGraceMs?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface DynamicPluginDiagnostic {
|
|
23
|
+
readonly pluginId?: string;
|
|
24
|
+
readonly runId?: string;
|
|
25
|
+
readonly stage: "approval" | "spawn" | "protocol" | "stderr" | "timeout" | "exit" | "cleanup";
|
|
26
|
+
readonly message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DynamicPluginContext extends DynamicPluginContextWire {
|
|
29
|
+
readonly signal?: AbortSignal;
|
|
30
|
+
}
|
|
31
|
+
/** Owns dynamic plugin child processes and never executes dynamic source in the host process. */
|
|
32
|
+
export declare class DynamicPluginBroker {
|
|
33
|
+
readonly runtime: DynamicPluginRuntime;
|
|
34
|
+
private readonly options;
|
|
35
|
+
private reservedToolNames;
|
|
36
|
+
private readonly runs;
|
|
37
|
+
private readonly current;
|
|
38
|
+
private sessionStartEvent?;
|
|
39
|
+
private disposed;
|
|
40
|
+
constructor(options: DynamicPluginBrokerOptions);
|
|
41
|
+
/** Adds host-owned tool names that dynamic capabilities must not shadow. */
|
|
42
|
+
setReservedToolNames(names: readonly string[]): void;
|
|
43
|
+
define(definition: DynamicPackageDefinition): DynamicPackageSnapshot;
|
|
44
|
+
inspect(): import("@di-code/plugin-runtime").DynamicPluginInspection;
|
|
45
|
+
run(packageId: string, signal?: AbortSignal): Promise<ActiveRunSnapshot>;
|
|
46
|
+
update(definition: DynamicPackageDefinition, signal?: AbortSignal): Promise<ActiveRunSnapshot>;
|
|
47
|
+
stop(runId: string): Promise<ActiveRunSnapshot>;
|
|
48
|
+
remove(packageId: string): Promise<void>;
|
|
49
|
+
dispose(): Promise<void>;
|
|
50
|
+
/** Exposes the broker as model tools; execution remains subject to approval and mode checks. */
|
|
51
|
+
createTools(): readonly AgentTool[];
|
|
52
|
+
/** Resolves active dynamic capabilities into the Agent request snapshot. */
|
|
53
|
+
getContextProvider(): AgentContextProvider;
|
|
54
|
+
resolveContext(signal?: AbortSignal): Promise<AgentRequestContext>;
|
|
55
|
+
/** Delivers an Agent lifecycle event to active dynamic event capabilities. */
|
|
56
|
+
emit(event: {
|
|
57
|
+
readonly type: string;
|
|
58
|
+
} & Record<string, unknown>, signal?: AbortSignal): Promise<void>;
|
|
59
|
+
private deliverEvent;
|
|
60
|
+
private activeRuns;
|
|
61
|
+
private createDynamicTool;
|
|
62
|
+
private createDynamicMiddleware;
|
|
63
|
+
private invoke;
|
|
64
|
+
private approve;
|
|
65
|
+
private spawnChild;
|
|
66
|
+
private createRun;
|
|
67
|
+
private acceptChildRecord;
|
|
68
|
+
private resolveInvocation;
|
|
69
|
+
private resolveMiddlewareNext;
|
|
70
|
+
private fail;
|
|
71
|
+
private stopRun;
|
|
72
|
+
private kill;
|
|
73
|
+
private reportDiagnostic;
|
|
74
|
+
private assertOpen;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=dynamic-broker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-broker.d.ts","sourceRoot":"","sources":["../../src/plugins/dynamic-broker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,SAAS,EAA2B,MAAM,gBAAgB,CAAC;AAEpH,OAAO,EACN,KAAK,iBAAiB,EAGtB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAE3B,KAAK,oBAAoB,IAAI,wBAAwB,EAErD,oBAAoB,EAKpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,QAAQ,EAAE,MA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