@finalai/final-agent-provider 0.10.1 → 0.12.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 +125 -46
- package/WORKSPACE-EGRESS.md +11 -11
- package/dist/modules/catalog.d.mts +9 -0
- package/dist/modules/catalog.mjs +21 -0
- package/dist/modules/catalog.mjs.map +7 -0
- package/dist/modules/harnesses/acp-agent.d.mts +4 -0
- package/dist/modules/harnesses/acp-agent.mjs +35 -0
- package/dist/modules/harnesses/acp-agent.mjs.map +7 -0
- package/dist/modules/harnesses/adapters.d.mts +7 -0
- package/dist/modules/harnesses/adapters.mjs +74 -0
- package/dist/modules/harnesses/adapters.mjs.map +7 -0
- package/dist/modules/harnesses/claude-code.d.mts +14 -0
- package/dist/modules/harnesses/claude-code.mjs +79 -0
- package/dist/modules/harnesses/claude-code.mjs.map +7 -0
- package/dist/modules/harnesses/codex.d.mts +12 -0
- package/dist/modules/harnesses/codex.mjs +90 -0
- package/dist/modules/harnesses/codex.mjs.map +7 -0
- package/dist/modules/harnesses/config-fields.d.mts +98 -57
- package/dist/modules/harnesses/config-fields.mjs +58 -35
- package/dist/modules/harnesses/config-fields.mjs.map +3 -3
- package/dist/modules/harnesses/definitions.d.mts +3 -0
- package/dist/modules/harnesses/definitions.mjs +21 -0
- package/dist/modules/harnesses/definitions.mjs.map +7 -0
- package/dist/modules/harnesses/fidelity.d.mts +1 -1
- package/dist/modules/harnesses/fidelity.mjs +17 -14
- package/dist/modules/harnesses/fidelity.mjs.map +2 -2
- package/dist/modules/harnesses/final.d.mts +12 -0
- package/dist/modules/harnesses/final.mjs +70 -0
- package/dist/modules/harnesses/final.mjs.map +7 -0
- package/dist/modules/harnesses/index.d.mts +13 -12
- package/dist/modules/harnesses/index.mjs +86 -45
- package/dist/modules/harnesses/index.mjs.map +3 -3
- package/dist/modules/harnesses/names.d.mts +43 -0
- package/dist/modules/harnesses/names.mjs +59 -0
- package/dist/modules/harnesses/names.mjs.map +7 -0
- package/dist/modules/harnesses/nanocode-claude.d.mts +18 -0
- package/dist/modules/harnesses/nanocode-claude.mjs +101 -0
- package/dist/modules/harnesses/nanocode-claude.mjs.map +7 -0
- package/dist/modules/harnesses/nanocode-codex.d.mts +13 -0
- package/dist/modules/harnesses/nanocode-codex.mjs +64 -0
- package/dist/modules/harnesses/nanocode-codex.mjs.map +7 -0
- package/dist/modules/harnesses/pi.d.mts +12 -0
- package/dist/modules/harnesses/pi.mjs +71 -0
- package/dist/modules/harnesses/pi.mjs.map +7 -0
- package/dist/modules/integrations.d.mts +9 -0
- package/dist/modules/integrations.mjs +29 -0
- package/dist/modules/integrations.mjs.map +7 -0
- package/dist/modules/provider/general.bundle.d.mts +1 -0
- package/dist/modules/provider/general.bundle.mjs +5 -0
- package/dist/modules/provider/general.bundle.mjs.map +7 -0
- package/dist/modules/provider/general.d.mts +11 -0
- package/dist/modules/provider/general.mjs +130 -0
- package/dist/modules/provider/general.mjs.map +7 -0
- package/dist/modules/provider/index.d.mts +3 -0
- package/dist/modules/provider/index.mjs +13 -0
- package/dist/modules/provider/index.mjs.map +7 -0
- package/dist/modules/sandboxes/access.d.mts +34 -0
- package/dist/modules/sandboxes/access.mjs +15 -0
- package/dist/modules/sandboxes/access.mjs.map +7 -0
- package/dist/modules/sandboxes/computer.d.mts +24 -51
- package/dist/modules/sandboxes/computer.mjs +523 -888
- package/dist/modules/sandboxes/computer.mjs.map +3 -3
- package/dist/modules/sandboxes/computers-api.d.mts +3 -2
- package/dist/modules/sandboxes/computers-api.mjs +2 -4
- package/dist/modules/sandboxes/computers-api.mjs.map +2 -2
- package/dist/modules/sandboxes/device-api.d.mts +4 -3
- package/dist/modules/sandboxes/device-api.mjs +2 -4
- package/dist/modules/sandboxes/device-api.mjs.map +2 -2
- package/dist/modules/sandboxes/device.d.mts +6 -6
- package/dist/modules/sandboxes/device.mjs +126 -121
- package/dist/modules/sandboxes/device.mjs.map +3 -3
- package/dist/modules/sandboxes/egress.d.mts +10 -9
- package/dist/modules/sandboxes/egress.mjs +73 -56
- package/dist/modules/sandboxes/egress.mjs.map +2 -2
- package/dist/modules/sandboxes/environment.d.mts +35 -269
- package/dist/modules/sandboxes/environment.mjs +27 -104
- package/dist/modules/sandboxes/environment.mjs.map +3 -3
- package/dist/modules/sandboxes/index.d.mts +9 -69
- package/dist/modules/sandboxes/index.mjs +35 -95
- package/dist/modules/sandboxes/index.mjs.map +3 -3
- package/dist/modules/sandboxes/local.d.mts +29 -0
- package/dist/modules/sandboxes/local.mjs +555 -0
- package/dist/modules/sandboxes/local.mjs.map +7 -0
- package/dist/modules/sandboxes/session.d.mts +0 -3
- package/dist/modules/sandboxes/session.mjs +2 -22
- package/dist/modules/sandboxes/session.mjs.map +2 -2
- package/dist/modules/sandboxes/testing/fake-machine.mjs +0 -28
- package/dist/modules/sandboxes/testing/fake-machine.mjs.map +2 -2
- package/package.json +73 -137
- package/dist/modules/authoring-final-channel.d.mts +0 -3
- package/dist/modules/authoring-final-channel.mjs +0 -10
- package/dist/modules/authoring-final-channel.mjs.map +0 -7
- package/dist/modules/channel-factories.d.mts +0 -40
- package/dist/modules/channel-factories.mjs +0 -212
- package/dist/modules/channel-factories.mjs.map +0 -7
- package/dist/modules/channels/content.d.mts +0 -6
- package/dist/modules/channels/content.mjs +0 -31
- package/dist/modules/channels/content.mjs.map +0 -7
- package/dist/modules/channels/delivery.d.mts +0 -54
- package/dist/modules/channels/delivery.mjs +0 -243
- package/dist/modules/channels/delivery.mjs.map +0 -7
- package/dist/modules/channels/direct-messaging.d.mts +0 -5
- package/dist/modules/channels/direct-messaging.mjs +0 -8
- package/dist/modules/channels/direct-messaging.mjs.map +0 -7
- package/dist/modules/channels/fake-platform.d.mts +0 -36
- package/dist/modules/channels/fake-platform.mjs +0 -168
- package/dist/modules/channels/fake-platform.mjs.map +0 -7
- package/dist/modules/channels/group-messaging.d.mts +0 -5
- package/dist/modules/channels/group-messaging.mjs +0 -8
- package/dist/modules/channels/group-messaging.mjs.map +0 -7
- package/dist/modules/channels/inbound.d.mts +0 -52
- package/dist/modules/channels/inbound.mjs +0 -42
- package/dist/modules/channels/inbound.mjs.map +0 -7
- package/dist/modules/channels/index.d.mts +0 -9
- package/dist/modules/channels/index.mjs +0 -10
- package/dist/modules/channels/index.mjs.map +0 -7
- package/dist/modules/channels/messaging-channel.d.mts +0 -7
- package/dist/modules/channels/messaging-channel.mjs +0 -99
- package/dist/modules/channels/messaging-channel.mjs.map +0 -7
- package/dist/modules/channels/projection.d.mts +0 -36
- package/dist/modules/channels/projection.mjs +0 -233
- package/dist/modules/channels/projection.mjs.map +0 -7
- package/dist/modules/channels/prompt.d.mts +0 -72
- package/dist/modules/channels/prompt.mjs +0 -208
- package/dist/modules/channels/prompt.mjs.map +0 -7
- package/dist/modules/channels/routing.d.mts +0 -5
- package/dist/modules/channels/routing.mjs +0 -53
- package/dist/modules/channels/routing.mjs.map +0 -7
- package/dist/modules/connections.d.mts +0 -11
- package/dist/modules/connections.mjs +0 -16
- package/dist/modules/connections.mjs.map +0 -7
- package/dist/modules/harnesses/acp-describe.d.mts +0 -20
- package/dist/modules/harnesses/acp-describe.mjs +0 -110
- package/dist/modules/harnesses/acp-describe.mjs.map +0 -7
- package/dist/modules/harnesses/local-stdio.d.mts +0 -47
- package/dist/modules/harnesses/local-stdio.mjs +0 -41
- package/dist/modules/harnesses/local-stdio.mjs.map +0 -7
- package/dist/modules/harnesses/remote-acp.d.mts +0 -76
- package/dist/modules/harnesses/remote-acp.mjs +0 -83
- package/dist/modules/harnesses/remote-acp.mjs.map +0 -7
- package/dist/modules/harnesses/remote-claude-code.d.mts +0 -88
- package/dist/modules/harnesses/remote-claude-code.mjs +0 -113
- package/dist/modules/harnesses/remote-claude-code.mjs.map +0 -7
- package/dist/modules/harnesses/remote-client-tls.d.mts +0 -35
- package/dist/modules/harnesses/remote-client-tls.mjs +0 -37
- package/dist/modules/harnesses/remote-client-tls.mjs.map +0 -7
- package/dist/modules/harnesses/remote-codex.d.mts +0 -98
- package/dist/modules/harnesses/remote-codex.mjs +0 -128
- package/dist/modules/harnesses/remote-codex.mjs.map +0 -7
- package/dist/modules/harnesses/remote-pi.d.mts +0 -78
- package/dist/modules/harnesses/remote-pi.mjs +0 -104
- package/dist/modules/harnesses/remote-pi.mjs.map +0 -7
- package/dist/modules/harnesses/remote-url.d.mts +0 -5
- package/dist/modules/harnesses/remote-url.mjs +0 -19
- package/dist/modules/harnesses/remote-url.mjs.map +0 -7
- package/dist/modules/harnesses/serverless-final.d.mts +0 -63
- package/dist/modules/harnesses/serverless-final.mjs +0 -88
- package/dist/modules/harnesses/serverless-final.mjs.map +0 -7
- package/dist/modules/harnesses/serverless-nanocode-claude.d.mts +0 -64
- package/dist/modules/harnesses/serverless-nanocode-claude.mjs +0 -105
- package/dist/modules/harnesses/serverless-nanocode-claude.mjs.map +0 -7
- package/dist/modules/harnesses/serverless-nanocode-codex.d.mts +0 -66
- package/dist/modules/harnesses/serverless-nanocode-codex.mjs +0 -113
- package/dist/modules/harnesses/serverless-nanocode-codex.mjs.map +0 -7
- package/dist/modules/harnesses/serverless-pi.d.mts +0 -64
- package/dist/modules/harnesses/serverless-pi.mjs +0 -98
- package/dist/modules/harnesses/serverless-pi.mjs.map +0 -7
- package/dist/modules/runtime/index.d.mts +0 -7
- package/dist/modules/runtime/index.mjs +0 -18
- package/dist/modules/runtime/index.mjs.map +0 -7
- package/dist/modules/runtime/local-stdio.d.mts +0 -10
- package/dist/modules/runtime/local-stdio.mjs +0 -106
- package/dist/modules/runtime/local-stdio.mjs.map +0 -7
- package/dist/modules/runtime/remote-acp.d.mts +0 -16
- package/dist/modules/runtime/remote-acp.mjs +0 -152
- package/dist/modules/runtime/remote-acp.mjs.map +0 -7
- package/dist/modules/runtime/remote-claude-code.d.mts +0 -5
- package/dist/modules/runtime/remote-claude-code.mjs +0 -47
- package/dist/modules/runtime/remote-claude-code.mjs.map +0 -7
- package/dist/modules/runtime/remote-codex.d.mts +0 -5
- package/dist/modules/runtime/remote-codex.mjs +0 -47
- package/dist/modules/runtime/remote-codex.mjs.map +0 -7
- package/dist/modules/runtime/remote-host.d.mts +0 -127
- package/dist/modules/runtime/remote-host.mjs +0 -387
- package/dist/modules/runtime/remote-host.mjs.map +0 -7
- package/dist/modules/runtime/remote-pi.d.mts +0 -5
- package/dist/modules/runtime/remote-pi.mjs +0 -44
- package/dist/modules/runtime/remote-pi.mjs.map +0 -7
- package/dist/modules/sandboxes/guide.d.mts +0 -35
- package/dist/modules/sandboxes/guide.mjs +0 -119
- package/dist/modules/sandboxes/guide.mjs.map +0 -7
- package/dist/modules/sandboxes/workspace-setup.d.mts +0 -42
- package/dist/modules/sandboxes/workspace-setup.mjs +0 -242
- package/dist/modules/sandboxes/workspace-setup.mjs.map +0 -7
- package/dist/modules/testing/harness.d.mts +0 -9
- package/dist/modules/testing/harness.mjs +0 -123
- package/dist/modules/testing/harness.mjs.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 { 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;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,mBAAmB;AAC5B;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,YAAY,EAAE,MAAM,UAAU,OAAO,oCAAoC;AAAA,IACzE,OAAO,EAAE,MAAM,+BAA+B;AAAA,IAC9C,WAAW,cAAc,mBAAmB;AAAA,IAC5C,aAAa;AAAA,MACX,GAAG,gBAAgB;AAAA,MACnB,SAAS,EAAE,OAAO,eAAe,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
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { urlJson, urlZod } from "./config-fields.mjs";
|
|
2
|
-
const REMOTE_URL_SCHEMES = ["ws", "wss", "http", "https"];
|
|
3
|
-
const remoteUrlZod = () => urlZod(REMOTE_URL_SCHEMES).refine(
|
|
4
|
-
(value) => {
|
|
5
|
-
const url = new URL(value);
|
|
6
|
-
return ["https:", "wss:"].includes(url.protocol) || ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
|
|
7
|
-
},
|
|
8
|
-
{ message: "Remote harness URLs require TLS except on loopback" }
|
|
9
|
-
);
|
|
10
|
-
const remoteUrlJson = (title) => ({
|
|
11
|
-
...urlJson(title, REMOTE_URL_SCHEMES),
|
|
12
|
-
pattern: "^((wss|https)://|(ws|http)://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:|/|$))"
|
|
13
|
-
});
|
|
14
|
-
export {
|
|
15
|
-
REMOTE_URL_SCHEMES,
|
|
16
|
-
remoteUrlJson,
|
|
17
|
-
remoteUrlZod
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=remote-url.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/harnesses/remote-url.ts"],
|
|
4
|
-
"sourcesContent": ["import { urlJson, urlZod } from \"./config-fields.mjs\";\n\n// Shared by remote-claude-code, remote-codex and remote-pi: the Final harness\n// runtime (`final-harness serve --program <...>`) on\n// a host you run, dialed over WebSocket or Streamable HTTP with a hop secret.\n//\n// The program's configuration (instructions, skills, model, base-tool bindings,\n// targets, credentials) is provider-private: open() and resume()\n// register it with the runtime themselves (`PUT /v1/program-configs/<id>`) and\n// return an endpoint whose headers name the registration. The session service\n// dials that endpoint and speaks plain ACP, exactly as for any other harness.\n\nexport const REMOTE_URL_SCHEMES = ['ws', 'wss', 'http', 'https'] as const;\n\nexport const remoteUrlZod = () =>\n urlZod(REMOTE_URL_SCHEMES).refine(\n (value) => {\n const url = new URL(value);\n return (\n ['https:', 'wss:'].includes(url.protocol) ||\n ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname)\n );\n },\n { message: 'Remote harness URLs require TLS except on loopback' },\n );\n\nexport const remoteUrlJson = (title: string) => ({\n ...urlJson(title, REMOTE_URL_SCHEMES),\n pattern: '^((wss|https)://|(ws|http)://(localhost|127\\\\.0\\\\.0\\\\.1|\\\\[::1\\\\])(:|/|$))',\n});\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS,cAAc;AAYzB,MAAM,qBAAqB,CAAC,MAAM,OAAO,QAAQ,OAAO;AAExD,MAAM,eAAe,MAC1B,OAAO,kBAAkB,EAAE;AAAA,EACzB,CAAC,UAAU;AACT,UAAM,MAAM,IAAI,IAAI,KAAK;AACzB,WACE,CAAC,UAAU,MAAM,EAAE,SAAS,IAAI,QAAQ,KACxC,CAAC,aAAa,aAAa,OAAO,EAAE,SAAS,IAAI,QAAQ;AAAA,EAE7D;AAAA,EACA,EAAE,SAAS,qDAAqD;AAClE;AAEK,MAAM,gBAAgB,CAAC,WAAmB;AAAA,EAC/C,GAAG,QAAQ,OAAO,kBAAkB;AAAA,EACpC,SAAS;AACX;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { PiPermissionMode, ReasoningLevel, type CredentialsInput, type HarnessBindingOutputIface, type InstructionInput, type SkillInput } from "./config-fields.mjs";
|
|
4
|
-
export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-final";
|
|
5
|
-
export declare const FINAL_REASONING_LEVELS: readonly [ReasoningLevel.Low, ReasoningLevel.Medium, ReasoningLevel.High];
|
|
6
|
-
export declare const serverlessFinalConfigSchema: z.ZodObject<{
|
|
7
|
-
model: z.ZodOptional<z.ZodString>;
|
|
8
|
-
reasoning: z.ZodOptional<z.ZodEnum<typeof ReasoningLevel>>;
|
|
9
|
-
credentials: z.ZodObject<{
|
|
10
|
-
payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
|
|
11
|
-
tryInOrder: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
12
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Subscription>;
|
|
13
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
14
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
15
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
16
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
18
|
-
secret: z.ZodString;
|
|
19
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
20
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
21
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
23
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
24
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
25
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
26
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Platform>;
|
|
28
|
-
budget: z.ZodOptional<z.ZodString>;
|
|
29
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.HarnessOwned>;
|
|
31
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
32
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Custom>;
|
|
33
|
-
resolver: z.ZodString;
|
|
34
|
-
events: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("@finalai/agent-provider").DynamicEvent>>>;
|
|
35
|
-
}, z.core.$strip>]>>;
|
|
36
|
-
}, z.core.$strip>;
|
|
37
|
-
permissionMode: z.ZodDefault<z.ZodEnum<typeof PiPermissionMode>>;
|
|
38
|
-
instructions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
39
|
-
role: z.ZodEnum<typeof import("@finalai/agent-provider").InstructionRole>;
|
|
40
|
-
content: z.ZodString;
|
|
41
|
-
source: z.ZodOptional<z.ZodString>;
|
|
42
|
-
}, z.core.$strip>>>;
|
|
43
|
-
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
44
|
-
key: z.ZodString;
|
|
45
|
-
description: z.ZodOptional<z.ZodString>;
|
|
46
|
-
files: z.ZodArray<z.ZodObject<{
|
|
47
|
-
path: z.ZodString;
|
|
48
|
-
content: z.ZodString;
|
|
49
|
-
}, z.core.$strip>>;
|
|
50
|
-
}, z.core.$strip>>>;
|
|
51
|
-
}, z.core.$strict>;
|
|
52
|
-
export type ServerlessFinalConfigIface = z.output<typeof serverlessFinalConfigSchema>;
|
|
53
|
-
export declare const SERVERLESS_FINAL_CONFIG_JSON_SCHEMA: JsonSchema;
|
|
54
|
-
export declare const SERVERLESS_FINAL_DESCRIPTION: HarnessDescriptionIface;
|
|
55
|
-
export interface ServerlessFinalConfigInputIface {
|
|
56
|
-
model?: string;
|
|
57
|
-
reasoning?: (typeof FINAL_REASONING_LEVELS)[number] | `${(typeof FINAL_REASONING_LEVELS)[number]}`;
|
|
58
|
-
credentials: CredentialsInput;
|
|
59
|
-
permissionMode?: PiPermissionMode | `${PiPermissionMode}`;
|
|
60
|
-
instructions?: InstructionInput[];
|
|
61
|
-
skills?: SkillInput[];
|
|
62
|
-
}
|
|
63
|
-
export declare const serverlessFinal: (config: ServerlessFinalConfigInputIface) => HarnessBindingOutputIface;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AcpTransport,
|
|
3
|
-
CredentialDelivery,
|
|
4
|
-
HarnessTrustClass,
|
|
5
|
-
InferenceCredentialKind,
|
|
6
|
-
McpTransportKind,
|
|
7
|
-
PromptWhileRunning,
|
|
8
|
-
SandboxWire
|
|
9
|
-
} from "@finalai/agent-provider";
|
|
10
|
-
import * as z from "zod";
|
|
11
|
-
import {
|
|
12
|
-
configObjectJson,
|
|
13
|
-
credentialsJson,
|
|
14
|
-
credentialsZod,
|
|
15
|
-
harnessBinding,
|
|
16
|
-
instructionsJson,
|
|
17
|
-
instructionsZod,
|
|
18
|
-
modelJson,
|
|
19
|
-
modelZod,
|
|
20
|
-
permissionModeJson,
|
|
21
|
-
PiPermissionMode,
|
|
22
|
-
reasoningJson,
|
|
23
|
-
ReasoningLevel,
|
|
24
|
-
reasoningZod,
|
|
25
|
-
skillsJson,
|
|
26
|
-
skillsZod
|
|
27
|
-
} from "./config-fields.mjs";
|
|
28
|
-
import { ModelVendor } from "./model-reference.mjs";
|
|
29
|
-
import { PI_BASE_TOOLS } from "./serverless-pi.mjs";
|
|
30
|
-
const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-final";
|
|
31
|
-
const FINAL_REASONING_LEVELS = [
|
|
32
|
-
ReasoningLevel.Low,
|
|
33
|
-
ReasoningLevel.Medium,
|
|
34
|
-
ReasoningLevel.High
|
|
35
|
-
];
|
|
36
|
-
const serverlessFinalConfigSchema = z.strictObject({
|
|
37
|
-
model: modelZod().optional(),
|
|
38
|
-
reasoning: reasoningZod(FINAL_REASONING_LEVELS).optional(),
|
|
39
|
-
credentials: credentialsZod(),
|
|
40
|
-
permissionMode: z.nativeEnum(PiPermissionMode).default(PiPermissionMode.Ask),
|
|
41
|
-
instructions: instructionsZod(),
|
|
42
|
-
skills: skillsZod()
|
|
43
|
-
});
|
|
44
|
-
const SERVERLESS_FINAL_CONFIG_JSON_SCHEMA = configObjectJson({
|
|
45
|
-
required: ["credentials"],
|
|
46
|
-
title: "Final harness (serverless)",
|
|
47
|
-
properties: {
|
|
48
|
-
model: modelJson(),
|
|
49
|
-
reasoning: reasoningJson(FINAL_REASONING_LEVELS),
|
|
50
|
-
credentials: credentialsJson(),
|
|
51
|
-
permissionMode: permissionModeJson(Object.values(PiPermissionMode), PiPermissionMode.Ask),
|
|
52
|
-
instructions: instructionsJson(),
|
|
53
|
-
skills: skillsJson()
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
const SERVERLESS_FINAL_DESCRIPTION = {
|
|
57
|
-
configSchema: SERVERLESS_FINAL_CONFIG_JSON_SCHEMA,
|
|
58
|
-
acp: {
|
|
59
|
-
transports: [AcpTransport.Relay, AcpTransport.Ws],
|
|
60
|
-
mcp: [McpTransportKind.Acp, McpTransportKind.Http]
|
|
61
|
-
},
|
|
62
|
-
baseTools: PI_BASE_TOOLS,
|
|
63
|
-
consumes: [SandboxWire.HandleRpc],
|
|
64
|
-
// The Final catalog through the LLM proxy (platform), or an organization's own
|
|
65
|
-
// OpenRouter-compatible key and base URL, as serverless-pi takes it.
|
|
66
|
-
inference: {
|
|
67
|
-
vendors: [ModelVendor.OpenRouter],
|
|
68
|
-
kinds: [InferenceCredentialKind.ApiKey, InferenceCredentialKind.Platform],
|
|
69
|
-
delivery: CredentialDelivery.PerRequest
|
|
70
|
-
},
|
|
71
|
-
// Final runs these on its own Workers.
|
|
72
|
-
trust: HarnessTrustClass.FirstParty,
|
|
73
|
-
supports: { observe: true, resumeReplay: true, fork: false, authorMeta: true },
|
|
74
|
-
// Same engine as serverless-pi (pi/engine.test.ts "injects a prompt accepted while
|
|
75
|
-
// running into the running work"); open asks are not re-raised across invocations.
|
|
76
|
-
promptWhileRunning: PromptWhileRunning.Inject,
|
|
77
|
-
sessionSurvivesDisconnect: false
|
|
78
|
-
};
|
|
79
|
-
const serverlessFinal = (config) => harnessBinding(SPECIFIER, config);
|
|
80
|
-
export {
|
|
81
|
-
FINAL_REASONING_LEVELS,
|
|
82
|
-
SERVERLESS_FINAL_CONFIG_JSON_SCHEMA,
|
|
83
|
-
SERVERLESS_FINAL_DESCRIPTION,
|
|
84
|
-
SPECIFIER,
|
|
85
|
-
serverlessFinal,
|
|
86
|
-
serverlessFinalConfigSchema
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=serverless-final.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 { 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,yBAAyB;AAAA,EACpC,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AACjB;AAEO,MAAM,8BAA8B,EAAE,aAAa;AAAA,EACxD,OAAO,SAAS,EAAE,SAAS;AAAA,EAC3B,WAAW,aAAa,sBAAsB,EAAE,SAAS;AAAA,EACzD,aAAa,eAAe;AAAA,EAC5B,gBAAgB,EAAE,WAAW,gBAAgB,EAAE,QAAQ,iBAAiB,GAAG;AAAA,EAC3E,cAAc,gBAAgB;AAAA,EAC9B,QAAQ,UAAU;AACpB,CAAC;AAIM,MAAM,sCAAkD,iBAAiB;AAAA,EAC9E,UAAU,CAAC,aAAa;AAAA,EACxB,OAAO;AAAA,EACP,YAAY;AAAA,IACV,OAAO,UAAU;AAAA,IACjB,WAAW,cAAc,sBAAsB;AAAA,IAC/C,aAAa,gBAAgB;AAAA,IAC7B,gBAAgB,mBAAmB,OAAO,OAAO,gBAAgB,GAAG,iBAAiB,GAAG;AAAA,IACxF,cAAc,iBAAiB;AAAA,IAC/B,QAAQ,WAAW;AAAA,EACrB;AACF,CAAC;AAEM,MAAM,+BAAwD;AAAA,EACnE,cAAc;AAAA,EACd,KAAK;AAAA,IACH,YAAY,CAAC,aAAa,OAAO,aAAa,EAAE;AAAA,IAChD,KAAK,CAAC,iBAAiB,KAAK,iBAAiB,IAAI;AAAA,EACnD;AAAA,EACA,WAAW;AAAA,EACX,UAAU,CAAC,YAAY,SAAS;AAAA;AAAA;AAAA,EAGhC,WAAW;AAAA,IACT,SAAS,CAAC,YAAY,UAAU;AAAA,IAChC,OAAO,CAAC,wBAAwB,QAAQ,wBAAwB,QAAQ;AAAA,IACxE,UAAU,mBAAmB;AAAA,EAC/B;AAAA;AAAA,EAEA,OAAO,kBAAkB;AAAA,EACzB,UAAU,EAAE,SAAS,MAAM,cAAc,MAAM,MAAM,OAAO,YAAY,KAAK;AAAA;AAAA;AAAA,EAG7E,oBAAoB,mBAAmB;AAAA,EACvC,2BAA2B;AAC7B;AAaO,MAAM,kBAAkB,CAC7B,WAC8B,eAAe,WAAW,MAAM;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { ClaudePermissionMode, ReasoningLevel, type CredentialsInput, type HarnessBindingOutputIface, type InstructionInput, type SkillInput } from "./config-fields.mjs";
|
|
4
|
-
export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-nanocode-claude";
|
|
5
|
-
export declare const CLAUDE_REASONING_LEVELS: readonly [ReasoningLevel.Low, ReasoningLevel.Medium, ReasoningLevel.High, ReasoningLevel.Max];
|
|
6
|
-
export declare const NANOCODE_CLAUDE_BASE_TOOLS: HarnessDescriptionIface['baseTools'];
|
|
7
|
-
export declare const serverlessNanocodeClaudeConfigSchema: z.ZodObject<{
|
|
8
|
-
model: z.ZodOptional<z.ZodString>;
|
|
9
|
-
reasoning: z.ZodOptional<z.ZodEnum<typeof ReasoningLevel>>;
|
|
10
|
-
credentials: z.ZodObject<{
|
|
11
|
-
payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
|
|
12
|
-
tryInOrder: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
13
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Subscription>;
|
|
14
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
15
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
16
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
17
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
19
|
-
secret: z.ZodString;
|
|
20
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
21
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
24
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
25
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
26
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Platform>;
|
|
29
|
-
budget: z.ZodOptional<z.ZodString>;
|
|
30
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.HarnessOwned>;
|
|
32
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Custom>;
|
|
34
|
-
resolver: z.ZodString;
|
|
35
|
-
events: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("@finalai/agent-provider").DynamicEvent>>>;
|
|
36
|
-
}, z.core.$strip>]>>;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
permissionMode: z.ZodDefault<z.ZodEnum<typeof ClaudePermissionMode>>;
|
|
39
|
-
instructions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
40
|
-
role: z.ZodEnum<typeof import("@finalai/agent-provider").InstructionRole>;
|
|
41
|
-
content: z.ZodString;
|
|
42
|
-
source: z.ZodOptional<z.ZodString>;
|
|
43
|
-
}, z.core.$strip>>>;
|
|
44
|
-
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
45
|
-
key: z.ZodString;
|
|
46
|
-
description: z.ZodOptional<z.ZodString>;
|
|
47
|
-
files: z.ZodArray<z.ZodObject<{
|
|
48
|
-
path: z.ZodString;
|
|
49
|
-
content: z.ZodString;
|
|
50
|
-
}, z.core.$strip>>;
|
|
51
|
-
}, z.core.$strip>>>;
|
|
52
|
-
}, z.core.$strict>;
|
|
53
|
-
export type ServerlessNanocodeClaudeConfigIface = z.output<typeof serverlessNanocodeClaudeConfigSchema>;
|
|
54
|
-
export declare const SERVERLESS_NANOCODE_CLAUDE_CONFIG_JSON_SCHEMA: JsonSchema;
|
|
55
|
-
export declare const SERVERLESS_NANOCODE_CLAUDE_DESCRIPTION: HarnessDescriptionIface;
|
|
56
|
-
export interface ServerlessNanocodeClaudeConfigInputIface {
|
|
57
|
-
model?: string;
|
|
58
|
-
reasoning?: (typeof CLAUDE_REASONING_LEVELS)[number] | `${(typeof CLAUDE_REASONING_LEVELS)[number]}`;
|
|
59
|
-
credentials: CredentialsInput;
|
|
60
|
-
permissionMode?: ClaudePermissionMode | `${ClaudePermissionMode}`;
|
|
61
|
-
instructions?: InstructionInput[];
|
|
62
|
-
skills?: SkillInput[];
|
|
63
|
-
}
|
|
64
|
-
export declare const serverlessNanocodeClaude: (config: ServerlessNanocodeClaudeConfigInputIface) => HarnessBindingOutputIface;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AcpTransport,
|
|
3
|
-
BaseCapability,
|
|
4
|
-
BaseToolProvision,
|
|
5
|
-
CredentialDelivery,
|
|
6
|
-
HarnessTrustClass,
|
|
7
|
-
InferenceCredentialKind,
|
|
8
|
-
McpTransportKind,
|
|
9
|
-
PromptWhileRunning,
|
|
10
|
-
SandboxWire
|
|
11
|
-
} from "@finalai/agent-provider";
|
|
12
|
-
import * as z from "zod";
|
|
13
|
-
import {
|
|
14
|
-
ClaudePermissionMode,
|
|
15
|
-
configObjectJson,
|
|
16
|
-
credentialsJson,
|
|
17
|
-
credentialsZod,
|
|
18
|
-
harnessBinding,
|
|
19
|
-
instructionsJson,
|
|
20
|
-
instructionsZod,
|
|
21
|
-
modelJson,
|
|
22
|
-
modelZod,
|
|
23
|
-
permissionModeJson,
|
|
24
|
-
reasoningJson,
|
|
25
|
-
ReasoningLevel,
|
|
26
|
-
reasoningZod,
|
|
27
|
-
skillsJson,
|
|
28
|
-
skillsZod
|
|
29
|
-
} from "./config-fields.mjs";
|
|
30
|
-
import { ModelVendor } from "./model-reference.mjs";
|
|
31
|
-
const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-nanocode-claude";
|
|
32
|
-
const CLAUDE_REASONING_LEVELS = [
|
|
33
|
-
ReasoningLevel.Low,
|
|
34
|
-
ReasoningLevel.Medium,
|
|
35
|
-
ReasoningLevel.High,
|
|
36
|
-
ReasoningLevel.Max
|
|
37
|
-
];
|
|
38
|
-
const NANOCODE_CLAUDE_BASE_TOOLS = {
|
|
39
|
-
[BaseCapability.Shell]: {
|
|
40
|
-
provision: BaseToolProvision.Bound,
|
|
41
|
-
nativeTools: ["Bash", "BashOutput"]
|
|
42
|
-
},
|
|
43
|
-
[BaseCapability.Files]: { provision: BaseToolProvision.Bound, nativeTools: ["Read", "Write"] }
|
|
44
|
-
};
|
|
45
|
-
const serverlessNanocodeClaudeConfigSchema = z.strictObject({
|
|
46
|
-
model: modelZod().optional(),
|
|
47
|
-
reasoning: reasoningZod(CLAUDE_REASONING_LEVELS).optional(),
|
|
48
|
-
credentials: credentialsZod(),
|
|
49
|
-
permissionMode: z.nativeEnum(ClaudePermissionMode).default(ClaudePermissionMode.Default),
|
|
50
|
-
instructions: instructionsZod(),
|
|
51
|
-
skills: skillsZod()
|
|
52
|
-
});
|
|
53
|
-
const SERVERLESS_NANOCODE_CLAUDE_CONFIG_JSON_SCHEMA = configObjectJson({
|
|
54
|
-
required: ["credentials"],
|
|
55
|
-
title: "Claude on nanocode (serverless)",
|
|
56
|
-
properties: {
|
|
57
|
-
model: modelJson(),
|
|
58
|
-
reasoning: reasoningJson(CLAUDE_REASONING_LEVELS),
|
|
59
|
-
credentials: credentialsJson(),
|
|
60
|
-
permissionMode: permissionModeJson(
|
|
61
|
-
Object.values(ClaudePermissionMode),
|
|
62
|
-
ClaudePermissionMode.Default
|
|
63
|
-
),
|
|
64
|
-
instructions: instructionsJson(),
|
|
65
|
-
skills: skillsJson()
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
const SERVERLESS_NANOCODE_CLAUDE_DESCRIPTION = {
|
|
69
|
-
configSchema: SERVERLESS_NANOCODE_CLAUDE_CONFIG_JSON_SCHEMA,
|
|
70
|
-
acp: {
|
|
71
|
-
transports: [AcpTransport.Relay, AcpTransport.Ws],
|
|
72
|
-
mcp: [McpTransportKind.Acp, McpTransportKind.Http]
|
|
73
|
-
},
|
|
74
|
-
baseTools: NANOCODE_CLAUDE_BASE_TOOLS,
|
|
75
|
-
consumes: [SandboxWire.HandleRpc],
|
|
76
|
-
// Subscriptions are the Claude setup token, used as a bearer.
|
|
77
|
-
inference: {
|
|
78
|
-
vendors: [ModelVendor.Anthropic],
|
|
79
|
-
kinds: [
|
|
80
|
-
InferenceCredentialKind.Subscription,
|
|
81
|
-
InferenceCredentialKind.ApiKey,
|
|
82
|
-
InferenceCredentialKind.Platform
|
|
83
|
-
],
|
|
84
|
-
delivery: CredentialDelivery.PerRequest
|
|
85
|
-
},
|
|
86
|
-
// Final runs these on its own Workers.
|
|
87
|
-
trust: HarnessTrustClass.FirstParty,
|
|
88
|
-
supports: { observe: true, resumeReplay: true, fork: false, authorMeta: true },
|
|
89
|
-
// Measured (agent-harness-workers nanocode/claude.test.ts "queues a prompt that arrives
|
|
90
|
-
// while a turn runs"): running, idle, running, idle. Open approvals are asked again
|
|
91
|
-
// with new ids after a lost invocation, so no disconnect survival yet.
|
|
92
|
-
promptWhileRunning: PromptWhileRunning.Queue,
|
|
93
|
-
sessionSurvivesDisconnect: false
|
|
94
|
-
};
|
|
95
|
-
const serverlessNanocodeClaude = (config) => harnessBinding(SPECIFIER, config);
|
|
96
|
-
export {
|
|
97
|
-
CLAUDE_REASONING_LEVELS,
|
|
98
|
-
NANOCODE_CLAUDE_BASE_TOOLS,
|
|
99
|
-
SERVERLESS_NANOCODE_CLAUDE_CONFIG_JSON_SCHEMA,
|
|
100
|
-
SERVERLESS_NANOCODE_CLAUDE_DESCRIPTION,
|
|
101
|
-
SPECIFIER,
|
|
102
|
-
serverlessNanocodeClaude,
|
|
103
|
-
serverlessNanocodeClaudeConfigSchema
|
|
104
|
-
};
|
|
105
|
-
//# sourceMappingURL=serverless-nanocode-claude.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/harnesses/serverless-nanocode-claude.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n AcpTransport,\n BaseCapability,\n BaseToolProvision,\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 ClaudePermissionMode,\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n modelJson,\n modelZod,\n permissionModeJson,\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\";\n\n// nanocode's Claude engine in the nanocode Durable Object script.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/serverless-nanocode-claude';\n\nexport const CLAUDE_REASONING_LEVELS = [\n ReasoningLevel.Low,\n ReasoningLevel.Medium,\n ReasoningLevel.High,\n ReasoningLevel.Max,\n] as const;\n\nexport const NANOCODE_CLAUDE_BASE_TOOLS: HarnessDescriptionIface['baseTools'] = {\n [BaseCapability.Shell]: {\n provision: BaseToolProvision.Bound,\n nativeTools: ['Bash', 'BashOutput'],\n },\n [BaseCapability.Files]: { provision: BaseToolProvision.Bound, nativeTools: ['Read', 'Write'] },\n};\n\nexport const serverlessNanocodeClaudeConfigSchema = z.strictObject({\n model: modelZod().optional(),\n reasoning: reasoningZod(CLAUDE_REASONING_LEVELS).optional(),\n credentials: credentialsZod(),\n permissionMode: z.nativeEnum(ClaudePermissionMode).default(ClaudePermissionMode.Default),\n instructions: instructionsZod(),\n skills: skillsZod(),\n});\n\nexport type ServerlessNanocodeClaudeConfigIface = z.output<\n typeof serverlessNanocodeClaudeConfigSchema\n>;\n\nexport const SERVERLESS_NANOCODE_CLAUDE_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n required: ['credentials'],\n title: 'Claude on nanocode (serverless)',\n properties: {\n model: modelJson(),\n reasoning: reasoningJson(CLAUDE_REASONING_LEVELS),\n credentials: credentialsJson(),\n permissionMode: permissionModeJson(\n Object.values(ClaudePermissionMode),\n ClaudePermissionMode.Default,\n ),\n instructions: instructionsJson(),\n skills: skillsJson(),\n },\n});\n\nexport const SERVERLESS_NANOCODE_CLAUDE_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: SERVERLESS_NANOCODE_CLAUDE_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Relay, AcpTransport.Ws],\n mcp: [McpTransportKind.Acp, McpTransportKind.Http],\n },\n baseTools: NANOCODE_CLAUDE_BASE_TOOLS,\n consumes: [SandboxWire.HandleRpc],\n // Subscriptions are the Claude setup token, used as a bearer.\n inference: {\n vendors: [ModelVendor.Anthropic],\n kinds: [\n InferenceCredentialKind.Subscription,\n InferenceCredentialKind.ApiKey,\n InferenceCredentialKind.Platform,\n ],\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 // Measured (agent-harness-workers nanocode/claude.test.ts \"queues a prompt that arrives\n // while a turn runs\"): running, idle, running, idle. Open approvals are asked again\n // with new ids after a lost invocation, so no disconnect survival yet.\n promptWhileRunning: PromptWhileRunning.Queue,\n sessionSurvivesDisconnect: false,\n};\n\nexport interface ServerlessNanocodeClaudeConfigInputIface {\n model?: string;\n reasoning?:\n | (typeof CLAUDE_REASONING_LEVELS)[number]\n | `${(typeof CLAUDE_REASONING_LEVELS)[number]}`;\n credentials: CredentialsInput;\n permissionMode?: ClaudePermissionMode | `${ClaudePermissionMode}`;\n instructions?: InstructionInput[];\n skills?: SkillInput[];\n}\n\nexport const serverlessNanocodeClaude = (\n config: ServerlessNanocodeClaudeConfigInputIface,\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,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;AAIrB,MAAM,YAAY;AAElB,MAAM,0BAA0B;AAAA,EACrC,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AACjB;AAEO,MAAM,6BAAmE;AAAA,EAC9E,CAAC,eAAe,KAAK,GAAG;AAAA,IACtB,WAAW,kBAAkB;AAAA,IAC7B,aAAa,CAAC,QAAQ,YAAY;AAAA,EACpC;AAAA,EACA,CAAC,eAAe,KAAK,GAAG,EAAE,WAAW,kBAAkB,OAAO,aAAa,CAAC,QAAQ,OAAO,EAAE;AAC/F;AAEO,MAAM,uCAAuC,EAAE,aAAa;AAAA,EACjE,OAAO,SAAS,EAAE,SAAS;AAAA,EAC3B,WAAW,aAAa,uBAAuB,EAAE,SAAS;AAAA,EAC1D,aAAa,eAAe;AAAA,EAC5B,gBAAgB,EAAE,WAAW,oBAAoB,EAAE,QAAQ,qBAAqB,OAAO;AAAA,EACvF,cAAc,gBAAgB;AAAA,EAC9B,QAAQ,UAAU;AACpB,CAAC;AAMM,MAAM,gDAA4D,iBAAiB;AAAA,EACxF,UAAU,CAAC,aAAa;AAAA,EACxB,OAAO;AAAA,EACP,YAAY;AAAA,IACV,OAAO,UAAU;AAAA,IACjB,WAAW,cAAc,uBAAuB;AAAA,IAChD,aAAa,gBAAgB;AAAA,IAC7B,gBAAgB;AAAA,MACd,OAAO,OAAO,oBAAoB;AAAA,MAClC,qBAAqB;AAAA,IACvB;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B,QAAQ,WAAW;AAAA,EACrB;AACF,CAAC;AAEM,MAAM,yCAAkE;AAAA,EAC7E,cAAc;AAAA,EACd,KAAK;AAAA,IACH,YAAY,CAAC,aAAa,OAAO,aAAa,EAAE;AAAA,IAChD,KAAK,CAAC,iBAAiB,KAAK,iBAAiB,IAAI;AAAA,EACnD;AAAA,EACA,WAAW;AAAA,EACX,UAAU,CAAC,YAAY,SAAS;AAAA;AAAA,EAEhC,WAAW;AAAA,IACT,SAAS,CAAC,YAAY,SAAS;AAAA,IAC/B,OAAO;AAAA,MACL,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,IAC1B;AAAA,IACA,UAAU,mBAAmB;AAAA,EAC/B;AAAA;AAAA,EAEA,OAAO,kBAAkB;AAAA,EACzB,UAAU,EAAE,SAAS,MAAM,cAAc,MAAM,MAAM,OAAO,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA,EAI7E,oBAAoB,mBAAmB;AAAA,EACvC,2BAA2B;AAC7B;AAaO,MAAM,2BAA2B,CACtC,WAC8B,eAAe,WAAW,MAAM;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { CodexApprovalPolicy, CodexApprovalsReviewer, ReasoningLevel, type CredentialsInput, type HarnessBindingOutputIface, type InstructionInput, type SkillInput } from "./config-fields.mjs";
|
|
4
|
-
export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-nanocode-codex";
|
|
5
|
-
export declare const CODEX_REASONING_LEVELS: readonly [ReasoningLevel.Low, ReasoningLevel.Medium, ReasoningLevel.High, ReasoningLevel.Max];
|
|
6
|
-
export declare const CODEX_BASE_TOOLS: HarnessDescriptionIface['baseTools'];
|
|
7
|
-
export declare const serverlessNanocodeCodexConfigSchema: z.ZodObject<{
|
|
8
|
-
model: z.ZodOptional<z.ZodString>;
|
|
9
|
-
reasoning: z.ZodOptional<z.ZodEnum<typeof ReasoningLevel>>;
|
|
10
|
-
credentials: z.ZodObject<{
|
|
11
|
-
payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
|
|
12
|
-
tryInOrder: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
13
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Subscription>;
|
|
14
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
15
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
16
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
17
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
19
|
-
secret: z.ZodString;
|
|
20
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
21
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
24
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
25
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
26
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Platform>;
|
|
29
|
-
budget: z.ZodOptional<z.ZodString>;
|
|
30
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.HarnessOwned>;
|
|
32
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Custom>;
|
|
34
|
-
resolver: z.ZodString;
|
|
35
|
-
events: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("@finalai/agent-provider").DynamicEvent>>>;
|
|
36
|
-
}, z.core.$strip>]>>;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
approvalPolicy: z.ZodDefault<z.ZodEnum<typeof CodexApprovalPolicy>>;
|
|
39
|
-
approvalsReviewer: z.ZodDefault<z.ZodEnum<typeof CodexApprovalsReviewer>>;
|
|
40
|
-
instructions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
41
|
-
role: z.ZodEnum<typeof import("@finalai/agent-provider").InstructionRole>;
|
|
42
|
-
content: z.ZodString;
|
|
43
|
-
source: z.ZodOptional<z.ZodString>;
|
|
44
|
-
}, z.core.$strip>>>;
|
|
45
|
-
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
46
|
-
key: z.ZodString;
|
|
47
|
-
description: z.ZodOptional<z.ZodString>;
|
|
48
|
-
files: z.ZodArray<z.ZodObject<{
|
|
49
|
-
path: z.ZodString;
|
|
50
|
-
content: z.ZodString;
|
|
51
|
-
}, z.core.$strip>>;
|
|
52
|
-
}, z.core.$strip>>>;
|
|
53
|
-
}, z.core.$strict>;
|
|
54
|
-
export type ServerlessNanocodeCodexConfigIface = z.output<typeof serverlessNanocodeCodexConfigSchema>;
|
|
55
|
-
export declare const SERVERLESS_NANOCODE_CODEX_CONFIG_JSON_SCHEMA: JsonSchema;
|
|
56
|
-
export declare const SERVERLESS_NANOCODE_CODEX_DESCRIPTION: HarnessDescriptionIface;
|
|
57
|
-
export interface ServerlessNanocodeCodexConfigInputIface {
|
|
58
|
-
model?: string;
|
|
59
|
-
reasoning?: (typeof CODEX_REASONING_LEVELS)[number] | `${(typeof CODEX_REASONING_LEVELS)[number]}`;
|
|
60
|
-
credentials: CredentialsInput;
|
|
61
|
-
approvalPolicy?: CodexApprovalPolicy | `${CodexApprovalPolicy}`;
|
|
62
|
-
approvalsReviewer?: CodexApprovalsReviewer | `${CodexApprovalsReviewer}`;
|
|
63
|
-
instructions?: InstructionInput[];
|
|
64
|
-
skills?: SkillInput[];
|
|
65
|
-
}
|
|
66
|
-
export declare const serverlessNanocodeCodex: (config: ServerlessNanocodeCodexConfigInputIface) => HarnessBindingOutputIface;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AcpTransport,
|
|
3
|
-
BaseCapability,
|
|
4
|
-
BaseToolProvision,
|
|
5
|
-
CredentialDelivery,
|
|
6
|
-
HarnessTrustClass,
|
|
7
|
-
InferenceCredentialKind,
|
|
8
|
-
McpTransportKind,
|
|
9
|
-
PromptWhileRunning,
|
|
10
|
-
SandboxWire
|
|
11
|
-
} from "@finalai/agent-provider";
|
|
12
|
-
import * as z from "zod";
|
|
13
|
-
import {
|
|
14
|
-
CodexApprovalPolicy,
|
|
15
|
-
CodexApprovalsReviewer,
|
|
16
|
-
configObjectJson,
|
|
17
|
-
credentialsJson,
|
|
18
|
-
credentialsZod,
|
|
19
|
-
harnessBinding,
|
|
20
|
-
instructionsJson,
|
|
21
|
-
instructionsZod,
|
|
22
|
-
modelJson,
|
|
23
|
-
modelZod,
|
|
24
|
-
permissionModeJson,
|
|
25
|
-
reasoningJson,
|
|
26
|
-
ReasoningLevel,
|
|
27
|
-
reasoningZod,
|
|
28
|
-
skillsJson,
|
|
29
|
-
skillsZod
|
|
30
|
-
} from "./config-fields.mjs";
|
|
31
|
-
import { ModelVendor } from "./model-reference.mjs";
|
|
32
|
-
const SPECIFIER = "@finalai/final-agent-provider/harnesses/serverless-nanocode-codex";
|
|
33
|
-
const CODEX_REASONING_LEVELS = [
|
|
34
|
-
ReasoningLevel.Low,
|
|
35
|
-
ReasoningLevel.Medium,
|
|
36
|
-
ReasoningLevel.High,
|
|
37
|
-
ReasoningLevel.Max
|
|
38
|
-
];
|
|
39
|
-
const CODEX_BASE_TOOLS = {
|
|
40
|
-
[BaseCapability.Shell]: {
|
|
41
|
-
provision: BaseToolProvision.Bound,
|
|
42
|
-
nativeTools: ["exec_command", "write_stdin"]
|
|
43
|
-
},
|
|
44
|
-
[BaseCapability.Files]: {
|
|
45
|
-
provision: BaseToolProvision.Bound,
|
|
46
|
-
nativeTools: ["apply_patch", "view_image"]
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const serverlessNanocodeCodexConfigSchema = z.strictObject({
|
|
50
|
-
model: modelZod().optional(),
|
|
51
|
-
reasoning: reasoningZod(CODEX_REASONING_LEVELS).optional(),
|
|
52
|
-
credentials: credentialsZod(),
|
|
53
|
-
approvalPolicy: z.nativeEnum(CodexApprovalPolicy).default(CodexApprovalPolicy.OnRequest),
|
|
54
|
-
approvalsReviewer: z.nativeEnum(CodexApprovalsReviewer).default(CodexApprovalsReviewer.User),
|
|
55
|
-
instructions: instructionsZod(),
|
|
56
|
-
skills: skillsZod()
|
|
57
|
-
});
|
|
58
|
-
const SERVERLESS_NANOCODE_CODEX_CONFIG_JSON_SCHEMA = configObjectJson({
|
|
59
|
-
required: ["credentials"],
|
|
60
|
-
title: "Codex on nanocode (serverless)",
|
|
61
|
-
properties: {
|
|
62
|
-
model: modelJson(),
|
|
63
|
-
reasoning: reasoningJson(CODEX_REASONING_LEVELS),
|
|
64
|
-
credentials: credentialsJson(),
|
|
65
|
-
approvalPolicy: permissionModeJson(
|
|
66
|
-
Object.values(CodexApprovalPolicy),
|
|
67
|
-
CodexApprovalPolicy.OnRequest
|
|
68
|
-
),
|
|
69
|
-
approvalsReviewer: permissionModeJson(
|
|
70
|
-
Object.values(CodexApprovalsReviewer),
|
|
71
|
-
CodexApprovalsReviewer.User
|
|
72
|
-
),
|
|
73
|
-
instructions: instructionsJson(),
|
|
74
|
-
skills: skillsJson()
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
const SERVERLESS_NANOCODE_CODEX_DESCRIPTION = {
|
|
78
|
-
configSchema: SERVERLESS_NANOCODE_CODEX_CONFIG_JSON_SCHEMA,
|
|
79
|
-
acp: {
|
|
80
|
-
transports: [AcpTransport.Relay, AcpTransport.Ws],
|
|
81
|
-
mcp: [McpTransportKind.Acp, McpTransportKind.Http]
|
|
82
|
-
},
|
|
83
|
-
baseTools: CODEX_BASE_TOOLS,
|
|
84
|
-
consumes: [SandboxWire.HandleRpc],
|
|
85
|
-
inference: {
|
|
86
|
-
vendors: [ModelVendor.OpenAI],
|
|
87
|
-
kinds: [
|
|
88
|
-
InferenceCredentialKind.Subscription,
|
|
89
|
-
InferenceCredentialKind.ApiKey,
|
|
90
|
-
InferenceCredentialKind.Platform
|
|
91
|
-
],
|
|
92
|
-
delivery: CredentialDelivery.PerRequest
|
|
93
|
-
},
|
|
94
|
-
// Final runs these on its own Workers.
|
|
95
|
-
trust: HarnessTrustClass.FirstParty,
|
|
96
|
-
supports: { observe: true, resumeReplay: true, fork: false, authorMeta: true },
|
|
97
|
-
// Measured (agent-harness-workers nanocode/codex.test.ts "steers a prompt that arrives
|
|
98
|
-
// while the turn runs into it"); open approvals are asked again with new ids after a
|
|
99
|
-
// lost invocation, so no disconnect survival yet.
|
|
100
|
-
promptWhileRunning: PromptWhileRunning.Inject,
|
|
101
|
-
sessionSurvivesDisconnect: false
|
|
102
|
-
};
|
|
103
|
-
const serverlessNanocodeCodex = (config) => harnessBinding(SPECIFIER, config);
|
|
104
|
-
export {
|
|
105
|
-
CODEX_BASE_TOOLS,
|
|
106
|
-
CODEX_REASONING_LEVELS,
|
|
107
|
-
SERVERLESS_NANOCODE_CODEX_CONFIG_JSON_SCHEMA,
|
|
108
|
-
SERVERLESS_NANOCODE_CODEX_DESCRIPTION,
|
|
109
|
-
SPECIFIER,
|
|
110
|
-
serverlessNanocodeCodex,
|
|
111
|
-
serverlessNanocodeCodexConfigSchema
|
|
112
|
-
};
|
|
113
|
-
//# sourceMappingURL=serverless-nanocode-codex.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/harnesses/serverless-nanocode-codex.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n AcpTransport,\n BaseCapability,\n BaseToolProvision,\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 CodexApprovalPolicy,\n CodexApprovalsReviewer,\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n instructionsJson,\n instructionsZod,\n modelJson,\n modelZod,\n permissionModeJson,\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\";\n\n// nanocode's Codex engine (Rust \u2192 wasm) in the nanocode Durable Object script.\n// Responses Lite models only; ChatGPT subscriptions go through the session\n// service relay because chatgpt.com blocks Workers egress.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/serverless-nanocode-codex';\n\n// The final://schemas/reasoning fragment has no xhigh/ultra yet; nanocode's\n// policies accept the rest.\nexport const CODEX_REASONING_LEVELS = [\n ReasoningLevel.Low,\n ReasoningLevel.Medium,\n ReasoningLevel.High,\n ReasoningLevel.Max,\n] as const;\n\nexport const CODEX_BASE_TOOLS: HarnessDescriptionIface['baseTools'] = {\n [BaseCapability.Shell]: {\n provision: BaseToolProvision.Bound,\n nativeTools: ['exec_command', 'write_stdin'],\n },\n [BaseCapability.Files]: {\n provision: BaseToolProvision.Bound,\n nativeTools: ['apply_patch', 'view_image'],\n },\n};\n\nexport const serverlessNanocodeCodexConfigSchema = z.strictObject({\n model: modelZod().optional(),\n reasoning: reasoningZod(CODEX_REASONING_LEVELS).optional(),\n credentials: credentialsZod(),\n approvalPolicy: z.nativeEnum(CodexApprovalPolicy).default(CodexApprovalPolicy.OnRequest),\n approvalsReviewer: z.nativeEnum(CodexApprovalsReviewer).default(CodexApprovalsReviewer.User),\n instructions: instructionsZod(),\n skills: skillsZod(),\n});\n\nexport type ServerlessNanocodeCodexConfigIface = z.output<\n typeof serverlessNanocodeCodexConfigSchema\n>;\n\nexport const SERVERLESS_NANOCODE_CODEX_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n required: ['credentials'],\n title: 'Codex on nanocode (serverless)',\n properties: {\n model: modelJson(),\n reasoning: reasoningJson(CODEX_REASONING_LEVELS),\n credentials: credentialsJson(),\n approvalPolicy: permissionModeJson(\n Object.values(CodexApprovalPolicy),\n CodexApprovalPolicy.OnRequest,\n ),\n approvalsReviewer: permissionModeJson(\n Object.values(CodexApprovalsReviewer),\n CodexApprovalsReviewer.User,\n ),\n instructions: instructionsJson(),\n skills: skillsJson(),\n },\n});\n\nexport const SERVERLESS_NANOCODE_CODEX_DESCRIPTION: HarnessDescriptionIface = {\n configSchema: SERVERLESS_NANOCODE_CODEX_CONFIG_JSON_SCHEMA,\n acp: {\n transports: [AcpTransport.Relay, AcpTransport.Ws],\n mcp: [McpTransportKind.Acp, McpTransportKind.Http],\n },\n baseTools: CODEX_BASE_TOOLS,\n consumes: [SandboxWire.HandleRpc],\n inference: {\n vendors: [ModelVendor.OpenAI],\n kinds: [\n InferenceCredentialKind.Subscription,\n InferenceCredentialKind.ApiKey,\n InferenceCredentialKind.Platform,\n ],\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 // Measured (agent-harness-workers nanocode/codex.test.ts \"steers a prompt that arrives\n // while the turn runs into it\"); open approvals are asked again with new ids after a\n // lost invocation, so no disconnect survival yet.\n promptWhileRunning: PromptWhileRunning.Inject,\n sessionSurvivesDisconnect: false,\n};\n\nexport interface ServerlessNanocodeCodexConfigInputIface {\n model?: string;\n reasoning?:\n | (typeof CODEX_REASONING_LEVELS)[number]\n | `${(typeof CODEX_REASONING_LEVELS)[number]}`;\n credentials: CredentialsInput;\n approvalPolicy?: CodexApprovalPolicy | `${CodexApprovalPolicy}`;\n approvalsReviewer?: CodexApprovalsReviewer | `${CodexApprovalsReviewer}`;\n instructions?: InstructionInput[];\n skills?: SkillInput[];\n}\n\nexport const serverlessNanocodeCodex = (\n config: ServerlessNanocodeCodexConfigInputIface,\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,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,OAKK;AACP,SAAS,mBAAmB;AAMrB,MAAM,YAAY;AAIlB,MAAM,yBAAyB;AAAA,EACpC,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AACjB;AAEO,MAAM,mBAAyD;AAAA,EACpE,CAAC,eAAe,KAAK,GAAG;AAAA,IACtB,WAAW,kBAAkB;AAAA,IAC7B,aAAa,CAAC,gBAAgB,aAAa;AAAA,EAC7C;AAAA,EACA,CAAC,eAAe,KAAK,GAAG;AAAA,IACtB,WAAW,kBAAkB;AAAA,IAC7B,aAAa,CAAC,eAAe,YAAY;AAAA,EAC3C;AACF;AAEO,MAAM,sCAAsC,EAAE,aAAa;AAAA,EAChE,OAAO,SAAS,EAAE,SAAS;AAAA,EAC3B,WAAW,aAAa,sBAAsB,EAAE,SAAS;AAAA,EACzD,aAAa,eAAe;AAAA,EAC5B,gBAAgB,EAAE,WAAW,mBAAmB,EAAE,QAAQ,oBAAoB,SAAS;AAAA,EACvF,mBAAmB,EAAE,WAAW,sBAAsB,EAAE,QAAQ,uBAAuB,IAAI;AAAA,EAC3F,cAAc,gBAAgB;AAAA,EAC9B,QAAQ,UAAU;AACpB,CAAC;AAMM,MAAM,+CAA2D,iBAAiB;AAAA,EACvF,UAAU,CAAC,aAAa;AAAA,EACxB,OAAO;AAAA,EACP,YAAY;AAAA,IACV,OAAO,UAAU;AAAA,IACjB,WAAW,cAAc,sBAAsB;AAAA,IAC/C,aAAa,gBAAgB;AAAA,IAC7B,gBAAgB;AAAA,MACd,OAAO,OAAO,mBAAmB;AAAA,MACjC,oBAAoB;AAAA,IACtB;AAAA,IACA,mBAAmB;AAAA,MACjB,OAAO,OAAO,sBAAsB;AAAA,MACpC,uBAAuB;AAAA,IACzB;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B,QAAQ,WAAW;AAAA,EACrB;AACF,CAAC;AAEM,MAAM,wCAAiE;AAAA,EAC5E,cAAc;AAAA,EACd,KAAK;AAAA,IACH,YAAY,CAAC,aAAa,OAAO,aAAa,EAAE;AAAA,IAChD,KAAK,CAAC,iBAAiB,KAAK,iBAAiB,IAAI;AAAA,EACnD;AAAA,EACA,WAAW;AAAA,EACX,UAAU,CAAC,YAAY,SAAS;AAAA,EAChC,WAAW;AAAA,IACT,SAAS,CAAC,YAAY,MAAM;AAAA,IAC5B,OAAO;AAAA,MACL,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,IAC1B;AAAA,IACA,UAAU,mBAAmB;AAAA,EAC/B;AAAA;AAAA,EAEA,OAAO,kBAAkB;AAAA,EACzB,UAAU,EAAE,SAAS,MAAM,cAAc,MAAM,MAAM,OAAO,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA,EAI7E,oBAAoB,mBAAmB;AAAA,EACvC,2BAA2B;AAC7B;AAcO,MAAM,0BAA0B,CACrC,WAC8B,eAAe,WAAW,MAAM;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|