@dxos/assistant-toolkit 0.10.0 → 0.11.1
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/lib/chunk-Chat.mjs +144 -0
- package/dist/lib/chunk-Chat.mjs.map +1 -0
- package/dist/lib/chunk-Memory.mjs +19 -0
- package/dist/lib/chunk-Memory.mjs.map +1 -0
- package/dist/lib/{neutral/agent-rules-KWCBKJ5W.mjs → chunk-agent-rules.mjs} +8 -15
- package/dist/lib/chunk-agent-rules.mjs.map +1 -0
- package/dist/lib/chunk-agent.mjs +45 -0
- package/dist/lib/chunk-agent.mjs.map +1 -0
- package/dist/lib/chunk-artifact-add.mjs +31 -0
- package/dist/lib/chunk-artifact-add.mjs.map +1 -0
- package/dist/lib/chunk-artifact-list.mjs +23 -0
- package/dist/lib/chunk-artifact-list.mjs.map +1 -0
- package/dist/lib/chunk-context-add.mjs +16 -0
- package/dist/lib/chunk-context-add.mjs.map +1 -0
- package/dist/lib/chunk-context-remove.mjs +16 -0
- package/dist/lib/chunk-context-remove.mjs.map +1 -0
- package/dist/lib/chunk-create-agent.mjs +23 -0
- package/dist/lib/chunk-create-agent.mjs.map +1 -0
- package/dist/lib/chunk-definitions.mjs +52 -0
- package/dist/lib/chunk-definitions.mjs.map +1 -0
- package/dist/lib/chunk-definitions2.mjs +56 -0
- package/dist/lib/chunk-definitions2.mjs.map +1 -0
- package/dist/lib/chunk-definitions3.mjs +24 -0
- package/dist/lib/chunk-definitions3.mjs.map +1 -0
- package/dist/lib/chunk-delete.mjs +14 -0
- package/dist/lib/chunk-delete.mjs.map +1 -0
- package/dist/lib/chunk-enable-skills.mjs +39 -0
- package/dist/lib/chunk-enable-skills.mjs.map +1 -0
- package/dist/lib/chunk-fetch-messages.mjs +113 -0
- package/dist/lib/chunk-fetch-messages.mjs.map +1 -0
- package/dist/lib/chunk-fetch.mjs +20 -0
- package/dist/lib/chunk-fetch.mjs.map +1 -0
- package/dist/lib/chunk-get-context.mjs +55 -0
- package/dist/lib/chunk-get-context.mjs.map +1 -0
- package/dist/lib/chunk-get-current-date.mjs +17 -0
- package/dist/lib/chunk-get-current-date.mjs.map +1 -0
- package/dist/lib/chunk-load.mjs +13 -0
- package/dist/lib/chunk-load.mjs.map +1 -0
- package/dist/lib/chunk-object-create.mjs +42 -0
- package/dist/lib/chunk-object-create.mjs.map +1 -0
- package/dist/lib/chunk-object-delete.mjs +14 -0
- package/dist/lib/chunk-object-delete.mjs.map +1 -0
- package/dist/lib/chunk-object-update.mjs +19 -0
- package/dist/lib/chunk-object-update.mjs.map +1 -0
- package/dist/lib/chunk-operations.mjs +714 -0
- package/dist/lib/chunk-operations.mjs.map +1 -0
- package/dist/lib/chunk-plan-reminder.mjs +80 -0
- package/dist/lib/chunk-plan-reminder.mjs.map +1 -0
- package/dist/lib/chunk-query-skills.mjs +12 -0
- package/dist/lib/chunk-query-skills.mjs.map +1 -0
- package/dist/lib/chunk-query.mjs +36 -0
- package/dist/lib/chunk-query.mjs.map +1 -0
- package/dist/lib/chunk-query2.mjs +18 -0
- package/dist/lib/chunk-query2.mjs.map +1 -0
- package/dist/lib/chunk-relation-create.mjs +41 -0
- package/dist/lib/chunk-relation-create.mjs.map +1 -0
- package/dist/lib/chunk-relation-delete.mjs +14 -0
- package/dist/lib/chunk-relation-delete.mjs.map +1 -0
- package/dist/lib/chunk-relay.mjs +76 -0
- package/dist/lib/chunk-relay.mjs.map +1 -0
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-run-instructions.mjs +145 -0
- package/dist/lib/chunk-run-instructions.mjs.map +1 -0
- package/dist/lib/chunk-save.mjs +17 -0
- package/dist/lib/chunk-save.mjs.map +1 -0
- package/dist/lib/chunk-schema-add.mjs +19 -0
- package/dist/lib/chunk-schema-add.mjs.map +1 -0
- package/dist/lib/chunk-schema-list.mjs +29 -0
- package/dist/lib/chunk-schema-list.mjs.map +1 -0
- package/dist/lib/chunk-set-alarm.mjs +55 -0
- package/dist/lib/chunk-set-alarm.mjs.map +1 -0
- package/dist/lib/chunk-sync-automation.mjs +130 -0
- package/dist/lib/chunk-sync-automation.mjs.map +1 -0
- package/dist/lib/chunk-sync-issues.mjs +127 -0
- package/dist/lib/chunk-sync-issues.mjs.map +1 -0
- package/dist/lib/chunk-sync.mjs +91 -0
- package/dist/lib/chunk-sync.mjs.map +1 -0
- package/dist/lib/chunk-tag-add.mjs +14 -0
- package/dist/lib/chunk-tag-add.mjs.map +1 -0
- package/dist/lib/chunk-tag-remove.mjs +14 -0
- package/dist/lib/chunk-tag-remove.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +198 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/chunk-update-tasks.mjs +34 -0
- package/dist/lib/chunk-update-tasks.mjs.map +1 -0
- package/dist/lib/index.mjs +614 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/testing.mjs +102 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/types/src/skills/agent/operations/definitions.d.ts +16 -46
- package/dist/types/src/skills/agent/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/agent/operations/get-context.test.d.ts +2 -0
- package/dist/types/src/skills/agent/operations/get-context.test.d.ts.map +1 -0
- package/dist/types/src/skills/agent/operations/index.d.ts.map +1 -1
- package/dist/types/src/skills/agent/operations/relay.d.ts +11 -0
- package/dist/types/src/skills/agent/operations/relay.d.ts.map +1 -0
- package/dist/types/src/skills/agent/operations/relay.test.d.ts +2 -0
- package/dist/types/src/skills/agent/operations/relay.test.d.ts.map +1 -0
- package/dist/types/src/skills/agent/skill.d.ts.map +1 -1
- package/dist/types/src/skills/agent-wizard/operations/definitions.d.ts +4 -1
- package/dist/types/src/skills/agent-wizard/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/agent-wizard/operations/sync-automation.d.ts +26 -0
- package/dist/types/src/skills/agent-wizard/operations/sync-automation.d.ts.map +1 -0
- package/dist/types/src/skills/agent-wizard/operations/sync-automation.test.d.ts +2 -0
- package/dist/types/src/skills/agent-wizard/operations/sync-automation.test.d.ts.map +1 -0
- package/dist/types/src/skills/agent-wizard/skill.d.ts.map +1 -1
- package/dist/types/src/skills/database/operations/context-add.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/context-add.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/context-remove.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/context-remove.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/definitions.d.ts +7 -2
- package/dist/types/src/skills/database/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/database/operations/load.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/load.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/object-create.d.ts +4 -1
- package/dist/types/src/skills/database/operations/object-create.d.ts.map +1 -1
- package/dist/types/src/skills/database/operations/object-create.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/object-create.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/object-delete.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/object-delete.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/object-update.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/object-update.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/query.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/query.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/relation-create.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/relation-create.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/schema-add.d.ts +3 -1
- package/dist/types/src/skills/database/operations/schema-add.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/schema-add.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/schema-list.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/schema-list.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/tag-add.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/tag-add.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/tag-remove.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/tag-remove.test.d.ts.map +1 -0
- package/dist/types/src/skills/delegation/operations/delegate-task.d.ts +6 -5
- package/dist/types/src/skills/delegation/operations/delegate-task.d.ts.map +1 -1
- package/dist/types/src/skills/index.d.ts +1 -0
- package/dist/types/src/skills/index.d.ts.map +1 -1
- package/dist/types/src/skills/linear/operations/sync-issues.d.ts.map +1 -1
- package/dist/types/src/skills/memory/operations/delete.test.d.ts +2 -0
- package/dist/types/src/skills/memory/operations/delete.test.d.ts.map +1 -0
- package/dist/types/src/skills/memory/operations/query.test.d.ts +2 -0
- package/dist/types/src/skills/memory/operations/query.test.d.ts.map +1 -0
- package/dist/types/src/skills/memory/operations/save.test.d.ts +2 -0
- package/dist/types/src/skills/memory/operations/save.test.d.ts.map +1 -0
- package/dist/types/src/skills/planning/operations/definitions.d.ts +1 -3
- package/dist/types/src/skills/planning/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/planning/operations/plan-reminder.d.ts +7 -6
- package/dist/types/src/skills/planning/operations/plan-reminder.d.ts.map +1 -1
- package/dist/types/src/skills/planning/operations/plan-reminder.test.d.ts +2 -0
- package/dist/types/src/skills/planning/operations/plan-reminder.test.d.ts.map +1 -0
- package/dist/types/src/skills/planning/operations/update-tasks.d.ts +3 -1
- package/dist/types/src/skills/planning/operations/update-tasks.d.ts.map +1 -1
- package/dist/types/src/skills/project/index.d.ts +3 -0
- package/dist/types/src/skills/project/index.d.ts.map +1 -0
- package/dist/types/src/skills/project/operations/artifact-add.d.ts +5 -0
- package/dist/types/src/skills/project/operations/artifact-add.d.ts.map +1 -0
- package/dist/types/src/skills/project/operations/artifact-list.d.ts +5 -0
- package/dist/types/src/skills/project/operations/artifact-list.d.ts.map +1 -0
- package/dist/types/src/skills/project/operations/definitions.d.ts +23 -0
- package/dist/types/src/skills/project/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/skills/project/operations/index.d.ts +4 -0
- package/dist/types/src/skills/project/operations/index.d.ts.map +1 -0
- package/dist/types/src/skills/project/skill.d.ts +4 -0
- package/dist/types/src/skills/project/skill.d.ts.map +1 -0
- package/dist/types/src/skills/project/skill.test.d.ts.map +1 -0
- package/dist/types/src/skills/skill-manager/skill.d.ts.map +1 -1
- package/dist/types/src/supervisor/delegation-strategy.d.ts +5 -5
- package/dist/types/src/supervisor/delegation-strategy.d.ts.map +1 -1
- package/dist/types/src/supervisor/delegation-strategy.test.d.ts +2 -0
- package/dist/types/src/supervisor/delegation-strategy.test.d.ts.map +1 -0
- package/dist/types/src/sync/sync.test.d.ts +2 -0
- package/dist/types/src/sync/sync.test.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/operations.d.ts +7 -0
- package/dist/types/src/testing/operations.d.ts.map +1 -0
- package/dist/types/src/types/Agent.d.ts +28 -31
- package/dist/types/src/types/Agent.d.ts.map +1 -1
- package/dist/types/src/types/Chat.d.ts +28 -14
- package/dist/types/src/types/Chat.d.ts.map +1 -1
- package/dist/types/src/types/Chat.test.d.ts +2 -0
- package/dist/types/src/types/Chat.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -29
- package/src/operations/run-instructions.test.ts +26 -34
- package/src/operations/skill-resolution.test.ts +6 -1
- package/src/skills/agent/operations/definitions.ts +18 -62
- package/src/skills/agent/operations/get-context.test.ts +81 -0
- package/src/skills/agent/operations/get-context.ts +9 -36
- package/src/skills/agent/operations/index.ts +1 -3
- package/src/skills/agent/operations/relay.test.ts +63 -0
- package/src/skills/agent/operations/relay.ts +124 -0
- package/src/skills/agent/skill.ts +3 -15
- package/src/skills/agent-wizard/operations/create-agent.ts +3 -3
- package/src/skills/agent-wizard/operations/definitions.ts +19 -4
- package/src/skills/agent-wizard/operations/index.ts +1 -1
- package/src/skills/agent-wizard/operations/sync-automation.test.ts +103 -0
- package/src/skills/agent-wizard/operations/sync-automation.ts +205 -0
- package/src/skills/agent-wizard/skill.ts +9 -10
- package/src/skills/alarm/skill.test.ts +2 -2
- package/src/skills/browser/skill.test.ts +4 -4
- package/src/skills/database/operations/context-add.test.ts +46 -0
- package/src/skills/database/operations/context-remove.test.ts +46 -0
- package/src/skills/database/operations/definitions.ts +23 -7
- package/src/skills/database/operations/load.test.ts +38 -0
- package/src/skills/database/operations/object-create.test.ts +116 -0
- package/src/skills/database/operations/object-create.ts +13 -2
- package/src/skills/database/operations/object-delete.test.ts +37 -0
- package/src/skills/database/operations/object-update.test.ts +39 -0
- package/src/skills/database/operations/query.test.ts +128 -0
- package/src/skills/database/operations/relation-create.test.ts +46 -0
- package/src/skills/database/operations/schema-add.test.ts +79 -0
- package/src/skills/database/operations/schema-list.test.ts +42 -0
- package/src/skills/database/operations/tag-add.test.ts +41 -0
- package/src/skills/database/operations/tag-remove.test.ts +43 -0
- package/src/skills/delegation/operations/delegate-task.test.ts +51 -36
- package/src/skills/delegation/operations/delegate-task.ts +31 -48
- package/src/skills/discord/operations/fetch-messages.test.ts +2 -2
- package/src/skills/github/operations/fetch-prs.ts +1 -1
- package/src/skills/index.ts +1 -0
- package/src/skills/linear/operations/linear.test.ts +1 -1
- package/src/skills/linear/operations/sync-issues.ts +6 -23
- package/src/skills/memory/operations/delete.test.ts +37 -0
- package/src/skills/memory/operations/query.test.ts +76 -0
- package/src/skills/memory/operations/save.test.ts +43 -0
- package/src/skills/planning/operations/definitions.ts +9 -6
- package/src/skills/planning/operations/plan-reminder.test.ts +123 -0
- package/src/skills/planning/operations/plan-reminder.ts +49 -31
- package/src/skills/planning/operations/update-tasks.md +23 -22
- package/src/skills/planning/operations/update-tasks.test.ts +31 -17
- package/src/skills/planning/operations/update-tasks.ts +17 -25
- package/src/skills/project/index.ts +6 -0
- package/src/skills/project/operations/artifact-add.ts +47 -0
- package/src/skills/project/operations/artifact-list.ts +41 -0
- package/src/skills/project/operations/definitions.ts +63 -0
- package/src/skills/project/operations/index.ts +12 -0
- package/src/skills/project/skill.test.ts +78 -0
- package/src/skills/project/skill.ts +42 -0
- package/src/skills/skill-manager/operations/definitions.ts +1 -1
- package/src/skills/skill-manager/skill.test.ts +1 -1
- package/src/skills/skill-manager/skill.ts +7 -5
- package/src/skills/websearch/skill.test.ts +2 -2
- package/src/supervisor/delegation-strategy.test.ts +129 -0
- package/src/supervisor/delegation-strategy.ts +92 -56
- package/src/sync/sync.test.ts +95 -0
- package/src/sync/sync.ts +5 -3
- package/src/testing/index.ts +1 -0
- package/src/testing/operations.ts +65 -0
- package/src/types/Agent.test.ts +36 -66
- package/src/types/Agent.ts +108 -137
- package/src/types/Chat.test.ts +234 -0
- package/src/types/Chat.ts +80 -26
- package/src/types/index.ts +1 -2
- package/dist/lib/neutral/add-artifact-5JNUYLCA.mjs +0 -24
- package/dist/lib/neutral/add-artifact-5JNUYLCA.mjs.map +0 -7
- package/dist/lib/neutral/agent-BFAYIBJI.mjs +0 -65
- package/dist/lib/neutral/agent-BFAYIBJI.mjs.map +0 -7
- package/dist/lib/neutral/agent-rules-KWCBKJ5W.mjs.map +0 -7
- package/dist/lib/neutral/chunk-3KA66YBF.mjs +0 -62
- package/dist/lib/neutral/chunk-3KA66YBF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-6SGNFL6I.mjs +0 -85
- package/dist/lib/neutral/chunk-6SGNFL6I.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BDTGFPM7.mjs +0 -113
- package/dist/lib/neutral/chunk-BDTGFPM7.mjs.map +0 -7
- package/dist/lib/neutral/chunk-EPQCDGIV.mjs +0 -27
- package/dist/lib/neutral/chunk-EPQCDGIV.mjs.map +0 -7
- package/dist/lib/neutral/chunk-H4W22FFJ.mjs +0 -232
- package/dist/lib/neutral/chunk-H4W22FFJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JBTXZQ5G.mjs +0 -60
- package/dist/lib/neutral/chunk-JBTXZQ5G.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JKOOA5OS.mjs +0 -97
- package/dist/lib/neutral/chunk-JKOOA5OS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JTEBE7KA.mjs +0 -66
- package/dist/lib/neutral/chunk-JTEBE7KA.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KLFXJ2Z3.mjs +0 -36
- package/dist/lib/neutral/chunk-KLFXJ2Z3.mjs.map +0 -7
- package/dist/lib/neutral/chunk-LBA5UOLF.mjs +0 -87
- package/dist/lib/neutral/chunk-LBA5UOLF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-LL3MOQUZ.mjs +0 -120
- package/dist/lib/neutral/chunk-LL3MOQUZ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-MFVIGJBW.mjs +0 -68
- package/dist/lib/neutral/chunk-MFVIGJBW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PBARVBNJ.mjs +0 -86
- package/dist/lib/neutral/chunk-PBARVBNJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VJ5QBYM5.mjs +0 -61
- package/dist/lib/neutral/chunk-VJ5QBYM5.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YQSQRSXG.mjs +0 -367
- package/dist/lib/neutral/chunk-YQSQRSXG.mjs.map +0 -7
- package/dist/lib/neutral/chunk-Z2HFOZXK.mjs +0 -191
- package/dist/lib/neutral/chunk-Z2HFOZXK.mjs.map +0 -7
- package/dist/lib/neutral/context-add-DZTPB3FK.mjs +0 -22
- package/dist/lib/neutral/context-add-DZTPB3FK.mjs.map +0 -7
- package/dist/lib/neutral/context-remove-XSBOM4VJ.mjs +0 -22
- package/dist/lib/neutral/context-remove-XSBOM4VJ.mjs.map +0 -7
- package/dist/lib/neutral/create-agent-5WTOFIEK.mjs +0 -35
- package/dist/lib/neutral/create-agent-5WTOFIEK.mjs.map +0 -7
- package/dist/lib/neutral/definitions-VRR5OGXI.mjs +0 -17
- package/dist/lib/neutral/definitions-VRR5OGXI.mjs.map +0 -7
- package/dist/lib/neutral/delegate-task-UX64NK4M.mjs +0 -13
- package/dist/lib/neutral/delegate-task-UX64NK4M.mjs.map +0 -7
- package/dist/lib/neutral/delete-IU7HPU3K.mjs +0 -19
- package/dist/lib/neutral/delete-IU7HPU3K.mjs.map +0 -7
- package/dist/lib/neutral/enable-skills-FHEJXQVB.mjs +0 -47
- package/dist/lib/neutral/enable-skills-FHEJXQVB.mjs.map +0 -7
- package/dist/lib/neutral/fetch-5LY25EBR.mjs +0 -24
- package/dist/lib/neutral/fetch-5LY25EBR.mjs.map +0 -7
- package/dist/lib/neutral/fetch-messages-CQMDI36G.mjs +0 -139
- package/dist/lib/neutral/fetch-messages-CQMDI36G.mjs.map +0 -7
- package/dist/lib/neutral/get-context-Q4YY6DRV.mjs +0 -77
- package/dist/lib/neutral/get-context-Q4YY6DRV.mjs.map +0 -7
- package/dist/lib/neutral/get-current-date-JR5F7ZS3.mjs +0 -17
- package/dist/lib/neutral/get-current-date-JR5F7ZS3.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -875
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/load-S6HC5TGX.mjs +0 -17
- package/dist/lib/neutral/load-S6HC5TGX.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/object-create-PVDQ62CG.mjs +0 -32
- package/dist/lib/neutral/object-create-PVDQ62CG.mjs.map +0 -7
- package/dist/lib/neutral/object-delete-3CSL6XI6.mjs +0 -18
- package/dist/lib/neutral/object-delete-3CSL6XI6.mjs.map +0 -7
- package/dist/lib/neutral/object-update-NIGMZINM.mjs +0 -28
- package/dist/lib/neutral/object-update-NIGMZINM.mjs.map +0 -7
- package/dist/lib/neutral/plan-reminder-N4X6JPBI.mjs +0 -88
- package/dist/lib/neutral/plan-reminder-N4X6JPBI.mjs.map +0 -7
- package/dist/lib/neutral/qualifier-5CIRZYX5.mjs +0 -91
- package/dist/lib/neutral/qualifier-5CIRZYX5.mjs.map +0 -7
- package/dist/lib/neutral/query-K4R7UHLU.mjs +0 -32
- package/dist/lib/neutral/query-K4R7UHLU.mjs.map +0 -7
- package/dist/lib/neutral/query-NCTCRYTD.mjs +0 -59
- package/dist/lib/neutral/query-NCTCRYTD.mjs.map +0 -7
- package/dist/lib/neutral/query-skills-7GQFSU4V.mjs +0 -17
- package/dist/lib/neutral/query-skills-7GQFSU4V.mjs.map +0 -7
- package/dist/lib/neutral/relation-create-QKXHTL7G.mjs +0 -34
- package/dist/lib/neutral/relation-create-QKXHTL7G.mjs.map +0 -7
- package/dist/lib/neutral/relation-delete-PDIWT2JX.mjs +0 -18
- package/dist/lib/neutral/relation-delete-PDIWT2JX.mjs.map +0 -7
- package/dist/lib/neutral/run-instructions-72ASH5EZ.mjs +0 -165
- package/dist/lib/neutral/run-instructions-72ASH5EZ.mjs.map +0 -7
- package/dist/lib/neutral/save-UYVRA4RS.mjs +0 -23
- package/dist/lib/neutral/save-UYVRA4RS.mjs.map +0 -7
- package/dist/lib/neutral/schema-add-5NOK2RWE.mjs +0 -25
- package/dist/lib/neutral/schema-add-5NOK2RWE.mjs.map +0 -7
- package/dist/lib/neutral/schema-list-BZUR5KMX.mjs +0 -37
- package/dist/lib/neutral/schema-list-BZUR5KMX.mjs.map +0 -7
- package/dist/lib/neutral/set-alarm-BD3NEYSU.mjs +0 -65
- package/dist/lib/neutral/set-alarm-BD3NEYSU.mjs.map +0 -7
- package/dist/lib/neutral/sync-issues-O76MCMD3.mjs +0 -166
- package/dist/lib/neutral/sync-issues-O76MCMD3.mjs.map +0 -7
- package/dist/lib/neutral/sync-triggers-YBTLPCUB.mjs +0 -138
- package/dist/lib/neutral/sync-triggers-YBTLPCUB.mjs.map +0 -7
- package/dist/lib/neutral/tag-add-L5WNOBYY.mjs +0 -18
- package/dist/lib/neutral/tag-add-L5WNOBYY.mjs.map +0 -7
- package/dist/lib/neutral/tag-remove-WV5RPE5W.mjs +0 -18
- package/dist/lib/neutral/tag-remove-WV5RPE5W.mjs.map +0 -7
- package/dist/lib/neutral/testing/index.mjs +0 -65
- package/dist/lib/neutral/testing/index.mjs.map +0 -7
- package/dist/lib/neutral/update-tasks-HX4ILWOU.mjs +0 -46
- package/dist/lib/neutral/update-tasks-HX4ILWOU.mjs.map +0 -7
- package/dist/types/src/skills/agent/operations/add-artifact.d.ts +0 -4
- package/dist/types/src/skills/agent/operations/add-artifact.d.ts.map +0 -1
- package/dist/types/src/skills/agent/operations/agent.d.ts +0 -4
- package/dist/types/src/skills/agent/operations/agent.d.ts.map +0 -1
- package/dist/types/src/skills/agent/operations/qualifier.d.ts +0 -5
- package/dist/types/src/skills/agent/operations/qualifier.d.ts.map +0 -1
- package/dist/types/src/skills/agent/skill.test.d.ts.map +0 -1
- package/dist/types/src/skills/agent-wizard/operations/sync-triggers.d.ts +0 -8
- package/dist/types/src/skills/agent-wizard/operations/sync-triggers.d.ts.map +0 -1
- package/dist/types/src/skills/database/skill.test.d.ts +0 -2
- package/dist/types/src/skills/database/skill.test.d.ts.map +0 -1
- package/dist/types/src/skills/memory/skill.test.d.ts +0 -2
- package/dist/types/src/skills/memory/skill.test.d.ts.map +0 -1
- package/dist/types/src/skills/planning/skill.test.d.ts +0 -2
- package/dist/types/src/skills/planning/skill.test.d.ts.map +0 -1
- package/dist/types/src/types/Plan.d.ts +0 -80
- package/dist/types/src/types/Plan.d.ts.map +0 -1
- package/src/operations/run-instructions.conversations.json +0 -1
- package/src/skills/agent/operations/add-artifact.ts +0 -20
- package/src/skills/agent/operations/agent.ts +0 -69
- package/src/skills/agent/operations/qualifier.ts +0 -97
- package/src/skills/agent/skill.conversations.json +0 -1
- package/src/skills/agent/skill.test.ts +0 -728
- package/src/skills/agent-wizard/operations/sync-triggers.ts +0 -169
- package/src/skills/database/skill.conversations.json +0 -1
- package/src/skills/database/skill.test.ts +0 -531
- package/src/skills/memory/skill.conversations.json +0 -1
- package/src/skills/memory/skill.test.ts +0 -138
- package/src/skills/planning/skill.conversations.json +0 -1
- package/src/skills/planning/skill.test.ts +0 -123
- package/src/types/Plan.ts +0 -123
- /package/dist/types/src/skills/{agent → project}/skill.test.d.ts +0 -0
|
@@ -6,14 +6,15 @@ import * as Cause from 'effect/Cause';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import * as Exit from 'effect/Exit';
|
|
8
8
|
|
|
9
|
+
import { type Delegation, type DelegationStrategy } from '@dxos/agent-runtime';
|
|
9
10
|
import { AiContext } from '@dxos/assistant';
|
|
10
11
|
import { Instructions } from '@dxos/compute';
|
|
11
12
|
import { ProcessManager } from '@dxos/compute-runtime';
|
|
12
|
-
import { Database, Feed, Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
+
import { Database, Feed, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
13
14
|
import { EffectEx } from '@dxos/effect';
|
|
14
|
-
import {
|
|
15
|
+
import { EID, EntityId } from '@dxos/keys';
|
|
15
16
|
import { log } from '@dxos/log';
|
|
16
|
-
import { Message } from '@dxos/types';
|
|
17
|
+
import { Message, Outline, Task } from '@dxos/types';
|
|
17
18
|
import { trim } from '@dxos/util';
|
|
18
19
|
|
|
19
20
|
import { RunInstructions } from '../operations';
|
|
@@ -39,26 +40,29 @@ const findChatForFeed = (feed: Feed.Feed): Effect.Effect<Chat.Chat | undefined,
|
|
|
39
40
|
});
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
|
-
* Resolves the agent whose chat is backed by the given conversation feed, if any.
|
|
43
|
-
* chats yield `undefined
|
|
43
|
+
* Resolves the agent whose chat is backed by the given conversation feed, if any.
|
|
44
|
+
* Plain (agentless) chats yield `undefined`.
|
|
44
45
|
*/
|
|
45
46
|
const findAgentForFeed = (feed: Feed.Feed): Effect.Effect<Agent.Agent | undefined, never, Database.Service> =>
|
|
46
47
|
Effect.gen(function* () {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
const chat = yield* findChatForFeed(feed);
|
|
49
|
+
return chat ? yield* Agent.loadForChat(chat) : undefined;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Normalizes an LLM-reported artifact reference (bare entity id or full ECHO URI) to a
|
|
54
|
+
* fully-qualified ref in the current space. Not resolved here — it resolves lazily when read.
|
|
55
|
+
*/
|
|
56
|
+
const resolveArtifactRef = (id: string): Effect.Effect<Ref.Ref<Obj.Unknown>, Error, Database.Service> =>
|
|
57
|
+
Effect.gen(function* () {
|
|
58
|
+
const parsed = EID.tryParse(id);
|
|
59
|
+
const candidate = (parsed ? EID.getEntityId(parsed) : undefined) ?? id;
|
|
60
|
+
if (!EntityId.isValid(candidate)) {
|
|
61
|
+
// Malformed LLM-reported id: fail so the caller's `orElseSucceed` drops it.
|
|
62
|
+
return yield* Effect.fail(new Error(`Invalid artifact id: ${id}`));
|
|
60
63
|
}
|
|
61
|
-
|
|
64
|
+
const { db } = yield* Database.Service;
|
|
65
|
+
return db.makeRef<Obj.Unknown>(EID.make({ spaceId: db.spaceId, entityId: candidate }));
|
|
62
66
|
});
|
|
63
67
|
|
|
64
68
|
/**
|
|
@@ -85,10 +89,42 @@ const extractArtifactIds = (value: unknown): string[] => {
|
|
|
85
89
|
};
|
|
86
90
|
|
|
87
91
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
|
|
92
|
+
* The durable agent tasks awaiting a sub-agent for this conversation: in-progress children of the
|
|
93
|
+
* working outline's task set whose assignee is an agent. Ordinary checklist items (markdown) are
|
|
94
|
+
* never spawned — delegation happens only through the promotion the delegate-task tool performs.
|
|
95
|
+
*/
|
|
96
|
+
const findPendingTasks = (
|
|
97
|
+
chat: Chat.Chat,
|
|
98
|
+
activeIds: ReadonlySet<string>,
|
|
99
|
+
): Effect.Effect<Task.Task[], never, Database.Service> =>
|
|
100
|
+
Effect.gen(function* () {
|
|
101
|
+
const outlineRef = Chat.peekOutlineRef(chat);
|
|
102
|
+
const outline = outlineRef
|
|
103
|
+
? yield* Database.load(outlineRef).pipe(Effect.orElseSucceed(() => undefined))
|
|
104
|
+
: undefined;
|
|
105
|
+
const taskSet = outline?.taskSet
|
|
106
|
+
? yield* Database.load(outline.taskSet).pipe(Effect.orElseSucceed(() => undefined))
|
|
107
|
+
: undefined;
|
|
108
|
+
if (!taskSet) {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
const children = yield* Database.query(Query.select(Filter.id(taskSet.id)).children()).run.pipe(
|
|
112
|
+
Effect.orElseSucceed(() => []),
|
|
113
|
+
);
|
|
114
|
+
return children.filter(
|
|
115
|
+
(child): child is Task.Task =>
|
|
116
|
+
Obj.instanceOf(Task.Task, child) &&
|
|
117
|
+
child.assignee?.role === 'assistant' &&
|
|
118
|
+
child.status === 'in-progress' &&
|
|
119
|
+
!activeIds.has(child.id),
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Supervisor behaviour for the conversational agent: after each turn, every in-progress agent
|
|
125
|
+
* task not already running is run by a sub-agent (a synthesized minimal `Routine` executed via
|
|
126
|
+
* `RunInstructions`); on completion the task status is updated, the checklist line is checked
|
|
127
|
+
* off, and a templated message is posted back to the conversation.
|
|
92
128
|
*/
|
|
93
129
|
export const makeDelegationStrategy = (): DelegationStrategy => ({
|
|
94
130
|
reconcile: (feed, activeIds) =>
|
|
@@ -97,16 +133,8 @@ export const makeDelegationStrategy = (): DelegationStrategy => ({
|
|
|
97
133
|
if (!chat) {
|
|
98
134
|
return [];
|
|
99
135
|
}
|
|
100
|
-
const plan = chat.plan ? yield* Database.load(chat.plan).pipe(Effect.orElseSucceed(() => undefined)) : undefined;
|
|
101
|
-
if (!plan) {
|
|
102
|
-
return [];
|
|
103
|
-
}
|
|
104
136
|
|
|
105
|
-
|
|
106
|
-
// (`update-tasks`) stays in the plan but is not double-delegated.
|
|
107
|
-
const pending = plan.tasks.filter(
|
|
108
|
-
(task) => task.delegated === true && task.status === 'in-progress' && !activeIds.has(task.id),
|
|
109
|
-
);
|
|
137
|
+
const pending = yield* findPendingTasks(chat, activeIds);
|
|
110
138
|
if (pending.length === 0) {
|
|
111
139
|
return [];
|
|
112
140
|
}
|
|
@@ -145,18 +173,13 @@ export const makeDelegationStrategy = (): DelegationStrategy => ({
|
|
|
145
173
|
id: task.id,
|
|
146
174
|
spawn: Effect.gen(function* () {
|
|
147
175
|
const invoker = yield* ProcessManager.ProcessOperationInvoker.Service;
|
|
176
|
+
// The task ↔ process mapping lives runtime-side (the supervisor's activeIds keyed by
|
|
177
|
+
// task id) — nothing is stamped on the durable task.
|
|
148
178
|
const fiber = yield* invoker.invokeFiber(RunInstructions, {
|
|
149
179
|
instructions: Ref.make(instructions),
|
|
150
180
|
input: {},
|
|
151
181
|
});
|
|
152
|
-
|
|
153
|
-
Obj.update(plan, (plan) => {
|
|
154
|
-
const taskRecord = plan.tasks.find((taskRecord) => taskRecord.id === task.id);
|
|
155
|
-
if (taskRecord) {
|
|
156
|
-
taskRecord.agentPid = pid;
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
return pid;
|
|
182
|
+
return fiber.pid;
|
|
160
183
|
}),
|
|
161
184
|
});
|
|
162
185
|
}
|
|
@@ -166,30 +189,43 @@ export const makeDelegationStrategy = (): DelegationStrategy => ({
|
|
|
166
189
|
onComplete: (feed, id, exit) =>
|
|
167
190
|
Effect.gen(function* () {
|
|
168
191
|
const chat = yield* findChatForFeed(feed);
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
chat?.plan != null ? yield* Database.load(chat.plan).pipe(Effect.orElseSucceed(() => undefined)) : undefined;
|
|
192
|
+
// Reuse the chat just resolved rather than re-scanning every chat for the same feed.
|
|
193
|
+
const agent = chat ? yield* Agent.loadForChat(chat) : undefined;
|
|
172
194
|
|
|
195
|
+
// Resolve the durable task by its id and record the outcome; on success the checklist line
|
|
196
|
+
// is checked off so the markdown mirror follows the durable state.
|
|
173
197
|
let title = id;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
title = task.title;
|
|
180
|
-
}
|
|
198
|
+
const tasks = yield* Database.query(Query.select(Filter.id(id))).run.pipe(Effect.orElseSucceed(() => []));
|
|
199
|
+
const task = tasks.find((candidate): candidate is Task.Task => Obj.instanceOf(Task.Task, candidate));
|
|
200
|
+
if (task) {
|
|
201
|
+
Obj.update(task, (task) => {
|
|
202
|
+
task.status = Exit.isSuccess(exit) ? 'done' : 'failed';
|
|
181
203
|
});
|
|
204
|
+
title = task.title;
|
|
205
|
+
|
|
206
|
+
if (chat && Exit.isSuccess(exit)) {
|
|
207
|
+
const outlineRef = Chat.peekOutlineRef(chat);
|
|
208
|
+
const outline = outlineRef
|
|
209
|
+
? yield* Database.load(outlineRef).pipe(Effect.orElseSucceed(() => undefined))
|
|
210
|
+
: undefined;
|
|
211
|
+
const text = outline
|
|
212
|
+
? yield* Database.load(outline.content).pipe(Effect.orElseSucceed(() => undefined))
|
|
213
|
+
: undefined;
|
|
214
|
+
if (text) {
|
|
215
|
+
Obj.update(text, (text) => {
|
|
216
|
+
text.content = Outline.upsertChecklistItems(text.content, [{ title: task.title, done: true }]);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
182
220
|
}
|
|
183
221
|
|
|
184
|
-
//
|
|
185
|
-
// turns can reference them
|
|
186
|
-
//
|
|
222
|
+
// Surface any artifacts the sub-agent produced as inline reference blocks in the notification
|
|
223
|
+
// message, so follow-up turns can reference them (durable filing belongs to the project's
|
|
224
|
+
// collection — the agent stores no artifacts).
|
|
187
225
|
const artifactRefs: Ref.Ref<Obj.Unknown>[] = [];
|
|
188
226
|
if (agent && Exit.isSuccess(exit)) {
|
|
189
227
|
for (const artifactId of extractArtifactIds(exit.value)) {
|
|
190
|
-
const ref = yield*
|
|
191
|
-
Effect.orElseSucceed(() => undefined),
|
|
192
|
-
);
|
|
228
|
+
const ref = yield* resolveArtifactRef(artifactId).pipe(Effect.orElseSucceed(() => undefined));
|
|
193
229
|
if (ref) {
|
|
194
230
|
artifactRefs.push(ref);
|
|
195
231
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
9
|
+
import { Database, Filter, Obj, Query } from '@dxos/echo';
|
|
10
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
+
import { EntityId } from '@dxos/keys';
|
|
12
|
+
import { Text } from '@dxos/schema';
|
|
13
|
+
|
|
14
|
+
import { syncObjects } from './sync';
|
|
15
|
+
|
|
16
|
+
EntityId.dangerouslyDisableRandomness();
|
|
17
|
+
|
|
18
|
+
const TestLayer = AssistantTestLayer({ types: [Text.Text], disableLlmMemoization: true });
|
|
19
|
+
|
|
20
|
+
const SOURCE = 'test.source';
|
|
21
|
+
|
|
22
|
+
/** Detached object carrying the foreign key `syncObjects` matches on. */
|
|
23
|
+
const makeIncoming = (id: string, content: string) => {
|
|
24
|
+
const obj = Obj.make(Text.Text, { content });
|
|
25
|
+
Obj.update(obj, (obj) => {
|
|
26
|
+
Obj.getMeta(obj).keys.push({ source: SOURCE, id });
|
|
27
|
+
});
|
|
28
|
+
return obj;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
describe('syncObjects', () => {
|
|
32
|
+
it.effect(
|
|
33
|
+
'adds an object with no foreign-key match',
|
|
34
|
+
Effect.fnUntraced(
|
|
35
|
+
function* (_) {
|
|
36
|
+
const [synced] = yield* syncObjects([makeIncoming('a', 'first')], { foreignKeyId: SOURCE });
|
|
37
|
+
yield* Database.flush();
|
|
38
|
+
|
|
39
|
+
const all = yield* Database.query(Filter.type(Text.Text)).run;
|
|
40
|
+
expect(all).toHaveLength(1);
|
|
41
|
+
expect(all[0].id).toBe(synced.id);
|
|
42
|
+
expect(Obj.getKeys(synced, SOURCE)).toEqual([{ source: SOURCE, id: 'a' }]);
|
|
43
|
+
},
|
|
44
|
+
Effect.provide(TestLayer),
|
|
45
|
+
TestHelpers.provideTestContext,
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
it.effect(
|
|
50
|
+
'updates the matching object in place rather than adding a second',
|
|
51
|
+
Effect.fnUntraced(
|
|
52
|
+
function* (_) {
|
|
53
|
+
const [first] = yield* syncObjects([makeIncoming('a', 'first')], { foreignKeyId: SOURCE });
|
|
54
|
+
yield* Database.flush();
|
|
55
|
+
|
|
56
|
+
const [second] = yield* syncObjects([makeIncoming('a', 'updated')], { foreignKeyId: SOURCE });
|
|
57
|
+
yield* Database.flush();
|
|
58
|
+
|
|
59
|
+
expect(second.id).toBe(first.id);
|
|
60
|
+
|
|
61
|
+
// Queried rather than read off the returned `Obj.Unknown`, which would need a cast.
|
|
62
|
+
const all = yield* Database.query(Query.select(Filter.type(Text.Text))).run;
|
|
63
|
+
expect(all).toHaveLength(1);
|
|
64
|
+
expect(all[0].content).toBe('updated');
|
|
65
|
+
|
|
66
|
+
// The foreign key survives the copy: it is read off a detached object, so it reaches the
|
|
67
|
+
// persisted object only because assignment copies nested records by value.
|
|
68
|
+
expect(Obj.getKeys(second, SOURCE)).toEqual([{ source: SOURCE, id: 'a' }]);
|
|
69
|
+
},
|
|
70
|
+
Effect.provide(TestLayer),
|
|
71
|
+
TestHelpers.provideTestContext,
|
|
72
|
+
),
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
it.effect(
|
|
76
|
+
'replaces keys from the same source, leaving other sources intact',
|
|
77
|
+
Effect.fnUntraced(
|
|
78
|
+
function* (_) {
|
|
79
|
+
const [existing] = yield* syncObjects([makeIncoming('a', 'first')], { foreignKeyId: SOURCE });
|
|
80
|
+
Obj.update(existing, (existing) => {
|
|
81
|
+
Obj.getMeta(existing).keys.push({ source: 'other', id: 'keep-me' });
|
|
82
|
+
});
|
|
83
|
+
yield* Database.flush();
|
|
84
|
+
|
|
85
|
+
yield* syncObjects([makeIncoming('a', 'updated')], { foreignKeyId: SOURCE });
|
|
86
|
+
yield* Database.flush();
|
|
87
|
+
|
|
88
|
+
expect(Obj.getKeys(existing, SOURCE)).toEqual([{ source: SOURCE, id: 'a' }]);
|
|
89
|
+
expect(Obj.getKeys(existing, 'other')).toEqual([{ source: 'other', id: 'keep-me' }]);
|
|
90
|
+
},
|
|
91
|
+
Effect.provide(TestLayer),
|
|
92
|
+
TestHelpers.provideTestContext,
|
|
93
|
+
),
|
|
94
|
+
);
|
|
95
|
+
});
|
package/src/sync/sync.ts
CHANGED
|
@@ -84,6 +84,7 @@ const copyObjectData = (existing: Obj.Unknown, newObj: Obj.Unknown) => {
|
|
|
84
84
|
) {
|
|
85
85
|
continue;
|
|
86
86
|
}
|
|
87
|
+
|
|
87
88
|
(existing as any)[key] = (newObj as any)[key];
|
|
88
89
|
}
|
|
89
90
|
|
|
@@ -92,16 +93,17 @@ const copyObjectData = (existing: Obj.Unknown, newObj: Obj.Unknown) => {
|
|
|
92
93
|
if (typeof key !== 'string' || key === 'id') {
|
|
93
94
|
continue;
|
|
94
95
|
}
|
|
96
|
+
|
|
95
97
|
if (!(key in newObj)) {
|
|
96
98
|
delete (existing as any)[key];
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
// Update foreign keys.
|
|
102
|
+
// Update foreign keys. The push copies by value, so `existing` does not share mutable state
|
|
103
|
+
// with `newObj`.
|
|
101
104
|
for (const foreignKey of Obj.getMeta(newObj).keys) {
|
|
102
105
|
Obj.deleteKeys(existing, foreignKey.source);
|
|
103
|
-
|
|
104
|
-
Obj.getMeta(existing).keys.push({ ...foreignKey });
|
|
106
|
+
Obj.getMeta(existing).keys.push(foreignKey);
|
|
105
107
|
}
|
|
106
108
|
});
|
|
107
109
|
};
|
package/src/testing/index.ts
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { AssistantTestLayerWithTriggers } from '@dxos/agent-runtime/testing';
|
|
6
|
+
import { AiContext } from '@dxos/assistant';
|
|
7
|
+
import { SpaceProperties } from '@dxos/client-protocol';
|
|
8
|
+
import { Instructions, OperationHandlerSet, Routine, Skill, Trigger } from '@dxos/compute';
|
|
9
|
+
import { Collection, Feed, Tag } from '@dxos/echo';
|
|
10
|
+
import { Text } from '@dxos/schema';
|
|
11
|
+
import { Employer, Organization, Outline, Person, Task, TaskSet } from '@dxos/types';
|
|
12
|
+
|
|
13
|
+
import { AgentHandlers } from '../operations';
|
|
14
|
+
import { AgentWizardHandlers } from '../skills/agent-wizard/operations';
|
|
15
|
+
import { AgentSkillHandlers } from '../skills/agent/operations';
|
|
16
|
+
import { AlarmHandlers } from '../skills/alarm/operations';
|
|
17
|
+
import { DatabaseHandlers } from '../skills/database/operations';
|
|
18
|
+
import { DelegationHandlers } from '../skills/delegation/operations';
|
|
19
|
+
import { MemoryHandlers } from '../skills/memory/operations';
|
|
20
|
+
import { PlanningHandlers } from '../skills/planning/operations';
|
|
21
|
+
import { SkillManagerHandlers } from '../skills/skill-manager/operations';
|
|
22
|
+
import { Agent, Chat } from '../types';
|
|
23
|
+
import { Memory } from '../types/Memory';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Shared layer for operation tests: every handler in the package plus the types those handlers
|
|
27
|
+
* touch, with no language model. Defined once so a `.test.ts` per handler does not restate it —
|
|
28
|
+
* handler sets are lazy, so registering all of them costs nothing until one is invoked.
|
|
29
|
+
*/
|
|
30
|
+
export const OperationTestLayer = AssistantTestLayerWithTriggers({
|
|
31
|
+
operationHandlers: OperationHandlerSet.merge(
|
|
32
|
+
AgentHandlers,
|
|
33
|
+
AgentSkillHandlers,
|
|
34
|
+
AgentWizardHandlers,
|
|
35
|
+
AlarmHandlers,
|
|
36
|
+
DatabaseHandlers,
|
|
37
|
+
DelegationHandlers,
|
|
38
|
+
MemoryHandlers,
|
|
39
|
+
PlanningHandlers,
|
|
40
|
+
SkillManagerHandlers,
|
|
41
|
+
),
|
|
42
|
+
types: [
|
|
43
|
+
Agent.Agent,
|
|
44
|
+
AiContext.Binding,
|
|
45
|
+
Chat.Chat,
|
|
46
|
+
Chat.CompanionTo,
|
|
47
|
+
Collection.Collection,
|
|
48
|
+
Employer.Employer,
|
|
49
|
+
Feed.Feed,
|
|
50
|
+
Instructions.Instructions,
|
|
51
|
+
Memory,
|
|
52
|
+
Organization.Organization,
|
|
53
|
+
Person.Person,
|
|
54
|
+
Outline.Outline,
|
|
55
|
+
Routine.Routine,
|
|
56
|
+
Task.Task,
|
|
57
|
+
TaskSet.TaskSet,
|
|
58
|
+
Skill.Skill,
|
|
59
|
+
SpaceProperties,
|
|
60
|
+
Tag.Tag,
|
|
61
|
+
Text.Text,
|
|
62
|
+
Trigger.Trigger,
|
|
63
|
+
],
|
|
64
|
+
disableLlmMemoization: true,
|
|
65
|
+
});
|
package/src/types/Agent.test.ts
CHANGED
|
@@ -5,86 +5,56 @@
|
|
|
5
5
|
import { describe, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
9
|
+
import { Instructions, Skill } from '@dxos/compute';
|
|
10
|
+
import { Database, Feed, Obj, Type } from '@dxos/echo';
|
|
10
11
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
-
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
12
12
|
import { EntityId } from '@dxos/keys';
|
|
13
13
|
import { Text } from '@dxos/schema';
|
|
14
|
+
import { Outline } from '@dxos/types';
|
|
14
15
|
|
|
15
|
-
import { Agent, Chat
|
|
16
|
+
import { Agent, Chat } from '../types';
|
|
16
17
|
|
|
17
18
|
EntityId.dangerouslyDisableRandomness();
|
|
18
19
|
|
|
19
20
|
const TestLayer = AssistantTestLayer({
|
|
20
|
-
types: [
|
|
21
|
+
types: [
|
|
22
|
+
Agent.Agent,
|
|
23
|
+
Outline.Outline,
|
|
24
|
+
Chat.Chat,
|
|
25
|
+
Chat.CompanionTo,
|
|
26
|
+
Skill.Skill,
|
|
27
|
+
Feed.Feed,
|
|
28
|
+
Text.Text,
|
|
29
|
+
Instructions.Instructions,
|
|
30
|
+
],
|
|
21
31
|
disableLlmMemoization: true,
|
|
22
32
|
});
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
return yield* Agent.makeInitialized(
|
|
26
|
-
{ name: 'Test', instructions: '' },
|
|
27
|
-
Skill.make({ key: 'org.dxos.test.skill', name: 'Test' }),
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
describe('Agent.addArtifact', () => {
|
|
32
|
-
// The id forms a tool may hand back: a bare entity id, or a fully-qualified ECHO URI. LLMs commonly
|
|
33
|
-
// strip a returned URI down to the bare id, so both must resolve.
|
|
34
|
-
it.scoped(
|
|
35
|
-
'adds a freshly-created object by bare entity id',
|
|
36
|
-
Effect.fnUntraced(
|
|
37
|
-
function* ({ expect }) {
|
|
38
|
-
const agent = yield* makeAgent();
|
|
39
|
-
const doc = yield* Database.add(Text.make({ content: 'hello' }));
|
|
40
|
-
|
|
41
|
-
yield* Agent.addArtifact(agent, { name: 'Doc', id: doc.id });
|
|
42
|
-
|
|
43
|
-
expect(agent.artifacts).toHaveLength(1);
|
|
44
|
-
expect(agent.artifacts[0]!.name).toBe('Doc');
|
|
45
|
-
const loaded = yield* Database.load(agent.artifacts[0]!.data);
|
|
46
|
-
expect(loaded.id).toBe(doc.id);
|
|
47
|
-
},
|
|
48
|
-
Effect.provide(TestLayer),
|
|
49
|
-
TestHelpers.provideTestContext,
|
|
50
|
-
),
|
|
51
|
-
);
|
|
52
|
-
|
|
34
|
+
describe('Agent (0.2.0)', () => {
|
|
53
35
|
it.scoped(
|
|
54
|
-
'
|
|
36
|
+
'makeInitialized creates the identity/preset shape',
|
|
55
37
|
Effect.fnUntraced(
|
|
56
38
|
function* ({ expect }) {
|
|
57
|
-
const agent = yield*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
function* ({ expect }) {
|
|
77
|
-
const agent = yield* makeAgent();
|
|
78
|
-
const doc = yield* Database.add(Text.make({ content: 'later' }));
|
|
79
|
-
const bareId = doc.id;
|
|
80
|
-
|
|
81
|
-
// Add by bare id; the helper must not require the artifact to be resolvable at add time.
|
|
82
|
-
yield* Agent.addArtifact(agent, { name: 'Doc', id: bareId });
|
|
83
|
-
expect(agent.artifacts).toHaveLength(1);
|
|
84
|
-
|
|
85
|
-
// The stored ref still resolves to the object.
|
|
86
|
-
const loaded = yield* Database.load(agent.artifacts[0]!.data);
|
|
87
|
-
expect(loaded.id).toBe(doc.id);
|
|
39
|
+
const agent = yield* Agent.makeInitialized(
|
|
40
|
+
{ name: 'Test', instructions: 'Do the thing.' },
|
|
41
|
+
Skill.make({ key: 'org.dxos.test.skill', name: 'Test' }),
|
|
42
|
+
);
|
|
43
|
+
yield* Database.flush();
|
|
44
|
+
|
|
45
|
+
expect(Type.getVersion(Agent.Agent)).toBe('0.2.0');
|
|
46
|
+
const { text, instructions } = yield* Agent.loadInstructions(agent);
|
|
47
|
+
expect(text).toBe('Do the thing.');
|
|
48
|
+
expect(Obj.getParent(instructions)).toBe(agent);
|
|
49
|
+
|
|
50
|
+
// The relation carries the linkage in both directions; the agent owns no conversation state.
|
|
51
|
+
const chat = yield* Agent.loadChat(agent);
|
|
52
|
+
expect(chat).toBeDefined();
|
|
53
|
+
expect(chat?.instructions?.uri).toBe(agent.instructions.uri);
|
|
54
|
+
|
|
55
|
+
// Compare by id: the two query paths may resolve distinct proxy instances.
|
|
56
|
+
const linkedAgent = chat ? yield* Agent.loadForChat(chat) : undefined;
|
|
57
|
+
expect(linkedAgent?.id).toBe(agent.id);
|
|
88
58
|
},
|
|
89
59
|
Effect.provide(TestLayer),
|
|
90
60
|
TestHelpers.provideTestContext,
|