@dxos/assistant-toolkit 0.8.4-main.ae835ea → 0.8.4-main.bcb3aa67d6
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-OBP4D5RN.mjs +30 -0
- package/dist/lib/neutral/add-artifact-OBP4D5RN.mjs.map +7 -0
- package/dist/lib/neutral/agent-27Z7BESA.mjs +95 -0
- package/dist/lib/neutral/agent-27Z7BESA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2NKPVOXM.mjs +267 -0
- package/dist/lib/neutral/chunk-2NKPVOXM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-3ZUJIEFV.mjs +184 -0
- package/dist/lib/neutral/chunk-3ZUJIEFV.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4QGZEDWS.mjs +140 -0
- package/dist/lib/neutral/chunk-4QGZEDWS.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-6IAJ2JI5.mjs +54 -0
- package/dist/lib/neutral/chunk-6IAJ2JI5.mjs.map +7 -0
- package/dist/lib/neutral/chunk-AGG6OZNB.mjs +74 -0
- package/dist/lib/neutral/chunk-AGG6OZNB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-AKMBURAD.mjs +320 -0
- package/dist/lib/neutral/chunk-AKMBURAD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BO4ZVH7M.mjs +73 -0
- package/dist/lib/neutral/chunk-BO4ZVH7M.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CJUCONUJ.mjs +99 -0
- package/dist/lib/neutral/chunk-CJUCONUJ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GAJ6MKJX.mjs +363 -0
- package/dist/lib/neutral/chunk-GAJ6MKJX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HEFG73F2.mjs +53 -0
- package/dist/lib/neutral/chunk-HEFG73F2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HZM3HNAS.mjs +78 -0
- package/dist/lib/neutral/chunk-HZM3HNAS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ILZ2ODWC.mjs +95 -0
- package/dist/lib/neutral/chunk-ILZ2ODWC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IQNOIB23.mjs +58 -0
- package/dist/lib/neutral/chunk-IQNOIB23.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-KWZG4QBN.mjs +685 -0
- package/dist/lib/neutral/chunk-KWZG4QBN.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-VBSCQN37.mjs +52 -0
- package/dist/lib/neutral/chunk-VBSCQN37.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-YBTLIXQK.mjs +29 -0
- package/dist/lib/neutral/chunk-YBTLIXQK.mjs.map +7 -0
- package/dist/lib/neutral/context-add-U5LSEQLG.mjs +22 -0
- package/dist/lib/neutral/context-add-U5LSEQLG.mjs.map +7 -0
- package/dist/lib/neutral/context-remove-3YGXLVRA.mjs +22 -0
- package/dist/lib/neutral/context-remove-3YGXLVRA.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-YEDZU75J.mjs +34 -0
- package/dist/lib/neutral/create-project-YEDZU75J.mjs.map +7 -0
- package/dist/lib/neutral/delete-LHMZDJFA.mjs +19 -0
- package/dist/lib/neutral/delete-LHMZDJFA.mjs.map +7 -0
- package/dist/lib/neutral/document-create-53ZVNGFR.mjs +57 -0
- package/dist/lib/neutral/document-create-53ZVNGFR.mjs.map +7 -0
- package/dist/lib/neutral/enable-blueprints-Q5NXGX2G.mjs +48 -0
- package/dist/lib/neutral/enable-blueprints-Q5NXGX2G.mjs.map +7 -0
- package/dist/lib/neutral/entity-extraction-CFXRZWZK.mjs +196 -0
- package/dist/lib/neutral/entity-extraction-CFXRZWZK.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-AFX7ZAVE.mjs +154 -0
- package/dist/lib/neutral/fetch-messages-AFX7ZAVE.mjs.map +7 -0
- package/dist/lib/neutral/get-context-MKM4CEGH.mjs +35 -0
- package/dist/lib/neutral/get-context-MKM4CEGH.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +248 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/load-KHLICMGJ.mjs +17 -0
- package/dist/lib/neutral/load-KHLICMGJ.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/{browser/index.mjs → neutral/mock-JSY4GY77.mjs} +28 -1953
- package/dist/lib/neutral/mock-JSY4GY77.mjs.map +7 -0
- package/dist/lib/neutral/object-create-7J7D53FT.mjs +43 -0
- package/dist/lib/neutral/object-create-7J7D53FT.mjs.map +7 -0
- package/dist/lib/neutral/object-delete-QFXUHJ2D.mjs +18 -0
- package/dist/lib/neutral/object-delete-QFXUHJ2D.mjs.map +7 -0
- package/dist/lib/neutral/object-update-C73HRM5F.mjs +28 -0
- package/dist/lib/neutral/object-update-C73HRM5F.mjs.map +7 -0
- package/dist/lib/neutral/project-rules-ZVV4TFOQ.mjs +77 -0
- package/dist/lib/neutral/project-rules-ZVV4TFOQ.mjs.map +7 -0
- package/dist/lib/neutral/prompt-J2XSDAWH.mjs +138 -0
- package/dist/lib/neutral/prompt-J2XSDAWH.mjs.map +7 -0
- package/dist/lib/neutral/qualifier-WRYRVSET.mjs +104 -0
- package/dist/lib/neutral/qualifier-WRYRVSET.mjs.map +7 -0
- package/dist/lib/neutral/query-FUFKLAN2.mjs +66 -0
- package/dist/lib/neutral/query-FUFKLAN2.mjs.map +7 -0
- package/dist/lib/neutral/query-U4LWIBNG.mjs +32 -0
- package/dist/lib/neutral/query-U4LWIBNG.mjs.map +7 -0
- package/dist/lib/neutral/query-blueprints-Y5CXJLCT.mjs +17 -0
- package/dist/lib/neutral/query-blueprints-Y5CXJLCT.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-YWV2TUKS.mjs +42 -0
- package/dist/lib/neutral/relation-create-YWV2TUKS.mjs.map +7 -0
- package/dist/lib/neutral/relation-delete-JGGA4CYQ.mjs +18 -0
- package/dist/lib/neutral/relation-delete-JGGA4CYQ.mjs.map +7 -0
- package/dist/lib/neutral/research-UBK6ZGX7.mjs +109 -0
- package/dist/lib/neutral/research-UBK6ZGX7.mjs.map +7 -0
- package/dist/lib/neutral/save-JZ73KUMA.mjs +23 -0
- package/dist/lib/neutral/save-JZ73KUMA.mjs.map +7 -0
- package/dist/lib/neutral/schema-add-7WKPPKW4.mjs +24 -0
- package/dist/lib/neutral/schema-add-7WKPPKW4.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-MIAIKERK.mjs +30 -0
- package/dist/lib/neutral/schema-list-MIAIKERK.mjs.map +7 -0
- package/dist/lib/neutral/sync-issues-FIRE3XR6.mjs +179 -0
- package/dist/lib/neutral/sync-issues-FIRE3XR6.mjs.map +7 -0
- package/dist/lib/neutral/tag-add-IKD4ADDM.mjs +19 -0
- package/dist/lib/neutral/tag-add-IKD4ADDM.mjs.map +7 -0
- package/dist/lib/neutral/tag-remove-PCSKCFT2.mjs +19 -0
- package/dist/lib/neutral/tag-remove-PCSKCFT2.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-HZ7A3ZA5.mjs +20 -0
- package/dist/lib/neutral/update-HZ7A3ZA5.mjs.map +7 -0
- package/dist/lib/neutral/update-tasks-TZ65WZ44.mjs +46 -0
- package/dist/lib/neutral/update-tasks-TZ65WZ44.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 +59 -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/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 +58 -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 +11 -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 +4 -0
- package/dist/types/src/blueprints/project/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/sync-triggers.d.ts +11 -0
- package/dist/types/src/blueprints/project/sync-triggers.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 +49 -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/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 +18 -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 +24 -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 +16 -4
- 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} +4 -1
- package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
- package/dist/types/src/{functions/research → crud}/graph.d.ts +14 -11
- package/dist/types/src/crud/graph.d.ts.map +1 -0
- package/dist/types/src/crud/graph.test.d.ts.map +1 -0
- package/dist/types/src/crud/index.d.ts +2 -0
- package/dist/types/src/crud/index.d.ts.map +1 -0
- package/dist/types/src/functions/agent/definitions.d.ts +101 -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 +100 -9
- 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 +3 -1
- 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 +2 -0
- package/dist/types/src/toolkits/index.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/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/Project.d.ts +73 -0
- package/dist/types/src/types/Project.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +5 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -38
- package/src/blueprints/automation/blueprint.ts +109 -0
- package/src/blueprints/automation/index.ts +5 -0
- package/src/blueprints/blueprint-manager/blueprint.test.ts +130 -0
- package/src/blueprints/blueprint-manager/blueprint.ts +49 -0
- package/src/blueprints/blueprint-manager/functions/definitions.ts +46 -0
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +44 -0
- package/src/blueprints/blueprint-manager/functions/index.ts +12 -0
- package/src/blueprints/blueprint-manager/functions/query-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 +64 -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 +343 -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 +301 -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 +56 -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 +27 -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/{design-blueprint.test.ts → blueprint.test.ts} +26 -37
- package/src/blueprints/design/{design-blueprint.ts → blueprint.ts} +21 -13
- 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/{functions/discord → blueprints/discord/functions}/fetch-messages.test.ts +11 -14
- 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 +60 -0
- package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +44 -50
- 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} +26 -33
- package/src/blueprints/{planning/planning-blueprint.ts → planning-old/blueprint.ts} +21 -13
- 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 +587 -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 +75 -0
- package/src/blueprints/project/functions/definitions.ts +91 -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 +7 -0
- package/src/blueprints/project/sync-triggers.ts +149 -0
- package/src/blueprints/project-wizard/blueprint.ts +43 -0
- package/src/blueprints/project-wizard/functions/create-project.ts +33 -0
- package/src/blueprints/project-wizard/functions/definitions.ts +48 -0
- package/src/blueprints/project-wizard/functions/index.ts +12 -0
- package/src/blueprints/project-wizard/functions/project-rules.ts +76 -0
- package/src/blueprints/project-wizard/index.ts +6 -0
- package/src/blueprints/research/blueprint.ts +61 -0
- 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/instructions-research.tpl → blueprints/research/functions/research-instructions.tpl} +19 -11
- package/src/blueprints/research/functions/research.conversations.json +1 -0
- package/src/blueprints/research/functions/research.test.ts +152 -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 +62 -0
- package/src/blueprints/research/types/index.ts +32 -0
- package/src/blueprints/testing.ts +34 -5
- 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} +4 -0
- package/src/crud/graph.test.ts +46 -0
- package/src/{functions/research → crud}/graph.ts +32 -40
- package/src/crud/index.ts +5 -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.test.ts +144 -0
- package/src/functions/agent/prompt.ts +120 -85
- package/src/functions/entity-extraction/definitions.ts +44 -0
- package/src/functions/entity-extraction/entity-extraction.conversations.json +1 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +19 -43
- package/src/functions/entity-extraction/entity-extraction.ts +84 -88
- 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 +3 -1
- 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 +5 -0
- package/src/types/Chat.ts +62 -0
- package/src/types/Memory.ts +23 -0
- package/src/types/Plan.ts +110 -0
- package/src/types/Project.ts +208 -0
- package/src/types/index.ts +8 -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 -2483
- 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 -12
- 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/create-document.d.ts +0 -7
- package/dist/types/src/functions/research/create-document.d.ts.map +0 -1
- package/dist/types/src/functions/research/graph.d.ts.map +0 -1
- package/dist/types/src/functions/research/graph.test.d.ts.map +0 -1
- package/dist/types/src/functions/research/index.d.ts +0 -19
- 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 -13
- 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 -384
- 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/src/blueprints/discord/discord-blueprint.ts +0 -34
- package/src/blueprints/linear/linear-blueprint.ts +0 -35
- package/src/blueprints/research/research-blueprint.ts +0 -45
- package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
- package/src/experimental/feed.test.ts +0 -108
- package/src/functions/discord/fetch-messages.ts +0 -251
- package/src/functions/discord/index.ts +0 -9
- package/src/functions/document/index.ts +0 -11
- 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 -86
- package/src/functions/research/create-document.ts +0 -69
- package/src/functions/research/graph.test.ts +0 -69
- package/src/functions/research/index.ts +0 -15
- package/src/functions/research/research-graph.ts +0 -47
- package/src/functions/research/research.conversations.json +0 -10714
- package/src/functions/research/research.test.ts +0 -240
- package/src/functions/research/research.ts +0 -155
- package/src/functions/research/types.ts +0 -24
- 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/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/{functions/research → crud}/graph.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
|
@@ -4,61 +4,37 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, expect, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
|
-
import * as Layer from 'effect/Layer';
|
|
8
7
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
8
|
+
import { MemoizedAiService } from '@dxos/ai/testing';
|
|
9
|
+
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
12
10
|
import { Blueprint } from '@dxos/blueprints';
|
|
13
11
|
import { Obj } from '@dxos/echo';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
FunctionInvocationService,
|
|
20
|
-
TracingService,
|
|
21
|
-
} from '@dxos/functions';
|
|
22
|
-
import { TestDatabaseLayer } from '@dxos/functions/testing';
|
|
23
|
-
import { ObjectId, PublicKey } from '@dxos/keys';
|
|
24
|
-
import { DataType } from '@dxos/schema';
|
|
12
|
+
import { Database } from '@dxos/echo';
|
|
13
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
14
|
+
import { FunctionInvocationService } from '@dxos/functions';
|
|
15
|
+
import { ObjectId } from '@dxos/keys';
|
|
16
|
+
import { Message, Organization, Person } from '@dxos/types';
|
|
25
17
|
|
|
26
|
-
import {
|
|
27
|
-
|
|
18
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
19
|
+
|
|
20
|
+
import { ResearchGraph } from '../../blueprints';
|
|
28
21
|
|
|
29
22
|
import { default as entityExtraction } from './entity-extraction';
|
|
30
23
|
|
|
31
24
|
ObjectId.dangerouslyDisableRandomness();
|
|
32
25
|
|
|
33
|
-
const TestLayer =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ComputeEventLogger.layerFromTracing,
|
|
38
|
-
).pipe(
|
|
39
|
-
Layer.provideMerge(FunctionInvocationService.layerTest({ functions: [entityExtraction] })),
|
|
40
|
-
Layer.provideMerge(
|
|
41
|
-
Layer.mergeAll(
|
|
42
|
-
MemoizedAiService.layerTest().pipe(Layer.provide(AiServiceTestingPreset('direct'))),
|
|
43
|
-
TestDatabaseLayer({
|
|
44
|
-
// TODO(dmaretskyi): define the constant space key in the test-builder.
|
|
45
|
-
spaceKey: PublicKey.from('665c420e0dec9aa36c2bedca567afb0778701920e346eaf83ab2bd3403859723'),
|
|
46
|
-
indexing: { vector: true },
|
|
47
|
-
types: [Blueprint.Blueprint, DataType.Message, DataType.Person, DataType.Organization, ResearchGraph],
|
|
48
|
-
}),
|
|
49
|
-
CredentialsService.configuredLayer([]),
|
|
50
|
-
TracingService.layerNoop,
|
|
51
|
-
),
|
|
52
|
-
),
|
|
53
|
-
);
|
|
26
|
+
const TestLayer = AssistantTestLayer({
|
|
27
|
+
operationHandlers: OperationHandlerSet.make(entityExtraction),
|
|
28
|
+
types: [Blueprint.Blueprint, Message.Message, Person.Person, Organization.Organization, ResearchGraph.ResearchGraph],
|
|
29
|
+
});
|
|
54
30
|
|
|
55
|
-
describe
|
|
31
|
+
describe('Entity extraction', () => {
|
|
56
32
|
it.effect(
|
|
57
|
-
'
|
|
33
|
+
'calls a function to generate a research report',
|
|
58
34
|
Effect.fnUntraced(
|
|
59
35
|
function* (_) {
|
|
60
|
-
const email = yield*
|
|
61
|
-
Obj.make(
|
|
36
|
+
const email = yield* Database.add(
|
|
37
|
+
Obj.make(Message.Message, {
|
|
62
38
|
[Obj.Meta]: {
|
|
63
39
|
tags: ['important'],
|
|
64
40
|
},
|
|
@@ -83,7 +59,7 @@ describe.skip('Entity extraction', () => {
|
|
|
83
59
|
],
|
|
84
60
|
}),
|
|
85
61
|
);
|
|
86
|
-
yield*
|
|
62
|
+
yield* Database.flush();
|
|
87
63
|
const result = yield* FunctionInvocationService.invokeFunction(entityExtraction, {
|
|
88
64
|
source: email,
|
|
89
65
|
});
|
|
@@ -2,105 +2,96 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
5
|
import * as Effect from 'effect/Effect';
|
|
7
6
|
import * as Layer from 'effect/Layer';
|
|
8
7
|
import * as Predicate from 'effect/Predicate';
|
|
9
|
-
import * as Schema from 'effect/Schema';
|
|
10
8
|
|
|
11
9
|
import { AiService } from '@dxos/ai';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { GenericToolkit } from '@dxos/ai';
|
|
11
|
+
import { AiSession, ToolExecutionServices } from '@dxos/assistant';
|
|
12
|
+
import { Database, Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
+
import { FunctionInvocationService } from '@dxos/functions';
|
|
15
14
|
import { type DXN } from '@dxos/keys';
|
|
16
15
|
import { log } from '@dxos/log';
|
|
17
|
-
import {
|
|
16
|
+
import { Operation } from '@dxos/operation';
|
|
17
|
+
import { type Actor, LegacyOrganization, Organization, Person } from '@dxos/types';
|
|
18
18
|
import { trim } from '@dxos/util';
|
|
19
19
|
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
organization = yield* DatabaseService.resolve(created[0], DataType.Organization);
|
|
68
|
-
Obj.getMeta(organization).tags ??= [];
|
|
69
|
-
Obj.getMeta(organization).tags!.push(...(Obj.getMeta(source)?.tags ?? []));
|
|
70
|
-
contact.organization = Ref.make(organization);
|
|
20
|
+
import { EntityExtraction } from './definitions';
|
|
21
|
+
import { ResearchGraph } from '../../blueprints';
|
|
22
|
+
import { makeGraphWriterHandler, makeGraphWriterToolkit } from '../../crud';
|
|
23
|
+
|
|
24
|
+
export default EntityExtraction.pipe(
|
|
25
|
+
Operation.withHandler(
|
|
26
|
+
Effect.fnUntraced(
|
|
27
|
+
function* ({ source: message, instructions }) {
|
|
28
|
+
const tags = Obj.getMeta(message)?.tags;
|
|
29
|
+
const contact = yield* extractContact(message.sender, tags);
|
|
30
|
+
let organization: Organization.Organization | null = null;
|
|
31
|
+
|
|
32
|
+
if (contact && !contact.organization) {
|
|
33
|
+
const created: DXN[] = [];
|
|
34
|
+
const GraphWriterToolkit = makeGraphWriterToolkit({
|
|
35
|
+
schema: [LegacyOrganization],
|
|
36
|
+
}).pipe();
|
|
37
|
+
const GraphWriterHandler = makeGraphWriterHandler(GraphWriterToolkit, {
|
|
38
|
+
onAppend: (dxns) => created.push(...dxns),
|
|
39
|
+
});
|
|
40
|
+
const toolkit = yield* GraphWriterToolkit.pipe(
|
|
41
|
+
Effect.provide(GraphWriterHandler.pipe(Layer.provide(ResearchGraph.contextQueueLayer))),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
yield* new AiSession().run({
|
|
45
|
+
system: trim`
|
|
46
|
+
Extract the sender's organization from the email. If you are not sure, do nothing.
|
|
47
|
+
The extracted organization URL must match the sender's email domain.
|
|
48
|
+
${instructions ? '<user_intructions>' + instructions + '</user_intructions>' : ''},
|
|
49
|
+
`,
|
|
50
|
+
prompt: JSON.stringify({ source: message, contact }),
|
|
51
|
+
toolkit,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (created.length > 1) {
|
|
55
|
+
throw new Error('Multiple organizations created');
|
|
56
|
+
} else if (created.length === 1) {
|
|
57
|
+
organization = yield* Database.resolve(created[0], Organization.Organization);
|
|
58
|
+
Obj.change(organization, (org) => {
|
|
59
|
+
const meta = Obj.getMeta(org);
|
|
60
|
+
meta.tags ??= [];
|
|
61
|
+
meta.tags.push(...(tags ?? []));
|
|
62
|
+
});
|
|
63
|
+
Obj.change(contact, (obj) => {
|
|
64
|
+
obj.organization = Ref.make(organization!);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
71
67
|
}
|
|
72
|
-
}
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Layer.provide(
|
|
85
|
-
// TODO(dmaretskyi): This should be provided by environment.
|
|
86
|
-
Layer.mergeAll(FunctionInvocationService.layerTest()),
|
|
87
|
-
),
|
|
69
|
+
return {
|
|
70
|
+
entities: [contact, organization].filter(Predicate.isNotNullable),
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
Effect.provide(
|
|
74
|
+
Layer.mergeAll(
|
|
75
|
+
AiService.model('@anthropic/claude-sonnet-4-0'), // TODO(dmaretskyi): Extract.
|
|
76
|
+
ToolExecutionServices,
|
|
77
|
+
FunctionInvocationService.layerNotAvailable,
|
|
78
|
+
).pipe(Layer.provide(GenericToolkit.providerEmpty)),
|
|
88
79
|
),
|
|
89
80
|
),
|
|
90
81
|
),
|
|
91
|
-
|
|
82
|
+
Operation.opaqueHandler,
|
|
83
|
+
);
|
|
92
84
|
|
|
93
|
-
const extractContact = Effect.fn('extractContact')(function* (
|
|
94
|
-
const name =
|
|
95
|
-
const email =
|
|
85
|
+
const extractContact = Effect.fn('extractContact')(function* (actor: Actor.Actor, tags?: readonly string[]) {
|
|
86
|
+
const name = actor.name;
|
|
87
|
+
const email = actor.email;
|
|
96
88
|
if (!email) {
|
|
97
|
-
log.warn('email is required for contact extraction', {
|
|
89
|
+
log.warn('email is required for contact extraction', { actor });
|
|
98
90
|
return undefined;
|
|
99
91
|
}
|
|
100
92
|
|
|
101
|
-
const
|
|
93
|
+
const existingContacts = yield* Database.runQuery(Filter.type(Person.Person));
|
|
102
94
|
|
|
103
|
-
// Check for existing contact
|
|
104
95
|
// TODO(dmaretskyi): Query filter DSL - https://linear.app/dxos/issue/DX-541/filtercontains-should-work-with-partial-objects
|
|
105
96
|
const existingContact = existingContacts.find((contact) =>
|
|
106
97
|
contact.emails?.some((contactEmail) => contactEmail.value === email),
|
|
@@ -111,16 +102,16 @@ const extractContact = Effect.fn('extractContact')(function* (message: DataType.
|
|
|
111
102
|
return existingContact;
|
|
112
103
|
}
|
|
113
104
|
|
|
114
|
-
const newContact = Obj.make(
|
|
115
|
-
[Obj.Meta]: {
|
|
116
|
-
tags: Obj.getMeta(message)?.tags,
|
|
117
|
-
},
|
|
105
|
+
const newContact = Obj.make(Person.Person, {
|
|
106
|
+
...(tags ? { [Obj.Meta]: { tags: [...tags] } } : {}),
|
|
118
107
|
emails: [{ value: email }],
|
|
119
108
|
});
|
|
120
|
-
yield*
|
|
109
|
+
yield* Database.add(newContact);
|
|
121
110
|
|
|
122
111
|
if (name) {
|
|
123
|
-
newContact
|
|
112
|
+
Obj.change(newContact, (obj) => {
|
|
113
|
+
obj.fullName = name;
|
|
114
|
+
});
|
|
124
115
|
}
|
|
125
116
|
|
|
126
117
|
const emailDomain = email.split('@')[1]?.toLowerCase();
|
|
@@ -131,7 +122,7 @@ const extractContact = Effect.fn('extractContact')(function* (message: DataType.
|
|
|
131
122
|
|
|
132
123
|
log.info('extracted email domain', { emailDomain });
|
|
133
124
|
|
|
134
|
-
const
|
|
125
|
+
const existingOrganisations = yield* Database.runQuery(Filter.type(Organization.Organization));
|
|
135
126
|
const matchingOrg = existingOrganisations.find((org) => {
|
|
136
127
|
if (org.website) {
|
|
137
128
|
try {
|
|
@@ -147,7 +138,10 @@ const extractContact = Effect.fn('extractContact')(function* (message: DataType.
|
|
|
147
138
|
emailDomain.endsWith(`.${websiteDomain}`)
|
|
148
139
|
);
|
|
149
140
|
} catch (e) {
|
|
150
|
-
log.warn('Error parsing website URL', {
|
|
141
|
+
log.warn('Error parsing website URL', {
|
|
142
|
+
website: org.website,
|
|
143
|
+
error: e,
|
|
144
|
+
});
|
|
151
145
|
return false;
|
|
152
146
|
}
|
|
153
147
|
}
|
|
@@ -156,7 +150,9 @@ const extractContact = Effect.fn('extractContact')(function* (message: DataType.
|
|
|
156
150
|
|
|
157
151
|
if (matchingOrg) {
|
|
158
152
|
log.info('found matching organization', { organization: matchingOrg });
|
|
159
|
-
newContact
|
|
153
|
+
Obj.change(newContact, (obj) => {
|
|
154
|
+
obj.organization = Ref.make(matchingOrg);
|
|
155
|
+
});
|
|
160
156
|
}
|
|
161
157
|
|
|
162
158
|
return newContact;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export * from './definitions';
|
|
8
|
+
|
|
9
|
+
export const EntityExtractionHandlers = OperationHandlerSet.lazy(() => import('./entity-extraction'));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { CredentialsService } from '@dxos/functions';
|
|
8
|
+
import { Operation } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
export const ExaSearch = Operation.make({
|
|
11
|
+
meta: {
|
|
12
|
+
key: 'org.dxos.function.exa-search',
|
|
13
|
+
name: 'Exa Search',
|
|
14
|
+
description: 'Search the web for information',
|
|
15
|
+
},
|
|
16
|
+
input: Schema.Struct({
|
|
17
|
+
query: Schema.String.annotations({
|
|
18
|
+
description: 'The query to search for.',
|
|
19
|
+
}),
|
|
20
|
+
}),
|
|
21
|
+
output: Schema.Unknown,
|
|
22
|
+
services: [CredentialsService],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const ExaMock = Operation.make({
|
|
26
|
+
meta: {
|
|
27
|
+
key: 'org.dxos.function.exa-mock',
|
|
28
|
+
name: 'Exa mock',
|
|
29
|
+
description: 'Search the web for information',
|
|
30
|
+
},
|
|
31
|
+
input: Schema.Struct({
|
|
32
|
+
query: Schema.String.annotations({
|
|
33
|
+
description: 'The query to search for.',
|
|
34
|
+
}),
|
|
35
|
+
}),
|
|
36
|
+
output: Schema.Unknown,
|
|
37
|
+
});
|
package/src/functions/exa/exa.ts
CHANGED
|
@@ -3,35 +3,30 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
6
|
import Exa from 'exa-js';
|
|
8
7
|
|
|
9
|
-
import { CredentialsService
|
|
8
|
+
import { CredentialsService } from '@dxos/functions';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
}),
|
|
20
|
-
outputSchema: Schema.Unknown,
|
|
21
|
-
handler: Effect.fnUntraced(function* ({ data: { query } }) {
|
|
22
|
-
const credential = yield* CredentialsService.getCredential({ service: 'exa.ai' });
|
|
23
|
-
const exa = new Exa(credential.apiKey);
|
|
11
|
+
import { ExaSearch } from './definitions';
|
|
12
|
+
|
|
13
|
+
export default ExaSearch.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* ({ query }) {
|
|
16
|
+
const credential = yield* CredentialsService.getCredential({ service: 'exa.ai' });
|
|
17
|
+
const exa = new Exa(credential.apiKey);
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
const context = yield* Effect.promise(async () =>
|
|
20
|
+
exa.searchAndContents(query, {
|
|
21
|
+
type: 'auto',
|
|
22
|
+
text: {
|
|
23
|
+
maxCharacters: 3_000,
|
|
24
|
+
},
|
|
25
|
+
livecrawl: 'always',
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
return context;
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
);
|
|
@@ -2,5 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
6
|
+
|
|
7
|
+
export * from './definitions';
|
|
8
|
+
|
|
9
|
+
export const ExaHandlers = OperationHandlerSet.lazy(
|
|
10
|
+
() => import('./exa'),
|
|
11
|
+
() => import('./mock'),
|
|
12
|
+
);
|
|
@@ -3,48 +3,39 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { Operation } from '@dxos/operation';
|
|
9
8
|
|
|
10
|
-
import {
|
|
9
|
+
import { ExaMock } from './definitions';
|
|
10
|
+
import { SEARCH_RESULTS } from './data';
|
|
11
11
|
|
|
12
|
-
export default
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const result = SEARCH_RESULTS.reduce(
|
|
24
|
-
(closest, current) => {
|
|
25
|
-
if (!current.autopromptString) {
|
|
26
|
-
return closest;
|
|
27
|
-
}
|
|
28
|
-
if (!closest) {
|
|
29
|
-
return current;
|
|
30
|
-
}
|
|
12
|
+
export default ExaMock.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fnUntraced(function* ({ query }) {
|
|
15
|
+
const result = SEARCH_RESULTS.reduce(
|
|
16
|
+
(closest, current) => {
|
|
17
|
+
if (!current.autopromptString) {
|
|
18
|
+
return closest;
|
|
19
|
+
}
|
|
20
|
+
if (!closest) {
|
|
21
|
+
return current;
|
|
22
|
+
}
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const dist2 = levenshteinDistance(query, closest.autopromptString || '');
|
|
24
|
+
const dist1 = levenshteinDistance(query, current.autopromptString);
|
|
25
|
+
const dist2 = levenshteinDistance(query, closest.autopromptString || '');
|
|
35
26
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const weight2 = dist2 / Math.max(query.length, closest.autopromptString?.length || 0);
|
|
27
|
+
const weight1 = dist1 / Math.max(query.length, current.autopromptString.length);
|
|
28
|
+
const weight2 = dist2 / Math.max(query.length, closest.autopromptString?.length || 0);
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
return weight1 < weight2 ? current : closest;
|
|
31
|
+
},
|
|
32
|
+
null as (typeof SEARCH_RESULTS)[0] | null,
|
|
33
|
+
);
|
|
44
34
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
return result;
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
);
|
|
48
39
|
|
|
49
40
|
const levenshteinDistance = (str1: string, str2: string): number => {
|
|
50
41
|
const m = str1.length;
|
package/src/functions/index.ts
CHANGED
package/src/index.ts
CHANGED
package/src/sync/sync.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { Database } from '@dxos/echo';
|
|
9
9
|
import { failedInvariant } from '@dxos/invariant';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
|
|
@@ -18,9 +18,12 @@ import { log } from '@dxos/log';
|
|
|
18
18
|
* @param opts.foreignKeyId - The key to use for matching objects.
|
|
19
19
|
*/
|
|
20
20
|
export const syncObjects: (
|
|
21
|
-
objs: Obj.
|
|
21
|
+
objs: Obj.Unknown[],
|
|
22
22
|
opts: { foreignKeyId: string },
|
|
23
|
-
) => Effect.Effect<Obj.
|
|
23
|
+
) => Effect.Effect<Obj.Unknown[], never, Database.Service> = Effect.fn('syncObjects')(function* (
|
|
24
|
+
objs,
|
|
25
|
+
{ foreignKeyId },
|
|
26
|
+
) {
|
|
24
27
|
return yield* Effect.forEach(
|
|
25
28
|
objs,
|
|
26
29
|
Effect.fnUntraced(function* (obj) {
|
|
@@ -28,7 +31,7 @@ export const syncObjects: (
|
|
|
28
31
|
for (const key of Object.keys(obj)) {
|
|
29
32
|
if (typeof key !== 'string' || key === 'id') continue;
|
|
30
33
|
if (!Ref.isRef((obj as any)[key])) continue;
|
|
31
|
-
const ref: Ref.
|
|
34
|
+
const ref: Ref.Unknown = (obj as any)[key];
|
|
32
35
|
if (!ref.target) continue;
|
|
33
36
|
if (Obj.getDXN(ref.target).isLocalObjectId()) {
|
|
34
37
|
// obj not persisted to db.
|
|
@@ -39,9 +42,7 @@ export const syncObjects: (
|
|
|
39
42
|
|
|
40
43
|
const schema = Obj.getSchema(obj) ?? failedInvariant('No schema.');
|
|
41
44
|
const foreignId = Obj.getKeys(obj, foreignKeyId)[0]?.id ?? failedInvariant('No foreign key.');
|
|
42
|
-
const
|
|
43
|
-
objects: [existing],
|
|
44
|
-
} = yield* DatabaseService.runQuery(
|
|
45
|
+
const [existing] = yield* Database.runQuery(
|
|
45
46
|
Query.select(Filter.foreignKeys(schema, [{ source: foreignKeyId, id: foreignId }])),
|
|
46
47
|
);
|
|
47
48
|
log('sync object', {
|
|
@@ -50,7 +51,7 @@ export const syncObjects: (
|
|
|
50
51
|
existing: existing ? Obj.getDXN(existing) : undefined,
|
|
51
52
|
});
|
|
52
53
|
if (!existing) {
|
|
53
|
-
yield*
|
|
54
|
+
yield* Database.add(obj);
|
|
54
55
|
return obj;
|
|
55
56
|
} else {
|
|
56
57
|
copyObjectData(existing, obj);
|
|
@@ -61,27 +62,34 @@ export const syncObjects: (
|
|
|
61
62
|
);
|
|
62
63
|
});
|
|
63
64
|
|
|
64
|
-
const copyObjectData = (existing: Obj.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (typeof key !== 'string' || key === 'id') continue;
|
|
78
|
-
if (!(key in newObj)) {
|
|
79
|
-
delete (existing as any)[key];
|
|
65
|
+
const copyObjectData = (existing: Obj.Unknown, newObj: Obj.Unknown) => {
|
|
66
|
+
Obj.change(existing, (obj) => {
|
|
67
|
+
// Copy properties from newObj to existing.
|
|
68
|
+
for (const key of Object.keys(newObj)) {
|
|
69
|
+
if (typeof key !== 'string' || key === 'id') continue;
|
|
70
|
+
if (
|
|
71
|
+
typeof (newObj as any)[key] !== 'string' &&
|
|
72
|
+
typeof (newObj as any)[key] !== 'number' &&
|
|
73
|
+
typeof (newObj as any)[key] !== 'boolean' &&
|
|
74
|
+
!Ref.isRef((newObj as any)[key])
|
|
75
|
+
)
|
|
76
|
+
continue;
|
|
77
|
+
(obj as any)[key] = (newObj as any)[key];
|
|
80
78
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
|
|
80
|
+
// Delete properties that don't exist in newObj.
|
|
81
|
+
for (const key of Object.keys(obj)) {
|
|
82
|
+
if (typeof key !== 'string' || key === 'id') continue;
|
|
83
|
+
if (!(key in newObj)) {
|
|
84
|
+
delete (obj as any)[key];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Update foreign keys.
|
|
89
|
+
for (const foreignKey of Obj.getMeta(newObj).keys) {
|
|
90
|
+
Obj.deleteKeys(obj, foreignKey.source);
|
|
91
|
+
// TODO(dmaretskyi): Doesn't work: `Obj.getMeta(existing).keys.push(foreignKey);`
|
|
92
|
+
Obj.getMeta(obj).keys.push({ ...foreignKey });
|
|
93
|
+
}
|
|
94
|
+
});
|
|
87
95
|
};
|