@crewx/sdk 0.9.0-rc.22 → 0.9.0-rc.221
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 +1 -1
- package/dist/account/auth-client.d.ts +61 -0
- package/dist/account/auth-json-v2.d.ts +1 -0
- package/dist/account/auth-json.d.ts +30 -0
- package/dist/account/config.d.ts +37 -0
- package/dist/account/env-bootstrap.d.ts +11 -0
- package/dist/account/errors.d.ts +24 -0
- package/dist/account/index.d.ts +12 -0
- package/dist/account/index.js +2 -0
- package/dist/account/session-manager.d.ts +47 -0
- package/dist/activity-log/builder.d.ts +59 -6
- package/dist/agent/agent-list-view.d.ts +19 -0
- package/dist/agent-interceptor/chain.d.ts +25 -0
- package/dist/agent-interceptor/index.d.ts +6 -0
- package/dist/agent-interceptor/model-runner.d.ts +19 -0
- package/dist/agent-interceptor/program-runner.d.ts +13 -0
- package/dist/agent-interceptor/protocol.d.ts +68 -0
- package/dist/agent-interceptor/run-stop.d.ts +3 -0
- package/dist/agent-interceptor/schema.d.ts +267 -0
- package/dist/agent-interceptor/types.d.ts +88 -0
- package/dist/app/app-files/args.d.ts +12 -0
- package/dist/app/app-files/errors.d.ts +6 -0
- package/dist/app/app-files/index.d.ts +35 -0
- package/dist/app/app-files/lock.d.ts +26 -0
- package/dist/app/app-files/root.d.ts +22 -0
- package/dist/app/app-files/store.d.ts +48 -0
- package/dist/app/app-files/write.child.d.ts +1 -0
- package/dist/app/app.d.ts +168 -0
- package/dist/app/backend-env.d.ts +3 -0
- package/dist/app/content-media-types.d.ts +2 -0
- package/dist/app/context.d.ts +2 -0
- package/dist/app/entry.d.ts +9 -0
- package/dist/app/frame.d.ts +55 -0
- package/dist/app/index.d.ts +20 -0
- package/dist/app/index.js +13 -0
- package/dist/app/job-bridge.child.d.ts +1 -0
- package/dist/app/job-bridge.d.ts +67 -0
- package/dist/app/job-bridge.drain.child.d.ts +1 -0
- package/dist/app/job-bridge.example.d.ts +11 -0
- package/dist/app/job-contract.d.ts +40 -0
- package/dist/app/job-wire.d.ts +149 -0
- package/dist/app/protocol.d.ts +9 -0
- package/dist/app/runtime.d.ts +23 -0
- package/dist/app/schedule-contract.d.ts +59 -0
- package/dist/app/tool-mode.d.ts +3 -0
- package/dist/app-artifact-policy/check.d.ts +2 -0
- package/dist/app-artifact-policy/contract.d.ts +54 -0
- package/dist/app-artifact-policy/helper.d.ts +15 -0
- package/dist/app-artifact-policy/index.d.ts +3 -0
- package/dist/app-artifact-policy/index.js +18 -0
- package/dist/app-artifact-policy/paths.d.ts +24 -0
- package/dist/app-artifact-policy/scan.d.ts +47 -0
- package/dist/app-sync/continuation.d.ts +67 -0
- package/dist/app-sync/coordinator.d.ts +92 -0
- package/dist/app-sync/create-ledger.d.ts +27 -0
- package/dist/app-sync/index.d.ts +9 -0
- package/dist/app-sync/index.js +390 -0
- package/dist/app-sync/scope.d.ts +35 -0
- package/dist/app-sync/session-fence.d.ts +26 -0
- package/dist/app-sync/sqlite-store.d.ts +237 -0
- package/dist/app-sync/types.d.ts +855 -0
- package/dist/app-ui/index.d.ts +95 -0
- package/dist/app-ui/index.js +1 -0
- package/dist/attachment-receive/index.d.ts +76 -0
- package/dist/attachment-receive/index.js +2 -0
- package/dist/boxing/box.types.d.ts +4 -0
- package/dist/config/canonicalize-agent-options.d.ts +2 -0
- package/dist/config/default-agent-models.d.ts +11 -0
- package/dist/config/global-settings.d.ts +33 -0
- package/dist/config/migrate-grok-mode.d.ts +6 -0
- package/dist/config/model-compat.d.ts +31 -0
- package/dist/config/models.generated.d.ts +38 -0
- package/dist/config/models.remote.d.ts +1 -0
- package/dist/config/overdrive.d.ts +7 -0
- package/dist/config/pricing.d.ts +6 -3
- package/dist/config/pricing.generated.d.ts +4 -0
- package/dist/config/pricing.types.d.ts +4 -0
- package/dist/config/timeout.config.d.ts +4 -0
- package/dist/config/wi-boards.d.ts +19 -0
- package/dist/context/GoalLoader.d.ts +6 -0
- package/dist/context-budget/continuity.d.ts +64 -0
- package/dist/context-budget/fixed-slot-shrink.d.ts +97 -0
- package/dist/context-budget/index.d.ts +168 -0
- package/dist/conversation/index.d.ts +1 -1
- package/dist/conversation/sqlite-provider.d.ts +6 -3
- package/dist/conversation/to-template-messages.d.ts +9 -0
- package/dist/conversation/types.d.ts +86 -1
- package/dist/desktop/command-runner.d.ts +4 -0
- package/dist/desktop/default-adapters.d.ts +4 -0
- package/dist/desktop/global-install.d.ts +19 -0
- package/dist/desktop/index.d.ts +3 -0
- package/dist/desktop/index.js +3 -0
- package/dist/desktop/install.d.ts +5 -0
- package/dist/desktop/lnk.d.ts +22 -0
- package/dist/desktop/manifest.d.ts +21 -0
- package/dist/desktop/types.d.ts +67 -0
- package/dist/desktop/version.d.ts +1 -0
- package/dist/desktop/windows-paths.d.ts +21 -0
- package/dist/desktop/wrapper.d.ts +18 -0
- package/dist/esm/account/index.js +2 -0
- package/dist/esm/app/index.js +13 -0
- package/dist/esm/app-artifact-policy/index.js +18 -0
- package/dist/esm/app-sync/index.js +390 -0
- package/dist/esm/attachment-receive/index.js +2 -0
- package/dist/esm/desktop/index.js +3 -0
- package/dist/esm/history-snapshot/index.js +16 -0
- package/dist/esm/index.js +1394 -224
- package/dist/esm/node/index.js +2 -0
- package/dist/esm/plugins/index.js +569 -219
- package/dist/esm/process/index.js +1 -0
- package/dist/esm/publish/index.js +2 -0
- package/dist/esm/repository/index.js +828 -211
- package/dist/esm/skills/index.js +2 -0
- package/dist/esm/testing/index.js +1 -1
- package/dist/events/types.d.ts +44 -0
- package/dist/facade/Crewx.d.ts +107 -5
- package/dist/facade/task-ticket.d.ts +14 -0
- package/dist/highlight/thread-highlight-prompt.d.ts +2 -0
- package/dist/highlight/thread-highlighter.d.ts +326 -0
- package/dist/history-snapshot/index.d.ts +83 -0
- package/dist/history-snapshot/index.js +16 -0
- package/dist/index.browser.d.ts +26 -1
- package/dist/index.browser.js +6 -2
- package/dist/index.d.ts +169 -19
- package/dist/index.js +1394 -224
- package/dist/internal/console-decoder.d.ts +38 -0
- package/dist/internal/windows-spawn.d.ts +10 -0
- package/dist/layout/types.d.ts +18 -1
- package/dist/lifecycle/process-lease.d.ts +80 -0
- package/dist/lifecycle/process-owner.d.ts +20 -0
- package/dist/lifecycle/task-heartbeat.d.ts +41 -0
- package/dist/lifecycle/task-stop.d.ts +112 -0
- package/dist/lifecycle/update-admission.d.ts +45 -0
- package/dist/local-server/base-url.d.ts +18 -0
- package/dist/local-server/index.d.ts +8 -0
- package/dist/local-server/opencode.d.ts +8 -0
- package/dist/local-server/probe.d.ts +3 -0
- package/dist/local-server/runtime.d.ts +26 -0
- package/dist/local-server/types.d.ts +43 -0
- package/dist/mcp-app/agent-access.d.ts +33 -0
- package/dist/mcp-app/app-handoff.d.ts +109 -0
- package/dist/mcp-app/app-icon-read.d.ts +7 -0
- package/dist/mcp-app/app-job-bridge.d.ts +30 -0
- package/dist/mcp-app/app-job-bridge.example.d.ts +36 -0
- package/dist/mcp-app/app-job.d.ts +168 -0
- package/dist/mcp-app/app-schedule.d.ts +85 -0
- package/dist/mcp-app/apps-context.d.ts +32 -0
- package/dist/mcp-app/bundle-provenance.d.ts +3 -0
- package/dist/mcp-app/candidate-registration.d.ts +4 -0
- package/dist/mcp-app/card-handler.d.ts +7 -0
- package/dist/mcp-app/catalog.d.ts +7 -0
- package/dist/mcp-app/content-channel.d.ts +86 -0
- package/dist/mcp-app/content-declarations.d.ts +31 -0
- package/dist/mcp-app/dev-checks.d.ts +31 -0
- package/dist/mcp-app/diagnostic-reason.d.ts +3 -0
- package/dist/mcp-app/discovery.d.ts +164 -0
- package/dist/mcp-app/errors.d.ts +7 -0
- package/dist/mcp-app/index.d.ts +46 -0
- package/dist/mcp-app/installed-app-ref.d.ts +25 -0
- package/dist/mcp-app/model-context.d.ts +29 -0
- package/dist/mcp-app/node-app-discovery-fs.d.ts +23 -0
- package/dist/mcp-app/product-bundle-assets.d.ts +27 -0
- package/dist/mcp-app/product-bundle-loader.d.ts +53 -0
- package/dist/mcp-app/projection.d.ts +14 -0
- package/dist/mcp-app/prompt-cards.d.ts +28 -0
- package/dist/mcp-app/registry.d.ts +28 -0
- package/dist/mcp-app/skill-backend.d.ts +141 -0
- package/dist/mcp-app/state-set.d.ts +9 -0
- package/dist/mcp-app/types.d.ts +501 -0
- package/dist/mcp-app/view-call.d.ts +7 -0
- package/dist/mcp-app/workspace-app-assets.d.ts +42 -0
- package/dist/mcp-app/workspace-app-scan-cache.d.ts +27 -0
- package/dist/mcp-app/workspace-snapshot.d.ts +81 -0
- package/dist/migrations/0011_far_black_tarantula.sql +1 -0
- package/dist/migrations/0012_blue_turbo.sql +23 -0
- package/dist/migrations/0013_hesitant_adam_destine.sql +15 -0
- package/dist/migrations/0014_organic_mongu.sql +73 -0
- package/dist/migrations/0015_panoramic_gorilla_man.sql +71 -0
- package/dist/migrations/0016_fuzzy_hemingway.sql +14 -0
- package/dist/migrations/0017_project_stage_sdk_migration.sql +29 -0
- package/dist/migrations/0018_bored_jackal.sql +33 -0
- package/dist/migrations/0019_backfill_task_thread_ids.sql +74 -0
- package/dist/migrations/0020_useful_iron_lad.sql +55 -0
- package/dist/migrations/0021_dashing_peter_quill.sql +51 -0
- package/dist/migrations/0022_wandering_bucky.sql +1 -0
- package/dist/migrations/0023_red_payback.sql +1 -0
- package/dist/migrations/0024_storage_metadata.sql +262 -0
- package/dist/migrations/0025_task_heartbeat.sql +8 -0
- package/dist/migrations/0025_thread_app_instance_ledger.sql +2 -0
- package/dist/migrations/0026_mcp_action_source.sql +47 -0
- package/dist/migrations/0027_task_stop_scope_cleanup.sql +5 -0
- package/dist/migrations/0027_ui_instance_active_unique.sql +2 -0
- package/dist/migrations/0029_nice_rhino.sql +1 -0
- package/dist/migrations/0031_petite_arclight.sql +6 -0
- package/dist/migrations/0032_ui_instance_opened_by.sql +1 -0
- package/dist/migrations/0033_thread_creator_boundary_guard.sql +38 -0
- package/dist/migrations/0034_keen_fallen_one.sql +36 -0
- package/dist/migrations/0035_request_log_daily.sql +11 -0
- package/dist/migrations/0036_ui_definition_archive.sql +8 -0
- package/dist/migrations/0037_ui_instance_agent_open_request.sql +1 -0
- package/dist/migrations/0038_task_rating.sql +3 -0
- package/dist/migrations/0039_aspiring_purifiers.sql +9 -0
- package/dist/migrations/0040_task_provider_inputs.sql +53 -0
- package/dist/migrations/0041_tranquil_vivisector.sql +54 -0
- package/dist/migrations/0042_breezy_blue_shield.sql +31 -0
- package/dist/migrations/0043_nervous_darkstar.sql +1 -0
- package/dist/migrations/0044_military_galactus.sql +8 -0
- package/dist/migrations/0045_task_pid_started_at.sql +1 -0
- package/dist/migrations/0046_acoustic_karnak.sql +49 -0
- package/dist/migrations/0047_doc_sync_connect_requests.sql +18 -0
- package/dist/migrations/0048_smart_gertrude_yorkes.sql +47 -0
- package/dist/migrations/0049_blue_sleepwalker.sql +25 -0
- package/dist/migrations/0050_rapid_black_cat.sql +89 -0
- package/dist/migrations/0051_lying_sinister_six.sql +1 -0
- package/dist/migrations/0052_lying_gambit.sql +33 -0
- package/dist/migrations/0053_smart_shriek.sql +172 -0
- package/dist/migrations/0054_lying_surge.sql +63 -0
- package/dist/migrations/0055_curious_talkback.sql +92 -0
- package/dist/migrations/0056_stale_menace.sql +14 -0
- package/dist/migrations/0057_eager_captain_flint.sql +18 -0
- package/dist/migrations/meta/0011_snapshot.json +1342 -0
- package/dist/migrations/meta/0012_snapshot.json +1494 -0
- package/dist/migrations/meta/0013_snapshot.json +1592 -0
- package/dist/migrations/meta/0014_snapshot.json +1975 -0
- package/dist/migrations/meta/0015_snapshot.json +2315 -0
- package/dist/migrations/meta/0016_snapshot.json +2419 -0
- package/dist/migrations/meta/0017_snapshot.json +2419 -0
- package/dist/migrations/meta/0018_snapshot.json +2570 -0
- package/dist/migrations/meta/0020_snapshot.json +2895 -0
- package/dist/migrations/meta/0021_snapshot.json +3031 -0
- package/dist/migrations/meta/0022_snapshot.json +3039 -0
- package/dist/migrations/meta/0023_snapshot.json +3047 -0
- package/dist/migrations/meta/0029_snapshot.json +3206 -0
- package/dist/migrations/meta/0031_snapshot.json +3251 -0
- package/dist/migrations/meta/0034_snapshot.json +3473 -0
- package/dist/migrations/meta/0035_snapshot.json +3547 -0
- package/dist/migrations/meta/0036_snapshot.json +3591 -0
- package/dist/migrations/meta/0037_snapshot.json +3598 -0
- package/dist/migrations/meta/0038_snapshot.json +3626 -0
- package/dist/migrations/meta/0039_snapshot.json +3684 -0
- package/dist/migrations/meta/0040_snapshot.json +3759 -0
- package/dist/migrations/meta/0041_snapshot.json +4156 -0
- package/dist/migrations/meta/0042_snapshot.json +4383 -0
- package/dist/migrations/meta/0043_snapshot.json +4390 -0
- package/dist/migrations/meta/0044_snapshot.json +4435 -0
- package/dist/migrations/meta/0045_snapshot.json +4442 -0
- package/dist/migrations/meta/0046_snapshot.json +4733 -0
- package/dist/migrations/meta/0047_snapshot.json +4832 -0
- package/dist/migrations/meta/0048_snapshot.json +5128 -0
- package/dist/migrations/meta/0049_snapshot.json +5165 -0
- package/dist/migrations/meta/0050_snapshot.json +5717 -0
- package/dist/migrations/meta/0051_snapshot.json +5725 -0
- package/dist/migrations/meta/0052_snapshot.json +5930 -0
- package/dist/migrations/meta/0053_snapshot.json +6780 -0
- package/dist/migrations/meta/0054_snapshot.json +6784 -0
- package/dist/migrations/meta/0055_snapshot.json +6896 -0
- package/dist/migrations/meta/0056_snapshot.json +6971 -0
- package/dist/migrations/meta/0057_snapshot.json +6971 -0
- package/dist/migrations/meta/_journal.json +329 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +2 -0
- package/dist/paths.d.ts +1 -0
- package/dist/plugin/types.d.ts +1 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +569 -219
- package/dist/plugins/sqlite-tracing.d.ts +46 -0
- package/dist/process/index.d.ts +2 -0
- package/dist/process/index.js +1 -0
- package/dist/process/process-control.d.ts +74 -0
- package/dist/prompt/tag-names.d.ts +22 -0
- package/dist/provider/acp/adapter.d.ts +37 -2
- package/dist/provider/acp/adapters/antigravity-account.d.ts +4 -0
- package/dist/provider/acp/completion-observer.d.ts +24 -0
- package/dist/provider/acp/connection.d.ts +69 -3
- package/dist/provider/acp/index.d.ts +3 -3
- package/dist/provider/acp/meta.d.ts +11 -0
- package/dist/provider/acp/register.d.ts +1 -0
- package/dist/provider/acp/runtime.d.ts +1 -0
- package/dist/provider/acp/types.d.ts +31 -4
- package/dist/provider/bridge.browser.d.ts +3 -0
- package/dist/provider/bridge.d.ts +28 -4
- package/dist/provider/classify-task-error.d.ts +2 -0
- package/dist/provider/claude-agent-env.d.ts +1 -0
- package/dist/provider/cli/adapter.types.d.ts +35 -7
- package/dist/provider/cli/adapters/agent-call.util.d.ts +1 -1
- package/dist/provider/cli/adapters/antigravity-stream.d.ts +27 -0
- package/dist/provider/cli/adapters/antigravity.d.ts +1 -0
- package/dist/provider/cli/adapters/cli-knob.util.d.ts +7 -0
- package/dist/provider/cli/adapters/codex-item.d.ts +1 -0
- package/dist/provider/cli/adapters/event-timestamp.util.d.ts +1 -0
- package/dist/provider/cli/adapters/grok.d.ts +2 -0
- package/dist/provider/cli/adapters/index.d.ts +5 -0
- package/dist/provider/cli/adapters/opencode-data-dir.d.ts +17 -0
- package/dist/provider/cli/adapters/opencode.d.ts +1 -0
- package/dist/provider/cli/builtin-allow.d.ts +6 -0
- package/dist/provider/cli/index.d.ts +3 -2
- package/dist/provider/cli/meta.d.ts +18 -1
- package/dist/provider/cli/protocol-envelope.d.ts +3 -0
- package/dist/provider/errors.d.ts +11 -1
- package/dist/provider/idle-watchdog.d.ts +19 -0
- package/dist/provider/model-ladder.d.ts +8 -0
- package/dist/provider/models.d.ts +17 -12
- package/dist/provider/order.d.ts +1 -1
- package/dist/provider/parse-usage.d.ts +6 -0
- package/dist/provider/provider-selection.d.ts +8 -0
- package/dist/provider/redact-technical-message.d.ts +1 -0
- package/dist/provider/safe-opencode-text.d.ts +2 -0
- package/dist/provider/task-error.types.d.ts +20 -0
- package/dist/provider-account/accounts.d.ts +15 -0
- package/dist/provider-account/antigravity-acp/auth.d.ts +29 -0
- package/dist/provider-account/antigravity-acp/browser.d.ts +4 -0
- package/dist/provider-account/antigravity-acp/install.d.ts +42 -0
- package/dist/provider-account/antigravity-acp/lease.d.ts +23 -0
- package/dist/provider-account/antigravity-acp/lifecycle.d.ts +76 -0
- package/dist/provider-account/antigravity-acp/manifest.d.ts +76 -0
- package/dist/provider-account/antigravity-acp/profile.d.ts +4 -0
- package/dist/provider-account/capabilities.d.ts +6 -0
- package/dist/provider-account/index.d.ts +13 -0
- package/dist/provider-account/registry.d.ts +30 -0
- package/dist/provider-account/types.d.ts +47 -0
- package/dist/publish/constants.d.ts +6 -0
- package/dist/publish/errors.d.ts +7 -0
- package/dist/publish/index.d.ts +55 -0
- package/dist/publish/index.js +2 -0
- package/dist/publish/manifest.d.ts +47 -0
- package/dist/publish/marketplace-api.constants.d.ts +1 -0
- package/dist/publish/pack.d.ts +6 -0
- package/dist/publish/scan.d.ts +10 -0
- package/dist/publish/secrets.d.ts +6 -0
- package/dist/publish/upload.d.ts +19 -0
- package/dist/remote/execution-profile.d.ts +9 -0
- package/dist/remote/index.d.ts +1 -0
- package/dist/remote/types.d.ts +28 -0
- package/dist/repository/agent-send-history.repository.d.ts +23 -0
- package/dist/repository/agent-suggestion.repository.d.ts +34 -0
- package/dist/repository/base-sqlite-repository.d.ts +1 -0
- package/dist/repository/common-code.repository.d.ts +45 -0
- package/dist/repository/db.d.ts +13 -1
- package/dist/repository/index.d.ts +62 -6
- package/dist/repository/index.js +828 -211
- package/dist/repository/logs-db.d.ts +12 -0
- package/dist/repository/notification.repository.d.ts +58 -0
- package/dist/repository/project.repository.d.ts +90 -0
- package/dist/repository/public-task-answer.d.ts +24 -0
- package/dist/repository/request-log-mover.d.ts +70 -0
- package/dist/repository/request-log.repository.d.ts +7 -3
- package/dist/repository/run-columns.d.ts +10 -0
- package/dist/repository/run-history.repository.d.ts +112 -0
- package/dist/repository/schedule-run.repository.d.ts +103 -0
- package/dist/repository/sidebar-tab.repository.d.ts +86 -0
- package/dist/repository/storage-metadata.repository.d.ts +64 -0
- package/dist/repository/task-log-migration.d.ts +74 -0
- package/dist/repository/task-log.repository.d.ts +47 -0
- package/dist/repository/task-status.d.ts +21 -0
- package/dist/repository/task.repository.d.ts +329 -8
- package/dist/repository/thread-history.repository.d.ts +193 -0
- package/dist/repository/thread-origin-verdict.d.ts +27 -0
- package/dist/repository/thread-title.types.d.ts +29 -0
- package/dist/repository/thread.repository.d.ts +134 -5
- package/dist/repository/usage-backfill.d.ts +62 -0
- package/dist/repository/usage-from-logs.d.ts +22 -0
- package/dist/repository/workflow-anchor-kinds.d.ts +4 -0
- package/dist/repository/workspace.repository.d.ts +3 -0
- package/dist/route/decide.d.ts +56 -0
- package/dist/route/eligibility.d.ts +11 -0
- package/dist/route/errors.d.ts +11 -0
- package/dist/route/index.d.ts +14 -0
- package/dist/route/runner.d.ts +15 -0
- package/dist/route/sqlite-store.d.ts +18 -0
- package/dist/route/store.d.ts +48 -0
- package/dist/route/strategies.d.ts +4 -0
- package/dist/route/types.d.ts +325 -0
- package/dist/schema/agent-send-history.d.ts +85 -0
- package/dist/schema/agent-suggestions.d.ts +199 -0
- package/dist/schema/app-sync.d.ts +2533 -0
- package/dist/schema/common-codes.d.ts +216 -0
- package/dist/schema/doc-create-dispatches.d.ts +101 -0
- package/dist/schema/doc-sync-connect-requests.d.ts +140 -0
- package/dist/schema/doc-sync-links.d.ts +556 -0
- package/dist/schema/index.d.ts +23 -0
- package/dist/schema/model-routes.d.ts +638 -0
- package/dist/schema/notifications.d.ts +303 -0
- package/dist/schema/projects.d.ts +610 -0
- package/dist/schema/request-log-daily.d.ts +151 -0
- package/dist/schema/run-column-backfill.d.ts +81 -0
- package/dist/schema/schedule-runs.d.ts +451 -0
- package/dist/schema/sidebar-tabs.d.ts +466 -0
- package/dist/schema/storage-metadata.d.ts +181 -0
- package/dist/schema/task-log-events.d.ts +119 -0
- package/dist/schema/task-provider-inputs.d.ts +100 -0
- package/dist/schema/tasks.d.ts +1172 -1
- package/dist/schema/thread-creator-unverified.d.ts +45 -0
- package/dist/schema/thread-history.d.ts +734 -0
- package/dist/schema/threads.d.ts +59 -0
- package/dist/schema/ui-action-receipts.d.ts +358 -0
- package/dist/schema/ui-definition-archive.d.ts +63 -0
- package/dist/schema/ui-instance-repins.d.ts +222 -0
- package/dist/schema/ui-instances.d.ts +324 -0
- package/dist/schema/workspaces.d.ts +17 -0
- package/dist/skills/index.d.ts +15 -0
- package/dist/skills/index.js +2 -0
- package/dist/skills/types.d.ts +18 -0
- package/dist/task-log/anchor-child-tasks.d.ts +7 -0
- package/dist/task-log/delegation-trailer.d.ts +34 -0
- package/dist/template/engine.d.ts +2 -2
- package/dist/template/helpers/exec.browser.d.ts +4 -3
- package/dist/template/helpers/exec.d.ts +4 -3
- package/dist/template/helpers/format-conversation.d.ts +1 -0
- package/dist/template/types.d.ts +20 -0
- package/dist/testing/index.js +1 -1
- package/dist/types/index.d.ts +3285 -84
- package/dist/types/task-log.types.d.ts +6 -1
- package/dist/ui-card/index.d.ts +2 -0
- package/dist/ui-card/legacy-card-parser.d.ts +11 -0
- package/dist/ui-instance/definition.d.ts +6 -0
- package/dist/ui-instance/errors.d.ts +18 -0
- package/dist/ui-instance/index.d.ts +11 -0
- package/dist/ui-instance/json.d.ts +19 -0
- package/dist/ui-instance/lineage.d.ts +24 -0
- package/dist/ui-instance/runtime.d.ts +19 -0
- package/dist/ui-instance/store.d.ts +216 -0
- package/dist/ui-instance/types.d.ts +384 -0
- package/dist/ui-plugin/app-icon.d.ts +50 -0
- package/dist/ui-plugin/app-manifest.d.ts +64 -0
- package/dist/ui-plugin/csp.d.ts +28 -0
- package/dist/ui-plugin/index.d.ts +8 -0
- package/dist/ui-plugin/limits.d.ts +27 -0
- package/dist/ui-plugin/manifest.d.ts +3 -0
- package/dist/ui-plugin/types.d.ts +220 -0
- package/dist/ui-plugin/validator.d.ts +18 -0
- package/dist/utils/crewx-executable.d.ts +76 -0
- package/dist/utils/crewx-home.d.ts +1 -0
- package/dist/utils/env-defaults.d.ts +3 -0
- package/dist/utils/id.d.ts +1 -1
- package/dist/utils/local-identity.d.ts +2 -0
- package/dist/utils/runner-env.d.ts +3 -0
- package/dist/utils/timestamp.d.ts +1 -0
- package/dist/utils/workspace.d.ts +1 -0
- package/dist/wi/create.d.ts +48 -0
- package/dist/wi/select.d.ts +20 -0
- package/package.json +90 -3
- package/templates/agents/default.yaml +311 -128
- package/templates/documents/crewx-manual.md +138 -138
- package/templates/documents/crewx-quick-guide.md +8 -7
- package/templates/workflows/wi-default-flow.yaml +65 -0
- package/templates/workflows/wi-plan-flow.yaml +140 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type SqliteDatabase = import('better-sqlite3').Database;
|
|
2
|
+
export declare const LOGS_DB_FILE_NAME = "logs.db";
|
|
3
|
+
export declare const LOGS_DB_SCHEMA_VERSION = 1;
|
|
4
|
+
export declare function resolveCrewxLogsDbPath(crewxDbPath?: string): string;
|
|
5
|
+
export declare function hashRequestLogBody(body: string): string;
|
|
6
|
+
export interface LogsDbHandle {
|
|
7
|
+
readonly path: string;
|
|
8
|
+
readonly sqlite: SqliteDatabase;
|
|
9
|
+
close(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function openLogsDb(crewxDbPath?: string): LogsDbHandle;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
import { notifications, notification_reads } from '../schema/index.js';
|
|
3
|
+
export declare const DEFAULT_NOTIFICATION_CAP = 500;
|
|
4
|
+
export type NotificationRow = typeof notifications.$inferSelect;
|
|
5
|
+
export type NewNotification = typeof notifications.$inferInsert;
|
|
6
|
+
export type NotificationReadRow = typeof notification_reads.$inferSelect;
|
|
7
|
+
export type NotificationLevel = 'info' | 'warning' | 'critical';
|
|
8
|
+
export type NotificationSource = 'agent' | 'system';
|
|
9
|
+
export interface CreateNotificationInput {
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
agentId?: string | null;
|
|
12
|
+
taskId?: string | null;
|
|
13
|
+
threadId?: string | null;
|
|
14
|
+
source?: NotificationSource;
|
|
15
|
+
level?: NotificationLevel;
|
|
16
|
+
title: string;
|
|
17
|
+
body?: string | null;
|
|
18
|
+
targetUserId?: string | null;
|
|
19
|
+
metadata?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface NotificationListItem extends NotificationRow {
|
|
22
|
+
read: boolean;
|
|
23
|
+
read_at: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface ListNotificationsParams {
|
|
26
|
+
workspaceId: string;
|
|
27
|
+
userId: string;
|
|
28
|
+
limit?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface UserScope {
|
|
31
|
+
workspaceId: string;
|
|
32
|
+
userId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface MarkReadParams {
|
|
35
|
+
notificationId: string;
|
|
36
|
+
workspaceId: string;
|
|
37
|
+
userId: string;
|
|
38
|
+
}
|
|
39
|
+
export declare const DEFAULT_LIST_LIMIT = 50;
|
|
40
|
+
export declare class NotificationRepository extends BaseSqliteRepository {
|
|
41
|
+
private readonly dbPath?;
|
|
42
|
+
private readonly cap;
|
|
43
|
+
constructor(opts?: {
|
|
44
|
+
dbPath?: string;
|
|
45
|
+
dbRoot?: string;
|
|
46
|
+
cap?: number;
|
|
47
|
+
});
|
|
48
|
+
resolveDbPath(): string;
|
|
49
|
+
private openHandle;
|
|
50
|
+
create(input: CreateNotificationInput): {
|
|
51
|
+
id: string;
|
|
52
|
+
};
|
|
53
|
+
private enforceCap;
|
|
54
|
+
list(params: ListNotificationsParams): NotificationListItem[];
|
|
55
|
+
unreadCount(params: UserScope): number;
|
|
56
|
+
markRead(params: MarkReadParams): boolean;
|
|
57
|
+
markAllRead(params: UserScope): number;
|
|
58
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
import type { Project as ProjectLedgerRow, ProjectCriterion as ProjectCriterionRow, ProjectEvent as ProjectEventRow } from '../schema/index.js';
|
|
3
|
+
export type ProjectScene = 'planning' | 'plan_review' | 'running' | 'human_wait' | 'limit_wait' | 'failed_stop' | 'analyzing_feedback' | 'replanned' | 'awaiting_review' | 'accepted';
|
|
4
|
+
export type CriterionVerifyStatus = 'pending' | 'verifying' | 'passed' | 'failed';
|
|
5
|
+
export type ProjectActorType = 'user' | 'project_manager' | 'system';
|
|
6
|
+
export type ProjectEventType = 'created' | 'plan_proposed' | 'plan_approved' | 'decision_requested' | 'decision_answered' | 'replanned' | 'stage_advanced' | 'criterion_verified' | 'scene_changed' | 'result_submitted' | 'accepted';
|
|
7
|
+
export type ProjectEvidenceKind = 'task' | 'wi' | 'url';
|
|
8
|
+
export interface ProjectStage {
|
|
9
|
+
key: string;
|
|
10
|
+
labelOverride: string | null;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_PROJECT_STAGE_KEYS: readonly ["outcome_plan", "contract_check", "feature_link", "use_verify", "result_review"];
|
|
13
|
+
export declare const DEFAULT_PROJECT_STAGES: readonly ProjectStage[];
|
|
14
|
+
export interface ProjectEvidence {
|
|
15
|
+
kind: ProjectEvidenceKind;
|
|
16
|
+
ref: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ProjectActorInput {
|
|
20
|
+
actorType?: ProjectActorType;
|
|
21
|
+
actorId?: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface CreateProjectInput {
|
|
24
|
+
workspaceId: string;
|
|
25
|
+
name: string;
|
|
26
|
+
outcome: string;
|
|
27
|
+
dueDate?: string | null;
|
|
28
|
+
stages?: readonly ProjectStage[];
|
|
29
|
+
criteria: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
export interface ListProjectsOptions {
|
|
32
|
+
includeArchived?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface ListProjectEventsOptions {
|
|
35
|
+
afterSeq?: number;
|
|
36
|
+
limit?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface AppendProjectEventInput extends ProjectActorInput {
|
|
39
|
+
projectId: string;
|
|
40
|
+
type: ProjectEventType;
|
|
41
|
+
title: string;
|
|
42
|
+
summary?: string | null;
|
|
43
|
+
payload?: Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
export interface SetCriterionVerifyInput extends ProjectActorInput {
|
|
46
|
+
projectId?: string;
|
|
47
|
+
criterionId: string;
|
|
48
|
+
verifyStatus?: CriterionVerifyStatus;
|
|
49
|
+
status?: CriterionVerifyStatus;
|
|
50
|
+
}
|
|
51
|
+
export interface SetCriterionEvidenceInput extends ProjectActorInput {
|
|
52
|
+
projectId?: string;
|
|
53
|
+
criterionId: string;
|
|
54
|
+
evidence: readonly ProjectEvidence[];
|
|
55
|
+
}
|
|
56
|
+
export interface AcceptProjectInput extends ProjectActorInput {
|
|
57
|
+
remainingRisks: unknown;
|
|
58
|
+
nextPlan: unknown;
|
|
59
|
+
lessons: unknown;
|
|
60
|
+
evidenceRefs: unknown;
|
|
61
|
+
}
|
|
62
|
+
export interface ProjectDetail extends ProjectLedgerRow {
|
|
63
|
+
stages: ProjectStage[];
|
|
64
|
+
criteria: ProjectCriterionRow[];
|
|
65
|
+
}
|
|
66
|
+
export declare class ProjectRepository extends BaseSqliteRepository {
|
|
67
|
+
private readonly dbPath?;
|
|
68
|
+
constructor(opts?: {
|
|
69
|
+
dbPath?: string;
|
|
70
|
+
dbRoot?: string;
|
|
71
|
+
});
|
|
72
|
+
resolveDbPath(): string;
|
|
73
|
+
private openHandle;
|
|
74
|
+
private getDetailFromHandle;
|
|
75
|
+
private getDetailOrThrow;
|
|
76
|
+
createProject(input: CreateProjectInput): ProjectDetail;
|
|
77
|
+
getProject(id: string): ProjectDetail | undefined;
|
|
78
|
+
listProjectsByWorkspace(workspaceId: string, options?: ListProjectsOptions): ProjectDetail[];
|
|
79
|
+
archiveProject(id: string): ProjectDetail;
|
|
80
|
+
setScene(id: string, scene: ProjectScene, actor?: ProjectActorInput): ProjectDetail;
|
|
81
|
+
setStageIndex(id: string, index: number, actor?: ProjectActorInput): ProjectDetail;
|
|
82
|
+
setCriterionVerify(input: SetCriterionVerifyInput): ProjectCriterionRow;
|
|
83
|
+
setCriterionVerify(projectId: string, criterionId: string, status: CriterionVerifyStatus, actor?: ProjectActorInput): ProjectCriterionRow;
|
|
84
|
+
setCriterionEvidence(input: SetCriterionEvidenceInput): ProjectCriterionRow;
|
|
85
|
+
setCriterionEvidence(projectId: string, criterionId: string, evidence: readonly ProjectEvidence[], actor?: ProjectActorInput): ProjectCriterionRow;
|
|
86
|
+
appendEvent(input: AppendProjectEventInput): ProjectEventRow;
|
|
87
|
+
appendEvent(projectId: string, input: Omit<AppendProjectEventInput, 'projectId'>): ProjectEventRow;
|
|
88
|
+
listEvents(projectId: string, options?: ListProjectEventsOptions): ProjectEventRow[];
|
|
89
|
+
acceptProject(id: string, input: AcceptProjectInput): ProjectDetail;
|
|
90
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TaskStatus } from './task-status.js';
|
|
2
|
+
export declare const UNREAD_PREVIEW_MAX_LENGTH = 120;
|
|
3
|
+
export interface PublicTaskAnswerInput {
|
|
4
|
+
result: string | null;
|
|
5
|
+
status: string;
|
|
6
|
+
error: string | null;
|
|
7
|
+
metadata: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface UnreadReplyCandidate {
|
|
10
|
+
id: string;
|
|
11
|
+
threadId: string;
|
|
12
|
+
completedAt: string;
|
|
13
|
+
status: TaskStatus;
|
|
14
|
+
result: string | null;
|
|
15
|
+
error: string | null;
|
|
16
|
+
metadata: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface UnreadReplySummary {
|
|
19
|
+
unreadCount: number;
|
|
20
|
+
unreadPreview: string | null;
|
|
21
|
+
}
|
|
22
|
+
export declare function publicTaskAnswerContent(task: PublicTaskAnswerInput): string;
|
|
23
|
+
export declare function toPreviewPlainText(content: string, maxLength?: number): string;
|
|
24
|
+
export declare function summarizeUnreadReplies(candidates: readonly UnreadReplyCandidate[]): UnreadReplySummary;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const REQUEST_LOG_MOVE_DEFAULT_BATCH_ROWS = 250;
|
|
2
|
+
export declare const REQUEST_LOG_MOVE_DEFAULT_BATCH_BYTES: number;
|
|
3
|
+
export declare const REQUEST_LOG_MOVE_CHECKPOINT_WAL_BYTES: number;
|
|
4
|
+
export declare const REQUEST_LOG_MOVE_CHECKPOINT_MIN_INTERVAL_MS = 5000;
|
|
5
|
+
export interface MoveRequestLogsProgress {
|
|
6
|
+
batches: number;
|
|
7
|
+
scannedRows: number;
|
|
8
|
+
movedRows: number;
|
|
9
|
+
bodiesAdded: number;
|
|
10
|
+
lastRowid: number;
|
|
11
|
+
elapsedMs: number;
|
|
12
|
+
deleteTxMs: number;
|
|
13
|
+
walBytes: number;
|
|
14
|
+
}
|
|
15
|
+
export interface MoveRequestLogsTestHooks {
|
|
16
|
+
afterRead?: (rows: ReadonlyArray<{
|
|
17
|
+
rowid: number;
|
|
18
|
+
id: string;
|
|
19
|
+
}>) => void;
|
|
20
|
+
afterLogsCommit?: (rows: ReadonlyArray<{
|
|
21
|
+
rowid: number;
|
|
22
|
+
id: string;
|
|
23
|
+
}>) => void;
|
|
24
|
+
}
|
|
25
|
+
export interface MoveRequestLogsOptions {
|
|
26
|
+
crewxDbPath?: string;
|
|
27
|
+
batchRows?: number;
|
|
28
|
+
batchBytes?: number;
|
|
29
|
+
maxBatches?: number;
|
|
30
|
+
maxMs?: number;
|
|
31
|
+
dryRun?: boolean;
|
|
32
|
+
checkpointWalBytes?: number;
|
|
33
|
+
checkpointMinIntervalMs?: number;
|
|
34
|
+
onProgress?: (progress: MoveRequestLogsProgress) => void;
|
|
35
|
+
testHooks?: MoveRequestLogsTestHooks;
|
|
36
|
+
}
|
|
37
|
+
export interface MoveRequestLogsResult {
|
|
38
|
+
crewxDbPath: string;
|
|
39
|
+
logsDbPath: string;
|
|
40
|
+
dryRun: boolean;
|
|
41
|
+
movedRows: number;
|
|
42
|
+
remainingRows: number;
|
|
43
|
+
bodiesAdded: number;
|
|
44
|
+
batches: number;
|
|
45
|
+
maxDeleteTxMs: number;
|
|
46
|
+
deleteTxMs: number[];
|
|
47
|
+
maxWalBytes: number;
|
|
48
|
+
checkpoints: number;
|
|
49
|
+
elapsedMs: number;
|
|
50
|
+
sliceLimitReached: boolean;
|
|
51
|
+
scan?: {
|
|
52
|
+
rows: number;
|
|
53
|
+
bodies: number;
|
|
54
|
+
bodyBytes: number;
|
|
55
|
+
distinctBodies: number;
|
|
56
|
+
distinctBodyBytes: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export declare function moveRequestLogsToLogsDb(opts?: MoveRequestLogsOptions): MoveRequestLogsResult;
|
|
60
|
+
export interface RequestLogsMoveStatus {
|
|
61
|
+
crewxDbPath: string;
|
|
62
|
+
logsDbPath: string;
|
|
63
|
+
crewxRows: number;
|
|
64
|
+
crewxFreelistPages: number;
|
|
65
|
+
logsRows: number | null;
|
|
66
|
+
logsBodies: number | null;
|
|
67
|
+
logsFileBytes: number;
|
|
68
|
+
logsWalBytes: number;
|
|
69
|
+
}
|
|
70
|
+
export declare function inspectRequestLogsMove(crewxDbPath?: string): RequestLogsMoveStatus;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
-
import { request_logs } from '../schema/index.js';
|
|
2
|
+
import type { request_logs } from '../schema/index.js';
|
|
3
3
|
export type RequestLogRow = typeof request_logs.$inferSelect;
|
|
4
4
|
export type NewRequestLog = typeof request_logs.$inferInsert;
|
|
5
5
|
export interface RequestLogEntry {
|
|
@@ -16,16 +16,20 @@ export interface RequestLogEntry {
|
|
|
16
16
|
userId?: string;
|
|
17
17
|
projectId?: string;
|
|
18
18
|
partitionKey?: string;
|
|
19
|
+
timestamp?: string;
|
|
19
20
|
metadata?: string;
|
|
20
21
|
}
|
|
21
22
|
export declare class RequestLogRepository extends BaseSqliteRepository {
|
|
22
23
|
private readonly dbPath?;
|
|
24
|
+
private writer?;
|
|
23
25
|
constructor(opts?: {
|
|
24
26
|
dbPath?: string;
|
|
25
27
|
dbRoot?: string;
|
|
26
28
|
});
|
|
27
29
|
resolveDbPath(): string;
|
|
28
|
-
|
|
30
|
+
resolveLogsDbPath(): string;
|
|
31
|
+
private ensureWriter;
|
|
29
32
|
bulkInsert(entries: RequestLogEntry[]): void;
|
|
30
|
-
|
|
33
|
+
private prepareRow;
|
|
34
|
+
close(): void;
|
|
31
35
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const RUN_COLUMNS_BACKFILL = "tasks_run_columns";
|
|
2
|
+
export declare const WORKFLOW_RUN_INDEX = "idx_tasks_workflow_run_id";
|
|
3
|
+
export declare const SCHEDULE_TASKS_INDEX = "idx_tasks_ws_schedule_started";
|
|
4
|
+
export declare const HUMAN_TASKS_INDEX = "idx_tasks_ws_human_started";
|
|
5
|
+
export declare const RUN_COLUMN_INDEXES: ReadonlyArray<{
|
|
6
|
+
name: string;
|
|
7
|
+
sql: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const SCHEDULED_TRIGGERS: readonly ["cron", "cron_manual"];
|
|
10
|
+
export declare function readScheduleIdFromMetadata(metadata: string | null | undefined): string | null;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
import type { ScheduleRunMode } from './schedule-run.repository.js';
|
|
3
|
+
import { type TaskStatus } from './task-status.js';
|
|
4
|
+
export type RunHistoryOrigin = 'all' | 'mine' | 'delegated' | 'scheduled' | 'workflow';
|
|
5
|
+
export type RunHistoryKind = 'task' | 'workflow' | 'schedule_run';
|
|
6
|
+
export type RunHistoryClass = 'mine' | 'delegated' | 'scheduled' | 'workflow' | 'system' | 'unknown';
|
|
7
|
+
export type RunHistoryTerminalReason = 'user_stop' | 'runner_lost' | 'launch_failed';
|
|
8
|
+
export interface RunHistoryQuery {
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
origin?: RunHistoryOrigin;
|
|
11
|
+
scheduleId?: string;
|
|
12
|
+
includeFrequentSuccess?: boolean;
|
|
13
|
+
agents?: readonly string[];
|
|
14
|
+
statuses?: readonly TaskStatus[];
|
|
15
|
+
q?: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
offset?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface RunHistoryRow {
|
|
20
|
+
kind: RunHistoryKind;
|
|
21
|
+
id: string;
|
|
22
|
+
origin: RunHistoryClass;
|
|
23
|
+
startedAt: string;
|
|
24
|
+
finishedAt: string | null;
|
|
25
|
+
durationMs: number | null;
|
|
26
|
+
status: TaskStatus;
|
|
27
|
+
terminalReason: RunHistoryTerminalReason | null;
|
|
28
|
+
agentId: string | null;
|
|
29
|
+
mode: ScheduleRunMode | null;
|
|
30
|
+
taskId: string | null;
|
|
31
|
+
scheduleId: string | null;
|
|
32
|
+
scheduleName: string | null;
|
|
33
|
+
builtinId: string | null;
|
|
34
|
+
workflowRunId: string | null;
|
|
35
|
+
highFrequency: boolean;
|
|
36
|
+
errorCode: string | null;
|
|
37
|
+
preview: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface RunHistoryPage {
|
|
40
|
+
rows: RunHistoryRow[];
|
|
41
|
+
total: number;
|
|
42
|
+
}
|
|
43
|
+
export interface ScheduleRunSummaryLastRun {
|
|
44
|
+
kind: 'task' | 'schedule_run';
|
|
45
|
+
id: string;
|
|
46
|
+
taskId: string | null;
|
|
47
|
+
status: TaskStatus;
|
|
48
|
+
startedAt: string;
|
|
49
|
+
finishedAt: string | null;
|
|
50
|
+
}
|
|
51
|
+
export interface ScheduleRunSummary {
|
|
52
|
+
lastRun: ScheduleRunSummaryLastRun | null;
|
|
53
|
+
succeededToday: number;
|
|
54
|
+
failedLast24h: number;
|
|
55
|
+
checkedAt: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ScheduleRunSummaryInput {
|
|
58
|
+
workspaceId: string;
|
|
59
|
+
scheduleIds: readonly string[];
|
|
60
|
+
timezoneBySchedule: Readonly<Record<string, string | undefined>>;
|
|
61
|
+
now: Date;
|
|
62
|
+
}
|
|
63
|
+
export interface FailedScheduleRunsSinceInput {
|
|
64
|
+
workspaceId: string;
|
|
65
|
+
since: Date;
|
|
66
|
+
}
|
|
67
|
+
export interface RunTaskIdsInput {
|
|
68
|
+
workspaceId: string;
|
|
69
|
+
taskIds: readonly string[];
|
|
70
|
+
}
|
|
71
|
+
export interface RunTaskListItemRow {
|
|
72
|
+
id: string;
|
|
73
|
+
model: string | null;
|
|
74
|
+
input_tokens: number | null;
|
|
75
|
+
output_tokens: number | null;
|
|
76
|
+
cost_usd: number | null;
|
|
77
|
+
thread_id: string | null;
|
|
78
|
+
metadata: string | null;
|
|
79
|
+
coding_agent_command: string | null;
|
|
80
|
+
caller_agent_id: string | null;
|
|
81
|
+
parent_agent_id: string | null;
|
|
82
|
+
}
|
|
83
|
+
export interface RunScheduleRunByTask {
|
|
84
|
+
taskId: string;
|
|
85
|
+
scheduleName: string | null;
|
|
86
|
+
builtinId: string | null;
|
|
87
|
+
}
|
|
88
|
+
export interface RunColumnBackfillInput {
|
|
89
|
+
batchSize?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface RunColumnBackfillResult {
|
|
92
|
+
scanned: number;
|
|
93
|
+
updated: number;
|
|
94
|
+
done: boolean;
|
|
95
|
+
indexesBuilt: string[];
|
|
96
|
+
}
|
|
97
|
+
export declare const RUN_HISTORY_PREVIEW_RAW_CHARS = 1000;
|
|
98
|
+
export declare class RunHistoryRepository extends BaseSqliteRepository {
|
|
99
|
+
private readonly dbPath?;
|
|
100
|
+
constructor(opts?: {
|
|
101
|
+
dbPath?: string;
|
|
102
|
+
dbRoot?: string;
|
|
103
|
+
});
|
|
104
|
+
resolveDbPath(): string;
|
|
105
|
+
private withReadable;
|
|
106
|
+
listRunHistory(query: RunHistoryQuery): RunHistoryPage;
|
|
107
|
+
getScheduleRunSummaries(input: ScheduleRunSummaryInput): Record<string, ScheduleRunSummary>;
|
|
108
|
+
countFailedScheduleRunsSince(input: FailedScheduleRunsSinceInput): number;
|
|
109
|
+
listTaskListItems(input: RunTaskIdsInput): RunTaskListItemRow[];
|
|
110
|
+
listScheduleRunsByTaskIds(input: RunTaskIdsInput): RunScheduleRunByTask[];
|
|
111
|
+
backfillRunColumns(input?: RunColumnBackfillInput): RunColumnBackfillResult;
|
|
112
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
export type ScheduleRunMode = 'command' | 'agent' | 'app';
|
|
3
|
+
export type ScheduleRunStatus = 'running' | 'success' | 'failed' | 'lost';
|
|
4
|
+
export interface ScheduleRun {
|
|
5
|
+
id: string;
|
|
6
|
+
scheduleId: string;
|
|
7
|
+
workspaceId: string;
|
|
8
|
+
mode: ScheduleRunMode;
|
|
9
|
+
trigger: string;
|
|
10
|
+
occurrenceKey: string | null;
|
|
11
|
+
taskId: string | null;
|
|
12
|
+
appId: string | null;
|
|
13
|
+
scheduleName: string | null;
|
|
14
|
+
builtinId: string | null;
|
|
15
|
+
command: string | null;
|
|
16
|
+
highFrequency: boolean;
|
|
17
|
+
status: ScheduleRunStatus;
|
|
18
|
+
errorCode: string | null;
|
|
19
|
+
exitCode: number | null;
|
|
20
|
+
signal: string | null;
|
|
21
|
+
startedAt: string;
|
|
22
|
+
finishedAt: string | null;
|
|
23
|
+
durationMs: number | null;
|
|
24
|
+
pid: number | null;
|
|
25
|
+
hostPid: number | null;
|
|
26
|
+
outputTail: string | null;
|
|
27
|
+
outputBytes: number | null;
|
|
28
|
+
outputTruncated: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface NewScheduleRun {
|
|
31
|
+
id: string;
|
|
32
|
+
scheduleId: string;
|
|
33
|
+
workspaceId: string;
|
|
34
|
+
mode: ScheduleRunMode;
|
|
35
|
+
trigger: string;
|
|
36
|
+
occurrenceKey?: string | null;
|
|
37
|
+
taskId?: string | null;
|
|
38
|
+
appId?: string | null;
|
|
39
|
+
scheduleName?: string | null;
|
|
40
|
+
builtinId?: string | null;
|
|
41
|
+
command?: string | null;
|
|
42
|
+
highFrequency: boolean;
|
|
43
|
+
status: ScheduleRunStatus;
|
|
44
|
+
errorCode?: string | null;
|
|
45
|
+
startedAt: string;
|
|
46
|
+
finishedAt?: string | null;
|
|
47
|
+
durationMs?: number | null;
|
|
48
|
+
pid?: number | null;
|
|
49
|
+
hostPid?: number | null;
|
|
50
|
+
}
|
|
51
|
+
export interface ScheduleRunFinish {
|
|
52
|
+
status: 'success' | 'failed' | 'lost';
|
|
53
|
+
errorCode?: string | null;
|
|
54
|
+
exitCode?: number | null;
|
|
55
|
+
signal?: string | null;
|
|
56
|
+
finishedAt: string;
|
|
57
|
+
durationMs: number;
|
|
58
|
+
outputTail?: string | null;
|
|
59
|
+
outputBytes?: number | null;
|
|
60
|
+
outputTruncated?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface ScheduleRunListOptions {
|
|
63
|
+
scheduleId?: string;
|
|
64
|
+
mode?: ScheduleRunMode;
|
|
65
|
+
limit?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface ScheduleRunPruneResult {
|
|
68
|
+
deleted: number;
|
|
69
|
+
tailsCleared: number;
|
|
70
|
+
}
|
|
71
|
+
export interface ScheduleRunRepositoryInterface {
|
|
72
|
+
insert(run: NewScheduleRun): void;
|
|
73
|
+
finish(id: string, finish: ScheduleRunFinish): boolean;
|
|
74
|
+
markLost(id: string, finish: Omit<ScheduleRunFinish, 'status'>): boolean;
|
|
75
|
+
get(id: string): ScheduleRun | undefined;
|
|
76
|
+
listByWorkspace(workspaceId: string, options?: ScheduleRunListOptions): ScheduleRun[];
|
|
77
|
+
listBySchedule(workspaceId: string, scheduleId: string, limit?: number): ScheduleRun[];
|
|
78
|
+
listRunning(workspaceId: string): ScheduleRun[];
|
|
79
|
+
prune(workspaceId: string, now: Date): ScheduleRunPruneResult;
|
|
80
|
+
}
|
|
81
|
+
export declare const SCHEDULE_RUN_COMMAND_MAX_BYTES: number;
|
|
82
|
+
export declare const SCHEDULE_RUN_SUCCESS_RETENTION_MS: number;
|
|
83
|
+
export declare const SCHEDULE_RUN_FAILURE_RETENTION_MS: number;
|
|
84
|
+
export declare const SCHEDULE_RUN_SUCCESS_TAIL_KEEP = 20;
|
|
85
|
+
export declare const SCHEDULE_RUN_FAILURE_TAIL_KEEP = 50;
|
|
86
|
+
export declare class ScheduleRunRepository extends BaseSqliteRepository implements ScheduleRunRepositoryInterface {
|
|
87
|
+
private readonly dbPath?;
|
|
88
|
+
constructor(opts?: {
|
|
89
|
+
dbPath?: string;
|
|
90
|
+
dbRoot?: string;
|
|
91
|
+
});
|
|
92
|
+
resolveDbPath(): string;
|
|
93
|
+
private openWritable;
|
|
94
|
+
private withReadable;
|
|
95
|
+
insert(run: NewScheduleRun): void;
|
|
96
|
+
finish(id: string, finish: ScheduleRunFinish): boolean;
|
|
97
|
+
markLost(id: string, finish: Omit<ScheduleRunFinish, 'status'>): boolean;
|
|
98
|
+
get(id: string): ScheduleRun | undefined;
|
|
99
|
+
listByWorkspace(workspaceId: string, options?: ScheduleRunListOptions): ScheduleRun[];
|
|
100
|
+
listBySchedule(workspaceId: string, scheduleId: string, limit?: number): ScheduleRun[];
|
|
101
|
+
listRunning(workspaceId: string): ScheduleRun[];
|
|
102
|
+
prune(workspaceId: string, now: Date): ScheduleRunPruneResult;
|
|
103
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
import { RepositoryError } from './errors.js';
|
|
3
|
+
import type { SidebarGroupColor } from '../schema/index.js';
|
|
4
|
+
export declare const SIDEBAR_CLOSED_TAB_LIMIT = 20;
|
|
5
|
+
export declare const SIDEBAR_CLOSED_TAB_TTL_MS: number;
|
|
6
|
+
export type SidebarTabErrorReason = 'NOT_FOUND' | 'INVALID_INPUT' | 'NOT_INITIALIZED';
|
|
7
|
+
export declare class SidebarTabRepositoryError extends RepositoryError {
|
|
8
|
+
readonly reason: SidebarTabErrorReason;
|
|
9
|
+
constructor(reason: SidebarTabErrorReason, message?: string, cause?: unknown);
|
|
10
|
+
}
|
|
11
|
+
export interface SidebarGroupSnapshot {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
color: SidebarGroupColor;
|
|
15
|
+
collapsed: boolean;
|
|
16
|
+
threadIds: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface SidebarSnapshot {
|
|
19
|
+
revision: number;
|
|
20
|
+
railCollapsed: boolean;
|
|
21
|
+
pinned: string[];
|
|
22
|
+
groups: SidebarGroupSnapshot[];
|
|
23
|
+
ungrouped: string[];
|
|
24
|
+
closedCount: number;
|
|
25
|
+
closedNextExpiryAt: string | null;
|
|
26
|
+
reads: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
export interface InitSidebarResult {
|
|
29
|
+
created: boolean;
|
|
30
|
+
snapshot: SidebarSnapshot;
|
|
31
|
+
}
|
|
32
|
+
export interface OpenSidebarTabOptions {
|
|
33
|
+
groupId?: string;
|
|
34
|
+
beforeThreadId?: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface MoveSidebarTabInput {
|
|
37
|
+
section: 'pinned' | 'group' | 'ungrouped';
|
|
38
|
+
groupId?: string;
|
|
39
|
+
beforeThreadId: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface CreateSidebarGroupInput {
|
|
42
|
+
threadId: string;
|
|
43
|
+
color: SidebarGroupColor;
|
|
44
|
+
name?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface UpdateSidebarGroupPatch {
|
|
47
|
+
name?: string;
|
|
48
|
+
color?: SidebarGroupColor;
|
|
49
|
+
collapsed?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface ReopenSidebarTabResult {
|
|
52
|
+
threadId: string | null;
|
|
53
|
+
snapshot: SidebarSnapshot;
|
|
54
|
+
}
|
|
55
|
+
export interface CreateSidebarGroupResult {
|
|
56
|
+
groupId: string;
|
|
57
|
+
snapshot: SidebarSnapshot;
|
|
58
|
+
}
|
|
59
|
+
export interface MarkThreadReadResult {
|
|
60
|
+
readThroughAt: string;
|
|
61
|
+
}
|
|
62
|
+
export declare class SidebarTabRepository extends BaseSqliteRepository {
|
|
63
|
+
private readonly dbPath?;
|
|
64
|
+
private readonly clock;
|
|
65
|
+
constructor(opts?: {
|
|
66
|
+
dbPath?: string;
|
|
67
|
+
dbRoot?: string;
|
|
68
|
+
clock?: () => number;
|
|
69
|
+
});
|
|
70
|
+
resolveDbPath(): string;
|
|
71
|
+
private openHandle;
|
|
72
|
+
private write;
|
|
73
|
+
private command;
|
|
74
|
+
getSnapshot(workspaceId: string): SidebarSnapshot | null;
|
|
75
|
+
initIfAbsent(workspaceId: string, seedThreadIds: string[]): InitSidebarResult;
|
|
76
|
+
open(workspaceId: string, threadId: string, options?: OpenSidebarTabOptions): SidebarSnapshot;
|
|
77
|
+
close(workspaceId: string, threadId: string): SidebarSnapshot;
|
|
78
|
+
reopenLast(workspaceId: string): ReopenSidebarTabResult;
|
|
79
|
+
move(workspaceId: string, threadId: string, input: MoveSidebarTabInput): SidebarSnapshot;
|
|
80
|
+
createGroup(workspaceId: string, input: CreateSidebarGroupInput): CreateSidebarGroupResult;
|
|
81
|
+
updateGroup(workspaceId: string, groupId: string, patch: UpdateSidebarGroupPatch): SidebarSnapshot;
|
|
82
|
+
ungroup(workspaceId: string, groupId: string): SidebarSnapshot;
|
|
83
|
+
moveGroup(workspaceId: string, groupId: string, beforeGroupId: string | null): SidebarSnapshot;
|
|
84
|
+
setRailCollapsed(workspaceId: string, railCollapsed: boolean): SidebarSnapshot;
|
|
85
|
+
markRead(workspaceId: string, threadId: string, throughTaskId: string): MarkThreadReadResult;
|
|
86
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
export declare const STORAGE_METADATA_KINDS: readonly ["taskLogs", "requestLogs", "prompts", "threadsLedger", "tasksLedger"];
|
|
3
|
+
export declare const STORAGE_METADATA_UNITS: readonly ["task_log_events", "request_logs", "tasks", "threads"];
|
|
4
|
+
export type StorageMetadataKind = (typeof STORAGE_METADATA_KINDS)[number];
|
|
5
|
+
export type StorageMetadataUnit = (typeof STORAGE_METADATA_UNITS)[number];
|
|
6
|
+
export type StorageMetadataAge = 'over6m' | 'm3to6' | 'm1to3' | 'recent1m';
|
|
7
|
+
export interface StorageMetadataAggregateRow {
|
|
8
|
+
sourceKind: StorageMetadataKind;
|
|
9
|
+
age: StorageMetadataAge;
|
|
10
|
+
count: number;
|
|
11
|
+
bytes: number;
|
|
12
|
+
}
|
|
13
|
+
export interface StorageMetadataCutoffs {
|
|
14
|
+
cutoff6: string;
|
|
15
|
+
cutoff3: string;
|
|
16
|
+
cutoff1: string;
|
|
17
|
+
}
|
|
18
|
+
export interface StorageMetadataUnitReadiness {
|
|
19
|
+
cursorRowid: number;
|
|
20
|
+
endRowid: number | null;
|
|
21
|
+
complete: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface StorageMetadataReadiness {
|
|
24
|
+
ready: boolean;
|
|
25
|
+
units: Record<StorageMetadataUnit, StorageMetadataUnitReadiness>;
|
|
26
|
+
}
|
|
27
|
+
export interface StorageMetadataSnapshot {
|
|
28
|
+
readiness: StorageMetadataReadiness;
|
|
29
|
+
rows: StorageMetadataAggregateRow[];
|
|
30
|
+
}
|
|
31
|
+
export interface StorageMetadataBatchResult {
|
|
32
|
+
unit: StorageMetadataUnit | null;
|
|
33
|
+
rowsScanned: number;
|
|
34
|
+
rowsWritten: number;
|
|
35
|
+
cursorRowid: number;
|
|
36
|
+
complete: boolean;
|
|
37
|
+
ready: boolean;
|
|
38
|
+
elapsedMs: number;
|
|
39
|
+
}
|
|
40
|
+
export interface StorageMetadataVerificationMismatch {
|
|
41
|
+
sourceId: string;
|
|
42
|
+
metaBytes: number;
|
|
43
|
+
sourceBytes: number;
|
|
44
|
+
}
|
|
45
|
+
export declare class StorageMetadataRepository extends BaseSqliteRepository {
|
|
46
|
+
private readonly dbPath?;
|
|
47
|
+
constructor(opts?: {
|
|
48
|
+
dbPath?: string;
|
|
49
|
+
dbRoot?: string;
|
|
50
|
+
});
|
|
51
|
+
resolveDbPath(): string;
|
|
52
|
+
private hasReadableDatabase;
|
|
53
|
+
private openWritableDatabase;
|
|
54
|
+
private readReadiness;
|
|
55
|
+
private readAggregate;
|
|
56
|
+
getReadiness(): StorageMetadataReadiness;
|
|
57
|
+
aggregate(cutoffs: StorageMetadataCutoffs): StorageMetadataAggregateRow[];
|
|
58
|
+
readSnapshot(cutoffs: StorageMetadataCutoffs): StorageMetadataSnapshot;
|
|
59
|
+
runBackfillBatch(opts?: {
|
|
60
|
+
batchSize?: number;
|
|
61
|
+
unit?: StorageMetadataUnit;
|
|
62
|
+
}): StorageMetadataBatchResult;
|
|
63
|
+
verifySample(kind: StorageMetadataKind, limit: number): StorageMetadataVerificationMismatch[];
|
|
64
|
+
}
|