dominds 1.17.7 → 1.18.2

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 (140) hide show
  1. package/dist/dialog-fork.js +11 -5
  2. package/dist/dialog-instance-registry.js +1 -18
  3. package/dist/dialog.d.ts +21 -31
  4. package/dist/dialog.js +207 -56
  5. package/dist/docs/dialog-system.md +3 -2
  6. package/dist/docs/dialog-system.zh.md +3 -2
  7. package/dist/docs/tellask-collab.md +2 -1
  8. package/dist/docs/tellask-collab.zh.md +2 -1
  9. package/dist/llm/defaults.yaml +43 -0
  10. package/dist/llm/gen/anthropic.js +153 -12
  11. package/dist/llm/gen/codex.js +160 -10
  12. package/dist/llm/gen/openai-compatible.js +141 -81
  13. package/dist/llm/gen/openai.js +178 -12
  14. package/dist/llm/gen/tool-result-image-ingest.d.ts +17 -8
  15. package/dist/llm/gen/tool-result-image-ingest.js +127 -27
  16. package/dist/llm/gen.d.ts +13 -0
  17. package/dist/llm/kernel-driver/drive.js +79 -15
  18. package/dist/llm/kernel-driver/flow.js +158 -41
  19. package/dist/llm/kernel-driver/reply-guidance.d.ts +6 -6
  20. package/dist/llm/kernel-driver/reply-guidance.js +169 -2
  21. package/dist/llm/kernel-driver/runtime.d.ts +2 -2
  22. package/dist/llm/kernel-driver/subdialog.js +4 -0
  23. package/dist/llm/kernel-driver/tellask-special.d.ts +2 -0
  24. package/dist/llm/kernel-driver/tellask-special.js +11 -6
  25. package/dist/llm/kernel-driver/types.d.ts +14 -24
  26. package/dist/minds/system-prompt.js +8 -8
  27. package/dist/persistence.d.ts +6 -5
  28. package/dist/persistence.js +198 -39
  29. package/dist/priming.js +98 -3
  30. package/dist/runtime/driver-messages.d.ts +1 -0
  31. package/dist/runtime/driver-messages.js +32 -10
  32. package/dist/runtime/reply-prompt-copy.js +4 -4
  33. package/dist/server/api-routes.js +11 -43
  34. package/dist/server/websocket-handler.js +155 -10
  35. package/dist/tools/builtins.js +10 -4
  36. package/dist/tools/cmd-runner.js +110 -49
  37. package/dist/tools/picture.d.ts +3 -0
  38. package/dist/tools/picture.js +344 -0
  39. package/dist/tools/prompts/control/en/principles.md +4 -2
  40. package/dist/tools/prompts/control/en/scenarios.md +2 -1
  41. package/dist/tools/prompts/control/en/tools.md +6 -6
  42. package/dist/tools/prompts/control/zh/principles.md +4 -2
  43. package/dist/tools/prompts/control/zh/scenarios.md +2 -1
  44. package/dist/tools/prompts/control/zh/tools.md +1 -1
  45. package/dist/tools/prompts/ws_mod.en.md +1 -0
  46. package/dist/tools/prompts/ws_mod.zh.md +1 -0
  47. package/dist/tools/prompts/ws_read/en/tools.md +25 -5
  48. package/dist/tools/prompts/ws_read/zh/tools.md +25 -5
  49. package/package.json +4 -4
  50. package/webapp/dist/assets/{_basePickBy-u7tNFRWr.js → _basePickBy-BPJaiZdW.js} +3 -3
  51. package/webapp/dist/assets/{_basePickBy-u7tNFRWr.js.map → _basePickBy-BPJaiZdW.js.map} +1 -1
  52. package/webapp/dist/assets/{_baseUniq-CH9LRkiH.js → _baseUniq-BEetT15i.js} +2 -2
  53. package/webapp/dist/assets/{_baseUniq-CH9LRkiH.js.map → _baseUniq-BEetT15i.js.map} +1 -1
  54. package/webapp/dist/assets/{arc-Bo0Lw3ZP.js → arc-Dm7Zf36f.js} +2 -2
  55. package/webapp/dist/assets/{arc-Bo0Lw3ZP.js.map → arc-Dm7Zf36f.js.map} +1 -1
  56. package/webapp/dist/assets/{architectureDiagram-VXUJARFQ-Ckyr89Iw.js → architectureDiagram-VXUJARFQ-BpTPtkuo.js} +7 -7
  57. package/webapp/dist/assets/{architectureDiagram-VXUJARFQ-Ckyr89Iw.js.map → architectureDiagram-VXUJARFQ-BpTPtkuo.js.map} +1 -1
  58. package/webapp/dist/assets/{blockDiagram-VD42YOAC-BSXoLLq_.js → blockDiagram-VD42YOAC-C8fLN0iu.js} +7 -7
  59. package/webapp/dist/assets/{blockDiagram-VD42YOAC-BSXoLLq_.js.map → blockDiagram-VD42YOAC-C8fLN0iu.js.map} +1 -1
  60. package/webapp/dist/assets/{c4Diagram-YG6GDRKO-CgCG1cP0.js → c4Diagram-YG6GDRKO-BpPr62CH.js} +3 -3
  61. package/webapp/dist/assets/{c4Diagram-YG6GDRKO-CgCG1cP0.js.map → c4Diagram-YG6GDRKO-BpPr62CH.js.map} +1 -1
  62. package/webapp/dist/assets/{channel-Crbz0zgt.js → channel-EMYoPjW3.js} +2 -2
  63. package/webapp/dist/assets/{channel-Crbz0zgt.js.map → channel-EMYoPjW3.js.map} +1 -1
  64. package/webapp/dist/assets/{chunk-4BX2VUAB-BIIEb_5S.js → chunk-4BX2VUAB-CefNtjWG.js} +2 -2
  65. package/webapp/dist/assets/{chunk-4BX2VUAB-BIIEb_5S.js.map → chunk-4BX2VUAB-CefNtjWG.js.map} +1 -1
  66. package/webapp/dist/assets/{chunk-55IACEB6-CaJzGgc9.js → chunk-55IACEB6-C_X7T43V.js} +2 -2
  67. package/webapp/dist/assets/{chunk-55IACEB6-CaJzGgc9.js.map → chunk-55IACEB6-C_X7T43V.js.map} +1 -1
  68. package/webapp/dist/assets/{chunk-B4BG7PRW-DHQwhO9F.js → chunk-B4BG7PRW-BRe3_2oA.js} +5 -5
  69. package/webapp/dist/assets/{chunk-B4BG7PRW-DHQwhO9F.js.map → chunk-B4BG7PRW-BRe3_2oA.js.map} +1 -1
  70. package/webapp/dist/assets/{chunk-DI55MBZ5-CG1lO0R8.js → chunk-DI55MBZ5-CbvrsI_w.js} +4 -4
  71. package/webapp/dist/assets/{chunk-DI55MBZ5-CG1lO0R8.js.map → chunk-DI55MBZ5-CbvrsI_w.js.map} +1 -1
  72. package/webapp/dist/assets/{chunk-FMBD7UC4-DAUsTLPS.js → chunk-FMBD7UC4-ORmtkrtS.js} +2 -2
  73. package/webapp/dist/assets/{chunk-FMBD7UC4-DAUsTLPS.js.map → chunk-FMBD7UC4-ORmtkrtS.js.map} +1 -1
  74. package/webapp/dist/assets/{chunk-QN33PNHL-BfQs-QHE.js → chunk-QN33PNHL-LTAOVhWu.js} +2 -2
  75. package/webapp/dist/assets/{chunk-QN33PNHL-BfQs-QHE.js.map → chunk-QN33PNHL-LTAOVhWu.js.map} +1 -1
  76. package/webapp/dist/assets/{chunk-QZHKN3VN-C5iKQ6mQ.js → chunk-QZHKN3VN-ZoUM_4u5.js} +2 -2
  77. package/webapp/dist/assets/{chunk-QZHKN3VN-C5iKQ6mQ.js.map → chunk-QZHKN3VN-ZoUM_4u5.js.map} +1 -1
  78. package/webapp/dist/assets/{chunk-TZMSLE5B-CBShDwy2.js → chunk-TZMSLE5B-Gao4qrq7.js} +2 -2
  79. package/webapp/dist/assets/{chunk-TZMSLE5B-CBShDwy2.js.map → chunk-TZMSLE5B-Gao4qrq7.js.map} +1 -1
  80. package/webapp/dist/assets/{classDiagram-2ON5EDUG-DrfJDzYO.js → classDiagram-2ON5EDUG-uha1vIGN.js} +6 -6
  81. package/webapp/dist/assets/{classDiagram-2ON5EDUG-DrfJDzYO.js.map → classDiagram-2ON5EDUG-uha1vIGN.js.map} +1 -1
  82. package/webapp/dist/assets/{classDiagram-v2-WZHVMYZB-DrfJDzYO.js → classDiagram-v2-WZHVMYZB-uha1vIGN.js} +6 -6
  83. package/webapp/dist/assets/{classDiagram-v2-WZHVMYZB-DrfJDzYO.js.map → classDiagram-v2-WZHVMYZB-uha1vIGN.js.map} +1 -1
  84. package/webapp/dist/assets/{clone-Cd-48URG.js → clone-_9Ayb1Gp.js} +2 -2
  85. package/webapp/dist/assets/{clone-Cd-48URG.js.map → clone-_9Ayb1Gp.js.map} +1 -1
  86. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-CCji0YN3.js → cose-bilkent-S5V4N54A-C8wDw3NY.js} +2 -2
  87. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-CCji0YN3.js.map → cose-bilkent-S5V4N54A-C8wDw3NY.js.map} +1 -1
  88. package/webapp/dist/assets/{dagre-6UL2VRFP-B94p-Dpl.js → dagre-6UL2VRFP-BUSeNot0.js} +7 -7
  89. package/webapp/dist/assets/{dagre-6UL2VRFP-B94p-Dpl.js.map → dagre-6UL2VRFP-BUSeNot0.js.map} +1 -1
  90. package/webapp/dist/assets/{diagram-PSM6KHXK-DP-zGmAS.js → diagram-PSM6KHXK-CMZAksVC.js} +8 -8
  91. package/webapp/dist/assets/{diagram-PSM6KHXK-DP-zGmAS.js.map → diagram-PSM6KHXK-CMZAksVC.js.map} +1 -1
  92. package/webapp/dist/assets/{diagram-QEK2KX5R-DquJirs4.js → diagram-QEK2KX5R-BQKoRtwy.js} +7 -7
  93. package/webapp/dist/assets/{diagram-QEK2KX5R-DquJirs4.js.map → diagram-QEK2KX5R-BQKoRtwy.js.map} +1 -1
  94. package/webapp/dist/assets/{diagram-S2PKOQOG-Dt5W2t6V.js → diagram-S2PKOQOG-DjMG97kd.js} +7 -7
  95. package/webapp/dist/assets/{diagram-S2PKOQOG-Dt5W2t6V.js.map → diagram-S2PKOQOG-DjMG97kd.js.map} +1 -1
  96. package/webapp/dist/assets/{erDiagram-Q2GNP2WA-Bs0-2Rfj.js → erDiagram-Q2GNP2WA-BujwA137.js} +5 -5
  97. package/webapp/dist/assets/{erDiagram-Q2GNP2WA-Bs0-2Rfj.js.map → erDiagram-Q2GNP2WA-BujwA137.js.map} +1 -1
  98. package/webapp/dist/assets/{flowDiagram-NV44I4VS-cJjXWAlK.js → flowDiagram-NV44I4VS-DgwPjg4y.js} +6 -6
  99. package/webapp/dist/assets/{flowDiagram-NV44I4VS-cJjXWAlK.js.map → flowDiagram-NV44I4VS-DgwPjg4y.js.map} +1 -1
  100. package/webapp/dist/assets/{ganttDiagram-JELNMOA3-Du1AUaKm.js → ganttDiagram-JELNMOA3-Db2ykf3E.js} +3 -3
  101. package/webapp/dist/assets/{ganttDiagram-JELNMOA3-Du1AUaKm.js.map → ganttDiagram-JELNMOA3-Db2ykf3E.js.map} +1 -1
  102. package/webapp/dist/assets/{gitGraphDiagram-V2S2FVAM-D_jVOYOK.js → gitGraphDiagram-V2S2FVAM-D_gSifkv.js} +8 -8
  103. package/webapp/dist/assets/{gitGraphDiagram-V2S2FVAM-D_jVOYOK.js.map → gitGraphDiagram-V2S2FVAM-D_gSifkv.js.map} +1 -1
  104. package/webapp/dist/assets/{graph-CuF_sq4r.js → graph-BHjCU5xP.js} +3 -3
  105. package/webapp/dist/assets/{graph-CuF_sq4r.js.map → graph-BHjCU5xP.js.map} +1 -1
  106. package/webapp/dist/assets/{index-DAShQcjb.js → index-DLajsIDJ.js} +1363 -248
  107. package/webapp/dist/assets/{index-DAShQcjb.js.map → index-DLajsIDJ.js.map} +1 -1
  108. package/webapp/dist/assets/{infoDiagram-HS3SLOUP-CEFlo_Hl.js → infoDiagram-HS3SLOUP-BDba5pKs.js} +6 -6
  109. package/webapp/dist/assets/{infoDiagram-HS3SLOUP-CEFlo_Hl.js.map → infoDiagram-HS3SLOUP-BDba5pKs.js.map} +1 -1
  110. package/webapp/dist/assets/{journeyDiagram-XKPGCS4Q-zc2Q4Se9.js → journeyDiagram-XKPGCS4Q-CmJAbmlm.js} +5 -5
  111. package/webapp/dist/assets/{journeyDiagram-XKPGCS4Q-zc2Q4Se9.js.map → journeyDiagram-XKPGCS4Q-CmJAbmlm.js.map} +1 -1
  112. package/webapp/dist/assets/{kanban-definition-3W4ZIXB7-oT42RM2a.js → kanban-definition-3W4ZIXB7-DxQeBTDk.js} +3 -3
  113. package/webapp/dist/assets/{kanban-definition-3W4ZIXB7-oT42RM2a.js.map → kanban-definition-3W4ZIXB7-DxQeBTDk.js.map} +1 -1
  114. package/webapp/dist/assets/{layout-BvaOu3k2.js → layout-DteV_yE8.js} +5 -5
  115. package/webapp/dist/assets/{layout-BvaOu3k2.js.map → layout-DteV_yE8.js.map} +1 -1
  116. package/webapp/dist/assets/{linear-Cg-CjocS.js → linear-zItbPrND.js} +2 -2
  117. package/webapp/dist/assets/{linear-Cg-CjocS.js.map → linear-zItbPrND.js.map} +1 -1
  118. package/webapp/dist/assets/{mindmap-definition-VGOIOE7T-CVFVrU22.js → mindmap-definition-VGOIOE7T-BJXI7UqO.js} +4 -4
  119. package/webapp/dist/assets/{mindmap-definition-VGOIOE7T-CVFVrU22.js.map → mindmap-definition-VGOIOE7T-BJXI7UqO.js.map} +1 -1
  120. package/webapp/dist/assets/{pieDiagram-ADFJNKIX-Bai5CMos.js → pieDiagram-ADFJNKIX-BpM-aH2p.js} +8 -8
  121. package/webapp/dist/assets/{pieDiagram-ADFJNKIX-Bai5CMos.js.map → pieDiagram-ADFJNKIX-BpM-aH2p.js.map} +1 -1
  122. package/webapp/dist/assets/{quadrantDiagram-AYHSOK5B-BPXDO_2E.js → quadrantDiagram-AYHSOK5B-NXdIpA15.js} +3 -3
  123. package/webapp/dist/assets/{quadrantDiagram-AYHSOK5B-BPXDO_2E.js.map → quadrantDiagram-AYHSOK5B-NXdIpA15.js.map} +1 -1
  124. package/webapp/dist/assets/{requirementDiagram-UZGBJVZJ-Dgj9X9cE.js → requirementDiagram-UZGBJVZJ-D1AICAA0.js} +4 -4
  125. package/webapp/dist/assets/{requirementDiagram-UZGBJVZJ-Dgj9X9cE.js.map → requirementDiagram-UZGBJVZJ-D1AICAA0.js.map} +1 -1
  126. package/webapp/dist/assets/{sankeyDiagram-TZEHDZUN-Dc0mO4OD.js → sankeyDiagram-TZEHDZUN-WiReDPfo.js} +2 -2
  127. package/webapp/dist/assets/{sankeyDiagram-TZEHDZUN-Dc0mO4OD.js.map → sankeyDiagram-TZEHDZUN-WiReDPfo.js.map} +1 -1
  128. package/webapp/dist/assets/{sequenceDiagram-WL72ISMW-DZJTga0d.js → sequenceDiagram-WL72ISMW-Cw76oP8t.js} +4 -4
  129. package/webapp/dist/assets/{sequenceDiagram-WL72ISMW-DZJTga0d.js.map → sequenceDiagram-WL72ISMW-Cw76oP8t.js.map} +1 -1
  130. package/webapp/dist/assets/{stateDiagram-FKZM4ZOC-RNxYatKM.js → stateDiagram-FKZM4ZOC-QjCeRczs.js} +9 -9
  131. package/webapp/dist/assets/{stateDiagram-FKZM4ZOC-RNxYatKM.js.map → stateDiagram-FKZM4ZOC-QjCeRczs.js.map} +1 -1
  132. package/webapp/dist/assets/{stateDiagram-v2-4FDKWEC3-ADxYqWzo.js → stateDiagram-v2-4FDKWEC3-IClqxQ4s.js} +5 -5
  133. package/webapp/dist/assets/{stateDiagram-v2-4FDKWEC3-ADxYqWzo.js.map → stateDiagram-v2-4FDKWEC3-IClqxQ4s.js.map} +1 -1
  134. package/webapp/dist/assets/{timeline-definition-IT6M3QCI-Qx_h1e-i.js → timeline-definition-IT6M3QCI-BfyfTY7m.js} +3 -3
  135. package/webapp/dist/assets/{timeline-definition-IT6M3QCI-Qx_h1e-i.js.map → timeline-definition-IT6M3QCI-BfyfTY7m.js.map} +1 -1
  136. package/webapp/dist/assets/{treemap-GDKQZRPO-BHzYvXGn.js → treemap-GDKQZRPO-C5MiL6--.js} +5 -5
  137. package/webapp/dist/assets/{treemap-GDKQZRPO-BHzYvXGn.js.map → treemap-GDKQZRPO-C5MiL6--.js.map} +1 -1
  138. package/webapp/dist/assets/{xychartDiagram-PRI3JC2R-DGdjkYQQ.js → xychartDiagram-PRI3JC2R-ybaJrSry.js} +3 -3
  139. package/webapp/dist/assets/{xychartDiagram-PRI3JC2R-DGdjkYQQ.js.map → xychartDiagram-PRI3JC2R-ybaJrSry.js.map} +1 -1
  140. package/webapp/dist/index.html +1 -1
