@dxos/assistant-toolkit 0.8.4-staging.60fe92afc8 → 0.9.1-main.c7dcc2e112

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 (89) hide show
  1. package/dist/lib/neutral/{add-artifact-54DVWE53.mjs → add-artifact-QEQP6T7Z.mjs} +4 -4
  2. package/dist/lib/neutral/{agent-LCBDWP74.mjs → agent-BU6PB7J6.mjs} +4 -4
  3. package/dist/lib/neutral/{agent-rules-3TBAIVTS.mjs → agent-rules-L3AHRSR4.mjs} +4 -4
  4. package/dist/lib/neutral/{chunk-URUJQGI6.mjs → chunk-5HANNHZZ.mjs} +11 -2
  5. package/dist/lib/neutral/chunk-5HANNHZZ.mjs.map +7 -0
  6. package/dist/lib/neutral/{chunk-KC2LPECT.mjs → chunk-ABOAU3NN.mjs} +4 -4
  7. package/dist/lib/neutral/chunk-ABOAU3NN.mjs.map +7 -0
  8. package/dist/lib/neutral/{chunk-RNIUE4LK.mjs → chunk-CUT6GB2W.mjs} +2 -2
  9. package/dist/lib/neutral/{chunk-Z3KITY4U.mjs → chunk-JZHXJBSM.mjs} +2 -2
  10. package/dist/lib/neutral/chunk-JZHXJBSM.mjs.map +7 -0
  11. package/dist/lib/neutral/{chunk-3YH7MWSD.mjs → chunk-KZDQGI3S.mjs} +2 -2
  12. package/dist/lib/neutral/{chunk-JRUTUKPS.mjs → chunk-OK3P6URP.mjs} +3 -3
  13. package/dist/lib/neutral/{chunk-BOB6M2YM.mjs → chunk-WTUY5UCA.mjs} +3 -3
  14. package/dist/lib/neutral/{chunk-BOB6M2YM.mjs.map → chunk-WTUY5UCA.mjs.map} +1 -1
  15. package/dist/lib/neutral/chunk-ZA5WZL4H.mjs +97 -0
  16. package/dist/lib/neutral/chunk-ZA5WZL4H.mjs.map +7 -0
  17. package/dist/lib/neutral/{create-agent-KUTBEXLJ.mjs → create-agent-7PBQFYHF.mjs} +6 -6
  18. package/dist/lib/neutral/{definitions-6HU2P7R7.mjs → definitions-BHRGH45G.mjs} +4 -4
  19. package/dist/lib/neutral/{delegate-task-E7WLHT6S.mjs → delegate-task-IQJSRLN3.mjs} +4 -4
  20. package/dist/lib/neutral/{get-context-X4FCUMLK.mjs → get-context-6SZ7HOV4.mjs} +4 -4
  21. package/dist/lib/neutral/index.mjs +61 -18
  22. package/dist/lib/neutral/index.mjs.map +4 -4
  23. package/dist/lib/neutral/meta.json +1 -1
  24. package/dist/lib/neutral/{prompt-QL7TTLM3.mjs → prompt-37GJGKNM.mjs} +4 -4
  25. package/dist/lib/neutral/{prompt-QL7TTLM3.mjs.map → prompt-37GJGKNM.mjs.map} +1 -1
  26. package/dist/lib/neutral/{qualifier-QAW6LSYF.mjs → qualifier-DHPHY3YH.mjs} +4 -4
  27. package/dist/lib/neutral/{sync-triggers-JEVTYIGU.mjs → sync-triggers-CI6ECSZX.mjs} +5 -5
  28. package/dist/lib/neutral/testing/index.mjs +2 -12
  29. package/dist/lib/neutral/testing/index.mjs.map +3 -3
  30. package/dist/lib/neutral/{update-tasks-N65UQUHS.mjs → update-tasks-R5YXESZ6.mjs} +4 -4
  31. package/dist/types/src/blueprints/agent/operations/definitions.d.ts +6 -4
  32. package/dist/types/src/blueprints/agent/operations/definitions.d.ts.map +1 -1
  33. package/dist/types/src/blueprints/agent-wizard/operations/create-agent.d.ts +3 -2
  34. package/dist/types/src/blueprints/agent-wizard/operations/definitions.d.ts +6 -4
  35. package/dist/types/src/blueprints/agent-wizard/operations/definitions.d.ts.map +1 -1
  36. package/dist/types/src/blueprints/agent-wizard/operations/sync-triggers.d.ts +3 -2
  37. package/dist/types/src/blueprints/delegation/operations/delegate-task.d.ts +4 -2
  38. package/dist/types/src/blueprints/delegation/operations/delegate-task.d.ts.map +1 -1
  39. package/dist/types/src/blueprints/planning/operations/update-tasks.d.ts.map +1 -1
  40. package/dist/types/src/functions/agent/definitions.d.ts +2 -2
  41. package/dist/types/src/supervisor/delegation-strategy.d.ts.map +1 -1
  42. package/dist/types/src/supervisor/index.d.ts +1 -0
  43. package/dist/types/src/supervisor/index.d.ts.map +1 -1
  44. package/dist/types/src/supervisor/plan-completion-guard.d.ts +6 -0
  45. package/dist/types/src/supervisor/plan-completion-guard.d.ts.map +1 -0
  46. package/dist/types/src/testing/plugins.d.ts.map +1 -1
  47. package/dist/types/src/types/Agent.d.ts +3 -2
  48. package/dist/types/src/types/Agent.d.ts.map +1 -1
  49. package/dist/types/src/types/Chat.d.ts +4 -4
  50. package/dist/types/src/types/Plan.d.ts +14 -3
  51. package/dist/types/src/types/Plan.d.ts.map +1 -1
  52. package/dist/types/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +27 -26
  54. package/src/blueprints/agent/blueprint.conversations.json +1 -1
  55. package/src/blueprints/database/blueprint.conversations.json +1 -1
  56. package/src/blueprints/delegation/operations/delegate-task.test.ts +68 -4
  57. package/src/blueprints/delegation/operations/delegate-task.ts +47 -11
  58. package/src/blueprints/memory/blueprint.conversations.json +1 -1
  59. package/src/blueprints/planning/operations/update-tasks.ts +4 -3
  60. package/src/functions/agent/definitions.ts +1 -1
  61. package/src/functions/agent/prompt.conversations.json +1 -1
  62. package/src/functions/agent/prompt.ts +1 -1
  63. package/src/supervisor/delegation-strategy.ts +8 -1
  64. package/src/supervisor/index.ts +1 -0
  65. package/src/supervisor/plan-completion-guard.ts +50 -0
  66. package/src/testing/plugins.tsx +2 -21
  67. package/src/types/Chat.ts +1 -1
  68. package/src/types/Plan.ts +14 -0
  69. package/dist/lib/neutral/chunk-KC2LPECT.mjs.map +0 -7
  70. package/dist/lib/neutral/chunk-U5FCQXA2.mjs +0 -69
  71. package/dist/lib/neutral/chunk-U5FCQXA2.mjs.map +0 -7
  72. package/dist/lib/neutral/chunk-URUJQGI6.mjs.map +0 -7
  73. package/dist/lib/neutral/chunk-Z3KITY4U.mjs.map +0 -7
  74. package/src/blueprints/blueprint-manager/blueprint.conversations.json +0 -1
  75. package/src/blueprints/browser/blueprint.conversations.json +0 -1
  76. package/src/blueprints/websearch/blueprint.conversations.json +0 -1
  77. /package/dist/lib/neutral/{add-artifact-54DVWE53.mjs.map → add-artifact-QEQP6T7Z.mjs.map} +0 -0
  78. /package/dist/lib/neutral/{agent-LCBDWP74.mjs.map → agent-BU6PB7J6.mjs.map} +0 -0
  79. /package/dist/lib/neutral/{agent-rules-3TBAIVTS.mjs.map → agent-rules-L3AHRSR4.mjs.map} +0 -0
  80. /package/dist/lib/neutral/{chunk-RNIUE4LK.mjs.map → chunk-CUT6GB2W.mjs.map} +0 -0
  81. /package/dist/lib/neutral/{chunk-3YH7MWSD.mjs.map → chunk-KZDQGI3S.mjs.map} +0 -0
  82. /package/dist/lib/neutral/{chunk-JRUTUKPS.mjs.map → chunk-OK3P6URP.mjs.map} +0 -0
  83. /package/dist/lib/neutral/{create-agent-KUTBEXLJ.mjs.map → create-agent-7PBQFYHF.mjs.map} +0 -0
  84. /package/dist/lib/neutral/{definitions-6HU2P7R7.mjs.map → definitions-BHRGH45G.mjs.map} +0 -0
  85. /package/dist/lib/neutral/{delegate-task-E7WLHT6S.mjs.map → delegate-task-IQJSRLN3.mjs.map} +0 -0
  86. /package/dist/lib/neutral/{get-context-X4FCUMLK.mjs.map → get-context-6SZ7HOV4.mjs.map} +0 -0
  87. /package/dist/lib/neutral/{qualifier-QAW6LSYF.mjs.map → qualifier-DHPHY3YH.mjs.map} +0 -0
  88. /package/dist/lib/neutral/{sync-triggers-JEVTYIGU.mjs.map → sync-triggers-CI6ECSZX.mjs.map} +0 -0
  89. /package/dist/lib/neutral/{update-tasks-N65UQUHS.mjs.map → update-tasks-R5YXESZ6.mjs.map} +0 -0
@@ -14,9 +14,10 @@ import { trim } from '@dxos/util';
14
14
  import { Plan, Agent } from '../../../types';
15
15
  import INSTRUCTIONS from './update-tasks.md?raw';
16
16
 
