@agentproto/runtime 0.7.0 → 0.8.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.
- package/README.md +1 -0
- package/dist/config-BRKy_SAF.d.ts +569 -0
- package/dist/config.d.ts +1 -272
- package/dist/config.mjs.map +1 -1
- package/dist/index.d.ts +154 -3
- package/dist/index.mjs +191 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/spawn-defaults-DAbADRd4.d.ts +0 -256
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createReadStream, existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, renameSync,
|
|
1
|
+
import { createReadStream, existsSync, promises, readdirSync, readFileSync, mkdirSync, writeFileSync, renameSync, createWriteStream, statSync, openSync, closeSync } from 'fs';
|
|
2
2
|
import { homedir, tmpdir } from 'os';
|
|
3
3
|
import { join, resolve, dirname, isAbsolute, normalize, relative, basename } from 'path';
|
|
4
4
|
import { createInterface } from 'readline';
|
|
@@ -1809,7 +1809,7 @@ function sanitizeAcpAgents(raw, target) {
|
|
|
1809
1809
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
1810
1810
|
}
|
|
1811
1811
|
async function loadConfig(path) {
|
|
1812
|
-
const target = CONFIG_FILE_PATH();
|
|
1812
|
+
const target = path ?? CONFIG_FILE_PATH();
|
|
1813
1813
|
try {
|
|
1814
1814
|
const raw = await promises.readFile(target, "utf8");
|
|
1815
1815
|
const parsed = JSON.parse(raw);
|
|
@@ -1900,6 +1900,7 @@ function resolveAuthSpec(input) {
|
|
|
1900
1900
|
const subCredAvailable = input.subscriptionCredential !== void 0;
|
|
1901
1901
|
const apiCredAvailable = input.apiKeyConfigCredential !== void 0 || input.apiKeyStoreCredential !== void 0;
|
|
1902
1902
|
let mode;
|
|
1903
|
+
let neitherConfigured = false;
|
|
1903
1904
|
if (input.requestedMode) {
|
|
1904
1905
|
if (input.requestedMode === "subscription" && !supportsSub) {
|
|
1905
1906
|
throw new AuthResolutionError(
|
|
@@ -1909,7 +1910,11 @@ function resolveAuthSpec(input) {
|
|
|
1909
1910
|
mode = input.requestedMode;
|
|
1910
1911
|
} else {
|
|
1911
1912
|
const preference = supportsSub ? ["subscription", "api-key"] : ["api-key"];
|
|
1912
|
-
|
|
1913
|
+
const available = preference.find(
|
|
1914
|
+
(m) => m === "subscription" ? subCredAvailable : apiCredAvailable
|
|
1915
|
+
);
|
|
1916
|
+
mode = available ?? preference[0];
|
|
1917
|
+
neitherConfigured = available === void 0;
|
|
1913
1918
|
}
|
|
1914
1919
|
let setEnv;
|
|
1915
1920
|
let credential;
|
|
@@ -1945,7 +1950,8 @@ function resolveAuthSpec(input) {
|
|
|
1945
1950
|
setEnv,
|
|
1946
1951
|
unsetEnv,
|
|
1947
1952
|
explicit: input.explicit,
|
|
1948
|
-
enforce
|
|
1953
|
+
enforce,
|
|
1954
|
+
...neitherConfigured ? { neitherConfigured } : {}
|
|
1949
1955
|
};
|
|
1950
1956
|
const echo = {
|
|
1951
1957
|
provider,
|
|
@@ -2271,6 +2277,50 @@ function createSandboxAgentSessionProxy(opts) {
|
|
|
2271
2277
|
};
|
|
2272
2278
|
}
|
|
2273
2279
|
|
|
2280
|
+
// src/worktree-isolation.ts
|
|
2281
|
+
var WORKTREE_ISOLATION_ENV = "AGENTPROTO_WORKTREES_ISOLATION";
|
|
2282
|
+
var DEFAULT_WORKTREE_ISOLATION = "on-request";
|
|
2283
|
+
function normalizeWorktreeField(field) {
|
|
2284
|
+
if (field === void 0 || field === false) return void 0;
|
|
2285
|
+
if (field === true) return {};
|
|
2286
|
+
const request = {};
|
|
2287
|
+
if (field.slug !== void 0) request.slug = field.slug;
|
|
2288
|
+
if (field.base !== void 0) request.base = field.base;
|
|
2289
|
+
return request;
|
|
2290
|
+
}
|
|
2291
|
+
function decideWorktreeIsolation(input) {
|
|
2292
|
+
const request = normalizeWorktreeField(input.field);
|
|
2293
|
+
if (input.depth > 0) return { action: "spawn-in-place" };
|
|
2294
|
+
switch (input.mode) {
|
|
2295
|
+
case "never":
|
|
2296
|
+
if (request !== void 0) {
|
|
2297
|
+
return {
|
|
2298
|
+
action: "reject",
|
|
2299
|
+
message: `agent_start: \`worktree\` was requested but this daemon's \`worktrees.isolation\` policy is set to "never". Remove the \`worktree\` field, or change the policy (config \`worktrees.isolation\` / env ${WORKTREE_ISOLATION_ENV}).`
|
|
2300
|
+
};
|
|
2301
|
+
}
|
|
2302
|
+
return { action: "spawn-in-place" };
|
|
2303
|
+
case "on-request":
|
|
2304
|
+
return request !== void 0 ? { action: "provision", request } : { action: "spawn-in-place" };
|
|
2305
|
+
case "always":
|
|
2306
|
+
return { action: "provision", request: request ?? {} };
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
function parseWorktreeIsolationMode(raw) {
|
|
2310
|
+
return raw === "always" || raw === "on-request" || raw === "never" ? raw : void 0;
|
|
2311
|
+
}
|
|
2312
|
+
async function loadWorktreeIsolation(loadCfg = loadConfig) {
|
|
2313
|
+
const fromEnv = parseWorktreeIsolationMode(process.env[WORKTREE_ISOLATION_ENV]);
|
|
2314
|
+
if (fromEnv) return fromEnv;
|
|
2315
|
+
try {
|
|
2316
|
+
const cfg = await loadCfg();
|
|
2317
|
+
const fromCfg = parseWorktreeIsolationMode(cfg.worktrees?.isolation);
|
|
2318
|
+
if (fromCfg) return fromCfg;
|
|
2319
|
+
} catch {
|
|
2320
|
+
}
|
|
2321
|
+
return DEFAULT_WORKTREE_ISOLATION;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2274
2324
|
// src/session-spawn.ts
|
|
2275
2325
|
var SPAWN_CLAIM_WINDOW_MS = 3e4;
|
|
2276
2326
|
var spawnClaimsByRegistry = /* @__PURE__ */ new WeakMap();
|
|
@@ -2298,7 +2348,9 @@ async function spawnAgentSession(deps2, input) {
|
|
|
2298
2348
|
callerScope,
|
|
2299
2349
|
webhookNotifier,
|
|
2300
2350
|
loadDefaultsConfig,
|
|
2301
|
-
resolveSandboxProvider: resolveSandboxProvider2
|
|
2351
|
+
resolveSandboxProvider: resolveSandboxProvider2,
|
|
2352
|
+
provisionWorktree,
|
|
2353
|
+
resolveWorktreeIsolation
|
|
2302
2354
|
} = deps2;
|
|
2303
2355
|
let cwd = input.cwd;
|
|
2304
2356
|
let resolvedSlug = input.workspaceSlug;
|
|
@@ -2366,6 +2418,28 @@ async function spawnAgentSession(deps2, input) {
|
|
|
2366
2418
|
};
|
|
2367
2419
|
}
|
|
2368
2420
|
}
|
|
2421
|
+
let worktreeRequest;
|
|
2422
|
+
if (input.sandbox === void 0) {
|
|
2423
|
+
const mode = resolveWorktreeIsolation ? await resolveWorktreeIsolation() : await loadWorktreeIsolation();
|
|
2424
|
+
const decision = decideWorktreeIsolation({
|
|
2425
|
+
mode,
|
|
2426
|
+
field: input.worktree,
|
|
2427
|
+
depth: childDepth
|
|
2428
|
+
});
|
|
2429
|
+
if (decision.action === "reject") {
|
|
2430
|
+
return { ok: false, code: "worktree_disabled", message: decision.message };
|
|
2431
|
+
}
|
|
2432
|
+
if (decision.action === "provision") {
|
|
2433
|
+
if (!provisionWorktree) {
|
|
2434
|
+
return {
|
|
2435
|
+
ok: false,
|
|
2436
|
+
code: "worktree_provisioner_not_enabled",
|
|
2437
|
+
message: `agent_start: \`worktree\` isolation is required (by request or the "${mode}" policy) but this daemon has no worktree provisioner wired (createGateway needs \`provisionWorktree\`, injected by the CLI over @agentproto/worktree).`
|
|
2438
|
+
};
|
|
2439
|
+
}
|
|
2440
|
+
worktreeRequest = decision.request;
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2369
2443
|
const configDefaults = loadDefaultsConfig ? await loadDefaultsConfig() : (await loadConfig()).defaults;
|
|
2370
2444
|
const roleRegistry = deps2.loadRoleRegistry ? await deps2.loadRoleRegistry() : await loadDefaultRoleRegistry();
|
|
2371
2445
|
let role;
|
|
@@ -2476,6 +2550,12 @@ async function spawnAgentSession(deps2, input) {
|
|
|
2476
2550
|
}
|
|
2477
2551
|
throw err;
|
|
2478
2552
|
}
|
|
2553
|
+
if (authSpec && authSpec.enforce === "always" && authSpec.credential === void 0 && !spawnDefaults.auth.explicit && resolvedProvider !== void 0) {
|
|
2554
|
+
const ignored = await (0, providers_store_exports.getProviderKey)(resolvedProvider);
|
|
2555
|
+
if (ignored !== void 0) {
|
|
2556
|
+
authSpec = { ...authSpec, ignoredApiKeyInStore: true };
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2479
2559
|
}
|
|
2480
2560
|
const effectiveOptions = normalizeSkillsOption(
|
|
2481
2561
|
spawnDefaults.skills,
|
|
@@ -2520,6 +2600,24 @@ ${input.prompt}` : input.prompt;
|
|
|
2520
2600
|
return result;
|
|
2521
2601
|
};
|
|
2522
2602
|
try {
|
|
2603
|
+
if (worktreeRequest && provisionWorktree) {
|
|
2604
|
+
let outcome;
|
|
2605
|
+
try {
|
|
2606
|
+
outcome = await provisionWorktree({
|
|
2607
|
+
cwd,
|
|
2608
|
+
...worktreeRequest.slug ? { slug: worktreeRequest.slug } : {},
|
|
2609
|
+
...worktreeRequest.base ? { base: worktreeRequest.base } : {},
|
|
2610
|
+
...input.label ? { labelHint: input.label } : {}
|
|
2611
|
+
});
|
|
2612
|
+
} catch (err) {
|
|
2613
|
+
return finish({
|
|
2614
|
+
ok: false,
|
|
2615
|
+
code: "worktree_provision_failed",
|
|
2616
|
+
message: `agent_start: worktree provisioning failed \u2014 ${err instanceof Error ? err.message : String(err)}`
|
|
2617
|
+
});
|
|
2618
|
+
}
|
|
2619
|
+
if (outcome.isolated) cwd = outcome.cwd;
|
|
2620
|
+
}
|
|
2523
2621
|
const resolvedMcpServers = await resolveMcpCredentialHeaders(mcpServers);
|
|
2524
2622
|
let liveSessionId;
|
|
2525
2623
|
let agentSession;
|
|
@@ -2804,7 +2902,9 @@ function registerAgentTools(server, opts) {
|
|
|
2804
2902
|
webhookNotifier,
|
|
2805
2903
|
daemonMcpUrl,
|
|
2806
2904
|
loadRoleRegistry: loadRoleRegistry2,
|
|
2807
|
-
resolveSandboxProvider: resolveSandboxProvider2
|
|
2905
|
+
resolveSandboxProvider: resolveSandboxProvider2,
|
|
2906
|
+
provisionWorktree,
|
|
2907
|
+
resolveWorktreeIsolation
|
|
2808
2908
|
} = opts;
|
|
2809
2909
|
server.tool(
|
|
2810
2910
|
"agent_start",
|
|
@@ -2919,6 +3019,22 @@ function registerAgentTools(server, opts) {
|
|
|
2919
3019
|
])
|
|
2920
3020
|
).optional().describe(
|
|
2921
3021
|
"Run this session inside a sandbox instead of on the host \u2014 pass a provider slug (see `list_sandbox_providers`) or an inline AIP-36 SandboxDefinition object. The daemon boots the sandbox, spawns `adapter` on the box's OWN agentproto daemon, and proxies the conversation back onto this session \u2014 `agent_prompt`/`agent_output`/`agent_kill` behave exactly as they do for a local spawn, and the transcript stays readable here even after the box is torn down. Omit to run locally (default). Pass an inline spec with `reuse: \"<sandboxId>\"` (from a prior session's `sandboxId`) to reconnect to an existing box instead \u2014 by default such a box is PAUSED (not killed) on session close so it stays reusable; set `lifecycle.destroy_on` to always kill it."
|
|
3022
|
+
),
|
|
3023
|
+
worktree: jsonTolerant(
|
|
3024
|
+
z.union([
|
|
3025
|
+
mcpBool,
|
|
3026
|
+
z.object({
|
|
3027
|
+
slug: z.string().regex(
|
|
3028
|
+
/^[a-z0-9][a-z0-9-]*$/,
|
|
3029
|
+
"slug must be lowercase kebab-case (letters, digits, hyphens)"
|
|
3030
|
+
).optional().describe(
|
|
3031
|
+
"Pin the worktree's slug (names its branch `wt/<slug>` and its directory). Omit to auto-mint a collision-free one from the label."
|
|
3032
|
+
),
|
|
3033
|
+
base: z.string().min(1).optional().describe("Git ref the worktree branch is cut from. Default 'origin/main'.")
|
|
3034
|
+
}).strict()
|
|
3035
|
+
])
|
|
3036
|
+
).optional().describe(
|
|
3037
|
+
"Isolate this session in its OWN git worktree instead of spawning directly in `cwd` \u2014 so a parallel agent can't collide on the working tree. `true` provisions a worktree on a fresh branch `wt/<slug>` cut from origin/main (slug auto-minted from `label`); pass `{ slug, base }` to pin either. The daemon boots the worktree (git worktree add + the repo's agentproto.json setup hooks) and spawns `adapter` THERE; the session's cwd, and every path it edits, live inside the worktree. Honoured only for a ROOT spawn (a spawn made THROUGH an orchestrator inherits its parent's tree \u2014 no second worktree) and only when `cwd` is inside a git repo (nothing to isolate otherwise \u21D2 spawns plain, no error). The daemon's `worktrees.isolation` policy may force this ON for every root spawn (`always`) or OFF (`never`, which REJECTS an explicit `worktree`). Ignored for a `sandbox` spawn (the box already isolates). The worktree is NOT auto-removed on session close \u2014 it holds the agent's work; tear it down with `agentproto worktree rm|archive|gc`."
|
|
2922
3038
|
)
|
|
2923
3039
|
},
|
|
2924
3040
|
async (input) => {
|
|
@@ -2942,7 +3058,9 @@ function registerAgentTools(server, opts) {
|
|
|
2942
3058
|
callerScope,
|
|
2943
3059
|
webhookNotifier,
|
|
2944
3060
|
loadRoleRegistry: loadRoleRegistry2,
|
|
2945
|
-
resolveSandboxProvider: resolveSandboxProvider2
|
|
3061
|
+
resolveSandboxProvider: resolveSandboxProvider2,
|
|
3062
|
+
...provisionWorktree ? { provisionWorktree } : {},
|
|
3063
|
+
...resolveWorktreeIsolation ? { resolveWorktreeIsolation } : {}
|
|
2946
3064
|
},
|
|
2947
3065
|
input
|
|
2948
3066
|
);
|
|
@@ -3836,6 +3954,12 @@ async function restartAgentSession(registry, resolveAgentAdapter, prev, opts = {
|
|
|
3836
3954
|
authSpec = result.spec;
|
|
3837
3955
|
authEcho = result.echo;
|
|
3838
3956
|
}
|
|
3957
|
+
if (authSpec && authSpec.enforce === "always" && authSpec.credential === void 0 && !spawnDefaults.auth.explicit && resolvedProvider !== void 0) {
|
|
3958
|
+
const ignored = await (0, providers_store_exports.getProviderKey)(resolvedProvider);
|
|
3959
|
+
if (ignored !== void 0) {
|
|
3960
|
+
authSpec = { ...authSpec, ignoredApiKeyInStore: true };
|
|
3961
|
+
}
|
|
3962
|
+
}
|
|
3839
3963
|
}
|
|
3840
3964
|
const spawnWithResume = async (resumeSessionId) => {
|
|
3841
3965
|
let liveSessionId;
|
|
@@ -11745,7 +11869,8 @@ async function startHttpServer(opts) {
|
|
|
11745
11869
|
opts.sessionEvents,
|
|
11746
11870
|
opts.eventRing,
|
|
11747
11871
|
opts.buildOrchestratorMcp,
|
|
11748
|
-
opts.daemonMcpUrl
|
|
11872
|
+
opts.daemonMcpUrl,
|
|
11873
|
+
opts.provisionWorktree
|
|
11749
11874
|
);
|
|
11750
11875
|
if (handled) return;
|
|
11751
11876
|
}
|
|
@@ -12203,6 +12328,22 @@ function parseOrchestratorField(raw) {
|
|
|
12203
12328
|
}
|
|
12204
12329
|
return void 0;
|
|
12205
12330
|
}
|
|
12331
|
+
function parseWorktreeField(raw) {
|
|
12332
|
+
const value = typeof raw === "string" ? tryParseJson(raw) ?? raw : raw;
|
|
12333
|
+
if (typeof value === "boolean") return value;
|
|
12334
|
+
if (value === "true") return true;
|
|
12335
|
+
if (value === "false") return false;
|
|
12336
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
12337
|
+
const obj = value;
|
|
12338
|
+
const slug = typeof obj.slug === "string" ? obj.slug : void 0;
|
|
12339
|
+
const base = typeof obj.base === "string" ? obj.base : void 0;
|
|
12340
|
+
return {
|
|
12341
|
+
...slug !== void 0 ? { slug } : {},
|
|
12342
|
+
...base !== void 0 ? { base } : {}
|
|
12343
|
+
};
|
|
12344
|
+
}
|
|
12345
|
+
return void 0;
|
|
12346
|
+
}
|
|
12206
12347
|
function parseMcpServersField(raw) {
|
|
12207
12348
|
const value = typeof raw === "string" ? tryParseJson(raw) : raw;
|
|
12208
12349
|
if (!Array.isArray(value)) return void 0;
|
|
@@ -12253,7 +12394,7 @@ async function resolveSlugFromCwd(cwd) {
|
|
|
12253
12394
|
return void 0;
|
|
12254
12395
|
}
|
|
12255
12396
|
}
|
|
12256
|
-
async function handleSessions(req, res, path, registry, resolveAgentAdapter, ptyEnabled = false, resolveBrowserAdapter, listBrowserAdapters, sessionEvents, eventRing, buildOrchestratorMcp, daemonMcpUrl) {
|
|
12397
|
+
async function handleSessions(req, res, path, registry, resolveAgentAdapter, ptyEnabled = false, resolveBrowserAdapter, listBrowserAdapters, sessionEvents, eventRing, buildOrchestratorMcp, daemonMcpUrl, provisionWorktree) {
|
|
12257
12398
|
const json = (status, body) => {
|
|
12258
12399
|
res.writeHead(status, { "content-type": "application/json" });
|
|
12259
12400
|
res.end(JSON.stringify(body));
|
|
@@ -12282,7 +12423,13 @@ async function handleSessions(req, res, path, registry, resolveAgentAdapter, pty
|
|
|
12282
12423
|
return true;
|
|
12283
12424
|
}
|
|
12284
12425
|
const result = await spawnAgentSession(
|
|
12285
|
-
{
|
|
12426
|
+
{
|
|
12427
|
+
registry,
|
|
12428
|
+
resolveAgentAdapter,
|
|
12429
|
+
buildOrchestratorMcp,
|
|
12430
|
+
daemonMcpUrl,
|
|
12431
|
+
...provisionWorktree ? { provisionWorktree } : {}
|
|
12432
|
+
},
|
|
12286
12433
|
{
|
|
12287
12434
|
adapter,
|
|
12288
12435
|
...typeof b.cwd === "string" && b.cwd.length > 0 ? { cwd: b.cwd } : {},
|
|
@@ -12326,6 +12473,14 @@ async function handleSessions(req, res, path, registry, resolveAgentAdapter, pty
|
|
|
12326
12473
|
...b.permissionHold !== void 0 ? (() => {
|
|
12327
12474
|
const h = typeof b.permissionHold === "boolean" ? b.permissionHold : b.permissionHold === "true" ? true : b.permissionHold === "false" ? false : void 0;
|
|
12328
12475
|
return h ? { permissionHold: true } : {};
|
|
12476
|
+
})() : {},
|
|
12477
|
+
// Worktree isolation — the HTTP twin of the MCP `agent_start` tool's
|
|
12478
|
+
// `worktree` field. Same `spawnAgentSession` core resolves the
|
|
12479
|
+
// `worktrees.isolation` policy, so `always` bites here too and there's
|
|
12480
|
+
// no policy-bypassing spawn path.
|
|
12481
|
+
...b.worktree !== void 0 ? (() => {
|
|
12482
|
+
const parsed = parseWorktreeField(b.worktree);
|
|
12483
|
+
return parsed !== void 0 ? { worktree: parsed } : {};
|
|
12329
12484
|
})() : {}
|
|
12330
12485
|
}
|
|
12331
12486
|
);
|
|
@@ -17876,6 +18031,29 @@ function isEnoent(err) {
|
|
|
17876
18031
|
function errMsg(err) {
|
|
17877
18032
|
return err instanceof Error ? err.message : String(err);
|
|
17878
18033
|
}
|
|
18034
|
+
async function isAgentCliAuthConfigured(slug, descriptor, model) {
|
|
18035
|
+
const config = await loadConfig();
|
|
18036
|
+
const spawnDefaults = resolveSpawnDefaults(config.defaults, slug, {});
|
|
18037
|
+
const pinnedProvider = spawnDefaults.auth.provider;
|
|
18038
|
+
const resolvedProvider = pinnedProvider ?? descriptor.provider ?? (model ? getModelProvider(model) : void 0);
|
|
18039
|
+
const apiKeyStoreCredential = resolvedProvider && spawnDefaults.auth.explicit && spawnDefaults.auth.apiKeyCredential === void 0 ? await (0, providers_store_exports.getProviderKey)(resolvedProvider) : void 0;
|
|
18040
|
+
try {
|
|
18041
|
+
const result = resolveAuthSpec({
|
|
18042
|
+
descriptor,
|
|
18043
|
+
...model ? { model } : {},
|
|
18044
|
+
...pinnedProvider ? { requestedProvider: pinnedProvider } : {},
|
|
18045
|
+
...spawnDefaults.auth.requestedMode ? { requestedMode: spawnDefaults.auth.requestedMode } : {},
|
|
18046
|
+
explicit: spawnDefaults.auth.explicit,
|
|
18047
|
+
...spawnDefaults.auth.subscriptionCredential !== void 0 ? { subscriptionCredential: spawnDefaults.auth.subscriptionCredential } : {},
|
|
18048
|
+
...spawnDefaults.auth.apiKeyCredential !== void 0 ? { apiKeyConfigCredential: spawnDefaults.auth.apiKeyCredential } : {},
|
|
18049
|
+
...apiKeyStoreCredential !== void 0 ? { apiKeyStoreCredential } : {}
|
|
18050
|
+
});
|
|
18051
|
+
return result?.spec.credential !== void 0;
|
|
18052
|
+
} catch (err) {
|
|
18053
|
+
if (err instanceof AuthResolutionError) return false;
|
|
18054
|
+
throw err;
|
|
18055
|
+
}
|
|
18056
|
+
}
|
|
17879
18057
|
|
|
17880
18058
|
// src/index.ts
|
|
17881
18059
|
var DEFAULT_ALWAYS_ON_TOOLS = [
|
|
@@ -18086,6 +18264,7 @@ async function createGateway(opts) {
|
|
|
18086
18264
|
webhookNotifier,
|
|
18087
18265
|
daemonMcpUrl,
|
|
18088
18266
|
resolveSandboxProvider: resolveSandboxProviderResolved,
|
|
18267
|
+
...opts.provisionWorktree ? { provisionWorktree: opts.provisionWorktree } : {},
|
|
18089
18268
|
...opts.resolveAgentAdapter ? { resolveAgentAdapter: opts.resolveAgentAdapter } : {},
|
|
18090
18269
|
...opts.listAgentAdapters ? { listAgentAdapters: opts.listAgentAdapters } : {}
|
|
18091
18270
|
});
|
|
@@ -18241,6 +18420,7 @@ async function createGateway(opts) {
|
|
|
18241
18420
|
// `agent_start` tool gets (session-spawn.ts is the shared logic).
|
|
18242
18421
|
buildOrchestratorMcp: orchestratorInjector,
|
|
18243
18422
|
daemonMcpUrl,
|
|
18423
|
+
...opts.provisionWorktree ? { provisionWorktree: opts.provisionWorktree } : {},
|
|
18244
18424
|
...opts.listAgentAdapters ? { listAgentAdapters: opts.listAgentAdapters } : {},
|
|
18245
18425
|
...opts.resolveBrowserAdapter ? { resolveBrowserAdapter: opts.resolveBrowserAdapter } : {},
|
|
18246
18426
|
...opts.listBrowserAdapters ? { listBrowserAdapters: opts.listBrowserAdapters } : {},
|
|
@@ -18328,6 +18508,6 @@ var export_providersPath = providers_store_exports.providersPath;
|
|
|
18328
18508
|
var export_removeProviderKey = providers_store_exports.removeProviderKey;
|
|
18329
18509
|
var export_setProviderKey = providers_store_exports.setProviderKey;
|
|
18330
18510
|
|
|
18331
|
-
export { AuthResolutionError, BUCKETS_ROOT, DEFAULT_BUCKET, DEFAULT_ORCHESTRATOR_TOOLS, LEGACY_SESSIONS_FILE, PAIRINGS_VERSION, export_PROVIDER_ENV_VARS as PROVIDER_ENV_VARS, bucketDir, bucketSessionsFile, bucketTranscriptDir, composeSessionObservers, createFileStepCache, createGateway, createOrchestratorInjector, createOrchestratorMcpServerFactory, createPairingRegistry, createScopeTokenRegistry, createWorkspaceFs, credentialFingerprint, daemonRegistryDir, declaredPresetToProviderPreset, deriveSessionUsage, fileConversationStore, formatToolCall, formatToolResult, getMcpCredentialDeps, export_getProviderKey as getProviderKey, export_injectProviderKeysIntoEnv as injectProviderKeysIntoEnv, isSafeBucketSlug, listBuckets, listPresets, export_loadProviders as loadProviders, makeBrowserAdapterLister, migrateLegacySessionsFile, migrationMarkerPath, monitorPolicyWait, monitorSessionWait, narrowOrchestratorTools, normalizeSkillsOption, parseDuration, policyWatchesSession, projectSessionUsage, export_providerEnvVar as providerEnvVar, export_providersPath as providersPath, readDaemonRegistry, readRegisteredSlugs, readRuntimeMeta, registerPairingTools, export_removeProviderKey as removeProviderKey, resolveAuthSpec, resolveBucketSlug, resolveSpawnDefaults, setMcpCredentialDeps, export_setProviderKey as setProviderKey, sweepStaleDaemonRegistry, sweepStaleRuntimeMetas, unlinkDaemonRegistryEntry, unlinkRuntimeMeta, writeDaemonRegistryEntry };
|
|
18511
|
+
export { AuthResolutionError, BUCKETS_ROOT, DEFAULT_BUCKET, DEFAULT_ORCHESTRATOR_TOOLS, DEFAULT_WORKTREE_ISOLATION, LEGACY_SESSIONS_FILE, PAIRINGS_VERSION, export_PROVIDER_ENV_VARS as PROVIDER_ENV_VARS, WORKTREE_ISOLATION_ENV, bucketDir, bucketSessionsFile, bucketTranscriptDir, composeSessionObservers, createFileStepCache, createGateway, createOrchestratorInjector, createOrchestratorMcpServerFactory, createPairingRegistry, createScopeTokenRegistry, createWorkspaceFs, credentialFingerprint, daemonRegistryDir, decideWorktreeIsolation, declaredPresetToProviderPreset, deriveSessionUsage, fileConversationStore, formatToolCall, formatToolResult, getMcpCredentialDeps, export_getProviderKey as getProviderKey, export_injectProviderKeysIntoEnv as injectProviderKeysIntoEnv, isAgentCliAuthConfigured, isSafeBucketSlug, listBuckets, listPresets, export_loadProviders as loadProviders, loadWorktreeIsolation, makeBrowserAdapterLister, migrateLegacySessionsFile, migrationMarkerPath, monitorPolicyWait, monitorSessionWait, narrowOrchestratorTools, normalizeSkillsOption, normalizeWorktreeField, parseDuration, parseWorktreeIsolationMode, policyWatchesSession, projectSessionUsage, export_providerEnvVar as providerEnvVar, export_providersPath as providersPath, readDaemonRegistry, readRegisteredSlugs, readRuntimeMeta, registerPairingTools, export_removeProviderKey as removeProviderKey, resolveAuthSpec, resolveBucketSlug, resolveSpawnDefaults, setMcpCredentialDeps, export_setProviderKey as setProviderKey, sweepStaleDaemonRegistry, sweepStaleRuntimeMetas, unlinkDaemonRegistryEntry, unlinkRuntimeMeta, writeDaemonRegistryEntry };
|
|
18332
18512
|
//# sourceMappingURL=index.mjs.map
|
|
18333
18513
|
//# sourceMappingURL=index.mjs.map
|