@xandreed/sdk 0.15.0 → 0.15.1

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @xandreed/sdk
2
2
 
3
- Efferent composable agent framework, 0.15.0. Node 24 or Bun.
3
+ Efferent composable agent framework, 0.15.1. Node 24 or Bun.
4
4
 
5
5
  Documentation: https://github.com/xandreeddev/efferent
@@ -42,7 +42,7 @@ export interface AgentConfig {
42
42
  readonly workspace?: string;
43
43
  /**
44
44
  * Defaults for every run; a turn's policy overrides them. Its loop
45
- * protection (`degenerate`, `malformedLimit`) is decoded here
45
+ * protection (`degenerate`, `malformedLimit`, `invalidCalls`) is decoded here
46
46
  * (`config.limits`), and a run's merged limits again (`turn.limits`).
47
47
  */
48
48
  readonly limits?: Partial<LoopLimits>;
@@ -74,7 +74,7 @@ const failure = (code, message) => new HarnessError({ code, message }), missing
74
74
  }, []), makeAgent = (config) => Effect.gen(function* () {
75
75
  if (config.budgetTokens !== void 0 && !isBudgetTokens(config.budgetTokens))
76
76
  return yield* Effect.fail(failure("config.budget", `budgetTokens must be an integer of at least 1, not ${config.budgetTokens}`));
77
- yield* Schema.decodeUnknownEffect(LoopProtection)(config.limits ?? {}).pipe(Effect.mapError((cause) => new HarnessError({ code: "config.limits", message: "the agent's limits carry a degenerate policy or malformedLimit that does not decode", cause })));
77
+ yield* Schema.decodeUnknownEffect(LoopProtection)(config.limits ?? {}).pipe(Effect.mapError((cause) => new HarnessError({ code: "config.limits", message: "the agent's limits carry a degenerate policy, malformedLimit or invalidCalls that does not decode", cause })));
78
78
  const parent = yield* Effect.scope, entries = config.plugins.map(entryOf), hosted = config.capabilities ?? [], host = hostCapabilities(hosted), withHost = hosted.length > 0, plugins = [...withHost ? [host] : [], ...entries.map((entry) => entry.plugin)], harness = {
79
79
  version: 1,
80
80
  plugins: [
@@ -55,7 +55,7 @@ export const schemaTokens = (tools, active) => active.reduce((sum, name) => {
55
55
  return tool === void 0 ? sum : sum + estimateTokens(`${tool.description ?? ""}${canonicalJson(toolParametersSchema(tool))}`);
56
56
  }, 0), cacheKeyOf = (prefix, conversation) => Option.map(Option.filter(Option.some(prefix), (value) => value.length > 0), (value) => `${value}:${conversation}`), stepRequestOf = Effect.fnUntraced(function* (policy, options = {}) {
57
57
  const runServices = Context.omit(CurrentToolResultReceipt)(replayableContext(yield* Effect.context())), memory = yield* TurnMemory, prompt = yield* TurnPrompt, events = yield* TurnEvents, tasks = yield* TurnTasks, tools = yield* (yield* TurnToolbox).tools, session = memory.session, run = yield* memory.startRun, inRun = (effect, step = Option.none()) => effect.pipe(Effect.provideService(CurrentAgentRun, Option.some(run)), Effect.provideService(CurrentAgentStep, step), Effect.provide(runServices)), defaultModel = Context.getOption(runServices, LanguageModel.LanguageModel), limits = { ...defaultLimits, ...options.limits, ...policy.limits };
58
- yield* Schema.decodeUnknownEffect(LoopProtection)(limits).pipe(Effect.mapError((cause) => new HarnessError({ code: "turn.limits", message: "the run's limits carry a degenerate policy or malformedLimit that does not decode", cause })));
58
+ yield* Schema.decodeUnknownEffect(LoopProtection)(limits).pipe(Effect.mapError((cause) => new HarnessError({ code: "turn.limits", message: "the run's limits carry a degenerate policy, malformedLimit or invalidCalls that does not decode", cause })));
59
59
  const budget = policy.budgetTokens ?? options.budgetTokens ?? defaultBudgetTokens;
60
60
  if (!isBudgetTokens(budget))
61
61
  return yield* Effect.fail(failure("turn.budget", `budgetTokens must be an integer of at least 1, not ${budget}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xandreed/sdk",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "engines": {
5
5
  "node": ">=24",
6
6
  "bun": ">=1.3.0"
@@ -18,12 +18,12 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@xandreed/runtime": "^0.15.0"
21
+ "@xandreed/runtime": "^0.15.1"
22
22
  },
23
23
  "private": false,
24
24
  "types": "./dist/index.d.ts",
25
25
  "peerDependencies": {
26
- "@xandreed/core": "^0.15.0",
26
+ "@xandreed/core": "^0.15.1",
27
27
  "effect": "^4.0.7"
28
28
  },
29
29
  "files": [