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.
- package/docs/openapi.json +101 -1
- package/package.json +2 -2
- package/public/index.html +39 -32
- package/public/sw.js +51 -16
- package/runner/src/adapter.ts +1 -4
- package/runner/src/config.ts +3 -5
- package/scripts/orchestrator-spawn-smoke.ts +2 -1
- package/src/automations.ts +20 -59
- package/src/bus.ts +3 -18
- package/src/cli.ts +244 -7
- package/src/command-events.ts +26 -0
- package/src/config-store.ts +12 -47
- package/src/connectors.ts +1 -4
- package/src/contracts.ts +2 -8
- package/src/daemon.ts +1 -4
- package/src/db.ts +23 -17
- package/src/dev.ts +1 -4
- package/src/http-body.ts +49 -0
- package/src/index.ts +101 -5
- package/src/lifecycle-manager.ts +11 -24
- package/src/maintenance.ts +28 -22
- package/src/managed-policy.ts +9 -28
- package/src/mcp.ts +35 -110
- package/src/memory-broker-smoke.ts +4 -2
- package/src/memory-command-broker.ts +2 -5
- package/src/memory-http-broker.ts +2 -5
- package/src/memory-service.ts +1 -4
- package/src/memory-sqlite-broker.ts +1 -8
- package/src/orchestrator-lookup.ts +29 -0
- package/src/provider-catalog-store.ts +3 -11
- package/src/recipe-loader.ts +1 -4
- package/src/recipe-validator.ts +2 -5
- package/src/routes.ts +417 -309
- package/src/security.ts +3 -7
- package/src/setup.ts +1 -4
- package/src/spawn-command.ts +151 -0
- package/src/sse.ts +1 -4
- package/src/steward.ts +17 -21
- package/src/upgrade.ts +40 -13
- package/src/utils.ts +38 -0
- package/src/validation.ts +80 -0
- package/src/workspace-claim.ts +29 -0
- package/src/workspace-merge.ts +21 -9
package/src/recipe-loader.ts
CHANGED
|
@@ -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
|
-
}
|
package/src/recipe-validator.ts
CHANGED
|
@@ -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(
|
|
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
|
-
}
|