@mininglamp-oss/octo-runtime 1.1.14 → 1.1.15
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/apps/cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-AE3OJBDS.js → chunk-RIZUXNZ2.js} +114 -39
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +5 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.d.ts +5 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +20 -20
- package/node_modules/@mininglamp-oss/octo-runtime-client/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-client/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-output-silence.js +58 -45
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +24 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-acp-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-acp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.15",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-antigravity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-claude-code",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-codebuddy",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
10
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.15",
|
|
10
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15"
|
|
11
11
|
},
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-codex",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -33,7 +33,10 @@ var DshTrajectory = class {
|
|
|
33
33
|
#receipts = /* @__PURE__ */ new Set();
|
|
34
34
|
#lastReason;
|
|
35
35
|
#lastNativeCode;
|
|
36
|
-
|
|
36
|
+
// 原生 commit 早于工具执行,甚至早于后续 turn。只暂存一个 root 候选,发布后不改分类。
|
|
37
|
+
#pendingText = [];
|
|
38
|
+
#pendingBytes = 0;
|
|
39
|
+
#pendingStep;
|
|
37
40
|
#objects = 0;
|
|
38
41
|
constructor(sessionId, maxTextBytes) {
|
|
39
42
|
this.sessionId = sessionId;
|
|
@@ -51,26 +54,53 @@ var DshTrajectory = class {
|
|
|
51
54
|
const parentSessionId = this.#sessions.get(sessionId)?.parent;
|
|
52
55
|
return { providerSessionId: sessionId, ...parentSessionId ? { parentSessionId } : {} };
|
|
53
56
|
}
|
|
57
|
+
#flushText(channel) {
|
|
58
|
+
const events = this.#pendingText.map((value) => event(value.type, { ...value.payload, channel }));
|
|
59
|
+
this.#pendingText = [];
|
|
60
|
+
this.#pendingBytes = 0;
|
|
61
|
+
return events;
|
|
62
|
+
}
|
|
63
|
+
#settleStep(channel, status) {
|
|
64
|
+
const output = this.#flushText(channel);
|
|
65
|
+
if (this.#pendingStep) {
|
|
66
|
+
const value = this.#pendingStep.event;
|
|
67
|
+
output.push(event(value.type, {
|
|
68
|
+
...value.payload,
|
|
69
|
+
...status ? { status } : {},
|
|
70
|
+
...channel === "final" ? { finishReason: "stop" } : {}
|
|
71
|
+
}));
|
|
72
|
+
this.#pendingStep = void 0;
|
|
73
|
+
}
|
|
74
|
+
return output;
|
|
75
|
+
}
|
|
54
76
|
accept(notification) {
|
|
55
77
|
const { method, params } = notification;
|
|
56
78
|
if (method === "subagent.started") {
|
|
57
|
-
|
|
79
|
+
const parent = this.#sessions.get(String(params.parentSessionId));
|
|
80
|
+
if (!parent || parent.activity?.finished)
|
|
58
81
|
return [];
|
|
59
82
|
required(identifier(params.childSessionId) && identifier(params.parentSessionId));
|
|
60
83
|
const child = this.#sessions.get(params.childSessionId);
|
|
84
|
+
let generation = 0;
|
|
61
85
|
if (child) {
|
|
62
86
|
required(child.parent === params.parentSessionId);
|
|
63
|
-
|
|
87
|
+
if (!child.activity?.finished)
|
|
88
|
+
return [];
|
|
89
|
+
this.#bound();
|
|
90
|
+
generation = child.activity.generation + 1;
|
|
91
|
+
child.activity = { generation, finished: false };
|
|
92
|
+
} else {
|
|
93
|
+
required(this.#sessions.size < 128 && params.childSessionId !== this.sessionId);
|
|
94
|
+
this.#sessions.set(params.childSessionId, {
|
|
95
|
+
parent: params.parentSessionId,
|
|
96
|
+
seq: -1,
|
|
97
|
+
digest: "",
|
|
98
|
+
activity: { generation, finished: false }
|
|
99
|
+
});
|
|
64
100
|
}
|
|
65
|
-
required(this.#sessions.size < 128 && params.childSessionId !== this.sessionId);
|
|
66
|
-
this.#sessions.set(params.childSessionId, {
|
|
67
|
-
parent: params.parentSessionId,
|
|
68
|
-
seq: -1,
|
|
69
|
-
digest: ""
|
|
70
|
-
});
|
|
71
101
|
return [
|
|
72
102
|
event("activity.started", {
|
|
73
|
-
activityId: this.#id(params.childSessionId, "agent",
|
|
103
|
+
activityId: this.#id(params.childSessionId, "agent", generation),
|
|
74
104
|
kind: "working",
|
|
75
105
|
subject: { type: "run" },
|
|
76
106
|
source: "provider",
|
|
@@ -85,12 +115,15 @@ var DshTrajectory = class {
|
|
|
85
115
|
}
|
|
86
116
|
if (method === "subagent.finished") {
|
|
87
117
|
const child = typeof params.childSessionId === "string" ? this.#sessions.get(params.childSessionId) : void 0;
|
|
88
|
-
if (!child)
|
|
118
|
+
if (!child?.activity)
|
|
89
119
|
return [];
|
|
90
120
|
required(child.parent === params.parentSessionId && ["ok", "error"].includes(String(params.status)));
|
|
121
|
+
if (child.activity.finished)
|
|
122
|
+
return [];
|
|
123
|
+
child.activity.finished = true;
|
|
91
124
|
return [
|
|
92
125
|
event("activity.finished", {
|
|
93
|
-
activityId: this.#id(String(params.childSessionId), "agent",
|
|
126
|
+
activityId: this.#id(String(params.childSessionId), "agent", child.activity.generation),
|
|
94
127
|
status: params.status === "ok" ? "completed" : "failed"
|
|
95
128
|
})
|
|
96
129
|
];
|
|
@@ -100,7 +133,7 @@ var DshTrajectory = class {
|
|
|
100
133
|
required(identifier(params.sessionId));
|
|
101
134
|
const sessionId = params.sessionId;
|
|
102
135
|
const state = this.#sessions.get(sessionId);
|
|
103
|
-
if (!state)
|
|
136
|
+
if (!state || state.activity?.finished)
|
|
104
137
|
return [];
|
|
105
138
|
const source = params.event;
|
|
106
139
|
required(record(source) && identifier(source.type) && integer(source.seq) && integer(source.time) && record(source.data));
|
|
@@ -132,8 +165,8 @@ var DshTrajectory = class {
|
|
|
132
165
|
required(integer(data.turn) && !this.#turns.has(sessionId));
|
|
133
166
|
this.#turns.set(sessionId, data.turn);
|
|
134
167
|
if (sessionId === this.sessionId) {
|
|
168
|
+
output.push(...this.#settleStep("commentary"));
|
|
135
169
|
this.#lastReason = void 0;
|
|
136
|
-
this.#lastAnswer = false;
|
|
137
170
|
}
|
|
138
171
|
output.push(event("activity.started", {
|
|
139
172
|
activityId: this.#id(sessionId, "turn", data.turn),
|
|
@@ -147,21 +180,38 @@ var DshTrajectory = class {
|
|
|
147
180
|
case "step/start":
|
|
148
181
|
required(integer(data.turn) && integer(data.step) && this.#turns.get(sessionId) === data.turn && !this.#steps.has(sessionId));
|
|
149
182
|
this.#bound();
|
|
150
|
-
this
|
|
183
|
+
if (sessionId === this.sessionId)
|
|
184
|
+
output.push(...this.#settleStep("commentary"));
|
|
185
|
+
this.#steps.set(sessionId, {
|
|
186
|
+
id: stepId,
|
|
187
|
+
tools: false,
|
|
188
|
+
committed: false,
|
|
189
|
+
answer: false,
|
|
190
|
+
interrupted: false
|
|
191
|
+
});
|
|
151
192
|
output.push(event("model_step.started", { stepId, startedAtMs: source.time, ...lineage }));
|
|
152
193
|
break;
|
|
153
|
-
case "step/end":
|
|
154
|
-
|
|
194
|
+
case "step/end": {
|
|
195
|
+
const step = this.#steps.get(sessionId);
|
|
196
|
+
required(step?.id === stepId && !this.#messages.has(sessionId));
|
|
197
|
+
required(![...this.#tools.values()].some((tool) => tool.stepId === stepId));
|
|
155
198
|
this.#steps.delete(sessionId);
|
|
156
|
-
|
|
199
|
+
const finished = event("model_step.finished", {
|
|
157
200
|
stepId,
|
|
158
|
-
status: "completed",
|
|
201
|
+
status: step.interrupted ? "cancelled" : "completed",
|
|
202
|
+
...step.tools ? { finishReason: "tool-calls" } : {},
|
|
159
203
|
endedAtMs: source.time,
|
|
160
204
|
...lineage
|
|
161
|
-
})
|
|
205
|
+
});
|
|
206
|
+
if (sessionId === this.sessionId && !step.tools)
|
|
207
|
+
this.#pendingStep = { event: finished, answer: step.answer && !step.interrupted };
|
|
208
|
+
else
|
|
209
|
+
output.push(finished);
|
|
162
210
|
break;
|
|
211
|
+
}
|
|
163
212
|
case "assistant/chunk": {
|
|
164
|
-
|
|
213
|
+
const step = this.#steps.get(sessionId);
|
|
214
|
+
required(step?.id === stepId && !step.committed && record(data.chunk));
|
|
165
215
|
const chunk = data.chunk;
|
|
166
216
|
if (chunk.type !== "text-delta")
|
|
167
217
|
break;
|
|
@@ -182,7 +232,8 @@ var DshTrajectory = class {
|
|
|
182
232
|
break;
|
|
183
233
|
}
|
|
184
234
|
case "assistant/message": {
|
|
185
|
-
|
|
235
|
+
const step = this.#steps.get(sessionId);
|
|
236
|
+
required(step?.id === stepId && !step.committed && record(data.message) && Array.isArray(data.message.content));
|
|
186
237
|
const blocks = data.message.content;
|
|
187
238
|
required(blocks.every((block) => record(block) && typeof block.type === "string"));
|
|
188
239
|
const text = blocks.filter((block) => block.type === "text").map((block) => {
|
|
@@ -197,7 +248,7 @@ var DshTrajectory = class {
|
|
|
197
248
|
if (reasoning) {
|
|
198
249
|
required(Buffer.byteLength(reasoning) <= this.maxTextBytes);
|
|
199
250
|
const analysis = {
|
|
200
|
-
|
|
251
|
+
messageId: this.#id(sessionId, "analysis", source.seq),
|
|
201
252
|
role: "assistant",
|
|
202
253
|
channel: "analysis",
|
|
203
254
|
exposure: "private_reasoning",
|
|
@@ -215,20 +266,24 @@ var DshTrajectory = class {
|
|
|
215
266
|
status: "streaming"
|
|
216
267
|
}));
|
|
217
268
|
let sent = existing?.text ?? "";
|
|
218
|
-
if (
|
|
269
|
+
if (data.stream !== void 0) {
|
|
219
270
|
required(Array.isArray(data.stream));
|
|
271
|
+
let recorded = "";
|
|
220
272
|
for (const part of data.stream) {
|
|
221
273
|
required(record(part) && typeof part.type === "string");
|
|
222
274
|
if (part.type !== "text-chunks")
|
|
223
275
|
continue;
|
|
224
276
|
required(Array.isArray(part.texts) && part.texts.every((item) => typeof item === "string"));
|
|
225
277
|
for (const delta of part.texts) {
|
|
226
|
-
|
|
227
|
-
required(Buffer.byteLength(
|
|
228
|
-
if (delta)
|
|
278
|
+
recorded += delta;
|
|
279
|
+
required(Buffer.byteLength(recorded) <= this.maxTextBytes);
|
|
280
|
+
if (!existing && delta)
|
|
229
281
|
output.push(this.#messageEvent("message.delta", messageId, sessionId, stepId, { text: delta }));
|
|
230
282
|
}
|
|
231
283
|
}
|
|
284
|
+
required(text.startsWith(recorded));
|
|
285
|
+
if (!existing)
|
|
286
|
+
sent = recorded;
|
|
232
287
|
}
|
|
233
288
|
required(text.startsWith(sent));
|
|
234
289
|
if (text.length > sent.length)
|
|
@@ -241,8 +296,9 @@ var DshTrajectory = class {
|
|
|
241
296
|
}));
|
|
242
297
|
this.#messages.delete(sessionId);
|
|
243
298
|
this.#bound();
|
|
244
|
-
|
|
245
|
-
|
|
299
|
+
step.committed = true;
|
|
300
|
+
step.answer = text.trim().length > 0;
|
|
301
|
+
step.interrupted = data.interrupted === true;
|
|
246
302
|
if (record(data.usage)) {
|
|
247
303
|
const usage = Object.fromEntries(Object.entries(data.usage).filter(([, value]) => integer(value)));
|
|
248
304
|
if (Object.keys(usage).length)
|
|
@@ -259,12 +315,15 @@ var DshTrajectory = class {
|
|
|
259
315
|
throw new DshError("DSH_TRAJECTORY_INVALID");
|
|
260
316
|
}
|
|
261
317
|
}
|
|
262
|
-
required(this.#steps.get(sessionId) === stepId && identifier(data.callId) && identifier(data.name) && record(args));
|
|
318
|
+
required(this.#steps.get(sessionId)?.id === stepId && this.#steps.get(sessionId)?.committed && identifier(data.callId) && identifier(data.name) && record(args));
|
|
263
319
|
const key = `${sessionId}\0${data.callId}`;
|
|
264
320
|
required(!this.#tools.has(key));
|
|
265
321
|
this.#bound();
|
|
266
322
|
const id = this.#id(sessionId, "tool", hash(data.callId));
|
|
267
|
-
this.#tools.set(key, { id,
|
|
323
|
+
this.#tools.set(key, { id, stepId, time: source.time });
|
|
324
|
+
this.#steps.get(sessionId).tools = true;
|
|
325
|
+
if (sessionId === this.sessionId)
|
|
326
|
+
output.push(...this.#flushText("commentary"));
|
|
268
327
|
output.push(event("tool_call.create", {
|
|
269
328
|
id,
|
|
270
329
|
name: data.name,
|
|
@@ -279,7 +338,7 @@ var DshTrajectory = class {
|
|
|
279
338
|
required(record(data.message) && identifier(data.message.toolCallId));
|
|
280
339
|
const key = `${sessionId}\0${data.message.toolCallId}`;
|
|
281
340
|
const tool = this.#tools.get(key);
|
|
282
|
-
required(tool && this.#steps.get(sessionId) === stepId && Array.isArray(data.message.content));
|
|
341
|
+
required(tool && tool.stepId === stepId && this.#steps.get(sessionId)?.id === stepId && Array.isArray(data.message.content));
|
|
283
342
|
required(data.message.isError === void 0 || typeof data.message.isError === "boolean");
|
|
284
343
|
this.#tools.delete(key);
|
|
285
344
|
output.push(event("tool_call.update", {
|
|
@@ -295,10 +354,13 @@ var DshTrajectory = class {
|
|
|
295
354
|
case "turn/end": {
|
|
296
355
|
required(integer(data.turn) && this.#turns.get(sessionId) === data.turn && record(data.reason) && ["completed", "error", "aborted", "max-tokens"].includes(String(data.reason.kind)));
|
|
297
356
|
this.#turns.delete(sessionId);
|
|
357
|
+
required(!this.#steps.has(sessionId) && !this.#messages.has(sessionId));
|
|
298
358
|
if (sessionId === this.sessionId) {
|
|
299
359
|
this.#lastReason = String(data.reason.kind);
|
|
300
360
|
const code = record(data.reason.error) ? nativeCode(data.reason.error.code) : void 0;
|
|
301
361
|
this.#lastNativeCode = code;
|
|
362
|
+
if (data.reason.kind !== "completed")
|
|
363
|
+
output.push(...this.#settleStep("commentary", data.reason.kind === "aborted" ? "cancelled" : "failed"));
|
|
302
364
|
}
|
|
303
365
|
output.push(event("activity.finished", {
|
|
304
366
|
activityId: this.#id(sessionId, "turn", data.turn),
|
|
@@ -308,30 +370,43 @@ var DshTrajectory = class {
|
|
|
308
370
|
break;
|
|
309
371
|
}
|
|
310
372
|
}
|
|
311
|
-
|
|
373
|
+
if (source.type !== "assistant/chunk" && source.type !== "assistant/message")
|
|
374
|
+
return output;
|
|
375
|
+
return output.filter((value) => {
|
|
376
|
+
if (!value.type.startsWith("message.") || value.payload.channel !== "commentary" || value.payload.providerSessionId !== this.sessionId || this.#steps.get(sessionId)?.tools)
|
|
377
|
+
return true;
|
|
378
|
+
required(this.#pendingText.length < 4096);
|
|
379
|
+
this.#pendingBytes += Buffer.byteLength(value.payload.text ?? "");
|
|
380
|
+
required(this.#pendingBytes <= this.maxTextBytes);
|
|
381
|
+
this.#pendingText.push(value);
|
|
382
|
+
return false;
|
|
383
|
+
});
|
|
312
384
|
}
|
|
313
385
|
#messageEvent(type, id, sessionId, stepId, data) {
|
|
314
386
|
return event(type, {
|
|
315
|
-
id,
|
|
316
|
-
channel:
|
|
387
|
+
messageId: id,
|
|
388
|
+
channel: "commentary",
|
|
317
389
|
stepId,
|
|
318
390
|
...this.#lineage(sessionId),
|
|
319
391
|
...data
|
|
320
392
|
});
|
|
321
393
|
}
|
|
322
|
-
/**
|
|
394
|
+
/**
|
|
395
|
+
* wait 只证明 idle;receipt、durable terminal 和已提交回答分别验证。
|
|
396
|
+
* 返回已确认的正文/步骤与尾部 run 终态;调用方仍须等资源清理后再发布尾项。
|
|
397
|
+
*/
|
|
323
398
|
finish(receiptId) {
|
|
324
399
|
if (!this.#receipts.has(receiptId) || !this.#lastReason || this.#turns.size || this.#steps.size || this.#tools.size || this.#messages.size)
|
|
325
400
|
throw new DshError("DSH_TRAJECTORY_INVALID");
|
|
326
401
|
if (this.#lastReason === "aborted")
|
|
327
|
-
return event("run.cancelled", { reason: "provider_aborted" });
|
|
402
|
+
return [event("run.cancelled", { reason: "provider_aborted" })];
|
|
328
403
|
if (this.#lastReason !== "completed")
|
|
329
404
|
throw new DshError("DSH_EXECUTION_FAILED", {
|
|
330
405
|
...this.#lastNativeCode === void 0 ? {} : { nativeCode: this.#lastNativeCode }
|
|
331
406
|
});
|
|
332
|
-
if (!this.#
|
|
407
|
+
if (!this.#pendingStep?.answer)
|
|
333
408
|
throw new DshError("DSH_NO_FINAL_OUTPUT");
|
|
334
|
-
return event("run.completed", {});
|
|
409
|
+
return [...this.#settleStep("final"), event("run.completed", {})];
|
|
335
410
|
}
|
|
336
411
|
};
|
|
337
412
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-XIUZ6GXG.js";
|
|
6
6
|
import {
|
|
7
7
|
DshTrajectory
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RIZUXNZ2.js";
|
|
9
9
|
import {
|
|
10
10
|
DSH_MIN_VERSION,
|
|
11
11
|
DSH_VERSION,
|
|
@@ -229,7 +229,10 @@ function createDshAdapter(options = {}) {
|
|
|
229
229
|
receiptId = receipt;
|
|
230
230
|
phase = "wait";
|
|
231
231
|
await owned.request("session/wait", { sessionId }, runTimeoutMs);
|
|
232
|
-
|
|
232
|
+
const finished = trajectory.finish(receiptId);
|
|
233
|
+
terminal = finished.pop();
|
|
234
|
+
for (const value of finished)
|
|
235
|
+
queue.push(value);
|
|
233
236
|
queue.close();
|
|
234
237
|
} catch (error) {
|
|
235
238
|
const failure = dshError(error, "DSH_EXECUTION_FAILED");
|
|
@@ -7,6 +7,9 @@ export declare class DshTrajectory {
|
|
|
7
7
|
private readonly maxTextBytes;
|
|
8
8
|
constructor(sessionId: string, maxTextBytes: number);
|
|
9
9
|
accept(notification: HarnessNotification): CanonicalEvent[];
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* wait 只证明 idle;receipt、durable terminal 和已提交回答分别验证。
|
|
12
|
+
* 返回已确认的正文/步骤与尾部 run 终态;调用方仍须等资源清理后再发布尾项。
|
|
13
|
+
*/
|
|
14
|
+
finish(receiptId: string): CanonicalEvent[];
|
|
12
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-dsh",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"semver": "7.8.6",
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-grok-build",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
15
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.15",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.15",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
15
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-hermes",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.15"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-kimi-code",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.15"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-mcode",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.15"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-openclaw",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
10
10
|
"ws": "8.22.1"
|
|
11
11
|
},
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-opencode",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
10
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.15",
|
|
10
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15"
|
|
11
11
|
},
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-qodercli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.15"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-qoderclicn",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.15"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"./module-manifest": "./dist/module-manifest.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
14
14
|
"import-meta-resolve": "4.2.0"
|
|
15
15
|
},
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,25 +9,25 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"commander": "15.0.0",
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.15",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
14
14
|
"json5": "2.2.3",
|
|
15
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
16
|
-
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.
|
|
17
|
-
"@mininglamp-oss/octo-runtime-cross-service": "1.1.
|
|
18
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
19
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
20
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
21
|
-
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.
|
|
22
|
-
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.
|
|
24
|
-
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.
|
|
25
|
-
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.
|
|
26
|
-
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.
|
|
27
|
-
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.
|
|
28
|
-
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.
|
|
29
|
-
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.
|
|
30
|
-
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.
|
|
31
|
-
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.
|
|
15
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.15",
|
|
16
|
+
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.15",
|
|
17
|
+
"@mininglamp-oss/octo-runtime-cross-service": "1.1.15",
|
|
18
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
19
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.15",
|
|
20
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.15",
|
|
21
|
+
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.15",
|
|
22
|
+
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.15",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.15",
|
|
24
|
+
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.15",
|
|
25
|
+
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.15",
|
|
26
|
+
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.15",
|
|
27
|
+
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.15",
|
|
28
|
+
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.15",
|
|
29
|
+
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.15",
|
|
30
|
+
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.15",
|
|
31
|
+
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.15"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Standalone Node.js client and shared protocol for an existing Octo Runtime Kernel",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"directory": "packages/octo-runtime-client"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
52
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-output-silence.js
CHANGED
|
@@ -21,37 +21,41 @@ export class ModelOutputSilence {
|
|
|
21
21
|
#interactions = new Set();
|
|
22
22
|
#activities = new Map();
|
|
23
23
|
#queued = false;
|
|
24
|
-
#
|
|
25
|
-
#reported = false;
|
|
24
|
+
#interval;
|
|
26
25
|
#disposed = false;
|
|
27
26
|
#pending;
|
|
28
|
-
#
|
|
29
|
-
#
|
|
27
|
+
#listener;
|
|
28
|
+
#timer;
|
|
30
29
|
constructor(time = clock) {
|
|
31
30
|
this.time = time;
|
|
32
|
-
this.#
|
|
31
|
+
this.#reset();
|
|
33
32
|
}
|
|
34
33
|
/** 唯一等待者;解除监听同时释放 timer,避免输出密集时累积 Promise 监听。 */
|
|
35
34
|
listen(wake) {
|
|
36
|
-
this.#
|
|
35
|
+
if (this.#disposed)
|
|
36
|
+
return () => { };
|
|
37
|
+
const listener = { wake };
|
|
38
|
+
this.#listener = listener;
|
|
37
39
|
if (this.#pending)
|
|
38
40
|
wake();
|
|
39
41
|
else
|
|
40
42
|
this.#arm();
|
|
41
43
|
return () => {
|
|
42
|
-
|
|
44
|
+
// 同一个回调也可重复订阅,旧 detach 只能解除自己那次订阅。
|
|
45
|
+
if (this.#listener !== listener)
|
|
43
46
|
return;
|
|
44
|
-
this.#
|
|
45
|
-
this.#
|
|
46
|
-
this.#cancelTimer = undefined;
|
|
47
|
+
this.#listener = undefined;
|
|
48
|
+
this.#clearTimer();
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
51
|
take() {
|
|
50
|
-
const
|
|
52
|
+
const pending = this.#pending;
|
|
51
53
|
this.#pending = undefined;
|
|
52
|
-
//
|
|
54
|
+
// 背压不改写已生成事实,也不补齐同段错过的分钟;旧段槽不能推进新段节点。
|
|
55
|
+
if (pending && pending.interval === this.#interval)
|
|
56
|
+
this.#advance(pending.interval);
|
|
53
57
|
this.#arm();
|
|
54
|
-
return
|
|
58
|
+
return pending?.event;
|
|
55
59
|
}
|
|
56
60
|
/** 原生侧工具事实补充 canonical;usage、传输心跳及一般进展均不算模型文本。 */
|
|
57
61
|
activity(activity) {
|
|
@@ -109,8 +113,8 @@ export class ModelOutputSilence {
|
|
|
109
113
|
this.#disposed = true;
|
|
110
114
|
this.#reset();
|
|
111
115
|
this.#pending = undefined;
|
|
112
|
-
this.#
|
|
113
|
-
this.#
|
|
116
|
+
this.#interval = undefined;
|
|
117
|
+
this.#listener = undefined;
|
|
114
118
|
this.#tools.clear();
|
|
115
119
|
this.#interactions.clear();
|
|
116
120
|
this.#activities.clear();
|
|
@@ -122,55 +126,64 @@ export class ModelOutputSilence {
|
|
|
122
126
|
this.#activities.delete(key);
|
|
123
127
|
}
|
|
124
128
|
#reset() {
|
|
125
|
-
this.#
|
|
126
|
-
this.#cancelTimer = undefined;
|
|
129
|
+
this.#clearTimer();
|
|
127
130
|
// 重置未来静默区间,不撤回已达到阈值、尚未被 Core 取走的通知事实。
|
|
128
|
-
this.#
|
|
129
|
-
this.#since = this.time.now();
|
|
131
|
+
this.#interval = { since: this.time.now(), nextMs: THRESHOLD_MS };
|
|
130
132
|
}
|
|
131
133
|
#sync() {
|
|
132
134
|
if (this.#queued || this.#tools.size || this.#interactions.size || this.#activities.size) {
|
|
133
135
|
this.#reset();
|
|
134
|
-
this.#
|
|
136
|
+
this.#interval = undefined;
|
|
135
137
|
}
|
|
136
|
-
else if (this.#
|
|
138
|
+
else if (!this.#interval)
|
|
137
139
|
this.#reset();
|
|
138
140
|
this.#arm();
|
|
139
141
|
}
|
|
142
|
+
#clearTimer() {
|
|
143
|
+
const timer = this.#timer;
|
|
144
|
+
this.#timer = undefined;
|
|
145
|
+
timer?.cancel?.();
|
|
146
|
+
}
|
|
147
|
+
#advance(interval) {
|
|
148
|
+
interval.nextMs = Math.max(interval.nextMs, (Math.floor((this.time.now() - interval.since) / THRESHOLD_MS) + 1) * THRESHOLD_MS);
|
|
149
|
+
}
|
|
140
150
|
#arm() {
|
|
141
|
-
this.#
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this.#since === undefined ||
|
|
146
|
-
this.#reported ||
|
|
147
|
-
this.#pending)
|
|
151
|
+
this.#clearTimer();
|
|
152
|
+
const interval = this.#interval;
|
|
153
|
+
const listener = this.#listener;
|
|
154
|
+
if (this.#disposed || !listener || !interval || this.#pending)
|
|
148
155
|
return;
|
|
149
|
-
|
|
150
|
-
|
|
156
|
+
// 分别校验段、订阅和 timer 身份;同一时刻重置或重订阅也使旧 callback 失效。
|
|
157
|
+
const timer = {};
|
|
158
|
+
this.#timer = timer;
|
|
159
|
+
timer.cancel = this.time.schedule(() => {
|
|
151
160
|
if (this.#disposed ||
|
|
152
|
-
this.#
|
|
153
|
-
|
|
154
|
-
this.#
|
|
161
|
+
this.#interval !== interval ||
|
|
162
|
+
this.#listener !== listener ||
|
|
163
|
+
this.#timer !== timer ||
|
|
155
164
|
this.#pending)
|
|
156
165
|
return;
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
this.#clearTimer();
|
|
167
|
+
const silenceMs = Math.max(0, Math.floor(this.time.now() - interval.since));
|
|
168
|
+
if (silenceMs < interval.nextMs) {
|
|
159
169
|
this.#arm();
|
|
160
170
|
return;
|
|
161
171
|
}
|
|
162
|
-
this.#
|
|
172
|
+
this.#advance(interval);
|
|
163
173
|
this.#pending = {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
interval,
|
|
175
|
+
event: {
|
|
176
|
+
protocolVersion: 2,
|
|
177
|
+
type: "run.notice",
|
|
178
|
+
payload: {
|
|
179
|
+
noticeId: randomUUID(),
|
|
180
|
+
code: "model_output_idle",
|
|
181
|
+
severity: "info",
|
|
182
|
+
params: { silenceMs, message: `${Math.floor(silenceMs / 1000)}s no LLM output` }
|
|
183
|
+
}
|
|
171
184
|
}
|
|
172
185
|
};
|
|
173
|
-
|
|
174
|
-
}, Math.max(1,
|
|
186
|
+
listener.wake();
|
|
187
|
+
}, Math.max(1, interval.nextMs - (this.time.now() - interval.since)));
|
|
175
188
|
}
|
|
176
189
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-executor-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-executor-kernel",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@mininglamp-oss/octo-runtime-client": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
15
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
16
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
13
|
+
"@mininglamp-oss/octo-runtime-client": "1.1.15",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.15",
|
|
15
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
16
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15"
|
|
17
17
|
},
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"files": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-host-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
15
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.15",
|
|
15
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15"
|
|
16
16
|
},
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"files": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"description": "Provider-neutral Agent runtime for unified execution through provider adapters",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -55,35 +55,35 @@
|
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
59
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
58
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.15",
|
|
59
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.15",
|
|
60
60
|
"import-meta-resolve": "4.2.0",
|
|
61
|
-
"@mininglamp-oss/octo-runtime-client": "1.1.
|
|
61
|
+
"@mininglamp-oss/octo-runtime-client": "1.1.15",
|
|
62
62
|
"commander": "15.0.0",
|
|
63
|
-
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.
|
|
63
|
+
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.15",
|
|
64
64
|
"semver": "7.8.6",
|
|
65
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
66
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
67
|
-
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.
|
|
68
|
-
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.
|
|
69
|
-
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.
|
|
70
|
-
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.
|
|
71
|
-
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.
|
|
72
|
-
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.
|
|
73
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
74
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
75
|
-
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.
|
|
76
|
-
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.
|
|
77
|
-
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.
|
|
65
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.15",
|
|
66
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.15",
|
|
67
|
+
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.15",
|
|
68
|
+
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.15",
|
|
69
|
+
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.15",
|
|
70
|
+
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.15",
|
|
71
|
+
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.15",
|
|
72
|
+
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.15",
|
|
73
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.15",
|
|
74
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.15",
|
|
75
|
+
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.15",
|
|
76
|
+
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.15",
|
|
77
|
+
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.15",
|
|
78
78
|
"ws": "8.22.1",
|
|
79
|
-
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.
|
|
80
|
-
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.
|
|
81
|
-
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.
|
|
82
|
-
"@mininglamp-oss/octo-runtime-cross-service": "1.1.
|
|
79
|
+
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.15",
|
|
80
|
+
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.15",
|
|
81
|
+
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.15",
|
|
82
|
+
"@mininglamp-oss/octo-runtime-cross-service": "1.1.15",
|
|
83
83
|
"iconv-lite": "0.7.3",
|
|
84
84
|
"safer-buffer": "2.1.2",
|
|
85
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
86
|
-
"@mininglamp-oss/octo-runtime-cli": "1.1.
|
|
85
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.15",
|
|
86
|
+
"@mininglamp-oss/octo-runtime-cli": "1.1.15",
|
|
87
87
|
"json5": "2.2.3"
|
|
88
88
|
},
|
|
89
89
|
"bundleDependencies": [
|