@mono-agent/agent-app 0.11.2 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +222 -26
- package/dist/adapter-send-tools-main.js +7 -1
- package/dist/adapter-send-tools-main.js.map +1 -1
- package/dist/adapter-send-tools.d.ts +19 -1
- package/dist/adapter-send-tools.d.ts.map +1 -1
- package/dist/adapter-send-tools.js +127 -13
- package/dist/adapter-send-tools.js.map +1 -1
- package/dist/app-config.d.ts.map +1 -1
- package/dist/app-config.js +15 -2
- package/dist/app-config.js.map +1 -1
- package/dist/app-controller-channels.d.ts +8 -0
- package/dist/app-controller-channels.d.ts.map +1 -0
- package/dist/app-controller-channels.js +207 -0
- package/dist/app-controller-channels.js.map +1 -0
- package/dist/app-controller-continuation.d.ts +26 -0
- package/dist/app-controller-continuation.d.ts.map +1 -0
- package/dist/app-controller-continuation.js +198 -0
- package/dist/app-controller-continuation.js.map +1 -0
- package/dist/app-controller-lifecycle.d.ts +6 -0
- package/dist/app-controller-lifecycle.d.ts.map +1 -0
- package/dist/app-controller-lifecycle.js +81 -0
- package/dist/app-controller-lifecycle.js.map +1 -0
- package/dist/app-controller-maintenance.d.ts +13 -0
- package/dist/app-controller-maintenance.d.ts.map +1 -0
- package/dist/app-controller-maintenance.js +180 -0
- package/dist/app-controller-maintenance.js.map +1 -0
- package/dist/app-controller-memory-health.d.ts +12 -0
- package/dist/app-controller-memory-health.d.ts.map +1 -0
- package/dist/app-controller-memory-health.js +160 -0
- package/dist/app-controller-memory-health.js.map +1 -0
- package/dist/app-controller-memory.d.ts +9 -0
- package/dist/app-controller-memory.d.ts.map +1 -0
- package/dist/app-controller-memory.js +83 -0
- package/dist/app-controller-memory.js.map +1 -0
- package/dist/app-controller-responder.d.ts +20 -0
- package/dist/app-controller-responder.d.ts.map +1 -0
- package/dist/app-controller-responder.js +246 -0
- package/dist/app-controller-responder.js.map +1 -0
- package/dist/app-controller-traceability.d.ts +25 -0
- package/dist/app-controller-traceability.d.ts.map +1 -0
- package/dist/app-controller-traceability.js +418 -0
- package/dist/app-controller-traceability.js.map +1 -0
- package/dist/app-controller-utils.d.ts +38 -0
- package/dist/app-controller-utils.d.ts.map +1 -0
- package/dist/app-controller-utils.js +185 -0
- package/dist/app-controller-utils.js.map +1 -0
- package/dist/app-controller.d.ts +400 -0
- package/dist/app-controller.d.ts.map +1 -0
- package/dist/app-controller.js +336 -0
- package/dist/app-controller.js.map +1 -0
- package/dist/app.d.ts +7 -115
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +6 -1912
- package/dist/app.js.map +1 -1
- package/dist/artifact-retention.d.ts +4 -0
- package/dist/artifact-retention.d.ts.map +1 -1
- package/dist/artifact-retention.js +38 -0
- package/dist/artifact-retention.js.map +1 -1
- package/dist/backfill.d.ts +3 -1
- package/dist/backfill.d.ts.map +1 -1
- package/dist/backfill.js +5 -1
- package/dist/backfill.js.map +1 -1
- package/dist/background-runtime.d.ts +27 -0
- package/dist/background-runtime.d.ts.map +1 -1
- package/dist/background-runtime.js +383 -205
- package/dist/background-runtime.js.map +1 -1
- package/dist/background-worker-lease.d.ts.map +1 -1
- package/dist/background-worker-lease.js +41 -241
- package/dist/background-worker-lease.js.map +1 -1
- package/dist/background.d.ts +31 -9
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +543 -272
- package/dist/background.js.map +1 -1
- package/dist/channel-drivers/cron.d.ts +11 -0
- package/dist/channel-drivers/cron.d.ts.map +1 -0
- package/dist/channel-drivers/cron.js +168 -0
- package/dist/channel-drivers/cron.js.map +1 -0
- package/dist/channel-drivers/live.d.ts +11 -0
- package/dist/channel-drivers/live.d.ts.map +1 -0
- package/dist/channel-drivers/live.js +47 -0
- package/dist/channel-drivers/live.js.map +1 -0
- package/dist/channel-drivers/native-notify.d.ts +27 -0
- package/dist/channel-drivers/native-notify.d.ts.map +1 -0
- package/dist/channel-drivers/native-notify.js +94 -0
- package/dist/channel-drivers/native-notify.js.map +1 -0
- package/dist/channel-drivers/openai-api.d.ts +7 -0
- package/dist/channel-drivers/openai-api.d.ts.map +1 -0
- package/dist/channel-drivers/openai-api.js +63 -0
- package/dist/channel-drivers/openai-api.js.map +1 -0
- package/dist/channel-drivers/shared.d.ts +4 -0
- package/dist/channel-drivers/shared.d.ts.map +1 -0
- package/dist/channel-drivers/shared.js +5 -0
- package/dist/channel-drivers/shared.js.map +1 -0
- package/dist/channel-drivers/slack.d.ts +14 -0
- package/dist/channel-drivers/slack.d.ts.map +1 -0
- package/dist/channel-drivers/slack.js +227 -0
- package/dist/channel-drivers/slack.js.map +1 -0
- package/dist/channel-drivers/telegram.d.ts +11 -0
- package/dist/channel-drivers/telegram.d.ts.map +1 -0
- package/dist/channel-drivers/telegram.js +244 -0
- package/dist/channel-drivers/telegram.js.map +1 -0
- package/dist/channel-drivers/tui.d.ts +15 -0
- package/dist/channel-drivers/tui.d.ts.map +1 -0
- package/dist/channel-drivers/tui.js +108 -0
- package/dist/channel-drivers/tui.js.map +1 -0
- package/dist/channel-drivers/webhook.d.ts +7 -0
- package/dist/channel-drivers/webhook.d.ts.map +1 -0
- package/dist/channel-drivers/webhook.js +115 -0
- package/dist/channel-drivers/webhook.js.map +1 -0
- package/dist/channels.d.ts +21 -81
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +11 -1174
- package/dist/channels.js.map +1 -1
- package/dist/cli-args.d.ts +121 -0
- package/dist/cli-args.d.ts.map +1 -0
- package/dist/cli-args.js +532 -0
- package/dist/cli-args.js.map +1 -0
- package/dist/cli-background-command.d.ts +59 -0
- package/dist/cli-background-command.d.ts.map +1 -0
- package/dist/cli-background-command.js +475 -0
- package/dist/cli-background-command.js.map +1 -0
- package/dist/cli-cancellation.d.ts +6 -0
- package/dist/cli-cancellation.d.ts.map +1 -0
- package/dist/cli-cancellation.js +23 -0
- package/dist/cli-cancellation.js.map +1 -0
- package/dist/cli-commands.d.ts +12 -0
- package/dist/cli-commands.d.ts.map +1 -0
- package/dist/cli-commands.js +306 -0
- package/dist/cli-commands.js.map +1 -0
- package/dist/cli-help.d.ts +11 -0
- package/dist/cli-help.d.ts.map +1 -0
- package/dist/cli-help.js +262 -0
- package/dist/cli-help.js.map +1 -0
- package/dist/cli-init-command.d.ts +60 -0
- package/dist/cli-init-command.d.ts.map +1 -0
- package/dist/cli-init-command.js +1910 -0
- package/dist/cli-init-command.js.map +1 -0
- package/dist/cli-install-skill-command.d.ts +3 -0
- package/dist/cli-install-skill-command.d.ts.map +1 -0
- package/dist/cli-install-skill-command.js +51 -0
- package/dist/cli-install-skill-command.js.map +1 -0
- package/dist/cli-sandbox-command.d.ts +10 -0
- package/dist/cli-sandbox-command.d.ts.map +1 -0
- package/dist/cli-sandbox-command.js +100 -0
- package/dist/cli-sandbox-command.js.map +1 -0
- package/dist/cli-validate-config-command.d.ts +36 -0
- package/dist/cli-validate-config-command.d.ts.map +1 -0
- package/dist/cli-validate-config-command.js +317 -0
- package/dist/cli-validate-config-command.js.map +1 -0
- package/dist/cli.d.ts +6 -248
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -3792
- package/dist/cli.js.map +1 -1
- package/dist/config-reference.d.ts +2 -1
- package/dist/config-reference.d.ts.map +1 -1
- package/dist/config-reference.js +34 -8
- package/dist/config-reference.js.map +1 -1
- package/dist/configured-agent.d.ts +23 -0
- package/dist/configured-agent.d.ts.map +1 -1
- package/dist/configured-agent.js +92 -13
- package/dist/configured-agent.js.map +1 -1
- package/dist/continuation-dispatch-worker.d.ts +21 -0
- package/dist/continuation-dispatch-worker.d.ts.map +1 -0
- package/dist/continuation-dispatch-worker.js +425 -0
- package/dist/continuation-dispatch-worker.js.map +1 -0
- package/dist/continuation-http-routes.d.ts +15 -0
- package/dist/continuation-http-routes.d.ts.map +1 -0
- package/dist/continuation-http-routes.js +265 -0
- package/dist/continuation-http-routes.js.map +1 -0
- package/dist/continuation-operator-api.d.ts +18 -0
- package/dist/continuation-operator-api.d.ts.map +1 -0
- package/dist/continuation-operator-api.js +164 -0
- package/dist/continuation-operator-api.js.map +1 -0
- package/dist/continuation-origin-store.d.ts +19 -0
- package/dist/continuation-origin-store.d.ts.map +1 -0
- package/dist/continuation-origin-store.js +273 -0
- package/dist/continuation-origin-store.js.map +1 -0
- package/dist/continuation-service-errors.d.ts +18 -0
- package/dist/continuation-service-errors.d.ts.map +1 -0
- package/dist/continuation-service-errors.js +35 -0
- package/dist/continuation-service-errors.js.map +1 -0
- package/dist/continuation-service-helpers.d.ts +39 -0
- package/dist/continuation-service-helpers.d.ts.map +1 -0
- package/dist/continuation-service-helpers.js +308 -0
- package/dist/continuation-service-helpers.js.map +1 -0
- package/dist/continuation-service-origin.d.ts +55 -0
- package/dist/continuation-service-origin.d.ts.map +1 -0
- package/dist/continuation-service-origin.js +325 -0
- package/dist/continuation-service-origin.js.map +1 -0
- package/dist/continuation-service-types.d.ts +110 -0
- package/dist/continuation-service-types.d.ts.map +1 -0
- package/dist/continuation-service-types.js +11 -0
- package/dist/continuation-service-types.js.map +1 -0
- package/dist/continuation-service.d.ts +4 -97
- package/dist/continuation-service.d.ts.map +1 -1
- package/dist/continuation-service.js +9 -1525
- package/dist/continuation-service.js.map +1 -1
- package/dist/continuation-store-fs.d.ts +15 -0
- package/dist/continuation-store-fs.d.ts.map +1 -0
- package/dist/continuation-store-fs.js +247 -0
- package/dist/continuation-store-fs.js.map +1 -0
- package/dist/continuation-store-policy.d.ts +21 -0
- package/dist/continuation-store-policy.d.ts.map +1 -0
- package/dist/continuation-store-policy.js +278 -0
- package/dist/continuation-store-policy.js.map +1 -0
- package/dist/continuation-store-records.d.ts +9 -0
- package/dist/continuation-store-records.d.ts.map +1 -0
- package/dist/continuation-store-records.js +221 -0
- package/dist/continuation-store-records.js.map +1 -0
- package/dist/continuation-store-types.d.ts +173 -0
- package/dist/continuation-store-types.d.ts.map +1 -0
- package/dist/continuation-store-types.js +26 -0
- package/dist/continuation-store-types.js.map +1 -0
- package/dist/continuation-store.d.ts +4 -138
- package/dist/continuation-store.d.ts.map +1 -1
- package/dist/continuation-store.js +145 -1049
- package/dist/continuation-store.js.map +1 -1
- package/dist/doctor.d.ts +10 -5
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +629 -58
- package/dist/doctor.js.map +1 -1
- package/dist/init.d.ts +2 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +92 -239
- package/dist/init.js.map +1 -1
- package/dist/interaction-bridge.d.ts +19 -0
- package/dist/interaction-bridge.d.ts.map +1 -1
- package/dist/interaction-bridge.js +130 -0
- package/dist/interaction-bridge.js.map +1 -1
- package/dist/launchd-logs.d.ts +91 -0
- package/dist/launchd-logs.d.ts.map +1 -0
- package/dist/launchd-logs.js +1499 -0
- package/dist/launchd-logs.js.map +1 -0
- package/dist/launchd.d.ts +27 -0
- package/dist/launchd.d.ts.map +1 -1
- package/dist/launchd.js +89 -10
- package/dist/launchd.js.map +1 -1
- package/dist/memory-command.d.ts +2 -0
- package/dist/memory-command.d.ts.map +1 -1
- package/dist/memory-command.js +161 -48
- package/dist/memory-command.js.map +1 -1
- package/dist/memory-recall-settings.d.ts +64 -0
- package/dist/memory-recall-settings.d.ts.map +1 -0
- package/dist/memory-recall-settings.js +51 -0
- package/dist/memory-recall-settings.js.map +1 -0
- package/dist/memory-recall.d.ts +7 -95
- package/dist/memory-recall.d.ts.map +1 -1
- package/dist/memory-recall.js +8 -143
- package/dist/memory-recall.js.map +1 -1
- package/dist/memory-rituals.d.ts +3 -3
- package/dist/memory-rituals.d.ts.map +1 -1
- package/dist/memory-rituals.js +16 -111
- package/dist/memory-rituals.js.map +1 -1
- package/dist/modules/catalog.js +2 -2
- package/dist/modules/catalog.js.map +1 -1
- package/dist/modules/known-tools.d.ts +8 -6
- package/dist/modules/known-tools.d.ts.map +1 -1
- package/dist/modules/known-tools.js +8 -6
- package/dist/modules/known-tools.js.map +1 -1
- package/dist/notify-destinations.d.ts +5 -0
- package/dist/notify-destinations.d.ts.map +1 -1
- package/dist/notify-destinations.js +7 -1
- package/dist/notify-destinations.js.map +1 -1
- package/dist/owner-private-lock.d.ts +95 -0
- package/dist/owner-private-lock.d.ts.map +1 -0
- package/dist/owner-private-lock.js +566 -0
- package/dist/owner-private-lock.js.map +1 -0
- package/dist/pi-oauth-login.d.ts +2 -0
- package/dist/pi-oauth-login.d.ts.map +1 -1
- package/dist/pi-oauth-login.js +39 -5
- package/dist/pi-oauth-login.js.map +1 -1
- package/dist/posted-message-index.d.ts +35 -16
- package/dist/posted-message-index.d.ts.map +1 -1
- package/dist/posted-message-index.js +1068 -52
- package/dist/posted-message-index.js.map +1 -1
- package/dist/posted-reply-history.d.ts +17 -0
- package/dist/posted-reply-history.d.ts.map +1 -0
- package/dist/posted-reply-history.js +169 -0
- package/dist/posted-reply-history.js.map +1 -0
- package/dist/proactive-notify.d.ts.map +1 -1
- package/dist/proactive-notify.js +6 -4
- package/dist/proactive-notify.js.map +1 -1
- package/dist/project-skills.d.ts +4 -0
- package/dist/project-skills.d.ts.map +1 -1
- package/dist/project-skills.js +99 -130
- package/dist/project-skills.js.map +1 -1
- package/dist/provider-setup.d.ts +0 -1
- package/dist/provider-setup.d.ts.map +1 -1
- package/dist/provider-setup.js +0 -3
- package/dist/provider-setup.js.map +1 -1
- package/dist/readiness-probe-worker.d.ts +61 -1
- package/dist/readiness-probe-worker.d.ts.map +1 -1
- package/dist/readiness-probe-worker.js +54 -58
- package/dist/readiness-probe-worker.js.map +1 -1
- package/dist/readiness-probe.d.ts +6 -9
- package/dist/readiness-probe.d.ts.map +1 -1
- package/dist/readiness-probe.js +30 -56
- package/dist/readiness-probe.js.map +1 -1
- package/dist/redact-secrets.d.ts +15 -0
- package/dist/redact-secrets.d.ts.map +1 -0
- package/dist/redact-secrets.js +65 -0
- package/dist/redact-secrets.js.map +1 -0
- package/dist/run-history.js +34 -24
- package/dist/run-history.js.map +1 -1
- package/dist/runtime-provenance.d.ts +8 -0
- package/dist/runtime-provenance.d.ts.map +1 -0
- package/dist/runtime-provenance.js +225 -0
- package/dist/runtime-provenance.js.map +1 -0
- package/dist/sandbox-manager.d.ts +4 -1
- package/dist/sandbox-manager.d.ts.map +1 -1
- package/dist/sandbox-manager.js +114 -273
- package/dist/sandbox-manager.js.map +1 -1
- package/dist/secure-file-replace.d.ts +49 -0
- package/dist/secure-file-replace.d.ts.map +1 -0
- package/dist/secure-file-replace.js +270 -0
- package/dist/secure-file-replace.js.map +1 -0
- package/dist/seen-conversations.d.ts +32 -5
- package/dist/seen-conversations.d.ts.map +1 -1
- package/dist/seen-conversations.js +145 -15
- package/dist/seen-conversations.js.map +1 -1
- package/dist/sessions.d.ts +20 -0
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +41 -6
- package/dist/sessions.js.map +1 -1
- package/dist/wizard/index.d.ts +2 -2
- package/dist/wizard/index.d.ts.map +1 -1
- package/dist/wizard/index.js +1 -1
- package/dist/wizard/index.js.map +1 -1
- package/dist/wizard/presets.d.ts +2 -1
- package/dist/wizard/presets.d.ts.map +1 -1
- package/dist/wizard/presets.js +2 -1
- package/dist/wizard/presets.js.map +1 -1
- package/dist/wizard/run.d.ts +0 -26
- package/dist/wizard/run.d.ts.map +1 -1
- package/dist/wizard/run.js +0 -53
- package/dist/wizard/run.js.map +1 -1
- package/package.json +22 -17
- package/schema/mono-agent.config.schema.json +45 -10
- package/skills/mono-agent-composer/SKILL.md +3 -3
- package/skills/mono-agent-composer/references/config-blueprint.md +123 -29
- package/skills/mono-agent-composer/references/discovery-questions.md +10 -8
- package/skills/mono-agent-composer/references/feature-coverage.md +90 -76
- package/skills/mono-agent-composer/references/package-map.md +6 -4
- package/skills/mono-agent-composer/references/playbooks.md +48 -27
- package/skills/mono-agent-composer/references/validation.md +16 -3
- package/dist/notify-runtime.d.ts +0 -26
- package/dist/notify-runtime.d.ts.map +0 -1
- package/dist/notify-runtime.js +0 -27
- package/dist/notify-runtime.js.map +0 -1
- package/dist/notify-tool.d.ts +0 -51
- package/dist/notify-tool.d.ts.map +0 -1
- package/dist/notify-tool.js +0 -182
- package/dist/notify-tool.js.map +0 -1
- package/dist/recipes/base.d.ts +0 -15
- package/dist/recipes/base.d.ts.map +0 -1
- package/dist/recipes/base.js +0 -51
- package/dist/recipes/base.js.map +0 -1
- package/dist/recipes/catalog.d.ts +0 -4
- package/dist/recipes/catalog.d.ts.map +0 -1
- package/dist/recipes/catalog.js +0 -525
- package/dist/recipes/catalog.js.map +0 -1
- package/dist/recipes/index.d.ts +0 -11
- package/dist/recipes/index.d.ts.map +0 -1
- package/dist/recipes/index.js +0 -14
- package/dist/recipes/index.js.map +0 -1
- package/dist/recipes/types.d.ts +0 -70
- package/dist/recipes/types.d.ts.map +0 -1
- package/dist/recipes/types.js +0 -15
- package/dist/recipes/types.js.map +0 -1
- package/dist/setup.d.ts +0 -29
- package/dist/setup.d.ts.map +0 -1
- package/dist/setup.js +0 -97
- package/dist/setup.js.map +0 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { type AgentContinuationOriginContext } from "@mono-agent/agent-contracts";
|
|
2
|
+
import type { ContinuationDeliveryReceipt, ContinuationMode, ContinuationState } from "./continuations.js";
|
|
3
|
+
export declare const CONTINUATION_STORE_SCHEMA_VERSION = 1;
|
|
4
|
+
export declare const CONTINUATION_RECORD_STORE_SCHEMA_VERSION = 3;
|
|
5
|
+
export declare const RECORDS_DIRECTORY = "records-v3";
|
|
6
|
+
export declare const TRANSACTION_FILE = "continuation-transaction-v3.json";
|
|
7
|
+
export declare const MANIFEST_FILE = "continuation-store-v3.json";
|
|
8
|
+
export declare const LEGACY_RECORDS_DIRECTORY = "records-v2";
|
|
9
|
+
export declare const LEGACY_TRANSACTION_FILE = "continuation-transaction-v2.json";
|
|
10
|
+
export declare const V2_ROLLBACK_GUARD = "UPGRADED-TO-RECORDS-V3";
|
|
11
|
+
export declare const ORIGIN_CONTEXT_GROUPS_DIRECTORY = "origin-context-groups-v1";
|
|
12
|
+
export declare const OWNER_DATABASE_FILE = "continuations-owner.sqlite";
|
|
13
|
+
export declare const ORIGIN_CONTEXTS_DIRECTORY = "origin-context-v1";
|
|
14
|
+
export declare const MAX_RECORD_BYTES: number;
|
|
15
|
+
export declare const MAX_TRANSACTION_BYTES: number;
|
|
16
|
+
export declare const MAX_MANIFEST_BYTES: number;
|
|
17
|
+
export declare const MAX_GENERATION_BYTES = 256;
|
|
18
|
+
export declare const MAX_LEGACY_STORE_BYTES: number;
|
|
19
|
+
export declare const DEFAULT_TERMINAL_MAX_RECORDS = 50000;
|
|
20
|
+
export declare const DEFAULT_TERMINAL_MAX_AGE_MS: number;
|
|
21
|
+
export declare const DEFAULT_CAPTURED_TEXT_MAX_RECORDS = 1000;
|
|
22
|
+
export declare const DEFAULT_CAPTURED_TEXT_MAX_AGE_MS: number;
|
|
23
|
+
export declare const MAX_CONTINUATION_ORIGIN_CONTEXT_BYTES: number;
|
|
24
|
+
export declare const MAX_CONTINUATION_ORIGIN_CONTEXT_MESSAGES = 64;
|
|
25
|
+
export declare const MAX_CONTINUATION_ORIGIN_CONTEXT_MESSAGE_BYTES: number;
|
|
26
|
+
export declare const MAX_CONTINUATION_ORIGIN_CONTEXT_STORE_BYTES: number;
|
|
27
|
+
export type ContinuationOriginContextState = "pending" | "pinned" | "abandoned" | "detached_latest" | "legacy_missing" | "scrubbed";
|
|
28
|
+
export interface ContinuationOriginContextReference {
|
|
29
|
+
readonly schemaVersion: 1;
|
|
30
|
+
readonly digest: string;
|
|
31
|
+
readonly bytes: number;
|
|
32
|
+
readonly messageCount: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ContinuationOriginContextPin {
|
|
35
|
+
readonly reference: ContinuationOriginContextReference;
|
|
36
|
+
release(): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export interface ContinuationRetentionOptions {
|
|
39
|
+
/** Metadata/idempotency tombstones retained after terminal compaction. Default 50,000. */
|
|
40
|
+
readonly terminalMaxRecords?: number;
|
|
41
|
+
/** Maximum terminal tombstone age. Default 365 days. */
|
|
42
|
+
readonly terminalMaxAgeMs?: number;
|
|
43
|
+
/** Captured synthesized text retained for operator retrieval. Default 1,000 records. */
|
|
44
|
+
readonly capturedTextMaxRecords?: number;
|
|
45
|
+
/** Captured text retention window. Default 30 days. */
|
|
46
|
+
readonly capturedTextMaxAgeMs?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface ContinuationStoreStats {
|
|
49
|
+
readonly format: "per-record-v3";
|
|
50
|
+
readonly records: number;
|
|
51
|
+
readonly active: number;
|
|
52
|
+
readonly unresolvedDelivery: number;
|
|
53
|
+
readonly deadLettered: number;
|
|
54
|
+
readonly terminalTombstones: number;
|
|
55
|
+
readonly compacted: number;
|
|
56
|
+
readonly capturedText: number;
|
|
57
|
+
readonly historyDegraded: number;
|
|
58
|
+
readonly limits: {
|
|
59
|
+
readonly terminalMaxRecords: number;
|
|
60
|
+
readonly terminalMaxAgeMs: number;
|
|
61
|
+
readonly capturedTextMaxRecords: number;
|
|
62
|
+
readonly capturedTextMaxAgeMs: number;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface ContinuationLastError {
|
|
66
|
+
readonly code: string;
|
|
67
|
+
readonly reason: string;
|
|
68
|
+
readonly at: string;
|
|
69
|
+
}
|
|
70
|
+
export interface DurableContinuationRecord {
|
|
71
|
+
readonly continuationId: string;
|
|
72
|
+
readonly serverName: string;
|
|
73
|
+
readonly originRunId: string;
|
|
74
|
+
readonly originConversationId: string;
|
|
75
|
+
readonly replyToConversationId?: string;
|
|
76
|
+
readonly historyBoundary?: string;
|
|
77
|
+
originContextState: ContinuationOriginContextState;
|
|
78
|
+
originContextRef?: ContinuationOriginContextReference;
|
|
79
|
+
/** Retained after terminal snapshot scrubbing for audit/idempotency. */
|
|
80
|
+
originContextDigest?: string;
|
|
81
|
+
originContextMessageCount?: number;
|
|
82
|
+
/** Domain-separated binding of the v1 claim fingerprint and pinned digest. */
|
|
83
|
+
originContextFingerprint?: string;
|
|
84
|
+
/** Store-only HMAC over the immutable claim, route, task, and snapshot binding. */
|
|
85
|
+
originContextBindingMac?: string;
|
|
86
|
+
completionKind?: "synthesized" | "origin_context_unavailable";
|
|
87
|
+
readonly mode: ContinuationMode;
|
|
88
|
+
readonly routeName?: string;
|
|
89
|
+
readonly taskKey: string;
|
|
90
|
+
readonly taskHash: string;
|
|
91
|
+
readonly claimFingerprint: string;
|
|
92
|
+
readonly resultTokenHash: string;
|
|
93
|
+
readonly createdAt: string;
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
readonly deadline: string;
|
|
96
|
+
state: ContinuationState;
|
|
97
|
+
resultIdempotencyKey?: string;
|
|
98
|
+
resultPayloadHash?: string;
|
|
99
|
+
resultPayload?: unknown;
|
|
100
|
+
synthesisAttempts: number;
|
|
101
|
+
synthesisDeferrals: number;
|
|
102
|
+
synthesisStartedAt?: string;
|
|
103
|
+
synthesizedText?: string;
|
|
104
|
+
actionable?: boolean;
|
|
105
|
+
deliveryAttempts: number;
|
|
106
|
+
deliveryStartedAt?: string;
|
|
107
|
+
nextAttemptAt?: string;
|
|
108
|
+
leaseOwner?: string;
|
|
109
|
+
leaseUntil?: string;
|
|
110
|
+
lastError?: ContinuationLastError;
|
|
111
|
+
receipt?: ContinuationDeliveryReceipt;
|
|
112
|
+
/** Set once bulky terminal payload/text fields have been removed. */
|
|
113
|
+
compactedAt?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ContinuationStoreFile {
|
|
116
|
+
readonly schemaVersion: typeof CONTINUATION_STORE_SCHEMA_VERSION;
|
|
117
|
+
readonly updatedAt: string;
|
|
118
|
+
readonly records: Record<string, DurableContinuationRecord>;
|
|
119
|
+
}
|
|
120
|
+
export interface ResolvedContinuationRetention {
|
|
121
|
+
readonly terminalMaxRecords: number;
|
|
122
|
+
readonly terminalMaxAgeMs: number;
|
|
123
|
+
readonly capturedTextMaxRecords: number;
|
|
124
|
+
readonly capturedTextMaxAgeMs: number;
|
|
125
|
+
}
|
|
126
|
+
export interface ContinuationRecordTransaction {
|
|
127
|
+
readonly schemaVersion: 2 | typeof CONTINUATION_RECORD_STORE_SCHEMA_VERSION;
|
|
128
|
+
readonly generation: string;
|
|
129
|
+
readonly createdAt: string;
|
|
130
|
+
readonly writes: readonly DurableContinuationRecord[];
|
|
131
|
+
readonly deletes: readonly string[];
|
|
132
|
+
}
|
|
133
|
+
export interface ContinuationStoreManifest {
|
|
134
|
+
readonly schemaVersion: typeof CONTINUATION_RECORD_STORE_SCHEMA_VERSION;
|
|
135
|
+
readonly generation: string;
|
|
136
|
+
readonly updatedAt: string;
|
|
137
|
+
/** False only for a fresh evidence-free store. Absent means true for eager-guard manifests; true is monotonic. */
|
|
138
|
+
readonly rollbackGuardRequired?: boolean;
|
|
139
|
+
readonly stats: ContinuationStoreStats;
|
|
140
|
+
}
|
|
141
|
+
export interface ContinuationOriginContextGroupCommit {
|
|
142
|
+
readonly schemaVersion: 1;
|
|
143
|
+
readonly groupKey: string;
|
|
144
|
+
readonly originRunId: string;
|
|
145
|
+
readonly originConversationId: string;
|
|
146
|
+
readonly historyBoundary: string;
|
|
147
|
+
readonly snapshotDigest: string;
|
|
148
|
+
readonly memberCount: number;
|
|
149
|
+
readonly memberSetDigest: string;
|
|
150
|
+
readonly activatedAt: string;
|
|
151
|
+
}
|
|
152
|
+
export interface ContinuationStore {
|
|
153
|
+
readonly path: string;
|
|
154
|
+
get(id: string): Promise<DurableContinuationRecord | undefined>;
|
|
155
|
+
list(): Promise<readonly DurableContinuationRecord[]>;
|
|
156
|
+
findClaim(input: {
|
|
157
|
+
readonly serverName: string;
|
|
158
|
+
readonly originRunId: string;
|
|
159
|
+
readonly taskKey: string;
|
|
160
|
+
}): Promise<DurableContinuationRecord | undefined>;
|
|
161
|
+
stats(): Promise<ContinuationStoreStats>;
|
|
162
|
+
stageOriginContext(snapshot: AgentContinuationOriginContext): Promise<ContinuationOriginContextPin>;
|
|
163
|
+
loadOriginContext(reference: ContinuationOriginContextReference): Promise<AgentContinuationOriginContext | undefined>;
|
|
164
|
+
activateOriginContextGroup(input: {
|
|
165
|
+
readonly claimFingerprint: string;
|
|
166
|
+
readonly activatedAt: string;
|
|
167
|
+
}): Promise<void>;
|
|
168
|
+
mutate<T>(operation: (records: Map<string, DurableContinuationRecord>) => T | Promise<T>): Promise<T>;
|
|
169
|
+
}
|
|
170
|
+
export interface ContinuationStoreLock {
|
|
171
|
+
release(): Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=continuation-store-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation-store-types.d.ts","sourceRoot":"","sources":["../src/continuation-store-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,8BAA8B,EACpC,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EACV,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,iCAAiC,IAAI,CAAC;AACnD,eAAO,MAAM,wCAAwC,IAAI,CAAC;AAE1D,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,eAAO,MAAM,gBAAgB,qCAAqC,CAAC;AACnE,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAC1D,eAAO,MAAM,wBAAwB,eAAe,CAAC;AACrD,eAAO,MAAM,uBAAuB,qCAAqC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAC1D,eAAO,MAAM,+BAA+B,6BAA6B,CAAC;AAC1E,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAChE,eAAO,MAAM,yBAAyB,sBAAsB,CAAC;AAC7D,eAAO,MAAM,gBAAgB,QAAkB,CAAC;AAChD,eAAO,MAAM,qBAAqB,QAAmB,CAAC;AACtD,eAAO,MAAM,kBAAkB,QAAc,CAAC;AAC9C,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,sBAAsB,QAAoB,CAAC;AACxD,eAAO,MAAM,4BAA4B,Q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MESSAGE_BYTES, AGENT_CONTINUATION_ORIGIN_CONTEXT_MAX_MESSAGES, } from "@mono-agent/agent-contracts";
|
|
2
|
+
export const CONTINUATION_STORE_SCHEMA_VERSION = 1;
|
|
3
|
+
export const CONTINUATION_RECORD_STORE_SCHEMA_VERSION = 3;
|
|
4
|
+
export const RECORDS_DIRECTORY = "records-v3";
|
|
5
|
+
export const TRANSACTION_FILE = "continuation-transaction-v3.json";
|
|
6
|
+
export const MANIFEST_FILE = "continuation-store-v3.json";
|
|
7
|
+
export const LEGACY_RECORDS_DIRECTORY = "records-v2";
|
|
8
|
+
export const LEGACY_TRANSACTION_FILE = "continuation-transaction-v2.json";
|
|
9
|
+
export const V2_ROLLBACK_GUARD = "UPGRADED-TO-RECORDS-V3";
|
|
10
|
+
export const ORIGIN_CONTEXT_GROUPS_DIRECTORY = "origin-context-groups-v1";
|
|
11
|
+
export const OWNER_DATABASE_FILE = "continuations-owner.sqlite";
|
|
12
|
+
export const ORIGIN_CONTEXTS_DIRECTORY = "origin-context-v1";
|
|
13
|
+
export const MAX_RECORD_BYTES = 2 * 1024 * 1024;
|
|
14
|
+
export const MAX_TRANSACTION_BYTES = 16 * 1024 * 1024;
|
|
15
|
+
export const MAX_MANIFEST_BYTES = 1024 * 1024;
|
|
16
|
+
export const MAX_GENERATION_BYTES = 256;
|
|
17
|
+
export const MAX_LEGACY_STORE_BYTES = 256 * 1024 * 1024;
|
|
18
|
+
export const DEFAULT_TERMINAL_MAX_RECORDS = 50_000;
|
|
19
|
+
export const DEFAULT_TERMINAL_MAX_AGE_MS = 365 * 24 * 60 * 60 * 1_000;
|
|
20
|
+
export const DEFAULT_CAPTURED_TEXT_MAX_RECORDS = 1_000;
|
|
21
|
+
export const DEFAULT_CAPTURED_TEXT_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1_000;
|
|
22
|
+
export const MAX_CONTINUATION_ORIGIN_CONTEXT_BYTES = AGENT_CONTINUATION_ORIGIN_CONTEXT_MAX_BYTES;
|
|
23
|
+
export const MAX_CONTINUATION_ORIGIN_CONTEXT_MESSAGES = AGENT_CONTINUATION_ORIGIN_CONTEXT_MAX_MESSAGES;
|
|
24
|
+
export const MAX_CONTINUATION_ORIGIN_CONTEXT_MESSAGE_BYTES = AGENT_CONTINUATION_ORIGIN_CONTEXT_MAX_MESSAGE_BYTES;
|
|
25
|
+
export const MAX_CONTINUATION_ORIGIN_CONTEXT_STORE_BYTES = 256 * 1024 * 1024;
|
|
26
|
+
//# sourceMappingURL=continuation-store-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation-store-types.js","sourceRoot":"","sources":["../src/continuation-store-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,mDAAmD,EACnD,8CAA8C,GAE/C,MAAM,6BAA6B,CAAC;AAQrC,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AACnE,MAAM,CAAC,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAC1D,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,kCAAkC,CAAC;AAC1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAC1D,MAAM,CAAC,MAAM,+BAA+B,GAAG,0BAA0B,CAAC;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,4BAA4B,CAAC;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAC7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;AACnD,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AACtE,MAAM,CAAC,MAAM,iCAAiC,GAAG,KAAK,CAAC;AACvD,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAC1E,MAAM,CAAC,MAAM,qCAAqC,GAAG,2CAA2C,CAAC;AACjG,MAAM,CAAC,MAAM,wCAAwC,GAAG,8CAA8C,CAAC;AACvG,MAAM,CAAC,MAAM,6CAA6C,GAAG,mDAAmD,CAAC;AACjH,MAAM,CAAC,MAAM,2CAA2C,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
|
@@ -1,143 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export declare const MAX_CONTINUATION_ORIGIN_CONTEXT_BYTES: number;
|
|
6
|
-
export declare const MAX_CONTINUATION_ORIGIN_CONTEXT_MESSAGES = 64;
|
|
7
|
-
export declare const MAX_CONTINUATION_ORIGIN_CONTEXT_MESSAGE_BYTES: number;
|
|
8
|
-
export declare const MAX_CONTINUATION_ORIGIN_CONTEXT_STORE_BYTES: number;
|
|
9
|
-
export type ContinuationOriginContextState = "pending" | "pinned" | "abandoned" | "detached_latest" | "legacy_missing" | "scrubbed";
|
|
10
|
-
export interface ContinuationOriginContextReference {
|
|
11
|
-
readonly schemaVersion: 1;
|
|
12
|
-
readonly digest: string;
|
|
13
|
-
readonly bytes: number;
|
|
14
|
-
readonly messageCount: number;
|
|
15
|
-
}
|
|
16
|
-
export interface ContinuationOriginContextPin {
|
|
17
|
-
readonly reference: ContinuationOriginContextReference;
|
|
18
|
-
release(): Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
export interface ContinuationRetentionOptions {
|
|
21
|
-
/** Metadata/idempotency tombstones retained after terminal compaction. Default 50,000. */
|
|
22
|
-
readonly terminalMaxRecords?: number;
|
|
23
|
-
/** Maximum terminal tombstone age. Default 365 days. */
|
|
24
|
-
readonly terminalMaxAgeMs?: number;
|
|
25
|
-
/** Captured synthesized text retained for operator retrieval. Default 1,000 records. */
|
|
26
|
-
readonly capturedTextMaxRecords?: number;
|
|
27
|
-
/** Captured text retention window. Default 30 days. */
|
|
28
|
-
readonly capturedTextMaxAgeMs?: number;
|
|
29
|
-
}
|
|
30
|
-
export interface ContinuationStoreStats {
|
|
31
|
-
readonly format: "per-record-v3";
|
|
32
|
-
readonly records: number;
|
|
33
|
-
readonly active: number;
|
|
34
|
-
readonly unresolvedDelivery: number;
|
|
35
|
-
readonly deadLettered: number;
|
|
36
|
-
readonly terminalTombstones: number;
|
|
37
|
-
readonly compacted: number;
|
|
38
|
-
readonly capturedText: number;
|
|
39
|
-
readonly historyDegraded: number;
|
|
40
|
-
readonly limits: {
|
|
41
|
-
readonly terminalMaxRecords: number;
|
|
42
|
-
readonly terminalMaxAgeMs: number;
|
|
43
|
-
readonly capturedTextMaxRecords: number;
|
|
44
|
-
readonly capturedTextMaxAgeMs: number;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export interface ContinuationLastError {
|
|
48
|
-
readonly code: string;
|
|
49
|
-
readonly reason: string;
|
|
50
|
-
readonly at: string;
|
|
51
|
-
}
|
|
52
|
-
export interface DurableContinuationRecord {
|
|
53
|
-
readonly continuationId: string;
|
|
54
|
-
readonly serverName: string;
|
|
55
|
-
readonly originRunId: string;
|
|
56
|
-
readonly originConversationId: string;
|
|
57
|
-
readonly replyToConversationId?: string;
|
|
58
|
-
readonly historyBoundary?: string;
|
|
59
|
-
originContextState: ContinuationOriginContextState;
|
|
60
|
-
originContextRef?: ContinuationOriginContextReference;
|
|
61
|
-
/** Retained after terminal snapshot scrubbing for audit/idempotency. */
|
|
62
|
-
originContextDigest?: string;
|
|
63
|
-
originContextMessageCount?: number;
|
|
64
|
-
/** Domain-separated binding of the v1 claim fingerprint and pinned digest. */
|
|
65
|
-
originContextFingerprint?: string;
|
|
66
|
-
/** Store-only HMAC over the immutable claim, route, task, and snapshot binding. */
|
|
67
|
-
originContextBindingMac?: string;
|
|
68
|
-
completionKind?: "synthesized" | "origin_context_unavailable";
|
|
69
|
-
readonly mode: ContinuationMode;
|
|
70
|
-
readonly routeName?: string;
|
|
71
|
-
readonly taskKey: string;
|
|
72
|
-
readonly taskHash: string;
|
|
73
|
-
readonly claimFingerprint: string;
|
|
74
|
-
readonly resultTokenHash: string;
|
|
75
|
-
readonly createdAt: string;
|
|
76
|
-
updatedAt: string;
|
|
77
|
-
readonly deadline: string;
|
|
78
|
-
state: ContinuationState;
|
|
79
|
-
resultIdempotencyKey?: string;
|
|
80
|
-
resultPayloadHash?: string;
|
|
81
|
-
resultPayload?: unknown;
|
|
82
|
-
synthesisAttempts: number;
|
|
83
|
-
synthesisDeferrals: number;
|
|
84
|
-
synthesisStartedAt?: string;
|
|
85
|
-
synthesizedText?: string;
|
|
86
|
-
actionable?: boolean;
|
|
87
|
-
deliveryAttempts: number;
|
|
88
|
-
deliveryStartedAt?: string;
|
|
89
|
-
nextAttemptAt?: string;
|
|
90
|
-
leaseOwner?: string;
|
|
91
|
-
leaseUntil?: string;
|
|
92
|
-
lastError?: ContinuationLastError;
|
|
93
|
-
receipt?: ContinuationDeliveryReceipt;
|
|
94
|
-
/** Set once bulky terminal payload/text fields have been removed. */
|
|
95
|
-
compactedAt?: string;
|
|
96
|
-
}
|
|
97
|
-
export interface ContinuationStore {
|
|
98
|
-
readonly path: string;
|
|
99
|
-
get(id: string): Promise<DurableContinuationRecord | undefined>;
|
|
100
|
-
list(): Promise<readonly DurableContinuationRecord[]>;
|
|
101
|
-
findClaim(input: {
|
|
102
|
-
readonly serverName: string;
|
|
103
|
-
readonly originRunId: string;
|
|
104
|
-
readonly taskKey: string;
|
|
105
|
-
}): Promise<DurableContinuationRecord | undefined>;
|
|
106
|
-
stats(): Promise<ContinuationStoreStats>;
|
|
107
|
-
stageOriginContext(snapshot: AgentContinuationOriginContext): Promise<ContinuationOriginContextPin>;
|
|
108
|
-
loadOriginContext(reference: ContinuationOriginContextReference): Promise<AgentContinuationOriginContext | undefined>;
|
|
109
|
-
/**
|
|
110
|
-
* Atomically publishes every prepared context in one immutable origin group.
|
|
111
|
-
* A compact durable group marker is the semantic commit point, so activation
|
|
112
|
-
* remains all-or-nothing even when materializing the individual records takes
|
|
113
|
-
* more than one bounded transaction.
|
|
114
|
-
*/
|
|
115
|
-
activateOriginContextGroup(input: {
|
|
116
|
-
readonly claimFingerprint: string;
|
|
117
|
-
readonly activatedAt: string;
|
|
118
|
-
}): Promise<void>;
|
|
119
|
-
mutate<T>(operation: (records: Map<string, DurableContinuationRecord>) => T | Promise<T>): Promise<T>;
|
|
120
|
-
}
|
|
121
|
-
export interface ContinuationStoreLock {
|
|
122
|
-
release(): Promise<void>;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Claim exclusive ownership of a continuation state directory for this process.
|
|
126
|
-
* SQLite holds an OS-backed exclusive transaction for the process lifetime.
|
|
127
|
-
* There is no stale-path cleanup race: close or process death releases the OS
|
|
128
|
-
* lock, and SQLite performs any required journal recovery for the next owner.
|
|
129
|
-
*/
|
|
130
|
-
export declare function acquireContinuationStoreLock(stateDir: string): Promise<ContinuationStoreLock>;
|
|
131
|
-
/**
|
|
132
|
-
* Open the bounded per-record store. Each continuation has its own atomic 0600
|
|
133
|
-
* file, so a result mutates O(1) durable data instead of rewriting every prior
|
|
134
|
-
* payload. A tiny write-ahead transaction makes multi-record maintenance
|
|
135
|
-
* restart-safe. The legacy v1 monolith is migrated idempotently on first open.
|
|
136
|
-
*/
|
|
1
|
+
import { type ContinuationRetentionOptions, type ContinuationStore } from "./continuation-store-types.js";
|
|
2
|
+
export { acquireContinuationStoreLock, loadOrCreateContinuationSecret, } from "./continuation-store-fs.js";
|
|
3
|
+
export { CONTINUATION_RECORD_STORE_SCHEMA_VERSION, CONTINUATION_STORE_SCHEMA_VERSION, MAX_CONTINUATION_ORIGIN_CONTEXT_BYTES, MAX_CONTINUATION_ORIGIN_CONTEXT_MESSAGES, MAX_CONTINUATION_ORIGIN_CONTEXT_MESSAGE_BYTES, MAX_CONTINUATION_ORIGIN_CONTEXT_STORE_BYTES, } from "./continuation-store-types.js";
|
|
4
|
+
export type { ContinuationLastError, ContinuationOriginContextPin, ContinuationOriginContextReference, ContinuationOriginContextState, ContinuationRetentionOptions, ContinuationStore, ContinuationStoreLock, ContinuationStoreStats, DurableContinuationRecord, } from "./continuation-store-types.js";
|
|
137
5
|
export declare function openContinuationStore(stateDir: string, options?: {
|
|
138
6
|
readonly retention?: ContinuationRetentionOptions;
|
|
139
7
|
readonly now?: () => Date;
|
|
140
8
|
}): Promise<ContinuationStore>;
|
|
141
|
-
/** Persistent owner-only key used to derive restart-stable callback capabilities. */
|
|
142
|
-
export declare function loadOrCreateContinuationSecret(stateDir: string): Promise<Buffer>;
|
|
143
9
|
//# sourceMappingURL=continuation-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuation-store.d.ts","sourceRoot":"","sources":["../src/continuation-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"continuation-store.d.ts","sourceRoot":"","sources":["../src/continuation-store.ts"],"names":[],"mappings":"AAsDA,OAAO,EAeL,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EAEvB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,wCAAwC,EACxC,iCAAiC,EACjC,qCAAqC,EACrC,wCAAwC,EACxC,6CAA6C,EAC7C,2CAA2C,GAC5C,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,qBAAqB,EACrB,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,4BAA4B,EAC5B,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,+BAA+B,CAAC;AAEvC,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IACP,QAAQ,CAAC,SAAS,CAAC,EAAE,4BAA4B,CAAC;IAClD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,GACL,OAAO,CAAC,iBAAiB,CAAC,CA+c5B"}
|