@sorbetai/tools-node 0.0.0-stage → 0.1.0-alpha.17

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.
@@ -0,0 +1,549 @@
1
+ import { b as FileExecutionOptions, f as EnvironmentInvocation, h as ExecutionEnvironmentSource, m as ExecutionEnvironmentProvider, p as ExecutionEnv } from "./index-B3RbI0Wh.js";
2
+ import * as s from "@earendil-works/pi-schema";
3
+ import * as Context from "effect/Context";
4
+ import * as _sorbetai_runtime0 from "@sorbetai/runtime";
5
+ import { JournalFact, JournalPage, JournalReadOptions, JsonValue, ToolDefinition, UnitModelContext, UnitRuntime, UnitTx, WaitMember } from "@sorbetai/runtime";
6
+ import { PluginApply, PluginDefinition, StoredPluginPackage } from "@sorbetai/plugins";
7
+ import { NodePluginHostToolBinding } from "@sorbetai/plugins/node";
8
+
9
+ //#region src/commands/contracts.d.ts
10
+
11
+ declare const CommandRequestSchema: s.Schema<{
12
+ command: string;
13
+ sandboxPermissions?: "default" | "require-escalated" | undefined;
14
+ justification?: string | undefined;
15
+ cwd?: string | undefined;
16
+ timeout?: number | undefined;
17
+ runInBackground?: boolean | undefined;
18
+ yieldMs?: number | undefined;
19
+ }>;
20
+ type CommandRequest = s.Static<typeof CommandRequestSchema>;
21
+ declare const CommandResultProperties: {
22
+ taskId: s.Schema<string>;
23
+ status: s.Schema<"unknown" | "running" | "completed" | "failed" | "timed_out" | "cancelled">;
24
+ commandSummary: s.Schema<string>;
25
+ outputPreview: s.Schema<string>;
26
+ outputReference: s.Schema<string>;
27
+ outputBytes: s.Schema<number>;
28
+ outputLimitExceeded: s.Schema<boolean>;
29
+ outputTruncated: s.Schema<boolean>;
30
+ wallTime: s.Schema<number>;
31
+ timeoutAt: s.Optional<s.Schema<string>>;
32
+ exitCode: s.Optional<s.Schema<number>>;
33
+ signal: s.Optional<s.Schema<string>>;
34
+ forced: s.Optional<s.Schema<boolean>>;
35
+ cleanupVerified: s.Optional<s.Schema<boolean>>;
36
+ summary: s.Optional<s.Schema<string>>;
37
+ };
38
+ declare const CommandResultSchema: s.Schema<{
39
+ taskId: string;
40
+ status: "unknown" | "running" | "completed" | "failed" | "timed_out" | "cancelled";
41
+ commandSummary: string;
42
+ outputPreview: string;
43
+ outputReference: string;
44
+ outputBytes: number;
45
+ outputLimitExceeded: boolean;
46
+ outputTruncated: boolean;
47
+ wallTime: number;
48
+ timeoutAt?: string | undefined;
49
+ exitCode?: number | undefined;
50
+ signal?: string | undefined;
51
+ forced?: boolean | undefined;
52
+ cleanupVerified?: boolean | undefined;
53
+ summary?: string | undefined;
54
+ }>;
55
+ type CommandResult = s.Static<typeof CommandResultSchema>;
56
+ type CommandWaitResult = {
57
+ readonly reason: 'completed';
58
+ readonly task: CommandResult;
59
+ } | {
60
+ readonly reason: 'timeout' | 'cancelled';
61
+ };
62
+ interface CommandOrigin {
63
+ readonly runId: string;
64
+ readonly toolCallId: string;
65
+ readonly effectAttemptId: string;
66
+ }
67
+ declare const StoredCommandSchema: s.Schema<{
68
+ taskId: string;
69
+ toolCallId: string;
70
+ cwd: string;
71
+ startedAt: string;
72
+ result: {
73
+ taskId: string;
74
+ status: "unknown" | "running" | "completed" | "failed" | "timed_out" | "cancelled";
75
+ commandSummary: string;
76
+ outputPreview: string;
77
+ outputReference: string;
78
+ outputBytes: number;
79
+ outputLimitExceeded: boolean;
80
+ outputTruncated: boolean;
81
+ wallTime: number;
82
+ timeoutAt?: string | undefined;
83
+ exitCode?: number | undefined;
84
+ signal?: string | undefined;
85
+ forced?: boolean | undefined;
86
+ cleanupVerified?: boolean | undefined;
87
+ summary?: string | undefined;
88
+ };
89
+ origin?: {
90
+ runId: string;
91
+ toolCallId: string;
92
+ effectAttemptId: string;
93
+ } | undefined;
94
+ processIdentity?: string | undefined;
95
+ background?: boolean | undefined;
96
+ completionObserved?: boolean | undefined;
97
+ }>;
98
+ type StoredCommand = Readonly<s.Static<typeof StoredCommandSchema>>;
99
+ /** Current resources and individually archived results; the Host owns exclusive access. */
100
+ interface CommandStore {
101
+ /** A store may omit older consumed results from recovery; they remain readable by identity.
102
+ * Active, unconsumed and unverified-cleanup records must always be included. */
103
+ read(options?: {
104
+ readonly maxCompleted: number;
105
+ }): Promise<readonly StoredCommand[]>;
106
+ /** Persist latest states before cache eviction. Archived results remain readable by identity.
107
+ * Unit stores commit both sets together; snapshot stores archive before replacing their snapshot. */
108
+ write(records: readonly StoredCommand[], archived?: readonly StoredCommand[]): Promise<void>;
109
+ readArchived(taskId: string): Promise<StoredCommand | undefined>;
110
+ /** Committed consumption when a receipt group can update it outside the process owner. */
111
+ isCompletionObserved?(taskId: string): boolean;
112
+ }
113
+ interface CommandTaskOptions {
114
+ readonly outputDirectory: string;
115
+ readonly store: CommandStore;
116
+ readonly origin?: (toolCallId: string) => Promise<CommandOrigin>;
117
+ /** Foreground observation window in milliseconds; defaults to 30,000. It never terminates execution. */
118
+ readonly foregroundMs?: number;
119
+ readonly maxProcesses?: number;
120
+ /** Recent completed-result cache size; defaults to 64, zero keeps no consumed results in memory. This is not a durable retention limit. Output and archived task identities remain readable. */
121
+ readonly maxCompleted?: number;
122
+ /** Explicit retained-output quota; omitted streams the complete output to disk. */
123
+ readonly maxOutputBytes?: number;
124
+ }
125
+ //#endregion
126
+ //#region src/commands/tasks.d.ts
127
+ declare class CommandTaskError extends Error {
128
+ readonly code: 'invalid_request' | 'not_supported' | 'quota_exceeded' | 'not_found' | 'closed' | 'wait_conflict' | 'persistence_failed';
129
+ constructor(code: 'invalid_request' | 'not_supported' | 'quota_exceeded' | 'not_found' | 'closed' | 'wait_conflict' | 'persistence_failed', message: string, cause?: Error);
130
+ }
131
+ /** Owns active commands, pending deliveries and a bounded cache of completed resource records. */
132
+ declare class CommandTasks {
133
+ #private;
134
+ readonly foregroundMs: number;
135
+ constructor(options: CommandTaskOptions);
136
+ recover(): Promise<void>;
137
+ start(environment: ExecutionEnv, requested: CommandRequest, toolCallId: string, signal?: AbortSignal, onOutput?: (text: string) => void, ownExecution?: (execute: () => Promise<void>) => Promise<void>, beforeStart?: () => Promise<void>): Promise<CommandResult>;
138
+ /** Cold results are read by identity without expanding the recent-result cache. */
139
+ status(taskId: string): Promise<CommandResult>;
140
+ list(): readonly CommandResult[];
141
+ /** Current and recently retained background commands, with their originating tool calls. */
142
+ background(): readonly StoredCommand[];
143
+ /** Observe durable background handoffs and terminal results. */
144
+ onBackground(listener: (record: StoredCommand) => void): () => void;
145
+ /** True once this task's completion reached the model, through wait or a model request. */
146
+ isCompletionObserved(taskId: string): boolean;
147
+ output(taskId: string, offset?: number, limit?: number): Promise<{
148
+ taskId: string;
149
+ content: string;
150
+ offset: number;
151
+ nextOffset: number;
152
+ retainedBytes: number;
153
+ outputReference: string;
154
+ outputBytes: number;
155
+ outputTruncated: boolean;
156
+ }>;
157
+ cancel(taskId: string): Promise<CommandResult>;
158
+ /** Waits up to timeoutMs (0–2,147,483,647 ms), without stopping the command.
159
+ * Unsupported timer durations reject rather than being shortened. */
160
+ wait(taskId: string, timeoutMs?: number, signal?: AbortSignal): Promise<CommandWaitResult>;
161
+ /** Notifies after a terminal result is durable; returns an unsubscribe function. */
162
+ onCompletion(listener: (record: StoredCommand) => void): () => void;
163
+ /** Join admissions and owned processes without cancelling them; future starts remain allowed. */
164
+ waitForIdle(): Promise<void>;
165
+ close(): Promise<void>;
166
+ }
167
+ //#endregion
168
+ //#region src/commands/store.d.ts
169
+ /** Host resource snapshot; replacement is atomic. Core Journal remains the execution evidence. */
170
+ declare class FileCommandStore implements CommandStore {
171
+ #private;
172
+ readonly path: string;
173
+ constructor(path: string);
174
+ read(): Promise<readonly StoredCommand[]>;
175
+ write(records: readonly StoredCommand[], archived?: readonly StoredCommand[]): Promise<void>;
176
+ archive(record: StoredCommand): Promise<void>;
177
+ readArchived(taskId: string): Promise<StoredCommand | undefined>;
178
+ }
179
+ //#endregion
180
+ //#region src/commands/unit-store.d.ts
181
+ /**
182
+ * Command ownership and results on the Unit commit line. Use one store per
183
+ * Session and serialize writes (CommandTasks already does). Keep the Unit open
184
+ * until its process owner closes. With outputDirectory, persist file names and
185
+ * project them into that directory on read, so copying a Unit does not retain
186
+ * absolute paths into its old location. Without it, keep the supplied references.
187
+ *
188
+ * Register commandTaskDefinition on every Unit open, including recovery opens.
189
+ * Recover the process owner before resuming the Unit; recovery settles abandoned
190
+ * commands as unknown and never executes them again.
191
+ */
192
+ declare class UnitCommandStore implements CommandStore {
193
+ #private;
194
+ readonly unit: UnitRuntime;
195
+ readonly sessionId: string;
196
+ readonly outputDirectory?: string | undefined;
197
+ constructor(unit: UnitRuntime, sessionId: string, outputDirectory?: string | undefined);
198
+ /** The CommandTask of a command id bash returned, if this Session owns one. */
199
+ commandTask(commandId: string): string | undefined;
200
+ isCompletionObserved(commandId: string): boolean;
201
+ /**
202
+ * Resolves `consumed` once a background completion reached the model, so the command can be
203
+ * archived. Commands still running or owned elsewhere are left alone.
204
+ */
205
+ stageDelivered(tx: UnitTx, commandId: string, cause: string): void;
206
+ /** Stage only terminal states actually included in a successful model request. */
207
+ stageNotificationCoverage(tx: UnitTx, commands: readonly Pick<CommandResult, 'taskId' | 'status'>[], modelRequestId: string): void;
208
+ read(options?: {
209
+ readonly maxCompleted: number;
210
+ }): Promise<readonly StoredCommand[]>;
211
+ readArchived(commandId: string): Promise<StoredCommand | undefined>;
212
+ /**
213
+ * Offline history for a permanently closed Session. No process, lifecycle Signals
214
+ * or completion input is created; the imported command remains read-only.
215
+ */
216
+ importCompleted(record: StoredCommand): Promise<void>;
217
+ write(input: readonly StoredCommand[], archived?: readonly StoredCommand[]): Promise<void>;
218
+ }
219
+ //#endregion
220
+ //#region src/commands/task.d.ts
221
+ declare const CommandTaskInputSchema: s.Schema<{
222
+ sessionId: string;
223
+ epochId: string;
224
+ command: {
225
+ taskId: string;
226
+ toolCallId: string;
227
+ cwd: string;
228
+ startedAt: string;
229
+ result: {
230
+ taskId: string;
231
+ status: "unknown" | "running" | "completed" | "failed" | "timed_out" | "cancelled";
232
+ commandSummary: string;
233
+ outputPreview: string;
234
+ outputReference: string;
235
+ outputBytes: number;
236
+ outputLimitExceeded: boolean;
237
+ outputTruncated: boolean;
238
+ wallTime: number;
239
+ timeoutAt?: string | undefined;
240
+ exitCode?: number | undefined;
241
+ signal?: string | undefined;
242
+ forced?: boolean | undefined;
243
+ cleanupVerified?: boolean | undefined;
244
+ summary?: string | undefined;
245
+ };
246
+ origin?: {
247
+ runId: string;
248
+ toolCallId: string;
249
+ effectAttemptId: string;
250
+ } | undefined;
251
+ processIdentity?: string | undefined;
252
+ background?: boolean | undefined;
253
+ completionObserved?: boolean | undefined;
254
+ };
255
+ }>;
256
+ type CommandTaskInput = s.Static<typeof CommandTaskInputSchema>;
257
+ /**
258
+ * Register on every Unit open. The Host owns processes; aborting this Task stops
259
+ * result delivery, not the OS process. Process cancellation remains the Host's job.
260
+ */
261
+ declare const commandTaskDefinition: _sorbetai_runtime0.TaskDefinition<{
262
+ sessionId: string;
263
+ epochId: string;
264
+ command: {
265
+ taskId: string;
266
+ toolCallId: string;
267
+ cwd: string;
268
+ startedAt: string;
269
+ result: {
270
+ taskId: string;
271
+ status: "unknown" | "running" | "completed" | "failed" | "timed_out" | "cancelled";
272
+ commandSummary: string;
273
+ outputPreview: string;
274
+ outputReference: string;
275
+ outputBytes: number;
276
+ outputLimitExceeded: boolean;
277
+ outputTruncated: boolean;
278
+ wallTime: number;
279
+ timeoutAt?: string | undefined;
280
+ exitCode?: number | undefined;
281
+ signal?: string | undefined;
282
+ forced?: boolean | undefined;
283
+ cleanupVerified?: boolean | undefined;
284
+ summary?: string | undefined;
285
+ };
286
+ origin?: {
287
+ runId: string;
288
+ toolCallId: string;
289
+ effectAttemptId: string;
290
+ } | undefined;
291
+ processIdentity?: string | undefined;
292
+ background?: boolean | undefined;
293
+ completionObserved?: boolean | undefined;
294
+ };
295
+ }, {
296
+ phase: "exited";
297
+ exit: string;
298
+ consumed: string;
299
+ started?: string | undefined;
300
+ handoff?: string | undefined;
301
+ } | {
302
+ phase: "open";
303
+ }, {
304
+ status: "unknown" | "completed" | "failed" | "timed_out" | "cancelled";
305
+ taskId: string;
306
+ commandSummary: string;
307
+ outputPreview: string;
308
+ outputReference: string;
309
+ outputBytes: number;
310
+ outputLimitExceeded: boolean;
311
+ outputTruncated: boolean;
312
+ wallTime: number;
313
+ timeoutAt?: string | undefined;
314
+ exitCode?: number | undefined;
315
+ signal?: string | undefined;
316
+ forced?: boolean | undefined;
317
+ cleanupVerified?: boolean | undefined;
318
+ summary?: string | undefined;
319
+ }>;
320
+ /**
321
+ * Stages command ownership and its lifecycle Signals in the caller's atomic group.
322
+ * A process owner commits this before dispatch; a receipt-only caller must already
323
+ * own its process. Exit may be resolved immediately after commit, before Unit resume.
324
+ * Repeating the creation key returns the original Task and Signal identities.
325
+ */
326
+ declare function stageCommandTask(tx: UnitTx, input: CommandTaskInput): {
327
+ taskId: string;
328
+ exit: string;
329
+ consumed: string;
330
+ started: string | undefined;
331
+ handoff: string | undefined;
332
+ };
333
+ //#endregion
334
+ //#region src/commands/recovery.d.ts
335
+ /** Settle committed command attempts before resuming a Unit, even when bash is no longer installed.
336
+ * The previous process owner must be gone; recovery never dispatches a command again. */
337
+ declare function recoverSessionCommands(unit: UnitRuntime, sessionId: string, outputDirectory: string): Promise<void>;
338
+ //#endregion
339
+ //#region src/commands/wait-source.d.ts
340
+ type Target = {
341
+ readonly taskId: string;
342
+ } | {
343
+ readonly runId: string;
344
+ };
345
+ type SubmissionInput = Extract<JournalFact, {
346
+ kind: 'submission.accepted';
347
+ }>['payload']['input'];
348
+ /**
349
+ * Lets the durable `wait` Tool wait for this Session's commands by the id bash returned. The
350
+ * shape matches `WaitTargetSource` from `@sorbetai/durable` without depending on it.
351
+ */
352
+ declare function commandWaitTargets(store: UnitCommandStore): {
353
+ resolve(sessionId: string, target: Target): Promise<{
354
+ readonly kind: "member";
355
+ readonly member: WaitMember;
356
+ } | {
357
+ readonly kind: "refused";
358
+ readonly reason: string;
359
+ } | undefined>;
360
+ describe(_sessionId: string, target: Target): Promise<{
361
+ readonly [key: string]: JsonValue;
362
+ }>;
363
+ notification(input: SubmissionInput): Target | undefined;
364
+ delivered(tx: UnitTx, target: Target, commandId: string): void;
365
+ };
366
+ //#endregion
367
+ //#region src/execution/output-truncation.d.ts
368
+ interface TruncationResult {
369
+ /** The truncated content */
370
+ content: string;
371
+ /** Whether truncation occurred */
372
+ truncated: boolean;
373
+ /** Which limit was hit: "lines", "bytes", or null if not truncated */
374
+ truncatedBy: 'lines' | 'bytes' | null;
375
+ /** Total number of lines in the original content */
376
+ totalLines: number;
377
+ /** Total number of bytes in the original content */
378
+ totalBytes: number;
379
+ /** Number of complete lines in the truncated output */
380
+ outputLines: number;
381
+ /** Number of bytes in the truncated output */
382
+ outputBytes: number;
383
+ /** Whether the last line was partially truncated (only for tail truncation edge case) */
384
+ lastLinePartial: boolean;
385
+ /** Whether the first line exceeded the byte limit (for head truncation) */
386
+ firstLineExceedsLimit: boolean;
387
+ /** The max lines limit that was applied */
388
+ maxLines: number;
389
+ /** The max bytes limit that was applied */
390
+ maxBytes: number;
391
+ }
392
+ //#endregion
393
+ //#region src/execution/read.d.ts
394
+ declare const ReadInput: s.Schema<{
395
+ path: string;
396
+ sandboxPermissions?: "default" | "require-escalated" | undefined;
397
+ justification?: string | undefined;
398
+ offset?: number | undefined;
399
+ byteOffset?: number | undefined;
400
+ limit?: number | undefined;
401
+ }>;
402
+ interface ReadDetails {
403
+ truncation?: TruncationResult;
404
+ byteRange?: {
405
+ offset: number;
406
+ end: number;
407
+ totalBytes: number;
408
+ next?: number;
409
+ };
410
+ }
411
+ declare function createReadTool(source: ExecutionEnvironmentSource, beforeStart?: FileExecutionOptions['beforeStart']): ToolDefinition<typeof ReadInput, ReadDetails | undefined> & {
412
+ readonly recovery: 'safe';
413
+ };
414
+ //#endregion
415
+ //#region src/execution/edit.d.ts
416
+ declare const EditInput: s.Schema<{
417
+ path: string;
418
+ edits: {
419
+ oldText: string;
420
+ newText: string;
421
+ }[];
422
+ sandboxPermissions?: "default" | "require-escalated" | undefined;
423
+ justification?: string | undefined;
424
+ }>;
425
+ interface EditDetails {
426
+ readonly diff: string;
427
+ readonly patch: string;
428
+ readonly firstChangedLine?: number;
429
+ readonly path: string;
430
+ readonly edits: number;
431
+ }
432
+ declare function createEditTool(source: ExecutionEnvironmentSource, beforeStart?: FileExecutionOptions['beforeStart']): ToolDefinition<typeof EditInput, EditDetails>;
433
+ //#endregion
434
+ //#region src/execution/write.d.ts
435
+ declare const WriteInput: s.Schema<{
436
+ path: string;
437
+ content: string;
438
+ sandboxPermissions?: "default" | "require-escalated" | undefined;
439
+ justification?: string | undefined;
440
+ }>;
441
+ interface WriteDetails {
442
+ readonly path: string;
443
+ readonly bytes: number;
444
+ }
445
+ declare function createWriteTool(source: ExecutionEnvironmentSource, beforeStart?: FileExecutionOptions['beforeStart']): ToolDefinition<typeof WriteInput, WriteDetails>;
446
+ //#endregion
447
+ //#region src/execution/bash.d.ts
448
+ declare const BashRequestSchema: s.Schema<{
449
+ command: string;
450
+ sandboxPermissions?: "default" | "require-escalated" | undefined;
451
+ justification?: string | undefined;
452
+ cwd?: string | undefined;
453
+ timeout?: number | undefined;
454
+ runInBackground?: boolean | undefined;
455
+ yieldMs?: number | undefined;
456
+ } | {
457
+ action: "list";
458
+ } | {
459
+ action: "status";
460
+ taskId: string;
461
+ } | {
462
+ action: "cancel";
463
+ taskId: string;
464
+ } | {
465
+ action: "output";
466
+ taskId: string;
467
+ offset?: number | undefined;
468
+ limit?: number | undefined;
469
+ }>;
470
+ interface BashDetails {
471
+ truncation?: TruncationResult;
472
+ fullOutputPath?: string;
473
+ }
474
+ /** ownExecution must invoke its work once and retain the Provider until that Promise drains.
475
+ * Retirement must not cancel handed-off work; its CommandTasks owner supplies cancellation.
476
+ */
477
+ declare function createBashTool(source: ExecutionEnvironmentSource, commands?: CommandTasks, ownExecution?: (execute: () => Promise<void>) => Promise<void>, beforeStart?: () => Promise<void>, invocationProperties?: s.Properties): ToolDefinition<typeof BashRequestSchema, BashDetails | undefined>;
478
+ //#endregion
479
+ //#region src/execution/escalation.d.ts
480
+ /**
481
+ * Explicit per-call sandbox escalation. A Tool never widens its own boundary: it declares the
482
+ * need, the Session decides, and only an approved attempt runs in the wider boundary
483
+ * (ADR-0103).
484
+ */
485
+ declare const SandboxEscalationProperties: {
486
+ readonly sandboxPermissions: s.Optional<s.Schema<"default" | "require-escalated">>;
487
+ readonly justification: s.Optional<s.Schema<string>>;
488
+ };
489
+ //#endregion
490
+ //#region src/workspace/contracts.d.ts
491
+ type NodeWorkspaceErrorCode = 'invalid_root';
492
+ declare class NodeWorkspaceError extends Error {
493
+ readonly code: NodeWorkspaceErrorCode;
494
+ constructor(code: NodeWorkspaceErrorCode, message: string, options?: ErrorOptions);
495
+ }
496
+ //#endregion
497
+ //#region src/workspace/node-workspace.d.ts
498
+ declare class NodeWorkspace {
499
+ #private;
500
+ private constructor();
501
+ /** Canonical absolute root used as the default Session filesystem authority. */
502
+ get root(): string;
503
+ static open(root: string): Promise<NodeWorkspace>;
504
+ }
505
+ //#endregion
506
+ //#region src/plugins/workspace.d.ts
507
+ /** Borrows the Host's admitted Run environment; constructing bindings performs no workspace IO. */
508
+ declare function createWorkspacePluginHostBindings(packageId: string, entryId: string, environment: () => ExecutionEnv): readonly NodePluginHostToolBinding[];
509
+ /** Programmatic assembly shares author behavior with the stored Package; no environment is owned. */
510
+ declare function createWorkspacePlugin(environment: () => ExecutionEnv): PluginApply<null>;
511
+ /** Encodes the shipped self-contained author bundle; does not install or grant Host bindings. */
512
+ declare function createWorkspacePluginPackage(): Promise<StoredPluginPackage>;
513
+ //#endregion
514
+ //#region src/commands/session.d.ts
515
+ interface CommandJournal {
516
+ readFacts(options?: JournalReadOptions): Promise<JournalPage>;
517
+ }
518
+ type CommandExecutionOptions = Pick<CommandTaskOptions, 'foregroundMs' | 'maxProcesses' | 'maxCompleted' | 'maxOutputBytes'>;
519
+ /** Node Host owns processes and evidence; Core owns the originating Tool Effect. */
520
+ declare class SessionCommands {
521
+ #private;
522
+ readonly tasks: CommandTasks;
523
+ constructor(filesDirectory: string, store: UnitCommandStore, options?: CommandExecutionOptions);
524
+ bind(runtime: CommandJournal): Promise<void>;
525
+ /** Completion notifications live for one request, never as revisioned command history. */
526
+ modelContext(): UnitModelContext;
527
+ beginRun(runId: string): void;
528
+ finishRun(): void;
529
+ }
530
+ //#endregion
531
+ //#region src/commands/service.d.ts
532
+ interface CommandRuntimeBinding {
533
+ readonly unit: UnitRuntime;
534
+ readonly sessionId: string;
535
+ readonly filesDirectory: string;
536
+ readonly enabled?: boolean;
537
+ readonly options?: CommandExecutionOptions;
538
+ readonly onReady: (owner: SessionCommands, store: UnitCommandStore) => void;
539
+ }
540
+ declare const CommandRuntime: Context.Service<CommandRuntimeBinding, CommandRuntimeBinding>;
541
+ //#endregion
542
+ //#region src/plugins/execution-tools.d.ts
543
+ declare const readTool: PluginDefinition<null, readonly [Context.Service<ExecutionEnvironmentProvider, ExecutionEnvironmentProvider>]>;
544
+ declare const editTool: PluginDefinition<null, readonly [Context.Service<ExecutionEnvironmentProvider, ExecutionEnvironmentProvider>]>;
545
+ declare const writeTool: PluginDefinition<null, readonly [Context.Service<ExecutionEnvironmentProvider, ExecutionEnvironmentProvider>]>;
546
+ declare const bashTool: PluginDefinition<null, readonly [typeof CommandRuntime]>;
547
+ //#endregion
548
+ export { type CommandExecutionOptions, type CommandOrigin, type CommandRequest, type CommandResult, CommandResultProperties, CommandResultSchema, CommandRuntime, type CommandRuntimeBinding, type CommandStore, CommandTaskError, type CommandTaskInput, type CommandTaskOptions, CommandTasks, type CommandWaitResult, type EnvironmentInvocation, type ExecutionEnvironmentProvider, type ExecutionEnvironmentSource, FileCommandStore, NodeWorkspace, NodeWorkspaceError, NodeWorkspaceErrorCode, SandboxEscalationProperties, SessionCommands, type StoredCommand, UnitCommandStore, bashTool, commandTaskDefinition, commandWaitTargets, createBashTool, createEditTool, createReadTool, createWorkspacePlugin, createWorkspacePluginHostBindings, createWorkspacePluginPackage, createWriteTool, editTool, readTool, recoverSessionCommands, stageCommandTask, writeTool };
549
+ //# sourceMappingURL=index.d.ts.map