@songsid/agend 2.3.5-beta.4 → 2.3.5
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/backend/claude-code.js +16 -3
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/muse.d.ts +3 -1
- package/dist/backend/muse.js +31 -1
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/types.d.ts +12 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/daemon.d.ts +23 -0
- package/dist/daemon.js +114 -8
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.js +7 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +1 -1
- package/dist/instance-lifecycle.js +29 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +7 -7
- package/dist/ui/settings-strings.js +8 -8
- package/dist/ui/shared/web-authorize.js +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/backend/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA8C1C;;;;;;GAMG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,yFAAyF;AACzF,MAAM,OAAO,sBAAuB,SAAQ,mBAAmB;CAAG;AAEl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AC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAAmB,EAAE,KAAa;IACpE,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,kBAAkB,KAAK,uCAAuC,WAAW,0BAA0B,CAAC,CAAC;IACpH,CAAC;AACH,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;AACzC,CAAC"}
|
package/dist/daemon.d.ts
CHANGED
|
@@ -646,6 +646,8 @@ export declare class Daemon extends EventEmitter {
|
|
|
646
646
|
/** Generation/signature fence for safety dialogs while their screen is still visible. */
|
|
647
647
|
private autoResolvedDialogKey;
|
|
648
648
|
private autoResolvedDialogGeneration;
|
|
649
|
+
/** RuntimeDialog.retrySafe: the sends made to the visible dialog of that key, in this spawn (monotonic time of the last). */
|
|
650
|
+
private retrySafeSends;
|
|
649
651
|
/** Per-launch safety phases survive startup handoff, redraws and failed/uncertain key ACKs. */
|
|
650
652
|
private launchDialogClaims;
|
|
651
653
|
/**
|
|
@@ -816,6 +818,8 @@ export declare class Daemon extends EventEmitter {
|
|
|
816
818
|
private pauseAllowStuck;
|
|
817
819
|
private pauseWakeState;
|
|
818
820
|
private pauseWakeTransition;
|
|
821
|
+
/** Includes a pause's pane admission, before it publishes pausing. */
|
|
822
|
+
private pauseAdmissions;
|
|
819
823
|
private modelOverride;
|
|
820
824
|
private recentUserMessages;
|
|
821
825
|
private recentEvents;
|
|
@@ -1533,6 +1537,11 @@ export declare class Daemon extends EventEmitter {
|
|
|
1533
1537
|
/** Why the deferred pause was requested; what its marker records (Phase 2a). */
|
|
1534
1538
|
private pendingPauseReason;
|
|
1535
1539
|
pause(reason?: PauseReason, admission?: CapacityNudgePauseGuard): Promise<void>;
|
|
1540
|
+
private pauseInner;
|
|
1541
|
+
/** Whether an admitted pause or published pause/wake still owns this launch. */
|
|
1542
|
+
get hasPendingPauseWake(): boolean;
|
|
1543
|
+
/** Settle pane admission as well as the published pause/wake transition. */
|
|
1544
|
+
waitForPauseWakeTransition(): Promise<void>;
|
|
1536
1545
|
/** Respawn the CLI in the preserved window and block until its prompt is ready. */
|
|
1537
1546
|
wake(timeoutMs?: number): Promise<void>;
|
|
1538
1547
|
/** A reset baseline must settle before a launch admits new work. */
|
|
@@ -1871,6 +1880,20 @@ export declare class Daemon extends EventEmitter {
|
|
|
1871
1880
|
/** Refresh the separate stdin-blocked observation from one pane capture. */
|
|
1872
1881
|
private updateInputBlockedState;
|
|
1873
1882
|
private hasAutoDialogClaim;
|
|
1883
|
+
/**
|
|
1884
|
+
* RuntimeDialog.retrySafe: may the claimed answer to this dialog — still on screen — be sent again now? Only for a
|
|
1885
|
+
* dialog that declares its keys safe to repeat, within its send budget, and once `afterMs` has passed since the last
|
|
1886
|
+
* send to it in this spawn.
|
|
1887
|
+
*/
|
|
1888
|
+
private retrySafeDue;
|
|
1889
|
+
/**
|
|
1890
|
+
* RuntimeDialog.retrySafe: a send to this dialog is on record in this spawn and the next one is not due (its budget
|
|
1891
|
+
* is spent, or `afterMs` has not passed). Holds even when the one-shot claim was released — a failed or uncertain key
|
|
1892
|
+
* ACK releases it — so the budget can never be bypassed (#3589 review).
|
|
1893
|
+
*/
|
|
1894
|
+
private retrySafeHeld;
|
|
1895
|
+
/** Count one send of a retrySafe dialog's keys (the first one included). */
|
|
1896
|
+
private noteRetrySafeSend;
|
|
1874
1897
|
private claimAutoDialog;
|
|
1875
1898
|
/** Whether a runtime prompt currently owns the pane's stdin. */
|
|
1876
1899
|
isInputBlocked(): boolean;
|
package/dist/daemon.js
CHANGED
|
@@ -1380,6 +1380,8 @@ export class Daemon extends EventEmitter {
|
|
|
1380
1380
|
/** Generation/signature fence for safety dialogs while their screen is still visible. */
|
|
1381
1381
|
autoResolvedDialogKey = null;
|
|
1382
1382
|
autoResolvedDialogGeneration = 0;
|
|
1383
|
+
/** RuntimeDialog.retrySafe: the sends made to the visible dialog of that key, in this spawn (monotonic time of the last). */
|
|
1384
|
+
retrySafeSends = null;
|
|
1383
1385
|
/** Per-launch safety phases survive startup handoff, redraws and failed/uncertain key ACKs. */
|
|
1384
1386
|
launchDialogClaims = null;
|
|
1385
1387
|
/**
|
|
@@ -1581,6 +1583,8 @@ export class Daemon extends EventEmitter {
|
|
|
1581
1583
|
pauseAllowStuck = false;
|
|
1582
1584
|
pauseWakeState = "active";
|
|
1583
1585
|
pauseWakeTransition = null;
|
|
1586
|
+
/** Includes a pause's pane admission, before it publishes pausing. */
|
|
1587
|
+
pauseAdmissions = new Set();
|
|
1584
1588
|
// Model failover: override model on next spawn when rate-limited
|
|
1585
1589
|
modelOverride;
|
|
1586
1590
|
// Context rotation v3: ring buffers for daemon-side snapshot
|
|
@@ -4193,9 +4197,11 @@ export class Daemon extends EventEmitter {
|
|
|
4193
4197
|
continue;
|
|
4194
4198
|
}
|
|
4195
4199
|
const autoKey = dialog.autoResolutionKey;
|
|
4196
|
-
if (dialog.verifyAfterKeys && autoKey
|
|
4200
|
+
if (dialog.verifyAfterKeys && autoKey
|
|
4201
|
+
&& ((this.hasAutoDialogClaim(dialog) && !this.retrySafeDue(dialog)) || this.retrySafeHeld(dialog))) {
|
|
4197
4202
|
// A previous poll sent the safety choice but the CLI has not
|
|
4198
|
-
// repainted yet. Never send another Enter into the same screen
|
|
4203
|
+
// repainted yet. Never send another Enter into the same screen
|
|
4204
|
+
// (a retrySafe dialog's keys may be re-sent: retrySafeDue).
|
|
4199
4205
|
continue;
|
|
4200
4206
|
}
|
|
4201
4207
|
// These keys go straight into the pane. Sent while a message delivery is
|
|
@@ -4236,10 +4242,12 @@ export class Daemon extends EventEmitter {
|
|
|
4236
4242
|
// not evidence that the old request was answered, and the one-minute fallback must keep running.
|
|
4237
4243
|
if (this.dialogAnswers?.key === Daemon.answerKey(dialog) && this.dialogAnswers.screen !== before)
|
|
4238
4244
|
this.endDialogEpisode(dialog.requestIdentity !== undefined);
|
|
4239
|
-
if (dialog.verifyAfterKeys && autoKey
|
|
4245
|
+
if (dialog.verifyAfterKeys && autoKey
|
|
4246
|
+
&& ((this.hasAutoDialogClaim(dialog) && !this.retrySafeDue(dialog)) || this.retrySafeHeld(dialog)))
|
|
4240
4247
|
return;
|
|
4241
4248
|
if (dialog.verifyAfterKeys && autoKey)
|
|
4242
4249
|
this.claimAutoDialog(dialog);
|
|
4250
|
+
this.noteRetrySafeSend(dialog);
|
|
4243
4251
|
this.logger.info(Daemon.answerDetailOf(dialog, currentPane), `Auto-dismissing runtime dialog: ${dialog.description}`);
|
|
4244
4252
|
const SPECIAL_KEYS = new Set(["Up", "Down", "Enter", "Escape", "Right", "Left"]);
|
|
4245
4253
|
for (const key of dialog.keys) {
|
|
@@ -5662,6 +5670,17 @@ export class Daemon extends EventEmitter {
|
|
|
5662
5670
|
/** Why the deferred pause was requested; what its marker records (Phase 2a). */
|
|
5663
5671
|
pendingPauseReason = "auth";
|
|
5664
5672
|
async pause(reason = "operator", admission) {
|
|
5673
|
+
const flight = this.pauseInner(reason, admission);
|
|
5674
|
+
const admissions = this.pauseAdmissions ??= new Set();
|
|
5675
|
+
admissions.add(flight);
|
|
5676
|
+
try {
|
|
5677
|
+
await flight;
|
|
5678
|
+
}
|
|
5679
|
+
finally {
|
|
5680
|
+
admissions.delete(flight);
|
|
5681
|
+
}
|
|
5682
|
+
}
|
|
5683
|
+
async pauseInner(reason, admission) {
|
|
5665
5684
|
if (admission && !admission.current())
|
|
5666
5685
|
return;
|
|
5667
5686
|
if (this.pauseWakeState === "paused")
|
|
@@ -5671,7 +5690,7 @@ export class Daemon extends EventEmitter {
|
|
|
5671
5690
|
if (this.getPauseWakeState() !== "active")
|
|
5672
5691
|
return;
|
|
5673
5692
|
}
|
|
5674
|
-
if (admission && !admission.current())
|
|
5693
|
+
if (this.deliveryWritesStopping || this.startupAborted || (admission && !admission.current()))
|
|
5675
5694
|
return;
|
|
5676
5695
|
// `pauseAllowStuck` is consumed here, not merely read: it authorises exactly
|
|
5677
5696
|
// one pause from a stuck pane (the auth-deferred one) and must never leak
|
|
@@ -5704,7 +5723,8 @@ export class Daemon extends EventEmitter {
|
|
|
5704
5723
|
// #1730 P2-2: the await yields — the pane read is only valid for the
|
|
5705
5724
|
// world it was taken from. Revalidate owner, phase, state and queue
|
|
5706
5725
|
// before acting on it; anything that moved defers this cycle.
|
|
5707
|
-
if (
|
|
5726
|
+
if (this.deliveryWritesStopping || this.startupAborted
|
|
5727
|
+
|| (admission && (!admission.current() || pane === null || !admission.accepts(pane)))
|
|
5708
5728
|
|| this.tmux !== tmux
|
|
5709
5729
|
|| this.tmux?.getWindowId?.() !== windowId
|
|
5710
5730
|
|| this.spawnGeneration !== generation
|
|
@@ -5779,6 +5799,17 @@ export class Daemon extends EventEmitter {
|
|
|
5779
5799
|
this.pauseWakeTransition = null;
|
|
5780
5800
|
}
|
|
5781
5801
|
}
|
|
5802
|
+
/** Whether an admitted pause or published pause/wake still owns this launch. */
|
|
5803
|
+
get hasPendingPauseWake() {
|
|
5804
|
+
return !!this.pauseAdmissions?.size
|
|
5805
|
+
|| !!this.pauseWakeTransition && (this.pauseWakeState === "pausing" || this.pauseWakeState === "waking");
|
|
5806
|
+
}
|
|
5807
|
+
/** Settle pane admission as well as the published pause/wake transition. */
|
|
5808
|
+
async waitForPauseWakeTransition() {
|
|
5809
|
+
while (this.hasPendingPauseWake) {
|
|
5810
|
+
await Promise.all([...this.pauseAdmissions ?? [], ...(this.pauseWakeTransition ? [this.pauseWakeTransition] : [])]);
|
|
5811
|
+
}
|
|
5812
|
+
}
|
|
5782
5813
|
/** Respawn the CLI in the preserved window and block until its prompt is ready. */
|
|
5783
5814
|
async wake(timeoutMs = 30_000) {
|
|
5784
5815
|
this.assertSessionOomAdmission();
|
|
@@ -8626,6 +8657,9 @@ export class Daemon extends EventEmitter {
|
|
|
8626
8657
|
this.autoResolvedDialogKey = null;
|
|
8627
8658
|
this.autoResolvedDialogGeneration = 0;
|
|
8628
8659
|
}
|
|
8660
|
+
// A retrySafe dialog that is gone and comes back (Claude's idle cold-resume timer) is a new episode: a fresh budget.
|
|
8661
|
+
if (!active)
|
|
8662
|
+
this.retrySafeSends = null;
|
|
8629
8663
|
return active;
|
|
8630
8664
|
}
|
|
8631
8665
|
hasAutoDialogClaim(dialog) {
|
|
@@ -8639,6 +8673,40 @@ export class Daemon extends EventEmitter {
|
|
|
8639
8673
|
}
|
|
8640
8674
|
return this.autoResolvedDialogGeneration === this.spawnGeneration && this.autoResolvedDialogKey === key;
|
|
8641
8675
|
}
|
|
8676
|
+
/**
|
|
8677
|
+
* RuntimeDialog.retrySafe: may the claimed answer to this dialog — still on screen — be sent again now? Only for a
|
|
8678
|
+
* dialog that declares its keys safe to repeat, within its send budget, and once `afterMs` has passed since the last
|
|
8679
|
+
* send to it in this spawn.
|
|
8680
|
+
*/
|
|
8681
|
+
retrySafeDue(dialog) {
|
|
8682
|
+
const retry = dialog.retrySafe, key = dialog.autoResolutionKey;
|
|
8683
|
+
if (!retry || !key || dialog.oncePerLaunch || !dialog.verifyAfterKeys)
|
|
8684
|
+
return false;
|
|
8685
|
+
const sends = this.retrySafeSends;
|
|
8686
|
+
if (!sends || sends.key !== key || sends.spawn !== this.spawnGeneration)
|
|
8687
|
+
return false; // no send of ours to repeat
|
|
8688
|
+
return sends.count < retry.max && performance.now() - sends.lastMono >= retry.afterMs;
|
|
8689
|
+
}
|
|
8690
|
+
/**
|
|
8691
|
+
* RuntimeDialog.retrySafe: a send to this dialog is on record in this spawn and the next one is not due (its budget
|
|
8692
|
+
* is spent, or `afterMs` has not passed). Holds even when the one-shot claim was released — a failed or uncertain key
|
|
8693
|
+
* ACK releases it — so the budget can never be bypassed (#3589 review).
|
|
8694
|
+
*/
|
|
8695
|
+
retrySafeHeld(dialog) {
|
|
8696
|
+
const key = dialog.autoResolutionKey, sends = this.retrySafeSends;
|
|
8697
|
+
if (!dialog.retrySafe || !key || !sends || sends.key !== key || sends.spawn !== this.spawnGeneration)
|
|
8698
|
+
return false;
|
|
8699
|
+
return !this.retrySafeDue(dialog);
|
|
8700
|
+
}
|
|
8701
|
+
/** Count one send of a retrySafe dialog's keys (the first one included). */
|
|
8702
|
+
noteRetrySafeSend(dialog) {
|
|
8703
|
+
const key = dialog.autoResolutionKey;
|
|
8704
|
+
if (!dialog.retrySafe || !key)
|
|
8705
|
+
return;
|
|
8706
|
+
const sends = this.retrySafeSends;
|
|
8707
|
+
const same = sends !== null && sends.key === key && sends.spawn === this.spawnGeneration;
|
|
8708
|
+
this.retrySafeSends = { key, spawn: this.spawnGeneration, count: (same ? sends.count : 0) + 1, lastMono: performance.now() };
|
|
8709
|
+
}
|
|
8642
8710
|
claimAutoDialog(dialog) {
|
|
8643
8711
|
const key = dialog.autoResolutionKey;
|
|
8644
8712
|
if (!key)
|
|
@@ -10945,7 +11013,32 @@ export class Daemon extends EventEmitter {
|
|
|
10945
11013
|
}
|
|
10946
11014
|
if (proof !== "stranded" || !allowRecoveryEnter)
|
|
10947
11015
|
return false;
|
|
10948
|
-
|
|
11016
|
+
// A retained post-Enter frame can still hold the paste while Codex is already
|
|
11017
|
+
// submitting it. Readiness may stay false for the whole new turn (#3578):
|
|
11018
|
+
// keep asking the same positive judge rather than waiting out its 30s cap.
|
|
11019
|
+
// A strand, output alone or an unreadable frame never stops this wait, and
|
|
11020
|
+
// only actual readiness can authorize the existing recovery Enter below.
|
|
11021
|
+
let waiting = true;
|
|
11022
|
+
const observed = { proof: proof };
|
|
11023
|
+
let ready;
|
|
11024
|
+
try {
|
|
11025
|
+
ready = await this.waitForPaneReadyForDelivery(windowId, STRANDED_RETRY_READY_WAIT_MS, async () => {
|
|
11026
|
+
if (!current())
|
|
11027
|
+
return true;
|
|
11028
|
+
observed.proof = await this.confirmSubmitted(signature, baseline, () => waiting && current());
|
|
11029
|
+
return !current() || observed.proof === "submitted";
|
|
11030
|
+
});
|
|
11031
|
+
}
|
|
11032
|
+
finally {
|
|
11033
|
+
// An in-flight read can outlive the wait deadline. It must not settle a
|
|
11034
|
+
// receipt or retire an input guard after this observation was abandoned.
|
|
11035
|
+
waiting = false;
|
|
11036
|
+
}
|
|
11037
|
+
if (!current())
|
|
11038
|
+
return false;
|
|
11039
|
+
if (observed.proof === "submitted")
|
|
11040
|
+
return true;
|
|
11041
|
+
if (ready !== true)
|
|
10949
11042
|
return false;
|
|
10950
11043
|
proof = await proofNow();
|
|
10951
11044
|
if (!current())
|
|
@@ -13671,12 +13764,17 @@ export class Daemon extends EventEmitter {
|
|
|
13671
13764
|
// Try each startup dialog pattern before checking ready state
|
|
13672
13765
|
let matched = false;
|
|
13673
13766
|
lastDialog = null;
|
|
13767
|
+
// A safety choice already sent whose dialog is still on screen (the CLI dropped the key, or has not repainted
|
|
13768
|
+
// yet): it is never read as ready below — its own menu row can carry the ready glyph (`❯`).
|
|
13769
|
+
let answeredStillVisible = null;
|
|
13674
13770
|
for (const dialog of startupDialogs) {
|
|
13675
13771
|
if (Daemon.dialogMatches(dialog, pane)) {
|
|
13676
13772
|
if (dialog.autoResolutionKey
|
|
13677
|
-
&& (attemptedSafetyChoices.has(dialog.autoResolutionKey)
|
|
13678
|
-
|| this.
|
|
13773
|
+
&& (((attemptedSafetyChoices.has(dialog.autoResolutionKey) || this.hasAutoDialogClaim(dialog))
|
|
13774
|
+
&& !this.retrySafeDue(dialog)) || this.retrySafeHeld(dialog))) {
|
|
13775
|
+
answeredStillVisible ??= dialog;
|
|
13679
13776
|
continue;
|
|
13777
|
+
}
|
|
13680
13778
|
lastDialog = dialog;
|
|
13681
13779
|
this.noteCodexReserveDialog(dialog, pane);
|
|
13682
13780
|
this.noteLiveIncidentDialog(dialog, pane);
|
|
@@ -13750,6 +13848,7 @@ export class Daemon extends EventEmitter {
|
|
|
13750
13848
|
attemptedSafetyChoices.add(dialog.autoResolutionKey);
|
|
13751
13849
|
this.claimAutoDialog(dialog);
|
|
13752
13850
|
}
|
|
13851
|
+
this.noteRetrySafeSend(dialog);
|
|
13753
13852
|
for (const key of dialog.keys) {
|
|
13754
13853
|
this.startupAdmission?.();
|
|
13755
13854
|
// Before every key, synchronously: the lock wait, the capture and the gap after the previous key can
|
|
@@ -13792,6 +13891,13 @@ export class Daemon extends EventEmitter {
|
|
|
13792
13891
|
await sleep();
|
|
13793
13892
|
continue;
|
|
13794
13893
|
}
|
|
13894
|
+
if (answeredStillVisible) {
|
|
13895
|
+
// Answered, still up: wait for it to go (or, for a retrySafe one, for its next send to fall due).
|
|
13896
|
+
lastDialog = answeredStillVisible;
|
|
13897
|
+
cleanReadyPolls = 0;
|
|
13898
|
+
await sleep();
|
|
13899
|
+
continue;
|
|
13900
|
+
}
|
|
13795
13901
|
if (this.dialogParkedSince !== 0 && !this.deliveryBlockingDialogs().some(d => Daemon.dialogMatches(d, pane)))
|
|
13796
13902
|
this.trackDialogParked(null);
|
|
13797
13903
|
// A sign-in screen that carries the ready pattern's own glyph (Claude's
|