@myclaw163/game-agent-runtime 0.0.0-stage → 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 (204) hide show
  1. package/README.md +67 -2
  2. package/dist/framework/action-diagnostics.d.ts +11 -0
  3. package/dist/framework/action-diagnostics.js +67 -0
  4. package/dist/framework/capability-registry.d.ts +58 -0
  5. package/dist/framework/capability-registry.js +325 -0
  6. package/dist/framework/contracts.d.ts +121 -0
  7. package/dist/framework/contracts.js +2 -0
  8. package/dist/framework/control/control-scheduler.d.ts +69 -0
  9. package/dist/framework/control/control-scheduler.js +1016 -0
  10. package/dist/framework/control/domain-set.d.ts +18 -0
  11. package/dist/framework/control/domain-set.js +70 -0
  12. package/dist/framework/control/index.d.ts +3 -0
  13. package/dist/framework/control/index.js +3 -0
  14. package/dist/framework/control/types.d.ts +142 -0
  15. package/dist/framework/control/types.js +13 -0
  16. package/dist/framework/control-coordinator.d.ts +7 -0
  17. package/dist/framework/control-coordinator.js +7 -0
  18. package/dist/framework/events/event-catalog.d.ts +23 -0
  19. package/dist/framework/events/event-catalog.js +52 -0
  20. package/dist/framework/events/event-delivery-service.d.ts +33 -0
  21. package/dist/framework/events/event-delivery-service.js +165 -0
  22. package/dist/framework/events/event-ingress.d.ts +28 -0
  23. package/dist/framework/events/event-ingress.js +76 -0
  24. package/dist/framework/events/event-repository.d.ts +38 -0
  25. package/dist/framework/events/event-repository.js +20 -0
  26. package/dist/framework/events/index.d.ts +7 -0
  27. package/dist/framework/events/index.js +7 -0
  28. package/dist/framework/events/memory-event-repository.d.ts +77 -0
  29. package/dist/framework/events/memory-event-repository.js +909 -0
  30. package/dist/framework/events/runtime-resume.d.ts +11 -0
  31. package/dist/framework/events/runtime-resume.js +7 -0
  32. package/dist/framework/events/sqlite-event-repository.d.ts +94 -0
  33. package/dist/framework/events/sqlite-event-repository.js +2044 -0
  34. package/dist/framework/events/store-compatibility.d.ts +17 -0
  35. package/dist/framework/events/store-compatibility.js +17 -0
  36. package/dist/framework/events/types.d.ts +242 -0
  37. package/dist/framework/events/types.js +39 -0
  38. package/dist/framework/index.d.ts +7 -0
  39. package/dist/framework/index.js +7 -0
  40. package/dist/framework/load-node-sqlite.d.ts +5 -0
  41. package/dist/framework/load-node-sqlite.js +19 -0
  42. package/dist/framework/mailbox/coalescer.d.ts +30 -0
  43. package/dist/framework/mailbox/coalescer.js +45 -0
  44. package/dist/framework/mailbox/host-notification-sink.d.ts +31 -0
  45. package/dist/framework/mailbox/host-notification-sink.js +13 -0
  46. package/dist/framework/mailbox/identity.d.ts +15 -0
  47. package/dist/framework/mailbox/identity.js +28 -0
  48. package/dist/framework/mailbox/index.d.ts +7 -0
  49. package/dist/framework/mailbox/index.js +7 -0
  50. package/dist/framework/mailbox/mailbox-dispatcher.d.ts +65 -0
  51. package/dist/framework/mailbox/mailbox-dispatcher.js +242 -0
  52. package/dist/framework/mailbox/mailbox-repository.d.ts +17 -0
  53. package/dist/framework/mailbox/mailbox-repository.js +9 -0
  54. package/dist/framework/mailbox/notification-projector.d.ts +25 -0
  55. package/dist/framework/mailbox/notification-projector.js +50 -0
  56. package/dist/framework/mailbox/types.d.ts +128 -0
  57. package/dist/framework/mailbox/types.js +1 -0
  58. package/dist/framework/modules/runtime-module-loader-hooks.mjs +156 -0
  59. package/dist/framework/modules/runtime-module-loader.d.ts +14 -0
  60. package/dist/framework/modules/runtime-module-loader.js +64 -0
  61. package/dist/framework/modules/runtime-module-output.d.ts +7 -0
  62. package/dist/framework/modules/runtime-module-output.js +15 -0
  63. package/dist/framework/modules/runtime-module-worker-bootstrap.mjs +23 -0
  64. package/dist/framework/participation-manager.d.ts +94 -0
  65. package/dist/framework/participation-manager.js +185 -0
  66. package/dist/framework/persistence/async-sqlite-persistence-worker.d.ts +1 -0
  67. package/dist/framework/persistence/async-sqlite-persistence-worker.js +62 -0
  68. package/dist/framework/persistence/memory-first-persistence.d.ts +36 -0
  69. package/dist/framework/persistence/memory-first-persistence.js +459 -0
  70. package/dist/framework/plugins/contracts.d.ts +345 -0
  71. package/dist/framework/plugins/contracts.js +1 -0
  72. package/dist/framework/plugins/index.d.ts +4 -0
  73. package/dist/framework/plugins/index.js +4 -0
  74. package/dist/framework/plugins/runtime-event-identity.d.ts +3 -0
  75. package/dist/framework/plugins/runtime-event-identity.js +11 -0
  76. package/dist/framework/plugins/runtime-input-journal.d.ts +85 -0
  77. package/dist/framework/plugins/runtime-input-journal.js +716 -0
  78. package/dist/framework/plugins/runtime-plugin-scheduler.d.ts +188 -0
  79. package/dist/framework/plugins/runtime-plugin-scheduler.js +1660 -0
  80. package/dist/framework/runtime.d.ts +264 -0
  81. package/dist/framework/runtime.js +1811 -0
  82. package/dist/framework/serial-task-queue.d.ts +6 -0
  83. package/dist/framework/serial-task-queue.js +12 -0
  84. package/dist/framework/state/contracts.d.ts +30 -0
  85. package/dist/framework/state/contracts.js +1 -0
  86. package/dist/framework/state/current-state-store.d.ts +17 -0
  87. package/dist/framework/state/current-state-store.js +153 -0
  88. package/dist/framework/state/durable-agent-state-snapshot.d.ts +61 -0
  89. package/dist/framework/state/durable-agent-state-snapshot.js +162 -0
  90. package/dist/framework/state/freshness.d.ts +7 -0
  91. package/dist/framework/state/freshness.js +52 -0
  92. package/dist/framework/state/history/contracts.d.ts +133 -0
  93. package/dist/framework/state/history/contracts.js +1 -0
  94. package/dist/framework/state/history/history-writer.d.ts +55 -0
  95. package/dist/framework/state/history/history-writer.js +157 -0
  96. package/dist/framework/state/history/memory-state-history-repository.d.ts +25 -0
  97. package/dist/framework/state/history/memory-state-history-repository.js +199 -0
  98. package/dist/framework/state/history/sqlite-state-history-repository.d.ts +28 -0
  99. package/dist/framework/state/history/sqlite-state-history-repository.js +565 -0
  100. package/dist/framework/state/history/trajectory-projector.d.ts +53 -0
  101. package/dist/framework/state/history/trajectory-projector.js +130 -0
  102. package/dist/framework/state/index.d.ts +12 -0
  103. package/dist/framework/state/index.js +12 -0
  104. package/dist/framework/state/state-ingress.d.ts +18 -0
  105. package/dist/framework/state/state-ingress.js +68 -0
  106. package/dist/framework/state/state-provider.d.ts +11 -0
  107. package/dist/framework/state/state-provider.js +56 -0
  108. package/dist/framework/state/types.d.ts +107 -0
  109. package/dist/framework/state/types.js +19 -0
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.js +1 -0
  112. package/dist/mailbox/adapters/claude-channel-adapter.d.ts +34 -0
  113. package/dist/mailbox/adapters/claude-channel-adapter.js +71 -0
  114. package/dist/mailbox/adapters/claude-channel-socket.d.ts +56 -0
  115. package/dist/mailbox/adapters/claude-channel-socket.js +279 -0
  116. package/dist/mailbox/adapters/desktop-event-socket.d.ts +81 -0
  117. package/dist/mailbox/adapters/desktop-event-socket.js +339 -0
  118. package/dist/mailbox/agent-mailbox-coordinator.d.ts +104 -0
  119. package/dist/mailbox/agent-mailbox-coordinator.js +412 -0
  120. package/dist/mailbox/host-monitor-rate-gate.d.ts +60 -0
  121. package/dist/mailbox/host-monitor-rate-gate.js +93 -0
  122. package/dist/mailbox/mailbox-event-batch-delivery.d.ts +73 -0
  123. package/dist/mailbox/mailbox-event-batch-delivery.js +251 -0
  124. package/dist/mailbox/mailbox-host-relay.d.ts +52 -0
  125. package/dist/mailbox/mailbox-host-relay.js +299 -0
  126. package/dist/mailbox/mailbox-plugin.d.ts +56 -0
  127. package/dist/mailbox/mailbox-plugin.js +111 -0
  128. package/dist/mailbox/mailbox-service.d.ts +128 -0
  129. package/dist/mailbox/mailbox-service.js +582 -0
  130. package/dist/memory/contracts.d.ts +12 -0
  131. package/dist/memory/contracts.js +1 -0
  132. package/dist/memory/strategy-memory-rpc.d.ts +21 -0
  133. package/dist/memory/strategy-memory-rpc.js +86 -0
  134. package/dist/memory/strategy-memory.d.ts +15 -0
  135. package/dist/memory/strategy-memory.js +95 -0
  136. package/dist/observability/detail-capture.d.ts +25 -0
  137. package/dist/observability/detail-capture.js +136 -0
  138. package/dist/observability/index.d.ts +5 -0
  139. package/dist/observability/index.js +5 -0
  140. package/dist/observability/process-timing.d.ts +14 -0
  141. package/dist/observability/process-timing.js +56 -0
  142. package/dist/observability/recorder.d.ts +56 -0
  143. package/dist/observability/recorder.js +202 -0
  144. package/dist/observability/redaction.d.ts +30 -0
  145. package/dist/observability/redaction.js +166 -0
  146. package/dist/observability/reporter.d.ts +32 -0
  147. package/dist/observability/reporter.js +140 -0
  148. package/dist/observability/sinks.d.ts +36 -0
  149. package/dist/observability/sinks.js +121 -0
  150. package/dist/observability/types.d.ts +81 -0
  151. package/dist/observability/types.js +1 -0
  152. package/dist/owner/control-channel.d.ts +42 -0
  153. package/dist/owner/control-channel.js +188 -0
  154. package/dist/owner/parent-process-watch.d.ts +15 -0
  155. package/dist/owner/parent-process-watch.js +40 -0
  156. package/dist/owner/process-identity.d.ts +10 -0
  157. package/dist/owner/process-identity.js +65 -0
  158. package/dist/owner/runtime-lock.d.ts +5 -0
  159. package/dist/owner/runtime-lock.js +47 -0
  160. package/dist/perception/binding-resolution.d.ts +9 -0
  161. package/dist/perception/binding-resolution.js +14 -0
  162. package/dist/perception/contracts.d.ts +85 -0
  163. package/dist/perception/contracts.js +1 -0
  164. package/dist/perception/map-concurrent.d.ts +2 -0
  165. package/dist/perception/map-concurrent.js +12 -0
  166. package/dist/perception/perception-host.d.ts +114 -0
  167. package/dist/perception/perception-host.js +336 -0
  168. package/dist/perception/perception-worker-host.d.ts +11 -0
  169. package/dist/perception/perception-worker-host.js +44 -0
  170. package/dist/perception/perception-worker.d.ts +21 -0
  171. package/dist/perception/perception-worker.js +77 -0
  172. package/dist/perception/strategy-names.d.ts +7 -0
  173. package/dist/perception/strategy-names.js +22 -0
  174. package/dist/sdk/perception.d.ts +5 -0
  175. package/dist/sdk/perception.js +6 -0
  176. package/dist/sdk/strategy.d.ts +6 -0
  177. package/dist/sdk/strategy.js +3 -0
  178. package/dist/strategy/activation-manager.d.ts +105 -0
  179. package/dist/strategy/activation-manager.js +367 -0
  180. package/dist/strategy/behavior-decision-history.d.ts +20 -0
  181. package/dist/strategy/behavior-decision-history.js +59 -0
  182. package/dist/strategy/behavior-instance-snapshot.d.ts +31 -0
  183. package/dist/strategy/behavior-instance-snapshot.js +145 -0
  184. package/dist/strategy/contracts.d.ts +189 -0
  185. package/dist/strategy/contracts.js +1 -0
  186. package/dist/strategy/control-driver.d.ts +25 -0
  187. package/dist/strategy/control-driver.js +131 -0
  188. package/dist/strategy/in-process-runner.d.ts +25 -0
  189. package/dist/strategy/in-process-runner.js +40 -0
  190. package/dist/strategy/strategy-host.d.ts +165 -0
  191. package/dist/strategy/strategy-host.js +1456 -0
  192. package/dist/strategy/strategy-script-runner.d.ts +81 -0
  193. package/dist/strategy/strategy-script-runner.js +235 -0
  194. package/dist/strategy/strategy-worker-host.d.ts +27 -0
  195. package/dist/strategy/strategy-worker-host.js +96 -0
  196. package/dist/strategy/thread-strategy-executor.d.ts +120 -0
  197. package/dist/strategy/thread-strategy-executor.js +778 -0
  198. package/examples/grid-game.mjs +129 -0
  199. package/examples/grid-perception-worker.mjs +6 -0
  200. package/examples/grid-perception.mjs +12 -0
  201. package/examples/grid-strategy-worker.mjs +11 -0
  202. package/examples/grid-strategy.mjs +13 -0
  203. package/examples/run-grid-game.mjs +24 -0
  204. package/package.json +53 -4
