@agentproto/runtime 5.2.1 → 5.4.0

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.
@@ -1,6 +1,107 @@
1
- import { C as ContextContinuityPolicy, S as SpawnBrowserMode } from './context-continuity-BfNVbX5W.js';
1
+ import { AcpMcpServer } from '@agentproto/acp';
2
+ import { SandboxMode } from '@agentproto/command-sandbox';
2
3
  import { CatalogProvider } from '@agentproto/model-catalog';
3
4
 
5
+ /**
6
+ * `agent_start({ browser: "headless" })` — an isolated headless Chrome for
7
+ * one spawned agent, mounted as a per-session stdio MCP server
8
+ * (`chrome-devtools-mcp --headless --isolated`, see
9
+ * `@agentproto/plugin-local-browser`'s `buildHeadlessBrowserMcpEntry`).
10
+ *
11
+ * The server is a child of the adapter process, so it inherits the session's
12
+ * `commandSandbox` confinement and normally dies with the adapter (stdin EOF,
13
+ * and Chrome exits when its pipe closes). On `session:exited`,
14
+ * `sweepSessionBrowser` does two things:
15
+ * - kills anything still carrying the session's `--agentproto-session=<id>`
16
+ * Chrome marker, in case an adapter never exited or never closed its MCP
17
+ * children;
18
+ * - deletes the session's profile dir, `$TMPDIR/agentproto-browser/<id>`.
19
+ * The profile is caller-owned rather than `--isolated`, because `--isolated`
20
+ * only cleans up on a graceful `browser.close()`; observed live, a killed
21
+ * session left its puppeteer temp profile behind.
22
+ */
23
+
24
+ /** `agent_start.browser`. `false` (the default) mounts nothing. */
25
+ type SpawnBrowserMode = "headless" | false;
26
+ interface HeadlessBrowserMount {
27
+ entry: AcpMcpServer;
28
+ /** Read grants the adapter's `commandSandbox` needs for the MCP server +
29
+ * Chrome (threaded as `additionalReadPaths`). */
30
+ readPaths: string[];
31
+ }
32
+ interface ResolveHeadlessBrowserInput {
33
+ sessionId: string;
34
+ cwd: string;
35
+ /** The spawn's explicit `commandSandbox`; `undefined` falls back to the
36
+ * workspace's `adapterSpawn` config, like the driver does. */
37
+ commandSandbox?: SandboxMode;
38
+ }
39
+ type ResolveHeadlessBrowser = (input: ResolveHeadlessBrowserInput) => Promise<HeadlessBrowserMount>;
40
+
41
+ /**
42
+ * Canonical context-continuity policy for long-running agent sessions.
43
+ *
44
+ * Provides a deterministic, testable policy engine with safe defaults and a
45
+ * clear override order: global defaults → per-harness defaults →
46
+ * per-model defaults → session override. The policy drives warnings,
47
+ * opportunistic compaction, fresh continuation, and hard-stop decisions at
48
+ * turn boundaries so sessions never silently run into the model context
49
+ * limit.
50
+ */
51
+ /**
52
+ * `manual` suppresses every automatic *nudge* (warn/compact/continue-fresh —
53
+ * see `contextContinuityNextAction`) so the session is left alone until the
54
+ * caller acts. It does NOT suppress `hard-stop`: that state is an
55
+ * unconditional safety floor, independent of mode, by design — its whole
56
+ * purpose is to stop a session from silently running past the model's real
57
+ * context window (further prompts would be truncated/rejected by the
58
+ * provider, or corrupt the conversation) even when nothing is watching.
59
+ * `manual` means "don't nag me", not "let me drive off the window's edge".
60
+ * A session that wants to opt out of the hard stop should set
61
+ * `hardStopAtPct` above what it will ever reach, not rely on mode.
62
+ */
63
+ type ContextContinuityMode = "manual" | "ask" | "auto";
64
+ interface ContextContinuityThresholds {
65
+ /** Percentage at which the UI first warns that context is filling. */
66
+ warnAtPct: number;
67
+ /** Percentage at which an opportunistic compact may be attempted. */
68
+ compactAtPct: number;
69
+ /** Percentage at which a fresh continuation session is created. */
70
+ continueFreshAtPct: number;
71
+ /** Percentage above which no new prompt may be admitted. */
72
+ hardStopAtPct: number;
73
+ }
74
+ interface ContextContinuityCheckpointSections {
75
+ goal: boolean;
76
+ plan: boolean;
77
+ decisions: boolean;
78
+ changedFiles: boolean;
79
+ gitStatus: boolean;
80
+ tests: boolean;
81
+ errors: boolean;
82
+ risks: boolean;
83
+ nextStep: boolean;
84
+ config: boolean;
85
+ }
86
+ /**
87
+ * User-supplied policy fragment. Every field optional; missing values are
88
+ * filled from the next precedence layer or from safe defaults.
89
+ */
90
+ interface ContextContinuityPolicy extends Partial<ContextContinuityThresholds>, Partial<ContextContinuityCheckpointSections> {
91
+ mode?: ContextContinuityMode;
92
+ /** Optional display label for UIs. */
93
+ label?: string;
94
+ }
95
+ /**
96
+ * Fully-resolved, validated policy. This is the shape stored on a session
97
+ * descriptor and returned by status queries.
98
+ */
99
+ interface ResolvedContextContinuityPolicy extends ContextContinuityThresholds, Required<ContextContinuityCheckpointSections> {
100
+ mode: ContextContinuityMode;
101
+ /** Effective label (falls back to mode when absent). */
102
+ label: string;
103
+ }
104
+
4
105
  /**
5
106
  * Deferred/lazy MCP tool loading (harness-parity item 3).
6
107
  *
@@ -589,4 +690,4 @@ interface DeclaredAdapterOption {
589
690
  */
