@zvada/agent-server 0.3.25 → 0.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +113 -0
- package/README.md +4 -1
- package/dist/client/client.js +27 -11
- package/dist/client/connection.js +35 -3
- package/dist/core/agents/acp/acp-agent.js +91 -14
- package/dist/core/agents/acp/mappings.js +5 -1
- package/dist/core/agents/claude-code/approvals.js +3 -2
- package/dist/core/agents/claude-code/claude-agent.js +12 -2
- package/dist/core/agents/claude-code/mcp.js +9 -1
- package/dist/core/agents/claude-code/models.js +16 -10
- package/dist/core/agents/claude-code/options.js +23 -2
- package/dist/core/agents/claude-code/session.js +21 -1
- package/dist/core/agents/claude-code/tools.js +9 -4
- package/dist/core/agents/claude-code/turn.js +2 -0
- package/dist/core/agents/codex-app-server/adapter.js +2 -0
- package/dist/core/agents/codex-app-server/client.js +8 -5
- package/dist/core/agents/codex-app-server/codex-agent.js +35 -2
- package/dist/core/agents/codex-app-server/effort.js +13 -6
- package/dist/core/agents/codex-app-server/mcp.js +35 -18
- package/dist/core/agents/codex-app-server/models.js +10 -10
- package/dist/core/agents/codex-app-server/options.js +11 -2
- package/dist/core/agents/codex-app-server/plan-approval.js +1 -1
- package/dist/core/agents/codex-app-server/session.js +11 -4
- package/dist/core/agents/codex-app-server/thread-settings.js +30 -11
- package/dist/core/agents/host-tools.js +493 -0
- package/dist/core/agents/mcp-config.js +6 -2
- package/dist/core/agents/scripted/scripted-agent.js +39 -6
- package/dist/core/agents/scripted/steps.js +5 -1
- package/dist/core/agents/session-agent.js +70 -2
- package/dist/core/agents/thinking-levels.js +8 -5
- package/dist/core/index.js +1 -0
- package/dist/core/presets.js +16 -3
- package/dist/core/processes/lifeline.js +9 -5
- package/dist/core/provision/pins.js +7 -16
- package/dist/core/provision/releases.js +25 -25
- package/dist/core/proxy/loopback.js +22 -4
- package/dist/core/runtime/agent-runtime.js +15 -5
- package/dist/core/runtime/event-processor.js +13 -8
- package/dist/core/runtime/origin-line.js +42 -0
- package/dist/core/runtime/request-broker.js +2 -1
- package/dist/core/runtime/steering.js +4 -3
- package/dist/core/runtime/turn.js +6 -4
- package/dist/operator/errors.js +97 -0
- package/dist/operator/index.js +10 -5
- package/dist/operator/mcp.js +7 -12
- package/dist/operator/operator.js +1336 -380
- package/dist/operator/refs.js +59 -0
- package/dist/operator/render.js +171 -74
- package/dist/operator/session-tools.js +87 -0
- package/dist/operator/types.js +30 -0
- package/dist/operator/view.js +82 -27
- package/dist/protocol/config.js +33 -6
- package/dist/protocol/conversation.js +3 -0
- package/dist/protocol/history.js +2 -1
- package/dist/protocol/index.js +1 -0
- package/dist/protocol/lifecycle.js +19 -0
- package/dist/protocol/model-catalog.js +58 -18
- package/dist/protocol/models.js +6 -27
- package/dist/protocol/origin.js +39 -0
- package/dist/protocol/reduce.js +2 -0
- package/dist/protocol/thinking.js +22 -9
- package/dist/protocol/wire-api.js +2 -2
- package/dist/protocol/wire.js +17 -0
- package/dist/server/bin.js +6 -4
- package/dist/server/routes.js +15 -5
- package/dist/types/client/client.d.ts.map +1 -1
- package/dist/types/client/connection.d.ts +14 -2
- package/dist/types/client/connection.d.ts.map +1 -1
- package/dist/types/client/turns.d.ts +2 -2
- package/dist/types/client/turns.d.ts.map +1 -1
- package/dist/types/core/agents/acp/acp-agent.d.ts +15 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
- package/dist/types/core/agents/acp/mappings.d.ts +5 -1
- package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
- package/dist/types/core/agents/acp/requests.d.ts +2 -0
- package/dist/types/core/agents/acp/requests.d.ts.map +1 -1
- package/dist/types/core/agents/base.d.ts +2 -0
- package/dist/types/core/agents/base.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/approvals.d.ts +2 -1
- package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/claude-agent.d.ts +1 -0
- package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/mcp.d.ts +8 -1
- package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/models.d.ts +9 -5
- package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/options.d.ts +10 -1
- package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/session.d.ts +2 -0
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/turn.d.ts +3 -0
- package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/client.d.ts +2 -0
- package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +11 -0
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/effort.d.ts +7 -7
- package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/mcp.d.ts +11 -3
- package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/models.d.ts +4 -1
- package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/options.d.ts +9 -2
- package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/requests.d.ts +2 -0
- package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/session.d.ts +6 -3
- package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
- package/dist/types/core/agents/host-tools.d.ts +162 -0
- package/dist/types/core/agents/host-tools.d.ts.map +1 -0
- package/dist/types/core/agents/mcp-config.d.ts +11 -2
- package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
- package/dist/types/core/agents/scripted/scripted-agent.d.ts +14 -1
- package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -1
- package/dist/types/core/agents/scripted/steps.d.ts.map +1 -1
- package/dist/types/core/agents/session-agent.d.ts +2 -7
- package/dist/types/core/agents/session-agent.d.ts.map +1 -1
- package/dist/types/core/agents/thinking-levels.d.ts +7 -3
- package/dist/types/core/agents/thinking-levels.d.ts.map +1 -1
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/presets.d.ts +11 -1
- package/dist/types/core/presets.d.ts.map +1 -1
- package/dist/types/core/processes/lifeline.d.ts.map +1 -1
- package/dist/types/core/provision/pins.d.ts +5 -4
- package/dist/types/core/provision/pins.d.ts.map +1 -1
- package/dist/types/core/proxy/loopback.d.ts.map +1 -1
- package/dist/types/core/runtime/agent-runtime.d.ts +4 -2
- package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
- package/dist/types/core/runtime/event-processor.d.ts +2 -2
- package/dist/types/core/runtime/event-processor.d.ts.map +1 -1
- package/dist/types/core/runtime/origin-line.d.ts +15 -0
- package/dist/types/core/runtime/origin-line.d.ts.map +1 -0
- package/dist/types/core/runtime/request-broker.d.ts +1 -1
- package/dist/types/core/runtime/request-broker.d.ts.map +1 -1
- package/dist/types/core/runtime/steering.d.ts +7 -4
- package/dist/types/core/runtime/steering.d.ts.map +1 -1
- package/dist/types/core/runtime/turn.d.ts.map +1 -1
- package/dist/types/operator/errors.d.ts +83 -0
- package/dist/types/operator/errors.d.ts.map +1 -0
- package/dist/types/operator/index.d.ts +10 -5
- package/dist/types/operator/index.d.ts.map +1 -1
- package/dist/types/operator/mcp.d.ts +1 -1
- package/dist/types/operator/mcp.d.ts.map +1 -1
- package/dist/types/operator/operator.d.ts +15 -197
- package/dist/types/operator/operator.d.ts.map +1 -1
- package/dist/types/operator/refs.d.ts +25 -0
- package/dist/types/operator/refs.d.ts.map +1 -0
- package/dist/types/operator/render.d.ts +59 -19
- package/dist/types/operator/render.d.ts.map +1 -1
- package/dist/types/operator/session-tools.d.ts +61 -0
- package/dist/types/operator/session-tools.d.ts.map +1 -0
- package/dist/types/operator/types.d.ts +441 -0
- package/dist/types/operator/types.d.ts.map +1 -0
- package/dist/types/operator/view.d.ts +19 -29
- package/dist/types/operator/view.d.ts.map +1 -1
- package/dist/types/protocol/config.d.ts +32 -24
- package/dist/types/protocol/config.d.ts.map +1 -1
- package/dist/types/protocol/conversation.d.ts +48 -39
- package/dist/types/protocol/conversation.d.ts.map +1 -1
- package/dist/types/protocol/execution.d.ts +2 -18
- package/dist/types/protocol/execution.d.ts.map +1 -1
- package/dist/types/protocol/history.d.ts +1 -1
- package/dist/types/protocol/history.d.ts.map +1 -1
- package/dist/types/protocol/index.d.ts +1 -0
- package/dist/types/protocol/index.d.ts.map +1 -1
- package/dist/types/protocol/lifecycle.d.ts +48 -74
- package/dist/types/protocol/lifecycle.d.ts.map +1 -1
- package/dist/types/protocol/model-catalog.d.ts.map +1 -1
- package/dist/types/protocol/models.d.ts +4 -42
- package/dist/types/protocol/models.d.ts.map +1 -1
- package/dist/types/protocol/origin.d.ts +49 -0
- package/dist/types/protocol/origin.d.ts.map +1 -0
- package/dist/types/protocol/reduce.d.ts.map +1 -1
- package/dist/types/protocol/thinking.d.ts +19 -19
- package/dist/types/protocol/thinking.d.ts.map +1 -1
- package/dist/types/protocol/wire-api.d.ts +59 -106
- package/dist/types/protocol/wire-api.d.ts.map +1 -1
- package/dist/types/protocol/wire.d.ts +81 -119
- package/dist/types/protocol/wire.d.ts.map +1 -1
- package/dist/types/server/routes.d.ts.map +1 -1
- package/docs/consuming.md +124 -132
- package/docs/deploy.md +6 -5
- package/docs/harnesses.md +79 -31
- package/docs/sync-history.md +2 -1
- package/package.json +4 -4
- package/src/client/client.ts +36 -9
- package/src/client/connection.ts +31 -1
- package/src/client/turns.ts +2 -1
- package/src/core/agents/acp/acp-agent.ts +123 -17
- package/src/core/agents/acp/mappings.ts +5 -1
- package/src/core/agents/acp/requests.ts +2 -0
- package/src/core/agents/base.ts +2 -0
- package/src/core/agents/claude-code/approvals.ts +4 -3
- package/src/core/agents/claude-code/claude-agent.ts +14 -2
- package/src/core/agents/claude-code/mcp.ts +11 -1
- package/src/core/agents/claude-code/models.ts +15 -10
- package/src/core/agents/claude-code/options.ts +33 -3
- package/src/core/agents/claude-code/session.ts +26 -1
- package/src/core/agents/claude-code/tools.ts +10 -4
- package/src/core/agents/claude-code/turn.ts +4 -0
- package/src/core/agents/codex-app-server/adapter.ts +2 -0
- package/src/core/agents/codex-app-server/client.ts +11 -5
- package/src/core/agents/codex-app-server/codex-agent.ts +45 -1
- package/src/core/agents/codex-app-server/effort.ts +15 -20
- package/src/core/agents/codex-app-server/mcp.ts +46 -23
- package/src/core/agents/codex-app-server/models.ts +10 -10
- package/src/core/agents/codex-app-server/options.ts +16 -2
- package/src/core/agents/codex-app-server/plan-approval.ts +1 -1
- package/src/core/agents/codex-app-server/requests.ts +2 -0
- package/src/core/agents/codex-app-server/session.ts +19 -4
- package/src/core/agents/codex-app-server/thread-settings.ts +31 -11
- package/src/core/agents/host-tools.ts +649 -0
- package/src/core/agents/mcp-config.ts +15 -3
- package/src/core/agents/scripted/scripted-agent.ts +51 -5
- package/src/core/agents/scripted/steps.ts +5 -1
- package/src/core/agents/session-agent.ts +78 -2
- package/src/core/agents/thinking-levels.ts +9 -6
- package/src/core/index.ts +9 -0
- package/src/core/presets.ts +28 -4
- package/src/core/processes/lifeline.ts +9 -5
- package/src/core/provision/pins.ts +7 -16
- package/src/core/provision/releases.ts +25 -25
- package/src/core/proxy/loopback.ts +25 -4
- package/src/core/runtime/agent-runtime.ts +31 -7
- package/src/core/runtime/event-processor.ts +13 -6
- package/src/core/runtime/origin-line.ts +43 -0
- package/src/core/runtime/request-broker.ts +2 -0
- package/src/core/runtime/steering.ts +8 -4
- package/src/core/runtime/turn.ts +11 -4
- package/src/operator/errors.ts +218 -0
- package/src/operator/index.ts +18 -23
- package/src/operator/mcp.ts +7 -16
- package/src/operator/operator.ts +1583 -613
- package/src/operator/refs.ts +75 -0
- package/src/operator/render.ts +208 -98
- package/src/operator/session-tools.ts +126 -0
- package/src/operator/types.ts +505 -0
- package/src/operator/view.ts +93 -42
- package/src/protocol/config.ts +36 -7
- package/src/protocol/conversation.ts +3 -0
- package/src/protocol/history.ts +2 -1
- package/src/protocol/index.ts +1 -0
- package/src/protocol/lifecycle.ts +21 -0
- package/src/protocol/model-catalog.ts +58 -18
- package/src/protocol/models.ts +6 -26
- package/src/protocol/origin.ts +47 -0
- package/src/protocol/reduce.ts +4 -0
- package/src/protocol/thinking.ts +27 -14
- package/src/protocol/wire-api.ts +2 -2
- package/src/protocol/wire.ts +18 -0
- package/src/server/bin.ts +6 -4
- package/src/server/routes.ts +16 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifeline.d.ts","sourceRoot":"","sources":["../../../../src/core/processes/lifeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lifeline.d.ts","sourceRoot":"","sources":["../../../../src/core/processes/lifeline.ts"],"names":[],"mappings":"AAyKA;;;;GAIG;AACH,cAAM,QAAQ;IAOD,OAAO,CAAC,QAAQ,CAAC,OAAO;IANpC,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,SAAS,CAAK;IACtB,mFAAmF;IACnF,OAAO,CAAC,MAAM,CAAS;gBAEM,OAAO,EAAE,MAAM;IAE5C,uEAAuE;IACvE,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAM5B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI1B,qFAAqF;IACrF,OAAO,CAAC,MAAM;IAoCd,OAAO,CAAC,KAAK;CAQb;AAID,qGAAqG;AACrG,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAGlD;AAED,yDAAyD;AACzD,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAEhD"}
|
|
@@ -15,10 +15,11 @@ import type { CliTool } from "./tools.ts";
|
|
|
15
15
|
* `auto` an installed `@openai/codex` package (a lockfile's) runs instead,
|
|
16
16
|
* and a `codex` on PATH only in `system` mode.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* A bump is `bun run bump -- <tool>`: it writes what changed upstream, moves
|
|
19
|
+
* the pin, and runs both refreshes, `releases:refresh` (each platform's build
|
|
20
|
+
* and its checksums, `releases.ts`) and `models:refresh` (the model catalog,
|
|
21
|
+
* which records the versions that listed it); tests fail until both match
|
|
22
|
+
* these pins. The `bump-clis` skill says what to read and prove.
|
|
22
23
|
*/
|
|
23
24
|
export declare const DEFAULT_PINS: Record<CliTool, string>;
|
|
24
25
|
//# sourceMappingURL=pins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pins.d.ts","sourceRoot":"","sources":["../../../../src/core/provision/pins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"pins.d.ts","sourceRoot":"","sources":["../../../../src/core/provision/pins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAGhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loopback.d.ts","sourceRoot":"","sources":["../../../../src/core/proxy/loopback.ts"],"names":[],"mappings":"AAGA,iDAAiD;AACjD,MAAM,WAAW,QAAQ;IACxB,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"loopback.d.ts","sourceRoot":"","sources":["../../../../src/core/proxy/loopback.ts"],"names":[],"mappings":"AAGA,iDAAiD;AACjD,MAAM,WAAW,QAAQ;IACxB,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AA0DD;;;;;GAKG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,GAC7C,OAAO,CAAC,QAAQ,CAAC,CAoDnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentCapabilities, AgentHarness, AuthLogin, AuthLoginParams, AuthUpdated, ElicitationOutcome, HarnessAuth, HarnessCli, HarnessCliProgress, ModelList, ModelsListParams, PermissionOutcome, RunRequest, TurnSteerResult } from "../../protocol/index.ts";
|
|
1
|
+
import type { AgentCapabilities, AgentHarness, AuthLogin, AuthLoginParams, AuthUpdated, ElicitationOutcome, HarnessAuth, HarnessCli, HarnessCliProgress, ModelList, ModelsListParams, Origin, PermissionOutcome, RunRequest, TurnSteerResult } from "../../protocol/index.ts";
|
|
2
2
|
import type { CancelResult, SteerRequest } from "../agents/base.ts";
|
|
3
3
|
import type { AgentRegistry } from "../agents/registry.ts";
|
|
4
4
|
import type { DiagnosticHandler } from "../diagnostics.ts";
|
|
@@ -148,7 +148,9 @@ export declare class AgentRuntime {
|
|
|
148
148
|
* ended; the same id with other input throws `TurnConflictError`. Input the
|
|
149
149
|
* harness cannot take throws, as it would fail a turn.
|
|
150
150
|
*/
|
|
151
|
-
steer(sessionId: string, request: SteerRequest
|
|
151
|
+
steer(sessionId: string, request: SteerRequest & {
|
|
152
|
+
origin?: Origin;
|
|
153
|
+
}): Promise<TurnSteerResult>;
|
|
152
154
|
/** Whether another turn of the session, live or remembered, took this steer id. */
|
|
153
155
|
private steerIdTaken;
|
|
154
156
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-runtime.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/agent-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-runtime.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/agent-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,MAAM,yBAAyB,CAAC;AAOjC,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAG1F,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAOjE,OAAO,EACN,KAAK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M;IAgBd;;;;;;;;OAQG;IACG,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAO7E;;;;;;;OAOG;IACG,KAAK,CACV,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GACzC,OAAO,CAAC,eAAe,CAAC;IA6C3B,mFAAmF;IACnF,OAAO,CAAC,YAAY;IAQpB;;;;;;OAMG;IACH,wBAAwB,IAAI,IAAI;IAMhC;;;;;OAKG;IACH,eAAe,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAAG,MAAM,IAAI;IAI1E;;;;OAIG;IACH,iBAAiB,IAAI,GAAG,CAAC,YAAY,CAAC;IAStC;;;;;OAKG;IACH,WAAW,CAAC,CAAC,SAAS,YAAY,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;IAI1F,yEAAyE;IACnE,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW3E,QAAQ,CAAC,IAAI,GAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YAMjD,eAAe;IAqB7B,0DAA0D;IAC1D,OAAO,CAAC,OAAO;IAIf,yFAAyF;IACzF,OAAO,CAAC,QAAQ;CAQhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentInput, LifecycleEvent, TurnEndedEvent, TurnExecution } from "../../protocol/index.ts";
|
|
1
|
+
import type { AgentInput, LifecycleEvent, Origin, TurnEndedEvent, TurnExecution } from "../../protocol/index.ts";
|
|
2
2
|
import type { AppliedExecution } from "../agents/base.ts";
|
|
3
3
|
import type { AdapterEvent, TransformResult } from "../agents/types.ts";
|
|
4
4
|
import type { TurnSteers } from "./steering.ts";
|
|
@@ -52,7 +52,7 @@ export declare class EventProcessor {
|
|
|
52
52
|
* id (`echoMessageId`), so a consumer that minted the turnId can predict the
|
|
53
53
|
* whole echo instead of reconciling a look-alike against it.
|
|
54
54
|
*/
|
|
55
|
-
echoUserMessage(input: AgentInput): Generator<LifecycleEvent>;
|
|
55
|
+
echoUserMessage(input: AgentInput, origin?: Origin): Generator<LifecycleEvent>;
|
|
56
56
|
/**
|
|
57
57
|
* A steer's echo: a complete user message at the point the agent read it,
|
|
58
58
|
* after whatever it had produced so far. Its ids derive from the steer id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-processor.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/event-processor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-processor.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/event-processor.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACX,UAAU,EAEV,cAAc,EACd,MAAM,EAEN,cAAc,EACd,aAAa,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqDrD;;;;;;;;;GASG;AACH,qBAAa,cAAc;IAsBzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,gFAAgF;IAChF,OAAO,CAAC,QAAQ,CAAC,MAAM;IAzBxB,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,iFAAiF;IACjF,OAAO,CAAC,iBAAiB,CAAC,C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YAAY;IASpB,OAAO,CAAE,YAAY;IAarB;;;gFAG4E;IAC5E,OAAO,CAAE,aAAa;IAOtB,OAAO,CAAE,QAAQ;IA8BjB;;;;OAIG;IACH,OAAO,CAAE,KAAK;CAkBd"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AgentInput, type Origin } from "../../protocol/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The one line an agent is given before a message that is not the person's,
|
|
4
|
+
* saying who sent it. Undefined for the person, whose messages carry none.
|
|
5
|
+
* The names and ids are the host's and untrusted: each is one JSON-quoted
|
|
6
|
+
* line, so none can end the line, the bracket or the quote.
|
|
7
|
+
*/
|
|
8
|
+
export declare function originLine(origin: Origin | undefined): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* The input as its agent is given it: the sender's line first when it is not
|
|
11
|
+
* the person (to text after a blank line; before a list as a text part of its
|
|
12
|
+
* own). The echo, and every store, keep the caller's input as it was sent.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withOriginLine(input: AgentInput, origin: Origin | undefined): AgentInput;
|
|
15
|
+
//# sourceMappingURL=origin-line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin-line.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/origin-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,MAAM,EAAe,MAAM,yBAAyB,CAAC;AAGpF;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CASzE;AAcD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAKxF"}
|
|
@@ -33,7 +33,7 @@ export declare class RequestBroker {
|
|
|
33
33
|
/** Whether it takes requests: until its turn ends, or its sink fails. */
|
|
34
34
|
get open(): boolean;
|
|
35
35
|
/** Ask whether a tool may run; resolves with the answer, or a cancel. */
|
|
36
|
-
askPermission(toolCall: PermissionToolCall, options: PermissionOption[], signal?: AbortSignal): Promise<PermissionOutcome>;
|
|
36
|
+
askPermission(toolCall: PermissionToolCall, options: PermissionOption[], signal?: AbortSignal, purpose?: "tool" | "plan"): Promise<PermissionOutcome>;
|
|
37
37
|
/** Ask the user what the agent asks; resolves with the answer, or a cancel. */
|
|
38
38
|
askElicitation(request: ElicitationRequest, signal?: AbortSignal): Promise<ElicitationOutcome>;
|
|
39
39
|
/** Answer an open request of this kind; false when it is not open here. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-broker.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/request-broker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,kBAAkB,EAElB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,kDAAkD;AAClD,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,EAAE,kBAAkB,CAAC;CAChC;AACD,MAAM,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC;AAgB/C,+DAA+D;AAC/D,UAAU,UAAU;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAoBD;;;;;;;;GAQG;AACH,qBAAa,aAAa;IASb,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAGtB;IACF,+EAA+E;IAC/E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,MAAM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AAM,CAAC,EAAE,WAAW,EACpB,OAAO,GAAE,MAAM,GAAG,MAAe,GAC/B,OAAO,CAAC,iBAAiB,CAAC;IA2B7B,+EAA+E;IAC/E,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA0B9F,2EAA2E;IAC3E,OAAO,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO;IAO9F,gGAAgG;IAC1F,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAKhC,iFAAiF;IACjF,KAAK,IAAI,IAAI;IAIb,uFAAuF;IACjF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAMd,IAAI;CAkClB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentInput, TurnSteerResult } from "../../protocol/index.ts";
|
|
1
|
+
import type { AgentInput, Origin, TurnSteerResult } from "../../protocol/index.ts";
|
|
2
2
|
import type { SteerOutcome } from "../agents/base.ts";
|
|
3
3
|
/** What a turn answered a steer: kept with the settled turn, so a retry converges. */
|
|
4
4
|
export interface SteerAnswer {
|
|
@@ -22,10 +22,13 @@ export declare class TurnSteers {
|
|
|
22
22
|
/** What it answered this steer id, if it took it. */
|
|
23
23
|
find(steerId: string): SteerAnswer | undefined;
|
|
24
24
|
/** Take a steer, and hand it to the harness with `deliver`. */
|
|
25
|
-
accept(steerId: string, inputKey: string, input: AgentInput, deliver: () => Promise<SteerOutcome
|
|
25
|
+
accept(steerId: string, inputKey: string, input: AgentInput, deliver: () => Promise<SteerOutcome>, origin?: Origin): Promise<TurnSteerResult>;
|
|
26
26
|
private answer;
|
|
27
|
-
/** The agent read a steer: its input, once, for its echo. */
|
|
28
|
-
read(steerId: string):
|
|
27
|
+
/** The agent read a steer: its input and sender, once, for its echo. */
|
|
28
|
+
read(steerId: string): {
|
|
29
|
+
input: AgentInput;
|
|
30
|
+
origin?: Origin;
|
|
31
|
+
} | undefined;
|
|
29
32
|
/** The steers it took that the agent has not read (all of them, once the turn is over). */
|
|
30
33
|
undelivered(): string[];
|
|
31
34
|
/** Its harness stopped executing: it takes no more steers. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steering.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/steering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"steering.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/steering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,sFAAsF;AACtF,MAAM,WAAW,WAAW;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC1C;AAWD;;;;;;GAMG;AACH,qBAAa,UAAU;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,KAAK,CAAS;IAEtB,mCAAmC;IACnC,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,qDAAqD;IACrD,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI9C,+DAA+D;IAC/D,MAAM,CACL,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,EACpC,MAAM,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,CAAC;YAiBb,MAAM;IAmBpB,wEAAwE;IACxE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAOzE,2FAA2F;IAC3F,WAAW,IAAI,MAAM,EAAE;IAMvB,8DAA8D;IAC9D,KAAK,IAAI,IAAI;IAIb,gEAAgE;IAChE,GAAG,IAAI,IAAI;IAIX,gFAAgF;IAChF,OAAO,IAAI,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC;CAK3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EAET,SAAS,EACT,UAAU,EACV,UAAU,EAEV,UAAU,EACV,aAAa,EACb,MAAM,yBAAyB,CAAC;AAOjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,KAAK,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../src/core/runtime/turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EAET,SAAS,EACT,UAAU,EACV,UAAU,EAEV,UAAU,EACV,aAAa,EACb,MAAM,yBAAyB,CAAC;AAOjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,KAAK,SAAS,EAAE,cAAc,EAAE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;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAC3C,oFAAoF;IACpF,OAAO,CAAC,WAAW,CAAC,CAAiB;IACrC;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,uFAAuF;IACvF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,wEAAwE;IACxE,OAAO,CAAC,OAAO,CAAC,CAAU;IAC1B,6EAA6E;IAC7E,OAAO,CAAC,SAAS,CAAS;gBAGR,OAAO,EAAE,UAAU;IACpC,wEAAwE;IAC/D,QAAQ,EAAE,MAAM,EACR,IAAI,EAAE,SAAS;IAChC,gEAAgE;IAChE,MAAM,EAAE,WAAW,EACF,IAAI,EAAE,QAAQ;IAwBhC;;;;;OAKG;IACH,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;YAQhB,OAAO;IAyGrB,6GAA6G;IAC7G,OAAO,CAAC,YAAY;IAyCpB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAqBhC;IAEF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CACkB;YAEvC,qBAAqB;IAqBnC;;;;;OAKG;YACW,IAAI;CAuBlB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The refusals: a closed set of codes (`OPERATOR_ERROR_CODES`), each with its
|
|
3
|
+
* sentence. A refusal reads `refused (<code>): <sentence>`, then the host's
|
|
4
|
+
* words, then the next call, which names only a tool that is installed.
|
|
5
|
+
*/
|
|
6
|
+
import type { OperatorErrorCode, Refusal } from "./types.ts";
|
|
7
|
+
/**
|
|
8
|
+
* A host's refusal at its own commit (`start`, `archive`, `send`): the code
|
|
9
|
+
* and the sessions it is about, by id; the package words it as its own
|
|
10
|
+
* refusal of that code, naming the sessions as the caller sees them.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Refused extends Error {
|
|
13
|
+
readonly refusal: Refusal;
|
|
14
|
+
name: string;
|
|
15
|
+
constructor(refusal: Refusal);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* What can be archived, as `archive` takes it: a chat on its own, or, for a
|
|
19
|
+
* chat that is its workspace's only one, the workspace (a host may refuse
|
|
20
|
+
* archiving a workspace's last chat on its own).
|
|
21
|
+
*/
|
|
22
|
+
export interface Archivable {
|
|
23
|
+
sessions: readonly string[];
|
|
24
|
+
workspaces: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
/** A refusal a model can act on. Anything else a tool throws is `failed`. */
|
|
27
|
+
export declare class OperatorError extends Error {
|
|
28
|
+
readonly code: OperatorErrorCode;
|
|
29
|
+
readonly extra: {
|
|
30
|
+
/** The host's words: trusted, one line, said after the sentence. */
|
|
31
|
+
detail?: string;
|
|
32
|
+
/** The next call, already built from the installed tools. */
|
|
33
|
+
next?: string;
|
|
34
|
+
retryAfter?: number;
|
|
35
|
+
/** What was done before the refusal, when something was. */
|
|
36
|
+
done?: string;
|
|
37
|
+
};
|
|
38
|
+
name: string;
|
|
39
|
+
constructor(code: OperatorErrorCode, sentence: string, extra?: {
|
|
40
|
+
/** The host's words: trusted, one line, said after the sentence. */
|
|
41
|
+
detail?: string;
|
|
42
|
+
/** The next call, already built from the installed tools. */
|
|
43
|
+
next?: string;
|
|
44
|
+
retryAfter?: number;
|
|
45
|
+
/** What was done before the refusal, when something was. */
|
|
46
|
+
done?: string;
|
|
47
|
+
});
|
|
48
|
+
get retryAfter(): number | undefined;
|
|
49
|
+
/** A refusal whose words are already built (a batch whose every item was refused). */
|
|
50
|
+
static said(code: OperatorErrorCode, text: string): OperatorError;
|
|
51
|
+
}
|
|
52
|
+
/** Build a hint for a call, or nothing when that tool is not installed. */
|
|
53
|
+
export type Hint = (tool: string, args?: Record<string, unknown>) => string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Every refusal, by code. Each takes what its sentence names and the `hint`
|
|
56
|
+
* of the operator that refuses, so its next call is one the caller has.
|
|
57
|
+
*/
|
|
58
|
+
export declare const refuse: {
|
|
59
|
+
invalidInput: (tool: string, field: string, problem: string) => OperatorError;
|
|
60
|
+
notFound: (hint: Hint, ref: string, known: readonly string[]) => OperatorError;
|
|
61
|
+
ambiguous: (ref: string, refs: readonly string[]) => OperatorError;
|
|
62
|
+
archived: (hint: Hint, ref: string, project?: string) => OperatorError;
|
|
63
|
+
self: (what: "session" | "workspace") => OperatorError;
|
|
64
|
+
readOnly: () => OperatorError;
|
|
65
|
+
access: (detail?: string) => OperatorError;
|
|
66
|
+
notYoursArchive: (ref: string, busy: readonly string[]) => OperatorError;
|
|
67
|
+
notYoursAnswer: (ref: string) => OperatorError;
|
|
68
|
+
notYoursPermission: () => OperatorError;
|
|
69
|
+
hasChildren: (hint: Hint, ref: string, children: readonly string[], archive: Archivable) => OperatorError;
|
|
70
|
+
busy: (hint: Hint, ref: string, state: "working" | "waiting on an answer" | "being set up", undone: "archived" | "started in it" | "sent") => OperatorError;
|
|
71
|
+
notWaiting: (hint: Hint, ref: string, status: string, current?: string) => OperatorError;
|
|
72
|
+
personOnly: (ref: string, why: string) => OperatorError;
|
|
73
|
+
setupFailed: (hint: Hint, ref: string, reason: string, done?: string) => OperatorError;
|
|
74
|
+
limitDepth: (depth: number) => OperatorError;
|
|
75
|
+
limitSessions: (hint: Hint, count: number, settled: Archivable) => OperatorError;
|
|
76
|
+
limitSettingUp: (retryAfter: number, detail?: string) => OperatorError;
|
|
77
|
+
limitRate: (count: number, retryAfter: number) => OperatorError;
|
|
78
|
+
limitResources: (retryAfter: number | undefined, detail?: string) => OperatorError;
|
|
79
|
+
staleCursor: (hint: Hint, ref: string) => OperatorError;
|
|
80
|
+
unsupported: (detail?: string) => OperatorError;
|
|
81
|
+
failed: () => OperatorError;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/operator/errors.ts"],"names":[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OAAO,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;AAOxF;;;GAGG;AACH,eAAO,MAAM,MAAM;yBACG,MAAM,SAAS,MAAM,WAAW,MAAM;qBAE1C,IAAI,OAAO,MAAM,SAAS,SAAS,MAAM,EAAE;qBAM3C,MAAM,QAAQ,SAAS,MAAM,EAAE;qBAK/B,IAAI,OAAO,MAAM,YAAY,MAAM;iBAIvC,SAAS,GAAG,WAAW;;sBAUlB,MAAM;2BAED,MAAM,QAAQ,SAAS,MAAM,EAAE;0BAKhC,MAAM;;wBAUR,IAAI,OAAO,MAAM,YAAY,SAAS,MAAM,EAAE,WAAW,UAAU;iBAOhF,IAAI,OACL,MAAM,SACJ,SAAS,GAAG,sBAAsB,GAAG,cAAc,UAClD,UAAU,GAAG,eAAe,GAAG,MAAM;uBAQ3B,IAAI,OAAO,MAAM,UAAU,MAAM,YAAY,MAAM;sBAUpD,MAAM,OAAO,MAAM;wBAKjB,IAAI,OAAO,MAAM,UAAU,MAAM,SAAS,MAAM;wBAShD,MAAM;0BAKJ,IAAI,SAAS,MAAM,WAAW,UAAU;iCAMjC,MAAM,WAAW,MAAM;uBAMjC,MAAM,cAAc,MAAM;iCAMhB,MAAM,GAAG,SAAS,WAAW,MAAM;wBAM5C,IAAI,OAAO,MAAM;2BAQd,MAAM;;CAO7B,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@zvada/agent-server/operator`: the session tools an outside agent
|
|
3
|
-
* product's coding agents with, and their
|
|
4
|
-
* protocol and zod; the product is the
|
|
2
|
+
* `@zvada/agent-server/operator`: the session tools an outside agent, or a
|
|
3
|
+
* product's own session, operates a product's coding agents with, and their
|
|
4
|
+
* MCP binding. Imports only the protocol and zod; the product is the
|
|
5
|
+
* `OperatorHost` (LLP 0014, LLP 0019).
|
|
5
6
|
*/
|
|
6
7
|
export { PLAN_OPTIONS, PLAN_TITLE } from "../protocol/plan.ts";
|
|
8
|
+
export { type Archivable, type Hint, OperatorError, Refused, refuse } from "./errors.ts";
|
|
7
9
|
export { type McpHandler, type McpServerInfo, type ToolSource, createMcpHandler, } from "./mcp.ts";
|
|
8
|
-
export {
|
|
10
|
+
export { DEFAULT_LIMITS, DEFAULT_WAITS, createOperator, tool } from "./operator.ts";
|
|
11
|
+
export { refOf } from "./refs.ts";
|
|
12
|
+
export { OPERATOR_GUIDANCE, type SessionTool, type SessionToolCaller, type SessionToolContent, type SessionToolSource, operatorSessionTools, } from "./session-tools.ts";
|
|
9
13
|
export { type Answer, callHint, oneLine, quote, quoted } from "./render.ts";
|
|
10
|
-
export
|
|
14
|
+
export * from "./types.ts";
|
|
15
|
+
export { type DecisionRequest, type QuestionRequest, type ViewMessage, settledStatus, turnOf, viewOf, waitingOf, } from "./view.ts";
|
|
11
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/operator/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/operator/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,EACN,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EACN,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,oBAAoB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5E,cAAc,YAAY,CAAC;AAC3B,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,aAAa,EACb,MAAM,EACN,MAAM,EACN,SAAS,GACT,MAAM,WAAW,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* result is null (a notification). It answers GET with `405`: the server
|
|
9
9
|
* never opens a stream of its own.
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import type { ToolInfo } from "./types.ts";
|
|
12
12
|
/** Anything that lists and runs tools: an operator, or a host's wrapper around one. */
|
|
13
13
|
export interface ToolSource<Caller> {
|
|
14
14
|
tools(caller: Caller): ToolInfo[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/operator/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/operator/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,uFAAuF;AACvF,MAAM,WAAW,UAAU,CAAC,MAAM;IACjC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAC;IAClC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,iFAMxB,CAAC;AAKX,MAAM,MAAM,UAAU,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAgB/F,0GAA0G;AAC1G,wBAAgB,gBAAgB,CAAC,MAAM,EACtC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,EAC1B,IAAI,EAAE,aAAa,GACjB,UAAU,CAAC,MAAM,CAAC,CA0FpB"}
|
|
@@ -1,206 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Operator tools: what a person does with a set of agent sessions, as
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
8
|
-
* answers in text. `createMcpHandler` (mcp.ts) serves them over MCP; a product
|
|
9
|
-
* adds its own tools (its projects, its diffs) beside them with `tool()` so
|
|
10
|
-
* they read as one set.
|
|
11
|
-
*
|
|
12
|
-
* The product supplies an `OperatorHost`: which sessions exist and what they are
|
|
13
|
-
* called, how to read one, and how to start, stop and answer a turn (it owns the
|
|
14
|
-
* run configuration, the storage and the authorization; the engine owns none).
|
|
2
|
+
* Operator tools: what a person does with a set of agent sessions, as calls an
|
|
3
|
+
* agent can make, whether it is an outside assistant or one of the product's
|
|
4
|
+
* own sessions (LLP 0014, LLP 0019). See who you are, list the sessions, read
|
|
5
|
+
* one, wait for some, start one, message one, answer what it asks, stop it,
|
|
6
|
+
* archive it. The product is the `OperatorHost`; the package owns the words,
|
|
7
|
+
* the waits, the rules and the limits, and holds nothing between calls.
|
|
15
8
|
*/
|
|
16
9
|
import { z } from "zod";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export interface SessionEntry {
|
|
21
|
-
/** The host's id. */
|
|
22
|
-
id: string;
|
|
23
|
-
/** What people call it; unique within its group. */
|
|
24
|
-
name: string;
|
|
25
|
-
/** What it belongs to (a project, a repository). Listed under it. */
|
|
26
|
-
group?: string;
|
|
27
|
-
phase: Phase;
|
|
28
|
-
title?: string;
|
|
29
|
-
/** Epoch milliseconds. */
|
|
30
|
-
lastActivityAt?: number;
|
|
31
|
-
/** A few words the host adds to the row (lines changed, a pull request). */
|
|
32
|
-
note?: string;
|
|
33
|
-
/** Paths in this session's tool lines are shown relative to this folder. */
|
|
34
|
-
root?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface SendOptions {
|
|
37
|
-
/** `interrupt` stops a running turn first; `auto` is refused while one runs. */
|
|
38
|
-
delivery: "auto" | "interrupt";
|
|
39
|
-
}
|
|
40
|
-
export interface ViewOptions {
|
|
41
|
-
/** The most recent messages wanted. A host may give more; the operator cuts. */
|
|
42
|
-
last?: number;
|
|
43
|
-
}
|
|
44
|
-
export interface StartInput {
|
|
45
|
-
/** The group (project) the new session is listed under. */
|
|
46
|
-
group: string;
|
|
47
|
-
/** Its first task. */
|
|
48
|
-
message: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* What `send` may resolve to. `duplicate: true`: this caller's identical
|
|
52
|
-
* request is still in flight, so nothing new was sent. Resolving to nothing
|
|
53
|
-
* (or `duplicate` absent or false) means a new turn was sent.
|
|
54
|
-
*/
|
|
55
|
-
export interface SendResult {
|
|
56
|
-
duplicate?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* One line in the host's words about what the send did that the view cannot
|
|
59
|
-
* show (for example, a message the host held that this one replaced).
|
|
60
|
-
* `send_message` says it before the outcome.
|
|
61
|
-
*/
|
|
62
|
-
note?: string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* What `start` returns: the session, with `duplicate: true` when this caller's
|
|
66
|
-
* identical start is still in flight (that session is returned) and nothing
|
|
67
|
-
* new was started.
|
|
68
|
-
*/
|
|
69
|
-
export interface StartResult extends SessionEntry {
|
|
70
|
-
duplicate?: boolean;
|
|
71
|
-
}
|
|
72
|
-
export interface OperatorHost<Caller = unknown> {
|
|
73
|
-
/** The sessions this caller may see. */
|
|
74
|
-
list(caller: Caller): Promise<SessionEntry[]>;
|
|
75
|
-
view(caller: Caller, sessionId: string, options?: ViewOptions): Promise<SessionView>;
|
|
76
|
-
/**
|
|
77
|
-
* Start a turn. The host chooses the agent, model, permissions and turn id.
|
|
78
|
-
* Refuse (throw an `OperatorError`) a turn while another runs and `delivery`
|
|
79
|
-
* is `auto`. A repeat is the same caller, the same session and the same
|
|
80
|
-
* message (trimmed) while the turn that message started is being sent or has
|
|
81
|
-
* not ended, whatever its `delivery`: send nothing and resolve to
|
|
82
|
-
* `{ duplicate: true }`. The operator then reports that turn as it stands,
|
|
83
|
-
* and never waits for a new one to show. Once that turn has ended, the same
|
|
84
|
-
* words are a new turn. Recognising a repeat is optional: a host that never
|
|
85
|
-
* reports one refuses it as busy, which is safe. With `interrupt`, resolve
|
|
86
|
-
* only once the turn it stops has ended: the operator then takes the next
|
|
87
|
-
* working view as the new turn.
|
|
88
|
-
*/
|
|
89
|
-
send(caller: Caller, sessionId: string, message: string, options: SendOptions): Promise<void | SendResult>;
|
|
90
|
-
/**
|
|
91
|
-
* Stop the session's turn. Resolve to `{ note }` when the stop is complete in
|
|
92
|
-
* a way the view cannot show (for example, a message the host held, dropped
|
|
93
|
-
* before it was sent): `stop_session` answers with the note and does not
|
|
94
|
-
* wait for the view to change.
|
|
95
|
-
*/
|
|
96
|
-
cancel(caller: Caller, sessionId: string): Promise<void | {
|
|
97
|
-
note: string;
|
|
98
|
-
}>;
|
|
99
|
-
respond(caller: Caller, sessionId: string, answer: Answer): Promise<void>;
|
|
100
|
-
/**
|
|
101
|
-
* Optional: create a session in a group and give it its first task. Enables
|
|
102
|
-
* `start_session`. It may return as soon as the session exists: until its
|
|
103
|
-
* first turn begins, its view is `working` with no messages, and the
|
|
104
|
-
* operator waits through that like a turn. A repeat is the same caller, the
|
|
105
|
-
* same group (case-insensitive) and the same message while the session it
|
|
106
|
-
* made is being set up or its first turn has not ended: return that session
|
|
107
|
-
* with `duplicate: true` and start nothing. Recognising a repeat is
|
|
108
|
-
* optional: a host that never reports one starts a second session.
|
|
109
|
-
*/
|
|
110
|
-
start?(caller: Caller, input: StartInput): Promise<StartResult>;
|
|
111
|
-
/**
|
|
112
|
-
* Optional: the name of every group (project) this caller could start a
|
|
113
|
-
* session in, those with no session included. `list_sessions` then shows
|
|
114
|
-
* the empty ones too, and the `start_session` hint names a real one.
|
|
115
|
-
*/
|
|
116
|
-
groups?(caller: Caller): Promise<string[]>;
|
|
117
|
-
/**
|
|
118
|
-
* Optional: the session with this id, for one `list` leaves out (a host that
|
|
119
|
-
* lists only its newest). Tried, with the reference as given (trimmed), when
|
|
120
|
-
* it names nothing listed. Throw an `OperatorError` to refuse it in your
|
|
121
|
-
* words: one the host knows but will not act on (archived) is no typo.
|
|
122
|
-
*/
|
|
123
|
-
entry?(caller: Caller, sessionId: string): Promise<SessionEntry | undefined>;
|
|
124
|
-
/** Optional: one line of host facts appended when a turn has settled ("changes: a.ts (+4 -0)"). */
|
|
125
|
-
outcome?(caller: Caller, entry: SessionEntry): Promise<string | undefined>;
|
|
126
|
-
/**
|
|
127
|
-
* Optional: resolves when any session may have changed. Remove what it
|
|
128
|
-
* registered when `signal` aborts (it always does, after each look). Without
|
|
129
|
-
* it the operator looks again every half second.
|
|
130
|
-
*/
|
|
131
|
-
changed?(signal: AbortSignal): Promise<void>;
|
|
132
|
-
}
|
|
133
|
-
export interface Tool<Caller = unknown> {
|
|
134
|
-
name: string;
|
|
135
|
-
title: string;
|
|
136
|
-
description: string;
|
|
137
|
-
input: z.ZodObject;
|
|
138
|
-
/** A tool that only reads: assistants run these without asking the person. */
|
|
139
|
-
readOnly: boolean;
|
|
140
|
-
/** It reaches past this host (sends something elsewhere): MCP's `openWorldHint`. */
|
|
141
|
-
openWorld?: boolean;
|
|
142
|
-
/** It may undo or lose work (stops a turn, removes something): MCP's `destructiveHint`. */
|
|
143
|
-
destructive?: boolean;
|
|
144
|
-
run(args: never, caller: Caller): Promise<string>;
|
|
145
|
-
}
|
|
146
|
-
/** Declare a tool, typed by its input. Hosts use this for their own tools. */
|
|
147
|
-
export declare function tool<Shape extends z.ZodRawShape, Caller = unknown>(def: {
|
|
10
|
+
import type { CallScope, Caller, Effect, ExtraTool, Limits, Operator, OperatorHost, OperatorOptions, WaitCaps } from "./types.ts";
|
|
11
|
+
/** Declare a tool, typed by its input. Hosts use this for their own (`effect`: what it does, honestly). */
|
|
12
|
+
export declare function tool<Shape extends z.ZodRawShape, Auth = unknown>(def: {
|
|
148
13
|
name: string;
|
|
149
14
|
title: string;
|
|
150
15
|
description: string;
|
|
151
16
|
input: Shape;
|
|
152
|
-
|
|
17
|
+
effect: Effect;
|
|
153
18
|
openWorld?: boolean;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
export
|
|
159
|
-
name: string;
|
|
160
|
-
title: string;
|
|
161
|
-
description: string;
|
|
162
|
-
/** JSON Schema of the arguments (an object). */
|
|
163
|
-
inputSchema: unknown;
|
|
164
|
-
readOnly: boolean;
|
|
165
|
-
/** It reaches past this host: MCP's `openWorldHint`. */
|
|
166
|
-
openWorld?: boolean;
|
|
167
|
-
/** It may undo or lose work: MCP's `destructiveHint`. */
|
|
168
|
-
destructive?: boolean;
|
|
169
|
-
}
|
|
170
|
-
/** Time, for the waits. Tests pass their own; the default is the wall clock. */
|
|
171
|
-
export interface OperatorClock {
|
|
172
|
-
now(): number;
|
|
173
|
-
/** Resolve after `ms`, or as soon as `signal` aborts. */
|
|
174
|
-
pause(ms: number, signal: AbortSignal): Promise<void>;
|
|
175
|
-
}
|
|
176
|
-
export interface OperatorOptions<Caller> {
|
|
177
|
-
/**
|
|
178
|
-
* No held call outlasts this (hosted assistants cut a tool call off after 2
|
|
179
|
-
* to 4 minutes). Default 90. A function is asked once per call, for the
|
|
180
|
-
* calling caller (a host holds a call no longer than the caller's sign-in
|
|
181
|
-
* has left). Below one second, a call does not wait: it looks once and
|
|
182
|
-
* answers, a working session as still working.
|
|
183
|
-
*/
|
|
184
|
-
maxWaitSeconds?: number | ((caller: Caller) => number);
|
|
185
|
-
/** The host's own tools, listed after the session tools. */
|
|
186
|
-
extra?: Tool<Caller>[];
|
|
187
|
-
clock?: OperatorClock;
|
|
188
|
-
}
|
|
189
|
-
export interface Operator<Caller = unknown> {
|
|
190
|
-
/**
|
|
191
|
-
* The tools, as any transport lists them: the same for every caller (an
|
|
192
|
-
* assistant keeps the list it got when it connected). A host that limits
|
|
193
|
-
* what a caller may run checks around `call`, in its own words.
|
|
194
|
-
*/
|
|
195
|
-
tools(caller: Caller): ToolInfo[];
|
|
196
|
-
/** Run one tool and answer in text. Refusals a model can act on are `OperatorError`s. */
|
|
197
|
-
call(name: string, args: unknown, caller: Caller): Promise<string>;
|
|
198
|
-
/** The session a model's `session` argument names (name, `group/name` or id). */
|
|
199
|
-
find(caller: Caller, ref: string): Promise<SessionEntry>;
|
|
200
|
-
}
|
|
201
|
-
/** A refusal a model can act on: its message says what to do instead. */
|
|
202
|
-
export declare class OperatorError extends Error {
|
|
203
|
-
name: string;
|
|
204
|
-
}
|
|
205
|
-
export declare function createOperator<Caller = unknown>(host: OperatorHost<Caller>, options?: OperatorOptions<Caller>): Operator<Caller>;
|
|
19
|
+
run(args: z.infer<z.ZodObject<Shape>>, caller: Caller<Auth>, call: CallScope): Promise<string>;
|
|
20
|
+
}): ExtraTool<Auth>;
|
|
21
|
+
export declare const DEFAULT_LIMITS: Limits;
|
|
22
|
+
export declare const DEFAULT_WAITS: WaitCaps;
|
|
23
|
+
export declare function createOperator<Auth = unknown>(host: OperatorHost<Auth>, options?: OperatorOptions<Auth>): Operator<Auth>;
|
|
206
24
|
//# sourceMappingURL=operator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/operator/operator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/operator/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,OAAO,KAAK,EACX,SAAS,EACT,MAAM,EACN,MAAM,EAEN,SAAS,EACT,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,eAAe,EAMf,QAAQ,EAER,MAAM,YAAY,CAAC;AAGpB,2GAA2G;AAC3G,wBAAgB,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,EAAE,IAAI,GAAG,OAAO,EAAE,GAAG,EAAE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/F,GAAG,SAAS,CAAC,IAAI,CAAC,CAElB;AAED,eAAO,MAAM,cAAc,EAAE,MAI5B,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,QAG3B,CAAC;AA6FF,wBAAgB,cAAc,CAAC,IAAI,GAAG,OAAO,EAC5C,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,EACxB,OAAO,GAAE,eAAe,CAAC,IAAI,CAAM,GACjC,QAAQ,CAAC,IAAI,CAAC,CA4iDhB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* References a model types: `id / [project "/"] workspace [":" chat]`. What
|
|
3
|
+
* the tools print is always explicit (`workspace:N`, or the session's id when
|
|
4
|
+
* the host numbers no chats), so a printed reference never moves to another
|
|
5
|
+
* chat.
|
|
6
|
+
*/
|
|
7
|
+
import type { Entry } from "./types.ts";
|
|
8
|
+
/** How the tools print an entry: `[project/]workspace:N`, or its id when it has no number. */
|
|
9
|
+
export declare function refOf(entry: Entry, all: readonly Entry[]): string;
|
|
10
|
+
/** What a reference resolved to: one entry, several, or none. */
|
|
11
|
+
export type Resolved = {
|
|
12
|
+
found: Entry;
|
|
13
|
+
} | {
|
|
14
|
+
ambiguous: Entry[];
|
|
15
|
+
} | {
|
|
16
|
+
missing: true;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The entry `ref` names among `all` (everything the caller may see, archived
|
|
20
|
+
* included). An id is exact: a session's, or a workspace's (its current
|
|
21
|
+
* chat). A name is case-insensitive; a bare workspace means its current chat,
|
|
22
|
+
* resolved now.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolve(ref: string, all: readonly Entry[]): Resolved;
|
|
25
|
+
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../src/operator/refs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,8FAA8F;AAC9F,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,KAAK,EAAE,GAAG,MAAM,CASjE;AAED,iEAAiE;AACjE,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,KAAK,EAAE,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC;AAErF;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,KAAK,EAAE,GAAG,QAAQ,CA6BpE"}
|