@relayfx/test 0.2.4 → 0.2.6
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 +16 -7
- package/dist/types/schema/agent-schema.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -415,8 +415,8 @@ var makeTurnPolicySnapshotTree = () => {
|
|
|
415
415
|
return tree;
|
|
416
416
|
};
|
|
417
417
|
var TurnPolicySnapshot = makeTurnPolicySnapshotTree().check(turnPolicySnapshotNodeCount).annotate({ identifier: "Relay.Agent.TurnPolicySnapshot" });
|
|
418
|
-
var defaultMaxToolTurns =
|
|
419
|
-
var defaultMaxWaitTurns =
|
|
418
|
+
var defaultMaxToolTurns = Number.POSITIVE_INFINITY;
|
|
419
|
+
var defaultMaxWaitTurns = Number.POSITIVE_INFINITY;
|
|
420
420
|
var DefinitionSchema = Schema5.Struct({
|
|
421
421
|
name: NonEmptyString,
|
|
422
422
|
instructions: Schema5.optionalKey(Schema5.String),
|
|
@@ -13634,11 +13634,11 @@ var TransferInput = Schema67.Struct({
|
|
|
13634
13634
|
var ModelInput = Schema67.Struct({
|
|
13635
13635
|
preset_name: Schema67.optionalKey(Schema67.String),
|
|
13636
13636
|
instructions: Schema67.optionalKey(Schema67.String),
|
|
13637
|
-
model: Schema67.optionalKey(Schema67.Struct({
|
|
13637
|
+
model: Schema67.optionalKey(Schema67.NullOr(Schema67.Struct({
|
|
13638
13638
|
provider: Schema67.String,
|
|
13639
13639
|
model: Schema67.String,
|
|
13640
13640
|
registration_key: Schema67.optionalKey(Schema67.String)
|
|
13641
|
-
})),
|
|
13641
|
+
}))),
|
|
13642
13642
|
tool_names: Schema67.optionalKey(Schema67.Array(Schema67.String)),
|
|
13643
13643
|
permissions: Schema67.optionalKey(Schema67.Array(Schema67.String)),
|
|
13644
13644
|
output_schema_ref: Schema67.optionalKey(Schema67.String),
|
|
@@ -13648,6 +13648,12 @@ var ModelInput = Schema67.Struct({
|
|
|
13648
13648
|
var ModelTransferInput = Schema67.Struct({
|
|
13649
13649
|
input: Schema67.optionalKey(Schema67.Array(Schema67.Struct({ type: Schema67.Literal("text"), text: Schema67.String })))
|
|
13650
13650
|
});
|
|
13651
|
+
var normalizeModelInput = (input) => {
|
|
13652
|
+
if (input.model !== null)
|
|
13653
|
+
return input;
|
|
13654
|
+
const { model: _, ...normalized } = input;
|
|
13655
|
+
return normalized;
|
|
13656
|
+
};
|
|
13651
13657
|
var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
|
|
13652
13658
|
var parentContext = (agent) => ({
|
|
13653
13659
|
...agent.instructions === undefined ? {} : { instructions: agent.instructions },
|
|
@@ -13816,7 +13822,7 @@ var registeredTool = (config) => tool(toolName, {
|
|
|
13816
13822
|
permissions: [{ name: permissionName, value: true }],
|
|
13817
13823
|
requiredPermissions: [permissionName],
|
|
13818
13824
|
metadata: { relay_core_tool: true },
|
|
13819
|
-
run: (input, context) => Schema67.decodeUnknownEffect(Input)(input).pipe(Effect59.flatMap((decoded) => run2(config, toolName, decoded, context, true)))
|
|
13825
|
+
run: (input, context) => Schema67.decodeUnknownEffect(Input)(normalizeModelInput(input)).pipe(Effect59.flatMap((decoded) => run2(config, toolName, decoded, context, true)))
|
|
13820
13826
|
});
|
|
13821
13827
|
var transferToolName2 = (name) => `transfer_to_${name.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g, "_").replaceAll(/^_+|_+$/g, "")}`;
|
|
13822
13828
|
var transferTools = (config) => (config.agent.handoff_targets ?? []).map((target) => {
|
|
@@ -17605,8 +17611,11 @@ var turnPolicyFromSnapshot = (snapshot2) => {
|
|
|
17605
17611
|
}
|
|
17606
17612
|
};
|
|
17607
17613
|
var turnPolicyFromDefinition = (agent) => {
|
|
17608
|
-
const
|
|
17609
|
-
|
|
17614
|
+
const policy = agent.turn_policy === undefined ? undefined : turnPolicyFromSnapshot(agent.turn_policy);
|
|
17615
|
+
if (agent.max_tool_turns === undefined)
|
|
17616
|
+
return policy ?? exports_turn_policy.recurs(Number.POSITIVE_INFINITY);
|
|
17617
|
+
const cap = exports_turn_policy.recurs(agent.max_tool_turns);
|
|
17618
|
+
return policy === undefined ? cap : exports_turn_policy.both(cap, policy);
|
|
17610
17619
|
};
|
|
17611
17620
|
var availableRegisteredTools = (agent, registered) => {
|
|
17612
17621
|
const names = toolNames(agent);
|
|
@@ -84,8 +84,8 @@ export type TurnPolicySnapshot = RecursTurnPolicySnapshot | UntilToolCallTurnPol
|
|
|
84
84
|
export declare const maxTurnPolicySnapshotDepth = 16;
|
|
85
85
|
export declare const maxTurnPolicySnapshotNodes = 64;
|
|
86
86
|
export declare const TurnPolicySnapshot: Schema.Codec<TurnPolicySnapshot>;
|
|
87
|
-
export declare const defaultMaxToolTurns
|
|
88
|
-
export declare const defaultMaxWaitTurns
|
|
87
|
+
export declare const defaultMaxToolTurns: number;
|
|
88
|
+
export declare const defaultMaxWaitTurns: number;
|
|
89
89
|
declare const DefinitionSchema: Schema.Struct<{
|
|
90
90
|
readonly name: Schema.String;
|
|
91
91
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
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.6",
|
|
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.6",
|
|
40
40
|
"effect": "4.0.0-beta.93"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|