@dxos/assistant-toolkit 0.14.0 → 0.16.0

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.
Files changed (77) hide show
  1. package/dist/lib/AgentOperation.mjs +1 -55
  2. package/dist/lib/Memory.mjs +1 -19
  3. package/dist/lib/chunk-AgentOperation.mjs +55 -0
  4. package/dist/lib/chunk-AgentOperation.mjs.map +1 -0
  5. package/dist/lib/chunk-AgentOperationHandlerSet.mjs +8 -0
  6. package/dist/lib/chunk-AgentOperationHandlerSet.mjs.map +1 -0
  7. package/dist/lib/chunk-AgentSkill.mjs +46 -0
  8. package/dist/lib/chunk-AgentSkill.mjs.map +1 -0
  9. package/dist/lib/chunk-AlarmSkill.mjs +31 -0
  10. package/dist/lib/chunk-AlarmSkill.mjs.map +1 -0
  11. package/dist/lib/chunk-AutomationSkill.mjs +100 -0
  12. package/dist/lib/chunk-AutomationSkill.mjs.map +1 -0
  13. package/dist/lib/chunk-BrowserSkill.mjs +30 -0
  14. package/dist/lib/chunk-BrowserSkill.mjs.map +1 -0
  15. package/dist/lib/chunk-ChatContextSkill.mjs +31 -0
  16. package/dist/lib/chunk-ChatContextSkill.mjs.map +1 -0
  17. package/dist/lib/chunk-DelegationSkill.mjs +32 -0
  18. package/dist/lib/chunk-DelegationSkill.mjs.map +1 -0
  19. package/dist/lib/chunk-DelegationStrategy.mjs +2 -2
  20. package/dist/lib/chunk-DelegationStrategy.mjs.map +1 -1
  21. package/dist/lib/chunk-Memory.mjs +19 -0
  22. package/dist/lib/chunk-Memory.mjs.map +1 -0
  23. package/dist/lib/chunk-MemorySkill.mjs +39 -0
  24. package/dist/lib/chunk-MemorySkill.mjs.map +1 -0
  25. package/dist/lib/chunk-PlanningSkill.mjs +47 -0
  26. package/dist/lib/chunk-PlanningSkill.mjs.map +1 -0
  27. package/dist/lib/chunk-SkillManagerSkill.mjs +47 -0
  28. package/dist/lib/chunk-SkillManagerSkill.mjs.map +1 -0
  29. package/dist/lib/chunk-SlashCommand.mjs +41 -0
  30. package/dist/lib/{ns/SlashCommand.mjs.map → chunk-SlashCommand.mjs.map} +1 -1
  31. package/dist/lib/chunk-WebSearchSkill.mjs.map +1 -1
  32. package/dist/lib/chunk-operations.mjs.map +1 -1
  33. package/dist/lib/chunk-operations2.mjs.map +1 -1
  34. package/dist/lib/chunk-operations3.mjs.map +1 -1
  35. package/dist/lib/chunk-operations4.mjs +1 -1
  36. package/dist/lib/chunk-operations4.mjs.map +1 -1
  37. package/dist/lib/chunk-operations5.mjs.map +1 -1
  38. package/dist/lib/chunk-operations7.mjs.map +1 -1
  39. package/dist/lib/chunk-operations8.mjs +1 -1
  40. package/dist/lib/chunk-query.mjs +1 -1
  41. package/dist/lib/chunk-query.mjs.map +1 -1
  42. package/dist/lib/chunk-run-instructions.mjs +1 -1
  43. package/dist/lib/chunk-run-instructions.mjs.map +1 -1
  44. package/dist/lib/chunk-save.mjs +1 -1
  45. package/dist/lib/chunk-save.mjs.map +1 -1
  46. package/dist/lib/index.mjs +13 -13
  47. package/dist/lib/ns/AgentOperationHandlerSet.mjs +2 -8
  48. package/dist/lib/ns/AgentSkill.mjs +2 -45
  49. package/dist/lib/ns/AlarmSkill.mjs +3 -31
  50. package/dist/lib/ns/AutomationSkill.mjs +1 -100
  51. package/dist/lib/ns/BrowserSkill.mjs +1 -30
  52. package/dist/lib/ns/ChatContextSkill.mjs +3 -31
  53. package/dist/lib/ns/DelegationSkill.mjs +3 -32
  54. package/dist/lib/ns/DelegationStrategy.mjs +1 -2
  55. package/dist/lib/ns/MemorySkill.mjs +3 -39
  56. package/dist/lib/ns/PlanningSkill.mjs +3 -47
  57. package/dist/lib/ns/SkillManagerSkill.mjs +3 -47
  58. package/dist/lib/ns/SlashCommand.mjs +1 -41
  59. package/dist/lib/ns/WebSearchSkill.mjs +1 -2
  60. package/dist/lib/testing.mjs +1 -1
  61. package/dist/lib/testing.mjs.map +1 -1
  62. package/dist/types/src/skills/agent/operations/definitions.d.ts +1 -0
  63. package/dist/types/src/skills/agent/operations/definitions.d.ts.map +1 -1
  64. package/dist/types/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +28 -28
  66. package/dist/lib/AgentOperation.mjs.map +0 -1
  67. package/dist/lib/Memory.mjs.map +0 -1
  68. package/dist/lib/ns/AgentOperationHandlerSet.mjs.map +0 -1
  69. package/dist/lib/ns/AgentSkill.mjs.map +0 -1
  70. package/dist/lib/ns/AlarmSkill.mjs.map +0 -1
  71. package/dist/lib/ns/AutomationSkill.mjs.map +0 -1
  72. package/dist/lib/ns/BrowserSkill.mjs.map +0 -1
  73. package/dist/lib/ns/ChatContextSkill.mjs.map +0 -1
  74. package/dist/lib/ns/DelegationSkill.mjs.map +0 -1
  75. package/dist/lib/ns/MemorySkill.mjs.map +0 -1
  76. package/dist/lib/ns/PlanningSkill.mjs.map +0 -1
  77. package/dist/lib/ns/SkillManagerSkill.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-MemorySkill.mjs","names":[],"sources":["../../src/skills/memory/MemorySkill.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Skill from '@dxos/compute/Skill';\nimport { Ref } from '@dxos/echo';\nimport { Text } from '@dxos/schema';\nimport { trim } from '@dxos/util';\n\nimport { DeleteMemory, QueryMemories, SaveMemory } from './operations/definitions.ts';\n\nexport const key = 'org.dxos.skill.memory';\n\nconst instructions = trim`\n You have the ability to save and recall memories.\n Memories are persistent knowledge units stored in the database.\n Use memories to remember facts, user preferences, decisions, and any knowledge that should persist across conversations.\n\n When the user asks you to remember something, save it as a memory with a descriptive title.\n When the user asks about something you might have stored, query your memories first.\n You can also delete outdated or incorrect memories.\n`;\n\nexport const make = () =>\n Skill.make({\n key,\n name: 'Memory',\n description: 'Persistent memory storage and retrieval.',\n agentCanEnable: true,\n instructions: {\n source: Ref.make(Text.make({ content: instructions })),\n },\n tools: Skill.toolDefinitions({ operations: [SaveMemory, QueryMemories, DeleteMemory] }),\n });\n\nexport { MemoryHandlers as Handlers } from './operations/index.ts';\nexport * as Operations from './operations/definitions.ts';\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,MAAM;AAEnB,IAAM,eAAe,IAAI;;;;;;;;;AAUzB,IAAa,aACX,MAAM,KAAK;CACT;CACA,MAAM;CACN,aAAa;CACb,gBAAgB;CAChB,cAAc,EACZ,QAAQ,IAAI,KAAK,KAAK,KAAK,EAAE,SAAS,aAAa,CAAC,CAAC,EACvD;CACA,OAAO,MAAM,gBAAgB,EAAE,YAAY;EAAC;EAAY;EAAe;CAAY,EAAE,CAAC;AACxF,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { a as definitions_exports, i as UpdateTasks, n as AskQuestion, r as PlanReminder, t as PlanningHandlers } from "./chunk-operations3.mjs";