@@ -4,7 +4,7 @@ import type { FuncTool, ToolArguments } from '../../tool';
4
4
  import { type LlmFailureQuirkHandlerSession } from '../api-quirks';
5
5
  import type { ProviderConfig } from '../client';
6
6
  import { type LlmFailureClassifier } from '../gen';
7
- import type { KernelDriverHumanPrompt } from './types';
7
+ import type { KernelDriverDiligencePrompt } from './types';
8
8
  export declare class LlmRetryStoppedError extends Error {
9
9
  readonly reason: DialogLlmRetryExhaustedReason;
10
10
  constructor(reason: DialogLlmRetryExhaustedReason, message: string);
@@ -35,7 +35,7 @@ export declare function maybePrepareDiligenceAutoContinuePrompt(options: {
35
35
  nextRemainingBudget: number;
36
36
  } | {
37
37
  kind: 'prompt';
38
- prompt: KernelDriverHumanPrompt;
38
+ prompt: KernelDriverDiligencePrompt;
39
39
  maxInjectCount: number;
40
40
  nextRemainingBudget: number;
41
41
  }>;
@@ -317,6 +317,10 @@ async function supplyResponseToSupdialog(args) {
317
317
  }),
318
318
  };
319
319
  await persistence_1.DialogPersistence.appendEvent(subdialogId, calleeResponseRef.course, replyResolutionRecord, parentDialog.status);
