@relayfx/sdk 0.0.42 → 0.0.44
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 +467 -273
- package/dist/index.js +596 -402
- package/dist/types/store-sql/session/session-repository.d.ts +77 -1
- package/package.json +3 -3
package/dist/ai.js
CHANGED
|
@@ -5005,6 +5005,38 @@ var payloadFromInput = (input) => {
|
|
|
5005
5005
|
message: input.message,
|
|
5006
5006
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
5007
5007
|
};
|
|
5008
|
+
case "ToolCall":
|
|
5009
|
+
return {
|
|
5010
|
+
part: input.part,
|
|
5011
|
+
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
5012
|
+
};
|
|
5013
|
+
case "ToolResult":
|
|
5014
|
+
return {
|
|
5015
|
+
part: input.part,
|
|
5016
|
+
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
5017
|
+
};
|
|
5018
|
+
case "Memory":
|
|
5019
|
+
return {
|
|
5020
|
+
items: input.items,
|
|
5021
|
+
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
5022
|
+
};
|
|
5023
|
+
case "Skill":
|
|
5024
|
+
return {
|
|
5025
|
+
name: input.name,
|
|
5026
|
+
body: input.body,
|
|
5027
|
+
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
5028
|
+
};
|
|
5029
|
+
case "Steering":
|
|
5030
|
+
return {
|
|
5031
|
+
message: input.message,
|
|
5032
|
+
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
5033
|
+
};
|
|
5034
|
+
case "Handoff":
|
|
5035
|
+
return {
|
|
5036
|
+
target: input.target,
|
|
5037
|
+
summary: input.summary,
|
|
5038
|
+
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
5039
|
+
};
|
|
5008
5040
|
case "Compaction":
|
|
5009
5041
|
return {
|
|
5010
5042
|
summary: input.summary,
|
|
@@ -5034,6 +5066,44 @@ var toEntryRecord = (row) => {
|
|
|
5034
5066
|
_tag: "Message",
|
|
5035
5067
|
message: payload.message
|
|
5036
5068
|
});
|
|
5069
|
+
case "ToolCall":
|
|
5070
|
+
return Effect18.succeed({
|
|
5071
|
+
...base,
|
|
5072
|
+
_tag: "ToolCall",
|
|
5073
|
+
part: payload.part
|
|
5074
|
+
});
|
|
5075
|
+
case "ToolResult":
|
|
5076
|
+
return Effect18.succeed({
|
|
5077
|
+
...base,
|
|
5078
|
+
_tag: "ToolResult",
|
|
5079
|
+
part: payload.part
|
|
5080
|
+
});
|
|
5081
|
+
case "Memory":
|
|
5082
|
+
return Effect18.succeed({
|
|
5083
|
+
...base,
|
|
5084
|
+
_tag: "Memory",
|
|
5085
|
+
items: Array.isArray(payload.items) ? payload.items.map(String) : []
|
|
5086
|
+
});
|
|
5087
|
+
case "Skill":
|
|
5088
|
+
return Effect18.succeed({
|
|
5089
|
+
...base,
|
|
5090
|
+
_tag: "Skill",
|
|
5091
|
+
name: String(payload.name ?? ""),
|
|
5092
|
+
body: String(payload.body ?? "")
|
|
5093
|
+
});
|
|
5094
|
+
case "Steering":
|
|
5095
|
+
return Effect18.succeed({
|
|
5096
|
+
...base,
|
|
5097
|
+
_tag: "Steering",
|
|
5098
|
+
message: payload.message
|
|
5099
|
+
});
|
|
5100
|
+
case "Handoff":
|
|
5101
|
+
return Effect18.succeed({
|
|
5102
|
+
...base,
|
|
5103
|
+
_tag: "Handoff",
|
|
5104
|
+
target: String(payload.target ?? ""),
|
|
5105
|
+
summary: String(payload.summary ?? "")
|
|
5106
|
+
});
|
|
5037
5107
|
case "Compaction":
|
|
5038
5108
|
return Effect18.succeed({
|
|
5039
5109
|
...base,
|
|
@@ -5081,6 +5151,18 @@ var appendToRecord = (input) => {
|
|
|
5081
5151
|
switch (input.input._tag) {
|
|
5082
5152
|
case "Message":
|
|
5083
5153
|
return { ...base, _tag: "Message", message: input.input.message };
|
|
5154
|
+
case "ToolCall":
|
|
5155
|
+
return { ...base, _tag: "ToolCall", part: input.input.part };
|
|
5156
|
+
case "ToolResult":
|
|
5157
|
+
return { ...base, _tag: "ToolResult", part: input.input.part };
|
|
5158
|
+
case "Memory":
|
|
5159
|
+
return { ...base, _tag: "Memory", items: input.input.items };
|
|
5160
|
+
case "Skill":
|
|
5161
|
+
return { ...base, _tag: "Skill", name: input.input.name, body: input.input.body };
|
|
5162
|
+
case "Steering":
|
|
5163
|
+
return { ...base, _tag: "Steering", message: input.input.message };
|
|
5164
|
+
case "Handoff":
|
|
5165
|
+
return { ...base, _tag: "Handoff", target: input.input.target, summary: input.input.summary };
|
|
5084
5166
|
case "Compaction":
|
|
5085
5167
|
return {
|
|
5086
5168
|
...base,
|
|
@@ -8318,7 +8400,7 @@ __export(exports_agent_loop_service, {
|
|
|
8318
8400
|
AgentLoopBudgetExceeded: () => AgentLoopBudgetExceeded
|
|
8319
8401
|
});
|
|
8320
8402
|
|
|
8321
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8403
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/agent.ts
|
|
8322
8404
|
var exports_agent = {};
|
|
8323
8405
|
__export(exports_agent, {
|
|
8324
8406
|
streamObject: () => streamObject,
|
|
@@ -8328,10 +8410,10 @@ __export(exports_agent, {
|
|
|
8328
8410
|
generate: () => generate,
|
|
8329
8411
|
defaultObjectPrompt: () => defaultObjectPrompt
|
|
8330
8412
|
});
|
|
8331
|
-
import { Cause as Cause3, Effect as Effect45, Fiber, Option as Option15, Queue as Queue2, Ref as Ref10, Schema as
|
|
8413
|
+
import { Cause as Cause3, Effect as Effect45, Fiber, Option as Option15, Queue as Queue2, Ref as Ref10, Schema as Schema47, Stream as Stream7 } from "effect";
|
|
8332
8414
|
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
8415
|
|
|
8334
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8416
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/agent-event.ts
|
|
8335
8417
|
var exports_agent_event = {};
|
|
8336
8418
|
__export(exports_agent_event, {
|
|
8337
8419
|
addUsage: () => addUsage,
|
|
@@ -8388,7 +8470,7 @@ class AgentSuspended extends Schema38.TaggedErrorClass()("@batonfx/core/AgentSus
|
|
|
8388
8470
|
}) {
|
|
8389
8471
|
}
|
|
8390
8472
|
|
|
8391
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8473
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/approvals.ts
|
|
8392
8474
|
var exports_approvals = {};
|
|
8393
8475
|
__export(exports_approvals, {
|
|
8394
8476
|
testLayer: () => testLayer26,
|
|
@@ -8404,7 +8486,7 @@ var autoApprove = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect3
|
|
|
8404
8486
|
var denyAll = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect31.succeed({ _tag: "Denied" }) }));
|
|
8405
8487
|
var testLayer26 = (implementation) => Layer29.succeed(Approvals, Approvals.of(implementation));
|
|
8406
8488
|
|
|
8407
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8489
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/compaction.ts
|
|
8408
8490
|
var exports_compaction = {};
|
|
8409
8491
|
__export(exports_compaction, {
|
|
8410
8492
|
truncate: () => truncate,
|
|
@@ -8422,7 +8504,7 @@ __export(exports_compaction, {
|
|
|
8422
8504
|
import { Context as Context32, Effect as Effect34, Layer as Layer32, Option as Option10, Schema as Schema41 } from "effect";
|
|
8423
8505
|
import { LanguageModel, Prompt as Prompt3, Tokenizer, Toolkit as Toolkit2 } from "effect/unstable/ai";
|
|
8424
8506
|
|
|
8425
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8507
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/session.ts
|
|
8426
8508
|
var exports_session = {};
|
|
8427
8509
|
__export(exports_session, {
|
|
8428
8510
|
testLayer: () => testLayer27,
|
|
@@ -8462,6 +8544,18 @@ var entryFromInput = (input, id2, parentId) => {
|
|
|
8462
8544
|
switch (input._tag) {
|
|
8463
8545
|
case "Message":
|
|
8464
8546
|
return { ...base, _tag: "Message", message: input.message };
|
|
8547
|
+
case "ToolCall":
|
|
8548
|
+
return { ...base, _tag: "ToolCall", part: input.part };
|
|
8549
|
+
case "ToolResult":
|
|
8550
|
+
return { ...base, _tag: "ToolResult", part: input.part };
|
|
8551
|
+
case "Memory":
|
|
8552
|
+
return { ...base, _tag: "Memory", items: input.items };
|
|
8553
|
+
case "Skill":
|
|
8554
|
+
return { ...base, _tag: "Skill", name: input.name, body: input.body };
|
|
8555
|
+
case "Steering":
|
|
8556
|
+
return { ...base, _tag: "Steering", message: input.message };
|
|
8557
|
+
case "Handoff":
|
|
8558
|
+
return { ...base, _tag: "Handoff", target: input.target, summary: input.summary };
|
|
8465
8559
|
case "Compaction":
|
|
8466
8560
|
return { ...base, _tag: "Compaction", summary: input.summary, firstKeptEntryId: input.firstKeptEntryId };
|
|
8467
8561
|
case "BranchSummary":
|
|
@@ -8524,6 +8618,17 @@ ${summary}
|
|
|
8524
8618
|
var branchSummaryMessage = (summary) => messageFromText("system", `<abandoned-branch-summary>
|
|
8525
8619
|
${summary}
|
|
8526
8620
|
</abandoned-branch-summary>`);
|
|
8621
|
+
var attributeValue = (value) => value.replaceAll("&", "&").replaceAll('"', """);
|
|
8622
|
+
var memoryMessage = (items) => messageFromText("system", `<memory>
|
|
8623
|
+
${items.join(`
|
|
8624
|
+
`)}
|
|
8625
|
+
</memory>`);
|
|
8626
|
+
var skillMessage = (entry) => messageFromText("system", `<skill name="${attributeValue(entry.name)}">
|
|
8627
|
+
${entry.body}
|
|
8628
|
+
</skill>`);
|
|
8629
|
+
var handoffMessage = (entry) => messageFromText("system", `<handoff target="${attributeValue(entry.target)}">
|
|
8630
|
+
${entry.summary}
|
|
8631
|
+
</handoff>`);
|
|
8527
8632
|
var projectedMessages = (path2) => {
|
|
8528
8633
|
const compactionIndex = path2.findLastIndex((entry) => entry._tag === "Compaction");
|
|
8529
8634
|
const messages = [];
|
|
@@ -8536,6 +8641,24 @@ var projectedMessages = (path2) => {
|
|
|
8536
8641
|
case "Message":
|
|
8537
8642
|
messages.push(entry.message);
|
|
8538
8643
|
break;
|
|
8644
|
+
case "ToolCall":
|
|
8645
|
+
messages.push(Prompt2.makeMessage("assistant", { content: [entry.part] }));
|
|
8646
|
+
break;
|
|
8647
|
+
case "ToolResult":
|
|
8648
|
+
messages.push(Prompt2.makeMessage("tool", { content: [entry.part] }));
|
|
8649
|
+
break;
|
|
8650
|
+
case "Memory":
|
|
8651
|
+
messages.push(memoryMessage(entry.items));
|
|
8652
|
+
break;
|
|
8653
|
+
case "Skill":
|
|
8654
|
+
messages.push(skillMessage(entry));
|
|
8655
|
+
break;
|
|
8656
|
+
case "Steering":
|
|
8657
|
+
messages.push(entry.message);
|
|
8658
|
+
break;
|
|
8659
|
+
case "Handoff":
|
|
8660
|
+
messages.push(handoffMessage(entry));
|
|
8661
|
+
break;
|
|
8539
8662
|
case "BranchSummary":
|
|
8540
8663
|
messages.push(branchSummaryMessage(entry.summary));
|
|
8541
8664
|
break;
|
|
@@ -8554,7 +8677,7 @@ var memoryLayer24 = Layer30.effect(SessionStore, Ref7.make(initialState).pipe(Ef
|
|
|
8554
8677
|
}))));
|
|
8555
8678
|
var testLayer27 = (implementation) => Layer30.succeed(SessionStore, SessionStore.of(implementation));
|
|
8556
8679
|
|
|
8557
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8680
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/tool-output.ts
|
|
8558
8681
|
var exports_tool_output = {};
|
|
8559
8682
|
__export(exports_tool_output, {
|
|
8560
8683
|
testLayer: () => testLayer28,
|
|
@@ -8614,7 +8737,7 @@ var bound = (result, options) => Effect33.gen(function* () {
|
|
|
8614
8737
|
return { _tag: "Success", result: output, encodedResult: output };
|
|
8615
8738
|
});
|
|
8616
8739
|
|
|
8617
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8740
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/compaction.ts
|
|
8618
8741
|
var DEFAULT_RESERVE_TOKENS = 16384;
|
|
8619
8742
|
var DEFAULT_KEEP_RECENT_TOKENS = 20000;
|
|
8620
8743
|
var SUMMARY_TEMPLATE = `Summarize the conversation so another agent can continue seamlessly.
|
|
@@ -8797,7 +8920,7 @@ var truncate = (maxTokens) => ({
|
|
|
8797
8920
|
var testLayer29 = (implementation) => Layer32.succeed(Compaction, Compaction.of(implementation));
|
|
8798
8921
|
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
8922
|
|
|
8800
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8923
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/instructions.ts
|
|
8801
8924
|
var exports_instructions = {};
|
|
8802
8925
|
__export(exports_instructions, {
|
|
8803
8926
|
testLayer: () => testLayer30,
|
|
@@ -8846,7 +8969,7 @@ var renderUpdate = (epoch, context) => Effect35.gen(function* () {
|
|
|
8846
8969
|
var layer27 = (sources) => Layer33.succeed(Instructions, Instructions.of({ sources: [...sources] }));
|
|
8847
8970
|
var testLayer30 = (implementation) => Layer33.succeed(Instructions, Instructions.of(implementation));
|
|
8848
8971
|
|
|
8849
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8972
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/memory.ts
|
|
8850
8973
|
var exports_memory = {};
|
|
8851
8974
|
__export(exports_memory, {
|
|
8852
8975
|
testLayer: () => testLayer31,
|
|
@@ -8875,7 +8998,7 @@ var merge = (first, second) => ({
|
|
|
8875
8998
|
var noopLayer = Layer34.succeed(Memory, Memory.of(noop));
|
|
8876
8999
|
var testLayer31 = (implementation) => Layer34.succeed(Memory, Memory.of(implementation));
|
|
8877
9000
|
|
|
8878
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9001
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/model-middleware.ts
|
|
8879
9002
|
var exports_model_middleware = {};
|
|
8880
9003
|
__export(exports_model_middleware, {
|
|
8881
9004
|
layer: () => layer28,
|
|
@@ -8889,7 +9012,7 @@ class ModelMiddleware extends Context35.Service()("@batonfx/core/ModelMiddleware
|
|
|
8889
9012
|
var identityLayer = Layer35.succeed(ModelMiddleware, []);
|
|
8890
9013
|
var layer28 = (middleware) => Layer35.succeed(ModelMiddleware, middleware);
|
|
8891
9014
|
|
|
8892
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9015
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/model-resilience.ts
|
|
8893
9016
|
var exports_model_resilience = {};
|
|
8894
9017
|
__export(exports_model_resilience, {
|
|
8895
9018
|
testLayer: () => testLayer32,
|
|
@@ -8935,7 +9058,7 @@ var apply = (model, resilience) => ({
|
|
|
8935
9058
|
}).pipe(Stream5.retry(retryStreamSchedule(resilience)))
|
|
8936
9059
|
});
|
|
8937
9060
|
|
|
8938
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9061
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/permissions.ts
|
|
8939
9062
|
var exports_permissions = {};
|
|
8940
9063
|
__export(exports_permissions, {
|
|
8941
9064
|
testLayer: () => testLayer33,
|
|
@@ -9065,7 +9188,7 @@ var ruleStoreMemory = (initialRules = []) => Layer37.effect(RuleStore, Ref9.make
|
|
|
9065
9188
|
var ruleStoreTestLayer = (implementation) => Layer37.succeed(RuleStore, RuleStore.of(implementation));
|
|
9066
9189
|
var testLayer33 = (implementation) => Layer37.succeed(Permissions, Permissions.of(implementation));
|
|
9067
9190
|
|
|
9068
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9191
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/skill-source.ts
|
|
9069
9192
|
var exports_skill_source = {};
|
|
9070
9193
|
__export(exports_skill_source, {
|
|
9071
9194
|
testLayer: () => testLayer34,
|
|
@@ -9123,37 +9246,64 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
9123
9246
|
return selected;
|
|
9124
9247
|
};
|
|
9125
9248
|
|
|
9126
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9249
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/steering.ts
|
|
9127
9250
|
var exports_steering = {};
|
|
9128
9251
|
__export(exports_steering, {
|
|
9129
9252
|
testLayer: () => testLayer35,
|
|
9130
9253
|
layer: () => layer30,
|
|
9254
|
+
SteeringQueueFull: () => SteeringQueueFull,
|
|
9131
9255
|
Steering: () => Steering
|
|
9132
9256
|
});
|
|
9133
|
-
import { Context as Context39, Effect as Effect41, Exit, Layer as Layer39, Queue } from "effect";
|
|
9257
|
+
import { Context as Context39, Effect as Effect41, Exit, Layer as Layer39, Queue, Schema as Schema45 } from "effect";
|
|
9134
9258
|
|
|
9135
9259
|
class Steering extends Context39.Service()("@batonfx/core/Steering") {
|
|
9136
9260
|
}
|
|
9261
|
+
|
|
9262
|
+
class SteeringQueueFull extends Schema45.TaggedErrorClass()("@batonfx/core/SteeringQueueFull", {
|
|
9263
|
+
queue: Schema45.Literals(["steering", "followUp"]),
|
|
9264
|
+
capacity: Schema45.Number
|
|
9265
|
+
}) {
|
|
9266
|
+
}
|
|
9267
|
+
var resolvePolicy = (policy, mode) => ({
|
|
9268
|
+
mode: policy?.mode ?? mode,
|
|
9269
|
+
...policy?.capacity === undefined ? {} : { capacity: policy.capacity },
|
|
9270
|
+
onFull: policy?.onFull ?? "fail"
|
|
9271
|
+
});
|
|
9272
|
+
var queueStrategy = (strategy) => {
|
|
9273
|
+
switch (strategy) {
|
|
9274
|
+
case "drop-oldest":
|
|
9275
|
+
return "sliding";
|
|
9276
|
+
case "drop-newest":
|
|
9277
|
+
case "fail":
|
|
9278
|
+
return "dropping";
|
|
9279
|
+
case "suspend":
|
|
9280
|
+
return "suspend";
|
|
9281
|
+
}
|
|
9282
|
+
};
|
|
9283
|
+
var makeQueue = (name, policy) => (policy.capacity === undefined ? Queue.unbounded() : Queue.make({ capacity: policy.capacity, strategy: queueStrategy(policy.onFull) })).pipe(Effect41.map((queue) => ({ name, queue, policy })));
|
|
9284
|
+
var offer = (runtime, message) => Queue.offer(runtime.queue, message).pipe(Effect41.flatMap((offered) => {
|
|
9285
|
+
if (offered || runtime.policy.capacity === undefined || runtime.policy.onFull !== "fail")
|
|
9286
|
+
return Effect41.void;
|
|
9287
|
+
return Effect41.fail(new SteeringQueueFull({ queue: runtime.name, capacity: runtime.policy.capacity }));
|
|
9288
|
+
}));
|
|
9137
9289
|
var drainOne = (queue) => Effect41.sync(() => {
|
|
9138
9290
|
const taken = Queue.takeUnsafe(queue);
|
|
9139
9291
|
return taken === undefined || !Exit.isSuccess(taken) ? [] : [taken.value];
|
|
9140
9292
|
});
|
|
9141
9293
|
var drain = (queue, mode) => mode === "all" ? Queue.clear(queue) : drainOne(queue);
|
|
9142
9294
|
var layer30 = (options = {}) => Layer39.effect(Steering, Effect41.gen(function* () {
|
|
9143
|
-
const steeringQueue = yield*
|
|
9144
|
-
const followUpQueue = yield*
|
|
9145
|
-
const steeringMode = options.steeringMode ?? "all";
|
|
9146
|
-
const followUpMode = options.followUpMode ?? "one-at-a-time";
|
|
9295
|
+
const steeringQueue = yield* makeQueue("steering", resolvePolicy(options.steering, "all"));
|
|
9296
|
+
const followUpQueue = yield* makeQueue("followUp", resolvePolicy(options.followUp, "one-at-a-time"));
|
|
9147
9297
|
return Steering.of({
|
|
9148
|
-
steer: (message) =>
|
|
9149
|
-
followUp: (message) =>
|
|
9150
|
-
takeSteering: () => drain(steeringQueue,
|
|
9151
|
-
takeFollowUp: () => drain(followUpQueue,
|
|
9298
|
+
steer: (message) => offer(steeringQueue, message),
|
|
9299
|
+
followUp: (message) => offer(followUpQueue, message),
|
|
9300
|
+
takeSteering: () => drain(steeringQueue.queue, steeringQueue.policy.mode),
|
|
9301
|
+
takeFollowUp: () => drain(followUpQueue.queue, followUpQueue.policy.mode)
|
|
9152
9302
|
});
|
|
9153
9303
|
}));
|
|
9154
9304
|
var testLayer35 = (implementation) => Layer39.succeed(Steering, Steering.of(implementation));
|
|
9155
9305
|
|
|
9156
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9306
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/tool-context.ts
|
|
9157
9307
|
var exports_tool_context = {};
|
|
9158
9308
|
__export(exports_tool_context, {
|
|
9159
9309
|
testLayer: () => testLayer36,
|
|
@@ -9171,7 +9321,7 @@ var layerDefault = Layer40.sync(ToolContext, () => ToolContext.of({
|
|
|
9171
9321
|
}));
|
|
9172
9322
|
var testLayer36 = (implementation) => Layer40.succeed(ToolContext, ToolContext.of(implementation));
|
|
9173
9323
|
|
|
9174
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9324
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/tool-executor.ts
|
|
9175
9325
|
var exports_tool_executor = {};
|
|
9176
9326
|
__export(exports_tool_executor, {
|
|
9177
9327
|
testLayer: () => testLayer37,
|
|
@@ -9186,7 +9336,7 @@ __export(exports_tool_executor, {
|
|
|
9186
9336
|
client: () => client,
|
|
9187
9337
|
ToolExecutor: () => ToolExecutor
|
|
9188
9338
|
});
|
|
9189
|
-
import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Schema as
|
|
9339
|
+
import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Schema as Schema46, Sink as Sink2, Stream as Stream6 } from "effect";
|
|
9190
9340
|
class ToolExecutor extends Context41.Service()("@batonfx/core/ToolExecutor") {
|
|
9191
9341
|
}
|
|
9192
9342
|
var failureMessage = (cause) => {
|
|
@@ -9209,10 +9359,10 @@ var resultMessage = (result) => {
|
|
|
9209
9359
|
var schemaMessage = (error) => error instanceof Error ? error.message : typeof error === "string" ? error : resultMessage(error);
|
|
9210
9360
|
var decodeSuccess = (tool2, result) => {
|
|
9211
9361
|
const successSchema = tool2.successSchema;
|
|
9212
|
-
if (!
|
|
9362
|
+
if (!Schema46.isSchema(successSchema)) {
|
|
9213
9363
|
return Effect43.succeed({ _tag: "Success", result, encodedResult: result });
|
|
9214
9364
|
}
|
|
9215
|
-
return
|
|
9365
|
+
return Schema46.decodeUnknownEffect(successSchema)(result).pipe(Effect43.flatMap((decoded) => Schema46.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
9366
|
};
|
|
9217
9367
|
var placementOutcome = (placement, tool2, response) => {
|
|
9218
9368
|
switch (response._tag) {
|
|
@@ -9297,7 +9447,7 @@ function router(routes) {
|
|
|
9297
9447
|
}
|
|
9298
9448
|
var testLayer37 = (implementation) => Layer41.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
9299
9449
|
|
|
9300
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9450
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/turn-policy.ts
|
|
9301
9451
|
var exports_turn_policy = {};
|
|
9302
9452
|
__export(exports_turn_policy, {
|
|
9303
9453
|
untilToolCall: () => untilToolCall,
|
|
@@ -9336,7 +9486,7 @@ var both = (first, second) => make4((info) => Effect44.gen(function* () {
|
|
|
9336
9486
|
}));
|
|
9337
9487
|
var defaultPolicy = recurs(8);
|
|
9338
9488
|
|
|
9339
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9489
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/agent.ts
|
|
9340
9490
|
function make5(nameOrOptions, options = {}) {
|
|
9341
9491
|
const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
|
|
9342
9492
|
return {
|
|
@@ -9347,16 +9497,22 @@ function make5(nameOrOptions, options = {}) {
|
|
|
9347
9497
|
};
|
|
9348
9498
|
}
|
|
9349
9499
|
var defaultObjectPrompt = "Return the final structured output for the task above.";
|
|
9500
|
+
var steeringDrainedEvent = (turn, queue, messages) => ({
|
|
9501
|
+
_tag: "SteeringDrained",
|
|
9502
|
+
turn,
|
|
9503
|
+
queue,
|
|
9504
|
+
count: messages.length
|
|
9505
|
+
});
|
|
9350
9506
|
var skillListingBudgetTokens = 2048;
|
|
9351
9507
|
var activateSkillToolName = "activate_skill";
|
|
9352
|
-
var activateSkillParameters =
|
|
9508
|
+
var activateSkillParameters = Schema47.Struct({ name: Schema47.String });
|
|
9353
9509
|
var activateSkillTool = Tool4.make(activateSkillToolName, {
|
|
9354
9510
|
description: "Load the full body for one listed Baton skill by name before applying that skill.",
|
|
9355
9511
|
parameters: activateSkillParameters,
|
|
9356
|
-
success:
|
|
9357
|
-
name:
|
|
9358
|
-
body:
|
|
9359
|
-
allowedTools:
|
|
9512
|
+
success: Schema47.Struct({
|
|
9513
|
+
name: Schema47.String,
|
|
9514
|
+
body: Schema47.String,
|
|
9515
|
+
allowedTools: Schema47.Array(Schema47.String)
|
|
9360
9516
|
})
|
|
9361
9517
|
});
|
|
9362
9518
|
var errorMessage = (error) => error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
@@ -9531,9 +9687,9 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9531
9687
|
}
|
|
9532
9688
|
userParts.push(part);
|
|
9533
9689
|
}
|
|
9534
|
-
const
|
|
9690
|
+
const memoryMessage2 = Prompt4.makeMessage("user", { content: userParts });
|
|
9535
9691
|
const [first, ...rest] = prompt.content;
|
|
9536
|
-
return first?.role === "system" ? Prompt4.fromMessages([first,
|
|
9692
|
+
return first?.role === "system" ? Prompt4.fromMessages([first, memoryMessage2, ...rest]) : Prompt4.fromMessages([memoryMessage2, ...prompt.content]);
|
|
9537
9693
|
});
|
|
9538
9694
|
const recallInitialPrompt = (prompt) => memoryRuntime === undefined ? Effect45.succeed(prompt) : memoryRuntime.service.recall({ key: memoryRuntime.key, turn: 0, prompt }).pipe(Effect45.mapError((error) => memoryError(0, error)), Effect45.flatMap((items) => insertRecalledItems(0, prompt, items)));
|
|
9539
9695
|
const rememberTurn = (turn, transcript, terminal) => memoryRuntime === undefined ? Effect45.void : memoryRuntime.service.remember({ key: memoryRuntime.key, turn, transcript, terminal }).pipe(Effect45.mapError((error) => memoryError(turn, error)));
|
|
@@ -9659,7 +9815,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9659
9815
|
const activateSkillOutcome = (turn, call) => Effect45.gen(function* () {
|
|
9660
9816
|
if (skillRuntime === undefined)
|
|
9661
9817
|
return { _tag: "Failure", message: "SkillSource is not available" };
|
|
9662
|
-
const params =
|
|
9818
|
+
const params = Schema47.decodeUnknownOption(activateSkillParameters)(call.params);
|
|
9663
9819
|
if (Option15.isNone(params))
|
|
9664
9820
|
return { _tag: "Failure", message: "Skill activation requires a name" };
|
|
9665
9821
|
const skill = yield* skillRuntime.source.get(params.value.name).pipe(Effect45.mapError((error) => skillError(turn, error)));
|
|
@@ -9898,7 +10054,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9898
10054
|
const followUp = yield* takeFollowUp();
|
|
9899
10055
|
if (followUp.length > 0) {
|
|
9900
10056
|
return {
|
|
9901
|
-
events: Stream7.fromIterable([completed]),
|
|
10057
|
+
events: Stream7.fromIterable([completed, steeringDrainedEvent(turn, "followUp", followUp)]),
|
|
9902
10058
|
next: { prompt: promptFromSteeringMessages(followUp) }
|
|
9903
10059
|
};
|
|
9904
10060
|
}
|
|
@@ -9934,7 +10090,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9934
10090
|
const basePrompt = steering.length === 0 ? toolPrompt : Prompt4.concat(promptFromSteeringMessages(steering), toolPrompt);
|
|
9935
10091
|
const prompt = decision2.overrides?.instructions === undefined ? basePrompt : withSystem(decision2.overrides.instructions, basePrompt);
|
|
9936
10092
|
return {
|
|
9937
|
-
events: Stream7.fromIterable([completed]),
|
|
10093
|
+
events: Stream7.fromIterable(steering.length === 0 ? [completed] : [completed, steeringDrainedEvent(turn, "steering", steering)]),
|
|
9938
10094
|
next: { prompt, ...decision2.overrides === undefined ? {} : { overrides: decision2.overrides } }
|
|
9939
10095
|
};
|
|
9940
10096
|
});
|
|
@@ -10013,14 +10169,14 @@ var generateObject = (agent, options) => Stream7.runFold(streamObject(agent, opt
|
|
|
10013
10169
|
})
|
|
10014
10170
|
})
|
|
10015
10171
|
})));
|
|
10016
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10172
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/agent-tool.ts
|
|
10017
10173
|
var exports_agent_tool = {};
|
|
10018
10174
|
__export(exports_agent_tool, {
|
|
10019
10175
|
asTool: () => asTool
|
|
10020
10176
|
});
|
|
10021
|
-
import { Cause as Cause4, Effect as Effect46, Schema as
|
|
10177
|
+
import { Cause as Cause4, Effect as Effect46, Schema as Schema48 } from "effect";
|
|
10022
10178
|
import { Tool as Tool5, Toolkit as Toolkit4 } from "effect/unstable/ai";
|
|
10023
|
-
var defaultParameters =
|
|
10179
|
+
var defaultParameters = Schema48.Struct({ prompt: Schema48.String });
|
|
10024
10180
|
var errorMessage2 = (error) => {
|
|
10025
10181
|
if (error instanceof AgentSuspended) {
|
|
10026
10182
|
return `suspended on ${error.tool_name}: ${error.reason}`;
|
|
@@ -10046,14 +10202,14 @@ var lazyHandled = (toolkit, name, handler) => ({
|
|
|
10046
10202
|
var asTool = (agent, options = {}) => {
|
|
10047
10203
|
const name = options.name ?? agent.name;
|
|
10048
10204
|
const parameters = options.parameters ?? defaultParameters;
|
|
10049
|
-
const success2 = options.success ??
|
|
10205
|
+
const success2 = options.success ?? Schema48.String;
|
|
10050
10206
|
const toPrompt = options.toPrompt ?? ((params) => params.prompt);
|
|
10051
10207
|
const fromResult = options.fromResult ?? ((result) => result.text);
|
|
10052
10208
|
const tool2 = Tool5.make(name, {
|
|
10053
10209
|
...options.description === undefined ? {} : { description: options.description },
|
|
10054
10210
|
parameters,
|
|
10055
10211
|
success: success2,
|
|
10056
|
-
failure:
|
|
10212
|
+
failure: Schema48.String,
|
|
10057
10213
|
failureMode: "return"
|
|
10058
10214
|
});
|
|
10059
10215
|
const toolkit = Toolkit4.make(tool2);
|
|
@@ -10071,7 +10227,7 @@ var asTool = (agent, options = {}) => {
|
|
|
10071
10227
|
});
|
|
10072
10228
|
return lazyHandled(toolkit, name, handler);
|
|
10073
10229
|
};
|
|
10074
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10230
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/guardrail.ts
|
|
10075
10231
|
var exports_guardrail = {};
|
|
10076
10232
|
__export(exports_guardrail, {
|
|
10077
10233
|
validateInput: () => validateInput2,
|
|
@@ -10151,16 +10307,16 @@ var redactOutput = (options) => ({
|
|
|
10151
10307
|
var filterOutput = (keep) => ({
|
|
10152
10308
|
transformPart: (part, context) => Effect47.succeed(part.type === "tool-call" || keep(part, context) ? Option16.some(part) : Option16.none())
|
|
10153
10309
|
});
|
|
10154
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10310
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/handoff.ts
|
|
10155
10311
|
var exports_handoff = {};
|
|
10156
10312
|
__export(exports_handoff, {
|
|
10157
10313
|
transferTool: () => transferTool,
|
|
10158
10314
|
supervisor: () => supervisor,
|
|
10159
10315
|
fanOut: () => fanOut
|
|
10160
10316
|
});
|
|
10161
|
-
import { Effect as Effect48, Schema as
|
|
10317
|
+
import { Effect as Effect48, Schema as Schema49 } from "effect";
|
|
10162
10318
|
import { AiError as AiError2, Toolkit as Toolkit5 } from "effect/unstable/ai";
|
|
10163
|
-
var defaultTransferParameters =
|
|
10319
|
+
var defaultTransferParameters = Schema49.Struct({ prompt: Schema49.String });
|
|
10164
10320
|
var transferName = (agentName) => `transfer_to_${agentName}`;
|
|
10165
10321
|
var positiveConcurrency = (value) => {
|
|
10166
10322
|
const concurrency = value ?? 4;
|
|
@@ -10214,7 +10370,7 @@ var supervisor = (options) => {
|
|
|
10214
10370
|
toolkit
|
|
10215
10371
|
};
|
|
10216
10372
|
};
|
|
10217
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10373
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/model-registry.ts
|
|
10218
10374
|
var exports_model_registry = {};
|
|
10219
10375
|
__export(exports_model_registry, {
|
|
10220
10376
|
testLayer: () => testLayer38,
|
|
@@ -10229,13 +10385,13 @@ __export(exports_model_registry, {
|
|
|
10229
10385
|
Service: () => Service29,
|
|
10230
10386
|
LanguageModelNotRegistered: () => LanguageModelNotRegistered
|
|
10231
10387
|
});
|
|
10232
|
-
import { Chunk as Chunk2, Context as Context42, Effect as Effect49, Layer as Layer43, Option as Option17, Ref as Ref11, Schema as
|
|
10388
|
+
import { Chunk as Chunk2, Context as Context42, Effect as Effect49, Layer as Layer43, Option as Option17, Ref as Ref11, Schema as Schema50, Semaphore as Semaphore3 } from "effect";
|
|
10233
10389
|
import { Model } from "effect/unstable/ai";
|
|
10234
10390
|
|
|
10235
|
-
class LanguageModelNotRegistered extends
|
|
10236
|
-
provider:
|
|
10237
|
-
model:
|
|
10238
|
-
registration_key:
|
|
10391
|
+
class LanguageModelNotRegistered extends Schema50.TaggedErrorClass()("LanguageModelNotRegistered", {
|
|
10392
|
+
provider: Schema50.String,
|
|
10393
|
+
model: Schema50.String,
|
|
10394
|
+
registration_key: Schema50.optionalKey(Schema50.String)
|
|
10239
10395
|
}) {
|
|
10240
10396
|
}
|
|
10241
10397
|
|
|
@@ -10303,7 +10459,7 @@ var provide = (selection, effect) => Effect49.gen(function* () {
|
|
|
10303
10459
|
return yield* service.provide(selection, effect);
|
|
10304
10460
|
});
|
|
10305
10461
|
|
|
10306
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10462
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.3/node_modules/@batonfx/core/src/index.ts
|
|
10307
10463
|
import {
|
|
10308
10464
|
AiError as AiError3,
|
|
10309
10465
|
Chat as Chat2,
|
|
@@ -10321,7 +10477,7 @@ import {
|
|
|
10321
10477
|
} from "effect/unstable/ai";
|
|
10322
10478
|
|
|
10323
10479
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
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
|
|
10480
|
+
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 Schema63, Stream as Stream8 } from "effect";
|
|
10325
10481
|
import { Chat as Chat3, LanguageModel as LanguageModel6, Prompt as Prompt12, Tokenizer as Tokenizer4, Toolkit as Toolkit7 } from "effect/unstable/ai";
|
|
10326
10482
|
|
|
10327
10483
|
// ../runtime/src/child/child-run-service.ts
|
|
@@ -10341,31 +10497,31 @@ __export(exports_child_run_service, {
|
|
|
10341
10497
|
ChildRunScopeBroadened: () => ChildRunScopeBroadened,
|
|
10342
10498
|
ChildRunModelMissing: () => ChildRunModelMissing
|
|
10343
10499
|
});
|
|
10344
|
-
import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as
|
|
10500
|
+
import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as Schema52 } from "effect";
|
|
10345
10501
|
|
|
10346
10502
|
// ../runtime/src/workspace/workspace-provider-service.ts
|
|
10347
|
-
import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as
|
|
10503
|
+
import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as Schema51 } from "effect";
|
|
10348
10504
|
|
|
10349
|
-
class WorkspaceNotFound extends
|
|
10505
|
+
class WorkspaceNotFound extends Schema51.TaggedErrorClass()("WorkspaceNotFound", {
|
|
10350
10506
|
sandbox_ref: exports_ids_schema.WorkspaceRef
|
|
10351
10507
|
}) {
|
|
10352
10508
|
}
|
|
10353
10509
|
|
|
10354
|
-
class WorkspaceUnavailable extends
|
|
10510
|
+
class WorkspaceUnavailable extends Schema51.TaggedErrorClass()("WorkspaceUnavailable", {
|
|
10355
10511
|
sandbox_ref: exports_ids_schema.WorkspaceRef,
|
|
10356
|
-
message:
|
|
10512
|
+
message: Schema51.String
|
|
10357
10513
|
}) {
|
|
10358
10514
|
}
|
|
10359
10515
|
|
|
10360
|
-
class WorkspaceCapabilityUnsupported extends
|
|
10361
|
-
capability:
|
|
10516
|
+
class WorkspaceCapabilityUnsupported extends Schema51.TaggedErrorClass()("WorkspaceCapabilityUnsupported", {
|
|
10517
|
+
capability: Schema51.Literals(["suspend", "snapshot", "fork"]),
|
|
10362
10518
|
provider_key: exports_workspace_schema.WorkspaceProviderKey
|
|
10363
10519
|
}) {
|
|
10364
10520
|
}
|
|
10365
10521
|
|
|
10366
|
-
class WorkspaceProviderError extends
|
|
10522
|
+
class WorkspaceProviderError extends Schema51.TaggedErrorClass()("WorkspaceProviderError", {
|
|
10367
10523
|
provider_key: exports_workspace_schema.WorkspaceProviderKey,
|
|
10368
|
-
message:
|
|
10524
|
+
message: Schema51.String
|
|
10369
10525
|
}) {
|
|
10370
10526
|
}
|
|
10371
10527
|
|
|
@@ -10397,28 +10553,28 @@ var destroy = Effect50.fn("WorkspaceProvider.destroy.call")(function* (ref) {
|
|
|
10397
10553
|
});
|
|
10398
10554
|
|
|
10399
10555
|
// ../runtime/src/child/child-run-service.ts
|
|
10400
|
-
class StaticChildRunPresetNotFound extends
|
|
10556
|
+
class StaticChildRunPresetNotFound extends Schema52.TaggedErrorClass()("StaticChildRunPresetNotFound", {
|
|
10401
10557
|
preset_name: exports_shared_schema.NonEmptyString
|
|
10402
10558
|
}) {
|
|
10403
10559
|
}
|
|
10404
10560
|
|
|
10405
|
-
class ChildRunScopeBroadened extends
|
|
10406
|
-
field:
|
|
10561
|
+
class ChildRunScopeBroadened extends Schema52.TaggedErrorClass()("ChildRunScopeBroadened", {
|
|
10562
|
+
field: Schema52.Literals(["tool_names", "permissions"]),
|
|
10407
10563
|
value: exports_shared_schema.NonEmptyString
|
|
10408
10564
|
}) {
|
|
10409
10565
|
}
|
|
10410
10566
|
|
|
10411
|
-
class ChildRunServiceError extends
|
|
10412
|
-
message:
|
|
10567
|
+
class ChildRunServiceError extends Schema52.TaggedErrorClass()("ChildRunServiceError", {
|
|
10568
|
+
message: Schema52.String
|
|
10413
10569
|
}) {
|
|
10414
10570
|
}
|
|
10415
10571
|
|
|
10416
|
-
class ChildRunWorkspaceUnavailable extends
|
|
10417
|
-
reason:
|
|
10572
|
+
class ChildRunWorkspaceUnavailable extends Schema52.TaggedErrorClass()("ChildRunWorkspaceUnavailable", {
|
|
10573
|
+
reason: Schema52.String
|
|
10418
10574
|
}) {
|
|
10419
10575
|
}
|
|
10420
10576
|
|
|
10421
|
-
class ChildRunModelMissing extends
|
|
10577
|
+
class ChildRunModelMissing extends Schema52.TaggedErrorClass()("ChildRunModelMissing", {}) {
|
|
10422
10578
|
}
|
|
10423
10579
|
|
|
10424
10580
|
class Service31 extends Context44.Service()("@relayfx/runtime/ChildRunService") {
|
|
@@ -10646,26 +10802,26 @@ var spawnDynamic = Effect51.fn("ChildRunService.spawnDynamic.call")(function* (i
|
|
|
10646
10802
|
});
|
|
10647
10803
|
|
|
10648
10804
|
// ../runtime/src/child/spawn-child-run-tool.ts
|
|
10649
|
-
import { Effect as Effect52, Schema as
|
|
10805
|
+
import { Effect as Effect52, Schema as Schema53 } from "effect";
|
|
10650
10806
|
var toolName = "spawn_child_run";
|
|
10651
10807
|
var permissionName = "relay.child_run.spawn";
|
|
10652
|
-
var Input =
|
|
10653
|
-
preset_name:
|
|
10654
|
-
instructions:
|
|
10655
|
-
model:
|
|
10656
|
-
tool_names:
|
|
10657
|
-
permissions:
|
|
10658
|
-
output_schema_ref:
|
|
10659
|
-
metadata:
|
|
10660
|
-
input:
|
|
10808
|
+
var Input = Schema53.Struct({
|
|
10809
|
+
preset_name: Schema53.optionalKey(exports_shared_schema.NonEmptyString),
|
|
10810
|
+
instructions: Schema53.optionalKey(Schema53.String),
|
|
10811
|
+
model: Schema53.optionalKey(exports_agent_schema.ModelSelection),
|
|
10812
|
+
tool_names: Schema53.optionalKey(Schema53.Array(Schema53.String)),
|
|
10813
|
+
permissions: Schema53.optionalKey(Schema53.Array(Schema53.String)),
|
|
10814
|
+
output_schema_ref: Schema53.optionalKey(Schema53.String),
|
|
10815
|
+
metadata: Schema53.optionalKey(exports_shared_schema.Metadata),
|
|
10816
|
+
input: Schema53.optionalKey(Schema53.Array(exports_content_schema.Part))
|
|
10661
10817
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Input" });
|
|
10662
|
-
var Output =
|
|
10818
|
+
var Output = Schema53.Struct({
|
|
10663
10819
|
child_execution_id: exports_ids_schema.ChildExecutionId,
|
|
10664
|
-
status:
|
|
10665
|
-
output:
|
|
10820
|
+
status: Schema53.Literals(["completed", "failed", "cancelled"]),
|
|
10821
|
+
output: Schema53.Array(exports_content_schema.Part)
|
|
10666
10822
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Output" });
|
|
10667
|
-
var TransferInput =
|
|
10668
|
-
input:
|
|
10823
|
+
var TransferInput = Schema53.Struct({
|
|
10824
|
+
input: Schema53.optionalKey(Schema53.Array(exports_content_schema.Part))
|
|
10669
10825
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.TransferInput" });
|
|
10670
10826
|
var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
|
|
10671
10827
|
var parentContext = (agent) => ({
|
|
@@ -10852,17 +11008,17 @@ var transferTools = (config) => (config.agent.handoff_targets ?? []).map((target
|
|
|
10852
11008
|
});
|
|
10853
11009
|
|
|
10854
11010
|
// ../runtime/src/memory/memory-service.ts
|
|
10855
|
-
import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as
|
|
11011
|
+
import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as Schema55 } from "effect";
|
|
10856
11012
|
import { EmbeddingModel as EmbeddingModel3, Prompt as Prompt9 } from "effect/unstable/ai";
|
|
10857
11013
|
|
|
10858
11014
|
// ../runtime/src/model/embedding-model-service.ts
|
|
10859
|
-
import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as
|
|
11015
|
+
import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as Schema54 } from "effect";
|
|
10860
11016
|
import { EmbeddingModel as EmbeddingModel2, Model as Model3 } from "effect/unstable/ai";
|
|
10861
11017
|
|
|
10862
|
-
class EmbeddingModelNotRegistered extends
|
|
10863
|
-
provider:
|
|
10864
|
-
model:
|
|
10865
|
-
registration_key:
|
|
11018
|
+
class EmbeddingModelNotRegistered extends Schema54.TaggedErrorClass()("EmbeddingModelNotRegistered", {
|
|
11019
|
+
provider: Schema54.String,
|
|
11020
|
+
model: Schema54.String,
|
|
11021
|
+
registration_key: Schema54.optionalKey(Schema54.String)
|
|
10866
11022
|
}) {
|
|
10867
11023
|
}
|
|
10868
11024
|
|
|
@@ -10988,7 +11144,7 @@ var defaultTopK = 5;
|
|
|
10988
11144
|
var memoryError = (error) => new exports_memory.MemoryError({
|
|
10989
11145
|
message: error instanceof Error ? `${error.name}: ${error.message}` : String(error)
|
|
10990
11146
|
});
|
|
10991
|
-
var decodeSubject = (subject) =>
|
|
11147
|
+
var decodeSubject = (subject) => Schema55.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(subject).pipe(Effect54.mapError(memoryError));
|
|
10992
11148
|
var textPart = (text3) => Prompt9.makePart("text", { text: text3 });
|
|
10993
11149
|
var textFromParts = (parts) => parts.filter((part) => part.type === "text").map((part) => part.text).join(`
|
|
10994
11150
|
`).trim();
|
|
@@ -11210,9 +11366,9 @@ __export(exports_schema_registry_service, {
|
|
|
11210
11366
|
Service: () => Service36,
|
|
11211
11367
|
SchemaRefNotRegistered: () => SchemaRefNotRegistered
|
|
11212
11368
|
});
|
|
11213
|
-
import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as
|
|
11369
|
+
import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as Schema56 } from "effect";
|
|
11214
11370
|
|
|
11215
|
-
class SchemaRefNotRegistered extends
|
|
11371
|
+
class SchemaRefNotRegistered extends Schema56.TaggedErrorClass()("SchemaRefNotRegistered", { schema_ref: exports_shared_schema.NonEmptyString }) {
|
|
11216
11372
|
}
|
|
11217
11373
|
|
|
11218
11374
|
class Service36 extends Context49.Service()("@relayfx/runtime/SchemaRegistry") {
|
|
@@ -11270,6 +11426,44 @@ var toAppendInput = (input) => {
|
|
|
11270
11426
|
message: input.message,
|
|
11271
11427
|
...input.metadata === undefined ? {} : { metadata: metadata10(input.metadata) }
|
|
11272
11428
|
};
|
|
11429
|
+
case "ToolCall":
|
|
11430
|
+
return {
|
|
11431
|
+
_tag: "ToolCall",
|
|
11432
|
+
part: input.part,
|
|
11433
|
+
...input.metadata === undefined ? {} : { metadata: metadata10(input.metadata) }
|
|
11434
|
+
};
|
|
11435
|
+
case "ToolResult":
|
|
11436
|
+
return {
|
|
11437
|
+
_tag: "ToolResult",
|
|
11438
|
+
part: input.part,
|
|
11439
|
+
...input.metadata === undefined ? {} : { metadata: metadata10(input.metadata) }
|
|
11440
|
+
};
|
|
11441
|
+
case "Memory":
|
|
11442
|
+
return {
|
|
11443
|
+
_tag: "Memory",
|
|
11444
|
+
items: input.items,
|
|
11445
|
+
...input.metadata === undefined ? {} : { metadata: metadata10(input.metadata) }
|
|
11446
|
+
};
|
|
11447
|
+
case "Skill":
|
|
11448
|
+
return {
|
|
11449
|
+
_tag: "Skill",
|
|
11450
|
+
name: input.name,
|
|
11451
|
+
body: input.body,
|
|
11452
|
+
...input.metadata === undefined ? {} : { metadata: metadata10(input.metadata) }
|
|
11453
|
+
};
|
|
11454
|
+
case "Steering":
|
|
11455
|
+
return {
|
|
11456
|
+
_tag: "Steering",
|
|
11457
|
+
message: input.message,
|
|
11458
|
+
...input.metadata === undefined ? {} : { metadata: metadata10(input.metadata) }
|
|
11459
|
+
};
|
|
11460
|
+
case "Handoff":
|
|
11461
|
+
return {
|
|
11462
|
+
_tag: "Handoff",
|
|
11463
|
+
target: input.target,
|
|
11464
|
+
summary: input.summary,
|
|
11465
|
+
...input.metadata === undefined ? {} : { metadata: metadata10(input.metadata) }
|
|
11466
|
+
};
|
|
11273
11467
|
case "Compaction":
|
|
11274
11468
|
return {
|
|
11275
11469
|
_tag: "Compaction",
|
|
@@ -11345,16 +11539,16 @@ __export(exports_blob_store_service, {
|
|
|
11345
11539
|
BlobStoreError: () => BlobStoreError,
|
|
11346
11540
|
BlobNotResolvable: () => BlobNotResolvable
|
|
11347
11541
|
});
|
|
11348
|
-
import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as
|
|
11542
|
+
import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as Schema57 } from "effect";
|
|
11349
11543
|
|
|
11350
|
-
class BlobNotResolvable extends
|
|
11351
|
-
uri:
|
|
11352
|
-
reason:
|
|
11544
|
+
class BlobNotResolvable extends Schema57.TaggedErrorClass()("BlobNotResolvable", {
|
|
11545
|
+
uri: Schema57.String,
|
|
11546
|
+
reason: Schema57.String
|
|
11353
11547
|
}) {
|
|
11354
11548
|
}
|
|
11355
11549
|
|
|
11356
|
-
class BlobStoreError extends
|
|
11357
|
-
message:
|
|
11550
|
+
class BlobStoreError extends Schema57.TaggedErrorClass()("BlobStoreError", {
|
|
11551
|
+
message: Schema57.String
|
|
11358
11552
|
}) {
|
|
11359
11553
|
}
|
|
11360
11554
|
|
|
@@ -11427,7 +11621,7 @@ __export(exports_prompt_assembler_service, {
|
|
|
11427
11621
|
Service: () => Service40,
|
|
11428
11622
|
PromptAssemblerError: () => PromptAssemblerError
|
|
11429
11623
|
});
|
|
11430
|
-
import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as
|
|
11624
|
+
import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as Schema59 } from "effect";
|
|
11431
11625
|
import { Prompt as Prompt10 } from "effect/unstable/ai";
|
|
11432
11626
|
|
|
11433
11627
|
// ../runtime/src/content/artifact-store-service.ts
|
|
@@ -11442,11 +11636,11 @@ __export(exports_artifact_store_service, {
|
|
|
11442
11636
|
Memory: () => Memory2,
|
|
11443
11637
|
ArtifactNotResolvable: () => ArtifactNotResolvable
|
|
11444
11638
|
});
|
|
11445
|
-
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as
|
|
11639
|
+
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as Schema58 } from "effect";
|
|
11446
11640
|
|
|
11447
|
-
class ArtifactNotResolvable extends
|
|
11448
|
-
artifact_id:
|
|
11449
|
-
reason:
|
|
11641
|
+
class ArtifactNotResolvable extends Schema58.TaggedErrorClass()("ArtifactNotResolvable", {
|
|
11642
|
+
artifact_id: Schema58.String,
|
|
11643
|
+
reason: Schema58.String
|
|
11450
11644
|
}) {
|
|
11451
11645
|
}
|
|
11452
11646
|
|
|
@@ -11488,14 +11682,14 @@ var register8 = Effect59.fn("ArtifactStore.register.call")(function* (artifact_i
|
|
|
11488
11682
|
});
|
|
11489
11683
|
|
|
11490
11684
|
// ../runtime/src/agent/prompt-assembler-service.ts
|
|
11491
|
-
class PromptAssemblerError extends
|
|
11492
|
-
message:
|
|
11685
|
+
class PromptAssemblerError extends Schema59.TaggedErrorClass()("PromptAssemblerError", {
|
|
11686
|
+
message: Schema59.String
|
|
11493
11687
|
}) {
|
|
11494
11688
|
}
|
|
11495
11689
|
|
|
11496
11690
|
class Service40 extends Context53.Service()("@relayfx/runtime/PromptAssembler") {
|
|
11497
11691
|
}
|
|
11498
|
-
var jsonValue2 = (value) =>
|
|
11692
|
+
var jsonValue2 = (value) => Schema59.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11499
11693
|
var stringifyJson = (value) => JSON.stringify(jsonValue2(value));
|
|
11500
11694
|
var contentToPromptPart = (part) => {
|
|
11501
11695
|
const options = part.provider_options;
|
|
@@ -11639,8 +11833,8 @@ var make9 = (config) => exports_compaction.make(strategy(config), defaultOptions
|
|
|
11639
11833
|
var layerFromEpoch = (epoch) => exports_instructions.layer(epoch.baseline.length === 0 ? [] : [exports_instructions.staticSource("relay:context-epoch", epoch.baseline)]);
|
|
11640
11834
|
|
|
11641
11835
|
// ../runtime/src/agent/relay-permissions.ts
|
|
11642
|
-
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as
|
|
11643
|
-
var jsonValue3 = (value) =>
|
|
11836
|
+
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as Schema60 } from "effect";
|
|
11837
|
+
var jsonValue3 = (value) => Schema60.decodeUnknownSync(exports_shared_schema.JsonValue)(value === undefined ? null : value);
|
|
11644
11838
|
var waitIdForToolCall = (toolCallId) => exports_ids_schema.WaitId.make(`wait:permission:${toolCallId}`);
|
|
11645
11839
|
var fallbackToolCallId = (request) => `${request.agentName}:${request.turn}:${request.tool}`;
|
|
11646
11840
|
var tokenFor2 = (request) => waitIdForToolCall(request.toolCallId ?? fallbackToolCallId(request));
|
|
@@ -11806,7 +12000,7 @@ var awaitAnswer = Effect62.fn("RelayPermissions.awaitAnswer")(function* (config,
|
|
|
11806
12000
|
});
|
|
11807
12001
|
var rememberRule = Effect62.fn("RelayPermissions.rememberRule")(function* (config, rule) {
|
|
11808
12002
|
const createdAt = yield* Clock6.currentTimeMillis;
|
|
11809
|
-
const decodedRule = yield*
|
|
12003
|
+
const decodedRule = yield* Schema60.decodeUnknownEffect(exports_agent_schema.PermissionRule)(rule).pipe(Effect62.mapError((error) => permissionError(error.message)));
|
|
11810
12004
|
yield* config.repository.remember({
|
|
11811
12005
|
agent: config.agentName,
|
|
11812
12006
|
scope: config.scope,
|
|
@@ -11822,9 +12016,9 @@ var layer40 = (config) => Layer56.mergeAll(Layer56.succeed(exports_permissions.P
|
|
|
11822
12016
|
})));
|
|
11823
12017
|
|
|
11824
12018
|
// ../runtime/src/agent/relay-steering.ts
|
|
11825
|
-
import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as
|
|
12019
|
+
import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as Schema61 } from "effect";
|
|
11826
12020
|
import { Prompt as Prompt11 } from "effect/unstable/ai";
|
|
11827
|
-
var jsonValue4 = (value) =>
|
|
12021
|
+
var jsonValue4 = (value) => Schema61.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11828
12022
|
var stringifyJson2 = (value) => JSON.stringify(jsonValue4(value));
|
|
11829
12023
|
var createdAtForSequence2 = (config, sequence) => config.startedAt + sequence - config.eventSequence;
|
|
11830
12024
|
var drainId = (config, kind, sequence) => `drain:${config.executionId}:steering:${kind}:sequence:${sequence}`;
|
|
@@ -11857,7 +12051,7 @@ var contentFromMessage = (message) => {
|
|
|
11857
12051
|
const textParts = promptTextParts(prompt);
|
|
11858
12052
|
if (textParts.length > 0)
|
|
11859
12053
|
return textParts;
|
|
11860
|
-
return [exports_content_schema.text(stringifyJson2(
|
|
12054
|
+
return [exports_content_schema.text(stringifyJson2(Schema61.encodeSync(Prompt11.Prompt)(prompt)))];
|
|
11861
12055
|
};
|
|
11862
12056
|
var steeringReceivedEvent = (config, kind, drain2, messages, sequence) => ({
|
|
11863
12057
|
id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:received`),
|
|
@@ -11902,8 +12096,8 @@ var layer41 = (config) => Layer57.succeed(exports_steering.Steering, exports_ste
|
|
|
11902
12096
|
}));
|
|
11903
12097
|
|
|
11904
12098
|
// ../runtime/src/agent/relay-tool-executor.ts
|
|
11905
|
-
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as
|
|
11906
|
-
var jsonValue5 = (value) =>
|
|
12099
|
+
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as Schema62 } from "effect";
|
|
12100
|
+
var jsonValue5 = (value) => Schema62.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11907
12101
|
var errorDetail = (error) => {
|
|
11908
12102
|
switch (error._tag) {
|
|
11909
12103
|
case "ToolNotRegistered":
|
|
@@ -12010,29 +12204,29 @@ var make12 = (first) => Ref17.make(first).pipe(Effect66.map((ref) => ({
|
|
|
12010
12204
|
})));
|
|
12011
12205
|
|
|
12012
12206
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
12013
|
-
class AgentLoopError extends
|
|
12014
|
-
message:
|
|
12015
|
-
next_event_sequence:
|
|
12207
|
+
class AgentLoopError extends Schema63.TaggedErrorClass()("AgentLoopError", {
|
|
12208
|
+
message: Schema63.String,
|
|
12209
|
+
next_event_sequence: Schema63.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12016
12210
|
}) {
|
|
12017
12211
|
}
|
|
12018
12212
|
|
|
12019
|
-
class AgentLoopWaitRequested extends
|
|
12213
|
+
class AgentLoopWaitRequested extends Schema63.TaggedErrorClass()("AgentLoopWaitRequested", {
|
|
12020
12214
|
wait_id: exports_ids_schema.WaitId,
|
|
12021
12215
|
tool_call: exports_tool_schema.Call,
|
|
12022
12216
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
12023
12217
|
}) {
|
|
12024
12218
|
}
|
|
12025
12219
|
|
|
12026
|
-
class AgentLoopBudgetExceeded extends
|
|
12027
|
-
tokens_used:
|
|
12028
|
-
token_budget:
|
|
12220
|
+
class AgentLoopBudgetExceeded extends Schema63.TaggedErrorClass()("AgentLoopBudgetExceeded", {
|
|
12221
|
+
tokens_used: Schema63.Int,
|
|
12222
|
+
token_budget: Schema63.Int,
|
|
12029
12223
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
12030
12224
|
}) {
|
|
12031
12225
|
}
|
|
12032
12226
|
|
|
12033
12227
|
class Service41 extends Context54.Service()("@relayfx/runtime/AgentLoop") {
|
|
12034
12228
|
}
|
|
12035
|
-
var jsonValue6 = (value) =>
|
|
12229
|
+
var jsonValue6 = (value) => Schema63.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
12036
12230
|
var toolNames = (agent) => HashSet6.fromIterable(agent.tool_names);
|
|
12037
12231
|
var availableRegisteredTools = (agent, registered) => {
|
|
12038
12232
|
const names = toolNames(agent);
|
|
@@ -12608,7 +12802,7 @@ __export(exports_execution_entity, {
|
|
|
12608
12802
|
});
|
|
12609
12803
|
import { ClusterSchema, Entity } from "effect/unstable/cluster";
|
|
12610
12804
|
import { Rpc } from "effect/unstable/rpc";
|
|
12611
|
-
import { Schema as
|
|
12805
|
+
import { Schema as Schema70 } from "effect";
|
|
12612
12806
|
|
|
12613
12807
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
12614
12808
|
var exports_execution_workflow = {};
|
|
@@ -12639,15 +12833,15 @@ __export(exports_execution_workflow, {
|
|
|
12639
12833
|
ActivityNameTemplates: () => ActivityNameTemplates
|
|
12640
12834
|
});
|
|
12641
12835
|
import { Activity, DurableDeferred, Workflow } from "effect/unstable/workflow";
|
|
12642
|
-
import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as
|
|
12836
|
+
import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as Schema69 } from "effect";
|
|
12643
12837
|
|
|
12644
12838
|
// ../runtime/src/child/parent-notifier-service.ts
|
|
12645
|
-
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as
|
|
12646
|
-
class ParentNotifyError extends
|
|
12647
|
-
message:
|
|
12839
|
+
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as Schema64 } from "effect";
|
|
12840
|
+
class ParentNotifyError extends Schema64.TaggedErrorClass()("ParentNotifyError", {
|
|
12841
|
+
message: Schema64.String
|
|
12648
12842
|
}) {
|
|
12649
12843
|
}
|
|
12650
|
-
var ChildTerminalStatus =
|
|
12844
|
+
var ChildTerminalStatus = Schema64.Literals(["completed", "failed", "cancelled"]).annotate({
|
|
12651
12845
|
identifier: "Relay.ParentNotifier.ChildTerminalStatus"
|
|
12652
12846
|
});
|
|
12653
12847
|
|
|
@@ -12746,15 +12940,15 @@ __export(exports_skill_registry_service, {
|
|
|
12746
12940
|
SkillDefinitionInvalid: () => SkillDefinitionInvalid,
|
|
12747
12941
|
Service: () => Service43
|
|
12748
12942
|
});
|
|
12749
|
-
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as
|
|
12943
|
+
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as Schema65 } from "effect";
|
|
12750
12944
|
|
|
12751
|
-
class SkillDefinitionInvalid extends
|
|
12752
|
-
message:
|
|
12945
|
+
class SkillDefinitionInvalid extends Schema65.TaggedErrorClass()("SkillDefinitionInvalid", {
|
|
12946
|
+
message: Schema65.String
|
|
12753
12947
|
}) {
|
|
12754
12948
|
}
|
|
12755
12949
|
|
|
12756
|
-
class SkillRegistryError extends
|
|
12757
|
-
message:
|
|
12950
|
+
class SkillRegistryError extends Schema65.TaggedErrorClass()("SkillRegistryError", {
|
|
12951
|
+
message: Schema65.String
|
|
12758
12952
|
}) {
|
|
12759
12953
|
}
|
|
12760
12954
|
|
|
@@ -12923,11 +13117,11 @@ __export(exports_execution_service, {
|
|
|
12923
13117
|
Service: () => Service44,
|
|
12924
13118
|
ExecutionServiceError: () => ExecutionServiceError
|
|
12925
13119
|
});
|
|
12926
|
-
import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as
|
|
13120
|
+
import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as Schema66, Stream as Stream9 } from "effect";
|
|
12927
13121
|
import { ShardingConfig } from "effect/unstable/cluster";
|
|
12928
|
-
class ExecutionServiceError extends
|
|
12929
|
-
message:
|
|
12930
|
-
next_event_sequence:
|
|
13122
|
+
class ExecutionServiceError extends Schema66.TaggedErrorClass()("ExecutionServiceError", {
|
|
13123
|
+
message: Schema66.String,
|
|
13124
|
+
next_event_sequence: Schema66.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12931
13125
|
}) {
|
|
12932
13126
|
}
|
|
12933
13127
|
|
|
@@ -13243,13 +13437,13 @@ var spawnChildRun = Effect70.fn("ExecutionService.spawnChildRun.call")(function*
|
|
|
13243
13437
|
var stream3 = (input) => Stream9.unwrap(Service44.pipe(Effect70.map((service) => service.stream(input))));
|
|
13244
13438
|
|
|
13245
13439
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13246
|
-
import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as
|
|
13440
|
+
import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as Schema68 } from "effect";
|
|
13247
13441
|
|
|
13248
13442
|
// ../runtime/src/workspace/workspace-runtime-service.ts
|
|
13249
|
-
import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as
|
|
13443
|
+
import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as Schema67 } from "effect";
|
|
13250
13444
|
|
|
13251
|
-
class WorkspaceRuntimeError extends
|
|
13252
|
-
message:
|
|
13445
|
+
class WorkspaceRuntimeError extends Schema67.TaggedErrorClass()("WorkspaceRuntimeError", {
|
|
13446
|
+
message: Schema67.String
|
|
13253
13447
|
}) {
|
|
13254
13448
|
}
|
|
13255
13449
|
|
|
@@ -13277,18 +13471,18 @@ var exec = Effect71.fn("WorkspaceRuntime.exec.call")(function* (input) {
|
|
|
13277
13471
|
});
|
|
13278
13472
|
|
|
13279
13473
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13280
|
-
class WorkspaceRuntimeMissing extends
|
|
13474
|
+
class WorkspaceRuntimeMissing extends Schema68.TaggedErrorClass()("WorkspaceRuntimeMissing", {
|
|
13281
13475
|
execution_id: exports_ids_schema.ExecutionId
|
|
13282
13476
|
}) {
|
|
13283
13477
|
}
|
|
13284
13478
|
|
|
13285
|
-
class WorkspaceLeaseMissingRef extends
|
|
13479
|
+
class WorkspaceLeaseMissingRef extends Schema68.TaggedErrorClass()("WorkspaceLeaseMissingRef", {
|
|
13286
13480
|
execution_id: exports_ids_schema.ExecutionId
|
|
13287
13481
|
}) {
|
|
13288
13482
|
}
|
|
13289
13483
|
|
|
13290
|
-
class WorkspacePlannerError extends
|
|
13291
|
-
message:
|
|
13484
|
+
class WorkspacePlannerError extends Schema68.TaggedErrorClass()("WorkspacePlannerError", {
|
|
13485
|
+
message: Schema68.String
|
|
13292
13486
|
}) {
|
|
13293
13487
|
}
|
|
13294
13488
|
|
|
@@ -13474,67 +13668,67 @@ var fail = Effect72.fn("WorkspacePlanner.fail.call")(function* (input) {
|
|
|
13474
13668
|
});
|
|
13475
13669
|
|
|
13476
13670
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
13477
|
-
class ExecutionWorkflowFailed extends
|
|
13478
|
-
message:
|
|
13671
|
+
class ExecutionWorkflowFailed extends Schema69.TaggedErrorClass()("ExecutionWorkflowFailed", {
|
|
13672
|
+
message: Schema69.String
|
|
13479
13673
|
}) {
|
|
13480
13674
|
}
|
|
13481
|
-
var StartInput =
|
|
13675
|
+
var StartInput = Schema69.Struct({
|
|
13482
13676
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13483
13677
|
root_address_id: exports_ids_schema.AddressId,
|
|
13484
|
-
session_id:
|
|
13485
|
-
input:
|
|
13678
|
+
session_id: Schema69.optionalKey(exports_ids_schema.SessionId),
|
|
13679
|
+
input: Schema69.optionalKey(Schema69.Array(exports_content_schema.Part)),
|
|
13486
13680
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
13487
13681
|
started_at: exports_shared_schema.TimestampMillis,
|
|
13488
13682
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
13489
|
-
agent_id:
|
|
13490
|
-
agent_revision:
|
|
13491
|
-
agent_snapshot:
|
|
13492
|
-
agent_tool_input_schema_digests:
|
|
13493
|
-
wait_id:
|
|
13494
|
-
resume_tool_call:
|
|
13495
|
-
workflow_generation:
|
|
13496
|
-
metadata:
|
|
13683
|
+
agent_id: Schema69.optionalKey(exports_ids_schema.AgentId),
|
|
13684
|
+
agent_revision: Schema69.optionalKey(exports_agent_schema.DefinitionRevision),
|
|
13685
|
+
agent_snapshot: Schema69.optionalKey(exports_agent_schema.Definition),
|
|
13686
|
+
agent_tool_input_schema_digests: Schema69.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
|
|
13687
|
+
wait_id: Schema69.optionalKey(exports_ids_schema.WaitId),
|
|
13688
|
+
resume_tool_call: Schema69.optionalKey(exports_tool_schema.Call),
|
|
13689
|
+
workflow_generation: Schema69.optionalKey(Schema69.Int.check(Schema69.isGreaterThanOrEqualTo(0))),
|
|
13690
|
+
metadata: Schema69.optionalKey(exports_shared_schema.Metadata)
|
|
13497
13691
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartInput" });
|
|
13498
|
-
var WaitSignalState =
|
|
13692
|
+
var WaitSignalState = Schema69.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
13499
13693
|
identifier: "Relay.ExecutionWorkflow.WaitSignalState"
|
|
13500
13694
|
});
|
|
13501
|
-
var WaitSignal =
|
|
13695
|
+
var WaitSignal = Schema69.Struct({
|
|
13502
13696
|
wait_id: exports_ids_schema.WaitId,
|
|
13503
13697
|
state: WaitSignalState,
|
|
13504
13698
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13505
13699
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSignal" });
|
|
13506
|
-
var SignalWaitInput =
|
|
13507
|
-
workflow_execution_id:
|
|
13700
|
+
var SignalWaitInput = Schema69.Struct({
|
|
13701
|
+
workflow_execution_id: Schema69.String,
|
|
13508
13702
|
wait_id: exports_ids_schema.WaitId,
|
|
13509
13703
|
state: WaitSignalState,
|
|
13510
13704
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13511
13705
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.SignalWaitInput" });
|
|
13512
|
-
var CancelExecutionInput =
|
|
13706
|
+
var CancelExecutionInput = Schema69.Struct({
|
|
13513
13707
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13514
13708
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
13515
|
-
reason:
|
|
13709
|
+
reason: Schema69.optionalKey(Schema69.String)
|
|
13516
13710
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionInput" });
|
|
13517
|
-
var CancelExecutionResult =
|
|
13711
|
+
var CancelExecutionResult = Schema69.Struct({
|
|
13518
13712
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13519
13713
|
status: exports_execution_schema.ExecutionStatus
|
|
13520
13714
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionResult" });
|
|
13521
|
-
var WaitSnapshot =
|
|
13715
|
+
var WaitSnapshot = Schema69.Struct({
|
|
13522
13716
|
id: exports_ids_schema.WaitId,
|
|
13523
13717
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13524
|
-
envelope_id:
|
|
13718
|
+
envelope_id: Schema69.optionalKey(exports_ids_schema.EnvelopeId),
|
|
13525
13719
|
mode: exports_envelope_schema.WaitMode,
|
|
13526
|
-
correlation_key:
|
|
13527
|
-
state:
|
|
13720
|
+
correlation_key: Schema69.optionalKey(Schema69.String),
|
|
13721
|
+
state: Schema69.Literals(["open", "resolved", "timed_out", "cancelled"]),
|
|
13528
13722
|
metadata: exports_shared_schema.Metadata,
|
|
13529
13723
|
created_at: exports_shared_schema.TimestampMillis,
|
|
13530
|
-
resolved_at:
|
|
13724
|
+
resolved_at: Schema69.optionalKey(exports_shared_schema.TimestampMillis)
|
|
13531
13725
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSnapshot" });
|
|
13532
|
-
var StartResult =
|
|
13726
|
+
var StartResult = Schema69.Struct({
|
|
13533
13727
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13534
13728
|
status: exports_execution_schema.ExecutionStatus,
|
|
13535
|
-
wait_id:
|
|
13536
|
-
wait_state:
|
|
13537
|
-
metadata:
|
|
13729
|
+
wait_id: Schema69.optionalKey(exports_ids_schema.WaitId),
|
|
13730
|
+
wait_state: Schema69.optionalKey(Schema69.Literals(["resolved", "timed_out", "cancelled"])),
|
|
13731
|
+
metadata: Schema69.optionalKey(exports_shared_schema.Metadata)
|
|
13538
13732
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartResult" });
|
|
13539
13733
|
var StartExecutionWorkflowName = "Relay/Execution/Start";
|
|
13540
13734
|
var ActivityNames = {
|
|
@@ -13744,7 +13938,7 @@ var cancelExecution = (input, turn, reason) => Activity.make({
|
|
|
13744
13938
|
});
|
|
13745
13939
|
var loadCancellationRequested = (input, turn) => Activity.make({
|
|
13746
13940
|
name: ActivityNames.checkCancel(turn),
|
|
13747
|
-
success:
|
|
13941
|
+
success: Schema69.Boolean,
|
|
13748
13942
|
error: ExecutionWorkflowFailed,
|
|
13749
13943
|
execute: Effect73.gen(function* () {
|
|
13750
13944
|
const repository = yield* exports_execution_repository.Service;
|
|
@@ -13754,7 +13948,7 @@ var loadCancellationRequested = (input, turn) => Activity.make({
|
|
|
13754
13948
|
});
|
|
13755
13949
|
var loadWait = (name, waitId) => Activity.make({
|
|
13756
13950
|
name,
|
|
13757
|
-
success:
|
|
13951
|
+
success: Schema69.UndefinedOr(WaitSnapshot),
|
|
13758
13952
|
error: ExecutionWorkflowFailed,
|
|
13759
13953
|
execute: get11(waitId).pipe(Effect73.map((record2) => record2 === undefined ? undefined : toWaitSnapshot(record2)), Effect73.mapError(mapWaitError2))
|
|
13760
13954
|
});
|
|
@@ -13845,7 +14039,7 @@ var compactionForStart = Effect73.fn("ExecutionWorkflow.compactionForStart")(fun
|
|
|
13845
14039
|
...keepRecentTokens === undefined ? {} : { keepRecentTokens }
|
|
13846
14040
|
};
|
|
13847
14041
|
});
|
|
13848
|
-
var decodeMemorySubject = (value) => typeof value === "string" ?
|
|
14042
|
+
var decodeMemorySubject = (value) => typeof value === "string" ? Schema69.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" }));
|
|
13849
14043
|
var memorySubjectForStart = Effect73.fn("ExecutionWorkflow.memorySubjectForStart")(function* (input) {
|
|
13850
14044
|
const executionSubject = memorySubjectFromMetadata(input.metadata);
|
|
13851
14045
|
if (executionSubject !== undefined)
|
|
@@ -13863,7 +14057,7 @@ var steeringEnabledForStart = (input) => {
|
|
|
13863
14057
|
var nextEventSequence4 = (eventLog, executionId) => eventLog.maxSequence(executionId).pipe(Effect73.map((max) => max === undefined ? 0 : max + 1), Effect73.mapError(mapEventLogError6));
|
|
13864
14058
|
var ensureWorkspace = (input) => Activity.make({
|
|
13865
14059
|
name: ActivityNames.ensureWorkspace,
|
|
13866
|
-
success:
|
|
14060
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13867
14061
|
error: ExecutionWorkflowFailed,
|
|
13868
14062
|
execute: Effect73.gen(function* () {
|
|
13869
14063
|
if (input.agent_snapshot === undefined)
|
|
@@ -13880,19 +14074,19 @@ var ensureWorkspace = (input) => Activity.make({
|
|
|
13880
14074
|
});
|
|
13881
14075
|
var suspendWorkspace = (input, key2) => Activity.make({
|
|
13882
14076
|
name: ActivityNames.suspendWorkspace(key2),
|
|
13883
|
-
success:
|
|
14077
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13884
14078
|
error: ExecutionWorkflowFailed,
|
|
13885
14079
|
execute: suspend2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13886
14080
|
});
|
|
13887
14081
|
var resumeWorkspace = (input, key2) => Activity.make({
|
|
13888
14082
|
name: ActivityNames.resumeWorkspace(key2),
|
|
13889
|
-
success:
|
|
14083
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13890
14084
|
error: ExecutionWorkflowFailed,
|
|
13891
14085
|
execute: resume2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.map((plan2) => plan2?.lease), Effect73.mapError(mapWorkspaceError))
|
|
13892
14086
|
});
|
|
13893
14087
|
var releaseWorkspace = (input) => Activity.make({
|
|
13894
14088
|
name: ActivityNames.releaseWorkspace,
|
|
13895
|
-
success:
|
|
14089
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13896
14090
|
error: ExecutionWorkflowFailed,
|
|
13897
14091
|
execute: release2({ executionId: input.execution_id, now: input.completed_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13898
14092
|
});
|
|
@@ -13993,7 +14187,7 @@ var childDispatchContext = (input) => {
|
|
|
13993
14187
|
};
|
|
13994
14188
|
var loadChildCancellationRequested = (input) => Activity.make({
|
|
13995
14189
|
name: ActivityNames.checkQueuedChildCancellation,
|
|
13996
|
-
success:
|
|
14190
|
+
success: Schema69.Boolean,
|
|
13997
14191
|
error: ExecutionWorkflowFailed,
|
|
13998
14192
|
execute: Effect73.gen(function* () {
|
|
13999
14193
|
const context = childDispatchContext(input);
|
|
@@ -14005,7 +14199,7 @@ var loadChildCancellationRequested = (input) => Activity.make({
|
|
|
14005
14199
|
});
|
|
14006
14200
|
var notifyParentActivity = (input, context, status, output) => Activity.make({
|
|
14007
14201
|
name: ActivityNames.notifyParent(status),
|
|
14008
|
-
success:
|
|
14202
|
+
success: Schema69.Void,
|
|
14009
14203
|
error: ExecutionWorkflowFailed,
|
|
14010
14204
|
execute: Effect73.gen(function* () {
|
|
14011
14205
|
const notifier = yield* Effect73.serviceOption(Service42);
|
|
@@ -14058,7 +14252,7 @@ var waitIdFromExecution = (execution) => {
|
|
|
14058
14252
|
};
|
|
14059
14253
|
var pendingToolCallFromExecution = (execution) => {
|
|
14060
14254
|
const pending = execution.metadata?.pending_tool_call;
|
|
14061
|
-
return
|
|
14255
|
+
return Schema69.decodeUnknownOption(exports_tool_schema.Call)(pending).pipe(Option26.getOrUndefined);
|
|
14062
14256
|
};
|
|
14063
14257
|
var finishCancelledWait = Effect73.fn("ExecutionWorkflow.finishCancelledWait")(function* (startInput, turn, waitId) {
|
|
14064
14258
|
const cancelled = yield* cancelExecution(startInput, turn, "wait cancelled");
|
|
@@ -14272,7 +14466,7 @@ var Start = Rpc.make("start", {
|
|
|
14272
14466
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14273
14467
|
var SignalWait = Rpc.make("signalWait", {
|
|
14274
14468
|
payload: SignalWaitInput,
|
|
14275
|
-
success:
|
|
14469
|
+
success: Schema70.Void,
|
|
14276
14470
|
error: ExecutionWorkflowFailed
|
|
14277
14471
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14278
14472
|
var Cancel = Rpc.make("cancel", {
|
|
@@ -14300,26 +14494,26 @@ __export(exports_envelope_service, {
|
|
|
14300
14494
|
EnvelopeRouteDeferred: () => EnvelopeRouteDeferred,
|
|
14301
14495
|
EnvelopeAddressNotFound: () => EnvelopeAddressNotFound
|
|
14302
14496
|
});
|
|
14303
|
-
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as
|
|
14304
|
-
class EnvelopeAddressNotFound extends
|
|
14497
|
+
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as Schema71 } from "effect";
|
|
14498
|
+
class EnvelopeAddressNotFound extends Schema71.TaggedErrorClass()("EnvelopeAddressNotFound", {
|
|
14305
14499
|
address_id: exports_ids_schema.AddressId
|
|
14306
14500
|
}) {
|
|
14307
14501
|
}
|
|
14308
14502
|
|
|
14309
|
-
class EnvelopeRouteUnavailable extends
|
|
14503
|
+
class EnvelopeRouteUnavailable extends Schema71.TaggedErrorClass()("EnvelopeRouteUnavailable", {
|
|
14310
14504
|
address_id: exports_ids_schema.AddressId,
|
|
14311
|
-
route_key:
|
|
14505
|
+
route_key: Schema71.String
|
|
14312
14506
|
}) {
|
|
14313
14507
|
}
|
|
14314
14508
|
|
|
14315
|
-
class EnvelopeRouteDeferred extends
|
|
14509
|
+
class EnvelopeRouteDeferred extends Schema71.TaggedErrorClass()("EnvelopeRouteDeferred", {
|
|
14316
14510
|
address_id: exports_ids_schema.AddressId,
|
|
14317
|
-
route_key:
|
|
14511
|
+
route_key: Schema71.String
|
|
14318
14512
|
}) {
|
|
14319
14513
|
}
|
|
14320
14514
|
|
|
14321
|
-
class EnvelopeServiceError extends
|
|
14322
|
-
message:
|
|
14515
|
+
class EnvelopeServiceError extends Schema71.TaggedErrorClass()("EnvelopeServiceError", {
|
|
14516
|
+
message: Schema71.String
|
|
14323
14517
|
}) {
|
|
14324
14518
|
}
|
|
14325
14519
|
|
|
@@ -14477,7 +14671,7 @@ __export(exports_runner_runtime_service, {
|
|
|
14477
14671
|
DatabaseMode: () => DatabaseMode,
|
|
14478
14672
|
ClusterConfigMismatch: () => ClusterConfigMismatch
|
|
14479
14673
|
});
|
|
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
|
|
14674
|
+
import { Config as Config5, Context as Context62, Crypto as Crypto4, Duration as Duration5, Effect as Effect77, Layer as Layer69, Option as Option27, Schema as Schema73, Stream as Stream10 } from "effect";
|
|
14481
14675
|
import {
|
|
14482
14676
|
ClusterWorkflowEngine,
|
|
14483
14677
|
HttpRunner,
|
|
@@ -14515,7 +14709,7 @@ __export(exports_scheduler_service, {
|
|
|
14515
14709
|
SchedulerError: () => SchedulerError,
|
|
14516
14710
|
ScheduleCronInvalid: () => ScheduleCronInvalid
|
|
14517
14711
|
});
|
|
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
|
|
14712
|
+
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 Schema72 } from "effect";
|
|
14519
14713
|
|
|
14520
14714
|
// ../runtime/src/wait/wait-signal.ts
|
|
14521
14715
|
var exports_wait_signal = {};
|
|
@@ -14535,14 +14729,14 @@ var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function*
|
|
|
14535
14729
|
});
|
|
14536
14730
|
|
|
14537
14731
|
// ../runtime/src/schedule/scheduler-service.ts
|
|
14538
|
-
class SchedulerError extends
|
|
14539
|
-
message:
|
|
14732
|
+
class SchedulerError extends Schema72.TaggedErrorClass()("SchedulerError", {
|
|
14733
|
+
message: Schema72.String
|
|
14540
14734
|
}) {
|
|
14541
14735
|
}
|
|
14542
14736
|
|
|
14543
|
-
class ScheduleCronInvalid extends
|
|
14544
|
-
cron_expr:
|
|
14545
|
-
message:
|
|
14737
|
+
class ScheduleCronInvalid extends Schema72.TaggedErrorClass()("ScheduleCronInvalid", {
|
|
14738
|
+
cron_expr: Schema72.String,
|
|
14739
|
+
message: Schema72.String
|
|
14546
14740
|
}) {
|
|
14547
14741
|
}
|
|
14548
14742
|
|
|
@@ -14693,25 +14887,25 @@ var runOnce2 = Effect76.fn("SchedulerService.runOnce.call")(function* () {
|
|
|
14693
14887
|
});
|
|
14694
14888
|
|
|
14695
14889
|
// ../runtime/src/runner/runner-runtime-service.ts
|
|
14696
|
-
var DatabaseMode =
|
|
14890
|
+
var DatabaseMode = Schema73.Literals(["sql", "pg", "mysql", "sqlite", "memory"]).annotate({
|
|
14697
14891
|
identifier: "Relay.RunnerRuntime.DatabaseMode"
|
|
14698
14892
|
});
|
|
14699
|
-
var ReadinessStatus =
|
|
14893
|
+
var ReadinessStatus = Schema73.Struct({
|
|
14700
14894
|
database: DatabaseMode,
|
|
14701
|
-
cluster:
|
|
14702
|
-
workflow:
|
|
14703
|
-
executionEntity:
|
|
14895
|
+
cluster: Schema73.Literal("ready"),
|
|
14896
|
+
workflow: Schema73.Literals(["ready", "client"]),
|
|
14897
|
+
executionEntity: Schema73.Literals(["registered", "client"])
|
|
14704
14898
|
}).annotate({ identifier: "Relay.RunnerRuntime.ReadinessStatus" });
|
|
14705
14899
|
|
|
14706
|
-
class RunnerRuntimeError extends
|
|
14707
|
-
message:
|
|
14900
|
+
class RunnerRuntimeError extends Schema73.TaggedErrorClass()("RunnerRuntimeError", {
|
|
14901
|
+
message: Schema73.String
|
|
14708
14902
|
}) {
|
|
14709
14903
|
}
|
|
14710
14904
|
|
|
14711
|
-
class ClusterConfigMismatch extends
|
|
14712
|
-
field:
|
|
14713
|
-
expected:
|
|
14714
|
-
actual:
|
|
14905
|
+
class ClusterConfigMismatch extends Schema73.TaggedErrorClass()("ClusterConfigMismatch", {
|
|
14906
|
+
field: Schema73.String,
|
|
14907
|
+
expected: Schema73.String,
|
|
14908
|
+
actual: Schema73.String
|
|
14715
14909
|
}) {
|
|
14716
14910
|
}
|
|
14717
14911
|
|
|
@@ -14725,7 +14919,7 @@ var memoryClusterLayer = Sharding.layer.pipe(Layer69.provideMerge(Runners.layerN
|
|
|
14725
14919
|
var clusterHost = Config5.string("RELAY_CLUSTER_HOST").pipe(Config5.withDefault("localhost"));
|
|
14726
14920
|
var clusterPort = Config5.int("RELAY_CLUSTER_PORT").pipe(Config5.withDefault(34431));
|
|
14727
14921
|
var clusterShardsPerGroup = Config5.int("RELAY_CLUSTER_SHARDS_PER_GROUP").pipe(Config5.withDefault(300));
|
|
14728
|
-
var clusterShardGroups = Config5.schema(Config5.Array(
|
|
14922
|
+
var clusterShardGroups = Config5.schema(Config5.Array(Schema73.String), "RELAY_CLUSTER_SHARD_GROUPS").pipe(Config5.withDefault(["default", "execution"]));
|
|
14729
14923
|
var runnerAddressKey = (address) => `${address.host}:${address.port}`;
|
|
14730
14924
|
var runnerAddressEquals = (left, right) => left.host === right.host && left.port === right.port;
|
|
14731
14925
|
var shardingConfigFromEnv = () => Layer69.effect(ShardingConfig2.ShardingConfig, Effect77.gen(function* () {
|
|
@@ -15055,51 +15249,51 @@ __export(exports_activity_version_registry, {
|
|
|
15055
15249
|
ActivityManifestChange: () => ActivityManifestChange,
|
|
15056
15250
|
ActivityManifest: () => ActivityManifest
|
|
15057
15251
|
});
|
|
15058
|
-
import { Crypto as Crypto5, Effect as Effect78, Schema as
|
|
15252
|
+
import { Crypto as Crypto5, Effect as Effect78, Schema as Schema74 } from "effect";
|
|
15059
15253
|
var generatedFrom = "@relayfx/runtime/ExecutionWorkflow";
|
|
15060
|
-
var ActivityManifestEntry =
|
|
15061
|
-
name:
|
|
15062
|
-
signature_hash:
|
|
15254
|
+
var ActivityManifestEntry = Schema74.Struct({
|
|
15255
|
+
name: Schema74.String,
|
|
15256
|
+
signature_hash: Schema74.String
|
|
15063
15257
|
}).annotate({ identifier: "Relay.ActivityManifestEntry" });
|
|
15064
|
-
var ActivityManifest =
|
|
15065
|
-
version:
|
|
15066
|
-
generated_from:
|
|
15067
|
-
hash_algorithm:
|
|
15068
|
-
activities:
|
|
15258
|
+
var ActivityManifest = Schema74.Struct({
|
|
15259
|
+
version: Schema74.Literal(1),
|
|
15260
|
+
generated_from: Schema74.String,
|
|
15261
|
+
hash_algorithm: Schema74.Literal("sha256-json-schema-v1"),
|
|
15262
|
+
activities: Schema74.Array(ActivityManifestEntry)
|
|
15069
15263
|
}).annotate({ identifier: "Relay.ActivityManifest" });
|
|
15070
|
-
var ActivityManifestChange =
|
|
15071
|
-
type:
|
|
15072
|
-
name:
|
|
15073
|
-
baseline_hash:
|
|
15074
|
-
current_hash:
|
|
15264
|
+
var ActivityManifestChange = Schema74.Struct({
|
|
15265
|
+
type: Schema74.Literals(["removed", "changed", "added"]),
|
|
15266
|
+
name: Schema74.String,
|
|
15267
|
+
baseline_hash: Schema74.optionalKey(Schema74.String),
|
|
15268
|
+
current_hash: Schema74.optionalKey(Schema74.String)
|
|
15075
15269
|
}).annotate({ identifier: "Relay.ActivityManifestChange" });
|
|
15076
|
-
var ActivityManifestGuardResult =
|
|
15077
|
-
status:
|
|
15078
|
-
waiting_executions:
|
|
15079
|
-
breaking_changes:
|
|
15080
|
-
additive_changes:
|
|
15270
|
+
var ActivityManifestGuardResult = Schema74.Struct({
|
|
15271
|
+
status: Schema74.Literals(["pass", "fail"]),
|
|
15272
|
+
waiting_executions: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15273
|
+
breaking_changes: Schema74.Array(ActivityManifestChange),
|
|
15274
|
+
additive_changes: Schema74.Array(ActivityManifestChange)
|
|
15081
15275
|
}).annotate({ identifier: "Relay.ActivityManifestGuardResult" });
|
|
15082
15276
|
|
|
15083
|
-
class ActivityManifestGuardFailed extends
|
|
15084
|
-
message:
|
|
15277
|
+
class ActivityManifestGuardFailed extends Schema74.TaggedErrorClass()("ActivityManifestGuardFailed", {
|
|
15278
|
+
message: Schema74.String,
|
|
15085
15279
|
result: ActivityManifestGuardResult
|
|
15086
15280
|
}) {
|
|
15087
15281
|
}
|
|
15088
|
-
var TurnInput =
|
|
15282
|
+
var TurnInput = Schema74.Struct({
|
|
15089
15283
|
start: StartInput,
|
|
15090
|
-
turn:
|
|
15284
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0))
|
|
15091
15285
|
});
|
|
15092
|
-
var WaitIdInput =
|
|
15286
|
+
var WaitIdInput = Schema74.Struct({
|
|
15093
15287
|
wait_id: exports_ids_schema.WaitId
|
|
15094
15288
|
});
|
|
15095
|
-
var WorkspaceKeyInput =
|
|
15289
|
+
var WorkspaceKeyInput = Schema74.Struct({
|
|
15096
15290
|
start: StartInput,
|
|
15097
|
-
key:
|
|
15291
|
+
key: Schema74.String
|
|
15098
15292
|
});
|
|
15099
15293
|
var contracts = [
|
|
15100
15294
|
{
|
|
15101
15295
|
name: ActivityNameTemplates.resolveLocalAgent,
|
|
15102
|
-
input:
|
|
15296
|
+
input: Schema74.Struct({ address_id: exports_ids_schema.AddressId }),
|
|
15103
15297
|
success: LocalAgentTarget,
|
|
15104
15298
|
error: ExecutionWorkflowFailed
|
|
15105
15299
|
},
|
|
@@ -15111,66 +15305,66 @@ var contracts = [
|
|
|
15111
15305
|
},
|
|
15112
15306
|
{
|
|
15113
15307
|
name: ActivityNameTemplates.cancel,
|
|
15114
|
-
input:
|
|
15308
|
+
input: Schema74.Struct({ start: StartInput, turn: Schema74.Int, reason: Schema74.String }),
|
|
15115
15309
|
success: exports_execution_schema.Execution,
|
|
15116
15310
|
error: ExecutionWorkflowFailed
|
|
15117
15311
|
},
|
|
15118
15312
|
{
|
|
15119
15313
|
name: ActivityNameTemplates.checkCancel,
|
|
15120
15314
|
input: TurnInput,
|
|
15121
|
-
success:
|
|
15315
|
+
success: Schema74.Boolean,
|
|
15122
15316
|
error: ExecutionWorkflowFailed
|
|
15123
15317
|
},
|
|
15124
15318
|
{
|
|
15125
15319
|
name: ActivityNameTemplates.loadWaitBeforeSleep,
|
|
15126
15320
|
input: WaitIdInput,
|
|
15127
|
-
success:
|
|
15321
|
+
success: Schema74.UndefinedOr(WaitSnapshot),
|
|
15128
15322
|
error: ExecutionWorkflowFailed
|
|
15129
15323
|
},
|
|
15130
15324
|
{
|
|
15131
15325
|
name: ActivityNameTemplates.loadWaitAfterWake,
|
|
15132
15326
|
input: WaitIdInput,
|
|
15133
|
-
success:
|
|
15327
|
+
success: Schema74.UndefinedOr(WaitSnapshot),
|
|
15134
15328
|
error: ExecutionWorkflowFailed
|
|
15135
15329
|
},
|
|
15136
15330
|
{
|
|
15137
15331
|
name: ActivityNameTemplates.markWaiting,
|
|
15138
|
-
input:
|
|
15332
|
+
input: Schema74.Struct({ start: StartInput, wait: WaitSnapshot }),
|
|
15139
15333
|
success: exports_execution_schema.Execution,
|
|
15140
15334
|
error: ExecutionWorkflowFailed
|
|
15141
15335
|
},
|
|
15142
15336
|
{
|
|
15143
15337
|
name: ActivityNameTemplates.ensureWorkspace,
|
|
15144
15338
|
input: StartInput,
|
|
15145
|
-
success:
|
|
15339
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15146
15340
|
error: ExecutionWorkflowFailed
|
|
15147
15341
|
},
|
|
15148
15342
|
{
|
|
15149
15343
|
name: ActivityNameTemplates.suspendWorkspace,
|
|
15150
15344
|
input: WorkspaceKeyInput,
|
|
15151
|
-
success:
|
|
15345
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15152
15346
|
error: ExecutionWorkflowFailed
|
|
15153
15347
|
},
|
|
15154
15348
|
{
|
|
15155
15349
|
name: ActivityNameTemplates.resumeWorkspace,
|
|
15156
15350
|
input: WorkspaceKeyInput,
|
|
15157
|
-
success:
|
|
15351
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15158
15352
|
error: ExecutionWorkflowFailed
|
|
15159
15353
|
},
|
|
15160
15354
|
{
|
|
15161
15355
|
name: ActivityNameTemplates.releaseWorkspace,
|
|
15162
15356
|
input: StartInput,
|
|
15163
|
-
success:
|
|
15357
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15164
15358
|
error: ExecutionWorkflowFailed
|
|
15165
15359
|
},
|
|
15166
15360
|
{
|
|
15167
15361
|
name: ActivityNameTemplates.complete,
|
|
15168
|
-
input:
|
|
15362
|
+
input: Schema74.Struct({
|
|
15169
15363
|
start: StartInput,
|
|
15170
|
-
turn:
|
|
15171
|
-
wait_id:
|
|
15172
|
-
wait_state:
|
|
15173
|
-
pending_tool_call:
|
|
15364
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15365
|
+
wait_id: Schema74.optionalKey(exports_ids_schema.WaitId),
|
|
15366
|
+
wait_state: Schema74.optionalKey(WaitSignalState),
|
|
15367
|
+
pending_tool_call: Schema74.optionalKey(exports_tool_schema.Call)
|
|
15174
15368
|
}),
|
|
15175
15369
|
success: exports_execution_schema.Execution,
|
|
15176
15370
|
error: ExecutionWorkflowFailed
|
|
@@ -15178,24 +15372,24 @@ var contracts = [
|
|
|
15178
15372
|
{
|
|
15179
15373
|
name: ActivityNameTemplates.checkQueuedChildCancellation,
|
|
15180
15374
|
input: StartInput,
|
|
15181
|
-
success:
|
|
15375
|
+
success: Schema74.Boolean,
|
|
15182
15376
|
error: ExecutionWorkflowFailed
|
|
15183
15377
|
},
|
|
15184
15378
|
{
|
|
15185
15379
|
name: ActivityNameTemplates.notifyParent,
|
|
15186
|
-
input:
|
|
15380
|
+
input: Schema74.Struct({
|
|
15187
15381
|
start: StartInput,
|
|
15188
15382
|
status: ChildTerminalStatus,
|
|
15189
|
-
output:
|
|
15383
|
+
output: Schema74.Array(exports_content_schema.Part)
|
|
15190
15384
|
}),
|
|
15191
|
-
success:
|
|
15385
|
+
success: Schema74.Void,
|
|
15192
15386
|
error: ExecutionWorkflowFailed
|
|
15193
15387
|
},
|
|
15194
15388
|
{
|
|
15195
15389
|
name: ActivityNameTemplates.continueAsNew,
|
|
15196
|
-
input:
|
|
15390
|
+
input: Schema74.Struct({
|
|
15197
15391
|
start: StartInput,
|
|
15198
|
-
turn:
|
|
15392
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15199
15393
|
wait_id: exports_ids_schema.WaitId,
|
|
15200
15394
|
pending_tool_call: exports_tool_schema.Call
|
|
15201
15395
|
}),
|
|
@@ -15203,7 +15397,7 @@ var contracts = [
|
|
|
15203
15397
|
error: ExecutionWorkflowFailed
|
|
15204
15398
|
}
|
|
15205
15399
|
];
|
|
15206
|
-
var schemaJson = (schema) =>
|
|
15400
|
+
var schemaJson = (schema) => Schema74.decodeUnknownSync(exports_shared_schema.JsonValue)(Schema74.toJsonSchemaDocument(schema));
|
|
15207
15401
|
var canonical = (value) => {
|
|
15208
15402
|
if (value === null || typeof value !== "object")
|
|
15209
15403
|
return value;
|
|
@@ -15318,7 +15512,7 @@ __export(exports_language_model_registration, {
|
|
|
15318
15512
|
anthropic: () => anthropic
|
|
15319
15513
|
});
|
|
15320
15514
|
|
|
15321
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15515
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.3/node_modules/@batonfx/providers/src/anthropic.ts
|
|
15322
15516
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
15323
15517
|
import { Layer as Layer70 } from "effect";
|
|
15324
15518
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
@@ -15334,13 +15528,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
15334
15528
|
});
|
|
15335
15529
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
15336
15530
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer70.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer70.provide(FetchHttpClient2.layer));
|
|
15337
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15531
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.3/node_modules/@batonfx/providers/src/deterministic.ts
|
|
15338
15532
|
import { OpenAiClient as OpenAiClient3 } from "@effect/ai-openai";
|
|
15339
15533
|
import { Effect as Effect79, Layer as Layer72, Option as Option28, Stream as Stream11 } from "effect";
|
|
15340
15534
|
import { LanguageModel as LanguageModel8, Response as Response7 } from "effect/unstable/ai";
|
|
15341
15535
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
15342
15536
|
|
|
15343
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15537
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.3/node_modules/@batonfx/providers/src/openai.ts
|
|
15344
15538
|
import { OpenAiClient as OpenAiClient2, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
15345
15539
|
import { Layer as Layer71 } from "effect";
|
|
15346
15540
|
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
@@ -15357,7 +15551,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
|
|
|
15357
15551
|
var openAiClientLayerConfig2 = OpenAiClient2.layerConfig;
|
|
15358
15552
|
var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer71.provide(OpenAiClient2.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer71.provide(FetchHttpClient3.layer));
|
|
15359
15553
|
|
|
15360
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15554
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.3/node_modules/@batonfx/providers/src/deterministic.ts
|
|
15361
15555
|
var deterministicModelLayer = Layer72.effect(LanguageModel8.LanguageModel, LanguageModel8.make({
|
|
15362
15556
|
generateText: () => Effect79.succeed([{ type: "text", text: "deterministic response" }]),
|
|
15363
15557
|
streamText: () => Stream11.make(Response7.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -15381,7 +15575,7 @@ var withOpenAiOrDeterministic = (options) => Layer72.unwrap(Effect79.gen(functio
|
|
|
15381
15575
|
...Option28.isSome(openAiRegistration) ? [openAiRegistration.value] : []
|
|
15382
15576
|
]);
|
|
15383
15577
|
}));
|
|
15384
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15578
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.3/node_modules/@batonfx/providers/src/openai-compat.ts
|
|
15385
15579
|
import { OpenAiClient as OpenAiClient4, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
15386
15580
|
import { Config as Config8, Layer as Layer73 } from "effect";
|
|
15387
15581
|
import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
|
|
@@ -15402,7 +15596,7 @@ var clientLayerConfig = (options) => OpenAiClient4.layerConfig({
|
|
|
15402
15596
|
...options.baseUrl === undefined ? {} : { apiUrl: Config8.succeed(options.baseUrl) }
|
|
15403
15597
|
});
|
|
15404
15598
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer73.provide(clientLayerConfig(options)), Layer73.provide(FetchHttpClient5.layer));
|
|
15405
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15599
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.3/node_modules/@batonfx/providers/src/openrouter.ts
|
|
15406
15600
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
15407
15601
|
import { Layer as Layer74 } from "effect";
|
|
15408
15602
|
import { FetchHttpClient as FetchHttpClient6 } from "effect/unstable/http";
|