590
691
  declare function normalizeSkillsOption(skills: string[], options: Record<string, boolean | number | string>, declaredOptions: readonly DeclaredAdapterOption[] | undefined): Record<string, boolean | number | string>;
591
692
 
592
- export { type AdapterAuthDescriptor as A, CLAUDE_CODE_OAUTH_SOURCE as C, type DefaultsAdapterAuthConfig as D, type ResolvedAuthSpec as R, type SpawnDefaultsConfig as S, type DeclaredAdapterOption as a, type AuthEcho as b, AuthResolutionError as c, type CredentialSource as d, type DefaultsAdapterConfig as e, type DeferredToolsConfig as f, type ResolveSubscriptionCredentialInput as g, type ResolvedSpawnAuthMaterial as h, type ResolvedSpawnDefaults as i, type SubscriptionCredentialResolution as j, SubscriptionSourceError as k, credentialFingerprint as l, resolveDeferredToolsGatewayOption as m, normalizeSkillsOption as n, resolveSpawnDefaults as o, resolveSubscriptionCredential as p, resolveAuthSpec as r };
693
+ export { type AdapterAuthDescriptor as A, type ContextContinuityPolicy as C, type DefaultsAdapterAuthConfig as D, type ResolvedContextContinuityPolicy as R, type SpawnDefaultsConfig as S, type SpawnBrowserMode as a, type ResolveHeadlessBrowser as b, type ResolvedAuthSpec as c, type DeclaredAdapterOption as d, type AuthEcho as e, AuthResolutionError as f, CLAUDE_CODE_OAUTH_SOURCE as g, type CredentialSource as h, type DefaultsAdapterConfig as i, type DeferredToolsConfig as j, type ResolveSubscriptionCredentialInput as k, type ResolvedSpawnAuthMaterial as l, type ResolvedSpawnDefaults as m, type SubscriptionCredentialResolution as n, SubscriptionSourceError as o, credentialFingerprint as p, normalizeSkillsOption as q, resolveAuthSpec as r, resolveDeferredToolsGatewayOption as s, resolveSpawnDefaults as t, resolveSubscriptionCredential as u };
@@ -1,9 +1,11 @@
1
1
  import 'zod';