17
- // Omit `delegated` (and `chat`) from the LLM-facing schema: delegation is set only by the
18
- // delegation tool, never by ordinary planning, and keeping it out leaves the tool schema unchanged.
19
- const SimpleTask = Plan.Task.omit('chat', 'delegated');
17
+ // Omit `chat`, `delegated`, and `agentPid` from the LLM-facing schema: these are set by the
18
+ // delegation tool / runtime, never by ordinary planning, and keeping them out leaves the tool
19
+ // schema unchanged.
20
+ const SimpleTask = Plan.Task.omit('chat', 'delegated', 'agentPid');
20
21
 
21
22
  export const UpdateTasks = Operation.make({
22
23
  meta: {
@@ -29,7 +29,7 @@ export const AgentPrompt = Operation.make({
29
29
  chat: Schema.optional(Ref.Ref(Chat.Chat)),
30
30
 
31
31
  /**
32
- * @default ai.claude.model.claude-opus-4-6
32
+ * @default ai.claude.model.claude-opus-4-8
33
33
  */
34
34
  model: Schema.optional(ModelName),
35
35
 
@@ -1 +1 @@
1
- {"conversations":[{"parameters":{"model":"ai.claude.model.claude-opus-4-6","stream":true,"tools":[{"name":"completeJob","inputSchema":{"type":"object","required":[],"properties":{"success":{"$id":"/schemas/any","title":"any"},"failure":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Short message describing the error."},"description":{"type":"string","description":"Optional longer message describing in detail what went wrong"}},"additionalProperties":false}},"additionalProperties":false}}]},"prompt":{"content":[{"role":"system","content":"You are an agent running in the non-interactive mode.\nThe user is unable to see what you are doing, and cannot answer any questions.\nDo not ask questions.\nComplete the task before you, and at the end call [completeJob] with the output.\nIf you are unable to complete the task, call [completeJob] with the failure reason.\nIf no output is required, call [completeJob] with an empty object: {}\nDo not stop until you call [completeJob].","options":{}},{"role":"user","content":"Reply with a single word: ack.\n<input>{}</input>","options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_01JstbpndWJDAhVwAppVJz2H","modelId":"claude-opus-4-6","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"reasoning-start","id":"0","metadata":{}},{"type":"reasoning-delta","id":"0","delta":"The user wants me to reply with a single word: \"ack\".","metadata":{}},{"type":"reasoning-delta","id":"0","delta":"","metadata":{"anthropic":{"type":"thinking","signature":"EvsBCmMIDhgCKkDoETBa+lesagv7ixB9LGrYHpBYfS/DCnRnegAetRGGWDl0kkFyqVQI7oDc+ZWbyk9tB+4ePqoqNXQXwE3240/HMg9jbGF1ZGUtb3B1cy00LTY4AEIIdGhpbmtpbmcSDFVIZlew/AFp1rmNoxoMPw+kyp+9hoNL5WyHIjDdm7hZK7hOH93slrwJoeXIuYMlv70L5mOQbDviNfFQyGfbuluo3tzWampRVGtohCgqRtiIkY7cWA700K9SVqH4mMfq1sjQ7yYuCRMv2lT7PrbCp3IRJmncUU6avNwBVX6E/hMO7ml/pORVNgsnB8Tn6FrYKqMFENAYAQ=="}}},{"type":"reasoning-end","id":"0","metadata":{}},{"type":"tool-params-start","id":"toolu_01KDviPNKjzY2nh9cGmo4oKm","name":"completeJob","providerExecuted":false,"metadata":{}},{"type":"tool-params-delta","id":"toolu_01KDviPNKjzY2nh9cGmo4oKm","delta":"","metadata":{}},{"type":"tool-params-delta","id":"toolu_01KDviPNKjzY2nh9cGmo4oKm","delta":"{\"success\"","metadata":{}},{"type":"tool-params-delta","id":"toolu_01KDviPNKjzY2nh9cGmo4oKm","delta":": ","metadata":{}},{"type":"tool-params-delta","id":"toolu_01KDviPNKjzY2nh9cGmo4oKm","delta":"\"ack\"}","metadata":{}},{"type":"tool-params-end","id":"toolu_01KDviPNKjzY2nh9cGmo4oKm","metadata":{}},{"type":"finish","reason":"tool-calls","usage":{"inputTokens":757,"outputTokens":85,"totalTokens":842},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":757,"output_tokens":60,"server_tool_use":null,"service_tier":"standard"}}}}]},{"parameters":{"model":"ai.claude.model.claude-opus-4-6","stream":true,"tools":[{"name":"completeJob","inputSchema":{"type":"object","required":[],"properties":{"success":{"$id":"/schemas/any","title":"any"},"failure":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Short message describing the error."},"description":{"type":"string","description":"Optional longer message describing in detail what went wrong"}},"additionalProperties":false}},"additionalProperties":false}}]},"prompt":{"content":[{"role":"system","content":"You are an agent running in the non-interactive mode.\nThe user is unable to see what you are doing, and cannot answer any questions.\nDo not ask questions.\nComplete the task before you, and at the end call [completeJob] with the output.\nIf you are unable to complete the task, call [completeJob] with the failure reason.\nIf no output is required, call [completeJob] with an empty object: {}\nDo not stop until you call [completeJob].","options":{}},{"role":"user","content":"Reply with a single word: ack.\n<input>{}</input>","options":{}},{"role":"assistant","content":[{"type":"reasoning","text":"The user wants me to reply with a single word: \"ack\".","options":{}},{"type":"tool-call","id":"toolu_01KDviPNKjzY2nh9cGmo4oKm","name":"completeJob","params":{"success":"ack"},"providerExecuted":false,"options":{}}],"options":{}},{"role":"tool","content":[{"type":"tool-result","id":"toolu_01KDviPNKjzY2nh9cGmo4oKm","name":"completeJob","isFailure":false,"result":{},"providerExecuted":false,"options":{}}],"options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_01Pz14sZtxk8PRuR9CKbe7Fy","modelId":"claude-opus-4-6","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"finish","reason":"stop","usage":{"inputTokens":824,"outputTokens":2,"totalTokens":826},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":824,"output_tokens":2,"server_tool_use":null,"service_tier":"standard"}}}}]}]}
1
+ {"conversations":[{"parameters":{"model":"ai.claude.model.claude-opus-4-6","stream":true,"tools":[{"name":"completeJob","inputSchema":{"type":"object","required":[],"properties":{"success":{"$id":"/schemas/any","title":"any"},"failure":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Short message describing the error."},"description":{"type":"string","description":"Optional longer message describing in detail what went wrong"}},"additionalProperties":false}},"additionalProperties":false}}]},"prompt":{"content":[{"role":"system","content":"You are an agent running in the non-interactive mode.\nThe user is unable to see what you are doing, and cannot answer any questions.\nDo not ask questions.\nComplete the task before you, and at the end call [completeJob] with the output.\nIf you are unable to complete the task, call [completeJob] with the failure reason.\nIf no output is required, call [completeJob] with an empty object: {}\nDo not stop until you call [completeJob].","options":{}},{"role":"user","content":"Reply with a single word: ack.\n<input>{}</input>","options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_011XBspJo8qpA74ASw5uEdDn","modelId":"claude-opus-4-6","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"reasoning-start","id":"0","metadata":{}},{"type":"reasoning-delta","id":"0","delta":"The user wants me to reply with a single word \"ack\" and complete the job.","metadata":{}},{"type":"reasoning-delta","id":"0","delta":"","metadata":{"anthropic":{"type":"thinking","signature":"Eo8CCmMIDhgCKkDmvWuElJmvgQqKv/OM8h45Qm9vFiau8OtHTiKeFGzABfFt5k5Oc9XiWXg1jeCrSXFmAcI3XEaKXp6jF8PCj/O0Mg9jbGF1ZGUtb3B1cy00LTY4AEIIdGhpbmtpbmcSDJLLuLKNtiWzw7pLSxoMVS5+G0m2Rt90uT/BIjDHn93ko70QlooeTV4Dfqhzvh3iIOfFQSt2vGX3dLIl4vErRKSzNfAGaI0f3Se9POgqWmqghiUovsd6FCGPEP+fypxFkW0ljAzvkRZElLL1koC0efkHJXq7+BLOE5LqBCe+kl/Sd22oz6dpOJis0l06/ffWB/VmRLbouqvk9I8W3+bqLYd/MJanUuthpBgB"}}},{"type":"reasoning-end","id":"0","metadata":{}},{"type":"tool-params-start","id":"toolu_018phiRmk3xRDvMqXkqaVTo2","name":"completeJob","providerExecuted":false,"metadata":{}},{"type":"tool-params-delta","id":"toolu_018phiRmk3xRDvMqXkqaVTo2","delta":"","metadata":{}},{"type":"tool-params-delta","id":"toolu_018phiRmk3xRDvMqXkqaVTo2","delta":"{\"success\"","metadata":{}},{"type":"tool-params-delta","id":"toolu_018phiRmk3xRDvMqXkqaVTo2","delta":": \"ack\"}","metadata":{}},{"type":"tool-params-end","id":"toolu_018phiRmk3xRDvMqXkqaVTo2","metadata":{}},{"type":"finish","reason":"tool-calls","usage":{"inputTokens":757,"outputTokens":89,"totalTokens":846},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":757,"output_tokens":43,"server_tool_use":null,"service_tier":"standard"}}}}]},{"parameters":{"model":"ai.claude.model.claude-opus-4-6","stream":true,"tools":[{"name":"completeJob","inputSchema":{"type":"object","required":[],"properties":{"success":{"$id":"/schemas/any","title":"any"},"failure":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Short message describing the error."},"description":{"type":"string","description":"Optional longer message describing in detail what went wrong"}},"additionalProperties":false}},"additionalProperties":false}}]},"prompt":{"content":[{"role":"system","content":"You are an agent running in the non-interactive mode.\nThe user is unable to see what you are doing, and cannot answer any questions.\nDo not ask questions.\nComplete the task before you, and at the end call [completeJob] with the output.\nIf you are unable to complete the task, call [completeJob] with the failure reason.\nIf no output is required, call [completeJob] with an empty object: {}\nDo not stop until you call [completeJob].","options":{}},{"role":"user","content":"Reply with a single word: ack.\n<input>{}</input>","options":{}},{"role":"assistant","content":[{"type":"reasoning","text":"The user wants me to reply with a single word \"ack\" and complete the job.","options":{}},{"type":"tool-call","id":"toolu_018phiRmk3xRDvMqXkqaVTo2","name":"completeJob","params":{"success":"ack"},"providerExecuted":false,"options":{}}],"options":{}},{"role":"tool","content":[{"type":"tool-result","id":"toolu_018phiRmk3xRDvMqXkqaVTo2","name":"completeJob","isFailure":false,"result":{},"providerExecuted":false,"options":{}}],"options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_0167q8hG371zH6naFSmJTKnL","modelId":"claude-opus-4-6","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"finish","reason":"stop","usage":{"inputTokens":824,"outputTokens":2,"totalTokens":826},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":824,"output_tokens":2,"server_tool_use":null,"service_tier":"standard"}}}}]},{"parameters":{"model":"ai.claude.model.claude-opus-4-8","stream":true,"tools":[{"name":"completeJob","inputSchema":{"type":"object","required":[],"properties":{"success":{"$id":"/schemas/any","title":"any"},"failure":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Short message describing the error."},"description":{"type":"string","description":"Optional longer message describing in detail what went wrong"}},"additionalProperties":false}},"additionalProperties":false}}]},"prompt":{"content":[{"role":"system","content":"You are an agent running in the non-interactive mode.\nThe user is unable to see what you are doing, and cannot answer any questions.\nDo not ask questions.\nComplete the task before you, and at the end call [completeJob] with the output.\nIf you are unable to complete the task, call [completeJob] with the failure reason.\nIf no output is required, call [completeJob] with an empty object: {}\nDo not stop until you call [completeJob].","options":{}},{"role":"user","content":"Reply with a single word: ack.\n<input>{}</input>","options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_015BQWUzrZFZMyJcjKfHsF5F","modelId":"claude-opus-4-8","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"text-start","id":"0","metadata":{}},{"type":"text-delta","id":"0","delta":"ack","metadata":{}},{"type":"text-end","id":"0","metadata":{}},{"type":"tool-params-start","id":"toolu_0133KXrwo8bGDYrsoVKDsY1S","name":"completeJob","providerExecuted":false,"metadata":{}},{"type":"tool-params-delta","id":"toolu_0133KXrwo8bGDYrsoVKDsY1S","delta":"","metadata":{}},{"type":"tool-params-delta","id":"toolu_0133KXrwo8bGDYrsoVKDsY1S","delta":"{\"succ","metadata":{}},{"type":"tool-params-delta","id":"toolu_0133KXrwo8bGDYrsoVKDsY1S","delta":"ess\": \"ack\"}","metadata":{}},{"type":"tool-params-end","id":"toolu_0133KXrwo8bGDYrsoVKDsY1S","metadata":{}},{"type":"finish","reason":"tool-calls","usage":{"inputTokens":624,"outputTokens":52,"totalTokens":676},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":624,"output_tokens":4,"server_tool_use":null,"service_tier":"standard"}}}}]},{"parameters":{"model":"ai.claude.model.claude-opus-4-8","stream":true,"tools":[{"name":"completeJob","inputSchema":{"type":"object","required":[],"properties":{"success":{"$id":"/schemas/any","title":"any"},"failure":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Short message describing the error."},"description":{"type":"string","description":"Optional longer message describing in detail what went wrong"}},"additionalProperties":false}},"additionalProperties":false}}]},"prompt":{"content":[{"role":"system","content":"You are an agent running in the non-interactive mode.\nThe user is unable to see what you are doing, and cannot answer any questions.\nDo not ask questions.\nComplete the task before you, and at the end call [completeJob] with the output.\nIf you are unable to complete the task, call [completeJob] with the failure reason.\nIf no output is required, call [completeJob] with an empty object: {}\nDo not stop until you call [completeJob].","options":{}},{"role":"user","content":"Reply with a single word: ack.\n<input>{}</input>","options":{}},{"role":"assistant","content":[{"type":"text","text":"ack","options":{}},{"type":"tool-call","id":"toolu_0133KXrwo8bGDYrsoVKDsY1S","name":"completeJob","params":{"success":"ack"},"providerExecuted":false,"options":{}}],"options":{}},{"role":"tool","content":[{"type":"tool-result","id":"toolu_0133KXrwo8bGDYrsoVKDsY1S","name":"completeJob","isFailure":false,"result":{},"providerExecuted":false,"options":{}}],"options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_01CriLe6LPTyJWJQvVN3WvMq","modelId":"claude-opus-4-8","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"text-start","id":"0","metadata":{}},{"type":"text-delta","id":"0","delta":"ack","metadata":{}},{"type":"text-end","id":"0","metadata":{}},{"type":"finish","reason":"stop","usage":{"inputTokens":683,"outputTokens":4,"totalTokens":687},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":683,"output_tokens":4,"server_tool_use":null,"service_tier":"standard"}}}}]}]}
@@ -28,7 +28,7 @@ import { PromptError } from '../../errors';
28
28
  import * as Chat from '../../types/Chat';
