@finalai/final-agent-provider 0.1.4 → 0.2.1

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.
Files changed (42) hide show
  1. package/HOSTING.md +49 -9
  2. package/README.md +10 -0
  3. package/dist/modules/harnesses/config-fields.d.mts +3 -2
  4. package/dist/modules/harnesses/config-fields.mjs +16 -3
  5. package/dist/modules/harnesses/config-fields.mjs.map +3 -3
  6. package/dist/modules/harnesses/index.d.mts +1 -1
  7. package/dist/modules/harnesses/index.mjs +2 -1
  8. package/dist/modules/harnesses/index.mjs.map +2 -2
  9. package/dist/modules/harnesses/model-reference.d.mts +6 -0
  10. package/dist/modules/harnesses/model-reference.mjs +12 -0
  11. package/dist/modules/harnesses/model-reference.mjs.map +7 -0
  12. package/dist/modules/harnesses/remote-claude-code.mjs +2 -2
  13. package/dist/modules/harnesses/remote-claude-code.mjs.map +2 -2
  14. package/dist/modules/harnesses/remote-codex.mjs +2 -2
  15. package/dist/modules/harnesses/remote-codex.mjs.map +2 -2
  16. package/dist/modules/harnesses/remote-pi.mjs +2 -2
  17. package/dist/modules/harnesses/remote-pi.mjs.map +2 -2
  18. package/dist/modules/harnesses/serverless-final.d.mts +2 -3
  19. package/dist/modules/harnesses/serverless-final.mjs +4 -9
  20. package/dist/modules/harnesses/serverless-final.mjs.map +2 -2
  21. package/dist/modules/harnesses/serverless-nanocode-claude.d.mts +2 -3
  22. package/dist/modules/harnesses/serverless-nanocode-claude.mjs +4 -9
  23. package/dist/modules/harnesses/serverless-nanocode-claude.mjs.map +2 -2
  24. package/dist/modules/harnesses/serverless-nanocode-codex.d.mts +2 -3
  25. package/dist/modules/harnesses/serverless-nanocode-codex.mjs +4 -9
  26. package/dist/modules/harnesses/serverless-nanocode-codex.mjs.map +2 -2
  27. package/dist/modules/harnesses/serverless-pi.d.mts +2 -3
  28. package/dist/modules/harnesses/serverless-pi.mjs +4 -4
  29. package/dist/modules/harnesses/serverless-pi.mjs.map +2 -2
  30. package/dist/modules/sandboxes/computer.mjs +21 -14
  31. package/dist/modules/sandboxes/computer.mjs.map +2 -2
  32. package/dist/modules/sandboxes/device.mjs +1 -1
  33. package/dist/modules/sandboxes/device.mjs.map +2 -2
  34. package/dist/modules/sandboxes/session.d.mts +1 -1
  35. package/dist/modules/sandboxes/session.mjs +1 -1
  36. package/dist/modules/sandboxes/session.mjs.map +2 -2
  37. package/dist/modules/sandboxes/testing/fake-machine.mjs +8 -0
  38. package/dist/modules/sandboxes/testing/fake-machine.mjs.map +2 -2
  39. package/package.json +3 -8
  40. package/dist/modules/harnesses/models.d.mts +0 -281
  41. package/dist/modules/harnesses/models.mjs +0 -234
  42. package/dist/modules/harnesses/models.mjs.map +0 -7
package/HOSTING.md CHANGED
@@ -21,6 +21,24 @@ Neither rewrites authored URLs. A GitHub-backed definition uses remote source;
21
21
  push edits before explicitly publishing a ref. Caller API keys never become agent
22
22
  credentials merely because they were used to publish.
23
23
 
24
+ ## Hosted model resolution (SDK 0.2.0)
25
+
26
+ Hosted Final, Pi, Codex and Claude configurations accept string model references.
27
+ `serverless*ConfigSchema.parse(...).model` can be undefined: the host must choose
28
+ its catalog default, resolve aliases and validate availability before dispatch.
29
+ The host owns current candidates, runtime capabilities and dated prices, and
30
+ advertises picker choices through its harness descriptions. Compilation remains
31
+ offline and checks reference syntax.
32
+
33
+ SDK 0.2.0 removes `@finalai/agents/models` and
34
+ `@finalai/final-agent-provider/harnesses/models`, including their model arrays,
35
+ defaults, model-ID unions and pricing helpers. Migrate callers to string model
36
+ references and host-owned discovery, metadata and pricing.
37
+
38
+ Publish the SDK release before upgrading host dependencies. Ship the host's
39
+ catalog/default implementation together with its SDK dependency upgrade; a host
40
+ that only changes the dependency will lose the old default and catalog APIs.
41
+
24
42
  ## Hosted connections
25
43
 
26
44
  ```ts
@@ -99,15 +117,37 @@ export default defineFinalConnection({
99
117
  });
100
118
  ```
101
119
 