2
- import './session-config-RyRL2AbD.js';
3
- import './context-continuity-BfNVbX5W.js';
4
- export { bx as RecentSpawnConfig, U as UserPreset, aQ as UserPresetsFile, aX as deleteUserPreset, by as deriveRecentSpawnConfigs, b1 as getUserPreset, b7 as listUserPresets, b9 as loadUserPresets, bt as saveUserPreset, bz as touchUserPreset, bA as userPresetSchema, bv as userPresetsPath } from './sessions-g4fw_zKx.js';
2
+ import './session-config-DxIIuJFY.js';
3
+ import './spawn-defaults-Cp9SGZex.js';
4
+ export { c5 as RecentSpawnConfig, U as UserPreset, b8 as UserPresetsFile, bp as deleteUserPreset, c6 as deriveRecentSpawnConfigs, bw as getUserPreset, bC as listUserPresets, bE as loadUserPresets, c0 as saveUserPreset, c7 as touchUserPreset, c8 as userPresetSchema, c3 as userPresetsPath } from './sessions-DMzCgTVy.js';
5
5
  import '@agentproto/auth';
6
6
  import '@agentproto/acp';
7
7
  import '@agentproto/command-sandbox';
8
+ import '@agentproto/model-catalog';
8
9
  import '@agentproto/acp/client';
9
10
  import 'node:child_process';
11
+ import './config-Gz7q9yfJ.js';
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@agentproto/runtime",
3
- "version": "5.2.1",
3
+ "version": "5.4.0",
4
4
  "description": "@agentproto/runtime — long-running gateway that turns an agentproto workspace into a live runtime. Composes @agentproto/mcp-server (CRUD verbs) with HTTP transport, HEARTBEAT.md autonomy loop, and append-only conversation persistence. Drop a workspace dir, point your MCP client at it, and the agent ticks on its own.",
5
5
  "keywords": [
6
6
  "agentproto",
7
+ "aip-46",
8
+ "aip-58",
7
9
  "runtime",
8
10
  "gateway",
9
11
  "mcp",
@@ -91,6 +93,11 @@
91
93
  "import": "./dist/release-check.mjs",
92
94
  "default": "./dist/release-check.mjs"
93
95
  },
96
+ "./bundles": {
97
+ "types": "./dist/bundles.d.ts",
98
+ "import": "./dist/bundles.mjs",
99
+ "default": "./dist/bundles.mjs"
100
+ },
94
101
  "./mcp-imports": {
95
102
  "types": "./dist/mcp-imports.d.ts",
96
103
  "import": "./dist/mcp-imports.mjs",
@@ -148,45 +155,51 @@
148
155
  },