29
29
  import { AgentPrompt } from './definitions';
30
30
 
31
- const DEFAULT_MODEL: ModelName = 'ai.claude.model.claude-opus-4-6';
31
+ const DEFAULT_MODEL: ModelName = 'ai.claude.model.claude-opus-4-8';
32
32
 
33
33
  export default AgentPrompt.pipe(
34
34
  Operation.withHandler(
@@ -128,7 +128,14 @@ export const makeDelegationStrategy = (): DelegationStrategy => ({
128
128
  spawn: Effect.gen(function* () {
129
129
  const invoker = yield* ProcessManager.ProcessOperationInvoker.Service;
130
130
  const fiber = yield* invoker.invokeFiber(AgentPrompt, { prompt: Ref.make(routine), input: {} });
131
- return fiber.pid;
131
+ const pid = fiber.pid;
132
+ Obj.update(plan, (plan) => {
133
+ const taskRecord = plan.tasks.find((taskRecord) => taskRecord.id === task.id);
134
+ if (taskRecord) {
135
+ taskRecord.agentPid = pid;
136
+ }
137
+ });
138
+ return pid;
132
139
  }),
133
140
  });
134
141
  }
@@ -3,3 +3,4 @@
3
3
  //
4
4
 
5
5
  export * from './delegation-strategy';
6
+ export * from './plan-completion-guard';
@@ -0,0 +1,50 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Database, Feed, Filter } from '@dxos/echo';
8
+ import { type CompletionGuard } from '@dxos/functions-runtime';
9
+
10
+ import { Agent, Plan } from '../types';
11
+
12
+ const findAgentForFeed = (feed: Feed.Feed): Effect.Effect<Agent.Agent | undefined, never, Database.Service> =>
13
+ Effect.gen(function* () {
14
+ const agents = yield* Database.query(Filter.type(Agent.Agent)).run;
15
+ for (const agent of agents) {
16
+ if (!agent.chat) {
17
+ continue;
18
+ }
19
+ const matches = yield* Effect.gen(function* () {
20
+ const chat = yield* Database.load(agent.chat!);
21
+ const chatFeed = yield* Database.load(chat.feed);
22
+ return chatFeed.id === feed.id;
23
+ }).pipe(Effect.orElseSucceed(() => false));
24
+ if (matches) {
25
+ return agent;
26
+ }
27
+ }
28
+ return undefined;
29
+ });
30
+
31
+ const hasIncompleteTasks = (plan: Plan.Plan): boolean =>
32
+ plan.tasks.some((task) => task.status === 'todo' || task.status === 'in-progress');
33
+
34
+ /**
35
+ * Returns a markdown plan summary when the conversation's agent still has open plan tasks.
36
+ */
37
+ export const makePlanCompletionGuard = (): CompletionGuard => ({
38
+ getIncompletePlanSummary: (feed) =>
39
+ Effect.gen(function* () {
40
+ const agent = yield* findAgentForFeed(feed);
41
+ if (!agent?.plan) {
42
+ return undefined;
43
+ }
44
+ const plan = yield* Database.load(agent.plan).pipe(Effect.orElseSucceed(() => undefined));
45
+ if (!plan || !hasIncompleteTasks(plan)) {
46
+ return undefined;
47
+ }
48
+ return Plan.formatPlan(plan);
49
+ }),
50
+ });
@@ -7,6 +7,7 @@ import React from 'react';
7
7
 
8
8
  import { Capabilities, Capability } from '@dxos/app-framework';
9
9
  import { Surface } from '@dxos/app-framework/ui';
10
+ import { AppSurface } from '@dxos/app-toolkit/ui';
10
11
  import { DXN, Format, type Obj, Type } from '@dxos/echo';
11
12
  import { Card } from '@dxos/react-ui';
12
13
  import { Syntax } from '@dxos/react-ui-syntax-highlighter';
@@ -30,32 +31,12 @@ declare global {
30
31
  }
31
32
  }
32
33
 
