@sentropic/h2a-runtime 0.97.1 → 0.97.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/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +78 -19
- package/dist/index.js.map +1 -1
- package/dist/launch-layout.d.ts.map +1 -1
- package/dist/launch-layout.js +2 -1
- package/dist/launch-layout.js.map +1 -1
- package/dist/native-restart.d.ts +2 -0
- package/dist/native-restart.d.ts.map +1 -1
- package/dist/native-restart.js.map +1 -1
- package/dist/protocol-local.d.ts +3 -5
- package/dist/protocol-local.d.ts.map +1 -1
- package/dist/protocol-local.js +2 -4
- package/dist/protocol-local.js.map +1 -1
- package/dist/registry.d.ts +11 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +4 -0
- package/dist/registry.js.map +1 -1
- package/dist/restore.d.ts +2 -0
- package/dist/restore.d.ts.map +1 -1
- package/dist/restore.js +4 -0
- package/dist/restore.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,33 @@ export declare function auditLiveSessionLeases(sessions?: ReadonlyArray<Registry
|
|
|
147
147
|
* (control-plane) are phase 2 — see the TODOs at the call site.
|
|
148
148
|
*/
|
|
149
149
|
export declare function resumeThrottledJob(job: RegistryEntry): StartJobResult;
|
|
150
|
+
/**
|
|
151
|
+
* Whether a Claude launch under the llm-mesh gateway should carry `--bare`.
|
|
152
|
+
*
|
|
153
|
+
* `--bare` skips Claude Code onboarding but ALSO strips Claude's native tool
|
|
154
|
+
* surface (hooks / skills / CLAUDE.md / LSP and, over the gateway, tools such as
|
|
155
|
+
* SendMessage / CronCreate / Monitor / AskUserQuestion). It is only meaningful
|
|
156
|
+
* for a Claude profile actually running under the gateway (the env probe below).
|
|
157
|
+
*
|
|
158
|
+
* RETURN-CONDITION (2026-09-18, owner): when the caller expresses no explicit
|
|
159
|
+
* choice, DO NOT force `--bare` — keep the native tools. This default was
|
|
160
|
+
* historically `true`. Flip DEFAULT_CLAUDE_BARE_UNDER_GATEWAY back to `true` (or
|
|
161
|
+
* drop the option entirely) ONLY once the h2a equivalents for the objective
|
|
162
|
+
* loop, SendMessage and AskUserQuestion are implemented AND demonstrated working
|
|
163
|
+
* under the gateway. Until then `--bare` stays an explicit opt-in.
|
|
164
|
+
*/
|
|
165
|
+
export declare const DEFAULT_CLAUDE_BARE_UNDER_GATEWAY = false;
|
|
166
|
+
export declare function resolveClaudeBare(profile: string, explicit?: boolean, gatewayActive?: boolean): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Explicit `--bare` / `--no-bare` choice from the run options, mirroring
|
|
169
|
+
* `gatewayModeFromOptions`. Defensive against commander's `--no-bare` negation
|
|
170
|
+
* (which sets `bare=false`) AND a separately-declared `noBare` flag. Returns
|
|
171
|
+
* `undefined` when the operator expressed no choice (so the default applies).
|
|
172
|
+
*/
|
|
173
|
+
export declare function bareChoiceFromOptions(opts: {
|
|
174
|
+
bare?: boolean;
|
|
175
|
+
noBare?: boolean;
|
|
176
|
+
}): boolean | undefined;
|
|
150
177
|
export declare function prepareStructuredGateway(mode: "auto" | "gateway" | "direct", inject?: (mode: "auto" | "gateway" | "direct") => Promise<string | undefined>): Promise<string | undefined>;
|
|
151
178
|
export interface RestoreLlmMeshPreparationContext {
|
|
152
179
|
readonly runtimeEnabled: boolean;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAuEA,OAAO,EAsDL,KAAK,YAAY,EAClB,MAAM,WAAW,CAAC;AAiCnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAS7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQ9C,OAAO,EAOL,KAAK,qBAAqB,EAE3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAqBL,KA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AAO,EAAE,IAAI,IAAI,QAAQ,EAAE,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAE5E;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACV,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1F,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,8EAA8E;AAC9E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG/D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,MAAM,CAEnE"}
|
package/dist/index.js
CHANGED
|
@@ -1343,9 +1343,46 @@ function gatewayModeFromOptions(opts) {
|
|
|
1343
1343
|
return "direct";
|
|
1344
1344
|
return "auto";
|
|
1345
1345
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1346
|
+
/**
|
|
1347
|
+
* Whether a Claude launch under the llm-mesh gateway should carry `--bare`.
|
|
1348
|
+
*
|
|
1349
|
+
* `--bare` skips Claude Code onboarding but ALSO strips Claude's native tool
|
|
1350
|
+
* surface (hooks / skills / CLAUDE.md / LSP and, over the gateway, tools such as
|
|
1351
|
+
* SendMessage / CronCreate / Monitor / AskUserQuestion). It is only meaningful
|
|
1352
|
+
* for a Claude profile actually running under the gateway (the env probe below).
|
|
1353
|
+
*
|
|
1354
|
+
* RETURN-CONDITION (2026-09-18, owner): when the caller expresses no explicit
|
|
1355
|
+
* choice, DO NOT force `--bare` — keep the native tools. This default was
|
|
1356
|
+
* historically `true`. Flip DEFAULT_CLAUDE_BARE_UNDER_GATEWAY back to `true` (or
|
|
1357
|
+
* drop the option entirely) ONLY once the h2a equivalents for the objective
|
|
1358
|
+
* loop, SendMessage and AskUserQuestion are implemented AND demonstrated working
|
|
1359
|
+
* under the gateway. Until then `--bare` stays an explicit opt-in.
|
|
1360
|
+
*/
|
|
1361
|
+
export const DEFAULT_CLAUDE_BARE_UNDER_GATEWAY = false;
|
|
1362
|
+
export function resolveClaudeBare(profile, explicit, gatewayActive = Boolean(process.env.ANTHROPIC_BASE_URL && process.env.ANTHROPIC_AUTH_TOKEN)) {
|
|
1363
|
+
if (!profileUsesLlmMeshGateway(profile) ||
|
|
1364
|
+
!gatewayActive) {
|
|
1365
|
+
return false;
|
|
1366
|
+
}
|
|
1367
|
+
return explicit ?? DEFAULT_CLAUDE_BARE_UNDER_GATEWAY;
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Explicit `--bare` / `--no-bare` choice from the run options, mirroring
|
|
1371
|
+
* `gatewayModeFromOptions`. Defensive against commander's `--no-bare` negation
|
|
1372
|
+
* (which sets `bare=false`) AND a separately-declared `noBare` flag. Returns
|
|
1373
|
+
* `undefined` when the operator expressed no choice (so the default applies).
|
|
1374
|
+
*/
|
|
1375
|
+
export function bareChoiceFromOptions(opts) {
|
|
1376
|
+
const wantsBare = opts.bare === true;
|
|
1377
|
+
const wantsNoBare = opts.bare === false || opts.noBare === true;
|
|
1378
|
+
if (wantsBare && wantsNoBare) {
|
|
1379
|
+
throw new Error("pass either --bare or --no-bare, not both");
|
|
1380
|
+
}
|
|
1381
|
+
if (wantsBare)
|
|
1382
|
+
return true;
|
|
1383
|
+
if (wantsNoBare)
|
|
1384
|
+
return false;
|
|
1385
|
+
return undefined;
|
|
1349
1386
|
}
|
|
1350
1387
|
async function injectLlmMeshGatewayEnv(mode = "auto", allowDirectFallback = true, clientSessionId) {
|
|
1351
1388
|
if (mode === "direct") {
|
|
@@ -1427,7 +1464,7 @@ async function prepareNativeRestart(session, mode) {
|
|
|
1427
1464
|
try {
|
|
1428
1465
|
const effectiveMode = gatewayModeForProfile(session.profile, mode);
|
|
1429
1466
|
await injectLlmMeshGatewayEnv(effectiveMode, effectiveMode !== "gateway", session.name);
|
|
1430
|
-
const useBare =
|
|
1467
|
+
const useBare = resolveClaudeBare(session.profile, session.bare);
|
|
1431
1468
|
return {
|
|
1432
1469
|
command: localCliCommand(session.profile),
|
|
1433
1470
|
args: session.convId
|
|
@@ -3467,6 +3504,8 @@ export async function main(argv) {
|
|
|
3467
3504
|
.option("--gw", "alias for --llm-gateway")
|
|
3468
3505
|
.option("--no-llm-gateway", "launch without llm-mesh gateway env")
|
|
3469
3506
|
.option("--no-gw", "alias for --no-llm-gateway")
|
|
3507
|
+
.option("--bare", "opt into Claude Code bare mode under --gw (skips onboarding but strips native tools/hooks/skills); default keeps native tools")
|
|
3508
|
+
.option("--no-bare", "keep Claude's native tools under --gw (default; overrides a pinned --bare on resume/restore)")
|
|
3470
3509
|
.action(async (slug, opts) => {
|
|
3471
3510
|
// NOTE: tmux availability is checked AFTER host resolution below — a
|
|
3472
3511
|
// `--tmux` flag must not block acting on an existing session whose
|
|
@@ -3559,6 +3598,8 @@ export async function main(argv) {
|
|
|
3559
3598
|
enrolledAt: new Date().toISOString(),
|
|
3560
3599
|
lastSeenAt: new Date().toISOString(),
|
|
3561
3600
|
source: "run",
|
|
3601
|
+
bare: registryEntry?.convId === resolvedConvId ? registryEntry?.bare : undefined,
|
|
3602
|
+
gatewayMode: registryEntry?.convId === resolvedConvId ? registryEntry?.gatewayMode : undefined,
|
|
3562
3603
|
}
|
|
3563
3604
|
: registryEntry;
|
|
3564
3605
|
// WHICH host serves this resume — resolved BEFORE ANY act (F1): every
|
|
@@ -3656,16 +3697,11 @@ export async function main(argv) {
|
|
|
3656
3697
|
process.exitCode = 2;
|
|
3657
3698
|
return;
|
|
3658
3699
|
}
|
|
3659
|
-
const effectiveGatewayMode = gatewayModeForProfile(profile, gatewayMode);
|
|
3700
|
+
const effectiveGatewayMode = gatewayModeForProfile(profile, gatewayMode === "auto" ? entry.gatewayMode ?? "auto" : gatewayMode);
|
|
3660
3701
|
let gateway;
|
|
3661
|
-
//
|
|
3662
|
-
//
|
|
3663
|
-
|
|
3664
|
-
// default even under a parent that itself runs under the gateway — must
|
|
3665
|
-
// NEVER carry --bare, or the child would skip onboarding while its
|
|
3666
|
-
// Anthropic env is scrubbed. The mode gate is evaluated pre-injection,
|
|
3667
|
-
// alongside the parent-env probe in shouldUseClaudeBare.
|
|
3668
|
-
const useBare = effectiveGatewayMode !== "direct" && shouldUseClaudeBare(profile);
|
|
3702
|
+
// Resolve against the selected mode, not the parent's environment:
|
|
3703
|
+
// required gateway injection below must succeed before either launch.
|
|
3704
|
+
const useBare = resolveClaudeBare(profile, bareChoiceFromOptions(opts) ?? entry.bare, effectiveGatewayMode === "gateway");
|
|
3669
3705
|
const command = localCliCommand(profile);
|
|
3670
3706
|
const args = localResumeArgs(profile, entry.convId, {
|
|
3671
3707
|
bare: useBare,
|
|
@@ -3874,7 +3910,8 @@ export async function main(argv) {
|
|
|
3874
3910
|
cwd: entry.cwd,
|
|
3875
3911
|
sessionClass,
|
|
3876
3912
|
...(entry.convId ? { convId: entry.convId } : {}),
|
|
3877
|
-
|
|
3913
|
+
gatewayMode: effectiveGatewayMode,
|
|
3914
|
+
bare: useBare,
|
|
3878
3915
|
});
|
|
3879
3916
|
process.stderr.write(`[h2a] resumed local session ${resumeSlug} (${profile} resume${entry.convId ? ` ${entry.convId}` : ""} in ${entry.cwd})\n`);
|
|
3880
3917
|
if (gateway) {
|
|
@@ -3912,6 +3949,8 @@ export async function main(argv) {
|
|
|
3912
3949
|
.option("--gw", "alias for --llm-gateway")
|
|
3913
3950
|
.option("--no-llm-gateway", "launch without llm-mesh gateway env")
|
|
3914
3951
|
.option("--no-gw", "alias for --no-llm-gateway")
|
|
3952
|
+
.option("--bare", "opt into Claude Code bare mode under --gw (skips onboarding but strips native tools/hooks/skills); default keeps native tools")
|
|
3953
|
+
.option("--no-bare", "keep Claude's native tools under --gw (default; overrides a pinned --bare on resume/restore)")
|
|
3915
3954
|
.action(async (profile, path, opts) => {
|
|
3916
3955
|
const structuredLaunch = opts.promptStdin === true ||
|
|
3917
3956
|
opts.agent !== undefined ||
|
|
@@ -4162,7 +4201,17 @@ export async function main(argv) {
|
|
|
4162
4201
|
}
|
|
4163
4202
|
// By default launches are direct. --llm-gateway/--gw opts into the
|
|
4164
4203
|
// local gateway for any profile that consumes Anthropic-compatible env.
|
|
4165
|
-
const
|
|
4204
|
+
const resumeRegistry = opts.resume ? loadRegistry() : undefined;
|
|
4205
|
+
if (resumeRegistry?.state === "unknown") {
|
|
4206
|
+
throw new Error("cannot recover pinned launch options: registry unreadable");
|
|
4207
|
+
}
|
|
4208
|
+
const resumeEntries = resumeRegistry?.entries.filter((entry) => isManagedLocalKind(entry.kind) && entry.convId === opts.resume &&
|
|
4209
|
+
entry.cwd === cwd && entry.tool === profile) ?? [];
|
|
4210
|
+
if (resumeEntries.some((entry) => entry.bare !== resumeEntries[0]?.bare || entry.gatewayMode !== resumeEntries[0]?.gatewayMode)) {
|
|
4211
|
+
throw new Error("cannot recover pinned launch options: conflicting registry rows");
|
|
4212
|
+
}
|
|
4213
|
+
const pinnedLaunch = resumeEntries[0];
|
|
4214
|
+
const launchGatewayMode = gatewayModeForProfile(profile, gatewayMode === "auto" ? pinnedLaunch?.gatewayMode ?? "auto" : gatewayMode);
|
|
4166
4215
|
const command = localCliCommand(profile);
|
|
4167
4216
|
// A detached/background or run-once launch is a worker, even when its
|
|
4168
4217
|
// agent later emits a Claude SessionStart hook. Stamp this through tmux
|
|
@@ -4205,7 +4254,7 @@ export async function main(argv) {
|
|
|
4205
4254
|
process.exitCode = 1;
|
|
4206
4255
|
return;
|
|
4207
4256
|
}
|
|
4208
|
-
const useBare =
|
|
4257
|
+
const useBare = resolveClaudeBare(profile, bareChoiceFromOptions(opts) ?? pinnedLaunch?.bare);
|
|
4209
4258
|
let args;
|
|
4210
4259
|
try {
|
|
4211
4260
|
args =
|
|
@@ -4443,7 +4492,8 @@ export async function main(argv) {
|
|
|
4443
4492
|
cwd,
|
|
4444
4493
|
sessionClass,
|
|
4445
4494
|
...(opts.resume !== undefined ? { convId: opts.resume } : {}),
|
|
4446
|
-
|
|
4495
|
+
gatewayMode: launchGatewayMode,
|
|
4496
|
+
bare: useBare,
|
|
4447
4497
|
});
|
|
4448
4498
|
started.push({
|
|
4449
4499
|
name,
|
|
@@ -5954,6 +6004,7 @@ export async function main(argv) {
|
|
|
5954
6004
|
...(entry.gatewayMode !== undefined
|
|
5955
6005
|
? { gatewayMode: entry.gatewayMode }
|
|
5956
6006
|
: {}),
|
|
6007
|
+
...(entry.bare !== undefined ? { bare: entry.bare } : {}),
|
|
5957
6008
|
}));
|
|
5958
6009
|
const result = await executeNativeRestart({
|
|
5959
6010
|
...(session !== undefined ? { target: session } : {}),
|
|
@@ -6007,6 +6058,7 @@ export async function main(argv) {
|
|
|
6007
6058
|
? { convId: candidate.convId }
|
|
6008
6059
|
: {}),
|
|
6009
6060
|
...(mode !== "auto" ? { gatewayMode: mode } : {}),
|
|
6061
|
+
...(candidate.bare !== undefined ? { bare: candidate.bare } : {}),
|
|
6010
6062
|
});
|
|
6011
6063
|
}
|
|
6012
6064
|
finally {
|
|
@@ -6118,6 +6170,8 @@ export async function main(argv) {
|
|
|
6118
6170
|
process.exitCode = 1;
|
|
6119
6171
|
return;
|
|
6120
6172
|
}
|
|
6173
|
+
const relaunchMode = gatewayModeForProfile(nativeEntry.tool, nativeEntry.gatewayMode ?? "auto");
|
|
6174
|
+
await injectLlmMeshGatewayEnv(relaunchMode, relaunchMode !== "gateway", actName);
|
|
6121
6175
|
if (!killNativeSessionTree(actName)) {
|
|
6122
6176
|
process.stderr.write(`[h2a] native session ${slug} could not be killed; nothing was relaunched.\n`);
|
|
6123
6177
|
process.exitCode = 1;
|
|
@@ -6125,7 +6179,7 @@ export async function main(argv) {
|
|
|
6125
6179
|
}
|
|
6126
6180
|
const profile = nativeEntry.tool;
|
|
6127
6181
|
const command = localCliCommand(profile);
|
|
6128
|
-
const useBare =
|
|
6182
|
+
const useBare = resolveClaudeBare(profile, nativeEntry.bare);
|
|
6129
6183
|
const args = nativeEntry.convId
|
|
6130
6184
|
? localResumeArgs(profile, nativeEntry.convId, { bare: useBare })
|
|
6131
6185
|
: localStartArgs(profile, { bare: useBare });
|
|
@@ -6143,6 +6197,8 @@ export async function main(argv) {
|
|
|
6143
6197
|
...(relaunched.pid !== undefined ? { pid: relaunched.pid } : {}),
|
|
6144
6198
|
cwd: nativeEntry.cwd,
|
|
6145
6199
|
sessionClass: nativeEntry.sessionClass ?? "human",
|
|
6200
|
+
gatewayMode: relaunchMode,
|
|
6201
|
+
bare: useBare,
|
|
6146
6202
|
...(nativeEntry.convId ? { convId: nativeEntry.convId } : {}),
|
|
6147
6203
|
});
|
|
6148
6204
|
process.stderr.write(`[h2a] native session ${slug} relaunched ` +
|
|
@@ -6383,7 +6439,9 @@ export async function main(argv) {
|
|
|
6383
6439
|
try {
|
|
6384
6440
|
const gatewayMode = gatewayModeForProfile(action.profile, entry.gatewayMode ?? "auto");
|
|
6385
6441
|
await injectLlmMeshGatewayEnv(gatewayMode, true, localSessionName(action.slug));
|
|
6386
|
-
const { name, agentPane } = startLocalSession(action.profile, action.command, entry.cwd, action.
|
|
6442
|
+
const { name, agentPane } = startLocalSession(action.profile, action.command, entry.cwd, localResumeArgs(action.profile, action.convId, {
|
|
6443
|
+
bare: resolveClaudeBare(action.profile, entry.bare),
|
|
6444
|
+
}), action.slug, undefined, {
|
|
6387
6445
|
sessionClass,
|
|
6388
6446
|
resumeId: action.convId,
|
|
6389
6447
|
attachedTerminal: true,
|
|
@@ -6401,6 +6459,7 @@ export async function main(argv) {
|
|
|
6401
6459
|
...(entry.gatewayMode !== undefined
|
|
6402
6460
|
? { gatewayMode: entry.gatewayMode }
|
|
6403
6461
|
: {}),
|
|
6462
|
+
...(entry.bare !== undefined ? { bare: entry.bare } : {}),
|
|
6404
6463
|
});
|
|
6405
6464
|
const wake = wakeRelaunchedSession(relaunchContinuationPrompt(entry.task), {
|
|
6406
6465
|
deliverContinuation: (prompt) => deliverInitialPrompt(agentPane, prompt, {
|