@xopcai/xopc 0.0.150 → 0.0.151

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 (145) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-B3YP7y9d.js → activity-store-uu1xu9Pl.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BaP05tRU.js → agent-avatar-dicebear-BuO-OVfD.js} +1 -1
  5. package/dist/gateway/static/root/assets/agents-Bpv3h31T.js +2 -0
  6. package/dist/gateway/static/root/assets/{api-BirUfJgj.js → api-CwL38LEV.js} +1 -1
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-D5Cg_a6I.js → app-management-settings-panel-B6OU3Eol.js} +1 -1
  8. package/dist/gateway/static/root/assets/appearance-settings-BaP4GFvN.js +1 -0
  9. package/dist/gateway/static/root/assets/apps-page-DZKNIMRg.js +1 -0
  10. package/dist/gateway/static/root/assets/{archive-plugin-D3OmrvFx.js → archive-plugin-CJX3zIh_.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-Cgkm_5mb.js → attachment-load-CI1ejk_l.js} +1 -1
  12. package/dist/gateway/static/root/assets/{automation-suggestion-card-CHvxSz-t.js → automation-suggestion-card-CjmhICbv.js} +1 -1
  13. package/dist/gateway/static/root/assets/automations-page-BtZl3B8m.js +6 -0
  14. package/dist/gateway/static/root/assets/{binary-plugins-dJR5UuzL.js → binary-plugins-CZ8nOXqK.js} +1 -1
  15. package/dist/gateway/static/root/assets/{block-editor-v4_7o92L.js → block-editor-BoSfyS_j.js} +46 -46
  16. package/dist/gateway/static/root/assets/browser-settings-page-CL1UiPcb.js +8 -0
  17. package/dist/gateway/static/root/assets/{capability-presets-api-BcTjPLiD.js → capability-presets-api-XzDKxPZ8.js} +1 -1
  18. package/dist/gateway/static/root/assets/{capability-presets-settings-panel-CddBf58y.js → capability-presets-settings-panel-Dc_uHYgl.js} +2 -2
  19. package/dist/gateway/static/root/assets/{channel-recipient-api-BbDlMRm5.js → channel-recipient-api-DYLBAhFF.js} +1 -1
  20. package/dist/gateway/static/root/assets/channels-settings-mALvXpJj.js +1 -0
  21. package/dist/gateway/static/root/assets/channels-status-swr-CZuEsO5b.js +1 -0
  22. package/dist/gateway/static/root/assets/{connector-logo-BNthqff-.js → connector-logo-BSjlInHT.js} +1 -1
  23. package/dist/gateway/static/root/assets/connectors-page-Cm_E3mmI.js +2 -0
  24. package/dist/gateway/static/root/assets/desktop-pet-DcJc91-C.js +1 -0
  25. package/dist/gateway/static/root/assets/desktop-pet-settings-CdeqTa3Q.js +1 -0
  26. package/dist/gateway/static/root/assets/{directory-picker-path-field-BdWd7m-p.js → directory-picker-path-field-Cp3fpm0k.js} +1 -1
  27. package/dist/gateway/static/root/assets/{dreaming-settings-CXDhu3Me.js → dreaming-settings-Bwj1O3zr.js} +3 -3
  28. package/dist/gateway/static/root/assets/{extension-debug-page-CLJTGozU.js → extension-debug-page-D_1xpKbZ.js} +1 -1
  29. package/dist/gateway/static/root/assets/{extension-page-ClxpGfzA.js → extension-page-CqZNCj96.js} +1 -1
  30. package/dist/gateway/static/root/assets/{extension-settings-page-CDA3ZJ8k.js → extension-settings-page-5MWbtQaQ.js} +1 -1
  31. package/dist/gateway/static/root/assets/{gateway-config-api-DpXL78pS.js → gateway-config-api-Co_IaS34.js} +1 -1
  32. package/dist/gateway/static/root/assets/gateway-settings-kmeWm2Pt.js +1 -0
  33. package/dist/gateway/static/root/assets/{gateway-startup-retry-D0SU7dte.js → gateway-startup-retry-BM_xvzl0.js} +1 -1
  34. package/dist/gateway/static/root/assets/goal-create-dialog-FoO-R4_U.js +1 -0
  35. package/dist/gateway/static/root/assets/goal-detail-page-CkJq7N5g.js +4 -0
  36. package/dist/gateway/static/root/assets/{goals-config-api-r71aDqix.js → goals-config-api-DrtsYjXz.js} +1 -1
  37. package/dist/gateway/static/root/assets/goals-page-DRAN-R64.js +2 -0
  38. package/dist/gateway/static/root/assets/{goals-settings-CZOLhkTH.js → goals-settings-wq9TKhIZ.js} +1 -1
  39. package/dist/gateway/static/root/assets/{heartbeat-settings-F9S1gIFo.js → heartbeat-settings-B5zDoHbo.js} +1 -1
  40. package/dist/gateway/static/root/assets/index-DIlxvrlG.css +1 -0
  41. package/dist/gateway/static/root/assets/index-apLU0Hun.js +196 -0
  42. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-3tC9iD21.js +1 -0
  43. package/dist/gateway/static/root/assets/local-app-workbench-page-CT-vDTLK.js +2 -0
  44. package/dist/gateway/static/root/assets/{local-apps-page-n7YJfRkU.js → local-apps-page-B9ruF9GV.js} +1 -1
  45. package/dist/gateway/static/root/assets/locale-store-GfSwnwIZ.js +1 -0
  46. package/dist/gateway/static/root/assets/logs-page-Ca1X8X2P.js +7 -0
  47. package/dist/gateway/static/root/assets/{markdown-split-1mnXr-JA.js → markdown-split-CzuhSQAB.js} +1 -1
  48. package/dist/gateway/static/root/assets/{media-plugins-D2bcxXrT.js → media-plugins-a3R4y-EL.js} +1 -1
  49. package/dist/gateway/static/root/assets/{messages-BH7paqYt.js → messages-B0B40tpO.js} +2 -2
  50. package/dist/gateway/static/root/assets/models-hub-panel-CbTlz9Of.js +2 -0
  51. package/dist/gateway/static/root/assets/{notes-page-Wjc2utlj.js → notes-page-BCxDy2dV.js} +1 -1
  52. package/dist/gateway/static/root/assets/notes-workbench-z6sBX9B2.js +4 -0
  53. package/dist/gateway/static/root/assets/{page-tabs-vdljrKuG.js → page-tabs-CJfk6M78.js} +1 -1
  54. package/dist/gateway/static/root/assets/{preview-open-alternatives-BHki0l-E.js → preview-open-alternatives-MFopTSgF.js} +1 -1
  55. package/dist/gateway/static/root/assets/project-detail-page-DU29deIr.js +1 -0
  56. package/dist/gateway/static/root/assets/projects-page-Ck3DLTlZ.js +1 -0
  57. package/dist/gateway/static/root/assets/remote-access-hub-gLsLyAyi.js +1 -0
  58. package/dist/gateway/static/root/assets/{save-bar-controls-Vy4EmvEh.js → save-bar-controls-D0uhU3Z8.js} +1 -1
  59. package/dist/gateway/static/root/assets/{schedule-field-CVcwC7k_.js → schedule-field-NGOH-7wV.js} +1 -1
  60. package/dist/gateway/static/root/assets/{schema-form-DhMA1vkR.js → schema-form-BJz5LoqG.js} +1 -1
  61. package/dist/gateway/static/root/assets/schemas-DgQq6Z5S.js +64 -0
  62. package/dist/gateway/static/root/assets/sessions-page-TmNoWpa_.js +1 -0
  63. package/dist/gateway/static/root/assets/settings-advanced-gate-CtPhh2m9.js +1 -0
  64. package/dist/gateway/static/root/assets/{settings-collapsible-section-C0xcL0vB.js → settings-collapsible-section-oDnUHnX_.js} +1 -1
  65. package/dist/gateway/static/root/assets/{settings-form-section-Cgj4iVpx.js → settings-form-section-DND90dDt.js} +1 -1
  66. package/dist/gateway/static/root/assets/settings-loading-skeleton-CEJtaoQp.js +1 -0
  67. package/dist/gateway/static/root/assets/{settings-page-B7_JZ2rM.js → settings-page-B1LJlRi9.js} +1 -1
  68. package/dist/gateway/static/root/assets/{settings-page-layout-CKuQT4SG.js → settings-page-layout-CsrLuDsW.js} +1 -1
  69. package/dist/gateway/static/root/assets/setup-status-panel-BPCJPHHY.js +1 -0
  70. package/dist/gateway/static/root/assets/{share-preview-page-BmVw-6SJ.js → share-preview-page-C1PwLh-p.js} +1 -1
  71. package/dist/gateway/static/root/assets/shares-settings-DCuqr7js.js +1 -0
  72. package/dist/gateway/static/root/assets/skill-reload-api-kn1Vypcy.js +1 -0
  73. package/dist/gateway/static/root/assets/skills-page-k6VIqTkK.js +2 -0
  74. package/dist/gateway/static/root/assets/{system-settings-panel-D6d8VAk8.js → system-settings-panel-BEsrEkSx.js} +1 -1
  75. package/dist/gateway/static/root/assets/{theme-store-EbMQ3TYi.js → theme-store-Bi6hMBDb.js} +1 -1
  76. package/dist/gateway/static/root/assets/{typed-models-lib-D63hJX-S.js → typed-models-lib-dOypdlMf.js} +1 -1
  77. package/dist/gateway/static/root/assets/{use-channel-catalog-D-I-qki9.js → use-channel-catalog-f8A-PVuq.js} +1 -1
  78. package/dist/gateway/static/root/assets/user-context-page-B9Y_Ciav.js +1 -0
  79. package/dist/gateway/static/root/assets/{user-profile-fields-editor-CPaoS8Zl.js → user-profile-fields-editor-DGC38Lx7.js} +1 -1
  80. package/dist/gateway/static/root/assets/{user-profile-settings-panel-Bs13qcx1.js → user-profile-settings-panel-DFkZ-tan.js} +1 -1
  81. package/dist/gateway/static/root/assets/{utils-3mnkFvPw.js → utils-CEIYZihF.js} +1 -1
  82. package/dist/gateway/static/root/assets/voice-api-key-field-DK6gaQsA.js +1 -0
  83. package/dist/gateway/static/root/assets/work-discovery-page-DSJb9Kq7.js +1 -0
  84. package/dist/gateway/static/root/assets/work-item-detail-page-DVavwV3D.js +1 -0
  85. package/dist/gateway/static/root/assets/work-page-foJDp0nz.js +1 -0
  86. package/dist/gateway/static/root/assets/workflow-run-setup-panel-BYqZpFCC.js +3 -0
  87. package/dist/gateway/static/root/assets/workflows-page-DgO0WAzs.js +11 -0
  88. package/dist/gateway/static/root/index.html +8 -7
  89. package/dist/package.js +1 -1
  90. package/dist/src/agent/agent-manager.d.ts +1 -0
  91. package/dist/src/agent/agent-manager.js +1 -0
  92. package/dist/src/agent/service.js +1 -0
  93. package/dist/src/agent/service.types.d.ts +2 -0
  94. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  95. package/dist/src/agent/tool-manuals/xopc-use.js +41 -2
  96. package/dist/src/agent/tools/automation-tool.js +45 -6
  97. package/dist/src/agent/tools/factory.d.ts +2 -0
  98. package/dist/src/agent/tools/factory.js +3 -2
  99. package/dist/src/agent/tools/goal-tool.d.ts +7 -1
  100. package/dist/src/agent/tools/goal-tool.js +34 -5
  101. package/dist/src/agent/tools/workflow-tool.js +32 -2
  102. package/dist/src/agent/tools/write.js +23 -3
  103. package/dist/src/agent/tools/xopc-use-tool.d.ts +6 -2
  104. package/dist/src/agent/tools/xopc-use-tool.js +216 -6
  105. package/dist/src/gateway/service.js +1 -0
  106. package/package.json +3 -2
  107. package/dist/gateway/static/root/assets/agents-QArUBYV7.js +0 -2
  108. package/dist/gateway/static/root/assets/appearance-settings-BBsAkJ56.js +0 -1
  109. package/dist/gateway/static/root/assets/apps-page-D1uAUndU.js +0 -1
  110. package/dist/gateway/static/root/assets/automations-page-BWQk03Vu.js +0 -6
  111. package/dist/gateway/static/root/assets/browser-settings-page-SruFGuBP.js +0 -8
  112. package/dist/gateway/static/root/assets/channels-settings-WI5tQ5tn.js +0 -1
  113. package/dist/gateway/static/root/assets/channels-status-swr-Dt2EROlf.js +0 -1
  114. package/dist/gateway/static/root/assets/connectors-page-DavHJ6rR.js +0 -2
  115. package/dist/gateway/static/root/assets/desktop-pet-CVajXkdj.js +0 -1
  116. package/dist/gateway/static/root/assets/desktop-pet-settings-SHI66eIi.js +0 -1
  117. package/dist/gateway/static/root/assets/gateway-settings-Co-mXFP_.js +0 -1
  118. package/dist/gateway/static/root/assets/goal-create-dialog-BO6G--Ec.js +0 -1
  119. package/dist/gateway/static/root/assets/goal-detail-page-DK8eog4h.js +0 -4
  120. package/dist/gateway/static/root/assets/goals-page-AcROW97U.js +0 -2
  121. package/dist/gateway/static/root/assets/index-C46C7Xee.css +0 -1
  122. package/dist/gateway/static/root/assets/index-IPmCli0N.js +0 -259
  123. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-B3CUVfZ8.js +0 -1
  124. package/dist/gateway/static/root/assets/local-app-workbench-page-HVq6NUvQ.js +0 -2
  125. package/dist/gateway/static/root/assets/locale-store-BvcHGPHU.js +0 -1
  126. package/dist/gateway/static/root/assets/logs-page-Dgko6r04.js +0 -7
  127. package/dist/gateway/static/root/assets/models-hub-panel-DD0cEfmR.js +0 -2
  128. package/dist/gateway/static/root/assets/notes-workbench-BkA2yg9K.js +0 -4
  129. package/dist/gateway/static/root/assets/project-detail-page-CXwVNLgg.js +0 -1
  130. package/dist/gateway/static/root/assets/projects-page-DlfvNcLh.js +0 -1
  131. package/dist/gateway/static/root/assets/remote-access-hub-BQyEX2Ui.js +0 -1
  132. package/dist/gateway/static/root/assets/sessions-page-CqQEW8oT.js +0 -1
  133. package/dist/gateway/static/root/assets/settings-advanced-gate-M8fleFSc.js +0 -1
  134. package/dist/gateway/static/root/assets/settings-loading-skeleton-CC_NmD69.js +0 -1
  135. package/dist/gateway/static/root/assets/setup-status-panel-DvR8Y5YN.js +0 -1
  136. package/dist/gateway/static/root/assets/shares-settings-C0JYYhGx.js +0 -1
  137. package/dist/gateway/static/root/assets/skill-reload-api-DBFBczqN.js +0 -1
  138. package/dist/gateway/static/root/assets/skills-page-KAI9qBDD.js +0 -2
  139. package/dist/gateway/static/root/assets/user-context-page-Cuft-EbR.js +0 -1
  140. package/dist/gateway/static/root/assets/voice-api-key-field-C716UEi9.js +0 -1
  141. package/dist/gateway/static/root/assets/work-discovery-page-CFSkHa0v.js +0 -1
  142. package/dist/gateway/static/root/assets/work-item-detail-page-DaapBdoZ.js +0 -1
  143. package/dist/gateway/static/root/assets/work-page-DMtX92vs.js +0 -1
  144. package/dist/gateway/static/root/assets/workflow-run-setup-panel-B9FnZNWZ.js +0 -3
  145. package/dist/gateway/static/root/assets/workflows-page-BgvE0_Iv.js +0 -11