149
156
  "dependencies": {
150
157
  "@modelcontextprotocol/ext-apps": "1.7.5",
151
- "@modelcontextprotocol/sdk": "^1.30.0",
158
+ "@modelcontextprotocol/sdk": "^1.30.1",
152
159
  "ai": "^6.0.277",
153
160
  "croner": "^9.1.0",
154
161
  "gray-matter": "^4.0.3",
155
162
  "ws": "^8.21.3",
156
163
  "zod": "^4.6.5",
157
- "@agentproto/acp": "0.9.0",
158
- "@agentproto/agent": "0.2.4",
159
- "@agentproto/app-client": "0.4.0",
160
- "@agentproto/app-kit": "1.3.1",
161
- "@agentproto/apps": "0.16.0",
162
- "@agentproto/auth": "1.1.0",
163
- "@agentproto/command-sandbox": "0.2.2",
164
- "@agentproto/driver": "0.2.4",
165
- "@agentproto/driver-agent-cli": "2.5.1",
166
- "@agentproto/driver-http": "0.1.8",
167
- "@agentproto/eval-reporters": "0.2.18",
168
- "@agentproto/llm-endpoint": "0.11.1",
169
- "@agentproto/manifest": "0.2.2",
170
- "@agentproto/mcp-server": "0.4.0",
164
+ "@agentproto/a2a": "0.1.0",
165
+ "@agentproto/adapter-browser": "0.3.0",
166
+ "@agentproto/agent": "0.2.5",
167
+ "@agentproto/acp": "0.9.1",
168
+ "@agentproto/app-client": "0.4.1",
169
+ "@agentproto/apps": "0.17.1",
170
+ "@agentproto/auth": "1.1.1",
171
+ "@agentproto/command-sandbox": "0.3.0",
172
+ "@agentproto/driver": "0.3.0",
173
+ "@agentproto/driver-agent-cli": "2.6.1",
174
+ "@agentproto/driver-browser": "0.2.0",
175
+ "@agentproto/driver-http": "0.1.10",
176
+ "@agentproto/eval-reporters": "0.2.20",
177
+ "@agentproto/governance": "0.1.5",
178
+ "@agentproto/governance-engine": "0.1.10",
179
+ "@agentproto/llm-endpoint": "0.11.2",
180
+ "@agentproto/app-kit": "1.4.1",
181
+ "@agentproto/mcp-server": "0.4.2",
171
182
  "@agentproto/model-catalog": "0.11.3",
172
- "@agentproto/plugin-local-browser": "0.3.0",
173
- "@agentproto/provider-kit": "0.4.5",
183
+ "@agentproto/pairing-host": "0.2.0",
184
+ "@agentproto/plugin-local-browser": "0.3.2",
185
+ "@agentproto/provider-kit": "0.4.6",
174
186
  "@agentproto/provider-presets": "0.7.0",
175
187
  "@agentproto/providers-store": "0.3.21",
176
- "@agentproto/redaction": "0.2.2",
177
- "@agentproto/review": "0.3.0",
178
- "@agentproto/routine": "0.3.0",
179
- "@agentproto/sandbox": "0.7.1",
180
- "@agentproto/secrets": "1.1.0",
181
- "@agentproto/telemetry-langfuse": "0.2.16",
182
- "@agentproto/tool": "0.3.1",
183
- "@agentproto/workflow": "0.7.0",
184
- "@agentproto/workflow-loader": "0.2.4",
185
- "@agentproto/workflow-runtime": "0.14.0",
186
- "@agentproto/workspace-brain": "0.4.8"
188
+ "@agentproto/redaction": "0.2.3",
189
+ "@agentproto/review": "0.4.0",
190
+ "@agentproto/routine": "0.3.1",
191
+ "@agentproto/sandbox": "0.7.3",
192
+ "@agentproto/telemetry-langfuse": "0.2.18",
193
+ "@agentproto/tool": "0.4.0",
194
+ "@agentproto/secrets": "1.2.0",
195
+ "@agentproto/workflow": "0.7.1",
196
+ "@agentproto/workflow-loader": "0.2.5",
197
+ "@agentproto/workflow-runtime": "0.16.0",
198
+ "@agentproto/workspace-brain": "0.4.10",
199
+ "@agentproto/manifest": "0.2.3"
187
200
  },
188
201
  "optionalDependencies": {
189
- "@agentproto/sandbox-e2b": "0.5.8"
202
+ "@agentproto/sandbox-e2b": "0.5.10"
190
203
  },
