openwork-server 0.18.62 → 0.18.64

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 (94) hide show
  1. package/README.md +2 -2
  2. package/dist/opencode-plugin-deps-1.18.33.tgz +0 -0
  3. package/dist/opencode-plugins/approval-loopback-fetch.js +18 -0
  4. package/dist/opencode-plugins/drive-file-tools.js +20 -5
  5. package/dist/opencode-plugins/managed-policy-next.js +7782 -1886
  6. package/dist/opencode-plugins/openwork-agent-permissions-v2.js +7912 -1896
  7. package/dist/opencode-plugins/openwork-auto-route-v2.js +19657 -0
  8. package/dist/opencode-plugins/openwork-capabilities-knowledge.js +7800 -1911
  9. package/dist/opencode-plugins/openwork-chrome-devtools.js +25294 -1914
  10. package/dist/opencode-plugins/openwork-cloud-skills-v2.js +54 -31
  11. package/dist/opencode-plugins/openwork-computer-use.js +25259 -1881
  12. package/dist/opencode-plugins/openwork-context-v2.js +25523 -1891
  13. package/dist/opencode-plugins/openwork-extensions-preview.js +8804 -2150
  14. package/dist/opencode-plugins/openwork-gateway-quota-v2.js +7748 -1846
  15. package/dist/opencode-plugins/openwork-gateway-quota.js +7755 -1853
  16. package/dist/opencode-plugins/openwork-pdf-attachments.js +8032 -2145
  17. package/dist/opencode-plugins/openwork-provider-adapters.js +65 -6
  18. package/dist/opencode-plugins/openwork-provider-sync-v2.js +459 -139
  19. package/dist/opencode-plugins/openwork-session-groups.js +5 -4
  20. package/dist/opencode-plugins/openwork-spreadsheets.js +7809 -1922
  21. package/dist/opencode-plugins/openwork-ui-bridge.js +6 -3
  22. package/dist/opencode-plugins/openwork-visible-reasoning-v2.js +153 -0
  23. package/dist/opencode-plugins/provider-safe-tool-schema.js +57 -0
  24. package/dist/opencode-plugins/session-read-detail.js +475 -0
  25. package/dist/openwork-server.mjs +21238 -10377
  26. package/package.json +1 -1
  27. package/web/assets/{abnfDiagram-VCTEODGH-DJzrT8Ql.js → abnfDiagram-VCTEODGH-j_pTDiqz.js} +1 -1
  28. package/web/assets/{app-_2KkkZIM.js → app-Bzky4OVl.js} +489 -454
  29. package/web/assets/app-C32roy8y.css +32 -0
  30. package/web/assets/{arc-KehB1xN5.js → arc-CaQNh7ZT.js} +1 -1
  31. package/web/assets/{architectureDiagram-5GKGNRK7-C_GL2639.js → architectureDiagram-5GKGNRK7-wMx5wEbF.js} +1 -1
  32. package/web/assets/{artifact-code-view-CYn_58gV.js → artifact-code-view-DCMMpJxD.js} +1 -1
  33. package/web/assets/{artifact-spreadsheet-editor-f6V-tYvi.js → artifact-spreadsheet-editor-DNHOxqPc.js} +1 -1
  34. package/web/assets/{artifact-text-editor-CiSlW3kl.js → artifact-text-editor-o6WCLEmo.js} +1 -1
  35. package/web/assets/{blockDiagram-OSKFZWR5-DErH-7gY.js → blockDiagram-OSKFZWR5-BYAM-sb8.js} +1 -1
  36. package/web/assets/{c4Diagram-7LVT6UL2-aML4z_n9.js → c4Diagram-7LVT6UL2-pOXGVuIa.js} +1 -1
  37. package/web/assets/channel-DR4AKESO.js +1 -0
  38. package/web/assets/{chunk-2Q5K7J3B-Dw_IH9rW.js → chunk-2Q5K7J3B-A7RWrtFk.js} +1 -1
  39. package/web/assets/{chunk-5VM5RSS4-aeJEQ945.js → chunk-5VM5RSS4-BbhM53lO.js} +1 -1
  40. package/web/assets/{chunk-F27PBJKO-hZwti-Oc.js → chunk-F27PBJKO-Aoti2mfN.js} +1 -1
  41. package/web/assets/{chunk-HLEWEB6X-JFNzm3Ge.js → chunk-HLEWEB6X-h1a1fijx.js} +1 -1
  42. package/web/assets/{chunk-JWPE2WC7-B34hvYk7.js → chunk-JWPE2WC7-CtyBiDJt.js} +1 -1
  43. package/web/assets/{chunk-POPQ4Y6H-CDqgEp-q.js → chunk-POPQ4Y6H-d6pjL5RD.js} +1 -1
  44. package/web/assets/{chunk-SVP7TREG-B65ta9aQ.js → chunk-SVP7TREG-DnzaR7AG.js} +1 -1
  45. package/web/assets/{chunk-XXDRQBXY-DjTi6c9m.js → chunk-XXDRQBXY-B9hkBiar.js} +1 -1
  46. package/web/assets/{chunk-ZLD2IHE6-CbviXFvb.js → chunk-ZLD2IHE6-DzJ1_fxy.js} +1 -1
  47. package/web/assets/classDiagram-CYGNFDIV-B0y8HxEN.js +1 -0
  48. package/web/assets/classDiagram-v2-TLXNO2FR-B0y8HxEN.js +1 -0
  49. package/web/assets/{cose-bilkent-JH36ORCC-Cl9SO5zd.js → cose-bilkent-JH36ORCC-BhvTRFRe.js} +1 -1
  50. package/web/assets/{cynefin-OW5HDTMX-CAcz2tHt.js → cynefin-OW5HDTMX-fGckFsSU.js} +1 -1
  51. package/web/assets/{cynefinDiagram-5FMLGOSQ-BJHft4FO.js → cynefinDiagram-5FMLGOSQ-BzW--hKZ.js} +1 -1
  52. package/web/assets/{dagre-OS7QT2EB-DbdnY1uS.js → dagre-OS7QT2EB-BnhLgL07.js} +1 -1
  53. package/web/assets/{diagram-S7CK7UJ4-C07WD5Lc.js → diagram-S7CK7UJ4-Cu-md7dS.js} +1 -1
  54. package/web/assets/{diagram-UQ7AKVKN-D8VCjq9x.js → diagram-UQ7AKVKN-DXQdcUqJ.js} +1 -1
  55. package/web/assets/{diagram-VSXAHHWV-D1XSfMnK.js → diagram-VSXAHHWV-C0TNG60H.js} +1 -1
  56. package/web/assets/{diagram-VX7I27RA-3GZe-yrf.js → diagram-VX7I27RA-z9AkHrlD.js} +1 -1
  57. package/web/assets/{diagram-Z3DM3KII-CI43WcIB.js → diagram-Z3DM3KII-CB0wN1mx.js} +1 -1
  58. package/web/assets/{ebnfDiagram-PWID7BFC-CTzouade.js → ebnfDiagram-PWID7BFC-k6ofa2S7.js} +1 -1
  59. package/web/assets/{erDiagram-2YWLMYGG-CNcqsnqx.js → erDiagram-2YWLMYGG-DH0LRcXA.js} +1 -1
  60. package/web/assets/{flowDiagram-T62WH6J4-pomAqjgF.js → flowDiagram-T62WH6J4-BRVNnCPG.js} +1 -1
  61. package/web/assets/{ganttDiagram-EL5Y4UJY-C1dNaxxj.js → ganttDiagram-EL5Y4UJY-BnEWMV5l.js} +1 -1
  62. package/web/assets/{gitGraphDiagram-WWUBYQGX-Ni8GECg1.js → gitGraphDiagram-WWUBYQGX-COrkPeQK.js} +1 -1
  63. package/web/assets/{infoDiagram-FKFFQAWI-C0kvE7Zu.js → infoDiagram-FKFFQAWI-DZuH1fmc.js} +1 -1
  64. package/web/assets/{ishikawaDiagram-5VMMS53U-CxmP_irp.js → ishikawaDiagram-5VMMS53U-CaJUJ6Ff.js} +1 -1
  65. package/web/assets/{journeyDiagram-EYS64GPL-60GkPgH5.js → journeyDiagram-EYS64GPL-BE6Fv_rV.js} +1 -1
  66. package/web/assets/{kanban-definition-UXKFOSKX-ByxcB0T_.js → kanban-definition-UXKFOSKX-B4bPGzK6.js} +1 -1
  67. package/web/assets/{layout-BD9ef90s.js → layout-or_42uvc.js} +1 -1
  68. package/web/assets/{linear-Dp9l0lBr.js → linear-5PXMsdhe.js} +1 -1
  69. package/web/assets/{mermaid.core-FKm3Akes.js → mermaid.core-DW6D3RPJ.js} +6 -6
  70. package/web/assets/{mindmap-definition-THT77NOG-i7WJlWHV.js → mindmap-definition-THT77NOG-CyTLW_BU.js} +1 -1
  71. package/web/assets/{pegDiagram-XKGWAZYB-DfI-LsJq.js → pegDiagram-XKGWAZYB-7JUI9VKo.js} +1 -1
  72. package/web/assets/{pieDiagram-E7YTZNPT-kcgWYBSb.js → pieDiagram-E7YTZNPT-Bp-lNUXy.js} +1 -1
  73. package/web/assets/{quadrantDiagram-AXDQQJYC-DVyziZnc.js → quadrantDiagram-AXDQQJYC-BHzbyOLv.js} +1 -1
  74. package/web/assets/{railroadDiagram-O6MQD6OU-CWgHq9nv.js → railroadDiagram-O6MQD6OU-DUbwyc8J.js} +1 -1
  75. package/web/assets/{requirementDiagram-IS5BZ75X-B7fgi4lz.js → requirementDiagram-IS5BZ75X-C6vHvRXL.js} +1 -1
  76. package/web/assets/{sankeyDiagram-P5KCCOFB-D1-pD_qh.js → sankeyDiagram-P5KCCOFB-rhUrZHvo.js} +1 -1
  77. package/web/assets/{sequenceDiagram-WJ2MYXX4-B6oeRmVj.js → sequenceDiagram-WJ2MYXX4-CbKw45qx.js} +1 -1
  78. package/web/assets/{sizeCapture-INFHLROL-BTpKGFt5.js → sizeCapture-INFHLROL-BzYRidKe.js} +1 -1
  79. package/web/assets/{stateDiagram-XQSTLZYL-zXJRxE6h.js → stateDiagram-XQSTLZYL-CY_NqfCu.js} +1 -1
  80. package/web/assets/stateDiagram-v2-IH3M54BS-ZplxpnyH.js +1 -0
  81. package/web/assets/{swimlanes-V6O3JKXN-Dc7MXPb3.js → swimlanes-V6O3JKXN-DsuNS06S.js} +1 -1
  82. package/web/assets/swimlanesDiagram-JKAHXJPX-BgYXaTmf.js +8 -0
  83. package/web/assets/{timeline-definition-24CTP7MA-DYhgbnjW.js → timeline-definition-24CTP7MA-Bw7piZjw.js} +1 -1
  84. package/web/assets/{vennDiagram-4TSXK5OY-DRnme7za.js → vennDiagram-4TSXK5OY-3QO9enN9.js} +1 -1
  85. package/web/assets/{wardleyDiagram-VM6X3IG4-wAoo4GsZ.js → wardleyDiagram-VM6X3IG4-u2wsdzR8.js} +1 -1
  86. package/web/assets/{workspace-file-tree-DmAwvqtx.js → workspace-file-tree-B0RW5c5J.js} +1 -1
  87. package/web/assets/{xychartDiagram-S5SC5T6Z-_Z_TOWBn.js → xychartDiagram-S5SC5T6Z-YVqX-MzU.js} +1 -1
  88. package/web/index.html +2 -2
  89. package/web/assets/app-CkmqBm_1.css +0 -32
  90. package/web/assets/channel-7oM0ncHI.js +0 -1
  91. package/web/assets/classDiagram-CYGNFDIV-BkidFauP.js +0 -1
  92. package/web/assets/classDiagram-v2-TLXNO2FR-BkidFauP.js +0 -1
  93. package/web/assets/stateDiagram-v2-IH3M54BS-CmwZ6tXj.js +0 -1
  94. package/web/assets/swimlanesDiagram-JKAHXJPX-BXoJEx2b.js +0 -8
