@earendil-works/pi-durable 1.3.0 → 1.5.0
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/CHANGELOG.md +227 -0
- package/README.md +287 -82
- package/dist/codemode/codemode.d.ts +4 -4
- package/dist/codemode/codemode.d.ts.map +1 -1
- package/dist/codemode/codemode.js +21 -16
- package/dist/codemode/codemode.js.map +1 -1
- package/dist/codemode/models.d.ts.map +1 -1
- package/dist/codemode/models.js +6 -4
- package/dist/codemode/models.js.map +1 -1
- package/dist/documents.d.ts +1 -1
- package/dist/documents.d.ts.map +1 -1
- package/dist/documents.js.map +1 -1
- package/dist/env/index.d.ts +12 -10
- package/dist/env/index.d.ts.map +1 -1
- package/dist/env/index.js.map +1 -1
- package/dist/env/node-watch.d.ts +3 -3
- package/dist/env/node-watch.d.ts.map +1 -1
- package/dist/env/node-watch.js +18 -16
- package/dist/env/node-watch.js.map +1 -1
- package/dist/env/node.d.ts +2 -2
- package/dist/env/node.d.ts.map +1 -1
- package/dist/env/node.js +12 -4
- package/dist/env/node.js.map +1 -1
- package/dist/errors.d.ts +18 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +26 -3
- package/dist/errors.js.map +1 -1
- package/dist/harness/agent.d.ts +13 -2
- package/dist/harness/agent.d.ts.map +1 -1
- package/dist/harness/agent.js +48 -6
- package/dist/harness/agent.js.map +1 -1
- package/dist/harness/compaction.d.ts +3 -1
- package/dist/harness/compaction.d.ts.map +1 -1
- package/dist/harness/compaction.js +38 -6
- package/dist/harness/compaction.js.map +1 -1
- package/dist/harness/context.d.ts +23 -7
- package/dist/harness/context.d.ts.map +1 -1
- package/dist/harness/context.js +71 -25
- package/dist/harness/context.js.map +1 -1
- package/dist/harness/define.d.ts +7 -3
- package/dist/harness/define.d.ts.map +1 -1
- package/dist/harness/define.js +4 -0
- package/dist/harness/define.js.map +1 -1
- package/dist/harness/generation.d.ts +38 -5
- package/dist/harness/generation.d.ts.map +1 -1
- package/dist/harness/generation.js +497 -108
- package/dist/harness/generation.js.map +1 -1
- package/dist/harness/harness.d.ts +7 -2
- package/dist/harness/harness.d.ts.map +1 -1
- package/dist/harness/harness.js +147 -57
- package/dist/harness/harness.js.map +1 -1
- package/dist/harness/inbox.d.ts +7 -3
- package/dist/harness/inbox.d.ts.map +1 -1
- package/dist/harness/inbox.js +7 -4
- package/dist/harness/inbox.js.map +1 -1
- package/dist/harness/json.d.ts +20 -4
- package/dist/harness/json.d.ts.map +1 -1
- package/dist/harness/json.js +23 -5
- package/dist/harness/json.js.map +1 -1
- package/dist/harness/live.d.ts +122 -16
- package/dist/harness/live.d.ts.map +1 -1
- package/dist/harness/live.js +93 -12
- package/dist/harness/live.js.map +1 -1
- package/dist/harness/partial-changes.d.ts +54 -0
- package/dist/harness/partial-changes.d.ts.map +1 -0
- package/dist/harness/partial-changes.js +162 -0
- package/dist/harness/partial-changes.js.map +1 -0
- package/dist/harness/prompt.d.ts +1 -1
- package/dist/harness/prompt.d.ts.map +1 -1
- package/dist/harness/prompt.js +1 -1
- package/dist/harness/prompt.js.map +1 -1
- package/dist/harness/registry-reader.d.ts +11 -0
- package/dist/harness/registry-reader.d.ts.map +1 -0
- package/dist/harness/registry-reader.js +25 -0
- package/dist/harness/registry-reader.js.map +1 -0
- package/dist/harness/scheduler.d.ts +86 -14
- package/dist/harness/scheduler.d.ts.map +1 -1
- package/dist/harness/scheduler.js +1459 -369
- package/dist/harness/scheduler.js.map +1 -1
- package/dist/harness/submissions.d.ts +23 -11
- package/dist/harness/submissions.d.ts.map +1 -1
- package/dist/harness/submissions.js +104 -36
- package/dist/harness/submissions.js.map +1 -1
- package/dist/harness/task-graph.d.ts +28 -8
- package/dist/harness/task-graph.d.ts.map +1 -1
- package/dist/harness/task-graph.js +85 -36
- package/dist/harness/task-graph.js.map +1 -1
- package/dist/harness/telemetry.d.ts +307 -0
- package/dist/harness/telemetry.d.ts.map +1 -0
- package/dist/harness/telemetry.js +136 -0
- package/dist/harness/telemetry.js.map +1 -0
- package/dist/harness/tool.d.ts +2 -0
- package/dist/harness/tool.d.ts.map +1 -1
- package/dist/harness/tool.js +223 -61
- package/dist/harness/tool.js.map +1 -1
- package/dist/harness/transcript.d.ts +72 -0
- package/dist/harness/transcript.d.ts.map +1 -0
- package/dist/harness/transcript.js +264 -0
- package/dist/harness/transcript.js.map +1 -0
- package/dist/harness/types.d.ts +302 -48
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js.map +1 -1
- package/dist/harness/util.d.ts +7 -1
- package/dist/harness/util.d.ts.map +1 -1
- package/dist/harness/util.js +13 -0
- package/dist/harness/util.js.map +1 -1
- package/dist/harness/view.d.ts +43 -22
- package/dist/harness/view.d.ts.map +1 -1
- package/dist/harness/view.js +130 -71
- package/dist/harness/view.js.map +1 -1
- package/dist/index.d.ts +13 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/search.d.ts +19 -3
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +107 -44
- package/dist/search.js.map +1 -1
- package/dist/session/cached-storage.d.ts +71 -0
- package/dist/session/cached-storage.d.ts.map +1 -0
- package/dist/session/cached-storage.js +269 -0
- package/dist/session/cached-storage.js.map +1 -0
- package/dist/session/conversation-tails.d.ts +33 -0
- package/dist/session/conversation-tails.d.ts.map +1 -0
- package/dist/session/conversation-tails.js +101 -0
- package/dist/session/conversation-tails.js.map +1 -0
- package/dist/session/keys.d.ts +68 -0
- package/dist/session/keys.d.ts.map +1 -0
- package/dist/session/keys.js +161 -0
- package/dist/session/keys.js.map +1 -0
- package/dist/session/session.d.ts +181 -29
- package/dist/session/session.d.ts.map +1 -1
- package/dist/session/session.js +1073 -183
- package/dist/session/session.js.map +1 -1
- package/dist/session/transaction.d.ts +86 -4
- package/dist/session/transaction.d.ts.map +1 -1
- package/dist/session/transaction.js +250 -38
- package/dist/session/transaction.js.map +1 -1
- package/dist/session/writer.d.ts +74 -0
- package/dist/session/writer.d.ts.map +1 -0
- package/dist/session/writer.js +294 -0
- package/dist/session/writer.js.map +1 -0
- package/dist/storage/indexeddb.d.ts +68 -0
- package/dist/storage/indexeddb.d.ts.map +1 -0
- package/dist/storage/indexeddb.js +881 -0
- package/dist/storage/indexeddb.js.map +1 -0
- package/dist/storage/jsonl/storage.d.ts +30 -2
- package/dist/storage/jsonl/storage.d.ts.map +1 -1
- package/dist/storage/jsonl/storage.js +88 -24
- package/dist/storage/jsonl/storage.js.map +1 -1
- package/dist/storage/memory.d.ts +7 -2
- package/dist/storage/memory.d.ts.map +1 -1
- package/dist/storage/memory.js +29 -3
- package/dist/storage/memory.js.map +1 -1
- package/dist/storage/sqlite/cloudflare.d.ts +2 -51
- package/dist/storage/sqlite/cloudflare.d.ts.map +1 -1
- package/dist/storage/sqlite/cloudflare.js +2 -133
- package/dist/storage/sqlite/cloudflare.js.map +1 -1
- package/dist/storage/sqlite/database.d.ts +1 -36
- package/dist/storage/sqlite/database.d.ts.map +1 -1
- package/dist/storage/sqlite/database.js.map +1 -1
- package/dist/storage/sqlite/index.d.ts +1 -1
- package/dist/storage/sqlite/index.d.ts.map +1 -1
- package/dist/storage/sqlite/index.js.map +1 -1
- package/dist/storage/sqlite/migrations.d.ts +2 -5
- package/dist/storage/sqlite/migrations.d.ts.map +1 -1
- package/dist/storage/sqlite/migrations.js +28 -28
- package/dist/storage/sqlite/migrations.js.map +1 -1
- package/dist/storage/sqlite/node.d.ts +2 -37
- package/dist/storage/sqlite/node.d.ts.map +1 -1
- package/dist/storage/sqlite/node.js +3 -174
- package/dist/storage/sqlite/node.js.map +1 -1
- package/dist/storage/sqlite/schema.d.ts +1 -3
- package/dist/storage/sqlite/schema.d.ts.map +1 -1
- package/dist/storage/sqlite/schema.js +2 -9
- package/dist/storage/sqlite/schema.js.map +1 -1
- package/dist/storage/sqlite/storage.d.ts +15 -3
- package/dist/storage/sqlite/storage.d.ts.map +1 -1
- package/dist/storage/sqlite/storage.js +110 -36
- package/dist/storage/sqlite/storage.js.map +1 -1
- package/dist/storage/store/commit.d.ts +33 -0
- package/dist/storage/store/commit.d.ts.map +1 -0
- package/dist/storage/store/commit.js +286 -0
- package/dist/storage/store/commit.js.map +1 -0
- package/dist/storage/store/documents.d.ts +43 -0
- package/dist/storage/store/documents.d.ts.map +1 -0
- package/dist/storage/store/documents.js +102 -0
- package/dist/storage/store/documents.js.map +1 -0
- package/dist/storage/store/index.d.ts +2 -0
- package/dist/storage/store/index.d.ts.map +1 -0
- package/dist/storage/store/index.js +2 -0
- package/dist/storage/store/index.js.map +1 -0
- package/dist/storage/store/queries.d.ts +49 -0
- package/dist/storage/store/queries.d.ts.map +1 -0
- package/dist/storage/store/queries.js +93 -0
- package/dist/storage/store/queries.js.map +1 -0
- package/dist/storage/store/storage.d.ts +59 -0
- package/dist/storage/store/storage.d.ts.map +1 -0
- package/dist/storage/store/storage.js +438 -0
- package/dist/storage/store/storage.js.map +1 -0
- package/dist/storage/store/tables.d.ts +54 -0
- package/dist/storage/store/tables.d.ts.map +1 -0
- package/dist/storage/store/tables.js +108 -0
- package/dist/storage/store/tables.js.map +1 -0
- package/dist/testing/commit-writes.d.ts +5 -0
- package/dist/testing/commit-writes.d.ts.map +1 -0
- package/dist/testing/commit-writes.js +12 -0
- package/dist/testing/commit-writes.js.map +1 -0
- package/dist/testing/env-conformance.js +7 -7
- package/dist/testing/env-conformance.js.map +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/storage-benchmark.d.ts.map +1 -1
- package/dist/testing/storage-benchmark.js +18 -17
- package/dist/testing/storage-benchmark.js.map +1 -1
- package/dist/testing/storage-conformance.d.ts.map +1 -1
- package/dist/testing/storage-conformance.js +369 -67
- package/dist/testing/storage-conformance.js.map +1 -1
- package/dist/timers.d.ts +21 -0
- package/dist/timers.d.ts.map +1 -0
- package/dist/timers.js +72 -0
- package/dist/timers.js.map +1 -0
- package/dist/tool-search/tool-search.d.ts +6 -12
- package/dist/tool-search/tool-search.d.ts.map +1 -1
- package/dist/tool-search/tool-search.js +7 -7
- package/dist/tool-search/tool-search.js.map +1 -1
- package/dist/tools/bash.d.ts +12 -12
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +16 -15
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/edit.d.ts +7 -7
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +9 -9
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/index.d.ts +32 -32
- package/dist/tools/read.d.ts +6 -6
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +19 -8
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/write.d.ts +4 -4
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +5 -5
- package/dist/tools/write.js.map +1 -1
- package/dist/types.d.ts +331 -64
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +27 -10
- package/dist/harness/events.d.ts +0 -186
- package/dist/harness/events.d.ts.map +0 -1
- package/dist/harness/events.js +0 -373
- package/dist/harness/events.js.map +0 -1
- package/dist/session/observation.d.ts +0 -42
- package/dist/session/observation.d.ts.map +0 -1
- package/dist/session/observation.js +0 -281
- package/dist/session/observation.js.map +0 -1
|
@@ -3,9 +3,18 @@ import type { Models } from "@earendil-works/pi-ai";
|
|
|
3
3
|
import type { ExecutionEnv } from "../env/index.ts";
|
|
4
4
|
import type { SessionImpl } from "../session/session.ts";
|
|
5
5
|
import type { Transaction } from "../session/transaction.ts";
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
6
|
+
import type { Timers } from "../timers.ts";
|
|
7
|
+
import type { ConversationId, ReportInfo, Storage, StorageWrite, TaskId, TaskOutcome, TaskRecord, TaskState } from "../types.ts";
|
|
8
|
+
import type { Agent, ConversationHandle, HarnessInspection, HarnessOptions, RegistryReader, RegistrySnapshot, Settings, SettledTask, TaskInspection, Wake } from "./types.ts";
|
|
8
9
|
type AnyTaskRecord = TaskRecord<JsonValue, JsonValue, JsonValue>;
|
|
10
|
+
/** What `blockedReason()` reads of a task: the task graph keeps only this of each record. */
|
|
11
|
+
export type BlockedSubject = Pick<AnyTaskRecord, "id" | "kind" | "version" | "abortRequested" | "abortReason"> & {
|
|
12
|
+
readonly status: TaskState<JsonValue, JsonValue>["status"];
|
|
13
|
+
};
|
|
14
|
+
/** The part of a record `blockedReason()` reads. */
|
|
15
|
+
export declare function blockedSubject(record: AnyTaskRecord): BlockedSubject;
|
|
16
|
+
/** Why a task cannot be reserved: no registered definition can take it. Derived from the registry. */
|
|
17
|
+
export type BlockedReason = "missing_task" | "task_too_old" | "migration_failed";
|
|
9
18
|
/** Terminal outcomes the scheduler writes without running task code. */
|
|
10
19
|
export type SchedulerOutcome = Extract<TaskOutcome<JsonValue>, {
|
|
11
20
|
readonly status: "faulted" | "orphaned";
|
|
@@ -16,10 +25,12 @@ export type InvocationBinding = {
|
|
|
16
25
|
check(): void;
|
|
17
26
|
};
|
|
18
27
|
export type TaskSchedulerOptions = {
|
|
28
|
+
readonly telemetry?: HarnessOptions["telemetry"];
|
|
19
29
|
readonly session: SessionImpl;
|
|
20
30
|
readonly storage: Storage;
|
|
21
31
|
readonly registry: RegistryReader;
|
|
22
|
-
|
|
32
|
+
/** The host's current model access (`HarnessOptions.models`); read at each access. */
|
|
33
|
+
readonly models: () => Models;
|
|
23
34
|
/** Resolve a conversation's agent against a snapshot; the runtime calls it at most once per phase. */
|
|
24
35
|
readonly agent: (conversationId: ConversationId, snapshot: RegistrySnapshot, context: Context) => Promise<Agent>;
|
|
25
36
|
/** Resolve the settings; read at each access. */
|
|
@@ -27,7 +38,18 @@ export type TaskSchedulerOptions = {
|
|
|
27
38
|
/** Build a conversation's environment with `HarnessOptions.env`. */
|
|
28
39
|
readonly env: (conversationId: ConversationId, context: Context) => Promise<ExecutionEnv | undefined>;
|
|
29
40
|
readonly now: () => number;
|
|
30
|
-
|
|
41
|
+
/** `HarnessOptions.onWake`: replaces the timer for sleeping tasks. */
|
|
42
|
+
readonly onWake: ((wake: Wake) => void) | undefined;
|
|
43
|
+
/** The host's timers (`HarnessOptions.setTimer`). */
|
|
44
|
+
readonly timers: Timers;
|
|
45
|
+
/** While closing, on the line after admitted commits settle, write what the callback returns straight to Storage. */
|
|
46
|
+
readonly writeAtClose: (writes: () => readonly StorageWrite[]) => Promise<void>;
|
|
47
|
+
readonly report: (error: unknown, info: ReportInfo, context?: Context) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Task kinds whose run phases end the task themselves once it was cut off `settings.restartLimit` times (the
|
|
50
|
+
* built-in tasks, from `TaskRecord.restarts`); the scheduler ends a task of any other kind `faulted` instead.
|
|
51
|
+
*/
|
|
52
|
+
readonly limitsRestarts: (kind: string) => boolean;
|
|
31
53
|
/** Harness cleanup staged in the commit that makes an outcome the scheduler wrote itself terminal. */
|
|
32
54
|
readonly settleOutcome: (tx: Transaction, record: AnyTaskRecord, outcome: SchedulerOutcome) => Promise<void>;
|
|
33
55
|
/** Withdraw a conversation's queued inputs, for conversation abort and abort cascades. */
|
|
@@ -36,12 +58,18 @@ export type TaskSchedulerOptions = {
|
|
|
36
58
|
readonly conversation: (id: ConversationId, binding: InvocationBinding, context: Context) => Promise<ConversationHandle | undefined>;
|
|
37
59
|
/** Context for scheduler commits and invocations; carries no caller cancellation. */
|
|
38
60
|
readonly context: Context;
|
|
61
|
+
/**
|
|
62
|
+
* `HarnessOptions.readOnly`: open loads live tasks as committed, `running` ones included, and the scheduler never
|
|
63
|
+
* commits, runs anything, or asks for a wakeup.
|
|
64
|
+
*/
|
|
65
|
+
readonly readOnly?: boolean;
|
|
39
66
|
};
|
|
40
67
|
/**
|
|
41
68
|
* Durable task scheduler of one Harness.
|
|
42
69
|
*
|
|
43
|
-
* `#live` mirrors every committed non-terminal task record: pending, running, waiting, and completing. The
|
|
44
|
-
* commit listener updates it on the Session line, so code running on the line reads exactly the committed
|
|
70
|
+
* `#live` mirrors every committed non-terminal task record: pending, running, waiting, sleeping, and completing. The
|
|
71
|
+
* synchronous commit listener updates it on the Session line, so code running on the line reads exactly the committed
|
|
72
|
+
* state from it.
|
|
45
73
|
*
|
|
46
74
|
* Tasks and conversations form one ownership tree (spec §5.5): a task's parent is its owner task, or its conversation;
|
|
47
75
|
* a conversation's parent is its owner task, if any. Walks up that tree decide what reaches one task: a cancelling
|
|
@@ -54,20 +82,47 @@ export type TaskSchedulerOptions = {
|
|
|
54
82
|
* later below a dropped node finds it unknown and loads its chain from storage again.
|
|
55
83
|
*
|
|
56
84
|
* Invariant: every task transition is decided and written by one callback serialized on the Session line. That covers
|
|
57
|
-
* reservation, marks, runtime commits, finalization, and the
|
|
58
|
-
*
|
|
59
|
-
*
|
|
85
|
+
* reservation, marks, runtime commits, finalization, and the step before each phase, which applies the precedence rules
|
|
86
|
+
* and writes a fault or handover. Handlers and joins run off the line. An invocation ends inside the step that decides
|
|
87
|
+
* its end, so a runtime commit it queued either lands before that decision or is rejected.
|
|
88
|
+
*
|
|
89
|
+
* Decisions stay serialized; their storage overlaps (group commit). The Session stores the commits of several jobs in
|
|
90
|
+
* one call while the line runs on, and this memory changes only as each commit is published. So every decision reads
|
|
91
|
+
* it in a decision region (`#region()`): synchronous, recording the keys it reads (a task's record, the live work below
|
|
92
|
+
* a node, the cancellation intent set), staging nothing; when one of them has an unpublished writer, the region waits
|
|
93
|
+
* for its publication and runs again, and only a region that read nothing unpublished is applied. Every commit writes
|
|
94
|
+
* the memberships its task changes alter (`membershipKeys()`), so a walk that a pending commit would change waits.
|
|
60
95
|
*/
|
|
61
96
|
export declare class TaskScheduler {
|
|
62
97
|
#private;
|
|
63
98
|
constructor(options: TaskSchedulerOptions);
|
|
64
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* Load live tasks and change surviving `running` tasks back to `pending`, counting the restart. Dispatches nothing;
|
|
101
|
+
* a task cut off `settings.restartLimit` times ends when it is next reserved. Read-only, it only loads them: a
|
|
102
|
+
* `running` task stays as committed, running in another process.
|
|
103
|
+
*/
|
|
65
104
|
open(context: Context): Promise<void>;
|
|
66
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Enable scheduling, and make sleeping tasks that are due runnable: a host wakeup, such as an alarm, calls this.
|
|
107
|
+
* Idempotent; the kick does nothing once closing.
|
|
108
|
+
*/
|
|
67
109
|
resume(): void;
|
|
68
110
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
111
|
+
* Why a live task cannot run here, if it cannot: its definition is missing, too old, or failed to migrate. A running
|
|
112
|
+
* task, an abort-marked one, and one holding its outcome are never blocked.
|
|
113
|
+
*/
|
|
114
|
+
blockedReason(record: BlockedSubject): BlockedReason | undefined;
|
|
115
|
+
/** Call `listener` when blocked reasons may have changed without a commit: a registry change or a failed migration. */
|
|
116
|
+
subscribeBlocked(listener: () => void): () => void;
|
|
117
|
+
/**
|
|
118
|
+
* When the Session next needs a process: `active` while some task can run now or is running, `at` for the earliest
|
|
119
|
+
* sleep not yet due. Synchronous, from memory; a task whose chain is not loaded yet counts as it would alone.
|
|
120
|
+
*/
|
|
121
|
+
wake(): Wake;
|
|
122
|
+
/**
|
|
123
|
+
* Signal every invocation and wait for them, then write the tasks they ran back as `pending` (`writeAtClose`), as a
|
|
124
|
+
* close is not a crash. Close calls this after every close listener has run, so waits, watches, and streams a task
|
|
125
|
+
* holds end with the Session's reason, not as cancelled by its signal.
|
|
71
126
|
*/
|
|
72
127
|
join(): Promise<void>;
|
|
73
128
|
/**
|
|
@@ -90,8 +145,23 @@ export declare class TaskScheduler {
|
|
|
90
145
|
* crosses background boundaries, and the wait also covers every task it reached.
|
|
91
146
|
*/
|
|
92
147
|
abortConversation(conversationId: ConversationId, background: boolean, context: Context): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* The ownership memberships a commit's task and conversation changes write (group commit §4.2), at its admission on
|
|
150
|
+
* the line: for each task created or made terminal, every node from its parent up to and including the nearest live
|
|
151
|
+
* task, or the root conversation, and then the roots too, conservatively, as a pending end may unlist the root a
|
|
152
|
+
* creation finds listed; for each conversation created under a task, that task; and the intent set when
|
|
153
|
+
* a change sets, upgrades, or clears a mark or a held or ended outcome other than `completed`. Loads the chains it
|
|
154
|
+
* walks; the nodes it installs stay until the commit is published.
|
|
155
|
+
*/
|
|
156
|
+
membershipKeys(tx: Transaction): readonly string[] | Promise<readonly string[]>;
|
|
93
157
|
/** Sizes of the ownership indexes, for tests that bound the scheduler's memory. */
|
|
94
|
-
get indexSizes(): Readonly<Record<"live" | "settled" | "edges" | "below" | "roots" | "unloaded" | "dropQueue", number>>;
|
|
158
|
+
get indexSizes(): Readonly<Record<"live" | "settled" | "edges" | "below" | "roots" | "unloaded" | "dropQueue" | "pins", number>>;
|
|
159
|
+
/**
|
|
160
|
+
* The kept contexts' idle state, for tests (a diagnostic, computed on demand): how many are kept and how many are
|
|
161
|
+
* idle, how many disagree with a full recompute (an idle period without `#idle()`, or `#idle()` without one; an
|
|
162
|
+
* expiry order that differs from the idle periods, or is not sorted), and how many idle checks covered every scope.
|
|
163
|
+
*/
|
|
164
|
+
get idleState(): Readonly<Record<"contexts" | "idleContexts" | "idleMismatches" | "fullIdleChecks", number>>;
|
|
95
165
|
/**
|
|
96
166
|
* Scheduling state and every live task with its derived state, read on the Session line. Runs no task code: a
|
|
97
167
|
* pending migration shows as `ready` with `migrates`, and only a migration the scheduler already tried, or one that
|
|
@@ -102,5 +172,7 @@ export declare class TaskScheduler {
|
|
|
102
172
|
tasks: TaskInspection[];
|
|
103
173
|
}>;
|
|
104
174
|
}
|
|
175
|
+
/** `state`, marked as ending its task for crashes (`task_interrupted` with `message`), whatever its outcome. */
|
|
176
|
+
export declare function endedByCrashes<T extends object>(state: T, message: string): T;
|
|
105
177
|
export {};
|
|
106
178
|
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../src/harness/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../src/harness/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAQpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAEX,cAAc,EAQd,UAAU,EAGV,OAAO,EACP,YAAY,EAEZ,MAAM,EACN,WAAW,EAEX,UAAU,EAEV,SAAS,EACT,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,EACX,KAAK,EAEL,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,IAAI,EACJ,MAAM,YAAY,CAAC;AAGpB,KAAK,aAAa,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAejE,6FAA6F;AAC7F,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,aAAa,CAAC,GAAG;IAChH,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC3D,CAAC;AAEF,oDAAoD;AACpD,wBAAgB,cAAc,CAAC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