@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
2
|
-
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
3
2
|
import { getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "../../config/schema.js";
|
|
3
|
+
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
4
4
|
import { getDefaultModelSync, getModelsByProvider, init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue } from "../../config/model-input.js";
|
|
6
6
|
import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
|
|
@@ -186,7 +186,7 @@ var McpConnectionDrafts = class {
|
|
|
186
186
|
try {
|
|
187
187
|
const server = structuredClone(draft.server);
|
|
188
188
|
if (enable) server.enabled = true;
|
|
189
|
-
if (server.url) {
|
|
189
|
+
if (typeof server.url === "string") {
|
|
190
190
|
const state = await draft.credentials.forServer(draft.serverId, server.url).load();
|
|
191
191
|
const candidateAlias = `mcp_draft_${randomUUID().replaceAll("-", "")}`;
|
|
192
192
|
durable = await createNativeMcpCredentials();
|
|
@@ -237,7 +237,7 @@ var McpConnectionDrafts = class {
|
|
|
237
237
|
} finally {
|
|
238
238
|
draft.committing = false;
|
|
239
239
|
if (alias && this.options.readConfig().mcp?.servers?.[draft.serverId]?.xopcOAuthCredentialId === alias) published = true;
|
|
240
|
-
if (!published && alias && durable && draft.server.url) durable.remove(alias, draft.server.url);
|
|
240
|
+
if (!published && alias && durable && typeof draft.server.url === "string") durable.remove(alias, draft.server.url);
|
|
241
241
|
if (this.drafts.has(id) && draft.expiresAt <= Date.now()) this.dispose(draft);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -144,7 +144,7 @@ function startMcpAuthorization(config, workspace, serverId, owner, options) {
|
|
|
144
144
|
config = resolveMcpSetupConfig(config, serverId);
|
|
145
145
|
const server = config.mcp?.servers?.[serverId];
|
|
146
146
|
if (!server?.url || server.enabled === false || isManagedConnectorServer(server) && server.xopcConnector.enabled === false) throw new Error("An enabled HTTP MCP server is required.");
|
|
147
|
-
httpUrl(server.url);
|
|
147
|
+
if (typeof server.url === "string") httpUrl(server.url);
|
|
148
148
|
if (server.auth || Object.keys(server.headers ?? {}).some((name) => name.toLowerCase() === "authorization")) throw new Error("This server uses configured credentials. Remove Authorization before using OAuth.");
|
|
149
149
|
const scope = options?.authorizationScope ?? serverId;
|
|
150
150
|
for (const attempt of attempts.values()) if (attempt.owner === owner && attempt.scope === scope) cancel(attempt);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/agent/mcp/credential-store-modules.ts
|
|
2
|
+
/** pi 1.1 exposes credential injection but keeps its store constructors internal. */
|
|
3
|
+
async function loadNativeMcpCredentialModules() {
|
|
4
|
+
const root = import.meta.resolve("@earendil-works/pi-coding-agent");
|
|
5
|
+
const { McpOAuthCredentialStore } = await import(new URL("./extensions/mcp/oauth.js", root).href);
|
|
6
|
+
const { InMemoryAuthStorageBackend } = await import(new URL("./core/auth-storage.js", root).href);
|
|
7
|
+
return {
|
|
8
|
+
McpOAuthCredentialStore,
|
|
9
|
+
InMemoryAuthStorageBackend
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { loadNativeMcpCredentialModules };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { loadNativeMcpCredentialModules } from "./credential-store-modules.js";
|
|
1
2
|
//#region src/agent/mcp/credential-store.ts
|
|
2
3
|
/** Use pi's own stores; never change PI_CODING_AGENT_DIR for an individual connection. */
|
|
3
4
|
async function createNativeMcpCredentials(memory = false) {
|
|
4
|
-
const
|
|
5
|
-
const { McpOAuthCredentialStore } = await import(new URL("./extensions/mcp/oauth.js", root).href);
|
|
5
|
+
const { McpOAuthCredentialStore, InMemoryAuthStorageBackend } = await loadNativeMcpCredentialModules();
|
|
6
6
|
if (!memory) return new McpOAuthCredentialStore();
|
|
7
|
-
const { InMemoryAuthStorageBackend } = await import(new URL("./core/auth-storage.js", root).href);
|
|
8
7
|
return new McpOAuthCredentialStore(new InMemoryAuthStorageBackend());
|
|
9
8
|
}
|
|
10
9
|
/** Credential identity may change on commit without changing the public tool namespace. */
|
|
@@ -4,8 +4,8 @@ import { init_session_input_repository, listTaskUpdateTriggers } from "../../sto
|
|
|
4
4
|
import { getClarificationResumeInput, init_clarification_wait_repository } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
5
5
|
import { getConnectionResumeInput, init_connection_wait_repository } from "../../storage/sqlite/connection-wait-repository.js";
|
|
6
6
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
7
|
-
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
8
7
|
import { init_model_usage, modelUsageOriginFromTurn, withModelUsageOrigin } from "../../providers/model-usage.js";
|
|
8
|
+
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
9
9
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
10
10
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
11
11
|
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
@@ -2,13 +2,13 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_attachment_ref, parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
4
4
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
6
6
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
7
7
|
import { extractProfileAgentId, resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
8
|
-
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
9
8
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
10
9
|
import { configureTracing, flushTracing } from "../observability/runtime.js";
|
|
11
10
|
import { getUserTimezone } from "../user-model/repository.js";
|
|
11
|
+
import { extractTextContent } from "./context/workspace.js";
|
|
12
12
|
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
13
13
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
14
14
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveStateDir } from "../../config/paths-state.js";
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
-
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
5
4
|
import { init_paths } from "../../config/paths.js";
|
|
5
|
+
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
6
6
|
import { findInstallSpec, hasBinary, installSkill } from "./installer.js";
|
|
7
7
|
import { applySkillEnvOverrides, createSkillConfigManager, getSkillEnvironment, isSkillEnabled, resolveSkillConfig, validateSkillConfig } from "./config.js";
|
|
8
8
|
import { parseSkillToolConditions } from "./skill-tool-gating.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
1
|
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
|
+
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
3
3
|
import { loadSkillsLock } from "./hub-lock.js";
|
|
4
4
|
import { dirname, join, resolve, sep } from "node:path";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
1
|
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
|
+
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
3
3
|
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
4
4
|
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
5
5
|
import { fuzzyFindText, normalizeForFuzzyMatch, normalizeToLF, restoreLineEndings } from "../tools/edit-diff.js";
|
|
@@ -2,9 +2,9 @@ import { resolveStateDir } from "../../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { init_paths, resolveBundledSkillsDir } from "../../config/paths.js";
|
|
5
|
+
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
5
6
|
import { createSkillConfigManager, isSkillEnabled } from "./config.js";
|
|
6
7
|
import { formatSkillsForPrompt, selectSkillsVisibleInPrompt } from "./format-skills-prompt.js";
|
|
7
|
-
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
8
8
|
import { createSkillLoader } from "./index.js";
|
|
9
9
|
//#region src/agent/skills/skill-manager.ts
|
|
10
10
|
/**
|
|
@@ -157,6 +157,7 @@ var SkillManager = class {
|
|
|
157
157
|
return this.skillLoader.getDiagnostics();
|
|
158
158
|
}
|
|
159
159
|
getVersion() {
|
|
160
|
+
this.refreshPlugins();
|
|
160
161
|
return String(this.version);
|
|
161
162
|
}
|
|
162
163
|
getLoadedAt() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
|
-
import {
|
|
2
|
+
import { resolvePluginCapabilityAccess } from "../../extensions/agent-plugins/capability-access.js";
|
|
3
3
|
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
4
|
+
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
4
5
|
import { homedir } from "node:os";
|
|
5
6
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
6
7
|
import { existsSync, realpathSync } from "node:fs";
|
|
@@ -48,7 +49,11 @@ function resolveSkillSources(options, skillsConfig) {
|
|
|
48
49
|
const extraDirs = [...configuredExtraDirs, ...optionExtraDirs];
|
|
49
50
|
const sources = [];
|
|
50
51
|
const diagnostics = [];
|
|
51
|
-
|
|
52
|
+
const pluginStore = new AgentPluginStore();
|
|
53
|
+
for (const plugin of pluginStore.active(options.agentId, options.workspaceDir)) {
|
|
54
|
+
const access = resolvePluginCapabilityAccess(plugin, pluginStore);
|
|
55
|
+
const skills = plugin.skills.filter((skill) => access.skill(skill.name));
|
|
56
|
+
if (!skills.length) continue;
|
|
52
57
|
sources.push({
|
|
53
58
|
id: `plugin:${plugin.id}`,
|
|
54
59
|
rootDir: plugin.rootDir,
|
|
@@ -56,8 +61,8 @@ function resolveSkillSources(options, skillsConfig) {
|
|
|
56
61
|
scope: "global",
|
|
57
62
|
managed: false,
|
|
58
63
|
writable: false,
|
|
59
|
-
skillFiles:
|
|
60
|
-
skillAliases: plugin.layout?.dialect !== "portable" ? Object.fromEntries(
|
|
64
|
+
skillFiles: skills.map((skill) => skill.filePath),
|
|
65
|
+
skillAliases: plugin.layout?.dialect !== "portable" ? Object.fromEntries(skills.map((skill) => [skill.filePath, `${plugin.id}.${skill.name}`])) : void 0
|
|
61
66
|
});
|
|
62
67
|
diagnostics.push(...plugin.diagnostics.map((diagnostic) => ({
|
|
63
68
|
type: "warning",
|
|
@@ -2,8 +2,8 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../../tasks/task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
5
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
5
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
6
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
7
7
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
8
8
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
9
9
|
import { extractAssistantText, getAssistantMessageErrorReason, isTransientProviderErrorMessage, stripCodeFences } from "../../providers/model-response.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { checkUrlSafety, checkWebsiteBlocklist } from "./url-safety.js";
|
|
2
|
-
import { Agent, fetch } from "undici";
|
|
3
2
|
import { lookup } from "node:dns";
|
|
3
|
+
import { Agent, fetch } from "undici";
|
|
4
4
|
//#region src/agent/tools/fetch-text.ts
|
|
5
5
|
/** Validate each redirect and the address actually used for the connection. */
|
|
6
6
|
async function fetchPublicText(input, blocklist, signal) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CapabilityDispatcher } from "../../capabilities/runtime/dispatcher.js";
|
|
2
1
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
3
2
|
import { LOCAL_READ_MAX_CHARS } from "./local-read-budget.js";
|
|
4
3
|
import { getEmbeddedExecutionSession } from "../embedded/execution-context.js";
|
|
4
|
+
import { CapabilityDispatcher } from "../../capabilities/runtime/dispatcher.js";
|
|
5
5
|
import { registerNoteReadCapabilities } from "../../notes/capabilities/read.js";
|
|
6
6
|
import { registerProjectReadCapabilities } from "../../projects/capabilities/read.js";
|
|
7
7
|
import { registerAutomationReadCapabilities } from "../../automations/capabilities/read.js";
|
|
@@ -11,13 +11,13 @@ import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
|
11
11
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
12
12
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
13
13
|
import "../../activity/index.js";
|
|
14
|
-
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
15
|
-
import "../../capabilities/runtime/dispatcher.js";
|
|
16
14
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
17
15
|
import { hasUnlocalizedTaskText, resolveTaskLocale } from "../../tasks/task-language.js";
|
|
18
16
|
import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
|
|
19
17
|
import { TaskOriginRepository } from "../../tasks/task-origin-repository.js";
|
|
20
18
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
19
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
20
|
+
import "../../capabilities/runtime/dispatcher.js";
|
|
21
21
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
22
22
|
import "../../projects/index.js";
|
|
23
23
|
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AgentEntrySchema, EffectiveAgentConfigSchema } from "../agent-config/schema.js";
|
|
2
2
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
3
3
|
import { init_agent_config } from "../agent-config/index.js";
|
|
4
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
5
|
-
import { defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
6
4
|
import { AgentCatalogRepository, init_repository } from "./repository.js";
|
|
7
5
|
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
6
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
7
|
+
import { defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
8
8
|
import { AgentCatalogService } from "./service.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/agent-catalog/capabilities.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getXopcDatabase } from "../../storage/sqlite/connection.js";
|
|
2
2
|
import { runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
3
3
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
4
5
|
import { AgentDefaultsSchema, AgentEntrySchema, AgentIdSchema, DEFAULT_AGENT_MODEL_REF, DEFAULT_SKILL_POLICY } from "../../agent-config/schema.js";
|
|
5
6
|
import { init_agent_config } from "../../agent-config/index.js";
|
|
6
7
|
import { BindingsSchema, init_binding_schema } from "../../routing/binding-schema.js";
|
|
7
8
|
import { AgentCatalogRepository, init_repository } from "../repository.js";
|
|
8
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
9
9
|
import { backupDatabaseBeforeCutover } from "../../storage/sqlite/migrations/conversation-backup.js";
|
|
10
10
|
import { copyFileSync, existsSync, readFileSync } from "node:fs";
|
|
11
11
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
3
3
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
4
|
+
import { DEFAULT_AGENT_ID, init_id, normalizeAgentId } from "./id.js";
|
|
4
5
|
import { AgentDefaultsSchema, AgentEntrySchema, DEFAULT_AGENT_MODEL_REF, DEFAULT_SKILL_POLICY } from "../agent-config/schema.js";
|
|
5
6
|
import { init_agent_config } from "../agent-config/index.js";
|
|
6
|
-
import { DEFAULT_AGENT_ID, init_id, normalizeAgentId } from "./id.js";
|
|
7
7
|
import { BindingsSchema, init_binding_schema } from "../routing/binding-schema.js";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
//#region src/agent-catalog/repository.ts
|
|
@@ -3,8 +3,8 @@ import { generatePKCE, init_pkce } from "./pkce.js";
|
|
|
3
3
|
import { init_resolution, resolveConnectedPlatformEndpoint } from "../../platform/resolution.js";
|
|
4
4
|
import { hostname } from "node:os";
|
|
5
5
|
import { randomBytes } from "node:crypto";
|
|
6
|
-
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
7
6
|
import http from "node:http";
|
|
7
|
+
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
8
8
|
//#region src/auth/oauth/xopc-cloud.ts
|
|
9
9
|
function consoleUrl() {
|
|
10
10
|
return (process.env.XOPC_CONSOLE_URL ?? resolveConnectedPlatformEndpoint("authorizationServer") ?? DEFAULT_CONSOLE_URL).replace(/\/+$/, "");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
3
2
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveOAuthPath } from "../config/paths.js";
|
|
3
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
4
4
|
import { assertCurrentModelProvider, init_provider_policy } from "../providers/provider-policy.js";
|
|
5
5
|
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -3,10 +3,10 @@ import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
|
3
3
|
import { init_trust_policy, resolveAutomationSafetyForTrust } from "../../user-context/trust-policy.js";
|
|
4
4
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
5
5
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
6
|
+
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
6
7
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
7
8
|
import { ExternalEffectNotAppliedError } from "../../capabilities/runtime/external-operations.js";
|
|
8
9
|
import { defineExternalCapability, defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
9
|
-
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
10
10
|
import { AutomationCreateCapabilityInputSchema } from "./write.js";
|
|
11
11
|
import { simulateAutomation } from "../draft/automation-draft-validator.js";
|
|
12
12
|
import { AutomationDraftService } from "../draft/automation-draft-service.js";
|
|
@@ -2,8 +2,8 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
4
4
|
import { init_agent_scope } from "../../agent/agent-scope.js";
|
|
5
|
-
import { init_session_key, resolveConversationId } from "../../routing/session-key.js";
|
|
6
5
|
import { init_model_usage, withModelUsageOrigin } from "../../providers/model-usage.js";
|
|
6
|
+
import { init_session_key, resolveConversationId } from "../../routing/session-key.js";
|
|
7
7
|
import { resolveAutomationTimeoutSeconds } from "../domain/defaults.js";
|
|
8
8
|
//#region src/automations/service/action-executor.ts
|
|
9
9
|
init_model_usage();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
2
2
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
3
|
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
4
|
+
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
4
5
|
import { cutoverLegacyAgentConfig } from "../agent-catalog/migrations/legacy-config-cutover.js";
|
|
5
6
|
import "../agent-catalog/index.js";
|
|
6
|
-
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
7
7
|
import { migrateIdentityMarkdownToCatalog } from "../agent-catalog/migrations/identity-markdown-cutover.js";
|
|
8
8
|
import { migrateCloudPublicModelsSync } from "../migrations/cloud-public-models.js";
|
|
9
9
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
@@ -13,8 +13,8 @@ import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSy
|
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
14
|
import { execFileSync, spawn } from "node:child_process";
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
16
|
-
import { readFile, readdir, rm } from "node:fs/promises";
|
|
17
16
|
import AdmZip from "adm-zip";
|
|
17
|
+
import { readFile, readdir, rm } from "node:fs/promises";
|
|
18
18
|
//#region src/browser/providers/browser-ext-install.ts
|
|
19
19
|
/**
|
|
20
20
|
* Install bundled Chrome extension artifacts into {resolveBinDir()}/browser-ext/.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SqliteCommitEffectError, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
-
import { OperationConflictError, executeAtomicOperation } from "./atomic-operations.js";
|
|
3
2
|
import { CapabilityError } from "./errors.js";
|
|
4
3
|
import { executeExternalOperation } from "./external-operations.js";
|
|
4
|
+
import { OperationConflictError, executeAtomicOperation } from "./atomic-operations.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/capabilities/runtime/dispatcher.ts
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CapabilityError } from "./errors.js";
|
|
2
2
|
import { CapabilityDispatcher } from "./dispatcher.js";
|
|
3
|
-
import { registerAgentCapabilities } from "../../agent-catalog/capabilities.js";
|
|
4
3
|
import { registerLocalAppReadCapabilities } from "../../local-apps/capabilities/read.js";
|
|
5
4
|
import { registerNoteReadCapabilities } from "../../notes/capabilities/read.js";
|
|
6
5
|
import { registerNoteWriteCapabilities } from "../../notes/capabilities/write.js";
|
|
@@ -17,6 +16,7 @@ import { registerAutomationDraftCapabilities } from "../../automations/capabilit
|
|
|
17
16
|
import { registerTaskWriteCapabilities } from "../../tasks/capabilities/write.js";
|
|
18
17
|
import { registerSettingsCapability } from "./settings.js";
|
|
19
18
|
import { registerAppContextCapability } from "./app-context.js";
|
|
19
|
+
import { registerAgentCapabilities } from "../../agent-catalog/capabilities.js";
|
|
20
20
|
//#region src/capabilities/runtime/product.ts
|
|
21
21
|
function createProductDispatcher(getNotes, taskWrites) {
|
|
22
22
|
const dispatcher = new CapabilityDispatcher();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { getCliAdapter } from "../connectors/cli/adapterRegistry.js";
|
|
2
|
+
import { validEndpointDomain } from "../connectors/endpoint-policy.js";
|
|
2
3
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
3
4
|
import { installConnectorDefinition } from "../connectors/install.js";
|
|
4
5
|
import { downloadConnectorStoreZipBuffer, fetchStoreConnectorPackageDetail, listConnectorPackages, resolveSkillsStoreBaseUrl } from "../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
5
6
|
import { createHash } from "node:crypto";
|
|
6
|
-
import { isIP } from "node:net";
|
|
7
7
|
import AdmZip from "adm-zip";
|
|
8
|
+
import { isIP } from "node:net";
|
|
8
9
|
//#region src/capabilities/store-connector.ts
|
|
9
10
|
const STORE_CONNECTOR_CANDIDATE_PREFIX = "store-connector:";
|
|
10
11
|
function storeConnectorCandidateRef(packageName, version) {
|
|
@@ -130,8 +131,7 @@ function readSetup(value) {
|
|
|
130
131
|
}
|
|
131
132
|
function assertDeclaredTemplateReferences(value, setupKeys) {
|
|
132
133
|
if (typeof value === "string") {
|
|
133
|
-
const match
|
|
134
|
-
if (match && !setupKeys.has(`${match[1]}:${match[2]}`)) throw new Error(`Connector template references undeclared ${match[1]} field "${match[2]}".`);
|
|
134
|
+
for (const match of value.matchAll(/\{\{(secrets|config)\.([A-Za-z0-9_.-]+)\}\}/g)) if (!setupKeys.has(`${match[1]}:${match[2]}`)) throw new Error(`Connector template references undeclared ${match[1]} field "${match[2]}".`);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
if (Array.isArray(value)) {
|
|
@@ -152,6 +152,10 @@ function assertSafeRemoteUrl(value) {
|
|
|
152
152
|
}
|
|
153
153
|
const hostname = url.hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
154
154
|
if (url.protocol !== "https:" || url.username || url.password || hostname === "localhost" || hostname.endsWith(".localhost") || isIP(hostname)) throw new Error("Store connectors must use a public HTTPS MCP endpoint.");
|
|
155
|
+
if (/\{\{/.test(urlString)) {
|
|
156
|
+
if ([...urlString.matchAll(/\{\{secrets\.([A-Za-z0-9_.-]+)\}\}/g)].length !== 1 || /^https:\/\/[^/?#]*\{\{/.test(urlString) || url.hash) throw new Error("Connector URL may contain one secret in its path or query only.");
|
|
157
|
+
return urlString;
|
|
158
|
+
}
|
|
155
159
|
return url.toString();
|
|
156
160
|
}
|
|
157
161
|
function readPermissions(value, isLocal) {
|
|
@@ -263,7 +267,21 @@ function readConnectorManifest(value, packageName, version, sha256) {
|
|
|
263
267
|
mode: "oauth",
|
|
264
268
|
...clientId ? { clientId } : {}
|
|
265
269
|
} : { mode: authMode };
|
|
266
|
-
const
|
|
270
|
+
const marketCategory = asString(manifest.category, "Connector category");
|
|
271
|
+
const category = {
|
|
272
|
+
logistics: "data",
|
|
273
|
+
commerce: "data",
|
|
274
|
+
analytics: "data",
|
|
275
|
+
projects: "automation",
|
|
276
|
+
design: "docs",
|
|
277
|
+
productivity: "automation",
|
|
278
|
+
industry: "data",
|
|
279
|
+
sales: "automation",
|
|
280
|
+
marketing: "automation",
|
|
281
|
+
finance: "data",
|
|
282
|
+
hr: "automation",
|
|
283
|
+
legal: "docs"
|
|
284
|
+
}[marketCategory] ?? marketCategory;
|
|
267
285
|
if (![
|
|
268
286
|
"code",
|
|
269
287
|
"docs",
|
|
@@ -271,7 +289,7 @@ function readConnectorManifest(value, packageName, version, sha256) {
|
|
|
271
289
|
"data",
|
|
272
290
|
"automation",
|
|
273
291
|
"custom"
|
|
274
|
-
].includes(category)) throw new Error(`Unsupported connector category: ${
|
|
292
|
+
].includes(category)) throw new Error(`Unsupported connector category: ${marketCategory}`);
|
|
275
293
|
const capabilities = asStringArray(manifest.capabilities, "Connector capabilities");
|
|
276
294
|
const allowedCapabilities = new Set([
|
|
277
295
|
"tools",
|
|
@@ -291,8 +309,20 @@ function readConnectorManifest(value, packageName, version, sha256) {
|
|
|
291
309
|
const { setup, keys: setupKeys } = readSetup(manifest.setup);
|
|
292
310
|
assertDeclaredTemplateReferences(serverTemplate, setupKeys);
|
|
293
311
|
const permissions = readPermissions(manifest.permissions, Boolean(localPackage));
|
|
294
|
-
const
|
|
295
|
-
|
|
312
|
+
const endpointReference = typeof serverTemplate.url === "string" ? TEMPLATE_PATTERN.exec(serverTemplate.url) : null;
|
|
313
|
+
let endpointPolicy;
|
|
314
|
+
if (!localPackage && endpointReference) {
|
|
315
|
+
const policy = asRecord(runtime.endpointPolicy, "Connector endpoint policy");
|
|
316
|
+
const domains = asStringArray(policy.domains, "Connector endpoint domains");
|
|
317
|
+
const pathPrefixes = asStringArray(policy.pathPrefixes, "Connector endpoint paths");
|
|
318
|
+
if (endpointReference[1] !== "secrets" || !domains.length || domains.some((domain) => !validEndpointDomain(domain)) || !pathPrefixes.length || pathPrefixes.some((path) => !path.startsWith("/") || /[?#]|\.\./.test(path)) || domains.some((domain) => !permissions.networkDomains?.includes(domain))) throw new Error("Connector endpoint policy must constrain a secret URL to declared provider domains and MCP paths.");
|
|
319
|
+
endpointPolicy = {
|
|
320
|
+
domains,
|
|
321
|
+
pathPrefixes
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const endpoint = localPackage ? void 0 : endpointReference ? serverTemplate.url : assertSafeRemoteUrl(serverTemplate.url);
|
|
325
|
+
const hostname = endpoint && !endpointReference ? new URL(endpoint).hostname : void 0;
|
|
296
326
|
if (hostname && permissions.networkDomains?.length && !permissions.networkDomains.some((domain) => domain.toLowerCase() === hostname.toLowerCase())) throw new Error("Connector network permissions must include the MCP endpoint host.");
|
|
297
327
|
return {
|
|
298
328
|
id: packageName,
|
|
@@ -310,14 +340,19 @@ function readConnectorManifest(value, packageName, version, sha256) {
|
|
|
310
340
|
type: "mcp",
|
|
311
341
|
serverId: asString(runtime.serverId, "Connector MCP serverId"),
|
|
312
342
|
serverTemplate: localPackage ? serverTemplate : {
|
|
313
|
-
...serverTemplate
|
|
343
|
+
...Object.fromEntries(Object.entries(serverTemplate).filter(([key]) => ![
|
|
344
|
+
"transport",
|
|
345
|
+
"connectionTimeoutMs",
|
|
346
|
+
"requestTimeoutMs",
|
|
347
|
+
"oauth"
|
|
348
|
+
].includes(key))),
|
|
314
349
|
url: endpoint,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
} } : {}
|
|
350
|
+
type: "http",
|
|
351
|
+
...typeof serverTemplate.requestTimeoutMs === "number" || typeof serverTemplate.connectionTimeoutMs === "number" ? { timeout: serverTemplate.requestTimeoutMs ?? serverTemplate.connectionTimeoutMs } : {},
|
|
352
|
+
...authMode === "oauth" ? { oauth: { ...clientId ? { clientId } : {} } } : {}
|
|
319
353
|
},
|
|
320
|
-
...localPackage ? { localPackage } : {}
|
|
354
|
+
...localPackage ? { localPackage } : {},
|
|
355
|
+
...endpointPolicy ? { endpointPolicy } : {}
|
|
321
356
|
},
|
|
322
357
|
permissions,
|
|
323
358
|
provenance: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
4
3
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
4
|
+
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
5
5
|
import { commandRegistry } from "./registry.js";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
4
3
|
import { init_paths, resolveConfigPath } from "../../config/paths.js";
|
|
4
|
+
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
5
5
|
import { commandRegistry } from "../registry.js";
|
|
6
6
|
import { parseConfigValue } from "../config-value.js";
|
|
7
7
|
import { getConfigValueAtPath, parseConfigPath, setConfigValueAtPath, unsetConfigValueAtPath } from "../config-paths.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
4
3
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
4
|
+
import { resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
5
5
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
6
6
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
7
7
|
import { getSessionDisplayName } from "./session-key.js";
|
|
@@ -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_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
|
-
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
5
4
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
5
|
+
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
6
6
|
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
7
7
|
import { ExtensionLoader } from "../../extensions/loader.js";
|
|
8
8
|
import "../../extensions/index.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
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, resolveAgentDir, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
5
4
|
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
5
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
6
6
|
import { colors } from "../utils/colors.js";
|
|
7
7
|
//#region src/cli/commands/agents.ts
|
|
8
8
|
init_repository();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../../../../agent-catalog/repository.js";
|
|
2
|
-
import { getDefaultAgentId, init_resolve_route } from "../../../../routing/resolve-route.js";
|
|
3
2
|
import { getAgentDefaultModelRef, init_schema, parseModelRef } from "../../../../config/schema.js";
|
|
3
|
+
import { getDefaultAgentId, init_resolve_route } from "../../../../routing/resolve-route.js";
|
|
4
4
|
import { PROVIDER_ENV_MAP, init_env_keys } from "../../../../providers/env-keys.js";
|
|
5
5
|
import { getModelOAuthProviderIds, init_registry } from "../../../../auth/oauth/registry.js";
|
|
6
6
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
2
1
|
import { pluginAuthorizations } from "../../extensions/agent-plugins/setup-contract.js";
|
|
3
2
|
import { PLUGIN_MANIFEST_PATHS } from "../../extensions/agent-plugins/formats.js";
|
|
4
3
|
import { pluginServerId } from "../../extensions/agent-plugins/validation.js";
|
|
5
4
|
import { isGitPluginSource } from "../../extensions/agent-plugins/source-catalog.js";
|
|
6
5
|
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
6
|
+
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
7
7
|
import { loadConfig } from "../../config/loader.js";
|
|
8
|
+
import { PluginSetupService } from "../../extensions/agent-plugins/setup.js";
|
|
8
9
|
import { getContextWithOpts } from "../context.js";
|
|
9
10
|
import { isAgentPluginArchive, withAgentPluginSource } from "../../extensions/agent-plugins/sources.js";
|
|
10
|
-
import { PluginSetupService } from "../../extensions/agent-plugins/setup.js";
|
|
11
11
|
import { removePluginCredentials } from "../../extensions/agent-plugins/credentials.js";
|
|
12
12
|
import { join, resolve } from "node:path";
|
|
13
13
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths, resolveExtensionsDir } from "../../config/paths.js";
|
|
2
|
-
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
3
2
|
import { computeExtensionDirectoryIntegrity, getExtensionLockfileManager } from "../../extensions/lockfile.js";
|
|
4
3
|
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
4
|
+
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
5
5
|
import { loadConfig } from "../../config/loader.js";
|
|
6
6
|
import { getContextWithOpts } from "../context.js";
|
|
7
7
|
import { peekExtensionManifestFromStoreZip } from "../../extensions/install.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths, resolveConfigPath } from "../../../config/paths.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
5
4
|
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
5
|
+
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
6
6
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "../../../infra/restart.js";
|
|
7
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
8
8
|
import { runServiceRestart, runServiceStop } from "./lifecycle-core.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getNativePiAgentDir, prepareNativeMcpConfig } from "../../agent/mcp/native-mcp.js";
|
|
2
2
|
import { loadConfig } from "../../config/loader.js";
|
|
3
|
+
import { resolveMcpSetupConfig } from "../../agent/mcp/effective-server.js";
|
|
3
4
|
import { register } from "../registry.js";
|
|
4
5
|
import { createGatewayHttpClientFromConfig } from "../../mcp/gateway-http-client.js";
|
|
5
6
|
import { createCapabilityMcpServer } from "../../mcp/capability-server.js";
|
|
6
|
-
import { resolveMcpSetupConfig } from "../../agent/mcp/effective-server.js";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { chmodSync, existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { main } from "@earendil-works/pi-coding-agent";
|