@finalai/agent-provider 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOSTING.md +334 -245
- package/README.md +93 -14
- package/dist/modules/canonical-json.d.mts +4 -0
- package/dist/modules/canonical-json.mjs +33 -0
- package/dist/modules/canonical-json.mjs.map +7 -0
- package/dist/modules/channel.d.mts +0 -3
- package/dist/modules/channel.mjs.map +1 -1
- package/dist/modules/code-host/host.d.mts +10 -0
- package/dist/modules/code-host/host.mjs +88 -0
- package/dist/modules/code-host/host.mjs.map +7 -0
- package/dist/modules/code-host/in-process.d.mts +24 -0
- package/dist/modules/code-host/in-process.mjs +89 -0
- package/dist/modules/code-host/in-process.mjs.map +7 -0
- package/dist/modules/code-host/index.d.mts +4 -0
- package/dist/modules/code-host/index.mjs +5 -0
- package/dist/modules/code-host/index.mjs.map +7 -0
- package/dist/modules/code-host/serverless.d.mts +63 -0
- package/dist/modules/code-host/serverless.mjs +27 -0
- package/dist/modules/code-host/serverless.mjs.map +7 -0
- package/dist/modules/code-host/types.d.mts +152 -0
- package/dist/modules/code-host/types.mjs +85 -0
- package/dist/modules/code-host/types.mjs.map +7 -0
- package/dist/modules/conformance/agent.mjs +72 -6
- package/dist/modules/conformance/agent.mjs.map +2 -2
- package/dist/modules/conformance/harness-kit.d.mts +9 -2
- package/dist/modules/conformance/harness-kit.mjs +224 -63
- package/dist/modules/conformance/harness-kit.mjs.map +3 -3
- package/dist/modules/conformance/local-harness.d.mts +1 -4
- package/dist/modules/conformance/local-harness.mjs +21 -22
- package/dist/modules/conformance/local-harness.mjs.map +2 -2
- package/dist/modules/conformance/protocol.d.mts +1 -0
- package/dist/modules/conformance/protocol.mjs +2 -0
- package/dist/modules/conformance/protocol.mjs.map +2 -2
- package/dist/modules/conformance/sandbox-kit.d.mts +12 -4
- package/dist/modules/conformance/sandbox-kit.mjs +189 -103
- package/dist/modules/conformance/sandbox-kit.mjs.map +2 -2
- package/dist/modules/conformance/scripted-model/chat-completions.mjs +1 -0
- package/dist/modules/conformance/scripted-model/chat-completions.mjs.map +2 -2
- package/dist/modules/conformance/scripted-model/directives.d.mts +3 -0
- package/dist/modules/conformance/scripted-model/directives.mjs +26 -10
- package/dist/modules/conformance/scripted-model/directives.mjs.map +2 -2
- package/dist/modules/conformance/scripted-model/messages.mjs +1 -0
- package/dist/modules/conformance/scripted-model/messages.mjs.map +2 -2
- package/dist/modules/conformance/scripted-model/responses.mjs +2 -0
- package/dist/modules/conformance/scripted-model/responses.mjs.map +2 -2
- package/dist/modules/conformance/stdio.d.mts +21 -0
- package/dist/modules/conformance/stdio.mjs +158 -0
- package/dist/modules/conformance/stdio.mjs.map +7 -0
- package/dist/modules/credential-routes.d.mts +2 -0
- package/dist/modules/credential-routes.mjs +2 -0
- package/dist/modules/credential-routes.mjs.map +2 -2
- package/dist/modules/document.d.mts +376 -0
- package/dist/modules/document.mjs +208 -0
- package/dist/modules/document.mjs.map +7 -0
- package/dist/modules/harness-configuration.d.mts +16 -0
- package/dist/modules/harness-configuration.mjs +83 -0
- package/dist/modules/harness-configuration.mjs.map +7 -0
- package/dist/modules/harness-definition.d.mts +280 -0
- package/dist/modules/harness-definition.mjs +430 -0
- package/dist/modules/harness-definition.mjs.map +7 -0
- package/dist/modules/harness-provider.d.mts +197 -0
- package/dist/modules/harness-provider.mjs +108 -0
- package/dist/modules/harness-provider.mjs.map +7 -0
- package/dist/modules/harness-requirements.d.mts +19 -0
- package/dist/modules/harness-requirements.mjs +40 -0
- package/dist/modules/harness-requirements.mjs.map +7 -0
- package/dist/modules/harness-start.d.mts +33 -0
- package/dist/modules/harness-start.mjs +107 -0
- package/dist/modules/harness-start.mjs.map +7 -0
- package/dist/modules/harness.d.mts +84 -109
- package/dist/modules/harness.mjs +56 -111
- package/dist/modules/harness.mjs.map +3 -3
- package/dist/modules/identity.d.mts +1 -0
- package/dist/modules/identity.mjs +2 -0
- package/dist/modules/identity.mjs.map +7 -0
- package/dist/modules/index.d.mts +12 -6
- package/dist/modules/index.mjs +12 -6
- package/dist/modules/index.mjs.map +2 -2
- package/dist/modules/inference.d.mts +35 -0
- package/dist/modules/inference.mjs +74 -0
- package/dist/modules/inference.mjs.map +7 -0
- package/dist/modules/local-channel-context.mjs +1 -1
- package/dist/modules/local-channel-context.mjs.map +2 -2
- package/dist/modules/requirements-check.d.mts +30 -0
- package/dist/modules/requirements-check.mjs +164 -0
- package/dist/modules/requirements-check.mjs.map +7 -0
- package/dist/modules/room-surface.d.mts +0 -5
- package/dist/modules/room-surface.mjs.map +2 -2
- package/dist/modules/sandbox/client.d.mts +3 -0
- package/dist/modules/sandbox/client.mjs +101 -18
- package/dist/modules/sandbox/client.mjs.map +2 -2
- package/dist/modules/sandbox/grant.d.mts +78 -0
- package/dist/modules/sandbox/grant.mjs +134 -0
- package/dist/modules/sandbox/grant.mjs.map +7 -0
- package/dist/modules/sandbox/index.d.mts +3 -3
- package/dist/modules/sandbox/index.mjs +4 -5
- package/dist/modules/sandbox/index.mjs.map +2 -2
- package/dist/modules/sandbox/mcp-hosted.d.mts +1 -1
- package/dist/modules/sandbox/mcp-hosted.mjs +4 -7
- package/dist/modules/sandbox/mcp-hosted.mjs.map +2 -2
- package/dist/modules/sandbox/mcp.d.mts +4 -2
- package/dist/modules/sandbox/mcp.mjs +14 -7
- package/dist/modules/sandbox/mcp.mjs.map +2 -2
- package/dist/modules/sandbox/memory-sandbox.d.mts +2 -1
- package/dist/modules/sandbox/memory-sandbox.mjs +71 -41
- package/dist/modules/sandbox/memory-sandbox.mjs.map +2 -2
- package/dist/modules/sandbox/networking.d.mts +7 -7
- package/dist/modules/sandbox/networking.mjs +16 -9
- package/dist/modules/sandbox/networking.mjs.map +2 -2
- package/dist/modules/sandbox/remote/adapter.d.mts +30 -0
- package/dist/modules/sandbox/remote/adapter.mjs +381 -0
- package/dist/modules/sandbox/remote/adapter.mjs.map +7 -0
- package/dist/modules/sandbox/remote/errors.d.mts +10 -0
- package/dist/modules/sandbox/remote/errors.mjs +62 -0
- package/dist/modules/sandbox/remote/errors.mjs.map +7 -0
- package/dist/modules/sandbox/remote/index.d.mts +5 -0
- package/dist/modules/sandbox/remote/index.mjs +6 -0
- package/dist/modules/sandbox/remote/index.mjs.map +7 -0
- package/dist/modules/sandbox/remote/ndjson.d.mts +6 -0
- package/dist/modules/sandbox/remote/ndjson.mjs +80 -0
- package/dist/modules/sandbox/remote/ndjson.mjs.map +7 -0
- package/dist/modules/sandbox/remote/platform-api.d.mts +8 -0
- package/dist/modules/sandbox/remote/platform-api.mjs +15 -0
- package/dist/modules/sandbox/remote/platform-api.mjs.map +7 -0
- package/dist/modules/sandbox/remote/preamble.d.mts +7 -0
- package/dist/modules/sandbox/remote/preamble.mjs +51 -0
- package/dist/modules/sandbox/remote/preamble.mjs.map +7 -0
- package/dist/modules/sandbox/remote/serve.d.mts +34 -0
- package/dist/modules/sandbox/remote/serve.mjs +519 -0
- package/dist/modules/sandbox/remote/serve.mjs.map +7 -0
- package/dist/modules/sandbox/remote/testing.d.mts +34 -0
- package/dist/modules/sandbox/remote/testing.mjs +275 -0
- package/dist/modules/sandbox/remote/testing.mjs.map +7 -0
- package/dist/modules/sandbox/seeds.d.mts +2 -2
- package/dist/modules/sandbox/seeds.mjs +2 -2
- package/dist/modules/sandbox/seeds.mjs.map +2 -2
- package/dist/modules/sandbox/server.d.mts +4 -6
- package/dist/modules/sandbox/server.mjs +93 -49
- package/dist/modules/sandbox/server.mjs.map +2 -2
- package/dist/modules/sandbox/setup/apply.d.mts +41 -0
- package/dist/modules/sandbox/setup/apply.mjs +204 -0
- package/dist/modules/sandbox/setup/apply.mjs.map +7 -0
- package/dist/modules/sandbox/setup/describe.d.mts +10 -0
- package/dist/modules/sandbox/setup/describe.mjs +62 -0
- package/dist/modules/sandbox/setup/describe.mjs.map +7 -0
- package/dist/modules/sandbox/setup/index.d.mts +6 -0
- package/dist/modules/sandbox/setup/index.mjs +17 -0
- package/dist/modules/sandbox/setup/index.mjs.map +7 -0
- package/dist/modules/sandbox/setup/paths.d.mts +8 -0
- package/dist/modules/sandbox/setup/paths.mjs +18 -0
- package/dist/modules/sandbox/setup/paths.mjs.map +7 -0
- package/dist/modules/sandbox/setup/schema.d.mts +42 -0
- package/dist/modules/sandbox/setup/schema.mjs +58 -0
- package/dist/modules/sandbox/setup/schema.mjs.map +7 -0
- package/dist/modules/sandbox/tool-policy.d.mts +1 -1
- package/dist/modules/sandbox/tool-policy.mjs +1 -1
- package/dist/modules/sandbox/tool-policy.mjs.map +2 -2
- package/dist/modules/sandbox/types.d.mts +117 -130
- package/dist/modules/sandbox/types.mjs +46 -50
- package/dist/modules/sandbox/types.mjs.map +3 -3
- package/dist/modules/sandbox/wire.d.mts +93 -6
- package/dist/modules/sandbox/wire.mjs +61 -38
- package/dist/modules/sandbox/wire.mjs.map +2 -2
- package/dist/modules/schemas.d.mts +5 -76
- package/dist/modules/schemas.mjs +18 -85
- package/dist/modules/schemas.mjs.map +2 -2
- package/dist/modules/tool-annotations.d.mts +15 -6
- package/dist/modules/tool-annotations.mjs +9 -3
- package/dist/modules/tool-annotations.mjs.map +2 -2
- package/dist/modules/tool-descriptor.d.mts +16 -0
- package/dist/modules/tool-descriptor.mjs +19 -0
- package/dist/modules/tool-descriptor.mjs.map +7 -0
- package/dist/modules/tool-patterns.d.mts +7 -7
- package/dist/modules/tool-patterns.mjs +10 -9
- package/dist/modules/tool-patterns.mjs.map +2 -2
- package/package.json +86 -36
- package/dist/modules/credentials.d.mts +0 -206
- package/dist/modules/credentials.mjs +0 -207
- package/dist/modules/credentials.mjs.map +0 -7
- package/dist/modules/dynamic.d.mts +0 -40
- package/dist/modules/dynamic.mjs +0 -79
- package/dist/modules/dynamic.mjs.map +0 -7
- package/dist/modules/hosted-bindings.d.mts +0 -15
- package/dist/modules/hosted-bindings.mjs +0 -21
- package/dist/modules/hosted-bindings.mjs.map +0 -7
- package/dist/modules/manifest.d.mts +0 -791
- package/dist/modules/manifest.mjs +0 -322
- package/dist/modules/manifest.mjs.map +0 -7
- package/dist/modules/provider-ref.d.mts +0 -29
- package/dist/modules/provider-ref.mjs +0 -55
- package/dist/modules/provider-ref.mjs.map +0 -7
- package/dist/modules/sandbox/open-scope-node.d.mts +0 -4
- package/dist/modules/sandbox/open-scope-node.mjs +0 -19
- package/dist/modules/sandbox/open-scope-node.mjs.map +0 -7
- package/dist/modules/sandbox/open-scope.d.mts +0 -16
- package/dist/modules/sandbox/open-scope.mjs +0 -66
- package/dist/modules/sandbox/open-scope.mjs.map +0 -7
- package/dist/modules/sandbox/workspace-identity.d.mts +0 -5
- package/dist/modules/sandbox/workspace-identity.mjs +0 -14
- package/dist/modules/sandbox/workspace-identity.mjs.map +0 -7
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { Capability, type CapabilityAccess } from '@finalai/agent-protocol';
|
|
3
|
+
import { PermissionLevel } from '@finalai/agent-protocol/agent-platform';
|
|
4
|
+
export declare const AGENT_DOCUMENT_VERSION = 5;
|
|
5
|
+
export declare enum CodePlacement {
|
|
6
|
+
InProcess = "in-process",
|
|
7
|
+
Serverless = "serverless"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ToolApprovalMode {
|
|
10
|
+
Allow = "allow",
|
|
11
|
+
Ask = "ask"
|
|
12
|
+
}
|
|
13
|
+
export declare const serverlessSourceSchema: z.ZodObject<{
|
|
14
|
+
source: z.ZodString;
|
|
15
|
+
export: z.ZodDefault<z.ZodString>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export declare const codeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
|
+
placement: z.ZodLiteral<CodePlacement.InProcess>;
|
|
19
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
20
|
+
source: z.ZodString;
|
|
21
|
+
export: z.ZodDefault<z.ZodString>;
|
|
22
|
+
placement: z.ZodLiteral<CodePlacement.Serverless>;
|
|
23
|
+
}, z.core.$strict>], "placement">;
|
|
24
|
+
export type CodeIface = z.infer<typeof codeSchema>;
|
|
25
|
+
export declare const toolAnnotationsSchema: z.ZodObject<{
|
|
26
|
+
title: z.ZodOptional<z.ZodString>;
|
|
27
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export declare const toolApprovalSchema: z.ZodUnion<readonly [z.ZodEnum<typeof ToolApprovalMode>, z.ZodObject<{
|
|
33
|
+
whenInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
34
|
+
placement: z.ZodLiteral<CodePlacement.InProcess>;
|
|
35
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
36
|
+
source: z.ZodString;
|
|
37
|
+
export: z.ZodDefault<z.ZodString>;
|
|
38
|
+
placement: z.ZodLiteral<CodePlacement.Serverless>;
|
|
39
|
+
}, z.core.$strict>], "placement">;
|
|
40
|
+
}, z.core.$strict>]>;
|
|
41
|
+
export declare const documentToolSchema: z.ZodObject<{
|
|
42
|
+
description: z.ZodString;
|
|
43
|
+
inputSchema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
|
|
44
|
+
outputSchema: z.ZodOptional<z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>>;
|
|
45
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
title: z.ZodOptional<z.ZodString>;
|
|
47
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
approval: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof ToolApprovalMode>, z.ZodObject<{
|
|
53
|
+
whenInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
54
|
+
placement: z.ZodLiteral<CodePlacement.InProcess>;
|
|
55
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
56
|
+
source: z.ZodString;
|
|
57
|
+
export: z.ZodDefault<z.ZodString>;
|
|
58
|
+
placement: z.ZodLiteral<CodePlacement.Serverless>;
|
|
59
|
+
}, z.core.$strict>], "placement">;
|
|
60
|
+
}, z.core.$strict>]>>;
|
|
61
|
+
code: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
62
|
+
placement: z.ZodLiteral<CodePlacement.InProcess>;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
source: z.ZodString;
|
|
65
|
+
export: z.ZodDefault<z.ZodString>;
|
|
66
|
+
placement: z.ZodLiteral<CodePlacement.Serverless>;
|
|
67
|
+
}, z.core.$strict>], "placement">;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export type DocumentToolIface = z.infer<typeof documentToolSchema>;
|
|
70
|
+
export declare const documentHookSchema: z.ZodObject<{
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
events: z.ZodArray<z.ZodString>;
|
|
73
|
+
code: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
|
+
placement: z.ZodLiteral<CodePlacement.InProcess>;
|
|
75
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
76
|
+
source: z.ZodString;
|
|
77
|
+
export: z.ZodDefault<z.ZodString>;
|
|
78
|
+
placement: z.ZodLiteral<CodePlacement.Serverless>;
|
|
79
|
+
}, z.core.$strict>], "placement">;
|
|
80
|
+
}, z.core.$strict>;
|
|
81
|
+
export type DocumentHookIface = z.infer<typeof documentHookSchema>;
|
|
82
|
+
export declare const documentSkillSchema: z.ZodObject<{
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
description: z.ZodOptional<z.ZodString>;
|
|
85
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
export type DocumentSkillIface = z.infer<typeof documentSkillSchema>;
|
|
88
|
+
export declare enum HarnessFeature {
|
|
89
|
+
Skills = "skills",
|
|
90
|
+
McpTools = "mcpTools",
|
|
91
|
+
NativeToolPolicy = "nativeToolPolicy",
|
|
92
|
+
SystemInstructions = "systemInstructions"
|
|
93
|
+
}
|
|
94
|
+
export declare const harnessRecommendationSchema: z.ZodObject<{
|
|
95
|
+
harness: z.ZodString;
|
|
96
|
+
model: z.ZodOptional<z.ZodString>;
|
|
97
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
export declare const harnessRequirementSchema: z.ZodObject<{
|
|
100
|
+
permissionMode: z.ZodEnum<typeof PermissionLevel>;
|
|
101
|
+
optionalFeatures: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof HarnessFeature>>>;
|
|
102
|
+
recommended: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
harness: z.ZodString;
|
|
104
|
+
model: z.ZodOptional<z.ZodString>;
|
|
105
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strict>>;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
export type HarnessRequirementIface = z.infer<typeof harnessRequirementSchema>;
|
|
109
|
+
export declare const computeRequirementsSchema: z.ZodObject<{
|
|
110
|
+
files: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").FilesAccess>;
|
|
112
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
113
|
+
description: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
shell: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ShellAccess>;
|
|
117
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
118
|
+
description: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$strict>>;
|
|
120
|
+
computerUse: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ScreenAccess>;
|
|
122
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
123
|
+
description: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strict>>;
|
|
125
|
+
browserUse: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ScreenAccess>;
|
|
127
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
128
|
+
description: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
export interface ComputeRequirementIface {
|
|
132
|
+
access: CapabilityAccess;
|
|
133
|
+
optional: boolean;
|
|
134
|
+
description?: string;
|
|
135
|
+
}
|
|
136
|
+
export declare const toolAnnotationSelectorSchema: z.ZodObject<{
|
|
137
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
export declare const integrationToolPolicySchema: z.ZodObject<{
|
|
143
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
144
|
+
deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
145
|
+
load: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
146
|
+
allowAnnotations: z.ZodOptional<z.ZodArray<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
|
+
denyAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
153
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
}, z.core.$strict>>>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
export declare const integrationRequirementSchema: z.ZodObject<{
|
|
160
|
+
description: z.ZodString;
|
|
161
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
162
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
163
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
164
|
+
deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
165
|
+
load: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
166
|
+
allowAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
167
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
}, z.core.$strict>>>;
|
|
172
|
+
denyAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
173
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
}, z.core.$strict>>>;
|
|
178
|
+
}, z.core.$strict>>;
|
|
179
|
+
approvals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<typeof ToolApprovalMode>>>;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
export type IntegrationRequirementIface = z.infer<typeof integrationRequirementSchema>;
|
|
182
|
+
export declare const requirementsSchema: z.ZodObject<{
|
|
183
|
+
harness: z.ZodObject<{
|
|
184
|
+
permissionMode: z.ZodEnum<typeof PermissionLevel>;
|
|
185
|
+
optionalFeatures: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof HarnessFeature>>>;
|
|
186
|
+
recommended: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
harness: z.ZodString;
|
|
188
|
+
model: z.ZodOptional<z.ZodString>;
|
|
189
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strict>>;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
compute: z.ZodDefault<z.ZodObject<{
|
|
193
|
+
files: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").FilesAccess>;
|
|
195
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
196
|
+
description: z.ZodOptional<z.ZodString>;
|
|
197
|
+
}, z.core.$strict>>;
|
|
198
|
+
shell: z.ZodOptional<z.ZodObject<{
|
|
199
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ShellAccess>;
|
|
200
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
201
|
+
description: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$strict>>;
|
|
203
|
+
computerUse: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ScreenAccess>;
|
|
205
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
206
|
+
description: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strict>>;
|
|
208
|
+
browserUse: z.ZodOptional<z.ZodObject<{
|
|
209
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ScreenAccess>;
|
|
210
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
211
|
+
description: z.ZodOptional<z.ZodString>;
|
|
212
|
+
}, z.core.$strict>>;
|
|
213
|
+
}, z.core.$strict>>;
|
|
214
|
+
integrations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
215
|
+
description: z.ZodString;
|
|
216
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
217
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
219
|
+
deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
220
|
+
load: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
221
|
+
allowAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
222
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
223
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
224
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
225
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
226
|
+
}, z.core.$strict>>>;
|
|
227
|
+
denyAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
228
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
230
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
231
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
+
}, z.core.$strict>>>;
|
|
233
|
+
}, z.core.$strict>>;
|
|
234
|
+
approvals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<typeof ToolApprovalMode>>>;
|
|
235
|
+
}, z.core.$strict>>>;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
export type RequirementsIface = z.infer<typeof requirementsSchema>;
|
|
238
|
+
export declare enum ScheduleTarget {
|
|
239
|
+
OwnerDirect = "owner-direct",
|
|
240
|
+
BoundConversation = "bound-conversation"
|
|
241
|
+
}
|
|
242
|
+
export declare const documentScheduleSchema: z.ZodObject<{
|
|
243
|
+
key: z.ZodString;
|
|
244
|
+
cron: z.ZodString;
|
|
245
|
+
timezone: z.ZodString;
|
|
246
|
+
prompt: z.ZodString;
|
|
247
|
+
target: z.ZodEnum<typeof ScheduleTarget>;
|
|
248
|
+
}, z.core.$strict>;
|
|
249
|
+
export declare const agentIdentitySchema: z.ZodObject<{
|
|
250
|
+
name: z.ZodString;
|
|
251
|
+
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
252
|
+
avatar: z.ZodOptional<z.ZodType<import("@finalai/agent-protocol").AgentAvatarIface, unknown, z.core.$ZodTypeInternals<import("@finalai/agent-protocol").AgentAvatarIface, unknown>>>;
|
|
253
|
+
}, z.core.$strict>;
|
|
254
|
+
export declare const agentDocumentSchema: z.ZodObject<{
|
|
255
|
+
version: z.ZodLiteral<5>;
|
|
256
|
+
identity: z.ZodObject<{
|
|
257
|
+
name: z.ZodString;
|
|
258
|
+
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
259
|
+
avatar: z.ZodOptional<z.ZodType<import("@finalai/agent-protocol").AgentAvatarIface, unknown, z.core.$ZodTypeInternals<import("@finalai/agent-protocol").AgentAvatarIface, unknown>>>;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
instructions: z.ZodDefault<z.ZodString>;
|
|
262
|
+
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
263
|
+
name: z.ZodString;
|
|
264
|
+
description: z.ZodOptional<z.ZodString>;
|
|
265
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
266
|
+
}, z.core.$strict>>>;
|
|
267
|
+
require: z.ZodObject<{
|
|
268
|
+
harness: z.ZodObject<{
|
|
269
|
+
permissionMode: z.ZodEnum<typeof PermissionLevel>;
|
|
270
|
+
optionalFeatures: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof HarnessFeature>>>;
|
|
271
|
+
recommended: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
harness: z.ZodString;
|
|
273
|
+
model: z.ZodOptional<z.ZodString>;
|
|
274
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
275
|
+
}, z.core.$strict>>;
|
|
276
|
+
}, z.core.$strict>;
|
|
277
|
+
compute: z.ZodDefault<z.ZodObject<{
|
|
278
|
+
files: z.ZodOptional<z.ZodObject<{
|
|
279
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").FilesAccess>;
|
|
280
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
281
|
+
description: z.ZodOptional<z.ZodString>;
|
|
282
|
+
}, z.core.$strict>>;
|
|
283
|
+
shell: z.ZodOptional<z.ZodObject<{
|
|
284
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ShellAccess>;
|
|
285
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
286
|
+
description: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, z.core.$strict>>;
|
|
288
|
+
computerUse: z.ZodOptional<z.ZodObject<{
|
|
289
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ScreenAccess>;
|
|
290
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
291
|
+
description: z.ZodOptional<z.ZodString>;
|
|
292
|
+
}, z.core.$strict>>;
|
|
293
|
+
browserUse: z.ZodOptional<z.ZodObject<{
|
|
294
|
+
access: z.ZodEnum<typeof import("@finalai/agent-protocol").ScreenAccess>;
|
|
295
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
296
|
+
description: z.ZodOptional<z.ZodString>;
|
|
297
|
+
}, z.core.$strict>>;
|
|
298
|
+
}, z.core.$strict>>;
|
|
299
|
+
integrations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
300
|
+
description: z.ZodString;
|
|
301
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
302
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
303
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
304
|
+
deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
305
|
+
load: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
306
|
+
allowAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
307
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
308
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
309
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
310
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
311
|
+
}, z.core.$strict>>>;
|
|
312
|
+
denyAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
313
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
314
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
315
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
316
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
317
|
+
}, z.core.$strict>>>;
|
|
318
|
+
}, z.core.$strict>>;
|
|
319
|
+
approvals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<typeof ToolApprovalMode>>>;
|
|
320
|
+
}, z.core.$strict>>>;
|
|
321
|
+
}, z.core.$strict>;
|
|
322
|
+
workspace: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
323
|
+
tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
324
|
+
description: z.ZodString;
|
|
325
|
+
inputSchema: z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>;
|
|
326
|
+
outputSchema: z.ZodOptional<z.ZodType<import("./json.mjs").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.mjs").JsonObject, unknown>>>;
|
|
327
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
328
|
+
title: z.ZodOptional<z.ZodString>;
|
|
329
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
330
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
331
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
332
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
}, z.core.$strict>>;
|
|
334
|
+
approval: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof ToolApprovalMode>, z.ZodObject<{
|
|
335
|
+
whenInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
336
|
+
placement: z.ZodLiteral<CodePlacement.InProcess>;
|
|
337
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
338
|
+
source: z.ZodString;
|
|
339
|
+
export: z.ZodDefault<z.ZodString>;
|
|
340
|
+
placement: z.ZodLiteral<CodePlacement.Serverless>;
|
|
341
|
+
}, z.core.$strict>], "placement">;
|
|
342
|
+
}, z.core.$strict>]>>;
|
|
343
|
+
code: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
344
|
+
placement: z.ZodLiteral<CodePlacement.InProcess>;
|
|
345
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
346
|
+
source: z.ZodString;
|
|
347
|
+
export: z.ZodDefault<z.ZodString>;
|
|
348
|
+
placement: z.ZodLiteral<CodePlacement.Serverless>;
|
|
349
|
+
}, z.core.$strict>], "placement">;
|
|
350
|
+
}, z.core.$strict>>>;
|
|
351
|
+
hooks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
352
|
+
name: z.ZodString;
|
|
353
|
+
events: z.ZodArray<z.ZodString>;
|
|
354
|
+
code: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
355
|
+
placement: z.ZodLiteral<CodePlacement.InProcess>;
|
|
356
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
357
|
+
source: z.ZodString;
|
|
358
|
+
export: z.ZodDefault<z.ZodString>;
|
|
359
|
+
placement: z.ZodLiteral<CodePlacement.Serverless>;
|
|
360
|
+
}, z.core.$strict>], "placement">;
|
|
361
|
+
}, z.core.$strict>>>;
|
|
362
|
+
toolPolicy: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<typeof ToolApprovalMode>>>;
|
|
363
|
+
secrets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
364
|
+
schedules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
365
|
+
key: z.ZodString;
|
|
366
|
+
cron: z.ZodString;
|
|
367
|
+
timezone: z.ZodString;
|
|
368
|
+
prompt: z.ZodString;
|
|
369
|
+
target: z.ZodEnum<typeof ScheduleTarget>;
|
|
370
|
+
}, z.core.$strict>>>;
|
|
371
|
+
}, z.core.$strict>;
|
|
372
|
+
export type AgentDocumentIface = z.output<typeof agentDocumentSchema>;
|
|
373
|
+
export type AgentDocumentInputIface = z.input<typeof agentDocumentSchema>;
|
|
374
|
+
export declare const inProcessCodeOf: (document: AgentDocumentIface) => string[];
|
|
375
|
+
export declare const computeRequirementsOf: (document: AgentDocumentIface) => [Capability, ComputeRequirementIface][];
|
|
376
|
+
export declare const agentDocumentHash: (document: AgentDocumentInputIface) => Promise<string>;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import {
|
|
3
|
+
agentAvatarSchema,
|
|
4
|
+
Capability,
|
|
5
|
+
capabilityAccessSchemas
|
|
6
|
+
} from "@finalai/agent-protocol";
|
|
7
|
+
import { PermissionLevel } from "@finalai/agent-protocol/agent-platform";
|
|
8
|
+
import { contentHash } from "./canonical-json.mjs";
|
|
9
|
+
import { jsonSchemaSchema, jsonValueSchema } from "./json.mjs";
|
|
10
|
+
const AGENT_DOCUMENT_VERSION = 5;
|
|
11
|
+
var CodePlacement = /* @__PURE__ */ ((CodePlacement2) => {
|
|
12
|
+
CodePlacement2["InProcess"] = "in-process";
|
|
13
|
+
CodePlacement2["Serverless"] = "serverless";
|
|
14
|
+
return CodePlacement2;
|
|
15
|
+
})(CodePlacement || {});
|
|
16
|
+
var ToolApprovalMode = /* @__PURE__ */ ((ToolApprovalMode2) => {
|
|
17
|
+
ToolApprovalMode2["Allow"] = "allow";
|
|
18
|
+
ToolApprovalMode2["Ask"] = "ask";
|
|
19
|
+
return ToolApprovalMode2;
|
|
20
|
+
})(ToolApprovalMode || {});
|
|
21
|
+
const serverlessSourceSchema = z.strictObject({
|
|
22
|
+
source: z.string().min(1).max(4 * 1024 * 1024),
|
|
23
|
+
// The module export implementing it.
|
|
24
|
+
export: z.string().min(1).default("default")
|
|
25
|
+
});
|
|
26
|
+
const codeSchema = z.discriminatedUnion("placement", [
|
|
27
|
+
z.strictObject({ placement: z.literal("in-process" /* InProcess */) }),
|
|
28
|
+
z.strictObject({
|
|
29
|
+
placement: z.literal("serverless" /* Serverless */),
|
|
30
|
+
...serverlessSourceSchema.shape
|
|
31
|
+
})
|
|
32
|
+
]);
|
|
33
|
+
const toolAnnotationsSchema = z.strictObject({
|
|
34
|
+
title: z.string().optional(),
|
|
35
|
+
readOnlyHint: z.boolean().optional(),
|
|
36
|
+
destructiveHint: z.boolean().optional(),
|
|
37
|
+
idempotentHint: z.boolean().optional(),
|
|
38
|
+
openWorldHint: z.boolean().optional()
|
|
39
|
+
});
|
|
40
|
+
const toolApprovalSchema = z.union([
|
|
41
|
+
z.nativeEnum(ToolApprovalMode),
|
|
42
|
+
z.strictObject({ whenInput: codeSchema })
|
|
43
|
+
]);
|
|
44
|
+
const documentToolSchema = z.strictObject({
|
|
45
|
+
description: z.string(),
|
|
46
|
+
inputSchema: jsonSchemaSchema,
|
|
47
|
+
outputSchema: jsonSchemaSchema.optional(),
|
|
48
|
+
annotations: toolAnnotationsSchema.optional(),
|
|
49
|
+
approval: toolApprovalSchema.optional(),
|
|
50
|
+
code: codeSchema
|
|
51
|
+
});
|
|
52
|
+
const documentHookSchema = z.strictObject({
|
|
53
|
+
name: z.string().min(1).max(120),
|
|
54
|
+
events: z.array(z.string().min(1)).min(1),
|
|
55
|
+
code: codeSchema
|
|
56
|
+
});
|
|
57
|
+
const documentSkillSchema = z.strictObject({
|
|
58
|
+
name: z.string().min(1).max(120),
|
|
59
|
+
description: z.string().max(2e3).optional(),
|
|
60
|
+
files: z.record(z.string().min(1), z.string())
|
|
61
|
+
});
|
|
62
|
+
var HarnessFeature = /* @__PURE__ */ ((HarnessFeature2) => {
|
|
63
|
+
HarnessFeature2["Skills"] = "skills";
|
|
64
|
+
HarnessFeature2["McpTools"] = "mcpTools";
|
|
65
|
+
HarnessFeature2["NativeToolPolicy"] = "nativeToolPolicy";
|
|
66
|
+
HarnessFeature2["SystemInstructions"] = "systemInstructions";
|
|
67
|
+
return HarnessFeature2;
|
|
68
|
+
})(HarnessFeature || {});
|
|
69
|
+
const harnessRecommendationSchema = z.strictObject({
|
|
70
|
+
harness: z.string().min(1),
|
|
71
|
+
model: z.string().min(1).optional(),
|
|
72
|
+
reasoning: z.string().min(1).optional()
|
|
73
|
+
});
|
|
74
|
+
const harnessRequirementSchema = z.strictObject({
|
|
75
|
+
// Binding: the most a caller's harness may be allowed to do unasked.
|
|
76
|
+
permissionMode: z.nativeEnum(PermissionLevel),
|
|
77
|
+
optionalFeatures: z.array(z.nativeEnum(HarnessFeature)).default([]),
|
|
78
|
+
// A hint: binds nobody. The platform and the SDK never act on it.
|
|
79
|
+
recommended: harnessRecommendationSchema.optional()
|
|
80
|
+
});
|
|
81
|
+
const computeRequirementFor = (access) => z.strictObject({
|
|
82
|
+
access,
|
|
83
|
+
optional: z.boolean().default(false),
|
|
84
|
+
description: z.string().max(2e3).optional()
|
|
85
|
+
});
|
|
86
|
+
const computeRequirementsSchema = z.strictObject({
|
|
87
|
+
[Capability.Files]: computeRequirementFor(capabilityAccessSchemas[Capability.Files]).optional(),
|
|
88
|
+
[Capability.Shell]: computeRequirementFor(capabilityAccessSchemas[Capability.Shell]).optional(),
|
|
89
|
+
[Capability.ComputerUse]: computeRequirementFor(
|
|
90
|
+
capabilityAccessSchemas[Capability.ComputerUse]
|
|
91
|
+
).optional(),
|
|
92
|
+
[Capability.BrowserUse]: computeRequirementFor(
|
|
93
|
+
capabilityAccessSchemas[Capability.BrowserUse]
|
|
94
|
+
).optional()
|
|
95
|
+
});
|
|
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 integrationToolPolicySchema = z.strictObject({
|
|
103
|
+
// Absent: every tool the server lists.
|
|
104
|
+
allow: z.array(z.string().min(1)).optional(),
|
|
105
|
+
deny: z.array(z.string().min(1)).optional(),
|
|
106
|
+
// Tools listed up front; the rest stay reachable through search.
|
|
107
|
+
load: z.array(z.string().min(1)).optional(),
|
|
108
|
+
allowAnnotations: z.array(toolAnnotationSelectorSchema).optional(),
|
|
109
|
+
denyAnnotations: z.array(toolAnnotationSelectorSchema).optional()
|
|
110
|
+
});
|
|
111
|
+
const integrationRequirementSchema = z.strictObject({
|
|
112
|
+
description: z.string().min(1).max(2e3),
|
|
113
|
+
optional: z.boolean().default(false),
|
|
114
|
+
tools: integrationToolPolicySchema.optional(),
|
|
115
|
+
// Tool name or pattern → approval.
|
|
116
|
+
approvals: z.record(z.string().min(1), z.nativeEnum(ToolApprovalMode)).optional()
|
|
117
|
+
});
|
|
118
|
+
const requirementsSchema = z.strictObject({
|
|
119
|
+
harness: harnessRequirementSchema,
|
|
120
|
+
compute: computeRequirementsSchema.default({}),
|
|
121
|
+
integrations: z.record(z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/), integrationRequirementSchema).default({})
|
|
122
|
+
});
|
|
123
|
+
var ScheduleTarget = /* @__PURE__ */ ((ScheduleTarget2) => {
|
|
124
|
+
ScheduleTarget2["OwnerDirect"] = "owner-direct";
|
|
125
|
+
ScheduleTarget2["BoundConversation"] = "bound-conversation";
|
|
126
|
+
return ScheduleTarget2;
|
|
127
|
+
})(ScheduleTarget || {});
|
|
128
|
+
const documentScheduleSchema = z.strictObject({
|
|
129
|
+
key: z.string().min(1),
|
|
130
|
+
cron: z.string().min(1),
|
|
131
|
+
timezone: z.string().min(1),
|
|
132
|
+
prompt: z.string().min(1),
|
|
133
|
+
target: z.nativeEnum(ScheduleTarget)
|
|
134
|
+
});
|
|
135
|
+
const agentIdentitySchema = z.strictObject({
|
|
136
|
+
name: z.string().min(1).max(120),
|
|
137
|
+
description: z.string().max(2e3).nullable().default(null),
|
|
138
|
+
avatar: agentAvatarSchema.optional()
|
|
139
|
+
});
|
|
140
|
+
const agentDocumentSchema = z.strictObject({
|
|
141
|
+
version: z.literal(AGENT_DOCUMENT_VERSION),
|
|
142
|
+
identity: agentIdentitySchema,
|
|
143
|
+
// Markdown, given to the harness as system instructions.
|
|
144
|
+
instructions: z.string().max(2e5).default(""),
|
|
145
|
+
skills: z.array(documentSkillSchema).default([]),
|
|
146
|
+
require: requirementsSchema,
|
|
147
|
+
// Files written into the workspace of whatever provides `files`, once per sandbox.
|
|
148
|
+
workspace: z.record(z.string().min(1), z.string()).default({}),
|
|
149
|
+
// Key is the tool's name.
|
|
150
|
+
tools: z.record(z.string().regex(/^[a-zA-Z0-9_-]{1,64}$/), documentToolSchema).default({}),
|
|
151
|
+
hooks: z.array(documentHookSchema).default([]),
|
|
152
|
+
// Approval for the harness's own tools, by capability or tool name
|
|
153
|
+
// (`shell`, `files.write`).
|
|
154
|
+
toolPolicy: z.record(z.string().min(1), z.nativeEnum(ToolApprovalMode)).default({}),
|
|
155
|
+
// Project secrets the agent's code may read, by name.
|
|
156
|
+
secrets: z.array(z.string().min(1)).default([]),
|
|
157
|
+
schedules: z.array(documentScheduleSchema).default([])
|
|
158
|
+
});
|
|
159
|
+
const inProcessCodeOf = (document) => {
|
|
160
|
+
const names = [];
|
|
161
|
+
for (const [name, tool] of Object.entries(document.tools)) {
|
|
162
|
+
if (tool.code.placement === "in-process" /* InProcess */) names.push(name);
|
|
163
|
+
else if (typeof tool.approval === "object" && tool.approval.whenInput.placement === "in-process" /* InProcess */)
|
|
164
|
+
names.push(`${name} (approval)`);
|
|
165
|
+
}
|
|
166
|
+
for (const hook of document.hooks)
|
|
167
|
+
if (hook.code.placement === "in-process" /* InProcess */) names.push(`hook ${hook.name}`);
|
|
168
|
+
return names;
|
|
169
|
+
};
|
|
170
|
+
const computeRequirementsOf = (document) => {
|
|
171
|
+
const entries = [];
|
|
172
|
+
for (const capability of Object.values(Capability)) {
|
|
173
|
+
const requirement = document.require.compute[capability];
|
|
174
|
+
if (requirement != null) entries.push([capability, requirement]);
|
|
175
|
+
}
|
|
176
|
+
return entries;
|
|
177
|
+
};
|
|
178
|
+
const agentDocumentHash = async (document) => contentHash(
|
|
179
|
+
jsonValueSchema.parse(JSON.parse(JSON.stringify(agentDocumentSchema.parse(document))))
|
|
180
|
+
);
|
|
181
|
+
export {
|
|
182
|
+
AGENT_DOCUMENT_VERSION,
|
|
183
|
+
CodePlacement,
|
|
184
|
+
HarnessFeature,
|
|
185
|
+
ScheduleTarget,
|
|
186
|
+
ToolApprovalMode,
|
|
187
|
+
agentDocumentHash,
|
|
188
|
+
agentDocumentSchema,
|
|
189
|
+
agentIdentitySchema,
|
|
190
|
+
codeSchema,
|
|
191
|
+
computeRequirementsOf,
|
|
192
|
+
computeRequirementsSchema,
|
|
193
|
+
documentHookSchema,
|
|
194
|
+
documentScheduleSchema,
|
|
195
|
+
documentSkillSchema,
|
|
196
|
+
documentToolSchema,
|
|
197
|
+
harnessRecommendationSchema,
|
|
198
|
+
harnessRequirementSchema,
|
|
199
|
+
inProcessCodeOf,
|
|
200
|
+
integrationRequirementSchema,
|
|
201
|
+
integrationToolPolicySchema,
|
|
202
|
+
requirementsSchema,
|
|
203
|
+
serverlessSourceSchema,
|
|
204
|
+
toolAnnotationSelectorSchema,
|
|
205
|
+
toolAnnotationsSchema,
|
|
206
|
+
toolApprovalSchema
|
|
207
|
+
};
|
|
208
|
+
//# sourceMappingURL=document.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/document.ts"],
|
|
4
|
+
"sourcesContent": ["import * as z from 'zod';\nimport {\n agentAvatarSchema,\n Capability,\n capabilityAccessSchemas,\n type CapabilityAccess,\n} from '@finalai/agent-protocol';\nimport { PermissionLevel } from '@finalai/agent-protocol/agent-platform';\nimport { contentHash } from \"./canonical-json.mjs\";\nimport { jsonSchemaSchema, jsonValueSchema } from \"./json.mjs\";\n\n// The agent's document (manifest v5): everything an agent is, as data. It\n// states what the agent requires and never what provides it: no sandboxes,\n// servers, credentials, models or harness placement. A session pins one\n// document by its content hash (./canonical-json.ts).\n//\n// Custom code is part of the document only when it runs on Final's runtime:\n// a serverless tool or hook carries its self-contained ES module source. An\n// in-process one carries only its interface; its body never leaves the\n// process that created the session.\n\nexport const AGENT_DOCUMENT_VERSION = 5;\n\nexport enum CodePlacement {\n // Runs in the process that created the session, over its connection.\n InProcess = 'in-process',\n // Runs on Final's runtime from the source in the document.\n Serverless = 'serverless',\n}\n\nexport enum ToolApprovalMode {\n Allow = 'allow',\n Ask = 'ask',\n}\n\n// One self-contained ES module. It may use the runtime's globals (`fetch`,\n// `crypto`, `URL`, ...) and its `ctx` argument; it imports nothing.\nexport const serverlessSourceSchema = z.strictObject({\n source: z\n .string()\n .min(1)\n .max(4 * 1024 * 1024),\n // The module export implementing it.\n export: z.string().min(1).default('default'),\n});\n\nexport const codeSchema = z.discriminatedUnion('placement', [\n z.strictObject({ placement: z.literal(CodePlacement.InProcess) }),\n z.strictObject({\n placement: z.literal(CodePlacement.Serverless),\n ...serverlessSourceSchema.shape,\n }),\n]);\n\nexport type CodeIface = z.infer<typeof codeSchema>;\n\nexport const toolAnnotationsSchema = z.strictObject({\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\n// Fixed approval, or a predicate over the input that runs where the tool runs.\nexport const toolApprovalSchema = z.union([\n z.nativeEnum(ToolApprovalMode),\n z.strictObject({ whenInput: codeSchema }),\n]);\n\nexport const documentToolSchema = z.strictObject({\n description: z.string(),\n inputSchema: jsonSchemaSchema,\n outputSchema: jsonSchemaSchema.optional(),\n annotations: toolAnnotationsSchema.optional(),\n approval: toolApprovalSchema.optional(),\n code: codeSchema,\n});\n\nexport type DocumentToolIface = z.infer<typeof documentToolSchema>;\n\nexport const documentHookSchema = z.strictObject({\n name: z.string().min(1).max(120),\n events: z.array(z.string().min(1)).min(1),\n code: codeSchema,\n});\n\nexport type DocumentHookIface = z.infer<typeof documentHookSchema>;\n\nexport const documentSkillSchema = z.strictObject({\n name: z.string().min(1).max(120),\n description: z.string().max(2000).optional(),\n files: z.record(z.string().min(1), z.string()),\n});\n\nexport type DocumentSkillIface = z.infer<typeof documentSkillSchema>;\n\n// Features of a harness the agent can live without. Everything else the\n// agent's parts need (./harness-requirements.ts) must be supported.\nexport enum HarnessFeature {\n Skills = 'skills',\n McpTools = 'mcpTools',\n NativeToolPolicy = 'nativeToolPolicy',\n SystemInstructions = 'systemInstructions',\n}\n\nexport const harnessRecommendationSchema = z.strictObject({\n harness: z.string().min(1),\n model: z.string().min(1).optional(),\n reasoning: z.string().min(1).optional(),\n});\n\nexport const harnessRequirementSchema = z.strictObject({\n // Binding: the most a caller's harness may be allowed to do unasked.\n permissionMode: z.nativeEnum(PermissionLevel),\n optionalFeatures: z.array(z.nativeEnum(HarnessFeature)).default([]),\n // A hint: binds nobody. The platform and the SDK never act on it.\n recommended: harnessRecommendationSchema.optional(),\n});\n\nexport type HarnessRequirementIface = z.infer<typeof harnessRequirementSchema>;\n\nconst computeRequirementFor = <Access extends z.ZodType<CapabilityAccess>>(access: Access) =>\n z.strictObject({\n access,\n optional: z.boolean().default(false),\n description: z.string().max(2000).optional(),\n });\n\nexport const computeRequirementsSchema = z.strictObject({\n [Capability.Files]: computeRequirementFor(capabilityAccessSchemas[Capability.Files]).optional(),\n [Capability.Shell]: computeRequirementFor(capabilityAccessSchemas[Capability.Shell]).optional(),\n [Capability.ComputerUse]: computeRequirementFor(\n capabilityAccessSchemas[Capability.ComputerUse],\n ).optional(),\n [Capability.BrowserUse]: computeRequirementFor(\n capabilityAccessSchemas[Capability.BrowserUse],\n ).optional(),\n});\n\nexport interface ComputeRequirementIface {\n access: CapabilityAccess;\n optional: boolean;\n description?: string;\n}\n\n// MCP tool annotation hints a slot's policy selects on.\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// The most an integration provided for a slot may expose. Names and `*`\n// patterns (./tool-patterns.ts); the most specific matching key governs.\nexport const integrationToolPolicySchema = z.strictObject({\n // Absent: every tool the server lists.\n allow: z.array(z.string().min(1)).optional(),\n deny: z.array(z.string().min(1)).optional(),\n // Tools listed up front; the rest stay reachable through search.\n load: z.array(z.string().min(1)).optional(),\n allowAnnotations: z.array(toolAnnotationSelectorSchema).optional(),\n denyAnnotations: z.array(toolAnnotationSelectorSchema).optional(),\n});\n\nexport const integrationRequirementSchema = z.strictObject({\n description: z.string().min(1).max(2000),\n optional: z.boolean().default(false),\n tools: integrationToolPolicySchema.optional(),\n // Tool name or pattern \u2192 approval.\n approvals: z.record(z.string().min(1), z.nativeEnum(ToolApprovalMode)).optional(),\n});\n\nexport type IntegrationRequirementIface = z.infer<typeof integrationRequirementSchema>;\n\nexport const requirementsSchema = z.strictObject({\n harness: harnessRequirementSchema,\n compute: computeRequirementsSchema.default({}),\n integrations: z\n .record(z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/), integrationRequirementSchema)\n .default({}),\n});\n\nexport type RequirementsIface = z.infer<typeof requirementsSchema>;\n\nexport enum ScheduleTarget {\n OwnerDirect = 'owner-direct',\n BoundConversation = 'bound-conversation',\n}\n\nexport const documentScheduleSchema = z.strictObject({\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 agentIdentitySchema = z.strictObject({\n name: z.string().min(1).max(120),\n description: z.string().max(2000).nullable().default(null),\n avatar: agentAvatarSchema.optional(),\n});\n\nexport const agentDocumentSchema = z.strictObject({\n version: z.literal(AGENT_DOCUMENT_VERSION),\n identity: agentIdentitySchema,\n // Markdown, given to the harness as system instructions.\n instructions: z.string().max(200_000).default(''),\n skills: z.array(documentSkillSchema).default([]),\n require: requirementsSchema,\n // Files written into the workspace of whatever provides `files`, once per sandbox.\n workspace: z.record(z.string().min(1), z.string()).default({}),\n // Key is the tool's name.\n tools: z.record(z.string().regex(/^[a-zA-Z0-9_-]{1,64}$/), documentToolSchema).default({}),\n hooks: z.array(documentHookSchema).default([]),\n // Approval for the harness's own tools, by capability or tool name\n // (`shell`, `files.write`).\n toolPolicy: z.record(z.string().min(1), z.nativeEnum(ToolApprovalMode)).default({}),\n // Project secrets the agent's code may read, by name.\n secrets: z.array(z.string().min(1)).default([]),\n schedules: z.array(documentScheduleSchema).default([]),\n});\n\nexport type AgentDocumentIface = z.output<typeof agentDocumentSchema>;\nexport type AgentDocumentInputIface = z.input<typeof agentDocumentSchema>;\n\n// Names of the tools and hooks whose code only runs in the creating process.\nexport const inProcessCodeOf = (document: AgentDocumentIface): string[] => {\n const names: string[] = [];\n for (const [name, tool] of Object.entries(document.tools)) {\n if (tool.code.placement === CodePlacement.InProcess) names.push(name);\n else if (\n typeof tool.approval === 'object' &&\n tool.approval.whenInput.placement === CodePlacement.InProcess\n )\n names.push(`${name} (approval)`);\n }\n for (const hook of document.hooks)\n if (hook.code.placement === CodePlacement.InProcess) names.push(`hook ${hook.name}`);\n return names;\n};\n\n// The compute requirements in a fixed order, with defaults applied.\nexport const computeRequirementsOf = (\n document: AgentDocumentIface,\n): [Capability, ComputeRequirementIface][] => {\n const entries: [Capability, ComputeRequirementIface][] = [];\n for (const capability of Object.values(Capability)) {\n const requirement = document.require.compute[capability];\n if (requirement != null) entries.push([capability, requirement]);\n }\n return entries;\n};\n\n// The agent's identity: the content hash of its document with defaults\n// applied, so a document written out in full and one leaving defaults out are\n// the same agent. Nothing a caller provides (harness settings, compute,\n// integrations) is part of it.\nexport const agentDocumentHash = async (document: AgentDocumentInputIface): Promise<string> =>\n contentHash(\n jsonValueSchema.parse(JSON.parse(JSON.stringify(agentDocumentSchema.parse(document)))),\n );\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,OAAO;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB,uBAAuB;AAY3C,MAAM,yBAAyB;AAE/B,IAAK,gBAAL,kBAAKA,mBAAL;AAEL,EAAAA,eAAA,eAAY;AAEZ,EAAAA,eAAA,gBAAa;AAJH,SAAAA;AAAA,GAAA;AAOL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,WAAQ;AACR,EAAAA,kBAAA,SAAM;AAFI,SAAAA;AAAA,GAAA;AAOL,MAAM,yBAAyB,EAAE,aAAa;AAAA,EACnD,QAAQ,EACL,OAAO,EACP,IAAI,CAAC,EACL,IAAI,IAAI,OAAO,IAAI;AAAA;AAAA,EAEtB,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,QAAQ,SAAS;AAC7C,CAAC;AAEM,MAAM,aAAa,EAAE,mBAAmB,aAAa;AAAA,EAC1D,EA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,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EAC9C,WAAW,EAAE,MAAM,sBAAsB,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC;AAMM,MAAM,kBAAkB,CAAC,aAA2C;AACzE,QAAM,QAAkB,CAAC;AACzB,aAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,SAAS,KAAK,GAAG;AACzD,QAAI,KAAK,KAAK,cAAc,6BAAyB,OAAM,KAAK,IAAI;AAAA,aAElE,OAAO,KAAK,aAAa,YACzB,KAAK,SAAS,UAAU,cAAc;AAEtC,YAAM,KAAK,GAAG,IAAI,aAAa;AAAA,EACnC;AACA,aAAW,QAAQ,SAAS;AAC1B,QAAI,KAAK,KAAK,cAAc,6BAAyB,OAAM,KAAK,QAAQ,KAAK,IAAI,EAAE;AACrF,SAAO;AACT;AAGO,MAAM,wBAAwB,CACnC,aAC4C;AAC5C,QAAM,UAAmD,CAAC;AAC1D,aAAW,cAAc,OAAO,OAAO,UAAU,GAAG;AAClD,UAAM,cAAc,SAAS,QAAQ,QAAQ,UAAU;AACvD,QAAI,eAAe,KAAM,SAAQ,KAAK,CAAC,YAAY,WAAW,CAAC;AAAA,EACjE;AACA,SAAO;AACT;AAMO,MAAM,oBAAoB,OAAO,aACtC;AAAA,EACE,gBAAgB,MAAM,KAAK,MAAM,KAAK,UAAU,oBAAoB,MAAM,QAAQ,CAAC,CAAC,CAAC;AACvF;",
|
|
6
|
+
"names": ["CodePlacement", "ToolApprovalMode", "HarnessFeature", "ScheduleTarget"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HarnessSettingsIface } from '@finalai/agent-protocol/agent-platform';
|
|
2
|
+
import type { HarnessDefinitionIface } from "./harness-definition.mjs";
|
|
3
|
+
export interface HarnessConfigurationCheckIface {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
problems: string[];
|
|
6
|
+
}
|
|
7
|
+
export type HarnessConfigurationDefinitionIface = Pick<HarnessDefinitionIface, 'configurationSchema' | 'lowestPermission' | 'inference'>;
|
|
8
|
+
export declare const validateHarnessConfiguration: (args: {
|
|
9
|
+
definition: HarnessConfigurationDefinitionIface;
|
|
10
|
+
configuration: unknown;
|
|
11
|
+
}) => HarnessConfigurationCheckIface;
|
|
12
|
+
export declare const acceptsHarnessSettings: (args: {
|
|
13
|
+
name: string;
|
|
14
|
+
definition: HarnessConfigurationDefinitionIface;
|
|
15
|
+
settings: HarnessSettingsIface;
|
|
16
|
+
}) => HarnessConfigurationCheckIface;
|