orkestrator 2.36.0 → 2.36.2-beta
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/client.js +339 -23
- package/dist/main.js +10532 -4435
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +634 -429
- package/resources/claude-bridge/dist/index.js +548 -147
- package/resources/codex-bridge/dist/index.js +1919 -1260
- package/resources/cursor-bridge/dist/index.js +587 -42
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +738 -103
- package/resources/pi-bridge/runtime/install.json +1 -1
|
@@ -25634,6 +25634,8 @@ function transcriptBoundSummary(state) {
|
|
|
25634
25634
|
var AGENT_MAIL_MAX_BODY_BYTES = 32 * 1024;
|
|
25635
25635
|
var AGENT_MAIL_MAX_STORE_BYTES = 32 * 1024 * 1024;
|
|
25636
25636
|
var AGENT_MAIL_DEFAULT_RETENTION_DAYS = 14;
|
|
25637
|
+
var AGENT_MAIL_MAX_ATTACHMENT_BYTES = 8 * 1024 * 1024;
|
|
25638
|
+
var AGENT_MAIL_MAX_TOTAL_ATTACHMENT_BYTES = 32 * 1024 * 1024;
|
|
25637
25639
|
var AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET = 16;
|
|
25638
25640
|
var AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT = 40;
|
|
25639
25641
|
var AGENT_MAIL_TOOL_NAMES = Object.freeze([
|
|
@@ -25667,6 +25669,9 @@ function agentMailCapabilities(tabType, agent, locked = true) {
|
|
|
25667
25669
|
}
|
|
25668
25670
|
if (tabType === "claude-tmux")
|
|
25669
25671
|
return { canPull: true, canSend: true, canInject: true };
|
|
25672
|
+
if (tabType === "pipeline-worker") {
|
|
25673
|
+
return agent ? { canPull: true, canSend: true, canInject: true } : { canPull: false, canSend: false, canInject: false };
|
|
25674
|
+
}
|
|
25670
25675
|
if (["claude", "codex", "opencode"].includes(tabType)) {
|
|
25671
25676
|
return { canPull: true, canSend: true, canInject: false };
|
|
25672
25677
|
}
|
|
@@ -27704,6 +27709,97 @@ function chargeAppended(state, before, after) {
|
|
|
27704
27709
|
function readText(value) {
|
|
27705
27710
|
return typeof value === "string" ? value : "";
|
|
27706
27711
|
}
|
|
27712
|
+
// ../protocol/src/execution-policy-narrowing.ts
|
|
27713
|
+
var APPROVALS_STRICTNESS = {
|
|
27714
|
+
"auto-approve": 0,
|
|
27715
|
+
ask: 1,
|
|
27716
|
+
deny: 2
|
|
27717
|
+
};
|
|
27718
|
+
var SANDBOX_STRICTNESS = {
|
|
27719
|
+
none: 0,
|
|
27720
|
+
container: 1,
|
|
27721
|
+
provider: 2
|
|
27722
|
+
};
|
|
27723
|
+
function networkStrictness(value) {
|
|
27724
|
+
return value === "restricted" ? 1 : 0;
|
|
27725
|
+
}
|
|
27726
|
+
function isSubset(candidate, of) {
|
|
27727
|
+
const allowed = new Set(of);
|
|
27728
|
+
return candidate.every((item) => allowed.has(item));
|
|
27729
|
+
}
|
|
27730
|
+
function rawCapabilityDenials(policy) {
|
|
27731
|
+
return [
|
|
27732
|
+
...policy.capabilityPolicy?.deny ?? [],
|
|
27733
|
+
...policy.capabilityPolicy?.extendedDeny ?? []
|
|
27734
|
+
];
|
|
27735
|
+
}
|
|
27736
|
+
function executionPolicyWidenings(current, next) {
|
|
27737
|
+
if (!current)
|
|
27738
|
+
return [];
|
|
27739
|
+
const widened = [];
|
|
27740
|
+
if (next.id !== current.id)
|
|
27741
|
+
widened.push("id");
|
|
27742
|
+
if (APPROVALS_STRICTNESS[next.approvals] < APPROVALS_STRICTNESS[current.approvals]) {
|
|
27743
|
+
widened.push("approvals");
|
|
27744
|
+
}
|
|
27745
|
+
if (SANDBOX_STRICTNESS[next.sandbox] < SANDBOX_STRICTNESS[current.sandbox]) {
|
|
27746
|
+
widened.push("sandbox");
|
|
27747
|
+
}
|
|
27748
|
+
if (next.projectResources && !current.projectResources)
|
|
27749
|
+
widened.push("projectResources");
|
|
27750
|
+
if (networkStrictness(next.networkAccess) < networkStrictness(current.networkAccess)) {
|
|
27751
|
+
widened.push("networkAccess");
|
|
27752
|
+
}
|
|
27753
|
+
if (networkStrictness(next.containerNetworkAccess) < networkStrictness(current.containerNetworkAccess)) {
|
|
27754
|
+
widened.push("containerNetworkAccess");
|
|
27755
|
+
}
|
|
27756
|
+
const currentAllow = current.toolPolicy?.allow;
|
|
27757
|
+
const nextAllow = next.toolPolicy?.allow;
|
|
27758
|
+
const allowNarrows = currentAllow === undefined ? nextAllow === undefined || nextAllow.length === 0 : nextAllow !== undefined && isSubset(nextAllow, currentAllow);
|
|
27759
|
+
if (!allowNarrows)
|
|
27760
|
+
widened.push("toolPolicy.allow");
|
|
27761
|
+
if (!isSubset(current.toolPolicy?.deny ?? [], next.toolPolicy?.deny ?? [])) {
|
|
27762
|
+
widened.push("toolPolicy.deny");
|
|
27763
|
+
}
|
|
27764
|
+
if (!isSubset(rawCapabilityDenials(current), rawCapabilityDenials(next))) {
|
|
27765
|
+
widened.push("capabilityPolicy.deny");
|
|
27766
|
+
}
|
|
27767
|
+
if (!isSubset(next.capabilityPolicy?.allow ?? [], current.capabilityPolicy?.allow ?? [])) {
|
|
27768
|
+
widened.push("capabilityPolicy.allow");
|
|
27769
|
+
}
|
|
27770
|
+
const currentServers = nativeAgentUserMcpGrant(current);
|
|
27771
|
+
const nextServers = nativeAgentUserMcpGrant(next);
|
|
27772
|
+
if (currentServers !== undefined && (nextServers === undefined || !isSubset(nextServers, currentServers))) {
|
|
27773
|
+
widened.push("capabilityPolicy.userMcpServers");
|
|
27774
|
+
}
|
|
27775
|
+
return widened;
|
|
27776
|
+
}
|
|
27777
|
+
var POLICY_WIDENING_REFUSED_CODE = "policy-widening-refused";
|
|
27778
|
+
function policyWideningRefusal(widened) {
|
|
27779
|
+
return {
|
|
27780
|
+
error: "Execution policy can only be narrowed on a live session; a wider policy applies after the agent bridge restarts.",
|
|
27781
|
+
code: POLICY_WIDENING_REFUSED_CODE,
|
|
27782
|
+
widened
|
|
27783
|
+
};
|
|
27784
|
+
}
|
|
27785
|
+
|
|
27786
|
+
class PolicyWideningRefusedError extends Error {
|
|
27787
|
+
widened;
|
|
27788
|
+
constructor(widened) {
|
|
27789
|
+
super(policyWideningRefusal(widened).error);
|
|
27790
|
+
this.widened = widened;
|
|
27791
|
+
this.name = "PolicyWideningRefusedError";
|
|
27792
|
+
}
|
|
27793
|
+
refusal() {
|
|
27794
|
+
return policyWideningRefusal(this.widened);
|
|
27795
|
+
}
|
|
27796
|
+
}
|
|
27797
|
+
function assertExecutionPolicyNotWidened(current, next) {
|
|
27798
|
+
const widened = executionPolicyWidenings(current, next);
|
|
27799
|
+
if (widened.length > 0)
|
|
27800
|
+
throw new PolicyWideningRefusedError(widened);
|
|
27801
|
+
}
|
|
27802
|
+
|
|
27707
27803
|
// ../../bridges/cursor-bridge/src/execution-policy.ts
|
|
27708
27804
|
function resolveCursorExecutionPolicy(policy) {
|
|
27709
27805
|
const resolved = policy ?? {
|
|
@@ -27744,6 +27840,9 @@ function resolveCursorExecutionPolicy(policy) {
|
|
|
27744
27840
|
...notes.length > 0 ? { note: notes.join(" ") } : {}
|
|
27745
27841
|
};
|
|
27746
27842
|
}
|
|
27843
|
+
function liveExecutionPolicy(state) {
|
|
27844
|
+
return state.policyPending ? undefined : state.policy;
|
|
27845
|
+
}
|
|
27747
27846
|
function cursorAppliedPolicy(state) {
|
|
27748
27847
|
const sessionPolicy = state.policy;
|
|
27749
27848
|
return resolveCursorExecutionPolicy(state.readOnly ? {
|
|
@@ -28467,6 +28566,16 @@ function logErrorKind(error) {
|
|
|
28467
28566
|
}
|
|
28468
28567
|
|
|
28469
28568
|
// ../protocol/src/log-vocabulary/define.ts
|
|
28569
|
+
var ESSENTIAL_ERROR_FIELDS = {
|
|
28570
|
+
"error.name": "label",
|
|
28571
|
+
"error.code": "label",
|
|
28572
|
+
"error.errno": "number",
|
|
28573
|
+
"error.syscall": "label",
|
|
28574
|
+
"error.exitCode": "number",
|
|
28575
|
+
"error.signal": "label",
|
|
28576
|
+
"error.outputOmitted": "boolean",
|
|
28577
|
+
"error.errorCount": "number"
|
|
28578
|
+
};
|
|
28470
28579
|
var THROTTLE_LOG_EVENTS = {
|
|
28471
28580
|
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
28472
28581
|
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
@@ -28516,7 +28625,11 @@ var BACKEND_LOG_AREAS = defineLogAreas({
|
|
|
28516
28625
|
backend: {
|
|
28517
28626
|
description: "The backend process: startup, background notices and shutdown.",
|
|
28518
28627
|
events: {
|
|
28519
|
-
starting:
|
|
28628
|
+
starting: {
|
|
28629
|
+
description: "The backend process is starting.",
|
|
28630
|
+
essential: true,
|
|
28631
|
+
fields: { version: "label" }
|
|
28632
|
+
},
|
|
28520
28633
|
"ssh-socket.resolved": "An SSH agent socket was found.",
|
|
28521
28634
|
"ssh-socket.missing": "No usable SSH agent socket was found.",
|
|
28522
28635
|
"standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
|
|
@@ -28531,8 +28644,16 @@ var BACKEND_LOG_AREAS = defineLogAreas({
|
|
|
28531
28644
|
"notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
|
|
28532
28645
|
"artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
|
|
28533
28646
|
"shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
|
|
28534
|
-
"shutdown.signal-received":
|
|
28535
|
-
|
|
28647
|
+
"shutdown.signal-received": {
|
|
28648
|
+
description: "A signal started shutdown, which tells a clean quit from the backend being killed.",
|
|
28649
|
+
essential: true,
|
|
28650
|
+
fields: { signal: "label" }
|
|
28651
|
+
},
|
|
28652
|
+
"shutdown.finished": {
|
|
28653
|
+
description: "Shutdown finished, and the process exits with `code`.",
|
|
28654
|
+
essential: true,
|
|
28655
|
+
fields: { code: "number" }
|
|
28656
|
+
},
|
|
28536
28657
|
"port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
|
|
28537
28658
|
"port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
|
|
28538
28659
|
}
|
|
@@ -28575,7 +28696,10 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28575
28696
|
"evidence.record-failed": "Change evidence could not be recorded; the read loop carries on.",
|
|
28576
28697
|
"evidence.shell-record-failed": "A shell observation could not be recorded.",
|
|
28577
28698
|
"evidence.turn-record-failed": "Turn change evidence could not be recorded.",
|
|
28699
|
+
"agent.exited": "An ACP agent process exited, with its `code` and `signal`, always at `warn`. `requested` is true when the bridge closed it normally, false for an unrequested or fault-driven exit.",
|
|
28700
|
+
"http.route-failed": "An HTTP route answered 500; its error message is not logged because it can hold content.",
|
|
28578
28701
|
"server.listening": "The HTTP server is listening.",
|
|
28702
|
+
"session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
|
|
28579
28703
|
"state.composer-reset": "A saved composer state was malformed and was reset.",
|
|
28580
28704
|
"state.discarded": "Saved bridge state could not be used and was discarded.",
|
|
28581
28705
|
"state.persist-failed": "Saving bridge state failed; a later write retries.",
|
|
@@ -28629,7 +28753,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28629
28753
|
"session.created": "A session was created or recovered.",
|
|
28630
28754
|
"session.delete-failed": "Deleting a session failed.",
|
|
28631
28755
|
"session.fork-failed": "Forking a session failed.",
|
|
28632
|
-
"session.policy-widening-refused": "A
|
|
28756
|
+
"session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
|
|
28633
28757
|
"session.rename-failed": "Renaming a session failed.",
|
|
28634
28758
|
"session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
|
|
28635
28759
|
"session.rewind-failed": "Rewinding session files failed.",
|
|
@@ -28663,6 +28787,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28663
28787
|
"app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
|
|
28664
28788
|
"app-server.invariant-violation": "app-server asked for something its configuration forbids.",
|
|
28665
28789
|
"app-server.protocol-violation": "app-server wrote a line that is not valid protocol; it was ignored.",
|
|
28790
|
+
"app-server.overflow-restart-failed": "Replacing the child after a notification queue overflow failed; the next request tries again.",
|
|
28666
28791
|
"app-server.recording": "Notification recording is on; recordings hold content.",
|
|
28667
28792
|
"app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
|
|
28668
28793
|
"app-server.stderr": "Metadata of an app-server stderr line, never its content.",
|
|
@@ -28693,6 +28818,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28693
28818
|
"ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
|
|
28694
28819
|
"ordered-events.reconcile-failed": "Reconciling ordered events failed.",
|
|
28695
28820
|
"parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
|
|
28821
|
+
"queue.overflow": "The notification queue passed a bound and dropped its backlog.",
|
|
28696
28822
|
"queue.task-failed": "A task on a per-thread queue failed.",
|
|
28697
28823
|
"raw-log.write-failed": "Appending to the raw Codex log failed.",
|
|
28698
28824
|
"recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
|
|
@@ -28706,6 +28832,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28706
28832
|
"server-request.flush-timeout": "An answer to a server request did not flush in time.",
|
|
28707
28833
|
"server-request.handoff-failed": "Handing a server request to the router threw.",
|
|
28708
28834
|
"session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
|
|
28835
|
+
"session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
|
|
28709
28836
|
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
28710
28837
|
"sse.keepalive-failed": "An event stream keepalive failed.",
|
|
28711
28838
|
"sse.observer-failed": "An event stream observer failed; it reconnects.",
|
|
@@ -28734,19 +28861,39 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28734
28861
|
events: {
|
|
28735
28862
|
"agent.archive-failed": "Archiving or unarchiving an agent failed.",
|
|
28736
28863
|
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
28864
|
+
"session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
|
|
28737
28865
|
"startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
|
|
28738
28866
|
"startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
|
|
28739
28867
|
"state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
|
|
28740
28868
|
"state.publication-recovered": "Saving bridge state recovered.",
|
|
28741
|
-
"state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy."
|
|
28869
|
+
"state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy.",
|
|
28870
|
+
"session.resume-fell-back": {
|
|
28871
|
+
description: "A saved conversation could not be resumed, so a new one started; its error message is not logged because it can hold content.",
|
|
28872
|
+
essential: true,
|
|
28873
|
+
fields: ESSENTIAL_ERROR_FIELDS
|
|
28874
|
+
},
|
|
28875
|
+
"turn.failed": "A turn failed; its error message is not logged because it can hold content. A cancelled turn is not a failure.",
|
|
28876
|
+
"turn.recovery-failed": "A run recovered after a bridge restart ended in failure, or could not be followed. A cancelled run is not a failure.",
|
|
28877
|
+
"turn.send-failed": "Sending a prompt to Cursor failed, so whether its run started is unknown; its error message is not logged because it can hold content.",
|
|
28878
|
+
"turn.timed-out": "A turn outlived its time budget, so its run was asked to cancel; `turn.failed` follows if it never stops."
|
|
28742
28879
|
}
|
|
28743
28880
|
},
|
|
28744
28881
|
"bridge.pi": {
|
|
28745
28882
|
description: "The Pi bridge: its routes, sessions and saved state.",
|
|
28746
28883
|
events: {
|
|
28747
28884
|
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
28885
|
+
"session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
|
|
28886
|
+
"session-list.failed": "Reading the resumable sessions failed, so none were offered; its error message is not logged because it can hold content.",
|
|
28748
28887
|
"state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
|
|
28749
|
-
"state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript."
|
|
28888
|
+
"state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript.",
|
|
28889
|
+
"session.resume-fell-back": {
|
|
28890
|
+
description: "A saved conversation could not be reopened, so a new one started; its error message is not logged because it can hold content.",
|
|
28891
|
+
essential: true,
|
|
28892
|
+
fields: ESSENTIAL_ERROR_FIELDS
|
|
28893
|
+
},
|
|
28894
|
+
"turn.failed": "A turn failed; its error message is not logged because it can hold content. A cancelled turn is not a failure.",
|
|
28895
|
+
"turn.refused": "Pi refused a prompt before starting a run, so nothing ran; its error message is not logged because it can hold content.",
|
|
28896
|
+
"turn.startup-timed-out": "Pi did not start a turn within its startup deadline, so the prompt was abandoned."
|
|
28750
28897
|
}
|
|
28751
28898
|
}
|
|
28752
28899
|
});
|
|
@@ -28757,14 +28904,31 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
28757
28904
|
description: "The Electron main process: startup, windows, quit and the Local backend's life.",
|
|
28758
28905
|
events: {
|
|
28759
28906
|
"backend.docker-context-seed-failed": "An agent-test profile fell back to the default Docker context.",
|
|
28760
|
-
"backend.exited":
|
|
28761
|
-
|
|
28907
|
+
"backend.exited": {
|
|
28908
|
+
description: "The Local backend exited unexpectedly; Local work is unavailable. `error.exitCode` and `error.signal` say how.",
|
|
28909
|
+
essential: true,
|
|
28910
|
+
fields: ESSENTIAL_ERROR_FIELDS
|
|
28911
|
+
},
|
|
28912
|
+
"backend.exited-recovering": {
|
|
28913
|
+
description: "The Local backend exited just after a remote update; relaunching unattended. `error.exitCode` and `error.signal` say how.",
|
|
28914
|
+
essential: true,
|
|
28915
|
+
fields: ESSENTIAL_ERROR_FIELDS
|
|
28916
|
+
},
|
|
28762
28917
|
"backend.keychain-link-remove-failed": "An agent-test profile kept a legacy link to the host keychain.",
|
|
28763
|
-
"backend.start-failed":
|
|
28918
|
+
"backend.start-failed": {
|
|
28919
|
+
description: "The Local backend did not start; continuing with remote machines.",
|
|
28920
|
+
essential: true,
|
|
28921
|
+
fields: ESSENTIAL_ERROR_FIELDS
|
|
28922
|
+
},
|
|
28764
28923
|
"clipboard.write-failed": "Writing text to the system clipboard failed.",
|
|
28765
28924
|
"dev-mode.ignored-packaged": "A packaged app was launched with ELECTRON_DEV=1 and ignored it; it loads its bundled renderer.",
|
|
28766
28925
|
"instance.already-running": "Another instance holds this data directory; this one will quit.",
|
|
28767
|
-
"main-thread.stalled":
|
|
28926
|
+
"main-thread.stalled": {
|
|
28927
|
+
description: "A timer fired late, so windows, IPC and the stdout reader waited.",
|
|
28928
|
+
essential: true,
|
|
28929
|
+
minLevel: "error",
|
|
28930
|
+
fields: { lagMs: "number", intervalMs: "number" }
|
|
28931
|
+
},
|
|
28768
28932
|
"quit.stopping-backend": "The app is quitting and has asked the Local backend to stop.",
|
|
28769
28933
|
"relaunch.schedule-failed": "The AppImage relaunch waiter failed; using Electron's relauncher.",
|
|
28770
28934
|
"relaunch.service-register-failed": "The AppImage relaunch service was refused; using a detached waiter.",
|
|
@@ -28775,7 +28939,11 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
28775
28939
|
"saved-machines.attach-failed": "Saved machines were not imported into the command node yet.",
|
|
28776
28940
|
"saved-machines.attached": "Saved machines were imported into the local command node.",
|
|
28777
28941
|
"startup.failed": "The application failed to start.",
|
|
28778
|
-
"uncaught-exception":
|
|
28942
|
+
"uncaught-exception": {
|
|
28943
|
+
description: "The main process hit an uncaught exception.",
|
|
28944
|
+
essential: true,
|
|
28945
|
+
fields: ESSENTIAL_ERROR_FIELDS
|
|
28946
|
+
},
|
|
28779
28947
|
"uncaught-exception.dialog-failed": "The uncaught exception sheet could not be shown.",
|
|
28780
28948
|
"window.create-failed": "A menu-driven new window could not be created.",
|
|
28781
28949
|
"window.recreate-failed": "The main window could not be recreated on activation.",
|
|
@@ -28798,6 +28966,12 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
28798
28966
|
"unhandled-rejection": "An unhandled rejection occurred while the renderer was starting."
|
|
28799
28967
|
}
|
|
28800
28968
|
},
|
|
28969
|
+
"desktop.permissions": {
|
|
28970
|
+
description: "Permission requests refused on the renderer and workspace realm sessions.",
|
|
28971
|
+
events: {
|
|
28972
|
+
denied: "A renderer asked for a permission the policy does not grant."
|
|
28973
|
+
}
|
|
28974
|
+
},
|
|
28801
28975
|
"desktop.dialog": {
|
|
28802
28976
|
description: "Native dialogs, whose modal loops hold the main thread while they are open.",
|
|
28803
28977
|
events: {
|
|
@@ -28916,6 +29090,8 @@ var GATEWAY_LOG_AREAS = defineLogAreas({
|
|
|
28916
29090
|
"loopback.unavailable": "The loopback client listener could not start.",
|
|
28917
29091
|
"auth-token.stored": "The gateway token's file was written. The path only, never the token.",
|
|
28918
29092
|
"auth-token.persist-failed": "The gateway token could not be saved.",
|
|
29093
|
+
"auth-guess.throttled": "A listener saw enough different wrong tokens that it now pauses new ones. Never the values.",
|
|
29094
|
+
"host.refused": "A request named a host this gateway does not answer to. Logged once per name, up to a limit.",
|
|
28919
29095
|
"port.fallback": "The preferred port was taken, so a nearby one is used.",
|
|
28920
29096
|
"port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
|
|
28921
29097
|
"request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
|
|
@@ -28959,6 +29135,22 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
|
|
|
28959
29135
|
"bridge-runtime.installed": "A bridge runtime finished installing.",
|
|
28960
29136
|
"opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
|
|
28961
29137
|
"server.stopping": "A local server is being stopped, for the fixed `reason` given.",
|
|
29138
|
+
"bridge.started": {
|
|
29139
|
+
description: "A local bridge process was spawned; `key` names its kind and environment.",
|
|
29140
|
+
essential: true,
|
|
29141
|
+
fields: { key: "label", pid: "number" }
|
|
29142
|
+
},
|
|
29143
|
+
"bridge.exited": {
|
|
29144
|
+
description: "A local bridge process exited, with its `code` and `signal`. `warn` when nothing asked it to, whatever the code; `info` when the backend stopped it, which `server.stopping` explains.",
|
|
29145
|
+
essential: true,
|
|
29146
|
+
fields: {
|
|
29147
|
+
key: "label",
|
|
29148
|
+
pid: "number",
|
|
29149
|
+
code: "number",
|
|
29150
|
+
signal: "label",
|
|
29151
|
+
requested: "boolean"
|
|
29152
|
+
}
|
|
29153
|
+
},
|
|
28962
29154
|
"reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
|
|
28963
29155
|
"reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
|
|
28964
29156
|
"reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
|
|
@@ -28992,13 +29184,29 @@ var LOGGING_LOG_AREAS = defineLogAreas({
|
|
|
28992
29184
|
"capture.started": "Saving logs to disk began for this process.",
|
|
28993
29185
|
"capture.stopped": "Saving logs to disk stopped for this process.",
|
|
28994
29186
|
"config.invalid": "A logging environment variable held a value that was ignored.",
|
|
28995
|
-
"entries.dropped":
|
|
29187
|
+
"entries.dropped": {
|
|
29188
|
+
description: "Entries were dropped and counted, for the fixed `reason` given: the queue was full, a write failed or, in the essential log, one event was repeating too fast.",
|
|
29189
|
+
essential: true,
|
|
29190
|
+
fields: { entries: "number", bytes: "number", reason: "label" }
|
|
29191
|
+
},
|
|
29192
|
+
"essential.started": {
|
|
29193
|
+
description: "This process began writing the essential log. One with no `essential.stopped` before it means the last writer died.",
|
|
29194
|
+
essential: true,
|
|
29195
|
+
fields: { owner: "label" }
|
|
29196
|
+
},
|
|
29197
|
+
"essential.stopped": {
|
|
29198
|
+
description: "This process stopped writing the essential log, in an orderly exit.",
|
|
29199
|
+
essential: true,
|
|
29200
|
+
fields: { owner: "label" }
|
|
29201
|
+
},
|
|
29202
|
+
"essential.write-failed": "Writing the essential log failed. Its entries are counted, and a marker reports them at the next write that works.",
|
|
28996
29203
|
"policy.changed": "The logging settings changed: saving, retention and levels, with no content.",
|
|
28997
29204
|
"policy.bridge-predates-route": "A running bridge has no logging settings route; it applies them at its next start.",
|
|
28998
29205
|
"policy.push-failed": "A running bridge did not take the logging settings after retries; its next start resends them.",
|
|
28999
29206
|
"prune.failed": "Removing expired log files failed; the next sweep retries.",
|
|
29000
29207
|
"write.failed": "Appending to the log file failed.",
|
|
29001
|
-
"unknown-area": "Code outside the type checker asked for an area that is not listed."
|
|
29208
|
+
"unknown-area": "Code outside the type checker asked for an area that is not listed.",
|
|
29209
|
+
...THROTTLE_LOG_EVENTS
|
|
29002
29210
|
}
|
|
29003
29211
|
}
|
|
29004
29212
|
});
|
|
@@ -29123,7 +29331,28 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
|
|
|
29123
29331
|
"event-loop": {
|
|
29124
29332
|
description: "This process's event loop. A stall of 10 seconds or more is written at error, so no level hides it.",
|
|
29125
29333
|
events: {
|
|
29126
|
-
stalled:
|
|
29334
|
+
stalled: {
|
|
29335
|
+
description: "A timer fired late, so every request in that window waited.",
|
|
29336
|
+
essential: true,
|
|
29337
|
+
minLevel: "error",
|
|
29338
|
+
fields: { lagMs: "number", intervalMs: "number" }
|
|
29339
|
+
}
|
|
29340
|
+
}
|
|
29341
|
+
},
|
|
29342
|
+
process: {
|
|
29343
|
+
description: "Failures of a whole process that nothing in it handled.",
|
|
29344
|
+
events: {
|
|
29345
|
+
"rejection.unhandled": {
|
|
29346
|
+
description: "A promise rejection reached the fatal rejection guard, which keeps the process running.",
|
|
29347
|
+
essential: true,
|
|
29348
|
+
fields: { kind: "label", ...ESSENTIAL_ERROR_FIELDS }
|
|
29349
|
+
},
|
|
29350
|
+
"uncaught-exception": {
|
|
29351
|
+
description: "An exception reached the top of the backend, which is about to die with it. `origin` says whether it was thrown or a rejected top-level await.",
|
|
29352
|
+
essential: true,
|
|
29353
|
+
fields: { origin: "label", ...ESSENTIAL_ERROR_FIELDS }
|
|
29354
|
+
},
|
|
29355
|
+
...THROTTLE_LOG_EVENTS
|
|
29127
29356
|
}
|
|
29128
29357
|
}
|
|
29129
29358
|
});
|
|
@@ -29361,21 +29590,43 @@ var STORAGE_LOG_AREAS = defineLogAreas({
|
|
|
29361
29590
|
description: "The SQLite-backed stores, their snapshots and imports from older formats.",
|
|
29362
29591
|
events: {
|
|
29363
29592
|
"usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
|
|
29364
|
-
"
|
|
29593
|
+
"migration.failed": {
|
|
29594
|
+
description: "The database could not be brought to this build's schema, so it did not open; `step` says whether the safety copy or the migration itself failed.",
|
|
29595
|
+
essential: true,
|
|
29596
|
+
fields: {
|
|
29597
|
+
fromVersion: "number",
|
|
29598
|
+
toVersion: "number",
|
|
29599
|
+
step: "label",
|
|
29600
|
+
...ESSENTIAL_ERROR_FIELDS
|
|
29601
|
+
}
|
|
29602
|
+
},
|
|
29603
|
+
"snapshot.integrity-failed": {
|
|
29604
|
+
description: "A database snapshot failed its integrity check and was discarded.",
|
|
29605
|
+
essential: true,
|
|
29606
|
+
fields: {}
|
|
29607
|
+
},
|
|
29365
29608
|
"snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
|
|
29366
|
-
"snapshot.failed":
|
|
29609
|
+
"snapshot.failed": {
|
|
29610
|
+
description: "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
|
|
29611
|
+
essential: true,
|
|
29612
|
+
fields: { retryAt: "label", ...ESSENTIAL_ERROR_FIELDS }
|
|
29613
|
+
},
|
|
29367
29614
|
"listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
|
|
29368
29615
|
"listener.change-failed": "A resource change listener threw; the committed mutation stands.",
|
|
29369
29616
|
"kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
|
|
29370
29617
|
"nodes.entries-dropped": "Unreadable node registry entries were ignored.",
|
|
29371
29618
|
"preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
|
|
29619
|
+
"preview-settings.invalid": "Invalid preview settings disabled transport and relay.",
|
|
29372
29620
|
"machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
|
|
29373
29621
|
"permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
|
|
29374
29622
|
"retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
|
|
29375
29623
|
"handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
|
|
29376
29624
|
"desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
|
|
29377
29625
|
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
29378
|
-
"legacy-json.archive-failed": "Imported JSON store files could not be archived."
|
|
29626
|
+
"legacy-json.archive-failed": "Imported JSON store files could not be archived.",
|
|
29627
|
+
"lease.heartbeat-failed": "A held lease's heartbeat failed, which shortens the lease; the next one retries.",
|
|
29628
|
+
"scrub.checkpoint-failed": "Deleted content could not be scrubbed from the WAL because the truncating checkpoint failed or was blocked; the next checkpoint retries.",
|
|
29629
|
+
...THROTTLE_LOG_EVENTS
|
|
29379
29630
|
}
|
|
29380
29631
|
}
|
|
29381
29632
|
});
|
|
@@ -29401,6 +29652,7 @@ var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
|
29401
29652
|
"usage.read-failed": "Reading a stage session's token usage failed.",
|
|
29402
29653
|
"checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
|
|
29403
29654
|
"checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
|
|
29655
|
+
"worker-mail.claim-failed": "Mail queued for a worker could not be claimed at its turn end; it stays queued.",
|
|
29404
29656
|
"legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
|
|
29405
29657
|
}
|
|
29406
29658
|
}
|
|
@@ -29470,6 +29722,10 @@ var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
|
29470
29722
|
"wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
|
|
29471
29723
|
"wake.waiting-report-failed": "A waiting worker could not be reported.",
|
|
29472
29724
|
"wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
|
|
29725
|
+
"pr-watch.added": "A pull request a coordinator conversation showed joined the project's watch; `source` says how.",
|
|
29726
|
+
"pr-watch.observe-failed": "A watched pull request could not be observed; the next sweep retries.",
|
|
29727
|
+
"pr-watch.read-failed": "GitHub could not be read for a watched pull request; `code` is the error category.",
|
|
29728
|
+
"pr-watch.removed": "A watched pull request stopped being watched without a reading; `reason` is `deleted` (GitHub confirmed it is gone) or `unreadable` (not found for the give-up period).",
|
|
29473
29729
|
"store.malformed": "The coordinator store was malformed and is treated as empty.",
|
|
29474
29730
|
"store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
|
|
29475
29731
|
"store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
|
|
@@ -29478,8 +29734,10 @@ var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
|
29478
29734
|
"remote-worker.settle-failed": "A remote worker could not be settled.",
|
|
29479
29735
|
"checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
|
|
29480
29736
|
"checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
|
|
29481
|
-
"checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded, or `outcome` says why not (`timed-out`, `failed`).",
|
|
29482
|
-
"checkout.mail-follow-failed": "Before mail woke the main coordinator, checking whether to fast-forward the project checkout failed; the mail was delivered anyway."
|
|
29737
|
+
"checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded (`fast-forwarded-fetched` when the fetch was slow or failed and the upstream commit already fetched was merged), or `outcome` says why not (`timed-out`, `failed`).",
|
|
29738
|
+
"checkout.mail-follow-failed": "Before mail woke the main coordinator, checking whether to fast-forward the project checkout failed; the mail was delivered anyway.",
|
|
29739
|
+
"checkout.message-check": "Before a typed message to the main coordinator, the backend answered whether to fast-forward the project checkout: `outcome` (`offer`, `fast-forwarded`, `turn-running`, `not-behind`, `blocked`, `no-status`), `fetch` (`fetched`, `failed`, `timed-out`, `skipped`) and `durationMs`.",
|
|
29740
|
+
"checkout.message-check-failed": "Before a typed message to the main coordinator, fast-forwarding to the upstream commit already fetched failed after a slow or failed fetch; the message was sent anyway."
|
|
29483
29741
|
}
|
|
29484
29742
|
}
|
|
29485
29743
|
});
|
|
@@ -29582,7 +29840,27 @@ var DOCKER_LOG_AREAS = defineLogAreas({
|
|
|
29582
29840
|
"recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
|
|
29583
29841
|
"github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
|
|
29584
29842
|
"availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
|
|
29585
|
-
"start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
|
|
29843
|
+
"start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports.",
|
|
29844
|
+
"writer-lease.lost": {
|
|
29845
|
+
description: "This backend lost the registry writer lease, for the fixed `reason` given. Schedules stop and container changes are refused until it restarts.",
|
|
29846
|
+
essential: true,
|
|
29847
|
+
fields: { reason: "label" }
|
|
29848
|
+
},
|
|
29849
|
+
"writer-lease.regained": {
|
|
29850
|
+
description: "This backend took the registry writer lease over from a holder that stopped refreshing it (it crashed, was killed or stalled), `staleForMs` after its last refresh. The counterpart of that holder's `writer-lease.lost` with reason `reclaimed`; a lease left by a clean shutdown is acquired silently.",
|
|
29851
|
+
essential: true,
|
|
29852
|
+
fields: { staleForMs: "number" }
|
|
29853
|
+
},
|
|
29854
|
+
"writer-lease.not-acquired": {
|
|
29855
|
+
description: "This backend started without the registry writer lease, for the fixed `reason` given. A second backend on one data directory is normal: it serves reads, runs no schedules and refuses container changes.",
|
|
29856
|
+
essential: true,
|
|
29857
|
+
fields: { reason: "label" }
|
|
29858
|
+
},
|
|
29859
|
+
"bridge.launched": {
|
|
29860
|
+
description: "A bridge process was launched in a container, for the first time there or as a relaunch; `provider` names it. A relaunch keeps the run before it in the previous log.",
|
|
29861
|
+
essential: true,
|
|
29862
|
+
fields: { provider: "label", containerPort: "number" }
|
|
29863
|
+
}
|
|
29586
29864
|
}
|
|
29587
29865
|
},
|
|
29588
29866
|
"docker.reachability": {
|
|
@@ -30290,6 +30568,146 @@ var LOG_VOCABULARY = {
|
|
|
30290
30568
|
...WEB_SYNC_LOG_AREAS
|
|
30291
30569
|
};
|
|
30292
30570
|
|
|
30571
|
+
// ../protocol/src/log-essential-labels.ts
|
|
30572
|
+
var ERROR_NAMES = new Set([
|
|
30573
|
+
"Error",
|
|
30574
|
+
"TypeError",
|
|
30575
|
+
"RangeError",
|
|
30576
|
+
"ReferenceError",
|
|
30577
|
+
"SyntaxError",
|
|
30578
|
+
"URIError",
|
|
30579
|
+
"EvalError",
|
|
30580
|
+
"AggregateError",
|
|
30581
|
+
"AbortError",
|
|
30582
|
+
"TimeoutError",
|
|
30583
|
+
"SystemError"
|
|
30584
|
+
]);
|
|
30585
|
+
var ERROR_CODES = new Set([
|
|
30586
|
+
"EACCES",
|
|
30587
|
+
"EADDRINUSE",
|
|
30588
|
+
"EADDRNOTAVAIL",
|
|
30589
|
+
"EAGAIN",
|
|
30590
|
+
"EBADF",
|
|
30591
|
+
"EBUSY",
|
|
30592
|
+
"ECANCELED",
|
|
30593
|
+
"ECONNABORTED",
|
|
30594
|
+
"ECONNREFUSED",
|
|
30595
|
+
"ECONNRESET",
|
|
30596
|
+
"EEXIST",
|
|
30597
|
+
"EHOSTUNREACH",
|
|
30598
|
+
"EINTR",
|
|
30599
|
+
"EINVAL",
|
|
30600
|
+
"EIO",
|
|
30601
|
+
"EISDIR",
|
|
30602
|
+
"EMFILE",
|
|
30603
|
+
"ENETUNREACH",
|
|
30604
|
+
"ENFILE",
|
|
30605
|
+
"ENOENT",
|
|
30606
|
+
"ENOMEM",
|
|
30607
|
+
"ENOSPC",
|
|
30608
|
+
"ENOSYS",
|
|
30609
|
+
"ENOTDIR",
|
|
30610
|
+
"ENOTEMPTY",
|
|
30611
|
+
"ENOTFOUND",
|
|
30612
|
+
"EPERM",
|
|
30613
|
+
"EPIPE",
|
|
30614
|
+
"EROFS",
|
|
30615
|
+
"ETIMEDOUT",
|
|
30616
|
+
"EXDEV",
|
|
30617
|
+
"SQLITE_BUSY",
|
|
30618
|
+
"SQLITE_CORRUPT",
|
|
30619
|
+
"SQLITE_FULL",
|
|
30620
|
+
"SQLITE_IOERR",
|
|
30621
|
+
"SQLITE_NOTADB",
|
|
30622
|
+
"SQLITE_READONLY",
|
|
30623
|
+
"ERR_CANCELED",
|
|
30624
|
+
"ERR_STREAM_DESTROYED"
|
|
30625
|
+
]);
|
|
30626
|
+
var SYSCALLS = new Set([
|
|
30627
|
+
"open",
|
|
30628
|
+
"read",
|
|
30629
|
+
"write",
|
|
30630
|
+
"stat",
|
|
30631
|
+
"lstat",
|
|
30632
|
+
"mkdir",
|
|
30633
|
+
"rmdir",
|
|
30634
|
+
"readdir",
|
|
30635
|
+
"rename",
|
|
30636
|
+
"unlink",
|
|
30637
|
+
"fsync",
|
|
30638
|
+
"fdatasync",
|
|
30639
|
+
"close",
|
|
30640
|
+
"access",
|
|
30641
|
+
"chmod",
|
|
30642
|
+
"copyfile",
|
|
30643
|
+
"connect",
|
|
30644
|
+
"listen",
|
|
30645
|
+
"bind",
|
|
30646
|
+
"spawn",
|
|
30647
|
+
"kill",
|
|
30648
|
+
"getaddrinfo"
|
|
30649
|
+
]);
|
|
30650
|
+
var SIGNALS = new Set([
|
|
30651
|
+
"SIGABRT",
|
|
30652
|
+
"SIGALRM",
|
|
30653
|
+
"SIGBUS",
|
|
30654
|
+
"SIGCHLD",
|
|
30655
|
+
"SIGCONT",
|
|
30656
|
+
"SIGFPE",
|
|
30657
|
+
"SIGHUP",
|
|
30658
|
+
"SIGILL",
|
|
30659
|
+
"SIGINT",
|
|
30660
|
+
"SIGKILL",
|
|
30661
|
+
"SIGPIPE",
|
|
30662
|
+
"SIGQUIT",
|
|
30663
|
+
"SIGSEGV",
|
|
30664
|
+
"SIGSTOP",
|
|
30665
|
+
"SIGTERM",
|
|
30666
|
+
"SIGTRAP",
|
|
30667
|
+
"SIGTSTP",
|
|
30668
|
+
"SIGTTIN",
|
|
30669
|
+
"SIGTTOU",
|
|
30670
|
+
"SIGUSR1",
|
|
30671
|
+
"SIGUSR2",
|
|
30672
|
+
"SIGWINCH",
|
|
30673
|
+
"SIGXCPU",
|
|
30674
|
+
"SIGXFSZ"
|
|
30675
|
+
]);
|
|
30676
|
+
var PROVIDERS3 = new Set(["claude", "codex", "opencode", "cursor", "grok", "acp", "pi"]);
|
|
30677
|
+
var UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
|
30678
|
+
var SOURCE = new RegExp(`^(?:claude|codex|opencode|cursor|grok|acp|pi):${UUID}$`, "i");
|
|
30679
|
+
|
|
30680
|
+
// ../protocol/src/log-essential.ts
|
|
30681
|
+
var vocabulary = LOG_VOCABULARY;
|
|
30682
|
+
var UNDECLARED_ERROR_LABELS = new Set([
|
|
30683
|
+
"site",
|
|
30684
|
+
"kind",
|
|
30685
|
+
"step",
|
|
30686
|
+
"reason",
|
|
30687
|
+
"signal",
|
|
30688
|
+
"code"
|
|
30689
|
+
]);
|
|
30690
|
+
function eventSpec(area, event) {
|
|
30691
|
+
const spec = Object.hasOwn(vocabulary, area) ? vocabulary[area] : undefined;
|
|
30692
|
+
if (!spec || !Object.hasOwn(spec.events, event))
|
|
30693
|
+
return null;
|
|
30694
|
+
const definition = spec.events[event];
|
|
30695
|
+
return typeof definition === "object" && definition.essential ? definition : null;
|
|
30696
|
+
}
|
|
30697
|
+
function declaredEssential(area, event, level) {
|
|
30698
|
+
const spec = eventSpec(area, event);
|
|
30699
|
+
return spec && (spec.minLevel !== "error" || level === "error") ? spec : null;
|
|
30700
|
+
}
|
|
30701
|
+
function hasEssentialEvents(area) {
|
|
30702
|
+
const spec = Object.hasOwn(vocabulary, area) ? vocabulary[area] : undefined;
|
|
30703
|
+
return spec !== undefined && Object.values(spec.events).some((event) => typeof event === "object" && event.essential);
|
|
30704
|
+
}
|
|
30705
|
+
function isEssentialEntry(area, event, level) {
|
|
30706
|
+
if (area === "logging" && event === "essential.write-failed")
|
|
30707
|
+
return false;
|
|
30708
|
+
return level === "error" || declaredEssential(area, event, level) !== null;
|
|
30709
|
+
}
|
|
30710
|
+
|
|
30293
30711
|
// ../protocol/src/logger.ts
|
|
30294
30712
|
var LOG_LEVELS = ["error", "warn", "info", "debug", "trace"];
|
|
30295
30713
|
var MAX_FIELD_CHARS = 2048;
|
|
@@ -30334,7 +30752,9 @@ var DEFAULT_CONFIG = {
|
|
|
30334
30752
|
level: "info",
|
|
30335
30753
|
areaLevels: {},
|
|
30336
30754
|
format: "text",
|
|
30337
|
-
sink: consoleSink
|
|
30755
|
+
sink: consoleSink,
|
|
30756
|
+
essentialSink: null,
|
|
30757
|
+
relayEssential: false
|
|
30338
30758
|
};
|
|
30339
30759
|
var config2 = DEFAULT_CONFIG;
|
|
30340
30760
|
var generation = 0;
|
|
@@ -30445,17 +30865,38 @@ function renderText(record) {
|
|
|
30445
30865
|
function renderJson(record) {
|
|
30446
30866
|
return escapeLogLine(JSON.stringify(record));
|
|
30447
30867
|
}
|
|
30868
|
+
function offerEssential(record) {
|
|
30869
|
+
if (!config2.essentialSink || !isEssentialEntry(record.area, record.event, record.level))
|
|
30870
|
+
return;
|
|
30871
|
+
try {
|
|
30872
|
+
config2.essentialSink(record);
|
|
30873
|
+
} catch {}
|
|
30874
|
+
}
|
|
30448
30875
|
function deliver(record) {
|
|
30876
|
+
let delivered = true;
|
|
30449
30877
|
try {
|
|
30450
30878
|
config2.sink({
|
|
30451
30879
|
method: OUTPUT_METHOD[record.level],
|
|
30452
30880
|
line: config2.format === "json" ? renderJson(record) : renderText(record),
|
|
30453
30881
|
record
|
|
30454
30882
|
});
|
|
30455
|
-
return true;
|
|
30456
30883
|
} catch {
|
|
30457
|
-
|
|
30884
|
+
delivered = false;
|
|
30885
|
+
}
|
|
30886
|
+
offerEssential(record);
|
|
30887
|
+
return delivered;
|
|
30888
|
+
}
|
|
30889
|
+
function deliverEssentialOnly(record) {
|
|
30890
|
+
if (config2.essentialSink) {
|
|
30891
|
+
offerEssential(record);
|
|
30892
|
+
return;
|
|
30458
30893
|
}
|
|
30894
|
+
if (!config2.relayEssential)
|
|
30895
|
+
return;
|
|
30896
|
+
const marked = { ...record, essentialOnly: true };
|
|
30897
|
+
try {
|
|
30898
|
+
config2.sink({ method: OUTPUT_METHOD[record.level], line: renderJson(marked), record: marked });
|
|
30899
|
+
} catch {}
|
|
30459
30900
|
}
|
|
30460
30901
|
function buildRecord(level, area, event, fields) {
|
|
30461
30902
|
const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
|
|
@@ -30620,12 +31061,17 @@ function deliverEvent(level, area, event, fields) {
|
|
|
30620
31061
|
return deliver(buildRecord(level, area, event, fields));
|
|
30621
31062
|
}
|
|
30622
31063
|
function tryWriteLog(level, area, event, fields) {
|
|
30623
|
-
if (LEVEL_RANK[level] > thresholdRank(area))
|
|
31064
|
+
if (LEVEL_RANK[level] > thresholdRank(area)) {
|
|
31065
|
+
if (isEssentialEntry(area, event, level)) {
|
|
31066
|
+
deliverEssentialOnly(buildRecord(level, area, event, resolveFields(fields)));
|
|
31067
|
+
}
|
|
30624
31068
|
return false;
|
|
31069
|
+
}
|
|
30625
31070
|
return deliverEvent(level, area, event, resolveFields(fields));
|
|
30626
31071
|
}
|
|
30627
31072
|
function createLogger(area) {
|
|
30628
31073
|
const spec = areaSpec(area);
|
|
31074
|
+
const mayHoldEssential = hasEssentialEvents(area);
|
|
30629
31075
|
let seenGeneration = -1;
|
|
30630
31076
|
let rank = 0;
|
|
30631
31077
|
const enabled = (level) => {
|
|
@@ -30638,9 +31084,16 @@ function createLogger(area) {
|
|
|
30638
31084
|
const writeResolved = (level, event, resolved) => {
|
|
30639
31085
|
deliverEvent(level, area, event, resolved);
|
|
30640
31086
|
};
|
|
31087
|
+
const writeFiltered = (level, event, fields) => {
|
|
31088
|
+
if (!mayHoldEssential || !isEssentialEntry(area, event, level))
|
|
31089
|
+
return;
|
|
31090
|
+
deliverEssentialOnly(buildRecord(level, area, event, resolveFields(fields)));
|
|
31091
|
+
};
|
|
30641
31092
|
const write = (level, event, fields) => {
|
|
30642
|
-
if (!enabled(level))
|
|
31093
|
+
if (!enabled(level)) {
|
|
31094
|
+
writeFiltered(level, event, fields);
|
|
30643
31095
|
return;
|
|
31096
|
+
}
|
|
30644
31097
|
writeResolved(level, event, resolveFields(fields));
|
|
30645
31098
|
};
|
|
30646
31099
|
return {
|
|
@@ -30651,8 +31104,10 @@ function createLogger(area) {
|
|
|
30651
31104
|
trace: (event, fields) => write("trace", event, fields),
|
|
30652
31105
|
throttled: (level, event, options) => {
|
|
30653
31106
|
syncThrottleLevels();
|
|
30654
|
-
if (!enabled(level))
|
|
31107
|
+
if (!enabled(level)) {
|
|
31108
|
+
writeFiltered(level, event, options.fields);
|
|
30655
31109
|
return;
|
|
31110
|
+
}
|
|
30656
31111
|
if (!spec || !Object.hasOwn(spec.events, event) || event.startsWith("throttle.") || !Object.hasOwn(spec.events, "throttle.recovered")) {
|
|
30657
31112
|
deliver(buildRecord(level, spec ? area : "logging", spec ? "invalid-event" : "unknown-area", undefined));
|
|
30658
31113
|
return;
|
|
@@ -31046,6 +31501,7 @@ function restoreSession(entry, fileBytes) {
|
|
|
31046
31501
|
state.id = entry.id;
|
|
31047
31502
|
if (isNativeAgentExecutionPolicy(entry.policy))
|
|
31048
31503
|
state.policy = entry.policy;
|
|
31504
|
+
state.policyPending = true;
|
|
31049
31505
|
if (typeof entry.readOnly === "boolean")
|
|
31050
31506
|
state.readOnly = entry.readOnly;
|
|
31051
31507
|
if (nonBlank(entry.agentId))
|
|
@@ -34395,15 +34851,18 @@ async function createSession(clientSessionKey, patch, policy, readOnly) {
|
|
|
34395
34851
|
throw new SessionConflictError("This Cursor session is closing; retry once the close completes");
|
|
34396
34852
|
}
|
|
34397
34853
|
if (policy)
|
|
34398
|
-
existing
|
|
34854
|
+
await applyRequestedPolicy(existing, resolveCursorExecutionPolicy(policy));
|
|
34399
34855
|
return existing;
|
|
34400
34856
|
}
|
|
34401
34857
|
const inFlight = sessionCreations.get(clientSessionKey);
|
|
34402
|
-
if (inFlight)
|
|
34403
|
-
|
|
34858
|
+
if (inFlight) {
|
|
34859
|
+
await inFlight;
|
|
34860
|
+
return createSession(clientSessionKey, patch, policy, readOnly);
|
|
34861
|
+
}
|
|
34404
34862
|
}
|
|
34405
34863
|
const work = (async () => {
|
|
34406
34864
|
const state = newSessionState(clientSessionKey, resolveCursorExecutionPolicy(policy));
|
|
34865
|
+
state.policyPending = !policy;
|
|
34407
34866
|
state.promptJournalComplete = true;
|
|
34408
34867
|
if (typeof readOnly === "boolean")
|
|
34409
34868
|
state.readOnly = readOnly;
|
|
@@ -34424,6 +34883,8 @@ async function createSession(clientSessionKey, patch, policy, readOnly) {
|
|
|
34424
34883
|
}
|
|
34425
34884
|
}
|
|
34426
34885
|
async function ensureAgent(state, options = {}) {
|
|
34886
|
+
if (policyChanges.has(state))
|
|
34887
|
+
throw new SessionConflictError("Session policy is changing");
|
|
34427
34888
|
assertSessionOpen(state);
|
|
34428
34889
|
if (state.agent && (state.attachedMcpKey ?? "") !== mcpConnectionKey(state.agentMcp)) {
|
|
34429
34890
|
const agent = state.agent;
|
|
@@ -34452,6 +34913,8 @@ async function ensureAgent(state, options = {}) {
|
|
|
34452
34913
|
await detachAgent(state);
|
|
34453
34914
|
}
|
|
34454
34915
|
assertSessionOpen(state);
|
|
34916
|
+
if (policyChanges.has(state))
|
|
34917
|
+
throw new SessionConflictError("Session policy is changing");
|
|
34455
34918
|
if (state.agent)
|
|
34456
34919
|
return state.agent;
|
|
34457
34920
|
state.attaching ??= attach(state).finally(() => {
|
|
@@ -34676,6 +35139,10 @@ async function attach(state) {
|
|
|
34676
35139
|
if (state.configResumePending) {
|
|
34677
35140
|
throw new Error("Cursor could not reopen this conversation with the updated configuration. The conversation was kept; retry with the current settings.", { cause: error });
|
|
34678
35141
|
}
|
|
35142
|
+
log5.warn("session.resume-fell-back", {
|
|
35143
|
+
sessionId: state.id,
|
|
35144
|
+
error: formatLogError(error, { message: false })
|
|
35145
|
+
});
|
|
34679
35146
|
state.agentId = undefined;
|
|
34680
35147
|
}
|
|
34681
35148
|
}
|
|
@@ -34942,6 +35409,32 @@ function resumePolicyKey(policy) {
|
|
|
34942
35409
|
toolPolicy: resolved.toolPolicy ?? null
|
|
34943
35410
|
});
|
|
34944
35411
|
}
|
|
35412
|
+
var policyChanges = new WeakSet;
|
|
35413
|
+
async function applyRequestedPolicy(state, policy) {
|
|
35414
|
+
if (policyChanges.has(state))
|
|
35415
|
+
throw new SessionConflictError("Session policy is changing");
|
|
35416
|
+
assertExecutionPolicyNotWidened(liveExecutionPolicy(state), policy);
|
|
35417
|
+
if (JSON.stringify(state.policy) !== JSON.stringify(policy)) {
|
|
35418
|
+
if (state.status === "running" || state.dispatching || state.rewinding) {
|
|
35419
|
+
throw new SessionConflictError("Session is already running");
|
|
35420
|
+
}
|
|
35421
|
+
policyChanges.add(state);
|
|
35422
|
+
state.dispatching = true;
|
|
35423
|
+
try {
|
|
35424
|
+
await state.attaching?.catch(() => {
|
|
35425
|
+
return;
|
|
35426
|
+
});
|
|
35427
|
+
await detachAgent(state);
|
|
35428
|
+
assertSessionOpen(state);
|
|
35429
|
+
assertExecutionPolicyNotWidened(liveExecutionPolicy(state), policy);
|
|
35430
|
+
state.policy = policy;
|
|
35431
|
+
} finally {
|
|
35432
|
+
state.dispatching = false;
|
|
35433
|
+
policyChanges.delete(state);
|
|
35434
|
+
}
|
|
35435
|
+
}
|
|
35436
|
+
state.policyPending = false;
|
|
35437
|
+
}
|
|
34945
35438
|
function resumeComposerConflicts(state, patch) {
|
|
34946
35439
|
if (!patch)
|
|
34947
35440
|
return false;
|
|
@@ -34967,9 +35460,11 @@ async function resumeSession(agentId, patch, policy, agentMcp) {
|
|
|
34967
35460
|
throw new SessionConflictError("This Cursor session is closing; retry once the close completes");
|
|
34968
35461
|
}
|
|
34969
35462
|
if (existing) {
|
|
34970
|
-
if (
|
|
34971
|
-
throw new SessionConflictError("Cursor session is already adopted
|
|
35463
|
+
if (resumeComposerConflicts(existing, patch)) {
|
|
35464
|
+
throw new SessionConflictError("Cursor session is already adopted with different composer controls");
|
|
34972
35465
|
}
|
|
35466
|
+
if (policy)
|
|
35467
|
+
await applyRequestedPolicy(existing, resolveCursorExecutionPolicy(policy));
|
|
34973
35468
|
if (agentMcp)
|
|
34974
35469
|
existing.agentMcp = agentMcp;
|
|
34975
35470
|
return existing;
|
|
@@ -34985,6 +35480,7 @@ async function resumeSession(agentId, patch, policy, agentMcp) {
|
|
|
34985
35480
|
if (hasTombstoneForAgent(agentId))
|
|
34986
35481
|
await finishTombstonesForAgent(agentId);
|
|
34987
35482
|
const state = newSessionState(undefined, resolveCursorExecutionPolicy(policy));
|
|
35483
|
+
state.policyPending = !policy;
|
|
34988
35484
|
state.agentId = agentId;
|
|
34989
35485
|
state.agentMcp = agentMcp;
|
|
34990
35486
|
applyComposerPatch(state, patch);
|
|
@@ -35045,7 +35541,11 @@ async function recoverActiveRun(state) {
|
|
|
35045
35541
|
state.status = "running";
|
|
35046
35542
|
state.turnStartedAt = active.createdAt;
|
|
35047
35543
|
beginAssistantTurn(state);
|
|
35048
|
-
state.
|
|
35544
|
+
state.turnCancelRequested = undefined;
|
|
35545
|
+
state.cancelTurn = () => {
|
|
35546
|
+
state.turnCancelRequested = true;
|
|
35547
|
+
return active.cancel();
|
|
35548
|
+
};
|
|
35049
35549
|
state.revision += 1;
|
|
35050
35550
|
const unsubscribe = active.onDidChangeStatus(() => {
|
|
35051
35551
|
state.revision += 1;
|
|
@@ -35068,7 +35568,16 @@ async function recoverActiveRun(state) {
|
|
|
35068
35568
|
await hydrateHistory(state);
|
|
35069
35569
|
state.status = active.status === "error" ? "error" : "idle";
|
|
35070
35570
|
state.error = active.error?.message;
|
|
35571
|
+
if (active.status === "error" && state.turnCancelRequested !== true) {
|
|
35572
|
+
log5.warn("turn.recovery-failed", { sessionId: state.id });
|
|
35573
|
+
}
|
|
35071
35574
|
} catch (error) {
|
|
35575
|
+
if (state.turnCancelRequested !== true) {
|
|
35576
|
+
log5.warn("turn.recovery-failed", {
|
|
35577
|
+
sessionId: state.id,
|
|
35578
|
+
error: formatLogError(error, { message: false })
|
|
35579
|
+
});
|
|
35580
|
+
}
|
|
35072
35581
|
state.status = "error";
|
|
35073
35582
|
state.error = error instanceof Error ? error.message : "Cursor run recovery failed";
|
|
35074
35583
|
} finally {
|
|
@@ -36126,6 +36635,7 @@ function classify(toolCall) {
|
|
|
36126
36635
|
return;
|
|
36127
36636
|
}
|
|
36128
36637
|
// ../../bridges/cursor-bridge/src/prompt.ts
|
|
36638
|
+
var log6 = createLogger("bridge.cursor");
|
|
36129
36639
|
var STRUCTURED_PROMPT_INSTRUCTION_PREFIX = "End your turn with exactly one JSON value";
|
|
36130
36640
|
function structuredPromptInstruction(schema) {
|
|
36131
36641
|
return `${STRUCTURED_PROMPT_INSTRUCTION_PREFIX} matching this JSON Schema. That final message must be the JSON value alone, with no Markdown fence and no commentary around it.
|
|
@@ -36240,7 +36750,9 @@ async function followStartedRun(state, run, promptSequence, input, diagnostics,
|
|
|
36240
36750
|
state.revision += 1;
|
|
36241
36751
|
});
|
|
36242
36752
|
let cancelling;
|
|
36753
|
+
state.turnCancelRequested = undefined;
|
|
36243
36754
|
state.cancelTurn = () => {
|
|
36755
|
+
state.turnCancelRequested = true;
|
|
36244
36756
|
if (!cancelling) {
|
|
36245
36757
|
const attempt = (async () => {
|
|
36246
36758
|
await (diagnostics ? diagnostics.cancel(run, "user") : run.cancel().catch(() => {
|
|
@@ -36325,6 +36837,7 @@ async function followRun(state, run, promptSequence, input, timeoutMs = PROMPT_T
|
|
|
36325
36837
|
}) : undefined;
|
|
36326
36838
|
if (!turnStillOwned(state, promptSequence))
|
|
36327
36839
|
return await closedTurnStopped();
|
|
36840
|
+
log6.warn("turn.timed-out", { sessionId: state.id });
|
|
36328
36841
|
state.error = error.message;
|
|
36329
36842
|
state.revision += 1;
|
|
36330
36843
|
schedulePersist();
|
|
@@ -36392,6 +36905,12 @@ function finishTurn(state, result, input, streamed) {
|
|
|
36392
36905
|
schedulePersist();
|
|
36393
36906
|
}
|
|
36394
36907
|
function failTurn(state, error, input, result, streamed = {}) {
|
|
36908
|
+
if (state.turnCancelRequested !== true) {
|
|
36909
|
+
log6.warn("turn.failed", {
|
|
36910
|
+
sessionId: state.id,
|
|
36911
|
+
error: formatLogError(error, { message: false })
|
|
36912
|
+
});
|
|
36913
|
+
}
|
|
36395
36914
|
settleBackgroundChildren(state);
|
|
36396
36915
|
settleAbandonedToolParts(state);
|
|
36397
36916
|
endTurnEvidence(state, turnEvidence.get(state), {
|
|
@@ -37262,7 +37781,8 @@ function configureLoggerFromEnvironment(env, options = {}) {
|
|
|
37262
37781
|
configureLogger({
|
|
37263
37782
|
...levels.level ? { level: levels.level } : {},
|
|
37264
37783
|
areaLevels: levels.areaLevels,
|
|
37265
|
-
format
|
|
37784
|
+
format,
|
|
37785
|
+
relayEssential: options.relayToSupervisor === true
|
|
37266
37786
|
});
|
|
37267
37787
|
const log = createLogger("logging");
|
|
37268
37788
|
if (levels.invalid.length > 0) {
|
|
@@ -38095,7 +38615,7 @@ var SOURCES = new Set([
|
|
|
38095
38615
|
var EXECUTION_KINDS = new Set(NATIVE_AGENT_COMMAND_EXECUTION_KINDS);
|
|
38096
38616
|
var ORIGINS2 = new Set(NATIVE_AGENT_COMMAND_ORIGINS);
|
|
38097
38617
|
var UNAVAILABLE_REASONS = new Set(NATIVE_AGENT_COMMAND_UNAVAILABLE_REASONS);
|
|
38098
|
-
var
|
|
38618
|
+
var ERROR_CODES2 = new Set(NATIVE_AGENT_COMMAND_CATALOGUE_ERROR_CODES);
|
|
38099
38619
|
var encoder2 = new TextEncoder;
|
|
38100
38620
|
function utf8ByteLength(value) {
|
|
38101
38621
|
if (/^[\x00-\x7f]*$/.test(value))
|
|
@@ -38383,7 +38903,7 @@ async function answerSessionActivityBatch(body, read, options = {}) {
|
|
|
38383
38903
|
}
|
|
38384
38904
|
|
|
38385
38905
|
// ../../bridges/cursor-bridge/src/http.ts
|
|
38386
|
-
var
|
|
38906
|
+
var log7 = createLogger("bridge.cursor");
|
|
38387
38907
|
|
|
38388
38908
|
class HttpError extends Error {
|
|
38389
38909
|
status;
|
|
@@ -38426,6 +38946,10 @@ async function route(request, response, clientSignal) {
|
|
|
38426
38946
|
} catch (error) {
|
|
38427
38947
|
if (error instanceof HttpError)
|
|
38428
38948
|
return json(response, error.status, { error: error.message });
|
|
38949
|
+
if (error instanceof PolicyWideningRefusedError) {
|
|
38950
|
+
log7.warn("session.policy-widening-refused", { widened: error.widened.join(",") });
|
|
38951
|
+
return json(response, 403, error.refusal());
|
|
38952
|
+
}
|
|
38429
38953
|
if (error instanceof CredentialError) {
|
|
38430
38954
|
return json(response, 401, {
|
|
38431
38955
|
error: error.message,
|
|
@@ -38448,7 +38972,7 @@ async function route(request, response, clientSignal) {
|
|
|
38448
38972
|
if (error instanceof PromptAttachmentError) {
|
|
38449
38973
|
return json(response, 400, { error: error.message });
|
|
38450
38974
|
}
|
|
38451
|
-
|
|
38975
|
+
log7.error("http.route-failed");
|
|
38452
38976
|
return json(response, 500, { error: "Internal bridge error" });
|
|
38453
38977
|
}
|
|
38454
38978
|
}
|
|
@@ -38965,6 +39489,9 @@ function unsupportedCommandRefresh() {
|
|
|
38965
39489
|
}
|
|
38966
39490
|
async function handlePrompt(request, response, state, clientSignal) {
|
|
38967
39491
|
const body = await readJson(request);
|
|
39492
|
+
if (isNativeAgentExecutionPolicy(body.policy)) {
|
|
39493
|
+
assertExecutionPolicyNotWidened(liveExecutionPolicy(state), resolveCursorExecutionPolicy(body.policy));
|
|
39494
|
+
}
|
|
38968
39495
|
const prompt = typeof body.prompt === "string" ? body.prompt.trim() : "";
|
|
38969
39496
|
const requestId = readBoundedString(body.requestId, MAX_PROMPT_REQUEST_ID_BYTES, "requestId");
|
|
38970
39497
|
const schema = isObject(body.outputSchema) ? body.outputSchema : undefined;
|
|
@@ -39010,6 +39537,7 @@ async function handlePrompt(request, response, state, clientSignal) {
|
|
|
39010
39537
|
kind: "prompt-journal-saturated"
|
|
39011
39538
|
});
|
|
39012
39539
|
}
|
|
39540
|
+
state.policyPending = false;
|
|
39013
39541
|
const idleSteer = commandFields.allowProviderCommands ? idleSteerPromptReply(prompt, "Cursor") : null;
|
|
39014
39542
|
if (idleSteer) {
|
|
39015
39543
|
assertSessionOpen(state);
|
|
@@ -39146,6 +39674,10 @@ async function dispatchClaimedPrompt(response, state, input) {
|
|
|
39146
39674
|
userMessageId
|
|
39147
39675
|
});
|
|
39148
39676
|
} catch (error) {
|
|
39677
|
+
log7.warn("turn.send-failed", {
|
|
39678
|
+
sessionId: state.id,
|
|
39679
|
+
error: formatLogError(error, { message: false })
|
|
39680
|
+
});
|
|
39149
39681
|
state.status = "error";
|
|
39150
39682
|
state.error = errorText(error);
|
|
39151
39683
|
state.dispatching = false;
|
|
@@ -39436,7 +39968,7 @@ function startParentWatchdog(options) {
|
|
|
39436
39968
|
}
|
|
39437
39969
|
|
|
39438
39970
|
// ../protocol/src/bridge-lifecycle.ts
|
|
39439
|
-
var
|
|
39971
|
+
var log8 = createLogger("bridge.lifecycle");
|
|
39440
39972
|
var TERMINATION_SIGNALS = ["SIGTERM", "SIGINT"];
|
|
39441
39973
|
function errorKind(error) {
|
|
39442
39974
|
if (error instanceof Error)
|
|
@@ -39490,7 +40022,7 @@ class BridgeLifecycle {
|
|
|
39490
40022
|
}
|
|
39491
40023
|
requestExit() {
|
|
39492
40024
|
this.#exit ??= this.shutdown().then(() => this.#options.exit(0), (error) => {
|
|
39493
|
-
|
|
40025
|
+
log8.error("shutdown.failed", {
|
|
39494
40026
|
bridge: this.#options.label,
|
|
39495
40027
|
errorClass: errorKind(error)
|
|
39496
40028
|
});
|
|
@@ -39507,7 +40039,7 @@ class BridgeLifecycle {
|
|
|
39507
40039
|
try {
|
|
39508
40040
|
idleSweep.run();
|
|
39509
40041
|
} catch (error) {
|
|
39510
|
-
|
|
40042
|
+
log8.warn("idle-sweep.failed", {
|
|
39511
40043
|
bridge: this.#options.label,
|
|
39512
40044
|
errorClass: errorKind(error)
|
|
39513
40045
|
});
|
|
@@ -39579,7 +40111,7 @@ async function settleIdleDetaches() {
|
|
|
39579
40111
|
}
|
|
39580
40112
|
|
|
39581
40113
|
// ../../bridges/cursor-bridge/src/server.ts
|
|
39582
|
-
var
|
|
40114
|
+
var log9 = createLogger("bridge.cursor");
|
|
39583
40115
|
var IDLE_SWEEP_MS = 60 * 1000;
|
|
39584
40116
|
var lifecycle;
|
|
39585
40117
|
var server = createServer((request, response) => {
|
|
@@ -39614,7 +40146,7 @@ function lifecycleFor(listenPort, options) {
|
|
|
39614
40146
|
applyWorkingDirectory();
|
|
39615
40147
|
await loadPersistedState();
|
|
39616
40148
|
finishRestoredTombstones().catch(() => {
|
|
39617
|
-
|
|
40149
|
+
log9.warn("startup.closes-failed");
|
|
39618
40150
|
});
|
|
39619
40151
|
await new Promise((resolve) => server.listen(listenPort, hostname, resolve));
|
|
39620
40152
|
},
|
|
@@ -39768,6 +40300,9 @@ function installFatalRejectionGuard(options) {
|
|
|
39768
40300
|
try {
|
|
39769
40301
|
warn(`${options.label} Unhandled promise rejection (continuing): ${describe(reason)}`);
|
|
39770
40302
|
} catch {}
|
|
40303
|
+
try {
|
|
40304
|
+
options.onRejection?.(reason);
|
|
40305
|
+
} catch {}
|
|
39771
40306
|
};
|
|
39772
40307
|
target.on("unhandledRejection", handler);
|
|
39773
40308
|
return () => {
|
|
@@ -39775,6 +40310,15 @@ function installFatalRejectionGuard(options) {
|
|
|
39775
40310
|
};
|
|
39776
40311
|
}
|
|
39777
40312
|
|
|
40313
|
+
// ../protocol/src/node/process-failure-log.ts
|
|
40314
|
+
var log10 = createLogger("process");
|
|
40315
|
+
function logUnhandledRejection(reason) {
|
|
40316
|
+
log10.throttled("error", "rejection.unhandled", {
|
|
40317
|
+
error: reason,
|
|
40318
|
+
fields: () => ({ error: formatLogError(reason, { message: false }) })
|
|
40319
|
+
});
|
|
40320
|
+
}
|
|
40321
|
+
|
|
39778
40322
|
// ../../bridges/cursor-bridge/src/login-cli.ts
|
|
39779
40323
|
async function runLogin(emit) {
|
|
39780
40324
|
const handle = beginLogin({ openBrowser: true });
|
|
@@ -39806,7 +40350,7 @@ async function runLogin(emit) {
|
|
|
39806
40350
|
|
|
39807
40351
|
// ../../bridges/cursor-bridge/src/index.ts
|
|
39808
40352
|
configureBridgeLogger();
|
|
39809
|
-
installFatalRejectionGuard({ label: "[cursor-bridge]" });
|
|
40353
|
+
installFatalRejectionGuard({ label: "[cursor-bridge]", onRejection: logUnhandledRejection });
|
|
39810
40354
|
if (process.argv.includes("--login")) {
|
|
39811
40355
|
process.exit(await runLogin((line) => process.stdout.write(`${line}
|
|
39812
40356
|
`)));
|
|
@@ -39937,6 +40481,7 @@ export {
|
|
|
39937
40481
|
json,
|
|
39938
40482
|
listModels,
|
|
39939
40483
|
listResumableSessions,
|
|
40484
|
+
liveExecutionPolicy,
|
|
39940
40485
|
loadPersistedState,
|
|
39941
40486
|
logout,
|
|
39942
40487
|
messageWindow,
|