@finalai/agent-definition 0.1.3 → 0.1.4
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/HOSTING.md +69 -0
- package/dist/compiler-assets/{chunk-BEFBCBUL.ts → chunk-4A66SVBJ.ts} +1 -1
- package/dist/compiler-assets/{chunk-5IZTHCGZ.ts → chunk-5NTKRRMC.ts} +105 -14
- package/dist/compiler-assets/{chunk-OO67EO5E.ts → chunk-APU2VKLW.ts} +42 -3
- package/dist/compiler-assets/{chunk-3YAKMWV4.ts → chunk-RIEMTCTV.ts} +6 -2
- package/dist/compiler-assets/{chunk-JXJPBM5W.ts → chunk-TJ536HI4.ts} +1 -1
- package/dist/compiler-assets/{chunk-I6U47R5U.ts → chunk-UBR53WBH.ts} +20 -4
- package/dist/compiler-assets/{chunk-FHKYXT3F.ts → chunk-YW7HDGQA.ts} +1 -1
- package/dist/compiler-assets/{chunk-TCKYMNPM.ts → chunk-YWFGIPHD.ts} +3 -3
- package/dist/compiler-assets/{chunk-TS7XNNHN.ts → chunk-Z5TO7RSJ.ts} +4 -2
- package/dist/compiler-assets/src/authoring/approval.ts +2 -2
- package/dist/compiler-assets/src/authoring/connections.ts +2 -2
- package/dist/compiler-assets/src/authoring/harness.ts +3 -3
- package/dist/compiler-assets/src/authoring/index.ts +5 -5
- package/dist/compiler-assets/src/authoring/sandbox.ts +2 -2
- package/dist/compiler-assets/src/compatibility.ts +2 -2
- package/dist/compiler-assets/src/index.ts +10 -6
- package/dist/compiler-assets/src/manifest.ts +5 -1
- package/dist/compiler-assets/src/resolve.ts +2 -2
- package/dist/compiler-assets/src/runtime/bundle.ts +5 -5
- package/dist/compiler-assets/src/runtime/describe.ts +4 -4
- package/dist/compiler-assets/src/runtime/described.ts +6 -4
- package/dist/compiler-assets/src/runtime/isolate.ts +4 -4
- package/dist/compiler-assets/src/runtime/lower.ts +3 -3
- package/dist/modules/authoring/agent.d.mts +3 -2
- package/dist/modules/authoring/agent.mjs.map +2 -2
- package/dist/modules/authoring/connections.d.mts +10 -2
- package/dist/modules/authoring/connections.mjs.map +2 -2
- package/dist/modules/authoring/harness.mjs +2 -0
- package/dist/modules/authoring/harness.mjs.map +2 -2
- package/dist/modules/authoring/index.d.mts +1 -1
- package/dist/modules/authoring/index.mjs.map +2 -2
- package/dist/modules/compiler/assemble.mjs +1 -1
- package/dist/modules/compiler/assemble.mjs.map +2 -2
- package/dist/modules/manifest.d.mts +2 -2
- package/dist/modules/manifest.mjs +4 -0
- package/dist/modules/manifest.mjs.map +2 -2
- package/dist/modules/runtime/describe.mjs +17 -3
- package/dist/modules/runtime/describe.mjs.map +2 -2
- package/dist/modules/runtime/described.d.mts +4 -4
- package/dist/modules/runtime/described.mjs +6 -2
- package/dist/modules/runtime/described.mjs.map +2 -2
- package/dist/modules/runtime/lower.mjs +76 -14
- package/dist/modules/runtime/lower.mjs.map +2 -2
- package/fixtures/assistant/agent/agent.ts +7 -0
- package/package.json +3 -3
package/HOSTING.md
CHANGED
|
@@ -66,6 +66,75 @@ other hosted connection. `binding`
|
|
|
66
66
|
selects another name. Existing explicit `url` calls remain static and compatible;
|
|
67
67
|
they always point at that URL. There is no Final-specific compiler rewrite.
|
|
68
68
|
|
|
69
|
+
## Connection tool policy
|
|
70
|
+
|
|
71
|
+
`tools.allow`, `tools.deny` and `tools.approval` keys are tool names or `*`
|
|
72
|
+
patterns, so a definition can scope a connection whose tool list it does not know:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
export default defineFinalConnection({
|
|
76
|
+
tools: {
|
|
77
|
+
allow: ['github.*', 'list_goals'],
|
|
78
|
+
deny: ['github.delete_repo'],
|
|
79
|
+
approval: { 'github.delete_*': always() },
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`*` matches any run of characters; everything else matches literally. `deny` wins
|
|
85
|
+
over `allow`. The most specific key governs a tool: an exact name, else the matching
|
|
86
|
+
pattern with the most literal characters, with ties resolved toward `ask`. Hosts
|
|
87
|
+
enforce this through `isToolExposed` and `toolApprovalOf` from
|
|
88
|
+
`@finalai/agent-provider`, and look up a tool's input-approval predicate under the
|
|
89
|
+
key `resolveToolApprovalKey` returns.
|
|
90
|
+
|
|
91
|
+
## Loaded and searchable tools
|
|
92
|
+
|
|
93
|
+
A connection that can expose many tools, such as Final's with every service the
|
|
94
|
+
person has connected, can name the ones the harness should list up front:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
export default defineFinalConnection({
|
|
98
|
+
tools: { load: ['list_goals', 'get_goal', 'draft_goal', 'notify_user'] },
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Without `load`, the harness lists every exposed tool, as before. With it, the host
|
|
103
|
+
lists only the loaded tools and must keep every other exposed tool reachable: it
|
|
104
|
+
serves a search over the connection's remaining exposed tools (name, description,
|
|
105
|
+
input schema) and a call that runs a found tool by its real name, with the same
|
|
106
|
+
exposure and approval checks as a direct call. A host may instead add a found tool
|
|
107
|
+
to the list and send `notifications/tools/list_changed`; harnesses that ignore that
|
|
108
|
+
notification still need the call path. `load: []` leaves every tool to search.
|
|
109
|
+
Entries are tool names or `*` patterns. `isToolLoaded` from `@finalai/agent-provider`
|
|
110
|
+
applies the rule after exposure.
|
|
111
|
+
|
|
112
|
+
## Selecting tools by annotation
|
|
113
|
+
|
|
114
|
+
`tools.allow` and `tools.deny` entries can be MCP annotation selectors as well as
|
|
115
|
+
tool names, so a definition can scope tools it cannot name in advance:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
export default defineFinalConnection({
|
|
119
|
+
tools: {
|
|
120
|
+
allow: ['list_goals', 'draft_goal', { readOnlyHint: true }],
|
|
121
|
+
deny: [{ destructiveHint: true, readOnlyHint: false }],
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A selector matches when every hint it sets equals the tool's hint, reading hints the
|
|
127
|
+
tool omits as the MCP spec's defaults (not read-only, destructive, not idempotent,
|
|
128
|
+
open world). The annotations come from the connection's server, so select on them
|
|
129
|
+
only for servers trusted to classify their own tools.
|
|
130
|
+
|
|
131
|
+
Selectors lower to `allowAnnotations` (each with the connection default approval and
|
|
132
|
+
input predicate) and `denyAnnotations`. A host exposes a tool when nothing in `deny`
|
|
133
|
+
or `denyAnnotations` matches it and either an `approvals` key (name or pattern)
|
|
134
|
+
governs it, `approvals` is null, or `toolAnnotationRuleFor` finds a rule; a tool an
|
|
135
|
+
`approvals` key governs keeps that approval, otherwise it runs under the rule's. `tools.approval` overrides apply only to
|
|
136
|
+
named tools.
|
|
137
|
+
|
|
69
138
|
## Resources and provider packages
|
|
70
139
|
|
|
71
140
|
`HostedBindingsIface` is the shared `@finalai/agent-provider` contract. Hosting
|
|
@@ -3,7 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-2ZRYQO4Q.ts";
|
|
4
4
|
import {
|
|
5
5
|
lowerApproval
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4A66SVBJ.ts";
|
|
7
|
+
import {
|
|
8
|
+
toolAnnotationSelectorSchema
|
|
9
|
+
} from "./chunk-APU2VKLW.ts";
|
|
7
10
|
import {
|
|
8
11
|
jsonSchemaDeclarationError
|
|
9
12
|
} from "./chunk-W6DOJA4W.ts";
|
|
@@ -38,9 +41,39 @@ import {
|
|
|
38
41
|
string,
|
|
39
42
|
toJSONSchema,
|
|
40
43
|
union,
|
|
44
|
+
unknown,
|
|
41
45
|
url
|
|
42
46
|
} from "./chunk-3K4C4SVG.ts";
|
|
43
47
|
|
|
48
|
+
// ../agent-provider/src/tool-patterns.ts
|
|
49
|
+
var TOOL_PATTERN_WILDCARD = "*";
|
|
50
|
+
var toolPatternMatches = (pattern, name) => {
|
|
51
|
+
let patternIndex = 0;
|
|
52
|
+
let nameIndex = 0;
|
|
53
|
+
let starIndex = -1;
|
|
54
|
+
let resumeIndex = 0;
|
|
55
|
+
while (nameIndex < name.length) {
|
|
56
|
+
const char = pattern[patternIndex];
|
|
57
|
+
if (char === TOOL_PATTERN_WILDCARD) {
|
|
58
|
+
starIndex = patternIndex;
|
|
59
|
+
resumeIndex = nameIndex;
|
|
60
|
+
patternIndex += 1;
|
|
61
|
+
} else if (char != null && char === name[nameIndex]) {
|
|
62
|
+
patternIndex += 1;
|
|
63
|
+
nameIndex += 1;
|
|
64
|
+
} else if (starIndex !== -1) {
|
|
65
|
+
patternIndex = starIndex + 1;
|
|
66
|
+
resumeIndex += 1;
|
|
67
|
+
nameIndex = resumeIndex;
|
|
68
|
+
} else {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
while (pattern[patternIndex] === TOOL_PATTERN_WILDCARD) patternIndex += 1;
|
|
73
|
+
return patternIndex === pattern.length;
|
|
74
|
+
};
|
|
75
|
+
var isToolDenied = (deny, name) => deny?.some((pattern) => toolPatternMatches(pattern, name)) === true;
|
|
76
|
+
|
|
44
77
|
// src/runtime/lower.ts
|
|
45
78
|
var IssueSeverity = /* @__PURE__ */ ((IssueSeverity2) => {
|
|
46
79
|
IssueSeverity2["Error"] = "error";
|
|
@@ -236,9 +269,10 @@ var authoredConnectionSchema = looseObject({
|
|
|
236
269
|
approval: optionalValueSchema,
|
|
237
270
|
toolCall: optionalValueSchema,
|
|
238
271
|
tools: looseObject({
|
|
239
|
-
allow: array(
|
|
240
|
-
deny: array(
|
|
241
|
-
approval: authoredRecordSchema.optional()
|
|
272
|
+
allow: array(unknown()).optional(),
|
|
273
|
+
deny: array(unknown()).optional(),
|
|
274
|
+
approval: authoredRecordSchema.optional(),
|
|
275
|
+
load: array(string()).optional()
|
|
242
276
|
}).optional()
|
|
243
277
|
});
|
|
244
278
|
var connectionAuthSchema = union([
|
|
@@ -263,6 +297,25 @@ var lowerAuth = (value, path, issues) => {
|
|
|
263
297
|
);
|
|
264
298
|
return null;
|
|
265
299
|
};
|
|
300
|
+
var splitToolEntries = (args) => {
|
|
301
|
+
const names = [];
|
|
302
|
+
const selectors = [];
|
|
303
|
+
for (const entry of args.entries) {
|
|
304
|
+
if (isString(entry)) {
|
|
305
|
+
names.push(entry);
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
const parsed = toolAnnotationSelectorSchema.safeParse(entry);
|
|
309
|
+
if (parsed.success) selectors.push(parsed.data);
|
|
310
|
+
else
|
|
311
|
+
args.issues.push(
|
|
312
|
+
error(
|
|
313
|
+
`${args.label} entries must be tool names, * patterns, or annotation selectors such as { readOnlyHint: true }`
|
|
314
|
+
)
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
return { names, selectors };
|
|
318
|
+
};
|
|
266
319
|
var lowerConnection = (args) => {
|
|
267
320
|
const issues = [];
|
|
268
321
|
const path = `connection ${args.key}`;
|
|
@@ -301,12 +354,29 @@ var lowerConnection = (args) => {
|
|
|
301
354
|
const overrides = Object.fromEntries(overrideEntries);
|
|
302
355
|
const inputApprovals = Object.fromEntries(inputApprovalEntries);
|
|
303
356
|
for (const key of staticOverrideKeys) delete inputApprovals[key];
|
|
304
|
-
const defaultPolicy = overrides[
|
|
305
|
-
const
|
|
357
|
+
const defaultPolicy = overrides[TOOL_PATTERN_WILDCARD] ?? defaultApproval.policy;
|
|
358
|
+
const allowEntries = tools?.allow == null ? null : splitToolEntries({ entries: tools.allow, label: `${path} tools.allow`, issues });
|
|
359
|
+
const allow = allowEntries?.names ?? null;
|
|
360
|
+
const allowSelectors = allowEntries?.selectors ?? [];
|
|
361
|
+
const denyEntries = splitToolEntries({
|
|
362
|
+
entries: tools?.deny ?? [],
|
|
363
|
+
label: `${path} tools.deny`,
|
|
364
|
+
issues
|
|
365
|
+
});
|
|
366
|
+
const deny = denyEntries.names;
|
|
367
|
+
const authoredEntries = {
|
|
368
|
+
allow: allow ?? [],
|
|
369
|
+
deny,
|
|
370
|
+
approval: Object.keys(overrides)
|
|
371
|
+
};
|
|
372
|
+
for (const [field, entries] of Object.entries(authoredEntries)) {
|
|
373
|
+
if (entries.some((entry) => entry.trim().length === 0))
|
|
374
|
+
issues.push(error(`${path} tools.${field} entries must be tool names or * patterns`));
|
|
375
|
+
}
|
|
376
|
+
const inherited = Object.hasOwn(inputApprovals, "*") ? inputApprovals["*"] : void 0;
|
|
306
377
|
let approvals = null;
|
|
307
378
|
if (allow != null) {
|
|
308
379
|
approvals = Object.fromEntries(allow.map((tool) => [tool, overrides[tool] ?? defaultPolicy]));
|
|
309
|
-
const inherited = Object.hasOwn(inputApprovals, "*") ? inputApprovals["*"] : void 0;
|
|
310
380
|
if (inherited != null) {
|
|
311
381
|
for (const tool of allow) {
|
|
312
382
|
if (!Object.hasOwn(overrides, tool))
|
|
@@ -319,20 +389,33 @@ var lowerConnection = (args) => {
|
|
|
319
389
|
}
|
|
320
390
|
}
|
|
321
391
|
for (const tool of Object.keys(overrides)) {
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
392
|
+
if (tool === TOOL_PATTERN_WILDCARD || allow.includes(tool)) continue;
|
|
393
|
+
if (allow.some((pattern) => toolPatternMatches(pattern, tool))) {
|
|
394
|
+
approvals[tool] = overrides[tool] ?? defaultPolicy;
|
|
395
|
+
continue;
|
|
326
396
|
}
|
|
397
|
+
issues.push(
|
|
398
|
+
warning(
|
|
399
|
+
allowSelectors.length > 0 ? `${path} sets an approval for ${tool}, which tools.allow does not name; approvals apply only to named tools` : `${path} sets an approval for ${tool}, which tools.allow does not expose`
|
|
400
|
+
)
|
|
401
|
+
);
|
|
327
402
|
}
|
|
328
403
|
} else if (defaultApproval.policy === "ask" /* Ask */ || Object.keys(overrides).length > 0) {
|
|
329
404
|
approvals = { "*": defaultApproval.policy, ...overrides };
|
|
330
405
|
}
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
if (Object.hasOwn(overrides, tool))
|
|
406
|
+
for (const tool of Object.keys(overrides)) {
|
|
407
|
+
if (tool !== TOOL_PATTERN_WILDCARD && isToolDenied(deny, tool))
|
|
334
408
|
issues.push(warning(`${path} sets an approval for ${tool}, which tools.deny hides`));
|
|
335
409
|
}
|
|
410
|
+
const load = tools?.load ?? null;
|
|
411
|
+
if (load?.some((tool) => tool.trim().length === 0) === true)
|
|
412
|
+
issues.push(error(`${path} tools.load entries must be tool names or * patterns`));
|
|
413
|
+
for (const tool of load ?? []) {
|
|
414
|
+
if (isToolDenied(deny, tool))
|
|
415
|
+
issues.push(warning(`${path} loads ${tool}, which tools.deny hides`));
|
|
416
|
+
else if (allow != null && allowSelectors.length === 0 && !allow.some((pattern) => toolPatternMatches(pattern, tool)))
|
|
417
|
+
issues.push(warning(`${path} loads ${tool}, which tools.allow does not expose`));
|
|
418
|
+
}
|
|
336
419
|
if (connection?.toolCall != null)
|
|
337
420
|
issues.push(error(`${path} uses toolCall.providedArguments, which is not supported`));
|
|
338
421
|
const binding = {
|
|
@@ -344,6 +427,14 @@ var lowerConnection = (args) => {
|
|
|
344
427
|
approvals
|
|
345
428
|
};
|
|
346
429
|
if (deny.length > 0) binding.deny = [...new Set(deny)];
|
|
430
|
+
if (load != null) binding.load = [...new Set(load)];
|
|
431
|
+
if (allowSelectors.length > 0)
|
|
432
|
+
binding.allowAnnotations = allowSelectors.map((match) => ({
|
|
433
|
+
match,
|
|
434
|
+
approval: defaultPolicy,
|
|
435
|
+
...inherited == null ? {} : { inputApproval: inherited }
|
|
436
|
+
}));
|
|
437
|
+
if (denyEntries.selectors.length > 0) binding.denyAnnotations = denyEntries.selectors;
|
|
347
438
|
if (Object.keys(inputApprovals).length > 0) binding.inputApprovals = inputApprovals;
|
|
348
439
|
return { binding, issues };
|
|
349
440
|
};
|
|
@@ -17,10 +17,25 @@ import {
|
|
|
17
17
|
object,
|
|
18
18
|
partialRecord,
|
|
19
19
|
record,
|
|
20
|
+
strictObject,
|
|
20
21
|
string,
|
|
21
22
|
union
|
|
22
23
|
} from "./chunk-3K4C4SVG.ts";
|
|
23
24
|
|
|
25
|
+
// ../agent-protocol/src/avatar.ts
|
|
26
|
+
var avatarMediaSchema = discriminatedUnion("type", [
|
|
27
|
+
object({ type: literal("image"), url: string().url() }),
|
|
28
|
+
object({
|
|
29
|
+
type: literal("video"),
|
|
30
|
+
url: string().url(),
|
|
31
|
+
posterUrl: string().url().optional()
|
|
32
|
+
})
|
|
33
|
+
]);
|
|
34
|
+
var agentAvatarSchema = object({
|
|
35
|
+
url: string().url(),
|
|
36
|
+
states: record(string().min(1), avatarMediaSchema).optional()
|
|
37
|
+
});
|
|
38
|
+
|
|
24
39
|
// ../agent-provider/src/provider-ref.ts
|
|
25
40
|
var packageProviderRefSchema = object({
|
|
26
41
|
kind: literal("package" /* Package */),
|
|
@@ -84,7 +99,7 @@ var ScheduleTarget = /* @__PURE__ */ ((ScheduleTarget2) => {
|
|
|
84
99
|
var identitySchema = object({
|
|
85
100
|
name: string().min(1).max(120),
|
|
86
101
|
description: string().max(2e3).nullable(),
|
|
87
|
-
|
|
102
|
+
avatar: agentAvatarSchema.optional()
|
|
88
103
|
});
|
|
89
104
|
var InputApprovalKind = /* @__PURE__ */ ((InputApprovalKind2) => {
|
|
90
105
|
InputApprovalKind2["Tool"] = "tool";
|
|
@@ -122,6 +137,17 @@ var mcpAuthSchema = union([
|
|
|
122
137
|
object({ kind: literal("final-session") })
|
|
123
138
|
]);
|
|
124
139
|
var toolApprovalsSchema = record(string(), nativeEnum(ToolApproval)).nullable();
|
|
140
|
+
var toolAnnotationSelectorSchema = strictObject({
|
|
141
|
+
readOnlyHint: boolean().optional(),
|
|
142
|
+
destructiveHint: boolean().optional(),
|
|
143
|
+
idempotentHint: boolean().optional(),
|
|
144
|
+
openWorldHint: boolean().optional()
|
|
145
|
+
}).refine((selector) => Object.keys(selector).length > 0, "Select at least one annotation");
|
|
146
|
+
var toolAnnotationRuleSchema = object({
|
|
147
|
+
match: toolAnnotationSelectorSchema,
|
|
148
|
+
approval: nativeEnum(ToolApproval),
|
|
149
|
+
inputApproval: inputApprovalSchema.optional()
|
|
150
|
+
});
|
|
125
151
|
var workerMcpServerBindingSchema = object({
|
|
126
152
|
key: string().min(1),
|
|
127
153
|
kind: literal("worker" /* Worker */),
|
|
@@ -135,9 +161,19 @@ var httpMcpServerBindingSchema = object({
|
|
|
135
161
|
auth: mcpAuthSchema.nullable(),
|
|
136
162
|
headers: record(string(), string()).default({}),
|
|
137
163
|
// Null allows every tool the server lists, each with the default approval.
|
|
164
|
+
// Keys are tool names or `*` patterns (./tool-patterns.ts); the most
|
|
165
|
+
// specific matching key governs a tool.
|
|
138
166
|
approvals: toolApprovalsSchema,
|
|
139
|
-
//
|
|
167
|
+
// Tool names or `*` patterns hidden even when `approvals` would expose them.
|
|
140
168
|
deny: array(string().min(1)).optional(),
|
|
169
|
+
// Exposed tools (names or `*` patterns) the harness lists up front. Absent
|
|
170
|
+
// lists every exposed tool; otherwise the host keeps the rest reachable
|
|
171
|
+
// through search (HOSTING.md).
|
|
172
|
+
load: array(string().min(1)).optional(),
|
|
173
|
+
// Tools also exposed by their MCP annotations; named tools keep `approvals`.
|
|
174
|
+
allowAnnotations: array(toolAnnotationRuleSchema).optional(),
|
|
175
|
+
// Tools hidden by their MCP annotations, whatever else exposes them.
|
|
176
|
+
denyAnnotations: array(toolAnnotationSelectorSchema).optional(),
|
|
141
177
|
// The authored resolver that produced this connection, for retained boundary values.
|
|
142
178
|
dynamicResolver: string().min(1).optional(),
|
|
143
179
|
inputApprovals: record(string(), inputApprovalSchema).optional()
|
|
@@ -246,7 +282,7 @@ var skillBundleSchema = object({
|
|
|
246
282
|
});
|
|
247
283
|
var emptyManifest = (name) => ({
|
|
248
284
|
version: MANIFEST_VERSION,
|
|
249
|
-
identity: { name, description: null
|
|
285
|
+
identity: { name, description: null },
|
|
250
286
|
harness: {
|
|
251
287
|
harness: packageRef("@finalai/final-agent-provider/harnesses/serverless-final"),
|
|
252
288
|
config: {}
|
|
@@ -263,6 +299,8 @@ var emptyManifest = (name) => ({
|
|
|
263
299
|
});
|
|
264
300
|
|
|
265
301
|
export {
|
|
302
|
+
avatarMediaSchema,
|
|
303
|
+
agentAvatarSchema,
|
|
266
304
|
providerRefSchema,
|
|
267
305
|
bundleRef,
|
|
268
306
|
formatProviderRef,
|
|
@@ -276,6 +314,7 @@ export {
|
|
|
276
314
|
identitySchema,
|
|
277
315
|
toolDescriptorSchema,
|
|
278
316
|
mcpAuthSchema,
|
|
317
|
+
toolAnnotationSelectorSchema,
|
|
279
318
|
workerMcpServerBindingSchema,
|
|
280
319
|
httpMcpServerBindingSchema,
|
|
281
320
|
mcpServerBindingSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCapability,
|
|
3
3
|
providerRefSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-APU2VKLW.ts";
|
|
5
5
|
import {
|
|
6
6
|
CredentialDelivery,
|
|
7
7
|
InferenceCredentialKind
|
|
@@ -260,7 +260,11 @@ var harnessDescriptionSchema = object({
|
|
|
260
260
|
// the author's name to the text.
|
|
261
261
|
authorMeta: boolean(),
|
|
262
262
|
// Explicit false: native toolPolicy cannot be enforced by this adapter's public surface.
|
|
263
|
-
nativeToolPolicy: boolean().optional()
|
|
263
|
+
nativeToolPolicy: boolean().optional(),
|
|
264
|
+
// Defers and searches MCP tools itself (a harness-native tool search): the
|
|
265
|
+
// host lists every exposed tool, ignoring connections' `tools.load`, and
|
|
266
|
+
// adds no search of its own. Absent: the host applies `load` and serves search.
|
|
267
|
+
deferredToolSearch: boolean().optional()
|
|
264
268
|
}),
|
|
265
269
|
promptWhileRunning: nativeEnum(PromptWhileRunning).default(DEFAULT_PROMPT_WHILE_RUNNING),
|
|
266
270
|
// Keeps the session, its running work and its open requests across a dropped
|
|
@@ -13,11 +13,14 @@ import {
|
|
|
13
13
|
note,
|
|
14
14
|
sandboxProviderNameOf,
|
|
15
15
|
toJson
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5NTKRRMC.ts";
|
|
17
17
|
import {
|
|
18
18
|
AGENT_DYNAMIC_PREFIX,
|
|
19
19
|
namedExportName
|
|
20
20
|
} from "./chunk-NMYHO2QN.ts";
|
|
21
|
+
import {
|
|
22
|
+
agentAvatarSchema
|
|
23
|
+
} from "./chunk-APU2VKLW.ts";
|
|
21
24
|
import {
|
|
22
25
|
hostedBindingRequirementSchema
|
|
23
26
|
} from "./chunk-MSE7X5YG.ts";
|
|
@@ -105,7 +108,7 @@ var isDefinedHarnessLike = (value) => isCallable(value) && isCallable(fieldOf(va
|
|
|
105
108
|
var KNOWN_AGENT_FIELDS = /* @__PURE__ */ new Set([
|
|
106
109
|
"name",
|
|
107
110
|
"description",
|
|
108
|
-
"
|
|
111
|
+
"avatar",
|
|
109
112
|
"harness",
|
|
110
113
|
"tools",
|
|
111
114
|
"toolPolicy",
|
|
@@ -132,7 +135,7 @@ var unknownAgentField = (key) => {
|
|
|
132
135
|
if (key === "defaultTools")
|
|
133
136
|
return "agent.ts field defaultTools is not supported: base tools are declared with tools: baseTools({ ... }) and are off by default";
|
|
134
137
|
if (key === "subagents" || key === "memory") return `agent.ts field ${key} is not supported yet`;
|
|
135
|
-
return `agent.ts field ${key} is not an agent field (name, description,
|
|
138
|
+
return `agent.ts field ${key} is not an agent field (name, description, avatar, harness, tools, toolPolicy, secrets, channels)`;
|
|
136
139
|
};
|
|
137
140
|
var describeHarness = (harness, ctx, issues) => {
|
|
138
141
|
if (harness == null) return null;
|
|
@@ -202,6 +205,19 @@ var describeSecrets = (value, issues) => {
|
|
|
202
205
|
issues.push(error("agent.ts secrets must be a list of secret names"));
|
|
203
206
|
return null;
|
|
204
207
|
};
|
|
208
|
+
var describeAvatar = (value, issues) => {
|
|
209
|
+
if (value === void 0) return null;
|
|
210
|
+
const parsed = agentAvatarSchema.safeParse(toJson(value, { path: "avatar", issues }));
|
|
211
|
+
if (parsed.success) return parsed.data;
|
|
212
|
+
for (const issue of parsed.error.issues) {
|
|
213
|
+
issues.push(
|
|
214
|
+
error(
|
|
215
|
+
`agent.ts avatar${issue.path.length > 0 ? `.${issue.path.join(".")}` : ""}: ${issue.message}`
|
|
216
|
+
)
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
return null;
|
|
220
|
+
};
|
|
205
221
|
var describeAgent = (value, ctx, issues) => {
|
|
206
222
|
if (value == null) return null;
|
|
207
223
|
if (!isPlainObject(value)) {
|
|
@@ -240,7 +256,7 @@ var describeAgent = (value, ctx, issues) => {
|
|
|
240
256
|
type: "agent",
|
|
241
257
|
name: stringOrNull(value["name"]),
|
|
242
258
|
description: stringOrNull(value["description"]),
|
|
243
|
-
|
|
259
|
+
avatar: describeAvatar(value["avatar"], issues),
|
|
244
260
|
harness: describeHarness(value["harness"], ctx, issues),
|
|
245
261
|
tools: baseToolsDescription?.targets ?? null,
|
|
246
262
|
hostTools: baseToolsDescription?.host ?? null,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
lowerSkill,
|
|
9
9
|
lowerTool,
|
|
10
10
|
toJson
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5NTKRRMC.ts";
|
|
12
12
|
import {
|
|
13
13
|
AUTHORED_SERVER_KEY
|
|
14
14
|
} from "./chunk-NMYHO2QN.ts";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-2ZRYQO4Q.ts";
|
|
25
25
|
import {
|
|
26
26
|
lowerApproval
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4A66SVBJ.ts";
|
|
28
28
|
import {
|
|
29
29
|
ConversationKind,
|
|
30
30
|
ParticipantKind
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
mcpServerBindingSchema,
|
|
34
34
|
providerRefSchema
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-APU2VKLW.ts";
|
|
36
36
|
import {
|
|
37
37
|
TranscriptRole
|
|
38
38
|
} from "./chunk-RWUIMTBI.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
harnessDescriptionSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RIEMTCTV.ts";
|
|
4
4
|
import {
|
|
5
5
|
bundleRef
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-APU2VKLW.ts";
|
|
7
7
|
import {
|
|
8
8
|
registerPending
|
|
9
9
|
} from "./chunk-QJ26GEUM.ts";
|
|
@@ -18,6 +18,8 @@ var completeHarnessDescription = (authored) => {
|
|
|
18
18
|
};
|
|
19
19
|
if (authored.supports?.nativeToolPolicy != null)
|
|
20
20
|
supports.nativeToolPolicy = authored.supports.nativeToolPolicy;
|
|
21
|
+
if (authored.supports?.deferredToolSearch != null)
|
|
22
|
+
supports.deferredToolSearch = authored.supports.deferredToolSearch;
|
|
21
23
|
return harnessDescriptionSchema.parse({
|
|
22
24
|
...authored,
|
|
23
25
|
acp: { transports: authored.acp.transports, mcp: authored.acp.mcp ?? [] },
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
lowerApproval,
|
|
4
4
|
never,
|
|
5
5
|
whenInput
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-4A66SVBJ.ts";
|
|
7
|
+
import "../../chunk-APU2VKLW.ts";
|
|
8
8
|
import "../../chunk-MSE7X5YG.ts";
|
|
9
9
|
import "../../chunk-4X2DS5BR.ts";
|
|
10
10
|
import "../../chunk-QJ26GEUM.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineHostedConnection,
|
|
3
3
|
defineMcpClientConnection
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-TJ536HI4.ts";
|
|
5
5
|
import "../../chunk-CIWWFQHL.ts";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-APU2VKLW.ts";
|
|
7
7
|
import "../../chunk-PFLSBTJA.ts";
|
|
8
8
|
import "../../chunk-ULI5WWRR.ts";
|
|
9
9
|
import "../../chunk-W6DOJA4W.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
completeHarnessDescription,
|
|
3
3
|
defineHarness
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-Z5TO7RSJ.ts";
|
|
5
|
+
import "../../chunk-RIEMTCTV.ts";
|
|
6
|
+
import "../../chunk-APU2VKLW.ts";
|
|
7
7
|
import "../../chunk-GCFSHHH2.ts";
|
|
8
8
|
import "../../chunk-MSE7X5YG.ts";
|
|
9
9
|
import "../../chunk-4X2DS5BR.ts";
|
|
@@ -2,7 +2,7 @@ import "../../chunk-RMIQJHSL.ts";
|
|
|
2
2
|
import {
|
|
3
3
|
completeHarnessDescription,
|
|
4
4
|
defineHarness
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-Z5TO7RSJ.ts";
|
|
6
6
|
import {
|
|
7
7
|
HookEvent,
|
|
8
8
|
defineHook
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import "../../chunk-4E5HECVD.ts";
|
|
20
20
|
import {
|
|
21
21
|
SandboxWire
|
|
22
|
-
} from "../../chunk-
|
|
22
|
+
} from "../../chunk-RIEMTCTV.ts";
|
|
23
23
|
import {
|
|
24
24
|
defineSchedule
|
|
25
25
|
} from "../../chunk-JGQ2KAN7.ts";
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
always,
|
|
38
38
|
never,
|
|
39
39
|
whenInput
|
|
40
|
-
} from "../../chunk-
|
|
40
|
+
} from "../../chunk-4A66SVBJ.ts";
|
|
41
41
|
import {
|
|
42
42
|
DELETE,
|
|
43
43
|
GET,
|
|
@@ -52,9 +52,9 @@ import "../../chunk-IF6MR7JF.ts";
|
|
|
52
52
|
import {
|
|
53
53
|
defineHostedConnection,
|
|
54
54
|
defineMcpClientConnection
|
|
55
|
-
} from "../../chunk-
|
|
55
|
+
} from "../../chunk-TJ536HI4.ts";
|
|
56
56
|
import "../../chunk-CIWWFQHL.ts";
|
|
57
|
-
import "../../chunk-
|
|
57
|
+
import "../../chunk-APU2VKLW.ts";
|
|
58
58
|
import {
|
|
59
59
|
TranscriptRole
|
|
60
60
|
} from "../../chunk-RWUIMTBI.ts";
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
import "../../chunk-4E5HECVD.ts";
|
|
8
8
|
import {
|
|
9
9
|
SandboxWire
|
|
10
|
-
} from "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
10
|
+
} from "../../chunk-RIEMTCTV.ts";
|
|
11
|
+
import "../../chunk-APU2VKLW.ts";
|
|
12
12
|
import "../../chunk-GCFSHHH2.ts";
|
|
13
13
|
import "../../chunk-MSE7X5YG.ts";
|
|
14
14
|
import "../../chunk-4X2DS5BR.ts";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
SHARED_SCHEMAS,
|
|
4
4
|
deliveredHarnessConfig,
|
|
5
5
|
referencedSharedSchemas
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-RIEMTCTV.ts";
|
|
7
7
|
import {
|
|
8
8
|
BaseCapability,
|
|
9
9
|
formatProviderRef
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-APU2VKLW.ts";
|
|
11
11
|
import {
|
|
12
12
|
credentialPolicySchema,
|
|
13
13
|
inferenceKindOfNode
|