@finalai/agent-provider 0.1.2 → 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.
@@ -0,0 +1,15 @@
1
+ import * as z from 'zod';
2
+ import { type JsonValue } from "./json.mjs";
3
+ export interface HostedBindingsIface {
4
+ get(name: string): Promise<JsonValue | null>;
5
+ }
6
+ export interface HostedBindingOptionsIface {
7
+ bindings?: HostedBindingsIface;
8
+ name: string;
9
+ }
10
+ export declare const requireHostedBinding: (options: HostedBindingOptionsIface) => Promise<JsonValue>;
11
+ export declare const hostedBindingRequirementSchema: z.ZodObject<{
12
+ name: z.ZodString;
13
+ schema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
14
+ }, z.core.$strip>;
15
+ export type HostedBindingRequirementIface = z.infer<typeof hostedBindingRequirementSchema>;
@@ -0,0 +1,21 @@
1
+ import * as z from "zod";
2
+ import { jsonSchemaSchema, jsonValueSchema } from "./json.mjs";
3
+ const requireHostedBinding = async (options) => {
4
+ if (options.name.trim().length === 0) throw new Error("Hosted binding name must not be empty");
5
+ if (options.bindings == null)
6
+ throw new Error(`Hosting does not supply bindings required by ${options.name}`);
7
+ const value = await options.bindings.get(options.name);
8
+ if (value == null) throw new Error(`Hosted binding ${options.name} is not configured`);
9
+ const parsed = jsonValueSchema.safeParse(value);
10
+ if (!parsed.success) throw new Error(`Hosted binding ${options.name} is not JSON configuration`);
11
+ return parsed.data;
12
+ };
13
+ const hostedBindingRequirementSchema = z.object({
14
+ name: z.string().trim().min(1),
15
+ schema: jsonSchemaSchema
16
+ });
17
+ export {
18
+ hostedBindingRequirementSchema,
19
+ requireHostedBinding
20
+ };
21
+ //# sourceMappingURL=hosted-bindings.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/hosted-bindings.ts"],
4
+ "sourcesContent": ["import * as z from 'zod';\nimport { jsonSchemaSchema, jsonValueSchema, type JsonValue } from \"./json.mjs\";\n\n// Hosting scopes this reader to the deployment, organization and agent. Values\n// contain configuration and credential references, never resolved credentials.\nexport interface HostedBindingsIface {\n get(name: string): Promise<JsonValue | null>;\n}\n\nexport interface HostedBindingOptionsIface {\n bindings?: HostedBindingsIface;\n name: string;\n}\n\nexport const requireHostedBinding = async (\n options: HostedBindingOptionsIface,\n): Promise<JsonValue> => {\n if (options.name.trim().length === 0) throw new Error('Hosted binding name must not be empty');\n if (options.bindings == null)\n throw new Error(`Hosting does not supply bindings required by ${options.name}`);\n const value = await options.bindings.get(options.name);\n if (value == null) throw new Error(`Hosted binding ${options.name} is not configured`);\n const parsed = jsonValueSchema.safeParse(value);\n if (!parsed.success) throw new Error(`Hosted binding ${options.name} is not JSON configuration`);\n return parsed.data;\n};\n\nexport const hostedBindingRequirementSchema = z.object({\n name: z.string().trim().min(1),\n schema: jsonSchemaSchema,\n});\n\nexport type HostedBindingRequirementIface = z.infer<typeof hostedBindingRequirementSchema>;\n"],
5
+ "mappings": "AAAA,YAAY,OAAO;AACnB,SAAS,kBAAkB,uBAAuC;AAa3D,MAAM,uBAAuB,OAClC,YACuB;AACvB,MAAI,QAAQ,KAAK,KAAK,EAAE,WAAW,EAAG,OAAM,IAAI,MAAM,uCAAuC;AAC7F,MAAI,QAAQ,YAAY;AACtB,UAAM,IAAI,MAAM,gDAAgD,QAAQ,IAAI,EAAE;AAChF,QAAM,QAAQ,MAAM,QAAQ,SAAS,IAAI,QAAQ,IAAI;AACrD,MAAI,SAAS,KAAM,OAAM,IAAI,MAAM,kBAAkB,QAAQ,IAAI,oBAAoB;AACrF,QAAM,SAAS,gBAAgB,UAAU,KAAK;AAC9C,MAAI,CAAC,OAAO,QAAS,OAAM,IAAI,MAAM,kBAAkB,QAAQ,IAAI,4BAA4B;AAC/F,SAAO,OAAO;AAChB;AAEO,MAAM,iCAAiC,EAAE,OAAO;AAAA,EACrD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;AAAA,EAC7B,QAAQ;AACV,CAAC;",
6
+ "names": []
7
+ }
@@ -3,12 +3,15 @@ export * from "./channel.mjs";
3
3
  export * from "./credentials.mjs";
4
4
  export * from "./dynamic.mjs";
5
5
  export * from "./harness.mjs";
6
+ export * from "./hosted-bindings.mjs";
6
7
  export * from "./json.mjs";
7
8
  export * from "./manifest.mjs";
8
9
  export * from "./provider-ref.mjs";
9
10
  export * from "./sandbox/open-scope.mjs";
10
11
  export * from "./sandbox/types.mjs";
11
12
  export * from "./schemas.mjs";
13
+ export * from "./tool-annotations.mjs";
14
+ export * from "./tool-patterns.mjs";
12
15
  export * from "./channel-context.mjs";
13
16
  export * from "./semantic-events.mjs";
14
17
  export * from "./sandbox/snapshots.mjs";
@@ -10,12 +10,15 @@ export * from "./channel.mjs";
10
10
  export * from "./credentials.mjs";
11
11
  export * from "./dynamic.mjs";
12
12
  export * from "./harness.mjs";
13
+ export * from "./hosted-bindings.mjs";
13
14
  export * from "./json.mjs";
14
15
  export * from "./manifest.mjs";
15
16
  export * from "./provider-ref.mjs";
16
17
  export * from "./sandbox/open-scope.mjs";
17
18
  export * from "./sandbox/types.mjs";
18
19
  export * from "./schemas.mjs";
20
+ export * from "./tool-annotations.mjs";
21
+ export * from "./tool-patterns.mjs";
19
22
  export * from "./channel-context.mjs";
20
23
  export * from "./semantic-events.mjs";
21
24
  export * from "./sandbox/snapshots.mjs";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/index.ts"],
