openwork-server 0.18.57 → 0.18.58
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/dist/opencode-plugin-deps-1.18.30.tgz +0 -0
- package/dist/opencode-plugins/opencode-stop-fence-client.js +6 -0
- package/dist/opencode-plugins/openwork-cloud-skills-v2.js +114 -0
- package/dist/opencode-plugins/openwork-codemode-discovery-v2.js +60 -0
- package/dist/opencode-plugins/openwork-context-v2.js +13777 -1
- package/dist/opencode-plugins/openwork-extensions-preview-steering.js +1 -1
- package/dist/opencode-plugins/openwork-extensions-preview.js +35 -4
- package/dist/opencode-plugins/openwork-mcp-readiness-v2.js +192 -0
- package/dist/opencode-plugins/openwork-mcp-results-v2.js +10836 -13
- package/dist/opencode-plugins/openwork-provider-filters-v2.js +5 -7
- package/dist/openwork-server.mjs +2781 -1805
- package/package.json +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-Dv8KxM1F.js → abnfDiagram-VCTEODGH-NpzjfSVw.js} +1 -1
- package/web/assets/{app-E_RdTPah.js → app-DAPWjSQy.js} +437 -409
- package/web/assets/app-Dt3ByUuG.css +32 -0
- package/web/assets/{arc-_WbfJV_K.js → arc-CHKYZ_eM.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-CckpRlSR.js → architectureDiagram-5GKGNRK7-CbtqO0tI.js} +1 -1
- package/web/assets/{artifact-code-view-BbU019Q_.js → artifact-code-view-BQF6eKZY.js} +1 -1
- package/web/assets/{artifact-spreadsheet-editor-B3q9ZZoB.js → artifact-spreadsheet-editor-CQJKFbub.js} +1 -1
- package/web/assets/{artifact-text-editor-CA2Dgulr.js → artifact-text-editor-B6E8-x3q.js} +1 -1
- package/web/assets/{blockDiagram-OSKFZWR5-BKdntEom.js → blockDiagram-OSKFZWR5-Ceoouvgp.js} +1 -1
- package/web/assets/{c4Diagram-7LVT6UL2-BJLyhqO1.js → c4Diagram-7LVT6UL2-DeZ6n4qW.js} +1 -1
- package/web/assets/channel-BA95BnJ8.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-D88ZIDGU.js → chunk-2Q5K7J3B-CpycWP6o.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-DebGr6SE.js → chunk-5VM5RSS4-DhEpcp77.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-ChkVnT1d.js → chunk-F27PBJKO-D0H-x4y2.js} +1 -1
- package/web/assets/{chunk-HLEWEB6X-ER6ZF6Pd.js → chunk-HLEWEB6X-CApTHm_u.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-CQw0tJnK.js → chunk-JWPE2WC7-BHCjUPpx.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-Dm94DEFc.js → chunk-POPQ4Y6H-CQhggViX.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-rzCKlvNW.js → chunk-SVP7TREG-CpeIJurV.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-BcXExR9z.js → chunk-XXDRQBXY-CLRkKkAV.js} +1 -1
- package/web/assets/{chunk-ZLD2IHE6-CRtSpyr1.js → chunk-ZLD2IHE6-BdYnQ042.js} +1 -1
- package/web/assets/classDiagram-CYGNFDIV-DEYczDTV.js +1 -0
- package/web/assets/classDiagram-v2-TLXNO2FR-DEYczDTV.js +1 -0
- package/web/assets/{cose-bilkent-JH36ORCC-1inJ0kKP.js → cose-bilkent-JH36ORCC-DmF8vX7k.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-BAEIfHgW.js → cynefin-OW5HDTMX-NLetkEsX.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-Dw_qVKID.js → cynefinDiagram-5FMLGOSQ-DKP1VgT5.js} +1 -1
- package/web/assets/{dagre-OS7QT2EB-BXAAz87u.js → dagre-OS7QT2EB-CRAAAd8s.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-BQt6gteN.js → diagram-S7CK7UJ4-DpAtNlvk.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-Dh7vrHwF.js → diagram-UQ7AKVKN-D3OPArp4.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-D2kNxmUp.js → diagram-VSXAHHWV-Ce3MQsSX.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-CctQDix_.js → diagram-VX7I27RA-DMNK9KDH.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-CDGlIVG5.js → diagram-Z3DM3KII-CCUXCTwV.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-0bgAb7z3.js → ebnfDiagram-PWID7BFC-Ch1ZBqfh.js} +1 -1
- package/web/assets/{erDiagram-2YWLMYGG-Dbur-iWa.js → erDiagram-2YWLMYGG-DfRCB-xW.js} +1 -1
- package/web/assets/{flowDiagram-T62WH6J4-Cw6AeymU.js → flowDiagram-T62WH6J4-Ch9kGwk1.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-BXYwFWOW.js → ganttDiagram-EL5Y4UJY-BzB0WGSq.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-De6ZCLNz.js → gitGraphDiagram-WWUBYQGX-Brbs3apz.js} +1 -1
- package/web/assets/{infoDiagram-FKFFQAWI-B11KM4en.js → infoDiagram-FKFFQAWI-Ca71MEwH.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-kGPWhBux.js → ishikawaDiagram-5VMMS53U-D0wX8tOf.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-K8Wtegvp.js → journeyDiagram-EYS64GPL-PeZPacru.js} +1 -1
- package/web/assets/{kanban-definition-UXKFOSKX-CjtX_cLJ.js → kanban-definition-UXKFOSKX-BLh162tT.js} +1 -1
- package/web/assets/{layout-Cn0uoRC-.js → layout-C0RknDsU.js} +1 -1
- package/web/assets/{linear-WTNza7Ko.js → linear-B9CiaY59.js} +1 -1
- package/web/assets/{mermaid.core-CbBVVRTZ.js → mermaid.core-CPTixcx8.js} +6 -6
- package/web/assets/{mindmap-definition-THT77NOG-DjyO1aA-.js → mindmap-definition-THT77NOG-BKk-svp_.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-ChPXU87n.js → pegDiagram-XKGWAZYB-Bs6f-6OM.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-bPQtXz_p.js → pieDiagram-E7YTZNPT-O9rjTBOJ.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-DokQ5FGV.js → quadrantDiagram-AXDQQJYC-MPWJAd0o.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-CcdqGxuL.js → railroadDiagram-O6MQD6OU-CmtyQoYY.js} +1 -1
- package/web/assets/{requirementDiagram-IS5BZ75X-CGMF9hMZ.js → requirementDiagram-IS5BZ75X-CiLZ0RyK.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-fc-d15bH.js → sankeyDiagram-P5KCCOFB-BLbDh3R4.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-DAmsOR8u.js → sequenceDiagram-WJ2MYXX4-DQMbAIgI.js} +1 -1
- package/web/assets/{sizeCapture-INFHLROL-6o7CY1B-.js → sizeCapture-INFHLROL-Di7AzhHC.js} +1 -1
- package/web/assets/{stateDiagram-XQSTLZYL-En5t4mkI.js → stateDiagram-XQSTLZYL-VqhUG217.js} +1 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-BXsiZKn6.js +1 -0
- package/web/assets/{swimlanes-V6O3JKXN-COBv2NoI.js → swimlanes-V6O3JKXN-BkN28nKF.js} +1 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-BuF8_99Y.js +8 -0
- package/web/assets/{timeline-definition-24CTP7MA-Qb-aTtSE.js → timeline-definition-24CTP7MA-B-p3ba39.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-Br3-0Ze-.js → vennDiagram-4TSXK5OY-Cggk7sJ0.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-BCeY3AKL.js → wardleyDiagram-VM6X3IG4-DZ8iGx_0.js} +1 -1
- package/web/assets/{workspace-file-tree-CYzKM8q4.js → workspace-file-tree-BKLzftpj.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-Bz96OPKc.js → xychartDiagram-S5SC5T6Z-Dg1J2qoX.js} +1 -1
- package/web/ext-microsoft-365.svg +1 -0
- package/web/index.html +2 -2
- package/web/assets/app-B682snBU.css +0 -32
- package/web/assets/channel-BZvy6aHa.js +0 -1
- package/web/assets/classDiagram-CYGNFDIV-DBAMzIwS.js +0 -1
- package/web/assets/classDiagram-v2-TLXNO2FR-DBAMzIwS.js +0 -1
- package/web/assets/katex-HP8lGamR.js +0 -257
- package/web/assets/stateDiagram-v2-IH3M54BS-DvIXHm_9.js +0 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-CorMSufQ.js +0 -8
|
@@ -47,7 +47,7 @@ const connectCatalogResponseSchema = z.object({
|
|
|
47
47
|
instruction: z.string(),
|
|
48
48
|
}).passthrough();
|
|
49
49
|
export const OPENWORK_GOOGLE_CONNECTION_INSTRUCTION = `Google Workspace uses OpenWork Cloud Connect only, with the member's Google connection managed by the Cloud backend. Do not set up local Google OAuth, request Google tokens, or offer a legacy Google extension or another provider stack. OpenWork Cloud readiness alone does not establish Google connection readiness. When the user requests Google setup or the requested operation is blocked by its connection, follow the exact live Cloud connection status action returned for that connection under the openwork-cloud server instructions. Never invent a connection status, connection id, or setup action; if no live status action is available, report that limitation.
|
|
50
|
-
For Google Drive uploads and Gmail attachments, Cloud search results alone do not establish that upload is unavailable. Discover the native Gmail draft schema before declaring attachments unsupported: OpenWork fulfills its attachment paths through host file transport, preserving the selected connection. Draft creation does not send email; sending is a separate, permissioned operation that requires the user's authorization. For Google Drive uploads, when OpenWork host tools are exposed, first query extension.actions with extensionId openwork-cloud-uploads. Only if drive_upload_file is returned and the user authorizes the upload, execute that exact action through openwork_execute id extension.call with extensionId openwork-cloud-uploads and args containing path and optional folderId. This host action
|
|
50
|
+
For Google Drive uploads and Gmail attachments, Cloud search results alone do not establish that upload is unavailable. Discover the native Gmail draft schema before declaring attachments unsupported: OpenWork fulfills its attachment paths through host file transport, preserving the selected connection. Draft creation does not send email; sending is a separate, permissioned operation that requires the user's authorization. For Google Drive uploads, when OpenWork host tools are exposed, first query extension.actions with extensionId openwork-cloud-uploads. Only if drive_upload_file is returned and the user authorizes the upload, execute that exact action through openwork_execute id extension.call with extensionId openwork-cloud-uploads and args containing path and optional folderId. This host action preserves bytes outside model context under authorized roots. Pass connectionId to preserve a requested Google Workspace account; omission uses the default. Files above 4 MiB use resumable transport when enabled for the organization; the host keeps the session URL out of model context. External clients with file transport may discover createGoogleDriveUploadSession and upload only the authorized file to its returned Google session URL without OAuth headers. That returned URL is a secret bearer credential (valid for up to a week): never print, share, log or persist it, and query the same session after an uncertain PUT instead of creating another session. If using the Gmail host action directly, only if gmail_create_draft_with_attachments is returned and the user authorizes draft creation, execute it with authorized paths and draft fields from its returned input schema, including the selected connectionId. It creates a reviewable draft, does not send email, and supports up to 10 files totaling 4 MiB. The bridge uses the Cloud backend member connection, not local Google credentials. Never load file bytes into model context or tool arguments, extract OAuth tokens, or improvise shell uploads as a fallback. A discovered createGoogleDriveUploadSession capability explicitly authorizes direct file transport to its returned session URL only after the user requests the upload. If host tools or the action are absent, including in external MCP-only clients, report that limitation rather than claiming this host upload route is available. Do not retry or switch routes after an uncertain result; verify whether the draft was created first.`;
|
|
51
51
|
export const OPENWORK_EXTENSION_DISCOVERY_INSTRUCTION = `If the user asks for something you cannot do with obvious built-in tools, check OpenWork extensions before saying the capability is unavailable. Use openwork_query with id extension.actions to inspect available extension actions, then openwork_execute with id extension.call for the matching action. Do not use another route to bypass a failed connection; follow its connection guidance. ${OPENWORK_GOOGLE_CONNECTION_INSTRUCTION}`;
|
|
52
52
|
export const OPENWORK_CLOUD_SKILL_AUTHORING_INSTRUCTION = "Skill creation: Cloud. When the user asks to create a skill, retrieve and follow the listed create-skill remote skill by calling openwork-cloud_get_skill with { name: \"create-skill\" }, or openwork-cloud_execute_capability with its exact <capability> when get_skill is not exposed. Create the skill in OpenWork Cloud as a private plugin, not in the workspace. For later steps, use share-plugin when the user wants a specific person or team to use a skill, and use add-to-marketplace or add-user-to-marketplace only when the user asks. Use a workspace-local skill only when the user explicitly requests one. Do not create both copies.";
|
|
53
53
|
export const OPENWORK_LOCAL_SKILL_AUTHORING_INSTRUCTION = "Skill creation: Local. Create or update a workspace-local skill only when the user requests one. Keep one skill in .opencode/skills/<skill-name>/SKILL.md, validate it, and re-read it after writing. Do not create a Cloud copy.";
|
|
@@ -49,6 +49,13 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
49
49
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
50
50
|
var openworkReadTransport = new AsyncLocalStorage;
|
|
51
51
|
|
|
52
|
+
// src/opencode-plugins/opencode-stop-fence-client.ts
|
|
53
|
+
async function assertSessionContinuation(post, input) {
|
|
54
|
+
if (!input.directory)
|
|
55
|
+
return;
|
|
56
|
+
await post("/experimental/session-stop-fence/check", input, AbortSignal.timeout(15000));
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
53
60
|
var exports_external = {};
|
|
54
61
|
__export(exports_external, {
|
|
@@ -13704,7 +13711,7 @@ function createV2ReadAdapter(read) {
|
|
|
13704
13711
|
return { all: [...catalog.values()], connected: [...catalog.keys()] };
|
|
13705
13712
|
}
|
|
13706
13713
|
if (url2.pathname === "/question")
|
|
13707
|
-
return items(await native("/api/form
|
|
13714
|
+
return items(await native("/api/form"));
|
|
13708
13715
|
const target = /^\/session\/([^/]+)(\/message|\/children)?$/.exec(url2.pathname);
|
|
13709
13716
|
if (!target)
|
|
13710
13717
|
throw new Error("Unsupported native engine read");
|
|
@@ -14356,12 +14363,16 @@ var automationExecutionTargetSchema = exports_external.enum(["desktop", "cloud"]
|
|
|
14356
14363
|
var AUTOMATION_MODEL_ATTENTION_CAPABILITY = "model_attention_v1";
|
|
14357
14364
|
var REMOTE_SESSION_DESKTOP_RUNNER_CAPABILITY = "remote_session_v1";
|
|
14358
14365
|
var REMOTE_SESSION_CONTROL_RUNNER_CAPABILITY = "remote_session_control_v1";
|
|
14366
|
+
var REMOTE_SESSION_ONLY_RUNNER_CAPABILITY = "remote_session_only_v1";
|
|
14367
|
+
var REMOTE_SESSION_RECOVERY_RUNNER_CAPABILITY = "remote_session_recovery_v1";
|
|
14359
14368
|
var automationDesktopRunnerCapabilitySchema = exports_external.enum([
|
|
14360
14369
|
AUTOMATION_MODEL_ATTENTION_CAPABILITY,
|
|
14361
14370
|
REMOTE_SESSION_DESKTOP_RUNNER_CAPABILITY,
|
|
14362
|
-
REMOTE_SESSION_CONTROL_RUNNER_CAPABILITY
|
|
14371
|
+
REMOTE_SESSION_CONTROL_RUNNER_CAPABILITY,
|
|
14372
|
+
REMOTE_SESSION_ONLY_RUNNER_CAPABILITY,
|
|
14373
|
+
REMOTE_SESSION_RECOVERY_RUNNER_CAPABILITY
|
|
14363
14374
|
]);
|
|
14364
|
-
var AUTOMATION_DESKTOP_RUNNER_CAPABILITY_LIMIT =
|
|
14375
|
+
var AUTOMATION_DESKTOP_RUNNER_CAPABILITY_LIMIT = 5;
|
|
14365
14376
|
var automationDesktopRunnerRegistrationSchema = exports_external.object({
|
|
14366
14377
|
runnerId: idSchema.min(8),
|
|
14367
14378
|
protocolVersion: exports_external.literal(1),
|
|
@@ -14568,6 +14579,7 @@ var remoteSessionTranscriptMessageSchema = exports_external.object({
|
|
|
14568
14579
|
error: remoteSessionCommandErrorSchema.nullable()
|
|
14569
14580
|
});
|
|
14570
14581
|
var remoteSessionReadResultSchema = exports_external.object({
|
|
14582
|
+
historyScope: exports_external.enum(["full", "context"]).optional(),
|
|
14571
14583
|
title: exports_external.string().max(240).nullable(),
|
|
14572
14584
|
status: remoteSessionStatusSchema,
|
|
14573
14585
|
waitingFor: remoteSessionWaitingForSchema.nullable(),
|
|
@@ -14756,6 +14768,20 @@ var automationListSchema = exports_external.object({
|
|
|
14756
14768
|
})),
|
|
14757
14769
|
nextCursor: exports_external.string().nullable()
|
|
14758
14770
|
}).meta({ ref: "AutomationList" });
|
|
14771
|
+
var AUTOMATION_RUN_RANGE_MAX_DAYS = 45;
|
|
14772
|
+
var automationRunRangeQuerySchema = exports_external.object({
|
|
14773
|
+
from: exports_external.coerce.number().int().nonnegative().describe("Inclusive lower bound, epoch milliseconds."),
|
|
14774
|
+
to: exports_external.coerce.number().int().positive().describe("Exclusive upper bound, epoch milliseconds."),
|
|
14775
|
+
cursor: exports_external.string().trim().min(1).max(160).optional().describe("nextCursor from the previous page."),
|
|
14776
|
+
limit: exports_external.coerce.number().int().min(1).max(500).optional().describe("Maximum runs to scan for this page (default 200).")
|
|
14777
|
+
}).refine((value) => value.to > value.from, { message: "to must be after from", path: ["to"] }).refine((value) => value.to - value.from <= AUTOMATION_RUN_RANGE_MAX_DAYS * 24 * 60 * 60 * 1000, {
|
|
14778
|
+
message: `The range may cover at most ${AUTOMATION_RUN_RANGE_MAX_DAYS} days`,
|
|
14779
|
+
path: ["to"]
|
|
14780
|
+
});
|
|
14781
|
+
var automationRunRangeSchema = exports_external.object({
|
|
14782
|
+
items: exports_external.array(automationRunSchema),
|
|
14783
|
+
nextCursor: exports_external.string().nullable()
|
|
14784
|
+
}).meta({ ref: "AutomationRunRange" });
|
|
14759
14785
|
var automationDetailSchema = exports_external.object({
|
|
14760
14786
|
automation: automationSchema,
|
|
14761
14787
|
revision: automationRevisionSchema,
|
|
@@ -14857,7 +14883,7 @@ var connectCatalogResponseSchema = exports_external.object({
|
|
|
14857
14883
|
instruction: exports_external.string()
|
|
14858
14884
|
}).passthrough();
|
|
14859
14885
|
var OPENWORK_GOOGLE_CONNECTION_INSTRUCTION = `Google Workspace uses OpenWork Cloud Connect only, with the member's Google connection managed by the Cloud backend. Do not set up local Google OAuth, request Google tokens, or offer a legacy Google extension or another provider stack. OpenWork Cloud readiness alone does not establish Google connection readiness. When the user requests Google setup or the requested operation is blocked by its connection, follow the exact live Cloud connection status action returned for that connection under the openwork-cloud server instructions. Never invent a connection status, connection id, or setup action; if no live status action is available, report that limitation.
|
|
14860
|
-
For Google Drive uploads and Gmail attachments, Cloud search results alone do not establish that upload is unavailable. Discover the native Gmail draft schema before declaring attachments unsupported: OpenWork fulfills its attachment paths through host file transport, preserving the selected connection. Draft creation does not send email; sending is a separate, permissioned operation that requires the user's authorization. For Google Drive uploads, when OpenWork host tools are exposed, first query extension.actions with extensionId openwork-cloud-uploads. Only if drive_upload_file is returned and the user authorizes the upload, execute that exact action through openwork_execute id extension.call with extensionId openwork-cloud-uploads and args containing path and optional folderId. This host action
|
|
14886
|
+
For Google Drive uploads and Gmail attachments, Cloud search results alone do not establish that upload is unavailable. Discover the native Gmail draft schema before declaring attachments unsupported: OpenWork fulfills its attachment paths through host file transport, preserving the selected connection. Draft creation does not send email; sending is a separate, permissioned operation that requires the user's authorization. For Google Drive uploads, when OpenWork host tools are exposed, first query extension.actions with extensionId openwork-cloud-uploads. Only if drive_upload_file is returned and the user authorizes the upload, execute that exact action through openwork_execute id extension.call with extensionId openwork-cloud-uploads and args containing path and optional folderId. This host action preserves bytes outside model context under authorized roots. Pass connectionId to preserve a requested Google Workspace account; omission uses the default. Files above 4 MiB use resumable transport when enabled for the organization; the host keeps the session URL out of model context. External clients with file transport may discover createGoogleDriveUploadSession and upload only the authorized file to its returned Google session URL without OAuth headers. That returned URL is a secret bearer credential (valid for up to a week): never print, share, log or persist it, and query the same session after an uncertain PUT instead of creating another session. If using the Gmail host action directly, only if gmail_create_draft_with_attachments is returned and the user authorizes draft creation, execute it with authorized paths and draft fields from its returned input schema, including the selected connectionId. It creates a reviewable draft, does not send email, and supports up to 10 files totaling 4 MiB. The bridge uses the Cloud backend member connection, not local Google credentials. Never load file bytes into model context or tool arguments, extract OAuth tokens, or improvise shell uploads as a fallback. A discovered createGoogleDriveUploadSession capability explicitly authorizes direct file transport to its returned session URL only after the user requests the upload. If host tools or the action are absent, including in external MCP-only clients, report that limitation rather than claiming this host upload route is available. Do not retry or switch routes after an uncertain result; verify whether the draft was created first.`;
|
|
14861
14887
|
var OPENWORK_EXTENSION_DISCOVERY_INSTRUCTION = `If the user asks for something you cannot do with obvious built-in tools, check OpenWork extensions before saying the capability is unavailable. Use openwork_query with id extension.actions to inspect available extension actions, then openwork_execute with id extension.call for the matching action. Do not use another route to bypass a failed connection; follow its connection guidance. ${OPENWORK_GOOGLE_CONNECTION_INSTRUCTION}`;
|
|
14862
14888
|
var OPENWORK_LOCAL_SKILL_AUTHORING_INSTRUCTION = "Skill creation: Local. Create or update a workspace-local skill only when the user requests one. Keep one skill in .opencode/skills/<skill-name>/SKILL.md, validate it, and re-read it after writing. Do not create a Cloud copy.";
|
|
14863
14889
|
var OPENWORK_ON_DEMAND_DISCOVERY_INSTRUCTION = `For remote skills and plugin instructions, read the exact known remote skill with openwork-cloud_get_skill by its name or capability, or list every available one with openwork-cloud_list_skills; when those tools are not exposed, execute the exact known remote skill capability with openwork-cloud_execute_capability, or discover it with openwork-cloud_search_capabilities, then execute the exact returned name and follow its instructions. Discover Workflows and Automations on demand; read live before reporting their current state. Follow the openwork-cloud server instructions when its tools are exposed. No Cloud readiness probe has been performed for this prompt; do not infer that Cloud is ready, disconnected, or unavailable.
|
|
@@ -16370,6 +16396,11 @@ var OpenWorkExtensionsPreview = async (factoryInput, _options, dependencies) =>
|
|
|
16370
16396
|
"tool.execute.before": fulfillGmailAttachments.before,
|
|
16371
16397
|
event: fulfillGmailAttachments.event,
|
|
16372
16398
|
dispose: fulfillGmailAttachments.dispose,
|
|
16399
|
+
"chat.params": async (input) => {
|
|
16400
|
+
if (!serverUrl2() || !serverToken2())
|
|
16401
|
+
return;
|
|
16402
|
+
await assertSessionContinuation(postJson, { directory: engineMcpStatusDirectory, sessionID: input.sessionID });
|
|
16403
|
+
},
|
|
16373
16404
|
"chat.headers": async (input, output) => {
|
|
16374
16405
|
if (input.model.providerID !== "openwork" && input.model.providerID !== "openwork-free")
|
|
16375
16406
|
return;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
12
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
20
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
+
for (let key of __getOwnPropNames(mod))
|
|
23
|
+
if (!__hasOwnProp.call(to, key))
|
|
24
|
+
__defProp(to, key, {
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
26
|
+
enumerable: true
|
|
27
|
+
});
|
|
28
|
+
if (canCache)
|
|
29
|
+
cache.set(mod, to);
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
+
var __returnValue = (v) => v;
|
|
34
|
+
function __exportSetter(name, newValue) {
|
|
35
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
+
}
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, {
|
|
40
|
+
get: all[name],
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
set: __exportSetter.bind(all, name)
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
47
|
+
|
|
48
|
+
// src/opencode-plugins/openwork-mcp-readiness-v2.ts
|
|
49
|
+
import { Context, Effect, Option, Schema, Scope } from "effect";
|
|
50
|
+
|
|
51
|
+
// src/opencode-v2-mcp-readiness.ts
|
|
52
|
+
var MCP_READINESS_RPC_ID = "openwork.mcp-readiness";
|
|
53
|
+
var mcpNamespace = (server) => server.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
54
|
+
var mcpToolId = (server, name) => `${mcpNamespace(server)}_${name.replace(/[^a-zA-Z0-9_-]/g, "_")}`;
|
|
55
|
+
function mcpBindingsReady(current, server, desired, previous) {
|
|
56
|
+
const published = new Set(current.filter((tool) => tool.options?.namespace === mcpNamespace(server)).map((tool) => tool.id));
|
|
57
|
+
const wanted = new Set(desired);
|
|
58
|
+
return desired.every((id) => published.has(id)) && previous.every((id) => wanted.has(id) || !published.has(id));
|
|
59
|
+
}
|
|
60
|
+
async function waitForMcpBindings(registry, server, desired, previous, signal) {
|
|
61
|
+
signal.throwIfAborted();
|
|
62
|
+
const current = await registry.list();
|
|
63
|
+
signal.throwIfAborted();
|
|
64
|
+
if (mcpBindingsReady(current, server, desired, previous))
|
|
65
|
+
return;
|
|
66
|
+
let closed = false;
|
|
67
|
+
let queued = false;
|
|
68
|
+
let registration;
|
|
69
|
+
let resolve = () => {};
|
|
70
|
+
let reject = () => {};
|
|
71
|
+
const ready = new Promise((accept, fail2) => {
|
|
72
|
+
resolve = accept;
|
|
73
|
+
reject = fail2;
|
|
74
|
+
});
|
|
75
|
+
ready.catch(() => {});
|
|
76
|
+
const fail = (error) => {
|
|
77
|
+
if (closed)
|
|
78
|
+
return;
|
|
79
|
+
closed = true;
|
|
80
|
+
reject(error);
|
|
81
|
+
};
|
|
82
|
+
const abort = () => fail(signal.reason ?? new Error("MCP readiness canceled"));
|
|
83
|
+
const observe = () => {
|
|
84
|
+
if (closed || queued)
|
|
85
|
+
return;
|
|
86
|
+
queued = true;
|
|
87
|
+
queueMicrotask(() => {
|
|
88
|
+
queued = false;
|
|
89
|
+
if (closed)
|
|
90
|
+
return;
|
|
91
|
+
registry.list().then((current2) => {
|
|
92
|
+
if (closed || !mcpBindingsReady(current2, server, desired, previous))
|
|
93
|
+
return;
|
|
94
|
+
closed = true;
|
|
95
|
+
resolve();
|
|
96
|
+
}, fail);
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
100
|
+
try {
|
|
101
|
+
signal.throwIfAborted();
|
|
102
|
+
registration = await registry.transform(observe);
|
|
103
|
+
await ready;
|
|
104
|
+
} finally {
|
|
105
|
+
closed = true;
|
|
106
|
+
signal.removeEventListener("abort", abort);
|
|
107
|
+
await registration?.dispose();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/opencode-plugins/openwork-mcp-readiness-v2.ts
|
|
112
|
+
class NativeMcp extends Context.Service()("@opencode/MCP") {
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
class NativeMcpTool extends Context.Service()("@opencode/McpTool") {
|
|
116
|
+
}
|
|
117
|
+
var serverSchema = { type: "string", minLength: 1 };
|
|
118
|
+
var toolsSchema = { type: "array", maxItems: 4096, items: { type: "string", minLength: 1 } };
|
|
119
|
+
var definition = {
|
|
120
|
+
id: MCP_READINESS_RPC_ID,
|
|
121
|
+
methods: {
|
|
122
|
+
catalog: {
|
|
123
|
+
input: { type: "object", properties: { server: serverSchema }, required: ["server"], additionalProperties: false },
|
|
124
|
+
output: { type: "object", properties: { tools: toolsSchema }, required: ["tools"], additionalProperties: false }
|
|
125
|
+
},
|
|
126
|
+
waitForTools: {
|
|
127
|
+
input: { type: "object", properties: { server: serverSchema }, required: ["server"], additionalProperties: false },
|
|
128
|
+
output: { type: "object", properties: { ready: { const: true } }, required: ["ready"], additionalProperties: false }
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
events: {}
|
|
132
|
+
};
|
|
133
|
+
var serverInput = Schema.Struct({ server: Schema.String });
|
|
134
|
+
var inputServer = (input) => Schema.decodeUnknownSync(serverInput)(input).server;
|
|
135
|
+
var nativeCatalog = Effect.gen(function* () {
|
|
136
|
+
const context = yield* Effect.context();
|
|
137
|
+
const mcp = Context.getOption(context, NativeMcp);
|
|
138
|
+
const source = Context.getOption(context, NativeMcpTool);
|
|
139
|
+
if (Option.isNone(mcp) || Option.isNone(source))
|
|
140
|
+
return yield* Effect.die(new Error("Native MCP readiness services are unavailable"));
|
|
141
|
+
yield* source.value.flush;
|
|
142
|
+
return mcp.value;
|
|
143
|
+
});
|
|
144
|
+
var waitForNativeMcpBindings = Effect.fn("OpenWorkMcp.waitForBindings")(function* (tool, server, desired, previous) {
|
|
145
|
+
const scope = yield* Scope.Scope;
|
|
146
|
+
yield* Effect.tryPromise({
|
|
147
|
+
try: (signal) => waitForMcpBindings({
|
|
148
|
+
list: () => Effect.runPromise(tool.list()),
|
|
149
|
+
transform: async (observe) => {
|
|
150
|
+
const registration = await Effect.runPromise(tool.transform(observe).pipe(Effect.provideService(Scope.Scope, scope)));
|
|
151
|
+
return { dispose: () => Effect.runPromise(registration.dispose) };
|
|
152
|
+
}
|
|
153
|
+
}, server, desired, previous, signal),
|
|
154
|
+
catch: (cause) => cause
|
|
155
|
+
});
|
|
156
|
+
}, Effect.orDie);
|
|
157
|
+
var openwork_mcp_readiness_v2_default = {
|
|
158
|
+
id: MCP_READINESS_RPC_ID,
|
|
159
|
+
effect: (ctx) => {
|
|
160
|
+
const supported = () => {
|
|
161
|
+
if (ctx.app.version !== "2.0.26")
|
|
162
|
+
throw new Error("Review the native MCP readiness bridge before changing the engine pin");
|
|
163
|
+
};
|
|
164
|
+
return ctx.rpc.register(definition, {
|
|
165
|
+
catalog: Effect.fn("OpenWorkMcp.catalog")(function* (input) {
|
|
166
|
+
supported();
|
|
167
|
+
const server = inputServer(input);
|
|
168
|
+
const mcp = yield* nativeCatalog;
|
|
169
|
+
const discovered = (yield* mcp.tools()).filter((tool) => tool.server === server).map((tool) => mcpToolId(server, tool.name));
|
|
170
|
+
const published = (yield* ctx.tool.list()).filter((tool) => tool.options?.namespace === mcpNamespace(server)).map((tool) => tool.id);
|
|
171
|
+
return { tools: [...new Set([...discovered, ...published])].sort() };
|
|
172
|
+
}),
|
|
173
|
+
waitForTools: Effect.fn("OpenWorkMcp.waitForTools")(function* (input) {
|
|
174
|
+
supported();
|
|
175
|
+
const server = inputServer(input);
|
|
176
|
+
const mcp = yield* nativeCatalog;
|
|
177
|
+
yield* ctx.tool.reload();
|
|
178
|
+
const previous = (yield* ctx.tool.list()).filter((tool) => tool.options?.namespace === mcpNamespace(server)).map((tool) => tool.id);
|
|
179
|
+
const target = (yield* mcp.servers()).find((item) => item.name === server);
|
|
180
|
+
if (target && !["connected", "disabled"].includes(target.status.status)) {
|
|
181
|
+
return yield* Effect.die(new Error(`MCP ${server} is ${target.status.status}, not executable`));
|
|
182
|
+
}
|
|
183
|
+
const desired = (yield* mcp.tools()).filter((tool) => tool.server === server).map((tool) => mcpToolId(server, tool.name));
|
|
184
|
+
yield* waitForNativeMcpBindings(ctx.tool, server, desired, previous).pipe(Effect.scoped);
|
|
185
|
+
return { ready: true };
|
|
186
|
+
})
|
|
187
|
+
}).pipe(Effect.asVoid);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
export {
|
|
191
|
+
openwork_mcp_readiness_v2_default as default
|
|
192
|
+
};
|