@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/assistant-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Assistant toolkit, definitions, and utilities.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"source": "./src/index.ts",
|
|
17
17
|
"types": "./dist/types/src/index.d.ts",
|
|
18
|
-
"
|
|
18
|
+
"import": "./dist/lib/index.mjs"
|
|
19
19
|
},
|
|
20
20
|
"./testing": {
|
|
21
21
|
"source": "./src/testing/index.ts",
|
|
22
22
|
"types": "./dist/types/src/testing/index.d.ts",
|
|
23
|
-
"
|
|
23
|
+
"import": "./dist/lib/testing.mjs"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
@@ -33,42 +33,43 @@
|
|
|
33
33
|
"@effect/platform": "0.96.2",
|
|
34
34
|
"dfx": "^0.127.0",
|
|
35
35
|
"exa-js": "^1.5.12",
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/compute": "0.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/react-ui-syntax-highlighter": "0.
|
|
54
|
-
"@dxos/schema": "0.
|
|
55
|
-
"@dxos/types": "0.
|
|
56
|
-
"@dxos/util": "0.
|
|
57
|
-
"@dxos/
|
|
36
|
+
"@dxos/agent-runtime": "0.11.0",
|
|
37
|
+
"@dxos/ai": "0.11.0",
|
|
38
|
+
"@dxos/app-framework": "0.11.0",
|
|
39
|
+
"@dxos/app-toolkit": "0.11.0",
|
|
40
|
+
"@dxos/assistant": "0.11.0",
|
|
41
|
+
"@dxos/compute": "0.11.0",
|
|
42
|
+
"@dxos/compute-runtime": "0.11.0",
|
|
43
|
+
"@dxos/echo": "0.11.0",
|
|
44
|
+
"@dxos/echo-protocol": "0.11.0",
|
|
45
|
+
"@dxos/edge-client": "0.11.0",
|
|
46
|
+
"@dxos/effect": "0.11.0",
|
|
47
|
+
"@dxos/errors": "0.11.0",
|
|
48
|
+
"@dxos/invariant": "0.11.0",
|
|
49
|
+
"@dxos/keys": "0.11.0",
|
|
50
|
+
"@dxos/log": "0.11.0",
|
|
51
|
+
"@dxos/protocols": "0.11.0",
|
|
52
|
+
"@dxos/react-ui": "0.11.0",
|
|
53
|
+
"@dxos/react-ui-syntax-highlighter": "0.11.0",
|
|
54
|
+
"@dxos/schema": "0.11.0",
|
|
55
|
+
"@dxos/types": "0.11.0",
|
|
56
|
+
"@dxos/util": "0.11.0",
|
|
57
|
+
"@dxos/client-protocol": "0.11.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"effect": "3.21.4",
|
|
61
61
|
"react": "~19.2.7",
|
|
62
62
|
"react-dom": "~19.2.7",
|
|
63
|
-
"@dxos/client
|
|
64
|
-
"@dxos/plugin-markdown": "0.
|
|
65
|
-
"@dxos/ui-theme": "0.
|
|
63
|
+
"@dxos/echo-client": "0.11.0",
|
|
64
|
+
"@dxos/plugin-markdown": "0.11.0",
|
|
65
|
+
"@dxos/ui-theme": "0.11.0",
|
|
66
|
+
"@dxos/client-protocol": "0.11.0"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
69
|
"effect": "3.21.4",
|
|
69
70
|
"react": "~19.2.7",
|
|
70
71
|
"react-dom": "~19.2.7",
|
|
71
|
-
"@dxos/ui-theme": "0.
|
|
72
|
+
"@dxos/ui-theme": "^0.11.0"
|
|
72
73
|
},
|
|
73
74
|
"publishConfig": {
|
|
74
75
|
"access": "public"
|
|
@@ -6,31 +6,37 @@ import { describe, expect, it } from '@effect/vitest';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import * as Schema from 'effect/Schema';
|
|
8
8
|
|
|
9
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
10
|
+
import { ScriptedLanguageModel } from '@dxos/ai/testing';
|
|
9
11
|
import { AiContext } from '@dxos/assistant';
|
|
10
12
|
import { Instructions, Operation, OperationHandlerSet } from '@dxos/compute';
|
|
11
13
|
import { Database, Feed, Filter, JsonSchema, Obj, Ref } from '@dxos/echo';
|
|
12
14
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
13
|
-
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
14
15
|
import { EntityId } from '@dxos/keys';
|
|
15
16
|
import { Text } from '@dxos/schema';
|
|
16
|
-
import { Message } from '@dxos/types';
|
|
17
|
+
import { Message, Outline } from '@dxos/types';
|
|
17
18
|
|
|
18
19
|
import * as Chat from '../types/Chat';
|
|
19
|
-
import * as Plan from '../types/Plan';
|
|
20
20
|
import { RunInstructions } from './definitions';
|
|
21
21
|
import defaultAgentPrompt from './run-instructions';
|
|
22
22
|
|
|
23
23
|
EntityId.dangerouslyDisableRandomness();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
// The agent finishes by calling `completeJob`; scripting that call drives the whole operation
|
|
26
|
+
// without a live model, so what is asserted is the operation's own behaviour rather than the
|
|
27
|
+
// model's. A scripted turn replaces the memoized conversation this file used to replay.
|
|
28
|
+
const layerWithResult = (success: unknown) =>
|
|
29
|
+
AssistantTestLayer({
|
|
30
|
+
operationHandlers: OperationHandlerSet.make(defaultAgentPrompt),
|
|
31
|
+
types: [Chat.Chat, Message.Message, AiContext.Binding, Text.Text, Outline.Outline],
|
|
32
|
+
aiService: ScriptedLanguageModel.scriptedAiService([
|
|
33
|
+
{ parts: [ScriptedLanguageModel.toolCall('completeJob', { success })] },
|
|
34
|
+
// The loop asks again once the tool result is fed back; a text-only turn stops it.
|
|
35
|
+
{ parts: [ScriptedLanguageModel.text('Done.')] },
|
|
36
|
+
]),
|
|
37
|
+
});
|
|
32
38
|
|
|
33
|
-
describe('
|
|
39
|
+
describe('RunInstructions', () => {
|
|
34
40
|
it.effect(
|
|
35
41
|
'chat mode appends assistant messages to the chat queue',
|
|
36
42
|
Effect.fnUntraced(
|
|
@@ -38,12 +44,7 @@ describe('Agent prompt', () => {
|
|
|
38
44
|
const feed = yield* Database.add(Feed.make());
|
|
39
45
|
const messageCountBefore = yield* countFeedMessages(feed);
|
|
40
46
|
|
|
41
|
-
const chat = yield* Database.add(
|
|
42
|
-
Chat.make({
|
|
43
|
-
feed: Ref.make(feed),
|
|
44
|
-
}),
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
+
const chat = yield* Database.add(Chat.make({ feed: Ref.make(feed) }));
|
|
47
48
|
const instructions = yield* Database.add(
|
|
48
49
|
Instructions.make({
|
|
49
50
|
name: 'chat-mode-test',
|
|
@@ -52,7 +53,6 @@ describe('Agent prompt', () => {
|
|
|
52
53
|
output: Schema.String,
|
|
53
54
|
}),
|
|
54
55
|
);
|
|
55
|
-
|
|
56
56
|
yield* Database.flush();
|
|
57
57
|
|
|
58
58
|
const result = yield* Operation.invoke(RunInstructions, {
|
|
@@ -62,34 +62,28 @@ describe('Agent prompt', () => {
|
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
const messageCountAfter = yield* countFeedMessages(feed);
|
|
65
|
-
|
|
66
65
|
expect(messageCountAfter).toBeGreaterThan(messageCountBefore);
|
|
67
66
|
expect(result).toBe('ack');
|
|
68
67
|
},
|
|
69
|
-
Effect.provide(
|
|
68
|
+
Effect.provide(layerWithResult('ack')),
|
|
70
69
|
TestHelpers.provideTestContext,
|
|
71
70
|
),
|
|
72
|
-
{ timeout: 60_000 },
|
|
73
71
|
);
|
|
74
72
|
|
|
75
73
|
it.effect(
|
|
76
|
-
'
|
|
74
|
+
'returns an object conforming to the instructions output schema',
|
|
77
75
|
Effect.fnUntraced(
|
|
78
76
|
function* (_) {
|
|
79
|
-
const Person = Schema.Struct({
|
|
80
|
-
name: Schema.String,
|
|
81
|
-
age: Schema.Number,
|
|
82
|
-
});
|
|
77
|
+
const Person = Schema.Struct({ name: Schema.String, age: Schema.Number });
|
|
83
78
|
|
|
84
79
|
const instructions = yield* Database.add(
|
|
85
80
|
Instructions.make({
|
|
86
81
|
name: 'output-schema-test',
|
|
87
|
-
text: 'Invent a fictional person and call completeJob with the success object describing them
|
|
82
|
+
text: 'Invent a fictional person and call completeJob with the success object describing them.',
|
|
88
83
|
output: Person,
|
|
89
84
|
skills: [],
|
|
90
85
|
}),
|
|
91
86
|
);
|
|
92
|
-
|
|
93
87
|
yield* Database.flush();
|
|
94
88
|
|
|
95
89
|
const result = yield* Operation.invoke(RunInstructions, {
|
|
@@ -97,17 +91,15 @@ describe('Agent prompt', () => {
|
|
|
97
91
|
input: {},
|
|
98
92
|
});
|
|
99
93
|
|
|
100
|
-
// The instructions
|
|
101
|
-
//
|
|
94
|
+
// The instructions persist their declared output as a JSON schema; decode it back and assert
|
|
95
|
+
// the returned object satisfies that schema.
|
|
102
96
|
const outputSchema = JsonSchema.toEffectSchema(instructions.output);
|
|
103
97
|
const decoded = Schema.decodeUnknownSync(outputSchema)(result);
|
|
104
|
-
expect(
|
|
105
|
-
expect(typeof decoded.age).toBe('number');
|
|
98
|
+
expect(decoded).toEqual({ name: 'Ada Lovelace', age: 36 });
|
|
106
99
|
},
|
|
107
|
-
Effect.provide(
|
|
100
|
+
Effect.provide(layerWithResult({ name: 'Ada Lovelace', age: 36 })),
|
|
108
101
|
TestHelpers.provideTestContext,
|
|
109
102
|
),
|
|
110
|
-
{ timeout: 60_000 },
|
|
111
103
|
);
|
|
112
104
|
});
|
|
113
105
|
|
|
@@ -6,11 +6,11 @@ import { describe, it } from '@effect/vitest';
|
|
|
6
6
|
import * as Duration from 'effect/Duration';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
|
|
9
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
9
10
|
import { AiContext } from '@dxos/assistant';
|
|
10
11
|
import { Instructions, Skill } from '@dxos/compute';
|
|
11
12
|
import { Database, Feed, Ref } from '@dxos/echo';
|
|
12
13
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
13
|
-
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
14
14
|
import { Text } from '@dxos/schema';
|
|
15
15
|
|
|
16
16
|
import { WebSearchSkill } from '../skills';
|
|
@@ -111,6 +111,11 @@ describe('Skill binding resolution (registry refs)', () => {
|
|
|
111
111
|
yield* Effect.promise(() => writer.open());
|
|
112
112
|
yield* Effect.promise(() => writer.bind({ skills: [Ref.make(skill)], objects: [] }));
|
|
113
113
|
|
|
114
|
+
// Model a spawned process reading the feed cold: drop the in-memory feed handle so the
|
|
115
|
+
// reader re-decodes the binding freshly, without the writer's identity-preserved instance
|
|
116
|
+
// (whose ref still carries the in-memory skill target).
|
|
117
|
+
yield* Effect.promise(() => db.evictFeedHandle(feed));
|
|
118
|
+
|
|
114
119
|
const reader = new AiContext.Binder({ feed, runtime });
|
|
115
120
|
yield* Effect.promise(() => reader.open()).pipe(
|
|
116
121
|
Effect.timeoutFail({
|
|
@@ -4,50 +4,33 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { AiService
|
|
7
|
+
import { AiService } from '@dxos/ai';
|
|
8
8
|
import { Harness } from '@dxos/assistant';
|
|
9
|
-
import { Operation,
|
|
10
|
-
import {
|
|
9
|
+
import { Operation, TriggerEvent } from '@dxos/compute';
|
|
10
|
+
import { AgentService } from '@dxos/compute/AgentService';
|
|
11
|
+
import { Database, Ref } from '@dxos/echo';
|
|
11
12
|
import { DXN } from '@dxos/keys';
|
|
12
13
|
|
|
13
|
-
import {
|
|
14
|
+
import { Chat } from '../../../types';
|
|
14
15
|
|
|
15
|
-
export const
|
|
16
|
+
export const Relay = Operation.make({
|
|
16
17
|
meta: {
|
|
17
|
-
key: DXN.make('org.dxos.function.agent.
|
|
18
|
-
name: 'Agent
|
|
19
|
-
description: '
|
|
20
|
-
icon: 'ph--brain--regular',
|
|
21
|
-
},
|
|
22
|
-
input: Schema.Struct({
|
|
23
|
-
agent: Schema.suspend(() => Ref.Ref(Agent.Agent)),
|
|
24
|
-
prompt: Schema.optional(Schema.String),
|
|
25
|
-
event: Schema.optional(TriggerEvent.TriggerEvent),
|
|
26
|
-
}),
|
|
27
|
-
output: Schema.Void,
|
|
28
|
-
services: [
|
|
29
|
-
AiService.AiService,
|
|
30
|
-
Database.Service,
|
|
31
|
-
Registry.Service,
|
|
32
|
-
Trace.TraceService,
|
|
33
|
-
OpaqueToolkit.OpaqueToolkitProvider,
|
|
34
|
-
],
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export const Qualifier = Operation.make({
|
|
38
|
-
meta: {
|
|
39
|
-
key: DXN.make('org.dxos.function.agent.qualifier'),
|
|
40
|
-
name: 'Agent Qualifier',
|
|
41
|
-
description:
|
|
42
|
-
'Qualifier that determines if the event is relevant to the agent. Puts the data into the input queue of the agent.',
|
|
18
|
+
key: DXN.make('org.dxos.function.agent.relay'),
|
|
19
|
+
name: 'Agent Relay',
|
|
20
|
+
description: 'Qualifies a subscription event with a cheap model and forwards it onto the durable agent session.',
|
|
43
21
|
icon: 'ph--funnel--regular',
|
|
44
22
|
},
|
|
45
23
|
input: Schema.Struct({
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
/** The chat whose durable session receives the event (carries feed, instructions, and agent). */
|
|
25
|
+
chat: Schema.suspend(() => Ref.Ref(Chat.Chat)),
|
|
26
|
+
event: Schema.optional(TriggerEvent.TriggerEvent),
|
|
27
|
+
/** Synthetic wake prompt (e.g. a cron tick) delivered instead of an event payload. */
|
|
28
|
+
prompt: Schema.optional(Schema.String),
|
|
29
|
+
/** Skip the cheap-model relevance check (default: qualify when an event is present). */
|
|
30
|
+
qualify: Schema.optional(Schema.Boolean),
|
|
48
31
|
}),
|
|
49
32
|
output: Schema.Void,
|
|
50
|
-
services: [AiService.AiService, Database.Service],
|
|
33
|
+
services: [AiService.AiService, Database.Service, AgentService],
|
|
51
34
|
});
|
|
52
35
|
|
|
53
36
|
export const GetContext = Operation.make({
|
|
@@ -62,34 +45,7 @@ export const GetContext = Operation.make({
|
|
|
62
45
|
id: Schema.String,
|
|
63
46
|
name: Schema.String,
|
|
64
47
|
instructions: Schema.String,
|
|
65
|
-
|
|
66
|
-
artifacts: Schema.Array(
|
|
67
|
-
Schema.Struct({
|
|
68
|
-
name: Schema.String,
|
|
69
|
-
type: Schema.optional(Schema.String),
|
|
70
|
-
dxn: Schema.optional(Schema.String),
|
|
71
|
-
}),
|
|
72
|
-
),
|
|
48
|
+
checklist: Schema.String,
|
|
73
49
|
}),
|
|
74
50
|
services: [Harness.HarnessService, Database.Service],
|
|
75
51
|
});
|
|
76
|
-
|
|
77
|
-
export const AddArtifact = Operation.make({
|
|
78
|
-
meta: {
|
|
79
|
-
key: DXN.make('org.dxos.function.agent.addArtifact'),
|
|
80
|
-
name: 'Add artifact',
|
|
81
|
-
description: 'Adds a new artifact.',
|
|
82
|
-
icon: 'ph--plus--regular',
|
|
83
|
-
},
|
|
84
|
-
input: Schema.Struct({
|
|
85
|
-
name: Schema.String.annotations({
|
|
86
|
-
description: 'The name of the artifact to add.',
|
|
87
|
-
}),
|
|
88
|
-
artifact: Schema.String.annotations({
|
|
89
|
-
description:
|
|
90
|
-
'The id of the artifact to add, exactly as returned by the tool that created it. Do NOT guess or generate the id.',
|
|
91
|
-
}),
|
|
92
|
-
}),
|
|
93
|
-
output: Schema.Void,
|
|
94
|
-
services: [Harness.HarnessService, Database.Service],
|
|
95
|
-
});
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { AiContext } from '@dxos/assistant';
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { EntityId } from '@dxos/keys';
|
|
14
|
+
import { Outline } from '@dxos/types';
|
|
15
|
+
|
|
16
|
+
import { OperationTestLayer } from '../../../testing';
|
|
17
|
+
import { Agent, Chat } from '../../../types';
|
|
18
|
+
import AgentSkillDef from '../skill';
|
|
19
|
+
import * as AgentSkillOperations from './definitions';
|
|
20
|
+
|
|
21
|
+
EntityId.dangerouslyDisableRandomness();
|
|
22
|
+
|
|
23
|
+
describe('GetContext', () => {
|
|
24
|
+
it.effect(
|
|
25
|
+
'reports the bound agent name and instructions',
|
|
26
|
+
Effect.fnUntraced(
|
|
27
|
+
function* (_) {
|
|
28
|
+
const { agent, conversation } = yield* setupBoundAgent();
|
|
29
|
+
|
|
30
|
+
const context = yield* Operation.invoke(AgentSkillOperations.GetContext, {}).pipe(Effect.provide(conversation));
|
|
31
|
+
|
|
32
|
+
expect(context.id).toBe(agent.id);
|
|
33
|
+
expect(context.name).toBe('Test Agent');
|
|
34
|
+
expect(context.instructions).toBe('A test agent for context.');
|
|
35
|
+
expect(context.checklist).toBe('No checklist found.');
|
|
36
|
+
},
|
|
37
|
+
Effect.provide(OperationTestLayer),
|
|
38
|
+
TestHelpers.provideTestContext,
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
it.effect(
|
|
43
|
+
'formats the chat checklist once one exists',
|
|
44
|
+
Effect.fnUntraced(
|
|
45
|
+
function* (_) {
|
|
46
|
+
const { agent, conversation } = yield* setupBoundAgent();
|
|
47
|
+
const chat = yield* Agent.loadChat(agent);
|
|
48
|
+
invariant(chat, 'Agent chat not found.');
|
|
49
|
+
const { text } = yield* Chat.ensureOutlineText(chat);
|
|
50
|
+
Obj.update(text, (text) => {
|
|
51
|
+
text.content = Outline.upsertChecklistItems(text.content, [{ title: 'Buy eggs', done: false }]);
|
|
52
|
+
});
|
|
53
|
+
yield* Database.flush();
|
|
54
|
+
|
|
55
|
+
const context = yield* Operation.invoke(AgentSkillOperations.GetContext, {}).pipe(Effect.provide(conversation));
|
|
56
|
+
|
|
57
|
+
expect(context.checklist).toContain('Buy eggs');
|
|
58
|
+
},
|
|
59
|
+
Effect.provide(OperationTestLayer),
|
|
60
|
+
TestHelpers.provideTestContext,
|
|
61
|
+
),
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Creates an agent and binds it to its own chat feed so the harness-scoped operation resolves it.
|
|
66
|
+
const setupBoundAgent = Effect.fnUntraced(function* () {
|
|
67
|
+
const agent = yield* Agent.makeInitialized(
|
|
68
|
+
{ name: 'Test Agent', instructions: 'A test agent for context.' },
|
|
69
|
+
AgentSkillDef.make(),
|
|
70
|
+
);
|
|
71
|
+
yield* Database.flush();
|
|
72
|
+
|
|
73
|
+
const chat = yield* Agent.loadChat(agent);
|
|
74
|
+
const chatFeed = chat?.feed?.target;
|
|
75
|
+
invariant(chatFeed, 'Agent chat feed not found.');
|
|
76
|
+
const runtime = yield* Effect.runtime<Database.Service>();
|
|
77
|
+
const binder = new AiContext.Binder({ feed: chatFeed, runtime });
|
|
78
|
+
yield* Effect.promise(() => binder.bind({ objects: [Ref.make(agent)] }));
|
|
79
|
+
|
|
80
|
+
return { agent, conversation: Operation.withInvocationOptions({ conversation: Obj.getURI(chatFeed) }) };
|
|
81
|
+
});
|
|
@@ -6,21 +6,13 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Harness } from '@dxos/assistant';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
|
-
import {
|
|
9
|
+
import { Filter } from '@dxos/echo';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
|
|
12
12
|
import { HarnessContextError } from '../../../errors';
|
|
13
|
-
import { Agent, Chat
|
|
13
|
+
import { Agent, Chat } from '../../../types';
|
|
14
14
|
import { GetContext } from './definitions';
|
|
15
15
|
|
|
16
|
-
const formatPlan = (chat: Chat.Chat) =>
|
|
17
|
-
chat.plan
|
|
18
|
-
? chat.plan.pipe(Database.load).pipe(
|
|
19
|
-
Effect.map(Plan.formatPlan),
|
|
20
|
-
Effect.catchTag('EntityNotFoundError', () => Effect.succeed('No plan found.')),
|
|
21
|
-
)
|
|
22
|
-
: Effect.succeed('No plan found.');
|
|
23
|
-
|
|
24
16
|
export default GetContext.pipe(
|
|
25
17
|
Operation.withHandler(
|
|
26
18
|
Effect.fnUntraced(function* () {
|
|
@@ -28,7 +20,7 @@ export default GetContext.pipe(
|
|
|
28
20
|
const chats = yield* Harness.queryContext(Filter.type(Chat.Chat));
|
|
29
21
|
|
|
30
22
|
if (agents.length === 0 && chats.length === 0) {
|
|
31
|
-
return { id: '', name: '', instructions: 'No agent context.',
|
|
23
|
+
return { id: '', name: '', instructions: 'No agent context.', checklist: 'No checklist found.' };
|
|
32
24
|
}
|
|
33
25
|
if (agents.length > 1) {
|
|
34
26
|
return yield* Effect.fail(new HarnessContextError({ type: 'agent', count: agents.length }));
|
|
@@ -37,15 +29,9 @@ export default GetContext.pipe(
|
|
|
37
29
|
return yield* Effect.fail(new HarnessContextError({ type: 'chat', count: chats.length }));
|
|
38
30
|
}
|
|
39
31
|
|
|
40
|
-
// Prefer the directly bound chat; fall back to the agent's
|
|
32
|
+
// Prefer the directly bound chat; fall back to the agent's companion chat when no chat is bound.
|
|
41
33
|
const directChat = chats.length === 1 ? chats[0] : undefined;
|
|
42
|
-
const chat =
|
|
43
|
-
directChat ??
|
|
44
|
-
(agents.length > 0 && agents[0].chat
|
|
45
|
-
? yield* agents[0].chat
|
|
46
|
-
.pipe(Database.load)
|
|
47
|
-
.pipe(Effect.catchTag('EntityNotFoundError', () => Effect.succeed(undefined)))
|
|
48
|
-
: undefined);
|
|
34
|
+
const chat = directChat ?? (agents.length > 0 ? yield* Agent.loadChat(agents[0]) : undefined);
|
|
49
35
|
|
|
50
36
|
if (agents.length === 0) {
|
|
51
37
|
invariant(chat, 'Expected a bound chat when no agent is in context.');
|
|
@@ -53,8 +39,7 @@ export default GetContext.pipe(
|
|
|
53
39
|
id: chat.id,
|
|
54
40
|
name: chat.name ?? '',
|
|
55
41
|
instructions: 'No agent context.',
|
|
56
|
-
|
|
57
|
-
artifacts: [],
|
|
42
|
+
checklist: yield* Chat.formatChecklist(chat),
|
|
58
43
|
};
|
|
59
44
|
}
|
|
60
45
|
|
|
@@ -63,23 +48,11 @@ export default GetContext.pipe(
|
|
|
63
48
|
return {
|
|
64
49
|
id: agent.id,
|
|
65
50
|
name: agent.name,
|
|
66
|
-
instructions: yield*
|
|
67
|
-
Effect.map((_) => _.
|
|
51
|
+
instructions: yield* Agent.loadInstructions(agent).pipe(
|
|
52
|
+
Effect.map((_) => _.text),
|
|
68
53
|
Effect.catchTag('EntityNotFoundError', () => Effect.succeed('No instructions found.')),
|
|
69
54
|
),
|
|
70
|
-
|
|
71
|
-
artifacts: yield* Effect.forEach(agent.artifacts, (artifact) =>
|
|
72
|
-
Effect.gen(function* () {
|
|
73
|
-
return {
|
|
74
|
-
name: artifact.name,
|
|
75
|
-
type: yield* Database.load(artifact.data).pipe(
|
|
76
|
-
Effect.map(Obj.getTypename),
|
|
77
|
-
Effect.catchTag('EntityNotFoundError', () => Effect.succeed('Artifact not found.')),
|
|
78
|
-
),
|
|
79
|
-
dxn: artifact.data.uri,
|
|
80
|
-
};
|
|
81
|
-
}),
|
|
82
|
-
),
|
|
55
|
+
checklist: yield* chat ? Chat.formatChecklist(chat) : Effect.succeed('No checklist found.'),
|
|
83
56
|
};
|
|
84
57
|
}) as any,
|
|
85
58
|
),
|
|
@@ -7,8 +7,6 @@ import { OperationHandlerSet } from '@dxos/compute';
|
|
|
7
7
|
export * as AgentSkillOperations from './definitions';
|
|
8
8
|
|
|
9
9
|
export const AgentSkillHandlers = OperationHandlerSet.lazy(
|
|
10
|
-
() => import('./add-artifact'),
|
|
11
|
-
() => import('./agent'),
|
|
12
10
|
() => import('./get-context'),
|
|
13
|
-
() => import('./
|
|
11
|
+
() => import('./relay'),
|
|
14
12
|
);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import { expect } from 'vitest';
|
|
8
|
+
|
|
9
|
+
import { AssistantTestLayer } from '@dxos/agent-runtime/testing';
|
|
10
|
+
import { Instructions, Operation, OperationHandlerSet, Process } from '@dxos/compute';
|
|
11
|
+
import { ProcessManager } from '@dxos/compute-runtime';
|
|
12
|
+
import { Database, Feed, Obj, Ref } from '@dxos/echo';
|
|
13
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
14
|
+
import { Text } from '@dxos/schema';
|
|
15
|
+
|
|
16
|
+
import { Chat } from '../../../types';
|
|
17
|
+
import { Relay } from './definitions';
|
|
18
|
+
import relayHandler from './relay';
|
|
19
|
+
|
|
20
|
+
const TestLayer = AssistantTestLayer({
|
|
21
|
+
operationHandlers: OperationHandlerSet.make(relayHandler),
|
|
22
|
+
types: [Chat.Chat, Instructions.Instructions, Text.Text, Feed.Feed],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Control-plane only: the qualify:false path needs no LLM turn, so it runs ungated in CI.
|
|
26
|
+
// Qualification itself (cheap-model relevance) is covered by the memoized agent-skill suite.
|
|
27
|
+
describe('Agent relay (control plane)', () => {
|
|
28
|
+
it.scoped(
|
|
29
|
+
'forwards onto the durable session for the chat feed',
|
|
30
|
+
Effect.fnUntraced(
|
|
31
|
+
function* (_) {
|
|
32
|
+
const processManager = yield* ProcessManager.ProcessManagerService;
|
|
33
|
+
|
|
34
|
+
const instructions = yield* Database.add(Instructions.make({ text: 'Relay target.' }));
|
|
35
|
+
const feed = yield* Database.add(Feed.make());
|
|
36
|
+
const chat = yield* Database.add(
|
|
37
|
+
Chat.make({ name: 'Relay chat', feed: Ref.make(feed), instructions: Ref.make(instructions) }),
|
|
38
|
+
);
|
|
39
|
+
yield* Database.flush();
|
|
40
|
+
|
|
41
|
+
yield* Operation.invoke(Relay, {
|
|
42
|
+
chat: Ref.make(chat),
|
|
43
|
+
prompt: 'Wake up.',
|
|
44
|
+
qualify: false,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Delivery lands on the durable process keyed by the chat feed (spawned on demand).
|
|
48
|
+
const target = Obj.getURI(feed);
|
|
49
|
+
const processes = yield* processManager.list({ target });
|
|
50
|
+
expect(processes.length).toBeGreaterThanOrEqual(1);
|
|
51
|
+
|
|
52
|
+
// Terminate before the turn runs — this test proves delivery, not the LLM turn.
|
|
53
|
+
for (const handle of processes) {
|
|
54
|
+
if (handle.status.state === Process.State.RUNNING) {
|
|
55
|
+
yield* handle.terminate();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
Effect.provide(TestLayer),
|
|
60
|
+
TestHelpers.provideTestContext,
|
|
61
|
+
),
|
|
62
|
+
);
|
|
63
|
+
});
|