@@ -11,7 +11,7 @@
11
11
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
12
12
  <link rel="manifest" href="/site.webmanifest?v=20260713-1" />
13
13
  <title>xopc</title>
14
- <script type="module" crossorigin src="/assets/index-IPmCli0N.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-apLU0Hun.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
@@ -24,14 +24,15 @@
24
24
  <link rel="modulepreload" crossorigin href="/assets/check-BODqo66o.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/circle-alert-RzVebuX2.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
27
- <link rel="modulepreload" crossorigin href="/assets/messages-BH7paqYt.js">
28
- <link rel="modulepreload" crossorigin href="/assets/locale-store-BvcHGPHU.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/messages-B0B40tpO.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/locale-store-GfSwnwIZ.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/schemas-DgQq6Z5S.js">
29
30
  <link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
30
31
  <link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
31
- <link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-D0SU7dte.js">
32
- <link rel="modulepreload" crossorigin href="/assets/activity-store-B3YP7y9d.js">
33
- <link rel="modulepreload" crossorigin href="/assets/theme-store-EbMQ3TYi.js">
34
- <link rel="stylesheet" crossorigin href="/assets/index-C46C7Xee.css">
32
+ <link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-BM_xvzl0.js">
33
+ <link rel="modulepreload" crossorigin href="/assets/activity-store-uu1xu9Pl.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/theme-store-Bi6hMBDb.js">
35
+ <link rel="stylesheet" crossorigin href="/assets/index-DIlxvrlG.css">
35
36
  </head>
