@dxos/assistant-toolkit 0.10.0 → 0.11.0
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
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { Database, Filter, JsonSchema, Query, Scope, Type } from '@dxos/echo';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { EntityId } from '@dxos/keys';
|
|
13
|
+
|
|
14
|
+
import { OperationTestLayer } from '../../../testing';
|
|
15
|
+
import { SchemaAdd } from './definitions';
|
|
16
|
+
|
|
17
|
+
EntityId.dangerouslyDisableRandomness();
|
|
18
|
+
|
|
19
|
+
// A representative draft-07 JSON Schema as a model would emit for the `add-schema` tool.
|
|
20
|
+
const PROJECT_JSON_SCHEMA = {
|
|
21
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
22
|
+
type: 'object',
|
|
23
|
+
title: 'Project',
|
|
24
|
+
properties: {
|
|
25
|
+
name: { type: 'string' },
|
|
26
|
+
description: { type: 'string' },
|
|
27
|
+
status: { type: 'string' },
|
|
28
|
+
},
|
|
29
|
+
required: ['name'],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
describe('SchemaAdd', () => {
|
|
33
|
+
it.effect(
|
|
34
|
+
'schema-add: requires jsonSchema to be an object',
|
|
35
|
+
Effect.fnUntraced(function* (_) {
|
|
36
|
+
// The tool parameter is typed as an object so the model emits the JSON Schema as an object.
|
|
37
|
+
// An unconstrained parameter let some models emit a JSON-encoded string, which then corrupted
|
|
38
|
+
// the created type; a non-object is now rejected at the tool-call boundary.
|
|
39
|
+
const decode = Schema.decodeUnknown(SchemaAdd.input);
|
|
40
|
+
const base = { name: 'Project', typename: 'com.example.type.project' };
|
|
41
|
+
|
|
42
|
+
const fromObject = yield* decode({ ...base, jsonSchema: PROJECT_JSON_SCHEMA });
|
|
43
|
+
expect(fromObject.jsonSchema).toEqual(PROJECT_JSON_SCHEMA);
|
|
44
|
+
|
|
45
|
+
const fromString = yield* Effect.either(decode({ ...base, jsonSchema: JSON.stringify(PROJECT_JSON_SCHEMA) }));
|
|
46
|
+
expect(fromString._tag).toBe('Left');
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
it.effect(
|
|
51
|
+
'schema-add: creates a schema with the declared fields',
|
|
52
|
+
Effect.fnUntraced(
|
|
53
|
+
function* (_) {
|
|
54
|
+
// Run the handler and assert the created type carries the declared fields, not merely that a
|
|
55
|
+
// type with the typename exists.
|
|
56
|
+
yield* Operation.invoke(SchemaAdd, {
|
|
57
|
+
name: 'Project',
|
|
58
|
+
typename: 'com.example.type.project',
|
|
59
|
+
jsonSchema: PROJECT_JSON_SCHEMA,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const allTypes = yield* Database.query(
|
|
63
|
+
Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
64
|
+
).run;
|
|
65
|
+
const schemas = allTypes.filter((type) => Type.getTypename(type) === 'com.example.type.project');
|
|
66
|
+
expect(schemas).toHaveLength(1);
|
|
67
|
+
expectSchemaProperties(schemas[0], ['name', 'description', 'status']);
|
|
68
|
+
},
|
|
69
|
+
Effect.provide(OperationTestLayer),
|
|
70
|
+
TestHelpers.provideTestContext,
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// Asserts that the type's JSON Schema declares (at least) the given property names.
|
|
76
|
+
const expectSchemaProperties = (schema: Parameters<typeof JsonSchema.toJsonSchema>[0], expectedKeys: string[]) => {
|
|
77
|
+
const properties = JsonSchema.toJsonSchema(schema).properties ?? {};
|
|
78
|
+
expect(Object.keys(properties)).toEqual(expect.arrayContaining(expectedKeys));
|
|
79
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Operation, Skill } from '@dxos/compute';
|
|
10
|
+
import { Feed, Type } from '@dxos/echo';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { EntityId } from '@dxos/keys';
|
|
13
|
+
import { Employer, Organization, Person } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { OperationTestLayer } from '../../../testing';
|
|
16
|
+
import { SchemaList } from './definitions';
|
|
17
|
+
|
|
18
|
+
EntityId.dangerouslyDisableRandomness();
|
|
19
|
+
|
|
20
|
+
describe('SchemaList', () => {
|
|
21
|
+
it.effect(
|
|
22
|
+
'schema-list: lists registered types and omits the excluded ones',
|
|
23
|
+
Effect.fnUntraced(
|
|
24
|
+
function* (_) {
|
|
25
|
+
const schemas = yield* Operation.invoke(SchemaList, {});
|
|
26
|
+
|
|
27
|
+
const rows = yield* Schema.decodeUnknown(
|
|
28
|
+
Schema.Array(Schema.Struct({ typename: Schema.String, kind: Schema.String })),
|
|
29
|
+
)(schemas);
|
|
30
|
+
const typenames = rows.map((row) => row.typename);
|
|
31
|
+
expect(typenames).toContain(Type.getTypename(Organization.Organization));
|
|
32
|
+
expect(typenames).toContain(Type.getTypename(Person.Person));
|
|
33
|
+
// Skill and Feed are on the handler's exclusion list, which keeps them out of the agent's context.
|
|
34
|
+
expect(typenames).not.toContain(Type.getTypename(Skill.Skill));
|
|
35
|
+
expect(typenames).not.toContain(Type.getTypename(Feed.Feed));
|
|
36
|
+
expect(rows.find((row) => row.typename === Type.getTypename(Employer.Employer))?.kind).toBe('relation');
|
|
37
|
+
},
|
|
38
|
+
Effect.provide(OperationTestLayer),
|
|
39
|
+
TestHelpers.provideTestContext,
|
|
40
|
+
),
|
|
41
|
+
);
|
|
42
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Obj, Ref, Tag } from '@dxos/echo';
|
|
10
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
+
import { EID, EntityId } from '@dxos/keys';
|
|
12
|
+
import { Organization } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { OperationTestLayer } from '../../../testing';
|
|
15
|
+
import { TagAdd } from './definitions';
|
|
16
|
+
|
|
17
|
+
EntityId.dangerouslyDisableRandomness();
|
|
18
|
+
|
|
19
|
+
describe('TagAdd', () => {
|
|
20
|
+
it.effect(
|
|
21
|
+
'tag-add: attaches the tag to the object',
|
|
22
|
+
Effect.fnUntraced(
|
|
23
|
+
function* (_) {
|
|
24
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Tagged Corp' }));
|
|
25
|
+
const tag = yield* Database.add(Tag.make({ label: 'important' }));
|
|
26
|
+
yield* Database.flush();
|
|
27
|
+
|
|
28
|
+
yield* Operation.invoke(TagAdd, { tag: Ref.make(tag), obj: Ref.make(organization) });
|
|
29
|
+
|
|
30
|
+
expect(taggedIds(organization)).toContain(tag.id);
|
|
31
|
+
},
|
|
32
|
+
Effect.provide(OperationTestLayer),
|
|
33
|
+
TestHelpers.provideTestContext,
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Compare by entity id: a same-space ref stores a local EID (`echo:/<id>`) while `Obj.getURI`
|
|
39
|
+
// returns the fully-qualified form (`echo://<space>/<id>`).
|
|
40
|
+
const taggedIds = (obj: Obj.Any): (string | undefined)[] =>
|
|
41
|
+
Obj.getMeta(obj).tags.map((ref) => EID.getEntityId(EID.parse(ref.uri)));
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Obj, Ref, Tag } from '@dxos/echo';
|
|
10
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
+
import { EID, EntityId } from '@dxos/keys';
|
|
12
|
+
import { Organization } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { OperationTestLayer } from '../../../testing';
|
|
15
|
+
import { TagAdd, TagRemove } from './definitions';
|
|
16
|
+
|
|
17
|
+
EntityId.dangerouslyDisableRandomness();
|
|
18
|
+
|
|
19
|
+
describe('TagRemove', () => {
|
|
20
|
+
it.effect(
|
|
21
|
+
'tag-remove: detaches the tag from the object',
|
|
22
|
+
Effect.fnUntraced(
|
|
23
|
+
function* (_) {
|
|
24
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Tagged Corp' }));
|
|
25
|
+
const tag = yield* Database.add(Tag.make({ label: 'important' }));
|
|
26
|
+
yield* Database.flush();
|
|
27
|
+
yield* Operation.invoke(TagAdd, { tag: Ref.make(tag), obj: Ref.make(organization) });
|
|
28
|
+
expect(taggedIds(organization)).toContain(tag.id);
|
|
29
|
+
|
|
30
|
+
yield* Operation.invoke(TagRemove, { tag: Ref.make(tag), obj: Ref.make(organization) });
|
|
31
|
+
|
|
32
|
+
expect(taggedIds(organization)).not.toContain(tag.id);
|
|
33
|
+
},
|
|
34
|
+
Effect.provide(OperationTestLayer),
|
|
35
|
+
TestHelpers.provideTestContext,
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Compare by entity id: a same-space ref stores a local EID (`echo:/<id>`) while `Obj.getURI`
|
|
41
|
+
// returns the fully-qualified form (`echo://<space>/<id>`).
|
|
42
|
+
const taggedIds = (obj: Obj.Any): (string | undefined)[] =>
|
|
43
|
+
Obj.getMeta(obj).tags.map((ref) => EID.getEntityId(EID.parse(ref.uri)));
|
|
@@ -5,14 +5,16 @@
|
|
|
5
5
|
import { describe, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
8
9
|
import { Operation, Skill } from '@dxos/compute';
|
|
9
|
-
import { Database, Feed, Obj } from '@dxos/echo';
|
|
10
|
+
import { Database, Feed, Filter, Obj, Query } from '@dxos/echo';
|
|
10
11
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
-
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
13
|
import { EntityId } from '@dxos/keys';
|
|
14
|
+
import { Text } from '@dxos/schema';
|
|
15
|
+
import { Outline, Task, TaskSet } from '@dxos/types';
|
|
14
16
|
|
|
15
|
-
import { Agent, Chat
|
|
17
|
+
import { Agent, Chat } from '../../../types';
|
|
16
18
|
import DelegationSkill from '../skill';
|
|
17
19
|
import { DelegateTask } from './delegate-task';
|
|
18
20
|
import { DelegationHandlers } from './index';
|
|
@@ -21,19 +23,29 @@ EntityId.dangerouslyDisableRandomness();
|
|
|
21
23
|
|
|
22
24
|
const TestLayer = AssistantTestLayer({
|
|
23
25
|
operationHandlers: DelegationHandlers,
|
|
24
|
-
types: [
|
|
26
|
+
types: [
|
|
27
|
+
Agent.Agent,
|
|
28
|
+
Outline.Outline,
|
|
29
|
+
Task.Task,
|
|
30
|
+
TaskSet.TaskSet,
|
|
31
|
+
Text.Text,
|
|
32
|
+
Chat.Chat,
|
|
33
|
+
Chat.CompanionTo,
|
|
34
|
+
Skill.Skill,
|
|
35
|
+
Feed.Feed,
|
|
36
|
+
],
|
|
25
37
|
skills: [DelegationSkill.make()],
|
|
26
38
|
disableLlmMemoization: true,
|
|
27
39
|
});
|
|
28
40
|
|
|
29
|
-
const invokeDelegateTask = (input: {
|
|
41
|
+
const invokeDelegateTask = (input: { title: string }, chatFeed: Feed.Feed) =>
|
|
30
42
|
Operation.invoke(DelegateTask, input).pipe(
|
|
31
43
|
Effect.provide(Operation.withInvocationOptions({ conversation: Obj.getURI(chatFeed) })),
|
|
32
44
|
);
|
|
33
45
|
|
|
34
46
|
describe('DelegateTask', () => {
|
|
35
47
|
it.scoped(
|
|
36
|
-
'
|
|
48
|
+
'promotes delegated work to a durable in-progress agent task',
|
|
37
49
|
Effect.fnUntraced(
|
|
38
50
|
function* ({ expect }) {
|
|
39
51
|
const agent = yield* Agent.makeInitialized(
|
|
@@ -42,19 +54,29 @@ describe('DelegateTask', () => {
|
|
|
42
54
|
);
|
|
43
55
|
yield* Database.flush();
|
|
44
56
|
|
|
45
|
-
const
|
|
57
|
+
const agentChat = yield* Agent.loadChat(agent);
|
|
58
|
+
const chatFeed = agentChat?.feed?.target;
|
|
46
59
|
invariant(chatFeed, 'Agent chat feed not found.');
|
|
47
60
|
|
|
48
61
|
yield* invokeDelegateTask({ title: 'Research widgets' }, chatFeed);
|
|
49
62
|
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
// The durable task is parented to the outline's task set with an agent assignee.
|
|
64
|
+
const chat = yield* Agent.loadChat(agent);
|
|
65
|
+
invariant(chat, 'Agent chat not found.');
|
|
66
|
+
const outline = yield* Database.load(chat.outline!);
|
|
67
|
+
const taskSet = yield* Database.load(outline.taskSet!);
|
|
68
|
+
const children = yield* Database.query(Query.select(Filter.id(taskSet.id)).children()).run;
|
|
69
|
+
const tasks = children.filter((child): child is Task.Task => Obj.instanceOf(Task.Task, child));
|
|
70
|
+
expect(tasks).toHaveLength(1);
|
|
71
|
+
expect(tasks[0]).toMatchObject({
|
|
54
72
|
title: 'Research widgets',
|
|
55
73
|
status: 'in-progress',
|
|
56
|
-
|
|
74
|
+
assignee: { role: 'assistant' },
|
|
57
75
|
});
|
|
76
|
+
|
|
77
|
+
// The checklist mirrors the item, unchecked until the sub-agent completes.
|
|
78
|
+
const text = yield* Database.load(outline.content);
|
|
79
|
+
expect(Outline.parseChecklist(text.content)).toEqual([{ title: 'Research widgets', done: false }]);
|
|
58
80
|
},
|
|
59
81
|
Effect.provide(TestLayer),
|
|
60
82
|
TestHelpers.provideTestContext,
|
|
@@ -62,35 +84,29 @@ describe('DelegateTask', () => {
|
|
|
62
84
|
);
|
|
63
85
|
|
|
64
86
|
it.scoped(
|
|
65
|
-
'
|
|
87
|
+
'reuses the outline task set across delegations',
|
|
66
88
|
Effect.fnUntraced(
|
|
67
89
|
function* ({ expect }) {
|
|
68
90
|
const agent = yield* Agent.makeInitialized(
|
|
69
91
|
{ name: 'Supervisor', instructions: 'Test.' },
|
|
70
92
|
DelegationSkill.make(),
|
|
71
93
|
);
|
|
72
|
-
const chat = yield* Database.load(agent.chat!);
|
|
73
|
-
const plan = yield* Chat.ensurePlan(chat);
|
|
74
|
-
const taskId = Plan.TaskId.make('1-ab');
|
|
75
|
-
Obj.update(plan, (plan) => {
|
|
76
|
-
plan.tasks.push({ id: taskId, title: 'Research widgets', status: 'todo' });
|
|
77
|
-
});
|
|
78
94
|
yield* Database.flush();
|
|
79
95
|
|
|
80
|
-
const
|
|
96
|
+
const agentChat = yield* Agent.loadChat(agent);
|
|
97
|
+
const chatFeed = agentChat?.feed?.target;
|
|
81
98
|
invariant(chatFeed, 'Agent chat feed not found.');
|
|
82
99
|
|
|
83
|
-
yield* invokeDelegateTask({
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
});
|
|
100
|
+
yield* invokeDelegateTask({ title: 'Research widgets' }, chatFeed);
|
|
101
|
+
yield* invokeDelegateTask({ title: 'Summarize findings' }, chatFeed);
|
|
102
|
+
|
|
103
|
+
const chat = yield* Agent.loadChat(agent);
|
|
104
|
+
invariant(chat, 'Agent chat not found.');
|
|
105
|
+
const outline = yield* Database.load(chat.outline!);
|
|
106
|
+
const taskSet = yield* Database.load(outline.taskSet!);
|
|
107
|
+
const children = yield* Database.query(Query.select(Filter.id(taskSet.id)).children()).run;
|
|
108
|
+
const tasks = children.filter((child): child is Task.Task => Obj.instanceOf(Task.Task, child));
|
|
109
|
+
expect(tasks).toHaveLength(2);
|
|
94
110
|
},
|
|
95
111
|
Effect.provide(TestLayer),
|
|
96
112
|
TestHelpers.provideTestContext,
|
|
@@ -98,7 +114,7 @@ describe('DelegateTask', () => {
|
|
|
98
114
|
);
|
|
99
115
|
|
|
100
116
|
it.scoped(
|
|
101
|
-
'fails
|
|
117
|
+
'fails on an empty title',
|
|
102
118
|
Effect.fnUntraced(
|
|
103
119
|
function* ({ expect }) {
|
|
104
120
|
const agent = yield* Agent.makeInitialized(
|
|
@@ -107,12 +123,11 @@ describe('DelegateTask', () => {
|
|
|
107
123
|
);
|
|
108
124
|
yield* Database.flush();
|
|
109
125
|
|
|
110
|
-
const
|
|
126
|
+
const agentChat = yield* Agent.loadChat(agent);
|
|
127
|
+
const chatFeed = agentChat?.feed?.target;
|
|
111
128
|
invariant(chatFeed, 'Agent chat feed not found.');
|
|
112
129
|
|
|
113
|
-
const exit = yield* invokeDelegateTask({
|
|
114
|
-
Effect.exit,
|
|
115
|
-
);
|
|
130
|
+
const exit = yield* invokeDelegateTask({ title: '' }, chatFeed).pipe(Effect.exit);
|
|
116
131
|
expect(exit._tag).toBe('Failure');
|
|
117
132
|
},
|
|
118
133
|
Effect.provide(TestLayer),
|
|
@@ -9,9 +9,10 @@ import { Harness } from '@dxos/assistant';
|
|
|
9
9
|
import { Operation } from '@dxos/compute';
|
|
10
10
|
import { Database, Obj } from '@dxos/echo';
|
|
11
11
|
import { DXN } from '@dxos/keys';
|
|
12
|
+
import { Outline } from '@dxos/types';
|
|
12
13
|
import { trim } from '@dxos/util';
|
|
13
14
|
|
|
14
|
-
import { Chat
|
|
15
|
+
import { Chat } from '../../../types';
|
|
15
16
|
|
|
16
17
|
export const DelegateTask = Operation.make({
|
|
17
18
|
meta: {
|
|
@@ -19,17 +20,14 @@ export const DelegateTask = Operation.make({
|
|
|
19
20
|
name: 'Delegate task',
|
|
20
21
|
description: trim`
|
|
21
22
|
Delegate a unit of work to a sub-agent.
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
Promotes the titled checklist item to a durable in-progress task assigned to an agent, so
|
|
24
|
+
the supervisor spawns a background sub-agent. Creates the checklist item if absent.
|
|
24
25
|
`,
|
|
25
26
|
icon: 'ph--share-network--regular',
|
|
26
27
|
},
|
|
27
28
|
input: Schema.Struct({
|
|
28
|
-
|
|
29
|
-
description: '
|
|
30
|
-
}),
|
|
31
|
-
title: Schema.optional(Schema.String).annotations({
|
|
32
|
-
description: 'Title for a new task to create and delegate. Omit when delegating by id.',
|
|
29
|
+
title: Schema.String.annotations({
|
|
30
|
+
description: 'Title of the work to delegate (matched against the checklist, created if new).',
|
|
33
31
|
}),
|
|
34
32
|
}),
|
|
35
33
|
output: Schema.Any,
|
|
@@ -37,56 +35,41 @@ export const DelegateTask = Operation.make({
|
|
|
37
35
|
});
|
|
38
36
|
|
|
39
37
|
/**
|
|
40
|
-
*
|
|
38
|
+
* Delegation is the promotion moment: the scratch checklist item becomes a durable `Task`
|
|
39
|
+
* (parented to the outline's task set) assigned to an agent (`role: 'assistant'`), which the
|
|
40
|
+
* supervisor's reconcile loop picks up. The markdown line is checked off only when the sub-agent
|
|
41
|
+
* completes (see the delegation strategy).
|
|
41
42
|
*/
|
|
42
43
|
export default DelegateTask.pipe(
|
|
43
44
|
Operation.withHandler(
|
|
44
|
-
Effect.fn(function* ({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (hasId === hasTitle) {
|
|
48
|
-
return yield* Effect.fail(
|
|
49
|
-
new Error('Provide exactly one of `id` (existing plan task) or `title` (new task to create).'),
|
|
50
|
-
);
|
|
45
|
+
Effect.fn(function* ({ title }) {
|
|
46
|
+
if (title.length === 0) {
|
|
47
|
+
return yield* Effect.fail(new Error('Provide a non-empty task title.'));
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
const chat = yield* Chat.getFromContext;
|
|
54
|
-
const
|
|
51
|
+
const { outline, text } = yield* Chat.ensureOutlineText(chat);
|
|
52
|
+
const { db } = yield* Database.Service;
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return yield* Effect.fail(
|
|
63
|
-
new Error(`Plan task "${id}" is already ${existing.status} and cannot be delegated.`),
|
|
64
|
-
);
|
|
65
|
-
}
|
|
54
|
+
const task = yield* Effect.promise(() =>
|
|
55
|
+
Outline.createTask(outline, db, title, {
|
|
56
|
+
status: 'in-progress',
|
|
57
|
+
assignee: { role: 'assistant' },
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
66
60
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
if (title === undefined) {
|
|
76
|
-
return yield* Effect.fail(
|
|
77
|
-
new Error('Provide exactly one of `id` (existing plan task) or `title` (new task to create).'),
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
Obj.update(plan, (plan) => {
|
|
81
|
-
Plan.addTasks(plan, [{ title, status: 'in-progress', delegated: true }]);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
61
|
+
// Ensure the checklist carries the item (unchecked until the sub-agent completes).
|
|
62
|
+
Obj.update(text, (text) => {
|
|
63
|
+
text.content = Outline.upsertChecklistItems(text.content, [{ title: task.title, done: false }]);
|
|
64
|
+
});
|
|
65
|
+
yield* Database.flush();
|
|
84
66
|
|
|
85
67
|
return trim`
|
|
86
|
-
Delegated
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
68
|
+
Delegated "${task.title}" as an in-progress agent task (id: ${task.id}).
|
|
69
|
+
Current checklist:
|
|
70
|
+
<checklist>
|
|
71
|
+
${text.content}
|
|
72
|
+
</checklist>
|
|
90
73
|
`;
|
|
91
74
|
}),
|
|
92
75
|
),
|
|
@@ -8,10 +8,10 @@ import * as Config from 'effect/Config';
|
|
|
8
8
|
import * as Effect from 'effect/Effect';
|
|
9
9
|
import * as Layer from 'effect/Layer';
|
|
10
10
|
|
|
11
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
11
12
|
import { Operation, OperationHandlerSet } from '@dxos/compute';
|
|
13
|
+
import { credentialsLayerConfig } from '@dxos/compute-runtime';
|
|
12
14
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
13
|
-
import { credentialsLayerConfig } from '@dxos/functions';
|
|
14
|
-
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
15
15
|
|
|
16
16
|
import { default as fetchMessages } from './fetch-messages';
|
|
17
17
|
|
|
@@ -6,7 +6,7 @@ import * as HttpClient from '@effect/platform/HttpClient';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
8
|
import { Credential, Operation } from '@dxos/compute';
|
|
9
|
-
import { withAuthorization } from '@dxos/
|
|
9
|
+
import { withAuthorization } from '@dxos/compute-runtime';
|
|
10
10
|
|
|
11
11
|
import { FetchPrs } from './definitions';
|
|
12
12
|
|
package/src/skills/index.ts
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { describe, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
8
9
|
import { Operation, OperationHandlerSet } from '@dxos/compute';
|
|
9
10
|
import { Database, Obj, Query } from '@dxos/echo';
|
|
10
11
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
-
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
12
12
|
import { Person, Pipeline, Task } from '@dxos/types';
|
|
13
13
|
|
|
14
14
|
import { LINEAR_ID_KEY, default as fetchLinearIssues } from './sync-issues';
|
|
@@ -9,10 +9,10 @@ import * as Effect from 'effect/Effect';
|
|
|
9
9
|
import * as Function from 'effect/Function';
|
|
10
10
|
|
|
11
11
|
import { Credential, Operation } from '@dxos/compute';
|
|
12
|
+
import { withAuthorization } from '@dxos/compute-runtime';
|
|
12
13
|
import { Database, Filter, Obj, Query, Ref, type Type } from '@dxos/echo';
|
|
13
|
-
import { withAuthorization } from '@dxos/functions';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
15
|
-
import { Person,
|
|
15
|
+
import { Person, Task } from '@dxos/types';
|
|
16
16
|
|
|
17
17
|
import { syncObjects } from '../../../sync';
|
|
18
18
|
import { graphqlRequestBody } from '../../../util';
|
|
@@ -156,27 +156,10 @@ const mapLinearIssue = (issue: LinearIssue, { teamId }: { teamId: string }): Tas
|
|
|
156
156
|
},
|
|
157
157
|
title: issue.title ?? undefined,
|
|
158
158
|
description: issue.description ?? undefined,
|
|
159
|
-
|
|
159
|
+
assignee: !issue.assignee ? undefined : { contact: Ref.make(mapLinearPerson(issue.assignee, { teamId })) },
|
|
160
160
|
// TODO(dmaretskyi): Sync those (+ linear team as org?).
|
|
161
161
|
// state: issue.state.name,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
: Ref.make(
|
|
166
|
-
Pipeline.make({
|
|
167
|
-
[Obj.Meta]: {
|
|
168
|
-
keys: [
|
|
169
|
-
{
|
|
170
|
-
id: issue.project.id,
|
|
171
|
-
source: LINEAR_ID_KEY,
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
id: teamId,
|
|
175
|
-
source: LINEAR_TEAM_ID_KEY,
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
},
|
|
179
|
-
name: issue.project.name,
|
|
180
|
-
}),
|
|
181
|
-
),
|
|
162
|
+
// Container membership (TaskSet parent edge) is not mapped here: `syncObjects` upserts
|
|
163
|
+
// detached objects, and parent edges need persisted objects — plugin-linear's sync owns
|
|
164
|
+
// real project mirroring.
|
|
182
165
|
});
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
10
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
+
import { EntityId } from '@dxos/keys';
|
|
12
|
+
|
|
13
|
+
import { OperationTestLayer } from '../../../testing';
|
|
14
|
+
import { Memory } from '../../../types/Memory';
|
|
15
|
+
import { DeleteMemory } from './definitions';
|
|
16
|
+
|
|
17
|
+
EntityId.dangerouslyDisableRandomness();
|
|
18
|
+
|
|
19
|
+
describe('DeleteMemory', () => {
|
|
20
|
+
it.effect(
|
|
21
|
+
'removes the memory from the database',
|
|
22
|
+
Effect.fnUntraced(
|
|
23
|
+
function* (_) {
|
|
24
|
+
const memory = yield* Database.add(Obj.make(Memory, { title: 'Outdated fact', content: 'Stale.' }));
|
|
25
|
+
const kept = yield* Database.add(Obj.make(Memory, { title: 'Current fact', content: 'Fresh.' }));
|
|
26
|
+
yield* Database.flush();
|
|
27
|
+
|
|
28
|
+
yield* Operation.invoke(DeleteMemory, { memory: Ref.make(memory) });
|
|
29
|
+
|
|
30
|
+
const memories = yield* Database.query(Query.select(Filter.type(Memory))).run;
|
|
31
|
+
expect(memories.map((entry) => entry.id)).toEqual([kept.id]);
|
|
32
|
+
},
|
|
33
|
+
Effect.provide(OperationTestLayer),
|
|
34
|
+
TestHelpers.provideTestContext,
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
});
|