102
- Without `load`, the harness lists every exposed tool, as before. With it, the host
103
- lists only the loaded tools and must keep every other exposed tool reachable: it
104
- serves a search over the connection's remaining exposed tools (name, description,
105
- input schema) and a call that runs a found tool by its real name, with the same
106
- exposure and approval checks as a direct call. A host may instead add a found tool
107
- to the list and send `notifications/tools/list_changed`; harnesses that ignore that
108
- notification still need the call path. `load: []` leaves every tool to search.
109
- Entries are tool names or `*` patterns. `isToolLoaded` from `@finalai/agent-provider`
110
- applies the rule after exposure.
120
+ With `load`, the host lists only the loaded tools and must keep every other exposed
121
+ tool reachable: it serves a search over the connection's remaining exposed tools
122
+ (name, description, input schema) and a call that runs a found tool by its real
123
+ name, with the same exposure and approval checks as a direct call. A host may
124
+ instead add a found tool to the list and send `notifications/tools/list_changed`;
125
+ harnesses that ignore that notification still need the call path. `load: []`
126
+ leaves every tool to search. Entries are tool names or `*` patterns.
127
+ `isToolLoaded` from `@finalai/agent-provider` applies the rule after exposure.
128
+
129
+ Without `load`, the harness lists the connection's exposed tools except:
130
+
131
+ - **Connector tools.** A server can label a tool with the connector it belongs to
132
+ in the tool's `_meta`:
133
+ `{ "ai.final/connector": { "namespace": "salesforce", "name": "Salesforce" } }`.
134
+ The namespace identifies the connector (unique within the server's tools); the
135
+ name is for display, and two connectors may share one. Final's server labels
136
+ every connector tool with the namespace and name of the install it comes from.
137
+ The host never lists labelled tools up front. Its search tool names each
138
+ connector and how many tools it has, so the agent knows what is connected
139
+ without any of those definitions in its context, and searches for the tools it
140
+ needs. A `load` entry that names a labelled tool still lists it.
141
+ - **Tools past a size limit.** When a connection exposes more unlabelled tools
142
+ than the host lists directly (100 in Final's host), those are searched too.
143
+
144
+ A harness that declares `supports.deferredToolSearch` defers and searches tools
145
+ itself, so the host lists every exposed tool to it and serves no search.
146
+
147
+ A host's search should name the connectors it covers and accept a connector's
148
+ namespace to narrow to. Once a host has listed its search and call tools, it keeps answering them for
149
+ that harness even if the connection stops hiding tools, unless the connection
150
+ then lists its own tool by one of those names.
111
151
 
112
152
  ## Selecting tools by annotation
113
153
 
package/README.md CHANGED
@@ -16,3 +16,13 @@ using the generic `defineHostedConnection` implementation. Its session grant sti
16
16
  goes through the usual credential broker. Existing calls with an explicit `url`
17
17
  remain static. Hosts without a binding reader cannot run URL-free definitions;
18
18
  see the repository's [hosting guide](HOSTING.md) for wiring requirements.
19
+
20
+ ## Hosted model references
21
+
22
+ The serverless Final, Pi, Codex and Claude helpers accept model strings, including provider-qualified references such as `openrouter/deepseek/deepseek-v4.1-flash`. Existing short model IDs remain valid aliases when the installed platform catalog supports them. The SDK checks printable ASCII reference syntax (up to 200 characters); the installed platform selects defaults, validates availability and supplies model picker suggestions. Omitting `model` inherits the platform default. Host integrators must now handle `serverless*ConfigSchema.parse(...).model` being undefined and resolve the default before dispatch. Local compilation does not fetch a model catalog.
23
+
24
+ Adding a model on an already-supported provider API requires a platform catalog update, not an SDK release. Native nanocode models must use an engine policy the platform supports. New provider protocols still require an integration.
25
+
26
+ The `modelZod(ids)` and `modelJson(ids, defaultId)` helpers retain explicit restrictions for third-party harness authors who choose to supply them.
27
+
28
+ SDK 0.2.0 removes `@finalai/agents/models` and `@finalai/final-agent-provider/harnesses/models`, including their model arrays, defaults, model-ID unions and pricing helpers. Use string model references and the installed platform’s harness description for current candidates and defaults. Pricing belongs to the hosting platform. The protocol-level `ModelVendor` enum remains available from `@finalai/final-agent-provider/harnesses`.
@@ -1,5 +1,6 @@
1
1
  import { type CredentialPolicyIface, type DynamicSlotIface, type InstructionFragmentIface, type JsonObject, type JsonSchema, type JsonValue, type PackageProviderRefIface, type SkillBundleIface } from '@finalai/agent-provider';
2
2
  import * as z from 'zod';
3
+ export { MODEL_REFERENCE_PATTERN } from "./model-reference.mjs";
3
4
  export declare enum ReasoningLevel {
4
5
  None = "none",
5
6
  Minimal = "minimal",
@@ -40,7 +41,7 @@ export declare const configObjectJson: (args: {
40
41
  properties: Record<string, JsonSchema>;
41
42
  required?: string[];
42
43
  }) => JsonSchema;
43
- export declare const modelJson: (ids: readonly string[], defaultId: string) => JsonSchema;
44
+ export declare const modelJson: (ids?: readonly string[], defaultId?: string) => JsonSchema;
44
45
  export declare const reasoningJson: (levels: readonly ReasoningLevel[]) => JsonSchema;
45
46
  export declare const credentialsJson: () => JsonSchema;
46
47
  export declare const permissionModeJson: (modes: readonly string[], defaultMode?: string) => JsonSchema;
@@ -49,7 +50,7 @@ export declare const skillsJson: () => JsonSchema;
49
50
  export declare const secretRefJson: () => JsonSchema;
50
51
  export declare const urlJson: (title: string, schemes: readonly string[]) => JsonSchema;
51
52
  export declare const absolutePathJson: (title: string) => JsonSchema;
52
- export declare const modelZod: (ids: readonly string[]) => z.ZodString;
53
+ export declare const modelZod: (ids?: readonly string[]) => z.ZodString;
53
54
  export declare const reasoningZod: (levels: readonly ReasoningLevel[]) => z.ZodEnum<typeof ReasoningLevel>;
54
55
  export declare const credentialsZod: () => z.ZodObject<{
55
56
  payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
@@ -1,3 +1,4 @@
1
+ import { MODEL_REFERENCE_PATTERN } from "./model-reference.mjs";
1
2
  import {
2
3
  credentialPolicySchema,
3
4
  instructionFragmentSchema,
@@ -8,6 +9,7 @@ import {
8
9
  skillBundleSchema
9
10
  } from "@finalai/agent-provider";
10
11
  import * as z from "zod";
12
+ import { MODEL_REFERENCE_PATTERN as MODEL_REFERENCE_PATTERN2 } from "./model-reference.mjs";
11
13
  var ReasoningLevel = /* @__PURE__ */ ((ReasoningLevel2) => {
12
14
  ReasoningLevel2["None"] = "none";
13
15
  ReasoningLevel2["Minimal"] = "minimal";
@@ -52,8 +54,9 @@ const configObjectJson = (args) => ({
52
54
  });
53
55
  const modelJson = (ids, defaultId) => ({
54
56
  $ref: SCHEMA_IDS.modelPicker,
55
- enum: [...ids],
56
- default: defaultId
57
+ type: "string",
58
+ ...ids == null ? { minLength: 1, maxLength: 200, pattern: MODEL_REFERENCE_PATTERN } : { enum: [...ids] },
59
+ ...defaultId == null ? {} : { default: defaultId }
57
60
  });
58
61
  const reasoningJson = (levels) => ({
59
62
  $ref: SCHEMA_IDS.reasoning,
@@ -79,7 +82,16 @@ const absolutePathJson = (title) => ({
79
82
  title,
80
83
  pattern: "^/"
81
84
  });
82
- const modelZod = (ids) => z.string().refine((id) => ids.includes(id), { message: `model must be one of: ${ids.join(", ")}` });
85
+ const modelZod = (ids) => {
86
+ if (ids != null)
87
+ return z.string().refine((id) => ids.includes(id), {
88
+ message: `model must be one of: ${ids.join(", ")}`
89
+ });
90
+ const pattern = new RegExp(MODEL_REFERENCE_PATTERN);
91
+ return z.string().min(1).max(200).regex(pattern, {
92
+ message: "model must be a printable ASCII reference without empty path segments"
93
+ });
94
+ };
83
95
  const reasoningZod = (levels) => z.nativeEnum(ReasoningLevel).refine((level) => levels.includes(level), {
84
96
  message: `reasoning must be one of: ${levels.join(", ")}`
85
97
  });
@@ -107,6 +119,7 @@ export {
107
119
  ClaudePermissionMode,
108
120
  CodexApprovalPolicy,
109
121
  CodexSandboxMode,
122
+ MODEL_REFERENCE_PATTERN2 as MODEL_REFERENCE_PATTERN,
110
123
  PiPermissionMode,
111
124
  ReasoningLevel,
112
125
  absolutePathJson,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/harnesses/config-fields.ts"],
4
- "sourcesContent": ["import {\n credentialPolicySchema,\n instructionFragmentSchema,\n jsonObjectSchema,\n jsonValueSchema,\n packageRef,\n SCHEMA_IDS,\n skillBundleSchema,\n type CredentialPolicyIface,\n type DynamicSlotIface,\n type InstructionFragmentIface,\n type JsonObject,\n type JsonSchema,\n type JsonValue,\n type PackageProviderRefIface,\n type SkillBundleIface,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\n\n// Config-schema building blocks shared by the harness modules. Each harness\n// writes its JSON Schema (what Build renders, $ref-ing the shared\n// final://schemas/* fragments) and a zod mirror (what open() validates the\n// resolved config with) from these, and a test keeps the two aligned.\n\n// Mirrors the final://schemas/reasoning fragment's enum.\nexport enum ReasoningLevel {\n None = 'none',\n Minimal = 'minimal',\n Low = 'low',\n Medium = 'medium',\n High = 'high',\n Max = 'max',\n}\n\n// Pi and the Final harness.\nexport enum PiPermissionMode {\n Auto = 'auto',\n Ask = 'ask',\n Readonly = 'readonly',\n}\n\n// Claude Code and the nanocode Claude engine.\nexport enum ClaudePermissionMode {\n Default = 'default',\n AcceptEdits = 'accept-edits',\n Plan = 'plan',\n Bypass = 'bypass',\n}\n\n// Codex and the nanocode Codex engine.\nexport enum CodexApprovalPolicy {\n Untrusted = 'untrusted',\n OnRequest = 'on-request',\n OnFailure = 'on-failure',\n Never = 'never',\n}\n\n// The Codex CLI's OS sandbox on a host you run.\nexport enum CodexSandboxMode {\n ReadOnly = 'read-only',\n WorkspaceWrite = 'workspace-write',\n DangerFullAccess = 'danger-full-access',\n}\n\nexport interface SecretRefIface {\n secretKey: string;\n}\n\nexport type InstructionInput = InstructionFragmentIface | DynamicSlotIface;\nexport type SkillInput = SkillBundleIface | DynamicSlotIface;\n\nexport const configObjectJson = (args: {\n title: string;\n properties: Record<string, JsonSchema>;\n required?: string[];\n}): JsonSchema => ({\n type: 'object',\n title: args.title,\n additionalProperties: false,\n properties: args.properties,\n required: args.required ?? [],\n});\n\nexport const modelJson = (ids: readonly string[], defaultId: string): JsonSchema => ({\n $ref: SCHEMA_IDS.modelPicker,\n enum: [...ids],\n default: defaultId,\n});\n\nexport const reasoningJson = (levels: readonly ReasoningLevel[]): JsonSchema => ({\n $ref: SCHEMA_IDS.reasoning,\n enum: [...levels],\n});\n\nexport const credentialsJson = (): JsonSchema => ({ $ref: SCHEMA_IDS.credentialPolicy });\n\nexport const permissionModeJson = (modes: readonly string[], defaultMode?: string): JsonSchema => {\n const schema: JsonSchema = { $ref: SCHEMA_IDS.permissionMode, enum: [...modes] };\n if (defaultMode != null) schema.default = defaultMode;\n return schema;\n};\n\nexport const instructionsJson = (): JsonSchema => ({ $ref: SCHEMA_IDS.instructions });\nexport const skillsJson = (): JsonSchema => ({ $ref: SCHEMA_IDS.skills });\nexport const secretRefJson = (): JsonSchema => ({ $ref: SCHEMA_IDS.secretRef });\n\nexport const urlJson = (title: string, schemes: readonly string[]): JsonSchema => ({\n type: 'string',\n title,\n format: 'uri',\n pattern: `^(${schemes.join('|')})://`,\n});\n\nexport const absolutePathJson = (title: string): JsonSchema => ({\n type: 'string',\n title,\n pattern: '^/',\n});\n\nexport const modelZod = (ids: readonly string[]) =>\n z\n .string()\n .refine((id) => ids.includes(id), { message: `model must be one of: ${ids.join(', ')}` });\n\nexport const reasoningZod = (levels: readonly ReasoningLevel[]) =>\n z.nativeEnum(ReasoningLevel).refine((level) => levels.includes(level), {\n message: `reasoning must be one of: ${levels.join(', ')}`,\n });\n\nexport const credentialsZod = () => credentialPolicySchema;\nexport const instructionsZod = () => z.array(instructionFragmentSchema).default([]);\nexport const skillsZod = () => z.array(skillBundleSchema).default([]);\nexport const secretRefZod = () => z.object({ secretKey: z.string().min(1) });\n\nexport const urlZod = (schemes: readonly string[]) =>\n z\n .string()\n .url()\n .refine((value) => schemes.some((scheme) => value.startsWith(`${scheme}://`)), {\n message: `url must use one of: ${schemes.join(', ')}`,\n });\n\nexport const absolutePathZod = () => z.string().startsWith('/');\n\n// Throws a readable error naming the harness; open() surfaces it as the\n// session's open failure.\nexport const parseHarnessConfig = <T extends z.ZodType>(args: {\n specifier: string;\n schema: T;\n config: JsonValue;\n}): z.output<T> => {\n const parsed = args.schema.safeParse(args.config);\n if (parsed.success) return parsed.data;\n const issues = parsed.error.issues\n .map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`)\n .join('; ');\n throw new Error(`invalid config for ${args.specifier}: ${issues}`);\n};\n\n// Authoring input and provider-private payloads are typed objects; a JSON\n// round trip drops undefined fields and the schema proves the result is JSON.\nexport const toJsonValue = <Value>(value: Value): JsonValue =>\n jsonValueSchema.parse(JSON.parse(JSON.stringify(value)));\n\nexport const toJsonObject = <Value>(value: Value): JsonObject =>\n jsonObjectSchema.parse(JSON.parse(JSON.stringify(value)));\n\nexport type CredentialsInput = CredentialPolicyIface;\n\n// What an authoring helper (`serverlessPi({...})`) returns: the manifest's\n// harness binding.\nexport interface HarnessBindingOutputIface {\n harness: PackageProviderRefIface;\n config: object;\n}\n\nexport const harnessBinding = <Config extends object>(\n specifier: string,\n config: Config,\n): HarnessBindingOutputIface => ({\n harness: packageRef(specifier),\n config: { ...config },\n});\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AACP,YAAY,OAAO;AAQZ,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,UAAO;AACP,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,SAAM;AACN,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,UAAO;AACP,EAAAA,gBAAA,SAAM;AANI,SAAAA;AAAA,GAAA;AAUL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,UAAO;AACP,EAAAA,kBAAA,SAAM;AACN,EAAAA,kBAAA,cAAW;AAHD,SAAAA;AAAA,GAAA;AAOL,IAAK,uBAAL,kBAAKC,0BAAL;AACL,EAAAA,sBAAA,aAAU;AACV,EAAAA,sBAAA,iBAAc;AACd,EAAAA,sBAAA,UAAO;AACP,EAAAA,sBAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AAQL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,WAAQ;AAJE,SAAAA;AAAA,GAAA;AAQL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,cAAW;AACX,EAAAA,kBAAA,oBAAiB;AACjB,EAAAA,kBAAA,sBAAmB;AAHT,SAAAA;AAAA,GAAA;AAaL,MAAM,mBAAmB,CAAC,UAId;AAAA,EACjB,MAAM;AAAA,EACN,OAAO,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ourcesContent": ["import { MODEL_REFERENCE_PATTERN } from \"./model-reference.mjs\";\nimport {\n credentialPolicySchema,\n instructionFragmentSchema,\n jsonObjectSchema,\n jsonValueSchema,\n packageRef,\n SCHEMA_IDS,\n skillBundleSchema,\n type CredentialPolicyIface,\n type DynamicSlotIface,\n type InstructionFragmentIface,\n type JsonObject,\n type JsonSchema,\n type JsonValue,\n type PackageProviderRefIface,\n type SkillBundleIface,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\n\nexport { MODEL_REFERENCE_PATTERN } from \"./model-reference.mjs\";\n\n// Config-schema building blocks shared by the harness modules. Each harness\n// writes its JSON Schema (what Build renders, $ref-ing the shared\n// final://schemas/* fragments) and a zod mirror (what open() validates the\n// resolved config with) from these, and a test keeps the two aligned.\n\n// Mirrors the final://schemas/reasoning fragment's enum.\nexport enum ReasoningLevel {\n None = 'none',\n Minimal = 'minimal',\n Low = 'low',\n Medium = 'medium',\n High = 'high',\n Max = 'max',\n}\n\n// Pi and the Final harness.\nexport enum PiPermissionMode {\n Auto = 'auto',\n Ask = 'ask',\n Readonly = 'readonly',\n}\n\n// Claude Code and the nanocode Claude engine.\nexport enum ClaudePermissionMode {\n Default = 'default',\n AcceptEdits = 'accept-edits',\n Plan = 'plan',\n Bypass = 'bypass',\n}\n\n// Codex and the nanocode Codex engine.\nexport enum CodexApprovalPolicy {\n Untrusted = 'untrusted',\n OnRequest = 'on-request',\n OnFailure = 'on-failure',\n Never = 'never',\n}\n\n// The Codex CLI's OS sandbox on a host you run.\nexport enum CodexSandboxMode {\n ReadOnly = 'read-only',\n WorkspaceWrite = 'workspace-write',\n DangerFullAccess = 'danger-full-access',\n}\n\nexport interface SecretRefIface {\n secretKey: string;\n}\n\nexport type InstructionInput = InstructionFragmentIface | DynamicSlotIface;\nexport type SkillInput = SkillBundleIface | DynamicSlotIface;\n\nexport const configObjectJson = (args: {\n title: string;\n properties: Record<string, JsonSchema>;\n required?: string[];\n}): JsonSchema => ({\n type: 'object',\n title: args.title,\n additionalProperties: false,\n properties: args.properties,\n required: args.required ?? [],\n});\n\n// Hosted harnesses leave choices and defaults to the platform; explicit lists stay restricted.\nexport const modelJson = (ids?: readonly string[], defaultId?: string): JsonSchema => ({\n $ref: SCHEMA_IDS.modelPicker,\n type: 'string',\n ...(ids == null\n ? { minLength: 1, maxLength: 200, pattern: MODEL_REFERENCE_PATTERN }\n : { enum: [...ids] }),\n ...(defaultId == null ? {} : { default: defaultId }),\n});\n\nexport const reasoningJson = (levels: readonly ReasoningLevel[]): JsonSchema => ({\n $ref: SCHEMA_IDS.reasoning,\n enum: [...levels],\n});\n\nexport const credentialsJson = (): JsonSchema => ({ $ref: SCHEMA_IDS.credentialPolicy });\n\nexport const permissionModeJson = (modes: readonly string[], defaultMode?: string): JsonSchema => {\n const schema: JsonSchema = { $ref: SCHEMA_IDS.permissionMode, enum: [...modes] };\n if (defaultMode != null) schema.default = defaultMode;\n return schema;\n};\n\nexport const instructionsJson = (): JsonSchema => ({ $ref: SCHEMA_IDS.instructions });\nexport const skillsJson = (): JsonSchema => ({ $ref: SCHEMA_IDS.skills });\nexport const secretRefJson = (): JsonSchema => ({ $ref: SCHEMA_IDS.secretRef });\n\nexport const urlJson = (title: string, schemes: readonly string[]): JsonSchema => ({\n type: 'string',\n title,\n format: 'uri',\n pattern: `^(${schemes.join('|')})://`,\n});\n\nexport const absolutePathJson = (title: string): JsonSchema => ({\n type: 'string',\n title,\n pattern: '^/',\n});\n\nexport const modelZod = (ids?: readonly string[]) => {\n if (ids != null)\n return z.string().refine((id) => ids.includes(id), {\n message: `model must be one of: ${ids.join(', ')}`,\n });\n const pattern = new RegExp(MODEL_REFERENCE_PATTERN);\n return z.string().min(1).max(200).regex(pattern, {\n message: 'model must be a printable ASCII reference without empty path segments',\n });\n};\n\nexport const reasoningZod = (levels: readonly ReasoningLevel[]) =>\n z.nativeEnum(ReasoningLevel).refine((level) => levels.includes(level), {\n message: `reasoning must be one of: ${levels.join(', ')}`,\n });\n\nexport const credentialsZod = () => credentialPolicySchema;\nexport const instructionsZod = () => z.array(instructionFragmentSchema).default([]);\nexport const skillsZod = () => z.array(skillBundleSchema).default([]);\nexport const secretRefZod = () => z.object({ secretKey: z.string().min(1) });\n\nexport const urlZod = (schemes: readonly string[]) =>\n z\n .string()\n .url()\n .refine((value) => schemes.some((scheme) => value.startsWith(`${scheme}://`)), {\n message: `url must use one of: ${schemes.join(', ')}`,\n });\n\nexport const absolutePathZod = () => z.string().startsWith('/');\n\n// Throws a readable error naming the harness; open() surfaces it as the\n// session's open failure.\nexport const parseHarnessConfig = <T extends z.ZodType>(args: {\n specifier: string;\n schema: T;\n config: JsonValue;\n}): z.output<T> => {\n const parsed = args.schema.safeParse(args.config);\n if (parsed.success) return parsed.data;\n const issues = parsed.error.issues\n .map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`)\n .join('; ');\n throw new Error(`invalid config for ${args.specifier}: ${issues}`);\n};\n\n// Authoring input and provider-private payloads are typed objects; a JSON\n// round trip drops undefined fields and the schema proves the result is JSON.\nexport const toJsonValue = <Value>(value: Value): JsonValue =>\n jsonValueSchema.parse(JSON.parse(JSON.stringify(value)));\n\nexport const toJsonObject = <Value>(value: Value): JsonObject =>\n jsonObjectSchema.parse(JSON.parse(JSON.stringify(value)));\n\nexport type CredentialsInput = CredentialPolicyIface;\n\n// What an authoring helper (`serverlessPi({...})`) returns: the manifest's\n// harness binding.\nexport interface HarnessBindingOutputIface {\n harness: PackageProviderRefIface;\n config: object;\n}\n\nexport const harnessBinding = <Config extends object>(\n specifier: string,\n config: Config,\n): HarnessBindingOutputIface => ({\n harness: packageRef(specifier),\n config: { ...config },\n});\n"],
5
+ "mappings": "AAAA,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AACP,YAAY,OAAO;AAEnB,SAAS,2BAAAA,gCAA+B;AAQjC,IAAK,iBAAL,kBAAKC,oB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,7 @@
1
1
  export type { RemoteHarnessFactoryConfigIface, RemoteHarnessIface, RemoteOpenArgsIface, RemoteProgramConfigIface, } from "../runtime/remote-host.mjs";
2
2
  export { ClaudePermissionMode, CodexApprovalPolicy, CodexSandboxMode, PiPermissionMode, ReasoningLevel, type HarnessBindingOutputIface, type SecretRefIface, } from "./config-fields.mjs";
3
3
  export { SPECIFIER as LOCAL_STDIO_SPECIFIER, localStdio, type LocalStdioConfigInputIface, } from "./local-stdio.mjs";
4
- export * from "./models.mjs";
4
+ export { ModelVendor } from "./model-reference.mjs";
5
5
  export { SPECIFIER as REMOTE_ACP_SPECIFIER, remoteAcp, type RemoteAcpConfigInputIface, } from "./remote-acp.mjs";
6
6
  export { SPECIFIER as REMOTE_CLAUDE_CODE_SPECIFIER, remoteClaudeCode, type RemoteClaudeCodeConfigInputIface, } from "./remote-claude-code.mjs";
7
7
  export type { RemoteClientTlsInputIface } from "./remote-client-tls.mjs";
@@ -9,7 +9,7 @@ import {
9
9
  SPECIFIER,
10
10
  localStdio
11
11
  } from "./local-stdio.mjs";
12
- export * from "./models.mjs";
12
+ import { ModelVendor } from "./model-reference.mjs";
13
13
  import {
14
14
  SPECIFIER as SPECIFIER2,
15
15
  remoteAcp
@@ -47,6 +47,7 @@ export {
47
47
  CodexApprovalPolicy,
48
48
  CodexSandboxMode,
49
49
  SPECIFIER as LOCAL_STDIO_SPECIFIER,
50
+ ModelVendor,
50
51
  PiPermissionMode,
51
52
  SPECIFIER2 as REMOTE_ACP_SPECIFIER,
52
53
  SPECIFIER3 as REMOTE_CLAUDE_CODE_SPECIFIER,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/harnesses/index.ts"],
4
- "sourcesContent": ["export type {\n RemoteHarnessFactoryConfigIface,\n RemoteHarnessIface,\n RemoteOpenArgsIface,\n RemoteProgramConfigIface,\n} from \"../runtime/remote-host.mjs\";\nexport {\n ClaudePermissionMode,\n CodexApprovalPolicy,\n CodexSandboxMode,\n PiPermissionMode,\n ReasoningLevel,\n type HarnessBindingOutputIface,\n type SecretRefIface,\n} from \"./config-fields.mjs\";\nexport {\n SPECIFIER as LOCAL_STDIO_SPECIFIER,\n localStdio,\n type LocalStdioConfigInputIface,\n} from \"./local-stdio.mjs\";\nexport * from \"./models.mjs\";\nexport {\n SPECIFIER as REMOTE_ACP_SPECIFIER,\n remoteAcp,\n type RemoteAcpConfigInputIface,\n} from \"./remote-acp.mjs\";\nexport {\n SPECIFIER as REMOTE_CLAUDE_CODE_SPECIFIER,\n remoteClaudeCode,\n type RemoteClaudeCodeConfigInputIface,\n} from \"./remote-claude-code.mjs\";\nexport type { RemoteClientTlsInputIface } from \"./remote-client-tls.mjs\";\nexport {\n SPECIFIER as REMOTE_CODEX_SPECIFIER,\n remoteCodex,\n type RemoteCodexConfigInputIface,\n} from \"./remote-codex.mjs\";\nexport {\n SPECIFIER as REMOTE_PI_SPECIFIER,\n remotePi,\n type RemotePiConfigInputIface,\n} from \"./remote-pi.mjs\";\nexport {\n SPECIFIER as SERVERLESS_FINAL_SPECIFIER,\n serverlessFinal,\n type ServerlessFinalConfigInputIface,\n} from \"./serverless-final.mjs\";\nexport {\n SPECIFIER as SERVERLESS_NANOCODE_CLAUDE_SPECIFIER,\n serverlessNanocodeClaude,\n type ServerlessNanocodeClaudeConfigInputIface,\n} from \"./serverless-nanocode-claude.mjs\";\nexport {\n SPECIFIER as SERVERLESS_NANOCODE_CODEX_SPECIFIER,\n serverlessNanocodeCodex,\n type ServerlessNanocodeCodexConfigInputIface,\n} from \"./serverless-nanocode-codex.mjs\";\nexport {\n SPECIFIER as SERVERLESS_PI_SPECIFIER,\n serverlessPi,\n type ServerlessPiConfigInputIface,\n} from \"./serverless-pi.mjs\";\n"],
5
- "mappings": "AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACe;AAAA,EACb;AAAA,OAEK;AACP,cAAc;AACd;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;",
4
+ "sourcesContent": ["export type {\n RemoteHarnessFactoryConfigIface,\n RemoteHarnessIface,\n RemoteOpenArgsIface,\n RemoteProgramConfigIface,\n} from \"../runtime/remote-host.mjs\";\nexport {\n ClaudePermissionMode,\n CodexApprovalPolicy,\n CodexSandboxMode,\n PiPermissionMode,\n ReasoningLevel,\n type HarnessBindingOutputIface,\n type SecretRefIface,\n} from \"./config-fields.mjs\";\nexport {\n SPECIFIER as LOCAL_STDIO_SPECIFIER,\n localStdio,\n type LocalStdioConfigInputIface,\n} from \"./local-stdio.mjs\";\nexport { ModelVendor } from \"./model-reference.mjs\";\nexport {\n SPECIFIER as REMOTE_ACP_SPECIFIER,\n remoteAcp,\n type RemoteAcpConfigInputIface,\n} from \"./remote-acp.mjs\";\nexport {\n SPECIFIER as REMOTE_CLAUDE_CODE_SPECIFIER,\n remoteClaudeCode,\n type RemoteClaudeCodeConfigInputIface,\n} from \"./remote-claude-code.mjs\";\nexport type { RemoteClientTlsInputIface } from \"./remote-client-tls.mjs\";\nexport {\n SPECIFIER as REMOTE_CODEX_SPECIFIER,\n remoteCodex,\n type RemoteCodexConfigInputIface,\n} from \"./remote-codex.mjs\";\nexport {\n SPECIFIER as REMOTE_PI_SPECIFIER,\n remotePi,\n type RemotePiConfigInputIface,\n} from \"./remote-pi.mjs\";\nexport {\n SPECIFIER as SERVERLESS_FINAL_SPECIFIER,\n serverlessFinal,\n type ServerlessFinalConfigInputIface,\n} from \"./serverless-final.mjs\";\nexport {\n SPECIFIER as SERVERLESS_NANOCODE_CLAUDE_SPECIFIER,\n serverlessNanocodeClaude,\n type ServerlessNanocodeClaudeConfigInputIface,\n} from \"./serverless-nanocode-claude.mjs\";\nexport {\n SPECIFIER as SERVERLESS_NANOCODE_CODEX_SPECIFIER,\n serverlessNanocodeCodex,\n type ServerlessNanocodeCodexConfigInputIface,\n} from \"./serverless-nanocode-codex.mjs\";\nexport {\n SPECIFIER as SERVERLESS_PI_SPECIFIER,\n serverlessPi,\n type ServerlessPiConfigInputIface,\n} from \"./serverless-pi.mjs\";\n"],
5
+ "mappings": "AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACe;AAAA,EACb;AAAA,OAEK;AACP,SAAS,mBAAmB;AAC5B;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACe,aAAbA;AAAA,EACA;AAAA,OAEK;",
6
6
  "names": ["SPECIFIER"]
7
7
  }
@@ -0,0 +1,6 @@
1
+ export declare enum ModelVendor {
2
+ OpenAI = "openai",
3
+ Anthropic = "anthropic",
4
+ OpenRouter = "openrouter"
5
+ }
6
+ export declare const MODEL_REFERENCE_PATTERN = "^[!-.0-~]+(?:/[!-.0-~]+)*$";
@@ -0,0 +1,12 @@
1
+ var ModelVendor = /* @__PURE__ */ ((ModelVendor2) => {
2
+ ModelVendor2["OpenAI"] = "openai";
3
+ ModelVendor2["Anthropic"] = "anthropic";
4
+ ModelVendor2["OpenRouter"] = "openrouter";
5
+ return ModelVendor2;
6
+ })(ModelVendor || {});
7
+ const MODEL_REFERENCE_PATTERN = "^[!-.0-~]+(?:/[!-.0-~]+)*$";
8
+ export {
9
+ MODEL_REFERENCE_PATTERN,
10
+ ModelVendor
11
+ };
12
+ //# sourceMappingURL=model-reference.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/harnesses/model-reference.ts"],
4
+ "sourcesContent": ["export enum ModelVendor {\n OpenAI = 'openai',\n Anthropic = 'anthropic',\n OpenRouter = 'openrouter',\n}\n\n// Printable ASCII excluding slash; identical character ranges in JavaScript and RE2.\nexport const MODEL_REFERENCE_PATTERN = '^[!-.0-~]+(?:/[!-.0-~]+)*$';\n"],
5
+ "mappings": "AAAO,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,aAAA,YAAS;AACT,EAAAA,aAAA,eAAY;AACZ,EAAAA,aAAA,gBAAa;AAHH,SAAAA;AAAA,GAAA;AAOL,MAAM,0BAA0B;",
6
+ "names": ["ModelVendor"]
7
+ }
@@ -23,7 +23,7 @@ import {
23
23
  secretRefJson,
24
24
  secretRefZod
25
25
  } from "./config-fields.mjs";
26
- import { CLAUDE_MODELS, vendorsOf } from "./models.mjs";
26
+ import { ModelVendor } from "./model-reference.mjs";
27
27
  import {
28
28
  remoteClientTlsJson,
29
29
  remoteClientTlsSchema
@@ -81,7 +81,7 @@ const REMOTE_CLAUDE_CODE_DESCRIPTION = {
81
81
  // Other bound targets reach it as the sandbox MCP projection.
82
82
  consumes: [SandboxWire.Mcp],
83
83
  inference: {
84
- vendors: vendorsOf(CLAUDE_MODELS),
84
+ vendors: [ModelVendor.Anthropic],
85
85
  kinds: [
86
86
  InferenceCredentialKind.HarnessOwned,
87
87
  InferenceCredentialKind.Subscription,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/harnesses/remote-claude-code.ts"],
4
- "sourcesContent": ["import {\n AcpTransport,\n BaseCapability,\n BaseToolProvision,\n CredentialDelivery,\n InferenceCredentialKind,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport {\n absolutePathJson,\n absolutePathZod,\n ClaudePermissionMode,\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n permissionModeJson,\n secretRefJson,\n secretRefZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type InstructionInput,\n type SecretRefIface,\n} from \"./config-fields.mjs\";\nimport { CLAUDE_MODELS, vendorsOf } from \"./models.mjs\";\nimport {\n remoteClientTlsJson,\n remoteClientTlsSchema,\n type RemoteClientTlsInputIface,\n} from \"./remote-client-tls.mjs\";\nimport { remoteUrlJson, remoteUrlZod } from \"./remote-url.mjs\";\n\n// Claude Code (Agent SDK) behind the Final ACP adapter, served by\n// `final-harness serve --program claude-code` on a host you run.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/remote-claude-code';\n\nexport const remoteClaudeCodeConfigSchema = z.strictObject({\n url: remoteUrlZod(),\n tls: remoteClientTlsSchema.optional(),\n hop: secretRefZod(),\n cwd: absolutePathZod().optional(),\n executable: z.string().min(1).optional(),\n model: z.string().min(1).optional(),\n credentials: credentialsZod(),\n permissionMode: z.nativeEnum(ClaudePermissionMode).optional(),\n instructions: instructionsZod(),\n allowedTools: z.array(z.string().min(1)).optional(),\n});\n\nexport type RemoteClaudeCodeConfigIface = z.output<typeof remoteClaudeCodeConfigSchema>;\n\nexport const REMOTE_CLAUDE_CODE_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n title: 'Claude Code (your host)',\n required: ['credentials', 'url', 'hop'],\n properties: {\n url: remoteUrlJson('Runtime URL'),\n tls: remoteClientTlsJson(),\n hop: secretRefJson(),\n cwd: absolutePathJson('Working directory on your host'),\n executable: { type: 'string', title: 'Installed executable on your host' },\n model: { $ref: 'final://schemas/model-picker' },\n credentials: {\n ...credentialsJson(),\n default: { payer: 'agent-owner', tryInOrder: [{ kind: 'harness-owned' }] },\n },\n permissionMode: permissionModeJson(Object.values(ClaudePermissionMode)),\n instructions: instructionsJson(),\n allowedTools: { type: 'array', title: 'Allowed tools', items: { type: 'string' } },\n },\n});\n\nexport const REMOTE_CLAUDE_CODE_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: REMOTE_CLAUDE_CODE_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Ws, AcpTransport.Http],\n mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio],\n },\n // Claude Code's own tools on your host, switched through its allow-lists.\n baseTools: {\n [BaseCapability.Shell]: {\n provision: BaseToolProvision.HostDisableable,\n nativeTools: ['Bash', 'BashOutput', 'KillShell'],\n },\n [BaseCapability.Files]: {\n provision: BaseToolProvision.HostDisableable,\n nativeTools: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'NotebookEdit'],\n },\n },\n // Other bound targets reach it as the sandbox MCP projection.\n consumes: [SandboxWire.Mcp],\n inference: {\n vendors: vendorsOf(CLAUDE_MODELS),\n kinds: [\n InferenceCredentialKind.HarnessOwned,\n InferenceCredentialKind.Subscription,\n InferenceCredentialKind.ApiKey,\n InferenceCredentialKind.Platform,\n ],\n delivery: CredentialDelivery.AtOpen,\n },\n supports: {\n observe: true,\n resumeReplay: true,\n fork: true,\n authorMeta: true,\n nativeToolPolicy: false,\n },\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: true,\n};\n\nexport interface RemoteClaudeCodeConfigInputIface {\n url: string;\n tls?: RemoteClientTlsInputIface;\n hop: SecretRefIface;\n cwd?: string;\n executable?: string;\n model?: string;\n credentials: CredentialsInput;\n permissionMode?: ClaudePermissionMode | `${ClaudePermissionMode}`;\n instructions?: InstructionInput[];\n allowedTools?: string[];\n}\n\nexport const remoteClaudeCode = (\n config: RemoteClaudeCodeConfigInputIface,\n): HarnessBindingOutputIface => harnessBinding(SPECIFIER, config);\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,YAAY,OAAO;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP,SAAS,eAAe,iBAAiB;AACzC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,eAAe,oBAAoB;AAKrC,MAAM,YAAY;AAElB,MAAM,+BAA+B,EAAE,aAAa;AAAA,EACzD,KAAK,aAAa;AAAA,EAClB,KAAK,sBAAsB,SAAS;AAAA,EACpC,KAAK,aAAa;AAAA,EAClB,KAAK,gBAAgB,EAAE,SAAS;AAAA,EAChC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACvC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAClC,aAAa,eAAe;AAAA,EAC5B,gBAAgB,EAAE,WAAW,oBAAoB,EAAE,SAAS;AAAA,EAC5D,cAAc,gBAAgB;AAAA,EAC9B,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS;AACpD,CAAC;AAIM,MAAM,wCAAoD,iBAAiB;AAAA,EAChF,OAAO;AAAA,EACP,UAAU,CAAC,eAAe,OAAO,KAAK;AAAA,EACtC,YAAY;AAAA,IACV,KAAK,cAAc,aAAa;AAAA,IAChC,KAAK,oBAAoB;AAAA,IACzB,KAAK,cAAc;AAAA,IACnB,KAAK,iBAAiB,gCAAgC;AAAA,IACtD,YAAY,EAAE,MAAM,UAAU,OAAO,oCAAoC;AAAA,IACzE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;AAC7B;AAeO,MAAM,mBAAmB,CAC9B,WAC8B,eAAe,WAAW,MAAM;",
4
+ "sourcesContent": ["import {\n AcpTransport,\n BaseCapability,\n BaseToolProvision,\n CredentialDelivery,\n InferenceCredentialKind,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport {\n absolutePathJson,\n absolutePathZod,\n ClaudePermissionMode,\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n permissionModeJson,\n secretRefJson,\n secretRefZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type InstructionInput,\n type SecretRefIface,\n} from \"./config-fields.mjs\";\nimport { ModelVendor } from \"./model-reference.mjs\";\nimport {\n remoteClientTlsJson,\n remoteClientTlsSchema,\n type RemoteClientTlsInputIface,\n} from \"./remote-client-tls.mjs\";\nimport { remoteUrlJson, remoteUrlZod } from \"./remote-url.mjs\";\n\n// Claude Code (Agent SDK) behind the Final ACP adapter, served by\n// `final-harness serve --program claude-code` on a host you run.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/remote-claude-code';\n\nexport const remoteClaudeCodeConfigSchema = z.strictObject({\n url: remoteUrlZod(),\n tls: remoteClientTlsSchema.optional(),\n hop: secretRefZod(),\n cwd: absolutePathZod().optional(),\n executable: z.string().min(1).optional(),\n model: z.string().min(1).optional(),\n credentials: credentialsZod(),\n permissionMode: z.nativeEnum(ClaudePermissionMode).optional(),\n instructions: instructionsZod(),\n allowedTools: z.array(z.string().min(1)).optional(),\n});\n\nexport type RemoteClaudeCodeConfigIface = z.output<typeof remoteClaudeCodeConfigSchema>;\n\nexport const REMOTE_CLAUDE_CODE_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n title: 'Claude Code (your host)',\n required: ['credentials', 'url', 'hop'],\n properties: {\n url: remoteUrlJson('Runtime URL'),\n tls: remoteClientTlsJson(),\n hop: secretRefJson(),\n cwd: absolutePathJson('Working directory on your host'),\n executable: { type: 'string', title: 'Installed executable on your host' },\n model: { $ref: 'final://schemas/model-picker' },\n credentials: {\n ...credentialsJson(),\n default: { payer: 'agent-owner', tryInOrder: [{ kind: 'harness-owned' }] },\n },\n permissionMode: permissionModeJson(Object.values(ClaudePermissionMode)),\n instructions: instructionsJson(),\n allowedTools: { type: 'array', title: 'Allowed tools', items: { type: 'string' } },\n },\n});\n\nexport const REMOTE_CLAUDE_CODE_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: REMOTE_CLAUDE_CODE_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Ws, AcpTransport.Http],\n mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio],\n },\n // Claude Code's own tools on your host, switched through its allow-lists.\n baseTools: {\n [BaseCapability.Shell]: {\n provision: BaseToolProvision.HostDisableable,\n nativeTools: ['Bash', 'BashOutput', 'KillShell'],\n },\n [BaseCapability.Files]: {\n provision: BaseToolProvision.HostDisableable,\n nativeTools: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'NotebookEdit'],\n },\n },\n // Other bound targets reach it as the sandbox MCP projection.\n consumes: [SandboxWire.Mcp],\n inference: {\n vendors: [ModelVendor.Anthropic],\n kinds: [\n InferenceCredentialKind.HarnessOwned,\n InferenceCredentialKind.Subscription,\n InferenceCredentialKind.ApiKey,\n InferenceCredentialKind.Platform,\n ],\n delivery: CredentialDelivery.AtOpen,\n },\n supports: {\n observe: true,\n resumeReplay: true,\n fork: true,\n authorMeta: true,\n nativeToolPolicy: false,\n },\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: true,\n};\n\nexport interface RemoteClaudeCodeConfigInputIface {\n url: string;\n tls?: RemoteClientTlsInputIface;\n hop: SecretRefIface;\n cwd?: string;\n executable?: string;\n model?: string;\n credentials: CredentialsInput;\n permissionMode?: ClaudePermissionMode | `${ClaudePermissionMode}`;\n instructions?: InstructionInput[];\n allowedTools?: string[];\n}\n\nexport const remoteClaudeCode = (\n config: RemoteClaudeCodeConfigInputIface,\n): HarnessBindingOutputIface => harnessBinding(SPECIFIER, config);\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,YAAY,OAAO;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,eAAe,oBAAoB;AAKrC,MAAM,YAAY;AAElB,MAAM,+BAA+B,EAAE,aAAa;AAAA,EACzD,KAAK,aAAa;AAAA,EAClB,KAAK,sBAAsB,SAAS;AAAA,EACpC,KAAK,aAAa;AAAA,EAClB,KAAK,gBAAgB,EAAE,SAAS;AAAA,EAChC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACvC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAClC,aAAa,eAAe;AAAA,EAC5B,gBAAgB,EAAE,WAAW,oBAAoB,EAAE,SAAS;AAAA,EAC5D,cAAc,gBAAgB;AAAA,EAC9B,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS;AACpD,CAAC;AAIM,MAAM,wCAAoD,iBAAiB;AAAA,EAChF,OAAO;AAAA,EACP,UAAU,CAAC,eAAe,OAAO,KAAK;AAAA,EACtC,YAAY;AAAA,IACV,KAAK,cAAc,aAAa;AAAA,IAChC,KAAK,oBAAoB;AAAA,IACzB,KAAK,cAAc;AAAA,IACnB,KAAK,iBAAiB,gCAAgC;AAAA,IACtD,YAAY,EAAE,MAAM,UAA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BAAoB,mBAAmB;AAAA,EACvC,2BAA2B;AAC7B;AAeO,MAAM,mBAAmB,CAC9B,WAC8B,eAAe,WAAW,MAAM;",
6
6
  "names": []
7
7
  }
@@ -28,7 +28,7 @@ import {
28
28
  skillsJson,
29
29
  skillsZod
30
30
  } from "./config-fields.mjs";
31
- import { CODEX_CLI_MODELS, vendorsOf } from "./models.mjs";
31
+ import { ModelVendor } from "./model-reference.mjs";
32
32
  import {
33
33
  remoteClientTlsJson,
34
34
  remoteClientTlsSchema
@@ -96,7 +96,7 @@ const REMOTE_CODEX_DESCRIPTION = {
96
96
  },
97
97
  consumes: [SandboxWire.Mcp],
98
98
  inference: {
99
- vendors: vendorsOf(CODEX_CLI_MODELS),
99
+ vendors: [ModelVendor.OpenAI],
100
100
  kinds: [
101
101
  InferenceCredentialKind.HarnessOwned,
102
102
  InferenceCredentialKind.Subscription,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/harnesses/remote-codex.ts"],
4
- "sourcesContent": ["import {\n AcpTransport,\n BaseCapability,\n BaseToolProvision,\n CredentialDelivery,\n InferenceCredentialKind,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport {\n absolutePathJson,\n absolutePathZod,\n CodexApprovalPolicy,\n CodexSandboxMode,\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n permissionModeJson,\n reasoningJson,\n reasoningZod,\n secretRefJson,\n secretRefZod,\n skillsJson,\n skillsZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type InstructionInput,\n type SecretRefIface,\n type SkillInput,\n} from \"./config-fields.mjs\";\nimport { CODEX_CLI_MODELS, vendorsOf } from \"./models.mjs\";\nimport {\n remoteClientTlsJson,\n remoteClientTlsSchema,\n type RemoteClientTlsInputIface,\n} from \"./remote-client-tls.mjs\";\nimport { remoteUrlJson, remoteUrlZod } from \"./remote-url.mjs\";\nimport { CODEX_REASONING_LEVELS } from \"./serverless-nanocode-codex.mjs\";\n\n// The Codex app-server behind the Final ACP translator, served by\n// `final-harness serve --program codex` on a host you run.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/remote-codex';\n\nexport const approvalPolicySchema = z.nativeEnum(CodexApprovalPolicy).exclude(['OnFailure']);\n\nexport type RemoteCodexApprovalPolicy = z.output<typeof approvalPolicySchema>;\n\nexport const remoteCodexConfigSchema = z.strictObject({\n url: remoteUrlZod(),\n tls: remoteClientTlsSchema.optional(),\n hop: secretRefZod(),\n cwd: absolutePathZod().optional(),\n executable: z.string().min(1).optional(),\n model: z.string().min(1).optional(),\n reasoning: reasoningZod(CODEX_REASONING_LEVELS).optional(),\n credentials: credentialsZod(),\n approvalPolicy: approvalPolicySchema.optional(),\n sandboxMode: z.nativeEnum(CodexSandboxMode).optional(),\n instructions: instructionsZod(),\n skills: skillsZod(),\n});\n\nexport type RemoteCodexConfigIface = z.output<typeof remoteCodexConfigSchema>;\n\nexport const REMOTE_CODEX_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n title: 'Codex (your host)',\n required: ['credentials', 'url', 'hop'],\n properties: {\n url: remoteUrlJson('Runtime URL'),\n tls: remoteClientTlsJson(),\n hop: secretRefJson(),\n cwd: absolutePathJson('Working directory on your host'),\n executable: { type: 'string', title: 'Installed executable on your host' },\n model: { $ref: 'final://schemas/model-picker' },\n reasoning: reasoningJson(CODEX_REASONING_LEVELS),\n credentials: {\n ...credentialsJson(),\n default: { payer: 'agent-owner', tryInOrder: [{ kind: 'harness-owned' }] },\n },\n approvalPolicy: permissionModeJson(Object.values(approvalPolicySchema.enum)),\n sandboxMode: {\n type: 'string',\n title: 'Sandbox mode',\n enum: Object.values(CodexSandboxMode),\n },\n instructions: instructionsJson(),\n skills: skillsJson(),\n },\n});\n\nexport const REMOTE_CODEX_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: REMOTE_CODEX_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Ws, AcpTransport.Http],\n // ACP servers are bridged by the runtime and reach Codex as dynamic tools.\n mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio],\n },\n // Codex's own tools on your host, under sandboxMode.\n baseTools: {\n [BaseCapability.Shell]: {\n provision: BaseToolProvision.HostDisableable,\n nativeTools: ['exec_command', 'write_stdin'],\n },\n [BaseCapability.Files]: {\n provision: BaseToolProvision.HostDisableable,\n nativeTools: ['apply_patch'],\n },\n },\n consumes: [SandboxWire.Mcp],\n inference: {\n vendors: vendorsOf(CODEX_CLI_MODELS),\n kinds: [\n InferenceCredentialKind.HarnessOwned,\n InferenceCredentialKind.Subscription,\n InferenceCredentialKind.ApiKey,\n InferenceCredentialKind.Platform,\n ],\n delivery: CredentialDelivery.AtOpen,\n },\n // No observe: group routing falls back to prompts with replyExpected: false.\n supports: {\n observe: false,\n resumeReplay: true,\n fork: false,\n authorMeta: true,\n nativeToolPolicy: false,\n },\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: true,\n};\n\nexport interface RemoteCodexConfigInputIface {\n url: string;\n tls?: RemoteClientTlsInputIface;\n hop: SecretRefIface;\n cwd?: string;\n executable?: string;\n model?: string;\n reasoning?:\n | (typeof CODEX_REASONING_LEVELS)[number]\n | `${(typeof CODEX_REASONING_LEVELS)[number]}`;\n credentials: CredentialsInput;\n approvalPolicy?: RemoteCodexApprovalPolicy | `${RemoteCodexApprovalPolicy}`;\n sandboxMode?: CodexSandboxMode | `${CodexSandboxMode}`;\n instructions?: InstructionInput[];\n skills?: SkillInput[];\n}\n\nexport const remoteCodex = (config: RemoteCodexConfigInputIface): HarnessBindingOutputIface =>\n harnessBinding(SPECIFIER, config);\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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,oBAAoB,mBAAmB;AAAA,EACvC,2BAA2B;AAC7B;AAmBO,MAAM,cAAc,CAAC,WAC1B,eAAe,WAAW,MAAM;",
4
+ "sourcesContent": ["import {\n AcpTransport,\n BaseCapability,\n BaseToolProvision,\n CredentialDelivery,\n InferenceCredentialKind,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport {\n absolutePathJson,\n absolutePathZod,\n CodexApprovalPolicy,\n CodexSandboxMode,\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n permissionModeJson,\n reasoningJson,\n reasoningZod,\n secretRefJson,\n secretRefZod,\n skillsJson,\n skillsZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type InstructionInput,\n type SecretRefIface,\n type SkillInput,\n} from \"./config-fields.mjs\";\nimport { ModelVendor } from \"./model-reference.mjs\";\nimport {\n remoteClientTlsJson,\n remoteClientTlsSchema,\n type RemoteClientTlsInputIface,\n} from \"./remote-client-tls.mjs\";\nimport { remoteUrlJson, remoteUrlZod } from \"./remote-url.mjs\";\nimport { CODEX_REASONING_LEVELS } from \"./serverless-nanocode-codex.mjs\";\n\n// The Codex app-server behind the Final ACP translator, served by\n// `final-harness serve --program codex` on a host you run.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/remote-codex';\n\nexport const approvalPolicySchema = z.nativeEnum(CodexApprovalPolicy).exclude(['OnFailure']);\n\nexport type RemoteCodexApprovalPolicy = z.output<typeof approvalPolicySchema>;\n\nexport const remoteCodexConfigSchema = z.strictObject({\n url: remoteUrlZod(),\n tls: remoteClientTlsSchema.optional(),\n hop: secretRefZod(),\n cwd: absolutePathZod().optional(),\n executable: z.string().min(1).optional(),\n model: z.string().min(1).optional(),\n reasoning: reasoningZod(CODEX_REASONING_LEVELS).optional(),\n credentials: credentialsZod(),\n approvalPolicy: approvalPolicySchema.optional(),\n sandboxMode: z.nativeEnum(CodexSandboxMode).optional(),\n instructions: instructionsZod(),\n skills: skillsZod(),\n});\n\nexport type RemoteCodexConfigIface = z.output<typeof remoteCodexConfigSchema>;\n\nexport const REMOTE_CODEX_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n title: 'Codex (your host)',\n required: ['credentials', 'url', 'hop'],\n properties: {\n url: remoteUrlJson('Runtime URL'),\n tls: remoteClientTlsJson(),\n hop: secretRefJson(),\n cwd: absolutePathJson('Working directory on your host'),\n executable: { type: 'string', title: 'Installed executable on your host' },\n model: { $ref: 'final://schemas/model-picker' },\n reasoning: reasoningJson(CODEX_REASONING_LEVELS),\n credentials: {\n ...credentialsJson(),\n default: { payer: 'agent-owner', tryInOrder: [{ kind: 'harness-owned' }] },\n },\n approvalPolicy: permissionModeJson(Object.values(approvalPolicySchema.enum)),\n sandboxMode: {\n type: 'string',\n title: 'Sandbox mode',\n enum: Object.values(CodexSandboxMode),\n },\n instructions: instructionsJson(),\n skills: skillsJson(),\n },\n});\n\nexport const REMOTE_CODEX_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: REMOTE_CODEX_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Ws, AcpTransport.Http],\n // ACP servers are bridged by the runtime and reach Codex as dynamic tools.\n mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio],\n },\n // Codex's own tools on your host, under sandboxMode.\n baseTools: {\n [BaseCapability.Shell]: {\n provision: BaseToolProvision.HostDisableable,\n nativeTools: ['exec_command', 'write_stdin'],\n },\n [BaseCapability.Files]: {\n provision: BaseToolProvision.HostDisableable,\n nativeTools: ['apply_patch'],\n },\n },\n consumes: [SandboxWire.Mcp],\n inference: {\n vendors: [ModelVendor.OpenAI],\n kinds: [\n InferenceCredentialKind.HarnessOwned,\n InferenceCredentialKind.Subscription,\n InferenceCredentialKind.ApiKey,\n InferenceCredentialKind.Platform,\n ],\n delivery: CredentialDelivery.AtOpen,\n },\n // No observe: group routing falls back to prompts with replyExpected: false.\n supports: {\n observe: false,\n resumeReplay: true,\n fork: false,\n authorMeta: true,\n nativeToolPolicy: false,\n },\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: true,\n};\n\nexport interface RemoteCodexConfigInputIface {\n url: string;\n tls?: RemoteClientTlsInputIface;\n hop: SecretRefIface;\n cwd?: string;\n executable?: string;\n model?: string;\n reasoning?:\n | (typeof CODEX_REASONING_LEVELS)[number]\n | `${(typeof CODEX_REASONING_LEVELS)[number]}`;\n credentials: CredentialsInput;\n approvalPolicy?: RemoteCodexApprovalPolicy | `${RemoteCodexApprovalPolicy}`;\n sandboxMode?: CodexSandboxMode | `${CodexSandboxMode}`;\n instructions?: InstructionInput[];\n skills?: SkillInput[];\n}\n\nexport const remoteCodex = (config: RemoteCodexConfigInputIface): HarnessBindingOutputIface =>\n harnessBinding(SPECIFIER, config);\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,YAAY,OAAO;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,eAAe,oBAAoB;AAC5C,SAAS,8BAA8B;AAKhC,MAAM,YAAY;AAElB,MAAM,uBAAuB,EAAE,WAAW,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAAC;AAIpF,MAAM,0BAA0B,EAAE,aAAa;AAAA,EACpD,KAAK,aAAa;AAAA,EAClB,KAAK,sBAAsB,SAAS;AAAA,EACpC,KAAK,aAAa;AAAA,EA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B,KAAK,iBAAiB,MAAM,iBAAiB,KAAK;AAAA,EAC3E;AAAA;AAAA,EAEA,WAAW;AAAA,IACT,CAAC,eAAe,KAAK,GAAG;AAAA,MACtB,WAAW,kBAAkB;AAAA,MAC7B,aAAa,CAAC,gBAAgB,aAAa;AAAA,IAC7C;AAAA,IACA,CAAC,eAAe,KAAK,GAAG;AAAA,MACtB,WAAW,kBAAkB;AAAA,MAC7B,aAAa,CAAC,aAAa;AAAA,IAC7B;AAAA,EACF;AAAA,EACA,UAAU,CAAC,YAAY,GAAG;AAAA,EAC1B,WAAW;AAAA,IACT,SAAS,CAAC,YAAY,MAAM;AAAA,IAC5B,OAAO;AAAA,MACL,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,IAC1B;AAAA,IACA,UAAU,mBAAmB;AAAA,EAC/B;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,SAAS;AAAA,IACT,cAAc;AAAA,IACd,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,kBAAkB;AAAA,EACpB;AAAA,EACA,oBAAoB,mBAAmB;AAAA,EACvC,2BAA2B;AAC7B;AAmBO,MAAM,cAAc,CAAC,WAC1B,eAAe,WAAW,MAAM;",
6
6
  "names": []
7
7
  }
@@ -24,7 +24,7 @@ import {
24
24
  secretRefJson,
25
25
  secretRefZod
26
26
  } from "./config-fields.mjs";
27
- import { PI_MODELS, vendorsOf } from "./models.mjs";
27
+ import { ModelVendor } from "./model-reference.mjs";
28
28
  import {
29
29
  remoteClientTlsJson,
30
30
  remoteClientTlsSchema
@@ -80,7 +80,7 @@ const REMOTE_PI_DESCRIPTION = {
80
80
  consumes: [SandboxWire.Mcp],
81
81
  // Explicit Final credentials are delivered at open; omission keeps the user login.
82
82
  inference: {
83
- vendors: vendorsOf(PI_MODELS),
83
+ vendors: [ModelVendor.OpenRouter, ModelVendor.OpenAI, ModelVendor.Anthropic],
84
84
  kinds: [
85
85
  InferenceCredentialKind.HarnessOwned,
86
86
  InferenceCredentialKind.ApiKey,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/harnesses/remote-pi.ts"],
4
- "sourcesContent": ["import {\n AcpTransport,\n BaseToolProvision,\n CredentialDelivery,\n InferenceCredentialKind,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport {\n absolutePathJson,\n absolutePathZod,\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n permissionModeJson,\n PiPermissionMode,\n reasoningJson,\n reasoningZod,\n secretRefJson,\n secretRefZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type InstructionInput,\n type SecretRefIface,\n} from \"./config-fields.mjs\";\nimport { PI_MODELS, vendorsOf } from \"./models.mjs\";\nimport {\n remoteClientTlsJson,\n remoteClientTlsSchema,\n type RemoteClientTlsInputIface,\n} from \"./remote-client-tls.mjs\";\nimport { remoteUrlJson, remoteUrlZod } from \"./remote-url.mjs\";\nimport { PI_BASE_TOOLS, PI_REASONING_LEVELS } from \"./serverless-pi.mjs\";\n\n// The installed Pi CLI, driven over its public JSONL RPC by final-harness.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/remote-pi';\n\nexport const remotePiConfigSchema = z.strictObject({\n url: remoteUrlZod(),\n tls: remoteClientTlsSchema.optional(),\n hop: secretRefZod(),\n cwd: absolutePathZod().optional(),\n executable: z.string().min(1).optional(),\n model: z.string().min(1).optional(),\n reasoning: reasoningZod(PI_REASONING_LEVELS).optional(),\n credentials: credentialsZod(),\n permissionMode: z.nativeEnum(PiPermissionMode).optional(),\n instructions: instructionsZod(),\n});\n\nexport type RemotePiConfigIface = z.output<typeof remotePiConfigSchema>;\n\nexport const REMOTE_PI_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n title: 'Pi (your host)',\n required: ['credentials', 'url', 'hop'],\n properties: {\n url: remoteUrlJson('Runtime URL'),\n tls: remoteClientTlsJson(),\n hop: secretRefJson(),\n cwd: absolutePathJson('Working directory on your host'),\n executable: { type: 'string', title: 'Installed executable on your host' },\n model: { $ref: 'final://schemas/model-picker' },\n reasoning: reasoningJson(PI_REASONING_LEVELS),\n credentials: {\n ...credentialsJson(),\n default: { payer: 'agent-owner', tryInOrder: [{ kind: 'harness-owned' }] },\n },\n permissionMode: permissionModeJson(Object.values(PiPermissionMode)),\n instructions: instructionsJson(),\n },\n});\n\nexport const REMOTE_PI_BASE_TOOLS: HarnessDescriptionIface['baseTools'] = Object.fromEntries(\n Object.entries(PI_BASE_TOOLS).map(([capability, declaration]) => [\n capability,\n { ...declaration, provision: BaseToolProvision.HostDisableable },\n ]),\n);\n\nexport const REMOTE_PI_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: REMOTE_PI_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Ws, AcpTransport.Http],\n mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio],\n },\n // Pi's own tools stay on your host; bound targets are additive MCP servers.\n baseTools: REMOTE_PI_BASE_TOOLS,\n consumes: [SandboxWire.Mcp],\n // Explicit Final credentials are delivered at open; omission keeps the user login.\n inference: {\n vendors: vendorsOf(PI_MODELS),\n kinds: [\n InferenceCredentialKind.HarnessOwned,\n InferenceCredentialKind.ApiKey,\n InferenceCredentialKind.Platform,\n ],\n delivery: CredentialDelivery.AtOpen,\n },\n supports: { observe: true, resumeReplay: true, fork: false, authorMeta: true },\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: true,\n};\n\nexport interface RemotePiConfigInputIface {\n url: string;\n tls?: RemoteClientTlsInputIface;\n hop: SecretRefIface;\n cwd?: string;\n executable?: string;\n model?: string;\n reasoning?: (typeof PI_REASONING_LEVELS)[number] | `${(typeof PI_REASONING_LEVELS)[number]}`;\n credentials: CredentialsInput;\n permissionMode?: PiPermissionMode | `${PiPermissionMode}`;\n instructions?: InstructionInput[];\n}\n\nexport const remotePi = (config: RemotePiConfigInputIface): HarnessBindingOutputIface =>\n harnessBinding(SPECIFIER, config);\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,YAAY,OAAO;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP,SAAS,WAAW,iBAAiB;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,eAAe,oBAAoB;AAC5C,SAAS,eAAe,2BAA2B;AAI5C,MAAM,YAAY;AAElB,MAAM,uBAAuB,EAAE,aAAa;AAAA,EACjD,KAAK,aAAa;AAAA,EAClB,KAAK,sBAAsB,SAAS;AAAA,EACpC,KAAK,aAAa;AAAA,EAClB,KAAK,gBAAgB,EAAE,SAAS;AAAA,EAChC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACvC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAClC,WAAW,aAAa,mBAAmB,EAAE,SAAS;AAAA,EACtD,aAAa,eAAe;AAAA,EAC5B,gBAAgB,EAAE,WAAW,gBAAgB,EAAE,SAAS;AAAA,EACxD,cAAc,gBAAgB;AAChC,CAAC;AAIM,MAAM,+BAA2C,iBAAiB;AAAA,EACvE,OAAO;AAAA,EACP,UAAU,CAAC,eAAe,OAAO,KAAK;AAAA,EACtC,YAAY;AAAA,IACV,KAAK,cAAc,aAAa;AAAA,IAChC,KAAK,oBAAoB;AAAA,IACzB,KAAK,cAAc;AAAA,IACnB,KAAK,iBAAiB,gCAAgC;AAAA,IACtD,YAA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n PromptWhileRunning,\n SandboxWire,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport {\n absolutePathJson,\n absolutePathZod,\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n permissionModeJson,\n PiPermissionMode,\n reasoningJson,\n reasoningZod,\n secretRefJson,\n secretRefZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type InstructionInput,\n type SecretRefIface,\n} from \"./config-fields.mjs\";\nimport { ModelVendor } from \"./model-reference.mjs\";\nimport {\n remoteClientTlsJson,\n remoteClientTlsSchema,\n type RemoteClientTlsInputIface,\n} from \"./remote-client-tls.mjs\";\nimport { remoteUrlJson, remoteUrlZod } from \"./remote-url.mjs\";\nimport { PI_BASE_TOOLS, PI_REASONING_LEVELS } from \"./serverless-pi.mjs\";\n\n// The installed Pi CLI, driven over its public JSONL RPC by final-harness.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/remote-pi';\n\nexport const remotePiConfigSchema = z.strictObject({\n url: remoteUrlZod(),\n tls: remoteClientTlsSchema.optional(),\n hop: secretRefZod(),\n cwd: absolutePathZod().optional(),\n executable: z.string().min(1).optional(),\n model: z.string().min(1).optional(),\n reasoning: reasoningZod(PI_REASONING_LEVELS).optional(),\n credentials: credentialsZod(),\n permissionMode: z.nativeEnum(PiPermissionMode).optional(),\n instructions: instructionsZod(),\n});\n\nexport type RemotePiConfigIface = z.output<typeof remotePiConfigSchema>;\n\nexport const REMOTE_PI_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n title: 'Pi (your host)',\n required: ['credentials', 'url', 'hop'],\n properties: {\n url: remoteUrlJson('Runtime URL'),\n tls: remoteClientTlsJson(),\n hop: secretRefJson(),\n cwd: absolutePathJson('Working directory on your host'),\n executable: { type: 'string', title: 'Installed executable on your host' },\n model: { $ref: 'final://schemas/model-picker' },\n reasoning: reasoningJson(PI_REASONING_LEVELS),\n credentials: {\n ...credentialsJson(),\n default: { payer: 'agent-owner', tryInOrder: [{ kind: 'harness-owned' }] },\n },\n permissionMode: permissionModeJson(Object.values(PiPermissionMode)),\n instructions: instructionsJson(),\n },\n});\n\nexport const REMOTE_PI_BASE_TOOLS: HarnessDescriptionIface['baseTools'] = Object.fromEntries(\n Object.entries(PI_BASE_TOOLS).map(([capability, declaration]) => [\n capability,\n { ...declaration, provision: BaseToolProvision.HostDisableable },\n ]),\n);\n\nexport const REMOTE_PI_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: REMOTE_PI_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Ws, AcpTransport.Http],\n mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio],\n },\n // Pi's own tools stay on your host; bound targets are additive MCP servers.\n baseTools: REMOTE_PI_BASE_TOOLS,\n consumes: [SandboxWire.Mcp],\n // Explicit Final credentials are delivered at open; omission keeps the user login.\n inference: {\n vendors: [ModelVendor.OpenRouter, ModelVendor.OpenAI, ModelVendor.Anthropic],\n kinds: [\n InferenceCredentialKind.HarnessOwned,\n InferenceCredentialKind.ApiKey,\n InferenceCredentialKind.Platform,\n ],\n delivery: CredentialDelivery.AtOpen,\n },\n supports: { observe: true, resumeReplay: true, fork: false, authorMeta: true },\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: true,\n};\n\nexport interface RemotePiConfigInputIface {\n url: string;\n tls?: RemoteClientTlsInputIface;\n hop: SecretRefIface;\n cwd?: string;\n executable?: string;\n model?: string;\n reasoning?: (typeof PI_REASONING_LEVELS)[number] | `${(typeof PI_REASONING_LEVELS)[number]}`;\n credentials: CredentialsInput;\n permissionMode?: PiPermissionMode | `${PiPermissionMode}`;\n instructions?: InstructionInput[];\n}\n\nexport const remotePi = (config: RemotePiConfigInputIface): HarnessBindingOutputIface =>\n harnessBinding(SPECIFIER, config);\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA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YAAY,CAAC,EAAE,MAAM,gBAAgB,CAAC,EAAE;AAAA,IAC3E;AAAA,IACA,gBAAgB,mBAAmB,OAAO,OAAO,gBAAgB,CAAC;AAAA,IAClE,cAAc,iBAAiB;AAAA,EACjC;AACF,CAAC;AAEM,MAAM,uBAA6D,OAAO;AAAA,EAC/E,OAAO,QAAQ,aAAa,EAAE,IAAI,CAAC,CAAC,YAAY,WAAW,MAAM;AAAA,IAC/D;AAAA,IACA,EAAE,GAAG,aAAa,WAAW,kBAAkB,gBAAgB;AAAA,EACjE,CAAC;AACH;AAEO,MAAM,wBAAiD;AAAA,EAC5D,cAAc;AAAA,EACd,KAAK;AAAA,IACH,YAAY,CAAC,aAAa,IAAI,aAAa,IAAI;AAAA,IAC/C,KAAK,CAAC,iBAAiB,KAAK,iBAAiB,MAAM,iBAAiB,KAAK;AAAA,EAC3E;AAAA;AAAA,EAEA,WAAW;AAAA,EACX,UAAU,CAAC,YAAY,GAAG;AAAA;AAAA,EAE1B,WAAW;AAAA,IACT,SAAS,CAAC,YAAY,YAAY,YAAY,QAAQ,YAAY,SAAS;AAAA,IAC3E,OAAO;AAAA,MACL,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,IAC1B;AAAA,IACA,UAAU,mBAAmB;AAAA,EAC/B;AAAA,EACA,UAAU,EAAE,SAAS,MAAM,cAAc,MAAM,MAAM,OAAO,YAAY,KAAK;AAAA,EAC7E,oBAAoB,mBAAmB;AAAA,EACvC,2BAA2B;AAC7B;AAeO,MAAM,WAAW,CAAC,WACvB,eAAe,WAAW,MAAM;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,10 @@
1
1
  import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
2
2
  import * as z from 'zod';
3
3
  import { PiPermissionMode, ReasoningLevel, type CredentialsInput, type HarnessBindingOutputIface, type InstructionInput, type SkillInput } from "./config-fields.mjs";
4
- import { type FinalHarnessModelId } from "./models.mjs";
5
4
  export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-final";
6
5
  export declare const FINAL_REASONING_LEVELS: readonly [ReasoningLevel.Low, ReasoningLevel.Medium, ReasoningLevel.High];
7
6
  export declare const serverlessFinalConfigSchema: z.ZodObject<{
8
- model: z.ZodDefault<z.ZodString>;
7
+ model: z.ZodOptional<z.ZodString>;
9
8
  reasoning: z.ZodOptional<z.ZodEnum<typeof ReasoningLevel>>;
10
9
  credentials: z.ZodObject<{
11
10
  payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
@@ -54,7 +53,7 @@ export type ServerlessFinalConfigIface = z.output<typeof serverlessFinalConfigSc
54
53
  export declare const SERVERLESS_FINAL_CONFIG_JSON_SCHEMA: JsonSchema;
55
54
  export declare const SERVERLESS_FINAL_DESCRIPTION: HarnessDescriptionIface;
56
55
  export interface ServerlessFinalConfigInputIface {
57
- model?: FinalHarnessModelId;
56
+ model?: string;
58
57
  reasoning?: (typeof FINAL_REASONING_LEVELS)[number] | `${(typeof FINAL_REASONING_LEVELS)[number]}`;
59
58
  credentials: CredentialsInput;
60
59
  permissionMode?: PiPermissionMode | `${PiPermissionMode}`;
@@ -25,12 +25,7 @@ import {
25
25
  skillsJson,
26
26
  skillsZod
27
27
  } from "./config-fields.mjs";
28
- import {
29
- DEFAULT_FINAL_HARNESS_MODEL,
30
- FINAL_HARNESS_MODELS,
31
- modelIds,
32
- vendorsOf
33
- } from "./models.mjs";
28
+ import { ModelVendor } from "./model-reference.mjs";
34
29
  import { PI_BASE_TOOLS } from "./serverless-pi.mjs";
35
30
  const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-final";
36
31
  const FINAL_REASONING_LEVELS = [
@@ -39,7 +34,7 @@ const FINAL_REASONING_LEVELS = [
39
34
  ReasoningLevel.High
40
35
  ];
41
36
  const serverlessFinalConfigSchema = z.strictObject({
42
- model: modelZod(modelIds(FINAL_HARNESS_MODELS)).default(DEFAULT_FINAL_HARNESS_MODEL),
37
+ model: modelZod().optional(),
43
38
  reasoning: reasoningZod(FINAL_REASONING_LEVELS).optional(),
44
39
  credentials: credentialsZod(),
45
40
  permissionMode: z.nativeEnum(PiPermissionMode).default(PiPermissionMode.Ask),
@@ -50,7 +45,7 @@ const SERVERLESS_FINAL_CONFIG_JSON_SCHEMA = configObjectJson({
50
45
  required: ["credentials"],
51
46
  title: "Final harness (serverless)",
52
47
  properties: {
53
- model: modelJson(modelIds(FINAL_HARNESS_MODELS), DEFAULT_FINAL_HARNESS_MODEL),
48
+ model: modelJson(),
54
49
  reasoning: reasoningJson(FINAL_REASONING_LEVELS),
55
50
  credentials: credentialsJson(),
56
51
  permissionMode: permissionModeJson(Object.values(PiPermissionMode), PiPermissionMode.Ask),
@@ -69,7 +64,7 @@ const SERVERLESS_FINAL_DESCRIPTION = {
69
64
  // The Final catalog through the LLM proxy (platform), or an organization's own
70
65
  // OpenRouter-compatible key and base URL, as serverless-pi takes it.
71
66
  inference: {
72
- vendors: vendorsOf(FINAL_HARNESS_MODELS),
67
+ vendors: [ModelVendor.OpenRouter],
73
68
  kinds: [InferenceCredentialKind.ApiKey, InferenceCredentialKind.Platform],
74
69
  delivery: CredentialDelivery.PerRequest
75
70
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/harnesses/serverless-final.ts"],
4
- "sourcesContent": ["import {\n AcpTransport,\n CredentialDelivery,\n HarnessTrustClass,\n InferenceCredentialKind,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport {\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n modelJson,\n modelZod,\n permissionModeJson,\n PiPermissionMode,\n reasoningJson,\n ReasoningLevel,\n reasoningZod,\n skillsJson,\n skillsZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type InstructionInput,\n type SkillInput,\n} from \"./config-fields.mjs\";\nimport {\n DEFAULT_FINAL_HARNESS_MODEL,\n FINAL_HARNESS_MODELS,\n modelIds,\n vendorsOf,\n type FinalHarnessModelId,\n} from \"./models.mjs\";\nimport { PI_BASE_TOOLS } from \"./serverless-pi.mjs\";\n\n// The Final harness (Final's own Pi-derived loop, the one Home runs on) in the\n// same Durable Object runtime as serverless-pi; it differs only in program and\n// catalog.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/serverless-final';\n\nexport const FINAL_REASONING_LEVELS = [\n ReasoningLevel.Low,\n ReasoningLevel.Medium,\n ReasoningLevel.High,\n] as const;\n\nexport const serverlessFinalConfigSchema = z.strictObject({\n model: modelZod(modelIds(FINAL_HARNESS_MODELS)).default(DEFAULT_FINAL_HARNESS_MODEL),\n reasoning: reasoningZod(FINAL_REASONING_LEVELS).optional(),\n credentials: credentialsZod(),\n permissionMode: z.nativeEnum(PiPermissionMode).default(PiPermissionMode.Ask),\n instructions: instructionsZod(),\n skills: skillsZod(),\n});\n\nexport type ServerlessFinalConfigIface = z.output<typeof serverlessFinalConfigSchema>;\n\nexport const SERVERLESS_FINAL_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n required: ['credentials'],\n title: 'Final harness (serverless)',\n properties: {\n model: modelJson(modelIds(FINAL_HARNESS_MODELS), DEFAULT_FINAL_HARNESS_MODEL),\n reasoning: reasoningJson(FINAL_REASONING_LEVELS),\n credentials: credentialsJson(),\n permissionMode: permissionModeJson(Object.values(PiPermissionMode), PiPermissionMode.Ask),\n instructions: instructionsJson(),\n skills: skillsJson(),\n },\n});\n\nexport const SERVERLESS_FINAL_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: SERVERLESS_FINAL_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Relay, AcpTransport.Ws],\n mcp: [McpTransportKind.Acp, McpTransportKind.Http],\n },\n baseTools: PI_BASE_TOOLS,\n consumes: [SandboxWire.HandleRpc],\n // The Final catalog through the LLM proxy (platform), or an organization's own\n // OpenRouter-compatible key and base URL, as serverless-pi takes it.\n inference: {\n vendors: vendorsOf(FINAL_HARNESS_MODELS),\n kinds: [InferenceCredentialKind.ApiKey, InferenceCredentialKind.Platform],\n delivery: CredentialDelivery.PerRequest,\n },\n // Final runs these on its own Workers.\n trust: HarnessTrustClass.FirstParty,\n supports: { observe: true, resumeReplay: true, fork: false, authorMeta: true },\n // Same engine as serverless-pi (pi/engine.test.ts \"injects a prompt accepted while\n // running into the running work\"); open asks are not re-raised across invocations.\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: false,\n};\n\nexport interface ServerlessFinalConfigInputIface {\n model?: FinalHarnessModelId;\n reasoning?:\n | (typeof FINAL_REASONING_LEVELS)[number]\n | `${(typeof FINAL_REASONING_LEVELS)[number]}`;\n credentials: CredentialsInput;\n permissionMode?: PiPermissionMode | `${PiPermissionMode}`;\n instructions?: InstructionInput[];\n skills?: SkillInput[];\n}\n\nexport const serverlessFinal = (\n config: ServerlessFinalConfigInputIface,\n): HarnessBindingOutputIface => harnessBinding(SPECIFIER, config);\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,YAAY,OAAO;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,qBAAqB;AAMvB,MAAM,YAAY;AAElB,MAAM,yBAAyB;AAAA,EACpC,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AACjB;AAEO,MAAM,8BAA8B,EAAE,aAAa;AAAA,EACxD,OAAO,SAAS,SAAS,oBAA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entialDelivery,\n HarnessTrustClass,\n InferenceCredentialKind,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport {\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n modelJson,\n modelZod,\n permissionModeJson,\n PiPermissionMode,\n reasoningJson,\n ReasoningLevel,\n reasoningZod,\n skillsJson,\n skillsZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type InstructionInput,\n type SkillInput,\n} from \"./config-fields.mjs\";\nimport { ModelVendor } from \"./model-reference.mjs\";\nimport { PI_BASE_TOOLS } from \"./serverless-pi.mjs\";\n\n// The Final harness (Final's own Pi-derived loop, the one Home runs on) in the\n// same Durable Object runtime as serverless-pi; it differs only in program and\n// catalog.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/serverless-final';\n\nexport const FINAL_REASONING_LEVELS = [\n ReasoningLevel.Low,\n ReasoningLevel.Medium,\n ReasoningLevel.High,\n] as const;\n\nexport const serverlessFinalConfigSchema = z.strictObject({\n model: modelZod().optional(),\n reasoning: reasoningZod(FINAL_REASONING_LEVELS).optional(),\n credentials: credentialsZod(),\n permissionMode: z.nativeEnum(PiPermissionMode).default(PiPermissionMode.Ask),\n instructions: instructionsZod(),\n skills: skillsZod(),\n});\n\nexport type ServerlessFinalConfigIface = z.output<typeof serverlessFinalConfigSchema>;\n\nexport const SERVERLESS_FINAL_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n required: ['credentials'],\n title: 'Final harness (serverless)',\n properties: {\n model: modelJson(),\n reasoning: reasoningJson(FINAL_REASONING_LEVELS),\n credentials: credentialsJson(),\n permissionMode: permissionModeJson(Object.values(PiPermissionMode), PiPermissionMode.Ask),\n instructions: instructionsJson(),\n skills: skillsJson(),\n },\n});\n\nexport const SERVERLESS_FINAL_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: SERVERLESS_FINAL_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Relay, AcpTransport.Ws],\n mcp: [McpTransportKind.Acp, McpTransportKind.Http],\n },\n baseTools: PI_BASE_TOOLS,\n consumes: [SandboxWire.HandleRpc],\n // The Final catalog through the LLM proxy (platform), or an organization's own\n // OpenRouter-compatible key and base URL, as serverless-pi takes it.\n inference: {\n vendors: [ModelVendor.OpenRouter],\n kinds: [InferenceCredentialKind.ApiKey, InferenceCredentialKind.Platform],\n delivery: CredentialDelivery.PerRequest,\n },\n // Final runs these on its own Workers.\n trust: HarnessTrustClass.FirstParty,\n supports: { observe: true, resumeReplay: true, fork: false, authorMeta: true },\n // Same engine as serverless-pi (pi/engine.test.ts \"injects a prompt accepted while\n // running into the running work\"); open asks are not re-raised across invocations.\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: false,\n};\n\nexport interface ServerlessFinalConfigInputIface {\n model?: string;\n reasoning?:\n | (typeof FINAL_REASONING_LEVELS)[number]\n | `${(typeof FINAL_REASONING_LEVELS)[number]}`;\n credentials: CredentialsInput;\n permissionMode?: PiPermissionMode | `${PiPermissionMode}`;\n instructions?: InstructionInput[];\n skills?: SkillInput[];\n}\n\nexport const serverlessFinal = (\n config: ServerlessFinalConfigInputIface,\n): HarnessBindingOutputIface => harnessBinding(SPECIFIER, config);\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,YAAY,OAAO;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAMvB,MAAM,YAAY;AAElB,MAAM,yBAAy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B,CAC7B,WAC8B,eAAe,WAAW,MAAM;",
6
6
  "names": []
7
7
  }
@@ -1,12 +1,11 @@
1
1
  import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
2
2
  import * as z from 'zod';
3
3
  import { ClaudePermissionMode, ReasoningLevel, type CredentialsInput, type HarnessBindingOutputIface, type InstructionInput, type SkillInput } from "./config-fields.mjs";
4
- import { type ClaudeModelId } from "./models.mjs";
5
4
  export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-nanocode-claude";
6
5
  export declare const CLAUDE_REASONING_LEVELS: readonly [ReasoningLevel.Low, ReasoningLevel.Medium, ReasoningLevel.High, ReasoningLevel.Max];
7
6
  export declare const NANOCODE_CLAUDE_BASE_TOOLS: HarnessDescriptionIface['baseTools'];
8
7
  export declare const serverlessNanocodeClaudeConfigSchema: z.ZodObject<{
9
- model: z.ZodDefault<z.ZodString>;
8
+ model: z.ZodOptional<z.ZodString>;
10
9
  reasoning: z.ZodOptional<z.ZodEnum<typeof ReasoningLevel>>;
11
10
  credentials: z.ZodObject<{
12
11
  payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
@@ -55,7 +54,7 @@ export type ServerlessNanocodeClaudeConfigIface = z.output<typeof serverlessNano
55
54
  export declare const SERVERLESS_NANOCODE_CLAUDE_CONFIG_JSON_SCHEMA: JsonSchema;
56
55
  export declare const SERVERLESS_NANOCODE_CLAUDE_DESCRIPTION: HarnessDescriptionIface;
57
56
  export interface ServerlessNanocodeClaudeConfigInputIface {
58
- model?: ClaudeModelId;
57
+ model?: string;
59
58
  reasoning?: (typeof CLAUDE_REASONING_LEVELS)[number] | `${(typeof CLAUDE_REASONING_LEVELS)[number]}`;
60
59
  credentials: CredentialsInput;
61
60
  permissionMode?: ClaudePermissionMode | `${ClaudePermissionMode}`;