320
+ const deferredReplyReassertion = await persistence_1.DialogPersistence.getDeferredReplyReassertion(subdialogId, parentDialog.status);
321
+ if (deferredReplyReassertion?.directive.targetCallId === resolvedCallId) {
322
+ await persistence_1.DialogPersistence.setDeferredReplyReassertion(subdialogId, undefined, parentDialog.status);
323
+ }
320
324
  }
321
325
  const anchorRecord = {
322
326
  ts: (0, time_1.formatUnifiedTimestamp)(new Date()),
@@ -96,6 +96,7 @@ export declare function executeTellaskCalls(args: {
96
96
  dlg: Dialog;
97
97
  calls: readonly TellaskCall[];
98
98
  callbacks: KernelDriverDriveCallbacks;
99
+ activePromptReplyDirective?: TellaskReplyDirective;
99
100
  }): Promise<{
100
101
  toolOutputs: ChatMessage[];
101
102
  successfulReplyCallIds: string[];
@@ -113,5 +114,6 @@ export declare function processTellaskFunctionRound(args: {
113
114
  funcCalls: readonly FuncCallMsg[];
114
115
  allowedSpecials: ReadonlySet<TellaskCallFunctionName>;
115
116
  callbacks: KernelDriverDriveCallbacks;
117
+ activePromptReplyDirective?: TellaskReplyDirective;
116
118
  }): Promise<TellaskFunctionRoundResult>;
117
119
  export {};
@@ -871,9 +871,10 @@ async function finishRegisteredTellaskReplacement(args) {
871
871
  await ownerDialog.addChatMessages(immediateMirror);
872
872
  }
873
873
  async function reviveDialogIfUnblocked(dialog, callbacks, reason) {
874
- const hasQ4H = await dialog.hasPendingQ4H();
875
- const hasPendingSubdialogs = await dialog.hasPendingSubdialogs();
876
- if (hasQ4H || hasPendingSubdialogs) {
874
+ const suspension = await dialog.getSuspensionStatus({
875
+ allowPendingSubdialogs: reason === 'reply_tellask_back_delivered',
876
+ });
877
+ if (!suspension.canDrive) {
877
878
  return;
878
879
  }
879
880
  if (dialog instanceof dialog_1.RootDialog) {
@@ -888,7 +889,9 @@ async function reviveDialogIfUnblocked(dialog, callbacks, reason) {
888
889
  noPromptSubdialogResumeEntitlement: dialog instanceof dialog_1.SubDialog
889
890
  ? {
890
891
  ownerDialogId: dialog.id.selfId,
891
- reason: 'reply_tellask_back_delivered',
892
+ reason: reason === 'reply_tellask_back_delivered'
893
+ ? 'reply_tellask_back_delivered'
894
+ : 'resolved_pending_subdialog_reply',
892
895
  }
893
896
  : undefined,
894
897
  },
@@ -1612,7 +1615,6 @@ async function executeTellaskCall(dlg, mentionList, body, callId, callbacks, opt
1612
1615
  msgId: resumePrompt.msgId,
1613
1616
  grammar: resumePrompt.grammar,
1614
1617
  userLanguageCode: resumePrompt.userLanguageCode,
1615
- q4hAnswerCallId: resumePrompt.q4hAnswerCallId,
1616
1618
  tellaskReplyDirective: resumePrompt.tellaskReplyDirective,
1617
1619
  skipTaskdoc: resumePrompt.skipTaskdoc,
1618
1620
  subdialogReplyTarget: resumePrompt.subdialogReplyTarget,
@@ -1789,7 +1791,7 @@ async function emitTellaskCallEvents(args) {
1789
1791
  }
1790
1792
  async function executeReplyTellaskCall(args) {
1791
1793
  const genseq = args.dlg.activeGenSeqOrUndefined ?? 1;
1792
- const activeDirective = await loadLatestActiveTellaskReplyDirective(args.dlg);
1794
+ const activeDirective = args.activePromptReplyDirective ?? (await loadLatestActiveTellaskReplyDirective(args.dlg));
1793
1795
  const expectedCallName = activeDirective?.expectedReplyCallName;
1794
1796
  if (!expectedCallName) {
1795
1797
  return {
@@ -2012,6 +2014,7 @@ async function executeValidTellaskCalls(args) {
2012
2014
  dlg: args.dlg,
2013
2015
  call,
2014
2016
  callbacks: args.callbacks,
2017
+ activePromptReplyDirective: args.activePromptReplyDirective,
2015
2018
  });
2016
2019
  if (replyResult.delivered) {
2017
2020
  successfulReplyCallIds.push(call.callId);
@@ -2075,6 +2078,7 @@ async function executeTellaskCalls(args) {
2075
2078
  dlg: args.dlg,
2076
2079
  calls: args.calls.map((call) => toExecutableValidTellaskCall(call)),
2077
2080
  callbacks: args.callbacks,
2081
+ activePromptReplyDirective: args.activePromptReplyDirective,
2078
2082
  });
2079
2083
  }
2080
2084
  async function processTellaskFunctionRound(args) {
@@ -2171,6 +2175,7 @@ async function processTellaskFunctionRound(args) {
2171
2175
  dlg: args.dlg,
2172
2176
  calls: orderedValidCalls.map((handled) => handled.call),
2173
2177
  callbacks: args.callbacks,
2178
+ activePromptReplyDirective: args.activePromptReplyDirective,
2174
2179
  });
2175
2180
  }
2176
2181
  catch (err) {
@@ -1,16 +1,7 @@
1
1
  import type { DialogDisplayState, DialogInterruptionReason } from '@longrun-ai/kernel/types/display-state';
2
- import type { LanguageCode } from '@longrun-ai/kernel/types/language';
3
- import type { TellaskReplyDirective } from '@longrun-ai/kernel/types/storage';
2
+ import type { DialogDiligencePrompt, DialogPrompt, DialogRunControlSpec, DialogRuntimeGuidePrompt, DialogRuntimePrompt, DialogRuntimeReplyPrompt, DialogRuntimeSubdialogPrompt, DialogUserPrompt } from '@longrun-ai/kernel/types/drive-intent';
4
3
  import type { Dialog, DialogID } from '../../dialog';
5
- export type KernelDriverRunControl = Readonly<{
6
- controlId: string;
7
- input: Readonly<Record<string, unknown>>;
8
- source: 'drive_dlg_by_user_msg' | 'drive_dialog_by_user_answer';
9
- q4h?: Readonly<{
10
- questionId: string;
11
- continuationType: 'answer' | 'followup' | 'retry' | 'new_message';
12
- }>;
13
- }>;
4
+ export type KernelDriverRunControl = DialogRunControlSpec;
14
5
  export type KernelDriverDriveSource = 'unspecified' | 'ws_user_message' | 'ws_user_answer' | 'ws_diligence_push' | 'ws_resume_dialog' | 'ws_resume_all' | 'kernel_driver_backend_loop' | 'kernel_driver_follow_up' | 'kernel_driver_subdialog_init' | 'kernel_driver_subdialog_resume' | 'kernel_driver_fbr_subdialog_round' | 'kernel_driver_type_a_supdialog_call' | 'kernel_driver_supply_response_parent_revive';
15
6
  export type KernelDriverDriveOptions = Readonly<{
16
7
  suppressDiligencePush?: boolean;
@@ -31,20 +22,18 @@ export type KernelDriverSubdialogReplyTarget = {
31
22
  callType: 'A' | 'B' | 'C';
32
23
  callId: string;
33
24
  };
34
- export interface KernelDriverHumanPrompt {
35
- content: string;
36
- msgId: string;
37
- grammar: 'markdown';
38
- userLanguageCode?: LanguageCode;
39
- q4hAnswerCallId?: string;
40
- tellaskReplyDirective?: TellaskReplyDirective;
41
- origin: 'user' | 'diligence_push' | 'runtime';
42
- skipTaskdoc?: boolean;
43
- subdialogReplyTarget?: KernelDriverSubdialogReplyTarget;
25
+ type KernelDriverPromptWithRunControl<TPrompt extends DialogPrompt> = TPrompt & {
44
26
  runControl?: KernelDriverRunControl;
45
- }
27
+ };
28
+ export type KernelDriverUserPrompt = KernelDriverPromptWithRunControl<DialogUserPrompt>;
29
+ export type KernelDriverDiligencePrompt = KernelDriverPromptWithRunControl<DialogDiligencePrompt>;
30
+ export type KernelDriverRuntimeGuidePrompt = KernelDriverPromptWithRunControl<DialogRuntimeGuidePrompt>;
31
+ export type KernelDriverRuntimeReplyPrompt = KernelDriverPromptWithRunControl<DialogRuntimeReplyPrompt>;
32
+ export type KernelDriverRuntimeSubdialogPrompt = KernelDriverPromptWithRunControl<DialogRuntimeSubdialogPrompt>;
33
+ export type KernelDriverRuntimePrompt = KernelDriverPromptWithRunControl<DialogRuntimePrompt>;
34
+ export type KernelDriverPrompt = KernelDriverPromptWithRunControl<DialogPrompt>;
46
35
  export type KernelDriverDriveCallOptions = Readonly<{
47
- humanPrompt: KernelDriverHumanPrompt;
36
+ humanPrompt: KernelDriverPrompt;
48
37
  waitInQue: boolean;
49
38
  driveOptions?: KernelDriverDriveOptions;
50
39
  }> | Readonly<{
@@ -60,7 +49,7 @@ export type KernelDriverDriveCallbacks = Readonly<{
60
49
  }>;
61
50
  export type KernelDriverDriveArgs = readonly [
62
51
  dlg: Dialog,
63
- humanPrompt: KernelDriverHumanPrompt,
52
+ humanPrompt: KernelDriverPrompt,
64
53
  waitInQue: boolean,
65
54
  driveOptions?: KernelDriverDriveOptions
66
55
  ] | readonly [
@@ -104,3 +93,4 @@ export type KernelDriverCoreResult = {
104
93
  };
105
94
  };
106
95
  export declare function createKernelDriverRuntimeState(): KernelDriverRuntimeState;
96
+ export {};
@@ -104,7 +104,7 @@ function buildTeammateTellaskPhaseContract(language) {
104
104
  '- 只有长线诉请(`tellask` + `sessionSlug`)才有“更新任务安排”的通道;一次性诉请(`tellaskSessionless`)没有这个通道。再次发起 `tellaskSessionless` 只会创建新的瞬态支线,不会更新、更不会要求旧支线主理人停止;若你后来发现可能需要改要求/提前收口,一开始就不该选择 `tellaskSessionless`。',
105
105
  '- 能由队友诉请完成的执行性工作,禁止转交 `askHuman` 做“转发员”;当你写“让 @X 执行 Y”时,必须在同一回复内直接发出 `tellask` 或 `tellaskSessionless`。',
106
106
  `- 当你在诉请正文里定义“回贴格式/交付格式”时,只写业务交付结构即可;不要要求被诉请者手写 \`${runtimeMarkers.finalCompleted}\` / \`${runtimeMarkers.tellaskBack}\` / FBR 标记(\`${runtimeMarkers.fbrDirectReply}\` / \`${runtimeMarkers.fbrReasoningOnly}\`),这些标记由 Dominds 运行时自动注入。`,
107
- '- 当你处于队友诉请触发的支线且需要澄清时,必须使用 `tellaskBack` 回问上游诉请者;`tellaskBack` 不携带 `sessionSlug`。',
107
+ '- 当你处于队友诉请触发的支线时,不要把“阻塞/不确定”默认等同于 `tellaskBack`:若按当前团队规程/SOP/职责卡已能明确判定执行负责人,直接用 `tellask` / `tellaskSessionless` 诉请对应负责人;只有确实需要上游诉请者补充需求、做裁决、澄清验收口径、提供缺失输入,或现有规程无法明确判责时,才使用 `tellaskBack`。`tellaskBack` 不携带 `sessionSlug`。',
108
108
  `- 回贴文本标记由运行时在跨对话传递正文中按语义自动添加(例如 \`${runtimeMarkers.tellaskBack}\` / \`${runtimeMarkers.finalCompleted}\` / FBR 标记 \`${runtimeMarkers.fbrDirectReply}\` / \`${runtimeMarkers.fbrReasoningOnly}\`);该传递正文会进入目标智能体上下文,且 UI 与其一致。你不应手写这些标记。`,
109
109
  ],
110
110
  en: [
@@ -116,7 +116,7 @@ function buildTeammateTellaskPhaseContract(language) {
116
116
  '- Only a sessioned Tellask (`tellask` + `sessionSlug`) has an assignment-update channel. A one-shot Tellask (`tellaskSessionless`) has no such channel: another `tellaskSessionless` creates a new transient sideline and does not update, stop, or instruct the earlier one to stop. If you may need later correction or earlier wrap-up, do not choose `tellaskSessionless` in the first place.',
117
117
  '- Do not use `askHuman` as a relay for executable teammate work. If you write “ask @X to do Y”, emit `tellask` or `tellaskSessionless` in the same response.',
118
118
  `- When you define a “reply/delivery format” inside tellask body, keep it to the business delivery structure; do not require the responder to hand-write \`${runtimeMarkers.finalCompleted}\` / \`${runtimeMarkers.tellaskBack}\` / FBR markers (\`${runtimeMarkers.fbrDirectReply}\` / \`${runtimeMarkers.fbrReasoningOnly}\`), because Dominds runtime injects those markers automatically.`,
119
- '- When you are in a teammate-triggered sideline and need clarification, you MUST issue `tellaskBack` to ask back upstream; `tellaskBack` must not carry `sessionSlug`.',
119
+ '- In a teammate-triggered sideline, do not treat “blocked / uncertain” as an automatic `tellaskBack`: if current team SOP / role ownership already identifies the responsible executor, directly use `tellask` / `tellaskSessionless` for that owner; use `tellaskBack` only when you truly need the upstream requester to clarify, decide, confirm acceptance criteria, provide missing input, or when existing SOP cannot determine ownership. `tellaskBack` must not carry `sessionSlug`.',
120
120
  `- Reply markers are auto-added by runtime in the inter-dialog transfer payload (for example \`${runtimeMarkers.tellaskBack}\` / \`${runtimeMarkers.finalCompleted}\` / FBR markers \`${runtimeMarkers.fbrDirectReply}\` / \`${runtimeMarkers.fbrReasoningOnly}\`); that same transfer payload is what the target agent receives in context and what UI shows. Do not hand-write markers.`,
121
121
  ],
122
122
  });
@@ -127,7 +127,7 @@ function buildSidelineUpstreamReplyMarkerRules(language) {
127
127
  const lines = pickLocalized(language, {
128
128
  zh: [
129
129
  '- 本规则仅用于当前支线向上游回复;`tellask` 用于**发起新的下游诉请对话**(委托队友做事),不用于向上游汇报。',
130
- '- 当前支线未完成/不确定/阻塞/需要澄清时:必须发起 `tellaskBack({ tellaskContent: "..." })`,并在 `tellaskContent` 中给出具体问题。',
130
+ '- 当前支线未完成时,不要默认直接 `tellaskBack`。先判断当前团队规程/SOP/职责卡能否明确负责人:若能明确且属于执行性处理,直接 `tellask` / `tellaskSessionless` 对应负责人;只有当必须向上游诉请者补充需求、做业务裁决、澄清验收口径、提供缺失输入,或现有规程无法明确判责时,才发起 `tellaskBack({ tellaskContent: "..." })`,并在 `tellaskContent` 中给出具体问题。',
131
131
  '- 是否存在“待你收口的跨对话回复义务”、以及精确该调用哪个 reply 函数,均由运行时程序化判断;运行时会在 assignment 或最新 runtime/user 提示里直接点名。',
132
132
  '- 若运行时点名了精确 reply 函数名,你只需调用那个被点名的函数;不要自己判断 `reply*` 变体。禁止调用 `tellaskBack` 发送最终结果,也禁止用 `tellask` 向诉请者发送最终结果。',
133
133
  `- 只有在运行时当前明确点名了某个精确 reply 函数,且你通过那个函数回复时,运行时才会把该回复作为完成结果投递给上游,并在传递正文中添加 ${runtimeMarkers.finalCompleted}。`,
@@ -142,7 +142,7 @@ function buildSidelineUpstreamReplyMarkerRules(language) {
142
142
  ],
143
143
  en: [
144
144
  '- This rule applies only when replying upstream from the current sideline; tellask is for initiating a new downstream tellask dialog (delegating work to a teammate), not for reporting back to the requester.',
145
- '- If the current sideline is unfinished, uncertain, blocked, or needs clarification: you must emit `tellaskBack({ tellaskContent: "..." })` and put concrete questions in `tellaskContent`.',
145
+ '- If the current sideline is unfinished, do not default to `tellaskBack`. First judge whether current team SOP / role ownership already identifies the responsible executor: if yes and the issue is execution work, directly use `tellask` / `tellaskSessionless` for that owner; use `tellaskBack({ tellaskContent: "..." })` only when the upstream requester must provide clarification, business decision, acceptance-criteria confirmation, missing input, or when existing SOP cannot determine ownership. Put concrete questions in `tellaskContent`.',
146
146
  '- Runtime programmatically decides whether there is an active inter-dialog reply obligation for you, and which exact reply function name applies; runtime will state that directly in the assignment or the latest runtime/user prompt.',
147
147
  '- If runtime names an exact reply function, call that named function and do not choose a `reply*` variant by yourself. Do not use `tellaskBack` or `tellask` to send final delivery.',
148
148
  `- Only replies sent through the exact reply function currently named by runtime are delivered upstream as completion results and marked with ${runtimeMarkers.finalCompleted}.`,
@@ -166,8 +166,8 @@ function buildTellaskReplyMarkerScopePolicy(language, dialogScope) {
166
166
  zh: [
167
167
  `- 回贴文本标记由运行时在跨对话传递正文中自动添加(常规完成=${runtimeMarkers.finalCompleted};FBR=${runtimeMarkers.fbrDirectReply} 或 ${runtimeMarkers.fbrReasoningOnly});该正文直接进入上游上下文,且 UI 展示与其一致。你无需、也不应手写标记。`,
168
168
  '- 若你在正文中给下游写“回贴格式”,只写业务交付结构;不得要求下游手写任何标记,运行时会自动注入。',
169
- '- `tellaskBack` 只允许用于回问/澄清/阻塞说明;禁止用 `tellaskBack` 发送最终结果。',
170
- '- 当前支线未完成/不确定/阻塞/需要澄清时:必须调用 `tellaskBack({ tellaskContent: "..." })`,不得发普通文本中间汇报。',
169
+ '- `tellaskBack` 只允许用于回问上游诉请者;仅当必须向上游补需求/澄清/裁决/缺失输入,或现有团队规程无法明确判责时才使用。禁止用 `tellaskBack` 发送最终结果。',
170
+ '- 当前支线未完成时,不得把“阻塞/不确定”机械等同于 `tellaskBack`;若团队规程/SOP/职责卡已明确负责人,应直接 `tellask` / `tellaskSessionless` 对应负责人,不得发普通文本中间汇报。',
171
171
  `- ${(0, reply_prompt_copy_1.buildSidelineCompletionRule)('zh')}`,
172
172
  `- 仅当运行时当前明确点名了某个精确 reply 函数,且你通过那个函数回复时,运行时才会把该回复投递给上游并标注 ${runtimeMarkers.finalCompleted}。`,
173
173
  '- 若运行时当前明确提示“没有待完成的跨对话回复义务”,说明这轮不是待你收口的跨对话回复义务;不要重复调用 `reply*`。',
@@ -175,8 +175,8 @@ function buildTellaskReplyMarkerScopePolicy(language, dialogScope) {
175
175
  en: [
176
176
  `- Reply markers are runtime-added in the inter-dialog transfer payload (regular completed reply = ${runtimeMarkers.finalCompleted}; FBR = ${runtimeMarkers.fbrDirectReply} or ${runtimeMarkers.fbrReasoningOnly}); this payload is delivered to upstream context and shown identically in UI. Do not hand-write markers.`,
177
177
  '- If you define a reply format for downstream, keep it to the business delivery structure; do not require downstream to hand-write any marker, because runtime injects markers automatically.',
178
- '- `tellaskBack` is allowed only for ask-back / clarification / blocked-state reporting; do not use `tellaskBack` to send final results.',
179
- '- If the current sideline is unfinished, uncertain, blocked, or needs clarification: you must call `tellaskBack({ tellaskContent: "..." })` instead of posting a plain-text progress update.',
178
+ '- `tellaskBack` is only for asking the upstream requester back; use it only when upstream clarification / decision / missing input is required, or current team SOP cannot determine ownership. Do not use `tellaskBack` to send final results.',
179
+ '- If the current sideline is unfinished, do not mechanically map “blocked / uncertain” to `tellaskBack`; when team SOP / role ownership already identifies the responsible owner, directly use `tellask` / `tellaskSessionless` for that owner instead of posting a plain-text progress update.',
180
180
  `- ${(0, reply_prompt_copy_1.buildSidelineCompletionRule)('en')}`,
181
181
  `- Runtime marks ${runtimeMarkers.finalCompleted} and delivers upstream only when runtime currently names an exact reply function and you reply through that named function.`,
182
182
  '- If runtime currently tells you there is no active inter-dialog reply obligation, then this turn is not awaiting another inter-dialog closure from you; do not call `reply*` again.',
@@ -6,15 +6,15 @@
6
6
  */
7
7
  import type { ContextHealthSnapshot } from '@longrun-ai/kernel/types/context-health';
8
8
  import type { NativeToolCallPayload, WebSearchCallAction, WebSearchCallSource } from '@longrun-ai/kernel/types/dialog';
9
- import type { DialogPrompt } from '@longrun-ai/kernel/types/drive-intent';
9
+ import type { DialogRuntimePrompt } from '@longrun-ai/kernel/types/drive-intent';
10
10
  import type { LanguageCode } from '@longrun-ai/kernel/types/language';
11
- import type { DialogLatestFile, DialogMetadataFile, HumanQuestion, PendingSubdialogStateRecord, PersistedDialogRecord, ProviderData, ReasoningPayload, ReconciledRecordWriteTarget, RootDialogMetadataFile, RootGenerationAnchor, SubdialogMetadataFile, SubdialogRegistryStateRecord, SubdialogResponseStateRecord, TellaskCallRecordName, TellaskReplyDirective } from '@longrun-ai/kernel/types/storage';
11
+ import type { DialogLatestFile, DialogMetadataFile, HumanQuestion, HumanTextRecord, PendingSubdialogStateRecord, PersistedDialogRecord, ProviderData, ReasoningPayload, ReconciledRecordWriteTarget, RootDialogMetadataFile, RootGenerationAnchor, SubdialogMetadataFile, SubdialogRegistryStateRecord, SubdialogResponseStateRecord, TellaskCallRecordName, TellaskReplyDirective } from '@longrun-ai/kernel/types/storage';
12
12
  import type { DialogsQuarantinedMessage, DialogStatusKind } from '@longrun-ai/kernel/types/wire';
13
13
  import { WebSocket } from 'ws';
14
14
  import type { PendingSubdialog } from './dialog';
15
15
  import { Dialog, DialogID, DialogStore, RootDialog, SubDialog } from './dialog';
16
16
  import { ChatMessage, FuncResultMsg, TellaskCarryoverMsg, TellaskResultMsg } from './llm/client';
17
- import type { ToolResultImageIngest } from './llm/gen';
17
+ import type { ToolResultImageIngest, UserImageIngest } from './llm/gen';
18
18
  import { Reminder } from './tool';
19
19
  export declare function setDialogsQuarantinedBroadcaster(fn: ((msg: DialogsQuarantinedMessage) => void) | null): void;
20
20
  export declare function setPrepareDialogQuarantineHook(fn: ((args: {
@@ -120,6 +120,7 @@ export declare class DiskFileDialogStore extends DialogStore {
120
120
  }): Promise<void>;
121
121
  nativeToolCall(dialog: Dialog, payload: NativeToolCallPayload): Promise<void>;
122
122
  toolResultImageIngest(dialog: Dialog, payload: ToolResultImageIngest): Promise<void>;
123
+ userImageIngest(dialog: Dialog, payload: UserImageIngest): Promise<void>;
123
124
  /**
124
125
  * Emit stream error for current generation lifecycle (uses active genseq when present)
125
126
  */
@@ -127,7 +128,7 @@ export declare class DiskFileDialogStore extends DialogStore {
127
128
  /**
128
129
  * Start new course (append-only JSONL + exceptional reminder persistence)
129
130
  */
130
- startNewCourse(dialog: Dialog, newCoursePrompt: DialogPrompt): Promise<void>;
131
+ startNewCourse(dialog: Dialog, newCoursePrompt: DialogRuntimePrompt): Promise<void>;
131
132
  /**
132
133
  * Persist reminder state (exceptional overwrite pattern)
133
134
  * Note: Event emission is handled by processReminderUpdates() in Dialog
@@ -138,7 +139,7 @@ export declare class DiskFileDialogStore extends DialogStore {
138
139
  * Note: The end_of_user_saying_evt is emitted by the driver after user content
139
140
  * is rendered and any tellask calls are parsed/executed.
140
141
  */
141
- persistUserMessage(dialog: Dialog, content: string, msgId: string, grammar: 'markdown', origin: 'user' | 'diligence_push' | 'runtime' | undefined, userLanguageCode?: LanguageCode, q4hAnswerCallId?: string, tellaskReplyDirective?: TellaskReplyDirective): Promise<void>;
142
+ persistUserMessage(dialog: Dialog, content: string, msgId: string, grammar: 'markdown', origin: 'user' | 'diligence_push' | 'runtime' | undefined, userLanguageCode?: LanguageCode, q4hAnswerCallId?: string, tellaskReplyDirective?: TellaskReplyDirective, contentItems?: HumanTextRecord['contentItems']): Promise<void>;
142
143
  appendTellaskReplyResolution(dialog: Dialog, payload: {
143
144
  callId: string;
144
145
  replyCallName: 'replyTellask' | 'replyTellaskSessionless' | 'replyTellaskBack';