@myagentroam/node 0.9.62 → 0.9.65
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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/dist/capabilities.js +110 -2
- package/dist/claude-agent-sdk.js +330 -2
- package/dist/claude-channel.js +44 -2
- package/dist/codex-app-server.js +510 -2
- package/dist/config.js +106 -2
- package/dist/connector/node-connector-options.js +1 -2
- package/dist/connector/node-operation-router.js +22 -2
- package/dist/connector.js +1736 -2
- package/dist/control-outbound-scheduler.js +153 -2
- package/dist/database.js +639 -2
- package/dist/fake-runner.js +129 -2
- package/dist/git-askpass.js +12 -0
- package/dist/git-execution-helper.js +266 -0
- package/dist/health.js +3 -2
- package/dist/main.js +57 -2
- package/dist/mcp-installation-model.js +1 -2
- package/dist/migrations/v004.js +55 -3
- package/dist/migrations/v005.js +13 -3
- package/dist/migrations/v006.js +90 -3
- package/dist/migrations/v007.js +22 -3
- package/dist/migrations/v008.js +18 -3
- package/dist/migrations/v009.js +70 -4
- package/dist/migrations/v010.js +43 -3
- package/dist/migrations/v011.js +20 -3
- package/dist/migrations/v012.js +8 -0
- package/dist/native-jsonl-reader.js +186 -2
- package/dist/native-session-history.js +1143 -2
- package/dist/opencode-runtime.js +80 -2
- package/dist/opencode-server.js +259 -2
- package/dist/operational.js +122 -2
- package/dist/process-tree.js +18 -2
- package/dist/ripgrep-binary.js +31 -2
- package/dist/rotating-log.js +67 -2
- package/dist/runner/abstract-runner.js +260 -2
- package/dist/runner/claude/managed-run-controller.js +355 -2
- package/dist/runner/claude/tool-normalizer.js +120 -2
- package/dist/runner/claude-code-runner.js +303 -2
- package/dist/runner/codex/composer-image-markers.js +8 -2
- package/dist/runner/codex/conversation-parser.js +913 -2
- package/dist/runner/codex/managed-run-controller.js +494 -2
- package/dist/runner/codex/tool-normalizer.js +214 -2
- package/dist/runner/codex-runner.js +585 -2
- package/dist/runner/fake-test-runner.js +47 -2
- package/dist/runner/mar-agent/conversation-normalizer.js +644 -2
- package/dist/runner/mar-agent/executor-stdio-client-transport.js +139 -2
- package/dist/runner/mar-agent/generated-images.js +41 -2
- package/dist/runner/mar-agent/history-projection.js +106 -2
- package/dist/runner/mar-agent/hosted-conversation-runtime.js +446 -2
- package/dist/runner/mar-agent/managed-run-controller.js +785 -2
- package/dist/runner/mar-agent/mcp-client-pool.js +233 -2
- package/dist/runner/mar-agent/runtime-model-factory.js +326 -2
- package/dist/runner/mar-agent-runner.js +458 -2
- package/dist/runner/opencode/conversation-parser.js +221 -2
- package/dist/runner/opencode/managed-run-controller.js +588 -2
- package/dist/runner/opencode/tool-normalizer.js +80 -2
- package/dist/runner/opencode-runner.js +426 -2
- package/dist/runner/runner-registry.js +87 -2
- package/dist/runner-command-engine.js +71 -2
- package/dist/runner-profiles.js +323 -2
- package/dist/runner-usage.js +190 -2
- package/dist/runtime-command-detector.js +73 -2
- package/dist/runtime-model.js +1 -2
- package/dist/runtime-state.js +1509 -2
- package/dist/service/attachment-domain-state.js +7 -2
- package/dist/service/bubblewrap-sandbox-executor.js +543 -2
- package/dist/service/continuous-run-coordinator.js +425 -2
- package/dist/service/conversation-history-service.js +552 -2
- package/dist/service/conversation-hosting-capability-service.js +61 -2
- package/dist/service/conversation-hosting-enablement-service.js +91 -2
- package/dist/service/conversation-hosting-maintenance-service.js +174 -2
- package/dist/service/conversation-segment-service.js +162 -2
- package/dist/service/conversation-template-node-service.js +992 -2
- package/dist/service/external-session-resume-service.js +152 -2
- package/dist/service/fake-managed-run-service.js +60 -2
- package/dist/service/git-execution-service.js +418 -0
- package/dist/service/git-operation-service.js +57 -0
- package/dist/service/hosted-conversation-node-service.js +1982 -2
- package/dist/service/hosted-conversation-store.js +1405 -2
- package/dist/service/managed-runner-session-service.js +35 -2
- package/dist/service/mar-agent-model-transport-test-service.js +88 -2
- package/dist/service/mcp-installation-verifier.js +87 -2
- package/dist/service/mcp-node-operation-service.js +90 -2
- package/dist/service/mission-mcp-server.js +124 -2
- package/dist/service/mission-mcp-stdio.js +40 -2
- package/dist/service/mission-runtime.js +142 -2
- package/dist/service/native-session-projection-service.js +274 -2
- package/dist/service/native-session-watch-service.js +683 -2
- package/dist/service/node-connection-lifecycle-service.js +88 -2
- package/dist/service/node-control-channel.js +85 -2
- package/dist/service/node-control-message-service.js +109 -2
- package/dist/service/node-request-service.js +62 -2
- package/dist/service/node-run-event-bridge.js +88 -2
- package/dist/service/node-terminal-channel.js +202 -2
- package/dist/service/node-upgrade-coordinator.js +137 -2
- package/dist/service/node-workspace-coordinator.js +97 -2
- package/dist/service/recent-run-projection-service.js +99 -2
- package/dist/service/run-attachment-service.js +321 -2
- package/dist/service/run-domain-state.js +4 -2
- package/dist/service/run-event-service.js +246 -2
- package/dist/service/run-ownership-policy.js +22 -2
- package/dist/service/run-workbench-service.js +120 -2
- package/dist/service/runner-channel-message-service.js +20 -2
- package/dist/service/runner-interaction-service.js +243 -2
- package/dist/service/runner-service.js +69 -2
- package/dist/service/runtime-credential-control-service.js +95 -2
- package/dist/service/session-catalog-service.js +404 -2
- package/dist/service/session-command-service.js +125 -2
- package/dist/service/session-context-service.js +128 -2
- package/dist/service/session-domain-state.js +9 -2
- package/dist/service/session-identity-service.js +86 -2
- package/dist/service/session-lifecycle-service.js +248 -2
- package/dist/service/session-message-service.js +270 -2
- package/dist/service/session-presentation-service.js +43 -2
- package/dist/service/session-query-service.js +82 -2
- package/dist/service/session-watch-slot-coordinator.js +21 -2
- package/dist/service/skill-directory-service.js +238 -2
- package/dist/service/skill-install-service.js +434 -2
- package/dist/service/skill-node-operation-service.js +206 -2
- package/dist/service/terminal-relay-state.js +3 -2
- package/dist/service/terminal-service.js +90 -2
- package/dist/service/web-search-error.js +40 -2
- package/dist/service/workbench-event-service.js +21 -2
- package/dist/service/workbench-manifest-service.js +69 -2
- package/dist/service/workspace-change-service.js +290 -2
- package/dist/service/workspace-content-search-service.js +457 -2
- package/dist/service/workspace-domain-state.js +41 -2
- package/dist/service/workspace-file-service.js +150 -2
- package/dist/service/workspace-git-exclude-service.js +119 -2
- package/dist/service/workspace-queue-workbench-service.js +176 -2
- package/dist/service/workspace-service.js +92 -2
- package/dist/service/workspace-session-service.js +154 -2
- package/dist/service/workspace-upload-service.js +262 -2
- package/dist/service/workspace-watch-controller.js +68 -2
- package/dist/service/workspace-watch-service.js +170 -2
- package/dist/service/workspace-watch-snapshot-service.js +218 -2
- package/dist/service/workspace-workbench-service.js +239 -2
- package/dist/service.js +91 -2
- package/dist/storage.js +32 -2
- package/dist/supervisor.js +136 -2
- package/dist/terminal.js +496 -2
- package/dist/util/git-credential-client.js +32 -0
- package/dist/util/node-operation-data.js +9 -2
- package/dist/util/node-operation-parsers.js +382 -2
- package/dist/util/personal-instructions.js +34 -2
- package/dist/util/runner-error.js +70 -2
- package/dist/util/runner-native-session-parsers.js +510 -2
- package/dist/util/safe-error.js +8 -2
- package/dist/util/secret-environment.js +25 -2
- package/dist/workspace.js +1793 -2
- package/package.json +11 -8
- package/vendor/ripgrep/darwin-arm64/rg +0 -0
- package/vendor/ripgrep/darwin-x64/rg +0 -0
- package/vendor/ripgrep/manifest.json +12 -0
- package/README.md +0 -42
- package/dist/event-buffer.js +0 -2
- package/dist/migrations/v001.js +0 -107
- package/dist/migrations/v002.js +0 -2
- package/dist/migrations/v003.js +0 -2
- package/dist/service/mcp-package-installer.js +0 -2
|
@@ -1,2 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
1
|
+
import { nodeLog } from './operational.js';
|
|
2
|
+
const MAX_FRAMES_PER_TURN = 32;
|
|
3
|
+
const MAX_BYTES_PER_TURN = 256 * 1024;
|
|
4
|
+
const SOCKET_NORMAL_DIRECT_WATER_BYTES = 256 * 1024;
|
|
5
|
+
const SOCKET_HIGH_WATER_BYTES = 1024 * 1024;
|
|
6
|
+
const BACKPRESSURE_RETRY_MS = 5;
|
|
7
|
+
const OUTBOUND_QUEUE_TTL_MS = 30_000;
|
|
8
|
+
/** Keeps control responses responsive while reliable Workbench events are busy. */
|
|
9
|
+
export class ControlOutboundScheduler {
|
|
10
|
+
socket;
|
|
11
|
+
onExpired;
|
|
12
|
+
high = [];
|
|
13
|
+
normal = [];
|
|
14
|
+
scheduled = false;
|
|
15
|
+
retryTimer;
|
|
16
|
+
expiryTimer;
|
|
17
|
+
backpressureStartedAt;
|
|
18
|
+
backpressureLogged = false;
|
|
19
|
+
maximumHighDepth = 0;
|
|
20
|
+
maximumNormalDepth = 0;
|
|
21
|
+
constructor(socket, onExpired = () => undefined) {
|
|
22
|
+
this.socket = socket;
|
|
23
|
+
this.onExpired = onExpired;
|
|
24
|
+
}
|
|
25
|
+
enqueue(envelope, priority) {
|
|
26
|
+
const socket = this.socket();
|
|
27
|
+
const bufferedAmount = socket?.bufferedAmount ?? 0;
|
|
28
|
+
if (socket !== undefined &&
|
|
29
|
+
socket.readyState === 1 &&
|
|
30
|
+
this.high.length === 0 &&
|
|
31
|
+
(priority === 'high' || this.normal.length === 0) &&
|
|
32
|
+
bufferedAmount <= SOCKET_NORMAL_DIRECT_WATER_BYTES) {
|
|
33
|
+
socket.send(JSON.stringify(envelope));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
(priority === 'high' ? this.high : this.normal).push({
|
|
37
|
+
envelope,
|
|
38
|
+
expiresAt: Date.now() + OUTBOUND_QUEUE_TTL_MS
|
|
39
|
+
});
|
|
40
|
+
this.maximumHighDepth = Math.max(this.maximumHighDepth, this.high.length);
|
|
41
|
+
this.maximumNormalDepth = Math.max(this.maximumNormalDepth, this.normal.length);
|
|
42
|
+
this.scheduleExpiry();
|
|
43
|
+
this.schedule();
|
|
44
|
+
}
|
|
45
|
+
reset() {
|
|
46
|
+
this.high.length = 0;
|
|
47
|
+
this.normal.length = 0;
|
|
48
|
+
this.scheduled = false;
|
|
49
|
+
if (this.retryTimer !== undefined)
|
|
50
|
+
clearTimeout(this.retryTimer);
|
|
51
|
+
this.retryTimer = undefined;
|
|
52
|
+
if (this.expiryTimer !== undefined)
|
|
53
|
+
clearTimeout(this.expiryTimer);
|
|
54
|
+
this.expiryTimer = undefined;
|
|
55
|
+
this.finishBackpressure('reset');
|
|
56
|
+
}
|
|
57
|
+
schedule() {
|
|
58
|
+
if (this.scheduled || this.retryTimer !== undefined)
|
|
59
|
+
return;
|
|
60
|
+
this.scheduled = true;
|
|
61
|
+
setImmediate(() => this.flush());
|
|
62
|
+
}
|
|
63
|
+
flush() {
|
|
64
|
+
this.scheduled = false;
|
|
65
|
+
const socket = this.socket();
|
|
66
|
+
if (socket === undefined || socket.readyState !== 1)
|
|
67
|
+
return;
|
|
68
|
+
if ((socket.bufferedAmount ?? 0) > SOCKET_HIGH_WATER_BYTES) {
|
|
69
|
+
this.waitForBackpressure(socket, 'high');
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let frames = 0;
|
|
73
|
+
let bytes = 0;
|
|
74
|
+
while (frames < MAX_FRAMES_PER_TURN) {
|
|
75
|
+
const queue = this.high.length > 0 ? this.high : this.normal;
|
|
76
|
+
const queued = queue[0];
|
|
77
|
+
if (queued === undefined)
|
|
78
|
+
break;
|
|
79
|
+
// High-frequency Workbench events can arrive in bursts. Stop normal traffic early so a later
|
|
80
|
+
// HTTP/control response keeps WebSocket buffer headroom instead of waiting behind the burst.
|
|
81
|
+
if (queue === this.normal &&
|
|
82
|
+
(socket.bufferedAmount ?? 0) > SOCKET_NORMAL_DIRECT_WATER_BYTES) {
|
|
83
|
+
this.waitForBackpressure(socket, 'normal');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const serialized = JSON.stringify(queued.envelope);
|
|
87
|
+
const size = Buffer.byteLength(serialized);
|
|
88
|
+
if (frames > 0 && bytes + size > MAX_BYTES_PER_TURN)
|
|
89
|
+
break;
|
|
90
|
+
queue.shift();
|
|
91
|
+
socket.send(serialized);
|
|
92
|
+
frames += 1;
|
|
93
|
+
bytes += size;
|
|
94
|
+
if ((socket.bufferedAmount ?? 0) > SOCKET_HIGH_WATER_BYTES)
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
if (this.high.length > 0 || this.normal.length > 0)
|
|
98
|
+
this.schedule();
|
|
99
|
+
else {
|
|
100
|
+
if (this.expiryTimer !== undefined)
|
|
101
|
+
clearTimeout(this.expiryTimer);
|
|
102
|
+
this.expiryTimer = undefined;
|
|
103
|
+
this.finishBackpressure('drained');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
waitForBackpressure(socket, level) {
|
|
107
|
+
this.backpressureStartedAt ??= Date.now();
|
|
108
|
+
if (!this.backpressureLogged && Date.now() - this.backpressureStartedAt >= 250) {
|
|
109
|
+
this.backpressureLogged = true;
|
|
110
|
+
nodeLog('control.outbound.backpressure', {
|
|
111
|
+
level,
|
|
112
|
+
bufferedBytes: socket.bufferedAmount,
|
|
113
|
+
highDepth: this.high.length,
|
|
114
|
+
normalDepth: this.normal.length
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
this.retryTimer = setTimeout(() => {
|
|
118
|
+
this.retryTimer = undefined;
|
|
119
|
+
this.schedule();
|
|
120
|
+
}, BACKPRESSURE_RETRY_MS);
|
|
121
|
+
}
|
|
122
|
+
finishBackpressure(reason) {
|
|
123
|
+
if (this.backpressureLogged)
|
|
124
|
+
nodeLog('control.outbound.backpressure.recovered', {
|
|
125
|
+
reason,
|
|
126
|
+
durationMs: Date.now() - (this.backpressureStartedAt ?? Date.now()),
|
|
127
|
+
maximumHighDepth: this.maximumHighDepth,
|
|
128
|
+
maximumNormalDepth: this.maximumNormalDepth
|
|
129
|
+
});
|
|
130
|
+
this.backpressureStartedAt = undefined;
|
|
131
|
+
this.backpressureLogged = false;
|
|
132
|
+
this.maximumHighDepth = 0;
|
|
133
|
+
this.maximumNormalDepth = 0;
|
|
134
|
+
}
|
|
135
|
+
scheduleExpiry() {
|
|
136
|
+
if (this.expiryTimer !== undefined)
|
|
137
|
+
return;
|
|
138
|
+
const expiresAt = Math.min(this.high[0]?.expiresAt ?? Number.POSITIVE_INFINITY, this.normal[0]?.expiresAt ?? Number.POSITIVE_INFINITY);
|
|
139
|
+
if (!Number.isFinite(expiresAt))
|
|
140
|
+
return;
|
|
141
|
+
this.expiryTimer = setTimeout(() => {
|
|
142
|
+
this.expiryTimer = undefined;
|
|
143
|
+
if ((this.high[0]?.expiresAt ?? Number.POSITIVE_INFINITY) > Date.now() &&
|
|
144
|
+
(this.normal[0]?.expiresAt ?? Number.POSITIVE_INFINITY) > Date.now()) {
|
|
145
|
+
this.scheduleExpiry();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
this.reset();
|
|
149
|
+
this.onExpired();
|
|
150
|
+
}, Math.max(0, expiresAt - Date.now()));
|
|
151
|
+
this.expiryTimer.unref();
|
|
152
|
+
}
|
|
153
|
+
}
|