4
- "sourcesContent": ["export {\n ProcessInspectionOperation,\n inspectedProcessSchema,\n processInspectionDetailSchema,\n processInspectionPageSchema,\n processInspectionRequestSchema,\n processInspectionResultSchema,\n type InspectedProcessIface,\n type ProcessInspectionDetailIface,\n type ProcessInspectionPageIface,\n type ProcessInspectionRequestIface,\n type ProcessInspectionResultIface,\n} from '@finalai/agent-protocol/process-inspection';\nexport * from \"./channel.mjs\";\nexport * from \"./credentials.mjs\";\nexport * from \"./dynamic.mjs\";\nexport * from \"./harness.mjs\";\nexport * from \"./json.mjs\";\nexport * from \"./manifest.mjs\";\nexport * from \"./provider-ref.mjs\";\nexport * from \"./sandbox/open-scope.mjs\";\nexport * from \"./sandbox/types.mjs\";\nexport * from \"./schemas.mjs\";\n\nexport * from \"./channel-context.mjs\";\n\nexport * from \"./semantic-events.mjs\";\n\nexport * from \"./sandbox/snapshots.mjs\";\n\nexport {\n SandboxEditorOperation,\n sandboxEditorRequestSchema,\n sandboxEditorResultSchema,\n sandboxEditorSessionSchema,\n type SandboxEditorRequestIface,\n type SandboxEditorResultIface,\n type SandboxEditorSessionIface,\n} from \"./sandbox/editor.mjs\";\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;",
4
+ "sourcesContent": ["export {\n ProcessInspectionOperation,\n inspectedProcessSchema,\n processInspectionDetailSchema,\n processInspectionPageSchema,\n processInspectionRequestSchema,\n processInspectionResultSchema,\n type InspectedProcessIface,\n type ProcessInspectionDetailIface,\n type ProcessInspectionPageIface,\n type ProcessInspectionRequestIface,\n type ProcessInspectionResultIface,\n} from '@finalai/agent-protocol/process-inspection';\nexport * from \"./channel.mjs\";\nexport * from \"./credentials.mjs\";\nexport * from \"./dynamic.mjs\";\nexport * from \"./harness.mjs\";\nexport * from \"./hosted-bindings.mjs\";\nexport * from \"./json.mjs\";\nexport * from \"./manifest.mjs\";\nexport * from \"./provider-ref.mjs\";\nexport * from \"./sandbox/open-scope.mjs\";\nexport * from \"./sandbox/types.mjs\";\nexport * from \"./schemas.mjs\";\nexport * from \"./tool-annotations.mjs\";\nexport * from \"./tool-patterns.mjs\";\n\nexport * from \"./channel-context.mjs\";\n\nexport * from \"./semantic-events.mjs\";\n\nexport * from \"./sandbox/snapshots.mjs\";\n\nexport {\n SandboxEditorOperation,\n sandboxEditorRequestSchema,\n sandboxEditorResultSchema,\n sandboxEditorSessionSchema,\n type SandboxEditorRequestIface,\n type SandboxEditorResultIface,\n type SandboxEditorSessionIface,\n} from \"./sandbox/editor.mjs\";\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,8 @@
1
1
  import * as z from 'zod';
2
2
  import { DynamicEvent } from "./dynamic.mjs";
3
- export declare const MANIFEST_VERSION = 2;
3
+ export { agentAvatarSchema, avatarMediaSchema } from '@finalai/agent-protocol';
4
+ export type { AgentAvatarIface, AvatarMedia, AvatarState } from '@finalai/agent-protocol';
5
+ export declare const MANIFEST_VERSION = 3;
4
6
  export declare enum BaseCapability {
5
7
  Shell = "shell",
6
8
  Files = "files",
@@ -39,7 +41,7 @@ export declare enum ScheduleDelivery {
39
41
  export declare const identitySchema: z.ZodObject<{
40
42
  name: z.ZodString;
41
43
  description: z.ZodNullable<z.ZodString>;
42
- avatarUrl: z.ZodNullable<z.ZodString>;
44
+ avatar: z.ZodOptional<z.ZodType<import("@finalai/agent-protocol").AgentAvatarIface, unknown, z.core.$ZodTypeInternals<import("@finalai/agent-protocol").AgentAvatarIface, unknown>>>;
43
45
  }, z.core.$strip>;
44
46
  export declare enum InputApprovalKind {
45
47
  Tool = "tool",
@@ -79,6 +81,27 @@ export declare const mcpAuthSchema: z.ZodUnion<readonly [z.ZodObject<{
79
81
  }, z.core.$strip>, z.ZodObject<{
80
82
  kind: z.ZodLiteral<"final-session">;
81
83
  }, z.core.$strip>]>;
84
+ export declare const toolAnnotationSelectorSchema: z.ZodObject<{
85
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
86
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
87
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
88
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
89
+ }, z.core.$strict>;
90
+ export declare const toolAnnotationRuleSchema: z.ZodObject<{
91
+ match: z.ZodObject<{
92
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
93
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
94
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
95
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
96
+ }, z.core.$strict>;
97
+ approval: z.ZodEnum<typeof ToolApproval>;
98
+ inputApproval: z.ZodOptional<z.ZodObject<{
99
+ kind: z.ZodEnum<typeof InputApprovalKind>;
100
+ export: z.ZodString;
101
+ policyKey: z.ZodOptional<z.ZodString>;
102
+ dynamic: z.ZodOptional<z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>>;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strip>;
82
105
  export declare const workerMcpServerBindingSchema: z.ZodObject<{
83
106
  key: z.ZodString;
84
107
  kind: z.ZodLiteral<McpServerBindingKind.Worker>;
@@ -118,6 +141,28 @@ export declare const httpMcpServerBindingSchema: z.ZodObject<{
118
141
  headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
119
142
  approvals: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<typeof ToolApproval>>>;
120
143
  deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
+ load: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ allowAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
146
+ match: z.ZodObject<{
147
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
148
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
149
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
150
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
151
+ }, z.core.$strict>;
152
+ approval: z.ZodEnum<typeof ToolApproval>;
153
+ inputApproval: z.ZodOptional<z.ZodObject<{
154
+ kind: z.ZodEnum<typeof InputApprovalKind>;
155
+ export: z.ZodString;
156
+ policyKey: z.ZodOptional<z.ZodString>;
157
+ dynamic: z.ZodOptional<z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>>;
158
+ }, z.core.$strip>>;
159
+ }, z.core.$strip>>>;
160
+ denyAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
161
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
162
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
163
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
164
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
165
+ }, z.core.$strict>>>;
121
166
  dynamicResolver: z.ZodOptional<z.ZodString>;
122
167
  inputApprovals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
123
168
  kind: z.ZodEnum<typeof InputApprovalKind>;
@@ -164,6 +209,28 @@ export declare const mcpServerBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
164
209
  headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
165
210
  approvals: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<typeof ToolApproval>>>;
166
211
  deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
212
+ load: z.ZodOptional<z.ZodArray<z.ZodString>>;
213
+ allowAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
214
+ match: z.ZodObject<{
215
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
216
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
217
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
218
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
219
+ }, z.core.$strict>;
220
+ approval: z.ZodEnum<typeof ToolApproval>;
221
+ inputApproval: z.ZodOptional<z.ZodObject<{
222
+ kind: z.ZodEnum<typeof InputApprovalKind>;
223
+ export: z.ZodString;
224
+ policyKey: z.ZodOptional<z.ZodString>;
225
+ dynamic: z.ZodOptional<z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>>;
226
+ }, z.core.$strip>>;
227
+ }, z.core.$strip>>>;
228
+ denyAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
230
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
231
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
232
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
233
+ }, z.core.$strict>>>;
167
234
  dynamicResolver: z.ZodOptional<z.ZodString>;
168
235
  inputApprovals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
169
236
  kind: z.ZodEnum<typeof InputApprovalKind>;
@@ -186,6 +253,10 @@ export declare const sandboxBindingSchema: z.ZodObject<{
186
253
  events: z.ZodArray<z.ZodEnum<typeof DynamicEvent>>;
187
254
  description: z.ZodOptional<z.ZodString>;
188
255
  preview: z.ZodOptional<z.ZodString>;
256
+ requiredBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
257
+ name: z.ZodString;
258
+ schema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
259
+ }, z.core.$strip>>>;
189
260
  }, z.core.$strip>;
190
261
  }, z.core.$strip>, z.ZodType<import("./json.mjs").JsonValue, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonValue, unknown>>]>;
191
262
  access: z.ZodDefault<z.ZodEnum<typeof SandboxAccess>>;
@@ -243,15 +314,19 @@ export declare const harnessBindingSchema: z.ZodObject<{
243
314
  events: z.ZodArray<z.ZodEnum<typeof DynamicEvent>>;
244
315
  description: z.ZodOptional<z.ZodString>;
245
316
  preview: z.ZodOptional<z.ZodString>;
317
+ requiredBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
318
+ name: z.ZodString;
319
+ schema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
320
+ }, z.core.$strip>>>;
246
321
  }, z.core.$strip>;
247
322
  }, z.core.$strip>, z.ZodType<import("./json.mjs").JsonValue, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonValue, unknown>>]>;
248
323
  }, z.core.$strip>;
