@xopcai/xopc 0.0.400 → 0.0.402
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-B7GhbbJl.js → agent-avatar-dicebear-DF_bLVLU.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-Bu_K45Ek.js → agent-defaults-settings-panel-CB96Cbva.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-ChQ0rVqM.js → agents-C97HREhT.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DXe_yRwn.js → app-management-settings-panel-Cr_dcDOi.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BzHQv_NH.js → appearance-settings-C5TsJu_t.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DRwxXHjg.js → apps-page-erjVBKui.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-D4OpAzgH.js → archive-plugin-CpsVjh9E.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CvoN7NI-.js → automations-page-Db1YnE2r.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-KgjR_a8V.js → automations-workspace-iTSZBSZf.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-BQ51byO-.js → binary-plugins-DYdnW_Fa.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CuaGcDNj.js → block-editor-HZ37eyhY.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BEj3E3Wg.js → browser-automation-inputs-B-V9Vc6B.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-bf2wLb_U.js → browser-automations-page-D0lBDbJO.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-B3B4j-fo.js → browser-settings-page-DIbXx7Ux.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CrMVZkHU.js → capabilities-page-DEZJFRU_.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-brKKbjb1.js → capabilities-settings-panel-BfdoIjPK.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-DrOc-yzD.js → capability-header-actions-BBPBfpGd.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-DwL_FBhH.js → channels-CapZyaWK.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DmNnS6TM.js → chat-terminal-dock-DQWv9Smb.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CzgZGc6E.js → computer-settings-page-CyPqxL6X.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BIfX9zNS.js → connector-service-page-DmCt-Kgx.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-e7r6aMEp.js → connectors-page-3xUE-PGt.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CbrbJS2K.js → date-picker-aOgNPu_Y.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-58ZbwNby.js → dependency-picker-oALjIlhN.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DwZJ9V8G.js → desktop-pet-pp9_jT3M.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-miynV1MT.js → desktop-pet-settings-BZCCh5T4.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CcOeWnx0.js → device-pairing-wizard-DpKzQlqA.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-6MGZG98P.js → directory-picker-path-field-LSNVNUaG.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-Dp_IJP6-.js → extension-debug-page-Bvy_tPme.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-pWuoYmVL.js → extension-page-D3J8-8AM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-SJ4T9oXh.js → extension-settings-page-F6KLsxCY.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Ds5gFBVs.js → gateway-settings-_YecsQF1.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-ChdUhMyZ.js → highlighted-body-KQOG7T2V-BCCIvIlA.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-BGjlHbXQ.js → home-page-DUoecphg.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-xTanSnq4.js → image-generation-api-DjQXmXWa.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DstG_R0Z.js → imports-page-Bg5N_9Vg.js} +1 -1
- package/dist/gateway/static/root/assets/{index-fDaRYOv1.js → index-cmsFpzI8.js} +8 -8
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CtSA2o-v.js → keyboard-shortcuts-settings-BxH3LBLL.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Bjy2vPj-.js → local-app-workbench-page-C7RejhJl.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BDApBgtY.js → local-apps-page-CsTZ1d01.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DePchbyj.js → logs-page-uLju0b0e.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-CfnxE6K5.js → management-settings-BkTmllrn.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bai9Og3V.js → media-plugins-CGq_o7tI.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DdlL1T6J.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-D9IfcVdl.js → note-detail-panel-Cps8VMV6.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-KGS9DAHs.js → notes-page-CdmoFpQ9.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-Hwj5mgvr.js → page-context-capture-button-BH9WwSgw.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-Bmkhjsrb.js → personal-page-UKNVJRDn.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-F3p7hZfb.js → plugin-details-dialog-gvBSFAhm.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-presentation-BTc9eGAc.js → plugin-presentation-C0la7V8t.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DAmgAXI9.js → preview-open-alternatives-rJ3l8Ii4.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Cvujq-at.js → product-open-page-CuzuFyIk.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-S1EfBQSH.js → product-preview-content-Dw2DstzN.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-nbeJjhHu.js → project-detail-page-C0XssfWQ.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-DKnFWTzc.js → projects-page-cT6yy_Xk.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DGjIoklN.js → remote-access-hub-CpEq4PU0.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CZHb7XN3.js → runtime-tools-settings-panel-CNar1-_V.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-P6uo4aTB.js → schema-form-D_cAMxj5.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-B-4njnNj.js → sessions-page-D5qR92KP.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-eKqVXNOq.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-h0HhEpiF.js → settings-form-section-DvLxOebb.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-AknPfAp8.js → settings-page-C6Tl6TD4.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BWfAXtFX.js → setup-status-panel-DuN4e4iO.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DELcrD4H.js → share-preview-page-BLraXBAe.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BPuThYz5.js → shares-settings-u2Y5Ljhu.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BZa6K-ss.js → skill-api-BE_i8VdM.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-kkS6CsDm.js → skill-reload-api-1xNCuBFH.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-CgbbAh89.js → skills-page-Clye5gro.js} +1 -1
- package/dist/gateway/static/root/assets/{style-p3jWw92_.js → style-pk3FR76e.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CnW46J1H.js → system-settings-panel-M550B6Mj.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-Cse314-c.js → task-detail-page-DqFhFqWu.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-DukbNSbs.js → tracing-settings-page-nXw76P46.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CnUDRk-U.js → tunnel-api-CC_TCY7S.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-LsoUOpYt.js → usage-page-BZ0t4KYM.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DmXcbSNm.js → use-autosave-DrxAqqzV.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-CfyppZWW.js → user-model-page-BAQOJoHC.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BS5WRLuc.js → voice-api-key-field-Bu4paIbu.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-9rVKP_hV.js → work-discovery-overlay-3TAUYZF4.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-qk5NOkwL.js → workflow-run-setup-panel-sgFaaLoB.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page--iOSBqMk.js → workflows-page-CxNXNDNc.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-B14g2TWE.js → xopc-cloud-account-card-DMZelX5s.js} +1 -1
- package/dist/gateway/static/root/index.html +1 -1
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +8 -4
- package/dist/src/agent/background-review/run-background-review.js +2 -2
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +6 -0
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/connection-drafts.js +2 -2
- package/dist/src/agent/mcp/connection-setup.js +1 -1
- package/dist/src/agent/mcp/credential-store-modules.d.ts +5 -0
- package/dist/src/agent/mcp/credential-store-modules.js +13 -0
- package/dist/src/agent/mcp/credential-store.js +2 -3
- package/dist/src/agent/service/process-direct-streaming.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +2 -1
- package/dist/src/agent/skills/skill-sources.js +9 -4
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -1
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.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/automations/service/action-executor.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/capabilities/store-connector.js +48 -13
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/chat-commands/context.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 +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/mcp.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-model-intents.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +69 -3
- package/dist/src/config/schema.js +13 -8
- package/dist/src/connectors/endpoint-policy.d.ts +7 -0
- package/dist/src/connectors/endpoint-policy.js +14 -0
- package/dist/src/connectors/materialize.js +16 -1
- package/dist/src/connectors/secret-store.js +4 -1
- package/dist/src/connectors/types.d.ts +2 -0
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/auth.js +1 -1
- package/dist/src/extensions/agent-plugins/capability-access.d.ts +23 -0
- package/dist/src/extensions/agent-plugins/capability-access.js +101 -0
- package/dist/src/extensions/agent-plugins/cli-authorization.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/cli-authorization.js +2 -2
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- package/dist/src/extensions/agent-plugins/inventory.js +1 -1
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +4 -4
- package/dist/src/extensions/agent-plugins/refresh-runtime-access.d.ts +3 -0
- package/dist/src/extensions/agent-plugins/refresh-runtime-access.js +36 -0
- package/dist/src/extensions/agent-plugins/setup-contract.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/setup-contract.js +1 -0
- package/dist/src/extensions/agent-plugins/setup.d.ts +4 -1
- package/dist/src/extensions/agent-plugins/setup.js +71 -38
- package/dist/src/extensions/agent-plugins/skill-catalog.js +2 -2
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- package/dist/src/extensions/agent-plugins/store.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/store.js +9 -2
- package/dist/src/extensions/agent-plugins/user-config.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +12 -2
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- 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.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +3 -3
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +5 -5
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
- 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/image-generation-setup.js +2 -2
- package/dist/src/gateway/service/config-coordinator.d.ts +23 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service.js +9 -9
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/imports/inventory.js +1 -1
- package/dist/src/imports/productImport.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/memory-learning/source-learning.js +1 -1
- package/dist/src/personal-agent/onboarding.d.ts +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/process/run-process.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- 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 +1 -1
- package/dist/src/user-context/access-policy.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/service.js +1 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-bXnI7rUg.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DfsiUGi6.js +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createLogger } from "../../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { pluginAuthorizations } from "./setup-contract.js";
|
|
4
|
+
import { resolvePluginCapabilityAccess } from "./capability-access.js";
|
|
5
|
+
import { AgentPluginStore } from "./store.js";
|
|
6
|
+
import { PluginSetupService } from "./setup.js";
|
|
7
|
+
//#region src/extensions/agent-plugins/refresh-runtime-access.ts
|
|
8
|
+
init_logger();
|
|
9
|
+
const log = createLogger("PluginRuntimeAccess");
|
|
10
|
+
/** Check provider-defined credentials before constructing a new turn's Skill index and MCP config. */
|
|
11
|
+
async function refreshPluginRuntimeAccess(config, workspace, agentId) {
|
|
12
|
+
const store = new AgentPluginStore(), service = new PluginSetupService(store);
|
|
13
|
+
const signature = () => JSON.stringify(store.active(agentId, workspace).map((plugin) => {
|
|
14
|
+
const access = resolvePluginCapabilityAccess(plugin, store);
|
|
15
|
+
return [
|
|
16
|
+
plugin.id,
|
|
17
|
+
plugin.skills.filter((s) => access.skill(s.name)).map((s) => s.name),
|
|
18
|
+
Object.keys(plugin.servers).filter(access.server)
|
|
19
|
+
];
|
|
20
|
+
}));
|
|
21
|
+
const before = signature();
|
|
22
|
+
for (const plugin of store.active(agentId, workspace)) {
|
|
23
|
+
if (!pluginAuthorizations(plugin.manifest).length && !Object.values(plugin.layout?.userConfig ?? {}).some((field) => field.sensitive) && Object.values(plugin.servers).every((server) => server.type === "stdio" || server.connectionAuth?.mode === "none")) continue;
|
|
24
|
+
try {
|
|
25
|
+
await service.refreshRuntime(plugin.id, config, workspace);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
log.warn({
|
|
28
|
+
err,
|
|
29
|
+
pluginId: plugin.id
|
|
30
|
+
}, "Could not refresh plugin authorization state");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return before !== signature();
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { refreshPluginRuntimeAccess };
|
|
@@ -65,6 +65,7 @@ const pluginPermissionIssueSchema = z.strictObject({
|
|
|
65
65
|
function parsePluginAuthorizationCheck(output, methodIds) {
|
|
66
66
|
const result = z.object({
|
|
67
67
|
authenticated: z.boolean(),
|
|
68
|
+
expiresAt: z.number().finite().optional(),
|
|
68
69
|
issues: z.array(pluginPermissionIssueSchema).max(20).default([])
|
|
69
70
|
}).parse(JSON.parse(output.trim().split("\n").at(-1)));
|
|
70
71
|
for (const issue of result.issues) {
|
|
@@ -39,6 +39,7 @@ declare const schema: z.ZodObject<{
|
|
|
39
39
|
deferred: z.ZodDefault<z.ZodBoolean>;
|
|
40
40
|
authorizations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
41
41
|
id: z.ZodString;
|
|
42
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
42
43
|
state: z.ZodEnum<{
|
|
43
44
|
error: "error";
|
|
44
45
|
pending: "pending";
|
|
@@ -117,10 +118,12 @@ export declare class PluginSetupService {
|
|
|
117
118
|
id: string;
|
|
118
119
|
name: string;
|
|
119
120
|
}>>>;
|
|
120
|
-
authorization(id: string, owner: string, server: string, config: Config): Promise<import("
|
|
121
|
+
authorization(id: string, owner: string, server: string, config: Config): Promise<import("./cli-authorization.js").PluginCliAuthorization | import("../../agent/mcp/connection-setup.js").McpAuthorization>;
|
|
121
122
|
redirect(id: string, owner: string, server: string, url: string, config: Config): boolean;
|
|
122
123
|
private config;
|
|
123
124
|
startPrepare(id: string, owner: string, revision: number, config: Config, workspace: string, idempotencyKey?: string): PluginSetupJob;
|
|
125
|
+
/** Recheck an installed revision without login prompts or resource downloads. */
|
|
126
|
+
refreshRuntime(id: string, config: Config, workspace: string): Promise<void>;
|
|
124
127
|
act(id: string, owner: string, input: z.infer<typeof setupActionSchema>, config: Config, workspace: string): Promise<PluginSetupJob>;
|
|
125
128
|
private perform;
|
|
126
129
|
}
|
|
@@ -11,8 +11,8 @@ import { readPluginAuthBinding, savePluginAuthBinding, savePluginOAuthReference
|
|
|
11
11
|
import { pluginConfigMissing, readPluginUserConfig, savePluginUserConfig } from "./user-config.js";
|
|
12
12
|
import { materializePluginServers } from "./mcp-adapter.js";
|
|
13
13
|
import { getNativePiAgentDir } from "../../agent/mcp/native-mcp.js";
|
|
14
|
-
import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../agent/mcp/connection-setup.js";
|
|
15
14
|
import { cancelPluginCliAuthorizations, getPluginCliAuthorization, inspectPluginCliAuthorization, startPluginCliAuthorization } from "./cli-authorization.js";
|
|
15
|
+
import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../agent/mcp/connection-setup.js";
|
|
16
16
|
import { join } from "node:path";
|
|
17
17
|
import { existsSync, readFileSync } from "node:fs";
|
|
18
18
|
import { randomUUID } from "node:crypto";
|
|
@@ -60,6 +60,7 @@ const schema = z.object({
|
|
|
60
60
|
deferred: z.boolean().default(false),
|
|
61
61
|
authorizations: z.array(z.object({
|
|
62
62
|
id: z.string(),
|
|
63
|
+
expiresAt: z.number().finite().optional(),
|
|
63
64
|
state: z.enum([
|
|
64
65
|
"pending",
|
|
65
66
|
"connected",
|
|
@@ -206,7 +207,7 @@ var PluginSetupService = class {
|
|
|
206
207
|
for (const [name, target] of Object.entries(plugin.servers)) {
|
|
207
208
|
result[name] = [];
|
|
208
209
|
for (const [sourceId, source] of Object.entries(config.mcp?.servers ?? {})) {
|
|
209
|
-
if (!matchingReusableConnection(target, source) ||
|
|
210
|
+
if (!matchingReusableConnection(target, source) || typeof source.url !== "string" || !source.xopcOAuthCredentialId) continue;
|
|
210
211
|
if (await credentials.tokens(source.xopcOAuthCredentialId, source.url)) result[name].push({
|
|
211
212
|
id: sourceId,
|
|
212
213
|
name: source.displayName ?? sourceId
|
|
@@ -265,6 +266,21 @@ var PluginSetupService = class {
|
|
|
265
266
|
});
|
|
266
267
|
return this.get(id, owner);
|
|
267
268
|
}
|
|
269
|
+
/** Recheck an installed revision without login prompts or resource downloads. */
|
|
270
|
+
async refreshRuntime(id, config, workspace) {
|
|
271
|
+
if (!existsSync(this.path(id)) || this.store.pending(id)) return;
|
|
272
|
+
const saved = schema.parse(JSON.parse(readFileSync(this.path(id), "utf8")));
|
|
273
|
+
if (saved.packageRevision !== this.store.receipt(id)?.revision || !saved.installed || saved.resources !== "ready" || !saved.connections.some((value) => value.state === "connected") && !saved.authorizations.some((value) => value.state === "connected") || saved.state === "cancelled" || running.has(this.key(id)) || lockfile.checkSync(this.path(id), { realpath: false })) return;
|
|
274
|
+
const release = lockfile.lockSync(this.path(id), { realpath: false });
|
|
275
|
+
try {
|
|
276
|
+
await this.perform(id, saved.owner, {
|
|
277
|
+
action: "prepare",
|
|
278
|
+
expectedRevision: saved.revision
|
|
279
|
+
}, config, workspace, true);
|
|
280
|
+
} finally {
|
|
281
|
+
release();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
268
284
|
async act(id, owner, input, config, workspace) {
|
|
269
285
|
const current = this.get(id, owner);
|
|
270
286
|
const previous = input.idempotencyKey && current?.operations.find((op) => op.key === input.idempotencyKey);
|
|
@@ -290,7 +306,7 @@ var PluginSetupService = class {
|
|
|
290
306
|
release();
|
|
291
307
|
}
|
|
292
308
|
}
|
|
293
|
-
async perform(id, owner, input, config, workspace) {
|
|
309
|
+
async perform(id, owner, input, config, workspace, refreshOnly = false) {
|
|
294
310
|
const job = this.get(id, owner);
|
|
295
311
|
if (!job) throw new Error("Setup not found");
|
|
296
312
|
if (job.revision !== input.expectedRevision) throw new Error("Setup changed. Refresh and retry.");
|
|
@@ -428,49 +444,58 @@ var PluginSetupService = class {
|
|
|
428
444
|
delete job.error;
|
|
429
445
|
this.write(job);
|
|
430
446
|
try {
|
|
431
|
-
await preparePluginResources(this.store, plugin, controller.signal);
|
|
447
|
+
if (!refreshOnly) await preparePluginResources(this.store, plugin, controller.signal);
|
|
432
448
|
job.resources = "ready";
|
|
433
449
|
job.missingConfig = pluginConfigMissing(this.store, plugin);
|
|
434
450
|
if (job.missingConfig.length) {
|
|
435
451
|
job.state = "action_required";
|
|
436
452
|
job.error = "Complete the required configuration fields.";
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
target.issues = check.issues;
|
|
444
|
-
} else if (method?.type === "form") {
|
|
445
|
-
const values = readPluginUserConfig(this.store, id, plugin.receipt.revision);
|
|
446
|
-
target.state = method.fields.every((key) => values[key] !== void 0 && values[key] !== "") ? "connected" : "pending";
|
|
447
|
-
}
|
|
453
|
+
}
|
|
454
|
+
for (const target of job.authorizations) {
|
|
455
|
+
const method = declarations.find((value) => value.id === target.id).methods.find((value) => value.id === target.method);
|
|
456
|
+
if (method?.type === "cli" && method.fields.some((key) => job.missingConfig.includes(key))) {
|
|
457
|
+
target.state = "pending";
|
|
458
|
+
continue;
|
|
448
459
|
}
|
|
449
|
-
|
|
450
|
-
controller.signal
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
delete server.toolCount;
|
|
458
|
-
continue;
|
|
459
|
-
}
|
|
460
|
-
const result = await probeMcpConnection(effective, workspace, pluginServerId(id, server.name), { signal: controller.signal });
|
|
461
|
-
controller.signal.throwIfAborted();
|
|
462
|
-
server.state = result.state;
|
|
463
|
-
server.toolCount = result.toolCount;
|
|
464
|
-
const persisted = this.get(id, owner);
|
|
465
|
-
if (!persisted || persisted.id !== job.id || persisted.revision !== job.revision || persisted.state === "cancelled" || !this.store.receipt(id)) throw new Error("Setup changed");
|
|
466
|
-
this.config(id, job.packageRevision, config);
|
|
467
|
-
this.write(job);
|
|
460
|
+
if (method?.type === "cli") {
|
|
461
|
+
const check = await inspectPluginCliAuthorization(this.store, plugin, target.id, method, controller.signal);
|
|
462
|
+
target.state = check.authenticated && (check.expiresAt === void 0 || check.expiresAt > Date.now()) ? "connected" : "pending";
|
|
463
|
+
target.issues = check.issues;
|
|
464
|
+
target.expiresAt = check.expiresAt;
|
|
465
|
+
} else if (method?.type === "form") {
|
|
466
|
+
const values = readPluginUserConfig(this.store, id, plugin.receipt.revision);
|
|
467
|
+
target.state = method.fields.every((key) => values[key] !== void 0 && values[key] !== "") ? "connected" : "pending";
|
|
468
468
|
}
|
|
469
|
-
for (const target of job.authorizations) target.state = declarations.find((value) => value.id === target.id).servers.every((name) => job.connections.find((value) => value.name === name)?.state === "connected") ? "connected" : "pending";
|
|
470
|
-
job.partial = plugin.diagnostics.length > 0;
|
|
471
|
-
if (job.connections.some((value) => value.state === "error")) job.error = "Connection verification failed. Check the credentials or login status and try again.";
|
|
472
|
-
job.state = "action_required";
|
|
473
469
|
}
|
|
470
|
+
for (const server of job.connections) {
|
|
471
|
+
controller.signal.throwIfAborted();
|
|
472
|
+
const unavailable = declarations.filter((value) => value.servers.includes(server.name)).some((gate) => {
|
|
473
|
+
const target = job.authorizations.find((value) => value.id === gate.id);
|
|
474
|
+
const method = gate.methods.find((value) => value.id === target.method);
|
|
475
|
+
return !method || method.type !== "oauth" && target.state !== "connected";
|
|
476
|
+
});
|
|
477
|
+
const missingServerConfig = job.missingConfig.some((key) => JSON.stringify(plugin.servers[server.name]).includes(`\${user_config.${key}}`));
|
|
478
|
+
if (unavailable || missingServerConfig) {
|
|
479
|
+
server.state = "skipped";
|
|
480
|
+
delete server.toolCount;
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
const result = await probeMcpConnection(effective, workspace, pluginServerId(id, server.name), { signal: controller.signal });
|
|
484
|
+
controller.signal.throwIfAborted();
|
|
485
|
+
server.state = result.state;
|
|
486
|
+
server.toolCount = result.toolCount;
|
|
487
|
+
const persisted = this.get(id, owner);
|
|
488
|
+
if (!persisted || persisted.id !== job.id || persisted.revision !== job.revision || persisted.state === "cancelled" || !this.store.receipt(id)) throw new Error("Setup changed");
|
|
489
|
+
this.config(id, job.packageRevision, config);
|
|
490
|
+
this.write(job);
|
|
491
|
+
}
|
|
492
|
+
for (const target of job.authorizations) {
|
|
493
|
+
const declaration = declarations.find((value) => value.id === target.id);
|
|
494
|
+
target.state = (declaration.methods.find((value) => value.id === target.method)?.type === "oauth" || target.state === "connected") && declaration.servers.every((name) => job.connections.find((value) => value.name === name)?.state === "connected") ? "connected" : "pending";
|
|
495
|
+
}
|
|
496
|
+
job.partial = plugin.diagnostics.length > 0;
|
|
497
|
+
if (job.connections.some((value) => value.state === "error")) job.error = "Connection verification failed. Check the credentials or login status and try again.";
|
|
498
|
+
job.state = "action_required";
|
|
474
499
|
this.config(id, job.packageRevision, config);
|
|
475
500
|
controller.signal.throwIfAborted();
|
|
476
501
|
if (this.get(id, owner)?.id !== job.id || this.get(id, owner)?.state === "cancelled") throw new Error("Setup changed");
|
|
@@ -478,6 +503,14 @@ var PluginSetupService = class {
|
|
|
478
503
|
} catch {
|
|
479
504
|
const current = this.get(id, owner);
|
|
480
505
|
if (!controller.signal.aborted && current?.id === job.id && current.revision === job.revision && current.state !== "cancelled" && (this.store.pending(id) ?? this.store.get(id))?.receipt.revision === job.packageRevision) {
|
|
506
|
+
for (const target of job.authorizations) target.state = "pending";
|
|
507
|
+
for (const connection of job.connections) {
|
|
508
|
+
const server = plugin.servers[connection.name];
|
|
509
|
+
if (server && (server.type !== "stdio" ? server.connectionAuth?.mode !== "none" : Object.values(server.env ?? {}).some((value) => Object.entries(plugin.layout?.userConfig ?? {}).some(([key, field]) => field.sensitive && value.includes(`\${user_config.${key}}`))))) {
|
|
510
|
+
connection.state = "error";
|
|
511
|
+
delete connection.toolCount;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
481
514
|
job.state = "failed";
|
|
482
515
|
if (job.resources !== "ready") job.resources = "error";
|
|
483
516
|
job.error = "Preparation failed. Retry after checking resources and connections.";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { containedPath } from "./validation.js";
|
|
2
|
+
import { AgentPluginStore } from "./store.js";
|
|
1
3
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
4
|
import { createSkillConfigManager } from "../../agent/skills/config.js";
|
|
3
5
|
import { parseSkillLocalizations } from "../../agent/skills/parse-skill-metadata.js";
|
|
4
|
-
import { containedPath } from "./validation.js";
|
|
5
|
-
import { AgentPluginStore } from "./store.js";
|
|
6
6
|
import { buildSkillMarkdownPreviewFromRaw } from "../../agent/skills/skill-markdown-preview-from-raw.js";
|
|
7
7
|
import { agentPluginInventoryRow } from "./inventory.js";
|
|
8
8
|
import { basename, dirname } from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockList, isIP } from "node:net";
|
|
2
|
-
import { Agent, fetch } from "undici";
|
|
3
2
|
import { lookup } from "node:dns";
|
|
3
|
+
import { Agent, fetch } from "undici";
|
|
4
4
|
//#region src/extensions/agent-plugins/source-http-fetch.ts
|
|
5
5
|
const blocked = new BlockList();
|
|
6
6
|
for (const [network, prefix] of [
|
|
@@ -66,12 +66,19 @@ var AgentPluginStore = class {
|
|
|
66
66
|
return readdirSync(this.receiptsDir()).filter((name) => name.endsWith(".json")).sort().map((name) => {
|
|
67
67
|
try {
|
|
68
68
|
const setupPath = join(this.stateDir, "plugin-setup", name);
|
|
69
|
-
return createHash("sha256").update(readFileSync(join(this.receiptsDir(), name))).update(existsSync(setupPath) ? readFileSync(setupPath) : "").digest("hex");
|
|
69
|
+
return createHash("sha256").update(readFileSync(join(this.receiptsDir(), name))).update(existsSync(setupPath) ? readFileSync(setupPath) : "").update(JSON.stringify(this.authorizationExpiryState(setupPath))).digest("hex");
|
|
70
70
|
} catch {
|
|
71
71
|
return "";
|
|
72
72
|
}
|
|
73
73
|
}).join("|");
|
|
74
74
|
}
|
|
75
|
+
authorizationExpiryState(path) {
|
|
76
|
+
try {
|
|
77
|
+
return (JSON.parse(readFileSync(path, "utf8")).authorizations ?? []).map((value) => value.expiresAt !== void 0 && value.expiresAt <= Date.now());
|
|
78
|
+
} catch {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
75
82
|
dataDir(id) {
|
|
76
83
|
return containedPath(this.stateDir, join(this.stateDir, "plugin-data", pluginName.parse(id)));
|
|
77
84
|
}
|
|
@@ -127,7 +134,7 @@ var AgentPluginStore = class {
|
|
|
127
134
|
});
|
|
128
135
|
const setupPath = join(this.stateDir, "plugin-setup", `${id}.json`);
|
|
129
136
|
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
|
|
137
|
+
const readiness = !valid || adapterChanged || capabilityChanged || inspection.layout?.compatibility.some((item) => item.component === "hooks" || ["authorizations", "capability-access"].includes(item.component) && 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
138
|
return {
|
|
132
139
|
...inspection,
|
|
133
140
|
id,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
-
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
2
|
import { pluginAuthorizations } from "./setup-contract.js";
|
|
4
3
|
import { pluginName } from "./validation.js";
|
|
4
|
+
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
5
5
|
import { pluginCredentialProviderPrefix } from "./auth.js";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { McpOAuthConfigSchema, init_schema } from "../../config/schema.js";
|
|
2
1
|
import { pluginAuthorizations, safeAuthorizationUrl } from "./setup-contract.js";
|
|
2
|
+
import { pluginCapabilityAccess } from "./capability-access.js";
|
|
3
3
|
import { normalizePluginMcpServer } from "./mcp-format.js";
|
|
4
|
+
import { McpOAuthConfigSchema, init_schema } from "../../config/schema.js";
|
|
4
5
|
import { pluginResources } from "./resources.js";
|
|
5
6
|
import { collectPluginSkillFiles, readPluginLayout } from "./formats.js";
|
|
6
7
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
7
8
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
8
9
|
import { createHash } from "node:crypto";
|
|
9
10
|
import { z } from "zod";
|
|
10
|
-
import yaml from "js-yaml";
|
|
11
11
|
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
12
|
+
import yaml from "js-yaml";
|
|
12
13
|
//#region src/extensions/agent-plugins/validation.ts
|
|
13
14
|
init_schema();
|
|
14
15
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
@@ -309,6 +310,15 @@ function inspectAgentPlugin(rootDir, dataDir = join(rootDir, ".inspection-data")
|
|
|
309
310
|
}
|
|
310
311
|
}
|
|
311
312
|
});
|
|
313
|
+
attempt("capability-access", () => {
|
|
314
|
+
const access = pluginCapabilityAccess(manifest);
|
|
315
|
+
const accounts = new Set(pluginAuthorizations(manifest).map((value) => value.id));
|
|
316
|
+
for (const [kind, rules] of Object.entries(access)) for (const [name, rule] of Object.entries(rules)) {
|
|
317
|
+
if (kind === "skills" ? !result.skills.some((skill) => skill.name === name) : !result.servers[name]) throw new Error(`Unknown ${kind} capability: ${name}`);
|
|
318
|
+
if (rule.servers.some((server) => !result.servers[server]) || rule.authorizations.some((value) => !accounts.has(typeof value === "string" ? value : value.id))) throw new Error(`Unknown capability dependency: ${name}`);
|
|
319
|
+
}
|
|
320
|
+
if (Object.keys(access.skills).length || Object.keys(access.mcp).length) result.capabilities.push(`runtime.capability-access:${JSON.stringify(access)}`);
|
|
321
|
+
});
|
|
312
322
|
result.capabilities.sort();
|
|
313
323
|
return result;
|
|
314
324
|
}
|
|
@@ -9,8 +9,8 @@ import { collectExtensionPackageDependencyIssues } from "./package-contract.js";
|
|
|
9
9
|
import { dirname, isAbsolute, join, resolve, sep } from "path";
|
|
10
10
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "fs";
|
|
11
11
|
import { execFileSync } from "node:child_process";
|
|
12
|
-
import semver from "semver";
|
|
13
12
|
import AdmZip from "adm-zip";
|
|
13
|
+
import semver from "semver";
|
|
14
14
|
import { tmpdir } from "os";
|
|
15
15
|
//#region src/extensions/install.ts
|
|
16
16
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_paths, resolveBundledExtensionsDir, resolveExtensionsDir } from "../config/paths.js";
|
|
4
|
-
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
5
4
|
import { computeExtensionDirectoryIntegrity, getExtensionLockfileManager } from "./lockfile.js";
|
|
5
|
+
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
6
6
|
import { loadConfig } from "../config/loader.js";
|
|
7
7
|
import { commitStagedExtensionInstall, finalizeStagedExtensionInstall, rollbackStagedExtensionInstall, stageExtensionNpm, stageExtensionStoreZip } from "./install-transaction.js";
|
|
8
8
|
import { findExtension } from "./marketplace.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
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 { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
5
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
4
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
|
+
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
7
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
8
8
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
9
9
|
import { resolve } from "node:path";
|
|
10
10
|
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 { extractProfileAgentId } from "../config/agent-profile.js";
|
|
4
3
|
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
5
5
|
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
6
|
import { isPathUnderWorkspace } from "./workspace-editor-path.js";
|
|
7
7
|
import { homedir } from "node:os";
|
|
@@ -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
3
|
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
|
-
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
5
4
|
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";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
2
1
|
import { PluginSelectionRequired } from "../../../extensions/agent-plugins/source-catalog.js";
|
|
3
2
|
import { AgentPluginStore } from "../../../extensions/agent-plugins/store.js";
|
|
3
|
+
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
4
4
|
import { savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
5
5
|
import { evictAllEmbeddedSessionRunners } from "../../../agent/embedded/session-runner.js";
|
|
6
|
+
import { cancelPluginCliAuthorizations } from "../../../extensions/agent-plugins/cli-authorization.js";
|
|
7
|
+
import { PluginSetupService, setupActionSchema } from "../../../extensions/agent-plugins/setup.js";
|
|
6
8
|
import { agentPluginInventoryRow } from "../../../extensions/agent-plugins/inventory.js";
|
|
7
9
|
import { withAgentPluginSource } from "../../../extensions/agent-plugins/sources.js";
|
|
8
10
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
9
|
-
import { cancelPluginCliAuthorizations } from "../../../extensions/agent-plugins/cli-authorization.js";
|
|
10
|
-
import { PluginSetupService, setupActionSchema } from "../../../extensions/agent-plugins/setup.js";
|
|
11
11
|
import { removePluginCredentials } from "../../../extensions/agent-plugins/credentials.js";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
//#region src/gateway/hono/routes/agent-plugins.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
1
2
|
import { AgentEntrySchema, AgentModelsOverrideSchema, AgentProfileSchema, RuntimePolicySchema, SkillOverrideSchema, ToolPoliciesSchema, WorkflowPolicySchema } from "../../../agent-config/schema.js";
|
|
2
3
|
import { init_agent_config } from "../../../agent-config/index.js";
|
|
3
|
-
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
4
4
|
import { init_agent_scope } from "../../../agent/agent-scope.js";
|
|
5
5
|
import { createGatewayAgent, deleteAgentAvatarFile, deleteGatewayAgent, getGatewayAgentEffectiveConfig, listAgentProfileFiles, listGatewayAgents, readAgentAvatarFile, readAgentProfileFile, resolveAgentAvatarImage, updateGatewayAgent, writeAgentAvatarFromBase64, writeAgentProfileFile } from "../../agents-admin.js";
|
|
6
6
|
import { getVoiceModelsConfig } from "../../../config/voice.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
-
import {
|
|
3
|
-
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config } from "../../../../user-context/config.js";
|
|
4
|
-
import { ComputerConfigSchema, init_config as init_config$1 } from "../../../../computer/config.js";
|
|
2
|
+
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
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";
|
|
@@ -14,11 +14,11 @@ import { assertGatewayRuntimeConfig } from "../../../runtime-config.js";
|
|
|
14
14
|
import { mergeRealtimeVoiceConfigPatch, mergeSttConfigPatch, mergeTtsConfigPatch } from "../../lib/safe-voice-config.js";
|
|
15
15
|
import { PATCH_OK, patchError } from "./result.js";
|
|
16
16
|
//#region src/gateway/hono/routes/config-patch/misc.ts
|
|
17
|
-
init_config
|
|
17
|
+
init_config();
|
|
18
18
|
init_schema();
|
|
19
19
|
init_binding_schema();
|
|
20
20
|
init_credentials();
|
|
21
|
-
init_config();
|
|
21
|
+
init_config$1();
|
|
22
22
|
async function applyMiscPatch(config, body) {
|
|
23
23
|
if (body.update !== void 0 && typeof body.update === "object" && body.update !== null) {
|
|
24
24
|
const updateResult = mergeUpdateConfigPatch(config, body.update);
|
|
@@ -21,13 +21,13 @@ import { createConnectorSetupSecretRequest, submitConnectorSetupSecret } from ".
|
|
|
21
21
|
import { recordConnectorHealthUsage } from "../../../connectors/usage.js";
|
|
22
22
|
import { getConnectorInstance, getInstalledConnectorDefinition, listConnectorInstances } from "../../../connectors/instances.js";
|
|
23
23
|
import { installConnector, installConnectorDefinition, uninstallConnector, updateConnectorConfig } from "../../../connectors/install.js";
|
|
24
|
-
import { ConfigPersistenceError, persistConfigMutation } from "../../../config/config-mutation.js";
|
|
25
24
|
import { resumeApprovedConnectorAction } from "../../../connectors/approval-resume.js";
|
|
26
25
|
import { startConnectorAuthorization } from "../../../connectors/auth-provider-registry.js";
|
|
27
26
|
import { composioLogoResponse } from "../../../connectors/composio-logo.js";
|
|
28
27
|
import { inspectManagedComposioStatus } from "../../../connectors/composio-managed-client.js";
|
|
29
28
|
import { appendComposioTriggerEvent, listComposioTriggerEvents } from "../../../connectors/composio-triggers.js";
|
|
30
29
|
import { ingestLocalFolderSource } from "../../../connectors/connected-source-ingestion.js";
|
|
30
|
+
import { ConfigPersistenceError, persistConfigMutation } from "../../../config/config-mutation.js";
|
|
31
31
|
import { testConnectorInstance } from "../../../connectors/health.js";
|
|
32
32
|
import { setConnectorEnabled } from "../../../connectors/lifecycle.js";
|
|
33
33
|
import { projectComposioConnectionStatus } from "../../../connectors/runtime-status.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
2
2
|
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
3
3
|
import { loadMergedMcpConfig } from "../../../agent/mcp/config.js";
|
|
4
|
-
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
5
4
|
import { resolveMcpSetupConfig } from "../../../agent/mcp/effective-server.js";
|
|
6
5
|
import { discoverMcpTools } from "../../../agent/mcp/tool-catalog.js";
|
|
7
6
|
import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../../agent/mcp/connection-setup.js";
|
|
7
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
8
8
|
import { McpConnectionDrafts, McpDraftError, mcpConfigRevision } from "../../../agent/mcp/connection-drafts.js";
|
|
9
9
|
import { withGatewayConfigWriteLock } from "../lib/config-write-lock.js";
|
|
10
10
|
//#region src/gateway/hono/routes/mcp.ts
|
|
@@ -2,10 +2,10 @@ import { getSqliteDatabase, init_transaction } from "../../../storage/sqlite/tra
|
|
|
2
2
|
import { getSessionMetadata } from "../../../storage/sqlite/session-read-repository.js";
|
|
3
3
|
import { init_session_repository } from "../../../storage/sqlite/session-repository.js";
|
|
4
4
|
import { getSessionConfig, init_config_repository } from "../../../storage/sqlite/config-repository.js";
|
|
5
|
+
import { init_config, resolveKnowledgeReadPolicy } from "../../../user-context/config.js";
|
|
5
6
|
import { bindOwnerIdentity } from "../../../user-context/identity-bindings.js";
|
|
6
7
|
import { canUseKnowledge, knowledgeExclusion } from "../../../knowledge-memory/usage-policy.js";
|
|
7
8
|
import { getKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
8
|
-
import { init_config, resolveKnowledgeReadPolicy } from "../../../user-context/config.js";
|
|
9
9
|
import { enqueueConversationLearning, learningStatus } from "../../../memory-learning/repository.js";
|
|
10
10
|
import "../../../knowledge-memory/index.js";
|
|
11
11
|
import { resolveEffectiveAgentProfileForSession } from "../../../config/agent-profile.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
1
2
|
import { getProviderSetupProfile, init_profiles } from "../../../providers/setup/profiles.js";
|
|
2
3
|
import { init_model_usage, withModelUsageOrigin } from "../../../providers/model-usage.js";
|
|
3
4
|
import { resolveEffectiveAgentConfigForAgent } from "../../../config/agent-profile.js";
|
|
4
5
|
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
5
|
-
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
6
6
|
import "../../../providers/constants.js";
|
|
7
7
|
import { computerModelProfile, init_model_policy, isDedicatedComputerModel } from "../../../computer/model-policy.js";
|
|
8
8
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.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 { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
13
11
|
import "../../../knowledge-memory/index.js";
|
|
14
12
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
15
13
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.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";
|
|
@@ -5,9 +5,9 @@ import { endpointContextSchema } from "../../../../packages/gateway-contract/src
|
|
|
5
5
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
6
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
7
7
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
8
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
8
9
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
9
10
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
10
|
-
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
11
11
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
12
12
|
import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
13
13
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
@@ -6,9 +6,9 @@ import { hasGatewayScope, init_gateway_scopes } from "../../security/gateway-sco
|
|
|
6
6
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
7
7
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
8
8
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
9
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
9
10
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
10
11
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
11
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
12
12
|
import { TaskCollaborationRepository } from "../../../tasks/task-collaboration-repository.js";
|
|
13
13
|
import { TaskCriterionReviewRepository } from "../../../tasks/task-criterion-review-repository.js";
|
|
14
14
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
@@ -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
3
|
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
4
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
|
-
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
6
4
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
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();
|