@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,44 +6,36 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Operation } from '@dxos/compute';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { Outline } from '@dxos/types';
|
|
9
10
|
import { trim } from '@dxos/util';
|
|
10
11
|
|
|
11
|
-
import { Chat
|
|
12
|
+
import { Chat } from '../../../types';
|
|
12
13
|
import { UpdateTasks } from './definitions';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* Upserts checklist items into the conversation's working outline (markdown `- [ ]` lines,
|
|
17
|
+
* matched by title). The outline is the cheap, fluid form of work — durable Task objects are
|
|
18
|
+
* created by promotion/delegation, not here.
|
|
16
19
|
*/
|
|
17
20
|
export default UpdateTasks.pipe(
|
|
18
21
|
Operation.withHandler(
|
|
19
|
-
Effect.fnUntraced(function* ({ tasks
|
|
22
|
+
Effect.fnUntraced(function* ({ tasks }) {
|
|
20
23
|
const chat = yield* Chat.getFromContext;
|
|
21
|
-
|
|
22
|
-
// TODO(burdon): How to report non-technical error?
|
|
23
|
-
const plan = yield* Chat.ensurePlan(chat);
|
|
24
|
+
const { text } = yield* Chat.ensureOutlineText(chat);
|
|
24
25
|
|
|
25
|
-
Obj.update(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
existingTask.status = task.status;
|
|
31
|
-
} else {
|
|
32
|
-
plan.tasks.push({
|
|
33
|
-
id: task.id,
|
|
34
|
-
title: task.title,
|
|
35
|
-
status: task.status,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
26
|
+
Obj.update(text, (text) => {
|
|
27
|
+
text.content = Outline.upsertChecklistItems(
|
|
28
|
+
text.content,
|
|
29
|
+
tasks.map(({ title, status }) => ({ title, done: status === 'done' })),
|
|
30
|
+
);
|
|
39
31
|
});
|
|
40
32
|
|
|
41
33
|
return trim`
|
|
42
|
-
You must update
|
|
43
|
-
Current
|
|
44
|
-
<
|
|
45
|
-
${
|
|
46
|
-
</
|
|
34
|
+
You must update a task to 'done' when complete, and keep exactly one task in progress.
|
|
35
|
+
Current checklist:
|
|
36
|
+
<checklist>
|
|
37
|
+
${text.content}
|
|
38
|
+
</checklist>
|
|
47
39
|
`;
|
|
48
40
|
}),
|
|
49
41
|
),
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Collection, Database, Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { EID } from '@dxos/keys';
|
|
10
|
+
|
|
11
|
+
import { ArtifactAdd } from './definitions';
|
|
12
|
+
|
|
13
|
+
/** Compare refs by entity id when possible — space-qualified and local URIs may name the same object. */
|
|
14
|
+
const refKey = (ref: Ref.Ref<Obj.Unknown>): string => {
|
|
15
|
+
const eid = EID.tryParse(ref.uri);
|
|
16
|
+
return (eid && EID.getEntityId(eid)) ?? ref.uri;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const handler: Operation.WithHandler<typeof ArtifactAdd> = ArtifactAdd.pipe(
|
|
20
|
+
Operation.withHandler(
|
|
21
|
+
Effect.fn(function* ({ project: projectRef, object: objectRef }) {
|
|
22
|
+
const project = yield* Database.load(projectRef);
|
|
23
|
+
|
|
24
|
+
// Projects normally own an artifacts collection from creation; materialize one for those that don't.
|
|
25
|
+
let collection: Collection.Collection;
|
|
26
|
+
if (project.artifacts) {
|
|
27
|
+
collection = yield* Database.load(project.artifacts);
|
|
28
|
+
} else {
|
|
29
|
+
collection = yield* Database.add(Collection.make());
|
|
30
|
+
Obj.setParent(collection, project);
|
|
31
|
+
Obj.update(project, (project) => {
|
|
32
|
+
project.artifacts = Ref.make(collection);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (!collection.objects.some((ref) => refKey(ref) === refKey(objectRef))) {
|
|
37
|
+
Obj.update(collection, (collection) => {
|
|
38
|
+
collection.objects.push(objectRef);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
yield* Database.flush();
|
|
43
|
+
}),
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export default handler;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Obj } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { ArtifactList } from './definitions';
|
|
11
|
+
|
|
12
|
+
const handler: Operation.WithHandler<typeof ArtifactList> = ArtifactList.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ project: projectRef }) {
|
|
15
|
+
const project = yield* Database.load(projectRef);
|
|
16
|
+
if (!project.artifacts) {
|
|
17
|
+
return { artifacts: [] };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const collection = yield* Database.load(project.artifacts);
|
|
21
|
+
const artifacts = yield* Effect.forEach(collection.objects, (ref) =>
|
|
22
|
+
Database.load(ref).pipe(
|
|
23
|
+
Effect.map((object) => ({
|
|
24
|
+
dxn: Obj.getURI(object),
|
|
25
|
+
typename: Obj.getTypename(object),
|
|
26
|
+
label: Obj.getLabel(object),
|
|
27
|
+
})),
|
|
28
|
+
// A broken ref yields a placeholder row rather than failing the whole listing; other
|
|
29
|
+
// load failures (transport, decoding) still propagate.
|
|
30
|
+
Effect.catchTag('EntityNotFoundError', () =>
|
|
31
|
+
Effect.succeed({ dxn: ref.uri, typename: undefined, label: undefined }),
|
|
32
|
+
),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return { artifacts };
|
|
37
|
+
}),
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export default handler;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { Operation, Project } from '@dxos/compute';
|
|
8
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { DXN } from '@dxos/keys';
|
|
10
|
+
import { trim } from '@dxos/util';
|
|
11
|
+
|
|
12
|
+
export const ArtifactAdd = Operation.make({
|
|
13
|
+
meta: {
|
|
14
|
+
key: DXN.make('org.dxos.function.project.artifactAdd'),
|
|
15
|
+
name: 'Add project artifact',
|
|
16
|
+
icon: 'ph--stack-plus--regular',
|
|
17
|
+
description: trim`
|
|
18
|
+
Files an object into a project's artifacts collection.
|
|
19
|
+
Use this after creating an object (document, outline, sheet, contact, …) while working in a
|
|
20
|
+
project's context, so the project owns it and it appears in the project's artifacts list.
|
|
21
|
+
Adding the same object twice is a no-op.
|
|
22
|
+
`,
|
|
23
|
+
},
|
|
24
|
+
input: Schema.Struct({
|
|
25
|
+
project: Ref.Ref(Project.Project).annotations({
|
|
26
|
+
description: 'The project to file into (its reference is in the chat context).',
|
|
27
|
+
}),
|
|
28
|
+
object: Ref.Ref(Obj.Unknown).annotations({
|
|
29
|
+
description: 'The object to file as an artifact.',
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
output: Schema.Void,
|
|
33
|
+
services: [Database.Service],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/** One artifact row: enough to identify and load the object, without inlining its content. */
|
|
37
|
+
export const ArtifactInfo = Schema.Struct({
|
|
38
|
+
dxn: Schema.String,
|
|
39
|
+
typename: Schema.optional(Schema.String),
|
|
40
|
+
label: Schema.optional(Schema.String),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const ArtifactList = Operation.make({
|
|
44
|
+
meta: {
|
|
45
|
+
key: DXN.make('org.dxos.function.project.artifactList'),
|
|
46
|
+
name: 'List project artifacts',
|
|
47
|
+
icon: 'ph--stack--regular',
|
|
48
|
+
description: trim`
|
|
49
|
+
Lists the objects in a project's artifacts collection (DXN, type, and label per artifact).
|
|
50
|
+
Use this to find what the project already holds before searching the whole space; load an
|
|
51
|
+
artifact's content with the load tool when needed.
|
|
52
|
+
`,
|
|
53
|
+
},
|
|
54
|
+
input: Schema.Struct({
|
|
55
|
+
project: Ref.Ref(Project.Project).annotations({
|
|
56
|
+
description: 'The project whose artifacts to list (its reference is in the chat context).',
|
|
57
|
+
}),
|
|
58
|
+
}),
|
|
59
|
+
output: Schema.Struct({
|
|
60
|
+
artifacts: Schema.Array(ArtifactInfo),
|
|
61
|
+
}),
|
|
62
|
+
services: [Database.Service],
|
|
63
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
|
+
|
|
7
|
+
export * as ProjectOperations from './definitions';
|
|
8
|
+
|
|
9
|
+
export const ProjectHandlers = OperationHandlerSet.lazy(
|
|
10
|
+
() => import('./artifact-add'),
|
|
11
|
+
() => import('./artifact-list'),
|
|
12
|
+
);
|
|
@@ -0,0 +1,78 @@
|
|
|
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 { Instructions, Project } from '@dxos/compute';
|
|
9
|
+
import { Collection, Database, Obj, Ref } from '@dxos/echo';
|
|
10
|
+
import { TestDatabaseLayer } from '@dxos/echo-client/testing';
|
|
11
|
+
import { Text } from '@dxos/schema';
|
|
12
|
+
|
|
13
|
+
import artifactAdd from './operations/artifact-add';
|
|
14
|
+
import artifactList from './operations/artifact-list';
|
|
15
|
+
|
|
16
|
+
const testLayer = () =>
|
|
17
|
+
TestDatabaseLayer({
|
|
18
|
+
types: [Project.Project, Instructions.Instructions, Collection.Collection, Text.Text],
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('project skill operations', () => {
|
|
22
|
+
it.effect('artifact-add files into the project collection; adding twice is a no-op', () =>
|
|
23
|
+
Effect.gen(function* () {
|
|
24
|
+
const collection = yield* Database.add(Collection.make());
|
|
25
|
+
const project = yield* Database.add(Project.make({ name: 'Voyage', artifacts: Ref.make(collection) }));
|
|
26
|
+
const doc = yield* Database.add(Text.make({ content: 'notes' }));
|
|
27
|
+
yield* Database.flush();
|
|
28
|
+
|
|
29
|
+
yield* artifactAdd.handler({ project: Ref.make(project), object: Ref.make(doc) });
|
|
30
|
+
expect(collection.objects).toHaveLength(1);
|
|
31
|
+
|
|
32
|
+
yield* artifactAdd.handler({ project: Ref.make(project), object: Ref.make(doc) });
|
|
33
|
+
expect(collection.objects).toHaveLength(1);
|
|
34
|
+
}).pipe(Effect.provide(testLayer())),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
it.effect('artifact-add materializes a collection for a project without one', () =>
|
|
38
|
+
Effect.gen(function* () {
|
|
39
|
+
const project = yield* Database.add(Project.make({ name: 'Bare' }));
|
|
40
|
+
const doc = yield* Database.add(Text.make({ content: 'notes' }));
|
|
41
|
+
yield* Database.flush();
|
|
42
|
+
|
|
43
|
+
yield* artifactAdd.handler({ project: Ref.make(project), object: Ref.make(doc) });
|
|
44
|
+
const artifactsRef = project.artifacts;
|
|
45
|
+
expect(artifactsRef).toBeDefined();
|
|
46
|
+
if (!artifactsRef) {
|
|
47
|
+
throw new Error('unreachable');
|
|
48
|
+
}
|
|
49
|
+
const collection = yield* Database.load(artifactsRef);
|
|
50
|
+
expect(collection.objects).toHaveLength(1);
|
|
51
|
+
}).pipe(Effect.provide(testLayer())),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
it.effect('artifact-list returns dxn, typename, and label per artifact', () =>
|
|
55
|
+
Effect.gen(function* () {
|
|
56
|
+
const doc = yield* Database.add(Text.make({ content: 'notes' }));
|
|
57
|
+
const collection = yield* Database.add(Collection.make({ objects: [Ref.make(doc)] }));
|
|
58
|
+
const project = yield* Database.add(Project.make({ name: 'Voyage', artifacts: Ref.make(collection) }));
|
|
59
|
+
yield* Database.flush();
|
|
60
|
+
|
|
61
|
+
const { artifacts } = yield* artifactList.handler({ project: Ref.make(project) });
|
|
62
|
+
expect(artifacts).toHaveLength(1);
|
|
63
|
+
expect(artifacts[0].dxn).toBe(Obj.getURI(doc));
|
|
64
|
+
expect(artifacts[0].typename).toBe('org.dxos.type.text');
|
|
65
|
+
expect(artifacts[0].label).toBe(Obj.getLabel(doc));
|
|
66
|
+
}).pipe(Effect.provide(testLayer())),
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
it.effect('artifact-list is empty for a project without a collection', () =>
|
|
70
|
+
Effect.gen(function* () {
|
|
71
|
+
const project = yield* Database.add(Project.make({ name: 'Bare' }));
|
|
72
|
+
yield* Database.flush();
|
|
73
|
+
|
|
74
|
+
const { artifacts } = yield* artifactList.handler({ project: Ref.make(project) });
|
|
75
|
+
expect(artifacts).toEqual([]);
|
|
76
|
+
}).pipe(Effect.provide(testLayer())),
|
|
77
|
+
);
|
|
78
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Skill } from '@dxos/compute';
|
|
6
|
+
import { Ref } from '@dxos/echo';
|
|
7
|
+
import { Text } from '@dxos/schema';
|
|
8
|
+
import { trim } from '@dxos/util';
|
|
9
|
+
|
|
10
|
+
import { ArtifactAdd, ArtifactList } from './operations/definitions';
|
|
11
|
+
|
|
12
|
+
const SKILL_KEY = 'org.dxos.skill.project';
|
|
13
|
+
|
|
14
|
+
const instructions = trim`
|
|
15
|
+
You are working in the context of a project (its reference is bound into this chat).
|
|
16
|
+
The project owns a collection of artifacts: the durable work products of this project.
|
|
17
|
+
When you create an object the user asked for (a document, outline, sheet, contact, …), file it
|
|
18
|
+
into the project's artifacts with the add-artifact tool so the project owns it.
|
|
19
|
+
When looking for the project's existing material, list its artifacts first rather than searching
|
|
20
|
+
the whole space.
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
const make = () =>
|
|
24
|
+
Skill.make({
|
|
25
|
+
key: SKILL_KEY,
|
|
26
|
+
name: 'Project',
|
|
27
|
+
description: "Manage a project's artifacts: file created objects and find existing ones.",
|
|
28
|
+
agentCanEnable: true,
|
|
29
|
+
instructions: {
|
|
30
|
+
source: Ref.make(Text.make({ content: instructions })),
|
|
31
|
+
},
|
|
32
|
+
tools: Skill.toolDefinitions({
|
|
33
|
+
operations: [ArtifactAdd, ArtifactList],
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const skill: Skill.Definition = {
|
|
38
|
+
key: SKILL_KEY,
|
|
39
|
+
make,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default skill;
|
|
@@ -26,7 +26,7 @@ export const EnableSkills = Operation.make({
|
|
|
26
26
|
key: DXN.make('org.dxos.function.skillManager.enableSkills'),
|
|
27
27
|
name: 'Enable skills',
|
|
28
28
|
description:
|
|
29
|
-
'Enables skills in the current conversation by their keys. Only skills with agentCanEnable=true can be enabled.
|
|
29
|
+
'Enables skills in the current conversation by their keys. Only skills with agentCanEnable=true can be enabled. The available keys are already listed in the system prompt, so call this directly rather than querying first.',
|
|
30
30
|
icon: 'ph--plugs-connected--regular',
|
|
31
31
|
},
|
|
32
32
|
input: Schema.Struct({
|
|
@@ -7,12 +7,12 @@ import * as Context from 'effect/Context';
|
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
import * as Layer from 'effect/Layer';
|
|
9
9
|
|
|
10
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
10
11
|
import { AiContext, Harness } from '@dxos/assistant';
|
|
11
12
|
import { Operation, Skill } from '@dxos/compute';
|
|
12
13
|
import { Database, Feed, Obj } from '@dxos/echo';
|
|
13
14
|
import { EffectEx } from '@dxos/effect';
|
|
14
15
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
15
|
-
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
16
16
|
import { EntityId, type URI } from '@dxos/keys';
|
|
17
17
|
|
|
18
18
|
import { DatabaseSkill, DiscordSkill, MemorySkill } from '../index';
|
|
@@ -17,10 +17,10 @@ const make = () =>
|
|
|
17
17
|
description: 'Query and enable skills in the current conversation.',
|
|
18
18
|
instructions: Template.make({
|
|
19
19
|
source: trim`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
The list below is the current set of available skills — it is rendered fresh into this prompt,
|
|
21
|
+
so do NOT call [query-skills] to obtain it. Call [enable-skills] directly with the keys you
|
|
22
|
+
need; only skills marked [agent-can-enable] can be enabled by the agent.
|
|
23
|
+
Reach for [query-skills] only to re-read the list after something has changed it.
|
|
24
24
|
|
|
25
25
|
<available_skills>
|
|
26
26
|
{{#each skills}}
|
|
@@ -28,7 +28,9 @@ const make = () =>
|
|
|
28
28
|
{{/each}}
|
|
29
29
|
</available_skills>
|
|
30
30
|
|
|
31
|
-
NOTE:
|
|
31
|
+
NOTE: A skill's tools only appear once it is enabled. Skills already enabled in this
|
|
32
|
+
conversation expose their tools to you directly — do not re-enable a skill whose tools you
|
|
33
|
+
can already see.
|
|
32
34
|
`,
|
|
33
35
|
inputs: [
|
|
34
36
|
{
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import { describe, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
+
import { AgentService } from '@dxos/agent-runtime';
|
|
9
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
8
10
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
9
|
-
import { AgentService } from '@dxos/functions-runtime';
|
|
10
|
-
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
11
11
|
|
|
12
12
|
import { WebSearchHandlers } from './operations';
|
|
13
13
|
import WebSearchSkill from './skill';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { AssistantTestLayer, collectEphemeral, messageTextIncludes, waitForMessage } from '@dxos/agent-runtime/testing';
|
|
9
|
+
import { ScriptedLanguageModel } from '@dxos/ai/testing';
|
|
10
|
+
import { AiContext } from '@dxos/assistant';
|
|
11
|
+
import { getSession } from '@dxos/compute/AgentService';
|
|
12
|
+
import { Database, Filter, Obj, Query } from '@dxos/echo';
|
|
13
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
14
|
+
import { invariant } from '@dxos/invariant';
|
|
15
|
+
import { EntityId } from '@dxos/keys';
|
|
16
|
+
import { Text } from '@dxos/schema';
|
|
17
|
+
import { Message, Outline, Task, TaskSet } from '@dxos/types';
|
|
18
|
+
|
|
19
|
+
import { AgentHandlers } from '../operations';
|
|
20
|
+
import { DelegationHandlers, DelegationSkill } from '../skills';
|
|
21
|
+
import { Agent, Chat } from '../types';
|
|
22
|
+
import { makeDelegationStrategy } from './delegation-strategy';
|
|
23
|
+
|
|
24
|
+
const { text, toolCall, promptIncludes, scriptedAiService } = ScriptedLanguageModel;
|
|
25
|
+
|
|
26
|
+
EntityId.dangerouslyDisableRandomness();
|
|
27
|
+
|
|
28
|
+
const TASK_TITLE = 'Compute 10 factorial';
|
|
29
|
+
|
|
30
|
+
// Two cooperating sessions share one scripted service: the sub-agent's `RunInstructions` system
|
|
31
|
+
// prompt is the discriminator (only sub-agents run in "non-interactive mode"); the supervisor is
|
|
32
|
+
// the fallback route. Each route consumes its own cursor, so supervisor turns are unaffected by
|
|
33
|
+
// when the sub-agent runs.
|
|
34
|
+
const TestLayer = AssistantTestLayer({
|
|
35
|
+
agent: { delegationStrategy: makeDelegationStrategy() },
|
|
36
|
+
aiService: scriptedAiService([
|
|
37
|
+
{
|
|
38
|
+
name: 'sub-agent',
|
|
39
|
+
match: promptIncludes('non-interactive mode'),
|
|
40
|
+
turns: [{ parts: [toolCall('completeJob', { success: '3628800' })] }, { parts: [text('Done.')] }],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'supervisor',
|
|
44
|
+
match: () => true,
|
|
45
|
+
turns: [
|
|
46
|
+
// Immediate reply + delegation in one turn: the user sees the reply while the work runs.
|
|
47
|
+
{
|
|
48
|
+
parts: [text('On it — delegating.'), toolCall('delegate-task', { title: TASK_TITLE })],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
parts: [text('Delegated. I will report back when it completes.')],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
]),
|
|
56
|
+
operationHandlers: [DelegationHandlers, AgentHandlers],
|
|
57
|
+
skills: [DelegationSkill.make()],
|
|
58
|
+
types: [
|
|
59
|
+
Agent.Agent,
|
|
60
|
+
Outline.Outline,
|
|
61
|
+
Task.Task,
|
|
62
|
+
TaskSet.TaskSet,
|
|
63
|
+
Chat.Chat,
|
|
64
|
+
Chat.CompanionTo,
|
|
65
|
+
AiContext.Binding,
|
|
66
|
+
Text.Text,
|
|
67
|
+
Message.Message,
|
|
68
|
+
],
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe('makeDelegationStrategy', () => {
|
|
72
|
+
it.scoped(
|
|
73
|
+
'replies immediately, delegates to a sub-agent, and folds the result back',
|
|
74
|
+
Effect.fnUntraced(
|
|
75
|
+
function* ({ expect }) {
|
|
76
|
+
const agent = yield* Agent.makeInitialized(
|
|
77
|
+
{
|
|
78
|
+
name: 'Supervisor',
|
|
79
|
+
instructions: 'You delegate units of work to sub-agents using the available tools.',
|
|
80
|
+
},
|
|
81
|
+
DelegationSkill.make(),
|
|
82
|
+
);
|
|
83
|
+
yield* Database.flush();
|
|
84
|
+
|
|
85
|
+
const chat = yield* Agent.loadChat(agent);
|
|
86
|
+
invariant(chat, 'Agent chat not found.');
|
|
87
|
+
const feed = yield* Database.load(chat.feed);
|
|
88
|
+
|
|
89
|
+
const session = yield* getSession(feed);
|
|
90
|
+
const ephemeral = yield* collectEphemeral(session);
|
|
91
|
+
|
|
92
|
+
yield* session.submitPrompt('Delegate a task to a sub-agent to compute 10 factorial.');
|
|
93
|
+
// Settles on the turn's reply; the delegated child runs in the background.
|
|
94
|
+
yield* session.waitForCompletion();
|
|
95
|
+
|
|
96
|
+
// The immediate reply streamed before the sub-agent produced anything.
|
|
97
|
+
const streamedText = ephemeral
|
|
98
|
+
.partialBlocks()
|
|
99
|
+
.map(({ block }) => (block._tag === 'text' ? block.text : ''))
|
|
100
|
+
.join('');
|
|
101
|
+
expect(streamedText).toContain('On it');
|
|
102
|
+
|
|
103
|
+
// DelegateTask promoted the work to a durable agent task under the outline's task set.
|
|
104
|
+
const outlineAfterTurn = chat.outline ? yield* Database.load(chat.outline) : undefined;
|
|
105
|
+
invariant(outlineAfterTurn, 'Outline not created.');
|
|
106
|
+
const taskSet = outlineAfterTurn.taskSet ? yield* Database.load(outlineAfterTurn.taskSet) : undefined;
|
|
107
|
+
invariant(taskSet, 'Task set not created.');
|
|
108
|
+
const children = yield* Database.query(Query.select(Filter.id(taskSet.id)).children()).run;
|
|
109
|
+
const tasks = children.filter((child): child is Task.Task => Obj.instanceOf(Task.Task, child));
|
|
110
|
+
expect(tasks).toHaveLength(1);
|
|
111
|
+
expect(tasks[0]).toMatchObject({ title: TASK_TITLE, assignee: { role: 'assistant' } });
|
|
112
|
+
|
|
113
|
+
// The post-turn reconcile spawned the sub-agent; its exit drives onComplete, which posts
|
|
114
|
+
// the fold-back message to the conversation feed out of band.
|
|
115
|
+
const notification = yield* waitForMessage(feed, messageTextIncludes('The sub-agent completed'));
|
|
116
|
+
expect(Message.extractText(notification)).toContain(TASK_TITLE);
|
|
117
|
+
expect(Message.extractText(notification)).toContain('3628800');
|
|
118
|
+
|
|
119
|
+
// ...marked the durable task done and checked off the checklist line.
|
|
120
|
+
expect(tasks[0].status).toEqual('done');
|
|
121
|
+
const outlineText = yield* Database.load(outlineAfterTurn.content);
|
|
122
|
+
expect(Outline.parseChecklist(outlineText.content)).toEqual([{ title: TASK_TITLE, done: true }]);
|
|
123
|
+
},
|
|
124
|
+
Effect.provide(TestLayer),
|
|
125
|
+
TestHelpers.provideTestContext,
|
|
126
|
+
),
|
|
127
|
+
{ timeout: 30_000 },
|
|
128
|
+
);
|
|
129
|
+
});
|