@relayfx/test 0.2.10 → 0.2.12
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/index.js +152 -100
- package/dist/types/runtime/address/address-resolution-service.d.ts +10 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +4 -6
- package/dist/types/runtime/child/child-run-service.d.ts +3 -0
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +5 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +20 -0
- package/dist/types/schema/agent-schema.d.ts +83 -0
- package/dist/types/schema/child-orchestration-schema.d.ts +15 -0
- package/dist/types/schema/execution-schema.d.ts +42 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -185,6 +185,7 @@ __export(exports_agent_schema, {
|
|
|
185
185
|
DefinitionRecord: () => DefinitionRecord,
|
|
186
186
|
DefinitionList: () => DefinitionList,
|
|
187
187
|
Definition: () => Definition2,
|
|
188
|
+
CompactionPolicy: () => CompactionPolicy,
|
|
188
189
|
ChildRunWorkspacePolicy: () => ChildRunWorkspacePolicy,
|
|
189
190
|
ChildRunPreset: () => ChildRunPreset
|
|
190
191
|
});
|
|
@@ -336,6 +337,12 @@ var ModelSelection = Schema5.Struct({
|
|
|
336
337
|
request_options: Schema5.optionalKey(Metadata),
|
|
337
338
|
metadata: Schema5.optionalKey(Metadata)
|
|
338
339
|
}).annotate({ identifier: "Relay.Agent.ModelSelection" });
|
|
340
|
+
var PositiveSafeInteger = Schema5.Number.check(Schema5.makeFilter((value) => Number.isSafeInteger(value) && value > 0 ? undefined : "must be a positive safe integer"));
|
|
341
|
+
var CompactionPolicy = Schema5.Struct({
|
|
342
|
+
context_window: PositiveSafeInteger,
|
|
343
|
+
reserve_tokens: PositiveSafeInteger,
|
|
344
|
+
keep_recent_tokens: PositiveSafeInteger
|
|
345
|
+
}).check(Schema5.makeFilter((policy) => policy.reserve_tokens + policy.keep_recent_tokens < policy.context_window ? undefined : "reserve_tokens + keep_recent_tokens must be less than context_window")).annotate({ identifier: "Relay.Agent.CompactionPolicy" });
|
|
339
346
|
var ChildRunWorkspacePolicy = Schema5.Struct({
|
|
340
347
|
mode: Schema5.Literals(["share", "fork"]),
|
|
341
348
|
fallback: Schema5.optionalKey(Schema5.Literals(["fail", "fresh"]))
|
|
@@ -343,6 +350,7 @@ var ChildRunWorkspacePolicy = Schema5.Struct({
|
|
|
343
350
|
var ChildRunPreset = Schema5.Struct({
|
|
344
351
|
instructions: Schema5.optionalKey(Schema5.String),
|
|
345
352
|
model: Schema5.optionalKey(ModelSelection),
|
|
353
|
+
compaction_policy: Schema5.optionalKey(CompactionPolicy),
|
|
346
354
|
tool_names: Schema5.optionalKey(Schema5.Array(Schema5.String)),
|
|
347
355
|
permissions: Schema5.optionalKey(Schema5.Array(Schema5.String)),
|
|
348
356
|
workspace_policy: Schema5.optionalKey(ChildRunWorkspacePolicy),
|
|
@@ -426,6 +434,7 @@ var DefinitionSchema = Schema5.Struct({
|
|
|
426
434
|
skill_definition_ids: Schema5.optionalKey(Schema5.Array(SkillDefinitionId)),
|
|
427
435
|
permission_rules: Schema5.optionalKey(PermissionRuleset),
|
|
428
436
|
turn_policy: Schema5.optionalKey(TurnPolicySnapshot),
|
|
437
|
+
compaction_policy: Schema5.optionalKey(CompactionPolicy),
|
|
429
438
|
max_tool_turns: Schema5.optionalKey(Schema5.Int.check(Schema5.isGreaterThanOrEqualTo(1))),
|
|
430
439
|
max_wait_turns: Schema5.optionalKey(Schema5.Int.check(Schema5.isGreaterThanOrEqualTo(0))),
|
|
431
440
|
token_budget: Schema5.optionalKey(Schema5.Int.check(Schema5.isGreaterThanOrEqualTo(1))),
|
|
@@ -446,6 +455,7 @@ var define = (input) => ({
|
|
|
446
455
|
...input.skill_definition_ids === undefined ? {} : { skill_definition_ids: input.skill_definition_ids },
|
|
447
456
|
...input.permission_rules === undefined ? {} : { permission_rules: input.permission_rules },
|
|
448
457
|
...input.turn_policy === undefined ? {} : { turn_policy: input.turn_policy },
|
|
458
|
+
...input.compaction_policy === undefined ? {} : { compaction_policy: input.compaction_policy },
|
|
449
459
|
...input.max_tool_turns === undefined ? {} : { max_tool_turns: input.max_tool_turns },
|
|
450
460
|
...input.max_wait_turns === undefined ? {} : { max_wait_turns: input.max_wait_turns },
|
|
451
461
|
...input.token_budget === undefined ? {} : { token_budget: input.token_budget },
|
|
@@ -603,6 +613,7 @@ var ExecutionEventSequence = Schema7.Int.check(Schema7.isGreaterThanOrEqualTo(0)
|
|
|
603
613
|
var ChildRunContext = Schema7.Struct({
|
|
604
614
|
instructions: Schema7.optionalKey(Schema7.String),
|
|
605
615
|
model: Schema7.optionalKey(ModelSelection),
|
|
616
|
+
compaction_policy: Schema7.optionalKey(CompactionPolicy),
|
|
606
617
|
tool_names: Schema7.Array(Schema7.String),
|
|
607
618
|
permissions: Schema7.Array(Schema7.String),
|
|
608
619
|
output_schema_ref: Schema7.optionalKey(Schema7.String),
|
|
@@ -611,6 +622,7 @@ var ChildRunContext = Schema7.Struct({
|
|
|
611
622
|
var ChildRunOverride = Schema7.Struct({
|
|
612
623
|
instructions: Schema7.optionalKey(Schema7.String),
|
|
613
624
|
model: Schema7.optionalKey(ModelSelection),
|
|
625
|
+
compaction_policy: Schema7.optionalKey(CompactionPolicy),
|
|
614
626
|
tool_names: Schema7.optionalKey(Schema7.Array(Schema7.String)),
|
|
615
627
|
permissions: Schema7.optionalKey(Schema7.Array(Schema7.String)),
|
|
616
628
|
workspace_policy: Schema7.optionalKey(ChildRunWorkspacePolicy),
|
|
@@ -627,6 +639,7 @@ var SpawnChildRunInput = Schema7.Struct({
|
|
|
627
639
|
preset_name: Schema7.optionalKey(NonEmptyString),
|
|
628
640
|
instructions: Schema7.optionalKey(Schema7.String),
|
|
629
641
|
model: Schema7.optionalKey(ModelSelection),
|
|
642
|
+
compaction_policy: Schema7.optionalKey(CompactionPolicy),
|
|
630
643
|
tool_names: Schema7.optionalKey(Schema7.Array(Schema7.String)),
|
|
631
644
|
permissions: Schema7.optionalKey(Schema7.Array(Schema7.String)),
|
|
632
645
|
workspace_policy: Schema7.optionalKey(ChildRunWorkspacePolicy),
|
|
@@ -650,6 +663,7 @@ var ExecutionEventType = Schema7.Literals([
|
|
|
650
663
|
"model.input.prepared",
|
|
651
664
|
"model.output.delta",
|
|
652
665
|
"model.reasoning.delta",
|
|
666
|
+
"model.toolcall.delta",
|
|
653
667
|
"model.output.completed",
|
|
654
668
|
"model.usage.reported",
|
|
655
669
|
"budget.exceeded",
|
|
@@ -11299,7 +11313,7 @@ var resolveLocalAgent = Effect37.fn("AddressResolution.resolveLocalAgent.call")(
|
|
|
11299
11313
|
const service = yield* Service34;
|
|
11300
11314
|
return yield* service.resolveLocalAgent(addressId);
|
|
11301
11315
|
});
|
|
11302
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11316
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/agent.js
|
|
11303
11317
|
var exports_agent = {};
|
|
11304
11318
|
__export(exports_agent, {
|
|
11305
11319
|
streamObject: () => streamObject,
|
|
@@ -11312,7 +11326,7 @@ __export(exports_agent, {
|
|
|
11312
11326
|
import { Cause as Cause3, Effect as Effect53, Fiber, Option as Option18, Queue as Queue2, Ref as Ref14, Schema as Schema62, Stream as Stream9 } from "effect";
|
|
11313
11327
|
import { Chat, LanguageModel as LanguageModel5, Prompt as Prompt8, Response as Response6, Telemetry, Tokenizer as Tokenizer2, Tool as Tool5, Toolkit as Toolkit4 } from "effect/unstable/ai";
|
|
11314
11328
|
|
|
11315
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11329
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/agent-event.js
|
|
11316
11330
|
var exports_agent_event = {};
|
|
11317
11331
|
__export(exports_agent_event, {
|
|
11318
11332
|
addUsage: () => addUsage,
|
|
@@ -11369,7 +11383,7 @@ class AgentSuspended extends Schema52.TaggedErrorClass()("@batonfx/core/AgentSus
|
|
|
11369
11383
|
}) {
|
|
11370
11384
|
}
|
|
11371
11385
|
|
|
11372
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11386
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/approvals.js
|
|
11373
11387
|
var exports_approvals = {};
|
|
11374
11388
|
__export(exports_approvals, {
|
|
11375
11389
|
testLayer: () => testLayer28,
|
|
@@ -11379,7 +11393,7 @@ __export(exports_approvals, {
|
|
|
11379
11393
|
});
|
|
11380
11394
|
import { Context as Context37, Effect as Effect40, Layer as Layer37 } from "effect";
|
|
11381
11395
|
|
|
11382
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11396
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/tool-executor.js
|
|
11383
11397
|
var exports_tool_executor = {};
|
|
11384
11398
|
__export(exports_tool_executor, {
|
|
11385
11399
|
testLayer: () => testLayer27,
|
|
@@ -11397,7 +11411,7 @@ __export(exports_tool_executor, {
|
|
|
11397
11411
|
import { Cause, Context as Context36, Effect as Effect39, Layer as Layer36, Option as Option10, Schedule as Schedule3, Schema as Schema53, Sink as Sink2, Stream as Stream7 } from "effect";
|
|
11398
11412
|
import { Response as Response2, Tool as Tool3, Toolkit as Toolkit2 } from "effect/unstable/ai";
|
|
11399
11413
|
|
|
11400
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11414
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/tool-context.js
|
|
11401
11415
|
import { Context as Context35, Effect as Effect38, Layer as Layer35 } from "effect";
|
|
11402
11416
|
|
|
11403
11417
|
class ToolContext extends Context35.Service()("@batonfx/core/ToolContext") {
|
|
@@ -11408,7 +11422,7 @@ var layerDefault = Layer35.sync(ToolContext, () => ToolContext.of({
|
|
|
11408
11422
|
sessionId: "local"
|
|
11409
11423
|
}));
|
|
11410
11424
|
|
|
11411
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11425
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/tool-executor.js
|
|
11412
11426
|
class ToolExecutor extends Context36.Service()("@batonfx/core/ToolExecutor") {
|
|
11413
11427
|
}
|
|
11414
11428
|
var failureMessage = (cause) => {
|
|
@@ -11519,14 +11533,14 @@ function router(routes) {
|
|
|
11519
11533
|
}
|
|
11520
11534
|
var testLayer27 = (implementation) => Layer36.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
11521
11535
|
|
|
11522
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11536
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/approvals.js
|
|
11523
11537
|
class Approvals extends Context37.Service()("@batonfx/core/Approvals") {
|
|
11524
11538
|
}
|
|
11525
11539
|
var autoApprove = Layer37.succeed(Approvals, Approvals.of({ check: () => Effect40.succeed({ _tag: "Approved" }) }));
|
|
11526
11540
|
var denyAll = Layer37.succeed(Approvals, Approvals.of({ check: () => Effect40.succeed({ _tag: "Denied" }) }));
|
|
11527
11541
|
var testLayer28 = (implementation) => Layer37.succeed(Approvals, Approvals.of(implementation));
|
|
11528
11542
|
|
|
11529
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11543
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/compaction.js
|
|
11530
11544
|
var exports_compaction = {};
|
|
11531
11545
|
__export(exports_compaction, {
|
|
11532
11546
|
truncate: () => truncate,
|
|
@@ -11549,7 +11563,7 @@ __export(exports_compaction, {
|
|
|
11549
11563
|
import { Context as Context40, Effect as Effect43, Layer as Layer40, Option as Option13, Schema as Schema56 } from "effect";
|
|
11550
11564
|
import { LanguageModel, Prompt as Prompt3, Tokenizer, Toolkit as Toolkit3 } from "effect/unstable/ai";
|
|
11551
11565
|
|
|
11552
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11566
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/session.js
|
|
11553
11567
|
var exports_session = {};
|
|
11554
11568
|
__export(exports_session, {
|
|
11555
11569
|
testLayer: () => testLayer29,
|
|
@@ -11722,7 +11736,7 @@ var memoryLayer31 = Layer38.effect(SessionStore, Ref10.make(initialState).pipe(E
|
|
|
11722
11736
|
}))));
|
|
11723
11737
|
var testLayer29 = (implementation) => Layer38.succeed(SessionStore, SessionStore.of(implementation));
|
|
11724
11738
|
|
|
11725
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11739
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/tool-output.js
|
|
11726
11740
|
var exports_tool_output = {};
|
|
11727
11741
|
__export(exports_tool_output, {
|
|
11728
11742
|
testLayer: () => testLayer30,
|
|
@@ -11781,7 +11795,7 @@ var bound = (result, options) => Effect42.gen(function* () {
|
|
|
11781
11795
|
return { _tag: "Success", result: output, encodedResult: output };
|
|
11782
11796
|
});
|
|
11783
11797
|
|
|
11784
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
11798
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/compaction.js
|
|
11785
11799
|
var DEFAULT_RESERVE_TOKENS = 16384;
|
|
11786
11800
|
var DEFAULT_KEEP_RECENT_TOKENS = 20000;
|
|
11787
11801
|
var SUMMARY_TEMPLATE = `Summarize the conversation so another agent can continue seamlessly.
|
|
@@ -12031,7 +12045,7 @@ var truncate = (maxTokens) => ({
|
|
|
12031
12045
|
var testLayer31 = (implementation) => Layer40.succeed(Compaction, Compaction.of(implementation));
|
|
12032
12046
|
var isContextOverflow = (error5) => /context|token|prompt/i.test(error5 instanceof Error ? `${error5.name}: ${error5.message}` : String(error5)) && /overflow|exceed|exceeded|maximum|too large|too long|length/i.test(error5 instanceof Error ? `${error5.name}: ${error5.message}` : String(error5));
|
|
12033
12047
|
|
|
12034
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12048
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/instructions.js
|
|
12035
12049
|
var exports_instructions = {};
|
|
12036
12050
|
__export(exports_instructions, {
|
|
12037
12051
|
testLayer: () => testLayer32,
|
|
@@ -12079,7 +12093,7 @@ var renderUpdate = (epoch, context) => Effect44.gen(function* () {
|
|
|
12079
12093
|
var layer33 = (sources) => Layer41.succeed(Instructions, Instructions.of({ sources: [...sources] }));
|
|
12080
12094
|
var testLayer32 = (implementation) => Layer41.succeed(Instructions, Instructions.of(implementation));
|
|
12081
12095
|
|
|
12082
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12096
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/memory.js
|
|
12083
12097
|
var exports_memory = {};
|
|
12084
12098
|
__export(exports_memory, {
|
|
12085
12099
|
testLayer: () => testLayer33,
|
|
@@ -12111,7 +12125,7 @@ var merge = (first, second) => ({
|
|
|
12111
12125
|
var noopLayer = Layer42.succeed(Memory, Memory.of(noop));
|
|
12112
12126
|
var testLayer33 = (implementation) => Layer42.succeed(Memory, Memory.of(implementation));
|
|
12113
12127
|
|
|
12114
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12128
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/model-middleware.js
|
|
12115
12129
|
var exports_model_middleware = {};
|
|
12116
12130
|
__export(exports_model_middleware, {
|
|
12117
12131
|
layer: () => layer34,
|
|
@@ -12125,7 +12139,7 @@ class ModelMiddleware extends Context43.Service()("@batonfx/core/ModelMiddleware
|
|
|
12125
12139
|
var identityLayer = Layer43.succeed(ModelMiddleware, []);
|
|
12126
12140
|
var layer34 = (middleware) => Layer43.succeed(ModelMiddleware, middleware);
|
|
12127
12141
|
|
|
12128
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12142
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/model-registry.js
|
|
12129
12143
|
var exports_model_registry = {};
|
|
12130
12144
|
__export(exports_model_registry, {
|
|
12131
12145
|
testLayer: () => testLayer34,
|
|
@@ -12214,7 +12228,7 @@ var provide = (selection, effect) => Effect47.gen(function* () {
|
|
|
12214
12228
|
return yield* service.provide(selection, effect);
|
|
12215
12229
|
});
|
|
12216
12230
|
|
|
12217
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12231
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/model-resilience.js
|
|
12218
12232
|
var exports_model_resilience = {};
|
|
12219
12233
|
__export(exports_model_resilience, {
|
|
12220
12234
|
testLayer: () => testLayer35,
|
|
@@ -12260,7 +12274,7 @@ var apply = (model, resilience) => ({
|
|
|
12260
12274
|
}).pipe(Stream8.retry(retryStreamSchedule(resilience)))
|
|
12261
12275
|
});
|
|
12262
12276
|
|
|
12263
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12277
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/permissions.js
|
|
12264
12278
|
var exports_permissions = {};
|
|
12265
12279
|
__export(exports_permissions, {
|
|
12266
12280
|
testLayer: () => testLayer36,
|
|
@@ -12390,7 +12404,7 @@ var ruleStoreMemory = (initialRules = []) => Layer46.effect(RuleStore, Ref13.mak
|
|
|
12390
12404
|
var ruleStoreTestLayer = (implementation) => Layer46.succeed(RuleStore, RuleStore.of(implementation));
|
|
12391
12405
|
var testLayer36 = (implementation) => Layer46.succeed(Permissions, Permissions.of(implementation));
|
|
12392
12406
|
|
|
12393
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12407
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/skill-source.js
|
|
12394
12408
|
var exports_skill_source = {};
|
|
12395
12409
|
__export(exports_skill_source, {
|
|
12396
12410
|
testLayer: () => testLayer37,
|
|
@@ -12470,7 +12484,7 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
12470
12484
|
return selected;
|
|
12471
12485
|
};
|
|
12472
12486
|
|
|
12473
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12487
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/steering.js
|
|
12474
12488
|
var exports_steering = {};
|
|
12475
12489
|
__export(exports_steering, {
|
|
12476
12490
|
testLayer: () => testLayer38,
|
|
@@ -12528,7 +12542,7 @@ var layer38 = (options = {}) => Layer48.effect(Steering, Effect51.gen(function*
|
|
|
12528
12542
|
}));
|
|
12529
12543
|
var testLayer38 = (implementation) => Layer48.succeed(Steering, Steering.of(implementation));
|
|
12530
12544
|
|
|
12531
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12545
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/turn-policy.js
|
|
12532
12546
|
var exports_turn_policy = {};
|
|
12533
12547
|
__export(exports_turn_policy, {
|
|
12534
12548
|
untilToolCall: () => untilToolCall,
|
|
@@ -12577,7 +12591,7 @@ var both = (first, second) => ({
|
|
|
12577
12591
|
});
|
|
12578
12592
|
var defaultPolicy = recurs(8);
|
|
12579
12593
|
|
|
12580
|
-
// ../../node_modules/.bun/@batonfx+core@0.4.
|
|
12594
|
+
// ../../node_modules/.bun/@batonfx+core@0.4.3/node_modules/@batonfx/core/dist/agent.js
|
|
12581
12595
|
function make5(nameOrOptions, options = {}) {
|
|
12582
12596
|
const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
|
|
12583
12597
|
return {
|
|
@@ -12763,8 +12777,7 @@ var streamInternal = (agent, options, structured) => Stream9.unwrap(Effect53.gen
|
|
|
12763
12777
|
turn: 0,
|
|
12764
12778
|
pending: [],
|
|
12765
12779
|
finish: undefined,
|
|
12766
|
-
usage: undefined
|
|
12767
|
-
contextTokens: undefined
|
|
12780
|
+
usage: undefined
|
|
12768
12781
|
};
|
|
12769
12782
|
const activatedSkillBodies = new Map;
|
|
12770
12783
|
const activatedSkillTools = new Map;
|
|
@@ -12815,10 +12828,8 @@ var streamInternal = (agent, options, structured) => Stream9.unwrap(Effect53.gen
|
|
|
12815
12828
|
})
|
|
12816
12829
|
});
|
|
12817
12830
|
const countTokens = (turn, prompt) => {
|
|
12818
|
-
if (state.contextTokens !== undefined)
|
|
12819
|
-
return Effect53.succeed(state.contextTokens);
|
|
12820
12831
|
return Option18.match(tokenizerService, {
|
|
12821
|
-
onNone: () => Effect53.succeed(
|
|
12832
|
+
onNone: () => Effect53.succeed(Math.ceil(JSON.stringify(prompt.content).length / 4)),
|
|
12822
12833
|
onSome: (tokenizer) => tokenizer.tokenize(prompt).pipe(Effect53.map((tokens) => tokens.length), Effect53.mapError((error5) => new AgentError({ message: errorMessage(error5), turn, cause: error5 })))
|
|
12823
12834
|
});
|
|
12824
12835
|
};
|
|
@@ -13027,7 +13038,6 @@ var streamInternal = (agent, options, structured) => Stream9.unwrap(Effect53.gen
|
|
|
13027
13038
|
reason: part.reason
|
|
13028
13039
|
};
|
|
13029
13040
|
state.usage = state.usage === undefined ? part.usage : addUsage(state.usage, part.usage);
|
|
13030
|
-
state.contextTokens = part.usage.inputTokens.total ?? state.contextTokens;
|
|
13031
13041
|
Telemetry.addGenAIAnnotations(span, {
|
|
13032
13042
|
operation: { name: "chat" },
|
|
13033
13043
|
usage: {
|
|
@@ -13281,8 +13291,8 @@ var generateObject = (agent, options) => Stream9.runFold(streamObject(agent, opt
|
|
|
13281
13291
|
})
|
|
13282
13292
|
})));
|
|
13283
13293
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
13284
|
-
import { Config as Config4, Context as Context72, Crypto as Crypto3, Effect as Effect90, HashSet as HashSet7, Layer as Layer79, Option as Option27, Ref as Ref23, Schema as Schema91, Stream as Stream12 } from "effect";
|
|
13285
|
-
import { Chat as Chat3, LanguageModel as LanguageModel7, Prompt as Prompt13, Tokenizer as Tokenizer4, Toolkit as Toolkit6 } from "effect/unstable/ai";
|
|
13294
|
+
import { Cause as Cause4, Config as Config4, Context as Context72, Crypto as Crypto3, Effect as Effect90, HashSet as HashSet7, Layer as Layer79, Option as Option27, Ref as Ref23, Schema as Schema91, Stream as Stream12 } from "effect";
|
|
13295
|
+
import { AiError as AiError4, Chat as Chat3, LanguageModel as LanguageModel7, Prompt as Prompt13, Tokenizer as Tokenizer4, Toolkit as Toolkit6 } from "effect/unstable/ai";
|
|
13286
13296
|
|
|
13287
13297
|
// ../runtime/src/child/child-run-service.ts
|
|
13288
13298
|
import { Context as Context50, Effect as Effect55, HashSet as HashSet5, Layer as Layer51, Option as Option19, Result as Result2, Schema as Schema64 } from "effect";
|
|
@@ -13376,6 +13386,7 @@ var resolveContext = (parent, override) => {
|
|
|
13376
13386
|
const permissions = override?.permissions ?? parent.permissions;
|
|
13377
13387
|
const instructions = override?.instructions ?? parent.instructions;
|
|
13378
13388
|
const model = override?.model ?? parent.model;
|
|
13389
|
+
const compactionPolicy = override?.compactionPolicy ?? parent.compactionPolicy;
|
|
13379
13390
|
const workspacePolicy = override?.workspacePolicy;
|
|
13380
13391
|
const outputSchemaRef = override?.outputSchemaRef ?? parent.outputSchemaRef;
|
|
13381
13392
|
const broadenedTool = subsetViolation(parent.toolNames, toolNames);
|
|
@@ -13395,6 +13406,7 @@ var resolveContext = (parent, override) => {
|
|
|
13395
13406
|
},
|
|
13396
13407
|
...instructions === undefined ? {} : { instructions },
|
|
13397
13408
|
...model === undefined ? {} : { model },
|
|
13409
|
+
...compactionPolicy === undefined ? {} : { compactionPolicy },
|
|
13398
13410
|
...workspacePolicy === undefined ? {} : { workspacePolicy },
|
|
13399
13411
|
...outputSchemaRef === undefined ? {} : { outputSchemaRef }
|
|
13400
13412
|
});
|
|
@@ -13541,12 +13553,14 @@ var agentContextFromSchema = (input) => ({
|
|
|
13541
13553
|
permissions: input.permissions,
|
|
13542
13554
|
...input.instructions === undefined ? {} : { instructions: input.instructions },
|
|
13543
13555
|
...input.model === undefined ? {} : { model: input.model },
|
|
13556
|
+
...input.compaction_policy === undefined ? {} : { compactionPolicy: input.compaction_policy },
|
|
13544
13557
|
...input.output_schema_ref === undefined ? {} : { outputSchemaRef: input.output_schema_ref },
|
|
13545
13558
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
13546
13559
|
});
|
|
13547
13560
|
var overrideFromSchema = (input) => ({
|
|
13548
13561
|
...input.instructions === undefined ? {} : { instructions: input.instructions },
|
|
13549
13562
|
...input.model === undefined ? {} : { model: input.model },
|
|
13563
|
+
...input.compaction_policy === undefined ? {} : { compactionPolicy: input.compaction_policy },
|
|
13550
13564
|
...input.tool_names === undefined ? {} : { toolNames: input.tool_names },
|
|
13551
13565
|
...input.permissions === undefined ? {} : { permissions: input.permissions },
|
|
13552
13566
|
...input.workspace_policy === undefined ? {} : { workspacePolicy: input.workspace_policy },
|
|
@@ -13554,7 +13568,7 @@ var overrideFromSchema = (input) => ({
|
|
|
13554
13568
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
13555
13569
|
});
|
|
13556
13570
|
var dynamicOverrideFromSpawn = (input) => {
|
|
13557
|
-
if (input.instructions === undefined && input.model === undefined && input.tool_names === undefined && input.permissions === undefined && input.workspace_policy === undefined && input.output_schema_ref === undefined && input.metadata === undefined) {
|
|
13571
|
+
if (input.instructions === undefined && input.model === undefined && input.compaction_policy === undefined && input.tool_names === undefined && input.permissions === undefined && input.workspace_policy === undefined && input.output_schema_ref === undefined && input.metadata === undefined) {
|
|
13558
13572
|
return;
|
|
13559
13573
|
}
|
|
13560
13574
|
return overrideFromSchema(input);
|
|
@@ -13576,6 +13590,7 @@ var childDefinition = (parentDefinition, context) => context.model === undefined
|
|
|
13576
13590
|
tool_names: [...context.toolNames],
|
|
13577
13591
|
permissions: parentDefinition.permissions.filter((permission) => context.permissions.includes(permission.name)),
|
|
13578
13592
|
child_run_presets: {},
|
|
13593
|
+
...context.compactionPolicy === undefined ? {} : { compaction_policy: context.compactionPolicy },
|
|
13579
13594
|
...parentDefinition.turn_policy === undefined ? {} : { turn_policy: parentDefinition.turn_policy },
|
|
13580
13595
|
...parentDefinition.max_tool_turns === undefined ? {} : { max_tool_turns: parentDefinition.max_tool_turns },
|
|
13581
13596
|
...parentDefinition.max_wait_turns === undefined ? {} : { max_wait_turns: parentDefinition.max_wait_turns },
|
|
@@ -13600,6 +13615,7 @@ var Input = Schema65.Struct({
|
|
|
13600
13615
|
preset_name: Schema65.optionalKey(exports_shared_schema.NonEmptyString),
|
|
13601
13616
|
instructions: Schema65.optionalKey(Schema65.String),
|
|
13602
13617
|
model: Schema65.optionalKey(exports_agent_schema.ModelSelection),
|
|
13618
|
+
compaction_policy: Schema65.optionalKey(exports_agent_schema.CompactionPolicy),
|
|
13603
13619
|
tool_names: Schema65.optionalKey(Schema65.Array(Schema65.String)),
|
|
13604
13620
|
permissions: Schema65.optionalKey(Schema65.Array(Schema65.String)),
|
|
13605
13621
|
output_schema_ref: Schema65.optionalKey(Schema65.String),
|
|
@@ -13622,6 +13638,7 @@ var ModelInput = Schema65.Struct({
|
|
|
13622
13638
|
model: Schema65.String,
|
|
13623
13639
|
registration_key: Schema65.optionalKey(Schema65.String)
|
|
13624
13640
|
}))),
|
|
13641
|
+
compaction_policy: Schema65.optionalKey(exports_agent_schema.CompactionPolicy),
|
|
13625
13642
|
tool_names: Schema65.optionalKey(Schema65.Array(Schema65.String)),
|
|
13626
13643
|
permissions: Schema65.optionalKey(Schema65.Array(Schema65.String)),
|
|
13627
13644
|
output_schema_ref: Schema65.optionalKey(Schema65.NullOr(Schema65.String)),
|
|
@@ -13643,6 +13660,7 @@ var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
|
|
|
13643
13660
|
var parentContext = (agent) => ({
|
|
13644
13661
|
...agent.instructions === undefined ? {} : { instructions: agent.instructions },
|
|
13645
13662
|
model: agent.model,
|
|
13663
|
+
...agent.compaction_policy === undefined ? {} : { compaction_policy: agent.compaction_policy },
|
|
13646
13664
|
tool_names: agent.tool_names,
|
|
13647
13665
|
permissions: agent.permissions.map((permission) => permission.name),
|
|
13648
13666
|
...agent.output_schema_ref === undefined ? {} : { output_schema_ref: agent.output_schema_ref },
|
|
@@ -13651,12 +13669,13 @@ var parentContext = (agent) => ({
|
|
|
13651
13669
|
var serviceParentContext = (agent) => ({
|
|
13652
13670
|
...agent.instructions === undefined ? {} : { instructions: agent.instructions },
|
|
13653
13671
|
model: agent.model,
|
|
13672
|
+
...agent.compaction_policy === undefined ? {} : { compactionPolicy: agent.compaction_policy },
|
|
13654
13673
|
toolNames: agent.tool_names,
|
|
13655
13674
|
permissions: agent.permissions.map((permission) => permission.name),
|
|
13656
13675
|
...agent.output_schema_ref === undefined ? {} : { outputSchemaRef: agent.output_schema_ref },
|
|
13657
13676
|
...agent.metadata === undefined ? {} : { metadata: agent.metadata }
|
|
13658
13677
|
});
|
|
13659
|
-
var hasDynamicOverride = (input) => input.instructions !== undefined || input.model !== undefined || input.tool_names !== undefined || input.permissions !== undefined || input.output_schema_ref !== undefined || input.metadata !== undefined;
|
|
13678
|
+
var hasDynamicOverride = (input) => input.instructions !== undefined || input.model !== undefined || input.compaction_policy !== undefined || input.tool_names !== undefined || input.permissions !== undefined || input.output_schema_ref !== undefined || input.metadata !== undefined;
|
|
13660
13679
|
var childExecutionId = (context) => exports_ids_schema.ChildExecutionId.make(`${context.executionId}:child:${context.call.id}`);
|
|
13661
13680
|
var childAddressId = (id2) => exports_ids_schema.AddressId.make(`address:child:${id2}`);
|
|
13662
13681
|
var childWaitId = (id2) => exports_ids_schema.WaitId.make(`wait:child:${id2}`);
|
|
@@ -13672,6 +13691,7 @@ var spawnInput = (config, input, context, id2) => ({
|
|
|
13672
13691
|
...input.preset_name === undefined ? {} : { preset_name: input.preset_name },
|
|
13673
13692
|
...input.instructions === undefined ? {} : { instructions: input.instructions },
|
|
13674
13693
|
...input.model === undefined ? {} : { model: input.model },
|
|
13694
|
+
...input.compaction_policy === undefined ? {} : { compaction_policy: input.compaction_policy },
|
|
13675
13695
|
...input.tool_names === undefined ? {} : { tool_names: input.tool_names },
|
|
13676
13696
|
...input.permissions === undefined ? {} : { permissions: input.permissions },
|
|
13677
13697
|
...input.output_schema_ref === undefined ? {} : { output_schema_ref: input.output_schema_ref },
|
|
@@ -13691,6 +13711,7 @@ var childOverride = (input) => {
|
|
|
13691
13711
|
return {
|
|
13692
13712
|
...input.instructions === undefined ? {} : { instructions: input.instructions },
|
|
13693
13713
|
...input.model === undefined ? {} : { model: input.model },
|
|
13714
|
+
...input.compaction_policy === undefined ? {} : { compactionPolicy: input.compaction_policy },
|
|
13694
13715
|
...input.tool_names === undefined ? {} : { toolNames: input.tool_names },
|
|
13695
13716
|
...input.permissions === undefined ? {} : { permissions: input.permissions },
|
|
13696
13717
|
...input.output_schema_ref === undefined ? {} : { outputSchemaRef: input.output_schema_ref },
|
|
@@ -13702,6 +13723,7 @@ var presetMap = (agent) => new Map(Object.entries(agent.child_run_presets ?? {})
|
|
|
13702
13723
|
{
|
|
13703
13724
|
...preset.instructions === undefined ? {} : { instructions: preset.instructions },
|
|
13704
13725
|
...preset.model === undefined ? {} : { model: preset.model },
|
|
13726
|
+
...preset.compaction_policy === undefined ? {} : { compactionPolicy: preset.compaction_policy },
|
|
13705
13727
|
...preset.tool_names === undefined ? {} : { toolNames: preset.tool_names },
|
|
13706
13728
|
...preset.permissions === undefined ? {} : { permissions: preset.permissions },
|
|
13707
13729
|
...preset.workspace_policy === undefined ? {} : { workspacePolicy: preset.workspace_policy },
|
|
@@ -15000,12 +15022,14 @@ var childContext = (input) => ({
|
|
|
15000
15022
|
permissions: input.permissions,
|
|
15001
15023
|
...input.instructions === undefined ? {} : { instructions: input.instructions },
|
|
15002
15024
|
...input.model === undefined ? {} : { model: input.model },
|
|
15025
|
+
...input.compaction_policy === undefined ? {} : { compactionPolicy: input.compaction_policy },
|
|
15003
15026
|
...input.output_schema_ref === undefined ? {} : { outputSchemaRef: input.output_schema_ref },
|
|
15004
15027
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
15005
15028
|
});
|
|
15006
15029
|
var childOverride2 = (input) => ({
|
|
15007
15030
|
...input.instructions === undefined ? {} : { instructions: input.instructions },
|
|
15008
15031
|
...input.model === undefined ? {} : { model: input.model },
|
|
15032
|
+
...input.compaction_policy === undefined ? {} : { compactionPolicy: input.compaction_policy },
|
|
15009
15033
|
...input.tool_names === undefined ? {} : { toolNames: input.tool_names },
|
|
15010
15034
|
...input.permissions === undefined ? {} : { permissions: input.permissions },
|
|
15011
15035
|
...input.workspace_policy === undefined ? {} : { workspacePolicy: input.workspace_policy },
|
|
@@ -15013,12 +15037,13 @@ var childOverride2 = (input) => ({
|
|
|
15013
15037
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
15014
15038
|
});
|
|
15015
15039
|
var dynamicOverride = (input) => {
|
|
15016
|
-
if (input.instructions === undefined && input.model === undefined && input.tool_names === undefined && input.permissions === undefined && input.workspace_policy === undefined && input.output_schema_ref === undefined && input.metadata === undefined) {
|
|
15040
|
+
if (input.instructions === undefined && input.model === undefined && input.compaction_policy === undefined && input.tool_names === undefined && input.permissions === undefined && input.workspace_policy === undefined && input.output_schema_ref === undefined && input.metadata === undefined) {
|
|
15017
15041
|
return;
|
|
15018
15042
|
}
|
|
15019
15043
|
return childOverride2({
|
|
15020
15044
|
...input.instructions === undefined ? {} : { instructions: input.instructions },
|
|
15021
15045
|
...input.model === undefined ? {} : { model: input.model },
|
|
15046
|
+
...input.compaction_policy === undefined ? {} : { compaction_policy: input.compaction_policy },
|
|
15022
15047
|
...input.tool_names === undefined ? {} : { tool_names: input.tool_names },
|
|
15023
15048
|
...input.permissions === undefined ? {} : { permissions: input.permissions },
|
|
15024
15049
|
...input.workspace_policy === undefined ? {} : { workspace_policy: input.workspace_policy },
|
|
@@ -15943,10 +15968,6 @@ var missingAgentSnapshot = () => new ExecutionWorkflowFailed({ message: "Agent s
|
|
|
15943
15968
|
var memorySubjectMetadataKey = "memory_subject_id";
|
|
15944
15969
|
var steeringEnabledMetadataKey = "steering_enabled";
|
|
15945
15970
|
var toolOutputMaxBytesMetadataKey = "tool_output_max_bytes";
|
|
15946
|
-
var compactionEnabledMetadataKey = "compaction_enabled";
|
|
15947
|
-
var compactionContextWindowMetadataKey = "compaction_context_window";
|
|
15948
|
-
var compactionReserveTokensMetadataKey = "compaction_reserve_tokens";
|
|
15949
|
-
var compactionKeepRecentTokensMetadataKey = "compaction_keep_recent_tokens";
|
|
15950
15971
|
var continueAsNewAfterTurnsMetadataKey = "continue_as_new_after_turns";
|
|
15951
15972
|
var workflowGenerationMetadataKey = "workflow_generation";
|
|
15952
15973
|
var workflowGenerationForStart = (input) => input.workflow_generation ?? 0;
|
|
@@ -15965,7 +15986,6 @@ var metadataSetting = (input, key4) => {
|
|
|
15965
15986
|
return input.agent_snapshot?.metadata?.[key4];
|
|
15966
15987
|
return;
|
|
15967
15988
|
};
|
|
15968
|
-
var executionMetadataSetting = (input, key4) => hasMetadataKey(input.metadata, key4) ? input.metadata?.[key4] : undefined;
|
|
15969
15989
|
var decodeOptionalNumberSetting = (value, key4, valid) => {
|
|
15970
15990
|
if (value === undefined)
|
|
15971
15991
|
return Effect74.succeed(undefined);
|
|
@@ -15978,31 +15998,6 @@ var decodeOptionalNumberSetting = (value, key4, valid) => {
|
|
|
15978
15998
|
var optionalNumberForStart = (input, key4, valid) => decodeOptionalNumberSetting(metadataSetting(input, key4), key4, valid).pipe(Effect74.map((value) => value === null ? undefined : value));
|
|
15979
15999
|
var continueAsNewAfterTurnsForStart = (input) => optionalNumberForStart(input, continueAsNewAfterTurnsMetadataKey, (value) => Number.isInteger(value) && value > 0);
|
|
15980
16000
|
var toolOutputMaxBytesForStart = (input) => decodeOptionalNumberSetting(metadataSetting(input, toolOutputMaxBytesMetadataKey), toolOutputMaxBytesMetadataKey, (value) => value >= 0);
|
|
15981
|
-
var decodeCompactionEnabled = (value) => {
|
|
15982
|
-
if (value === undefined)
|
|
15983
|
-
return Effect74.succeed(undefined);
|
|
15984
|
-
if (value === null || value === false)
|
|
15985
|
-
return Effect74.succeed(null);
|
|
15986
|
-
if (value === true)
|
|
15987
|
-
return Effect74.succeed(true);
|
|
15988
|
-
return Effect74.fail(new ExecutionWorkflowFailed({ message: "compaction_enabled metadata value must be true or false" }));
|
|
15989
|
-
};
|
|
15990
|
-
var compactionForStart = Effect74.fn("ExecutionWorkflow.compactionForStart")(function* (input) {
|
|
15991
|
-
const executionEnabled = yield* decodeCompactionEnabled(executionMetadataSetting(input, compactionEnabledMetadataKey));
|
|
15992
|
-
if (executionEnabled === null)
|
|
15993
|
-
return null;
|
|
15994
|
-
const agentEnabled = yield* decodeCompactionEnabled(input.agent_snapshot?.metadata?.[compactionEnabledMetadataKey]);
|
|
15995
|
-
if (executionEnabled !== true && agentEnabled !== true)
|
|
15996
|
-
return;
|
|
15997
|
-
const contextWindow = yield* optionalNumberForStart(input, compactionContextWindowMetadataKey, (value) => value > 0);
|
|
15998
|
-
const reserveTokens = yield* optionalNumberForStart(input, compactionReserveTokensMetadataKey, (value) => value >= 0);
|
|
15999
|
-
const keepRecentTokens = yield* optionalNumberForStart(input, compactionKeepRecentTokensMetadataKey, (value) => value >= 0);
|
|
16000
|
-
return {
|
|
16001
|
-
...contextWindow === undefined ? {} : { contextWindow },
|
|
16002
|
-
...reserveTokens === undefined ? {} : { reserveTokens },
|
|
16003
|
-
...keepRecentTokens === undefined ? {} : { keepRecentTokens }
|
|
16004
|
-
};
|
|
16005
|
-
});
|
|
16006
16001
|
var decodeMemorySubject = (value) => typeof value === "string" ? Schema79.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(value).pipe(Effect74.mapError(() => new ExecutionWorkflowFailed({ message: `Invalid memory_subject_id metadata value: ${value}` }))) : Effect74.fail(new ExecutionWorkflowFailed({ message: "memory_subject_id metadata value must be a string" }));
|
|
16007
16002
|
var memorySubjectForStart = Effect74.fn("ExecutionWorkflow.memorySubjectForStart")(function* (input) {
|
|
16008
16003
|
const executionSubject = memorySubjectFromMetadata(input.metadata);
|
|
@@ -16074,7 +16069,6 @@ var completeExecution = (input, waitId, waitState, workspaceRuntimeLayer, turn,
|
|
|
16074
16069
|
const runEventSequence = yield* nextEventSequence4(eventLog, input.execution_id);
|
|
16075
16070
|
const memorySubjectId = yield* memorySubjectForStart(input);
|
|
16076
16071
|
const toolOutputMaxBytes = yield* toolOutputMaxBytesForStart(input);
|
|
16077
|
-
const compaction = yield* compactionForStart(input);
|
|
16078
16072
|
const skillDefinitionIds = input.agent_snapshot.skill_definition_ids ?? [];
|
|
16079
16073
|
const loopProgram = agentLoop.run({
|
|
16080
16074
|
executionId: input.execution_id,
|
|
@@ -16090,7 +16084,6 @@ var completeExecution = (input, waitId, waitState, workspaceRuntimeLayer, turn,
|
|
|
16090
16084
|
...pendingToolCall === undefined ? {} : { resumeToolCall: pendingToolCall },
|
|
16091
16085
|
...memorySubjectId === undefined ? {} : { memorySubjectId },
|
|
16092
16086
|
...toolOutputMaxBytes === undefined ? {} : { toolOutputMaxBytes },
|
|
16093
|
-
...compaction === undefined ? {} : { compaction },
|
|
16094
16087
|
eventSequence: runEventSequence + 1,
|
|
16095
16088
|
startedAt: input.started_at,
|
|
16096
16089
|
completedAt: input.completed_at,
|
|
@@ -17751,6 +17744,20 @@ var reasoningDeltaEvent = (input, part, deltaIndex) => {
|
|
|
17751
17744
|
created_at: input.startedAt + deltaIndex + 1
|
|
17752
17745
|
};
|
|
17753
17746
|
};
|
|
17747
|
+
var toolCallDeltaEvent = (input, part, toolCallName, sequence, deltaIndex) => ({
|
|
17748
|
+
id: exports_ids_schema.EventId.make(`event:${input.executionId}:model:${sequence}:toolcall-delta:${part.id}:${deltaIndex}`),
|
|
17749
|
+
execution_id: input.executionId,
|
|
17750
|
+
type: "model.toolcall.delta",
|
|
17751
|
+
sequence,
|
|
17752
|
+
cursor: `${input.executionId}:model:${sequence}:toolcall-delta:${part.id}:${deltaIndex}`,
|
|
17753
|
+
data: {
|
|
17754
|
+
tool_call_id: part.id,
|
|
17755
|
+
...toolCallName === undefined ? {} : { tool_name: toolCallName },
|
|
17756
|
+
delta: part.delta,
|
|
17757
|
+
delta_index: deltaIndex
|
|
17758
|
+
},
|
|
17759
|
+
created_at: input.startedAt + (sequence - input.eventSequence)
|
|
17760
|
+
});
|
|
17754
17761
|
var outputCompletedEvent = (input, content, outputText, sequence, structuredOutput) => ({
|
|
17755
17762
|
id: exports_ids_schema.EventId.make(`event:${input.executionId}:model:${sequence}:output-completed`),
|
|
17756
17763
|
execution_id: input.executionId,
|
|
@@ -17814,6 +17821,35 @@ var restoreHistory = Effect90.fn("AgentLoop.restoreHistory")(function* (chats, i
|
|
|
17814
17821
|
const chat = yield* Chat3.fromExport(record2.exportData).pipe(Effect90.mapError((error5) => loopError(error5, input.eventSequence + 1)));
|
|
17815
17822
|
return yield* Ref23.get(chat.history);
|
|
17816
17823
|
});
|
|
17824
|
+
var toolCallDecodeMaxRetriesConfig = Config4.int("RELAY_AGENT_TOOL_CALL_DECODE_MAX_RETRIES").pipe(Config4.withDefault(2));
|
|
17825
|
+
var isToolCallDecodeError = (error5) => AiError4.isAiError(error5) && error5.method === "streamText" && error5.reason._tag === "InvalidOutputError";
|
|
17826
|
+
var toolCallDecodeFeedback = (error5, availableToolNames) => {
|
|
17827
|
+
const tools = availableToolNames.length === 0 ? "(no tools are available)" : availableToolNames.join(", ");
|
|
17828
|
+
return Prompt13.fromMessages([
|
|
17829
|
+
Prompt13.makeMessage("user", {
|
|
17830
|
+
content: [
|
|
17831
|
+
Prompt13.makePart("text", {
|
|
17832
|
+
text: `Your previous response contained an invalid tool call: ${error5.reason.message}. Only call these tools with arguments matching their input schemas: ${tools}. Re-issue the intended tool calls.`
|
|
17833
|
+
})
|
|
17834
|
+
]
|
|
17835
|
+
})
|
|
17836
|
+
]);
|
|
17837
|
+
};
|
|
17838
|
+
var withToolCallDecodeResilience = (base2, availableToolNames, maxRetries) => ({
|
|
17839
|
+
...base2,
|
|
17840
|
+
streamText: (options) => {
|
|
17841
|
+
const attempt = (prompt, retriesLeft) => Stream12.suspend(() => {
|
|
17842
|
+
let emitted = false;
|
|
17843
|
+
return base2.streamText({ ...options, prompt }).pipe(Stream12.tap(() => Effect90.sync(() => void (emitted = true))), Stream12.catchCause((cause) => {
|
|
17844
|
+
if (Cause4.hasInterrupts(cause))
|
|
17845
|
+
return Stream12.failCause(cause);
|
|
17846
|
+
const error5 = Cause4.squash(cause);
|
|
17847
|
+
return !emitted && retriesLeft > 0 && isToolCallDecodeError(error5) ? attempt(Prompt13.concat(Prompt13.make(prompt), toolCallDecodeFeedback(error5, availableToolNames)), retriesLeft - 1) : Stream12.failCause(cause);
|
|
17848
|
+
}));
|
|
17849
|
+
});
|
|
17850
|
+
return attempt(options.prompt, maxRetries);
|
|
17851
|
+
}
|
|
17852
|
+
});
|
|
17817
17853
|
var saveContextEpoch = Effect90.fn("AgentLoop.saveContextEpoch")(function* (epochs, input, epoch) {
|
|
17818
17854
|
yield* epochs.save({
|
|
17819
17855
|
executionId: input.executionId,
|
|
@@ -17894,20 +17930,11 @@ var decodeOptionalNumber = (value, key4, valid) => {
|
|
|
17894
17930
|
return Effect90.fail(new AgentLoopError2({ message: `${key4} metadata value is invalid` }));
|
|
17895
17931
|
};
|
|
17896
17932
|
var effectiveToolOutputMaxBytes = (input) => input.toolOutputMaxBytes !== undefined ? Effect90.succeed(input.toolOutputMaxBytes ?? undefined) : decodeOptionalNumber(metadataValue(input.agent.metadata, "tool_output_max_bytes"), "tool_output_max_bytes", (value) => value >= 0);
|
|
17897
|
-
var
|
|
17898
|
-
|
|
17899
|
-
|
|
17900
|
-
|
|
17901
|
-
|
|
17902
|
-
const reserveTokens = yield* decodeOptionalNumber(metadataValue(input.agent.metadata, "compaction_reserve_tokens"), "compaction_reserve_tokens", (value) => value >= 0);
|
|
17903
|
-
const keepRecentTokens = yield* decodeOptionalNumber(metadataValue(input.agent.metadata, "compaction_keep_recent_tokens"), "compaction_keep_recent_tokens", (value) => value >= 0);
|
|
17904
|
-
return {
|
|
17905
|
-
...contextWindow === undefined ? {} : { contextWindow },
|
|
17906
|
-
...reserveTokens === undefined ? {} : { reserveTokens },
|
|
17907
|
-
...keepRecentTokens === undefined ? {} : { keepRecentTokens }
|
|
17908
|
-
};
|
|
17909
|
-
});
|
|
17910
|
-
var effectiveCompactionOptions = (input) => input.compaction !== undefined ? Effect90.succeed(input.compaction ?? undefined) : compactionOptionsFromAgentMetadata(input);
|
|
17933
|
+
var compactionOptions = (agent) => agent.compaction_policy === undefined ? undefined : {
|
|
17934
|
+
contextWindow: agent.compaction_policy.context_window,
|
|
17935
|
+
reserveTokens: agent.compaction_policy.reserve_tokens,
|
|
17936
|
+
keepRecentTokens: agent.compaction_policy.keep_recent_tokens
|
|
17937
|
+
};
|
|
17911
17938
|
var layer59 = Layer79.effect(Service54, Effect90.gen(function* () {
|
|
17912
17939
|
const eventLog = yield* Service30;
|
|
17913
17940
|
const languageModels = yield* Service40;
|
|
@@ -17966,9 +17993,11 @@ var layer59 = Layer79.effect(Service54, Effect90.gen(function* () {
|
|
|
17966
17993
|
const registered = [...availableRegisteredTools(input.agent, yield* tools.registeredTools), ...allCoreTools];
|
|
17967
17994
|
const definitions2 = registered.map((tool2) => tool2.definition);
|
|
17968
17995
|
yield* validateToolInputSchemaDigests(input, definitions2);
|
|
17996
|
+
const toolCallDecodeMaxRetries = yield* toolCallDecodeMaxRetriesConfig.pipe(Effect90.mapError((error5) => loopError(error5, input.eventSequence + 1)));
|
|
17969
17997
|
yield* appendEvent(eventLog, inputPreparedEvent(input, definitions2), input.eventSequence + 1);
|
|
17970
17998
|
const toolOutputMaxBytes = yield* effectiveToolOutputMaxBytes(input);
|
|
17971
|
-
const
|
|
17999
|
+
const compactionPolicy = input.agent.compaction_policy;
|
|
18000
|
+
const activeCompactionOptions = compactionOptions(input.agent);
|
|
17972
18001
|
const runTokenizer = yield* Effect90.serviceOption(Tokenizer4.Tokenizer);
|
|
17973
18002
|
const activeTokenizer = Option27.isSome(runTokenizer) ? runTokenizer : tokenizer;
|
|
17974
18003
|
const allocator = yield* make14(input.eventSequence + 1);
|
|
@@ -18041,25 +18070,25 @@ var layer59 = Layer79.effect(Service54, Effect90.gen(function* () {
|
|
|
18041
18070
|
next_event_sequence: input.eventSequence + 1
|
|
18042
18071
|
}));
|
|
18043
18072
|
}
|
|
18044
|
-
if (
|
|
18073
|
+
if (activeCompactionOptions !== undefined && input.sessionId === undefined) {
|
|
18045
18074
|
return yield* Effect90.fail(new AgentLoopError2({
|
|
18046
18075
|
message: "Execution compaction requires session_id",
|
|
18047
18076
|
next_event_sequence: input.eventSequence + 1
|
|
18048
18077
|
}));
|
|
18049
18078
|
}
|
|
18050
|
-
if (
|
|
18079
|
+
if (activeCompactionOptions !== undefined && Option27.isNone(sessionRepository)) {
|
|
18051
18080
|
return yield* Effect90.fail(new AgentLoopError2({
|
|
18052
18081
|
message: "Execution compaction requires SessionRepository in context",
|
|
18053
18082
|
next_event_sequence: input.eventSequence + 1
|
|
18054
18083
|
}));
|
|
18055
18084
|
}
|
|
18056
|
-
if (
|
|
18085
|
+
if (activeCompactionOptions !== undefined && Option27.isNone(compactionRepository)) {
|
|
18057
18086
|
return yield* Effect90.fail(new AgentLoopError2({
|
|
18058
18087
|
message: "Execution compaction requires CompactionRepository in context",
|
|
18059
18088
|
next_event_sequence: input.eventSequence + 1
|
|
18060
18089
|
}));
|
|
18061
18090
|
}
|
|
18062
|
-
const batonCompaction =
|
|
18091
|
+
const batonCompaction = compactionPolicy === undefined ? undefined : { contextWindow: compactionPolicy.context_window };
|
|
18063
18092
|
const batonOptions = {
|
|
18064
18093
|
...options,
|
|
18065
18094
|
...toolOutputMaxBytes === undefined ? {} : { toolOutputMaxBytes },
|
|
@@ -18078,12 +18107,12 @@ var layer59 = Layer79.effect(Service54, Effect90.gen(function* () {
|
|
|
18078
18107
|
...allCoreTools.length === 0 ? {} : { extraTools: allCoreTools }
|
|
18079
18108
|
});
|
|
18080
18109
|
const activeBlobStore = toolOutputMaxBytes === undefined || Option27.isNone(blobStore) ? undefined : blobStore.value;
|
|
18081
|
-
const activeCompactionRepository =
|
|
18110
|
+
const activeCompactionRepository = activeCompactionOptions === undefined || Option27.isNone(compactionRepository) ? undefined : compactionRepository.value;
|
|
18082
18111
|
const toolOutputStore = toolOutputMaxBytes === undefined ? undefined : exports_tool_output.ToolOutputStore.of(make13(activeBlobStore));
|
|
18083
|
-
const compactionService =
|
|
18112
|
+
const compactionService = activeCompactionOptions === undefined ? undefined : exports_compaction.Compaction.of(make11({
|
|
18084
18113
|
executionId: input.executionId,
|
|
18085
18114
|
repository: activeCompactionRepository,
|
|
18086
|
-
options:
|
|
18115
|
+
options: activeCompactionOptions
|
|
18087
18116
|
}));
|
|
18088
18117
|
if (memory !== undefined && Option27.isNone(durableMemory)) {
|
|
18089
18118
|
return yield* Effect90.fail(new AgentLoopError2({
|
|
@@ -18091,6 +18120,16 @@ var layer59 = Layer79.effect(Service54, Effect90.gen(function* () {
|
|
|
18091
18120
|
next_event_sequence: input.eventSequence + 1
|
|
18092
18121
|
}));
|
|
18093
18122
|
}
|
|
18123
|
+
const tokenBudget = input.agent.token_budget;
|
|
18124
|
+
const enforceBudget = (state) => tokenBudget === undefined || state.tokensUsed < tokenBudget ? Effect90.void : Effect90.gen(function* () {
|
|
18125
|
+
const budgetSequence = yield* allocator.allocate(1);
|
|
18126
|
+
yield* appendEvent(eventLog, budgetExceededEvent(input, state.tokensUsed, tokenBudget, budgetSequence), budgetSequence + 1);
|
|
18127
|
+
return yield* Effect90.fail(new AgentLoopBudgetExceeded2({
|
|
18128
|
+
tokens_used: state.tokensUsed,
|
|
18129
|
+
token_budget: tokenBudget,
|
|
18130
|
+
next_event_sequence: budgetSequence + 1
|
|
18131
|
+
}));
|
|
18132
|
+
});
|
|
18094
18133
|
const foldEvent = (state, event) => Effect90.gen(function* () {
|
|
18095
18134
|
switch (event._tag) {
|
|
18096
18135
|
case "ModelPart": {
|
|
@@ -18107,6 +18146,18 @@ var layer59 = Layer79.effect(Service54, Effect90.gen(function* () {
|
|
|
18107
18146
|
yield* appendEvent(eventLog, reasoningDeltaEvent(input, part, deltaIndex), sequence + 1);
|
|
18108
18147
|
return state;
|
|
18109
18148
|
}
|
|
18149
|
+
if (part.type === "tool-params-start") {
|
|
18150
|
+
return { ...state, toolCallNames: { ...state.toolCallNames, [part.id]: part.name } };
|
|
18151
|
+
}
|
|
18152
|
+
if (part.type === "tool-params-delta") {
|
|
18153
|
+
const sequence = yield* allocator.allocate(1);
|
|
18154
|
+
const deltaIndex = state.toolCallDeltaIndexes[part.id] ?? 0;
|
|
18155
|
+
yield* appendEvent(eventLog, toolCallDeltaEvent(input, part, state.toolCallNames[part.id], sequence, deltaIndex), sequence + 1);
|
|
18156
|
+
return {
|
|
18157
|
+
...state,
|
|
18158
|
+
toolCallDeltaIndexes: { ...state.toolCallDeltaIndexes, [part.id]: deltaIndex + 1 }
|
|
18159
|
+
};
|
|
18160
|
+
}
|
|
18110
18161
|
if (part.type === "finish") {
|
|
18111
18162
|
const finish = part;
|
|
18112
18163
|
const sequence = yield* allocator.allocate(1);
|
|
@@ -18126,19 +18177,13 @@ var layer59 = Layer79.effect(Service54, Effect90.gen(function* () {
|
|
|
18126
18177
|
return state;
|
|
18127
18178
|
}
|
|
18128
18179
|
case "TurnStarted": {
|
|
18129
|
-
if (
|
|
18130
|
-
|
|
18131
|
-
yield* appendEvent(eventLog, budgetExceededEvent(input, state.tokensUsed, input.agent.token_budget, budgetSequence), budgetSequence + 1);
|
|
18132
|
-
return yield* Effect90.fail(new AgentLoopBudgetExceeded2({
|
|
18133
|
-
tokens_used: state.tokensUsed,
|
|
18134
|
-
token_budget: input.agent.token_budget,
|
|
18135
|
-
next_event_sequence: budgetSequence + 1
|
|
18136
|
-
}));
|
|
18137
|
-
}
|
|
18180
|
+
if (event.turn > 0)
|
|
18181
|
+
yield* enforceBudget(state);
|
|
18138
18182
|
return state;
|
|
18139
18183
|
}
|
|
18140
18184
|
case "TurnCompleted": {
|
|
18141
18185
|
yield* persistTranscript(chats, input, event.transcript);
|
|
18186
|
+
yield* enforceBudget(state);
|
|
18142
18187
|
return { ...state, transcript: event.transcript, turn: event.turn };
|
|
18143
18188
|
}
|
|
18144
18189
|
case "Completed": {
|
|
@@ -18149,9 +18194,16 @@ var layer59 = Layer79.effect(Service54, Effect90.gen(function* () {
|
|
|
18149
18194
|
}
|
|
18150
18195
|
});
|
|
18151
18196
|
const runFold = Effect90.gen(function* () {
|
|
18152
|
-
const base2 = yield* LanguageModel7.LanguageModel;
|
|
18197
|
+
const base2 = withToolCallDecodeResilience(yield* LanguageModel7.LanguageModel, definitions2.map((definition) => definition.name), toolCallDecodeMaxRetries);
|
|
18153
18198
|
const sessionStore = input.sessionId !== undefined && Option27.isSome(sessionRepository) ? yield* make8(input.sessionId, input.sessionEntryScope ?? input.executionId).pipe(Effect90.provideService(exports_session_repository.Service, sessionRepository.value)) : undefined;
|
|
18154
|
-
const folded = exports_agent.stream(agent, batonOptions).pipe(Stream12.runFoldEffect(() => ({
|
|
18199
|
+
const folded = exports_agent.stream(agent, batonOptions).pipe(Stream12.runFoldEffect(() => ({
|
|
18200
|
+
text: "",
|
|
18201
|
+
transcript: undefined,
|
|
18202
|
+
turn: undefined,
|
|
18203
|
+
tokensUsed: seededTokens,
|
|
18204
|
+
toolCallNames: {},
|
|
18205
|
+
toolCallDeltaIndexes: {}
|
|
18206
|
+
}), foldEvent), Effect90.provideService(LanguageModel7.LanguageModel, base2), Effect90.provideService(exports_model_resilience.ModelResilience, policy), Effect90.provide(executorLayer), Effect90.provide(handlerLayer), Effect90.provide(layer54), Effect90.provide(exports_model_middleware.identityLayer), Effect90.provide(instructionsLayer), Effect90.provide(permissionsLayer), Effect90.provide(steeringLayer));
|
|
18155
18207
|
const withToolOutput = toolOutputStore === undefined ? folded : folded.pipe(Effect90.provideService(exports_tool_output.ToolOutputStore, toolOutputStore));
|
|
18156
18208
|
const withCompaction = compactionService === undefined ? withToolOutput : withToolOutput.pipe(Effect90.provideService(exports_compaction.Compaction, compactionService));
|
|
18157
18209
|
const withSession = sessionStore === undefined ? withCompaction : withCompaction.pipe(Effect90.provideService(exports_session.SessionStore, sessionStore));
|
|
@@ -18198,6 +18250,7 @@ var overrideOf = (child) => {
|
|
|
18198
18250
|
return {
|
|
18199
18251
|
...override?.instructions === undefined ? {} : { instructions: override.instructions },
|
|
18200
18252
|
...override?.model === undefined ? {} : { model: override.model },
|
|
18253
|
+
...override?.compaction_policy === undefined ? {} : { compactionPolicy: override.compaction_policy },
|
|
18201
18254
|
...override?.tool_names === undefined ? {} : { toolNames: override.tool_names },
|
|
18202
18255
|
...override?.permissions === undefined ? {} : { permissions: override.permissions },
|
|
18203
18256
|
...override?.workspace_policy === undefined ? {} : { workspacePolicy: override.workspace_policy },
|
|
@@ -18529,7 +18582,6 @@ var layer65 = Layer84.effect(Service64, Effect95.gen(function* () {
|
|
|
18529
18582
|
entity_kind: input.kind,
|
|
18530
18583
|
entity_key: input.key,
|
|
18531
18584
|
entity_generation: instance.generation,
|
|
18532
|
-
compaction_enabled: input.metadata?.compaction_enabled ?? kind.metadata?.compaction_enabled ?? true,
|
|
18533
18585
|
...kind.state_enabled === undefined ? {} : { state_enabled: kind.state_enabled },
|
|
18534
18586
|
...kind.continue_as_new_after_turns === undefined ? {} : { continue_as_new_after_turns: kind.continue_as_new_after_turns }
|
|
18535
18587
|
};
|
|
@@ -19253,7 +19305,7 @@ var check = Effect99.fn("RunnerRuntime.check.call")(function* () {
|
|
|
19253
19305
|
return yield* service.check();
|
|
19254
19306
|
});
|
|
19255
19307
|
// ../runtime/src/workflow/definition-runtime.ts
|
|
19256
|
-
import { Cause as
|
|
19308
|
+
import { Cause as Cause5, Clock as Clock17, Context as Context82, Effect as Effect100, Exit as Exit3, Layer as Layer89, Option as Option30, Schema as Schema102 } from "effect";
|
|
19257
19309
|
|
|
19258
19310
|
class UnsupportedOperation extends Schema102.TaggedErrorClass()("UnsupportedWorkflowOperation", { operation_id: exports_ids_schema.WorkflowOperationId, kind: Schema102.String }) {
|
|
19259
19311
|
}
|
|
@@ -19575,7 +19627,7 @@ var run5 = Effect100.fn("WorkflowDefinitionRuntime.run")(function* (executionId)
|
|
|
19575
19627
|
});
|
|
19576
19628
|
const result = yield* Effect100.exit(execute(revision.definition.entry_operation_id));
|
|
19577
19629
|
if (Exit3.isFailure(result)) {
|
|
19578
|
-
const failure3 =
|
|
19630
|
+
const failure3 = Cause5.findErrorOption(result.cause);
|
|
19579
19631
|
if (Option30.isSome(failure3) && failure3.value instanceof WorkflowJoining)
|
|
19580
19632
|
return yield* result;
|
|
19581
19633
|
const currentRun = yield* repository.inspect(executionId);
|
|
@@ -79,6 +79,11 @@ export declare const LocalAgentTarget: Schema.Struct<{
|
|
|
79
79
|
readonly [x: string]: Schema.Json;
|
|
80
80
|
};
|
|
81
81
|
readonly instructions?: string;
|
|
82
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
83
|
+
readonly context_window: Schema.Number;
|
|
84
|
+
readonly reserve_tokens: Schema.Number;
|
|
85
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
86
|
+
}, "Encoded">;
|
|
82
87
|
readonly output_schema_ref?: string;
|
|
83
88
|
readonly skill_definition_ids?: readonly string[];
|
|
84
89
|
readonly permission_rules?: {
|
|
@@ -111,6 +116,11 @@ export declare const LocalAgentTarget: Schema.Struct<{
|
|
|
111
116
|
};
|
|
112
117
|
};
|
|
113
118
|
readonly instructions?: string;
|
|
119
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
120
|
+
readonly context_window: Schema.Number;
|
|
121
|
+
readonly reserve_tokens: Schema.Number;
|
|
122
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
123
|
+
}, "Encoded">;
|
|
114
124
|
readonly tool_names?: readonly string[];
|
|
115
125
|
readonly workspace_policy?: {
|
|
116
126
|
readonly mode: "share" | "fork";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Agent, Content, Execution, Ids, Shared, Tool } from "../../schema/index";
|
|
2
2
|
import { AgentChatRepository } from "@relayfx/store-sql/portable";
|
|
3
|
-
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
import { Cause, Context, Effect, Layer, Schema } from "effect";
|
|
4
4
|
import { Tool as AiTool } from "effect/unstable/ai";
|
|
5
5
|
import type { DispatchInput } from "../child/spawn-child-run-tool";
|
|
6
6
|
import { Service as EventLogService } from "../execution/event-log-service";
|
|
@@ -9,11 +9,10 @@ import { Service as ModelCallPolicyService } from "../model/model-call-policy";
|
|
|
9
9
|
import { Service as SchemaRegistryService } from "../schema-registry/schema-registry-service";
|
|
10
10
|
import { Service as ToolRuntimeService } from "../tool/tool-runtime-service";
|
|
11
11
|
import { Service as PromptAssemblerService } from "./prompt-assembler-service";
|
|
12
|
-
import type { Options } from "./relay-compaction";
|
|
13
12
|
declare const AgentLoopError_base: Schema.Class<AgentLoopError, Schema.TaggedStruct<"AgentLoopError", {
|
|
14
13
|
readonly message: Schema.String;
|
|
15
14
|
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
16
|
-
}>,
|
|
15
|
+
}>, Cause.YieldableError>;
|
|
17
16
|
export declare class AgentLoopError extends AgentLoopError_base {
|
|
18
17
|
}
|
|
19
18
|
declare const AgentLoopWaitRequested_base: Schema.Class<AgentLoopWaitRequested, Schema.TaggedStruct<"AgentLoopWaitRequested", {
|
|
@@ -29,14 +28,14 @@ declare const AgentLoopWaitRequested_base: Schema.Class<AgentLoopWaitRequested,
|
|
|
29
28
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
30
29
|
}>;
|
|
31
30
|
readonly next_event_sequence: Schema.Int;
|
|
32
|
-
}>,
|
|
31
|
+
}>, Cause.YieldableError>;
|
|
33
32
|
export declare class AgentLoopWaitRequested extends AgentLoopWaitRequested_base {
|
|
34
33
|
}
|
|
35
34
|
declare const AgentLoopBudgetExceeded_base: Schema.Class<AgentLoopBudgetExceeded, Schema.TaggedStruct<"AgentLoopBudgetExceeded", {
|
|
36
35
|
readonly tokens_used: Schema.Int;
|
|
37
36
|
readonly token_budget: Schema.Int;
|
|
38
37
|
readonly next_event_sequence: Schema.Int;
|
|
39
|
-
}>,
|
|
38
|
+
}>, Cause.YieldableError>;
|
|
40
39
|
export declare class AgentLoopBudgetExceeded extends AgentLoopBudgetExceeded_base {
|
|
41
40
|
}
|
|
42
41
|
export interface RunInput {
|
|
@@ -54,7 +53,6 @@ export interface RunInput {
|
|
|
54
53
|
readonly completedAt: number;
|
|
55
54
|
readonly steeringEnabled?: boolean;
|
|
56
55
|
readonly toolOutputMaxBytes?: number | null;
|
|
57
|
-
readonly compaction?: Options | null;
|
|
58
56
|
readonly sessionEntryScope?: string;
|
|
59
57
|
readonly dispatchChildRun?: (input: DispatchInput) => Effect.Effect<void, unknown, any>;
|
|
60
58
|
}
|
|
@@ -29,6 +29,7 @@ export declare class ChildRunModelMissing extends ChildRunModelMissing_base {
|
|
|
29
29
|
export interface AgentContext {
|
|
30
30
|
readonly instructions?: string;
|
|
31
31
|
readonly model?: Agent.ModelSelection;
|
|
32
|
+
readonly compactionPolicy?: Agent.CompactionPolicy;
|
|
32
33
|
readonly toolNames: ReadonlyArray<string>;
|
|
33
34
|
readonly permissions: ReadonlyArray<string>;
|
|
34
35
|
readonly outputSchemaRef?: string;
|
|
@@ -37,6 +38,7 @@ export interface AgentContext {
|
|
|
37
38
|
export interface ChildRunOverride {
|
|
38
39
|
readonly instructions?: string;
|
|
39
40
|
readonly model?: Agent.ModelSelection;
|
|
41
|
+
readonly compactionPolicy?: Agent.CompactionPolicy;
|
|
40
42
|
readonly toolNames?: ReadonlyArray<string>;
|
|
41
43
|
readonly permissions?: ReadonlyArray<string>;
|
|
42
44
|
readonly workspacePolicy?: Agent.ChildRunWorkspacePolicy;
|
|
@@ -74,6 +76,7 @@ export declare class Service extends Service_base {
|
|
|
74
76
|
export interface ResolvedChildContext {
|
|
75
77
|
readonly instructions?: string;
|
|
76
78
|
readonly model?: Agent.ModelSelection;
|
|
79
|
+
readonly compactionPolicy?: Agent.CompactionPolicy;
|
|
77
80
|
readonly toolNames: ReadonlyArray<string>;
|
|
78
81
|
readonly permissions: ReadonlyArray<string>;
|
|
79
82
|
readonly workspacePolicy?: Agent.ChildRunWorkspacePolicy;
|
|
@@ -16,6 +16,11 @@ export declare const Input: Schema.Struct<{
|
|
|
16
16
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
17
17
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
18
18
|
}>>;
|
|
19
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
20
|
+
readonly context_window: Schema.Number;
|
|
21
|
+
readonly reserve_tokens: Schema.Number;
|
|
22
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
23
|
+
}>>;
|
|
19
24
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
20
25
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
21
26
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
@@ -103,6 +103,11 @@ export declare const StartInput: Schema.Struct<{
|
|
|
103
103
|
readonly [x: string]: Schema.Json;
|
|
104
104
|
};
|
|
105
105
|
readonly instructions?: string;
|
|
106
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
107
|
+
readonly context_window: Schema.Number;
|
|
108
|
+
readonly reserve_tokens: Schema.Number;
|
|
109
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
110
|
+
}, "Encoded">;
|
|
106
111
|
readonly output_schema_ref?: string;
|
|
107
112
|
readonly skill_definition_ids?: readonly string[];
|
|
108
113
|
readonly permission_rules?: {
|
|
@@ -135,6 +140,11 @@ export declare const StartInput: Schema.Struct<{
|
|
|
135
140
|
};
|
|
136
141
|
};
|
|
137
142
|
readonly instructions?: string;
|
|
143
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
144
|
+
readonly context_window: Schema.Number;
|
|
145
|
+
readonly reserve_tokens: Schema.Number;
|
|
146
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
147
|
+
}, "Encoded">;
|
|
138
148
|
readonly tool_names?: readonly string[];
|
|
139
149
|
readonly workspace_policy?: {
|
|
140
150
|
readonly mode: "share" | "fork";
|
|
@@ -361,6 +371,11 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
|
|
|
361
371
|
readonly [x: string]: Schema.Json;
|
|
362
372
|
};
|
|
363
373
|
readonly instructions?: string;
|
|
374
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
375
|
+
readonly context_window: Schema.Number;
|
|
376
|
+
readonly reserve_tokens: Schema.Number;
|
|
377
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
378
|
+
}, "Encoded">;
|
|
364
379
|
readonly output_schema_ref?: string;
|
|
365
380
|
readonly skill_definition_ids?: readonly string[];
|
|
366
381
|
readonly permission_rules?: {
|
|
@@ -393,6 +408,11 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
|
|
|
393
408
|
};
|
|
394
409
|
};
|
|
395
410
|
readonly instructions?: string;
|
|
411
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
412
|
+
readonly context_window: Schema.Number;
|
|
413
|
+
readonly reserve_tokens: Schema.Number;
|
|
414
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
415
|
+
}, "Encoded">;
|
|
396
416
|
readonly tool_names?: readonly string[];
|
|
397
417
|
readonly workspace_policy?: {
|
|
398
418
|
readonly mode: "share" | "fork";
|
|
@@ -13,6 +13,13 @@ export declare const ModelSelection: Schema.Struct<{
|
|
|
13
13
|
}>;
|
|
14
14
|
export interface ModelSelection extends Schema.Schema.Type<typeof ModelSelection> {
|
|
15
15
|
}
|
|
16
|
+
export declare const CompactionPolicy: Schema.Struct<{
|
|
17
|
+
readonly context_window: Schema.Number;
|
|
18
|
+
readonly reserve_tokens: Schema.Number;
|
|
19
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
20
|
+
}>;
|
|
21
|
+
export interface CompactionPolicy extends Schema.Schema.Type<typeof CompactionPolicy> {
|
|
22
|
+
}
|
|
16
23
|
export declare const ChildRunWorkspacePolicy: Schema.Struct<{
|
|
17
24
|
readonly mode: Schema.Literals<readonly ["share", "fork"]>;
|
|
18
25
|
readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
|
|
@@ -28,6 +35,11 @@ export declare const ChildRunPreset: Schema.Struct<{
|
|
|
28
35
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
29
36
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
30
37
|
}>>;
|
|
38
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
39
|
+
readonly context_window: Schema.Number;
|
|
40
|
+
readonly reserve_tokens: Schema.Number;
|
|
41
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
42
|
+
}>>;
|
|
31
43
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
32
44
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
33
45
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -114,6 +126,11 @@ declare const DefinitionSchema: Schema.Struct<{
|
|
|
114
126
|
readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
|
|
115
127
|
}>>;
|
|
116
128
|
readonly turn_policy: Schema.optionalKey<Schema.Codec<TurnPolicySnapshot, TurnPolicySnapshot, never, never>>;
|
|
129
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
130
|
+
readonly context_window: Schema.Number;
|
|
131
|
+
readonly reserve_tokens: Schema.Number;
|
|
132
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
133
|
+
}>>;
|
|
117
134
|
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
118
135
|
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
119
136
|
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
@@ -126,6 +143,11 @@ declare const DefinitionSchema: Schema.Struct<{
|
|
|
126
143
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
127
144
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
128
145
|
}>>;
|
|
146
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
147
|
+
readonly context_window: Schema.Number;
|
|
148
|
+
readonly reserve_tokens: Schema.Number;
|
|
149
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
150
|
+
}>>;
|
|
129
151
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
130
152
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
131
153
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -160,6 +182,7 @@ export interface DefineInput {
|
|
|
160
182
|
readonly skill_definition_ids?: ReadonlyArray<SkillDefinitionId>;
|
|
161
183
|
readonly permission_rules?: PermissionRuleset;
|
|
162
184
|
readonly turn_policy?: TurnPolicySnapshot;
|
|
185
|
+
readonly compaction_policy?: CompactionPolicy;
|
|
163
186
|
readonly max_tool_turns?: number;
|
|
164
187
|
readonly max_wait_turns?: number;
|
|
165
188
|
readonly token_budget?: number;
|
|
@@ -199,6 +222,11 @@ export declare const DefinitionRecord: Schema.Struct<{
|
|
|
199
222
|
readonly [x: string]: Schema.Json;
|
|
200
223
|
};
|
|
201
224
|
readonly instructions?: string;
|
|
225
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
226
|
+
readonly context_window: Schema.Number;
|
|
227
|
+
readonly reserve_tokens: Schema.Number;
|
|
228
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
229
|
+
}, "Encoded">;
|
|
202
230
|
readonly output_schema_ref?: string;
|
|
203
231
|
readonly skill_definition_ids?: readonly string[];
|
|
204
232
|
readonly permission_rules?: {
|
|
@@ -231,6 +259,11 @@ export declare const DefinitionRecord: Schema.Struct<{
|
|
|
231
259
|
};
|
|
232
260
|
};
|
|
233
261
|
readonly instructions?: string;
|
|
262
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
263
|
+
readonly context_window: Schema.Number;
|
|
264
|
+
readonly reserve_tokens: Schema.Number;
|
|
265
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
266
|
+
}, "Encoded">;
|
|
234
267
|
readonly tool_names?: readonly string[];
|
|
235
268
|
readonly workspace_policy?: {
|
|
236
269
|
readonly mode: "share" | "fork";
|
|
@@ -280,6 +313,11 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
|
|
|
280
313
|
readonly [x: string]: Schema.Json;
|
|
281
314
|
};
|
|
282
315
|
readonly instructions?: string;
|
|
316
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
317
|
+
readonly context_window: Schema.Number;
|
|
318
|
+
readonly reserve_tokens: Schema.Number;
|
|
319
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
320
|
+
}, "Encoded">;
|
|
283
321
|
readonly output_schema_ref?: string;
|
|
284
322
|
readonly skill_definition_ids?: readonly string[];
|
|
285
323
|
readonly permission_rules?: {
|
|
@@ -312,6 +350,11 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
|
|
|
312
350
|
};
|
|
313
351
|
};
|
|
314
352
|
readonly instructions?: string;
|
|
353
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
354
|
+
readonly context_window: Schema.Number;
|
|
355
|
+
readonly reserve_tokens: Schema.Number;
|
|
356
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
357
|
+
}, "Encoded">;
|
|
315
358
|
readonly tool_names?: readonly string[];
|
|
316
359
|
readonly workspace_policy?: {
|
|
317
360
|
readonly mode: "share" | "fork";
|
|
@@ -359,6 +402,11 @@ export declare const RegisterDefinitionPayload: Schema.Struct<{
|
|
|
359
402
|
readonly [x: string]: Schema.Json;
|
|
360
403
|
};
|
|
361
404
|
readonly instructions?: string;
|
|
405
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
406
|
+
readonly context_window: Schema.Number;
|
|
407
|
+
readonly reserve_tokens: Schema.Number;
|
|
408
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
409
|
+
}, "Encoded">;
|
|
362
410
|
readonly output_schema_ref?: string;
|
|
363
411
|
readonly skill_definition_ids?: readonly string[];
|
|
364
412
|
readonly permission_rules?: {
|
|
@@ -391,6 +439,11 @@ export declare const RegisterDefinitionPayload: Schema.Struct<{
|
|
|
391
439
|
};
|
|
392
440
|
};
|
|
393
441
|
readonly instructions?: string;
|
|
442
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
443
|
+
readonly context_window: Schema.Number;
|
|
444
|
+
readonly reserve_tokens: Schema.Number;
|
|
445
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
446
|
+
}, "Encoded">;
|
|
394
447
|
readonly tool_names?: readonly string[];
|
|
395
448
|
readonly workspace_policy?: {
|
|
396
449
|
readonly mode: "share" | "fork";
|
|
@@ -438,6 +491,11 @@ export declare const DefinitionRegistered: Schema.Struct<{
|
|
|
438
491
|
readonly [x: string]: Schema.Json;
|
|
439
492
|
};
|
|
440
493
|
readonly instructions?: string;
|
|
494
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
495
|
+
readonly context_window: Schema.Number;
|
|
496
|
+
readonly reserve_tokens: Schema.Number;
|
|
497
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
498
|
+
}, "Encoded">;
|
|
441
499
|
readonly output_schema_ref?: string;
|
|
442
500
|
readonly skill_definition_ids?: readonly string[];
|
|
443
501
|
readonly permission_rules?: {
|
|
@@ -470,6 +528,11 @@ export declare const DefinitionRegistered: Schema.Struct<{
|
|
|
470
528
|
};
|
|
471
529
|
};
|
|
472
530
|
readonly instructions?: string;
|
|
531
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
532
|
+
readonly context_window: Schema.Number;
|
|
533
|
+
readonly reserve_tokens: Schema.Number;
|
|
534
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
535
|
+
}, "Encoded">;
|
|
473
536
|
readonly tool_names?: readonly string[];
|
|
474
537
|
readonly workspace_policy?: {
|
|
475
538
|
readonly mode: "share" | "fork";
|
|
@@ -521,6 +584,11 @@ export declare const DefinitionList: Schema.Struct<{
|
|
|
521
584
|
readonly [x: string]: Schema.Json;
|
|
522
585
|
};
|
|
523
586
|
readonly instructions?: string;
|
|
587
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
588
|
+
readonly context_window: Schema.Number;
|
|
589
|
+
readonly reserve_tokens: Schema.Number;
|
|
590
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
591
|
+
}, "Encoded">;
|
|
524
592
|
readonly output_schema_ref?: string;
|
|
525
593
|
readonly skill_definition_ids?: readonly string[];
|
|
526
594
|
readonly permission_rules?: {
|
|
@@ -553,6 +621,11 @@ export declare const DefinitionList: Schema.Struct<{
|
|
|
553
621
|
};
|
|
554
622
|
};
|
|
555
623
|
readonly instructions?: string;
|
|
624
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
625
|
+
readonly context_window: Schema.Number;
|
|
626
|
+
readonly reserve_tokens: Schema.Number;
|
|
627
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
628
|
+
}, "Encoded">;
|
|
556
629
|
readonly tool_names?: readonly string[];
|
|
557
630
|
readonly workspace_policy?: {
|
|
558
631
|
readonly mode: "share" | "fork";
|
|
@@ -604,6 +677,11 @@ export declare const DefinitionRevisionList: Schema.Struct<{
|
|
|
604
677
|
readonly [x: string]: Schema.Json;
|
|
605
678
|
};
|
|
606
679
|
readonly instructions?: string;
|
|
680
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
681
|
+
readonly context_window: Schema.Number;
|
|
682
|
+
readonly reserve_tokens: Schema.Number;
|
|
683
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
684
|
+
}, "Encoded">;
|
|
607
685
|
readonly output_schema_ref?: string;
|
|
608
686
|
readonly skill_definition_ids?: readonly string[];
|
|
609
687
|
readonly permission_rules?: {
|
|
@@ -636,6 +714,11 @@ export declare const DefinitionRevisionList: Schema.Struct<{
|
|
|
636
714
|
};
|
|
637
715
|
};
|
|
638
716
|
readonly instructions?: string;
|
|
717
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
718
|
+
readonly context_window: Schema.Number;
|
|
719
|
+
readonly reserve_tokens: Schema.Number;
|
|
720
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
721
|
+
}, "Encoded">;
|
|
639
722
|
readonly tool_names?: readonly string[];
|
|
640
723
|
readonly workspace_policy?: {
|
|
641
724
|
readonly mode: "share" | "fork";
|
|
@@ -19,6 +19,11 @@ export declare const FanOutChild: Schema.Struct<{
|
|
|
19
19
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
20
20
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
21
21
|
}>>;
|
|
22
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
23
|
+
readonly context_window: Schema.Number;
|
|
24
|
+
readonly reserve_tokens: Schema.Number;
|
|
25
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
26
|
+
}>>;
|
|
22
27
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
23
28
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
24
29
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -104,6 +109,11 @@ export declare const FanOutDefinition: Schema.Struct<{
|
|
|
104
109
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
105
110
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
106
111
|
}>>;
|
|
112
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
113
|
+
readonly context_window: Schema.Number;
|
|
114
|
+
readonly reserve_tokens: Schema.Number;
|
|
115
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
116
|
+
}>>;
|
|
107
117
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
108
118
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
109
119
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -322,6 +332,11 @@ export declare const FanOutState: Schema.Struct<{
|
|
|
322
332
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
323
333
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
324
334
|
}>>;
|
|
335
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
336
|
+
readonly context_window: Schema.Number;
|
|
337
|
+
readonly reserve_tokens: Schema.Number;
|
|
338
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
339
|
+
}>>;
|
|
325
340
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
326
341
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
327
342
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -42,6 +42,11 @@ export declare const Execution: Schema.Struct<{
|
|
|
42
42
|
readonly [x: string]: Schema.Json;
|
|
43
43
|
};
|
|
44
44
|
readonly instructions?: string;
|
|
45
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
46
|
+
readonly context_window: Schema.Number;
|
|
47
|
+
readonly reserve_tokens: Schema.Number;
|
|
48
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
49
|
+
}, "Encoded">;
|
|
45
50
|
readonly output_schema_ref?: string;
|
|
46
51
|
readonly skill_definition_ids?: readonly string[];
|
|
47
52
|
readonly permission_rules?: {
|
|
@@ -74,6 +79,11 @@ export declare const Execution: Schema.Struct<{
|
|
|
74
79
|
};
|
|
75
80
|
};
|
|
76
81
|
readonly instructions?: string;
|
|
82
|
+
readonly compaction_policy?: Schema.Struct.ReadonlySide<{
|
|
83
|
+
readonly context_window: Schema.Number;
|
|
84
|
+
readonly reserve_tokens: Schema.Number;
|
|
85
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
86
|
+
}, "Encoded">;
|
|
77
87
|
readonly tool_names?: readonly string[];
|
|
78
88
|
readonly workspace_policy?: {
|
|
79
89
|
readonly mode: "share" | "fork";
|
|
@@ -105,6 +115,11 @@ export declare const ChildRunContext: Schema.Struct<{
|
|
|
105
115
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
106
116
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
107
117
|
}>>;
|
|
118
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
119
|
+
readonly context_window: Schema.Number;
|
|
120
|
+
readonly reserve_tokens: Schema.Number;
|
|
121
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
122
|
+
}>>;
|
|
108
123
|
readonly tool_names: Schema.$Array<Schema.String>;
|
|
109
124
|
readonly permissions: Schema.$Array<Schema.String>;
|
|
110
125
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
@@ -121,6 +136,11 @@ export declare const ChildRunOverride: Schema.Struct<{
|
|
|
121
136
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
122
137
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
123
138
|
}>>;
|
|
139
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
140
|
+
readonly context_window: Schema.Number;
|
|
141
|
+
readonly reserve_tokens: Schema.Number;
|
|
142
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
143
|
+
}>>;
|
|
124
144
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
125
145
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
126
146
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -141,6 +161,11 @@ export declare const ChildRunPreset: Schema.Struct<{
|
|
|
141
161
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
142
162
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
143
163
|
}>>;
|
|
164
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
165
|
+
readonly context_window: Schema.Number;
|
|
166
|
+
readonly reserve_tokens: Schema.Number;
|
|
167
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
168
|
+
}>>;
|
|
144
169
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
145
170
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
146
171
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -171,6 +196,11 @@ export declare const SpawnChildRunInput: Schema.Struct<{
|
|
|
171
196
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
172
197
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
173
198
|
}>>;
|
|
199
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
200
|
+
readonly context_window: Schema.Number;
|
|
201
|
+
readonly reserve_tokens: Schema.Number;
|
|
202
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
203
|
+
}>>;
|
|
174
204
|
readonly tool_names: Schema.$Array<Schema.String>;
|
|
175
205
|
readonly permissions: Schema.$Array<Schema.String>;
|
|
176
206
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
@@ -185,6 +215,11 @@ export declare const SpawnChildRunInput: Schema.Struct<{
|
|
|
185
215
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
186
216
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
187
217
|
}>>;
|
|
218
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
219
|
+
readonly context_window: Schema.Number;
|
|
220
|
+
readonly reserve_tokens: Schema.Number;
|
|
221
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
222
|
+
}>>;
|
|
188
223
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
189
224
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
190
225
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -203,6 +238,11 @@ export declare const SpawnChildRunInput: Schema.Struct<{
|
|
|
203
238
|
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
204
239
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
205
240
|
}>>;
|
|
241
|
+
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
242
|
+
readonly context_window: Schema.Number;
|
|
243
|
+
readonly reserve_tokens: Schema.Number;
|
|
244
|
+
readonly keep_recent_tokens: Schema.Number;
|
|
245
|
+
}>>;
|
|
206
246
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
207
247
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
208
248
|
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
@@ -276,7 +316,7 @@ export declare const ChildRunAccepted: Schema.Struct<{
|
|
|
276
316
|
}>;
|
|
277
317
|
export interface ChildRunAccepted extends Schema.Schema.Type<typeof ChildRunAccepted> {
|
|
278
318
|
}
|
|
279
|
-
export declare const ExecutionEventType: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
319
|
+
export declare const ExecutionEventType: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
280
320
|
export type ExecutionEventType = typeof ExecutionEventType.Type;
|
|
281
321
|
export declare const ExecutionEvent: Schema.Struct<{
|
|
282
322
|
readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
|
|
@@ -288,7 +328,7 @@ export declare const ExecutionEvent: Schema.Struct<{
|
|
|
288
328
|
readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
|
|
289
329
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
|
|
290
330
|
}>;
|
|
291
|
-
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
331
|
+
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
292
332
|
readonly sequence: Schema.Int;
|
|
293
333
|
readonly cursor: Schema.String;
|
|
294
334
|
readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@relayfx/test",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.12",
|
|
5
5
|
"description": "Experimental deterministic test kit for Relay applications",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"typecheck": "bun tsc --noEmit"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@relayfx/sdk": "0.2.
|
|
39
|
+
"@relayfx/sdk": "0.2.12",
|
|
40
40
|
"effect": "4.0.0-beta.93"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|