@dxos/assistant-toolkit 0.10.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/chunk-Chat.mjs +144 -0
- package/dist/lib/chunk-Chat.mjs.map +1 -0
- package/dist/lib/chunk-Memory.mjs +19 -0
- package/dist/lib/chunk-Memory.mjs.map +1 -0
- package/dist/lib/{neutral/agent-rules-KWCBKJ5W.mjs → chunk-agent-rules.mjs} +8 -15
- package/dist/lib/chunk-agent-rules.mjs.map +1 -0
- package/dist/lib/chunk-agent.mjs +45 -0
- package/dist/lib/chunk-agent.mjs.map +1 -0
- package/dist/lib/chunk-artifact-add.mjs +31 -0
- package/dist/lib/chunk-artifact-add.mjs.map +1 -0
- package/dist/lib/chunk-artifact-list.mjs +23 -0
- package/dist/lib/chunk-artifact-list.mjs.map +1 -0
- package/dist/lib/chunk-context-add.mjs +16 -0
- package/dist/lib/chunk-context-add.mjs.map +1 -0
- package/dist/lib/chunk-context-remove.mjs +16 -0
- package/dist/lib/chunk-context-remove.mjs.map +1 -0
- package/dist/lib/chunk-create-agent.mjs +23 -0
- package/dist/lib/chunk-create-agent.mjs.map +1 -0
- package/dist/lib/chunk-definitions.mjs +52 -0
- package/dist/lib/chunk-definitions.mjs.map +1 -0
- package/dist/lib/chunk-definitions2.mjs +56 -0
- package/dist/lib/chunk-definitions2.mjs.map +1 -0
- package/dist/lib/chunk-definitions3.mjs +24 -0
- package/dist/lib/chunk-definitions3.mjs.map +1 -0
- package/dist/lib/chunk-delete.mjs +14 -0
- package/dist/lib/chunk-delete.mjs.map +1 -0
- package/dist/lib/chunk-enable-skills.mjs +39 -0
- package/dist/lib/chunk-enable-skills.mjs.map +1 -0
- package/dist/lib/chunk-fetch-messages.mjs +113 -0
- package/dist/lib/chunk-fetch-messages.mjs.map +1 -0
- package/dist/lib/chunk-fetch.mjs +20 -0
- package/dist/lib/chunk-fetch.mjs.map +1 -0
- package/dist/lib/chunk-get-context.mjs +55 -0
- package/dist/lib/chunk-get-context.mjs.map +1 -0
- package/dist/lib/chunk-get-current-date.mjs +17 -0
- package/dist/lib/chunk-get-current-date.mjs.map +1 -0
- package/dist/lib/chunk-load.mjs +13 -0
- package/dist/lib/chunk-load.mjs.map +1 -0
- package/dist/lib/chunk-object-create.mjs +42 -0
- package/dist/lib/chunk-object-create.mjs.map +1 -0
- package/dist/lib/chunk-object-delete.mjs +14 -0
- package/dist/lib/chunk-object-delete.mjs.map +1 -0
- package/dist/lib/chunk-object-update.mjs +19 -0
- package/dist/lib/chunk-object-update.mjs.map +1 -0
- package/dist/lib/chunk-operations.mjs +714 -0
- package/dist/lib/chunk-operations.mjs.map +1 -0
- package/dist/lib/chunk-plan-reminder.mjs +80 -0
- package/dist/lib/chunk-plan-reminder.mjs.map +1 -0
- package/dist/lib/chunk-query-skills.mjs +12 -0
- package/dist/lib/chunk-query-skills.mjs.map +1 -0
- package/dist/lib/chunk-query.mjs +36 -0
- package/dist/lib/chunk-query.mjs.map +1 -0
- package/dist/lib/chunk-query2.mjs +18 -0
- package/dist/lib/chunk-query2.mjs.map +1 -0
- package/dist/lib/chunk-relation-create.mjs +41 -0
- package/dist/lib/chunk-relation-create.mjs.map +1 -0
- package/dist/lib/chunk-relation-delete.mjs +14 -0
- package/dist/lib/chunk-relation-delete.mjs.map +1 -0
- package/dist/lib/chunk-relay.mjs +76 -0
- package/dist/lib/chunk-relay.mjs.map +1 -0
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-run-instructions.mjs +145 -0
- package/dist/lib/chunk-run-instructions.mjs.map +1 -0
- package/dist/lib/chunk-save.mjs +17 -0
- package/dist/lib/chunk-save.mjs.map +1 -0
- package/dist/lib/chunk-schema-add.mjs +19 -0
- package/dist/lib/chunk-schema-add.mjs.map +1 -0
- package/dist/lib/chunk-schema-list.mjs +29 -0
- package/dist/lib/chunk-schema-list.mjs.map +1 -0
- package/dist/lib/chunk-set-alarm.mjs +55 -0
- package/dist/lib/chunk-set-alarm.mjs.map +1 -0
- package/dist/lib/chunk-sync-automation.mjs +130 -0
- package/dist/lib/chunk-sync-automation.mjs.map +1 -0
- package/dist/lib/chunk-sync-issues.mjs +127 -0
- package/dist/lib/chunk-sync-issues.mjs.map +1 -0
- package/dist/lib/chunk-sync.mjs +91 -0
- package/dist/lib/chunk-sync.mjs.map +1 -0
- package/dist/lib/chunk-tag-add.mjs +14 -0
- package/dist/lib/chunk-tag-add.mjs.map +1 -0
- package/dist/lib/chunk-tag-remove.mjs +14 -0
- package/dist/lib/chunk-tag-remove.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +198 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/chunk-update-tasks.mjs +34 -0
- package/dist/lib/chunk-update-tasks.mjs.map +1 -0
- package/dist/lib/index.mjs +614 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/testing.mjs +102 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/types/src/skills/agent/operations/definitions.d.ts +16 -46
- package/dist/types/src/skills/agent/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/agent/operations/get-context.test.d.ts +2 -0
- package/dist/types/src/skills/agent/operations/get-context.test.d.ts.map +1 -0
- package/dist/types/src/skills/agent/operations/index.d.ts.map +1 -1
- package/dist/types/src/skills/agent/operations/relay.d.ts +11 -0
- package/dist/types/src/skills/agent/operations/relay.d.ts.map +1 -0
- package/dist/types/src/skills/agent/operations/relay.test.d.ts +2 -0
- package/dist/types/src/skills/agent/operations/relay.test.d.ts.map +1 -0
- package/dist/types/src/skills/agent/skill.d.ts.map +1 -1
- package/dist/types/src/skills/agent-wizard/operations/definitions.d.ts +4 -1
- package/dist/types/src/skills/agent-wizard/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/agent-wizard/operations/sync-automation.d.ts +26 -0
- package/dist/types/src/skills/agent-wizard/operations/sync-automation.d.ts.map +1 -0
- package/dist/types/src/skills/agent-wizard/operations/sync-automation.test.d.ts +2 -0
- package/dist/types/src/skills/agent-wizard/operations/sync-automation.test.d.ts.map +1 -0
- package/dist/types/src/skills/agent-wizard/skill.d.ts.map +1 -1
- package/dist/types/src/skills/database/operations/context-add.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/context-add.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/context-remove.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/context-remove.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/definitions.d.ts +7 -2
- package/dist/types/src/skills/database/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/database/operations/load.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/load.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/object-create.d.ts +4 -1
- package/dist/types/src/skills/database/operations/object-create.d.ts.map +1 -1
- package/dist/types/src/skills/database/operations/object-create.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/object-create.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/object-delete.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/object-delete.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/object-update.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/object-update.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/query.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/query.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/relation-create.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/relation-create.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/schema-add.d.ts +3 -1
- package/dist/types/src/skills/database/operations/schema-add.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/schema-add.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/schema-list.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/schema-list.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/tag-add.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/tag-add.test.d.ts.map +1 -0
- package/dist/types/src/skills/database/operations/tag-remove.test.d.ts +2 -0
- package/dist/types/src/skills/database/operations/tag-remove.test.d.ts.map +1 -0
- package/dist/types/src/skills/delegation/operations/delegate-task.d.ts +6 -5
- package/dist/types/src/skills/delegation/operations/delegate-task.d.ts.map +1 -1
- package/dist/types/src/skills/index.d.ts +1 -0
- package/dist/types/src/skills/index.d.ts.map +1 -1
- package/dist/types/src/skills/linear/operations/sync-issues.d.ts.map +1 -1
- package/dist/types/src/skills/memory/operations/delete.test.d.ts +2 -0
- package/dist/types/src/skills/memory/operations/delete.test.d.ts.map +1 -0
- package/dist/types/src/skills/memory/operations/query.test.d.ts +2 -0
- package/dist/types/src/skills/memory/operations/query.test.d.ts.map +1 -0
- package/dist/types/src/skills/memory/operations/save.test.d.ts +2 -0
- package/dist/types/src/skills/memory/operations/save.test.d.ts.map +1 -0
- package/dist/types/src/skills/planning/operations/definitions.d.ts +1 -3
- package/dist/types/src/skills/planning/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/planning/operations/plan-reminder.d.ts +7 -6
- package/dist/types/src/skills/planning/operations/plan-reminder.d.ts.map +1 -1
- package/dist/types/src/skills/planning/operations/plan-reminder.test.d.ts +2 -0
- package/dist/types/src/skills/planning/operations/plan-reminder.test.d.ts.map +1 -0
- package/dist/types/src/skills/planning/operations/update-tasks.d.ts +3 -1
- package/dist/types/src/skills/planning/operations/update-tasks.d.ts.map +1 -1
- package/dist/types/src/skills/project/index.d.ts +3 -0
- package/dist/types/src/skills/project/index.d.ts.map +1 -0
- package/dist/types/src/skills/project/operations/artifact-add.d.ts +5 -0
- package/dist/types/src/skills/project/operations/artifact-add.d.ts.map +1 -0
- package/dist/types/src/skills/project/operations/artifact-list.d.ts +5 -0
- package/dist/types/src/skills/project/operations/artifact-list.d.ts.map +1 -0
- package/dist/types/src/skills/project/operations/definitions.d.ts +23 -0
- package/dist/types/src/skills/project/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/skills/project/operations/index.d.ts +4 -0
- package/dist/types/src/skills/project/operations/index.d.ts.map +1 -0
- package/dist/types/src/skills/project/skill.d.ts +4 -0
- package/dist/types/src/skills/project/skill.d.ts.map +1 -0
- package/dist/types/src/skills/project/skill.test.d.ts.map +1 -0
- package/dist/types/src/skills/skill-manager/skill.d.ts.map +1 -1
- package/dist/types/src/supervisor/delegation-strategy.d.ts +5 -5
- package/dist/types/src/supervisor/delegation-strategy.d.ts.map +1 -1
- package/dist/types/src/supervisor/delegation-strategy.test.d.ts +2 -0
- package/dist/types/src/supervisor/delegation-strategy.test.d.ts.map +1 -0
- package/dist/types/src/sync/sync.test.d.ts +2 -0
- package/dist/types/src/sync/sync.test.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/operations.d.ts +7 -0
- package/dist/types/src/testing/operations.d.ts.map +1 -0
- package/dist/types/src/types/Agent.d.ts +28 -31
- package/dist/types/src/types/Agent.d.ts.map +1 -1
- package/dist/types/src/types/Chat.d.ts +28 -14
- package/dist/types/src/types/Chat.d.ts.map +1 -1
- package/dist/types/src/types/Chat.test.d.ts +2 -0
- package/dist/types/src/types/Chat.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -29
- package/src/operations/run-instructions.test.ts +26 -34
- package/src/operations/skill-resolution.test.ts +6 -1
- package/src/skills/agent/operations/definitions.ts +18 -62
- package/src/skills/agent/operations/get-context.test.ts +81 -0
- package/src/skills/agent/operations/get-context.ts +9 -36
- package/src/skills/agent/operations/index.ts +1 -3
- package/src/skills/agent/operations/relay.test.ts +63 -0
- package/src/skills/agent/operations/relay.ts +124 -0
- package/src/skills/agent/skill.ts +3 -15
- package/src/skills/agent-wizard/operations/create-agent.ts +3 -3
- package/src/skills/agent-wizard/operations/definitions.ts +19 -4
- package/src/skills/agent-wizard/operations/index.ts +1 -1
- package/src/skills/agent-wizard/operations/sync-automation.test.ts +103 -0
- package/src/skills/agent-wizard/operations/sync-automation.ts +205 -0
- package/src/skills/agent-wizard/skill.ts +9 -10
- package/src/skills/alarm/skill.test.ts +2 -2
- package/src/skills/browser/skill.test.ts +4 -4
- package/src/skills/database/operations/context-add.test.ts +46 -0
- package/src/skills/database/operations/context-remove.test.ts +46 -0
- package/src/skills/database/operations/definitions.ts +23 -7
- package/src/skills/database/operations/load.test.ts +38 -0
- package/src/skills/database/operations/object-create.test.ts +116 -0
- package/src/skills/database/operations/object-create.ts +13 -2
- package/src/skills/database/operations/object-delete.test.ts +37 -0
- package/src/skills/database/operations/object-update.test.ts +39 -0
- package/src/skills/database/operations/query.test.ts +128 -0
- package/src/skills/database/operations/relation-create.test.ts +46 -0
- package/src/skills/database/operations/schema-add.test.ts +79 -0
- package/src/skills/database/operations/schema-list.test.ts +42 -0
- package/src/skills/database/operations/tag-add.test.ts +41 -0
- package/src/skills/database/operations/tag-remove.test.ts +43 -0
- package/src/skills/delegation/operations/delegate-task.test.ts +51 -36
- package/src/skills/delegation/operations/delegate-task.ts +31 -48
- package/src/skills/discord/operations/fetch-messages.test.ts +2 -2
- package/src/skills/github/operations/fetch-prs.ts +1 -1
- package/src/skills/index.ts +1 -0
- package/src/skills/linear/operations/linear.test.ts +1 -1
- package/src/skills/linear/operations/sync-issues.ts +6 -23
- package/src/skills/memory/operations/delete.test.ts +37 -0
- package/src/skills/memory/operations/query.test.ts +76 -0
- package/src/skills/memory/operations/save.test.ts +43 -0
- package/src/skills/planning/operations/definitions.ts +9 -6
- package/src/skills/planning/operations/plan-reminder.test.ts +123 -0
- package/src/skills/planning/operations/plan-reminder.ts +49 -31
- package/src/skills/planning/operations/update-tasks.md +23 -22
- package/src/skills/planning/operations/update-tasks.test.ts +31 -17
- package/src/skills/planning/operations/update-tasks.ts +17 -25
- package/src/skills/project/index.ts +6 -0
- package/src/skills/project/operations/artifact-add.ts +47 -0
- package/src/skills/project/operations/artifact-list.ts +41 -0
- package/src/skills/project/operations/definitions.ts +63 -0
- package/src/skills/project/operations/index.ts +12 -0
- package/src/skills/project/skill.test.ts +78 -0
- package/src/skills/project/skill.ts +42 -0
- package/src/skills/skill-manager/operations/definitions.ts +1 -1
- package/src/skills/skill-manager/skill.test.ts +1 -1
- package/src/skills/skill-manager/skill.ts +7 -5
- package/src/skills/websearch/skill.test.ts +2 -2
- package/src/supervisor/delegation-strategy.test.ts +129 -0
- package/src/supervisor/delegation-strategy.ts +92 -56
- package/src/sync/sync.test.ts +95 -0
- package/src/sync/sync.ts +5 -3
- package/src/testing/index.ts +1 -0
- package/src/testing/operations.ts +65 -0
- package/src/types/Agent.test.ts +36 -66
- package/src/types/Agent.ts +108 -137
- package/src/types/Chat.test.ts +234 -0
- package/src/types/Chat.ts +80 -26
- package/src/types/index.ts +1 -2
- package/dist/lib/neutral/add-artifact-5JNUYLCA.mjs +0 -24
- package/dist/lib/neutral/add-artifact-5JNUYLCA.mjs.map +0 -7
- package/dist/lib/neutral/agent-BFAYIBJI.mjs +0 -65
- package/dist/lib/neutral/agent-BFAYIBJI.mjs.map +0 -7
- package/dist/lib/neutral/agent-rules-KWCBKJ5W.mjs.map +0 -7
- package/dist/lib/neutral/chunk-3KA66YBF.mjs +0 -62
- package/dist/lib/neutral/chunk-3KA66YBF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-6SGNFL6I.mjs +0 -85
- package/dist/lib/neutral/chunk-6SGNFL6I.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BDTGFPM7.mjs +0 -113
- package/dist/lib/neutral/chunk-BDTGFPM7.mjs.map +0 -7
- package/dist/lib/neutral/chunk-EPQCDGIV.mjs +0 -27
- package/dist/lib/neutral/chunk-EPQCDGIV.mjs.map +0 -7
- package/dist/lib/neutral/chunk-H4W22FFJ.mjs +0 -232
- package/dist/lib/neutral/chunk-H4W22FFJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JBTXZQ5G.mjs +0 -60
- package/dist/lib/neutral/chunk-JBTXZQ5G.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JKOOA5OS.mjs +0 -97
- package/dist/lib/neutral/chunk-JKOOA5OS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JTEBE7KA.mjs +0 -66
- package/dist/lib/neutral/chunk-JTEBE7KA.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KLFXJ2Z3.mjs +0 -36
- package/dist/lib/neutral/chunk-KLFXJ2Z3.mjs.map +0 -7
- package/dist/lib/neutral/chunk-LBA5UOLF.mjs +0 -87
- package/dist/lib/neutral/chunk-LBA5UOLF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-LL3MOQUZ.mjs +0 -120
- package/dist/lib/neutral/chunk-LL3MOQUZ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-MFVIGJBW.mjs +0 -68
- package/dist/lib/neutral/chunk-MFVIGJBW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PBARVBNJ.mjs +0 -86
- package/dist/lib/neutral/chunk-PBARVBNJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VJ5QBYM5.mjs +0 -61
- package/dist/lib/neutral/chunk-VJ5QBYM5.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YQSQRSXG.mjs +0 -367
- package/dist/lib/neutral/chunk-YQSQRSXG.mjs.map +0 -7
- package/dist/lib/neutral/chunk-Z2HFOZXK.mjs +0 -191
- package/dist/lib/neutral/chunk-Z2HFOZXK.mjs.map +0 -7
- package/dist/lib/neutral/context-add-DZTPB3FK.mjs +0 -22
- package/dist/lib/neutral/context-add-DZTPB3FK.mjs.map +0 -7
- package/dist/lib/neutral/context-remove-XSBOM4VJ.mjs +0 -22
- package/dist/lib/neutral/context-remove-XSBOM4VJ.mjs.map +0 -7
- package/dist/lib/neutral/create-agent-5WTOFIEK.mjs +0 -35
- package/dist/lib/neutral/create-agent-5WTOFIEK.mjs.map +0 -7
- package/dist/lib/neutral/definitions-VRR5OGXI.mjs +0 -17
- package/dist/lib/neutral/definitions-VRR5OGXI.mjs.map +0 -7
- package/dist/lib/neutral/delegate-task-UX64NK4M.mjs +0 -13
- package/dist/lib/neutral/delegate-task-UX64NK4M.mjs.map +0 -7
- package/dist/lib/neutral/delete-IU7HPU3K.mjs +0 -19
- package/dist/lib/neutral/delete-IU7HPU3K.mjs.map +0 -7
- package/dist/lib/neutral/enable-skills-FHEJXQVB.mjs +0 -47
- package/dist/lib/neutral/enable-skills-FHEJXQVB.mjs.map +0 -7
- package/dist/lib/neutral/fetch-5LY25EBR.mjs +0 -24
- package/dist/lib/neutral/fetch-5LY25EBR.mjs.map +0 -7
- package/dist/lib/neutral/fetch-messages-CQMDI36G.mjs +0 -139
- package/dist/lib/neutral/fetch-messages-CQMDI36G.mjs.map +0 -7
- package/dist/lib/neutral/get-context-Q4YY6DRV.mjs +0 -77
- package/dist/lib/neutral/get-context-Q4YY6DRV.mjs.map +0 -7
- package/dist/lib/neutral/get-current-date-JR5F7ZS3.mjs +0 -17
- package/dist/lib/neutral/get-current-date-JR5F7ZS3.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -875
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/load-S6HC5TGX.mjs +0 -17
- package/dist/lib/neutral/load-S6HC5TGX.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/object-create-PVDQ62CG.mjs +0 -32
- package/dist/lib/neutral/object-create-PVDQ62CG.mjs.map +0 -7
- package/dist/lib/neutral/object-delete-3CSL6XI6.mjs +0 -18
- package/dist/lib/neutral/object-delete-3CSL6XI6.mjs.map +0 -7
- package/dist/lib/neutral/object-update-NIGMZINM.mjs +0 -28
- package/dist/lib/neutral/object-update-NIGMZINM.mjs.map +0 -7
- package/dist/lib/neutral/plan-reminder-N4X6JPBI.mjs +0 -88
- package/dist/lib/neutral/plan-reminder-N4X6JPBI.mjs.map +0 -7
- package/dist/lib/neutral/qualifier-5CIRZYX5.mjs +0 -91
- package/dist/lib/neutral/qualifier-5CIRZYX5.mjs.map +0 -7
- package/dist/lib/neutral/query-K4R7UHLU.mjs +0 -32
- package/dist/lib/neutral/query-K4R7UHLU.mjs.map +0 -7
- package/dist/lib/neutral/query-NCTCRYTD.mjs +0 -59
- package/dist/lib/neutral/query-NCTCRYTD.mjs.map +0 -7
- package/dist/lib/neutral/query-skills-7GQFSU4V.mjs +0 -17
- package/dist/lib/neutral/query-skills-7GQFSU4V.mjs.map +0 -7
- package/dist/lib/neutral/relation-create-QKXHTL7G.mjs +0 -34
- package/dist/lib/neutral/relation-create-QKXHTL7G.mjs.map +0 -7
- package/dist/lib/neutral/relation-delete-PDIWT2JX.mjs +0 -18
- package/dist/lib/neutral/relation-delete-PDIWT2JX.mjs.map +0 -7
- package/dist/lib/neutral/run-instructions-72ASH5EZ.mjs +0 -165
- package/dist/lib/neutral/run-instructions-72ASH5EZ.mjs.map +0 -7
- package/dist/lib/neutral/save-UYVRA4RS.mjs +0 -23
- package/dist/lib/neutral/save-UYVRA4RS.mjs.map +0 -7
- package/dist/lib/neutral/schema-add-5NOK2RWE.mjs +0 -25
- package/dist/lib/neutral/schema-add-5NOK2RWE.mjs.map +0 -7
- package/dist/lib/neutral/schema-list-BZUR5KMX.mjs +0 -37
- package/dist/lib/neutral/schema-list-BZUR5KMX.mjs.map +0 -7
- package/dist/lib/neutral/set-alarm-BD3NEYSU.mjs +0 -65
- package/dist/lib/neutral/set-alarm-BD3NEYSU.mjs.map +0 -7
- package/dist/lib/neutral/sync-issues-O76MCMD3.mjs +0 -166
- package/dist/lib/neutral/sync-issues-O76MCMD3.mjs.map +0 -7
- package/dist/lib/neutral/sync-triggers-YBTLPCUB.mjs +0 -138
- package/dist/lib/neutral/sync-triggers-YBTLPCUB.mjs.map +0 -7
- package/dist/lib/neutral/tag-add-L5WNOBYY.mjs +0 -18
- package/dist/lib/neutral/tag-add-L5WNOBYY.mjs.map +0 -7
- package/dist/lib/neutral/tag-remove-WV5RPE5W.mjs +0 -18
- package/dist/lib/neutral/tag-remove-WV5RPE5W.mjs.map +0 -7
- package/dist/lib/neutral/testing/index.mjs +0 -65
- package/dist/lib/neutral/testing/index.mjs.map +0 -7
- package/dist/lib/neutral/update-tasks-HX4ILWOU.mjs +0 -46
- package/dist/lib/neutral/update-tasks-HX4ILWOU.mjs.map +0 -7
- package/dist/types/src/skills/agent/operations/add-artifact.d.ts +0 -4
- package/dist/types/src/skills/agent/operations/add-artifact.d.ts.map +0 -1
- package/dist/types/src/skills/agent/operations/agent.d.ts +0 -4
- package/dist/types/src/skills/agent/operations/agent.d.ts.map +0 -1
- package/dist/types/src/skills/agent/operations/qualifier.d.ts +0 -5
- package/dist/types/src/skills/agent/operations/qualifier.d.ts.map +0 -1
- package/dist/types/src/skills/agent/skill.test.d.ts.map +0 -1
- package/dist/types/src/skills/agent-wizard/operations/sync-triggers.d.ts +0 -8
- package/dist/types/src/skills/agent-wizard/operations/sync-triggers.d.ts.map +0 -1
- package/dist/types/src/skills/database/skill.test.d.ts +0 -2
- package/dist/types/src/skills/database/skill.test.d.ts.map +0 -1
- package/dist/types/src/skills/memory/skill.test.d.ts +0 -2
- package/dist/types/src/skills/memory/skill.test.d.ts.map +0 -1
- package/dist/types/src/skills/planning/skill.test.d.ts +0 -2
- package/dist/types/src/skills/planning/skill.test.d.ts.map +0 -1
- package/dist/types/src/types/Plan.d.ts +0 -80
- package/dist/types/src/types/Plan.d.ts.map +0 -1
- package/src/operations/run-instructions.conversations.json +0 -1
- package/src/skills/agent/operations/add-artifact.ts +0 -20
- package/src/skills/agent/operations/agent.ts +0 -69
- package/src/skills/agent/operations/qualifier.ts +0 -97
- package/src/skills/agent/skill.conversations.json +0 -1
- package/src/skills/agent/skill.test.ts +0 -728
- package/src/skills/agent-wizard/operations/sync-triggers.ts +0 -169
- package/src/skills/database/skill.conversations.json +0 -1
- package/src/skills/database/skill.test.ts +0 -531
- package/src/skills/memory/skill.conversations.json +0 -1
- package/src/skills/memory/skill.test.ts +0 -138
- package/src/skills/planning/skill.conversations.json +0 -1
- package/src/skills/planning/skill.test.ts +0 -123
- package/src/types/Plan.ts +0 -123
- /package/dist/types/src/skills/{agent → project}/skill.test.d.ts +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
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, Feed, Obj, Query, Ref } from '@dxos/echo';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { EID, EntityId } from '@dxos/keys';
|
|
13
|
+
import { Organization } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { OperationTestLayer } from '../../../testing';
|
|
16
|
+
import { ContextAdd } from './definitions';
|
|
17
|
+
|
|
18
|
+
EntityId.dangerouslyDisableRandomness();
|
|
19
|
+
|
|
20
|
+
describe('ContextAdd', () => {
|
|
21
|
+
it.effect(
|
|
22
|
+
'context-add: binds the object to the conversation',
|
|
23
|
+
Effect.fnUntraced(
|
|
24
|
+
function* (_) {
|
|
25
|
+
const feed = yield* Database.add(Feed.make());
|
|
26
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Context Corp' }));
|
|
27
|
+
yield* Database.flush();
|
|
28
|
+
|
|
29
|
+
yield* Operation.invoke(ContextAdd, { obj: Ref.make(organization) }).pipe(
|
|
30
|
+
Effect.provide(Operation.withInvocationOptions({ conversation: Obj.getURI(feed) })),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const bindings = yield* Feed.query(feed, Query.type(AiContext.Binding)).run;
|
|
34
|
+
const added = bindings.flatMap((binding) => entityIds(binding.objects.added));
|
|
35
|
+
expect(added).toContain(organization.id);
|
|
36
|
+
},
|
|
37
|
+
Effect.provide(OperationTestLayer),
|
|
38
|
+
TestHelpers.provideTestContext,
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Compare by entity id: a same-space ref stores a local EID (`echo:/<id>`) while `Obj.getURI`
|
|
44
|
+
// returns the fully-qualified form (`echo://<space>/<id>`).
|
|
45
|
+
const entityIds = (refs: readonly Ref.Ref<Obj.Unknown>[]): (string | undefined)[] =>
|
|
46
|
+
refs.map((ref) => EID.getEntityId(EID.parse(ref.uri)));
|
|
@@ -0,0 +1,46 @@
|
|
|
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, Feed, Obj, Query, Ref } from '@dxos/echo';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { EID, EntityId } from '@dxos/keys';
|
|
13
|
+
import { Organization } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { OperationTestLayer } from '../../../testing';
|
|
16
|
+
import { ContextAdd, ContextRemove } from './definitions';
|
|
17
|
+
|
|
18
|
+
EntityId.dangerouslyDisableRandomness();
|
|
19
|
+
|
|
20
|
+
describe('ContextRemove', () => {
|
|
21
|
+
it.effect(
|
|
22
|
+
'context-remove: unbinds the object from the conversation',
|
|
23
|
+
Effect.fnUntraced(
|
|
24
|
+
function* (_) {
|
|
25
|
+
const feed = yield* Database.add(Feed.make());
|
|
26
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Remove Context Corp' }));
|
|
27
|
+
yield* Database.flush();
|
|
28
|
+
|
|
29
|
+
const conversation = Operation.withInvocationOptions({ conversation: Obj.getURI(feed) });
|
|
30
|
+
yield* Operation.invoke(ContextAdd, { obj: Ref.make(organization) }).pipe(Effect.provide(conversation));
|
|
31
|
+
yield* Operation.invoke(ContextRemove, { obj: Ref.make(organization) }).pipe(Effect.provide(conversation));
|
|
32
|
+
|
|
33
|
+
const bindings = yield* Feed.query(feed, Query.type(AiContext.Binding)).run;
|
|
34
|
+
const removed = bindings.flatMap((binding) => entityIds(binding.objects.removed));
|
|
35
|
+
expect(removed).toContain(organization.id);
|
|
36
|
+
},
|
|
37
|
+
Effect.provide(OperationTestLayer),
|
|
38
|
+
TestHelpers.provideTestContext,
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Compare by entity id: a same-space ref stores a local EID (`echo:/<id>`) while `Obj.getURI`
|
|
44
|
+
// returns the fully-qualified form (`echo://<space>/<id>`).
|
|
45
|
+
const entityIds = (refs: readonly Ref.Ref<Obj.Unknown>[]): (string | undefined)[] =>
|
|
46
|
+
refs.map((ref) => EID.getEntityId(EID.parse(ref.uri)));
|
|
@@ -53,7 +53,7 @@ export const Query = Operation.make({
|
|
|
53
53
|
|
|
54
54
|
<example description="Emails from specific mailboxes">
|
|
55
55
|
{
|
|
56
|
-
"in": [{"/" : "echo
|
|
56
|
+
"in": [{"/" : "echo:///YYYYYY"}, {"/" : "echo:///XXXXXXX"}],
|
|
57
57
|
"typename": "org.dxos.type.email",
|
|
58
58
|
"includeContent": true,
|
|
59
59
|
"limit": 20
|
|
@@ -132,15 +132,26 @@ export const ObjectCreate = Operation.make({
|
|
|
132
132
|
name: 'Create object',
|
|
133
133
|
icon: 'ph--plus--regular',
|
|
134
134
|
description: trim`
|
|
135
|
-
Creates a new object and adds it to the current space.
|
|
135
|
+
Creates a new object of any type and adds it to the current space.
|
|
136
|
+
When a type has its own create tool (e.g. the markdown skill creates documents), prefer that
|
|
137
|
+
tool — it builds the object's owned parts correctly. Use this one for types that have none.
|
|
136
138
|
Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.
|
|
137
139
|
References are provided in the following format: { "/": "echo:..." }.
|
|
138
|
-
Reference examples: { "/": "echo
|
|
140
|
+
Reference examples: { "/": "echo:///01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "echo://<space id>/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
|
|
139
141
|
`,
|
|
140
142
|
},
|
|
141
143
|
input: Schema.Struct({
|
|
142
|
-
typename: Schema.String
|
|
143
|
-
|
|
144
|
+
typename: Schema.String.annotations({
|
|
145
|
+
description: 'The typename of the object to create.',
|
|
146
|
+
examples: ['dxn:org.dxos.type.person'],
|
|
147
|
+
}),
|
|
148
|
+
properties: Schema.Record({ key: Schema.String, value: Schema.Any }),
|
|
149
|
+
attach: Schema.optional(Schema.Boolean).annotations({
|
|
150
|
+
description: trim`
|
|
151
|
+
Attach the object to the space root collection so it appears in the navigation tree.
|
|
152
|
+
Set for top-level objects; leave unset for subordinate objects referenced by others.
|
|
153
|
+
`,
|
|
154
|
+
}),
|
|
144
155
|
}),
|
|
145
156
|
output: Schema.Unknown,
|
|
146
157
|
services: [Database.Service],
|
|
@@ -154,7 +165,7 @@ export const ObjectUpdate = Operation.make({
|
|
|
154
165
|
description: trim`
|
|
155
166
|
Updates the object properties.
|
|
156
167
|
References are provided in the following format: { "/": "echo:..." }.
|
|
157
|
-
Reference examples: { "/": "echo
|
|
168
|
+
Reference examples: { "/": "echo:///01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "echo://<space id>/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
|
|
158
169
|
`,
|
|
159
170
|
},
|
|
160
171
|
input: Schema.Struct({
|
|
@@ -196,7 +207,12 @@ export const SchemaAdd = Operation.make({
|
|
|
196
207
|
typename: Schema.String.annotations({
|
|
197
208
|
description: 'The typename of the schema in the format of "com.example.type.type".',
|
|
198
209
|
}),
|
|
199
|
-
|
|
210
|
+
// Typed as a record so the tool parameter advertises `type: object` to the LLM, forcing it to
|
|
211
|
+
// emit the JSON Schema as an object rather than a JSON-encoded string (which an unconstrained
|
|
212
|
+
// `Schema.Any` parameter would allow, breaking `makeObjectFromJsonSchema`).
|
|
213
|
+
jsonSchema: Schema.Record({ key: Schema.String, value: Schema.Any }).annotations({
|
|
214
|
+
description: 'The JSON Schema (draft-07) object describing the fields of the new type.',
|
|
215
|
+
}),
|
|
200
216
|
}),
|
|
201
217
|
output: Schema.Void,
|
|
202
218
|
services: [Database.Service],
|
|
@@ -0,0 +1,38 @@
|
|
|
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, Obj, Ref } from '@dxos/echo';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { EntityId } from '@dxos/keys';
|
|
13
|
+
import { Organization, Person } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { OperationTestLayer } from '../../../testing';
|
|
16
|
+
import { Load } from './definitions';
|
|
17
|
+
|
|
18
|
+
EntityId.dangerouslyDisableRandomness();
|
|
19
|
+
|
|
20
|
+
describe('Load', () => {
|
|
21
|
+
it.effect(
|
|
22
|
+
'load: returns one entry per requested ref',
|
|
23
|
+
Effect.fnUntraced(
|
|
24
|
+
function* (_) {
|
|
25
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Cyberdyne Systems' }));
|
|
26
|
+
const person = yield* Database.add(Obj.make(Person.Person, { fullName: 'John Connor' }));
|
|
27
|
+
yield* Database.flush();
|
|
28
|
+
|
|
29
|
+
const loaded = yield* Operation.invoke(Load, { refs: [Ref.make(organization), Ref.make(person)] });
|
|
30
|
+
|
|
31
|
+
const rows = yield* Schema.decodeUnknown(Schema.Array(Schema.Struct({ id: Schema.String })))(loaded);
|
|
32
|
+
expect(rows.map((row) => row.id)).toEqual([organization.id, person.id]);
|
|
33
|
+
},
|
|
34
|
+
Effect.provide(OperationTestLayer),
|
|
35
|
+
TestHelpers.provideTestContext,
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
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 Option from 'effect/Option';
|
|
8
|
+
|
|
9
|
+
import { AppAnnotation } from '@dxos/app-toolkit';
|
|
10
|
+
import { WithProperties } from '@dxos/app-toolkit/testing';
|
|
11
|
+
import { SpaceProperties } from '@dxos/client-protocol';
|
|
12
|
+
import { Operation } from '@dxos/compute';
|
|
13
|
+
import { Annotation, Collection, Database, Obj, Query, Type } from '@dxos/echo';
|
|
14
|
+
import { EncodedReference } from '@dxos/echo-protocol';
|
|
15
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
16
|
+
import { EntityId } from '@dxos/keys';
|
|
17
|
+
import { Organization, Person } from '@dxos/types';
|
|
18
|
+
|
|
19
|
+
import { OperationTestLayer } from '../../../testing';
|
|
20
|
+
import { ObjectCreate } from './definitions';
|
|
21
|
+
|
|
22
|
+
const loadRootCollection = Effect.gen(function* () {
|
|
23
|
+
const [properties] = yield* Database.query(Query.type(SpaceProperties)).run;
|
|
24
|
+
const collectionRef = Annotation.get(properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrThrow);
|
|
25
|
+
return yield* Database.load(collectionRef);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
EntityId.dangerouslyDisableRandomness();
|
|
29
|
+
|
|
30
|
+
describe('ObjectCreate', () => {
|
|
31
|
+
it.effect(
|
|
32
|
+
'object-create: creates an object with the declared properties',
|
|
33
|
+
Effect.fnUntraced(
|
|
34
|
+
function* (_) {
|
|
35
|
+
yield* Operation.invoke(ObjectCreate, {
|
|
36
|
+
typename: Type.getTypename(Organization.Organization),
|
|
37
|
+
properties: { name: 'Cyberdyne Systems' },
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const organizations = yield* Database.query(Query.type(Organization.Organization)).run;
|
|
41
|
+
expect(organizations).toHaveLength(1);
|
|
42
|
+
expect(organizations[0].name).toBe('Cyberdyne Systems');
|
|
43
|
+
},
|
|
44
|
+
Effect.provide(OperationTestLayer),
|
|
45
|
+
TestHelpers.provideTestContext,
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
it.effect(
|
|
50
|
+
'object-create: resolves an encoded reference into a live ref',
|
|
51
|
+
Effect.fnUntraced(
|
|
52
|
+
function* (_) {
|
|
53
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Cyberdyne Systems' }));
|
|
54
|
+
yield* Database.flush();
|
|
55
|
+
|
|
56
|
+
yield* Operation.invoke(ObjectCreate, {
|
|
57
|
+
typename: Type.getTypename(Person.Person),
|
|
58
|
+
properties: {
|
|
59
|
+
fullName: 'John Doe',
|
|
60
|
+
// The model emits references in this wire form; the handler decodes it to a ref.
|
|
61
|
+
organization: EncodedReference.fromURI(Obj.getURI(organization)),
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const people = yield* Database.query(Query.type(Person.Person)).run;
|
|
66
|
+
expect(people).toHaveLength(1);
|
|
67
|
+
expect(people[0].organization?.target).toBe(organization);
|
|
68
|
+
},
|
|
69
|
+
Effect.provide(OperationTestLayer),
|
|
70
|
+
TestHelpers.provideTestContext,
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
it.effect(
|
|
75
|
+
'object-create: default leaves the root collection untouched',
|
|
76
|
+
Effect.fnUntraced(
|
|
77
|
+
function* (_) {
|
|
78
|
+
yield* Operation.invoke(ObjectCreate, {
|
|
79
|
+
typename: Type.getTypename(Collection.Collection),
|
|
80
|
+
properties: { name: 'Unattached', objects: [] },
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const collection = yield* loadRootCollection;
|
|
84
|
+
expect(collection.objects).toHaveLength(0);
|
|
85
|
+
},
|
|
86
|
+
WithProperties,
|
|
87
|
+
Effect.provide(OperationTestLayer),
|
|
88
|
+
TestHelpers.provideTestContext,
|
|
89
|
+
),
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
it.effect(
|
|
93
|
+
'object-create: attach files the object in the space root collection',
|
|
94
|
+
Effect.fnUntraced(
|
|
95
|
+
function* (_) {
|
|
96
|
+
// A collection is always collection-eligible; non-eligible types (no
|
|
97
|
+
// `CollectionItemAnnotation`) are filed under navtree type nodes instead and skip the root.
|
|
98
|
+
yield* Operation.invoke(ObjectCreate, {
|
|
99
|
+
typename: Type.getTypename(Collection.Collection),
|
|
100
|
+
properties: { name: 'Projects', objects: [] },
|
|
101
|
+
attach: true,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const collection = yield* loadRootCollection;
|
|
105
|
+
const created = (yield* Database.query(Query.type(Collection.Collection)).run).find(
|
|
106
|
+
(candidate) => candidate !== collection && candidate.name === 'Projects',
|
|
107
|
+
);
|
|
108
|
+
expect(created).toBeDefined();
|
|
109
|
+
expect(collection.objects.map((ref) => ref.target)).toContain(created);
|
|
110
|
+
},
|
|
111
|
+
WithProperties,
|
|
112
|
+
Effect.provide(OperationTestLayer),
|
|
113
|
+
TestHelpers.provideTestContext,
|
|
114
|
+
),
|
|
115
|
+
);
|
|
116
|
+
});
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
+
// Narrow subpath: the app-toolkit barrel drags `@dxos/client` (→ protobufjs), which the workerd
|
|
8
|
+
// bundle guard (env-tests) forbids for assistant-toolkit.
|
|
9
|
+
import { CollectionModel } from '@dxos/app-toolkit/types';
|
|
7
10
|
import { Operation } from '@dxos/compute';
|
|
8
11
|
import { Database, Entity, Filter, Obj, Query, Scope, Type } from '@dxos/echo';
|
|
9
12
|
import { EncodedReference } from '@dxos/echo-protocol';
|
|
@@ -14,7 +17,7 @@ import { ObjectCreate } from './definitions';
|
|
|
14
17
|
|
|
15
18
|
export default ObjectCreate.pipe(
|
|
16
19
|
Operation.withHandler(
|
|
17
|
-
Effect.fn(function* ({ typename,
|
|
20
|
+
Effect.fn(function* ({ typename, properties, attach }) {
|
|
18
21
|
const { db } = yield* Database.Service;
|
|
19
22
|
const types = yield* Database.query(Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()))
|
|
20
23
|
.run;
|
|
@@ -26,7 +29,7 @@ export default ObjectCreate.pipe(
|
|
|
26
29
|
const object = db.add(
|
|
27
30
|
Obj.make(
|
|
28
31
|
schema,
|
|
29
|
-
deepMapValues(
|
|
32
|
+
deepMapValues(properties, (value, recurse) => {
|
|
30
33
|
if (EncodedReference.isEncodedReference(value)) {
|
|
31
34
|
return db.makeRef(EncodedReference.toURI(value));
|
|
32
35
|
}
|
|
@@ -34,6 +37,14 @@ export default ObjectCreate.pipe(
|
|
|
34
37
|
}),
|
|
35
38
|
),
|
|
36
39
|
);
|
|
40
|
+
|
|
41
|
+
if (attach) {
|
|
42
|
+
// Same best-effort attach as `markdown.create`: the object is already persisted, so swallow
|
|
43
|
+
// only the transient race where concurrent agents materialize the root collection.
|
|
44
|
+
yield* CollectionModel.add({ object }).pipe(Effect.catchTag('EntityNotFoundError', () => Effect.void));
|
|
45
|
+
yield* Database.flush();
|
|
46
|
+
}
|
|
47
|
+
|
|
37
48
|
return Entity.toJSON(object);
|
|
38
49
|
}),
|
|
39
50
|
),
|
|
@@ -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, Obj, Query, Ref } from '@dxos/echo';
|
|
10
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
+
import { EntityId } from '@dxos/keys';
|
|
12
|
+
import { Organization } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { OperationTestLayer } from '../../../testing';
|
|
15
|
+
import { ObjectDelete } from './definitions';
|
|
16
|
+
|
|
17
|
+
EntityId.dangerouslyDisableRandomness();
|
|
18
|
+
|
|
19
|
+
describe('ObjectDelete', () => {
|
|
20
|
+
it.effect(
|
|
21
|
+
'object-delete: removes the object from the database',
|
|
22
|
+
Effect.fnUntraced(
|
|
23
|
+
function* (_) {
|
|
24
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Doomed Corp' }));
|
|
25
|
+
yield* Database.flush();
|
|
26
|
+
|
|
27
|
+
yield* Operation.invoke(ObjectDelete, { obj: Ref.make(organization) });
|
|
28
|
+
yield* Database.flush();
|
|
29
|
+
|
|
30
|
+
const organizations = yield* Database.query(Query.type(Organization.Organization)).run;
|
|
31
|
+
expect(organizations).toHaveLength(0);
|
|
32
|
+
},
|
|
33
|
+
Effect.provide(OperationTestLayer),
|
|
34
|
+
TestHelpers.provideTestContext,
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
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 } from '@dxos/echo';
|
|
10
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
+
import { EntityId } from '@dxos/keys';
|
|
12
|
+
import { Organization } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { OperationTestLayer } from '../../../testing';
|
|
15
|
+
import { ObjectUpdate } from './definitions';
|
|
16
|
+
|
|
17
|
+
EntityId.dangerouslyDisableRandomness();
|
|
18
|
+
|
|
19
|
+
describe('ObjectUpdate', () => {
|
|
20
|
+
it.effect(
|
|
21
|
+
'object-update: writes the given properties onto the object',
|
|
22
|
+
Effect.fnUntraced(
|
|
23
|
+
function* (_) {
|
|
24
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Before' }));
|
|
25
|
+
yield* Database.flush();
|
|
26
|
+
|
|
27
|
+
yield* Operation.invoke(ObjectUpdate, {
|
|
28
|
+
obj: Ref.make(organization),
|
|
29
|
+
properties: { name: 'After', description: 'Now with a description.' },
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
expect(organization.name).toBe('After');
|
|
33
|
+
expect(organization.description).toBe('Now with a description.');
|
|
34
|
+
},
|
|
35
|
+
Effect.provide(OperationTestLayer),
|
|
36
|
+
TestHelpers.provideTestContext,
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
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, Feed, Obj, Ref, Type } from '@dxos/echo';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { EntityId } from '@dxos/keys';
|
|
13
|
+
import { Organization, Person } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { OperationTestLayer } from '../../../testing';
|
|
16
|
+
import { Query as QueryOperation } from './definitions';
|
|
17
|
+
|
|
18
|
+
EntityId.dangerouslyDisableRandomness();
|
|
19
|
+
|
|
20
|
+
describe('Query', () => {
|
|
21
|
+
it.effect(
|
|
22
|
+
'query: finds objects by typename',
|
|
23
|
+
Effect.fnUntraced(
|
|
24
|
+
function* (_) {
|
|
25
|
+
yield* Database.add(Obj.make(Organization.Organization, { name: 'Acme Corp' }));
|
|
26
|
+
yield* Database.add(Obj.make(Organization.Organization, { name: 'Globex Industries' }));
|
|
27
|
+
yield* Database.add(Obj.make(Person.Person, { fullName: 'John Connor' }));
|
|
28
|
+
yield* Database.flush();
|
|
29
|
+
|
|
30
|
+
const results = yield* Operation.invoke(QueryOperation, {
|
|
31
|
+
typename: Type.getTypename(Organization.Organization),
|
|
32
|
+
limit: 20,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
expect((yield* rows(results)).map((row) => row.label).sort()).toEqual(['Acme Corp', 'Globex Industries']);
|
|
36
|
+
},
|
|
37
|
+
Effect.provide(OperationTestLayer),
|
|
38
|
+
TestHelpers.provideTestContext,
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
it.effect(
|
|
43
|
+
'query: the in param scopes results to the given feed',
|
|
44
|
+
Effect.fnUntraced(
|
|
45
|
+
function* (_) {
|
|
46
|
+
const inbox1 = Feed.make({ name: 'inbox-1' });
|
|
47
|
+
yield* Database.add(inbox1);
|
|
48
|
+
yield* Feed.append(inbox1, [Obj.make(Organization.Organization, { name: 'Email Corp Alpha' })]);
|
|
49
|
+
|
|
50
|
+
const inbox2 = Feed.make({ name: 'inbox-2' });
|
|
51
|
+
yield* Database.add(inbox2);
|
|
52
|
+
yield* Feed.append(inbox2, [Obj.make(Organization.Organization, { name: 'Email Corp Beta' })]);
|
|
53
|
+
yield* Database.flush();
|
|
54
|
+
|
|
55
|
+
const results = yield* Operation.invoke(QueryOperation, {
|
|
56
|
+
typename: Type.getTypename(Organization.Organization),
|
|
57
|
+
in: [Ref.make(inbox1)],
|
|
58
|
+
includeQueues: true,
|
|
59
|
+
limit: 20,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
expect((yield* rows(results)).map((row) => row.label)).toEqual(['Email Corp Alpha']);
|
|
63
|
+
},
|
|
64
|
+
Effect.provide(OperationTestLayer),
|
|
65
|
+
TestHelpers.provideTestContext,
|
|
66
|
+
),
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
it.effect(
|
|
70
|
+
'query operation: includeQueues via invokeFunction',
|
|
71
|
+
Effect.fnUntraced(
|
|
72
|
+
function* (_) {
|
|
73
|
+
const feed = Feed.make();
|
|
74
|
+
yield* Database.add(feed);
|
|
75
|
+
yield* Feed.append(feed, [
|
|
76
|
+
Obj.make(Organization.Organization, {
|
|
77
|
+
name: 'Invoke Op Lot Co',
|
|
78
|
+
description: 'Feed-only mock email op-search-token-7f3a2c91 reservation line.',
|
|
79
|
+
}),
|
|
80
|
+
]);
|
|
81
|
+
yield* Database.flush();
|
|
82
|
+
|
|
83
|
+
const noQueues = yield* Operation.invoke(QueryOperation, {
|
|
84
|
+
text: 'op-search-token-7f3a2c91',
|
|
85
|
+
includeQueues: false,
|
|
86
|
+
limit: 20,
|
|
87
|
+
});
|
|
88
|
+
expect(noQueues).toHaveLength(0);
|
|
89
|
+
|
|
90
|
+
const withQueues = yield* Operation.invoke(QueryOperation, {
|
|
91
|
+
text: 'op-search-token-7f3a2c91',
|
|
92
|
+
includeQueues: true,
|
|
93
|
+
limit: 20,
|
|
94
|
+
});
|
|
95
|
+
expect(withQueues.length).toBeGreaterThanOrEqual(1);
|
|
96
|
+
expect(
|
|
97
|
+
(yield* rows(withQueues)).some(
|
|
98
|
+
(row) =>
|
|
99
|
+
row.typename === Type.getTypename(Organization.Organization) &&
|
|
100
|
+
String(row.label ?? '').includes('Invoke Op Lot'),
|
|
101
|
+
),
|
|
102
|
+
).toBe(true);
|
|
103
|
+
|
|
104
|
+
const byTypename = yield* Operation.invoke(QueryOperation, {
|
|
105
|
+
typename: Type.getTypename(Organization.Organization),
|
|
106
|
+
includeQueues: true,
|
|
107
|
+
limit: 20,
|
|
108
|
+
});
|
|
109
|
+
expect(byTypename.length).toBeGreaterThanOrEqual(1);
|
|
110
|
+
expect(
|
|
111
|
+
(yield* rows(byTypename)).some(
|
|
112
|
+
(row) =>
|
|
113
|
+
row.typename === Type.getTypename(Organization.Organization) &&
|
|
114
|
+
String(row.label ?? '').includes('Invoke Op Lot'),
|
|
115
|
+
),
|
|
116
|
+
).toBe(true);
|
|
117
|
+
},
|
|
118
|
+
Effect.provide(OperationTestLayer),
|
|
119
|
+
TestHelpers.provideTestContext,
|
|
120
|
+
),
|
|
121
|
+
);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// The operation's output is `Schema.Unknown`; decode rather than cast.
|
|
125
|
+
const rows = (results: readonly unknown[]) =>
|
|
126
|
+
Schema.decodeUnknown(
|
|
127
|
+
Schema.Array(Schema.Struct({ typename: Schema.optional(Schema.String), label: Schema.optional(Schema.String) })),
|
|
128
|
+
)(results);
|
|
@@ -0,0 +1,46 @@
|
|
|
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, Query, Ref, Relation, Type } from '@dxos/echo';
|
|
10
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
+
import { EntityId } from '@dxos/keys';
|
|
12
|
+
import { Employer, Organization, Person } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { OperationTestLayer } from '../../../testing';
|
|
15
|
+
import { RelationCreate } from './definitions';
|
|
16
|
+
|
|
17
|
+
EntityId.dangerouslyDisableRandomness();
|
|
18
|
+
|
|
19
|
+
describe('RelationCreate', () => {
|
|
20
|
+
it.effect(
|
|
21
|
+
'relation-create: links source to target and stores the properties',
|
|
22
|
+
Effect.fnUntraced(
|
|
23
|
+
function* (_) {
|
|
24
|
+
const person = yield* Database.add(Obj.make(Person.Person, { fullName: 'John Connor' }));
|
|
25
|
+
const organization = yield* Database.add(Obj.make(Organization.Organization, { name: 'Cyberdyne Systems' }));
|
|
26
|
+
yield* Database.flush();
|
|
27
|
+
|
|
28
|
+
yield* Operation.invoke(RelationCreate, {
|
|
29
|
+
typename: Type.getTypename(Employer.Employer),
|
|
30
|
+
source: Ref.make(person),
|
|
31
|
+
target: Ref.make(organization),
|
|
32
|
+
properties: { role: 'Engineer' },
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const relations = yield* Database.query(Query.type(Employer.Employer)).run;
|
|
36
|
+
expect(relations).toHaveLength(1);
|
|
37
|
+
expect(relations[0].role).toBe('Engineer');
|
|
38
|
+
// Endpoints, not just the properties: a swapped source/target would otherwise pass.
|
|
39
|
+
expect(Relation.getSource(relations[0]).id).toBe(person.id);
|
|
40
|
+
expect(Relation.getTarget(relations[0]).id).toBe(organization.id);
|
|
41
|
+
},
|
|
42
|
+
Effect.provide(OperationTestLayer),
|
|
43
|
+
TestHelpers.provideTestContext,
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
});
|