oh-my-copilot 5.18.0 → 5.18.2
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +3 -3
- package/bridge/__pycache__/gyoshu_bridge.cpython-314.pyc +0 -0
- package/bridge/claude-md-coordinator.cjs +2 -2
- package/bridge/cli.cjs +17691 -14571
- package/bridge/mcp-server.cjs +4624 -1922
- package/bridge/runtime-cli.cjs +2735 -757
- package/bridge/team-bridge.cjs +357 -139
- package/bridge/team-mcp.cjs +922 -645
- package/bridge/team.js +2851 -874
- package/dist/__tests__/delegation-enforcer.test.js +1 -1
- package/dist/__tests__/delegation-enforcer.test.js.map +1 -1
- package/dist/__tests__/hud/cli-diagnostic.test.js +1 -1
- package/dist/__tests__/hud/cli-diagnostic.test.js.map +1 -1
- package/dist/__tests__/pre-tool-enforcer.test.js +3 -0
- package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
- package/dist/__tests__/session-start-script-context.test.js +1 -1
- package/dist/__tests__/session-start-script-context.test.js.map +1 -1
- package/dist/__tests__/skills.test.js +9 -0
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/cli/commands/__tests__/smoke-cassette.test.d.ts +2 -0
- package/dist/cli/commands/__tests__/smoke-cassette.test.d.ts.map +1 -0
- package/dist/cli/commands/__tests__/smoke-cassette.test.js +135 -0
- package/dist/cli/commands/__tests__/smoke-cassette.test.js.map +1 -0
- package/dist/cli/commands/smoke.d.ts +41 -2
- package/dist/cli/commands/smoke.d.ts.map +1 -1
- package/dist/cli/commands/smoke.js +103 -6
- package/dist/cli/commands/smoke.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +30 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/copilot-run/__tests__/job.test.js +347 -2
- package/dist/copilot-run/__tests__/job.test.js.map +1 -1
- package/dist/copilot-run/__tests__/sandbox-session.test.d.ts +2 -0
- package/dist/copilot-run/__tests__/sandbox-session.test.d.ts.map +1 -0
- package/dist/copilot-run/__tests__/sandbox-session.test.js +181 -0
- package/dist/copilot-run/__tests__/sandbox-session.test.js.map +1 -0
- package/dist/copilot-run/__tests__/sandbox.test.js +128 -4
- package/dist/copilot-run/__tests__/sandbox.test.js.map +1 -1
- package/dist/copilot-run/job.d.ts +87 -13
- package/dist/copilot-run/job.d.ts.map +1 -1
- package/dist/copilot-run/job.js +517 -177
- package/dist/copilot-run/job.js.map +1 -1
- package/dist/copilot-run/sandbox-session.d.ts +71 -0
- package/dist/copilot-run/sandbox-session.d.ts.map +1 -0
- package/dist/copilot-run/sandbox-session.js +156 -0
- package/dist/copilot-run/sandbox-session.js.map +1 -0
- package/dist/copilot-run/sandbox.d.ts +17 -0
- package/dist/copilot-run/sandbox.d.ts.map +1 -1
- package/dist/copilot-run/sandbox.js +108 -4
- package/dist/copilot-run/sandbox.js.map +1 -1
- package/dist/copilot-run/timeout.d.ts +4 -0
- package/dist/copilot-run/timeout.d.ts.map +1 -0
- package/dist/copilot-run/timeout.js +10 -0
- package/dist/copilot-run/timeout.js.map +1 -0
- package/dist/factory/check/__tests__/cli-ado.test.d.ts +2 -0
- package/dist/factory/check/__tests__/cli-ado.test.d.ts.map +1 -0
- package/dist/factory/check/__tests__/cli-ado.test.js +95 -0
- package/dist/factory/check/__tests__/cli-ado.test.js.map +1 -0
- package/dist/factory/check/__tests__/cli.test.js +2 -1
- package/dist/factory/check/__tests__/cli.test.js.map +1 -1
- package/dist/factory/check/cli.d.ts +17 -1
- package/dist/factory/check/cli.d.ts.map +1 -1
- package/dist/factory/check/cli.js +20 -2
- package/dist/factory/check/cli.js.map +1 -1
- package/dist/factory/heal/__tests__/logs-ado.test.d.ts +2 -0
- package/dist/factory/heal/__tests__/logs-ado.test.d.ts.map +1 -0
- package/dist/factory/heal/__tests__/logs-ado.test.js +39 -0
- package/dist/factory/heal/__tests__/logs-ado.test.js.map +1 -0
- package/dist/factory/heal/classify.d.ts +3 -1
- package/dist/factory/heal/classify.d.ts.map +1 -1
- package/dist/factory/heal/classify.js +4 -2
- package/dist/factory/heal/classify.js.map +1 -1
- package/dist/factory/heal/cli.d.ts +8 -2
- package/dist/factory/heal/cli.d.ts.map +1 -1
- package/dist/factory/heal/cli.js +11 -9
- package/dist/factory/heal/cli.js.map +1 -1
- package/dist/factory/heal/debug-lane.js +1 -1
- package/dist/factory/heal/debug-lane.js.map +1 -1
- package/dist/factory/heal/heal-evidence.d.ts +4 -2
- package/dist/factory/heal/heal-evidence.d.ts.map +1 -1
- package/dist/factory/heal/heal-evidence.js +8 -6
- package/dist/factory/heal/heal-evidence.js.map +1 -1
- package/dist/factory/heal/logs.d.ts +1 -1
- package/dist/factory/heal/logs.d.ts.map +1 -1
- package/dist/factory/heal/logs.js +4 -3
- package/dist/factory/heal/logs.js.map +1 -1
- package/dist/factory/heal/run.d.ts +3 -0
- package/dist/factory/heal/run.d.ts.map +1 -1
- package/dist/factory/heal/run.js +1 -1
- package/dist/factory/heal/run.js.map +1 -1
- package/dist/factory/run/__tests__/engine.sandbox.test.js +30 -2
- package/dist/factory/run/__tests__/engine.sandbox.test.js.map +1 -1
- package/dist/factory/run/__tests__/engine.test.js +31 -1
- package/dist/factory/run/__tests__/engine.test.js.map +1 -1
- package/dist/factory/run/__tests__/fake-lanes.d.ts +2 -0
- package/dist/factory/run/__tests__/fake-lanes.d.ts.map +1 -1
- package/dist/factory/run/__tests__/fake-lanes.js +1 -1
- package/dist/factory/run/__tests__/fake-lanes.js.map +1 -1
- package/dist/factory/run/__tests__/merge-policy.test.d.ts +2 -0
- package/dist/factory/run/__tests__/merge-policy.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/merge-policy.test.js +40 -0
- package/dist/factory/run/__tests__/merge-policy.test.js.map +1 -0
- package/dist/factory/run/__tests__/prepare-gates.test.js +22 -0
- package/dist/factory/run/__tests__/prepare-gates.test.js.map +1 -1
- package/dist/factory/run/__tests__/units.test.js +12 -1
- package/dist/factory/run/__tests__/units.test.js.map +1 -1
- package/dist/factory/run/engine.d.ts.map +1 -1
- package/dist/factory/run/engine.js +32 -6
- package/dist/factory/run/engine.js.map +1 -1
- package/dist/factory/run/lane-commit.d.ts +10 -1
- package/dist/factory/run/lane-commit.d.ts.map +1 -1
- package/dist/factory/run/lane-commit.js +21 -4
- package/dist/factory/run/lane-commit.js.map +1 -1
- package/dist/factory/run/merge-policy.d.ts +3 -1
- package/dist/factory/run/merge-policy.d.ts.map +1 -1
- package/dist/factory/run/merge-policy.js +8 -2
- package/dist/factory/run/merge-policy.js.map +1 -1
- package/dist/factory/run/review-guard.d.ts +2 -0
- package/dist/factory/run/review-guard.d.ts.map +1 -1
- package/dist/factory/run/review-guard.js +1 -1
- package/dist/factory/run/review-guard.js.map +1 -1
- package/dist/factory/run/state.d.ts +13 -0
- package/dist/factory/run/state.d.ts.map +1 -1
- package/dist/factory/run/state.js +20 -5
- package/dist/factory/run/state.js.map +1 -1
- package/dist/features/builtin-skills/skills.js +1 -1
- package/dist/features/builtin-skills/skills.js.map +1 -1
- package/dist/features/delegation-enforcer.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.js +2 -6
- package/dist/features/delegation-enforcer.js.map +1 -1
- package/dist/forge/__tests__/gh-argv-baseline.heal.test.js +52 -2
- package/dist/forge/__tests__/gh-argv-baseline.heal.test.js.map +1 -1
- package/dist/forge/ado/__tests__/acceptance-scripts.test.d.ts +8 -0
- package/dist/forge/ado/__tests__/acceptance-scripts.test.d.ts.map +1 -0
- package/dist/forge/ado/__tests__/acceptance-scripts.test.js +567 -0
- package/dist/forge/ado/__tests__/acceptance-scripts.test.js.map +1 -0
- package/dist/forge/ado/__tests__/az-binary.test.js +4 -0
- package/dist/forge/ado/__tests__/az-binary.test.js.map +1 -1
- package/dist/forge/ado/__tests__/failed-jobs.test.d.ts +2 -0
- package/dist/forge/ado/__tests__/failed-jobs.test.d.ts.map +1 -0
- package/dist/forge/ado/__tests__/failed-jobs.test.js +96 -0
- package/dist/forge/ado/__tests__/failed-jobs.test.js.map +1 -0
- package/dist/forge/ado/az-binary.d.ts +2 -1
- package/dist/forge/ado/az-binary.d.ts.map +1 -1
- package/dist/forge/ado/az-binary.js +3 -2
- package/dist/forge/ado/az-binary.js.map +1 -1
- package/dist/forge/ado/checks.d.ts.map +1 -1
- package/dist/forge/ado/checks.js +30 -0
- package/dist/forge/ado/checks.js.map +1 -1
- package/dist/forge/github/ci.d.ts +2 -0
- package/dist/forge/github/ci.d.ts.map +1 -1
- package/dist/forge/github/ci.js +3 -0
- package/dist/forge/github/ci.js.map +1 -1
- package/dist/forge/types.d.ts +2 -0
- package/dist/forge/types.d.ts.map +1 -1
- package/dist/hooks/autopilot/__tests__/pipeline.test.js +1 -1
- package/dist/hooks/autopilot/__tests__/pipeline.test.js.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.js +3 -3
- package/dist/hooks/autopilot/adapters/execution-adapter.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js +4 -0
- package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/jev-shadow.test.js +7 -0
- package/dist/hooks/keyword-detector/__tests__/jev-shadow.test.js.map +1 -1
- package/dist/hooks/keyword-detector/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/index.js +4 -4
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/keyword-detector/jev-shadow.js +1 -1
- package/dist/hooks/keyword-detector/jev-shadow.js.map +1 -1
- package/dist/hud/index.js +1 -1
- package/dist/hud/index.js.map +1 -1
- package/dist/mcp/__tests__/host-smoke-tool.test.js +14 -0
- package/dist/mcp/__tests__/host-smoke-tool.test.js.map +1 -1
- package/dist/ship/gates.d.ts +9 -3
- package/dist/ship/gates.d.ts.map +1 -1
- package/dist/ship/gates.js +24 -7
- package/dist/ship/gates.js.map +1 -1
- package/dist/smoke/__tests__/copilot-sdk-driver.test.js +129 -4
- package/dist/smoke/__tests__/copilot-sdk-driver.test.js.map +1 -1
- package/dist/smoke/__tests__/copilot-session-env.test.d.ts +2 -0
- package/dist/smoke/__tests__/copilot-session-env.test.d.ts.map +1 -0
- package/dist/smoke/__tests__/copilot-session-env.test.js +29 -0
- package/dist/smoke/__tests__/copilot-session-env.test.js.map +1 -0
- package/dist/smoke/__tests__/copilot-team-scenario.test.js +3 -0
- package/dist/smoke/__tests__/copilot-team-scenario.test.js.map +1 -1
- package/dist/smoke/copilot-sdk-driver.d.ts +37 -1
- package/dist/smoke/copilot-sdk-driver.d.ts.map +1 -1
- package/dist/smoke/copilot-sdk-driver.js +114 -10
- package/dist/smoke/copilot-sdk-driver.js.map +1 -1
- package/dist/smoke/copilot-sdk-scenarios.d.ts +27 -0
- package/dist/smoke/copilot-sdk-scenarios.d.ts.map +1 -1
- package/dist/smoke/copilot-sdk-scenarios.js +31 -0
- package/dist/smoke/copilot-sdk-scenarios.js.map +1 -1
- package/dist/smoke/copilot-session-env.d.ts +38 -1
- package/dist/smoke/copilot-session-env.d.ts.map +1 -1
- package/dist/smoke/copilot-session-env.js +82 -1
- package/dist/smoke/copilot-session-env.js.map +1 -1
- package/dist/smoke/copilot-smoke.d.ts +21 -1
- package/dist/smoke/copilot-smoke.d.ts.map +1 -1
- package/dist/smoke/copilot-smoke.js +86 -6
- package/dist/smoke/copilot-smoke.js.map +1 -1
- package/dist/smoke/copilot-team-scenario.d.ts +4 -2
- package/dist/smoke/copilot-team-scenario.d.ts.map +1 -1
- package/dist/smoke/copilot-team-scenario.js +5 -4
- package/dist/smoke/copilot-team-scenario.js.map +1 -1
- package/dist/smoke/replay/__tests__/cassette.test.d.ts +2 -0
- package/dist/smoke/replay/__tests__/cassette.test.d.ts.map +1 -0
- package/dist/smoke/replay/__tests__/cassette.test.js +387 -0
- package/dist/smoke/replay/__tests__/cassette.test.js.map +1 -0
- package/dist/smoke/replay/__tests__/handler.test.d.ts +2 -0
- package/dist/smoke/replay/__tests__/handler.test.d.ts.map +1 -0
- package/dist/smoke/replay/__tests__/handler.test.js +367 -0
- package/dist/smoke/replay/__tests__/handler.test.js.map +1 -0
- package/dist/smoke/replay/__tests__/matcher.test.d.ts +2 -0
- package/dist/smoke/replay/__tests__/matcher.test.d.ts.map +1 -0
- package/dist/smoke/replay/__tests__/matcher.test.js +318 -0
- package/dist/smoke/replay/__tests__/matcher.test.js.map +1 -0
- package/dist/smoke/replay/__tests__/normalize.test.d.ts +2 -0
- package/dist/smoke/replay/__tests__/normalize.test.d.ts.map +1 -0
- package/dist/smoke/replay/__tests__/normalize.test.js +53 -0
- package/dist/smoke/replay/__tests__/normalize.test.js.map +1 -0
- package/dist/smoke/replay/__tests__/redact.test.d.ts +2 -0
- package/dist/smoke/replay/__tests__/redact.test.d.ts.map +1 -0
- package/dist/smoke/replay/__tests__/redact.test.js +453 -0
- package/dist/smoke/replay/__tests__/redact.test.js.map +1 -0
- package/dist/smoke/replay/__tests__/run.test.d.ts +2 -0
- package/dist/smoke/replay/__tests__/run.test.d.ts.map +1 -0
- package/dist/smoke/replay/__tests__/run.test.js +311 -0
- package/dist/smoke/replay/__tests__/run.test.js.map +1 -0
- package/dist/smoke/replay/cassette.d.ts +210 -0
- package/dist/smoke/replay/cassette.d.ts.map +1 -0
- package/dist/smoke/replay/cassette.js +580 -0
- package/dist/smoke/replay/cassette.js.map +1 -0
- package/dist/smoke/replay/handler.d.ts +221 -0
- package/dist/smoke/replay/handler.d.ts.map +1 -0
- package/dist/smoke/replay/handler.js +702 -0
- package/dist/smoke/replay/handler.js.map +1 -0
- package/dist/smoke/replay/matcher.d.ts +194 -0
- package/dist/smoke/replay/matcher.d.ts.map +1 -0
- package/dist/smoke/replay/matcher.js +344 -0
- package/dist/smoke/replay/matcher.js.map +1 -0
- package/dist/smoke/replay/normalize.d.ts +35 -0
- package/dist/smoke/replay/normalize.d.ts.map +1 -0
- package/dist/smoke/replay/normalize.js +64 -0
- package/dist/smoke/replay/normalize.js.map +1 -0
- package/dist/smoke/replay/redact.d.ts +151 -0
- package/dist/smoke/replay/redact.d.ts.map +1 -0
- package/dist/smoke/replay/redact.js +577 -0
- package/dist/smoke/replay/redact.js.map +1 -0
- package/dist/smoke/replay/run.d.ts +119 -0
- package/dist/smoke/replay/run.d.ts.map +1 -0
- package/dist/smoke/replay/run.js +302 -0
- package/dist/smoke/replay/run.js.map +1 -0
- package/dist/team/__tests__/sdk-transport.test.js +334 -6
- package/dist/team/__tests__/sdk-transport.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.pane-env.test.js +13 -13
- package/dist/team/__tests__/tmux-session.pane-env.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.spawn.test.js +12 -0
- package/dist/team/__tests__/tmux-session.spawn.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.split-pane-env.test.js +2 -2
- package/dist/team/__tests__/tmux-session.split-pane-env.test.js.map +1 -1
- package/dist/team/__tests__/worker-launch-ack.test.js +173 -9
- package/dist/team/__tests__/worker-launch-ack.test.js.map +1 -1
- package/dist/team/git-worktree.d.ts.map +1 -1
- package/dist/team/git-worktree.js +2 -1
- package/dist/team/git-worktree.js.map +1 -1
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +3 -2
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/sdk-host.d.ts +44 -0
- package/dist/team/sdk-host.d.ts.map +1 -1
- package/dist/team/sdk-host.js +147 -5
- package/dist/team/sdk-host.js.map +1 -1
- package/dist/team/sdk-policy.d.ts +17 -0
- package/dist/team/sdk-policy.d.ts.map +1 -1
- package/dist/team/sdk-policy.js +79 -1
- package/dist/team/sdk-policy.js.map +1 -1
- package/dist/team/sdk-transport.d.ts +15 -0
- package/dist/team/sdk-transport.d.ts.map +1 -1
- package/dist/team/sdk-transport.js +54 -9
- package/dist/team/sdk-transport.js.map +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +5 -0
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-launch-ack.d.ts +3 -1
- package/dist/team/worker-launch-ack.d.ts.map +1 -1
- package/dist/team/worker-launch-ack.js +73 -8
- package/dist/team/worker-launch-ack.js.map +1 -1
- package/dist/tools/host-smoke-tool.d.ts +5 -1
- package/dist/tools/host-smoke-tool.d.ts.map +1 -1
- package/dist/tools/host-smoke-tool.js +26 -3
- package/dist/tools/host-smoke-tool.js.map +1 -1
- package/dist/workflow/__tests__/alias-resolver.test.js +2 -0
- package/dist/workflow/__tests__/alias-resolver.test.js.map +1 -1
- package/dist/workflow/alias-resolver.js +2 -2
- package/dist/workflow/alias-resolver.js.map +1 -1
- package/docs/CLAUDE.md +3 -2
- package/docs/REFERENCE.md +69 -4
- package/docs/copilot-instructions.md +6 -5
- package/package.json +2 -2
- package/plugin.json +1 -1
- package/scripts/ado-acceptance.mjs +611 -0
- package/scripts/ado-capture.mjs +320 -0
- package/scripts/ado-fixture-import.mjs +293 -0
- package/scripts/keyword-detector.mjs +2 -2
- package/scripts/lib/backlog-to-workitems.mjs +115 -0
- package/scripts/persistent-mode.cjs +1 -1
- package/scripts/persistent-mode.mjs +1 -1
- package/scripts/pre-tool-enforcer.mjs +1 -1
- package/scripts/session-start.mjs +3 -3
- package/scripts/setup-copilot-instructions.sh +1 -1
- package/scripts/spikes/request-handler-probe.mjs +186 -0
- package/skills/autopilot/SKILL.md +3 -3
- package/skills/cancel/SKILL.md +1 -1
- package/skills/ship/SKILL.md +2 -2
- package/skills/team/SKILL.md +3 -3
- package/templates/hooks/keyword-detector.mjs +1 -1
- package/templates/hooks/pre-tool-use.mjs +1 -1
- package/bridge/__pycache__/gyoshu_bridge.cpython-312.pyc +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tmux-session.split-pane-env.test.js","sourceRoot":"","sources":["../../../src/team/__tests__/tmux-session.split-pane-env.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,M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AC,CAAC,CAAC;QACnC,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1E,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,4CAA4C,CAAC,CAAC;QAChF,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { mkdir, mkdtemp, readFile, rm, symlink, writeFile } from 'node:fs/promis
|
|
|
6
6
|
import { tmpdir } from 'node:os';
|
|
7
7
|
import { join, relative } from 'node:path';
|
|
8
8
|
import * as processUtils from '../../platform/process-utils.js';
|
|
9
|
-
import { awaitWorkerLaunchAcknowledgement, awaitWorkerLaunchProviderStarted, buildWorkerLaunchBootstrapSpec, buildWindowsSupervisorInvocation, buildWindowsSupervisorSource, cleanupWorkerLaunchTransport, observeWorkerLaunchProvider, isWorkerLaunchAttemptAccepted, isWorkerLaunchProviderStarted, loadWorkerLaunchAttempt, loadCurrentWorkerLaunchAttempt, prepareWorkerLaunchAttempt, materializeWorkerLaunchTransport, runWorkerLaunchBootstrap, readAndConsumeWorkerLaunchDescriptor, retireWorkerLaunchAttempt, retireAndCleanupCurrentWorkerLaunchAttempt, terminateWorkerLaunchProvider, revokeWorkerLaunchAttempt, withWorkerLaunchAttemptFence, buildProviderEnvironment, buildProviderSpawnInvocation, materializeProviderSpawnInvocation, quoteWindowsCreateProcessArgument, } from '../worker-launch-ack.js';
|
|
9
|
+
import { awaitWorkerLaunchAcknowledgement, awaitWorkerLaunchProviderStarted, buildWorkerLaunchBootstrapSpec, buildWindowsSupervisorInvocation, buildWindowsSupervisorSource, cleanupWorkerLaunchTransport, observeWorkerLaunchProvider, isWorkerLaunchAttemptAccepted, isWorkerLaunchProviderStarted, loadWorkerLaunchAttempt, loadCurrentWorkerLaunchAttempt, prepareWorkerLaunchAttempt, materializeWorkerLaunchTransport, runWorkerLaunchBootstrap, readAndConsumeWorkerLaunchDescriptor, retireWorkerLaunchAttempt, retireAndCleanupCurrentWorkerLaunchAttempt, terminateWorkerLaunchProvider, revokeWorkerLaunchAttempt, withWorkerLaunchAttemptFence, assertEnvPassthroughAllowed, buildProviderEnvironment, buildProviderSpawnInvocation, materializeProviderSpawnInvocation, quoteWindowsCreateProcessArgument, } from '../worker-launch-ack.js';
|
|
10
10
|
import { captureOwnedProcessGroup, getProcessStartIdentity, isProcessAlive, terminateOwnedProcessGroup, terminateOwnedProcessTree, } from '../../platform/process-utils.js';
|
|
11
11
|
import { getOmcRoot } from '../../lib/worktree-paths.js';
|
|
12
12
|
import { getWorkerEnv } from '../model-contract.js';
|
|
@@ -82,7 +82,7 @@ afterEach(async () => {
|
|
|
82
82
|
await removeFixtureDir(cwd);
|
|
83
83
|
cwd = '';
|
|
84
84
|
});
|
|
85
|
-
async function attempt() {
|
|
85
|
+
async function attempt(provider = 'codex') {
|
|
86
86
|
cwd = await createFixture('worker-launch-ack-');
|
|
87
87
|
return prepareWorkerLaunchAttempt({
|
|
88
88
|
cwd,
|
|
@@ -90,7 +90,7 @@ async function attempt() {
|
|
|
90
90
|
workerName: 'worker-1',
|
|
91
91
|
instanceId: randomUUID(),
|
|
92
92
|
paneId: '%2',
|
|
93
|
-
provider
|
|
93
|
+
provider,
|
|
94
94
|
runtimeCliPath: '/runtime-cli.cjs',
|
|
95
95
|
});
|
|
96
96
|
}
|
|
@@ -515,6 +515,65 @@ describe('worker launch acknowledgement', () => {
|
|
|
515
515
|
await writeFile(completionPath, 'not-an-exit-code\n', 'utf8');
|
|
516
516
|
await expect(observeWorkerLaunchProvider(launchAttempt)).resolves.toBe('unknown');
|
|
517
517
|
});
|
|
518
|
+
describe('stops waiting for provider start once the provider has exited', () => {
|
|
519
|
+
const START_WAIT_MS = 10_000;
|
|
520
|
+
async function writeStarted(launchAttempt, pid, processStartIdentity) {
|
|
521
|
+
const expected = await acceptFixtureAttempt(launchAttempt);
|
|
522
|
+
await writeFile(launchAttempt.startedPath, JSON.stringify({
|
|
523
|
+
...expected,
|
|
524
|
+
kind: 'worker_launch_provider_started',
|
|
525
|
+
pid,
|
|
526
|
+
process_start_identity: processStartIdentity,
|
|
527
|
+
written_at: new Date().toISOString(),
|
|
528
|
+
}), 'utf8');
|
|
529
|
+
}
|
|
530
|
+
async function timedStartWait(launchAttempt) {
|
|
531
|
+
const t0 = Date.now();
|
|
532
|
+
const started = await awaitWorkerLaunchProviderStarted(launchAttempt, { timeoutMs: START_WAIT_MS, pollIntervalMs: 5 });
|
|
533
|
+
return { started, elapsedMs: Date.now() - t0 };
|
|
534
|
+
}
|
|
535
|
+
it('returns false at once when a terminal record follows valid start evidence', async () => {
|
|
536
|
+
const launchAttempt = await attempt();
|
|
537
|
+
const identity = await getProcessStartIdentity(process.pid);
|
|
538
|
+
await writeStarted(launchAttempt, process.pid, identity);
|
|
539
|
+
await writeFile(`${launchAttempt.startedPath}.terminal`, '{}', 'utf8');
|
|
540
|
+
const { started, elapsedMs } = await timedStartWait(launchAttempt);
|
|
541
|
+
expect(started).toBe(false);
|
|
542
|
+
expect(elapsedMs).toBeLessThan(2_000);
|
|
543
|
+
});
|
|
544
|
+
it('returns false at once when the supervisor completion marker exists', async () => {
|
|
545
|
+
const launchAttempt = await attempt();
|
|
546
|
+
await acceptFixtureAttempt(launchAttempt);
|
|
547
|
+
await writeBoundCompletionEvidence(launchAttempt, join(cwd, 'provider-exit.json'));
|
|
548
|
+
const { started, elapsedMs } = await timedStartWait(launchAttempt);
|
|
549
|
+
expect(started).toBe(false);
|
|
550
|
+
expect(elapsedMs).toBeLessThan(2_000);
|
|
551
|
+
});
|
|
552
|
+
it('returns false at once when the started pid is dead', async () => {
|
|
553
|
+
const launchAttempt = await attempt();
|
|
554
|
+
const provider = await spawnDisposableProvider();
|
|
555
|
+
await writeStarted(launchAttempt, provider.pid, provider.processStartIdentity);
|
|
556
|
+
await stopDisposableProvider(provider.child);
|
|
557
|
+
await vi.waitFor(() => expect(isProcessAlive(provider.pid)).toBe(false), { timeout: 5_000, interval: 10 });
|
|
558
|
+
const { started, elapsedMs } = await timedStartWait(launchAttempt);
|
|
559
|
+
expect(started).toBe(false);
|
|
560
|
+
expect(elapsedMs).toBeLessThan(2_000);
|
|
561
|
+
});
|
|
562
|
+
it.each(['mismatch', 'unknown'])('keeps waiting through a transient %s liveness read', async (transient) => {
|
|
563
|
+
const launchAttempt = await attempt();
|
|
564
|
+
const identity = await getProcessStartIdentity(process.pid);
|
|
565
|
+
await writeStarted(launchAttempt, process.pid, identity);
|
|
566
|
+
const liveness = vi.spyOn(processUtils, 'isProcessIdentityLive').mockResolvedValueOnce(transient);
|
|
567
|
+
try {
|
|
568
|
+
const { started } = await timedStartWait(launchAttempt);
|
|
569
|
+
expect(started).toBe(true);
|
|
570
|
+
expect(liveness.mock.calls.length).toBeGreaterThanOrEqual(2);
|
|
571
|
+
}
|
|
572
|
+
finally {
|
|
573
|
+
liveness.mockRestore();
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
});
|
|
518
577
|
it('rejects a completion marker from another launch even when the path is substituted', async () => {
|
|
519
578
|
const launchAttempt = await attempt();
|
|
520
579
|
await acceptFixtureAttempt(launchAttempt);
|
|
@@ -3095,22 +3154,22 @@ describe('worker launch acknowledgement', () => {
|
|
|
3095
3154
|
const sourceEnv = {
|
|
3096
3155
|
PATH: '/usr/bin:/bin',
|
|
3097
3156
|
HOME: '/home/provider',
|
|
3098
|
-
|
|
3157
|
+
CUSTOM_PROVIDER_SETTING: 'secret-token-123',
|
|
3099
3158
|
ANOTHER_CUSTOM_VAR: 'another-value',
|
|
3100
3159
|
};
|
|
3101
3160
|
// Verify that without passthrough, custom vars are NOT in the environment
|
|
3102
3161
|
const runtimeEnv = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux');
|
|
3103
3162
|
expect(runtimeEnv).toHaveProperty('EXPLICIT', 'yes');
|
|
3104
|
-
expect(runtimeEnv).not.toHaveProperty('
|
|
3163
|
+
expect(runtimeEnv).not.toHaveProperty('CUSTOM_PROVIDER_SETTING');
|
|
3105
3164
|
expect(runtimeEnv).not.toHaveProperty('ANOTHER_CUSTOM_VAR');
|
|
3106
3165
|
// Verify that custom vars ARE included when passthrough is specified
|
|
3107
|
-
const runtimeEnvWithPassthrough = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux', ['
|
|
3166
|
+
const runtimeEnvWithPassthrough = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux', ['CUSTOM_PROVIDER_SETTING', 'ANOTHER_CUSTOM_VAR']);
|
|
3108
3167
|
expect(runtimeEnvWithPassthrough).toHaveProperty('EXPLICIT', 'yes');
|
|
3109
|
-
expect(runtimeEnvWithPassthrough).toHaveProperty('
|
|
3168
|
+
expect(runtimeEnvWithPassthrough).toHaveProperty('CUSTOM_PROVIDER_SETTING', 'secret-token-123');
|
|
3110
3169
|
expect(runtimeEnvWithPassthrough).toHaveProperty('ANOTHER_CUSTOM_VAR', 'another-value');
|
|
3111
3170
|
// Passthrough vars that don't exist in sourceEnv should be silently skipped
|
|
3112
|
-
const runtimeEnvMissingVar = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux', ['NONEXISTENT_VAR', '
|
|
3113
|
-
expect(runtimeEnvMissingVar).toHaveProperty('
|
|
3171
|
+
const runtimeEnvMissingVar = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux', ['NONEXISTENT_VAR', 'CUSTOM_PROVIDER_SETTING']);
|
|
3172
|
+
expect(runtimeEnvMissingVar).toHaveProperty('CUSTOM_PROVIDER_SETTING', 'secret-token-123');
|
|
3114
3173
|
expect(runtimeEnvMissingVar).not.toHaveProperty('NONEXISTENT_VAR');
|
|
3115
3174
|
});
|
|
3116
3175
|
it('parses OMC_TEAM_WORKER_ENV_PASSTHROUGH from source environment', () => {
|
|
@@ -3154,4 +3213,109 @@ describe('worker launch acknowledgement', () => {
|
|
|
3154
3213
|
expect(() => buildProviderEnvironment({}, sourceEnv, 'win32', ['SYSTEMROOT'])).toThrow('worker_launch_env_passthrough_key_reserved');
|
|
3155
3214
|
});
|
|
3156
3215
|
});
|
|
3216
|
+
describe('worker env passthrough refuses credentials except the provider login', () => {
|
|
3217
|
+
const sourceEnv = {
|
|
3218
|
+
PATH: '/usr/bin',
|
|
3219
|
+
HOME: '/home/user',
|
|
3220
|
+
AWS_SECRET_ACCESS_KEY: 'aws-secret',
|
|
3221
|
+
AWS_REGION: 'eu-north-1',
|
|
3222
|
+
NPM_TOKEN: 'npm-secret',
|
|
3223
|
+
SSH_AUTH_SOCK: '/tmp/agent.sock',
|
|
3224
|
+
GH_TOKEN: 'gh-secret',
|
|
3225
|
+
ANTHROPIC_API_KEY: 'anthropic-secret',
|
|
3226
|
+
GOOGLE_APPLICATION_CREDENTIALS: '/keys/sa.json',
|
|
3227
|
+
};
|
|
3228
|
+
afterEach(() => { vi.unstubAllEnvs(); });
|
|
3229
|
+
it('builds the provider env without the source env credentials', () => {
|
|
3230
|
+
for (const provider of ['copilot', 'claude', undefined]) {
|
|
3231
|
+
const env = buildProviderEnvironment({}, sourceEnv, 'linux', undefined, provider);
|
|
3232
|
+
expect(Object.keys(env).sort()).toEqual(['HOME', 'PATH']);
|
|
3233
|
+
}
|
|
3234
|
+
});
|
|
3235
|
+
it.each(['AWS_SECRET_ACCESS_KEY', 'NPM_TOKEN', 'SSH_AUTH_SOCK'])('refuses passthrough of %s for every provider', key => {
|
|
3236
|
+
for (const provider of ['copilot', 'claude', 'codex', undefined]) {
|
|
3237
|
+
expect(() => buildProviderEnvironment({}, sourceEnv, 'linux', [key], provider))
|
|
3238
|
+
.toThrow('worker_launch_env_passthrough_credential');
|
|
3239
|
+
}
|
|
3240
|
+
});
|
|
3241
|
+
it('passes ANTHROPIC_API_KEY to claude only and GH_TOKEN to copilot only, skipping the other', () => {
|
|
3242
|
+
const notice = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
|
|
3243
|
+
expect(buildProviderEnvironment({}, sourceEnv, 'linux', ['ANTHROPIC_API_KEY'], 'claude'))
|
|
3244
|
+
.toHaveProperty('ANTHROPIC_API_KEY', 'anthropic-secret');
|
|
3245
|
+
expect(buildProviderEnvironment({}, sourceEnv, 'linux', ['GH_TOKEN'], 'copilot'))
|
|
3246
|
+
.toHaveProperty('GH_TOKEN', 'gh-secret');
|
|
3247
|
+
expect(notice).not.toHaveBeenCalled();
|
|
3248
|
+
// A mixed team shares one list: another provider's login is skipped, not refused.
|
|
3249
|
+
const mixed = ['ANTHROPIC_API_KEY', 'GH_TOKEN', 'CUSTOM_SETTING'];
|
|
3250
|
+
const env = { ...sourceEnv, CUSTOM_SETTING: 'custom' };
|
|
3251
|
+
const copilot = buildProviderEnvironment({}, env, 'linux', mixed, 'copilot');
|
|
3252
|
+
expect(copilot).toMatchObject({ GH_TOKEN: 'gh-secret', CUSTOM_SETTING: 'custom' });
|
|
3253
|
+
expect(copilot).not.toHaveProperty('ANTHROPIC_API_KEY');
|
|
3254
|
+
const claude = buildProviderEnvironment({}, env, 'linux', mixed, 'claude');
|
|
3255
|
+
expect(claude).toMatchObject({ ANTHROPIC_API_KEY: 'anthropic-secret', CUSTOM_SETTING: 'custom' });
|
|
3256
|
+
expect(claude).not.toHaveProperty('GH_TOKEN');
|
|
3257
|
+
const codex = buildProviderEnvironment({}, env, 'linux', mixed, 'codex');
|
|
3258
|
+
expect(codex).not.toHaveProperty('ANTHROPIC_API_KEY');
|
|
3259
|
+
expect(codex).not.toHaveProperty('GH_TOKEN');
|
|
3260
|
+
expect(notice).toHaveBeenCalledWith(expect.stringMatching(/ANTHROPIC_API_KEY is another provider's login; not forwarded to this copilot worker/));
|
|
3261
|
+
notice.mockRestore();
|
|
3262
|
+
// The pane shell hosts any provider: any provider's login passes there.
|
|
3263
|
+
expect(buildProviderEnvironment({}, sourceEnv, 'linux', ['ANTHROPIC_API_KEY', 'GH_TOKEN']))
|
|
3264
|
+
.toMatchObject({ ANTHROPIC_API_KEY: 'anthropic-secret', GH_TOKEN: 'gh-secret' });
|
|
3265
|
+
});
|
|
3266
|
+
it('passes AWS_* and GOOGLE_* to claude only when Bedrock or Vertex is enabled', () => {
|
|
3267
|
+
const bedrock = { ...sourceEnv, CLAUDE_CODE_USE_BEDROCK: '1' };
|
|
3268
|
+
expect(buildProviderEnvironment({}, bedrock, 'linux', ['AWS_SECRET_ACCESS_KEY', 'AWS_REGION'], 'claude'))
|
|
3269
|
+
.toMatchObject({ AWS_SECRET_ACCESS_KEY: 'aws-secret', AWS_REGION: 'eu-north-1' });
|
|
3270
|
+
const notice = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
|
|
3271
|
+
expect(buildProviderEnvironment({}, bedrock, 'linux', ['AWS_SECRET_ACCESS_KEY'], 'copilot'))
|
|
3272
|
+
.not.toHaveProperty('AWS_SECRET_ACCESS_KEY');
|
|
3273
|
+
notice.mockRestore();
|
|
3274
|
+
expect(() => buildProviderEnvironment({}, sourceEnv, 'linux', ['AWS_SECRET_ACCESS_KEY'], 'copilot'))
|
|
3275
|
+
.toThrow('worker_launch_env_passthrough_credential');
|
|
3276
|
+
expect(() => buildProviderEnvironment({}, { ...sourceEnv, CLAUDE_CODE_USE_BEDROCK: '0' }, 'linux', ['AWS_SECRET_ACCESS_KEY'], 'claude'))
|
|
3277
|
+
.toThrow('worker_launch_env_passthrough_credential');
|
|
3278
|
+
expect(() => buildProviderEnvironment({}, bedrock, 'linux', ['GOOGLE_APPLICATION_CREDENTIALS'], 'claude'))
|
|
3279
|
+
.toThrow('worker_launch_env_passthrough_credential');
|
|
3280
|
+
expect(buildProviderEnvironment({}, { ...sourceEnv, CLAUDE_CODE_USE_VERTEX: 'true' }, 'linux', ['GOOGLE_APPLICATION_CREDENTIALS'], 'claude'))
|
|
3281
|
+
.toHaveProperty('GOOGLE_APPLICATION_CREDENTIALS', '/keys/sa.json');
|
|
3282
|
+
});
|
|
3283
|
+
it('matches the provider login by case on POSIX and case-insensitively on Windows', () => {
|
|
3284
|
+
const env = { ...sourceEnv, gh_token: 'lower' };
|
|
3285
|
+
expect(() => buildProviderEnvironment({}, env, 'linux', ['gh_token'], 'copilot'))
|
|
3286
|
+
.toThrow('worker_launch_env_passthrough_credential');
|
|
3287
|
+
expect(buildProviderEnvironment({}, env, 'win32', ['gh_token'], 'copilot')).toHaveProperty('gh_token', 'lower');
|
|
3288
|
+
});
|
|
3289
|
+
it('names the key, the provider and the allowed logins in the error', () => {
|
|
3290
|
+
expect(() => assertEnvPassthroughAllowed('copilot', { OMC_TEAM_WORKER_ENV_PASSTHROUGH: 'PATH, NPM_TOKEN' }, 'linux'))
|
|
3291
|
+
.toThrow(/^worker_launch_env_passthrough_credential: .*NPM_TOKEN for a copilot worker; remove it\..*COPILOT_GITHUB_TOKEN/);
|
|
3292
|
+
expect(() => assertEnvPassthroughAllowed('copilot', { OMC_TEAM_WORKER_ENV_PASSTHROUGH: 'COPILOT_GITHUB_TOKEN,CUSTOM_SETTING' }, 'linux'))
|
|
3293
|
+
.not.toThrow();
|
|
3294
|
+
});
|
|
3295
|
+
it('the supervisor refuses a passthrough credential no provider owns', async () => {
|
|
3296
|
+
const launchAttempt = await attempt();
|
|
3297
|
+
const spec = buildWorkerLaunchBootstrapSpec(launchAttempt, ['codex'], cwd, { platform: 'win32' });
|
|
3298
|
+
expect(() => buildWindowsSupervisorInvocation(spec, { ...sourceEnv, OMC_TEAM_WORKER_ENV_PASSTHROUGH: 'NPM_TOKEN' }))
|
|
3299
|
+
.toThrow('worker_launch_env_passthrough_credential');
|
|
3300
|
+
});
|
|
3301
|
+
it('the supervisor takes the Bedrock switch from the worker env, not only the pane shell env', async () => {
|
|
3302
|
+
const launchAttempt = await attempt('claude');
|
|
3303
|
+
const providerEnv = { CLAUDE_CODE_USE_BEDROCK: '1' };
|
|
3304
|
+
const spec = buildWorkerLaunchBootstrapSpec(launchAttempt, ['claude'], cwd, { platform: 'win32', providerEnv });
|
|
3305
|
+
// The pane shell env (env -i + baseline + passthrough) carries no switch.
|
|
3306
|
+
const paneEnv = { ...sourceEnv, OMC_TEAM_WORKER_ENV_PASSTHROUGH: 'AWS_SECRET_ACCESS_KEY,AWS_REGION' };
|
|
3307
|
+
expect(() => buildWindowsSupervisorInvocation(spec, paneEnv)).not.toThrow('worker_launch_env_passthrough_credential');
|
|
3308
|
+
expect(buildProviderEnvironment(spec.provider_env, paneEnv, 'linux', undefined, 'claude'))
|
|
3309
|
+
.toMatchObject({ CLAUDE_CODE_USE_BEDROCK: '1', AWS_SECRET_ACCESS_KEY: 'aws-secret', AWS_REGION: 'eu-north-1' });
|
|
3310
|
+
expect(() => assertEnvPassthroughAllowed('claude', paneEnv, 'linux', providerEnv)).not.toThrow();
|
|
3311
|
+
});
|
|
3312
|
+
it('the leader refuses before materializing the launch transport', async () => {
|
|
3313
|
+
const launchAttempt = await attempt();
|
|
3314
|
+
vi.stubEnv('OMC_TEAM_WORKER_ENV_PASSTHROUGH', 'NPM_TOKEN');
|
|
3315
|
+
vi.stubEnv('NPM_TOKEN', 'npm-secret');
|
|
3316
|
+
await expect(materializeWorkerLaunchTransport({ attempt: launchAttempt, providerArgv: ['codex'], cwd }))
|
|
3317
|
+
.rejects.toThrow('worker_launch_env_passthrough_credential');
|
|
3318
|
+
expect(existsSync(launchAttempt.bootstrapDescriptorPath)).toBe(false);
|
|
3319
|
+
});
|
|
3320
|
+
});
|
|
3157
3321
|
//# sourceMappingURL=worker-launch-ack.test.js.map
|