dominds 1.27.2 → 1.27.4

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.
Files changed (47) hide show
  1. package/dist/apps/runtime.js +3 -1
  2. package/dist/dialog-fork.js +2 -1
  3. package/dist/dialog-global-registry.d.ts +11 -1
  4. package/dist/dialog-global-registry.js +45 -0
  5. package/dist/dialog.d.ts +14 -5
  6. package/dist/dialog.js +114 -21
  7. package/dist/docs/daemon-cmd-runner.md +5 -0
  8. package/dist/docs/daemon-cmd-runner.zh.md +5 -0
  9. package/dist/llm/kernel-driver/drive.js +228 -49
  10. package/dist/llm/kernel-driver/fbr.d.ts +9 -0
  11. package/dist/llm/kernel-driver/fbr.js +186 -59
  12. package/dist/mcp/supervisor.js +4 -1
  13. package/dist/minds/load.js +1 -0
  14. package/dist/minds/system-prompt-parts.js +30 -30
  15. package/dist/persistence.js +83 -17
  16. package/dist/priming.js +2 -3
  17. package/dist/runtime/driver-messages.d.ts +9 -0
  18. package/dist/runtime/driver-messages.js +103 -33
  19. package/dist/runtime/shared-reminder-update-impact.d.ts +20 -0
  20. package/dist/runtime/shared-reminder-update-impact.js +110 -0
  21. package/dist/shared-reminders.js +2 -2
  22. package/dist/tool-availability.js +1 -0
  23. package/dist/tool.d.ts +7 -4
  24. package/dist/tool.js +10 -4
  25. package/dist/tools/app-reminders.js +4 -3
  26. package/dist/tools/builtins.js +2 -0
  27. package/dist/tools/cmd-runner-protocol.d.ts +6 -0
  28. package/dist/tools/cmd-runner-protocol.js +57 -2
  29. package/dist/tools/cmd-runner.js +83 -2
  30. package/dist/tools/ctrl.d.ts +2 -0
  31. package/dist/tools/ctrl.js +183 -6
  32. package/dist/tools/os.js +115 -14
  33. package/dist/tools/pending-tellask-reminder.js +1 -0
  34. package/dist/tools/process-kill.js +49 -0
  35. package/dist/tools/prompts/control/en/errors.md +1 -1
  36. package/dist/tools/prompts/control/en/index.md +4 -4
  37. package/dist/tools/prompts/control/en/principles.md +22 -21
  38. package/dist/tools/prompts/control/en/scenarios.md +10 -3
  39. package/dist/tools/prompts/control/en/tools.md +28 -5
  40. package/dist/tools/prompts/control/zh/errors.md +1 -1
  41. package/dist/tools/prompts/control/zh/index.md +4 -4
  42. package/dist/tools/prompts/control/zh/principles.md +21 -20
  43. package/dist/tools/prompts/control/zh/scenarios.md +10 -3
  44. package/dist/tools/prompts/control/zh/tools.md +28 -5
  45. package/dist/tools/prompts/os/en/tools.md +2 -0
  46. package/dist/tools/prompts/os/zh/tools.md +2 -0
  47. package/package.json +4 -4
@@ -697,8 +697,8 @@ function serializeReminderSnapshot(reminder) {
697
697
  ownerName: reminder.owner?.name,
698
698
  meta: reminder.meta,
699
699
  echoback: reminder.echoback,
700
- scope: reminder.scope ?? 'dialog',
701
- renderMode: reminder.renderMode ?? 'markdown',
700
+ scope: reminder.scope,
701
+ renderMode: reminder.renderMode,
702
702
  createdAt: reminder.createdAt ?? (0, time_1.formatUnifiedTimestamp)(new Date()),
703
703
  priority: reminder.priority ?? 'medium',
704
704
  };
@@ -2234,17 +2234,34 @@ function parseDialogLatestFile(value) {
2234
2234
  if (typeof fbrStateRaw.iteration !== 'number' || !Number.isInteger(fbrStateRaw.iteration)) {
2235
2235
  return null;
2236
2236
  }
2237
- if (fbrStateRaw.iteration < 1 || fbrStateRaw.iteration > fbrStateRaw.effort) {
2237
+ if (fbrStateRaw.iteration < 1) {
2238
2238
  return null;
2239
2239
  }
2240
2240
  if (typeof fbrStateRaw.promptDelivered !== 'boolean')
2241
2241
  return null;
2242
+ if (phase !== 'finalization' && fbrStateRaw.iteration > fbrStateRaw.effort) {
2243
+ return null;
2244
+ }
2245
+ if (phase !== 'finalization') {
2246
+ return {
2247
+ kind: 'serial',
2248
+ effort: fbrStateRaw.effort,
2249
+ phase,
2250
+ iteration: fbrStateRaw.iteration,
2251
+ promptDelivered: fbrStateRaw.promptDelivered,
2252
+ };
2253
+ }
2254
+ const finalizationReason = fbrStateRaw.finalizationReason;
2255
+ if (finalizationReason !== 'planned' && finalizationReason !== 'context_caution') {
2256
+ return null;
2257
+ }
2242
2258
  return {
2243
2259
  kind: 'serial',
2244
2260
  effort: fbrStateRaw.effort,
2245
2261
  phase,
2246
2262
  iteration: fbrStateRaw.iteration,
2247
2263
  promptDelivered: fbrStateRaw.promptDelivered,
2264
+ finalizationReason,
2248
2265
  };
2249
2266
  })();
2250
2267
  if (fbrState === null)
