orkestrator 2.36.1 → 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 +331 -23
- package/dist/main.js +7949 -3557
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +626 -429
- package/resources/claude-bridge/dist/index.js +540 -147
- package/resources/codex-bridge/dist/index.js +1912 -1261
- package/resources/cursor-bridge/dist/index.js +579 -42
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +730 -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([
|
|
@@ -27707,6 +27709,97 @@ function chargeAppended(state, before, after) {
|
|
|
27707
27709
|
function readText(value) {
|
|
27708
27710
|
return typeof value === "string" ? value : "";
|
|
27709
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
|
+
|
|
27710
27803
|
// ../../bridges/cursor-bridge/src/execution-policy.ts
|
|
27711
27804
|
function resolveCursorExecutionPolicy(policy) {
|
|
27712
27805
|
const resolved = policy ?? {
|
|
@@ -27747,6 +27840,9 @@ function resolveCursorExecutionPolicy(policy) {
|
|
|
27747
27840
|
...notes.length > 0 ? { note: notes.join(" ") } : {}
|
|
27748
27841
|
};
|
|
27749
27842
|
}
|
|
27843
|
+
function liveExecutionPolicy(state) {
|
|
27844
|
+
return state.policyPending ? undefined : state.policy;
|
|
27845
|
+
}
|
|
27750
27846
|
function cursorAppliedPolicy(state) {
|
|
27751
27847
|
const sessionPolicy = state.policy;
|
|
27752
27848
|
return resolveCursorExecutionPolicy(state.readOnly ? {
|
|
@@ -28470,6 +28566,16 @@ function logErrorKind(error) {
|
|
|
28470
28566
|
}
|
|
28471
28567
|
|
|
28472
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
|
+
};
|
|
28473
28579
|
var THROTTLE_LOG_EVENTS = {
|
|
28474
28580
|
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
28475
28581
|
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
@@ -28519,7 +28625,11 @@ var BACKEND_LOG_AREAS = defineLogAreas({
|
|
|
28519
28625
|
backend: {
|
|
28520
28626
|
description: "The backend process: startup, background notices and shutdown.",
|
|
28521
28627
|
events: {
|
|
28522
|
-
starting:
|
|
28628
|
+
starting: {
|
|
28629
|
+
description: "The backend process is starting.",
|
|
28630
|
+
essential: true,
|
|
28631
|
+
fields: { version: "label" }
|
|
28632
|
+
},
|
|
28523
28633
|
"ssh-socket.resolved": "An SSH agent socket was found.",
|
|
28524
28634
|
"ssh-socket.missing": "No usable SSH agent socket was found.",
|
|
28525
28635
|
"standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
|
|
@@ -28534,8 +28644,16 @@ var BACKEND_LOG_AREAS = defineLogAreas({
|
|
|
28534
28644
|
"notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
|
|
28535
28645
|
"artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
|
|
28536
28646
|
"shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
|
|
28537
|
-
"shutdown.signal-received":
|
|
28538
|
-
|
|
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
|
+
},
|
|
28539
28657
|
"port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
|
|
28540
28658
|
"port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
|
|
28541
28659
|
}
|
|
@@ -28578,7 +28696,10 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28578
28696
|
"evidence.record-failed": "Change evidence could not be recorded; the read loop carries on.",
|
|
28579
28697
|
"evidence.shell-record-failed": "A shell observation could not be recorded.",
|
|
28580
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.",
|
|
28581
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.",
|
|
28582
28703
|
"state.composer-reset": "A saved composer state was malformed and was reset.",
|
|
28583
28704
|
"state.discarded": "Saved bridge state could not be used and was discarded.",
|
|
28584
28705
|
"state.persist-failed": "Saving bridge state failed; a later write retries.",
|
|
@@ -28632,7 +28753,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28632
28753
|
"session.created": "A session was created or recovered.",
|
|
28633
28754
|
"session.delete-failed": "Deleting a session failed.",
|
|
28634
28755
|
"session.fork-failed": "Forking a session failed.",
|
|
28635
|
-
"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.",
|
|
28636
28757
|
"session.rename-failed": "Renaming a session failed.",
|
|
28637
28758
|
"session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
|
|
28638
28759
|
"session.rewind-failed": "Rewinding session files failed.",
|
|
@@ -28666,6 +28787,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28666
28787
|
"app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
|
|
28667
28788
|
"app-server.invariant-violation": "app-server asked for something its configuration forbids.",
|
|
28668
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.",
|
|
28669
28791
|
"app-server.recording": "Notification recording is on; recordings hold content.",
|
|
28670
28792
|
"app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
|
|
28671
28793
|
"app-server.stderr": "Metadata of an app-server stderr line, never its content.",
|
|
@@ -28696,6 +28818,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28696
28818
|
"ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
|
|
28697
28819
|
"ordered-events.reconcile-failed": "Reconciling ordered events failed.",
|
|
28698
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.",
|
|
28699
28822
|
"queue.task-failed": "A task on a per-thread queue failed.",
|
|
28700
28823
|
"raw-log.write-failed": "Appending to the raw Codex log failed.",
|
|
28701
28824
|
"recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
|
|
@@ -28709,6 +28832,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28709
28832
|
"server-request.flush-timeout": "An answer to a server request did not flush in time.",
|
|
28710
28833
|
"server-request.handoff-failed": "Handing a server request to the router threw.",
|
|
28711
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.",
|
|
28712
28836
|
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
28713
28837
|
"sse.keepalive-failed": "An event stream keepalive failed.",
|
|
28714
28838
|
"sse.observer-failed": "An event stream observer failed; it reconnects.",
|
|
@@ -28737,19 +28861,39 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
28737
28861
|
events: {
|
|
28738
28862
|
"agent.archive-failed": "Archiving or unarchiving an agent failed.",
|
|
28739
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.",
|
|
28740
28865
|
"startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
|
|
28741
28866
|
"startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
|
|
28742
28867
|
"state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
|
|
28743
28868
|
"state.publication-recovered": "Saving bridge state recovered.",
|
|
28744
|
-
"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."
|
|
28745
28879
|
}
|
|
28746
28880
|
},
|
|
28747
28881
|
"bridge.pi": {
|
|
28748
28882
|
description: "The Pi bridge: its routes, sessions and saved state.",
|
|
28749
28883
|
events: {
|
|
28750
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.",
|
|
28751
28887
|
"state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
|
|
28752
|
-
"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."
|
|
28753
28897
|
}
|
|
28754
28898
|
}
|
|
28755
28899
|
});
|
|
@@ -28760,14 +28904,31 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
28760
28904
|
description: "The Electron main process: startup, windows, quit and the Local backend's life.",
|
|
28761
28905
|
events: {
|
|
28762
28906
|
"backend.docker-context-seed-failed": "An agent-test profile fell back to the default Docker context.",
|
|
28763
|
-
"backend.exited":
|
|
28764
|
-
|
|
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
|
+
},
|
|
28765
28917
|
"backend.keychain-link-remove-failed": "An agent-test profile kept a legacy link to the host keychain.",
|
|
28766
|
-
"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
|
+
},
|
|
28767
28923
|
"clipboard.write-failed": "Writing text to the system clipboard failed.",
|
|
28768
28924
|
"dev-mode.ignored-packaged": "A packaged app was launched with ELECTRON_DEV=1 and ignored it; it loads its bundled renderer.",
|
|
28769
28925
|
"instance.already-running": "Another instance holds this data directory; this one will quit.",
|
|
28770
|
-
"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
|
+
},
|
|
28771
28932
|
"quit.stopping-backend": "The app is quitting and has asked the Local backend to stop.",
|
|
28772
28933
|
"relaunch.schedule-failed": "The AppImage relaunch waiter failed; using Electron's relauncher.",
|
|
28773
28934
|
"relaunch.service-register-failed": "The AppImage relaunch service was refused; using a detached waiter.",
|
|
@@ -28778,7 +28939,11 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
28778
28939
|
"saved-machines.attach-failed": "Saved machines were not imported into the command node yet.",
|
|
28779
28940
|
"saved-machines.attached": "Saved machines were imported into the local command node.",
|
|
28780
28941
|
"startup.failed": "The application failed to start.",
|
|
28781
|
-
"uncaught-exception":
|
|
28942
|
+
"uncaught-exception": {
|
|
28943
|
+
description: "The main process hit an uncaught exception.",
|
|
28944
|
+
essential: true,
|
|
28945
|
+
fields: ESSENTIAL_ERROR_FIELDS
|
|
28946
|
+
},
|
|
28782
28947
|
"uncaught-exception.dialog-failed": "The uncaught exception sheet could not be shown.",
|
|
28783
28948
|
"window.create-failed": "A menu-driven new window could not be created.",
|
|
28784
28949
|
"window.recreate-failed": "The main window could not be recreated on activation.",
|
|
@@ -28801,6 +28966,12 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
28801
28966
|
"unhandled-rejection": "An unhandled rejection occurred while the renderer was starting."
|
|
28802
28967
|
}
|
|
28803
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
|
+
},
|
|
28804
28975
|
"desktop.dialog": {
|
|
28805
28976
|
description: "Native dialogs, whose modal loops hold the main thread while they are open.",
|
|
28806
28977
|
events: {
|
|
@@ -28919,6 +29090,8 @@ var GATEWAY_LOG_AREAS = defineLogAreas({
|
|
|
28919
29090
|
"loopback.unavailable": "The loopback client listener could not start.",
|
|
28920
29091
|
"auth-token.stored": "The gateway token's file was written. The path only, never the token.",
|
|
28921
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.",
|
|
28922
29095
|
"port.fallback": "The preferred port was taken, so a nearby one is used.",
|
|
28923
29096
|
"port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
|
|
28924
29097
|
"request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
|
|
@@ -28962,6 +29135,22 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
|
|
|
28962
29135
|
"bridge-runtime.installed": "A bridge runtime finished installing.",
|
|
28963
29136
|
"opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
|
|
28964
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
|
+
},
|
|
28965
29154
|
"reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
|
|
28966
29155
|
"reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
|
|
28967
29156
|
"reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
|
|
@@ -28995,13 +29184,29 @@ var LOGGING_LOG_AREAS = defineLogAreas({
|
|
|
28995
29184
|
"capture.started": "Saving logs to disk began for this process.",
|
|
28996
29185
|
"capture.stopped": "Saving logs to disk stopped for this process.",
|
|
28997
29186
|
"config.invalid": "A logging environment variable held a value that was ignored.",
|
|
28998
|
-
"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.",
|
|
28999
29203
|
"policy.changed": "The logging settings changed: saving, retention and levels, with no content.",
|
|
29000
29204
|
"policy.bridge-predates-route": "A running bridge has no logging settings route; it applies them at its next start.",
|
|
29001
29205
|
"policy.push-failed": "A running bridge did not take the logging settings after retries; its next start resends them.",
|
|
29002
29206
|
"prune.failed": "Removing expired log files failed; the next sweep retries.",
|
|
29003
29207
|
"write.failed": "Appending to the log file failed.",
|
|
29004
|
-
"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
|
|
29005
29210
|
}
|
|
29006
29211
|
}
|
|
29007
29212
|
});
|
|
@@ -29126,7 +29331,28 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
|
|
|
29126
29331
|
"event-loop": {
|
|
29127
29332
|
description: "This process's event loop. A stall of 10 seconds or more is written at error, so no level hides it.",
|
|
29128
29333
|
events: {
|
|
29129
|
-
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
|
|
29130
29356
|
}
|
|
29131
29357
|
}
|
|
29132
29358
|
});
|
|
@@ -29364,21 +29590,43 @@ var STORAGE_LOG_AREAS = defineLogAreas({
|
|
|
29364
29590
|
description: "The SQLite-backed stores, their snapshots and imports from older formats.",
|
|
29365
29591
|
events: {
|
|
29366
29592
|
"usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
|
|
29367
|
-
"
|
|
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
|
+
},
|
|
29368
29608
|
"snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
|
|
29369
|
-
"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
|
+
},
|
|
29370
29614
|
"listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
|
|
29371
29615
|
"listener.change-failed": "A resource change listener threw; the committed mutation stands.",
|
|
29372
29616
|
"kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
|
|
29373
29617
|
"nodes.entries-dropped": "Unreadable node registry entries were ignored.",
|
|
29374
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.",
|
|
29375
29620
|
"machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
|
|
29376
29621
|
"permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
|
|
29377
29622
|
"retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
|
|
29378
29623
|
"handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
|
|
29379
29624
|
"desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
|
|
29380
29625
|
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
29381
|
-
"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
|
|
29382
29630
|
}
|
|
29383
29631
|
}
|
|
29384
29632
|
});
|
|
@@ -29486,8 +29734,10 @@ var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
|
29486
29734
|
"remote-worker.settle-failed": "A remote worker could not be settled.",
|
|
29487
29735
|
"checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
|
|
29488
29736
|
"checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
|
|
29489
|
-
"checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded, or `outcome` says why not (`timed-out`, `failed`).",
|
|
29490
|
-
"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."
|
|
29491
29741
|
}
|
|
29492
29742
|
}
|
|
29493
29743
|
});
|
|
@@ -29590,7 +29840,27 @@ var DOCKER_LOG_AREAS = defineLogAreas({
|
|
|
29590
29840
|
"recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
|
|
29591
29841
|
"github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
|
|
29592
29842
|
"availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
|
|
29593
|
-
"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
|
+
}
|
|
29594
29864
|
}
|
|
29595
29865
|
},
|
|
29596
29866
|
"docker.reachability": {
|
|
@@ -30298,6 +30568,146 @@ var LOG_VOCABULARY = {
|
|
|
30298
30568
|
...WEB_SYNC_LOG_AREAS
|
|
30299
30569
|
};
|
|
30300
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
|
+
|
|
30301
30711
|
// ../protocol/src/logger.ts
|
|
30302
30712
|
var LOG_LEVELS = ["error", "warn", "info", "debug", "trace"];
|
|
30303
30713
|
var MAX_FIELD_CHARS = 2048;
|
|
@@ -30342,7 +30752,9 @@ var DEFAULT_CONFIG = {
|
|
|
30342
30752
|
level: "info",
|
|
30343
30753
|
areaLevels: {},
|
|
30344
30754
|
format: "text",
|
|
30345
|
-
sink: consoleSink
|
|
30755
|
+
sink: consoleSink,
|
|
30756
|
+
essentialSink: null,
|
|
30757
|
+
relayEssential: false
|
|
30346
30758
|
};
|
|
30347
30759
|
var config2 = DEFAULT_CONFIG;
|
|
30348
30760
|
var generation = 0;
|
|
@@ -30453,17 +30865,38 @@ function renderText(record) {
|
|
|
30453
30865
|
function renderJson(record) {
|
|
30454
30866
|
return escapeLogLine(JSON.stringify(record));
|
|
30455
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
|
+
}
|
|
30456
30875
|
function deliver(record) {
|
|
30876
|
+
let delivered = true;
|
|
30457
30877
|
try {
|
|
30458
30878
|
config2.sink({
|
|
30459
30879
|
method: OUTPUT_METHOD[record.level],
|
|
30460
30880
|
line: config2.format === "json" ? renderJson(record) : renderText(record),
|
|
30461
30881
|
record
|
|
30462
30882
|
});
|
|
30463
|
-
return true;
|
|
30464
30883
|
} catch {
|
|
30465
|
-
|
|
30884
|
+
delivered = false;
|
|
30885
|
+
}
|
|
30886
|
+
offerEssential(record);
|
|
30887
|
+
return delivered;
|
|
30888
|
+
}
|
|
30889
|
+
function deliverEssentialOnly(record) {
|
|
30890
|
+
if (config2.essentialSink) {
|
|
30891
|
+
offerEssential(record);
|
|
30892
|
+
return;
|
|
30466
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 {}
|
|
30467
30900
|
}
|
|
30468
30901
|
function buildRecord(level, area, event, fields) {
|
|
30469
30902
|
const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
|
|
@@ -30628,12 +31061,17 @@ function deliverEvent(level, area, event, fields) {
|
|
|
30628
31061
|
return deliver(buildRecord(level, area, event, fields));
|
|
30629
31062
|
}
|
|
30630
31063
|
function tryWriteLog(level, area, event, fields) {
|
|
30631
|
-
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
|
+
}
|
|
30632
31068
|
return false;
|
|
31069
|
+
}
|
|
30633
31070
|
return deliverEvent(level, area, event, resolveFields(fields));
|
|
30634
31071
|
}
|
|
30635
31072
|
function createLogger(area) {
|
|
30636
31073
|
const spec = areaSpec(area);
|
|
31074
|
+
const mayHoldEssential = hasEssentialEvents(area);
|
|
30637
31075
|
let seenGeneration = -1;
|
|
30638
31076
|
let rank = 0;
|
|
30639
31077
|
const enabled = (level) => {
|
|
@@ -30646,9 +31084,16 @@ function createLogger(area) {
|
|
|
30646
31084
|
const writeResolved = (level, event, resolved) => {
|
|
30647
31085
|
deliverEvent(level, area, event, resolved);
|
|
30648
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
|
+
};
|
|
30649
31092
|
const write = (level, event, fields) => {
|
|
30650
|
-
if (!enabled(level))
|
|
31093
|
+
if (!enabled(level)) {
|
|
31094
|
+
writeFiltered(level, event, fields);
|
|
30651
31095
|
return;
|
|
31096
|
+
}
|
|
30652
31097
|
writeResolved(level, event, resolveFields(fields));
|
|
30653
31098
|
};
|
|
30654
31099
|
return {
|
|
@@ -30659,8 +31104,10 @@ function createLogger(area) {
|
|
|
30659
31104
|
trace: (event, fields) => write("trace", event, fields),
|
|
30660
31105
|
throttled: (level, event, options) => {
|
|
30661
31106
|
syncThrottleLevels();
|
|
30662
|
-
if (!enabled(level))
|
|
31107
|
+
if (!enabled(level)) {
|
|
31108
|
+
writeFiltered(level, event, options.fields);
|
|
30663
31109
|
return;
|
|
31110
|
+
}
|
|
30664
31111
|
if (!spec || !Object.hasOwn(spec.events, event) || event.startsWith("throttle.") || !Object.hasOwn(spec.events, "throttle.recovered")) {
|
|
30665
31112
|
deliver(buildRecord(level, spec ? area : "logging", spec ? "invalid-event" : "unknown-area", undefined));
|
|
30666
31113
|
return;
|
|
@@ -31054,6 +31501,7 @@ function restoreSession(entry, fileBytes) {
|
|
|
31054
31501
|
state.id = entry.id;
|
|
31055
31502
|
if (isNativeAgentExecutionPolicy(entry.policy))
|
|
31056
31503
|
state.policy = entry.policy;
|
|
31504
|
+
state.policyPending = true;
|
|
31057
31505
|
if (typeof entry.readOnly === "boolean")
|
|
31058
31506
|
state.readOnly = entry.readOnly;
|
|
31059
31507
|
if (nonBlank(entry.agentId))
|
|
@@ -34403,15 +34851,18 @@ async function createSession(clientSessionKey, patch, policy, readOnly) {
|
|
|
34403
34851
|
throw new SessionConflictError("This Cursor session is closing; retry once the close completes");
|
|
34404
34852
|
}
|
|
34405
34853
|
if (policy)
|
|
34406
|
-
existing
|
|
34854
|
+
await applyRequestedPolicy(existing, resolveCursorExecutionPolicy(policy));
|
|
34407
34855
|
return existing;
|
|
34408
34856
|
}
|
|
34409
34857
|
const inFlight = sessionCreations.get(clientSessionKey);
|
|
34410
|
-
if (inFlight)
|
|
34411
|
-
|
|
34858
|
+
if (inFlight) {
|
|
34859
|
+
await inFlight;
|
|
34860
|
+
return createSession(clientSessionKey, patch, policy, readOnly);
|
|
34861
|
+
}
|
|
34412
34862
|
}
|
|
34413
34863
|
const work = (async () => {
|
|
34414
34864
|
const state = newSessionState(clientSessionKey, resolveCursorExecutionPolicy(policy));
|
|
34865
|
+
state.policyPending = !policy;
|
|
34415
34866
|
state.promptJournalComplete = true;
|
|
34416
34867
|
if (typeof readOnly === "boolean")
|
|
34417
34868
|
state.readOnly = readOnly;
|
|
@@ -34432,6 +34883,8 @@ async function createSession(clientSessionKey, patch, policy, readOnly) {
|
|
|
34432
34883
|
}
|
|
34433
34884
|
}
|
|
34434
34885
|
async function ensureAgent(state, options = {}) {
|
|
34886
|
+
if (policyChanges.has(state))
|
|
34887
|
+
throw new SessionConflictError("Session policy is changing");
|
|
34435
34888
|
assertSessionOpen(state);
|
|
34436
34889
|
if (state.agent && (state.attachedMcpKey ?? "") !== mcpConnectionKey(state.agentMcp)) {
|
|
34437
34890
|
const agent = state.agent;
|
|
@@ -34460,6 +34913,8 @@ async function ensureAgent(state, options = {}) {
|
|
|
34460
34913
|
await detachAgent(state);
|
|
34461
34914
|
}
|
|
34462
34915
|
assertSessionOpen(state);
|
|
34916
|
+
if (policyChanges.has(state))
|
|
34917
|
+
throw new SessionConflictError("Session policy is changing");
|
|
34463
34918
|
if (state.agent)
|
|
34464
34919
|
return state.agent;
|
|
34465
34920
|
state.attaching ??= attach(state).finally(() => {
|
|
@@ -34684,6 +35139,10 @@ async function attach(state) {
|
|
|
34684
35139
|
if (state.configResumePending) {
|
|
34685
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 });
|
|
34686
35141
|
}
|
|
35142
|
+
log5.warn("session.resume-fell-back", {
|
|
35143
|
+
sessionId: state.id,
|
|
35144
|
+
error: formatLogError(error, { message: false })
|
|
35145
|
+
});
|
|
34687
35146
|
state.agentId = undefined;
|
|
34688
35147
|
}
|
|
34689
35148
|
}
|
|
@@ -34950,6 +35409,32 @@ function resumePolicyKey(policy) {
|
|
|
34950
35409
|
toolPolicy: resolved.toolPolicy ?? null
|
|
34951
35410
|
});
|
|
34952
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
|
+
}
|
|
34953
35438
|
function resumeComposerConflicts(state, patch) {
|
|
34954
35439
|
if (!patch)
|
|
34955
35440
|
return false;
|
|
@@ -34975,9 +35460,11 @@ async function resumeSession(agentId, patch, policy, agentMcp) {
|
|
|
34975
35460
|
throw new SessionConflictError("This Cursor session is closing; retry once the close completes");
|
|
34976
35461
|
}
|
|
34977
35462
|
if (existing) {
|
|
34978
|
-
if (
|
|
34979
|
-
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");
|
|
34980
35465
|
}
|
|
35466
|
+
if (policy)
|
|
35467
|
+
await applyRequestedPolicy(existing, resolveCursorExecutionPolicy(policy));
|
|
34981
35468
|
if (agentMcp)
|
|
34982
35469
|
existing.agentMcp = agentMcp;
|
|
34983
35470
|
return existing;
|
|
@@ -34993,6 +35480,7 @@ async function resumeSession(agentId, patch, policy, agentMcp) {
|
|
|
34993
35480
|
if (hasTombstoneForAgent(agentId))
|
|
34994
35481
|
await finishTombstonesForAgent(agentId);
|
|
34995
35482
|
const state = newSessionState(undefined, resolveCursorExecutionPolicy(policy));
|
|
35483
|
+
state.policyPending = !policy;
|
|
34996
35484
|
state.agentId = agentId;
|
|
34997
35485
|
state.agentMcp = agentMcp;
|
|
34998
35486
|
applyComposerPatch(state, patch);
|
|
@@ -35053,7 +35541,11 @@ async function recoverActiveRun(state) {
|
|
|
35053
35541
|
state.status = "running";
|
|
35054
35542
|
state.turnStartedAt = active.createdAt;
|
|
35055
35543
|
beginAssistantTurn(state);
|
|
35056
|
-
state.
|
|
35544
|
+
state.turnCancelRequested = undefined;
|
|
35545
|
+
state.cancelTurn = () => {
|
|
35546
|
+
state.turnCancelRequested = true;
|
|
35547
|
+
return active.cancel();
|
|
35548
|
+
};
|
|
35057
35549
|
state.revision += 1;
|
|
35058
35550
|
const unsubscribe = active.onDidChangeStatus(() => {
|
|
35059
35551
|
state.revision += 1;
|
|
@@ -35076,7 +35568,16 @@ async function recoverActiveRun(state) {
|
|
|
35076
35568
|
await hydrateHistory(state);
|
|
35077
35569
|
state.status = active.status === "error" ? "error" : "idle";
|
|
35078
35570
|
state.error = active.error?.message;
|
|
35571
|
+
if (active.status === "error" && state.turnCancelRequested !== true) {
|
|
35572
|
+
log5.warn("turn.recovery-failed", { sessionId: state.id });
|
|
35573
|
+
}
|
|
35079
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
|
+
}
|
|
35080
35581
|
state.status = "error";
|
|
35081
35582
|
state.error = error instanceof Error ? error.message : "Cursor run recovery failed";
|
|
35082
35583
|
} finally {
|
|
@@ -36134,6 +36635,7 @@ function classify(toolCall) {
|
|
|
36134
36635
|
return;
|
|
36135
36636
|
}
|
|
36136
36637
|
// ../../bridges/cursor-bridge/src/prompt.ts
|
|
36638
|
+
var log6 = createLogger("bridge.cursor");
|
|
36137
36639
|
var STRUCTURED_PROMPT_INSTRUCTION_PREFIX = "End your turn with exactly one JSON value";
|
|
36138
36640
|
function structuredPromptInstruction(schema) {
|
|
36139
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.
|
|
@@ -36248,7 +36750,9 @@ async function followStartedRun(state, run, promptSequence, input, diagnostics,
|
|
|
36248
36750
|
state.revision += 1;
|
|
36249
36751
|
});
|
|
36250
36752
|
let cancelling;
|
|
36753
|
+
state.turnCancelRequested = undefined;
|
|
36251
36754
|
state.cancelTurn = () => {
|
|
36755
|
+
state.turnCancelRequested = true;
|
|
36252
36756
|
if (!cancelling) {
|
|
36253
36757
|
const attempt = (async () => {
|
|
36254
36758
|
await (diagnostics ? diagnostics.cancel(run, "user") : run.cancel().catch(() => {
|
|
@@ -36333,6 +36837,7 @@ async function followRun(state, run, promptSequence, input, timeoutMs = PROMPT_T
|
|
|
36333
36837
|
}) : undefined;
|
|
36334
36838
|
if (!turnStillOwned(state, promptSequence))
|
|
36335
36839
|
return await closedTurnStopped();
|
|
36840
|
+
log6.warn("turn.timed-out", { sessionId: state.id });
|
|
36336
36841
|
state.error = error.message;
|
|
36337
36842
|
state.revision += 1;
|
|
36338
36843
|
schedulePersist();
|
|
@@ -36400,6 +36905,12 @@ function finishTurn(state, result, input, streamed) {
|
|
|
36400
36905
|
schedulePersist();
|
|
36401
36906
|
}
|
|
36402
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
|
+
}
|
|
36403
36914
|
settleBackgroundChildren(state);
|
|
36404
36915
|
settleAbandonedToolParts(state);
|
|
36405
36916
|
endTurnEvidence(state, turnEvidence.get(state), {
|
|
@@ -37270,7 +37781,8 @@ function configureLoggerFromEnvironment(env, options = {}) {
|
|
|
37270
37781
|
configureLogger({
|
|
37271
37782
|
...levels.level ? { level: levels.level } : {},
|
|
37272
37783
|
areaLevels: levels.areaLevels,
|
|
37273
|
-
format
|
|
37784
|
+
format,
|
|
37785
|
+
relayEssential: options.relayToSupervisor === true
|
|
37274
37786
|
});
|
|
37275
37787
|
const log = createLogger("logging");
|
|
37276
37788
|
if (levels.invalid.length > 0) {
|
|
@@ -38103,7 +38615,7 @@ var SOURCES = new Set([
|
|
|
38103
38615
|
var EXECUTION_KINDS = new Set(NATIVE_AGENT_COMMAND_EXECUTION_KINDS);
|
|
38104
38616
|
var ORIGINS2 = new Set(NATIVE_AGENT_COMMAND_ORIGINS);
|
|
38105
38617
|
var UNAVAILABLE_REASONS = new Set(NATIVE_AGENT_COMMAND_UNAVAILABLE_REASONS);
|
|
38106
|
-
var
|
|
38618
|
+
var ERROR_CODES2 = new Set(NATIVE_AGENT_COMMAND_CATALOGUE_ERROR_CODES);
|
|
38107
38619
|
var encoder2 = new TextEncoder;
|
|
38108
38620
|
function utf8ByteLength(value) {
|
|
38109
38621
|
if (/^[\x00-\x7f]*$/.test(value))
|
|
@@ -38391,7 +38903,7 @@ async function answerSessionActivityBatch(body, read, options = {}) {
|
|
|
38391
38903
|
}
|
|
38392
38904
|
|
|
38393
38905
|
// ../../bridges/cursor-bridge/src/http.ts
|
|
38394
|
-
var
|
|
38906
|
+
var log7 = createLogger("bridge.cursor");
|
|
38395
38907
|
|
|
38396
38908
|
class HttpError extends Error {
|
|
38397
38909
|
status;
|
|
@@ -38434,6 +38946,10 @@ async function route(request, response, clientSignal) {
|
|
|
38434
38946
|
} catch (error) {
|
|
38435
38947
|
if (error instanceof HttpError)
|
|
38436
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
|
+
}
|
|
38437
38953
|
if (error instanceof CredentialError) {
|
|
38438
38954
|
return json(response, 401, {
|
|
38439
38955
|
error: error.message,
|
|
@@ -38456,7 +38972,7 @@ async function route(request, response, clientSignal) {
|
|
|
38456
38972
|
if (error instanceof PromptAttachmentError) {
|
|
38457
38973
|
return json(response, 400, { error: error.message });
|
|
38458
38974
|
}
|
|
38459
|
-
|
|
38975
|
+
log7.error("http.route-failed");
|
|
38460
38976
|
return json(response, 500, { error: "Internal bridge error" });
|
|
38461
38977
|
}
|
|
38462
38978
|
}
|
|
@@ -38973,6 +39489,9 @@ function unsupportedCommandRefresh() {
|
|
|
38973
39489
|
}
|
|
38974
39490
|
async function handlePrompt(request, response, state, clientSignal) {
|
|
38975
39491
|
const body = await readJson(request);
|
|
39492
|
+
if (isNativeAgentExecutionPolicy(body.policy)) {
|
|
39493
|
+
assertExecutionPolicyNotWidened(liveExecutionPolicy(state), resolveCursorExecutionPolicy(body.policy));
|
|
39494
|
+
}
|
|
38976
39495
|
const prompt = typeof body.prompt === "string" ? body.prompt.trim() : "";
|
|
38977
39496
|
const requestId = readBoundedString(body.requestId, MAX_PROMPT_REQUEST_ID_BYTES, "requestId");
|
|
38978
39497
|
const schema = isObject(body.outputSchema) ? body.outputSchema : undefined;
|
|
@@ -39018,6 +39537,7 @@ async function handlePrompt(request, response, state, clientSignal) {
|
|
|
39018
39537
|
kind: "prompt-journal-saturated"
|
|
39019
39538
|
});
|
|
39020
39539
|
}
|
|
39540
|
+
state.policyPending = false;
|
|
39021
39541
|
const idleSteer = commandFields.allowProviderCommands ? idleSteerPromptReply(prompt, "Cursor") : null;
|
|
39022
39542
|
if (idleSteer) {
|
|
39023
39543
|
assertSessionOpen(state);
|
|
@@ -39154,6 +39674,10 @@ async function dispatchClaimedPrompt(response, state, input) {
|
|
|
39154
39674
|
userMessageId
|
|
39155
39675
|
});
|
|
39156
39676
|
} catch (error) {
|
|
39677
|
+
log7.warn("turn.send-failed", {
|
|
39678
|
+
sessionId: state.id,
|
|
39679
|
+
error: formatLogError(error, { message: false })
|
|
39680
|
+
});
|
|
39157
39681
|
state.status = "error";
|
|
39158
39682
|
state.error = errorText(error);
|
|
39159
39683
|
state.dispatching = false;
|
|
@@ -39444,7 +39968,7 @@ function startParentWatchdog(options) {
|
|
|
39444
39968
|
}
|
|
39445
39969
|
|
|
39446
39970
|
// ../protocol/src/bridge-lifecycle.ts
|
|
39447
|
-
var
|
|
39971
|
+
var log8 = createLogger("bridge.lifecycle");
|
|
39448
39972
|
var TERMINATION_SIGNALS = ["SIGTERM", "SIGINT"];
|
|
39449
39973
|
function errorKind(error) {
|
|
39450
39974
|
if (error instanceof Error)
|
|
@@ -39498,7 +40022,7 @@ class BridgeLifecycle {
|
|
|
39498
40022
|
}
|
|
39499
40023
|
requestExit() {
|
|
39500
40024
|
this.#exit ??= this.shutdown().then(() => this.#options.exit(0), (error) => {
|
|
39501
|
-
|
|
40025
|
+
log8.error("shutdown.failed", {
|
|
39502
40026
|
bridge: this.#options.label,
|
|
39503
40027
|
errorClass: errorKind(error)
|
|
39504
40028
|
});
|
|
@@ -39515,7 +40039,7 @@ class BridgeLifecycle {
|
|
|
39515
40039
|
try {
|
|
39516
40040
|
idleSweep.run();
|
|
39517
40041
|
} catch (error) {
|
|
39518
|
-
|
|
40042
|
+
log8.warn("idle-sweep.failed", {
|
|
39519
40043
|
bridge: this.#options.label,
|
|
39520
40044
|
errorClass: errorKind(error)
|
|
39521
40045
|
});
|
|
@@ -39587,7 +40111,7 @@ async function settleIdleDetaches() {
|
|
|
39587
40111
|
}
|
|
39588
40112
|
|
|
39589
40113
|
// ../../bridges/cursor-bridge/src/server.ts
|
|
39590
|
-
var
|
|
40114
|
+
var log9 = createLogger("bridge.cursor");
|
|
39591
40115
|
var IDLE_SWEEP_MS = 60 * 1000;
|
|
39592
40116
|
var lifecycle;
|
|
39593
40117
|
var server = createServer((request, response) => {
|
|
@@ -39622,7 +40146,7 @@ function lifecycleFor(listenPort, options) {
|
|
|
39622
40146
|
applyWorkingDirectory();
|
|
39623
40147
|
await loadPersistedState();
|
|
39624
40148
|
finishRestoredTombstones().catch(() => {
|
|
39625
|
-
|
|
40149
|
+
log9.warn("startup.closes-failed");
|
|
39626
40150
|
});
|
|
39627
40151
|
await new Promise((resolve) => server.listen(listenPort, hostname, resolve));
|
|
39628
40152
|
},
|
|
@@ -39776,6 +40300,9 @@ function installFatalRejectionGuard(options) {
|
|
|
39776
40300
|
try {
|
|
39777
40301
|
warn(`${options.label} Unhandled promise rejection (continuing): ${describe(reason)}`);
|
|
39778
40302
|
} catch {}
|
|
40303
|
+
try {
|
|
40304
|
+
options.onRejection?.(reason);
|
|
40305
|
+
} catch {}
|
|
39779
40306
|
};
|
|
39780
40307
|
target.on("unhandledRejection", handler);
|
|
39781
40308
|
return () => {
|
|
@@ -39783,6 +40310,15 @@ function installFatalRejectionGuard(options) {
|
|
|
39783
40310
|
};
|
|
39784
40311
|
}
|
|
39785
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
|
+
|
|
39786
40322
|
// ../../bridges/cursor-bridge/src/login-cli.ts
|
|
39787
40323
|
async function runLogin(emit) {
|
|
39788
40324
|
const handle = beginLogin({ openBrowser: true });
|
|
@@ -39814,7 +40350,7 @@ async function runLogin(emit) {
|
|
|
39814
40350
|
|
|
39815
40351
|
// ../../bridges/cursor-bridge/src/index.ts
|
|
39816
40352
|
configureBridgeLogger();
|
|
39817
|
-
installFatalRejectionGuard({ label: "[cursor-bridge]" });
|
|
40353
|
+
installFatalRejectionGuard({ label: "[cursor-bridge]", onRejection: logUnhandledRejection });
|
|
39818
40354
|
if (process.argv.includes("--login")) {
|
|
39819
40355
|
process.exit(await runLogin((line) => process.stdout.write(`${line}
|
|
39820
40356
|
`)));
|
|
@@ -39945,6 +40481,7 @@ export {
|
|
|
39945
40481
|
json,
|
|
39946
40482
|
listModels,
|
|
39947
40483
|
listResumableSessions,
|
|
40484
|
+
liveExecutionPolicy,
|
|
39948
40485
|
loadPersistedState,
|
|
39949
40486
|
logout,
|
|
39950
40487
|
messageWindow,
|