@codeworksh/harness 0.0.1-dev.20260824182323 → 0.0.1-dev.20260825090614
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/README.md +15 -0
- package/cli/index.d.mts +1 -2
- package/cli/index.mjs +150 -9
- package/cli/index.mjs.map +1 -1
- package/effect.d.mts +2101 -26
- package/effect.mjs +2 -2
- package/package.json +2 -2
- package/{session-CF1B0VEr.mjs → session-BpTL_HoS.mjs} +247 -99
- package/session-BpTL_HoS.mjs.map +1 -0
- package/control-DyVTL25_.d.mts +0 -1947
- package/session-CF1B0VEr.mjs.map +0 -1
package/effect.d.mts
CHANGED
|
@@ -1,8 +1,2083 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Event, Message, Model } from "@codeworksh/aikit";
|
|
1
|
+
import { Cause, Config, Context, Duration, Effect, Layer, Option, Schema, Stream } from "effect";
|
|
2
|
+
import { Event, Message, Model, Protocol } from "@codeworksh/aikit";
|
|
4
3
|
import { SqlClient, SqlClient as SqlClient$1 } from "effect/unstable/sql";
|
|
5
4
|
import { SqliteClient } from "@effect/sql-sqlite-node";
|
|
5
|
+
import { Model as Model$1 } from "effect/unstable/schema";
|
|
6
|
+
import { ChildProcessSpawner } from "effect/unstable/process";
|
|
7
|
+
import { SqliteProvider, create } from "@platformatic/vfs";
|
|
8
|
+
import "just-bash";
|
|
9
|
+
import "@codeworksh/aikit/failure";
|
|
10
|
+
//#region src/session/prompt/schema.d.ts
|
|
11
|
+
declare const Prompt: Schema.Struct<{
|
|
12
|
+
readonly text: Schema.String;
|
|
13
|
+
}> & {
|
|
14
|
+
equivalence: import("effect/Equivalence").Equivalence<{
|
|
15
|
+
readonly text: string;
|
|
16
|
+
}>;
|
|
17
|
+
fromUserMessage: (input: Pick<Prompt, "text">) => {
|
|
18
|
+
readonly text: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
type Prompt = typeof Prompt.Type;
|
|
22
|
+
declare const Delivery: Schema.Literals<readonly ["steer", "followUp"]>;
|
|
23
|
+
type Delivery = typeof Delivery.Type;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/db/schema.sql.d.ts
|
|
26
|
+
declare const entryTypes: readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"];
|
|
27
|
+
type EntryType = (typeof entryTypes)[number];
|
|
28
|
+
declare const entryStates: readonly ["draft", "committed", "aborted"];
|
|
29
|
+
type EntryState = (typeof entryStates)[number];
|
|
30
|
+
declare const partTypes: readonly ["text", "image", "thinking", "toolCall"];
|
|
31
|
+
type PartType = (typeof partTypes)[number];
|
|
32
|
+
declare const toolStatuses: readonly ["pending", "running", "completed", "error", "skipped", "aborted"];
|
|
33
|
+
type ToolStatus = (typeof toolStatuses)[number];
|
|
34
|
+
declare const SessionRow_base: import("effect/unstable/schema/VariantSchema").Class<SessionRow, {
|
|
35
|
+
readonly createdAt: Model$1.DateTimeInsertFromNumber;
|
|
36
|
+
readonly updatedAt: Model$1.DateTimeUpdateFromNumber;
|
|
37
|
+
readonly id: Schema.brand<Schema.String, "Session.ID">;
|
|
38
|
+
readonly projectId: Schema.String;
|
|
39
|
+
readonly parentId: Model$1.FieldOption<Schema.brand<Schema.String, "Session.ID">>;
|
|
40
|
+
readonly slug: Schema.String;
|
|
41
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
42
|
+
readonly title: Schema.String;
|
|
43
|
+
readonly tag: Model$1.FieldOption<Schema.String>;
|
|
44
|
+
readonly metadata: import("effect/unstable/schema/VariantSchema").Field<{
|
|
45
|
+
readonly select: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
46
|
+
readonly insert: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
47
|
+
readonly update: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
48
|
+
readonly json: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
49
|
+
readonly jsonCreate: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
50
|
+
readonly jsonUpdate: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
51
|
+
}>;
|
|
52
|
+
readonly sandboxInstanceId: Model$1.FieldOption<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
53
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
54
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
55
|
+
}>;
|
|
56
|
+
readonly leafEntryId: Model$1.FieldOption<Schema.String>;
|
|
57
|
+
readonly cost: Model$1.GeneratedByDb<Schema.Finite>;
|
|
58
|
+
readonly tokensInput: Model$1.GeneratedByDb<Schema.Int>;
|
|
59
|
+
readonly tokensOutput: Model$1.GeneratedByDb<Schema.Int>;
|
|
60
|
+
readonly tokensCacheRead: Model$1.GeneratedByDb<Schema.Int>;
|
|
61
|
+
readonly tokensCacheWrite: Model$1.GeneratedByDb<Schema.Int>;
|
|
62
|
+
}, Schema.Struct<import("effect/unstable/schema/VariantSchema").ExtractFields<"select", {
|
|
63
|
+
readonly createdAt: Model$1.DateTimeInsertFromNumber;
|
|
64
|
+
readonly updatedAt: Model$1.DateTimeUpdateFromNumber;
|
|
65
|
+
readonly id: Schema.brand<Schema.String, "Session.ID">;
|
|
66
|
+
readonly projectId: Schema.String;
|
|
67
|
+
readonly parentId: Model$1.FieldOption<Schema.brand<Schema.String, "Session.ID">>;
|
|
68
|
+
readonly slug: Schema.String;
|
|
69
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
70
|
+
readonly title: Schema.String;
|
|
71
|
+
readonly tag: Model$1.FieldOption<Schema.String>;
|
|
72
|
+
readonly metadata: import("effect/unstable/schema/VariantSchema").Field<{
|
|
73
|
+
readonly select: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
74
|
+
readonly insert: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
75
|
+
readonly update: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
76
|
+
readonly json: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
77
|
+
readonly jsonCreate: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
78
|
+
readonly jsonUpdate: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
79
|
+
}>;
|
|
80
|
+
readonly sandboxInstanceId: Model$1.FieldOption<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
81
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
82
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
83
|
+
}>;
|
|
84
|
+
readonly leafEntryId: Model$1.FieldOption<Schema.String>;
|
|
85
|
+
readonly cost: Model$1.GeneratedByDb<Schema.Finite>;
|
|
86
|
+
readonly tokensInput: Model$1.GeneratedByDb<Schema.Int>;
|
|
87
|
+
readonly tokensOutput: Model$1.GeneratedByDb<Schema.Int>;
|
|
88
|
+
readonly tokensCacheRead: Model$1.GeneratedByDb<Schema.Int>;
|
|
89
|
+
readonly tokensCacheWrite: Model$1.GeneratedByDb<Schema.Int>;
|
|
90
|
+
}, true>>> & {
|
|
91
|
+
readonly insert: Schema.Struct<{
|
|
92
|
+
readonly createdAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
93
|
+
readonly updatedAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
94
|
+
readonly id: Schema.brand<Schema.String, "Session.ID">;
|
|
95
|
+
readonly projectId: Schema.String;
|
|
96
|
+
readonly parentId: Schema.OptionFromNullOr<Schema.brand<Schema.String, "Session.ID">>;
|
|
97
|
+
readonly slug: Schema.String;
|
|
98
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
99
|
+
readonly title: Schema.String;
|
|
100
|
+
readonly tag: Schema.OptionFromNullOr<Schema.String>;
|
|
101
|
+
readonly metadata: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
102
|
+
readonly sandboxInstanceId: Schema.OptionFromNullOr<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
103
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
104
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
105
|
+
}>;
|
|
106
|
+
readonly leafEntryId: Schema.OptionFromNullOr<Schema.String>;
|
|
107
|
+
}>;
|
|
108
|
+
readonly json: Schema.Struct<{
|
|
109
|
+
readonly createdAt: Schema.DateTimeUtcFromMillis;
|
|
110
|
+
readonly updatedAt: Schema.DateTimeUtcFromMillis;
|
|
111
|
+
readonly id: Schema.brand<Schema.String, "Session.ID">;
|
|
112
|
+
readonly projectId: Schema.String;
|
|
113
|
+
readonly parentId: Model$1.optionalOption<Schema.brand<Schema.String, "Session.ID">>;
|
|
114
|
+
readonly slug: Schema.String;
|
|
115
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
116
|
+
readonly title: Schema.String;
|
|
117
|
+
readonly tag: Model$1.optionalOption<Schema.String>;
|
|
118
|
+
readonly metadata: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
119
|
+
readonly sandboxInstanceId: Model$1.optionalOption<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
120
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
121
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
122
|
+
}>;
|
|
123
|
+
readonly leafEntryId: Model$1.optionalOption<Schema.String>;
|
|
124
|
+
readonly cost: Schema.Finite;
|
|
125
|
+
readonly tokensInput: Schema.Int;
|
|
126
|
+
readonly tokensOutput: Schema.Int;
|
|
127
|
+
readonly tokensCacheRead: Schema.Int;
|
|
128
|
+
readonly tokensCacheWrite: Schema.Int;
|
|
129
|
+
}>;
|
|
130
|
+
readonly jsonCreate: Schema.Struct<{
|
|
131
|
+
readonly id: Schema.brand<Schema.String, "Session.ID">;
|
|
132
|
+
readonly projectId: Schema.String;
|
|
133
|
+
readonly parentId: Model$1.optionalOption<Schema.brand<Schema.String, "Session.ID">>;
|
|
134
|
+
readonly slug: Schema.String;
|
|
135
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
136
|
+
readonly title: Schema.String;
|
|
137
|
+
readonly tag: Model$1.optionalOption<Schema.String>;
|
|
138
|
+
readonly metadata: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
139
|
+
readonly sandboxInstanceId: Model$1.optionalOption<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
140
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
141
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
142
|
+
}>;
|
|
143
|
+
readonly leafEntryId: Model$1.optionalOption<Schema.String>;
|
|
144
|
+
}>;
|
|
145
|
+
readonly jsonUpdate: Schema.Struct<{
|
|
146
|
+
readonly id: Schema.brand<Schema.String, "Session.ID">;
|
|
147
|
+
readonly projectId: Schema.String;
|
|
148
|
+
readonly parentId: Model$1.optionalOption<Schema.brand<Schema.String, "Session.ID">>;
|
|
149
|
+
readonly slug: Schema.String;
|
|
150
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
151
|
+
readonly title: Schema.String;
|
|
152
|
+
readonly tag: Model$1.optionalOption<Schema.String>;
|
|
153
|
+
readonly metadata: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
154
|
+
readonly sandboxInstanceId: Model$1.optionalOption<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
155
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
156
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
157
|
+
}>;
|
|
158
|
+
readonly leafEntryId: Model$1.optionalOption<Schema.String>;
|
|
159
|
+
}>;
|
|
160
|
+
readonly select: Schema.Struct<{
|
|
161
|
+
readonly createdAt: Schema.DateTimeUtcFromMillis;
|
|
162
|
+
readonly updatedAt: Schema.DateTimeUtcFromMillis;
|
|
163
|
+
readonly id: Schema.brand<Schema.String, "Session.ID">;
|
|
164
|
+
readonly projectId: Schema.String;
|
|
165
|
+
readonly parentId: Schema.OptionFromNullOr<Schema.brand<Schema.String, "Session.ID">>;
|
|
166
|
+
readonly slug: Schema.String;
|
|
167
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
168
|
+
readonly title: Schema.String;
|
|
169
|
+
readonly tag: Schema.OptionFromNullOr<Schema.String>;
|
|
170
|
+
readonly metadata: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
171
|
+
readonly sandboxInstanceId: Schema.OptionFromNullOr<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
172
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
173
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
174
|
+
}>;
|
|
175
|
+
readonly leafEntryId: Schema.OptionFromNullOr<Schema.String>;
|
|
176
|
+
readonly cost: Schema.Finite;
|
|
177
|
+
readonly tokensInput: Schema.Int;
|
|
178
|
+
readonly tokensOutput: Schema.Int;
|
|
179
|
+
readonly tokensCacheRead: Schema.Int;
|
|
180
|
+
readonly tokensCacheWrite: Schema.Int;
|
|
181
|
+
}>;
|
|
182
|
+
readonly update: Schema.Struct<{
|
|
183
|
+
readonly updatedAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
184
|
+
readonly id: Schema.brand<Schema.String, "Session.ID">;
|
|
185
|
+
readonly projectId: Schema.String;
|
|
186
|
+
readonly parentId: Schema.OptionFromNullOr<Schema.brand<Schema.String, "Session.ID">>;
|
|
187
|
+
readonly slug: Schema.String;
|
|
188
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
189
|
+
readonly title: Schema.String;
|
|
190
|
+
readonly tag: Schema.OptionFromNullOr<Schema.String>;
|
|
191
|
+
readonly metadata: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
192
|
+
readonly sandboxInstanceId: Schema.OptionFromNullOr<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
193
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
194
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
195
|
+
}>;
|
|
196
|
+
readonly leafEntryId: Schema.OptionFromNullOr<Schema.String>;
|
|
197
|
+
}>;
|
|
198
|
+
};
|
|
199
|
+
declare class SessionRow extends SessionRow_base {}
|
|
200
|
+
declare const SessionEntryRow_base: import("effect/unstable/schema/VariantSchema").Class<SessionEntryRow, {
|
|
201
|
+
readonly createdAt: Model$1.DateTimeInsertFromNumber;
|
|
202
|
+
readonly updatedAt: Model$1.DateTimeUpdateFromNumber;
|
|
203
|
+
readonly id: Schema.String;
|
|
204
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
205
|
+
readonly parentId: Model$1.FieldOption<Schema.String>;
|
|
206
|
+
readonly seq: Schema.Int;
|
|
207
|
+
readonly type: Schema.Literals<readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"]>;
|
|
208
|
+
readonly state: Schema.Literals<readonly ["draft", "committed", "aborted"]>;
|
|
209
|
+
readonly data: Schema.String;
|
|
210
|
+
readonly label: Model$1.FieldOption<Schema.String>;
|
|
211
|
+
readonly metadata: import("effect/unstable/schema/VariantSchema").Field<{
|
|
212
|
+
readonly select: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
213
|
+
readonly insert: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
214
|
+
readonly update: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
215
|
+
readonly json: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
216
|
+
readonly jsonCreate: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
217
|
+
readonly jsonUpdate: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
218
|
+
}>;
|
|
219
|
+
}, Schema.Struct<import("effect/unstable/schema/VariantSchema").ExtractFields<"select", {
|
|
220
|
+
readonly createdAt: Model$1.DateTimeInsertFromNumber;
|
|
221
|
+
readonly updatedAt: Model$1.DateTimeUpdateFromNumber;
|
|
222
|
+
readonly id: Schema.String;
|
|
223
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
224
|
+
readonly parentId: Model$1.FieldOption<Schema.String>;
|
|
225
|
+
readonly seq: Schema.Int;
|
|
226
|
+
readonly type: Schema.Literals<readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"]>;
|
|
227
|
+
readonly state: Schema.Literals<readonly ["draft", "committed", "aborted"]>;
|
|
228
|
+
readonly data: Schema.String;
|
|
229
|
+
readonly label: Model$1.FieldOption<Schema.String>;
|
|
230
|
+
readonly metadata: import("effect/unstable/schema/VariantSchema").Field<{
|
|
231
|
+
readonly select: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
232
|
+
readonly insert: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
233
|
+
readonly update: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
234
|
+
readonly json: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
235
|
+
readonly jsonCreate: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
236
|
+
readonly jsonUpdate: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
237
|
+
}>;
|
|
238
|
+
}, true>>> & {
|
|
239
|
+
readonly insert: Schema.Struct<{
|
|
240
|
+
readonly createdAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
241
|
+
readonly updatedAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
242
|
+
readonly id: Schema.String;
|
|
243
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
244
|
+
readonly parentId: Schema.OptionFromNullOr<Schema.String>;
|
|
245
|
+
readonly seq: Schema.Int;
|
|
246
|
+
readonly type: Schema.Literals<readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"]>;
|
|
247
|
+
readonly state: Schema.Literals<readonly ["draft", "committed", "aborted"]>;
|
|
248
|
+
readonly data: Schema.String;
|
|
249
|
+
readonly label: Schema.OptionFromNullOr<Schema.String>;
|
|
250
|
+
readonly metadata: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
251
|
+
}>;
|
|
252
|
+
readonly json: Schema.Struct<{
|
|
253
|
+
readonly createdAt: Schema.DateTimeUtcFromMillis;
|
|
254
|
+
readonly updatedAt: Schema.DateTimeUtcFromMillis;
|
|
255
|
+
readonly id: Schema.String;
|
|
256
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
257
|
+
readonly parentId: Model$1.optionalOption<Schema.String>;
|
|
258
|
+
readonly seq: Schema.Int;
|
|
259
|
+
readonly type: Schema.Literals<readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"]>;
|
|
260
|
+
readonly state: Schema.Literals<readonly ["draft", "committed", "aborted"]>;
|
|
261
|
+
readonly data: Schema.String;
|
|
262
|
+
readonly label: Model$1.optionalOption<Schema.String>;
|
|
263
|
+
readonly metadata: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
264
|
+
}>;
|
|
265
|
+
readonly jsonCreate: Schema.Struct<{
|
|
266
|
+
readonly id: Schema.String;
|
|
267
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
268
|
+
readonly parentId: Model$1.optionalOption<Schema.String>;
|
|
269
|
+
readonly seq: Schema.Int;
|
|
270
|
+
readonly type: Schema.Literals<readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"]>;
|
|
271
|
+
readonly state: Schema.Literals<readonly ["draft", "committed", "aborted"]>;
|
|
272
|
+
readonly data: Schema.String;
|
|
273
|
+
readonly label: Model$1.optionalOption<Schema.String>;
|
|
274
|
+
readonly metadata: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
275
|
+
}>;
|
|
276
|
+
readonly jsonUpdate: Schema.Struct<{
|
|
277
|
+
readonly id: Schema.String;
|
|
278
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
279
|
+
readonly parentId: Model$1.optionalOption<Schema.String>;
|
|
280
|
+
readonly seq: Schema.Int;
|
|
281
|
+
readonly type: Schema.Literals<readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"]>;
|
|
282
|
+
readonly state: Schema.Literals<readonly ["draft", "committed", "aborted"]>;
|
|
283
|
+
readonly data: Schema.String;
|
|
284
|
+
readonly label: Model$1.optionalOption<Schema.String>;
|
|
285
|
+
readonly metadata: Model$1.optionalOption<Schema.$Record<Schema.String, Schema.String>>;
|
|
286
|
+
}>;
|
|
287
|
+
readonly select: Schema.Struct<{
|
|
288
|
+
readonly createdAt: Schema.DateTimeUtcFromMillis;
|
|
289
|
+
readonly updatedAt: Schema.DateTimeUtcFromMillis;
|
|
290
|
+
readonly id: Schema.String;
|
|
291
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
292
|
+
readonly parentId: Schema.OptionFromNullOr<Schema.String>;
|
|
293
|
+
readonly seq: Schema.Int;
|
|
294
|
+
readonly type: Schema.Literals<readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"]>;
|
|
295
|
+
readonly state: Schema.Literals<readonly ["draft", "committed", "aborted"]>;
|
|
296
|
+
readonly data: Schema.String;
|
|
297
|
+
readonly label: Schema.OptionFromNullOr<Schema.String>;
|
|
298
|
+
readonly metadata: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
299
|
+
}>;
|
|
300
|
+
readonly update: Schema.Struct<{
|
|
301
|
+
readonly updatedAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
302
|
+
readonly id: Schema.String;
|
|
303
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
304
|
+
readonly parentId: Schema.OptionFromNullOr<Schema.String>;
|
|
305
|
+
readonly seq: Schema.Int;
|
|
306
|
+
readonly type: Schema.Literals<readonly ["user", "assistant", "synthetic", "compaction", "branchSummary", "custom", "configChange"]>;
|
|
307
|
+
readonly state: Schema.Literals<readonly ["draft", "committed", "aborted"]>;
|
|
308
|
+
readonly data: Schema.String;
|
|
309
|
+
readonly label: Schema.OptionFromNullOr<Schema.String>;
|
|
310
|
+
readonly metadata: Schema.OptionFromNullOr<Schema.fromJsonString<Schema.$Record<Schema.String, Schema.String>>>;
|
|
311
|
+
}>;
|
|
312
|
+
};
|
|
313
|
+
declare class SessionEntryRow extends SessionEntryRow_base {}
|
|
314
|
+
declare const SessionEntryPartRow_base: import("effect/unstable/schema/VariantSchema").Class<SessionEntryPartRow, {
|
|
315
|
+
readonly createdAt: Model$1.DateTimeInsertFromNumber;
|
|
316
|
+
readonly updatedAt: Model$1.DateTimeUpdateFromNumber;
|
|
317
|
+
readonly id: Schema.String;
|
|
318
|
+
readonly entryId: Schema.String;
|
|
319
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
320
|
+
readonly partIndex: Schema.Int;
|
|
321
|
+
readonly type: Schema.Literals<readonly ["text", "image", "thinking", "toolCall"]>;
|
|
322
|
+
readonly status: Model$1.FieldOption<Schema.Literals<readonly ["pending", "running", "completed", "error", "skipped", "aborted"]>>;
|
|
323
|
+
readonly callId: Model$1.FieldOption<Schema.String>;
|
|
324
|
+
readonly toolName: Model$1.FieldOption<Schema.String>;
|
|
325
|
+
readonly data: Schema.String;
|
|
326
|
+
}, Schema.Struct<import("effect/unstable/schema/VariantSchema").ExtractFields<"select", {
|
|
327
|
+
readonly createdAt: Model$1.DateTimeInsertFromNumber;
|
|
328
|
+
readonly updatedAt: Model$1.DateTimeUpdateFromNumber;
|
|
329
|
+
readonly id: Schema.String;
|
|
330
|
+
readonly entryId: Schema.String;
|
|
331
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
332
|
+
readonly partIndex: Schema.Int;
|
|
333
|
+
readonly type: Schema.Literals<readonly ["text", "image", "thinking", "toolCall"]>;
|
|
334
|
+
readonly status: Model$1.FieldOption<Schema.Literals<readonly ["pending", "running", "completed", "error", "skipped", "aborted"]>>;
|
|
335
|
+
readonly callId: Model$1.FieldOption<Schema.String>;
|
|
336
|
+
readonly toolName: Model$1.FieldOption<Schema.String>;
|
|
337
|
+
readonly data: Schema.String;
|
|
338
|
+
}, true>>> & {
|
|
339
|
+
readonly insert: Schema.Struct<{
|
|
340
|
+
readonly createdAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
341
|
+
readonly updatedAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
342
|
+
readonly id: Schema.String;
|
|
343
|
+
readonly entryId: Schema.String;
|
|
344
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
345
|
+
readonly partIndex: Schema.Int;
|
|
346
|
+
readonly type: Schema.Literals<readonly ["text", "image", "thinking", "toolCall"]>;
|
|
347
|
+
readonly status: Schema.OptionFromNullOr<Schema.Literals<readonly ["pending", "running", "completed", "error", "skipped", "aborted"]>>;
|
|
348
|
+
readonly callId: Schema.OptionFromNullOr<Schema.String>;
|
|
349
|
+
readonly toolName: Schema.OptionFromNullOr<Schema.String>;
|
|
350
|
+
readonly data: Schema.String;
|
|
351
|
+
}>;
|
|
352
|
+
readonly json: Schema.Struct<{
|
|
353
|
+
readonly createdAt: Schema.DateTimeUtcFromMillis;
|
|
354
|
+
readonly updatedAt: Schema.DateTimeUtcFromMillis;
|
|
355
|
+
readonly id: Schema.String;
|
|
356
|
+
readonly entryId: Schema.String;
|
|
357
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
358
|
+
readonly partIndex: Schema.Int;
|
|
359
|
+
readonly type: Schema.Literals<readonly ["text", "image", "thinking", "toolCall"]>;
|
|
360
|
+
readonly status: Model$1.optionalOption<Schema.Literals<readonly ["pending", "running", "completed", "error", "skipped", "aborted"]>>;
|
|
361
|
+
readonly callId: Model$1.optionalOption<Schema.String>;
|
|
362
|
+
readonly toolName: Model$1.optionalOption<Schema.String>;
|
|
363
|
+
readonly data: Schema.String;
|
|
364
|
+
}>;
|
|
365
|
+
readonly jsonCreate: Schema.Struct<{
|
|
366
|
+
readonly id: Schema.String;
|
|
367
|
+
readonly entryId: Schema.String;
|
|
368
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
369
|
+
readonly partIndex: Schema.Int;
|
|
370
|
+
readonly type: Schema.Literals<readonly ["text", "image", "thinking", "toolCall"]>;
|
|
371
|
+
readonly status: Model$1.optionalOption<Schema.Literals<readonly ["pending", "running", "completed", "error", "skipped", "aborted"]>>;
|
|
372
|
+
readonly callId: Model$1.optionalOption<Schema.String>;
|
|
373
|
+
readonly toolName: Model$1.optionalOption<Schema.String>;
|
|
374
|
+
readonly data: Schema.String;
|
|
375
|
+
}>;
|
|
376
|
+
readonly jsonUpdate: Schema.Struct<{
|
|
377
|
+
readonly id: Schema.String;
|
|
378
|
+
readonly entryId: Schema.String;
|
|
379
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
380
|
+
readonly partIndex: Schema.Int;
|
|
381
|
+
readonly type: Schema.Literals<readonly ["text", "image", "thinking", "toolCall"]>;
|
|
382
|
+
readonly status: Model$1.optionalOption<Schema.Literals<readonly ["pending", "running", "completed", "error", "skipped", "aborted"]>>;
|
|
383
|
+
readonly callId: Model$1.optionalOption<Schema.String>;
|
|
384
|
+
readonly toolName: Model$1.optionalOption<Schema.String>;
|
|
385
|
+
readonly data: Schema.String;
|
|
386
|
+
}>;
|
|
387
|
+
readonly select: Schema.Struct<{
|
|
388
|
+
readonly createdAt: Schema.DateTimeUtcFromMillis;
|
|
389
|
+
readonly updatedAt: Schema.DateTimeUtcFromMillis;
|
|
390
|
+
readonly id: Schema.String;
|
|
391
|
+
readonly entryId: Schema.String;
|
|
392
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
393
|
+
readonly partIndex: Schema.Int;
|
|
394
|
+
readonly type: Schema.Literals<readonly ["text", "image", "thinking", "toolCall"]>;
|
|
395
|
+
readonly status: Schema.OptionFromNullOr<Schema.Literals<readonly ["pending", "running", "completed", "error", "skipped", "aborted"]>>;
|
|
396
|
+
readonly callId: Schema.OptionFromNullOr<Schema.String>;
|
|
397
|
+
readonly toolName: Schema.OptionFromNullOr<Schema.String>;
|
|
398
|
+
readonly data: Schema.String;
|
|
399
|
+
}>;
|
|
400
|
+
readonly update: Schema.Struct<{
|
|
401
|
+
readonly updatedAt: import("effect/unstable/schema/VariantSchema").Overrideable<Schema.DateTimeUtcFromMillis>;
|
|
402
|
+
readonly id: Schema.String;
|
|
403
|
+
readonly entryId: Schema.String;
|
|
404
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID">;
|
|
405
|
+
readonly partIndex: Schema.Int;
|
|
406
|
+
readonly type: Schema.Literals<readonly ["text", "image", "thinking", "toolCall"]>;
|
|
407
|
+
readonly status: Schema.OptionFromNullOr<Schema.Literals<readonly ["pending", "running", "completed", "error", "skipped", "aborted"]>>;
|
|
408
|
+
readonly callId: Schema.OptionFromNullOr<Schema.String>;
|
|
409
|
+
readonly toolName: Schema.OptionFromNullOr<Schema.String>;
|
|
410
|
+
readonly data: Schema.String;
|
|
411
|
+
}>;
|
|
412
|
+
};
|
|
413
|
+
declare class SessionEntryPartRow extends SessionEntryPartRow_base {}
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/event/schema.d.ts
|
|
416
|
+
declare const ID$3: Schema.brand<Schema.String, "Event.ID"> & {
|
|
417
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
418
|
+
};
|
|
419
|
+
type ID$3 = typeof ID$3.Type;
|
|
420
|
+
type Definition$1<Type extends string = string, DataSchema extends Schema.Codec<unknown, unknown> = Schema.Codec<unknown, unknown>> = Schema.Top & {
|
|
421
|
+
readonly type: Type;
|
|
422
|
+
readonly durable?: {
|
|
423
|
+
readonly version: number;
|
|
424
|
+
readonly aggregate: string;
|
|
425
|
+
};
|
|
426
|
+
readonly data: DataSchema;
|
|
427
|
+
};
|
|
428
|
+
type Data<D extends Definition$1> = Schema.Schema.Type<D["data"]>;
|
|
429
|
+
type Payload<D extends Definition$1 = Definition$1> = {
|
|
430
|
+
readonly id: ID$3;
|
|
431
|
+
readonly type: D["type"];
|
|
432
|
+
readonly data: Data<D>;
|
|
433
|
+
readonly durable?: {
|
|
434
|
+
readonly aggregateId: string;
|
|
435
|
+
readonly seq: number;
|
|
436
|
+
readonly version: number;
|
|
437
|
+
};
|
|
438
|
+
readonly metadata?: Record<string, string>;
|
|
439
|
+
};
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/event/event.d.ts
|
|
442
|
+
type Subscriber<D extends Definition$1 = Definition$1> = (event: Payload<D>) => Effect.Effect<void>;
|
|
443
|
+
type Unsubscribe = Effect.Effect<void>;
|
|
444
|
+
/**
|
|
445
|
+
* A durable read manifest: the definitions whose stored rows are in scope, keyed
|
|
446
|
+
* by versioned type, plus the decoder those rows are decoded through. `schema`
|
|
447
|
+
* is the tagged union of the same definitions, so it validates the whole
|
|
448
|
+
* envelope (id/type/durable/data), not just the payload.
|
|
449
|
+
*/
|
|
450
|
+
type Manifest<A> = {
|
|
451
|
+
readonly definitions: ReadonlyMap<string, Definition$1>;
|
|
452
|
+
readonly schema: Schema.Decoder<A, never>;
|
|
453
|
+
};
|
|
454
|
+
type ReadAggregateInput<A> = {
|
|
455
|
+
readonly aggregateId: string;
|
|
456
|
+
/** Exclusive lower bound. Omitted reads from the first stored sequence (0). */
|
|
457
|
+
readonly after?: number;
|
|
458
|
+
readonly limit: number;
|
|
459
|
+
readonly manifest: Manifest<A>;
|
|
460
|
+
};
|
|
461
|
+
type ReadAggregateResult<A> = {
|
|
462
|
+
readonly events: ReadonlyArray<A>;
|
|
463
|
+
readonly hasMore: boolean;
|
|
464
|
+
};
|
|
465
|
+
interface PublishOptions {
|
|
466
|
+
/** Caller-supplied event ID. Publishing the same ID twice is a defect, not an upsert. */
|
|
467
|
+
readonly id?: ID$3;
|
|
468
|
+
/**
|
|
469
|
+
* Publish-time context — correlation, tracing — carried to projectors on the
|
|
470
|
+
* in-memory payload and deliberately not stored in the event row. A projector
|
|
471
|
+
* persists it into its own projection if it means something there; the log
|
|
472
|
+
* records what happened, not who asked. It therefore does not survive a
|
|
473
|
+
* durable reread or a rebuild, which `event.test.ts` pins explicitly.
|
|
474
|
+
*/
|
|
475
|
+
readonly metadata?: Record<string, string>;
|
|
476
|
+
}
|
|
477
|
+
interface Interface$11 {
|
|
478
|
+
readonly latestSequence: (aggregateId: string) => Effect.Effect<number>;
|
|
479
|
+
readonly readAggregate: <A>(input: ReadAggregateInput<A>) => Effect.Effect<ReadAggregateResult<A>>;
|
|
480
|
+
/**
|
|
481
|
+
* Appends one event. Durable definitions are assigned the aggregate's next
|
|
482
|
+
* sequence, projected, and stored in a single transaction; the returned
|
|
483
|
+
* payload carries that sequence in `durable`.
|
|
484
|
+
*/
|
|
485
|
+
readonly publish: <D extends Definition$1>(definition: D, data: Data<D>, options?: PublishOptions) => Effect.Effect<Payload<D>>;
|
|
486
|
+
/**
|
|
487
|
+
* Registers a projector for one event type. Projectors run inside the commit
|
|
488
|
+
* transaction, so a failing projector rolls the event back with it.
|
|
489
|
+
*/
|
|
490
|
+
readonly project: <D extends Definition$1>(definition: D, projector: Subscriber<D>) => Effect.Effect<void>;
|
|
491
|
+
/**
|
|
492
|
+
* Live stream of one event type.
|
|
493
|
+
*
|
|
494
|
+
* This is the only way to read a non-durable definition -- stream deltas and
|
|
495
|
+
* block boundaries. They never reach a projector: projectors run inside the
|
|
496
|
+
* commit, and a live event has no commit, so registering one for a live type
|
|
497
|
+
* compiles and silently never fires.
|
|
498
|
+
*/
|
|
499
|
+
readonly subscribe: <D extends Definition$1>(definition: D) => Stream.Stream<Payload<D>>;
|
|
500
|
+
/** Every event, durable and live alike, in publish order. */
|
|
501
|
+
readonly all: () => Stream.Stream<Payload>;
|
|
502
|
+
/** Durable catch-up followed by the process-local event tail for one session. */
|
|
503
|
+
readonly stream: (input: {
|
|
504
|
+
readonly sessionId: string;
|
|
505
|
+
readonly after?: number;
|
|
506
|
+
}) => Stream.Stream<Payload>;
|
|
507
|
+
/**
|
|
508
|
+
* Callback form of {@link all}, returning its own removal. A listener runs
|
|
509
|
+
* after the commit for a durable event, and its failures are logged rather
|
|
510
|
+
* than surfaced -- the event already happened, so a watcher cannot undo it.
|
|
511
|
+
*/
|
|
512
|
+
readonly listen: (listener: Subscriber) => Effect.Effect<Unsubscribe>;
|
|
513
|
+
/**
|
|
514
|
+
* Moves an aggregate's head to at least `seq`, so the next published event
|
|
515
|
+
* lands above it. Two callers need this: a fork, reserving [0..seq] for
|
|
516
|
+
* copied entries, and any write that takes a position without going through
|
|
517
|
+
* an event -- otherwise the head still points below state that already
|
|
518
|
+
* exists, and the next event collides with it.
|
|
519
|
+
*
|
|
520
|
+
* A sequence is a version position, not a row count, so declaring an
|
|
521
|
+
* aggregate "already at version N" is legal. Never rewinds: a lower `seq`
|
|
522
|
+
* than the current head is a no-op.
|
|
523
|
+
*/
|
|
524
|
+
readonly advance: (aggregateId: string, seq: number) => Effect.Effect<void>;
|
|
525
|
+
}
|
|
526
|
+
declare const Service_base$10: Context.ServiceClass<Service$10, "@codeworksh/harness/event/event/Service", Interface$11>;
|
|
527
|
+
declare class Service$10 extends Service_base$10 {}
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/sandbox/errors.d.ts
|
|
530
|
+
declare const SandboxNotFoundError_base: Schema.Class<SandboxNotFoundError, Schema.TaggedStruct<"SandboxNotFoundError", {
|
|
531
|
+
readonly id: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
532
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
533
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
534
|
+
};
|
|
535
|
+
}>, import("effect/Cause").YieldableError>;
|
|
536
|
+
/**
|
|
537
|
+
* Lifecycle errors are confined to the control plane. Once a mount succeeds,
|
|
538
|
+
* consumers continue to see only FileSystemError and ShellError.
|
|
539
|
+
*/
|
|
540
|
+
declare class SandboxNotFoundError extends SandboxNotFoundError_base {}
|
|
541
|
+
declare const SandboxDriverNotRegisteredError_base: Schema.Class<SandboxDriverNotRegisteredError, Schema.TaggedStruct<"SandboxDriverNotRegisteredError", {
|
|
542
|
+
readonly driver: Schema.String;
|
|
543
|
+
}>, import("effect/Cause").YieldableError>;
|
|
544
|
+
declare class SandboxDriverNotRegisteredError extends SandboxDriverNotRegisteredError_base {}
|
|
545
|
+
declare const SandboxDriverRegistrationError_base: Schema.Class<SandboxDriverRegistrationError, Schema.TaggedStruct<"SandboxDriverRegistrationError", {
|
|
546
|
+
readonly driver: Schema.String;
|
|
547
|
+
readonly reason: Schema.String;
|
|
548
|
+
}>, import("effect/Cause").YieldableError>;
|
|
549
|
+
declare class SandboxDriverRegistrationError extends SandboxDriverRegistrationError_base {}
|
|
550
|
+
declare const SandboxBusyError_base: Schema.Class<SandboxBusyError, Schema.TaggedStruct<"SandboxBusyError", {
|
|
551
|
+
readonly id: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
552
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
553
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
554
|
+
};
|
|
555
|
+
readonly refCount: Schema.Int;
|
|
556
|
+
}>, import("effect/Cause").YieldableError>;
|
|
557
|
+
declare class SandboxBusyError extends SandboxBusyError_base {}
|
|
558
|
+
declare const SandboxMustBeStoppedError_base: Schema.Class<SandboxMustBeStoppedError, Schema.TaggedStruct<"SandboxMustBeStoppedError", {
|
|
559
|
+
readonly id: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
560
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
561
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
562
|
+
};
|
|
563
|
+
readonly status: Schema.Literals<readonly ["provisioning", "online", "offline", "suspending", "removing", "removed", "unavail", "faulted"]>;
|
|
564
|
+
}>, import("effect/Cause").YieldableError>;
|
|
565
|
+
declare class SandboxMustBeStoppedError extends SandboxMustBeStoppedError_base {}
|
|
566
|
+
declare const SandboxRemovedError_base: Schema.Class<SandboxRemovedError, Schema.TaggedStruct<"SandboxRemovedError", {
|
|
567
|
+
readonly id: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
568
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
569
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
570
|
+
};
|
|
571
|
+
readonly removedAt: Schema.optional<Schema.DateTimeUtc>;
|
|
572
|
+
}>, import("effect/Cause").YieldableError>;
|
|
573
|
+
declare class SandboxRemovedError extends SandboxRemovedError_base {}
|
|
574
|
+
declare const SandboxUnavailError_base: Schema.Class<SandboxUnavailError, Schema.TaggedStruct<"SandboxUnavailError", {
|
|
575
|
+
readonly id: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
576
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
577
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
578
|
+
};
|
|
579
|
+
readonly reason: Schema.String;
|
|
580
|
+
}>, import("effect/Cause").YieldableError>;
|
|
581
|
+
declare class SandboxUnavailError extends SandboxUnavailError_base {}
|
|
582
|
+
declare const SandboxUnsupportedError_base: Schema.Class<SandboxUnsupportedError, Schema.TaggedStruct<"SandboxUnsupportedError", {
|
|
583
|
+
readonly id: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
584
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
585
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
586
|
+
};
|
|
587
|
+
readonly driver: Schema.String;
|
|
588
|
+
readonly operation: Schema.String;
|
|
589
|
+
}>, import("effect/Cause").YieldableError>;
|
|
590
|
+
declare class SandboxUnsupportedError extends SandboxUnsupportedError_base {}
|
|
591
|
+
declare const SandboxTransitionConflictError_base: Schema.Class<SandboxTransitionConflictError, Schema.TaggedStruct<"SandboxTransitionConflictError", {
|
|
592
|
+
readonly id: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
593
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
594
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
595
|
+
};
|
|
596
|
+
readonly expected: Schema.$Array<Schema.Literals<readonly ["provisioning", "online", "offline", "suspending", "removing", "removed", "unavail", "faulted"]>>;
|
|
597
|
+
readonly actual: Schema.Literals<readonly ["provisioning", "online", "offline", "suspending", "removing", "removed", "unavail", "faulted"]>;
|
|
598
|
+
}>, import("effect/Cause").YieldableError>;
|
|
599
|
+
declare class SandboxTransitionConflictError extends SandboxTransitionConflictError_base {}
|
|
600
|
+
declare const SandboxProviderError_base: Schema.Class<SandboxProviderError, Schema.TaggedStruct<"SandboxProviderError", {
|
|
601
|
+
readonly driver: Schema.String;
|
|
602
|
+
readonly operation: Schema.String;
|
|
603
|
+
readonly sanitized: Schema.Struct<{
|
|
604
|
+
readonly name: Schema.String;
|
|
605
|
+
readonly message: Schema.String;
|
|
606
|
+
readonly code: Schema.optional<Schema.String>;
|
|
607
|
+
}>;
|
|
608
|
+
}>, import("effect/Cause").YieldableError>;
|
|
609
|
+
/**
|
|
610
|
+
* A lifecycle failure safe to serialize, persist, or log.
|
|
611
|
+
*
|
|
612
|
+
* The raw SDK defect is deliberately absent from the schema. It is retained on
|
|
613
|
+
* a non-enumerable symbol by {@link providerError}, so Effect's default
|
|
614
|
+
* formatting and JSON serialization cannot expose credentials nested in it.
|
|
615
|
+
*/
|
|
616
|
+
declare class SandboxProviderError extends SandboxProviderError_base {}
|
|
617
|
+
type SandboxMountError = SandboxNotFoundError | SandboxDriverNotRegisteredError | SandboxUnavailError | SandboxRemovedError | SandboxProviderError;
|
|
618
|
+
type SandboxCreateError = SandboxDriverNotRegisteredError | SandboxDriverRegistrationError | SandboxProviderError;
|
|
619
|
+
type SandboxRegisterError = SandboxDriverNotRegisteredError | SandboxDriverRegistrationError | SandboxProviderError;
|
|
620
|
+
type SandboxReadError = never;
|
|
621
|
+
type SandboxRefreshError = SandboxNotFoundError | SandboxDriverNotRegisteredError | SandboxUnavailError | SandboxUnsupportedError | SandboxProviderError;
|
|
622
|
+
type SandboxWakeError = SandboxRefreshError | SandboxRemovedError;
|
|
623
|
+
type SandboxStopError = SandboxWakeError | SandboxBusyError | SandboxTransitionConflictError;
|
|
624
|
+
type SandboxDestroyError = SandboxStopError | SandboxMustBeStoppedError;
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region src/sandbox/fs/filesystem.d.ts
|
|
627
|
+
declare const OperationUnsupportedError_base: Schema.Class<OperationUnsupportedError, Schema.TaggedStruct<"OperationUnsupportedError", {
|
|
628
|
+
readonly operation: Schema.String;
|
|
629
|
+
readonly message: Schema.String;
|
|
630
|
+
}>, import("effect/Cause").YieldableError>;
|
|
631
|
+
/**
|
|
632
|
+
* The runtime filesystem contract, independent of any backend.
|
|
633
|
+
*
|
|
634
|
+
* Two surfaces, deliberately:
|
|
635
|
+
* - {@link Provider} is what a backend implements — plain promises that reject,
|
|
636
|
+
* matching every SDK we wrap.
|
|
637
|
+
* - {@link Interface} is what the harness consumes — Effect with a typed error
|
|
638
|
+
* channel and tracing spans. {@link fromProvider} bridges the two exactly
|
|
639
|
+
* once, so no consumer ever writes `Effect.tryPromise` against a filesystem.
|
|
640
|
+
*
|
|
641
|
+
* Implementations:
|
|
642
|
+
* - Local:
|
|
643
|
+
* implement it over a VFS (`./local`);
|
|
644
|
+
* local filesystem use OS primitives; hence have broader filesytem capabilities.
|
|
645
|
+
*
|
|
646
|
+
* - Remote:
|
|
647
|
+
* implement it over a provider (`./remote`).
|
|
648
|
+
* remote filesytems depends on the interface provided by the remote provider; hence can have limited filesytem capabilities.
|
|
649
|
+
*
|
|
650
|
+
* `isFile`/`isDirectory` are required booleans; size, mtime, and isSymbolicLink are omitted when the
|
|
651
|
+
* backend cannot report them — never fabricated.
|
|
652
|
+
*
|
|
653
|
+
* **Paths are POSIX, and the harness is Unix-only (for now!).** Every path uses `/`
|
|
654
|
+
* separators on both the host and inside a sandbox — Windows is not supported,
|
|
655
|
+
* so no translation layer exists. Consumers must use the shared Effect POSIX
|
|
656
|
+
* path implementation, never the platform default, or a host running the harness would
|
|
657
|
+
* impose its own flavour on a remote sandbox's paths. Relative paths resolve
|
|
658
|
+
* against the backend's configured `cwd`.
|
|
659
|
+
*/
|
|
660
|
+
declare class OperationUnsupportedError extends OperationUnsupportedError_base {}
|
|
661
|
+
declare const FileSystemError_base: Schema.Class<FileSystemError, Schema.TaggedStruct<"SandboxFileSystemError", {
|
|
662
|
+
readonly method: Schema.String;
|
|
663
|
+
readonly path: Schema.String;
|
|
664
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
665
|
+
}>, import("effect/Cause").YieldableError>;
|
|
666
|
+
/** A backend operation failed. `cause` carries the provider's own rejection. */
|
|
667
|
+
declare class FileSystemError extends FileSystemError_base {}
|
|
668
|
+
interface FileStat {
|
|
669
|
+
readonly isFile: boolean;
|
|
670
|
+
readonly isDirectory: boolean;
|
|
671
|
+
readonly isSymbolicLink?: boolean;
|
|
672
|
+
readonly size?: number;
|
|
673
|
+
readonly mtime?: Date;
|
|
674
|
+
}
|
|
675
|
+
interface RmOptions {
|
|
676
|
+
readonly recursive?: boolean;
|
|
677
|
+
readonly force?: boolean;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* The consumer-facing contract. `exists` distinguishes "absent" from "could not
|
|
681
|
+
* tell": a backend failure is a typed failure, not `false`, so a caller acting
|
|
682
|
+
* on absence never acts on a network blip. Use `SandboxFs.existsOrFalse` where
|
|
683
|
+
* a best-effort answer really is wanted.
|
|
684
|
+
*/
|
|
685
|
+
interface Interface$10 {
|
|
686
|
+
readonly readFile: (path: string) => Effect.Effect<string, FileSystemError>;
|
|
687
|
+
readonly readFileBuffer: (path: string) => Effect.Effect<Uint8Array, FileSystemError>;
|
|
688
|
+
/** Creates missing parent directories, on every backend. */
|
|
689
|
+
readonly writeFile: (path: string, content: string | Uint8Array) => Effect.Effect<void, FileSystemError>;
|
|
690
|
+
readonly stat: (path: string) => Effect.Effect<FileStat, FileSystemError>;
|
|
691
|
+
readonly readdir: (path: string) => Effect.Effect<string[], FileSystemError>;
|
|
692
|
+
readonly exists: (path: string) => Effect.Effect<boolean, FileSystemError>;
|
|
693
|
+
readonly mkdir: (path: string, options?: {
|
|
694
|
+
recursive?: boolean;
|
|
695
|
+
}) => Effect.Effect<void, FileSystemError>;
|
|
696
|
+
readonly rm: (path: string, options?: RmOptions) => Effect.Effect<void, FileSystemError | OperationUnsupportedError>;
|
|
697
|
+
readonly lstat?: (path: string) => Effect.Effect<FileStat, FileSystemError>;
|
|
698
|
+
}
|
|
699
|
+
declare const Service_base$9: Context.ServiceClass<Service$9, "@codeworksh/harness/sandbox/fs/filesystem/Service", Interface$10>;
|
|
700
|
+
/** The runtime filesystem service — the live {@link Interface} for the active sandbox. */
|
|
701
|
+
declare class Service$9 extends Service_base$9 {}
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region src/sandbox/shell/shell.d.ts
|
|
704
|
+
declare const ShellError_base: Schema.Class<ShellError, Schema.TaggedStruct<"ShellError", {
|
|
705
|
+
readonly command: Schema.String;
|
|
706
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
707
|
+
}>, import("effect/Cause").YieldableError>;
|
|
708
|
+
/**
|
|
709
|
+
* The pluggable execution contract. Local sandboxes usually get a Shell through
|
|
710
|
+
* just-bash over the local `Local.Vfs`; remote sandboxes provide their own
|
|
711
|
+
* native Shell. Either way the rest of the harness depends only on this service
|
|
712
|
+
* tag.
|
|
713
|
+
*/
|
|
714
|
+
declare class ShellError extends ShellError_base {}
|
|
715
|
+
interface ExecResult {
|
|
716
|
+
readonly stdout: string;
|
|
717
|
+
readonly stderr: string;
|
|
718
|
+
readonly exitCode: number;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* One options shape for every entry point. `cwd` is the operation-level
|
|
722
|
+
* override: it wins over the mount's working directory, and a relative value
|
|
723
|
+
* resolves against it. Neither mutates shared state, so concurrent commands in
|
|
724
|
+
* one mount can run in different directories.
|
|
725
|
+
*/
|
|
726
|
+
interface ShellOptions {
|
|
727
|
+
readonly env?: Record<string, string>;
|
|
728
|
+
readonly cwd?: string;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* A streamed chunk of command output, terminated by a single `exit` carrying the
|
|
732
|
+
* exit code. (A backend-level mirror of the tool layer's event; kept here so
|
|
733
|
+
* `sandbox/` does not depend on `tools/`.)
|
|
734
|
+
*/
|
|
735
|
+
type ExecChunk = {
|
|
736
|
+
readonly _tag: "stdout";
|
|
737
|
+
readonly bytes: Uint8Array;
|
|
738
|
+
} | {
|
|
739
|
+
readonly _tag: "stderr";
|
|
740
|
+
readonly bytes: Uint8Array;
|
|
741
|
+
} | {
|
|
742
|
+
readonly _tag: "exit";
|
|
743
|
+
readonly exitCode: number;
|
|
744
|
+
};
|
|
745
|
+
/**
|
|
746
|
+
* The command-execution capability a sandbox exposes. For an in-process
|
|
747
|
+
* backend this is just-bash; for a remote backend it is the sandbox's own
|
|
748
|
+
* shell. The {@link Shell} service tag carries this interface.
|
|
749
|
+
*/
|
|
750
|
+
interface ISandboxExe {
|
|
751
|
+
readonly exec: (command: string, options?: ShellOptions) => Effect.Effect<ExecResult, ShellError>;
|
|
752
|
+
/**
|
|
753
|
+
* Run a program with an explicit argument vector, bypassing shell word
|
|
754
|
+
* splitting. Callers that build commands from untrusted values — branch
|
|
755
|
+
* names, file paths — must use this instead of interpolating into
|
|
756
|
+
* {@link exec}, where a space or `$(…)` would change what runs.
|
|
757
|
+
*
|
|
758
|
+
* Backends whose transport only accepts a string quote the vector with
|
|
759
|
+
* {@link quote}; backends that spawn directly pass it through untouched.
|
|
760
|
+
*/
|
|
761
|
+
readonly execArgv: (argv: ReadonlyArray<string>, options?: ShellOptions) => Effect.Effect<ExecResult, ShellError>;
|
|
762
|
+
/**
|
|
763
|
+
* Optional streaming output: stdout/stderr chunks then a terminal `exit`.
|
|
764
|
+
* Backends that can stream (e.g. Vercel) implement it; `ToolShell.fromSandboxShell`
|
|
765
|
+
* bridges it to `ToolShell.stream` so the bash tool streams over them too.
|
|
766
|
+
*/
|
|
767
|
+
readonly stream?: (command: string, options?: ShellOptions) => Stream.Stream<ExecChunk, ShellError>;
|
|
768
|
+
}
|
|
769
|
+
declare const Shell_base: Context.ServiceClass<Shell$1, "@codeworksh/harness/sandbox/shell/shell", ISandboxExe>;
|
|
770
|
+
/** Execution service — the live {@link ISandboxExe} for the active sandbox. */
|
|
771
|
+
declare class Shell$1 extends Shell_base {}
|
|
772
|
+
//#endregion
|
|
773
|
+
//#region src/sandbox/io.d.ts
|
|
774
|
+
/**
|
|
775
|
+
* `SandboxIO` is a **mount**: a filesystem, a shell, and the identity and
|
|
776
|
+
* working directory they act on.
|
|
777
|
+
*
|
|
778
|
+
* It is the whole vocabulary a consumer needs. Project, Git, Copy, Location, and
|
|
779
|
+
* every tool ask for `SandboxIO.FileSystem`, `SandboxIO.Shell`, and
|
|
780
|
+
* `SandboxIO.Current` — never for a driver, an address, or a provider SDK — so
|
|
781
|
+
* a host directory, an in-memory VFS, and a remote microVM are interchangeable
|
|
782
|
+
* behind one contract.
|
|
783
|
+
*
|
|
784
|
+
* The mount neither creates nor destroys infrastructure. `SandboxInstance` is
|
|
785
|
+
* the durable namespace it acts on — a device, which exists whether or not
|
|
786
|
+
* anything has it mounted — and `Sandbox.Controller` is the only path that
|
|
787
|
+
* creates, stops, or destroys one.
|
|
788
|
+
*/
|
|
789
|
+
/**
|
|
790
|
+
* The filesystem tag. Re-exported here so consumers import one namespace —
|
|
791
|
+
* Project, Git, Copy, and the runner ask for `SandboxIO.FileSystem`, never for
|
|
792
|
+
* the module that happens to define it. Code *inside* `sandbox/` keeps importing
|
|
793
|
+
* the tag directly, since `io.ts` is built on top of it.
|
|
794
|
+
*/
|
|
795
|
+
declare const FileSystem$1: typeof Service$9;
|
|
796
|
+
type FileSystem$1 = Service$9;
|
|
797
|
+
/** The shell tag. Re-exported here so consumers import one namespace. */
|
|
798
|
+
declare const Shell: typeof Shell$1;
|
|
799
|
+
type Shell = Shell$1;
|
|
800
|
+
/**
|
|
801
|
+
* What a mount sees: immutable identity, plus the working directory resolved for
|
|
802
|
+
* *this* mount.
|
|
803
|
+
*
|
|
804
|
+
* Nothing mutable belongs here. `status`, `usage`, and reference counts all
|
|
805
|
+
* change while a mount is open, so a mount-time snapshot of them would be wrong
|
|
806
|
+
* by construction — runtime code that needs live management state asks the
|
|
807
|
+
* control plane. The driver's own resource locator is likewise absent: consumers
|
|
808
|
+
* never parse a Vercel name or a Daytona id.
|
|
809
|
+
*/
|
|
810
|
+
interface Identity {
|
|
811
|
+
readonly id: ID$2;
|
|
812
|
+
readonly driver: Name;
|
|
813
|
+
readonly kind: Kind;
|
|
814
|
+
/** Absolute, and always a path in *this* namespace. */
|
|
815
|
+
readonly cwd: string;
|
|
816
|
+
}
|
|
817
|
+
declare const Current_base: Context.ServiceClass<Current, "@codeworksh/harness/sandbox/io/Current", Identity>;
|
|
818
|
+
/** Identity and working directory of the current mount. */
|
|
819
|
+
declare class Current extends Current_base {}
|
|
820
|
+
/** Everything a mount provides. */
|
|
821
|
+
type Provides = Current | Service$9 | Shell$1;
|
|
822
|
+
/** A built mount. */
|
|
823
|
+
type Layer$1<E = never, RIn = never> = Layer.Layer<Provides, E, RIn>;
|
|
824
|
+
//#endregion
|
|
825
|
+
//#region src/sandbox/driver.d.ts
|
|
826
|
+
/** Open driver identity. Adding a driver never extends a union in core. */
|
|
827
|
+
declare const Name: Schema.brand<Schema.String, "SandboxDriver.Name">;
|
|
828
|
+
type Name = typeof Name.Type;
|
|
829
|
+
/** A path whose coordinate system is the mounted namespace. */
|
|
830
|
+
declare const AbsolutePath$1: Schema.brand<Schema.String, "SandboxDriver.AbsolutePath">;
|
|
831
|
+
type AbsolutePath$1 = typeof AbsolutePath$1.Type;
|
|
832
|
+
declare const RuntimeConfigBase: Schema.Struct<{
|
|
833
|
+
readonly defaultCwd: Schema.brand<Schema.String, "SandboxDriver.AbsolutePath">;
|
|
834
|
+
}>;
|
|
835
|
+
interface RuntimeConfigBase extends Schema.Schema.Type<typeof RuntimeConfigBase> {}
|
|
836
|
+
interface Capabilities {
|
|
837
|
+
readonly reattach: boolean;
|
|
838
|
+
readonly wake: boolean;
|
|
839
|
+
readonly stop: boolean;
|
|
840
|
+
readonly destroy: boolean;
|
|
841
|
+
readonly cancels: boolean;
|
|
842
|
+
}
|
|
843
|
+
interface Observed {
|
|
844
|
+
readonly status: Status;
|
|
845
|
+
readonly providerStatus?: string | undefined;
|
|
846
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
847
|
+
}
|
|
848
|
+
interface Provisioned<RuntimeConfig extends RuntimeConfigBase> {
|
|
849
|
+
readonly providerResourceId?: string | undefined;
|
|
850
|
+
readonly providerStatus?: string | undefined;
|
|
851
|
+
readonly runtimeConfig: RuntimeConfig;
|
|
852
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
853
|
+
}
|
|
854
|
+
interface RuntimeInput$1<RuntimeConfig extends RuntimeConfigBase> {
|
|
855
|
+
readonly id: ID$2;
|
|
856
|
+
readonly providerResourceId: Option.Option<string>;
|
|
857
|
+
readonly runtimeConfig: RuntimeConfig;
|
|
858
|
+
}
|
|
859
|
+
interface Driver$1<CreateConfig, RuntimeConfig extends RuntimeConfigBase> {
|
|
860
|
+
readonly name: Name;
|
|
861
|
+
readonly kind: Kind;
|
|
862
|
+
readonly capabilities: Capabilities;
|
|
863
|
+
readonly createConfigCodec: Schema.Codec<CreateConfig, unknown>;
|
|
864
|
+
readonly runtimeConfigCodec: Schema.Codec<RuntimeConfig, unknown>;
|
|
865
|
+
readonly create: (input: {
|
|
866
|
+
readonly instanceId: ID$2;
|
|
867
|
+
readonly config: CreateConfig;
|
|
868
|
+
}) => Effect.Effect<Provisioned<RuntimeConfig>, SandboxProviderError>;
|
|
869
|
+
readonly runtimeConfigFor: (input: {
|
|
870
|
+
readonly providerResourceId: string;
|
|
871
|
+
readonly overrides?: Partial<RuntimeConfig> | undefined;
|
|
872
|
+
}) => Effect.Effect<RuntimeConfig, SandboxProviderError>;
|
|
873
|
+
readonly attach: (input: RuntimeInput$1<RuntimeConfig>) => Layer.Layer<FileSystem$1 | Shell, SandboxProviderError>;
|
|
874
|
+
readonly inspect?: (input: RuntimeInput$1<RuntimeConfig>) => Effect.Effect<Observed, SandboxProviderError>;
|
|
875
|
+
readonly wake?: (input: RuntimeInput$1<RuntimeConfig>) => Effect.Effect<Observed, SandboxProviderError>;
|
|
876
|
+
readonly stop?: (input: RuntimeInput$1<RuntimeConfig>) => Effect.Effect<Observed, SandboxProviderError>;
|
|
877
|
+
readonly destroy?: (input: RuntimeInput$1<RuntimeConfig>) => Effect.Effect<void, SandboxProviderError>;
|
|
878
|
+
}
|
|
879
|
+
type Definition<CreateConfig, RuntimeConfig extends RuntimeConfigBase> = Pick<Driver$1<CreateConfig, RuntimeConfig>, "name" | "createConfigCodec" | "runtimeConfigCodec">;
|
|
880
|
+
/**
|
|
881
|
+
* The registry's type-erased shape. Erasure happens once at registration;
|
|
882
|
+
* untrusted values still cross the registered driver's codecs before reaching
|
|
883
|
+
* its typed implementation.
|
|
884
|
+
*/
|
|
885
|
+
interface Registered {
|
|
886
|
+
readonly name: Name;
|
|
887
|
+
readonly kind: Kind;
|
|
888
|
+
readonly capabilities: Capabilities;
|
|
889
|
+
readonly createConfigCodec: Schema.Codec<unknown, unknown>;
|
|
890
|
+
readonly runtimeConfigCodec: Schema.Codec<RuntimeConfigBase, unknown>;
|
|
891
|
+
readonly create: (input: {
|
|
892
|
+
readonly instanceId: ID$2;
|
|
893
|
+
readonly config: unknown;
|
|
894
|
+
}) => Effect.Effect<Provisioned<RuntimeConfigBase>, SandboxProviderError>;
|
|
895
|
+
readonly runtimeConfigFor: (input: {
|
|
896
|
+
readonly providerResourceId: string;
|
|
897
|
+
readonly overrides?: Readonly<Record<string, unknown>> | undefined;
|
|
898
|
+
}) => Effect.Effect<RuntimeConfigBase, SandboxProviderError>;
|
|
899
|
+
readonly attach: (input: RuntimeInput$1<RuntimeConfigBase>) => Layer.Layer<FileSystem$1 | Shell, SandboxProviderError>;
|
|
900
|
+
readonly inspect?: (input: RuntimeInput$1<RuntimeConfigBase>) => Effect.Effect<Observed, SandboxProviderError>;
|
|
901
|
+
readonly wake?: (input: RuntimeInput$1<RuntimeConfigBase>) => Effect.Effect<Observed, SandboxProviderError>;
|
|
902
|
+
readonly stop?: (input: RuntimeInput$1<RuntimeConfigBase>) => Effect.Effect<Observed, SandboxProviderError>;
|
|
903
|
+
readonly destroy?: (input: RuntimeInput$1<RuntimeConfigBase>) => Effect.Effect<void, SandboxProviderError>;
|
|
904
|
+
}
|
|
905
|
+
interface RegistryService {
|
|
906
|
+
readonly names: ReadonlySet<Name>;
|
|
907
|
+
readonly find: (name: Name) => Option.Option<Registered>;
|
|
908
|
+
readonly get: (name: Name) => Effect.Effect<Registered, SandboxDriverNotRegisteredError>;
|
|
909
|
+
readonly decodeCreateConfig: (name: Name, input: unknown) => Effect.Effect<unknown, SandboxDriverNotRegisteredError | SandboxDriverRegistrationError>;
|
|
910
|
+
readonly decodeRuntimeConfig: (name: Name, input: unknown) => Effect.Effect<RuntimeConfigBase, SandboxDriverNotRegisteredError | SandboxDriverRegistrationError>;
|
|
911
|
+
readonly encodeRuntimeConfig: (name: Name, input: RuntimeConfigBase) => Effect.Effect<unknown, SandboxDriverNotRegisteredError | SandboxDriverRegistrationError>;
|
|
912
|
+
}
|
|
913
|
+
declare const Registry_base: Context.ServiceClass<Registry, "@codeworksh/harness/sandbox/driver/Registry", RegistryService>;
|
|
914
|
+
declare class Registry extends Registry_base {}
|
|
915
|
+
interface Registration {
|
|
916
|
+
readonly registered: Registered;
|
|
917
|
+
}
|
|
918
|
+
declare namespace instance_d_exports {
|
|
919
|
+
export { ID$2 as ID, Info$3 as Info, Kind, Ownership, PersistedError, instance_d_exports as SandboxInstance, Status, Usage$1 as Usage, fromColumn, fromField, isMountable, mountable, toColumn, toField };
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* A Sandbox instance is a **durable filesystem namespace** plus whatever compute
|
|
923
|
+
* acts on it — a device in Unix terms, which exists whether or not anything has
|
|
924
|
+
* it mounted. `Sandbox.Controller` is the only thing that creates,
|
|
925
|
+
* stops, or destroys one; this module is just its identity and state model.
|
|
926
|
+
*
|
|
927
|
+
* The application ID is deliberately separate from the driver's own resource
|
|
928
|
+
* locator: callers never parse a Vercel name or a Daytona ID, driver formats may
|
|
929
|
+
* change, and a destroyed resource must stay identifiable in Project/Session
|
|
930
|
+
* history. A missing resource is never recreated under an existing ID — a new
|
|
931
|
+
* resource is a new namespace and therefore a new ID.
|
|
932
|
+
*/
|
|
933
|
+
declare const ID$2: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
934
|
+
/**
|
|
935
|
+
* The host. Reserved, and never written to a column — see {@link toColumn}.
|
|
936
|
+
* It exists at runtime so nothing has to branch on "is this the host": it is
|
|
937
|
+
* what identity reads, what logs show, and what the transport cache keys on.
|
|
938
|
+
*/
|
|
939
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
940
|
+
/** A fresh identity for a namespace nothing has named yet. */
|
|
941
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
942
|
+
};
|
|
943
|
+
type ID$2 = typeof ID$2.Type;
|
|
944
|
+
/**
|
|
945
|
+
* The storage boundary for namespace references, in one place.
|
|
946
|
+
*
|
|
947
|
+
* The host filesystem exists whether or not a row describes it, so it gets no
|
|
948
|
+
* row and `NULL` is the only spelling of it — the Unix analogue is exact, since
|
|
949
|
+
* `/` has no entry in the mount table you consult to find other mounts. That
|
|
950
|
+
* makes a session or directory writable before any namespace is registered (the
|
|
951
|
+
* foreign key is skipped on NULL), makes `SET sandbox_instance_id = NULL` a
|
|
952
|
+
* meaningful "revert to the host", and leaves the host impossible to tombstone,
|
|
953
|
+
* collect, or destroy, because there is nothing to point at.
|
|
954
|
+
*
|
|
955
|
+
* Two SQLite consequences ride on this and break correctness silently if missed:
|
|
956
|
+
* unique indexes treat NULLs as distinct, so every uniqueness constraint
|
|
957
|
+
* spanning a namespace column coalesces to `'local'`; and `= NULL` never
|
|
958
|
+
* matches, so namespace-scoped reads use `IS`.
|
|
959
|
+
*/
|
|
960
|
+
declare const toColumn: (id: ID$2) => string | null;
|
|
961
|
+
declare const fromColumn: (value: string | null) => ID$2;
|
|
962
|
+
/**
|
|
963
|
+
* The same mapping for row models, whose optional columns are `Option` rather
|
|
964
|
+
* than `null`. Kept beside {@link toColumn} so the boundary stays one place:
|
|
965
|
+
* `toColumn`/`fromColumn` for SQL parameters, these for `Model.FieldOption`.
|
|
966
|
+
*/
|
|
967
|
+
declare const toField: (id: ID$2) => Option.Option<ID$2>;
|
|
968
|
+
declare const fromField: (value: Option.Option<ID$2>) => ID$2;
|
|
969
|
+
/**
|
|
970
|
+
* Filesystem-class taxonomy, mirroring Unix: disk, tmpfs/procfs, NFS/CIFS.
|
|
971
|
+
* Stored on the row rather than derived from the registered driver, so reading
|
|
972
|
+
* an instance never depends on the registry — which matters most when a driver
|
|
973
|
+
* is *not* configured and you need to list or clean up its rows.
|
|
974
|
+
*/
|
|
975
|
+
declare const Kind: Schema.Literals<readonly ["local", "virtual", "remote"]>;
|
|
976
|
+
type Kind = typeof Kind.Type;
|
|
977
|
+
declare const Ownership: Schema.Literals<readonly ["managed", "external"]>;
|
|
978
|
+
type Ownership = typeof Ownership.Type;
|
|
979
|
+
/**
|
|
980
|
+
* Lifecycle state, in ZFS pool vocabulary. This is the **last observed** value,
|
|
981
|
+
* not live driver truth: Daytona auto-stops and auto-archives, Vercel sandboxes
|
|
982
|
+
* expire on their own timeout, so drift is normal. `stateObservedAt` carries the
|
|
983
|
+
* freshness and `Controller.refresh` updates it without waking anything.
|
|
984
|
+
*
|
|
985
|
+
* `removed` and `unavail` are deliberately distinct. `removed` means we deleted
|
|
986
|
+
* it; `unavail` means the driver claims it is gone. A "not found" is frequently a
|
|
987
|
+
* misclassification — wrong region, wrong API url, a revoked key answering 404,
|
|
988
|
+
* eventual consistency right after create — so it must never be recorded as if we
|
|
989
|
+
* had destroyed the resource ourselves.
|
|
990
|
+
*/
|
|
991
|
+
declare const Status: Schema.Literals<readonly ["provisioning", "online", "offline", "suspending", "removing", "removed", "unavail", "faulted"]>;
|
|
992
|
+
type Status = typeof Status.Type;
|
|
993
|
+
/**
|
|
994
|
+
* The statuses a `mount` may proceed from. This is the predicate every
|
|
995
|
+
* conditional write depends on, so it is enumerated once here rather than
|
|
996
|
+
* restated as prose at each call site.
|
|
997
|
+
*
|
|
998
|
+
* `offline` qualifies because mounting wakes.
|
|
999
|
+
* `faulted` qualifies because a fault is a *usability* condition, not an identity one — see {@link Status}.
|
|
1000
|
+
*
|
|
1001
|
+
* There is no `resuming`: it would exist to be observed by nothing, since
|
|
1002
|
+
* mounting wakes, `offline` is already mountable, and waking is not destructive
|
|
1003
|
+
* so it needs no claim. `suspending` and `removing` stay because they *are*
|
|
1004
|
+
* compare-and-set claims, blocking a concurrent mount mid-destruction.
|
|
1005
|
+
*/
|
|
1006
|
+
declare const mountable: ReadonlySet<Status>;
|
|
1007
|
+
declare const isMountable: (status: Status) => boolean;
|
|
1008
|
+
/**
|
|
1009
|
+
* Reference state, derived — never stored. `busy` carries its `umount` meaning:
|
|
1010
|
+
* something holds this and destruction must not proceed unforced.
|
|
1011
|
+
*
|
|
1012
|
+
* `pinned` is the kernel sense of the word: never reclaimable. It short-circuits
|
|
1013
|
+
* counting entirely for instances that cannot be stopped or destroyed (the local
|
|
1014
|
+
* host), which is what keeps them out of any future collector by construction
|
|
1015
|
+
* rather than by an ownership check happening to catch them.
|
|
1016
|
+
*/
|
|
1017
|
+
declare const Usage$1: Schema.Literals<readonly ["idle", "busy", "pinned"]>;
|
|
1018
|
+
type Usage$1 = typeof Usage$1.Type;
|
|
1019
|
+
/** Sanitized driver failure. The only error shape allowed to be persisted or logged. */
|
|
1020
|
+
declare const PersistedError: Schema.Struct<{
|
|
1021
|
+
readonly name: Schema.String;
|
|
1022
|
+
readonly message: Schema.String;
|
|
1023
|
+
readonly code: Schema.optional<Schema.String>;
|
|
1024
|
+
}>;
|
|
1025
|
+
type PersistedError = typeof PersistedError.Type;
|
|
1026
|
+
/** Durable metadata, safe to return and persist. Assembled by the control plane. */
|
|
1027
|
+
interface Info$3 {
|
|
1028
|
+
readonly id: ID$2;
|
|
1029
|
+
readonly driver: Name;
|
|
1030
|
+
readonly kind: Kind;
|
|
1031
|
+
readonly providerResourceId: Option.Option<string>;
|
|
1032
|
+
readonly ownership: Ownership;
|
|
1033
|
+
readonly status: Status;
|
|
1034
|
+
readonly usage: Usage$1;
|
|
1035
|
+
/** References held by *this* control plane. Process-local; see the transport cache. */
|
|
1036
|
+
readonly refCount: number;
|
|
1037
|
+
readonly providerStatus: Option.Option<string>;
|
|
1038
|
+
readonly metadata: Readonly<Record<string, string>>;
|
|
1039
|
+
readonly lastError: Option.Option<PersistedError>;
|
|
1040
|
+
readonly createdAt: Date;
|
|
1041
|
+
readonly updatedAt: Date;
|
|
1042
|
+
readonly stateObservedAt: Date;
|
|
1043
|
+
readonly lastMountedAt: Option.Option<Date>;
|
|
1044
|
+
readonly lastUnmountedAt: Option.Option<Date>;
|
|
1045
|
+
readonly lastUsedAt: Option.Option<Date>;
|
|
1046
|
+
readonly removedAt: Option.Option<Date>;
|
|
1047
|
+
}
|
|
1048
|
+
//#endregion
|
|
1049
|
+
//#region src/schema.d.ts
|
|
1050
|
+
/**
|
|
1051
|
+
* Absolute file path (e.g., `/home/user/projects/myapp/src/main.ts`).
|
|
1052
|
+
*/
|
|
1053
|
+
declare const AbsolutePath: Schema.brand<Schema.String, "AbsolutePath">;
|
|
1054
|
+
type AbsolutePath = Schema.Schema.Type<typeof AbsolutePath>;
|
|
1055
|
+
declare namespace schema_d_exports$1 {
|
|
1056
|
+
export { AssistantEnvelopeUsage, CompactionData, ID$1 as ID, IDFromDb, JsonObject, MessageEnvelopeIdentity, schema_d_exports$1 as SessionSchema, Usage };
|
|
1057
|
+
}
|
|
1058
|
+
declare const ID$1: Schema.brand<Schema.String, "Session.ID"> & {
|
|
1059
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Session.ID">;
|
|
1060
|
+
create: () => string & import("effect/Brand").Brand<"Session.ID">;
|
|
1061
|
+
};
|
|
1062
|
+
type ID$1 = typeof ID$1.Type;
|
|
1063
|
+
declare const IDFromDb: Schema.brand<Schema.String, "Session.ID">;
|
|
1064
|
+
declare const JsonObject: Schema.fromJsonString<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
1065
|
+
declare const MessageEnvelopeIdentity: Schema.fromJsonString<Schema.Struct<{
|
|
1066
|
+
readonly messageId: Schema.String;
|
|
1067
|
+
}>>;
|
|
1068
|
+
declare const CompactionData: Schema.fromJsonString<Schema.Struct<{
|
|
1069
|
+
readonly summary: Schema.String;
|
|
1070
|
+
readonly firstKeptEntryId: Schema.NullOr<Schema.String>;
|
|
1071
|
+
readonly tokensBefore: Schema.Int;
|
|
1072
|
+
}>>;
|
|
1073
|
+
type CompactionData = typeof CompactionData.Type;
|
|
1074
|
+
declare const Usage: Schema.Struct<{
|
|
1075
|
+
readonly input: Schema.Int;
|
|
1076
|
+
readonly output: Schema.Int;
|
|
1077
|
+
readonly cacheRead: Schema.Int;
|
|
1078
|
+
readonly cacheWrite: Schema.Int;
|
|
1079
|
+
readonly totalTokens: Schema.Int;
|
|
1080
|
+
readonly cost: Schema.Struct<{
|
|
1081
|
+
readonly input: Schema.Finite;
|
|
1082
|
+
readonly output: Schema.Finite;
|
|
1083
|
+
readonly cacheRead: Schema.Finite;
|
|
1084
|
+
readonly cacheWrite: Schema.Finite;
|
|
1085
|
+
readonly total: Schema.Finite;
|
|
1086
|
+
}>;
|
|
1087
|
+
}>;
|
|
1088
|
+
type Usage = typeof Usage.Type;
|
|
1089
|
+
declare const AssistantEnvelopeUsage: Schema.fromJsonString<Schema.Struct<{
|
|
1090
|
+
readonly usage: Schema.Struct<{
|
|
1091
|
+
readonly input: Schema.Int;
|
|
1092
|
+
readonly output: Schema.Int;
|
|
1093
|
+
readonly cacheRead: Schema.Int;
|
|
1094
|
+
readonly cacheWrite: Schema.Int;
|
|
1095
|
+
readonly totalTokens: Schema.Int;
|
|
1096
|
+
readonly cost: Schema.Struct<{
|
|
1097
|
+
readonly input: Schema.Finite;
|
|
1098
|
+
readonly output: Schema.Finite;
|
|
1099
|
+
readonly cacheRead: Schema.Finite;
|
|
1100
|
+
readonly cacheWrite: Schema.Finite;
|
|
1101
|
+
readonly total: Schema.Finite;
|
|
1102
|
+
}>;
|
|
1103
|
+
}>;
|
|
1104
|
+
}>>;
|
|
1105
|
+
//#endregion
|
|
1106
|
+
//#region src/session/session.d.ts
|
|
1107
|
+
declare const SessionNotFoundError_base: Schema.Class<SessionNotFoundError, Schema.TaggedStruct<"SessionNotFoundError", {
|
|
1108
|
+
readonly sessionId: Schema.String;
|
|
1109
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1110
|
+
declare class SessionNotFoundError extends SessionNotFoundError_base {}
|
|
1111
|
+
declare const EntryNotFoundError_base: Schema.Class<EntryNotFoundError, Schema.TaggedStruct<"EntryNotFoundError", {
|
|
1112
|
+
readonly sessionId: Schema.String;
|
|
1113
|
+
readonly entryId: Schema.String;
|
|
1114
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1115
|
+
declare class EntryNotFoundError extends EntryNotFoundError_base {}
|
|
1116
|
+
declare const InvalidEntryDataError_base: Schema.Class<InvalidEntryDataError, Schema.TaggedStruct<"InvalidEntryDataError", {
|
|
1117
|
+
readonly entryId: Schema.String;
|
|
1118
|
+
readonly type: Schema.String;
|
|
1119
|
+
readonly reason: Schema.String;
|
|
1120
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1121
|
+
declare class InvalidEntryDataError extends InvalidEntryDataError_base {}
|
|
1122
|
+
interface CreateSession {
|
|
1123
|
+
readonly id?: ID$1;
|
|
1124
|
+
readonly projectId: string;
|
|
1125
|
+
readonly parentId?: ID$1;
|
|
1126
|
+
readonly slug: string;
|
|
1127
|
+
readonly directory: AbsolutePath;
|
|
1128
|
+
readonly title: string;
|
|
1129
|
+
readonly tag?: string;
|
|
1130
|
+
/**
|
|
1131
|
+
* The namespace this session's directory lives in. Defaults to the host,
|
|
1132
|
+
* which needs no row; any other namespace must already be registered.
|
|
1133
|
+
*/
|
|
1134
|
+
readonly sandboxInstanceId?: ID$2;
|
|
1135
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
1136
|
+
}
|
|
1137
|
+
interface AppendPart {
|
|
1138
|
+
readonly id?: string;
|
|
1139
|
+
readonly type: PartType;
|
|
1140
|
+
readonly status?: ToolStatus;
|
|
1141
|
+
readonly callId?: string;
|
|
1142
|
+
readonly toolName?: string;
|
|
1143
|
+
readonly data: string;
|
|
1144
|
+
}
|
|
1145
|
+
interface AppendEntry {
|
|
1146
|
+
readonly id: string;
|
|
1147
|
+
readonly sessionId: ID$1;
|
|
1148
|
+
/**
|
|
1149
|
+
* Position in the session's durable log — the sequence of the event that
|
|
1150
|
+
* produced this entry. Must exceed every existing entry's seq, which the
|
|
1151
|
+
* event log guarantees since sequences only ever advance.
|
|
1152
|
+
*/
|
|
1153
|
+
readonly seq: number;
|
|
1154
|
+
readonly type: EntryType;
|
|
1155
|
+
/** Defaults to committed. Only LLMStarted inserts a draft. */
|
|
1156
|
+
readonly state?: EntryState;
|
|
1157
|
+
readonly data: string;
|
|
1158
|
+
readonly parts?: ReadonlyArray<AppendPart>;
|
|
1159
|
+
readonly parentId?: string;
|
|
1160
|
+
/**
|
|
1161
|
+
* Publish-time context from the event that produced this entry. The log does
|
|
1162
|
+
* not store event metadata, so if it is to survive at all it survives here.
|
|
1163
|
+
*/
|
|
1164
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
1165
|
+
}
|
|
1166
|
+
interface SettleToolCall {
|
|
1167
|
+
readonly entryId: string;
|
|
1168
|
+
readonly callId: string;
|
|
1169
|
+
readonly status: Exclude<ToolStatus, "pending" | "running">;
|
|
1170
|
+
readonly data: string;
|
|
1171
|
+
}
|
|
1172
|
+
interface ReplaceAssistant {
|
|
1173
|
+
readonly id: string;
|
|
1174
|
+
readonly sessionId: ID$1;
|
|
1175
|
+
readonly data: string;
|
|
1176
|
+
readonly parts: ReadonlyArray<AppendPart>;
|
|
1177
|
+
}
|
|
1178
|
+
interface SetEntryState {
|
|
1179
|
+
readonly id: string;
|
|
1180
|
+
readonly sessionId: ID$1;
|
|
1181
|
+
readonly state: "committed";
|
|
1182
|
+
}
|
|
1183
|
+
interface AbortAssistant {
|
|
1184
|
+
readonly id: string;
|
|
1185
|
+
readonly sessionId: ID$1;
|
|
1186
|
+
/** Encoded assistant stub. Parts are always deleted by the transition. */
|
|
1187
|
+
readonly data: string;
|
|
1188
|
+
}
|
|
1189
|
+
interface ForkInput {
|
|
1190
|
+
readonly sessionId: ID$1;
|
|
1191
|
+
readonly entryId?: string;
|
|
1192
|
+
readonly mode?: "at" | "before";
|
|
1193
|
+
readonly id?: ID$1;
|
|
1194
|
+
readonly slug: string;
|
|
1195
|
+
readonly title?: string;
|
|
1196
|
+
readonly tag?: string;
|
|
1197
|
+
}
|
|
1198
|
+
interface HydratedEntry {
|
|
1199
|
+
readonly entry: SessionEntryRow;
|
|
1200
|
+
readonly parts: ReadonlyArray<SessionEntryPartRow>;
|
|
1201
|
+
}
|
|
1202
|
+
interface Interface$9 {
|
|
1203
|
+
readonly create: (input: CreateSession) => Effect.Effect<SessionRow>;
|
|
1204
|
+
readonly get: (sessionId: ID$1) => Effect.Effect<Option.Option<SessionRow>>;
|
|
1205
|
+
readonly list: (input: {
|
|
1206
|
+
projectId: string;
|
|
1207
|
+
}) => Effect.Effect<SessionRow[]>;
|
|
1208
|
+
readonly entry: (entryId: string) => Effect.Effect<Option.Option<HydratedEntry>>;
|
|
1209
|
+
/** Active root→leaf path with parts attached. */
|
|
1210
|
+
readonly path: (sessionId: ID$1) => Effect.Effect<HydratedEntry[]>;
|
|
1211
|
+
/** All branches, newest-first, paged by entry seq. */
|
|
1212
|
+
readonly timeline: (input: {
|
|
1213
|
+
sessionId: ID$1;
|
|
1214
|
+
cursorSeq?: number;
|
|
1215
|
+
limit?: number;
|
|
1216
|
+
}) => Effect.Effect<HydratedEntry[]>;
|
|
1217
|
+
/** Unsettled toolCall parts (crash recovery / live status). */
|
|
1218
|
+
readonly unsettled: (sessionId: ID$1) => Effect.Effect<SessionEntryPartRow[]>;
|
|
1219
|
+
readonly append: (input: AppendEntry) => Effect.Effect<SessionEntryRow, SessionNotFoundError | EntryNotFoundError | InvalidEntryDataError>;
|
|
1220
|
+
/** Projector-only: replace the payload of an existing draft assistant in place. */
|
|
1221
|
+
readonly replaceAssistant: (input: ReplaceAssistant) => Effect.Effect<void>;
|
|
1222
|
+
/** Projector-only: settle one pending/running tool part on a draft assistant. */
|
|
1223
|
+
readonly settleToolCall: (input: SettleToolCall) => Effect.Effect<void>;
|
|
1224
|
+
/** Projector-only: commit a draft after every tool part is terminal. */
|
|
1225
|
+
readonly setEntryState: (input: SetEntryState) => Effect.Effect<void>;
|
|
1226
|
+
/** Projector-only: turn a draft into a partless aborted tombstone. */
|
|
1227
|
+
readonly abortAssistant: (input: AbortAssistant) => Effect.Effect<void>;
|
|
1228
|
+
/** Copy root→fork-point into a new session (`parentId` = source). Clone = fork at leaf. */
|
|
1229
|
+
readonly fork: (input: ForkInput) => Effect.Effect<SessionRow, SessionNotFoundError | EntryNotFoundError | InvalidEntryDataError>;
|
|
1230
|
+
/** Move the leaf cursor; the next append forks a sibling branch. */
|
|
1231
|
+
readonly branch: (input: {
|
|
1232
|
+
sessionId: ID$1;
|
|
1233
|
+
entryId: string;
|
|
1234
|
+
}) => Effect.Effect<void, EntryNotFoundError>;
|
|
1235
|
+
/** Set or clear (null) the bookmark label on an entry. */
|
|
1236
|
+
readonly setLabel: (input: {
|
|
1237
|
+
sessionId: ID$1;
|
|
1238
|
+
entryId: string;
|
|
1239
|
+
label: string | null;
|
|
1240
|
+
}) => Effect.Effect<void, EntryNotFoundError>;
|
|
1241
|
+
}
|
|
1242
|
+
declare const Service_base$8: Context.ServiceClass<Service$8, "@codeworksh/harness/session/session/Service", Interface$9>;
|
|
1243
|
+
declare class Service$8 extends Service_base$8 {}
|
|
1244
|
+
//#endregion
|
|
1245
|
+
//#region src/context/errors.d.ts
|
|
1246
|
+
declare const ContextDecodeError_base: Schema.Class<ContextDecodeError, Schema.TaggedStruct<"ContextDecodeError", {
|
|
1247
|
+
readonly entryId: Schema.String;
|
|
1248
|
+
readonly type: Schema.String;
|
|
1249
|
+
readonly reason: Schema.String;
|
|
1250
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1251
|
+
declare class ContextDecodeError extends ContextDecodeError_base {}
|
|
1252
|
+
declare const ContextEncodeError_base: Schema.Class<ContextEncodeError, Schema.TaggedStruct<"ContextEncodeError", {
|
|
1253
|
+
readonly messageId: Schema.String;
|
|
1254
|
+
readonly role: Schema.String;
|
|
1255
|
+
readonly reason: Schema.String;
|
|
1256
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1257
|
+
declare class ContextEncodeError extends ContextEncodeError_base {}
|
|
1258
|
+
//#endregion
|
|
1259
|
+
//#region src/sandbox/control.d.ts
|
|
1260
|
+
interface CreateInput$2<CreateConfig, RuntimeConfig extends RuntimeConfigBase> {
|
|
1261
|
+
readonly driver: Definition<CreateConfig, RuntimeConfig>;
|
|
1262
|
+
readonly config: CreateConfig;
|
|
1263
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
1264
|
+
/** Reserved for isolated test/script constructors that already own an id. */
|
|
1265
|
+
readonly instanceId?: ID$2 | undefined;
|
|
1266
|
+
}
|
|
1267
|
+
interface RegisterInput$1<CreateConfig, RuntimeConfig extends RuntimeConfigBase> {
|
|
1268
|
+
readonly driver: Definition<CreateConfig, RuntimeConfig>;
|
|
1269
|
+
readonly providerResourceId: string;
|
|
1270
|
+
readonly runtimeConfig?: Partial<RuntimeConfig> | undefined;
|
|
1271
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
1272
|
+
}
|
|
1273
|
+
interface MountOptions {
|
|
1274
|
+
/** Absolute, or relative to RuntimeConfig.defaultCwd. */
|
|
1275
|
+
readonly cwd?: string;
|
|
1276
|
+
}
|
|
1277
|
+
interface DestroyOptions {
|
|
1278
|
+
/** Skip only this process's live-reference guard. */
|
|
1279
|
+
readonly force?: boolean;
|
|
1280
|
+
}
|
|
1281
|
+
interface ListInput {
|
|
1282
|
+
readonly driver?: Name;
|
|
1283
|
+
readonly status?: Status;
|
|
1284
|
+
readonly usage?: Usage$1;
|
|
1285
|
+
}
|
|
1286
|
+
interface Interface$8 {
|
|
1287
|
+
readonly create: <CreateConfig, RuntimeConfig extends RuntimeConfigBase>(input: CreateInput$2<CreateConfig, RuntimeConfig>) => Effect.Effect<Info$3, SandboxCreateError>;
|
|
1288
|
+
readonly createAndMount: <CreateConfig, RuntimeConfig extends RuntimeConfigBase>(input: CreateInput$2<CreateConfig, RuntimeConfig>, options?: MountOptions) => Layer$1<SandboxCreateError | SandboxMountError>;
|
|
1289
|
+
readonly register: <CreateConfig, RuntimeConfig extends RuntimeConfigBase>(input: RegisterInput$1<CreateConfig, RuntimeConfig>) => Effect.Effect<Info$3, SandboxRegisterError>;
|
|
1290
|
+
readonly get: (id: ID$2) => Effect.Effect<Option.Option<Info$3>, SandboxReadError>;
|
|
1291
|
+
readonly list: (input?: ListInput) => Effect.Effect<ReadonlyArray<Info$3>, SandboxReadError>;
|
|
1292
|
+
/** Resolve a session cwd without mounting or waking the sandbox. */
|
|
1293
|
+
readonly resolveCwd: (id?: ID$2, override?: string) => Effect.Effect<AbsolutePath$1, SandboxMountError>;
|
|
1294
|
+
readonly refresh: (id: ID$2) => Effect.Effect<Info$3, SandboxRefreshError>;
|
|
1295
|
+
readonly mount: (id?: ID$2, options?: MountOptions) => Layer$1<SandboxMountError>;
|
|
1296
|
+
readonly withMount: <A, E, R>(id: ID$2 | undefined, use: Effect.Effect<A, E, R>, options?: MountOptions) => Effect.Effect<A, E | SandboxMountError, Exclude<R, Provides>>;
|
|
1297
|
+
readonly wake: (id: ID$2) => Effect.Effect<Info$3, SandboxWakeError>;
|
|
1298
|
+
readonly stop: (id: ID$2) => Effect.Effect<Info$3, SandboxStopError>;
|
|
1299
|
+
readonly destroy: (id: ID$2, options?: DestroyOptions) => Effect.Effect<void, SandboxDestroyError>;
|
|
1300
|
+
}
|
|
1301
|
+
declare const Controller_base: Context.ServiceClass<Controller, "@codeworksh/harness/sandbox/control/Controller", Interface$8>;
|
|
1302
|
+
declare class Controller extends Controller_base {}
|
|
1303
|
+
//#endregion
|
|
1304
|
+
//#region src/sandbox/drivers/daytona.d.ts
|
|
1305
|
+
interface ClientOptions$1 {
|
|
1306
|
+
readonly apiKey?: string | undefined;
|
|
1307
|
+
readonly apiUrl?: string | undefined;
|
|
1308
|
+
readonly target?: string | undefined;
|
|
1309
|
+
}
|
|
1310
|
+
declare const CreateConfig$1: Schema.Struct<{
|
|
1311
|
+
readonly snapshot: Schema.optional<Schema.String>;
|
|
1312
|
+
readonly image: Schema.optional<Schema.String>;
|
|
1313
|
+
readonly language: Schema.optional<Schema.String>;
|
|
1314
|
+
readonly envVars: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
1315
|
+
readonly resources: Schema.optional<Schema.Struct<{
|
|
1316
|
+
readonly cpu: Schema.optional<Schema.Finite>;
|
|
1317
|
+
readonly gpu: Schema.optional<Schema.Finite>;
|
|
1318
|
+
readonly memory: Schema.optional<Schema.Finite>;
|
|
1319
|
+
readonly disk: Schema.optional<Schema.Finite>;
|
|
1320
|
+
}>>;
|
|
1321
|
+
readonly user: Schema.optional<Schema.String>;
|
|
1322
|
+
readonly cwd: Schema.optional<Schema.String>;
|
|
1323
|
+
readonly autoStopInterval: Schema.optional<Schema.Finite>;
|
|
1324
|
+
readonly execTimeout: Schema.optional<Schema.Finite>;
|
|
1325
|
+
}>;
|
|
1326
|
+
type CreateConfig$1 = typeof CreateConfig$1.Type;
|
|
1327
|
+
//#endregion
|
|
1328
|
+
//#region src/sandbox/drivers/vercel.d.ts
|
|
1329
|
+
interface ClientOptions {
|
|
1330
|
+
readonly token?: string | undefined;
|
|
1331
|
+
readonly teamId?: string | undefined;
|
|
1332
|
+
readonly projectId?: string | undefined;
|
|
1333
|
+
}
|
|
1334
|
+
declare const CreateConfig: Schema.Struct<{
|
|
1335
|
+
readonly snapshot: Schema.optional<Schema.String>;
|
|
1336
|
+
readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
1337
|
+
readonly type: Schema.Literal<"git">;
|
|
1338
|
+
readonly url: Schema.String;
|
|
1339
|
+
readonly revision: Schema.optional<Schema.String>;
|
|
1340
|
+
readonly depth: Schema.optional<Schema.Finite>;
|
|
1341
|
+
}>, Schema.Struct<{
|
|
1342
|
+
readonly type: Schema.Literal<"tarball">;
|
|
1343
|
+
readonly url: Schema.String;
|
|
1344
|
+
}>]>>;
|
|
1345
|
+
readonly runtime: Schema.optional<Schema.String>;
|
|
1346
|
+
readonly ports: Schema.optional<Schema.$Array<Schema.Finite>>;
|
|
1347
|
+
readonly envVars: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
1348
|
+
readonly vcpus: Schema.optional<Schema.Finite>;
|
|
1349
|
+
readonly timeout: Schema.optional<Schema.Finite>;
|
|
1350
|
+
readonly execTimeout: Schema.optional<Schema.Finite>;
|
|
1351
|
+
}>;
|
|
1352
|
+
type CreateConfig = typeof CreateConfig.Type;
|
|
1353
|
+
//#endregion
|
|
1354
|
+
//#region src/location/location.d.ts
|
|
1355
|
+
declare const Info_base: Schema.Class<Info$2, Schema.Struct<{
|
|
1356
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
1357
|
+
readonly sandboxInstanceId: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
1358
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
1359
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
1360
|
+
};
|
|
1361
|
+
readonly project: Schema.Struct<{
|
|
1362
|
+
readonly id: Schema.brand<Schema.String, "Project.ID"> & {
|
|
1363
|
+
local: string & import("effect/Brand").Brand<"Project.ID">;
|
|
1364
|
+
};
|
|
1365
|
+
readonly name: Schema.String;
|
|
1366
|
+
readonly vcs: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
1367
|
+
readonly type: Schema.Literal<"git">;
|
|
1368
|
+
readonly store: Schema.brand<Schema.String, "AbsolutePath">;
|
|
1369
|
+
}>]>>;
|
|
1370
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
1371
|
+
}>;
|
|
1372
|
+
}>, {}>;
|
|
1373
|
+
declare class Info$2 extends Info_base {}
|
|
1374
|
+
interface Interface$7 extends Info$2 {}
|
|
1375
|
+
declare const Service_base$7: Context.ServiceClass<Service$7, "@codeworksh/harness/location/location/Service", Interface$7>;
|
|
1376
|
+
declare class Service$7 extends Service_base$7 {}
|
|
1377
|
+
//#endregion
|
|
1378
|
+
//#region src/context/assemble.d.ts
|
|
1379
|
+
interface EffectiveConfig {
|
|
1380
|
+
readonly model?: {
|
|
1381
|
+
readonly providerId: string;
|
|
1382
|
+
readonly modelId: string;
|
|
1383
|
+
};
|
|
1384
|
+
readonly thinkingLevel?: Model.ThinkingLevel;
|
|
1385
|
+
}
|
|
1386
|
+
interface Snapshot$1 {
|
|
1387
|
+
readonly sessionId: string;
|
|
1388
|
+
readonly leafEntryId: string | null;
|
|
1389
|
+
readonly messages: ReadonlyArray<Message.Message>;
|
|
1390
|
+
readonly config: EffectiveConfig;
|
|
1391
|
+
readonly lastAssistant?: {
|
|
1392
|
+
readonly entryId: string;
|
|
1393
|
+
readonly message: Message.AssistantMessage;
|
|
1394
|
+
};
|
|
1395
|
+
}
|
|
1396
|
+
//#endregion
|
|
1397
|
+
//#region src/context/context.d.ts
|
|
1398
|
+
type ContextReadError = SessionNotFoundError | ContextDecodeError;
|
|
1399
|
+
interface Interface$6 {
|
|
1400
|
+
readonly assemble: (sessionId: ID$1) => Effect.Effect<Snapshot$1, ContextReadError>;
|
|
1401
|
+
}
|
|
1402
|
+
declare const Service_base$6: Context.ServiceClass<Service$6, "@codeworksh/harness/context/context/Service", Interface$6>;
|
|
1403
|
+
declare class Service$6 extends Service_base$6 {}
|
|
1404
|
+
//#endregion
|
|
1405
|
+
//#region src/tools/error.d.ts
|
|
1406
|
+
declare const ToolExecutionError_base: Schema.Class<ToolExecutionError, Schema.TaggedStruct<"ToolExecutionError", {
|
|
1407
|
+
readonly toolName: Schema.String;
|
|
1408
|
+
readonly cause: Schema.Defect;
|
|
1409
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1410
|
+
/** A typed wrapper for a tool failure crossing the heterogeneous registry boundary. */
|
|
1411
|
+
declare class ToolExecutionError extends ToolExecutionError_base {}
|
|
1412
|
+
declare namespace tool_d_exports {
|
|
1413
|
+
export { AnyToolDef, AnyToolImpl, FailureMode, Handler, ModelContent, RegisteredTool, ToolCallContext, ToolDef, ToolImpl, define, implement, make, provide, register$1 as register, toAikitTool, toProviderJsonSchema };
|
|
1414
|
+
}
|
|
1415
|
+
/**
|
|
1416
|
+
* The tool definition + handler model.
|
|
1417
|
+
*
|
|
1418
|
+
* A tool definition is pure, serializable data: name, description, and Effect
|
|
1419
|
+
* Schema for parameters / success / failure. Execution is a separate `Handler`
|
|
1420
|
+
* — an `Effect` whose capability dependencies (e.g. `ToolShell`) live in its
|
|
1421
|
+
* requirements `R`, provided by a Layer at runtime. Separating the two is the
|
|
1422
|
+
* main testing win: assert on the definition as plain data, and run the handler
|
|
1423
|
+
* against a stub capability Layer.
|
|
1424
|
+
*
|
|
1425
|
+
* Effect Schema is the single source of truth. {@link toAikitTool} derives a
|
|
1426
|
+
* provider-safe JSON Schema object for the aikit wire view; the harness
|
|
1427
|
+
* decode/encodes arguments and results with Effect Schema natively (it does not
|
|
1428
|
+
* use aikit's Typebox validators).
|
|
1429
|
+
*/
|
|
1430
|
+
/** What the model reads next turn (the `content` side of content/details). */
|
|
1431
|
+
type ModelContent = ReadonlyArray<Message.TextContent | Message.ImageContent>;
|
|
1432
|
+
/**
|
|
1433
|
+
* Expected failures become a tool-error result fed back to the model ("return");
|
|
1434
|
+
* "error" lets them hit the calling effect's error channel. Defaults to
|
|
1435
|
+
* "return" in {@link define}.
|
|
1436
|
+
*
|
|
1437
|
+
* "return" — almost always, for agent tools.
|
|
1438
|
+
* A bash non-zero exit, a file-not-found, a bad-patch — the model should see these and adapt.
|
|
1439
|
+
*
|
|
1440
|
+
* "error" — the rare "this failure is fatal to the run"
|
|
1441
|
+
* case: e.g. an unrecoverable auth/quota error where letting the model keep looping is pointless.
|
|
1442
|
+
*/
|
|
1443
|
+
type FailureMode = "return" | "error";
|
|
1444
|
+
/** Per-call metadata handed to a handler instead of positional args. */
|
|
1445
|
+
interface ToolCallContext {
|
|
1446
|
+
readonly callID: string;
|
|
1447
|
+
readonly toolName: string;
|
|
1448
|
+
readonly rawArgs: Record<string, unknown>;
|
|
1449
|
+
}
|
|
1450
|
+
/**
|
|
1451
|
+
* A pure tool definition. Parametrised over the *schema* instances so the
|
|
1452
|
+
* decoded parameter/success/failure types can be recovered via `["Type"]`.
|
|
1453
|
+
*/
|
|
1454
|
+
interface ToolDef<Name extends string = string, Params extends Schema.Top = Schema.Top, Success extends Schema.Top = Schema.Top, Failure extends Schema.Top = Schema.Top> {
|
|
1455
|
+
readonly name: Name;
|
|
1456
|
+
readonly description: string;
|
|
1457
|
+
/** Human-readable display label (kept from the previous `AgentTool`). */
|
|
1458
|
+
readonly label?: string;
|
|
1459
|
+
/**
|
|
1460
|
+
* A short one-line summary for compact tool listings (e.g. a system-prompt tool index),
|
|
1461
|
+
* distinct from the fuller `description`.
|
|
1462
|
+
*/
|
|
1463
|
+
readonly promptSnippet?: string;
|
|
1464
|
+
/** Optional guideline bullets appended to the default system prompt Guidelines section when this tool is active. */
|
|
1465
|
+
readonly promptGuidelines?: ReadonlyArray<string>;
|
|
1466
|
+
readonly parameters: Params;
|
|
1467
|
+
readonly success: Success;
|
|
1468
|
+
/** Declared, model-visible failures (typed). Omit for tools that cannot fail expectedly. */
|
|
1469
|
+
readonly failure?: Failure;
|
|
1470
|
+
readonly failureMode: FailureMode;
|
|
1471
|
+
/** Render success for the model. Omit → executor falls back to JSON text. */
|
|
1472
|
+
readonly encodeContent?: (success: Success["Type"]) => ModelContent;
|
|
1473
|
+
/** Render an expected failure for the model. Omit → executor falls back to JSON text. */
|
|
1474
|
+
readonly encodeFailureContent?: (failure: Failure["Type"]) => ModelContent;
|
|
1475
|
+
}
|
|
1476
|
+
/** A handler: validated params + context → typed success or typed failure. */
|
|
1477
|
+
type Handler<Params extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, R = never> = (params: Params["Type"], ctx: ToolCallContext) => Effect.Effect<Success["Type"], Failure["Type"], R>;
|
|
1478
|
+
/** A definition paired with its handler (the unit the executor runs). */
|
|
1479
|
+
interface ToolImpl<Name extends string = string, Params extends Schema.Top = Schema.Top, Success extends Schema.Top = Schema.Top, Failure extends Schema.Top = Schema.Top, R = never> {
|
|
1480
|
+
readonly definition: ToolDef<Name, Params, Success, Failure>;
|
|
1481
|
+
readonly handler: Handler<Params, Success, Failure, R>;
|
|
1482
|
+
}
|
|
1483
|
+
type AnyToolDef = ToolDef<string, any, any, any>;
|
|
1484
|
+
type AnyToolImpl<R = never> = ToolImpl<string, any, any, any, R>;
|
|
1485
|
+
interface DefineInput<Name extends string, Params extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top> {
|
|
1486
|
+
readonly name: Name;
|
|
1487
|
+
readonly description: string;
|
|
1488
|
+
readonly label?: string;
|
|
1489
|
+
readonly promptSnippet?: string;
|
|
1490
|
+
readonly parameters: Params;
|
|
1491
|
+
readonly success: Success;
|
|
1492
|
+
readonly failure?: Failure;
|
|
1493
|
+
readonly failureMode?: FailureMode;
|
|
1494
|
+
readonly encodeContent?: (success: Success["Type"]) => ModelContent;
|
|
1495
|
+
readonly encodeFailureContent?: (failure: Failure["Type"]) => ModelContent;
|
|
1496
|
+
}
|
|
1497
|
+
/** Define a pure tool (handler attached later via {@link implement} or a toolkit). */
|
|
1498
|
+
declare const define: <Name extends string, Params extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top = Schema.Top>(input: DefineInput<Name, Params, Success, Failure>) => ToolDef<Name, Params, Success, Failure>;
|
|
1499
|
+
/** Attach a handler to an existing definition (the testable def/exec split). */
|
|
1500
|
+
declare const implement: <Name extends string, Params extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, R = never>(definition: ToolDef<Name, Params, Success, Failure>, handler: Handler<Params, Success, Failure, R>) => ToolImpl<Name, Params, Success, Failure, R>;
|
|
1501
|
+
/** Sugar for the co-located case: a definition with its handler in one object. */
|
|
1502
|
+
declare const make: <Name extends string, Params extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top = Schema.Top, R = never>(input: DefineInput<Name, Params, Success, Failure> & {
|
|
1503
|
+
readonly handler: Handler<Params, Success, Failure, R>;
|
|
1504
|
+
}) => ToolImpl<Name, Params, Success, Failure, R>;
|
|
1505
|
+
/**
|
|
1506
|
+
* A tool ready to register: its capability requirements have been discharged, leaving only
|
|
1507
|
+
* the executor-provided {@link ToolProgress}. The registry and executor hold `RegisteredTool`s
|
|
1508
|
+
* and are non-generic (only `handle` is generic, over a progress sink's `RProgress`), so any
|
|
1509
|
+
* number of tools — built-in or
|
|
1510
|
+
* third-party/plugin — compose without a shared capability union
|
|
1511
|
+
*/
|
|
1512
|
+
interface RegisteredTool {
|
|
1513
|
+
readonly definition: AnyToolDef;
|
|
1514
|
+
readonly handler: (params: unknown, ctx: ToolCallContext) => Effect.Effect<unknown, ToolExecutionError, ToolProgress>;
|
|
1515
|
+
}
|
|
1516
|
+
/** Register a tool whose only requirement is the executor-provided progress service. */
|
|
1517
|
+
declare const register$1: <Name extends string, Params extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top>(impl: ToolImpl<Name, Params, Success, Failure, ToolProgress>) => RegisteredTool;
|
|
1518
|
+
/**
|
|
1519
|
+
* Discharge a tool's capability requirements into a {@link RegisteredTool}, erasing its `R`
|
|
1520
|
+
* (the executor still provides `ToolProgress`). This is the registration boundary: a
|
|
1521
|
+
* plugin/third-party tool provides its own fully-resolved capability Layer here, so the
|
|
1522
|
+
* registry never has to unify anyone's `R`.
|
|
1523
|
+
*/
|
|
1524
|
+
declare const provide: <Name extends string, Params extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, R>(impl: ToolImpl<Name, Params, Success, Failure, R | ToolProgress>, layer: Layer.Layer<R>) => RegisteredTool;
|
|
1525
|
+
/**
|
|
1526
|
+
* Derive a provider-safe JSON Schema object from an Effect Schema. This is the
|
|
1527
|
+
* single boundary that crosses into the provider wire; if a provider rejects a
|
|
1528
|
+
* construct, fix it here. Draft-07 inlines the root (no top-level `$ref`).
|
|
1529
|
+
*/
|
|
1530
|
+
declare const toProviderJsonSchema: (schema: Schema.Top) => Record<string, unknown>;
|
|
1531
|
+
/**
|
|
1532
|
+
* Build the aikit `Message.Tool` wire view from a definition. The derived JSON
|
|
1533
|
+
* Schema object satisfies aikit's `parameters` slot structurally at runtime; the
|
|
1534
|
+
* single localized cast keeps aikit untouched (decision 3-A).
|
|
1535
|
+
*/
|
|
1536
|
+
declare const toAikitTool: (def: AnyToolDef) => Message.Tool;
|
|
1537
|
+
//#endregion
|
|
1538
|
+
//#region src/tools/progress.d.ts
|
|
1539
|
+
/**
|
|
1540
|
+
* `ToolProgress` — the side-channel a long-running tool (e.g. streaming bash)
|
|
1541
|
+
* writes interim output to, instead of an `onUpdate` callback.
|
|
1542
|
+
*
|
|
1543
|
+
* Most tools never call `report` and keep a clean `Effect<Success, Failure>`
|
|
1544
|
+
* signature. Throttling / coalescing lives in the Layer (the live one routes to
|
|
1545
|
+
* the run's event PubSub, tagged with the active callID); the handler just
|
|
1546
|
+
* reports.
|
|
1547
|
+
*/
|
|
1548
|
+
/** Mirror of aikit's `Message.ToolRunningPartial` (kept structural to stay decoupled). */
|
|
1549
|
+
interface ToolProgressPartial {
|
|
1550
|
+
readonly content?: ModelContent;
|
|
1551
|
+
readonly details?: unknown;
|
|
1552
|
+
}
|
|
1553
|
+
interface IToolProgress {
|
|
1554
|
+
readonly report: (partial: ToolProgressPartial) => Effect.Effect<void>;
|
|
1555
|
+
}
|
|
1556
|
+
declare const ToolProgress_base: Context.ServiceClass<ToolProgress, "@codeworksh/harness/tools/progress/ToolProgress", IToolProgress>;
|
|
1557
|
+
declare class ToolProgress extends ToolProgress_base {}
|
|
1558
|
+
//#endregion
|
|
1559
|
+
//#region src/tools/executor.d.ts
|
|
1560
|
+
/**
|
|
1561
|
+
* `ToolExecutor` — the uniform pipeline run for every tool call:
|
|
1562
|
+
*
|
|
1563
|
+
* resolve def → decode args (Effect Schema) → run handler (scoped, exit) →
|
|
1564
|
+
* encode typed Success/Failure into aikit's message protocol → complete terminal part.
|
|
1565
|
+
*
|
|
1566
|
+
* Tool handlers never touch event plumbing or aikit message shapes. The executor owns
|
|
1567
|
+
* the whole pending → terminal value transition. Result mapping:
|
|
1568
|
+
* - success → completed (content + encoded details)
|
|
1569
|
+
* - declared failure → error (content + encoded details), fed to the model
|
|
1570
|
+
* - interruption → aborted
|
|
1571
|
+
* - undeclared / defect → run error (re-raised as a defect)
|
|
1572
|
+
*/
|
|
1573
|
+
/** A complete terminal tool-call part, ready for persistence and event publication. */
|
|
1574
|
+
type ToolOutcome = Message.ToolCallTerminalPart;
|
|
1575
|
+
/** One progress emission handed to an observer, including the complete running part. */
|
|
1576
|
+
interface ProgressEvent {
|
|
1577
|
+
readonly partial: ToolProgressPartial;
|
|
1578
|
+
readonly toolCall: Message.ToolCallRunningPart;
|
|
1579
|
+
readonly ctx: ToolCallContext;
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Per-call execution options (owned here; the registry only forwards them). Progress is
|
|
1583
|
+
* best-effort UI telemetry — see the `handle` progress path in {@link make}.
|
|
1584
|
+
*/
|
|
1585
|
+
interface HandleOptions<RProgress = never, EProgress = never> {
|
|
1586
|
+
/** Sliding-queue capacity for best-effort progress. Bounded default (64); tunable. */
|
|
1587
|
+
readonly progressBuffer?: number;
|
|
1588
|
+
/**
|
|
1589
|
+
* On NORMAL completion, how long to let the sink flush the queue backlog before the scope
|
|
1590
|
+
* closes and the drain fiber stops (default 3s). Ignored on interruption — abort stays snappy.
|
|
1591
|
+
*/
|
|
1592
|
+
readonly progressDrainGrace?: Duration.Input;
|
|
1593
|
+
/**
|
|
1594
|
+
* Best-effort progress observer, drained on a scoped background fiber — never in the tool
|
|
1595
|
+
* hot path. It MAY fail and MAY require services (`RProgress`): failures are logged/dropped,
|
|
1596
|
+
* and intermediate updates may be dropped under load. Not part of tool correctness.
|
|
1597
|
+
*/
|
|
1598
|
+
readonly onProgress?: (event: ProgressEvent) => Effect.Effect<void, EProgress, RProgress>;
|
|
1599
|
+
}
|
|
1600
|
+
interface Executor {
|
|
1601
|
+
/** aikit wire view of the tool set, for the loop context (`convertTools`). */
|
|
1602
|
+
readonly wire: Message.Tool[];
|
|
1603
|
+
/**
|
|
1604
|
+
* Atomically transform one complete pending tool-call part into a complete terminal
|
|
1605
|
+
* part. Most failures become a terminal
|
|
1606
|
+
* `ToolOutcome`; a `failureMode: "error"` tool propagates a {@link ToolExecutionError}
|
|
1607
|
+
* retaining its declared failure as `cause`, and undeclared failures/defects propagate as defects.
|
|
1608
|
+
*
|
|
1609
|
+
* Tools enter as {@link RegisteredTool}s (capability `R` already discharged at
|
|
1610
|
+
* registration), so the only requirement left in the result is a progress sink's own
|
|
1611
|
+
* `RProgress`. `options.onProgress` observes live progress off the hot path.
|
|
1612
|
+
*/
|
|
1613
|
+
readonly handle: <RProgress = never, EProgress = never>(call: Message.ToolCallPendingPart, options?: HandleOptions<RProgress, EProgress>) => Effect.Effect<ToolOutcome, ToolExecutionError, RProgress>;
|
|
1614
|
+
}
|
|
1615
|
+
//#endregion
|
|
1616
|
+
//#region src/tools/registry.d.ts
|
|
1617
|
+
/**
|
|
1618
|
+
* `ToolRegistry` — the loop-facing entry point to the tool catalog
|
|
1619
|
+
*
|
|
1620
|
+
* A `Registry` is a plain immutable value (like {@link Executor}, not a service): a catalog
|
|
1621
|
+
* of {@link RegisteredTool}s plus a `resolve` that produces a frozen {@link Resolved}
|
|
1622
|
+
* snapshot. The registry **catalogs** tools and produces snapshots; it does **not** execute
|
|
1623
|
+
* them — execution lives on the resolved snapshot (`resolved.handle`), backed by the
|
|
1624
|
+
* `Executor`.
|
|
1625
|
+
*
|
|
1626
|
+
* Because a tool's capability `R` is discharged at registration (`Tool.provide` → a
|
|
1627
|
+
* `RegisteredTool` whose only residual requirement is the executor-provided `ToolProgress`),
|
|
1628
|
+
* `Registry` / `Resolved` are **non-generic** — so any number of tools (built-in or
|
|
1629
|
+
* third-party/plugin) compose without a shared capability union.
|
|
1630
|
+
*/
|
|
1631
|
+
/** A frozen effective tool set: model-facing defs + the single execution entry point. */
|
|
1632
|
+
interface Resolved {
|
|
1633
|
+
/** Pure definition data (prompt index, debugging, future codemode). */
|
|
1634
|
+
readonly defs: ReadonlyArray<AnyToolDef>;
|
|
1635
|
+
/** The aikit wire view handed to the LLM request as `tools`. */
|
|
1636
|
+
readonly wire: ReadonlyArray<Message.Tool>;
|
|
1637
|
+
/**
|
|
1638
|
+
* Transform one complete pending tool-call part into a complete terminal part. The **only**
|
|
1639
|
+
* execution entry point — the
|
|
1640
|
+
* loop never runs a tool any other way. This is the executor's `handle` re-exposed; because
|
|
1641
|
+
* the catalog holds `RegisteredTool`s (capability `R` discharged), only a progress sink's own
|
|
1642
|
+
* `RProgress` surfaces in the result.
|
|
1643
|
+
*/
|
|
1644
|
+
readonly handle: Executor["handle"];
|
|
1645
|
+
}
|
|
1646
|
+
//#endregion
|
|
1647
|
+
//#region src/session/runtime.d.ts
|
|
1648
|
+
/** Process-local values that cannot be reconstructed from the durable session log. */
|
|
1649
|
+
type Bindings = Options$1;
|
|
1650
|
+
interface Interface$5 {
|
|
1651
|
+
readonly get: (sessionId: ID$1) => Effect.Effect<Option.Option<Bindings>>;
|
|
1652
|
+
readonly set: (sessionId: ID$1, bindings: Bindings) => Effect.Effect<void>;
|
|
1653
|
+
readonly update: (sessionId: ID$1, patch: Bindings) => Effect.Effect<void>;
|
|
1654
|
+
readonly remove: (sessionId: ID$1) => Effect.Effect<void>;
|
|
1655
|
+
}
|
|
1656
|
+
declare const Service_base$5: Context.ServiceClass<Service$5, "@codeworksh/harness/session/runtime/Service", Interface$5>;
|
|
1657
|
+
declare class Service$5 extends Service_base$5 {}
|
|
1658
|
+
//#endregion
|
|
1659
|
+
//#region src/state/prompt.d.ts
|
|
1660
|
+
/**
|
|
1661
|
+
* What the override sees. The rendered prompt plus the runtime facts it was
|
|
1662
|
+
* rendered from, so a caller can rebuild any part of it rather than only append.
|
|
1663
|
+
*
|
|
1664
|
+
* `tools` is the same resolved set the provider receives, which is what makes a
|
|
1665
|
+
* full override viable without losing the index.
|
|
1666
|
+
*
|
|
1667
|
+
* Conversation messages are deliberately absent. A hook that could read the
|
|
1668
|
+
* transcript is a provider-step concern, not runtime state.
|
|
1669
|
+
*/
|
|
1670
|
+
interface PromptSystemOverrideInput {
|
|
1671
|
+
readonly systemPrompt: string;
|
|
1672
|
+
readonly tools: ReadonlyArray<AnyToolDef>;
|
|
1673
|
+
readonly sandbox: Identity;
|
|
1674
|
+
readonly location: Info$2;
|
|
1675
|
+
readonly provider: string;
|
|
1676
|
+
readonly model: string;
|
|
1677
|
+
readonly thinkingLevel: Model.ThinkingLevel;
|
|
1678
|
+
readonly toolExecution: ToolExecutionMode;
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* The final link in the chain. Its return value is the prompt, verbatim.
|
|
1682
|
+
*
|
|
1683
|
+
* Sync or async: a caller integrating a non-Effect SDK should not have to reach
|
|
1684
|
+
* for Effect to change a string. A throw or rejection becomes a typed
|
|
1685
|
+
* `State.SnapshotError`, never a defect.
|
|
1686
|
+
*/
|
|
1687
|
+
type PromptSystemOverride = (input: PromptSystemOverrideInput) => string | PromiseLike<string>;
|
|
1688
|
+
//#endregion
|
|
1689
|
+
//#region src/state/state.d.ts
|
|
1690
|
+
/**
|
|
1691
|
+
* How a turn's tool calls are scheduled once the array has been re-read.
|
|
1692
|
+
*
|
|
1693
|
+
* Pinned in the snapshot so a configuration change cannot switch scheduling
|
|
1694
|
+
* halfway through an exchange. State supplies the value; Loop implements it.
|
|
1695
|
+
*/
|
|
1696
|
+
type ToolExecutionMode = "sequential" | "parallel";
|
|
1697
|
+
/**
|
|
1698
|
+
* Everything a caller may legally inject into aikit's
|
|
1699
|
+
* `stream(model, context, options)`.
|
|
1700
|
+
*
|
|
1701
|
+
* aikit's bag is generic per protocol (`Protocol.OptionsFor<TProtocol>`); this is
|
|
1702
|
+
* the erased form, the same move the tool registry makes when it discharges a
|
|
1703
|
+
* tool's capability `R`. Four fields are excluded:
|
|
1704
|
+
*
|
|
1705
|
+
* - `signal` -- `LLM.run` binds it to the scope that aborts the transport on
|
|
1706
|
+
* interruption. A caller value would silently break cancellation.
|
|
1707
|
+
* - `sessionId` -- Loop owns it.
|
|
1708
|
+
* - `reasoning` -- this *is* the thinking level. Exposing it alongside
|
|
1709
|
+
* `thinkingLevel` would be two spellings of one value, free to drift.
|
|
1710
|
+
* - `modelId` -- duplicates {@link Options.model}.
|
|
1711
|
+
*
|
|
1712
|
+
* Note: keep options in sync with aikit see @codeworksh/aikit
|
|
1713
|
+
*/
|
|
1714
|
+
type RequestOptions = Omit<Protocol.CommonOptions, "signal" | "sessionId" | "reasoning"> & {
|
|
1715
|
+
readonly baseURL?: string;
|
|
1716
|
+
readonly method?: Model.APIMethodEnum;
|
|
1717
|
+
readonly toolChoice?: unknown;
|
|
1718
|
+
readonly activeTools?: ReadonlyArray<string>;
|
|
1719
|
+
readonly factoryOptions?: Record<string, unknown>;
|
|
1720
|
+
readonly providerOptions?: Record<string, Record<string, unknown>>;
|
|
1721
|
+
};
|
|
1722
|
+
interface Options$1 extends RequestOptions {
|
|
1723
|
+
/** Replaces the default foundation prose. */
|
|
1724
|
+
readonly promptCustom?: string;
|
|
1725
|
+
/** Appended after the rendered tool sections. */
|
|
1726
|
+
readonly promptSystemAppend?: string;
|
|
1727
|
+
/** Owns the final prompt outright. Sync or async. */
|
|
1728
|
+
readonly promptSystemOverride?: PromptSystemOverride;
|
|
1729
|
+
/**
|
|
1730
|
+
* Registered after the built-in Bash tool, so the registry's
|
|
1731
|
+
* last-registration-wins rule lets a caller intentionally replace Bash by
|
|
1732
|
+
* name.
|
|
1733
|
+
*
|
|
1734
|
+
* TODO(sanchitrk): check if our assumption is correct here? overriding with same name allowed.
|
|
1735
|
+
* requires fixing if needed within tool registry
|
|
1736
|
+
*/
|
|
1737
|
+
readonly tools?: ReadonlyArray<RegisteredTool>;
|
|
1738
|
+
/** Built-in tool names enabled for this session. Omitted keeps the Bash default. */
|
|
1739
|
+
readonly builtinTools?: ReadonlyArray<"bash">;
|
|
1740
|
+
readonly provider?: string;
|
|
1741
|
+
readonly model?: string;
|
|
1742
|
+
readonly thinkingLevel?: Model.ThinkingLevel;
|
|
1743
|
+
readonly toolExecution?: ToolExecutionMode;
|
|
1744
|
+
}
|
|
1745
|
+
declare const SnapshotError_base: Schema.Class<SnapshotError, Schema.TaggedStruct<"State.SnapshotError", {
|
|
1746
|
+
readonly sessionId: Schema.String;
|
|
1747
|
+
readonly reason: Schema.String;
|
|
1748
|
+
readonly cause: Schema.Defect;
|
|
1749
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1750
|
+
/**
|
|
1751
|
+
* The prompt override threw or rejected.
|
|
1752
|
+
*
|
|
1753
|
+
* Typed rather than a defect: a caller's callback failing is a caller bug, but it
|
|
1754
|
+
* is one the session should report and survive rather than crash on. The turn
|
|
1755
|
+
* fails before any provider request goes out.
|
|
1756
|
+
*/
|
|
1757
|
+
declare class SnapshotError extends SnapshotError_base {}
|
|
1758
|
+
/**
|
|
1759
|
+
* Immutable runtime state for one exchange.
|
|
1760
|
+
*
|
|
1761
|
+
* `tools.handle` is executable, and that is deliberate: the definitions the model
|
|
1762
|
+
* is shown, the wire schemas it is given, and the handlers that run all come from
|
|
1763
|
+
* one resolved registry. Splitting them would let the advertised set drift from
|
|
1764
|
+
* the executed one.
|
|
1765
|
+
*
|
|
1766
|
+
* Not durable and not serializable. It holds no mutable refs and owns no
|
|
1767
|
+
* lifecycle -- the mount it reads outlives it.
|
|
1768
|
+
*/
|
|
1769
|
+
interface Snapshot {
|
|
1770
|
+
readonly sessionId: ID$1;
|
|
1771
|
+
readonly sandbox: Identity;
|
|
1772
|
+
readonly location: Info$2;
|
|
1773
|
+
readonly systemPrompt: string;
|
|
1774
|
+
readonly tools: Resolved;
|
|
1775
|
+
readonly provider: string;
|
|
1776
|
+
readonly model: string;
|
|
1777
|
+
readonly thinkingLevel: Model.ThinkingLevel;
|
|
1778
|
+
readonly request: RequestOptions;
|
|
1779
|
+
readonly toolExecution: ToolExecutionMode;
|
|
1780
|
+
}
|
|
1781
|
+
interface Interface$4 {
|
|
1782
|
+
/**
|
|
1783
|
+
* Capture runtime state for one exchange. Called inside a session drain,
|
|
1784
|
+
* where the mount it reads is already open.
|
|
1785
|
+
*/
|
|
1786
|
+
readonly snapshot: (sessionId: ID$1) => Effect.Effect<Snapshot, SnapshotError | ContextReadError, Provides | Service$7>;
|
|
1787
|
+
}
|
|
1788
|
+
declare const Service_base$4: Context.ServiceClass<Service$4, "@codeworksh/harness/state/state/Service", Interface$4>;
|
|
1789
|
+
declare class Service$4 extends Service_base$4 {}
|
|
1790
|
+
declare namespace run_d_exports {
|
|
1791
|
+
export { Interface$3 as Interface, LLMStreamError, ModelCatalogError, ModelNotFoundError, ProviderAuthenticationError, ProviderAuthorizationError, ProviderConfigurationError, ProviderContentPolicyError, ProviderError, ProviderFailureReason, ProviderInvalidRequestError, ProviderInvalidResponseError, ProviderModelUnavailableError, ProviderQuotaError, ProviderRateLimitError, ProviderTimeoutError, ProviderTransportError, ProviderUnavailableError, ProviderUnknownError, RunError, run_d_exports as Runner, SandboxDirectoryNotFoundError, Service$3 as Service };
|
|
1792
|
+
}
|
|
1793
|
+
declare const SandboxDirectoryNotFoundError_base: Schema.Class<SandboxDirectoryNotFoundError, Schema.TaggedStruct<"Runner.SandboxDirectoryNotFoundError", {
|
|
1794
|
+
readonly sessionId: Schema.String;
|
|
1795
|
+
readonly sandboxInstanceId: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
|
|
1796
|
+
local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
1797
|
+
create: () => string & import("effect/Brand").Brand<"SandboxInstance.ID">;
|
|
1798
|
+
};
|
|
1799
|
+
readonly directory: Schema.String;
|
|
1800
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1801
|
+
declare class SandboxDirectoryNotFoundError extends SandboxDirectoryNotFoundError_base {
|
|
1802
|
+
get message(): string;
|
|
1803
|
+
}
|
|
1804
|
+
declare const ProviderAuthenticationError_base: Schema.Class<ProviderAuthenticationError, Schema.TaggedStruct<"Runner.ProviderAuthenticationError", {
|
|
1805
|
+
readonly message: Schema.String;
|
|
1806
|
+
readonly isRetryable: Schema.Boolean;
|
|
1807
|
+
readonly status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1808
|
+
readonly code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1809
|
+
readonly requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1810
|
+
readonly retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1811
|
+
readonly authentication: Schema.Literals<readonly ["missing", "invalid", "expired"]>;
|
|
1812
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1813
|
+
declare class ProviderAuthenticationError extends ProviderAuthenticationError_base {}
|
|
1814
|
+
declare const ProviderConfigurationError_base: Schema.Class<ProviderConfigurationError, Schema.TaggedStruct<"Runner.ProviderConfigurationError", {
|
|
1815
|
+
message: Schema.String;
|
|
1816
|
+
isRetryable: Schema.Boolean;
|
|
1817
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1818
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1819
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1820
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1821
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1822
|
+
declare class ProviderConfigurationError extends ProviderConfigurationError_base {}
|
|
1823
|
+
declare const ProviderAuthorizationError_base: Schema.Class<ProviderAuthorizationError, Schema.TaggedStruct<"Runner.ProviderAuthorizationError", {
|
|
1824
|
+
message: Schema.String;
|
|
1825
|
+
isRetryable: Schema.Boolean;
|
|
1826
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1827
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1828
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1829
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1830
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1831
|
+
declare class ProviderAuthorizationError extends ProviderAuthorizationError_base {}
|
|
1832
|
+
declare const ProviderModelUnavailableError_base: Schema.Class<ProviderModelUnavailableError, Schema.TaggedStruct<"Runner.ProviderModelUnavailableError", {
|
|
1833
|
+
message: Schema.String;
|
|
1834
|
+
isRetryable: Schema.Boolean;
|
|
1835
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1836
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1837
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1838
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1839
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1840
|
+
declare class ProviderModelUnavailableError extends ProviderModelUnavailableError_base {}
|
|
1841
|
+
declare const ProviderRateLimitError_base: Schema.Class<ProviderRateLimitError, Schema.TaggedStruct<"Runner.ProviderRateLimitError", {
|
|
1842
|
+
message: Schema.String;
|
|
1843
|
+
isRetryable: Schema.Boolean;
|
|
1844
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1845
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1846
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1847
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1848
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1849
|
+
declare class ProviderRateLimitError extends ProviderRateLimitError_base {}
|
|
1850
|
+
declare const ProviderQuotaError_base: Schema.Class<ProviderQuotaError, Schema.TaggedStruct<"Runner.ProviderQuotaError", {
|
|
1851
|
+
message: Schema.String;
|
|
1852
|
+
isRetryable: Schema.Boolean;
|
|
1853
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1854
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1855
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1856
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1857
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1858
|
+
declare class ProviderQuotaError extends ProviderQuotaError_base {}
|
|
1859
|
+
declare const ProviderInvalidRequestError_base: Schema.Class<ProviderInvalidRequestError, Schema.TaggedStruct<"Runner.ProviderInvalidRequestError", {
|
|
1860
|
+
message: Schema.String;
|
|
1861
|
+
isRetryable: Schema.Boolean;
|
|
1862
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1863
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1864
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1865
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1866
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1867
|
+
declare class ProviderInvalidRequestError extends ProviderInvalidRequestError_base {}
|
|
1868
|
+
declare const ProviderContentPolicyError_base: Schema.Class<ProviderContentPolicyError, Schema.TaggedStruct<"Runner.ProviderContentPolicyError", {
|
|
1869
|
+
message: Schema.String;
|
|
1870
|
+
isRetryable: Schema.Boolean;
|
|
1871
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1872
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1873
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1874
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1875
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1876
|
+
declare class ProviderContentPolicyError extends ProviderContentPolicyError_base {}
|
|
1877
|
+
declare const ProviderTimeoutError_base: Schema.Class<ProviderTimeoutError, Schema.TaggedStruct<"Runner.ProviderTimeoutError", {
|
|
1878
|
+
message: Schema.String;
|
|
1879
|
+
isRetryable: Schema.Boolean;
|
|
1880
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1881
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1882
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1883
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1884
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1885
|
+
declare class ProviderTimeoutError extends ProviderTimeoutError_base {}
|
|
1886
|
+
declare const ProviderTransportError_base: Schema.Class<ProviderTransportError, Schema.TaggedStruct<"Runner.ProviderTransportError", {
|
|
1887
|
+
message: Schema.String;
|
|
1888
|
+
isRetryable: Schema.Boolean;
|
|
1889
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1890
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1891
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1892
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1893
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1894
|
+
declare class ProviderTransportError extends ProviderTransportError_base {}
|
|
1895
|
+
declare const ProviderUnavailableError_base: Schema.Class<ProviderUnavailableError, Schema.TaggedStruct<"Runner.ProviderUnavailableError", {
|
|
1896
|
+
message: Schema.String;
|
|
1897
|
+
isRetryable: Schema.Boolean;
|
|
1898
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1899
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1900
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1901
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1902
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1903
|
+
declare class ProviderUnavailableError extends ProviderUnavailableError_base {}
|
|
1904
|
+
declare const ProviderInvalidResponseError_base: Schema.Class<ProviderInvalidResponseError, Schema.TaggedStruct<"Runner.ProviderInvalidResponseError", {
|
|
1905
|
+
message: Schema.String;
|
|
1906
|
+
isRetryable: Schema.Boolean;
|
|
1907
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1908
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1909
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1910
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1911
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1912
|
+
declare class ProviderInvalidResponseError extends ProviderInvalidResponseError_base {}
|
|
1913
|
+
declare const ProviderUnknownError_base: Schema.Class<ProviderUnknownError, Schema.TaggedStruct<"Runner.ProviderUnknownError", {
|
|
1914
|
+
message: Schema.String;
|
|
1915
|
+
isRetryable: Schema.Boolean;
|
|
1916
|
+
status: Schema.decodeTo<Schema.optional<Schema.Finite>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
1917
|
+
code: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1918
|
+
requestId: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
|
1919
|
+
retryAfter: Schema.decodeTo<Schema.optional<Schema.Duration>, Schema.optionalKey<Schema.Duration>, never, never>;
|
|
1920
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1921
|
+
declare class ProviderUnknownError extends ProviderUnknownError_base {}
|
|
1922
|
+
declare const ProviderFailureReason: Schema.Union<readonly [typeof ProviderAuthenticationError, typeof ProviderConfigurationError, typeof ProviderAuthorizationError, typeof ProviderModelUnavailableError, typeof ProviderRateLimitError, typeof ProviderQuotaError, typeof ProviderInvalidRequestError, typeof ProviderContentPolicyError, typeof ProviderTimeoutError, typeof ProviderTransportError, typeof ProviderUnavailableError, typeof ProviderInvalidResponseError, typeof ProviderUnknownError]>;
|
|
1923
|
+
type ProviderFailureReason = Schema.Schema.Type<typeof ProviderFailureReason>;
|
|
1924
|
+
declare const ProviderError_base: Schema.Class<ProviderError, Schema.TaggedStruct<"Runner.ProviderError", {
|
|
1925
|
+
readonly provider: Schema.String;
|
|
1926
|
+
readonly model: Schema.String;
|
|
1927
|
+
readonly reason: Schema.Union<readonly [typeof ProviderAuthenticationError, typeof ProviderConfigurationError, typeof ProviderAuthorizationError, typeof ProviderModelUnavailableError, typeof ProviderRateLimitError, typeof ProviderQuotaError, typeof ProviderInvalidRequestError, typeof ProviderContentPolicyError, typeof ProviderTimeoutError, typeof ProviderTransportError, typeof ProviderUnavailableError, typeof ProviderInvalidResponseError, typeof ProviderUnknownError]>;
|
|
1928
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1929
|
+
/** Stable provider boundary for SDK and RPC consumers; inspect `reason._tag` for the category. */
|
|
1930
|
+
declare class ProviderError extends ProviderError_base {
|
|
1931
|
+
readonly cause: ProviderAuthenticationError | ProviderAuthorizationError | ProviderConfigurationError | ProviderContentPolicyError | ProviderInvalidRequestError | ProviderInvalidResponseError | ProviderModelUnavailableError | ProviderQuotaError | ProviderRateLimitError | ProviderTimeoutError | ProviderTransportError | ProviderUnavailableError | ProviderUnknownError;
|
|
1932
|
+
get message(): string;
|
|
1933
|
+
get isRetryable(): boolean;
|
|
1934
|
+
}
|
|
1935
|
+
declare const ModelCatalogError_base: Schema.Class<ModelCatalogError, Schema.TaggedStruct<"Runner.ModelCatalogError", {
|
|
1936
|
+
readonly path: Schema.String;
|
|
1937
|
+
readonly reason: Schema.Literals<readonly ["missing", "unreadable", "empty", "invalid"]>;
|
|
1938
|
+
readonly detail: Schema.String;
|
|
1939
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1940
|
+
declare class ModelCatalogError extends ModelCatalogError_base {
|
|
1941
|
+
get message(): string;
|
|
1942
|
+
}
|
|
1943
|
+
declare const ModelNotFoundError_base: Schema.Class<ModelNotFoundError, Schema.TaggedStruct<"Runner.ModelNotFoundError", {
|
|
1944
|
+
readonly provider: Schema.String;
|
|
1945
|
+
readonly model: Schema.String;
|
|
1946
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1947
|
+
declare class ModelNotFoundError extends ModelNotFoundError_base {
|
|
1948
|
+
get message(): string;
|
|
1949
|
+
}
|
|
1950
|
+
declare const LLMStreamError_base: Schema.Class<LLMStreamError, Schema.TaggedStruct<"Runner.LLMStreamError", {
|
|
1951
|
+
readonly sessionId: Schema.String;
|
|
1952
|
+
readonly reason: Schema.String;
|
|
1953
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1954
|
+
declare class LLMStreamError extends LLMStreamError_base {
|
|
1955
|
+
get message(): string;
|
|
1956
|
+
}
|
|
1957
|
+
type RunError = ModelCatalogError | ModelNotFoundError | ProviderError | LLMStreamError | ContextDecodeError | ContextEncodeError | SessionNotFoundError | SnapshotError | SandboxDirectoryNotFoundError | SandboxMountError | FileSystemError;
|
|
1958
|
+
interface Interface$3 {
|
|
1959
|
+
/** Drains eligible durable work. Explicit runs perform one provider attempt even when no work is eligible. */
|
|
1960
|
+
readonly run: (input: {
|
|
1961
|
+
readonly sessionId: ID$1;
|
|
1962
|
+
readonly force: boolean;
|
|
1963
|
+
}) => Effect.Effect<void, RunError, Provides | Service$7>;
|
|
1964
|
+
}
|
|
1965
|
+
declare const Service_base$3: Context.ServiceClass<Service$3, "@codeworksh/harness/runner/run/Service", Interface$3>;
|
|
1966
|
+
declare class Service$3 extends Service_base$3 {}
|
|
1967
|
+
//#endregion
|
|
1968
|
+
//#region src/runner/execution.d.ts
|
|
1969
|
+
interface Interface$2 {
|
|
1970
|
+
/** Snapshots active execution owned by this process. */
|
|
1971
|
+
readonly active: Effect.Effect<ReadonlySet<ID$1>>;
|
|
1972
|
+
/** Starts execution while idle or joins the active execution. */
|
|
1973
|
+
readonly resume: (sessionId: ID$1) => Effect.Effect<void, RunError>;
|
|
1974
|
+
/** Drains durable queued input without forcing an otherwise empty provider turn. */
|
|
1975
|
+
readonly drain: (sessionId: ID$1) => Effect.Effect<void, RunError>;
|
|
1976
|
+
/** Registers newly recorded work. Repeated wakeups may coalesce. */
|
|
1977
|
+
readonly wake: (sessionId: ID$1) => Effect.Effect<void>;
|
|
1978
|
+
/** Interrupt active work owned by this process. Idle interruption is a no-op. */
|
|
1979
|
+
readonly interrupt: (sessionId: ID$1) => Effect.Effect<void>;
|
|
1980
|
+
}
|
|
1981
|
+
declare const Service_base$2: Context.ServiceClass<Service$2, "@codeworksh/harness/runner/execution/Service", Interface$2>;
|
|
1982
|
+
declare class Service$2 extends Service_base$2 {}
|
|
1983
|
+
//#endregion
|
|
1984
|
+
//#region src/session/input/schema.d.ts
|
|
1985
|
+
declare const Admitted: Schema.Struct<{
|
|
1986
|
+
readonly admittedSeq: Schema.Int;
|
|
1987
|
+
readonly id: Schema.brand<Schema.String, "Message.ID"> & {
|
|
1988
|
+
create: () => string & import("effect/Brand").Brand<"Message.ID">;
|
|
1989
|
+
from: (id: string) => string & import("effect/Brand").Brand<"Message.ID">;
|
|
1990
|
+
};
|
|
1991
|
+
readonly sessionId: Schema.brand<Schema.String, "Session.ID"> & {
|
|
1992
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Session.ID">;
|
|
1993
|
+
create: () => string & import("effect/Brand").Brand<"Session.ID">;
|
|
1994
|
+
};
|
|
1995
|
+
readonly prompt: Schema.Struct<{
|
|
1996
|
+
readonly text: Schema.String;
|
|
1997
|
+
}> & {
|
|
1998
|
+
equivalence: import("effect/Equivalence").Equivalence<{
|
|
1999
|
+
readonly text: string;
|
|
2000
|
+
}>;
|
|
2001
|
+
fromUserMessage: (input: Pick<Prompt, "text">) => {
|
|
2002
|
+
readonly text: string;
|
|
2003
|
+
};
|
|
2004
|
+
};
|
|
2005
|
+
readonly delivery: Schema.Literals<readonly ["steer", "followUp"]>;
|
|
2006
|
+
readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
2007
|
+
readonly promotedSeq: Schema.decodeTo<Schema.optional<Schema.Int>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
2008
|
+
}>;
|
|
2009
|
+
interface Admitted extends Schema.Schema.Type<typeof Admitted> {}
|
|
2010
|
+
declare namespace schema_d_exports {
|
|
2011
|
+
export { ID, schema_d_exports as SessionMessageSchema };
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* A conversation message id.
|
|
2015
|
+
*
|
|
2016
|
+
* Deliberately unprefixed. aikit mints assistant message ids itself, as bare
|
|
2017
|
+
* uuidv7, and `stream()` accepts no id -- so any naming rule of ours would have
|
|
2018
|
+
* to be imposed on messages aikit hands us, by rewriting a field of the value we
|
|
2019
|
+
* were given. Sharing aikit's format instead means an id means the same thing on
|
|
2020
|
+
* both sides of the boundary and never needs translating.
|
|
2021
|
+
*
|
|
2022
|
+
* The brand carries the meaning; uuidv7 keeps ids time-ordered, so they sort by
|
|
2023
|
+
* creation.
|
|
2024
|
+
*/
|
|
2025
|
+
declare const ID: Schema.brand<Schema.String, "Message.ID"> & {
|
|
2026
|
+
create: () => string & import("effect/Brand").Brand<"Message.ID">;
|
|
2027
|
+
/**
|
|
2028
|
+
* Adopt an id minted elsewhere -- in practice aikit's, which arrives as a
|
|
2029
|
+
* plain string on every stream event and inside every assistant message.
|
|
2030
|
+
*
|
|
2031
|
+
* `make` does the same thing. This exists so the boundary where a foreign
|
|
2032
|
+
* id enters the domain is named and greppable, and so the pairing with
|
|
2033
|
+
* `create` says which side chose the id.
|
|
2034
|
+
*/
|
|
2035
|
+
from: (id: string) => string & import("effect/Brand").Brand<"Message.ID">;
|
|
2036
|
+
};
|
|
2037
|
+
type ID = typeof ID.Type;
|
|
2038
|
+
//#endregion
|
|
2039
|
+
//#region src/control.d.ts
|
|
2040
|
+
declare const PromptConflictError_base: Schema.Class<PromptConflictError, Schema.TaggedStruct<"PromptConflictError", {
|
|
2041
|
+
readonly sessionId: Schema.String;
|
|
2042
|
+
readonly messageId: Schema.String;
|
|
2043
|
+
}>, import("effect/Cause").YieldableError>;
|
|
2044
|
+
/**
|
|
2045
|
+
* The prompt could not be admitted under the id it was given: either that id
|
|
2046
|
+
* already carries different content, or it has already left the inbox. Typed
|
|
2047
|
+
* rather than a defect — a client that retried with a reused id can act on it.
|
|
2048
|
+
*/
|
|
2049
|
+
declare class PromptConflictError extends PromptConflictError_base {}
|
|
2050
|
+
interface PromptInput$1 {
|
|
2051
|
+
readonly sessionId: ID$1;
|
|
2052
|
+
readonly prompt: Prompt;
|
|
2053
|
+
/** Supply to make the call idempotent across retries; minted when omitted. */
|
|
2054
|
+
readonly id?: ID;
|
|
2055
|
+
/** Defaults to "steer": join the running turn rather than waiting for the next. */
|
|
2056
|
+
readonly delivery?: Delivery;
|
|
2057
|
+
}
|
|
2058
|
+
interface Interface$1 {
|
|
2059
|
+
/**
|
|
2060
|
+
* Records a prompt in the session's durable inbox, then wakes its drain.
|
|
2061
|
+
*
|
|
2062
|
+
* Returns once the prompt is stored, not once it is answered, and not once it
|
|
2063
|
+
* is in the conversation: an admitted prompt enters the transcript at
|
|
2064
|
+
* promotion, which the runner performs at the start of a turn. Between the
|
|
2065
|
+
* two the inbox is the only durable record, which is what makes a crash in
|
|
2066
|
+
* that window recoverable rather than a user message nothing ever answered.
|
|
2067
|
+
*/
|
|
2068
|
+
readonly prompt: (input: PromptInput$1) => Effect.Effect<Admitted, SessionNotFoundError | PromptConflictError>;
|
|
2069
|
+
/** Records a prompt and awaits the drain generation responsible for it. */
|
|
2070
|
+
readonly run: (input: PromptInput$1) => Effect.Effect<Admitted, SessionNotFoundError | PromptConflictError | RunError>;
|
|
2071
|
+
/** Starts a drain while the session is idle, or joins the one already running. */
|
|
2072
|
+
readonly resume: (sessionId: ID$1) => Effect.Effect<void, SessionNotFoundError | RunError>;
|
|
2073
|
+
/** Stops work owned by this process, waiting for its cleanup. Idle is a no-op. */
|
|
2074
|
+
readonly interrupt: (sessionId: ID$1) => Effect.Effect<void>;
|
|
2075
|
+
/** Sessions this process is currently draining. */
|
|
2076
|
+
readonly active: Effect.Effect<ReadonlySet<ID$1>>;
|
|
2077
|
+
}
|
|
2078
|
+
declare const Service_base$1: Context.ServiceClass<Service$1, "@codeworksh/harness/control/Service", Interface$1>;
|
|
2079
|
+
declare class Service$1 extends Service_base$1 {}
|
|
2080
|
+
//#endregion
|
|
6
2081
|
//#region src/global.d.ts
|
|
7
2082
|
declare const Service_base: Context.ServiceClass<Service, "@codeworksh/harness/global/Service", Interface>;
|
|
8
2083
|
declare class Service extends Service_base {}
|
|
@@ -16,18 +2091,18 @@ interface Interface {
|
|
|
16
2091
|
//#endregion
|
|
17
2092
|
//#region src/runner/llm.d.ts
|
|
18
2093
|
interface Input {
|
|
19
|
-
readonly sessionId: ID;
|
|
2094
|
+
readonly sessionId: ID$1;
|
|
20
2095
|
readonly context: Message.Context;
|
|
21
2096
|
readonly provider: string;
|
|
22
2097
|
readonly model: string;
|
|
23
2098
|
readonly thinkingLevel?: Model.ThinkingLevel;
|
|
24
2099
|
readonly options?: RequestOptions;
|
|
25
2100
|
}
|
|
26
|
-
type Open = (input: Input, signal: AbortSignal) => Effect.Effect<AsyncIterable<Event.LLMMessageEvent>, ModelNotFoundError |
|
|
2101
|
+
type Open = (input: Input, signal: AbortSignal) => Effect.Effect<AsyncIterable<Event.LLMMessageEvent>, ModelCatalogError | ModelNotFoundError | ProviderError>;
|
|
27
2102
|
declare namespace sandbox_d_exports {
|
|
28
|
-
export { CreateInput$1 as CreateInput, Driver, Drivers, Info$1 as Info, RegisterInput, sandbox_d_exports as Sandbox, instance_d_exports as SandboxInstance, create$
|
|
2103
|
+
export { CreateInput$1 as CreateInput, Driver, Drivers, Info$1 as Info, RegisterInput, sandbox_d_exports as Sandbox, instance_d_exports as SandboxInstance, create$2 as create, destroy, get$1 as get, list, refresh, register, stop, wake };
|
|
29
2104
|
}
|
|
30
|
-
type Info$1 = Info$
|
|
2105
|
+
type Info$1 = Info$3;
|
|
31
2106
|
type Driver = Registration;
|
|
32
2107
|
type CreateInput$1 = {
|
|
33
2108
|
readonly driver: "memory";
|
|
@@ -45,16 +2120,16 @@ type RegisterInput = {
|
|
|
45
2120
|
readonly driver: "vercel" | "daytona";
|
|
46
2121
|
readonly providerResourceId: string;
|
|
47
2122
|
};
|
|
48
|
-
declare const create$
|
|
49
|
-
declare const register: (input: RegisterInput) => Effect.Effect<Info$
|
|
50
|
-
declare const get$1: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<import("effect/Option").Option<Info$
|
|
2123
|
+
declare const create$2: (input: CreateInput$1) => Effect.Effect<Info$3, SandboxCreateError, Controller | Registry>;
|
|
2124
|
+
declare const register: (input: RegisterInput) => Effect.Effect<Info$3, SandboxRegisterError, Controller | Registry>;
|
|
2125
|
+
declare const get$1: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<import("effect/Option").Option<Info$3>, never, Controller>;
|
|
51
2126
|
declare const list: (input?: {
|
|
52
2127
|
readonly driver?: string;
|
|
53
2128
|
readonly status?: Status;
|
|
54
|
-
} | undefined) => Effect.Effect<readonly Info$
|
|
55
|
-
declare const refresh: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<Info$
|
|
56
|
-
declare const wake: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<Info$
|
|
57
|
-
declare const stop: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<Info$
|
|
2129
|
+
} | undefined) => Effect.Effect<readonly Info$3[], never, Controller>;
|
|
2130
|
+
declare const refresh: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<Info$3, SandboxRefreshError, Controller>;
|
|
2131
|
+
declare const wake: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<Info$3, SandboxWakeError, Controller>;
|
|
2132
|
+
declare const stop: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<Info$3, SandboxStopError, Controller>;
|
|
58
2133
|
declare const destroy: (id: string & import("effect/Brand").Brand<"SandboxInstance.ID">) => Effect.Effect<void, SandboxDestroyError, Controller>;
|
|
59
2134
|
declare const Drivers: {
|
|
60
2135
|
readonly memory: Driver;
|
|
@@ -71,13 +2146,13 @@ interface Options {
|
|
|
71
2146
|
readonly sandboxes?: ReadonlyArray<Driver>;
|
|
72
2147
|
readonly llm?: Open;
|
|
73
2148
|
}
|
|
74
|
-
declare const layer: (options?: Options) => Layer.Layer<Controller | Registry | Service | Service$
|
|
2149
|
+
declare const layer: (options?: Options) => Layer.Layer<Controller | Registry | Service | Service$10 | Service$8 | Service$6 | Service$5 | Service$4 | Service$2 | Service$1 | SqlClient$1.SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient, import("effect/Config").ConfigError | SandboxDriverRegistrationError, never>;
|
|
75
2150
|
declare namespace tools_d_exports {
|
|
76
2151
|
export { tools_d_exports as Tools, bash };
|
|
77
2152
|
}
|
|
78
2153
|
declare const bash: "bash";
|
|
79
2154
|
declare namespace session_d_exports {
|
|
80
|
-
export { AbsolutePath, AttachInput, CreateInput, Handle, Info, ModelConfig, PromptInput, RuntimeInput, session_d_exports as Session, schema_d_exports as SessionMessageSchema, schema_d_exports$1 as SessionSchema, SystemPromptConfig, ToolsConfig, attach, create, get };
|
|
2155
|
+
export { AbsolutePath, AttachInput, CreateInput, Handle, Info, ModelConfig, PromptInput, RuntimeInput, session_d_exports as Session, schema_d_exports as SessionMessageSchema, schema_d_exports$1 as SessionSchema, SystemPromptConfig, ToolsConfig, attach, create$1 as create, get };
|
|
81
2156
|
}
|
|
82
2157
|
interface ModelConfig {
|
|
83
2158
|
readonly provider: string;
|
|
@@ -106,21 +2181,21 @@ interface CreateInput extends RuntimeInput {
|
|
|
106
2181
|
readonly directory?: string;
|
|
107
2182
|
}
|
|
108
2183
|
interface AttachInput extends RuntimeInput {
|
|
109
|
-
readonly sessionId: ID;
|
|
2184
|
+
readonly sessionId: ID$1;
|
|
110
2185
|
}
|
|
111
2186
|
type PromptInput = string | {
|
|
112
2187
|
readonly text: string;
|
|
113
2188
|
readonly delivery?: Delivery;
|
|
114
|
-
readonly id?: ID
|
|
2189
|
+
readonly id?: ID;
|
|
115
2190
|
};
|
|
116
2191
|
interface Info {
|
|
117
|
-
readonly id: ID;
|
|
2192
|
+
readonly id: ID$1;
|
|
118
2193
|
readonly title: string;
|
|
119
2194
|
readonly directory: AbsolutePath;
|
|
120
2195
|
readonly sandbox?: Info$1;
|
|
121
2196
|
}
|
|
122
2197
|
interface Handle {
|
|
123
|
-
readonly id: ID;
|
|
2198
|
+
readonly id: ID$1;
|
|
124
2199
|
readonly active: Effect.Effect<boolean>;
|
|
125
2200
|
readonly info: Effect.Effect<Info, SessionNotFoundError>;
|
|
126
2201
|
readonly prompt: (input: PromptInput) => ReturnType<Interface$1["prompt"]>;
|
|
@@ -132,14 +2207,14 @@ interface Handle {
|
|
|
132
2207
|
}) => Stream.Stream<Payload>;
|
|
133
2208
|
readonly path: () => Effect.Effect<ReadonlyArray<HydratedEntry>>;
|
|
134
2209
|
}
|
|
135
|
-
declare const create: (input?: CreateInput | undefined) => Effect.Effect<{
|
|
2210
|
+
declare const create$1: (input?: CreateInput | undefined) => Effect.Effect<{
|
|
136
2211
|
id: string & import("effect/Brand").Brand<"Session.ID">;
|
|
137
2212
|
active: Effect.Effect<boolean, never, never>;
|
|
138
2213
|
info: Effect.Effect<{
|
|
139
2214
|
id: string & import("effect/Brand").Brand<"Session.ID">;
|
|
140
2215
|
title: string;
|
|
141
2216
|
directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
142
|
-
sandbox?: Info$
|
|
2217
|
+
sandbox?: Info$3;
|
|
143
2218
|
}, SessionNotFoundError, never>;
|
|
144
2219
|
prompt: (input: PromptInput) => Effect.Effect<Admitted, PromptConflictError | SessionNotFoundError, never>;
|
|
145
2220
|
run: (input: PromptInput) => Effect.Effect<Admitted, PromptConflictError | RunError, never>;
|
|
@@ -149,9 +2224,9 @@ declare const create: (input?: CreateInput | undefined) => Effect.Effect<{
|
|
|
149
2224
|
readonly after?: number;
|
|
150
2225
|
} | undefined) => Stream.Stream<Payload, never, never>;
|
|
151
2226
|
path: () => Effect.Effect<HydratedEntry[], never, never>;
|
|
152
|
-
}, SandboxMountError, Controller | Service$
|
|
153
|
-
declare const get: (sessionId: string & import("effect/Brand").Brand<"Session.ID">) => Effect.Effect<Option.None<Handle> | Option.Some<Handle>, never, Controller | Service$
|
|
154
|
-
declare const attach: (input: AttachInput) => Effect.Effect<Handle, SessionNotFoundError, Controller | Service$
|
|
2227
|
+
}, SandboxMountError, Controller | Service$10 | Service$8 | Service$5 | Service$1 | SqlClient.SqlClient>;
|
|
2228
|
+
declare const get: (sessionId: string & import("effect/Brand").Brand<"Session.ID">) => Effect.Effect<Option.None<Handle> | Option.Some<Handle>, never, Controller | Service$10 | Service$8 | Service$1>;
|
|
2229
|
+
declare const attach: (input: AttachInput) => Effect.Effect<Handle, SessionNotFoundError, Controller | Service$10 | Service$8 | Service$5 | Service$1>;
|
|
155
2230
|
//#endregion
|
|
156
|
-
export { harness_d_exports as Harness, sandbox_d_exports as Sandbox, session_d_exports as Session, tool_d_exports as Tool, tools_d_exports as Tools };
|
|
2231
|
+
export { harness_d_exports as Harness, run_d_exports as Runner, sandbox_d_exports as Sandbox, session_d_exports as Session, tool_d_exports as Tool, tools_d_exports as Tools };
|
|
157
2232
|
//# sourceMappingURL=effect.d.mts.map
|