@dxos/assistant-toolkit 0.8.4-main.e8ec1fe → 0.8.4-main.fcfe5033a5
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/neutral/add-artifact-IGKQVEIL.mjs +30 -0
- package/dist/lib/neutral/add-artifact-IGKQVEIL.mjs.map +7 -0
- package/dist/lib/neutral/agent-3MJJ36QG.mjs +87 -0
- package/dist/lib/neutral/agent-3MJJ36QG.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4BWLYLTR.mjs +29 -0
- package/dist/lib/neutral/chunk-4BWLYLTR.mjs.map +7 -0
- package/dist/lib/neutral/chunk-6DPL2YY5.mjs +68 -0
- package/dist/lib/neutral/chunk-6DPL2YY5.mjs.map +7 -0
- package/dist/lib/neutral/chunk-6FL4C6KD.mjs +86 -0
- package/dist/lib/neutral/chunk-6FL4C6KD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7VH5RFBT.mjs +392 -0
- package/dist/lib/neutral/chunk-7VH5RFBT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7WHAIX7N.mjs +692 -0
- package/dist/lib/neutral/chunk-7WHAIX7N.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7WUXG23R.mjs +95 -0
- package/dist/lib/neutral/chunk-7WUXG23R.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DV5DCOUE.mjs +52 -0
- package/dist/lib/neutral/chunk-DV5DCOUE.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FKGWM6KF.mjs +140 -0
- package/dist/lib/neutral/chunk-FKGWM6KF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HCS67KNS.mjs +74 -0
- package/dist/lib/neutral/chunk-HCS67KNS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-I2YSCI65.mjs +76 -0
- package/dist/lib/neutral/chunk-I2YSCI65.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IVXBQQDJ.mjs +332 -0
- package/dist/lib/neutral/chunk-IVXBQQDJ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JEQB7H27.mjs +70 -0
- package/dist/lib/neutral/chunk-JEQB7H27.mjs.map +7 -0
- package/dist/lib/neutral/chunk-LI6VMCJW.mjs +27 -0
- package/dist/lib/neutral/chunk-LI6VMCJW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MEZ4UFR6.mjs +25 -0
- package/dist/lib/neutral/chunk-MEZ4UFR6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-RXITNKBD.mjs +73 -0
- package/dist/lib/neutral/chunk-RXITNKBD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-RZYPNKOB.mjs +53 -0
- package/dist/lib/neutral/chunk-RZYPNKOB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VD2WAUU2.mjs +78 -0
- package/dist/lib/neutral/chunk-VD2WAUU2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VDEDVOS6.mjs +39 -0
- package/dist/lib/neutral/chunk-VDEDVOS6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VUGCOWRW.mjs +283 -0
- package/dist/lib/neutral/chunk-VUGCOWRW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-YPECGXN2.mjs +100 -0
- package/dist/lib/neutral/chunk-YPECGXN2.mjs.map +7 -0
- package/dist/lib/neutral/context-add-QAHU6I24.mjs +22 -0
- package/dist/lib/neutral/context-add-QAHU6I24.mjs.map +7 -0
- package/dist/lib/neutral/context-remove-VMZPMZ4E.mjs +22 -0
- package/dist/lib/neutral/context-remove-VMZPMZ4E.mjs.map +7 -0
- package/dist/lib/neutral/create-P6I22VS5.mjs +23 -0
- package/dist/lib/neutral/create-P6I22VS5.mjs.map +7 -0
- package/dist/lib/neutral/create-project-JBCPS6OC.mjs +36 -0
- package/dist/lib/neutral/create-project-JBCPS6OC.mjs.map +7 -0
- package/dist/lib/neutral/delete-7PDHEV4U.mjs +19 -0
- package/dist/lib/neutral/delete-7PDHEV4U.mjs.map +7 -0
- package/dist/lib/neutral/document-create-GKW354LS.mjs +55 -0
- package/dist/lib/neutral/document-create-GKW354LS.mjs.map +7 -0
- package/dist/lib/neutral/enable-blueprints-4UMPKGUD.mjs +48 -0
- package/dist/lib/neutral/enable-blueprints-4UMPKGUD.mjs.map +7 -0
- package/dist/lib/neutral/entity-extraction-T2M7C3WU.mjs +194 -0
- package/dist/lib/neutral/entity-extraction-T2M7C3WU.mjs.map +7 -0
- package/dist/lib/neutral/exa-P4G3DCYB.mjs +28 -0
- package/dist/lib/neutral/exa-P4G3DCYB.mjs.map +7 -0
- package/dist/lib/neutral/fetch-TLKREIZA.mjs +16 -0
- package/dist/lib/neutral/fetch-TLKREIZA.mjs.map +7 -0
- package/dist/lib/neutral/fetch-messages-UKDOTMLZ.mjs +150 -0
- package/dist/lib/neutral/fetch-messages-UKDOTMLZ.mjs.map +7 -0
- package/dist/lib/neutral/get-context-TJOY4S33.mjs +35 -0
- package/dist/lib/neutral/get-context-TJOY4S33.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +250 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/load-ZTOGVHWP.mjs +17 -0
- package/dist/lib/neutral/load-ZTOGVHWP.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/{browser/index.mjs → neutral/mock-2ARYZ54S.mjs} +28 -2249
- package/dist/lib/neutral/mock-2ARYZ54S.mjs.map +7 -0
- package/dist/lib/neutral/object-create-7QCGL56E.mjs +43 -0
- package/dist/lib/neutral/object-create-7QCGL56E.mjs.map +7 -0
- package/dist/lib/neutral/object-delete-KXBWC4Q4.mjs +18 -0
- package/dist/lib/neutral/object-delete-KXBWC4Q4.mjs.map +7 -0
- package/dist/lib/neutral/object-update-B7RDX3JC.mjs +28 -0
- package/dist/lib/neutral/object-update-B7RDX3JC.mjs.map +7 -0
- package/dist/lib/neutral/project-4YLFG5BQ.mjs +23 -0
- package/dist/lib/neutral/project-4YLFG5BQ.mjs.map +7 -0
- package/dist/lib/neutral/project-rules-R5EYMWD3.mjs +78 -0
- package/dist/lib/neutral/project-rules-R5EYMWD3.mjs.map +7 -0
- package/dist/lib/neutral/prompt-4NEDW6FG.mjs +197 -0
- package/dist/lib/neutral/prompt-4NEDW6FG.mjs.map +7 -0
- package/dist/lib/neutral/qualifier-RKTN2QK4.mjs +104 -0
- package/dist/lib/neutral/qualifier-RKTN2QK4.mjs.map +7 -0
- package/dist/lib/neutral/query-BPDND25Q.mjs +32 -0
- package/dist/lib/neutral/query-BPDND25Q.mjs.map +7 -0
- package/dist/lib/neutral/query-V2ZWVVYP.mjs +70 -0
- package/dist/lib/neutral/query-V2ZWVVYP.mjs.map +7 -0
- package/dist/lib/neutral/query-blueprints-EKHEZAGD.mjs +17 -0
- package/dist/lib/neutral/query-blueprints-EKHEZAGD.mjs.map +7 -0
- package/dist/lib/neutral/read-JJN7YXHI.mjs +19 -0
- package/dist/lib/neutral/read-JJN7YXHI.mjs.map +7 -0
- package/dist/lib/neutral/relation-create-FSHBM5CJ.mjs +42 -0
- package/dist/lib/neutral/relation-create-FSHBM5CJ.mjs.map +7 -0
- package/dist/lib/neutral/relation-delete-CYYQUIZY.mjs +18 -0
- package/dist/lib/neutral/relation-delete-CYYQUIZY.mjs.map +7 -0
- package/dist/lib/neutral/research-DZPSEZZC.mjs +106 -0
- package/dist/lib/neutral/research-DZPSEZZC.mjs.map +7 -0
- package/dist/lib/neutral/save-M4KRWV4W.mjs +23 -0
- package/dist/lib/neutral/save-M4KRWV4W.mjs.map +7 -0
- package/dist/lib/neutral/schema-add-RVV364G6.mjs +24 -0
- package/dist/lib/neutral/schema-add-RVV364G6.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-4IYBLXFN.mjs +39 -0
- package/dist/lib/neutral/schema-list-4IYBLXFN.mjs.map +7 -0
- package/dist/lib/neutral/sync-issues-BBAMXSZN.mjs +179 -0
- package/dist/lib/neutral/sync-issues-BBAMXSZN.mjs.map +7 -0
- package/dist/lib/neutral/sync-triggers-56ELUXSO.mjs +112 -0
- package/dist/lib/neutral/sync-triggers-56ELUXSO.mjs.map +7 -0
- package/dist/lib/neutral/tag-add-OUDUBR3E.mjs +19 -0
- package/dist/lib/neutral/tag-add-OUDUBR3E.mjs.map +7 -0
- package/dist/lib/neutral/tag-remove-DI3ZSLFK.mjs +19 -0
- package/dist/lib/neutral/tag-remove-DI3ZSLFK.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +81 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/update-J64AYUS5.mjs +20 -0
- package/dist/lib/neutral/update-J64AYUS5.mjs.map +7 -0
- package/dist/lib/neutral/update-blueprints-ZNWR7BBN.mjs +17 -0
- package/dist/lib/neutral/update-blueprints-ZNWR7BBN.mjs.map +7 -0
- package/dist/lib/neutral/update-tasks-EH7MOB5X.mjs +46 -0
- package/dist/lib/neutral/update-tasks-EH7MOB5X.mjs.map +7 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/automation/index.d.ts +2 -0
- package/dist/types/src/blueprints/automation/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts +60 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts +36 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +27 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +5 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts +3 -0
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/browser/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/index.d.ts +2 -0
- package/dist/types/src/blueprints/browser/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/database/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/definitions.d.ts +59 -0
- package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/load.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-create.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-update.d.ts +10 -0
- package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/query.d.ts +13 -0
- package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts +10 -0
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts +9 -0
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/index.d.ts +3 -0
- package/dist/types/src/blueprints/database/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/design/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/design/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/design/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/design/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/design/index.d.ts +1 -2
- package/dist/types/src/blueprints/design/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts +16 -0
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.d.ts +4 -2
- package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/index.d.ts +2 -2
- package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/functions/definitions.d.ts +8 -0
- package/dist/types/src/blueprints/github/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts +9 -0
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/index.d.ts +2 -0
- package/dist/types/src/blueprints/github/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +14 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts +7 -0
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts +11 -0
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/index.d.ts +2 -2
- package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/markdown/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/markdown/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/functions/create.d.ts +8 -0
- package/dist/types/src/blueprints/markdown/functions/create.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/functions/definitions.d.ts +45 -0
- package/dist/types/src/blueprints/markdown/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/markdown/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/functions/read.d.ts +17 -0
- package/dist/types/src/blueprints/markdown/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/functions/update.d.ts +16 -0
- package/dist/types/src/blueprints/markdown/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/index.d.ts +3 -0
- package/dist/types/src/blueprints/markdown/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/memory/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/memory/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts +17 -0
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/delete.d.ts +10 -0
- package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/memory/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/query.d.ts +8 -0
- package/dist/types/src/blueprints/memory/functions/query.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/save.d.ts +8 -0
- package/dist/types/src/blueprints/memory/functions/save.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/index.d.ts +3 -0
- package/dist/types/src/blueprints/memory/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/planning/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts +11 -0
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +11 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/index.d.ts +2 -2
- package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning-old/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/planning-old/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/definitions.d.ts +31 -0
- package/dist/types/src/blueprints/planning-old/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/planning-old/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/read.d.ts +17 -0
- package/dist/types/src/blueprints/planning-old/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/task-list.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/task-list.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/update.d.ts +19 -0
- package/dist/types/src/blueprints/planning-old/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/index.d.ts +3 -0
- package/dist/types/src/blueprints/planning-old/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/project/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/project/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +8 -0
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/agent.d.ts +4 -0
- package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/definitions.d.ts +150 -0
- package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/get-context.d.ts +15 -0
- package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +69 -0
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/index.d.ts +3 -0
- package/dist/types/src/blueprints/project/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +48 -0
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +89 -0
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts +44 -0
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/index.d.ts +3 -0
- package/dist/types/src/blueprints/project-wizard/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/research/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/research/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/functions/definitions.d.ts +21 -0
- package/dist/types/src/blueprints/research/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/functions/document-create.d.ts +12 -0
- package/dist/types/src/blueprints/research/functions/document-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/research/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/functions/research.d.ts +7 -0
- package/dist/types/src/blueprints/research/functions/research.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/functions/research.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/index.d.ts +3 -2
- package/dist/types/src/blueprints/research/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts +35 -0
- package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/types/index.d.ts +7 -0
- package/dist/types/src/blueprints/research/types/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/testing.d.ts +17 -5
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/websearch/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts +5 -0
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/fetch.d.ts +6 -0
- package/dist/types/src/blueprints/websearch/functions/fetch.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/websearch/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/index.d.ts +3 -3
- package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/{websearch-toolkit.d.ts → toolkit.d.ts} +3 -1
- package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
- package/dist/types/src/crud/graph.d.ts +14 -11
- package/dist/types/src/crud/graph.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +41 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/functions/agent/definitions.d.ts +60 -0
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -0
- package/dist/types/src/functions/agent/index.d.ts +3 -4
- package/dist/types/src/functions/agent/index.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.d.ts +2 -7
- package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.test.d.ts +2 -0
- package/dist/types/src/functions/agent/prompt.test.d.ts.map +1 -0
- package/dist/types/src/functions/entity-extraction/definitions.d.ts +182 -0
- package/dist/types/src/functions/entity-extraction/definitions.d.ts.map +1 -0
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +2 -171
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +3 -173
- package/dist/types/src/functions/entity-extraction/index.d.ts.map +1 -1
- package/dist/types/src/functions/exa/data/exa-search-1748337321991.d.ts.map +1 -0
- package/dist/types/src/functions/exa/data/exa-search-1748337331526.d.ts.map +1 -0
- package/dist/types/src/functions/exa/data/exa-search-1748337344119.d.ts.map +1 -0
- package/dist/types/src/functions/exa/data/index.d.ts.map +1 -0
- package/dist/types/src/functions/exa/definitions.d.ts +9 -0
- package/dist/types/src/functions/exa/definitions.d.ts.map +1 -0
- package/dist/types/src/functions/exa/exa.d.ts +4 -2
- package/dist/types/src/functions/exa/exa.d.ts.map +1 -1
- package/dist/types/src/functions/exa/index.d.ts +3 -2
- package/dist/types/src/functions/exa/index.d.ts.map +1 -1
- package/dist/types/src/functions/exa/mock.d.ts +3 -2
- package/dist/types/src/functions/exa/mock.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +1 -5
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/sync/sync.d.ts +3 -3
- package/dist/types/src/sync/sync.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/plugins.d.ts +19 -0
- package/dist/types/src/testing/plugins.d.ts.map +1 -0
- package/dist/types/src/toolkits/WebToolkit.d.ts +38 -0
- package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -0
- package/dist/types/src/toolkits/index.d.ts +1 -2
- package/dist/types/src/toolkits/index.d.ts.map +1 -1
- package/dist/types/src/types/Agent.d.ts +73 -0
- package/dist/types/src/types/Agent.d.ts.map +1 -0
- package/dist/types/src/types/Chat.d.ts +52 -0
- package/dist/types/src/types/Chat.d.ts.map +1 -0
- package/dist/types/src/types/McpServer.d.ts +18 -0
- package/dist/types/src/types/McpServer.d.ts.map +1 -0
- package/dist/types/src/types/Memory.d.ts +12 -0
- package/dist/types/src/types/Memory.d.ts.map +1 -0
- package/dist/types/src/types/Plan.d.ts +86 -0
- package/dist/types/src/types/Plan.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +6 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -40
- package/src/blueprints/automation/blueprint.ts +108 -0
- package/src/blueprints/automation/index.ts +5 -0
- package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -0
- package/src/blueprints/blueprint-manager/blueprint.test.ts +199 -0
- package/src/blueprints/blueprint-manager/blueprint.ts +50 -0
- package/src/blueprints/blueprint-manager/functions/definitions.ts +58 -0
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +44 -0
- package/src/blueprints/blueprint-manager/functions/index.ts +13 -0
- package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +19 -0
- package/src/blueprints/blueprint-manager/functions/update-blueprints.ts +19 -0
- package/src/blueprints/blueprint-manager/index.ts +6 -0
- package/src/blueprints/browser/blueprint.conversations.json +1 -0
- package/src/blueprints/browser/blueprint.test.ts +63 -0
- package/src/blueprints/browser/blueprint.ts +41 -0
- package/src/blueprints/browser/index.ts +5 -0
- package/src/blueprints/database/blueprint.conversations.json +1 -0
- package/src/blueprints/database/blueprint.test.ts +532 -0
- package/src/blueprints/database/blueprint.ts +67 -0
- package/src/blueprints/database/functions/context-add.ts +24 -0
- package/src/blueprints/database/functions/context-remove.ts +24 -0
- package/src/blueprints/database/functions/definitions.ts +318 -0
- package/src/blueprints/database/functions/index.ts +23 -0
- package/src/blueprints/database/functions/load.ts +19 -0
- package/src/blueprints/database/functions/object-create.ts +38 -0
- package/src/blueprints/database/functions/object-delete.ts +20 -0
- package/src/blueprints/database/functions/object-update.ts +30 -0
- package/src/blueprints/database/functions/query.ts +64 -0
- package/src/blueprints/database/functions/relation-create.ts +34 -0
- package/src/blueprints/database/functions/relation-delete.ts +21 -0
- package/src/blueprints/database/functions/schema-add.ts +28 -0
- package/src/blueprints/database/functions/schema-list.ts +34 -0
- package/src/blueprints/database/functions/tag-add.ts +21 -0
- package/src/blueprints/database/functions/tag-remove.ts +21 -0
- package/src/blueprints/database/index.ts +21 -0
- package/src/blueprints/design/blueprint.test.ts +77 -0
- package/src/blueprints/design/{design-blueprint.ts → blueprint.ts} +20 -12
- package/src/blueprints/design/index.ts +1 -3
- package/src/blueprints/discord/blueprint.ts +42 -0
- package/src/blueprints/discord/functions/definitions.ts +71 -0
- package/src/blueprints/discord/functions/fetch-messages.test.ts +45 -0
- package/src/blueprints/discord/functions/fetch-messages.ts +199 -0
- package/src/blueprints/discord/functions/index.ts +9 -0
- package/src/blueprints/discord/index.ts +2 -3
- package/src/blueprints/github/functions/definitions.ts +27 -0
- package/src/blueprints/github/functions/fetch-prs.ts +24 -0
- package/src/blueprints/github/functions/index.ts +9 -0
- package/src/blueprints/github/index.ts +5 -0
- package/src/blueprints/index.ts +14 -6
- package/src/blueprints/linear/blueprint.ts +43 -0
- package/src/blueprints/linear/functions/definitions.ts +24 -0
- package/src/blueprints/linear/functions/index.ts +9 -0
- package/src/blueprints/linear/functions/linear.test.ts +59 -0
- package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +40 -46
- package/src/blueprints/linear/index.ts +2 -3
- package/src/blueprints/markdown/blueprint.ts +36 -0
- package/src/blueprints/markdown/functions/create.ts +20 -0
- package/src/blueprints/markdown/functions/definitions.ts +80 -0
- package/src/blueprints/markdown/functions/index.ts +13 -0
- package/src/blueprints/markdown/functions/read.ts +22 -0
- package/src/blueprints/markdown/functions/update.ts +22 -0
- package/src/blueprints/markdown/index.ts +11 -0
- package/src/blueprints/memory/blueprint.conversations.json +1 -0
- package/src/blueprints/memory/blueprint.test.ts +139 -0
- package/src/blueprints/memory/blueprint.ts +42 -0
- package/src/blueprints/memory/functions/definitions.ts +68 -0
- package/src/blueprints/memory/functions/delete.ts +20 -0
- package/src/blueprints/memory/functions/index.ts +13 -0
- package/src/blueprints/memory/functions/query.ts +32 -0
- package/src/blueprints/memory/functions/save.ts +20 -0
- package/src/blueprints/memory/index.ts +6 -0
- package/src/blueprints/planning/blueprint.ts +25 -0
- package/src/blueprints/planning/functions/definitions.ts +137 -0
- package/src/blueprints/planning/functions/index.ts +9 -0
- package/src/blueprints/planning/functions/update-tasks.ts +45 -0
- package/src/blueprints/planning/index.ts +3 -4
- package/src/blueprints/{planning/planning-blueprint.test.ts → planning-old/blueprint.test.ts} +23 -40
- package/src/blueprints/{planning/planning-blueprint.ts → planning-old/blueprint.ts} +20 -12
- package/src/blueprints/planning-old/functions/definitions.ts +53 -0
- package/src/blueprints/planning-old/functions/index.ts +12 -0
- package/src/blueprints/planning-old/functions/read.ts +24 -0
- package/src/blueprints/planning-old/functions/update.ts +31 -0
- package/src/blueprints/planning-old/index.ts +6 -0
- package/src/blueprints/project/blueprint.conversations.json +1 -0
- package/src/blueprints/project/blueprint.test.ts +626 -0
- package/src/blueprints/project/blueprint.ts +65 -0
- package/src/blueprints/project/functions/add-artifact.ts +30 -0
- package/src/blueprints/project/functions/agent.ts +68 -0
- package/src/blueprints/project/functions/definitions.ts +92 -0
- package/src/blueprints/project/functions/get-context.ts +46 -0
- package/src/blueprints/project/functions/index.ts +14 -0
- package/src/blueprints/project/functions/qualifier.ts +90 -0
- package/src/blueprints/project/index.ts +6 -0
- package/src/blueprints/project-wizard/blueprint.ts +48 -0
- package/src/blueprints/project-wizard/functions/create-project.ts +33 -0
- package/src/blueprints/project-wizard/functions/definitions.ts +64 -0
- package/src/blueprints/project-wizard/functions/index.ts +13 -0
- package/src/blueprints/project-wizard/functions/project-rules.ts +77 -0
- package/src/blueprints/project-wizard/functions/sync-triggers.ts +135 -0
- package/src/blueprints/project-wizard/index.ts +6 -0
- package/src/blueprints/research/{research-blueprint.ts → blueprint.ts} +21 -13
- package/src/blueprints/research/functions/definitions.ts +87 -0
- package/src/blueprints/research/functions/document-create.ts +50 -0
- package/src/blueprints/research/functions/index.ts +12 -0
- package/src/{functions/research → blueprints/research/functions}/research-instructions.tpl +5 -5
- package/src/blueprints/research/functions/research.conversations.json +1 -0
- package/src/blueprints/research/functions/research.test.ts +149 -0
- package/src/blueprints/research/functions/research.ts +138 -0
- package/src/blueprints/research/index.ts +3 -3
- package/src/blueprints/research/types/ResearchGraph.ts +96 -0
- package/src/{functions/research/types.ts → blueprints/research/types/index.ts} +12 -6
- package/src/blueprints/testing.ts +32 -8
- package/src/blueprints/websearch/blueprint.conversations.json +1 -0
- package/src/blueprints/websearch/blueprint.test.ts +39 -0
- package/src/blueprints/websearch/blueprint.ts +31 -0
- package/src/blueprints/websearch/functions/definitions.ts +25 -0
- package/src/blueprints/websearch/functions/fetch.ts +18 -0
- package/src/blueprints/websearch/functions/index.ts +9 -0
- package/src/blueprints/websearch/index.ts +3 -4
- package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +6 -1
- package/src/crud/graph.test.ts +13 -38
- package/src/crud/graph.ts +33 -41
- package/src/errors.ts +25 -0
- package/src/functions/READ_THIS.md +5 -0
- package/src/functions/agent/definitions.ts +53 -0
- package/src/functions/agent/index.ts +3 -5
- package/src/functions/agent/prompt.conversations.json +1 -0
- package/src/functions/agent/prompt.test.ts +83 -0
- package/src/functions/agent/prompt.ts +211 -102
- package/src/functions/entity-extraction/definitions.ts +36 -0
- package/src/functions/entity-extraction/entity-extraction.conversations.json +1 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +15 -33
- package/src/functions/entity-extraction/entity-extraction.ts +81 -90
- package/src/functions/entity-extraction/index.ts +4 -4
- package/src/functions/exa/definitions.ts +37 -0
- package/src/functions/exa/exa.ts +22 -27
- package/src/functions/exa/index.ts +8 -2
- package/src/functions/exa/mock.ts +26 -35
- package/src/functions/index.ts +1 -5
- package/src/index.ts +2 -2
- package/src/sync/sync.ts +38 -30
- package/src/testing/index.ts +2 -1
- package/src/testing/plugins.tsx +77 -0
- package/src/toolkits/WebToolkit.ts +33 -0
- package/src/toolkits/index.ts +1 -2
- package/src/types/Agent.ts +219 -0
- package/src/types/Chat.ts +62 -0
- package/src/types/McpServer.ts +37 -0
- package/src/types/Memory.ts +24 -0
- package/src/types/Plan.ts +110 -0
- package/src/types/index.ts +9 -0
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/node-esm/index.mjs +0 -2778
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/types/src/blueprints/design/design-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/design-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/design/design-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/research-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/research-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/research/research-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +0 -1
- package/dist/types/src/experimental/feed.test.d.ts +0 -2
- package/dist/types/src/experimental/feed.test.d.ts.map +0 -1
- package/dist/types/src/functions/discord/fetch-messages.d.ts.map +0 -1
- package/dist/types/src/functions/discord/fetch-messages.test.d.ts.map +0 -1
- package/dist/types/src/functions/discord/index.d.ts +0 -12
- package/dist/types/src/functions/discord/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/index.d.ts +0 -13
- package/dist/types/src/functions/document/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/read.d.ts +0 -7
- package/dist/types/src/functions/document/read.d.ts.map +0 -1
- package/dist/types/src/functions/document/update.d.ts +0 -6
- package/dist/types/src/functions/document/update.d.ts.map +0 -1
- package/dist/types/src/functions/github/fetch-prs.d.ts +0 -6
- package/dist/types/src/functions/github/fetch-prs.d.ts.map +0 -1
- package/dist/types/src/functions/linear/index.d.ts +0 -9
- package/dist/types/src/functions/linear/index.d.ts.map +0 -1
- package/dist/types/src/functions/linear/linear.test.d.ts.map +0 -1
- package/dist/types/src/functions/linear/sync-issues.d.ts +0 -12
- package/dist/types/src/functions/linear/sync-issues.d.ts.map +0 -1
- package/dist/types/src/functions/research/document-create.d.ts +0 -9
- package/dist/types/src/functions/research/document-create.d.ts.map +0 -1
- package/dist/types/src/functions/research/index.d.ts +0 -21
- package/dist/types/src/functions/research/index.d.ts.map +0 -1
- package/dist/types/src/functions/research/research-graph.d.ts +0 -18
- package/dist/types/src/functions/research/research-graph.d.ts.map +0 -1
- package/dist/types/src/functions/research/research.d.ts +0 -14
- package/dist/types/src/functions/research/research.d.ts.map +0 -1
- package/dist/types/src/functions/research/research.test.d.ts.map +0 -1
- package/dist/types/src/functions/research/types.d.ts +0 -6
- package/dist/types/src/functions/research/types.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/index.d.ts +0 -15
- package/dist/types/src/functions/tasks/index.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/read.d.ts +0 -7
- package/dist/types/src/functions/tasks/read.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/task-list.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/task-list.test.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/update.d.ts +0 -9
- package/dist/types/src/functions/tasks/update.d.ts.map +0 -1
- package/dist/types/src/plugins.d.ts +0 -19
- package/dist/types/src/plugins.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/testing/data/index.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.d.ts +0 -17
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.test.d.ts +0 -2
- package/dist/types/src/toolkits/AssistantToolkit.test.d.ts.map +0 -1
- package/dist/types/src/toolkits/SystemToolkit.d.ts +0 -67
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
- package/src/blueprints/design/design-blueprint.test.ts +0 -103
- package/src/blueprints/discord/discord-blueprint.ts +0 -34
- package/src/blueprints/linear/linear-blueprint.ts +0 -35
- package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
- package/src/experimental/feed.test.ts +0 -111
- package/src/functions/discord/fetch-messages.test.ts +0 -58
- package/src/functions/discord/fetch-messages.ts +0 -252
- package/src/functions/discord/index.ts +0 -9
- package/src/functions/document/index.ts +0 -12
- package/src/functions/document/read.ts +0 -29
- package/src/functions/document/update.ts +0 -30
- package/src/functions/github/fetch-prs.ts +0 -30
- package/src/functions/linear/index.ts +0 -9
- package/src/functions/linear/linear.test.ts +0 -83
- package/src/functions/research/document-create.ts +0 -75
- package/src/functions/research/index.ts +0 -14
- package/src/functions/research/research-graph.ts +0 -47
- package/src/functions/research/research.conversations.json +0 -1
- package/src/functions/research/research.test.ts +0 -179
- package/src/functions/research/research.ts +0 -190
- package/src/functions/tasks/index.ts +0 -11
- package/src/functions/tasks/read.ts +0 -34
- package/src/functions/tasks/update.ts +0 -52
- package/src/plugins.tsx +0 -68
- package/src/toolkits/AssistantToolkit.conversations.json +0 -1
- package/src/toolkits/AssistantToolkit.test.ts +0 -88
- package/src/toolkits/AssistantToolkit.ts +0 -47
- package/src/toolkits/SystemToolkit.ts +0 -231
- /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.d.ts +0 -0
- /package/dist/types/src/{functions/linear → blueprints/linear/functions}/linear.test.d.ts +0 -0
- /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.d.ts +0 -0
- /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.d.ts +0 -0
- /package/dist/types/src/{functions/research → blueprints/research/functions}/research.test.d.ts +0 -0
- /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337321991.d.ts +0 -0
- /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337331526.d.ts +0 -0
- /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337344119.d.ts +0 -0
- /package/dist/types/src/{testing → functions/exa}/data/index.d.ts +0 -0
- /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.ts +0 -0
- /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.ts +0 -0
- /package/src/blueprints/research/{research-blueprint.test.ts → blueprint.test.ts} +0 -0
- /package/src/{testing → functions/exa}/data/exa-search-1748337321991.ts +0 -0
- /package/src/{testing → functions/exa}/data/exa-search-1748337331526.ts +0 -0
- /package/src/{testing → functions/exa}/data/exa-search-1748337344119.ts +0 -0
- /package/src/{testing → functions/exa}/data/index.ts +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LocalSearchHandler,
|
|
3
|
+
LocalSearchToolkit,
|
|
4
|
+
ResearchDataTypes,
|
|
5
|
+
ResearchGraph_exports,
|
|
6
|
+
makeGraphWriterHandler,
|
|
7
|
+
makeGraphWriterToolkit
|
|
8
|
+
} from "./chunk-7VH5RFBT.mjs";
|
|
9
|
+
import {
|
|
10
|
+
Research
|
|
11
|
+
} from "./chunk-7WUXG23R.mjs";
|
|
12
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
13
|
+
|
|
14
|
+
// src/blueprints/research/functions/research.ts
|
|
15
|
+
import * as AnthropicTool from "@effect/ai-anthropic/AnthropicTool";
|
|
16
|
+
import * as Toolkit from "@effect/ai/Toolkit";
|
|
17
|
+
import * as Array from "effect/Array";
|
|
18
|
+
import * as Effect from "effect/Effect";
|
|
19
|
+
import * as Function from "effect/Function";
|
|
20
|
+
import * as Layer from "effect/Layer";
|
|
21
|
+
import * as Option from "effect/Option";
|
|
22
|
+
import * as String from "effect/String";
|
|
23
|
+
import { AiService, ConsolePrinter, OpaqueToolkit } from "@dxos/ai";
|
|
24
|
+
import { AiRequest, GenerationObserver, ToolExecutionServices, createToolkit } from "@dxos/assistant";
|
|
25
|
+
import { Template } from "@dxos/blueprints";
|
|
26
|
+
import { Entity, Obj } from "@dxos/echo";
|
|
27
|
+
import { Database } from "@dxos/echo";
|
|
28
|
+
import { Trace } from "@dxos/functions";
|
|
29
|
+
import { Operation } from "@dxos/operation";
|
|
30
|
+
import { Person } from "@dxos/types";
|
|
31
|
+
import { trim } from "@dxos/util";
|
|
32
|
+
|
|
33
|
+
// raw-loader:/__w/dxos/dxos/packages/core/assistant-toolkit/src/blueprints/research/functions/research-instructions.tpl?raw
|
|
34
|
+
var research_instructions_default = "You are the Research Agent.\n\nThe Research Agent is an expert assistant that conducts in-depth research using real-time web search.\nThe Research Agent outputs results in a structured format matching the schema provided.\n\nThe Research Agent is equipped with the ability to:\n\n- Generate precise and effective search queries \n- Request web pages by query.\n- Synthesize accurate, clear, and structured answers using reliable information from the retrieved content\n{{#if entityExtraction}}\n- Search the local database for information using a vector index (through a `local_search` tool)\n{{/if}}\n\nThe Research Agent always follows these principles:\n\n- Relevance First: The Research Agent only returns facts supported by content in retrieved web pages. The Research Agent never fabricates or guesses information.\n- Summarize, Don't Copy: The Research Agent synthesizes and rephrases content in its own words. The Research Agent quotes only when necessary.\n- Multiple Sources: The Research Agent cross-references at least 2 sources before drawing conclusions, unless the information is directly stated and non-controversial.\n- Transparency: The Research Agent mentions which sources were used and explains how it arrived at conclusions.\n- Accuracy Over Brevity: The Research Agent prefers detailed, technically accurate explanations over shallow summaries.\n- The Research Agent admits uncertainty rather than misleading.\n{{#if entityExtraction}}\n- The Research Agent picks the most concrete schema types for extracted information.\n- The Research Agent fills schema fields completely with information it is confident about, and omits fields it is not confident about.\n- When outputting results, the Research Agent adds extra data that fits the schema even if not directly related to the user's question.\n- The Research Agent creates relations and references between new objects found and what's already in the database.\n- The Research Agent does not create objects that are already in the database.\n- The Research Agent re-uses existing object IDs as references when enriching existing objects.\n- The Research Agent ALWAYS calls the `graph_writer` at the end to save the data. This conversation will be deleted, so only the data written to the graph will be preserved.\n{{/if}}\n\nThe Research Agent may be asked for:\n\n- Technical explanations\n- Literature reviews \n- Comparisons\n- Emerging trends\n- Implementation strategies\n\nThe Research Agent begins by interpreting the user's request, then:\n\nThe Research Agent breaks it into sub-questions (if applicable).\n\nFor each sub-question, the Research Agent generates a clear, concise web search query.\n\nThe Research Agent extracts and synthesizes relevant answers.\n\nThe Research Agent's output includes:\n\n- A clear, structured answer to the user's question\n- A citation list or link list of sources used\n\nOptionally, the Research Agent provides follow-up suggestions or questions for deeper inquiry.\n\nHere's how the Research Agent operates:\n\n1. The Research Agent analyzes the user's request and identifies key topics to search for (3 or more), printing them out.\n2. The Research Agent performs a web search for each topic.\n3. The Research Agent reads and analyzes results, cross references information from multiple sources, and represents conflicting information as ranges of possible values.\n\n{{#if entityExtraction}}\n4. The Research Agent searches the local database for information using a vector index that might link to the user's question.\n6. The Research Agent creates relations and references between new objects and existing database objects when related, using existing object IDs as references.\n7. The Research Agent selects the most concrete schema types for extracted information, using multiple types as needed, and prints its decision and reasoning.\n5. The Research Agent creates a clear, structured answer to the user's question.\n8. The Research Agent submits results using the specific schema.\n{{/if}}\n\n{{#if entityExtraction}}\nIMPORTANT:\n- The Research Agent always runs the `local_search` tool to search the local database at least once before submitting results.\n- The Research Agent does not create objects that already exist in the database.\n- Ids that are not in the database are human-readable strings like `ivan_zhao_1`.\n{{/if}}\n\nStatus reporting:\n\nThe Research Agent reports its status frequently using the `<status>` tags: <status>Searching for Google Founders</status>\nThe Research Agent reports its status in-between each tool call and before submitting results.\n\n{{#if entityExtraction}}\n<example>\n\nBased on my research, I can now provide information about Google and it's founders.\n\nThe following objects are already in the database, I will not submit them again, but I'll re-use their IDs as references:\n\n- 01JWRDEHPB5TT2JQQQC15038BT Google\n- 01JWRDEHPA14CYW2NW9FAH6DJJ Larry Page\n- 01JWRDEHPBN0BBJP57B9S108W6 Sergey Brin\n\nI will use the following schema to construct new objects:\n\n- type:org.dxos.type.organization for Alphabet Inc.\n- type:org.dxos.type.person for Ivan Zhao\n- type:org.dxos.type.person for Simon Last\n- dxn:type:org.dxos.relation.employer for Ivan's employer\n- dxn:type:org.dxos.relation.employer for Simon's employer\n\n<status>Formatting results</status>\n\n</example>\n{{/if}}\n\nLast content block is the full research note -- the result of the research.\n";
|
|
35
|
+
|
|
36
|
+
// src/blueprints/research/functions/research.ts
|
|
37
|
+
var research_default = Research.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ query, instructions, mockSearch = false, entityExtraction = false }) {
|
|
38
|
+
if (mockSearch) {
|
|
39
|
+
const mockPerson = yield* Database.add(Obj.make(Person.Person, {
|
|
40
|
+
preferredName: "John Doe",
|
|
41
|
+
emails: [
|
|
42
|
+
{
|
|
43
|
+
value: "john.doe@example.com"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
phoneNumbers: [
|
|
47
|
+
{
|
|
48
|
+
value: "123-456-7890"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}));
|
|
52
|
+
return {
|
|
53
|
+
document: trim`
|
|
54
|
+
The research ran in test-mode and was mocked. Proceed as usual.
|
|
55
|
+
We reference John Doe to test reference: ${Obj.getDXN(mockPerson)}
|
|
56
|
+
`,
|
|
57
|
+
objects: [
|
|
58
|
+
Obj.toJSON(mockPerson)
|
|
59
|
+
]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
yield* Database.flush();
|
|
63
|
+
yield* Trace.emitStatus("Starting research...");
|
|
64
|
+
const NativeWebSearch = Toolkit.make(AnthropicTool.WebSearch_20250305({}));
|
|
65
|
+
let toolkitDef = NativeWebSearch;
|
|
66
|
+
let handlers = Layer.empty;
|
|
67
|
+
const objectDXNs = [];
|
|
68
|
+
if (entityExtraction) {
|
|
69
|
+
const GraphWriterToolkit = makeGraphWriterToolkit({
|
|
70
|
+
schema: ResearchDataTypes
|
|
71
|
+
});
|
|
72
|
+
const GraphWriterHandler = makeGraphWriterHandler(GraphWriterToolkit, {
|
|
73
|
+
onAppend: (dxns) => objectDXNs.push(...dxns)
|
|
74
|
+
});
|
|
75
|
+
toolkitDef = Toolkit.merge(toolkitDef, LocalSearchToolkit, GraphWriterToolkit);
|
|
76
|
+
handlers = Layer.mergeAll(handlers, LocalSearchHandler, GraphWriterHandler).pipe(Layer.provide(ResearchGraph_exports.contextQueueLayer));
|
|
77
|
+
}
|
|
78
|
+
const toolkit = yield* createToolkit({
|
|
79
|
+
toolkit: OpaqueToolkit.make(toolkitDef, handlers)
|
|
80
|
+
});
|
|
81
|
+
const request = new AiRequest({
|
|
82
|
+
observer: GenerationObserver.fromPrinter(new ConsolePrinter({
|
|
83
|
+
tag: "research"
|
|
84
|
+
}))
|
|
85
|
+
});
|
|
86
|
+
const result = yield* request.run({
|
|
87
|
+
prompt: query,
|
|
88
|
+
system: join(Template.process(research_instructions_default, {
|
|
89
|
+
entityExtraction
|
|
90
|
+
}), instructions && `<instructions>${instructions}</instructions>`),
|
|
91
|
+
toolkit
|
|
92
|
+
});
|
|
93
|
+
const objects = yield* Effect.forEach(objectDXNs, (dxn) => Database.resolve(dxn)).pipe(Effect.map(Array.map((obj) => Entity.toJSON(obj))));
|
|
94
|
+
return {
|
|
95
|
+
document: extractLastTextBlock(result),
|
|
96
|
+
objects
|
|
97
|
+
};
|
|
98
|
+
}, Effect.provide(Layer.mergeAll(AiService.model("@anthropic/claude-sonnet-4-0"), ToolExecutionServices, Trace.writerLayerNoop).pipe(Layer.provide(OpaqueToolkit.providerEmpty))))), Operation.opaqueHandler);
|
|
99
|
+
var join = (...strings) => strings.filter(Boolean).join("\n\n");
|
|
100
|
+
var extractLastTextBlock = (result) => {
|
|
101
|
+
return Function.pipe(result, Array.last, Option.map(Function.flow((_) => _.blocks, Array.reverse, Array.dropWhile((_) => _._tag === "stats"), Array.takeWhile((_) => _._tag === "text"), Array.reverse, Array.map((_) => _.text), Array.reduce("", String.concat))), Option.getOrElse(() => ""));
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
research_default as default
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=research-DZPSEZZC.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/research/functions/research.ts", "raw-loader:/__w/dxos/dxos/packages/core/assistant-toolkit/src/blueprints/research/functions/research-instructions.tpl?raw"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AnthropicTool from '@effect/ai-anthropic/AnthropicTool';\nimport * as Toolkit from '@effect/ai/Toolkit';\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as String from 'effect/String';\n\nimport { AiService, ConsolePrinter, OpaqueToolkit } from '@dxos/ai';\nimport { AiRequest, GenerationObserver, ToolExecutionServices, createToolkit } from '@dxos/assistant';\nimport { Template } from '@dxos/blueprints';\nimport { type DXN, Entity, Obj } from '@dxos/echo';\nimport { Database } from '@dxos/echo';\nimport { Trace } from '@dxos/functions';\nimport { Operation } from '@dxos/operation';\nimport { type Message, Person } from '@dxos/types';\nimport { trim } from '@dxos/util';\n\nimport { LocalSearchHandler, LocalSearchToolkit, makeGraphWriterHandler, makeGraphWriterToolkit } from '../../../crud';\nimport { ResearchGraph } from '../types';\nimport { ResearchDataTypes } from '../types';\nimport { Research } from './definitions';\nimport PROMPT from './research-instructions.tpl?raw';\n\n/**\n * Exec external service and return the results as a Subgraph.\n */\nexport default Research.pipe(\n Operation.withHandler(\n Effect.fnUntraced(\n function* ({ query, instructions, mockSearch = false, entityExtraction = false }) {\n if (mockSearch) {\n const mockPerson = yield* Database.add(\n Obj.make(Person.Person, {\n preferredName: 'John Doe',\n emails: [{ value: 'john.doe@example.com' }],\n phoneNumbers: [{ value: '123-456-7890' }],\n }),\n );\n\n return {\n document: trim`\n The research ran in test-mode and was mocked. Proceed as usual.\n We reference John Doe to test reference: ${Obj.getDXN(mockPerson)}\n `,\n objects: [Obj.toJSON(mockPerson)],\n };\n }\n\n yield* Database.flush();\n yield* Trace.emitStatus('Starting research...');\n\n const NativeWebSearch = Toolkit.make(AnthropicTool.WebSearch_20250305({}));\n\n let toolkitDef: Toolkit.Any = NativeWebSearch;\n let handlers: Layer.Layer<any, any> = Layer.empty as any;\n\n const objectDXNs: DXN[] = [];\n if (entityExtraction) {\n const GraphWriterToolkit = makeGraphWriterToolkit({ schema: ResearchDataTypes });\n const GraphWriterHandler = makeGraphWriterHandler(GraphWriterToolkit, {\n onAppend: (dxns) => objectDXNs.push(...dxns),\n });\n\n toolkitDef = Toolkit.merge(toolkitDef, LocalSearchToolkit, GraphWriterToolkit);\n handlers = Layer.mergeAll(handlers, LocalSearchHandler, GraphWriterHandler).pipe(\n Layer.provide(ResearchGraph.contextQueueLayer),\n ) as any;\n }\n\n const toolkit = yield* createToolkit({\n toolkit: OpaqueToolkit.make(toolkitDef as Toolkit.Toolkit<any>, handlers),\n });\n\n const request = new AiRequest({\n observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'research' })),\n });\n const result = yield* request.run({\n prompt: query,\n system: join(\n Template.process(PROMPT, { entityExtraction }),\n instructions && `<instructions>${instructions}</instructions>`,\n ),\n toolkit,\n });\n\n const objects = yield* Effect.forEach(objectDXNs, (dxn) => Database.resolve(dxn)).pipe(\n Effect.map(Array.map((obj) => Entity.toJSON(obj))),\n );\n\n return {\n document: extractLastTextBlock(result),\n objects,\n };\n },\n Effect.provide(\n Layer.mergeAll(\n AiService.model('@anthropic/claude-sonnet-4-0'),\n ToolExecutionServices,\n Trace.writerLayerNoop,\n ).pipe(Layer.provide(OpaqueToolkit.providerEmpty)),\n ),\n ),\n ),\n Operation.opaqueHandler,\n);\n\n// TODO(burdon): Factor out.\nconst join = (...strings: (string | undefined)[]) => strings.filter(Boolean).join('\\n\\n');\n\n/**\n * Extracts the last text block from the result.\n * Skips citations.\n */\n// TODO(burdon): Factor out.\nconst extractLastTextBlock = (result: Message.Message[]) => {\n return Function.pipe(\n result,\n Array.last,\n Option.map(\n Function.flow(\n (_: Message.Message) => _.blocks,\n Array.reverse,\n Array.dropWhile((_: any) => _._tag === 'stats'),\n Array.takeWhile((_: any) => _._tag === 'text'),\n Array.reverse,\n Array.map((_: any) => _.text),\n Array.reduce('', String.concat),\n ),\n ),\n Option.getOrElse(() => ''),\n );\n};\n", "You are the Research Agent.\n\nThe Research Agent is an expert assistant that conducts in-depth research using real-time web search.\nThe Research Agent outputs results in a structured format matching the schema provided.\n\nThe Research Agent is equipped with the ability to:\n\n- Generate precise and effective search queries \n- Request web pages by query.\n- Synthesize accurate, clear, and structured answers using reliable information from the retrieved content\n{{#if entityExtraction}}\n- Search the local database for information using a vector index (through a `local_search` tool)\n{{/if}}\n\nThe Research Agent always follows these principles:\n\n- Relevance First: The Research Agent only returns facts supported by content in retrieved web pages. The Research Agent never fabricates or guesses information.\n- Summarize, Don't Copy: The Research Agent synthesizes and rephrases content in its own words. The Research Agent quotes only when necessary.\n- Multiple Sources: The Research Agent cross-references at least 2 sources before drawing conclusions, unless the information is directly stated and non-controversial.\n- Transparency: The Research Agent mentions which sources were used and explains how it arrived at conclusions.\n- Accuracy Over Brevity: The Research Agent prefers detailed, technically accurate explanations over shallow summaries.\n- The Research Agent admits uncertainty rather than misleading.\n{{#if entityExtraction}}\n- The Research Agent picks the most concrete schema types for extracted information.\n- The Research Agent fills schema fields completely with information it is confident about, and omits fields it is not confident about.\n- When outputting results, the Research Agent adds extra data that fits the schema even if not directly related to the user's question.\n- The Research Agent creates relations and references between new objects found and what's already in the database.\n- The Research Agent does not create objects that are already in the database.\n- The Research Agent re-uses existing object IDs as references when enriching existing objects.\n- The Research Agent ALWAYS calls the `graph_writer` at the end to save the data. This conversation will be deleted, so only the data written to the graph will be preserved.\n{{/if}}\n\nThe Research Agent may be asked for:\n\n- Technical explanations\n- Literature reviews \n- Comparisons\n- Emerging trends\n- Implementation strategies\n\nThe Research Agent begins by interpreting the user's request, then:\n\nThe Research Agent breaks it into sub-questions (if applicable).\n\nFor each sub-question, the Research Agent generates a clear, concise web search query.\n\nThe Research Agent extracts and synthesizes relevant answers.\n\nThe Research Agent's output includes:\n\n- A clear, structured answer to the user's question\n- A citation list or link list of sources used\n\nOptionally, the Research Agent provides follow-up suggestions or questions for deeper inquiry.\n\nHere's how the Research Agent operates:\n\n1. The Research Agent analyzes the user's request and identifies key topics to search for (3 or more), printing them out.\n2. The Research Agent performs a web search for each topic.\n3. The Research Agent reads and analyzes results, cross references information from multiple sources, and represents conflicting information as ranges of possible values.\n\n{{#if entityExtraction}}\n4. The Research Agent searches the local database for information using a vector index that might link to the user's question.\n6. The Research Agent creates relations and references between new objects and existing database objects when related, using existing object IDs as references.\n7. The Research Agent selects the most concrete schema types for extracted information, using multiple types as needed, and prints its decision and reasoning.\n5. The Research Agent creates a clear, structured answer to the user's question.\n8. The Research Agent submits results using the specific schema.\n{{/if}}\n\n{{#if entityExtraction}}\nIMPORTANT:\n- The Research Agent always runs the `local_search` tool to search the local database at least once before submitting results.\n- The Research Agent does not create objects that already exist in the database.\n- Ids that are not in the database are human-readable strings like `ivan_zhao_1`.\n{{/if}}\n\nStatus reporting:\n\nThe Research Agent reports its status frequently using the `<status>` tags: <status>Searching for Google Founders</status>\nThe Research Agent reports its status in-between each tool call and before submitting results.\n\n{{#if entityExtraction}}\n<example>\n\nBased on my research, I can now provide information about Google and it's founders.\n\nThe following objects are already in the database, I will not submit them again, but I'll re-use their IDs as references:\n\n- 01JWRDEHPB5TT2JQQQC15038BT Google\n- 01JWRDEHPA14CYW2NW9FAH6DJJ Larry Page\n- 01JWRDEHPBN0BBJP57B9S108W6 Sergey Brin\n\nI will use the following schema to construct new objects:\n\n- type:org.dxos.type.organization for Alphabet Inc.\n- type:org.dxos.type.person for Ivan Zhao\n- type:org.dxos.type.person for Simon Last\n- dxn:type:org.dxos.relation.employer for Ivan's employer\n- dxn:type:org.dxos.relation.employer for Simon's employer\n\n<status>Formatting results</status>\n\n</example>\n{{/if}}\n\nLast content block is the full research note -- the result of the research.\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["AnthropicTool", "Toolkit", "Array", "Effect", "Function", "Layer", "Option", "String", "AiService", "ConsolePrinter", "OpaqueToolkit", "AiRequest", "GenerationObserver", "ToolExecutionServices", "createToolkit", "Template", "Entity", "Obj", "Database", "Trace", "Operation", "Person", "trim", "Research", "pipe", "Operation", "withHandler", "fnUntraced", "query", "instructions", "mockSearch", "entityExtraction", "mockPerson", "Database", "add", "Obj", "make", "Person", "preferredName", "emails", "value", "phoneNumbers", "document", "trim", "getDXN", "objects", "toJSON", "flush", "Trace", "emitStatus", "NativeWebSearch", "WebSearch_20250305", "toolkitDef", "handlers", "empty", "objectDXNs", "GraphWriterToolkit", "makeGraphWriterToolkit", "schema", "ResearchDataTypes", "GraphWriterHandler", "makeGraphWriterHandler", "onAppend", "dxns", "push", "merge", "LocalSearchToolkit", "mergeAll", "LocalSearchHandler", "provide", "ResearchGraph", "contextQueueLayer", "toolkit", "createToolkit", "OpaqueToolkit", "request", "AiRequest", "observer", "GenerationObserver", "fromPrinter", "ConsolePrinter", "tag", "result", "run", "prompt", "system", "join", "Template", "process", "PROMPT", "forEach", "dxn", "resolve", "map", "obj", "Entity", "extractLastTextBlock", "AiService", "model", "ToolExecutionServices", "writerLayerNoop", "providerEmpty", "opaqueHandler", "strings", "filter", "Boolean", "last", "flow", "_", "blocks", "reverse", "dropWhile", "_tag", "takeWhile", "text", "reduce", "concat", "getOrElse"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SaveMemory
|
|
3
|
+
} from "./chunk-RXITNKBD.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Memory
|
|
6
|
+
} from "./chunk-4BWLYLTR.mjs";
|
|
7
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
8
|
+
|
|
9
|
+
// src/blueprints/memory/functions/save.ts
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import { Database, Entity, Obj } from "@dxos/echo";
|
|
12
|
+
import { Operation } from "@dxos/operation";
|
|
13
|
+
var save_default = SaveMemory.pipe(Operation.withHandler(Effect.fn(function* ({ title, content }) {
|
|
14
|
+
const memory = yield* Database.add(Obj.make(Memory, {
|
|
15
|
+
title,
|
|
16
|
+
content
|
|
17
|
+
}));
|
|
18
|
+
return Entity.toJSON(memory);
|
|
19
|
+
})));
|
|
20
|
+
export {
|
|
21
|
+
save_default as default
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=save-M4KRWV4W.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/memory/functions/save.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Database, Entity, Obj } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\n\nimport { Memory } from '../../../types/Memory';\nimport { SaveMemory } from './definitions';\n\nexport default SaveMemory.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ title, content }) {\n const memory = yield* Database.add(Obj.make(Memory, { title, content }));\n return Entity.toJSON(memory);\n }),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,UAAUC,QAAQC,WAAW;AACtC,SAASC,iBAAiB;AAK1B,IAAA,eAAeC,WAAWC,KACxBC,UAAUC,YACDC,UAAG,WAAW,EAAEC,OAAOC,QAAO,GAAE;AACrC,QAAMC,SAAS,OAAOC,SAASC,IAAIC,IAAIC,KAAKC,QAAQ;IAAEP;IAAOC;EAAQ,CAAA,CAAA;AACrE,SAAOO,OAAOC,OAAOP,MAAAA;AACvB,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Database", "Entity", "Obj", "Operation", "SaveMemory", "pipe", "Operation", "withHandler", "fn", "title", "content", "memory", "Database", "add", "Obj", "make", "Memory", "Entity", "toJSON"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SchemaAdd
|
|
3
|
+
} from "./chunk-IVXBQQDJ.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/blueprints/database/functions/schema-add.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { Database } from "@dxos/echo";
|
|
9
|
+
import { Operation } from "@dxos/operation";
|
|
10
|
+
var schema_add_default = SchemaAdd.pipe(Operation.withHandler(Effect.fn(function* ({ name, typename, jsonSchema }) {
|
|
11
|
+
const { db } = yield* Database.Service;
|
|
12
|
+
yield* Effect.promise(() => db.schemaRegistry.register([
|
|
13
|
+
{
|
|
14
|
+
typename,
|
|
15
|
+
version: "0.1.0",
|
|
16
|
+
jsonSchema,
|
|
17
|
+
name
|
|
18
|
+
}
|
|
19
|
+
]));
|
|
20
|
+
})));
|
|
21
|
+
export {
|
|
22
|
+
schema_add_default as default
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=schema-add-RVV364G6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/database/functions/schema-add.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Database } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\n\nimport { SchemaAdd } from './definitions';\n\nexport default SchemaAdd.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ name, typename, jsonSchema }) {\n const { db } = yield* Database.Service;\n yield* Effect.promise(() =>\n db.schemaRegistry.register([\n {\n typename,\n version: '0.1.0',\n jsonSchema,\n name,\n },\n ]),\n );\n }),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAI1B,IAAA,qBAAeC,UAAUC,KACvBC,UAAUC,YACDC,UAAG,WAAW,EAAEC,MAAMC,UAAUC,WAAU,GAAE;AACjD,QAAM,EAAEC,GAAE,IAAK,OAAOC,SAASC;AAC/B,SAAcC,eAAQ,MACpBH,GAAGI,eAAeC,SAAS;IACzB;MACEP;MACAQ,SAAS;MACTP;MACAF;IACF;GACD,CAAA;AAEL,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Database", "Operation", "SchemaAdd", "pipe", "Operation", "withHandler", "fn", "name", "typename", "jsonSchema", "db", "Database", "Service", "promise", "schemaRegistry", "register", "version"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SchemaList
|
|
3
|
+
} from "./chunk-IVXBQQDJ.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/blueprints/database/functions/schema-list.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { Prompt, Blueprint } from "@dxos/blueprints";
|
|
9
|
+
import { Database, Feed, JsonSchema, Type, View } from "@dxos/echo";
|
|
10
|
+
import { Operation } from "@dxos/operation";
|
|
11
|
+
var EXCLUDED_TYPES = [
|
|
12
|
+
Type.PersistentType,
|
|
13
|
+
View.View,
|
|
14
|
+
Prompt.Prompt,
|
|
15
|
+
Blueprint.Blueprint,
|
|
16
|
+
Feed.Feed
|
|
17
|
+
];
|
|
18
|
+
var excludedTypenames = EXCLUDED_TYPES.map((type) => Type.getTypename(type));
|
|
19
|
+
var schema_list_default = SchemaList.pipe(Operation.withHandler(Effect.fn(function* () {
|
|
20
|
+
const { db } = yield* Database.Service;
|
|
21
|
+
const schema = yield* Effect.promise(() => db.schemaRegistry.query({
|
|
22
|
+
location: [
|
|
23
|
+
"database",
|
|
24
|
+
"runtime"
|
|
25
|
+
]
|
|
26
|
+
}).run());
|
|
27
|
+
return schema.filter((schema2) => !excludedTypenames.includes(Type.getTypename(schema2))).map((schema2) => {
|
|
28
|
+
const meta = Type.getMeta(schema2);
|
|
29
|
+
return {
|
|
30
|
+
typename: Type.getTypename(schema2),
|
|
31
|
+
jsonSchema: JsonSchema.toJsonSchema(schema2),
|
|
32
|
+
kind: meta?.sourceSchema ? "relation" : "record"
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
})));
|
|
36
|
+
export {
|
|
37
|
+
schema_list_default as default
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=schema-list-4IYBLXFN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/database/functions/schema-list.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Prompt, Blueprint } from '@dxos/blueprints';\nimport { Database, Feed, JsonSchema, Type, View } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\n\nimport { SchemaList } from './definitions';\n\n// TODO(dmaretskyi): This is a balance between not filling the agent's context with too many types and not excluding important types.\nconst EXCLUDED_TYPES = [Type.PersistentType, View.View, Prompt.Prompt, Blueprint.Blueprint, Feed.Feed];\nconst excludedTypenames = EXCLUDED_TYPES.map((type) => Type.getTypename(type));\n\nexport default SchemaList.pipe(\n Operation.withHandler(\n Effect.fn(function* () {\n const { db } = yield* Database.Service;\n const schema = yield* Effect.promise(() => db.schemaRegistry.query({ location: ['database', 'runtime'] }).run());\n return schema\n .filter((schema) => !excludedTypenames.includes(Type.getTypename(schema)))\n .map((schema) => {\n const meta = Type.getMeta(schema);\n return {\n typename: Type.getTypename(schema),\n jsonSchema: JsonSchema.toJsonSchema(schema),\n kind: meta?.sourceSchema ? 'relation' : 'record',\n };\n });\n }),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,QAAQC,iBAAiB;AAClC,SAASC,UAAUC,MAAMC,YAAYC,MAAMC,YAAY;AACvD,SAASC,iBAAiB;AAK1B,IAAMC,iBAAiB;EAACC,KAAKC;EAAgBC,KAAKA;EAAMC,OAAOA;EAAQC,UAAUA;EAAWC,KAAKA;;AACjG,IAAMC,oBAAoBP,eAAeQ,IAAI,CAACC,SAASR,KAAKS,YAAYD,IAAAA,CAAAA;AAExE,IAAA,sBAAeE,WAAWC,KACxBC,UAAUC,YACDC,UAAG,aAAA;AACR,QAAM,EAAEC,GAAE,IAAK,OAAOC,SAASC;AAC/B,QAAMC,SAAS,OAAcC,eAAQ,MAAMJ,GAAGK,eAAeC,MAAM;IAAEC,UAAU;MAAC;MAAY;;EAAW,CAAA,EAAGC,IAAG,CAAA;AAC7G,SAAOL,OACJM,OAAO,CAACN,YAAW,CAACZ,kBAAkBmB,SAASzB,KAAKS,YAAYS,OAAAA,CAAAA,CAAAA,EAChEX,IAAI,CAACW,YAAAA;AACJ,UAAMQ,OAAO1B,KAAK2B,QAAQT,OAAAA;AAC1B,WAAO;MACLU,UAAU5B,KAAKS,YAAYS,OAAAA;MAC3BW,YAAYC,WAAWC,aAAab,OAAAA;MACpCc,MAAMN,MAAMO,eAAe,aAAa;IAC1C;EACF,CAAA;AACJ,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Prompt", "Blueprint", "Database", "Feed", "JsonSchema", "Type", "View", "Operation", "EXCLUDED_TYPES", "Type", "PersistentType", "View", "Prompt", "Blueprint", "Feed", "excludedTypenames", "map", "type", "getTypename", "SchemaList", "pipe", "Operation", "withHandler", "fn", "db", "Database", "Service", "schema", "promise", "schemaRegistry", "query", "location", "run", "filter", "includes", "meta", "getMeta", "typename", "jsonSchema", "JsonSchema", "toJsonSchema", "kind", "sourceSchema"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
syncObjects
|
|
3
|
+
} from "./chunk-VD2WAUU2.mjs";
|
|
4
|
+
import {
|
|
5
|
+
SyncIssues
|
|
6
|
+
} from "./chunk-LI6VMCJW.mjs";
|
|
7
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
8
|
+
|
|
9
|
+
// src/blueprints/linear/functions/sync-issues.ts
|
|
10
|
+
import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
|
|
11
|
+
import * as HttpClient from "@effect/platform/HttpClient";
|
|
12
|
+
import * as Array from "effect/Array";
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
|
+
import * as Function from "effect/Function";
|
|
15
|
+
import { Filter, Obj, Query, Ref } from "@dxos/echo";
|
|
16
|
+
import { Database } from "@dxos/echo";
|
|
17
|
+
import { CredentialsService, withAuthorization } from "@dxos/functions";
|
|
18
|
+
import { log } from "@dxos/log";
|
|
19
|
+
import { Operation } from "@dxos/operation";
|
|
20
|
+
import { Person, Pipeline, Task } from "@dxos/types";
|
|
21
|
+
|
|
22
|
+
// src/util/graphql.ts
|
|
23
|
+
import * as HttpBody from "@effect/platform/HttpBody";
|
|
24
|
+
var graphqlRequestBody = (query, variables = {}) => HttpBody.json({
|
|
25
|
+
query,
|
|
26
|
+
variables
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// src/blueprints/linear/functions/sync-issues.ts
|
|
30
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/core/assistant-toolkit/src/blueprints/linear/functions/sync-issues.ts";
|
|
31
|
+
var queryIssues = `
|
|
32
|
+
query Issues($teamId: String!, $after: DateTimeOrDuration!) {
|
|
33
|
+
team(id: $teamId) {
|
|
34
|
+
id
|
|
35
|
+
name
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
issues(last: 150, orderBy: updatedAt, filter: {
|
|
39
|
+
updatedAt: { gt: $after }
|
|
40
|
+
}) {
|
|
41
|
+
edges {
|
|
42
|
+
node {
|
|
43
|
+
id
|
|
44
|
+
title
|
|
45
|
+
createdAt
|
|
46
|
+
updatedAt
|
|
47
|
+
description
|
|
48
|
+
assignee { id, name }
|
|
49
|
+
state {
|
|
50
|
+
name
|
|
51
|
+
}
|
|
52
|
+
project {
|
|
53
|
+
id
|
|
54
|
+
name
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
cursor
|
|
58
|
+
}
|
|
59
|
+
pageInfo {
|
|
60
|
+
hasNextPage
|
|
61
|
+
endCursor
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
var LINEAR_ID_KEY = "linear.app/id";
|
|
68
|
+
var LINEAR_TEAM_ID_KEY = "linear.app/teamId";
|
|
69
|
+
var LINEAR_UPDATED_AT_KEY = "linear.app/updatedAt";
|
|
70
|
+
var sync_issues_default = SyncIssues.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ team }) {
|
|
71
|
+
const credential = yield* CredentialsService.getCredential({
|
|
72
|
+
service: "linear.app"
|
|
73
|
+
});
|
|
74
|
+
const client = yield* HttpClient.HttpClient.pipe(Effect.map(withAuthorization(credential.apiKey)));
|
|
75
|
+
const after = yield* getLatestUpdateTimestamp(team, Task.Task);
|
|
76
|
+
log.info("will fetch", {
|
|
77
|
+
after
|
|
78
|
+
}, {
|
|
79
|
+
F: __dxlog_file,
|
|
80
|
+
L: 86,
|
|
81
|
+
S: this,
|
|
82
|
+
C: (f, a) => f(...a)
|
|
83
|
+
});
|
|
84
|
+
const response = yield* client.post("https://api.linear.app/graphql", {
|
|
85
|
+
body: yield* graphqlRequestBody(queryIssues, {
|
|
86
|
+
teamId: team,
|
|
87
|
+
after
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
const json2 = yield* response.json;
|
|
91
|
+
const tasks = json2.data.team.issues.edges.map((edge) => mapLinearIssue(edge.node, {
|
|
92
|
+
teamId: team
|
|
93
|
+
}));
|
|
94
|
+
log.info("Fetched tasks", {
|
|
95
|
+
count: tasks.length
|
|
96
|
+
}, {
|
|
97
|
+
F: __dxlog_file,
|
|
98
|
+
L: 98,
|
|
99
|
+
S: this,
|
|
100
|
+
C: (f, a) => f(...a)
|
|
101
|
+
});
|
|
102
|
+
return {
|
|
103
|
+
objects: yield* syncObjects(tasks, {
|
|
104
|
+
foreignKeyId: LINEAR_ID_KEY
|
|
105
|
+
}),
|
|
106
|
+
syncComplete: tasks.length < 150
|
|
107
|
+
};
|
|
108
|
+
}, Effect.provide(FetchHttpClient.layer))));
|
|
109
|
+
var getLatestUpdateTimestamp = Effect.fnUntraced(function* (teamId, dataType) {
|
|
110
|
+
const existingTasks = yield* Database.runQuery(Query.type(dataType).select(Filter.foreignKeys(dataType, [
|
|
111
|
+
{
|
|
112
|
+
source: LINEAR_TEAM_ID_KEY,
|
|
113
|
+
id: teamId
|
|
114
|
+
}
|
|
115
|
+
])));
|
|
116
|
+
return Function.pipe(existingTasks, Array.map((task) => Obj.getKeys(task, LINEAR_UPDATED_AT_KEY).at(0)?.id), Array.filter((x) => x !== void 0), Array.reduce("2025-01-01T00:00:00.000Z", (acc, x) => x > acc ? x : acc));
|
|
117
|
+
});
|
|
118
|
+
var mapLinearPerson = (person, { teamId }) => Obj.make(Person.Person, {
|
|
119
|
+
[Obj.Meta]: {
|
|
120
|
+
keys: [
|
|
121
|
+
{
|
|
122
|
+
id: person.id,
|
|
123
|
+
source: LINEAR_ID_KEY
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: teamId,
|
|
127
|
+
source: LINEAR_TEAM_ID_KEY
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
nickname: person.name
|
|
132
|
+
});
|
|
133
|
+
var mapLinearIssue = (issue, { teamId }) => Obj.make(Task.Task, {
|
|
134
|
+
[Obj.Meta]: {
|
|
135
|
+
keys: [
|
|
136
|
+
{
|
|
137
|
+
id: issue.id,
|
|
138
|
+
source: LINEAR_ID_KEY
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: issue.updatedAt,
|
|
142
|
+
source: LINEAR_UPDATED_AT_KEY
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: teamId,
|
|
146
|
+
source: LINEAR_TEAM_ID_KEY
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
title: issue.title ?? void 0,
|
|
151
|
+
description: issue.description ?? void 0,
|
|
152
|
+
assigned: !issue.assignee ? void 0 : Ref.make(mapLinearPerson(issue.assignee, {
|
|
153
|
+
teamId
|
|
154
|
+
})),
|
|
155
|
+
// TODO(dmaretskyi): Sync those (+ linear team as org?).
|
|
156
|
+
// state: issue.state.name,
|
|
157
|
+
project: !issue.project ? void 0 : Ref.make(Pipeline.make({
|
|
158
|
+
[Obj.Meta]: {
|
|
159
|
+
keys: [
|
|
160
|
+
{
|
|
161
|
+
id: issue.project.id,
|
|
162
|
+
source: LINEAR_ID_KEY
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: teamId,
|
|
166
|
+
source: LINEAR_TEAM_ID_KEY
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
name: issue.project.name
|
|
171
|
+
}))
|
|
172
|
+
});
|
|
173
|
+
export {
|
|
174
|
+
LINEAR_ID_KEY,
|
|
175
|
+
LINEAR_TEAM_ID_KEY,
|
|
176
|
+
LINEAR_UPDATED_AT_KEY,
|
|
177
|
+
sync_issues_default as default
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=sync-issues-BBAMXSZN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/linear/functions/sync-issues.ts", "../../../src/util/graphql.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FetchHttpClient from '@effect/platform/FetchHttpClient';\nimport * as HttpClient from '@effect/platform/HttpClient';\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { Filter, Obj, Query, Ref, type Type } from '@dxos/echo';\nimport { Database } from '@dxos/echo';\nimport { CredentialsService, withAuthorization } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { Operation } from '@dxos/operation';\nimport { Person, Pipeline, Task } from '@dxos/types';\n\nimport { syncObjects } from '../../../sync';\nimport { graphqlRequestBody } from '../../../util';\nimport { SyncIssues } from './definitions';\n\nconst queryIssues = `\nquery Issues($teamId: String!, $after: DateTimeOrDuration!) {\n team(id: $teamId) {\n id\n name\n\n\n issues(last: 150, orderBy: updatedAt, filter: {\n updatedAt: { gt: $after }\n }) {\n edges {\n node {\n id\n title\n createdAt\n updatedAt\n description\n assignee { id, name }\n state {\n name\n }\n project {\n id\n name\n }\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n}\n`;\n\ntype LinearIssue = {\n id: string;\n title: string;\n createdAt: string;\n updatedAt: string;\n description: string;\n assignee: LinearPerson;\n state: { name: string };\n project: { id: string; name: string };\n};\n\ntype LinearPerson = {\n id: string;\n name: string;\n};\n\nexport const LINEAR_ID_KEY = 'linear.app/id';\nexport const LINEAR_TEAM_ID_KEY = 'linear.app/teamId';\nexport const LINEAR_UPDATED_AT_KEY = 'linear.app/updatedAt';\n\nexport default SyncIssues.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ team }) {\n const credential = yield* CredentialsService.getCredential({ service: 'linear.app' });\n const client = yield* HttpClient.HttpClient.pipe(Effect.map(withAuthorization(credential.apiKey!)));\n\n const after = yield* getLatestUpdateTimestamp(team, Task.Task);\n log.info('will fetch', { after });\n\n const response = yield* client.post('https://api.linear.app/graphql', {\n body: yield* graphqlRequestBody(queryIssues, {\n teamId: team,\n after,\n }),\n });\n const json: any = yield* response.json;\n const tasks = (json.data.team.issues.edges as any[]).map((edge: any) =>\n mapLinearIssue(edge.node as LinearIssue, { teamId: team }),\n );\n log.info('Fetched tasks', { count: tasks.length });\n\n return {\n objects: yield* syncObjects(tasks, { foreignKeyId: LINEAR_ID_KEY }),\n syncComplete: tasks.length < 150,\n };\n }, Effect.provide(FetchHttpClient.layer)),\n ),\n);\n\nconst getLatestUpdateTimestamp: (\n teamId: string,\n dataType: Type.AnyObj,\n) => Effect.Effect<string, never, Database.Service> = Effect.fnUntraced(function* (teamId, dataType) {\n const existingTasks = yield* Database.runQuery(\n Query.type(dataType).select(Filter.foreignKeys(dataType, [{ source: LINEAR_TEAM_ID_KEY, id: teamId }])),\n );\n return Function.pipe(\n existingTasks,\n Array.map((task) => Obj.getKeys(task, LINEAR_UPDATED_AT_KEY).at(0)?.id),\n Array.filter((x) => x !== undefined),\n Array.reduce('2025-01-01T00:00:00.000Z', (acc: string, x: string) => (x > acc ? x : acc)),\n );\n});\n\nconst mapLinearPerson = (person: LinearPerson, { teamId }: { teamId: string }): Person.Person =>\n Obj.make(Person.Person, {\n [Obj.Meta]: {\n keys: [\n {\n id: person.id,\n source: LINEAR_ID_KEY,\n },\n {\n id: teamId,\n source: LINEAR_TEAM_ID_KEY,\n },\n ],\n },\n nickname: person.name,\n });\n\nconst mapLinearIssue = (issue: LinearIssue, { teamId }: { teamId: string }): Task.Task =>\n Obj.make(Task.Task, {\n [Obj.Meta]: {\n keys: [\n {\n id: issue.id,\n source: LINEAR_ID_KEY,\n },\n {\n id: issue.updatedAt,\n source: LINEAR_UPDATED_AT_KEY,\n },\n {\n id: teamId,\n source: LINEAR_TEAM_ID_KEY,\n },\n ],\n },\n title: issue.title ?? undefined,\n description: issue.description ?? undefined,\n assigned: !issue.assignee ? undefined : Ref.make(mapLinearPerson(issue.assignee, { teamId })),\n // TODO(dmaretskyi): Sync those (+ linear team as org?).\n // state: issue.state.name,\n\n project: !issue.project\n ? undefined\n : Ref.make(\n Pipeline.make({\n [Obj.Meta]: {\n keys: [\n {\n id: issue.project.id,\n source: LINEAR_ID_KEY,\n },\n {\n id: teamId,\n source: LINEAR_TEAM_ID_KEY,\n },\n ],\n },\n name: issue.project.name,\n }),\n ),\n });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as HttpBody from '@effect/platform/HttpBody';\n\n/**\n * Template tag literal to get syntax highlighting for the query.\n *\n * @example\n * ```ts\n * const query = gql`\n * query Team($teamId: String!) {\n * team(id: $teamId) {\n * id\n * name\n * }\n * }\n * `;\n * ```\n */\nexport const gql = (query: string) => query;\n\n/**\n * @returns JSON body for the graphql request.\n */\nexport const graphqlRequestBody = (query: string, variables: Record<string, any> = {}) =>\n HttpBody.json({\n query,\n variables,\n });\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["FetchHttpClient", "HttpClient", "Array", "Effect", "Function", "Filter", "Obj", "Query", "Ref", "Database", "CredentialsService", "withAuthorization", "log", "Operation", "Person", "Pipeline", "Task", "HttpBody", "graphqlRequestBody", "query", "variables", "json", "queryIssues", "LINEAR_ID_KEY", "LINEAR_TEAM_ID_KEY", "LINEAR_UPDATED_AT_KEY", "SyncIssues", "pipe", "Operation", "withHandler", "fnUntraced", "team", "credential", "CredentialsService", "getCredential", "service", "client", "HttpClient", "map", "withAuthorization", "apiKey", "after", "getLatestUpdateTimestamp", "Task", "log", "info", "response", "post", "body", "graphqlRequestBody", "teamId", "json", "tasks", "data", "issues", "edges", "edge", "mapLinearIssue", "node", "count", "length", "objects", "syncObjects", "foreignKeyId", "syncComplete", "provide", "layer", "dataType", "existingTasks", "Database", "runQuery", "Query", "type", "select", "Filter", "foreignKeys", "source", "id", "task", "Obj", "getKeys", "at", "filter", "x", "undefined", "reduce", "acc", "mapLinearPerson", "person", "make", "Person", "Meta", "keys", "nickname", "name", "issue", "updatedAt", "title", "description", "assigned", "assignee", "Ref", "project", "Pipeline"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SyncTriggers
|
|
3
|
+
} from "./chunk-I2YSCI65.mjs";
|
|
4
|
+
import "./chunk-VUGCOWRW.mjs";
|
|
5
|
+
import "./chunk-DV5DCOUE.mjs";
|
|
6
|
+
import "./chunk-4BWLYLTR.mjs";
|
|
7
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
8
|
+
|
|
9
|
+
// src/blueprints/project-wizard/functions/sync-triggers.ts
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Option from "effect/Option";
|
|
12
|
+
import { Database, Feed, Filter, Obj, Ref } from "@dxos/echo";
|
|
13
|
+
import { Trigger } from "@dxos/functions";
|
|
14
|
+
import { Operation } from "@dxos/operation";
|
|
15
|
+
import { FeedAnnotation } from "@dxos/schema";
|
|
16
|
+
var sync_triggers_default = SyncTriggers.pipe(Operation.withHandler(Effect.fn(function* ({ agent: agentRef }) {
|
|
17
|
+
const agent = yield* Database.load(agentRef);
|
|
18
|
+
yield* syncAgentTriggers(agent);
|
|
19
|
+
})));
|
|
20
|
+
var AGENT_TRIGGER_EXTENSION_KEY = "org.dxos.extension.AgentTrigger";
|
|
21
|
+
var AGENT_TRIGGER_TARGET_EXTENSION_KEY = "org.dxos.extension.AgentTriggerTarget";
|
|
22
|
+
var hasFeedAnnotation = (obj) => {
|
|
23
|
+
const schema = Obj.getSchema(obj);
|
|
24
|
+
if (!schema) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const annotation = FeedAnnotation.get(schema);
|
|
28
|
+
return Option.isSome(annotation) && annotation.value === true;
|
|
29
|
+
};
|
|
30
|
+
var syncAgentTriggers = (agent) => Effect.gen(function* () {
|
|
31
|
+
const triggers = yield* Database.runQuery(Filter.foreignKeys(Trigger.Trigger, [
|
|
32
|
+
{
|
|
33
|
+
source: AGENT_TRIGGER_EXTENSION_KEY,
|
|
34
|
+
id: agent.id
|
|
35
|
+
}
|
|
36
|
+
]));
|
|
37
|
+
for (const trigger of triggers) {
|
|
38
|
+
yield* Database.remove(trigger);
|
|
39
|
+
}
|
|
40
|
+
const { Qualifier, AgentWorker } = yield* Effect.promise(() => import("./project-4YLFG5BQ.mjs"));
|
|
41
|
+
for (const subscription of agent.subscriptions) {
|
|
42
|
+
const targetOption = yield* Database.loadOption(subscription);
|
|
43
|
+
if (Option.isNone(targetOption)) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const target = targetOption.value;
|
|
47
|
+
let feedObj;
|
|
48
|
+
if (Obj.instanceOf(Feed.Feed, target)) {
|
|
49
|
+
feedObj = target;
|
|
50
|
+
} else if (hasFeedAnnotation(target)) {
|
|
51
|
+
const feedRef = target.feed;
|
|
52
|
+
feedObj = feedRef ? Option.getOrUndefined(yield* Database.loadOption(feedRef)) : void 0;
|
|
53
|
+
}
|
|
54
|
+
const queueDxn = Option.fromNullable(feedObj).pipe(Option.filter(Obj.instanceOf(Feed.Feed)), Option.map(Feed.getQueueDxn), Option.getOrUndefined);
|
|
55
|
+
if (!queueDxn) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const filterEvents = agent.filterEvents ?? true;
|
|
59
|
+
yield* Database.add(Trigger.make({
|
|
60
|
+
[Obj.Parent]: agent,
|
|
61
|
+
[Obj.Meta]: {
|
|
62
|
+
keys: [
|
|
63
|
+
{
|
|
64
|
+
source: AGENT_TRIGGER_EXTENSION_KEY,
|
|
65
|
+
id: agent.id
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
source: AGENT_TRIGGER_TARGET_EXTENSION_KEY,
|
|
69
|
+
id: subscription.dxn.toString()
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
enabled: true,
|
|
74
|
+
spec: Trigger.specQueue(queueDxn.toString()),
|
|
75
|
+
function: Ref.make(Operation.serialize(filterEvents ? Qualifier : AgentWorker)),
|
|
76
|
+
input: {
|
|
77
|
+
agent: Ref.make(agent),
|
|
78
|
+
event: "{{event}}"
|
|
79
|
+
},
|
|
80
|
+
concurrency: filterEvents ? 5 : void 0
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
if ((agent.filterEvents ?? true) && agent.queue) {
|
|
84
|
+
yield* Database.add(Trigger.make({
|
|
85
|
+
[Obj.Parent]: agent,
|
|
86
|
+
[Obj.Meta]: {
|
|
87
|
+
keys: [
|
|
88
|
+
{
|
|
89
|
+
source: AGENT_TRIGGER_EXTENSION_KEY,
|
|
90
|
+
id: agent.id
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
source: AGENT_TRIGGER_TARGET_EXTENSION_KEY,
|
|
94
|
+
id: Obj.getDXN(agent)?.toString() ?? ""
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
function: Ref.make(Operation.serialize(AgentWorker)),
|
|
99
|
+
enabled: true,
|
|
100
|
+
spec: Trigger.specQueue(agent.queue.dxn.toString()),
|
|
101
|
+
input: {
|
|
102
|
+
agent: Ref.make(agent),
|
|
103
|
+
event: "{{event}}"
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
yield* Database.flush();
|
|
108
|
+
});
|
|
109
|
+
export {
|
|
110
|
+
sync_triggers_default as default
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=sync-triggers-56ELUXSO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/project-wizard/functions/sync-triggers.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Database, Feed, Filter, Obj, Ref } from '@dxos/echo';\nimport { Trigger } from '@dxos/functions';\nimport { Operation } from '@dxos/operation';\nimport { FeedAnnotation } from '@dxos/schema';\n\nimport { Agent } from '../../../types';\nimport { SyncTriggers } from './definitions';\n\nexport default SyncTriggers.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ agent: agentRef }) {\n const agent = yield* Database.load(agentRef);\n yield* syncAgentTriggers(agent);\n }),\n ),\n);\n\n/**\n * Foreign key {@link AGENT_TRIGGER_EXTENSION_KEY} => <agent id : ObjectId>.\n */\nconst AGENT_TRIGGER_EXTENSION_KEY = 'org.dxos.extension.AgentTrigger';\n\n/**\n * Foreign key {@link AGENT_TRIGGER_TARGET_EXTENSION_KEY} => <dxn string of subscription target>.\n */\nconst AGENT_TRIGGER_TARGET_EXTENSION_KEY = 'org.dxos.extension.AgentTriggerTarget';\n\n/** Checks if an object's schema has the FeedAnnotation. */\nconst hasFeedAnnotation = (obj: Obj.Unknown): boolean => {\n const schema = Obj.getSchema(obj);\n if (!schema) {\n return false;\n }\n const annotation = FeedAnnotation.get(schema);\n return Option.isSome(annotation) && annotation.value === true;\n};\n\n/**\n * Syncs triggers in the database with the agent subscriptions.\n */\nconst syncAgentTriggers = (agent: Agent.Agent): Effect.Effect<void, never, Database.Service> =>\n Effect.gen(function* () {\n const triggers = yield* Database.runQuery(\n Filter.foreignKeys(Trigger.Trigger, [{ source: AGENT_TRIGGER_EXTENSION_KEY, id: agent.id }]),\n );\n\n // Remove all existing triggers — they will be recreated with the current config.\n // This ensures operation and concurrency stay in sync when filterEvents is toggled.\n for (const trigger of triggers) {\n yield* Database.remove(trigger);\n }\n\n // Lazy import to avoid circular dependency issues.\n const { Qualifier, AgentWorker } = yield* Effect.promise(() => import('../../project'));\n\n for (const subscription of agent.subscriptions) {\n const targetOption = yield* Database.loadOption(subscription);\n if (Option.isNone(targetOption)) {\n continue;\n }\n const target = targetOption.value;\n\n let feedObj: Feed.Feed | undefined;\n if (Obj.instanceOf(Feed.Feed, target)) {\n feedObj = target;\n } else if (hasFeedAnnotation(target)) {\n const feedRef = (target as Obj.Unknown & { feed?: Ref.Ref<Feed.Feed> }).feed;\n feedObj = feedRef ? Option.getOrUndefined(yield* Database.loadOption(feedRef)) : undefined;\n }\n\n const queueDxn = Option.fromNullable(feedObj).pipe(\n Option.filter(Obj.instanceOf(Feed.Feed)),\n Option.map(Feed.getQueueDxn),\n Option.getOrUndefined,\n );\n if (!queueDxn) {\n continue;\n }\n\n const filterEvents = agent.filterEvents ?? true;\n\n yield* Database.add(\n Trigger.make({\n [Obj.Parent]: agent,\n [Obj.Meta]: {\n keys: [\n { source: AGENT_TRIGGER_EXTENSION_KEY, id: agent.id },\n { source: AGENT_TRIGGER_TARGET_EXTENSION_KEY, id: subscription.dxn.toString() },\n ],\n },\n enabled: true,\n spec: Trigger.specQueue(queueDxn.toString()),\n function: Ref.make(Operation.serialize(filterEvents ? Qualifier : AgentWorker)),\n input: {\n agent: Ref.make(agent),\n event: '{{event}}',\n },\n concurrency: filterEvents ? 5 : undefined,\n }),\n );\n }\n\n if ((agent.filterEvents ?? true) && agent.queue) {\n yield* Database.add(\n Trigger.make({\n [Obj.Parent]: agent,\n [Obj.Meta]: {\n keys: [\n { source: AGENT_TRIGGER_EXTENSION_KEY, id: agent.id },\n {\n source: AGENT_TRIGGER_TARGET_EXTENSION_KEY,\n id: Obj.getDXN(agent)?.toString() ?? '',\n },\n ],\n },\n function: Ref.make(Operation.serialize(AgentWorker)),\n enabled: true,\n spec: Trigger.specQueue(agent.queue.dxn.toString()),\n input: {\n agent: Ref.make(agent),\n event: '{{event}}',\n },\n }),\n );\n }\n\n yield* Database.flush();\n });\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Effect", "Option", "Database", "Feed", "Filter", "Obj", "Ref", "Trigger", "Operation", "FeedAnnotation", "SyncTriggers", "pipe", "Operation", "withHandler", "fn", "agent", "agentRef", "Database", "load", "syncAgentTriggers", "AGENT_TRIGGER_EXTENSION_KEY", "AGENT_TRIGGER_TARGET_EXTENSION_KEY", "hasFeedAnnotation", "obj", "schema", "Obj", "getSchema", "annotation", "FeedAnnotation", "get", "isSome", "value", "gen", "triggers", "runQuery", "Filter", "foreignKeys", "Trigger", "source", "id", "trigger", "remove", "Qualifier", "AgentWorker", "promise", "subscription", "subscriptions", "targetOption", "loadOption", "isNone", "target", "feedObj", "instanceOf", "Feed", "feedRef", "feed", "getOrUndefined", "undefined", "queueDxn", "fromNullable", "filter", "map", "getQueueDxn", "filterEvents", "add", "make", "Parent", "Meta", "keys", "dxn", "toString", "enabled", "spec", "specQueue", "function", "Ref", "serialize", "input", "event", "concurrency", "queue", "getDXN", "flush"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TagAdd
|
|
3
|
+
} from "./chunk-IVXBQQDJ.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/blueprints/database/functions/tag-add.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { Database, Entity, Obj } from "@dxos/echo";
|
|
9
|
+
import { Operation } from "@dxos/operation";
|
|
10
|
+
var tag_add_default = TagAdd.pipe(Operation.withHandler(Effect.fn(function* ({ tag, obj }) {
|
|
11
|
+
const object = yield* Database.load(obj);
|
|
12
|
+
const tagObj = yield* Database.load(tag);
|
|
13
|
+
Entity.change(object, (object2) => Entity.addTag(object2, Obj.getDXN(tagObj).toString()));
|
|
14
|
+
return Entity.toJSON(object);
|
|
15
|
+
})));
|
|
16
|
+
export {
|
|
17
|
+
tag_add_default as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=tag-add-OUDUBR3E.mjs.map
|