@xopcai/xopc 0.0.232 → 0.0.234
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/{activity-store-VXCWz43N.js → activity-store-BzswYHcj.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BXRaZYW8.js → agent-avatar-dicebear-CztNAQyE.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BHeLVAW5.js +1 -0
- package/dist/gateway/static/root/assets/agents-B8c0U7Ze.js +1 -0
- package/dist/gateway/static/root/assets/{api-wGPgL8xY.js → api-7zOtMbaE.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BJfClfPx.js → app-management-settings-panel-BxBMAdWc.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C_R0vUAu.js → appearance-settings-DVAxCOPL.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CBow8pBI.js → apps-page-BtzXxSYK.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DnFHkSHE.js → archive-plugin-DawToDU8.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DZrEwytM.js → attachment-load-BpCKsdiO.js} +1 -1
- package/dist/gateway/static/root/assets/attachment-preview-renderer-BDTD8YUe.js +12 -0
- package/dist/gateway/static/root/assets/{automations-page-DpkKajui.js → automations-page-a6_hTplT.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-C7ZwZl04.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Ckc_Csue.js → binary-plugins-OqUf-uET.js} +2 -2
- package/dist/gateway/static/root/assets/{block-editor-DAC6w-iV.js → block-editor-9OAYqVKF.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-CEHhbDj0.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BGd7R8GO.js → browser-workflow-inputs-4ooVX-Tx.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DUfj7ntM.js → browser-workflows-page-CUgwXXsi.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-97gkGeSV.js → capabilities-settings-panel-CAbI9beX.js} +5 -5
- package/dist/gateway/static/root/assets/channels-settings-BksDnAyv.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-CfboECLt.js → channels-status-swr-BDJvMnA_.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CA9fndbZ.js → chat-terminal-dock-DB9zi_dy.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-CnY8lcGJ.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-CqPu7HYJ.js → cron-expression-a9Jyianb.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-C8dJsCgk.js → date-picker-B_l2CHWO.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Iz2wYimy.js → dependency-picker-DjcEIzVJ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-C3h40FmG.js → desktop-pet-ZCBsj8Je.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-YfeVVzLe.js → desktop-pet-settings-DJJf0EvL.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CChgztz_.js → extension-debug-page-CMXbAkx-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DF6ct6_y.js → extension-page-WWePedpo.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-jgBsjn0F.js → extension-settings-page-DjIhNJVI.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-CVajuIGL.js → gateway-config-api-BNj6srhV.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BGQn8duh.js → gateway-config-swr-R702lNJR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BbssNGid.js → gateway-settings-DvlFDxhZ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-D2Rnh9fX.js → gateway-startup-retry-2rVSUvyw.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-Dlahslof.js +1 -0
- package/dist/gateway/static/root/assets/home-page-DJhUd30b.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D7W2p5_8.js → image-generation-api-B28USRCK.js} +1 -1
- package/dist/gateway/static/root/assets/index-BTUuTnc9.css +2 -0
- package/dist/gateway/static/root/assets/index-CXGQihfj.js +70 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BvHYyNus.js → keyboard-shortcuts-settings-d12AAEaC.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DUP0UiFY.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Cb8t2wWM.js → local-apps-page-_z2o0cD1.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DLwVxS3V.js → locale-store-8k4mvYGL.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CPUaLcGH.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-B8Jie4-J.js → management-settings-eTBfNgXU.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BD1r4o2i.js → markdown-split-7rTfQCN_.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-D02mJdoU.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-BCev8fkW.js → media-plugins-BIfKo5Ow.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CoovNoMn.js +3 -0
- package/dist/gateway/static/root/assets/{mobile-device-api-DACoHhhk.js → mobile-device-api-CvjVB_TB.js} +1 -1
- package/dist/gateway/static/root/assets/models-hub-cache-CYr6LzvY.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-DEdNKw0I.js → notes-api-p2Pncp2B.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BBTLjJwa.js → notes-page-dOvbZBOQ.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DQMUpDc9.js +4 -0
- package/dist/gateway/static/root/assets/{oauth-api-BNCO2YK5.js → oauth-api-DpLONwfK.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-fEBbRekH.js → product-open-page-CgZhadZQ.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-D1HidxgT.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-CxwNbbud.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-Cvr4Qm7N.js → registry-api-B7b0LJgI.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CK59rSc_.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BT5B74IH.js → runtime-tools-settings-panel-D3PS55Yg.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-C4tB34S5.js → schema-form-H-aeWTzM.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C2tP7363.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DlYBA2N-.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-D1oXhkgI.js → settings-form-section-B9oF8Rhw.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CldfX6FJ.js → settings-loading-skeleton-CazDM3n5.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-c3LJnbvE.js → settings-page-C6pmQNzY.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Cn2E0G2o.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DptCK_mk.js → share-preview-page-XgxvE8cx.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Czph0_fM.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DDq_QEqd.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-OHBeBtSg.js → skills-page-CfNV6kgb.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-B9WZbOLC.js → skills-page.utils-DgxGb7v7.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Dj_DpOGw.js → system-settings-panel-B4W--Ukh.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-UY5kNWoR.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Cpd3Gd5R.js → theme-store-CpcBI73Q.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DCl5Yq7N.js → use-autosave-DR7YWBzR.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-DnUL8kJU.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BB_ZQV8F.js → voice-api-key-field-BZhqoxBR.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-BNiYmpl5.js → voice-config-api-ynE-vY6I.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BrIdtdum.js → work-discovery-overlay-CouKiK45.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-hKh-uCLo.js → workflow-run-setup-panel-CUqAESrr.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-B8dJRjMJ.js +5 -0
- package/dist/gateway/static/root/index.html +13 -13
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-protocol/src/index.js +162 -2
- package/dist/packages/gateway-contract/src/product-delivery.js +6 -2
- package/dist/packages/gateway-contract/src/turn-outcome.js +77 -1
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/capabilities/definitions.d.ts +1 -1
- package/dist/src/agent/capabilities/definitions.js +2 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +57 -8
- package/dist/src/agent/embedded/types.d.ts +5 -0
- package/dist/src/agent/external-tools/endpoint-provider.js +5 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +5 -0
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/create-share-tool.js +2 -1
- package/dist/src/agent/tools/exec-command.d.ts +2 -0
- package/dist/src/agent/tools/exec-command.js +24 -7
- package/dist/src/agent/tools/factory.js +2 -0
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/publish-artifacts.d.ts +8 -0
- package/dist/src/agent/tools/publish-artifacts.js +95 -0
- package/dist/src/agent/tools/send-media.js +2 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/command-catalog.js +4 -0
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/providers.js +1 -1
- package/dist/src/cli/commands/support.d.ts +1 -0
- package/dist/src/cli/commands/support.js +51 -0
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/endpoint-tools/binding-service.d.ts +22 -0
- package/dist/src/endpoint-tools/binding-service.js +45 -0
- package/dist/src/endpoint-tools/index.d.ts +1 -0
- package/dist/src/endpoint-tools/index.js +2 -1
- package/dist/src/endpoint-tools/invocation-service.d.ts +1 -0
- package/dist/src/endpoint-tools/invocation-service.js +8 -0
- package/dist/src/endpoint-tools/policy.d.ts +4 -1
- package/dist/src/endpoint-tools/policy.js +68 -5
- package/dist/src/endpoint-tools/registry.js +1 -1
- package/dist/src/endpoint-tools/runtime.d.ts +2 -0
- package/dist/src/endpoint-tools/runtime.js +8 -0
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/files/file-service.js +14 -5
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +5 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/middleware/auth.js +3 -2
- package/dist/src/gateway/hono/routes/endpoint-tools.js +68 -1
- package/dist/src/gateway/hono/routes/files.js +7 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/media.js +46 -2
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/support.d.ts +3 -0
- package/dist/src/gateway/hono/routes/support.js +28 -0
- package/dist/src/gateway/hono/routes/you.js +24 -0
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +0 -35
- package/dist/src/gateway/service.js +3 -3
- package/dist/src/media/store.js +9 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/store.js +4 -2
- package/dist/src/session/turn-outcome-projector.d.ts +9 -0
- package/dist/src/session/turn-outcome-projector.js +209 -0
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.d.ts +8 -0
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +32 -0
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/139_turn_outcome_artifact_backfill.sql +231 -0
- package/dist/src/storage/sqlite/migrations/140_endpoint_session_bindings.sql +8 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/support/build-support-investigation-prompt.d.ts +2 -0
- package/dist/src/support/build-support-investigation-prompt.js +29 -0
- package/dist/src/support/collect-support-report.d.ts +16 -0
- package/dist/src/support/collect-support-report.js +216 -0
- package/dist/src/support/redact-support-report.d.ts +16 -0
- package/dist/src/support/redact-support-report.js +89 -0
- package/dist/src/support/types.d.ts +76 -0
- package/dist/src/support/types.js +18 -0
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/user-context/user-avatar.d.ts +17 -0
- package/dist/src/user-context/user-avatar.js +116 -0
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-dR7HMaRX.js +0 -1
- package/dist/gateway/static/root/assets/agents-Bileycwe.js +0 -1
- package/dist/gateway/static/root/assets/attachment-preview-renderer-Cmo-5BP5.js +0 -11
- package/dist/gateway/static/root/assets/automations-workspace-BBntVWgv.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DrsMd-Po.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-CuBsz8UI.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-SuL7td7Z.js +0 -2
- package/dist/gateway/static/root/assets/heartbeat-settings-CJtXu8iD.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Be1o1AXQ.js +0 -1
- package/dist/gateway/static/root/assets/index-B2OJSXX9.js +0 -70
- package/dist/gateway/static/root/assets/index-rHjAElxG.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-COfelgk7.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-DA8oDjeB.js +0 -2
- package/dist/gateway/static/root/assets/markdown-view-B-BHEcNd.js +0 -201
- package/dist/gateway/static/root/assets/messages-Dp1OxSKt.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-C8zjqmIv.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-DICgUGPv.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CqdkznYJ.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-dHDXpMCg.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-2feZudJw.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CO2JCFdy.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DxMVaqdn.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DZNHb6A5.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DakZ2AGN.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BOiNkWJC.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-D5Nbe3C8.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-CAPSUK8B.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-ahDvypGO.js +0 -5
- package/dist/src/gateway/chat-stream/turn-outcome-collector.d.ts +0 -16
- package/dist/src/gateway/chat-stream/turn-outcome-collector.js +0 -111
|
@@ -3,10 +3,10 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { getUserProfile } from "../storage/sqlite/user-context-repository.js";
|
|
4
4
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
5
5
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
6
|
-
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
7
6
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
8
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
9
7
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
8
|
+
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
9
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
10
10
|
import { extractTextContent } from "./context/workspace.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
12
|
import { getProjectForSession } from "../projects/workspace.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_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "../../config/workspace-defaults.js";
|
|
4
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
4
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
6
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
7
7
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
8
8
|
import { resolveCompactionPolicy } from "../memory/compaction-policy.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/agent/skills/hub-lock.ts
|
|
5
5
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
3
4
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
4
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
5
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
6
|
+
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
7
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
8
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
7
9
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
8
10
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
9
|
-
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
10
11
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
11
|
-
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
12
12
|
//#region src/agent/tasks/task-judge-service.ts
|
|
13
13
|
init_schema();
|
|
14
14
|
init_providers();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
2
|
+
import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
3
|
import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
3
4
|
import { resolveShareConfig } from "../../share/share-config.js";
|
|
4
5
|
import { mergeWithDefaults } from "../../share/site-share-config.js";
|
|
@@ -231,7 +232,7 @@ function successResult(locale, payload) {
|
|
|
231
232
|
artifacts: [{
|
|
232
233
|
artifactId: `share:${String(payload.shareUrl ?? "")}`,
|
|
233
234
|
title: String(payload.title ?? "Shared result"),
|
|
234
|
-
kind: payload.kind === "site" ? "site" : payload.kind === "zip" ? "archive" : "
|
|
235
|
+
kind: payload.kind === "site" ? "site" : payload.kind === "zip" ? "archive" : turnOutcomeKindFromFileName(String(payload.title ?? "Shared result")),
|
|
235
236
|
availability: "available",
|
|
236
237
|
location: "artifact_store",
|
|
237
238
|
capabilities: payload.kind === "site" ? ["preview", "share"] : ["download", "share"],
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import type { TurnOutcomeDeliverable } from '@xopcai/gateway-contract';
|
|
2
3
|
export interface ExecCommandDetails {
|
|
3
4
|
command: string;
|
|
4
5
|
cwd: string;
|
|
@@ -15,6 +16,7 @@ export interface ExecCommandDetails {
|
|
|
15
16
|
stderr: string;
|
|
16
17
|
aggregatedOutput: string;
|
|
17
18
|
failureHint?: string;
|
|
19
|
+
artifacts?: TurnOutcomeDeliverable[];
|
|
18
20
|
}
|
|
19
21
|
export interface ExecCommandUpdateDetails {
|
|
20
22
|
kind: 'command_output_delta';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { formatSize, truncateTail } from "./truncate.js";
|
|
2
2
|
import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
|
|
3
|
+
import { publishArtifactPaths } from "./publish-artifacts.js";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
5
|
import { spawn } from "node:child_process";
|
|
5
6
|
import { Type } from "@sinclair/typebox";
|
|
@@ -12,7 +13,11 @@ const ExecCommandSchema = Type.Object({
|
|
|
12
13
|
cmd: Type.String({ description: "Shell command to execute." }),
|
|
13
14
|
cwd: Type.Optional(Type.String({ description: "Working directory. Relative paths are resolved under the agent workspace." })),
|
|
14
15
|
timeoutMs: Type.Optional(Type.Number({ description: "Command timeout in milliseconds. Defaults to 1800000 (30m) and is capped at 14400000 (4h)." })),
|
|
15
|
-
maxOutputChars: Type.Optional(Type.Number({ description: "Maximum characters returned to the model. UI streaming still receives output deltas." }))
|
|
16
|
+
maxOutputChars: Type.Optional(Type.Number({ description: "Maximum characters returned to the model. UI streaming still receives output deltas." })),
|
|
17
|
+
outputs: Type.Optional(Type.Array(Type.String({ minLength: 1 }), {
|
|
18
|
+
maxItems: 50,
|
|
19
|
+
description: "Final user-facing files created by this command. Relative paths resolve under the effective cwd and are persisted as chat deliverables after a successful command."
|
|
20
|
+
}))
|
|
16
21
|
});
|
|
17
22
|
function clampTimeoutMs(raw) {
|
|
18
23
|
return Math.min(MAX_COMMAND_TIMEOUT_MS, Math.max(1e3, Math.floor(typeof raw === "number" && Number.isFinite(raw) ? raw : DEFAULT_TIMEOUT_MS)));
|
|
@@ -94,7 +99,8 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
94
99
|
description: [
|
|
95
100
|
"Run shell commands for code inspection, builds, tests, type checks, and verification.",
|
|
96
101
|
"Use apply_patch for file edits; do not edit files by shell redirection unless explicitly necessary.",
|
|
97
|
-
"Relative cwd values resolve under the current agent workspace."
|
|
102
|
+
"Relative cwd values resolve under the current agent workspace.",
|
|
103
|
+
"When the command creates final user-facing files, declare all final paths in outputs so they are persisted with this command."
|
|
98
104
|
].join(" "),
|
|
99
105
|
parameters: ExecCommandSchema,
|
|
100
106
|
label: "Run Command",
|
|
@@ -102,7 +108,7 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
102
108
|
supportsParallel: false,
|
|
103
109
|
idempotent: false,
|
|
104
110
|
finalGuardRelevant: true,
|
|
105
|
-
async execute(
|
|
111
|
+
async execute(toolCallId, params, signal, onUpdate) {
|
|
106
112
|
const command = (params.cmd ?? params.command ?? "").trim();
|
|
107
113
|
if (!command) return {
|
|
108
114
|
content: [{
|
|
@@ -206,7 +212,7 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
206
212
|
}
|
|
207
213
|
});
|
|
208
214
|
};
|
|
209
|
-
const finish = (exitCode, errorText) => {
|
|
215
|
+
const finish = async (exitCode, errorText) => {
|
|
210
216
|
if (settled) return;
|
|
211
217
|
settled = true;
|
|
212
218
|
clearTimeout(timeout);
|
|
@@ -243,10 +249,21 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
243
249
|
truncatedBy: formatted.truncatedBy,
|
|
244
250
|
outputBytes: formatted.outputBytes
|
|
245
251
|
};
|
|
252
|
+
let resultText = formatted.text;
|
|
253
|
+
if (details.status === "success" && params.outputs?.length) {
|
|
254
|
+
details.artifacts = await publishArtifactPaths({
|
|
255
|
+
paths: params.outputs,
|
|
256
|
+
baseDir: policy.effectiveCwd,
|
|
257
|
+
toolCallId
|
|
258
|
+
});
|
|
259
|
+
const published = details.artifacts.filter((item) => item.availability === "available").length;
|
|
260
|
+
const failed = details.artifacts.length - published;
|
|
261
|
+
resultText += `\n\nArtifacts: ${published} published${failed > 0 ? `, ${failed} failed` : ""}.`;
|
|
262
|
+
}
|
|
246
263
|
resolveTool({
|
|
247
264
|
content: [{
|
|
248
265
|
type: "text",
|
|
249
|
-
text:
|
|
266
|
+
text: resultText
|
|
250
267
|
}],
|
|
251
268
|
details
|
|
252
269
|
});
|
|
@@ -263,8 +280,8 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
263
280
|
else signal?.addEventListener("abort", abort, { once: true });
|
|
264
281
|
proc.stdout?.on("data", (data) => publishDelta("stdout", data));
|
|
265
282
|
proc.stderr?.on("data", (data) => publishDelta("stderr", data));
|
|
266
|
-
proc.on("error", (err) => finish(null, `Error: ${err.message}`));
|
|
267
|
-
proc.on("close", (code) => finish(code));
|
|
283
|
+
proc.on("error", (err) => void finish(null, `Error: ${err.message}`));
|
|
284
|
+
proc.on("close", (code) => void finish(code));
|
|
268
285
|
});
|
|
269
286
|
}
|
|
270
287
|
};
|
|
@@ -11,6 +11,7 @@ import { createDefaultExternalToolGatewayTools } from "../external-tools/index.j
|
|
|
11
11
|
import { createReadFileTool } from "./read.js";
|
|
12
12
|
import { createWriteFileTool } from "./write.js";
|
|
13
13
|
import { createListDirTool } from "./list-dir.js";
|
|
14
|
+
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
14
15
|
import { createExecCommandTool } from "./exec-command.js";
|
|
15
16
|
import { createApplyPatchTool } from "./apply-patch.js";
|
|
16
17
|
import { createMemoryGetTool, createMemorySearchTool } from "./memory-tool.js";
|
|
@@ -280,6 +281,7 @@ var AgentToolsFactory = class {
|
|
|
280
281
|
getConfig: () => this.deps.getConfig?.()
|
|
281
282
|
})] : [],
|
|
282
283
|
createSendMediaTool(workspace, bus, () => this.deps.getCurrentContext()),
|
|
284
|
+
createPublishArtifactsTool(workspace),
|
|
283
285
|
createReadMediaTool(),
|
|
284
286
|
...isShareToolAvailable(cfg) ? [createCreateShareTool({
|
|
285
287
|
workspace,
|
|
@@ -14,6 +14,7 @@ export { createWebSearchTool, createWebFetchTool } from './web.js';
|
|
|
14
14
|
export { createWebExtractTool, stripHtmlBoilerplate, DEFAULT_WEB_EXTRACT_MAX_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, } from './web-extract.js';
|
|
15
15
|
export { createMessageTool } from './communication.js';
|
|
16
16
|
export { createSendMediaTool } from './send-media.js';
|
|
17
|
+
export { createPublishArtifactsTool } from './publish-artifacts.js';
|
|
17
18
|
export { createReadMediaTool } from './media-read-tool.js';
|
|
18
19
|
export { createCreateShareTool, isShareToolAvailable, type CreateShareToolDeps, } from './create-share-tool.js';
|
|
19
20
|
export { createTodoTool, TodoStore, type TodoItem, type TodoStatus } from './todo-tool.js';
|
|
@@ -4,6 +4,7 @@ import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, GREP_MAX_LINE_LENGTH, formatSize,
|
|
|
4
4
|
import { createReadFileTool } from "./read.js";
|
|
5
5
|
import { createWriteFileTool, writeFileTool } from "./write.js";
|
|
6
6
|
import { createListDirTool, listDirTool } from "./list-dir.js";
|
|
7
|
+
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
7
8
|
import { createExecCommandTool } from "./exec-command.js";
|
|
8
9
|
import { fuzzyFindText, generateDiffString, normalizeForFuzzyMatch, normalizeToLF, restoreLineEndings, stripBom } from "./edit-diff.js";
|
|
9
10
|
import { createApplyPatchTool } from "./apply-patch.js";
|
|
@@ -42,4 +43,4 @@ import { createManagedJobTool } from "./managed-job-tool.js";
|
|
|
42
43
|
import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
|
|
43
44
|
import { createImageTool } from "./image-tool.js";
|
|
44
45
|
import { createImageGenerateTool, resolveImageGenerationModelConfigForTool } from "./image-generate-tool.js";
|
|
45
|
-
export { BrowserManager, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, SANDBOX_ALLOWED_TOOLS, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, buildSandboxToolMap, createApplyPatchTool, createAutomationTool, createBrowserRecipeTool, createClarifyTool, createCreateShareTool, createDelegateTool, createDesktopPetTool, createDreamingTool, createExecCommandTool, createExecuteCodeTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createListDirTool, createManagedJobTool, createMemoryGetTool, createMemorySearchTool, createMessageTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionRecallTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
46
|
+
export { BrowserManager, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, SANDBOX_ALLOWED_TOOLS, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, buildSandboxToolMap, createApplyPatchTool, createAutomationTool, createBrowserRecipeTool, createClarifyTool, createCreateShareTool, createDelegateTool, createDesktopPetTool, createDreamingTool, createExecCommandTool, createExecuteCodeTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createListDirTool, createManagedJobTool, createMemoryGetTool, createMemorySearchTool, createMessageTool, createPublishArtifactsTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionRecallTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import { type TurnOutcomeDeliverable } from '@xopcai/gateway-contract';
|
|
3
|
+
export declare function publishArtifactPaths(params: {
|
|
4
|
+
paths: string[];
|
|
5
|
+
baseDir: string;
|
|
6
|
+
toolCallId: string;
|
|
7
|
+
}): Promise<TurnOutcomeDeliverable[]>;
|
|
8
|
+
export declare function createPublishArtifactsTool(workspace: string): AgentTool;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
2
|
+
import { turnOutcomeKindFromFileName, turnOutcomeMimeTypeFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
3
|
+
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
4
|
+
import { persistToolMedia } from "./tool-media.js";
|
|
5
|
+
import { basename, isAbsolute } from "node:path";
|
|
6
|
+
import { readFile } from "node:fs/promises";
|
|
7
|
+
import { Type } from "@sinclair/typebox";
|
|
8
|
+
//#region src/agent/tools/publish-artifacts.ts
|
|
9
|
+
const PublishArtifactsSchema = Type.Object({ paths: Type.Array(Type.String({ minLength: 1 }), {
|
|
10
|
+
minItems: 1,
|
|
11
|
+
maxItems: 50,
|
|
12
|
+
description: "Files to publish. Relative paths resolve under the current agent workspace."
|
|
13
|
+
}) });
|
|
14
|
+
async function publishArtifactPaths(params) {
|
|
15
|
+
const paths = [...new Set(params.paths.map((value) => value.trim()).filter(Boolean))];
|
|
16
|
+
const artifacts = [];
|
|
17
|
+
const publishedPaths = /* @__PURE__ */ new Set();
|
|
18
|
+
for (const [index, inputPath] of paths.entries()) {
|
|
19
|
+
const resolved = resolvePathUnderWorkspace(inputPath, params.baseDir);
|
|
20
|
+
if (publishedPaths.has(resolved)) continue;
|
|
21
|
+
publishedPaths.add(resolved);
|
|
22
|
+
try {
|
|
23
|
+
const policy = evaluateFilePolicy({
|
|
24
|
+
operation: "read",
|
|
25
|
+
path: resolved,
|
|
26
|
+
workspaceRoot: params.baseDir
|
|
27
|
+
});
|
|
28
|
+
if (!policy.allowed) throw new Error(policy.reason);
|
|
29
|
+
const media = await persistToolMedia({
|
|
30
|
+
buffer: await readFile(policy.canonicalPath ?? resolved),
|
|
31
|
+
filePath: resolved
|
|
32
|
+
});
|
|
33
|
+
const kind = turnOutcomeKindFromFileName(media.name);
|
|
34
|
+
artifacts.push({
|
|
35
|
+
artifactId: media.id,
|
|
36
|
+
title: media.name,
|
|
37
|
+
kind,
|
|
38
|
+
mimeType: media.mimeType,
|
|
39
|
+
sizeBytes: media.size,
|
|
40
|
+
availability: "available",
|
|
41
|
+
location: "artifact_store",
|
|
42
|
+
capabilities: kind === "archive" || kind === "file" ? ["download"] : ["preview", "download"],
|
|
43
|
+
uri: media.uri
|
|
44
|
+
});
|
|
45
|
+
} catch {
|
|
46
|
+
const title = basename(resolved);
|
|
47
|
+
const mimeType = turnOutcomeMimeTypeFromFileName(title);
|
|
48
|
+
artifacts.push({
|
|
49
|
+
artifactId: `publish-failed:${params.toolCallId}:${index}`,
|
|
50
|
+
title,
|
|
51
|
+
kind: turnOutcomeKindFromFileName(title),
|
|
52
|
+
...mimeType ? { mimeType } : {},
|
|
53
|
+
availability: "failed",
|
|
54
|
+
location: isAbsolute(inputPath) ? "external_host" : "workspace",
|
|
55
|
+
capabilities: ["regenerate"]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return artifacts;
|
|
60
|
+
}
|
|
61
|
+
function createPublishArtifactsTool(workspace) {
|
|
62
|
+
return {
|
|
63
|
+
name: "publish_artifacts",
|
|
64
|
+
label: "Publish Artifacts",
|
|
65
|
+
description: "Publish completed user-facing files into durable chat artifacts. Call this after exec_command or another runtime creates spreadsheets, presentations, PDFs, documents, archives, or other files. Pass every final deliverable together; do not publish temporary or source files.",
|
|
66
|
+
parameters: PublishArtifactsSchema,
|
|
67
|
+
mutationScope: "none",
|
|
68
|
+
supportsParallel: false,
|
|
69
|
+
idempotent: false,
|
|
70
|
+
async execute(toolCallId, params) {
|
|
71
|
+
const paths = [...new Set(params.paths.map((value) => value.trim()).filter(Boolean))];
|
|
72
|
+
if (paths.length === 0) throw new Error("At least one artifact path is required");
|
|
73
|
+
const artifacts = await publishArtifactPaths({
|
|
74
|
+
paths,
|
|
75
|
+
baseDir: workspace,
|
|
76
|
+
toolCallId
|
|
77
|
+
});
|
|
78
|
+
const publishedCount = artifacts.filter((item) => item.availability === "available").length;
|
|
79
|
+
const failedCount = artifacts.length - publishedCount;
|
|
80
|
+
return {
|
|
81
|
+
content: [{
|
|
82
|
+
type: "text",
|
|
83
|
+
text: [
|
|
84
|
+
`${publishedCount} artifact${publishedCount === 1 ? "" : "s"} published`,
|
|
85
|
+
failedCount > 0 ? `${failedCount} failed` : "",
|
|
86
|
+
artifacts.map((item) => item.title).join(", ")
|
|
87
|
+
].filter(Boolean).join(": ")
|
|
88
|
+
}],
|
|
89
|
+
details: { artifacts }
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { createPublishArtifactsTool, publishArtifactPaths };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { checkFileSafety } from "../prompt/safety.js";
|
|
2
2
|
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
3
|
+
import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
3
4
|
import { persistToolMedia } from "./tool-media.js";
|
|
4
5
|
import { basename } from "node:path";
|
|
5
6
|
import { readFile } from "fs/promises";
|
|
@@ -67,7 +68,7 @@ function createSendMediaTool(workspace, bus, getContext) {
|
|
|
67
68
|
artifacts: [{
|
|
68
69
|
artifactId: media.id,
|
|
69
70
|
title: media.name,
|
|
70
|
-
kind: media.type === "photo" ? "image" : media.type === "video" ? "video" : media.type === "audio" ? "audio" : media.
|
|
71
|
+
kind: media.type === "photo" ? "image" : media.type === "video" ? "video" : media.type === "audio" ? "audio" : turnOutcomeKindFromFileName(media.name),
|
|
71
72
|
mimeType: media.mimeType,
|
|
72
73
|
sizeBytes: media.size,
|
|
73
74
|
availability: "available",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
3
4
|
import { getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
4
5
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
5
6
|
import { isLocalModelBaseUrl, resolveModelCallApiKey, resolveModelCallOptions } from "../providers/model-call.js";
|
|
6
|
-
import { getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
7
7
|
//#region src/ai-assist/text-assist.ts
|
|
8
8
|
init_providers();
|
|
9
9
|
init_logger();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
5
4
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
|
-
import {
|
|
5
|
+
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
7
6
|
import { getApiKeyFromEnv, init_env_keys } from "../providers/env-keys.js";
|
|
7
|
+
import { getOAuthProviderDefinition, init_registry } from "./oauth/registry.js";
|
|
8
8
|
import { init_oauth_provider_lock, withOAuthProviderLock } from "./oauth-provider-lock.js";
|
|
9
9
|
import { dirname, join } from "path";
|
|
10
10
|
import { mkdir, readFile, readdir, rm } from "fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { chmodSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/auth/profiles/store.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
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";
|
|
4
|
-
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
3
|
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
4
|
+
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
//#region src/auth/sync-provider-auth.ts
|
|
8
8
|
/**
|
|
@@ -2,8 +2,8 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { assertCacheDir, init_cache_dir_policy } from "../cache-dir-policy.js";
|
|
5
|
-
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
6
5
|
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
6
|
+
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
7
7
|
import { shouldRunExtensionBridgeServer } from "../backend-from-config.js";
|
|
8
8
|
import { resolvePackageRoot } from "../../infra/update-check.js";
|
|
9
9
|
import { dirname, join } from "node:path";
|
|
@@ -16,6 +16,7 @@ const REGISTRY_COMMAND_MODULES = {
|
|
|
16
16
|
project: () => import("./commands/project.js"),
|
|
17
17
|
config: () => import("./commands/config.js"),
|
|
18
18
|
doctor: () => import("./commands/doctor/index.js"),
|
|
19
|
+
support: () => import("./commands/support.js"),
|
|
19
20
|
runtime: () => import("./commands/runtime.js"),
|
|
20
21
|
image: () => import("./commands/image.js"),
|
|
21
22
|
channels: () => import("./commands/channels.js"),
|
|
@@ -83,6 +83,10 @@ const ROOT_HELP_COMMANDS = [
|
|
|
83
83
|
name: "doctor [options]",
|
|
84
84
|
description: "Check xopc installation health and diagnose common issues"
|
|
85
85
|
},
|
|
86
|
+
{
|
|
87
|
+
name: "support",
|
|
88
|
+
description: "Create a redacted diagnostic report for an xopc problem"
|
|
89
|
+
},
|
|
86
90
|
{
|
|
87
91
|
name: "runtime",
|
|
88
92
|
description: "Manage Node.js and Python tool runtimes used by agents"
|
|
@@ -4,9 +4,9 @@ import { CredentialResolver, init_credentials } from "../../auth/credentials.js"
|
|
|
4
4
|
import { getAllProviders, init_providers } from "../../providers/index.js";
|
|
5
5
|
import { formatExamples, register } from "../registry.js";
|
|
6
6
|
import { disconnectProvider } from "../../providers/provider-disconnect.js";
|
|
7
|
+
import { colorizeStatus, colors } from "../utils/colors.js";
|
|
7
8
|
import { listAllProfiles, listProfilesForProvider, removeAuthProfile, upsertAuthProfile } from "../../auth/profiles/profiles.js";
|
|
8
9
|
import { getOAuthProvider, getSupportedOAuthProviders } from "../utils/oauth-providers.js";
|
|
9
|
-
import { colorizeStatus, colors } from "../utils/colors.js";
|
|
10
10
|
import { runCliOAuthLogin } from "../utils/oauth-login.js";
|
|
11
11
|
import { Command } from "commander";
|
|
12
12
|
//#region src/cli/commands/auth.ts
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v140).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema, parseModelRef } from "../../../../config/schema.js";
|
|
2
|
-
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
3
2
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "../../../../providers/env-keys.js";
|
|
3
|
+
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
//#region src/cli/commands/doctor/checks/provider-auth.ts
|
|
6
6
|
init_loader();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
2
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
3
2
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
4
|
import { getAllModels, getAvailableModels, getConfiguredProviders, getProviderAuthState, getProviderDisplayName, init_providers, isProviderConfigured, providerSupportsApiKey, providerSupportsOAuth, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { formatExamples, register } from "../registry.js";
|
|
6
6
|
import { getContextWithOpts } from "../context.js";
|
|
@@ -10,9 +10,9 @@ import { discoverProviderModels, isProviderApiDiscoverable } from "../../../prov
|
|
|
10
10
|
import { getXopcCloudCatalogCoordinator } from "../../../providers/xopc-cloud-catalog-coordinator.js";
|
|
11
11
|
import { getDomesticProviderBaseUrl, getDomesticProviderPreset, getDomesticProviderPresetIds, providerConfigFromDomesticPreset } from "../../../providers/domestic-presets.js";
|
|
12
12
|
import { getProviderHint, getRecommendedModelsForProvider, sortModelsForPicker, sortProvidersForPicker } from "../../../providers/presentation.js";
|
|
13
|
+
import { colors } from "../../utils/colors.js";
|
|
13
14
|
import { listProfilesForProvider } from "../../../auth/profiles/profiles.js";
|
|
14
15
|
import { getOAuthProvider } from "../../utils/oauth-providers.js";
|
|
15
|
-
import { colors } from "../../utils/colors.js";
|
|
16
16
|
import { runCliOAuthLogin } from "../../utils/oauth-login.js";
|
|
17
17
|
import { confirm, input, select } from "@inquirer/prompts";
|
|
18
18
|
//#region src/cli/commands/onboard/model.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv } from "../../providers/env-keys.js";
|
|
2
2
|
import { PROVIDER_META, getAllProviders, getSortedProviders, init_providers } from "../../providers/index.js";
|
|
3
3
|
import { formatExamples, register } from "../registry.js";
|
|
4
|
-
import { getProfile, listAllProfiles, listProfilesForProvider, removeAuthProfile, upsertAuthProfile } from "../../auth/profiles/profiles.js";
|
|
5
4
|
import { colors } from "../utils/colors.js";
|
|
5
|
+
import { getProfile, listAllProfiles, listProfilesForProvider, removeAuthProfile, upsertAuthProfile } from "../../auth/profiles/profiles.js";
|
|
6
6
|
import { SETUP_EXIT } from "./setup-shared/types.js";
|
|
7
7
|
import { emitTask } from "./setup-shared/output.js";
|
|
8
8
|
import { isPromptCancelled, promptSecret } from "./setup-shared/prompts.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
2
|
+
import { formatExamples, register } from "../registry.js";
|
|
3
|
+
import { collectSupportReport } from "../../support/collect-support-report.js";
|
|
4
|
+
import { SupportReportInputSchema } from "../../support/types.js";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import { writeFile } from "node:fs/promises";
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
//#region src/cli/commands/support.ts
|
|
9
|
+
init_paths_state();
|
|
10
|
+
function defaultOutputPath(capturedAt) {
|
|
11
|
+
return resolve(`xopc-diagnostics-${capturedAt.replace(/[:.]/g, "-")}.json`);
|
|
12
|
+
}
|
|
13
|
+
async function runSupportReport(ctx, options) {
|
|
14
|
+
const report = await collectSupportReport(SupportReportInputSchema.parse({
|
|
15
|
+
problem: options.problem ?? "xopc startup or runtime problem",
|
|
16
|
+
occurredAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
17
|
+
}), { paths: {
|
|
18
|
+
configPath: ctx.configPath,
|
|
19
|
+
stateDir: resolveStateDir(),
|
|
20
|
+
workspaceDir: ctx.workspacePath
|
|
21
|
+
} });
|
|
22
|
+
const outputPath = options.output ? resolve(options.output) : defaultOutputPath(report.capturedAt);
|
|
23
|
+
await writeFile(outputPath, `${JSON.stringify(report, null, 2)}\n`, {
|
|
24
|
+
encoding: "utf8",
|
|
25
|
+
flag: "wx",
|
|
26
|
+
mode: 384
|
|
27
|
+
});
|
|
28
|
+
console.log(report.markdown);
|
|
29
|
+
console.log(`\nDiagnostic file: ${outputPath}`);
|
|
30
|
+
}
|
|
31
|
+
function createSupportCommand(ctx) {
|
|
32
|
+
const command = new Command("support").description("Create a redacted diagnostic report for an xopc problem").addHelpText("after", formatExamples([
|
|
33
|
+
"xopc support report",
|
|
34
|
+
"xopc support report --problem \"Telegram receives messages but does not reply\"",
|
|
35
|
+
"xopc support report --output ./xopc-diagnostics.json"
|
|
36
|
+
]));
|
|
37
|
+
command.command("report").description("Collect Doctor results and nearby warning/error logs").option("-p, --problem <text>", "Short description of the problem").option("-o, --output <path>", "Diagnostic JSON output path (must not already exist)").action((options) => runSupportReport(ctx, options));
|
|
38
|
+
return command;
|
|
39
|
+
}
|
|
40
|
+
register({
|
|
41
|
+
id: "support",
|
|
42
|
+
name: "support",
|
|
43
|
+
description: "Create a redacted diagnostic report for an xopc problem",
|
|
44
|
+
factory: createSupportCommand,
|
|
45
|
+
metadata: {
|
|
46
|
+
category: "maintenance",
|
|
47
|
+
examples: ["xopc support report"]
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export {};
|
package/dist/src/config/index.js
CHANGED
|
@@ -2,15 +2,15 @@ import { ENV_VARS, XOPC_DB_FILENAME, resolveHomeDir, resolveStateDir, resolveXop
|
|
|
2
2
|
import { TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema } from "../../extensions/telegram/src/config-schema.js";
|
|
3
3
|
import { WeixinAccountConfigSchema, WeixinConfigSchema } from "../../extensions/weixin/src/config-schema.js";
|
|
4
4
|
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
5
|
-
import {
|
|
5
|
+
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
6
6
|
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
7
7
|
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
8
8
|
import { resolveAgentDir as resolveAgentDir$1, resolveAgentHomeDir as resolveAgentHomeDir$1, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
9
|
-
import { extractProfileAgentId, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
10
9
|
import { FILENAMES, WORKSPACE_FILES, existsSync, hasBundledExtensionManifest, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentHomeDir, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveMcpOAuthPath, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStatusPath, resolveToolsDir, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath } from "./paths.js";
|
|
11
|
-
import { init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
|
-
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
13
10
|
import { CustomModelSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, ModelOverrideSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProviderConfigSchema, VercelGatewayRoutingSchema, getDefaultModelValues, init_models_json, loadModelsJson, modelsJsonExists, saveModelsJson, validateModelsConfig } from "./models-json.js";
|
|
11
|
+
import { init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
|
+
import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.js";
|
|
13
|
+
import { extractProfileAgentId, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
14
14
|
import { canonicalizeConfiguredMcpServer, isKnownCliMcpTypeAlias, normalizeConfiguredMcpServers, resolveXopcMcpTransportAlias } from "./mcp-config-normalize.js";
|
|
15
15
|
import { formatThinkingLevels, listThinkingLevels, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, thinkLevelToNumber } from "../agent/transcript/thinking-types.js";
|
|
16
16
|
import { getWorkspacePath } from "./workspace-path-helpers.js";
|
|
@@ -2,8 +2,8 @@ import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
4
|
import { ConfigSchema, init_schema } from "./schema.js";
|
|
5
|
-
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
6
5
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
|
+
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
7
7
|
import { assertChannelPluginConfigs, init_validate_channel_configs } from "./validate-channel-configs.js";
|
|
8
8
|
import { dirname } from "path";
|
|
9
9
|
import { existsSync, mkdirSync, promises, readFileSync } from "fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
3
2
|
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
3
|
+
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
4
4
|
import { existsSync, readFileSync } from "fs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/config/models-json.ts
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { EndpointConnectionSnapshot } from './registry.js';
|
|
2
|
+
import { EndpointRegistry } from './registry.js';
|
|
3
|
+
export interface EndpointSessionBinding {
|
|
4
|
+
sessionKey: string;
|
|
5
|
+
endpointId: string;
|
|
6
|
+
boundAt: number;
|
|
7
|
+
}
|
|
8
|
+
export interface EndpointSessionBindingStore {
|
|
9
|
+
get(sessionKey: string): EndpointSessionBinding | undefined;
|
|
10
|
+
set(binding: EndpointSessionBinding): EndpointSessionBinding;
|
|
11
|
+
delete(sessionKey: string): boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class EndpointBindingService {
|
|
14
|
+
private readonly registry;
|
|
15
|
+
private readonly store;
|
|
16
|
+
constructor(registry: EndpointRegistry, store?: EndpointSessionBindingStore);
|
|
17
|
+
bind(sessionKey: string, endpointId: string, now?: number): EndpointSessionBinding;
|
|
18
|
+
get(sessionKey: string): EndpointSessionBinding | undefined;
|
|
19
|
+
resolve(sessionKey: string): EndpointConnectionSnapshot | undefined;
|
|
20
|
+
unbind(sessionKey: string): boolean;
|
|
21
|
+
private normalizeSessionKey;
|
|
22
|
+
}
|