@crewx/sdk 0.9.0-rc.21 → 0.9.0-rc.210
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 +78 -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 +82 -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 +27 -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/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 +305 -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 +3161 -96
- 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,74 @@
|
|
|
1
|
+
export type TaskLogMigrationMode = 'dry-run' | 'apply' | 'verify';
|
|
2
|
+
export declare const TASK_LOG_MIGRATION_TERMINAL_STATUSES: readonly ["success", "failed", "completed"];
|
|
3
|
+
export declare const TASK_LOG_MIGRATION_MIN_FREE_SPACE_BYTES: number;
|
|
4
|
+
export declare const TASK_LOG_MIGRATION_EVENT_ROW_BYTES = 256;
|
|
5
|
+
export type TaskLogVerificationIssueKind = 'malformed-blob' | 'mixed-source' | 'seq-gap' | 'duplicate-seq' | 'orphan-event' | 'count-mismatch' | 'source-invariant' | 'invalid-event';
|
|
6
|
+
export type TaskLogMigrationFailureKind = 'malformed' | 'mixed-source' | 'metadata' | 'invalid-source';
|
|
7
|
+
export interface TaskLogMigrationOptions {
|
|
8
|
+
mode: TaskLogMigrationMode;
|
|
9
|
+
dbPath?: string;
|
|
10
|
+
batchTasks?: number;
|
|
11
|
+
backupPath?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TaskLogMigrationFailure {
|
|
14
|
+
taskId: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
kind?: TaskLogMigrationFailureKind;
|
|
17
|
+
}
|
|
18
|
+
export interface TaskLogVerificationIssue {
|
|
19
|
+
taskId: string | null;
|
|
20
|
+
kind: TaskLogVerificationIssueKind;
|
|
21
|
+
reason: string;
|
|
22
|
+
expected?: number;
|
|
23
|
+
actual?: number;
|
|
24
|
+
seq?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface TaskLogVerificationReport {
|
|
27
|
+
checkedTasks: number;
|
|
28
|
+
eventSourceTasks: number;
|
|
29
|
+
blobSourceTasks: number;
|
|
30
|
+
eventCount: number;
|
|
31
|
+
orphanEventCount: number;
|
|
32
|
+
failedTasks: number;
|
|
33
|
+
issues: TaskLogVerificationIssue[];
|
|
34
|
+
}
|
|
35
|
+
export interface TaskLogMigrationReport {
|
|
36
|
+
mode: TaskLogMigrationMode;
|
|
37
|
+
ok: boolean;
|
|
38
|
+
dbPath: string;
|
|
39
|
+
backupPath?: string;
|
|
40
|
+
backupMethod?: 'sqlite-online-backup';
|
|
41
|
+
blockedReason?: string;
|
|
42
|
+
activeTaskCount: number;
|
|
43
|
+
taskCount: number;
|
|
44
|
+
candidateTaskCount: number;
|
|
45
|
+
eligibleTaskCount: number;
|
|
46
|
+
statusCounts: Record<string, number>;
|
|
47
|
+
deferredTaskCount: number;
|
|
48
|
+
deferredStatusCounts: Record<string, number>;
|
|
49
|
+
entryCount: number;
|
|
50
|
+
sourceBytes: number;
|
|
51
|
+
estimatedFreeSpaceBytes: number;
|
|
52
|
+
requiredFreeSpaceBytes: number;
|
|
53
|
+
availableFreeSpaceBytes: number;
|
|
54
|
+
minimumFreeSpaceReserveBytes: number;
|
|
55
|
+
freeSpaceGatePassed: boolean;
|
|
56
|
+
migratedTasks: number;
|
|
57
|
+
migratedEntries: number;
|
|
58
|
+
skippedTasks: number;
|
|
59
|
+
failedTasks: number;
|
|
60
|
+
malformedRows: TaskLogMigrationFailure[];
|
|
61
|
+
failures: TaskLogMigrationFailure[];
|
|
62
|
+
logicalSourceBytesRemoved: number;
|
|
63
|
+
warnings: string[];
|
|
64
|
+
remainingTaskCount: number;
|
|
65
|
+
verification?: TaskLogVerificationReport;
|
|
66
|
+
}
|
|
67
|
+
export declare function resolveTaskLogMigrationDbPath(dbPath?: string): string;
|
|
68
|
+
export declare function hasSufficientTaskLogMigrationFreeSpace(availableFreeSpaceBytes: number, estimatedFreeSpaceBytes: number): boolean;
|
|
69
|
+
export interface TaskLogWalCheckpointConnection {
|
|
70
|
+
pragma(pragma: string): unknown;
|
|
71
|
+
}
|
|
72
|
+
export declare function tryCheckpointTaskLogWal(db: TaskLogWalCheckpointConnection): string | undefined;
|
|
73
|
+
export declare function runTaskLogMigration(options: TaskLogMigrationOptions): Promise<TaskLogMigrationReport>;
|
|
74
|
+
export declare function taskLogBackupName(backupPath: string): string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
export type TaskLogStorage = 'blob' | 'events';
|
|
3
|
+
export interface TaskLogEntry {
|
|
4
|
+
timestamp: string;
|
|
5
|
+
level: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
export type RawTaskLogEntry = TaskLogEntry;
|
|
9
|
+
export type TaskLogRawEntry = TaskLogEntry;
|
|
10
|
+
export interface TaskLogState {
|
|
11
|
+
taskId: string;
|
|
12
|
+
source: TaskLogStorage;
|
|
13
|
+
revision: number;
|
|
14
|
+
lastSeq: number;
|
|
15
|
+
}
|
|
16
|
+
export type TaskLogReadEntry = TaskLogEntry & {
|
|
17
|
+
readonly seq: number;
|
|
18
|
+
};
|
|
19
|
+
export interface TaskLogReadResult extends TaskLogState {
|
|
20
|
+
entries: TaskLogReadEntry[];
|
|
21
|
+
}
|
|
22
|
+
export interface TaskLogRepositoryContract {
|
|
23
|
+
appendLog(taskId: string, entry: TaskLogEntry): TaskLogState;
|
|
24
|
+
appendLogs(taskId: string, entries: readonly TaskLogEntry[]): TaskLogState;
|
|
25
|
+
readLogs(taskId: string): TaskLogReadResult | undefined;
|
|
26
|
+
readLogsTail(taskId: string, limit: number): TaskLogReadResult | undefined;
|
|
27
|
+
getLogState(taskId: string): TaskLogState | undefined;
|
|
28
|
+
}
|
|
29
|
+
export declare class TaskLogRepository extends BaseSqliteRepository implements TaskLogRepositoryContract {
|
|
30
|
+
private readonly dbPath?;
|
|
31
|
+
constructor(opts?: {
|
|
32
|
+
dbPath?: string;
|
|
33
|
+
dbRoot?: string;
|
|
34
|
+
});
|
|
35
|
+
resolveDbPath(): string;
|
|
36
|
+
private openHandle;
|
|
37
|
+
private findStateRow;
|
|
38
|
+
private findStateRowInTransaction;
|
|
39
|
+
private requireStateRowInTransaction;
|
|
40
|
+
appendLog(taskId: string, entry: TaskLogEntry): TaskLogState;
|
|
41
|
+
appendLogs(taskId: string, entries: readonly TaskLogEntry[]): TaskLogState;
|
|
42
|
+
getLogState(taskId: string): TaskLogState | undefined;
|
|
43
|
+
readLogs(taskId: string): TaskLogReadResult | undefined;
|
|
44
|
+
readLogsTail(taskId: string, limit: number): TaskLogReadResult | undefined;
|
|
45
|
+
readTail(taskId: string, limit: number): TaskLogReadResult | undefined;
|
|
46
|
+
private readLogsInternal;
|
|
47
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type TaskStatus = 'pending' | 'running' | 'paused' | 'success' | 'failed' | 'stopped';
|
|
2
|
+
export declare const TASK_TERMINAL_STATUSES: readonly ["success", "failed", "stopped"];
|
|
3
|
+
export declare const TASK_TERMINAL_STORED_STATUSES: readonly ["success", "completed", "done", "failed", "error", "stopped", "runner_lost"];
|
|
4
|
+
export declare function storedTaskStatusesFor(statuses: readonly string[]): string[];
|
|
5
|
+
export type TaskTerminalStatus = (typeof TASK_TERMINAL_STATUSES)[number];
|
|
6
|
+
export type TaskTerminalReason = 'user_stop' | 'runner_lost' | 'launch_failed';
|
|
7
|
+
export declare const LEGACY_TASK_TERMINAL_ERROR_PATTERNS: {
|
|
8
|
+
readonly stopped: RegExp;
|
|
9
|
+
readonly runnerLost: RegExp;
|
|
10
|
+
};
|
|
11
|
+
export interface TaskStatusInput {
|
|
12
|
+
status: string;
|
|
13
|
+
error?: string | null;
|
|
14
|
+
metadata?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function readTaskTerminalReason(row: TaskStatusInput): TaskTerminalReason | undefined;
|
|
17
|
+
export declare function normalizeTaskStatus(row: TaskStatusInput): TaskStatus;
|
|
18
|
+
export declare function normalizeTaskRow<T extends TaskStatusInput>(row: T): Omit<T, 'status'> & {
|
|
19
|
+
status: TaskStatus;
|
|
20
|
+
};
|
|
21
|
+
export declare function isTaskRetryableByDefault(row: TaskStatusInput): boolean;
|
|
@@ -1,21 +1,137 @@
|
|
|
1
1
|
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
import type { DrizzleDb } from './db.js';
|
|
3
|
+
import { RepositoryError } from './errors.js';
|
|
2
4
|
import { tasks } from '../schema/index.js';
|
|
3
|
-
|
|
5
|
+
import { type WorkflowAnchorTaskKind } from './workflow-anchor-kinds.js';
|
|
6
|
+
import { type ProcessControlOptions } from '../process/process-control.js';
|
|
7
|
+
import type { TaskLogEntry, TaskLogReadResult, TaskLogState } from './task-log.repository.js';
|
|
8
|
+
import { type TaskStatus, type TaskTerminalReason } from './task-status.js';
|
|
9
|
+
import { type StopTaskOptions, type StopTaskGenerationForInstructionOptions, type StopTaskResult } from '../lifecycle/task-stop.js';
|
|
10
|
+
export { TASK_HEARTBEAT_HARD_STALE_MS, TASK_HEARTBEAT_INTERVAL_MS, TASK_HEARTBEAT_STALE_MS, resolveTaskHeartbeatHardStaleMs, resolveTaskHeartbeatIntervalMs, resolveTaskHeartbeatStaleMs, } from '../lifecycle/task-heartbeat.js';
|
|
11
|
+
type RawTaskRow = Omit<typeof tasks.$inferSelect, 'security_key'>;
|
|
12
|
+
export type TaskRow = Omit<RawTaskRow, 'status'> & {
|
|
13
|
+
status: TaskStatus;
|
|
14
|
+
};
|
|
15
|
+
export interface ProviderInputRecord {
|
|
16
|
+
runEpoch: number;
|
|
17
|
+
input: string;
|
|
18
|
+
keyWrapSkipped: boolean;
|
|
19
|
+
recordedAt: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ProviderInputEpochEntry {
|
|
22
|
+
runEpoch: number;
|
|
23
|
+
available: boolean;
|
|
24
|
+
reason?: 'absent' | 'pruned';
|
|
25
|
+
keyWrapSkipped?: true;
|
|
26
|
+
}
|
|
4
27
|
export type NewTask = typeof tasks.$inferInsert;
|
|
5
|
-
|
|
28
|
+
type TaskActorKind = NonNullable<NewTask['actor_kind']>;
|
|
29
|
+
export type TaskKillStatus = 'terminated' | 'not_found' | 'failed' | 'not_running';
|
|
30
|
+
export interface TaskKillResult {
|
|
31
|
+
status: TaskKillStatus;
|
|
32
|
+
killed: boolean;
|
|
33
|
+
pid?: number;
|
|
34
|
+
error?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface TaskStopRequestResult {
|
|
37
|
+
accepted: boolean;
|
|
38
|
+
status: string | null;
|
|
39
|
+
runEpoch: number;
|
|
40
|
+
alreadyRequestedAt?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface TaskStopRequestReceipt {
|
|
43
|
+
taskId: string;
|
|
44
|
+
workspaceId: string | null;
|
|
45
|
+
sourceRunEpoch: number;
|
|
46
|
+
settleRunEpoch: number;
|
|
47
|
+
stopRequestedAt: string;
|
|
48
|
+
stopRequestedEpoch: number;
|
|
49
|
+
metadataBefore: string | null;
|
|
50
|
+
metadataAfter: string;
|
|
51
|
+
}
|
|
52
|
+
export type TaskStopOrigin = 'http' | 'cli' | 'instruction' | 'workflow' | 'internal';
|
|
53
|
+
export interface TaskStopRequestContext {
|
|
54
|
+
origin?: TaskStopOrigin;
|
|
55
|
+
at?: string;
|
|
56
|
+
callerPid?: number;
|
|
57
|
+
callerTaskId?: string;
|
|
58
|
+
}
|
|
59
|
+
export type TaskStopMethod = 'cooperative' | 'forced';
|
|
60
|
+
export interface FinalizeTaskStopOptions {
|
|
61
|
+
id: string;
|
|
62
|
+
runEpoch: number;
|
|
63
|
+
completedAt?: string;
|
|
64
|
+
method: TaskStopMethod;
|
|
65
|
+
error?: string;
|
|
66
|
+
terminalReason?: TaskTerminalReason;
|
|
67
|
+
durationMs?: number | null;
|
|
68
|
+
}
|
|
69
|
+
export interface FinalizeTaskForHostShutdownOptions {
|
|
70
|
+
id: string;
|
|
71
|
+
expectedRunEpoch: number;
|
|
72
|
+
workspaceId?: string | null;
|
|
73
|
+
completedAt?: string;
|
|
74
|
+
}
|
|
75
|
+
export type FinalizeTaskForHostShutdownOutcome = 'settled' | 'not_running' | 'epoch_mismatch' | 'workspace_mismatch';
|
|
76
|
+
export type TaskListRow = Pick<TaskRow, 'id' | 'thread_id' | 'agent_id' | 'status' | 'parent_task_id' | 'started_at' | 'completed_at' | 'duration_ms' | 'input_tokens' | 'output_tokens' | 'cost_usd' | 'error' | 'rating' | 'rated_at'> & {
|
|
77
|
+
terminalReason: TaskTerminalReason | null;
|
|
78
|
+
};
|
|
79
|
+
export type TaskActivityLogRow = Pick<TaskRow, 'id' | 'thread_id' | 'agent_id' | 'parent_task_id' | 'started_at' | 'completed_at'>;
|
|
80
|
+
export type FindTasksByThreadOptions = {
|
|
81
|
+
projection: 'activity-log';
|
|
82
|
+
};
|
|
83
|
+
export interface WorkflowCardRow {
|
|
84
|
+
taskId: string;
|
|
85
|
+
workflowRunId?: string;
|
|
86
|
+
raw?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface WorkflowParentTaskRow {
|
|
89
|
+
id: string;
|
|
90
|
+
agent_id: string;
|
|
91
|
+
thread_id: string | null;
|
|
92
|
+
workspace_id: string | null;
|
|
93
|
+
platform: string | null;
|
|
94
|
+
status: string;
|
|
95
|
+
error: string | null;
|
|
96
|
+
completed_at: string | null;
|
|
97
|
+
duration_ms: number | null;
|
|
98
|
+
started_at: string;
|
|
99
|
+
metadata: string | null;
|
|
100
|
+
}
|
|
101
|
+
export { WORKFLOW_ANCHOR_TASK_KINDS, isWorkflowAnchorTaskKind } from './workflow-anchor-kinds.js';
|
|
102
|
+
export type { WorkflowAnchorTaskKind } from './workflow-anchor-kinds.js';
|
|
103
|
+
export type WorkflowParentTaskKind = WorkflowAnchorTaskKind;
|
|
104
|
+
export interface WorkflowParentTaskLookup {
|
|
105
|
+
workspaceId: string;
|
|
106
|
+
workflowRunId: string;
|
|
107
|
+
kind: WorkflowParentTaskKind;
|
|
108
|
+
}
|
|
109
|
+
export interface AgentProviderUsageRow {
|
|
110
|
+
provider: string;
|
|
111
|
+
inputTokens: number;
|
|
112
|
+
outputTokens: number;
|
|
113
|
+
cachedInputTokens: number;
|
|
114
|
+
totalTokens: number;
|
|
115
|
+
costUsd: number;
|
|
116
|
+
totalTasks: number;
|
|
117
|
+
unavailableTaskCount: number;
|
|
118
|
+
}
|
|
6
119
|
export interface AgentUsageRow {
|
|
7
120
|
agentId: string;
|
|
8
121
|
workspaceId: string | null;
|
|
9
122
|
totalTasks: number;
|
|
123
|
+
unavailableTaskCount?: number;
|
|
10
124
|
inputTokens: number;
|
|
11
125
|
outputTokens: number;
|
|
12
126
|
cachedInputTokens: number;
|
|
13
127
|
costUsd: number;
|
|
14
128
|
totalTokens: number;
|
|
129
|
+
providers: AgentProviderUsageRow[];
|
|
15
130
|
}
|
|
16
131
|
export interface TrendRow {
|
|
17
132
|
date: string;
|
|
18
133
|
agentId: string;
|
|
134
|
+
unavailableTaskCount?: number;
|
|
19
135
|
inputTokens: number;
|
|
20
136
|
outputTokens: number;
|
|
21
137
|
cachedInputTokens: number;
|
|
@@ -25,6 +141,7 @@ export interface TrendRow {
|
|
|
25
141
|
export interface ProviderUsageRow {
|
|
26
142
|
provider: string;
|
|
27
143
|
totalTasks: number;
|
|
144
|
+
unavailableTaskCount?: number;
|
|
28
145
|
inputTokens: number;
|
|
29
146
|
outputTokens: number;
|
|
30
147
|
cachedInputTokens: number;
|
|
@@ -37,6 +154,7 @@ export interface ModelUsageRow {
|
|
|
37
154
|
model: string;
|
|
38
155
|
provider: string;
|
|
39
156
|
totalTasks: number;
|
|
157
|
+
unavailableTaskCount?: number;
|
|
40
158
|
inputTokens: number;
|
|
41
159
|
outputTokens: number;
|
|
42
160
|
cachedInputTokens: number;
|
|
@@ -52,20 +170,84 @@ export interface ReportTaskRow {
|
|
|
52
170
|
status: string;
|
|
53
171
|
error: string | null;
|
|
54
172
|
exitCode: number | null;
|
|
173
|
+
terminalReason: TaskTerminalReason | null;
|
|
174
|
+
}
|
|
175
|
+
export interface DelegationEdge {
|
|
176
|
+
callerAgentId: string | null;
|
|
177
|
+
agentId: string;
|
|
178
|
+
taskCount: number;
|
|
179
|
+
totalTokens: number;
|
|
180
|
+
outputTokens: number;
|
|
181
|
+
}
|
|
182
|
+
export interface DelegationMatrixResult {
|
|
183
|
+
edges: DelegationEdge[];
|
|
184
|
+
truncated: boolean;
|
|
185
|
+
}
|
|
186
|
+
export type TaskEvidenceRow = Pick<TaskRow, 'id' | 'agent_id' | 'status' | 'prompt' | 'started_at' | 'completed_at' | 'thread_id'> & {
|
|
187
|
+
terminalReason: TaskTerminalReason | null;
|
|
188
|
+
};
|
|
189
|
+
export interface ThreadChainTurn {
|
|
190
|
+
id: string;
|
|
191
|
+
agentId: string;
|
|
192
|
+
status: string;
|
|
193
|
+
prompt: string;
|
|
194
|
+
startedAt: string;
|
|
195
|
+
completedAt: string | null;
|
|
196
|
+
}
|
|
197
|
+
export interface ThreadChain {
|
|
198
|
+
threadId: string;
|
|
199
|
+
targetAgentTurnCount: number;
|
|
200
|
+
turns: ThreadChainTurn[];
|
|
55
201
|
}
|
|
202
|
+
export declare const CANONICAL_USER_STOP_ERROR = "Stopped by user";
|
|
203
|
+
export declare const HOST_SHUTDOWN_TERMINAL_ERROR = "Stopped by app shutdown";
|
|
204
|
+
type TaskUsageColumns = Pick<TaskRow, 'input_tokens' | 'output_tokens' | 'cached_input_tokens' | 'cost_usd'>;
|
|
205
|
+
export declare function mergeTerminalReason(metadataJson: string | null | undefined, reason: TaskTerminalReason): string;
|
|
206
|
+
export declare function hasRecordedUsage(task: TaskUsageColumns): boolean;
|
|
56
207
|
export declare const PID_NULL_REAP_GRACE_MS: number;
|
|
208
|
+
export declare const PENDING_ADOPT_GRACE_MS: number;
|
|
209
|
+
export declare const DEFAULT_TASK_REAPER_TICK_INTERVAL_MS: number;
|
|
210
|
+
export interface ReapOrphanedTasksOptions {
|
|
211
|
+
tickIntervalMs?: number;
|
|
212
|
+
}
|
|
57
213
|
export declare class TaskRepository extends BaseSqliteRepository {
|
|
58
214
|
private readonly dbPath?;
|
|
215
|
+
private readonly clock;
|
|
216
|
+
private readonly taskLogRepository;
|
|
217
|
+
private readonly processControl;
|
|
218
|
+
private lastReaperTickAt?;
|
|
219
|
+
private orphanReapInFlight?;
|
|
59
220
|
private readonly pidNullObservedSince;
|
|
60
221
|
constructor(opts?: {
|
|
61
222
|
dbPath?: string;
|
|
62
223
|
dbRoot?: string;
|
|
224
|
+
clock?: () => number;
|
|
225
|
+
processControl?: ProcessControlOptions;
|
|
63
226
|
});
|
|
64
227
|
resolveDbPath(): string;
|
|
65
228
|
private openHandle;
|
|
229
|
+
heartbeatTask(opts: {
|
|
230
|
+
id: string;
|
|
231
|
+
runEpoch: number;
|
|
232
|
+
}): boolean;
|
|
233
|
+
requestTaskStop(opts: {
|
|
234
|
+
id: string;
|
|
235
|
+
requestedAt: string;
|
|
236
|
+
origin?: TaskStopOrigin;
|
|
237
|
+
callerPid?: number;
|
|
238
|
+
callerTaskId?: string;
|
|
239
|
+
}): TaskStopRequestResult;
|
|
240
|
+
private requestTaskStopForInstruction;
|
|
241
|
+
finalizeTaskStop(opts: FinalizeTaskStopOptions): boolean;
|
|
242
|
+
finalizeTaskForHostShutdown(opts: FinalizeTaskForHostShutdownOptions): FinalizeTaskForHostShutdownOutcome;
|
|
243
|
+
stopTask(id: string, options?: StopTaskOptions): Promise<StopTaskResult>;
|
|
244
|
+
stopTaskGenerationForInstruction(options: StopTaskGenerationForInstructionOptions): Promise<StopTaskResult>;
|
|
66
245
|
startTask(opts: {
|
|
67
246
|
id: string;
|
|
68
247
|
agentId: string;
|
|
248
|
+
actorKind?: TaskActorKind | null;
|
|
249
|
+
actorId?: string | null;
|
|
250
|
+
userId?: string | null;
|
|
69
251
|
prompt: string;
|
|
70
252
|
mode: string;
|
|
71
253
|
status: string;
|
|
@@ -77,13 +259,38 @@ export declare class TaskRepository extends BaseSqliteRepository {
|
|
|
77
259
|
command?: string | null;
|
|
78
260
|
metadata?: string | null;
|
|
79
261
|
workspaceId?: string | null;
|
|
262
|
+
cwd?: string | null;
|
|
263
|
+
projectId?: string | null;
|
|
80
264
|
platform?: string | null;
|
|
81
265
|
crewxVersion?: string | null;
|
|
82
266
|
threadId?: string | null;
|
|
83
267
|
model?: string | null;
|
|
84
268
|
renderedPrompt?: string | null;
|
|
269
|
+
securityKey?: string | null;
|
|
85
270
|
codingAgentCommand?: string | null;
|
|
86
271
|
}): void;
|
|
272
|
+
recordTaskPid(opts: {
|
|
273
|
+
id: string;
|
|
274
|
+
runEpoch: number;
|
|
275
|
+
pid: number;
|
|
276
|
+
}): boolean;
|
|
277
|
+
updateTaskOwnership(opts: {
|
|
278
|
+
id: string;
|
|
279
|
+
runEpoch: number;
|
|
280
|
+
ownership: 'runner' | 'caller';
|
|
281
|
+
providerPid?: number | null;
|
|
282
|
+
runtime?: {
|
|
283
|
+
model?: string | null;
|
|
284
|
+
renderedPrompt?: string | null;
|
|
285
|
+
securityKey?: string | null;
|
|
286
|
+
codingAgentCommand?: string | null;
|
|
287
|
+
metadata?: Record<string, unknown>;
|
|
288
|
+
};
|
|
289
|
+
}): boolean;
|
|
290
|
+
adoptPendingTask(id: string): boolean;
|
|
291
|
+
failPendingTask(id: string, error: string, completedAt?: string): boolean;
|
|
292
|
+
stopPendingTask(id: string, error?: string, completedAt?: string, stopRequest?: TaskStopRequestContext): boolean;
|
|
293
|
+
listTasksByProjectId(projectId: string): TaskRow[];
|
|
87
294
|
finishTask(opts: {
|
|
88
295
|
id: string;
|
|
89
296
|
status: string;
|
|
@@ -96,22 +303,52 @@ export declare class TaskRepository extends BaseSqliteRepository {
|
|
|
96
303
|
outputTokens?: number;
|
|
97
304
|
cachedInputTokens?: number;
|
|
98
305
|
costUsd?: number;
|
|
306
|
+
usagePresent?: boolean;
|
|
307
|
+
usageComplete?: boolean;
|
|
99
308
|
model?: string | null;
|
|
100
309
|
runEpoch?: number | null;
|
|
310
|
+
partialResultRecovered?: boolean;
|
|
311
|
+
}): void;
|
|
312
|
+
updateTaskLifecycle(opts: {
|
|
313
|
+
id: string;
|
|
314
|
+
status: TaskStatus;
|
|
315
|
+
error: string | null;
|
|
316
|
+
completedAt: string | null;
|
|
317
|
+
durationMs: number | null;
|
|
318
|
+
workspaceId: string;
|
|
319
|
+
terminalReason?: TaskTerminalReason;
|
|
101
320
|
}): void;
|
|
102
321
|
appendLog(taskId: string, entry: {
|
|
103
322
|
timestamp: string;
|
|
104
323
|
level: string;
|
|
105
324
|
message: string;
|
|
106
325
|
}): void;
|
|
326
|
+
appendLogs(taskId: string, entries: readonly TaskLogEntry[]): void;
|
|
327
|
+
readLogs(taskId: string): TaskLogReadResult | undefined;
|
|
328
|
+
readLogsTail(taskId: string, limit: number): TaskLogReadResult | undefined;
|
|
329
|
+
getLogState(taskId: string): TaskLogState | undefined;
|
|
107
330
|
getRunningTasks(): TaskRow[];
|
|
331
|
+
getActiveTasks(): TaskRow[];
|
|
108
332
|
getAllTasks(): TaskRow[];
|
|
333
|
+
readTaskSecurityKey(id: string): string | null;
|
|
334
|
+
recordProviderInput(opts: {
|
|
335
|
+
id: string;
|
|
336
|
+
runEpoch: number;
|
|
337
|
+
input: string;
|
|
338
|
+
keyWrapSkipped: boolean;
|
|
339
|
+
interceptedRequest?: boolean;
|
|
340
|
+
recordedAt?: string;
|
|
341
|
+
}): boolean;
|
|
342
|
+
listProviderInputEpochs(id: string, opts?: {
|
|
343
|
+
archivedRunEpochs?: ReadonlySet<number>;
|
|
344
|
+
}): ProviderInputEpochEntry[];
|
|
345
|
+
readProviderInput(id: string, runEpoch: number): ProviderInputRecord | undefined;
|
|
109
346
|
getTask(id: string): TaskRow | undefined;
|
|
110
|
-
killTask(id: string):
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
347
|
+
killTask(id: string): Promise<TaskKillResult>;
|
|
348
|
+
reapOrphanedTasks(options?: ReapOrphanedTasksOptions): Promise<number>;
|
|
349
|
+
private runOrphanReaperPass;
|
|
350
|
+
private judgeRecordedTargets;
|
|
351
|
+
private terminateRecordedProcesses;
|
|
115
352
|
reapRunningWorkflowTasks(graceMs?: number): number;
|
|
116
353
|
findTaskStatus(taskId: string, workspaceId?: string): TaskRow | undefined;
|
|
117
354
|
findChildTasks(parentTaskId: string, workspaceId?: string): TaskRow[];
|
|
@@ -127,7 +364,14 @@ export declare class TaskRepository extends BaseSqliteRepository {
|
|
|
127
364
|
outputTokens: number;
|
|
128
365
|
costUsd: number;
|
|
129
366
|
};
|
|
367
|
+
findTasksByThread(threadId: string, workspaceId: string | undefined, options: FindTasksByThreadOptions): TaskActivityLogRow[];
|
|
130
368
|
findTasksByThread(threadId: string, workspaceId?: string): TaskRow[];
|
|
369
|
+
private parseWorkflowCardMetadata;
|
|
370
|
+
private extractThreadIdFromCommand;
|
|
371
|
+
findRunningWorkflowParentTasks(): WorkflowParentTaskRow[];
|
|
372
|
+
findWorkflowParentTasksByWorkspace(workspaceId: string): WorkflowParentTaskRow[];
|
|
373
|
+
findWorkflowParentTask(opts: WorkflowParentTaskLookup): WorkflowParentTaskRow | undefined;
|
|
374
|
+
batchFetchWorkflowCards(threadIds: string[], workspaceId?: string): Map<string, WorkflowCardRow>;
|
|
131
375
|
findAllTasks(params: {
|
|
132
376
|
workspaceId?: string;
|
|
133
377
|
agentId?: string;
|
|
@@ -148,9 +392,86 @@ export declare class TaskRepository extends BaseSqliteRepository {
|
|
|
148
392
|
getAgentUsage(from: string, to: string, workspace?: string): AgentUsageRow[];
|
|
149
393
|
getAgentUsageTrendRaw(from: string, to: string, workspace?: string): TrendRow[];
|
|
150
394
|
findTaskForStop(taskId: string, workspaceId: string): TaskRow | undefined;
|
|
151
|
-
|
|
395
|
+
findLatestTaskByMetadata(opts: {
|
|
396
|
+
agentId: string;
|
|
397
|
+
workspaceId: string;
|
|
398
|
+
metaKey: string;
|
|
399
|
+
metaValue: string;
|
|
400
|
+
}): {
|
|
401
|
+
id: string;
|
|
402
|
+
thread_id: string | null;
|
|
403
|
+
status: string;
|
|
404
|
+
result: string | null;
|
|
405
|
+
error: string | null;
|
|
406
|
+
started_at: string;
|
|
407
|
+
completed_at: string | null;
|
|
408
|
+
metadata: string | null;
|
|
409
|
+
} | null;
|
|
410
|
+
markTaskFailed(taskId: string, error: string, workspaceId?: string, status?: TaskStatus, terminalReason?: TaskTerminalReason): void;
|
|
152
411
|
findTasksByPromptHint(hint: string, workspaceId?: string): TaskRow[];
|
|
153
412
|
getProviderUsage(from: string, to: string, workspace?: string): ProviderUsageRow[];
|
|
154
413
|
getModelUsage(from: string, to: string, workspace?: string): ModelUsageRow[];
|
|
155
414
|
getTasksForReport(from: string, to: string, workspace?: string): ReportTaskRow[];
|
|
415
|
+
getDelegationMatrix(from: string, to: string, workspace?: string): DelegationMatrixResult;
|
|
416
|
+
findTaskEvidence(params: {
|
|
417
|
+
workspaceId?: string;
|
|
418
|
+
agents?: string[];
|
|
419
|
+
statuses?: string[];
|
|
420
|
+
from?: string;
|
|
421
|
+
to?: string;
|
|
422
|
+
limit?: number;
|
|
423
|
+
order?: 'ASC' | 'DESC';
|
|
424
|
+
}): TaskEvidenceRow[];
|
|
425
|
+
findThreadChains(params: {
|
|
426
|
+
targetAgentId: string;
|
|
427
|
+
workspaceId?: string;
|
|
428
|
+
from?: string;
|
|
429
|
+
to?: string;
|
|
430
|
+
maxThreads?: number;
|
|
431
|
+
maxTurnsPerThread?: number;
|
|
432
|
+
}): ThreadChain[];
|
|
433
|
+
}
|
|
434
|
+
export declare const TASK_RATINGS: readonly ["up", "down"];
|
|
435
|
+
export type TaskRating = (typeof TASK_RATINGS)[number];
|
|
436
|
+
export declare const RATED_TASK_EXCERPT_MAX_CHARS = 1000;
|
|
437
|
+
export declare const RATED_TASK_LIST_MAX_LIMIT = 200;
|
|
438
|
+
export type TaskRatingErrorCode = 'TASK_NOT_FOUND' | 'TASK_RATING_NOT_TERMINAL';
|
|
439
|
+
export declare class TaskRatingError extends RepositoryError {
|
|
440
|
+
readonly stableCode: TaskRatingErrorCode;
|
|
441
|
+
readonly taskId: string;
|
|
442
|
+
constructor(stableCode: TaskRatingErrorCode, taskId: string);
|
|
443
|
+
}
|
|
444
|
+
export interface SetTaskRatingInput {
|
|
445
|
+
workspaceId: string;
|
|
446
|
+
taskId: string;
|
|
447
|
+
rating: TaskRating | null;
|
|
448
|
+
now?: string;
|
|
449
|
+
}
|
|
450
|
+
export interface SetTaskRatingResult {
|
|
451
|
+
taskId: string;
|
|
452
|
+
rating: TaskRating | null;
|
|
453
|
+
ratedAt: string | null;
|
|
454
|
+
changed: boolean;
|
|
455
|
+
}
|
|
456
|
+
export declare function setTaskRating(db: DrizzleDb, input: SetTaskRatingInput): SetTaskRatingResult;
|
|
457
|
+
export interface ListRatedTasksInput {
|
|
458
|
+
workspaceId: string;
|
|
459
|
+
agentId?: string;
|
|
460
|
+
sinceIso?: string;
|
|
461
|
+
limit: number;
|
|
462
|
+
}
|
|
463
|
+
export interface RatedTaskRow {
|
|
464
|
+
taskId: string;
|
|
465
|
+
agentId: string;
|
|
466
|
+
threadId: string | null;
|
|
467
|
+
status: TaskStatus;
|
|
468
|
+
rating: TaskRating;
|
|
469
|
+
ratedAt: string;
|
|
470
|
+
promptExcerpt: string | null;
|
|
471
|
+
resultExcerpt: string | null;
|
|
156
472
|
}
|
|
473
|
+
export declare function buildRatedTasksQuery(input: ListRatedTasksInput): import("drizzle-orm").SQL<unknown>;
|
|
474
|
+
export declare function listRatedTasks(db: DrizzleDb, input: ListRatedTasksInput): RatedTaskRow[];
|
|
475
|
+
export type CountRatedTasksInput = Omit<ListRatedTasksInput, 'limit'>;
|
|
476
|
+
export declare function buildRatedTasksCountQuery(input: CountRatedTasksInput): import("drizzle-orm").SQL<unknown>;
|
|
477
|
+
export declare function countRatedTasks(db: DrizzleDb, input: CountRatedTasksInput): number;
|