@@ -9291,6 +9308,7 @@ class DialogPersistence {
9291
9308
  static resolvePendingUserInterjectionReplyFromCourseEvents(events, course) {
9292
9309
  let pendingUserInterjectionReply;
9293
9310
  let visibleReplySettled = false;
9311
+ let visibleReplyGenseq;
9294
9312
  for (const event of events) {
9295
9313
  if (event.type === 'human_text_record') {
9296
9314
  if (event.origin !== 'user')
@@ -9304,6 +9322,7 @@ class DialogPersistence {
9304
9322
  genseq: (0, storage_1.toCallSiteGenseqNo)(event.genseq),
9305
9323
  };
9306
9324
  visibleReplySettled = false;
9325
+ visibleReplyGenseq = undefined;
9307
9326
  continue;
9308
9327
  }
9309
9328
  if (pendingUserInterjectionReply === undefined) {
@@ -9311,23 +9330,38 @@ class DialogPersistence {
9311
9330
  }
9312
9331
  if (event.type === 'agent_words_record') {
9313
9332
  visibleReplySettled = true;
9333
+ visibleReplyGenseq = event.genseq;
9314
9334
  continue;
9315
9335
  }
9316
9336
  if (event.type === 'func_call_record' || event.type === 'tellask_call_record') {
9317
- visibleReplySettled = false;
9337
+ if (visibleReplyGenseq === undefined || event.genseq <= visibleReplyGenseq) {
9338
+ visibleReplySettled = false;
9339
+ visibleReplyGenseq = undefined;
9340
+ }
9318
9341
  }
9319
9342
  }
9320
9343
  return visibleReplySettled ? undefined : pendingUserInterjectionReply;
9321
9344
  }
9322
9345
  static resolveAnsweredUserInterjectionA2HFromCourseEvents(args) {
9323
9346
  let pendingUserInterjectionReply;
9324
- let lastVisibleAnswer;
9325
- let visibleReplySettled = false;
9347
+ let visibleAnswer;
9348
+ let hasAutoDriveAfterVisibleAnswer = false;
9349
+ let possibleAutoDriveStartGenseq;
9326
9350
  for (const event of args.events) {
9327
9351
  if (event.type === 'human_text_record') {
9328
- if (event.origin !== 'user')
9352
+ if (event.origin !== 'user') {
9353
+ if (visibleAnswer !== undefined &&
9354
+ possibleAutoDriveStartGenseq !== undefined &&
9355
+ event.genseq === possibleAutoDriveStartGenseq) {
9356
+ hasAutoDriveAfterVisibleAnswer = true;
9357
+ }
9329
9358
  continue;
9359
+ }
9330
9360
  if (typeof event.q4hAnswerCallId === 'string' && event.q4hAnswerCallId.trim() !== '') {
9361
+ pendingUserInterjectionReply = undefined;
9362
+ visibleAnswer = undefined;
9363
+ hasAutoDriveAfterVisibleAnswer = false;
9364
+ possibleAutoDriveStartGenseq = undefined;
9331
9365
  continue;
9332
9366
  }
9333
9367
  pendingUserInterjectionReply = {
@@ -9335,24 +9369,56 @@ class DialogPersistence {
9335
9369
  course: (0, storage_1.toDialogCourseNumber)(args.course),
9336
9370
  genseq: (0, storage_1.toCallSiteGenseqNo)(event.genseq),
9337
9371
  };
9338
- visibleReplySettled = false;
9339
- lastVisibleAnswer = undefined;
9372
+ visibleAnswer = undefined;
9373
+ hasAutoDriveAfterVisibleAnswer = false;
9374
+ possibleAutoDriveStartGenseq = undefined;
9340
9375
  continue;
9341
9376
  }
9342
9377
  if (pendingUserInterjectionReply === undefined) {
9343
9378
  continue;
9344
9379
  }
9345
9380
  if (event.type === 'agent_words_record') {
9346
- visibleReplySettled = true;
9347
- lastVisibleAnswer = { content: event.content, genseq: event.genseq };
9381
+ if (visibleAnswer !== undefined &&
9382
+ (hasAutoDriveAfterVisibleAnswer ||
9383
+ (possibleAutoDriveStartGenseq !== undefined &&
9384
+ event.genseq === possibleAutoDriveStartGenseq))) {
9385
+ hasAutoDriveAfterVisibleAnswer = true;
9386
+ continue;
9387
+ }
9388
+ visibleAnswer = { content: event.content, genseq: event.genseq };
9389
+ continue;
9390
+ }
9391
+ if (event.type === 'gen_start_record') {
9392
+ if (visibleAnswer !== undefined &&
9393
+ (typeof event.msgId !== 'string' || event.msgId.trim() === '')) {
9394
+ hasAutoDriveAfterVisibleAnswer = true;
9395
+ possibleAutoDriveStartGenseq = undefined;
9396
+ }
9397
+ else if (visibleAnswer !== undefined) {
9398
+ possibleAutoDriveStartGenseq = event.genseq;
9399
+ }
9400
+ continue;
9401
+ }
9402
+ if (event.type === 'agent_thought_record' || event.type === 'runtime_guide_record') {
9403
+ if (visibleAnswer !== undefined &&
9404
+ possibleAutoDriveStartGenseq !== undefined &&
9405
+ event.genseq === possibleAutoDriveStartGenseq) {
9406
+ hasAutoDriveAfterVisibleAnswer = true;
9407
+ }
9348
9408
  continue;
9349
9409
  }
9350
9410
  if (event.type === 'func_call_record' || event.type === 'tellask_call_record') {
9351
- visibleReplySettled = false;
9352
- lastVisibleAnswer = undefined;
9411
+ if (visibleAnswer !== undefined && event.genseq > visibleAnswer.genseq) {
9412
+ hasAutoDriveAfterVisibleAnswer = true;
9413
+ continue;
9414
+ }
9415
+ visibleAnswer = undefined;
9416
+ possibleAutoDriveStartGenseq = undefined;
9353
9417
  }
9354
9418
  }
9355
- if (!visibleReplySettled || pendingUserInterjectionReply === undefined || !lastVisibleAnswer) {
9419
+ if (pendingUserInterjectionReply === undefined ||
9420
+ visibleAnswer === undefined ||
9421
+ !hasAutoDriveAfterVisibleAnswer) {
9356
9422
  return undefined;
9357
9423
  }
9358
9424
  if (pendingUserInterjectionReply.msgId !== args.pending?.msgId) {
@@ -9362,16 +9428,16 @@ class DialogPersistence {
9362
9428
  args.dialogId.rootId,
9363
9429
  args.dialogId.selfId,
9364
9430
  `c${String(args.course)}`,
9365
- `g${String(lastVisibleAnswer.genseq)}`,
9431
+ `g${String(visibleAnswer.genseq)}`,
9366
9432
  pendingUserInterjectionReply.msgId,
9367
9433
  ].join('|');
9368
9434
  return {
9369
9435
  id: `a2h-${Buffer.from(answerIdSource).toString('base64url')}`,
9370
- content: lastVisibleAnswer.content,
9436
+ content: visibleAnswer.content,
9371
9437
  answeredAt: (0, time_1.formatUnifiedTimestamp)(new Date()),
9372
9438
  answerRef: {
9373
9439
  course: (0, storage_1.toDialogCourseNumber)(args.course),
9374
- genseq: (0, storage_1.toCallSiteGenseqNo)(lastVisibleAnswer.genseq),
9440
+ genseq: (0, storage_1.toCallSiteGenseqNo)(visibleAnswer.genseq),
9375
9441
  },
9376
9442
  };
9377
9443
  }
package/dist/priming.js CHANGED
@@ -227,7 +227,7 @@ function reminderToSnapshot(reminder) {
227
227
  meta: reminder.meta,
228
228
  echoback: reminder.echoback,
229
229
  scope: reminder.scope,
230
- renderMode: reminder.renderMode ?? 'markdown',
230
+ renderMode: reminder.renderMode,
231
231
  createdAt: reminder.createdAt,
232
232
  priority: reminder.priority,
233
233
  };
@@ -2203,8 +2203,7 @@ async function applyPrimingRemindersToDialog(args) {
2203
2203
  const taskReminders = [];
2204
2204
  const agentReminders = [];
2205
2205
  for (const reminder of args.reminders) {
2206
- const scope = reminder.scope ?? 'task';
2207
- switch (scope) {
2206
+ switch (reminder.scope) {
2208
2207
  case 'dialog':
2209
2208
  dialogReminders.push(reminder);
2210
2209
  break;
@@ -56,6 +56,15 @@ export type ReminderMaintenanceReferenceItem = Readonly<{
56
56
  meta?: unknown;
57
57
  }>;
58
58
  export declare function formatReminderMaintenanceReference(language: LanguageCode, reminders: readonly ReminderMaintenanceReferenceItem[]): string | undefined;
59
+ export declare function formatSharedReminderUpdateImpactNotice(language: LanguageCode, args: {
60
+ reminderId: string;
61
+ scope: 'task' | 'agent' | 'runtime';
62
+ audience: 'updater' | 'peer';
63
+ }): string;
64
+ export declare function formatSharedReminderMigrationImpactNotice(language: LanguageCode, args: {
65
+ reminderId: string;
66
+ scope: 'task' | 'agent' | 'runtime';
67
+ }): string;
59
68
  export declare function formatReminderItemGuide(language: LanguageCode, reminderId: string, content: string, options?: {
60
69
  meta?: unknown;
61
70
  scope?: 'dialog' | 'task' | 'agent' | 'runtime';
@@ -12,6 +12,8 @@ exports.formatDiligenceAutoContinuePrompt = formatDiligenceAutoContinuePrompt;
12
12
  exports.formatReminderContextGuide = formatReminderContextGuide;
13
13
  exports.formatReminderContextFooter = formatReminderContextFooter;
14
14
  exports.formatReminderMaintenanceReference = formatReminderMaintenanceReference;
15
+ exports.formatSharedReminderUpdateImpactNotice = formatSharedReminderUpdateImpactNotice;
16
+ exports.formatSharedReminderMigrationImpactNotice = formatSharedReminderMigrationImpactNotice;
15
17
  exports.formatReminderItemGuide = formatReminderItemGuide;
16
18
  exports.formatQ4HDiligencePushBudgetExhausted = formatQ4HDiligencePushBudgetExhausted;
17
19
  exports.formatDomindsNoteTellaskForTeammatesOnly = formatDomindsNoteTellaskForTeammatesOnly;
@@ -133,16 +135,18 @@ function formatNewCourseStartPrompt(language, args) {
133
135
  : `Dominds 因上下文已告急而自动开启了第 ${args.nextCourse} 程对话。`;
134
136
  return (`${noticePrefix} ${prefix} ` +
135
137
  '这是 Dominds 的换程提示,不是新的用户诉求;不要把这条提示当成新的待办,也不要只回复“收到/好的/我会先整理提醒项”。' +
136
- '现在已经进入新一程:上下文已经不再吃紧,告急状况已改观。第一步先复核并在必要时整理接续包提醒项,以清醒头脑删除冗余、纠正偏激或失真的过桥思路、压缩成高质量提醒项;若提醒项已经足够清晰,就不要为了整理而整理。' +
137
- '完成这一步后,直接继续推进原任务本身;除非任务自然需要对用户交付结果,否则不要为这条提示单独回复。');
138
+ '现在已经进入新一程:如果见到上一程的上下文吃紧/告急状况记录,此时既已消除。第一步先读取当前对话范围(scope=dialog)的接续包提醒项,尤其是其中写明的当前对话任务目标,并按这个目标恢复当前这一路主线对话/支线对话,不要仅凭同一差遣牒里的其它主线或支线内容改道。' +
139
+ '随后复核并在必要时整理接续包提醒项,以清醒头脑删除冗余、纠正偏激或失真的过桥思路、压缩成高质量提醒项;若提醒项已经足够清晰,就不要为了整理而整理。' +
140
+ '完成这一步后,直接按照当前对话范围提醒项里的任务目标继续推进;除非任务自然需要对用户交付结果,否则不要为这条提示单独回复。');
138
141
  }
139
142
  const prefix = args.source === 'clear_mind'
140
143
  ? `This is dialog course #${args.nextCourse}. You just cleared your mind.`
141
144
  : `Dominds auto-started dialog course #${args.nextCourse} because context was critical.`;
142
145
  return (`${noticePrefix} ${prefix} ` +
143
146
  'This is a Dominds course-transition notice, not a new user request; do not treat it as a new to-do, and do not reply with a standalone "acknowledged/ok/I will reorganize the reminders first". ' +
144
- 'You are now in a new course: your first step is to review and, if needed, rewrite any continuation-package reminders with a clear head, remove redundancy, correct biased or distorted bridge notes, and compress them into high-quality reminders; if the reminders are already clear enough, do not churn on them. ' +
145
- 'After that, continue the underlying task itself directly; unless the task naturally calls for a user-facing delivery, do not send a standalone reply just for this notice.');
147
+ 'You are now in a new course: if you see records that the previous course was context-tight or context-critical, that condition is now resolved. First read the current-dialog scoped (scope=dialog) continuation-package reminders, especially the current dialog task goal written there, and resume this specific Main Dialog or Side Dialog from that goal instead of drifting into other Main/Side Dialog work that shares the same Taskdoc. ' +
148
+ 'Then review and, if needed, rewrite any continuation-package reminders with a clear head, remove redundancy, correct biased or distorted bridge notes, and compress them into high-quality reminders; if the reminders are already clear enough, do not churn on them. ' +
149
+ 'After that, continue directly from the task goal in the current-dialog scoped reminders; unless the task naturally calls for a user-facing delivery, do not send a standalone reply just for this notice.');
146
150
  }
147
151
  function formatDiligenceAutoContinuePrompt(language, diligenceText) {
148
152
  const noticePrefix = formatSystemNoticePrefix(language);
@@ -562,6 +566,60 @@ function formatReminderMaintenanceReference(language, reminders) {
562
566
  ...lines,
563
567
  ].join('\n');
564
568
  }
569
+ function formatSharedReminderUpdateImpactNotice(language, args) {
570
+ const reminderId = args.reminderId;
571
+ const scope = args.scope;
572
+ if (language === 'zh') {
573
+ const scopeName = scope === 'task' ? '任务范围' : scope === 'agent' ? '智能体范围' : '运行时范围';
574
+ const impactedDialogs = scope === 'task'
575
+ ? '当前进行时存在同一智能体在当前差遣牒任务内的其它并行对话'
576
+ : '当前进行时存在同一智能体的其它并行对话';
577
+ if (args.audience === 'updater') {
578
+ return `共享范围影响:你刚更新的 reminder_id=${reminderId} 是${scopeName}提醒项,不是当前对话私有;${impactedDialogs},其它能看到这条提醒项的对话也会看到这次更新。请考虑使用 migrate_reminder({ "reminder_id": "${reminderId}", "scope": "dialog" }) 确保提醒项的影响范围合理;若新内容只应影响当前对话,迁移后系统会从共享范围撤下,并保留为仅本对话可见的提醒项。`;
579
+ }
580
+ return [
581
+ `${formatSystemNoticePrefix(language)} 共享范围提醒项已更新`,
582
+ '',
583
+ `reminder_id=${reminderId} 是${scopeName}提醒项,不是当前对话私有;${impactedDialogs}。同一智能体的某个并行对话刚更新了它,你所在对话也会看到这次更新。`,
584
+ '这条共享提醒项这次实际上由另一对话维护;你应自行判断它与本对话当前上下文是否有关,只采纳确实相关的部分。',
585
+ `请把它作为最新共享参考。若这次更新看起来只适合更新者所在对话,不要在本对话替它修正共享内容;可提醒更新者在其对话中使用 migrate_reminder({ "reminder_id": "${reminderId}", "scope": "dialog" }) 迁回对话范围,从而从其它并行对话撤下。本对话若另有私有状态,请另建对话范围提醒项。`,
586
+ ].join('\n');
587
+ }
588
+ const scopeName = scope === 'task' ? 'task-scope' : scope === 'agent' ? 'agent-scope' : 'runtime-scope';
589
+ const impactedDialogs = scope === 'task'
590
+ ? 'The current in-flight work has other parallel dialogs for the same agent and Taskdoc'
591
+ : 'The current in-flight work has other parallel dialogs for the same agent';
592
+ if (args.audience === 'updater') {
593
+ return `Shared-scope impact: the reminder you just updated, reminder_id=${reminderId}, is ${scopeName}, not private to the current dialog. ${impactedDialogs}, so other dialogs that can see this reminder will see this update too. Consider running migrate_reminder({ "reminder_id": "${reminderId}", "scope": "dialog" }) to make sure the reminder's impact scope is appropriate; if the new content should affect only the current dialog, Dominds will withdraw it from shared scope and keep it visible only in this dialog after migration.`;
594
+ }
595
+ return [
596
+ `${formatSystemNoticePrefix(language)} Shared-scope reminder updated`,
597
+ '',
598
+ `reminder_id=${reminderId} is ${scopeName}, not private to the current dialog. ${impactedDialogs}. Another parallel dialog for the same agent just updated it, so this dialog will see the update too.`,
599
+ 'This shared reminder was actually maintained by another dialog this time; decide for yourself whether it is relevant to this dialog context, and use only the parts that are truly relevant.',
600
+ `Use it as the latest shared reference. If this update appears to fit only the updater's dialog, do not correct the shared content from this dialog; you may ask the updater to run migrate_reminder({ "reminder_id": "${reminderId}", "scope": "dialog" }) in that dialog so Dominds withdraws it from other parallel dialogs. If this dialog has its own private state, create a separate dialog-scope reminder here.`,
601
+ ].join('\n');
602
+ }
603
+ function formatSharedReminderMigrationImpactNotice(language, args) {
604
+ const reminderId = args.reminderId;
605
+ const scope = args.scope;
606
+ if (language === 'zh') {
607
+ const scopeName = scope === 'task' ? '任务范围' : scope === 'agent' ? '智能体范围' : '运行时范围';
608
+ return [
609
+ `${formatSystemNoticePrefix(language)} 共享范围提醒项已迁回其它对话`,
610
+ '',
611
+ `reminder_id=${reminderId} 原本是${scopeName}提醒项;更新者对话已将它迁回自己的对话范围,因此它不再是你所在对话可见的共享参考。`,
612
+ '若本对话仍需要类似内容,请按本对话当前状态另建对话范围或任务范围提醒项;不要假设迁走后的内容仍适用于这里。',
613
+ ].join('\n');
614
+ }
615
+ const scopeName = scope === 'task' ? 'task-scope' : scope === 'agent' ? 'agent-scope' : 'runtime-scope';
616
+ return [
617
+ `${formatSystemNoticePrefix(language)} Shared-scope reminder migrated back to another dialog`,
618
+ '',
619
+ `reminder_id=${reminderId} was ${scopeName}. The updater dialog has moved it back into its own dialog scope, so it is no longer a shared reference visible to this dialog.`,
620
+ 'If this dialog still needs similar content, create a dialog-scope or task-scope reminder that matches this dialog now; do not assume the migrated content still applies here.',
621
+ ].join('\n');
622
+ }
565
623
  function formatReminderItemGuide(language, reminderId, content, options) {
566
624
  // `options.meta` is persisted JSON coming from tools. Runtime shape checks are unavoidable here
567
625
  // to keep reminder ownership/management loosely coupled and extensible.
@@ -615,12 +673,12 @@ function formatReminderItemGuide(language, reminderId, content, options) {
615
673
  }
616
674
  const scopeLabel = scope === 'task' ? '(任务范围)' : scope === 'agent' ? '(智能体范围)' : '';
617
675
  const scopeGuide = scope === 'task'
618
- ? `${projectionNote}你设置了任务范围提醒项,Dominds 会在当前差遣牒任务内、所有由你主理的对话里提醒你。请把它当作当前任务的手头工作提示,不要自动当成系统下发的下一步动作。`
676
+ ? `${projectionNote}你设置了任务范围提醒项,Dominds 会在当前差遣牒任务内的相关对话里提醒你。请把它当作当前任务的手头工作提示,不要自动当成系统下发的下一步动作。`
619
677
  : scope === 'agent'
620
- ? `${projectionNote}你设置了智能体范围提醒项,Dominds 会在所有由你主理的对话里提醒你。它只适合紧急、短期、全局刺眼提醒;不要用来记录普通任务状态,也不要自动当成系统下发的下一步动作。`
678
+ ? `${projectionNote}你设置了智能体范围提醒项,Dominds 会在由你主理的后续对话里提醒你。它只适合紧急、短期、全局刺眼提醒;不要用来记录普通任务状态,也不要自动当成系统下发的下一步动作。`
621
679
  : `${projectionNote}你设置了提醒项,Dominds 会在需要时提醒你。请把它当作用来保留当前对话里容易丢的手头工作信息的提示,不要自动当成系统下发的下一步动作。`;
622
680
  const scopeMaintenance = scope === 'task'
623
- ? '你应保持简洁、及时更新;不再需要时就删除。若它只对当前对话有效,应改写成 dialog 范围提醒;若需要全队同步当前任务状态,应写入差遣牒 progress,而不是扩大提醒范围。'
681
+ ? '你应保持简洁、及时更新;不再需要时就删除。若它只对当前对话有效,应改写成对话范围提醒;若需要全队同步当前任务状态,应写入差遣牒 progress,而不是扩大提醒范围。'
624
682
  : scope === 'agent'
625
683
  ? '你应主动保持极少量、短期、强相关;不再需要时必须删除。普通任务进展不要放在 agent 范围,当前任务内跨对话可见请改用 task 范围。'
626
684
  : '你应保持简洁、及时更新;不再需要时就删除。若后续准备换程,也可以把它整理成接续包。';
@@ -669,9 +727,9 @@ ${content}`;
669
727
  }
670
728
  const scopeLabel = scope === 'task' ? ' (TASK SCOPE)' : scope === 'agent' ? ' (AGENT SCOPE)' : '';
671
729
  const scopeGuide = scope === 'task'
672
- ? `${enProjectionPrefix}You set a task-scope reminder so Dominds can remind you in every dialog you lead for the current Taskdoc. Treat it as a current-work reference for this task, not as an automatically assigned next action.`
730
+ ? `${enProjectionPrefix}You set a task-scope reminder so Dominds can remind you across relevant dialogs for the current Taskdoc. Treat it as a current-work reference for this task, not as an automatically assigned next action.`
673
731
  : scope === 'agent'
674
- ? `${enProjectionPrefix}You set an agent-scope reminder so Dominds can remind you in every dialog you lead. This is only for urgent, short-lived, globally visible cues; do not use it for ordinary task state, and do not treat it as an automatically assigned next action.`
732
+ ? `${enProjectionPrefix}You set an agent-scope reminder so Dominds can remind you across later dialogs you lead. This is only for urgent, short-lived, globally visible cues; do not use it for ordinary task state, and do not treat it as an automatically assigned next action.`
675
733
  : `${enProjectionPrefix}You set a reminder so Dominds can remind you when needed. Treat it as a current-work reference for easy-to-lose details in the current dialog, not as an automatically assigned next action.`;
676
734
  const scopeMaintenance = scope === 'task'
677
735
  ? 'Keep it concise, refresh it when needed, and delete it when obsolete. If it is only useful for the current dialog, rewrite it into dialog scope; if the team must synchronize current task state, update Taskdoc progress instead of broadening reminder scope.'
@@ -739,14 +797,16 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
739
797
  '',
740
798
  '影响:对话历史中的工具调用/结果信息很多已经过时,成为你的思考负担。',
741
799
  '',
742
- '行动:你当前处于支线对话。本程不要维护差遣牒,也不要整理差遣牒更新提案;当前目标是维护足够详尽的接续包提醒项,然后主动 clear_mind 开启新一程继续工作。',
800
+ '行动:你当前处于支线对话。本程不要维护差遣牒,也不要整理差遣牒更新提案;当前目标是维护足够详尽的当前对话范围(scope=dialog)接续包提醒项,然后主动 clear_mind 开启新一程继续工作。',
801
+ '',
802
+ '重点提醒:接续包提醒项必须写明当前这一路支线对话的任务目标;同一差遣牒下可能还有同一智能体的其它主线/支线对话,下一程要靠 scope=dialog 提醒项继续本路对话,不能靠共享差遣牒猜目标。',
743
803
  '',
744
- '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项没有固定长度限制,宁可完整一些;允许写成多条粗略提醒项,不必在当前程强行压成单条。',
804
+ '提醒项应覆盖:当前对话历史中下一程需要知道的任务目标、讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项没有固定长度限制,宁可完整一些;允许写成多条粗略提醒项,不必在当前程强行压成单条。',
745
805
  '',
746
806
  'Dominds 已提醒当前上下文吃紧:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;真正清理冗余、合并提醒项,放到 Dominds 开启新一程后再做。',
747
807
  '',
748
808
  '操作:',
749
- '- 优先新增详尽接续包提醒项:add_reminder({ "content": "..." })',
809
+ '- 优先新增详尽接续包提醒项:add_reminder({ "content": "...", "scope": "dialog" })',
750
810
  '- 只有在确实能就地复用现有提醒项、且不会额外增加当前程认知负担时,才更新:update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
751
811
  ].join('\n');
752
812
  }
@@ -757,14 +817,15 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
757
817
  '',
758
818
  '影响:对话历史中的工具调用/结果信息很多已经过时,成为你的思考负担。',
759
819
  '',
760
- '行动:你当前处于主线对话。先把当前对话历史中尚未落实到文档、且下一程需要知会的讨论细节落到差遣牒合适章节。然后再把差遣牒仍未覆盖、但恢复工作会丢的信息记进新提醒项过桥(下一步行动 + 关键定位信息 + 运行/验证信息 + 容易丢的临时细节);允许先带着一定冗余,也允许先写成多条粗略提醒项,不必在当前程强行压成单条。',
820
+ '行动:你当前处于主线对话。先新增或更新当前对话范围(scope=dialog)接续包提醒项,并把当前这一路主线对话的任务目标写清楚。然后只把确实需要同一差遣牒下其它对话/队友知会的讨论事实落到差遣牒合适章节;再把差遣牒仍未覆盖、但恢复本路对话会丢的信息记进 scope=dialog 新提醒项过桥(任务目标 + 下一步行动 + 关键定位信息 + 运行/验证信息 + 容易丢的临时细节);允许先带着一定冗余,也允许先写成多条粗略提醒项,不必在当前程强行压成单条。',
761
821
  '',
762
- 'Dominds 已提醒当前上下文吃紧:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;那是 Dominds 真正开启新一程后的第一步。当前程的目标是先把未落文档的讨论细节补进差遣牒,再把差遣牒仍未覆盖、但恢复工作会丢的信息带过桥;真正清理冗余、合并提醒项,放到新一程再做。然后主动 clear_mind,开启新一程对话继续工作。',
822
+ 'Dominds 已提醒当前上下文吃紧:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;那是 Dominds 真正开启新一程后的第一步。当前程的目标是先用 scope=dialog 提醒项保住本路对话目标,再把需要共享的事实补进差遣牒,最后把差遣牒仍未覆盖、但恢复本路对话会丢的信息带过桥;真正清理冗余、合并提醒项,放到新一程再做。然后主动 clear_mind,开启新一程对话继续工作。',
763
823
  '',
764
824
  '操作:',
825
+ '- 必须确保当前对话范围提醒项写明本路任务目标:add_reminder({ "content": "...", "scope": "dialog" }) 或 update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
765
826
  '- 优先新增差遣牒章节保存讨论细节:do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
766
827
  '- 只有在确实需要改写已有章节、且已对照当前差遣牒内容完成合并时,才先调用 recall_taskdoc({"selector":"<selector>"}) 取得 content_hash,再更新:change_mind({"selector":"<selector>","content":"...","previous_content_hash":"crc32:..."})',
767
- '- 优先新增过桥提醒项:add_reminder({ "content": "..." })',
828
+ '- 优先新增当前对话 scope=dialog 过桥提醒项:add_reminder({ "content": "...", "scope": "dialog" })',
768
829
  '- 只有在确实能就地复用现有提醒项、且不会额外增加当前程认知负担时,才更新:update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
769
830
  ].join('\n');
770
831
  }
@@ -776,12 +837,14 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
776
837
  '',
777
838
  `Dominds 最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
778
839
  '',
779
- '行动:你当前处于支线对话。本程不要维护差遣牒,也不要整理差遣牒更新提案;当前目标是尽快维护足够详尽的接续包提醒项,然后 clear_mind。',
840
+ '行动:你当前处于支线对话。本程不要维护差遣牒,也不要整理差遣牒更新提案;当前目标是尽快维护足够详尽的当前对话范围(scope=dialog)接续包提醒项,然后 clear_mind。',
780
841
  '',
781
- '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项没有固定长度限制,宁可完整一些;允许写成多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
842
+ '重点提醒:接续包提醒项必须写明当前这一路支线对话的任务目标;同一差遣牒下可能还有同一智能体的其它主线/支线对话,下一程要靠 scope=dialog 提醒项继续本路对话,不能靠共享差遣牒猜目标。',
843
+ '',
844
+ '提醒项应覆盖:当前对话历史中下一程需要知道的任务目标、讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项没有固定长度限制,宁可完整一些;允许写成多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
782
845
  '',
783
846
  '操作:',
784
- '- 优先新增详尽接续包提醒项:add_reminder({ "content": "..." })',
847
+ '- 优先新增详尽接续包提醒项:add_reminder({ "content": "...", "scope": "dialog" })',
785
848
  '- 只有在确实能就地复用现有提醒项、且不会额外增加当前程认知负担时,才更新:update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
786
849
  '- clear_mind({})',
787
850
  '',
@@ -795,16 +858,17 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
795
858
  '',
796
859
  `Dominds 最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
797
860
  '',
798
- '行动:你当前处于主线对话。尽快保住易丢信息,然后 clear_mind。Dominds 已提醒当前上下文告急:先把当前对话历史中尚未落实到文档、且下一程需要知会的讨论细节落到差遣牒合适章节。然后再把差遣牒仍未覆盖、但恢复工作会丢的信息新增提醒项带过桥;允许先保留多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
861
+ '行动:你当前处于主线对话。尽快保住易丢信息,然后 clear_mind。Dominds 已提醒当前上下文告急:先新增或更新当前对话范围(scope=dialog)接续包提醒项,并把当前这一路主线对话的任务目标写清楚。然后只把确实需要同一差遣牒下其它对话/队友知会的讨论事实落到差遣牒合适章节;再把差遣牒仍未覆盖、但恢复本路对话会丢的信息新增 scope=dialog 提醒项带过桥;允许先保留多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
799
862
  '',
800
863
  '操作:',
864
+ '- 必须确保当前对话范围提醒项写明本路任务目标:add_reminder({ "content": "...", "scope": "dialog" }) 或 update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
801
865
  '- 优先新增差遣牒章节保存讨论细节:do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
802
866
  '- 只有在确实需要改写已有章节、且已对照当前差遣牒内容完成合并时,才先调用 recall_taskdoc({"selector":"<selector>"}) 取得 content_hash,再更新:change_mind({"selector":"<selector>","content":"...","previous_content_hash":"crc32:..."})',
803
- '- 优先新增过桥提醒项:add_reminder({ "content": "..." })',
867
+ '- 优先新增当前对话 scope=dialog 过桥提醒项:add_reminder({ "content": "...", "scope": "dialog" })',
804
868
  '- 只有在确实能就地复用现有提醒项、且不会额外增加当前程认知负担时,才更新:update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
805
869
  '- clear_mind({})',
806
870
  '',
807
- '接续包要点:下一步行动 + 关键定位信息 + 运行验证方式 + 容易丢的临时细节;不要重复差遣牒已有内容,本程刚落入差遣牒的讨论细节只需提示下一程先查差遣牒。Dominds 已提醒当前上下文告急:不要提前做“新一程清醒复核”;Dominds 真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
871
+ '接续包要点:当前对话任务目标 + 下一步行动 + 关键定位信息 + 运行验证方式 + 容易丢的临时细节;不要重复差遣牒已有内容,本程刚落入差遣牒的讨论细节只需提示下一程先查差遣牒。Dominds 已提醒当前上下文告急:不要提前做“新一程清醒复核”;Dominds 真正开启新一程后,第一步才是按当前对话范围提醒项里的任务目标继续本路对话,并重新审视整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
808
872
  ].join('\n');
809
873
  }
810
874
  if (args.kind === 'caution' && args.mode === 'soft') {
@@ -816,14 +880,16 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
816
880
  '',
817
881
  'Impact: stale call/results in dialog history are creating cognitive noise.',
818
882
  '',
819
- 'Action: you are in a Side Dialog. Do not maintain Taskdoc in this course, and do not draft Taskdoc update proposals. The current goal is to maintain sufficiently detailed continuation-package reminders, then proactively clear_mind to start a new dialog course.',
883
+ 'Action: you are in a Side Dialog. Do not maintain Taskdoc in this course, and do not draft Taskdoc update proposals. The current goal is to maintain sufficiently detailed current-dialog scoped (scope=dialog) continuation-package reminders, then proactively clear_mind to start a new dialog course.',
884
+ '',
885
+ 'Priority reminder: the continuation-package reminder must state this specific Side Dialog task goal. The same Taskdoc may have other Main/Side Dialogs for the same agent, so the next course must continue this dialog from scope=dialog reminders instead of guessing the goal from the shared Taskdoc.',
820
886
  '',
821
- 'Reminders should cover: discussion details from current dialog history that the next course needs to know, next actions, key pointers, run/verify info, volatile paths/IDs/sample inputs, and any reasoning needed to resume safely. Reminders have no fixed length limit, so prefer being complete; rough multi-reminder carry-over is acceptable, and you do not need to force everything into one clean reminder in the current course.',
887
+ 'Reminders should cover: the task goal, discussion details from current dialog history that the next course needs to know, next actions, key pointers, run/verify info, volatile paths/IDs/sample inputs, and any reasoning needed to resume safely. Reminders have no fixed length limit, so prefer being complete; rough multi-reminder carry-over is acceptable, and you do not need to force everything into one clean reminder in the current course.',
822
888
  '',
823
889
  'Dominds has already warned that context is tight for the current course, so do not keep expanding context and do not switch early into “clear-headed continuation-package review” mode; reminder cleanup and dedup belong to the new course.',
824
890
  '',
825
891
  'Operations:',
826
- '- Prefer adding a detailed continuation-package reminder first: add_reminder({ "content": "..." })',
892
+ '- Prefer adding a detailed continuation-package reminder first: add_reminder({ "content": "...", "scope": "dialog" })',
827
893
  '- Only if an existing reminder is clearly the right place, and updating it would not add extra cognitive load in the current course: update_reminder({ "reminder_id": "<existing reminder_id>", "content": "..." })',
828
894
  ].join('\n');
829
895
  }
@@ -834,14 +900,15 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
834
900
  '',
835
901
  'Impact: stale call/results in dialog history are creating cognitive noise.',
836
902
  '',
837
- 'Action: you are in the Main Dialog. First record current-dialog discussion details that are not yet documented but the next course needs to know into the appropriate Taskdoc sections. Then write information still not covered by Taskdoc but easy to lose into new bridge reminders (next step + key pointers + run/verify info + easy-to-lose volatile details). Some redundancy is acceptable, and rough multi-reminder carry-over is acceptable too; do not force everything into one clean reminder in the current course.',
903
+ 'Action: you are in the Main Dialog. First add or update a current-dialog scoped (scope=dialog) continuation-package reminder and state this specific Main Dialog task goal clearly. Then record only discussion facts that other dialogs/teammates sharing the same Taskdoc truly need to know into the appropriate Taskdoc sections. After that, write information still not covered by Taskdoc but easy to lose for resuming this dialog into scope=dialog bridge reminders (task goal + next step + key pointers + run/verify info + easy-to-lose volatile details). Some redundancy is acceptable, and rough multi-reminder carry-over is acceptable too; do not force everything into one clean reminder in the current course.',
838
904
  '',
839
- 'Dominds has already warned that context is tight for the current course, so do not keep expanding context and do not switch early into “clear-headed continuation-package review” mode; that is the first step only after Dominds actually starts the new course. In the current course, the goal is to first fill Taskdoc with undocumented discussion details, then carry forward details still not covered by Taskdoc; reminder cleanup and dedup belong to the new course. Then proactively clear_mind to start a new dialog course.',
905
+ 'Dominds has already warned that context is tight for the current course, so do not keep expanding context and do not switch early into “clear-headed continuation-package review” mode; that is the first step only after Dominds actually starts the new course. In the current course, the goal is to first preserve this dialog goal in a scope=dialog reminder, then fill Taskdoc only with facts that need to be shared, and finally carry forward details still not covered by Taskdoc but needed to resume this dialog; reminder cleanup and dedup belong to the new course. Then proactively clear_mind to start a new dialog course.',
840
906
  '',
841
907
  'Operations:',
908
+ '- Ensure a current-dialog scoped reminder states this dialog task goal: add_reminder({ "content": "...", "scope": "dialog" }) or update_reminder({ "reminder_id": "<existing reminder_id>", "content": "..." })',
842
909
  '- Prefer creating a new Taskdoc section for discussion details: do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
843
910
  '- Only update when an existing section truly needs rewriting and you have merged against the current Taskdoc content: first call recall_taskdoc({"selector":"<selector>"}) for content_hash, then change_mind({"selector":"<selector>","content":"...","previous_content_hash":"crc32:..."})',
844
- '- Prefer adding a bridge reminder first: add_reminder({ "content": "..." })',
911
+ '- Prefer adding a current-dialog scope=dialog bridge reminder first: add_reminder({ "content": "...", "scope": "dialog" })',
845
912
  '- Only if an existing reminder is clearly the right place, and updating it would not add extra cognitive load in the current course: update_reminder({ "reminder_id": "<existing reminder_id>", "content": "..." })',
846
913
  ].join('\n');
847
914
  }
@@ -853,12 +920,14 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
853
920
  '',
854
921
  `Dominds will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
855
922
  '',
856
- 'Action: you are in a Side Dialog. Do not maintain Taskdoc in this course, and do not draft Taskdoc update proposals. The current goal is to maintain sufficiently detailed continuation-package reminders as soon as possible, then clear_mind.',
923
+ 'Action: you are in a Side Dialog. Do not maintain Taskdoc in this course, and do not draft Taskdoc update proposals. The current goal is to maintain sufficiently detailed current-dialog scoped (scope=dialog) continuation-package reminders as soon as possible, then clear_mind.',
924
+ '',
925
+ 'Priority reminder: the continuation-package reminder must state this specific Side Dialog task goal. The same Taskdoc may have other Main/Side Dialogs for the same agent, so the next course must continue this dialog from scope=dialog reminders instead of guessing the goal from the shared Taskdoc.',
857
926
  '',
858
- 'Reminders should cover: discussion details from current dialog history that the next course needs to know, next actions, key pointers, run/verify info, volatile paths/IDs/sample inputs, and any reasoning needed to resume safely. Reminders have no fixed length limit, so prefer being complete; multiple rough reminders, including some redundancy, are acceptable as a bridge.',
927
+ 'Reminders should cover: the task goal, discussion details from current dialog history that the next course needs to know, next actions, key pointers, run/verify info, volatile paths/IDs/sample inputs, and any reasoning needed to resume safely. Reminders have no fixed length limit, so prefer being complete; multiple rough reminders, including some redundancy, are acceptable as a bridge.',
859
928
  '',
860
929
  'Operations:',
861
- '- Prefer adding a detailed continuation-package reminder first: add_reminder({ "content": "..." })',
930
+ '- Prefer adding a detailed continuation-package reminder first: add_reminder({ "content": "...", "scope": "dialog" })',
862
931
  '- Only if an existing reminder is clearly the right place, and updating it would not add extra cognitive load in the current course: update_reminder({ "reminder_id": "<existing reminder_id>", "content": "..." })',
863
932
  '- clear_mind({})',
864
933
  '',
@@ -872,16 +941,17 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
872
941
  '',
873
942
  `Dominds will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
874
943
  '',
875
- 'Action: you are in the Main Dialog. Preserve easy-to-lose information, then clear_mind. Because Dominds has warned that context is critical, first record current-dialog discussion details that are not yet documented but the next course needs to know into the appropriate Taskdoc sections. Then add bridge reminders for information still not covered by Taskdoc but easy to lose. Multiple rough reminders, including some redundancy, are acceptable as a bridge; do not spend the current course forcing them into a clean final package.',
944
+ 'Action: you are in the Main Dialog. Preserve easy-to-lose information, then clear_mind. Because Dominds has warned that context is critical, first add or update a current-dialog scoped (scope=dialog) continuation-package reminder and state this specific Main Dialog task goal clearly. Then record only discussion facts that other dialogs/teammates sharing the same Taskdoc truly need to know into the appropriate Taskdoc sections. After that, add scope=dialog bridge reminders for information still not covered by Taskdoc but easy to lose when resuming this dialog. Multiple rough reminders, including some redundancy, are acceptable as a bridge; do not spend the current course forcing them into a clean final package.',
876
945
  '',
877
946
  'Operations:',
947
+ '- Ensure a current-dialog scoped reminder states this dialog task goal: add_reminder({ "content": "...", "scope": "dialog" }) or update_reminder({ "reminder_id": "<existing reminder_id>", "content": "..." })',
878
948
  '- Prefer creating a new Taskdoc section for discussion details: do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
879
949
  '- Only update when an existing section truly needs rewriting and you have merged against the current Taskdoc content: first call recall_taskdoc({"selector":"<selector>"}) for content_hash, then change_mind({"selector":"<selector>","content":"...","previous_content_hash":"crc32:..."})',
880
- '- Prefer adding a bridge reminder first: add_reminder({ "content": "..." })',
950
+ '- Prefer adding a current-dialog scope=dialog bridge reminder first: add_reminder({ "content": "...", "scope": "dialog" })',
881
951
  '- Only if an existing reminder is clearly the right place, and updating it would not add extra cognitive load in the current course: update_reminder({ "reminder_id": "<existing reminder_id>", "content": "..." })',
882
952
  '- clear_mind({})',
883
953
  '',
884
- 'Continuation package: next step + key pointers + run/verify info + easy-to-lose volatile details. Do not duplicate Taskdoc content; for discussion details just written into Taskdoc in this course, only remind the next course to review Taskdoc first. Because Dominds has warned that context is critical in the current course, do not start the new-course cleanup early; once Dominds actually starts the new course, the first step is to reconcile rough bridge reminders by removing redundancy, correcting biased or distorted bridge notes, and merging/compressing them into high-quality reminders.',
954
+ 'Continuation package: current dialog task goal + next step + key pointers + run/verify info + easy-to-lose volatile details. Do not duplicate Taskdoc content; for discussion details just written into Taskdoc in this course, only remind the next course to review Taskdoc first. Because Dominds has warned that context is critical in the current course, do not start the new-course cleanup early; once Dominds actually starts the new course, the first step is to continue this dialog from the task goal in current-dialog scoped reminders and reconcile rough bridge reminders by removing redundancy, correcting biased or distorted bridge notes, and merging/compressing them into high-quality reminders.',
885
955
  ].join('\n');
886
956
  }
887
957
  function formatAgentFacingCriticalUserInterjectionRemediationGuide(language, args) {
@@ -0,0 +1,20 @@
1
+ import type { LanguageCode } from '@longrun-ai/kernel/types/language';
2
+ import type { Dialog } from '../dialog';
3
+ export type SharedReminderUpdateImpactScope = 'task' | 'agent' | 'runtime';
4
+ export type SharedReminderUpdateImpactDispatch = Readonly<{
5
+ scope: SharedReminderUpdateImpactScope;
6
+ peerDialogCount: number;
7
+ dispatchedDialogCount: number;
8
+ }>;
9
+ export declare function dispatchSharedReminderUpdateImpact(args: {
10
+ updater: Dialog;
11
+ reminderId: string;
12
+ scope: SharedReminderUpdateImpactScope;
13
+ language: LanguageCode;
14
+ }): Promise<SharedReminderUpdateImpactDispatch | undefined>;
15
+ export declare function dispatchSharedReminderMigrationImpact(args: {
16
+ updater: Dialog;
17
+ reminderId: string;
18
+ scope: SharedReminderUpdateImpactScope;
19
+ language: LanguageCode;
20
+ }): Promise<SharedReminderUpdateImpactDispatch | undefined>;