@xopcai/xopc 0.0.341 → 0.0.342
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BLPcg31f.js → agent-avatar-dicebear-BHTH7Hzp.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C70FWAHE.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BmYHMIPz.js +1 -0
- package/dist/gateway/static/root/assets/agents-BqIiqYmt.js +70 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-9hEICfl6.js → agents-admin-api-Op3XAo56.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D1t5R8Nw.js → app-management-settings-panel-DrvjGsNn.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-AEXbf39m.js → appearance-settings-CdYUxeW5.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DmDgodab.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Dn0-Buj5.js → archive-plugin-Dvl6N_oW.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BSra2qfj.js → automations-page-7eSAb9Fz.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BXLmMZKj.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Dot1Il-Y.js → binary-plugins-B6fBdtZm.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CDcC8LCq.js → block-editor-DnMibNrZ.js} +29 -29
- package/dist/gateway/static/root/assets/{browser-automation-inputs-cnvnVaXG.js → browser-automation-inputs-CX5HElxM.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CAUS0Ri8.js → browser-automations-page-fTkFKnIa.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CGF08LW0.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-CE5NAPxj.js → capabilities-DSg8th5w.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CADE2fFw.js → capabilities-page-CBQUqwHq.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BIXA7-_a.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-BJNo9stz.js → capability-header-actions-UQmVc6ea.js} +1 -1
- package/dist/gateway/static/root/assets/channels-Cwqvvnpy.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-kdmj_0as.js → chat-terminal-dock-81LOYomp.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-0eV1PD7w.js → computer-settings-page-DffgMAWa.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-CfoHye-I.js → connector-service-page-DjKxEmO4.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-w-DTg9X-.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-Cos4-ejW.js → date-picker--gtRUEYY.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BPwj_jHy.js → dependency-picker-OM5MJcAI.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DEuqqeV7.js → desktop-pet-Ck5QncbS.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CjBMcLuI.js → desktop-pet-settings-Be9YZ7dP.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CG2bKfYq.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CcGJupzB.js → directory-picker-path-field-CS-rIYvx.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BK0gkhEA.js → extension-debug-page-yeovsc29.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BjfzKvd3.js → extension-page-BGXlLDIK.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-xqe5mUAc.js → extension-settings-page-1T5JWoRQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BdBCP9uF.js → gateway-config-swr-D_oNkPwY.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-MiR9DJIf.js → gateway-realtime-B6tO02l7.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DA3d45t6.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DXaGFC4E.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B8XTENLw.js → gateway-startup-retry-DVo2M1Ed.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Be8_HeNB.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DufKsb8h.js → image-generation-api-DjyB_9yW.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BMiS5gUB.js → imports-page-DHoZ6dWz.js} +1 -1
- package/dist/gateway/static/root/assets/index-Bbo9EJvY.js +106 -0
- package/dist/gateway/static/root/assets/index-CRfBe1x4.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BTOmULWn.js → keyboard-shortcuts-settings-DOloJmHM.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-EwMSmvUp.js → local-app-workbench-page-DzvhfcOp.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-gicbE8bt.js → local-apps-page-BcZxG7Sm.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Bwxng2U0.js → local-session-drafts-yZc4OIxG.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-GbEE8D1I.js → locale-store-CCYf4Qxv.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-jPeHW3s9.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-CcEPCLdK.js → management-settings-Dal0gIED.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DtEVIWB3.js → markdown-view-gPnGW4pR.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-1hJztT1f.js → media-plugins-BqXBeW_0.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-DvcSrOiI.js → messages-6j-AkWdj.js} +2 -2
- package/dist/gateway/static/root/assets/note-detail-panel-Dnd6FEft.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-DWMxG17u.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-yJUYnJxT.js → page-context-capture-button-CblMYGvM.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-BM7TwlkM.js → page-tabs-BQLuzP2G.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-C8ewCNje.js → preview-open-alternatives-bAtTMiqI.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CRx7HKvw.js → product-open-page-BiZx2t3O.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BeCtOOvf.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DVFst1Zv.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DTHBAr2T.js → registry-api-DGRLQQ_H.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-xlX73tyv.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DOB15s5m.js → runtime-tools-settings-panel-BL43kX94.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-CHIai08O.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-DchPlBrp.js → schema-form-BpTqO-iv.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-Bb2zLVED.js → session-api-BXyyrPIk.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-9M-yBtb4.js → session-manager-OBkrb3ow.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DEcTMG-C.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DXWLgEoV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-UlkZDGLU.js → settings-form-section-DTsRLeno.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-PYnr6mlX.js → settings-page-DXuAkBPd.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Di0Ed3Y_.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-B0jqVHIE.js → share-preview-page-kKdqUjj2.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Deazms2V.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-DgwnV477.js → skill-api-BYnK8QTQ.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B6GZUBNC.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BAEDw1ez.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-eEK7Mm70.js → system-settings-panel-DbULjt1I.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-Dwa6P2yd.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-Cty9Iw8k.js → tunnel-api-CEoNfQtH.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-C3ZO6KNv.js → usage-page-BFFftzL6.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-EEUVQbRp.js → use-autosave-qKVzK824.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-Cb9EhncT.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DTmACeYO.js → voice-api-key-field-DUg1IyGa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DIBe0AZN.js → voice-config-api-Dh_RxWat.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-C9guuKGB.js → work-discovery-overlay-C8RS5pAe.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BjGFnWIF.js → workflow-run-setup-panel-FkVKYHxF.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CXTfjyCR.js +6 -0
- package/dist/gateway/static/root/index.html +15 -15
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/mobile-user-understanding.js +9 -0
- package/dist/src/agent/agent-manager.js +5 -5
- package/dist/src/agent/background-review/run-background-review.js +2 -2
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +2 -2
- package/dist/src/agent/service.js +4 -4
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +25 -2
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +9 -3
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/extension-agent-plugin.js +3 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/extension-cli-register.js +2 -0
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +1 -0
- package/dist/src/config/schema.js +2 -1
- package/dist/src/extensions/agent-plugins/inventory.d.ts +37 -13
- package/dist/src/extensions/agent-plugins/inventory.js +1 -0
- package/dist/src/extensions/agent-plugins/sources.d.ts +13 -1
- package/dist/src/extensions/agent-plugins/sources.js +17 -2
- package/dist/src/extensions/agent-plugins/store.d.ts +46 -0
- package/dist/src/extensions/agent-plugins/store.js +19 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/marketplace.d.ts +2 -1
- package/dist/src/extensions/marketplace.js +6 -5
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +6 -4
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +62 -4
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/marketplace-service.d.ts +1 -1
- package/dist/src/gateway/service/marketplace-service.js +3 -2
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +3 -3
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/user-context/config.d.ts +2 -0
- package/dist/src/user-context/config.js +2 -0
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/repository.d.ts +2 -0
- package/dist/src/user-model/repository.js +18 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C6lTld5j.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-C4tkmkNX.js +0 -1
- package/dist/gateway/static/root/assets/agents-CfnoU72e.js +0 -70
- package/dist/gateway/static/root/assets/apps-page-BBlltMmy.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-wN4UZK_t.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-DXgm5Ckn.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BVA9R5lZ.js +0 -8
- package/dist/gateway/static/root/assets/channels-Do21a722.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Db1Y7qF-.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-BsqwXeyv.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Cj-byMay.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-C07o7J3o.js +0 -1
- package/dist/gateway/static/root/assets/home-page-a92Q8Na2.js +0 -1
- package/dist/gateway/static/root/assets/index-Bd7mDZFV.css +0 -1
- package/dist/gateway/static/root/assets/index-CJRGgrw3.js +0 -106
- package/dist/gateway/static/root/assets/logs-page-BBxTvrXn.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-panel-LcJBf6gK.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BaTCRZLb.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CSh8kKw8.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DYwOgWaC.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B8ApF5IX.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DqhxjqAy.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-BcnoQbIP.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cedcl54F.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-xp2jQuPa.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BnRfPQfC.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-zai_s2F8.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BYAE6Al2.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-BK82L-MC.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CT_RNLbB.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-B1uzFMKj.js +0 -6
|
@@ -37,15 +37,30 @@ function withAgentPluginArchive(buffer, fn) {
|
|
|
37
37
|
async function withAgentPluginSource(source, config, fn) {
|
|
38
38
|
if (!source.startsWith("https://") && !source.startsWith("store:")) return fn(source);
|
|
39
39
|
let buffer;
|
|
40
|
+
let provenance;
|
|
40
41
|
if (source.startsWith("store:")) {
|
|
41
|
-
const { resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, downloadExtensionStoreZipBuffer, verifyStoreArtifactSha256 } = await import("../../agent/skills/marketplace/adapters/store/store-api-client.js");
|
|
42
|
+
const { fetchMarketplacePackageDetail, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, downloadExtensionStoreZipBuffer, verifyStoreArtifactSha256 } = await import("../../agent/skills/marketplace/adapters/store/store-api-client.js");
|
|
42
43
|
const spec = source.slice(6);
|
|
43
44
|
const match = /^([a-z0-9.-]+)(?:@([^/]+))?$/.exec(spec);
|
|
44
45
|
if (!match) throw new Error("Expected store:<package>[@version]");
|
|
45
46
|
const base = resolveExtensionsStoreBaseUrl(config);
|
|
47
|
+
const detail = await fetchMarketplacePackageDetail(base, match[1]);
|
|
48
|
+
if (detail.type !== "plugin" && detail.type !== "extension") throw new Error(`Store package has unsupported type: ${detail.type}`);
|
|
46
49
|
const artifact = await resolveExtensionZipDownloadUrl(base, match[1], match[2]);
|
|
47
50
|
buffer = await downloadExtensionStoreZipBuffer(base, artifact.downloadUrl);
|
|
48
51
|
verifyStoreArtifactSha256(buffer, artifact.sha256);
|
|
52
|
+
provenance = {
|
|
53
|
+
kind: "store",
|
|
54
|
+
packageName: match[1],
|
|
55
|
+
packageType: detail.type,
|
|
56
|
+
version: artifact.version,
|
|
57
|
+
sha256: artifact.sha256,
|
|
58
|
+
...detail.publisher?.verification ? { publisherVerification: detail.publisher.verification } : {},
|
|
59
|
+
...detail.publisher?.sourceRepository ? { sourceRepository: detail.publisher.sourceRepository } : {},
|
|
60
|
+
...artifact.sourceCommit ? { sourceCommit: artifact.sourceCommit } : {},
|
|
61
|
+
...artifact.artifactFormat ? { artifactFormat: artifact.artifactFormat } : {},
|
|
62
|
+
...artifact.riskTier ? { riskTier: artifact.riskTier } : {}
|
|
63
|
+
};
|
|
49
64
|
} else {
|
|
50
65
|
const url = new URL(source);
|
|
51
66
|
const response = await createPluginHttpFetch(url, {})(url, { signal: AbortSignal.timeout(3e4) });
|
|
@@ -66,7 +81,7 @@ async function withAgentPluginSource(source, config, fn) {
|
|
|
66
81
|
}
|
|
67
82
|
buffer = Buffer.concat(chunks);
|
|
68
83
|
}
|
|
69
|
-
return withAgentPluginArchive(buffer, fn);
|
|
84
|
+
return withAgentPluginArchive(buffer, (local) => fn(local, provenance));
|
|
70
85
|
}
|
|
71
86
|
//#endregion
|
|
72
87
|
export { isAgentPluginArchive, withAgentPluginArchive, withAgentPluginSource };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type PluginInspection } from './validation.js';
|
|
3
|
+
import type { AgentPluginSourceProvenance } from './sources.js';
|
|
3
4
|
declare const receiptSchema: z.ZodObject<{
|
|
4
5
|
id: z.ZodString;
|
|
5
6
|
revision: z.ZodString;
|
|
@@ -8,6 +9,28 @@ declare const receiptSchema: z.ZodObject<{
|
|
|
8
9
|
enabled: z.ZodBoolean;
|
|
9
10
|
integrity: z.ZodString;
|
|
10
11
|
capabilities: z.ZodArray<z.ZodString>;
|
|
12
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
kind: z.ZodLiteral<"store">;
|
|
14
|
+
packageName: z.ZodString;
|
|
15
|
+
packageType: z.ZodEnum<{
|
|
16
|
+
extension: "extension";
|
|
17
|
+
plugin: "plugin";
|
|
18
|
+
}>;
|
|
19
|
+
version: z.ZodString;
|
|
20
|
+
sha256: z.ZodString;
|
|
21
|
+
publisherVerification: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
verified: "verified";
|
|
23
|
+
community: "community";
|
|
24
|
+
}>>;
|
|
25
|
+
sourceRepository: z.ZodOptional<z.ZodString>;
|
|
26
|
+
sourceCommit: z.ZodOptional<z.ZodString>;
|
|
27
|
+
artifactFormat: z.ZodOptional<z.ZodString>;
|
|
28
|
+
riskTier: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
content: "content";
|
|
30
|
+
network: "network";
|
|
31
|
+
"local-exec": "local-exec";
|
|
32
|
+
}>>;
|
|
33
|
+
}, z.core.$strict>>;
|
|
11
34
|
previous: z.ZodOptional<z.ZodObject<{
|
|
12
35
|
id: z.ZodString;
|
|
13
36
|
revision: z.ZodString;
|
|
@@ -16,6 +39,28 @@ declare const receiptSchema: z.ZodObject<{
|
|
|
16
39
|
enabled: z.ZodBoolean;
|
|
17
40
|
integrity: z.ZodString;
|
|
18
41
|
capabilities: z.ZodArray<z.ZodString>;
|
|
42
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
kind: z.ZodLiteral<"store">;
|
|
44
|
+
packageName: z.ZodString;
|
|
45
|
+
packageType: z.ZodEnum<{
|
|
46
|
+
extension: "extension";
|
|
47
|
+
plugin: "plugin";
|
|
48
|
+
}>;
|
|
49
|
+
version: z.ZodString;
|
|
50
|
+
sha256: z.ZodString;
|
|
51
|
+
publisherVerification: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
verified: "verified";
|
|
53
|
+
community: "community";
|
|
54
|
+
}>>;
|
|
55
|
+
sourceRepository: z.ZodOptional<z.ZodString>;
|
|
56
|
+
sourceCommit: z.ZodOptional<z.ZodString>;
|
|
57
|
+
artifactFormat: z.ZodOptional<z.ZodString>;
|
|
58
|
+
riskTier: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
content: "content";
|
|
60
|
+
network: "network";
|
|
61
|
+
"local-exec": "local-exec";
|
|
62
|
+
}>>;
|
|
63
|
+
}, z.core.$strict>>;
|
|
19
64
|
}, z.core.$strip>>;
|
|
20
65
|
}, z.core.$strip>;
|
|
21
66
|
export type PluginReceipt = z.infer<typeof receiptSchema>;
|
|
@@ -52,6 +97,7 @@ export declare class AgentPluginStore {
|
|
|
52
97
|
replace?: boolean;
|
|
53
98
|
expectedId?: string;
|
|
54
99
|
sourceLabel?: string;
|
|
100
|
+
provenance?: AgentPluginSourceProvenance;
|
|
55
101
|
}): InstalledAgentPlugin;
|
|
56
102
|
setEnabled(id: string, enabled: boolean): InstalledAgentPlugin;
|
|
57
103
|
rollback(id: string): InstalledAgentPlugin;
|
|
@@ -16,6 +16,22 @@ import lockfile from "proper-lockfile";
|
|
|
16
16
|
init_paths_state();
|
|
17
17
|
init_write_file_atomic();
|
|
18
18
|
init_logger();
|
|
19
|
+
const provenanceSchema = z.strictObject({
|
|
20
|
+
kind: z.literal("store"),
|
|
21
|
+
packageName: pluginName,
|
|
22
|
+
packageType: z.enum(["plugin", "extension"]),
|
|
23
|
+
version: z.string().min(1),
|
|
24
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/),
|
|
25
|
+
publisherVerification: z.enum(["community", "verified"]).optional(),
|
|
26
|
+
sourceRepository: z.string().url().optional(),
|
|
27
|
+
sourceCommit: z.string().optional(),
|
|
28
|
+
artifactFormat: z.string().optional(),
|
|
29
|
+
riskTier: z.enum([
|
|
30
|
+
"content",
|
|
31
|
+
"network",
|
|
32
|
+
"local-exec"
|
|
33
|
+
]).optional()
|
|
34
|
+
});
|
|
19
35
|
const receiptFields = z.object({
|
|
20
36
|
id: pluginName,
|
|
21
37
|
revision: z.string().uuid(),
|
|
@@ -23,7 +39,8 @@ const receiptFields = z.object({
|
|
|
23
39
|
installedAt: z.string(),
|
|
24
40
|
enabled: z.boolean(),
|
|
25
41
|
integrity: z.string(),
|
|
26
|
-
capabilities: z.array(z.string())
|
|
42
|
+
capabilities: z.array(z.string()),
|
|
43
|
+
provenance: provenanceSchema.optional()
|
|
27
44
|
});
|
|
28
45
|
const receiptSchema = receiptFields.extend({ previous: receiptFields.optional() });
|
|
29
46
|
const log = createLogger("AgentPlugins");
|
|
@@ -189,6 +206,7 @@ var AgentPluginStore = class {
|
|
|
189
206
|
enabled: current?.enabled ?? false,
|
|
190
207
|
integrity,
|
|
191
208
|
capabilities: installed.capabilities,
|
|
209
|
+
...options.provenance ? { provenance: provenanceSchema.parse(options.provenance) } : {},
|
|
192
210
|
previous: current ? receiptFields.parse(current) : void 0
|
|
193
211
|
});
|
|
194
212
|
} catch (error) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
2
2
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import yaml from "js-yaml";
|
|
5
4
|
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
5
|
+
import yaml from "js-yaml";
|
|
6
6
|
//#region src/extensions/agent-plugins/validation.ts
|
|
7
7
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
8
8
|
const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Extension marketplace catalog from xopc-store (`
|
|
2
|
+
* Extension marketplace catalog from xopc-store (portable `plugin` and native `extension` packages).
|
|
3
3
|
* Base URL: `XOPC_SKILLS_STORE_URL` → `gateway.skillsStoreBaseUrl` → `https://store.xopc.ai`.
|
|
4
4
|
*/
|
|
5
5
|
export interface RegistryEntry {
|
|
@@ -17,6 +17,7 @@ export interface RegistryEntry {
|
|
|
17
17
|
iconUrl: string;
|
|
18
18
|
iconSha256: string;
|
|
19
19
|
};
|
|
20
|
+
packageType?: 'plugin' | 'extension';
|
|
20
21
|
}
|
|
21
22
|
export interface ExtensionRegistryFile {
|
|
22
23
|
version: number;
|
|
@@ -4,7 +4,7 @@ import { init_resolution, resolveConnectedPlatformEndpoint } from "../platform/r
|
|
|
4
4
|
import { loadConfig } from "../config/loader.js";
|
|
5
5
|
//#region src/extensions/marketplace.ts
|
|
6
6
|
/**
|
|
7
|
-
* Extension marketplace catalog from xopc-store (`
|
|
7
|
+
* Extension marketplace catalog from xopc-store (portable `plugin` and native `extension` packages).
|
|
8
8
|
* Base URL: `XOPC_SKILLS_STORE_URL` → `gateway.skillsStoreBaseUrl` → `https://store.xopc.ai`.
|
|
9
9
|
*/
|
|
10
10
|
init_logger();
|
|
@@ -42,8 +42,8 @@ function normalizeStoreBaseUrl() {
|
|
|
42
42
|
function titleCaseSlug(slug) {
|
|
43
43
|
return slug.split("-").filter(Boolean).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
|
|
44
44
|
}
|
|
45
|
-
async function
|
|
46
|
-
const listUrl = `${normalizeStoreBaseUrl()}/api/v1/packages?type
|
|
45
|
+
async function fetchPackageCatalogFromStore(packageType) {
|
|
46
|
+
const listUrl = `${normalizeStoreBaseUrl()}/api/v1/packages?type=${packageType}&pageSize=200`;
|
|
47
47
|
try {
|
|
48
48
|
const res = await fetch(listUrl, { signal: AbortSignal.timeout(2e4) });
|
|
49
49
|
if (!res.ok) {
|
|
@@ -71,7 +71,8 @@ async function fetchExtensionCatalogFromStore() {
|
|
|
71
71
|
iconUrl: it.branding.iconUrl,
|
|
72
72
|
iconSha256: it.branding.iconSha256
|
|
73
73
|
} } : {},
|
|
74
|
-
verified: author === "xopcai"
|
|
74
|
+
verified: it.publisher?.verification === "verified" || author === "xopcai",
|
|
75
|
+
packageType
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
return extensions.length > 0 ? extensions : null;
|
|
@@ -87,7 +88,7 @@ async function fetchRegistry(forceRefresh = false) {
|
|
|
87
88
|
const now = Date.now();
|
|
88
89
|
if (!forceRefresh && cache && now - cache.at < CACHE_TTL_MS) return cache.data;
|
|
89
90
|
const storeBase = normalizeStoreBaseUrl();
|
|
90
|
-
const fromStore = await
|
|
91
|
+
const fromStore = (await Promise.all([fetchPackageCatalogFromStore("plugin"), fetchPackageCatalogFromStore("extension")])).flatMap((items) => items ?? []);
|
|
91
92
|
if (fromStore && fromStore.length > 0) {
|
|
92
93
|
const data = {
|
|
93
94
|
version: 1,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId, validateAgentIdForNewAgent } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath } from "../agent/agent-scope.js";
|
|
4
|
+
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
5
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
5
6
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
6
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
7
|
-
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
8
7
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
8
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
10
10
|
import { join, resolve } from "node:path";
|
|
11
11
|
import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
3
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
4
|
+
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
5
5
|
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
@@ -214,6 +214,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
214
214
|
enabled: boolean;
|
|
215
215
|
writePolicy: "allow" | "deny";
|
|
216
216
|
sensitiveWritePolicy: "allow" | "confirm" | "deny";
|
|
217
|
+
showMemoryReferences: boolean;
|
|
217
218
|
processingPolicy: "local_only" | "remote_allowed";
|
|
218
219
|
extraction: {
|
|
219
220
|
reviewIntervalTurns: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
3
|
+
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
3
4
|
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
5
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
5
|
-
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
6
6
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
7
7
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
8
8
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
@@ -33,9 +33,10 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
33
33
|
app.post("/api/extensions/install", deps.strictRateLimitMiddleware, async (c) => {
|
|
34
34
|
try {
|
|
35
35
|
const body = sourceBody.parse(await c.req.json());
|
|
36
|
-
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source) => store.install(source, {
|
|
36
|
+
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source, provenance) => store.install(source, {
|
|
37
37
|
reviewHash: body.reviewHash,
|
|
38
|
-
sourceLabel: body.source
|
|
38
|
+
sourceLabel: body.source,
|
|
39
|
+
provenance
|
|
39
40
|
}));
|
|
40
41
|
await refresh();
|
|
41
42
|
return c.json({
|
|
@@ -85,11 +86,12 @@ function registerAgentPluginRoutes(app, deps) {
|
|
|
85
86
|
app.post("/api/extensions/agent-plugins/:id/update", deps.strictRateLimitMiddleware, async (c) => {
|
|
86
87
|
try {
|
|
87
88
|
const body = sourceBody.parse(await c.req.json());
|
|
88
|
-
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source) => store.install(source, {
|
|
89
|
+
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source, provenance) => store.install(source, {
|
|
89
90
|
reviewHash: body.reviewHash,
|
|
90
91
|
replace: true,
|
|
91
92
|
expectedId: c.req.param("id"),
|
|
92
|
-
sourceLabel: body.source
|
|
93
|
+
sourceLabel: body.source,
|
|
94
|
+
provenance
|
|
93
95
|
}));
|
|
94
96
|
await refresh();
|
|
95
97
|
return c.json({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
-
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
3
1
|
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
2
|
+
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
4
3
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
5
4
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
6
5
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
7
6
|
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
7
|
+
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
8
8
|
import { mergeGatewaySkillsMarketplacePatch, mergeSessionConfigPatch, mergeUpdateConfigPatch } from "../../../../config/web-patch.js";
|
|
9
9
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../../../auth.js";
|
|
10
10
|
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveEffectiveAgentConfigForAgent } from "../../../config/agent-profile.js";
|
|
1
2
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
3
|
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
3
4
|
import { computerModelProfile, init_model_policy, isDedicatedComputerModel } from "../../../computer/model-policy.js";
|
|
@@ -8,7 +9,6 @@ import { CredentialResolver, init_credentials } from "../../../auth/credentials.
|
|
|
8
9
|
import "../../../providers/constants.js";
|
|
9
10
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
10
11
|
import { PROVIDER_META, getAllModels, getAllProviders, getAvailableModels, getProviderAuthState, init_providers, isProviderConfigured, isProviderConfiguredSync } from "../../../providers/index.js";
|
|
11
|
-
import { resolveEffectiveAgentConfigForAgent } from "../../../config/agent-profile.js";
|
|
12
12
|
import { buildCapabilityPlansForConfig } from "../../../capabilities/readiness/from-config.js";
|
|
13
13
|
import "../../../capabilities/readiness/index.js";
|
|
14
14
|
import { getImageGenerationProvider, reloadImageGenerationProviders, resolveImageGenerationCredentialMode } from "../../../agent/image/generation/provider-registry.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NoteDeleteOutputSchema, NoteGetOutputSchema, ProductReadContracts } from "../../../../packages/gateway-contract/src/capabilities.js";
|
|
2
2
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
4
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
3
|
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
6
4
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
7
7
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
8
8
|
import { getShareStore } from "../../../share/share-store.js";
|
|
9
9
|
import { resolveShareUrl } from "../../../share/share-url.js";
|
|
@@ -7,12 +7,12 @@ import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript
|
|
|
7
7
|
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
8
8
|
import { ActivityService } from "../../../activity/service.js";
|
|
9
9
|
import "../../../activity/index.js";
|
|
10
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
11
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
12
10
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
13
11
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
14
12
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
15
13
|
import "../../../knowledge-memory/index.js";
|
|
14
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
15
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
16
16
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
17
17
|
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
18
18
|
import { ProjectDeletionBlockedError, ProjectWorkspaceInUseError } from "../../../projects/project-service.js";
|
|
@@ -4,9 +4,9 @@ import { browserPageContextsInputSchema } from "../../../../packages/gateway-con
|
|
|
4
4
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
5
5
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
6
6
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
7
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
7
8
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
8
9
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
9
|
-
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
10
10
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
11
11
|
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
12
12
|
import { parseSlashCommand } from "../../../chat-commands/command-parse.js";
|
|
@@ -5,9 +5,9 @@ import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
|
5
5
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
6
6
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
7
7
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
8
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
8
9
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
9
10
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
10
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
11
11
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
12
12
|
import { TaskDeleteOutputSchema } from "../../../tasks/capabilities/management.js";
|
|
13
13
|
import { TaskMutationOutputSchema } from "../../../tasks/capabilities/write.js";
|
|
@@ -2,7 +2,7 @@ import { init_transaction, runSqliteWriteTransaction } from "../../../storage/sq
|
|
|
2
2
|
import { createCollaborationRule, getCollaborationRule, init_collaboration_rule_repository, listCollaborationRules, setCollaborationRuleStatus } from "../../../storage/sqlite/collaboration-rule-repository.js";
|
|
3
3
|
import { KnowledgeReviewConflictError, deleteKnowledgeItem, getKnowledgeItem, listKnowledgeItems, reviewKnowledgeItem, searchKnowledgeItems } from "../../../knowledge-memory/repository.js";
|
|
4
4
|
import "../../../knowledge-memory/index.js";
|
|
5
|
-
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../../user-model/repository.js";
|
|
5
|
+
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../../user-model/repository.js";
|
|
6
6
|
import { listActionRuleSuggestions } from "../../../user-model/action-rule-suggestions.js";
|
|
7
7
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "../../../user-model/goals.js";
|
|
8
8
|
import { listUserAssertionEdges, listUserModelObservations } from "../../../user-model/observation-repository.js";
|
|
@@ -210,7 +210,16 @@ function decodeMobileCursor(value) {
|
|
|
210
210
|
}
|
|
211
211
|
function registerUserModelRoutes(authenticated, deps) {
|
|
212
212
|
const write = deps.strictRateLimitMiddleware;
|
|
213
|
-
|
|
213
|
+
const userContextConfig = () => deps.service.currentConfig.userContext;
|
|
214
|
+
const memorySettings = () => {
|
|
215
|
+
const userContext = userContextConfig();
|
|
216
|
+
return {
|
|
217
|
+
memoryEnabled: userContext.enabled && userContext.userModel.enabled && userContext.knowledgeMemory.enabled,
|
|
218
|
+
showMemoryReferences: userContext.userModel.showMemoryReferences,
|
|
219
|
+
sensitiveWritePolicy: userContext.userModel.sensitiveWritePolicy
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
const snapshot = () => {
|
|
214
223
|
const rawAssertions = listUserAssertions({
|
|
215
224
|
statuses: [
|
|
216
225
|
"active",
|
|
@@ -239,7 +248,7 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
239
248
|
...source.lastCollectedAt ? { lastCollectedAt: source.lastCollectedAt } : {},
|
|
240
249
|
consent: getActiveUnderstandingConsent(source.id)
|
|
241
250
|
}));
|
|
242
|
-
return
|
|
251
|
+
return {
|
|
243
252
|
assertions,
|
|
244
253
|
assertionEdges: listUserAssertionEdges(assertions.map((item) => item.id)),
|
|
245
254
|
observations: listUserModelObservations({ limit: 500 }),
|
|
@@ -252,6 +261,7 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
252
261
|
profile,
|
|
253
262
|
sources,
|
|
254
263
|
suggestedCallName: profile.callName || machineCallName(),
|
|
264
|
+
settings: memorySettings(),
|
|
255
265
|
counts: {
|
|
256
266
|
activeAssertions: assertions.filter((item) => item.status === "active").length,
|
|
257
267
|
reviewAssertions: assertions.filter((item) => item.status === "needs_review" || item.status === "conflicted").length,
|
|
@@ -259,7 +269,40 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
259
269
|
activePriorities: priorities.filter((item) => item.status === "active").length,
|
|
260
270
|
activeKnowledge: knowledge.filter((item) => item.status === "active").length
|
|
261
271
|
}
|
|
262
|
-
}
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
authenticated.get("/api/user-model", (c) => c.json(snapshot()));
|
|
275
|
+
authenticated.patch("/api/user-model/settings", write, async (c) => {
|
|
276
|
+
const input = await body(c);
|
|
277
|
+
const memoryEnabled = input?.memoryEnabled;
|
|
278
|
+
const showMemoryReferences = input?.showMemoryReferences;
|
|
279
|
+
const sensitiveWritePolicy = input?.sensitiveWritePolicy;
|
|
280
|
+
if (!input || memoryEnabled !== void 0 && typeof memoryEnabled !== "boolean" || showMemoryReferences !== void 0 && typeof showMemoryReferences !== "boolean" || sensitiveWritePolicy !== void 0 && ![
|
|
281
|
+
"deny",
|
|
282
|
+
"confirm",
|
|
283
|
+
"allow"
|
|
284
|
+
].includes(String(sensitiveWritePolicy)) || memoryEnabled === void 0 && showMemoryReferences === void 0 && sensitiveWritePolicy === void 0) return c.json({ error: "At least one valid memory setting is required" }, 400);
|
|
285
|
+
const nextConfig = structuredClone(deps.service.currentConfig);
|
|
286
|
+
if (typeof memoryEnabled === "boolean") {
|
|
287
|
+
nextConfig.userContext.userModel.enabled = memoryEnabled;
|
|
288
|
+
nextConfig.userContext.knowledgeMemory.enabled = memoryEnabled;
|
|
289
|
+
}
|
|
290
|
+
if (typeof showMemoryReferences === "boolean") nextConfig.userContext.userModel.showMemoryReferences = showMemoryReferences;
|
|
291
|
+
if (sensitiveWritePolicy === "deny" || sensitiveWritePolicy === "confirm" || sensitiveWritePolicy === "allow") nextConfig.userContext.userModel.sensitiveWritePolicy = sensitiveWritePolicy;
|
|
292
|
+
const result = await deps.service.saveConfig(nextConfig);
|
|
293
|
+
return result.saved ? c.json({ settings: memorySettings() }) : c.json({ error: result.error ?? "Failed to save memory settings" }, 500);
|
|
294
|
+
});
|
|
295
|
+
authenticated.get("/api/user-model/export", (c) => {
|
|
296
|
+
const exportedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
297
|
+
const payload = {
|
|
298
|
+
format: "xopc-user-memory",
|
|
299
|
+
version: 1,
|
|
300
|
+
exportedAt,
|
|
301
|
+
data: snapshot()
|
|
302
|
+
};
|
|
303
|
+
c.header("Content-Disposition", `attachment; filename="xopc-memory-${exportedAt.slice(0, 10)}.json"`);
|
|
304
|
+
c.header("Content-Type", "application/json; charset=utf-8");
|
|
305
|
+
return c.body(`${JSON.stringify(payload, null, 2)}\n`);
|
|
263
306
|
});
|
|
264
307
|
authenticated.get("/api/user-model/mobile-summary", (c) => {
|
|
265
308
|
const rawAssertions = listUserAssertions({
|
|
@@ -306,6 +349,7 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
306
349
|
locale: profile.locale ?? ""
|
|
307
350
|
},
|
|
308
351
|
suggestedCallName: profile.callName || machineCallName(),
|
|
352
|
+
settings: memorySettings(),
|
|
309
353
|
counts: {
|
|
310
354
|
total: visible.length,
|
|
311
355
|
explicit: visible.filter((item) => item.authority === "user_explicit").length,
|
|
@@ -472,6 +516,16 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
472
516
|
return c.json({ error: errorMessage(error) }, 404);
|
|
473
517
|
}
|
|
474
518
|
});
|
|
519
|
+
authenticated.patch("/api/user-model/assertions/:id/scope", write, async (c) => {
|
|
520
|
+
const nextScope = scope((await body(c))?.scope);
|
|
521
|
+
if (!nextScope) return c.json({ error: "A valid scope is required" }, 400);
|
|
522
|
+
try {
|
|
523
|
+
const assertion = setUserAssertionScope(c.req.param("id"), nextScope);
|
|
524
|
+
return c.json({ assertion: assertionView(assertion) });
|
|
525
|
+
} catch (error) {
|
|
526
|
+
return c.json({ error: errorMessage(error) }, 400);
|
|
527
|
+
}
|
|
528
|
+
});
|
|
475
529
|
authenticated.patch("/api/user-model/assertions/:id", write, async (c) => {
|
|
476
530
|
const current = getUserAssertion(c.req.param("id"));
|
|
477
531
|
const input = await body(c);
|
|
@@ -710,6 +764,10 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
710
764
|
authenticated.get("/api/turns/:turnId/execution-context", (c) => {
|
|
711
765
|
const audit = getExecutionContextAudit(c.req.param("turnId"));
|
|
712
766
|
if (!audit) return c.json({ error: "Execution context not found" }, 404);
|
|
767
|
+
if (!userContextConfig().userModel.showMemoryReferences) return c.json({
|
|
768
|
+
audit,
|
|
769
|
+
resolvedItems: []
|
|
770
|
+
});
|
|
713
771
|
const goals = new Map(listUserGoals().map((item) => [item.id, item]));
|
|
714
772
|
const priorities = new Map(listPriorityWindows().map((item) => [item.id, item]));
|
|
715
773
|
const resolvedItems = audit.items.flatMap((item) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
|
-
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
4
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
3
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
4
|
+
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
6
5
|
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
7
6
|
import { fetchWithTimeoutGuarded } from "../media-shared/http/provider-http.js";
|
|
8
7
|
import "../media-shared/http/index.js";
|
|
8
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { getImageGenerationProvider, listImageGenerationProvidersSummary } from "../agent/image/generation/provider-registry.js";
|
|
10
10
|
//#region src/gateway/image-generation-setup.ts
|
|
11
11
|
init_repository();
|
package/dist/src/gateway/lock.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
-
import fs$1 from "node:fs/promises";
|
|
5
4
|
import net from "node:net";
|
|
5
|
+
import fs$1 from "node:fs/promises";
|
|
6
6
|
import { homedir } from "os";
|
|
7
7
|
//#region src/gateway/lock.ts
|
|
8
8
|
/**
|
|
@@ -110,7 +110,7 @@ export declare class GatewayMarketplaceService {
|
|
|
110
110
|
}>>;
|
|
111
111
|
private getDefaultAgentId;
|
|
112
112
|
private getInstallAvailability;
|
|
113
|
-
/** xopc-store
|
|
113
|
+
/** xopc-store portable Agent Plugin or native extension package preview. */
|
|
114
114
|
fetchExtensionPackageDetail(packageName: string): Promise<ExtensionMarketplacePackageDetailPayload>;
|
|
115
115
|
/**
|
|
116
116
|
* Install an extension from xopc-store into `~/.xopc/extensions`, append id
|
|
@@ -200,12 +200,12 @@ var GatewayMarketplaceService = class {
|
|
|
200
200
|
diagnostics: relevantDiagnostics
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
/** xopc-store
|
|
203
|
+
/** xopc-store portable Agent Plugin or native extension package preview. */
|
|
204
204
|
async fetchExtensionPackageDetail(packageName) {
|
|
205
205
|
const { downloadExtensionStoreZipBuffer, fetchMarketplacePackageDetail, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } = await import("../../agent/skills/marketplace/adapters/store/store-api-client.js");
|
|
206
206
|
const base = resolveExtensionsStoreBaseUrl(this.opts.getConfig());
|
|
207
207
|
const detail = await fetchMarketplacePackageDetail(base, packageName.trim());
|
|
208
|
-
if (detail.type !== "extension") throw new Error(`Package "${packageName}" is not
|
|
208
|
+
if (detail.type !== "extension" && detail.type !== "plugin") throw new Error(`Package "${packageName}" is not a plugin or extension (store type: ${detail.type}).`);
|
|
209
209
|
try {
|
|
210
210
|
const resolved = await resolveExtensionZipDownloadUrl(base, packageName.trim());
|
|
211
211
|
const buffer = await downloadExtensionStoreZipBuffer(base, resolved.downloadUrl);
|
|
@@ -222,6 +222,7 @@ var GatewayMarketplaceService = class {
|
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
+
if (detail.type === "plugin") throw new Error("Store plugin artifact is not an Agent Plugins package");
|
|
225
226
|
const { peekExtensionManifestFromStoreZip, peekExtensionPackageJsonFromStoreZip } = await import("../../extensions/install.js");
|
|
226
227
|
const manifest = peekExtensionManifestFromStoreZip(buffer);
|
|
227
228
|
const packageJson = peekExtensionPackageJsonFromStoreZip(buffer);
|
|
@@ -16,17 +16,17 @@ import { init_session_repository, listSessionMetadata, patchSessionMetadata } fr
|
|
|
16
16
|
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
17
17
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
18
18
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
19
|
-
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
20
|
-
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
21
19
|
import { init_config, resolveKnowledgeReadPolicy } from "../user-context/config.js";
|
|
22
20
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
23
|
-
import {
|
|
21
|
+
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
24
22
|
import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
|
|
25
23
|
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
26
24
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
25
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
26
|
+
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
27
|
+
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
27
28
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
28
29
|
import { AI_USAGE_RETENTION_MS, markStaleAiUsageEventsUnknown, pruneAiUsageEvents } from "../storage/sqlite/ai-usage-repository.js";
|
|
29
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
30
30
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
31
31
|
import { listKnowledgeItems } from "../knowledge-memory/repository.js";
|
|
32
32
|
import "../knowledge-memory/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
2
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
3
2
|
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
4
3
|
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
4
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
5
|
import { prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
6
6
|
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
7
7
|
init_repository();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
2
|
-
import { extractAssistantText, getAssistantMessageErrorReason } from "../providers/model-response.js";
|
|
3
2
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
4
3
|
import { completeWithResolvedCredentials, isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
4
|
+
import { extractAssistantText, getAssistantMessageErrorReason } from "../providers/model-response.js";
|
|
5
5
|
import { resolveModelSelector } from "../config/agent-model-intents.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/home-intelligence/generator.ts
|
|
@@ -5,10 +5,10 @@ import { currentOperationId, init_operation_context } from "../infra/operation-c
|
|
|
5
5
|
import { afterSqliteCommit, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { ExtensionCapabilityBindingsSchema, extensionCapabilityPermissions } from "../../packages/gateway-contract/src/extension-capabilities.js";
|
|
7
7
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
8
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
9
8
|
import { init_paths, resolveExtensionsDir } from "../config/paths.js";
|
|
10
9
|
import { LocalAppStore } from "./store.js";
|
|
11
10
|
import { slugifyProjectName } from "../projects/project-store.js";
|
|
11
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
12
12
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
13
13
|
import { validateLocalAppCapabilityContracts } from "./capabilities/contracts.js";
|
|
14
14
|
import { buildLocalAppFixGuidance } from "./fix-guidance.js";
|