@otium-team/negotium 0.0.0-stage → 0.23.13
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/LICENSE +202 -0
- package/README.md +329 -2
- package/bin/codex-sdk-window-hide.mjs +40 -0
- package/bin/negotium.mjs +22 -0
- package/dist/agent-helpers.js +23090 -0
- package/dist/agent-helpers.js.map +171 -0
- package/dist/background-bash.js +535 -0
- package/dist/background-bash.js.map +16 -0
- package/dist/browser-runtime.js +2334 -0
- package/dist/browser-runtime.js.map +35 -0
- package/dist/canonical-mcp-bridge.js +13 -0
- package/dist/canonical-mcp-bridge.js.map +9 -0
- package/dist/chunk-22kg3fsw.js +79 -0
- package/dist/chunk-22kg3fsw.js.map +9 -0
- package/dist/chunk-d4j77adx.js +336 -0
- package/dist/chunk-d4j77adx.js.map +13 -0
- package/dist/chunk-mk9x18jn.js +172 -0
- package/dist/chunk-mk9x18jn.js.map +12 -0
- package/dist/chunk-qd0vtfm2.js +3923 -0
- package/dist/chunk-qd0vtfm2.js.map +47 -0
- package/dist/chunk-wf7ny8eq.js +206 -0
- package/dist/chunk-wf7ny8eq.js.map +10 -0
- package/dist/chunk-ww8a4ej4.js +54 -0
- package/dist/chunk-ww8a4ej4.js.map +10 -0
- package/dist/cron.js +1 -0
- package/dist/hosted-agent.js +5982 -0
- package/dist/hosted-agent.js.map +62 -0
- package/dist/main.js +60229 -0
- package/dist/main.js.map +340 -0
- package/dist/mcp-catalog.js +39 -0
- package/dist/mcp-catalog.js.map +10 -0
- package/dist/mcp-factories.js +25767 -0
- package/dist/mcp-factories.js.map +181 -0
- package/dist/mcp-servers.js +50 -0
- package/dist/mcp-servers.js.map +10 -0
- package/dist/media.js +570 -0
- package/dist/media.js.map +15 -0
- package/dist/outbox.js +354 -0
- package/dist/outbox.js.map +15 -0
- package/dist/platform-runtime.js +73 -0
- package/dist/platform-runtime.js.map +12 -0
- package/dist/prompts.js +892 -0
- package/dist/prompts.js.map +15 -0
- package/dist/query-runtime.js +1071 -0
- package/dist/query-runtime.js.map +26 -0
- package/dist/registry.js +335 -0
- package/dist/registry.js.map +14 -0
- package/dist/rollout.js +57 -0
- package/dist/rollout.js.map +10 -0
- package/dist/runtime/cron/background-sessions.ts +119 -0
- package/dist/runtime/cron/context.ts +123 -0
- package/dist/runtime/cron/host.ts +67 -0
- package/dist/runtime/cron/index.ts +95 -0
- package/dist/runtime/cron/mcp-server.ts +556 -0
- package/dist/runtime/cron/module.ts +174 -0
- package/dist/runtime/cron/package.json +6 -0
- package/dist/runtime/cron/schedule.ts +211 -0
- package/dist/runtime/cron/scheduler.ts +444 -0
- package/dist/runtime/cron/scripts.ts +203 -0
- package/dist/runtime/cron/store.ts +1163 -0
- package/dist/runtime/cron/summarize.ts +115 -0
- package/dist/runtime/package.json +6 -0
- package/dist/runtime/scripts/faster-whisper-wrapper.py +87 -0
- package/dist/runtime/src/agents/api-topic-agent-switch.ts +179 -0
- package/dist/runtime/src/agents/archiver.ts +677 -0
- package/dist/runtime/src/agents/auth-check.ts +156 -0
- package/dist/runtime/src/agents/claude-notices.ts +130 -0
- package/dist/runtime/src/agents/claude-provider.ts +941 -0
- package/dist/runtime/src/agents/claude-registry.ts +117 -0
- package/dist/runtime/src/agents/claude-runtime-inspection.ts +43 -0
- package/dist/runtime/src/agents/codex-app-server.ts +138 -0
- package/dist/runtime/src/agents/codex-native-multi-agent.ts +360 -0
- package/dist/runtime/src/agents/codex-provider.ts +1193 -0
- package/dist/runtime/src/agents/codex-registry.ts +116 -0
- package/dist/runtime/src/agents/codex-tier-resolver.ts +74 -0
- package/dist/runtime/src/agents/codex-tree-kill.ts +54 -0
- package/dist/runtime/src/agents/codex-tree-manager.ts +230 -0
- package/dist/runtime/src/agents/codex-vault-hook-bridge.ts +240 -0
- package/dist/runtime/src/agents/codex-vault-hook.mjs +50 -0
- package/dist/runtime/src/agents/codex-windows-wrapper.ts +174 -0
- package/dist/runtime/src/agents/compaction-support.ts +75 -0
- package/dist/runtime/src/agents/compaction-tool-projection.ts +125 -0
- package/dist/runtime/src/agents/contracts.ts +75 -0
- package/dist/runtime/src/agents/deep-map.ts +13 -0
- package/dist/runtime/src/agents/execution-host.ts +118 -0
- package/dist/runtime/src/agents/explicit-agent-switch.ts +106 -0
- package/dist/runtime/src/agents/fixtures/claude-attachments.jsonl +2 -0
- package/dist/runtime/src/agents/fixtures/codex-shell.jsonl +5 -0
- package/dist/runtime/src/agents/fork.ts +100 -0
- package/dist/runtime/src/agents/hosted-agent.ts +78 -0
- package/dist/runtime/src/agents/idle-archiver.ts +225 -0
- package/dist/runtime/src/agents/idle-compact.ts +225 -0
- package/dist/runtime/src/agents/index.ts +225 -0
- package/dist/runtime/src/agents/maestro-provider.ts +246 -0
- package/dist/runtime/src/agents/maestro-registry.ts +189 -0
- package/dist/runtime/src/agents/mcp-tools/ask-user.ts +653 -0
- package/dist/runtime/src/agents/mcp-tools/common.ts +23 -0
- package/dist/runtime/src/agents/mcp-tools/inline-assets.ts +203 -0
- package/dist/runtime/src/agents/mcp-tools/publish-html.ts +183 -0
- package/dist/runtime/src/agents/mcp-tools/request-vault.ts +684 -0
- package/dist/runtime/src/agents/mcp-tools/self-config.ts +353 -0
- package/dist/runtime/src/agents/mcp-tools/spawn-subagent.ts +1349 -0
- package/dist/runtime/src/agents/mcp-tools/visual-compat.ts +18 -0
- package/dist/runtime/src/agents/mcp-tools/visuals.ts +60 -0
- package/dist/runtime/src/agents/memory-archive-policy.ts +54 -0
- package/dist/runtime/src/agents/model-catalog.ts +439 -0
- package/dist/runtime/src/agents/public-helpers.ts +149 -0
- package/dist/runtime/src/agents/registry.ts +35 -0
- package/dist/runtime/src/agents/rollout/claude.ts +336 -0
- package/dist/runtime/src/agents/rollout/codex.ts +910 -0
- package/dist/runtime/src/agents/rollout/index.ts +26 -0
- package/dist/runtime/src/agents/rollout/shared.ts +293 -0
- package/dist/runtime/src/agents/self-config-core.ts +704 -0
- package/dist/runtime/src/agents/task-events.ts +59 -0
- package/dist/runtime/src/agents/tool-format.ts +613 -0
- package/dist/runtime/src/agents/topic-agent-switch.ts +189 -0
- package/dist/runtime/src/agents/topic-cleanup.ts +285 -0
- package/dist/runtime/src/agents/vault-tool-policy.ts +36 -0
- package/dist/runtime/src/application/execute-external-user-turn.ts +23 -0
- package/dist/runtime/src/application/submit-runtime-gateway-turn.ts +484 -0
- package/dist/runtime/src/application/submit-user-message.ts +60 -0
- package/dist/runtime/src/application/switch-topic-effort.ts +48 -0
- package/dist/runtime/src/application/switch-topic-model.ts +79 -0
- package/dist/runtime/src/application/topic-service.ts +190 -0
- package/dist/runtime/src/application/turn-follow-ups.ts +291 -0
- package/dist/runtime/src/application/vault-command.ts +170 -0
- package/dist/runtime/src/bus.ts +409 -0
- package/dist/runtime/src/config-public.ts +2 -0
- package/dist/runtime/src/cron-host.ts +33 -0
- package/dist/runtime/src/cron-mcp-host.ts +5 -0
- package/dist/runtime/src/identifiers.ts +49 -0
- package/dist/runtime/src/index.ts +573 -0
- package/dist/runtime/src/mcp/agent-health-server.ts +8 -0
- package/dist/runtime/src/mcp/canonical-bridge-config.ts +84 -0
- package/dist/runtime/src/mcp/canonical-proxy-server.ts +308 -0
- package/dist/runtime/src/mcp/compaction-log-server.ts +25 -0
- package/dist/runtime/src/mcp/decision-server.ts +21 -0
- package/dist/runtime/src/mcp/dm-ipc.ts +60 -0
- package/dist/runtime/src/mcp/factories/agent-health.ts +394 -0
- package/dist/runtime/src/mcp/factories/compaction-log.ts +135 -0
- package/dist/runtime/src/mcp/factories/decision.ts +186 -0
- package/dist/runtime/src/mcp/factories/index.ts +73 -0
- package/dist/runtime/src/mcp/factories/session-comm.ts +184 -0
- package/dist/runtime/src/mcp/factories/session-history.ts +103 -0
- package/dist/runtime/src/mcp/factories/stdio-protection.ts +24 -0
- package/dist/runtime/src/mcp/factories/system-health.ts +259 -0
- package/dist/runtime/src/mcp/factories/task.ts +185 -0
- package/dist/runtime/src/mcp/factories/token-stats.ts +145 -0
- package/dist/runtime/src/mcp/factories/vault.ts +32 -0
- package/dist/runtime/src/mcp/mcp-helpers.ts +40 -0
- package/dist/runtime/src/mcp/peer-bridge.ts +119 -0
- package/dist/runtime/src/mcp/runtime-spec.ts +473 -0
- package/dist/runtime/src/mcp/session-comm/actor-policy.ts +160 -0
- package/dist/runtime/src/mcp/session-comm/bridge-ipc-config.ts +27 -0
- package/dist/runtime/src/mcp/session-comm/context.ts +113 -0
- package/dist/runtime/src/mcp/session-comm/default-host.ts +723 -0
- package/dist/runtime/src/mcp/session-comm/history-target.ts +89 -0
- package/dist/runtime/src/mcp/session-comm/history-tools.ts +113 -0
- package/dist/runtime/src/mcp/session-comm/hub-remote-session.ts +553 -0
- package/dist/runtime/src/mcp/session-comm/limits.ts +8 -0
- package/dist/runtime/src/mcp/session-comm/peer-forward.ts +251 -0
- package/dist/runtime/src/mcp/session-comm/runtime.ts +128 -0
- package/dist/runtime/src/mcp/session-comm/server.ts +1036 -0
- package/dist/runtime/src/mcp/session-comm/tell-permissions.ts +79 -0
- package/dist/runtime/src/mcp/session-comm/topic-catalog.ts +155 -0
- package/dist/runtime/src/mcp/session-comm/topic-config.ts +137 -0
- package/dist/runtime/src/mcp/session-comm/topics.ts +313 -0
- package/dist/runtime/src/mcp/session-history-limits.ts +36 -0
- package/dist/runtime/src/mcp/session-history-reader.ts +359 -0
- package/dist/runtime/src/mcp/session-history-server.ts +19 -0
- package/dist/runtime/src/mcp/stdio-protect.ts +7 -0
- package/dist/runtime/src/mcp/system-health-server.ts +5 -0
- package/dist/runtime/src/mcp/task-server.ts +17 -0
- package/dist/runtime/src/mcp/token-stats-server.ts +10 -0
- package/dist/runtime/src/mcp/vault-server.ts +12 -0
- package/dist/runtime/src/mcp/wiki-search-index.ts +359 -0
- package/dist/runtime/src/mcp/wiki-server.ts +2386 -0
- package/dist/runtime/src/mcp-runtime-host.ts +81 -0
- package/dist/runtime/src/media/file-events.ts +33 -0
- package/dist/runtime/src/media/text-extractor.ts +334 -0
- package/dist/runtime/src/media/video.ts +92 -0
- package/dist/runtime/src/node-host.ts +211 -0
- package/dist/runtime/src/outbox/coalescing-runner.ts +157 -0
- package/dist/runtime/src/outbox/file-ops.ts +267 -0
- package/dist/runtime/src/outbox/index.ts +26 -0
- package/dist/runtime/src/outbox/utils.ts +74 -0
- package/dist/runtime/src/platform/background-bash/context.ts +9 -0
- package/dist/runtime/src/platform/background-bash/manager.ts +292 -0
- package/dist/runtime/src/platform/background-bash/output-buffer.ts +323 -0
- package/dist/runtime/src/platform/config-helpers.ts +47 -0
- package/dist/runtime/src/platform/config.ts +618 -0
- package/dist/runtime/src/platform/constants.ts +30 -0
- package/dist/runtime/src/platform/debug-users.ts +14 -0
- package/dist/runtime/src/platform/delay.ts +1 -0
- package/dist/runtime/src/platform/error.ts +9 -0
- package/dist/runtime/src/platform/file-utils.ts +35 -0
- package/dist/runtime/src/platform/ipc.ts +55 -0
- package/dist/runtime/src/platform/jsonl.ts +277 -0
- package/dist/runtime/src/platform/lifecycle.ts +176 -0
- package/dist/runtime/src/platform/log-rotation.ts +45 -0
- package/dist/runtime/src/platform/logger.ts +42 -0
- package/dist/runtime/src/platform/maestro-bootstrap-env.ts +3 -0
- package/dist/runtime/src/platform/mcp-catalog-policy.ts +63 -0
- package/dist/runtime/src/platform/mcp-config.ts +1329 -0
- package/dist/runtime/src/platform/memoize-import.ts +26 -0
- package/dist/runtime/src/platform/modules.ts +145 -0
- package/dist/runtime/src/platform/node-plugins.ts +46 -0
- package/dist/runtime/src/platform/paths.ts +62 -0
- package/dist/runtime/src/platform/playwright/browser-processes.ts +300 -0
- package/dist/runtime/src/platform/playwright/capability.ts +5 -0
- package/dist/runtime/src/platform/playwright/headed-launch.ts +61 -0
- package/dist/runtime/src/platform/playwright/manager-utils.ts +128 -0
- package/dist/runtime/src/platform/playwright/manager.ts +1502 -0
- package/dist/runtime/src/platform/playwright/mcp-transport.ts +35 -0
- package/dist/runtime/src/platform/playwright/profile-management.ts +33 -0
- package/dist/runtime/src/platform/playwright/public-runtime.ts +52 -0
- package/dist/runtime/src/platform/playwright/transport-probe.ts +89 -0
- package/dist/runtime/src/platform/playwright/vault-broker.ts +261 -0
- package/dist/runtime/src/platform/public-runtime.ts +18 -0
- package/dist/runtime/src/prompts/agents/wiki-archiver.md +194 -0
- package/dist/runtime/src/prompts/builders.ts +696 -0
- package/dist/runtime/src/prompts/sessions/_shared-tools.md +38 -0
- package/dist/runtime/src/prompts/sessions/channel-system.md +13 -0
- package/dist/runtime/src/prompts/sessions/manager-system.md +34 -0
- package/dist/runtime/src/prompts/sessions/surfaces/cli.md +6 -0
- package/dist/runtime/src/prompts/sessions/surfaces/otium-manager.md +18 -0
- package/dist/runtime/src/prompts/sessions/surfaces/otium.md +6 -0
- package/dist/runtime/src/prompts/sessions/surfaces/telegram.md +5 -0
- package/dist/runtime/src/prompts/sessions/surfaces/terminal.md +6 -0
- package/dist/runtime/src/prompts/sessions/topic-system.md +9 -0
- package/dist/runtime/src/prompts/sessions/visual-design.md +38 -0
- package/dist/runtime/src/query/active-rooms.ts +514 -0
- package/dist/runtime/src/query/index.ts +23 -0
- package/dist/runtime/src/query/public-runtime.ts +28 -0
- package/dist/runtime/src/query/room-query-registry.ts +217 -0
- package/dist/runtime/src/query/session-inbox-cleanup.ts +45 -0
- package/dist/runtime/src/query/session-inbox-path.ts +42 -0
- package/dist/runtime/src/query/state.ts +116 -0
- package/dist/runtime/src/query/types.ts +8 -0
- package/dist/runtime/src/runtime/actor-topic-reach.ts +123 -0
- package/dist/runtime/src/runtime/actor-topic-scope.ts +255 -0
- package/dist/runtime/src/runtime/ask-callbacks.ts +217 -0
- package/dist/runtime/src/runtime/attachments.ts +149 -0
- package/dist/runtime/src/runtime/background-session-policy.ts +1 -0
- package/dist/runtime/src/runtime/background-sessions.ts +288 -0
- package/dist/runtime/src/runtime/bashrs-completions.ts +350 -0
- package/dist/runtime/src/runtime/channel-context.ts +115 -0
- package/dist/runtime/src/runtime/context-warning.ts +131 -0
- package/dist/runtime/src/runtime/cron-sessions.ts +35 -0
- package/dist/runtime/src/runtime/delivery-ack.ts +112 -0
- package/dist/runtime/src/runtime/errors.ts +70 -0
- package/dist/runtime/src/runtime/event-heartbeat.ts +77 -0
- package/dist/runtime/src/runtime/file-hooks.ts +81 -0
- package/dist/runtime/src/runtime/footer.ts +23 -0
- package/dist/runtime/src/runtime/gateway-capabilities.ts +22 -0
- package/dist/runtime/src/runtime/inbox.ts +1307 -0
- package/dist/runtime/src/runtime/playwright-turn-abort.ts +59 -0
- package/dist/runtime/src/runtime/public-helpers.ts +78 -0
- package/dist/runtime/src/runtime/remote-session-grant.ts +221 -0
- package/dist/runtime/src/runtime/remote-session-inbox.ts +943 -0
- package/dist/runtime/src/runtime/remote-session-reply-outbox.ts +168 -0
- package/dist/runtime/src/runtime/task-format.ts +18 -0
- package/dist/runtime/src/runtime/tasks.ts +53 -0
- package/dist/runtime/src/runtime/thread-context.ts +123 -0
- package/dist/runtime/src/runtime/thread-read.ts +67 -0
- package/dist/runtime/src/runtime/topic-config.ts +29 -0
- package/dist/runtime/src/runtime/turn-event-stream.ts +1051 -0
- package/dist/runtime/src/runtime/turn-runner.ts +2311 -0
- package/dist/runtime/src/runtime/turn-session.ts +116 -0
- package/dist/runtime/src/runtime/usage-alert.ts +51 -0
- package/dist/runtime/src/runtime/user-turn-envelope.ts +94 -0
- package/dist/runtime/src/runtime/visual-html.ts +175 -0
- package/dist/runtime/src/runtime/visual-store.ts +480 -0
- package/dist/runtime/src/runtime/visuals.ts +209 -0
- package/dist/runtime/src/runtime-gateway.ts +1045 -0
- package/dist/runtime/src/security/sanitize.ts +27 -0
- package/dist/runtime/src/security/sensitive-path.ts +41 -0
- package/dist/runtime/src/storage/activity-log.ts +167 -0
- package/dist/runtime/src/storage/api-messages.ts +766 -0
- package/dist/runtime/src/storage/api-topic-brief.ts +134 -0
- package/dist/runtime/src/storage/api-topic-config.ts +197 -0
- package/dist/runtime/src/storage/api-topics.ts +1647 -0
- package/dist/runtime/src/storage/app-settings.ts +50 -0
- package/dist/runtime/src/storage/ask-user-gates.ts +359 -0
- package/dist/runtime/src/storage/browser-profiles.ts +186 -0
- package/dist/runtime/src/storage/conversation-migration.ts +180 -0
- package/dist/runtime/src/storage/conversations.ts +377 -0
- package/dist/runtime/src/storage/decisions.ts +231 -0
- package/dist/runtime/src/storage/forum/agent-settings.ts +20 -0
- package/dist/runtime/src/storage/forum/index.ts +4 -0
- package/dist/runtime/src/storage/forum/repository.ts +283 -0
- package/dist/runtime/src/storage/forum/schema.ts +314 -0
- package/dist/runtime/src/storage/forum-db.ts +4 -0
- package/dist/runtime/src/storage/remote-session.ts +1028 -0
- package/dist/runtime/src/storage/runtime-events.ts +209 -0
- package/dist/runtime/src/storage/runtime-follow-ups.ts +212 -0
- package/dist/runtime/src/storage/runtime-gateway-submissions.ts +132 -0
- package/dist/runtime/src/storage/runtime-leases.ts +190 -0
- package/dist/runtime/src/storage/runtime-process-leases.ts +288 -0
- package/dist/runtime/src/storage/runtime-topic-state.ts +181 -0
- package/dist/runtime/src/storage/runtime-turn-requests.ts +846 -0
- package/dist/runtime/src/storage/self-schedules.ts +306 -0
- package/dist/runtime/src/storage/session-asks.ts +468 -0
- package/dist/runtime/src/storage/session-inbox-signal.ts +76 -0
- package/dist/runtime/src/storage/session-inbox.ts +161 -0
- package/dist/runtime/src/storage/sqlite.ts +154 -0
- package/dist/runtime/src/storage/storage-contract.ts +54 -0
- package/dist/runtime/src/storage/storage-host.ts +336 -0
- package/dist/runtime/src/storage/storage-public-host.ts +16 -0
- package/dist/runtime/src/storage/storage-public.ts +66 -0
- package/dist/runtime/src/storage/tasks.ts +172 -0
- package/dist/runtime/src/storage/token-stats.ts +432 -0
- package/dist/runtime/src/storage/topic-archive-state.ts +226 -0
- package/dist/runtime/src/storage/topic-archive.ts +169 -0
- package/dist/runtime/src/storage/topic-host-mcp-grants.ts +54 -0
- package/dist/runtime/src/storage/topic-link-records.ts +1085 -0
- package/dist/runtime/src/storage/topic-settings.ts +67 -0
- package/dist/runtime/src/storage/topic-tool-capabilities.ts +89 -0
- package/dist/runtime/src/storage/topic-transcript.ts +98 -0
- package/dist/runtime/src/storage/vault-crypto-core.ts +65 -0
- package/dist/runtime/src/storage/vault-crypto.ts +31 -0
- package/dist/runtime/src/storage/vault-public.ts +27 -0
- package/dist/runtime/src/storage/vault-request-gates.ts +359 -0
- package/dist/runtime/src/storage/vault.ts +388 -0
- package/dist/runtime/src/storage/wiki-summary-names.ts +52 -0
- package/dist/runtime/src/storage/wiki.ts +90 -0
- package/dist/runtime/src/topics/claim-abort.ts +190 -0
- package/dist/runtime/src/topics/create.ts +192 -0
- package/dist/runtime/src/topics/derive.ts +600 -0
- package/dist/runtime/src/topics/lifecycle.ts +425 -0
- package/dist/runtime/src/topics/links.ts +7 -0
- package/dist/runtime/src/topics/personal-general.ts +91 -0
- package/dist/runtime/src/topics/session.ts +1041 -0
- package/dist/runtime/src/topics/update.ts +287 -0
- package/dist/runtime/src/types/api.ts +591 -0
- package/dist/runtime/src/types.ts +418 -0
- package/dist/runtime/src/version.ts +1 -0
- package/dist/runtime/tsconfig.json +13 -0
- package/dist/runtime-gateway.js +514 -0
- package/dist/runtime-gateway.js.map +10 -0
- package/dist/runtime-helpers.js +1792 -0
- package/dist/runtime-helpers.js.map +40 -0
- package/dist/sqlite.js +66 -0
- package/dist/sqlite.js.map +10 -0
- package/dist/storage.js +5223 -0
- package/dist/storage.js.map +47 -0
- package/dist/types/apps/negotium/src/mcp-servers.d.ts +20 -0
- package/dist/types/packages/core/src/agents/api-topic-agent-switch.d.ts +38 -0
- package/dist/types/packages/core/src/agents/archiver.d.ts +87 -0
- package/dist/types/packages/core/src/agents/auth-check.d.ts +19 -0
- package/dist/types/packages/core/src/agents/claude-notices.d.ts +15 -0
- package/dist/types/packages/core/src/agents/claude-provider.d.ts +25 -0
- package/dist/types/packages/core/src/agents/claude-registry.d.ts +3 -0
- package/dist/types/packages/core/src/agents/claude-runtime-inspection.d.ts +9 -0
- package/dist/types/packages/core/src/agents/codex-app-server.d.ts +13 -0
- package/dist/types/packages/core/src/agents/codex-native-multi-agent.d.ts +20 -0
- package/dist/types/packages/core/src/agents/codex-provider.d.ts +64 -0
- package/dist/types/packages/core/src/agents/codex-registry.d.ts +3 -0
- package/dist/types/packages/core/src/agents/codex-tier-resolver.d.ts +10 -0
- package/dist/types/packages/core/src/agents/codex-tree-kill.d.ts +13 -0
- package/dist/types/packages/core/src/agents/codex-tree-manager.d.ts +28 -0
- package/dist/types/packages/core/src/agents/codex-vault-hook-bridge.d.ts +28 -0
- package/dist/types/packages/core/src/agents/codex-windows-wrapper.d.ts +30 -0
- package/dist/types/packages/core/src/agents/compaction-support.d.ts +5 -0
- package/dist/types/packages/core/src/agents/compaction-tool-projection.d.ts +9 -0
- package/dist/types/packages/core/src/agents/contracts.d.ts +68 -0
- package/dist/types/packages/core/src/agents/deep-map.d.ts +2 -0
- package/dist/types/packages/core/src/agents/execution-host.d.ts +33 -0
- package/dist/types/packages/core/src/agents/explicit-agent-switch.d.ts +26 -0
- package/dist/types/packages/core/src/agents/fork.d.ts +50 -0
- package/dist/types/packages/core/src/agents/hosted-agent.d.ts +15 -0
- package/dist/types/packages/core/src/agents/idle-archiver.d.ts +35 -0
- package/dist/types/packages/core/src/agents/idle-compact.d.ts +37 -0
- package/dist/types/packages/core/src/agents/index.d.ts +8 -0
- package/dist/types/packages/core/src/agents/maestro-provider.d.ts +75 -0
- package/dist/types/packages/core/src/agents/maestro-registry.d.ts +3 -0
- package/dist/types/packages/core/src/agents/mcp-tools/ask-user.d.ts +147 -0
- package/dist/types/packages/core/src/agents/mcp-tools/common.d.ts +14 -0
- package/dist/types/packages/core/src/agents/mcp-tools/inline-assets.d.ts +24 -0
- package/dist/types/packages/core/src/agents/mcp-tools/publish-html.d.ts +18 -0
- package/dist/types/packages/core/src/agents/mcp-tools/request-vault.d.ts +124 -0
- package/dist/types/packages/core/src/agents/mcp-tools/self-config.d.ts +45 -0
- package/dist/types/packages/core/src/agents/mcp-tools/spawn-subagent.d.ts +148 -0
- package/dist/types/packages/core/src/agents/mcp-tools/visual-compat.d.ts +55 -0
- package/dist/types/packages/core/src/agents/mcp-tools/visuals.d.ts +70 -0
- package/dist/types/packages/core/src/agents/memory-archive-policy.d.ts +24 -0
- package/dist/types/packages/core/src/agents/model-catalog.d.ts +132 -0
- package/dist/types/packages/core/src/agents/public-helpers.d.ts +17 -0
- package/dist/types/packages/core/src/agents/registry.d.ts +5 -0
- package/dist/types/packages/core/src/agents/rollout/claude.d.ts +77 -0
- package/dist/types/packages/core/src/agents/rollout/codex.d.ts +119 -0
- package/dist/types/packages/core/src/agents/rollout/index.d.ts +6 -0
- package/dist/types/packages/core/src/agents/rollout/shared.d.ts +56 -0
- package/dist/types/packages/core/src/agents/self-config-core.d.ts +199 -0
- package/dist/types/packages/core/src/agents/task-events.d.ts +19 -0
- package/dist/types/packages/core/src/agents/tool-format.d.ts +25 -0
- package/dist/types/packages/core/src/agents/topic-cleanup.d.ts +83 -0
- package/dist/types/packages/core/src/agents/vault-tool-policy.d.ts +2 -0
- package/dist/types/packages/core/src/bus.d.ts +141 -0
- package/dist/types/packages/core/src/identifiers.d.ts +27 -0
- package/dist/types/packages/core/src/mcp/canonical-bridge-config.d.ts +21 -0
- package/dist/types/packages/core/src/mcp/factories/agent-health.d.ts +5 -0
- package/dist/types/packages/core/src/mcp/factories/compaction-log.d.ts +8 -0
- package/dist/types/packages/core/src/mcp/factories/decision.d.ts +18 -0
- package/dist/types/packages/core/src/mcp/factories/index.d.ts +13 -0
- package/dist/types/packages/core/src/mcp/factories/session-comm.d.ts +38 -0
- package/dist/types/packages/core/src/mcp/factories/session-history.d.ts +11 -0
- package/dist/types/packages/core/src/mcp/factories/stdio-protection.d.ts +10 -0
- package/dist/types/packages/core/src/mcp/factories/system-health.d.ts +37 -0
- package/dist/types/packages/core/src/mcp/factories/task.d.ts +13 -0
- package/dist/types/packages/core/src/mcp/factories/token-stats.d.ts +20 -0
- package/dist/types/packages/core/src/mcp/factories/vault.d.ts +9 -0
- package/dist/types/packages/core/src/mcp/mcp-helpers.d.ts +26 -0
- package/dist/types/packages/core/src/mcp/peer-bridge.d.ts +92 -0
- package/dist/types/packages/core/src/mcp/runtime-spec.d.ts +147 -0
- package/dist/types/packages/core/src/mcp/session-comm/actor-policy.d.ts +120 -0
- package/dist/types/packages/core/src/mcp/session-comm/bridge-ipc-config.d.ts +6 -0
- package/dist/types/packages/core/src/mcp/session-comm/context.d.ts +44 -0
- package/dist/types/packages/core/src/mcp/session-comm/history-tools.d.ts +31 -0
- package/dist/types/packages/core/src/mcp/session-comm/hub-remote-session.d.ts +149 -0
- package/dist/types/packages/core/src/mcp/session-comm/limits.d.ts +8 -0
- package/dist/types/packages/core/src/mcp/session-comm/peer-forward.d.ts +85 -0
- package/dist/types/packages/core/src/mcp/session-comm/tell-permissions.d.ts +29 -0
- package/dist/types/packages/core/src/mcp/session-comm/topic-catalog.d.ts +59 -0
- package/dist/types/packages/core/src/mcp/session-history-limits.d.ts +20 -0
- package/dist/types/packages/core/src/mcp/session-history-reader.d.ts +35 -0
- package/dist/types/packages/core/src/mcp/wiki-search-index.d.ts +59 -0
- package/dist/types/packages/core/src/mcp/wiki-server.d.ts +53 -0
- package/dist/types/packages/core/src/media/file-events.d.ts +14 -0
- package/dist/types/packages/core/src/media/text-extractor.d.ts +34 -0
- package/dist/types/packages/core/src/outbox/coalescing-runner.d.ts +68 -0
- package/dist/types/packages/core/src/outbox/file-ops.d.ts +79 -0
- package/dist/types/packages/core/src/outbox/index.d.ts +3 -0
- package/dist/types/packages/core/src/outbox/utils.d.ts +16 -0
- package/dist/types/packages/core/src/platform/background-bash/context.d.ts +1 -0
- package/dist/types/packages/core/src/platform/background-bash/manager.d.ts +34 -0
- package/dist/types/packages/core/src/platform/config-helpers.d.ts +20 -0
- package/dist/types/packages/core/src/platform/config.d.ts +178 -0
- package/dist/types/packages/core/src/platform/constants.d.ts +20 -0
- package/dist/types/packages/core/src/platform/delay.d.ts +1 -0
- package/dist/types/packages/core/src/platform/error.d.ts +6 -0
- package/dist/types/packages/core/src/platform/file-utils.d.ts +16 -0
- package/dist/types/packages/core/src/platform/ipc.d.ts +32 -0
- package/dist/types/packages/core/src/platform/jsonl.d.ts +46 -0
- package/dist/types/packages/core/src/platform/lifecycle.d.ts +40 -0
- package/dist/types/packages/core/src/platform/logger.d.ts +20 -0
- package/dist/types/packages/core/src/platform/maestro-bootstrap-env.d.ts +0 -0
- package/dist/types/packages/core/src/platform/mcp-catalog-policy.d.ts +73 -0
- package/dist/types/packages/core/src/platform/mcp-config.d.ts +286 -0
- package/dist/types/packages/core/src/platform/memoize-import.d.ts +15 -0
- package/dist/types/packages/core/src/platform/paths.d.ts +18 -0
- package/dist/types/packages/core/src/platform/playwright/browser-processes.d.ts +60 -0
- package/dist/types/packages/core/src/platform/playwright/capability.d.ts +1 -0
- package/dist/types/packages/core/src/platform/playwright/headed-launch.d.ts +13 -0
- package/dist/types/packages/core/src/platform/playwright/manager-utils.d.ts +34 -0
- package/dist/types/packages/core/src/platform/playwright/manager.d.ts +194 -0
- package/dist/types/packages/core/src/platform/playwright/mcp-transport.d.ts +4 -0
- package/dist/types/packages/core/src/platform/playwright/profile-management.d.ts +8 -0
- package/dist/types/packages/core/src/platform/playwright/public-runtime.d.ts +6 -0
- package/dist/types/packages/core/src/platform/playwright/transport-probe.d.ts +13 -0
- package/dist/types/packages/core/src/platform/playwright/vault-broker.d.ts +6 -0
- package/dist/types/packages/core/src/platform/public-runtime.d.ts +3 -0
- package/dist/types/packages/core/src/prompts/builders.d.ts +78 -0
- package/dist/types/packages/core/src/query/active-rooms.d.ts +240 -0
- package/dist/types/packages/core/src/query/public-runtime.d.ts +4 -0
- package/dist/types/packages/core/src/query/room-query-registry.d.ts +71 -0
- package/dist/types/packages/core/src/query/session-inbox-cleanup.d.ts +5 -0
- package/dist/types/packages/core/src/query/session-inbox-path.d.ts +8 -0
- package/dist/types/packages/core/src/query/state.d.ts +25 -0
- package/dist/types/packages/core/src/query/types.d.ts +6 -0
- package/dist/types/packages/core/src/runtime/actor-topic-reach.d.ts +63 -0
- package/dist/types/packages/core/src/runtime/actor-topic-scope.d.ts +127 -0
- package/dist/types/packages/core/src/runtime/ask-callbacks.d.ts +53 -0
- package/dist/types/packages/core/src/runtime/attachments.d.ts +36 -0
- package/dist/types/packages/core/src/runtime/background-session-policy.d.ts +1 -0
- package/dist/types/packages/core/src/runtime/background-sessions.d.ts +27 -0
- package/dist/types/packages/core/src/runtime/bashrs-completions.d.ts +50 -0
- package/dist/types/packages/core/src/runtime/channel-context.d.ts +13 -0
- package/dist/types/packages/core/src/runtime/context-warning.d.ts +46 -0
- package/dist/types/packages/core/src/runtime/cron-sessions.d.ts +9 -0
- package/dist/types/packages/core/src/runtime/errors.d.ts +6 -0
- package/dist/types/packages/core/src/runtime/event-heartbeat.d.ts +17 -0
- package/dist/types/packages/core/src/runtime/file-hooks.d.ts +38 -0
- package/dist/types/packages/core/src/runtime/playwright-turn-abort.d.ts +12 -0
- package/dist/types/packages/core/src/runtime/public-helpers.d.ts +17 -0
- package/dist/types/packages/core/src/runtime/remote-session-grant.d.ts +91 -0
- package/dist/types/packages/core/src/runtime/remote-session-inbox.d.ts +206 -0
- package/dist/types/packages/core/src/runtime/remote-session-reply-outbox.d.ts +37 -0
- package/dist/types/packages/core/src/runtime/task-format.d.ts +4 -0
- package/dist/types/packages/core/src/runtime/tasks.d.ts +3 -0
- package/dist/types/packages/core/src/runtime/thread-context.d.ts +62 -0
- package/dist/types/packages/core/src/runtime/topic-config.d.ts +24 -0
- package/dist/types/packages/core/src/runtime/turn-event-stream.d.ts +47 -0
- package/dist/types/packages/core/src/runtime/turn-runner.d.ts +284 -0
- package/dist/types/packages/core/src/runtime/turn-session.d.ts +49 -0
- package/dist/types/packages/core/src/runtime/usage-alert.d.ts +11 -0
- package/dist/types/packages/core/src/runtime/user-turn-envelope.d.ts +37 -0
- package/dist/types/packages/core/src/runtime/visual-html.d.ts +13 -0
- package/dist/types/packages/core/src/runtime/visual-store.d.ts +71 -0
- package/dist/types/packages/core/src/runtime/visuals.d.ts +33 -0
- package/dist/types/packages/core/src/runtime-gateway.d.ts +282 -0
- package/dist/types/packages/core/src/security/sanitize.d.ts +16 -0
- package/dist/types/packages/core/src/security/sensitive-path.d.ts +1 -0
- package/dist/types/packages/core/src/storage/activity-log.d.ts +25 -0
- package/dist/types/packages/core/src/storage/api-messages.d.ts +156 -0
- package/dist/types/packages/core/src/storage/api-topic-brief.d.ts +39 -0
- package/dist/types/packages/core/src/storage/api-topic-config.d.ts +23 -0
- package/dist/types/packages/core/src/storage/api-topics.d.ts +274 -0
- package/dist/types/packages/core/src/storage/app-settings.d.ts +4 -0
- package/dist/types/packages/core/src/storage/ask-user-gates.d.ts +65 -0
- package/dist/types/packages/core/src/storage/browser-profiles.d.ts +31 -0
- package/dist/types/packages/core/src/storage/conversations.d.ts +149 -0
- package/dist/types/packages/core/src/storage/decisions.d.ts +45 -0
- package/dist/types/packages/core/src/storage/forum/agent-settings.d.ts +3 -0
- package/dist/types/packages/core/src/storage/forum/index.d.ts +4 -0
- package/dist/types/packages/core/src/storage/forum/repository.d.ts +42 -0
- package/dist/types/packages/core/src/storage/forum/schema.d.ts +38 -0
- package/dist/types/packages/core/src/storage/forum-db.d.ts +2 -0
- package/dist/types/packages/core/src/storage/remote-session.d.ts +318 -0
- package/dist/types/packages/core/src/storage/runtime-events.d.ts +33 -0
- package/dist/types/packages/core/src/storage/runtime-leases.d.ts +27 -0
- package/dist/types/packages/core/src/storage/runtime-process-leases.d.ts +47 -0
- package/dist/types/packages/core/src/storage/runtime-topic-state.d.ts +39 -0
- package/dist/types/packages/core/src/storage/runtime-turn-requests.d.ts +163 -0
- package/dist/types/packages/core/src/storage/self-schedules.d.ts +54 -0
- package/dist/types/packages/core/src/storage/session-asks.d.ts +78 -0
- package/dist/types/packages/core/src/storage/session-inbox-signal.d.ts +35 -0
- package/dist/types/packages/core/src/storage/session-inbox.d.ts +36 -0
- package/dist/types/packages/core/src/storage/sqlite.d.ts +20 -0
- package/dist/types/packages/core/src/storage/storage-contract.d.ts +46 -0
- package/dist/types/packages/core/src/storage/storage-host.d.ts +41 -0
- package/dist/types/packages/core/src/storage/storage-public-host.d.ts +7 -0
- package/dist/types/packages/core/src/storage/storage-public.d.ts +45 -0
- package/dist/types/packages/core/src/storage/tasks.d.ts +49 -0
- package/dist/types/packages/core/src/storage/token-stats.d.ts +69 -0
- package/dist/types/packages/core/src/storage/topic-archive-state.d.ts +33 -0
- package/dist/types/packages/core/src/storage/topic-archive.d.ts +42 -0
- package/dist/types/packages/core/src/storage/topic-host-mcp-grants.d.ts +5 -0
- package/dist/types/packages/core/src/storage/topic-link-records.d.ts +281 -0
- package/dist/types/packages/core/src/storage/topic-settings.d.ts +19 -0
- package/dist/types/packages/core/src/storage/topic-tool-capabilities.d.ts +37 -0
- package/dist/types/packages/core/src/storage/topic-transcript.d.ts +38 -0
- package/dist/types/packages/core/src/storage/vault-crypto-core.d.ts +6 -0
- package/dist/types/packages/core/src/storage/vault-crypto.d.ts +12 -0
- package/dist/types/packages/core/src/storage/vault-public.d.ts +3 -0
- package/dist/types/packages/core/src/storage/vault-request-gates.d.ts +69 -0
- package/dist/types/packages/core/src/storage/vault.d.ts +49 -0
- package/dist/types/packages/core/src/storage/wiki-summary-names.d.ts +13 -0
- package/dist/types/packages/core/src/storage/wiki.d.ts +15 -0
- package/dist/types/packages/core/src/topics/derive.d.ts +83 -0
- package/dist/types/packages/core/src/topics/lifecycle.d.ts +75 -0
- package/dist/types/packages/core/src/topics/links.d.ts +2 -0
- package/dist/types/packages/core/src/topics/personal-general.d.ts +15 -0
- package/dist/types/packages/core/src/topics/session.d.ts +70 -0
- package/dist/types/packages/core/src/types/api.d.ts +551 -0
- package/dist/types/packages/core/src/types.d.ts +405 -0
- package/dist/types/packages/core/src/version.d.ts +1 -0
- package/dist/types/packages/module-cron/src/background-sessions.d.ts +2 -0
- package/dist/types/packages/module-cron/src/context.d.ts +15 -0
- package/dist/types/packages/module-cron/src/host.d.ts +23 -0
- package/dist/types/packages/module-cron/src/index.d.ts +14 -0
- package/dist/types/packages/module-cron/src/module.d.ts +13 -0
- package/dist/types/packages/module-cron/src/schedule.d.ts +23 -0
- package/dist/types/packages/module-cron/src/scheduler.d.ts +46 -0
- package/dist/types/packages/module-cron/src/scripts.d.ts +29 -0
- package/dist/types/packages/module-cron/src/store.d.ts +152 -0
- package/dist/types/packages/module-cron/src/summarize.d.ts +4 -0
- package/dist/vault.js +848 -0
- package/dist/vault.js.map +18 -0
- package/install-bash-rs.mjs +90 -0
- package/install-browser-rs.mjs +83 -0
- package/package.json +171 -4
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import {
|
|
5
|
+
EFFORT_VALUES,
|
|
6
|
+
type EffortLevel,
|
|
7
|
+
getRegistry,
|
|
8
|
+
getTopic,
|
|
9
|
+
getTopicByNameForUser,
|
|
10
|
+
isAgentKind,
|
|
11
|
+
type TopicSurface,
|
|
12
|
+
} from "../src/cron-mcp-host.ts";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import {
|
|
15
|
+
CRON_CONTEXT_RETAIN_TURNS,
|
|
16
|
+
CRON_CONTEXT_ROTATE_EVERY,
|
|
17
|
+
resetCronTopicContext,
|
|
18
|
+
updateCronJobWithContextReset,
|
|
19
|
+
} from "#context";
|
|
20
|
+
import { cronScriptExists, listCronScripts } from "#scripts";
|
|
21
|
+
import {
|
|
22
|
+
countCronRuns,
|
|
23
|
+
createCronJob,
|
|
24
|
+
cronActorOwnerUserId,
|
|
25
|
+
deleteCronJob,
|
|
26
|
+
getCronJob,
|
|
27
|
+
getCronJobByOwnerAndName,
|
|
28
|
+
getCronTopicContext,
|
|
29
|
+
listCronJobs,
|
|
30
|
+
listCronRuns,
|
|
31
|
+
listCronTopicSessions,
|
|
32
|
+
requestCronCancel,
|
|
33
|
+
requestCronRun,
|
|
34
|
+
setCronJobEnabled,
|
|
35
|
+
} from "#store";
|
|
36
|
+
import { queueCronPromptSummary } from "#summarize";
|
|
37
|
+
|
|
38
|
+
const args = process.argv.slice(2);
|
|
39
|
+
const arg = (name: string) =>
|
|
40
|
+
args.find((value) => value.startsWith(`--${name}=`))?.slice(name.length + 3) ?? "";
|
|
41
|
+
const userId = arg("user-id");
|
|
42
|
+
const actorUserId = arg("actor-user-id") || userId;
|
|
43
|
+
const currentTopic = arg("topic");
|
|
44
|
+
const currentTopicId = arg("topic-id");
|
|
45
|
+
const authorized = arg("authorized") === "true";
|
|
46
|
+
const efforts = new Set<string>(EFFORT_VALUES);
|
|
47
|
+
|
|
48
|
+
function ok(value: unknown) {
|
|
49
|
+
return {
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: "text" as const,
|
|
53
|
+
text: typeof value === "string" ? value : JSON.stringify(value, null, 2),
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function fail(error: unknown) {
|
|
60
|
+
return {
|
|
61
|
+
isError: true,
|
|
62
|
+
content: [
|
|
63
|
+
{ type: "text" as const, text: error instanceof Error ? error.message : String(error) },
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Surface of the room this cron server was started for, if it has one. */
|
|
69
|
+
function callerSurface(): TopicSurface | undefined {
|
|
70
|
+
return currentTopicId ? (getTopic(currentTopicId)?.surface ?? undefined) : undefined;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Resolve the topic a cron tool call targets.
|
|
75
|
+
*
|
|
76
|
+
* Precedence is explicit-id, then explicit-title, then the current room. The
|
|
77
|
+
* old order was `input.topic_id || currentTopicId` first, which had two
|
|
78
|
+
* consequences: the host always passes `--topic-id` when the room has one
|
|
79
|
+
* (module.ts), so an explicitly supplied `topic` was silently ignored, and the
|
|
80
|
+
* id branch returned `getTopic()` raw — no surface check — while callers
|
|
81
|
+
* gated only on `ownsTopic` (membership). A Telegram agent could therefore
|
|
82
|
+
* pin a durable, repeating cron job onto a `terminal` room by pasting its id.
|
|
83
|
+
* Cron is the worst place for that: the job outlives the conversation and
|
|
84
|
+
* keeps firing turns.
|
|
85
|
+
*
|
|
86
|
+
* Anything resolved by id or title must live on the caller's surface. When
|
|
87
|
+
* this server has no current room the surface is unknown; that only happens
|
|
88
|
+
* outside the normal MCP path, and the lookup stays unscoped there rather than
|
|
89
|
+
* refusing every call.
|
|
90
|
+
*/
|
|
91
|
+
function resolveTopic(input?: { topic_id?: string; topic?: string }) {
|
|
92
|
+
const surface = callerSurface();
|
|
93
|
+
const onCallerSurface = <T extends { surface?: string | null } | null>(topic: T): T | null =>
|
|
94
|
+
topic && (!surface || topic.surface === surface) ? topic : null;
|
|
95
|
+
|
|
96
|
+
const explicitId = input?.topic_id?.trim();
|
|
97
|
+
if (explicitId) return onCallerSurface(getTopic(explicitId));
|
|
98
|
+
|
|
99
|
+
const explicitTitle = input?.topic?.trim();
|
|
100
|
+
if (explicitTitle) {
|
|
101
|
+
return getTopicByNameForUser(explicitTitle, userId, surface ? { surface } : { scope: "all" });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (currentTopicId) return getTopic(currentTopicId);
|
|
105
|
+
return currentTopic
|
|
106
|
+
? getTopicByNameForUser(currentTopic, userId, surface ? { surface } : { scope: "all" })
|
|
107
|
+
: null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function ownsTopic(topic: NonNullable<ReturnType<typeof getTopic>>): boolean {
|
|
111
|
+
return authorized || topic.participants.some((participant) => participant.userId === userId);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function canSeeJob(job: NonNullable<ReturnType<typeof getCronJob>>): boolean {
|
|
115
|
+
if (authorized) return true;
|
|
116
|
+
if (cronActorOwnerUserId(job) === actorUserId) return true;
|
|
117
|
+
const topic = getTopic(job.topicId);
|
|
118
|
+
return Boolean(topic && ownsTopic(topic));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function resolveVisibleJob(input: { job_id?: string; name?: string }) {
|
|
122
|
+
const job = input.job_id?.trim()
|
|
123
|
+
? getCronJob(input.job_id.trim())
|
|
124
|
+
: (() => {
|
|
125
|
+
const name = input.name?.trim();
|
|
126
|
+
if (!name) return null;
|
|
127
|
+
const matches = listCronJobs().filter((entry) => entry.name === name && canSeeJob(entry));
|
|
128
|
+
if (matches.length > 1)
|
|
129
|
+
throw new Error(`multiple visible jobs named '${name}'; use job_id`);
|
|
130
|
+
return matches[0] ?? null;
|
|
131
|
+
})();
|
|
132
|
+
if (!job) throw new Error("cron job not found; provide job_id or name");
|
|
133
|
+
if (!canSeeJob(job)) throw new Error("cron job not found");
|
|
134
|
+
return job;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function resolveOwnedJob(input: { job_id?: string; name?: string }) {
|
|
138
|
+
const job = resolveVisibleJob(input);
|
|
139
|
+
if (!authorized && cronActorOwnerUserId(job) !== actorUserId)
|
|
140
|
+
throw new Error("only the job owner can mutate this cron job");
|
|
141
|
+
return job;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function jobDto(job: NonNullable<ReturnType<typeof getCronJob>>) {
|
|
145
|
+
const runs = listCronRuns(job.id, 1);
|
|
146
|
+
const contextState = getCronTopicContext(job.topicId);
|
|
147
|
+
const canMutate = authorized || cronActorOwnerUserId(job) === actorUserId;
|
|
148
|
+
const prompt = job.prompt?.trim() ?? "";
|
|
149
|
+
return {
|
|
150
|
+
...job,
|
|
151
|
+
canMutate,
|
|
152
|
+
prompt: canMutate ? prompt || null : null,
|
|
153
|
+
promptPreview: prompt ? prompt.replace(/\s+/g, " ").slice(0, 180) : null,
|
|
154
|
+
summary: job.summary ?? null,
|
|
155
|
+
runCount: countCronRuns(job.id),
|
|
156
|
+
context: {
|
|
157
|
+
scope: "topic",
|
|
158
|
+
sessionName: `cron-${job.topicId}`,
|
|
159
|
+
providers: listCronTopicSessions(job.topicId).map((session) => session.agent),
|
|
160
|
+
successfulRunsSinceRotation: contextState?.successfulRunsSinceRotation ?? 0,
|
|
161
|
+
rotateEvery: CRON_CONTEXT_ROTATE_EVERY,
|
|
162
|
+
retainTurns: CRON_CONTEXT_RETAIN_TURNS,
|
|
163
|
+
lastRotatedAt: contextState?.lastRotatedAt ?? null,
|
|
164
|
+
},
|
|
165
|
+
lastRun: runs[0] ?? null,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const jobRef = {
|
|
170
|
+
job_id: z.string().optional().describe("Cron job id"),
|
|
171
|
+
name: z.string().optional().describe("Cron job name visible to the current user"),
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const server = new McpServer({ name: "negotium-cron", version: "0.1.0" });
|
|
175
|
+
|
|
176
|
+
server.tool(
|
|
177
|
+
"cron_create",
|
|
178
|
+
"Create a persistent prompt- or Python-script-based scheduled task for a topic. All jobs in the topic share one Cron conversation.",
|
|
179
|
+
{
|
|
180
|
+
name: z.string().describe("Unique name using letters, numbers, dash, or underscore"),
|
|
181
|
+
prompt: z.string().optional().describe("Inline task instructions, up to 20,000 characters"),
|
|
182
|
+
script: z
|
|
183
|
+
.string()
|
|
184
|
+
.optional()
|
|
185
|
+
.describe("Plain .py filename from the node Cron jobs directory; stdout becomes the prompt"),
|
|
186
|
+
schedule: z.string().describe("Five-field cron expression, e.g. '0 9 * * 1-5'"),
|
|
187
|
+
timezone: z.string().optional().describe("IANA timezone, e.g. America/Los_Angeles"),
|
|
188
|
+
topic_id: z.string().optional(),
|
|
189
|
+
topic: z.string().optional(),
|
|
190
|
+
agent: z.string().optional().describe("claude, codex, or maestro"),
|
|
191
|
+
model: z.string().optional(),
|
|
192
|
+
effort: z.string().optional().describe("low, medium, high, xhigh, or max"),
|
|
193
|
+
},
|
|
194
|
+
async ({ name, prompt, script, schedule, timezone, topic_id, topic, agent, model, effort }) => {
|
|
195
|
+
try {
|
|
196
|
+
if (!userId) throw new Error("missing user context");
|
|
197
|
+
const cleanName = name.trim();
|
|
198
|
+
if (!/^[A-Za-z0-9_-]+$/.test(cleanName)) {
|
|
199
|
+
throw new Error("name must use only letters, numbers, dashes, and underscores");
|
|
200
|
+
}
|
|
201
|
+
const cleanPrompt = prompt?.trim() || undefined;
|
|
202
|
+
const cleanScript = script?.trim() || undefined;
|
|
203
|
+
if (Boolean(cleanPrompt) === Boolean(cleanScript)) {
|
|
204
|
+
throw new Error("provide exactly one of prompt or script");
|
|
205
|
+
}
|
|
206
|
+
if (cleanPrompt && cleanPrompt.length > 20_000) {
|
|
207
|
+
throw new Error("prompt must be 20,000 characters or fewer");
|
|
208
|
+
}
|
|
209
|
+
if (cleanScript && !cronScriptExists(cleanScript)) {
|
|
210
|
+
throw new Error(`cron script not found: ${cleanScript}`);
|
|
211
|
+
}
|
|
212
|
+
if (getCronJobByOwnerAndName(actorUserId, cleanName))
|
|
213
|
+
throw new Error(`cron job already exists: ${cleanName}`);
|
|
214
|
+
const target = resolveTopic({ topic_id, topic });
|
|
215
|
+
if (!target || !ownsTopic(target)) throw new Error("target topic not found");
|
|
216
|
+
if (!target.agent) throw new Error("target topic has no agent");
|
|
217
|
+
const resolvedAgent = agent?.trim();
|
|
218
|
+
if (resolvedAgent && !isAgentKind(resolvedAgent))
|
|
219
|
+
throw new Error(`invalid agent: ${resolvedAgent}`);
|
|
220
|
+
const effectiveAgent = isAgentKind(resolvedAgent) ? resolvedAgent : target.agent;
|
|
221
|
+
const registry = getRegistry(effectiveAgent);
|
|
222
|
+
const cleanModel = model?.trim() || undefined;
|
|
223
|
+
if (cleanModel && !registry.validateModel(cleanModel)) {
|
|
224
|
+
throw new Error(`model '${cleanModel}' is invalid for ${effectiveAgent}`);
|
|
225
|
+
}
|
|
226
|
+
const cleanEffort = effort?.trim();
|
|
227
|
+
if (cleanEffort && !efforts.has(cleanEffort))
|
|
228
|
+
throw new Error(`invalid effort: ${cleanEffort}`);
|
|
229
|
+
const resolvedEffort = cleanEffort as EffortLevel | undefined;
|
|
230
|
+
if (resolvedEffort && !registry.validateEffort(resolvedEffort)) {
|
|
231
|
+
throw new Error(`effort '${resolvedEffort}' is invalid for ${effectiveAgent}`);
|
|
232
|
+
}
|
|
233
|
+
return ok(
|
|
234
|
+
(() => {
|
|
235
|
+
const job = createCronJob({
|
|
236
|
+
name: cleanName,
|
|
237
|
+
ownerUserId: userId,
|
|
238
|
+
actorOwnerUserId: actorUserId === userId ? undefined : actorUserId,
|
|
239
|
+
topicId: target.id,
|
|
240
|
+
prompt: cleanPrompt,
|
|
241
|
+
script: cleanScript,
|
|
242
|
+
schedule: schedule.trim(),
|
|
243
|
+
timezone,
|
|
244
|
+
agent: isAgentKind(resolvedAgent) ? resolvedAgent : undefined,
|
|
245
|
+
model: cleanModel,
|
|
246
|
+
effort: resolvedEffort,
|
|
247
|
+
});
|
|
248
|
+
if (cleanPrompt) queueCronPromptSummary(job.id, cleanPrompt);
|
|
249
|
+
return jobDto(job);
|
|
250
|
+
})(),
|
|
251
|
+
);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
return fail(error);
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
server.tool(
|
|
259
|
+
"cron_list_scripts",
|
|
260
|
+
"List available Python prompt scripts on this node.",
|
|
261
|
+
{},
|
|
262
|
+
async () => ok({ scripts: listCronScripts() }),
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
server.tool(
|
|
266
|
+
"cron_edit",
|
|
267
|
+
"Update a scheduled task. Source, topic, or runtime changes reset its shared Cron context.",
|
|
268
|
+
{
|
|
269
|
+
...jobRef,
|
|
270
|
+
new_name: z.string().optional(),
|
|
271
|
+
prompt: z.string().nullable().optional(),
|
|
272
|
+
script: z.string().nullable().optional(),
|
|
273
|
+
schedule: z.string().optional(),
|
|
274
|
+
timezone: z.string().nullable().optional(),
|
|
275
|
+
topic_id: z.string().optional(),
|
|
276
|
+
topic: z.string().optional(),
|
|
277
|
+
agent: z.string().nullable().optional(),
|
|
278
|
+
model: z.string().nullable().optional(),
|
|
279
|
+
effort: z.string().nullable().optional(),
|
|
280
|
+
enabled: z.boolean().optional(),
|
|
281
|
+
},
|
|
282
|
+
async ({
|
|
283
|
+
job_id,
|
|
284
|
+
name,
|
|
285
|
+
new_name,
|
|
286
|
+
prompt,
|
|
287
|
+
script,
|
|
288
|
+
schedule,
|
|
289
|
+
timezone,
|
|
290
|
+
topic_id,
|
|
291
|
+
topic,
|
|
292
|
+
agent,
|
|
293
|
+
model,
|
|
294
|
+
effort,
|
|
295
|
+
enabled,
|
|
296
|
+
}) => {
|
|
297
|
+
try {
|
|
298
|
+
const job = resolveOwnedJob({ job_id, name });
|
|
299
|
+
const target = topic_id || topic ? resolveTopic({ topic_id, topic }) : getTopic(job.topicId);
|
|
300
|
+
if (!target || !ownsTopic(target) || !target.agent) throw new Error("target topic not found");
|
|
301
|
+
|
|
302
|
+
const cleanName = new_name?.trim();
|
|
303
|
+
if (cleanName && !/^[A-Za-z0-9_-]+$/.test(cleanName)) {
|
|
304
|
+
throw new Error("name must use only letters, numbers, dashes, and underscores");
|
|
305
|
+
}
|
|
306
|
+
if (cleanName) {
|
|
307
|
+
const duplicate = getCronJobByOwnerAndName(userId, cleanName);
|
|
308
|
+
if (duplicate && duplicate.id !== job.id)
|
|
309
|
+
throw new Error(`cron job already exists: ${cleanName}`);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
let nextPrompt = prompt !== undefined ? prompt?.trim() || undefined : job.prompt;
|
|
313
|
+
let nextScript = script !== undefined ? script?.trim() || undefined : job.script;
|
|
314
|
+
if (prompt !== undefined && nextPrompt) nextScript = undefined;
|
|
315
|
+
if (script !== undefined && nextScript) nextPrompt = undefined;
|
|
316
|
+
if (Boolean(nextPrompt) === Boolean(nextScript)) {
|
|
317
|
+
throw new Error("provide exactly one of prompt or script");
|
|
318
|
+
}
|
|
319
|
+
if (nextPrompt && nextPrompt.length > 20_000) {
|
|
320
|
+
throw new Error("prompt must be 20,000 characters or fewer");
|
|
321
|
+
}
|
|
322
|
+
if (nextScript && !cronScriptExists(nextScript)) {
|
|
323
|
+
throw new Error(`cron script not found: ${nextScript}`);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const rawAgent = agent?.trim() || undefined;
|
|
327
|
+
if (rawAgent && !isAgentKind(rawAgent)) throw new Error(`invalid agent: ${rawAgent}`);
|
|
328
|
+
const nextAgent =
|
|
329
|
+
agent !== undefined ? (isAgentKind(rawAgent) ? rawAgent : undefined) : job.agent;
|
|
330
|
+
const effectiveAgent = nextAgent ?? target.agent;
|
|
331
|
+
const registry = getRegistry(effectiveAgent);
|
|
332
|
+
const nextModel = model !== undefined ? model?.trim() || undefined : job.model;
|
|
333
|
+
if (nextModel && !registry.validateModel(nextModel)) {
|
|
334
|
+
throw new Error(`model '${nextModel}' is invalid for ${effectiveAgent}`);
|
|
335
|
+
}
|
|
336
|
+
const rawEffort = effort?.trim() || undefined;
|
|
337
|
+
if (rawEffort && !efforts.has(rawEffort)) throw new Error(`invalid effort: ${rawEffort}`);
|
|
338
|
+
const nextEffort = effort !== undefined ? (rawEffort as EffortLevel | undefined) : job.effort;
|
|
339
|
+
if (nextEffort && !registry.validateEffort(nextEffort)) {
|
|
340
|
+
throw new Error(`effort '${nextEffort}' is invalid for ${effectiveAgent}`);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const sourceChanged = nextPrompt !== job.prompt || nextScript !== job.script;
|
|
344
|
+
const updated = await updateCronJobWithContextReset(job.id, {
|
|
345
|
+
name: cleanName,
|
|
346
|
+
topicId: target.id !== job.topicId ? target.id : undefined,
|
|
347
|
+
prompt: prompt !== undefined || script !== undefined ? (nextPrompt ?? null) : undefined,
|
|
348
|
+
script: prompt !== undefined || script !== undefined ? (nextScript ?? null) : undefined,
|
|
349
|
+
summary: sourceChanged ? null : undefined,
|
|
350
|
+
schedule: schedule?.trim(),
|
|
351
|
+
timezone,
|
|
352
|
+
agent: agent !== undefined ? (nextAgent ?? null) : undefined,
|
|
353
|
+
model: model !== undefined ? (nextModel ?? null) : undefined,
|
|
354
|
+
effort: effort !== undefined ? (nextEffort ?? null) : undefined,
|
|
355
|
+
enabled,
|
|
356
|
+
});
|
|
357
|
+
if (!updated) throw new Error("cron job not found");
|
|
358
|
+
if (sourceChanged && nextPrompt) queueCronPromptSummary(updated.id, nextPrompt);
|
|
359
|
+
return ok(jobDto(updated));
|
|
360
|
+
} catch (error) {
|
|
361
|
+
return fail(error);
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
server.tool(
|
|
367
|
+
"cron_list",
|
|
368
|
+
"List scheduled tasks visible through ownership or topic participation.",
|
|
369
|
+
{
|
|
370
|
+
topic_id: z.string().optional(),
|
|
371
|
+
topic: z.string().optional(),
|
|
372
|
+
include_disabled: z.boolean().optional(),
|
|
373
|
+
},
|
|
374
|
+
async ({ topic_id, topic, include_disabled }) => {
|
|
375
|
+
if (!userId) return fail("missing user context");
|
|
376
|
+
const target = topic_id || topic ? resolveTopic({ topic_id, topic }) : null;
|
|
377
|
+
if ((topic_id || topic) && !target) return fail("target topic not found");
|
|
378
|
+
return ok(
|
|
379
|
+
listCronJobs()
|
|
380
|
+
.filter(canSeeJob)
|
|
381
|
+
.filter((job) => (target ? job.topicId === target.id : true))
|
|
382
|
+
.filter((job) => (include_disabled === false ? job.enabled : true))
|
|
383
|
+
.map(jobDto),
|
|
384
|
+
);
|
|
385
|
+
},
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
server.tool(
|
|
389
|
+
"cron_inspect",
|
|
390
|
+
"Inspect one scheduled task and its recent run history.",
|
|
391
|
+
jobRef,
|
|
392
|
+
async (input) => {
|
|
393
|
+
try {
|
|
394
|
+
const job = resolveVisibleJob(input);
|
|
395
|
+
return ok({ ...jobDto(job), runs: listCronRuns(job.id, 20) });
|
|
396
|
+
} catch (error) {
|
|
397
|
+
return fail(error);
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
);
|
|
401
|
+
|
|
402
|
+
server.tool(
|
|
403
|
+
"cron_logs",
|
|
404
|
+
"Show durable run history for one scheduled task. This replaces per-process pm2 logs.",
|
|
405
|
+
{ ...jobRef, limit: z.number().int().min(1).max(100).optional() },
|
|
406
|
+
async ({ limit, ...input }) => {
|
|
407
|
+
try {
|
|
408
|
+
const job = resolveOwnedJob(input);
|
|
409
|
+
return ok({ jobId: job.id, runs: listCronRuns(job.id, limit ?? 20) });
|
|
410
|
+
} catch (error) {
|
|
411
|
+
return fail(error);
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
for (const [toolName, enabled] of [
|
|
417
|
+
["cron_pause", false],
|
|
418
|
+
["cron_resume", true],
|
|
419
|
+
] as const) {
|
|
420
|
+
server.tool(
|
|
421
|
+
toolName,
|
|
422
|
+
`${enabled ? "Resume" : "Pause"} a scheduled task.`,
|
|
423
|
+
jobRef,
|
|
424
|
+
async (input) => {
|
|
425
|
+
try {
|
|
426
|
+
const job = resolveOwnedJob(input);
|
|
427
|
+
return ok(jobDto(setCronJobEnabled(job.id, enabled)!));
|
|
428
|
+
} catch (error) {
|
|
429
|
+
return fail(error);
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
server.tool(
|
|
436
|
+
"cron_restart",
|
|
437
|
+
"Re-arm a scheduled task from the current time. The central scheduler has no per-job process to restart.",
|
|
438
|
+
jobRef,
|
|
439
|
+
async (input) => {
|
|
440
|
+
try {
|
|
441
|
+
const job = resolveOwnedJob(input);
|
|
442
|
+
return ok(jobDto(setCronJobEnabled(job.id, true)!));
|
|
443
|
+
} catch (error) {
|
|
444
|
+
return fail(error);
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
);
|
|
448
|
+
|
|
449
|
+
server.tool(
|
|
450
|
+
"cron_run",
|
|
451
|
+
"Queue one immediate run without changing the schedule.",
|
|
452
|
+
jobRef,
|
|
453
|
+
async (input) => {
|
|
454
|
+
try {
|
|
455
|
+
const job = resolveOwnedJob(input);
|
|
456
|
+
if (!job.enabled) throw new Error("job is disabled; use cron_resume first");
|
|
457
|
+
return ok({ queued: true, requestId: requestCronRun(job.id), jobId: job.id });
|
|
458
|
+
} catch (error) {
|
|
459
|
+
return fail(error);
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
);
|
|
463
|
+
|
|
464
|
+
server.tool(
|
|
465
|
+
"cron_reset",
|
|
466
|
+
"Reset the shared Cron conversation for the task's entire topic.",
|
|
467
|
+
jobRef,
|
|
468
|
+
async (input) => {
|
|
469
|
+
try {
|
|
470
|
+
const job = resolveOwnedJob(input);
|
|
471
|
+
const sessions = await resetCronTopicContext(job.topicId);
|
|
472
|
+
return ok({ reset: true, topicId: job.topicId, clearedProviderSessions: sessions });
|
|
473
|
+
} catch (error) {
|
|
474
|
+
return fail(error);
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
);
|
|
478
|
+
|
|
479
|
+
server.tool(
|
|
480
|
+
"cron_kill",
|
|
481
|
+
"Cancel an active or queued run, including its agent or Python process tree.",
|
|
482
|
+
jobRef,
|
|
483
|
+
async (input) => {
|
|
484
|
+
try {
|
|
485
|
+
const job = resolveOwnedJob(input);
|
|
486
|
+
return ok({
|
|
487
|
+
cancellationQueued: true,
|
|
488
|
+
requestId: requestCronCancel(job.id),
|
|
489
|
+
jobId: job.id,
|
|
490
|
+
});
|
|
491
|
+
} catch (error) {
|
|
492
|
+
return fail(error);
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
);
|
|
496
|
+
|
|
497
|
+
server.tool(
|
|
498
|
+
"cron_delete",
|
|
499
|
+
"Delete a scheduled task and its run history.",
|
|
500
|
+
jobRef,
|
|
501
|
+
async (input) => {
|
|
502
|
+
try {
|
|
503
|
+
const job = resolveOwnedJob(input);
|
|
504
|
+
deleteCronJob(job.id);
|
|
505
|
+
return ok({ deleted: true, jobId: job.id });
|
|
506
|
+
} catch (error) {
|
|
507
|
+
return fail(error);
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
);
|
|
511
|
+
|
|
512
|
+
server.tool("cron_status", "Show a compact scheduled-task status summary.", {}, async () => {
|
|
513
|
+
if (!userId) return fail("missing user context");
|
|
514
|
+
const jobs = listCronJobs().filter(canSeeJob);
|
|
515
|
+
return ok({
|
|
516
|
+
backend: "sqlite-central-scheduler",
|
|
517
|
+
total: jobs.length,
|
|
518
|
+
enabled: jobs.filter((job) => job.enabled).length,
|
|
519
|
+
disabled: jobs.filter((job) => !job.enabled).length,
|
|
520
|
+
jobs: jobs.map((job) => ({
|
|
521
|
+
id: job.id,
|
|
522
|
+
name: job.name,
|
|
523
|
+
topicId: job.topicId,
|
|
524
|
+
enabled: job.enabled,
|
|
525
|
+
nextRunAt: job.nextRunAt,
|
|
526
|
+
lastRun: listCronRuns(job.id, 1)[0] ?? null,
|
|
527
|
+
contextProviders: listCronTopicSessions(job.topicId).map((session) => session.agent),
|
|
528
|
+
contextRunsSinceRotation: getCronTopicContext(job.topicId)?.successfulRunsSinceRotation ?? 0,
|
|
529
|
+
})),
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
server.tool(
|
|
534
|
+
"cron_reconcile",
|
|
535
|
+
"Validate the current user's DB-backed schedules. No pm2 process reconciliation is required.",
|
|
536
|
+
{},
|
|
537
|
+
async () => {
|
|
538
|
+
if (!userId) return fail("missing user context");
|
|
539
|
+
const jobs = listCronJobs(userId);
|
|
540
|
+
const invalid = jobs
|
|
541
|
+
.filter((job) => {
|
|
542
|
+
const topic = getTopic(job.topicId);
|
|
543
|
+
return !topic?.agent || !ownsTopic(topic);
|
|
544
|
+
})
|
|
545
|
+
.map((job) => job.id);
|
|
546
|
+
return ok({
|
|
547
|
+
backend: "sqlite-central-scheduler",
|
|
548
|
+
checked: jobs.length,
|
|
549
|
+
invalid,
|
|
550
|
+
externalProcesses: 0,
|
|
551
|
+
drift: 0,
|
|
552
|
+
});
|
|
553
|
+
},
|
|
554
|
+
);
|
|
555
|
+
|
|
556
|
+
await server.connect(new StdioServerTransport());
|