@dxos/assistant-toolkit 0.8.4-main.dfabb4ec29 → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/dist/lib/neutral/{add-artifact-ZUJ5DMSY.mjs → add-artifact-ZKSSMPLY.mjs} +6 -6
- package/dist/lib/neutral/{add-artifact-ZUJ5DMSY.mjs.map → add-artifact-ZKSSMPLY.mjs.map} +3 -3
- package/dist/lib/neutral/{agent-5NIKAYUK.mjs → agent-UIASE5LZ.mjs} +7 -7
- package/dist/lib/neutral/{agent-5NIKAYUK.mjs.map → agent-UIASE5LZ.mjs.map} +2 -2
- package/dist/lib/neutral/chunk-AF5TWFLV.mjs +66 -0
- package/dist/lib/neutral/chunk-AF5TWFLV.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-P4ZMYO4K.mjs → chunk-CMHECL6N.mjs} +21 -33
- package/dist/lib/neutral/chunk-CMHECL6N.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ZFXLTBZG.mjs → chunk-DC5KITJP.mjs} +3 -2
- package/dist/lib/neutral/chunk-DC5KITJP.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-WLR3BGO4.mjs → chunk-EUHZLWCG.mjs} +2 -1
- package/dist/lib/neutral/chunk-EUHZLWCG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-IKBIORQX.mjs → chunk-EUTROPCP.mjs} +22 -9
- package/dist/lib/neutral/chunk-EUTROPCP.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-GV66MKAQ.mjs → chunk-FNN6ERC6.mjs} +4 -3
- package/dist/lib/neutral/chunk-FNN6ERC6.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-246ACKSH.mjs → chunk-GEMRKH7J.mjs} +15 -12
- package/dist/lib/neutral/chunk-GEMRKH7J.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-EJAQUAKM.mjs → chunk-GHGJCH73.mjs} +8 -5
- package/dist/lib/neutral/chunk-GHGJCH73.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-KGU725LW.mjs → chunk-LO2S3ICN.mjs} +4 -7
- package/dist/lib/neutral/chunk-LO2S3ICN.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-TO5IX24K.mjs → chunk-MMIERIDT.mjs} +12 -9
- package/dist/lib/neutral/chunk-MMIERIDT.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-NR3GTWRC.mjs → chunk-OC77MYT5.mjs} +8 -13
- package/dist/lib/neutral/chunk-OC77MYT5.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ROMZO4CB.mjs → chunk-ONQXVECY.mjs} +11 -9
- package/dist/lib/neutral/chunk-ONQXVECY.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-QO5SU37C.mjs → chunk-PAEPER4S.mjs} +3 -3
- package/dist/lib/neutral/{chunk-XUF53B6B.mjs → chunk-RIF2TKJJ.mjs} +10 -9
- package/dist/lib/neutral/chunk-RIF2TKJJ.mjs.map +7 -0
- package/dist/lib/neutral/{context-add-VB7AOY3G.mjs → context-add-VNJUVPSY.mjs} +4 -4
- package/dist/lib/neutral/context-add-VNJUVPSY.mjs.map +7 -0
- package/dist/lib/neutral/{context-remove-VCM3VPSO.mjs → context-remove-ZASL7ABZ.mjs} +4 -4
- package/dist/lib/neutral/context-remove-ZASL7ABZ.mjs.map +7 -0
- package/dist/lib/neutral/{create-project-EIF4OJMY.mjs → create-project-VNC2KKBG.mjs} +7 -7
- package/dist/lib/neutral/{delete-J3PMWP7Z.mjs → delete-NLBJMMBJ.mjs} +3 -3
- package/dist/lib/neutral/{enable-blueprints-LBDZH2CY.mjs → enable-blueprints-SMGQ2WCU.mjs} +4 -4
- package/dist/lib/neutral/enable-blueprints-SMGQ2WCU.mjs.map +7 -0
- package/dist/lib/neutral/{fetch-KHMHV7JR.mjs → fetch-VV3DU75K.mjs} +2 -2
- package/dist/lib/neutral/{fetch-messages-QOBBCTGC.mjs → fetch-messages-YXH77S3S.mjs} +2 -2
- package/dist/lib/neutral/{get-context-TN7X7U2H.mjs → get-context-LG2CNVII.mjs} +7 -7
- package/dist/lib/neutral/{get-context-TN7X7U2H.mjs.map → get-context-LG2CNVII.mjs.map} +3 -3
- package/dist/lib/neutral/index.mjs +84 -85
- package/dist/lib/neutral/index.mjs.map +3 -3
- package/dist/lib/neutral/{load-ALP3TK2E.mjs → load-K7HEJA54.mjs} +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{object-create-Z57Y3X6Y.mjs → object-create-EN6PJN3L.mjs} +4 -4
- package/dist/lib/neutral/{object-create-Z57Y3X6Y.mjs.map → object-create-EN6PJN3L.mjs.map} +2 -2
- package/dist/lib/neutral/{object-delete-X53LS37B.mjs → object-delete-RMA5ZKGY.mjs} +2 -2
- package/dist/lib/neutral/{object-update-GVKSBR7T.mjs → object-update-JW5PLR2T.mjs} +3 -3
- package/dist/lib/neutral/{object-update-GVKSBR7T.mjs.map → object-update-JW5PLR2T.mjs.map} +2 -2
- package/dist/lib/neutral/{project-HPHTZ2CI.mjs → project-OGO5ABSZ.mjs} +6 -6
- package/dist/lib/neutral/{project-rules-IVDHKSKI.mjs → project-rules-IVA3DSOW.mjs} +5 -5
- package/dist/lib/neutral/{prompt-Y7NN7M5D.mjs → prompt-YVFNLD7U.mjs} +5 -5
- package/dist/lib/neutral/{prompt-Y7NN7M5D.mjs.map → prompt-YVFNLD7U.mjs.map} +3 -3
- package/dist/lib/neutral/{qualifier-VDOY5CWU.mjs → qualifier-UTPO5E3S.mjs} +15 -14
- package/dist/lib/neutral/qualifier-UTPO5E3S.mjs.map +7 -0
- package/dist/lib/neutral/{query-PPJU5622.mjs → query-3FK3ED6L.mjs} +4 -5
- package/dist/lib/neutral/query-3FK3ED6L.mjs.map +7 -0
- package/dist/lib/neutral/{query-U56GNEV6.mjs → query-GXZT4KUX.mjs} +3 -3
- package/dist/lib/neutral/{query-blueprints-KXADGHSA.mjs → query-blueprints-GA2JM54N.mjs} +2 -2
- package/dist/lib/neutral/{relation-create-XJ2IX6X3.mjs → relation-create-XOFKYPL2.mjs} +3 -3
- package/dist/lib/neutral/{relation-create-XJ2IX6X3.mjs.map → relation-create-XOFKYPL2.mjs.map} +3 -3
- package/dist/lib/neutral/{relation-delete-EP4KXAFL.mjs → relation-delete-MVJKKVEQ.mjs} +2 -2
- package/dist/lib/neutral/{save-GWAPLT3Z.mjs → save-TFQMJKG7.mjs} +3 -3
- package/dist/lib/neutral/{schema-add-Z5CY6P24.mjs → schema-add-I7BFBU55.mjs} +2 -2
- package/dist/lib/neutral/schema-list-TYGGAO2P.mjs +49 -0
- package/dist/lib/neutral/schema-list-TYGGAO2P.mjs.map +7 -0
- package/dist/lib/neutral/{sync-issues-4YE5XAK5.mjs → sync-issues-3U3EL6KO.mjs} +5 -6
- package/dist/lib/neutral/sync-issues-3U3EL6KO.mjs.map +7 -0
- package/dist/lib/neutral/{sync-triggers-CDMJVW6E.mjs → sync-triggers-M6U6RAKN.mjs} +39 -37
- package/dist/lib/neutral/sync-triggers-M6U6RAKN.mjs.map +7 -0
- package/dist/lib/neutral/{tag-add-VNIIOVJA.mjs → tag-add-RCE2QULJ.mjs} +3 -3
- package/dist/lib/neutral/{tag-add-VNIIOVJA.mjs.map → tag-add-RCE2QULJ.mjs.map} +3 -3
- package/dist/lib/neutral/{tag-remove-6R2R27W3.mjs → tag-remove-EPKB5CDE.mjs} +3 -3
- package/dist/lib/neutral/{tag-remove-6R2R27W3.mjs.map → tag-remove-EPKB5CDE.mjs.map} +3 -3
- package/dist/lib/neutral/testing/index.mjs +7 -10
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- package/dist/lib/neutral/{update-blueprints-N2AK2VUR.mjs → update-blueprints-VOGJKSMQ.mjs} +2 -2
- package/dist/lib/neutral/update-tasks-PNNNCPWH.mjs +13 -0
- package/dist/lib/neutral/update-tasks-PNNNCPWH.mjs.map +7 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts +10 -12
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts +6 -7
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +4 -5
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/definitions.d.ts +17 -17
- package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/load.d.ts +2 -2
- package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts +1 -1
- package/dist/types/src/blueprints/database/functions/object-update.d.ts +2 -2
- package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/query.d.ts +2 -3
- package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +1 -1
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -1
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts +2 -2
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/memory/functions/delete.d.ts +2 -2
- package/dist/types/src/blueprints/planning/functions/index.d.ts +1 -1
- package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +14 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.test.d.ts +2 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +1 -5
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/definitions.d.ts +60 -45
- package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/get-context.d.ts +1 -12
- package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +3 -71
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -1
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +22 -18
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +43 -36
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts +21 -17
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts.map +1 -1
- package/dist/types/src/blueprints/testing.d.ts +4 -4
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/crud/graph.d.ts +8 -11
- package/dist/types/src/crud/graph.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +3 -3
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/functions/agent/definitions.d.ts +12 -13
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -1
- package/dist/types/src/sync/sync.d.ts +1 -2
- package/dist/types/src/sync/sync.d.ts.map +1 -1
- package/dist/types/src/testing/plugins.d.ts +1 -1
- package/dist/types/src/testing/plugins.d.ts.map +1 -1
- package/dist/types/src/types/Agent.d.ts +23 -22
- package/dist/types/src/types/Agent.d.ts.map +1 -1
- package/dist/types/src/types/Chat.d.ts +17 -20
- package/dist/types/src/types/Chat.d.ts.map +1 -1
- package/dist/types/src/types/McpServer.d.ts +1 -2
- package/dist/types/src/types/McpServer.d.ts.map +1 -1
- package/dist/types/src/types/Memory.d.ts +1 -2
- package/dist/types/src/types/Memory.d.ts.map +1 -1
- package/dist/types/src/types/Plan.d.ts +14 -16
- package/dist/types/src/types/Plan.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -26
- package/src/blueprints/automation/blueprint.ts +3 -3
- package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -1
- package/src/blueprints/blueprint-manager/blueprint.test.ts +23 -19
- package/src/blueprints/blueprint-manager/functions/definitions.ts +8 -5
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +2 -2
- package/src/blueprints/database/blueprint.conversations.json +1 -1
- package/src/blueprints/database/blueprint.test.ts +15 -15
- package/src/blueprints/database/functions/context-add.ts +2 -2
- package/src/blueprints/database/functions/context-remove.ts +2 -2
- package/src/blueprints/database/functions/definitions.ts +19 -6
- package/src/blueprints/database/functions/object-create.ts +2 -2
- package/src/blueprints/database/functions/object-update.ts +1 -1
- package/src/blueprints/database/functions/query.ts +3 -4
- package/src/blueprints/database/functions/relation-create.ts +1 -1
- package/src/blueprints/database/functions/schema-list.ts +17 -10
- package/src/blueprints/database/functions/tag-add.ts +1 -1
- package/src/blueprints/database/functions/tag-remove.ts +1 -1
- package/src/blueprints/discord/functions/definitions.ts +1 -0
- package/src/blueprints/discord/functions/fetch-messages.test.ts +7 -2
- package/src/blueprints/github/functions/definitions.ts +1 -0
- package/src/blueprints/linear/functions/definitions.ts +1 -0
- package/src/blueprints/linear/functions/linear.test.ts +1 -2
- package/src/blueprints/linear/functions/sync-issues.ts +1 -2
- package/src/blueprints/memory/blueprint.conversations.json +1 -1
- package/src/blueprints/memory/functions/definitions.ts +3 -0
- package/src/blueprints/planning/blueprint.ts +1 -1
- package/src/blueprints/planning/functions/index.ts +1 -1
- package/src/blueprints/planning/functions/{definitions.ts → update-tasks.md} +29 -50
- package/src/blueprints/planning/functions/update-tasks.test.ts +55 -0
- package/src/blueprints/planning/functions/update-tasks.ts +26 -3
- package/src/blueprints/project/blueprint.conversations.json +1 -1
- package/src/blueprints/project/blueprint.test.ts +12 -14
- package/src/blueprints/project/functions/add-artifact.ts +1 -0
- package/src/blueprints/project/functions/agent.ts +2 -2
- package/src/blueprints/project/functions/definitions.ts +8 -6
- package/src/blueprints/project/functions/get-context.ts +2 -1
- package/src/blueprints/project/functions/qualifier.ts +8 -7
- package/src/blueprints/project-wizard/functions/definitions.ts +6 -4
- package/src/blueprints/project-wizard/functions/sync-triggers.ts +32 -34
- package/src/blueprints/testing.ts +10 -4
- package/src/blueprints/websearch/blueprint.conversations.json +1 -1
- package/src/blueprints/websearch/functions/definitions.ts +1 -0
- package/src/crud/graph.test.ts +1 -1
- package/src/crud/graph.ts +142 -151
- package/src/errors.ts +3 -3
- package/src/functions/agent/definitions.ts +2 -1
- package/src/functions/agent/prompt.conversations.json +1 -1
- package/src/functions/agent/prompt.test.ts +8 -11
- package/src/functions/agent/prompt.ts +2 -2
- package/src/sync/sync.ts +7 -6
- package/src/testing/plugins.tsx +8 -13
- package/src/types/Agent.ts +24 -29
- package/src/types/Chat.ts +9 -16
- package/src/types/McpServer.ts +3 -6
- package/src/types/Memory.ts +3 -3
- package/src/types/Plan.ts +4 -11
- package/dist/lib/neutral/chunk-246ACKSH.mjs.map +0 -7
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-FIGO6CA6.mjs +0 -140
- package/dist/lib/neutral/chunk-FIGO6CA6.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GV66MKAQ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-IKBIORQX.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KGU725LW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs.map +0 -7
- package/dist/lib/neutral/chunk-P4ZMYO4K.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ROMZO4CB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TO5IX24K.mjs.map +0 -7
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-XUF53B6B.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +0 -7
- package/dist/lib/neutral/context-add-VB7AOY3G.mjs.map +0 -7
- package/dist/lib/neutral/context-remove-VCM3VPSO.mjs.map +0 -7
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs.map +0 -7
- package/dist/lib/neutral/qualifier-VDOY5CWU.mjs.map +0 -7
- package/dist/lib/neutral/query-PPJU5622.mjs.map +0 -7
- package/dist/lib/neutral/schema-list-W326VPVX.mjs +0 -38
- package/dist/lib/neutral/schema-list-W326VPVX.mjs.map +0 -7
- package/dist/lib/neutral/sync-issues-4YE5XAK5.mjs.map +0 -7
- package/dist/lib/neutral/sync-triggers-CDMJVW6E.mjs.map +0 -7
- package/dist/lib/neutral/update-tasks-H7SWIFQL.mjs +0 -46
- package/dist/lib/neutral/update-tasks-H7SWIFQL.mjs.map +0 -7
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts +0 -11
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts.map +0 -1
- /package/dist/lib/neutral/{chunk-QO5SU37C.mjs.map → chunk-PAEPER4S.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-project-EIF4OJMY.mjs.map → create-project-VNC2KKBG.mjs.map} +0 -0
- /package/dist/lib/neutral/{delete-J3PMWP7Z.mjs.map → delete-NLBJMMBJ.mjs.map} +0 -0
- /package/dist/lib/neutral/{fetch-KHMHV7JR.mjs.map → fetch-VV3DU75K.mjs.map} +0 -0
- /package/dist/lib/neutral/{fetch-messages-QOBBCTGC.mjs.map → fetch-messages-YXH77S3S.mjs.map} +0 -0
- /package/dist/lib/neutral/{load-ALP3TK2E.mjs.map → load-K7HEJA54.mjs.map} +0 -0
- /package/dist/lib/neutral/{object-delete-X53LS37B.mjs.map → object-delete-RMA5ZKGY.mjs.map} +0 -0
- /package/dist/lib/neutral/{project-HPHTZ2CI.mjs.map → project-OGO5ABSZ.mjs.map} +0 -0
- /package/dist/lib/neutral/{project-rules-IVDHKSKI.mjs.map → project-rules-IVA3DSOW.mjs.map} +0 -0
- /package/dist/lib/neutral/{query-U56GNEV6.mjs.map → query-GXZT4KUX.mjs.map} +0 -0
- /package/dist/lib/neutral/{query-blueprints-KXADGHSA.mjs.map → query-blueprints-GA2JM54N.mjs.map} +0 -0
- /package/dist/lib/neutral/{relation-delete-EP4KXAFL.mjs.map → relation-delete-MVJKKVEQ.mjs.map} +0 -0
- /package/dist/lib/neutral/{save-GWAPLT3Z.mjs.map → save-TFQMJKG7.mjs.map} +0 -0
- /package/dist/lib/neutral/{schema-add-Z5CY6P24.mjs.map → schema-add-I7BFBU55.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-blueprints-N2AK2VUR.mjs.map → update-blueprints-VOGJKSMQ.mjs.map} +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// src/blueprints/database/functions/definitions.ts
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
|
-
import {
|
|
3
|
+
import { AiContext } from "@dxos/assistant";
|
|
4
4
|
import { Operation } from "@dxos/compute";
|
|
5
|
-
import { Database, Obj, Ref, Relation, Tag } from "@dxos/echo";
|
|
5
|
+
import { Database, Obj, Ref, Relation, Tag, Type } from "@dxos/echo";
|
|
6
6
|
import { trim } from "@dxos/util";
|
|
7
7
|
var Query = Operation.make({
|
|
8
8
|
meta: {
|
|
9
9
|
key: "org.dxos.function.database.query",
|
|
10
10
|
name: "Query",
|
|
11
|
+
icon: "ph--magnifying-glass--regular",
|
|
11
12
|
description: trim`
|
|
12
13
|
Query for objects in ECHO.
|
|
13
14
|
Use this tool when searching for information in the space (both automerge and queues).
|
|
@@ -88,6 +89,7 @@ var Load = Operation.make({
|
|
|
88
89
|
meta: {
|
|
89
90
|
key: "org.dxos.function.database.load",
|
|
90
91
|
name: "Load object",
|
|
92
|
+
icon: "ph--download--regular",
|
|
91
93
|
description: trim`
|
|
92
94
|
Loads the object or relation content.
|
|
93
95
|
Can load multiple objects at at time.
|
|
@@ -109,6 +111,7 @@ var ObjectCreate = Operation.make({
|
|
|
109
111
|
meta: {
|
|
110
112
|
key: "org.dxos.function.database.object-create",
|
|
111
113
|
name: "Create object",
|
|
114
|
+
icon: "ph--plus--regular",
|
|
112
115
|
description: trim`
|
|
113
116
|
Creates a new object and adds it to the current space.
|
|
114
117
|
Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.
|
|
@@ -129,6 +132,7 @@ var ObjectUpdate = Operation.make({
|
|
|
129
132
|
meta: {
|
|
130
133
|
key: "org.dxos.function.database.object-update",
|
|
131
134
|
name: "Update object",
|
|
135
|
+
icon: "ph--pencil--regular",
|
|
132
136
|
description: trim`
|
|
133
137
|
Updates the object properties.
|
|
134
138
|
References are provided in the following format: { "/": "dxn:..." }.
|
|
@@ -153,7 +157,8 @@ var ObjectDelete = Operation.make({
|
|
|
153
157
|
name: "Delete object",
|
|
154
158
|
description: trim`
|
|
155
159
|
Deletes the object.
|
|
156
|
-
|
|
160
|
+
`,
|
|
161
|
+
icon: "ph--trash--regular"
|
|
157
162
|
},
|
|
158
163
|
input: Schema.Struct({
|
|
159
164
|
obj: Ref.Ref(Obj.Unknown)
|
|
@@ -167,6 +172,7 @@ var SchemaAdd = Operation.make({
|
|
|
167
172
|
meta: {
|
|
168
173
|
key: "org.dxos.function.database.schema-add",
|
|
169
174
|
name: "Add schema",
|
|
175
|
+
icon: "ph--plus--regular",
|
|
170
176
|
description: trim`
|
|
171
177
|
Adds a schema to the space.
|
|
172
178
|
The name will be used when displayed to the user.
|
|
@@ -188,6 +194,7 @@ var SchemaList = Operation.make({
|
|
|
188
194
|
meta: {
|
|
189
195
|
key: "org.dxos.function.database.schema-list",
|
|
190
196
|
name: "List schemas",
|
|
197
|
+
icon: "ph--list--regular",
|
|
191
198
|
description: trim`
|
|
192
199
|
Lists schemas definitions.
|
|
193
200
|
`
|
|
@@ -204,6 +211,7 @@ var ContextAdd = Operation.make({
|
|
|
204
211
|
meta: {
|
|
205
212
|
key: "org.dxos.function.database.context-add",
|
|
206
213
|
name: "Add to context",
|
|
214
|
+
icon: "ph--plus-circle--regular",
|
|
207
215
|
description: trim`
|
|
208
216
|
Adds the object to the chat context.
|
|
209
217
|
Use this it for objects that are useful long-term for the conversation.
|
|
@@ -216,13 +224,14 @@ var ContextAdd = Operation.make({
|
|
|
216
224
|
}),
|
|
217
225
|
output: Schema.Void,
|
|
218
226
|
services: [
|
|
219
|
-
|
|
227
|
+
AiContext.Service
|
|
220
228
|
]
|
|
221
229
|
}).pipe(Operation.intrinsic);
|
|
222
230
|
var ContextRemove = Operation.make({
|
|
223
231
|
meta: {
|
|
224
232
|
key: "org.dxos.function.database.context-remove",
|
|
225
233
|
name: "Remove from context",
|
|
234
|
+
icon: "ph--minus-circle--regular",
|
|
226
235
|
description: trim`
|
|
227
236
|
Removes the object from the chat context.
|
|
228
237
|
Use this it for objects that are no longer useful for the conversation.
|
|
@@ -235,13 +244,14 @@ var ContextRemove = Operation.make({
|
|
|
235
244
|
}),
|
|
236
245
|
output: Schema.Void,
|
|
237
246
|
services: [
|
|
238
|
-
|
|
247
|
+
AiContext.Service
|
|
239
248
|
]
|
|
240
249
|
}).pipe(Operation.intrinsic);
|
|
241
250
|
var RelationCreate = Operation.make({
|
|
242
251
|
meta: {
|
|
243
252
|
key: "org.dxos.function.database.relation-create",
|
|
244
253
|
name: "Create relation",
|
|
254
|
+
icon: "ph--arrows-merge--regular",
|
|
245
255
|
description: trim`
|
|
246
256
|
Creates a new relation and adds it to the current space.
|
|
247
257
|
Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.
|
|
@@ -266,7 +276,8 @@ var RelationDelete = Operation.make({
|
|
|
266
276
|
name: "Delete relation",
|
|
267
277
|
description: trim`
|
|
268
278
|
Deletes the relation.
|
|
269
|
-
|
|
279
|
+
`,
|
|
280
|
+
icon: "ph--trash--regular"
|
|
270
281
|
},
|
|
271
282
|
input: Schema.Struct({
|
|
272
283
|
rel: Ref.Ref(Relation.Unknown)
|
|
@@ -280,9 +291,10 @@ var TagAdd = Operation.make({
|
|
|
280
291
|
meta: {
|
|
281
292
|
key: "org.dxos.function.database.tag-add",
|
|
282
293
|
name: "Add tag",
|
|
294
|
+
icon: "ph--tag--regular",
|
|
283
295
|
description: trim`
|
|
284
296
|
Adds a tag to an object.
|
|
285
|
-
Tags are objects of type ${Tag.Tag
|
|
297
|
+
Tags are objects of type ${Type.getTypename(Tag.Tag)}.
|
|
286
298
|
You must search database for available tags, or create a new one.
|
|
287
299
|
`
|
|
288
300
|
},
|
|
@@ -299,9 +311,10 @@ var TagRemove = Operation.make({
|
|
|
299
311
|
meta: {
|
|
300
312
|
key: "org.dxos.function.database.tag-remove",
|
|
301
313
|
name: "Remove tag",
|
|
314
|
+
icon: "ph--tag--regular",
|
|
302
315
|
description: trim`
|
|
303
316
|
Removes a tag from an object.
|
|
304
|
-
Tags are objects of type ${Tag.Tag
|
|
317
|
+
Tags are objects of type ${Type.getTypename(Tag.Tag)}.
|
|
305
318
|
`
|
|
306
319
|
},
|
|
307
320
|
input: Schema.Struct({
|
|
@@ -329,4 +342,4 @@ export {
|
|
|
329
342
|
TagAdd,
|
|
330
343
|
TagRemove
|
|
331
344
|
};
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
345
|
+
//# sourceMappingURL=chunk-EUTROPCP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/database/functions/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiContext } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj, Ref, Relation, Tag, Type } from '@dxos/echo';\nimport { trim } from '@dxos/util';\n\nexport const Query = Operation.make({\n meta: {\n key: 'org.dxos.function.database.query',\n name: 'Query',\n icon: 'ph--magnifying-glass--regular',\n description: trim`\n Query for objects in ECHO.\n Use this tool when searching for information in the space (both automerge and queues).\n Currently, two types of queries are supported:\n - Full-text search - terms may appear anywhere in the object.\n - Type-based search - objects of a specific type.\n You can use them together, for example, to search for objects of a specific type that match a full-text query.\n Important: Whem querying by typename, make sure to list the schema first, to get the exact typename.\n\n Omit both typename and text to search for all objects.\n\n <output_format>\n You can choose to either return the full object data, or just the DXN, type and label.\n When expecting a lot of results, run with includeContent=false to not pollute the context, and then load specific objects using the load tool.\n\n You can choose to get the content right away, if you don't expect a lot of results.\n To load content right away, run with includeContent=true.\n When loading content, set an appropriate limit on the number of results to avoid overwhelming the context.\n </output_format>\n\n <example description=\"All tasks related to Cyberdyne and Bob\">\n {\n \"typename\": \"org.dxos.type.task\",\n \"text\": \"cyberdyne bob\",\n }\n </example>\n\n <example description=\"Financial report Q1 2026\">\n {\n \"typename\": \"org.dxos.type.document\",\n \"text\": \"financial report Q1 2026\",\n \"includeContent\": true\n \"limit\": 3\n }\n </example>\n\n <example description=\"Emails from specific mailboxes\">\n {\n \"in\": [{\"/\" : \"dxn:echo:@:YYYYYY\"}, {\"/\" : \"dxn:echo:@:XXXXXXX\"}],\n \"typename\": \"org.dxos.type.email\",\n \"includeContent\": true,\n \"limit\": 20\n }\n </example>\n `,\n },\n input: Schema.Struct({\n in: Schema.optional(\n Schema.Array(Ref.Ref(Obj.Unknown)).annotations({\n description:\n 'Scope the query to children of specific objects (transitively). ' +\n 'Use this to query items within containers such as feeds or folders. ' +\n 'For example, to find emails use `in: [mailbox1.feed, mailbox2.feed]`.',\n }),\n ),\n typename: Schema.optional(\n Schema.String.annotations({\n description: 'The typename of the objects to list.',\n example: 'org.dxos.type.task',\n }),\n ),\n text: Schema.optional(\n Schema.String.annotations({\n description: 'Full text search query.',\n example: 'email cyberdyne bob',\n }),\n ),\n includeContent: Schema.optional(\n Schema.Boolean.annotations({\n description: 'Include the full object data in the response.',\n default: false,\n }),\n ),\n limit: Schema.optional(\n Schema.Number.annotations({\n description: 'The maximum number of results to return.',\n default: 10,\n }),\n ),\n includeQueues: Schema.optional(\n Schema.Boolean.annotations({\n description: 'Search in queues as well as spaces. Only use this if searching for emails.',\n default: false,\n }),\n ),\n }),\n output: Schema.Array(Schema.Unknown),\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const Load = Operation.make({\n meta: {\n key: 'org.dxos.function.database.load',\n name: 'Load object',\n icon: 'ph--download--regular',\n description: trim`\n Loads the object or relation content.\n Can load multiple objects at at time.\n Use the to read the data when you have a DXN.\n Call this tool with an array of one or more DXNs or object IDs.\n When use see a reference ({ '/': 'dxn:...' }), you can call this function to load the object.\n Note that returned data is only a snapshot in time, and might have changed since the object was last loaded.\n `,\n },\n input: Schema.Struct({\n refs: Schema.Array(Ref.Ref(Obj.Unknown)),\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const ObjectCreate = Operation.make({\n meta: {\n key: 'org.dxos.function.database.object-create',\n name: 'Create object',\n icon: 'ph--plus--regular',\n description: trim`\n Creates a new object and adds it to the current space.\n Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.\n References are provided in the following format: { \"/\": \"dxn:...\" }.\n Reference examples: { \"/\": \"dxn:echo:@:01KG7R1ZXWFMWQ4DA1Q6TN1DG4\" }, { \"/\": \"dxn:queue:data:01KG7R1ZXWFMWQ4DA1Q6TN1DG4:01KG7R1ZXWFMWQ4DA1Q6TN1DG4\" }\n `,\n },\n input: Schema.Struct({\n typename: Schema.String,\n data: Schema.Any,\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const ObjectUpdate = Operation.make({\n meta: {\n key: 'org.dxos.function.database.object-update',\n name: 'Update object',\n icon: 'ph--pencil--regular',\n description: trim`\n Updates the object properties.\n References are provided in the following format: { \"/\": \"dxn:...\" }.\n Reference examples: { \"/\": \"dxn:echo:@:01KG7R1ZXWFMWQ4DA1Q6TN1DG4\" }, { \"/\": \"dxn:queue:data:01KG7R1ZXWFMWQ4DA1Q6TN1DG4:01KG7R1ZXWFMWQ4DA1Q6TN1DG4\" }\n `,\n },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown),\n properties: Schema.Record({ key: Schema.String, value: Schema.Any }),\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const ObjectDelete = Operation.make({\n meta: {\n key: 'org.dxos.function.database.object-delete',\n name: 'Delete object',\n description: trim`\n Deletes the object.\n `,\n icon: 'ph--trash--regular',\n },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown),\n }),\n output: Schema.Void,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const SchemaAdd = Operation.make({\n meta: {\n key: 'org.dxos.function.database.schema-add',\n name: 'Add schema',\n icon: 'ph--plus--regular',\n description: trim`\n Adds a schema to the space.\n The name will be used when displayed to the user.\n `,\n },\n input: Schema.Struct({\n name: Schema.String,\n typename: Schema.String.annotations({\n description: 'The typename of the schema in the format of \"com.example.type.type\".',\n }),\n jsonSchema: Schema.Any,\n }),\n output: Schema.Void,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const SchemaList = Operation.make({\n meta: {\n key: 'org.dxos.function.database.schema-list',\n name: 'List schemas',\n icon: 'ph--list--regular',\n description: trim`\n Lists schemas definitions.\n `,\n },\n input: Schema.Struct({\n limit: Schema.optional(Schema.Number),\n }),\n output: Schema.Array(Schema.Unknown),\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const ContextAdd = Operation.make({\n meta: {\n key: 'org.dxos.function.database.context-add',\n name: 'Add to context',\n icon: 'ph--plus-circle--regular',\n description: trim`\n Adds the object to the chat context.\n Use this it for objects that are useful long-term for the conversation.\n `,\n },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown).annotations({\n description: 'Object to add to the chat context.',\n }),\n }),\n output: Schema.Void,\n services: [AiContext.Service],\n}).pipe(Operation.intrinsic);\n\nexport const ContextRemove = Operation.make({\n meta: {\n key: 'org.dxos.function.database.context-remove',\n name: 'Remove from context',\n icon: 'ph--minus-circle--regular',\n description: trim`\n Removes the object from the chat context.\n Use this it for objects that are no longer useful for the conversation.\n `,\n },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown).annotations({\n description: 'Object to remove from the chat context.',\n }),\n }),\n output: Schema.Void,\n services: [AiContext.Service],\n}).pipe(Operation.intrinsic);\n\nexport const RelationCreate = Operation.make({\n meta: {\n key: 'org.dxos.function.database.relation-create',\n name: 'Create relation',\n icon: 'ph--arrows-merge--regular',\n description: trim`\n Creates a new relation and adds it to the current space.\n Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.\n `,\n },\n input: Schema.Struct({\n typename: Schema.String,\n source: Ref.Ref(Obj.Unknown),\n target: Ref.Ref(Obj.Unknown),\n properties: Schema.Any.annotations({\n description: 'The data to be stored in the relation.',\n }),\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const RelationDelete = Operation.make({\n meta: {\n key: 'org.dxos.function.database.relation-delete',\n name: 'Delete relation',\n description: trim`\n Deletes the relation.\n `,\n icon: 'ph--trash--regular',\n },\n input: Schema.Struct({\n rel: Ref.Ref(Relation.Unknown),\n }),\n output: Schema.Void,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const TagAdd = Operation.make({\n meta: {\n key: 'org.dxos.function.database.tag-add',\n name: 'Add tag',\n icon: 'ph--tag--regular',\n description: trim`\n Adds a tag to an object.\n Tags are objects of type ${Type.getTypename(Tag.Tag)}.\n You must search database for available tags, or create a new one.\n `,\n },\n input: Schema.Struct({\n tag: Ref.Ref(Obj.Unknown),\n obj: Ref.Ref(Obj.Unknown),\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const TagRemove = Operation.make({\n meta: {\n key: 'org.dxos.function.database.tag-remove',\n name: 'Remove tag',\n icon: 'ph--tag--regular',\n description: trim`\n Removes a tag from an object.\n Tags are objects of type ${Type.getTypename(Tag.Tag)}.\n `,\n },\n input: Schema.Struct({\n tag: Ref.Ref(Obj.Unknown),\n obj: Ref.Ref(Obj.Unknown),\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n}).pipe(Operation.intrinsic);\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Schema", "AiContext", "Operation", "Database", "Obj", "Ref", "Relation", "Tag", "Type", "trim", "Query", "make", "meta", "key", "name", "icon", "description", "input", "Struct", "in", "optional", "Array", "Unknown", "annotations", "typename", "String", "example", "text", "includeContent", "Boolean", "default", "limit", "Number", "includeQueues", "output", "services", "Service", "pipe", "intrinsic", "Load", "refs", "ObjectCreate", "data", "Any", "ObjectUpdate", "obj", "properties", "Record", "value", "ObjectDelete", "Void", "SchemaAdd", "jsonSchema", "SchemaList", "ContextAdd", "ContextRemove", "RelationCreate", "source", "target", "RelationDelete", "rel", "TagAdd", "getTypename", "tag", "TagRemove"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Chat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OC77MYT5.mjs";
|
|
4
4
|
|
|
5
5
|
// src/functions/agent/definitions.ts
|
|
6
6
|
import * as Schema from "effect/Schema";
|
|
@@ -12,7 +12,8 @@ var AgentPrompt = Operation.make({
|
|
|
12
12
|
meta: {
|
|
13
13
|
key: "org.dxos.function.prompt",
|
|
14
14
|
name: "Run Routine",
|
|
15
|
-
description: "Agentic worker that executes a provided prompt using blueprints and tools."
|
|
15
|
+
description: "Agentic worker that executes a provided prompt using blueprints and tools.",
|
|
16
|
+
icon: "ph--brain--regular"
|
|
16
17
|
},
|
|
17
18
|
input: Schema.Struct({
|
|
18
19
|
prompt: Ref.Ref(Routine.Routine),
|
|
@@ -57,4 +58,4 @@ var AgentPrompt = Operation.make({
|
|
|
57
58
|
export {
|
|
58
59
|
AgentPrompt
|
|
59
60
|
};
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-FNN6ERC6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/functions/agent/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService, OpaqueToolkit, ModelName } from '@dxos/ai';\nimport { Routine, Trace, Operation, OperationRegistry } from '@dxos/compute';\nimport { Database, Feed, Ref } from '@dxos/echo';\nimport { Text } from '@dxos/schema';\n\nimport * as Chat from '../../types/Chat';\n\n// TODO(dmaretskyi): Rename to RunRoutine.\nexport const AgentPrompt = Operation.make({\n meta: {\n key: 'org.dxos.function.prompt',\n name: 'Run Routine',\n description: 'Agentic worker that executes a provided prompt using blueprints and tools.',\n icon: 'ph--brain--regular',\n },\n input: Schema.Struct({\n prompt: Ref.Ref(Routine.Routine),\n\n /**\n * When set, runs in this chat (history, queue, and bound context). Routine blueprints and context objects are merged into the conversation for this request.\n */\n chat: Schema.optional(Ref.Ref(Chat.Chat)),\n\n /**\n * @default @anthropic/claude-opus-4-6\n */\n model: Schema.optional(ModelName),\n\n /**\n * Input object or data.\n * References get auto-resolved.\n */\n input: Schema.Any.pipe(Schema.annotations({ title: 'Input' })),\n\n systemInstructions: Schema.optional(Schema.String).annotations({\n description: 'Additional system instructions to add to the system prompt.',\n }),\n }),\n output: Schema.Any,\n // ECHO types that the handler loads via Database.load(). Declaring them here ensures the\n // runtime registers their schema before remote invocation (e.g. via the EDGE function service).\n types: [Routine.Routine, Text.Text, Feed.Feed, Chat.Chat],\n services: [\n AiService.AiService,\n Database.Service,\n Feed.FeedService,\n OpaqueToolkit.OpaqueToolkitProvider,\n OperationRegistry.Service,\n Trace.TraceService,\n ],\n}).pipe(Operation.intrinsic);\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAWC,eAAeC,iBAAiB;AACpD,SAASC,SAASC,OAAOC,WAAWC,yBAAyB;AAC7D,SAASC,UAAUC,MAAMC,WAAW;AACpC,SAASC,YAAY;AAKd,IAAMC,cAAcC,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;IACbC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBC,QAAQC,IAAIA,IAAIC,QAAQA,OAAO;;;;IAK/BC,MAAaC,gBAASH,IAAIA,IAASI,IAAI,CAAA;;;;IAKvCC,OAAcF,gBAASG,SAAAA;;;;;IAMvBT,OAAcU,WAAIC,KAAYC,mBAAY;MAAEC,OAAO;IAAQ,CAAA,CAAA;IAE3DC,oBAA2BR,gBAAgBS,aAAM,EAAEH,YAAY;MAC7Dd,aAAa;IACf,CAAA;EACF,CAAA;EACAkB,QAAeN;;;EAGfO,OAAO;IAACb,QAAQA;IAASc,KAAKA;IAAMC,KAAKA;IAAWZ;;EACpDa,UAAU;IACRC,UAAUA;IACVC,SAASC;IACTJ,KAAKK;IACLC,cAAcC;IACdC,kBAAkBJ;IAClBK,MAAMC;;AAEV,CAAA,EAAGlB,KAAKlB,UAAUqC,SAAS;",
|
|
6
|
+
"names": ["Schema", "AiService", "OpaqueToolkit", "ModelName", "Routine", "Trace", "Operation", "OperationRegistry", "Database", "Feed", "Ref", "Text", "AgentPrompt", "Operation", "make", "meta", "key", "name", "description", "icon", "input", "Struct", "prompt", "Ref", "Routine", "chat", "optional", "Chat", "model", "ModelName", "Any", "pipe", "annotations", "title", "systemInstructions", "String", "output", "types", "Text", "Feed", "services", "AiService", "Database", "Service", "FeedService", "OpaqueToolkit", "OpaqueToolkitProvider", "OperationRegistry", "Trace", "TraceService", "intrinsic"]
|
|
7
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Agent_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CMHECL6N.mjs";
|
|
4
4
|
|
|
5
5
|
// src/blueprints/project/functions/definitions.ts
|
|
6
6
|
import * as Schema from "effect/Schema";
|
|
7
7
|
import { AiService, OpaqueToolkit } from "@dxos/ai";
|
|
8
|
-
import {
|
|
8
|
+
import { AiContext } from "@dxos/assistant";
|
|
9
9
|
import { Trace, TriggerEvent, Operation, OperationRegistry } from "@dxos/compute";
|
|
10
10
|
import { Database, Feed, Obj, Ref } from "@dxos/echo";
|
|
11
|
-
import { QueueService } from "@dxos/functions";
|
|
12
11
|
var AgentWorker = Operation.make({
|
|
13
12
|
meta: {
|
|
14
13
|
key: "org.dxos.function.agent.worker",
|
|
15
14
|
name: "Agent Worker",
|
|
16
|
-
description: "Agentic worker that drives the agent autonomously."
|
|
15
|
+
description: "Agentic worker that drives the agent autonomously.",
|
|
16
|
+
icon: "ph--brain--regular"
|
|
17
17
|
},
|
|
18
18
|
input: Schema.Struct({
|
|
19
19
|
agent: Schema.suspend(() => Ref.Ref(Agent_exports.Agent)),
|
|
@@ -24,7 +24,6 @@ var AgentWorker = Operation.make({
|
|
|
24
24
|
services: [
|
|
25
25
|
AiService.AiService,
|
|
26
26
|
Database.Service,
|
|
27
|
-
QueueService,
|
|
28
27
|
Feed.FeedService,
|
|
29
28
|
OperationRegistry.Service,
|
|
30
29
|
Trace.TraceService,
|
|
@@ -35,7 +34,8 @@ var Qualifier = Operation.make({
|
|
|
35
34
|
meta: {
|
|
36
35
|
key: "org.dxos.function.agent.qualifier",
|
|
37
36
|
name: "Agent Qualifier",
|
|
38
|
-
description: "Qualifier that determines if the event is relevant to the agent. Puts the data into the input queue of the agent."
|
|
37
|
+
description: "Qualifier that determines if the event is relevant to the agent. Puts the data into the input queue of the agent.",
|
|
38
|
+
icon: "ph--funnel--regular"
|
|
39
39
|
},
|
|
40
40
|
input: Schema.Struct({
|
|
41
41
|
agent: Schema.suspend(() => Ref.Ref(Agent_exports.Agent)),
|
|
@@ -44,14 +44,16 @@ var Qualifier = Operation.make({
|
|
|
44
44
|
output: Schema.Void,
|
|
45
45
|
services: [
|
|
46
46
|
AiService.AiService,
|
|
47
|
-
Database.Service
|
|
47
|
+
Database.Service,
|
|
48
|
+
Feed.FeedService
|
|
48
49
|
]
|
|
49
50
|
}).pipe(Operation.intrinsic);
|
|
50
51
|
var GetContext = Operation.make({
|
|
51
52
|
meta: {
|
|
52
53
|
key: "org.dxos.function.agent.get-context",
|
|
53
54
|
name: "Get Agent Context",
|
|
54
|
-
description: "Get the context of an agent."
|
|
55
|
+
description: "Get the context of an agent.",
|
|
56
|
+
icon: "ph--info--regular"
|
|
55
57
|
},
|
|
56
58
|
input: Schema.Struct({}),
|
|
57
59
|
output: Schema.Struct({
|
|
@@ -66,7 +68,7 @@ var GetContext = Operation.make({
|
|
|
66
68
|
}))
|
|
67
69
|
}),
|
|
68
70
|
services: [
|
|
69
|
-
|
|
71
|
+
AiContext.Service,
|
|
70
72
|
Database.Service
|
|
71
73
|
]
|
|
72
74
|
}).pipe(Operation.intrinsic);
|
|
@@ -74,7 +76,8 @@ var AddArtifact = Operation.make({
|
|
|
74
76
|
meta: {
|
|
75
77
|
key: "org.dxos.function.agent.add-artifact",
|
|
76
78
|
name: "Add artifact",
|
|
77
|
-
description: "Adds a new artifact."
|
|
79
|
+
description: "Adds a new artifact.",
|
|
80
|
+
icon: "ph--plus--regular"
|
|
78
81
|
},
|
|
79
82
|
input: Schema.Struct({
|
|
80
83
|
name: Schema.String.annotations({
|
|
@@ -86,7 +89,7 @@ var AddArtifact = Operation.make({
|
|
|
86
89
|
}),
|
|
87
90
|
output: Schema.Void,
|
|
88
91
|
services: [
|
|
89
|
-
|
|
92
|
+
AiContext.Service,
|
|
90
93
|
Database.Service
|
|
91
94
|
]
|
|
92
95
|
}).pipe(Operation.intrinsic);
|
|
@@ -97,4 +100,4 @@ export {
|
|
|
97
100
|
GetContext,
|
|
98
101
|
AddArtifact
|
|
99
102
|
};
|
|
100
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
//# sourceMappingURL=chunk-GEMRKH7J.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/project/functions/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService, OpaqueToolkit } from '@dxos/ai';\nimport { AiContext } from '@dxos/assistant';\nimport { Trace, TriggerEvent, Operation, OperationRegistry } from '@dxos/compute';\nimport { Database, Feed, Obj, Ref } from '@dxos/echo';\n\nimport { Agent } from '../../../types';\n\nexport const AgentWorker = Operation.make({\n meta: {\n key: 'org.dxos.function.agent.worker',\n name: 'Agent Worker',\n description: 'Agentic worker that drives the agent autonomously.',\n icon: 'ph--brain--regular',\n },\n input: Schema.Struct({\n agent: Schema.suspend(() => Ref.Ref(Agent.Agent)),\n prompt: Schema.optional(Schema.String),\n event: Schema.optional(TriggerEvent.TriggerEvent),\n }),\n output: Schema.Void,\n services: [\n AiService.AiService,\n Database.Service,\n Feed.FeedService,\n OperationRegistry.Service,\n Trace.TraceService,\n OpaqueToolkit.OpaqueToolkitProvider,\n ],\n}).pipe(Operation.intrinsic);\n\nexport const Qualifier = Operation.make({\n meta: {\n key: 'org.dxos.function.agent.qualifier',\n name: 'Agent Qualifier',\n description:\n 'Qualifier that determines if the event is relevant to the agent. Puts the data into the input queue of the agent.',\n icon: 'ph--funnel--regular',\n },\n input: Schema.Struct({\n agent: Schema.suspend(() => Ref.Ref(Agent.Agent)),\n event: TriggerEvent.TriggerEvent,\n }),\n output: Schema.Void,\n services: [AiService.AiService, Database.Service, Feed.FeedService],\n}).pipe(Operation.intrinsic);\n\nexport const GetContext = Operation.make({\n meta: {\n key: 'org.dxos.function.agent.get-context',\n name: 'Get Agent Context',\n description: 'Get the context of an agent.',\n icon: 'ph--info--regular',\n },\n input: Schema.Struct({}),\n output: Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n instructions: Schema.String,\n plan: Schema.String,\n artifacts: Schema.Array(\n Schema.Struct({\n name: Schema.String,\n type: Schema.optional(Schema.String),\n dxn: Schema.optional(Schema.String),\n }),\n ),\n }),\n services: [AiContext.Service, Database.Service],\n}).pipe(Operation.intrinsic);\n\nexport const AddArtifact = Operation.make({\n meta: {\n key: 'org.dxos.function.agent.add-artifact',\n name: 'Add artifact',\n description: 'Adds a new artifact.',\n icon: 'ph--plus--regular',\n },\n input: Schema.Struct({\n name: Schema.String.annotations({\n description: 'The name of the artifact to add.',\n }),\n artifact: Ref.Ref(Obj.Unknown).annotations({\n description: 'The artifact to add. Do NOT guess or try to generate the ID.',\n }),\n }),\n output: Schema.Void,\n services: [AiContext.Service, Database.Service],\n}).pipe(Operation.intrinsic);\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAWC,qBAAqB;AACzC,SAASC,iBAAiB;AAC1B,SAASC,OAAOC,cAAcC,WAAWC,yBAAyB;AAClE,SAASC,UAAUC,MAAMC,KAAKC,WAAW;AAIlC,IAAMC,cAAcC,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;IACbC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBC,OAAcC,eAAQ,MAAMC,IAAIA,IAAIC,cAAMA,KAAK,CAAA;IAC/CC,QAAeC,gBAAgBC,aAAM;IACrCC,OAAcF,gBAASG,aAAaA,YAAY;EAClD,CAAA;EACAC,QAAeC;EACfC,UAAU;IACRC,UAAUA;IACVC,SAASC;IACTC,KAAKC;IACLC,kBAAkBH;IAClBI,MAAMC;IACNC,cAAcC;;AAElB,CAAA,EAAGC,KAAK/B,UAAUgC,SAAS;AAEpB,IAAMC,YAAYjC,UAAUC,KAAK;EACtCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aACE;IACFC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBC,OAAcC,eAAQ,MAAMC,IAAIA,IAAIC,cAAMA,KAAK,CAAA;IAC/CI,OAAOC,aAAaA;EACtB,CAAA;EACAC,QAAeC;EACfC,UAAU;IAACC,UAAUA;IAAWC,SAASC;IAASC,KAAKC;;AACzD,CAAA,EAAGM,KAAK/B,UAAUgC,SAAS;AAEpB,IAAME,aAAalC,UAAUC,KAAK;EACvCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;IACbC,MAAM;EACR;EACAC,OAAcC,cAAO,CAAC,CAAA;EACtBU,QAAeV,cAAO;IACpB2B,IAAWpB;IACXX,MAAaW;IACbqB,cAAqBrB;IACrBsB,MAAatB;IACbuB,WAAkBC,aACT/B,cAAO;MACZJ,MAAaW;MACbyB,MAAa1B,gBAAgBC,aAAM;MACnC0B,KAAY3B,gBAAgBC,aAAM;IACpC,CAAA,CAAA;EAEJ,CAAA;EACAK,UAAU;IAACsB,UAAUnB;IAASD,SAASC;;AACzC,CAAA,EAAGQ,KAAK/B,UAAUgC,SAAS;AAEpB,IAAMW,cAAc3C,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;IACbC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBJ,MAAaW,cAAO6B,YAAY;MAC9BvC,aAAa;IACf,CAAA;IACAwC,UAAUlC,IAAIA,IAAImC,IAAIC,OAAO,EAAEH,YAAY;MACzCvC,aAAa;IACf,CAAA;EACF,CAAA;EACAa,QAAeC;EACfC,UAAU;IAACsB,UAAUnB;IAASD,SAASC;;AACzC,CAAA,EAAGQ,KAAK/B,UAAUgC,SAAS;",
|
|
6
|
+
"names": ["Schema", "AiService", "OpaqueToolkit", "AiContext", "Trace", "TriggerEvent", "Operation", "OperationRegistry", "Database", "Feed", "Obj", "Ref", "AgentWorker", "Operation", "make", "meta", "key", "name", "description", "icon", "input", "Struct", "agent", "suspend", "Ref", "Agent", "prompt", "optional", "String", "event", "TriggerEvent", "output", "Void", "services", "AiService", "Database", "Service", "Feed", "FeedService", "OperationRegistry", "Trace", "TraceService", "OpaqueToolkit", "OpaqueToolkitProvider", "pipe", "intrinsic", "Qualifier", "GetContext", "id", "instructions", "plan", "artifacts", "Array", "type", "dxn", "AiContext", "AddArtifact", "annotations", "artifact", "Obj", "Unknown"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Memory
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LO2S3ICN.mjs";
|
|
4
4
|
|
|
5
5
|
// src/blueprints/memory/functions/definitions.ts
|
|
6
6
|
import * as Schema from "effect/Schema";
|
|
@@ -10,7 +10,8 @@ var QueryMemories = Operation.make({
|
|
|
10
10
|
meta: {
|
|
11
11
|
key: "org.dxos.function.memory.query",
|
|
12
12
|
name: "Query memories",
|
|
13
|
-
description: "Search for stored memories using full-text search. Returns memories matching the query terms. Use this to recall previously saved knowledge, facts, or preferences."
|
|
13
|
+
description: "Search for stored memories using full-text search. Returns memories matching the query terms. Use this to recall previously saved knowledge, facts, or preferences.",
|
|
14
|
+
icon: "ph--brain--regular"
|
|
14
15
|
},
|
|
15
16
|
input: Schema.Struct({
|
|
16
17
|
text: Schema.optional(Schema.String.annotations({
|
|
@@ -35,7 +36,8 @@ var SaveMemory = Operation.make({
|
|
|
35
36
|
meta: {
|
|
36
37
|
key: "org.dxos.function.memory.save",
|
|
37
38
|
name: "Save memory",
|
|
38
|
-
description: "Saves a new memory to the database. Use this to persist knowledge, facts, preferences, or any information that should be remembered across conversations."
|
|
39
|
+
description: "Saves a new memory to the database. Use this to persist knowledge, facts, preferences, or any information that should be remembered across conversations.",
|
|
40
|
+
icon: "ph--brain--regular"
|
|
39
41
|
},
|
|
40
42
|
input: Schema.Struct({
|
|
41
43
|
title: Schema.String.annotations({
|
|
@@ -54,7 +56,8 @@ var DeleteMemory = Operation.make({
|
|
|
54
56
|
meta: {
|
|
55
57
|
key: "org.dxos.function.memory.delete",
|
|
56
58
|
name: "Delete memory",
|
|
57
|
-
description: "Deletes a memory from the database. Use this to remove outdated or incorrect memories."
|
|
59
|
+
description: "Deletes a memory from the database. Use this to remove outdated or incorrect memories.",
|
|
60
|
+
icon: "ph--trash--regular"
|
|
58
61
|
},
|
|
59
62
|
input: Schema.Struct({
|
|
60
63
|
memory: Ref.Ref(Memory)
|
|
@@ -70,4 +73,4 @@ export {
|
|
|
70
73
|
SaveMemory,
|
|
71
74
|
DeleteMemory
|
|
72
75
|
};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-GHGJCH73.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/memory/functions/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation } from '@dxos/compute';\nimport { Database, Ref } from '@dxos/echo';\n\nimport { Memory } from '../../../types/Memory';\n\nexport const QueryMemories = Operation.make({\n meta: {\n key: 'org.dxos.function.memory.query',\n name: 'Query memories',\n description:\n 'Search for stored memories using full-text search. Returns memories matching the query terms. Use this to recall previously saved knowledge, facts, or preferences.',\n icon: 'ph--brain--regular',\n },\n input: Schema.Struct({\n text: Schema.optional(\n Schema.String.annotations({\n description: 'Full-text search query. Omit to list all memories.',\n examples: ['new york trip date plan', 'favorite color', 'project cyberdyne'],\n }),\n ),\n limit: Schema.optional(\n Schema.Number.annotations({\n description: 'Maximum number of results to return.',\n default: 10,\n }),\n ),\n }),\n output: Schema.Array(Schema.Unknown),\n services: [Database.Service],\n});\n\nexport const SaveMemory = Operation.make({\n meta: {\n key: 'org.dxos.function.memory.save',\n name: 'Save memory',\n description:\n 'Saves a new memory to the database. Use this to persist knowledge, facts, preferences, or any information that should be remembered across conversations.',\n icon: 'ph--brain--regular',\n },\n input: Schema.Struct({\n title: Schema.String.annotations({\n description: 'Short descriptive title for the memory.',\n }),\n content: Schema.String.annotations({\n description:\n 'The content of the memory. Can be a fact, preference, instruction, or any knowledge worth persisting.',\n }),\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n});\n\nexport const DeleteMemory = Operation.make({\n meta: {\n key: 'org.dxos.function.memory.delete',\n name: 'Delete memory',\n description: 'Deletes a memory from the database. Use this to remove outdated or incorrect memories.',\n icon: 'ph--trash--regular',\n },\n input: Schema.Struct({\n memory: Ref.Ref(Memory),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,WAAW;AAIvB,IAAMC,gBAAgBC,UAAUC,KAAK;EAC1CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aACE;IACFC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBC,MAAaC,gBACJC,cAAOC,YAAY;MACxBP,aAAa;MACbQ,UAAU;QAAC;QAA2B;QAAkB;;IAC1D,CAAA,CAAA;IAEFC,OAAcJ,gBACLK,cAAOH,YAAY;MACxBP,aAAa;MACbW,SAAS;IACX,CAAA,CAAA;EAEJ,CAAA;EACAC,QAAeC,aAAaC,cAAO;EACnCC,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMC,aAAavB,UAAUC,KAAK;EACvCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aACE;IACFC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBgB,OAAcb,cAAOC,YAAY;MAC/BP,aAAa;IACf,CAAA;IACAoB,SAAgBd,cAAOC,YAAY;MACjCP,aACE;IACJ,CAAA;EACF,CAAA;EACAY,QAAeE;EACfC,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMI,eAAe1B,UAAUC,KAAK;EACzCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;IACbC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBmB,QAAQC,IAAIA,IAAIC,MAAAA;EAClB,CAAA;EACAZ,QAAea;EACfV,UAAU;IAACC,SAASC;;AACtB,CAAA;",
|
|
6
|
+
"names": ["Schema", "Operation", "Database", "Ref", "QueryMemories", "Operation", "make", "meta", "key", "name", "description", "icon", "input", "Struct", "text", "optional", "String", "annotations", "examples", "limit", "Number", "default", "output", "Array", "Unknown", "services", "Database", "Service", "SaveMemory", "title", "content", "DeleteMemory", "memory", "Ref", "Memory", "Void"]
|
|
7
|
+
}
|
|
@@ -8,22 +8,19 @@ __export(Memory_exports, {
|
|
|
8
8
|
Memory: () => Memory
|
|
9
9
|
});
|
|
10
10
|
import * as Schema from "effect/Schema";
|
|
11
|
-
import { Annotation, Type } from "@dxos/echo";
|
|
11
|
+
import { DXN, Annotation, Type } from "@dxos/echo";
|
|
12
12
|
var Memory = Schema.Struct({
|
|
13
13
|
title: Schema.String,
|
|
14
14
|
content: Schema.String
|
|
15
|
-
}).pipe(
|
|
16
|
-
typename: "org.dxos.type.memory",
|
|
17
|
-
version: "0.1.0"
|
|
18
|
-
}), Annotation.LabelAnnotation.set([
|
|
15
|
+
}).pipe(Annotation.LabelAnnotation.set([
|
|
19
16
|
"title"
|
|
20
17
|
]), Annotation.IconAnnotation.set({
|
|
21
18
|
icon: "ph--brain--regular",
|
|
22
19
|
hue: "pink"
|
|
23
|
-
}));
|
|
20
|
+
}), Type.makeObject(DXN.make("org.dxos.type.memory", "0.1.0")));
|
|
24
21
|
|
|
25
22
|
export {
|
|
26
23
|
Memory,
|
|
27
24
|
Memory_exports
|
|
28
25
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-LO2S3ICN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/Memory.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN, Annotation, Type } from '@dxos/echo';\n\n/**\n * Unit of knowledge generated by an agent.\n */\nexport const Memory = Schema.Struct({\n title: Schema.String,\n content: Schema.String,\n}).pipe(\n Annotation.LabelAnnotation.set(['title']),\n Annotation.IconAnnotation.set({\n icon: 'ph--brain--regular',\n hue: 'pink',\n }),\n Type.makeObject(DXN.make('org.dxos.type.memory', '0.1.0')),\n);\n\nexport type Memory = Type.InstanceType<typeof Memory>;\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAYC,YAAY;AAK/B,IAAMC,SAAgBC,cAAO;EAClCC,OAAcC;EACdC,SAAgBD;AAClB,CAAA,EAAGE,KACDP,WAAWQ,gBAAgBC,IAAI;EAAC;CAAQ,GACxCT,WAAWU,eAAeD,IAAI;EAC5BE,MAAM;EACNC,KAAK;AACP,CAAA,GACAX,KAAKY,WAAWd,IAAIe,KAAK,wBAAwB,OAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Schema", "DXN", "Annotation", "Type", "Memory", "Struct", "title", "String", "content", "pipe", "LabelAnnotation", "set", "IconAnnotation", "icon", "hue", "makeObject", "make"]
|
|
7
|
+
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
// src/blueprints/blueprint-manager/functions/definitions.ts
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
|
-
import {
|
|
3
|
+
import { AiContext } from "@dxos/assistant";
|
|
4
4
|
import { Blueprint, Operation } from "@dxos/compute";
|
|
5
|
-
import { Database } from "@dxos/echo";
|
|
5
|
+
import { Database, Type } from "@dxos/echo";
|
|
6
6
|
var QueryBlueprints = Operation.make({
|
|
7
7
|
meta: {
|
|
8
8
|
key: "org.dxos.function.blueprint-manager.query-blueprints",
|
|
9
9
|
name: "Query blueprints",
|
|
10
|
-
description: "Queries available blueprints."
|
|
10
|
+
description: "Queries available blueprints.",
|
|
11
|
+
icon: "ph--blueprint--regular"
|
|
11
12
|
},
|
|
12
13
|
input: Schema.Struct({}),
|
|
13
|
-
output: Schema.Array(Blueprint.Blueprint),
|
|
14
|
+
output: Schema.Array(Type.getSchema(Blueprint.Blueprint)),
|
|
14
15
|
services: [
|
|
15
16
|
Blueprint.RegistryService
|
|
16
17
|
]
|
|
@@ -19,7 +20,8 @@ var EnableBlueprints = Operation.make({
|
|
|
19
20
|
meta: {
|
|
20
21
|
key: "org.dxos.function.blueprint-manager.enable-blueprints",
|
|
21
22
|
name: "Enable blueprints",
|
|
22
|
-
description: "Enables blueprints in the current conversation by their keys. Only blueprints with agentCanEnable=true can be enabled. Always call [query-blueprints] first to discover available blueprint keys."
|
|
23
|
+
description: "Enables blueprints in the current conversation by their keys. Only blueprints with agentCanEnable=true can be enabled. Always call [query-blueprints] first to discover available blueprint keys.",
|
|
24
|
+
icon: "ph--plugs-connected--regular"
|
|
23
25
|
},
|
|
24
26
|
input: Schema.Struct({
|
|
25
27
|
keys: Schema.Array(Schema.String).annotations({
|
|
@@ -33,7 +35,7 @@ var EnableBlueprints = Operation.make({
|
|
|
33
35
|
})
|
|
34
36
|
}),
|
|
35
37
|
output: Schema.Struct({
|
|
36
|
-
enabled: Schema.Array(Blueprint.Blueprint),
|
|
38
|
+
enabled: Schema.Array(Type.getSchema(Blueprint.Blueprint)),
|
|
37
39
|
rejected: Schema.Array(Schema.Struct({
|
|
38
40
|
key: Schema.String,
|
|
39
41
|
reason: Schema.String
|
|
@@ -42,14 +44,15 @@ var EnableBlueprints = Operation.make({
|
|
|
42
44
|
services: [
|
|
43
45
|
Blueprint.RegistryService,
|
|
44
46
|
Database.Service,
|
|
45
|
-
|
|
47
|
+
AiContext.Service
|
|
46
48
|
]
|
|
47
49
|
});
|
|
48
50
|
var UpdateBlueprints = Operation.make({
|
|
49
51
|
meta: {
|
|
50
52
|
key: "org.dxos.function.blueprint-manager.refresh-blueprints",
|
|
51
53
|
name: "Refresh blueprints",
|
|
52
|
-
description: "Updates the blueprints saved to the database with the latest version from the registry. Sometimes blueprints in the database can become outdated. Use this function to pull in the latest versions."
|
|
54
|
+
description: "Updates the blueprints saved to the database with the latest version from the registry. Sometimes blueprints in the database can become outdated. Use this function to pull in the latest versions.",
|
|
55
|
+
icon: "ph--arrows-clockwise--regular"
|
|
53
56
|
},
|
|
54
57
|
input: Schema.Struct({}),
|
|
55
58
|
output: Schema.Void,
|
|
@@ -64,4 +67,4 @@ export {
|
|
|
64
67
|
EnableBlueprints,
|
|
65
68
|
UpdateBlueprints
|
|
66
69
|
};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-MMIERIDT.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/blueprint-manager/functions/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiContext } from '@dxos/assistant';\nimport { Blueprint, Operation } from '@dxos/compute';\nimport { Database, Type } from '@dxos/echo';\n\nexport const QueryBlueprints = Operation.make({\n meta: {\n key: 'org.dxos.function.blueprint-manager.query-blueprints',\n name: 'Query blueprints',\n description: 'Queries available blueprints.',\n icon: 'ph--blueprint--regular',\n },\n input: Schema.Struct({}),\n output: Schema.Array(Type.getSchema(Blueprint.Blueprint)),\n services: [Blueprint.RegistryService],\n});\n\nexport const EnableBlueprints = Operation.make({\n meta: {\n key: 'org.dxos.function.blueprint-manager.enable-blueprints',\n name: 'Enable blueprints',\n description:\n 'Enables blueprints in the current conversation by their keys. Only blueprints with agentCanEnable=true can be enabled. Always call [query-blueprints] first to discover available blueprint keys.',\n icon: 'ph--plugs-connected--regular',\n },\n input: Schema.Struct({\n keys: Schema.Array(Schema.String).annotations({\n description: 'The keys of the blueprints to enable.',\n examples: [['org.dxos.blueprint.memory', 'org.dxos.blueprint.database']],\n }),\n }),\n output: Schema.Struct({\n enabled: Schema.Array(Type.getSchema(Blueprint.Blueprint)),\n rejected: Schema.Array(\n Schema.Struct({\n key: Schema.String,\n reason: Schema.String,\n }),\n ),\n }),\n services: [Blueprint.RegistryService, Database.Service, AiContext.Service],\n});\n\nexport const UpdateBlueprints = Operation.make({\n meta: {\n key: 'org.dxos.function.blueprint-manager.refresh-blueprints',\n name: 'Refresh blueprints',\n description:\n 'Updates the blueprints saved to the database with the latest version from the registry. Sometimes blueprints in the database can become outdated. Use this function to pull in the latest versions.',\n icon: 'ph--arrows-clockwise--regular',\n },\n input: Schema.Struct({}),\n output: Schema.Void,\n services: [Blueprint.RegistryService, Database.Service],\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,iBAAiB;AACrC,SAASC,UAAUC,YAAY;AAExB,IAAMC,kBAAkBH,UAAUI,KAAK;EAC5CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;IACbC,MAAM;EACR;EACAC,OAAcC,cAAO,CAAC,CAAA;EACtBC,QAAeC,aAAMX,KAAKY,UAAUf,UAAUA,SAAS,CAAA;EACvDgB,UAAU;IAAChB,UAAUiB;;AACvB,CAAA;AAEO,IAAMC,mBAAmBjB,UAAUI,KAAK;EAC7CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aACE;IACFC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBO,MAAaL,aAAaM,aAAM,EAAEC,YAAY;MAC5CZ,aAAa;MACba,UAAU;QAAC;UAAC;UAA6B;;;IAC3C,CAAA;EACF,CAAA;EACAT,QAAeD,cAAO;IACpBW,SAAgBT,aAAMX,KAAKY,UAAUf,UAAUA,SAAS,CAAA;IACxDwB,UAAiBV,aACRF,cAAO;MACZL,KAAYa;MACZK,QAAeL;IACjB,CAAA,CAAA;EAEJ,CAAA;EACAJ,UAAU;IAAChB,UAAUiB;IAAiBf,SAASwB;IAAS3B,UAAU2B;;AACpE,CAAA;AAEO,IAAMC,mBAAmB1B,UAAUI,KAAK;EAC7CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aACE;IACFC,MAAM;EACR;EACAC,OAAcC,cAAO,CAAC,CAAA;EACtBC,QAAee;EACfZ,UAAU;IAAChB,UAAUiB;IAAiBf,SAASwB;;AACjD,CAAA;",
|
|
6
|
+
"names": ["Schema", "AiContext", "Blueprint", "Operation", "Database", "Type", "QueryBlueprints", "make", "meta", "key", "name", "description", "icon", "input", "Struct", "output", "Array", "getSchema", "services", "RegistryService", "EnableBlueprints", "keys", "String", "annotations", "examples", "enabled", "rejected", "reason", "Service", "UpdateBlueprints", "Void"]
|
|
7
|
+
}
|
|
@@ -11,35 +11,30 @@ __export(Chat_exports, {
|
|
|
11
11
|
make: () => make
|
|
12
12
|
});
|
|
13
13
|
import * as Schema from "effect/Schema";
|
|
14
|
-
import { Annotation, Feed, Obj, Ref, Type } from "@dxos/echo";
|
|
14
|
+
import { DXN, Annotation, Feed, Obj, Ref, Type } from "@dxos/echo";
|
|
15
15
|
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
16
16
|
var Chat = Schema.Struct({
|
|
17
17
|
name: Schema.String.pipe(Schema.optional),
|
|
18
18
|
feed: Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false)),
|
|
19
19
|
view: Schema.String.pipe(Schema.optional)
|
|
20
|
-
}).pipe(
|
|
21
|
-
typename: "org.dxos.type.assistant.chat",
|
|
22
|
-
version: "0.1.0"
|
|
23
|
-
}), LabelAnnotation.set([
|
|
20
|
+
}).pipe(LabelAnnotation.set([
|
|
24
21
|
"name"
|
|
25
22
|
]), Annotation.IconAnnotation.set({
|
|
26
23
|
icon: "ph--sparkle--regular",
|
|
27
24
|
hue: "sky"
|
|
28
|
-
}));
|
|
25
|
+
}), Type.makeObject(DXN.make("org.dxos.type.assistant.chat", "0.1.0")));
|
|
29
26
|
var make = (props) => Obj.make(Chat, props);
|
|
30
27
|
var LegacyCompanionTo = Schema.Struct({
|
|
31
28
|
id: Obj.ID
|
|
32
|
-
}).pipe(Type.
|
|
33
|
-
|
|
34
|
-
version: "0.1.0",
|
|
29
|
+
}).pipe(Type.makeRelation({
|
|
30
|
+
dxn: DXN.make("org.dxos.relation.assistant.companionTo", "0.1.0"),
|
|
35
31
|
source: Chat,
|
|
36
32
|
target: Obj.Unknown
|
|
37
33
|
}));
|
|
38
34
|
var CompanionTo = Schema.Struct({
|
|
39
35
|
id: Obj.ID
|
|
40
|
-
}).pipe(Type.
|
|
41
|
-
|
|
42
|
-
version: "0.1.0",
|
|
36
|
+
}).pipe(Type.makeRelation({
|
|
37
|
+
dxn: DXN.make("org.dxos.relation.assistant.companionTo", "0.1.0"),
|
|
43
38
|
source: Chat,
|
|
44
39
|
target: Obj.Unknown
|
|
45
40
|
}));
|
|
@@ -50,4 +45,4 @@ export {
|
|
|
50
45
|
CompanionTo,
|
|
51
46
|
Chat_exports
|
|
52
47
|
};
|
|
53
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-OC77MYT5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/Chat.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN, Annotation, Feed, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\n\n/**\n * AI chat.\n */\nexport const Chat = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n feed: Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false)),\n view: Schema.String.pipe(Schema.optional),\n}).pipe(\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--sparkle--regular',\n hue: 'sky',\n }),\n Type.makeObject(DXN.make('org.dxos.type.assistant.chat', '0.1.0')),\n);\n\nexport type Chat = Type.InstanceType<typeof Chat>;\nexport const make = (props: Obj.MakeProps<typeof Chat>) => Obj.make(Chat, props);\n\n/** @deprecated Use CompanionTo instead. */\nexport const LegacyCompanionTo = Schema.Struct({\n id: Obj.ID,\n}).pipe(\n Type.makeRelation({\n dxn: DXN.make('org.dxos.relation.assistant.companionTo', '0.1.0'),\n source: Chat,\n target: Obj.Unknown,\n }),\n);\n\nexport type LegacyCompanionTo = Type.InstanceType<typeof LegacyCompanionTo>;\n/**\n * Relation between a Chat and companion objects (e.g., artifacts).\n */\nexport const CompanionTo = Schema.Struct({\n id: Obj.ID,\n}).pipe(\n Type.makeRelation({\n dxn: DXN.make('org.dxos.relation.assistant.companionTo', '0.1.0'),\n source: Chat,\n target: Obj.Unknown,\n }),\n);\n\nexport type CompanionTo = Type.InstanceType<typeof CompanionTo>;\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;;;;AAMA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAYC,MAAMC,KAAKC,KAAKC,YAAY;AACtD,SAASC,qBAAqBC,uBAAuB;AAK9C,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,MAAMV,IAAIA,IAAIF,KAAKA,IAAI,EAAEU,KAAKN,oBAAoBS,IAAI,KAAA,CAAA;EACtDC,MAAaL,cAAOC,KAAYC,eAAQ;AAC1C,CAAA,EAAGD,KACDL,gBAAgBQ,IAAI;EAAC;CAAO,GAC5Bd,WAAWgB,eAAeF,IAAI;EAC5BG,MAAM;EACNC,KAAK;AACP,CAAA,GACAd,KAAKe,WAAWpB,IAAIqB,KAAK,gCAAgC,OAAA,CAAA,CAAA;AAIpD,IAAMA,OAAO,CAACC,UAAsCnB,IAAIkB,KAAKb,MAAMc,KAAAA;AAGnE,IAAMC,oBAA2Bd,cAAO;EAC7Ce,IAAIrB,IAAIsB;AACV,CAAA,EAAGb,KACDP,KAAKqB,aAAa;EAChBC,KAAK3B,IAAIqB,KAAK,2CAA2C,OAAA;EACzDO,QAAQpB;EACRqB,QAAQ1B,IAAI2B;AACd,CAAA,CAAA;AAOK,IAAMC,cAAqBtB,cAAO;EACvCe,IAAIrB,IAAIsB;AACV,CAAA,EAAGb,KACDP,KAAKqB,aAAa;EAChBC,KAAK3B,IAAIqB,KAAK,2CAA2C,OAAA;EACzDO,QAAQpB;EACRqB,QAAQ1B,IAAI2B;AACd,CAAA,CAAA;",
|
|
6
|
+
"names": ["Schema", "DXN", "Annotation", "Feed", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "Chat", "Struct", "name", "String", "pipe", "optional", "feed", "set", "view", "IconAnnotation", "icon", "hue", "makeObject", "make", "props", "LegacyCompanionTo", "id", "ID", "makeRelation", "dxn", "source", "target", "Unknown", "CompanionTo"]
|
|
7
|
+
}
|
|
@@ -6,7 +6,8 @@ var SyncIssues = Operation.make({
|
|
|
6
6
|
meta: {
|
|
7
7
|
key: "org.dxos.function.linear.sync-issues",
|
|
8
8
|
name: "Linear",
|
|
9
|
-
description: "Sync issues from Linear."
|
|
9
|
+
description: "Sync issues from Linear.",
|
|
10
|
+
icon: "ph--arrows-clockwise--regular"
|
|
10
11
|
},
|
|
11
12
|
input: Schema.Struct({
|
|
12
13
|
team: Schema.String.annotations({
|
|
@@ -22,9 +23,9 @@ var SyncIssues = Operation.make({
|
|
|
22
23
|
|
|
23
24
|
// src/sync/sync.ts
|
|
24
25
|
import * as Effect from "effect/Effect";
|
|
25
|
-
import { Filter, Obj, Query, Ref } from "@dxos/echo";
|
|
26
|
-
import { Database as Database2 } from "@dxos/echo";
|
|
26
|
+
import { Database as Database2, Filter, Obj, Query, Ref } from "@dxos/echo";
|
|
27
27
|
import { failedInvariant } from "@dxos/invariant";
|
|
28
|
+
import { EchoURI } from "@dxos/keys";
|
|
28
29
|
import { log } from "@dxos/log";
|
|
29
30
|
var __dxlog_file = "/__w/dxos/dxos/packages/core/compute/assistant-toolkit/src/sync/sync.ts";
|
|
30
31
|
var syncObjects = Effect.fn("syncObjects")(function* (objs, { foreignKeyId }) {
|
|
@@ -40,7 +41,8 @@ var syncObjects = Effect.fn("syncObjects")(function* (objs, { foreignKeyId }) {
|
|
|
40
41
|
if (!ref.target) {
|
|
41
42
|
continue;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
const targetUri = EchoURI.tryParse(Obj.getURI(ref.target));
|
|
45
|
+
if (targetUri && EchoURI.isLocal(targetUri)) {
|
|
44
46
|
const [target] = yield* syncObjects([
|
|
45
47
|
ref.target
|
|
46
48
|
], {
|
|
@@ -49,9 +51,9 @@ var syncObjects = Effect.fn("syncObjects")(function* (objs, { foreignKeyId }) {
|
|
|
49
51
|
obj[key] = Ref.make(target);
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
const
|
|
54
|
+
const type = Obj.getType(obj) ?? failedInvariant("No type.");
|
|
53
55
|
const foreignId = Obj.getKeys(obj, foreignKeyId)[0]?.id ?? failedInvariant("No foreign key.");
|
|
54
|
-
const [existing] = yield* Database2.runQuery(Query.select(Filter.foreignKeys(
|
|
56
|
+
const [existing] = yield* Database2.runQuery(Query.select(Filter.foreignKeys(type, [
|
|
55
57
|
{
|
|
56
58
|
source: foreignKeyId,
|
|
57
59
|
id: foreignId
|
|
@@ -60,8 +62,8 @@ var syncObjects = Effect.fn("syncObjects")(function* (objs, { foreignKeyId }) {
|
|
|
60
62
|
log("sync object", {
|
|
61
63
|
type: Obj.getTypename(obj),
|
|
62
64
|
foreignId,
|
|
63
|
-
existing: existing ? Obj.
|
|
64
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L:
|
|
65
|
+
existing: existing ? Obj.getURI(existing) : void 0
|
|
66
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 49, S: this });
|
|
65
67
|
if (!existing) {
|
|
66
68
|
yield* Database2.add(obj);
|
|
67
69
|
return obj;
|
|
@@ -105,4 +107,4 @@ export {
|
|
|
105
107
|
SyncIssues,
|
|
106
108
|
syncObjects
|
|
107
109
|
};
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-ONQXVECY.mjs.map
|