36
37
  <body>
37
38
  <div id="root"></div>
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.0.150";
2
+ var version = "0.0.151";
3
3
  //#endregion
4
4
  export { version };
@@ -88,6 +88,7 @@ export interface AgentManagerConfig {
88
88
  getNotesService?: () => NotesService | undefined;
89
89
  getProjectService?: () => ProjectService | undefined;
90
90
  getWorkItemService?: () => WorkItemService | undefined;
91
+ getLocalAppService?: () => import('../local-apps/index.js').LocalAppService | undefined;
91
92
  /** Gateway: starts persisted workflow runs (dedicated chat session per run). */
92
93
  getWorkflowRunService?: () => import('../workflows/service/workflow-run-service.types.js').WorkflowRunServiceLike | undefined;
93
94
  /** Runtime notification for UI/CLI shells that cache skill catalogs. */
@@ -233,6 +233,7 @@ var AgentManager = class {
233
233
  getNotesService: this.config.getNotesService,
234
234
  getProjectService: this.config.getProjectService,
235
235
  getWorkItemService: this.config.getWorkItemService,
236
+ getLocalAppService: this.config.getLocalAppService,
236
237
  getWorkflowRunService: this.config.getWorkflowRunService,
237
238
  getSkillIndexingContext: () => {
238
239
  const ctx = this.config.getCurrentContext?.();
@@ -231,6 +231,7 @@ var AgentService = class {
231
231
  getNotesService: config.getNotesService,
232
232
  getProjectService: config.getProjectService,
233
233
  getWorkItemService: config.getWorkItemService,
234
+ getLocalAppService: config.getLocalAppService,
234
235
  getWorkflowRunService: config.getWorkflowRunService,
235
236
  onSkillsUpdated: config.onSkillsUpdated,
236
237
  installSkillFromSource: (opts) => this.installSkillFromSource(opts),
@@ -6,6 +6,7 @@ import type { ExtensionRegistryImpl as ExtensionRegistry } from '../extensions/i
6
6
  import type { NotesService } from '../notes/index.js';
7
7
  import type { ProjectService } from '../projects/index.js';
8
8
  import type { WorkItemService } from '../work-items/index.js';
9
+ import type { LocalAppService } from '../local-apps/index.js';
9
10
  import type { GatewayClarifyRequestFn } from './tools/clarify-tool.js';
10
11
  import type { ProgressStage } from './lifecycle/progress.js';
11
12
  import type { AgentSourceContextResolver } from './source-context/types.js';
@@ -31,6 +32,7 @@ export interface AgentServiceConfig {
31
32
  getNotesService?: () => NotesService | undefined;
32
33
  getProjectService?: () => ProjectService | undefined;
33
34
  getWorkItemService?: () => WorkItemService | undefined;
35
+ getLocalAppService?: () => LocalAppService | undefined;
34
36
  /**
35
37
  * Gateway: reuse the gateway `SessionManager` store so web API and agent share one index + files.
36
38
  * When omitted, `AgentService` creates its own `SessionStore` (CLI / embedded).
@@ -1 +1 @@
1
- export declare const xopcUseManual = "# XOPC Use Tool Manual\n\n## Overview\n\n`xopc_use` is the unified tool for operating XOPC product objects. Use it instead of editing storage files or database rows directly.\n\nBasic shape:\n\n```json\n{\n \"mode\": \"project | note | work_item\",\n \"command\": \"list | get | create | update | append | preview_edit | resolve_workspace\",\n \"args\": { \"...\": \"...\" },\n \"dryRun\": false\n}\n```\n\n## General Rules\n\n- Use `list` or `get` first when the target object is ambiguous.\n- Use `dryRun: true` before a broad or risky change.\n- Prefer additive operations over destructive replacement.\n- Do not invent ids. If an id is not known, search/list first.\n- Do not attempt delete/archive workflows through this tool unless the command is explicitly supported.\n- For non-trivial note rewrites, use `note.preview_edit` before `note.update`.\n\n## Projects\n\nProjects group sessions, work items, goals, workflows, files, and project instructions.\n\n### Find projects\n\n```json\n{ \"mode\": \"project\", \"command\": \"list\", \"args\": { \"search\": \"release\", \"limit\": 10 } }\n```\n\n### Read project detail\n\n```json\n{ \"mode\": \"project\", \"command\": \"get\", \"args\": { \"projectId\": \"project_id\" } }\n```\n\n### Create a project\n\nUse when the user asks to keep an outcome moving across conversations, or explicitly accepts an offer to do so. The user does not need to say \u201Cproject\u201D. Do not create one merely because a task is complex: continuity across sessions, files, decisions, or dependencies is the key signal. Include `workspaceRoot` when the work maps to a local repository or directory. Include `brief` for the desired outcome and `instructions` only for durable operating guidance.\n\n```json\n{\n \"mode\": \"project\",\n \"command\": \"create\",\n \"args\": {\n \"name\": \"AI Product Research\",\n \"workspaceRoot\": \"/path/to/repo\",\n \"brief\": \"Explore demand and feasibility for an AI product.\",\n \"instructions\": \"Keep decisions and open questions current.\"\n }\n}\n```\n\n### Update a project\n\nUse for metadata, brief, status, or instructions. Use `dryRun` first when changing `workspaceRoot` or broad instructions.\n\n```json\n{\n \"mode\": \"project\",\n \"command\": \"update\",\n \"args\": {\n \"projectId\": \"project_id\",\n \"status\": \"active\",\n \"instructions\": \"Prioritize safe previews before changing notes.\"\n }\n}\n```\n\n### Resolve workspace\n\nUse when a file path or current working directory should be mapped to a project.\n\n```json\n{\n \"mode\": \"project\",\n \"command\": \"resolve_workspace\",\n \"args\": { \"workspacePath\": \"/path/to/repo\", \"autoCreate\": false }\n}\n```\n\n## Notes\n\nNotes are user-owned markdown objects. Treat them as durable user content.\n\n### Find notes\n\n```json\n{ \"mode\": \"note\", \"command\": \"list\", \"args\": { \"search\": \"pricing\", \"limit\": 10 } }\n```\n\n### Create a note\n\n```json\n{\n \"mode\": \"note\",\n \"command\": \"create\",\n \"args\": {\n \"title\": \"Product direction\",\n \"markdown\": \"Initial notes...\",\n \"tags\": [\"product\"]\n }\n}\n```\n\n### Append to a note\n\nPrefer append when preserving original user notes and adding AI output.\n\n```json\n{\n \"mode\": \"note\",\n \"command\": \"append\",\n \"args\": {\n \"noteId\": \"note_id\",\n \"heading\": \"AI synthesis\",\n \"content\": \"Key points...\"\n }\n}\n```\n\n### Preview an edit\n\nUse before rewriting or restructuring a note.\n\n```json\n{\n \"mode\": \"note\",\n \"command\": \"preview_edit\",\n \"args\": {\n \"noteId\": \"note_id\",\n \"instruction\": \"Summarize this as action items\"\n }\n}\n```\n\n### Update a note\n\nUse only when the user clearly wants the canonical note changed. Prefer `append` or `preview_edit` otherwise.\n\n```json\n{\n \"mode\": \"note\",\n \"command\": \"update\",\n \"args\": {\n \"noteId\": \"note_id\",\n \"status\": \"processed\",\n \"tags\": [\"product\", \"validated\"]\n }\n}\n```\n\n## Work Items\n\nWork items are project-scoped tasks. If `projectId` is omitted, the tool may inherit the current session's project binding.\n\n### Create a work item\n\n```json\n{\n \"mode\": \"work_item\",\n \"command\": \"create\",\n \"args\": {\n \"projectId\": \"project_id\",\n \"title\": \"Validate technical feasibility\",\n \"description\": \"Check API, storage, UI, and safety implications.\",\n \"priority\": \"high\",\n \"status\": \"todo\"\n }\n}\n```\n\n### Update a work item\n\n```json\n{\n \"mode\": \"work_item\",\n \"command\": \"update\",\n \"args\": {\n \"workItemId\": \"work_item_id\",\n \"status\": \"in_progress\",\n \"nextAction\": \"Prototype the xopc_use tool path.\"\n }\n}\n```\n\n## Safety\n\n- `note.update` can replace canonical user content. Use `preview_edit` first for content rewrites.\n- `project.update.workspaceRoot` changes project-file scope. Use `dryRun` and ask the user if intent is unclear.\n- `work_item.update.archivedAt` hides work from normal active views. Confirm before archiving.\n- If the user asks for deletion, explain that deletion is not exposed through `xopc_use` yet.\n";
1
+ export declare const xopcUseManual = "# XOPC Use Tool Manual\n\n## Overview\n\n`xopc_use` is the unified tool for operating XOPC product objects. Use it instead of editing storage files or database rows directly.\n\nBasic shape:\n\n```json\n{\n \"mode\": \"project | note | work_item | local_app | settings\",\n \"command\": \"list | get | create | update | append | preview_edit | resolve_workspace | validate | open\",\n \"args\": { \"...\": \"...\" },\n \"dryRun\": false\n}\n```\n\n## General Rules\n\n- Use `list` or `get` first when the target object is ambiguous.\n- Use `dryRun: true` before a broad or risky change.\n- Prefer additive operations over destructive replacement.\n- Do not invent ids. If an id is not known, search/list first.\n- Do not attempt delete/archive workflows through this tool unless the command is explicitly supported.\n- For non-trivial note rewrites, use `note.preview_edit` before `note.update`.\n- Preserve the returned \u201COpen in xopc\u201D link in channel replies so the user can jump directly into the delivered object.\n\n## Projects\n\nProjects group sessions, work items, goals, workflows, files, and project instructions.\n\n### Find projects\n\n```json\n{ \"mode\": \"project\", \"command\": \"list\", \"args\": { \"search\": \"release\", \"limit\": 10 } }\n```\n\n### Read project detail\n\n```json\n{ \"mode\": \"project\", \"command\": \"get\", \"args\": { \"projectId\": \"project_id\" } }\n```\n\n### Create a project\n\nUse when the user asks to keep an outcome moving across conversations, or explicitly accepts an offer to do so. The user does not need to say \u201Cproject\u201D. Do not create one merely because a task is complex: continuity across sessions, files, decisions, or dependencies is the key signal. Include `workspaceRoot` when the work maps to a local repository or directory. Include `brief` for the desired outcome and `instructions` only for durable operating guidance.\n\n```json\n{\n \"mode\": \"project\",\n \"command\": \"create\",\n \"args\": {\n \"name\": \"AI Product Research\",\n \"workspaceRoot\": \"/path/to/repo\",\n \"brief\": \"Explore demand and feasibility for an AI product.\",\n \"instructions\": \"Keep decisions and open questions current.\"\n }\n}\n```\n\n### Update a project\n\nUse for metadata, brief, status, or instructions. Use `dryRun` first when changing `workspaceRoot` or broad instructions.\n\n```json\n{\n \"mode\": \"project\",\n \"command\": \"update\",\n \"args\": {\n \"projectId\": \"project_id\",\n \"status\": \"active\",\n \"instructions\": \"Prioritize safe previews before changing notes.\"\n }\n}\n```\n\n### Resolve workspace\n\nUse when a file path or current working directory should be mapped to a project.\n\n```json\n{\n \"mode\": \"project\",\n \"command\": \"resolve_workspace\",\n \"args\": { \"workspacePath\": \"/path/to/repo\", \"autoCreate\": false }\n}\n```\n\n## Notes\n\nNotes are user-owned markdown objects. Treat them as durable user content.\n\n### Find notes\n\n```json\n{ \"mode\": \"note\", \"command\": \"list\", \"args\": { \"search\": \"pricing\", \"limit\": 10 } }\n```\n\n### Create a note\n\n```json\n{\n \"mode\": \"note\",\n \"command\": \"create\",\n \"args\": {\n \"title\": \"Product direction\",\n \"markdown\": \"Initial notes...\",\n \"tags\": [\"product\"]\n }\n}\n```\n\n### Append to a note\n\nPrefer append when preserving original user notes and adding AI output.\n\n```json\n{\n \"mode\": \"note\",\n \"command\": \"append\",\n \"args\": {\n \"noteId\": \"note_id\",\n \"heading\": \"AI synthesis\",\n \"content\": \"Key points...\"\n }\n}\n```\n\n### Preview an edit\n\nUse before rewriting or restructuring a note.\n\n```json\n{\n \"mode\": \"note\",\n \"command\": \"preview_edit\",\n \"args\": {\n \"noteId\": \"note_id\",\n \"instruction\": \"Summarize this as action items\"\n }\n}\n```\n\n### Update a note\n\nUse only when the user clearly wants the canonical note changed. Prefer `append` or `preview_edit` otherwise.\n\n```json\n{\n \"mode\": \"note\",\n \"command\": \"update\",\n \"args\": {\n \"noteId\": \"note_id\",\n \"status\": \"processed\",\n \"tags\": [\"product\", \"validated\"]\n }\n}\n```\n\n## Work Items\n\nWork items are project-scoped tasks. If `projectId` is omitted, the tool may inherit the current session's project binding.\n\n### Create a work item\n\n```json\n{\n \"mode\": \"work_item\",\n \"command\": \"create\",\n \"args\": {\n \"projectId\": \"project_id\",\n \"title\": \"Validate technical feasibility\",\n \"description\": \"Check API, storage, UI, and safety implications.\",\n \"priority\": \"high\",\n \"status\": \"todo\"\n }\n}\n```\n\n### Update a work item\n\n```json\n{\n \"mode\": \"work_item\",\n \"command\": \"update\",\n \"args\": {\n \"workItemId\": \"work_item_id\",\n \"status\": \"in_progress\",\n \"nextAction\": \"Prototype the xopc_use tool path.\"\n }\n}\n```\n\n## Local Apps\n\nLocal apps are first-class XOPC extension UIs backed by a project workspace.\n\n```json\n{\n \"mode\": \"local_app\",\n \"command\": \"create\",\n \"args\": {\n \"name\": \"Research Hub\",\n \"idea\": \"Keep product research sources and decisions together.\",\n \"description\": \"A compact local research workspace.\"\n }\n}\n```\n\nUse `list`, `get`, and `validate` to inspect an existing app. Installation,\nactivation, rollback, and uninstall remain explicit product UI operations because\nthey change the extension runtime.\n\n## Settings\n\nUse settings references when the user must review credentials, privacy, gateway,\nappearance, agent browser, or another configuration surface. This does not change\nconfiguration silently; it returns an exact inline jump target.\n\n```json\n{\n \"mode\": \"settings\",\n \"command\": \"open\",\n \"args\": {\n \"section\": \"credentials\",\n \"title\": \"Provider credentials\",\n \"summary\": \"Add the API key required by the selected model.\"\n }\n}\n```\n\n## Safety\n\n- `note.update` can replace canonical user content. Use `preview_edit` first for content rewrites.\n- `project.update.workspaceRoot` changes project-file scope. Use `dryRun` and ask the user if intent is unclear.\n- `work_item.update.archivedAt` hides work from normal active views. Confirm before archiving.\n- If the user asks for deletion, explain that deletion is not exposed through `xopc_use` yet.\n";
@@ -9,8 +9,8 @@ Basic shape:
9
9
 
10
10
  \`\`\`json
11
11
  {
12
- "mode": "project | note | work_item",
13
- "command": "list | get | create | update | append | preview_edit | resolve_workspace",
12
+ "mode": "project | note | work_item | local_app | settings",
13
+ "command": "list | get | create | update | append | preview_edit | resolve_workspace | validate | open",
14
14
  "args": { "...": "..." },
15
15
  "dryRun": false
16
16
  }
@@ -24,6 +24,7 @@ Basic shape:
24
24
  - Do not invent ids. If an id is not known, search/list first.
25
25
  - Do not attempt delete/archive workflows through this tool unless the command is explicitly supported.
26
26
  - For non-trivial note rewrites, use \`note.preview_edit\` before \`note.update\`.
27
+ - Preserve the returned “Open in xopc” link in channel replies so the user can jump directly into the delivered object.
27
28
 
28
29
  ## Projects
29
30
 
@@ -191,6 +192,44 @@ Work items are project-scoped tasks. If \`projectId\` is omitted, the tool may i
191
192
  }
192
193
  \`\`\`
193
194
 
195
+ ## Local Apps
196
+
197
+ Local apps are first-class XOPC extension UIs backed by a project workspace.
198
+
199
+ \`\`\`json
200
+ {
201
+ "mode": "local_app",
202
+ "command": "create",
203
+ "args": {
204
+ "name": "Research Hub",
205
+ "idea": "Keep product research sources and decisions together.",
206
+ "description": "A compact local research workspace."
207
+ }
208
+ }
209
+ \`\`\`
210
+
211
+ Use \`list\`, \`get\`, and \`validate\` to inspect an existing app. Installation,
212
+ activation, rollback, and uninstall remain explicit product UI operations because
213
+ they change the extension runtime.
214
+
215
+ ## Settings
216
+
217
+ Use settings references when the user must review credentials, privacy, gateway,
218
+ appearance, agent browser, or another configuration surface. This does not change
219
+ configuration silently; it returns an exact inline jump target.
220
+
221
+ \`\`\`json
222
+ {
223
+ "mode": "settings",
224
+ "command": "open",
225
+ "args": {
226
+ "section": "credentials",
227
+ "title": "Provider credentials",
228
+ "summary": "Add the API key required by the selected model."
229
+ }
230
+ }
231
+ \`\`\`
232
+
194
233
  ## Safety
195
234
 
196
235
  - \`note.update\` can replace canonical user content. Use \`preview_edit\` first for content rewrites.
@@ -1,4 +1,5 @@
1
1
  import { Type } from "@sinclair/typebox";
2
+ import { appendProductDeliveryText } from "@xopcai/gateway-contract";
2
3
  //#region src/agent/tools/automation-tool.ts
3
4
  const AutomationToolSchema = Type.Object({
4
5
  action: Type.Union([
@@ -20,7 +21,7 @@ function textResult(text, details = {}) {
20
21
  return {
21
22
  content: [{
22
23
  type: "text",
23
- text
24
+ text: appendProductDeliveryText(text, details.delivery)
24
25
  }],
25
26
  details
26
27
  };
@@ -31,6 +32,28 @@ function formatAutomation(item) {
31
32
  const next = item.state.nextRunAtMs ? new Date(item.state.nextRunAtMs).toISOString() : "none";
32
33
  return `- ${item.id} · ${item.name} · ${status} · trigger=${trigger} · next=${next}`;
33
34
  }
35
+ function automationDelivery(automation, operation) {
36
+ return {
37
+ version: 1,
38
+ operation,
39
+ primary: {
40
+ kind: "automation",
41
+ id: automation.id,
42
+ title: automation.name,
43
+ summary: automation.description?.trim() || void 0,
44
+ status: automation.enabled ? "enabled" : "paused",
45
+ revision: String(automation.updatedAtMs),
46
+ projectId: automation.projectId ?? void 0,
47
+ capabilities: [
48
+ "open",
49
+ "edit",
50
+ "continue_in_chat",
51
+ "run",
52
+ automation.enabled ? "pause" : "resume"
53
+ ]
54
+ }
55
+ };
56
+ }
34
57
  function createAutomationTool(deps) {
35
58
  return {
36
59
  name: "automation",
@@ -48,7 +71,10 @@ function createAutomationTool(deps) {
48
71
  case "create": {
49
72
  if (!params.automation || typeof params.automation !== "object") return textResult("automation payload is required for create.", { ok: false });
50
73
  const automation = await service.create(params.automation);
51
- return textResult(`Created automation ${automation.id}: ${automation.name}`, { automation });
74
+ return textResult(`Created automation ${automation.id}: ${automation.name}`, {
75
+ automation,
76
+ delivery: automationDelivery(automation, "created")
77
+ });
52
78
  }
53
79
  case "update": {
54
80
  const id = params.automationId?.trim();
@@ -56,7 +82,10 @@ function createAutomationTool(deps) {
56
82
  if (!params.patch || typeof params.patch !== "object") return textResult("patch payload is required for update.", { ok: false });
57
83
  const automation = await service.update(id, params.patch);
58
84
  if (!automation) return textResult(`Automation not found: ${id}`, { ok: false });
59
- return textResult(`Updated automation ${automation.id}: ${automation.name}`, { automation });
85
+ return textResult(`Updated automation ${automation.id}: ${automation.name}`, {
86
+ automation,
87
+ delivery: automationDelivery(automation, "updated")
88
+ });
60
89
  }
61
90
  case "delete": {
62
91
  const id = params.automationId?.trim();
@@ -67,22 +96,32 @@ function createAutomationTool(deps) {
67
96
  case "run": {
68
97
  const id = params.automationId?.trim();
69
98
  if (!id) return textResult("automationId is required for run.", { ok: false });
99
+ const automation = (await service.list()).find((item) => item.id === id);
70
100
  const run = await service.runNow(id);
71
- return textResult(`Started automation run ${run.id}.`, { run });
101
+ return textResult(`Started automation run ${run.id}.`, {
102
+ run,
103
+ ...automation ? { delivery: automationDelivery(automation, "started") } : {}
104
+ });
72
105
  }
73
106
  case "pause": {
74
107
  const id = params.automationId?.trim();
75
108
  if (!id) return textResult("automationId is required for pause.", { ok: false });
76
109
  const automation = await service.pause(id);
77
110
  if (!automation) return textResult(`Automation not found: ${id}`, { ok: false });
78
- return textResult(`Paused automation ${id}.`, { automation });
111
+ return textResult(`Paused automation ${id}.`, {
112
+ automation,
113
+ delivery: automationDelivery(automation, "updated")
114
+ });
79
115
  }
80
116
  case "resume": {
81
117
  const id = params.automationId?.trim();
82
118
  if (!id) return textResult("automationId is required for resume.", { ok: false });
83
119
  const automation = await service.resume(id);
84
120
  if (!automation) return textResult(`Automation not found: ${id}`, { ok: false });
85
- return textResult(`Resumed automation ${id}.`, { automation });
121
+ return textResult(`Resumed automation ${id}.`, {
122
+ automation,
123
+ delivery: automationDelivery(automation, "updated")
124
+ });
86
125
  }
87
126
  case "history": {
88
127
  const id = params.automationId?.trim();
@@ -18,6 +18,7 @@ import type { AutomationService } from '../../automations/index.js';
18
18
  import type { NotesService } from '../../notes/index.js';
19
19
  import type { ProjectService } from '../../projects/index.js';
20
20
  import type { WorkItemService } from '../../work-items/index.js';
21
+ import type { LocalAppService } from '../../local-apps/index.js';
21
22
  import type { WorkflowRunServiceLike } from '../../workflows/service/workflow-run-service.types.js';
22
23
  import type { SkillManager } from '../skills/skill-manager.js';
23
24
  import { type ToolExecutorConfig } from './executor.js';
@@ -51,6 +52,7 @@ export interface ToolFactoryDeps {
51
52
  getNotesService?: () => NotesService | undefined;
52
53
  getProjectService?: () => ProjectService | undefined;
53
54
  getWorkItemService?: () => WorkItemService | undefined;
55
+ getLocalAppService?: () => LocalAppService | undefined;
54
56
  /** Gateway: starts persisted workflow runs (dedicated chat session per run). */
55
57
  getWorkflowRunService?: () => WorkflowRunServiceLike | undefined;
56
58
  /** Current session skill indexing (tool gating + allowlist); used by skills_list / skill_view. */
@@ -283,13 +283,14 @@ var AgentToolsFactory = class {
283
283
  getCurrentSessionKey: () => this.deps.getCurrentContext()?.sessionKey
284
284
  })] : [],
285
285
  ...this.deps.getAutomationService ? [createAutomationTool({ getAutomationService: this.deps.getAutomationService })] : [],
286
- ...this.deps.getProjectService || this.deps.getNotesService || this.deps.getWorkItemService ? [createXopcUseTool({
286
+ ...this.deps.getProjectService || this.deps.getNotesService || this.deps.getWorkItemService || this.deps.getLocalAppService ? [createXopcUseTool({
287
287
  getConfig: () => this.deps.getConfig?.(),
288
288
  getCurrentAgentId: () => options.agentId,
289
289
  getCurrentSessionKey: () => this.deps.getCurrentContext()?.sessionKey,
290
290
  getNotesService: this.deps.getNotesService,
291
291
  getProjectService: this.deps.getProjectService,
292
- getWorkItemService: this.deps.getWorkItemService
292
+ getWorkItemService: this.deps.getWorkItemService,
293
+ getLocalAppService: this.deps.getLocalAppService
293
294
  })] : [],
294
295
  createGoalTool({ getCurrentSessionKey: () => this.deps.getCurrentContext()?.sessionKey }),
295
296
  ...browserEnabled ? [createBrowserUseTool({
@@ -1,4 +1,6 @@
1
1
  import type { AgentTool } from '@earendil-works/pi-agent-core';
2
+ import { type ProductDeliveryEnvelope } from '@xopcai/gateway-contract';
3
+ import { type Goal } from '../../goals/index.js';
2
4
  declare const GoalToolSchema: import("@sinclair/typebox").TObject<{
3
5
  action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"list">, import("@sinclair/typebox").TLiteral<"create">, import("@sinclair/typebox").TLiteral<"update">]>;
4
6
  goalId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -19,5 +21,9 @@ declare const GoalToolSchema: import("@sinclair/typebox").TObject<{
19
21
  export interface GoalToolOptions {
20
22
  getCurrentSessionKey?: () => string | undefined;
21
23
  }
22
- export declare function createGoalTool(options?: GoalToolOptions): AgentTool<typeof GoalToolSchema, {}>;
24
+ type GoalToolDetails = {
25
+ goal?: Goal;
26
+ delivery?: ProductDeliveryEnvelope;
27
+ };
28
+ export declare function createGoalTool(options?: GoalToolOptions): AgentTool<typeof GoalToolSchema, GoalToolDetails>;
23
29
  export {};
@@ -3,6 +3,7 @@ import "../../storage/sqlite/index.js";
3
3
  import { GoalService } from "../../goals/goal-service.js";
4
4
  import "../../goals/index.js";
5
5
  import { Type } from "@sinclair/typebox";
6
+ import { appendProductDeliveryText } from "@xopcai/gateway-contract";
6
7
  //#region src/agent/tools/goal-tool.ts
7
8
  const GoalToolSchema = Type.Object({
8
9
  action: Type.Union([
@@ -42,13 +43,35 @@ const GoalToolSchema = Type.Object({
42
43
  maximum: 100
43
44
  }))
44
45
  });
45
- function textResult(text) {
46
+ function goalDelivery(goal, operation) {
47
+ return {
48
+ version: 1,
49
+ operation,
50
+ primary: {
51
+ kind: "goal",
52
+ id: goal.id,
53
+ title: goal.title,
54
+ summary: goal.description?.trim() || goal.nextAction?.trim() || void 0,
55
+ status: goal.status,
56
+ revision: String(goal.updatedAt),
57
+ projectId: goal.projectId ?? void 0,
58
+ capabilities: [
59
+ "open",
60
+ "edit",
61
+ "continue_in_chat",
62
+ "pause",
63
+ "resume"
64
+ ]
65
+ }
66
+ };
67
+ }
68
+ function textResult(text, details = {}) {
46
69
  return {
47
70
  content: [{
48
71
  type: "text",
49
- text
72
+ text: appendProductDeliveryText(text, details.delivery)
50
73
  }],
51
- details: {}
74
+ details
52
75
  };
53
76
  }
54
77
  function createGoalTool(options = {}) {
@@ -81,7 +104,10 @@ function createGoalTool(options = {}) {
81
104
  maxTurns: params.maxTurns,
82
105
  source: "workflow"
83
106
  });
84
- return textResult(`Created goal ${goal.id}\n${goal.title}`);
107
+ return textResult(`Created goal ${goal.id}\n${goal.title}`, {
108
+ goal,
109
+ delivery: goalDelivery(goal, "created")
110
+ });
85
111
  }
86
112
  const goalId = params.goalId?.trim();
87
113
  if (!goalId) return textResult("Error: goalId is required.");
@@ -97,7 +123,10 @@ function createGoalTool(options = {}) {
97
123
  });
98
124
  if (!goal) return textResult(`Goal not found: ${goalId}`);
99
125
  if (params.status) goal = goals.setStatus(goalId, params.status, { reason: params.blockedReason });
100
- return textResult(`Updated goal ${goalId}\n${goal?.title ?? ""}`);
126
+ return textResult(`Updated goal ${goalId}\n${goal?.title ?? ""}`, goal ? {
127
+ goal,
128
+ delivery: goalDelivery(goal, "updated")
129
+ } : {});
101
130
  }
102
131
  };
103
132
  }
@@ -2,6 +2,7 @@ import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
3
  import { extractProfileAgentId } from "../../config/agent-profile.js";
4
4
  import { Type } from "@sinclair/typebox";
5
+ import { appendProductDeliveryText } from "@xopcai/gateway-contract";
5
6
  //#region src/agent/tools/workflow-tool.ts
6
7
  /**
7
8
  * `workflow` — starts a persisted workflow run in a dedicated chat session.
@@ -76,16 +77,45 @@ function createWorkflowTool(deps) {
76
77
  }],
77
78
  details: { error: result.message }
78
79
  };
80
+ const summary = goal ? `Started workflow \`${definitionId}\` (run ${result.runId}). Open chat session to track progress and continue.` : `Started workflow \`${definitionId}\` (run ${result.runId}). Open the workflow chat session to track progress.`;
81
+ const delivery = {
82
+ version: 1,
83
+ operation: "started",
84
+ primary: {
85
+ kind: "workflow_run",
86
+ id: result.runId,
87
+ title: goal || definitionId,
88
+ summary: `Workflow ${definitionId}`,
89
+ status: "running",
90
+ capabilities: ["open", "continue_in_chat"]
91
+ },
92
+ related: [{
93
+ kind: "workflow_definition",
94
+ id: definitionId,
95
+ title: definitionId,
96
+ capabilities: [
97
+ "open",
98
+ "edit",
99
+ "run"
100
+ ]
101
+ }, {
102
+ kind: "session",
103
+ id: result.sessionKey,
104
+ title: goal || definitionId,
105
+ capabilities: ["open", "continue_in_chat"]
106
+ }]
107
+ };
79
108
  return {
80
109
  content: [{
81
110
  type: "text",
82
- text: `${goal ? `Started workflow \`${definitionId}\` (run ${result.runId}). Open chat session to track progress and continue.` : `Started workflow \`${definitionId}\` (run ${result.runId}). Open the workflow chat session to track progress.`}\n\nsessionKey: ${result.sessionKey}`
111
+ text: appendProductDeliveryText(`${summary}\n\nsessionKey: ${result.sessionKey}`, delivery)
83
112
  }],
84
113
  details: {
85
114
  runId: result.runId,
86
115
  sessionKey: result.sessionKey,
87
116
  definitionId,
88
- parentSessionKey: parentSessionKey ?? null
117
+ parentSessionKey: parentSessionKey ?? null,
118
+ delivery
89
119
  }
90
120
  };
91
121
  } catch (e) {
@@ -1,9 +1,10 @@
1
1
  import { checkFileSafety } from "../prompt/safety.js";
2
2
  import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
3
3
  import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
4
- import { dirname } from "path";
4
+ import { basename, dirname } from "path";
5
5
  import { mkdir, writeFile } from "fs/promises";
6
6
  import { Type } from "@sinclair/typebox";
7
+ import { appendProductDeliveryText } from "@xopcai/gateway-contract";
7
8
  //#region src/agent/tools/write.ts
8
9
  const MAX_FILE_SIZE = 10 * 1024 * 1024;
9
10
  const WriteFileSchema = Type.Object({
@@ -69,12 +70,31 @@ function createWriteFileTool(workspace, options) {
69
70
  operation: "write"
70
71
  }
71
72
  });
73
+ const delivery = {
74
+ version: 1,
75
+ operation: "updated",
76
+ primary: {
77
+ kind: "file",
78
+ id: target,
79
+ title: basename(target),
80
+ summary: `${contentBytes} bytes written`,
81
+ capabilities: [
82
+ "preview",
83
+ "reveal",
84
+ "share"
85
+ ]
86
+ }
87
+ };
72
88
  return {
73
89
  content: [{
74
90
  type: "text",
75
- text: `File written: ${target}`
91
+ text: appendProductDeliveryText(`File written: ${target}`, delivery)
76
92
  }],
77
- details: { size: contentBytes }
93
+ details: {
94
+ size: contentBytes,
95
+ path: target,
96
+ delivery
97
+ }
78
98
  };
79
99
  } catch (error) {
80
100
  return {
@@ -1,15 +1,17 @@
1
1
  import type { AgentTool } from '@earendil-works/pi-agent-core';
2
+ import { type ProductDeliveryEnvelope } from '@xopcai/gateway-contract';
2
3
  import type { Config } from '../../config/schema.js';
3
4
  import type { NotesService } from '../../notes/index.js';
4
5
  import { type ProjectService } from '../../projects/index.js';
5
6
  import type { WorkItemService } from '../../work-items/index.js';
7
+ import type { LocalAppService } from '../../local-apps/index.js';
6
8
  declare const XopcUseToolSchema: import("@sinclair/typebox").TObject<{
7
- mode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"project">, import("@sinclair/typebox").TLiteral<"note">, import("@sinclair/typebox").TLiteral<"work_item">]>;
9
+ mode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"project">, import("@sinclair/typebox").TLiteral<"note">, import("@sinclair/typebox").TLiteral<"work_item">, import("@sinclair/typebox").TLiteral<"local_app">, import("@sinclair/typebox").TLiteral<"settings">]>;
8
10
  command: import("@sinclair/typebox").TString;
9
11
  args: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
10
12
  dryRun: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
11
13
  }>;
12
- export type XopcUseMode = 'project' | 'note' | 'work_item';
14
+ export type XopcUseMode = 'project' | 'note' | 'work_item' | 'local_app' | 'settings';
13
15
  export interface XopcUseToolInput {
14
16
  mode: XopcUseMode;
15
17
  command: string;
@@ -23,12 +25,14 @@ export interface XopcUseToolDeps {
23
25
  getNotesService?: () => NotesService | undefined;
24
26
  getProjectService?: () => ProjectService | undefined;
25
27
  getWorkItemService?: () => WorkItemService | undefined;
28
+ getLocalAppService?: () => LocalAppService | undefined;
26
29
  }
27
30
  type XopcUseDetails = {
28
31
  mode: XopcUseMode;
29
32
  command: string;
30
33
  dryRun: boolean;
31
34
  result?: unknown;
35
+ delivery?: ProductDeliveryEnvelope;
32
36
  };
33
37
  export declare function createXopcUseTool(deps: XopcUseToolDeps): AgentTool<typeof XopcUseToolSchema, XopcUseDetails>;
34
38
  export {};