@alpacakit/agents 0.1.0-beta.39 → 0.2.0-beta.3
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 +142 -1
- package/dist/agents/builtin.d.ts +2 -2
- package/dist/agents/builtin.d.ts.map +1 -1
- package/dist/agents/builtin.js +6 -4
- package/dist/agents/claude/cli.d.ts +133 -0
- package/dist/agents/claude/cli.d.ts.map +1 -0
- package/dist/agents/claude/cli.js +182 -0
- package/dist/agents/claude/host.d.ts +14 -0
- package/dist/agents/claude/host.d.ts.map +1 -0
- package/dist/agents/claude/host.js +319 -0
- package/dist/agents/{claude.d.ts → claude/index.d.ts} +11 -11
- package/dist/agents/claude/index.d.ts.map +1 -0
- package/dist/agents/claude/index.js +134 -0
- package/dist/agents/claude/session.d.ts +25 -0
- package/dist/agents/claude/session.d.ts.map +1 -0
- package/dist/agents/claude/session.js +321 -0
- package/dist/agents/codex/cli.d.ts +132 -0
- package/dist/agents/codex/cli.d.ts.map +1 -0
- package/dist/agents/codex/cli.js +110 -0
- package/dist/agents/codex/host.d.ts +14 -0
- package/dist/agents/codex/host.d.ts.map +1 -0
- package/dist/agents/codex/host.js +221 -0
- package/dist/agents/codex/index.d.ts +14 -0
- package/dist/agents/codex/index.d.ts.map +1 -0
- package/dist/agents/codex/index.js +127 -0
- package/dist/agents/codex/session.d.ts +21 -0
- package/dist/agents/codex/session.d.ts.map +1 -0
- package/dist/agents/codex/session.js +390 -0
- package/dist/agents/openai-compatible/fetch-engine.d.ts.map +1 -1
- package/dist/agents/openai-compatible/fetch-engine.js +3 -2
- package/dist/agents/openai-compatible/pi/engine.js +1 -1
- package/dist/agents/openai-compatible/pi/{session.d.ts → run.d.ts} +1 -1
- package/dist/agents/openai-compatible/pi/run.d.ts.map +1 -0
- package/dist/agents/openai-compatible/pi/sandbox.d.ts.map +1 -1
- package/dist/auth/login-probe.d.ts +6 -4
- package/dist/auth/login-probe.d.ts.map +1 -1
- package/dist/auth/login-probe.js +19 -13
- package/dist/auth/material.d.ts +1 -1
- package/dist/auth/material.d.ts.map +1 -1
- package/dist/codex/app-server.d.ts +50 -1
- package/dist/codex/app-server.d.ts.map +1 -1
- package/dist/codex/app-server.js +140 -66
- package/dist/codex/index.d.ts +3 -2
- package/dist/codex/index.d.ts.map +1 -1
- package/dist/codex/index.js +2 -1
- package/dist/codex/protocol.d.ts +101 -0
- package/dist/codex/protocol.d.ts.map +1 -1
- package/dist/codex/protocol.js +78 -0
- package/dist/config/agent-config-validation.d.ts +1 -1
- package/dist/config/agent-config-validation.d.ts.map +1 -1
- package/dist/config/agent-configs.d.ts.map +1 -1
- package/dist/config/agent-configs.js +3 -3
- package/dist/config/compose.d.ts.map +1 -1
- package/dist/config/config.d.ts +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/model.d.ts +0 -1
- package/dist/config/model.d.ts.map +1 -1
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +1 -1
- package/dist/config/store.d.ts.map +1 -1
- package/dist/config/store.js +6 -24
- package/dist/config/support.d.ts +0 -1
- package/dist/config/support.d.ts.map +1 -1
- package/dist/config/support.js +0 -9
- package/dist/core/cli-child.d.ts +56 -0
- package/dist/core/cli-child.d.ts.map +1 -0
- package/dist/core/cli-child.js +105 -0
- package/dist/core/fs.d.ts +1 -1
- package/dist/core/fs.d.ts.map +1 -1
- package/dist/core/fs.js +10 -2
- package/dist/core/node-ports.d.ts.map +1 -1
- package/dist/core/node-ports.js +1 -5
- package/dist/core/session.d.ts +104 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +29 -0
- package/dist/fleet/store.d.ts.map +1 -1
- package/dist/fleet/store.js +4 -3
- package/dist/host/availability.d.ts +2 -1
- package/dist/host/availability.d.ts.map +1 -1
- package/dist/host/github-dir.d.ts.map +1 -1
- package/dist/host/github-dir.js +2 -1
- package/dist/host/mcp-list.d.ts.map +1 -1
- package/dist/host/mcp-list.js +5 -6
- package/dist/host/run-command.d.ts +2 -1
- package/dist/host/run-command.d.ts.map +1 -1
- package/dist/host/run-command.js +10 -19
- package/dist/host/session-files.d.ts +23 -0
- package/dist/host/session-files.d.ts.map +1 -0
- package/dist/host/session-files.js +92 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/internal/controlled-process/supervisor-runtime.js +27 -1
- package/dist/kernel/classify.d.ts +1 -2
- package/dist/kernel/classify.d.ts.map +1 -1
- package/dist/kernel/classify.js +1 -1
- package/dist/kernel/cli-agent.d.ts.map +1 -1
- package/dist/kernel/cli-agent.js +26 -85
- package/dist/kernel/cli-login.d.ts.map +1 -1
- package/dist/kernel/cli-login.js +9 -30
- package/dist/kernel/definition.d.ts +11 -2
- package/dist/kernel/definition.d.ts.map +1 -1
- package/dist/kernel/facets.d.ts +38 -1
- package/dist/kernel/facets.d.ts.map +1 -1
- package/dist/kernel/facets.js +20 -0
- package/dist/kernel/login.d.ts.map +1 -1
- package/dist/kernel/login.js +2 -1
- package/dist/kernel/options.d.ts +1 -1
- package/dist/kernel/options.d.ts.map +1 -1
- package/dist/kernel/run.d.ts.map +1 -1
- package/dist/kernel/run.js +2 -1
- package/dist/kernel/runtime.d.ts +10 -6
- package/dist/kernel/runtime.d.ts.map +1 -1
- package/dist/kernel/runtime.js +4 -1
- package/dist/kernel/session.d.ts +104 -0
- package/dist/kernel/session.d.ts.map +1 -0
- package/dist/kernel/session.js +314 -0
- package/dist/testing/fake-exec.d.ts +10 -5
- package/dist/testing/fake-exec.d.ts.map +1 -1
- package/dist/testing/fake-exec.js +17 -2
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -1
- package/package.json +2 -2
- package/dist/agents/claude.d.ts.map +0 -1
- package/dist/agents/claude.js +0 -543
- package/dist/agents/codex.d.ts +0 -19
- package/dist/agents/codex.d.ts.map +0 -1
- package/dist/agents/codex.js +0 -377
- package/dist/agents/openai-compatible/pi/session.d.ts.map +0 -1
- /package/dist/agents/openai-compatible/pi/{session.js → run.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-login.d.ts","sourceRoot":"","sources":["../../src/kernel/cli-login.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAIjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-login.d.ts","sourceRoot":"","sources":["../../src/kernel/cli-login.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAIjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAa1B,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAsB9D,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAC/C,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAuFF,wBAAuB,eAAe,CACpC,OAAO,EAAE,sBAAsB,GAC9B,QAAQ,CA6GV"}
|
package/dist/kernel/cli-login.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { LOGIN_EVENT_TYPE, LOGIN_METHOD, } from "../auth/login.js";
|
|
2
2
|
import { AUTH_MATERIAL_KIND, AUTH_STATUS, } from "../auth/material.js";
|
|
3
|
+
import { appendTail, escalateTermination, failureEvidence, RAW_OUTPUT_CAP_CHARS, resolveCommand, } from "../core/cli-child.js";
|
|
3
4
|
import { applyEnvPatch } from "../core/env.js";
|
|
4
|
-
import { AGENT_ERROR_CODE, AgentError,
|
|
5
|
+
import { AGENT_ERROR_CODE, AgentError, TIMEOUT_KIND } from "../core/error.js";
|
|
5
6
|
import { redactSecrets } from "../core/redact.js";
|
|
6
|
-
import { OUTPUT_CHANNEL
|
|
7
|
+
import { OUTPUT_CHANNEL } from "../core/values.js";
|
|
7
8
|
import { classifyFailure, sharedFailureMatchers } from "./classify.js";
|
|
8
9
|
const DEFAULT_CLI_LOGIN_TIMEOUT_MS = 20 * 60 * 1_000;
|
|
9
|
-
const SIGKILL_ESCALATION_MS = 5_000;
|
|
10
|
-
const RAW_OUTPUT_CAP_CHARS = 10 * 1024 * 1024;
|
|
11
|
-
const OUTPUT_TAIL_CHARS = 2_000;
|
|
12
10
|
const SCAN_BUFFER_CHARS = 12_000;
|
|
13
11
|
const MINUTE_MS = 60_000;
|
|
14
12
|
// Best-effort scanners over the accumulated (ANSI-stripped) CLI output, matching
|
|
@@ -21,12 +19,6 @@ const DEVICE_CODE_PATTERN = /\b[A-Z0-9]{4,}(?:-[A-Z0-9]{4,})+\b/u;
|
|
|
21
19
|
const URL_PATTERN = /https?:\/\/[^\s)]+/u;
|
|
22
20
|
// biome-ignore lint/suspicious/noControlCharactersInRegex: strips ANSI/CSI escape sequences from colorized CLI output.
|
|
23
21
|
const ANSI_PATTERN = /\x1b\[[0-?]*[ -/]*[@-~]/gu;
|
|
24
|
-
function boundedTail(current, text, capChars) {
|
|
25
|
-
const combined = current + text;
|
|
26
|
-
return combined.length > capChars
|
|
27
|
-
? combined.slice(combined.length - capChars)
|
|
28
|
-
: combined;
|
|
29
|
-
}
|
|
30
22
|
function stripAnsi(text) {
|
|
31
23
|
return text.replace(ANSI_PATTERN, "");
|
|
32
24
|
}
|
|
@@ -78,11 +70,7 @@ function loginExitError(input) {
|
|
|
78
70
|
code: AGENT_ERROR_CODE.failed,
|
|
79
71
|
classification: AgentError.agentFailure(AGENT_ERROR_CODE.failed),
|
|
80
72
|
message: redactSecrets(`Login command "${command}" exited with code ${exit.code ?? "null"}${signal}`),
|
|
81
|
-
data: {
|
|
82
|
-
exitCode: exit.code,
|
|
83
|
-
stdoutTail: redactSecrets(stdout.slice(-OUTPUT_TAIL_CHARS)) || null,
|
|
84
|
-
stderrTail: redactSecrets(stderr.slice(-OUTPUT_TAIL_CHARS)) || null,
|
|
85
|
-
},
|
|
73
|
+
data: failureEvidence({ stdout, stderr, exitCode: exit.code }),
|
|
86
74
|
});
|
|
87
75
|
}
|
|
88
76
|
function homeDirOutcome(request, status) {
|
|
@@ -94,15 +82,7 @@ function homeDirOutcome(request, status) {
|
|
|
94
82
|
export async function* cliLoginCommand(options) {
|
|
95
83
|
const timeoutMs = options.timeoutMs ?? DEFAULT_CLI_LOGIN_TIMEOUT_MS;
|
|
96
84
|
const env = applyEnvPatch(options.ctx.env, options.envPatch);
|
|
97
|
-
const command = await options.ctx.exec
|
|
98
|
-
if (command === null) {
|
|
99
|
-
throw new AgentError({
|
|
100
|
-
code: AGENT_ERROR_CODE.notAvailable,
|
|
101
|
-
classification: AgentError.agentFailure(AGENT_ERROR_CODE.notAvailable),
|
|
102
|
-
message: `Login command "${options.command}" was not found on PATH`,
|
|
103
|
-
data: { cause: NOT_AVAILABLE_CAUSE.notInstalled },
|
|
104
|
-
});
|
|
105
|
-
}
|
|
85
|
+
const command = await resolveCommand(options.ctx.exec, options.command, env, null);
|
|
106
86
|
const child = options.ctx.exec.spawn({
|
|
107
87
|
command,
|
|
108
88
|
args: [...options.args],
|
|
@@ -130,8 +110,7 @@ export async function* cliLoginCommand(options) {
|
|
|
130
110
|
return;
|
|
131
111
|
}
|
|
132
112
|
killed = true;
|
|
133
|
-
|
|
134
|
-
cancelKill.current = options.ctx.clock.setTimeout(() => child.kill(PROCESS_SIGNAL.sigkill), SIGKILL_ESCALATION_MS);
|
|
113
|
+
cancelKill.current = escalateTermination(child, options.ctx.clock);
|
|
135
114
|
};
|
|
136
115
|
const onAbort = () => escalateKill();
|
|
137
116
|
const cancelTimeout = options.ctx.clock.setTimeout(() => {
|
|
@@ -147,10 +126,10 @@ export async function* cliLoginCommand(options) {
|
|
|
147
126
|
try {
|
|
148
127
|
for await (const chunk of child.chunks) {
|
|
149
128
|
if (chunk.channel === OUTPUT_CHANNEL.stdout) {
|
|
150
|
-
stdout =
|
|
129
|
+
stdout = appendTail(stdout, chunk.text, RAW_OUTPUT_CAP_CHARS);
|
|
151
130
|
}
|
|
152
131
|
else {
|
|
153
|
-
stderr =
|
|
132
|
+
stderr = appendTail(stderr, chunk.text, RAW_OUTPUT_CAP_CHARS);
|
|
154
133
|
}
|
|
155
134
|
yield {
|
|
156
135
|
type: LOGIN_EVENT_TYPE.output,
|
|
@@ -158,7 +137,7 @@ export async function* cliLoginCommand(options) {
|
|
|
158
137
|
chunk: chunk.text,
|
|
159
138
|
};
|
|
160
139
|
if (!emitted) {
|
|
161
|
-
scanBuffer =
|
|
140
|
+
scanBuffer = appendTail(scanBuffer, stripAnsi(chunk.text), SCAN_BUFFER_CHARS);
|
|
162
141
|
const event = parseEvent(scanBuffer, options.ctx.clock.now());
|
|
163
142
|
if (event !== null) {
|
|
164
143
|
emitted = true;
|
|
@@ -11,6 +11,7 @@ import type { AgentEvent, AgentRunOutcome } from "../core/run.js";
|
|
|
11
11
|
import type { AgentAvailabilityCapability } from "../host/availability.js";
|
|
12
12
|
import type { DoctorCapability, McpCapability, SkillsCapability } from "../host/capabilities.js";
|
|
13
13
|
import type { ResolvedRunOptions } from "./options.js";
|
|
14
|
+
import type { SessionCapability } from "./session.js";
|
|
14
15
|
/** Resolved (rule 2): the adapter's whole world. */
|
|
15
16
|
export type RunContext = {
|
|
16
17
|
/** The ONE stop channel — caller abort, timeout, and guard violations. */
|
|
@@ -25,7 +26,12 @@ export type RunContext = {
|
|
|
25
26
|
logger: Logger;
|
|
26
27
|
};
|
|
27
28
|
export type AgentRun = AsyncGenerator<AgentEvent, AgentRunOutcome, void>;
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* `SessionPermissions` is the host-specific permission shape a session is
|
|
31
|
+
* opened with (`ClaudeSessionPermissions`, `CodexSessionPermissions`); it
|
|
32
|
+
* stays a type parameter so the neutral `Sandbox` never learns host words.
|
|
33
|
+
*/
|
|
34
|
+
export interface AgentDefinition<Id extends string = string, SessionPermissions = unknown> {
|
|
29
35
|
id: Id;
|
|
30
36
|
run(options: ResolvedRunOptions, ctx: RunContext): AgentRun;
|
|
31
37
|
availability?: AgentAvailabilityCapability;
|
|
@@ -34,10 +40,13 @@ export interface AgentDefinition<Id extends string = string> {
|
|
|
34
40
|
doctor?: DoctorCapability;
|
|
35
41
|
skills?: SkillsCapability;
|
|
36
42
|
mcp?: McpCapability;
|
|
43
|
+
session?: SessionCapability<SessionPermissions>;
|
|
37
44
|
}
|
|
45
|
+
/** The session permission type a definition declares (`unknown` when it has no session facet). */
|
|
46
|
+
export type SessionPermissionsOf<Definition> = Definition extends AgentDefinition<string, infer Permissions> ? Permissions : unknown;
|
|
38
47
|
/**
|
|
39
48
|
* Identity helper for hand-rolled agents: pins the `Id` literal and
|
|
40
49
|
* type-checks the definition in place. No runtime behavior.
|
|
41
50
|
*/
|
|
42
|
-
export declare function defineAgent<const Id extends string>(definition: AgentDefinition<Id>): AgentDefinition<Id>;
|
|
51
|
+
export declare function defineAgent<const Id extends string, SessionPermissions = unknown>(definition: AgentDefinition<Id, SessionPermissions>): AgentDefinition<Id, SessionPermissions>;
|
|
43
52
|
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/kernel/definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAA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2E;IAC3E,KAAK,EAAE,KAAK,CAAC;IACb,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAC9B,EAAE,SAAS,MAAM,GAAG,MAAM,EAC1B,kBAAkB,GAAG,OAAO;IAE5B,EAAE,EAAE,EAAE,CAAC;IACP,GAAG,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC5D,YAAY,CAAC,EAAE,2BAA2B,CAAC;IAC3C,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;CACjD;AAED,kGAAkG;AAClG,MAAM,MAAM,oBAAoB,CAAC,UAAU,IACzC,UAAU,SAAS,eAAe,CAAC,MAAM,EAAE,MAAM,WAAW,CAAC,GACzD,WAAW,GACX,OAAO,CAAC;AAEd;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,CAAC,EAAE,SAAS,MAAM,EACvB,kBAAkB,GAAG,OAAO,EAE5B,UAAU,EAAE,eAAe,CAAC,EAAE,EAAE,kBAAkB,CAAC,GAClD,eAAe,CAAC,EAAE,EAAE,kBAAkB,CAAC,CAEzC"}
|
package/dist/kernel/facets.d.ts
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { type LoginCapability, type LoginHandle, type LoginMethod, type LoginRequest } from "../auth/login.js";
|
|
8
8
|
import type { AuthCapability, AuthMaterial, AuthMaterialDescriptor, AuthMaterialKind, AuthStatus } from "../auth/material.js";
|
|
9
|
-
import type
|
|
9
|
+
import { type EnvPatch } from "../core/env.js";
|
|
10
10
|
import type { Clock, Exec, HttpClient, Logger, SecretResolvers } from "../core/ports.js";
|
|
11
|
+
import type { Session, SessionFacts } from "../core/session.js";
|
|
11
12
|
import type { AgentAvailability, AgentAvailabilityCapability } from "../host/availability.js";
|
|
12
13
|
import type { DoctorCapability, DoctorReport, InstalledSkill, InstallOptions, InstallOutcome, McpCapability, McpScope, McpServerSpec, McpServerState, SkillSource, SkillsCapability } from "../host/capabilities.js";
|
|
13
14
|
import type { HostLocation } from "../host/context.js";
|
|
15
|
+
import type { SessionCapability } from "./session.js";
|
|
14
16
|
export type AgentAuth = {
|
|
15
17
|
supports(kind: AuthMaterialKind): boolean;
|
|
16
18
|
/** Supported material kinds in canonical order (empty if none). */
|
|
@@ -45,6 +47,40 @@ export type AgentMcp = {
|
|
|
45
47
|
scope: McpScope;
|
|
46
48
|
}): Promise<void>;
|
|
47
49
|
};
|
|
50
|
+
/** Call-site input (rule 1): `env` patches the runtime's base environment. */
|
|
51
|
+
export type SessionOpenOptions<Permissions> = {
|
|
52
|
+
workspace: string;
|
|
53
|
+
permissions: Permissions;
|
|
54
|
+
env?: EnvPatch;
|
|
55
|
+
};
|
|
56
|
+
export type SessionResumeOptions<Permissions> = SessionOpenOptions<Permissions> & {
|
|
57
|
+
/**
|
|
58
|
+
* Codex only (Claude has no archive): when `true`, an archived thread is
|
|
59
|
+
* `thread/unarchive`d before `thread/resume`, which also moves it back into
|
|
60
|
+
* the ChatGPT app's active list. Default `false`: resuming an archived
|
|
61
|
+
* thread fails with the server's "is archived" message; check
|
|
62
|
+
* `inspect(id).archived` first.
|
|
63
|
+
*/
|
|
64
|
+
unarchive?: boolean;
|
|
65
|
+
};
|
|
66
|
+
export type AgentSessions<Permissions> = {
|
|
67
|
+
/**
|
|
68
|
+
* Start a new conversation in `workspace`. Codex note: `thread/start`
|
|
69
|
+
* with a writable sandbox (`workspace-write`, `danger-full-access`) makes
|
|
70
|
+
* Codex append a `trust_level` entry for the workspace to
|
|
71
|
+
* `~/.codex/config.toml`; `read-only` does not (T53/T57, codex 0.153.4).
|
|
72
|
+
*/
|
|
73
|
+
open(options: SessionOpenOptions<Permissions>): Promise<Session>;
|
|
74
|
+
/**
|
|
75
|
+
* Take over an existing conversation by the host's id. Permissions are
|
|
76
|
+
* always passed explicitly — hosts do not reliably restore the original
|
|
77
|
+
* ones (Codex `thread/resume` without `sandbox` ran as danger-full-access).
|
|
78
|
+
* An archived Codex thread is unarchived only when `unarchive: true`.
|
|
79
|
+
*/
|
|
80
|
+
resume(id: string, options: SessionResumeOptions<Permissions>): Promise<Session>;
|
|
81
|
+
/** Read the host's own files about a conversation; `null` when it has none. */
|
|
82
|
+
inspect(id: string, location: HostLocation): Promise<SessionFacts<Permissions> | null>;
|
|
83
|
+
};
|
|
48
84
|
export type FacetBinding = {
|
|
49
85
|
agentId: string;
|
|
50
86
|
env: Record<string, string>;
|
|
@@ -59,5 +95,6 @@ export declare function bindAvailability(capability: AgentAvailabilityCapability
|
|
|
59
95
|
export declare function bindLogin(capability: LoginCapability, binding: FacetBinding): AgentLogin;
|
|
60
96
|
export declare function bindDoctor(capability: DoctorCapability, binding: FacetBinding): AgentDoctor;
|
|
61
97
|
export declare function bindSkills(capability: SkillsCapability, binding: FacetBinding): AgentSkills;
|
|
98
|
+
export declare function bindSessions<Permissions>(capability: SessionCapability<Permissions>, binding: FacetBinding): AgentSessions<Permissions>;
|
|
62
99
|
export declare function bindMcp(capability: McpCapability, binding: FacetBinding): AgentMcp;
|
|
63
100
|
//# sourceMappingURL=facets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facets.d.ts","sourceRoot":"","sources":["../../src/kernel/facets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,KAAK,WAAW,EAChB,KAAK,YAAY,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c,EAC1B,OAAO,EAAE,YAAY,GACpB,SAAS,CAiCX;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,2BAA2B,EACvC,OAAO,EAAE,YAAY,GACpB,sBAAsB,CAIxB;AAED,wBAAgB,SAAS,CACvB,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,YAAY,GACpB,UAAU,CAuBZ;AAED,wBAAgB,UAAU,CACxB,UAAU,EAAE,gBAAgB,EAC5B,OAAO,EAAE,YAAY,GACpB,WAAW,CAIb;AAQD,wBAAgB,UAAU,CACxB,UAAU,EAAE,gBAAgB,EAC5B,OAAO,EAAE,YAAY,GACpB,WAAW,CAab;AASD,wBAAgB,YAAY,CAAC,WAAW,EACtC,UAAU,EAAE,iBAAiB,CAAC,WAAW,CAAC,EAC1C,OAAO,EAAE,YAAY,GACpB,aAAa,CAAC,WAAW,CAAC,CA+B5B;AAED,wBAAgB,OAAO,CACrB,UAAU,EAAE,aAAa,EACzB,OAAO,EAAE,YAAY,GACpB,QAAQ,CA+BV"}
|
package/dist/kernel/facets.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { LOGIN_METHOD, } from "../auth/login.js";
|
|
8
8
|
import { AUTH_MATERIAL_KIND, AUTH_STATUS, authMaterialRequiresSecret, } from "../auth/material.js";
|
|
9
|
+
import { applyEnvPatch, EMPTY_ENV_PATCH } from "../core/env.js";
|
|
9
10
|
import { AGENT_ERROR_CODE, AgentError } from "../core/error.js";
|
|
10
11
|
import { resolveHostLocation } from "../host/context.js";
|
|
11
12
|
import { validateSpecSecrets } from "../host/validate-spec.js";
|
|
@@ -83,6 +84,25 @@ export function bindSkills(capability, binding) {
|
|
|
83
84
|
},
|
|
84
85
|
};
|
|
85
86
|
}
|
|
87
|
+
export function bindSessions(capability, binding) {
|
|
88
|
+
const context = (options) => ({
|
|
89
|
+
env: applyEnvPatch(binding.env, options.env ?? EMPTY_ENV_PATCH),
|
|
90
|
+
exec: binding.exec,
|
|
91
|
+
clock: binding.clock,
|
|
92
|
+
logger: {
|
|
93
|
+
log: (level, message, data) => binding.logger.log(level, `[session ${binding.agentId}] ${message}`, data),
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
const resolved = (options) => ({
|
|
97
|
+
workspace: options.workspace,
|
|
98
|
+
permissions: options.permissions,
|
|
99
|
+
});
|
|
100
|
+
return {
|
|
101
|
+
open: (options) => capability.open(resolved(options), context(options)),
|
|
102
|
+
resume: (id, options) => capability.resume(id, { ...resolved(options), unarchive: options.unarchive ?? false }, context(options)),
|
|
103
|
+
inspect: (id, location) => capability.inspect(id, hostContext(binding, location)),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
86
106
|
export function bindMcp(capability, binding) {
|
|
87
107
|
return {
|
|
88
108
|
list: (location) => capability.list(hostContext(binding, location)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/kernel/login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,WAAW,EACX,YAAY,EAEZ,YAAY,EACb,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/kernel/login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,WAAW,EACX,YAAY,EAEZ,YAAY,EACb,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,KAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,WAAW,CAW9D"}
|
package/dist/kernel/login.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NO_FAILURE_EVIDENCE } from "../core/cli-child.js";
|
|
1
2
|
import { AGENT_ERROR_CODE, AgentError, isAgentError } from "../core/error.js";
|
|
2
3
|
import { redactSecrets } from "../core/redact.js";
|
|
3
4
|
import { EventBroadcast } from "./handle.js";
|
|
@@ -59,7 +60,7 @@ function toLoginError(agentId, thrown) {
|
|
|
59
60
|
code: AGENT_ERROR_CODE.failed,
|
|
60
61
|
classification: AgentError.agentFailure(AGENT_ERROR_CODE.failed),
|
|
61
62
|
message: redactSecrets(message),
|
|
62
|
-
data:
|
|
63
|
+
data: NO_FAILURE_EVIDENCE,
|
|
63
64
|
cause: thrown,
|
|
64
65
|
agentId,
|
|
65
66
|
});
|
package/dist/kernel/options.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* normalized exactly once into the resolved twins (rule 2) — agent
|
|
4
4
|
* definitions only ever see the resolved types.
|
|
5
5
|
*/
|
|
6
|
-
import { type EnvPatch } from "../core/env.js";
|
|
7
6
|
import type { ChildProcessLifecycle, ControlledExec } from "../core/controlled-process.js";
|
|
7
|
+
import { type EnvPatch } from "../core/env.js";
|
|
8
8
|
import type { GuardFactory } from "./guard.js";
|
|
9
9
|
export declare const GRANT_KIND: {
|
|
10
10
|
readonly shell: "shell";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/kernel/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/kernel/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAmB,KAAK,QAAQ,EAAE,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
|
package/dist/kernel/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/kernel/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/kernel/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAIV,SAAS,EAEV,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,iBAAiB,CAAC;AAGnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAUvD,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,eAAe,CAAC;IAC5B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AA0RF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAExD"}
|
package/dist/kernel/run.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* stop on abort.
|
|
7
7
|
*/
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
|
+
import { NO_FAILURE_EVIDENCE } from "../core/cli-child.js";
|
|
9
10
|
import { AGENT_ERROR_CODE, AgentError, isAgentError, TIMEOUT_KIND, withRunIdentity, } from "../core/error.js";
|
|
10
11
|
import { redactSecrets } from "../core/redact.js";
|
|
11
12
|
import { RUN_EVENT_TYPE, RUN_OUTCOME } from "../core/run.js";
|
|
@@ -245,7 +246,7 @@ class RunDriver {
|
|
|
245
246
|
code: AGENT_ERROR_CODE.failed,
|
|
246
247
|
classification: AgentError.agentFailure(AGENT_ERROR_CODE.failed),
|
|
247
248
|
message: redactSecrets(message),
|
|
248
|
-
data:
|
|
249
|
+
data: NO_FAILURE_EVIDENCE,
|
|
249
250
|
cause: thrown,
|
|
250
251
|
...this.identity(),
|
|
251
252
|
});
|
package/dist/kernel/runtime.d.ts
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
import { type Ports } from "../core/ports.js";
|
|
8
8
|
import type { RunHandle } from "../core/run.js";
|
|
9
9
|
import { type StructuredHandle, type StructuredRunOptions } from "../structured/run-structured.js";
|
|
10
|
-
import type { AgentDefinition } from "./definition.js";
|
|
11
|
-
import { type AgentAuth, type AgentAvailabilityProbe, type AgentDoctor, type AgentLogin, type AgentMcp, type AgentSkills } from "./facets.js";
|
|
10
|
+
import type { AgentDefinition, SessionPermissionsOf } from "./definition.js";
|
|
11
|
+
import { type AgentAuth, type AgentAvailabilityProbe, type AgentDoctor, type AgentLogin, type AgentMcp, type AgentSessions, type AgentSkills } from "./facets.js";
|
|
12
12
|
import { type RunOptions } from "./options.js";
|
|
13
|
-
export interface Agent<Id extends string = string> {
|
|
13
|
+
export interface Agent<Id extends string = string, SessionPermissions = unknown> {
|
|
14
14
|
readonly id: Id;
|
|
15
15
|
run<T>(options: StructuredRunOptions<T>): StructuredHandle<T>;
|
|
16
16
|
run(options: RunOptions): RunHandle;
|
|
@@ -21,9 +21,13 @@ export interface Agent<Id extends string = string> {
|
|
|
21
21
|
skills: AgentSkills | null;
|
|
22
22
|
mcp: AgentMcp | null;
|
|
23
23
|
doctor: AgentDoctor | null;
|
|
24
|
+
/** Long-lived conversations; `null` when the definition has no session facet. */
|
|
25
|
+
session: AgentSessions<SessionPermissions> | null;
|
|
24
26
|
}
|
|
25
|
-
export interface AgentRuntime<Id extends string = string> {
|
|
26
|
-
agent<I extends Id>(id: I): Agent<I
|
|
27
|
+
export interface AgentRuntime<Id extends string = string, Defs extends readonly AgentDefinition[] = readonly AgentDefinition<Id>[]> {
|
|
28
|
+
agent<I extends Id>(id: I): Agent<I, SessionPermissionsOf<Extract<Defs[number], {
|
|
29
|
+
id: I;
|
|
30
|
+
}>>>;
|
|
27
31
|
agents(): Agent<Id>[];
|
|
28
32
|
/** The resolved ports — composition layers (fleet) reuse these. */
|
|
29
33
|
readonly ports: Ports;
|
|
@@ -45,5 +49,5 @@ export type AgentRuntimeOptions<Defs extends readonly AgentDefinition[]> = {
|
|
|
45
49
|
* resolver, so registering "keychain" never silently drops "env".
|
|
46
50
|
*/
|
|
47
51
|
export declare function resolvePorts(ports?: Partial<Ports>): Ports;
|
|
48
|
-
export declare function createAgentRuntime<const Defs extends readonly AgentDefinition[]>(options: AgentRuntimeOptions<Defs>): AgentRuntime<Defs[number]["id"]>;
|
|
52
|
+
export declare function createAgentRuntime<const Defs extends readonly AgentDefinition[]>(options: AgentRuntimeOptions<Defs>): AgentRuntime<Defs[number]["id"], Defs>;
|
|
49
53
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/kernel/runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAA6B,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAE1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/kernel/runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAA6B,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAE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AK,CAAC,CAAC,SAAS,EAAE,EAChB,EAAE,EAAE,CAAC,GACJ,KAAK,CAAC,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;CACvB;AAED,MAAM,MAAM,mBAAmB,CAAC,IAAI,SAAS,SAAS,eAAe,EAAE,IAAI;IACzE,MAAM,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACvB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAS1D;AA6ED,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,IAAI,SAAS,SAAS,eAAe,EAAE,EAC7C,OAAO,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAwC5E"}
|
package/dist/kernel/runtime.js
CHANGED
|
@@ -10,7 +10,7 @@ import { AGENT_ERROR_CODE, AgentError } from "../core/error.js";
|
|
|
10
10
|
import { fetchHttp, nodeExec, systemClock } from "../core/node-ports.js";
|
|
11
11
|
import { noopLogger, noopTelemetry } from "../core/ports.js";
|
|
12
12
|
import { isStructuredRunOptions, resolveStructuredRunOptions, startStructuredRun, } from "../structured/run-structured.js";
|
|
13
|
-
import { bindAuth, bindAvailability, bindDoctor, bindLogin, bindMcp, bindSkills, } from "./facets.js";
|
|
13
|
+
import { bindAuth, bindAvailability, bindDoctor, bindLogin, bindMcp, bindSessions, bindSkills, } from "./facets.js";
|
|
14
14
|
import { resolveRunOptions } from "./options.js";
|
|
15
15
|
import { startRun } from "./run.js";
|
|
16
16
|
/**
|
|
@@ -77,6 +77,9 @@ function bindAgent(definition, ports, baseEnv) {
|
|
|
77
77
|
doctor: definition.doctor === undefined
|
|
78
78
|
? null
|
|
79
79
|
: bindDoctor(definition.doctor, binding),
|
|
80
|
+
session: definition.session === undefined
|
|
81
|
+
? null
|
|
82
|
+
: bindSessions(definition.session, binding),
|
|
80
83
|
};
|
|
81
84
|
}
|
|
82
85
|
export function createAgentRuntime(options) {
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session driver (design "Kernel", session plane): as `RunDriver`
|
|
3
|
+
* drives an adapter's generator, `driveSession` drives a host's
|
|
4
|
+
* `SessionProtocol`. The driver owns the conversation's lifecycle — one
|
|
5
|
+
* turn at a time, the approval registry and its lifetime, the event
|
|
6
|
+
* stream, and the end of it all when the child is gone. A protocol only
|
|
7
|
+
* encodes the five verbs for its host and decodes one incoming item into
|
|
8
|
+
* the neutral session signals; it never keeps turn or approval state.
|
|
9
|
+
*/
|
|
10
|
+
import { AGENT_ERROR_CODE, AgentError } from "../core/error.js";
|
|
11
|
+
import type { Clock, Exec, ExecExit, Logger } from "../core/ports.js";
|
|
12
|
+
import { type ApprovalDecision, type Session, type SessionFacts, type TurnOutcome } from "../core/session.js";
|
|
13
|
+
import type { HostContext } from "../host/context.js";
|
|
14
|
+
/** Resolved (rule 2): what a session adapter gets to open or resume. */
|
|
15
|
+
export type SessionContext = {
|
|
16
|
+
/** Fully layered: baseEnv → options.env. */
|
|
17
|
+
env: Record<string, string>;
|
|
18
|
+
exec: Exec;
|
|
19
|
+
clock: Clock;
|
|
20
|
+
/** Pre-scoped to the session by the kernel. */
|
|
21
|
+
logger: Logger;
|
|
22
|
+
};
|
|
23
|
+
export type ResolvedSessionOpenOptions<Permissions> = {
|
|
24
|
+
workspace: string;
|
|
25
|
+
permissions: Permissions;
|
|
26
|
+
};
|
|
27
|
+
export type ResolvedSessionResumeOptions<Permissions> = ResolvedSessionOpenOptions<Permissions> & {
|
|
28
|
+
/** Codex only: unarchive an archived thread before resuming it. */
|
|
29
|
+
unarchive: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** Definition-side session capability; absent = `Agent.session` is `null`. */
|
|
32
|
+
export type SessionCapability<Permissions> = {
|
|
33
|
+
open(options: ResolvedSessionOpenOptions<Permissions>, ctx: SessionContext): Promise<Session>;
|
|
34
|
+
resume(id: string, options: ResolvedSessionResumeOptions<Permissions>, ctx: SessionContext): Promise<Session>;
|
|
35
|
+
inspect(id: string, ctx: HostContext): Promise<SessionFacts<Permissions> | null>;
|
|
36
|
+
};
|
|
37
|
+
/** What a protocol's `decode` may tell the driver about the running turn. */
|
|
38
|
+
export type SessionSink<Payload> = {
|
|
39
|
+
/** The turn the driver currently holds; `null` between turns. */
|
|
40
|
+
readonly activeTurnId: string | null;
|
|
41
|
+
message(text: string): void;
|
|
42
|
+
tool(name: string): void;
|
|
43
|
+
/** `payload` is whatever the host needs back to answer this request. */
|
|
44
|
+
approvalRequested(requestId: string, summary: string, payload: Payload): void;
|
|
45
|
+
/** `text === null` falls back to the turn's collected messages. */
|
|
46
|
+
endTurn(outcome: TurnOutcome, text: string | null): void;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* A host's side of a Session: the encoding of each verb and the decoding
|
|
50
|
+
* of one incoming item. `incoming` ends when the child is gone; a
|
|
51
|
+
* protocol that correlates its own request/response pairs (Claude control
|
|
52
|
+
* requests) settles them inside `incoming`, before it ends.
|
|
53
|
+
*/
|
|
54
|
+
export interface SessionProtocol<Incoming, Payload> {
|
|
55
|
+
readonly incoming: AsyncIterable<Incoming>;
|
|
56
|
+
/** Settles when the child is gone; a rejection counts as an exit without code or signal. */
|
|
57
|
+
readonly exit: Promise<ExecExit>;
|
|
58
|
+
readonly stderrTail: string;
|
|
59
|
+
/** Ask the host to take a turn; resolves with the turn id once it has. */
|
|
60
|
+
startTurn(text: string): Promise<string>;
|
|
61
|
+
steer(turnId: string, text: string): Promise<void>;
|
|
62
|
+
interrupt(turnId: string): Promise<void>;
|
|
63
|
+
respond(payload: Payload, decision: ApprovalDecision): void;
|
|
64
|
+
decode(item: Incoming, sink: SessionSink<Payload>): void;
|
|
65
|
+
/** End the child: stdin EOF first, then signals. */
|
|
66
|
+
close(): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
export declare function assertHostSessionId(id: string, agentId: string): void;
|
|
69
|
+
export declare function sessionStateError(agentId: string, reason: string): AgentError<typeof AGENT_ERROR_CODE.invalidInput>;
|
|
70
|
+
export declare function sessionExitedError(agentId: string, exit: ExecExit | null, stderrTail: string): AgentError<typeof AGENT_ERROR_CODE.failed>;
|
|
71
|
+
/**
|
|
72
|
+
* One interactive child held for the life of a Session: stdout is read as
|
|
73
|
+
* NDJSON lines, stdin stays open for incremental writes, and `close()`
|
|
74
|
+
* ends stdin first (both hosts exit on EOF) before escalating to signals.
|
|
75
|
+
*/
|
|
76
|
+
export declare class SessionProcess {
|
|
77
|
+
private readonly process;
|
|
78
|
+
private readonly clock;
|
|
79
|
+
private exitValue;
|
|
80
|
+
private stderrTail;
|
|
81
|
+
private constructor();
|
|
82
|
+
static spawn(input: {
|
|
83
|
+
command: string;
|
|
84
|
+
args: readonly string[];
|
|
85
|
+
cwd: string;
|
|
86
|
+
ctx: SessionContext;
|
|
87
|
+
agentId: string;
|
|
88
|
+
}): Promise<SessionProcess>;
|
|
89
|
+
get exit(): Promise<ExecExit>;
|
|
90
|
+
get exited(): ExecExit | null;
|
|
91
|
+
get stderr(): string;
|
|
92
|
+
writeLine(line: string): void;
|
|
93
|
+
/** Non-empty stdout lines in order; stderr is kept as a tail for errors. */
|
|
94
|
+
lines(): AsyncGenerator<string, void, void>;
|
|
95
|
+
close(): Promise<ExecExit>;
|
|
96
|
+
}
|
|
97
|
+
/** Bind a host protocol to the one Session lifecycle. */
|
|
98
|
+
export declare function driveSession<Incoming, Payload>(input: {
|
|
99
|
+
id: string;
|
|
100
|
+
agentId: string;
|
|
101
|
+
protocol: SessionProtocol<Incoming, Payload>;
|
|
102
|
+
logger: Logger;
|
|
103
|
+
}): Session;
|
|
104
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/kernel/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EACV,KAAK,EACL,IAAI,EACJ,QAAQ,EAER,MAAM,EACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,OAAO,EAEZ,KAAK,YAAY,EAEjB,KAAK,WAAW,EAEjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG;IAC3B,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,WAAW,IAAI;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,4BAA4B,CAAC,WAAW,IAClD,0BAA0B,CAAC,WAAW,CAAC,GAAG;IACxC,mEAAmE;IACnE,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,CAAC,WAAW,IAAI;IAC3C,IAAI,CACF,OAAO,EAAE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