dominds 1.8.2 → 1.8.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.
- package/dist/apps/run-control.js +21 -4
- package/dist/apps/runtime.js +66 -24
- package/dist/dialog.js +23 -1
- package/dist/docs/app-constitution.md +3 -1
- package/dist/docs/app-constitution.zh.md +3 -1
- package/dist/docs/dialog-system.zh.md +5 -5
- package/dist/llm/kernel-driver/context.js +2 -31
- package/dist/llm/kernel-driver/drive.js +6 -8
- package/dist/llm/kernel-driver/subdialog.js +8 -0
- package/dist/minds/system-prompt.js +2 -2
- package/dist/priming.js +4 -0
- package/dist/server/websocket-handler.js +16 -0
- package/dist/server.js +7 -2
- package/dist/shared/diligence.js +2 -2
- package/dist/shared/i18n/driver-messages.js +47 -7
- package/dist/static/assets/{_basePickBy-DOCpneO0.js → _basePickBy-b79Z8z7v.js} +3 -3
- package/dist/static/assets/{_basePickBy-DOCpneO0.js.map → _basePickBy-b79Z8z7v.js.map} +1 -1
- package/dist/static/assets/{_baseUniq-DBZLqTK1.js → _baseUniq-EKRe-CHy.js} +2 -2
- package/dist/static/assets/{_baseUniq-DBZLqTK1.js.map → _baseUniq-EKRe-CHy.js.map} +1 -1
- package/dist/static/assets/{arc-Dw9YkyBZ.js → arc-CBReIrdk.js} +2 -2
- package/dist/static/assets/{arc-Dw9YkyBZ.js.map → arc-CBReIrdk.js.map} +1 -1
- package/dist/static/assets/{architectureDiagram-VXUJARFQ-DiXBIlTy.js → architectureDiagram-VXUJARFQ-arl_gJGi.js} +7 -7
- package/dist/static/assets/{architectureDiagram-VXUJARFQ-DiXBIlTy.js.map → architectureDiagram-VXUJARFQ-arl_gJGi.js.map} +1 -1
- package/dist/static/assets/{blockDiagram-VD42YOAC-CBTqG3TT.js → blockDiagram-VD42YOAC-BvLkPr7Y.js} +7 -7
- package/dist/static/assets/{blockDiagram-VD42YOAC-CBTqG3TT.js.map → blockDiagram-VD42YOAC-BvLkPr7Y.js.map} +1 -1
- package/dist/static/assets/{c4Diagram-YG6GDRKO-CKltdqcg.js → c4Diagram-YG6GDRKO-DLQB9QIV.js} +3 -3
- package/dist/static/assets/{c4Diagram-YG6GDRKO-CKltdqcg.js.map → c4Diagram-YG6GDRKO-DLQB9QIV.js.map} +1 -1
- package/dist/static/assets/{channel-CsfA5ddv.js → channel-C-1aKDRA.js} +2 -2
- package/dist/static/assets/{channel-CsfA5ddv.js.map → channel-C-1aKDRA.js.map} +1 -1
- package/dist/static/assets/{chunk-4BX2VUAB-BCdL9ibi.js → chunk-4BX2VUAB-guy7Bw0c.js} +2 -2
- package/dist/static/assets/{chunk-4BX2VUAB-BCdL9ibi.js.map → chunk-4BX2VUAB-guy7Bw0c.js.map} +1 -1
- package/dist/static/assets/{chunk-55IACEB6-CcKnxlqS.js → chunk-55IACEB6-CPekYUDl.js} +2 -2
- package/dist/static/assets/{chunk-55IACEB6-CcKnxlqS.js.map → chunk-55IACEB6-CPekYUDl.js.map} +1 -1
- package/dist/static/assets/{chunk-B4BG7PRW-BnypOYYo.js → chunk-B4BG7PRW-C7_VGVGd.js} +5 -5
- package/dist/static/assets/{chunk-B4BG7PRW-BnypOYYo.js.map → chunk-B4BG7PRW-C7_VGVGd.js.map} +1 -1
- package/dist/static/assets/{chunk-DI55MBZ5-BGYHpvhR.js → chunk-DI55MBZ5-B7Z_kPEp.js} +4 -4
- package/dist/static/assets/{chunk-DI55MBZ5-BGYHpvhR.js.map → chunk-DI55MBZ5-B7Z_kPEp.js.map} +1 -1
- package/dist/static/assets/{chunk-FMBD7UC4-Crf0Br1R.js → chunk-FMBD7UC4-CNyLnVLQ.js} +2 -2
- package/dist/static/assets/{chunk-FMBD7UC4-Crf0Br1R.js.map → chunk-FMBD7UC4-CNyLnVLQ.js.map} +1 -1
- package/dist/static/assets/{chunk-QN33PNHL-Cg1EQYdQ.js → chunk-QN33PNHL-De0KQ1wi.js} +2 -2
- package/dist/static/assets/{chunk-QN33PNHL-Cg1EQYdQ.js.map → chunk-QN33PNHL-De0KQ1wi.js.map} +1 -1
- package/dist/static/assets/{chunk-QZHKN3VN-DRH7UNkC.js → chunk-QZHKN3VN-DsfWQPDD.js} +2 -2
- package/dist/static/assets/{chunk-QZHKN3VN-DRH7UNkC.js.map → chunk-QZHKN3VN-DsfWQPDD.js.map} +1 -1
- package/dist/static/assets/{chunk-TZMSLE5B-CaZqBdnu.js → chunk-TZMSLE5B-BGHvMn1A.js} +2 -2
- package/dist/static/assets/{chunk-TZMSLE5B-CaZqBdnu.js.map → chunk-TZMSLE5B-BGHvMn1A.js.map} +1 -1
- package/dist/static/assets/{classDiagram-2ON5EDUG-DSsG0iFI.js → classDiagram-2ON5EDUG-JmOuUZWB.js} +6 -6
- package/dist/static/assets/{classDiagram-2ON5EDUG-DSsG0iFI.js.map → classDiagram-2ON5EDUG-JmOuUZWB.js.map} +1 -1
- package/dist/static/assets/{classDiagram-v2-WZHVMYZB-DSsG0iFI.js → classDiagram-v2-WZHVMYZB-JmOuUZWB.js} +6 -6
- package/dist/static/assets/{classDiagram-v2-WZHVMYZB-DSsG0iFI.js.map → classDiagram-v2-WZHVMYZB-JmOuUZWB.js.map} +1 -1
- package/dist/static/assets/{clone-xhbAL4G8.js → clone-bFKUwLh9.js} +2 -2
- package/dist/static/assets/{clone-xhbAL4G8.js.map → clone-bFKUwLh9.js.map} +1 -1
- package/dist/static/assets/{cose-bilkent-S5V4N54A-B7Rtmhjt.js → cose-bilkent-S5V4N54A-B-TrWbLI.js} +2 -2
- package/dist/static/assets/{cose-bilkent-S5V4N54A-B7Rtmhjt.js.map → cose-bilkent-S5V4N54A-B-TrWbLI.js.map} +1 -1
- package/dist/static/assets/{dagre-6UL2VRFP-BkqhLTnX.js → dagre-6UL2VRFP-eFdBPojd.js} +7 -7
- package/dist/static/assets/{dagre-6UL2VRFP-BkqhLTnX.js.map → dagre-6UL2VRFP-eFdBPojd.js.map} +1 -1
- package/dist/static/assets/{diagram-PSM6KHXK-CZKtGq3a.js → diagram-PSM6KHXK-CG-pEDnm.js} +8 -8
- package/dist/static/assets/{diagram-PSM6KHXK-CZKtGq3a.js.map → diagram-PSM6KHXK-CG-pEDnm.js.map} +1 -1
- package/dist/static/assets/{diagram-QEK2KX5R-CnMVuAHl.js → diagram-QEK2KX5R-DIMTH7OH.js} +7 -7
- package/dist/static/assets/{diagram-QEK2KX5R-CnMVuAHl.js.map → diagram-QEK2KX5R-DIMTH7OH.js.map} +1 -1
- package/dist/static/assets/{diagram-S2PKOQOG-CeSf7JXc.js → diagram-S2PKOQOG-CtsocJ3s.js} +7 -7
- package/dist/static/assets/{diagram-S2PKOQOG-CeSf7JXc.js.map → diagram-S2PKOQOG-CtsocJ3s.js.map} +1 -1
- package/dist/static/assets/{erDiagram-Q2GNP2WA-CSt8_Jg8.js → erDiagram-Q2GNP2WA-DE2fcc5h.js} +5 -5
- package/dist/static/assets/{erDiagram-Q2GNP2WA-CSt8_Jg8.js.map → erDiagram-Q2GNP2WA-DE2fcc5h.js.map} +1 -1
- package/dist/static/assets/{flowDiagram-NV44I4VS-D5Ml-CXN.js → flowDiagram-NV44I4VS-CRmxnCqy.js} +6 -6
- package/dist/static/assets/{flowDiagram-NV44I4VS-D5Ml-CXN.js.map → flowDiagram-NV44I4VS-CRmxnCqy.js.map} +1 -1
- package/dist/static/assets/{ganttDiagram-JELNMOA3-CyMWbWsa.js → ganttDiagram-JELNMOA3-MIOIERui.js} +3 -3
- package/dist/static/assets/{ganttDiagram-JELNMOA3-CyMWbWsa.js.map → ganttDiagram-JELNMOA3-MIOIERui.js.map} +1 -1
- package/dist/static/assets/{gitGraphDiagram-V2S2FVAM-vl516Is8.js → gitGraphDiagram-V2S2FVAM-crIYDBIk.js} +8 -8
- package/dist/static/assets/{gitGraphDiagram-V2S2FVAM-vl516Is8.js.map → gitGraphDiagram-V2S2FVAM-crIYDBIk.js.map} +1 -1
- package/dist/static/assets/{graph-BGZ_sL_x.js → graph-CB0VmlGP.js} +3 -3
- package/dist/static/assets/{graph-BGZ_sL_x.js.map → graph-CB0VmlGP.js.map} +1 -1
- package/dist/static/assets/{index-C-RsyM0K.js → index-CzBEs1w4.js} +53 -35
- package/dist/static/assets/{index-C-RsyM0K.js.map → index-CzBEs1w4.js.map} +1 -1
- package/dist/static/assets/{infoDiagram-HS3SLOUP-6wx0LbHY.js → infoDiagram-HS3SLOUP-CnsCAuJf.js} +6 -6
- package/dist/static/assets/{infoDiagram-HS3SLOUP-6wx0LbHY.js.map → infoDiagram-HS3SLOUP-CnsCAuJf.js.map} +1 -1
- package/dist/static/assets/{journeyDiagram-XKPGCS4Q-YPjC-r77.js → journeyDiagram-XKPGCS4Q-BtzLS-NC.js} +5 -5
- package/dist/static/assets/{journeyDiagram-XKPGCS4Q-YPjC-r77.js.map → journeyDiagram-XKPGCS4Q-BtzLS-NC.js.map} +1 -1
- package/dist/static/assets/{kanban-definition-3W4ZIXB7-DlG-ZWTO.js → kanban-definition-3W4ZIXB7-CwykQ3vY.js} +3 -3
- package/dist/static/assets/{kanban-definition-3W4ZIXB7-DlG-ZWTO.js.map → kanban-definition-3W4ZIXB7-CwykQ3vY.js.map} +1 -1
- package/dist/static/assets/{layout-BZJKhYY3.js → layout-Cu6uuh5P.js} +5 -5
- package/dist/static/assets/{layout-BZJKhYY3.js.map → layout-Cu6uuh5P.js.map} +1 -1
- package/dist/static/assets/{linear-Bau37zh5.js → linear-BXsc4B31.js} +2 -2
- package/dist/static/assets/{linear-Bau37zh5.js.map → linear-BXsc4B31.js.map} +1 -1
- package/dist/static/assets/{mindmap-definition-VGOIOE7T-n2WXgX4b.js → mindmap-definition-VGOIOE7T-BtD61cN8.js} +4 -4
- package/dist/static/assets/{mindmap-definition-VGOIOE7T-n2WXgX4b.js.map → mindmap-definition-VGOIOE7T-BtD61cN8.js.map} +1 -1
- package/dist/static/assets/{pieDiagram-ADFJNKIX-DgW7FkI4.js → pieDiagram-ADFJNKIX-B2EbMDmb.js} +8 -8
- package/dist/static/assets/{pieDiagram-ADFJNKIX-DgW7FkI4.js.map → pieDiagram-ADFJNKIX-B2EbMDmb.js.map} +1 -1
- package/dist/static/assets/{quadrantDiagram-AYHSOK5B-BtsDjIpC.js → quadrantDiagram-AYHSOK5B-BwYvMil1.js} +3 -3
- package/dist/static/assets/{quadrantDiagram-AYHSOK5B-BtsDjIpC.js.map → quadrantDiagram-AYHSOK5B-BwYvMil1.js.map} +1 -1
- package/dist/static/assets/{requirementDiagram-UZGBJVZJ-DPzuPEge.js → requirementDiagram-UZGBJVZJ-syDAMAIY.js} +4 -4
- package/dist/static/assets/{requirementDiagram-UZGBJVZJ-DPzuPEge.js.map → requirementDiagram-UZGBJVZJ-syDAMAIY.js.map} +1 -1
- package/dist/static/assets/{sankeyDiagram-TZEHDZUN-BJS1ETtL.js → sankeyDiagram-TZEHDZUN-ifN71SAO.js} +2 -2
- package/dist/static/assets/{sankeyDiagram-TZEHDZUN-BJS1ETtL.js.map → sankeyDiagram-TZEHDZUN-ifN71SAO.js.map} +1 -1
- package/dist/static/assets/{sequenceDiagram-WL72ISMW-DXEpa4ly.js → sequenceDiagram-WL72ISMW-ytS-PG6f.js} +4 -4
- package/dist/static/assets/{sequenceDiagram-WL72ISMW-DXEpa4ly.js.map → sequenceDiagram-WL72ISMW-ytS-PG6f.js.map} +1 -1
- package/dist/static/assets/{stateDiagram-FKZM4ZOC-CGU6VJY5.js → stateDiagram-FKZM4ZOC-BICTjIiL.js} +9 -9
- package/dist/static/assets/{stateDiagram-FKZM4ZOC-CGU6VJY5.js.map → stateDiagram-FKZM4ZOC-BICTjIiL.js.map} +1 -1
- package/dist/static/assets/{stateDiagram-v2-4FDKWEC3-Dx_GvlFA.js → stateDiagram-v2-4FDKWEC3-BD67hjdo.js} +5 -5
- package/dist/static/assets/{stateDiagram-v2-4FDKWEC3-Dx_GvlFA.js.map → stateDiagram-v2-4FDKWEC3-BD67hjdo.js.map} +1 -1
- package/dist/static/assets/{timeline-definition-IT6M3QCI-DcWLmdgJ.js → timeline-definition-IT6M3QCI-Bn4PeFHS.js} +3 -3
- package/dist/static/assets/{timeline-definition-IT6M3QCI-DcWLmdgJ.js.map → timeline-definition-IT6M3QCI-Bn4PeFHS.js.map} +1 -1
- package/dist/static/assets/{treemap-GDKQZRPO-BhUwKF9C.js → treemap-GDKQZRPO-C-_A6aNF.js} +5 -5
- package/dist/static/assets/{treemap-GDKQZRPO-BhUwKF9C.js.map → treemap-GDKQZRPO-C-_A6aNF.js.map} +1 -1
- package/dist/static/assets/{xychartDiagram-PRI3JC2R-Cr4t0oCq.js → xychartDiagram-PRI3JC2R-BaUb_VjF.js} +3 -3
- package/dist/static/assets/{xychartDiagram-PRI3JC2R-Cr4t0oCq.js.map → xychartDiagram-PRI3JC2R-BaUb_VjF.js.map} +1 -1
- package/dist/static/index.html +1 -1
- package/dist/tools/pending-tellask-reminder.js +2 -2
- package/dist/tools/prompts/team_mgmt/en/errors.md +6 -0
- package/dist/tools/prompts/team_mgmt/zh/errors.md +6 -0
- package/dist/tools/team_mgmt.js +29 -0
- package/package.json +1 -1
- package/dist/apps/installed-file.js +0 -207
- package/dist/apps/runtime-port.js +0 -91
- package/dist/docs/kernel-app-architecture.md +0 -286
- package/dist/docs/kernel-app-architecture.zh.md +0 -285
- package/dist/llm/driver-entry.js +0 -28
- package/dist/llm/driver-v2/context-health.js +0 -121
- package/dist/llm/driver-v2/context.js +0 -56
- package/dist/llm/driver-v2/core.js +0 -1545
- package/dist/llm/driver-v2/index.js +0 -26
- package/dist/llm/driver-v2/orchestrator.js +0 -158
- package/dist/llm/driver-v2/policy.js +0 -129
- package/dist/llm/driver-v2/restore-dialog-hierarchy.js +0 -73
- package/dist/llm/driver-v2/round.js +0 -366
- package/dist/llm/driver-v2/runtime-utils.js +0 -365
- package/dist/llm/driver-v2/saying-events.js +0 -20
- package/dist/llm/driver-v2/subdialog-txn.js +0 -42
- package/dist/llm/driver-v2/supdialog-response.js +0 -400
- package/dist/llm/driver-v2/tellask-bridge.js +0 -1148
- package/dist/llm/driver-v2/types.js +0 -10
- package/dist/llm/driver-v2-ref-only/context-health.js +0 -121
- package/dist/llm/driver-v2-ref-only/context.js +0 -17
- package/dist/llm/driver-v2-ref-only/core.js +0 -1710
- package/dist/llm/driver-v2-ref-only/index.js +0 -26
- package/dist/llm/driver-v2-ref-only/orchestrator.js +0 -158
- package/dist/llm/driver-v2-ref-only/policy.js +0 -129
- package/dist/llm/driver-v2-ref-only/restore-dialog-hierarchy.js +0 -73
- package/dist/llm/driver-v2-ref-only/round.js +0 -366
- package/dist/llm/driver-v2-ref-only/runtime-utils.js +0 -473
- package/dist/llm/driver-v2-ref-only/saying-events.js +0 -18
- package/dist/llm/driver-v2-ref-only/subdialog-txn.js +0 -42
- package/dist/llm/driver-v2-ref-only/supdialog-response.js +0 -453
- package/dist/llm/driver-v2-ref-only/tellask-bridge.js +0 -1178
- package/dist/llm/driver-v2-ref-only/types.js +0 -10
- package/dist/tools/prompts/memory/en/errors.md +0 -155
- package/dist/tools/prompts/memory/en/index.md +0 -47
- package/dist/tools/prompts/memory/en/principles.md +0 -79
- package/dist/tools/prompts/memory/en/scenarios.md +0 -174
- package/dist/tools/prompts/memory/en/tools.md +0 -154
- package/dist/tools/prompts/memory/zh/errors.md +0 -155
- package/dist/tools/prompts/memory/zh/index.md +0 -47
- package/dist/tools/prompts/memory/zh/principles.md +0 -79
- package/dist/tools/prompts/memory/zh/scenarios.md +0 -174
- package/dist/tools/prompts/memory/zh/tools.md +0 -154
package/dist/apps/run-control.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.applyAppDialogRunControl = applyAppDialogRunControl;
|
|
4
4
|
exports.applyRegisteredAppDialogRunControls = applyRegisteredAppDialogRunControls;
|
|
5
|
+
const log_1 = require("../log");
|
|
5
6
|
const dialog_run_controls_1 = require("./dialog-run-controls");
|
|
6
7
|
const runtime_1 = require("./runtime");
|
|
8
|
+
const log = (0, log_1.createLogger)('apps-run-control');
|
|
7
9
|
async function applyAppDialogRunControl(params) {
|
|
8
10
|
const controlId = params.controlId.trim();
|
|
9
11
|
if (controlId === '') {
|
|
@@ -18,10 +20,25 @@ async function applyAppDialogRunControl(params) {
|
|
|
18
20
|
}
|
|
19
21
|
async function applyRegisteredAppDialogRunControls(payload) {
|
|
20
22
|
for (const control of (0, dialog_run_controls_1.listAppDialogRunControls)()) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
let result;
|
|
24
|
+
try {
|
|
25
|
+
result = await applyAppDialogRunControl({
|
|
26
|
+
controlId: control.id,
|
|
27
|
+
payload,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
32
|
+
log.warn('App dialog run control failed; continuing without this app control', err, {
|
|
33
|
+
controlId: control.id,
|
|
34
|
+
dialogId: payload.dialog.selfId,
|
|
35
|
+
rootId: payload.dialog.rootId,
|
|
36
|
+
agentId: payload.agentId,
|
|
37
|
+
taskDocPath: payload.taskDocPath,
|
|
38
|
+
source: payload.source,
|
|
39
|
+
});
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
25
42
|
if (result.kind === 'reject') {
|
|
26
43
|
return result;
|
|
27
44
|
}
|
package/dist/apps/runtime.js
CHANGED
|
@@ -29,6 +29,17 @@ let hostedAppsSignature = null;
|
|
|
29
29
|
let appsRuntimeConfig = null;
|
|
30
30
|
let refreshQueue = Promise.resolve();
|
|
31
31
|
const registeredAppArtifactsById = new Map();
|
|
32
|
+
function asError(error) {
|
|
33
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
34
|
+
}
|
|
35
|
+
function formatAppCapabilityUnavailableMessage(params) {
|
|
36
|
+
return [
|
|
37
|
+
`App capability unavailable: ${params.capability}`,
|
|
38
|
+
`appId=${params.appId}`,
|
|
39
|
+
`reason=${params.detail}`,
|
|
40
|
+
'This app-specific capability is unavailable for now. Continue with other available tools unless this app is required.',
|
|
41
|
+
].join('\n');
|
|
42
|
+
}
|
|
32
43
|
function resolveRootDialogFor(dlg) {
|
|
33
44
|
if (dlg instanceof dialog_1.RootDialog) {
|
|
34
45
|
return dlg;
|
|
@@ -269,27 +280,46 @@ function registerAppArtifacts(app) {
|
|
|
269
280
|
descriptionI18n: t.descriptionI18n,
|
|
270
281
|
parameters: t.parameters,
|
|
271
282
|
call: async (dlg, caller, args) => {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
if (Array.isArray(result.reminderRequests) && result.reminderRequests.length > 0) {
|
|
282
|
-
await (0, app_reminders_1.applyAppReminderRequests)(dlg, {
|
|
283
|
-
appId: app.appId,
|
|
284
|
-
reminderRequests: result.reminderRequests,
|
|
285
|
-
resolveHostClient: waitForAppsHostClient,
|
|
283
|
+
try {
|
|
284
|
+
const host = await ensureAppsHostReadyForToolCalls();
|
|
285
|
+
const result = await host.callTool(t.name, args, {
|
|
286
|
+
dialogId: dlg.id.selfId,
|
|
287
|
+
rootDialogId: dlg.id.rootId,
|
|
288
|
+
agentId: dlg.agentId,
|
|
289
|
+
taskDocPath: dlg.taskDocPath,
|
|
290
|
+
sessionSlug: dlg instanceof dialog_1.SubDialog ? dlg.sessionSlug : undefined,
|
|
291
|
+
callerId: caller.id,
|
|
286
292
|
});
|
|
293
|
+
if (Array.isArray(result.reminderRequests) && result.reminderRequests.length > 0) {
|
|
294
|
+
await (0, app_reminders_1.applyAppReminderRequests)(dlg, {
|
|
295
|
+
appId: app.appId,
|
|
296
|
+
reminderRequests: result.reminderRequests,
|
|
297
|
+
resolveHostClient: waitForAppsHostClient,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
if (Array.isArray(result.dialogReminderRequests) &&
|
|
301
|
+
result.dialogReminderRequests.length > 0) {
|
|
302
|
+
await applyDialogReminderRequestBatches(dlg, app.appId, result.dialogReminderRequests);
|
|
303
|
+
}
|
|
304
|
+
return result.output;
|
|
287
305
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
306
|
+
catch (error) {
|
|
307
|
+
const err = asError(error);
|
|
308
|
+
log.warn('App tool call failed', err, {
|
|
309
|
+
appId: app.appId,
|
|
310
|
+
toolName: t.name,
|
|
311
|
+
dialogId: dlg.id.valueOf(),
|
|
312
|
+
rootId: dlg.id.rootId,
|
|
313
|
+
selfId: dlg.id.selfId,
|
|
314
|
+
agentId: dlg.agentId,
|
|
315
|
+
callerId: caller.id,
|
|
316
|
+
});
|
|
317
|
+
throw new Error(formatAppCapabilityUnavailableMessage({
|
|
318
|
+
appId: app.appId,
|
|
319
|
+
capability: `tool:${t.name}`,
|
|
320
|
+
detail: err.message,
|
|
321
|
+
}));
|
|
291
322
|
}
|
|
292
|
-
return result.output;
|
|
293
323
|
},
|
|
294
324
|
}));
|
|
295
325
|
registerAppToolset({
|
|
@@ -401,18 +431,30 @@ async function registerEnabledAppsToolProxies(params) {
|
|
|
401
431
|
await run;
|
|
402
432
|
}
|
|
403
433
|
async function listDynamicAppToolsetsForMember(_params) {
|
|
404
|
-
|
|
434
|
+
try {
|
|
435
|
+
await registerEnabledAppsToolProxies({ rtwsRootAbs: _params.rtwsRootAbs });
|
|
436
|
+
}
|
|
437
|
+
catch (error) {
|
|
438
|
+
log.warn(`Failed to refresh enabled app tool proxies while resolving dynamic toolsets for member '${_params.memberId}'; continuing without dynamic app toolsets.`, asError(error));
|
|
439
|
+
return [];
|
|
440
|
+
}
|
|
405
441
|
if (!appsRuntimeConfig && !appsHostClient && !appsHostTransition) {
|
|
406
442
|
return [];
|
|
407
443
|
}
|
|
408
444
|
if (!appsHostClient && !appsHostTransition) {
|
|
409
445
|
return [];
|
|
410
446
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
447
|
+
try {
|
|
448
|
+
const host = await ensureAppsHostReadyForToolCalls();
|
|
449
|
+
return await host.listDynamicToolsets({
|
|
450
|
+
memberId: _params.memberId,
|
|
451
|
+
taskDocPath: _params.taskDocPath,
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
catch (error) {
|
|
455
|
+
log.warn(`Failed to load dynamic app toolsets for member '${_params.memberId}'; continuing without dynamic app toolsets.`, asError(error));
|
|
456
|
+
return [];
|
|
457
|
+
}
|
|
416
458
|
}
|
|
417
459
|
async function initAppsRuntime(params) {
|
|
418
460
|
appsRuntimeConfig = {
|
package/dist/dialog.js
CHANGED
|
@@ -52,6 +52,7 @@ const util_1 = require("util");
|
|
|
52
52
|
const evt_registry_1 = require("./evt-registry");
|
|
53
53
|
const log_1 = require("./log");
|
|
54
54
|
const async_fifo_mutex_1 = require("./shared/async-fifo-mutex");
|
|
55
|
+
const driver_messages_1 = require("./shared/i18n/driver-messages");
|
|
55
56
|
const runtime_language_1 = require("./shared/runtime-language");
|
|
56
57
|
const id_1 = require("./shared/utils/id");
|
|
57
58
|
const inter_dialog_format_1 = require("./shared/utils/inter-dialog-format");
|
|
@@ -124,6 +125,7 @@ class Dialog {
|
|
|
124
125
|
// This is an in-process cache only (not persisted), intended for small, stable “felt-sense” context
|
|
125
126
|
// like Agent Priming transcripts.
|
|
126
127
|
this._coursePrefixMsgs = [];
|
|
128
|
+
this._courseRuntimeNoticeMsgs = [];
|
|
127
129
|
// Track whether the current course's initial events (user_text, generating_start)
|
|
128
130
|
// have been fully processed. Used to ensure subdialog_final_response_evt arrives
|
|
129
131
|
// only after parent events are emitted.
|
|
@@ -171,6 +173,7 @@ class Dialog {
|
|
|
171
173
|
this._lastUserLanguageCode = (0, runtime_language_1.getWorkLanguage)();
|
|
172
174
|
this._lastContextHealth = initialState?.contextHealth;
|
|
173
175
|
this._lastContextHealthGenseq = undefined;
|
|
176
|
+
this.resetCourseLanguageNotice();
|
|
174
177
|
}
|
|
175
178
|
setLastContextHealth(snapshot) {
|
|
176
179
|
this._lastContextHealth = snapshot;
|
|
@@ -203,6 +206,24 @@ class Dialog {
|
|
|
203
206
|
setLastUserLanguageCode(language) {
|
|
204
207
|
this._lastUserLanguageCode = language;
|
|
205
208
|
}
|
|
209
|
+
buildCourseRuntimeNotice(content) {
|
|
210
|
+
return {
|
|
211
|
+
type: 'environment_msg',
|
|
212
|
+
role: 'user',
|
|
213
|
+
content,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
resetCourseLanguageNotice() {
|
|
217
|
+
this._courseRuntimeNoticeMsgs = [
|
|
218
|
+
this.buildCourseRuntimeNotice((0, driver_messages_1.formatCurrentUserLanguagePreference)((0, runtime_language_1.getWorkLanguage)(), this._lastUserLanguageCode)),
|
|
219
|
+
];
|
|
220
|
+
}
|
|
221
|
+
appendCourseLanguageChangedNotice(previousLanguage, nextLanguage) {
|
|
222
|
+
if (previousLanguage === nextLanguage) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
this._courseRuntimeNoticeMsgs.push(this.buildCourseRuntimeNotice((0, driver_messages_1.formatUserLanguagePreferenceChangedNotice)((0, runtime_language_1.getWorkLanguage)(), previousLanguage, nextLanguage)));
|
|
226
|
+
}
|
|
206
227
|
/**
|
|
207
228
|
* Get the current callId for tellask call correlation
|
|
208
229
|
*
|
|
@@ -470,7 +491,7 @@ class Dialog {
|
|
|
470
491
|
this._coursePrefixMsgs = [...msgs];
|
|
471
492
|
}
|
|
472
493
|
getCoursePrefixMsgs() {
|
|
473
|
-
return this._coursePrefixMsgs;
|
|
494
|
+
return [...this._coursePrefixMsgs, ...this._courseRuntimeNoticeMsgs];
|
|
474
495
|
}
|
|
475
496
|
// only to be used by the driver
|
|
476
497
|
async addChatMessages(...msgs) {
|
|
@@ -689,6 +710,7 @@ class Dialog {
|
|
|
689
710
|
: this._currentCourse + 1;
|
|
690
711
|
this._currentCourse = storeCourse;
|
|
691
712
|
this._updatedAt = (0, time_1.formatUnifiedTimestamp)(new Date());
|
|
713
|
+
this.resetCourseLanguageNotice();
|
|
692
714
|
const normalized = this.setUpNextPrompt(nextPrompt);
|
|
693
715
|
if (options?.skipEnqueueIntent !== true) {
|
|
694
716
|
this._driveIntents.length = 0;
|
|
@@ -690,7 +690,7 @@ async function checkSubdialogRevival(supdialog: Dialog): Promise<void> {
|
|
|
690
690
|
|
|
691
691
|
1. 清除所有聊天消息
|
|
692
692
|
2. 清除所有 Q4H 问题
|
|
693
|
-
3.
|
|
693
|
+
3. 增加“某一程对话”(dialog course)计数器
|
|
694
694
|
4. 更新对话的时间戳
|
|
695
695
|
5. 将 `newCoursePrompt` 排队到 `dlg.upNext`,以便驱动程序可以启动新的协程并将其用作新一程的**第一个 `role=user` 消息**
|
|
696
696
|
|
|
@@ -882,7 +882,7 @@ interface SubdialogRegistry {
|
|
|
882
882
|
|
|
883
883
|
- **层级支持**:用于子对话管理的父子关系
|
|
884
884
|
- **内存管理**:持久化提醒和临时聊天消息
|
|
885
|
-
- **清理头脑操作**:`
|
|
885
|
+
- **清理头脑操作**:`startNewCourse(newCoursePrompt)` 方法(清除消息,清除 Q4H,开启新一程对话,并为下一次驱动排队开启提示)
|
|
886
886
|
- **子对话管理**:专门子任务的创建和协调
|
|
887
887
|
- **Q4H 管理**:用于问题跟踪的 `updateQuestions4Human()` 方法
|
|
888
888
|
- **内存访问**:与差遣牒和团队/智能体内存的集成
|
|
@@ -899,7 +899,7 @@ interface SubdialogRegistry {
|
|
|
899
899
|
- **对话存储**:`dominds/main/persistence.ts`
|
|
900
900
|
- **Q4H 存储**:每个对话的 `q4h.yaml`(被 clear_mind 清除)
|
|
901
901
|
- **提醒存储**:每个对话的 `reminders.json`
|
|
902
|
-
-
|
|
902
|
+
- **事件持久化**:按程分文件的 JSONL 事件流
|
|
903
903
|
- **注册表存储**:每个根对话的 `registry.yaml`
|
|
904
904
|
|
|
905
905
|
**Q4H 持久化方法**:
|
|
@@ -983,9 +983,9 @@ interface RegistryMethods {
|
|
|
983
983
|
- fork 后的 root/subdialog 都落到 `running/`,并拥有新的 rootId
|
|
984
984
|
- 前端不得对 sideline dialog 暴露该入口;当前实现仅支持 fork root dialog
|
|
985
985
|
|
|
986
|
-
###
|
|
986
|
+
### 支线对话起始角色提示(强制)
|
|
987
987
|
|
|
988
|
-
|
|
988
|
+
每当支线对话进入新一程时,运行时必须在 assignment prompt 前插入角色头:
|
|
989
989
|
|
|
990
990
|
- ZH:`你是当前被诉请者对话(tellaskee dialog)的主理人;诉请者对话(tellasker dialog)为 @xxx(当前发起本次诉请)。`
|
|
991
991
|
- EN:`You are the responder (tellaskee dialog) for this dialog; the tellasker dialog is @xxx (the current caller).`
|
|
@@ -4,32 +4,6 @@ exports.buildDriveBaseContextMessages = buildDriveBaseContextMessages;
|
|
|
4
4
|
exports.appendDriveEphemeralContext = appendDriveEphemeralContext;
|
|
5
5
|
exports.appendDriveTailContext = appendDriveTailContext;
|
|
6
6
|
exports.assembleDriveContextMessages = assembleDriveContextMessages;
|
|
7
|
-
function findLastUserPromptLikeIndex(msgs) {
|
|
8
|
-
for (let i = msgs.length - 1; i >= 0; i--) {
|
|
9
|
-
const msg = msgs[i];
|
|
10
|
-
if (msg &&
|
|
11
|
-
(msg.type === 'prompting_msg' ||
|
|
12
|
-
msg.type === 'environment_msg' ||
|
|
13
|
-
msg.type === 'tellask_carryover_result_msg') &&
|
|
14
|
-
msg.role === 'user') {
|
|
15
|
-
return i;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return -1;
|
|
19
|
-
}
|
|
20
|
-
function insertBeforeLastUserPromptLike(msgs, toInsert) {
|
|
21
|
-
if (toInsert.length === 0)
|
|
22
|
-
return [...msgs];
|
|
23
|
-
const next = [...msgs];
|
|
24
|
-
const insertIndex = findLastUserPromptLikeIndex(next);
|
|
25
|
-
if (insertIndex >= 0) {
|
|
26
|
-
next.splice(insertIndex, 0, ...toInsert);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
next.push(...toInsert);
|
|
30
|
-
}
|
|
31
|
-
return next;
|
|
32
|
-
}
|
|
33
7
|
function buildDriveBaseContextMessages(parts) {
|
|
34
8
|
return [
|
|
35
9
|
...parts.prependedContextMessages,
|
|
@@ -62,12 +36,9 @@ function hasUserPromptLikeAnchor(source) {
|
|
|
62
36
|
}
|
|
63
37
|
function appendDriveTailContext(source, parts) {
|
|
64
38
|
if (hasUserPromptLikeAnchor(source)) {
|
|
65
|
-
return [...source, ...parts.renderedReminders
|
|
66
|
-
}
|
|
67
|
-
if (parts.renderedReminders.length > 0) {
|
|
68
|
-
return [parts.languageGuideMsg, ...parts.renderedReminders];
|
|
39
|
+
return [...source, ...parts.renderedReminders];
|
|
69
40
|
}
|
|
70
|
-
return [...source, parts.
|
|
41
|
+
return [...source, ...parts.renderedReminders];
|
|
71
42
|
}
|
|
72
43
|
function assembleDriveContextMessages(args) {
|
|
73
44
|
const baseMsgs = buildDriveBaseContextMessages(args.base);
|
|
@@ -10,6 +10,7 @@ const persistence_1 = require("../../persistence");
|
|
|
10
10
|
const diligence_1 = require("../../shared/diligence");
|
|
11
11
|
const driver_messages_1 = require("../../shared/i18n/driver-messages");
|
|
12
12
|
const runtime_language_1 = require("../../shared/runtime-language");
|
|
13
|
+
const storage_1 = require("../../shared/types/storage");
|
|
13
14
|
const id_1 = require("../../shared/utils/id");
|
|
14
15
|
const time_1 = require("../../shared/utils/time");
|
|
15
16
|
const tool_1 = require("../../tool");
|
|
@@ -1121,6 +1122,10 @@ async function driveDialogStreamCore(dlg, humanPrompt, driveOptions, callbacks)
|
|
|
1121
1122
|
anchorRole: 'assignment',
|
|
1122
1123
|
callId: normalizedCallId,
|
|
1123
1124
|
genseq: dlg.activeGenSeq,
|
|
1125
|
+
...(0, storage_1.toRootGenerationAnchor)({
|
|
1126
|
+
rootCourse: (dlg instanceof dialog_1.SubDialog ? dlg.rootDialog : dlg).currentCourse,
|
|
1127
|
+
rootGenseq: (dlg instanceof dialog_1.SubDialog ? dlg.rootDialog : dlg).activeGenSeqOrUndefined ?? 0,
|
|
1128
|
+
}),
|
|
1124
1129
|
};
|
|
1125
1130
|
const course = dlg.activeGenCourseOrUndefined ?? dlg.currentCourse;
|
|
1126
1131
|
await persistence_1.DialogPersistence.appendEvent(dlg.id, course, record, dlg.status);
|
|
@@ -1130,13 +1135,6 @@ async function driveDialogStreamCore(dlg, humanPrompt, driveOptions, callbacks)
|
|
|
1130
1135
|
pubRemindersVer = dlg.remindersVer;
|
|
1131
1136
|
const taskDocMsg = dlg.taskDocPath && !skipTaskdocForThisDrive ? await (0, taskdoc_1.formatTaskDocContent)(dlg) : undefined;
|
|
1132
1137
|
const renderedReminders = await renderRemindersForContext(dlg);
|
|
1133
|
-
const uiLanguage = dlg.getLastUserLanguageCode();
|
|
1134
|
-
const workingLanguage = (0, runtime_language_1.getWorkLanguage)();
|
|
1135
|
-
const guideMsg = {
|
|
1136
|
-
type: 'environment_msg',
|
|
1137
|
-
role: 'user',
|
|
1138
|
-
content: (0, driver_messages_1.formatCurrentUserLanguagePreference)(workingLanguage, uiLanguage),
|
|
1139
|
-
};
|
|
1140
1138
|
const ctxMsgs = (0, context_1.assembleDriveContextMessages)({
|
|
1141
1139
|
base: {
|
|
1142
1140
|
prependedContextMessages: policy.prependedContextMessages,
|
|
@@ -1146,7 +1144,7 @@ async function driveDialogStreamCore(dlg, humanPrompt, driveOptions, callbacks)
|
|
|
1146
1144
|
dialogMsgsForContext: await buildDialogMsgsForContext(dlg),
|
|
1147
1145
|
},
|
|
1148
1146
|
ephemeral: {},
|
|
1149
|
-
tail: { renderedReminders
|
|
1147
|
+
tail: { renderedReminders },
|
|
1150
1148
|
});
|
|
1151
1149
|
const newMsgs = [];
|
|
1152
1150
|
const streamedFuncCalls = [];
|
|
@@ -324,6 +324,14 @@ async function supplyResponseToSupdialog(args) {
|
|
|
324
324
|
anchorRole: 'response',
|
|
325
325
|
callId: resolvedCallId,
|
|
326
326
|
genseq: calleeResponseRef.genseq,
|
|
327
|
+
...(0, storage_1.toRootGenerationAnchor)({
|
|
328
|
+
rootCourse: parentDialog instanceof dialog_1.SubDialog
|
|
329
|
+
? parentDialog.rootDialog.currentCourse
|
|
330
|
+
: parentDialog.currentCourse,
|
|
331
|
+
rootGenseq: parentDialog instanceof dialog_1.SubDialog
|
|
332
|
+
? (parentDialog.rootDialog.activeGenSeqOrUndefined ?? 0)
|
|
333
|
+
: (parentDialog.activeGenSeqOrUndefined ?? 0),
|
|
334
|
+
}),
|
|
327
335
|
assignmentCourse: assignmentRef !== undefined ? (0, storage_1.toAssignmentCourseNumber)(assignmentRef.course) : undefined,
|
|
328
336
|
assignmentGenseq: assignmentRef !== undefined
|
|
329
337
|
? (0, storage_1.toAssignmentGenerationSeqNumber)(assignmentRef.genseq)
|
|
@@ -93,7 +93,7 @@ function buildTeammateTellaskPhaseContract(language) {
|
|
|
93
93
|
zh: [
|
|
94
94
|
'- 队友诉请必须遵循“发起 → 等待 → 判定 → 续推”四段协议:若目标未达成,立即发出下一轮诉请推进。',
|
|
95
95
|
'- 对队友诉请而言,收到回贴即表示该轮调用已结束;不存在“对方仍在后台继续执行同一诉请”的默认语义。要继续必须显式再发一轮诉请函数(通常 \\`tellask\\` 复用同一 \\`sessionSlug\\`)。',
|
|
96
|
-
'- 只有在存在明确进行中诉请时,才可声明“等待回贴/等待结果”(通常应可在“⏳
|
|
96
|
+
'- 只有在存在明确进行中诉请时,才可声明“等待回贴/等待结果”(通常应可在“⏳ 进行中诉请(共 N 路,自动添加,手动删除)”这类提醒项中观测到);若该提醒项不存在,或提醒项已明确“当前没有执行中的诉请”,则“等待”是错误动作,必须执行下一动作(直接诉请或本地执行)。',
|
|
97
97
|
'- 能由队友诉请完成的执行性工作,禁止转交 \\`askHuman\\` 做“转发员”;当你写“让 @X 执行 Y”时,必须在同一回复内直接发出 \\`tellask\\` 或 \\`tellaskSessionless\\`。',
|
|
98
98
|
`- 当你在诉请正文里定义“回贴格式/交付格式”时,必须明确写入:\`Dominds 会自动注入回贴标记,禁止手写标记\`;不得要求被诉请者手写 \`${runtimeMarkers.finalCompleted}\` / \`${runtimeMarkers.tellaskBack}\` / FBR 标记(\`${runtimeMarkers.fbrDirectReply}\` / \`${runtimeMarkers.fbrReasoningOnly}\`)。`,
|
|
99
99
|
'- 当你处于队友诉请触发的支线且需要澄清时,必须使用 \\`tellaskBack\\` 回问上游诉请者;\\`tellaskBack\\` 不携带 \\`sessionSlug\\`。',
|
|
@@ -102,7 +102,7 @@ function buildTeammateTellaskPhaseContract(language) {
|
|
|
102
102
|
en: [
|
|
103
103
|
'- Teammate Tellasks MUST follow four phases: “initiate -> wait -> judge -> continue”. If the objective is not met, immediately send the next Tellask round.',
|
|
104
104
|
'- For teammate Tellasks, a delivered response closes that call round; there is no default “still running in background” state for the same Tellask. To continue, emit a new Tellask function call explicitly (usually \\`tellask\\` with the same \\`sessionSlug\\`).',
|
|
105
|
-
'- You may claim “waiting for reply/result” only when a concrete pending Tellask exists (normally observable in
|
|
105
|
+
'- You may claim “waiting for reply/result” only when a concrete pending Tellask exists (normally observable in a “⏳ In-flight Tellasks (N total, auto-added, manually deleted)” reminder). If that reminder is absent, or it explicitly states there are no in-flight Tellasks, waiting is a wrong action; execute the next action now (direct Tellask or local action).',
|
|
106
106
|
'- 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.',
|
|
107
107
|
`- When you define a “reply/delivery format” inside tellask body, you must explicitly include: \`Dominds auto-injects reply markers; do not hand-write markers\`; do not require the responder to hand-write \`${runtimeMarkers.finalCompleted}\` / \`${runtimeMarkers.tellaskBack}\` / FBR markers (\`${runtimeMarkers.fbrDirectReply}\` / \`${runtimeMarkers.fbrReasoningOnly}\`).`,
|
|
108
108
|
'- When you are in a teammate-triggered sideline and need clarification, you MUST issue \\`tellaskBack\\` to ask back upstream; \\`tellaskBack\\` must not carry \\`sessionSlug\\`.',
|
package/dist/priming.js
CHANGED
|
@@ -749,6 +749,10 @@ function normalizePrimingRecordFromJson(raw) {
|
|
|
749
749
|
const record = {
|
|
750
750
|
ts: '',
|
|
751
751
|
type,
|
|
752
|
+
...(0, storage_1.toRootGenerationAnchor)({
|
|
753
|
+
rootCourse: expectIntegerField(raw, 'rootCourse', context),
|
|
754
|
+
rootGenseq: expectIntegerField(raw, 'rootGenseq', context),
|
|
755
|
+
}),
|
|
752
756
|
anchorRole,
|
|
753
757
|
callId: expectStringField(raw, 'callId', context),
|
|
754
758
|
genseq: expectIntegerField(raw, 'genseq', context),
|
|
@@ -83,6 +83,16 @@ function resolveUserLanguageCode(ws, raw, fallbackDialog) {
|
|
|
83
83
|
return fallbackDialog.getLastUserLanguageCode();
|
|
84
84
|
return (0, runtime_language_1.getWorkLanguage)();
|
|
85
85
|
}
|
|
86
|
+
function syncDialogLanguagePreference(dialog, language, options) {
|
|
87
|
+
const previousLanguage = dialog.getLastUserLanguageCode();
|
|
88
|
+
dialog.setUiLanguage(language);
|
|
89
|
+
dialog.setLastUserLanguageCode(language);
|
|
90
|
+
if (options?.appendSwitchNotice) {
|
|
91
|
+
dialog.appendCourseLanguageChangedNotice(previousLanguage, language);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
dialog.resetCourseLanguageNotice();
|
|
95
|
+
}
|
|
86
96
|
async function queueUserSupplementAtGenerationBoundary(dialog, prompt) {
|
|
87
97
|
const latest = await persistence_1.DialogPersistence.loadDialogLatest(dialog.id, 'running');
|
|
88
98
|
const runStateKind = latest?.runState?.kind;
|
|
@@ -554,6 +564,10 @@ async function handleSetUiLanguage(ws, packet) {
|
|
|
554
564
|
return;
|
|
555
565
|
}
|
|
556
566
|
wsUiLanguage.set(ws, parsed);
|
|
567
|
+
const liveDialog = wsLiveDlg.get(ws);
|
|
568
|
+
if (liveDialog) {
|
|
569
|
+
syncDialogLanguagePreference(liveDialog, parsed, { appendSwitchNotice: true });
|
|
570
|
+
}
|
|
557
571
|
ws.send(JSON.stringify({ type: 'ui_language_set', uiLanguage: parsed }));
|
|
558
572
|
}
|
|
559
573
|
/**
|
|
@@ -575,6 +589,7 @@ async function handleCreateDialog(ws, packet) {
|
|
|
575
589
|
const dialogUI = new persistence_1.DiskFileDialogStore(dialogId);
|
|
576
590
|
// Create RootDialog instance with the new store
|
|
577
591
|
const dialog = new dialog_1.RootDialog(dialogUI, taskDocPath, dialogId, agentId);
|
|
592
|
+
syncDialogLanguagePreference(dialog, resolveUserLanguageCode(ws, undefined, dialog));
|
|
578
593
|
dialog_global_registry_1.globalDialogRegistry.register(dialog);
|
|
579
594
|
// Setup WebSocket subscription for real-time events
|
|
580
595
|
await setupWebSocketSubscription(ws, dialog);
|
|
@@ -720,6 +735,7 @@ async function handleDisplayDialog(ws, packet) {
|
|
|
720
735
|
}
|
|
721
736
|
dialog = loaded;
|
|
722
737
|
}
|
|
738
|
+
syncDialogLanguagePreference(dialog, resolveUserLanguageCode(ws, undefined, dialog));
|
|
723
739
|
// Subscribe BEFORE sending restoration events.
|
|
724
740
|
// This avoids a race where new persisted events (e.g., Agent Priming replay) are emitted
|
|
725
741
|
// between the restoration snapshot read and the subscription setup.
|
package/dist/server.js
CHANGED
|
@@ -128,8 +128,13 @@ async function startServer(opts = {}) {
|
|
|
128
128
|
(0, websocket_handler_1.setupWebSocketServer)(httpServer.getHttpServer(), clients, config.auth ?? { kind: 'disabled' }, (0, runtime_language_1.getWorkLanguage)());
|
|
129
129
|
// MCP is best-effort: startup must not be blocked by MCP config/server issues.
|
|
130
130
|
(0, supervisor_1.startMcpSupervisor)();
|
|
131
|
-
// Apps host
|
|
132
|
-
|
|
131
|
+
// Apps host is optional for server boot: app failures must stay loud, but they must not block WebUI startup.
|
|
132
|
+
try {
|
|
133
|
+
await (0, runtime_1.initAppsRuntime)({ rtwsRootAbs: process.cwd(), kernel: { host, port } });
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
log.warn('Apps runtime initialization failed during server startup; continuing without app runtime capabilities until the app issue is fixed', error instanceof Error ? error : new Error(String(error)));
|
|
137
|
+
}
|
|
133
138
|
// Crash recovery: any dialogs left in "proceeding" state are surfaced as interrupted/resumable.
|
|
134
139
|
await (0, dialog_run_state_1.reconcileRunStatesAfterRestart)();
|
|
135
140
|
// Tests may opt out so the process can shut down cleanly without a driver stop API.
|
package/dist/shared/diligence.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.DILIGENCE_FALLBACK_TEXT = {
|
|
|
30
30
|
'',
|
|
31
31
|
'当该提醒项明确写出“当前没有任何执行中的诉请、没有其祂智能体在后台工作”时,任何“继续等待”的想法和行为都是错误的;如果你已经明确知晓这点,可手动删除该提醒项以免碍眼。',
|
|
32
32
|
'',
|
|
33
|
-
'同理,若不存在“⏳
|
|
33
|
+
'同理,若不存在“⏳ 进行中诉请(共 N 路,自动添加,手动删除)”这类提醒项,或某条历史诉请未出现在该提醒项中,都表示当前没有可等待的进行中诉请(通常代表该轮已回贴或已结束);“继续等待”是错误动作,必须立即执行下一步:本地动作,或使用同一个 `sessionSlug` 再次调用 `tellask` 向对应队友发起下一轮诉请。',
|
|
34
34
|
].join('\n'),
|
|
35
35
|
en: [
|
|
36
36
|
'Do a self-check (run one FBR): does the Taskdoc already contain a sufficiently clear goal definition?',
|
|
@@ -59,6 +59,6 @@ exports.DILIGENCE_FALLBACK_TEXT = {
|
|
|
59
59
|
'',
|
|
60
60
|
'When this reminder explicitly says there are no in-flight Tellasks and no agents working in the background, any “keep waiting” thought or behavior is wrong; if you clearly know this, manually delete the reminder to reduce noise.',
|
|
61
61
|
'',
|
|
62
|
-
'Likewise, if
|
|
62
|
+
'Likewise, if a “⏳ In-flight Tellasks (N total, auto-added, manually deleted)” reminder is absent, or a historical Tellask is not listed in that reminder, there is no waitable in-flight Tellask for it at the moment (usually the previous round has replied or ended). “Keep waiting” is a wrong action; execute the next step immediately: local action, or launch a new Tellask round to the same teammate via `tellask` with the same `sessionSlug`.',
|
|
63
63
|
].join('\n'),
|
|
64
64
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatSystemNoticePrefix = formatSystemNoticePrefix;
|
|
4
4
|
exports.formatCurrentUserLanguagePreference = formatCurrentUserLanguagePreference;
|
|
5
|
+
exports.formatUserLanguagePreferenceChangedNotice = formatUserLanguagePreferenceChangedNotice;
|
|
5
6
|
exports.formatNewCourseStartPrompt = formatNewCourseStartPrompt;
|
|
6
7
|
exports.formatReminderItemGuide = formatReminderItemGuide;
|
|
7
8
|
exports.formatQ4HDiligencePushBudgetExhausted = formatQ4HDiligencePushBudgetExhausted;
|
|
@@ -21,14 +22,53 @@ function formatCurrentUserLanguagePreference(workingLanguage, uiLanguage) {
|
|
|
21
22
|
const prefix = formatSystemNoticePrefix(workingLanguage);
|
|
22
23
|
if (workingLanguage === 'zh') {
|
|
23
24
|
if (uiLanguage === workingLanguage) {
|
|
24
|
-
return
|
|
25
|
+
return [
|
|
26
|
+
prefix,
|
|
27
|
+
'这是浏览器里的界面语言设置,不是新的用户指令;不要停下当前工作,也不要单独回复确认,只需在后续继续任务时遵守。',
|
|
28
|
+
`你对用户的可见回复语言应使用:${uiName}。`,
|
|
29
|
+
].join('\n');
|
|
25
30
|
}
|
|
26
|
-
return
|
|
31
|
+
return [
|
|
32
|
+
prefix,
|
|
33
|
+
'这是浏览器里的界面语言设置,不是新的用户指令;不要停下当前工作,也不要单独回复确认,只需在后续继续任务时遵守。',
|
|
34
|
+
`你对用户的可见回复语言应使用:${uiName}。`,
|
|
35
|
+
`你的内部工作语言保持为:${workingName}(用于系统提示、队友诉请与工具调用)。`,
|
|
36
|
+
].join('\n');
|
|
27
37
|
}
|
|
28
38
|
if (uiLanguage === workingLanguage) {
|
|
29
|
-
return
|
|
39
|
+
return [
|
|
40
|
+
prefix,
|
|
41
|
+
'This comes from a browser UI language change, not a new user instruction. Do not stop the current work or send a standalone acknowledgement; just follow it in subsequent work.',
|
|
42
|
+
`Your user-visible reply language should be: ${uiName}.`,
|
|
43
|
+
].join('\n');
|
|
44
|
+
}
|
|
45
|
+
return [
|
|
46
|
+
prefix,
|
|
47
|
+
'This comes from a browser UI language change, not a new user instruction. Do not stop the current work or send a standalone acknowledgement; just follow it in subsequent work.',
|
|
48
|
+
`Your user-visible reply language should be: ${uiName}.`,
|
|
49
|
+
`Your internal work language remains: ${workingName} (system prompt, teammate comms, function tools).`,
|
|
50
|
+
].join('\n');
|
|
51
|
+
}
|
|
52
|
+
function formatUserLanguagePreferenceChangedNotice(workingLanguage, previousUiLanguage, nextUiLanguage) {
|
|
53
|
+
const previousName = (0, language_1.formatLanguageName)(previousUiLanguage, workingLanguage);
|
|
54
|
+
const nextName = (0, language_1.formatLanguageName)(nextUiLanguage, workingLanguage);
|
|
55
|
+
const prefix = formatSystemNoticePrefix(workingLanguage);
|
|
56
|
+
if (workingLanguage === 'zh') {
|
|
57
|
+
return [
|
|
58
|
+
prefix,
|
|
59
|
+
'这是浏览器里的界面语言切换,不是新的用户指令;不要停下当前工作,不要只回复“收到/好的”,也不要把这条提示当成新的待办。',
|
|
60
|
+
`用户的界面语言已从 ${previousName} 切换为 ${nextName}。`,
|
|
61
|
+
`从现在起,你对用户的可见回复语言应使用:${nextName}。`,
|
|
62
|
+
'继续推进当前任务本身。',
|
|
63
|
+
].join('\n');
|
|
30
64
|
}
|
|
31
|
-
return
|
|
65
|
+
return [
|
|
66
|
+
prefix,
|
|
67
|
+
'This is a browser UI language change, not a new user instruction. Do not stop the current work, do not reply with a standalone "acknowledged/ok", and do not treat this notice as a new to-do.',
|
|
68
|
+
`The user UI language changed from ${previousName} to ${nextName}.`,
|
|
69
|
+
`From now on, your user-visible reply language should be: ${nextName}.`,
|
|
70
|
+
'Continue the current task itself.',
|
|
71
|
+
].join('\n');
|
|
32
72
|
}
|
|
33
73
|
function formatNewCourseStartPrompt(language, args) {
|
|
34
74
|
if (language === 'zh') {
|
|
@@ -39,10 +79,10 @@ function formatNewCourseStartPrompt(language, args) {
|
|
|
39
79
|
'现在已经进入新一程:第一步先复核并整理接续包提醒项,以清醒头脑删除冗余、纠正偏激或失真的过桥思路、压缩成高质量提醒项;再继续推进任务。');
|
|
40
80
|
}
|
|
41
81
|
const prefix = args.source === 'clear_mind'
|
|
42
|
-
? `This is course #${args.nextCourse}
|
|
43
|
-
: `System auto-started course #${args.nextCourse}
|
|
82
|
+
? `This is dialog course #${args.nextCourse}. You just cleared your mind.`
|
|
83
|
+
: `System auto-started dialog course #${args.nextCourse} because context health is critical.`;
|
|
44
84
|
return (`${prefix} ` +
|
|
45
|
-
'You are now in a new course: your first step is to review and rewrite any continuation-package reminders with a clear head, remove redundancy, correct biased or distorted bridge notes, compress them into high-quality reminders, and then continue the task.');
|
|
85
|
+
'You are now in a new dialog course: your first step is to review and rewrite any continuation-package reminders with a clear head, remove redundancy, correct biased or distorted bridge notes, compress them into high-quality reminders, and then continue the task.');
|
|
46
86
|
}
|
|
47
87
|
function formatReminderItemGuide(language, index, content, options) {
|
|
48
88
|
function isRecord(value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as isSymbol, c as baseFlatten, g as baseIteratee, k as keys, h as baseFindIndex, j as baseEach, l as arrayMap, m as hasPath, n as castPath, t as toKey, o as baseGet } from "./_baseUniq-
|
|
2
|
-
import { aR as isObject, aA as baseRest, aS as isIterateeCall, aT as keysIn, aU as eq, aV as isArrayLike, aW as isArray, aX as identity, aY as isIndex, aZ as assignValue } from "./index-
|
|
1
|
+
import { e as isSymbol, c as baseFlatten, g as baseIteratee, k as keys, h as baseFindIndex, j as baseEach, l as arrayMap, m as hasPath, n as castPath, t as toKey, o as baseGet } from "./_baseUniq-EKRe-CHy.js";
|
|
2
|
+
import { aR as isObject, aA as baseRest, aS as isIterateeCall, aT as keysIn, aU as eq, aV as isArrayLike, aW as isArray, aX as identity, aY as isIndex, aZ as assignValue } from "./index-CzBEs1w4.js";
|
|
3
3
|
var reWhitespace = /\s/;
|
|
4
4
|
function trimmedEndIndex(string) {
|
|
5
5
|
var index = string.length;
|
|
@@ -193,4 +193,4 @@ export {
|
|
|
193
193
|
map as m,
|
|
194
194
|
toFinite as t
|
|
195
195
|
};
|
|
196
|
-
//# sourceMappingURL=_basePickBy-
|
|
196
|
+
//# sourceMappingURL=_basePickBy-b79Z8z7v.js.map
|