@crewx/sdk 0.9.0-rc.18 → 0.9.0-rc.181
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 +167 -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-ui/index.d.ts +83 -0
- package/dist/app-ui/index.js +1 -0
- package/dist/boxing/box.types.d.ts +4 -0
- package/dist/config/canonicalize-agent-options.d.ts +18 -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 +37 -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-budget/continuity.d.ts +63 -0
- package/dist/context-budget/index.d.ts +142 -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 +58 -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/desktop/index.js +3 -0
- package/dist/esm/index.js +1311 -224
- package/dist/esm/node/index.js +2 -0
- package/dist/esm/plugins/index.js +532 -214
- package/dist/esm/process/index.js +1 -0
- package/dist/esm/publish/index.js +2 -0
- package/dist/esm/repository/index.js +792 -207
- package/dist/esm/skills/index.js +2 -0
- package/dist/esm/testing/index.js +1 -1
- package/dist/events/types.d.ts +29 -0
- package/dist/facade/Crewx.d.ts +70 -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/index.browser.d.ts +25 -1
- package/dist/index.browser.js +6 -2
- package/dist/index.d.ts +164 -17
- package/dist/index.js +1311 -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 +108 -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 +26 -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 +45 -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/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 +80 -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/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/_journal.json +259 -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 +532 -214
- 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/connection.d.ts +6 -0
- package/dist/provider/acp/meta.d.ts +11 -0
- package/dist/provider/bridge.browser.d.ts +2 -0
- package/dist/provider/bridge.d.ts +16 -2
- 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 +25 -2
- 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/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/index.d.ts +3 -2
- package/dist/provider/cli/meta.d.ts +5 -0
- package/dist/provider/cli/protocol-envelope.d.ts +3 -0
- package/dist/provider/errors.d.ts +5 -1
- package/dist/provider/idle-watchdog.d.ts +19 -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/task-error.types.d.ts +17 -0
- package/dist/provider-account/accounts.d.ts +15 -0
- package/dist/provider-account/index.d.ts +5 -0
- package/dist/provider-account/registry.d.ts +30 -0
- package/dist/provider-account/types.d.ts +40 -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 +792 -207
- 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 +320 -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/schema/agent-send-history.d.ts +85 -0
- package/dist/schema/agent-suggestions.d.ts +199 -0
- package/dist/schema/common-codes.d.ts +216 -0
- package/dist/schema/doc-sync-connect-requests.d.ts +140 -0
- package/dist/schema/doc-sync-links.d.ts +481 -0
- package/dist/schema/index.d.ts +20 -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 +1611 -3
- 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 +215 -0
- package/dist/ui-instance/types.d.ts +344 -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 +68 -3
- package/templates/agents/default.yaml +303 -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,83 @@
|
|
|
1
|
+
export interface AppUiToolCall {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly arguments?: Readonly<Record<string, unknown>>;
|
|
4
|
+
}
|
|
5
|
+
export interface AppUiCallOptions {
|
|
6
|
+
readonly timeout?: number;
|
|
7
|
+
readonly resetTimeoutOnProgress?: boolean;
|
|
8
|
+
readonly onprogress?: (progress: AppUiProgress) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface AppUiProgress {
|
|
11
|
+
readonly progress: number;
|
|
12
|
+
readonly total?: number;
|
|
13
|
+
readonly message?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface AppUiToolResult {
|
|
16
|
+
readonly isError?: boolean;
|
|
17
|
+
readonly structuredContent?: Readonly<Record<string, unknown>>;
|
|
18
|
+
}
|
|
19
|
+
export interface AppUiToolCaller {
|
|
20
|
+
callServerTool(params: AppUiToolCall, options?: AppUiCallOptions): Promise<AppUiToolResult>;
|
|
21
|
+
}
|
|
22
|
+
export declare class CrewxAppToolError extends Error {
|
|
23
|
+
readonly code: string;
|
|
24
|
+
constructor(code: string, message?: string);
|
|
25
|
+
}
|
|
26
|
+
export interface AppUiShareResult {
|
|
27
|
+
readonly shareId: string;
|
|
28
|
+
readonly url: string;
|
|
29
|
+
readonly revision: number;
|
|
30
|
+
readonly status: 'active';
|
|
31
|
+
readonly viewer: 'app' | 'markdown';
|
|
32
|
+
}
|
|
33
|
+
export interface AppUiFileItem {
|
|
34
|
+
readonly ref: string;
|
|
35
|
+
readonly version: string;
|
|
36
|
+
readonly bytes: number;
|
|
37
|
+
readonly modifiedAt: string;
|
|
38
|
+
}
|
|
39
|
+
export interface AppUiFilesListResult {
|
|
40
|
+
readonly items: readonly AppUiFileItem[];
|
|
41
|
+
readonly next: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface AppUiFileReadResult {
|
|
44
|
+
readonly ref: string;
|
|
45
|
+
readonly text: string;
|
|
46
|
+
readonly version: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AppUiFileWriteResult {
|
|
49
|
+
readonly ref: string;
|
|
50
|
+
readonly version: string;
|
|
51
|
+
}
|
|
52
|
+
export interface AppUiShareInput {
|
|
53
|
+
readonly ref: string;
|
|
54
|
+
readonly onprogress?: (progress: AppUiProgress) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface AppUiListFilesInput {
|
|
57
|
+
readonly prefix?: string;
|
|
58
|
+
readonly after?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface AppUiWriteFileInput {
|
|
61
|
+
readonly ref: string;
|
|
62
|
+
readonly text: string;
|
|
63
|
+
readonly expectedVersion: string | null;
|
|
64
|
+
}
|
|
65
|
+
export declare function share(app: AppUiToolCaller, input: AppUiShareInput): Promise<AppUiShareResult>;
|
|
66
|
+
export declare function listFiles(app: AppUiToolCaller, input?: AppUiListFilesInput): Promise<AppUiFilesListResult>;
|
|
67
|
+
export declare function readFile(app: AppUiToolCaller, input: {
|
|
68
|
+
readonly ref: string;
|
|
69
|
+
}): Promise<AppUiFileReadResult>;
|
|
70
|
+
export declare function writeFile(app: AppUiToolCaller, input: AppUiWriteFileInput): Promise<AppUiFileWriteResult>;
|
|
71
|
+
export declare const CREWX_DOCUMENT_CHANGED: "ui/notifications/crewx-document-changed";
|
|
72
|
+
export interface AppUiDocumentChanged {
|
|
73
|
+
readonly ref: string;
|
|
74
|
+
readonly version: string | null;
|
|
75
|
+
}
|
|
76
|
+
export interface AppUiNotification {
|
|
77
|
+
readonly method: string;
|
|
78
|
+
readonly params?: unknown;
|
|
79
|
+
}
|
|
80
|
+
export interface AppUiNotificationSource {
|
|
81
|
+
fallbackNotificationHandler?(notification: AppUiNotification): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
export declare function onDocumentChanged(app: AppUiNotificationSource, handler: (params: AppUiDocumentChanged) => void): () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var p=class extends Error{code;constructor(r,n=r){super(n),this.name="CrewxAppToolError",this.code=r;}},g=1200*1e3;function x(e,r){return d(e,{name:"crewx_docs_share",arguments:{ref:r.ref}},{timeout:g,resetTimeoutOnProgress:true,onprogress:r.onprogress??(()=>{})})}function C(e,r={}){return d(e,{name:"crewx_files_list",arguments:{...r}})}function R(e,r){return d(e,{name:"crewx_files_read",arguments:{ref:r.ref}})}function T(e,r){return d(e,{name:"crewx_files_write",arguments:{ref:r.ref,text:r.text,expectedVersion:r.expectedVersion}})}var m="ui/notifications/crewx-document-changed",A=/^sha256:[0-9a-f]{64}$/,l=new WeakMap;function w(e,r){let n=l.get(e)??y(e),t=i=>r(i);return n.listeners.add(t),()=>{n.listeners.delete(t),n.listeners.size===0&&l.get(e)===n&&(l.delete(e),e.fallbackNotificationHandler===n.dispatch&&(e.fallbackNotificationHandler=n.previous));}}function y(e){let r=e.fallbackNotificationHandler,n=new Set,t=async o=>{if(o.method!==m){await r?.call(e,o);return}let s=U(o.params);if(s===void 0)return;let a;for(let u of [...n])try{u(s);}catch(f){a??={error:f};}if(a!==void 0)throw a.error},i={listeners:n,previous:r,dispatch:t};return l.set(e,i),e.fallbackNotificationHandler=t,i}function U(e){if(!c(e))return;let r=e.ref,n=e.version;if(!(typeof r!="string"||r.length===0)&&!(n!==null&&(typeof n!="string"||!A.test(n))))return {ref:r,version:n}}async function d(e,r,n){let t=n===void 0?await e.callServerTool(r):await e.callServerTool(r,n);if(t.isError===true){let i=t.structuredContent?.error,o=c(i)?i:void 0,s=typeof o?.code=="string"?o.code:"TOOL_ERROR",a=typeof o?.message=="string"?o.message:s;throw new p(s,a)}if(!c(t.structuredContent))throw new p("TOOL_RESULT_INVALID",`${r.name} returned no structured result`);return t.structuredContent}function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}exports.CREWX_DOCUMENT_CHANGED=m;exports.CrewxAppToolError=p;exports.listFiles=C;exports.onDocumentChanged=w;exports.readFile=R;exports.share=x;exports.writeFile=T;
|
|
@@ -43,11 +43,15 @@ export interface ThreadMessage {
|
|
|
43
43
|
content: string;
|
|
44
44
|
timestamp: string;
|
|
45
45
|
metadata: Record<string, unknown> | null;
|
|
46
|
+
contentTruncated?: boolean;
|
|
47
|
+
originalTokens?: number;
|
|
48
|
+
includedTokens?: number;
|
|
46
49
|
}
|
|
47
50
|
export interface ContextBuildParams {
|
|
48
51
|
maxTokens: number;
|
|
49
52
|
hotzoneRatio: number;
|
|
50
53
|
warmzoneRatio: number;
|
|
54
|
+
minGuaranteedPairs?: number;
|
|
51
55
|
}
|
|
52
56
|
export interface ContextBuildResponse {
|
|
53
57
|
hot: ThreadMessage[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function normalizeClaudeMode(mode: string): string;
|
|
2
|
+
export interface AgentOptionsLike {
|
|
3
|
+
query?: unknown;
|
|
4
|
+
execute?: unknown;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface CanonicalizeAgentOptionsInput {
|
|
8
|
+
provider?: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
options: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface CanonicalizeAgentOptionsResult {
|
|
13
|
+
options: unknown;
|
|
14
|
+
changed: boolean;
|
|
15
|
+
removed: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function normalizeProviderMode(providerId: string, mode: string): string;
|
|
18
|
+
export declare function canonicalizeAgentOptions(input: CanonicalizeAgentOptionsInput): CanonicalizeAgentOptionsResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ProviderExecutionOptions } from './models.generated.js';
|
|
2
|
+
export type DefaultAgentStage = {
|
|
3
|
+
model: string;
|
|
4
|
+
query: Pick<ProviderExecutionOptions, 'mode' | 'effort'>;
|
|
5
|
+
execute: Pick<ProviderExecutionOptions, 'mode' | 'effort'>;
|
|
6
|
+
};
|
|
7
|
+
export interface DefaultAgentProfile {
|
|
8
|
+
planner: DefaultAgentStage;
|
|
9
|
+
worker: DefaultAgentStage;
|
|
10
|
+
}
|
|
11
|
+
export declare function getDefaultAgentProfile(provider: string): DefaultAgentProfile | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'fs';
|
|
2
|
+
import type { LocalServerSettings } from '../local-server/types';
|
|
3
|
+
export interface GlobalSettings {
|
|
4
|
+
cron?: {
|
|
5
|
+
auto_start?: boolean;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
ai_server?: LocalServerSettings;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export type DeepPartial<T> = T extends object ? {
|
|
12
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
13
|
+
} : T;
|
|
14
|
+
export interface GlobalSettingsStore {
|
|
15
|
+
read(): GlobalSettings;
|
|
16
|
+
update(patch: DeepPartial<GlobalSettings>): GlobalSettings;
|
|
17
|
+
set(key: string, value: unknown): GlobalSettings;
|
|
18
|
+
remove(key: string): GlobalSettings;
|
|
19
|
+
readonly path: string;
|
|
20
|
+
}
|
|
21
|
+
interface GlobalSettingsFileSystem {
|
|
22
|
+
mkdirSync: typeof mkdirSync;
|
|
23
|
+
readFileSync: typeof readFileSync;
|
|
24
|
+
renameSync: typeof renameSync;
|
|
25
|
+
statSync: typeof statSync;
|
|
26
|
+
writeFileSync: typeof writeFileSync;
|
|
27
|
+
}
|
|
28
|
+
export interface CreateGlobalSettingsStoreOptions {
|
|
29
|
+
filePath?: string;
|
|
30
|
+
fileSystem?: Partial<GlobalSettingsFileSystem>;
|
|
31
|
+
}
|
|
32
|
+
export declare function createGlobalSettingsStore(opts?: CreateGlobalSettingsStoreOptions): GlobalSettingsStore;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const CLAUDE_OPUS_4_8_BASE_MODEL_ID: "claude-opus-4-8";
|
|
2
|
+
export declare const CLAUDE_OPUS_4_8_LEGACY_MODEL_ID: "claude-opus-4-8[1m]";
|
|
3
|
+
export declare const CLAUDE_MODEL_COMPATIBILITY_PAIRS: readonly [{
|
|
4
|
+
readonly baseModelId: "claude-opus-4-8";
|
|
5
|
+
readonly catalogModelId: "claude-opus-4-8[1m]";
|
|
6
|
+
}, {
|
|
7
|
+
readonly baseModelId: "claude-opus-4-7";
|
|
8
|
+
readonly catalogModelId: "claude-opus-4-7[1m]";
|
|
9
|
+
}, {
|
|
10
|
+
readonly baseModelId: "claude-opus-4-6";
|
|
11
|
+
readonly catalogModelId: "claude-opus-4-6[1m]";
|
|
12
|
+
}, {
|
|
13
|
+
readonly baseModelId: "claude-sonnet-4-6";
|
|
14
|
+
readonly catalogModelId: "claude-sonnet-4-6[1m]";
|
|
15
|
+
}];
|
|
16
|
+
export declare function normalizeAntigravityMode(mode: string): string;
|
|
17
|
+
export declare function resolveCatalogModelId(model: string): string;
|
|
18
|
+
export declare const ANTIGRAVITY_MODEL_COMPATIBILITY: ReadonlyArray<{
|
|
19
|
+
legacyId: string;
|
|
20
|
+
model: string;
|
|
21
|
+
effort?: string;
|
|
22
|
+
}>;
|
|
23
|
+
export type AntigravityResolvedModel = {
|
|
24
|
+
model?: string;
|
|
25
|
+
effort?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function resolveAntigravityModel(model?: string): AntigravityResolvedModel;
|
|
28
|
+
export declare function resolveProviderCatalogModel(providerId: string, model?: string): {
|
|
29
|
+
model?: string;
|
|
30
|
+
effort?: string;
|
|
31
|
+
};
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
import type { ModelApiPricing } from './pricing.types.js';
|
|
2
|
+
export declare const MODEL_TIERS: readonly ["flagship", "balanced", "speed"];
|
|
3
|
+
export type ModelTier = (typeof MODEL_TIERS)[number];
|
|
4
|
+
export declare const EFFORT_LEVELS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"];
|
|
5
|
+
export type EffortLevel = (typeof EFFORT_LEVELS)[number];
|
|
6
|
+
export type KnownEffortLevel = EffortLevel;
|
|
7
|
+
export declare const PROVIDER_ARGV_EFFORTS: Record<string, readonly string[]>;
|
|
8
|
+
export declare const MODEL_CATALOG_VERSION = 34;
|
|
9
|
+
export declare const MODEL_CATALOG_UPDATED = "2026-10-24T00:00:00Z";
|
|
1
10
|
export interface ModelCatalogEntry {
|
|
2
11
|
id: string;
|
|
3
12
|
name: string;
|
|
4
13
|
description?: string;
|
|
14
|
+
contextWindowTokens?: number;
|
|
15
|
+
tier?: ModelTier;
|
|
16
|
+
recommended?: boolean;
|
|
17
|
+
apiPricing?: ModelApiPricing;
|
|
5
18
|
}
|
|
6
19
|
export interface ProviderModeEntry {
|
|
7
20
|
id: string;
|
|
@@ -12,11 +25,35 @@ export interface ProviderModelOverride {
|
|
|
12
25
|
effort?: string[];
|
|
13
26
|
defaultEffort?: string;
|
|
14
27
|
}
|
|
28
|
+
export type ProviderOptionSpec = {
|
|
29
|
+
key: string;
|
|
30
|
+
type: 'boolean';
|
|
31
|
+
} | {
|
|
32
|
+
key: string;
|
|
33
|
+
type: 'enum';
|
|
34
|
+
values: string[];
|
|
35
|
+
};
|
|
36
|
+
export interface ProviderExecutionOptions {
|
|
37
|
+
mode: string;
|
|
38
|
+
effort: string;
|
|
39
|
+
providerOptions?: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
export interface ProviderDefaultProfile {
|
|
42
|
+
model: string;
|
|
43
|
+
query: ProviderExecutionOptions;
|
|
44
|
+
execute: ProviderExecutionOptions;
|
|
45
|
+
}
|
|
46
|
+
export interface ProviderDefaults {
|
|
47
|
+
version: number;
|
|
48
|
+
providers: Record<string, ProviderDefaultProfile>;
|
|
49
|
+
}
|
|
15
50
|
export interface ProviderCatalogEntry {
|
|
16
51
|
models: ModelCatalogEntry[];
|
|
17
52
|
modes: ProviderModeEntry[];
|
|
18
53
|
effort: string[];
|
|
19
54
|
modelOverrides: Record<string, ProviderModelOverride>;
|
|
55
|
+
providerOptions?: ProviderOptionSpec[];
|
|
20
56
|
}
|
|
21
57
|
export declare const PROVIDER_CATALOGS: Record<string, ProviderCatalogEntry>;
|
|
58
|
+
export declare const PROVIDER_DEFAULTS: ProviderDefaults;
|
|
22
59
|
export declare const PROVIDER_MODELS: Record<string, ModelCatalogEntry[]>;
|
|
@@ -3,6 +3,7 @@ export interface OverdriveProfile {
|
|
|
3
3
|
model?: string;
|
|
4
4
|
mode?: string;
|
|
5
5
|
effort?: string;
|
|
6
|
+
providerOptions?: Record<string, unknown>;
|
|
6
7
|
}
|
|
7
8
|
export type OverdriveSignalInput = boolean | {
|
|
8
9
|
mode?: 'count' | 'latch';
|
|
@@ -20,5 +21,11 @@ export interface OverdriveResolution {
|
|
|
20
21
|
mode?: string;
|
|
21
22
|
effort?: string;
|
|
22
23
|
crossProvider: boolean;
|
|
24
|
+
providerOptions?: Record<string, unknown>;
|
|
23
25
|
}
|
|
24
26
|
export declare function resolveOverdrive(agentOptions: unknown, mode: 'query' | 'execute', baseProvider: string, signal: OverdriveSignal): OverdriveResolution;
|
|
27
|
+
export interface ModeOverrideResolution {
|
|
28
|
+
provider?: string;
|
|
29
|
+
model?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function resolveModeOverride(agentOptions: unknown, mode: 'query' | 'execute'): ModeOverrideResolution;
|
package/dist/config/pricing.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type { ModelPricing } from './pricing.types.js';
|
|
2
|
-
export type { ModelPricing } from './pricing.types.js';
|
|
3
|
-
export { MODEL_PRICING } from './pricing.generated.js';
|
|
1
|
+
import type { ModelApiPricing, ModelPricing } from './pricing.types.js';
|
|
2
|
+
export type { ModelApiPricing, ModelPricing } from './pricing.types.js';
|
|
3
|
+
export { MODEL_PRICING, UNPUBLISHED_MODEL_IDS } from './pricing.generated.js';
|
|
4
4
|
export declare function setPricingOverride(models: Record<string, ModelPricing>): void;
|
|
5
5
|
export declare function clearPricingOverride(): void;
|
|
6
|
+
export declare function setApiPricingOverride(models: Record<string, ModelApiPricing>): void;
|
|
7
|
+
export declare function clearApiPricingOverride(): void;
|
|
6
8
|
export declare function normalizeModel(model: string): string;
|
|
9
|
+
export declare function lookupApiPricing(model: string | null | undefined): ModelApiPricing | undefined;
|
|
7
10
|
export declare function getPricing(model: string | null | undefined): ModelPricing;
|
|
8
11
|
export declare function calculateCost(inputTokens: number, outputTokens: number, model: string | null | undefined, cachedInputTokens?: number, _date?: Date): number;
|
|
9
12
|
export declare function resolveCost(costUsd: number | undefined, inputTokens: number | undefined, outputTokens: number | undefined, cachedInputTokens: number | undefined, model: string | null | undefined, date?: Date): number;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { ModelPricing } from './pricing.types.js';
|
|
2
2
|
export declare const MODEL_PRICING: Record<string, ModelPricing>;
|
|
3
|
+
export declare const MODEL_PRICING_VERSION = 34;
|
|
4
|
+
export declare const MODEL_PRICING_UPDATED = "2026-10-24T00:00:00Z";
|
|
5
|
+
export declare const UNPUBLISHED_MODEL_IDS: ReadonlySet<string>;
|
|
6
|
+
export declare const CATALOG_MODEL_IDS: ReadonlySet<string>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export interface TimeoutConfig {
|
|
2
2
|
queryMs: number;
|
|
3
3
|
executeMs: number;
|
|
4
|
+
idleMs: number;
|
|
4
5
|
}
|
|
6
|
+
export declare const DEFAULT_IDLE_MS: number;
|
|
7
|
+
export declare const DEFAULT_RESUME_TIMEOUT_MS = 60000;
|
|
8
|
+
export declare function parseIdleEnvOverride(env?: NodeJS.ProcessEnv): number | undefined;
|
|
5
9
|
export declare function getProviderTimeoutConfig(env?: NodeJS.ProcessEnv): TimeoutConfig;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CrewxProjectConfig } from '../types';
|
|
2
|
+
export declare const DEFAULT_WI_BOARD_ID = "default";
|
|
3
|
+
export declare const ARCHIVE_WI_BOARD_ID = "archive";
|
|
4
|
+
export declare const DEFAULT_WI_WORKFLOW_ID = "wi-default-flow";
|
|
5
|
+
export declare const WI_PLAN_WORKFLOW_ID = "wi-plan-flow";
|
|
6
|
+
export declare const WI_DEFAULT_FLOW_FILENAME = "wi-default-flow.yaml";
|
|
7
|
+
export declare const WI_PLAN_FLOW_FILENAME = "wi-plan-flow.yaml";
|
|
8
|
+
export declare const WI_BOARD_ID_PATTERN: RegExp;
|
|
9
|
+
export declare function isReservedWiBoardId(id: string): boolean;
|
|
10
|
+
export interface ResolvedWiBoard {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
workflowId: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
goalId?: string;
|
|
16
|
+
system: boolean;
|
|
17
|
+
readOnly: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function resolveWiBoards(config: CrewxProjectConfig | undefined): ResolvedWiBoard[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ConversationHighlight, ConversationThreadState, SemanticContinuityContext, TemplateMessage } from '../conversation/types.js';
|
|
2
|
+
export declare const DEFAULT_PROTECTED_TURN_COUNT = 5;
|
|
3
|
+
export declare const DEFAULT_HIGHLIGHT_BUDGET_PERCENT = 5;
|
|
4
|
+
export declare const MAX_ACTIVE_HIGHLIGHTS = 12;
|
|
5
|
+
export declare const MAX_ACTIVE_HIGHLIGHT_CHARS = 2000;
|
|
6
|
+
export declare const MAX_THREAD_TITLE_CHARS = 200;
|
|
7
|
+
export declare const MAX_THREAD_STATE_VALUE_CHARS = 64;
|
|
8
|
+
export interface ConversationTurn {
|
|
9
|
+
taskId?: string;
|
|
10
|
+
messages: TemplateMessage[];
|
|
11
|
+
ordinal: number;
|
|
12
|
+
}
|
|
13
|
+
export interface GroupedConversationTurns {
|
|
14
|
+
turns: ConversationTurn[];
|
|
15
|
+
unpairedMessages: TemplateMessage[];
|
|
16
|
+
droppedMessages: TemplateMessage[];
|
|
17
|
+
}
|
|
18
|
+
export interface ConversationTurnSelection {
|
|
19
|
+
includedTurns: ConversationTurn[];
|
|
20
|
+
omittedTurns: ConversationTurn[];
|
|
21
|
+
protectedTurns: ConversationTurn[];
|
|
22
|
+
tokenCount: number;
|
|
23
|
+
protectedTokenCount: number;
|
|
24
|
+
overBudget: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface SelectConversationTurnsOptions {
|
|
27
|
+
turns: readonly ConversationTurn[];
|
|
28
|
+
maxTokenCount: number;
|
|
29
|
+
countTokens: (text: string) => number;
|
|
30
|
+
protectedTurnCount?: number;
|
|
31
|
+
materializeTurn?: (turn: ConversationTurn) => string;
|
|
32
|
+
}
|
|
33
|
+
export interface ConversationHighlightSelection {
|
|
34
|
+
includedHighlights: ConversationHighlight[];
|
|
35
|
+
omittedHighlights: ConversationHighlight[];
|
|
36
|
+
truncatedHighlights: number;
|
|
37
|
+
representedTaskIds: string[];
|
|
38
|
+
unrepresentedTaskIds: string[];
|
|
39
|
+
tokenCount: number;
|
|
40
|
+
budgetTokens: number;
|
|
41
|
+
}
|
|
42
|
+
export interface SelectConversationHighlightsOptions {
|
|
43
|
+
highlights: readonly ConversationHighlight[];
|
|
44
|
+
omittedTaskIds: readonly string[];
|
|
45
|
+
taskOrder: readonly string[];
|
|
46
|
+
maxTokenCount: number;
|
|
47
|
+
countTokens: (text: string) => number;
|
|
48
|
+
applySafetyCap?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare function getConversationMessageTaskId(message: TemplateMessage): string | undefined;
|
|
51
|
+
export declare function groupConversationTurns(messages: readonly TemplateMessage[]): GroupedConversationTurns;
|
|
52
|
+
export declare function withoutDroppedAppCards(messages: readonly TemplateMessage[]): TemplateMessage[];
|
|
53
|
+
export declare function materializeConversationTurn(turn: ConversationTurn, includeActivityLog?: boolean): string;
|
|
54
|
+
export declare function selectConversationTurns(options: SelectConversationTurnsOptions): ConversationTurnSelection;
|
|
55
|
+
export declare function buildThreadStateContext(state: ConversationThreadState | undefined): ConversationThreadState | undefined;
|
|
56
|
+
export declare function selectConversationHighlights(options: SelectConversationHighlightsOptions): ConversationHighlightSelection;
|
|
57
|
+
export interface BuildSemanticContinuityContextOptions {
|
|
58
|
+
highlights: readonly ConversationHighlight[];
|
|
59
|
+
omittedTaskIds: readonly string[];
|
|
60
|
+
representedTaskIds: readonly string[];
|
|
61
|
+
applySafetyCap?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export declare function buildSemanticContinuityContext(options: BuildSemanticContinuityContextOptions): SemanticContinuityContext;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export declare const DEFAULT_INPUT_BUDGET_PERCENT = 60;
|
|
2
|
+
export declare const MIN_INPUT_BUDGET_PERCENT = 30;
|
|
3
|
+
export declare const MAX_INPUT_BUDGET_PERCENT = 80;
|
|
4
|
+
export declare const INPUT_BUDGET_TOKENIZER_ENCODING = "o200k_base";
|
|
5
|
+
export declare const FRESH_PROVIDER_INITIAL_INPUT_SEPARATOR = "\n\n---\n\n";
|
|
6
|
+
export declare const FRESH_PROVIDER_INITIAL_INPUT_FRAMING = "system_prompt\\n\\n---\\n\\nmessage";
|
|
7
|
+
export declare const RESUME_PROVIDER_INITIAL_INPUT_FRAMING = "message";
|
|
8
|
+
export type InputBudgetUnresolvedReason = 'invalid_input_budget_percent' | 'provider_catalog_unavailable' | 'model_not_found' | 'context_window_tokens_unavailable';
|
|
9
|
+
export type TokenizerFallbackReason = 'vendor_tokenizer_unavailable';
|
|
10
|
+
export interface ResolveInputBudgetOptions {
|
|
11
|
+
provider: string;
|
|
12
|
+
model: string;
|
|
13
|
+
inputBudgetPercent?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface TokenizerOptions {
|
|
16
|
+
provider?: string;
|
|
17
|
+
model?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TokenizerMetadata {
|
|
20
|
+
provider: string;
|
|
21
|
+
model: string;
|
|
22
|
+
encoding: typeof INPUT_BUDGET_TOKENIZER_ENCODING;
|
|
23
|
+
exact: boolean;
|
|
24
|
+
fallbackReason?: TokenizerFallbackReason;
|
|
25
|
+
}
|
|
26
|
+
export interface ResolvedInputBudget {
|
|
27
|
+
resolved: true;
|
|
28
|
+
requestedProvider: string;
|
|
29
|
+
provider: string;
|
|
30
|
+
model: string;
|
|
31
|
+
contextWindowTokens: number;
|
|
32
|
+
inputBudgetPercent: number;
|
|
33
|
+
inputBudgetTokens: number;
|
|
34
|
+
tokenizer: TokenizerMetadata;
|
|
35
|
+
}
|
|
36
|
+
export interface UnresolvedInputBudget {
|
|
37
|
+
resolved: false;
|
|
38
|
+
requestedProvider: string;
|
|
39
|
+
provider: string;
|
|
40
|
+
model: string;
|
|
41
|
+
reason: InputBudgetUnresolvedReason;
|
|
42
|
+
inputBudgetPercent?: number;
|
|
43
|
+
tokenizer: TokenizerMetadata;
|
|
44
|
+
}
|
|
45
|
+
export type ResolveInputBudgetResult = ResolvedInputBudget | UnresolvedInputBudget;
|
|
46
|
+
export type ContextBudgetPhase = 'fresh' | 'resume';
|
|
47
|
+
export type ProviderInitialInputFraming = typeof FRESH_PROVIDER_INITIAL_INPUT_FRAMING | typeof RESUME_PROVIDER_INITIAL_INPUT_FRAMING;
|
|
48
|
+
export interface ContextBudgetLayoutCapability {
|
|
49
|
+
layoutId: string;
|
|
50
|
+
supportsSemanticContinuity: boolean;
|
|
51
|
+
slot: string | null;
|
|
52
|
+
requiredForOmittedTurns: boolean;
|
|
53
|
+
warning?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ContextBudgetActivityDegradation {
|
|
56
|
+
taskId: string;
|
|
57
|
+
taskDistance: number;
|
|
58
|
+
action: 'reduced' | 'omitted';
|
|
59
|
+
}
|
|
60
|
+
export type ContextBudgetAssemblyErrorCode = 'INPUT_BUDGET_EXCEEDED' | 'CONTINUITY_SLOT_REQUIRED';
|
|
61
|
+
export declare class ContextBudgetLayoutError extends Error {
|
|
62
|
+
readonly layoutId: string;
|
|
63
|
+
readonly omittedTurnCount: number;
|
|
64
|
+
readonly code: "CONTINUITY_SLOT_REQUIRED";
|
|
65
|
+
constructor(message: string, layoutId: string, omittedTurnCount: number);
|
|
66
|
+
}
|
|
67
|
+
export interface ContextBudgetManifest {
|
|
68
|
+
runningInstructionAppsOmitted?: number;
|
|
69
|
+
phase: ContextBudgetPhase;
|
|
70
|
+
initialInputFraming: ProviderInitialInputFraming;
|
|
71
|
+
resolved: boolean;
|
|
72
|
+
reason?: InputBudgetUnresolvedReason;
|
|
73
|
+
requestedProvider: string;
|
|
74
|
+
requestedModel: string | null;
|
|
75
|
+
effectiveProvider: string;
|
|
76
|
+
effectiveModel: string | null;
|
|
77
|
+
contextWindowTokens: number | null;
|
|
78
|
+
inputBudgetPercent: number | null;
|
|
79
|
+
inputBudgetTokens: number | null;
|
|
80
|
+
tokenizer: TokenizerMetadata;
|
|
81
|
+
initialTokenCount: number | null;
|
|
82
|
+
finalTokenCount: number | null;
|
|
83
|
+
activityLogTokenCount: number | null;
|
|
84
|
+
activityIncludedEntries: number | null;
|
|
85
|
+
activityOmittedEntries: number | null;
|
|
86
|
+
activityRemovedForBudget: boolean;
|
|
87
|
+
activityNewestTaskTokenCap: number | null;
|
|
88
|
+
historyOriginalMessages: number;
|
|
89
|
+
historyIncludedMessages: number;
|
|
90
|
+
historyOmittedMessages: number;
|
|
91
|
+
turnOriginal: number;
|
|
92
|
+
turnIncluded: number;
|
|
93
|
+
turnOmitted: number;
|
|
94
|
+
highlightOriginal: number;
|
|
95
|
+
highlightIncluded: number;
|
|
96
|
+
highlightOmitted: number;
|
|
97
|
+
highlightTruncated: number;
|
|
98
|
+
representedOmittedTurns: number;
|
|
99
|
+
unrepresentedOmittedTurns: number;
|
|
100
|
+
activityDegraded: boolean;
|
|
101
|
+
activityIncludedTasks: number;
|
|
102
|
+
activityOmittedTasks: number;
|
|
103
|
+
activityDegradation: ContextBudgetActivityDegradation[];
|
|
104
|
+
highlightLookupFailed: boolean;
|
|
105
|
+
layoutCapability: ContextBudgetLayoutCapability;
|
|
106
|
+
overBudget: boolean;
|
|
107
|
+
overdriveProviderSuppressed?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface TokenCountResult {
|
|
110
|
+
tokenCount: number;
|
|
111
|
+
tokenizer: TokenizerMetadata;
|
|
112
|
+
}
|
|
113
|
+
export interface TokenCounter {
|
|
114
|
+
metadata: TokenizerMetadata;
|
|
115
|
+
countTokens(text: string): number;
|
|
116
|
+
}
|
|
117
|
+
export interface FreshProviderInitialInput {
|
|
118
|
+
systemPrompt?: string | null;
|
|
119
|
+
message: string;
|
|
120
|
+
}
|
|
121
|
+
type PieceCacheEventType = 'hit' | 'miss' | 'evict' | 'full_encode';
|
|
122
|
+
interface PieceCacheEvent {
|
|
123
|
+
type: PieceCacheEventType;
|
|
124
|
+
piece?: string;
|
|
125
|
+
tokenCount?: number;
|
|
126
|
+
reason?: 'special_token';
|
|
127
|
+
}
|
|
128
|
+
type PieceCacheObserver = (event: PieceCacheEvent) => void;
|
|
129
|
+
interface TokenCounterInternalOptions {
|
|
130
|
+
pieceCacheMaxEntries?: number;
|
|
131
|
+
observePieceCache?: PieceCacheObserver;
|
|
132
|
+
}
|
|
133
|
+
export declare function normalizeInputBudgetProvider(provider: string): string;
|
|
134
|
+
export declare function resolveTokenizerMetadata(options?: TokenizerOptions): TokenizerMetadata;
|
|
135
|
+
export declare function countTokens(text: string, options?: TokenizerOptions): TokenCountResult;
|
|
136
|
+
export declare function renderFreshProviderInitialInput(input: FreshProviderInitialInput): string;
|
|
137
|
+
export declare function countFreshProviderInitialInput(input: FreshProviderInitialInput, count: (text: string) => number): number;
|
|
138
|
+
export declare function createTokenCounter(options?: TokenizerOptions): TokenCounter;
|
|
139
|
+
export declare function __createTokenCounterForTest(options?: TokenizerOptions, internalOptions?: TokenCounterInternalOptions): TokenCounter;
|
|
140
|
+
export declare function resolveInputBudget(options: ResolveInputBudgetOptions): ResolveInputBudgetResult;
|
|
141
|
+
export { DEFAULT_HIGHLIGHT_BUDGET_PERCENT, DEFAULT_PROTECTED_TURN_COUNT, MAX_ACTIVE_HIGHLIGHT_CHARS, MAX_ACTIVE_HIGHLIGHTS, MAX_THREAD_STATE_VALUE_CHARS, MAX_THREAD_TITLE_CHARS, buildSemanticContinuityContext, buildThreadStateContext, getConversationMessageTaskId, groupConversationTurns, materializeConversationTurn, selectConversationHighlights, selectConversationTurns, withoutDroppedAppCards, } from './continuity.js';
|
|
142
|
+
export type { BuildSemanticContinuityContextOptions, ConversationHighlightSelection, ConversationTurn, ConversationTurnSelection, GroupedConversationTurns, SelectConversationHighlightsOptions, SelectConversationTurnsOptions, } from './continuity.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
2
|
export { toTaskReader } from './to-task-reader.js';
|
|
3
|
-
export { toTemplateMessages } from './to-template-messages.js';
|
|
3
|
+
export { LEGACY_UI_CARD_SAFE_SUMMARY, sanitizeLegacyUiCardText, sanitizeTemplateMessages, toTemplateMessages, } from './to-template-messages.js';
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import type { ConversationThread, FetchHistoryOptions, IConversationHistoryProvider, Platform } from './types';
|
|
1
|
+
import type { ConversationHighlight, ConversationThread, ConversationThreadState, FetchHistoryOptions, IConversationHistoryProvider, Platform, ThreadCreationOptions } from './types';
|
|
2
2
|
export declare class SqliteConversationProvider implements IConversationHistoryProvider {
|
|
3
3
|
private readonly dbPath;
|
|
4
4
|
constructor(dbPath?: string);
|
|
5
5
|
private getThreadRepo;
|
|
6
|
+
private getThreadHistoryRepo;
|
|
6
7
|
updateThread(id: string, patch: {
|
|
7
8
|
title?: string;
|
|
8
9
|
}): void;
|
|
9
|
-
ensureThread(threadId: string, platform: Platform, workspaceId?: string): Promise<{
|
|
10
|
+
ensureThread(threadId: string, platform: Platform, workspaceId?: string, creator?: ThreadCreationOptions): Promise<{
|
|
10
11
|
created: boolean;
|
|
11
12
|
}>;
|
|
12
13
|
fetchHistory(threadId: string, options?: FetchHistoryOptions): Promise<ConversationThread>;
|
|
14
|
+
fetchThreadState(threadId: string): Promise<ConversationThreadState | undefined>;
|
|
15
|
+
fetchHighlights(threadId: string): Promise<ConversationHighlight[] | undefined>;
|
|
13
16
|
saveUserMessage(threadId: string, text: string, _userId?: string, _metadata?: Record<string, unknown>): Promise<{
|
|
14
17
|
id: string;
|
|
15
18
|
firstMessage: boolean;
|
|
@@ -18,6 +21,6 @@ export declare class SqliteConversationProvider implements IConversationHistoryP
|
|
|
18
21
|
id: string;
|
|
19
22
|
}>;
|
|
20
23
|
close(): void;
|
|
21
|
-
private
|
|
24
|
+
private readActiveHighlights;
|
|
22
25
|
private rowsToMessages;
|
|
23
26
|
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import type { ConversationThread, TemplateMessage } from './types';
|
|
2
|
+
import type { UiAgentContextProjection } from '../ui-instance/types.js';
|
|
3
|
+
import type { McpAppStateDescriptor } from '../mcp-app/types.js';
|
|
4
|
+
export declare const LEGACY_UI_CARD_SAFE_SUMMARY = "[workflow card omitted from AI context]";
|
|
5
|
+
export declare const V2_UI_INSTANCE_SAFE_SUMMARY = "[workflow UI instance omitted from AI context]";
|
|
6
|
+
export declare function sanitizeUiInstanceReferenceText(text: string): string;
|
|
7
|
+
export declare function sanitizeLegacyUiCardText(text: string): string;
|
|
8
|
+
export declare function sanitizeTemplateMessages(messages: readonly TemplateMessage[]): TemplateMessage[];
|
|
9
|
+
export declare function appendUiProjections(messages: readonly TemplateMessage[], projections: readonly UiAgentContextProjection[] | undefined): TemplateMessage[];
|
|
10
|
+
export declare function appendMcpAppProjections(messages: readonly TemplateMessage[], descriptors: readonly McpAppStateDescriptor[] | undefined): TemplateMessage[];
|
|
2
11
|
export declare function toTemplateMessages(thread: ConversationThread): TemplateMessage[];
|