@xopcai/xopc 0.0.179 → 0.0.180
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-A5FUMjeV.js → activity-store-DFKtQDgE.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-NghNiDWx.js → agent-avatar-dicebear-CcTvB_4W.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Baq8Shzy.js → agents-DgGj9bu6.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Bmzslx0Z.js → api-CUClAvuL.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DDWS_BBJ.js → app-management-settings-panel-Ib-cWKHM.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C6znvVtX.js → appearance-settings-CRSN8WuA.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-d-Y0Jbe1.js → apps-page-B5xahuT-.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-fvTZhPUr.js → archive-plugin-BBF9zspN.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BFEgvg-Q.js → attachment-load-D3QQfA7w.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BUYrvMmD.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CuI2bOc7.js → binary-plugins-D78XOjJ3.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Z_k8W0al.js → block-editor-D_VVXlYX.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CGApoYPr.js → browser-settings-page-Cjw07q9h.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-gs6b5e9-.js → browser-workflow-inputs-_gu08MA4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Cq5qXStp.js → browser-workflows-page-58DBMXgG.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BC-8n4Hl.js → capabilities-settings-panel-D_dfVxHY.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-BTKhPoDC.js → capability-presets-api-DhCn9rPv.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-D7WQ0oBN.js → capability-presets-settings-panel-LWWIYUT7.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-TwMak0SE.js → channel-recipient-api-DYtoNV5A.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-DysELlO_.js → channels-settings-Cyj5OunL.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-TEFnV0IG.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-DBKotvNr.js → connector-logo-CxIXnifA.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-QH-0WnOo.js → connectors-page-0TobCpBB.js} +2 -2
- package/dist/gateway/static/root/assets/{desktop-pet-Dwml8znf.js → desktop-pet-CwVSLL6N.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CyIg2jJp.js → desktop-pet-settings-BOIp4q0Z.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-B6fc_7SL.js → directory-picker-path-field-C8_lsW6S.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CUQxGnDf.js → dreaming-settings-Da9FeWQl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-AbRNi2ON.js → extension-debug-page-CMNnSJP6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-ClYfiLXC.js → extension-page-t0pJqLvM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BGVP2hw1.js → extension-settings-page-aiR-tKnW.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-B7GqtklK.js → gateway-config-api-CkyQBD6r.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BMeK8igT.js → gateway-settings-BIZfAgfB.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CKKL96r_.js → gateway-startup-retry-CSU7UvzG.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-Dj0ao2qA.js → goals-settings-Dx9uTyWF.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CTI2nPKa.js → heartbeat-settings-Cnr5ORXL.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BY3VQ5Mv.js → image-generation-api-BR6Kb77X.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BDzspHrg.js → index-BA56bQ68.js} +8 -8
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CELtDFz3.js → keyboard-shortcuts-settings-D76uYKeQ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-m8CTSGix.js → local-app-workbench-page-DSUNtLHg.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-CF5uUd1n.js → local-apps-page-BsLnojTh.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DIVc0AQs.js → locale-store-BNC8HUCI.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DmH7Tk4k.js → logs-page-yI8kpQtO.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CN85EdB8.js → markdown-split-D6smTQWD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CxYEc-b8.js → media-plugins-D1TmMF0A.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-DYqBwJAK.js → messages-H_iJjnEM.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-Goab4781.js → notes-page-Vt-diFf0.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-C4jDBVBN.js → notes-workbench-BD297EZt.js} +2 -2
- package/dist/gateway/static/root/assets/{outcome-detail-page-DNRfeLZp.js → outcome-detail-page-C5i_ZR9a.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-tQNQcAts.js → page-tabs-BnSzIjH0.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BSTlgsDB.js → preview-open-alternatives-CF12Eqi4.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-iQ5gTCip.js → product-open-page-Du0TE_CU.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-D7anK-eu.js → project-detail-page-D1HGz7Dy.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BePESKWy.js → projects-page-CqP2TnW-.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CHrzBKIs.js → remote-access-hub-BXdVJLS3.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-BsPf5Gkk.js → save-bar-controls-B53UNtDM.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-kAytH7mq.js → schedule-field-C3dIMN5q.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-Bbw8l2ri.js → schema-form-BKvpxqof.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-He5YAczL.js → sessions-page-CPAwDdl5.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-C-jGsoft.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BqbibcnJ.js → settings-form-section-kt6GIS32.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DNLNCEGT.js → settings-loading-skeleton-85eUPcKz.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BR6Ss0bK.js → settings-page-Di5x6Xrc.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-Cdb1e2Cz.js → settings-page-layout-CkkCee_x.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-moT-D-ia.js → setup-status-panel-uxEE6gAB.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CkrASny2.js → share-preview-page-BtLEstaI.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-X49zY21H.js → shares-settings-2mcsMWgn.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-ocDwsrEt.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-9_jfsFU5.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-BG5dGkyA.js → skills-page.utils-C2SHvq8V.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-XdY8eyYf.js → system-settings-panel-CIJ66cUy.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DtwI_VLT.js → theme-store-ClDa_Bci.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-UghsQu_I.js → time-picker-D0zAsHOo.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-DOnpwsrE.js → typed-models-lib-GsmwmB40.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-BWDtfNvQ.js → use-channel-catalog-BQz3K7xj.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-BtNBEtKj.js → user-context-page-Bn4BLg4W.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DP80jW-W.js → voice-api-key-field-Blaxsbb3.js} +1 -1
- package/dist/gateway/static/root/assets/{work-copy-hQmivDgT.js → work-copy-Cwyan9Sn.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CkDOVZBr.js → work-discovery-page-iJ9RBSpu.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-CqvkcFcR.js → work-item-detail-page-CqTH7PQX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-page-BL8TZW4Z.js → work-page-H3m99ccS.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BLlVqKdA.js → workflow-run-setup-panel-CTG4RpRE.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BgsdRu3_.js → workflows-page-BxZSKMfv.js} +1 -1
- package/dist/gateway/static/root/index.html +6 -6
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +4 -1
- package/dist/src/agent/agent-manager.js +21 -7
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +2 -0
- package/dist/src/agent/embedded/run-for-session.js +3 -1
- package/dist/src/agent/goals/post-turn.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +6 -1
- package/dist/src/agent/inbound/turn-dispatcher.js +5 -2
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/lifecycle/timeout-wrapper.d.ts +2 -0
- package/dist/src/agent/lifecycle/timeout-wrapper.js +39 -9
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +2 -2
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +6 -1
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +1 -1
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +2 -0
- package/dist/src/agent/mcp/mcp-transport-config.js +10 -3
- package/dist/src/agent/mcp/mcp-transport.d.ts +1 -0
- package/dist/src/agent/mcp/mcp-transport.js +5 -2
- package/dist/src/agent/memory/dreaming/config.js +1 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +1 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +6 -2
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -0
- package/dist/src/agent/service/process-direct-one-shot.d.ts +3 -0
- package/dist/src/agent/service/process-direct-one-shot.js +4 -1
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +5 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/config.js +6 -0
- package/dist/src/agent/skills/filesystem-watcher.d.ts +4 -0
- package/dist/src/agent/skills/filesystem-watcher.js +16 -7
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.d.ts +10 -7
- package/dist/src/agent/skills/index.js +56 -47
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.d.ts +5 -2
- package/dist/src/agent/skills/skill-manager.js +10 -5
- package/dist/src/agent/skills/skill-sources.d.ts +18 -0
- package/dist/src/agent/skills/skill-sources.js +143 -0
- package/dist/src/agent/skills/types.d.ts +25 -2
- package/dist/src/agent/tools/delegate-tool.js +2 -1
- package/dist/src/agent/tools/executor.d.ts +2 -0
- package/dist/src/agent/tools/executor.js +18 -11
- 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/managed-job-tool.d.ts +2 -0
- package/dist/src/agent/tools/managed-job-tool.js +160 -0
- package/dist/src/agent/workspace-runtime/registry.d.ts +3 -0
- package/dist/src/agent/workspace-runtime/registry.js +3 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/auth/credentials.d.ts +9 -1
- package/dist/src/auth/credentials.js +112 -56
- package/dist/src/auth/model-credential-store.js +7 -22
- package/dist/src/auth/oauth-provider-lock.d.ts +5 -0
- package/dist/src/auth/oauth-provider-lock.js +91 -0
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/domain/defaults.d.ts +8 -1
- package/dist/src/automations/domain/defaults.js +9 -2
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +33 -7
- package/dist/src/automations/domain/validation.d.ts +8 -0
- package/dist/src/automations/domain/validation.js +2 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.d.ts +2 -2
- package/dist/src/automations/service/action-executor.js +144 -34
- package/dist/src/automations/service/automation-service.d.ts +4 -0
- package/dist/src/automations/service/automation-service.js +197 -18
- package/dist/src/automations/storage/automation-run-repository.d.ts +1 -0
- package/dist/src/automations/storage/automation-run-repository.js +37 -7
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.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/utils/oauth-login.js +1 -7
- package/dist/src/config/agent-profile.js +1 -1
- 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/config/schema.d.ts +3 -0
- package/dist/src/config/schema.js +2 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/oauth-async.js +1 -7
- package/dist/src/gateway/hono/oauth.js +1 -7
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/you.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +3 -3
- package/dist/src/goals/goal-workflow-judge.js +1 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/projects/project-loop.js +3 -3
- package/dist/src/providers/auth-runtime/oauth.js +12 -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/storage/sqlite/migrations/088_automation_execution_deadlines.sql +5 -0
- package/dist/src/storage/sqlite/migrations/089_automation_run_leases.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/tui/backends/embedded-backend.d.ts +2 -0
- package/dist/src/tui/backends/embedded-backend.js +11 -7
- package/dist/src/tui/tui-backend.d.ts +2 -0
- package/dist/src/tui/tui-oauth-login.js +1 -7
- package/dist/src/tui/tui-picker-overlay.js +1 -0
- package/dist/src/tui/tui-picker-services.d.ts +1 -0
- package/dist/src/tui/tui-skills-autocomplete.d.ts +6 -2
- package/dist/src/tui/tui-skills-autocomplete.js +10 -6
- package/dist/src/tui/tui-startup-resources.d.ts +3 -1
- package/dist/src/tui/tui-startup-resources.js +4 -3
- package/dist/src/tui/tui.js +4 -1
- package/dist/src/work/home-query-service.d.ts +31 -2
- package/dist/src/work/home-query-service.js +4 -4
- package/dist/src/work/index.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +3 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/automations-page-CFYOCBlQ.js +0 -6
- package/dist/gateway/static/root/assets/channels-status-swr-BAC-R8IK.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-2eAC9GCP.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CjpnFfOH.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DEwfSOUE.js +0 -2
|
@@ -19,7 +19,17 @@ function rowToRun(row) {
|
|
|
19
19
|
error: row.error ?? void 0,
|
|
20
20
|
sessionKey: row.session_key ?? void 0,
|
|
21
21
|
workflowRunId: row.workflow_run_id ?? void 0,
|
|
22
|
-
model: row.model ?? void 0
|
|
22
|
+
model: row.model ?? void 0,
|
|
23
|
+
deadlineAtMs: row.deadline_at_ms ?? void 0,
|
|
24
|
+
currentPhase: row.current_phase ?? void 0,
|
|
25
|
+
cancelRequestedAtMs: row.cancel_requested_at_ms ?? void 0,
|
|
26
|
+
cancelConfirmedAtMs: row.cancel_confirmed_at_ms ?? void 0,
|
|
27
|
+
termination: row.termination_json ? JSON.parse(row.termination_json) : void 0,
|
|
28
|
+
heartbeatAtMs: row.heartbeat_at_ms ?? void 0,
|
|
29
|
+
leaseOwner: row.lease_owner ?? void 0,
|
|
30
|
+
leaseExpiresAtMs: row.lease_expires_at_ms ?? void 0,
|
|
31
|
+
attemptNumber: row.attempt_number,
|
|
32
|
+
rootRunId: row.root_run_id ?? void 0
|
|
23
33
|
};
|
|
24
34
|
}
|
|
25
35
|
function rowToEvent(row) {
|
|
@@ -55,11 +65,19 @@ function saveAutomationRun(run) {
|
|
|
55
65
|
db.prepare(`INSERT OR REPLACE INTO automation_runs (
|
|
56
66
|
run_id, automation_id, automation_name, status, trigger_snapshot_json,
|
|
57
67
|
action_snapshot_json, manual, created_at_ms, started_at_ms, ended_at_ms,
|
|
58
|
-
duration_ms, summary, error, session_key, workflow_run_id, model
|
|
59
|
-
|
|
68
|
+
duration_ms, summary, error, session_key, workflow_run_id, model,
|
|
69
|
+
deadline_at_ms, current_phase, cancel_requested_at_ms, cancel_confirmed_at_ms,
|
|
70
|
+
termination_json, heartbeat_at_ms, lease_owner, lease_expires_at_ms,
|
|
71
|
+
attempt_number, root_run_id
|
|
72
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(run.id, run.automationId, run.automationName, run.status, JSON.stringify(run.triggerSnapshot), JSON.stringify(run.actionSnapshot), run.manual ? 1 : 0, run.createdAtMs, run.startedAtMs ?? null, run.endedAtMs ?? null, run.durationMs ?? null, run.summary ?? null, run.error ?? null, run.sessionKey ?? null, run.workflowRunId ?? null, run.model ?? null, run.deadlineAtMs ?? null, run.currentPhase ?? null, run.cancelRequestedAtMs ?? null, run.cancelConfirmedAtMs ?? null, run.termination ? JSON.stringify(run.termination) : null, run.heartbeatAtMs ?? null, run.leaseOwner ?? null, run.leaseExpiresAtMs ?? null, run.attemptNumber ?? 1, run.rootRunId ?? run.id);
|
|
60
73
|
trimRuns(db, run.automationId);
|
|
61
74
|
});
|
|
62
75
|
}
|
|
76
|
+
function touchAutomationRunLease(runId, leaseOwner, heartbeatAtMs, leaseExpiresAtMs) {
|
|
77
|
+
getSqliteDatabase().prepare(`UPDATE automation_runs
|
|
78
|
+
SET heartbeat_at_ms = ?, lease_owner = ?, lease_expires_at_ms = ?
|
|
79
|
+
WHERE run_id = ? AND status IN ('queued', 'running', 'cancelling')`).run(heartbeatAtMs, leaseOwner, leaseExpiresAtMs, runId);
|
|
80
|
+
}
|
|
63
81
|
function listAutomationRunEvents(runId) {
|
|
64
82
|
return getSqliteDatabase().prepare(`SELECT event_id, run_id, automation_id, type, message, data_json, created_at_ms
|
|
65
83
|
FROM automation_run_events
|
|
@@ -69,7 +87,10 @@ function listAutomationRunEvents(runId) {
|
|
|
69
87
|
function getAutomationRun(runId) {
|
|
70
88
|
const row = getSqliteDatabase().prepare(`SELECT run_id, automation_id, automation_name, status, trigger_snapshot_json,
|
|
71
89
|
action_snapshot_json, manual, created_at_ms, started_at_ms, ended_at_ms,
|
|
72
|
-
duration_ms, summary, error, session_key, workflow_run_id, model
|
|
90
|
+
duration_ms, summary, error, session_key, workflow_run_id, model,
|
|
91
|
+
deadline_at_ms, current_phase, cancel_requested_at_ms, cancel_confirmed_at_ms,
|
|
92
|
+
termination_json, heartbeat_at_ms, lease_owner, lease_expires_at_ms,
|
|
93
|
+
attempt_number, root_run_id
|
|
73
94
|
FROM automation_runs
|
|
74
95
|
WHERE run_id = ?`).get(runId);
|
|
75
96
|
return row ? rowToRun(row) : null;
|
|
@@ -79,13 +100,19 @@ function listAutomationRuns(options) {
|
|
|
79
100
|
const db = getSqliteDatabase();
|
|
80
101
|
const base = `SELECT run_id, automation_id, automation_name, status, trigger_snapshot_json,
|
|
81
102
|
action_snapshot_json, manual, created_at_ms, started_at_ms, ended_at_ms,
|
|
82
|
-
duration_ms, summary, error, session_key, workflow_run_id, model
|
|
103
|
+
duration_ms, summary, error, session_key, workflow_run_id, model,
|
|
104
|
+
deadline_at_ms, current_phase, cancel_requested_at_ms, cancel_confirmed_at_ms,
|
|
105
|
+
termination_json, heartbeat_at_ms, lease_owner, lease_expires_at_ms,
|
|
106
|
+
attempt_number, root_run_id
|
|
83
107
|
FROM automation_runs`;
|
|
84
108
|
let rows;
|
|
85
109
|
if (options?.automationId) rows = db.prepare(`${base} WHERE automation_id = ? ORDER BY created_at_ms DESC LIMIT ?`).all(options.automationId, limit);
|
|
86
110
|
else if (options?.projectId) rows = db.prepare(`SELECT r.run_id, r.automation_id, r.automation_name, r.status, r.trigger_snapshot_json,
|
|
87
111
|
r.action_snapshot_json, r.manual, r.created_at_ms, r.started_at_ms, r.ended_at_ms,
|
|
88
|
-
r.duration_ms, r.summary, r.error, r.session_key, r.workflow_run_id, r.model
|
|
112
|
+
r.duration_ms, r.summary, r.error, r.session_key, r.workflow_run_id, r.model,
|
|
113
|
+
r.deadline_at_ms, r.current_phase, r.cancel_requested_at_ms, r.cancel_confirmed_at_ms,
|
|
114
|
+
r.termination_json, r.heartbeat_at_ms, r.lease_owner, r.lease_expires_at_ms,
|
|
115
|
+
r.attempt_number, r.root_run_id
|
|
89
116
|
FROM automation_runs r
|
|
90
117
|
JOIN automations a ON a.automation_id = r.automation_id
|
|
91
118
|
WHERE a.project_id = ?
|
|
@@ -109,6 +136,9 @@ function listAutomationRunsForProductEvent(options) {
|
|
|
109
136
|
return getSqliteDatabase().prepare(`SELECT r.run_id, r.automation_id, r.automation_name, r.status, r.trigger_snapshot_json,
|
|
110
137
|
r.action_snapshot_json, r.manual, r.created_at_ms, r.started_at_ms, r.ended_at_ms,
|
|
111
138
|
r.duration_ms, r.summary, r.error, r.session_key, r.workflow_run_id, r.model,
|
|
139
|
+
r.deadline_at_ms, r.current_phase, r.cancel_requested_at_ms, r.cancel_confirmed_at_ms,
|
|
140
|
+
r.termination_json, r.heartbeat_at_ms, r.lease_owner, r.lease_expires_at_ms,
|
|
141
|
+
r.attempt_number, r.root_run_id,
|
|
112
142
|
e.event_id, e.run_id AS event_run_id, e.automation_id AS event_automation_id,
|
|
113
143
|
e.type AS event_type, e.message AS event_message, e.data_json AS event_data_json,
|
|
114
144
|
e.created_at_ms AS event_created_at_ms
|
|
@@ -136,4 +166,4 @@ function deleteAutomationRunsForAutomation(automationId) {
|
|
|
136
166
|
});
|
|
137
167
|
}
|
|
138
168
|
//#endregion
|
|
139
|
-
export { appendAutomationRunEvent, deleteAutomationRunsForAutomation, getAutomationRun, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, saveAutomationRun };
|
|
169
|
+
export { appendAutomationRunEvent, deleteAutomationRunsForAutomation, getAutomationRun, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, saveAutomationRun, touchAutomationRunLease };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { deleteAutomation, getAutomation, listAutomations, saveAutomation, saveAutomations } from "./automation-repository.js";
|
|
2
|
-
import { appendAutomationRunEvent, deleteAutomationRunsForAutomation, getAutomationRun, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, saveAutomationRun } from "./automation-run-repository.js";
|
|
3
|
-
export { appendAutomationRunEvent, deleteAutomation, deleteAutomationRunsForAutomation, getAutomation, getAutomationRun, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listAutomations, saveAutomation, saveAutomationRun, saveAutomations };
|
|
2
|
+
import { appendAutomationRunEvent, deleteAutomationRunsForAutomation, getAutomationRun, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, saveAutomationRun, touchAutomationRunLease } from "./automation-run-repository.js";
|
|
3
|
+
export { appendAutomationRunEvent, deleteAutomation, deleteAutomationRunsForAutomation, getAutomation, getAutomationRun, listAutomationRunEvents, listAutomationRuns, listAutomationRunsForProductEvent, listAutomations, saveAutomation, saveAutomationRun, saveAutomations, touchAutomationRunLease };
|
|
@@ -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 { resolvePackageRoot } from "../../infra/update-check.js";
|
|
8
8
|
import { dirname, join } from "node:path";
|
|
9
9
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -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 v89).`,
|
|
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";
|
|
@@ -74,13 +74,7 @@ async function runCliOAuthLogin(options) {
|
|
|
74
74
|
provider: config.provider,
|
|
75
75
|
onProgress: options.onProgress
|
|
76
76
|
}));
|
|
77
|
-
await new CredentialResolver().
|
|
78
|
-
access: config.provider.getApiKey(credentials),
|
|
79
|
-
refresh: credentials.refresh,
|
|
80
|
-
expiresAt: credentials.expires,
|
|
81
|
-
scope: Array.isArray(credentials.scope) ? credentials.scope.filter((value) => typeof value === "string") : void 0,
|
|
82
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
83
|
-
});
|
|
77
|
+
await new CredentialResolver().saveOAuthCredentials(options.provider, credentials);
|
|
84
78
|
return {
|
|
85
79
|
provider: options.provider,
|
|
86
80
|
credentials,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
2
1
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
2
|
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
|
@@ -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, 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
|
-
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, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
10
9
|
import { FILENAMES, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, 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, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, 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, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, 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
|
|
@@ -1471,6 +1471,7 @@ export declare const McpServerSchema: z.ZodObject<{
|
|
|
1471
1471
|
}, z.core.$strip>;
|
|
1472
1472
|
}, z.core.$strip>]>>>;
|
|
1473
1473
|
connectionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1474
|
+
requestTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1474
1475
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
1475
1476
|
export declare const McpConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
1476
1477
|
servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -1496,6 +1497,7 @@ export declare const McpConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
|
1496
1497
|
}, z.core.$strip>;
|
|
1497
1498
|
}, z.core.$strip>]>>>;
|
|
1498
1499
|
connectionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1500
|
+
requestTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1499
1501
|
}, z.core.$catchall<z.ZodUnknown>>>>;
|
|
1500
1502
|
sessionIdleTtlMs: z.ZodOptional<z.ZodNumber>;
|
|
1501
1503
|
}, z.core.$strict>>;
|
|
@@ -2302,6 +2304,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
2302
2304
|
}, z.core.$strip>;
|
|
2303
2305
|
}, z.core.$strip>]>>>;
|
|
2304
2306
|
connectionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
2307
|
+
requestTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
2305
2308
|
}, z.core.$catchall<z.ZodUnknown>>>>;
|
|
2306
2309
|
sessionIdleTtlMs: z.ZodOptional<z.ZodNumber>;
|
|
2307
2310
|
}, z.core.$strict>>;
|
|
@@ -967,7 +967,8 @@ defaultAgent: z.string().min(1).optional() }).strict().default({});
|
|
|
967
967
|
url: McpHttpUrlSchema.optional(),
|
|
968
968
|
transport: z.enum(["sse", "streamable-http"]).optional(),
|
|
969
969
|
headers: z.record(z.string(), McpConfigScalarSchema).optional(),
|
|
970
|
-
connectionTimeoutMs: z.number().finite().positive().optional()
|
|
970
|
+
connectionTimeoutMs: z.number().finite().positive().optional(),
|
|
971
|
+
requestTimeoutMs: z.number().finite().positive().optional()
|
|
971
972
|
}).catchall(z.unknown()).superRefine((value, ctx) => {
|
|
972
973
|
const hasCommand = typeof value.command === "string" && value.command.trim().length > 0;
|
|
973
974
|
const hasUrl = typeof value.url === "string" && value.url.trim().length > 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
4
3
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
|
+
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync } from "fs";
|
|
7
7
|
import { mkdir, readFile } from "fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
1
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
|
-
import {
|
|
2
|
+
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
4
3
|
import { WORKSPACE_FILES, init_paths, resolveUserProfilePath } from "../config/paths.js";
|
|
4
|
+
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
5
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
6
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { seedAgentProfileMarkdownFiles } from "../agent/context/workspace-seed.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
4
3
|
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
5
5
|
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
@@ -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";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ContextCompactionPolicySchema, init_config } from "../../../user-context/config.js";
|
|
2
2
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
3
3
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
4
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
5
4
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
6
5
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
6
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
7
7
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
8
8
|
import { getAllProviders, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
9
9
|
import { resolveShareConfig } from "../../../share/share-config.js";
|
|
@@ -275,13 +275,7 @@ async function runOAuthFlow(session, oauthProvider, _service) {
|
|
|
275
275
|
try {
|
|
276
276
|
const credentials = await oauthProvider.login(callbacks);
|
|
277
277
|
setOAuthCredentialsToCache(session.provider, credentials);
|
|
278
|
-
await new CredentialResolver().
|
|
279
|
-
access: oauthProvider.getApiKey(credentials),
|
|
280
|
-
refresh: credentials.refresh,
|
|
281
|
-
expiresAt: credentials.expires,
|
|
282
|
-
scope: Array.isArray(credentials.scope) ? credentials.scope.filter((value) => typeof value === "string") : void 0,
|
|
283
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
284
|
-
});
|
|
278
|
+
await new CredentialResolver().saveOAuthCredentials(session.provider, credentials);
|
|
285
279
|
session.status = "completed";
|
|
286
280
|
session.credentials = credentials;
|
|
287
281
|
session.message = "OAuth login successful";
|
|
@@ -74,13 +74,7 @@ function createOAuthHandler(_service) {
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
setOAuthCredentialsToCache(provider, credentials);
|
|
77
|
-
await new CredentialResolver().
|
|
78
|
-
access: oauthProvider.getApiKey(credentials),
|
|
79
|
-
refresh: credentials.refresh,
|
|
80
|
-
expiresAt: credentials.expires,
|
|
81
|
-
scope: Array.isArray(credentials.scope) ? credentials.scope.filter((value) => typeof value === "string") : void 0,
|
|
82
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
83
|
-
});
|
|
77
|
+
await new CredentialResolver().saveOAuthCredentials(provider, credentials);
|
|
84
78
|
return c.json({
|
|
85
79
|
ok: true,
|
|
86
80
|
payload: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
1
|
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
2
|
+
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
3
3
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
4
4
|
import { getModelCatalogStore, init_model_catalog_store } from "../../../providers/model-catalog-store.js";
|
|
5
5
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
@@ -882,7 +882,7 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
882
882
|
ok: true,
|
|
883
883
|
status: queued ? "queued" : "saved",
|
|
884
884
|
goal: goals.get(goal.id),
|
|
885
|
-
href: `/
|
|
885
|
+
href: `/work/${encodeURIComponent(goal.outcomeId)}`
|
|
886
886
|
});
|
|
887
887
|
});
|
|
888
888
|
authenticated.patch("/api/you/controls", deps.strictRateLimitMiddleware, async (c) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
3
|
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
4
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
6
|
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
7
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
@@ -8,14 +8,14 @@ import { closeXopcDatabase, openXopcDatabase } from "../storage/sqlite/connectio
|
|
|
8
8
|
import "../storage/sqlite/index.js";
|
|
9
9
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
10
10
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
11
|
-
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
12
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
13
11
|
import { init_paths, resolveAgentDir, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
12
|
+
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
14
13
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
15
14
|
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
16
15
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
17
16
|
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
18
|
-
import {
|
|
17
|
+
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
18
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
19
19
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
20
20
|
import { onAutomationProductEvent, publishAutomationProductEvent } from "../automations/product-events.js";
|
|
21
21
|
import { GoalRunner } from "../goals/goal-runner.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 { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
4
|
+
import { resolveGoalUiLocale } from "../agent/goals/goal-locale.js";
|
|
4
5
|
import { GoalService } from "./goal-service.js";
|
|
5
6
|
import { renderWorkflowText } from "../agent/workflow/snapshot.js";
|
|
6
|
-
import { resolveGoalUiLocale } from "../agent/goals/goal-locale.js";
|
|
7
7
|
import { evaluateAfterTurnHermesLike } from "../agent/goals/evaluate-turn.js";
|
|
8
8
|
import { runViewToSnapshot } from "../workflows/service/run-view-to-snapshot.js";
|
|
9
9
|
//#region src/goals/goal-workflow-judge.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
3
2
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
4
3
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
|
@@ -4,8 +4,8 @@ import { buildNoteAttachmentRef } from "./attachment-ref.js";
|
|
|
4
4
|
import { parseNoteMarkdown } from "./note-markdown.js";
|
|
5
5
|
import { changedFieldsFromPatch, emitActivity, previewText, systemActivityActor, systemActivitySource } from "../activity/emitter.js";
|
|
6
6
|
import { getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
7
|
-
import { publishAutomationProductEvent } from "../automations/product-events.js";
|
|
8
7
|
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
8
|
+
import { publishAutomationProductEvent } from "../automations/product-events.js";
|
|
9
9
|
import { NotesStore } from "./store.js";
|
|
10
10
|
import { partitionAttachmentsByReference } from "./note-attachment-sync.js";
|
|
11
11
|
import { buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact } from "./agent-context.js";
|
|
@@ -36,7 +36,7 @@ function buildProjectLoopOverview(input) {
|
|
|
36
36
|
title: goal.title,
|
|
37
37
|
detail: compactText(goal.blockedReason || goal.nextAction || goal.description),
|
|
38
38
|
status: goal.status,
|
|
39
|
-
href: `/
|
|
39
|
+
href: `/work/${encodeURIComponent(goal.outcomeId)}`,
|
|
40
40
|
updatedAt: goal.updatedAt
|
|
41
41
|
})),
|
|
42
42
|
...staleGoals.map((goal) => ({
|
|
@@ -45,7 +45,7 @@ function buildProjectLoopOverview(input) {
|
|
|
45
45
|
title: goal.title,
|
|
46
46
|
detail: compactText(goal.nextAction || goal.description || "Goal has not changed recently."),
|
|
47
47
|
status: goal.status,
|
|
48
|
-
href: `/
|
|
48
|
+
href: `/work/${encodeURIComponent(goal.outcomeId)}`,
|
|
49
49
|
updatedAt: goal.updatedAt
|
|
50
50
|
})),
|
|
51
51
|
...failedWorkflowRuns.map((run) => ({
|
|
@@ -74,7 +74,7 @@ function buildProjectLoopOverview(input) {
|
|
|
74
74
|
detail: compactText(goal.nextAction || goal.blockedReason || goal.description),
|
|
75
75
|
timestamp: goal.updatedAt,
|
|
76
76
|
status: goal.status,
|
|
77
|
-
href: `/
|
|
77
|
+
href: `/work/${encodeURIComponent(goal.outcomeId)}`
|
|
78
78
|
})),
|
|
79
79
|
...input.recentWorkflowRuns.map((run) => ({
|
|
80
80
|
id: `workflow:${run.runId}`,
|
|
@@ -3,6 +3,7 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
//#region src/providers/auth-runtime/oauth.ts
|
|
4
4
|
init_logger();
|
|
5
5
|
const log = createLogger("AuthOAuthRefresh");
|
|
6
|
+
const pendingProfileRefreshes = /* @__PURE__ */ new Map();
|
|
6
7
|
/** Number of ms before {@link AuthProfile.expiresAt} we treat the token as stale. */
|
|
7
8
|
const REFRESH_SKEW_MS = 6e4;
|
|
8
9
|
function isOAuthAccessTokenExpired(profile, nowMs) {
|
|
@@ -23,6 +24,17 @@ async function refreshOAuthProfile(profile, options = {}) {
|
|
|
23
24
|
if (profile.mode !== "oauth") throw new Error(`refreshOAuthProfile: profile mode is "${profile.mode}", expected "oauth"`);
|
|
24
25
|
if (!profile.oauthRefreshToken) throw new Error("refreshOAuthProfile: profile is missing oauthRefreshToken");
|
|
25
26
|
if (!profile.oauthTokenEndpoint) throw new Error("refreshOAuthProfile: profile is missing oauthTokenEndpoint");
|
|
27
|
+
const refreshKey = `${profile.provider}\0${profile.profileId}\0${profile.oauthRefreshToken}`;
|
|
28
|
+
const existing = pendingProfileRefreshes.get(refreshKey);
|
|
29
|
+
if (existing) return existing;
|
|
30
|
+
let pending;
|
|
31
|
+
pending = refreshOAuthProfileOnce(profile, options).finally(() => {
|
|
32
|
+
if (pendingProfileRefreshes.get(refreshKey) === pending) pendingProfileRefreshes.delete(refreshKey);
|
|
33
|
+
});
|
|
34
|
+
pendingProfileRefreshes.set(refreshKey, pending);
|
|
35
|
+
return pending;
|
|
36
|
+
}
|
|
37
|
+
async function refreshOAuthProfileOnce(profile, options) {
|
|
26
38
|
const body = new URLSearchParams();
|
|
27
39
|
body.set("grant_type", "refresh_token");
|
|
28
40
|
body.set("refresh_token", profile.oauthRefreshToken);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
1
|
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
|
+
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
-
import { getOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
5
3
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
6
4
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
7
5
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
+
import { getOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
8
7
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
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 { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
4
|
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
|
+
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
2
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
|
+
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ALTER TABLE automation_runs ADD COLUMN deadline_at_ms INTEGER;
|
|
2
|
+
ALTER TABLE automation_runs ADD COLUMN current_phase TEXT;
|
|
3
|
+
ALTER TABLE automation_runs ADD COLUMN cancel_requested_at_ms INTEGER;
|
|
4
|
+
ALTER TABLE automation_runs ADD COLUMN cancel_confirmed_at_ms INTEGER;
|
|
5
|
+
ALTER TABLE automation_runs ADD COLUMN termination_json TEXT;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
ALTER TABLE automation_runs ADD COLUMN heartbeat_at_ms INTEGER;
|
|
2
|
+
ALTER TABLE automation_runs ADD COLUMN lease_owner TEXT;
|
|
3
|
+
ALTER TABLE automation_runs ADD COLUMN lease_expires_at_ms INTEGER;
|
|
4
|
+
ALTER TABLE automation_runs ADD COLUMN attempt_number INTEGER NOT NULL DEFAULT 1;
|
|
5
|
+
ALTER TABLE automation_runs ADD COLUMN root_run_id TEXT;
|
|
6
|
+
|
|
7
|
+
CREATE INDEX IF NOT EXISTS idx_automation_runs_lease
|
|
8
|
+
ON automation_runs(status, lease_expires_at_ms);
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 89;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -12,7 +12,7 @@ const log = createLogger("Sqlite:Migrations");
|
|
|
12
12
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
13
13
|
const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
14
14
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
15
|
-
const XOPC_DB_SCHEMA_VERSION =
|
|
15
|
+
const XOPC_DB_SCHEMA_VERSION = 89;
|
|
16
16
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
17
17
|
function resolveMigrationsDir(override) {
|
|
18
18
|
if (override) return override;
|
|
@@ -46,7 +46,7 @@ function applySingleMigration(db, migration) {
|
|
|
46
46
|
* Each step runs in its own transaction and updates schema_meta on success.
|
|
47
47
|
*/
|
|
48
48
|
function applyPendingMigrations(db, options = {}) {
|
|
49
|
-
const targetVersion = options.targetVersion ??
|
|
49
|
+
const targetVersion = options.targetVersion ?? 89;
|
|
50
50
|
let currentVersion = readSchemaVersion(db);
|
|
51
51
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
52
52
|
if (currentVersion >= targetVersion) return currentVersion;
|
|
@@ -62,7 +62,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
62
62
|
}
|
|
63
63
|
/** Inspect schema version without mutating the database. */
|
|
64
64
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
65
|
-
const appVersion = options.targetVersion ??
|
|
65
|
+
const appVersion = options.targetVersion ?? 89;
|
|
66
66
|
const dbVersion = readSchemaVersion(db);
|
|
67
67
|
if (dbVersion > appVersion) return {
|
|
68
68
|
dbVersion,
|
|
@@ -19,7 +19,7 @@ const log = createLogger('Sqlite:Migrations');
|
|
|
19
19
|
export const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
20
20
|
|
|
21
21
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
22
|
-
export const XOPC_DB_SCHEMA_VERSION =
|
|
22
|
+
export const XOPC_DB_SCHEMA_VERSION = 89;
|
|
23
23
|
|
|
24
24
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ function ensureXopcDatabaseSchema(db) {
|
|
|
31
31
|
bootstrapFreshDatabase(db);
|
|
32
32
|
currentVersion = 11;
|
|
33
33
|
}
|
|
34
|
-
applyPendingMigrations(db, { targetVersion:
|
|
34
|
+
applyPendingMigrations(db, { targetVersion: 89 });
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, ensureSchemaMetaTable, ensureXopcDatabaseSchema, readSchemaVersion, readSchemaVersionForTest, setSchemaVersion };
|
|
@@ -43,7 +43,9 @@ export declare class EmbeddedBackend implements TuiBackend {
|
|
|
43
43
|
getActiveSignal(): AbortSignal | undefined;
|
|
44
44
|
private getWorkflowRunService;
|
|
45
45
|
private activeConfig;
|
|
46
|
+
private isWorkspaceTrusted;
|
|
46
47
|
getStartupResources(sessionKey: string): Promise<import("../tui-backend.js").TuiStartupResources>;
|
|
48
|
+
refreshWorkspaceTrust(): void;
|
|
47
49
|
startWorkflowRun(opts: TuiWorkflowRunStartRequest): Promise<TuiWorkflowRunStartResult>;
|
|
48
50
|
resolveStartupProject(opts: {
|
|
49
51
|
workspacePath: string;
|