@humwick/runner 0.130.5 → 0.130.6
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/agent-bin/humwick +2 -2
- package/agent-bin/humwick-browser +4 -0
- package/hooks/fff-search-redirect/fff-search-redirect.cjs +1 -1
- package/hooks/web-tools-redirect/web-tools-redirect.cjs +2 -2
- package/package.json +7 -10
- package/plugins/browser/skills/playwright-cli/SKILL.md +8 -6
- package/plugins/claude/.claude-plugin/plugin.json +3 -3
- package/plugins/claude/claude-statusline-probe.cjs +26 -16
- package/plugins/claude/hooks/gate-run-guard.provisioned.mjs +47 -17
- package/plugins/claude/hooks/gate-run-guard.sh +3 -3
- package/plugins/claude/hooks/gate-run-guard.ts +5 -5
- package/plugins/claude/hooks/kill-guard.sh +4 -4
- package/plugins/claude/hooks/kill-guard.ts +1 -1
- package/plugins/claude/hooks/permission-request.sh +1 -1
- package/plugins/claude/hooks/post-compact.sh +1 -1
- package/plugins/claude/hooks/post-tool-use.sh +3 -3
- package/plugins/claude/hooks/pre-compact.sh +2 -2
- package/plugins/claude/hooks/read-only-bash-guard.sh +4 -4
- package/plugins/claude/hooks/relay-status.sh +32 -32
- package/plugins/claude/hooks/session-end.sh +2 -2
- package/plugins/claude/hooks/session-start.sh +3 -3
- package/plugins/claude/hooks/shell-trust.ts +1 -1
- package/plugins/claude/hooks/stop-failure.sh +2 -2
- package/plugins/claude/hooks/stop.sh +6 -6
- package/plugins/claude/hooks/subagent-skill-policy.cjs +8 -6
- package/plugins/claude/hooks/subagent-stop.sh +3 -3
- package/plugins/claude/hooks/user-prompt-submit.sh +1 -1
- package/plugins/claude/hooks/wait-loop-guard.ts +3 -3
- package/plugins/claude/monitors/monitors.json +2 -2
- package/plugins/claude/monitors/relay-monitor.provisioned.mjs +96 -62
- package/plugins/claude/monitors/relay-monitor.ts +5 -5
- package/plugins/claude/skills/label/SKILL.md +3 -3
- package/plugins/claude/skills/message/SKILL.md +5 -5
- package/plugins/claude/skills/react/SKILL.md +1 -1
- package/plugins/claude/skills/read-message/SKILL.md +4 -4
- package/plugins/claude/skills/reply/SKILL.md +5 -5
- package/plugins/claude/skills/send-claimable/SKILL.md +5 -5
- package/plugins/claude/skills/slice-first/SKILL.md +5 -3
- package/plugins/claude/skills/slice-first/references/plan-recipe.md +30 -29
- package/plugins/claude/skills/status/SKILL.md +1 -1
- package/plugins/claude/skills/tags/SKILL.md +5 -5
- package/plugins/claude/skills/task/SKILL.md +10 -10
- package/plugins/claude-output-style/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-output-style/output-styles/{agent-relay.md → humwick.md} +1 -1
- package/plugins/codex/skills/guide/SKILL.md +1 -1
- package/plugins/codex/skills/label/SKILL.md +3 -3
- package/plugins/codex/skills/message/SKILL.md +5 -5
- package/plugins/codex/skills/react/SKILL.md +1 -1
- package/plugins/codex/skills/read-message/SKILL.md +4 -4
- package/plugins/codex/skills/reply/SKILL.md +5 -5
- package/plugins/codex/skills/send-claimable/SKILL.md +5 -5
- package/plugins/codex/skills/slice-first/SKILL.md +5 -3
- package/plugins/codex/skills/slice-first/references/plan-recipe.md +30 -29
- package/plugins/codex/skills/status/SKILL.md +1 -1
- package/plugins/codex/skills/tags/SKILL.md +5 -5
- package/plugins/codex/skills/task/SKILL.md +11 -10
- package/src/adapter.ts +95 -92
- package/src/adapters/claude-api.ts +8 -11
- package/src/adapters/claude-context-command.ts +1 -1
- package/src/adapters/claude-credentials.ts +7 -3
- package/src/adapters/claude-delivery-lanes.ts +2 -2
- package/src/adapters/claude-delivery.ts +16 -16
- package/src/adapters/claude-effort.ts +2 -2
- package/src/adapters/claude-exit.ts +2 -2
- package/src/adapters/claude-headless-mirror.ts +18 -2
- package/src/adapters/claude-headless-refusal.ts +3 -3
- package/src/adapters/claude-headless.ts +11 -10
- package/src/adapters/claude-launch-exit.ts +1 -1
- package/src/adapters/claude-monitor-delivery-plan.ts +36 -16
- package/src/adapters/claude-permission.ts +5 -5
- package/src/adapters/claude-prompt-gates.ts +9 -9
- package/src/adapters/claude-prompt-hook.ts +2 -2
- package/src/adapters/claude-session-capture.ts +6 -6
- package/src/adapters/claude-session-probe.ts +25 -25
- package/src/adapters/claude-shutdown.ts +11 -11
- package/src/adapters/claude-status-detectors.ts +31 -31
- package/src/adapters/claude-subagents.ts +7 -7
- package/src/adapters/claude-submit-confirmation.ts +6 -6
- package/src/adapters/claude-tmux.ts +43 -43
- package/src/adapters/claude-token-usage-capture.ts +5 -5
- package/src/adapters/claude-tool-policy.ts +7 -7
- package/src/adapters/claude-transcript.ts +24 -24
- package/src/adapters/claude.ts +100 -100
- package/src/adapters/codex-agent-message-capture.ts +26 -63
- package/src/adapters/codex-app-server.ts +1 -1
- package/src/adapters/codex-client.ts +9 -9
- package/src/adapters/codex-effective-config.ts +1 -1
- package/src/adapters/codex-launch-config.ts +5 -5
- package/src/adapters/codex-rollout-context.ts +2 -2
- package/src/adapters/codex-skill-discovery.ts +1 -1
- package/src/adapters/codex-token-usage-capture.ts +16 -16
- package/src/adapters/codex-tool-output.ts +4 -4
- package/src/adapters/codex-version.ts +3 -3
- package/src/adapters/codex.ts +64 -64
- package/src/adapters/opencode-api.ts +1 -1
- package/src/adapters/opencode-context.ts +20 -22
- package/src/adapters/opencode-model-registry.ts +7 -7
- package/src/adapters/opencode-provider.ts +8 -8
- package/src/adapters/opencode-provisioning.ts +30 -0
- package/src/adapters/opencode-server-retry.ts +1 -1
- package/src/adapters/opencode-soft-steer.ts +5 -5
- package/src/adapters/opencode-spawn.ts +18 -14
- package/src/adapters/opencode-token-usage-capture.ts +12 -12
- package/src/adapters/opencode-tool-events.ts +15 -15
- package/src/adapters/opencode.ts +232 -232
- package/src/adapters/project-shell.ts +11 -11
- package/src/adapters/service-access.ts +6 -6
- package/src/adapters/tmux-offload.ts +9 -9
- package/src/adapters/tool-summary.ts +5 -5
- package/src/agent-redact.ts +1 -1
- package/src/agent-runner/commands/dispatch.ts +10 -10
- package/src/agent-runner/commands/lifecycle.ts +2 -2
- package/src/agent-runner/commands/prompt.ts +19 -19
- package/src/agent-runner/credentials.ts +5 -5
- package/src/agent-runner/inbox.ts +1 -1
- package/src/agent-runner/lifecycle-milestones.ts +3 -3
- package/src/agent-runner/lifecycle-phase.ts +2 -2
- package/src/agent-runner/liveness-exchange.ts +4 -10
- package/src/agent-runner/registration.ts +8 -8
- package/src/agent-runner/runner-context.ts +9 -14
- package/src/agent-runner/session-mirror.ts +12 -12
- package/src/agent-runner/task-claims.ts +2 -2
- package/src/agent-runner/token-usage-coverage.ts +1 -1
- package/src/agent-runner/turn-report.ts +12 -12
- package/src/api-budget-accounting.ts +3 -3
- package/src/area-memory.ts +6 -6
- package/src/artifact-path-materialize.ts +1 -1
- package/src/async-guard.ts +5 -5
- package/src/attachment-cache.ts +17 -22
- package/src/background-script-reconcile.ts +6 -6
- package/src/bounded-log.ts +1 -1
- package/src/busy-reconciler.ts +22 -22
- package/src/claim-tracker.ts +3 -3
- package/src/claude-settings.ts +8 -8
- package/src/claude-system-prompt.ts +1 -1
- package/src/claude-workspace-trust.ts +1 -1
- package/src/config.ts +62 -61
- package/src/context-boundary.ts +5 -5
- package/src/context-command.ts +3 -3
- package/src/control-server.ts +32 -32
- package/src/delivery-result.ts +2 -2
- package/src/effort-command.ts +2 -2
- package/src/empty-turn.ts +22 -14
- package/src/free-port.ts +1 -1
- package/src/gate-run-config.ts +3 -3
- package/src/host-asset-plan.ts +24 -17
- package/src/host-claude-config-worker.ts +2 -2
- package/src/host-sources.ts +2 -2
- package/src/index.ts +16 -16
- package/src/launch-assembly.ts +94 -96
- package/src/liveness.ts +15 -15
- package/src/logger.ts +3 -3
- package/src/mcp-outbox.ts +3 -3
- package/src/mcp-preflight.ts +2 -2
- package/src/mcp-source-selection.ts +2 -2
- package/src/mcp-tool-deferral.ts +1 -1
- package/src/mcp-vault-env.ts +2 -2
- package/src/message-body-config/config.ts +4 -4
- package/src/mid-turn-delivery.ts +2 -2
- package/src/native-memory-lever.ts +8 -8
- package/src/outbox.ts +15 -15
- package/src/pending-permission-store.ts +1 -1
- package/src/profile-home.ts +19 -19
- package/src/profile-projection.ts +26 -24
- package/src/project-instructions.ts +5 -5
- package/src/provider-auth-warning.ts +17 -0
- package/src/provider-double.ts +1 -1
- package/src/provider-hold.ts +3 -3
- package/src/provider-home-marker.ts +1 -1
- package/src/provider-home-tombstone.ts +1 -1
- package/src/provider-input-queue.ts +2 -2
- package/src/provider-integration.ts +15 -13
- package/src/provider-setup.ts +15 -3
- package/src/providers.ts +1 -1
- package/src/provisioning.ts +37 -40
- package/src/question-decision.ts +2 -2
- package/src/quota.ts +0 -6
- package/src/rate-limit.ts +24 -13
- package/src/refused-prompt-store.ts +2 -2
- package/src/relay-injection-events.ts +2 -2
- package/src/relay-instructions.ts +5 -5
- package/src/relay-mcp-proxy.long-turn-e2e.ts +13 -13
- package/src/relay-mcp-proxy.ts +57 -58
- package/src/relay-mcp.ts +55 -69
- package/src/reply-obligation-cache.ts +9 -9
- package/src/response-capture-report.ts +9 -9
- package/src/response-routing.ts +1 -1
- package/src/runner-core.ts +209 -222
- package/src/runner-exit.ts +1 -1
- package/src/runner-helpers.ts +10 -10
- package/src/runner-insights.ts +4 -2
- package/src/runner-mcp-proxy.ts +3 -3
- package/src/runner-spawn-config.ts +3 -3
- package/src/runtime-token-file.ts +1 -1
- package/src/runtime-token-remint.ts +1 -1
- package/src/service-access.ts +2 -2
- package/src/session-destroy.ts +1 -1
- package/src/session-insights.ts +1 -1
- package/src/session-scratch.ts +24 -37
- package/src/spawn-input.ts +6 -6
- package/src/startup-config-fetch.ts +4 -4
- package/src/subreaper.ts +3 -5
- package/src/test-run-dedup.ts +13 -13
- package/src/transcript-context.ts +2 -2
- package/src/transport-errors.ts +1 -1
- package/src/turn-opener.ts +1 -1
- package/src/turn-reconcile-event.ts +2 -2
- package/src/vault-proxy-hop.ts +2 -2
- package/src/web-tools.ts +2 -2
- package/agent-bin/agent-relay-browser +0 -10
- package/src/adapters/provider-quota-harvest.ts +0 -76
package/src/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { parseRunnerCliArgs, runnerHelp } from "./spawn-input";
|
|
|
32
32
|
import { VERSION } from "./version";
|
|
33
33
|
import type { AgentProfile, WorkspaceMetadata } from "@humwick/sdk";
|
|
34
34
|
import { exitRunner } from "./runner-exit";
|
|
35
|
-
import { codexConfigOverrides, errMessage, formatRunnerExitLine, isRecord, isRelayInjectionCategory, normalizeAgentLifecycle,
|
|
35
|
+
import { codexConfigOverrides, errMessage, formatRunnerExitLine, isRecord, isRelayInjectionCategory, normalizeAgentLifecycle, HUMWICK_TOKEN_HEADER, providerArgsSelectStreamJson, startArtifactCheckoutLease } from "@humwick/sdk";
|
|
36
36
|
import { supportedLaunchModesForProvider } from "@humwick/providers";
|
|
37
37
|
import { installUnhandledRejectionGuard } from "./async-guard";
|
|
38
38
|
import type { RunnerRelayInjectionEvent } from "./relay-injection-events";
|
|
@@ -40,14 +40,14 @@ import { enableRunnerSubreaper } from "./subreaper";
|
|
|
40
40
|
|
|
41
41
|
export async function main(argv = process.argv): Promise<void> {
|
|
42
42
|
disableCoreDumps();
|
|
43
|
-
//
|
|
43
|
+
// last-resort observability, installed before anything can schedule work. Two managed
|
|
44
44
|
// OpenCode sessions died with a clean `exit(1)` and an EMPTY stderr capture: the actual cause
|
|
45
45
|
// (a terminal provider failure resolving through onProviderExit, see runner-core.ts) turned out
|
|
46
|
-
// not to be a crash at all, but this guard closes the still-real, long-documented gap
|
|
46
|
+
// not to be a crash at all, but this guard closes the still-real, long-documented gap
|
|
47
47
|
// for any genuine unhandled rejection or uncaught exception elsewhere in the runner — neither
|
|
48
48
|
// currently leaves a trace beyond "exited after Ns". `unhandledRejection` mirrors the
|
|
49
49
|
// orchestrator's non-fatal "log and survive" backstop (see the SDK function's doc): nothing
|
|
50
|
-
// here respawns a dead runner
|
|
50
|
+
// here respawns a dead runner, so surviving beats dying silently. `uncaughtException`
|
|
51
51
|
// stays fatal (a synchronous throw can leave a half-applied mutation behind — same ruling as
|
|
52
52
|
// the orchestrator) but is logged deterministically via multiple paths first, so a crash always
|
|
53
53
|
// leaves a stack trace regardless of whether Bun's own default reporter would have shown one.
|
|
@@ -74,7 +74,7 @@ export async function main(argv = process.argv): Promise<void> {
|
|
|
74
74
|
// Started only once we know this is a real launch, not --version/--help: the lease holds an
|
|
75
75
|
// un-refed setInterval alive (see sdk/src/artifact-checkout-gc.ts), so starting it earlier
|
|
76
76
|
// stops --version/--help from ever exiting on a host whose runtime is a checkout symlink
|
|
77
|
-
// (e.g. the
|
|
77
|
+
// (e.g. the worker-a self-hosted runner) — the process hangs until externally killed.
|
|
78
78
|
startArtifactCheckoutLease();
|
|
79
79
|
const globalConfig = loadGlobalConfig();
|
|
80
80
|
const relayUrl = opts.relayUrl ?? globalConfig.relayUrl;
|
|
@@ -87,7 +87,7 @@ export async function main(argv = process.argv): Promise<void> {
|
|
|
87
87
|
: undefined);
|
|
88
88
|
const adapter = createProviderAdapter(opts.provider, opts.providerArgs, launchMode);
|
|
89
89
|
// Resolved BEFORE the interactive token exchange so the mint can stamp the posture into the signed
|
|
90
|
-
// constraints
|
|
90
|
+
// constraints: `agent.meta.approvalMode` is authz-relevant and therefore stripped at
|
|
91
91
|
// registration unless the token can prove it (src/authz-meta-keys.ts).
|
|
92
92
|
const approvalMode = opts.approvalMode
|
|
93
93
|
?? detectApprovalModeFromArgs(opts.provider, providerConfig.defaultArgs, opts.providerArgs)
|
|
@@ -119,10 +119,10 @@ export async function main(argv = process.argv): Promise<void> {
|
|
|
119
119
|
provider: opts.provider,
|
|
120
120
|
model: opts.model,
|
|
121
121
|
effort: opts.effort,
|
|
122
|
-
//
|
|
122
|
+
// effective-catalog window resolved server-side; the OpenCode adapter prefers it
|
|
123
123
|
// over its static manifest so override-defined models (muse-spark) report context usage.
|
|
124
124
|
...(opts.contextWindowTokens !== undefined ? { contextWindowTokens: opts.contextWindowTokens } : {}),
|
|
125
|
-
//
|
|
125
|
+
// the full record (protocol ≥ 2); the adapter applies payload > manifest precedence.
|
|
126
126
|
...(opts.modelRecord ? { modelRecord: opts.modelRecord } : {}),
|
|
127
127
|
runnerId: id,
|
|
128
128
|
instanceId: crypto.randomUUID(),
|
|
@@ -161,7 +161,7 @@ export async function main(argv = process.argv): Promise<void> {
|
|
|
161
161
|
providerConfig,
|
|
162
162
|
...(launchConfig ? { launchConfig } : {}),
|
|
163
163
|
adapter,
|
|
164
|
-
//
|
|
164
|
+
// printed via console.error (captured into the systemd-redirected stdout/stderr log
|
|
165
165
|
// the orchestrator tails on exit, see logFileDiagnostics/readLogTail) BEFORE process.exit runs
|
|
166
166
|
// below, so a terminal-provider-failure exit reads "model-unavailable: APIError 404 ..." in
|
|
167
167
|
// that log instead of leaving it empty.
|
|
@@ -173,7 +173,7 @@ export async function main(argv = process.argv): Promise<void> {
|
|
|
173
173
|
await runner.run();
|
|
174
174
|
|
|
175
175
|
const code = await Promise.race([exitPromise, signalPromise(runner)]);
|
|
176
|
-
//
|
|
176
|
+
// the structured exit record is written before stop can stall: the orchestrator parses
|
|
177
177
|
// it back from the log tail when systemd has already collected the unit. exitRunner then exits.
|
|
178
178
|
const reason = exitReason ?? (code === 130 || code === 143 ? `signal ${code === 130 ? "SIGINT" : "SIGTERM"}` : undefined);
|
|
179
179
|
console.error(formatRunnerExitLine(code, reason));
|
|
@@ -202,7 +202,7 @@ export async function resolveRunnerToken(input: {
|
|
|
202
202
|
runnerId: string;
|
|
203
203
|
agentId: string;
|
|
204
204
|
label?: string;
|
|
205
|
-
/**
|
|
205
|
+
/** the posture this interactive session actually launches with. Sent so the relay can stamp
|
|
206
206
|
* it into the signed constraints; without it the session's `meta.approvalMode` is unprovable and
|
|
207
207
|
* gets stripped at registration, silently downgrading spawned children to `guarded`. */
|
|
208
208
|
approvalMode?: string;
|
|
@@ -227,7 +227,7 @@ export async function resolveRunnerToken(input: {
|
|
|
227
227
|
method: "POST",
|
|
228
228
|
headers: {
|
|
229
229
|
"Content-Type": "application/json",
|
|
230
|
-
[
|
|
230
|
+
[HUMWICK_TOKEN_HEADER]: input.token,
|
|
231
231
|
},
|
|
232
232
|
body: JSON.stringify({
|
|
233
233
|
provider: input.provider,
|
|
@@ -243,9 +243,9 @@ export async function resolveRunnerToken(input: {
|
|
|
243
243
|
const body = await res.json().catch(() => null) as { token?: string; record?: { jti?: string; profileId?: string; expiresAt?: number }; error?: string } | null;
|
|
244
244
|
if (res.ok && body?.token) return { token: body.token, jti: body.record?.jti, profileId: body.record?.profileId ?? "provider-interactive", expiresAt: body.record?.expiresAt };
|
|
245
245
|
const detail = body?.error ? `: ${body.error}` : "";
|
|
246
|
-
console.warn(`[
|
|
246
|
+
console.warn(`[humwick] interactive scoped-token exchange failed (${res.status}${detail}); continuing with existing token. Root-token runtime fallback is deprecated.`);
|
|
247
247
|
} catch (error) {
|
|
248
|
-
console.warn(`[
|
|
248
|
+
console.warn(`[humwick] interactive scoped-token exchange failed (${errMessage(error)}); continuing with existing token. Root-token runtime fallback is deprecated.`);
|
|
249
249
|
}
|
|
250
250
|
return { token: input.token, rootFallback: true };
|
|
251
251
|
}
|
|
@@ -334,7 +334,7 @@ function parseRelayInjectionEventsEnv(raw: string | undefined): RunnerRelayInjec
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
//
|
|
337
|
+
// arm the `shuttingDown` restart-suppression latch synchronously, in the signal handler itself, BEFORE resolving this
|
|
338
338
|
// promise (which only unblocks `main()`'s `await Promise.race(...)`, itself an extra tick before
|
|
339
339
|
// `await runner.stop()` ever runs). See `markShuttingDown`'s doc comment in runner-core.ts for the
|
|
340
340
|
// race this closes: a direct-child provider (Codex/OpenCode) dying from the SAME process-group
|
|
@@ -381,7 +381,7 @@ export function runCli(provider?: string): void {
|
|
|
381
381
|
// A fatal startup failure (e.g. the runner could not register with the relay within the
|
|
382
382
|
// deadline) must exit non-zero, not hang or swallow — the orchestrator's exit detection
|
|
383
383
|
// then reports it and the spawn-parent is notified instead of waiting on a silent zombie.
|
|
384
|
-
console.error(`[
|
|
384
|
+
console.error(`[humwick] runner fatal: ${errMessage(error)}`);
|
|
385
385
|
exitRunner(1, `runner fatal: ${errMessage(error)}`);
|
|
386
386
|
});
|
|
387
387
|
}
|