agent-relay-server 0.17.0 → 0.19.0

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.
@@ -2,6 +2,7 @@ import { existsSync, readFileSync, readdirSync } from "node:fs";
2
2
  import { basename, join, resolve } from "node:path";
3
3
  import { validateRecipe } from "./recipe-validator";
4
4
  import type { Recipe } from "./types";
5
+ import { isRecord } from "agent-relay-sdk";
5
6
 
6
7
  interface LoadedRecipe {
7
8
  name: string;
@@ -113,7 +114,3 @@ function parseScalar(value: string): unknown {
113
114
  if (/^\d+$/.test(trimmed)) return Number(trimmed);
114
115
  return trimmed.replace(/^["']|["']$/g, "");
115
116
  }
116
-
117
- function isRecord(value: unknown): value is Record<string, unknown> {
118
- return typeof value === "object" && value !== null && !Array.isArray(value);
119
- }
@@ -1,5 +1,6 @@
1
1
  import type { MemoryType, Recipe, RecipeAgent, RecipeMemoryPolicy } from "./types";
2
2
  import { resolveProviderSelection, type ProviderEffort } from "agent-relay-sdk/provider-catalog";
3
+ import { errMessage, isRecord } from "agent-relay-sdk";
3
4
 
4
5
  class RecipeValidationError extends Error {}
5
6
 
@@ -51,7 +52,7 @@ function validateAgent(value: unknown): RecipeAgent {
51
52
  try {
52
53
  resolveProviderSelection({ provider, model, effort });
53
54
  } catch (error) {
54
- throw new RecipeValidationError(error instanceof Error ? error.message : String(error));
55
+ throw new RecipeValidationError(errMessage(error));
55
56
  }
56
57
  return {
57
58
  role: requiredString(value.role, "agent.role"),
@@ -131,7 +132,3 @@ function optionalPositiveInteger(value: unknown, field: string): number | undefi
131
132
  if (typeof value !== "number" || !Number.isSafeInteger(value) || value <= 0) throw new RecipeValidationError(`${field} must be a positive integer`);
132
133
  return value;
133
134
  }
134
-
135
- function isRecord(value: unknown): value is Record<string, unknown> {
136
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
137
- }