ai-whisper 0.4.3 → 0.4.4
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/.tsbuildinfo +1 -0
- package/dist/bin/broker-daemon.d.ts +3 -0
- package/dist/bin/broker-daemon.d.ts.map +1 -0
- package/dist/bin/companion-agent.d.ts +3 -0
- package/dist/bin/companion-agent.d.ts.map +1 -0
- package/dist/bin/relay-monitor.d.ts +3 -0
- package/dist/bin/relay-monitor.d.ts.map +1 -0
- package/dist/bin/whisper.d.ts +3 -0
- package/dist/bin/whisper.d.ts.map +1 -0
- package/dist/bin/whisper.js +130 -92
- package/dist/commands/collab/dashboard.d.ts +18 -0
- package/dist/commands/collab/dashboard.d.ts.map +1 -0
- package/dist/commands/collab/inspect.d.ts +23 -0
- package/dist/commands/collab/inspect.d.ts.map +1 -0
- package/dist/commands/collab/mount.d.ts +54 -0
- package/dist/commands/collab/mount.d.ts.map +1 -0
- package/dist/commands/collab/reconnect.d.ts +44 -0
- package/dist/commands/collab/reconnect.d.ts.map +1 -0
- package/dist/commands/collab/recover.d.ts +33 -0
- package/dist/commands/collab/recover.d.ts.map +1 -0
- package/dist/commands/collab/relay-monitor.d.ts +21 -0
- package/dist/commands/collab/relay-monitor.d.ts.map +1 -0
- package/dist/commands/collab/start.d.ts +53 -0
- package/dist/commands/collab/start.d.ts.map +1 -0
- package/dist/commands/collab/status.d.ts +6 -0
- package/dist/commands/collab/status.d.ts.map +1 -0
- package/dist/commands/collab/stop.d.ts +13 -0
- package/dist/commands/collab/stop.d.ts.map +1 -0
- package/dist/commands/collab/tell.d.ts +26 -0
- package/dist/commands/collab/tell.d.ts.map +1 -0
- package/dist/commands/skill/install.d.ts +12 -0
- package/dist/commands/skill/install.d.ts.map +1 -0
- package/dist/commands/workflow/cancel.d.ts +14 -0
- package/dist/commands/workflow/cancel.d.ts.map +1 -0
- package/dist/commands/workflow/inspect.d.ts +40 -0
- package/dist/commands/workflow/inspect.d.ts.map +1 -0
- package/dist/commands/workflow/list.d.ts +27 -0
- package/dist/commands/workflow/list.d.ts.map +1 -0
- package/dist/commands/workflow/pause.d.ts +14 -0
- package/dist/commands/workflow/pause.d.ts.map +1 -0
- package/dist/commands/workflow/resume.d.ts +17 -0
- package/dist/commands/workflow/resume.d.ts.map +1 -0
- package/dist/commands/workflow/start.d.ts +60 -0
- package/dist/commands/workflow/start.d.ts.map +1 -0
- package/dist/commands/workflow/types.d.ts +2 -0
- package/dist/commands/workflow/types.d.ts.map +1 -0
- package/dist/create-cli.d.ts +4 -0
- package/dist/create-cli.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/runtime/action-inference.d.ts +3 -0
- package/dist/runtime/action-inference.d.ts.map +1 -0
- package/dist/runtime/artifact-input.d.ts +2 -0
- package/dist/runtime/artifact-input.d.ts.map +1 -0
- package/dist/runtime/assistant-turn-capture.d.ts +14 -0
- package/dist/runtime/assistant-turn-capture.d.ts.map +1 -0
- package/dist/runtime/bracketed-paste-detector.d.ts +16 -0
- package/dist/runtime/bracketed-paste-detector.d.ts.map +1 -0
- package/dist/runtime/broker-artifact-service.d.ts +48 -0
- package/dist/runtime/broker-artifact-service.d.ts.map +1 -0
- package/dist/runtime/broker-connect.d.ts +9 -0
- package/dist/runtime/broker-connect.d.ts.map +1 -0
- package/dist/runtime/broker-daemon.d.ts +25 -0
- package/dist/runtime/broker-daemon.d.ts.map +1 -0
- package/dist/runtime/busy-indicator.d.ts +11 -0
- package/dist/runtime/busy-indicator.d.ts.map +1 -0
- package/dist/runtime/capture-handback-text.d.ts +39 -0
- package/dist/runtime/capture-handback-text.d.ts.map +1 -0
- package/dist/runtime/clipboard-change-count.d.ts +12 -0
- package/dist/runtime/clipboard-change-count.d.ts.map +1 -0
- package/dist/runtime/clipboard-handback-capture.d.ts +13 -0
- package/dist/runtime/clipboard-handback-capture.d.ts.map +1 -0
- package/dist/runtime/collab-resolver.d.ts +36 -0
- package/dist/runtime/collab-resolver.d.ts.map +1 -0
- package/dist/runtime/companion-agent-loop.d.ts +13 -0
- package/dist/runtime/companion-agent-loop.d.ts.map +1 -0
- package/dist/runtime/context-injector.d.ts +20 -0
- package/dist/runtime/context-injector.d.ts.map +1 -0
- package/dist/runtime/context-policy.d.ts +3 -0
- package/dist/runtime/context-policy.d.ts.map +1 -0
- package/dist/runtime/current-tty.d.ts +2 -0
- package/dist/runtime/current-tty.d.ts.map +1 -0
- package/dist/runtime/dashboard-glyph.d.ts +12 -0
- package/dist/runtime/dashboard-glyph.d.ts.map +1 -0
- package/dist/runtime/dashboard-state.d.ts +182 -0
- package/dist/runtime/dashboard-state.d.ts.map +1 -0
- package/dist/runtime/dashboard-view.d.ts +34 -0
- package/dist/runtime/dashboard-view.d.ts.map +1 -0
- package/dist/runtime/dashboard.d.ts +46 -0
- package/dist/runtime/dashboard.d.ts.map +1 -0
- package/dist/runtime/evaluator-config.d.ts +21 -0
- package/dist/runtime/evaluator-config.d.ts.map +1 -0
- package/dist/runtime/evaluator-observer.d.ts +8 -0
- package/dist/runtime/evaluator-observer.d.ts.map +1 -0
- package/dist/runtime/id-factory.d.ts +5 -0
- package/dist/runtime/id-factory.d.ts.map +1 -0
- package/dist/runtime/launcher.d.ts +39 -0
- package/dist/runtime/launcher.d.ts.map +1 -0
- package/dist/runtime/live-session-broker-executor.d.ts +8 -0
- package/dist/runtime/live-session-broker-executor.d.ts.map +1 -0
- package/dist/runtime/live-session.d.ts +25 -0
- package/dist/runtime/live-session.d.ts.map +1 -0
- package/dist/runtime/load-dot-env.d.ts +6 -0
- package/dist/runtime/load-dot-env.d.ts.map +1 -0
- package/dist/runtime/local-multiline-composer.d.ts +23 -0
- package/dist/runtime/local-multiline-composer.d.ts.map +1 -0
- package/dist/runtime/mount-session-main.d.ts +44 -0
- package/dist/runtime/mount-session-main.d.ts.map +1 -0
- package/dist/runtime/mounted-turn-owned-relay.d.ts +160 -0
- package/dist/runtime/mounted-turn-owned-relay.d.ts.map +1 -0
- package/dist/runtime/on-demand-processing.d.ts +23 -0
- package/dist/runtime/on-demand-processing.d.ts.map +1 -0
- package/dist/runtime/operator-inspect-captures.d.ts +6 -0
- package/dist/runtime/operator-inspect-captures.d.ts.map +1 -0
- package/dist/runtime/operator-inspect-verdicts.d.ts +6 -0
- package/dist/runtime/operator-inspect-verdicts.d.ts.map +1 -0
- package/dist/runtime/operator-inspect.d.ts +137 -0
- package/dist/runtime/operator-inspect.d.ts.map +1 -0
- package/dist/runtime/paths.d.ts +2 -0
- package/dist/runtime/paths.d.ts.map +1 -0
- package/dist/runtime/port-allocator.d.ts +7 -0
- package/dist/runtime/port-allocator.d.ts.map +1 -0
- package/dist/runtime/port-utils.d.ts +3 -0
- package/dist/runtime/port-utils.d.ts.map +1 -0
- package/dist/runtime/process-start-time.d.ts +7 -0
- package/dist/runtime/process-start-time.d.ts.map +1 -0
- package/dist/runtime/provider-submit-strategy.d.ts +13 -0
- package/dist/runtime/provider-submit-strategy.d.ts.map +1 -0
- package/dist/runtime/providers.d.ts +17 -0
- package/dist/runtime/providers.d.ts.map +1 -0
- package/dist/runtime/record-evaluator-status.d.ts +9 -0
- package/dist/runtime/record-evaluator-status.d.ts.map +1 -0
- package/dist/runtime/recovery-guard.d.ts +12 -0
- package/dist/runtime/recovery-guard.d.ts.map +1 -0
- package/dist/runtime/relay-directive.d.ts +4 -0
- package/dist/runtime/relay-directive.d.ts.map +1 -0
- package/dist/runtime/relay-line-buffer.d.ts +22 -0
- package/dist/runtime/relay-line-buffer.d.ts.map +1 -0
- package/dist/runtime/relay-monitor.d.ts +26 -0
- package/dist/runtime/relay-monitor.d.ts.map +1 -0
- package/dist/runtime/relay-orchestrator-evaluator.d.ts +160 -0
- package/dist/runtime/relay-orchestrator-evaluator.d.ts.map +1 -0
- package/dist/runtime/relay-orchestrator.d.ts +116 -0
- package/dist/runtime/relay-orchestrator.d.ts.map +1 -0
- package/dist/runtime/relay-pane-writer.d.ts +28 -0
- package/dist/runtime/relay-pane-writer.d.ts.map +1 -0
- package/dist/runtime/relay-service.d.ts +76 -0
- package/dist/runtime/relay-service.d.ts.map +1 -0
- package/dist/runtime/relay-view-input.d.ts +17 -0
- package/dist/runtime/relay-view-input.d.ts.map +1 -0
- package/dist/runtime/relay-view-state.d.ts +86 -0
- package/dist/runtime/relay-view-state.d.ts.map +1 -0
- package/dist/runtime/relay-view.d.ts +16 -0
- package/dist/runtime/relay-view.d.ts.map +1 -0
- package/dist/runtime/reply-wait.d.ts +21 -0
- package/dist/runtime/reply-wait.d.ts.map +1 -0
- package/dist/runtime/runtime-debug-log.d.ts +7 -0
- package/dist/runtime/runtime-debug-log.d.ts.map +1 -0
- package/dist/runtime/state-root.d.ts +3 -0
- package/dist/runtime/state-root.d.ts.map +1 -0
- package/dist/runtime/terminal-input-normalizer.d.ts +11 -0
- package/dist/runtime/terminal-input-normalizer.d.ts.map +1 -0
- package/dist/runtime/theme.d.ts +15 -0
- package/dist/runtime/theme.d.ts.map +1 -0
- package/dist/runtime/version-check.d.ts +17 -0
- package/dist/runtime/version-check.d.ts.map +1 -0
- package/dist/runtime/wait-for-broker-ready.d.ts +13 -0
- package/dist/runtime/wait-for-broker-ready.d.ts.map +1 -0
- package/dist/runtime/workspace-id.d.ts +3 -0
- package/dist/runtime/workspace-id.d.ts.map +1 -0
- package/package.json +3 -3
package/dist/bin/whisper.js
CHANGED
|
@@ -9497,6 +9497,10 @@ function createMountedTurnOwnedRelay(input) {
|
|
|
9497
9497
|
}
|
|
9498
9498
|
const STALE_HANDOFF_AFTER_MS = 5 * 6e4;
|
|
9499
9499
|
const HAND_BACK_READY_AFTER_MS = 3e4;
|
|
9500
|
+
const autoHandbackMaxAttempts = Math.max(1, input.autoHandbackMaxAttempts ?? 3);
|
|
9501
|
+
const autoHandbackRetryMs = Math.max(0, input.autoHandbackRetryMs ?? 1e4);
|
|
9502
|
+
const autoHandbackAttempts = /* @__PURE__ */ new Map();
|
|
9503
|
+
let autoHandbackInFlight = false;
|
|
9500
9504
|
let disconnectHandled = false;
|
|
9501
9505
|
let lastOwnerCardKey = null;
|
|
9502
9506
|
let renderedOwnerCardLines = 0;
|
|
@@ -9788,110 +9792,134 @@ ${hint}`,
|
|
|
9788
9792
|
if (accepted === null || autoHandbackFiredFor === accepted.handoffId || (input.isPausedInput?.() ?? false)) {
|
|
9789
9793
|
return;
|
|
9790
9794
|
}
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9795
|
+
const retryState = autoHandbackAttempts.get(accepted.handoffId) ?? {
|
|
9796
|
+
attempts: 0,
|
|
9797
|
+
nextEligibleAt: 0
|
|
9798
|
+
};
|
|
9799
|
+
if (Date.now() < retryState.nextEligibleAt) {
|
|
9800
|
+
return;
|
|
9801
|
+
}
|
|
9802
|
+
if (autoHandbackInFlight) return;
|
|
9803
|
+
autoHandbackInFlight = true;
|
|
9800
9804
|
try {
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9805
|
+
input.turnCapture?.finishAssistantTurn();
|
|
9806
|
+
const turnResult = input.turnCapture?.extractLatestAssistantTurn() ?? { confidence: "low", text: null };
|
|
9807
|
+
console.warn(
|
|
9808
|
+
`[ai-whisper] auto-handback fire: target=${input.currentAgent} handoff=${accepted.handoffId} turnLen=${(turnResult.text ?? "").length} turnConf=${turnResult.confidence}`
|
|
9809
|
+
);
|
|
9810
|
+
let clipboardText = null;
|
|
9811
|
+
let leaseDegraded = false;
|
|
9812
|
+
let interferenceDetected = false;
|
|
9813
|
+
try {
|
|
9814
|
+
const captureResult = await input.captureHandbackText?.(turnResult.text ?? "") ?? null;
|
|
9815
|
+
if (typeof captureResult === "string") {
|
|
9816
|
+
clipboardText = captureResult;
|
|
9817
|
+
} else if (captureResult !== null) {
|
|
9818
|
+
interferenceDetected = captureResult.interferenceDetected;
|
|
9819
|
+
if (captureResult.status === "captured") {
|
|
9820
|
+
clipboardText = captureResult.text;
|
|
9821
|
+
} else {
|
|
9822
|
+
leaseDegraded = true;
|
|
9823
|
+
console.warn(
|
|
9824
|
+
`[ai-whisper] capture lease degraded: target=${input.currentAgent} handoff=${accepted.handoffId} interference=${interferenceDetected} \u2014 /copy was NOT executed; PTY fallback only`
|
|
9825
|
+
);
|
|
9826
|
+
}
|
|
9808
9827
|
} else {
|
|
9809
|
-
leaseDegraded = true;
|
|
9810
9828
|
console.warn(
|
|
9811
|
-
`[ai-whisper] capture
|
|
9829
|
+
`[ai-whisper] capture pipeline returned null: target=${input.currentAgent} handoff=${accepted.handoffId} \u2014 captureHandbackText short-circuited (likely no session claim)`
|
|
9812
9830
|
);
|
|
9813
9831
|
}
|
|
9814
|
-
}
|
|
9832
|
+
} catch (err) {
|
|
9833
|
+
clipboardText = null;
|
|
9834
|
+
const msg = err instanceof Error ? `${err.message}
|
|
9835
|
+
${err.stack ?? ""}` : String(err);
|
|
9815
9836
|
console.warn(
|
|
9816
|
-
`[ai-whisper] capture pipeline
|
|
9837
|
+
`[ai-whisper] capture pipeline threw (swallowed): target=${input.currentAgent} handoff=${accepted.handoffId}
|
|
9838
|
+
${msg}`
|
|
9817
9839
|
);
|
|
9818
9840
|
}
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
)
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9841
|
+
const classification = classifyCapture(turnResult, clipboardText);
|
|
9842
|
+
const captureStatus = classification.status;
|
|
9843
|
+
let requestText = captureStatus === "ok" ? clipboardText ?? "" : "";
|
|
9844
|
+
if (leaseDegraded && (turnResult.text ?? "").trim().length > 0) {
|
|
9845
|
+
requestText = turnResult.text;
|
|
9846
|
+
}
|
|
9847
|
+
const capturedNothing = captureStatus === "no_response_captured";
|
|
9848
|
+
if (capturedNothing && retryState.attempts + 1 < autoHandbackMaxAttempts) {
|
|
9849
|
+
retryState.attempts += 1;
|
|
9850
|
+
retryState.nextEligibleAt = Date.now() + autoHandbackRetryMs;
|
|
9851
|
+
autoHandbackAttempts.set(accepted.handoffId, retryState);
|
|
9852
|
+
console.warn(
|
|
9853
|
+
`[ai-whisper] auto-handback empty capture \u2014 retrying: target=${input.currentAgent} handoff=${accepted.handoffId} attempt=${retryState.attempts}/${autoHandbackMaxAttempts}`
|
|
9854
|
+
);
|
|
9855
|
+
return;
|
|
9856
|
+
}
|
|
9857
|
+
autoHandbackFiredFor = accepted.handoffId;
|
|
9858
|
+
autoHandbackAttempts.delete(accepted.handoffId);
|
|
9859
|
+
const currentAcceptedId = getAcceptedHandoff()?.handoffId;
|
|
9860
|
+
const abortedByRaceGuard = currentAcceptedId !== accepted.handoffId;
|
|
9861
|
+
const handoffMeta = input.broker.control.getHandoffWithWorkflowMeta?.(accepted.handoffId) ?? null;
|
|
9862
|
+
const samplesAllowed = process.env["AI_WHISPER_NO_CAPTURE_SAMPLES"] !== "1";
|
|
9863
|
+
const sampleOf = (text) => {
|
|
9864
|
+
if (text === null) return null;
|
|
9865
|
+
if (!samplesAllowed) return null;
|
|
9866
|
+
return text.slice(0, 200);
|
|
9867
|
+
};
|
|
9868
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
9869
|
+
try {
|
|
9870
|
+
input.broker.control.recordCaptureDiagnostic?.({
|
|
9871
|
+
handoffId: accepted.handoffId,
|
|
9872
|
+
collabId: input.collabId,
|
|
9873
|
+
chainId: handoffMeta?.chainId ?? null,
|
|
9874
|
+
workflowId: handoffMeta?.workflowId ?? null,
|
|
9875
|
+
targetProvider: input.currentAgent,
|
|
9876
|
+
captureStatus,
|
|
9877
|
+
clipLen: (clipboardText ?? "").length,
|
|
9878
|
+
turnLen: (turnResult.text ?? "").length,
|
|
9879
|
+
turnConfidence: turnResult.confidence,
|
|
9880
|
+
jaccardScore: classification.jaccardScore,
|
|
9881
|
+
containmentScore: classification.containmentScore,
|
|
9882
|
+
clipSample: sampleOf(clipboardText),
|
|
9883
|
+
turnSample: sampleOf(turnResult.text),
|
|
9884
|
+
abortedByRaceGuard,
|
|
9885
|
+
interferenceDetected,
|
|
9886
|
+
now
|
|
9887
|
+
});
|
|
9888
|
+
} catch (err) {
|
|
9889
|
+
console.warn(
|
|
9890
|
+
`[ai-whisper] capture diagnostic write failed: ${err instanceof Error ? err.message : String(err)}`
|
|
9891
|
+
);
|
|
9892
|
+
}
|
|
9893
|
+
if (process.env["AI_WHISPER_DEBUG_CAPTURE"]) {
|
|
9894
|
+
const { writeFileSync: writeFileSync3 } = await import("node:fs");
|
|
9895
|
+
writeFileSync3(
|
|
9896
|
+
process.env["AI_WHISPER_DEBUG_CAPTURE"],
|
|
9897
|
+
JSON.stringify({
|
|
9898
|
+
captureStatus,
|
|
9899
|
+
jaccardScore: classification.jaccardScore,
|
|
9900
|
+
containmentScore: classification.containmentScore,
|
|
9901
|
+
turnTextLen: (turnResult.text ?? "").length,
|
|
9902
|
+
clipLen: (clipboardText ?? "").length,
|
|
9903
|
+
turnText: turnResult.text,
|
|
9904
|
+
clipText: clipboardText
|
|
9905
|
+
}, null, 2),
|
|
9906
|
+
"utf8"
|
|
9907
|
+
);
|
|
9908
|
+
}
|
|
9909
|
+
if (abortedByRaceGuard) return;
|
|
9910
|
+
input.broker.control.handoffBackRelay?.({
|
|
9846
9911
|
handoffId: accepted.handoffId,
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9912
|
+
nextHandoffId: `handoff_${now.replace(/[^0-9]/g, "")}`,
|
|
9913
|
+
senderAgent: input.currentAgent,
|
|
9914
|
+
targetAgent: accepted.senderAgent,
|
|
9915
|
+
requestText,
|
|
9851
9916
|
captureStatus,
|
|
9852
|
-
clipLen: (clipboardText ?? "").length,
|
|
9853
|
-
turnLen: (turnResult.text ?? "").length,
|
|
9854
|
-
turnConfidence: turnResult.confidence,
|
|
9855
|
-
jaccardScore: classification.jaccardScore,
|
|
9856
|
-
containmentScore: classification.containmentScore,
|
|
9857
|
-
clipSample: sampleOf(clipboardText),
|
|
9858
|
-
turnSample: sampleOf(turnResult.text),
|
|
9859
|
-
abortedByRaceGuard,
|
|
9860
|
-
interferenceDetected,
|
|
9861
9917
|
now
|
|
9862
9918
|
});
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
);
|
|
9867
|
-
}
|
|
9868
|
-
if (process.env["AI_WHISPER_DEBUG_CAPTURE"]) {
|
|
9869
|
-
const { writeFileSync: writeFileSync3 } = await import("node:fs");
|
|
9870
|
-
writeFileSync3(
|
|
9871
|
-
process.env["AI_WHISPER_DEBUG_CAPTURE"],
|
|
9872
|
-
JSON.stringify({
|
|
9873
|
-
captureStatus,
|
|
9874
|
-
jaccardScore: classification.jaccardScore,
|
|
9875
|
-
containmentScore: classification.containmentScore,
|
|
9876
|
-
turnTextLen: (turnResult.text ?? "").length,
|
|
9877
|
-
clipLen: (clipboardText ?? "").length,
|
|
9878
|
-
turnText: turnResult.text,
|
|
9879
|
-
clipText: clipboardText
|
|
9880
|
-
}, null, 2),
|
|
9881
|
-
"utf8"
|
|
9882
|
-
);
|
|
9919
|
+
input.turnCapture?.reset();
|
|
9920
|
+
} finally {
|
|
9921
|
+
autoHandbackInFlight = false;
|
|
9883
9922
|
}
|
|
9884
|
-
if (abortedByRaceGuard) return;
|
|
9885
|
-
input.broker.control.handoffBackRelay?.({
|
|
9886
|
-
handoffId: accepted.handoffId,
|
|
9887
|
-
nextHandoffId: `handoff_${now.replace(/[^0-9]/g, "")}`,
|
|
9888
|
-
senderAgent: input.currentAgent,
|
|
9889
|
-
targetAgent: accepted.senderAgent,
|
|
9890
|
-
requestText,
|
|
9891
|
-
captureStatus,
|
|
9892
|
-
now
|
|
9893
|
-
});
|
|
9894
|
-
input.turnCapture?.reset();
|
|
9895
9923
|
},
|
|
9896
9924
|
handleOwnerDisconnect() {
|
|
9897
9925
|
if (disconnectHandled) return;
|
|
@@ -10351,6 +10379,10 @@ function resolveCodexSubmitStrategyOverride() {
|
|
|
10351
10379
|
if (raw === "bracketed" || raw === "keystream" || raw === "chunk") return raw;
|
|
10352
10380
|
return void 0;
|
|
10353
10381
|
}
|
|
10382
|
+
function resolvePositiveIntEnv(name) {
|
|
10383
|
+
const n = Number(process.env[name] ?? "");
|
|
10384
|
+
return Number.isFinite(n) && n > 0 ? Math.floor(n) : void 0;
|
|
10385
|
+
}
|
|
10354
10386
|
var readChangeCount = makeChangeCountReader();
|
|
10355
10387
|
function safeReapSessions(input) {
|
|
10356
10388
|
const reap = input.reap ?? ((collabId, agentType, keepSessionId) => {
|
|
@@ -10641,7 +10673,13 @@ function createMountSessionRuntime(input) {
|
|
|
10641
10673
|
return runConfirm();
|
|
10642
10674
|
},
|
|
10643
10675
|
prefillHandbackFromCapture: false,
|
|
10644
|
-
turnCapture
|
|
10676
|
+
turnCapture,
|
|
10677
|
+
autoHandbackMaxAttempts: resolvePositiveIntEnv(
|
|
10678
|
+
"AI_WHISPER_AUTO_HANDBACK_MAX_ATTEMPTS"
|
|
10679
|
+
),
|
|
10680
|
+
autoHandbackRetryMs: resolvePositiveIntEnv(
|
|
10681
|
+
"AI_WHISPER_AUTO_HANDBACK_RETRY_MS"
|
|
10682
|
+
)
|
|
10645
10683
|
});
|
|
10646
10684
|
const mountedTurnRelay = turnRelay;
|
|
10647
10685
|
interactiveSession.onExit(() => {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type BrokerLike = {
|
|
2
|
+
stop: () => Promise<void>;
|
|
3
|
+
};
|
|
4
|
+
type RuntimeLike = {
|
|
5
|
+
start: () => void;
|
|
6
|
+
stop: () => Promise<void>;
|
|
7
|
+
waitUntilStopped: () => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export declare function runCollabDashboard(input?: {
|
|
10
|
+
stdout?: NodeJS.WritableStream;
|
|
11
|
+
/** Eligible-collab window in ms (overrides env + default). */
|
|
12
|
+
windowMs?: number;
|
|
13
|
+
__createBroker?: () => BrokerLike;
|
|
14
|
+
__createRuntime?: (broker: BrokerLike, dashboardId: string, stdout: NodeJS.WritableStream) => RuntimeLike;
|
|
15
|
+
__noSignals?: boolean;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/dashboard.ts"],"names":[],"mappings":"AAKA,KAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAChD,KAAK,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,KAAK,CAAC,EAAE;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,UAAU,CAAC;IAClC,eAAe,CAAC,EAAE,CACjB,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,CAAC,cAAc,KACzB,WAAW,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,iBAsDA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type CapturesArg = true | string;
|
|
2
|
+
export type VerdictsArg = true | string;
|
|
3
|
+
type BrokerAssessor = (input: {
|
|
4
|
+
host: string;
|
|
5
|
+
port: number;
|
|
6
|
+
pid: number;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
ok: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function runCollabInspect(input: {
|
|
11
|
+
cwd: string;
|
|
12
|
+
collabIdOverride?: string;
|
|
13
|
+
now: string;
|
|
14
|
+
watch: boolean;
|
|
15
|
+
captures?: CapturesArg;
|
|
16
|
+
verdicts?: VerdictsArg;
|
|
17
|
+
assessBroker?: BrokerAssessor;
|
|
18
|
+
write?: (chunk: string) => void;
|
|
19
|
+
sleep?: (ms: number) => Promise<void>;
|
|
20
|
+
watchIntervalMs?: number;
|
|
21
|
+
}): Promise<string | null>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/inspect.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AAKxC,KAAK,cAAc,GAAG,CAAC,KAAK,EAAE;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ,KAAK,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE/B,wBAAsB,gBAAgB,CAAC,KAAK,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB,0BA4JA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { assessBrokerDaemon } from "../../runtime/broker-daemon.js";
|
|
2
|
+
import { createMountSessionRuntime } from "../../runtime/mount-session-main.js";
|
|
3
|
+
import { runCollabRecover } from "./recover.js";
|
|
4
|
+
import { runCollabStart } from "./start.js";
|
|
5
|
+
export declare function recordMountedSession(input: {
|
|
6
|
+
cwd: string;
|
|
7
|
+
agentType: "codex" | "claude";
|
|
8
|
+
ttyPath: string;
|
|
9
|
+
pid: number;
|
|
10
|
+
collabIdOverride?: string;
|
|
11
|
+
}): void;
|
|
12
|
+
export declare function runCollabMount(input: {
|
|
13
|
+
workspaceRoot: string;
|
|
14
|
+
collabIdOverride?: string;
|
|
15
|
+
target: "codex" | "claude";
|
|
16
|
+
/**
|
|
17
|
+
* Args forwarded after `--` to the visible agent binary spawn
|
|
18
|
+
* (e.g. `mount codex -- --full-auto --model gpt-5`). Threaded to
|
|
19
|
+
* createInteractiveSessionForTarget only — the relay/companion provider
|
|
20
|
+
* side is unaffected. Defaults to []. No shell escaping; the CLI relies
|
|
21
|
+
* on commander 13's variadic positional to yield a clean string[].
|
|
22
|
+
*/
|
|
23
|
+
passthroughArgs?: string[];
|
|
24
|
+
now: string;
|
|
25
|
+
resolveCurrentTty?: () => string;
|
|
26
|
+
createRuntime?: typeof createMountSessionRuntime;
|
|
27
|
+
assessBroker?: typeof assessBrokerDaemon;
|
|
28
|
+
/**
|
|
29
|
+
* Test seam: override the auto-create call. Defaults to runCollabStart.
|
|
30
|
+
* Used in tests to simulate a parallel mount winning the create race.
|
|
31
|
+
*/
|
|
32
|
+
runStartFn?: typeof runCollabStart;
|
|
33
|
+
/**
|
|
34
|
+
* Test seam: override the pid liveness check used when deciding whether a
|
|
35
|
+
* "bound" binding has a live owner. Defaults to defaultIsPidAlive.
|
|
36
|
+
*/
|
|
37
|
+
isPidAlive?: (pid: number) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Test seam: override the daemon-revive call used to transparently re-adopt
|
|
40
|
+
* an existing active collab whose daemon is dead. Defaults to runCollabRecover.
|
|
41
|
+
*/
|
|
42
|
+
runRecoverFn?: typeof runCollabRecover;
|
|
43
|
+
/**
|
|
44
|
+
* Test seam: liveness probe for the resolved collab's DAEMON pid. The
|
|
45
|
+
* resolver treats any non-null pid as "live" (it does not call
|
|
46
|
+
* process.kill), so a stale non-null pid left behind by a crashed/restarted
|
|
47
|
+
* daemon would otherwise be reused as if healthy. mount probes the daemon
|
|
48
|
+
* pid here and, when dead, transparently re-adopts via recover. Defaults to
|
|
49
|
+
* defaultIsPidAlive. NOTE: distinct from `isPidAlive`, which probes the
|
|
50
|
+
* mounted session-attachment owner pid.
|
|
51
|
+
*/
|
|
52
|
+
isDaemonPidAlive?: (pid: number) => boolean;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/mount.ts"],"names":[],"mappings":"AASA,OAAO,EACN,kBAAkB,EAElB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAOhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAY5C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,IAAI,CAyBP;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,MAAM,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACjD,YAAY,CAAC,EAAE,OAAO,kBAAkB,CAAC;IACzC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,cAAc,CAAC;IACnC;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACtC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,gBAAgB,CAAC;IACvC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C,iBAoPA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type BrokerRuntime } from "@ai-whisper/broker";
|
|
2
|
+
export interface ReattachableSession {
|
|
3
|
+
agentType: "codex" | "claude";
|
|
4
|
+
attachmentKind: "mounted" | "adopted";
|
|
5
|
+
ttyPath: string;
|
|
6
|
+
pid: number | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function listReattachableSessions(input: {
|
|
9
|
+
cwd: string;
|
|
10
|
+
collabIdOverride?: string;
|
|
11
|
+
}): ReattachableSession[];
|
|
12
|
+
export declare function runCollabReconnect(input: {
|
|
13
|
+
workspaceRoot: string;
|
|
14
|
+
collabIdOverride?: string;
|
|
15
|
+
target: "codex" | "claude";
|
|
16
|
+
now: string;
|
|
17
|
+
resolveCurrentTty?: () => string;
|
|
18
|
+
startMountedSession?: (input: {
|
|
19
|
+
target: "codex" | "claude";
|
|
20
|
+
workspaceRoot: string;
|
|
21
|
+
ttyPath: string;
|
|
22
|
+
claimId: string;
|
|
23
|
+
secret: string;
|
|
24
|
+
broker: BrokerRuntime;
|
|
25
|
+
}) => Promise<void>;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
mode: "mounted";
|
|
28
|
+
claim: {
|
|
29
|
+
status: "pending" | "consumed" | "expired" | "replaced";
|
|
30
|
+
version: 1;
|
|
31
|
+
collabId: string;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
claimId: string;
|
|
34
|
+
agentType: "codex" | "claude";
|
|
35
|
+
mode: "attach" | "rebind" | "reconnect";
|
|
36
|
+
targetMode: "snippet_shell" | "adopt_current_tty" | "explicit_tty" | "mount_current_tty";
|
|
37
|
+
targetTtyPath: string | null;
|
|
38
|
+
secret: string;
|
|
39
|
+
expiresAt: string;
|
|
40
|
+
consumedAt: string | null;
|
|
41
|
+
};
|
|
42
|
+
ttyPath: string;
|
|
43
|
+
}>;
|
|
44
|
+
//# sourceMappingURL=reconnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconnect.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/reconnect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAM3F,MAAM,WAAW,mBAAmB;IACnC,SAAS,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC9B,cAAc,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,mBAAmB,EAAE,CAyBxB;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,MAAM,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC7B,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC;QAC3B,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,aAAa,CAAC;KACtB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;;;;;;;;;;;;;;;;;GAmFA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type IsAliveResult } from "@ai-whisper/broker";
|
|
2
|
+
export interface CollabRecoverResult {
|
|
3
|
+
collabId: string;
|
|
4
|
+
host: string;
|
|
5
|
+
port: number;
|
|
6
|
+
pid: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CollabRecoverOpts {
|
|
9
|
+
cwd: string;
|
|
10
|
+
collabIdOverride?: string;
|
|
11
|
+
explicitPort?: number;
|
|
12
|
+
portRange?: readonly [number, number];
|
|
13
|
+
now: () => string;
|
|
14
|
+
isPortFreeOs: (port: number) => Promise<boolean>;
|
|
15
|
+
isAlive?: (pid: number) => Promise<IsAliveResult>;
|
|
16
|
+
spawnBroker: (input: {
|
|
17
|
+
collabId: string;
|
|
18
|
+
host: string;
|
|
19
|
+
port: number;
|
|
20
|
+
sqlitePath: string;
|
|
21
|
+
}) => number;
|
|
22
|
+
waitForReady: (input: {
|
|
23
|
+
host: string;
|
|
24
|
+
port: number;
|
|
25
|
+
collabId: string;
|
|
26
|
+
timeoutMs: number;
|
|
27
|
+
}) => Promise<boolean>;
|
|
28
|
+
signalProcess: (pid: number, signal: "SIGTERM" | "SIGKILL") => void;
|
|
29
|
+
readyTimeoutMs?: number;
|
|
30
|
+
staleThresholdMs?: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function runCollabRecover(opts: CollabRecoverOpts): Promise<CollabRecoverResult>;
|
|
33
|
+
//# sourceMappingURL=recover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recover.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/recover.ts"],"names":[],"mappings":"AAAA,OAAO,EAQN,KAAK,aAAa,EAClB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAClD,WAAW,EAAE,CAAC,KAAK,EAAE;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;KACnB,KAAK,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,KAAK,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KAClB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAgBD,wBAAsB,gBAAgB,CACrC,IAAI,EAAE,iBAAiB,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAiO9B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { assessBrokerDaemon } from "../../runtime/broker-daemon.js";
|
|
2
|
+
export interface RelayMonitorTargets {
|
|
3
|
+
collabId: string;
|
|
4
|
+
sqlitePath: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveRelayMonitorTargets(input: {
|
|
7
|
+
cwd: string;
|
|
8
|
+
collabIdOverride?: string;
|
|
9
|
+
}): RelayMonitorTargets;
|
|
10
|
+
export declare function runCollabRelayMonitor(input: {
|
|
11
|
+
cwd: string;
|
|
12
|
+
collabIdOverride?: string;
|
|
13
|
+
assessBroker?: typeof assessBrokerDaemon;
|
|
14
|
+
brokerEnv?: {
|
|
15
|
+
sqlitePath: string;
|
|
16
|
+
host: string;
|
|
17
|
+
port: number;
|
|
18
|
+
collabId: string;
|
|
19
|
+
};
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=relay-monitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-monitor.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/relay-monitor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAKpE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,mBAAmB,CAetB;AAED,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,kBAAkB,CAAC;IACzC,SAAS,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CACjF,iBAuEA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { LaunchMode, LaunchResult } from "../../runtime/launcher.js";
|
|
2
|
+
export interface CollabStartResult {
|
|
3
|
+
collabId: string;
|
|
4
|
+
port: number;
|
|
5
|
+
host: string;
|
|
6
|
+
pid: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CollabStartOpts {
|
|
9
|
+
cwd: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
launchMode: LaunchMode;
|
|
12
|
+
tmuxSession?: string;
|
|
13
|
+
explicitPort?: number;
|
|
14
|
+
portRange?: readonly [number, number];
|
|
15
|
+
now: () => string;
|
|
16
|
+
isPortFreeOs: (port: number) => Promise<boolean>;
|
|
17
|
+
spawnBroker: (input: {
|
|
18
|
+
collabId: string;
|
|
19
|
+
host: string;
|
|
20
|
+
port: number;
|
|
21
|
+
sqlitePath: string;
|
|
22
|
+
}) => number;
|
|
23
|
+
waitForReady: (input: {
|
|
24
|
+
host: string;
|
|
25
|
+
port: number;
|
|
26
|
+
collabId: string;
|
|
27
|
+
timeoutMs: number;
|
|
28
|
+
}) => Promise<boolean>;
|
|
29
|
+
signalProcess: (pid: number, signal: "SIGTERM" | "SIGKILL") => void;
|
|
30
|
+
readyTimeoutMs?: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function runCollabStart(opts: CollabStartOpts): Promise<CollabStartResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Persists the runtime metadata produced by `launchSessions` so that
|
|
35
|
+
* `whisper collab stop` can tear down what `start` launched. Symmetric
|
|
36
|
+
* with `recordMountedSession` in mount.ts.
|
|
37
|
+
*
|
|
38
|
+
* - tmux mode: records the deterministic tmux session name on the collab
|
|
39
|
+
* row so stop issues `tmux kill-session`.
|
|
40
|
+
* - terminals mode: records each launched codex/claude window (kind
|
|
41
|
+
* "owned") so stop closes the window and signals the pid. The
|
|
42
|
+
* relay-monitor's terminal window/pid cannot live in
|
|
43
|
+
* `session_attachment` (its PK is `(collab_id, agent_type,
|
|
44
|
+
* attachment_kind)` and `agent_type` is constrained to
|
|
45
|
+
* `codex|claude`), so they are persisted on the `collab` row
|
|
46
|
+
* instead (parallel to `tmux_session`) for stop to tear down.
|
|
47
|
+
*/
|
|
48
|
+
export declare function recordLaunchedSessions(input: {
|
|
49
|
+
collabId: string;
|
|
50
|
+
launchMode: "tmux" | "terminals";
|
|
51
|
+
launch: LaunchResult;
|
|
52
|
+
}): void;
|
|
53
|
+
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/start.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAW1E,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,WAAW,EAAE,CAAC,KAAK,EAAE;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;KACnB,KAAK,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,KAAK,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KAClB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,wBAAsB,cAAc,CACnC,IAAI,EAAE,eAAe,GACnB,OAAO,CAAC,iBAAiB,CAAC,CA2K5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,MAAM,EAAE,YAAY,CAAC;CACrB,GAAG,IAAI,CAsEP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/status.ts"],"names":[],"mappings":"AAUA,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CACf,GAAG,MAAM,CA8DT"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CollabStopOpts {
|
|
2
|
+
cwd: string;
|
|
3
|
+
collabIdOverride?: string;
|
|
4
|
+
now: () => string;
|
|
5
|
+
signalProcess: (pid: number, signal: "SIGTERM" | "SIGKILL") => void;
|
|
6
|
+
/**
|
|
7
|
+
* Runs a shell command for tmux/terminal teardown. Injectable for tests;
|
|
8
|
+
* defaults to a best-effort `execSync` wrapper that swallows failures.
|
|
9
|
+
*/
|
|
10
|
+
execCommand?: (cmd: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function runCollabStop(input: CollabStopOpts): void;
|
|
13
|
+
//# sourceMappingURL=stop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/stop.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,cAAc;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IACpE;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAuBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAoGzD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CompanionProvider, WorkItem } from "@ai-whisper/shared";
|
|
2
|
+
export declare function runCollabTell(input: {
|
|
3
|
+
cwd: string;
|
|
4
|
+
target: "codex" | "claude";
|
|
5
|
+
instruction: string;
|
|
6
|
+
explicitAction?: WorkItem["requestedAction"];
|
|
7
|
+
artifactPaths: string[];
|
|
8
|
+
threadTitle?: string;
|
|
9
|
+
providerOverride?: CompanionProvider;
|
|
10
|
+
now: string;
|
|
11
|
+
collabIdOverride?: string;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
kind: "answer" | "review" | "clarification" | "failure";
|
|
14
|
+
version: 1;
|
|
15
|
+
threadId: string;
|
|
16
|
+
collabId: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
workItemId: string;
|
|
19
|
+
turnIndex: number;
|
|
20
|
+
artifactManifestIds: string[];
|
|
21
|
+
replyId: string;
|
|
22
|
+
sourceSessionId: string;
|
|
23
|
+
content: string;
|
|
24
|
+
transitionIntent: "in_progress" | "awaiting_user" | "completed" | "failed" | null;
|
|
25
|
+
} | null>;
|
|
26
|
+
//# sourceMappingURL=tell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tell.d.ts","sourceRoot":"","sources":["../../../src/commands/collab/tell.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAQtE,wBAAsB,aAAa,CAAC,KAAK,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC7C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;;;;;;;;;;;;;UAiEA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SkillInstallTarget = "claude" | "codex" | "all";
|
|
2
|
+
export interface SkillInstallInput {
|
|
3
|
+
target: SkillInstallTarget;
|
|
4
|
+
force?: boolean;
|
|
5
|
+
fakeHome?: string;
|
|
6
|
+
bundledSkillsDir?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SkillInstallResult {
|
|
9
|
+
installedAt: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function runSkillInstall(input: SkillInstallInput): Promise<SkillInstallResult>;
|
|
12
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/skill/install.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IAClC,WAAW,EAAE,MAAM,EAAE,CAAC;CACtB;AAiBD,wBAAsB,eAAe,CACpC,KAAK,EAAE,iBAAiB,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAuD7B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface WorkflowCancelDeps {
|
|
2
|
+
broker: {
|
|
3
|
+
control: {
|
|
4
|
+
cancelWorkflow: (input: {
|
|
5
|
+
workflowId: string;
|
|
6
|
+
now: string;
|
|
7
|
+
}) => void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
workflowId: string;
|
|
11
|
+
now: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function runWorkflowCancel(deps: WorkflowCancelDeps): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=cancel.d.ts.map
|