@relayfx/sdk 0.2.11 → 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/ai.js +2 -2
- package/dist/{index-jg4xh3fx.js → index-236a3f4t.js} +12 -6
- package/dist/{index-fhqr1n44.js → index-33d4k6kk.js} +152 -100
- package/dist/{index-tpwr0wmj.js → index-aph699jp.js} +7 -7
- package/dist/index.js +3 -3
- package/dist/sqlite.js +2 -2
- package/dist/types/relay/client.d.ts +4 -2
- package/dist/types/relay/operation.d.ts +33 -3
- 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 +3 -3
package/dist/ai.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./index-
|
|
2
|
+
import"./index-aph699jp.js";
|
|
3
3
|
import {
|
|
4
4
|
AiError,
|
|
5
5
|
Chat,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
exports_tool_executor,
|
|
35
35
|
exports_tool_output,
|
|
36
36
|
exports_turn_policy
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-33d4k6kk.js";
|
|
38
38
|
|
|
39
39
|
// src/ai.ts
|
|
40
40
|
var relayAiPackage = "@relayfx/sdk/ai";
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
exports_wait_service,
|
|
49
49
|
exports_wait_signal,
|
|
50
50
|
exports_workflow_definition_repository
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-33d4k6kk.js";
|
|
52
52
|
|
|
53
53
|
// src/operation.ts
|
|
54
54
|
var exports_operation = {};
|
|
@@ -416,6 +416,7 @@ var SpawnChildRunInput = Schema.Struct({
|
|
|
416
416
|
preset_name: Schema.optionalKey(exports_shared_schema.NonEmptyString),
|
|
417
417
|
instructions: Schema.optionalKey(Schema.String),
|
|
418
418
|
model: Schema.optionalKey(exports_agent_schema.ModelSelection),
|
|
419
|
+
compaction_policy: Schema.optionalKey(exports_agent_schema.CompactionPolicy),
|
|
419
420
|
tool_names: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
420
421
|
permissions: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
421
422
|
workspace_policy: Schema.optionalKey(exports_agent_schema.ChildRunWorkspacePolicy),
|
|
@@ -1042,7 +1043,7 @@ var startExecutionByAgentDefinitionPayload = (input, definition) => ({
|
|
|
1042
1043
|
started_at: input.started_at,
|
|
1043
1044
|
completed_at: input.completed_at,
|
|
1044
1045
|
agent_id: input.agent_id,
|
|
1045
|
-
agent_revision: definition.
|
|
1046
|
+
agent_revision: definition.revision,
|
|
1046
1047
|
agent_snapshot: definition.definition,
|
|
1047
1048
|
...definition.tool_input_schema_digests === undefined ? {} : { agent_tool_input_schema_digests: definition.tool_input_schema_digests },
|
|
1048
1049
|
...input.wait_id === undefined ? {} : { wait_id: input.wait_id },
|
|
@@ -1146,6 +1147,7 @@ var registerAgentPayload = Effect.fn("Client.registerAgentPayload")(function* (i
|
|
|
1146
1147
|
permissions: input.permissions ?? [],
|
|
1147
1148
|
...input.skill_definition_ids === undefined ? {} : { skill_definition_ids: input.skill_definition_ids },
|
|
1148
1149
|
...input.permission_rules === undefined ? {} : { permission_rules: input.permission_rules },
|
|
1150
|
+
...input.compaction_policy === undefined ? {} : { compaction_policy: input.compaction_policy },
|
|
1149
1151
|
...turnPolicy,
|
|
1150
1152
|
...input.max_wait_turns === undefined ? {} : { max_wait_turns: input.max_wait_turns },
|
|
1151
1153
|
...input.token_budget === undefined ? {} : { token_budget: input.token_budget },
|
|
@@ -1155,7 +1157,6 @@ var registerAgentPayload = Effect.fn("Client.registerAgentPayload")(function* (i
|
|
|
1155
1157
|
...metadata === undefined ? {} : { metadata }
|
|
1156
1158
|
});
|
|
1157
1159
|
});
|
|
1158
|
-
var agentDefinitionNotFound = (id) => new ClientError({ message: `Agent not found: ${id}` });
|
|
1159
1160
|
var wakeMetadata = (input) => ({
|
|
1160
1161
|
...input.metadata,
|
|
1161
1162
|
...input.from === undefined ? {} : { from: input.from },
|
|
@@ -1331,11 +1332,13 @@ var wakeRuntime = Effect.fn("Client.wakeRuntime")(function* (waits, eventLog, ex
|
|
|
1331
1332
|
};
|
|
1332
1333
|
});
|
|
1333
1334
|
var childJoinWaitId = (childExecutionId) => exports_ids_schema.WaitId.make(`wait:child:${childExecutionId}`);
|
|
1335
|
+
var childSessionId = (childExecutionId) => exports_ids_schema.SessionId.make(`session:child:${childExecutionId}`);
|
|
1334
1336
|
var childSpawnFingerprintKey = "relay_child_spawn_fingerprint";
|
|
1335
1337
|
var childExecutionIdForSpawn = (input) => input.child_execution_id ?? exports_ids_schema.ChildExecutionId.make(`${input.execution_id}:child:${input.address_id}`);
|
|
1336
1338
|
var parentContextFromDefinition = (definition, fingerprint) => ({
|
|
1337
1339
|
...definition.instructions === undefined ? {} : { instructions: definition.instructions },
|
|
1338
1340
|
model: definition.model,
|
|
1341
|
+
...definition.compaction_policy === undefined ? {} : { compaction_policy: definition.compaction_policy },
|
|
1339
1342
|
tool_names: definition.tool_names,
|
|
1340
1343
|
permissions: definition.permissions.map((permission) => permission.name),
|
|
1341
1344
|
...definition.output_schema_ref === undefined ? {} : { output_schema_ref: definition.output_schema_ref },
|
|
@@ -1350,6 +1353,7 @@ var internalSpawnChildRunInput = (input, pin, createdAt) => ({
|
|
|
1350
1353
|
...input.preset_name === undefined ? {} : { preset_name: input.preset_name },
|
|
1351
1354
|
...input.instructions === undefined ? {} : { instructions: input.instructions },
|
|
1352
1355
|
...input.model === undefined ? {} : { model: input.model },
|
|
1356
|
+
...input.compaction_policy === undefined ? {} : { compaction_policy: input.compaction_policy },
|
|
1353
1357
|
...input.tool_names === undefined ? {} : { tool_names: input.tool_names },
|
|
1354
1358
|
...input.permissions === undefined ? {} : { permissions: input.permissions },
|
|
1355
1359
|
...input.workspace_policy === undefined ? {} : { workspace_policy: input.workspace_policy },
|
|
@@ -1429,6 +1433,7 @@ var parentDefinitionPin = Effect.fn("Client.parentDefinitionPin")(function* (exe
|
|
|
1429
1433
|
var childStartInput = (input, accepted, pin, definition, createdAt, parentWaitId) => ({
|
|
1430
1434
|
execution_id: exports_ids_schema.ExecutionId.make(accepted.child_execution_id),
|
|
1431
1435
|
root_address_id: input.address_id,
|
|
1436
|
+
session_id: childSessionId(accepted.child_execution_id),
|
|
1432
1437
|
input: input.input === undefined ? [] : [...input.input],
|
|
1433
1438
|
event_sequence: 0,
|
|
1434
1439
|
started_at: createdAt,
|
|
@@ -1689,9 +1694,10 @@ var layerFromRuntime = Layer.effect(Service, Effect.gen(function* () {
|
|
|
1689
1694
|
yield* rejectReserved(input.execution_id, "execution:entity:");
|
|
1690
1695
|
if (input.session_id !== undefined)
|
|
1691
1696
|
yield* rejectReserved(input.session_id, "session:entity:");
|
|
1692
|
-
const definition = yield* agentRegistry.
|
|
1693
|
-
if (definition === undefined)
|
|
1694
|
-
return yield* Effect.fail(
|
|
1697
|
+
const definition = yield* agentRegistry.getRevision({ id: input.agent_id, revision: input.agent_revision }).pipe(Effect.mapError(toClientError));
|
|
1698
|
+
if (definition === undefined) {
|
|
1699
|
+
return yield* Effect.fail(new ClientError({ message: `Agent revision not found: ${input.agent_id}@${input.agent_revision}` }));
|
|
1700
|
+
}
|
|
1695
1701
|
const payload = startExecutionByAgentDefinitionPayload(input, definition);
|
|
1696
1702
|
const client = makeExecutionClient(payload.execution_id);
|
|
1697
1703
|
return yield* client.start(payload).pipe(Effect.mapError(toClientError));
|