@xopcai/xopc 0.0.174 → 0.0.176
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-CyEDJeIt.js → activity-store-DsFM1upC.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DF7Bol6I.js → agent-avatar-dicebear-DvdMLOga.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BVjlpbeZ.js +2 -0
- package/dist/gateway/static/root/assets/{api-DYunqroX.js → api-BdPLCCBm.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DwyUxpgY.js → api-Bop4IQRW.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B4xJyvDu.js → app-management-settings-panel-DMLDOHul.js} +1 -1
- package/dist/gateway/static/root/assets/appearance-settings-DbI9foFR.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-njqxLWYD.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DWhBmmjD.js → archive-plugin-Dfdxuwvb.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BOpZfa_I.js → attachment-load-Dn3RlnYD.js} +2 -2
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-DonnL2dL.js → attachment-preview-renderer-Cmo-5BP5.js} +2 -2
- package/dist/gateway/static/root/assets/{attachment-process-heavy-RnGYy9bC.js → attachment-process-heavy-B2_kr5EA.js} +3 -3
- package/dist/gateway/static/root/assets/{automation-suggestion-card-Byu3I7Rs.js → automation-suggestion-card-Bc0Y7A9u.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-D-eweHZJ.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-6AG1qatz.js → binary-plugins-0XtB-xC0.js} +2 -2
- package/dist/gateway/static/root/assets/{block-editor-CJhrn98_.js → block-editor-C4fXWbEE.js} +6 -6
- package/dist/gateway/static/root/assets/browser-settings-page-lC86-drr.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CBVb4mt9.js → browser-workflow-inputs-CZmzNymN.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Cq4XUKbu.js → browser-workflows-page-CBYM9HqG.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-6tYNfHqJ.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-hbW4NAKO.js → capability-presets-api-BiJxmmhW.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Co-ymbd9.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CzMjHb17.js → channel-recipient-api-BKTUZDp-.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-D46eVjaQ.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-BMRAO4zZ.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-B9Au6gMZ.js → connector-logo-Pr4RIKjj.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Dw1eYbRi.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-B8cZuQUt.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CNff5TFb.js → desktop-pet-settings-CEQacUDF.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Bf956uo-.js → directory-picker-path-field-DWnxdZtc.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CHM8FE1g.js → dreaming-settings-D2e2w2Ho.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-ZqM_0eUs.js → extension-debug-page-BLjTGbv3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D4hvXOMM.js → extension-page-D2_UC6hy.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-GsqxaJjA.js → extension-settings-page-BsH6o_PX.js} +1 -1
- package/dist/gateway/static/root/assets/{focus-detail-page-CE6uwrl1.js → focus-detail-page-BBXUtxRB.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-B4THmgnS.js → gateway-config-api-C-DkC6UJ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CPv-MxGE.js → gateway-settings-DEOGiimF.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-MP3K71pP.js → gateway-startup-retry-BlSLh1TF.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-CSFcRE_N.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-VjRArfAJ.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-DCcDuIjG.js → goals-config-api-CcdS9qek.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-BAcErdch.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-o9QMXvNq.js → goals-settings-BY7crl0z.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DixwpXnH.js → heartbeat-settings-DtTkS0gs.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BOGH9FGi.js → image-generation-api-WGgkbwDZ.js} +1 -1
- package/dist/gateway/static/root/assets/index-2UImfRDC.js +212 -0
- package/dist/gateway/static/root/assets/index-CS9sVShT.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D4o4ZPF6.js → keyboard-shortcuts-settings-C5lpWQ3f.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Cl0fcPL4.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-GzMmpO7G.js → local-apps-page-b05wWvXG.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CAuhEGCn.js → locale-store-sToMfHX_.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-cDE1jLJv.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-CIX8D1pv.js → markdown-split-0gPVst5y.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bp3eIA45.js → media-plugins-Rxyq_KTm.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CarlxqXV.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-RVFiYAoO.js → notes-page-DRhNDl_Q.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-BKNBk0Uf.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-BGAYH3Ef.js → page-tabs-cOEOQqHh.js} +1 -1
- package/dist/gateway/static/root/assets/pdf-D4PI9qAw.js +54 -0
- package/dist/gateway/static/root/assets/pdf.worker.min-CHFwMXne.mjs +29 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BM6pDkHp.js → preview-open-alternatives-BopOLFvu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BiMetEmn.js → product-open-page-DWVPmmOq.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BhjEXNQW.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-B80e69PH.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CwdVob6H.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-BdjV8MK5.js → save-bar-controls-BfZmKe1t.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-ChlqXU46.js → schedule-field-Cpi4jCRV.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DDKf5ZSH.js → schema-form-OXFkcZQe.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BGt3Asj6.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BnTdM9Nn.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CPG0KGVs.js → settings-form-section-BwqkZCHJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DRSDHucM.js → settings-loading-skeleton-BbqH_S3Y.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CeB7_xD0.js → settings-page-BoxC-JSa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BENrkwd0.js → settings-page-layout-Ddu2iGaW.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-z1Lwv0js.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DIzczJkG.js → share-preview-page-CVazOFjy.js} +2 -2
- package/dist/gateway/static/root/assets/shares-settings-C4lXuyQj.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DSuIDkeI.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-xgZczqVe.js +2 -0
- package/dist/gateway/static/root/assets/skills-page.utils-DgyB1tSo.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-Dp4d5Q1B.js → system-settings-panel-BoLSQL65.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CbGc1laW.js → theme-store-CBNcGOfj.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-gochWrny.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-DwPk3OPL.js → typed-models-lib-DvRnr7YB.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CXrEu2dw.js → use-channel-catalog-CA9BFVB7.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CEfIy4WZ.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DFoA79LB.js → voice-api-key-field-v8tgylEZ.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-B-3MClaf.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-CEsFEdax.js +1 -0
- package/dist/gateway/static/root/assets/work-page-CT9AHnq6.js +3 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-CC3cJn5k.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-C-1-_Zp1.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +8 -8
- package/dist/src/agent/context/execution-scope.d.ts +26 -0
- package/dist/src/agent/context/execution-scope.js +84 -0
- package/dist/src/agent/context/project-context.d.ts +3 -1
- package/dist/src/agent/context/project-context.js +26 -8
- package/dist/src/agent/embedded/model-runtime.d.ts +1 -2
- package/dist/src/agent/embedded/model-runtime.js +17 -29
- package/dist/src/agent/embedded/session-runner.js +2 -3
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -0
- package/dist/src/agent/prompt/system-prompt.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +7 -4
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/session/session-config-service.d.ts +4 -1
- package/dist/src/agent/session/session-config-service.js +5 -3
- package/dist/src/agent/session/session-inspector.d.ts +6 -0
- package/dist/src/agent/session/session-inspector.js +9 -2
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.d.ts +2 -0
- package/dist/src/agent/skills/index.js +14 -5
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/test-framework.js +1 -1
- package/dist/src/agent/workflow/subagent-runner.js +2 -0
- package/dist/src/agent/workflow/types.d.ts +1 -0
- package/dist/src/auth/model-credential-store.d.ts +17 -0
- package/dist/src/auth/model-credential-store.js +110 -0
- package/dist/src/auth/oauth/github-copilot.js +2 -2
- package/dist/src/auth/oauth/openai-codex.js +98 -7
- package/dist/src/auth/oauth/types.d.ts +4 -1
- package/dist/src/auth/oauth/xopc-cloud.js +124 -6
- package/dist/src/automations/domain/defaults.d.ts +1 -0
- package/dist/src/automations/domain/defaults.js +4 -0
- package/dist/src/automations/domain/index.d.ts +1 -0
- package/dist/src/automations/domain/index.js +2 -1
- package/dist/src/automations/index.js +2 -1
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +21 -0
- package/dist/src/config/schema.js +12 -2
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -0
- package/dist/src/gateway/hono/oauth-async.d.ts +5 -0
- package/dist/src/gateway/hono/oauth-async.js +20 -8
- package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +1 -1
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +9 -0
- package/dist/src/gateway/hono/routes/goals.js +13 -0
- package/dist/src/gateway/hono/routes/home.d.ts +16 -3
- package/dist/src/gateway/hono/routes/home.js +98 -25
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/project-skills.d.ts +3 -0
- package/dist/src/gateway/hono/routes/project-skills.js +119 -0
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/sessions-api.d.ts +2 -1
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/projects/index.d.ts +1 -0
- package/dist/src/projects/index.js +2 -1
- package/dist/src/projects/project-skill-service.d.ts +67 -0
- package/dist/src/projects/project-skill-service.js +131 -0
- package/dist/src/providers/index.js +4 -2
- package/dist/src/providers/provider-auth-service.d.ts +22 -0
- package/dist/src/providers/provider-auth-service.js +66 -0
- package/dist/src/providers/register-runtime-providers.d.ts +6 -0
- package/dist/src/providers/register-runtime-providers.js +55 -0
- package/dist/src/providers/xopc-cloud-account-service.d.ts +2 -2
- package/dist/src/providers/xopc-cloud-account-service.js +6 -5
- package/dist/src/providers/xopc-cloud-config.d.ts +3 -0
- package/dist/src/providers/xopc-cloud-config.js +13 -0
- package/dist/src/providers/xopc-cloud-model-source.d.ts +2 -2
- package/dist/src/providers/xopc-cloud-model-source.js +6 -5
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/thinking-resolve.d.ts +8 -0
- package/dist/src/session/thinking-resolve.js +6 -3
- package/dist/src/storage/sqlite/home-attention-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/home-attention-repository.js +21 -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/067_home_attention_acknowledgements.sql +9 -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/storage/sqlite/schema.sql +10 -0
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/tui/xopc-tui-keybindings.d.ts +44 -4
- package/dist/src/workflows/engine/workflow-engine.d.ts +1 -0
- package/dist/src/workflows/engine/workflow-engine.js +2 -0
- package/dist/src/workflows/service/workflow-run-service.js +11 -5
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/agents-BVxEFPQ5.js +0 -2
- package/dist/gateway/static/root/assets/appearance-settings-B2PQxRiu.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BtIgd82S.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-CG_SCH5b.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CfLqPWZC.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DCJmm6cR.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-CnkAYvWI.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-DtqqFpDn.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-C-5yHbc0.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CaHfs8YF.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-CvFMKYdb.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-DAeb82xP.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-CwLSp01r.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-DvJQ6_4M.js +0 -2
- package/dist/gateway/static/root/assets/index-CfXiRNN5.css +0 -1
- package/dist/gateway/static/root/assets/index-eyttVNS_.js +0 -212
- package/dist/gateway/static/root/assets/local-app-workbench-page-CPcfqn_A.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-DXABWCZp.js +0 -7
- package/dist/gateway/static/root/assets/messages-BiBdO1-O.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-DgJzZRX3.js +0 -4
- package/dist/gateway/static/root/assets/pdf-epILhEOn.js +0 -54
- package/dist/gateway/static/root/assets/pdf.worker.min-iDqQPrd3.mjs +0 -31
- package/dist/gateway/static/root/assets/project-detail-page-DF7F70Vg.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Cw3jyi5s.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-ChAJsaNY.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BxZIxt7z.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DcDLS0xV.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-4Xa9NA7v.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BpN0o5Cf.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DvF2UAaL.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CGKXpNfy.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-BhgCeDuO.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Dy_fKAK_.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BWkjb1NK.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DLBNFse5.js +0 -1
- package/dist/gateway/static/root/assets/work-page-Bn5RXMIE.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BuniGPO0.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-_vFhRrAl.js +0 -11
|
@@ -2,9 +2,9 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { loadConfig } from "../../config/loader.js";
|
|
3
3
|
import { formatExamples, register } from "../registry.js";
|
|
4
4
|
import "../../config/index.js";
|
|
5
|
-
import { acquireUpdateLock } from "../../infra/update-lock.js";
|
|
6
5
|
import { normalizeUpdateChannel } from "../../infra/update-channels.js";
|
|
7
6
|
import { compareSemver, resolveNpmChannelTag } from "../../infra/update-check.js";
|
|
7
|
+
import { acquireUpdateLock } from "../../infra/update-lock.js";
|
|
8
8
|
import { formatUpdateApiResult, resolveUpdateInstallSurface, runGatewayUpdateWithPostSteps } from "../../infra/update-runner.js";
|
|
9
9
|
import { Command } from "commander";
|
|
10
10
|
//#region src/cli/commands/update.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
1
2
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
2
3
|
import "../agent-manifest/index.js";
|
|
3
|
-
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
4
4
|
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
5
5
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
6
6
|
//#region src/config/agent-profile.ts
|
package/dist/src/config/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ENV_VARS, XOPC_DB_FILENAME, resolveHomeDir, resolveStateDir, resolveXopcDatabasePath } from "./paths-state.js";
|
|
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
|
-
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, 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";
|
|
4
|
+
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, 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
5
|
import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.js";
|
|
6
6
|
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
7
7
|
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
@@ -27,4 +27,4 @@ init_workspace_path();
|
|
|
27
27
|
init_models_json();
|
|
28
28
|
init_resolve_config_value();
|
|
29
29
|
//#endregion
|
|
30
|
-
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BASE_RELOAD_RULES, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigHotReloader, ConfigSchema, ConnectorsConfigSchema, CustomModelSchema, ENV_VARS, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, FILENAMES, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelOverrideSchema, ModelsDevConfigSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProfileManager, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, UpdateAutoConfigSchema, UpdateConfigSchema, VercelGatewayRoutingSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WORKSPACE_FILES, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, XOPC_DB_FILENAME, applyConfigOverrides, buildReloadPlan, canonicalizeConfiguredMcpServer, clearConfigValueCache, createProfile, deleteProfile, diffConfigPaths, existsSync, expandWorkspacePathString, extractProfileAgentId, formatThinkingLevels, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, getAllowedCommands, getCacheStats, getConfigOverrides, getCurrentProfile, getDefaultModelValues, resolveModelsJsonPath as getModelsJsonPath, getProfileManager, getProfileNameFromDir, getSwitchCommand, getWorkspacePath, hasBundledExtensionManifest, isKnownCliMcpTypeAlias, listAgentProfileMarkdownDirs, listAgentWorkspaceDirs, listProfiles, listThinkingLevels, loadConfig, loadModelsJson, matchReloadRule, modelsJsonExists, normalizeConfiguredMcpServers, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, normalizeWorkspaceDir, parseModelRef, resetConfigOverrides, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveConfigValue, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHeaders, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveProfileStateDir, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceRoot, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcDatabasePath, resolveXopcMcpTransportAlias, saveConfig, saveModelsJson, setConfigOverride, testApiKeyResolution, thinkLevelToNumber, unsetConfigOverride, validateModelsConfig };
|
|
30
|
+
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BASE_RELOAD_RULES, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigHotReloader, ConfigSchema, ConnectorsConfigSchema, CustomModelSchema, ENV_VARS, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, FILENAMES, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelOverrideSchema, ModelsDevConfigSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProfileManager, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, UpdateAutoConfigSchema, UpdateConfigSchema, VercelGatewayRoutingSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WORKSPACE_FILES, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, XOPC_DB_FILENAME, applyConfigOverrides, buildReloadPlan, canonicalizeConfiguredMcpServer, clearConfigValueCache, createProfile, deleteProfile, diffConfigPaths, existsSync, expandWorkspacePathString, extractProfileAgentId, formatThinkingLevels, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, getAllowedCommands, getCacheStats, getConfigOverrides, getCurrentProfile, getDefaultModelValues, resolveModelsJsonPath as getModelsJsonPath, getProfileManager, getProfileNameFromDir, getSwitchCommand, getWorkspacePath, hasBundledExtensionManifest, isKnownCliMcpTypeAlias, listAgentProfileMarkdownDirs, listAgentWorkspaceDirs, listProfiles, listThinkingLevels, loadConfig, loadModelsJson, matchReloadRule, modelsJsonExists, normalizeConfiguredMcpServers, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, normalizeWorkspaceDir, parseModelRef, resetConfigOverrides, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveConfigValue, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHeaders, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveProfileStateDir, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceRoot, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcDatabasePath, resolveXopcMcpTransportAlias, saveConfig, saveModelsJson, setConfigOverride, testApiKeyResolution, thinkLevelToNumber, unsetConfigOverride, validateModelsConfig };
|
|
@@ -787,6 +787,13 @@ export declare const GatewayBindModeSchema: z.ZodEnum<{
|
|
|
787
787
|
lan: "lan";
|
|
788
788
|
tailnet: "tailnet";
|
|
789
789
|
}>;
|
|
790
|
+
export declare const GatewayWebchatConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
791
|
+
activityDetailDefault: z.ZodDefault<z.ZodEnum<{
|
|
792
|
+
stream: "stream";
|
|
793
|
+
on: "on";
|
|
794
|
+
off: "off";
|
|
795
|
+
}>>;
|
|
796
|
+
}, z.core.$strip>>;
|
|
790
797
|
export declare const GatewayConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
791
798
|
bind: z.ZodOptional<z.ZodEnum<{
|
|
792
799
|
auto: "auto";
|
|
@@ -872,6 +879,13 @@ export declare const GatewayConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
872
879
|
timezone: z.ZodOptional<z.ZodString>;
|
|
873
880
|
}, z.core.$strip>>;
|
|
874
881
|
}, z.core.$strip>>>;
|
|
882
|
+
webchat: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
883
|
+
activityDetailDefault: z.ZodDefault<z.ZodEnum<{
|
|
884
|
+
stream: "stream";
|
|
885
|
+
on: "on";
|
|
886
|
+
off: "off";
|
|
887
|
+
}>>;
|
|
888
|
+
}, z.core.$strip>>>;
|
|
875
889
|
maxSseConnections: z.ZodOptional<z.ZodNumber>;
|
|
876
890
|
corsOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
877
891
|
publicUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -2053,6 +2067,13 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
2053
2067
|
timezone: z.ZodOptional<z.ZodString>;
|
|
2054
2068
|
}, z.core.$strip>>;
|
|
2055
2069
|
}, z.core.$strip>>>;
|
|
2070
|
+
webchat: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
2071
|
+
activityDetailDefault: z.ZodDefault<z.ZodEnum<{
|
|
2072
|
+
stream: "stream";
|
|
2073
|
+
on: "on";
|
|
2074
|
+
off: "off";
|
|
2075
|
+
}>>;
|
|
2076
|
+
}, z.core.$strip>>>;
|
|
2056
2077
|
maxSseConnections: z.ZodOptional<z.ZodNumber>;
|
|
2057
2078
|
corsOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2058
2079
|
publicUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -64,7 +64,7 @@ function parseModelRef(ref) {
|
|
|
64
64
|
model: trimmed.slice(idx + 1).trim()
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
var AgentModelRefSchema, AgentImageGenerationModelSchema, AgentTypedModelRoleSchema, AgentTypedModelRolesSchema, AgentModelsSchema, AgentsConfigSchema, BrowserCloudConfigSchema, BrowserExtensionConfigSchema, BrowserCloakConfigSchema, BrowserConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, SessionDmScopeSchema, SessionStorageConfigSchema, SessionResetModeSchema, SessionResetConfigSchema, SessionResetByTypeSchema, SessionScopeSchema, SessionConfigSchema, ChannelsConfigSchema, SearchProviderEntrySchema, WebSearchConfigSchema, WebsiteBlocklistSchema, WebToolsConfigSchema, ToolsConfigSchema, GatewayAuthRateLimitSchema, GatewaySecuritySchema, GatewayTrustedProxySchema, GatewayAuthSchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayRemoteSchema, GatewayTlsSchema, GatewayModeSchema, HeartbeatConfigSchema, GatewayChannelConnectDeferModeSchema, TunnelConsentSchema, TunnelConfigSchema, WorkspaceImportConfigSchema, WorkspaceConfigSchema, GatewayBindModeSchema, GatewayConfigSchema, ModelsDevConfigSchema, ModelCatalogConfigSchema, SttProviderConfigCatchallSchema, STTProviderConfigSchema, STTFallbackConfigSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, STTConfigSchema, TtsProviderConfigCatchallSchema, TTSProviderConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSEdgeConfigSchema, TTSSummarizationConfigSchema, TTSConfigSchema, VoiceRefinementConfigSchema, VoiceConfigSchema, MessagesConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProviderAuthConfigSchema, ProvidersConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, UpdateAutoConfigSchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, UpdateConfigSchema, CommandsConfigSchema, TuiConfigSchema, McpHttpUrlSchema, ConnectorSecretReferenceSchema, McpConfigScalarSchema, McpServerSchema, McpConfigSchema, CodeIntelligenceConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ConfigSchema;
|
|
67
|
+
var AgentModelRefSchema, AgentImageGenerationModelSchema, AgentTypedModelRoleSchema, AgentTypedModelRolesSchema, AgentModelsSchema, AgentsConfigSchema, BrowserCloudConfigSchema, BrowserExtensionConfigSchema, BrowserCloakConfigSchema, BrowserConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, SessionDmScopeSchema, SessionStorageConfigSchema, SessionResetModeSchema, SessionResetConfigSchema, SessionResetByTypeSchema, SessionScopeSchema, SessionConfigSchema, ChannelsConfigSchema, SearchProviderEntrySchema, WebSearchConfigSchema, WebsiteBlocklistSchema, WebToolsConfigSchema, ToolsConfigSchema, GatewayAuthRateLimitSchema, GatewaySecuritySchema, GatewayTrustedProxySchema, GatewayAuthSchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayRemoteSchema, GatewayTlsSchema, GatewayModeSchema, HeartbeatConfigSchema, GatewayChannelConnectDeferModeSchema, TunnelConsentSchema, TunnelConfigSchema, WorkspaceImportConfigSchema, WorkspaceConfigSchema, GatewayBindModeSchema, GatewayWebchatConfigSchema, GatewayConfigSchema, ModelsDevConfigSchema, ModelCatalogConfigSchema, SttProviderConfigCatchallSchema, STTProviderConfigSchema, STTFallbackConfigSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, STTConfigSchema, TtsProviderConfigCatchallSchema, TTSProviderConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSEdgeConfigSchema, TTSSummarizationConfigSchema, TTSConfigSchema, VoiceRefinementConfigSchema, VoiceConfigSchema, MessagesConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProviderAuthConfigSchema, ProvidersConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, UpdateAutoConfigSchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, UpdateConfigSchema, CommandsConfigSchema, TuiConfigSchema, McpHttpUrlSchema, ConnectorSecretReferenceSchema, McpConfigScalarSchema, McpServerSchema, McpConfigSchema, CodeIntelligenceConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ConfigSchema;
|
|
68
68
|
var init_schema = __esmMin((() => {
|
|
69
69
|
init_schema$1();
|
|
70
70
|
init_preset_chain();
|
|
@@ -451,6 +451,13 @@ strict: z.boolean().optional() }).optional();
|
|
|
451
451
|
"tailnet",
|
|
452
452
|
"custom"
|
|
453
453
|
]);
|
|
454
|
+
GatewayWebchatConfigSchema = z.object({
|
|
455
|
+
/** Default visibility of AI execution activity in the Web UI. */
|
|
456
|
+
activityDetailDefault: z.enum([
|
|
457
|
+
"off",
|
|
458
|
+
"on",
|
|
459
|
+
"stream"
|
|
460
|
+
]).default("on") }).default({ activityDetailDefault: "on" });
|
|
454
461
|
GatewayConfigSchema = z.object({
|
|
455
462
|
/** Semantic bind mode. */
|
|
456
463
|
bind: GatewayBindModeSchema.optional(),
|
|
@@ -465,6 +472,7 @@ strict: z.boolean().optional() }).optional();
|
|
|
465
472
|
tls: GatewayTlsSchema.optional(),
|
|
466
473
|
auth: GatewayAuthSchema.optional(),
|
|
467
474
|
heartbeat: HeartbeatConfigSchema.optional(),
|
|
475
|
+
webchat: GatewayWebchatConfigSchema.optional(),
|
|
468
476
|
maxSseConnections: z.number().optional(),
|
|
469
477
|
corsOrigins: z.array(z.string()).optional(),
|
|
470
478
|
/**
|
|
@@ -638,6 +646,7 @@ strict: z.boolean().optional() }).optional();
|
|
|
638
646
|
intervalMs: 18e5,
|
|
639
647
|
includeSystemPromptSection: false
|
|
640
648
|
},
|
|
649
|
+
webchat: { activityDetailDefault: "on" },
|
|
641
650
|
maxSseConnections: 100,
|
|
642
651
|
corsOrigins: [],
|
|
643
652
|
skillsMarketplaceProvider: "store",
|
|
@@ -1116,6 +1125,7 @@ workDiscoveryOnboarding: z.boolean().default(true) }).strict().default({ workDis
|
|
|
1116
1125
|
intervalMs: 18e5,
|
|
1117
1126
|
includeSystemPromptSection: false
|
|
1118
1127
|
},
|
|
1128
|
+
webchat: { activityDetailDefault: "on" },
|
|
1119
1129
|
maxSseConnections: 100,
|
|
1120
1130
|
corsOrigins: [],
|
|
1121
1131
|
skillsMarketplaceProvider: "store",
|
|
@@ -1183,4 +1193,4 @@ workDiscoveryOnboarding: z.boolean().default(true) }).strict().default({ workDis
|
|
|
1183
1193
|
}));
|
|
1184
1194
|
//#endregion
|
|
1185
1195
|
init_schema();
|
|
1186
|
-
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef };
|
|
1196
|
+
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
2
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
|
+
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
3
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
4
|
import { WORKSPACE_FILES, init_paths, resolveUserProfilePath } from "../config/paths.js";
|
|
5
5
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { shouldSilence, stripHeartbeatToken } from "../../heartbeat/tokens.js";
|
|
4
|
-
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
5
4
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
6
5
|
import { isHeartbeatContentEmpty } from "../../heartbeat/content-check.js";
|
|
6
|
+
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
7
7
|
import { createHeartbeatWake } from "../../heartbeat/wake.js";
|
|
8
8
|
import { resolveHeartbeatMdPath } from "../workspace-heartbeat-path.js";
|
|
9
9
|
import { readFile } from "fs/promises";
|
|
@@ -252,6 +252,9 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
252
252
|
timezone?: string;
|
|
253
253
|
};
|
|
254
254
|
};
|
|
255
|
+
webchat: {
|
|
256
|
+
activityDetailDefault: "stream" | "on" | "off";
|
|
257
|
+
};
|
|
255
258
|
maxSseConnections: number;
|
|
256
259
|
channelConnectDeferMode: "explicit" | "off" | "auto";
|
|
257
260
|
channelConnectDeferIds: string[];
|
|
@@ -165,6 +165,7 @@ async function buildSafeWebConfigPayload(service, options = {}) {
|
|
|
165
165
|
isolatedSession: config.gateway?.heartbeat?.isolatedSession,
|
|
166
166
|
activeHours: config.gateway?.heartbeat?.activeHours
|
|
167
167
|
},
|
|
168
|
+
webchat: { activityDetailDefault: config.gateway?.webchat?.activityDetailDefault ?? "on" },
|
|
168
169
|
maxSseConnections: typeof config.gateway?.maxSseConnections === "number" ? config.gateway.maxSseConnections : 100,
|
|
169
170
|
channelConnectDeferMode: config.gateway?.channelConnectDeferMode ?? "auto",
|
|
170
171
|
channelConnectDeferIds: Array.isArray(config.gateway?.channelConnectDeferIds) ? config.gateway.channelConnectDeferIds : [],
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
import { Hono } from 'hono';
|
|
9
9
|
import type { GatewayService } from '../service.js';
|
|
10
10
|
import { type OAuthCredentials } from '../../auth/oauth/types.js';
|
|
11
|
+
export declare function resolveOAuthLoginMethodPreference(params: {
|
|
12
|
+
requestedMethod?: unknown;
|
|
13
|
+
supportedMethods?: readonly string[];
|
|
14
|
+
remote: boolean;
|
|
15
|
+
}): string | undefined;
|
|
11
16
|
export declare function createOAuthAsyncHandler(service: GatewayService): Hono<import("hono/dist/types/types.js").BlankEnv, import("hono/dist/types/types.js").BlankSchema, "/">;
|
|
12
17
|
export declare function getOAuthCredentialsFromCache(provider: string): OAuthCredentials | undefined;
|
|
13
18
|
export declare function setOAuthCredentialsToCache(provider: string, creds: OAuthCredentials): void;
|
|
@@ -28,6 +28,7 @@ function formatOAuthAsyncError(err) {
|
|
|
28
28
|
const OAUTH_PROVIDERS = getOAuthProviderInterfaces();
|
|
29
29
|
const oauthSessions = /* @__PURE__ */ new Map();
|
|
30
30
|
const SESSION_TTL_MS = 600 * 1e3;
|
|
31
|
+
const SESSION_EXPIRY_GRACE_MS = 3e4;
|
|
31
32
|
setInterval(() => {
|
|
32
33
|
const now = Date.now();
|
|
33
34
|
for (const [id, session] of oauthSessions.entries()) if (now > session.expiresAt) {
|
|
@@ -64,11 +65,21 @@ function requestLooksRemote(c) {
|
|
|
64
65
|
hostWithoutPort(c.req.header("host"))
|
|
65
66
|
].some((candidate) => candidate && !isLoopbackHost(candidate));
|
|
66
67
|
}
|
|
68
|
+
function resolveOAuthLoginMethodPreference(params) {
|
|
69
|
+
if (typeof params.requestedMethod === "string" && params.requestedMethod.trim()) {
|
|
70
|
+
const requested = params.requestedMethod.trim();
|
|
71
|
+
return !params.supportedMethods || params.supportedMethods.includes(requested) ? requested : void 0;
|
|
72
|
+
}
|
|
73
|
+
if (params.remote && params.supportedMethods?.includes("browser") && params.supportedMethods.includes("device_code")) return "device_code";
|
|
74
|
+
}
|
|
67
75
|
function preferredOAuthLoginMethod(params) {
|
|
68
|
-
if (typeof params.requestedMethod === "string" && params.requestedMethod.trim()) return params.requestedMethod.trim();
|
|
69
|
-
if (params.provider !== "openai-codex") return;
|
|
70
76
|
const publicHost = hostWithoutPort(resolveReverseProxyPublicUrl(params.service.currentConfig) ?? void 0);
|
|
71
|
-
|
|
77
|
+
const remote = Boolean(publicHost && !isLoopbackHost(publicHost) || requestLooksRemote(params.c));
|
|
78
|
+
return resolveOAuthLoginMethodPreference({
|
|
79
|
+
requestedMethod: params.requestedMethod,
|
|
80
|
+
supportedMethods: OAUTH_PROVIDERS[params.provider]?.loginMethods,
|
|
81
|
+
remote
|
|
82
|
+
});
|
|
72
83
|
}
|
|
73
84
|
function createOAuthAsyncHandler(service) {
|
|
74
85
|
const oauth = new Hono();
|
|
@@ -99,9 +110,9 @@ function createOAuthAsyncHandler(service) {
|
|
|
99
110
|
oauthSessions.set(sessionId, session);
|
|
100
111
|
runOAuthFlow(session, oauthProvider, service).catch((err) => {
|
|
101
112
|
log.error({
|
|
113
|
+
err,
|
|
102
114
|
sessionId,
|
|
103
|
-
provider
|
|
104
|
-
error: err
|
|
115
|
+
provider
|
|
105
116
|
}, "Background OAuth flow failed");
|
|
106
117
|
session.status = "failed";
|
|
107
118
|
session.error = err instanceof Error ? err.message : "OAuth flow failed";
|
|
@@ -220,6 +231,7 @@ async function runOAuthFlow(session, oauthProvider, _service) {
|
|
|
220
231
|
session.verificationUri = info.verificationUri;
|
|
221
232
|
session.instructions = `Enter code ${info.userCode}`;
|
|
222
233
|
session.message = `Open ${info.verificationUri} and enter code ${info.userCode}`;
|
|
234
|
+
if (info.expiresInSeconds) session.expiresAt = Math.max(session.expiresAt, Date.now() + info.expiresInSeconds * 1e3 + SESSION_EXPIRY_GRACE_MS);
|
|
223
235
|
},
|
|
224
236
|
onPrompt: async (prompt) => {
|
|
225
237
|
session.status = "waiting_code";
|
|
@@ -285,9 +297,9 @@ async function runOAuthFlow(session, oauthProvider, _service) {
|
|
|
285
297
|
session.status = "failed";
|
|
286
298
|
session.error = formatOAuthAsyncError(err);
|
|
287
299
|
log.error({
|
|
300
|
+
err,
|
|
288
301
|
sessionId: session.id,
|
|
289
|
-
provider: session.provider
|
|
290
|
-
error: err
|
|
302
|
+
provider: session.provider
|
|
291
303
|
}, "OAuth login failed");
|
|
292
304
|
}
|
|
293
305
|
} finally {
|
|
@@ -307,4 +319,4 @@ function deleteOAuthCredentialsFromCache(provider) {
|
|
|
307
319
|
oauthCredentialsCache.delete(provider);
|
|
308
320
|
}
|
|
309
321
|
//#endregion
|
|
310
|
-
export { createOAuthAsyncHandler, deleteOAuthCredentialsFromCache, getOAuthCredentialsFromCache, setOAuthCredentialsToCache };
|
|
322
|
+
export { createOAuthAsyncHandler, deleteOAuthCredentialsFromCache, getOAuthCredentialsFromCache, resolveOAuthLoginMethodPreference, setOAuthCredentialsToCache };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Covers heartbeat, bind/customBindHost/port, tailscale, auth (mode + token +
|
|
5
5
|
* password + rateLimit + trustedProxy), trustedProxies, allowRealIpFallback,
|
|
6
|
-
* dangerouslyAllowHostHeaderOriginFallback, security, share, siteShare, publicUrl,
|
|
6
|
+
* dangerouslyAllowHostHeaderOriginFallback, security, share, siteShare, publicUrl, webchat,
|
|
7
7
|
* corsOrigins, maxSseConnections, and channelConnectDefer{Mode,Ids,SkipIds}.
|
|
8
8
|
*
|
|
9
9
|
* Validation policy: each subsection that can reject rejects with a 400 and a
|
|
@@ -32,6 +32,15 @@ function parseDeferIdList(raw) {
|
|
|
32
32
|
return ids;
|
|
33
33
|
}
|
|
34
34
|
function applyGatewayPatch(config, body) {
|
|
35
|
+
if (body.gateway?.webchat?.activityDetailDefault !== void 0) {
|
|
36
|
+
const level = body.gateway.webchat.activityDetailDefault;
|
|
37
|
+
if (level !== "off" && level !== "on" && level !== "stream") return patchError("gateway.webchat.activityDetailDefault must be off, on, or stream");
|
|
38
|
+
const gw = ensureGateway(config);
|
|
39
|
+
gw.webchat = {
|
|
40
|
+
...gw.webchat ?? { activityDetailDefault: "on" },
|
|
41
|
+
activityDetailDefault: level
|
|
42
|
+
};
|
|
43
|
+
}
|
|
35
44
|
if (body.gateway?.heartbeat !== void 0 && typeof body.gateway.heartbeat === "object") {
|
|
36
45
|
const gw = ensureGateway(config);
|
|
37
46
|
if (!gw.heartbeat) gw.heartbeat = {
|
|
@@ -532,6 +532,8 @@ function registerGoalsRoutes(authenticated, deps) {
|
|
|
532
532
|
error: "Goal not found"
|
|
533
533
|
}, 404);
|
|
534
534
|
const patch = {};
|
|
535
|
+
let requestedProjectId;
|
|
536
|
+
let projectChanged = false;
|
|
535
537
|
if (typeof body.title === "string") patch.title = body.title;
|
|
536
538
|
if ("description" in body) patch.description = typeof body.description === "string" ? body.description : void 0;
|
|
537
539
|
const priority = parsePriority(body.priority);
|
|
@@ -547,10 +549,21 @@ function registerGoalsRoutes(authenticated, deps) {
|
|
|
547
549
|
ok: false,
|
|
548
550
|
error: "Project not found"
|
|
549
551
|
}, 404);
|
|
552
|
+
requestedProjectId = nextProjectId;
|
|
553
|
+
projectChanged = nextProjectId !== goal.projectId;
|
|
550
554
|
patch.projectId = nextProjectId;
|
|
551
555
|
}
|
|
552
556
|
const locale = normalizeGoalUiLocale(body.uiLocale);
|
|
553
557
|
if (locale) patch.uiLocale = locale;
|
|
558
|
+
if (projectChanged && goal.activeSessionKey) try {
|
|
559
|
+
if (requestedProjectId) deps.service.projects.attachSession(goal.activeSessionKey, requestedProjectId);
|
|
560
|
+
else deps.service.projects.detachSession(goal.activeSessionKey);
|
|
561
|
+
} catch (error) {
|
|
562
|
+
return c.json({
|
|
563
|
+
ok: false,
|
|
564
|
+
error: error instanceof Error ? error.message : String(error)
|
|
565
|
+
}, 404);
|
|
566
|
+
}
|
|
554
567
|
if (Object.keys(patch).length > 0) goal = goals.update(goalId, patch);
|
|
555
568
|
if (status) {
|
|
556
569
|
const previousStatus = goal?.status;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
|
+
import { type HomeAttentionSubjectKind } from '../../../storage/sqlite/index.js';
|
|
2
3
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
|
-
type HomeDecisionKind = 'work_item' | 'goal' | '
|
|
4
|
-
type HomeDecisionReason = 'needs_input' | 'in_review' | 'blocked' | 'overdue' | 'due_soon' | '
|
|
4
|
+
type HomeDecisionKind = 'work_item' | 'goal' | 'connector_approval' | 'goal_evidence';
|
|
5
|
+
type HomeDecisionReason = 'needs_input' | 'in_review' | 'blocked' | 'overdue' | 'due_soon' | 'approval_required';
|
|
6
|
+
type HomeAttention = {
|
|
7
|
+
id: string;
|
|
8
|
+
kind: HomeAttentionSubjectKind;
|
|
9
|
+
runId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
detail: string;
|
|
12
|
+
reason: 'run_failed' | 'run_timeout';
|
|
13
|
+
href: string;
|
|
14
|
+
updatedAt: number;
|
|
15
|
+
sessionKey?: string;
|
|
16
|
+
};
|
|
5
17
|
type HomeDecision = {
|
|
6
18
|
id: string;
|
|
7
19
|
kind: HomeDecisionKind;
|
|
@@ -39,6 +51,7 @@ type HomeAutomation = {
|
|
|
39
51
|
export declare function buildHomeBriefing(input: {
|
|
40
52
|
locale?: string;
|
|
41
53
|
decisions: HomeDecision[];
|
|
54
|
+
attention: HomeAttention[];
|
|
42
55
|
activeWorkCount: number;
|
|
43
56
|
activeWorkflowCount: number;
|
|
44
57
|
activeGoalCount: number;
|
|
@@ -68,7 +81,7 @@ export declare function buildHomeBriefing(input: {
|
|
|
68
81
|
* - recentSessions: last 5 active AI sessions (threads)
|
|
69
82
|
* - activeAgent: default agent identity for this gateway
|
|
70
83
|
* - gateway: readiness + public tunnel status
|
|
71
|
-
* - workflowRuns: active
|
|
84
|
+
* - workflowRuns: active and recent workflow runs
|
|
72
85
|
* - upcomingAutomations: upcoming enabled automations
|
|
73
86
|
* - recentAutomationRuns: latest automation executions
|
|
74
87
|
*/
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { acknowledgeHomeAttention, isHomeAttentionAcknowledged } from "../../../storage/sqlite/home-attention-repository.js";
|
|
1
2
|
import { decideConnectorApproval, listConnectorApprovals } from "../../../storage/sqlite/connector-repository.js";
|
|
2
3
|
import "../../../storage/sqlite/index.js";
|
|
3
4
|
import { GoalService } from "../../../goals/goal-service.js";
|
|
4
5
|
import "../../../goals/index.js";
|
|
6
|
+
import "../../../automations/domain/defaults.js";
|
|
7
|
+
import "../../../automations/index.js";
|
|
5
8
|
import { listGatewayAgents } from "../../agents-admin.js";
|
|
6
9
|
import { WorkItemService } from "../../../work-items/work-item-service.js";
|
|
7
10
|
import "../../../work-items/index.js";
|
|
@@ -83,6 +86,19 @@ function toHomeAutomationRun(run) {
|
|
|
83
86
|
workflowRunId: run.workflowRunId
|
|
84
87
|
};
|
|
85
88
|
}
|
|
89
|
+
function effectiveAutomationTimeoutSeconds(run, automation) {
|
|
90
|
+
return run.actionSnapshot.timeoutSeconds ?? automation?.reliability?.timeoutSeconds ?? 300;
|
|
91
|
+
}
|
|
92
|
+
function attentionDetail(kind, status, locale, timeoutSeconds) {
|
|
93
|
+
const isChinese = locale?.toLowerCase().startsWith("zh") ?? false;
|
|
94
|
+
if (status === "timeout") {
|
|
95
|
+
const seconds = timeoutSeconds ?? 300;
|
|
96
|
+
const duration = seconds % 60 === 0 ? `${seconds / 60} ${isChinese ? "分钟" : seconds === 60 ? "minute" : "minutes"}` : `${seconds} ${isChinese ? "秒" : seconds === 1 ? "second" : "seconds"}`;
|
|
97
|
+
return isChinese ? `运行超过 ${duration},系统已停止本次执行。` : `The run exceeded ${duration} and was stopped.`;
|
|
98
|
+
}
|
|
99
|
+
if (isChinese) return kind === "automation_run" ? "自动化未能完成,请查看详情后重试。" : "工作流未能完成,请查看详情后重试。";
|
|
100
|
+
return kind === "automation_run" ? "The automation did not complete. Review the details and retry." : "The workflow did not complete. Review the details and retry.";
|
|
101
|
+
}
|
|
86
102
|
function decisionFromGoal(goal, projectName) {
|
|
87
103
|
if (goal.status !== "needs_input" && goal.status !== "blocked") return null;
|
|
88
104
|
return {
|
|
@@ -124,7 +140,8 @@ function decisionFromWorkItem(item, projectName, nowMs) {
|
|
|
124
140
|
function buildHomeBriefing(input) {
|
|
125
141
|
const isChinese = input.locale?.toLowerCase().startsWith("zh") ?? false;
|
|
126
142
|
const movingCount = input.activeWorkCount + input.activeWorkflowCount + input.activeGoalCount;
|
|
127
|
-
const
|
|
143
|
+
const attentionCount = input.decisions.length + input.attention.length;
|
|
144
|
+
const summary = attentionCount > 0 ? isChinese ? movingCount > 0 ? `有 ${attentionCount} 件事需要你处理;我正在继续推进 ${movingCount} 件工作。` : `有 ${attentionCount} 件事需要你处理。` : movingCount > 0 ? `${attentionCount} ${attentionCount === 1 ? "item needs" : "items need"} your attention; I’m continuing ${movingCount} in the background.` : `${attentionCount} ${attentionCount === 1 ? "item needs" : "items need"} your attention.` : movingCount > 0 ? isChinese ? `目前没有事情需要你处理;我正在继续推进 ${movingCount} 件工作。` : `Nothing needs you right now; I’m continuing ${movingCount} ${movingCount === 1 ? "item" : "items"} in the background.` : isChinese ? "今天还没有正在推进的事项。把想要的结果交给我,我会从这里开始。" : "Nothing is moving yet today. Hand me an outcome and I’ll take it from here.";
|
|
128
145
|
return {
|
|
129
146
|
generatedAt: input.nowMs,
|
|
130
147
|
summary,
|
|
@@ -149,7 +166,7 @@ function buildHomeBriefing(input) {
|
|
|
149
166
|
* - recentSessions: last 5 active AI sessions (threads)
|
|
150
167
|
* - activeAgent: default agent identity for this gateway
|
|
151
168
|
* - gateway: readiness + public tunnel status
|
|
152
|
-
* - workflowRuns: active
|
|
169
|
+
* - workflowRuns: active and recent workflow runs
|
|
153
170
|
* - upcomingAutomations: upcoming enabled automations
|
|
154
171
|
* - recentAutomationRuns: latest automation executions
|
|
155
172
|
*/
|
|
@@ -222,33 +239,14 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
222
239
|
const currentWorkItems = activeWorkItems.slice(0, 30).map((item) => toHomeWorkItem(item, projectsById.get(item.projectId)?.name ?? "Project"));
|
|
223
240
|
const recentlyCompletedWorkItems = allWorkItems.items.filter((item) => item.status === "done").sort((left, right) => (right.completedAt ?? right.updatedAt) - (left.completedAt ?? left.updatedAt)).slice(0, 8).map((item) => toHomeWorkItem(item, projectsById.get(item.projectId)?.name ?? "Project"));
|
|
224
241
|
const activeWorkflowRuns = workflowRuns.filter((run) => run.status === "queued" || run.status === "running").slice(0, 5).map(toHomeWorkflowRun);
|
|
225
|
-
const
|
|
242
|
+
const failedWorkflowRuns = workflowRuns.filter((run) => run.status === "failed" || run.status === "timeout").slice(0, 5).map(toHomeWorkflowRun);
|
|
226
243
|
const recentWorkflowRuns = workflowRuns.slice(0, 5).map(toHomeWorkflowRun);
|
|
227
244
|
const upcomingAutomations = automations.map(toHomeAutomation).filter((automation) => Boolean(automation)).sort((a, b) => Date.parse(a.nextRunAt) - Date.parse(b.nextRunAt)).slice(0, 5);
|
|
228
245
|
const latestAutomationRuns = [...automationRuns].sort((left, right) => right.createdAtMs - left.createdAtMs).filter((run, index, all) => all.findIndex((candidate) => candidate.automationId === run.automationId) === index);
|
|
246
|
+
const automationsById = new Map(automations.map((automation) => [automation.id, automation]));
|
|
229
247
|
const decisions = [
|
|
230
248
|
...activeWorkItems.map((item) => decisionFromWorkItem(item, projectsById.get(item.projectId)?.name ?? "Project", nowMs)).filter((item) => Boolean(item)),
|
|
231
249
|
...activeGoals.map((goal) => decisionFromGoal(goal, goal.projectId ? projectsById.get(goal.projectId)?.name : void 0)).filter((item) => Boolean(item)),
|
|
232
|
-
...attentionWorkflowRuns.map((run) => ({
|
|
233
|
-
id: `workflow:${run.id}`,
|
|
234
|
-
kind: "workflow_run",
|
|
235
|
-
title: run.title,
|
|
236
|
-
detail: run.status,
|
|
237
|
-
reason: "run_failed",
|
|
238
|
-
urgency: "now",
|
|
239
|
-
href: `/workflows?runId=${encodeURIComponent(run.id)}`,
|
|
240
|
-
updatedAt: run.completedAtMs ?? run.startedAtMs ?? run.createdAtMs
|
|
241
|
-
})),
|
|
242
|
-
...latestAutomationRuns.filter((run) => run.status === "failed" || run.status === "timeout").map((run) => ({
|
|
243
|
-
id: `automation:${run.id}`,
|
|
244
|
-
kind: "automation_run",
|
|
245
|
-
title: run.automationName || run.automationId,
|
|
246
|
-
detail: run.error || run.summary,
|
|
247
|
-
reason: "run_failed",
|
|
248
|
-
urgency: "now",
|
|
249
|
-
href: "/automations",
|
|
250
|
-
updatedAt: run.endedAtMs ?? run.startedAtMs ?? run.createdAtMs
|
|
251
|
-
})),
|
|
252
250
|
...connectorApprovals.filter((approval) => Date.parse(approval.expiresAt) > nowMs).map((approval) => ({
|
|
253
251
|
id: `connector-approval:${approval.id}`,
|
|
254
252
|
kind: "connector_approval",
|
|
@@ -283,6 +281,28 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
283
281
|
].sort((left, right) => {
|
|
284
282
|
return (left.urgency === "now" ? 0 : 1) - (right.urgency === "now" ? 0 : 1) || right.updatedAt - left.updatedAt;
|
|
285
283
|
}).slice(0, 20);
|
|
284
|
+
const locale = c.req.query("locale");
|
|
285
|
+
const attention = [...failedWorkflowRuns.filter((run) => !isHomeAttentionAcknowledged("workflow_run", run.id)).map((run) => ({
|
|
286
|
+
id: `workflow_run:${run.id}`,
|
|
287
|
+
kind: "workflow_run",
|
|
288
|
+
runId: run.id,
|
|
289
|
+
title: run.title,
|
|
290
|
+
detail: attentionDetail("workflow_run", run.status === "timeout" ? "timeout" : "failed", locale),
|
|
291
|
+
reason: run.status === "timeout" ? "run_timeout" : "run_failed",
|
|
292
|
+
href: `/workflows?runId=${encodeURIComponent(run.id)}`,
|
|
293
|
+
updatedAt: run.completedAtMs ?? run.startedAtMs ?? run.createdAtMs,
|
|
294
|
+
sessionKey: run.sessionKey
|
|
295
|
+
})), ...latestAutomationRuns.filter((run) => run.status === "failed" || run.status === "timeout").filter((run) => !isHomeAttentionAcknowledged("automation_run", run.id)).map((run) => ({
|
|
296
|
+
id: `automation_run:${run.id}`,
|
|
297
|
+
kind: "automation_run",
|
|
298
|
+
runId: run.id,
|
|
299
|
+
title: run.automationName || run.automationId,
|
|
300
|
+
detail: attentionDetail("automation_run", run.status === "timeout" ? "timeout" : "failed", locale, effectiveAutomationTimeoutSeconds(run, automationsById.get(run.automationId))),
|
|
301
|
+
reason: run.status === "timeout" ? "run_timeout" : "run_failed",
|
|
302
|
+
href: `/automations?run=${encodeURIComponent(run.id)}`,
|
|
303
|
+
updatedAt: run.endedAtMs ?? run.startedAtMs ?? run.createdAtMs,
|
|
304
|
+
sessionKey: run.sessionKey
|
|
305
|
+
}))].sort((left, right) => right.updatedAt - left.updatedAt).slice(0, 10);
|
|
286
306
|
const wins = [
|
|
287
307
|
...recentlyCompletedWorkItems.map((item) => ({
|
|
288
308
|
id: `work:${item.id}`,
|
|
@@ -307,8 +327,9 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
307
327
|
}))
|
|
308
328
|
].sort((left, right) => right.completedAt - left.completedAt);
|
|
309
329
|
const briefing = buildHomeBriefing({
|
|
310
|
-
locale
|
|
330
|
+
locale,
|
|
311
331
|
decisions,
|
|
332
|
+
attention,
|
|
312
333
|
activeWorkCount: activeWorkItems.filter((item) => item.status === "in_progress").length,
|
|
313
334
|
activeWorkflowCount: activeWorkflowRuns.length,
|
|
314
335
|
activeGoalCount: activeGoals.filter((goal) => goal.status === "active").length,
|
|
@@ -341,11 +362,11 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
341
362
|
},
|
|
342
363
|
workflowRuns: {
|
|
343
364
|
active: activeWorkflowRuns,
|
|
344
|
-
attention: attentionWorkflowRuns,
|
|
345
365
|
recent: recentWorkflowRuns
|
|
346
366
|
},
|
|
347
367
|
briefing,
|
|
348
368
|
decisions,
|
|
369
|
+
attention,
|
|
349
370
|
chats: {
|
|
350
371
|
running: workChats.filter((chat) => chat.active),
|
|
351
372
|
recent: workChats.filter((chat) => !chat.active).slice(0, 8)
|
|
@@ -412,6 +433,58 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
412
433
|
error: "Unsupported decision kind"
|
|
413
434
|
}, 400);
|
|
414
435
|
});
|
|
436
|
+
authenticated.post("/api/home/attention/acknowledge", deps.strictRateLimitMiddleware, async (c) => {
|
|
437
|
+
const body = await c.req.json().catch(() => ({}));
|
|
438
|
+
const kind = body.kind === "automation_run" || body.kind === "workflow_run" ? body.kind : void 0;
|
|
439
|
+
const runId = typeof body.runId === "string" ? body.runId.trim() : "";
|
|
440
|
+
if (!kind || !runId) return c.json({
|
|
441
|
+
ok: false,
|
|
442
|
+
error: "kind and runId are required"
|
|
443
|
+
}, 400);
|
|
444
|
+
acknowledgeHomeAttention(kind, runId);
|
|
445
|
+
return c.json({
|
|
446
|
+
ok: true,
|
|
447
|
+
status: "acknowledged"
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
authenticated.post("/api/home/attention/retry", deps.strictRateLimitMiddleware, async (c) => {
|
|
451
|
+
const body = await c.req.json().catch(() => ({}));
|
|
452
|
+
const kind = body.kind === "automation_run" || body.kind === "workflow_run" ? body.kind : void 0;
|
|
453
|
+
const runId = typeof body.runId === "string" ? body.runId.trim() : "";
|
|
454
|
+
if (!kind || !runId) return c.json({
|
|
455
|
+
ok: false,
|
|
456
|
+
error: "kind and runId are required"
|
|
457
|
+
}, 400);
|
|
458
|
+
if (kind === "automation_run") try {
|
|
459
|
+
const run = await service.automationServiceInstance.rerunFromRun(runId);
|
|
460
|
+
acknowledgeHomeAttention(kind, runId);
|
|
461
|
+
return c.json({
|
|
462
|
+
ok: true,
|
|
463
|
+
runId: run.id
|
|
464
|
+
}, 202);
|
|
465
|
+
} catch (error) {
|
|
466
|
+
return c.json({
|
|
467
|
+
ok: false,
|
|
468
|
+
error: error instanceof Error ? error.message : "Failed to retry automation"
|
|
469
|
+
}, 400);
|
|
470
|
+
}
|
|
471
|
+
const agentId = (await listGatewayAgents(service.currentConfig)).defaultId;
|
|
472
|
+
const result = await service.createWorkflowRunService().retryWorkflowRun({
|
|
473
|
+
agentId,
|
|
474
|
+
runId
|
|
475
|
+
});
|
|
476
|
+
if (result.ok === false) return c.json({
|
|
477
|
+
ok: false,
|
|
478
|
+
error: result.message,
|
|
479
|
+
code: result.code
|
|
480
|
+
}, result.httpStatus);
|
|
481
|
+
acknowledgeHomeAttention(kind, runId);
|
|
482
|
+
return c.json({
|
|
483
|
+
ok: true,
|
|
484
|
+
runId: result.runId,
|
|
485
|
+
sessionKey: result.sessionKey
|
|
486
|
+
}, 202);
|
|
487
|
+
});
|
|
415
488
|
}
|
|
416
489
|
//#endregion
|
|
417
490
|
export { buildHomeBriefing, registerHomeRoutes };
|
|
@@ -4,6 +4,7 @@ import { registerSessionsRoutes } from "./sessions.js";
|
|
|
4
4
|
import { registerStatusRoutes } from "./status.js";
|
|
5
5
|
import { registerMemoryRoutes } from "./memory.js";
|
|
6
6
|
import { registerProjectsRoutes } from "./projects.js";
|
|
7
|
+
import { registerProjectSkillRoutes } from "./project-skills.js";
|
|
7
8
|
import { registerSearchRoutes } from "./search.js";
|
|
8
9
|
import { registerMobileRoutes } from "./mobile.js";
|
|
9
10
|
import { registerTaskOutcomeRoutes } from "./task-outcomes.js";
|
|
@@ -21,6 +22,7 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
21
22
|
registerMemoryRoutes(authenticated, deps);
|
|
22
23
|
registerActivityRoutes(authenticated, deps);
|
|
23
24
|
registerProjectsRoutes(authenticated, deps);
|
|
25
|
+
registerProjectSkillRoutes(authenticated, deps);
|
|
24
26
|
registerLocalAppsRoutes(authenticated, deps);
|
|
25
27
|
registerWorkDiscoveryRoutes(authenticated, deps);
|
|
26
28
|
registerFocusRoutes(authenticated, deps);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readLocalAppAcceptanceConfig } from "../../../local-apps/acceptance.js";
|
|
2
|
-
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
3
2
|
import { LOCAL_APP_RUNTIME_BRIDGE_HASH, injectLocalAppRuntimeBridge } from "../../../local-apps/preview-runtime-bridge.js";
|
|
3
|
+
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
4
4
|
import { relative, resolve } from "node:path";
|
|
5
5
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
6
6
|
//#region src/gateway/hono/routes/local-apps.ts
|