191
204
  "devDependencies": {
192
205
  "@types/node": "^25.9.5",
@@ -1,104 +0,0 @@
1
- import { AcpMcpServer } from '@agentproto/acp';
2
- import { SandboxMode } from '@agentproto/command-sandbox';
3
-
4
- /**
5
- * `agent_start({ browser: "headless" })` — an isolated headless Chrome for
6
- * one spawned agent, mounted as a per-session stdio MCP server
7
- * (`chrome-devtools-mcp --headless --isolated`, see
8
- * `@agentproto/plugin-local-browser`'s `buildHeadlessBrowserMcpEntry`).
9
- *
10
- * The server is a child of the adapter process, so it inherits the session's
11
- * `commandSandbox` confinement and normally dies with the adapter (stdin EOF,
12
- * and Chrome exits when its pipe closes). On `session:exited`,
13
- * `sweepSessionBrowser` does two things:
14
- * - kills anything still carrying the session's `--agentproto-session=<id>`
15
- * Chrome marker, in case an adapter never exited or never closed its MCP
16
- * children;
17
- * - deletes the session's profile dir, `$TMPDIR/agentproto-browser/<id>`.
18
- * The profile is caller-owned rather than `--isolated`, because `--isolated`
19
- * only cleans up on a graceful `browser.close()`; observed live, a killed
20
- * session left its puppeteer temp profile behind.
21
- */
22
-
23
- /** `agent_start.browser`. `false` (the default) mounts nothing. */
24
- type SpawnBrowserMode = "headless" | false;
25
- interface HeadlessBrowserMount {
26
- entry: AcpMcpServer;
27
- /** Read grants the adapter's `commandSandbox` needs for the MCP server +
28
- * Chrome (threaded as `additionalReadPaths`). */
29
- readPaths: string[];
30
- }
31
- interface ResolveHeadlessBrowserInput {
32
- sessionId: string;
33
- cwd: string;
34
- /** The spawn's explicit `commandSandbox`; `undefined` falls back to the
35
- * workspace's `adapterSpawn` config, like the driver does. */
36
- commandSandbox?: SandboxMode;
37
- }
38
- type ResolveHeadlessBrowser = (input: ResolveHeadlessBrowserInput) => Promise<HeadlessBrowserMount>;
39
-
40
- /**
41
- * Canonical context-continuity policy for long-running agent sessions.
42
- *
43
- * Provides a deterministic, testable policy engine with safe defaults and a
44
- * clear override order: global defaults → per-harness defaults →
45
- * per-model defaults → session override. The policy drives warnings,
46
- * opportunistic compaction, fresh continuation, and hard-stop decisions at
47
- * turn boundaries so sessions never silently run into the model context
48
- * limit.
49
- */
50
- /**
51
- * `manual` suppresses every automatic *nudge* (warn/compact/continue-fresh —
52
- * see `contextContinuityNextAction`) so the session is left alone until the
53
- * caller acts. It does NOT suppress `hard-stop`: that state is an
54
- * unconditional safety floor, independent of mode, by design — its whole
55
- * purpose is to stop a session from silently running past the model's real
56
- * context window (further prompts would be truncated/rejected by the
57
- * provider, or corrupt the conversation) even when nothing is watching.
58
- * `manual` means "don't nag me", not "let me drive off the window's edge".
59
- * A session that wants to opt out of the hard stop should set
60
- * `hardStopAtPct` above what it will ever reach, not rely on mode.
61
- */
62
- type ContextContinuityMode = "manual" | "ask" | "auto";
63
- interface ContextContinuityThresholds {
64
- /** Percentage at which the UI first warns that context is filling. */
65
- warnAtPct: number;
66
- /** Percentage at which an opportunistic compact may be attempted. */
67
- compactAtPct: number;
68
- /** Percentage at which a fresh continuation session is created. */
69
- continueFreshAtPct: number;
70
- /** Percentage above which no new prompt may be admitted. */
71
- hardStopAtPct: number;
72
- }
73
- interface ContextContinuityCheckpointSections {
74
- goal: boolean;
75
- plan: boolean;
76
- decisions: boolean;
77
- changedFiles: boolean;
78
- gitStatus: boolean;
79
- tests: boolean;
80
- errors: boolean;
81
- risks: boolean;
82
- nextStep: boolean;
83
- config: boolean;
84
- }
85
- /**
86
- * User-supplied policy fragment. Every field optional; missing values are
87
- * filled from the next precedence layer or from safe defaults.
88
- */
89
- interface ContextContinuityPolicy extends Partial<ContextContinuityThresholds>, Partial<ContextContinuityCheckpointSections> {
90
- mode?: ContextContinuityMode;
91
- /** Optional display label for UIs. */
92
- label?: string;
93
- }
94
- /**
95
- * Fully-resolved, validated policy. This is the shape stored on a session
96
- * descriptor and returned by status queries.
97
- */
98
- interface ResolvedContextContinuityPolicy extends ContextContinuityThresholds, Required<ContextContinuityCheckpointSections> {
99
- mode: ContextContinuityMode;
100
- /** Effective label (falls back to mode when absent). */
101
- label: string;
102
- }
103
-
104
- export type { ContextContinuityPolicy as C, ResolvedContextContinuityPolicy as R, SpawnBrowserMode as S, ResolveHeadlessBrowser as a };