@agentdocumentformat/cli 0.7.2
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/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/adf.mjs +162 -0
- package/dist/chunks/APEv2Parser-2CNNHMXV.mjs +22 -0
- package/dist/chunks/AiffParser-7BR4RL6G.mjs +162 -0
- package/dist/chunks/App-L5L37JI5.mjs +16747 -0
- package/dist/chunks/AsfParser-VVRSLFOM.mjs +538 -0
- package/dist/chunks/DsdiffParser-CMD4AX7A.mjs +156 -0
- package/dist/chunks/DsfParser-UOGZDS2M.mjs +94 -0
- package/dist/chunks/FlacParser-HB3T3CD4.mjs +23 -0
- package/dist/chunks/MP4Parser-66HBRUSX.mjs +973 -0
- package/dist/chunks/MatroskaParser-J3HUIMEW.mjs +579 -0
- package/dist/chunks/MpegParser-YW6LIUEW.mjs +442 -0
- package/dist/chunks/MusepackParser-PAUSXP7D.mjs +252 -0
- package/dist/chunks/OggParser-NUBV3GWC.mjs +359 -0
- package/dist/chunks/WavPackParser-WQAGT7TC.mjs +171 -0
- package/dist/chunks/WaveParser-EWLQVDX4.mjs +238 -0
- package/dist/chunks/adf-schema-JRU2BTOG.mjs +62 -0
- package/dist/chunks/build-QF5W473T.mjs +60 -0
- package/dist/chunks/chatgpt-subscription-BQGWYZXE.mjs +23 -0
- package/dist/chunks/chunk-2DIECGFL.mjs +6 -0
- package/dist/chunks/chunk-2NAP2ZF7.mjs +60 -0
- package/dist/chunks/chunk-3AT7IIP7.mjs +25696 -0
- package/dist/chunks/chunk-3GNIDM53.mjs +35 -0
- package/dist/chunks/chunk-3M4ZPOA3.mjs +1477 -0
- package/dist/chunks/chunk-4MQPTCXY.mjs +510 -0
- package/dist/chunks/chunk-5PO5PKRV.mjs +366 -0
- package/dist/chunks/chunk-5QU5VY7N.mjs +52 -0
- package/dist/chunks/chunk-5W7KES6P.mjs +436 -0
- package/dist/chunks/chunk-62NE4LG4.mjs +61 -0
- package/dist/chunks/chunk-64OKE4X3.mjs +45 -0
- package/dist/chunks/chunk-6GJ4QHRI.mjs +1278 -0
- package/dist/chunks/chunk-6VQEXLE2.mjs +144 -0
- package/dist/chunks/chunk-6XUV6EK6.mjs +41 -0
- package/dist/chunks/chunk-776TSXEP.mjs +43 -0
- package/dist/chunks/chunk-7CV2SA3H.mjs +285 -0
- package/dist/chunks/chunk-7MTRVW2U.mjs +3103 -0
- package/dist/chunks/chunk-7N2R2VCG.mjs +1434 -0
- package/dist/chunks/chunk-7T2YMTWL.mjs +374 -0
- package/dist/chunks/chunk-7XYNI52E.mjs +149 -0
- package/dist/chunks/chunk-APHX6HSV.mjs +7731 -0
- package/dist/chunks/chunk-APRU6PHC.mjs +40 -0
- package/dist/chunks/chunk-AUYKRQPJ.mjs +499 -0
- package/dist/chunks/chunk-DXWDD5XJ.mjs +136 -0
- package/dist/chunks/chunk-EWL5FG4I.mjs +39 -0
- package/dist/chunks/chunk-EYX2YLJW.mjs +117 -0
- package/dist/chunks/chunk-F5ELW46V.mjs +27 -0
- package/dist/chunks/chunk-G426FACA.mjs +49 -0
- package/dist/chunks/chunk-GEKSJHIV.mjs +2472 -0
- package/dist/chunks/chunk-HBUENVQL.mjs +570 -0
- package/dist/chunks/chunk-HPVFJYXR.mjs +112 -0
- package/dist/chunks/chunk-HWLWPXQ7.mjs +721 -0
- package/dist/chunks/chunk-I2HJYHFT.mjs +665 -0
- package/dist/chunks/chunk-I3UYSITV.mjs +68 -0
- package/dist/chunks/chunk-IC4JDZCI.mjs +3864 -0
- package/dist/chunks/chunk-IHDDCZBS.mjs +112 -0
- package/dist/chunks/chunk-IIGMZHQQ.mjs +10416 -0
- package/dist/chunks/chunk-KWFOS5WC.mjs +41 -0
- package/dist/chunks/chunk-LAZIXV2F.mjs +5290 -0
- package/dist/chunks/chunk-LFMB4PAA.mjs +10814 -0
- package/dist/chunks/chunk-M2RX3S2T.mjs +49 -0
- package/dist/chunks/chunk-M3WPIJYM.mjs +65 -0
- package/dist/chunks/chunk-NBTUWMGP.mjs +263 -0
- package/dist/chunks/chunk-NGK6PVSF.mjs +2676 -0
- package/dist/chunks/chunk-NZ7JTHEO.mjs +85 -0
- package/dist/chunks/chunk-OQN33RGQ.mjs +52 -0
- package/dist/chunks/chunk-RIX34QHC.mjs +2935 -0
- package/dist/chunks/chunk-SGUTYISF.mjs +16 -0
- package/dist/chunks/chunk-SLJ5L7PY.mjs +1473 -0
- package/dist/chunks/chunk-SLUKGXKH.mjs +68 -0
- package/dist/chunks/chunk-TMT32MXT.mjs +419 -0
- package/dist/chunks/chunk-UYY5M2PB.mjs +151 -0
- package/dist/chunks/chunk-VAUOM3IN.mjs +298 -0
- package/dist/chunks/chunk-VMHTYDH4.mjs +172 -0
- package/dist/chunks/chunk-VZS54AA5.mjs +200 -0
- package/dist/chunks/chunk-WFQUVXML.mjs +295 -0
- package/dist/chunks/chunk-X34PDRUH.mjs +809 -0
- package/dist/chunks/chunk-XNPZBLYL.mjs +33 -0
- package/dist/chunks/chunk-XX7OSWTO.mjs +157 -0
- package/dist/chunks/chunk-XYTWGHFS.mjs +600 -0
- package/dist/chunks/chunk-XYV3VCIX.mjs +336 -0
- package/dist/chunks/chunk-Y5ZLKFLE.mjs +1469 -0
- package/dist/chunks/chunk-ZJKXHM4Q.mjs +230 -0
- package/dist/chunks/cli-TCMBNZF6.mjs +1030 -0
- package/dist/chunks/commands-DTEKM4ZL.mjs +20 -0
- package/dist/chunks/daemon-ZC3FZ2P4.mjs +112449 -0
- package/dist/chunks/daemon-control-WDX7PMTC.mjs +300 -0
- package/dist/chunks/daemon-token-WRSULP7G.mjs +23 -0
- package/dist/chunks/devtools-H7CI2ZVG.mjs +85 -0
- package/dist/chunks/discord-IWDQJA7A.mjs +70588 -0
- package/dist/chunks/dist-C57KYFS2.mjs +4952 -0
- package/dist/chunks/dist-I3XBAGDL.mjs +11 -0
- package/dist/chunks/email-V4Q4VJON.mjs +58679 -0
- package/dist/chunks/environment-NX277MQG.mjs +15 -0
- package/dist/chunks/grok-subscription-4PYX7TBF.mjs +19 -0
- package/dist/chunks/layout-EPJQNFAI.mjs +22 -0
- package/dist/chunks/lib-N7FCZWKH.mjs +4038 -0
- package/dist/chunks/open-OTQDGDH5.mjs +36 -0
- package/dist/chunks/parser-JVY2PWSM.mjs +19 -0
- package/dist/chunks/pipeline-executor-BHBSJX2K.mjs +19 -0
- package/dist/chunks/react-IUIDQ5LX.mjs +11 -0
- package/dist/chunks/screen-54BUTYCW.mjs +27 -0
- package/dist/chunks/slack-3L5QTDZX.mjs +8113 -0
- package/dist/chunks/store-WR7TZJZS.mjs +32 -0
- package/dist/chunks/telegram-5ISVFBV3.mjs +14918 -0
- package/dist/chunks/terminal-O5WO7C5U.mjs +48 -0
- package/dist/chunks/theme-NORU4J74.mjs +20 -0
- package/dist/chunks/themes-F2FKU7CP.mjs +23 -0
- package/dist/chunks/token-6G3HCMNX.mjs +54 -0
- package/dist/chunks/token-util-UXYSDQIW.mjs +12 -0
- package/dist/chunks/tui-ODVYUIMT.mjs +197 -0
- package/dist/chunks/welcome-XHXFV7SH.mjs +32 -0
- package/dist/chunks/whatsapp-XSAMNGPJ.mjs +85412 -0
- package/dist/chunks/xterm-headless-YF53XWXE.mjs +3353 -0
- package/package.json +53 -0
- package/resources/wasm/coreutils.LICENSE +18 -0
- package/resources/wasm/coreutils.wasm +0 -0
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
import { createRequire as __adfCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __adfFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __adfDirname } from 'node:path';
|
|
4
|
+
const require = __adfCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __adfFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __adfDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
external_exports
|
|
9
|
+
} from "./chunk-ZJKXHM4Q.mjs";
|
|
10
|
+
import {
|
|
11
|
+
AGENT_STATES,
|
|
12
|
+
LOOP_PROHIBITED_TOOLS,
|
|
13
|
+
MESSAGING_MODES,
|
|
14
|
+
RESERVED_AGENT_PATH_SEGMENTS,
|
|
15
|
+
START_IN_STATES
|
|
16
|
+
} from "./chunk-WFQUVXML.mjs";
|
|
17
|
+
|
|
18
|
+
// src/shared/types/umbilical-events.ts
|
|
19
|
+
var UMBILICAL_EVENT_TYPES = [
|
|
20
|
+
// --- agent lifecycle ---------------------------------------------------
|
|
21
|
+
"agent.loaded",
|
|
22
|
+
"agent.unloaded",
|
|
23
|
+
"agent.state.changed",
|
|
24
|
+
"agent.error",
|
|
25
|
+
// An auth-bricked loop left `error` because its provider's sign-in
|
|
26
|
+
// completed (no turn is re-run; the next trigger works normally).
|
|
27
|
+
"agent.recovered",
|
|
28
|
+
// Sealed credential envelopes re-checked after the owner identity became
|
|
29
|
+
// ready (or on the periodic re-check): the agent's `degraded` was recomputed.
|
|
30
|
+
"agent.credentials.unlocked",
|
|
31
|
+
// --- turn --------------------------------------------------------------
|
|
32
|
+
"turn.completed",
|
|
33
|
+
// --- tools -------------------------------------------------------------
|
|
34
|
+
"tool.started",
|
|
35
|
+
"tool.completed",
|
|
36
|
+
"tool.failed",
|
|
37
|
+
// --- model calls -------------------------------------------------------
|
|
38
|
+
"llm.completed",
|
|
39
|
+
"llm.failed",
|
|
40
|
+
// --- lambdas -----------------------------------------------------------
|
|
41
|
+
"lambda.started",
|
|
42
|
+
"lambda.completed",
|
|
43
|
+
"lambda.failed",
|
|
44
|
+
// --- triggers / timers -------------------------------------------------
|
|
45
|
+
"trigger.fired",
|
|
46
|
+
"timer.fired",
|
|
47
|
+
// --- messaging ---------------------------------------------------------
|
|
48
|
+
"message.received",
|
|
49
|
+
"message.sent",
|
|
50
|
+
"message.delivery_failed",
|
|
51
|
+
// --- filesystem --------------------------------------------------------
|
|
52
|
+
"file.read",
|
|
53
|
+
"file.written",
|
|
54
|
+
"file.deleted",
|
|
55
|
+
// --- database ----------------------------------------------------------
|
|
56
|
+
"db.read",
|
|
57
|
+
"db.write",
|
|
58
|
+
// --- websockets --------------------------------------------------------
|
|
59
|
+
"ws.opened",
|
|
60
|
+
"ws.closed",
|
|
61
|
+
// --- stream bindings ---------------------------------------------------
|
|
62
|
+
"binding.created",
|
|
63
|
+
"binding.materialized",
|
|
64
|
+
"binding.pending",
|
|
65
|
+
"binding.reconnecting",
|
|
66
|
+
"binding.error",
|
|
67
|
+
"binding.threshold_exceeded",
|
|
68
|
+
"binding.flow_summary",
|
|
69
|
+
"binding.terminated",
|
|
70
|
+
// --- channel adapters / MCP -------------------------------------------
|
|
71
|
+
"adapter.status.changed",
|
|
72
|
+
"adapter.log",
|
|
73
|
+
"mcp.status.changed",
|
|
74
|
+
"mcp.tools.discovered",
|
|
75
|
+
"mcp.log",
|
|
76
|
+
// --- daemon ------------------------------------------------------------
|
|
77
|
+
"daemon.started",
|
|
78
|
+
"daemon.autostart.report",
|
|
79
|
+
// --- lifecycle / control-plane -----------------------------------------
|
|
80
|
+
// These are emitted by the runtime (HIL, asks, suspend, config/context,
|
|
81
|
+
// loop lifecycle, mesh queueing, trigger drops, WS reconnect, turn deltas).
|
|
82
|
+
//
|
|
83
|
+
// Exception: `umbilical.checkpoint` is the signed epoch/checkpoint marker
|
|
84
|
+
// from the deferred sealed-epochs design (docs/design/sealed-epochs.md) and
|
|
85
|
+
// is reserved — declared up front so tap filters validate cleanly, but
|
|
86
|
+
// nothing emits it today.
|
|
87
|
+
"umbilical.checkpoint",
|
|
88
|
+
"hil.requested",
|
|
89
|
+
"hil.resolved",
|
|
90
|
+
"ask.requested",
|
|
91
|
+
"ask.resolved",
|
|
92
|
+
"suspend.requested",
|
|
93
|
+
"suspend.resolved",
|
|
94
|
+
"config.changed",
|
|
95
|
+
"context.injected",
|
|
96
|
+
"loop.compacted",
|
|
97
|
+
"loop.compaction_failed",
|
|
98
|
+
"loop.compaction_superseded",
|
|
99
|
+
"loop.cleared",
|
|
100
|
+
"loop.recovered",
|
|
101
|
+
"message.queued",
|
|
102
|
+
"trigger.dropped",
|
|
103
|
+
// Automatic recovery from transient provider errors (config.recovery):
|
|
104
|
+
// scheduled → armed a backoff retry; started → retry turn began;
|
|
105
|
+
// cancelled → disarmed (fresh work, abort, or owner state change).
|
|
106
|
+
"provider.retry_scheduled",
|
|
107
|
+
"provider.retry_started",
|
|
108
|
+
"provider.retry_cancelled",
|
|
109
|
+
// Recovery from the terminal `error` state: an incoming agent-scope trigger
|
|
110
|
+
// may spend itself as a recovery turn (recovery_trigger); once the attempt
|
|
111
|
+
// cap is hit and the cooldown has not elapsed, triggers are dropped and the
|
|
112
|
+
// suppression is announced once per episode (recovery_suppressed).
|
|
113
|
+
"error.recovery_trigger",
|
|
114
|
+
"error.recovery_suppressed",
|
|
115
|
+
"ws.reconnecting",
|
|
116
|
+
"turn.delta"
|
|
117
|
+
], KNOWN_EVENT_TYPES = new Set(UMBILICAL_EVENT_TYPES), CUSTOM_EVENT_PREFIX = "custom.";
|
|
118
|
+
function isKnownUmbilicalEventType(type) {
|
|
119
|
+
return typeof type != "string" || type.length === 0 ? !1 : type.startsWith(CUSTOM_EVENT_PREFIX) && type.length > CUSTOM_EVENT_PREFIX.length ? !0 : KNOWN_EVENT_TYPES.has(type);
|
|
120
|
+
}
|
|
121
|
+
var UMBILICAL_EVENT_PREFIXES = Array.from(
|
|
122
|
+
new Set(UMBILICAL_EVENT_TYPES.map((type) => type.slice(0, type.indexOf("."))))
|
|
123
|
+
).concat("custom");
|
|
124
|
+
function isUmbilicalEventWildcard(entry) {
|
|
125
|
+
if (entry === "*") return !0;
|
|
126
|
+
if (!entry.endsWith(".*")) return !1;
|
|
127
|
+
let prefix = entry.slice(0, -2);
|
|
128
|
+
return UMBILICAL_EVENT_PREFIXES.includes(prefix);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// src/main/adf/adf-schema.ts
|
|
132
|
+
function warnUnknownEventTypes(label, eventTypes) {
|
|
133
|
+
if (eventTypes)
|
|
134
|
+
for (let entry of eventTypes)
|
|
135
|
+
entry !== "*" && (isUmbilicalEventWildcard(entry) || isKnownUmbilicalEventType(entry) || console.warn(`[ADF] ${label} filters on unknown umbilical event type "${entry}". Known types: src/shared/types/umbilical-events.ts (docs/guides/umbilical-events.md).`));
|
|
136
|
+
}
|
|
137
|
+
var TOOL_NAME_RENAMES = {
|
|
138
|
+
msg_list_agents: "agent_discover"
|
|
139
|
+
}, ToolDeclarationSchema = external_exports.object({
|
|
140
|
+
name: external_exports.string().min(1),
|
|
141
|
+
// A declaration with a MISSING flag is treated as disabled/hidden everywhere
|
|
142
|
+
// at runtime (shell gate `!decl.enabled`, getToolsForAgent `enabled && visible`,
|
|
143
|
+
// UI checkboxes). The validation schema must agree: defaulting missing flags to
|
|
144
|
+
// true would silently grant capability the runtime then refuses, making the
|
|
145
|
+
// config lie in whichever direction the consumer parsed it.
|
|
146
|
+
enabled: external_exports.boolean().default(!1),
|
|
147
|
+
visible: external_exports.boolean().default(!1),
|
|
148
|
+
restricted: external_exports.boolean().optional(),
|
|
149
|
+
mcp_tool_hash: external_exports.string().optional(),
|
|
150
|
+
mcp_tool_status: external_exports.enum(["new", "changed", "removed"]).optional()
|
|
151
|
+
}).transform((decl) => {
|
|
152
|
+
let renamed = TOOL_NAME_RENAMES[decl.name];
|
|
153
|
+
return renamed ? { ...decl, name: renamed } : decl;
|
|
154
|
+
}), TriggerFilterSchema = external_exports.object({
|
|
155
|
+
source: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
156
|
+
sender: external_exports.string().optional(),
|
|
157
|
+
to: external_exports.string().optional(),
|
|
158
|
+
watch: external_exports.string().optional(),
|
|
159
|
+
include_self: external_exports.boolean().optional(),
|
|
160
|
+
tools: external_exports.array(external_exports.string()).optional(),
|
|
161
|
+
status: external_exports.string().optional(),
|
|
162
|
+
level: external_exports.array(external_exports.enum(["debug", "info", "warn", "error"])).optional(),
|
|
163
|
+
origin: external_exports.array(external_exports.string()).optional(),
|
|
164
|
+
event: external_exports.array(external_exports.string()).optional(),
|
|
165
|
+
provider: external_exports.array(external_exports.string()).optional()
|
|
166
|
+
}).strict().optional(), TriggerTargetSchema = external_exports.object({
|
|
167
|
+
scope: external_exports.enum(["system", "agent"]),
|
|
168
|
+
lambda: external_exports.string().optional(),
|
|
169
|
+
command: external_exports.string().optional(),
|
|
170
|
+
warm: external_exports.boolean().optional(),
|
|
171
|
+
filter: TriggerFilterSchema,
|
|
172
|
+
debounce_ms: external_exports.number().int().positive().optional(),
|
|
173
|
+
interval_ms: external_exports.number().int().positive().optional(),
|
|
174
|
+
batch_ms: external_exports.number().int().positive().optional(),
|
|
175
|
+
batch_count: external_exports.number().int().positive().optional(),
|
|
176
|
+
// Cognition stream this target wakes. Absent → 'main'. Existence of the
|
|
177
|
+
// named loop is a runtime concern (the router falls back to main), not a
|
|
178
|
+
// schema one — a config may legitimately be validated before its loops load.
|
|
179
|
+
loop: external_exports.string().min(1).optional()
|
|
180
|
+
}).refine(
|
|
181
|
+
(t) => [t.debounce_ms, t.interval_ms, t.batch_ms].filter((v) => v !== void 0).length <= 1,
|
|
182
|
+
{ message: "Only one timing modifier allowed per target" }
|
|
183
|
+
).refine(
|
|
184
|
+
(t) => t.batch_count === void 0 || t.batch_ms !== void 0,
|
|
185
|
+
{ message: "batch_count requires batch_ms" }
|
|
186
|
+
).refine(
|
|
187
|
+
(t) => t.scope === "system" || !t.lambda && !t.command && t.warm === void 0,
|
|
188
|
+
{ message: "lambda, command, and warm only allowed on system scope targets" }
|
|
189
|
+
).refine(
|
|
190
|
+
(t) => !t.lambda || !t.command,
|
|
191
|
+
{ message: "lambda and command are mutually exclusive" }
|
|
192
|
+
), TriggerConfigSchema = external_exports.object({
|
|
193
|
+
enabled: external_exports.boolean(),
|
|
194
|
+
targets: external_exports.array(TriggerTargetSchema).default([])
|
|
195
|
+
}), TriggersConfigV3Schema = external_exports.object({
|
|
196
|
+
on_startup: TriggerConfigSchema.optional(),
|
|
197
|
+
on_inbox: TriggerConfigSchema.optional(),
|
|
198
|
+
on_outbox: TriggerConfigSchema.optional(),
|
|
199
|
+
on_file_change: TriggerConfigSchema.optional(),
|
|
200
|
+
on_chat: TriggerConfigSchema.optional(),
|
|
201
|
+
on_timer: TriggerConfigSchema.optional(),
|
|
202
|
+
on_tool_call: TriggerConfigSchema.optional(),
|
|
203
|
+
on_task_create: TriggerConfigSchema.optional(),
|
|
204
|
+
on_task_complete: TriggerConfigSchema.optional(),
|
|
205
|
+
on_logs: TriggerConfigSchema.optional(),
|
|
206
|
+
on_llm_call: TriggerConfigSchema.optional()
|
|
207
|
+
}), LoggingRuleSchema = external_exports.object({
|
|
208
|
+
origin: external_exports.string().min(1),
|
|
209
|
+
min_level: external_exports.enum(["debug", "info", "warn", "error"])
|
|
210
|
+
}), LoggingConfigSchema = external_exports.object({
|
|
211
|
+
default_level: external_exports.enum(["debug", "info", "warn", "error"]).default("info"),
|
|
212
|
+
rules: external_exports.array(LoggingRuleSchema).optional(),
|
|
213
|
+
max_rows: external_exports.number().int().positive().nullable().optional()
|
|
214
|
+
}), MiddlewareRefSchema = external_exports.object({
|
|
215
|
+
lambda: external_exports.string().min(1)
|
|
216
|
+
}), ServingApiRouteSchema = external_exports.object({
|
|
217
|
+
method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "WS"]),
|
|
218
|
+
path: external_exports.string().min(1),
|
|
219
|
+
lambda: external_exports.string().optional(),
|
|
220
|
+
warm: external_exports.boolean().optional(),
|
|
221
|
+
cache_ttl_ms: external_exports.number().int().positive().optional(),
|
|
222
|
+
on_card: external_exports.boolean().optional(),
|
|
223
|
+
middleware: external_exports.array(MiddlewareRefSchema).optional(),
|
|
224
|
+
high_water_mark_bytes: external_exports.number().int().positive().optional()
|
|
225
|
+
}).superRefine((route, ctx) => {
|
|
226
|
+
route.method === "WS" && !route.lambda && ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "WS routes require a lambda handler", path: ["lambda"] }), route.method !== "WS" && !route.lambda && ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "HTTP routes require a lambda handler", path: ["lambda"] });
|
|
227
|
+
let firstSegment = route.path.replace(/^\/+/, "").split("/")[0];
|
|
228
|
+
RESERVED_AGENT_PATH_SEGMENTS.includes(firstSegment) && ctx.addIssue({
|
|
229
|
+
code: external_exports.ZodIssueCode.custom,
|
|
230
|
+
message: `Path segment "${firstSegment}" is reserved for the agent's protocol mailbox and cannot be used by a serving route`,
|
|
231
|
+
path: ["path"]
|
|
232
|
+
});
|
|
233
|
+
}), WsConnectionConfigSchema = external_exports.object({
|
|
234
|
+
id: external_exports.string().min(1),
|
|
235
|
+
url: external_exports.string().url(),
|
|
236
|
+
did: external_exports.string().optional(),
|
|
237
|
+
enabled: external_exports.boolean(),
|
|
238
|
+
lambda: external_exports.string().optional(),
|
|
239
|
+
auth: external_exports.enum(["auto", "required", "none"]).optional(),
|
|
240
|
+
auto_reconnect: external_exports.boolean().optional(),
|
|
241
|
+
reconnect_delay_ms: external_exports.number().int().positive().optional(),
|
|
242
|
+
keepalive_interval_ms: external_exports.number().int().positive().optional(),
|
|
243
|
+
connect_timeout_ms: external_exports.number().int().positive().optional(),
|
|
244
|
+
high_water_mark_bytes: external_exports.number().int().positive().optional()
|
|
245
|
+
}), UmbilicalFilterSchema = external_exports.object({
|
|
246
|
+
event_types: external_exports.array(external_exports.string()).optional(),
|
|
247
|
+
when: external_exports.string().optional(),
|
|
248
|
+
allow_wildcard: external_exports.boolean().optional().describe('Required to subscribe to "*" or bare "prefix.*" event_types, matching the umbilical_tap gate.'),
|
|
249
|
+
max_rate_per_sec: external_exports.number().int().positive().optional().describe("Token-bucket ceiling. Frames beyond it are dropped and counted in binding.flow_summary.frames_dropped."),
|
|
250
|
+
exclude_source: external_exports.string().optional().describe('Suppress events whose "source" equals this value, e.g. "lambda:lib/tap.ts:onEvent".')
|
|
251
|
+
});
|
|
252
|
+
function usesWildcardEventTypes(eventTypes) {
|
|
253
|
+
return eventTypes.some((type) => type === "*" || type.endsWith(".*"));
|
|
254
|
+
}
|
|
255
|
+
var StreamBindEndpointSchema = external_exports.union([
|
|
256
|
+
external_exports.object({
|
|
257
|
+
kind: external_exports.literal("ws"),
|
|
258
|
+
connection_id: external_exports.string().min(1)
|
|
259
|
+
}),
|
|
260
|
+
external_exports.object({
|
|
261
|
+
kind: external_exports.literal("process"),
|
|
262
|
+
isolation: external_exports.enum(["host", "container_shared", "container_isolated"]),
|
|
263
|
+
image: external_exports.string().optional(),
|
|
264
|
+
command: external_exports.array(external_exports.string()).min(1),
|
|
265
|
+
env: external_exports.record(external_exports.string()).optional(),
|
|
266
|
+
cwd: external_exports.string().optional()
|
|
267
|
+
}).superRefine((endpoint, ctx) => {
|
|
268
|
+
endpoint.isolation === "container_isolated" && !endpoint.image && ctx.addIssue({
|
|
269
|
+
code: external_exports.ZodIssueCode.custom,
|
|
270
|
+
message: "container_isolated process bindings require image",
|
|
271
|
+
path: ["image"]
|
|
272
|
+
});
|
|
273
|
+
}),
|
|
274
|
+
external_exports.object({
|
|
275
|
+
kind: external_exports.literal("tcp"),
|
|
276
|
+
host: external_exports.string().min(1),
|
|
277
|
+
port: external_exports.number().int().min(1).max(65535)
|
|
278
|
+
}),
|
|
279
|
+
external_exports.object({
|
|
280
|
+
kind: external_exports.literal("umbilical"),
|
|
281
|
+
filter: UmbilicalFilterSchema.optional()
|
|
282
|
+
})
|
|
283
|
+
]), BindOptionsSchema = external_exports.object({
|
|
284
|
+
idle_timeout_ms: external_exports.number().int().positive().optional(),
|
|
285
|
+
max_duration_ms: external_exports.number().int().positive().optional(),
|
|
286
|
+
max_bytes: external_exports.number().int().positive().optional(),
|
|
287
|
+
flow_summary_interval_ms: external_exports.number().int().positive().optional(),
|
|
288
|
+
close_a_on_b_close: external_exports.boolean().optional(),
|
|
289
|
+
close_b_on_a_close: external_exports.boolean().optional(),
|
|
290
|
+
queue_high_water_bytes: external_exports.number().int().positive().optional().describe("Per-direction cap on queued-but-unwritten bytes (default 4194304). At the cap the source is paused and resumes at half; unpausable sources drop frames instead."),
|
|
291
|
+
drain_timeout_ms: external_exports.number().int().positive().optional().describe("How long termination waits for in-flight writes to flush (default 1000).")
|
|
292
|
+
}), StreamBindingDeclarationSchema = external_exports.object({
|
|
293
|
+
id: external_exports.string().min(1),
|
|
294
|
+
a: StreamBindEndpointSchema,
|
|
295
|
+
b: StreamBindEndpointSchema,
|
|
296
|
+
bidirectional: external_exports.boolean().optional(),
|
|
297
|
+
reconnect: external_exports.boolean().optional(),
|
|
298
|
+
options: BindOptionsSchema.optional()
|
|
299
|
+
}).superRefine((binding, ctx) => {
|
|
300
|
+
binding.b.kind === "umbilical" && ctx.addIssue({
|
|
301
|
+
code: external_exports.ZodIssueCode.custom,
|
|
302
|
+
message: "umbilical endpoints are read-only and cannot appear as b",
|
|
303
|
+
path: ["b"]
|
|
304
|
+
});
|
|
305
|
+
for (let side of ["a", "b"]) {
|
|
306
|
+
let endpoint = binding[side];
|
|
307
|
+
if (endpoint?.kind !== "umbilical") continue;
|
|
308
|
+
warnUnknownEventTypes(`stream_binding "${binding.id}" endpoint ${side}`, endpoint.filter?.event_types);
|
|
309
|
+
let eventTypes = endpoint.filter?.event_types?.length ? endpoint.filter.event_types : ["*"];
|
|
310
|
+
usesWildcardEventTypes(eventTypes) && !endpoint.filter?.allow_wildcard && ctx.addIssue({
|
|
311
|
+
code: external_exports.ZodIssueCode.custom,
|
|
312
|
+
message: `stream_binding "${binding.id}" endpoint ${side} subscribes to wildcard event_types (${eventTypes.join(", ")}) but filter.allow_wildcard is not true.`,
|
|
313
|
+
path: [side, "filter", "allow_wildcard"]
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}), StreamBindConfigSchema = external_exports.object({
|
|
317
|
+
host_process_bind: external_exports.boolean().optional(),
|
|
318
|
+
container_shared_bind: external_exports.boolean().optional(),
|
|
319
|
+
container_isolated_bind: external_exports.boolean().optional(),
|
|
320
|
+
allow_tcp_bind: external_exports.boolean().optional().describe("Enables TCP stream binding. Fails closed on its own \u2014 every bind is denied until tcp_allowlist has at least one rule."),
|
|
321
|
+
tcp_allowlist: external_exports.array(external_exports.object({
|
|
322
|
+
host: external_exports.string().min(1).describe('Exact hostname/IP, or "*" to match every host.'),
|
|
323
|
+
port: external_exports.number().int().min(1).max(65535).optional(),
|
|
324
|
+
ports: external_exports.array(external_exports.number().int().min(1).max(65535)).optional(),
|
|
325
|
+
min_port: external_exports.number().int().min(1).max(65535).optional(),
|
|
326
|
+
max_port: external_exports.number().int().min(1).max(65535).optional()
|
|
327
|
+
})).optional().describe('Required whenever allow_tcp_bind is true. A rule with no port constraint allows every port on that host; use { host: "*" } to allow everything explicitly.')
|
|
328
|
+
}), ServingPublicConfigSchema = external_exports.object({
|
|
329
|
+
enabled: external_exports.boolean(),
|
|
330
|
+
index: external_exports.string().optional()
|
|
331
|
+
}), ServingSharedConfigSchema = external_exports.object({
|
|
332
|
+
enabled: external_exports.boolean(),
|
|
333
|
+
patterns: external_exports.array(external_exports.string()).optional().refine(
|
|
334
|
+
(arr) => !arr || arr.every((s) => !RESERVED_AGENT_PATH_SEGMENTS.includes(s.replace(/^\/+/, "").split("/")[0])),
|
|
335
|
+
{ message: `Shared entries must not start with a reserved segment (${RESERVED_AGENT_PATH_SEGMENTS.join("/")})` }
|
|
336
|
+
)
|
|
337
|
+
}), ServingConfigSchema = external_exports.object({
|
|
338
|
+
shared: ServingSharedConfigSchema.optional(),
|
|
339
|
+
public: ServingPublicConfigSchema.optional(),
|
|
340
|
+
api: external_exports.array(ServingApiRouteSchema).optional()
|
|
341
|
+
}), ResolutionSchema = external_exports.object({
|
|
342
|
+
method: external_exports.string().min(1),
|
|
343
|
+
endpoint: external_exports.string().optional(),
|
|
344
|
+
network: external_exports.string().optional(),
|
|
345
|
+
contract: external_exports.string().optional(),
|
|
346
|
+
chain_id: external_exports.number().int().optional(),
|
|
347
|
+
domain: external_exports.string().optional(),
|
|
348
|
+
selector: external_exports.string().optional()
|
|
349
|
+
}), CardOverridesSchema = external_exports.object({
|
|
350
|
+
endpoints: external_exports.object({
|
|
351
|
+
inbox: external_exports.string().url().optional(),
|
|
352
|
+
card: external_exports.string().url().optional(),
|
|
353
|
+
health: external_exports.string().url().optional(),
|
|
354
|
+
ws: external_exports.string().optional()
|
|
355
|
+
}).optional(),
|
|
356
|
+
resolution: ResolutionSchema.optional(),
|
|
357
|
+
publish_attestations: external_exports.boolean().optional()
|
|
358
|
+
}), AdapterInstanceConfigSchema = external_exports.object({
|
|
359
|
+
enabled: external_exports.boolean(),
|
|
360
|
+
config: external_exports.record(external_exports.unknown()).optional(),
|
|
361
|
+
policy: external_exports.object({
|
|
362
|
+
dm: external_exports.enum(["all", "allowlist", "none"]).optional(),
|
|
363
|
+
groups: external_exports.enum(["all", "mention", "none"]).optional(),
|
|
364
|
+
allow_from: external_exports.array(external_exports.string()).optional()
|
|
365
|
+
}).optional(),
|
|
366
|
+
limits: external_exports.object({
|
|
367
|
+
max_attachment_size: external_exports.number().int().positive().optional()
|
|
368
|
+
}).optional()
|
|
369
|
+
}), ModelConfigSchema = external_exports.object({
|
|
370
|
+
provider: external_exports.string().min(1),
|
|
371
|
+
model_id: external_exports.string().default(""),
|
|
372
|
+
temperature: external_exports.number().min(0).max(2).nullable().default(0.7),
|
|
373
|
+
max_tokens: external_exports.number().int().positive().nullable().default(4096),
|
|
374
|
+
top_p: external_exports.number().min(0).max(1).nullable().optional(),
|
|
375
|
+
/** @deprecated folded into `reasoning.max_tokens` on config load. */
|
|
376
|
+
thinking_budget: external_exports.number().int().positive().nullable().optional(),
|
|
377
|
+
reasoning: external_exports.object({
|
|
378
|
+
enabled: external_exports.boolean().optional(),
|
|
379
|
+
effort: external_exports.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
380
|
+
max_tokens: external_exports.number().int().positive().optional(),
|
|
381
|
+
exclude: external_exports.boolean().optional(),
|
|
382
|
+
preserve: external_exports.boolean().optional(),
|
|
383
|
+
summary: external_exports.enum(["auto", "concise", "detailed"]).optional()
|
|
384
|
+
}).optional(),
|
|
385
|
+
compact_threshold: external_exports.number().int().positive().nullable().optional(),
|
|
386
|
+
/** @deprecated Use multimodal.image instead. Kept for backward compatibility. */
|
|
387
|
+
vision: external_exports.boolean().default(!1),
|
|
388
|
+
multimodal: external_exports.object({
|
|
389
|
+
image: external_exports.boolean().optional(),
|
|
390
|
+
audio: external_exports.boolean().optional(),
|
|
391
|
+
video: external_exports.boolean().optional()
|
|
392
|
+
}).optional(),
|
|
393
|
+
params: external_exports.array(external_exports.object({ key: external_exports.string(), value: external_exports.string() })).optional(),
|
|
394
|
+
provider_params: external_exports.record(external_exports.unknown()).optional()
|
|
395
|
+
}), PROHIBITED_LOOP_TOOL_NAMES = LOOP_PROHIBITED_TOOLS, LOOP_NAME_PATTERN = /^[a-z0-9][a-z0-9_-]{0,31}$/, LOOP_NAME_RULE = 'loop name must be 1-32 characters of lowercase letters, digits, "_" or "-", starting with a letter or digit', LOOP_GOAL_MAX_CHARS = 4e3, LOOP_TOOLS_MAX = 64, MAX_SIDE_LOOPS = 16, LoopConfigSchema = external_exports.object({
|
|
396
|
+
name: external_exports.string().regex(LOOP_NAME_PATTERN, { message: LOOP_NAME_RULE }).refine((n) => n !== "main", {
|
|
397
|
+
message: "'main' is the implicit host loop and cannot be declared as an inner loop"
|
|
398
|
+
}),
|
|
399
|
+
goal: external_exports.string().min(1).max(LOOP_GOAL_MAX_CHARS),
|
|
400
|
+
enabled: external_exports.boolean(),
|
|
401
|
+
autostart: external_exports.boolean().optional().describe("Run a first turn on the goal at create and whenever the agent starts, instead of waiting to be addressed."),
|
|
402
|
+
autonomous: external_exports.boolean().optional().describe("Keep turning after text-only responses until the loop calls sys_set_state. Per-loop; not inherited from the host. Default false."),
|
|
403
|
+
model: ModelConfigSchema.optional().describe(
|
|
404
|
+
"Overrides the parent's model for this loop only. Absent = inherit. `provider` may name a different configured provider than the parent's (e.g. a grok-subscription loop under a chatgpt-subscription host); credentials are resolved by that provider id. A loop whose provider cannot be built does not start."
|
|
405
|
+
),
|
|
406
|
+
// Same bounds as the host's `context.compact_threshold` (positive integer,
|
|
407
|
+
// nullable, optional) — it lands in exactly that field of the derived config,
|
|
408
|
+
// so a rule the host rejects must not be reachable through a loop.
|
|
409
|
+
compact_threshold: external_exports.number().int().positive().nullable().optional().describe(
|
|
410
|
+
"Token count at which this loop auto-compacts its own history. Absent = inherit the parent's `context.compact_threshold`. Exists for the `model` override: a different model has a different context window, so the host trigger point may not suit this loop."
|
|
411
|
+
),
|
|
412
|
+
tools: external_exports.array(external_exports.string().min(1)).max(LOOP_TOOLS_MAX).optional().describe("Absolute allow-list, intersected with host-enabled tools at derive time. Nothing is implicit \u2014 loop_send/loop_list must be listed to be granted.")
|
|
413
|
+
}).superRefine((loop, ctx) => {
|
|
414
|
+
for (let tool of loop.tools ?? [])
|
|
415
|
+
PROHIBITED_LOOP_TOOL_NAMES.includes(tool) && ctx.addIssue({
|
|
416
|
+
code: external_exports.ZodIssueCode.custom,
|
|
417
|
+
message: `loop "${loop.name}" requests prohibited tool "${tool}" (never grantable to an inner loop)`,
|
|
418
|
+
path: ["tools"]
|
|
419
|
+
});
|
|
420
|
+
}), LoopsConfigSchema = external_exports.array(LoopConfigSchema).superRefine((loops, ctx) => {
|
|
421
|
+
let seen = /* @__PURE__ */ new Set();
|
|
422
|
+
loops.forEach((loop, index) => {
|
|
423
|
+
let key = loop.name.toLowerCase();
|
|
424
|
+
seen.has(key) && ctx.addIssue({
|
|
425
|
+
code: external_exports.ZodIssueCode.custom,
|
|
426
|
+
message: `duplicate loop name "${loop.name}"`,
|
|
427
|
+
path: [index, "name"]
|
|
428
|
+
}), seen.add(key);
|
|
429
|
+
});
|
|
430
|
+
}), PreLlmHookConfigSchema = external_exports.object({
|
|
431
|
+
source: external_exports.string().min(1),
|
|
432
|
+
scope: external_exports.enum(["all", "main", "loops"]).default("all"),
|
|
433
|
+
loops: external_exports.array(external_exports.string().regex(/^[a-z0-9][a-z0-9_-]{0,31}$/)).min(1).max(64).optional(),
|
|
434
|
+
include_main: external_exports.boolean().optional(),
|
|
435
|
+
timeout_ms: external_exports.number().int().min(1e3).max(3e5).optional()
|
|
436
|
+
}).superRefine((hook, ctx) => {
|
|
437
|
+
if (hook.scope === "loops") {
|
|
438
|
+
if (!hook.loops || hook.loops.length === 0) {
|
|
439
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: 'loops is required when pre_llm_hook.scope is "loops"', path: ["loops"] });
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
let seen = /* @__PURE__ */ new Set();
|
|
443
|
+
hook.loops.forEach((name, index) => {
|
|
444
|
+
name === "main" && ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: 'main is not an inner-loop target; use scope "main" or "all"', path: ["loops", index] }), seen.has(name) && ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `duplicate loop name "${name}"`, path: ["loops", index] }), seen.add(name);
|
|
445
|
+
});
|
|
446
|
+
} else hook.loops !== void 0 && ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: 'loops is only allowed when pre_llm_hook.scope is "loops"', path: ["loops"] });
|
|
447
|
+
hook.scope !== "loops" && hook.include_main !== void 0 && ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: 'include_main is only allowed when pre_llm_hook.scope is "loops"', path: ["include_main"] });
|
|
448
|
+
}), AgentConfigSchema = external_exports.object({
|
|
449
|
+
adf_version: external_exports.literal("0.2"),
|
|
450
|
+
id: external_exports.string().min(1),
|
|
451
|
+
name: external_exports.string().min(1).max(100),
|
|
452
|
+
description: external_exports.string().max(2e3).default(""),
|
|
453
|
+
icon: external_exports.string().optional(),
|
|
454
|
+
handle: external_exports.string().regex(/^[a-z0-9][a-z0-9-]*$/).max(64).optional(),
|
|
455
|
+
reply_to: external_exports.string().optional(),
|
|
456
|
+
// deprecated — use card.endpoints.inbox
|
|
457
|
+
card: CardOverridesSchema.optional(),
|
|
458
|
+
state: external_exports.enum(AGENT_STATES).default("active"),
|
|
459
|
+
start_in_state: external_exports.enum(START_IN_STATES).optional(),
|
|
460
|
+
autonomous: external_exports.boolean().default(!1),
|
|
461
|
+
autostart: external_exports.boolean().optional(),
|
|
462
|
+
model: ModelConfigSchema,
|
|
463
|
+
instructions: external_exports.string().min(1),
|
|
464
|
+
include_base_prompt: external_exports.boolean().optional(),
|
|
465
|
+
bare_prompt: external_exports.boolean().optional(),
|
|
466
|
+
context: external_exports.object({
|
|
467
|
+
compact_threshold: external_exports.number().int().positive().nullable().optional(),
|
|
468
|
+
audit: external_exports.object({
|
|
469
|
+
loop: external_exports.boolean().default(!0),
|
|
470
|
+
inbox: external_exports.boolean().default(!1),
|
|
471
|
+
outbox: external_exports.boolean().default(!1),
|
|
472
|
+
files: external_exports.boolean().default(!1)
|
|
473
|
+
}).optional(),
|
|
474
|
+
dynamic_instructions: external_exports.object({
|
|
475
|
+
inbox_hints: external_exports.boolean().optional(),
|
|
476
|
+
context_warning: external_exports.boolean().optional(),
|
|
477
|
+
idle_reminder: external_exports.boolean().optional(),
|
|
478
|
+
mesh_updates: external_exports.boolean().optional()
|
|
479
|
+
}).optional()
|
|
480
|
+
}),
|
|
481
|
+
tools: external_exports.array(ToolDeclarationSchema).default([]),
|
|
482
|
+
triggers: TriggersConfigV3Schema,
|
|
483
|
+
security: external_exports.object({
|
|
484
|
+
allow_unsigned: external_exports.boolean().default(!0),
|
|
485
|
+
level: external_exports.union([external_exports.literal(0), external_exports.literal(1), external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
486
|
+
require_signature: external_exports.boolean().optional(),
|
|
487
|
+
require_payload_signature: external_exports.boolean().optional(),
|
|
488
|
+
middleware: external_exports.object({
|
|
489
|
+
inbox: external_exports.array(MiddlewareRefSchema).optional(),
|
|
490
|
+
outbox: external_exports.array(MiddlewareRefSchema).optional()
|
|
491
|
+
}).optional(),
|
|
492
|
+
fetch_middleware: external_exports.array(MiddlewareRefSchema).optional(),
|
|
493
|
+
require_middleware_authorization: external_exports.boolean().default(!0),
|
|
494
|
+
allow_local_fetch: external_exports.boolean().optional().describe("Opt out of the sys_fetch SSRF guard. When false/absent, sys_fetch refuses loopback, link-local and RFC1918/CGNAT destinations (including after DNS resolution and across redirects)."),
|
|
495
|
+
table_protections: external_exports.record(external_exports.enum(["none", "append_only", "authorized"])).optional()
|
|
496
|
+
}),
|
|
497
|
+
limits: external_exports.object({
|
|
498
|
+
execution_timeout_ms: external_exports.number().int().positive().default(6e4),
|
|
499
|
+
max_file_read_tokens: external_exports.number().int().positive().default(3e4),
|
|
500
|
+
max_file_write_bytes: external_exports.number().int().positive().default(5e6),
|
|
501
|
+
max_tool_result_tokens: external_exports.number().int().positive().default(16e3),
|
|
502
|
+
max_tool_result_preview_chars: external_exports.number().int().positive().default(5e3),
|
|
503
|
+
max_active_turns: external_exports.number().int().positive().nullable().default(null),
|
|
504
|
+
max_image_size_bytes: external_exports.number().int().positive().optional(),
|
|
505
|
+
max_audio_size_bytes: external_exports.number().int().positive().optional(),
|
|
506
|
+
max_video_size_bytes: external_exports.number().int().positive().optional(),
|
|
507
|
+
suspend_timeout_ms: external_exports.number().int().positive().optional(),
|
|
508
|
+
hibernate_nudge: external_exports.object({
|
|
509
|
+
enabled: external_exports.boolean(),
|
|
510
|
+
interval_ms: external_exports.number().int().positive()
|
|
511
|
+
}).optional()
|
|
512
|
+
}),
|
|
513
|
+
recovery: external_exports.object({
|
|
514
|
+
auto_retry: external_exports.boolean().default(!0).describe("Retry the failed turn automatically after a transient provider error (rate limit, overload, network)."),
|
|
515
|
+
max_attempts: external_exports.number().int().positive().max(100).default(5),
|
|
516
|
+
// Bounded: values past ~2^31 ms overflow Node's setTimeout to 1ms, turning
|
|
517
|
+
// backoff into a hot retry loop against an already-failing provider.
|
|
518
|
+
base_delay_ms: external_exports.number().int().positive().max(36e5).default(15e3),
|
|
519
|
+
max_delay_ms: external_exports.number().int().positive().max(864e5).default(3e5)
|
|
520
|
+
}).optional(),
|
|
521
|
+
pre_llm_hook: PreLlmHookConfigSchema.optional(),
|
|
522
|
+
messaging: external_exports.object({
|
|
523
|
+
receive: external_exports.boolean().optional().default(!0).describe("Whether the agent participates in the mesh and can receive messages."),
|
|
524
|
+
mode: external_exports.enum(MESSAGING_MODES).default("proactive"),
|
|
525
|
+
visibility: external_exports.enum(["directory", "localhost", "lan", "public", "off"]).default("localhost"),
|
|
526
|
+
inbox_mode: external_exports.boolean().optional(),
|
|
527
|
+
allow_list: external_exports.array(external_exports.string()).optional(),
|
|
528
|
+
block_list: external_exports.array(external_exports.string()).optional(),
|
|
529
|
+
network: external_exports.string().optional().describe("ALF network identifier. Default: 'devnet'.")
|
|
530
|
+
}),
|
|
531
|
+
audit: external_exports.object({
|
|
532
|
+
loop: external_exports.boolean().default(!0),
|
|
533
|
+
inbox: external_exports.boolean().default(!1),
|
|
534
|
+
outbox: external_exports.boolean().default(!1),
|
|
535
|
+
files: external_exports.boolean().default(!1)
|
|
536
|
+
}).optional(),
|
|
537
|
+
code_execution: external_exports.object({
|
|
538
|
+
model_invoke: external_exports.boolean().default(!0),
|
|
539
|
+
sys_lambda: external_exports.boolean().default(!0),
|
|
540
|
+
task_resolve: external_exports.boolean().default(!0),
|
|
541
|
+
loop_inject: external_exports.boolean().default(!0),
|
|
542
|
+
identity_status: external_exports.boolean().default(!0),
|
|
543
|
+
get_identity: external_exports.boolean().default(!0),
|
|
544
|
+
set_identity: external_exports.boolean().default(!0),
|
|
545
|
+
attestation_list: external_exports.boolean().default(!0),
|
|
546
|
+
attestation_add: external_exports.boolean().default(!0),
|
|
547
|
+
attestation_issue: external_exports.boolean().default(!0),
|
|
548
|
+
network: external_exports.boolean().optional(),
|
|
549
|
+
packages: external_exports.array(external_exports.object({
|
|
550
|
+
name: external_exports.string().min(1),
|
|
551
|
+
version: external_exports.string().min(1)
|
|
552
|
+
})).max(50).optional(),
|
|
553
|
+
restricted_methods: external_exports.array(external_exports.string()).optional()
|
|
554
|
+
}).optional(),
|
|
555
|
+
/** @deprecated Packages moved to code_execution.packages. */
|
|
556
|
+
sandbox: external_exports.object({
|
|
557
|
+
packages: external_exports.array(external_exports.object({
|
|
558
|
+
name: external_exports.string().min(1),
|
|
559
|
+
version: external_exports.string().optional(),
|
|
560
|
+
enabled: external_exports.boolean()
|
|
561
|
+
})).optional()
|
|
562
|
+
}).optional(),
|
|
563
|
+
compute: external_exports.object({
|
|
564
|
+
enabled: external_exports.boolean().default(!1),
|
|
565
|
+
packages: external_exports.object({
|
|
566
|
+
npm: external_exports.array(external_exports.string()).max(100).optional(),
|
|
567
|
+
pip: external_exports.array(external_exports.string()).max(100).optional()
|
|
568
|
+
}).optional(),
|
|
569
|
+
target: external_exports.string().min(1).optional(),
|
|
570
|
+
allowed_targets: external_exports.array(external_exports.string().min(1)).max(20).optional(),
|
|
571
|
+
default_target: external_exports.string().min(1).optional(),
|
|
572
|
+
host_access: external_exports.boolean().optional(),
|
|
573
|
+
browser: external_exports.boolean().optional().describe("Run the visible desktop (X server, Openbox, tint2, noVNC, managed Chromium) in the isolated container and show the Computer tab (default true). false = headless-only, no viewer.")
|
|
574
|
+
}).optional(),
|
|
575
|
+
logging: LoggingConfigSchema.optional(),
|
|
576
|
+
adapters: external_exports.record(AdapterInstanceConfigSchema).optional(),
|
|
577
|
+
serving: ServingConfigSchema.optional(),
|
|
578
|
+
ws_connections: external_exports.array(WsConnectionConfigSchema).optional(),
|
|
579
|
+
stream_bind: StreamBindConfigSchema.optional(),
|
|
580
|
+
stream_bindings: external_exports.array(StreamBindingDeclarationSchema).optional(),
|
|
581
|
+
umbilical_taps: external_exports.array(external_exports.object({
|
|
582
|
+
name: external_exports.string().min(1),
|
|
583
|
+
lambda: external_exports.string().min(1),
|
|
584
|
+
filter: external_exports.object({
|
|
585
|
+
event_types: external_exports.array(external_exports.string()).default(["*"]),
|
|
586
|
+
when: external_exports.string().optional(),
|
|
587
|
+
allow_wildcard: external_exports.boolean().default(!1)
|
|
588
|
+
}).default({ event_types: ["*"], allow_wildcard: !1 }),
|
|
589
|
+
exclude_own_origin: external_exports.boolean().default(!0),
|
|
590
|
+
max_rate_per_sec: external_exports.number().int().positive().default(100)
|
|
591
|
+
}).superRefine((tap, ctx) => {
|
|
592
|
+
usesWildcardEventTypes(tap.filter.event_types) && !tap.filter.allow_wildcard && ctx.addIssue({
|
|
593
|
+
code: external_exports.ZodIssueCode.custom,
|
|
594
|
+
message: `umbilical_tap "${tap.name}" uses wildcard event_types (${tap.filter.event_types.join(", ")}) but allow_wildcard is not true.`,
|
|
595
|
+
path: ["filter", "allow_wildcard"]
|
|
596
|
+
}), warnUnknownEventTypes(`umbilical_tap "${tap.name}"`, tap.filter.event_types);
|
|
597
|
+
})).default([]),
|
|
598
|
+
// Opt-in umbilical emission knobs. Absent/false keeps the default (quiet) behaviour.
|
|
599
|
+
umbilical: external_exports.object({
|
|
600
|
+
stream_deltas: external_exports.boolean().optional(),
|
|
601
|
+
// In-memory replay window for reconnecting observers. Nothing is persisted.
|
|
602
|
+
log: external_exports.object({
|
|
603
|
+
enabled: external_exports.boolean().optional(),
|
|
604
|
+
max_events: external_exports.number().int().positive().optional(),
|
|
605
|
+
exclude_types: external_exports.array(external_exports.string()).optional()
|
|
606
|
+
}).optional()
|
|
607
|
+
}).optional(),
|
|
608
|
+
providers: external_exports.array(external_exports.object({
|
|
609
|
+
id: external_exports.string().min(1),
|
|
610
|
+
type: external_exports.enum(["anthropic", "openai", "openai-compatible", "openrouter"]),
|
|
611
|
+
name: external_exports.string(),
|
|
612
|
+
baseUrl: external_exports.string(),
|
|
613
|
+
preset: external_exports.string().optional(),
|
|
614
|
+
defaultModel: external_exports.string().optional(),
|
|
615
|
+
params: external_exports.array(external_exports.object({ key: external_exports.string(), value: external_exports.string() })).optional(),
|
|
616
|
+
requestDelayMs: external_exports.number().optional()
|
|
617
|
+
})).optional(),
|
|
618
|
+
// Side loops only; 'main' is implicit. Absent = none — pre-loops files stay
|
|
619
|
+
// byte-identical because nothing writes the empty array back.
|
|
620
|
+
loops: LoopsConfigSchema.optional(),
|
|
621
|
+
mcp: external_exports.object({
|
|
622
|
+
servers: external_exports.array(external_exports.object({
|
|
623
|
+
name: external_exports.string(),
|
|
624
|
+
transport: external_exports.enum(["stdio", "http"]),
|
|
625
|
+
command: external_exports.string().optional(),
|
|
626
|
+
args: external_exports.array(external_exports.string()).optional(),
|
|
627
|
+
url: external_exports.string().optional(),
|
|
628
|
+
// Remote HTTP endpoint uses interactive OAuth (browser sign-in) instead
|
|
629
|
+
// of a static bearer/header token. Must survive `.adf` round-trips — the
|
|
630
|
+
// connect paths key their sealed token by the pinned url when this is set.
|
|
631
|
+
oauth: external_exports.boolean().optional(),
|
|
632
|
+
headers: external_exports.record(external_exports.string()).optional(),
|
|
633
|
+
header_env: external_exports.array(external_exports.object({
|
|
634
|
+
header: external_exports.string(),
|
|
635
|
+
env: external_exports.string(),
|
|
636
|
+
required: external_exports.boolean().optional(),
|
|
637
|
+
credential_ref: external_exports.string().optional()
|
|
638
|
+
})).optional(),
|
|
639
|
+
bearer_token_env_var: external_exports.string().optional(),
|
|
640
|
+
env: external_exports.record(external_exports.string()).optional(),
|
|
641
|
+
env_keys: external_exports.array(external_exports.string()).optional(),
|
|
642
|
+
env_schema: external_exports.array(external_exports.object({
|
|
643
|
+
key: external_exports.string(),
|
|
644
|
+
scope: external_exports.enum(["agent", "app"]),
|
|
645
|
+
required: external_exports.boolean().optional(),
|
|
646
|
+
description: external_exports.string().optional(),
|
|
647
|
+
credential_ref: external_exports.string().optional()
|
|
648
|
+
})).optional(),
|
|
649
|
+
npm_package: external_exports.string().optional(),
|
|
650
|
+
pypi_package: external_exports.string().optional(),
|
|
651
|
+
source: external_exports.string().optional(),
|
|
652
|
+
tool_call_timeout_ms: external_exports.number().positive().optional(),
|
|
653
|
+
available_tools: external_exports.array(external_exports.object({
|
|
654
|
+
name: external_exports.string(),
|
|
655
|
+
description: external_exports.string().optional(),
|
|
656
|
+
input_schema: external_exports.record(external_exports.unknown())
|
|
657
|
+
})).optional(),
|
|
658
|
+
restricted: external_exports.boolean().optional(),
|
|
659
|
+
host_requested: external_exports.boolean().optional(),
|
|
660
|
+
run_location: external_exports.enum(["host", "shared"]).optional(),
|
|
661
|
+
credential_files: external_exports.array(external_exports.object({
|
|
662
|
+
path: external_exports.string().min(1),
|
|
663
|
+
required: external_exports.boolean().optional(),
|
|
664
|
+
write_back: external_exports.boolean().optional()
|
|
665
|
+
})).optional()
|
|
666
|
+
})),
|
|
667
|
+
new_tools_restricted: external_exports.boolean().optional()
|
|
668
|
+
}).optional(),
|
|
669
|
+
metadata: external_exports.object({
|
|
670
|
+
created_at: external_exports.string(),
|
|
671
|
+
updated_at: external_exports.string(),
|
|
672
|
+
author: external_exports.string().optional(),
|
|
673
|
+
tags: external_exports.array(external_exports.string()).optional(),
|
|
674
|
+
version: external_exports.string().optional()
|
|
675
|
+
})
|
|
676
|
+
}), TimerOnceSchema = external_exports.object({
|
|
677
|
+
mode: external_exports.literal("once"),
|
|
678
|
+
at: external_exports.number().int().positive()
|
|
679
|
+
}), TimerIntervalSchema = external_exports.object({
|
|
680
|
+
mode: external_exports.literal("interval"),
|
|
681
|
+
every_ms: external_exports.number().int().positive(),
|
|
682
|
+
start_at: external_exports.number().int().positive().optional(),
|
|
683
|
+
end_at: external_exports.number().int().positive().optional(),
|
|
684
|
+
max_runs: external_exports.number().int().positive().optional()
|
|
685
|
+
}), TimerCronSchema = external_exports.object({
|
|
686
|
+
mode: external_exports.literal("cron"),
|
|
687
|
+
cron: external_exports.string(),
|
|
688
|
+
end_at: external_exports.number().int().positive().optional(),
|
|
689
|
+
max_runs: external_exports.number().int().positive().optional()
|
|
690
|
+
}), TimerScheduleSchema = external_exports.discriminatedUnion("mode", [
|
|
691
|
+
TimerOnceSchema,
|
|
692
|
+
TimerIntervalSchema,
|
|
693
|
+
TimerCronSchema
|
|
694
|
+
]);
|
|
695
|
+
|
|
696
|
+
export {
|
|
697
|
+
ToolDeclarationSchema,
|
|
698
|
+
TriggersConfigV3Schema,
|
|
699
|
+
ServingApiRouteSchema,
|
|
700
|
+
WsConnectionConfigSchema,
|
|
701
|
+
UmbilicalFilterSchema,
|
|
702
|
+
StreamBindEndpointSchema,
|
|
703
|
+
BindOptionsSchema,
|
|
704
|
+
StreamBindingDeclarationSchema,
|
|
705
|
+
StreamBindConfigSchema,
|
|
706
|
+
ServingPublicConfigSchema,
|
|
707
|
+
ServingSharedConfigSchema,
|
|
708
|
+
ServingConfigSchema,
|
|
709
|
+
AdapterInstanceConfigSchema,
|
|
710
|
+
ModelConfigSchema,
|
|
711
|
+
LOOP_NAME_PATTERN,
|
|
712
|
+
LOOP_NAME_RULE,
|
|
713
|
+
LOOP_GOAL_MAX_CHARS,
|
|
714
|
+
LOOP_TOOLS_MAX,
|
|
715
|
+
MAX_SIDE_LOOPS,
|
|
716
|
+
LoopConfigSchema,
|
|
717
|
+
LoopsConfigSchema,
|
|
718
|
+
PreLlmHookConfigSchema,
|
|
719
|
+
AgentConfigSchema,
|
|
720
|
+
TimerScheduleSchema
|
|
721
|
+
};
|