@tessar/core 0.1.0-alpha.0 → 0.1.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.
Files changed (147) hide show
  1. package/README.md +168 -31
  2. package/dist/agent.d.ts +37 -87
  3. package/dist/agent.js +101 -1116
  4. package/dist/agent.js.map +1 -1
  5. package/dist/controller.d.ts +13 -4
  6. package/dist/controller.js +184 -19
  7. package/dist/controller.js.map +1 -1
  8. package/dist/engine/call.d.ts +8 -0
  9. package/dist/engine/call.js +136 -0
  10. package/dist/engine/call.js.map +1 -0
  11. package/dist/engine/checkpoint.d.ts +11 -0
  12. package/dist/engine/checkpoint.js +187 -0
  13. package/dist/engine/checkpoint.js.map +1 -0
  14. package/dist/engine/delivery.js +6 -13
  15. package/dist/engine/delivery.js.map +1 -1
  16. package/dist/engine/execution.d.ts +5 -0
  17. package/dist/engine/execution.js +292 -0
  18. package/dist/engine/execution.js.map +1 -0
  19. package/dist/engine/frame.d.ts +77 -0
  20. package/dist/engine/frame.js +83 -0
  21. package/dist/engine/frame.js.map +1 -0
  22. package/dist/engine/hooks.d.ts +4 -0
  23. package/dist/engine/hooks.js +138 -0
  24. package/dist/engine/hooks.js.map +1 -0
  25. package/dist/engine/interrupt.d.ts +1 -1
  26. package/dist/engine/lineage.d.ts +1 -1
  27. package/dist/engine/recovery.d.ts +1 -2
  28. package/dist/engine/recovery.js +4 -2
  29. package/dist/engine/recovery.js.map +1 -1
  30. package/dist/engine/resume.d.ts +12 -1
  31. package/dist/engine/resume.js +189 -0
  32. package/dist/engine/resume.js.map +1 -1
  33. package/dist/engine/runtime.d.ts +16 -0
  34. package/dist/engine/runtime.js +29 -0
  35. package/dist/engine/runtime.js.map +1 -0
  36. package/dist/engine/services.d.ts +3 -0
  37. package/dist/engine/services.js +125 -0
  38. package/dist/engine/services.js.map +1 -0
  39. package/dist/engine/tool-executor.d.ts +8 -2
  40. package/dist/engine/tool-executor.js +266 -3
  41. package/dist/engine/tool-executor.js.map +1 -1
  42. package/dist/engine/tracked-effects.js +5 -6
  43. package/dist/engine/tracked-effects.js.map +1 -1
  44. package/dist/errors.js +24 -9
  45. package/dist/errors.js.map +1 -1
  46. package/dist/events/definition.d.ts +2 -0
  47. package/dist/events/definition.js +2 -0
  48. package/dist/events/definition.js.map +1 -1
  49. package/dist/events/dispatcher.d.ts +1 -1
  50. package/dist/events/dispatcher.js +35 -4
  51. package/dist/events/dispatcher.js.map +1 -1
  52. package/dist/events/observer.d.ts +3 -0
  53. package/dist/events/observer.js +13 -0
  54. package/dist/events/observer.js.map +1 -0
  55. package/dist/events/{catalog.d.ts → type.d.ts} +170 -47
  56. package/dist/events/type.js +175 -0
  57. package/dist/events/type.js.map +1 -0
  58. package/dist/identity.d.ts +1 -0
  59. package/dist/identity.js +23 -0
  60. package/dist/identity.js.map +1 -0
  61. package/dist/index.d.ts +4 -2
  62. package/dist/index.js +4 -2
  63. package/dist/index.js.map +1 -1
  64. package/dist/instructions/instruction.d.ts +2 -0
  65. package/dist/instructions/instruction.js +10 -3
  66. package/dist/instructions/instruction.js.map +1 -1
  67. package/dist/loop.d.ts +5 -5
  68. package/dist/loop.js +44 -204
  69. package/dist/loop.js.map +1 -1
  70. package/dist/messages/codec.js +4 -2
  71. package/dist/messages/codec.js.map +1 -1
  72. package/dist/messages/message.d.ts +2 -3
  73. package/dist/messages/message.js +3 -3
  74. package/dist/messages/message.js.map +1 -1
  75. package/dist/models/contract.d.ts +15 -0
  76. package/dist/models/options.d.ts +3 -0
  77. package/dist/models/options.js +13 -0
  78. package/dist/models/options.js.map +1 -0
  79. package/dist/models/registry.d.ts +2 -0
  80. package/dist/models/registry.js +18 -1
  81. package/dist/models/registry.js.map +1 -1
  82. package/dist/models/resolver.d.ts +4 -2
  83. package/dist/models/resolver.js +9 -4
  84. package/dist/models/resolver.js.map +1 -1
  85. package/dist/models/stream.d.ts +6 -0
  86. package/dist/models/stream.js +61 -2
  87. package/dist/models/stream.js.map +1 -1
  88. package/dist/plugins/context.d.ts +27 -2
  89. package/dist/plugins/host.d.ts +5 -1
  90. package/dist/plugins/host.js +33 -11
  91. package/dist/plugins/host.js.map +1 -1
  92. package/dist/plugins/registry.d.ts +1 -1
  93. package/dist/plugins/registry.js +18 -10
  94. package/dist/plugins/registry.js.map +1 -1
  95. package/dist/session.d.ts +16 -6
  96. package/dist/session.js +126 -55
  97. package/dist/session.js.map +1 -1
  98. package/dist/state/commit.d.ts +5 -0
  99. package/dist/state/commit.js +50 -5
  100. package/dist/state/commit.js.map +1 -1
  101. package/dist/state/fork.js +27 -6
  102. package/dist/state/fork.js.map +1 -1
  103. package/dist/state/memory-backend.js +307 -38
  104. package/dist/state/memory-backend.js.map +1 -1
  105. package/dist/state/plugin-state.js +73 -18
  106. package/dist/state/plugin-state.js.map +1 -1
  107. package/dist/state/queries.d.ts +14 -14
  108. package/dist/state/queries.js +150 -48
  109. package/dist/state/queries.js.map +1 -1
  110. package/dist/state/schema.d.ts +47 -6
  111. package/dist/state/schema.js +9 -1
  112. package/dist/state/schema.js.map +1 -1
  113. package/dist/state/scope.js +3 -2
  114. package/dist/state/scope.js.map +1 -1
  115. package/dist/state/sessions.d.ts +2 -0
  116. package/dist/state/sessions.js +21 -0
  117. package/dist/state/sessions.js.map +1 -0
  118. package/dist/state/storage-ports.d.ts +16 -2
  119. package/dist/state/threads.d.ts +1 -0
  120. package/dist/state/threads.js +77 -12
  121. package/dist/state/threads.js.map +1 -1
  122. package/dist/testing/harness.d.ts +2 -1
  123. package/dist/testing/harness.js +6 -4
  124. package/dist/testing/harness.js.map +1 -1
  125. package/dist/testing/scripted-provider.d.ts +1 -0
  126. package/dist/testing/scripted-provider.js +7 -0
  127. package/dist/testing/scripted-provider.js.map +1 -1
  128. package/dist/testing/storage-conformance.js +111 -0
  129. package/dist/testing/storage-conformance.js.map +1 -1
  130. package/dist/thread.d.ts +4 -2
  131. package/dist/thread.js +14 -6
  132. package/dist/thread.js.map +1 -1
  133. package/dist/tools/tool.d.ts +11 -12
  134. package/dist/tools/tool.js +27 -10
  135. package/dist/tools/tool.js.map +1 -1
  136. package/dist/trace/records.d.ts +11 -6
  137. package/dist/trace/records.js +28 -1
  138. package/dist/trace/records.js.map +1 -1
  139. package/package.json +7 -1
  140. package/dist/events/catalog.js +0 -89
  141. package/dist/events/catalog.js.map +0 -1
  142. package/dist/models/cache.d.ts +0 -12
  143. package/dist/models/cache.js +0 -17
  144. package/dist/models/cache.js.map +0 -1
  145. package/dist/session-events.d.ts +0 -60
  146. package/dist/session-events.js +0 -14
  147. package/dist/session-events.js.map +0 -1