@@ -12,6 +12,12 @@ const catalogSchema = z.object({
12
12
  setup: z.object({ status: z.string(), message: z.string() }).optional(),
13
13
  })),
14
14
  });
15
+ /** The skill the engine's native `skill` tool is about to load, if any. */
16
+ function skillToolId(event) {
17
+ if (event.tool !== "skill" || typeof event.input !== "object" || event.input === null || !("id" in event.input))
18
+ return null;
19
+ return typeof event.input.id === "string" ? event.input.id : null;
20
+ }
15
21
  export const CLOUD_SKILL_ID_PREFIX = "openwork-cloud-";
16
22
  const MAX_SKILLS = 150;
17
23
  // Native entries carry Den's full description (at most 1,024 characters), the
@@ -117,7 +123,8 @@ export function mentionedSkillIds(text, skills) {
117
123
  /** Setup starts background discovery without making Cloud a dependency of
118
124
  * chatting or local skill discovery. Only authorized catalog entries and
119
125
  * digest-verified bodies are added to the native registry. Discovery reads
120
- * metadata only; a body is read when a message names or attaches its skill. */
126
+ * metadata only; a body is read when a message names or attaches its skill,
127
+ * or when the model calls the native skill tool for it. */
121
128
  export async function registerCloudSkillDiscovery(context) {
122
129
  let skills = [];
123
130
  let catalog = { skills: [] };
@@ -132,6 +139,7 @@ export async function registerCloudSkillDiscovery(context) {
132
139
  const controller = new AbortController();
133
140
  let registration;
134
141
  let promptHook;
142
+ let toolHook;
135
143
  const call = async (name, input) => {
136
144
  const response = await fetch(context.options.url, {
137
145
  method: "POST", redirect: "error",
@@ -198,37 +206,51 @@ export async function registerCloudSkillDiscovery(context) {
198
206
  });
199
207
  return publishing;
200
208
  };
201
- const ensurePromptHook = async () => {
202
- if (promptHook || !context.session)
209
+ /** Read the registered skills `ids` names, mark them warm and publish their bodies. */
210
+ const use = async (ids) => {
211
+ // Only registered skills: an unlisted ID never costs a read.
212
+ const registered = new Set(skills.map(skill => skill.id));
213
+ const used = new Set([...ids].filter(id => registered.has(id)));
214
+ const entries = catalog.skills.filter(skill => used.has(skillId(skill)));
215
+ if (entries.length === 0)
203
216
  return;
204
- promptHook = await context.session.hook("prompt", async (event) => {
205
- if (skills.length === 0)
206
- return;
207
- const attached = new Set((event.prompt.skills ?? []).map(skill => skill.id));
208
- const mentioned = mentionedSkillIds(event.prompt.text, skills).filter(id => !attached.has(id));
209
- if (mentioned.length)
210
- event.prompt.skills = [...(event.prompt.skills ?? []), ...mentioned.map(id => ({ id }))];
211
- // Only registered skills: an unlisted ID never costs a read.
212
- const registered = new Set(skills.map(skill => skill.id));
213
- const used = new Set([...attached, ...mentioned].filter(id => registered.has(id)));
214
- const entries = catalog.skills.filter(skill => used.has(skillId(skill)));
215
- if (entries.length === 0)
216
- return;
217
- try {
218
- // Freshly authorized for this message, and counted by Den as a use.
219
- // A body that cannot be read leaves the discovery note: get_skill still works.
220
- await readBodies(entries, true);
221
- for (const skill of entries) {
222
- const id = skillId(skill);
223
- warm.splice(0, warm.length, ...warm.filter(entry => entry !== id), id);
224
- }
225
- warm.splice(0, Math.max(0, warm.length - MAX_WARM_SKILLS));
226
- await publish();
227
- }
228
- catch {
229
- // A message is never held back by Cloud skill loading.
217
+ try {
218
+ // Freshly authorized for this use, and counted by Den as one.
219
+ // A body that cannot be read leaves the discovery note: get_skill still works.
220
+ await readBodies(entries, true);
221
+ for (const skill of entries) {
222
+ const id = skillId(skill);
223
+ warm.splice(0, warm.length, ...warm.filter(entry => entry !== id), id);
230
224
  }
231
- });
225
+ warm.splice(0, Math.max(0, warm.length - MAX_WARM_SKILLS));
226
+ await publish();
227
+ }
228
+ catch {
229
+ // Neither a message nor a skill call is held back by Cloud skill loading.
230
+ }
231
+ };
232
+ const ensureHooks = async () => {
233
+ if (!promptHook && context.session) {
234
+ promptHook = await context.session.hook("prompt", async (event) => {
235
+ if (skills.length === 0)
236
+ return;
237
+ const attached = new Set((event.prompt.skills ?? []).map(skill => skill.id));
238
+ const mentioned = mentionedSkillIds(event.prompt.text, skills).filter(id => !attached.has(id));
239
+ if (mentioned.length)
240
+ event.prompt.skills = [...(event.prompt.skills ?? []), ...mentioned.map(id => ({ id }))];
241
+ await use([...attached, ...mentioned]);
242
+ });
243
+ }
244
+ // The model picked a skill itself: load its body before the native skill
245
+ // tool reads the registry, so one call returns the full SKILL.md instead
246
+ // of a note that sends the model to get_skill for a second call.
247
+ if (!toolHook && context.tool) {
248
+ toolHook = await context.tool.hook("execute.before", async (event) => {
249
+ const id = skillToolId(event);
250
+ if (id?.startsWith(CLOUD_SKILL_ID_PREFIX))
251
+ await use([id]);
252
+ });
253
+ }
232
254
  };
233
255
  const refresh = async () => {
234
256
  if (closed || refreshing)
@@ -241,7 +263,7 @@ export async function registerCloudSkillDiscovery(context) {
241
263
  catalog = catalogSchema.parse(value);
242
264
  // Only warm skills whose digest changed are read again.
243
265
  await readBodies(warmEntries().filter(skill => skill.digest && !contents.has(skill.digest)), false);
244
- await ensurePromptHook();
266
+ await ensureHooks();
245
267
  await publish();
246
268
  }
247
269
  catch {
@@ -263,6 +285,7 @@ export async function registerCloudSkillDiscovery(context) {
263
285
  contents.clear();
264
286
  await publishing.catch(() => { });
265
287
  await promptHook?.dispose();
288
+ await toolHook?.dispose();
266
289
  await registration?.dispose();
267
290
  };
268
291
  }