@agentproto/runtime 4.1.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog-models.d.ts +3 -3
- package/dist/catalog-models.mjs.map +1 -1
- package/dist/config-schema.d.ts +2 -2
- package/dist/config-schema.mjs +148 -35
- package/dist/config-schema.mjs.map +1 -1
- package/dist/config.d.ts +50 -3
- package/dist/config.mjs +148 -35
- package/dist/config.mjs.map +1 -1
- package/dist/{context-continuity-Bn99UtVC.d.ts → context-continuity-BfNVbX5W.d.ts} +1 -1
- package/dist/index.d.ts +3792 -8564
- package/dist/index.mjs +6399 -1215
- package/dist/index.mjs.map +1 -1
- package/dist/{session-config-ByfVeEQJ.d.ts → session-config-RyRL2AbD.d.ts} +1 -1
- package/dist/session-presence.mjs +148 -35
- package/dist/session-presence.mjs.map +1 -1
- package/dist/sessions-g4fw_zKx.d.ts +6231 -0
- package/dist/{spawn-defaults-CZj39Znq.d.ts → spawn-defaults-CHvz85DD.d.ts} +13 -1
- package/dist/user-presets.d.ts +6 -94
- package/dist/user-presets.mjs +36 -4
- package/dist/user-presets.mjs.map +1 -1
- package/docs/mcp-tools/agent_start.md +18 -0
- package/package.json +14 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CostBudget } from '@agentproto/auth';
|
|
2
|
-
import { C as ContextContinuityPolicy } from './context-continuity-
|
|
2
|
+
import { C as ContextContinuityPolicy } from './context-continuity-BfNVbX5W.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* SessionConfig — the unified per-session config surface, decomposed into
|
|
@@ -16,6 +16,7 @@ import '@agentproto/command-sandbox';
|
|
|
16
16
|
import '@agentproto/plugin-local-browser';
|
|
17
17
|
import '@modelcontextprotocol/sdk/types.js';
|
|
18
18
|
import '@agentproto/provider-kit';
|
|
19
|
+
import '@agentproto/llm-endpoint';
|
|
19
20
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
20
21
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
21
22
|
import 'net';
|
|
@@ -1934,6 +1935,29 @@ var init_worktree_identity = __esm({
|
|
|
1934
1935
|
z.object({ worktreeId: z.string() });
|
|
1935
1936
|
}
|
|
1936
1937
|
});
|
|
1938
|
+
var init_mcp_imports = __esm({
|
|
1939
|
+
"src/mcp-imports.ts"() {
|
|
1940
|
+
}
|
|
1941
|
+
});
|
|
1942
|
+
var bundleIdSchema, bundleSchema;
|
|
1943
|
+
var init_bundles = __esm({
|
|
1944
|
+
"src/bundles.ts"() {
|
|
1945
|
+
init_mcp_imports();
|
|
1946
|
+
bundleIdSchema = z.string().regex(/^[a-z0-9][a-z0-9-]*$/, "id must be lowercase kebab-case (letters, digits, hyphens)");
|
|
1947
|
+
bundleSchema = z.object({
|
|
1948
|
+
id: bundleIdSchema,
|
|
1949
|
+
label: z.string().min(1),
|
|
1950
|
+
description: z.string().min(1).optional(),
|
|
1951
|
+
mcpImports: z.array(z.string().min(1)),
|
|
1952
|
+
includeDaemon: z.boolean().optional(),
|
|
1953
|
+
skills: z.array(z.string().min(1))
|
|
1954
|
+
});
|
|
1955
|
+
z.object({
|
|
1956
|
+
version: z.literal(1),
|
|
1957
|
+
bundles: z.array(bundleSchema)
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1937
1961
|
var init_catalog_models = __esm({
|
|
1938
1962
|
"src/catalog-models.ts"() {
|
|
1939
1963
|
init_spawn_defaults();
|
|
@@ -1986,6 +2010,41 @@ var init_canonical_posture = __esm({
|
|
|
1986
2010
|
})();
|
|
1987
2011
|
}
|
|
1988
2012
|
});
|
|
2013
|
+
var effortSchema, postureSchema, routeSchema, userPresetSchema;
|
|
2014
|
+
var init_user_presets = __esm({
|
|
2015
|
+
"src/user-presets.ts"() {
|
|
2016
|
+
effortSchema = z.enum(["low", "medium", "high", "xhigh", "max", "ultracode"]);
|
|
2017
|
+
postureSchema = z.union([
|
|
2018
|
+
z.enum(["default", "plan", "accept-edits", "bypass", "read-only"]),
|
|
2019
|
+
z.object({ harnessModeId: z.string().min(1) })
|
|
2020
|
+
]);
|
|
2021
|
+
routeSchema = z.object({
|
|
2022
|
+
gateway: z.string().min(1),
|
|
2023
|
+
baseUrl: z.string().url().optional()
|
|
2024
|
+
});
|
|
2025
|
+
userPresetSchema = z.object({
|
|
2026
|
+
id: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
2027
|
+
label: z.string().min(1),
|
|
2028
|
+
adapter: z.string().min(1).optional(),
|
|
2029
|
+
harness: z.string().min(1).optional(),
|
|
2030
|
+
model: z.string().min(1).optional(),
|
|
2031
|
+
route: routeSchema.optional(),
|
|
2032
|
+
access: z.object({ profileRef: z.string().min(1).optional() }).optional(),
|
|
2033
|
+
posture: postureSchema.optional(),
|
|
2034
|
+
effort: effortSchema.optional(),
|
|
2035
|
+
contextProfile: z.string().min(1).optional(),
|
|
2036
|
+
cwd: z.string().min(1).optional(),
|
|
2037
|
+
skills: z.array(z.string().min(1)).optional(),
|
|
2038
|
+
bundles: z.array(z.string().min(1)).optional(),
|
|
2039
|
+
browser: z.union([z.literal("headless"), z.literal(false)]).optional(),
|
|
2040
|
+
lastUsedAt: z.string().min(1).optional()
|
|
2041
|
+
});
|
|
2042
|
+
z.object({
|
|
2043
|
+
version: z.literal(1),
|
|
2044
|
+
presets: z.array(userPresetSchema)
|
|
2045
|
+
});
|
|
2046
|
+
}
|
|
2047
|
+
});
|
|
1989
2048
|
var harnessPresetSchema;
|
|
1990
2049
|
var init_harness_preset_store = __esm({
|
|
1991
2050
|
"src/harness-preset-store.ts"() {
|
|
@@ -2086,6 +2145,10 @@ var init_session_title = __esm({
|
|
|
2086
2145
|
"src/session-title.ts"() {
|
|
2087
2146
|
}
|
|
2088
2147
|
});
|
|
2148
|
+
var init_inference_binding = __esm({
|
|
2149
|
+
"src/inference-binding.ts"() {
|
|
2150
|
+
}
|
|
2151
|
+
});
|
|
2089
2152
|
|
|
2090
2153
|
// src/mcp-credential-deps.ts
|
|
2091
2154
|
var init_mcp_credential_deps = __esm({
|
|
@@ -2137,16 +2200,20 @@ var init_sandbox_adapters = __esm({
|
|
|
2137
2200
|
var init_session_spawn = __esm({
|
|
2138
2201
|
"src/session-spawn.ts"() {
|
|
2139
2202
|
init_sessions();
|
|
2203
|
+
init_transcript_writer();
|
|
2140
2204
|
init_workspaces_config();
|
|
2141
2205
|
init_config();
|
|
2142
2206
|
init_worktree_identity();
|
|
2143
2207
|
init_spawn_defaults();
|
|
2208
|
+
init_bundles();
|
|
2209
|
+
init_mcp_imports();
|
|
2144
2210
|
init_launch_config();
|
|
2145
2211
|
init_claude_code_oauth_source();
|
|
2146
2212
|
init_providers_store();
|
|
2147
2213
|
init_catalog_models();
|
|
2148
2214
|
init_context_continuity();
|
|
2149
2215
|
init_canonical_posture();
|
|
2216
|
+
init_user_presets();
|
|
2150
2217
|
init_harness_preset_store();
|
|
2151
2218
|
init_browser_mount();
|
|
2152
2219
|
init_role();
|
|
@@ -2155,6 +2222,7 @@ var init_session_spawn = __esm({
|
|
|
2155
2222
|
init_agents_md();
|
|
2156
2223
|
init_workspace_rules();
|
|
2157
2224
|
init_session_title();
|
|
2225
|
+
init_inference_binding();
|
|
2158
2226
|
init_mcp_credential_deps();
|
|
2159
2227
|
init_sandbox_agent_session_proxy();
|
|
2160
2228
|
init_sandbox_ledger();
|
|
@@ -2286,6 +2354,9 @@ var init_agent_start_schema = __esm({
|
|
|
2286
2354
|
notifyParentOnCrash: mcpBool.optional().describe(
|
|
2287
2355
|
`Notify this session's parent directly (in-band) if it later crashes. Independent of the global \`notifyUrl\` webhook, which fires either way. ${help("notifyParentOnCrash")}`
|
|
2288
2356
|
),
|
|
2357
|
+
sentinel: mcpBool.optional().describe(
|
|
2358
|
+
`Set false to opt this spawn OUT of sentinel auto-link: a PR this session opens will never get an automatic AIP-60 sentinel watching it, regardless of the daemon's \`sentinel.autoWatchPrs\` config. ${help("sentinel")}`
|
|
2359
|
+
),
|
|
2289
2360
|
allowSharedCwd: mcpBool.optional().describe(
|
|
2290
2361
|
"Acknowledge running a nested spawn in the parent's dirty working tree, silencing the shared-dirty-cwd warning. Only relevant with no `worktree`/`sandbox`; default false = warn."
|
|
2291
2362
|
),
|
|
@@ -2300,6 +2371,12 @@ var init_agent_start_schema = __esm({
|
|
|
2300
2371
|
skills: jsonTolerant(z.array(z.string())).optional().describe(
|
|
2301
2372
|
`Normalized skill ids for this session (e.g. ['agentproto']). REPLACES (not unions) config defaults when set. Adapters with no \`skills\` option (e.g. claude-code) ignore it. ${help("skills")}`
|
|
2302
2373
|
),
|
|
2374
|
+
bundles: jsonTolerant(z.array(z.string())).optional().describe(
|
|
2375
|
+
`Capability bundle ids (\`bundle_list\`) to attach \u2014 each expands to its imported MCPs (mounted as native MCP servers, never via the mcp_imported_* indirection) + skills, and optionally the daemon's own /mcp. REPLACES (not unions) config defaults when set. ${help("bundles")}`
|
|
2376
|
+
),
|
|
2377
|
+
daemonMount: mcpBool.optional().describe(
|
|
2378
|
+
`Explicitly mount the daemon's own scoped /mcp gateway for this spawn \u2014 the only way an adapter outside the default self-mount set (opencode, codex, gemini, \u2026) gets it. Default false. ${help("daemonMount")}`
|
|
2379
|
+
),
|
|
2303
2380
|
model: z.string().optional().describe(
|
|
2304
2381
|
"Model identifier to pass to the adapter. For claude-code, applied via session/set_config_option \u2014 NOT a CLI flag."
|
|
2305
2382
|
),
|
|
@@ -2309,6 +2386,16 @@ var init_agent_start_schema = __esm({
|
|
|
2309
2386
|
route: jsonTolerant(
|
|
2310
2387
|
z.object({ gateway: z.string().min(1), baseUrl: z.string().url().optional() })
|
|
2311
2388
|
).optional().describe("Billing route/gateway. Independent of `model` and `access`."),
|
|
2389
|
+
inference: jsonTolerant(
|
|
2390
|
+
z.object({
|
|
2391
|
+
endpoint: z.string().min(1).optional().describe('A registered local/LAN inference endpoint id (`agentproto llm endpoints list`), or "<id>@<device>" for a paired device\'s own shared endpoint.'),
|
|
2392
|
+
model: z.string().min(1).optional().describe('A bare model id (paired with `endpoint`), or the shorthand "<model>@<device|endpoint>" when `endpoint` is omitted.'),
|
|
2393
|
+
force: mcpBool.optional().describe("Skip the fit-check refusal on a clear miss (the check still runs and still warns)."),
|
|
2394
|
+
headroomPct: z.number().min(0).max(95).optional().describe("Headroom percentage held back from the endpoint's loaded ctx for the fit check. Default 25.")
|
|
2395
|
+
})
|
|
2396
|
+
).optional().describe(
|
|
2397
|
+
`Bind this spawn to a local/LAN inference endpoint instead of a cloud model: \`{endpoint}\`, \`{endpoint, model}\`, or the shorthand \`{model: "<model>@<device|endpoint>"}\`. Runs a fit check (the harness's known first-request size vs the endpoint's loaded ctx) BEFORE spawning and refuses with an actionable error on a clear miss (\`force\` overrides). Defaults \`adapter\`/\`harness\` to "pi" when neither is set. Mutually exclusive with \`model\`/\`route\`/\`access\` \u2014 set those directly instead of \`inference\`, never both. ${help("inference")}`
|
|
2398
|
+
),
|
|
2312
2399
|
access: jsonTolerant(z.object({ profileRef: z.string().min(1).optional() })).optional().describe("Named auth profile to bill at initial spawn; resolved from the local keychain."),
|
|
2313
2400
|
posture: z.string().optional().describe("Canonical agent posture (plan, bypass, accept-edits, read-only) or native harness mode."),
|
|
2314
2401
|
contextProfile: z.string().optional().describe("Context intake profile (for example full or lean)."),
|
|
@@ -2447,39 +2534,6 @@ var init_agent_start_schema = __esm({
|
|
|
2447
2534
|
agentStartInputSchema.omit({ wait: true });
|
|
2448
2535
|
}
|
|
2449
2536
|
});
|
|
2450
|
-
var effortSchema, postureSchema, routeSchema, userPresetSchema;
|
|
2451
|
-
var init_user_presets = __esm({
|
|
2452
|
-
"src/user-presets.ts"() {
|
|
2453
|
-
effortSchema = z.enum(["low", "medium", "high", "xhigh", "max", "ultracode"]);
|
|
2454
|
-
postureSchema = z.union([
|
|
2455
|
-
z.enum(["default", "plan", "accept-edits", "bypass", "read-only"]),
|
|
2456
|
-
z.object({ harnessModeId: z.string().min(1) })
|
|
2457
|
-
]);
|
|
2458
|
-
routeSchema = z.object({
|
|
2459
|
-
gateway: z.string().min(1),
|
|
2460
|
-
baseUrl: z.string().url().optional()
|
|
2461
|
-
});
|
|
2462
|
-
userPresetSchema = z.object({
|
|
2463
|
-
id: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
2464
|
-
label: z.string().min(1),
|
|
2465
|
-
adapter: z.string().min(1).optional(),
|
|
2466
|
-
harness: z.string().min(1).optional(),
|
|
2467
|
-
model: z.string().min(1).optional(),
|
|
2468
|
-
route: routeSchema.optional(),
|
|
2469
|
-
access: z.object({ profileRef: z.string().min(1).optional() }).optional(),
|
|
2470
|
-
posture: postureSchema.optional(),
|
|
2471
|
-
effort: effortSchema.optional(),
|
|
2472
|
-
contextProfile: z.string().min(1).optional(),
|
|
2473
|
-
cwd: z.string().min(1).optional(),
|
|
2474
|
-
skills: z.array(z.string().min(1)).optional(),
|
|
2475
|
-
browser: z.union([z.literal("headless"), z.literal(false)]).optional()
|
|
2476
|
-
});
|
|
2477
|
-
z.object({
|
|
2478
|
-
version: z.literal(1),
|
|
2479
|
-
presets: z.array(userPresetSchema)
|
|
2480
|
-
});
|
|
2481
|
-
}
|
|
2482
|
-
});
|
|
2483
2537
|
var init_catalog_provider_models = __esm({
|
|
2484
2538
|
"src/catalog-provider-models.ts"() {
|
|
2485
2539
|
}
|
|
@@ -2564,6 +2618,11 @@ var init_session_observer = __esm({
|
|
|
2564
2618
|
"src/session-observer.ts"() {
|
|
2565
2619
|
}
|
|
2566
2620
|
});
|
|
2621
|
+
var init_session_artifacts = __esm({
|
|
2622
|
+
"src/session-artifacts.ts"() {
|
|
2623
|
+
init_transcript_writer();
|
|
2624
|
+
}
|
|
2625
|
+
});
|
|
2567
2626
|
var DEFAULT_TITLER_MODEL;
|
|
2568
2627
|
var init_session_titler = __esm({
|
|
2569
2628
|
"src/session-titler.ts"() {
|
|
@@ -2639,6 +2698,7 @@ var init_sessions = __esm({
|
|
|
2639
2698
|
init_session_observer();
|
|
2640
2699
|
init_tool_presenter();
|
|
2641
2700
|
init_transcript_writer();
|
|
2701
|
+
init_session_artifacts();
|
|
2642
2702
|
init_session_titler();
|
|
2643
2703
|
init_resume_context_digest();
|
|
2644
2704
|
init_conversation_index();
|
|
@@ -2722,7 +2782,9 @@ var init_config_schema = __esm({
|
|
|
2722
2782
|
skills: z.array(z.string()).optional(),
|
|
2723
2783
|
options: optionsMapSchema.optional(),
|
|
2724
2784
|
auth: defaultsAdapterAuthConfigSchema.optional(),
|
|
2725
|
-
contextContinuity: contextContinuityPolicySchema.optional()
|
|
2785
|
+
contextContinuity: contextContinuityPolicySchema.optional(),
|
|
2786
|
+
bundles: z.array(z.string()).optional(),
|
|
2787
|
+
daemonMount: z.boolean().optional()
|
|
2726
2788
|
}).passthrough();
|
|
2727
2789
|
mcpDefaultsConfigSchema = z.object({
|
|
2728
2790
|
deferredTools: deferredToolsConfigSchema.optional()
|
|
@@ -2731,6 +2793,7 @@ var init_config_schema = __esm({
|
|
|
2731
2793
|
skills: z.array(z.string()).optional(),
|
|
2732
2794
|
options: optionsMapSchema.optional(),
|
|
2733
2795
|
adapters: z.record(z.string(), defaultsAdapterConfigSchema).optional(),
|
|
2796
|
+
bundles: z.array(z.string()).optional(),
|
|
2734
2797
|
contextContinuity: contextContinuityPolicySchema.optional(),
|
|
2735
2798
|
defaultRoleDepthCutoff: z.number().optional(),
|
|
2736
2799
|
maxGrantableDelegation: z.number().optional(),
|
|
@@ -2772,7 +2835,9 @@ var init_config_schema = __esm({
|
|
|
2772
2835
|
}).passthrough();
|
|
2773
2836
|
featuresConfigSchema = z.object({
|
|
2774
2837
|
pty: z.boolean().optional(),
|
|
2775
|
-
llmEndpoint: z.boolean().optional()
|
|
2838
|
+
llmEndpoint: z.boolean().optional(),
|
|
2839
|
+
deviceInferenceShare: z.boolean().optional(),
|
|
2840
|
+
deviceSpawnAllow: z.boolean().optional()
|
|
2776
2841
|
}).passthrough();
|
|
2777
2842
|
worktreesConfigSchema = z.object({
|
|
2778
2843
|
root: z.string().optional(),
|
|
@@ -3112,6 +3177,15 @@ var init_config_schema = __esm({
|
|
|
3112
3177
|
label: "Default options",
|
|
3113
3178
|
help: "AIP-45 options auto-applied to every agent_start spawn."
|
|
3114
3179
|
},
|
|
3180
|
+
{
|
|
3181
|
+
path: "defaults.bundles",
|
|
3182
|
+
schema: strArray,
|
|
3183
|
+
apply: "hot",
|
|
3184
|
+
writable: true,
|
|
3185
|
+
section: "defaults",
|
|
3186
|
+
label: "Default capability bundles",
|
|
3187
|
+
help: "Bundle ids (bundle_list) auto-attached to every agent_start spawn (unioned with per-adapter bundles)."
|
|
3188
|
+
},
|
|
3115
3189
|
{
|
|
3116
3190
|
path: "defaults.defaultRoleDepthCutoff",
|
|
3117
3191
|
schema: num,
|
|
@@ -3338,6 +3412,25 @@ var init_config_schema = __esm({
|
|
|
3338
3412
|
label: "Adapter default options",
|
|
3339
3413
|
help: "AIP-45 options auto-applied to spawns of this adapter."
|
|
3340
3414
|
},
|
|
3415
|
+
{
|
|
3416
|
+
path: "defaults.adapters.*.bundles",
|
|
3417
|
+
schema: strArray,
|
|
3418
|
+
apply: "hot",
|
|
3419
|
+
writable: true,
|
|
3420
|
+
section: "harnesses",
|
|
3421
|
+
label: "Adapter default capability bundles",
|
|
3422
|
+
help: "Bundle ids (bundle_list) auto-attached to spawns of this adapter (unioned with the global default)."
|
|
3423
|
+
},
|
|
3424
|
+
{
|
|
3425
|
+
path: "defaults.adapters.*.daemonMount",
|
|
3426
|
+
schema: z.boolean(),
|
|
3427
|
+
apply: "hot",
|
|
3428
|
+
writable: true,
|
|
3429
|
+
section: "harnesses",
|
|
3430
|
+
label: "Adapter daemon self-mount opt-in",
|
|
3431
|
+
help: "Explicitly mount the daemon's own scoped /mcp for spawns of this adapter, for harnesses outside the default self-mount allowlist (opencode, codex, gemini, \u2026).",
|
|
3432
|
+
default: false
|
|
3433
|
+
},
|
|
3341
3434
|
{
|
|
3342
3435
|
path: "defaults.adapters.*.contextContinuity",
|
|
3343
3436
|
schema: contextContinuityPolicySchema,
|
|
@@ -3581,6 +3674,26 @@ var init_config_schema = __esm({
|
|
|
3581
3674
|
label: "LLM Endpoint feature",
|
|
3582
3675
|
help: "Enable the local LLM Endpoint proxy sidecar (route + MCP tools + child-process lifecycle).",
|
|
3583
3676
|
default: false
|
|
3677
|
+
},
|
|
3678
|
+
{
|
|
3679
|
+
path: "features.deviceInferenceShare",
|
|
3680
|
+
schema: bool,
|
|
3681
|
+
apply: "restart",
|
|
3682
|
+
writable: true,
|
|
3683
|
+
section: "daemon",
|
|
3684
|
+
label: "Device inference sharing",
|
|
3685
|
+
help: "Expose this daemon's local inference endpoint(s) to a paired HOST-scoped controller. Toggle via `agentproto devices share-inference on|off`.",
|
|
3686
|
+
default: false
|
|
3687
|
+
},
|
|
3688
|
+
{
|
|
3689
|
+
path: "features.deviceSpawnAllow",
|
|
3690
|
+
schema: bool,
|
|
3691
|
+
apply: "restart",
|
|
3692
|
+
writable: true,
|
|
3693
|
+
section: "daemon",
|
|
3694
|
+
label: "Device spawn allow",
|
|
3695
|
+
help: 'Allow a paired HOST-scoped controller to spawn/drive agent sessions on this daemon (`agent_start({ sandbox: "device:<name>" })`). Toggle via `agentproto devices allow-spawn on|off`.',
|
|
3696
|
+
default: false
|
|
3584
3697
|
}
|
|
3585
3698
|
];
|
|
3586
3699
|
}
|