@lobu/runtime-device 24.3.0 → 24.5.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/dist/component.json +1 -1
- package/dist/dependencies.bun.lock +66 -68
- package/dist/verify.mjs +1 -1
- package/npm-shrinkwrap.json +165 -181
- package/package.json +2 -2
- package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +23 -5
- package/vendor/cli/dist/bundled-skills/lobu-connect/SKILL.md +6 -0
- package/vendor/cli/dist/commands/_lib/apply/apply-cmd.js +20 -13
- package/vendor/cli/dist/commands/_lib/apply/client.d.ts +48 -100
- package/vendor/cli/dist/commands/_lib/apply/client.js +76 -27
- package/vendor/cli/dist/commands/_lib/apply/deployment.js +1 -1
- package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +7 -11
- package/vendor/cli/dist/commands/_lib/apply/desired-state.js +9 -40
- package/vendor/cli/dist/commands/_lib/apply/diff.d.ts +4 -4
- package/vendor/cli/dist/commands/_lib/apply/diff.js +37 -33
- package/vendor/cli/dist/commands/_lib/apply/map-config.d.ts +1 -1
- package/vendor/cli/dist/commands/_lib/apply/map-config.js +79 -92
- package/vendor/cli/dist/commands/_lib/apply/shared.d.ts +3 -6
- package/vendor/cli/dist/commands/_lib/apply/shared.js +8 -19
- package/vendor/cli/dist/commands/dev.js +21 -7
- package/vendor/cli/dist/commands/doctor.js +1 -8
- package/vendor/cli/dist/commands/init.js +4 -5
- package/vendor/cli/dist/config/define.d.ts +27 -28
- package/vendor/cli/dist/config/define.js +4 -5
- package/vendor/cli/dist/connectors/postgres.ts +77 -48
- package/vendor/cli/dist/internal/api-client.d.ts +2 -0
- package/vendor/cli/dist/internal/api-client.js +6 -1
- package/vendor/cli/dist/internal/node-binary.d.ts +22 -0
- package/vendor/cli/dist/internal/node-binary.js +73 -0
- package/vendor/cli/dist/internal/node-version.d.ts +7 -12
- package/vendor/cli/dist/internal/node-version.js +16 -20
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/dist/templates/AGENTS.md.tmpl +2 -2
- package/vendor/cli/package.json +2 -2
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +8 -2
- package/vendor/connector-sdk/dist/reaction-sdk.d.ts +5 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/connector-worker/dist/daemon/acp-adapters/claude.js +1 -1
- package/vendor/connector-worker/dist/daemon/agent-turn.js +69 -3
- package/vendor/connector-worker/dist/daemon/client.d.ts +25 -8
- package/vendor/connector-worker/dist/daemon/client.js +32 -4
- package/vendor/connector-worker/dist/daemon/log.js +2 -1
- package/vendor/connector-worker/dist/daemon/mac-device-daemon.js +7 -1
- package/vendor/connector-worker/dist/daemon/poll-loop.d.ts +17 -0
- package/vendor/connector-worker/dist/daemon/poll-loop.js +101 -13
- package/vendor/connector-worker/dist/daemon/resource-admission.d.ts +19 -0
- package/vendor/connector-worker/dist/daemon/resource-admission.js +59 -0
- package/vendor/connector-worker/dist/daemon/resources.d.ts +20 -0
- package/vendor/connector-worker/dist/daemon/resources.js +163 -0
- package/vendor/connector-worker/dist/daemon/start.js +29 -4
- package/vendor/connector-worker/dist/daemon/worker.d.ts +2 -0
- package/vendor/connector-worker/dist/daemon/worker.js +4 -0
- package/vendor/connector-worker/dist/executor/select.d.ts +1 -1
- package/vendor/connector-worker/dist/executor/select.js +1 -1
- package/vendor/connector-worker/dist/isolate/ivm-types.d.ts +1 -2
- package/vendor/connector-worker/dist/isolate/ivm-types.js +1 -2
- package/vendor/connector-worker/dist/isolate/load.d.ts +10 -12
- package/vendor/connector-worker/dist/isolate/load.js +23 -27
- package/vendor/connector-worker/dist/self-check/index.d.ts +2 -2
- package/vendor/connector-worker/dist/self-check/index.js +2 -2
- package/vendor/connector-worker/package.json +3 -4
- package/vendor/core/dist/contracts/agent-settings.d.ts +61 -6
- package/vendor/core/dist/contracts/agent-settings.js +10 -7
- package/vendor/core/dist/contracts/tools/manage-agents.d.ts +473 -98
- package/vendor/core/dist/contracts/tools/manage-agents.js +111 -2
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +21 -18
- package/vendor/core/dist/contracts/tools/manage-automations.js +15 -15
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +45 -20
- package/vendor/core/dist/contracts/tools/manage-entity.js +17 -5
- package/vendor/core/dist/contracts/tools/manage-inference-providers.d.ts +445 -0
- package/vendor/core/dist/contracts/tools/manage-inference-providers.js +133 -0
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +4 -4
- package/vendor/core/dist/contracts/tools/manage-views.js +5 -3
- package/vendor/core/dist/contracts/worker/device-automation.js +4 -2
- package/vendor/core/dist/error-report.d.ts +73 -0
- package/vendor/core/dist/error-report.js +346 -0
- package/vendor/core/dist/index.d.ts +4 -1
- package/vendor/core/dist/index.js +7 -1
- package/vendor/core/dist/logger.js +15 -6
- package/vendor/core/dist/otel-fetch.d.ts +19 -0
- package/vendor/core/dist/otel-fetch.js +96 -0
- package/vendor/core/dist/otel.d.ts +22 -2
- package/vendor/core/dist/otel.js +95 -48
- package/vendor/core/dist/reserved.d.ts +1 -1
- package/vendor/core/dist/reserved.js +6 -4
- package/vendor/core/dist/tool-result.d.ts +8 -0
- package/vendor/core/dist/tool-result.js +61 -0
- package/vendor/core/dist/trace-context.d.ts +12 -0
- package/vendor/core/dist/trace-context.js +50 -0
- package/vendor/core/dist/utils/diagnostic-scrubber.js +1 -1
- package/vendor/core/dist/worker/auth.js +4 -0
- package/vendor/core/package.json +6 -1
- /package/vendor/cli/dist/vendor/ora/{.bun-tag-fde20e9a6df212fa → .bun-tag-77bb9b258a474a18} +0 -0
- /package/vendor/ora/{.bun-tag-fde20e9a6df212fa → .bun-tag-77bb9b258a474a18} +0 -0
- /package/vendor/postgres/{.bun-tag-22d644c2873790db → .bun-tag-c81dacd34e959a7a} +0 -0
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Load `isolated-vm` for the
|
|
2
|
+
* Load `isolated-vm` for the worker's Node runtime.
|
|
3
3
|
*
|
|
4
|
-
* The native addon is ABI-bound
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `packages/server/src/sandbox/run-script.ts`; the gateway adopting this
|
|
11
|
-
* module is a follow-up.
|
|
4
|
+
* The native addon is ABI-bound to the Node major: Lobu ships one
|
|
5
|
+
* `isolated-vm@7` build and runs it on Node 26 only. Bun cannot dlopen a V8
|
|
6
|
+
* addon, and Node majors other than 26 have no matching ABI build, so both
|
|
7
|
+
* return `null` and the executor selector fails an `isolate` run instead of
|
|
8
|
+
* forking a child for it. Mirrors
|
|
9
|
+
* `packages/server/src/sandbox/run-script.ts`.
|
|
12
10
|
*/
|
|
13
11
|
function unwrapIsolatedVm(mod) {
|
|
14
12
|
const m = mod;
|
|
@@ -20,10 +18,12 @@ function isBun() {
|
|
|
20
18
|
function nodeMajor() {
|
|
21
19
|
return Number(process.versions.node?.split('.')[0] ?? 0);
|
|
22
20
|
}
|
|
21
|
+
/** The only Node major this repo's isolated-vm build supports. */
|
|
22
|
+
const SUPPORTED_NODE_MAJOR = 26;
|
|
23
23
|
/**
|
|
24
|
-
* Why this host cannot run an isolate, or `null` when
|
|
25
|
-
*
|
|
26
|
-
* platform) is reported by `loadIsolatedVm()` returning null; this only
|
|
24
|
+
* Why this host cannot run an isolate, or `null` when it is the supported
|
|
25
|
+
* Node 26 line. A load failure on an eligible host (native build skipped on
|
|
26
|
+
* this platform) is reported by `loadIsolatedVm()` returning null; this only
|
|
27
27
|
* classifies the runtime.
|
|
28
28
|
*/
|
|
29
29
|
export function isolatedVmUnavailableReason() {
|
|
@@ -33,24 +33,20 @@ export function isolatedVmUnavailableReason() {
|
|
|
33
33
|
const major = nodeMajor();
|
|
34
34
|
if (!Number.isFinite(major) || major === 0)
|
|
35
35
|
return 'could not determine the Node major version';
|
|
36
|
-
if (major
|
|
37
|
-
return `isolated-vm
|
|
38
|
-
|
|
39
|
-
return 'isolated-vm has no build for Node 25 (EOL non-LTS line skipped upstream)';
|
|
36
|
+
if (major !== SUPPORTED_NODE_MAJOR) {
|
|
37
|
+
return `isolated-vm requires Node ${SUPPORTED_NODE_MAJOR}.x; this host runs Node ${process.versions.node}`;
|
|
38
|
+
}
|
|
40
39
|
return null;
|
|
41
40
|
}
|
|
42
|
-
/**
|
|
41
|
+
/** The one optionalDependency that carries the Node 26 isolated-vm build. */
|
|
43
42
|
const IVM_MODULE = 'isolated-vm';
|
|
44
|
-
const IVM_NEXT_MODULE = 'isolated-vm-next';
|
|
45
43
|
/**
|
|
46
44
|
* The optionalDependency that carries this Node line's isolated-vm build, or
|
|
47
45
|
* `null` when the runtime has none (`isolatedVmUnavailableReason()` says why).
|
|
48
46
|
* Shared by the loader and the self-check so both name the same package.
|
|
49
47
|
*/
|
|
50
48
|
export function isolatedVmSpecifier() {
|
|
51
|
-
|
|
52
|
-
return null;
|
|
53
|
-
return nodeMajor() >= 26 ? IVM_NEXT_MODULE : IVM_MODULE;
|
|
49
|
+
return isolatedVmUnavailableReason() === null ? IVM_MODULE : null;
|
|
54
50
|
}
|
|
55
51
|
let cached = null;
|
|
56
52
|
/**
|
|
@@ -68,12 +64,12 @@ async function loadIsolatedVmUncached() {
|
|
|
68
64
|
if (!specifier)
|
|
69
65
|
return null;
|
|
70
66
|
try {
|
|
71
|
-
// Dynamic on purpose: the
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
67
|
+
// Dynamic on purpose: the addon is an optionalDependency, and a static
|
|
68
|
+
// import of a native addon absent on this host would fail this module
|
|
69
|
+
// (and every static importer of the executor) at load instead of failing
|
|
70
|
+
// closed for the isolate lane alone. The specifier is a variable so the
|
|
71
|
+
// worker typechecks with the package absent; `unwrapIsolatedVm` narrows
|
|
72
|
+
// to the structural `IsolatedVm`.
|
|
77
73
|
return unwrapIsolatedVm(await import(specifier));
|
|
78
74
|
}
|
|
79
75
|
catch {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* The result also reports the isolate lane (`isolate_lane`): whether this
|
|
11
11
|
* runtime can load `isolated-vm`, the V8 addon every connector run needs.
|
|
12
|
-
* That section never flips `ok` — a Bun or Node
|
|
13
|
-
* addon and simply runs no connector code — but the worker
|
|
12
|
+
* That section never flips `ok` — a Bun or non-26 Node host legitimately lacks
|
|
13
|
+
* the addon and simply runs no connector code — but the worker
|
|
14
14
|
* image smoke asserts `isolate_lane.available` separately, because the image
|
|
15
15
|
* exists to run the isolate lane and its native build is otherwise unproven.
|
|
16
16
|
*
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* The result also reports the isolate lane (`isolate_lane`): whether this
|
|
11
11
|
* runtime can load `isolated-vm`, the V8 addon every connector run needs.
|
|
12
|
-
* That section never flips `ok` — a Bun or Node
|
|
13
|
-
* addon and simply runs no connector code — but the worker
|
|
12
|
+
* That section never flips `ok` — a Bun or non-26 Node host legitimately lacks
|
|
13
|
+
* the addon and simply runs no connector code — but the worker
|
|
14
14
|
* image smoke asserts `isolate_lane.available` separately, because the image
|
|
15
15
|
* exists to run the isolate lane and its native build is otherwise unproven.
|
|
16
16
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/connector-worker",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.5.0",
|
|
4
4
|
"description": "Self-hosted worker for Lobu memory — connectors and embedding generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -73,11 +73,10 @@
|
|
|
73
73
|
"undici": "7.30.1"
|
|
74
74
|
},
|
|
75
75
|
"optionalDependencies": {
|
|
76
|
-
"isolated-vm": "
|
|
77
|
-
"isolated-vm-next": "npm:isolated-vm@^7.0.1"
|
|
76
|
+
"isolated-vm": "7.0.2"
|
|
78
77
|
},
|
|
79
78
|
"engines": {
|
|
80
|
-
"node": ">=
|
|
79
|
+
"node": ">=26 <27"
|
|
81
80
|
},
|
|
82
81
|
"keywords": [
|
|
83
82
|
"worker",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
* — a superset of stored, matching the existing interface every consumer
|
|
21
21
|
* already uses, so this is a drop-in replacement.
|
|
22
22
|
*
|
|
23
|
-
* `
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* `AgentSettingsPatchSchema` omits store-owned updatedAt for declarative writes;
|
|
24
|
+
* `manage_agents` update further omits identityMd (written as identity_md).
|
|
25
|
+
* REST PATCH bodies and sanitized GET responses stay with the route that owns them.
|
|
26
26
|
*/
|
|
27
27
|
import { type Static } from "@sinclair/typebox";
|
|
28
28
|
export declare const NetworkConfigSchema: import("@sinclair/typebox").TObject<{
|
|
@@ -49,10 +49,11 @@ export declare const GuardrailStageSchema: import("@sinclair/typebox").TUnion<im
|
|
|
49
49
|
* `tools` are optional here even though each variant requires one of them.
|
|
50
50
|
* Narrowing the shape would force every one of the ~37 read sites to discriminate
|
|
51
51
|
* before touching a field, for no safety gain: `guardrailsInline` is only ever
|
|
52
|
-
* written through `validateGuardrailsInline` (server/src/lobu/agent-
|
|
52
|
+
* written through `validateGuardrailsInline` (server/src/lobu/agent-settings.ts),
|
|
53
53
|
* which rejects a judge with no policy AND a require-tool with no tools before
|
|
54
|
-
* anything is persisted.
|
|
55
|
-
*
|
|
54
|
+
* anything is persisted. Both write paths (the PATCH config route and the
|
|
55
|
+
* `manage_agents` tool) reach it through `validateAgentSettingsUpdate`; a new
|
|
56
|
+
* write path must do the same.
|
|
56
57
|
*/
|
|
57
58
|
export declare const AgentInlineGuardrailSchema: import("@sinclair/typebox").TObject<{
|
|
58
59
|
name: import("@sinclair/typebox").TString;
|
|
@@ -164,5 +165,59 @@ export declare const AgentSettingsStoredSchema: import("@sinclair/typebox").TObj
|
|
|
164
165
|
updatedAt: import("@sinclair/typebox").TNumber;
|
|
165
166
|
}>;
|
|
166
167
|
export type AgentSettingsStored = Static<typeof AgentSettingsStoredSchema>;
|
|
168
|
+
/** Writable stored settings; timestamps are always assigned by the store. */
|
|
169
|
+
export declare const AgentSettingsPatchSchema: import("@sinclair/typebox").TObject<{
|
|
170
|
+
models: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
171
|
+
networkConfig: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
172
|
+
allowedDomains: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
173
|
+
deniedDomains: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
174
|
+
}>>;
|
|
175
|
+
nixConfig: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
176
|
+
flakeUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
177
|
+
packages: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
178
|
+
}>>;
|
|
179
|
+
soulMd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
180
|
+
userMd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
181
|
+
identityMd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
182
|
+
skillsConfig: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
183
|
+
skills: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
184
|
+
repo: import("@sinclair/typebox").TString;
|
|
185
|
+
name: import("@sinclair/typebox").TString;
|
|
186
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
187
|
+
instructions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
188
|
+
enabled: import("@sinclair/typebox").TBoolean;
|
|
189
|
+
system: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
190
|
+
content: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
191
|
+
modelPreference: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
192
|
+
thinkingLevel: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"off">, import("@sinclair/typebox").TLiteral<"low">, import("@sinclair/typebox").TLiteral<"medium">, import("@sinclair/typebox").TLiteral<"high">]>>;
|
|
193
|
+
}>>;
|
|
194
|
+
}>>;
|
|
195
|
+
guardrails: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
196
|
+
guardrailsInline: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
197
|
+
name: import("@sinclair/typebox").TString;
|
|
198
|
+
enabled: import("@sinclair/typebox").TBoolean;
|
|
199
|
+
stage: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"input" | "output" | "pre-tool" | "egress">[]>;
|
|
200
|
+
/** Defaults to `"judge"` when omitted (backward compatible). */
|
|
201
|
+
kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"judge">, import("@sinclair/typebox").TLiteral<"require-tool">]>>;
|
|
202
|
+
/** Required for `kind: "judge"` (enforced by validateGuardrailsInline). */
|
|
203
|
+
policy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
204
|
+
model: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
205
|
+
/**
|
|
206
|
+
* For `judge` pre-tool: optional tool-name filter (run only for these tools).
|
|
207
|
+
* For `require-tool`: the tool name(s) that must appear in this turn's
|
|
208
|
+
* `toolsUsed` (manual, e.g. `["send_message"]`).
|
|
209
|
+
*/
|
|
210
|
+
tools: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
211
|
+
domains: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
212
|
+
}>>>;
|
|
213
|
+
sandboxId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
214
|
+
verboseLogging: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
215
|
+
showToolCalls: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
216
|
+
starters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
217
|
+
title: import("@sinclair/typebox").TString;
|
|
218
|
+
message: import("@sinclair/typebox").TString;
|
|
219
|
+
}>>>;
|
|
220
|
+
}>;
|
|
221
|
+
export type AgentSettingsPatch = Static<typeof AgentSettingsPatchSchema>;
|
|
167
222
|
export {};
|
|
168
223
|
//# sourceMappingURL=agent-settings.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentSettingsStoredSchema = exports.SkillsConfigSchema = exports.SkillConfigSchema = exports.AgentInlineGuardrailSchema = exports.GuardrailStageSchema = exports.NixConfigSchema = exports.NetworkConfigSchema = void 0;
|
|
3
|
+
exports.AgentSettingsPatchSchema = exports.AgentSettingsStoredSchema = exports.SkillsConfigSchema = exports.SkillConfigSchema = exports.AgentInlineGuardrailSchema = exports.GuardrailStageSchema = exports.NixConfigSchema = exports.NetworkConfigSchema = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* AgentSettings TypeBox contract family — the single source for the agent
|
|
6
6
|
* settings shape across every surface (declarative, CLI apply, admin tools,
|
|
@@ -23,9 +23,9 @@ exports.AgentSettingsStoredSchema = exports.SkillsConfigSchema = exports.SkillCo
|
|
|
23
23
|
* — a superset of stored, matching the existing interface every consumer
|
|
24
24
|
* already uses, so this is a drop-in replacement.
|
|
25
25
|
*
|
|
26
|
-
* `
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* `AgentSettingsPatchSchema` omits store-owned updatedAt for declarative writes;
|
|
27
|
+
* `manage_agents` update further omits identityMd (written as identity_md).
|
|
28
|
+
* REST PATCH bodies and sanitized GET responses stay with the route that owns them.
|
|
29
29
|
*/
|
|
30
30
|
const typebox_1 = require("@sinclair/typebox");
|
|
31
31
|
// ── Nested schemas ──────────────────────────────────────────────────────────
|
|
@@ -59,10 +59,11 @@ void _stageCheck;
|
|
|
59
59
|
* `tools` are optional here even though each variant requires one of them.
|
|
60
60
|
* Narrowing the shape would force every one of the ~37 read sites to discriminate
|
|
61
61
|
* before touching a field, for no safety gain: `guardrailsInline` is only ever
|
|
62
|
-
* written through `validateGuardrailsInline` (server/src/lobu/agent-
|
|
62
|
+
* written through `validateGuardrailsInline` (server/src/lobu/agent-settings.ts),
|
|
63
63
|
* which rejects a judge with no policy AND a require-tool with no tools before
|
|
64
|
-
* anything is persisted.
|
|
65
|
-
*
|
|
64
|
+
* anything is persisted. Both write paths (the PATCH config route and the
|
|
65
|
+
* `manage_agents` tool) reach it through `validateAgentSettingsUpdate`; a new
|
|
66
|
+
* write path must do the same.
|
|
66
67
|
*/
|
|
67
68
|
exports.AgentInlineGuardrailSchema = typebox_1.Type.Object({
|
|
68
69
|
name: typebox_1.Type.String(),
|
|
@@ -143,4 +144,6 @@ exports.AgentSettingsStoredSchema = typebox_1.Type.Object({
|
|
|
143
144
|
starters: typebox_1.Type.Optional(typebox_1.Type.Array(AgentStarterSchema, { maxItems: AGENT_STARTERS_MAX })),
|
|
144
145
|
updatedAt: typebox_1.Type.Number(),
|
|
145
146
|
});
|
|
147
|
+
/** Writable stored settings; timestamps are always assigned by the store. */
|
|
148
|
+
exports.AgentSettingsPatchSchema = typebox_1.Type.Omit(exports.AgentSettingsStoredSchema, ["updatedAt"], { additionalProperties: false });
|
|
146
149
|
//# sourceMappingURL=agent-settings.js.map
|