249
324
  export declare const agentManifestSchema: z.ZodObject<{
250
- version: z.ZodLiteral<2>;
325
+ version: z.ZodUnion<readonly [z.ZodLiteral<2>, z.ZodLiteral<3>]>;
251
326
  identity: z.ZodObject<{
252
327
  name: z.ZodString;
253
328
  description: z.ZodNullable<z.ZodString>;
254
- avatarUrl: z.ZodNullable<z.ZodString>;
329
+ avatar: z.ZodOptional<z.ZodType<import("@finalai/agent-protocol").AgentAvatarIface, unknown, z.core.$ZodTypeInternals<import("@finalai/agent-protocol").AgentAvatarIface, unknown>>>;
255
330
  }, z.core.$strip>;
256
331
  harness: z.ZodObject<{
257
332
  harness: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -267,6 +342,10 @@ export declare const agentManifestSchema: z.ZodObject<{
267
342
  events: z.ZodArray<z.ZodEnum<typeof DynamicEvent>>;
268
343
  description: z.ZodOptional<z.ZodString>;
269
344
  preview: z.ZodOptional<z.ZodString>;
345
+ requiredBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
346
+ name: z.ZodString;
347
+ schema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
348
+ }, z.core.$strip>>>;
270
349
  }, z.core.$strip>;
271
350
  }, z.core.$strip>, z.ZodType<import("./json.mjs").JsonValue, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonValue, unknown>>]>;
272
351
  }, z.core.$strip>;
@@ -276,6 +355,10 @@ export declare const agentManifestSchema: z.ZodObject<{
276
355
  events: z.ZodArray<z.ZodEnum<typeof DynamicEvent>>;
277
356
  description: z.ZodOptional<z.ZodString>;
278
357
  preview: z.ZodOptional<z.ZodString>;
358
+ requiredBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
359
+ name: z.ZodString;
360
+ schema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
361
+ }, z.core.$strip>>>;
279
362
  }, z.core.$strip>;
280
363
  }, z.core.$strip>, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
281
364
  key: z.ZodString;
@@ -315,6 +398,28 @@ export declare const agentManifestSchema: z.ZodObject<{
315
398
  headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
316
399
  approvals: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<typeof ToolApproval>>>;
317
400
  deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
401
+ load: z.ZodOptional<z.ZodArray<z.ZodString>>;
402
+ allowAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
403
+ match: z.ZodObject<{
404
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
405
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
406
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
407
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
408
+ }, z.core.$strict>;
409
+ approval: z.ZodEnum<typeof ToolApproval>;
410
+ inputApproval: z.ZodOptional<z.ZodObject<{
411
+ kind: z.ZodEnum<typeof InputApprovalKind>;
412
+ export: z.ZodString;
413
+ policyKey: z.ZodOptional<z.ZodString>;
414
+ dynamic: z.ZodOptional<z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>>;
415
+ }, z.core.$strip>>;
416
+ }, z.core.$strip>>>;
417
+ denyAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
418
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
419
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
420
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
421
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
422
+ }, z.core.$strict>>>;
318
423
  dynamicResolver: z.ZodOptional<z.ZodString>;
319
424
  inputApprovals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
320
425
  kind: z.ZodEnum<typeof InputApprovalKind>;
@@ -329,6 +434,10 @@ export declare const agentManifestSchema: z.ZodObject<{
329
434
  events: z.ZodArray<z.ZodEnum<typeof DynamicEvent>>;
330
435
  description: z.ZodOptional<z.ZodString>;
331
436
  preview: z.ZodOptional<z.ZodString>;
437
+ requiredBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
438
+ name: z.ZodString;
439
+ schema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
440
+ }, z.core.$strip>>>;
332
441
  }, z.core.$strip>;
333
442
  }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodObject<{
334
443
  provider: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -344,6 +453,10 @@ export declare const agentManifestSchema: z.ZodObject<{
344
453
  events: z.ZodArray<z.ZodEnum<typeof DynamicEvent>>;
345
454
  description: z.ZodOptional<z.ZodString>;
346
455
  preview: z.ZodOptional<z.ZodString>;
456
+ requiredBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
457
+ name: z.ZodString;
458
+ schema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
459
+ }, z.core.$strip>>>;
347
460
  }, z.core.$strip>;
348
461
  }, z.core.$strip>, z.ZodType<import("./json.mjs").JsonValue, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonValue, unknown>>]>;
349
462
  access: z.ZodDefault<z.ZodEnum<typeof SandboxAccess>>;
@@ -396,11 +509,11 @@ export declare const agentManifestSchema: z.ZodObject<{
396
509
  }, z.core.$strip>>;
397
510
  }, z.core.$strip>;
