@dxos/assistant-toolkit 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
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-BA5WQRDU.mjs → add-artifact-4IVGW6CI.mjs} +4 -4
- package/dist/lib/neutral/{add-artifact-BA5WQRDU.mjs.map → add-artifact-4IVGW6CI.mjs.map} +3 -3
- package/dist/lib/neutral/{agent-M2EW5M36.mjs → agent-F4L7UXME.mjs} +5 -5
- package/dist/lib/neutral/{agent-M2EW5M36.mjs.map → agent-F4L7UXME.mjs.map} +2 -2
- package/dist/lib/neutral/{chunk-CLHVRIYF.mjs → chunk-5GPL2WXU.mjs} +35 -36
- package/dist/lib/neutral/chunk-5GPL2WXU.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-CVUA23QI.mjs → chunk-7UCYAP3T.mjs} +17 -17
- package/dist/lib/neutral/chunk-7UCYAP3T.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-TO5IX24K.mjs → chunk-ANSF2BHN.mjs} +3 -3
- package/dist/lib/neutral/chunk-ANSF2BHN.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-D5MG5OKX.mjs → chunk-BCT55UTL.mjs} +2 -2
- package/dist/lib/neutral/{chunk-J37DYY7A.mjs → chunk-COL54UJ3.mjs} +12 -3
- package/dist/lib/neutral/chunk-COL54UJ3.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-E2XRNXWP.mjs → chunk-KS3IA6FQ.mjs} +11 -10
- package/dist/lib/neutral/chunk-KS3IA6FQ.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-KY2TIPJ5.mjs → chunk-MMQ7HFL4.mjs} +4 -5
- package/dist/lib/neutral/chunk-MMQ7HFL4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-PLGEBNTO.mjs +65 -0
- package/dist/lib/neutral/chunk-PLGEBNTO.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-JCYLFOFK.mjs → chunk-W2722TC5.mjs} +5 -5
- package/dist/lib/neutral/{chunk-JCYLFOFK.mjs.map → chunk-W2722TC5.mjs.map} +3 -3
- package/dist/lib/neutral/{context-add-IIDPRRVB.mjs → context-add-S5MBW2NA.mjs} +4 -4
- package/dist/lib/neutral/context-add-S5MBW2NA.mjs.map +7 -0
- package/dist/lib/neutral/{context-remove-RDYV4PD4.mjs → context-remove-35O5T5N5.mjs} +4 -4
- package/dist/lib/neutral/context-remove-35O5T5N5.mjs.map +7 -0
- package/dist/lib/neutral/{create-project-GLDEAWTT.mjs → create-project-3AGXJ4TD.mjs} +5 -5
- package/dist/lib/neutral/{enable-blueprints-LBDZH2CY.mjs → enable-blueprints-IVKST3WH.mjs} +4 -4
- package/dist/lib/neutral/enable-blueprints-IVKST3WH.mjs.map +7 -0
- package/dist/lib/neutral/{fetch-messages-PWGUG5G3.mjs → fetch-messages-QOBBCTGC.mjs} +2 -2
- package/dist/lib/neutral/{get-context-B55SX5Y4.mjs → get-context-FBYWIP72.mjs} +4 -4
- package/dist/lib/neutral/{get-context-B55SX5Y4.mjs.map → get-context-FBYWIP72.mjs.map} +3 -3
- package/dist/lib/neutral/index.mjs +67 -57
- package/dist/lib/neutral/index.mjs.map +3 -3
- package/dist/lib/neutral/{load-LI7HHVD6.mjs → load-GAT3T2AD.mjs} +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{object-create-52Z7YKIA.mjs → object-create-PL3WRP74.mjs} +3 -3
- package/dist/lib/neutral/{object-delete-I266YAXI.mjs → object-delete-PZJQN5KW.mjs} +2 -2
- package/dist/lib/neutral/{object-update-HY4GI7LA.mjs → object-update-R43N3VJX.mjs} +2 -2
- package/dist/lib/neutral/{project-2YBPW5N7.mjs → project-VVXXUMAI.mjs} +4 -4
- package/dist/lib/neutral/{project-rules-XUBEPDP6.mjs → project-rules-KSVSOZJV.mjs} +3 -3
- package/dist/lib/neutral/{prompt-2WZQERT4.mjs → prompt-INL55Q2B.mjs} +10 -7
- package/dist/lib/neutral/{prompt-2WZQERT4.mjs.map → prompt-INL55Q2B.mjs.map} +3 -3
- package/dist/lib/neutral/{qualifier-2AC2ICOB.mjs → qualifier-DAF4H7V3.mjs} +11 -11
- package/dist/lib/neutral/qualifier-DAF4H7V3.mjs.map +7 -0
- package/dist/lib/neutral/{query-B3NOYFCK.mjs → query-MP5NSQKO.mjs} +3 -4
- package/dist/lib/neutral/query-MP5NSQKO.mjs.map +7 -0
- package/dist/lib/neutral/{query-blueprints-KXADGHSA.mjs → query-blueprints-PLWYVOI3.mjs} +2 -2
- package/dist/lib/neutral/{relation-create-Z3NGW4VU.mjs → relation-create-YAAAFTR2.mjs} +3 -3
- package/dist/lib/neutral/{relation-delete-LXY7W2YO.mjs → relation-delete-IEPKERFR.mjs} +2 -2
- package/dist/lib/neutral/{schema-add-4TXJO2V7.mjs → schema-add-5BNIINRS.mjs} +2 -2
- package/dist/lib/neutral/{schema-list-PJS5AFZ3.mjs → schema-list-54UK7S4R.mjs} +2 -2
- package/dist/lib/neutral/{sync-issues-LOLHZNFL.mjs → sync-issues-DWY76B3M.mjs} +6 -7
- package/dist/lib/neutral/sync-issues-DWY76B3M.mjs.map +7 -0
- package/dist/lib/neutral/{sync-triggers-EYJM4QWR.mjs → sync-triggers-NOIQLELD.mjs} +8 -9
- package/dist/lib/neutral/{sync-triggers-EYJM4QWR.mjs.map → sync-triggers-NOIQLELD.mjs.map} +3 -3
- package/dist/lib/neutral/{tag-add-5NOHUTIE.mjs → tag-add-NLVRGTC6.mjs} +2 -2
- package/dist/lib/neutral/{tag-remove-QTKYDJAW.mjs → tag-remove-N4HFBIA2.mjs} +2 -2
- package/dist/lib/neutral/testing/index.mjs +3 -3
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- package/dist/lib/neutral/{update-blueprints-N2AK2VUR.mjs → update-blueprints-2SNK6HLG.mjs} +2 -2
- package/dist/lib/neutral/update-tasks-QQUR53RN.mjs +13 -0
- package/dist/lib/neutral/update-tasks-QQUR53RN.mjs.map +7 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts +10 -8
- 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 -5
- 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 -3
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +2 -2
- 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 +2 -2
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/definitions.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/query.d.ts +1 -2
- package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -1
- 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 +16 -8
- 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 +8 -4
- 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 +6 -2
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +12 -4
- 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 +6 -2
- 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/crud/graph.d.ts +5 -7
- package/dist/types/src/crud/graph.d.ts.map +1 -1
- package/dist/types/src/functions/agent/definitions.d.ts +6 -5
- 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/types/Agent.d.ts +9 -7
- package/dist/types/src/types/Agent.d.ts.map +1 -1
- package/dist/types/src/types/McpServer.d.ts +4 -1
- package/dist/types/src/types/McpServer.d.ts.map +1 -1
- 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 +1 -1
- package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -1
- package/src/blueprints/blueprint-manager/blueprint.test.ts +21 -17
- package/src/blueprints/blueprint-manager/blueprint.ts +2 -2
- package/src/blueprints/blueprint-manager/functions/definitions.ts +2 -2
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +2 -2
- package/src/blueprints/browser/blueprint.test.ts +3 -3
- package/src/blueprints/browser/blueprint.ts +1 -1
- package/src/blueprints/database/blueprint.conversations.json +1 -1
- package/src/blueprints/database/blueprint.test.ts +6 -6
- package/src/blueprints/database/blueprint.ts +1 -1
- 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 +16 -16
- package/src/blueprints/database/functions/query.ts +2 -3
- package/src/blueprints/discord/blueprint.ts +1 -1
- package/src/blueprints/discord/functions/fetch-messages.test.ts +7 -2
- package/src/blueprints/linear/blueprint.ts +1 -1
- 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/blueprint.ts +1 -1
- 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 +25 -3
- package/src/blueprints/project/blueprint.conversations.json +1 -1
- package/src/blueprints/project/blueprint.test.ts +15 -17
- package/src/blueprints/project/blueprint.ts +2 -2
- package/src/blueprints/project/functions/add-artifact.ts +1 -0
- package/src/blueprints/project/functions/agent.ts +1 -1
- package/src/blueprints/project/functions/definitions.ts +8 -8
- package/src/blueprints/project/functions/get-context.ts +1 -0
- package/src/blueprints/project/functions/qualifier.ts +5 -5
- package/src/blueprints/project-wizard/functions/sync-triggers.ts +4 -9
- package/src/blueprints/testing.ts +10 -4
- package/src/blueprints/websearch/blueprint.conversations.json +1 -1
- package/src/crud/graph.test.ts +1 -1
- package/src/crud/graph.ts +125 -127
- package/src/functions/agent/definitions.ts +8 -3
- package/src/functions/agent/prompt.conversations.json +1 -1
- package/src/functions/agent/prompt.test.ts +8 -11
- package/src/functions/agent/prompt.ts +5 -2
- package/src/sync/sync.ts +1 -2
- package/src/types/Agent.ts +28 -29
- package/src/types/McpServer.ts +5 -5
- package/src/types/Plan.ts +1 -0
- package/dist/lib/neutral/chunk-CLHVRIYF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-CVUA23QI.mjs.map +0 -7
- package/dist/lib/neutral/chunk-E2XRNXWP.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J37DYY7A.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KY2TIPJ5.mjs.map +0 -7
- package/dist/lib/neutral/chunk-MMTKJBB5.mjs +0 -140
- package/dist/lib/neutral/chunk-MMTKJBB5.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TO5IX24K.mjs.map +0 -7
- package/dist/lib/neutral/context-add-IIDPRRVB.mjs.map +0 -7
- package/dist/lib/neutral/context-remove-RDYV4PD4.mjs.map +0 -7
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs.map +0 -7
- package/dist/lib/neutral/qualifier-2AC2ICOB.mjs.map +0 -7
- package/dist/lib/neutral/query-B3NOYFCK.mjs.map +0 -7
- package/dist/lib/neutral/sync-issues-LOLHZNFL.mjs.map +0 -7
- package/dist/lib/neutral/update-tasks-ML2FCYU5.mjs +0 -46
- package/dist/lib/neutral/update-tasks-ML2FCYU5.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-D5MG5OKX.mjs.map → chunk-BCT55UTL.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-project-GLDEAWTT.mjs.map → create-project-3AGXJ4TD.mjs.map} +0 -0
- /package/dist/lib/neutral/{fetch-messages-PWGUG5G3.mjs.map → fetch-messages-QOBBCTGC.mjs.map} +0 -0
- /package/dist/lib/neutral/{load-LI7HHVD6.mjs.map → load-GAT3T2AD.mjs.map} +0 -0
- /package/dist/lib/neutral/{object-create-52Z7YKIA.mjs.map → object-create-PL3WRP74.mjs.map} +0 -0
- /package/dist/lib/neutral/{object-delete-I266YAXI.mjs.map → object-delete-PZJQN5KW.mjs.map} +0 -0
- /package/dist/lib/neutral/{object-update-HY4GI7LA.mjs.map → object-update-R43N3VJX.mjs.map} +0 -0
- /package/dist/lib/neutral/{project-2YBPW5N7.mjs.map → project-VVXXUMAI.mjs.map} +0 -0
- /package/dist/lib/neutral/{project-rules-XUBEPDP6.mjs.map → project-rules-KSVSOZJV.mjs.map} +0 -0
- /package/dist/lib/neutral/{query-blueprints-KXADGHSA.mjs.map → query-blueprints-PLWYVOI3.mjs.map} +0 -0
- /package/dist/lib/neutral/{relation-create-Z3NGW4VU.mjs.map → relation-create-YAAAFTR2.mjs.map} +0 -0
- /package/dist/lib/neutral/{relation-delete-LXY7W2YO.mjs.map → relation-delete-IEPKERFR.mjs.map} +0 -0
- /package/dist/lib/neutral/{schema-add-4TXJO2V7.mjs.map → schema-add-5BNIINRS.mjs.map} +0 -0
- /package/dist/lib/neutral/{schema-list-PJS5AFZ3.mjs.map → schema-list-54UK7S4R.mjs.map} +0 -0
- /package/dist/lib/neutral/{tag-add-5NOHUTIE.mjs.map → tag-add-NLVRGTC6.mjs.map} +0 -0
- /package/dist/lib/neutral/{tag-remove-QTKYDJAW.mjs.map → tag-remove-N4HFBIA2.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-blueprints-N2AK2VUR.mjs.map → update-blueprints-2SNK6HLG.mjs.map} +0 -0
package/src/types/McpServer.ts
CHANGED
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
import * as Schema from 'effect/Schema';
|
|
8
8
|
|
|
9
|
+
import { McpServer as McpServerSpec } from '@dxos/compute';
|
|
9
10
|
import { Annotation, Type } from '@dxos/echo';
|
|
10
11
|
import { LabelAnnotation } from '@dxos/echo/internal';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* MCP server configuration stored as a space-level ECHO object.
|
|
14
15
|
*
|
|
16
|
+
* Composes the canonical connection spec from `@dxos/compute` (`url`, `protocol`, `apiKey`)
|
|
17
|
+
* and adds instance-level fields (`name`, `enabled`) plus ECHO annotations.
|
|
18
|
+
*
|
|
15
19
|
* NOTE: `apiKey` is stored in plaintext and replicated to all peers with access to the space.
|
|
16
20
|
* A future iteration should move secrets to per-device credential storage or use envelope encryption.
|
|
17
21
|
*/
|
|
18
22
|
export const McpServer = Schema.Struct({
|
|
19
|
-
|
|
20
|
-
url: Schema.String,
|
|
21
|
-
protocol: Schema.Union(Schema.Literal('sse'), Schema.Literal('http')),
|
|
22
|
-
/** Stored in plaintext; replicated to all peers in the space. */
|
|
23
|
-
apiKey: Schema.optional(Schema.String),
|
|
23
|
+
...McpServerSpec.McpServer.fields,
|
|
24
24
|
enabled: Schema.optional(Schema.Boolean),
|
|
25
25
|
}).pipe(
|
|
26
26
|
Type.object({
|
package/src/types/Plan.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
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 { 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});\nexport interface Task extends Schema.Schema.Type<typeof Task> {}\n\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(\n Type.object({\n typename: 'org.dxos.type.plan',\n version: '0.1.0',\n }),\n Annotation.SystemTypeAnnotation.set(true),\n);\nexport interface Plan extends Schema.Schema.Type<typeof Plan> {}\n\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 { AiContextBinder, AiContextService } from '@dxos/assistant';\nimport { type Blueprint } from '@dxos/compute';\nimport { Annotation, Database, Feed, Format, Obj, Ref, Relation, Type } from '@dxos/echo';\nimport { Queue } from '@dxos/echo-db';\nimport { type ObjectNotFoundError } from '@dxos/echo/Err';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { acquireReleaseResource } from '@dxos/effect';\nimport { QueueService } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { QueueAnnotation, 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 * Input feed for subscriptions.\n */\n // TODO(burdon): Rename to Feed?\n // NOTE: Named `queue` to conform to subscribable schema (see QueueAnnotation).\n queue: Schema.optional(Ref.Ref(Queue).pipe(FormInputAnnotation.set(false))),\n\n /**\n * References to objects with a canonical queue property.\n * Schema must have the QueueAnnotation.\n */\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 * 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 */\n filterEvents: Schema.optional(Schema.Boolean).annotations({\n title: 'Filter events',\n description: 'Allow the agent to filter events.',\n }),\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 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}).pipe(\n Type.object({\n typename: 'org.dxos.type.agent',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n QueueAnnotation.set(true),\n Annotation.IconAnnotation.set({\n icon: 'ph--drone--regular',\n hue: 'sky',\n }),\n);\n\nexport interface Agent extends Schema.Schema.Type<typeof Agent> {}\n\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, QueueService | Feed.FeedService | Database.Service> =>\n Effect.gen(function* () {\n const agent = Obj.make(Agent, {\n ...props,\n instructions: Ref.make(Text.make(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 yield* Database.add(agent);\n const feed = yield* Database.add(Feed.make());\n const runtime = yield* Effect.runtime<Feed.FeedService>();\n const contextBinder = new AiContextBinder({ 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 inputQueue = yield* QueueService.createQueue();\n\n Obj.update(agent, (agent) => {\n agent.chat = Ref.make(chat);\n agent.queue = Ref.fromDXN(inputQueue.dxn);\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, ObjectNotFoundError, 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 AiContextBinder({\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 AiContextBinder({ 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, AiContextService> = Effect.gen(function* () {\n const agents = yield* Function.pipe(AiContextService.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 { 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 * 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 name: Schema.String,\n url: Schema.String,\n protocol: Schema.Union(Schema.Literal('sse'), Schema.Literal('http')),\n /** Stored in plaintext; replicated to all peers in the space. */\n apiKey: Schema.optional(Schema.String),\n enabled: Schema.optional(Schema.Boolean),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.assistant.mcpServer',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--plugs-connected--regular',\n hue: 'sky',\n }),\n);\n\nexport interface McpServer extends Schema.Schema.Type<typeof McpServer> {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAAA;;;;;;;;;;AAMA,YAAYA,YAAY;AAExB,SAASC,YAAYC,KAAKC,KAAKC,YAAY;AAIpC,IAAMC,SAAgBC,cAAOC,KAAYC,aAAM,gCAAA,CAAA;AAG/C,IAAMC,OAAcC,cAAO;;;;EAIhCC,IAAIN;EAEJO,OAAcN,cAAOO,YAAY;IAC/BC,aAAa;EACf,CAAA;EAEAC,QAAeC,eAAQ,QAAQ,eAAe,MAAA;;;;EAK9CC,QAAeC,gBAASb,MAAAA,EAAQQ,YAAY;IAC1CC,a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AA,GAAA;IAEIE,CAAAA,SAAOoB,MAAQ,GAAA;EAElB,CAAA,CAAA;AACL,CAAA,EAAA,KAAe,aAAA;AACf,IAAIC,qBAAqB,WAAA,aAAA;QACvB,SAAO,OAAmB,cAAIC,iBAAO,YAAA,KAAA,CAAA;AACvC,MAAA,OAAA,WAAA,GAAA;AAEA,WAAMxB,OAAiB,YAAA,IAAA,MAAA,sDAAA,OAAA,MAAA,EAAA,CAAA;EACvB;AACC,QAAA,QAAA,OAAA,CAAA;;;;;AC9OH;;;;AAMA,YAAYyB,aAAY;AAExB,SAASC,cAAAA,aAAYC,QAAAA,aAAY;AACjC,SAASC,mBAAAA,wBAAuB;AAQzB,IAAMC,YAAmBC,eAAO;EACrCC,MAAaC;EACbC,KAAYD;EACZE,UAAiBC,cAAaC,gBAAQ,KAAA,GAAeA,gBAAQ,MAAA,CAAA;;EAE7DC,QAAeC,iBAAgBN,cAAM;EACrCO,SAAgBD,iBAAgBE,eAAO;AACzC,CAAA,EAAGC,KACDd,MAAKe,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAhB,iBAAgBiB,IAAI;EAAC;CAAO,GAC5BnB,YAAWoB,eAAeD,IAAI;EAC5BE,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Obj", "Ref", "Type", "TaskId", "String", "pipe", "brand", "Task", "Struct", "id", "title", "annotations", "description", "status", "Literal", "parent", "optional", "chat", "Ref", "Chat", "Plan", "tasks", "Array", "Type", "object", "typename", "version", "Annotation", "SystemTypeAnnotation", "set", "generateTaskId", "plan", "existingIds", "map", "task", "num", "letter", "split", "parseInt", "filter", "_", "isNaN", "newId", "length", "Math", "max", "make", "crypto", "randomUUID", "slice", "addTasks", "taskId", "push", "makePlan", "props", "Obj", "update", "formatPlan", "toLocaleUpperCase", "join", "Effect", "Function", "Schema", "AiContextBinder", "AiContextService", "Annotation", "Database", "Feed", "Format", "Obj", "Ref", "Relation", "Type", "Queue", "FormInputAnnotation", "LabelAnnotation", "acquireReleaseResource", "QueueService", "invariant", "QueueAnnotation", "Text", "Ref", "artifacts", "Array", "Schema", "String", "data", "Obj", "description", "Type", "typename", "version", "LabelAnnotation", "QueueAnnotation", "set", "icon", "hue", "Annotation", "props", "instructions", "make", "Text", "plan", "subscriptions", "filterEvents", "enabled", "Database", "agent", "runtime", "Effect", "contextBinder", "AiContextBinder", "feed", "agentBlueprint", "objects", "chat", "setParent", "Source", "Relation", "Target", "inputQueue", "queue", "fromDXN", "existingFeed", "pipe", "existingContextBinder", "acquireReleaseResource", "blueprints", "add", "scoped", "agents", "Error", "Schema", "Annotation", "Type", "LabelAnnotation", "McpServer", "Struct", "name", "String", "url", "protocol", "Union", "Literal", "apiKey", "optional", "enabled", "Boolean", "pipe", "object", "typename", "version", "set", "IconAnnotation", "icon", "hue"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { AiContextService } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj, Ref, Relation, Tag } 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 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});\n\nexport const Load = Operation.make({\n meta: {\n key: 'org.dxos.function.database.load',\n name: 'Load object',\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});\n\nexport const ObjectCreate = Operation.make({\n meta: {\n key: 'org.dxos.function.database.object-create',\n name: 'Create object',\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});\n\nexport const ObjectUpdate = Operation.make({\n meta: {\n key: 'org.dxos.function.database.object-update',\n name: 'Update object',\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});\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 },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n\nexport const SchemaAdd = Operation.make({\n meta: {\n key: 'org.dxos.function.database.schema-add',\n name: 'Add schema',\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});\n\nexport const SchemaList = Operation.make({\n meta: {\n key: 'org.dxos.function.database.schema-list',\n name: 'List schemas',\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});\n\nexport const ContextAdd = Operation.make({\n meta: {\n key: 'org.dxos.function.database.context-add',\n name: 'Add to context',\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: [AiContextService],\n});\n\nexport const ContextRemove = Operation.make({\n meta: {\n key: 'org.dxos.function.database.context-remove',\n name: 'Remove from context',\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: [AiContextService],\n});\n\nexport const RelationCreate = Operation.make({\n meta: {\n key: 'org.dxos.function.database.relation-create',\n name: 'Create relation',\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});\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 },\n input: Schema.Struct({\n rel: Ref.Ref(Relation.Unknown),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n\nexport const TagAdd = Operation.make({\n meta: {\n key: 'org.dxos.function.database.tag-add',\n name: 'Add tag',\n description: trim`\n Adds a tag to an object.\n Tags are objects of type ${Tag.Tag.typename}.\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});\n\nexport const TagRemove = Operation.make({\n meta: {\n key: 'org.dxos.function.database.tag-remove',\n name: 'Remove tag',\n description: trim`\n Removes a tag from an object.\n Tags are objects of type ${Tag.Tag.typename}.\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});\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AACjC,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,KAAKC,KAAKC,UAAUC,WAAW;AAClD,SAASC,YAAY;AAEd,IAAMC,QAAQP,UAAUQ,KAAK;EAClCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAaN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6Cf;EACAO,OAAcC,cAAO;IACnBC,IAAWC,gBACFC,aAAMd,IAAIA,IAAID,IAAIgB,OAAO,CAAA,EAAGC,YAAY;MAC7CP,aACE;IAGJ,CAAA,CAAA;IAEFQ,UAAiBJ,gBACRK,cAAOF,YAAY;MACxBP,aAAa;MACbU,SAAS;IACX,CAAA,CAAA;IAEFC,MAAaP,gBACJK,cAAOF,YAAY;MACxBP,aAAa;MACbU,SAAS;IACX,CAAA,CAAA;IAEFE,gBAAuBR,gBACdS,eAAQN,YAAY;MACzBP,aAAa;MACbc,S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C3BsB,YAAmBH,WAAIlB,YAAY;MACjCP,aAAa;IACf,CAAA;EACF,CAAA;EACAkB,QAAeZ;EACfa,UAAU;IAAC9B,SAAS+B;;AACtB,CAAA;AAEO,IAAMqB,iBAAiBrD,UAAUQ,KAAK;EAC3CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAaN;;;EAGf;EACAO,OAAcC,cAAO;IACnBwC,KAAKnD,IAAIA,IAAIC,SAASc,OAAO;EAC/B,CAAA;EACAY,QAAec;EACfb,UAAU;IAAC9B,SAAS+B;;AACtB,CAAA;AAEO,IAAMuB,SAASvD,UAAUQ,KAAK;EACnCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAaN;;iCAEgBD,IAAIA,IAAIe,QAAQ;;;EAG/C;EACAP,OAAcC,cAAO;IACnB0C,KAAKrD,IAAIA,IAAID,IAAIgB,OAAO;IACxBqB,KAAKpC,IAAIA,IAAID,IAAIgB,OAAO;EAC1B,CAAA;EACAY,QAAeZ;EACfa,UAAU;IAAC9B,SAAS+B;;AACtB,CAAA;AAEO,IAAMyB,YAAYzD,UAAUQ,KAAK;EACtCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAaN;;iCAEgBD,IAAIA,IAAIe,QAAQ;;EAE/C;EACAP,OAAcC,cAAO;IACnB0C,KAAKrD,IAAIA,IAAID,IAAIgB,OAAO;IACxBqB,KAAKpC,IAAIA,IAAID,IAAIgB,OAAO;EAC1B,CAAA;EACAY,QAAeZ;EACfa,UAAU;IAAC9B,SAAS+B;;AACtB,CAAA;",
|
|
6
|
-
"names": ["Schema", "AiContextService", "Operation", "Database", "Obj", "Ref", "Relation", "Tag", "trim", "Query", "make", "meta", "key", "name", "description", "input", "Struct", "in", "optional", "Array", "Unknown", "annotations", "typename", "String", "example", "text", "includeContent", "Boolean", "default", "limit", "Number", "includeQueues", "output", "services", "Service", "Load", "refs", "ObjectCreate", "data", "Any", "ObjectUpdate", "obj", "properties", "Record", "value", "ObjectDelete", "Void", "SchemaAdd", "jsonSchema", "SchemaList", "ContextAdd", "ContextRemove", "RelationCreate", "source", "target", "RelationDelete", "rel", "TagAdd", "tag", "TagRemove"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { AiContextService } from '@dxos/assistant';\nimport { Trace, TriggerEvent, Operation, OperationRegistry } from '@dxos/compute';\nimport { Database, Feed, Obj, Ref } from '@dxos/echo';\nimport { QueueService } from '@dxos/functions';\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 },\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 QueueService,\n Feed.FeedService,\n OperationRegistry.Service,\n Trace.TraceService,\n OpaqueToolkit.OpaqueToolkitProvider,\n ],\n});\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 },\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],\n});\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 },\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: [AiContextService, Database.Service],\n});\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 },\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: [AiContextService, Database.Service],\n});\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAWC,qBAAqB;AACzC,SAASC,wBAAwB;AACjC,SAASC,OAAOC,cAAcC,WAAWC,yBAAyB;AAClE,SAASC,UAAUC,MAAMC,KAAKC,WAAW;AACzC,SAASC,oBAAoB;AAItB,IAAMC,cAAcC,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;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;IACAC,KAAKC;IACLC,kBAAkBJ;IAClBK,MAAMC;IACNC,cAAcC;;AAElB,CAAA;AAEO,IAAMC,YAAY/B,UAAUC,KAAK;EACtCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aACE;EACJ;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;;AAC3C,CAAA;AAEO,IAAMU,aAAahC,UAAUC,KAAK;EACvCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO,CAAC,CAAA;EACtBU,QAAeV,cAAO;IACpB0B,IAAWnB;IACXV,MAAaU;IACboB,cAAqBpB;IACrBqB,MAAarB;IACbsB,WAAkBC,aACT9B,cAAO;MACZH,MAAaU;MACbwB,MAAazB,gBAAgBC,aAAM;MACnCyB,KAAY1B,gBAAgBC,aAAM;IACpC,CAAA,CAAA;EAEJ,CAAA;EACAK,UAAU;IAACqB;IAAkBnB,SAASC;;AACxC,CAAA;AAEO,IAAMmB,cAAczC,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBH,MAAaU,cAAO4B,YAAY;MAC9BrC,aAAa;IACf,CAAA;IACAsC,UAAUjC,IAAIA,IAAIkC,IAAIC,OAAO,EAAEH,YAAY;MACzCrC,aAAa;IACf,CAAA;EACF,CAAA;EACAY,QAAeC;EACfC,UAAU;IAACqB;IAAkBnB,SAASC;;AACxC,CAAA;",
|
|
6
|
-
"names": ["Schema", "AiService", "OpaqueToolkit", "AiContextService", "Trace", "TriggerEvent", "Operation", "OperationRegistry", "Database", "Feed", "Obj", "Ref", "QueueService", "AgentWorker", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "agent", "suspend", "Ref", "Agent", "prompt", "optional", "String", "event", "TriggerEvent", "output", "Void", "services", "AiService", "Database", "Service", "QueueService", "Feed", "FeedService", "OperationRegistry", "Trace", "TraceService", "OpaqueToolkit", "OpaqueToolkitProvider", "Qualifier", "GetContext", "id", "instructions", "plan", "artifacts", "Array", "type", "dxn", "AiContextService", "AddArtifact", "annotations", "artifact", "Obj", "Unknown"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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';\n\nimport * as Chat from '../../types/Chat';\n\nexport const AgentPrompt = Operation.make({\n meta: {\n key: 'org.dxos.function.prompt',\n name: 'Agent',\n description: 'Agentic worker that executes a provided prompt using blueprints and tools.',\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\n model: Schema.optional(ModelName),\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 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;AAI7B,IAAMC,cAAcC,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBC,QAAQC,IAAIA,IAAIC,QAAQA,OAAO;;;;IAK/BC,MAAaC,gBAASH,IAAIA,IAASI,IAAI,CAAA;;;;IAMvCC,OAAcF,gBAASG,SAAAA;;;;;IAKvBT,OAAcU,WAAIC,KAAYC,mBAAY;MAAEC,OAAO;IAAQ,CAAA,CAAA;IAE3DC,oBAA2BR,gBAAgBS,aAAM,EAAEH,YAAY;MAC7Db,aAAa;IACf,CAAA;EACF,CAAA;EACAiB,QAAeN;EACfO,UAAU;IACRC,UAAUA;IACVC,SAASC;IACTC,KAAKC;IACLC,cAAcC;IACdC,kBAAkBL;IAClBM,MAAMC;;AAEV,CAAA;",
|
|
6
|
-
"names": ["Schema", "AiService", "OpaqueToolkit", "ModelName", "Routine", "Trace", "Operation", "OperationRegistry", "Database", "Feed", "Ref", "AgentPrompt", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "prompt", "Ref", "Routine", "chat", "optional", "Chat", "model", "ModelName", "Any", "pipe", "annotations", "title", "systemInstructions", "String", "output", "services", "AiService", "Database", "Service", "Feed", "FeedService", "OpaqueToolkit", "OpaqueToolkitProvider", "OperationRegistry", "Trace", "TraceService"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/linear/functions/definitions.ts", "../../../src/sync/sync.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Credential, Operation } from '@dxos/compute';\nimport { Database } from '@dxos/echo';\n\nexport const SyncIssues = Operation.make({\n meta: {\n key: 'org.dxos.function.linear.sync-issues',\n name: 'Linear',\n description: 'Sync issues from Linear.',\n },\n input: Schema.Struct({\n team: Schema.String.annotations({\n description: 'Linear team id.',\n }),\n }),\n output: Schema.Any,\n services: [Credential.CredentialsService, Database.Service],\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Filter, Obj, Query, Ref } from '@dxos/echo';\nimport { Database } from '@dxos/echo';\nimport { failedInvariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\n/**\n * Syncs objects to the database.\n * If there's an object with a matching foreign key in the database, it will be updated.\n * Otherwise, a new object will be added.\n * Recursively syncs top-level refs.\n *\n * @param opts.foreignKeyId - The key to use for matching objects.\n */\nexport const syncObjects: (\n objs: Obj.Unknown[],\n opts: { foreignKeyId: string },\n) => Effect.Effect<Obj.Unknown[], never, Database.Service> = Effect.fn('syncObjects')(function* (\n objs,\n { foreignKeyId },\n) {\n return yield* Effect.forEach(\n objs,\n Effect.fnUntraced(function* (obj) {\n // Sync referenced objects.\n for (const key of Object.keys(obj)) {\n if (typeof key !== 'string' || key === 'id') {\n continue;\n }\n if (!Ref.isRef((obj as any)[key])) {\n continue;\n }\n const ref: Ref.Unknown = (obj as any)[key];\n if (!ref.target) {\n continue;\n }\n if (Obj.getDXN(ref.target).isLocalObjectId()) {\n // obj not persisted to db.\n const [target] = yield* syncObjects([ref.target], { foreignKeyId });\n (obj as any)[key] = Ref.make(target);\n }\n }\n\n const schema = Obj.getSchema(obj) ?? failedInvariant('No schema.');\n const foreignId = Obj.getKeys(obj, foreignKeyId)[0]?.id ?? failedInvariant('No foreign key.');\n const [existing] = yield* Database.runQuery(\n Query.select(Filter.foreignKeys(schema, [{ source: foreignKeyId, id: foreignId }])),\n );\n log('sync object', {\n type: Obj.getTypename(obj),\n foreignId,\n existing: existing ? Obj.getDXN(existing) : undefined,\n });\n if (!existing) {\n yield* Database.add(obj);\n return obj;\n } else {\n copyObjectData(existing, obj);\n return existing;\n }\n }),\n { concurrency: 1 },\n );\n});\n\nconst copyObjectData = (existing: Obj.Unknown, newObj: Obj.Unknown) => {\n Obj.update(existing, (existing) => {\n // Copy properties from newObj to existing.\n for (const key of Object.keys(newObj)) {\n if (typeof key !== 'string' || key === 'id') {\n continue;\n }\n if (\n typeof (newObj as any)[key] !== 'string' &&\n typeof (newObj as any)[key] !== 'number' &&\n typeof (newObj as any)[key] !== 'boolean' &&\n !Ref.isRef((newObj as any)[key])\n ) {\n continue;\n }\n (existing as any)[key] = (newObj as any)[key];\n }\n\n // Delete properties that don't exist in newObj.\n for (const key of Object.keys(existing)) {\n if (typeof key !== 'string' || key === 'id') {\n continue;\n }\n if (!(key in newObj)) {\n delete (existing as any)[key];\n }\n }\n\n // Update foreign keys.\n for (const foreignKey of Obj.getMeta(newObj).keys) {\n Obj.deleteKeys(existing, foreignKey.source);\n // TODO(dmaretskyi): Doesn't work: `Obj.getMeta(existing).keys.push(foreignKey);`\n Obj.getMeta(existing).keys.push({ ...foreignKey });\n }\n });\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,iBAAiB;AACtC,SAASC,gBAAgB;AAElB,IAAMC,aAAaF,UAAUG,KAAK;EACvCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBC,MAAaC,cAAOC,YAAY;MAC9BL,aAAa;IACf,CAAA;EACF,CAAA;EACAM,QAAeC;EACfC,UAAU;IAAChB,WAAWiB;IAAoBf,SAASgB;;AACrD,CAAA;;;AClBA,YAAYC,YAAY;AAExB,SAASC,QAAQC,KAAKC,OAAOC,WAAW;AACxC,SAASC,YAAAA,iBAAgB;AACzB,SAASC,uBAAuB;AAChC,SAASC,WAAW;AAEpB,IAAA,eAAA;AAkBM,IAAA,cAA2B,UAAA,aAAA,EAAA,WAAA,MAAA,EAAA,aAAA,GAAA;SAC3B,OAAWC,eAAcC,MAAW,kBAAA,WAAA,KAAA;eAEhC,OAAA,OAAA,KAAA,GAAA,GAAA;AACF,UAAA,OAAA,QAAA,YAAA,QAAA,MAAA;AACI;;AAEJ,UAAA,CAAA,IAAA,MAAA,IAAA,GAAA,CAAA,GAAA;AACA;MACA;YACE,MAAA,IAAA,GAAA;AACF,UAAA,CAAA,IAAA,QAAA;AACIP;;UAEF,IAAA,OAAOQ,IAAO,MAAG,EAAA,gBAAmB,GAAA;cAAc,CAAA,MAAA,IAAA,OAAA,YAAA;UAAEC,IAAAA;QAAa,GAAA;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AAA,EAAA,KAAA,KAAA;QAClD,GAAA;MACF,CAAA;IACF;;;",
|
|
6
|
-
"names": ["Schema", "Credential", "Operation", "Database", "SyncIssues", "make", "meta", "key", "name", "description", "input", "Struct", "team", "String", "annotations", "output", "Any", "services", "CredentialsService", "Service", "Effect", "Filter", "Obj", "Query", "Ref", "Database", "failedInvariant", "log", "key", "keys", "target", "foreignKeyId", "existing", "runQuery", "select", "foreignKeys", "source", "foreignId", "getDXN", "obj", "copyObjectData", "concurrency", "Object", "getMeta"]
|
|
7
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Plan_exports
|
|
3
|
-
} from "./chunk-CLHVRIYF.mjs";
|
|
4
|
-
|
|
5
|
-
// src/blueprints/planning/functions/definitions.ts
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
|
-
import { AiContextService } from "@dxos/assistant";
|
|
8
|
-
import { Operation } from "@dxos/compute";
|
|
9
|
-
import { Database } from "@dxos/echo";
|
|
10
|
-
import { trim } from "@dxos/util";
|
|
11
|
-
var INSTRUCTIONS = trim`
|
|
12
|
-
TASK MANAGEMENT TOOL - USAGE GUIDELINES
|
|
13
|
-
|
|
14
|
-
This tool maintains an organized task list during work sessions to track progress, break down objectives, and ensure thoroughness. After creating initial tasks, update them silently without announcing changes to the user.
|
|
15
|
-
|
|
16
|
-
=== CORE USAGE PRINCIPLES ===
|
|
17
|
-
|
|
18
|
-
Create and manage tasks for: multi-step objectives requiring 3+ distinct actions, complex projects needing careful sequencing, user requests for task organization, multiple deliverables provided together, new instructions (capture as tasks immediately with new IDs), completed work (mark done and add follow-ups), and active work (mark as 'in-progress', limit one at a time).
|
|
19
|
-
|
|
20
|
-
Skip task management for: single straightforward actions, simple requests achievable in 1-2 steps, informational queries, quick lookups or clarifications, and avoid creating verification tasks unless requested.
|
|
21
|
-
|
|
22
|
-
=== TOOL SPECIFICATION ===
|
|
23
|
-
|
|
24
|
-
update-tasks requires an array of task objects. Each task object contains:
|
|
25
|
-
- id (string, required): unique identifier like "task_1" or "research_sources"
|
|
26
|
-
- title (string, optional): update to clarify or refine task description
|
|
27
|
-
- status (string, optional): 'todo' | 'in-progress' | 'done'
|
|
28
|
-
|
|
29
|
-
Task status meanings: 'todo' means not yet started, 'in-progress' means currently being worked on, 'done' means completed successfully.
|
|
30
|
-
|
|
31
|
-
=== OPERATIONAL GUIDELINES ===
|
|
32
|
-
|
|
33
|
-
Update tasks in real-time as work progresses. Mark tasks 'done' immediately upon completion. Maintain only ONE task with 'in-progress' status at a time. Complete current tasks before starting new ones. Use specific, actionable task titles. Break complex work into manageable logical pieces. Batch task updates with other actions when possible for efficiency.
|
|
34
|
-
|
|
35
|
-
=== USAGE EXAMPLES ===
|
|
36
|
-
|
|
37
|
-
<example type="research_project">
|
|
38
|
-
<user_message>I need to research sustainable packaging options and write a report comparing costs and environmental impact.</user_message>
|
|
39
|
-
<assistant_action>
|
|
40
|
-
Creates tasks:
|
|
41
|
-
1. {id: "research_materials", title: "Research sustainable packaging materials", status: "in-progress"}
|
|
42
|
-
2. {id: "compare_costs", title: "Compile cost comparison data", status: "todo"}
|
|
43
|
-
3. {id: "assess_impact", title: "Evaluate environmental impact metrics", status: "todo"}
|
|
44
|
-
4. {id: "draft_report", title: "Write comparative analysis report", status: "todo"}
|
|
45
|
-
|
|
46
|
-
Begins research work immediately in same response.
|
|
47
|
-
</assistant_action>
|
|
48
|
-
<reasoning>Multi-phase project requiring systematic tracking across research, analysis, and writing stages.</reasoning>
|
|
49
|
-
</example>
|
|
50
|
-
|
|
51
|
-
<example type="event_planning">
|
|
52
|
-
<user_message>Help me plan a team retreat - venue, agenda, catering, and send invitations.</user_message>
|
|
53
|
-
<assistant_action>
|
|
54
|
-
Creates tasks:
|
|
55
|
-
1. {id: "venue_options", title: "Research and recommend venues", status: "in-progress"}
|
|
56
|
-
2. {id: "draft_agenda", title: "Create retreat agenda", status: "todo"}
|
|
57
|
-
3. {id: "arrange_catering", title: "Coordinate catering options", status: "todo"}
|
|
58
|
-
4. {id: "send_invites", title: "Draft and send invitations", status: "todo"}
|
|
59
|
-
</assistant_action>
|
|
60
|
-
<reasoning>Multiple distinct deliverables with dependencies requiring organized tracking.</reasoning>
|
|
61
|
-
</example>
|
|
62
|
-
|
|
63
|
-
<example type="document_analysis">
|
|
64
|
-
<user_message>Review this 30-page contract for key terms, risks, and negotiation points.</user_message>
|
|
65
|
-
<assistant_action>
|
|
66
|
-
Creates tasks:
|
|
67
|
-
1. {id: "extract_key_terms", title: "Identify key contractual terms", status: "in-progress"}
|
|
68
|
-
2. {id: "flag_risks", title: "Flag potential risks and liabilities", status: "todo"}
|
|
69
|
-
3. {id: "negotiation_points", title: "Compile negotiation recommendations", status: "todo"}
|
|
70
|
-
4. {id: "summary_doc", title: "Prepare executive summary", status: "todo"}
|
|
71
|
-
</assistant_action>
|
|
72
|
-
<reasoning>Substantial analysis work requiring methodical breakdown and systematic review.</reasoning>
|
|
73
|
-
</example>
|
|
74
|
-
|
|
75
|
-
<example type="multiple_deliverables">
|
|
76
|
-
<user_message>I need: 1) competitor analysis for three companies, 2) SWOT analysis, 3) market positioning recommendations.</user_message>
|
|
77
|
-
<assistant_action>
|
|
78
|
-
Creates tasks:
|
|
79
|
-
1. {id: "competitor_research", title: "Research three competitor companies", status: "in-progress"}
|
|
80
|
-
2. {id: "swot_analysis", title: "Develop SWOT analysis", status: "todo"}
|
|
81
|
-
3. {id: "positioning_recs", title: "Create market positioning recommendations", status: "todo"}
|
|
82
|
-
</assistant_action>
|
|
83
|
-
<reasoning>User provided numbered list of distinct deliverables requiring separate effort.</reasoning>
|
|
84
|
-
</example>
|
|
85
|
-
|
|
86
|
-
<example type="skip_simple_question">
|
|
87
|
-
<user_message>What's the difference between renewable and sustainable energy?</user_message>
|
|
88
|
-
<assistant_action>Provides explanation directly without creating tasks.</assistant_action>
|
|
89
|
-
<reasoning>Informational request with no actionable work to complete or track.</reasoning>
|
|
90
|
-
</example>
|
|
91
|
-
|
|
92
|
-
<example type="skip_quick_lookup">
|
|
93
|
-
<user_message>Find the population of Tokyo.</user_message>
|
|
94
|
-
<assistant_action>Searches and provides answer without task tracking.</assistant_action>
|
|
95
|
-
<reasoning>Single straightforward lookup completable immediately.</reasoning>
|
|
96
|
-
</example>
|
|
97
|
-
|
|
98
|
-
<example type="skip_trivial_task">
|
|
99
|
-
<user_message>Summarize this 2-paragraph email.</user_message>
|
|
100
|
-
<assistant_action>Provides summary directly without creating tasks.</assistant_action>
|
|
101
|
-
<reasoning>Single simple action requiring no breakdown or progress tracking.</reasoning>
|
|
102
|
-
</example>
|
|
103
|
-
|
|
104
|
-
<example type="skip_single_action">
|
|
105
|
-
<user_message>Check if my flight is on time.</user_message>
|
|
106
|
-
<assistant_action>Performs lookup and reports status without task management.</assistant_action>
|
|
107
|
-
<reasoning>One-step action with immediate completion, no organizational benefit from tasks.</reasoning>
|
|
108
|
-
</example>
|
|
109
|
-
|
|
110
|
-
=== BEST PRACTICES ===
|
|
111
|
-
|
|
112
|
-
For task creation: use descriptive unique IDs reflecting the work, start first task as 'in-progress', batch initial creation with beginning work. For progress tracking: update status immediately upon completion, keep only one 'in-progress' task unless parallel work is natural, add follow-up tasks as they emerge. For task breakdown: aim for reasonably-scoped tasks, group related small actions into logical units, split tasks requiring different approaches.
|
|
113
|
-
|
|
114
|
-
When uncertain whether to use task management, err on the side of creating tasks. Proactive organization demonstrates thoroughness and ensures comprehensive work completion.
|
|
115
|
-
`;
|
|
116
|
-
var TaskProps = Schema.Struct({
|
|
117
|
-
id: Plan_exports.TaskId,
|
|
118
|
-
title: Schema.String,
|
|
119
|
-
status: Schema.Literal("todo", "in-progress", "done")
|
|
120
|
-
});
|
|
121
|
-
var UpdateTasks = Operation.make({
|
|
122
|
-
meta: {
|
|
123
|
-
key: "org.dxos.function.planning.update-tasks",
|
|
124
|
-
name: "Update tasks",
|
|
125
|
-
description: INSTRUCTIONS
|
|
126
|
-
},
|
|
127
|
-
input: Schema.Struct({
|
|
128
|
-
tasks: Schema.Array(TaskProps)
|
|
129
|
-
}),
|
|
130
|
-
output: Schema.Any,
|
|
131
|
-
services: [
|
|
132
|
-
AiContextService,
|
|
133
|
-
Database.Service
|
|
134
|
-
]
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
export {
|
|
138
|
-
UpdateTasks
|
|
139
|
-
};
|
|
140
|
-
//# sourceMappingURL=chunk-MMTKJBB5.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/planning/functions/definitions.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiContextService } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database } from '@dxos/echo';\nimport { trim } from '@dxos/util';\n\nimport { Plan } from '../../../types';\n\nconst INSTRUCTIONS = trim`\nTASK MANAGEMENT TOOL - USAGE GUIDELINES\n\nThis tool maintains an organized task list during work sessions to track progress, break down objectives, and ensure thoroughness. After creating initial tasks, update them silently without announcing changes to the user.\n\n=== CORE USAGE PRINCIPLES ===\n\nCreate and manage tasks for: multi-step objectives requiring 3+ distinct actions, complex projects needing careful sequencing, user requests for task organization, multiple deliverables provided together, new instructions (capture as tasks immediately with new IDs), completed work (mark done and add follow-ups), and active work (mark as 'in-progress', limit one at a time).\n\nSkip task management for: single straightforward actions, simple requests achievable in 1-2 steps, informational queries, quick lookups or clarifications, and avoid creating verification tasks unless requested.\n\n=== TOOL SPECIFICATION ===\n\nupdate-tasks requires an array of task objects. Each task object contains:\n- id (string, required): unique identifier like \"task_1\" or \"research_sources\"\n- title (string, optional): update to clarify or refine task description\n- status (string, optional): 'todo' | 'in-progress' | 'done'\n\nTask status meanings: 'todo' means not yet started, 'in-progress' means currently being worked on, 'done' means completed successfully.\n\n=== OPERATIONAL GUIDELINES ===\n\nUpdate tasks in real-time as work progresses. Mark tasks 'done' immediately upon completion. Maintain only ONE task with 'in-progress' status at a time. Complete current tasks before starting new ones. Use specific, actionable task titles. Break complex work into manageable logical pieces. Batch task updates with other actions when possible for efficiency.\n\n=== USAGE EXAMPLES ===\n\n<example type=\"research_project\">\n<user_message>I need to research sustainable packaging options and write a report comparing costs and environmental impact.</user_message>\n<assistant_action>\nCreates tasks:\n1. {id: \"research_materials\", title: \"Research sustainable packaging materials\", status: \"in-progress\"}\n2. {id: \"compare_costs\", title: \"Compile cost comparison data\", status: \"todo\"}\n3. {id: \"assess_impact\", title: \"Evaluate environmental impact metrics\", status: \"todo\"}\n4. {id: \"draft_report\", title: \"Write comparative analysis report\", status: \"todo\"}\n\nBegins research work immediately in same response.\n</assistant_action>\n<reasoning>Multi-phase project requiring systematic tracking across research, analysis, and writing stages.</reasoning>\n</example>\n\n<example type=\"event_planning\">\n<user_message>Help me plan a team retreat - venue, agenda, catering, and send invitations.</user_message>\n<assistant_action>\nCreates tasks:\n1. {id: \"venue_options\", title: \"Research and recommend venues\", status: \"in-progress\"}\n2. {id: \"draft_agenda\", title: \"Create retreat agenda\", status: \"todo\"}\n3. {id: \"arrange_catering\", title: \"Coordinate catering options\", status: \"todo\"}\n4. {id: \"send_invites\", title: \"Draft and send invitations\", status: \"todo\"}\n</assistant_action>\n<reasoning>Multiple distinct deliverables with dependencies requiring organized tracking.</reasoning>\n</example>\n\n<example type=\"document_analysis\">\n<user_message>Review this 30-page contract for key terms, risks, and negotiation points.</user_message>\n<assistant_action>\nCreates tasks:\n1. {id: \"extract_key_terms\", title: \"Identify key contractual terms\", status: \"in-progress\"}\n2. {id: \"flag_risks\", title: \"Flag potential risks and liabilities\", status: \"todo\"}\n3. {id: \"negotiation_points\", title: \"Compile negotiation recommendations\", status: \"todo\"}\n4. {id: \"summary_doc\", title: \"Prepare executive summary\", status: \"todo\"}\n</assistant_action>\n<reasoning>Substantial analysis work requiring methodical breakdown and systematic review.</reasoning>\n</example>\n\n<example type=\"multiple_deliverables\">\n<user_message>I need: 1) competitor analysis for three companies, 2) SWOT analysis, 3) market positioning recommendations.</user_message>\n<assistant_action>\nCreates tasks:\n1. {id: \"competitor_research\", title: \"Research three competitor companies\", status: \"in-progress\"}\n2. {id: \"swot_analysis\", title: \"Develop SWOT analysis\", status: \"todo\"}\n3. {id: \"positioning_recs\", title: \"Create market positioning recommendations\", status: \"todo\"}\n</assistant_action>\n<reasoning>User provided numbered list of distinct deliverables requiring separate effort.</reasoning>\n</example>\n\n<example type=\"skip_simple_question\">\n<user_message>What's the difference between renewable and sustainable energy?</user_message>\n<assistant_action>Provides explanation directly without creating tasks.</assistant_action>\n<reasoning>Informational request with no actionable work to complete or track.</reasoning>\n</example>\n\n<example type=\"skip_quick_lookup\">\n<user_message>Find the population of Tokyo.</user_message>\n<assistant_action>Searches and provides answer without task tracking.</assistant_action>\n<reasoning>Single straightforward lookup completable immediately.</reasoning>\n</example>\n\n<example type=\"skip_trivial_task\">\n<user_message>Summarize this 2-paragraph email.</user_message>\n<assistant_action>Provides summary directly without creating tasks.</assistant_action>\n<reasoning>Single simple action requiring no breakdown or progress tracking.</reasoning>\n</example>\n\n<example type=\"skip_single_action\">\n<user_message>Check if my flight is on time.</user_message>\n<assistant_action>Performs lookup and reports status without task management.</assistant_action>\n<reasoning>One-step action with immediate completion, no organizational benefit from tasks.</reasoning>\n</example>\n\n=== BEST PRACTICES ===\n\nFor task creation: use descriptive unique IDs reflecting the work, start first task as 'in-progress', batch initial creation with beginning work. For progress tracking: update status immediately upon completion, keep only one 'in-progress' task unless parallel work is natural, add follow-up tasks as they emerge. For task breakdown: aim for reasonably-scoped tasks, group related small actions into logical units, split tasks requiring different approaches.\n\nWhen uncertain whether to use task management, err on the side of creating tasks. Proactive organization demonstrates thoroughness and ensures comprehensive work completion.\n`;\n\nconst TaskProps = Schema.Struct({\n id: Plan.TaskId,\n title: Schema.String,\n status: Schema.Literal('todo', 'in-progress', 'done'),\n});\n\nexport const UpdateTasks = Operation.make({\n meta: {\n key: 'org.dxos.function.planning.update-tasks',\n name: 'Update tasks',\n description: INSTRUCTIONS,\n },\n input: Schema.Struct({\n tasks: Schema.Array(TaskProps),\n }),\n output: Schema.Any,\n services: [AiContextService, Database.Service],\n});\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AACjC,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AACzB,SAASC,YAAY;AAIrB,IAAMC,eAAeC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GrB,IAAMC,YAAmBC,cAAO;EAC9BC,IAAIC,aAAKC;EACTC,OAAcC;EACdC,QAAeC,eAAQ,QAAQ,eAAe,MAAA;AAChD,CAAA;AAEO,IAAMC,cAAcC,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAajB;EACf;EACAkB,OAAcf,cAAO;IACnBgB,OAAcC,aAAMlB,SAAAA;EACtB,CAAA;EACAmB,QAAeC;EACfC,UAAU;IAACC;IAAkBC,SAASC;;AACxC,CAAA;",
|
|
6
|
-
"names": ["Schema", "AiContextService", "Operation", "Database", "trim", "INSTRUCTIONS", "trim", "TaskProps", "Struct", "id", "Plan", "TaskId", "title", "String", "status", "Literal", "UpdateTasks", "Operation", "make", "meta", "key", "name", "description", "input", "tasks", "Array", "output", "Any", "services", "AiContextService", "Database", "Service"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { AiContextService } from '@dxos/assistant';\nimport { Blueprint, Operation } from '@dxos/compute';\nimport { Database } 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 },\n input: Schema.Struct({}),\n output: Schema.Array(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 },\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(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, AiContextService],\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 },\n input: Schema.Struct({}),\n output: Schema.Void,\n services: [Blueprint.RegistryService, Database.Service],\n});\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AACjC,SAASC,WAAWC,iBAAiB;AACrC,SAASC,gBAAgB;AAElB,IAAMC,kBAAkBF,UAAUG,KAAK;EAC5CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO,CAAC,CAAA;EACtBC,QAAeC,aAAMZ,UAAUA,SAAS;EACxCa,UAAU;IAACb,UAAUc;;AACvB,CAAA;AAEO,IAAMC,mBAAmBd,UAAUG,KAAK;EAC7CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aACE;EACJ;EACAC,OAAcC,cAAO;IACnBM,MAAaJ,aAAaK,aAAM,EAAEC,YAAY;MAC5CV,aAAa;MACbW,UAAU;QAAC;UAAC;UAA6B;;;IAC3C,CAAA;EACF,CAAA;EACAR,QAAeD,cAAO;IACpBU,SAAgBR,aAAMZ,UAAUA,SAAS;IACzCqB,UAAiBT,aACRF,cAAO;MACZJ,KAAYW;MACZK,QAAeL;IACjB,CAAA,CAAA;EAEJ,CAAA;EACAJ,UAAU;IAACb,UAAUc;IAAiBZ,SAASqB;IAASxB;;AAC1D,CAAA;AAEO,IAAMyB,mBAAmBvB,UAAUG,KAAK;EAC7CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aACE;EACJ;EACAC,OAAcC,cAAO,CAAC,CAAA;EACtBC,QAAec;EACfZ,UAAU;IAACb,UAAUc;IAAiBZ,SAASqB;;AACjD,CAAA;",
|
|
6
|
-
"names": ["Schema", "AiContextService", "Blueprint", "Operation", "Database", "QueryBlueprints", "make", "meta", "key", "name", "description", "input", "Struct", "output", "Array", "services", "RegistryService", "EnableBlueprints", "keys", "String", "annotations", "examples", "enabled", "rejected", "reason", "Service", "UpdateBlueprints", "Void"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/database/functions/context-add.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { AiContextService } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\n\nimport { ContextAdd } from './definitions';\n\nexport default ContextAdd.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ obj }) {\n const { binder } = yield* AiContextService;\n yield* Effect.promise(() =>\n binder.bind({\n blueprints: [],\n objects: [obj],\n }),\n );\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AACjC,SAASC,iBAAiB;AAI1B,IAAA,sBAAeC,WAAWC,KACxBC,UAAUC,YACDC,UAAG,WAAW,EAAEC,IAAG,GAAE;AAC1B,QAAM,EAAEC,OAAM,IAAK,OAAOC;AAC1B,SAAcC,eAAQ,MACpBF,OAAOG,KAAK;IACVC,YAAY,CAAA;IACZC,SAAS;MAACN;;EACZ,CAAA,CAAA;AAEJ,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "AiContextService", "Operation", "ContextAdd", "pipe", "Operation", "withHandler", "fn", "obj", "binder", "AiContextService", "promise", "bind", "blueprints", "objects"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/database/functions/context-remove.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { AiContextService } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\n\nimport { ContextRemove } from './definitions';\n\nexport default ContextRemove.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ obj }) {\n const { binder } = yield* AiContextService;\n yield* Effect.promise(() =>\n binder.unbind({\n blueprints: [],\n objects: [obj],\n }),\n );\n }) as any,\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AACjC,SAASC,iBAAiB;AAI1B,IAAA,yBAAeC,cAAcC,KAC3BC,UAAUC,YACDC,UAAG,WAAW,EAAEC,IAAG,GAAE;AAC1B,QAAM,EAAEC,OAAM,IAAK,OAAOC;AAC1B,SAAcC,eAAQ,MACpBF,OAAOG,OAAO;IACZC,YAAY,CAAA;IACZC,SAAS;MAACN;;EACZ,CAAA,CAAA;AAEJ,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "AiContextService", "Operation", "ContextRemove", "pipe", "Operation", "withHandler", "fn", "obj", "binder", "AiContextService", "promise", "unbind", "blueprints", "objects"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/blueprint-manager/functions/enable-blueprints.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { AiContextService } from '@dxos/assistant';\nimport { Blueprint, Operation } from '@dxos/compute';\nimport { Ref } from '@dxos/echo';\n\nimport { EnableBlueprints } from './definitions';\n\nexport default EnableBlueprints.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ keys }) {\n const registry = yield* Blueprint.RegistryService;\n const enabled: Blueprint.Blueprint[] = [];\n const rejected: { key: string; reason: string }[] = [];\n\n for (const key of keys) {\n const blueprint = registry.getByKey(key);\n if (!blueprint) {\n rejected.push({ key, reason: 'Blueprint not found in registry.' });\n continue;\n }\n if (!blueprint.agentCanEnable) {\n rejected.push({ key, reason: 'Blueprint does not allow agent auto-enable (agentCanEnable is not set).' });\n continue;\n }\n const dbBlueprint = yield* Blueprint.upsert(key).pipe(Effect.orDie);\n enabled.push(dbBlueprint);\n }\n\n if (enabled.length > 0) {\n yield* AiContextService.bindContext({\n blueprints: enabled.map(Ref.make),\n });\n }\n\n return { enabled, rejected };\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AACjC,SAASC,WAAWC,iBAAiB;AACrC,SAASC,WAAW;AAIpB,IAAA,4BAAeC,iBAAiBC,KAC9BC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,KAAI,GAAE;AACnC,QAAMC,WAAW,OAAOC,UAAUC;AAClC,QAAMC,UAAiC,CAAA;AACvC,QAAMC,WAA8C,CAAA;AAEpD,aAAWC,OAAON,MAAM;AACtB,UAAMO,YAAYN,SAASO,SAASF,GAAAA;AACpC,QAAI,CAACC,WAAW;AACdF,eAASI,KAAK;QAAEH;QAAKI,QAAQ;MAAmC,CAAA;AAChE;IACF;AACA,QAAI,CAACH,UAAUI,gBAAgB;AAC7BN,eAASI,KAAK;QAAEH;QAAKI,QAAQ;MAA0E,CAAA;AACvG;IACF;AACA,UAAME,cAAc,OAAOV,UAAUW,OAAOP,GAAAA,EAAKV,KAAYkB,YAAK;AAClEV,YAAQK,KAAKG,WAAAA;EACf;AAEA,MAAIR,QAAQW,SAAS,GAAG;AACtB,WAAOC,iBAAiBC,YAAY;MAClCC,YAAYd,QAAQe,IAAIC,IAAIC,IAAI;IAClC,CAAA;EACF;AAEA,SAAO;IAAEjB;IAASC;EAAS;AAC7B,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "AiContextService", "Blueprint", "Operation", "Ref", "EnableBlueprints", "pipe", "Operation", "withHandler", "fnUntraced", "keys", "registry", "Blueprint", "RegistryService", "enabled", "rejected", "key", "blueprint", "getByKey", "push", "reason", "agentCanEnable", "dbBlueprint", "upsert", "orDie", "length", "AiContextService", "bindContext", "blueprints", "map", "Ref", "make"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/project/functions/qualifier.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as LanguageModel from '@effect/ai/LanguageModel';\nimport * as Prompt from '@effect/ai/Prompt';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj, Ref } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { trim } from '@dxos/util';\n\nimport { Plan, Agent } from '../../../types';\nimport { Qualifier } from './definitions';\n\nexport default Qualifier.pipe(\n Operation.withHandler(\n Effect.fnUntraced(\n function* ({ agent: agentRef, event }) {\n const agent = yield* Database.load(agentRef);\n invariant(Obj.instanceOf(Agent.Agent, agent));\n invariant(agent.chat, 'Agent has no chat.');\n\n const { id, name, queue } = agent;\n if (!queue) {\n throw new Error('Agent has no queue.');\n }\n\n const plan = yield* Database.load(agent.plan);\n const instructions = yield* Database.load(agent.instructions);\n\n const { value } = yield* Effect.scoped(\n LanguageModel.generateObject({\n schema: Schema.Struct({\n isRelevant: Schema.Boolean,\n }),\n prompt: Prompt.fromMessages([\n Prompt.systemMessage({\n content: trim`\n You are a qualifying agent that determines if the event is relevant to the agent.\n Respond with true if the event is relevant to the agent, false otherwise.\n If you are not sure, return true.\n The qualified events will be forwarded to the larger agent that will process them.\n <agent id=\"${id}\" name=\"${name}\">\n <instructions>\n ${instructions.content}\n </instructions>\n <plan>\n ${Plan.formatPlan(plan)}\n </plan>\n </agent>\n `,\n }),\n Prompt.userMessage({\n content: [\n Prompt.makePart('text', {\n text: trim`\n <event>\n ${JSON.stringify(event, null, 2)}\n </event>\n `,\n }),\n ],\n }),\n ]),\n }),\n );\n\n const { isRelevant } = value as { isRelevant: boolean };\n\n if (isRelevant) {\n const queueTarget = yield* Database.load(queue);\n if ('queue' in event && event.item) {\n const obj = event.item;\n yield* Effect.promise(() => queueTarget.append([obj]));\n } else if ('subject' in event && Ref.isRef(event.subject)) {\n const obj = yield* Database.load(event.subject);\n yield* Effect.promise(() => queueTarget.append([obj]));\n } else {\n throw new Error('Invalid event.');\n }\n }\n },\n Effect.provide(AiService.model('@anthropic/claude-sonnet-4-5')),\n ),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAIA,YAAYA,mBAAmB;AAC/B,YAAYC,YAAY;AACxB,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,KAAKC,WAAW;AACnC,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AAKrB,IAAA,eAAeC;IAKPC,oBAAUC,UAAIC,KAAWC,UAAW,YAAEC,kB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,gBAAA;IAEFjB;;;",
|
|
6
|
-
"names": ["LanguageModel", "Prompt", "Effect", "Schema", "AiService", "Operation", "Database", "Obj", "Ref", "invariant", "trim", "Qualifier", "invariant", "Obj", "instanceOf", "Agent", "agent", "name", "queue", "Error", "plan", "Database", "Effect", "scoped", "LanguageModel", "schema", "Struct", "isRelevant", "Boolean", "prompt", "fromMessages", "content", "instructions", "makePart", "text", "JSON", "queueTarget", "event", "promise", "obj", "append"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/database/functions/query.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Entity, Filter, Obj, Query as EchoQuery } from '@dxos/echo';\nimport { Database } from '@dxos/echo';\n\nimport { Query } from './definitions';\n\n// TODO(burdon): Move to toolkit (i.e., tool not function).\nexport default Query.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ in: parents, typename, text, includeContent = false, limit = 10, includeQueues = false }) {\n const { db } = yield* Database.Service;\n let query: EchoQuery.Any;\n if (text) {\n query = EchoQuery.all(\n ...text.split(' ').map((term) => EchoQuery.select(Filter.text(term, { type: 'full-text' }))),\n );\n if (typename !== undefined) {\n const schema = yield* Database.runSchemaQuery({ typename, location: ['database', 'runtime'] });\n if (schema.length === 0) {\n return yield* Effect.fail(new Error(`Schema ${typename} not found`));\n }\n query = query.select(Filter.type(schema[0]));\n }\n } else if (typename) {\n const schema = yield* Database.runSchemaQuery({ typename, location: ['database', 'runtime'] });\n if (schema.length === 0) {\n return yield* Effect.fail(new Error(`Schema ${typename} not found`));\n }\n query = EchoQuery.select(Filter.type(schema[0]));\n } else {\n query = EchoQuery.select(Filter.everything());\n }\n\n if (parents && parents.length > 0) {\n query = query.select(Filter.childOf(parents));\n }\n\n query = query.limit(limit);\n if (includeQueues) {\n // Must scope to the current space: `from({ allQueuesFromSpaces: true })` alone has no spaceIds, so the SQL\n // index returns nothing (see ObjectMetaIndex.buildSourceCondition / early returns when spaceIds are empty).\n query = query.from(db, { includeFeeds: true });\n }\n\n yield* Database.flush();\n const results = yield* Database.runQuery(query);\n if (includeContent) {\n return results.map((obj) => Entity.toJSON(obj));\n } else {\n return results.map((obj) => ({\n dxn: Obj.getDXN(obj).toString(),\n typename: Obj.getTypename(obj),\n label: Obj.getLabel(obj),\n }));\n }\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,QAAQC,QAAQC,KAAKC,SAASC,iBAAiB;AACxD,SAASC,gBAAgB;AAKzB,IAAA,gBAAeC,MAAMC,KACnBC,UAAUC,YACDC,UAAG,WAAW,EAAEC,IAAIC,SAASC,UAAUC,MAAMC,iBAAiB,OAAOC,QAAQ,IAAIC,gBAAgB,MAAK,GAAE;AAC7G,QAAM,EAAEC,GAAE,IAAK,OAAOC,SAASC;AAC/B,MAAIC;AACJ,MAAIP,MAAM;AACRO,YAAQC,UAAUC,IAAG,GAChBT,KAAKU,MAAM,GAAA,EAAKC,IAAI,CAACC,SAASJ,UAAUK,OAAOC,OAAOd,KAAKY,MAAM;MAAEG,MAAM;IAAY,CAAA,CAAA,CAAA,CAAA;AAE1F,QAAIhB,aAAaiB,QAAW;AAC1B,YAAMC,SAAS,OAAOZ,SAASa,eAAe;QAAEnB;QAAUoB,UAAU;UAAC;UAAY;;MAAW,CAAA;AAC5F,UAAIF,OAAOG,WAAW,GAAG;AACvB,eAAO,OAAcC,YAAK,IAAIC,MAAM,UAAUvB,QAAAA,YAAoB,CAAA;MACpE;AACAQ,cAAQA,MAAMM,OAAOC,OAAOC,KAAKE,OAAO,CAAA,CAAE,CAAA;IAC5C;EACF,WAAWlB,UAAU;AACnB,UAAMkB,SAAS,OAAOZ,SAASa,eAAe;MAAEnB;MAAUoB,UAAU;QAAC;QAAY;;IAAW,CAAA;AAC5F,QAAIF,OAAOG,WAAW,GAAG;AACvB,aAAO,OAAcC,YAAK,IAAIC,MAAM,UAAUvB,QAAAA,YAAoB,CAAA;IACpE;AACAQ,YAAQC,UAAUK,OAAOC,OAAOC,KAAKE,OAAO,CAAA,CAAE,CAAA;EAChD,OAAO;AACLV,YAAQC,UAAUK,OAAOC,OAAOS,WAAU,CAAA;EAC5C;AAEA,MAAIzB,WAAWA,QAAQsB,SAAS,GAAG;AACjCb,YAAQA,MAAMM,OAAOC,OAAOU,QAAQ1B,OAAAA,CAAAA;EACtC;AAEAS,UAAQA,MAAML,MAAMA,KAAAA;AACpB,MAAIC,eAAe;AAGjBI,YAAQA,MAAMkB,KAAKrB,IAAI;MAAEsB,cAAc;IAAK,CAAA;EAC9C;AAEA,SAAOrB,SAASsB,MAAK;AACrB,QAAMC,UAAU,OAAOvB,SAASwB,SAAStB,KAAAA;AACzC,MAAIN,gBAAgB;AAClB,WAAO2B,QAAQjB,IAAI,CAACmB,QAAQC,OAAOC,OAAOF,GAAAA,CAAAA;EAC5C,OAAO;AACL,WAAOF,QAAQjB,IAAI,CAACmB,SAAS;MAC3BG,KAAKC,IAAIC,OAAOL,GAAAA,EAAKM,SAAQ;MAC7BrC,UAAUmC,IAAIG,YAAYP,GAAAA;MAC1BQ,OAAOJ,IAAIK,SAAST,GAAAA;IACtB,EAAA;EACF;AACF,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Operation", "Entity", "Filter", "Obj", "Query", "EchoQuery", "Database", "Query", "pipe", "Operation", "withHandler", "fn", "in", "parents", "typename", "text", "includeContent", "limit", "includeQueues", "db", "Database", "Service", "query", "EchoQuery", "all", "split", "map", "term", "select", "Filter", "type", "undefined", "schema", "runSchemaQuery", "location", "length", "fail", "Error", "everything", "childOf", "from", "includeFeeds", "flush", "results", "runQuery", "obj", "Entity", "toJSON", "dxn", "Obj", "getDXN", "toString", "getTypename", "label", "getLabel"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/linear/functions/sync-issues.ts", "../../../src/util/graphql.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FetchHttpClient from '@effect/platform/FetchHttpClient';\nimport * as HttpClient from '@effect/platform/HttpClient';\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { Credential, Operation } from '@dxos/compute';\nimport { Filter, Obj, Query, Ref, type Type } from '@dxos/echo';\nimport { Database } from '@dxos/echo';\nimport { withAuthorization } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { Person, Pipeline, Task } from '@dxos/types';\n\nimport { syncObjects } from '../../../sync';\nimport { graphqlRequestBody } from '../../../util';\nimport { SyncIssues } from './definitions';\n\nconst queryIssues = `\nquery Issues($teamId: String!, $after: DateTimeOrDuration!) {\n team(id: $teamId) {\n id\n name\n\n\n issues(last: 150, orderBy: updatedAt, filter: {\n updatedAt: { gt: $after }\n }) {\n edges {\n node {\n id\n title\n createdAt\n updatedAt\n description\n assignee { id, name }\n state {\n name\n }\n project {\n id\n name\n }\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n}\n`;\n\ntype LinearIssue = {\n id: string;\n title: string;\n createdAt: string;\n updatedAt: string;\n description: string;\n assignee: LinearPerson;\n state: { name: string };\n project: { id: string; name: string };\n};\n\ntype LinearPerson = {\n id: string;\n name: string;\n};\n\nexport const LINEAR_ID_KEY = 'linear.app/id';\nexport const LINEAR_TEAM_ID_KEY = 'linear.app/teamId';\nexport const LINEAR_UPDATED_AT_KEY = 'linear.app/updatedAt';\n\nexport default SyncIssues.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ team }) {\n const credential = yield* Credential.CredentialsService.getCredential({ service: 'linear.app' });\n const client = yield* HttpClient.HttpClient.pipe(Effect.map(withAuthorization(credential.apiKey!)));\n\n const after = yield* getLatestUpdateTimestamp(team, Task.Task);\n log.info('will fetch', { after });\n\n const response = yield* client.post('https://api.linear.app/graphql', {\n body: yield* graphqlRequestBody(queryIssues, {\n teamId: team,\n after,\n }),\n });\n const json: any = yield* response.json;\n const tasks = (json.data.team.issues.edges as any[]).map((edge: any) =>\n mapLinearIssue(edge.node as LinearIssue, { teamId: team }),\n );\n log.info('Fetched tasks', { count: tasks.length });\n\n return {\n objects: yield* syncObjects(tasks, { foreignKeyId: LINEAR_ID_KEY }),\n syncComplete: tasks.length < 150,\n };\n }, Effect.provide(FetchHttpClient.layer)),\n ),\n);\n\nconst getLatestUpdateTimestamp: (\n teamId: string,\n dataType: Type.AnyObj,\n) => Effect.Effect<string, never, Database.Service> = Effect.fnUntraced(function* (teamId, dataType) {\n const existingTasks = yield* Database.runQuery(\n Query.type(dataType).select(Filter.foreignKeys(dataType, [{ source: LINEAR_TEAM_ID_KEY, id: teamId }])),\n );\n return Function.pipe(\n existingTasks,\n Array.map((task) => Obj.getKeys(task, LINEAR_UPDATED_AT_KEY).at(0)?.id),\n Array.filter((x) => x !== undefined),\n Array.reduce('2025-01-01T00:00:00.000Z', (acc: string, x: string) => (x > acc ? x : acc)),\n );\n});\n\nconst mapLinearPerson = (person: LinearPerson, { teamId }: { teamId: string }): Person.Person =>\n Obj.make(Person.Person, {\n [Obj.Meta]: {\n keys: [\n {\n id: person.id,\n source: LINEAR_ID_KEY,\n },\n {\n id: teamId,\n source: LINEAR_TEAM_ID_KEY,\n },\n ],\n },\n nickname: person.name,\n });\n\nconst mapLinearIssue = (issue: LinearIssue, { teamId }: { teamId: string }): Task.Task =>\n Obj.make(Task.Task, {\n [Obj.Meta]: {\n keys: [\n {\n id: issue.id,\n source: LINEAR_ID_KEY,\n },\n {\n id: issue.updatedAt,\n source: LINEAR_UPDATED_AT_KEY,\n },\n {\n id: teamId,\n source: LINEAR_TEAM_ID_KEY,\n },\n ],\n },\n title: issue.title ?? undefined,\n description: issue.description ?? undefined,\n assigned: !issue.assignee ? undefined : Ref.make(mapLinearPerson(issue.assignee, { teamId })),\n // TODO(dmaretskyi): Sync those (+ linear team as org?).\n // state: issue.state.name,\n\n project: !issue.project\n ? undefined\n : Ref.make(\n Pipeline.make({\n [Obj.Meta]: {\n keys: [\n {\n id: issue.project.id,\n source: LINEAR_ID_KEY,\n },\n {\n id: teamId,\n source: LINEAR_TEAM_ID_KEY,\n },\n ],\n },\n name: issue.project.name,\n }),\n ),\n });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as HttpBody from '@effect/platform/HttpBody';\n\n/**\n * Template tag literal to get syntax highlighting for the query.\n *\n * @example\n * ```ts\n * const query = gql`\n * query Team($teamId: String!) {\n * team(id: $teamId) {\n * id\n * name\n * }\n * }\n * `;\n * ```\n */\nexport const gql = (query: string) => query;\n\n/**\n * @returns JSON body for the graphql request.\n */\nexport const graphqlRequestBody = (query: string, variables: Record<string, any> = {}) =>\n HttpBody.json({\n query,\n variables,\n });\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,qBAAqB;AACjC,YAAYC,gBAAgB;AAC5B,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,YAAYC,iBAAiB;AACtC,SAASC,QAAQC,KAAKC,OAAOC,WAAsB;AACnD,SAASC,gBAAgB;AACzB,SAASC,yBAAyB;AAClC,SAASC,WAAW;AACpB,SAASC,QAAQC,UAAUC,YAAY;;;ACXvC,YAAYC,cAAc;AAsBnB,IAAMC,qBAAqB,CAACC,OAAeC,YAAiC,CAAC,MACzEC,cAAK;EACZF;EACAC;AACF,CAAA;;;ADTF,IAAA,eAAME;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDC,IAAMC,gBAAAA;AAEb,IAAA,qBACEC;AAEI,IAAMC,wBAAoBC;0BAA8CC,WAAS,KAAA,UAAA,YAAA,kBAAA,WAAA,EAAA,KAAA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AAA;WACJ,GAAA;;;QAGA,IAAA,OAAA;QACA,QAAA;;;QAGA,IAAA;QACD,QAAA;MACH;IACAC;EACF;EAEIC,UAAAA,OAAkBC;;qBAGZ,CAAA,OAAA,EAAA,OAAA,MAAA,IAAA,KAAA,KAAA,MAAA;WACJ,GAAA;;;QAGA,IAAA,MAAA;QACA,QAAA;;;QAGA,IAAA,MAAA;QACA,QAAA;;;QAGA,IAAA;QACD,QAAA;MACH;IACAC;EACAC;EACAC,OAAAA,MAAWH,SAAMI;eAAkExB,MAAAA,eAAAA;EAAO,UAAA,CAAA,MAAA,WAAA,SAAA,IAAA,KAAA,gBAAA,MAAA,UAAA;IAC1F;EACA,CAAA,CAAA;;;WAOUyB,CAAAA,MAAM,UAAA,SAAA,IAAA,KAAA,SAAA,KAAA;aACJ,GAAA;;;UAGA,IAAA,MAAA,QAAA;UACA,QAAA;;;UAGA,IAAA;UACD,QAAA;QACH;MACAC;IACF;IAER,MAAA,MAAA,QAAA;;;",
|
|
6
|
-
"names": ["FetchHttpClient", "HttpClient", "Array", "Effect", "Function", "Credential", "Operation", "Filter", "Obj", "Query", "Ref", "Database", "withAuthorization", "log", "Person", "Pipeline", "Task", "HttpBody", "graphqlRequestBody", "query", "variables", "json", "queryIssues", "LINEAR_UPDATED_AT_KEY", "Operation", "credential", "Credential", "service", "client", "log", "info", "after", "graphqlRequestBody", "team", "teamId", "json", "count", "syncObjects", "syncComplete", "tasks", "Effect", "FetchHttpClient", "layer", "existingTasks", "Database", "runQuery", "LINEAR_TEAM_ID_KEY", "mapLinearPerson", "person", "Obj", "make", "Person", "nickname", "mapLinearIssue", "issue", "title", "description", "assigned", "assignee", "keys", "name"]
|
|
7
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
UpdateTasks
|
|
3
|
-
} from "./chunk-MMTKJBB5.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Agent_exports,
|
|
6
|
-
Plan_exports
|
|
7
|
-
} from "./chunk-CLHVRIYF.mjs";
|
|
8
|
-
import "./chunk-NR3GTWRC.mjs";
|
|
9
|
-
import "./chunk-KGU725LW.mjs";
|
|
10
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
11
|
-
|
|
12
|
-
// src/blueprints/planning/functions/update-tasks.ts
|
|
13
|
-
import * as Effect from "effect/Effect";
|
|
14
|
-
import { Operation } from "@dxos/compute";
|
|
15
|
-
import { Database, Obj } from "@dxos/echo";
|
|
16
|
-
import { trim } from "@dxos/util";
|
|
17
|
-
var update_tasks_default = UpdateTasks.pipe(Operation.withHandler(Effect.fn(function* ({ tasks: newTasks }) {
|
|
18
|
-
const agent = yield* Agent_exports.getFromChatContext;
|
|
19
|
-
const plan = yield* Database.load(agent.plan);
|
|
20
|
-
Obj.update(plan, (plan2) => {
|
|
21
|
-
for (const task of newTasks) {
|
|
22
|
-
const existingTask = plan2.tasks.find((t) => t.id === task.id);
|
|
23
|
-
if (existingTask) {
|
|
24
|
-
existingTask.title = task.title;
|
|
25
|
-
existingTask.status = task.status;
|
|
26
|
-
} else {
|
|
27
|
-
plan2.tasks.push({
|
|
28
|
-
id: task.id,
|
|
29
|
-
title: task.title,
|
|
30
|
-
status: task.status
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return trim`
|
|
36
|
-
Tasks updated. Don't forget to mark tasks as done when you're done with them or update their status to 'in-progress' when you start working on them.
|
|
37
|
-
Current plan:
|
|
38
|
-
<plan>
|
|
39
|
-
${Plan_exports.formatPlan(plan)}
|
|
40
|
-
</plan>
|
|
41
|
-
`;
|
|
42
|
-
})));
|
|
43
|
-
export {
|
|
44
|
-
update_tasks_default as default
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=update-tasks-ML2FCYU5.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/planning/functions/update-tasks.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj } from '@dxos/echo';\nimport { trim } from '@dxos/util';\n\nimport { Plan, Agent } from '../../../types';\nimport { UpdateTasks } from './definitions';\n\nexport default UpdateTasks.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ tasks: newTasks }) {\n const agent = yield* Agent.getFromChatContext;\n const plan = yield* Database.load(agent.plan);\n\n Obj.update(plan, (plan) => {\n for (const task of newTasks) {\n const existingTask = plan.tasks.find((t) => t.id === task.id);\n if (existingTask) {\n existingTask.title = task.title;\n existingTask.status = task.status;\n } else {\n plan.tasks.push({\n id: task.id,\n title: task.title,\n status: task.status,\n });\n }\n }\n });\n\n return trim`\n Tasks updated. Don't forget to mark tasks as done when you're done with them or update their status to 'in-progress' when you start working on them.\n Current plan:\n <plan>\n ${Plan.formatPlan(plan)}\n </plan>\n `;\n }) as any,\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,WAAW;AAC9B,SAASC,YAAY;AAKrB,IAAA,uBAAeC,YAAYC,KACzBC,UAAUC,YACDC,UAAG,WAAW,EAAEC,OAAOC,SAAQ,GAAE;AACtC,QAAMC,QAAQ,OAAOC,cAAMC;AAC3B,QAAMC,OAAO,OAAOC,SAASC,KAAKL,MAAMG,IAAI;AAE5CG,MAAIC,OAAOJ,MAAM,CAACA,UAAAA;AAChB,eAAWK,QAAQT,UAAU;AAC3B,YAAMU,eAAeN,MAAKL,MAAMY,KAAK,CAACC,MAAMA,EAAEC,OAAOJ,KAAKI,EAAE;AAC5D,UAAIH,cAAc;AAChBA,qBAAaI,QAAQL,KAAKK;AAC1BJ,qBAAaK,SAASN,KAAKM;MAC7B,OAAO;AACLX,QAAAA,MAAKL,MAAMiB,KAAK;UACdH,IAAIJ,KAAKI;UACTC,OAAOL,KAAKK;UACZC,QAAQN,KAAKM;QACf,CAAA;MACF;IACF;EACF,CAAA;AAEA,SAAOE;;;;YAIDC,aAAKC,WAAWf,IAAAA,CAAAA;;;AAGxB,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Operation", "Database", "Obj", "trim", "UpdateTasks", "pipe", "Operation", "withHandler", "fn", "tasks", "newTasks", "agent", "Agent", "getFromChatContext", "plan", "Database", "load", "Obj", "update", "task", "existingTask", "find", "t", "id", "title", "status", "push", "trim", "Plan", "formatPlan"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AiContextService } from '@dxos/assistant';
|
|
2
|
-
import { Operation } from '@dxos/compute';
|
|
3
|
-
import { Database } from '@dxos/echo';
|
|
4
|
-
export declare const UpdateTasks: Operation.Definition<{
|
|
5
|
-
readonly tasks: readonly {
|
|
6
|
-
readonly id: string & import("effect/Brand").Brand<"@dxos/assistant-toolkit/TaskId">;
|
|
7
|
-
readonly title: string;
|
|
8
|
-
readonly status: "done" | "in-progress" | "todo";
|
|
9
|
-
}[];
|
|
10
|
-
}, any, AiContextService | Database.Service>;
|
|
11
|
-
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../../../../src/blueprints/planning/functions/definitions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAqHtC,eAAO,MAAM,WAAW;;;;;;4CAWtB,CAAC"}
|
|
File without changes
|
/package/dist/lib/neutral/{create-project-GLDEAWTT.mjs.map → create-project-3AGXJ4TD.mjs.map}
RENAMED
|
File without changes
|
/package/dist/lib/neutral/{fetch-messages-PWGUG5G3.mjs.map → fetch-messages-QOBBCTGC.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/neutral/{query-blueprints-KXADGHSA.mjs.map → query-blueprints-PLWYVOI3.mjs.map}
RENAMED
|
File without changes
|
/package/dist/lib/neutral/{relation-create-Z3NGW4VU.mjs.map → relation-create-YAAAFTR2.mjs.map}
RENAMED
|
File without changes
|
/package/dist/lib/neutral/{relation-delete-LXY7W2YO.mjs.map → relation-delete-IEPKERFR.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|