package/README.md CHANGED
@@ -1,31 +1,168 @@
1
- # @tessar/core
2
-
3
- Tessar's TypeScript API for Agent, Controller, Session, Thread, messages,
4
- tools, hooks, state and checkpoints. Requires Node 24.14 or newer.
5
-
6
- ```sh
7
- npm install @tessar/core@next
8
- ```
9
-
10
- - `Agent` owns its model/instructions/limits and the agent loop.
11
- - `Controller({ id, agent, plugins })` owns plugin setup, resources and sessions.
12
- - Call `controller.initialize()` before Agent or Session execution, and
13
- `controller.dispose()` when finished.
14
- - `agent.stream()` creates an independent task; `agent.generate()` collects the
15
- same execution. A Session manages a continuing conversation with
16
- `session.subscribe()` and queued `session.followUp()` inputs.
17
- - Core manages state and checkpoints, using memory storage by default.
18
-
19
- ```ts
20
- import { Agent, Controller, HumanMessage, type Plugin } from "@tessar/core";
21
- import { createTool, toolResult } from "@tessar/core/tool";
22
- ```
23
-
24
- Built-in and custom plugins use classes instantiated with `new`, implementing
25
- the same `Plugin` instance contract. Providers and persistence backends are
26
- separate plugins: `@tessar/openai` and `@tessar/sqlite`.
27
-
28
- This is an alpha release. See the
29
- [repository](https://github.com/hphucdev-04/tessar) for complete TypeScript
30
- examples and the current API contracts. The bundled model catalog includes its
31
- upstream license at `src/models/catalog.LICENSE`.
1
+ # @tessar/core
2
+
3
+ Tessar's TypeScript API for Agent, Controller, Session, Thread, messages,
4
+ tools, hooks, state and checkpoints. Requires Node 24.14 or newer.
5
+
6
+ ```sh
7
+ npm install @tessar/core @tessar/openai zod
8
+ ```
9
+
10
+ - `Agent` owns its model, instructions, tools, limits and the agent loop.
11
+ - `Controller({ id, agent, plugins })` owns plugin setup, resources and sessions.
12
+ - An executable model lets Agent run directly, without public init/dispose.
13
+ - When opting into Controller, initialize it before its sessions or plugin-backed
14
+ executions and dispose it when finished.
15
+ - `agent.stream()` creates an independent task; `agent.generate()` collects the
16
+ same execution. A Session manages a continuing conversation with
17
+ `session.subscribe()` and queued `session.followUp()` inputs.
18
+ - Core manages state and checkpoints, using memory storage by default.
19
+
20
+ ```ts
21
+ import { Agent, Controller, HumanMessage, ToolMessage } from "@tessar/core";
22
+ import { createTool } from "@tessar/core/tool";
23
+ import { OpenAIProvider } from "@tessar/openai";
24
+ import { z } from "zod";
25
+
26
+ const addTool = createTool({
27
+ name: "add",
28
+ description: "Add two numbers",
29
+ schema: z.object({ a: z.number(), b: z.number() }),
30
+ execute: ({ a, b }) => ({ sum: a + b }),
31
+ });
32
+
33
+ const agent = new Agent({
34
+ id: "assistant",
35
+ model: new OpenAIProvider({
36
+ apiKey: process.env.OPENAI_API_KEY!,
37
+ model: process.env.OPENAI_MODEL!,
38
+ }),
39
+ tools: { addTool },
40
+ });
41
+
42
+ const result = await agent.generate("What is 1 + 2?");
43
+ console.log(result.output);
44
+ ```
45
+
46
+ Tools can also be registered by plugins using `tessar.tools.register(addTool)`.
47
+ Both paths share hooks and execution. Tool names must be unique.
48
+ `tools: { concurrency: 4, addTool }` optionally limits active calls, including
49
+ plugin tools; omit concurrency to execute the model's tool calls without a
50
+ scheduling limit. Tools are authorized before dispatch; results enter the
51
+ conversation in call order after the executions complete. Execution budgets
52
+ such as `limits.maxToolCalls` still apply.
53
+
54
+ `Agent.model` is required. `stream(message, options?)` and
55
+ `generate(message, options?)` accept a string, a message, or message history.
56
+ Each direct call has independent context and automatic per-execution cleanup.
57
+ Use a Session when the host needs a continuing conversation.
58
+
59
+ ```ts
60
+ const stream = agent.stream("Explain briefly", {
61
+ model: "another-model-on-the-same-connection",
62
+ modelOptions: { reasoning: { effort: "low" } },
63
+ });
64
+ for await (const event of stream) console.log(event);
65
+ ```
66
+
67
+ A string model override keeps the default connection. An executable model
68
+ instance selects its own connection and request defaults. `modelOptions`
69
+ replaces top-level values, including whole nested objects, for that call only.
70
+ Omitted provider settings are left to the provider SDK. Legacy object-input
71
+ overloads/model references remain for existing Controller integrations.
72
+
73
+ Zod validates arguments and infers executor input; Tessar generates the model's
74
+ JSON Schema. Return text or JSON directly: Tessar wraps it in a `ToolMessage`
75
+ and binds the toolCallId. Undefined and non-JSON returns fail explicitly.
76
+ To supply content parts or metadata, return a message yourself:
77
+
78
+ ```ts
79
+ new ToolMessage("Already calculated", { metadata: { source: "cache" } });
80
+ ```
81
+
82
+ All messages have an ID, role, content and optional metadata. Constructors infer
83
+ the role and generate an ID unless supplied. Metadata is persisted for hosts and
84
+ plugins and is not automatically sent to a model. Standalone ToolMessages may
85
+ omit toolCallId; encoding history requires it, and the tool runtime binds it
86
+ automatically. OpenAI Responses serializes JSON tool data as JSON text.
87
+
88
+ Retry, conditional availability and permissions belong in tool implementations
89
+ or plugins. Use `tools.select` for advertised tools and `tool.before` to enforce
90
+ execution policy. Skills and subagents are host/plugin orchestration, expressed
91
+ to providers through instructions, messages and tools.
92
+
93
+ Build instructions from sections when plugins need to append their own content:
94
+
95
+ ```ts
96
+ import { buildInstruction } from "@tessar/core";
97
+
98
+ const instructions = buildInstruction([
99
+ { id: "base", content: "You are an assistant.", order: 0 },
100
+ { id: "skills", content: "<skills>...</skills>", order: 100 },
101
+ { id: "current-context", content: "Current task details", order: 1000 },
102
+ ]);
103
+ const agent = new Agent({ id: "assistant", model, instructions });
104
+ ```
105
+
106
+ Sections sort by ascending `order`, with omitted order comparing as zero. Equal
107
+ orders sort by ordinal ID, independent of plugin registration order. Use distinct
108
+ orders when sequence matters. IDs must be unique and orders finite numbers.
109
+ Building copies/freezes the data; it does not mutate caller arrays or inject a
110
+ default order. String instructions remain supported. Final requests are normalized
111
+ after `context.prepare` and `model.request`, including sections added by plugins.
112
+ Ordering controls content placement; provider adapters own serialization and cache
113
+ behavior. Core adds no cache markers or history breakpoint API.
114
+
115
+ Built-in and custom plugins use classes instantiated with `new`, implementing
116
+ the same `Plugin` instance contract. Provider adapters are separate packages,
117
+ such as `@tessar/openai`; persistence backends such as `@tessar/sqlite` attach
118
+ through Controller plugins.
119
+
120
+ All hooks share `tessar.hook` and one typed EventMap. Import event groups directly:
121
+
122
+ ```ts
123
+ import { model, thread, session } from "@tessar/core";
124
+
125
+ tessar.hook(model.usage, event => console.log(event.payload.usage));
126
+ tessar.hook(thread.beforeDelete, () => ({ decision: "deny", reason: "Keep history" }));
127
+ tessar.hook(session.model.beforeChange, event => console.log(event.payload.model));
128
+ ```
129
+
130
+ Keys start lowercase and use camelCase for hyphens in the string identifier:
131
+ `thread.beforeDelete === "thread.before-delete"`. There is no `events` prefix.
132
+ The old `AgentEvents` and `SessionEvents` exports are replaced by these groups.
133
+ Session selection policies are asynchronous: use `await session.setModel(model)`
134
+ before queuing input that should use the new model. See
135
+ [plugin authoring](../../docs/plugin-authoring.md) for decisions and capabilities.
136
+
137
+ This is an early 0.x release. See the
138
+ [repository](https://github.com/hphucdev-04/tessar) for complete TypeScript
139
+ examples and the current API contracts. The bundled model catalog includes its
140
+ upstream license at `src/models/catalog.LICENSE`.
141
+
142
+ ## Persistent Sessions
143
+
144
+ `await controller.createSession({ scope, metadata })` commits a Session record
145
+ before returning the handle. `session.id` is generated by Tessar. Use
146
+ `await controller.getSession(id, { scope })` to restore it and
147
+ `await controller.listSessions({ scope, limit, cursor })` to browse this Agent's
148
+ Sessions. A restored handle does not automatically resume unfinished work.
149
+
150
+ Selections use compare-and-set: stale handles fail `CommitConflict`; reload the
151
+ Session before retrying. Thread creation may succeed before selection fails,
152
+ so the unselected thread remains available in the scoped thread list. Closing
153
+ a Session keeps its record. Soft-deleting a thread clears stored selections in
154
+ the same transaction. Subscribers and unadmitted followUp queues stay in memory.
155
+
156
+ There is no Agent table. The application constructs its Agent and supplies the
157
+ same `agentId` and compatible providers/plugins on restart. Controller's ID is
158
+ not a persistence key. Session creation notifications are available to Controller
159
+ plugins; subscribe on the returned handle for subsequent events. Restoration
160
+ does not emit another `session.created` notification.
161
+
162
+ `controller.deleteThread` is a soft delete. `controller.purgeThread` permanently
163
+ removes only a deleted, inactive, unowned thread with no retained fork referencing
164
+ it. Both invoke thread deletion policy; purge supplies `permanent: true`.
165
+
166
+ Storage adapter authors must implement the new `sessions` CAS port, backend page
167
+ and history queries, `threads.get(..., { includeDeleted })` and `threads.purge`.
168
+ These are breaking storage-port changes; run storage conformance and query tests.
package/dist/agent.d.ts CHANGED
@@ -1,55 +1,36 @@
1
1
  import type { Controller } from "./controller.js";
2
2
  import type { Model } from "./models/profile.js";
3
- import type { Scope, InterruptRecord } from "./state/schema.js";
4
- import { type Stream, type DeliveryTarget, type Attachment } from "./engine/delivery.js";
3
+ import type { ModelAdapter, ModelOptions, ModelRef } from "./models/contract.js";
4
+ import type { Scope, InterruptRecord, StreamLimits } from "./state/schema.js";
5
+ import type { StreamRecord } from "./trace/records.js";
6
+ import type { StorageBackend } from "./state/storage-ports.js";
7
+ import type { PluginHost } from "./plugins/host.js";
8
+ import { type Stream, type DeliveryTarget } from "./engine/delivery.js";
5
9
  export type { Stream, DeliveryTarget } from "./engine/delivery.js";
6
10
  import { type ErrorInfo } from "./errors.js";
7
- import { type Clock, type IdGenerator, type JsonObject, type JsonValue } from "./json.js";
11
+ import { type Clock, type IdGenerator, type JsonObject } from "./json.js";
8
12
  import { type Instruction } from "./instructions/instruction.js";
9
- import { type MessageData } from "./messages/message.js";
10
- import type { ModelRef } from "./models/contract.js";
11
- import { PluginHost } from "./plugins/host.js";
12
- import type { RegistryLease } from "./plugins/registry.js";
13
- import { PluginStateAccess } from "./state/plugin-state.js";
14
- import type { StorageBackend, Lease } from "./state/storage-ports.js";
15
- import type { Checkpoint, RecordEntry, StreamLimits } from "./state/schema.js";
16
- import type { StreamRecord } from "./trace/records.js";
17
- export interface ExecutionOrigin {
18
- parentStreamId: string;
19
- parentToolExecutionId?: string;
20
- dispatchId: string;
21
- }
22
- export type ExecutionRequest = ({
23
- kind: "input";
24
- threadId: string;
25
- input: readonly MessageData[];
26
- model: ModelRef;
27
- origin?: ExecutionOrigin;
28
- context?: JsonObject;
29
- limits?: Partial<StreamLimits>;
30
- } | {
31
- kind: "resume";
32
- threadId: string;
33
- interruptId: string;
34
- value: JsonValue;
35
- model?: ModelRef;
36
- } | {
37
- kind: "recover";
38
- threadId: string;
39
- streamId: string;
40
- model?: ModelRef;
41
- }) & {
42
- signal?: AbortSignal;
43
- };
44
- export interface AgentOptions {
13
+ import type { MessageData } from "./messages/message.js";
14
+ import { Tool } from "./tools/tool.js";
15
+ import type { ExecutionRequest } from "./engine/frame.js";
16
+ export type { ExecutionFrame, ExecutionRequest, ExecutionOrigin, } from "./engine/frame.js";
17
+ import type { ExecutionRuntime } from "./engine/runtime.js";
18
+ export type ModelSelection = ModelAdapter | Model | ModelRef;
19
+ export type AgentInput = string | MessageData | readonly MessageData[];
20
+ export interface AgentOptions<M extends ModelSelection = ModelSelection> {
45
21
  id: string;
46
- model?: Model | ModelRef;
22
+ model: M;
47
23
  instructions?: string | Instruction;
48
24
  limits?: Partial<StreamLimits>;
25
+ tools?: AgentTools;
26
+ }
27
+ export interface AgentTools {
28
+ concurrency?: number;
29
+ readonly [alias: string]: Tool | number | undefined;
49
30
  }
50
- export interface AgentExecutionOptions {
51
- input: MessageData | readonly MessageData[];
52
- model?: Model | ModelRef;
31
+ export interface AgentExecutionOptions<M = ModelAdapter> {
32
+ model?: M | Model | ModelRef | string;
33
+ modelOptions?: ModelOptions<M>;
53
34
  scope?: Scope;
54
35
  context?: JsonObject;
55
36
  signal?: AbortSignal;
@@ -65,26 +46,11 @@ export interface GenerateOutcome {
65
46
  error: ErrorInfo | null;
66
47
  }
67
48
  export declare function inputMessages(input: MessageData | readonly MessageData[]): readonly MessageData[];
68
- export interface ExecutionFrame {
69
- effectLocks?: Map<string, Promise<unknown>>;
70
- commitQueue?: Promise<void>;
71
- currentToolExecutionId?: string;
72
- heartbeat?: ReturnType<typeof setInterval>;
73
- ownershipError?: ErrorInfo;
74
- request: ExecutionRequest;
75
- sink: Attachment;
76
- registry: RegistryLease;
77
- lease: Lease;
78
- cp: Checkpoint;
79
- stream: StreamRecord;
80
- records: Map<string, RecordEntry>;
81
- state: PluginStateAccess;
82
- admitted: boolean;
83
- sequence: number;
84
- }
85
- export declare class Agent {
49
+ export declare class Agent<M extends ModelSelection = ModelSelection> {
86
50
  readonly id: string;
87
- readonly model: Readonly<ModelRef> | undefined;
51
+ readonly tools: readonly Tool[];
52
+ /** @internal */ readonly toolConcurrency: number;
53
+ readonly model: M;
88
54
  private controller?;
89
55
  /** @internal */ attachController(controller: Controller): void;
90
56
  private runtime;
@@ -95,34 +61,18 @@ export declare class Agent {
95
61
  readonly limits: StreamLimits;
96
62
  readonly instructions: Instruction;
97
63
  private readonly jobs;
64
+ private readonly outcomes;
98
65
  private readonly active;
66
+ private readonly pendingModels;
99
67
  private closed;
68
+ private readonly releaseId;
100
69
  private readonly resumeAdmissions;
101
- constructor(options: AgentOptions);
102
- stream(options: AgentExecutionOptions): Stream;
103
- generate(options: AgentExecutionOptions): Promise<GenerateOutcome>;
70
+ constructor(options: AgentOptions<M>);
71
+ stream<T extends ModelAdapter = Extract<M, ModelAdapter>>(input: AgentInput, options?: AgentExecutionOptions<T>): Stream;
72
+ generate<T extends ModelAdapter = Extract<M, ModelAdapter>>(input: AgentInput, options?: AgentExecutionOptions<T>): Promise<GenerateOutcome>;
104
73
  /** @internal Shared admission for Thread, Session and testing. */
105
- admit(request: ExecutionRequest, target?: DeliveryTarget, prepare?: () => Promise<void>): Stream;
106
- private execute;
107
- private eventContext;
108
- private watchLease;
109
- private hook;
110
- private put;
111
- private rows;
112
- private services;
113
- private auxiliary;
114
- private updateUsage;
115
- private commit;
116
- private commitNow;
117
- private prepareMessage;
118
- private appendMessage;
119
- private loop;
120
- private restoreFrame;
121
- private prepareRecovery;
122
- private suspend;
123
- private prepareResume;
124
- private prepareResumeFrame;
125
- private finish;
126
- cancel(threadId: string, streamId: string, reason?: string, target?: DeliveryTarget): Promise<void>;
74
+ admit(request: ExecutionRequest, target?: DeliveryTarget, prepare?: () => Promise<void>, runtime?: ExecutionRuntime, cleanup?: () => Promise<void>): Stream;
75
+ private executionContext;
76
+ cancel(threadId: string, streamId: string, reason?: string, target?: DeliveryTarget, context?: Pick<ExecutionRequest, "session" | "thread">): Promise<void>;
127
77
  shutdown(): Promise<void>;
128
78
  }