398
511
  export declare const resolvedAgentManifestSchema: z.ZodObject<{
399
- version: z.ZodLiteral<2>;
512
+ version: z.ZodUnion<readonly [z.ZodLiteral<2>, z.ZodLiteral<3>]>;
400
513
  identity: z.ZodObject<{
401
514
  name: z.ZodString;
402
515
  description: z.ZodNullable<z.ZodString>;
403
- avatarUrl: z.ZodNullable<z.ZodString>;
516
+ avatar: z.ZodOptional<z.ZodType<import("@finalai/agent-protocol").AgentAvatarIface, unknown, z.core.$ZodTypeInternals<import("@finalai/agent-protocol").AgentAvatarIface, unknown>>>;
404
517
  }, z.core.$strip>;
405
518
  tools: z.ZodObject<{
406
519
  base: z.ZodRecord<z.ZodEnum<typeof BaseCapability> & z.core.$partial, z.ZodObject<{
@@ -495,6 +608,28 @@ export declare const resolvedAgentManifestSchema: z.ZodObject<{
495
608
  headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
496
609
  approvals: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<typeof ToolApproval>>>;
497
610
  deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
611
+ load: z.ZodOptional<z.ZodArray<z.ZodString>>;
612
+ allowAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
613
+ match: z.ZodObject<{
614
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
615
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
616
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
617
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
618
+ }, z.core.$strict>;
619
+ approval: z.ZodEnum<typeof ToolApproval>;
620
+ inputApproval: z.ZodOptional<z.ZodObject<{
621
+ kind: z.ZodEnum<typeof InputApprovalKind>;
622
+ export: z.ZodString;
623
+ policyKey: z.ZodOptional<z.ZodString>;
624
+ dynamic: z.ZodOptional<z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>>;
625
+ }, z.core.$strip>>;
626
+ }, z.core.$strip>>>;
627
+ denyAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
628
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
629
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
630
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
631
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
632
+ }, z.core.$strict>>>;
498
633
  dynamicResolver: z.ZodOptional<z.ZodString>;
499
634
  inputApprovals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
500
635
  kind: z.ZodEnum<typeof InputApprovalKind>;
@@ -521,6 +656,8 @@ export type ToolDescriptorIface = z.infer<typeof toolDescriptorSchema>;
521
656
  export type McpAuth = z.infer<typeof mcpAuthSchema>;
522
657
  export type WorkerMcpServerBindingIface = z.infer<typeof workerMcpServerBindingSchema>;
523
658
  export type HttpMcpServerBindingIface = z.infer<typeof httpMcpServerBindingSchema>;
659
+ export type ToolAnnotationSelectorIface = z.infer<typeof toolAnnotationSelectorSchema>;
660
+ export type ToolAnnotationRuleIface = z.infer<typeof toolAnnotationRuleSchema>;
524
661
  export type McpServerBinding = z.infer<typeof mcpServerBindingSchema>;
525
662
  export type SandboxBindingIface = z.infer<typeof sandboxBindingSchema>;
526
663
  export type BaseToolsIface = z.infer<typeof baseToolsSchema>;
@@ -1,8 +1,10 @@
1
1
  import * as z from "zod";
2
+ import { agentAvatarSchema } from "@finalai/agent-protocol";
2
3
  import { containsDynamicSlot, DynamicEvent, maybeDynamic } from "./dynamic.mjs";
3
4
  import { jsonObjectSchema, jsonSchemaSchema, jsonValueSchema } from "./json.mjs";
4
5
  import { packageRef, providerRefSchema } from "./provider-ref.mjs";
5
- const MANIFEST_VERSION = 2;
6
+ import { agentAvatarSchema as agentAvatarSchema2, avatarMediaSchema } from "@finalai/agent-protocol";
7
+ const MANIFEST_VERSION = 3;
6
8
  var BaseCapability = /* @__PURE__ */ ((BaseCapability2) => {
7
9
  BaseCapability2["Shell"] = "shell";
8
10
  BaseCapability2["Files"] = "files";
@@ -53,7 +55,7 @@ var ScheduleDelivery = /* @__PURE__ */ ((ScheduleDelivery2) => {
53
55
  const identitySchema = z.object({
54
56
  name: z.string().min(1).max(120),
55
57
  description: z.string().max(2e3).nullable(),
56
- avatarUrl: z.string().url().nullable()
58
+ avatar: agentAvatarSchema.optional()
57
59
  });
58
60
  var InputApprovalKind = /* @__PURE__ */ ((InputApprovalKind2) => {
59
61
  InputApprovalKind2["Tool"] = "tool";
@@ -91,6 +93,17 @@ const mcpAuthSchema = z.union([
91
93
  z.object({ kind: z.literal("final-session") })
92
94
  ]);
93
95
  const toolApprovalsSchema = z.record(z.string(), z.nativeEnum(ToolApproval)).nullable();
96
+ const toolAnnotationSelectorSchema = z.strictObject({
97
+ readOnlyHint: z.boolean().optional(),
98
+ destructiveHint: z.boolean().optional(),
99
+ idempotentHint: z.boolean().optional(),
100
+ openWorldHint: z.boolean().optional()
101
+ }).refine((selector) => Object.keys(selector).length > 0, "Select at least one annotation");
102
+ const toolAnnotationRuleSchema = z.object({
103
+ match: toolAnnotationSelectorSchema,
104
+ approval: z.nativeEnum(ToolApproval),
105
+ inputApproval: inputApprovalSchema.optional()
106
+ });
94
107
  const workerMcpServerBindingSchema = z.object({
95
108
  key: z.string().min(1),
96
109
  kind: z.literal("worker" /* Worker */),
@@ -104,9 +117,19 @@ const httpMcpServerBindingSchema = z.object({
104
117
  auth: mcpAuthSchema.nullable(),
105
118
  headers: z.record(z.string(), z.string()).default({}),
106
119
  // Null allows every tool the server lists, each with the default approval.
120
+ // Keys are tool names or `*` patterns (./tool-patterns.ts); the most
121
+ // specific matching key governs a tool.
107
122
  approvals: toolApprovalsSchema,
108
- // Tools hidden even when `approvals` would expose them.
123
+ // Tool names or `*` patterns hidden even when `approvals` would expose them.
109
124
  deny: z.array(z.string().min(1)).optional(),
125
+ // Exposed tools (names or `*` patterns) the harness lists up front. Absent
126
+ // lists every exposed tool; otherwise the host keeps the rest reachable
127
+ // through search (HOSTING.md).
128
+ load: z.array(z.string().min(1)).optional(),
129
+ // Tools also exposed by their MCP annotations; named tools keep `approvals`.
130
+ allowAnnotations: z.array(toolAnnotationRuleSchema).optional(),
131
+ // Tools hidden by their MCP annotations, whatever else exposes them.
132
+ denyAnnotations: z.array(toolAnnotationSelectorSchema).optional(),
110
133
  // The authored resolver that produced this connection, for retained boundary values.
111
134
  dynamicResolver: z.string().min(1).optional(),
112
135
  inputApprovals: z.record(z.string(), inputApprovalSchema).optional()
@@ -166,7 +189,8 @@ const harnessBindingSchema = z.object({
166
189
  config: maybeDynamic(jsonValueSchema)
167
190
  });
168
191
  const agentManifestSchema = z.object({
169
- version: z.literal(MANIFEST_VERSION),
192
+ // Read persisted v2 revisions; v3 writers require hosts enforcing hosted bindings.
193
+ version: z.union([z.literal(2), z.literal(MANIFEST_VERSION)]),
170
194
  identity: identitySchema,
171
195
  harness: harnessBindingSchema,
172
196
  mcpServers: maybeDynamic(z.array(mcpServerBindingSchema)),
@@ -214,7 +238,7 @@ const skillBundleSchema = z.object({
214
238
  });
215
239
  const emptyManifest = (name) => ({
216
240
  version: MANIFEST_VERSION,
217
- identity: { name, description: null, avatarUrl: null },
241
+ identity: { name, description: null },
218
242
  harness: {
219
243
  harness: packageRef("@finalai/final-agent-provider/harnesses/serverless-final"),
220
244
  config: {}
@@ -240,7 +264,9 @@ export {
240
264
  ScheduleDelivery,
241
265
  ScheduleTarget,
242
266
  ToolApproval,
267
+ agentAvatarSchema2 as agentAvatarSchema,
243
268
  agentManifestSchema,
269
+ avatarMediaSchema,
244
270
  baseToolsSchema,
245
271
  bundleSchema,
246
272
  channelBindingSchema,
@@ -260,6 +286,8 @@ export {
260
286
  scheduleDefinitionSchema,
261
287
  skillBundleSchema,
262
288
  skillFileSchema,
289
+ toolAnnotationRuleSchema,
290
+ toolAnnotationSelectorSchema,
263
291
  toolDescriptorSchema,
264
292
  workerMcpServerBindingSchema
265
293
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/manifest.ts"],
4
- "sourcesContent": ["import * as z from 'zod';\nimport { containsDynamicSlot, DynamicEvent, maybeDynamic } from \"./dynamic.mjs\";\nimport { jsonObjectSchema, jsonSchemaSchema, jsonValueSchema } from \"./json.mjs\";\nimport { packageRef, providerRefSchema } from \"./provider-ref.mjs\";\n\n// The Agent Manifest. It lives in the provider contract\n// package because it is what harnesses, sandboxes and channels receive;\n// @finalai/agent-definition compiles directories into it and re-exports it.\n//\n// A harness owns its loop, native tools, prompt assembly, models, permission\n// modes, memory and compaction: all of that is `harness.config`, typed by the\n// harness's own configSchema. What ACP standardizes (MCP servers, prompts,\n// permissions, cancellation) is session input, identical for every harness.\n\nexport const MANIFEST_VERSION = 2;\n\n// Base tool capability classes, one to one with sandbox handle capabilities.\nexport enum BaseCapability {\n Shell = 'shell',\n Files = 'files',\n Process = 'process',\n Ports = 'ports',\n Browser = 'browser',\n ComputerUse = 'computerUse',\n}\n\nexport enum ToolApproval {\n Allow = 'allow',\n Ask = 'ask',\n}\n\n// What a session may do on a sandbox target: read files; also run\n// processes (execute, without file writes); or everything (write).\nexport enum SandboxAccess {\n Read = 'read',\n Execute = 'execute',\n Write = 'write',\n}\n\nconst SANDBOX_ACCESS_RANK = {\n [SandboxAccess.Read]: 0,\n [SandboxAccess.Execute]: 1,\n [SandboxAccess.Write]: 2,\n} satisfies Record<SandboxAccess, number>;\n\n// Each access includes the ones before it: read < execute < write.\nexport const sandboxAccessAtLeast = (access: SandboxAccess, floor: SandboxAccess): boolean =>\n SANDBOX_ACCESS_RANK[access] >= SANDBOX_ACCESS_RANK[floor];\n\nexport const narrowerSandboxAccess = (a: SandboxAccess, b: SandboxAccess): SandboxAccess =>\n SANDBOX_ACCESS_RANK[a] <= SANDBOX_ACCESS_RANK[b] ? a : b;\n\nexport enum SandboxAttach {\n Lazy = 'lazy',\n OnPrompt = 'on-prompt',\n}\n\nexport enum McpServerBindingKind {\n // Authored tools, served from the agent's Worker isolate behind the MCP host.\n Worker = 'worker',\n Http = 'http',\n}\n\nexport enum ScheduleTarget {\n OwnerDirect = 'owner-direct',\n BoundConversation = 'bound-conversation',\n}\n\n// Whether a schedule's firing must get a visible reply. Values match the schedules API.\nexport enum ScheduleDelivery {\n Always = 'always',\n // The agent replies only when there is something to say; an empty turn posts nothing.\n IfNeeded = 'if_needed',\n}\n\nexport const identitySchema = z.object({\n name: z.string().min(1).max(120),\n description: z.string().max(2000).nullable(),\n avatarUrl: z.string().url().nullable(),\n});\n\nexport enum InputApprovalKind {\n Tool = 'tool',\n Connection = 'connection',\n}\n\nexport const inputApprovalSchema = z.object({\n kind: z.nativeEnum(InputApprovalKind),\n export: z.string().min(1),\n // Connection default when absent; otherwise tools.approval[policyKey].\n policyKey: z.string().min(1).optional(),\n dynamic: jsonObjectSchema.optional(),\n});\nexport type InputApprovalIface = z.infer<typeof inputApprovalSchema>;\n\n// Tool descriptors are stored statically so `tools/list` never needs the isolate.\nexport const toolDescriptorSchema = z.object({\n name: z.string().min(1),\n description: z.string(),\n inputSchema: jsonSchemaSchema,\n outputSchema: jsonSchemaSchema.optional(),\n annotations: z\n .object({\n title: z.string().optional(),\n readOnlyHint: z.boolean().optional(),\n destructiveHint: z.boolean().optional(),\n idempotentHint: z.boolean().optional(),\n openWorldHint: z.boolean().optional(),\n })\n .optional(),\n // Bundle export implementing it ('tools/lookup_release_notes').\n export: z.string().min(1).optional(),\n // Boundary snapshot used to reconstruct dynamic tools after isolate eviction.\n dynamic: jsonObjectSchema.optional(),\n inputApproval: inputApprovalSchema.optional(),\n});\n\nexport const mcpAuthSchema = z.union([\n z.object({ secretKey: z.string().min(1), headerName: z.string().min(1).nullable() }),\n // Resolved by the broker to a session-scoped grant (Final's own MCP server).\n z.object({ kind: z.literal('final-session') }),\n]);\n\nconst toolApprovalsSchema = z.record(z.string(), z.nativeEnum(ToolApproval)).nullable();\n\nexport const workerMcpServerBindingSchema = z.object({\n key: z.string().min(1),\n kind: z.literal(McpServerBindingKind.Worker),\n tools: z.array(toolDescriptorSchema),\n approvals: toolApprovalsSchema,\n});\n\nexport const httpMcpServerBindingSchema = z.object({\n key: z.string().min(1),\n kind: z.literal(McpServerBindingKind.Http),\n url: z.string().url(),\n auth: mcpAuthSchema.nullable(),\n headers: z.record(z.string(), z.string()).default({}),\n // Null allows every tool the server lists, each with the default approval.\n approvals: toolApprovalsSchema,\n // Tools hidden even when `approvals` would expose them.\n deny: z.array(z.string().min(1)).optional(),\n // The authored resolver that produced this connection, for retained boundary values.\n dynamicResolver: z.string().min(1).optional(),\n inputApprovals: z.record(z.string(), inputApprovalSchema).optional(),\n});\n\nexport const mcpServerBindingSchema = z.discriminatedUnion('kind', [\n workerMcpServerBindingSchema,\n httpMcpServerBindingSchema,\n]);\n\nexport const sandboxBindingSchema = z.object({\n provider: providerRefSchema,\n // Provider-defined environment options (`computer`: a setup guide reference or\n // inline guide plus start-time parameters). Validated by the provider.\n environment: maybeDynamic(jsonValueSchema),\n access: z.nativeEnum(SandboxAccess).default(SandboxAccess.Write),\n attach: z.nativeEnum(SandboxAttach).default(SandboxAttach.Lazy),\n});\n\nexport const baseToolsSchema = z.object({\n base: z.partialRecord(z.nativeEnum(BaseCapability), z.object({ target: z.string().min(1) })),\n // Capabilities declared on the harness's own host with no sandbox target\n // (`baseTools({ shell: harnessHost })`): only a harness that\n // provides them natively (host-disableable, host-fixed) can serve them.\n host: z.array(z.nativeEnum(BaseCapability)).optional(),\n});\n\nexport const channelBindingSchema = z.object({\n // Stable within the definition; publish maps it to a binding id.\n key: z.string().min(1),\n channel: providerRefSchema,\n config: jsonObjectSchema.default({}),\n source: z.string().optional(),\n});\n\nexport const hookBindingSchema = z.object({\n slug: z.string().min(1),\n export: z.string().min(1),\n events: z.array(z.string().min(1)).min(1),\n});\n\nexport const scheduleDefinitionSchema = z.object({\n key: z.string().min(1),\n cron: z.string().min(1),\n timezone: z.string().min(1),\n prompt: z.string().min(1),\n target: z.nativeEnum(ScheduleTarget),\n});\n\nexport const bundleSchema = z.object({\n // Absent on historical revisions: the host must inspect their resources.\n hasPreparationFiles: z.boolean().optional(),\n hash: z.string().min(1),\n // Dynamic slot path \u2192 resolver export and events.\n resolvers: z.record(\n z.string(),\n z.object({ export: z.string().min(1), events: z.array(z.nativeEnum(DynamicEvent)).min(1) }),\n ),\n});\n\nexport const harnessBindingSchema = z.object({\n harness: providerRefSchema,\n // Validated against the harness's configSchema; may contain dynamic slots at\n // any depth (an instruction fragment, the model).\n config: maybeDynamic(jsonValueSchema),\n});\n\nexport const agentManifestSchema = z.object({\n version: z.literal(MANIFEST_VERSION),\n identity: identitySchema,\n harness: harnessBindingSchema,\n mcpServers: maybeDynamic(z.array(mcpServerBindingSchema)),\n sandboxes: maybeDynamic(z.record(z.string(), sandboxBindingSchema)),\n tools: baseToolsSchema,\n toolPolicy: z.record(z.string(), z.nativeEnum(ToolApproval)),\n // Organization secrets this agent may read, by name (`secrets.get`,\n // MCP `secretKey`, `apiKey({ secret })`). Nothing else is readable;\n // binding organization secrets requires an organization admin at publish.\n secrets: z.array(z.string().min(1)).default([]),\n channels: z.array(channelBindingSchema),\n channelSources: z\n .record(z.string(), z.object({ path: z.string(), source: z.string(), disabled: z.boolean() }))\n .optional(),\n hooks: z.array(hookBindingSchema),\n schedules: z.array(scheduleDefinitionSchema),\n bundle: bundleSchema.nullable(),\n});\n\n// What one session actually got: every dynamic slot replaced by its resolved\n// value (stored in agent.session_manifests).\nexport const resolvedAgentManifestSchema = agentManifestSchema\n .extend({\n harness: z.object({ harness: providerRefSchema, config: jsonValueSchema }),\n mcpServers: z.array(mcpServerBindingSchema),\n sandboxes: z.record(z.string(), sandboxBindingSchema.extend({ environment: jsonValueSchema })),\n })\n .superRefine((manifest, ctx) => {\n if (containsDynamicSlot(manifest)) {\n ctx.addIssue({\n code: 'custom',\n message: 'a resolved manifest must not contain dynamic slots',\n });\n }\n });\n\nexport type IdentityIface = z.infer<typeof identitySchema>;\nexport type ToolDescriptorIface = z.infer<typeof toolDescriptorSchema>;\nexport type McpAuth = z.infer<typeof mcpAuthSchema>;\nexport type WorkerMcpServerBindingIface = z.infer<typeof workerMcpServerBindingSchema>;\nexport type HttpMcpServerBindingIface = z.infer<typeof httpMcpServerBindingSchema>;\nexport type McpServerBinding = z.infer<typeof mcpServerBindingSchema>;\nexport type SandboxBindingIface = z.infer<typeof sandboxBindingSchema>;\nexport type BaseToolsIface = z.infer<typeof baseToolsSchema>;\nexport type ChannelBindingIface = z.infer<typeof channelBindingSchema>;\nexport type HookBindingIface = z.infer<typeof hookBindingSchema>;\nexport type ScheduleDefinitionIface = z.infer<typeof scheduleDefinitionSchema>;\nexport type BundleIface = z.infer<typeof bundleSchema>;\nexport type HarnessBindingIface = z.infer<typeof harnessBindingSchema>;\nexport type AgentManifestIface = z.infer<typeof agentManifestSchema>;\nexport type ResolvedAgentManifestIface = z.infer<typeof resolvedAgentManifestSchema>;\nexport type ResolvedSandboxBindingIface = ResolvedAgentManifestIface['sandboxes'][string];\n\n// The fields of a harness config the platform itself reads through the shared\n// schema fragments; everything else is opaque to the platform.\nexport enum InstructionRole {\n System = 'system',\n User = 'user',\n}\n\nexport const instructionFragmentSchema = z.object({\n role: z.nativeEnum(InstructionRole),\n content: z.string(),\n // Source file, for the compatibility report and Build.\n source: z.string().optional(),\n});\n\nexport const skillFileSchema = z.object({ path: z.string().min(1), content: z.string() });\nexport const skillBundleSchema = z.object({\n key: z.string().min(1),\n description: z.string().optional(),\n files: z.array(skillFileSchema),\n});\n\nexport type InstructionFragmentIface = z.infer<typeof instructionFragmentSchema>;\nexport type SkillBundleIface = z.infer<typeof skillBundleSchema>;\n\nexport const emptyManifest = (name: string): AgentManifestIface => ({\n version: MANIFEST_VERSION,\n identity: { name, description: null, avatarUrl: null },\n harness: {\n harness: packageRef('@finalai/final-agent-provider/harnesses/serverless-final'),\n config: {},\n },\n mcpServers: [],\n sandboxes: {},\n tools: { base: {} },\n toolPolicy: {},\n secrets: [],\n channels: [],\n hooks: [],\n schedules: [],\n bundle: null,\n});\n"],
5
- "mappings": "AAAA,YAAY,OAAO;AACnB,SAAS,qBAAqB,cAAc,oBAAoB;AAChE,SAAS,kBAAkB,kBAAkB,uBAAuB;AACpE,SAAS,YAAY,yBAAyB;AAWvC,MAAM,mBAAmB;AAGzB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,iBAAc;AANJ,SAAAA;AAAA,GAAA;AASL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,WAAQ;AACR,EAAAA,cAAA,SAAM;AAFI,SAAAA;AAAA,GAAA;AAOL,IAAK,gBAAL,kBAAKC,mBAAL;AACL,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,aAAU;AACV,EAAAA,eAAA,WAAQ;AAHE,SAAAA;AAAA,GAAA;AAMZ,MAAM,sBAAsB;AAAA,EAC1B,CAAC,iBAAkB,GAAG;AAAA,EACtB,CAAC,uBAAqB,GAAG;AAAA,EACzB,CAAC,mBAAmB,GAAG;AACzB;AAGO,MAAM,uBAAuB,CAAC,QAAuB,UAC1D,oBAAoB,MAAM,KAAK,oBAAoB,KAAK;AAEnD,MAAM,wBAAwB,CAAC,GAAkB,MACtD,oBAAoB,CA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AAChC,CAAC;AAKM,MAAM,gBAAgB,CAAC,UAAsC;AAAA,EAClE,SAAS;AAAA,EACT,UAAU,EAAE,MAAM,aAAa,MAAM,WAAW,KAAK;AAAA,EACrD,SAAS;AAAA,IACP,SAAS,WAAW,0DAA0D;AAAA,IAC9E,QAAQ,CAAC;AAAA,EACX;AAAA,EACA,YAAY,CAAC;AAAA,EACb,WAAW,CAAC;AAAA,EACZ,OAAO,EAAE,MAAM,CAAC,EAAE;AAAA,EAClB,YAAY,CAAC;AAAA,EACb,SAAS,CAAC;AAAA,EACV,UAAU,CAAC;AAAA,EACX,OAAO,CAAC;AAAA,EACR,WAAW,CAAC;AAAA,EACZ,QAAQ;AACV;",
6
- "names": ["BaseCapability", "ToolApproval", "SandboxAccess", "SandboxAttach", "McpServerBindingKind", "ScheduleTarget", "ScheduleDelivery", "InputApprovalKind", "InstructionRole"]
4
+ "sourcesContent": ["import * as z from 'zod';\nimport { agentAvatarSchema } from '@finalai/agent-protocol';\nimport { containsDynamicSlot, DynamicEvent, maybeDynamic } from \"./dynamic.mjs\";\nimport { jsonObjectSchema, jsonSchemaSchema, jsonValueSchema } from \"./json.mjs\";\nimport { packageRef, providerRefSchema } from \"./provider-ref.mjs\";\n\nexport { agentAvatarSchema, avatarMediaSchema } from '@finalai/agent-protocol';\nexport type { AgentAvatarIface, AvatarMedia, AvatarState } from '@finalai/agent-protocol';\n\n// The Agent Manifest. It lives in the provider contract\n// package because it is what harnesses, sandboxes and channels receive;\n// @finalai/agent-definition compiles directories into it and re-exports it.\n//\n// A harness owns its loop, native tools, prompt assembly, models, permission\n// modes, memory and compaction: all of that is `harness.config`, typed by the\n// harness's own configSchema. What ACP standardizes (MCP servers, prompts,\n// permissions, cancellation) is session input, identical for every harness.\n\nexport const MANIFEST_VERSION = 3;\n\n// Base tool capability classes, one to one with sandbox handle capabilities.\nexport enum BaseCapability {\n Shell = 'shell',\n Files = 'files',\n Process = 'process',\n Ports = 'ports',\n Browser = 'browser',\n ComputerUse = 'computerUse',\n}\n\nexport enum ToolApproval {\n Allow = 'allow',\n Ask = 'ask',\n}\n\n// What a session may do on a sandbox target: read files; also run\n// processes (execute, without file writes); or everything (write).\nexport enum SandboxAccess {\n Read = 'read',\n Execute = 'execute',\n Write = 'write',\n}\n\nconst SANDBOX_ACCESS_RANK = {\n [SandboxAccess.Read]: 0,\n [SandboxAccess.Execute]: 1,\n [SandboxAccess.Write]: 2,\n} satisfies Record<SandboxAccess, number>;\n\n// Each access includes the ones before it: read < execute < write.\nexport const sandboxAccessAtLeast = (access: SandboxAccess, floor: SandboxAccess): boolean =>\n SANDBOX_ACCESS_RANK[access] >= SANDBOX_ACCESS_RANK[floor];\n\nexport const narrowerSandboxAccess = (a: SandboxAccess, b: SandboxAccess): SandboxAccess =>\n SANDBOX_ACCESS_RANK[a] <= SANDBOX_ACCESS_RANK[b] ? a : b;\n\nexport enum SandboxAttach {\n Lazy = 'lazy',\n OnPrompt = 'on-prompt',\n}\n\nexport enum McpServerBindingKind {\n // Authored tools, served from the agent's Worker isolate behind the MCP host.\n Worker = 'worker',\n Http = 'http',\n}\n\nexport enum ScheduleTarget {\n OwnerDirect = 'owner-direct',\n BoundConversation = 'bound-conversation',\n}\n\n// Whether a schedule's firing must get a visible reply. Values match the schedules API.\nexport enum ScheduleDelivery {\n Always = 'always',\n // The agent replies only when there is something to say; an empty turn posts nothing.\n IfNeeded = 'if_needed',\n}\n\nexport const identitySchema = z.object({\n name: z.string().min(1).max(120),\n description: z.string().max(2000).nullable(),\n avatar: agentAvatarSchema.optional(),\n});\n\nexport enum InputApprovalKind {\n Tool = 'tool',\n Connection = 'connection',\n}\n\nexport const inputApprovalSchema = z.object({\n kind: z.nativeEnum(InputApprovalKind),\n export: z.string().min(1),\n // Connection default when absent; otherwise tools.approval[policyKey].\n policyKey: z.string().min(1).optional(),\n dynamic: jsonObjectSchema.optional(),\n});\nexport type InputApprovalIface = z.infer<typeof inputApprovalSchema>;\n\n// Tool descriptors are stored statically so `tools/list` never needs the isolate.\nexport const toolDescriptorSchema = z.object({\n name: z.string().min(1),\n description: z.string(),\n inputSchema: jsonSchemaSchema,\n outputSchema: jsonSchemaSchema.optional(),\n annotations: z\n .object({\n title: z.string().optional(),\n readOnlyHint: z.boolean().optional(),\n destructiveHint: z.boolean().optional(),\n idempotentHint: z.boolean().optional(),\n openWorldHint: z.boolean().optional(),\n })\n .optional(),\n // Bundle export implementing it ('tools/lookup_release_notes').\n export: z.string().min(1).optional(),\n // Boundary snapshot used to reconstruct dynamic tools after isolate eviction.\n dynamic: jsonObjectSchema.optional(),\n inputApproval: inputApprovalSchema.optional(),\n});\n\nexport const mcpAuthSchema = z.union([\n z.object({ secretKey: z.string().min(1), headerName: z.string().min(1).nullable() }),\n // Resolved by the broker to a session-scoped grant (Final's own MCP server).\n z.object({ kind: z.literal('final-session') }),\n]);\n\nconst toolApprovalsSchema = z.record(z.string(), z.nativeEnum(ToolApproval)).nullable();\n\n// MCP tool annotation hints a connection policy selects on (./tool-annotations.ts).\nexport const toolAnnotationSelectorSchema = z\n .strictObject({\n readOnlyHint: z.boolean().optional(),\n destructiveHint: z.boolean().optional(),\n idempotentHint: z.boolean().optional(),\n openWorldHint: z.boolean().optional(),\n })\n .refine((selector) => Object.keys(selector).length > 0, 'Select at least one annotation');\n\n// Tools exposed because their annotations match, with the approval (and the\n// connection default's input predicate) they run under.\nexport const toolAnnotationRuleSchema = z.object({\n match: toolAnnotationSelectorSchema,\n approval: z.nativeEnum(ToolApproval),\n inputApproval: inputApprovalSchema.optional(),\n});\n\nexport const workerMcpServerBindingSchema = z.object({\n key: z.string().min(1),\n kind: z.literal(McpServerBindingKind.Worker),\n tools: z.array(toolDescriptorSchema),\n approvals: toolApprovalsSchema,\n});\n\nexport const httpMcpServerBindingSchema = z.object({\n key: z.string().min(1),\n kind: z.literal(McpServerBindingKind.Http),\n url: z.string().url(),\n auth: mcpAuthSchema.nullable(),\n headers: z.record(z.string(), z.string()).default({}),\n // Null allows every tool the server lists, each with the default approval.\n // Keys are tool names or `*` patterns (./tool-patterns.ts); the most\n // specific matching key governs a tool.\n approvals: toolApprovalsSchema,\n // Tool names or `*` patterns hidden even when `approvals` would expose them.\n deny: z.array(z.string().min(1)).optional(),\n // Exposed tools (names or `*` patterns) the harness lists up front. Absent\n // lists every exposed tool; otherwise the host keeps the rest reachable\n // through search (HOSTING.md).\n load: z.array(z.string().min(1)).optional(),\n // Tools also exposed by their MCP annotations; named tools keep `approvals`.\n allowAnnotations: z.array(toolAnnotationRuleSchema).optional(),\n // Tools hidden by their MCP annotations, whatever else exposes them.\n denyAnnotations: z.array(toolAnnotationSelectorSchema).optional(),\n // The authored resolver that produced this connection, for retained boundary values.\n dynamicResolver: z.string().min(1).optional(),\n inputApprovals: z.record(z.string(), inputApprovalSchema).optional(),\n});\n\nexport const mcpServerBindingSchema = z.discriminatedUnion('kind', [\n workerMcpServerBindingSchema,\n httpMcpServerBindingSchema,\n]);\n\nexport const sandboxBindingSchema = z.object({\n provider: providerRefSchema,\n // Provider-defined environment options (`computer`: a setup guide reference or\n // inline guide plus start-time parameters). Validated by the provider.\n environment: maybeDynamic(jsonValueSchema),\n access: z.nativeEnum(SandboxAccess).default(SandboxAccess.Write),\n attach: z.nativeEnum(SandboxAttach).default(SandboxAttach.Lazy),\n});\n\nexport const baseToolsSchema = z.object({\n base: z.partialRecord(z.nativeEnum(BaseCapability), z.object({ target: z.string().min(1) })),\n // Capabilities declared on the harness's own host with no sandbox target\n // (`baseTools({ shell: harnessHost })`): only a harness that\n // provides them natively (host-disableable, host-fixed) can serve them.\n host: z.array(z.nativeEnum(BaseCapability)).optional(),\n});\n\nexport const channelBindingSchema = z.object({\n // Stable within the definition; publish maps it to a binding id.\n key: z.string().min(1),\n channel: providerRefSchema,\n config: jsonObjectSchema.default({}),\n source: z.string().optional(),\n});\n\nexport const hookBindingSchema = z.object({\n slug: z.string().min(1),\n export: z.string().min(1),\n events: z.array(z.string().min(1)).min(1),\n});\n\nexport const scheduleDefinitionSchema = z.object({\n key: z.string().min(1),\n cron: z.string().min(1),\n timezone: z.string().min(1),\n prompt: z.string().min(1),\n target: z.nativeEnum(ScheduleTarget),\n});\n\nexport const bundleSchema = z.object({\n // Absent on historical revisions: the host must inspect their resources.\n hasPreparationFiles: z.boolean().optional(),\n hash: z.string().min(1),\n // Dynamic slot path \u2192 resolver export and events.\n resolvers: z.record(\n z.string(),\n z.object({ export: z.string().min(1), events: z.array(z.nativeEnum(DynamicEvent)).min(1) }),\n ),\n});\n\nexport const harnessBindingSchema = z.object({\n harness: providerRefSchema,\n // Validated against the harness's configSchema; may contain dynamic slots at\n // any depth (an instruction fragment, the model).\n config: maybeDynamic(jsonValueSchema),\n});\n\nexport const agentManifestSchema = z.object({\n // Read persisted v2 revisions; v3 writers require hosts enforcing hosted bindings.\n version: z.union([z.literal(2), z.literal(MANIFEST_VERSION)]),\n identity: identitySchema,\n harness: harnessBindingSchema,\n mcpServers: maybeDynamic(z.array(mcpServerBindingSchema)),\n sandboxes: maybeDynamic(z.record(z.string(), sandboxBindingSchema)),\n tools: baseToolsSchema,\n toolPolicy: z.record(z.string(), z.nativeEnum(ToolApproval)),\n // Organization secrets this agent may read, by name (`secrets.get`,\n // MCP `secretKey`, `apiKey({ secret })`). Nothing else is readable;\n // binding organization secrets requires an organization admin at publish.\n secrets: z.array(z.string().min(1)).default([]),\n channels: z.array(channelBindingSchema),\n channelSources: z\n .record(z.string(), z.object({ path: z.string(), source: z.string(), disabled: z.boolean() }))\n .optional(),\n hooks: z.array(hookBindingSchema),\n schedules: z.array(scheduleDefinitionSchema),\n bundle: bundleSchema.nullable(),\n});\n\n// What one session actually got: every dynamic slot replaced by its resolved\n// value (stored in agent.session_manifests).\nexport const resolvedAgentManifestSchema = agentManifestSchema\n .extend({\n harness: z.object({ harness: providerRefSchema, config: jsonValueSchema }),\n mcpServers: z.array(mcpServerBindingSchema),\n sandboxes: z.record(z.string(), sandboxBindingSchema.extend({ environment: jsonValueSchema })),\n })\n .superRefine((manifest, ctx) => {\n if (containsDynamicSlot(manifest)) {\n ctx.addIssue({\n code: 'custom',\n message: 'a resolved manifest must not contain dynamic slots',\n });\n }\n });\n\nexport type IdentityIface = z.infer<typeof identitySchema>;\nexport type ToolDescriptorIface = z.infer<typeof toolDescriptorSchema>;\nexport type McpAuth = z.infer<typeof mcpAuthSchema>;\nexport type WorkerMcpServerBindingIface = z.infer<typeof workerMcpServerBindingSchema>;\nexport type HttpMcpServerBindingIface = z.infer<typeof httpMcpServerBindingSchema>;\nexport type ToolAnnotationSelectorIface = z.infer<typeof toolAnnotationSelectorSchema>;\nexport type ToolAnnotationRuleIface = z.infer<typeof toolAnnotationRuleSchema>;\nexport type McpServerBinding = z.infer<typeof mcpServerBindingSchema>;\nexport type SandboxBindingIface = z.infer<typeof sandboxBindingSchema>;\nexport type BaseToolsIface = z.infer<typeof baseToolsSchema>;\nexport type ChannelBindingIface = z.infer<typeof channelBindingSchema>;\nexport type HookBindingIface = z.infer<typeof hookBindingSchema>;\nexport type ScheduleDefinitionIface = z.infer<typeof scheduleDefinitionSchema>;\nexport type BundleIface = z.infer<typeof bundleSchema>;\nexport type HarnessBindingIface = z.infer<typeof harnessBindingSchema>;\nexport type AgentManifestIface = z.infer<typeof agentManifestSchema>;\nexport type ResolvedAgentManifestIface = z.infer<typeof resolvedAgentManifestSchema>;\nexport type ResolvedSandboxBindingIface = ResolvedAgentManifestIface['sandboxes'][string];\n\n// The fields of a harness config the platform itself reads through the shared\n// schema fragments; everything else is opaque to the platform.\nexport enum InstructionRole {\n System = 'system',\n User = 'user',\n}\n\nexport const instructionFragmentSchema = z.object({\n role: z.nativeEnum(InstructionRole),\n content: z.string(),\n // Source file, for the compatibility report and Build.\n source: z.string().optional(),\n});\n\nexport const skillFileSchema = z.object({ path: z.string().min(1), content: z.string() });\nexport const skillBundleSchema = z.object({\n key: z.string().min(1),\n description: z.string().optional(),\n files: z.array(skillFileSchema),\n});\n\nexport type InstructionFragmentIface = z.infer<typeof instructionFragmentSchema>;\nexport type SkillBundleIface = z.infer<typeof skillBundleSchema>;\n\nexport const emptyManifest = (name: string): AgentManifestIface => ({\n version: MANIFEST_VERSION,\n identity: { name, description: null },\n harness: {\n harness: packageRef('@finalai/final-agent-provider/harnesses/serverless-final'),\n config: {},\n },\n mcpServers: [],\n sandboxes: {},\n tools: { base: {} },\n toolPolicy: {},\n secrets: [],\n channels: [],\n hooks: [],\n schedules: [],\n bundle: null,\n});\n"],
5
+ "mappings": "AAAA,YAAY,OAAO;AACnB,SAAS,yBAAyB;AAClC,SAAS,qBAAqB,cAAc,oBAAoB;AAChE,SAAS,kBAAkB,kBAAkB,uBAAuB;AACpE,SAAS,YAAY,yBAAyB;AAE9C,SAAS,qBAAAA,oBAAmB,yBAAyB;AAY9C,MAAM,mBAAmB;AAGzB,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,iBAAc;AANJ,SAAAA;AAAA,GAAA;AASL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,WAAQ;AACR,EAAAA,cAAA,SAAM;AAFI,SAAAA;AAAA,GAAA;AAOL,IAAK,gBAAL,kBAAKC,mBAAL;AACL,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,aAAU;AACV,EAAAA,eAAA,WAAQ;AAHE,SAAAA;AAAA,GAAA;AAMZ,MAAM,sBAAsB;AAAA,EAC1B,CAAC,iBAAkB,GAAG;AAAA,EACtB,CAAC,uBAAqB,GAAG;AAAA,EACzB,CAAC,mBAAmB,GAAG;AACzB;AAGO,MAAM,uBAAuB,CAAC,QAAuB,UAC1D,oBAAoB,MAAM,KAAK,oBAAoB,KAAK;AAEnD,MAAM,wBAAwB,CAAC,GAAkB,MACtD,oBAAoB,CAAC,KAAK,oBAAoB,CAAC,IAAI,I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9B,MAAI,oBAAoB,QAAQ,GAAG;AACjC,QAAI,SAAS;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AACF,CAAC;AAuBI,IAAK,kBAAL,kBAAKC,qBAAL;AACL,EAAAA,iBAAA,YAAS;AACT,EAAAA,iBAAA,UAAO;AAFG,SAAAA;AAAA,GAAA;AAKL,MAAM,4BAA4B,EAAE,OAAO;AAAA,EAChD,MAAM,EAAE,WAAW,eAAe;AAAA,EAClC,SAAS,EAAE,OAAO;AAAA;AAAA,EAElB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAEM,MAAM,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC;AACjF,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACrB,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,OAAO,EAAE,MAAM,eAAe;AAChC,CAAC;AAKM,MAAM,gBAAgB,CAAC,UAAsC;AAAA,EAClE,SAAS;AAAA,EACT,UAAU,EAAE,MAAM,aAAa,KAAK;AAAA,EACpC,SAAS;AAAA,IACP,SAAS,WAAW,0DAA0D;AAAA,IAC9E,QAAQ,CAAC;AAAA,EACX;AAAA,EACA,YAAY,CAAC;AAAA,EACb,WAAW,CAAC;AAAA,EACZ,OAAO,EAAE,MAAM,CAAC,EAAE;AAAA,EAClB,YAAY,CAAC;AAAA,EACb,SAAS,CAAC;AAAA,EACV,UAAU,CAAC;AAAA,EACX,OAAO,CAAC;AAAA,EACR,WAAW,CAAC;AAAA,EACZ,QAAQ;AACV;",
6
+ "names": ["agentAvatarSchema", "BaseCapability", "ToolApproval", "SandboxAccess", "SandboxAttach", "McpServerBindingKind", "ScheduleTarget", "ScheduleDelivery", "InputApprovalKind", "InstructionRole"]
7
7
  }
@@ -1,3 +1,4 @@
1
+ import type { HostedBindingsIface } from "../hosted-bindings.mjs";
1
2
  import type { ProcessInspectionRequestIface, ProcessInspectionResultIface } from '@finalai/agent-protocol/process-inspection';
2
3
  import type { JsonValue } from "../json.mjs";
3
4
  import type { ToolDescriptorIface } from "../manifest.mjs";
@@ -239,10 +240,12 @@ export interface SandboxActingUserIface {
239
240
  }
240
241
  export declare const noSandboxActingUser: SandboxActingUserIface;
241
242
  export interface SandboxOfferContextIface {
243
+ bindings?: HostedBindingsIface;
242
244
  organizationId: string;
243
245
  actingUser: SandboxActingUserIface;
244
246
  }
245
247
  export interface SandboxEnvironmentContextIface {
248
+ bindings?: HostedBindingsIface;
246
249
  organizationId: string;
247
250
  guides: SandboxGuidesIface;
248
251
  }
@@ -258,6 +261,7 @@ export interface SandboxPreparationSourceIface {
258
261
  }>;
259
262
  }
260
263
  export interface SandboxPrepareContextIface {
264
+ bindings?: HostedBindingsIface;
261
265
  preparation?: SandboxPreparationSourceIface;
262
266
  artifacts?: SandboxArtifactsIface;
263
267
  files: Record<string, string>;
@@ -270,6 +274,7 @@ export interface SandboxPrepareContextIface {
270
274
  log?: (message: string) => void;
271
275
  }
272
276
  export interface SandboxStartContextIface {
277
+ bindings?: HostedBindingsIface;
273
278
  /** Passive recovery only: never wake, create, seed, or restart backend services. */
274
279
  passive?: boolean;
275
280
  preparation?: SandboxPreparationSourceIface;