dominds 1.24.4 → 1.25.0
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/README.md +48 -1
- package/README.zh.md +48 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +22 -0
- package/dist/dialog-display-state.d.ts +1 -1
- package/dist/dialog-display-state.js +16 -2
- package/dist/dialog-drive-work.js +5 -0
- package/dist/dialog-global-registry.d.ts +9 -8
- package/dist/dialog-global-registry.js +39 -38
- package/dist/dialog-instance-registry.js +7 -0
- package/dist/dialog-interruption.d.ts +2 -0
- package/dist/dialog-interruption.js +6 -0
- package/dist/dialog.d.ts +6 -6
- package/dist/dialog.js +40 -36
- package/dist/docs/dialog-system.md +7 -7
- package/dist/docs/dialog-system.zh.md +4 -4
- package/dist/docs/dlg-drive-algo.zh.md +539 -0
- package/dist/llm/kernel-driver/drive.js +59 -87
- package/dist/llm/kernel-driver/flow.js +687 -205
- package/dist/llm/kernel-driver/loop.js +131 -61
- package/dist/llm/kernel-driver/runtime.js +1 -1
- package/dist/llm/kernel-driver/sideDialog.js +14 -12
- package/dist/llm/kernel-driver/tellask-special.js +24 -23
- package/dist/llm/kernel-driver/types.d.ts +6 -27
- package/dist/llm/kernel-driver/types.js +0 -1
- package/dist/persistence-errors.d.ts +1 -1
- package/dist/persistence.d.ts +60 -18
- package/dist/persistence.js +481 -202
- package/dist/recovery/open-generation-recovery.d.ts +1 -0
- package/dist/recovery/{proceeding-drive.js → open-generation-recovery.js} +25 -25
- package/dist/recovery/reply-delivery-recovery.d.ts +3 -0
- package/dist/recovery/{reply-special.js → reply-delivery-recovery.js} +12 -12
- package/dist/server/websocket-handler.js +4 -4
- package/dist/server.js +4 -4
- package/dist/tools/builtins.js +4 -2
- package/dist/tools/prompts/skills/en/errors.md +2 -0
- package/dist/tools/prompts/skills/en/index.md +1 -0
- package/dist/tools/prompts/skills/en/tools.md +6 -0
- package/dist/tools/prompts/skills/zh/errors.md +2 -0
- package/dist/tools/prompts/skills/zh/index.md +1 -0
- package/dist/tools/prompts/skills/zh/tools.md +6 -0
- package/dist/tools/ripgrep.js +386 -44
- package/dist/tools/skills.d.ts +1 -0
- package/dist/tools/skills.js +81 -1
- package/dist/tools/team_mgmt.js +38 -2
- package/package.json +5 -5
- package/dist/docs/issues/tellask-background-continuation-live-bugs-2026-05-17.zh.md +0 -101
- package/dist/docs/tellask-background-continuation-refactor.zh.md +0 -1146
- package/dist/recovery/proceeding-drive.d.ts +0 -1
- package/dist/recovery/reply-special.d.ts +0 -3
package/dist/dialog.js
CHANGED
|
@@ -48,9 +48,9 @@ const work_language_1 = require("./runtime/work-language");
|
|
|
48
48
|
const shared_reminders_1 = require("./shared-reminders");
|
|
49
49
|
const tool_1 = require("./tool");
|
|
50
50
|
const id_2 = require("./utils/id");
|
|
51
|
-
async function
|
|
51
|
+
async function queueRootDialogDrive(rootId, meta) {
|
|
52
52
|
const { globalDialogRegistry } = await Promise.resolve().then(() => __importStar(require('./dialog-global-registry')));
|
|
53
|
-
globalDialogRegistry.
|
|
53
|
+
globalDialogRegistry.queueRootDrive(rootId, meta);
|
|
54
54
|
}
|
|
55
55
|
class InvalidReminderIndexError extends Error {
|
|
56
56
|
constructor(index, total) {
|
|
@@ -228,7 +228,7 @@ class Dialog {
|
|
|
228
228
|
this._currentCourse = 1;
|
|
229
229
|
this._remindersVer = 0;
|
|
230
230
|
// Prompts queued for future drives (set by startNewCourse or deferred-resume flows).
|
|
231
|
-
this.
|
|
231
|
+
this._queuedPrompts = [];
|
|
232
232
|
this._driveIntents = [];
|
|
233
233
|
this._driveIntentMode = 'legacy';
|
|
234
234
|
// Course prefix messages injected into LLM context on every course.
|
|
@@ -243,7 +243,7 @@ class Dialog {
|
|
|
243
243
|
// Track the generation sequence when _generationStarted was set
|
|
244
244
|
// Used to ensure proper ordering when multiple generations occur
|
|
245
245
|
this._generationStartedGenseq = 0;
|
|
246
|
-
// Pending sideDialog IDs (for
|
|
246
|
+
// Pending sideDialog IDs (for active callee tracking)
|
|
247
247
|
this._activeCalleeDialogIds = [];
|
|
248
248
|
// Phase 11: Suspension state for Type A sideDialog mechanism
|
|
249
249
|
// Tracks whether this dialog is in normal state, suspended, or resuming from suspension
|
|
@@ -755,11 +755,11 @@ class Dialog {
|
|
|
755
755
|
return this._updatedAt;
|
|
756
756
|
}
|
|
757
757
|
replaceQueuedPromptState(existingMsgId, nextPrompt) {
|
|
758
|
-
const queueIndex = this.
|
|
758
|
+
const queueIndex = this._queuedPrompts.findIndex((prompt) => prompt.msgId === existingMsgId);
|
|
759
759
|
if (queueIndex < 0) {
|
|
760
|
-
throw new Error(`
|
|
760
|
+
throw new Error(`Queued prompt replacement invariant violation: dialog=${this.id.valueOf()} existingMsgId=${existingMsgId}`);
|
|
761
761
|
}
|
|
762
|
-
this.
|
|
762
|
+
this._queuedPrompts[queueIndex] = nextPrompt;
|
|
763
763
|
for (let index = this._driveIntents.length - 1; index >= 0; index -= 1) {
|
|
764
764
|
const intent = this._driveIntents[index];
|
|
765
765
|
if (intent.kind !== 'prompt' || intent.prompt.msgId !== existingMsgId)
|
|
@@ -822,7 +822,7 @@ class Dialog {
|
|
|
822
822
|
}
|
|
823
823
|
default: {
|
|
824
824
|
const _exhaustive = nextPrompt;
|
|
825
|
-
throw new Error(`
|
|
825
|
+
throw new Error(`Queued prompt replacement invariant violation: unsupported queued prompt`);
|
|
826
826
|
}
|
|
827
827
|
}
|
|
828
828
|
})(),
|
|
@@ -830,7 +830,7 @@ class Dialog {
|
|
|
830
830
|
};
|
|
831
831
|
return nextPrompt;
|
|
832
832
|
}
|
|
833
|
-
throw new Error(`
|
|
833
|
+
throw new Error(`Queued prompt replacement invariant violation: missing drive intent dialog=${this.id.valueOf()} existingMsgId=${existingMsgId}`);
|
|
834
834
|
}
|
|
835
835
|
setPendingRuntimePrompt(prompt) {
|
|
836
836
|
const prepared = typeof prompt === 'string'
|
|
@@ -875,7 +875,7 @@ class Dialog {
|
|
|
875
875
|
const prompt = runtimeCommon;
|
|
876
876
|
return prompt;
|
|
877
877
|
})();
|
|
878
|
-
this.
|
|
878
|
+
this._queuedPrompts = [
|
|
879
879
|
normalized.calleeDialogReplyTarget !== undefined
|
|
880
880
|
? {
|
|
881
881
|
kind: 'new_course_runtime_sideDialog',
|
|
@@ -927,7 +927,7 @@ class Dialog {
|
|
|
927
927
|
return normalizedExisting;
|
|
928
928
|
}
|
|
929
929
|
enqueueQueuedPromptState(state) {
|
|
930
|
-
this.
|
|
930
|
+
this._queuedPrompts.push(state);
|
|
931
931
|
const promptCommon = {
|
|
932
932
|
content: state.prompt,
|
|
933
933
|
...(state.contentItems === undefined ? {} : { contentItems: state.contentItems }),
|
|
@@ -980,7 +980,7 @@ class Dialog {
|
|
|
980
980
|
}
|
|
981
981
|
default: {
|
|
982
982
|
const _exhaustive = state;
|
|
983
|
-
throw new Error(`
|
|
983
|
+
throw new Error(`Queued prompt enqueue invariant violation: unsupported queued prompt`);
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
986
|
})(),
|
|
@@ -988,14 +988,14 @@ class Dialog {
|
|
|
988
988
|
});
|
|
989
989
|
this._updatedAt = (0, time_1.formatUnifiedTimestamp)(new Date());
|
|
990
990
|
}
|
|
991
|
-
|
|
992
|
-
if (this.
|
|
991
|
+
peekLatestQueuedPrompt() {
|
|
992
|
+
if (this._queuedPrompts.length === 0) {
|
|
993
993
|
return undefined;
|
|
994
994
|
}
|
|
995
|
-
return this.
|
|
995
|
+
return this._queuedPrompts[this._queuedPrompts.length - 1];
|
|
996
996
|
}
|
|
997
997
|
queueUserPromptAtGenerationBoundary(options) {
|
|
998
|
-
const existing = this.
|
|
998
|
+
const existing = this.peekLatestQueuedPrompt();
|
|
999
999
|
const trimmed = options.prompt.trim();
|
|
1000
1000
|
if (!trimmed) {
|
|
1001
1001
|
throw new Error('Prompt is required to queue generation-boundary user prompt');
|
|
@@ -1050,7 +1050,7 @@ class Dialog {
|
|
|
1050
1050
|
return created;
|
|
1051
1051
|
}
|
|
1052
1052
|
queueRegisteredAssignmentUpdatePrompt(options) {
|
|
1053
|
-
const existing = this.
|
|
1053
|
+
const existing = this.peekLatestQueuedPrompt();
|
|
1054
1054
|
const trimmed = options.prompt.trim();
|
|
1055
1055
|
if (!trimmed) {
|
|
1056
1056
|
throw new Error('Prompt is required to queue registered assignment update');
|
|
@@ -1093,7 +1093,7 @@ class Dialog {
|
|
|
1093
1093
|
async persistPendingRuntimePrompt(prompt) {
|
|
1094
1094
|
await this.dlgStore.persistPendingRuntimePrompt(this, prompt);
|
|
1095
1095
|
if (this.id.selfId === this.id.rootId) {
|
|
1096
|
-
await
|
|
1096
|
+
await queueRootDialogDrive(this.id.rootId, {
|
|
1097
1097
|
source: 'dialog_runtime_prompt',
|
|
1098
1098
|
reason: `queued_runtime_prompt:${prompt.msgId}`,
|
|
1099
1099
|
});
|
|
@@ -1155,14 +1155,14 @@ class Dialog {
|
|
|
1155
1155
|
});
|
|
1156
1156
|
return created;
|
|
1157
1157
|
}
|
|
1158
|
-
|
|
1159
|
-
return this.
|
|
1158
|
+
hasQueuedPrompt() {
|
|
1159
|
+
return this._queuedPrompts.length > 0;
|
|
1160
1160
|
}
|
|
1161
|
-
|
|
1162
|
-
return this.
|
|
1161
|
+
peekQueuedPrompt() {
|
|
1162
|
+
return this._queuedPrompts[0];
|
|
1163
1163
|
}
|
|
1164
|
-
|
|
1165
|
-
return this.
|
|
1164
|
+
takeQueuedPrompt() {
|
|
1165
|
+
return this._queuedPrompts.shift();
|
|
1166
1166
|
}
|
|
1167
1167
|
setActiveRunControlSpec(spec) {
|
|
1168
1168
|
this._activeRunControlSpec = spec;
|
|
@@ -1244,7 +1244,7 @@ class Dialog {
|
|
|
1244
1244
|
await this.dlgStore.startNewCourse(this, nextPrompt);
|
|
1245
1245
|
}
|
|
1246
1246
|
if (this.id.selfId === this.id.rootId) {
|
|
1247
|
-
await
|
|
1247
|
+
await queueRootDialogDrive(this.id.rootId, {
|
|
1248
1248
|
source: 'dialog_start_new_course',
|
|
1249
1249
|
reason: `queued_runtime_prompt:${nextPrompt.msgId}`,
|
|
1250
1250
|
});
|
|
@@ -1265,6 +1265,7 @@ class Dialog {
|
|
|
1265
1265
|
runControl: runControlSpec,
|
|
1266
1266
|
});
|
|
1267
1267
|
}
|
|
1268
|
+
return normalized;
|
|
1268
1269
|
}
|
|
1269
1270
|
// Proxy methods for DialogStore - route calls through dialog object instead of direct dlgStore access
|
|
1270
1271
|
async receiveFuncResult(result) {
|
|
@@ -1498,7 +1499,15 @@ class Dialog {
|
|
|
1498
1499
|
// Mark generation as started with the actual genseq
|
|
1499
1500
|
// This ensures sideDialog_final_response_evt waits for both user_text and generating_start_evt
|
|
1500
1501
|
this.markGenerationStarted();
|
|
1501
|
-
|
|
1502
|
+
try {
|
|
1503
|
+
return await this.dlgStore.notifyGeneratingStart(this, msgId);
|
|
1504
|
+
}
|
|
1505
|
+
catch (err) {
|
|
1506
|
+
this._generationStarted = false;
|
|
1507
|
+
this._generationStartedGenseq = 0;
|
|
1508
|
+
this._activeGenCourse = undefined;
|
|
1509
|
+
throw err;
|
|
1510
|
+
}
|
|
1502
1511
|
}
|
|
1503
1512
|
async notifyGeneratingFinish(contextHealth, llmGenModel) {
|
|
1504
1513
|
if (contextHealth) {
|
|
@@ -1507,17 +1516,12 @@ class Dialog {
|
|
|
1507
1516
|
try {
|
|
1508
1517
|
await this.dlgStore.notifyGeneratingFinish(this, contextHealth, llmGenModel);
|
|
1509
1518
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
});
|
|
1519
|
+
finally {
|
|
1520
|
+
// Reset generation tracking for the next course even when persistence fails loudly.
|
|
1521
|
+
this._generationStarted = false;
|
|
1522
|
+
this._generationStartedGenseq = 0;
|
|
1523
|
+
this._activeGenCourse = undefined;
|
|
1516
1524
|
}
|
|
1517
|
-
// Reset generation tracking for the next course
|
|
1518
|
-
this._generationStarted = false;
|
|
1519
|
-
this._generationStartedGenseq = 0;
|
|
1520
|
-
this._activeGenCourse = undefined;
|
|
1521
1525
|
}
|
|
1522
1526
|
async streamError(error) {
|
|
1523
1527
|
if (this.dlgStore) {
|
|
@@ -729,7 +729,7 @@ sequenceDiagram
|
|
|
729
729
|
Side-->>Store: persist final response
|
|
730
730
|
Driver-->>Asker: supply result-arrival fact + clear pending callee
|
|
731
731
|
opt result arrival creates an explicit drive source
|
|
732
|
-
Driver-->>Asker:
|
|
732
|
+
Driver-->>Asker: upsert result_arrival trigger + wake queue
|
|
733
733
|
end
|
|
734
734
|
```
|
|
735
735
|
|
|
@@ -1231,7 +1231,7 @@ Dominds' runtime does **not** persist a single enum-like “awaiting …” stat
|
|
|
1231
1231
|
driven is derived from persisted facts:
|
|
1232
1232
|
|
|
1233
1233
|
- Persisted status (API/index): `running | completed | archived`
|
|
1234
|
-
- Persisted `latest.yaml`: `status`, `
|
|
1234
|
+
- Persisted `latest.yaml`: `status`, `nextStep.triggers`, `generating`
|
|
1235
1235
|
- Derived gates: `hasPendingQ4H()`; active callee dispatches are background callee facts, not a drive gate
|
|
1236
1236
|
|
|
1237
1237
|
**Persisted status lifecycle:**
|
|
@@ -1250,12 +1250,12 @@ stateDiagram-v2
|
|
|
1250
1250
|
flowchart TD
|
|
1251
1251
|
A[status=running] --> B{canDrive?\\n(no pending Q4H)}
|
|
1252
1252
|
B -- no --> S[Suspended\\n(waiting on Q4H)]
|
|
1253
|
-
S -->|Q4H answered| C{
|
|
1253
|
+
S -->|Q4H answered| C{nextStep trigger?}
|
|
1254
1254
|
R[result arrival] --> C
|
|
1255
|
-
B -- yes --> C{
|
|
1255
|
+
B -- yes --> C{nextStep trigger?}
|
|
1256
1256
|
C -- no --> I[Idle\\n(waiting for trigger)]
|
|
1257
1257
|
C -- yes --> D[Drive loop\\n(generating=true while streaming)]
|
|
1258
|
-
D --> E{
|
|
1258
|
+
D --> E{hasQueuedPrompt?}
|
|
1259
1259
|
E -- yes --> C
|
|
1260
1260
|
E -- no --> I
|
|
1261
1261
|
```
|
|
@@ -1306,7 +1306,7 @@ sequenceDiagram
|
|
|
1306
1306
|
Side-->>Driver: final response
|
|
1307
1307
|
Driver-->>Tellasker: supply result-arrival fact + clear pending callee
|
|
1308
1308
|
opt result arrival creates an explicit drive source
|
|
1309
|
-
Driver-->>Tellasker:
|
|
1309
|
+
Driver-->>Tellasker: upsert result_arrival trigger + wake queue
|
|
1310
1310
|
end
|
|
1311
1311
|
```
|
|
1312
1312
|
|
|
@@ -1381,7 +1381,7 @@ sequenceDiagram
|
|
|
1381
1381
|
Side-->>Asker: sideDialog response supplied to tellasker (result-arrival fact; clears this pending callee)
|
|
1382
1382
|
|
|
1383
1383
|
opt Asker has a result-arrival drive source
|
|
1384
|
-
Asker-->>Asker:
|
|
1384
|
+
Asker-->>Asker: upsert result_arrival trigger + wake queue (result-arrival handling)
|
|
1385
1385
|
end
|
|
1386
1386
|
```
|
|
1387
1387
|
|
|
@@ -714,7 +714,7 @@ sequenceDiagram
|
|
|
714
714
|
Side-->>Store: 持久化最终响应
|
|
715
715
|
Driver-->>Asker: 供应结果到达事实 + 清除 pending callee
|
|
716
716
|
opt 结果到达形成显式驱动源
|
|
717
|
-
Driver-->>Asker:
|
|
717
|
+
Driver-->>Asker: 写入 result_arrival trigger + Wake Queue
|
|
718
718
|
end
|
|
719
719
|
```
|
|
720
720
|
|
|
@@ -1214,7 +1214,7 @@ Dominds 的运行时**不**持久化单一的类似枚举的 "awaiting …" 状
|
|
|
1214
1214
|
驱动是从持久化的事实派生的:
|
|
1215
1215
|
|
|
1216
1216
|
- 持久化状态(API/索引):`running | completed | archived`
|
|
1217
|
-
- 持久化 `latest.yaml`:`status`、`
|
|
1217
|
+
- 持久化 `latest.yaml`:`status`、`nextStep.triggers`、`generating`
|
|
1218
1218
|
- 派生的门控:`hasPendingQ4H()`;active callee dispatches 是后台被诉请者事实,不是驱动门控
|
|
1219
1219
|
|
|
1220
1220
|
**持久化状态生命周期**:
|
|
@@ -1286,7 +1286,7 @@ sequenceDiagram
|
|
|
1286
1286
|
Side-->>Driver: 最终响应
|
|
1287
1287
|
Driver-->>Tellasker: 供应结果到达事实 + 清除 pending callee
|
|
1288
1288
|
opt 结果到达形成显式驱动源
|
|
1289
|
-
Driver-->>Tellasker:
|
|
1289
|
+
Driver-->>Tellasker: 写入 result_arrival trigger + Wake Queue(结果到达处理)
|
|
1290
1290
|
end
|
|
1291
1291
|
```
|
|
1292
1292
|
|
|
@@ -1358,7 +1358,7 @@ sequenceDiagram
|
|
|
1358
1358
|
Side-->>Asker: callee 响应供应给诉请者(结果到达事实;清除该 pending callee)
|
|
1359
1359
|
|
|
1360
1360
|
opt 诉请者有 result-arrival 驱动事实
|
|
1361
|
-
Asker-->>Asker:
|
|
1361
|
+
Asker-->>Asker: 写入 result_arrival trigger + Wake Queue(结果到达处理)
|
|
1362
1362
|
end
|
|
1363
1363
|
```
|
|
1364
1364
|
|