@xopcai/xopc 0.0.397 → 0.0.399
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/src/plugin.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CIEGrioy.js → agent-avatar-dicebear-CpQYvwOW.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BQxtFjlw.js +1 -0
- package/dist/gateway/static/root/assets/agents-AuBMS_Pf.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-BjGOUrAf.js → agents-admin-api-DvSe10zu.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DIJ0ii-n.js → app-management-settings-panel-QMCJPUuH.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BGnyHS-p.js → appearance-settings-BGPmyRLn.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DtqV9r9m.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CR8FcRAa.js → archive-plugin-H2rWTIwC.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BLInZo7N.js → automations-page-jENavthQ.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CImof0cA.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DW9pu205.js → binary-plugins-DPyR9xd5.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-ClgTc5v8.js → block-editor-LrMWBpSq.js} +40 -40
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Bn7kDuUB.js → browser-automation-inputs-CyjyiwCe.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-BwuUYfOv.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-C2B2U1px.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-CTfLd_UE.js → capabilities-glv1DeRI.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-D95AkBeY.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Dibaaecx.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-9ZG71-BO.js → capability-header-actions-DIAfw_sB.js} +1 -1
- package/dist/gateway/static/root/assets/capability-links-DzQWK1Fh.js +1 -0
- package/dist/gateway/static/root/assets/channels-BDsCl-WU.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-x1W2_hwc.js → chat-terminal-dock-B_JFEyRy.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-B2vSOHPO.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-Kf8kaNm_.js → connector-service-page-D2cCQJWy.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-C9t9v36q.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-d5kiPUG0.js → date-picker-BYz1BvpE.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BcH76tQC.js → dependency-picker-B5onlFRJ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-B-925tPX.js → desktop-pet-IsOXKVI4.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-3XJ4qR65.js → desktop-pet-settings-BZhPDsCp.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-Hf-xMRH5.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-B-qZCjGR.js → directory-picker-path-field-C7mO36eo.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BlQu1u6X.js → extension-debug-page-BkSnNO_a.js} +1 -1
- package/dist/gateway/static/root/assets/extension-page-CTXu0lgl.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-DzsZI4dz.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-Di9g6pE8.js → gateway-config-swr-DAir1JsW.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-2-o7qk92.js → gateway-realtime-dE0XrVAT.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CPlVuu0d.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DDfLdRFy.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BCUswcVy.js → gateway-startup-retry-CqyGHM2M.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-Czdbbi0H.js → highlighted-body-KQOG7T2V-Dy3ktsqG.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Cw0YZFEE.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DPFPJ2ps.js → image-generation-api-CsX0tJA9.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Bwyotfbt.js → imports-page-BnaJaGsz.js} +1 -1
- package/dist/gateway/static/root/assets/index-QegseiyI.css +1 -0
- package/dist/gateway/static/root/assets/{index-Dsp_gNdl.js → index-dViajQ_4.js} +11 -11
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-C20gl-l7.js → keyboard-shortcuts-settings-B0-L_-9C.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-o0M_OSjC.js → local-app-workbench-page-DCU-MUm0.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DoWJCmOq.js → local-apps-page-CYB-jS8K.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BjwlkAKA.js → local-session-drafts-fhip41-L.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Djl2FW6_.js → locale-store-Jnhw2WMv.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BFTL93RX.js → logs-page-Dd_Miu5W.js} +2 -2
- package/dist/gateway/static/root/assets/management-settings-EhbGOA7d.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DyO7Q0Ms.js → markdown-view-B58RypQ4.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DLrTRF0a.js → media-plugins-Gg2S_-0J.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-B491wqqw.js +1 -0
- package/dist/gateway/static/root/assets/messages-DBvKzlCl.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-b0LhcM8E.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-CrrJhf22.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-YTVWZ02-.js → page-context-capture-button-CVkaHzKp.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-C5bS9Zox.js +1 -0
- package/dist/gateway/static/root/assets/plugin-details-dialog-BEmOUy9T.js +1 -0
- package/dist/gateway/static/root/assets/plugin-presentation-B9Am-_vW.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DzA__S54.js → preview-open-alternatives-BsblzqIi.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DvlMKj0T.js → product-open-page-OZZTYmjY.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-qdFyo4NG.js → product-preview-content-BECp_NcY.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BIXCksxe.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-XzE2Lrf2.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BwR2CiR5.js → registry-api-BbUEMGcj.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DdeFnheH.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-C_VOMhLI.js → runtime-tools-api-D0xtCTXr.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BCHLh-KQ.js → runtime-tools-settings-panel-DTEruUBq.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CJvaVHkx.js → schema-form-v4qyepTr.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DbNNQps9.js → session-api-CAKgrbgz.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-DfVviLTK.js → session-manager-D_N7qha7.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-D6ff4Ntg.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-ewl9-rd5.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-B3eODxNv.js → settings-form-section-Bg4VGpOS.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-Dg86uCnr.js → settings-page-DWnJiiZ3.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-ShBGdTLC.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DCy1f25V.js → share-preview-page-CajYPnal.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CbkMauXr.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-RisyPAMA.js → skill-api-CViUmvY5.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BBJFG6Sa.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-Xz71fZ-2.js +2 -0
- package/dist/gateway/static/root/assets/{style-CwMX73G7.js → style-C06V_QkC.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Cma37Pfm.js → system-settings-panel-ygHZouKG.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-yrk_lymf.js +2 -0
- package/dist/gateway/static/root/assets/{task-expandable-content-D3i_51Oc.js → task-expandable-content-HdEeV_0-.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-DC-kLysq.js → tracing-settings-page-BpwIY_cs.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BgdhbR1L.js → tunnel-api-DJwLyVlX.js} +1 -1
- package/dist/gateway/static/root/assets/usage-page-B7nIyRrc.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-iKvZ1pvC.js → use-autosave-CYG5ELoQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-BYt2yFNk.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CESbtuwM.js → voice-api-key-field-CTvb35O3.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Ceo_hqZC.js → voice-config-api-T3nM4buh.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-dtPpmYyh.js → work-discovery-overlay-DQJpheuI.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DmFn3E_B.js → workflow-run-setup-panel-BDK1g07U.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DFsw6QAX.js +6 -0
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DTZnabfg.js → xopc-cloud-account-card-CbASlMPP.js} +1 -1
- package/dist/gateway/static/root/index.html +15 -15
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +8 -0
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +2 -2
- package/dist/src/channels/index.js +1 -1
- package/dist/src/channels/manager.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/extensions/agent-plugins/branding.d.ts +6 -0
- package/dist/src/extensions/agent-plugins/branding.js +11 -1
- package/dist/src/extensions/agent-plugins/cli-authorization.d.ts +11 -0
- package/dist/src/extensions/agent-plugins/cli-authorization.js +11 -6
- package/dist/src/extensions/agent-plugins/inventory.d.ts +12 -0
- package/dist/src/extensions/agent-plugins/inventory.js +3 -2
- package/dist/src/extensions/agent-plugins/setup-contract.d.ts +20 -0
- package/dist/src/extensions/agent-plugins/setup-contract.js +20 -1
- package/dist/src/extensions/agent-plugins/setup.d.ts +8 -0
- package/dist/src/extensions/agent-plugins/setup.js +10 -5
- package/dist/src/extensions/agent-plugins/skill-catalog.d.ts +14 -0
- package/dist/src/extensions/agent-plugins/skill-catalog.js +95 -0
- package/dist/src/extensions/agent-plugins/store.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/gateway/hono/app.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser-install.js +1 -1
- package/dist/src/gateway/service/marketplace-service.js +4 -2
- package/dist/src/gateway/service.js +7 -7
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CzKNVkRn.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-mpA9rwYd.js +0 -1
- package/dist/gateway/static/root/assets/agents-7VMa7Rzo.js +0 -77
- package/dist/gateway/static/root/assets/apps-page-CvqDUvof.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DvTSHLt3.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-CJGBhDnv.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-tsi5W-cJ.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-CfbGk8q_.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BkO7QEyA.js +0 -8
- package/dist/gateway/static/root/assets/channels-D0CwJktG.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-D_b_bFVz.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DlpfL2Rc.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-12m5Z9-8.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-CXxM1M62.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-AF5nvsPP.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQ6-whg-.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-ABXvW_yL.js +0 -1
- package/dist/gateway/static/root/assets/home-page-LXGxGwVl.js +0 -2
- package/dist/gateway/static/root/assets/index-BKHxJaGD.css +0 -1
- package/dist/gateway/static/root/assets/management-settings-C52cuMg1.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CPYJsRUJ.js +0 -1
- package/dist/gateway/static/root/assets/messages-DPxcWxfD.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-CNN41byS.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BsfBp_8z.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-N4KoCZYG.js +0 -1
- package/dist/gateway/static/root/assets/plugin-details-page-DcrrzQI-.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-y67s_fA8.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D5iYgi0O.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DeFF7Re-.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DZ93_D5M.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-F1WX7vxq.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-ruFzAArp.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DeIVZvpJ.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Dwkm1Fof.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-UiTLsrFc.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-BKOF_kxS.js +0 -2
- package/dist/gateway/static/root/assets/usage-page-BSlFg3Xj.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-D4GB8QsM.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DEtaRuxH.js +0 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getStoreConnectorInstallPlan, installStoreConnector, listStoreConnectors } from "../../capabilities/store-connector.js";
|
|
2
2
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
3
3
|
import { register } from "../registry.js";
|
|
4
|
-
import { Command } from "commander";
|
|
5
4
|
import { confirm } from "@inquirer/prompts";
|
|
5
|
+
import { Command } from "commander";
|
|
6
6
|
//#region src/cli/commands/connectors.ts
|
|
7
7
|
function parsePairs(values, option) {
|
|
8
8
|
const output = {};
|
|
@@ -16,8 +16,8 @@ import { existsSync, readFileSync, statSync } from "node:fs";
|
|
|
16
16
|
import { execSync } from "node:child_process";
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
18
18
|
import semver from "semver";
|
|
19
|
-
import { Command } from "commander";
|
|
20
19
|
import { confirm } from "@inquirer/prompts";
|
|
20
|
+
import { Command } from "commander";
|
|
21
21
|
//#region src/cli/commands/extension-marketplace.ts
|
|
22
22
|
init_paths();
|
|
23
23
|
const MANIFEST = "xopc.extension.json";
|
|
@@ -16,8 +16,8 @@ import { prepareUpdateGlobalDefaults } from "../../gateway/global-defaults-admin
|
|
|
16
16
|
import { disconnectProvider } from "../../providers/provider-disconnect.js";
|
|
17
17
|
import { colors } from "../utils/colors.js";
|
|
18
18
|
import { runCliOAuthLogin } from "../utils/oauth-login.js";
|
|
19
|
-
import { Command } from "commander";
|
|
20
19
|
import { input } from "@inquirer/prompts";
|
|
20
|
+
import { Command } from "commander";
|
|
21
21
|
//#region src/cli/commands/models.ts
|
|
22
22
|
init_credentials();
|
|
23
23
|
init_schema();
|
|
@@ -11,8 +11,8 @@ import { initWorkspace } from "../utils/init-workspace.js";
|
|
|
11
11
|
import { setupModel } from "./onboard/model.js";
|
|
12
12
|
import { getChannelConfigurators } from "./onboard/channels/registry.js";
|
|
13
13
|
import { setupChannels } from "./onboard/channels/index.js";
|
|
14
|
-
import { Command } from "commander";
|
|
15
14
|
import { select } from "@inquirer/prompts";
|
|
15
|
+
import { Command } from "commander";
|
|
16
16
|
//#region src/cli/commands/onboard.ts
|
|
17
17
|
init_repository();
|
|
18
18
|
init_schema();
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type PluginManifest } from './validation.js';
|
|
2
|
+
export declare function pluginLocalizations(manifest: PluginManifest): {
|
|
3
|
+
[k: string]: {
|
|
4
|
+
description?: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
2
8
|
/** Inline bounded package assets so authenticated and offline inventories need no extra fetch. */
|
|
3
9
|
export declare function pluginBranding(root: string, manifest: PluginManifest): {
|
|
4
10
|
iconUrl: string;
|
|
@@ -3,6 +3,16 @@ import { extname, resolve } from "node:path";
|
|
|
3
3
|
import { readFileSync, statSync } from "node:fs";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
//#region src/extensions/agent-plugins/branding.ts
|
|
6
|
+
function pluginLocalizations(manifest) {
|
|
7
|
+
const extension = manifest.extensions?.["ai.xopc"];
|
|
8
|
+
return Object.fromEntries(["en", "zh-CN"].flatMap((locale) => {
|
|
9
|
+
const value = extension?.localizations?.[locale];
|
|
10
|
+
return typeof value?.displayName === "string" && value.displayName.trim() ? [[locale, {
|
|
11
|
+
displayName: value.displayName,
|
|
12
|
+
...typeof value.description === "string" ? { description: value.description } : {}
|
|
13
|
+
}]] : [];
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
6
16
|
/** Inline bounded package assets so authenticated and offline inventories need no extra fetch. */
|
|
7
17
|
function pluginBranding(root, manifest) {
|
|
8
18
|
const icon = (manifest.extensions?.["ai.xopc"])?.branding?.icon;
|
|
@@ -41,4 +51,4 @@ function pluginBranding(root, manifest) {
|
|
|
41
51
|
}
|
|
42
52
|
}
|
|
43
53
|
//#endregion
|
|
44
|
-
export { pluginBranding };
|
|
54
|
+
export { pluginBranding, pluginLocalizations };
|
|
@@ -14,6 +14,17 @@ export type PluginCliAuthorization = {
|
|
|
14
14
|
};
|
|
15
15
|
error?: string;
|
|
16
16
|
};
|
|
17
|
+
export declare function inspectPluginCliAuthorization(store: AgentPluginStore, plugin: InstalledAgentPlugin, authorization: string, method: CliMethod, signal: AbortSignal): Promise<{
|
|
18
|
+
authenticated: boolean;
|
|
19
|
+
issues: {
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
scopes: string[];
|
|
23
|
+
instructions: string[];
|
|
24
|
+
method?: string;
|
|
25
|
+
helpUrl?: string;
|
|
26
|
+
}[];
|
|
27
|
+
}>;
|
|
17
28
|
export declare function checkPluginCliAuthorization(store: AgentPluginStore, plugin: InstalledAgentPlugin, authorization: string, method: CliMethod, signal: AbortSignal): Promise<boolean>;
|
|
18
29
|
export declare function startPluginCliAuthorization(store: AgentPluginStore, plugin: InstalledAgentPlugin, authorization: string, method: CliMethod, owner: string): PluginCliAuthorization;
|
|
19
30
|
export declare function getPluginCliAuthorization(id: string, owner: string, revision: string): PluginCliAuthorization | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
2
2
|
import { spawnProcess } from "../../process/run-process.js";
|
|
3
|
-
import { safeAuthorizationUrl } from "./setup-contract.js";
|
|
3
|
+
import { parsePluginAuthorizationCheck, pluginAuthorizations, safeAuthorizationUrl } from "./setup-contract.js";
|
|
4
4
|
import { containedPath, expandPluginVariables, resolvePluginCwd, validatePluginServer } from "./validation.js";
|
|
5
5
|
import { expandUserConfig, readPluginUserConfig } from "./user-config.js";
|
|
6
6
|
import { homedir } from "node:os";
|
|
@@ -86,15 +86,20 @@ async function execute(store, plugin, authorization, command, signal, timeoutMs,
|
|
|
86
86
|
if (result.exitCode !== 0 || result.timedOut || result.aborted || result.outputTruncated) throw new Error("CLI login or account check failed. Retry authorization.");
|
|
87
87
|
return result.stdout;
|
|
88
88
|
}
|
|
89
|
-
async function
|
|
89
|
+
async function inspectPluginCliAuthorization(store, plugin, authorization, method, signal) {
|
|
90
90
|
try {
|
|
91
|
-
|
|
92
|
-
return !!last && JSON.parse(last).authenticated === true;
|
|
91
|
+
return parsePluginAuthorizationCheck(await execute(store, plugin, authorization, method.check, signal, 15e3), pluginAuthorizations(plugin.manifest).find((value) => value.id === authorization)?.methods.map((value) => value.id) ?? []);
|
|
93
92
|
} catch {
|
|
94
93
|
signal.throwIfAborted();
|
|
95
|
-
return
|
|
94
|
+
return {
|
|
95
|
+
authenticated: false,
|
|
96
|
+
issues: []
|
|
97
|
+
};
|
|
96
98
|
}
|
|
97
99
|
}
|
|
100
|
+
async function checkPluginCliAuthorization(store, plugin, authorization, method, signal) {
|
|
101
|
+
return (await inspectPluginCliAuthorization(store, plugin, authorization, method, signal)).authenticated;
|
|
102
|
+
}
|
|
98
103
|
function startPluginCliAuthorization(store, plugin, authorization, method, owner) {
|
|
99
104
|
for (const [key, attempt] of attempts) if (attempt.view.expiresAt < Date.now()) {
|
|
100
105
|
attempt.controller.abort();
|
|
@@ -195,4 +200,4 @@ function cancelAllPluginCliAuthorizations() {
|
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
//#endregion
|
|
198
|
-
export { cancelAllPluginCliAuthorizations, cancelPluginCliAuthorizations, checkPluginCliAuthorization, getPluginCliAuthorization, startPluginCliAuthorization };
|
|
203
|
+
export { cancelAllPluginCliAuthorizations, cancelPluginCliAuthorizations, checkPluginCliAuthorization, getPluginCliAuthorization, inspectPluginCliAuthorization, startPluginCliAuthorization };
|
|
@@ -94,6 +94,12 @@ export declare function agentPluginInventoryRow(plugin: InstalledAgentPlugin, st
|
|
|
94
94
|
version: string;
|
|
95
95
|
description: string;
|
|
96
96
|
source: string;
|
|
97
|
+
localizations: {
|
|
98
|
+
[k: string]: {
|
|
99
|
+
description?: string;
|
|
100
|
+
displayName: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
97
103
|
branding: {
|
|
98
104
|
iconUrl: string;
|
|
99
105
|
iconSha256: string;
|
|
@@ -202,6 +208,12 @@ export declare function listAgentPluginInventory(): {
|
|
|
202
208
|
version: string;
|
|
203
209
|
description: string;
|
|
204
210
|
source: string;
|
|
211
|
+
localizations: {
|
|
212
|
+
[k: string]: {
|
|
213
|
+
description?: string;
|
|
214
|
+
displayName: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
205
217
|
branding: {
|
|
206
218
|
iconUrl: string;
|
|
207
219
|
iconSha256: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { pluginAuthorizations } from "./setup-contract.js";
|
|
2
2
|
import { pluginServerId } from "./validation.js";
|
|
3
3
|
import { AgentPluginStore } from "./store.js";
|
|
4
|
-
import { pluginBranding } from "./branding.js";
|
|
4
|
+
import { pluginBranding, pluginLocalizations } from "./branding.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
//#region src/extensions/agent-plugins/inventory.ts
|
|
@@ -16,7 +16,7 @@ function agentPluginInventoryRow(plugin, store = new AgentPluginStore()) {
|
|
|
16
16
|
try {
|
|
17
17
|
authorizations = pluginAuthorizations(plugin.manifest);
|
|
18
18
|
} catch {}
|
|
19
|
-
const needsAuthorization = !!job && ((job.missingConfig?.length ?? 0) > 0 || job.connections?.some((value) => value.state !== "connected") || job.authorizations?.some((value) => value.state !== "connected"));
|
|
19
|
+
const needsAuthorization = !!job && ((job.missingConfig?.length ?? 0) > 0 || job.connections?.some((value) => value.state !== "connected") || job.authorizations?.some((value) => value.state !== "connected" || !!value.issues?.length));
|
|
20
20
|
return {
|
|
21
21
|
id: `plugin:${plugin.id}`,
|
|
22
22
|
pluginId: plugin.id,
|
|
@@ -25,6 +25,7 @@ function agentPluginInventoryRow(plugin, store = new AgentPluginStore()) {
|
|
|
25
25
|
version: plugin.manifest.version ?? plugin.receipt.provenance?.version,
|
|
26
26
|
description: plugin.manifest.description,
|
|
27
27
|
source: "agent-plugin",
|
|
28
|
+
localizations: pluginLocalizations(plugin.manifest),
|
|
28
29
|
branding: pluginBranding(plugin.rootDir, plugin.manifest),
|
|
29
30
|
active: plugin.receipt.enabled && plugin.readiness !== "blocked" && plugin.readiness !== "setup_required",
|
|
30
31
|
activationEligible: plugin.receipt.enabled,
|
|
@@ -52,3 +52,23 @@ export declare function pluginAuthorizations(manifest: {
|
|
|
52
52
|
extensions?: Record<string, unknown>;
|
|
53
53
|
}): PluginAuthorization[];
|
|
54
54
|
export declare function safeAuthorizationUrl(value: string): string;
|
|
55
|
+
export declare const pluginPermissionIssueSchema: z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
title: z.ZodString;
|
|
58
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
59
|
+
instructions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
60
|
+
method: z.ZodOptional<z.ZodString>;
|
|
61
|
+
helpUrl: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
export type PluginPermissionIssue = z.infer<typeof pluginPermissionIssueSchema>;
|
|
64
|
+
export declare function parsePluginAuthorizationCheck(output: string, methodIds: string[]): {
|
|
65
|
+
authenticated: boolean;
|
|
66
|
+
issues: {
|
|
67
|
+
id: string;
|
|
68
|
+
title: string;
|
|
69
|
+
scopes: string[];
|
|
70
|
+
instructions: string[];
|
|
71
|
+
method?: string;
|
|
72
|
+
helpUrl?: string;
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
@@ -54,5 +54,24 @@ function safeAuthorizationUrl(value) {
|
|
|
54
54
|
].includes(url.hostname))) throw new Error("Authorization requires an HTTPS or loopback URL");
|
|
55
55
|
return url.href;
|
|
56
56
|
}
|
|
57
|
+
const pluginPermissionIssueSchema = z.strictObject({
|
|
58
|
+
id,
|
|
59
|
+
title: z.string().min(1).max(100),
|
|
60
|
+
scopes: z.array(z.string().min(1).max(200).regex(/^[a-zA-Z0-9_.:-]+$/)).max(30).default([]),
|
|
61
|
+
instructions: z.array(z.string().min(1).max(1e3)).max(6).default([]),
|
|
62
|
+
method: id.optional(),
|
|
63
|
+
helpUrl: z.string().url().optional()
|
|
64
|
+
});
|
|
65
|
+
function parsePluginAuthorizationCheck(output, methodIds) {
|
|
66
|
+
const result = z.object({
|
|
67
|
+
authenticated: z.boolean(),
|
|
68
|
+
issues: z.array(pluginPermissionIssueSchema).max(20).default([])
|
|
69
|
+
}).parse(JSON.parse(output.trim().split("\n").at(-1)));
|
|
70
|
+
for (const issue of result.issues) {
|
|
71
|
+
if (issue.method && !methodIds.includes(issue.method)) throw new Error("Unknown permission recovery method");
|
|
72
|
+
if (issue.helpUrl) safeAuthorizationUrl(issue.helpUrl);
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
57
76
|
//#endregion
|
|
58
|
-
export { pluginAuthorizationSchema, pluginAuthorizations, safeAuthorizationUrl, setupCommandSchema };
|
|
77
|
+
export { parsePluginAuthorizationCheck, pluginAuthorizationSchema, pluginAuthorizations, pluginPermissionIssueSchema, safeAuthorizationUrl, setupCommandSchema };
|
|
@@ -45,6 +45,14 @@ declare const schema: z.ZodObject<{
|
|
|
45
45
|
skipped: "skipped";
|
|
46
46
|
connected: "connected";
|
|
47
47
|
}>;
|
|
48
|
+
issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
title: z.ZodString;
|
|
51
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
52
|
+
instructions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
53
|
+
method: z.ZodOptional<z.ZodString>;
|
|
54
|
+
helpUrl: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strict>>>;
|
|
48
56
|
method: z.ZodOptional<z.ZodString>;
|
|
49
57
|
attemptId: z.ZodOptional<z.ZodString>;
|
|
50
58
|
}, z.core.$strip>>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
4
|
-
import { pluginAuthorizations } from "./setup-contract.js";
|
|
4
|
+
import { pluginAuthorizations, pluginPermissionIssueSchema } from "./setup-contract.js";
|
|
5
5
|
import { preparePluginResources } from "./resources.js";
|
|
6
6
|
import { pluginName, pluginServerId } from "./validation.js";
|
|
7
7
|
import { AgentPluginStore } from "./store.js";
|
|
@@ -12,7 +12,7 @@ import { pluginConfigMissing, readPluginUserConfig, savePluginUserConfig } from
|
|
|
12
12
|
import { materializePluginServers } from "./mcp-adapter.js";
|
|
13
13
|
import { getNativePiAgentDir } from "../../agent/mcp/native-mcp.js";
|
|
14
14
|
import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../agent/mcp/connection-setup.js";
|
|
15
|
-
import { cancelPluginCliAuthorizations,
|
|
15
|
+
import { cancelPluginCliAuthorizations, getPluginCliAuthorization, inspectPluginCliAuthorization, startPluginCliAuthorization } from "./cli-authorization.js";
|
|
16
16
|
import { join } from "node:path";
|
|
17
17
|
import { existsSync, readFileSync } from "node:fs";
|
|
18
18
|
import { randomUUID } from "node:crypto";
|
|
@@ -66,6 +66,7 @@ const schema = z.object({
|
|
|
66
66
|
"skipped",
|
|
67
67
|
"error"
|
|
68
68
|
]),
|
|
69
|
+
issues: z.array(pluginPermissionIssueSchema).max(20).default([]),
|
|
69
70
|
method: z.string().optional(),
|
|
70
71
|
attemptId: z.string().optional()
|
|
71
72
|
})).default([]),
|
|
@@ -171,7 +172,8 @@ var PluginSetupService = class {
|
|
|
171
172
|
deferred: false,
|
|
172
173
|
authorizations: pluginAuthorizations(plugin.manifest).map((value) => ({
|
|
173
174
|
id: value.id,
|
|
174
|
-
state: "pending"
|
|
175
|
+
state: "pending",
|
|
176
|
+
issues: []
|
|
175
177
|
})),
|
|
176
178
|
operations: [],
|
|
177
179
|
missingConfig: pluginConfigMissing(this.store, plugin),
|
|
@@ -435,8 +437,11 @@ var PluginSetupService = class {
|
|
|
435
437
|
} else {
|
|
436
438
|
for (const target of job.authorizations) {
|
|
437
439
|
const method = declarations.find((value) => value.id === target.id).methods.find((value) => value.id === target.method);
|
|
438
|
-
if (method?.type === "cli")
|
|
439
|
-
|
|
440
|
+
if (method?.type === "cli") {
|
|
441
|
+
const check = await inspectPluginCliAuthorization(this.store, plugin, target.id, method, controller.signal);
|
|
442
|
+
target.state = check.authenticated ? "connected" : "pending";
|
|
443
|
+
target.issues = check.issues;
|
|
444
|
+
} else if (method?.type === "form") {
|
|
440
445
|
const values = readPluginUserConfig(this.store, id, plugin.receipt.revision);
|
|
441
446
|
target.state = method.fields.every((key) => values[key] !== void 0 && values[key] !== "") ? "connected" : "pending";
|
|
442
447
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SkillCatalogEntry } from '../../agent/agent-manager.js';
|
|
2
|
+
import { AgentPluginStore } from './store.js';
|
|
3
|
+
export declare function pluginSkillName(plugin: ReturnType<AgentPluginStore['list']>[number], name: string): string;
|
|
4
|
+
/** Browse installed content without enabling it in the Agent runtime. */
|
|
5
|
+
export declare function withPluginSkillCatalog(catalog: SkillCatalogEntry[], store?: AgentPluginStore): SkillCatalogEntry[];
|
|
6
|
+
export declare function pluginSkillPreview(name: string, store?: AgentPluginStore): {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
bodyMarkdown: string;
|
|
10
|
+
disableModelInvocation: boolean;
|
|
11
|
+
metadata: import("../../agent/skills/types.js").SkillMetadata;
|
|
12
|
+
toolConditions?: import("../../agent/skills/types.js").SkillToolConditions;
|
|
13
|
+
requiredEnvVarNames?: string[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
|
+
import { createSkillConfigManager } from "../../agent/skills/config.js";
|
|
3
|
+
import { parseSkillLocalizations } from "../../agent/skills/parse-skill-metadata.js";
|
|
4
|
+
import { containedPath } from "./validation.js";
|
|
5
|
+
import { AgentPluginStore } from "./store.js";
|
|
6
|
+
import { buildSkillMarkdownPreviewFromRaw } from "../../agent/skills/skill-markdown-preview-from-raw.js";
|
|
7
|
+
import { agentPluginInventoryRow } from "./inventory.js";
|
|
8
|
+
import { basename, dirname } from "node:path";
|
|
9
|
+
import { readFileSync } from "node:fs";
|
|
10
|
+
//#region src/extensions/agent-plugins/skill-catalog.ts
|
|
11
|
+
function pluginSkillName(plugin, name) {
|
|
12
|
+
return plugin.layout?.dialect !== "portable" ? `${plugin.id}.${name}` : name;
|
|
13
|
+
}
|
|
14
|
+
/** Browse installed content without enabling it in the Agent runtime. */
|
|
15
|
+
function withPluginSkillCatalog(catalog, store = new AgentPluginStore()) {
|
|
16
|
+
const rows = [...catalog];
|
|
17
|
+
const config = createSkillConfigManager(store.stateDir).load();
|
|
18
|
+
for (const plugin of store.list()) {
|
|
19
|
+
const inventory = agentPluginInventoryRow(plugin, store);
|
|
20
|
+
const owner = {
|
|
21
|
+
id: plugin.id,
|
|
22
|
+
name: plugin.manifest.name,
|
|
23
|
+
title: inventory.setup.authorizations.length === 1 ? inventory.setup.authorizations[0].title : plugin.manifest.name,
|
|
24
|
+
authorizationStatus: inventory.authorizationStatus,
|
|
25
|
+
active: inventory.active,
|
|
26
|
+
readiness: plugin.readiness
|
|
27
|
+
};
|
|
28
|
+
for (const skill of plugin.skills) {
|
|
29
|
+
const name = pluginSkillName(plugin, skill.name);
|
|
30
|
+
const index = rows.findIndex((row) => row.origin === `plugin:${plugin.id}` && row.name === name);
|
|
31
|
+
try {
|
|
32
|
+
const raw = readFileSync(containedPath(plugin.rootDir, skill.filePath), "utf8");
|
|
33
|
+
const preview = buildSkillMarkdownPreviewFromRaw(raw, {
|
|
34
|
+
name,
|
|
35
|
+
description: ""
|
|
36
|
+
});
|
|
37
|
+
const { frontmatter } = parseFrontmatter(raw);
|
|
38
|
+
const fm = frontmatter;
|
|
39
|
+
const localizations = parseSkillLocalizations(fm).localizations ?? {
|
|
40
|
+
en: {
|
|
41
|
+
displayName: skill.name,
|
|
42
|
+
description: preview.description
|
|
43
|
+
},
|
|
44
|
+
"zh-CN": {
|
|
45
|
+
displayName: typeof fm.displayName === "string" ? fm.displayName : skill.name,
|
|
46
|
+
description: typeof fm.displayDescription === "string" ? fm.displayDescription : preview.description
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
if (index >= 0) {
|
|
50
|
+
rows[index] = {
|
|
51
|
+
...rows[index],
|
|
52
|
+
localizations,
|
|
53
|
+
plugin: owner
|
|
54
|
+
};
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
rows.push({
|
|
58
|
+
localizations,
|
|
59
|
+
directoryId: basename(dirname(skill.filePath)),
|
|
60
|
+
name,
|
|
61
|
+
description: preview.description,
|
|
62
|
+
source: "global",
|
|
63
|
+
origin: `plugin:${plugin.id}`,
|
|
64
|
+
path: dirname(skill.filePath),
|
|
65
|
+
managed: false,
|
|
66
|
+
writable: false,
|
|
67
|
+
enabled: config.entries?.[name]?.enabled !== false,
|
|
68
|
+
disableModelInvocation: preview.disableModelInvocation,
|
|
69
|
+
plugin: owner
|
|
70
|
+
});
|
|
71
|
+
} catch {}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return rows;
|
|
75
|
+
}
|
|
76
|
+
function pluginSkillPreview(name, store = new AgentPluginStore()) {
|
|
77
|
+
for (const plugin of store.list()) {
|
|
78
|
+
const skill = plugin.skills.find((skill) => pluginSkillName(plugin, skill.name) === name);
|
|
79
|
+
if (!skill) continue;
|
|
80
|
+
try {
|
|
81
|
+
return {
|
|
82
|
+
...buildSkillMarkdownPreviewFromRaw(readFileSync(containedPath(plugin.rootDir, skill.filePath), "utf8"), {
|
|
83
|
+
name,
|
|
84
|
+
description: ""
|
|
85
|
+
}),
|
|
86
|
+
name
|
|
87
|
+
};
|
|
88
|
+
} catch {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { pluginSkillName, pluginSkillPreview, withPluginSkillCatalog };
|
|
@@ -127,7 +127,7 @@ var AgentPluginStore = class {
|
|
|
127
127
|
});
|
|
128
128
|
const setupPath = join(this.stateDir, "plugin-setup", `${id}.json`);
|
|
129
129
|
const setup = existsSync(setupPath) ? JSON.parse(readFileSync(setupPath, "utf8")) : void 0;
|
|
130
|
-
const readiness = !valid || adapterChanged || capabilityChanged || inspection.layout?.compatibility.some((item) => item.component === "hooks" || item.component === "authorizations" && item.support === "invalid") ? "blocked" : setup?.packageRevision === receipt.revision && setup.state !== "completed" && !setup.installed ? "setup_required" : inspection.diagnostics.length || setup?.packageRevision === receipt.revision && (setup.partial || setup.installed && (setup.missingConfig?.length || setup.connections?.some((value) => value.state !== "connected") || setup.authorizations?.some((value) => value.state !== "connected"))) ? "degraded" : "ready";
|
|
130
|
+
const readiness = !valid || adapterChanged || capabilityChanged || inspection.layout?.compatibility.some((item) => item.component === "hooks" || item.component === "authorizations" && item.support === "invalid") ? "blocked" : setup?.packageRevision === receipt.revision && setup.state !== "completed" && !setup.installed ? "setup_required" : inspection.diagnostics.length || setup?.packageRevision === receipt.revision && (setup.partial || setup.installed && (setup.missingConfig?.length || setup.connections?.some((value) => value.state !== "connected") || setup.authorizations?.some((value) => value.state !== "connected" || !!value.issues?.length))) ? "degraded" : "ready";
|
|
131
131
|
return {
|
|
132
132
|
...inspection,
|
|
133
133
|
id,
|
|
@@ -7,8 +7,8 @@ import { DEFAULT_SECURITY_CONFIG, checkExtensionDirSafety, checkExtensionPathSaf
|
|
|
7
7
|
import { SlotRegistry, getSlotRegistry, registerSlotType } from "../slots.js";
|
|
8
8
|
import { ExtensionDiagnostics, ExtensionLoaderCacheImpl, getExtensionCache, getExtensionDiagnostics } from "../diagnostics.js";
|
|
9
9
|
import { ExtensionHookRunner, createHookContext, isHookEvent } from "../hooks.js";
|
|
10
|
-
import { registerExtensionCliProgram } from "./channel-helpers.js";
|
|
11
10
|
import { defineChannelPluginEntry } from "./channel-entry.js";
|
|
11
|
+
import { registerExtensionCliProgram } from "./channel-helpers.js";
|
|
12
12
|
import { lazyFunction, lazyModule } from "./lazy.js";
|
|
13
13
|
import { createMockExtensionApi, createTestGateway } from "./testing.js";
|
|
14
14
|
//#region src/extensions/sdk/index.ts
|
|
@@ -7,10 +7,10 @@ import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
|
7
7
|
import { loadTunnelState } from "../../tunnel/tunnel-state.js";
|
|
8
8
|
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
9
9
|
import { maxSessionInputRequestBodyBytes } from "../chat-limits.js";
|
|
10
|
+
import { BROWSER_EXTENSION_ID } from "../../browser/extension-identity.js";
|
|
10
11
|
import { isLoopbackIpAddress, isTrustedProxyAddress } from "../client-ip.js";
|
|
11
12
|
import { buildGatewayConsoleCspHeader } from "../security/csp.js";
|
|
12
13
|
import { checkBrowserOrigin, isChromeExtensionOrigin } from "../security/origin-check.js";
|
|
13
|
-
import { BROWSER_EXTENSION_ID } from "../../browser/extension-identity.js";
|
|
14
14
|
import { auth } from "./middleware/auth.js";
|
|
15
15
|
import { gatewayScopes } from "./middleware/scopes.js";
|
|
16
16
|
import { createChannelRateLimitMiddleware, createChatRateLimitMiddleware, createMediaRateLimitMiddleware, createStrictRateLimitMiddleware, createTaskRateLimitMiddleware, createXopcCloudPollRateLimitMiddleware } from "./middleware/strict-rate-limit.js";
|
|
@@ -3,9 +3,9 @@ import { PluginSelectionRequired } from "../../../extensions/agent-plugins/sourc
|
|
|
3
3
|
import { AgentPluginStore } from "../../../extensions/agent-plugins/store.js";
|
|
4
4
|
import { savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
5
5
|
import { evictAllEmbeddedSessionRunners } from "../../../agent/embedded/session-runner.js";
|
|
6
|
+
import { agentPluginInventoryRow } from "../../../extensions/agent-plugins/inventory.js";
|
|
6
7
|
import { withAgentPluginSource } from "../../../extensions/agent-plugins/sources.js";
|
|
7
8
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
8
|
-
import { agentPluginInventoryRow } from "../../../extensions/agent-plugins/inventory.js";
|
|
9
9
|
import { cancelPluginCliAuthorizations } from "../../../extensions/agent-plugins/cli-authorization.js";
|
|
10
10
|
import { PluginSetupService, setupActionSchema } from "../../../extensions/agent-plugins/setup.js";
|
|
11
11
|
import { removePluginCredentials } from "../../../extensions/agent-plugins/credentials.js";
|
|
@@ -3,11 +3,11 @@ import { ActivationPlanner } from "../../../extensions/activation-planner.js";
|
|
|
3
3
|
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
4
4
|
import { validateExtensionConfig } from "../../../extensions/config-validation.js";
|
|
5
5
|
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
6
|
+
import { listAgentPluginInventory } from "../../../extensions/agent-plugins/inventory.js";
|
|
6
7
|
import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
7
8
|
import { createOAuthHandler } from "../oauth.js";
|
|
8
9
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
9
10
|
import { loadExtensionStore, saveExtensionStore } from "../lib/extension-store.js";
|
|
10
|
-
import { listAgentPluginInventory } from "../../../extensions/agent-plugins/inventory.js";
|
|
11
11
|
import { relative, resolve } from "node:path";
|
|
12
12
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
13
13
|
//#region src/gateway/hono/routes/auth-registry-extensions.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
2
1
|
import { acquireBrowserInstallLock, cancelBrowserInstall } from "../../../browser/install-lock.js";
|
|
2
|
+
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
3
3
|
import { runPlaywrightChromiumInstallWithProgress } from "../../../browser/providers/playwright-install.js";
|
|
4
4
|
import { streamSSE } from "hono/streaming";
|
|
5
5
|
//#region src/gateway/hono/routes/browser-install.ts
|
|
@@ -10,6 +10,7 @@ import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "../..
|
|
|
10
10
|
import { getExtensionLockfileManager } from "../../extensions/lockfile.js";
|
|
11
11
|
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
12
12
|
import { normalizeSkillInstallTarget } from "../../agent/skills/install-target.js";
|
|
13
|
+
import { pluginSkillPreview, withPluginSkillCatalog } from "../../extensions/agent-plugins/skill-catalog.js";
|
|
13
14
|
import { isAgentPluginArchive, withAgentPluginArchive } from "../../extensions/agent-plugins/sources.js";
|
|
14
15
|
import { existsSync, rmSync } from "node:fs";
|
|
15
16
|
//#region src/gateway/service/marketplace-service.ts
|
|
@@ -52,7 +53,7 @@ var GatewayMarketplaceService = class {
|
|
|
52
53
|
getSkillsApi() {
|
|
53
54
|
const snapshot = this.opts.getAgentService().getSkillCatalogSnapshot();
|
|
54
55
|
return {
|
|
55
|
-
catalog: snapshot.catalog,
|
|
56
|
+
catalog: withPluginSkillCatalog(snapshot.catalog),
|
|
56
57
|
managed: listManagedSkillDirs(),
|
|
57
58
|
version: snapshot.version,
|
|
58
59
|
loadedAt: snapshot.loadedAt,
|
|
@@ -82,9 +83,10 @@ var GatewayMarketplaceService = class {
|
|
|
82
83
|
return this.opts.getAgentService().setSessionWorkspaceTrust(conversationId, trusted);
|
|
83
84
|
}
|
|
84
85
|
getSkillMarkdownSource(skillName) {
|
|
85
|
-
return this.opts.getAgentService().getSkillMarkdownSource(skillName);
|
|
86
|
+
return this.opts.getAgentService().getSkillMarkdownSource(skillName) ?? pluginSkillPreview(skillName);
|
|
86
87
|
}
|
|
87
88
|
deleteSkill(skillId, target) {
|
|
89
|
+
if (this.getSkillsApi().catalog.find((row) => row.name === skillId)?.origin.startsWith("plugin:")) throw new Error("This skill belongs to a plugin. Manage or uninstall the owning plugin instead.");
|
|
88
90
|
const requestedTarget = target ? this.resolveInstallTarget(target) : void 0;
|
|
89
91
|
const workspaceTarget = requestedTarget ?? this.resolveInstallTarget("workspace");
|
|
90
92
|
try {
|
|
@@ -81,6 +81,9 @@ import "../infra/bus/index.js";
|
|
|
81
81
|
import { collectMediaUrisFromMessages, deleteMediaUris } from "../media/session-references.js";
|
|
82
82
|
import { AgentService } from "../agent/service.js";
|
|
83
83
|
import { bootstrapApplicationStateSync } from "../bootstrap/application-state.js";
|
|
84
|
+
import { setPairingBroadcastSink } from "../channels/pairing/pairing-events.js";
|
|
85
|
+
import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
|
|
86
|
+
import { ChannelManager } from "../channels/manager.js";
|
|
84
87
|
import { ChatPreviewService } from "../chat-previews/service.js";
|
|
85
88
|
import "../chat-previews/index.js";
|
|
86
89
|
import { configureGatewayHttpProxy } from "../infra/http-proxy-env.js";
|
|
@@ -100,13 +103,8 @@ import { DiscussionSealer } from "../discussions/sealer.js";
|
|
|
100
103
|
import "../discussions/index.js";
|
|
101
104
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
102
105
|
import "../endpoint-tools/index.js";
|
|
103
|
-
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
104
|
-
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
105
|
-
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
106
|
-
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
107
106
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
108
107
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
109
|
-
import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
|
|
110
108
|
import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
|
|
111
109
|
import { getGatewayFileSpaceService } from "./file-space-service.js";
|
|
112
110
|
import { reconcileHomeIntelligenceAutomation } from "./home-intelligence-automation-reconciler.js";
|
|
@@ -120,8 +118,6 @@ import { WorkDiscoveryService } from "../work-discovery/service.js";
|
|
|
120
118
|
import { buildVoiceMemoryContext } from "../voice/realtime/memory-context.js";
|
|
121
119
|
import { buildVoicePersonaContext } from "../voice/realtime/persona-context.js";
|
|
122
120
|
import { voiceMemoryBudget, voicePersonaBudget } from "../voice/realtime/conversation-context.js";
|
|
123
|
-
import { setPairingBroadcastSink } from "../channels/pairing/pairing-events.js";
|
|
124
|
-
import { ChannelManager } from "../channels/manager.js";
|
|
125
121
|
import "../notes/index.js";
|
|
126
122
|
import { buildWorkflowChildTools } from "../agent/workflow/workflow-child-tools.js";
|
|
127
123
|
import { WorkflowRunService } from "../workflows/service/workflow-run-service.js";
|
|
@@ -167,6 +163,10 @@ import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decisio
|
|
|
167
163
|
import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
|
|
168
164
|
import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
|
|
169
165
|
import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
|
|
166
|
+
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
167
|
+
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
168
|
+
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
169
|
+
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
170
170
|
import crypto from "node:crypto";
|
|
171
171
|
//#region src/gateway/service.ts
|
|
172
172
|
init_session_repository();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
3
4
|
import { homePatternKey } from "./strategy.js";
|
|
5
|
+
import { HomeAdvicePolicy } from "./policy.js";
|
|
4
6
|
import { HomeIntelligenceRepository } from "./repository.js";
|
|
5
7
|
import { HomeOpportunityApplicationService } from "./application-service.js";
|
|
6
|
-
import { HomeAdvicePolicy } from "./policy.js";
|
|
7
|
-
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
8
8
|
import { buildHomeOpportunityNotification } from "./notification.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
//#region src/home-intelligence/host.ts
|
|
@@ -5,8 +5,8 @@ import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
|
5
5
|
import { init_gateway_scopes } from "../../gateway/security/gateway-scopes.js";
|
|
6
6
|
import { createDevice, getDevice, init_device_access_repository, registerInitialDeviceRefreshToken, revokeDevice } from "./device-access-repository.js";
|
|
7
7
|
import { getOrCreateGatewayIdentity, init_gateway_identity_repository } from "./gateway-identity-repository.js";
|
|
8
|
-
import "../../browser/extension-identity.js";
|
|
9
8
|
import { browserEnrollmentPublicKeyThumbprint } from "../../browser/enrollment.js";
|
|
9
|
+
import "../../browser/extension-identity.js";
|
|
10
10
|
import crypto from "node:crypto";
|
|
11
11
|
//#region src/storage/sqlite/device-pairing-approval.ts
|
|
12
12
|
init_src();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.399",
|
|
4
4
|
"description": "Local-first personal AI with Ada, task delegation, files, projects, workflows, and automations. Use cloud or local models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|