@finalai/agent-provider 0.9.0 → 0.11.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 +106 -20
- 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 +51 -15
- package/dist/modules/channel.mjs +1 -0
- package/dist/modules/channel.mjs.map +2 -2
- 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 +3 -3
- package/dist/modules/credential-routes.mjs +2 -2
- package/dist/modules/credential-routes.mjs.map +2 -2
- package/dist/modules/document.d.mts +358 -0
- package/dist/modules/document.mjs +193 -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 -7
- package/dist/modules/index.mjs +12 -7
- 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.d.mts +1 -1
- 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/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/body.d.mts +1 -0
- package/dist/modules/sandbox/remote/body.mjs +27 -0
- package/dist/modules/sandbox/remote/body.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 +520 -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 +40 -0
- package/dist/modules/sandbox/setup/apply.mjs +190 -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 +43 -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 -142
- package/dist/modules/sandbox/types.mjs +47 -57
- 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 -41
- 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/room-surface.d.mts +0 -355
- package/dist/modules/room-surface.mjs +0 -156
- package/dist/modules/room-surface.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,430 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Capability,
|
|
3
|
+
FilesAccess,
|
|
4
|
+
RUNTIME_KINDS,
|
|
5
|
+
RuntimeKind,
|
|
6
|
+
ShellAccess
|
|
7
|
+
} from "@finalai/agent-protocol";
|
|
8
|
+
import {
|
|
9
|
+
HarnessComputeStatus,
|
|
10
|
+
InferenceSourceKind,
|
|
11
|
+
isUrlEnvironment,
|
|
12
|
+
PermissionLevel
|
|
13
|
+
} from "@finalai/agent-protocol/agent-platform";
|
|
14
|
+
import * as z from "zod";
|
|
15
|
+
import { contentHash } from "./canonical-json.mjs";
|
|
16
|
+
import { HarnessFeature } from "./document.mjs";
|
|
17
|
+
import {
|
|
18
|
+
CredentialDelivery,
|
|
19
|
+
DEFAULT_PROMPT_WHILE_RUNNING,
|
|
20
|
+
DEFAULT_SESSION_SURVIVES_DISCONNECT,
|
|
21
|
+
McpTransportKind,
|
|
22
|
+
PromptWhileRunning,
|
|
23
|
+
SandboxWire
|
|
24
|
+
} from "./harness.mjs";
|
|
25
|
+
import {
|
|
26
|
+
ACP_V2_INTERFACE,
|
|
27
|
+
FinalExtension,
|
|
28
|
+
HARNESS_COMMAND_PATH,
|
|
29
|
+
HarnessEnvironmentKind,
|
|
30
|
+
PLACEHOLDER,
|
|
31
|
+
runtimesOf
|
|
32
|
+
} from "./harness-start.mjs";
|
|
33
|
+
import { jsonObjectSchema, jsonSchemaSchema, jsonValueSchema } from "./json.mjs";
|
|
34
|
+
import { RuntimeKind as RuntimeKind2 } from "@finalai/agent-protocol";
|
|
35
|
+
import {
|
|
36
|
+
ACP_V2_INTERFACE as ACP_V2_INTERFACE2,
|
|
37
|
+
FinalExtension as FinalExtension2,
|
|
38
|
+
harnessStartFor,
|
|
39
|
+
HarnessEnvironmentKind as HarnessEnvironmentKind2,
|
|
40
|
+
runtimesOf as runtimesOf2
|
|
41
|
+
} from "./harness-start.mjs";
|
|
42
|
+
const CONFIGURATION_PATH = /^configuration(?:\.[A-Za-z0-9_-]+)+$/u;
|
|
43
|
+
const isTemplatePath = (path) => CONFIGURATION_PATH.test(path) || path === HARNESS_COMMAND_PATH;
|
|
44
|
+
const placeholdersOf = (template) => [...template.matchAll(PLACEHOLDER)].map((match) => match[1] ?? "");
|
|
45
|
+
const templateSchema = z.string().max(4096).superRefine((template, ctx) => {
|
|
46
|
+
for (const path of placeholdersOf(template))
|
|
47
|
+
if (!isTemplatePath(path))
|
|
48
|
+
ctx.addIssue({
|
|
49
|
+
code: "custom",
|
|
50
|
+
message: `{{${path}}} names neither configuration.<field> nor harness.command`
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
const conditionPathSchema = z.string().regex(CONFIGURATION_PATH, "Expected configuration.<field>[.<field>\u2026]");
|
|
54
|
+
const processArgSchema = z.union([
|
|
55
|
+
templateSchema,
|
|
56
|
+
z.strictObject({ when: conditionPathSchema, args: z.array(templateSchema).min(1) }),
|
|
57
|
+
z.strictObject({ spread: z.literal("harness.args") })
|
|
58
|
+
]);
|
|
59
|
+
const processEnvValueSchema = z.union([
|
|
60
|
+
templateSchema,
|
|
61
|
+
z.strictObject({ when: conditionPathSchema, value: templateSchema })
|
|
62
|
+
]);
|
|
63
|
+
const processRunSchema = z.strictObject({
|
|
64
|
+
command: templateSchema.pipe(z.string().min(1)),
|
|
65
|
+
args: z.array(processArgSchema).default([]),
|
|
66
|
+
env: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u), processEnvValueSchema).default({})
|
|
67
|
+
});
|
|
68
|
+
const workerRunSchema = z.strictObject({
|
|
69
|
+
program: z.string().min(1).max(200)
|
|
70
|
+
});
|
|
71
|
+
const runEntriesSchema = z.strictObject({
|
|
72
|
+
[RuntimeKind.Process]: processRunSchema.optional(),
|
|
73
|
+
[RuntimeKind.Worker]: workerRunSchema.optional()
|
|
74
|
+
}).default({});
|
|
75
|
+
const nativeUseSchema = (access) => z.strictObject({
|
|
76
|
+
// Access levels below full it can hold the model to. Empty: none.
|
|
77
|
+
enforces: z.array(access).default([]),
|
|
78
|
+
// Its own tools for it, for display.
|
|
79
|
+
tools: z.array(z.string()).default([])
|
|
80
|
+
});
|
|
81
|
+
const harnessNativeSchema = z.strictObject({
|
|
82
|
+
[Capability.Files]: nativeUseSchema(z.nativeEnum(FilesAccess)).optional(),
|
|
83
|
+
[Capability.Shell]: nativeUseSchema(z.nativeEnum(ShellAccess)).optional()
|
|
84
|
+
}).default({});
|
|
85
|
+
const harnessProviderCodeSchema = z.strictObject({
|
|
86
|
+
source: z.string().min(1).max(4 * 1024 * 1024)
|
|
87
|
+
});
|
|
88
|
+
const harnessProviderNameSchema = z.strictObject({
|
|
89
|
+
name: z.string().min(1).max(200)
|
|
90
|
+
});
|
|
91
|
+
const harnessProviderReferenceSchema = z.union([
|
|
92
|
+
harnessProviderCodeSchema,
|
|
93
|
+
harnessProviderNameSchema
|
|
94
|
+
]);
|
|
95
|
+
var HarnessService = /* @__PURE__ */ ((HarnessService2) => {
|
|
96
|
+
HarnessService2["SessionStore"] = "session-store";
|
|
97
|
+
HarnessService2["FrameAttachments"] = "frame-attachments";
|
|
98
|
+
HarnessService2["SubscriptionRelay"] = "subscription-relay";
|
|
99
|
+
return HarnessService2;
|
|
100
|
+
})(HarnessService || {});
|
|
101
|
+
const servicesSchema = z.array(z.nativeEnum(HarnessService)).default([]).refine((services) => new Set(services).size === services.length, {
|
|
102
|
+
message: "Services must not repeat"
|
|
103
|
+
});
|
|
104
|
+
const harnessModelSchema = z.strictObject({
|
|
105
|
+
id: z.string().min(1).max(200),
|
|
106
|
+
label: z.string().min(1).max(120),
|
|
107
|
+
// One of the definition's `inference.vendors`.
|
|
108
|
+
vendor: z.string().min(1).max(60),
|
|
109
|
+
// The id on the vendor's API; `id` when absent.
|
|
110
|
+
vendorModelId: z.string().min(1).max(200).optional(),
|
|
111
|
+
aliases: z.array(z.string().min(1).max(200)).default([]),
|
|
112
|
+
// A subset of the configuration schema's `reasoning` enum.
|
|
113
|
+
reasoningLevels: z.array(z.string().min(1)).default([]),
|
|
114
|
+
defaultReasoning: z.string().min(1).optional(),
|
|
115
|
+
// At most one entry per definition is the default.
|
|
116
|
+
default: z.boolean().default(false),
|
|
117
|
+
input: z.array(z.enum(["text", "image"])).default(["text"]),
|
|
118
|
+
runtime: jsonObjectSchema.default({})
|
|
119
|
+
});
|
|
120
|
+
const harnessModelsSchema = z.strictObject({
|
|
121
|
+
// Also accept `<vendor>/<id>` for a vendor in `inference.vendors` (and, for
|
|
122
|
+
// a definition with exactly one vendor, a bare id) outside `entries`. With
|
|
123
|
+
// no vendors declared, any model is accepted and the harness validates it.
|
|
124
|
+
open: z.boolean().default(false),
|
|
125
|
+
entries: z.array(harnessModelSchema).default([])
|
|
126
|
+
});
|
|
127
|
+
const harnessDefinitionSchema = z.strictObject({
|
|
128
|
+
title: z.string().min(1).max(120).optional(),
|
|
129
|
+
description: z.string().max(2e3).optional(),
|
|
130
|
+
// Everything configurable (model, reasoning, inference, permission mode,
|
|
131
|
+
// anything harness-specific) as JSON Schema, so a picker can render it
|
|
132
|
+
// without running code.
|
|
133
|
+
configurationSchema: jsonSchemaSchema,
|
|
134
|
+
// Features of the agent document it supports.
|
|
135
|
+
features: z.array(z.nativeEnum(HarnessFeature)),
|
|
136
|
+
// The most it can be held to: a harness that cannot ask before acting is `auto`.
|
|
137
|
+
lowestPermission: z.nativeEnum(PermissionLevel),
|
|
138
|
+
inference: z.strictObject({
|
|
139
|
+
vendors: z.array(z.string()).default([]),
|
|
140
|
+
// Inference sources it can use; the others in a caller's list are skipped.
|
|
141
|
+
kinds: z.array(z.nativeEnum(InferenceSourceKind)),
|
|
142
|
+
delivery: z.nativeEnum(CredentialDelivery)
|
|
143
|
+
}),
|
|
144
|
+
// The models it offers (resolveHarnessModel). Absent: any model, which
|
|
145
|
+
// the harness validates itself.
|
|
146
|
+
models: harnessModelsSchema.default({ open: true, entries: [] }),
|
|
147
|
+
// Platform services it uses during a session.
|
|
148
|
+
services: servicesSchema,
|
|
149
|
+
native: harnessNativeSchema,
|
|
150
|
+
// The native interface an ACP adapter maps (`acp-v2`: it needs none).
|
|
151
|
+
interface: z.string().min(1).max(120).default(ACP_V2_INTERFACE),
|
|
152
|
+
// The ACP adapter it runs behind unless the settings name another.
|
|
153
|
+
adapter: z.string().min(1).max(200).nullable().default(null),
|
|
154
|
+
run: runEntriesSchema,
|
|
155
|
+
// Reaches the harness itself instead of starting a program in an environment.
|
|
156
|
+
provider: harnessProviderReferenceSchema.optional(),
|
|
157
|
+
// MCP server transports it takes in `session/new`.
|
|
158
|
+
mcp: z.array(z.nativeEnum(McpTransportKind)).default([]),
|
|
159
|
+
// Wires it speaks to reach a provided sandbox.
|
|
160
|
+
consumes: z.array(z.nativeEnum(SandboxWire)).default([]),
|
|
161
|
+
supports: z.strictObject({
|
|
162
|
+
observe: z.boolean().default(false),
|
|
163
|
+
resumeReplay: z.boolean().default(false),
|
|
164
|
+
fork: z.boolean().default(false),
|
|
165
|
+
// Renders _meta["final.ai"].author itself; otherwise the author's
|
|
166
|
+
// name is prepended to the text.
|
|
167
|
+
authorMeta: z.boolean().default(false),
|
|
168
|
+
// Defers and searches MCP tools itself.
|
|
169
|
+
deferredToolSearch: z.boolean().default(false)
|
|
170
|
+
}).default({
|
|
171
|
+
observe: false,
|
|
172
|
+
resumeReplay: false,
|
|
173
|
+
fork: false,
|
|
174
|
+
authorMeta: false,
|
|
175
|
+
deferredToolSearch: false
|
|
176
|
+
}),
|
|
177
|
+
promptWhileRunning: z.nativeEnum(PromptWhileRunning).default(DEFAULT_PROMPT_WHILE_RUNNING),
|
|
178
|
+
sessionSurvivesDisconnect: z.boolean().default(DEFAULT_SESSION_SURVIVES_DISCONNECT)
|
|
179
|
+
}).superRefine((definition, ctx) => {
|
|
180
|
+
if (runtimesOf(definition.run).length === 0 && definition.provider == null && definition.interface !== ACP_V2_INTERFACE)
|
|
181
|
+
ctx.addIssue({
|
|
182
|
+
code: "custom",
|
|
183
|
+
path: ["run"],
|
|
184
|
+
message: "A harness needs a run entry (process or worker) or a provider, unless it speaks ACP v2 and is reached at a URL"
|
|
185
|
+
});
|
|
186
|
+
for (const arg of definition.run.process?.args ?? [])
|
|
187
|
+
if (typeof arg === "object" && "spread" in arg)
|
|
188
|
+
ctx.addIssue({
|
|
189
|
+
code: "custom",
|
|
190
|
+
path: ["run", "process", "args"],
|
|
191
|
+
message: "Only an ACP adapter wraps a harness command"
|
|
192
|
+
});
|
|
193
|
+
for (const template of templatesOf(definition.run.process))
|
|
194
|
+
if (placeholdersOf(template).includes(HARNESS_COMMAND_PATH))
|
|
195
|
+
ctx.addIssue({
|
|
196
|
+
code: "custom",
|
|
197
|
+
path: ["run", "process"],
|
|
198
|
+
message: "Only an ACP adapter wraps a harness command"
|
|
199
|
+
});
|
|
200
|
+
for (const problem of modelProblems(definition))
|
|
201
|
+
ctx.addIssue({ code: "custom", path: ["models", ...problem.path], message: problem.message });
|
|
202
|
+
});
|
|
203
|
+
var AdapterConfigurationDelivery = /* @__PURE__ */ ((AdapterConfigurationDelivery2) => {
|
|
204
|
+
AdapterConfigurationDelivery2["Launch"] = "launch";
|
|
205
|
+
AdapterConfigurationDelivery2["ConfigOptions"] = "config-options";
|
|
206
|
+
return AdapterConfigurationDelivery2;
|
|
207
|
+
})(AdapterConfigurationDelivery || {});
|
|
208
|
+
const acpAdapterDefinitionSchema = z.strictObject({
|
|
209
|
+
title: z.string().min(1).max(120).optional(),
|
|
210
|
+
description: z.string().max(2e3).optional(),
|
|
211
|
+
// The harness interfaces it maps to ACP v2.
|
|
212
|
+
adapts: z.array(z.string().min(1).max(120)).min(1),
|
|
213
|
+
// `process`: a command that launches or wraps the harness and speaks ACP
|
|
214
|
+
// v2 on stdio. `worker`: a worker program that does the same.
|
|
215
|
+
run: runEntriesSchema,
|
|
216
|
+
configuration: z.nativeEnum(AdapterConfigurationDelivery).default("launch" /* Launch */),
|
|
217
|
+
// The Final ACP extensions it implements and advertises in `initialize`.
|
|
218
|
+
extensions: z.array(z.nativeEnum(FinalExtension)).default([]),
|
|
219
|
+
// Platform services it uses during a session.
|
|
220
|
+
services: servicesSchema
|
|
221
|
+
}).superRefine((definition, ctx) => {
|
|
222
|
+
if (runtimesOf(definition.run).length === 0)
|
|
223
|
+
ctx.addIssue({
|
|
224
|
+
code: "custom",
|
|
225
|
+
path: ["run"],
|
|
226
|
+
message: "An ACP adapter needs a run entry (process or worker)"
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
const hashOf = async (schema, value) => contentHash(jsonValueSchema.parse(JSON.parse(JSON.stringify(schema.parse(value)))));
|
|
230
|
+
const reasoningEnumOf = (schema) => {
|
|
231
|
+
const properties = jsonObjectSchema.safeParse(schema["properties"]).data;
|
|
232
|
+
const reasoning = jsonObjectSchema.safeParse(properties?.["reasoning"]).data;
|
|
233
|
+
if (reasoning == null) return [];
|
|
234
|
+
const levels = z.array(z.string()).safeParse(reasoning["enum"]).data;
|
|
235
|
+
return levels ?? null;
|
|
236
|
+
};
|
|
237
|
+
const referencesOf = (entry) => [
|
|
238
|
+
.../* @__PURE__ */ new Set([entry.id, ...entry.aliases, `${entry.vendor}/${entry.vendorModelId ?? entry.id}`])
|
|
239
|
+
];
|
|
240
|
+
const modelProblems = (definition) => {
|
|
241
|
+
const problems = [];
|
|
242
|
+
const entries = definition.models.entries;
|
|
243
|
+
const vendors = new Set(definition.inference.vendors);
|
|
244
|
+
const reasoning = reasoningEnumOf(definition.configurationSchema);
|
|
245
|
+
const seen = /* @__PURE__ */ new Map();
|
|
246
|
+
if (entries.filter((entry) => entry.default).length > 1)
|
|
247
|
+
problems.push({ path: ["entries"], message: "At most one model is the default" });
|
|
248
|
+
entries.forEach((entry, index) => {
|
|
249
|
+
const at = ["entries", index];
|
|
250
|
+
if (!vendors.has(entry.vendor))
|
|
251
|
+
problems.push({
|
|
252
|
+
path: [...at, "vendor"],
|
|
253
|
+
message: `${entry.vendor} is not one of inference.vendors`
|
|
254
|
+
});
|
|
255
|
+
for (const reference of referencesOf(entry)) {
|
|
256
|
+
const owner = seen.get(reference);
|
|
257
|
+
if (owner == null) seen.set(reference, entry.id);
|
|
258
|
+
else
|
|
259
|
+
problems.push({
|
|
260
|
+
path: at,
|
|
261
|
+
message: `${reference} already names model ${owner}`
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
if (reasoning != null) {
|
|
265
|
+
for (const level of entry.reasoningLevels)
|
|
266
|
+
if (!reasoning.includes(level))
|
|
267
|
+
problems.push({
|
|
268
|
+
path: [...at, "reasoningLevels"],
|
|
269
|
+
message: `${level} is not a reasoning level the configuration accepts`
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
if (entry.defaultReasoning != null && !entry.reasoningLevels.includes(entry.defaultReasoning))
|
|
273
|
+
problems.push({
|
|
274
|
+
path: [...at, "defaultReasoning"],
|
|
275
|
+
message: `${entry.defaultReasoning} is not one of the model's reasoning levels`
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
return problems;
|
|
279
|
+
};
|
|
280
|
+
const resolveHarnessModel = (args) => {
|
|
281
|
+
const { models, inference } = args.definition;
|
|
282
|
+
const entry = models.entries.find((candidate) => referencesOf(candidate).includes(args.model));
|
|
283
|
+
if (entry != null)
|
|
284
|
+
return { entry, vendor: entry.vendor, vendorModelId: entry.vendorModelId ?? entry.id };
|
|
285
|
+
if (!models.open || args.model.length === 0) return null;
|
|
286
|
+
const vendors = inference.vendors;
|
|
287
|
+
if (vendors.length === 0) return { entry: null, vendor: null, vendorModelId: args.model };
|
|
288
|
+
const slash = args.model.indexOf("/");
|
|
289
|
+
if (slash < 0)
|
|
290
|
+
return vendors.length === 1 ? { entry: null, vendor: vendors[0] ?? null, vendorModelId: args.model } : null;
|
|
291
|
+
const vendor = args.model.slice(0, slash);
|
|
292
|
+
const vendorModelId = args.model.slice(slash + 1);
|
|
293
|
+
return vendors.includes(vendor) && vendorModelId.length > 0 ? { entry: null, vendor, vendorModelId } : null;
|
|
294
|
+
};
|
|
295
|
+
const harnessDefinitionHash = (definition) => hashOf(harnessDefinitionSchema, definition);
|
|
296
|
+
const acpAdapterDefinitionHash = (definition) => hashOf(acpAdapterDefinitionSchema, definition);
|
|
297
|
+
function* templatesOf(run) {
|
|
298
|
+
if (run == null) return;
|
|
299
|
+
yield run.command;
|
|
300
|
+
for (const arg of run.args) {
|
|
301
|
+
if (typeof arg === "string") yield arg;
|
|
302
|
+
else if ("args" in arg) yield* arg.args;
|
|
303
|
+
}
|
|
304
|
+
for (const value of Object.values(run.env)) yield typeof value === "string" ? value : value.value;
|
|
305
|
+
}
|
|
306
|
+
const nativeCapabilitiesOf = (harness) => [Capability.Files, Capability.Shell].filter(
|
|
307
|
+
(capability) => harness.native[capability] != null
|
|
308
|
+
);
|
|
309
|
+
const adapterNameFor = (args) => isUrlEnvironment(args.settings.environment) ? null : args.settings.adapter ?? args.harness.adapter;
|
|
310
|
+
const composeHarness = (args) => {
|
|
311
|
+
const { harness, settings } = args;
|
|
312
|
+
const name = settings.harness;
|
|
313
|
+
const environment = settings.environment;
|
|
314
|
+
const nativeAsProcess = nativeCapabilitiesOf(harness);
|
|
315
|
+
const none = (problems2, awaitsEnvironment = false) => ({
|
|
316
|
+
environment: null,
|
|
317
|
+
awaitsEnvironment,
|
|
318
|
+
adapter: null,
|
|
319
|
+
runtime: null,
|
|
320
|
+
native: nativeAsProcess,
|
|
321
|
+
problems: problems2
|
|
322
|
+
});
|
|
323
|
+
if (isUrlEnvironment(environment))
|
|
324
|
+
return {
|
|
325
|
+
environment: {
|
|
326
|
+
kind: HarnessEnvironmentKind.Url,
|
|
327
|
+
url: environment.url,
|
|
328
|
+
hop: environment.hop ?? null
|
|
329
|
+
},
|
|
330
|
+
awaitsEnvironment: false,
|
|
331
|
+
adapter: null,
|
|
332
|
+
runtime: null,
|
|
333
|
+
native: nativeAsProcess,
|
|
334
|
+
problems: settings.adapter == null ? [] : [
|
|
335
|
+
`an ACP endpoint at a URL already speaks ACP and takes no adapter (${settings.adapter})`
|
|
336
|
+
]
|
|
337
|
+
};
|
|
338
|
+
const sandboxId = environment ?? (nativeAsProcess.length > 0 ? args.compute[Capability.Shell] ?? args.compute[Capability.Files] ?? null : null);
|
|
339
|
+
if (sandboxId == null)
|
|
340
|
+
return nativeAsProcess.length > 0 ? none([], true) : none([`${name} needs an environment: name the sandbox it runs in, or an ACP endpoint URL`]);
|
|
341
|
+
const offered = args.sandboxRuntimes(sandboxId);
|
|
342
|
+
if (offered == null) return none([`No sandbox ${sandboxId} in this project`]);
|
|
343
|
+
const problems = [];
|
|
344
|
+
const adapter = args.adapter;
|
|
345
|
+
if (adapter == null && harness.interface !== ACP_V2_INTERFACE)
|
|
346
|
+
problems.push(`${name} speaks ${harness.interface}, not ACP v2, and names no ACP adapter`);
|
|
347
|
+
if (adapter != null && adapter.definition == null)
|
|
348
|
+
problems.push(`Unknown ACP adapter ${adapter.name}`);
|
|
349
|
+
if (adapter?.definition != null && !adapter.definition.adapts.includes(harness.interface))
|
|
350
|
+
problems.push(
|
|
351
|
+
`ACP adapter ${adapter.name} adapts ${adapter.definition.adapts.join(", ")}, not ${harness.interface}`
|
|
352
|
+
);
|
|
353
|
+
const harnessRuntimes = runtimesOf(harness.run);
|
|
354
|
+
const adapterRuntimes = adapter?.definition == null ? RUNTIME_KINDS : runtimesOf(adapter.definition.run);
|
|
355
|
+
const runtime = RUNTIME_KINDS.find(
|
|
356
|
+
(kind) => offered.includes(kind) && harnessRuntimes.includes(kind) && adapterRuntimes.includes(kind)
|
|
357
|
+
) ?? null;
|
|
358
|
+
if (runtime == null && harness.provider == null) {
|
|
359
|
+
const parts = [
|
|
360
|
+
`${name} runs as ${listOf(harnessRuntimes)}`,
|
|
361
|
+
...adapter?.definition == null ? [] : [`${adapter.name} as ${listOf(adapterRuntimes)}`],
|
|
362
|
+
`sandbox ${sandboxId} runs ${listOf([...offered])}`
|
|
363
|
+
];
|
|
364
|
+
problems.push(`Nothing here can run ${name}: ${parts.join("; ")}`);
|
|
365
|
+
}
|
|
366
|
+
return {
|
|
367
|
+
environment: { kind: HarnessEnvironmentKind.Sandbox, sandboxId },
|
|
368
|
+
awaitsEnvironment: false,
|
|
369
|
+
adapter: adapter?.name ?? null,
|
|
370
|
+
runtime,
|
|
371
|
+
// A worker runtime offers no files or shell of its own: a harness there
|
|
372
|
+
// drives the sandboxes provided for them.
|
|
373
|
+
native: runtime === RuntimeKind.Worker ? [] : nativeAsProcess,
|
|
374
|
+
problems
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
const listOf = (kinds) => kinds.length === 0 ? "nothing" : kinds.join(" or ");
|
|
378
|
+
const harnessCheckInputOf = (args) => {
|
|
379
|
+
const compute = {};
|
|
380
|
+
const enforces = {};
|
|
381
|
+
for (const capability of Object.values(Capability)) {
|
|
382
|
+
const native = args.composition.native.includes(capability);
|
|
383
|
+
compute[capability] = native ? HarnessComputeStatus.Harness : HarnessComputeStatus.Sandbox;
|
|
384
|
+
}
|
|
385
|
+
for (const capability of [Capability.Files, Capability.Shell])
|
|
386
|
+
if (args.composition.native.includes(capability))
|
|
387
|
+
enforces[capability] = args.harness.native[capability]?.enforces ?? [];
|
|
388
|
+
const permissionMode = args.settings.configuration.permissionMode;
|
|
389
|
+
const environment = args.composition.environment;
|
|
390
|
+
return {
|
|
391
|
+
supports: args.harness.features,
|
|
392
|
+
lowestPermission: args.harness.lowestPermission,
|
|
393
|
+
...permissionMode == null ? {} : { permissionMode },
|
|
394
|
+
compute,
|
|
395
|
+
environment: environment?.kind === HarnessEnvironmentKind.Sandbox ? environment.sandboxId : null,
|
|
396
|
+
awaitsEnvironment: args.composition.awaitsEnvironment,
|
|
397
|
+
enforces,
|
|
398
|
+
problems: args.composition.problems
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
export {
|
|
402
|
+
ACP_V2_INTERFACE2 as ACP_V2_INTERFACE,
|
|
403
|
+
AdapterConfigurationDelivery,
|
|
404
|
+
FinalExtension2 as FinalExtension,
|
|
405
|
+
HarnessEnvironmentKind2 as HarnessEnvironmentKind,
|
|
406
|
+
HarnessService,
|
|
407
|
+
RuntimeKind2 as RuntimeKind,
|
|
408
|
+
acpAdapterDefinitionHash,
|
|
409
|
+
acpAdapterDefinitionSchema,
|
|
410
|
+
adapterNameFor,
|
|
411
|
+
composeHarness,
|
|
412
|
+
harnessCheckInputOf,
|
|
413
|
+
harnessDefinitionHash,
|
|
414
|
+
harnessDefinitionSchema,
|
|
415
|
+
harnessModelSchema,
|
|
416
|
+
harnessModelsSchema,
|
|
417
|
+
harnessNativeSchema,
|
|
418
|
+
harnessProviderCodeSchema,
|
|
419
|
+
harnessProviderNameSchema,
|
|
420
|
+
harnessProviderReferenceSchema,
|
|
421
|
+
harnessStartFor,
|
|
422
|
+
processArgSchema,
|
|
423
|
+
processEnvValueSchema,
|
|
424
|
+
processRunSchema,
|
|
425
|
+
resolveHarnessModel,
|
|
426
|
+
runEntriesSchema,
|
|
427
|
+
runtimesOf2 as runtimesOf,
|
|
428
|
+
workerRunSchema
|
|
429
|
+
};
|
|
430
|
+
//# sourceMappingURL=harness-definition.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/harness-definition.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n Capability,\n FilesAccess,\n RUNTIME_KINDS,\n RuntimeKind,\n ShellAccess,\n type CapabilityAccess,\n} from '@finalai/agent-protocol';\nimport {\n HarnessComputeStatus,\n InferenceSourceKind,\n isUrlEnvironment,\n PermissionLevel,\n type ResolvedHarnessSettingsIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport * as z from 'zod';\nimport { contentHash } from \"./canonical-json.mjs\";\nimport { HarnessFeature } from \"./document.mjs\";\nimport {\n CredentialDelivery,\n DEFAULT_PROMPT_WHILE_RUNNING,\n DEFAULT_SESSION_SURVIVES_DISCONNECT,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n} from \"./harness.mjs\";\nimport {\n ACP_V2_INTERFACE,\n FinalExtension,\n HARNESS_COMMAND_PATH,\n HarnessEnvironmentKind,\n PLACEHOLDER,\n runtimesOf,\n} from \"./harness-start.mjs\";\nimport { jsonObjectSchema, jsonSchemaSchema, jsonValueSchema, type JsonSchema } from \"./json.mjs\";\nimport type { HarnessCheckInputIface } from \"./requirements-check.mjs\";\n\nexport { RuntimeKind } from '@finalai/agent-protocol';\nexport {\n ACP_V2_INTERFACE,\n FinalExtension,\n harnessStartFor,\n HarnessEnvironmentKind,\n runtimesOf,\n type HarnessStartResult,\n} from \"./harness-start.mjs\";\n\n// Three independent pieces reach a model loop:\n//\n// - a harness: the agent program (it may not speak ACP);\n// - an ACP adapter: maps one harness interface to ACP v2, reusable across\n// harnesses that share the interface; a harness speaking ACP v2 needs none;\n// - an environment: a sandbox that runs them, by runtime kind (`process` on a\n// machine, `worker` on a worker runtime), or an ACP v2 endpoint at a URL.\n//\n// Harness and adapter definitions are data, published by name and stored by\n// content hash. A harness provider (./harness-provider.ts) starts\n// adapter(harness) in the environment and hands the session service the ACP\n// stream; the requirements check composes the three with composeHarness.\n\nconst CONFIGURATION_PATH = /^configuration(?:\\.[A-Za-z0-9_-]+)+$/u;\n\nconst isTemplatePath = (path: string): boolean =>\n CONFIGURATION_PATH.test(path) || path === HARNESS_COMMAND_PATH;\n\nconst placeholdersOf = (template: string): string[] =>\n [...template.matchAll(PLACEHOLDER)].map((match) => match[1] ?? '');\n\nconst templateSchema = z\n .string()\n .max(4096)\n .superRefine((template, ctx) => {\n for (const path of placeholdersOf(template))\n if (!isTemplatePath(path))\n ctx.addIssue({\n code: 'custom',\n message: `{{${path}}} names neither configuration.<field> nor harness.command`,\n });\n });\n\nconst conditionPathSchema = z\n .string()\n .regex(CONFIGURATION_PATH, 'Expected configuration.<field>[.<field>\u2026]');\n\n// One launch argument: a template, a group included only when a configuration\n// value is set (not null, not false), or, in an adapter's entry, the wrapped\n// harness's arguments.\nexport const processArgSchema = z.union([\n templateSchema,\n z.strictObject({ when: conditionPathSchema, args: z.array(templateSchema).min(1) }),\n z.strictObject({ spread: z.literal('harness.args') }),\n]);\n\nexport const processEnvValueSchema = z.union([\n templateSchema,\n z.strictObject({ when: conditionPathSchema, value: templateSchema }),\n]);\n\n// A command any process environment can run. Its arguments and environment\n// are derived from the settings' configuration by the declared templates.\nexport const processRunSchema = z.strictObject({\n command: templateSchema.pipe(z.string().min(1)),\n args: z.array(processArgSchema).default([]),\n env: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u), processEnvValueSchema).default({}),\n});\n\n// A program built for a worker runtime, by the name the runtime knows it by.\nexport const workerRunSchema = z.strictObject({\n program: z.string().min(1).max(200),\n});\n\n// One entry per runtime kind the piece can run as.\nexport const runEntriesSchema = z\n .strictObject({\n [RuntimeKind.Process]: processRunSchema.optional(),\n [RuntimeKind.Worker]: workerRunSchema.optional(),\n })\n .default({});\n\nexport type ProcessRunIface = z.output<typeof processRunSchema>;\nexport type WorkerRunIface = z.output<typeof workerRunSchema>;\nexport type RunEntriesIface = z.output<typeof runEntriesSchema>;\n\n// A capability the harness uses with its own tools on the machine it runs on\n// as a process; the sandbox it runs in serves it.\nconst nativeUseSchema = <Access extends z.ZodType<CapabilityAccess>>(access: Access) =>\n z.strictObject({\n // Access levels below full it can hold the model to. Empty: none.\n enforces: z.array(access).default([]),\n // Its own tools for it, for display.\n tools: z.array(z.string()).default([]),\n });\n\nexport const harnessNativeSchema = z\n .strictObject({\n [Capability.Files]: nativeUseSchema(z.nativeEnum(FilesAccess)).optional(),\n [Capability.Shell]: nativeUseSchema(z.nativeEnum(ShellAccess)).optional(),\n })\n .default({});\n\n// Code that reaches the harness itself, for one that is not a program its\n// environment runs (./harness-provider.ts): one self-contained ES module.\nexport const harnessProviderCodeSchema = z.strictObject({\n source: z\n .string()\n .min(1)\n .max(4 * 1024 * 1024),\n});\n\nexport type HarnessProviderCodeIface = z.infer<typeof harnessProviderCodeSchema>;\n\n// A published harness provider that reaches the harness, by name: bare for\n// one in the caller's projects, `handle/name` for a publisher's public one.\nexport const harnessProviderNameSchema = z.strictObject({\n name: z.string().min(1).max(200),\n});\n\nexport type HarnessProviderNameIface = z.infer<typeof harnessProviderNameSchema>;\n\n// What reaches a harness that is not (only) a program its environment runs:\n// its own code, or a published provider by name. Absent, the platform's\n// default provider starts adapter(harness) in the environment.\nexport const harnessProviderReferenceSchema = z.union([\n harnessProviderCodeSchema,\n harnessProviderNameSchema,\n]);\n\nexport type HarnessProviderReferenceIface = z.infer<typeof harnessProviderReferenceSchema>;\n\n// Services the platform runs for a harness session, issued only to a harness\n// or ACP adapter that declares it uses them.\nexport enum HarnessService {\n // Durable per-session storage the harness appends to and loads from.\n SessionStore = 'session-store',\n // Oversized ACP frames replaced by an attachment reference.\n FrameAttachments = 'frame-attachments',\n // Model requests relayed through a subscription the harness cannot hold.\n SubscriptionRelay = 'subscription-relay',\n}\n\nconst servicesSchema = z\n .array(z.nativeEnum(HarnessService))\n .default([])\n .refine((services) => new Set(services).size === services.length, {\n message: 'Services must not repeat',\n });\n\n// One model a harness definition offers. Settings name it by `id` (or an\n// alias) in `configuration.model`; `runtime` is read only by the harness's own\n// program or adapter.\nexport const harnessModelSchema = z.strictObject({\n id: z.string().min(1).max(200),\n label: z.string().min(1).max(120),\n // One of the definition's `inference.vendors`.\n vendor: z.string().min(1).max(60),\n // The id on the vendor's API; `id` when absent.\n vendorModelId: z.string().min(1).max(200).optional(),\n aliases: z.array(z.string().min(1).max(200)).default([]),\n // A subset of the configuration schema's `reasoning` enum.\n reasoningLevels: z.array(z.string().min(1)).default([]),\n defaultReasoning: z.string().min(1).optional(),\n // At most one entry per definition is the default.\n default: z.boolean().default(false),\n input: z.array(z.enum(['text', 'image'])).default(['text']),\n runtime: jsonObjectSchema.default({}),\n});\n\nexport type HarnessModelIface = z.output<typeof harnessModelSchema>;\nexport type HarnessModelInputIface = z.input<typeof harnessModelSchema>;\n\nexport const harnessModelsSchema = z.strictObject({\n // Also accept `<vendor>/<id>` for a vendor in `inference.vendors` (and, for\n // a definition with exactly one vendor, a bare id) outside `entries`. With\n // no vendors declared, any model is accepted and the harness validates it.\n open: z.boolean().default(false),\n entries: z.array(harnessModelSchema).default([]),\n});\n\nexport type HarnessModelsIface = z.output<typeof harnessModelsSchema>;\n\nexport const harnessDefinitionSchema = z\n .strictObject({\n title: z.string().min(1).max(120).optional(),\n description: z.string().max(2000).optional(),\n // Everything configurable (model, reasoning, inference, permission mode,\n // anything harness-specific) as JSON Schema, so a picker can render it\n // without running code.\n configurationSchema: jsonSchemaSchema,\n // Features of the agent document it supports.\n features: z.array(z.nativeEnum(HarnessFeature)),\n // The most it can be held to: a harness that cannot ask before acting is `auto`.\n lowestPermission: z.nativeEnum(PermissionLevel),\n inference: z.strictObject({\n vendors: z.array(z.string()).default([]),\n // Inference sources it can use; the others in a caller's list are skipped.\n kinds: z.array(z.nativeEnum(InferenceSourceKind)),\n delivery: z.nativeEnum(CredentialDelivery),\n }),\n // The models it offers (resolveHarnessModel). Absent: any model, which\n // the harness validates itself.\n models: harnessModelsSchema.default({ open: true, entries: [] }),\n // Platform services it uses during a session.\n services: servicesSchema,\n native: harnessNativeSchema,\n // The native interface an ACP adapter maps (`acp-v2`: it needs none).\n interface: z.string().min(1).max(120).default(ACP_V2_INTERFACE),\n // The ACP adapter it runs behind unless the settings name another.\n adapter: z.string().min(1).max(200).nullable().default(null),\n run: runEntriesSchema,\n // Reaches the harness itself instead of starting a program in an environment.\n provider: harnessProviderReferenceSchema.optional(),\n // MCP server transports it takes in `session/new`.\n mcp: z.array(z.nativeEnum(McpTransportKind)).default([]),\n // Wires it speaks to reach a provided sandbox.\n consumes: z.array(z.nativeEnum(SandboxWire)).default([]),\n supports: z\n .strictObject({\n observe: z.boolean().default(false),\n resumeReplay: z.boolean().default(false),\n fork: z.boolean().default(false),\n // Renders _meta[\"final.ai\"].author itself; otherwise the author's\n // name is prepended to the text.\n authorMeta: z.boolean().default(false),\n // Defers and searches MCP tools itself.\n deferredToolSearch: z.boolean().default(false),\n })\n .default({\n observe: false,\n resumeReplay: false,\n fork: false,\n authorMeta: false,\n deferredToolSearch: false,\n }),\n promptWhileRunning: z.nativeEnum(PromptWhileRunning).default(DEFAULT_PROMPT_WHILE_RUNNING),\n sessionSurvivesDisconnect: z.boolean().default(DEFAULT_SESSION_SURVIVES_DISCONNECT),\n })\n .superRefine((definition, ctx) => {\n // An agent that speaks ACP v2 itself may be reached only at a URL.\n if (\n runtimesOf(definition.run).length === 0 &&\n definition.provider == null &&\n definition.interface !== ACP_V2_INTERFACE\n )\n ctx.addIssue({\n code: 'custom',\n path: ['run'],\n message:\n 'A harness needs a run entry (process or worker) or a provider, unless it speaks ACP v2 and is reached at a URL',\n });\n for (const arg of definition.run.process?.args ?? [])\n if (typeof arg === 'object' && 'spread' in arg)\n ctx.addIssue({\n code: 'custom',\n path: ['run', 'process', 'args'],\n message: 'Only an ACP adapter wraps a harness command',\n });\n for (const template of templatesOf(definition.run.process))\n if (placeholdersOf(template).includes(HARNESS_COMMAND_PATH))\n ctx.addIssue({\n code: 'custom',\n path: ['run', 'process'],\n message: 'Only an ACP adapter wraps a harness command',\n });\n for (const problem of modelProblems(definition))\n ctx.addIssue({ code: 'custom', path: ['models', ...problem.path], message: problem.message });\n });\n\nexport type HarnessDefinitionIface = z.output<typeof harnessDefinitionSchema>;\nexport type HarnessDefinitionInputIface = z.input<typeof harnessDefinitionSchema>;\n\n// How the harness configuration reaches the harness through an adapter.\nexport enum AdapterConfigurationDelivery {\n // In the launch arguments and environment, by the run entries' templates.\n Launch = 'launch',\n // As ACP session config options after `session/new`.\n ConfigOptions = 'config-options',\n}\n\nexport const acpAdapterDefinitionSchema = z\n .strictObject({\n title: z.string().min(1).max(120).optional(),\n description: z.string().max(2000).optional(),\n // The harness interfaces it maps to ACP v2.\n adapts: z.array(z.string().min(1).max(120)).min(1),\n // `process`: a command that launches or wraps the harness and speaks ACP\n // v2 on stdio. `worker`: a worker program that does the same.\n run: runEntriesSchema,\n configuration: z\n .nativeEnum(AdapterConfigurationDelivery)\n .default(AdapterConfigurationDelivery.Launch),\n // The Final ACP extensions it implements and advertises in `initialize`.\n extensions: z.array(z.nativeEnum(FinalExtension)).default([]),\n // Platform services it uses during a session.\n services: servicesSchema,\n })\n .superRefine((definition, ctx) => {\n if (runtimesOf(definition.run).length === 0)\n ctx.addIssue({\n code: 'custom',\n path: ['run'],\n message: 'An ACP adapter needs a run entry (process or worker)',\n });\n });\n\nexport type AcpAdapterDefinitionIface = z.output<typeof acpAdapterDefinitionSchema>;\nexport type AcpAdapterDefinitionInputIface = z.input<typeof acpAdapterDefinitionSchema>;\n\nconst hashOf = async <Schema extends z.ZodType>(schema: Schema, value: unknown): Promise<string> =>\n contentHash(jsonValueSchema.parse(JSON.parse(JSON.stringify(schema.parse(value)))));\n\n// Model entries and the definition must agree: references are unique, at\n// most one default, vendors declared, reasoning levels in the configuration's\n// reasoning enum.\n\ninterface ModelProblemIface {\n path: (string | number)[];\n message: string;\n}\n\nconst reasoningEnumOf = (schema: JsonSchema): string[] | null => {\n const properties = jsonObjectSchema.safeParse(schema['properties']).data;\n const reasoning = jsonObjectSchema.safeParse(properties?.['reasoning']).data;\n if (reasoning == null) return [];\n const levels = z.array(z.string()).safeParse(reasoning['enum']).data;\n return levels ?? null;\n};\n\n// The strings a model setting can name an entry by: its id, its aliases and\n// `vendor/vendorModelId`.\nconst referencesOf = (entry: HarnessModelIface): string[] => [\n ...new Set([entry.id, ...entry.aliases, `${entry.vendor}/${entry.vendorModelId ?? entry.id}`]),\n];\n\nconst modelProblems = (\n definition: Pick<HarnessDefinitionIface, 'models' | 'inference' | 'configurationSchema'>,\n): ModelProblemIface[] => {\n const problems: ModelProblemIface[] = [];\n const entries = definition.models.entries;\n const vendors = new Set(definition.inference.vendors);\n const reasoning = reasoningEnumOf(definition.configurationSchema);\n const seen = new Map<string, string>();\n if (entries.filter((entry) => entry.default).length > 1)\n problems.push({ path: ['entries'], message: 'At most one model is the default' });\n entries.forEach((entry, index) => {\n const at = ['entries', index];\n if (!vendors.has(entry.vendor))\n problems.push({\n path: [...at, 'vendor'],\n message: `${entry.vendor} is not one of inference.vendors`,\n });\n for (const reference of referencesOf(entry)) {\n const owner = seen.get(reference);\n if (owner == null) seen.set(reference, entry.id);\n else\n problems.push({\n path: at,\n message: `${reference} already names model ${owner}`,\n });\n }\n if (reasoning != null)\n for (const level of entry.reasoningLevels)\n if (!reasoning.includes(level))\n problems.push({\n path: [...at, 'reasoningLevels'],\n message: `${level} is not a reasoning level the configuration accepts`,\n });\n if (entry.defaultReasoning != null && !entry.reasoningLevels.includes(entry.defaultReasoning))\n problems.push({\n path: [...at, 'defaultReasoning'],\n message: `${entry.defaultReasoning} is not one of the model's reasoning levels`,\n });\n });\n return problems;\n};\n\nexport interface ResolvedHarnessModelIface {\n // The entry it names; null for a model the definition accepts openly.\n entry: HarnessModelIface | null;\n // The vendor serving it; null only when the definition declares no vendors\n // and accepts any model.\n vendor: string | null;\n // The model's id on the vendor's API.\n vendorModelId: string;\n}\n\n// What a `configuration.model` names under a definition: one of its entries\n// (by id, alias or `vendor/vendorModelId`), or, for an open list, a model of\n// a declared vendor. Null when the definition does not offer it.\nexport const resolveHarnessModel = (args: {\n definition: Pick<HarnessDefinitionIface, 'models' | 'inference'>;\n model: string;\n}): ResolvedHarnessModelIface | null => {\n const { models, inference } = args.definition;\n const entry = models.entries.find((candidate) => referencesOf(candidate).includes(args.model));\n if (entry != null)\n return { entry, vendor: entry.vendor, vendorModelId: entry.vendorModelId ?? entry.id };\n if (!models.open || args.model.length === 0) return null;\n const vendors = inference.vendors;\n if (vendors.length === 0) return { entry: null, vendor: null, vendorModelId: args.model };\n const slash = args.model.indexOf('/');\n if (slash < 0)\n return vendors.length === 1\n ? { entry: null, vendor: vendors[0] ?? null, vendorModelId: args.model }\n : null;\n const vendor = args.model.slice(0, slash);\n const vendorModelId = args.model.slice(slash + 1);\n return vendors.includes(vendor) && vendorModelId.length > 0\n ? { entry: null, vendor, vendorModelId }\n : null;\n};\n\n// Content hashes with defaults applied, as for agent documents.\nexport const harnessDefinitionHash = (definition: HarnessDefinitionInputIface): Promise<string> =>\n hashOf(harnessDefinitionSchema, definition);\n\nexport const acpAdapterDefinitionHash = (\n definition: AcpAdapterDefinitionInputIface,\n): Promise<string> => hashOf(acpAdapterDefinitionSchema, definition);\n\nfunction* templatesOf(run: ProcessRunIface | undefined): Generator<string> {\n if (run == null) return;\n yield run.command;\n for (const arg of run.args) {\n if (typeof arg === 'string') yield arg;\n else if ('args' in arg) yield* arg.args;\n }\n for (const value of Object.values(run.env)) yield typeof value === 'string' ? value : value.value;\n}\n\n// Composition: which runtime, which adapter, which sandbox.\n\nexport type ComposedEnvironmentIface =\n | { kind: HarnessEnvironmentKind.Sandbox; sandboxId: string }\n | { kind: HarnessEnvironmentKind.Url; url: string; hop: string | null };\n\nexport interface NamedDefinitionIface<Definition> {\n name: string;\n // Null when the name resolves to nothing the project can use.\n definition: Definition | null;\n}\n\nexport interface HarnessCompositionArgsIface {\n harness: HarnessDefinitionIface;\n // The adapter the settings name, else the harness's default; null when\n // neither names one.\n adapter: NamedDefinitionIface<AcpAdapterDefinitionIface> | null;\n settings: Pick<ResolvedHarnessSettingsIface, 'harness' | 'adapter' | 'environment'>;\n // The caller's compute, which places a harness that names no environment.\n compute: Partial<Record<Capability, string>>;\n // The runtime kinds a sandbox offers; null for an id naming nothing in the project.\n sandboxRuntimes: (sandboxId: string) => readonly RuntimeKind[] | null;\n}\n\nexport interface HarnessCompositionIface {\n // Null when it has none yet (see awaitsEnvironment) or cannot have one.\n environment: ComposedEnvironmentIface | null;\n // It uses files or shell natively and runs in the sandbox provided for\n // `shell`, which was not.\n awaitsEnvironment: boolean;\n // The adapter's name when one is used.\n adapter: string | null;\n // What the environment runs it as; null at a URL, when unknown, or for a\n // harness its provider reaches without a run entry.\n runtime: RuntimeKind | null;\n // Capabilities the harness uses natively where it runs: none as a worker.\n native: Capability[];\n problems: string[];\n}\n\nconst nativeCapabilitiesOf = (harness: HarnessDefinitionIface): Capability[] =>\n ([Capability.Files, Capability.Shell] as const).filter(\n (capability) => harness.native[capability] != null,\n );\n\n// The adapter a harness runs behind under these settings: the settings',\n// else the harness's default.\nexport const adapterNameFor = (args: {\n harness: HarnessDefinitionIface;\n settings: Pick<ResolvedHarnessSettingsIface, 'adapter' | 'environment'>;\n}): string | null =>\n isUrlEnvironment(args.settings.environment)\n ? null\n : (args.settings.adapter ?? args.harness.adapter);\n\n// Composes a harness, its adapter and its environment: the environment must\n// run a kind both the harness and the adapter have an entry for, and a\n// harness that uses files or shell natively runs in the sandbox providing\n// them.\nexport const composeHarness = (args: HarnessCompositionArgsIface): HarnessCompositionIface => {\n const { harness, settings } = args;\n const name = settings.harness;\n const environment = settings.environment;\n const nativeAsProcess = nativeCapabilitiesOf(harness);\n const none = (problems: string[], awaitsEnvironment = false): HarnessCompositionIface => ({\n environment: null,\n awaitsEnvironment,\n adapter: null,\n runtime: null,\n native: nativeAsProcess,\n problems,\n });\n\n if (isUrlEnvironment(environment))\n return {\n environment: {\n kind: HarnessEnvironmentKind.Url,\n url: environment.url,\n hop: environment.hop ?? null,\n },\n awaitsEnvironment: false,\n adapter: null,\n runtime: null,\n native: nativeAsProcess,\n problems:\n settings.adapter == null\n ? []\n : [\n `an ACP endpoint at a URL already speaks ACP and takes no adapter (${settings.adapter})`,\n ],\n };\n\n const sandboxId =\n environment ??\n (nativeAsProcess.length > 0\n ? (args.compute[Capability.Shell] ?? args.compute[Capability.Files] ?? null)\n : null);\n if (sandboxId == null)\n return nativeAsProcess.length > 0\n ? none([], true)\n : none([`${name} needs an environment: name the sandbox it runs in, or an ACP endpoint URL`]);\n const offered = args.sandboxRuntimes(sandboxId);\n if (offered == null) return none([`No sandbox ${sandboxId} in this project`]);\n\n const problems: string[] = [];\n const adapter = args.adapter;\n if (adapter == null && harness.interface !== ACP_V2_INTERFACE)\n problems.push(`${name} speaks ${harness.interface}, not ACP v2, and names no ACP adapter`);\n if (adapter != null && adapter.definition == null)\n problems.push(`Unknown ACP adapter ${adapter.name}`);\n if (adapter?.definition != null && !adapter.definition.adapts.includes(harness.interface))\n problems.push(\n `ACP adapter ${adapter.name} adapts ${adapter.definition.adapts.join(', ')}, not ${harness.interface}`,\n );\n\n const harnessRuntimes = runtimesOf(harness.run);\n const adapterRuntimes =\n adapter?.definition == null ? RUNTIME_KINDS : runtimesOf(adapter.definition.run);\n const runtime =\n RUNTIME_KINDS.find(\n (kind) =>\n offered.includes(kind) && harnessRuntimes.includes(kind) && adapterRuntimes.includes(kind),\n ) ?? null;\n if (runtime == null && harness.provider == null) {\n const parts = [\n `${name} runs as ${listOf(harnessRuntimes)}`,\n ...(adapter?.definition == null ? [] : [`${adapter.name} as ${listOf(adapterRuntimes)}`]),\n `sandbox ${sandboxId} runs ${listOf([...offered])}`,\n ];\n problems.push(`Nothing here can run ${name}: ${parts.join('; ')}`);\n }\n\n return {\n environment: { kind: HarnessEnvironmentKind.Sandbox, sandboxId },\n awaitsEnvironment: false,\n adapter: adapter?.name ?? null,\n runtime,\n // A worker runtime offers no files or shell of its own: a harness there\n // drives the sandboxes provided for them.\n native: runtime === RuntimeKind.Worker ? [] : nativeAsProcess,\n problems,\n };\n};\n\nconst listOf = (kinds: readonly string[]): string =>\n kinds.length === 0 ? 'nothing' : kinds.join(' or ');\n\n// The requirements check's view of a composed harness (./requirements-check.ts).\nexport const harnessCheckInputOf = (args: {\n harness: HarnessDefinitionIface;\n composition: HarnessCompositionIface;\n settings: Pick<ResolvedHarnessSettingsIface, 'configuration'>;\n}): HarnessCheckInputIface => {\n const compute: Partial<Record<Capability, HarnessComputeStatus>> = {};\n const enforces: Partial<Record<Capability, readonly CapabilityAccess[]>> = {};\n for (const capability of Object.values(Capability)) {\n const native = args.composition.native.includes(capability);\n compute[capability] = native ? HarnessComputeStatus.Harness : HarnessComputeStatus.Sandbox;\n }\n for (const capability of [Capability.Files, Capability.Shell] as const)\n if (args.composition.native.includes(capability))\n enforces[capability] = args.harness.native[capability]?.enforces ?? [];\n const permissionMode = args.settings.configuration.permissionMode;\n const environment = args.composition.environment;\n return {\n supports: args.harness.features,\n lowestPermission: args.harness.lowestPermission,\n ...(permissionMode == null ? {} : { permissionMode }),\n compute,\n environment:\n environment?.kind === HarnessEnvironmentKind.Sandbox ? environment.sandboxId : null,\n awaitsEnvironment: args.composition.awaitsEnvironment,\n enforces,\n problems: args.composition.problems,\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,YAAY,OAAO;AACnB,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AA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