@dxos/assistant-toolkit 0.8.4-main.d05539e30a → 0.8.4-main.d9fc60f731
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-4IVGW6CI.mjs → add-artifact-ADKF427P.mjs} +5 -5
- package/dist/lib/neutral/{agent-F4L7UXME.mjs → agent-4HT4GKKI.mjs} +8 -8
- package/dist/lib/neutral/{agent-F4L7UXME.mjs.map → agent-4HT4GKKI.mjs.map} +2 -2
- package/dist/lib/neutral/{chunk-ANSF2BHN.mjs → chunk-3ZDYN7BG.mjs} +14 -25
- package/dist/lib/neutral/chunk-3ZDYN7BG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-EJAQUAKM.mjs → chunk-53BZWMRB.mjs} +12 -8
- package/dist/lib/neutral/chunk-53BZWMRB.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-WLR3BGO4.mjs → chunk-6SYN5IV3.mjs} +4 -2
- package/dist/lib/neutral/chunk-6SYN5IV3.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-W2722TC5.mjs → chunk-7OQIX2PP.mjs} +4 -4
- package/dist/lib/neutral/{chunk-W2722TC5.mjs.map → chunk-7OQIX2PP.mjs.map} +1 -1
- package/dist/lib/neutral/{chunk-5GPL2WXU.mjs → chunk-ALDU6VDG.mjs} +13 -23
- package/dist/lib/neutral/chunk-ALDU6VDG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-COL54UJ3.mjs → chunk-AYV2KMAV.mjs} +7 -5
- package/dist/lib/neutral/chunk-AYV2KMAV.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-MMQ7HFL4.mjs → chunk-BB6X6NT6.mjs} +12 -8
- package/dist/lib/neutral/chunk-BB6X6NT6.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-BCT55UTL.mjs → chunk-DBUT6FKM.mjs} +16 -14
- package/dist/lib/neutral/chunk-DBUT6FKM.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-NR3GTWRC.mjs → chunk-GQRUBCMT.mjs} +8 -13
- package/dist/lib/neutral/chunk-GQRUBCMT.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-PLGEBNTO.mjs → chunk-JRYAD4TG.mjs} +6 -4
- package/dist/lib/neutral/chunk-JRYAD4TG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ZFXLTBZG.mjs → chunk-PHZNOLXL.mjs} +5 -3
- package/dist/lib/neutral/chunk-PHZNOLXL.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-KGU725LW.mjs → chunk-SOLG2NPH.mjs} +4 -7
- package/dist/lib/neutral/chunk-SOLG2NPH.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-KS3IA6FQ.mjs → chunk-T3RP4AUP.mjs} +19 -16
- package/dist/lib/neutral/chunk-T3RP4AUP.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-7UCYAP3T.mjs → chunk-V3PPVL3C.mjs} +54 -40
- package/dist/lib/neutral/chunk-V3PPVL3C.mjs.map +7 -0
- package/dist/lib/neutral/{context-add-S5MBW2NA.mjs → context-add-2G2CDRCK.mjs} +2 -2
- package/dist/lib/neutral/{context-remove-35O5T5N5.mjs → context-remove-QQOT57JC.mjs} +2 -2
- package/dist/lib/neutral/{create-project-3AGXJ4TD.mjs → create-project-LVIH4OLF.mjs} +7 -7
- package/dist/lib/neutral/{delete-J3PMWP7Z.mjs → delete-MRER3QMO.mjs} +3 -3
- package/dist/lib/neutral/{enable-blueprints-IVKST3WH.mjs → enable-blueprints-GEIKTSRV.mjs} +10 -10
- package/dist/lib/neutral/enable-blueprints-GEIKTSRV.mjs.map +7 -0
- package/dist/lib/neutral/{fetch-KHMHV7JR.mjs → fetch-B2AYJK7F.mjs} +2 -2
- package/dist/lib/neutral/{fetch-messages-QOBBCTGC.mjs → fetch-messages-RUUU63L2.mjs} +2 -2
- package/dist/lib/neutral/{get-context-FBYWIP72.mjs → get-context-3SXNFRXG.mjs} +9 -9
- package/dist/lib/neutral/{get-context-FBYWIP72.mjs.map → get-context-3SXNFRXG.mjs.map} +3 -3
- package/dist/lib/neutral/index.mjs +76 -77
- package/dist/lib/neutral/index.mjs.map +3 -3
- package/dist/lib/neutral/{load-GAT3T2AD.mjs → load-YWYQ4THR.mjs} +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{object-create-PL3WRP74.mjs → object-create-WME2XFGD.mjs} +9 -12
- package/dist/lib/neutral/object-create-WME2XFGD.mjs.map +7 -0
- package/dist/lib/neutral/{object-delete-PZJQN5KW.mjs → object-delete-I5OAPI32.mjs} +2 -2
- package/dist/lib/neutral/{object-update-R43N3VJX.mjs → object-update-VCOL62NX.mjs} +3 -3
- package/dist/lib/neutral/{object-update-R43N3VJX.mjs.map → object-update-VCOL62NX.mjs.map} +2 -2
- package/dist/lib/neutral/{project-VVXXUMAI.mjs → project-4BYI2PZC.mjs} +6 -6
- package/dist/lib/neutral/{project-rules-KSVSOZJV.mjs → project-rules-7NYDDQ7K.mjs} +5 -5
- package/dist/lib/neutral/{prompt-INL55Q2B.mjs → prompt-DZP2K2NE.mjs} +5 -5
- package/dist/lib/neutral/prompt-DZP2K2NE.mjs.map +7 -0
- package/dist/lib/neutral/{qualifier-DAF4H7V3.mjs → qualifier-NLOWVZCM.mjs} +8 -7
- package/dist/lib/neutral/qualifier-NLOWVZCM.mjs.map +7 -0
- package/dist/lib/neutral/{query-MP5NSQKO.mjs → query-GZDTQRQ6.mjs} +12 -22
- package/dist/lib/neutral/query-GZDTQRQ6.mjs.map +7 -0
- package/dist/lib/neutral/{query-U56GNEV6.mjs → query-KBKGBYUO.mjs} +3 -3
- package/dist/lib/neutral/{query-blueprints-PLWYVOI3.mjs → query-blueprints-MFXXRZBY.mjs} +5 -4
- package/dist/lib/neutral/query-blueprints-MFXXRZBY.mjs.map +7 -0
- package/dist/lib/neutral/{relation-create-YAAAFTR2.mjs → relation-create-UHBWQQXS.mjs} +8 -11
- package/dist/lib/neutral/relation-create-UHBWQQXS.mjs.map +7 -0
- package/dist/lib/neutral/{relation-delete-IEPKERFR.mjs → relation-delete-ZSB7JOHO.mjs} +2 -2
- package/dist/lib/neutral/{save-GWAPLT3Z.mjs → save-B2CSSFDG.mjs} +3 -3
- package/dist/lib/neutral/{schema-add-5BNIINRS.mjs → schema-add-ZJ64RAZK.mjs} +13 -12
- package/dist/lib/neutral/schema-add-ZJ64RAZK.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-3X3VNYYB.mjs +37 -0
- package/dist/lib/neutral/schema-list-3X3VNYYB.mjs.map +7 -0
- package/dist/lib/neutral/{sync-issues-DWY76B3M.mjs → sync-issues-36TS2R7R.mjs} +2 -2
- package/dist/lib/neutral/{sync-triggers-NOIQLELD.mjs → sync-triggers-MMHKQDNW.mjs} +37 -34
- package/dist/lib/neutral/sync-triggers-MMHKQDNW.mjs.map +7 -0
- package/dist/lib/neutral/{tag-add-NLVRGTC6.mjs → tag-add-7P5O3IAV.mjs} +4 -5
- package/dist/lib/neutral/tag-add-7P5O3IAV.mjs.map +7 -0
- package/dist/lib/neutral/{tag-remove-N4HFBIA2.mjs → tag-remove-YZIMOFA4.mjs} +4 -5
- package/dist/lib/neutral/tag-remove-YZIMOFA4.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +6 -9
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- package/dist/lib/neutral/update-tasks-6MJCJ2KC.mjs +13 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts +11 -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 -6
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +6 -5
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +1 -1
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts +1 -1
- package/dist/types/src/blueprints/database/functions/definitions.d.ts +20 -14
- 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-create.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 -2
- 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-add.d.ts.map +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 +6 -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 +6 -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/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/update-tasks.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/definitions.d.ts +50 -43
- package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +3 -75
- 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 +20 -20
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +1 -1
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +39 -40
- 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 +18 -18
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.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 +5 -6
- 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 +14 -22
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -1
- 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 +19 -20
- 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 +15 -17
- package/dist/types/src/types/Plan.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -30
- 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 +4 -51
- package/src/blueprints/blueprint-manager/blueprint.ts +5 -5
- package/src/blueprints/blueprint-manager/functions/definitions.ts +10 -19
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +8 -5
- package/src/blueprints/blueprint-manager/functions/index.ts +0 -1
- package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +3 -2
- package/src/blueprints/browser/blueprint.conversations.json +1 -0
- package/src/blueprints/browser/blueprint.test.ts +4 -3
- package/src/blueprints/database/blueprint.conversations.json +1 -1
- package/src/blueprints/database/blueprint.test.ts +25 -25
- package/src/blueprints/database/functions/definitions.ts +51 -37
- package/src/blueprints/database/functions/object-create.ts +8 -5
- package/src/blueprints/database/functions/object-update.ts +1 -1
- package/src/blueprints/database/functions/query.ts +15 -9
- package/src/blueprints/database/functions/relation-create.ts +7 -4
- package/src/blueprints/database/functions/schema-add.ts +7 -12
- package/src/blueprints/database/functions/schema-list.ts +12 -7
- package/src/blueprints/database/functions/tag-add.ts +2 -3
- package/src/blueprints/database/functions/tag-remove.ts +2 -3
- package/src/blueprints/discord/functions/definitions.ts +3 -1
- package/src/blueprints/github/functions/definitions.ts +3 -1
- package/src/blueprints/linear/functions/definitions.ts +3 -1
- package/src/blueprints/memory/blueprint.conversations.json +1 -1
- package/src/blueprints/memory/blueprint.test.ts +2 -2
- package/src/blueprints/memory/functions/definitions.ts +7 -3
- package/src/blueprints/planning/functions/update-tasks.test.ts +3 -3
- package/src/blueprints/planning/functions/update-tasks.ts +3 -1
- package/src/blueprints/project/blueprint.conversations.json +1 -1
- package/src/blueprints/project/blueprint.test.ts +5 -5
- package/src/blueprints/project/blueprint.ts +1 -1
- package/src/blueprints/project/functions/agent.ts +3 -3
- package/src/blueprints/project/functions/definitions.ts +13 -10
- package/src/blueprints/project/functions/get-context.ts +4 -4
- package/src/blueprints/project/functions/qualifier.ts +3 -2
- package/src/blueprints/project-wizard/blueprint.ts +1 -1
- package/src/blueprints/project-wizard/functions/definitions.ts +11 -8
- package/src/blueprints/project-wizard/functions/sync-triggers.ts +31 -28
- package/src/blueprints/websearch/blueprint.conversations.json +1 -1
- package/src/blueprints/websearch/functions/definitions.ts +3 -1
- package/src/crud/graph.ts +48 -56
- package/src/errors.ts +3 -3
- package/src/functions/agent/definitions.ts +4 -2
- package/src/functions/agent/prompt.conversations.json +1 -1
- package/src/functions/agent/prompt.test.ts +2 -2
- package/src/functions/agent/prompt.ts +2 -2
- package/src/sync/sync.ts +6 -4
- package/src/testing/plugins.tsx +9 -14
- package/src/types/Agent.ts +17 -23
- package/src/types/Chat.ts +10 -20
- package/src/types/McpServer.ts +4 -10
- package/src/types/Memory.ts +4 -7
- package/src/types/Plan.ts +4 -12
- package/dist/lib/neutral/chunk-5GPL2WXU.mjs.map +0 -7
- package/dist/lib/neutral/chunk-7UCYAP3T.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ANSF2BHN.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BCT55UTL.mjs.map +0 -7
- package/dist/lib/neutral/chunk-COL54UJ3.mjs.map +0 -7
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KGU725LW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KS3IA6FQ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-MMQ7HFL4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PLGEBNTO.mjs.map +0 -7
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +0 -7
- package/dist/lib/neutral/enable-blueprints-IVKST3WH.mjs.map +0 -7
- package/dist/lib/neutral/object-create-PL3WRP74.mjs.map +0 -7
- package/dist/lib/neutral/prompt-INL55Q2B.mjs.map +0 -7
- package/dist/lib/neutral/qualifier-DAF4H7V3.mjs.map +0 -7
- package/dist/lib/neutral/query-MP5NSQKO.mjs.map +0 -7
- package/dist/lib/neutral/query-blueprints-PLWYVOI3.mjs.map +0 -7
- package/dist/lib/neutral/relation-create-YAAAFTR2.mjs.map +0 -7
- package/dist/lib/neutral/schema-add-5BNIINRS.mjs.map +0 -7
- package/dist/lib/neutral/schema-list-54UK7S4R.mjs +0 -38
- package/dist/lib/neutral/schema-list-54UK7S4R.mjs.map +0 -7
- package/dist/lib/neutral/sync-triggers-NOIQLELD.mjs.map +0 -7
- package/dist/lib/neutral/tag-add-NLVRGTC6.mjs.map +0 -7
- package/dist/lib/neutral/tag-remove-N4HFBIA2.mjs.map +0 -7
- package/dist/lib/neutral/update-blueprints-2SNK6HLG.mjs +0 -16
- package/dist/lib/neutral/update-blueprints-2SNK6HLG.mjs.map +0 -7
- package/dist/lib/neutral/update-tasks-QQUR53RN.mjs +0 -13
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +0 -4
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts.map +0 -1
- package/src/blueprints/blueprint-manager/functions/update-blueprints.ts +0 -18
- /package/dist/lib/neutral/{add-artifact-4IVGW6CI.mjs.map → add-artifact-ADKF427P.mjs.map} +0 -0
- /package/dist/lib/neutral/{context-add-S5MBW2NA.mjs.map → context-add-2G2CDRCK.mjs.map} +0 -0
- /package/dist/lib/neutral/{context-remove-35O5T5N5.mjs.map → context-remove-QQOT57JC.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-project-3AGXJ4TD.mjs.map → create-project-LVIH4OLF.mjs.map} +0 -0
- /package/dist/lib/neutral/{delete-J3PMWP7Z.mjs.map → delete-MRER3QMO.mjs.map} +0 -0
- /package/dist/lib/neutral/{fetch-KHMHV7JR.mjs.map → fetch-B2AYJK7F.mjs.map} +0 -0
- /package/dist/lib/neutral/{fetch-messages-QOBBCTGC.mjs.map → fetch-messages-RUUU63L2.mjs.map} +0 -0
- /package/dist/lib/neutral/{load-GAT3T2AD.mjs.map → load-YWYQ4THR.mjs.map} +0 -0
- /package/dist/lib/neutral/{object-delete-PZJQN5KW.mjs.map → object-delete-I5OAPI32.mjs.map} +0 -0
- /package/dist/lib/neutral/{project-VVXXUMAI.mjs.map → project-4BYI2PZC.mjs.map} +0 -0
- /package/dist/lib/neutral/{project-rules-KSVSOZJV.mjs.map → project-rules-7NYDDQ7K.mjs.map} +0 -0
- /package/dist/lib/neutral/{query-U56GNEV6.mjs.map → query-KBKGBYUO.mjs.map} +0 -0
- /package/dist/lib/neutral/{relation-delete-IEPKERFR.mjs.map → relation-delete-ZSB7JOHO.mjs.map} +0 -0
- /package/dist/lib/neutral/{save-GWAPLT3Z.mjs.map → save-B2CSSFDG.mjs.map} +0 -0
- /package/dist/lib/neutral/{sync-issues-DWY76B3M.mjs.map → sync-issues-36TS2R7R.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-tasks-QQUR53RN.mjs.map → update-tasks-6MJCJ2KC.mjs.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AddArtifact
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T3RP4AUP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Agent_exports
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ALDU6VDG.mjs";
|
|
7
|
+
import "./chunk-GQRUBCMT.mjs";
|
|
8
|
+
import "./chunk-SOLG2NPH.mjs";
|
|
9
9
|
import "./chunk-J5LGTIGS.mjs";
|
|
10
10
|
|
|
11
11
|
// src/blueprints/project/functions/add-artifact.ts
|
|
@@ -27,4 +27,4 @@ var add_artifact_default = AddArtifact.pipe(Operation.withHandler(Effect.fnUntra
|
|
|
27
27
|
export {
|
|
28
28
|
add_artifact_default as default
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=add-artifact-
|
|
30
|
+
//# sourceMappingURL=add-artifact-ADKF427P.mjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentWorker
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T3RP4AUP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Agent_exports
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ALDU6VDG.mjs";
|
|
7
|
+
import "./chunk-GQRUBCMT.mjs";
|
|
8
|
+
import "./chunk-SOLG2NPH.mjs";
|
|
9
9
|
import "./chunk-J5LGTIGS.mjs";
|
|
10
10
|
|
|
11
11
|
// src/blueprints/project/functions/agent.ts
|
|
@@ -19,10 +19,10 @@ import { acquireReleaseResource } from "@dxos/effect";
|
|
|
19
19
|
import { invariant } from "@dxos/invariant";
|
|
20
20
|
var __dxlog_file = "/__w/dxos/dxos/packages/core/compute/assistant-toolkit/src/blueprints/project/functions/agent.ts";
|
|
21
21
|
var agent_default = AgentWorker.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ agent: agentRef, prompt, event }) {
|
|
22
|
-
const agent = yield* Database.load(agentRef).pipe(Effect.catchTag("
|
|
22
|
+
const agent = yield* Database.load(agentRef).pipe(Effect.catchTag("EntityNotFoundError", () => Effect.die(new Error("Unable to load agent object."))));
|
|
23
23
|
invariant(Obj.instanceOf(Agent_exports.Agent, agent), void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 16, S: this, A: ["Obj.instanceOf(Agent.Agent, agent)", ""] });
|
|
24
24
|
invariant(agent.chat, "Agent has no chat.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 17, S: this, A: ["agent.chat", "'Agent has no chat.'"] });
|
|
25
|
-
const chatFeed = yield* agent.chat.pipe(Database.load, Effect.flatMap((chat) => Database.load(chat.feed)), Effect.catchTag("
|
|
25
|
+
const chatFeed = yield* agent.chat.pipe(Database.load, Effect.flatMap((chat) => Database.load(chat.feed)), Effect.catchTag("EntityNotFoundError", () => Effect.die(new Error("Unable to load agent chat feed object."))));
|
|
26
26
|
invariant(chatFeed, "Agent chat feed not found.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 19, S: this, A: ["chatFeed", "'Agent chat feed not found.'"] });
|
|
27
27
|
const runtime2 = yield* Effect.runtime();
|
|
28
28
|
const session = yield* acquireReleaseResource(() => new AiSession.Session({
|
|
@@ -54,7 +54,7 @@ var agent_default = AgentWorker.pipe(Operation.withHandler(Effect.fnUntraced(fun
|
|
|
54
54
|
yield* session.createRequest({
|
|
55
55
|
prompt: input
|
|
56
56
|
}).pipe(Effect.provide(Layer.mergeAll(AiService.model("@anthropic/claude-opus-4-6"), ToolExecutionServices).pipe(Layer.provideMerge(Operation.withInvocationOptions({
|
|
57
|
-
conversation: Obj.
|
|
57
|
+
conversation: Obj.getURI(chatFeed)
|
|
58
58
|
})))), Effect.retry({
|
|
59
59
|
times: 2
|
|
60
60
|
}));
|
|
@@ -62,4 +62,4 @@ var agent_default = AgentWorker.pipe(Operation.withHandler(Effect.fnUntraced(fun
|
|
|
62
62
|
export {
|
|
63
63
|
agent_default as default
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=agent-
|
|
65
|
+
//# sourceMappingURL=agent-4HT4GKKI.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/blueprints/project/functions/agent.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport { AiService } from '@dxos/ai';\nimport { AiSession, ToolExecutionServices } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database, Feed, Obj } from '@dxos/echo';\nimport { acquireReleaseResource } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\nimport { ContentBlock } from '@dxos/types';\n\nimport { Agent } from '../../../types';\nimport { AgentWorker } from './definitions';\n\nexport default AgentWorker.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ agent: agentRef, prompt, event }) {\n const agent = yield* Database.load(agentRef).pipe(\n Effect.catchTag('
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AAEvB,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,6BAA6B;AACjD,SAASC,iBAAiB;AAC1B,SAASC,UAAgBC,WAAW;AACpC,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAM1B,IAAA,eAAeC;IAMTC,gBAAUC,YAAIC,KAAWC,UAAaC,YAAAA,kBAAAA,WAAAA,EAAAA,OAAAA,UAAAA,QAAAA,MAAAA,GAAAA;AACtCJ,QAAAA,QAAUI,OAAU,SAAE,KAAA,QAAA,EAAA,KAAA,gBAAA,uBAAA,MAAA,WAAA,IAAA,MAAA,8BAAA,CAAA,CAAA,CAAA;AAEtB,YAAMC,IAAAA,WAAkBD,cAAME,OAAKC,KACjCC,GAAAA,QAASC,EAAI,YACNC,YAASJ,GAAAA,cAAkBG,GAAKH,IAAAA,GAAKK,MAAI,GAAA,CAChDC,sCAAgB,EAAuB,EAAA,CAAA;AAEzCZ,YAAUK,MAAAA,MAAU,sBAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,cAAA,sBAAA,EAAA,CAAA;AACpB,QAAMQ,WAAU,OAAOD,MAAOC,KAAAA,KAAO,SAAA,MAAA,eAAA,CAAA,SAAA,SAAA,KAAA,KAAA,IAAA,CAAA,GAAA,gBAAA,uBAAA,MAAA,WAAA,IAAA,MAAA,wCAAA,CAAA,CAAA,CAAA;AACrC,YAAMC,UAAU,8BAA8B,EAAM,YAAIC,YAAkB,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,YAAA,8BAAA,EAAA,CAAA;mBAAQV,OAAAA,eAAAA;kBAAUQ,OAAAA,uBAAAA,MAAAA,IAAAA,UAAAA,QAAAA;IAAQ,MAAA;IAE9FG,SAAAA;EACFA,CAAAA,CAAAA;QACF,kBAAgB,QAAA,QAAA,WAAA,EAAA,OAAA,IAAA,WAAA,cAAwDA,KAAAA,CAAAA;AAC1E,MAAA,gBAAA,WAAA,GAAA;AAEI,UAACC,IAAAA,MAAWC,wDAAO,gBAAA,MAAA;;AAEvB,MAAA,CAAA,UAAA,CAAA,OAAA;AAEIC,UAAAA,IAA8B,MAAA,0CAAA;EAClC;MACEA,QAAMC,CAAAA;cAAOC;UAAcC,KAAML;MAAQM,MAAAA;MAAyB,MAAA;MACpE,aAAA;IACIL,CAAAA;;aACWG;UAAcC,KAAME;MAAuBD,MAAAA;MAAyB,MAAA,KAAA,UAAA,KAAA;MACnF,aAAA;IAEA,CAAA;;AAGE,SACK,QACIE,cACCC;IACiDC,QAAAA;
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport { AiService } from '@dxos/ai';\nimport { AiSession, ToolExecutionServices } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database, Feed, Obj } from '@dxos/echo';\nimport { acquireReleaseResource } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\nimport { ContentBlock } from '@dxos/types';\n\nimport { Agent } from '../../../types';\nimport { AgentWorker } from './definitions';\n\nexport default AgentWorker.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ agent: agentRef, prompt, event }) {\n const agent = yield* Database.load(agentRef).pipe(\n Effect.catchTag('EntityNotFoundError', () => Effect.die(new Error('Unable to load agent object.'))),\n );\n invariant(Obj.instanceOf(Agent.Agent, agent));\n invariant(agent.chat, 'Agent has no chat.');\n\n const chatFeed = yield* agent.chat.pipe(\n Database.load,\n Effect.flatMap((chat) => Database.load(chat.feed)),\n Effect.catchTag('EntityNotFoundError', () => Effect.die(new Error('Unable to load agent chat feed object.'))),\n );\n invariant(chatFeed, 'Agent chat feed not found.');\n const runtime = yield* Effect.runtime<Feed.FeedService>();\n const session = yield* acquireReleaseResource(() => new AiSession.Session({ feed: chatFeed, runtime }));\n\n const agentsInContext = session.context.getObjects().filter(Obj.instanceOf(Agent.Agent));\n if (agentsInContext.length !== 1) {\n throw new Error('There should be exactly one agent in context. Got: ' + agentsInContext.length);\n }\n\n if (!prompt && !event) {\n throw new Error('Either prompt or event must be provided.');\n }\n\n let input: ContentBlock.Any[] = [];\n if (prompt) {\n input.push({ _tag: 'text', text: prompt, disposition: 'synthetic' });\n }\n if (event) {\n input.push({ _tag: 'text', text: JSON.stringify(event), disposition: 'synthetic' });\n }\n\n yield* session\n .createRequest({\n prompt: input,\n })\n .pipe(\n Effect.provide(\n Layer.mergeAll(AiService.model('@anthropic/claude-opus-4-6'), ToolExecutionServices).pipe(\n Layer.provideMerge(Operation.withInvocationOptions({ conversation: Obj.getURI(chatFeed) })),\n ),\n ),\n Effect.retry({ times: 2 }),\n );\n }, Effect.scoped),\n ),\n Operation.opaqueHandler,\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AAEvB,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,6BAA6B;AACjD,SAASC,iBAAiB;AAC1B,SAASC,UAAgBC,WAAW;AACpC,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAM1B,IAAA,eAAeC;IAMTC,gBAAUC,YAAIC,KAAWC,UAAaC,YAAAA,kBAAAA,WAAAA,EAAAA,OAAAA,UAAAA,QAAAA,MAAAA,GAAAA;AACtCJ,QAAAA,QAAUI,OAAU,SAAE,KAAA,QAAA,EAAA,KAAA,gBAAA,uBAAA,MAAA,WAAA,IAAA,MAAA,8BAAA,CAAA,CAAA,CAAA;AAEtB,YAAMC,IAAAA,WAAkBD,cAAME,OAAKC,KACjCC,GAAAA,QAASC,EAAI,YACNC,YAASJ,GAAAA,cAAkBG,GAAKH,IAAAA,GAAKK,MAAI,GAAA,CA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jB,OAAOkB;;;",
|
|
6
6
|
"names": ["Effect", "Layer", "AiService", "AiSession", "ToolExecutionServices", "Operation", "Database", "Obj", "acquireReleaseResource", "invariant", "AgentWorker", "invariant", "Obj", "instanceOf", "Agent", "agent", "chatFeed", "chat", "pipe", "Database", "load", "flatMap", "feed", "Effect", "runtime", "session", "AiSession", "agentsInContext", "prompt", "event", "input", "push", "_tag", "text", "disposition", "JSON", "provide", "mergeAll", "conversation", "retry", "times", "scoped"]
|
|
7
7
|
}
|
|
@@ -2,24 +2,27 @@
|
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
import { AiContext } from "@dxos/assistant";
|
|
4
4
|
import { Blueprint, Operation } from "@dxos/compute";
|
|
5
|
-
import { Database } from "@dxos/echo";
|
|
5
|
+
import { Database, Registry, Type } from "@dxos/echo";
|
|
6
|
+
import { DXN } from "@dxos/keys";
|
|
6
7
|
var QueryBlueprints = Operation.make({
|
|
7
8
|
meta: {
|
|
8
|
-
key: "org.dxos.function.
|
|
9
|
+
key: DXN.make("org.dxos.function.blueprintManager.queryBlueprints"),
|
|
9
10
|
name: "Query blueprints",
|
|
10
|
-
description: "Queries available blueprints."
|
|
11
|
+
description: "Queries available blueprints.",
|
|
12
|
+
icon: "ph--blueprint--regular"
|
|
11
13
|
},
|
|
12
14
|
input: Schema.Struct({}),
|
|
13
|
-
output: Schema.Array(Blueprint.Blueprint),
|
|
15
|
+
output: Schema.Array(Type.getSchema(Blueprint.Blueprint)),
|
|
14
16
|
services: [
|
|
15
|
-
|
|
17
|
+
Registry.Service
|
|
16
18
|
]
|
|
17
19
|
});
|
|
18
20
|
var EnableBlueprints = Operation.make({
|
|
19
21
|
meta: {
|
|
20
|
-
key: "org.dxos.function.
|
|
22
|
+
key: DXN.make("org.dxos.function.blueprintManager.enableBlueprints"),
|
|
21
23
|
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."
|
|
24
|
+
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.",
|
|
25
|
+
icon: "ph--plugs-connected--regular"
|
|
23
26
|
},
|
|
24
27
|
input: Schema.Struct({
|
|
25
28
|
keys: Schema.Array(Schema.String).annotations({
|
|
@@ -33,35 +36,21 @@ var EnableBlueprints = Operation.make({
|
|
|
33
36
|
})
|
|
34
37
|
}),
|
|
35
38
|
output: Schema.Struct({
|
|
36
|
-
enabled: Schema.Array(Blueprint.Blueprint),
|
|
39
|
+
enabled: Schema.Array(Type.getSchema(Blueprint.Blueprint)),
|
|
37
40
|
rejected: Schema.Array(Schema.Struct({
|
|
38
41
|
key: Schema.String,
|
|
39
42
|
reason: Schema.String
|
|
40
43
|
}))
|
|
41
44
|
}),
|
|
42
45
|
services: [
|
|
43
|
-
|
|
46
|
+
Registry.Service,
|
|
44
47
|
Database.Service,
|
|
45
48
|
AiContext.Service
|
|
46
49
|
]
|
|
47
50
|
});
|
|
48
|
-
var UpdateBlueprints = Operation.make({
|
|
49
|
-
meta: {
|
|
50
|
-
key: "org.dxos.function.blueprint-manager.refresh-blueprints",
|
|
51
|
-
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."
|
|
53
|
-
},
|
|
54
|
-
input: Schema.Struct({}),
|
|
55
|
-
output: Schema.Void,
|
|
56
|
-
services: [
|
|
57
|
-
Blueprint.RegistryService,
|
|
58
|
-
Database.Service
|
|
59
|
-
]
|
|
60
|
-
});
|
|
61
51
|
|
|
62
52
|
export {
|
|
63
53
|
QueryBlueprints,
|
|
64
|
-
EnableBlueprints
|
|
65
|
-
UpdateBlueprints
|
|
54
|
+
EnableBlueprints
|
|
66
55
|
};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-3ZDYN7BG.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, Registry, Type } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nexport const QueryBlueprints = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.blueprintManager.queryBlueprints'),\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: [Registry.Service],\n});\n\nexport const EnableBlueprints = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.blueprintManager.enableBlueprints'),\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: [Registry.Service, Database.Service, AiContext.Service],\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,iBAAiB;AACrC,SAASC,UAAUC,UAAUC,YAAY;AACzC,SAASC,WAAW;AAEb,IAAMC,kBAAkBL,UAAUM,KAAK;EAC5CC,MAAM;IACJC,KAAKJ,IAAIE,KAAK,oDAAA;IACdG,MAAM;IACNC,aAAa;IACbC,MAAM;EACR;EACAC,OAAcC,cAAO,CAAC,CAAA;EACtBC,QAAeC,aAAMZ,KAAKa,UAAUjB,UAAUA,SAAS,CAAA;EACvDkB,UAAU;IAACf,SAASgB;;AACtB,CAAA;AAEO,IAAMC,mBAAmBnB,UAAUM,KAAK;EAC7CC,MAAM;IACJC,KAAKJ,IAAIE,KAAK,qDAAA;IACdG,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,aAAMZ,KAAKa,UAAUjB,UAAUA,SAAS,CAAA;IACxD0B,UAAiBV,aACRF,cAAO;MACZL,KAAYa;MACZK,QAAeL;IACjB,CAAA,CAAA;EAEJ,CAAA;EACAJ,UAAU;IAACf,SAASgB;IAASjB,SAASiB;IAASpB,UAAUoB;;AAC3D,CAAA;",
|
|
6
|
+
"names": ["Schema", "AiContext", "Blueprint", "Operation", "Database", "Registry", "Type", "DXN", "QueryBlueprints", "make", "meta", "key", "name", "description", "icon", "input", "Struct", "output", "Array", "getSchema", "services", "Service", "EnableBlueprints", "keys", "String", "annotations", "examples", "enabled", "rejected", "reason"]
|
|
7
|
+
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Memory
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SOLG2NPH.mjs";
|
|
4
4
|
|
|
5
5
|
// src/blueprints/memory/functions/definitions.ts
|
|
6
6
|
import * as Schema from "effect/Schema";
|
|
7
7
|
import { Operation } from "@dxos/compute";
|
|
8
8
|
import { Database, Ref } from "@dxos/echo";
|
|
9
|
+
import { DXN } from "@dxos/keys";
|
|
9
10
|
var QueryMemories = Operation.make({
|
|
10
11
|
meta: {
|
|
11
|
-
key: "org.dxos.function.memory.query",
|
|
12
|
+
key: DXN.make("org.dxos.function.memory.query"),
|
|
12
13
|
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."
|
|
14
|
+
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.",
|
|
15
|
+
icon: "ph--brain--regular"
|
|
14
16
|
},
|
|
15
17
|
input: Schema.Struct({
|
|
16
18
|
text: Schema.optional(Schema.String.annotations({
|
|
@@ -33,9 +35,10 @@ var QueryMemories = Operation.make({
|
|
|
33
35
|
});
|
|
34
36
|
var SaveMemory = Operation.make({
|
|
35
37
|
meta: {
|
|
36
|
-
key: "org.dxos.function.memory.save",
|
|
38
|
+
key: DXN.make("org.dxos.function.memory.save"),
|
|
37
39
|
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."
|
|
40
|
+
description: "Saves a new memory to the database. Use this to persist knowledge, facts, preferences, or any information that should be remembered across conversations.",
|
|
41
|
+
icon: "ph--brain--regular"
|
|
39
42
|
},
|
|
40
43
|
input: Schema.Struct({
|
|
41
44
|
title: Schema.String.annotations({
|
|
@@ -52,9 +55,10 @@ var SaveMemory = Operation.make({
|
|
|
52
55
|
});
|
|
53
56
|
var DeleteMemory = Operation.make({
|
|
54
57
|
meta: {
|
|
55
|
-
key: "org.dxos.function.memory.delete",
|
|
58
|
+
key: DXN.make("org.dxos.function.memory.delete"),
|
|
56
59
|
name: "Delete memory",
|
|
57
|
-
description: "Deletes a memory from the database. Use this to remove outdated or incorrect memories."
|
|
60
|
+
description: "Deletes a memory from the database. Use this to remove outdated or incorrect memories.",
|
|
61
|
+
icon: "ph--trash--regular"
|
|
58
62
|
},
|
|
59
63
|
input: Schema.Struct({
|
|
60
64
|
memory: Ref.Ref(Memory)
|
|
@@ -70,4 +74,4 @@ export {
|
|
|
70
74
|
SaveMemory,
|
|
71
75
|
DeleteMemory
|
|
72
76
|
};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
77
|
+
//# sourceMappingURL=chunk-53BZWMRB.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';\nimport { DXN } from '@dxos/keys';\n\nimport { Memory } from '../../../types/Memory';\n\nexport const QueryMemories = Operation.make({\n meta: {\n key: DXN.make('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: DXN.make('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: DXN.make('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;AAC9B,SAASC,WAAW;AAIb,IAAMC,gBAAgBC,UAAUC,KAAK;EAC1CC,MAAM;IACJC,KAAKC,IAAIH,KAAK,gCAAA;IACdI,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,aAAaxB,UAAUC,KAAK;EACvCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,+BAAA;IACdI,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,eAAe3B,UAAUC,KAAK;EACzCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,iCAAA;IACdI,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", "DXN", "QueryMemories", "Operation", "make", "meta", "key", "DXN", "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
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// src/blueprints/websearch/functions/definitions.ts
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
import { Operation } from "@dxos/compute";
|
|
4
|
+
import { DXN } from "@dxos/keys";
|
|
4
5
|
import { trim } from "@dxos/util";
|
|
5
6
|
var Fetch = Operation.make({
|
|
6
7
|
meta: {
|
|
7
|
-
key: "org.dxos.function.web-search.fetch",
|
|
8
|
+
key: DXN.make("org.dxos.function.web-search.fetch"),
|
|
8
9
|
name: "Fetch web page",
|
|
10
|
+
icon: "ph--globe-simple--regular",
|
|
9
11
|
description: trim`
|
|
10
12
|
Fetches the content of a web page and returns the HTML.
|
|
11
13
|
Use this to get the content of a web page.
|
|
@@ -22,4 +24,4 @@ var Fetch = Operation.make({
|
|
|
22
24
|
export {
|
|
23
25
|
Fetch
|
|
24
26
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-6SYN5IV3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/websearch/functions/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation } from '@dxos/compute';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const Fetch = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.web-search.fetch'),\n name: 'Fetch web page',\n icon: 'ph--globe-simple--regular',\n description: trim`\n Fetches the content of a web page and returns the HTML. \n Use this to get the content of a web page.\n `,\n },\n input: Schema.Struct({\n url: Schema.String.annotations({\n description: 'The URL of the web page to fetch.',\n }),\n }),\n output: Schema.String,\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,QAAQH,UAAUI,KAAK;EAClCC,MAAM;IACJC,KAAKL,IAAIG,KAAK,oCAAA;IACdG,MAAM;IACNC,MAAM;IACNC,aAAaP;;;;EAIf;EACAQ,OAAcC,cAAO;IACnBC,KAAYC,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;EACF,CAAA;EACAM,QAAeF;AACjB,CAAA;",
|
|
6
|
+
"names": ["Schema", "Operation", "DXN", "trim", "Fetch", "make", "meta", "key", "name", "icon", "description", "input", "Struct", "url", "String", "annotations", "output"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AddArtifact
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T3RP4AUP.mjs";
|
|
4
4
|
|
|
5
5
|
// src/blueprints/project/blueprint.ts
|
|
6
6
|
import { Blueprint, Template } from "@dxos/compute";
|
|
@@ -8,7 +8,7 @@ import { trim } from "@dxos/util";
|
|
|
8
8
|
|
|
9
9
|
// src/blueprints/project/functions/index.ts
|
|
10
10
|
import { OperationHandlerSet } from "@dxos/compute";
|
|
11
|
-
var AgentBlueprintHandlers = OperationHandlerSet.lazy(() => import("./add-artifact-
|
|
11
|
+
var AgentBlueprintHandlers = OperationHandlerSet.lazy(() => import("./add-artifact-ADKF427P.mjs"), () => import("./agent-4HT4GKKI.mjs"), () => import("./get-context-3SXNFRXG.mjs"), () => import("./qualifier-NLOWVZCM.mjs"));
|
|
12
12
|
|
|
13
13
|
// src/blueprints/project/blueprint.ts
|
|
14
14
|
var BLUEPRINT_KEY = "org.dxos.blueprint.agent";
|
|
@@ -47,7 +47,7 @@ var make = () => Blueprint.make({
|
|
|
47
47
|
{
|
|
48
48
|
name: "agent",
|
|
49
49
|
kind: "operation",
|
|
50
|
-
operation: "org.dxos.function.agent.
|
|
50
|
+
operation: "org.dxos.function.agent.getContext"
|
|
51
51
|
}
|
|
52
52
|
]
|
|
53
53
|
}),
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
AgentBlueprintHandlers,
|
|
68
68
|
blueprint_default
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-7OQIX2PP.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/blueprints/project/blueprint.ts", "../../../src/blueprints/project/functions/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { AddArtifact } from './functions';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.agent';\n\n/**\n * Creates the Agent blueprint. This is a function to avoid circular dependency issues.\n */\n// TODO(dmaretskyi): Combine with Agent Wizard.\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Agent blueprint',\n instructions: Template.make({\n source: trim`\n You work on an agent. Each agent has instructions - the goal of the agent.\n The agent plan shows the current progress of the agent.\n Agent has a number of associated artifacts you can read/write.\n You can edit them if necessary.\n\n IMPORTANT: When creating a new artifact, always add it to the agent using the add-artifact function.\n\n {{#with agent}}\n <agent id=\"{{id}}\" name=\"{{name}}\">\n <instructions>\n {{instructions}}\n </instructions>\n <plan>\n {{plan}}\n </plan>\n\n <artifacts>\n {{#each artifacts}}\n <artifact type=\"{{type}}\" dxn=\"{{dxn}}\">\n {{name}}\n </artifact>\n {{/each}}\n </artifacts>\n </agent>\n {{/with}}\n `,\n inputs: [\n {\n name: 'agent',\n kind: 'operation',\n operation: 'org.dxos.function.agent.
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { AddArtifact } from './functions';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.agent';\n\n/**\n * Creates the Agent blueprint. This is a function to avoid circular dependency issues.\n */\n// TODO(dmaretskyi): Combine with Agent Wizard.\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Agent blueprint',\n instructions: Template.make({\n source: trim`\n You work on an agent. Each agent has instructions - the goal of the agent.\n The agent plan shows the current progress of the agent.\n Agent has a number of associated artifacts you can read/write.\n You can edit them if necessary.\n\n IMPORTANT: When creating a new artifact, always add it to the agent using the add-artifact function.\n\n {{#with agent}}\n <agent id=\"{{id}}\" name=\"{{name}}\">\n <instructions>\n {{instructions}}\n </instructions>\n <plan>\n {{plan}}\n </plan>\n\n <artifacts>\n {{#each artifacts}}\n <artifact type=\"{{type}}\" dxn=\"{{dxn}}\">\n {{name}}\n </artifact>\n {{/each}}\n </artifacts>\n </agent>\n {{/with}}\n `,\n inputs: [\n {\n name: 'agent',\n kind: 'operation',\n operation: 'org.dxos.function.agent.getContext',\n },\n ],\n }),\n tools: Blueprint.toolDefinitions({ operations: [AddArtifact] }),\n });\n\nconst blueprint: Blueprint.Definition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport * from './definitions';\n\nexport const AgentBlueprintHandlers = OperationHandlerSet.lazy(\n () => import('./add-artifact'),\n () => import('./agent'),\n () => import('./get-context'),\n () => import('./qualifier'),\n);\n"],
|
|
5
5
|
"mappings": ";;;;;AAIA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;;;ACDrB,SAASC,2BAA2B;AAI7B,IAAMC,yBAAyBD,oBAAoBE,KACxD,MAAM,OAAO,6BAAA,GACb,MAAM,OAAO,sBAAA,GACb,MAAM,OAAO,4BAAA,GACb,MAAM,OAAO,0BAAA,CAAA;;;ADHf,IAAMC,gBAAgB;AAMtB,IAAMC,OAAO,MACXC,UAAUD,KAAK;EACbE,KAAKH;EACLI,MAAM;EACNC,cAAcC,SAASL,KAAK;IAC1BM,QAAQC;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BRC,QAAQ;MACN;QACEL,MAAM;QACNM,MAAM;QACNC,WAAW;MACb;;EAEJ,CAAA;EACAC,OAAOV,UAAUW,gBAAgB;IAAEC,YAAY;MAACC;;EAAa,CAAA;AAC/D,CAAA;AAEF,IAAMC,YAAkC;EACtCb,KAAKH;EACLC;AACF;AAEA,IAAA,oBAAee;",
|
|
6
6
|
"names": ["Blueprint", "Template", "trim", "OperationHandlerSet", "AgentBlueprintHandlers", "lazy", "BLUEPRINT_KEY", "make", "Blueprint", "key", "name", "instructions", "Template", "source", "trim", "inputs", "kind", "operation", "tools", "toolDefinitions", "operations", "AddArtifact", "blueprint"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Chat,
|
|
3
3
|
CompanionTo,
|
|
4
4
|
make
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GQRUBCMT.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__export
|
|
8
8
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -19,7 +19,7 @@ __export(Plan_exports, {
|
|
|
19
19
|
makePlan: () => makePlan
|
|
20
20
|
});
|
|
21
21
|
import * as Schema from "effect/Schema";
|
|
22
|
-
import { Annotation, Obj, Ref, Type } from "@dxos/echo";
|
|
22
|
+
import { DXN, Annotation, Obj, Ref, Type } from "@dxos/echo";
|
|
23
23
|
var TaskId = Schema.String.pipe(Schema.brand("@dxos/assistant-toolkit/TaskId"));
|
|
24
24
|
var Task = Schema.Struct({
|
|
25
25
|
/**
|
|
@@ -43,10 +43,7 @@ var Task = Schema.Struct({
|
|
|
43
43
|
});
|
|
44
44
|
var Plan = Schema.Struct({
|
|
45
45
|
tasks: Schema.Array(Task)
|
|
46
|
-
}).pipe(Type.
|
|
47
|
-
typename: "org.dxos.type.plan",
|
|
48
|
-
version: "0.1.0"
|
|
49
|
-
}), Annotation.SystemTypeAnnotation.set(true));
|
|
46
|
+
}).pipe(Annotation.HiddenAnnotation.set(true), Type.makeObject(DXN.make("org.dxos.type.plan", "0.1.0")));
|
|
50
47
|
var generateTaskId = (plan) => {
|
|
51
48
|
const existingIds = plan.tasks.map((task) => {
|
|
52
49
|
const [num, letter] = task.id.split("-");
|
|
@@ -96,7 +93,7 @@ import * as Effect from "effect/Effect";
|
|
|
96
93
|
import * as Function from "effect/Function";
|
|
97
94
|
import * as Schema2 from "effect/Schema";
|
|
98
95
|
import { AiContext } from "@dxos/assistant";
|
|
99
|
-
import { Annotation as Annotation2, Database, Feed, Format, Obj as Obj2, Ref as Ref2, Relation, Type as Type2 } from "@dxos/echo";
|
|
96
|
+
import { DXN as DXN2, Annotation as Annotation2, Database, Feed, Format, Obj as Obj2, Ref as Ref2, Relation, Type as Type2 } from "@dxos/echo";
|
|
100
97
|
import { FormInputAnnotation } from "@dxos/echo/internal";
|
|
101
98
|
import { acquireReleaseResource } from "@dxos/effect";
|
|
102
99
|
import { invariant } from "@dxos/invariant";
|
|
@@ -163,17 +160,14 @@ var Agent = Schema2.Struct({
|
|
|
163
160
|
* @deprecated Subscriptions will write directly to the agent.
|
|
164
161
|
*/
|
|
165
162
|
feed: Schema2.optional(Ref2.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false)))
|
|
166
|
-
}).pipe(
|
|
167
|
-
typename: "org.dxos.type.agent",
|
|
168
|
-
version: "0.1.0"
|
|
169
|
-
}), Annotation2.LabelAnnotation.set([
|
|
163
|
+
}).pipe(Annotation2.LabelAnnotation.set([
|
|
170
164
|
"name"
|
|
171
165
|
]), Annotation2.IconAnnotation.set({
|
|
172
166
|
icon: "ph--drone--regular",
|
|
173
167
|
hue: "sky"
|
|
174
|
-
}));
|
|
168
|
+
}), Type2.makeObject(DXN2.make("org.dxos.type.agent", "0.1.0")));
|
|
175
169
|
var makeInitialized = (props, blueprint) => Effect.gen(function* () {
|
|
176
|
-
const agent = Obj2.make(Agent, {
|
|
170
|
+
const agent = yield* Database.add(Obj2.make(Agent, {
|
|
177
171
|
...props,
|
|
178
172
|
instructions: Ref2.make(Text.make({
|
|
179
173
|
content: props.instructions
|
|
@@ -185,8 +179,7 @@ var makeInitialized = (props, blueprint) => Effect.gen(function* () {
|
|
|
185
179
|
subscriptions: props.subscriptions ?? [],
|
|
186
180
|
filterEvents: props.filterEvents ?? true,
|
|
187
181
|
enabled: props.enabled ?? true
|
|
188
|
-
});
|
|
189
|
-
yield* Database.add(agent);
|
|
182
|
+
}));
|
|
190
183
|
const feed = yield* Database.add(Feed.make());
|
|
191
184
|
const runtime2 = yield* Effect.runtime();
|
|
192
185
|
const contextBinder = new AiContext.Binder({
|
|
@@ -223,7 +216,7 @@ var makeInitialized = (props, blueprint) => Effect.gen(function* () {
|
|
|
223
216
|
return agent;
|
|
224
217
|
});
|
|
225
218
|
var resetChatHistory = (agent) => Effect.gen(function* () {
|
|
226
|
-
invariant(agent.chat, "Agent must have an existing chat to reset.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L:
|
|
219
|
+
invariant(agent.chat, "Agent must have an existing chat to reset.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 141, S: this, A: ["agent.chat", "'Agent must have an existing chat to reset.'"] });
|
|
227
220
|
const existingFeed = yield* agent.chat.pipe(Database.load).pipe(Effect.map((_) => _.feed), Effect.flatMap(Database.load));
|
|
228
221
|
const runtime2 = yield* Effect.runtime();
|
|
229
222
|
const existingContextBinder = yield* acquireReleaseResource(() => new AiContext.Binder({
|
|
@@ -269,24 +262,21 @@ __export(McpServer_exports, {
|
|
|
269
262
|
});
|
|
270
263
|
import * as Schema3 from "effect/Schema";
|
|
271
264
|
import { McpServer as McpServerSpec } from "@dxos/compute";
|
|
272
|
-
import { Annotation as Annotation3, Type as Type3 } from "@dxos/echo";
|
|
265
|
+
import { DXN as DXN3, Annotation as Annotation3, Type as Type3 } from "@dxos/echo";
|
|
273
266
|
import { LabelAnnotation } from "@dxos/echo/internal";
|
|
274
267
|
var McpServer = Schema3.Struct({
|
|
275
268
|
...McpServerSpec.McpServer.fields,
|
|
276
269
|
enabled: Schema3.optional(Schema3.Boolean)
|
|
277
|
-
}).pipe(
|
|
278
|
-
typename: "org.dxos.type.assistant.mcpServer",
|
|
279
|
-
version: "0.1.0"
|
|
280
|
-
}), LabelAnnotation.set([
|
|
270
|
+
}).pipe(LabelAnnotation.set([
|
|
281
271
|
"name"
|
|
282
272
|
]), Annotation3.IconAnnotation.set({
|
|
283
273
|
icon: "ph--plugs-connected--regular",
|
|
284
274
|
hue: "sky"
|
|
285
|
-
}));
|
|
275
|
+
}), Type3.makeObject(DXN3.make("org.dxos.type.assistant.mcpServer", "0.1.0")));
|
|
286
276
|
|
|
287
277
|
export {
|
|
288
278
|
Plan_exports,
|
|
289
279
|
Agent_exports,
|
|
290
280
|
McpServer_exports
|
|
291
281
|
};
|
|
292
|
-
//# sourceMappingURL=chunk-
|
|
282
|
+
//# sourceMappingURL=chunk-ALDU6VDG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/Plan.ts", "../../../src/types/Agent.ts", "../../../src/types/McpServer.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN, Annotation, Obj, Ref, Type } from '@dxos/echo';\n\nimport * as Chat from './Chat';\n\nexport const TaskId = Schema.String.pipe(Schema.brand('@dxos/assistant-toolkit/TaskId'));\nexport type TaskId = Schema.Schema.Type<typeof TaskId>;\n\nexport const Task = Schema.Struct({\n /**\n * Short task ID unique within the plan.\n */\n id: TaskId,\n\n title: Schema.String.annotations({\n description: 'Task title and description.',\n }),\n\n status: Schema.Literal('todo', 'in-progress', 'done'),\n\n /**\n * Parent task ID.\n */\n parent: Schema.optional(TaskId).annotations({\n description: 'Parent task ID.',\n }),\n\n /**\n * Chat object that this task is associated with.\n */\n chat: Schema.optional(Ref.Ref(Chat.Chat)),\n});\n\nexport type Task = Schema.Schema.Type<typeof Task>;\n/**\n * Hierarchical collection of tasks for humans and agents to track progress.\n */\nexport const Plan = Schema.Struct({\n tasks: Schema.Array(Task),\n}).pipe(Annotation.HiddenAnnotation.set(true), Type.makeObject(DXN.make('org.dxos.type.plan', '0.1.0')));\nexport type Plan = Type.InstanceType<typeof Plan>;\nexport const generateTaskId = (plan: Plan): TaskId => {\n const existingIds = plan.tasks\n .map((task) => {\n const [num, letter] = task.id.split('-');\n return parseInt(num);\n })\n .filter((_) => !isNaN(_));\n let newId;\n if (existingIds.length === 0) {\n newId = 1;\n } else {\n newId = Math.max(...existingIds) + 1;\n }\n // Add random suffix to avoid collisions.\n return TaskId.make(`${newId}-${crypto.randomUUID().slice(0, 2)}`);\n};\n\n/**\n * Add new tasks to a plan, generating IDs for new tasks.\n * Use inside an `Obj.update` callback.\n */\nexport const addTasks = (\n plan: Obj.Mutable<Plan>,\n tasks: (Pick<Task, 'title'> & Partial<Pick<Task, 'status' | 'parent' | 'chat'>>)[],\n) => {\n for (const task of tasks) {\n const taskId = generateTaskId(plan);\n plan.tasks.push({ id: taskId, ...task, status: task.status ?? 'todo' });\n }\n return plan;\n};\n\ninterface MakePlanProps {\n tasks: {\n title: string;\n status?: 'todo' | 'in-progress' | 'done';\n }[];\n}\n\nexport const makePlan = (props: MakePlanProps): Plan => {\n const plan = Obj.make(Plan, { tasks: [] });\n Obj.update(plan, (plan) => {\n addTasks(plan, props.tasks);\n });\n return plan;\n};\n\n/**\n * Formats plan to markdown format.\n */\nexport const formatPlan = (plan: Plan): string => {\n return plan.tasks\n .map((task) => `- **${task.status?.toLocaleUpperCase()}**: ${task.title ?? 'No title'} <!-- id=${task.id} -->`)\n .join('\\n');\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Schema from 'effect/Schema';\n\nimport { AiContext } from '@dxos/assistant';\nimport { type Blueprint } from '@dxos/compute';\nimport { DXN, Annotation, Database, Feed, Format, Obj, Ref, Relation, Type } from '@dxos/echo';\nimport { type EntityNotFoundError } from '@dxos/echo/Err';\nimport { FormInputAnnotation } from '@dxos/echo/internal';\nimport { acquireReleaseResource } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\nimport { Text } from '@dxos/schema';\n\nimport * as Chat from './Chat';\nimport * as Plan from './Plan';\n\n/**\n * Agent schema definition.\n */\nexport const Agent = Schema.Struct({\n name: Schema.optional(Schema.String),\n\n /**\n * When false, agent triggers are disabled after sync-triggers runs.\n */\n enabled: Schema.optional(Schema.Boolean).annotations({\n title: 'Enabled',\n description: 'Master switch for agent automation; propagated to all triggers on sync.',\n }),\n\n /**\n * Instructions for the agent.\n */\n instructions: Ref.Ref(Text.Text).pipe(\n Format.FormatAnnotation.set(Format.TypeFormat.Markdown),\n Schema.annotations({ title: 'Instructions' }),\n ),\n\n /**\n * Primary chat for the agent.\n */\n // TODO(dmaretskyi): Multiple chats; RB: branching hierarchy.\n chat: Schema.optional(Ref.Ref(Chat.Chat).pipe(FormInputAnnotation.set(false))),\n\n // TODO(burdon): Is this used? Should it be an artifact?\n // Format.FormatAnnotation.set(Format.TypeFormat.Markdown)\n plan: Ref.Ref(Plan.Plan).pipe(FormInputAnnotation.set(false)),\n\n // TODO(burdon): Currently Memory.Memory objects are global to the space; make them artifacts?\n artifacts: Schema.Array(\n Schema.Struct({\n // TODO(dmaretskyi): Consider gettings names from the artifact itself using Obj.getLabel.\n name: Schema.String,\n // TODO(burdon): Rename object.\n data: Ref.Ref(Obj.Unknown),\n }),\n ).pipe(FormInputAnnotation.set(false)),\n\n /**\n * References to objects with a canonical queue property.\n * Schema must have the QueueAnnotation.\n */\n // Change to trigger.\n // TODO(dmaretskyi): Turn into an array of objects when form-data\n subscriptions: Schema.Array(Ref.Ref(Obj.Unknown)).pipe(FormInputAnnotation.set(false)),\n\n /**\n * Cron expression for a timer trigger that invokes the agent worker on a schedule.\n * The timer trigger bypasses the qualifier and goes straight to the agent worker.\n */\n // Change to trigger.\n cron: Schema.optional(Schema.String).annotations({\n title: 'Cron',\n description: 'Cron expression for a timer trigger that invokes the agent on a schedule.',\n }),\n\n /**\n * Allow the agent to filter events.\n * Related events will be added to the input queue of the agent.\n * It is recommended to enable this.\n * @deprecated\n */\n filterEvents: Schema.optional(Schema.Boolean).annotations({\n title: 'Filter events',\n description: 'Allow the agent to filter events.',\n }),\n\n /**\n * Input feed for subscriptions.\n * @deprecated Subscriptions will write directly to the agent.\n */\n feed: Schema.optional(Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false))),\n}).pipe(\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--drone--regular', hue: 'sky' }),\n Type.makeObject(DXN.make('org.dxos.type.agent', '0.1.0')),\n);\n\nexport type Agent = Type.InstanceType<typeof Agent>;\n/**\n * Creates a fully initialized Agent with chat, queue, and context bindings.\n *\n * @param props - Agent properties including spec, plan, blueprints, and context objects.\n * @param blueprint - The blueprint to use for the agent context.\n * @returns An Effect that yields the initialized Agent.\n */\nexport const makeInitialized = (\n props: Omit<Obj.MakeProps<typeof Agent>, 'instructions' | 'plan' | 'artifacts' | 'subscriptions' | 'chat'> &\n Partial<Pick<Obj.MakeProps<typeof Agent>, 'artifacts' | 'subscriptions'>> & {\n instructions: string;\n blueprints?: Ref.Ref<Blueprint.Blueprint>[];\n contextObjects?: Ref.Ref<Obj.Any>[];\n },\n blueprint: Blueprint.Blueprint,\n): Effect.Effect<Agent, never, Feed.FeedService | Database.Service> =>\n Effect.gen(function* () {\n const agent = yield* Database.add(\n Obj.make(Agent, {\n ...props,\n instructions: Ref.make(Text.make({ content: props.instructions })),\n plan: Ref.make(Plan.makePlan({ tasks: [] })),\n artifacts: props.artifacts ?? [],\n subscriptions: props.subscriptions ?? [],\n filterEvents: props.filterEvents ?? true,\n enabled: props.enabled ?? true,\n }),\n );\n const feed = yield* Database.add(Feed.make());\n const runtime = yield* Effect.runtime<Feed.FeedService>();\n const contextBinder = new AiContext.Binder({ feed, runtime });\n // TODO(dmaretskyi): Blueprint registry.\n const agentBlueprint = yield* Database.add(Obj.clone(blueprint, { deep: true }));\n yield* Effect.promise(() =>\n contextBinder.bind({\n blueprints: [Ref.make(agentBlueprint), ...(props.blueprints ?? [])],\n objects: [Ref.make(agent), ...(props.contextObjects ?? [])],\n }),\n );\n const chat = yield* Database.add(\n Chat.make({\n [Obj.Parent]: agent,\n feed: Ref.make(feed),\n }),\n );\n Obj.setParent(feed, chat);\n yield* Database.add(\n Relation.make(Chat.CompanionTo, {\n [Relation.Source]: chat,\n [Relation.Target]: agent,\n }),\n );\n\n const inputFeed = yield* Database.add(Feed.make());\n\n Obj.update(agent, (agent) => {\n agent.chat = Ref.make(chat);\n agent.feed = Ref.make(inputFeed);\n });\n\n return agent;\n });\n\n/**\n * Resets the agent chat history by rebuilding the chat context.\n * Preserves the existing blueprints and objects from the current chat context.\n *\n * @param agent - The agent whose chat history should be reset. Must have an existing chat.\n * @returns An Effect that resets the chat history.\n */\nexport const resetChatHistory = (\n agent: Agent,\n): Effect.Effect<void, EntityNotFoundError, Feed.FeedService | Database.Service> =>\n Effect.gen(function* () {\n invariant(agent.chat, 'Agent must have an existing chat to reset.');\n\n const existingFeed = yield* agent.chat.pipe(Database.load).pipe(\n Effect.map((_) => _.feed),\n Effect.flatMap(Database.load),\n );\n const runtime = yield* Effect.runtime<Feed.FeedService>();\n const existingContextBinder = yield* acquireReleaseResource(\n () =>\n new AiContext.Binder({\n feed: existingFeed,\n runtime,\n }),\n );\n const blueprints = existingContextBinder.getBlueprints().map((blueprint) => Ref.make(blueprint));\n const objects = existingContextBinder.getObjects().map((object) => Ref.make(object));\n\n const feed = yield* Database.add(Feed.make());\n const contextBinder = new AiContext.Binder({ feed, runtime });\n yield* Effect.promise(() =>\n contextBinder.bind({\n blueprints,\n objects,\n }),\n );\n\n const chat = yield* Database.add(\n Chat.make({\n feed: Ref.make(feed),\n }),\n );\n Obj.setParent(feed, chat);\n Obj.update(agent, (agent) => {\n agent.chat = Ref.make(chat);\n });\n\n yield* Database.add(\n Relation.make(Chat.CompanionTo, {\n [Relation.Source]: chat,\n [Relation.Target]: agent,\n }),\n );\n }).pipe(Effect.scoped);\n\nexport const getFromChatContext: Effect.Effect<Agent, Error, AiContext.Service> = Effect.gen(function* () {\n const agents = yield* Function.pipe(AiContext.Service.findObjects(Agent));\n if (agents.length !== 1) {\n return yield* Effect.fail(new Error(`There should be exactly one agent in context. Got: ${agents.length}`));\n }\n\n const agent = agents[0];\n return agent;\n});\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { McpServer as McpServerSpec } from '@dxos/compute';\nimport { DXN, Annotation, Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo/internal';\n\n/**\n * MCP server configuration stored as a space-level ECHO object.\n *\n * Composes the canonical connection spec from `@dxos/compute` (`url`, `protocol`, `apiKey`)\n * and adds instance-level fields (`name`, `enabled`) plus ECHO annotations.\n *\n * NOTE: `apiKey` is stored in plaintext and replicated to all peers with access to the space.\n * A future iteration should move secrets to per-device credential storage or use envelope encryption.\n */\nexport const McpServer = Schema.Struct({\n ...McpServerSpec.McpServer.fields,\n enabled: Schema.optional(Schema.Boolean),\n}).pipe(\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--plugs-connected--regular', hue: 'sky' }),\n Type.makeObject(DXN.make('org.dxos.type.assistant.mcpServer', '0.1.0')),\n);\n\nexport type McpServer = Type.InstanceType<typeof McpServer>;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAAA;;;;;;;;;;AAMA,YAAYA,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AAA,OAAA,OAAA,SAAA,IAAA,KAAA;IAEEM,MAAAA,KAAUN,KAAAA,IAAMK;EACpB1B,CAAAA,CAAAA;OACE+B,UAAU,MAAGrC,IAAIiB;AACnB,EAAAX,KAAA,OAAA,OAAA,CAAA+B,WAAA;AAEA,IAAAA,OAAOG,OAASjB,KACdY,KAAAA,IAASlB;;SAENkB,SAASC,IAAM,SAAGC,KAAAA,aAAAA;IACrB,CAAA,SAAA,MAAA,GAAA;IAEIR,CAAAA,SAAOgB,MAAQ,GAAA;EAElB,CAAA,CAAA;AACL,CAAA,EAAA,KAAe,aAAA;AACf,IAAIC,qBAAqB,WAAA,aAAA;QACvB,SAAO,OAAmB,cAAIC,UAAO,QAAA,YAAA,KAAA,CAAA;AACvC,MAAA,OAAA,WAAA,GAAA;AAEA,WAAMV,OAAiB,YAAA,IAAA,MAAA,sDAAA,OAAA,MAAA,EAAA,CAAA;EACvB;AACC,QAAA,QAAA,OAAA,CAAA;;;;;ACvOH;;;;AAMA,YAAYW,aAAY;AAExB,SAASC,aAAaC,qBAAqB;AAC3C,SAASC,OAAAA,MAAKC,cAAAA,aAAYC,QAAAA,aAAY;AACtC,SAASC,uBAAuB;AAWzB,IAAML,YAAmBM,eAAO;EACrC,GAAGL,cAAcD,UAAUO;EAC3BC,SAAgBC,iBAAgBC,eAAO;AACzC,CAAA,EAAGC,KACDN,gBAAgBO,IAAI;EAAC;CAAO,GAC5BT,YAAWU,eAAeD,IAAI;EAAEE,MAAM;EAAgCC,KAAK;AAAM,CAAA,GACjFX,MAAKY,WAAWd,KAAIe,KAAK,qCAAqC,OAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Schema", "DXN", "Annotation", "Obj", "Ref", "Type", "TaskId", "String", "pipe", "brand", "Task", "Struct", "id", "title", "annotations", "description", "status", "Literal", "parent", "optional", "chat", "Ref", "Chat", "Plan", "tasks", "Array", "Annotation", "HiddenAnnotation", "set", "Type", "makeObject", "DXN", "make", "generateTaskId", "plan", "existingIds", "map", "task", "num", "letter", "split", "parseInt", "filter", "_", "isNaN", "newId", "length", "Math", "max", "crypto", "randomUUID", "slice", "addTasks", "taskId", "push", "makePlan", "props", "Obj", "update", "formatPlan", "toLocaleUpperCase", "join", "Effect", "Function", "Schema", "AiContext", "DXN", "Annotation", "Database", "Feed", "Format", "Obj", "Ref", "Relation", "Type", "FormInputAnnotation", "acquireReleaseResource", "invariant", "Text", "Ref", "artifacts", "Array", "Schema", "String", "data", "Obj", "description", "Annotation", "IconAnnotation", "icon", "hue", "Type", "makeObject", "props", "instructions", "Text", "make", "plan", "Plan", "subscriptions", "filterEvents", "enabled", "add", "contextBinder", "AiContext", "Binder", "feed", "runtime", "Effect", "agentBlueprint", "objects", "chat", "setParent", "Source", "Relation", "Target", "agent", "inputFeed", "existingFeed", "Database", "pipe", "existingContextBinder", "acquireReleaseResource", "blueprints", "scoped", "agents", "Error", "Schema", "McpServer", "McpServerSpec", "DXN", "Annotation", "Type", "LabelAnnotation", "Struct", "fields", "enabled", "optional", "Boolean", "pipe", "set", "IconAnnotation", "icon", "hue", "makeObject", "make"]
|
|
7
|
+
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Chat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GQRUBCMT.mjs";
|
|
4
4
|
|
|
5
5
|
// src/functions/agent/definitions.ts
|
|
6
6
|
import * as Schema from "effect/Schema";
|
|
7
7
|
import { AiService, OpaqueToolkit, ModelName } from "@dxos/ai";
|
|
8
8
|
import { Routine, Trace, Operation, OperationRegistry } from "@dxos/compute";
|
|
9
9
|
import { Database, Feed, Ref } from "@dxos/echo";
|
|
10
|
+
import { DXN } from "@dxos/keys";
|
|
10
11
|
import { Text } from "@dxos/schema";
|
|
11
12
|
var AgentPrompt = Operation.make({
|
|
12
13
|
meta: {
|
|
13
|
-
key: "org.dxos.function.prompt",
|
|
14
|
+
key: DXN.make("org.dxos.function.prompt"),
|
|
14
15
|
name: "Run Routine",
|
|
15
|
-
description: "Agentic worker that executes a provided prompt using blueprints and tools."
|
|
16
|
+
description: "Agentic worker that executes a provided prompt using blueprints and tools.",
|
|
17
|
+
icon: "ph--brain--regular"
|
|
16
18
|
},
|
|
17
19
|
input: Schema.Struct({
|
|
18
20
|
prompt: Ref.Ref(Routine.Routine),
|
|
@@ -52,9 +54,9 @@ var AgentPrompt = Operation.make({
|
|
|
52
54
|
OperationRegistry.Service,
|
|
53
55
|
Trace.TraceService
|
|
54
56
|
]
|
|
55
|
-
})
|
|
57
|
+
});
|
|
56
58
|
|
|
57
59
|
export {
|
|
58
60
|
AgentPrompt
|
|
59
61
|
};
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-AYV2KMAV.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 { DXN } from '@dxos/keys';\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: DXN.make('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});\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAWC,eAAeC,iBAAiB;AACpD,SAASC,SAASC,OAAOC,WAAWC,yBAAyB;AAC7D,SAASC,UAAUC,MAAMC,WAAW;AACpC,SAASC,WAAW;AACpB,SAASC,YAAY;AAKd,IAAMC,cAAcC,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,0BAAA;IACdI,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;",
|
|
6
|
+
"names": ["Schema", "AiService", "OpaqueToolkit", "ModelName", "Routine", "Trace", "Operation", "OperationRegistry", "Database", "Feed", "Ref", "DXN", "Text", "AgentPrompt", "Operation", "make", "meta", "key", "DXN", "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"]
|
|
7
|
+
}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
import { Credential, Operation } from "@dxos/compute";
|
|
4
4
|
import { Database } from "@dxos/echo";
|
|
5
|
+
import { DXN } from "@dxos/keys";
|
|
5
6
|
var SyncIssues = Operation.make({
|
|
6
7
|
meta: {
|
|
7
|
-
key: "org.dxos.function.linear.
|
|
8
|
+
key: DXN.make("org.dxos.function.linear.syncIssues"),
|
|
8
9
|
name: "Linear",
|
|
9
|
-
description: "Sync issues from Linear."
|
|
10
|
+
description: "Sync issues from Linear.",
|
|
11
|
+
icon: "ph--arrows-clockwise--regular"
|
|
10
12
|
},
|
|
11
13
|
input: Schema.Struct({
|
|
12
14
|
team: Schema.String.annotations({
|
|
@@ -24,6 +26,7 @@ var SyncIssues = Operation.make({
|
|
|
24
26
|
import * as Effect from "effect/Effect";
|
|
25
27
|
import { Database as Database2, Filter, Obj, Query, Ref } from "@dxos/echo";
|
|
26
28
|
import { failedInvariant } from "@dxos/invariant";
|
|
29
|
+
import { EID } from "@dxos/keys";
|
|
27
30
|
import { log } from "@dxos/log";
|
|
28
31
|
var __dxlog_file = "/__w/dxos/dxos/packages/core/compute/assistant-toolkit/src/sync/sync.ts";
|
|
29
32
|
var syncObjects = Effect.fn("syncObjects")(function* (objs, { foreignKeyId }) {
|
|
@@ -39,7 +42,8 @@ var syncObjects = Effect.fn("syncObjects")(function* (objs, { foreignKeyId }) {
|
|
|
39
42
|
if (!ref.target) {
|
|
40
43
|
continue;
|
|
41
44
|
}
|
|
42
|
-
|
|
45
|
+
const targetUri = EID.tryParse(Obj.getURI(ref.target));
|
|
46
|
+
if (targetUri && EID.isLocal(targetUri)) {
|
|
43
47
|
const [target] = yield* syncObjects([
|
|
44
48
|
ref.target
|
|
45
49
|
], {
|
|
@@ -48,9 +52,9 @@ var syncObjects = Effect.fn("syncObjects")(function* (objs, { foreignKeyId }) {
|
|
|
48
52
|
obj[key] = Ref.make(target);
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
|
-
const
|
|
55
|
+
const type = Obj.getType(obj) ?? failedInvariant("No type.");
|
|
52
56
|
const foreignId = Obj.getKeys(obj, foreignKeyId)[0]?.id ?? failedInvariant("No foreign key.");
|
|
53
|
-
const [existing] = yield* Database2.runQuery(Query.select(Filter.foreignKeys(
|
|
57
|
+
const [existing] = yield* Database2.runQuery(Query.select(Filter.foreignKeys(type, [
|
|
54
58
|
{
|
|
55
59
|
source: foreignKeyId,
|
|
56
60
|
id: foreignId
|
|
@@ -59,8 +63,8 @@ var syncObjects = Effect.fn("syncObjects")(function* (objs, { foreignKeyId }) {
|
|
|
59
63
|
log("sync object", {
|
|
60
64
|
type: Obj.getTypename(obj),
|
|
61
65
|
foreignId,
|
|
62
|
-
existing: existing ? Obj.
|
|
63
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L:
|
|
66
|
+
existing: existing ? Obj.getURI(existing) : void 0
|
|
67
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 49, S: this });
|
|
64
68
|
if (!existing) {
|
|
65
69
|
yield* Database2.add(obj);
|
|
66
70
|
return obj;
|
|
@@ -104,4 +108,4 @@ export {
|
|
|
104
108
|
SyncIssues,
|
|
105
109
|
syncObjects
|
|
106
110
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
111
|
+
//# sourceMappingURL=chunk-BB6X6NT6.mjs.map
|