33
- // TODO(dmaretskyi): Removed images from conductor GPT implementation.
34
- const isImage = (data: any): data is any => false;
35
-
36
34
  export const capabilities: Capability.Any[] = [
37
- Capability.contributes(
38
- Capabilities.ReactSurface,
39
- Surface.create({
40
- id: 'pluginImage',
41
- role: 'card--content',
42
- filter: (data: any): data is any => isImage(data.value),
43
- component: ({ data }) => (
44
- <Card.Body>
45
- <img
46
- className='grow object-cover'
47
- src={`data:image/jpeg;base64,${data.value.source.data}`}
48
- alt={data.value.prompt ?? `Generated image [id=${data.value.id}]`}
49
- />
50
- </Card.Body>
51
- ),
52
- }),
53
- ),
54
35
  Capability.contributes(
55
36
  Capabilities.ReactSurface,
56
37
  Surface.create({
57
38
  id: 'pluginDefault',
58
- role: 'card--content',
39
+ filter: Surface.makeFilter(AppSurface.CardContent),
59
40
  position: 'last',
60
41
  component: ({ data }) => (
61
42
  <Card.Body>
package/src/types/Chat.ts CHANGED
@@ -15,7 +15,7 @@ import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';
15
15
  export const Chat = Schema.Struct({
16
16
  name: Schema.String.pipe(Schema.optional),
17
17
  feed: Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false)),
18
- view: Schema.String.pipe(Schema.optional),
18
+ viewType: Schema.String.pipe(Schema.optional),
19
19
  }).pipe(
20
20
  LabelAnnotation.set(['name']),
21
21
  Annotation.IconAnnotation.set({ icon: 'ph--sparkle--regular', hue: 'sky' }),
package/src/types/Plan.ts CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  import * as Schema from 'effect/Schema';
8
8
 
9
+ import { Process } from '@dxos/compute';
9
10
  import { DXN, Annotation, Obj, Ref, Type } from '@dxos/echo';
10
11
 
11
12
  import * as Chat from './Chat';
@@ -32,6 +33,13 @@ export const Task = Schema.Struct({
32
33
  */
33
34
  delegated: Schema.optional(Schema.Boolean),
34
35
 
36
+ /**
37
+ * Sub-agent process id; set when the supervisor spawns a delegated task.
38
+ */
39
+ agentPid: Schema.optional(Process.ID).annotations({
40
+ description: 'Sub-agent process id for delegated tasks.',
41
+ }),
42
+
35
43
  /**
36
44
  * Parent task ID.
37
45
  */
@@ -46,6 +54,12 @@ export const Task = Schema.Struct({
46
54
  });
47
55
 
48
56
  export type Task = Schema.Schema.Type<typeof Task>;
57
+
58
+ /**
59
+ * Short tag label for a delegated sub-agent process id (e.g. `agent-a1b2`).
60
+ */
61
+ export const formatAgentPidTag = (pid: Process.ID): string => `agent-${String(pid).replaceAll('-', '').slice(0, 4)}`;
62
+
49
63
  /**
50
64
  * Hierarchical collection of tasks for humans and agents to track progress.
51
65
  */
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/blueprints/planning/operations/update-tasks.ts", "raw-loader:/__w/dxos/dxos/packages/core/compute/assistant-toolkit/src/blueprints/planning/operations/update-tasks.md?raw"],
4
- "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { AiContext } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nimport { Plan, Agent } from '../../../types';\nimport INSTRUCTIONS from './update-tasks.md?raw';\n\n// Omit `delegated` (and `chat`) from the LLM-facing schema: delegation is set only by the\n// delegation tool, never by ordinary planning, and keeping it out leaves the tool schema unchanged.\nconst SimpleTask = Plan.Task.omit('chat', 'delegated');\n\nexport const UpdateTasks = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.planning.updateTasks'),\n name: 'Update tasks',\n description: INSTRUCTIONS,\n icon: 'ph--check-square-offset--regular',\n },\n input: Schema.Struct({\n tasks: Schema.Array(SimpleTask),\n }),\n output: Schema.Any,\n services: [AiContext.Service, Database.Service],\n});\n\n/**\n * Updates the planning document (Agent.plan) with the given tasks.\n */\nexport default UpdateTasks.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ tasks: newTasks }) {\n const agent = yield* Agent.getFromChatContext;\n // TODO(burdon): How to specify requirements/preconditions before calling?\n // TODO(burdon): How to report non-technical error?\n const plan = yield* Database.load(agent.plan);\n\n Obj.update(plan, (plan) => {\n for (const task of newTasks) {\n const existingTask = plan.tasks.find((t) => t.id === task.id);\n if (existingTask) {\n existingTask.title = task.title;\n existingTask.status = task.status;\n } else {\n plan.tasks.push({\n id: task.id,\n title: task.title,\n status: task.status,\n });\n }\n }\n });\n\n return trim`\n You must update the task status to 'in-progress' when you start and 'done' when complete.\n Current plan updated:\n <plan>\n ${Plan.formatPlan(plan)}\n </plan>\n `;\n }) as any,\n ),\n);\n", "## PLANNING TOOL\n\nThis tool maintains an organized task list.\nUse this to track progress, break down objectives, and ensure thoroughness.\nIf you are asked to create a plan use this tool instead of creating a new document.\nAfter creating initial tasks, update them silently without announcing changes to the user.\nImportant: Do not show or summarize the contents of the task list unless the user asks for this.\n\n### CORE USAGE PRINCIPLES\n\nCreate and manage tasks for: multi-step objectives requiring 3+ distinct actions, complex projects needing careful sequencing,\nuser requests for task organization, multiple deliverables provided together, new instructions (capture as tasks immediately with new IDs),\ncompleted work (mark `done` and add follow-ups), and active work (mark as `in-progress`, limit one at a time).\n\nSkip task management for: single straightforward actions, simple requests achievable in 1-2 steps,\ninformational queries, quick lookups or clarifications, and avoid creating verification tasks unless requested.\n\n### TOOL SPECIFICATION\n\n`update-tasks` requires an array of task objects. Each task object contains:\n\n- id (string, required): unique identifier like \"task_1\" or \"research_sources\"\n- title (string, optional): update to clarify or refine task description\n- status (string, optional): `todo` | `in-progress` | `done`\n\nTask status meanings: 'todo' means not yet started, `in-progress` means currently being worked on, `done` means completed successfully.\n\n### OPERATIONAL GUIDELINES\n\nUpdate tasks in realtime as work progresses. Mark tasks `done` immediately upon completion.\nMaintain only ONE task with `in-progress` status at a time. Complete current tasks before starting new ones.\nUse specific, actionable task titles. Break complex work into manageable logical pieces.\nBatch task updates with other actions when possible for efficiency.\n\n### USAGE EXAMPLES\n\n<example type=\"research_project\">\n<user_message>I need to research sustainable packaging options and write a report comparing costs and environmental impact.</user_message>\n<assistant_action>\nCreates tasks:\n1. {id: \"research_materials\", title: \"Research sustainable packaging materials\", status: \"in-progress\"}\n2. {id: \"compare_costs\", title: \"Compile cost comparison data\", status: \"todo\"}\n3. {id: \"assess_impact\", title: \"Evaluate environmental impact metrics\", status: \"todo\"}\n4. {id: \"draft_report\", title: \"Write comparative analysis report\", status: \"todo\"}\n\nBegins research work immediately in same response.\n</assistant_action>\n<reasoning>Multi-phase project requiring systematic tracking across research, analysis, and writing stages.</reasoning>\n</example>\n\n<example type=\"event_planning\">\n<user_message>Help me plan a team retreat - venue, agenda, catering, and send invitations.</user_message>\n<assistant_action>\nCreates tasks:\n1. {id: \"venue_options\", title: \"Research and recommend venues\", status: \"in-progress\"}\n2. {id: \"draft_agenda\", title: \"Create retreat agenda\", status: \"todo\"}\n3. {id: \"arrange_catering\", title: \"Coordinate catering options\", status: \"todo\"}\n4. {id: \"send_invites\", title: \"Draft and send invitations\", status: \"todo\"}\n</assistant_action>\n<reasoning>Multiple distinct deliverables with dependencies requiring organized tracking.</reasoning>\n</example>\n\n<example type=\"document_analysis\">\n<user_message>Review this 30-page contract for key terms, risks, and negotiation points.</user_message>\n<assistant_action>\nCreates tasks:\n1. {id: \"extract_key_terms\", title: \"Identify key contractual terms\", status: \"in-progress\"}\n2. {id: \"flag_risks\", title: \"Flag potential risks and liabilities\", status: \"todo\"}\n3. {id: \"negotiation_points\", title: \"Compile negotiation recommendations\", status: \"todo\"}\n4. {id: \"summary_doc\", title: \"Prepare executive summary\", status: \"todo\"}\n</assistant_action>\n<reasoning>Substantial analysis work requiring methodical breakdown and systematic review.</reasoning>\n</example>\n\n<example type=\"multiple_deliverables\">\n<user_message>I need: 1) competitor analysis for three companies, 2) SWOT analysis, 3) market positioning recommendations.</user_message>\n<assistant_action>\nCreates tasks:\n1. {id: \"competitor_research\", title: \"Research three competitor companies\", status: \"in-progress\"}\n2. {id: \"swot_analysis\", title: \"Develop SWOT analysis\", status: \"todo\"}\n3. {id: \"positioning_recs\", title: \"Create market positioning recommendations\", status: \"todo\"}\n</assistant_action>\n<reasoning>User provided numbered list of distinct deliverables requiring separate effort.</reasoning>\n</example>\n\n<example type=\"skip_simple_question\">\n<user_message>What's the difference between renewable and sustainable energy?</user_message>\n<assistant_action>Provides explanation directly without creating tasks.</assistant_action>\n<reasoning>Informational request with no actionable work to complete or track.</reasoning>\n</example>\n\n<example type=\"skip_quick_lookup\">\n<user_message>Find the population of Tokyo.</user_message>\n<assistant_action>Searches and provides answer without task tracking.</assistant_action>\n<reasoning>Single straightforward lookup completable immediately.</reasoning>\n</example>\n\n<example type=\"skip_trivial_task\">\n<user_message>Summarize this 2-paragraph email.</user_message>\n<assistant_action>Provides summary directly without creating tasks.</assistant_action>\n<reasoning>Single simple action requiring no breakdown or progress tracking.</reasoning>\n</example>\n\n<example type=\"skip_single_action\">\n<user_message>Check if my flight is on time.</user_message>\n<assistant_action>Performs lookup and reports status without task management.</assistant_action>\n<reasoning>One-step action with immediate completion, no organizational benefit from tasks.</reasoning>\n</example>\n\n### BEST PRACTICES\n\nFor task creation: use descriptive unique IDs reflecting the work, start first task as `in-progress`, batch initial creation with beginning work.\nFor progress tracking: update status immediately upon completion, keep only one `in-progress` task unless parallel work is natural, add follow-up tasks as they emerge. For task breakdown: aim for reasonably-scoped tasks, group related small actions into logical units, split tasks requiring different approaches.\n\nWhen uncertain whether to use task management, err on the side of creating tasks.\nProactive organization demonstrates thoroughness and ensures comprehensive work completion.\n"],
5
- "mappings": ";;;;;;;;;AAAA;;;iBAAAA;;AAIA,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,WAAW;AAC9B,SAASC,WAAW;AACpB,SAASC,YAAY;;;ACXrB;;;ADkBA,IAAMC,aAAaC,aAAKC,KAAKC,KAAK,QAAQ,WAAA;AAEnC,IAAMC,cAAcC,UAAUC,KAAK;EACxCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,wCAAA;IACdI,MAAM;IACNC,aAAaC;IACbC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBC,OAAcC,aAAMjB,UAAAA;EACtB,CAAA;EACAkB,QAAeC;EACfC,UAAU;IAACC,UAAUC;IAASC,SAASD;;AACzC,CAAA;AAKA,IAAAE,wBAAepB,YAAYqB,KACzBpB,UAAUqB,YACDC,UAAG,WAAW,EAAEX,OAAOY,SAAQ,GAAE;AACtC,QAAMC,QAAQ,OAAOC,cAAMC;AAG3B,QAAMC,OAAO,OAAOT,SAASU,KAAKJ,MAAMG,IAAI;AAE5CE,MAAIC,OAAOH,MAAM,CAACA,UAAAA;AAChB,eAAWI,QAAQR,UAAU;AAC3B,YAAMS,eAAeL,MAAKhB,MAAMsB,KAAK,CAACC,MAAMA,EAAEC,OAAOJ,KAAKI,EAAE;AAC5D,UAAIH,cAAc;AAChBA,qBAAaI,QAAQL,KAAKK;AAC1BJ,qBAAaK,SAASN,KAAKM;MAC7B,OAAO;AACLV,QAAAA,MAAKhB,MAAM2B,KAAK;UACdH,IAAIJ,KAAKI;UACTC,OAAOL,KAAKK;UACZC,QAAQN,KAAKM;QACf,CAAA;MACF;IACF;EACF,CAAA;AAEA,SAAOE;;;;YAID3C,aAAK4C,WAAWb,IAAAA,CAAAA;;;AAGxB,CAAA,CAAA,CAAA;",
6
- "names": ["update_tasks_default", "Effect", "Schema", "AiContext", "Operation", "Database", "Obj", "DXN", "trim", "SimpleTask", "Plan", "Task", "omit", "UpdateTasks", "Operation", "make", "meta", "key", "DXN", "name", "description", "INSTRUCTIONS", "icon", "input", "Struct", "tasks", "Array", "output", "Any", "services", "AiContext", "Service", "Database", "update_tasks_default", "pipe", "withHandler", "fn", "newTasks", "agent", "Agent", "getFromChatContext", "plan", "load", "Obj", "update", "task", "existingTask", "find", "t", "id", "title", "status", "push", "trim", "formatPlan"]
7
- }
@@ -1,69 +0,0 @@
1
- import {
2
- Agent_exports,
3
- Plan_exports
4
- } from "./chunk-URUJQGI6.mjs";
5
- import {
6
- __export
7
- } from "./chunk-J5LGTIGS.mjs";
8
-
9
- // src/blueprints/delegation/operations/delegate-task.ts
10
- var delegate_task_exports = {};
11
- __export(delegate_task_exports, {
12
- DelegateTask: () => DelegateTask,
13
- default: () => delegate_task_default
14
- });
15
- import * as Effect from "effect/Effect";
16
- import * as Schema from "effect/Schema";
17
- import { AiContext } from "@dxos/assistant";
18
- import { Operation } from "@dxos/compute";
19
- import { Database, Obj } from "@dxos/echo";
20
- import { DXN } from "@dxos/keys";
21
- import { trim } from "@dxos/util";
22
- var DelegateTask = Operation.make({
23
- meta: {
24
- key: DXN.make("org.dxos.function.delegation.delegateTask"),
25
- name: "Delegate task",
26
- description: trim`
27
- Delegate a unit of work to a sub-agent.
28
- Records the work as an in-progress task on the plan and returns the updated plan.
29
- Use this to hand off work that can proceed in the background while you continue the conversation.
30
- `,
31
- icon: "ph--share-network--regular"
32
- },
33
- input: Schema.Struct({
34
- title: Schema.String.annotations({
35
- description: "Short title describing the work to delegate to a sub-agent."
36
- })
37
- }),
38
- output: Schema.Any,
39
- services: [
40
- AiContext.Service,
41
- Database.Service
42
- ]
43
- });
44
- var delegate_task_default = DelegateTask.pipe(Operation.withHandler(Effect.fn(function* ({ title }) {
45
- const agent = yield* Agent_exports.getFromChatContext;
46
- const plan = yield* Database.load(agent.plan);
47
- Obj.update(plan, (plan2) => {
48
- Plan_exports.addTasks(plan2, [
49
- {
50
- title,
51
- status: "in-progress",
52
- delegated: true
53
- }
54
- ]);
55
- });
56
- return trim`
57
- Delegated work as an in-progress task. Current plan:
58
- <plan>
59
- ${Plan_exports.formatPlan(plan)}
60
- </plan>
61
- `;
62
- })));
63
-
64
- export {
65
- DelegateTask,
66
- delegate_task_default,
67
- delegate_task_exports
68
- };
69
- //# sourceMappingURL=chunk-U5FCQXA2.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/blueprints/delegation/operations/delegate-task.ts"],
4
- "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { AiContext } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nimport { Agent, Plan } from '../../../types';\n\nexport const DelegateTask = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.delegation.delegateTask'),\n name: 'Delegate task',\n description: trim`\n Delegate a unit of work to a sub-agent. \n Records the work as an in-progress task on the plan and returns the updated plan. \n Use this to hand off work that can proceed in the background while you continue the conversation.\n `,\n icon: 'ph--share-network--regular',\n },\n input: Schema.Struct({\n title: Schema.String.annotations({\n description: 'Short title describing the work to delegate to a sub-agent.',\n }),\n }),\n output: Schema.Any,\n services: [AiContext.Service, Database.Service],\n});\n\n/**\n * Records delegated work as an in-progress task on the current agent's plan.\n */\nexport default DelegateTask.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ title }) {\n const agent = yield* Agent.getFromChatContext;\n const plan = yield* Database.load(agent.plan);\n Obj.update(plan, (plan) => {\n // Mark as delegated so the supervisor's reconcile loop picks it up (and ordinary\n // `update-tasks` tasks are NOT spawned as sub-agents).\n Plan.addTasks(plan, [{ title, status: 'in-progress', delegated: true }]);\n });\n return trim`\n Delegated work as an in-progress task. Current plan:\n <plan>\n ${Plan.formatPlan(plan)}\n </plan>\n `;\n }),\n ),\n);\n"],
5
- "mappings": ";;;;;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,WAAW;AAC9B,SAASC,WAAW;AACpB,SAASC,YAAY;AAId,IAAMC,eAAeC,UAAUC,KAAK;EACzCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,2CAAA;IACdI,MAAM;IACNC,aAAaC;;;;;IAKbC,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBC,OAAcC,cAAOC,YAAY;MAC/BP,aAAa;IACf,CAAA;EACF,CAAA;EACAQ,QAAeC;EACfC,UAAU;IAACC,UAAUC;IAASC,SAASD;;AACzC,CAAA;AAKA,IAAA,wBAAenB,aAAaqB,KAC1BpB,UAAUqB,YACDC,UAAG,WAAW,EAAEX,MAAK,GAAE;AAC5B,QAAMY,QAAQ,OAAOC,cAAMC;AAC3B,QAAMC,OAAO,OAAOP,SAASQ,KAAKJ,MAAMG,IAAI;AAC5CE,MAAIC,OAAOH,MAAM,CAACA,UAAAA;AAGhBI,iBAAKC,SAASL,OAAM;MAAC;QAAEf;QAAOqB,QAAQ;QAAeC,WAAW;MAAK;KAAE;EACzE,CAAA;AACA,SAAO1B;;;YAGDuB,aAAKI,WAAWR,IAAAA,CAAAA;;;AAGxB,CAAA,CAAA,CAAA;",
6
- "names": ["Effect", "Schema", "AiContext", "Operation", "Database", "Obj", "DXN", "trim", "DelegateTask", "Operation", "make", "meta", "key", "DXN", "name", "description", "trim", "icon", "input", "Struct", "title", "String", "annotations", "output", "Any", "services", "AiContext", "Service", "Database", "pipe", "withHandler", "fn", "agent", "Agent", "getFromChatContext", "plan", "load", "Obj", "update", "Plan", "addTasks", "status", "delegated", "formatPlan"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Plan.ts", "../../../src/types/Agent.ts", "../../../src/types/McpServer.ts"],
4
- "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN, Annotation, Obj, Ref, Type } from '@dxos/echo';\n\nimport * as Chat from './Chat';\n\nexport const TaskId = Schema.String.pipe(Schema.brand('@dxos/assistant-toolkit/TaskId'));\nexport type TaskId = Schema.Schema.Type<typeof TaskId>;\n\nexport const Task = Schema.Struct({\n /**\n * Short task ID unique within the plan.\n */\n id: TaskId,\n\n title: Schema.String.annotations({\n description: 'Task title and description.',\n }),\n\n status: Schema.Literal('todo', 'in-progress', 'done', 'failed'),\n\n /**\n * Whether this task was handed to a sub-agent via the delegation tool. Only delegated tasks are\n * picked up by the supervisor's reconcile loop, so a task created via ordinary planning\n * (`update-tasks`) is not double-spawned as a sub-agent.\n */\n delegated: Schema.optional(Schema.Boolean),\n\n /**\n * Parent task ID.\n */\n parent: Schema.optional(TaskId).annotations({\n description: 'Parent task ID.',\n }),\n\n /**\n * Chat object that this task is associated with.\n */\n chat: Schema.optional(Ref.Ref(Chat.Chat)),\n});\n\nexport type Task = Schema.Schema.Type<typeof Task>;\n/**\n * Hierarchical collection of tasks for humans and agents to track progress.\n */\nexport const Plan = Schema.Struct({\n tasks: Schema.Array(Task),\n}).pipe(Annotation.HiddenAnnotation.set(true), Type.makeObject(DXN.make('org.dxos.type.plan', '0.1.0')));\nexport type Plan = Type.InstanceType<typeof Plan>;\nexport const generateTaskId = (plan: Plan): TaskId => {\n const existingIds = plan.tasks\n .map((task) => {\n const [num, letter] = task.id.split('-');\n return parseInt(num);\n })\n .filter((_) => !isNaN(_));\n let newId;\n if (existingIds.length === 0) {\n newId = 1;\n } else {\n newId = Math.max(...existingIds) + 1;\n }\n // Add random suffix to avoid collisions.\n return TaskId.make(`${newId}-${crypto.randomUUID().slice(0, 2)}`);\n};\n\n/**\n * Add new tasks to a plan, generating IDs for new tasks.\n * Use inside an `Obj.update` callback.\n */\nexport const addTasks = (\n plan: Obj.Mutable<Plan>,\n tasks: (Pick<Task, 'title'> & Partial<Pick<Task, 'status' | 'parent' | 'chat' | 'delegated'>>)[],\n) => {\n for (const task of tasks) {\n const taskId = generateTaskId(plan);\n plan.tasks.push({ id: taskId, ...task, status: task.status ?? 'todo' });\n }\n return plan;\n};\n\ninterface MakePlanProps {\n tasks: (Pick<Task, 'title'> & Partial<Pick<Task, 'status'>>)[];\n}\n\nexport const makePlan = (props: MakePlanProps): Plan => {\n const plan = Obj.make(Plan, { tasks: [] });\n Obj.update(plan, (plan) => {\n addTasks(plan, props.tasks);\n });\n return plan;\n};\n\n/**\n * Formats plan to markdown format.\n */\nexport const formatPlan = (plan: Plan): string => {\n return plan.tasks\n .map((task) => `- **${task.status?.toLocaleUpperCase()}**: ${task.title ?? 'No title'} <!-- id=${task.id} -->`)\n .join('\\n');\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Schema from 'effect/Schema';\n\nimport { AiContext } from '@dxos/assistant';\nimport { type Blueprint } from '@dxos/compute';\nimport { DXN, Annotation, Database, Feed, Format, Obj, Ref, Relation, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/Annotation';\nimport { type EntityNotFoundError } from '@dxos/echo/Err';\nimport { EffectEx } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\nimport { EID, type EntityId } from '@dxos/keys';\nimport { Text } from '@dxos/schema';\n\nimport * as Chat from './Chat';\nimport * as Plan from './Plan';\n\n/**\n * Agent schema definition.\n */\nexport const Agent = Schema.Struct({\n name: Schema.optional(Schema.String),\n\n /**\n * When false, agent triggers are disabled after sync-triggers runs.\n */\n enabled: Schema.optional(Schema.Boolean).annotations({\n title: 'Enabled',\n description: 'Master switch for agent automation; propagated to all triggers on sync.',\n }),\n\n /**\n * Instructions for the agent.\n */\n instructions: Ref.Ref(Text.Text).pipe(\n Format.FormatAnnotation.set(Format.TypeFormat.Markdown),\n Schema.annotations({ title: 'Instructions' }),\n ),\n\n /**\n * Primary chat for the agent.\n */\n // TODO(dmaretskyi): Multiple chats; RB: branching hierarchy.\n chat: Schema.optional(Ref.Ref(Chat.Chat).pipe(FormInputAnnotation.set(false))),\n\n // TODO(burdon): Is this used? Should it be an artifact?\n // Format.FormatAnnotation.set(Format.TypeFormat.Markdown)\n plan: Ref.Ref(Plan.Plan).pipe(FormInputAnnotation.set(false)),\n\n // TODO(burdon): Currently Memory.Memory objects are global to the space; make them artifacts?\n artifacts: Schema.Array(\n Schema.Struct({\n // TODO(dmaretskyi): Consider gettings names from the artifact itself using Obj.getLabel.\n name: Schema.String,\n // TODO(burdon): Rename object.\n data: Ref.Ref(Obj.Unknown),\n }),\n ).pipe(FormInputAnnotation.set(false)),\n\n /**\n * References to objects with a canonical queue property.\n * Schema must have the QueueAnnotation.\n */\n // Change to trigger.\n // TODO(dmaretskyi): Turn into an array of objects when form-data\n subscriptions: Schema.Array(Ref.Ref(Obj.Unknown)).pipe(FormInputAnnotation.set(false)),\n\n /**\n * Cron expression for a timer trigger that invokes the agent worker on a schedule.\n * The timer trigger bypasses the qualifier and goes straight to the agent worker.\n */\n // Change to trigger.\n cron: Schema.optional(Schema.String).annotations({\n title: 'Cron',\n description: 'Cron expression for a timer trigger that invokes the agent on a schedule.',\n }),\n\n /**\n * Input feed for subscriptions.\n * @deprecated Subscriptions will write directly to the agent.\n */\n feed: Schema.optional(Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false))),\n\n /**\n * Allow the agent to filter events.\n * Related events will be added to the input queue of the agent.\n * It is recommended to enable this.\n * @deprecated\n */\n filterEvents: Schema.optional(Schema.Boolean).annotations({\n title: 'Filter events',\n description: 'Allow the agent to filter events.',\n }),\n}).pipe(\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--drone--regular', hue: 'sky' }),\n Type.makeObject(DXN.make('org.dxos.type.agent', '0.1.0')),\n);\n\nexport type Agent = Type.InstanceType<typeof Agent>;\n\nexport type MakeProps = Omit<\n Obj.MakeProps<typeof Agent>,\n 'instructions' | 'plan' | 'artifacts' | 'subscriptions' | 'chat'\n> &\n Partial<Pick<Obj.MakeProps<typeof Agent>, 'artifacts' | 'subscriptions'>> & {\n instructions: string;\n blueprints?: Ref.Ref<Blueprint.Blueprint>[];\n contextObjects?: Ref.Ref<Obj.Any>[];\n };\n\n/**\n * Creates a fully initialized Agent with chat, queue, and context bindings.\n *\n * @param props - Agent properties including spec, plan, blueprints, and context objects.\n * @param blueprint - The blueprint to use for the agent context.\n * @returns An Effect that yields the initialized Agent.\n */\nexport const makeInitialized = (\n props: MakeProps,\n // TODO(burdon): Reconcile with props.blueprints.\n blueprint: Blueprint.Blueprint,\n): Effect.Effect<Agent, never, Feed.FeedService | Database.Service> =>\n Effect.gen(function* () {\n const agent = yield* Database.add(\n Obj.make(Agent, {\n ...props,\n instructions: Ref.make(Text.make({ content: props.instructions })),\n plan: Ref.make(Plan.makePlan({ tasks: [] })),\n artifacts: props.artifacts ?? [],\n subscriptions: props.subscriptions ?? [],\n filterEvents: props.filterEvents ?? true,\n enabled: props.enabled ?? true,\n }),\n );\n const feed = yield* Database.add(Feed.make());\n const runtime = yield* Effect.runtime<Feed.FeedService>();\n const contextBinder = new AiContext.Binder({ feed, runtime });\n // TODO(dmaretskyi): Blueprint registry.\n const agentBlueprint = yield* Database.add(Obj.clone(blueprint, { deep: true }));\n yield* Effect.promise(() =>\n contextBinder.bind({\n blueprints: [Ref.make(agentBlueprint), ...(props.blueprints ?? [])],\n objects: [Ref.make(agent), ...(props.contextObjects ?? [])],\n }),\n );\n\n const chat = yield* Database.add(\n Chat.make({\n [Obj.Parent]: agent,\n feed: Ref.make(feed),\n }),\n );\n Obj.setParent(feed, chat);\n yield* Database.add(\n Relation.make(Chat.CompanionTo, {\n [Relation.Source]: chat,\n [Relation.Target]: agent,\n }),\n );\n\n const inputFeed = yield* Database.add(Feed.make());\n Obj.update(agent, (agent) => {\n agent.chat = Ref.make(chat);\n agent.feed = Ref.make(inputFeed);\n });\n\n return agent;\n });\n\n/**\n * Resets the agent chat history by rebuilding the chat context.\n * Preserves the existing blueprints and objects from the current chat context.\n *\n * @param agent - The agent whose chat history should be reset. Must have an existing chat.\n * @returns An Effect that resets the chat history.\n */\nexport const resetChatHistory = (\n agent: Agent,\n): Effect.Effect<void, EntityNotFoundError, Feed.FeedService | Database.Service> =>\n Effect.gen(function* () {\n invariant(agent.chat, 'Agent must have an existing chat to reset.');\n\n const existingFeed = yield* agent.chat.pipe(Database.load).pipe(\n Effect.map((_) => _.feed),\n Effect.flatMap(Database.load),\n );\n const runtime = yield* Effect.runtime<Feed.FeedService>();\n const existingContextBinder = yield* EffectEx.acquireReleaseResource(\n () =>\n new AiContext.Binder({\n feed: existingFeed,\n runtime,\n }),\n );\n const blueprints = existingContextBinder.getBlueprints().map((blueprint) => Ref.make(blueprint));\n const objects = existingContextBinder.getObjects().map((object) => Ref.make(object));\n\n const feed = yield* Database.add(Feed.make());\n const contextBinder = new AiContext.Binder({ feed, runtime });\n yield* Effect.promise(() =>\n contextBinder.bind({\n blueprints,\n objects,\n }),\n );\n\n const chat = yield* Database.add(\n Chat.make({\n feed: Ref.make(feed),\n }),\n );\n Obj.setParent(feed, chat);\n Obj.update(agent, (agent) => {\n agent.chat = Ref.make(chat);\n });\n\n yield* Database.add(\n Relation.make(Chat.CompanionTo, {\n [Relation.Source]: chat,\n [Relation.Target]: agent,\n }),\n );\n }).pipe(Effect.scoped);\n\nexport const getFromChatContext: Effect.Effect<Agent, Error, AiContext.Service> = Effect.gen(function* () {\n const agents = yield* Function.pipe(AiContext.Service.findObjects(Agent));\n if (agents.length !== 1) {\n return yield* Effect.fail(new Error(`There should be exactly one agent in context. Got: ${agents.length}`));\n }\n\n const agent = agents[0];\n return agent;\n});\n\n/**\n * Adds an object to the agent's artifacts (context), resolving it by id within the agent's space.\n *\n * Accepts whatever reference a tool returned — a bare entity id (e.g. `01J…`) or a full ECHO URI\n * (`echo:/…`, `echo://…`). LLMs frequently strip a returned URI down to the bare id, which is not\n * a resolvable URI on its own; resolving by entity id within the space tolerates both forms.\n *\n * Returns the fully-qualified {@link Ref.Ref} that was stored (also usable for an inline message\n * reference block).\n */\nexport const addArtifact = (\n agent: Agent,\n { name, id }: { name: string; id: string },\n): Effect.Effect<Ref.Ref<Obj.Unknown>, Error, Database.Service> =>\n Effect.gen(function* () {\n // Untyped, LLM-provided reference: normalize to the entity id, falling back to the raw value\n // (a bare id is already an entity id) — a genuine external-data boundary.\n const parsed = EID.tryParse(id);\n const entityId = ((parsed ? EID.getEntityId(parsed) : undefined) ?? id) as EntityId;\n\n // Store a FULLY-QUALIFIED ref (`echo://<space>/<id>`), not a local `echo:/<id>` one: the artifact\n // is created by a separate tool/process invocation, and a space-less local ref does not resolve\n // when the agent is later read from a different db view (e.g. the UI). It is not resolved here —\n // it resolves lazily when read, by which point the artifact is persisted.\n const { db } = yield* Database.Service;\n const ref = db.makeRef<Obj.Unknown>(EID.make({ spaceId: db.spaceId, entityId }));\n\n Obj.update(agent, (agent) => {\n agent.artifacts.push({ name, data: ref });\n });\n yield* Database.flush();\n return ref;\n });\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { McpServer as McpServerSpec } from '@dxos/compute';\nimport { DXN, Annotation, Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo/Annotation';\n\n/**\n * MCP server configuration stored as a space-level ECHO object.\n *\n * Composes the canonical connection spec from `@dxos/compute` (`url`, `protocol`, `apiKey`)\n * and adds instance-level fields (`name`, `enabled`) plus ECHO annotations.\n *\n * NOTE: `apiKey` is stored in plaintext and replicated to all peers with access to the space.\n * A future iteration should move secrets to per-device credential storage or use envelope encryption.\n */\nexport const McpServer = Schema.Struct({\n ...McpServerSpec.McpServer.fields,\n enabled: Schema.optional(Schema.Boolean),\n}).pipe(\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--plugs-connected--regular', hue: 'sky' }),\n Type.makeObject(DXN.make('org.dxos.type.assistant.mcpServer', '0.1.0')),\n);\n\nexport type McpServer = Type.InstanceType<typeof McpServer>;\n"],
5
- "mappings": ";;;;;;;;;;AAAA;;;;;;;;;;AAMA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAYC,KAAKC,KAAKC,YAAY;AAIzC,IAAMC,SAAgBC,cAAOC,KAAYC,aAAM,gCAAA,CAAA;AAG/C,IAAMC,OAAcC,cAAO;;;;EAIhCC,IAAIN;EAEJO,OAAcN,cAAOO,YAAY;IAC/BC,aAAa;EACf,CAAA;EAEAC,QAAeC,eAAQ,QAAQ,eAAe,QAAQ,QAAA;;;;;;EAOtDC,WAAkBC,gB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,GAAA;IAEIiB,CAAAA,SAAOe,MAAQ,GAAA;EAElB,CAAA,CAAA;AACL,CAAA,EAAA,KAAe,aAAA;AACf,IAAIC,qBAAqB,WAAA,aAAA;QACvB,SAAO,OAAmB,cAAIC,UAAO,QAAA,YAAA,KAAA,CAAA;AACvC,MAAA,OAAA,WAAA,GAAA;AAEA,WAAMlC,OAAiB,YAAA,IAAA,MAAA,sDAAA,OAAA,MAAA,EAAA,CAAA;EACvB;AACC,QAAA,QAAA,OAAA,CAAA;AAEH,SAAA;;AAgBI,IAAA,cAAA,CAAA,OAAA,EAAA,MAAA,GAAA,MAAA,WAAA,aAAA;AAIA,QAAA,SAAA,IAAA,SAAA,EAAA;AACA,QAAA,YAAA,SAAA,IAAA,YAAA,MAAA,IAAA,WAAA;QAI+CmC,EAAAA,GAAAA,IAASC,OAAGD,SAAO;QAAEE,MAAAA,GAAAA,QAAAA,IAAAA,KAAAA;IAAS,SAAA,GAAA;IAEzEC;;cACqBC,OAAAA,CAAAA,WAAAA;WAAMjD,UAAMkD,KAAAA;MAAI;MACzC,MAAA;IACA,CAAA;EACA,CAAA;AACC,SAAA,SAAA,MAAA;;;;;ACjRL;;;;AAMA,YAAYC,aAAY;AAExB,SAASC,aAAaC,qBAAqB;AAC3C,SAASC,OAAAA,MAAKC,cAAAA,aAAYC,QAAAA,aAAY;AACtC,SAASC,uBAAuB;AAWzB,IAAML,YAAmBM,eAAO;EACrC,GAAGL,cAAcD,UAAUO;EAC3BC,SAAgBC,iBAAgBC,eAAO;AACzC,CAAA,EAAGC,KACDN,gBAAgBO,IAAI;EAAC;CAAO,GAC5BT,YAAWU,eAAeD,IAAI;EAAEE,MAAM;EAAgCC,KAAK;AAAM,CAAA,GACjFX,MAAKY,WAAWd,KAAIe,KAAK,qCAAqC,OAAA,CAAA,CAAA;",
6
- "names": ["Schema", "DXN", "Annotation", "Obj", "Ref", "Type", "TaskId", "String", "pipe", "brand", "Task", "Struct", "id", "title", "annotations", "description", "status", "Literal", "delegated", "optional", "Boolean", "parent", "chat", "Ref", "Chat", "Plan", "tasks", "Array", "Annotation", "HiddenAnnotation", "set", "Type", "makeObject", "DXN", "make", "generateTaskId", "plan", "existingIds", "map", "task", "num", "letter", "split", "parseInt", "filter", "_", "isNaN", "newId", "length", "Math", "max", "crypto", "randomUUID", "slice", "addTasks", "taskId", "push", "makePlan", "props", "Obj", "update", "formatPlan", "toLocaleUpperCase", "join", "Effect", "Function", "Schema", "AiContext", "DXN", "Annotation", "Database", "Feed", "Format", "Obj", "Ref", "Relation", "Type", "FormInputAnnotation", "EffectEx", "invariant", "EID", "Text", "Ref", "artifacts", "Array", "Schema", "String", "data", "Obj", "description", "Annotation", "LabelAnnotation", "IconAnnotation", "icon", "hue", "Type", "makeObject", "agent", "Database", "props", "instructions", "Text", "make", "plan", "Plan", "subscriptions", "filterEvents", "enabled", "add", "contextBinder", "AiContext", "Binder", "feed", "runtime", "Effect", "agentBlueprint", "objects", "chat", "setParent", "Source", "Relation", "Target", "inputFeed", "existingFeed", "pipe", "existingContextBinder", "EffectEx", "acquireReleaseResource", "blueprints", "scoped", "agents", "Error", "spaceId", "db", "entityId", "update", "name", "ref", "Schema", "McpServer", "McpServerSpec", "DXN", "Annotation", "Type", "LabelAnnotation", "Struct", "fields", "enabled", "optional", "Boolean", "pipe", "set", "IconAnnotation", "icon", "hue", "makeObject", "make"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Chat.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN, Annotation, Feed, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';\n\n/**\n * AI chat.\n */\nexport const Chat = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n feed: Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false)),\n view: Schema.String.pipe(Schema.optional),\n}).pipe(\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--sparkle--regular', hue: 'sky' }),\n Type.makeObject(DXN.make('org.dxos.type.assistant.chat', '0.1.0')),\n);\n\nexport type Chat = Type.InstanceType<typeof Chat>;\nexport const make = (props: Obj.MakeProps<typeof Chat>) => Obj.make(Chat, props);\n\n/** @deprecated Use CompanionTo instead. */\nexport const LegacyCompanionTo = Schema.Struct({\n id: Obj.ID,\n}).pipe(\n Type.makeRelation({\n dxn: DXN.make('org.dxos.relation.assistant.companionTo', '0.1.0'),\n source: Chat,\n target: Obj.Unknown,\n }),\n);\n\nexport type LegacyCompanionTo = Type.InstanceType<typeof LegacyCompanionTo>;\n/**\n * Relation between a Chat and companion objects (e.g., artifacts).\n */\nexport const CompanionTo = Schema.Struct({\n id: Obj.ID,\n}).pipe(\n Type.makeRelation({\n dxn: DXN.make('org.dxos.relation.assistant.companionTo', '0.1.0'),\n source: Chat,\n target: Obj.Unknown,\n }),\n);\n\nexport type CompanionTo = Type.InstanceType<typeof CompanionTo>;\n"],
5
- "mappings": ";;;;;AAAA;;;;;;;AAMA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAYC,MAAMC,KAAKC,KAAKC,YAAY;AACtD,SAASC,qBAAqBC,uBAAuB;AAK9C,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,MAAMV,IAAIA,IAAIF,KAAKA,IAAI,EAAEU,KAAKN,oBAAoBS,IAAI,KAAA,CAAA;EACtDC,MAAaL,cAAOC,KAAYC,eAAQ;AAC1C,CAAA,EAAGD,KACDL,gBAAgBQ,IAAI;EAAC;CAAO,GAC5Bd,WAAWgB,eAAeF,IAAI;EAAEG,MAAM;EAAwBC,KAAK;AAAM,CAAA,GACzEd,KAAKe,WAAWpB,IAAIqB,KAAK,gCAAgC,OAAA,CAAA,CAAA;AAIpD,IAAMA,OAAO,CAACC,UAAsCnB,IAAIkB,KAAKb,MAAMc,KAAAA;AAGnE,IAAMC,oBAA2Bd,cAAO;EAC7Ce,IAAIrB,IAAIsB;AACV,CAAA,EAAGb,KACDP,KAAKqB,aAAa;EAChBC,KAAK3B,IAAIqB,KAAK,2CAA2C,OAAA;EACzDO,QAAQpB;EACRqB,QAAQ1B,IAAI2B;AACd,CAAA,CAAA;AAOK,IAAMC,cAAqBtB,cAAO;EACvCe,IAAIrB,IAAIsB;AACV,CAAA,EAAGb,KACDP,KAAKqB,aAAa;EAChBC,KAAK3B,IAAIqB,KAAK,2CAA2C,OAAA;EACzDO,QAAQpB;EACRqB,QAAQ1B,IAAI2B;AACd,CAAA,CAAA;",
6
- "names": ["Schema", "DXN", "Annotation", "Feed", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "Chat", "Struct", "name", "String", "pipe", "optional", "feed", "set", "view", "IconAnnotation", "icon", "hue", "makeObject", "make", "props", "LegacyCompanionTo", "id", "ID", "makeRelation", "dxn", "source", "target", "Unknown", "CompanionTo"]
7
- }
@@ -1 +0,0 @@
1
- {"conversations":[{"parameters":{"model":"ai.claude.model.claude-opus-4-6","stream":true,"tools":[{"name":"query-blueprints","description":"Queries available blueprints.","inputSchema":{"$id":"/schemas/%7B%7D","anyOf":[{"type":"object"},{"type":"array"}]}},{"name":"enable-blueprints","description":"Enables blueprints in the current conversation by their keys. Only blueprints with agentCanEnable=true can be enabled. Always call [query-blueprints] first to discover available blueprint keys.","inputSchema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"string"},"description":"The keys of the blueprints to enable.","examples":[["org.dxos.blueprint.memory","org.dxos.blueprint.database"]]}},"additionalProperties":false}},{"name":"refresh-blueprints","description":"Updates the blueprints saved to the database with the latest version from the registry. Sometimes blueprints in the database can become outdated. Use this function to pull in the latest versions.","inputSchema":{"$id":"/schemas/%7B%7D","anyOf":[{"type":"object"},{"type":"array"}]}}]},"prompt":{"content":[{"role":"system","content":"You can call blueprint manager tools. When asked to refresh or sync blueprints from the registry,\ncall the refresh blueprints tool once and then stop.\n\n## Blueprints Definitions\n\n<blueprint>\n You can query available blueprints and enable them in the current conversation.\n Use [query-blueprints] to refresh the list of available blueprints.\n Use [refresh-blueprints] to update blueprint objects stored in the database from the built-in registry when they have drifted.\n Use [enable-blueprints] to enable blueprints by their keys. Always call [query-blueprints] first.\n Only blueprints with agentCanEnable=true can be enabled by the agent.\n \n <available_blueprints>\n - \"Database\" -- Query and manipulate objects in the ECHO database. [agent-can-enable]\n - \"Discord\" -- Discord integration.\n - \"Memory\" -- Persistent memory storage and retrieval. [agent-can-enable]\n </available_blueprints>\n \n NOTE: You must enable the blueprint to use it, only then the tools from that blueprint will appear.\n</blueprint>","options":{}},{"role":"user","content":"Refresh blueprints from the registry so database copies match the built-in definitions.","options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_01EnWRrZtYvker1hoFaUftiX","modelId":"claude-opus-4-6","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"reasoning-start","id":"0","metadata":{}},{"type":"reasoning-delta","id":"0","delta":"The user wants to refresh blueprints from the registry. I should call the refresh-blueprints tool.","metadata":{}},{"type":"reasoning-delta","id":"0","delta":"","metadata":{"anthropic":{"type":"thinking","signature":"EqgCCmMIDhgCKkBdz2UkSiBc+mB42bn4XBMulDdlfY744r6A3/CtRIj5ka8kLuAbmGbpsDHh15YA4AXwrTKjmGFVws1/iQVVcX0NMg9jbGF1ZGUtb3B1cy00LTY4AEIIdGhpbmtpbmcSDC1IWXx2nxKJlumiFBoMODifRWw+vJr3M9oxIjCNeGHzgul3HZTZVS1Y1fq36Z6+uk9jVJtfR1kiZDmfUabkraoD+PzSoABC7+HQSl4qc4hegrTArcyY5OVZiDXjw5cbBhF72gChkZu+A5b/wqIxjxdVTqj5Mk3W9dVK7gF5K9ATIOu8KeHLwz9wFEZgmK9vBQhhWrX+X0SaZ7Tds2fllZyPf+1u7EbqQUDP0fp8mjeXRSKJLeTBGTw/d5Ul0Y3/DIgYAQ=="}}},{"type":"reasoning-end","id":"0","metadata":{}},{"type":"text-start","id":"1","metadata":{}},{"type":"text-delta","id":"1","delta":"I","metadata":{}},{"type":"text-delta","id":"1","delta":"'ll refresh the blueprints from the registry now.","metadata":{}},{"type":"text-end","id":"1","metadata":{}},{"type":"tool-params-start","id":"toolu_0191HNbgqXmmaNXfW6keirtd","name":"refresh-blueprints","providerExecuted":false,"metadata":{}},{"type":"tool-params-delta","id":"toolu_0191HNbgqXmmaNXfW6keirtd","delta":"","metadata":{}},{"type":"tool-params-end","id":"toolu_0191HNbgqXmmaNXfW6keirtd","metadata":{}},{"type":"finish","reason":"tool-calls","usage":{"inputTokens":1086,"outputTokens":90,"totalTokens":1176},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":1086,"output_tokens":40,"server_tool_use":null,"service_tier":"standard"}}}}]},{"parameters":{"model":"ai.claude.model.claude-opus-4-6","stream":true,"tools":[{"name":"query-blueprints","description":"Queries available blueprints.","inputSchema":{"$id":"/schemas/%7B%7D","anyOf":[{"type":"object"},{"type":"array"}]}},{"name":"enable-blueprints","description":"Enables blueprints in the current conversation by their keys. Only blueprints with agentCanEnable=true can be enabled. Always call [query-blueprints] first to discover available blueprint keys.","inputSchema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"string"},"description":"The keys of the blueprints to enable.","examples":[["org.dxos.blueprint.memory","org.dxos.blueprint.database"]]}},"additionalProperties":false}},{"name":"refresh-blueprints","description":"Updates the blueprints saved to the database with the latest version from the registry. Sometimes blueprints in the database can become outdated. Use this function to pull in the latest versions.","inputSchema":{"$id":"/schemas/%7B%7D","anyOf":[{"type":"object"},{"type":"array"}]}}]},"prompt":{"content":[{"role":"system","content":"You can call blueprint manager tools. When asked to refresh or sync blueprints from the registry,\ncall the refresh blueprints tool once and then stop.\n\n## Blueprints Definitions\n\n<blueprint>\n You can query available blueprints and enable them in the current conversation.\n Use [query-blueprints] to refresh the list of available blueprints.\n Use [refresh-blueprints] to update blueprint objects stored in the database from the built-in registry when they have drifted.\n Use [enable-blueprints] to enable blueprints by their keys. Always call [query-blueprints] first.\n Only blueprints with agentCanEnable=true can be enabled by the agent.\n \n <available_blueprints>\n - \"Database\" -- Query and manipulate objects in the ECHO database. [agent-can-enable]\n - \"Discord\" -- Discord integration.\n - \"Memory\" -- Persistent memory storage and retrieval. [agent-can-enable]\n </available_blueprints>\n \n NOTE: You must enable the blueprint to use it, only then the tools from that blueprint will appear.\n</blueprint>","options":{}},{"role":"user","content":"Refresh blueprints from the registry so database copies match the built-in definitions.","options":{}},{"role":"assistant","content":[{"type":"reasoning","text":"The user wants to refresh blueprints from the registry. I should call the refresh-blueprints tool.","options":{}},{"type":"text","text":"I'll refresh the blueprints from the registry now.","options":{}},{"type":"tool-call","id":"toolu_0191HNbgqXmmaNXfW6keirtd","name":"refresh-blueprints","params":{},"providerExecuted":false,"options":{}}],"options":{}},{"role":"tool","content":[{"type":"tool-result","id":"toolu_0191HNbgqXmmaNXfW6keirtd","name":"refresh-blueprints","isFailure":false,"result":{},"providerExecuted":false,"options":{}}],"options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_01UYmSHxnE5L1YWqDDnmQtpE","modelId":"claude-opus-4-6","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"text-start","id":"0","metadata":{}},{"type":"text-delta","id":"0","delta":"The blueprints stored","metadata":{}},{"type":"text-delta","id":"0","delta":" in the database have been updated to match the latest built-in definitions from the registry. Everything should","metadata":{}},{"type":"text-delta","id":"0","delta":" now be in sync.","metadata":{}},{"type":"text-end","id":"0","metadata":{}},{"type":"finish","reason":"stop","usage":{"inputTokens":1149,"outputTokens":33,"totalTokens":1182},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":1149,"output_tokens":5,"server_tool_use":null,"service_tier":"standard"}}}}]}]}