openwork-server 0.18.63 → 0.18.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/opencode-plugin-deps-1.18.33.tgz +0 -0
- package/dist/opencode-plugins/approval-loopback-fetch.js +18 -0
- package/dist/opencode-plugins/computer-listing-files.js +101 -0
- package/dist/opencode-plugins/drive-file-tools.js +2 -2
- package/dist/opencode-plugins/managed-policy-next.js +11 -5
- package/dist/opencode-plugins/openwork-agent-permissions-v2.js +162 -11
- package/dist/opencode-plugins/openwork-agent-questions.js +24 -0
- package/dist/opencode-plugins/openwork-auto-route-v2.js +19657 -0
- package/dist/opencode-plugins/openwork-capabilities-knowledge.js +5 -3
- package/dist/opencode-plugins/openwork-chrome-devtools.js +17498 -5
- package/dist/opencode-plugins/openwork-cloud-skills-v2.js +54 -31
- package/dist/opencode-plugins/openwork-codemode-discovery-v2.js +19 -6
- package/dist/opencode-plugins/openwork-computer-use.js +17650 -37
- package/dist/opencode-plugins/openwork-context-v2.js +17840 -78
- package/dist/opencode-plugins/openwork-extensions-preview.js +929 -175
- package/dist/opencode-plugins/openwork-gateway-quota-v2.js +15 -0
- package/dist/opencode-plugins/openwork-gateway-quota.js +15 -0
- package/dist/opencode-plugins/openwork-mcp-results-v2.js +20 -4
- package/dist/opencode-plugins/openwork-office-attachments.js +1 -1
- package/dist/opencode-plugins/openwork-provider-adapters.js +65 -6
- package/dist/opencode-plugins/openwork-provider-sync-v2.js +459 -139
- package/dist/opencode-plugins/openwork-session-groups.js +5 -4
- package/dist/opencode-plugins/openwork-spreadsheets.js +1 -1
- package/dist/opencode-plugins/openwork-ui-bridge.js +6 -3
- package/dist/opencode-plugins/session-read-detail.js +475 -0
- package/dist/openwork-server.mjs +98993 -87384
- package/package.json +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-BSIb81ug.js → abnfDiagram-VCTEODGH-_euFTfuE.js} +1 -1
- package/web/assets/app-BL4DzbHg.css +32 -0
- package/web/assets/{app-DZr96oX3.js → app-B_eR6sGg.js} +461 -460
- package/web/assets/{arc-BTCnV0Ha.js → arc-DIIHEUK5.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-3IgeX1_6.js → architectureDiagram-5GKGNRK7-DD7V4Nl6.js} +1 -1
- package/web/assets/{artifact-code-view-ZP8nVuQx.js → artifact-code-view-2fHBrzKl.js} +1 -1
- package/web/assets/{artifact-spreadsheet-editor-BW94PK45.js → artifact-spreadsheet-editor-D2kPT8kU.js} +1 -1
- package/web/assets/{artifact-text-editor-BhIcTcNi.js → artifact-text-editor-uJetA3RS.js} +1 -1
- package/web/assets/{blockDiagram-OSKFZWR5-d1pNUfi4.js → blockDiagram-OSKFZWR5-B5VTERzj.js} +1 -1
- package/web/assets/{c4Diagram-7LVT6UL2-BTVoP_gs.js → c4Diagram-7LVT6UL2-1Lh6d98a.js} +1 -1
- package/web/assets/channel-CLju5G1-.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-BIy8BDgC.js → chunk-2Q5K7J3B-BYSg2PtF.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-BDvSSuPz.js → chunk-5VM5RSS4-CUeEqVp6.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-CqT02j1I.js → chunk-F27PBJKO-BYl1gIUK.js} +1 -1
- package/web/assets/{chunk-HLEWEB6X-DOSYJ6qO.js → chunk-HLEWEB6X-CSHTqizU.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-BLJ5TLJ6.js → chunk-JWPE2WC7-C3M9OIeQ.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-TRvB63--.js → chunk-POPQ4Y6H-CBer2BDK.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-Bz6HrnA2.js → chunk-SVP7TREG-gh6XHnDe.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-wBuvw6SP.js → chunk-XXDRQBXY-BWW96PGH.js} +1 -1
- package/web/assets/{chunk-ZLD2IHE6-CsK6m1Sk.js → chunk-ZLD2IHE6-BwjCpFv6.js} +1 -1
- package/web/assets/classDiagram-CYGNFDIV-DZO1M7Ic.js +1 -0
- package/web/assets/classDiagram-v2-TLXNO2FR-DZO1M7Ic.js +1 -0
- package/web/assets/{cose-bilkent-JH36ORCC-CISbKtKO.js → cose-bilkent-JH36ORCC-lJjj59Sx.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-Dk7vIkhw.js → cynefin-OW5HDTMX-CAIFZQxV.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-C3bIjcy0.js → cynefinDiagram-5FMLGOSQ-BNCAcb93.js} +1 -1
- package/web/assets/{dagre-OS7QT2EB-BsP75gf5.js → dagre-OS7QT2EB-DMlHDwrG.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-B4K-iSz7.js → diagram-S7CK7UJ4-Dbpa25GK.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-bly7AwhV.js → diagram-UQ7AKVKN-BCT_Qc9p.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-DObKajM9.js → diagram-VSXAHHWV-CapON9I2.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-SQp5kc6I.js → diagram-VX7I27RA-CCMsrHOR.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-BmaqS6Rw.js → diagram-Z3DM3KII-BOpKxuDL.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-BOhK-9Al.js → ebnfDiagram-PWID7BFC-C1sb3HsT.js} +1 -1
- package/web/assets/{erDiagram-2YWLMYGG-DP0d4SRU.js → erDiagram-2YWLMYGG-3TIcbkY2.js} +1 -1
- package/web/assets/{flowDiagram-T62WH6J4-CJLvattq.js → flowDiagram-T62WH6J4-C3YP5_VV.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-Dzi8suyh.js → ganttDiagram-EL5Y4UJY-BWO0IFRX.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-D-xOZUu9.js → gitGraphDiagram-WWUBYQGX-Dpi4d5u9.js} +1 -1
- package/web/assets/{infoDiagram-FKFFQAWI-CTR7Ei2k.js → infoDiagram-FKFFQAWI-C3t_XWD1.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-CBf51Qea.js → ishikawaDiagram-5VMMS53U-Duhj9xvC.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-ZumMGF2u.js → journeyDiagram-EYS64GPL-Bq_tWeLz.js} +1 -1
- package/web/assets/{kanban-definition-UXKFOSKX-81Fni8Sl.js → kanban-definition-UXKFOSKX-C7zCaEcE.js} +1 -1
- package/web/assets/{layout-D-HFg0Gy.js → layout-BGV5k35C.js} +1 -1
- package/web/assets/{linear-lAHomfjd.js → linear-jBjiubEm.js} +1 -1
- package/web/assets/{mermaid.core-sRbhnZ3C.js → mermaid.core-DcEA9CwK.js} +6 -6
- package/web/assets/{mindmap-definition-THT77NOG-t_uxFNYx.js → mindmap-definition-THT77NOG-DWi2qNO-.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-B4FryuiE.js → pegDiagram-XKGWAZYB-mpdETODF.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-DrIgLewj.js → pieDiagram-E7YTZNPT-B_E8xv7R.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-DifmQS8L.js → quadrantDiagram-AXDQQJYC-C3DLSKZx.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-C76a1ZKv.js → railroadDiagram-O6MQD6OU-CV8e2EYD.js} +1 -1
- package/web/assets/{requirementDiagram-IS5BZ75X-CT_K8F_V.js → requirementDiagram-IS5BZ75X-D8_GWwzL.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-DWQLcVQR.js → sankeyDiagram-P5KCCOFB-BedccLEd.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-aTZD72z2.js → sequenceDiagram-WJ2MYXX4-Cf9QsPD1.js} +1 -1
- package/web/assets/{sizeCapture-INFHLROL-BzVHqyuK.js → sizeCapture-INFHLROL-BZXVwOZ-.js} +1 -1
- package/web/assets/{stateDiagram-XQSTLZYL-D9BpFjx0.js → stateDiagram-XQSTLZYL-JaEqdUWJ.js} +1 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-BVaVsTdq.js +1 -0
- package/web/assets/{swimlanes-V6O3JKXN-DiN46HW4.js → swimlanes-V6O3JKXN-CIkru_FY.js} +1 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-AGVU67SD.js +8 -0
- package/web/assets/{timeline-definition-24CTP7MA-CJZAuVpz.js → timeline-definition-24CTP7MA-BDahVZ3U.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-d5RgWEF0.js → vennDiagram-4TSXK5OY-yi0sphxQ.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-DP1nzuP1.js → wardleyDiagram-VM6X3IG4-PXKHpuHP.js} +1 -1
- package/web/assets/{workspace-file-tree-iodkCqW9.js → workspace-file-tree-BoW3xSOx.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-Bh1aCFiI.js → xychartDiagram-S5SC5T6Z-2ZN6-3RY.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/app-Bx1ym5U0.css +0 -32
- package/web/assets/channel-DqkU7DUB.js +0 -1
- package/web/assets/classDiagram-CYGNFDIV-C-Tb50QW.js +0 -1
- package/web/assets/classDiagram-v2-TLXNO2FR-C-Tb50QW.js +0 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-B7xLeFMx.js +0 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-C1vbqhAp.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
|
-
|
|
202
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
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
|
|
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
|
}
|
|
@@ -16,10 +16,23 @@ function bindsDiscovery(value) {
|
|
|
16
16
|
return bindsDiscovery(value.left);
|
|
17
17
|
return Object.values(value).some(entry => Array.isArray(entry) ? entry.some(bindsDiscovery) : bindsDiscovery(entry));
|
|
18
18
|
}
|
|
19
|
+
function propertyName(value) {
|
|
20
|
+
const property = value.property;
|
|
21
|
+
if (!record(property))
|
|
22
|
+
return undefined;
|
|
23
|
+
if (value.computed === true)
|
|
24
|
+
return property.type === "Literal" && typeof property.value === "string" ? property.value : undefined;
|
|
25
|
+
return property.type === "Identifier" && typeof property.name === "string" ? property.name : undefined;
|
|
26
|
+
}
|
|
27
|
+
function isTools(value) {
|
|
28
|
+
return record(value) && value.type === "Identifier" && value.name === "tools";
|
|
29
|
+
}
|
|
19
30
|
/** The pinned engine has a bare search() intrinsic, but no tools.search alias.
|
|
31
|
+
* Models also write a server's spelling, tools["openwork-cloud"].search, which
|
|
32
|
+
* is rewritten only when that server has no tool of its own named search.
|
|
20
33
|
* Rewrite syntax before execution, never retry a script that may have written.
|
|
21
34
|
* Source ranges leave strings, comments, and unrelated tool paths unchanged. */
|
|
22
|
-
export function nativeDiscoveryCode(code) {
|
|
35
|
+
export function nativeDiscoveryCode(code, serverHasSearch = () => false) {
|
|
23
36
|
if (!code.includes("search"))
|
|
24
37
|
return code;
|
|
25
38
|
let tree;
|
|
@@ -39,11 +52,11 @@ export function nativeDiscoveryCode(code) {
|
|
|
39
52
|
|| value.type === "CatchClause" && bindsDiscovery(value.param)
|
|
40
53
|
|| Array.isArray(value.params) && value.params.some(bindsDiscovery))
|
|
41
54
|
shadowed = true;
|
|
42
|
-
if (value.type === "MemberExpression" &&
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
if (value.type === "MemberExpression" && propertyName(value) === "search" && typeof value.start === "number" && typeof value.end === "number") {
|
|
56
|
+
const server = record(value.object) && value.object.type === "MemberExpression" && isTools(value.object.object) ? propertyName(value.object) : undefined;
|
|
57
|
+
if (isTools(value.object) || server !== undefined && !serverHasSearch(server))
|
|
58
|
+
ranges.push({ start: value.start, end: value.end });
|
|
59
|
+
}
|
|
47
60
|
for (const entry of Object.values(value)) {
|
|
48
61
|
if (Array.isArray(entry))
|
|
49
62
|
entry.forEach(visit);
|