@xopcai/xopc 0.0.110 → 0.0.112
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/README.md +46 -4
- package/README.zh-CN.md +46 -4
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/feishu/src/workflow-progress.js +1 -1
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +1 -1
- package/dist/extensions/telegram/src/routing-integration.js +2 -2
- package/dist/extensions/telegram/src/update-offset-store.js +1 -1
- package/dist/extensions/telegram/src/workflow-progress.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/media/data-url.js +1 -1
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
- package/dist/extensions/weixin/src/plugin.js +1 -1
- package/dist/extensions/weixin/src/storage/sync-buf.js +1 -1
- package/dist/extensions/weixin/src/workflow-progress.js +1 -1
- package/dist/gateway/static/root/apple-touch-icon.png +0 -0
- package/dist/gateway/static/root/assets/Combination-BzaXOLd9.js +41 -0
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-EhRp-ZMa.js +1 -0
- package/dist/gateway/static/root/assets/agent-browser-settings-page-H4foVCiS.js +6 -0
- package/dist/gateway/static/root/assets/agent-defaults-tabbed-page-DDNw2oNU.js +1 -0
- package/dist/gateway/static/root/assets/agents-E_X2kzS1.js +71 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-BIy7KEsM.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-DGQG8NwA.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-BZLvInLr.js +1 -0
- package/dist/gateway/static/root/assets/archive-plugin-uuQPupqx.js +1 -0
- package/dist/gateway/static/root/assets/attachment-load-DBkv0cAv.js +2 -0
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-CybMSIoS.js → attachment-preview-renderer-DonnL2dL.js} +1 -1
- package/dist/gateway/static/root/assets/binary-plugins-DxxN_VAR.js +2 -0
- package/dist/gateway/static/root/assets/block-editor-CwnUlRmO.js +180 -0
- package/dist/gateway/static/root/assets/channels-settings-BHvUKlzw.js +1 -0
- package/dist/gateway/static/root/assets/cn-JdwAhgNB.js +1 -0
- package/dist/gateway/static/root/assets/code-editor-dZTY2dRW.js +1 -0
- package/dist/gateway/static/root/assets/config-api-BD-NcD5d.js +3 -0
- package/dist/gateway/static/root/assets/config-reload-event-Bjh2zoKp.js +1 -0
- package/dist/gateway/static/root/assets/connectors-settings-VBzXcEXL.js +2 -0
- package/dist/gateway/static/root/assets/cron-api-C5DoipZA.js +1 -0
- package/dist/gateway/static/root/assets/cron-dreaming-jobs-nCMWCf0p.js +1 -0
- package/dist/gateway/static/root/assets/cron-page-BLTpdm34.js +3 -0
- package/dist/gateway/static/root/assets/dist-By6Rh2ee.js +1 -0
- package/dist/gateway/static/root/assets/dist-CkobR7mk.js +1 -0
- package/dist/gateway/static/root/assets/dist-DokQNVMQ.js +1 -0
- package/dist/gateway/static/root/assets/dreaming-scene-BHMRVEUS.js +4585 -0
- package/dist/gateway/static/root/assets/dreaming-settings-DSVhXTPq.js +1 -0
- package/dist/gateway/static/root/assets/extension-debug-page-BDHA9o_e.js +1 -0
- package/dist/gateway/static/root/assets/{extension-page-W1wiG38F.js → extension-page-DmDLVSPE.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-1124aHw_.js +1 -0
- package/dist/gateway/static/root/assets/fetch-DOe56Wmy.js +1 -0
- package/dist/gateway/static/root/assets/format-cron-label-BsotZDO5.js +2 -0
- package/dist/gateway/static/root/assets/format-interval-label-tsMSvBSR.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-api-CsD4FC9D.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-HQ8FBhY2.js +1 -0
- package/dist/gateway/static/root/assets/gateway-startup-retry-C1zg7pH3.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-BG3Onph0.js +1 -0
- package/dist/gateway/static/root/assets/goals-page-DgeKn8zL.js +2 -0
- package/dist/gateway/static/root/assets/goals-settings-B5nI6lgz.js +1 -0
- package/dist/gateway/static/root/assets/heartbeat-config-api-CIv42nJD.js +1 -0
- package/dist/gateway/static/root/assets/heartbeat-settings-DFcVuJ3M.js +1 -0
- package/dist/gateway/static/root/assets/html-workspace-editor-CQLWDiwE.js +1 -0
- package/dist/gateway/static/root/assets/index-5A_ZaABy.css +1 -0
- package/dist/gateway/static/root/assets/index-BTmbp2AU.js +121 -0
- package/dist/gateway/static/root/assets/interval-presets-DGP3S7OB.js +1 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-fETaDYQP.js +1 -0
- package/dist/gateway/static/root/assets/locale-store-DjbfSsfA.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-B1-b27lK.js +2 -0
- package/dist/gateway/static/root/assets/markdown-editor-AssmZFx4.js +2 -0
- package/dist/gateway/static/root/assets/markdown-split-CgeBJMOD.js +1 -0
- package/dist/gateway/static/root/assets/media-plugins-C30GzlV2.js +1 -0
- package/dist/gateway/static/root/assets/mermaid-render-BbqDc_LQ.js +134 -0
- package/dist/gateway/static/root/assets/messages-BUUfPaZ9.js +3 -0
- package/dist/gateway/static/root/assets/middleware-Pd0e8Igk.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-panel-DPcTS1-u.js +2 -0
- package/dist/gateway/static/root/assets/note-detail-page-xeGb4owe.js +2 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-t1g0qZYh.js +1 -0
- package/dist/gateway/static/root/assets/note-time-hm6JO_Wi.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-C_TdnKBe.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-DeWp9x5g.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BtkPmJIN.js +1 -0
- package/dist/gateway/static/root/assets/save-bar-controls-BOaAOJI3.js +1 -0
- package/dist/gateway/static/root/assets/schedule-field-BLWLKqgw.js +1 -0
- package/dist/gateway/static/root/assets/schema-form-plqRFYT8.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-DOUjxzJm.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-qK_bnTrw.js +1 -0
- package/dist/gateway/static/root/assets/settings-collapsible-section-BP5zRrDI.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-Bv8MZplG.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-DmDfE1ww.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-BEFwNcIZ.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-4OX1YCgp.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-CbKmJZot.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-YdtnUHtK.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DwW1IzQ0.js +2 -0
- package/dist/gateway/static/root/assets/system-settings-panel-CGy4f_s2.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-CD2wtgZV.js +1 -0
- package/dist/gateway/static/root/assets/use-agent-defaults-form-BMuMvzl_.js +1 -0
- package/dist/gateway/static/root/assets/use-blob-object-url-D4BFuzZB.js +1 -0
- package/dist/gateway/static/root/assets/use-channel-catalog-CjGHnDvN.js +1 -0
- package/dist/gateway/static/root/assets/use-settings-tab-guard-BMMFa0oA.js +1 -0
- package/dist/gateway/static/root/assets/vendor-codemirror-CNP1wPe7.js +45 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-DnRbhMNq.js +1 -0
- package/dist/gateway/static/root/assets/voice-player-store-D5vzWwls.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-page.utils-EYg_xBQS.js → workflow-page.utils-tjGpRVnw.js} +1 -1
- package/dist/gateway/static/root/assets/workflows-page-DqqHKGj2.js +18 -0
- package/dist/gateway/static/root/favicon-16x16.png +0 -0
- package/dist/gateway/static/root/favicon-32x32.png +0 -0
- package/dist/gateway/static/root/favicon.ico +0 -0
- package/dist/gateway/static/root/favicon.svg +14 -12
- package/dist/gateway/static/root/index.html +18 -15
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +28 -2
- package/dist/src/agent/agent-manager.js +82 -11
- package/dist/src/agent/agent-manager.js.map +1 -1
- package/dist/src/agent/agent-scope.js +1 -1
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
- package/dist/src/agent/context/workspace-seed.js +2 -2
- package/dist/src/agent/context/workspace-state.js +1 -1
- package/dist/src/agent/context/workspace.js +1 -1
- package/dist/src/agent/goals/checklist-judge.d.ts +5 -0
- package/dist/src/agent/goals/checklist-judge.js +26 -2
- package/dist/src/agent/goals/checklist-judge.js.map +1 -1
- package/dist/src/agent/goals/evaluate-turn.d.ts +5 -1
- package/dist/src/agent/goals/evaluate-turn.js +29 -3
- package/dist/src/agent/goals/evaluate-turn.js.map +1 -1
- package/dist/src/agent/goals/goal-locale.d.ts +0 -2
- package/dist/src/agent/goals/goal-locale.js +3 -16
- package/dist/src/agent/goals/goal-locale.js.map +1 -1
- package/dist/src/agent/goals/persistent-goal-service.d.ts +9 -0
- package/dist/src/agent/goals/persistent-goal-service.js +3 -2
- package/dist/src/agent/goals/persistent-goal-service.js.map +1 -1
- package/dist/src/agent/goals/post-turn.d.ts +7 -0
- package/dist/src/agent/goals/post-turn.js +70 -25
- package/dist/src/agent/goals/post-turn.js.map +1 -1
- package/dist/src/agent/goals/state.d.ts +0 -5
- package/dist/src/agent/goals/state.js +1 -96
- package/dist/src/agent/goals/state.js.map +1 -1
- package/dist/src/agent/image/load-image-media.js +2 -2
- package/dist/src/agent/ipc/inbox.js +3 -3
- package/dist/src/agent/ipc/socket.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/memory/builtin-memory-store.js +1 -1
- package/dist/src/agent/memory/dreaming/deep-promotion.js +1 -1
- package/dist/src/agent/memory/dreaming/events.js +1 -1
- package/dist/src/agent/memory/dreaming/last-run.js +1 -1
- package/dist/src/agent/memory/dreaming/light-sweep.js +1 -1
- package/dist/src/agent/memory/dreaming/preview.js +1 -1
- package/dist/src/agent/memory/dreaming/rem-patterns.js +1 -1
- package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
- package/dist/src/agent/memory/dreaming/utils.js +1 -1
- package/dist/src/agent/memory/memory-flush.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -1
- package/dist/src/agent/messaging/command-handler.d.ts +7 -0
- package/dist/src/agent/messaging/command-handler.js +11 -2
- package/dist/src/agent/messaging/command-handler.js.map +1 -1
- package/dist/src/agent/models/manager.js +1 -1
- package/dist/src/agent/prompt/memory/index.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/reply/post-compaction-context.js +1 -1
- package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
- package/dist/src/agent/sandbox/path-policy.js +2 -2
- package/dist/src/agent/service/direct-turn-helpers.d.ts +2 -0
- package/dist/src/agent/service/direct-turn-helpers.js +3 -2
- package/dist/src/agent/service/direct-turn-helpers.js.map +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +10 -1
- package/dist/src/agent/service/process-direct-streaming.js.map +1 -1
- package/dist/src/agent/service/reconcile-dreaming-cron.js +8 -5
- package/dist/src/agent/service/reconcile-dreaming-cron.js.map +1 -1
- package/dist/src/agent/service.d.ts +2 -1
- package/dist/src/agent/service.js +30 -6
- package/dist/src/agent/service.js.map +1 -1
- package/dist/src/agent/service.types.d.ts +12 -0
- package/dist/src/agent/session/session-config-service.d.ts +8 -0
- package/dist/src/agent/session/session-config-service.js +20 -0
- package/dist/src/agent/session/session-config-service.js.map +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/config.js +2 -2
- package/dist/src/agent/skills/filesystem-watcher.d.ts +19 -0
- package/dist/src/agent/skills/filesystem-watcher.js +182 -0
- package/dist/src/agent/skills/filesystem-watcher.js.map +1 -0
- package/dist/src/agent/skills/hub-hash.js +2 -2
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +30 -36
- package/dist/src/agent/skills/hub-pull.js.map +1 -1
- package/dist/src/agent/skills/index.js +82 -38
- package/dist/src/agent/skills/index.js.map +1 -1
- package/dist/src/agent/skills/installer.js +2 -2
- package/dist/src/agent/skills/managed-store.d.ts +19 -0
- package/dist/src/agent/skills/managed-store.js +97 -38
- package/dist/src/agent/skills/managed-store.js.map +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.d.ts +16 -6
- package/dist/src/agent/skills/skill-manager.js +79 -24
- package/dist/src/agent/skills/skill-manager.js.map +1 -1
- package/dist/src/agent/skills/skill-view-path.js +1 -1
- package/dist/src/agent/skills/test-framework.js +1 -1
- package/dist/src/agent/skills/types.d.ts +11 -0
- package/dist/src/agent/skills/watcher.js +1 -1
- package/dist/src/agent/starter-agents.js +1 -1
- package/dist/src/agent/tools/cronjob-tool.d.ts +8 -3
- package/dist/src/agent/tools/cronjob-tool.js +82 -24
- package/dist/src/agent/tools/cronjob-tool.js.map +1 -1
- package/dist/src/agent/tools/dreaming-tool.js +1 -1
- package/dist/src/agent/tools/edit.d.ts +2 -0
- package/dist/src/agent/tools/edit.js +10 -0
- package/dist/src/agent/tools/edit.js.map +1 -1
- package/dist/src/agent/tools/factory.js +17 -4
- package/dist/src/agent/tools/factory.js.map +1 -1
- package/dist/src/agent/tools/find.js +1 -1
- package/dist/src/agent/tools/goal-evidence-recorder.d.ts +6 -0
- package/dist/src/agent/tools/goal-evidence-recorder.js +34 -0
- package/dist/src/agent/tools/goal-evidence-recorder.js.map +1 -0
- package/dist/src/agent/tools/goal-tool.d.ts +19 -0
- package/dist/src/agent/tools/goal-tool.js +101 -0
- package/dist/src/agent/tools/goal-tool.js.map +1 -0
- package/dist/src/agent/tools/grep.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/shell.d.ts +2 -0
- package/dist/src/agent/tools/shell.js +17 -2
- package/dist/src/agent/tools/shell.js.map +1 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.d.ts +1 -0
- package/dist/src/agent/tools/workflow-tool.js +11 -3
- package/dist/src/agent/tools/workflow-tool.js.map +1 -1
- package/dist/src/agent/tools/write.d.ts +2 -0
- package/dist/src/agent/tools/write.js +11 -0
- package/dist/src/agent/tools/write.js.map +1 -1
- package/dist/src/agent/workflow/catalog.js +1 -1
- package/dist/src/agent/workspace-runtime/registry.d.ts +5 -0
- package/dist/src/agent/workspace-runtime/registry.js +7 -0
- package/dist/src/agent/workspace-runtime/registry.js.map +1 -1
- package/dist/src/ai-assist/text-assist.d.ts +39 -0
- package/dist/src/ai-assist/text-assist.js +234 -0
- package/dist/src/ai-assist/text-assist.js.map +1 -0
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +2 -2
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/browser/cache-dir-policy.js +1 -1
- package/dist/src/browser/cdp-local-launcher.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +4 -4
- package/dist/src/browser/providers/cloakbrowser.js +5 -5
- package/dist/src/browser/providers/playwright-doctor.js +1 -1
- package/dist/src/browser/stealth.js +1 -1
- package/dist/src/channels/attachments/inbound-persist.d.ts +7 -0
- package/dist/src/channels/attachments/inbound-persist.js +20 -2
- package/dist/src/channels/attachments/inbound-persist.js.map +1 -1
- package/dist/src/channels/outbound/persist-store.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +1 -1
- package/dist/src/channels/pairing/pairing-store.js +2 -2
- package/dist/src/chat-commands/agent-edit.js +2 -2
- package/dist/src/chat-commands/builtins/config.js +3 -3
- package/dist/src/chat-commands/builtins/goal.d.ts +1 -1
- package/dist/src/chat-commands/builtins/goal.js +55 -97
- package/dist/src/chat-commands/builtins/goal.js.map +1 -1
- package/dist/src/chat-commands/builtins/subgoal.d.ts +1 -1
- package/dist/src/chat-commands/builtins/subgoal.js +49 -108
- package/dist/src/chat-commands/builtins/subgoal.js.map +1 -1
- package/dist/src/chat-commands/builtins/system.js +11 -4
- package/dist/src/chat-commands/builtins/system.js.map +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +132 -8
- package/dist/src/chat-commands/builtins/workflow.js.map +1 -1
- package/dist/src/chat-commands/context.d.ts +6 -0
- package/dist/src/chat-commands/context.js +12 -0
- package/dist/src/chat-commands/context.js.map +1 -1
- package/dist/src/chat-commands/types.d.ts +7 -0
- package/dist/src/cli/command-catalog.js +43 -0
- package/dist/src/cli/command-catalog.js.map +1 -1
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-loaders.js.map +1 -1
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/command-manifest.js.map +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/cron.js +55 -16
- package/dist/src/cli/commands/cron.js.map +1 -1
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/cron-health.js +2 -83
- package/dist/src/cli/commands/doctor/checks/cron-health.js.map +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/doctor/checks/state-integrity.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
- package/dist/src/cli/commands/extension-create.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +2 -2
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension-pack.js +2 -2
- package/dist/src/cli/commands/extension.js +3 -3
- package/dist/src/cli/commands/gateway/logs.js +1 -1
- package/dist/src/cli/commands/goal.d.ts +4 -0
- package/dist/src/cli/commands/goal.js +213 -0
- package/dist/src/cli/commands/goal.js.map +1 -0
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +2 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +11 -5
- package/dist/src/cli/commands/onboard.js.map +1 -1
- package/dist/src/cli/commands/skills-test.js +1 -1
- package/dist/src/cli/templates.js +1 -1
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/agent-typed-models.js +1 -1
- package/dist/src/config/gateway-bind.js +1 -1
- package/dist/src/config/index.js +8 -8
- package/dist/src/config/loader.js +4 -4
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/paths-state.js +1 -1
- package/dist/src/config/paths.js +1 -1
- package/dist/src/config/profile.js +1 -1
- package/dist/src/config/reload.js +1 -1
- package/dist/src/config/schema.d.ts +115 -2
- package/dist/src/config/schema.js +63 -7
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/config/web-patch.d.ts +14 -1
- package/dist/src/config/web-patch.js +45 -8
- package/dist/src/config/web-patch.js.map +1 -1
- package/dist/src/config/workspace-path.js +1 -1
- package/dist/src/cron/executor.d.ts +2 -0
- package/dist/src/cron/executor.js +126 -70
- package/dist/src/cron/executor.js.map +1 -1
- package/dist/src/cron/index.d.ts +1 -1
- package/dist/src/cron/index.js +3 -3
- package/dist/src/cron/job-content.js +1 -0
- package/dist/src/cron/job-content.js.map +1 -1
- package/dist/src/cron/run-log-store.d.ts +1 -0
- package/dist/src/cron/run-log-store.js +4 -2
- package/dist/src/cron/run-log-store.js.map +1 -1
- package/dist/src/cron/schedule.d.ts +10 -0
- package/dist/src/cron/schedule.js +85 -0
- package/dist/src/cron/schedule.js.map +1 -0
- package/dist/src/cron/service.d.ts +34 -77
- package/dist/src/cron/service.js +327 -264
- package/dist/src/cron/service.js.map +1 -1
- package/dist/src/cron/types.d.ts +97 -49
- package/dist/src/cron/validation.d.ts +374 -86
- package/dist/src/cron/validation.js +156 -129
- package/dist/src/cron/validation.js.map +1 -1
- package/dist/src/cron/workflow-run-completion.js +1 -1
- package/dist/src/daemon/constants.js +1 -1
- package/dist/src/daemon/install-plan.js +2 -2
- package/dist/src/daemon/launchd.js +2 -2
- package/dist/src/daemon/schtasks.js +2 -2
- package/dist/src/daemon/systemd.js +2 -2
- package/dist/src/extensions/bundle-mcp.js +1 -1
- package/dist/src/extensions/discover-extensions.js +2 -2
- package/dist/src/extensions/health.js +1 -1
- package/dist/src/extensions/install.js +2 -2
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/lockfile.js +3 -3
- package/dist/src/extensions/security.js +1 -1
- package/dist/src/extensions/update.js +2 -2
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/chat-stream/mapper.d.ts +1 -0
- package/dist/src/gateway/chat-stream/mapper.js +6 -2
- package/dist/src/gateway/chat-stream/mapper.js.map +1 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +2 -0
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +14 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/lib/extension-store.js +2 -2
- package/dist/src/gateway/hono/lib/static-ui.js +2 -2
- package/dist/src/gateway/hono/oauth-async.js +1 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/ai-assist.d.ts +3 -0
- package/dist/src/gateway/hono/routes/ai-assist.js +66 -0
- package/dist/src/gateway/hono/routes/ai-assist.js.map +1 -0
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +7 -0
- package/dist/src/gateway/hono/routes/commands-skills.js.map +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/cron.js +24 -5
- package/dist/src/gateway/hono/routes/cron.js.map +1 -1
- package/dist/src/gateway/hono/routes/dreaming.js +1 -1
- package/dist/src/gateway/hono/routes/goals.d.ts +1 -1
- package/dist/src/gateway/hono/routes/goals.js +670 -173
- package/dist/src/gateway/hono/routes/goals.js.map +1 -1
- package/dist/src/gateway/hono/routes/home.d.ts +5 -0
- package/dist/src/gateway/hono/routes/home.js +90 -3
- package/dist/src/gateway/hono/routes/home.js.map +1 -1
- package/dist/src/gateway/hono/routes/host-fs.js +2 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +20 -14
- package/dist/src/gateway/hono/routes/notes.js.map +1 -1
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +8 -4
- package/dist/src/gateway/hono/routes/workflows.js.map +1 -1
- package/dist/src/gateway/hono/routes/workspace.js +2 -2
- package/dist/src/gateway/hono/sse.js.map +1 -1
- package/dist/src/gateway/lock.js +3 -3
- package/dist/src/gateway/ports.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +2 -0
- package/dist/src/gateway/service/agent-runner.js +8 -4
- package/dist/src/gateway/service/agent-runner.js.map +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/marketplace-service.d.ts +22 -10
- package/dist/src/gateway/service/marketplace-service.js +46 -5
- package/dist/src/gateway/service/marketplace-service.js.map +1 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +3 -0
- package/dist/src/gateway/service/run-gateway-agent.js.map +1 -1
- package/dist/src/gateway/service.d.ts +8 -0
- package/dist/src/gateway/service.js +79 -6
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/workspace-fs-file-list.js +1 -1
- package/dist/src/goals/goal-notifications.d.ts +29 -0
- package/dist/src/goals/goal-notifications.js +154 -0
- package/dist/src/goals/goal-notifications.js.map +1 -0
- package/dist/src/goals/goal-queue-store.d.ts +16 -0
- package/dist/src/goals/goal-queue-store.js +131 -0
- package/dist/src/goals/goal-queue-store.js.map +1 -0
- package/dist/src/goals/goal-queue-types.d.ts +31 -0
- package/dist/src/goals/goal-queue-types.js +1 -0
- package/dist/src/goals/goal-runner.d.ts +17 -0
- package/dist/src/goals/goal-runner.js +127 -0
- package/dist/src/goals/goal-runner.js.map +1 -0
- package/dist/src/goals/goal-service.d.ts +77 -0
- package/dist/src/goals/goal-service.js +261 -0
- package/dist/src/goals/goal-service.js.map +1 -0
- package/dist/src/goals/goal-store.d.ts +38 -0
- package/dist/src/goals/goal-store.js +404 -0
- package/dist/src/goals/goal-store.js.map +1 -0
- package/dist/src/goals/goal-workflow-judge.d.ts +13 -0
- package/dist/src/goals/goal-workflow-judge.js +147 -0
- package/dist/src/goals/goal-workflow-judge.js.map +1 -0
- package/dist/src/goals/index.d.ts +10 -0
- package/dist/src/goals/index.js +7 -0
- package/dist/src/goals/types.d.ts +119 -0
- package/dist/src/goals/types.js +1 -0
- package/dist/src/i18n/goals-bundle.js +1 -1
- package/dist/src/i18n/index.js +1 -1
- package/dist/src/i18n/share-tool-bundle.js +2 -2
- package/dist/src/infra/brew.js +1 -1
- package/dist/src/infra/package-json.js +1 -1
- package/dist/src/infra/package-update-steps.js +1 -1
- package/dist/src/infra/path-env.js +2 -2
- package/dist/src/infra/restart.js +1 -1
- package/dist/src/infra/stable-node-path.js +1 -1
- package/dist/src/infra/update-check.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/infra/update-lock.js +2 -2
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/infra/write-file-atomic.js +2 -2
- package/dist/src/media/store.js +1 -1
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/notes/store.js +2 -2
- package/dist/src/project-trust/trust-store.js +2 -2
- package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
- package/dist/src/providers/index.js +1 -1
- package/dist/src/providers/model-registry.js +4 -4
- package/dist/src/session/init-session-turn.js +2 -2
- package/dist/src/session/resolve-session.js +3 -3
- package/dist/src/session/session-title.js +2 -2
- package/dist/src/session/store.js +1 -1
- package/dist/src/share/share-auto.js +2 -2
- package/dist/src/share/share-store.js +3 -3
- package/dist/src/share/share-thumbnail.js +2 -2
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-share-store.js +3 -3
- package/dist/src/share/site-static-serve.js +1 -1
- package/dist/src/storage/sqlite/connection.js +1 -1
- package/dist/src/storage/sqlite/cron-job-repository.d.ts +6 -0
- package/dist/src/storage/sqlite/cron-job-repository.js +70 -0
- package/dist/src/storage/sqlite/cron-job-repository.js.map +1 -0
- package/dist/src/storage/sqlite/cron-run-repository.js +0 -1
- package/dist/src/storage/sqlite/cron-run-repository.js.map +1 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/memory-index-repository.js +2 -2
- package/dist/src/storage/sqlite/migrations/006_add_goals.sql +108 -0
- package/dist/src/storage/sqlite/migrations/007_goal_run_judge_schema.sql +4 -0
- package/dist/src/storage/sqlite/migrations/008_goal_queue_workflow_runs.sql +53 -0
- package/dist/src/storage/sqlite/migrations/009_cron_jobs.sql +24 -0
- package/dist/src/storage/sqlite/migrations/discover.js +1 -1
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +4 -4
- package/dist/src/storage/sqlite/migrations/runner.js.map +1 -1
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +2 -2
- package/dist/src/storage/sqlite/schema.sql +188 -0
- package/dist/src/tui/clipboard-image.js +3 -3
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/theme-manager.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +4 -4
- package/dist/src/tui/tui-commands.js +2 -2
- package/dist/src/tui/tui-keybindings-file.js +1 -1
- package/dist/src/tui/tui-scoped-models.js +2 -2
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +6 -6
- package/dist/src/tunnel/frpc-binary.js +4 -4
- package/dist/src/tunnel/frpc-config.js +1 -1
- package/dist/src/tunnel/frpc-extract.js +1 -1
- package/dist/src/tunnel/tunnel-state.js +1 -1
- package/dist/src/utils/logger/audit.js +1 -1
- package/dist/src/utils/logger/log-store.js +1 -1
- package/dist/src/utils/logger/rotation.js +1 -1
- package/dist/src/utils/logger/stats.d.ts +1 -1
- package/dist/src/utils/logger/streams.js +1 -1
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/voice/tts/providers/edge-speech.js +2 -2
- package/dist/src/workflows/domain/run.d.ts +1 -0
- package/dist/src/workflows/domain/run.js.map +1 -1
- package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
- package/dist/src/workflows/engine/projector.js +23 -14
- package/dist/src/workflows/engine/projector.js.map +1 -1
- package/dist/src/workflows/engine/workflow-engine.d.ts +1 -0
- package/dist/src/workflows/engine/workflow-engine.js +36 -0
- package/dist/src/workflows/engine/workflow-engine.js.map +1 -1
- package/dist/src/workflows/index.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +7 -3
- package/dist/src/workflows/service/workflow-run-service.js.map +1 -1
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +1 -0
- package/dist/src/workflows/service/workflow-session-bridge.js +8 -1
- package/dist/src/workflows/service/workflow-session-bridge.js.map +1 -1
- package/dist/src/workflows/store/event-store.js +1 -1
- package/dist/src/workflows/store/run-index-store.d.ts +8 -0
- package/dist/src/workflows/store/run-index-store.js +58 -0
- package/dist/src/workflows/store/run-index-store.js.map +1 -0
- package/dist/src/workflows/store/run-store.d.ts +2 -0
- package/dist/src/workflows/store/run-store.js +15 -22
- package/dist/src/workflows/store/run-store.js.map +1 -1
- package/package.json +10 -5
- package/dist/gateway/static/root/assets/Combination-HAlzriaz.js +0 -41
- package/dist/gateway/static/root/assets/agents-CFFioJCI.js +0 -78
- package/dist/gateway/static/root/assets/apps-page-BYDmkbzG.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-CsbDaMvd.js +0 -1
- package/dist/gateway/static/root/assets/circle-check-C23XjkUj.js +0 -1
- package/dist/gateway/static/root/assets/copy-Dv6d4Dvw.js +0 -1
- package/dist/gateway/static/root/assets/cron-page-Apk-7p4p.js +0 -1
- package/dist/gateway/static/root/assets/dist-DmGDgpy2.js +0 -1
- package/dist/gateway/static/root/assets/extension-debug-page-pxFC-tUa.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-COXSv6xP.js +0 -1
- package/dist/gateway/static/root/assets/fetch-CFdKBnE6.js +0 -1
- package/dist/gateway/static/root/assets/gateway-startup-retry-DdngdObI.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-config-api-DcmAMYmN.js +0 -1
- package/dist/gateway/static/root/assets/index-C_2yKRJX.js +0 -4845
- package/dist/gateway/static/root/assets/index-DI5_GsZt.css +0 -1
- package/dist/gateway/static/root/assets/logs-page-DvTWUOzd.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-page-CZbdugWZ.js +0 -180
- package/dist/gateway/static/root/assets/note-time-RdyBZxj3.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-mEAwy3e1.js +0 -1
- package/dist/gateway/static/root/assets/schema-form-DEvdni_r.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BsgffzV4.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-t6v8Dwb8.js +0 -2
- package/dist/gateway/static/root/assets/settings-form-section-BoYYZmJG.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-ClIthYF8.js +0 -3
- package/dist/gateway/static/root/assets/share-preview-page-Dd9et7KD.js +0 -2
- package/dist/gateway/static/root/assets/skills-page-DEXtxyfQ.js +0 -2
- package/dist/gateway/static/root/assets/theme-store-BZozwAeK.js +0 -1
- package/dist/gateway/static/root/assets/url-DQRqHuL-.js +0 -3
- package/dist/gateway/static/root/assets/vendor-codemirror-DYoKfS8f.js +0 -45
- package/dist/gateway/static/root/assets/voice-api-key-field-CNrKzQrf.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-EMZkzJNN.js +0 -18
- package/dist/gateway/static/root/favicon-16.png +0 -0
- package/dist/gateway/static/root/favicon-32.png +0 -0
- package/dist/src/agent/goals/checklist-user.d.ts +0 -24
- package/dist/src/agent/goals/checklist-user.js +0 -92
- package/dist/src/agent/goals/checklist-user.js.map +0 -1
- package/dist/src/agent/goals/goal-run-store.d.ts +0 -19
- package/dist/src/agent/goals/goal-run-store.js +0 -138
- package/dist/src/agent/goals/goal-run-store.js.map +0 -1
- package/dist/src/agent/goals/goal-run-types.d.ts +0 -28
- package/dist/src/agent/goals/goal-run-types.js +0 -6
- package/dist/src/agent/goals/goal-run-types.js.map +0 -1
- package/dist/src/agent/goals/patch-from-user-action.d.ts +0 -20
- package/dist/src/agent/goals/patch-from-user-action.js +0 -103
- package/dist/src/agent/goals/patch-from-user-action.js.map +0 -1
- package/dist/src/cron/persistence.d.ts +0 -62
- package/dist/src/cron/persistence.js +0 -188
- package/dist/src/cron/persistence.js.map +0 -1
- /package/dist/gateway/static/root/assets/{note-detail-page-D4ZIVQbk.css → block-editor-D4ZIVQbk.css} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GoalStore } from "./goal-store.js";
|
|
2
|
+
import { GoalService, normalizeGoalUiLocale } from "./goal-service.js";
|
|
3
|
+
import { GoalQueueStore } from "./goal-queue-store.js";
|
|
4
|
+
import { GoalRunner } from "./goal-runner.js";
|
|
5
|
+
import { GoalNotificationService } from "./goal-notifications.js";
|
|
6
|
+
import { GoalWorkflowJudge } from "./goal-workflow-judge.js";
|
|
7
|
+
export { GoalNotificationService, GoalQueueStore, GoalRunner, GoalService, GoalStore, GoalWorkflowJudge, normalizeGoalUiLocale };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export type GoalStatus = 'active' | 'paused' | 'blocked' | 'needs_input' | 'done' | 'archived';
|
|
2
|
+
export type GoalPriority = 'low' | 'normal' | 'high';
|
|
3
|
+
export type GoalSource = 'chat' | 'cli' | 'cron' | 'workflow' | 'channel' | 'api';
|
|
4
|
+
export type GoalUiLocale = 'en' | 'zh';
|
|
5
|
+
export type GoalChecklistStatus = 'pending' | 'completed' | 'impossible';
|
|
6
|
+
export type GoalChecklistAddedBy = 'user' | 'judge';
|
|
7
|
+
export type GoalRunStatus = 'running' | 'succeeded' | 'failed' | 'aborted';
|
|
8
|
+
export type GoalRunVerdict = 'continue' | 'done' | 'blocked' | 'needs_input' | 'decompose';
|
|
9
|
+
export interface Goal {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
status: GoalStatus;
|
|
14
|
+
agentId: string;
|
|
15
|
+
priority: GoalPriority;
|
|
16
|
+
deadlineAt?: number;
|
|
17
|
+
createdAt: number;
|
|
18
|
+
updatedAt: number;
|
|
19
|
+
completedAt?: number;
|
|
20
|
+
archivedAt?: number;
|
|
21
|
+
activeSessionKey?: string;
|
|
22
|
+
currentRunId?: string;
|
|
23
|
+
nextAction?: string;
|
|
24
|
+
blockedReason?: string;
|
|
25
|
+
judgeModelRef?: string;
|
|
26
|
+
maxTurns: number;
|
|
27
|
+
turnsUsed: number;
|
|
28
|
+
uiLocale?: GoalUiLocale;
|
|
29
|
+
source: GoalSource;
|
|
30
|
+
}
|
|
31
|
+
export interface GoalChecklistItem {
|
|
32
|
+
id: string;
|
|
33
|
+
goalId: string;
|
|
34
|
+
text: string;
|
|
35
|
+
status: GoalChecklistStatus;
|
|
36
|
+
addedBy: GoalChecklistAddedBy;
|
|
37
|
+
addedAt: number;
|
|
38
|
+
completedAt?: number;
|
|
39
|
+
evidenceSummary?: string;
|
|
40
|
+
sortOrder: number;
|
|
41
|
+
}
|
|
42
|
+
export interface GoalRun {
|
|
43
|
+
id: string;
|
|
44
|
+
goalId: string;
|
|
45
|
+
sessionKey: string;
|
|
46
|
+
source: GoalSource;
|
|
47
|
+
status: GoalRunStatus;
|
|
48
|
+
startedAt: number;
|
|
49
|
+
finishedAt?: number;
|
|
50
|
+
verdict?: GoalRunVerdict;
|
|
51
|
+
reason?: string;
|
|
52
|
+
nextAction?: string;
|
|
53
|
+
assistantPreview?: string;
|
|
54
|
+
checklistProgress?: {
|
|
55
|
+
done: number;
|
|
56
|
+
total: number;
|
|
57
|
+
};
|
|
58
|
+
confidence?: number;
|
|
59
|
+
missingEvidence?: string[];
|
|
60
|
+
userQuestion?: string;
|
|
61
|
+
completedChecklistItemIds?: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface GoalEvent {
|
|
64
|
+
id: string;
|
|
65
|
+
goalId: string;
|
|
66
|
+
runId?: string;
|
|
67
|
+
kind: string;
|
|
68
|
+
message: string;
|
|
69
|
+
data?: unknown;
|
|
70
|
+
createdAt: number;
|
|
71
|
+
}
|
|
72
|
+
export interface GoalEvidence {
|
|
73
|
+
id: string;
|
|
74
|
+
goalId: string;
|
|
75
|
+
runId?: string;
|
|
76
|
+
kind: 'file' | 'diff' | 'command' | 'test' | 'link' | 'message' | 'artifact';
|
|
77
|
+
title: string;
|
|
78
|
+
summary?: string;
|
|
79
|
+
uri?: string;
|
|
80
|
+
data?: unknown;
|
|
81
|
+
createdAt: number;
|
|
82
|
+
}
|
|
83
|
+
export interface GoalWithDetails extends Goal {
|
|
84
|
+
checklist: GoalChecklistItem[];
|
|
85
|
+
latestRun?: GoalRun;
|
|
86
|
+
}
|
|
87
|
+
export interface GoalListQuery {
|
|
88
|
+
status?: GoalStatus | GoalStatus[];
|
|
89
|
+
agentId?: string;
|
|
90
|
+
sessionKey?: string;
|
|
91
|
+
limit?: number;
|
|
92
|
+
offset?: number;
|
|
93
|
+
}
|
|
94
|
+
export interface CreateGoalInput {
|
|
95
|
+
title: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
agentId: string;
|
|
98
|
+
sessionKey?: string;
|
|
99
|
+
priority?: GoalPriority;
|
|
100
|
+
deadlineAt?: number;
|
|
101
|
+
judgeModelRef?: string;
|
|
102
|
+
maxTurns: number;
|
|
103
|
+
uiLocale?: GoalUiLocale;
|
|
104
|
+
source?: GoalSource;
|
|
105
|
+
}
|
|
106
|
+
export interface GoalJudgeDecision {
|
|
107
|
+
verdict: GoalRunVerdict;
|
|
108
|
+
reason: string;
|
|
109
|
+
nextAction?: string;
|
|
110
|
+
assistantPreview?: string;
|
|
111
|
+
checklistProgress?: {
|
|
112
|
+
done: number;
|
|
113
|
+
total: number;
|
|
114
|
+
};
|
|
115
|
+
confidence?: number;
|
|
116
|
+
missingEvidence?: string[];
|
|
117
|
+
userQuestion?: string;
|
|
118
|
+
completedChecklistItemIds?: string[];
|
|
119
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatI18n } from "./format.js";
|
|
2
|
-
import { serverLocaleOrFallback } from "./locale.js";
|
|
3
2
|
import goals_en_default, { judgeReason } from "./locales/goals.en.js";
|
|
4
3
|
import goals_zh_default from "./locales/goals.zh.js";
|
|
4
|
+
import { serverLocaleOrFallback } from "./locale.js";
|
|
5
5
|
//#region src/i18n/goals-bundle.ts
|
|
6
6
|
/** Canonical English strings for judge parse / API contract (from `goals.en.json`). */
|
|
7
7
|
const JUDGE_REASON_EN = judgeReason;
|
package/dist/src/i18n/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatI18n } from "./format.js";
|
|
2
2
|
import { DEFAULT_SERVER_LOCALE, SERVER_LOCALES, isServerLocale, normalizeServerLocale, serverLocaleOrFallback } from "./locale.js";
|
|
3
|
-
import { resolveToolLocale, shareToolErrorLine, shareToolMessages, shareToolSuccessLines } from "./share-tool-bundle.js";
|
|
4
3
|
import { JUDGE_REASON_EN, goalsChecklistProgressSuffix, goalsContinuationChecklistTemplate, goalsContinuationPlainTemplate, goalsEvaluateCopy, goalsJudgeReason, goalsJudgeResponseLanguageNote, goalsMessages } from "./goals-bundle.js";
|
|
4
|
+
import { resolveToolLocale, shareToolErrorLine, shareToolMessages, shareToolSuccessLines } from "./share-tool-bundle.js";
|
|
5
5
|
export { DEFAULT_SERVER_LOCALE, JUDGE_REASON_EN, SERVER_LOCALES, formatI18n, goalsChecklistProgressSuffix, goalsContinuationChecklistTemplate, goalsContinuationPlainTemplate, goalsEvaluateCopy, goalsJudgeReason, goalsJudgeResponseLanguageNote, goalsMessages, isServerLocale, normalizeServerLocale, resolveToolLocale, serverLocaleOrFallback, shareToolErrorLine, shareToolMessages, shareToolSuccessLines };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import share_tool_en_default from "./locales/share-tool.en.js";
|
|
2
|
-
import share_tool_zh_default from "./locales/share-tool.zh.js";
|
|
3
1
|
import { formatI18n } from "./format.js";
|
|
4
2
|
import { normalizeServerLocale, serverLocaleOrFallback } from "./locale.js";
|
|
3
|
+
import share_tool_en_default from "./locales/share-tool.en.js";
|
|
4
|
+
import share_tool_zh_default from "./locales/share-tool.zh.js";
|
|
5
5
|
//#region src/i18n/share-tool-bundle.ts
|
|
6
6
|
const byLocale = {
|
|
7
7
|
en: share_tool_en_default,
|
package/dist/src/infra/brew.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readPackageVersion } from "./package-json.js";
|
|
2
2
|
import { XOPC_PACKAGE_NAME, collectInstalledGlobalPackageErrors, globalInstallArgs, globalInstallFallbackArgs, resolveExpectedInstalledVersionFromSpec, resolveGlobalInstallTarget, resolveNpmGlobalPrefixLayoutFromGlobalRoot, resolveNpmGlobalPrefixLayoutFromPrefix } from "./update-global.js";
|
|
3
|
-
import path from "node:path";
|
|
4
3
|
import fs from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
5
|
//#region src/infra/package-update-steps.ts
|
|
6
6
|
function formatError(err) {
|
|
7
7
|
return err instanceof Error ? err.message : String(err);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveBrewPathDirs } from "./brew.js";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
2
|
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import os from "node:os";
|
|
5
5
|
//#region src/infra/path-env.ts
|
|
6
6
|
function isTruthyEnvValue(value) {
|
|
7
7
|
if (!value) return false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import path from "node:path";
|
|
5
4
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
6
|
//#region src/infra/restart.ts
|
|
7
7
|
/**
|
|
8
8
|
* Gateway restart coordination — OpenClaw-aligned SIGUSR1 authorization and restart intent.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
|
|
2
2
|
import { channelToNpmTag } from "./update-channels.js";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
3
|
import { access, readFile } from "node:fs/promises";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
//#region src/infra/update-check.ts
|
|
7
7
|
init_package_version();
|
|
@@ -2,9 +2,9 @@ import { resolveExecPathBinPrepend } from "./path-env.js";
|
|
|
2
2
|
import { readPackageVersion } from "./package-json.js";
|
|
3
3
|
import { applyPathPrepend } from "./path-prepend.js";
|
|
4
4
|
import { createDefaultCommandRunner } from "./run-command.js";
|
|
5
|
-
import path from "node:path";
|
|
6
5
|
import fs from "node:fs";
|
|
7
6
|
import fs$1 from "node:fs/promises";
|
|
7
|
+
import path from "node:path";
|
|
8
8
|
//#region src/infra/update-global.ts
|
|
9
9
|
const XOPC_PACKAGE_NAME = "@xopcai/xopc";
|
|
10
10
|
const GLOBAL_RENAME_PREFIX = ".";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
1
2
|
import { init_paths_state, resolveUpdateLockPath } from "../config/paths-state.js";
|
|
2
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
4
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
5
|
-
import { dirname } from "node:path";
|
|
6
5
|
import { mkdir, readFile, unlink } from "node:fs/promises";
|
|
6
|
+
import { dirname } from "node:path";
|
|
7
7
|
//#region src/infra/update-lock.ts
|
|
8
8
|
init_write_file_atomic();
|
|
9
9
|
init_paths_state();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
1
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
3
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
5
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
6
6
|
import { resolveGatewayService } from "../daemon/service.js";
|
|
@@ -8,8 +8,8 @@ import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
|
8
8
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
9
9
|
import { trimLogTail } from "./update-log.js";
|
|
10
10
|
import { maybeRestartGatewayAfterUpdate } from "./update-restart.js";
|
|
11
|
-
import path from "node:path";
|
|
12
11
|
import fs from "node:fs/promises";
|
|
12
|
+
import path from "node:path";
|
|
13
13
|
//#region src/infra/update-runner.ts
|
|
14
14
|
const DEFAULT_TIMEOUT_MS = 2700 * 1e3;
|
|
15
15
|
const MAX_LOG_CHARS = 8e3;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
2
3
|
import { init_paths_state, resolveUpdateCheckStatePath } from "../config/paths-state.js";
|
|
3
4
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
5
|
import { init_logger } from "../utils/logger.js";
|
|
5
|
-
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
6
6
|
import { acquireUpdateLock } from "./update-lock.js";
|
|
7
7
|
import { normalizeUpdateChannel } from "./update-channels.js";
|
|
8
8
|
import { compareSemver, detectInstallKind, resolveNpmChannelTag, resolvePackageRoot } from "./update-check.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { chmodSync, closeSync, copyFileSync, fsyncSync, mkdirSync, openSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
4
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { chmodSync, closeSync, copyFileSync, fsyncSync, mkdirSync, openSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
5
4
|
import { chmod, copyFile, mkdir, open, rename, rm } from "node:fs/promises";
|
|
5
|
+
import path from "node:path";
|
|
6
6
|
//#region src/infra/write-file-atomic.ts
|
|
7
7
|
/**
|
|
8
8
|
* Durable single-file writes: temp file → fsync → rename to target.
|
package/dist/src/media/store.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getMediaBucketDir, getMediaDir, isPathInside } from "./paths.js";
|
|
2
2
|
import { buildMediaUri } from "./uri.js";
|
|
3
|
-
import { extname, join, parse } from "node:path";
|
|
4
3
|
import { randomUUID } from "node:crypto";
|
|
5
4
|
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
5
|
+
import { extname, join, parse } from "node:path";
|
|
6
6
|
//#region src/media/store.ts
|
|
7
7
|
/** Default per-file cap for inbound staging (5 MiB). */
|
|
8
8
|
const MEDIA_MAX_BYTES = 5 * 1024 * 1024;
|
|
@@ -7,8 +7,8 @@ import { isSTTAvailable } from "../voice/stt/availability.js";
|
|
|
7
7
|
import "../voice/stt/index.js";
|
|
8
8
|
import { mergeSttConfigFromAppConfig } from "../channels/attachments/voice-stt-webchat.js";
|
|
9
9
|
import { extractDocumentText } from "../document-understanding/extract.js";
|
|
10
|
-
import { extname } from "node:path";
|
|
11
10
|
import { readFile } from "node:fs/promises";
|
|
11
|
+
import { extname } from "node:path";
|
|
12
12
|
//#region src/notes/agent-context.ts
|
|
13
13
|
const MAX_NOTE_MARKDOWN_CHARS = 4e4;
|
|
14
14
|
const MAX_TEXT_ATTACHMENT_CHARS = 2e4;
|
|
@@ -6,8 +6,8 @@ import { parseNoteMarkdown } from "./note-markdown.js";
|
|
|
6
6
|
import { NotesStore } from "./store.js";
|
|
7
7
|
import { partitionAttachmentsByReference } from "./note-attachment-sync.js";
|
|
8
8
|
import { buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact } from "./agent-context.js";
|
|
9
|
-
import { randomUUID } from "node:crypto";
|
|
10
9
|
import { complete } from "@earendil-works/pi-ai";
|
|
10
|
+
import { randomUUID } from "node:crypto";
|
|
11
11
|
//#region src/notes/service.ts
|
|
12
12
|
init_providers();
|
|
13
13
|
init_logger();
|
package/dist/src/notes/store.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
1
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
3
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
4
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
5
5
|
import { buildNoteIndexMeta } from "./note-index-meta.js";
|
|
6
6
|
import { deleteNoteRecord, getNoteRecord, listNoteRecords, upsertNoteRecord } from "../storage/sqlite/notes-repository.js";
|
|
7
7
|
import { deleteNoteAgentContextRecord } from "../storage/sqlite/note-agent-context-repository.js";
|
|
8
8
|
import "../storage/sqlite/index.js";
|
|
9
9
|
import { resolveNoteHistoryDir, resolveNoteMediaDir } from "./paths.js";
|
|
10
|
-
import { join } from "node:path";
|
|
11
10
|
import { randomUUID } from "node:crypto";
|
|
12
11
|
import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
12
|
+
import { join } from "node:path";
|
|
13
13
|
//#region src/notes/store.ts
|
|
14
14
|
init_write_file_atomic();
|
|
15
15
|
init_logger();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_paths } from "../config/paths.js";
|
|
3
|
-
import { homedir } from "node:os";
|
|
4
|
-
import { dirname, join, resolve } from "node:path";
|
|
5
3
|
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
6
|
import lockfile from "proper-lockfile";
|
|
7
7
|
//#region src/project-trust/trust-store.ts
|
|
8
8
|
init_paths();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
3
|
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
5
|
//#region src/providers/auth-runtime/auth-profile-store.ts
|
|
6
6
|
/**
|
|
7
7
|
* {@link AuthProfileStore} implementations.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
3
2
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
4
3
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
5
4
|
import { CredentialResolver, hasCredentials, init_credentials, resolveApiKey } from "../auth/credentials.js";
|
|
5
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
6
6
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
7
7
|
import { getModel, getModels, getProviders } from "@earendil-works/pi-ai";
|
|
8
8
|
//#region src/providers/index.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { createLogger } from "../utils/logger/index.js";
|
|
3
|
-
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
2
|
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
3
|
+
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
6
4
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
5
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
6
|
+
import { init_logger } from "../utils/logger.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
|
-
import { existsSync, readFileSync } from "fs";
|
|
9
8
|
import { getModels, getProviders } from "@earendil-works/pi-ai";
|
|
9
|
+
import { existsSync, readFileSync } from "fs";
|
|
10
10
|
//#region src/providers/model-registry.ts
|
|
11
11
|
/**
|
|
12
12
|
* Model Registry - manages built-in and custom models from models.json
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SessionConfigSchema, init_schema } from "../config/schema.js";
|
|
2
|
-
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
3
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { SessionConfigSchema, init_schema } from "../config/schema.js";
|
|
4
|
+
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
5
5
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
6
6
|
import "../storage/sqlite/index.js";
|
|
7
7
|
import { evaluateSessionFreshness, resolveSessionResetPolicy } from "./reset-policy.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SessionConfigSchema, init_schema } from "../config/schema.js";
|
|
2
1
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
3
|
-
import { init_agent_session_key, normalizeAgentId, resolveAgentIdFromSessionKey } from "../routing/agent-session-key.js";
|
|
4
|
-
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
5
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
6
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
+
import { SessionConfigSchema, init_schema } from "../config/schema.js";
|
|
5
|
+
import { init_agent_session_key, normalizeAgentId, resolveAgentIdFromSessionKey } from "../routing/agent-session-key.js";
|
|
6
|
+
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
7
7
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
8
8
|
import { findSessionKeyByTranscriptId, getSessionMetadata, getSessionPersistedLevels } from "../storage/sqlite/session-repository.js";
|
|
9
9
|
import "../storage/sqlite/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isCronSessionKey } from "../routing/session-key-utils.js";
|
|
2
|
-
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
3
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { isCronSessionKey } from "../routing/session-key-utils.js";
|
|
4
|
+
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
5
5
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
6
6
|
import { readAgentMessageContent } from "../agent/memory/agent-message-access.js";
|
|
7
7
|
import { stripSessionStartupContextFromUserText } from "../agent/reply/startup-context.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
5
5
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
6
6
|
import "./types.js";
|
|
7
7
|
import { buildSessionContextForLlm, mergeLlmMessagesPreservingContextRows, transcriptRowsFromJsonArray } from "./session-context-for-llm.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveMimeType } from "./share-store.js";
|
|
2
|
-
import { basename, join, resolve } from "node:path";
|
|
3
|
-
import { readdirSync } from "node:fs";
|
|
4
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { readdirSync } from "node:fs";
|
|
5
4
|
import { copyFile, mkdir, rm, stat } from "node:fs/promises";
|
|
5
|
+
import { basename, join, resolve } from "node:path";
|
|
6
6
|
//#region src/share/share-auto.ts
|
|
7
7
|
/**
|
|
8
8
|
* Smart-share decision layer.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
+
import { init_paths } from "../config/paths.js";
|
|
2
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
4
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_paths } from "../config/paths.js";
|
|
5
5
|
import { SHARE_CONFIG_DEFAULTS } from "./share-types.js";
|
|
6
6
|
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
7
7
|
import { logShareAudit } from "./share-audit.js";
|
|
8
|
-
import { join, relative, resolve } from "node:path";
|
|
9
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
10
8
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
9
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
11
10
|
import { lstat, readdir, realpath, stat } from "node:fs/promises";
|
|
11
|
+
import { join, relative, resolve } from "node:path";
|
|
12
12
|
//#region src/share/share-store.ts
|
|
13
13
|
init_paths();
|
|
14
14
|
init_logger();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
+
import { init_paths } from "../config/paths.js";
|
|
2
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
4
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_paths } from "../config/paths.js";
|
|
5
5
|
import { getShareStore } from "./share-store.js";
|
|
6
6
|
import { getSiteShareStore } from "./site-share-store.js";
|
|
7
7
|
import { loadPlaywrightCoreModule } from "../browser/providers/playwright-doctor.js";
|
|
8
|
-
import { join } from "node:path";
|
|
9
8
|
import { mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
9
|
+
import { join } from "node:path";
|
|
10
10
|
//#region src/share/share-thumbnail.ts
|
|
11
11
|
/**
|
|
12
12
|
* Thumbnail generator for shares.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
2
|
-
import { relative, resolve } from "node:path";
|
|
3
2
|
import { createReadStream } from "node:fs";
|
|
4
3
|
import { lstat, readdir, realpath, stat } from "node:fs/promises";
|
|
4
|
+
import { relative, resolve } from "node:path";
|
|
5
5
|
import { Readable, Transform } from "node:stream";
|
|
6
6
|
import { pipeline } from "node:stream/promises";
|
|
7
7
|
import { crc32, createDeflateRaw } from "node:zlib";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
+
import { init_paths } from "../config/paths.js";
|
|
2
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
4
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_paths } from "../config/paths.js";
|
|
5
5
|
import { SITE_SHARE_CONFIG_DEFAULTS } from "./site-share-types.js";
|
|
6
6
|
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
7
|
-
import { join, relative, resolve } from "node:path";
|
|
8
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
9
7
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
8
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
10
9
|
import { lstat, readdir, realpath, stat } from "node:fs/promises";
|
|
10
|
+
import { join, relative, resolve } from "node:path";
|
|
11
11
|
//#region src/share/site-share-store.ts
|
|
12
12
|
init_paths();
|
|
13
13
|
init_logger();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
2
2
|
import { resolveMimeType, shareResponseContentType } from "./share-store.js";
|
|
3
|
-
import { join, relative, resolve } from "node:path";
|
|
4
3
|
import { createReadStream } from "node:fs";
|
|
5
4
|
import { readFile, stat } from "node:fs/promises";
|
|
5
|
+
import { join, relative, resolve } from "node:path";
|
|
6
6
|
import { Readable } from "node:stream";
|
|
7
7
|
//#region src/share/site-static-serve.ts
|
|
8
8
|
const HASHED_ASSET_RE = /\.[a-f0-9]{8,}\.(?:js|mjs|css|woff2?|ttf|otf|svg|png|jpg|jpeg|gif|webp|avif|ico)$/i;
|
|
@@ -4,8 +4,8 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
4
4
|
import { ensureXopcDatabaseSchema } from "./schema.js";
|
|
5
5
|
import { requireNodeSqlite } from "../../infra/node-sqlite.js";
|
|
6
6
|
import { installSqliteTransientRejectionHandler } from "../../infra/unhandled-rejections.js";
|
|
7
|
-
import path from "node:path";
|
|
8
7
|
import fs from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
9
|
import childProcess from "node:child_process";
|
|
10
10
|
//#region src/storage/sqlite/connection.ts
|
|
11
11
|
init_logger();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JobData } from '../../cron/types.js';
|
|
2
|
+
export declare function listCronJobs(): JobData[];
|
|
3
|
+
export declare function getCronJob(jobId: string): JobData | null;
|
|
4
|
+
export declare function saveCronJob(job: JobData): void;
|
|
5
|
+
export declare function saveCronJobs(jobs: JobData[]): void;
|
|
6
|
+
export declare function deleteCronJob(jobId: string): boolean;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
import { JobDataSchema } from "../../cron/validation.js";
|
|
3
|
+
//#region src/storage/sqlite/cron-job-repository.ts
|
|
4
|
+
function parseJson(value) {
|
|
5
|
+
if (!value) return void 0;
|
|
6
|
+
return JSON.parse(value);
|
|
7
|
+
}
|
|
8
|
+
function rowToCronJob(row) {
|
|
9
|
+
return JobDataSchema.parse({
|
|
10
|
+
id: row.job_id,
|
|
11
|
+
name: row.name,
|
|
12
|
+
description: row.description ?? void 0,
|
|
13
|
+
enabled: row.enabled !== 0,
|
|
14
|
+
deleteAfterRun: row.delete_after_run == null ? void 0 : row.delete_after_run !== 0,
|
|
15
|
+
createdAtMs: row.created_at_ms,
|
|
16
|
+
updatedAtMs: row.updated_at_ms,
|
|
17
|
+
schedule: parseJson(row.schedule_json),
|
|
18
|
+
sessionTarget: row.session_target,
|
|
19
|
+
wakeMode: row.wake_mode,
|
|
20
|
+
agentId: row.agent_id ?? void 0,
|
|
21
|
+
sessionKey: row.session_key ?? void 0,
|
|
22
|
+
workingDirectory: row.working_directory ?? void 0,
|
|
23
|
+
payload: parseJson(row.payload_json),
|
|
24
|
+
delivery: parseJson(row.delivery_json),
|
|
25
|
+
failureAlert: parseJson(row.failure_alert_json),
|
|
26
|
+
state: parseJson(row.state_json) ?? {}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function bindJson(value) {
|
|
30
|
+
return value === void 0 ? null : JSON.stringify(value);
|
|
31
|
+
}
|
|
32
|
+
function upsertJob(db, job) {
|
|
33
|
+
db.prepare(`INSERT OR REPLACE INTO cron_jobs (
|
|
34
|
+
job_id, name, description, enabled, delete_after_run, created_at_ms, updated_at_ms,
|
|
35
|
+
schedule_json, session_target, wake_mode, agent_id, session_key, working_directory,
|
|
36
|
+
payload_json, delivery_json, failure_alert_json, state_json
|
|
37
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(job.id, job.name, job.description ?? null, job.enabled ? 1 : 0, job.deleteAfterRun == null ? null : job.deleteAfterRun ? 1 : 0, job.createdAtMs, job.updatedAtMs, JSON.stringify(job.schedule), job.sessionTarget, job.wakeMode, job.agentId ?? null, job.sessionKey ?? null, job.workingDirectory ?? null, JSON.stringify(job.payload), bindJson(job.delivery), bindJson(job.failureAlert), JSON.stringify(job.state ?? {}));
|
|
38
|
+
}
|
|
39
|
+
function listCronJobs() {
|
|
40
|
+
return getSqliteDatabase().prepare(`SELECT job_id, name, description, enabled, delete_after_run, created_at_ms, updated_at_ms,
|
|
41
|
+
schedule_json, session_target, wake_mode, agent_id, session_key, working_directory,
|
|
42
|
+
payload_json, delivery_json, failure_alert_json, state_json
|
|
43
|
+
FROM cron_jobs
|
|
44
|
+
ORDER BY created_at_ms DESC`).all().map(rowToCronJob);
|
|
45
|
+
}
|
|
46
|
+
function getCronJob(jobId) {
|
|
47
|
+
const row = getSqliteDatabase().prepare(`SELECT job_id, name, description, enabled, delete_after_run, created_at_ms, updated_at_ms,
|
|
48
|
+
schedule_json, session_target, wake_mode, agent_id, session_key, working_directory,
|
|
49
|
+
payload_json, delivery_json, failure_alert_json, state_json
|
|
50
|
+
FROM cron_jobs
|
|
51
|
+
WHERE job_id = ?`).get(jobId);
|
|
52
|
+
return row ? rowToCronJob(row) : null;
|
|
53
|
+
}
|
|
54
|
+
function saveCronJob(job) {
|
|
55
|
+
runSqliteWriteTransaction((db) => upsertJob(db, job));
|
|
56
|
+
}
|
|
57
|
+
function saveCronJobs(jobs) {
|
|
58
|
+
runSqliteWriteTransaction((db) => {
|
|
59
|
+
for (const job of jobs) upsertJob(db, job);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function deleteCronJob(jobId) {
|
|
63
|
+
return runSqliteWriteTransaction((db) => {
|
|
64
|
+
return db.prepare(`DELETE FROM cron_jobs WHERE job_id = ?`).run(jobId).changes > 0;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { deleteCronJob, getCronJob, listCronJobs, saveCronJob, saveCronJobs };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=cron-job-repository.js.map
|