3
+ import { Ref } from "@dxos/echo";
4
+ import { trim } from "@dxos/util";
5
+ import * as Skill from "@dxos/compute/Skill";
6
+ import * as Template from "@dxos/compute/Template";
7
+ import * as Operation from "@dxos/compute/Operation";
8
+ //#region src/skills/planning/PlanningSkill.ts
9
+ var PlanningSkill_exports = /* @__PURE__ */ __exportAll({
10
+ Handlers: () => PlanningHandlers,
11
+ Operations: () => definitions_exports,
12
+ key: () => key,
13
+ make: () => make
14
+ });
15
+ var key = "org.dxos.skill.planning";
16
+ var make = () => Skill.make({
17
+ key,
18
+ name: "Planning",
19
+ description: "Plans and tracks complex tasks using artifacts.",
20
+ agentCanEnable: true,
21
+ tools: Skill.toolDefinitions({ operations: [UpdateTasks, AskQuestion] }),
22
+ instructions: Template.make({ source: trim`
23
+ {{! Planning }}
24
+
25
+ The conversation has a durable, numbered task checklist that you cannot see directly.
26
+ Before answering any question about tasks — or acting on a task referenced by number or
27
+ title — read the current checklist first (call the get-agent-context tool when available;
28
+ otherwise the update-tasks result echoes it). Ordinals like "task 1" refer to that
29
+ numbered list, and each line carries the task's ref.
30
+ Track your work with update-tasks: address an existing task by its ref, set create only to
31
+ make a new one, keep exactly one task started at a time, and mark a task done as soon as it
32
+ completes. Starting a task assigns it to you.
33
+ Do only what the user asked: if they name a specific task or subset, complete exactly
34
+ that and stop — never start unrequested tasks on your own.
35
+ A task that already exists elsewhere (a project's task, a sub-task of one you were given) is
36
+ worked through its own ref — never recreate it with create. assign puts it on this checklist
37
+ and makes you its assignee; unassign takes it off and clears the assignee, never deleting it.
38
+ ` }),
39
+ hooks: [{
40
+ spec: { _tag: "end-request" },
41
+ function: Ref.make(Operation.serialize(PlanReminder))
42
+ }]
43
+ });
44
+ //#endregion
45
+ export { key as n, make as r, PlanningSkill_exports as t };
46
+
47
+ //# sourceMappingURL=chunk-PlanningSkill.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-PlanningSkill.mjs","names":[],"sources":["../../src/skills/planning/PlanningSkill.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Skill from '@dxos/compute/Skill';\nimport * as Template from '@dxos/compute/Template';\nimport { Ref } from '@dxos/echo';\nimport { trim } from '@dxos/util';\n\nimport { AskQuestion, PlanReminder, UpdateTasks } from './operations/definitions.ts';\n\nexport const key = 'org.dxos.skill.planning';\n\nexport const make = () =>\n Skill.make({\n key,\n name: 'Planning',\n description: 'Plans and tracks complex tasks using artifacts.',\n agentCanEnable: true,\n tools: Skill.toolDefinitions({ operations: [UpdateTasks, AskQuestion] }),\n instructions: Template.make({\n source: trim`\n {{! Planning }}\n\n The conversation has a durable, numbered task checklist that you cannot see directly.\n Before answering any question about tasks — or acting on a task referenced by number or\n title — read the current checklist first (call the get-agent-context tool when available;\n otherwise the update-tasks result echoes it). Ordinals like \"task 1\" refer to that\n numbered list, and each line carries the task's ref.\n Track your work with update-tasks: address an existing task by its ref, set create only to\n make a new one, keep exactly one task started at a time, and mark a task done as soon as it\n completes. Starting a task assigns it to you.\n Do only what the user asked: if they name a specific task or subset, complete exactly\n that and stop — never start unrequested tasks on your own.\n A task that already exists elsewhere (a project's task, a sub-task of one you were given) is\n worked through its own ref — never recreate it with create. assign puts it on this checklist\n and makes you its assignee; unassign takes it off and clears the assignee, never deleting it.\n `,\n }),\n // At the end of every request, remind the agent to keep working while its plan has open tasks.\n // The reminder enqueues onto the owning host (Tier B), which keeps the process alive.\n hooks: [\n {\n spec: { _tag: 'end-request' },\n function: Ref.make(Operation.serialize(PlanReminder)),\n },\n ],\n });\n\nexport { PlanningHandlers as Handlers } from './operations/index.ts';\nexport * as Operations from './operations/definitions.ts';\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAa,MAAM;AAEnB,IAAa,aACX,MAAM,KAAK;CACT;CACA,MAAM;CACN,aAAa;CACb,gBAAgB;CAChB,OAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,aAAa,WAAW,EAAE,CAAC;CACvE,cAAc,SAAS,KAAK,EAC1B,QAAQ,IAAI;;;;;;;;;;;;;;;;QAiBd,CAAC;CAGD,OAAO,CACL;EACE,MAAM,EAAE,MAAM,cAAc;EAC5B,UAAU,IAAI,KAAK,UAAU,UAAU,YAAY,CAAC;CACtD,CACF;AACF,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { i as definitions_exports, n as EnableSkills, r as QuerySkills, t as SkillManagerHandlers } from "./chunk-operations2.mjs";
3
+ import { DXN } from "@dxos/keys";
4
+ import { trim } from "@dxos/util";
5
+ import * as Skill from "@dxos/compute/Skill";
6
+ import * as Template from "@dxos/compute/Template";
7
+ //#region src/skills/skill-manager/SkillManagerSkill.ts
8
+ var SkillManagerSkill_exports = /* @__PURE__ */ __exportAll({
9
+ Handlers: () => SkillManagerHandlers,
10
+ Operations: () => definitions_exports,
11
+ key: () => key,
12
+ make: () => make
13
+ });
14
+ var key = "org.dxos.skill.skillManager";
15
+ var make = () => Skill.make({
16
+ key,
17
+ name: "Skill Manager",
18
+ description: "Query and enable skills in the current conversation.",
19
+ instructions: Template.make({
20
+ source: trim`
21
+ The list below is the current set of available skills — it is rendered fresh into this prompt,
22
+ so do NOT call [query-skills] to obtain it. Call [enable-skills] directly with the keys you
23
+ need; only skills marked [agent-can-enable] can be enabled by the agent.
24
+ Reach for [query-skills] only to re-read the list after something has changed it.
25
+
26
+ <available_skills>
27
+ {{#each skills}}
28
+ - {{key}} "{{name}}"{{#if description}} -- {{description}}{{/if}}{{#if agentCanEnable}} [agent-can-enable]{{/if}}
29
+ {{/each}}
30
+ </available_skills>
31
+
32
+ NOTE: A skill's tools only appear once it is enabled. Skills already enabled in this
33
+ conversation expose their tools to you directly — do not re-enable a skill whose tools you
34
+ can already see.
35
+ `,
36
+ inputs: [{
37
+ name: "skills",
38
+ kind: "operation",
39
+ operation: DXN.getName(QuerySkills.meta.key)
40
+ }]
41
+ }),
42
+ tools: Skill.toolDefinitions({ operations: [QuerySkills, EnableSkills] })
43
+ });
44
+ //#endregion
45
+ export { key as n, make as r, SkillManagerSkill_exports as t };
46
+
47
+ //# sourceMappingURL=chunk-SkillManagerSkill.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-SkillManagerSkill.mjs","names":[],"sources":["../../src/skills/skill-manager/SkillManagerSkill.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Skill from '@dxos/compute/Skill';\nimport * as Template from '@dxos/compute/Template';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nimport { EnableSkills, QuerySkills } from './operations/definitions.ts';\n\nexport const key = 'org.dxos.skill.skillManager';\n\nexport const make = () =>\n Skill.make({\n key,\n name: 'Skill Manager',\n description: 'Query and enable skills in the current conversation.',\n instructions: Template.make({\n source: trim`\n The list below is the current set of available skills — it is rendered fresh into this prompt,\n so do NOT call [query-skills] to obtain it. Call [enable-skills] directly with the keys you\n need; only skills marked [agent-can-enable] can be enabled by the agent.\n Reach for [query-skills] only to re-read the list after something has changed it.\n\n <available_skills>\n {{#each skills}}\n - {{key}} \"{{name}}\"{{#if description}} -- {{description}}{{/if}}{{#if agentCanEnable}} [agent-can-enable]{{/if}}\n {{/each}}\n </available_skills>\n\n NOTE: A skill's tools only appear once it is enabled. Skills already enabled in this\n conversation expose their tools to you directly — do not re-enable a skill whose tools you\n can already see.\n `,\n inputs: [\n {\n name: 'skills',\n kind: 'operation',\n operation: DXN.getName(QuerySkills.meta.key),\n },\n ],\n }),\n tools: Skill.toolDefinitions({ operations: [QuerySkills, EnableSkills] }),\n });\n\nexport { SkillManagerHandlers as Handlers } from './operations/index.ts';\nexport * as Operations from './operations/definitions.ts';\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,MAAM;AAEnB,IAAa,aACX,MAAM,KAAK;CACT;CACA,MAAM;CACN,aAAa;CACb,cAAc,SAAS,KAAK;EAC1B,QAAQ,IAAI;;;;;;;;;;;;;;;;EAgBZ,QAAQ,CACN;GACE,MAAM;GACN,MAAM;GACN,WAAW,IAAI,QAAQ,YAAY,KAAK,GAAG;EAC7C,CACF;CACF,CAAC;CACD,OAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,aAAa,YAAY,EAAE,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ //#region src/commands.ts
3
+ /**
4
+ * `1 3`, `1,3`, or titles. Quoting is what makes a title unambiguous — a title is often several
5
+ * words (`"Draft release notes"`) and may itself be a number (`"123"`), neither of which a bare
6
+ * whitespace split can express.
7
+ */
8
+ var parseTaskSelectors = (args) => {
9
+ const selectors = [];
10
+ const tokens = args.matchAll(/"([^"]*)"|'([^']*)'|([^\s,]+)/g);
11
+ for (const [, doubleQuoted, singleQuoted, bare] of tokens) {
12
+ const quoted = doubleQuoted ?? singleQuoted;
13
+ if (quoted !== void 0) {
14
+ if (quoted.length > 0) selectors.push({ title: quoted });
15
+ } else if (bare !== void 0) selectors.push(/^\d+$/.test(bare) ? { ordinal: Number(bare) } : { title: bare });
16
+ }
17
+ return selectors;
18
+ };
19
+ /**
20
+ * Resolves a prompt into one of `commands`: `undefined` when the text is not a known command (it
21
+ * falls through to the model).
22
+ */
23
+ var resolveSlashCommand = (text, commands) => {
24
+ if (!text.startsWith("/")) return;
25
+ const [name, ...rest] = text.split(/\s+/);
26
+ const command = commands.find((candidate) => candidate.command === name);
27
+ return command ? {
28
+ command,
29
+ args: rest.join(" ")
30
+ } : void 0;
31
+ };
32
+ //#endregion
33
+ //#region src/SlashCommand.ts
34
+ var SlashCommand_exports = /* @__PURE__ */ __exportAll({
35
+ parseTaskSelectors: () => parseTaskSelectors,
36
+ resolveSlashCommand: () => resolveSlashCommand
37
+ });
38
+ //#endregion
39
+ export { parseTaskSelectors as n, resolveSlashCommand as r, SlashCommand_exports as t };
40
+
41
+ //# sourceMappingURL=chunk-SlashCommand.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SlashCommand.mjs","names":[],"sources":["../../../src/commands.ts","../../../src/SlashCommand.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Chat from '@dxos/assistant/Chat';\nimport * as Operation from '@dxos/compute/Operation';\nimport { type Database } from '@dxos/echo';\n\n/**\n * A deterministic prompt shortcut: a leading `/command args` line runs an operation directly, with\n * no model in the loop. The commands live with the verbs they invoke, so this module stays\n * operation-agnostic — the parse and the shape are all a prompt editor or a chat needs.\n */\nexport type SlashCommand = {\n /** Including the leading slash, e.g. `/task:run`. */\n command: string;\n /** Description surfaced in the prompt's completion list. */\n description: string;\n /** Runs the command; an Error describes correct usage, and is shown rather than thrown. */\n execute: (args: string, context: SlashCommandContext) => Promise<SlashCommandResult | Error>;\n};\n\n/** `invoke` is the caller's own invoker, so a command's effect goes through the verb itself. */\nexport type SlashCommandContext = {\n db: Database.Database;\n chat: Chat.Chat;\n invoke: OperationInvoke;\n};\n\n/** `OperationService['invokePromise']`, so the operation's input and output types survive the call. */\nexport type OperationInvoke = Operation.OperationService['invokePromise'];\n\nexport type SlashCommandResult = {\n /** One line for the transcript, so a command's effect is visible in the conversation. */\n summary?: string;\n /**\n * Prompt sent to the model after execution. Needed when the effect is driven by the supervisor\n * loop (delegation spawns on the post-turn reconcile), so the command must wake the\n * conversation; omitted when the result is already visible.\n */\n followUp?: string;\n};\n\n/** A task named by its 1-based position in the set, or by its exact title. */\nexport type TaskSelector = { ordinal: number } | { title: string };\n\n/**\n * `1 3`, `1,3`, or titles. Quoting is what makes a title unambiguous — a title is often several\n * words (`\"Draft release notes\"`) and may itself be a number (`\"123\"`), neither of which a bare\n * whitespace split can express.\n */\nexport const parseTaskSelectors = (args: string): TaskSelector[] => {\n const selectors: TaskSelector[] = [];\n // Quoted run, or a bare run of anything but whitespace and commas.\n const tokens = args.matchAll(/\"([^\"]*)\"|'([^']*)'|([^\\s,]+)/g);\n for (const [, doubleQuoted, singleQuoted, bare] of tokens) {\n const quoted = doubleQuoted ?? singleQuoted;\n if (quoted !== undefined) {\n if (quoted.length > 0) {\n selectors.push({ title: quoted });\n }\n } else if (bare !== undefined) {\n selectors.push(/^\\d+$/.test(bare) ? { ordinal: Number(bare) } : { title: bare });\n }\n }\n return selectors;\n};\n\n/**\n * Resolves a prompt into one of `commands`: `undefined` when the text is not a known command (it\n * falls through to the model).\n */\nexport const resolveSlashCommand = (\n text: string,\n commands: readonly SlashCommand[],\n): { command: SlashCommand; args: string } | undefined => {\n if (!text.startsWith('/')) {\n return undefined;\n }\n const [name, ...rest] = text.split(/\\s+/);\n const command = commands.find((candidate) => candidate.command === name);\n return command ? { command, args: rest.join(' ') } : undefined;\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport * from './commands.ts';\n"],"mappings":";;;;;;;AAmDA,IAAa,sBAAsB,SAAiC;CAClE,MAAM,YAA4B,CAAC;CAEnC,MAAM,SAAS,KAAK,SAAS,gCAAgC;CAC7D,KAAK,MAAM,GAAG,cAAc,cAAc,SAAS,QAAQ;EACzD,MAAM,SAAS,gBAAgB;EAC/B,IAAI,WAAW,KAAA,GACT;OAAA,OAAO,SAAS,GAClB,UAAU,KAAK,EAAE,OAAO,OAAO,CAAC;EAAA,OAE7B,IAAI,SAAS,KAAA,GAClB,UAAU,KAAK,QAAQ,KAAK,IAAI,IAAI,EAAE,SAAS,OAAO,IAAI,EAAE,IAAI,EAAE,OAAO,KAAK,CAAC;CAEnF;CACA,OAAO;AACT;;;;;AAMA,IAAa,uBACX,MACA,aACwD;CACxD,IAAI,CAAC,KAAK,WAAW,GAAG,GACtB;CAEF,MAAM,CAAC,MAAM,GAAG,QAAQ,KAAK,MAAM,KAAK;CACxC,MAAM,UAAU,SAAS,MAAM,cAAc,UAAU,YAAY,IAAI;CACvE,OAAO,UAAU;EAAE;EAAS,MAAM,KAAK,KAAK,GAAG;CAAE,IAAI,KAAA;AACvD"}
1
+ {"version":3,"file":"chunk-SlashCommand.mjs","names":[],"sources":["../../src/commands.ts","../../src/SlashCommand.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Chat from '@dxos/assistant/Chat';\nimport * as Operation from '@dxos/compute/Operation';\nimport { type Database } from '@dxos/echo';\n\n/**\n * A deterministic prompt shortcut: a leading `/command args` line runs an operation directly, with\n * no model in the loop. The commands live with the verbs they invoke, so this module stays\n * operation-agnostic — the parse and the shape are all a prompt editor or a chat needs.\n */\nexport type SlashCommand = {\n /** Including the leading slash, e.g. `/task:run`. */\n command: string;\n /** Description surfaced in the prompt's completion list. */\n description: string;\n /** Runs the command; an Error describes correct usage, and is shown rather than thrown. */\n execute: (args: string, context: SlashCommandContext) => Promise<SlashCommandResult | Error>;\n};\n\n/** `invoke` is the caller's own invoker, so a command's effect goes through the verb itself. */\nexport type SlashCommandContext = {\n db: Database.Database;\n chat: Chat.Chat;\n invoke: OperationInvoke;\n};\n\n/** `OperationService['invokePromise']`, so the operation's input and output types survive the call. */\nexport type OperationInvoke = Operation.OperationService['invokePromise'];\n\nexport type SlashCommandResult = {\n /** One line for the transcript, so a command's effect is visible in the conversation. */\n summary?: string;\n /**\n * Prompt sent to the model after execution. Needed when the effect is driven by the supervisor\n * loop (delegation spawns on the post-turn reconcile), so the command must wake the\n * conversation; omitted when the result is already visible.\n */\n followUp?: string;\n};\n\n/** A task named by its 1-based position in the set, or by its exact title. */\nexport type TaskSelector = { ordinal: number } | { title: string };\n\n/**\n * `1 3`, `1,3`, or titles. Quoting is what makes a title unambiguous — a title is often several\n * words (`\"Draft release notes\"`) and may itself be a number (`\"123\"`), neither of which a bare\n * whitespace split can express.\n */\nexport const parseTaskSelectors = (args: string): TaskSelector[] => {\n const selectors: TaskSelector[] = [];\n // Quoted run, or a bare run of anything but whitespace and commas.\n const tokens = args.matchAll(/\"([^\"]*)\"|'([^']*)'|([^\\s,]+)/g);\n for (const [, doubleQuoted, singleQuoted, bare] of tokens) {\n const quoted = doubleQuoted ?? singleQuoted;\n if (quoted !== undefined) {\n if (quoted.length > 0) {\n selectors.push({ title: quoted });\n }\n } else if (bare !== undefined) {\n selectors.push(/^\\d+$/.test(bare) ? { ordinal: Number(bare) } : { title: bare });\n }\n }\n return selectors;\n};\n\n/**\n * Resolves a prompt into one of `commands`: `undefined` when the text is not a known command (it\n * falls through to the model).\n */\nexport const resolveSlashCommand = (\n text: string,\n commands: readonly SlashCommand[],\n): { command: SlashCommand; args: string } | undefined => {\n if (!text.startsWith('/')) {\n return undefined;\n }\n const [name, ...rest] = text.split(/\\s+/);\n const command = commands.find((candidate) => candidate.command === name);\n return command ? { command, args: rest.join(' ') } : undefined;\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport * from './commands.ts';\n"],"mappings":";;;;;;;AAmDA,IAAa,sBAAsB,SAAiC;CAClE,MAAM,YAA4B,CAAC;CAEnC,MAAM,SAAS,KAAK,SAAS,gCAAgC;CAC7D,KAAK,MAAM,GAAG,cAAc,cAAc,SAAS,QAAQ;EACzD,MAAM,SAAS,gBAAgB;EAC/B,IAAI,WAAW,KAAA,GACT;OAAA,OAAO,SAAS,GAClB,UAAU,KAAK,EAAE,OAAO,OAAO,CAAC;EAAA,OAE7B,IAAI,SAAS,KAAA,GAClB,UAAU,KAAK,QAAQ,KAAK,IAAI,IAAI,EAAE,SAAS,OAAO,IAAI,EAAE,IAAI,EAAE,OAAO,KAAK,CAAC;CAEnF;CACA,OAAO;AACT;;;;;AAMA,IAAa,uBACX,MACA,aACwD;CACxD,IAAI,CAAC,KAAK,WAAW,GAAG,GACtB;CAEF,MAAM,CAAC,MAAM,GAAG,QAAQ,KAAK,MAAM,KAAK;CACxC,MAAM,UAAU,SAAS,MAAM,cAAc,UAAU,YAAY,IAAI;CACvE,OAAO,UAAU;EAAE;EAAS,MAAM,KAAK,KAAK,GAAG;CAAE,IAAI,KAAA;AACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-WebSearchSkill.mjs","names":[],"sources":["../../src/skills/websearch/operations/definitions.ts","../../src/skills/websearch/toolkit.ts","../../src/skills/websearch/operations/index.ts","../../src/skills/websearch/WebSearchSkill.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const Fetch = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.fetch'),\n name: 'Fetch web page',\n icon: 'ph--globe-simple--regular',\n description: trim`\n Fetches the content of a web page and returns the HTML. \n Use this to get the content of a web page.\n `,\n },\n input: Schema.Struct({\n url: Schema.String.annotate({\n description: 'The URL of the web page to fetch.',\n }),\n }),\n output: Schema.String,\n});\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Toolkit from 'effect/ai/Toolkit';\nimport * as Layer from 'effect/Layer';\n\nimport { OpaqueToolkit } from '@dxos/ai';\nimport { AnthropicWebSearchTool } from '@dxos/ai/resolvers';\n\nexport const WebSearchToolkit = Toolkit.make(AnthropicWebSearchTool);\n\nexport const WebSearchToolkitOpaque = OpaqueToolkit.make(WebSearchToolkit, Layer.empty);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { Fetch } from './definitions.ts';\n\nexport * as WebSearchOperations from './definitions.ts';\n\nexport const WebSearchHandlers = OperationHandlerSet.lazy([\n Fetch.pipe(Operation.lazyHandler(() => import('./fetch.ts'))),\n]);\n","//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Skill from '@dxos/compute/Skill';\nimport { Ref } from '@dxos/echo';\nimport { Text } from '@dxos/schema';\n\nimport { Fetch } from './operations/definitions.ts';\nimport { WebSearchToolkit } from './toolkit.ts';\n\nexport const key = 'org.dxos.skill.webSearch';\n\nexport const make = () =>\n Skill.make({\n key,\n name: 'Web Search',\n description: 'Search the web.',\n agentCanEnable: true,\n instructions: {\n source: Ref.make(Text.make()),\n },\n tools: Skill.toolDefinitions({ operations: [Fetch], tools: [WebSearchToolkit.tools.AnthropicWebSearch.name] }),\n });\n\nexport { WebSearchHandlers as Handlers } from './operations/index.ts';\nexport * as Operations from './operations/definitions.ts';\nexport { WebSearchToolkit as Toolkit, WebSearchToolkitOpaque as ToolkitOpaque } from './toolkit.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAUA,IAAa,QAAQ,UAAU,KAAK;CAClC,MAAM;EACJ,KAAK,MAAI,KAAK,2CAA2C;EACzD,MAAM;EACN,MAAM;EACN,aAAa,IAAI;;;;CAInB;CACA,OAAO,OAAO,OAAO,EACnB,KAAK,OAAO,OAAO,SAAS,EAC1B,aAAa,oCACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;AACjB,CAAC;;;AChBD,IAAa,mBAAmB,QAAQ,KAAK,sBAAsB;AAEnE,IAAa,yBAAyB,cAAc,KAAK,kBAAkB,MAAM,KAAK;;;ACDtF,IAAa,oBAAoB,oBAAoB,KAAK,CACxD,MAAM,KAAK,UAAU,kBAAkB,OAAO,oBAAa,CAAC,CAC9D,CAAC;;;;;;;;;;;ACAD,IAAa,MAAM;AAEnB,IAAa,aACX,MAAM,KAAK;CACT;CACA,MAAM;CACN,aAAa;CACb,gBAAgB;CAChB,cAAc,EACZ,QAAQ,IAAI,KAAK,KAAK,KAAK,CAAC,EAC9B;CACA,OAAO,MAAM,gBAAgB;EAAE,YAAY,CAAC,KAAK;EAAG,OAAO,CAAC,iBAAiB,MAAM,mBAAmB,IAAI;CAAE,CAAC;AAC/G,CAAC"}
1
+ {"version":3,"file":"chunk-WebSearchSkill.mjs","names":["DXN"],"sources":["../../src/skills/websearch/operations/definitions.ts","../../src/skills/websearch/toolkit.ts","../../src/skills/websearch/operations/index.ts","../../src/skills/websearch/WebSearchSkill.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const Fetch = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.fetch'),\n name: 'Fetch web page',\n icon: 'ph--globe-simple--regular',\n description: trim`\n Fetches the content of a web page and returns the HTML. \n Use this to get the content of a web page.\n `,\n },\n input: Schema.Struct({\n url: Schema.String.annotate({\n description: 'The URL of the web page to fetch.',\n }),\n }),\n output: Schema.String,\n});\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Toolkit from 'effect/ai/Toolkit';\nimport * as Layer from 'effect/Layer';\n\nimport { OpaqueToolkit } from '@dxos/ai';\nimport { AnthropicWebSearchTool } from '@dxos/ai/resolvers';\n\nexport const WebSearchToolkit = Toolkit.make(AnthropicWebSearchTool);\n\nexport const WebSearchToolkitOpaque = OpaqueToolkit.make(WebSearchToolkit, Layer.empty);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { Fetch } from './definitions.ts';\n\nexport * as WebSearchOperations from './definitions.ts';\n\nexport const WebSearchHandlers = OperationHandlerSet.lazy([\n Fetch.pipe(Operation.lazyHandler(() => import('./fetch.ts'))),\n]);\n","//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Skill from '@dxos/compute/Skill';\nimport { Ref } from '@dxos/echo';\nimport { Text } from '@dxos/schema';\n\nimport { Fetch } from './operations/definitions.ts';\nimport { WebSearchToolkit } from './toolkit.ts';\n\nexport const key = 'org.dxos.skill.webSearch';\n\nexport const make = () =>\n Skill.make({\n key,\n name: 'Web Search',\n description: 'Search the web.',\n agentCanEnable: true,\n instructions: {\n source: Ref.make(Text.make()),\n },\n tools: Skill.toolDefinitions({ operations: [Fetch], tools: [WebSearchToolkit.tools.AnthropicWebSearch.name] }),\n });\n\nexport { WebSearchHandlers as Handlers } from './operations/index.ts';\nexport * as Operations from './operations/definitions.ts';\nexport { WebSearchToolkit as Toolkit, WebSearchToolkitOpaque as ToolkitOpaque } from './toolkit.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAUA,IAAa,QAAQ,UAAU,KAAK;CAClC,MAAM;EACJ,KAAKA,MAAI,KAAK,2CAA2C;EACzD,MAAM;EACN,MAAM;EACN,aAAa,IAAI;;;;CAInB;CACA,OAAO,OAAO,OAAO,EACnB,KAAK,OAAO,OAAO,SAAS,EAC1B,aAAa,oCACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;AACjB,CAAC;;;AChBD,IAAa,mBAAmB,QAAQ,KAAK,sBAAsB;AAEnE,IAAa,yBAAyB,cAAc,KAAK,kBAAkB,MAAM,KAAK;;;ACDtF,IAAa,oBAAoB,oBAAoB,KAAK,CACxD,MAAM,KAAK,UAAU,kBAAkB,OAAO,oBAAa,CAAC,CAC9D,CAAC;;;;;;;;;;;ACAD,IAAa,MAAM;AAEnB,IAAa,aACX,MAAM,KAAK;CACT;CACA,MAAM;CACN,aAAa;CACb,gBAAgB;CAChB,cAAc,EACZ,QAAQ,IAAI,KAAK,KAAK,KAAK,CAAC,EAC9B;CACA,OAAO,MAAM,gBAAgB;EAAE,YAAY,CAAC,KAAK;EAAG,OAAO,CAAC,iBAAiB,MAAM,mBAAmB,IAAI;CAAE,CAAC;AAC/G,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-operations.mjs","names":[],"sources":["../../src/skills/delegation/operations/definitions.ts","../../src/skills/delegation/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Harness } from '@dxos/assistant';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const DelegateTask = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.delegateTask'),\n name: 'Delegate task',\n description: trim`\n Delegate a NEW unit of work to a sub-agent.\n Creates a durable task assigned to an agent; the supervisor spawns a background sub-agent\n for it and reports the result back to the conversation. To delegate tasks that already\n exist on the checklist, use delegate-tasks instead.\n `,\n icon: 'ph--share-network--regular',\n },\n input: Schema.Struct({\n title: Schema.String.annotate({\n description: 'Title of the work to delegate (matched against the checklist, created if new).',\n }),\n }),\n output: Schema.Any,\n services: [Harness.HarnessService, Database.Service],\n});\n\nexport const DelegateTasks = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.delegateTasks'),\n name: 'Delegate tasks',\n description: trim`\n Delegate one or more EXISTING tasks from the conversation's checklist to background\n sub-agents. Select tasks by their checklist ordinal (1-based number) or exact title.\n Each selected task is assigned to an agent; the supervisor spawns one sub-agent per task\n once the task's dependencies are done, and reports each result back to the conversation.\n `,\n icon: 'ph--share-network--regular',\n },\n input: Schema.Struct({\n tasks: Schema.Array(Schema.Union([Schema.Number, Schema.String])).annotate({\n description: 'Tasks to delegate: 1-based checklist ordinals and/or exact titles.',\n }),\n }),\n output: Schema.Any,\n services: [Harness.HarnessService, Database.Service],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { DelegateTask, DelegateTasks } from './definitions.ts';\n\nexport * as DelegationSkillOperations from './definitions.ts';\n\nexport const DelegationSkillHandlers = OperationHandlerSet.lazy([\n DelegateTask.pipe(Operation.lazyHandler(() => import('./delegate-task.ts'))),\n DelegateTasks.pipe(Operation.lazyHandler(() => import('./delegate-tasks.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,eAAe,UAAU,KAAK;CACzC,MAAM;EACJ,KAAK,MAAI,KAAK,kDAAkD;EAChE,MAAM;EACN,aAAa,IAAI;;;;;;EAMjB,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,iFACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,QAAQ,gBAAgB,SAAS,OAAO;AACrD,CAAC;AAED,IAAa,gBAAgB,UAAU,KAAK;CAC1C,MAAM;EACJ,KAAK,MAAI,KAAK,mDAAmD;EACjE,MAAM;EACN,aAAa,IAAI;;;;;;EAMjB,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,OAAO,OAAO,MAAM,OAAO,MAAM,CAAC,OAAO,QAAQ,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,EACzE,aAAa,qEACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,QAAQ,gBAAgB,SAAS,OAAO;AACrD,CAAC;;;ACzCD,IAAa,0BAA0B,oBAAoB,KAAK,CAC9D,aAAa,KAAK,UAAU,kBAAkB,OAAO,4BAAqB,CAAC,GAC3E,cAAc,KAAK,UAAU,kBAAkB,OAAO,6BAAsB,CAAC,CAC/E,CAAC"}
1
+ {"version":3,"file":"chunk-operations.mjs","names":["DXN"],"sources":["../../src/skills/delegation/operations/definitions.ts","../../src/skills/delegation/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Harness } from '@dxos/assistant';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const DelegateTask = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.delegateTask'),\n name: 'Delegate task',\n description: trim`\n Delegate a NEW unit of work to a sub-agent.\n Creates a durable task assigned to an agent; the supervisor spawns a background sub-agent\n for it and reports the result back to the conversation. To delegate tasks that already\n exist on the checklist, use delegate-tasks instead.\n `,\n icon: 'ph--share-network--regular',\n },\n input: Schema.Struct({\n title: Schema.String.annotate({\n description: 'Title of the work to delegate (matched against the checklist, created if new).',\n }),\n }),\n output: Schema.Any,\n services: [Harness.HarnessService, Database.Service],\n});\n\nexport const DelegateTasks = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.delegateTasks'),\n name: 'Delegate tasks',\n description: trim`\n Delegate one or more EXISTING tasks from the conversation's checklist to background\n sub-agents. Select tasks by their checklist ordinal (1-based number) or exact title.\n Each selected task is assigned to an agent; the supervisor spawns one sub-agent per task\n once the task's dependencies are done, and reports each result back to the conversation.\n `,\n icon: 'ph--share-network--regular',\n },\n input: Schema.Struct({\n tasks: Schema.Array(Schema.Union([Schema.Number, Schema.String])).annotate({\n description: 'Tasks to delegate: 1-based checklist ordinals and/or exact titles.',\n }),\n }),\n output: Schema.Any,\n services: [Harness.HarnessService, Database.Service],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { DelegateTask, DelegateTasks } from './definitions.ts';\n\nexport * as DelegationSkillOperations from './definitions.ts';\n\nexport const DelegationSkillHandlers = OperationHandlerSet.lazy([\n DelegateTask.pipe(Operation.lazyHandler(() => import('./delegate-task.ts'))),\n DelegateTasks.pipe(Operation.lazyHandler(() => import('./delegate-tasks.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,eAAe,UAAU,KAAK;CACzC,MAAM;EACJ,KAAKA,MAAI,KAAK,kDAAkD;EAChE,MAAM;EACN,aAAa,IAAI;;;;;;EAMjB,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,iFACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,QAAQ,gBAAgB,SAAS,OAAO;AACrD,CAAC;AAED,IAAa,gBAAgB,UAAU,KAAK;CAC1C,MAAM;EACJ,KAAKA,MAAI,KAAK,mDAAmD;EACjE,MAAM;EACN,aAAa,IAAI;;;;;;EAMjB,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,OAAO,OAAO,MAAM,OAAO,MAAM,CAAC,OAAO,QAAQ,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,EACzE,aAAa,qEACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,QAAQ,gBAAgB,SAAS,OAAO;AACrD,CAAC;;;ACzCD,IAAa,0BAA0B,oBAAoB,KAAK,CAC9D,aAAa,KAAK,UAAU,kBAAkB,OAAO,4BAAqB,CAAC,GAC3E,cAAc,KAAK,UAAU,kBAAkB,OAAO,6BAAsB,CAAC,CAC/E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-operations2.mjs","names":[],"sources":["../../src/skills/skill-manager/operations/definitions.ts","../../src/skills/skill-manager/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Harness } from '@dxos/assistant';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Skill from '@dxos/compute/Skill';\nimport { Database, Registry, Type } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nexport const QuerySkills = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.querySkills'),\n name: 'Query skills',\n description: 'Queries available skills.',\n icon: 'ph--student--regular',\n },\n input: Schema.Struct({}),\n output: Schema.Array(Type.getSchema(Skill.Skill)),\n services: [Registry.Service],\n});\n\nexport const EnableSkills = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.enableSkills'),\n name: 'Enable skills',\n description:\n 'Enables skills in the current conversation by their keys. Only skills with agentCanEnable=true can be enabled. The available keys are already listed in the system prompt, so call this directly rather than querying first.',\n icon: 'ph--plugs-connected--regular',\n },\n input: Schema.Struct({\n keys: Schema.Array(Schema.String).annotate({\n description: 'The keys of the skills to enable.',\n examples: [['org.dxos.skill.memory', 'org.dxos.skill.database']],\n }),\n }),\n output: Schema.Struct({\n enabled: Schema.Array(Type.getSchema(Skill.Skill)),\n rejected: Schema.Array(\n Schema.Struct({\n key: Schema.String,\n reason: Schema.String,\n }),\n ),\n }),\n services: [Registry.Service, Database.Service, Harness.HarnessService],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { EnableSkills, QuerySkills } from './definitions.ts';\n\nexport * as SkillManagerOperations from './definitions.ts';\n\nexport const SkillManagerHandlers = OperationHandlerSet.lazy([\n QuerySkills.pipe(Operation.lazyHandler(() => import('./query-skills.ts'))),\n EnableSkills.pipe(Operation.lazyHandler(() => import('./enable-skills.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,cAAc,UAAU,KAAK;CACxC,MAAM;EACJ,KAAK,MAAI,KAAK,iDAAiD;EAC/D,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,OAAO,OAAO,OAAO,CAAC,CAAC;CACvB,QAAQ,OAAO,MAAM,KAAK,UAAU,MAAM,KAAK,CAAC;CAChD,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;AAED,IAAa,eAAe,UAAU,KAAK;CACzC,MAAM;EACJ,KAAK,MAAI,KAAK,kDAAkD;EAChE,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,MAAM,OAAO,MAAM,OAAO,MAAM,CAAC,CAAC,SAAS;EACzC,aAAa;EACb,UAAU,CAAC,CAAC,yBAAyB,yBAAyB,CAAC;CACjE,CAAC,EACH,CAAC;CACD,QAAQ,OAAO,OAAO;EACpB,SAAS,OAAO,MAAM,KAAK,UAAU,MAAM,KAAK,CAAC;EACjD,UAAU,OAAO,MACf,OAAO,OAAO;GACZ,KAAK,OAAO;GACZ,QAAQ,OAAO;EACjB,CAAC,CACH;CACF,CAAC;CACD,UAAU;EAAC,SAAS;EAAS,SAAS;EAAS,QAAQ;CAAc;AACvE,CAAC;;;ACrCD,IAAa,uBAAuB,oBAAoB,KAAK,CAC3D,YAAY,KAAK,UAAU,kBAAkB,OAAO,2BAAoB,CAAC,GACzE,aAAa,KAAK,UAAU,kBAAkB,OAAO,4BAAqB,CAAC,CAC7E,CAAC"}
1
+ {"version":3,"file":"chunk-operations2.mjs","names":["DXN"],"sources":["../../src/skills/skill-manager/operations/definitions.ts","../../src/skills/skill-manager/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Harness } from '@dxos/assistant';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Skill from '@dxos/compute/Skill';\nimport { Database, Registry, Type } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nexport const QuerySkills = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.querySkills'),\n name: 'Query skills',\n description: 'Queries available skills.',\n icon: 'ph--student--regular',\n },\n input: Schema.Struct({}),\n output: Schema.Array(Type.getSchema(Skill.Skill)),\n services: [Registry.Service],\n});\n\nexport const EnableSkills = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.enableSkills'),\n name: 'Enable skills',\n description:\n 'Enables skills in the current conversation by their keys. Only skills with agentCanEnable=true can be enabled. The available keys are already listed in the system prompt, so call this directly rather than querying first.',\n icon: 'ph--plugs-connected--regular',\n },\n input: Schema.Struct({\n keys: Schema.Array(Schema.String).annotate({\n description: 'The keys of the skills to enable.',\n examples: [['org.dxos.skill.memory', 'org.dxos.skill.database']],\n }),\n }),\n output: Schema.Struct({\n enabled: Schema.Array(Type.getSchema(Skill.Skill)),\n rejected: Schema.Array(\n Schema.Struct({\n key: Schema.String,\n reason: Schema.String,\n }),\n ),\n }),\n services: [Registry.Service, Database.Service, Harness.HarnessService],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { EnableSkills, QuerySkills } from './definitions.ts';\n\nexport * as SkillManagerOperations from './definitions.ts';\n\nexport const SkillManagerHandlers = OperationHandlerSet.lazy([\n QuerySkills.pipe(Operation.lazyHandler(() => import('./query-skills.ts'))),\n EnableSkills.pipe(Operation.lazyHandler(() => import('./enable-skills.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,cAAc,UAAU,KAAK;CACxC,MAAM;EACJ,KAAKA,MAAI,KAAK,iDAAiD;EAC/D,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,OAAO,OAAO,OAAO,CAAC,CAAC;CACvB,QAAQ,OAAO,MAAM,KAAK,UAAU,MAAM,KAAK,CAAC;CAChD,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;AAED,IAAa,eAAe,UAAU,KAAK;CACzC,MAAM;EACJ,KAAKA,MAAI,KAAK,kDAAkD;EAChE,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,MAAM,OAAO,MAAM,OAAO,MAAM,CAAC,CAAC,SAAS;EACzC,aAAa;EACb,UAAU,CAAC,CAAC,yBAAyB,yBAAyB,CAAC;CACjE,CAAC,EACH,CAAC;CACD,QAAQ,OAAO,OAAO;EACpB,SAAS,OAAO,MAAM,KAAK,UAAU,MAAM,KAAK,CAAC;EACjD,UAAU,OAAO,MACf,OAAO,OAAO;GACZ,KAAK,OAAO;GACZ,QAAQ,OAAO;EACjB,CAAC,CACH;CACF,CAAC;CACD,UAAU;EAAC,SAAS;EAAS,SAAS;EAAS,QAAQ;CAAc;AACvE,CAAC;;;ACrCD,IAAa,uBAAuB,oBAAoB,KAAK,CAC3D,YAAY,KAAK,UAAU,kBAAkB,OAAO,2BAAoB,CAAC,GACzE,aAAa,KAAK,UAAU,kBAAkB,OAAO,4BAAqB,CAAC,CAC7E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-operations3.mjs","names":[],"sources":["../../src/skills/planning/operations/definitions.ts","../../src/skills/planning/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport { Harness } from '@dxos/assistant';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Trace from '@dxos/compute/Trace';\nimport { Database, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { Task } from '@dxos/types';\nimport { trim } from '@dxos/util';\n\nimport INSTRUCTIONS from './update-tasks.md?raw';\n\n/**\n * One edit to the conversation's tasks. Flat rather than a union of create/update shapes: a union\n * renders as `anyOf`, which some providers handle poorly, so the handler enforces the combinations.\n */\nconst TaskChange = Schema.Struct({\n task: Ref.Ref(Task.Task)\n .annotate({\n description:\n 'The existing task to change: the `echo://` URI inside the link on its checklist line, as a plain string. Omit with `create`.',\n })\n .pipe(Schema.optional),\n create: Schema.Boolean.annotate({\n description: 'Create a new task on this checklist, assigned to you. Requires `title`; omit `task`.',\n }).pipe(Schema.optional),\n assign: Schema.Boolean.annotate({\n description: 'Put the task on this checklist and make you its assignee.',\n }).pipe(Schema.optional),\n unassign: Schema.Boolean.annotate({\n description: 'Take the task off this checklist and clear its assignee. Never deletes the task.',\n }).pipe(Schema.optional),\n title: Schema.String.annotate({ description: 'The new task title, or a rename of an existing task.' }).pipe(\n Schema.optional,\n ),\n status: Schema.Literals(['todo', 'started', 'done'])\n .annotate({ description: '`started` also assigns the task to you.' })\n .pipe(Schema.optional),\n});\n\nexport type TaskChange = Schema.Schema.Type<typeof TaskChange>;\n\nexport const UpdateTasks = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.updateTasks'),\n name: 'Update tasks',\n description: INSTRUCTIONS,\n icon: 'ph--check-square-offset--regular',\n },\n input: Schema.Struct({\n changes: Schema.Array(TaskChange),\n }),\n output: Schema.Any,\n services: [Harness.HarnessService, Database.Service, Trace.TraceService],\n});\n\nexport const AskQuestion = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.askQuestion'),\n name: 'Ask question',\n icon: 'ph--question--regular',\n description: trim`\n Ask the user a question you cannot answer yourself, and stop that task on it.\n Prefer asking to guessing: an assumption the checklist then carries as fact costs more than\n the round trip does.\n Every question is about one task on the checklist, named by its exact title: the task is put in\n 'blocked' and the question filed on it, so the person answering can see what it holds up.\n Offer the likely answers in \"options\" when you have them — the reader may still type their own,\n so never phrase the question as if the list were exhaustive.\n Ask only what you genuinely cannot decide: a question costs the user a round trip, and a\n blocked task stays blocked until they take it.\n You are not resumed by waiting: finish this turn after asking. When the answer lands you are\n sent a message naming the question, and you read it back with the get-objects tool.\n `,\n },\n input: Schema.Struct({\n task: Schema.String.annotate({\n description: 'Exact title of the checklist task this question blocks.',\n }),\n question: Schema.String.annotate({ description: 'The question, as put to the user.' }),\n context: Schema.optional(\n Schema.String.annotate({ description: 'Why you are asking — what you are blocked on, in a sentence or two.' }),\n ),\n options: Schema.optional(\n Schema.Array(\n Schema.Struct({\n title: Schema.String.annotate({ description: 'The answer, as the reader will see it on the button.' }),\n description: Schema.optional(Schema.String.annotate({ description: 'What choosing it means.' })),\n }),\n ).annotate({ description: 'Suggested answers. Omit when you have no plausible candidates.' }),\n ),\n }),\n output: Schema.Any,\n services: [Harness.HarnessService, Database.Service, Trace.TraceService],\n});\n\nexport const PlanReminder = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.planReminder'),\n name: 'Plan reminder',\n description: 'Reminds the agent to continue when its plan still has incomplete tasks.',\n },\n input: Schema.Struct({}),\n output: Schema.Void,\n services: [Harness.HarnessService, Database.Service, AiService.AiService],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { AskQuestion, PlanReminder, UpdateTasks } from './definitions.ts';\n\nexport * as PlanningOperations from './definitions.ts';\n\nexport const PlanningHandlers = OperationHandlerSet.lazy([\n UpdateTasks.pipe(Operation.lazyHandler(() => import('./update-tasks.ts'))),\n AskQuestion.pipe(Operation.lazyHandler(() => import('./ask-question.ts'))),\n PlanReminder.pipe(Operation.lazyHandler(() => import('./plan-reminder.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,aAAa,OAAO,OAAO;CAC/B,MAAM,IAAI,IAAI,KAAK,IAAI,CAAA,CACpB,SAAS,EACR,aACE,+HACJ,CAAC,CAAA,CACA,KAAK,OAAO,QAAQ;CACvB,QAAQ,OAAO,QAAQ,SAAS,EAC9B,aAAa,uFACf,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ;CACvB,QAAQ,OAAO,QAAQ,SAAS,EAC9B,aAAa,4DACf,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ;CACvB,UAAU,OAAO,QAAQ,SAAS,EAChC,aAAa,mFACf,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ;CACvB,OAAO,OAAO,OAAO,SAAS,EAAE,aAAa,uDAAuD,CAAC,CAAC,CAAC,KACrG,OAAO,QACT;C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AAQ,OAAO;CACf,UAAU;EAAC,QAAQ;EAAgB,SAAS;EAAS,UAAU;CAAS;AAC1E,CAAC;;;ACnGD,IAAa,mBAAmB,oBAAoB,KAAK;CACvD,YAAY,KAAK,UAAU,kBAAkB,OAAO,2BAAoB,CAAC;CACzE,YAAY,KAAK,UAAU,kBAAkB,OAAO,2BAAoB,CAAC;CACzE,aAAa,KAAK,UAAU,kBAAkB,OAAO,4BAAqB,CAAC;AAC7E,CAAC"}
1
+ {"version":3,"file":"chunk-operations3.mjs","names":["DXN","INSTRUCTIONS"],"sources":["../../src/skills/planning/operations/definitions.ts","../../src/skills/planning/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport { Harness } from '@dxos/assistant';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Trace from '@dxos/compute/Trace';\nimport { Database, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { Task } from '@dxos/types';\nimport { trim } from '@dxos/util';\n\nimport INSTRUCTIONS from './update-tasks.md?raw';\n\n/**\n * One edit to the conversation's tasks. Flat rather than a union of create/update shapes: a union\n * renders as `anyOf`, which some providers handle poorly, so the handler enforces the combinations.\n */\nconst TaskChange = Schema.Struct({\n task: Ref.Ref(Task.Task)\n .annotate({\n description:\n 'The existing task to change: the `echo://` URI inside the link on its checklist line, as a plain string. Omit with `create`.',\n })\n .pipe(Schema.optional),\n create: Schema.Boolean.annotate({\n description: 'Create a new task on this checklist, assigned to you. Requires `title`; omit `task`.',\n }).pipe(Schema.optional),\n assign: Schema.Boolean.annotate({\n description: 'Put the task on this checklist and make you its assignee.',\n }).pipe(Schema.optional),\n unassign: Schema.Boolean.annotate({\n description: 'Take the task off this checklist and clear its assignee. Never deletes the task.',\n }).pipe(Schema.optional),\n title: Schema.String.annotate({ description: 'The new task title, or a rename of an existing task.' }).pipe(\n Schema.optional,\n ),\n status: Schema.Literals(['todo', 'started', 'done'])\n .annotate({ description: '`started` also assigns the task to you.' })\n .pipe(Schema.optional),\n});\n\nexport type TaskChange = Schema.Schema.Type<typeof TaskChange>;\n\nexport const UpdateTasks = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.updateTasks'),\n name: 'Update tasks',\n description: INSTRUCTIONS,\n icon: 'ph--check-square-offset--regular',\n },\n input: Schema.Struct({\n changes: Schema.Array(TaskChange),\n }),\n output: Schema.Any,\n services: [Harness.HarnessService, Database.Service, Trace.TraceService],\n});\n\nexport const AskQuestion = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.askQuestion'),\n name: 'Ask question',\n icon: 'ph--question--regular',\n description: trim`\n Ask the user a question you cannot answer yourself, and stop that task on it.\n Prefer asking to guessing: an assumption the checklist then carries as fact costs more than\n the round trip does.\n Every question is about one task on the checklist, named by its exact title: the task is put in\n 'blocked' and the question filed on it, so the person answering can see what it holds up.\n Offer the likely answers in \"options\" when you have them — the reader may still type their own,\n so never phrase the question as if the list were exhaustive.\n Ask only what you genuinely cannot decide: a question costs the user a round trip, and a\n blocked task stays blocked until they take it.\n You are not resumed by waiting: finish this turn after asking. When the answer lands you are\n sent a message naming the question, and you read it back with the get-objects tool.\n `,\n },\n input: Schema.Struct({\n task: Schema.String.annotate({\n description: 'Exact title of the checklist task this question blocks.',\n }),\n question: Schema.String.annotate({ description: 'The question, as put to the user.' }),\n context: Schema.optional(\n Schema.String.annotate({ description: 'Why you are asking — what you are blocked on, in a sentence or two.' }),\n ),\n options: Schema.optional(\n Schema.Array(\n Schema.Struct({\n title: Schema.String.annotate({ description: 'The answer, as the reader will see it on the button.' }),\n description: Schema.optional(Schema.String.annotate({ description: 'What choosing it means.' })),\n }),\n ).annotate({ description: 'Suggested answers. Omit when you have no plausible candidates.' }),\n ),\n }),\n output: Schema.Any,\n services: [Harness.HarnessService, Database.Service, Trace.TraceService],\n});\n\nexport const PlanReminder = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.planReminder'),\n name: 'Plan reminder',\n description: 'Reminds the agent to continue when its plan still has incomplete tasks.',\n },\n input: Schema.Struct({}),\n output: Schema.Void,\n services: [Harness.HarnessService, Database.Service, AiService.AiService],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { AskQuestion, PlanReminder, UpdateTasks } from './definitions.ts';\n\nexport * as PlanningOperations from './definitions.ts';\n\nexport const PlanningHandlers = OperationHandlerSet.lazy([\n UpdateTasks.pipe(Operation.lazyHandler(() => import('./update-tasks.ts'))),\n AskQuestion.pipe(Operation.lazyHandler(() => import('./ask-question.ts'))),\n PlanReminder.pipe(Operation.lazyHandler(() => import('./plan-reminder.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,aAAa,OAAO,OAAO;CAC/B,MAAM,IAAI,IAAI,KAAK,IAAI,CAAA,CACpB,SAAS,EACR,aACE,+HACJ,CAAC,CAAA,CACA,KAAK,OAAO,QAAQ;CACvB,QAAQ,OAAO,QAAQ,SAAS,EAC9B,aAAa,uFACf,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ;CACvB,QAAQ,OAAO,QAAQ,SAAS,EAC9B,aAAa,4DACf,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ;CACvB,UAAU,OAAO,QAAQ,SAAS,EAChC,aAAa,mFACf,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ;CACvB,OAAO,OAAO,OAAO,SAAS,EAAE,aAAa,uDAAuD,CAAC,CAAC,CAAC,KACrG,OAAO,QACT;CACA,QAAQ,OAAO,SAAS;EAAC;EAAQ;EAAW;CAAM,CAAC,CAAA,CAChD,SAAS,EAAE,aAAa,0CAA0C,CAAC,CAAA,CACnE,KAAK,OAAO,QAAQ;AACzB,CAAC;AAID,IAAa,cAAc,UAAU,KAAK;CACxC,MAAM;EACJ,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KAAK,UAAU,kBAAkB,OAAO,2BAAoB,CAAC;CACzE,aAAa,KAAK,UAAU,kBAAkB,OAAO,4BAAqB,CAAC;AAC7E,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
- import { Memory } from "./Memory.mjs";
2
+ import { t as Memory } from "./chunk-Memory.mjs";
3
3
  import { Database, Ref } from "@dxos/echo";
4
4
  import { DXN as DXN$1 } from "@dxos/keys";
5
5
  import * as Schema from "effect/Schema";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-operations4.mjs","names":[],"sources":["../../src/skills/memory/operations/definitions.ts","../../src/skills/memory/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nimport * as Memory from '../../../types/Memory.ts';\n\nexport const QueryMemories = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.query'),\n name: 'Query memories',\n description:\n 'Search for stored memories using full-text search. Returns memories matching the query terms. Use this to recall previously saved knowledge, facts, or preferences.',\n icon: 'ph--brain--regular',\n },\n input: Schema.Struct({\n text: Schema.optional(\n Schema.String.annotate({\n description: 'Full-text search query. Omit to list all memories.',\n examples: ['new york trip date plan', 'favorite color', 'project cyberdyne'],\n }),\n ),\n limit: Schema.optional(\n Schema.Number.annotate({\n description: 'Maximum number of results to return.',\n default: 10,\n }),\n ),\n }),\n output: Schema.Array(Schema.Unknown),\n services: [Database.Service],\n});\n\nexport const SaveMemory = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.save'),\n name: 'Save memory',\n description:\n 'Saves a new memory to the database. Use this to persist knowledge, facts, preferences, or any information that should be remembered across conversations.',\n icon: 'ph--brain--regular',\n },\n input: Schema.Struct({\n title: Schema.String.annotate({\n description: 'Short descriptive title for the memory.',\n }),\n content: Schema.String.annotate({\n description:\n 'The content of the memory. Can be a fact, preference, instruction, or any knowledge worth persisting.',\n }),\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n});\n\nexport const DeleteMemory = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.delete'),\n name: 'Delete memory',\n description: 'Deletes a memory from the database. Use this to remove outdated or incorrect memories.',\n icon: 'ph--trash--regular',\n },\n input: Schema.Struct({\n memory: Ref.Ref(Memory.Memory),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { DeleteMemory, QueryMemories, SaveMemory } from './definitions.ts';\n\nexport * as MemoryOperations from './definitions.ts';\n\nexport const MemoryHandlers = OperationHandlerSet.lazy([\n SaveMemory.pipe(Operation.lazyHandler(() => import('./save.ts'))),\n QueryMemories.pipe(Operation.lazyHandler(() => import('./query.ts'))),\n DeleteMemory.pipe(Operation.lazyHandler(() => import('./delete.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,gBAAgB,UAAU,KAAK;CAC1C,MAAM;EACJ,KAAK,MAAI,KAAK,2CAA2C;EACzD,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO;EACnB,MAAM,OAAO,SACX,OAAO,OAAO,SAAS;GACrB,aAAa;GACb,UAAU;IAAC;IAA2B;IAAkB;GAAmB;EAC7E,CAAC,CACH;EACA,OAAO,OAAO,SACZ,OAAO,OAAO,SAAS;GACrB,aAAa;GACb,SAAS;EACX,CAAC,CACH;CACF,CAAC;CACD,QAAQ,OAAO,MAAM,OAAO,OAAO;CACnC,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;AAED,IAAa,aAAa,UAAU,KAAK;CACvC,MAAM;EACJ,KAAK,MAAI,KAAK,0CAA0C;EACxD,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO;EACnB,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,0CACf,CAAC;EACD,SAAS,OAAO,OAAO,SAAS,EAC9B,aACE,wGACJ,CAAC;CACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;AAED,IAAa,eAAe,UAAU,KAAK;CACzC,MAAM;EACJ,KAAK,MAAI,KAAK,4CAA4C;EAC1D,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,QAAQ,IAAI,IAAI,MAAa,EAC/B,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;;;AC5DD,IAAa,iBAAiB,oBAAoB,KAAK;CACrD,WAAW,KAAK,UAAU,kBAAkB,OAAO,mBAAY,CAAC;CAChE,cAAc,KAAK,UAAU,kBAAkB,OAAO,oBAAa,CAAC;CACpE,aAAa,KAAK,UAAU,kBAAkB,OAAO,qBAAc,CAAC;AACtE,CAAC"}
1
+ {"version":3,"file":"chunk-operations4.mjs","names":["DXN","Memory.Memory"],"sources":["../../src/skills/memory/operations/definitions.ts","../../src/skills/memory/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nimport * as Memory from '../../../types/Memory.ts';\n\nexport const QueryMemories = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.query'),\n name: 'Query memories',\n description:\n 'Search for stored memories using full-text search. Returns memories matching the query terms. Use this to recall previously saved knowledge, facts, or preferences.',\n icon: 'ph--brain--regular',\n },\n input: Schema.Struct({\n text: Schema.optional(\n Schema.String.annotate({\n description: 'Full-text search query. Omit to list all memories.',\n examples: ['new york trip date plan', 'favorite color', 'project cyberdyne'],\n }),\n ),\n limit: Schema.optional(\n Schema.Number.annotate({\n description: 'Maximum number of results to return.',\n default: 10,\n }),\n ),\n }),\n output: Schema.Array(Schema.Unknown),\n services: [Database.Service],\n});\n\nexport const SaveMemory = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.save'),\n name: 'Save memory',\n description:\n 'Saves a new memory to the database. Use this to persist knowledge, facts, preferences, or any information that should be remembered across conversations.',\n icon: 'ph--brain--regular',\n },\n input: Schema.Struct({\n title: Schema.String.annotate({\n description: 'Short descriptive title for the memory.',\n }),\n content: Schema.String.annotate({\n description:\n 'The content of the memory. Can be a fact, preference, instruction, or any knowledge worth persisting.',\n }),\n }),\n output: Schema.Unknown,\n services: [Database.Service],\n});\n\nexport const DeleteMemory = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.delete'),\n name: 'Delete memory',\n description: 'Deletes a memory from the database. Use this to remove outdated or incorrect memories.',\n icon: 'ph--trash--regular',\n },\n input: Schema.Struct({\n memory: Ref.Ref(Memory.Memory),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { DeleteMemory, QueryMemories, SaveMemory } from './definitions.ts';\n\nexport * as MemoryOperations from './definitions.ts';\n\nexport const MemoryHandlers = OperationHandlerSet.lazy([\n SaveMemory.pipe(Operation.lazyHandler(() => import('./save.ts'))),\n QueryMemories.pipe(Operation.lazyHandler(() => import('./query.ts'))),\n DeleteMemory.pipe(Operation.lazyHandler(() => import('./delete.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,gBAAgB,UAAU,KAAK;CAC1C,MAAM;EACJ,KAAKA,MAAI,KAAK,2CAA2C;EACzD,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO;EACnB,MAAM,OAAO,SACX,OAAO,OAAO,SAAS;GACrB,aAAa;GACb,UAAU;IAAC;IAA2B;IAAkB;GAAmB;EAC7E,CAAC,CACH;EACA,OAAO,OAAO,SACZ,OAAO,OAAO,SAAS;GACrB,aAAa;GACb,SAAS;EACX,CAAC,CACH;CACF,CAAC;CACD,QAAQ,OAAO,MAAM,OAAO,OAAO;CACnC,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;AAED,IAAa,aAAa,UAAU,KAAK;CACvC,MAAM;EACJ,KAAKA,MAAI,KAAK,0CAA0C;EACxD,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO;EACnB,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,0CACf,CAAC;EACD,SAAS,OAAO,OAAO,SAAS,EAC9B,aACE,wGACJ,CAAC;CACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;AAED,IAAa,eAAe,UAAU,KAAK;CACzC,MAAM;EACJ,KAAKA,MAAI,KAAK,4CAA4C;EAC1D,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,QAAQ,IAAI,IAAIC,MAAa,EAC/B,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;;;AC5DD,IAAa,iBAAiB,oBAAoB,KAAK;CACrD,WAAW,KAAK,UAAU,kBAAkB,OAAO,mBAAY,CAAC;CAChE,cAAc,KAAK,UAAU,kBAAkB,OAAO,oBAAa,CAAC;CACpE,aAAa,KAAK,UAAU,kBAAkB,OAAO,qBAAc,CAAC;AACtE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-operations5.mjs","names":[],"sources":["../../src/skills/chat-context/operations/definitions.ts","../../src/skills/chat-context/operations/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Harness } from '@dxos/assistant';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Obj, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const ContextAdd = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.addContext'),\n name: 'Add to context',\n icon: 'ph--plus-circle--regular',\n description: trim`\n Adds the object to the chat context.\n Use this it for objects that are useful long-term for the conversation.\n `,\n },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown).annotate({\n description: 'Object to add to the chat context.',\n }),\n }),\n output: Schema.Void,\n services: [Harness.HarnessService],\n});\n\nexport const ContextRemove = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.removeContext'),\n name: 'Remove from context',\n icon: 'ph--minus-circle--regular',\n description: trim`\n Removes the object from the chat context.\n Use this it for objects that are no longer useful for the conversation.\n `,\n },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown).annotate({\n description: 'Object to remove from the chat context.',\n }),\n }),\n output: Schema.Void,\n services: [Harness.HarnessService],\n});\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { ContextAdd, ContextRemove } from './definitions.ts';\n\nexport * as ChatContextOperations from './definitions.ts';\n\nexport const ChatContextHandlers = OperationHandlerSet.lazy([\n ContextAdd.pipe(Operation.lazyHandler(() => import('./context-add.ts'))),\n ContextRemove.pipe(Operation.lazyHandler(() => import('./context-remove.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,aAAa,UAAU,KAAK;CACvC,MAAM;EACJ,KAAK,MAAI,KAAK,gDAAgD;EAC9D,MAAM;EACN,MAAM;EACN,aAAa,IAAI;;;;CAInB;CACA,OAAO,OAAO,OAAO,EACnB,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,SAAS,EACjC,aAAa,qCACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,QAAQ,cAAc;AACnC,CAAC;AAED,IAAa,gBAAgB,UAAU,KAAK;CAC1C,MAAM;EACJ,KAAK,MAAI,KAAK,mDAAmD;EACjE,MAAM;EACN,MAAM;EACN,aAAa,IAAI;;;;CAInB;CACA,OAAO,OAAO,OAAO,EACnB,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,SAAS,EACjC,aAAa,0CACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,QAAQ,cAAc;AACnC,CAAC;;;ACrCD,IAAa,sBAAsB,oBAAoB,KAAK,CAC1D,WAAW,KAAK,UAAU,kBAAkB,OAAO,0BAAmB,CAAC,GACvE,cAAc,KAAK,UAAU,kBAAkB,OAAO,6BAAsB,CAAC,CAC/E,CAAC"}
1
+ {"version":3,"file":"chunk-operations5.mjs","names":["DXN"],"sources":["../../src/skills/chat-context/operations/definitions.ts","../../src/skills/chat-context/operations/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Harness } from '@dxos/assistant';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Obj, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const ContextAdd = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.addContext'),\n name: 'Add to context',\n icon: 'ph--plus-circle--regular',\n description: trim`\n Adds the object to the chat context.\n Use this it for objects that are useful long-term for the conversation.\n `,\n },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown).annotate({\n description: 'Object to add to the chat context.',\n }),\n }),\n output: Schema.Void,\n services: [Harness.HarnessService],\n});\n\nexport const ContextRemove = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.removeContext'),\n name: 'Remove from context',\n icon: 'ph--minus-circle--regular',\n description: trim`\n Removes the object from the chat context.\n Use this it for objects that are no longer useful for the conversation.\n `,\n },\n input: Schema.Struct({\n obj: Ref.Ref(Obj.Unknown).annotate({\n description: 'Object to remove from the chat context.',\n }),\n }),\n output: Schema.Void,\n services: [Harness.HarnessService],\n});\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { ContextAdd, ContextRemove } from './definitions.ts';\n\nexport * as ChatContextOperations from './definitions.ts';\n\nexport const ChatContextHandlers = OperationHandlerSet.lazy([\n ContextAdd.pipe(Operation.lazyHandler(() => import('./context-add.ts'))),\n ContextRemove.pipe(Operation.lazyHandler(() => import('./context-remove.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,aAAa,UAAU,KAAK;CACvC,MAAM;EACJ,KAAKA,MAAI,KAAK,gDAAgD;EAC9D,MAAM;EACN,MAAM;EACN,aAAa,IAAI;;;;CAInB;CACA,OAAO,OAAO,OAAO,EACnB,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,SAAS,EACjC,aAAa,qCACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,QAAQ,cAAc;AACnC,CAAC;AAED,IAAa,gBAAgB,UAAU,KAAK;CAC1C,MAAM;EACJ,KAAKA,MAAI,KAAK,mDAAmD;EACjE,MAAM;EACN,MAAM;EACN,aAAa,IAAI;;;;CAInB;CACA,OAAO,OAAO,OAAO,EACnB,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,SAAS,EACjC,aAAa,0CACf,CAAC,EACH,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,QAAQ,cAAc;AACnC,CAAC;;;ACrCD,IAAa,sBAAsB,oBAAoB,KAAK,CAC1D,WAAW,KAAK,UAAU,kBAAkB,OAAO,0BAAmB,CAAC,GACvE,cAAc,KAAK,UAAU,kBAAkB,OAAO,6BAAsB,CAAC,CAC/E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-operations7.mjs","names":[],"sources":["../../src/skills/agent/operations/definitions.ts","../../src/skills/agent/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport { Harness } from '@dxos/assistant';\nimport * as Agent from '@dxos/assistant/Agent';\nimport * as Chat from '@dxos/assistant/Chat';\nimport * as AgentService from '@dxos/compute/AgentService';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as TriggerEvent from '@dxos/compute/TriggerEvent';\nimport { Database, Obj, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nexport const Relay = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.relay'),\n name: 'Agent Relay',\n description: 'Qualifies a subscription event with a cheap model and forwards it onto the durable agent session.',\n icon: 'ph--funnel--regular',\n },\n input: Schema.Struct({\n /** The chat whose durable session receives the event (carries feed, instructions, and agent). */\n chat: Schema.suspend(() => Ref.Ref(Chat.Chat)),\n event: Schema.optional(TriggerEvent.TriggerEvent),\n /** Synthetic wake prompt (e.g. a cron tick) delivered instead of an event payload. */\n prompt: Schema.optional(Schema.String),\n /** Skip the cheap-model relevance check (default: qualify when an event is present). */\n qualify: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Void,\n services: [AiService.AiService, Database.Service, AgentService.AgentService],\n});\n\nexport const GetContext = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.getContext'),\n name: 'Get Agent Context',\n description: 'Get the context of an agent.',\n icon: 'ph--info--regular',\n },\n input: Schema.Struct({}),\n output: Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n instructions: Schema.String,\n checklist: Schema.String,\n }),\n services: [Harness.HarnessService, Database.Service],\n});\n\nexport const SyncAutomation = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.syncTriggers'),\n name: 'Sync automation',\n description:\n 'Compiles the agent automation config (subscriptions, optional cron) into Routines that relay events onto the agent session. Recreates everything, so call with the FULL desired config after any change; enabled is copied from the agent onto every trigger.',\n icon: 'ph--arrows-clockwise--regular',\n },\n input: Schema.Struct({\n agent: Schema.suspend(() => Ref.Ref(Agent.Agent)).annotate({\n description: 'The agent whose automation should be synced.',\n }),\n subscriptions: Schema.optional(\n Schema.Array(Ref.Ref(Obj.Unknown)).annotate({\n description: 'The objects to subscribe to (e.g. mailboxes); each compiles to a feed-triggered routine.',\n }),\n ),\n cron: Schema.optional(\n Schema.String.annotate({\n description: 'Cron expression for a scheduled wake routine.',\n }),\n ),\n qualify: Schema.optional(\n Schema.Boolean.annotate({\n description: 'Run the cheap-model relevance filter on subscription events (default true).',\n }),\n ),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { GetContext, Relay, SyncAutomation } from './definitions.ts';\n\nexport * as AgentSkillOperations from './definitions.ts';\n\nexport const AgentSkillHandlers = OperationHandlerSet.lazy([\n GetContext.pipe(Operation.lazyHandler(() => import('./get-context.ts'))),\n Relay.pipe(Operation.lazyHandler(() => import('./relay.ts'))),\n SyncAutomation.pipe(Operation.lazyHandler(() => import('./sync-automation.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,IAAa,QAAQ,UAAU,KAAK;CAClC,MAAM;EACJ,KAAK,MAAI,KAAK,2CAA2C;EACzD,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,OAAO,OAAO,OAAO;;EAEnB,MAAM,OAAO,cAAc,IAAI,IAAI,KAAK,IAAI,CAAC;EAC7C,OAAO,OAAO,SAAS,aAAa,YAAY;;EAEhD,QAAQ,OAAO,SAAS,OAAO,MAAM;;EAErC,SAAS,OAAO,SAAS,OAAO,OAAO;CACzC,CAAC;CACD,QAAQ,OAAO;CACf,UAAU;EAAC,UAAU;EAAW,SAAS;EAAS,aAAa;CAAY;AAC7E,CAAC;AAED,IAAa,aAAa,UAAU,KAAK;CACvC,MAAM;EACJ,KAAK,MAAI,KAAK,gDAAgD;EAC9D,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,OAAO,OAAO,OAAO,CAAC,CAAC;CACvB,QAAQ,OAAO,OAAO;EACpB,IAAI,OAAO;EACX,MAAM,OAAO;EACb,cAAc,OAAO;EACrB,WAAW,OAAO;CACpB,CAAC;CACD,UAAU,CAAC,QAAQ,gBAAgB,SAAS,OAAO;AACrD,CAAC;AAED,IAAa,iBAAiB,UAAU,KAAK;CAC3C,MAAM;EACJ,KAAK,MAAI,KAAK,kDAAkD;EAChE,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO;EACnB,OAAO,OAAO,cAAc,IAAI,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,SAAS,EACzD,aAAa,+CACf,CAAC;EACD,eAAe,OAAO,SACpB,OAAO,MAAM,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,EAC1C,aAAa,2FACf,CAAC,CACH;EACA,MAAM,OAAO,SACX,OAAO,OAAO,SAAS,EACrB,aAAa,gDACf,CAAC,CACH;EACA,SAAS,OAAO,SACd,OAAO,QAAQ,SAAS,EACtB,aAAa,8EACf,CAAC,CACH;CACF,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;;;ACxED,IAAa,qBAAqB,oBAAoB,KAAK;CACzD,WAAW,KAAK,UAAU,kBAAkB,OAAO,0BAAmB,CAAC;CACvE,MAAM,KAAK,UAAU,kBAAkB,OAAO,oBAAa,CAAC;CAC5D,eAAe,KAAK,UAAU,kBAAkB,OAAO,8BAAuB,CAAC;AACjF,CAAC"}
1
+ {"version":3,"file":"chunk-operations7.mjs","names":["DXN"],"sources":["../../src/skills/agent/operations/definitions.ts","../../src/skills/agent/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport { Harness } from '@dxos/assistant';\nimport * as Agent from '@dxos/assistant/Agent';\nimport * as Chat from '@dxos/assistant/Chat';\nimport * as AgentService from '@dxos/compute/AgentService';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as TriggerEvent from '@dxos/compute/TriggerEvent';\nimport { Database, Obj, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nexport const Relay = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.relay'),\n name: 'Agent Relay',\n description: 'Qualifies a subscription event with a cheap model and forwards it onto the durable agent session.',\n icon: 'ph--funnel--regular',\n },\n input: Schema.Struct({\n /** The chat whose durable session receives the event (carries feed, instructions, and agent). */\n chat: Schema.suspend(() => Ref.Ref(Chat.Chat)),\n event: Schema.optional(TriggerEvent.TriggerEvent),\n /** Synthetic wake prompt (e.g. a cron tick) delivered instead of an event payload. */\n prompt: Schema.optional(Schema.String),\n /** Skip the cheap-model relevance check (default: qualify when an event is present). */\n qualify: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Void,\n services: [AiService.AiService, Database.Service, AgentService.AgentService],\n});\n\nexport const GetContext = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.getContext'),\n name: 'Get Agent Context',\n description: 'Get the context of an agent.',\n icon: 'ph--info--regular',\n },\n input: Schema.Struct({}),\n output: Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n instructions: Schema.String,\n checklist: Schema.String,\n }),\n services: [Harness.HarnessService, Database.Service],\n});\n\nexport const SyncAutomation = Operation.make({\n meta: {\n key: DXN.make('org.dxos.operation.assistantToolkit.syncTriggers'),\n name: 'Sync automation',\n description:\n 'Compiles the agent automation config (subscriptions, optional cron) into Routines that relay events onto the agent session. Recreates everything, so call with the FULL desired config after any change; enabled is copied from the agent onto every trigger.',\n icon: 'ph--arrows-clockwise--regular',\n },\n input: Schema.Struct({\n agent: Schema.suspend(() => Ref.Ref(Agent.Agent)).annotate({\n description: 'The agent whose automation should be synced.',\n }),\n subscriptions: Schema.optional(\n Schema.Array(Ref.Ref(Obj.Unknown)).annotate({\n description: 'The objects to subscribe to (e.g. mailboxes); each compiles to a feed-triggered routine.',\n }),\n ),\n cron: Schema.optional(\n Schema.String.annotate({\n description: 'Cron expression for a scheduled wake routine.',\n }),\n ),\n qualify: Schema.optional(\n Schema.Boolean.annotate({\n description: 'Run the cheap-model relevance filter on subscription events (default true).',\n }),\n ),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { GetContext, Relay, SyncAutomation } from './definitions.ts';\n\nexport * as AgentSkillOperations from './definitions.ts';\n\nexport const AgentSkillHandlers = OperationHandlerSet.lazy([\n GetContext.pipe(Operation.lazyHandler(() => import('./get-context.ts'))),\n Relay.pipe(Operation.lazyHandler(() => import('./relay.ts'))),\n SyncAutomation.pipe(Operation.lazyHandler(() => import('./sync-automation.ts'))),\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,IAAa,QAAQ,UAAU,KAAK;CAClC,MAAM;EACJ,KAAKA,MAAI,KAAK,2CAA2C;EACzD,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,OAAO,OAAO,OAAO;;EAEnB,MAAM,OAAO,cAAc,IAAI,IAAI,KAAK,IAAI,CAAC;EAC7C,OAAO,OAAO,SAAS,aAAa,YAAY;;EAEhD,QAAQ,OAAO,SAAS,OAAO,MAAM;;EAErC,SAAS,OAAO,SAAS,OAAO,OAAO;CACzC,CAAC;CACD,QAAQ,OAAO;CACf,UAAU;EAAC,UAAU;EAAW,SAAS;EAAS,aAAa;CAAY;AAC7E,CAAC;AAED,IAAa,aAAa,UAAU,KAAK;CACvC,MAAM;EACJ,KAAKA,MAAI,KAAK,gDAAgD;EAC9D,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,OAAO,OAAO,OAAO,CAAC,CAAC;CACvB,QAAQ,OAAO,OAAO;EACpB,IAAI,OAAO;EACX,MAAM,OAAO;EACb,cAAc,OAAO;EACrB,WAAW,OAAO;CACpB,CAAC;CACD,UAAU,CAAC,QAAQ,gBAAgB,SAAS,OAAO;AACrD,CAAC;AAED,IAAa,iBAAiB,UAAU,KAAK;CAC3C,MAAM;EACJ,KAAKA,MAAI,KAAK,kDAAkD;EAChE,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO;EACnB,OAAO,OAAO,cAAc,IAAI,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,SAAS,EACzD,aAAa,+CACf,CAAC;EACD,eAAe,OAAO,SACpB,OAAO,MAAM,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,EAC1C,aAAa,2FACf,CAAC,CACH;EACA,MAAM,OAAO,SACX,OAAO,OAAO,SAAS,EACrB,aAAa,gDACf,CAAC,CACH;EACA,SAAS,OAAO,SACd,OAAO,QAAQ,SAAS,EACtB,aAAa,8EACf,CAAC,CACH;CACF,CAAC;CACD,QAAQ,OAAO;CACf,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;;;ACxED,IAAa,qBAAqB,oBAAoB,KAAK;CACzD,WAAW,KAAK,UAAU,kBAAkB,OAAO,0BAAmB,CAAC;CACvE,MAAM,KAAK,UAAU,kBAAkB,OAAO,oBAAa,CAAC;CAC5D,eAAe,KAAK,UAAU,kBAAkB,OAAO,8BAAuB,CAAC;AACjF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { RunInstructions } from "./AgentOperation.mjs";
1
+ import { n as RunInstructions } from "./chunk-AgentOperation.mjs";
2
2
  import * as Operation from "@dxos/compute/Operation";
3
3
  import * as OperationHandlerSet from "@dxos/compute/OperationHandlerSet";
4
4
  //#region src/operations/index.ts
@@ -1,4 +1,4 @@
1
- import { Memory } from "./Memory.mjs";
1
+ import { t as Memory } from "./chunk-Memory.mjs";
2
2
  import { r as QueryMemories } from "./chunk-operations4.mjs";
3
3
  import * as Effect from "effect/Effect";
4
4
  import { Database, Entity, Filter, Query } from "@dxos/echo";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-query.mjs","names":[],"sources":["../../src/skills/memory/operations/query.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database, Entity, Filter, Query } from '@dxos/echo';\n\nimport * as Memory from '../../../types/Memory.ts';\nimport { QueryMemories } from './definitions.ts';\n\nexport default QueryMemories.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ text, limit = 10 }) {\n let query: Query.Any;\n if (text) {\n query = Query.all(\n // TODO(dmaretskyi): We should move this to the query executor layer.\n ...text.split(' ').map((term) => Query.select(Filter.text(term, { type: 'full-text' }))),\n ).select(Filter.type(Memory.Memory));\n } else {\n query = Query.select(Filter.type(Memory.Memory));\n }\n query = query.limit(limit);\n\n yield* Database.flush();\n const results = yield* Database.query(query).run;\n return results.map((obj) => Entity.toJSON(obj));\n }),\n ),\n);\n"],"mappings":";;;;;;AAYA,IAAA,gBAAe,cAAc,KAC3B,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,MAAM,QAAQ,MAAM;CACzC,IAAI;CACJ,IAAI,MACF,QAAQ,MAAM,IAEZ,GAAG,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,SAAS,MAAM,OAAO,OAAO,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC,CAAC,CAAC,CACzF,CAAC,CAAC,OAAO,OAAO,KAAK,MAAa,CAAC;MAEnC,QAAQ,MAAM,OAAO,OAAO,KAAK,MAAa,CAAC;CAEjD,QAAQ,MAAM,MAAM,KAAK;CAEzB,OAAO,SAAS,MAAM;CAEtB,QAAO,OADgB,SAAS,MAAM,KAAK,CAAC,CAAC,IAAA,CAC9B,KAAK,QAAQ,OAAO,OAAO,GAAG,CAAC;AAChD,CAAC,CACH,CACF"}
1
+ {"version":3,"file":"chunk-query.mjs","names":["Memory.Memory"],"sources":["../../src/skills/memory/operations/query.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database, Entity, Filter, Query } from '@dxos/echo';\n\nimport * as Memory from '../../../types/Memory.ts';\nimport { QueryMemories } from './definitions.ts';\n\nexport default QueryMemories.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ text, limit = 10 }) {\n let query: Query.Any;\n if (text) {\n query = Query.all(\n // TODO(dmaretskyi): We should move this to the query executor layer.\n ...text.split(' ').map((term) => Query.select(Filter.text(term, { type: 'full-text' }))),\n ).select(Filter.type(Memory.Memory));\n } else {\n query = Query.select(Filter.type(Memory.Memory));\n }\n query = query.limit(limit);\n\n yield* Database.flush();\n const results = yield* Database.query(query).run;\n return results.map((obj) => Entity.toJSON(obj));\n }),\n ),\n);\n"],"mappings":";;;;;;AAYA,IAAA,gBAAe,cAAc,KAC3B,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,MAAM,QAAQ,MAAM;CACzC,IAAI;CACJ,IAAI,MACF,QAAQ,MAAM,IAEZ,GAAG,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,SAAS,MAAM,OAAO,OAAO,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC,CAAC,CAAC,CACzF,CAAC,CAAC,OAAO,OAAO,KAAKA,MAAa,CAAC;MAEnC,QAAQ,MAAM,OAAO,OAAO,KAAKA,MAAa,CAAC;CAEjD,QAAQ,MAAM,MAAM,KAAK;CAEzB,OAAO,SAAS,MAAM;CAEtB,QAAO,OADgB,SAAS,MAAM,KAAK,CAAC,CAAC,IAAA,CAC9B,KAAK,QAAQ,OAAO,OAAO,GAAG,CAAC;AAChD,CAAC,CACH,CACF"}
@@ -1,5 +1,5 @@
1
1
  import { t as PromptError } from "./chunk-errors.mjs";
2
- import { RunInstructions } from "./AgentOperation.mjs";
2
+ import { n as RunInstructions } from "./chunk-AgentOperation.mjs";
3
3
  import * as Effect from "effect/Effect";
4
4
  import { AiSession, getOperationFromTool, makeToolExecutionService, makeToolResolverFromOperations } from "@dxos/assistant";
5
5
  import * as Chat from "@dxos/assistant/Chat";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-run-instructions.mjs","names":[],"sources":["../../src/operations/complete-job-tool.ts","../../src/operations/run-instructions.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Tool from 'effect/ai/Tool';\nimport * as Schema from 'effect/Schema';\n\nimport { JsonSchema } from '@dxos/echo';\n\n/** `Instructions.make` defaults `output` to `Schema.Void`; this is what that serializes to. */\nconst UNDECLARED_OUTPUT = JsonSchema.toJsonSchema(Schema.Void);\nconst UNDECLARED_TYPE = 'type' in UNDECLARED_OUTPUT ? UNDECLARED_OUTPUT.type : undefined;\n\n/**\n * Whether the routine's stored output carries a payload contract. `Instructions` keeps only the\n * serialized schema, so a declared `null` output is indistinguishable from a defaulted one — and\n * wants the same tool either way, having no payload to validate.\n */\nconst isUndeclaredOutput = (output: JsonSchema.JsonSchema): boolean =>\n ('$id' in output && output.$id === '/schemas/unknown') || ('type' in output && output.type === UNDECLARED_TYPE);\n\n/**\n * Accepts any JSON value, unlike `Schema.Any`, while serializing to concrete types. This matters\n * twice: the Anthropic API rejects a strict tool whose schema contains the empty `{}` subschema\n * `Schema.Any` serializes to, and — observed live — a schema-less `success` invites the model to\n * emit invalid JSON (digit-separated numbers such as `3,628,800`), which kills the sub-agent.\n * `ObjectKeyword` rather than `Record(String, Any)`: the provider's structured-output codec\n * rewrites records into [key, value] tuples whose value member is again the empty schema.\n */\nconst JsonPayload = Schema.Union([\n Schema.String,\n Schema.Number,\n Schema.Boolean,\n Schema.ObjectKeyword,\n Schema.Array(Schema.Any),\n]);\n\n/** The parameters `completeJob` decodes: the declared output (or any JSON payload) under `success`. */\nexport const makeCompleteJobParameters = (output: JsonSchema.JsonSchema) =>\n Schema.Struct({\n // Both fields accept `null` because models emit it for a field they mean to omit.\n success: Schema.optional(\n Schema.NullOr(isUndeclaredOutput(output) ? JsonPayload : JsonSchema.toEffectSchema(output)),\n ),\n failure: Schema.optional(\n Schema.NullOr(\n Schema.Struct({\n message: Schema.String.annotate({\n description: 'Short message describing the error.',\n }),\n description: Schema.optional(Schema.NullOr(Schema.String)).annotate({\n description: 'Optional longer message describing in detail what went wrong',\n }),\n }),\n ),\n ),\n });\n\n/**\n * The tool a routine signals completion with: its declared output under `success`, or a failure.\n *\n * Dynamic rather than static: a dynamic tool's JSON schema reaches the provider verbatim, while a\n * static tool is serialized through the provider's structured-output transformer, which rewrites\n * object members into typeless subschemas the Anthropic API rejects. The caller decodes the\n * (unvalidated) input against {@link makeCompleteJobParameters}, so what the model is told and\n * what is validated agree.\n */\nexport const makeCompleteJobTool = (output: JsonSchema.JsonSchema) =>\n Tool.dynamic('completeJob', {\n parameters: JsonSchema.toJsonSchema(makeCompleteJobParameters(output)),\n failure: Schema.String,\n }).annotate(Tool.Strict, false);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Toolkit from 'effect/ai/Toolkit';\nimport * as Deferred from 'effect/Deferred';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as Schema from 'effect/Schema';\n\nimport { AiService, OpaqueToolkit } from '@dxos/ai';\nimport {\n AiSession,\n getOperationFromTool,\n makeToolExecutionService,\n makeToolResolverFromOperations,\n} from '@dxos/assistant';\nimport * as Chat from '@dxos/assistant/Chat';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Template from '@dxos/compute/Template';\nimport * as Trace from '@dxos/compute/Trace';\nimport { Database, Feed, Obj, Ref } from '@dxos/echo';\nimport * as EffectEx from '@dxos/effect/EffectEx';\nimport { invariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { trim } from '@dxos/util';\n\nimport { PromptError } from '../errors.ts';\nimport * as AgentOperation from '../types/AgentOperation.ts';\nimport { makeCompleteJobParameters, makeCompleteJobTool } from './complete-job-tool.ts';\n\nconst DEFAULT_MODEL: DXN.DXN = DXN.make('com.anthropic.model.claude-opus-5.default');\n\nexport default AgentOperation.RunInstructions.pipe(\n Operation.withHandler(\n Effect.fnUntraced(\n function* (data) {\n log.info('processing input', { input: data.input });\n\n const input = yield* Ref.isRef(data.input)\n ? Database.load(data.input).pipe(Effect.map(Obj.toJSON))\n : Effect.succeed(data.input);\n\n yield* Database.flush();\n const instructions = yield* Database.load(data.instructions);\n yield* Trace.emitStatus(`Running ${instructions.id}`);\n\n log.info('starting agent', { instructions: instructions.id, input });\n\n // Bind the instructions' own refs, dropping any that no longer resolve. The refs must be\n // bound as-is (not re-wrapped via `Ref.make`) to preserve their registry DXN: bindings\n // are persisted to the conversation feed, and registry-only skills have no space-DB\n // identity, so an EID ref would not resolve when the binding is re-read.\n const skillRefs = yield* Effect.filter(instructions.skills, (ref) =>\n Database.load(ref).pipe(\n Effect.as(true),\n Effect.catchTag('EntityNotFoundError', () => Effect.succeed(false)),\n ),\n );\n\n // Bind the instructions' context objects (sibling of skills), dropping any that no longer resolve.\n const objectRefs = yield* Effect.filter(instructions.objects ?? [], (ref) =>\n Database.load(ref).pipe(\n Effect.as(true),\n Effect.catchTag('EntityNotFoundError', () => Effect.succeed(false)),\n ),\n );\n\n const textDoc = yield* Database.load(instructions.text);\n let promptText = Template.process(textDoc.content, input);\n\n if (input !== undefined) {\n promptText += `\\n<input>${JSON.stringify(input)}</input>`;\n }\n\n let systemText = trim`\n You are an agent running in the non-interactive mode.\n The user is unable to see what you are doing, and cannot answer any questions.\n Do not ask questions.\n Complete the task before you, and at the end call [completeJob] with {\"success\": <output>}.\n The output goes inside \"success\" — never at the top level, and never wrapped in a second\n \"success\" of its own.\n If you are unable to complete the task, call [completeJob] with {\"failure\": {\"message\": \"...\"}}.\n Pass one of the two, never both, and omit the field you do not use.\n If no output is required, call [completeJob] with an empty object: {}\n The success value must be strictly valid JSON: quote free text, and write numbers without\n digit separators (3628800, never 3,628,800).\n Do not stop until you call [completeJob].\n `;\n if (data.systemInstructions) {\n systemText += `\\n${data.systemInstructions}`;\n }\n\n const modelLayer = AiService.languageModel(DXN.getName(data.model ?? DEFAULT_MODEL));\n\n let feed: Feed.Feed;\n if (data.chat) {\n const chat = yield* Database.load(data.chat);\n invariant(Obj.instanceOf(Chat.Chat, chat), 'Expected Chat object.');\n feed = yield* Database.load(chat.feed);\n } else {\n feed = yield* Database.add(Feed.make());\n }\n\n const resultSink = yield* Deferred.make<unknown, PromptError>();\n const promptToolkit = makePromptAgentToolkit({\n completeJobTool: makeCompleteJobTool(instructions.output),\n parameters: makeCompleteJobParameters(instructions.output),\n resultSink,\n });\n\n const runtime = yield* Effect.context<Database.Service>();\n const session = yield* EffectEx.acquireReleaseResource(() => new AiSession.Session({ feed, runtime }));\n\n yield* Effect.promise(() =>\n session.context.bind({\n skills: skillRefs,\n objects: data.chat ? [...objectRefs, data.chat] : objectRefs,\n }),\n );\n\n yield* session\n .createRequest({\n prompt: promptText,\n system: systemText,\n toolkit: promptToolkit,\n })\n .pipe(\n Effect.provide(\n Layer.mergeAll(modelLayer, ToolExecutionService({ feed }), makeToolResolverFromOperations()),\n ),\n );\n\n return yield* Deferred.poll(resultSink).pipe(\n Effect.flatMap(Effect.fromOption),\n Effect.flatten,\n Effect.catchTag('NoSuchElementError', () =>\n Effect.gen(function* () {\n yield* session\n .createRequest({\n prompt: 'You must signal task completion by calling [completeJob] with the output or failure reason.',\n system: systemText,\n toolkit: promptToolkit,\n })\n .pipe(\n Effect.provide(\n Layer.mergeAll(modelLayer, ToolExecutionService({ feed }), makeToolResolverFromOperations()),\n ),\n );\n\n return yield* Deferred.poll(resultSink).pipe(\n Effect.flatMap(Effect.fromOption),\n Effect.flatten,\n Effect.catchTag('NoSuchElementError', () =>\n Effect.fail(new PromptError('Agent did not signal task completion.', {})),\n ),\n );\n }),\n ),\n );\n },\n // v4 dropped `tapBoth`; `onExit` runs the finalizer on either outcome.\n Effect.onExit(() => Database.flush()),\n Effect.scoped,\n ),\n ),\n Operation.opaqueHandler,\n);\n\nconst makePromptAgentToolkit = (options: {\n completeJobTool: ReturnType<typeof makeCompleteJobTool>;\n parameters: ReturnType<typeof makeCompleteJobParameters>;\n resultSink: Deferred.Deferred<unknown, PromptError>;\n}) => {\n class PromptAgentToolkit extends Toolkit.make(options.completeJobTool) {}\n const layer = PromptAgentToolkit.toLayer({\n completeJob: Effect.fnUntraced(function* (input) {\n // A dynamic tool's input is unvalidated; a decode failure is reported to the model as a\n // tool failure so it can correct the call.\n const result = yield* Schema.decodeUnknownEffect(options.parameters)(input).pipe(\n Effect.mapError((error) => String(error)),\n );\n // A success payload wins over a failure sent alongside it, so a placeholder cannot discard\n // completed work.\n if (result.success == null && result.failure) {\n yield* Deferred.fail(\n options.resultSink,\n new PromptError(result.failure.message, {\n description: result.failure.description ?? undefined,\n }),\n );\n } else {\n yield* Deferred.succeed(options.resultSink, result.success ?? undefined);\n }\n }),\n });\n\n return OpaqueToolkit.make(PromptAgentToolkit, layer);\n};\n\ninterface ToolExecutionServiceOptions {\n feed: Feed.Feed;\n}\n\nconst ToolExecutionService = ({ feed }: ToolExecutionServiceOptions) =>\n Layer.unwrap(\n Effect.gen(function* () {\n const operationInvoker = yield* Operation.Service;\n return makeToolExecutionService({\n invoke: (tool, input) =>\n Effect.gen(function* () {\n const operationDef = getOperationFromTool(tool).pipe(Option.getOrThrow);\n log('invoking operation', { operationDef, input });\n const result = yield* operationInvoker\n .invoke(operationDef, input, {\n conversation: Obj.getURI(feed),\n })\n .pipe(Effect.orDie);\n log('result', { result });\n return result;\n }),\n });\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,oBAAoB,WAAW,aAAa,OAAO,IAAI;AAC7D,IAAM,kBAAkB,UAAU,oBAAoB,kBAAkB,OAAO,KAAA;;;;;;AAO/E,IAAM,sBAAsB,WACzB,SAAS,UAAU,OAAO,QAAQ,sBAAwB,UA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AAC,CAAC,KAAK,CAAC,CAAC,KAC1E,OAAO,UAAU,UAAU,OAAO,KAAK,CAAC,CAC1C;EAGA,IAAI,OAAO,WAAW,QAAQ,OAAO,SACnC,OAAO,SAAS,KACd,QAAQ,YACR,IAAI,YAAY,OAAO,QAAQ,SAAS,EACtC,aAAa,OAAO,QAAQ,eAAe,KAAA,EAC7C,CAAC,CACH;OAEA,OAAO,SAAS,QAAQ,QAAQ,YAAY,OAAO,WAAW,KAAA,CAAS;CAE3E,CAAC,EACH,CAAC;CAED,OAAO,cAAc,KAAK,oBAAoB,KAAK;AACrD;AAMA,IAAM,wBAAwB,EAAE,WAC9B,MAAM,OACJ,OAAO,IAAI,aAAa;CACtB,MAAM,mBAAmB,OAAO,UAAU;CAC1C,OAAO,yBAAyB,EAC9B,SAAS,MAAM,UACb,OAAO,IAAI,aAAa;EACtB,MAAM,eAAe,qBAAqB,IAAI,CAAC,CAAC,KAAK,OAAO,UAAU;EACtE,IAAI,sBAAsB;GAAE;GAAc;EAAM,GAAA;GAAA,YAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA;EAAA,CAAC;EACjD,MAAM,SAAS,OAAO,iBACnB,OAAO,cAAc,OAAO,EAC3B,cAAc,IAAI,OAAO,IAAI,EAC/B,CAAC,CAAA,CACA,KAAK,OAAO,KAAK;EACpB,IAAI,UAAU,EAAE,OAAO,GAAA;GAAA,YAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA;EAAA,CAAC;EACxB,OAAO;CACT,CAAC,EACL,CAAC;AACH,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-run-instructions.mjs","names":["DXN"],"sources":["../../src/operations/complete-job-tool.ts","../../src/operations/run-instructions.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Tool from 'effect/ai/Tool';\nimport * as Schema from 'effect/Schema';\n\nimport { JsonSchema } from '@dxos/echo';\n\n/** `Instructions.make` defaults `output` to `Schema.Void`; this is what that serializes to. */\nconst UNDECLARED_OUTPUT = JsonSchema.toJsonSchema(Schema.Void);\nconst UNDECLARED_TYPE = 'type' in UNDECLARED_OUTPUT ? UNDECLARED_OUTPUT.type : undefined;\n\n/**\n * Whether the routine's stored output carries a payload contract. `Instructions` keeps only the\n * serialized schema, so a declared `null` output is indistinguishable from a defaulted one — and\n * wants the same tool either way, having no payload to validate.\n */\nconst isUndeclaredOutput = (output: JsonSchema.JsonSchema): boolean =>\n ('$id' in output && output.$id === '/schemas/unknown') || ('type' in output && output.type === UNDECLARED_TYPE);\n\n/**\n * Accepts any JSON value, unlike `Schema.Any`, while serializing to concrete types. This matters\n * twice: the Anthropic API rejects a strict tool whose schema contains the empty `{}` subschema\n * `Schema.Any` serializes to, and — observed live — a schema-less `success` invites the model to\n * emit invalid JSON (digit-separated numbers such as `3,628,800`), which kills the sub-agent.\n * `ObjectKeyword` rather than `Record(String, Any)`: the provider's structured-output codec\n * rewrites records into [key, value] tuples whose value member is again the empty schema.\n */\nconst JsonPayload = Schema.Union([\n Schema.String,\n Schema.Number,\n Schema.Boolean,\n Schema.ObjectKeyword,\n Schema.Array(Schema.Any),\n]);\n\n/** The parameters `completeJob` decodes: the declared output (or any JSON payload) under `success`. */\nexport const makeCompleteJobParameters = (output: JsonSchema.JsonSchema) =>\n Schema.Struct({\n // Both fields accept `null` because models emit it for a field they mean to omit.\n success: Schema.optional(\n Schema.NullOr(isUndeclaredOutput(output) ? JsonPayload : JsonSchema.toEffectSchema(output)),\n ),\n failure: Schema.optional(\n Schema.NullOr(\n Schema.Struct({\n message: Schema.String.annotate({\n description: 'Short message describing the error.',\n }),\n description: Schema.optional(Schema.NullOr(Schema.String)).annotate({\n description: 'Optional longer message describing in detail what went wrong',\n }),\n }),\n ),\n ),\n });\n\n/**\n * The tool a routine signals completion with: its declared output under `success`, or a failure.\n *\n * Dynamic rather than static: a dynamic tool's JSON schema reaches the provider verbatim, while a\n * static tool is serialized through the provider's structured-output transformer, which rewrites\n * object members into typeless subschemas the Anthropic API rejects. The caller decodes the\n * (unvalidated) input against {@link makeCompleteJobParameters}, so what the model is told and\n * what is validated agree.\n */\nexport const makeCompleteJobTool = (output: JsonSchema.JsonSchema) =>\n Tool.dynamic('completeJob', {\n parameters: JsonSchema.toJsonSchema(makeCompleteJobParameters(output)),\n failure: Schema.String,\n }).annotate(Tool.Strict, false);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Toolkit from 'effect/ai/Toolkit';\nimport * as Deferred from 'effect/Deferred';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as Schema from 'effect/Schema';\n\nimport { AiService, OpaqueToolkit } from '@dxos/ai';\nimport {\n AiSession,\n getOperationFromTool,\n makeToolExecutionService,\n makeToolResolverFromOperations,\n} from '@dxos/assistant';\nimport * as Chat from '@dxos/assistant/Chat';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Template from '@dxos/compute/Template';\nimport * as Trace from '@dxos/compute/Trace';\nimport { Database, Feed, Obj, Ref } from '@dxos/echo';\nimport * as EffectEx from '@dxos/effect/EffectEx';\nimport { invariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { trim } from '@dxos/util';\n\nimport { PromptError } from '../errors.ts';\nimport * as AgentOperation from '../types/AgentOperation.ts';\nimport { makeCompleteJobParameters, makeCompleteJobTool } from './complete-job-tool.ts';\n\nconst DEFAULT_MODEL: DXN.DXN = DXN.make('com.anthropic.model.claude-opus-5.default');\n\nexport default AgentOperation.RunInstructions.pipe(\n Operation.withHandler(\n Effect.fnUntraced(\n function* (data) {\n log.info('processing input', { input: data.input });\n\n const input = yield* Ref.isRef(data.input)\n ? Database.load(data.input).pipe(Effect.map(Obj.toJSON))\n : Effect.succeed(data.input);\n\n yield* Database.flush();\n const instructions = yield* Database.load(data.instructions);\n yield* Trace.emitStatus(`Running ${instructions.id}`);\n\n log.info('starting agent', { instructions: instructions.id, input });\n\n // Bind the instructions' own refs, dropping any that no longer resolve. The refs must be\n // bound as-is (not re-wrapped via `Ref.make`) to preserve their registry DXN: bindings\n // are persisted to the conversation feed, and registry-only skills have no space-DB\n // identity, so an EID ref would not resolve when the binding is re-read.\n const skillRefs = yield* Effect.filter(instructions.skills, (ref) =>\n Database.load(ref).pipe(\n Effect.as(true),\n Effect.catchTag('EntityNotFoundError', () => Effect.succeed(false)),\n ),\n );\n\n // Bind the instructions' context objects (sibling of skills), dropping any that no longer resolve.\n const objectRefs = yield* Effect.filter(instructions.objects ?? [], (ref) =>\n Database.load(ref).pipe(\n Effect.as(true),\n Effect.catchTag('EntityNotFoundError', () => Effect.succeed(false)),\n ),\n );\n\n const textDoc = yield* Database.load(instructions.text);\n let promptText = Template.process(textDoc.content, input);\n\n if (input !== undefined) {\n promptText += `\\n<input>${JSON.stringify(input)}</input>`;\n }\n\n let systemText = trim`\n You are an agent running in the non-interactive mode.\n The user is unable to see what you are doing, and cannot answer any questions.\n Do not ask questions.\n Complete the task before you, and at the end call [completeJob] with {\"success\": <output>}.\n The output goes inside \"success\" — never at the top level, and never wrapped in a second\n \"success\" of its own.\n If you are unable to complete the task, call [completeJob] with {\"failure\": {\"message\": \"...\"}}.\n Pass one of the two, never both, and omit the field you do not use.\n If no output is required, call [completeJob] with an empty object: {}\n The success value must be strictly valid JSON: quote free text, and write numbers without\n digit separators (3628800, never 3,628,800).\n Do not stop until you call [completeJob].\n `;\n if (data.systemInstructions) {\n systemText += `\\n${data.systemInstructions}`;\n }\n\n const modelLayer = AiService.languageModel(DXN.getName(data.model ?? DEFAULT_MODEL));\n\n let feed: Feed.Feed;\n if (data.chat) {\n const chat = yield* Database.load(data.chat);\n invariant(Obj.instanceOf(Chat.Chat, chat), 'Expected Chat object.');\n feed = yield* Database.load(chat.feed);\n } else {\n feed = yield* Database.add(Feed.make());\n }\n\n const resultSink = yield* Deferred.make<unknown, PromptError>();\n const promptToolkit = makePromptAgentToolkit({\n completeJobTool: makeCompleteJobTool(instructions.output),\n parameters: makeCompleteJobParameters(instructions.output),\n resultSink,\n });\n\n const runtime = yield* Effect.context<Database.Service>();\n const session = yield* EffectEx.acquireReleaseResource(() => new AiSession.Session({ feed, runtime }));\n\n yield* Effect.promise(() =>\n session.context.bind({\n skills: skillRefs,\n objects: data.chat ? [...objectRefs, data.chat] : objectRefs,\n }),\n );\n\n yield* session\n .createRequest({\n prompt: promptText,\n system: systemText,\n toolkit: promptToolkit,\n })\n .pipe(\n Effect.provide(\n Layer.mergeAll(modelLayer, ToolExecutionService({ feed }), makeToolResolverFromOperations()),\n ),\n );\n\n return yield* Deferred.poll(resultSink).pipe(\n Effect.flatMap(Effect.fromOption),\n Effect.flatten,\n Effect.catchTag('NoSuchElementError', () =>\n Effect.gen(function* () {\n yield* session\n .createRequest({\n prompt: 'You must signal task completion by calling [completeJob] with the output or failure reason.',\n system: systemText,\n toolkit: promptToolkit,\n })\n .pipe(\n Effect.provide(\n Layer.mergeAll(modelLayer, ToolExecutionService({ feed }), makeToolResolverFromOperations()),\n ),\n );\n\n return yield* Deferred.poll(resultSink).pipe(\n Effect.flatMap(Effect.fromOption),\n Effect.flatten,\n Effect.catchTag('NoSuchElementError', () =>\n Effect.fail(new PromptError('Agent did not signal task completion.', {})),\n ),\n );\n }),\n ),\n );\n },\n // v4 dropped `tapBoth`; `onExit` runs the finalizer on either outcome.\n Effect.onExit(() => Database.flush()),\n Effect.scoped,\n ),\n ),\n Operation.opaqueHandler,\n);\n\nconst makePromptAgentToolkit = (options: {\n completeJobTool: ReturnType<typeof makeCompleteJobTool>;\n parameters: ReturnType<typeof makeCompleteJobParameters>;\n resultSink: Deferred.Deferred<unknown, PromptError>;\n}) => {\n class PromptAgentToolkit extends Toolkit.make(options.completeJobTool) {}\n const layer = PromptAgentToolkit.toLayer({\n completeJob: Effect.fnUntraced(function* (input) {\n // A dynamic tool's input is unvalidated; a decode failure is reported to the model as a\n // tool failure so it can correct the call.\n const result = yield* Schema.decodeUnknownEffect(options.parameters)(input).pipe(\n Effect.mapError((error) => String(error)),\n );\n // A success payload wins over a failure sent alongside it, so a placeholder cannot discard\n // completed work.\n if (result.success == null && result.failure) {\n yield* Deferred.fail(\n options.resultSink,\n new PromptError(result.failure.message, {\n description: result.failure.description ?? undefined,\n }),\n );\n } else {\n yield* Deferred.succeed(options.resultSink, result.success ?? undefined);\n }\n }),\n });\n\n return OpaqueToolkit.make(PromptAgentToolkit, layer);\n};\n\ninterface ToolExecutionServiceOptions {\n feed: Feed.Feed;\n}\n\nconst ToolExecutionService = ({ feed }: ToolExecutionServiceOptions) =>\n Layer.unwrap(\n Effect.gen(function* () {\n const operationInvoker = yield* Operation.Service;\n return makeToolExecutionService({\n invoke: (tool, input) =>\n Effect.gen(function* () {\n const operationDef = getOperationFromTool(tool).pipe(Option.getOrThrow);\n log('invoking operation', { operationDef, input });\n const result = yield* operationInvoker\n .invoke(operationDef, input, {\n conversation: Obj.getURI(feed),\n })\n .pipe(Effect.orDie);\n log('result', { result });\n return result;\n }),\n });\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,oBAAoB,WAAW,aAAa,OAAO,IAAI;AAC7D,IAAM,kBAAkB,UAAU,oBAAoB,kBAAkB,OAAO,KAAA;;;;;;AAO/E,IAAM,sBAAsB,WACzB,SAAS,UAAU,OAAO,QAAQ,sBAAwB,UAAU,UAAU,OAAO,SAAS;;;;;;;;;AAUjG,IAAM,cAAc,OAAO,MAAM;CAC/B,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO,MAAM,OAAO,GAAG;AACzB,CAAC;;AAGD,IAAa,6BAA6B,WACxC,OAAO,OAAO;CAEZ,SAAS,OAAO,SACd,OAAO,OAAO,mBAAmB,MAAM,IAAI,cAAc,WAAW,eAAe,MAAM,CAAC,CAC5F;CACA,SAAS,OAAO,SACd,OAAO,OACL,OAAO,OAAO;EACZ,SAAS,OAAO,OAAO,SAAS,EAC9B,aAAa,sCACf,CAAC;EACD,aAAa,OAAO,SAA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,MAAM,OACJ,OAAO,IAAI,aAAa;CACtB,MAAM,mBAAmB,OAAO,UAAU;CAC1C,OAAO,yBAAyB,EAC9B,SAAS,MAAM,UACb,OAAO,IAAI,aAAa;EACtB,MAAM,eAAe,qBAAqB,IAAI,CAAC,CAAC,KAAK,OAAO,UAAU;EACtE,IAAI,sBAAsB;GAAE;GAAc;EAAM,GAAA;GAAA,YAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA;EAAA,CAAC;EACjD,MAAM,SAAS,OAAO,iBACnB,OAAO,cAAc,OAAO,EAC3B,cAAc,IAAI,OAAO,IAAI,EAC/B,CAAC,CAAA,CACA,KAAK,OAAO,KAAK;EACpB,IAAI,UAAU,EAAE,OAAO,GAAA;GAAA,YAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA;EAAA,CAAC;EACxB,OAAO;CACT,CAAC,EACL,CAAC;AACH,CAAC,CACH"}
@@ -1,4 +1,4 @@
1
- import { Memory } from "./Memory.mjs";
1
+ import { t as Memory } from "./chunk-Memory.mjs";
2
2
  import { i as SaveMemory } from "./chunk-operations4.mjs";
3
3
  import * as Effect from "effect/Effect";
4
4
  import { Database, Entity, Obj } from "@dxos/echo";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-save.mjs","names":[],"sources":["../../src/skills/memory/operations/save.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database, Entity, Obj } from '@dxos/echo';\n\nimport * as Memory from '../../../types/Memory.ts';\nimport { SaveMemory } from './definitions.ts';\n\nexport default SaveMemory.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ title, content }) {\n const memory = yield* Database.add(Obj.make(Memory.Memory, { title, content }));\n return Entity.toJSON(memory);\n }),\n ),\n);\n"],"mappings":";;;;;;AAYA,IAAA,eAAe,WAAW,KACxB,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,OAAO,WAAW;CACvC,MAAM,SAAS,OAAO,SAAS,IAAI,IAAI,KAAK,QAAe;EAAE;EAAO;CAAQ,CAAC,CAAC;CAC9E,OAAO,OAAO,OAAO,MAAM;AAC7B,CAAC,CACH,CACF"}
1
+ {"version":3,"file":"chunk-save.mjs","names":["Memory.Memory"],"sources":["../../src/skills/memory/operations/save.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { Database, Entity, Obj } from '@dxos/echo';\n\nimport * as Memory from '../../../types/Memory.ts';\nimport { SaveMemory } from './definitions.ts';\n\nexport default SaveMemory.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ title, content }) {\n const memory = yield* Database.add(Obj.make(Memory.Memory, { title, content }));\n return Entity.toJSON(memory);\n }),\n ),\n);\n"],"mappings":";;;;;;AAYA,IAAA,eAAe,WAAW,KACxB,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,OAAO,WAAW;CACvC,MAAM,SAAS,OAAO,SAAS,IAAI,IAAI,KAAKA,QAAe;EAAE;EAAO;CAAQ,CAAC,CAAC;CAC9E,OAAO,OAAO,OAAO,MAAM;AAC7B,CAAC,CACH,CACF"}
@@ -1,16 +1,16 @@
1
- import { t as DelegationSkill_exports } from "./ns/DelegationSkill.mjs";
2
- import { t as AgentOperation_exports } from "./AgentOperation.mjs";
1
+ import { t as DelegationSkill_exports } from "./chunk-DelegationSkill.mjs";
2
+ import { t as AgentOperation_exports } from "./chunk-AgentOperation.mjs";
3
3
  import { t as DelegationStrategy_exports } from "./chunk-DelegationStrategy.mjs";
4
4
  import { t as WebSearchSkill_exports } from "./chunk-WebSearchSkill.mjs";
5
- import { t as SlashCommand_exports } from "./ns/SlashCommand.mjs";
6
- import { t as SkillManagerSkill_exports } from "./ns/SkillManagerSkill.mjs";
7
- import { t as PlanningSkill_exports } from "./ns/PlanningSkill.mjs";
8
- import { t as Memory_exports } from "./Memory.mjs";
9
- import { t as MemorySkill_exports } from "./ns/MemorySkill.mjs";
10
- import { t as ChatContextSkill_exports } from "./ns/ChatContextSkill.mjs";
11
- import { t as BrowserSkill_exports } from "./ns/BrowserSkill.mjs";
12
- import { t as AutomationSkill_exports } from "./ns/AutomationSkill.mjs";
13
- import { t as AlarmSkill_exports } from "./ns/AlarmSkill.mjs";
14
- import { t as AgentSkill_exports } from "./ns/AgentSkill.mjs";
15
- import { t as AgentOperationHandlerSet_exports } from "./ns/AgentOperationHandlerSet.mjs";
5
+ import { t as SlashCommand_exports } from "./chunk-SlashCommand.mjs";
6
+ import { t as SkillManagerSkill_exports } from "./chunk-SkillManagerSkill.mjs";
7
+ import { t as PlanningSkill_exports } from "./chunk-PlanningSkill.mjs";
8
+ import { n as Memory_exports } from "./chunk-Memory.mjs";
9
+ import { t as MemorySkill_exports } from "./chunk-MemorySkill.mjs";
10
+ import { t as ChatContextSkill_exports } from "./chunk-ChatContextSkill.mjs";
11
+ import { t as BrowserSkill_exports } from "./chunk-BrowserSkill.mjs";
12
+ import { t as AutomationSkill_exports } from "./chunk-AutomationSkill.mjs";
13
+ import { t as AlarmSkill_exports } from "./chunk-AlarmSkill.mjs";
14
+ import { t as AgentSkill_exports } from "./chunk-AgentSkill.mjs";
15
+ import { t as AgentOperationHandlerSet_exports } from "./chunk-AgentOperationHandlerSet.mjs";
16
16
  export { AgentOperation_exports as AgentOperation, AgentOperationHandlerSet_exports as AgentOperationHandlerSet, AgentSkill_exports as AgentSkill, AlarmSkill_exports as AlarmSkill, AutomationSkill_exports as AutomationSkill, BrowserSkill_exports as BrowserSkill, ChatContextSkill_exports as ChatContextSkill, DelegationSkill_exports as DelegationSkill, DelegationStrategy_exports as DelegationStrategy, Memory_exports as Memory, MemorySkill_exports as MemorySkill, PlanningSkill_exports as PlanningSkill, SkillManagerSkill_exports as SkillManagerSkill, SlashCommand_exports as SlashCommand, WebSearchSkill_exports as WebSearchSkill };
@@ -1,8 +1,2 @@
1
- import { t as __exportAll } from "../chunk-rolldown-runtime.mjs";
2
- import { t as AgentHandlers } from "../chunk-operations8.mjs";
3
- //#region src/AgentOperationHandlerSet.ts
4
- var AgentOperationHandlerSet_exports = /* @__PURE__ */ __exportAll({ handlers: () => AgentHandlers });
5
- //#endregion
6
- export { AgentHandlers as handlers, AgentOperationHandlerSet_exports as t };
7
-
8
- //# sourceMappingURL=AgentOperationHandlerSet.mjs.map
1
+ export { t as handlers } from "../chunk-operations8.mjs";
2
+ import "../chunk-AgentOperationHandlerSet.mjs";