@@ -0,0 +1,264 @@
1
+ import type { EventStoreCompatibility } from './events/store-compatibility.js';
2
+ import type { StoredStateFrame } from './state/index.js';
3
+ import type { RuntimeCycleInfo } from './plugins/contracts.js';
4
+ import { ActionRegistry, ObservationRegistry, type ActionAdmissionOptions } from './capability-registry.js';
5
+ import { actionFailureDiagnosticSeverity } from './action-diagnostics.js';
6
+ import type { ActionCaller, ActionResult, ObservationResult } from './contracts.js';
7
+ import { type EventCatalog, type CanonicalEvent, type EventRepository } from './events/index.js';
8
+ import { RuntimePluginScheduler, type RuntimeEpoch, type RuntimeEpochExecutionResult, type RuntimePersistenceStore, type RuntimeEpochPlugin, type RuntimeInputAcceptance, type RuntimeInputBatch, type RuntimePluginDescriptor, type RuntimeSourceContext, type RuntimeSourcePlugin } from './plugins/index.js';
9
+ import { HistoryWriter, type HistoryWriterDegradedScopeHealth, type HistoryWriterHealth, type FlushableStateIngressObserver, type StateIngressObserver, type RuntimeConnectionState, type RuntimeScope, type StateHistoryRepository, type StateFreshnessPolicy, type StateFreshnessPolicyResolver, type StateProviderResult } from './state/index.js';
10
+ import type { TelemetryRecorder } from '../observability/index.js';
11
+ export interface RuntimePersistenceStatus {
12
+ events: 'sqlite' | 'memory';
13
+ stateHistory: 'sqlite' | 'memory';
14
+ inputJournal: 'sqlite' | 'memory';
15
+ warnings: string[];
16
+ historyWriter: PublicHistoryWriterHealth;
17
+ }
18
+ /** Durable Event/session store used by the fixed Runtime loop. */
19
+ export type RuntimeRepository = EventRepository;
20
+ export declare const RUNTIME_CYCLE_SOURCE_ID = "runtime.processing-cycle";
21
+ export interface RuntimeProcessingCadence {
22
+ intervalMs: number;
23
+ /** Local controls may carry cached data but must not refresh the authoritative observation clock. */
24
+ isStateUpdate?(input: Readonly<Pick<RuntimeInputBatch<Record<string, any>>, 'state' | 'sourceId'>>): boolean;
25
+ createState(input: {
26
+ latestInput: Readonly<RuntimeEpoch<Record<string, any>>>;
27
+ latestStateFrame: Readonly<StoredStateFrame<Record<string, any>>> | null;
28
+ cycle: Readonly<RuntimeCycleInfo>;
29
+ }): Record<string, any>;
30
+ }
31
+ export interface RuntimeOptions<TPosition = unknown> {
32
+ eventStoreCompatibility?: EventStoreCompatibility;
33
+ actionFailureSeverity?: typeof actionFailureDiagnosticSeverity;
34
+ processingCadence?: RuntimeProcessingCadence;
35
+ notificationPolicy?: import('./events/event-ingress.js').EventIngressOptions['notificationPolicy'];
36
+ /** Host-owned follow-up work, scheduled after an epoch closes without inventing external input. */
37
+ followUpInput?: (epoch: RuntimeEpoch<Record<string, any>>, latest: StoredStateFrame<Record<string, any>>, events: readonly CanonicalEvent[]) => RuntimeInputBatch<Record<string, any>> | undefined;
38
+ adapterId: string;
39
+ accountId: string;
40
+ eventCatalog: EventCatalog;
41
+ eventLedgerPath?: string;
42
+ stateHistoryPath?: string;
43
+ inputJournalPath?: string;
44
+ eventRepository?: RuntimeRepository;
45
+ /**
46
+ * Consumers whose delivery rows are created atomically with each Event.
47
+ * Omit to retain the legacy local-agent consumer; pass [] when adapters own
48
+ * their delivery lanes and create them only while enabled.
49
+ */
50
+ initialEventConsumerIds?: readonly string[];
51
+ stateHistoryRepository?: StateHistoryRepository<TPosition>;
52
+ inputJournal?: RuntimePersistenceStore<Record<string, any>, Record<string, unknown>>;
53
+ historyObserverFactory?: (writer: HistoryWriter<TPosition>) => StateIngressObserver<Record<string, any>>;
54
+ stateObservers?: FlushableStateIngressObserver<Record<string, any>>[];
55
+ resume?: boolean;
56
+ resumeKey?: string;
57
+ mode?: string;
58
+ stateFreshnessPolicy?: StateFreshnessPolicy;
59
+ /** Optional per-source override for transports with different State cadence. */
60
+ stateFreshnessPolicyResolver?: StateFreshnessPolicyResolver;
61
+ /** Owner-side operational telemetry. It is never part of Event or State. */
62
+ observability?: TelemetryRecorder;
63
+ /** Static per-epoch plugin graph used by the Runtime loop. */
64
+ runtimeEpochPlugins?: RuntimeEpochPlugin<Record<string, any>, Record<string, unknown>>[];
65
+ /** Projects a game-neutral Runtime State into the current game-facing view. */
66
+ currentStateFromRuntimeState?: (state: Readonly<Record<string, any>>) => Record<string, any> | null;
67
+ initialSegment: {
68
+ kind: string;
69
+ identity?: string;
70
+ };
71
+ }
72
+ export type PublicRuntimeScope = Omit<RuntimeScope, 'accountId'>;
73
+ export interface PublicHistoryWriterDegradedScopeHealth extends Omit<HistoryWriterDegradedScopeHealth, 'scope'> {
74
+ scope: PublicRuntimeScope;
75
+ }
76
+ export interface PublicHistoryWriterHealth extends HistoryWriterHealth {
77
+ degradedScopes: PublicHistoryWriterDegradedScopeHealth[];
78
+ }
79
+ export interface ExpectedRuntimeScope {
80
+ sessionId: string;
81
+ segmentId: string;
82
+ }
83
+ /** Latest durable value of one plugin-owned State topic at a Ready boundary. */
84
+ export interface RuntimeReadyPluginState {
85
+ pluginId: string;
86
+ topic: string;
87
+ value: unknown;
88
+ updatedEpochSeq: number;
89
+ updatedDomainTick?: number;
90
+ }
91
+ /** Result of a plugin's invocation for the Ready View's closing epoch. */
92
+ export interface RuntimeReadyPluginOutcome {
93
+ pluginId: string;
94
+ epochSeq: number;
95
+ domainTick?: number;
96
+ outcome: RuntimeEpochExecutionResult['outcomes'][number]['outcome'];
97
+ reason?: string;
98
+ }
99
+ /** One coherent, non-consuming view at the latest fully closed epoch. */
100
+ export interface RuntimeReadyView<TState = Record<string, any> | null> {
101
+ scope: PublicRuntimeScope;
102
+ state: StateProviderResult<TState>;
103
+ /** Topic-keyed latest values, carried only within the same Runtime segment. */
104
+ pluginStates: Record<string, RuntimeReadyPluginState>;
105
+ /** Plugin-keyed outcomes for this exact closing epoch. */
106
+ pluginOutcomes: Record<string, RuntimeReadyPluginOutcome>;
107
+ events: CanonicalEvent[];
108
+ throughCommitSeq: number;
109
+ frameSeq: number;
110
+ eventWatermark: number;
111
+ epochSeq: number;
112
+ hasMore: boolean;
113
+ }
114
+ /**
115
+ * Game-neutral coordinator for one participation. Source Plugins submit
116
+ * complete InputBatch values; Runtime persists them, assigns epoch_seq and
117
+ * drives the static Epoch Plugin graph.
118
+ */
119
+ export declare class Runtime<TPosition = unknown> implements RuntimeSourceContext<Record<string, any>, Record<string, unknown>> {
120
+ readonly adapterId: string;
121
+ readonly accountId: string;
122
+ readonly repository: RuntimeRepository;
123
+ readonly stateHistoryRepository: StateHistoryRepository<TPosition>;
124
+ readonly inputJournal: RuntimePersistenceStore<Record<string, any>, Record<string, unknown>>;
125
+ readonly observations: ObservationRegistry;
126
+ readonly actions: ActionRegistry;
127
+ private readonly eventCatalog;
128
+ private readonly eventIngress;
129
+ private readonly notificationRelays;
130
+ private readonly stateStore;
131
+ private readonly stateIngress;
132
+ private readonly stateProvider;
133
+ private readonly historyWriter;
134
+ private readonly stateObservers;
135
+ private readonly participation;
136
+ private readonly pluginScheduler;
137
+ private readonly connectionScopes;
138
+ private readonly sourcePlugins;
139
+ private readonly observability?;
140
+ private readonly actionFailureSeverity;
141
+ private readonly currentStateFromRuntimeState;
142
+ private readonly persistenceBase;
143
+ private lastHistoryWriterHealthSignature;
144
+ private closed;
145
+ private closing;
146
+ private sourceInputOpen;
147
+ private closePromise?;
148
+ private fatalError;
149
+ private ownerRestartGapOpen;
150
+ private readyState;
151
+ private readyScope;
152
+ private readyFrameSeq;
153
+ private readyEventWatermark;
154
+ private readyEpochSeq;
155
+ private readyPluginStates;
156
+ private readyPluginOutcomes;
157
+ private latestAcceptedEpochSeq;
158
+ private readonly acceptedAgentStateByEpoch;
159
+ private readonly epochCompletions;
160
+ private readonly epochIntakeTimings;
161
+ private readonly closedReadyAnchors;
162
+ private startPromise?;
163
+ private readonly followUpInput?;
164
+ private readonly readyObservers;
165
+ private readonly processingCadence?;
166
+ private cadenceTimer?;
167
+ private cadenceRun?;
168
+ private cadencePaused;
169
+ private cadenceHasLiveInput;
170
+ private cadenceId;
171
+ private cadenceNextAt;
172
+ private cadenceLatestInput?;
173
+ private cadenceLatestStateFrame?;
174
+ private cadenceProcessedInput;
175
+ private cadenceStateVersion;
176
+ private readonly cadenceInstanceId;
177
+ private cadenceError?;
178
+ private cadenceRecoveryNeedsCycle;
179
+ constructor(options: RuntimeOptions<TPosition>);
180
+ /** Dynamic owner health; unlike the repository choice, writer health can change at runtime. */
181
+ get persistence(): RuntimePersistenceStatus;
182
+ historyWriterHealth(): PublicHistoryWriterHealth;
183
+ scope(): RuntimeScope;
184
+ currentSegment(): {
185
+ scope: RuntimeScope;
186
+ kind: string;
187
+ identity?: string;
188
+ };
189
+ publicScope(): PublicRuntimeScope;
190
+ private publicScopeFor;
191
+ runtimeEpochPluginDescriptors(): ReturnType<RuntimePluginScheduler['descriptors']>;
192
+ /** Full-diagnostic, on-demand scheduler state; never sampled by default. */
193
+ runtimeEpochDiagnosticSnapshot(): ReturnType<RuntimePluginScheduler['diagnosticSnapshot']>;
194
+ /** Full-only retained row counts; implementations without a hot cache report an empty object. */
195
+ runtimeRetainedRecordCounts(): Readonly<Record<string, unknown>>;
196
+ runtimePersistenceDiagnostics(): Readonly<Record<string, unknown>>;
197
+ runtimePluginDescriptors(): RuntimePluginDescriptor[];
198
+ /** Start the current scope's Epoch Plugin graph before external input arrives. */
199
+ start(): Promise<void>;
200
+ startSourcePlugin(plugin: RuntimeSourcePlugin<Record<string, any>, Record<string, unknown>>): Promise<void>;
201
+ closeActionScope(scope: RuntimeScope, reason: string): void;
202
+ activateSegment(kind: string, identity?: string): Promise<RuntimeScope>;
203
+ adoptResumeKey(resumeKey: string): RuntimeScope;
204
+ updateMode(mode: string): RuntimeScope;
205
+ bindConnection(sourceId: string, connectionId: string, atMs?: number): RuntimeScope;
206
+ /** Explicitly move a still-live physical connection to a new logical segment. */
207
+ rebindConnectionScope(sourceId: string, connectionId: string, atMs?: number): RuntimeScope;
208
+ connectionScope(sourceId: string, connectionId: string): RuntimeScope | null;
209
+ isActiveConnection(sourceId: string, connectionId: string): boolean;
210
+ connectionChanged(sourceId: string, connectionId: string, state: RuntimeConnectionState, atMs?: number): void;
211
+ connectionLiveness(sourceId: string, connectionId: string, atMs?: number): boolean;
212
+ diagnostic(name: string, attributes?: Readonly<Record<string, unknown>>, severity?: 'debug' | 'info' | 'warn' | 'error'): void;
213
+ /**
214
+ * The fixed Runtime intake boundary. Acceptance persists the complete input
215
+ * immediately; plugin work is queued independently so Source intake never
216
+ * waits for a slow Perception or Behavior invocation.
217
+ */
218
+ acceptInputBatch(batch: RuntimeInputBatch<Record<string, any>, Record<string, unknown>>): Promise<RuntimeInputAcceptance<Record<string, any>, Record<string, unknown>>>;
219
+ readState(nowMs?: number): StateProviderResult<Record<string, any> | null>;
220
+ /** Agent-safe State view. Internal account identity never crosses owner IPC. */
221
+ readAgentState(nowMs?: number): StateProviderResult<Record<string, any> | null>;
222
+ queryObservation<Q, R>(capability: string, request: Q, expectedScope: ExpectedRuntimeScope): Promise<ObservationResult<R>>;
223
+ performAction<A, R>(capability: string, action: A, expectedScope: ExpectedRuntimeScope, caller: ActionCaller, admission?: ActionAdmissionOptions): Promise<ActionResult<R>>;
224
+ /**
225
+ * Non-consuming view bounded by the latest fully closed epoch. Consumers
226
+ * get one State/Event position without changing any delivery cursor.
227
+ */
228
+ readReadyView(afterCommitSeq?: number, limit?: number): RuntimeReadyView;
229
+ /** Waits for one exact epoch and returns the immutable State/Event view closed at it. */
230
+ waitForEpochReadyView(epochSeq: number, afterCommitSeq?: number, limit?: number): Promise<RuntimeReadyView>;
231
+ flush(): Promise<void>;
232
+ close(): Promise<void>;
233
+ private closeInternal;
234
+ private sourceEventInput;
235
+ private pluginEventInput;
236
+ private pauseCadence;
237
+ private armCadence;
238
+ private runProcessingCycle;
239
+ private hasPendingRelayNotifications;
240
+ private drainCadence;
241
+ private restoreCadenceInputs;
242
+ private commitInputEvents;
243
+ private recoverOpenEpochs;
244
+ /** Covers a crash between closing the producer epoch and accepting its follow-up. */
245
+ private recoverPendingNotifications;
246
+ private epochEventId;
247
+ private projectSourceFrame;
248
+ private recoveredAgentState;
249
+ private onEpochClosed;
250
+ private resetReadyView;
251
+ private trackEpochCompletion;
252
+ private readyViewFromAnchor;
253
+ private pluginCapabilityAccess;
254
+ private latestAcceptedActionState;
255
+ private persistTransition;
256
+ private openStateScope;
257
+ private connectionKey;
258
+ private enqueueOwnerRestartGap;
259
+ private sealDurableScope;
260
+ private assertOpen;
261
+ private assertSourceInputOpen;
262
+ private assertExpectedScope;
263
+ private onHistoryWriterHealthChanged;
264
+ }