@relayfx/sdk 0.0.41 → 0.0.42
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/dist/ai.js +317 -275
- package/dist/index.js +461 -419
- package/package.json +3 -3
package/dist/ai.js
CHANGED
|
@@ -8318,7 +8318,7 @@ __export(exports_agent_loop_service, {
|
|
|
8318
8318
|
AgentLoopBudgetExceeded: () => AgentLoopBudgetExceeded
|
|
8319
8319
|
});
|
|
8320
8320
|
|
|
8321
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8321
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/agent.ts
|
|
8322
8322
|
var exports_agent = {};
|
|
8323
8323
|
__export(exports_agent, {
|
|
8324
8324
|
streamObject: () => streamObject,
|
|
@@ -8328,10 +8328,10 @@ __export(exports_agent, {
|
|
|
8328
8328
|
generate: () => generate,
|
|
8329
8329
|
defaultObjectPrompt: () => defaultObjectPrompt
|
|
8330
8330
|
});
|
|
8331
|
-
import { Cause as Cause3, Effect as Effect45, Fiber, Option as Option15, Queue as Queue2, Ref as Ref10, Schema as
|
|
8331
|
+
import { Cause as Cause3, Effect as Effect45, Fiber, Option as Option15, Queue as Queue2, Ref as Ref10, Schema as Schema46, Stream as Stream7 } from "effect";
|
|
8332
8332
|
import { Chat, LanguageModel as LanguageModel3, Prompt as Prompt4, Response as Response3, Telemetry, Tokenizer as Tokenizer2, Tool as Tool4, Toolkit as Toolkit3 } from "effect/unstable/ai";
|
|
8333
8333
|
|
|
8334
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8334
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/agent-event.ts
|
|
8335
8335
|
var exports_agent_event = {};
|
|
8336
8336
|
__export(exports_agent_event, {
|
|
8337
8337
|
addUsage: () => addUsage,
|
|
@@ -8388,7 +8388,7 @@ class AgentSuspended extends Schema38.TaggedErrorClass()("@batonfx/core/AgentSus
|
|
|
8388
8388
|
}) {
|
|
8389
8389
|
}
|
|
8390
8390
|
|
|
8391
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8391
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/approvals.ts
|
|
8392
8392
|
var exports_approvals = {};
|
|
8393
8393
|
__export(exports_approvals, {
|
|
8394
8394
|
testLayer: () => testLayer26,
|
|
@@ -8404,7 +8404,7 @@ var autoApprove = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect3
|
|
|
8404
8404
|
var denyAll = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect31.succeed({ _tag: "Denied" }) }));
|
|
8405
8405
|
var testLayer26 = (implementation) => Layer29.succeed(Approvals, Approvals.of(implementation));
|
|
8406
8406
|
|
|
8407
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8407
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/compaction.ts
|
|
8408
8408
|
var exports_compaction = {};
|
|
8409
8409
|
__export(exports_compaction, {
|
|
8410
8410
|
truncate: () => truncate,
|
|
@@ -8422,7 +8422,7 @@ __export(exports_compaction, {
|
|
|
8422
8422
|
import { Context as Context32, Effect as Effect34, Layer as Layer32, Option as Option10, Schema as Schema41 } from "effect";
|
|
8423
8423
|
import { LanguageModel, Prompt as Prompt3, Tokenizer, Toolkit as Toolkit2 } from "effect/unstable/ai";
|
|
8424
8424
|
|
|
8425
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8425
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/session.ts
|
|
8426
8426
|
var exports_session = {};
|
|
8427
8427
|
__export(exports_session, {
|
|
8428
8428
|
testLayer: () => testLayer27,
|
|
@@ -8554,7 +8554,7 @@ var memoryLayer24 = Layer30.effect(SessionStore, Ref7.make(initialState).pipe(Ef
|
|
|
8554
8554
|
}))));
|
|
8555
8555
|
var testLayer27 = (implementation) => Layer30.succeed(SessionStore, SessionStore.of(implementation));
|
|
8556
8556
|
|
|
8557
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8557
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/tool-output.ts
|
|
8558
8558
|
var exports_tool_output = {};
|
|
8559
8559
|
__export(exports_tool_output, {
|
|
8560
8560
|
testLayer: () => testLayer28,
|
|
@@ -8614,7 +8614,7 @@ var bound = (result, options) => Effect33.gen(function* () {
|
|
|
8614
8614
|
return { _tag: "Success", result: output, encodedResult: output };
|
|
8615
8615
|
});
|
|
8616
8616
|
|
|
8617
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8617
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/compaction.ts
|
|
8618
8618
|
var DEFAULT_RESERVE_TOKENS = 16384;
|
|
8619
8619
|
var DEFAULT_KEEP_RECENT_TOKENS = 20000;
|
|
8620
8620
|
var SUMMARY_TEMPLATE = `Summarize the conversation so another agent can continue seamlessly.
|
|
@@ -8797,7 +8797,7 @@ var truncate = (maxTokens) => ({
|
|
|
8797
8797
|
var testLayer29 = (implementation) => Layer32.succeed(Compaction, Compaction.of(implementation));
|
|
8798
8798
|
var isContextOverflow = (error) => /context|token|prompt/i.test(error instanceof Error ? `${error.name}: ${error.message}` : String(error)) && /overflow|exceed|exceeded|maximum|too large|too long|length/i.test(error instanceof Error ? `${error.name}: ${error.message}` : String(error));
|
|
8799
8799
|
|
|
8800
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8800
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/instructions.ts
|
|
8801
8801
|
var exports_instructions = {};
|
|
8802
8802
|
__export(exports_instructions, {
|
|
8803
8803
|
testLayer: () => testLayer30,
|
|
@@ -8846,7 +8846,7 @@ var renderUpdate = (epoch, context) => Effect35.gen(function* () {
|
|
|
8846
8846
|
var layer27 = (sources) => Layer33.succeed(Instructions, Instructions.of({ sources: [...sources] }));
|
|
8847
8847
|
var testLayer30 = (implementation) => Layer33.succeed(Instructions, Instructions.of(implementation));
|
|
8848
8848
|
|
|
8849
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8849
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/memory.ts
|
|
8850
8850
|
var exports_memory = {};
|
|
8851
8851
|
__export(exports_memory, {
|
|
8852
8852
|
testLayer: () => testLayer31,
|
|
@@ -8875,7 +8875,7 @@ var merge = (first, second) => ({
|
|
|
8875
8875
|
var noopLayer = Layer34.succeed(Memory, Memory.of(noop));
|
|
8876
8876
|
var testLayer31 = (implementation) => Layer34.succeed(Memory, Memory.of(implementation));
|
|
8877
8877
|
|
|
8878
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8878
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/model-middleware.ts
|
|
8879
8879
|
var exports_model_middleware = {};
|
|
8880
8880
|
__export(exports_model_middleware, {
|
|
8881
8881
|
layer: () => layer28,
|
|
@@ -8889,7 +8889,7 @@ class ModelMiddleware extends Context35.Service()("@batonfx/core/ModelMiddleware
|
|
|
8889
8889
|
var identityLayer = Layer35.succeed(ModelMiddleware, []);
|
|
8890
8890
|
var layer28 = (middleware) => Layer35.succeed(ModelMiddleware, middleware);
|
|
8891
8891
|
|
|
8892
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8892
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/model-resilience.ts
|
|
8893
8893
|
var exports_model_resilience = {};
|
|
8894
8894
|
__export(exports_model_resilience, {
|
|
8895
8895
|
testLayer: () => testLayer32,
|
|
@@ -8935,7 +8935,7 @@ var apply = (model, resilience) => ({
|
|
|
8935
8935
|
}).pipe(Stream5.retry(retryStreamSchedule(resilience)))
|
|
8936
8936
|
});
|
|
8937
8937
|
|
|
8938
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8938
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/permissions.ts
|
|
8939
8939
|
var exports_permissions = {};
|
|
8940
8940
|
__export(exports_permissions, {
|
|
8941
8941
|
testLayer: () => testLayer33,
|
|
@@ -9065,7 +9065,7 @@ var ruleStoreMemory = (initialRules = []) => Layer37.effect(RuleStore, Ref9.make
|
|
|
9065
9065
|
var ruleStoreTestLayer = (implementation) => Layer37.succeed(RuleStore, RuleStore.of(implementation));
|
|
9066
9066
|
var testLayer33 = (implementation) => Layer37.succeed(Permissions, Permissions.of(implementation));
|
|
9067
9067
|
|
|
9068
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9068
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/skill-source.ts
|
|
9069
9069
|
var exports_skill_source = {};
|
|
9070
9070
|
__export(exports_skill_source, {
|
|
9071
9071
|
testLayer: () => testLayer34,
|
|
@@ -9123,7 +9123,7 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
9123
9123
|
return selected;
|
|
9124
9124
|
};
|
|
9125
9125
|
|
|
9126
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9126
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/steering.ts
|
|
9127
9127
|
var exports_steering = {};
|
|
9128
9128
|
__export(exports_steering, {
|
|
9129
9129
|
testLayer: () => testLayer35,
|
|
@@ -9153,7 +9153,7 @@ var layer30 = (options = {}) => Layer39.effect(Steering, Effect41.gen(function*
|
|
|
9153
9153
|
}));
|
|
9154
9154
|
var testLayer35 = (implementation) => Layer39.succeed(Steering, Steering.of(implementation));
|
|
9155
9155
|
|
|
9156
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9156
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/tool-context.ts
|
|
9157
9157
|
var exports_tool_context = {};
|
|
9158
9158
|
__export(exports_tool_context, {
|
|
9159
9159
|
testLayer: () => testLayer36,
|
|
@@ -9171,18 +9171,22 @@ var layerDefault = Layer40.sync(ToolContext, () => ToolContext.of({
|
|
|
9171
9171
|
}));
|
|
9172
9172
|
var testLayer36 = (implementation) => Layer40.succeed(ToolContext, ToolContext.of(implementation));
|
|
9173
9173
|
|
|
9174
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9174
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/tool-executor.ts
|
|
9175
9175
|
var exports_tool_executor = {};
|
|
9176
9176
|
__export(exports_tool_executor, {
|
|
9177
9177
|
testLayer: () => testLayer37,
|
|
9178
|
+
sandbox: () => sandbox,
|
|
9178
9179
|
router: () => router,
|
|
9179
9180
|
routeToolkit: () => routeToolkit,
|
|
9180
9181
|
route: () => route,
|
|
9182
|
+
remote: () => remote,
|
|
9183
|
+
mcp: () => mcp,
|
|
9181
9184
|
fromToolkit: () => fromToolkit,
|
|
9182
9185
|
executeToolkit: () => executeToolkit,
|
|
9186
|
+
client: () => client,
|
|
9183
9187
|
ToolExecutor: () => ToolExecutor
|
|
9184
9188
|
});
|
|
9185
|
-
import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Sink as Sink2, Stream as Stream6 } from "effect";
|
|
9189
|
+
import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Schema as Schema45, Sink as Sink2, Stream as Stream6 } from "effect";
|
|
9186
9190
|
class ToolExecutor extends Context41.Service()("@batonfx/core/ToolExecutor") {
|
|
9187
9191
|
}
|
|
9188
9192
|
var failureMessage = (cause) => {
|
|
@@ -9202,6 +9206,24 @@ var resultMessage = (result) => {
|
|
|
9202
9206
|
return String(result);
|
|
9203
9207
|
}
|
|
9204
9208
|
};
|
|
9209
|
+
var schemaMessage = (error) => error instanceof Error ? error.message : typeof error === "string" ? error : resultMessage(error);
|
|
9210
|
+
var decodeSuccess = (tool2, result) => {
|
|
9211
|
+
const successSchema = tool2.successSchema;
|
|
9212
|
+
if (!Schema45.isSchema(successSchema)) {
|
|
9213
|
+
return Effect43.succeed({ _tag: "Success", result, encodedResult: result });
|
|
9214
|
+
}
|
|
9215
|
+
return Schema45.decodeUnknownEffect(successSchema)(result).pipe(Effect43.flatMap((decoded) => Schema45.encodeUnknownEffect(successSchema)(decoded).pipe(Effect43.map((encoded) => ({ _tag: "Success", result: decoded, encodedResult: encoded })))), Effect43.catchCause((cause) => Effect43.succeed(failureOutcome(`invalid client result: ${schemaMessage(Cause2.squash(cause))}`))));
|
|
9216
|
+
};
|
|
9217
|
+
var placementOutcome = (placement, tool2, response) => {
|
|
9218
|
+
switch (response._tag) {
|
|
9219
|
+
case "Failure":
|
|
9220
|
+
return Effect43.succeed(failureOutcome(response.message));
|
|
9221
|
+
case "Suspend":
|
|
9222
|
+
return Effect43.succeed({ _tag: "Suspend", token: response.token });
|
|
9223
|
+
case "Success":
|
|
9224
|
+
return decodeSuccess(tool2, response.result).pipe(Effect43.map((outcome) => outcome._tag === "Failure" ? failureOutcome(outcome.message.replace("invalid client result", `invalid ${placement} result`)) : outcome));
|
|
9225
|
+
}
|
|
9226
|
+
};
|
|
9205
9227
|
var executeWithToolkit = (toolkit, request) => {
|
|
9206
9228
|
if (toolkit.tools[request.call.name] === undefined) {
|
|
9207
9229
|
return Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`));
|
|
@@ -9239,6 +9261,24 @@ var route = (options) => {
|
|
|
9239
9261
|
execute: options.execute
|
|
9240
9262
|
};
|
|
9241
9263
|
};
|
|
9264
|
+
var placementRoute = (placement, options) => {
|
|
9265
|
+
const routedTools = options.tools ?? Object.keys(options.toolkit.tools);
|
|
9266
|
+
return route({
|
|
9267
|
+
tools: routedTools,
|
|
9268
|
+
execute: (request) => {
|
|
9269
|
+
const tool2 = options.toolkit.tools[request.call.name];
|
|
9270
|
+
if (tool2 === undefined)
|
|
9271
|
+
return Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`));
|
|
9272
|
+
const effect = options.execute({ ...request, placement, tool: tool2 });
|
|
9273
|
+
const scheduled = "schedule" in options && options.schedule !== undefined ? Effect43.retry(effect, options.schedule) : effect;
|
|
9274
|
+
return scheduled.pipe(Effect43.flatMap((response) => placementOutcome(placement, tool2, response)), Effect43.catchCause((cause) => Cause2.hasInterrupts(cause) ? Effect43.interrupt : Effect43.succeed(failureOutcome(`${placement} tool infrastructure failed: ${failureMessage(cause)}`))));
|
|
9275
|
+
}
|
|
9276
|
+
});
|
|
9277
|
+
};
|
|
9278
|
+
var client = (options) => placementRoute("client", options);
|
|
9279
|
+
var remote = (options) => placementRoute("remote", options);
|
|
9280
|
+
var mcp = (options) => placementRoute("mcp", options);
|
|
9281
|
+
var sandbox = (options) => placementRoute("sandbox", options);
|
|
9242
9282
|
function routeToolkit(toolkit) {
|
|
9243
9283
|
const makeRoute = (handled) => route({
|
|
9244
9284
|
tools: Object.keys(handled.tools),
|
|
@@ -9247,15 +9287,17 @@ function routeToolkit(toolkit) {
|
|
|
9247
9287
|
return "handle" in toolkit ? makeRoute(toolkit) : toolkit.pipe(Effect43.map(makeRoute));
|
|
9248
9288
|
}
|
|
9249
9289
|
var routeInputEffect = (input) => Effect43.isEffect(input) ? input : Effect43.succeed(input);
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
}
|
|
9290
|
+
function router(routes) {
|
|
9291
|
+
return Layer41.effect(ToolExecutor, Effect43.all(Array.from(routes, routeInputEffect)).pipe(Effect43.map((resolved) => ToolExecutor.of({
|
|
9292
|
+
execute: (request) => {
|
|
9293
|
+
const matched = resolved.find((candidate) => candidate.matches(request));
|
|
9294
|
+
return matched === undefined ? Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`)) : matched.execute(request);
|
|
9295
|
+
}
|
|
9296
|
+
}))));
|
|
9297
|
+
}
|
|
9256
9298
|
var testLayer37 = (implementation) => Layer41.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
9257
9299
|
|
|
9258
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9300
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/turn-policy.ts
|
|
9259
9301
|
var exports_turn_policy = {};
|
|
9260
9302
|
__export(exports_turn_policy, {
|
|
9261
9303
|
untilToolCall: () => untilToolCall,
|
|
@@ -9294,7 +9336,7 @@ var both = (first, second) => make4((info) => Effect44.gen(function* () {
|
|
|
9294
9336
|
}));
|
|
9295
9337
|
var defaultPolicy = recurs(8);
|
|
9296
9338
|
|
|
9297
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9339
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/agent.ts
|
|
9298
9340
|
function make5(nameOrOptions, options = {}) {
|
|
9299
9341
|
const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
|
|
9300
9342
|
return {
|
|
@@ -9307,14 +9349,14 @@ function make5(nameOrOptions, options = {}) {
|
|
|
9307
9349
|
var defaultObjectPrompt = "Return the final structured output for the task above.";
|
|
9308
9350
|
var skillListingBudgetTokens = 2048;
|
|
9309
9351
|
var activateSkillToolName = "activate_skill";
|
|
9310
|
-
var activateSkillParameters =
|
|
9352
|
+
var activateSkillParameters = Schema46.Struct({ name: Schema46.String });
|
|
9311
9353
|
var activateSkillTool = Tool4.make(activateSkillToolName, {
|
|
9312
9354
|
description: "Load the full body for one listed Baton skill by name before applying that skill.",
|
|
9313
9355
|
parameters: activateSkillParameters,
|
|
9314
|
-
success:
|
|
9315
|
-
name:
|
|
9316
|
-
body:
|
|
9317
|
-
allowedTools:
|
|
9356
|
+
success: Schema46.Struct({
|
|
9357
|
+
name: Schema46.String,
|
|
9358
|
+
body: Schema46.String,
|
|
9359
|
+
allowedTools: Schema46.Array(Schema46.String)
|
|
9318
9360
|
})
|
|
9319
9361
|
});
|
|
9320
9362
|
var errorMessage = (error) => error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
@@ -9617,7 +9659,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9617
9659
|
const activateSkillOutcome = (turn, call) => Effect45.gen(function* () {
|
|
9618
9660
|
if (skillRuntime === undefined)
|
|
9619
9661
|
return { _tag: "Failure", message: "SkillSource is not available" };
|
|
9620
|
-
const params =
|
|
9662
|
+
const params = Schema46.decodeUnknownOption(activateSkillParameters)(call.params);
|
|
9621
9663
|
if (Option15.isNone(params))
|
|
9622
9664
|
return { _tag: "Failure", message: "Skill activation requires a name" };
|
|
9623
9665
|
const skill = yield* skillRuntime.source.get(params.value.name).pipe(Effect45.mapError((error) => skillError(turn, error)));
|
|
@@ -9971,14 +10013,14 @@ var generateObject = (agent, options) => Stream7.runFold(streamObject(agent, opt
|
|
|
9971
10013
|
})
|
|
9972
10014
|
})
|
|
9973
10015
|
})));
|
|
9974
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10016
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/agent-tool.ts
|
|
9975
10017
|
var exports_agent_tool = {};
|
|
9976
10018
|
__export(exports_agent_tool, {
|
|
9977
10019
|
asTool: () => asTool
|
|
9978
10020
|
});
|
|
9979
|
-
import { Cause as Cause4, Effect as Effect46, Schema as
|
|
10021
|
+
import { Cause as Cause4, Effect as Effect46, Schema as Schema47 } from "effect";
|
|
9980
10022
|
import { Tool as Tool5, Toolkit as Toolkit4 } from "effect/unstable/ai";
|
|
9981
|
-
var defaultParameters =
|
|
10023
|
+
var defaultParameters = Schema47.Struct({ prompt: Schema47.String });
|
|
9982
10024
|
var errorMessage2 = (error) => {
|
|
9983
10025
|
if (error instanceof AgentSuspended) {
|
|
9984
10026
|
return `suspended on ${error.tool_name}: ${error.reason}`;
|
|
@@ -10004,14 +10046,14 @@ var lazyHandled = (toolkit, name, handler) => ({
|
|
|
10004
10046
|
var asTool = (agent, options = {}) => {
|
|
10005
10047
|
const name = options.name ?? agent.name;
|
|
10006
10048
|
const parameters = options.parameters ?? defaultParameters;
|
|
10007
|
-
const success2 = options.success ??
|
|
10049
|
+
const success2 = options.success ?? Schema47.String;
|
|
10008
10050
|
const toPrompt = options.toPrompt ?? ((params) => params.prompt);
|
|
10009
10051
|
const fromResult = options.fromResult ?? ((result) => result.text);
|
|
10010
10052
|
const tool2 = Tool5.make(name, {
|
|
10011
10053
|
...options.description === undefined ? {} : { description: options.description },
|
|
10012
10054
|
parameters,
|
|
10013
10055
|
success: success2,
|
|
10014
|
-
failure:
|
|
10056
|
+
failure: Schema47.String,
|
|
10015
10057
|
failureMode: "return"
|
|
10016
10058
|
});
|
|
10017
10059
|
const toolkit = Toolkit4.make(tool2);
|
|
@@ -10029,7 +10071,7 @@ var asTool = (agent, options = {}) => {
|
|
|
10029
10071
|
});
|
|
10030
10072
|
return lazyHandled(toolkit, name, handler);
|
|
10031
10073
|
};
|
|
10032
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10074
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/guardrail.ts
|
|
10033
10075
|
var exports_guardrail = {};
|
|
10034
10076
|
__export(exports_guardrail, {
|
|
10035
10077
|
validateInput: () => validateInput2,
|
|
@@ -10109,16 +10151,16 @@ var redactOutput = (options) => ({
|
|
|
10109
10151
|
var filterOutput = (keep) => ({
|
|
10110
10152
|
transformPart: (part, context) => Effect47.succeed(part.type === "tool-call" || keep(part, context) ? Option16.some(part) : Option16.none())
|
|
10111
10153
|
});
|
|
10112
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10154
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/handoff.ts
|
|
10113
10155
|
var exports_handoff = {};
|
|
10114
10156
|
__export(exports_handoff, {
|
|
10115
10157
|
transferTool: () => transferTool,
|
|
10116
10158
|
supervisor: () => supervisor,
|
|
10117
10159
|
fanOut: () => fanOut
|
|
10118
10160
|
});
|
|
10119
|
-
import { Effect as Effect48, Schema as
|
|
10161
|
+
import { Effect as Effect48, Schema as Schema48 } from "effect";
|
|
10120
10162
|
import { AiError as AiError2, Toolkit as Toolkit5 } from "effect/unstable/ai";
|
|
10121
|
-
var defaultTransferParameters =
|
|
10163
|
+
var defaultTransferParameters = Schema48.Struct({ prompt: Schema48.String });
|
|
10122
10164
|
var transferName = (agentName) => `transfer_to_${agentName}`;
|
|
10123
10165
|
var positiveConcurrency = (value) => {
|
|
10124
10166
|
const concurrency = value ?? 4;
|
|
@@ -10172,7 +10214,7 @@ var supervisor = (options) => {
|
|
|
10172
10214
|
toolkit
|
|
10173
10215
|
};
|
|
10174
10216
|
};
|
|
10175
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10217
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/model-registry.ts
|
|
10176
10218
|
var exports_model_registry = {};
|
|
10177
10219
|
__export(exports_model_registry, {
|
|
10178
10220
|
testLayer: () => testLayer38,
|
|
@@ -10187,13 +10229,13 @@ __export(exports_model_registry, {
|
|
|
10187
10229
|
Service: () => Service29,
|
|
10188
10230
|
LanguageModelNotRegistered: () => LanguageModelNotRegistered
|
|
10189
10231
|
});
|
|
10190
|
-
import { Chunk as Chunk2, Context as Context42, Effect as Effect49, Layer as Layer43, Option as Option17, Ref as Ref11, Schema as
|
|
10232
|
+
import { Chunk as Chunk2, Context as Context42, Effect as Effect49, Layer as Layer43, Option as Option17, Ref as Ref11, Schema as Schema49, Semaphore as Semaphore3 } from "effect";
|
|
10191
10233
|
import { Model } from "effect/unstable/ai";
|
|
10192
10234
|
|
|
10193
|
-
class LanguageModelNotRegistered extends
|
|
10194
|
-
provider:
|
|
10195
|
-
model:
|
|
10196
|
-
registration_key:
|
|
10235
|
+
class LanguageModelNotRegistered extends Schema49.TaggedErrorClass()("LanguageModelNotRegistered", {
|
|
10236
|
+
provider: Schema49.String,
|
|
10237
|
+
model: Schema49.String,
|
|
10238
|
+
registration_key: Schema49.optionalKey(Schema49.String)
|
|
10197
10239
|
}) {
|
|
10198
10240
|
}
|
|
10199
10241
|
|
|
@@ -10261,7 +10303,7 @@ var provide = (selection, effect) => Effect49.gen(function* () {
|
|
|
10261
10303
|
return yield* service.provide(selection, effect);
|
|
10262
10304
|
});
|
|
10263
10305
|
|
|
10264
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10306
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.1/node_modules/@batonfx/core/src/index.ts
|
|
10265
10307
|
import {
|
|
10266
10308
|
AiError as AiError3,
|
|
10267
10309
|
Chat as Chat2,
|
|
@@ -10279,7 +10321,7 @@ import {
|
|
|
10279
10321
|
} from "effect/unstable/ai";
|
|
10280
10322
|
|
|
10281
10323
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
10282
|
-
import { Config as Config3, Context as Context54, Crypto as Crypto3, Effect as Effect67, HashSet as HashSet6, Layer as Layer60, Option as Option22, Ref as Ref18, Schema as
|
|
10324
|
+
import { Config as Config3, Context as Context54, Crypto as Crypto3, Effect as Effect67, HashSet as HashSet6, Layer as Layer60, Option as Option22, Ref as Ref18, Schema as Schema62, Stream as Stream8 } from "effect";
|
|
10283
10325
|
import { Chat as Chat3, LanguageModel as LanguageModel6, Prompt as Prompt12, Tokenizer as Tokenizer4, Toolkit as Toolkit7 } from "effect/unstable/ai";
|
|
10284
10326
|
|
|
10285
10327
|
// ../runtime/src/child/child-run-service.ts
|
|
@@ -10299,31 +10341,31 @@ __export(exports_child_run_service, {
|
|
|
10299
10341
|
ChildRunScopeBroadened: () => ChildRunScopeBroadened,
|
|
10300
10342
|
ChildRunModelMissing: () => ChildRunModelMissing
|
|
10301
10343
|
});
|
|
10302
|
-
import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as
|
|
10344
|
+
import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as Schema51 } from "effect";
|
|
10303
10345
|
|
|
10304
10346
|
// ../runtime/src/workspace/workspace-provider-service.ts
|
|
10305
|
-
import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as
|
|
10347
|
+
import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as Schema50 } from "effect";
|
|
10306
10348
|
|
|
10307
|
-
class WorkspaceNotFound extends
|
|
10349
|
+
class WorkspaceNotFound extends Schema50.TaggedErrorClass()("WorkspaceNotFound", {
|
|
10308
10350
|
sandbox_ref: exports_ids_schema.WorkspaceRef
|
|
10309
10351
|
}) {
|
|
10310
10352
|
}
|
|
10311
10353
|
|
|
10312
|
-
class WorkspaceUnavailable extends
|
|
10354
|
+
class WorkspaceUnavailable extends Schema50.TaggedErrorClass()("WorkspaceUnavailable", {
|
|
10313
10355
|
sandbox_ref: exports_ids_schema.WorkspaceRef,
|
|
10314
|
-
message:
|
|
10356
|
+
message: Schema50.String
|
|
10315
10357
|
}) {
|
|
10316
10358
|
}
|
|
10317
10359
|
|
|
10318
|
-
class WorkspaceCapabilityUnsupported extends
|
|
10319
|
-
capability:
|
|
10360
|
+
class WorkspaceCapabilityUnsupported extends Schema50.TaggedErrorClass()("WorkspaceCapabilityUnsupported", {
|
|
10361
|
+
capability: Schema50.Literals(["suspend", "snapshot", "fork"]),
|
|
10320
10362
|
provider_key: exports_workspace_schema.WorkspaceProviderKey
|
|
10321
10363
|
}) {
|
|
10322
10364
|
}
|
|
10323
10365
|
|
|
10324
|
-
class WorkspaceProviderError extends
|
|
10366
|
+
class WorkspaceProviderError extends Schema50.TaggedErrorClass()("WorkspaceProviderError", {
|
|
10325
10367
|
provider_key: exports_workspace_schema.WorkspaceProviderKey,
|
|
10326
|
-
message:
|
|
10368
|
+
message: Schema50.String
|
|
10327
10369
|
}) {
|
|
10328
10370
|
}
|
|
10329
10371
|
|
|
@@ -10355,28 +10397,28 @@ var destroy = Effect50.fn("WorkspaceProvider.destroy.call")(function* (ref) {
|
|
|
10355
10397
|
});
|
|
10356
10398
|
|
|
10357
10399
|
// ../runtime/src/child/child-run-service.ts
|
|
10358
|
-
class StaticChildRunPresetNotFound extends
|
|
10400
|
+
class StaticChildRunPresetNotFound extends Schema51.TaggedErrorClass()("StaticChildRunPresetNotFound", {
|
|
10359
10401
|
preset_name: exports_shared_schema.NonEmptyString
|
|
10360
10402
|
}) {
|
|
10361
10403
|
}
|
|
10362
10404
|
|
|
10363
|
-
class ChildRunScopeBroadened extends
|
|
10364
|
-
field:
|
|
10405
|
+
class ChildRunScopeBroadened extends Schema51.TaggedErrorClass()("ChildRunScopeBroadened", {
|
|
10406
|
+
field: Schema51.Literals(["tool_names", "permissions"]),
|
|
10365
10407
|
value: exports_shared_schema.NonEmptyString
|
|
10366
10408
|
}) {
|
|
10367
10409
|
}
|
|
10368
10410
|
|
|
10369
|
-
class ChildRunServiceError extends
|
|
10370
|
-
message:
|
|
10411
|
+
class ChildRunServiceError extends Schema51.TaggedErrorClass()("ChildRunServiceError", {
|
|
10412
|
+
message: Schema51.String
|
|
10371
10413
|
}) {
|
|
10372
10414
|
}
|
|
10373
10415
|
|
|
10374
|
-
class ChildRunWorkspaceUnavailable extends
|
|
10375
|
-
reason:
|
|
10416
|
+
class ChildRunWorkspaceUnavailable extends Schema51.TaggedErrorClass()("ChildRunWorkspaceUnavailable", {
|
|
10417
|
+
reason: Schema51.String
|
|
10376
10418
|
}) {
|
|
10377
10419
|
}
|
|
10378
10420
|
|
|
10379
|
-
class ChildRunModelMissing extends
|
|
10421
|
+
class ChildRunModelMissing extends Schema51.TaggedErrorClass()("ChildRunModelMissing", {}) {
|
|
10380
10422
|
}
|
|
10381
10423
|
|
|
10382
10424
|
class Service31 extends Context44.Service()("@relayfx/runtime/ChildRunService") {
|
|
@@ -10604,26 +10646,26 @@ var spawnDynamic = Effect51.fn("ChildRunService.spawnDynamic.call")(function* (i
|
|
|
10604
10646
|
});
|
|
10605
10647
|
|
|
10606
10648
|
// ../runtime/src/child/spawn-child-run-tool.ts
|
|
10607
|
-
import { Effect as Effect52, Schema as
|
|
10649
|
+
import { Effect as Effect52, Schema as Schema52 } from "effect";
|
|
10608
10650
|
var toolName = "spawn_child_run";
|
|
10609
10651
|
var permissionName = "relay.child_run.spawn";
|
|
10610
|
-
var Input =
|
|
10611
|
-
preset_name:
|
|
10612
|
-
instructions:
|
|
10613
|
-
model:
|
|
10614
|
-
tool_names:
|
|
10615
|
-
permissions:
|
|
10616
|
-
output_schema_ref:
|
|
10617
|
-
metadata:
|
|
10618
|
-
input:
|
|
10652
|
+
var Input = Schema52.Struct({
|
|
10653
|
+
preset_name: Schema52.optionalKey(exports_shared_schema.NonEmptyString),
|
|
10654
|
+
instructions: Schema52.optionalKey(Schema52.String),
|
|
10655
|
+
model: Schema52.optionalKey(exports_agent_schema.ModelSelection),
|
|
10656
|
+
tool_names: Schema52.optionalKey(Schema52.Array(Schema52.String)),
|
|
10657
|
+
permissions: Schema52.optionalKey(Schema52.Array(Schema52.String)),
|
|
10658
|
+
output_schema_ref: Schema52.optionalKey(Schema52.String),
|
|
10659
|
+
metadata: Schema52.optionalKey(exports_shared_schema.Metadata),
|
|
10660
|
+
input: Schema52.optionalKey(Schema52.Array(exports_content_schema.Part))
|
|
10619
10661
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Input" });
|
|
10620
|
-
var Output =
|
|
10662
|
+
var Output = Schema52.Struct({
|
|
10621
10663
|
child_execution_id: exports_ids_schema.ChildExecutionId,
|
|
10622
|
-
status:
|
|
10623
|
-
output:
|
|
10664
|
+
status: Schema52.Literals(["completed", "failed", "cancelled"]),
|
|
10665
|
+
output: Schema52.Array(exports_content_schema.Part)
|
|
10624
10666
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Output" });
|
|
10625
|
-
var TransferInput =
|
|
10626
|
-
input:
|
|
10667
|
+
var TransferInput = Schema52.Struct({
|
|
10668
|
+
input: Schema52.optionalKey(Schema52.Array(exports_content_schema.Part))
|
|
10627
10669
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.TransferInput" });
|
|
10628
10670
|
var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
|
|
10629
10671
|
var parentContext = (agent) => ({
|
|
@@ -10810,17 +10852,17 @@ var transferTools = (config) => (config.agent.handoff_targets ?? []).map((target
|
|
|
10810
10852
|
});
|
|
10811
10853
|
|
|
10812
10854
|
// ../runtime/src/memory/memory-service.ts
|
|
10813
|
-
import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as
|
|
10855
|
+
import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as Schema54 } from "effect";
|
|
10814
10856
|
import { EmbeddingModel as EmbeddingModel3, Prompt as Prompt9 } from "effect/unstable/ai";
|
|
10815
10857
|
|
|
10816
10858
|
// ../runtime/src/model/embedding-model-service.ts
|
|
10817
|
-
import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as
|
|
10859
|
+
import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as Schema53 } from "effect";
|
|
10818
10860
|
import { EmbeddingModel as EmbeddingModel2, Model as Model3 } from "effect/unstable/ai";
|
|
10819
10861
|
|
|
10820
|
-
class EmbeddingModelNotRegistered extends
|
|
10821
|
-
provider:
|
|
10822
|
-
model:
|
|
10823
|
-
registration_key:
|
|
10862
|
+
class EmbeddingModelNotRegistered extends Schema53.TaggedErrorClass()("EmbeddingModelNotRegistered", {
|
|
10863
|
+
provider: Schema53.String,
|
|
10864
|
+
model: Schema53.String,
|
|
10865
|
+
registration_key: Schema53.optionalKey(Schema53.String)
|
|
10824
10866
|
}) {
|
|
10825
10867
|
}
|
|
10826
10868
|
|
|
@@ -10946,7 +10988,7 @@ var defaultTopK = 5;
|
|
|
10946
10988
|
var memoryError = (error) => new exports_memory.MemoryError({
|
|
10947
10989
|
message: error instanceof Error ? `${error.name}: ${error.message}` : String(error)
|
|
10948
10990
|
});
|
|
10949
|
-
var decodeSubject = (subject) =>
|
|
10991
|
+
var decodeSubject = (subject) => Schema54.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(subject).pipe(Effect54.mapError(memoryError));
|
|
10950
10992
|
var textPart = (text3) => Prompt9.makePart("text", { text: text3 });
|
|
10951
10993
|
var textFromParts = (parts) => parts.filter((part) => part.type === "text").map((part) => part.text).join(`
|
|
10952
10994
|
`).trim();
|
|
@@ -11140,20 +11182,20 @@ __export(exports_model_call_policy, {
|
|
|
11140
11182
|
defaultClassify: () => defaultClassify2,
|
|
11141
11183
|
Service: () => Service35
|
|
11142
11184
|
});
|
|
11143
|
-
import { Context as Context48, Duration as Duration3, Layer as Layer49, Schedule as
|
|
11185
|
+
import { Context as Context48, Duration as Duration3, Layer as Layer49, Schedule as Schedule4 } from "effect";
|
|
11144
11186
|
import { AiError as AiError4 } from "effect/unstable/ai";
|
|
11145
11187
|
|
|
11146
11188
|
class Service35 extends Context48.Service()("@relayfx/runtime/ModelCallPolicy") {
|
|
11147
11189
|
}
|
|
11148
11190
|
var isOutputValidationError = (error) => AiError4.isAiError(error) ? error.reason._tag === "InvalidOutputError" : AiError4.isAiErrorReason(error) && error._tag === "InvalidOutputError";
|
|
11149
11191
|
var defaultClassify2 = (error) => isOutputValidationError(error) ? "terminal" : exports_model_resilience.defaultClassify(error);
|
|
11150
|
-
var defaultSchedule =
|
|
11192
|
+
var defaultSchedule = Schedule4.exponential(Duration3.seconds(1)).pipe(Schedule4.jittered, Schedule4.both(Schedule4.recurs(4)));
|
|
11151
11193
|
var make7 = (input) => ({
|
|
11152
11194
|
classify: input?.classify ?? defaultClassify2,
|
|
11153
11195
|
retrySchedule: input?.retrySchedule ?? defaultSchedule
|
|
11154
11196
|
});
|
|
11155
11197
|
var layer36 = (input) => Layer49.succeed(Service35, Service35.of(make7(input)));
|
|
11156
|
-
var noRetryLayer = layer36({ retrySchedule:
|
|
11198
|
+
var noRetryLayer = layer36({ retrySchedule: Schedule4.recurs(0) });
|
|
11157
11199
|
var testLayer41 = (implementation) => Layer49.succeed(Service35, Service35.of(implementation));
|
|
11158
11200
|
|
|
11159
11201
|
// ../runtime/src/schema-registry/schema-registry-service.ts
|
|
@@ -11168,9 +11210,9 @@ __export(exports_schema_registry_service, {
|
|
|
11168
11210
|
Service: () => Service36,
|
|
11169
11211
|
SchemaRefNotRegistered: () => SchemaRefNotRegistered
|
|
11170
11212
|
});
|
|
11171
|
-
import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as
|
|
11213
|
+
import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as Schema55 } from "effect";
|
|
11172
11214
|
|
|
11173
|
-
class SchemaRefNotRegistered extends
|
|
11215
|
+
class SchemaRefNotRegistered extends Schema55.TaggedErrorClass()("SchemaRefNotRegistered", { schema_ref: exports_shared_schema.NonEmptyString }) {
|
|
11174
11216
|
}
|
|
11175
11217
|
|
|
11176
11218
|
class Service36 extends Context49.Service()("@relayfx/runtime/SchemaRegistry") {
|
|
@@ -11303,16 +11345,16 @@ __export(exports_blob_store_service, {
|
|
|
11303
11345
|
BlobStoreError: () => BlobStoreError,
|
|
11304
11346
|
BlobNotResolvable: () => BlobNotResolvable
|
|
11305
11347
|
});
|
|
11306
|
-
import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as
|
|
11348
|
+
import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as Schema56 } from "effect";
|
|
11307
11349
|
|
|
11308
|
-
class BlobNotResolvable extends
|
|
11309
|
-
uri:
|
|
11310
|
-
reason:
|
|
11350
|
+
class BlobNotResolvable extends Schema56.TaggedErrorClass()("BlobNotResolvable", {
|
|
11351
|
+
uri: Schema56.String,
|
|
11352
|
+
reason: Schema56.String
|
|
11311
11353
|
}) {
|
|
11312
11354
|
}
|
|
11313
11355
|
|
|
11314
|
-
class BlobStoreError extends
|
|
11315
|
-
message:
|
|
11356
|
+
class BlobStoreError extends Schema56.TaggedErrorClass()("BlobStoreError", {
|
|
11357
|
+
message: Schema56.String
|
|
11316
11358
|
}) {
|
|
11317
11359
|
}
|
|
11318
11360
|
|
|
@@ -11385,7 +11427,7 @@ __export(exports_prompt_assembler_service, {
|
|
|
11385
11427
|
Service: () => Service40,
|
|
11386
11428
|
PromptAssemblerError: () => PromptAssemblerError
|
|
11387
11429
|
});
|
|
11388
|
-
import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as
|
|
11430
|
+
import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as Schema58 } from "effect";
|
|
11389
11431
|
import { Prompt as Prompt10 } from "effect/unstable/ai";
|
|
11390
11432
|
|
|
11391
11433
|
// ../runtime/src/content/artifact-store-service.ts
|
|
@@ -11400,11 +11442,11 @@ __export(exports_artifact_store_service, {
|
|
|
11400
11442
|
Memory: () => Memory2,
|
|
11401
11443
|
ArtifactNotResolvable: () => ArtifactNotResolvable
|
|
11402
11444
|
});
|
|
11403
|
-
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as
|
|
11445
|
+
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as Schema57 } from "effect";
|
|
11404
11446
|
|
|
11405
|
-
class ArtifactNotResolvable extends
|
|
11406
|
-
artifact_id:
|
|
11407
|
-
reason:
|
|
11447
|
+
class ArtifactNotResolvable extends Schema57.TaggedErrorClass()("ArtifactNotResolvable", {
|
|
11448
|
+
artifact_id: Schema57.String,
|
|
11449
|
+
reason: Schema57.String
|
|
11408
11450
|
}) {
|
|
11409
11451
|
}
|
|
11410
11452
|
|
|
@@ -11446,14 +11488,14 @@ var register8 = Effect59.fn("ArtifactStore.register.call")(function* (artifact_i
|
|
|
11446
11488
|
});
|
|
11447
11489
|
|
|
11448
11490
|
// ../runtime/src/agent/prompt-assembler-service.ts
|
|
11449
|
-
class PromptAssemblerError extends
|
|
11450
|
-
message:
|
|
11491
|
+
class PromptAssemblerError extends Schema58.TaggedErrorClass()("PromptAssemblerError", {
|
|
11492
|
+
message: Schema58.String
|
|
11451
11493
|
}) {
|
|
11452
11494
|
}
|
|
11453
11495
|
|
|
11454
11496
|
class Service40 extends Context53.Service()("@relayfx/runtime/PromptAssembler") {
|
|
11455
11497
|
}
|
|
11456
|
-
var jsonValue2 = (value) =>
|
|
11498
|
+
var jsonValue2 = (value) => Schema58.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11457
11499
|
var stringifyJson = (value) => JSON.stringify(jsonValue2(value));
|
|
11458
11500
|
var contentToPromptPart = (part) => {
|
|
11459
11501
|
const options = part.provider_options;
|
|
@@ -11597,8 +11639,8 @@ var make9 = (config) => exports_compaction.make(strategy(config), defaultOptions
|
|
|
11597
11639
|
var layerFromEpoch = (epoch) => exports_instructions.layer(epoch.baseline.length === 0 ? [] : [exports_instructions.staticSource("relay:context-epoch", epoch.baseline)]);
|
|
11598
11640
|
|
|
11599
11641
|
// ../runtime/src/agent/relay-permissions.ts
|
|
11600
|
-
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as
|
|
11601
|
-
var jsonValue3 = (value) =>
|
|
11642
|
+
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as Schema59 } from "effect";
|
|
11643
|
+
var jsonValue3 = (value) => Schema59.decodeUnknownSync(exports_shared_schema.JsonValue)(value === undefined ? null : value);
|
|
11602
11644
|
var waitIdForToolCall = (toolCallId) => exports_ids_schema.WaitId.make(`wait:permission:${toolCallId}`);
|
|
11603
11645
|
var fallbackToolCallId = (request) => `${request.agentName}:${request.turn}:${request.tool}`;
|
|
11604
11646
|
var tokenFor2 = (request) => waitIdForToolCall(request.toolCallId ?? fallbackToolCallId(request));
|
|
@@ -11764,7 +11806,7 @@ var awaitAnswer = Effect62.fn("RelayPermissions.awaitAnswer")(function* (config,
|
|
|
11764
11806
|
});
|
|
11765
11807
|
var rememberRule = Effect62.fn("RelayPermissions.rememberRule")(function* (config, rule) {
|
|
11766
11808
|
const createdAt = yield* Clock6.currentTimeMillis;
|
|
11767
|
-
const decodedRule = yield*
|
|
11809
|
+
const decodedRule = yield* Schema59.decodeUnknownEffect(exports_agent_schema.PermissionRule)(rule).pipe(Effect62.mapError((error) => permissionError(error.message)));
|
|
11768
11810
|
yield* config.repository.remember({
|
|
11769
11811
|
agent: config.agentName,
|
|
11770
11812
|
scope: config.scope,
|
|
@@ -11780,9 +11822,9 @@ var layer40 = (config) => Layer56.mergeAll(Layer56.succeed(exports_permissions.P
|
|
|
11780
11822
|
})));
|
|
11781
11823
|
|
|
11782
11824
|
// ../runtime/src/agent/relay-steering.ts
|
|
11783
|
-
import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as
|
|
11825
|
+
import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as Schema60 } from "effect";
|
|
11784
11826
|
import { Prompt as Prompt11 } from "effect/unstable/ai";
|
|
11785
|
-
var jsonValue4 = (value) =>
|
|
11827
|
+
var jsonValue4 = (value) => Schema60.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11786
11828
|
var stringifyJson2 = (value) => JSON.stringify(jsonValue4(value));
|
|
11787
11829
|
var createdAtForSequence2 = (config, sequence) => config.startedAt + sequence - config.eventSequence;
|
|
11788
11830
|
var drainId = (config, kind, sequence) => `drain:${config.executionId}:steering:${kind}:sequence:${sequence}`;
|
|
@@ -11815,7 +11857,7 @@ var contentFromMessage = (message) => {
|
|
|
11815
11857
|
const textParts = promptTextParts(prompt);
|
|
11816
11858
|
if (textParts.length > 0)
|
|
11817
11859
|
return textParts;
|
|
11818
|
-
return [exports_content_schema.text(stringifyJson2(
|
|
11860
|
+
return [exports_content_schema.text(stringifyJson2(Schema60.encodeSync(Prompt11.Prompt)(prompt)))];
|
|
11819
11861
|
};
|
|
11820
11862
|
var steeringReceivedEvent = (config, kind, drain2, messages, sequence) => ({
|
|
11821
11863
|
id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:received`),
|
|
@@ -11860,8 +11902,8 @@ var layer41 = (config) => Layer57.succeed(exports_steering.Steering, exports_ste
|
|
|
11860
11902
|
}));
|
|
11861
11903
|
|
|
11862
11904
|
// ../runtime/src/agent/relay-tool-executor.ts
|
|
11863
|
-
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as
|
|
11864
|
-
var jsonValue5 = (value) =>
|
|
11905
|
+
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as Schema61 } from "effect";
|
|
11906
|
+
var jsonValue5 = (value) => Schema61.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11865
11907
|
var errorDetail = (error) => {
|
|
11866
11908
|
switch (error._tag) {
|
|
11867
11909
|
case "ToolNotRegistered":
|
|
@@ -11968,29 +12010,29 @@ var make12 = (first) => Ref17.make(first).pipe(Effect66.map((ref) => ({
|
|
|
11968
12010
|
})));
|
|
11969
12011
|
|
|
11970
12012
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
11971
|
-
class AgentLoopError extends
|
|
11972
|
-
message:
|
|
11973
|
-
next_event_sequence:
|
|
12013
|
+
class AgentLoopError extends Schema62.TaggedErrorClass()("AgentLoopError", {
|
|
12014
|
+
message: Schema62.String,
|
|
12015
|
+
next_event_sequence: Schema62.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
11974
12016
|
}) {
|
|
11975
12017
|
}
|
|
11976
12018
|
|
|
11977
|
-
class AgentLoopWaitRequested extends
|
|
12019
|
+
class AgentLoopWaitRequested extends Schema62.TaggedErrorClass()("AgentLoopWaitRequested", {
|
|
11978
12020
|
wait_id: exports_ids_schema.WaitId,
|
|
11979
12021
|
tool_call: exports_tool_schema.Call,
|
|
11980
12022
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
11981
12023
|
}) {
|
|
11982
12024
|
}
|
|
11983
12025
|
|
|
11984
|
-
class AgentLoopBudgetExceeded extends
|
|
11985
|
-
tokens_used:
|
|
11986
|
-
token_budget:
|
|
12026
|
+
class AgentLoopBudgetExceeded extends Schema62.TaggedErrorClass()("AgentLoopBudgetExceeded", {
|
|
12027
|
+
tokens_used: Schema62.Int,
|
|
12028
|
+
token_budget: Schema62.Int,
|
|
11987
12029
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
11988
12030
|
}) {
|
|
11989
12031
|
}
|
|
11990
12032
|
|
|
11991
12033
|
class Service41 extends Context54.Service()("@relayfx/runtime/AgentLoop") {
|
|
11992
12034
|
}
|
|
11993
|
-
var jsonValue6 = (value) =>
|
|
12035
|
+
var jsonValue6 = (value) => Schema62.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11994
12036
|
var toolNames = (agent) => HashSet6.fromIterable(agent.tool_names);
|
|
11995
12037
|
var availableRegisteredTools = (agent, registered) => {
|
|
11996
12038
|
const names = toolNames(agent);
|
|
@@ -12559,14 +12601,14 @@ var exports_execution_entity = {};
|
|
|
12559
12601
|
__export(exports_execution_entity, {
|
|
12560
12602
|
layer: () => layer49,
|
|
12561
12603
|
entity: () => entity,
|
|
12562
|
-
client: () =>
|
|
12604
|
+
client: () => client2,
|
|
12563
12605
|
Start: () => Start,
|
|
12564
12606
|
SignalWait: () => SignalWait,
|
|
12565
12607
|
Cancel: () => Cancel
|
|
12566
12608
|
});
|
|
12567
12609
|
import { ClusterSchema, Entity } from "effect/unstable/cluster";
|
|
12568
12610
|
import { Rpc } from "effect/unstable/rpc";
|
|
12569
|
-
import { Schema as
|
|
12611
|
+
import { Schema as Schema69 } from "effect";
|
|
12570
12612
|
|
|
12571
12613
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
12572
12614
|
var exports_execution_workflow = {};
|
|
@@ -12597,15 +12639,15 @@ __export(exports_execution_workflow, {
|
|
|
12597
12639
|
ActivityNameTemplates: () => ActivityNameTemplates
|
|
12598
12640
|
});
|
|
12599
12641
|
import { Activity, DurableDeferred, Workflow } from "effect/unstable/workflow";
|
|
12600
|
-
import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as
|
|
12642
|
+
import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as Schema68 } from "effect";
|
|
12601
12643
|
|
|
12602
12644
|
// ../runtime/src/child/parent-notifier-service.ts
|
|
12603
|
-
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as
|
|
12604
|
-
class ParentNotifyError extends
|
|
12605
|
-
message:
|
|
12645
|
+
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as Schema63 } from "effect";
|
|
12646
|
+
class ParentNotifyError extends Schema63.TaggedErrorClass()("ParentNotifyError", {
|
|
12647
|
+
message: Schema63.String
|
|
12606
12648
|
}) {
|
|
12607
12649
|
}
|
|
12608
|
-
var ChildTerminalStatus =
|
|
12650
|
+
var ChildTerminalStatus = Schema63.Literals(["completed", "failed", "cancelled"]).annotate({
|
|
12609
12651
|
identifier: "Relay.ParentNotifier.ChildTerminalStatus"
|
|
12610
12652
|
});
|
|
12611
12653
|
|
|
@@ -12704,15 +12746,15 @@ __export(exports_skill_registry_service, {
|
|
|
12704
12746
|
SkillDefinitionInvalid: () => SkillDefinitionInvalid,
|
|
12705
12747
|
Service: () => Service43
|
|
12706
12748
|
});
|
|
12707
|
-
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as
|
|
12749
|
+
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as Schema64 } from "effect";
|
|
12708
12750
|
|
|
12709
|
-
class SkillDefinitionInvalid extends
|
|
12710
|
-
message:
|
|
12751
|
+
class SkillDefinitionInvalid extends Schema64.TaggedErrorClass()("SkillDefinitionInvalid", {
|
|
12752
|
+
message: Schema64.String
|
|
12711
12753
|
}) {
|
|
12712
12754
|
}
|
|
12713
12755
|
|
|
12714
|
-
class SkillRegistryError extends
|
|
12715
|
-
message:
|
|
12756
|
+
class SkillRegistryError extends Schema64.TaggedErrorClass()("SkillRegistryError", {
|
|
12757
|
+
message: Schema64.String
|
|
12716
12758
|
}) {
|
|
12717
12759
|
}
|
|
12718
12760
|
|
|
@@ -12881,11 +12923,11 @@ __export(exports_execution_service, {
|
|
|
12881
12923
|
Service: () => Service44,
|
|
12882
12924
|
ExecutionServiceError: () => ExecutionServiceError
|
|
12883
12925
|
});
|
|
12884
|
-
import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as
|
|
12926
|
+
import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as Schema65, Stream as Stream9 } from "effect";
|
|
12885
12927
|
import { ShardingConfig } from "effect/unstable/cluster";
|
|
12886
|
-
class ExecutionServiceError extends
|
|
12887
|
-
message:
|
|
12888
|
-
next_event_sequence:
|
|
12928
|
+
class ExecutionServiceError extends Schema65.TaggedErrorClass()("ExecutionServiceError", {
|
|
12929
|
+
message: Schema65.String,
|
|
12930
|
+
next_event_sequence: Schema65.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12889
12931
|
}) {
|
|
12890
12932
|
}
|
|
12891
12933
|
|
|
@@ -13201,13 +13243,13 @@ var spawnChildRun = Effect70.fn("ExecutionService.spawnChildRun.call")(function*
|
|
|
13201
13243
|
var stream3 = (input) => Stream9.unwrap(Service44.pipe(Effect70.map((service) => service.stream(input))));
|
|
13202
13244
|
|
|
13203
13245
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13204
|
-
import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as
|
|
13246
|
+
import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as Schema67 } from "effect";
|
|
13205
13247
|
|
|
13206
13248
|
// ../runtime/src/workspace/workspace-runtime-service.ts
|
|
13207
|
-
import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as
|
|
13249
|
+
import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as Schema66 } from "effect";
|
|
13208
13250
|
|
|
13209
|
-
class WorkspaceRuntimeError extends
|
|
13210
|
-
message:
|
|
13251
|
+
class WorkspaceRuntimeError extends Schema66.TaggedErrorClass()("WorkspaceRuntimeError", {
|
|
13252
|
+
message: Schema66.String
|
|
13211
13253
|
}) {
|
|
13212
13254
|
}
|
|
13213
13255
|
|
|
@@ -13235,18 +13277,18 @@ var exec = Effect71.fn("WorkspaceRuntime.exec.call")(function* (input) {
|
|
|
13235
13277
|
});
|
|
13236
13278
|
|
|
13237
13279
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13238
|
-
class WorkspaceRuntimeMissing extends
|
|
13280
|
+
class WorkspaceRuntimeMissing extends Schema67.TaggedErrorClass()("WorkspaceRuntimeMissing", {
|
|
13239
13281
|
execution_id: exports_ids_schema.ExecutionId
|
|
13240
13282
|
}) {
|
|
13241
13283
|
}
|
|
13242
13284
|
|
|
13243
|
-
class WorkspaceLeaseMissingRef extends
|
|
13285
|
+
class WorkspaceLeaseMissingRef extends Schema67.TaggedErrorClass()("WorkspaceLeaseMissingRef", {
|
|
13244
13286
|
execution_id: exports_ids_schema.ExecutionId
|
|
13245
13287
|
}) {
|
|
13246
13288
|
}
|
|
13247
13289
|
|
|
13248
|
-
class WorkspacePlannerError extends
|
|
13249
|
-
message:
|
|
13290
|
+
class WorkspacePlannerError extends Schema67.TaggedErrorClass()("WorkspacePlannerError", {
|
|
13291
|
+
message: Schema67.String
|
|
13250
13292
|
}) {
|
|
13251
13293
|
}
|
|
13252
13294
|
|
|
@@ -13432,67 +13474,67 @@ var fail = Effect72.fn("WorkspacePlanner.fail.call")(function* (input) {
|
|
|
13432
13474
|
});
|
|
13433
13475
|
|
|
13434
13476
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
13435
|
-
class ExecutionWorkflowFailed extends
|
|
13436
|
-
message:
|
|
13477
|
+
class ExecutionWorkflowFailed extends Schema68.TaggedErrorClass()("ExecutionWorkflowFailed", {
|
|
13478
|
+
message: Schema68.String
|
|
13437
13479
|
}) {
|
|
13438
13480
|
}
|
|
13439
|
-
var StartInput =
|
|
13481
|
+
var StartInput = Schema68.Struct({
|
|
13440
13482
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13441
13483
|
root_address_id: exports_ids_schema.AddressId,
|
|
13442
|
-
session_id:
|
|
13443
|
-
input:
|
|
13484
|
+
session_id: Schema68.optionalKey(exports_ids_schema.SessionId),
|
|
13485
|
+
input: Schema68.optionalKey(Schema68.Array(exports_content_schema.Part)),
|
|
13444
13486
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
13445
13487
|
started_at: exports_shared_schema.TimestampMillis,
|
|
13446
13488
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
13447
|
-
agent_id:
|
|
13448
|
-
agent_revision:
|
|
13449
|
-
agent_snapshot:
|
|
13450
|
-
agent_tool_input_schema_digests:
|
|
13451
|
-
wait_id:
|
|
13452
|
-
resume_tool_call:
|
|
13453
|
-
workflow_generation:
|
|
13454
|
-
metadata:
|
|
13489
|
+
agent_id: Schema68.optionalKey(exports_ids_schema.AgentId),
|
|
13490
|
+
agent_revision: Schema68.optionalKey(exports_agent_schema.DefinitionRevision),
|
|
13491
|
+
agent_snapshot: Schema68.optionalKey(exports_agent_schema.Definition),
|
|
13492
|
+
agent_tool_input_schema_digests: Schema68.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
|
|
13493
|
+
wait_id: Schema68.optionalKey(exports_ids_schema.WaitId),
|
|
13494
|
+
resume_tool_call: Schema68.optionalKey(exports_tool_schema.Call),
|
|
13495
|
+
workflow_generation: Schema68.optionalKey(Schema68.Int.check(Schema68.isGreaterThanOrEqualTo(0))),
|
|
13496
|
+
metadata: Schema68.optionalKey(exports_shared_schema.Metadata)
|
|
13455
13497
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartInput" });
|
|
13456
|
-
var WaitSignalState =
|
|
13498
|
+
var WaitSignalState = Schema68.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
13457
13499
|
identifier: "Relay.ExecutionWorkflow.WaitSignalState"
|
|
13458
13500
|
});
|
|
13459
|
-
var WaitSignal =
|
|
13501
|
+
var WaitSignal = Schema68.Struct({
|
|
13460
13502
|
wait_id: exports_ids_schema.WaitId,
|
|
13461
13503
|
state: WaitSignalState,
|
|
13462
13504
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13463
13505
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSignal" });
|
|
13464
|
-
var SignalWaitInput =
|
|
13465
|
-
workflow_execution_id:
|
|
13506
|
+
var SignalWaitInput = Schema68.Struct({
|
|
13507
|
+
workflow_execution_id: Schema68.String,
|
|
13466
13508
|
wait_id: exports_ids_schema.WaitId,
|
|
13467
13509
|
state: WaitSignalState,
|
|
13468
13510
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13469
13511
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.SignalWaitInput" });
|
|
13470
|
-
var CancelExecutionInput =
|
|
13512
|
+
var CancelExecutionInput = Schema68.Struct({
|
|
13471
13513
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13472
13514
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
13473
|
-
reason:
|
|
13515
|
+
reason: Schema68.optionalKey(Schema68.String)
|
|
13474
13516
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionInput" });
|
|
13475
|
-
var CancelExecutionResult =
|
|
13517
|
+
var CancelExecutionResult = Schema68.Struct({
|
|
13476
13518
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13477
13519
|
status: exports_execution_schema.ExecutionStatus
|
|
13478
13520
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionResult" });
|
|
13479
|
-
var WaitSnapshot =
|
|
13521
|
+
var WaitSnapshot = Schema68.Struct({
|
|
13480
13522
|
id: exports_ids_schema.WaitId,
|
|
13481
13523
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13482
|
-
envelope_id:
|
|
13524
|
+
envelope_id: Schema68.optionalKey(exports_ids_schema.EnvelopeId),
|
|
13483
13525
|
mode: exports_envelope_schema.WaitMode,
|
|
13484
|
-
correlation_key:
|
|
13485
|
-
state:
|
|
13526
|
+
correlation_key: Schema68.optionalKey(Schema68.String),
|
|
13527
|
+
state: Schema68.Literals(["open", "resolved", "timed_out", "cancelled"]),
|
|
13486
13528
|
metadata: exports_shared_schema.Metadata,
|
|
13487
13529
|
created_at: exports_shared_schema.TimestampMillis,
|
|
13488
|
-
resolved_at:
|
|
13530
|
+
resolved_at: Schema68.optionalKey(exports_shared_schema.TimestampMillis)
|
|
13489
13531
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSnapshot" });
|
|
13490
|
-
var StartResult =
|
|
13532
|
+
var StartResult = Schema68.Struct({
|
|
13491
13533
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13492
13534
|
status: exports_execution_schema.ExecutionStatus,
|
|
13493
|
-
wait_id:
|
|
13494
|
-
wait_state:
|
|
13495
|
-
metadata:
|
|
13535
|
+
wait_id: Schema68.optionalKey(exports_ids_schema.WaitId),
|
|
13536
|
+
wait_state: Schema68.optionalKey(Schema68.Literals(["resolved", "timed_out", "cancelled"])),
|
|
13537
|
+
metadata: Schema68.optionalKey(exports_shared_schema.Metadata)
|
|
13496
13538
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartResult" });
|
|
13497
13539
|
var StartExecutionWorkflowName = "Relay/Execution/Start";
|
|
13498
13540
|
var ActivityNames = {
|
|
@@ -13702,7 +13744,7 @@ var cancelExecution = (input, turn, reason) => Activity.make({
|
|
|
13702
13744
|
});
|
|
13703
13745
|
var loadCancellationRequested = (input, turn) => Activity.make({
|
|
13704
13746
|
name: ActivityNames.checkCancel(turn),
|
|
13705
|
-
success:
|
|
13747
|
+
success: Schema68.Boolean,
|
|
13706
13748
|
error: ExecutionWorkflowFailed,
|
|
13707
13749
|
execute: Effect73.gen(function* () {
|
|
13708
13750
|
const repository = yield* exports_execution_repository.Service;
|
|
@@ -13712,7 +13754,7 @@ var loadCancellationRequested = (input, turn) => Activity.make({
|
|
|
13712
13754
|
});
|
|
13713
13755
|
var loadWait = (name, waitId) => Activity.make({
|
|
13714
13756
|
name,
|
|
13715
|
-
success:
|
|
13757
|
+
success: Schema68.UndefinedOr(WaitSnapshot),
|
|
13716
13758
|
error: ExecutionWorkflowFailed,
|
|
13717
13759
|
execute: get11(waitId).pipe(Effect73.map((record2) => record2 === undefined ? undefined : toWaitSnapshot(record2)), Effect73.mapError(mapWaitError2))
|
|
13718
13760
|
});
|
|
@@ -13803,7 +13845,7 @@ var compactionForStart = Effect73.fn("ExecutionWorkflow.compactionForStart")(fun
|
|
|
13803
13845
|
...keepRecentTokens === undefined ? {} : { keepRecentTokens }
|
|
13804
13846
|
};
|
|
13805
13847
|
});
|
|
13806
|
-
var decodeMemorySubject = (value) => typeof value === "string" ?
|
|
13848
|
+
var decodeMemorySubject = (value) => typeof value === "string" ? Schema68.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(value).pipe(Effect73.mapError(() => new ExecutionWorkflowFailed({ message: `Invalid memory_subject_id metadata value: ${value}` }))) : Effect73.fail(new ExecutionWorkflowFailed({ message: "memory_subject_id metadata value must be a string" }));
|
|
13807
13849
|
var memorySubjectForStart = Effect73.fn("ExecutionWorkflow.memorySubjectForStart")(function* (input) {
|
|
13808
13850
|
const executionSubject = memorySubjectFromMetadata(input.metadata);
|
|
13809
13851
|
if (executionSubject !== undefined)
|
|
@@ -13821,7 +13863,7 @@ var steeringEnabledForStart = (input) => {
|
|
|
13821
13863
|
var nextEventSequence4 = (eventLog, executionId) => eventLog.maxSequence(executionId).pipe(Effect73.map((max) => max === undefined ? 0 : max + 1), Effect73.mapError(mapEventLogError6));
|
|
13822
13864
|
var ensureWorkspace = (input) => Activity.make({
|
|
13823
13865
|
name: ActivityNames.ensureWorkspace,
|
|
13824
|
-
success:
|
|
13866
|
+
success: Schema68.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13825
13867
|
error: ExecutionWorkflowFailed,
|
|
13826
13868
|
execute: Effect73.gen(function* () {
|
|
13827
13869
|
if (input.agent_snapshot === undefined)
|
|
@@ -13838,19 +13880,19 @@ var ensureWorkspace = (input) => Activity.make({
|
|
|
13838
13880
|
});
|
|
13839
13881
|
var suspendWorkspace = (input, key2) => Activity.make({
|
|
13840
13882
|
name: ActivityNames.suspendWorkspace(key2),
|
|
13841
|
-
success:
|
|
13883
|
+
success: Schema68.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13842
13884
|
error: ExecutionWorkflowFailed,
|
|
13843
13885
|
execute: suspend2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13844
13886
|
});
|
|
13845
13887
|
var resumeWorkspace = (input, key2) => Activity.make({
|
|
13846
13888
|
name: ActivityNames.resumeWorkspace(key2),
|
|
13847
|
-
success:
|
|
13889
|
+
success: Schema68.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13848
13890
|
error: ExecutionWorkflowFailed,
|
|
13849
13891
|
execute: resume2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.map((plan2) => plan2?.lease), Effect73.mapError(mapWorkspaceError))
|
|
13850
13892
|
});
|
|
13851
13893
|
var releaseWorkspace = (input) => Activity.make({
|
|
13852
13894
|
name: ActivityNames.releaseWorkspace,
|
|
13853
|
-
success:
|
|
13895
|
+
success: Schema68.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13854
13896
|
error: ExecutionWorkflowFailed,
|
|
13855
13897
|
execute: release2({ executionId: input.execution_id, now: input.completed_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13856
13898
|
});
|
|
@@ -13951,7 +13993,7 @@ var childDispatchContext = (input) => {
|
|
|
13951
13993
|
};
|
|
13952
13994
|
var loadChildCancellationRequested = (input) => Activity.make({
|
|
13953
13995
|
name: ActivityNames.checkQueuedChildCancellation,
|
|
13954
|
-
success:
|
|
13996
|
+
success: Schema68.Boolean,
|
|
13955
13997
|
error: ExecutionWorkflowFailed,
|
|
13956
13998
|
execute: Effect73.gen(function* () {
|
|
13957
13999
|
const context = childDispatchContext(input);
|
|
@@ -13963,7 +14005,7 @@ var loadChildCancellationRequested = (input) => Activity.make({
|
|
|
13963
14005
|
});
|
|
13964
14006
|
var notifyParentActivity = (input, context, status, output) => Activity.make({
|
|
13965
14007
|
name: ActivityNames.notifyParent(status),
|
|
13966
|
-
success:
|
|
14008
|
+
success: Schema68.Void,
|
|
13967
14009
|
error: ExecutionWorkflowFailed,
|
|
13968
14010
|
execute: Effect73.gen(function* () {
|
|
13969
14011
|
const notifier = yield* Effect73.serviceOption(Service42);
|
|
@@ -14016,7 +14058,7 @@ var waitIdFromExecution = (execution) => {
|
|
|
14016
14058
|
};
|
|
14017
14059
|
var pendingToolCallFromExecution = (execution) => {
|
|
14018
14060
|
const pending = execution.metadata?.pending_tool_call;
|
|
14019
|
-
return
|
|
14061
|
+
return Schema68.decodeUnknownOption(exports_tool_schema.Call)(pending).pipe(Option26.getOrUndefined);
|
|
14020
14062
|
};
|
|
14021
14063
|
var finishCancelledWait = Effect73.fn("ExecutionWorkflow.finishCancelledWait")(function* (startInput, turn, waitId) {
|
|
14022
14064
|
const cancelled = yield* cancelExecution(startInput, turn, "wait cancelled");
|
|
@@ -14230,7 +14272,7 @@ var Start = Rpc.make("start", {
|
|
|
14230
14272
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14231
14273
|
var SignalWait = Rpc.make("signalWait", {
|
|
14232
14274
|
payload: SignalWaitInput,
|
|
14233
|
-
success:
|
|
14275
|
+
success: Schema69.Void,
|
|
14234
14276
|
error: ExecutionWorkflowFailed
|
|
14235
14277
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14236
14278
|
var Cancel = Rpc.make("cancel", {
|
|
@@ -14244,7 +14286,7 @@ var layer49 = entity.toLayer(entity.of({
|
|
|
14244
14286
|
signalWait: (request) => signalWait(request.payload),
|
|
14245
14287
|
cancel: (request) => cancelRequest(request.payload)
|
|
14246
14288
|
}), { concurrency: "unbounded" });
|
|
14247
|
-
var
|
|
14289
|
+
var client2 = entity.client;
|
|
14248
14290
|
// ../runtime/src/envelope/envelope-service.ts
|
|
14249
14291
|
var exports_envelope_service = {};
|
|
14250
14292
|
__export(exports_envelope_service, {
|
|
@@ -14258,26 +14300,26 @@ __export(exports_envelope_service, {
|
|
|
14258
14300
|
EnvelopeRouteDeferred: () => EnvelopeRouteDeferred,
|
|
14259
14301
|
EnvelopeAddressNotFound: () => EnvelopeAddressNotFound
|
|
14260
14302
|
});
|
|
14261
|
-
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as
|
|
14262
|
-
class EnvelopeAddressNotFound extends
|
|
14303
|
+
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as Schema70 } from "effect";
|
|
14304
|
+
class EnvelopeAddressNotFound extends Schema70.TaggedErrorClass()("EnvelopeAddressNotFound", {
|
|
14263
14305
|
address_id: exports_ids_schema.AddressId
|
|
14264
14306
|
}) {
|
|
14265
14307
|
}
|
|
14266
14308
|
|
|
14267
|
-
class EnvelopeRouteUnavailable extends
|
|
14309
|
+
class EnvelopeRouteUnavailable extends Schema70.TaggedErrorClass()("EnvelopeRouteUnavailable", {
|
|
14268
14310
|
address_id: exports_ids_schema.AddressId,
|
|
14269
|
-
route_key:
|
|
14311
|
+
route_key: Schema70.String
|
|
14270
14312
|
}) {
|
|
14271
14313
|
}
|
|
14272
14314
|
|
|
14273
|
-
class EnvelopeRouteDeferred extends
|
|
14315
|
+
class EnvelopeRouteDeferred extends Schema70.TaggedErrorClass()("EnvelopeRouteDeferred", {
|
|
14274
14316
|
address_id: exports_ids_schema.AddressId,
|
|
14275
|
-
route_key:
|
|
14317
|
+
route_key: Schema70.String
|
|
14276
14318
|
}) {
|
|
14277
14319
|
}
|
|
14278
14320
|
|
|
14279
|
-
class EnvelopeServiceError extends
|
|
14280
|
-
message:
|
|
14321
|
+
class EnvelopeServiceError extends Schema70.TaggedErrorClass()("EnvelopeServiceError", {
|
|
14322
|
+
message: Schema70.String
|
|
14281
14323
|
}) {
|
|
14282
14324
|
}
|
|
14283
14325
|
|
|
@@ -14435,7 +14477,7 @@ __export(exports_runner_runtime_service, {
|
|
|
14435
14477
|
DatabaseMode: () => DatabaseMode,
|
|
14436
14478
|
ClusterConfigMismatch: () => ClusterConfigMismatch
|
|
14437
14479
|
});
|
|
14438
|
-
import { Config as Config5, Context as Context62, Crypto as Crypto4, Duration as Duration5, Effect as Effect77, Layer as Layer69, Option as Option27, Schema as
|
|
14480
|
+
import { Config as Config5, Context as Context62, Crypto as Crypto4, Duration as Duration5, Effect as Effect77, Layer as Layer69, Option as Option27, Schema as Schema72, Stream as Stream10 } from "effect";
|
|
14439
14481
|
import {
|
|
14440
14482
|
ClusterWorkflowEngine,
|
|
14441
14483
|
HttpRunner,
|
|
@@ -14473,7 +14515,7 @@ __export(exports_scheduler_service, {
|
|
|
14473
14515
|
SchedulerError: () => SchedulerError,
|
|
14474
14516
|
ScheduleCronInvalid: () => ScheduleCronInvalid
|
|
14475
14517
|
});
|
|
14476
|
-
import { Clock as Clock10, Config as Config4, Context as Context61, Cron, Duration as Duration4, Effect as Effect76, Layer as Layer68, Random, Result as Result3, Schema as
|
|
14518
|
+
import { Clock as Clock10, Config as Config4, Context as Context61, Cron, Duration as Duration4, Effect as Effect76, Layer as Layer68, Random, Result as Result3, Schema as Schema71 } from "effect";
|
|
14477
14519
|
|
|
14478
14520
|
// ../runtime/src/wait/wait-signal.ts
|
|
14479
14521
|
var exports_wait_signal = {};
|
|
@@ -14483,8 +14525,8 @@ __export(exports_wait_signal, {
|
|
|
14483
14525
|
import { Effect as Effect75 } from "effect";
|
|
14484
14526
|
var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function* (input) {
|
|
14485
14527
|
const workflowExecutionId2 = yield* activeWorkflowExecutionIdForExecution(input.executionId);
|
|
14486
|
-
const
|
|
14487
|
-
yield*
|
|
14528
|
+
const client3 = input.makeExecutionClient(input.executionId);
|
|
14529
|
+
yield* client3.signalWait({
|
|
14488
14530
|
workflow_execution_id: workflowExecutionId2,
|
|
14489
14531
|
wait_id: input.waitId,
|
|
14490
14532
|
state: input.state,
|
|
@@ -14493,14 +14535,14 @@ var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function*
|
|
|
14493
14535
|
});
|
|
14494
14536
|
|
|
14495
14537
|
// ../runtime/src/schedule/scheduler-service.ts
|
|
14496
|
-
class SchedulerError extends
|
|
14497
|
-
message:
|
|
14538
|
+
class SchedulerError extends Schema71.TaggedErrorClass()("SchedulerError", {
|
|
14539
|
+
message: Schema71.String
|
|
14498
14540
|
}) {
|
|
14499
14541
|
}
|
|
14500
14542
|
|
|
14501
|
-
class ScheduleCronInvalid extends
|
|
14502
|
-
cron_expr:
|
|
14503
|
-
message:
|
|
14543
|
+
class ScheduleCronInvalid extends Schema71.TaggedErrorClass()("ScheduleCronInvalid", {
|
|
14544
|
+
cron_expr: Schema71.String,
|
|
14545
|
+
message: Schema71.String
|
|
14504
14546
|
}) {
|
|
14505
14547
|
}
|
|
14506
14548
|
|
|
@@ -14538,7 +14580,7 @@ var make14 = Effect76.gen(function* () {
|
|
|
14538
14580
|
const waits = yield* Service25;
|
|
14539
14581
|
const eventLog = yield* Service24;
|
|
14540
14582
|
const executionRepository = yield* exports_execution_repository.Service;
|
|
14541
|
-
const makeExecutionClient = yield*
|
|
14583
|
+
const makeExecutionClient = yield* client2;
|
|
14542
14584
|
const workerId = yield* workerIdConfig;
|
|
14543
14585
|
const claimTtlMillis = yield* claimTtlMillisConfig;
|
|
14544
14586
|
const pollIntervalMillis = yield* pollIntervalMillisConfig;
|
|
@@ -14651,25 +14693,25 @@ var runOnce2 = Effect76.fn("SchedulerService.runOnce.call")(function* () {
|
|
|
14651
14693
|
});
|
|
14652
14694
|
|
|
14653
14695
|
// ../runtime/src/runner/runner-runtime-service.ts
|
|
14654
|
-
var DatabaseMode =
|
|
14696
|
+
var DatabaseMode = Schema72.Literals(["sql", "pg", "mysql", "sqlite", "memory"]).annotate({
|
|
14655
14697
|
identifier: "Relay.RunnerRuntime.DatabaseMode"
|
|
14656
14698
|
});
|
|
14657
|
-
var ReadinessStatus =
|
|
14699
|
+
var ReadinessStatus = Schema72.Struct({
|
|
14658
14700
|
database: DatabaseMode,
|
|
14659
|
-
cluster:
|
|
14660
|
-
workflow:
|
|
14661
|
-
executionEntity:
|
|
14701
|
+
cluster: Schema72.Literal("ready"),
|
|
14702
|
+
workflow: Schema72.Literals(["ready", "client"]),
|
|
14703
|
+
executionEntity: Schema72.Literals(["registered", "client"])
|
|
14662
14704
|
}).annotate({ identifier: "Relay.RunnerRuntime.ReadinessStatus" });
|
|
14663
14705
|
|
|
14664
|
-
class RunnerRuntimeError extends
|
|
14665
|
-
message:
|
|
14706
|
+
class RunnerRuntimeError extends Schema72.TaggedErrorClass()("RunnerRuntimeError", {
|
|
14707
|
+
message: Schema72.String
|
|
14666
14708
|
}) {
|
|
14667
14709
|
}
|
|
14668
14710
|
|
|
14669
|
-
class ClusterConfigMismatch extends
|
|
14670
|
-
field:
|
|
14671
|
-
expected:
|
|
14672
|
-
actual:
|
|
14711
|
+
class ClusterConfigMismatch extends Schema72.TaggedErrorClass()("ClusterConfigMismatch", {
|
|
14712
|
+
field: Schema72.String,
|
|
14713
|
+
expected: Schema72.String,
|
|
14714
|
+
actual: Schema72.String
|
|
14673
14715
|
}) {
|
|
14674
14716
|
}
|
|
14675
14717
|
|
|
@@ -14683,7 +14725,7 @@ var memoryClusterLayer = Sharding.layer.pipe(Layer69.provideMerge(Runners.layerN
|
|
|
14683
14725
|
var clusterHost = Config5.string("RELAY_CLUSTER_HOST").pipe(Config5.withDefault("localhost"));
|
|
14684
14726
|
var clusterPort = Config5.int("RELAY_CLUSTER_PORT").pipe(Config5.withDefault(34431));
|
|
14685
14727
|
var clusterShardsPerGroup = Config5.int("RELAY_CLUSTER_SHARDS_PER_GROUP").pipe(Config5.withDefault(300));
|
|
14686
|
-
var clusterShardGroups = Config5.schema(Config5.Array(
|
|
14728
|
+
var clusterShardGroups = Config5.schema(Config5.Array(Schema72.String), "RELAY_CLUSTER_SHARD_GROUPS").pipe(Config5.withDefault(["default", "execution"]));
|
|
14687
14729
|
var runnerAddressKey = (address) => `${address.host}:${address.port}`;
|
|
14688
14730
|
var runnerAddressEquals = (left, right) => left.host === right.host && left.port === right.port;
|
|
14689
14731
|
var shardingConfigFromEnv = () => Layer69.effect(ShardingConfig2.ShardingConfig, Effect77.gen(function* () {
|
|
@@ -14784,7 +14826,7 @@ var testCryptoLayer = Layer69.succeed(Crypto4.Crypto, Crypto4.make({
|
|
|
14784
14826
|
var executionServiceLayer = layer46.pipe(Layer69.provideMerge(layer32));
|
|
14785
14827
|
var addressResolutionLayerWith = (toolRuntimeLayer) => layer25.pipe(Layer69.provideMerge(layerFromRepository), Layer69.provideMerge(layer24.pipe(Layer69.provideMerge(toolRuntimeLayer))));
|
|
14786
14828
|
var parentNotifierLayer = Layer69.effect(Service42, Effect77.gen(function* () {
|
|
14787
|
-
const makeExecutionClient = yield*
|
|
14829
|
+
const makeExecutionClient = yield* client2;
|
|
14788
14830
|
const executionRepository = yield* exports_execution_repository.Service;
|
|
14789
14831
|
return yield* make13({
|
|
14790
14832
|
signalWait: (input) => signalWorkflowWait({
|
|
@@ -14803,7 +14845,7 @@ var workflowAndEntityLayerWith = (toolRuntimeLayer, schedulerLayer, promptAssemb
|
|
|
14803
14845
|
var makeService2 = (database, checkDatabase) => Effect77.gen(function* () {
|
|
14804
14846
|
const sharding = yield* Sharding.Sharding;
|
|
14805
14847
|
const workflow = yield* WorkflowEngine.WorkflowEngine;
|
|
14806
|
-
const makeClient = yield*
|
|
14848
|
+
const makeClient = yield* client2;
|
|
14807
14849
|
return Service49.of({
|
|
14808
14850
|
check: Effect77.fn("RunnerRuntime.check")(function* () {
|
|
14809
14851
|
yield* Effect77.annotateCurrentSpan("relay.database.mode", database);
|
|
@@ -14850,7 +14892,7 @@ var sqlCheckLayer = Layer69.effect(Service49, Effect77.gen(function* () {
|
|
|
14850
14892
|
}));
|
|
14851
14893
|
var makeClientService = (database, checkDatabase) => Effect77.gen(function* () {
|
|
14852
14894
|
const sharding = yield* Sharding.Sharding;
|
|
14853
|
-
const makeClient = yield*
|
|
14895
|
+
const makeClient = yield* client2;
|
|
14854
14896
|
return Service49.of({
|
|
14855
14897
|
check: Effect77.fn("RunnerRuntime.check")(function* () {
|
|
14856
14898
|
yield* Effect77.annotateCurrentSpan("relay.database.mode", database);
|
|
@@ -15013,51 +15055,51 @@ __export(exports_activity_version_registry, {
|
|
|
15013
15055
|
ActivityManifestChange: () => ActivityManifestChange,
|
|
15014
15056
|
ActivityManifest: () => ActivityManifest
|
|
15015
15057
|
});
|
|
15016
|
-
import { Crypto as Crypto5, Effect as Effect78, Schema as
|
|
15058
|
+
import { Crypto as Crypto5, Effect as Effect78, Schema as Schema73 } from "effect";
|
|
15017
15059
|
var generatedFrom = "@relayfx/runtime/ExecutionWorkflow";
|
|
15018
|
-
var ActivityManifestEntry =
|
|
15019
|
-
name:
|
|
15020
|
-
signature_hash:
|
|
15060
|
+
var ActivityManifestEntry = Schema73.Struct({
|
|
15061
|
+
name: Schema73.String,
|
|
15062
|
+
signature_hash: Schema73.String
|
|
15021
15063
|
}).annotate({ identifier: "Relay.ActivityManifestEntry" });
|
|
15022
|
-
var ActivityManifest =
|
|
15023
|
-
version:
|
|
15024
|
-
generated_from:
|
|
15025
|
-
hash_algorithm:
|
|
15026
|
-
activities:
|
|
15064
|
+
var ActivityManifest = Schema73.Struct({
|
|
15065
|
+
version: Schema73.Literal(1),
|
|
15066
|
+
generated_from: Schema73.String,
|
|
15067
|
+
hash_algorithm: Schema73.Literal("sha256-json-schema-v1"),
|
|
15068
|
+
activities: Schema73.Array(ActivityManifestEntry)
|
|
15027
15069
|
}).annotate({ identifier: "Relay.ActivityManifest" });
|
|
15028
|
-
var ActivityManifestChange =
|
|
15029
|
-
type:
|
|
15030
|
-
name:
|
|
15031
|
-
baseline_hash:
|
|
15032
|
-
current_hash:
|
|
15070
|
+
var ActivityManifestChange = Schema73.Struct({
|
|
15071
|
+
type: Schema73.Literals(["removed", "changed", "added"]),
|
|
15072
|
+
name: Schema73.String,
|
|
15073
|
+
baseline_hash: Schema73.optionalKey(Schema73.String),
|
|
15074
|
+
current_hash: Schema73.optionalKey(Schema73.String)
|
|
15033
15075
|
}).annotate({ identifier: "Relay.ActivityManifestChange" });
|
|
15034
|
-
var ActivityManifestGuardResult =
|
|
15035
|
-
status:
|
|
15036
|
-
waiting_executions:
|
|
15037
|
-
breaking_changes:
|
|
15038
|
-
additive_changes:
|
|
15076
|
+
var ActivityManifestGuardResult = Schema73.Struct({
|
|
15077
|
+
status: Schema73.Literals(["pass", "fail"]),
|
|
15078
|
+
waiting_executions: Schema73.Int.check(Schema73.isGreaterThanOrEqualTo(0)),
|
|
15079
|
+
breaking_changes: Schema73.Array(ActivityManifestChange),
|
|
15080
|
+
additive_changes: Schema73.Array(ActivityManifestChange)
|
|
15039
15081
|
}).annotate({ identifier: "Relay.ActivityManifestGuardResult" });
|
|
15040
15082
|
|
|
15041
|
-
class ActivityManifestGuardFailed extends
|
|
15042
|
-
message:
|
|
15083
|
+
class ActivityManifestGuardFailed extends Schema73.TaggedErrorClass()("ActivityManifestGuardFailed", {
|
|
15084
|
+
message: Schema73.String,
|
|
15043
15085
|
result: ActivityManifestGuardResult
|
|
15044
15086
|
}) {
|
|
15045
15087
|
}
|
|
15046
|
-
var TurnInput =
|
|
15088
|
+
var TurnInput = Schema73.Struct({
|
|
15047
15089
|
start: StartInput,
|
|
15048
|
-
turn:
|
|
15090
|
+
turn: Schema73.Int.check(Schema73.isGreaterThanOrEqualTo(0))
|
|
15049
15091
|
});
|
|
15050
|
-
var WaitIdInput =
|
|
15092
|
+
var WaitIdInput = Schema73.Struct({
|
|
15051
15093
|
wait_id: exports_ids_schema.WaitId
|
|
15052
15094
|
});
|
|
15053
|
-
var WorkspaceKeyInput =
|
|
15095
|
+
var WorkspaceKeyInput = Schema73.Struct({
|
|
15054
15096
|
start: StartInput,
|
|
15055
|
-
key:
|
|
15097
|
+
key: Schema73.String
|
|
15056
15098
|
});
|
|
15057
15099
|
var contracts = [
|
|
15058
15100
|
{
|
|
15059
15101
|
name: ActivityNameTemplates.resolveLocalAgent,
|
|
15060
|
-
input:
|
|
15102
|
+
input: Schema73.Struct({ address_id: exports_ids_schema.AddressId }),
|
|
15061
15103
|
success: LocalAgentTarget,
|
|
15062
15104
|
error: ExecutionWorkflowFailed
|
|
15063
15105
|
},
|
|
@@ -15069,66 +15111,66 @@ var contracts = [
|
|
|
15069
15111
|
},
|
|
15070
15112
|
{
|
|
15071
15113
|
name: ActivityNameTemplates.cancel,
|
|
15072
|
-
input:
|
|
15114
|
+
input: Schema73.Struct({ start: StartInput, turn: Schema73.Int, reason: Schema73.String }),
|
|
15073
15115
|
success: exports_execution_schema.Execution,
|
|
15074
15116
|
error: ExecutionWorkflowFailed
|
|
15075
15117
|
},
|
|
15076
15118
|
{
|
|
15077
15119
|
name: ActivityNameTemplates.checkCancel,
|
|
15078
15120
|
input: TurnInput,
|
|
15079
|
-
success:
|
|
15121
|
+
success: Schema73.Boolean,
|
|
15080
15122
|
error: ExecutionWorkflowFailed
|
|
15081
15123
|
},
|
|
15082
15124
|
{
|
|
15083
15125
|
name: ActivityNameTemplates.loadWaitBeforeSleep,
|
|
15084
15126
|
input: WaitIdInput,
|
|
15085
|
-
success:
|
|
15127
|
+
success: Schema73.UndefinedOr(WaitSnapshot),
|
|
15086
15128
|
error: ExecutionWorkflowFailed
|
|
15087
15129
|
},
|
|
15088
15130
|
{
|
|
15089
15131
|
name: ActivityNameTemplates.loadWaitAfterWake,
|
|
15090
15132
|
input: WaitIdInput,
|
|
15091
|
-
success:
|
|
15133
|
+
success: Schema73.UndefinedOr(WaitSnapshot),
|
|
15092
15134
|
error: ExecutionWorkflowFailed
|
|
15093
15135
|
},
|
|
15094
15136
|
{
|
|
15095
15137
|
name: ActivityNameTemplates.markWaiting,
|
|
15096
|
-
input:
|
|
15138
|
+
input: Schema73.Struct({ start: StartInput, wait: WaitSnapshot }),
|
|
15097
15139
|
success: exports_execution_schema.Execution,
|
|
15098
15140
|
error: ExecutionWorkflowFailed
|
|
15099
15141
|
},
|
|
15100
15142
|
{
|
|
15101
15143
|
name: ActivityNameTemplates.ensureWorkspace,
|
|
15102
15144
|
input: StartInput,
|
|
15103
|
-
success:
|
|
15145
|
+
success: Schema73.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15104
15146
|
error: ExecutionWorkflowFailed
|
|
15105
15147
|
},
|
|
15106
15148
|
{
|
|
15107
15149
|
name: ActivityNameTemplates.suspendWorkspace,
|
|
15108
15150
|
input: WorkspaceKeyInput,
|
|
15109
|
-
success:
|
|
15151
|
+
success: Schema73.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15110
15152
|
error: ExecutionWorkflowFailed
|
|
15111
15153
|
},
|
|
15112
15154
|
{
|
|
15113
15155
|
name: ActivityNameTemplates.resumeWorkspace,
|
|
15114
15156
|
input: WorkspaceKeyInput,
|
|
15115
|
-
success:
|
|
15157
|
+
success: Schema73.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15116
15158
|
error: ExecutionWorkflowFailed
|
|
15117
15159
|
},
|
|
15118
15160
|
{
|
|
15119
15161
|
name: ActivityNameTemplates.releaseWorkspace,
|
|
15120
15162
|
input: StartInput,
|
|
15121
|
-
success:
|
|
15163
|
+
success: Schema73.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15122
15164
|
error: ExecutionWorkflowFailed
|
|
15123
15165
|
},
|
|
15124
15166
|
{
|
|
15125
15167
|
name: ActivityNameTemplates.complete,
|
|
15126
|
-
input:
|
|
15168
|
+
input: Schema73.Struct({
|
|
15127
15169
|
start: StartInput,
|
|
15128
|
-
turn:
|
|
15129
|
-
wait_id:
|
|
15130
|
-
wait_state:
|
|
15131
|
-
pending_tool_call:
|
|
15170
|
+
turn: Schema73.Int.check(Schema73.isGreaterThanOrEqualTo(0)),
|
|
15171
|
+
wait_id: Schema73.optionalKey(exports_ids_schema.WaitId),
|
|
15172
|
+
wait_state: Schema73.optionalKey(WaitSignalState),
|
|
15173
|
+
pending_tool_call: Schema73.optionalKey(exports_tool_schema.Call)
|
|
15132
15174
|
}),
|
|
15133
15175
|
success: exports_execution_schema.Execution,
|
|
15134
15176
|
error: ExecutionWorkflowFailed
|
|
@@ -15136,24 +15178,24 @@ var contracts = [
|
|
|
15136
15178
|
{
|
|
15137
15179
|
name: ActivityNameTemplates.checkQueuedChildCancellation,
|
|
15138
15180
|
input: StartInput,
|
|
15139
|
-
success:
|
|
15181
|
+
success: Schema73.Boolean,
|
|
15140
15182
|
error: ExecutionWorkflowFailed
|
|
15141
15183
|
},
|
|
15142
15184
|
{
|
|
15143
15185
|
name: ActivityNameTemplates.notifyParent,
|
|
15144
|
-
input:
|
|
15186
|
+
input: Schema73.Struct({
|
|
15145
15187
|
start: StartInput,
|
|
15146
15188
|
status: ChildTerminalStatus,
|
|
15147
|
-
output:
|
|
15189
|
+
output: Schema73.Array(exports_content_schema.Part)
|
|
15148
15190
|
}),
|
|
15149
|
-
success:
|
|
15191
|
+
success: Schema73.Void,
|
|
15150
15192
|
error: ExecutionWorkflowFailed
|
|
15151
15193
|
},
|
|
15152
15194
|
{
|
|
15153
15195
|
name: ActivityNameTemplates.continueAsNew,
|
|
15154
|
-
input:
|
|
15196
|
+
input: Schema73.Struct({
|
|
15155
15197
|
start: StartInput,
|
|
15156
|
-
turn:
|
|
15198
|
+
turn: Schema73.Int.check(Schema73.isGreaterThanOrEqualTo(0)),
|
|
15157
15199
|
wait_id: exports_ids_schema.WaitId,
|
|
15158
15200
|
pending_tool_call: exports_tool_schema.Call
|
|
15159
15201
|
}),
|
|
@@ -15161,7 +15203,7 @@ var contracts = [
|
|
|
15161
15203
|
error: ExecutionWorkflowFailed
|
|
15162
15204
|
}
|
|
15163
15205
|
];
|
|
15164
|
-
var schemaJson = (schema) =>
|
|
15206
|
+
var schemaJson = (schema) => Schema73.decodeUnknownSync(exports_shared_schema.JsonValue)(Schema73.toJsonSchemaDocument(schema));
|
|
15165
15207
|
var canonical = (value) => {
|
|
15166
15208
|
if (value === null || typeof value !== "object")
|
|
15167
15209
|
return value;
|
|
@@ -15276,7 +15318,7 @@ __export(exports_language_model_registration, {
|
|
|
15276
15318
|
anthropic: () => anthropic
|
|
15277
15319
|
});
|
|
15278
15320
|
|
|
15279
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15321
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.1/node_modules/@batonfx/providers/src/anthropic.ts
|
|
15280
15322
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
15281
15323
|
import { Layer as Layer70 } from "effect";
|
|
15282
15324
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
@@ -15292,13 +15334,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
15292
15334
|
});
|
|
15293
15335
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
15294
15336
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer70.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer70.provide(FetchHttpClient2.layer));
|
|
15295
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15337
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.1/node_modules/@batonfx/providers/src/deterministic.ts
|
|
15296
15338
|
import { OpenAiClient as OpenAiClient3 } from "@effect/ai-openai";
|
|
15297
15339
|
import { Effect as Effect79, Layer as Layer72, Option as Option28, Stream as Stream11 } from "effect";
|
|
15298
15340
|
import { LanguageModel as LanguageModel8, Response as Response7 } from "effect/unstable/ai";
|
|
15299
15341
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
15300
15342
|
|
|
15301
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15343
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.1/node_modules/@batonfx/providers/src/openai.ts
|
|
15302
15344
|
import { OpenAiClient as OpenAiClient2, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
15303
15345
|
import { Layer as Layer71 } from "effect";
|
|
15304
15346
|
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
@@ -15315,7 +15357,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
|
|
|
15315
15357
|
var openAiClientLayerConfig2 = OpenAiClient2.layerConfig;
|
|
15316
15358
|
var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer71.provide(OpenAiClient2.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer71.provide(FetchHttpClient3.layer));
|
|
15317
15359
|
|
|
15318
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15360
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.1/node_modules/@batonfx/providers/src/deterministic.ts
|
|
15319
15361
|
var deterministicModelLayer = Layer72.effect(LanguageModel8.LanguageModel, LanguageModel8.make({
|
|
15320
15362
|
generateText: () => Effect79.succeed([{ type: "text", text: "deterministic response" }]),
|
|
15321
15363
|
streamText: () => Stream11.make(Response7.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -15339,7 +15381,7 @@ var withOpenAiOrDeterministic = (options) => Layer72.unwrap(Effect79.gen(functio
|
|
|
15339
15381
|
...Option28.isSome(openAiRegistration) ? [openAiRegistration.value] : []
|
|
15340
15382
|
]);
|
|
15341
15383
|
}));
|
|
15342
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15384
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.1/node_modules/@batonfx/providers/src/openai-compat.ts
|
|
15343
15385
|
import { OpenAiClient as OpenAiClient4, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
15344
15386
|
import { Config as Config8, Layer as Layer73 } from "effect";
|
|
15345
15387
|
import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
|
|
@@ -15360,7 +15402,7 @@ var clientLayerConfig = (options) => OpenAiClient4.layerConfig({
|
|
|
15360
15402
|
...options.baseUrl === undefined ? {} : { apiUrl: Config8.succeed(options.baseUrl) }
|
|
15361
15403
|
});
|
|
15362
15404
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer73.provide(clientLayerConfig(options)), Layer73.provide(FetchHttpClient5.layer));
|
|
15363
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15405
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.1/node_modules/@batonfx/providers/src/openrouter.ts
|
|
15364
15406
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
15365
15407
|
import { Layer as Layer74 } from "effect";
|
|
15366
15408
|
import { FetchHttpClient as FetchHttpClient6 } from "effect/unstable/http";
|