@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,113 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AcpTransport,
|
|
3
|
-
BaseCapability,
|
|
4
|
-
BaseToolProvision,
|
|
5
|
-
CredentialDelivery,
|
|
6
|
-
InferenceCredentialKind,
|
|
7
|
-
McpTransportKind,
|
|
8
|
-
PromptWhileRunning,
|
|
9
|
-
SandboxWire
|
|
10
|
-
} from "@finalai/agent-provider";
|
|
11
|
-
import * as z from "zod";
|
|
12
|
-
import {
|
|
13
|
-
absolutePathJson,
|
|
14
|
-
absolutePathZod,
|
|
15
|
-
ClaudePermissionMode,
|
|
16
|
-
configObjectJson,
|
|
17
|
-
credentialsJson,
|
|
18
|
-
credentialsZod,
|
|
19
|
-
harnessBinding,
|
|
20
|
-
instructionsJson,
|
|
21
|
-
instructionsZod,
|
|
22
|
-
permissionModeJson,
|
|
23
|
-
secretRefJson,
|
|
24
|
-
secretRefZod
|
|
25
|
-
} from "./config-fields.mjs";
|
|
26
|
-
import { ModelVendor } from "./model-reference.mjs";
|
|
27
|
-
import {
|
|
28
|
-
remoteClientTlsJson,
|
|
29
|
-
remoteClientTlsSchema
|
|
30
|
-
} from "./remote-client-tls.mjs";
|
|
31
|
-
import { remoteUrlJson, remoteUrlZod } from "./remote-url.mjs";
|
|
32
|
-
const SPECIFIER = "@finalai/final-agent-provider/harnesses/remote-claude-code";
|
|
33
|
-
const remotePermissionModeSchema = z.nativeEnum(ClaudePermissionMode).exclude(["Auto"]);
|
|
34
|
-
const remoteClaudeCodeConfigSchema = z.strictObject({
|
|
35
|
-
url: remoteUrlZod(),
|
|
36
|
-
tls: remoteClientTlsSchema.optional(),
|
|
37
|
-
hop: secretRefZod(),
|
|
38
|
-
cwd: absolutePathZod().optional(),
|
|
39
|
-
executable: z.string().min(1).optional(),
|
|
40
|
-
model: z.string().min(1).optional(),
|
|
41
|
-
credentials: credentialsZod(),
|
|
42
|
-
permissionMode: remotePermissionModeSchema.optional(),
|
|
43
|
-
instructions: instructionsZod(),
|
|
44
|
-
allowedTools: z.array(z.string().min(1)).optional()
|
|
45
|
-
});
|
|
46
|
-
const REMOTE_CLAUDE_CODE_CONFIG_JSON_SCHEMA = configObjectJson({
|
|
47
|
-
title: "Claude Code (your host)",
|
|
48
|
-
required: ["credentials", "url", "hop"],
|
|
49
|
-
properties: {
|
|
50
|
-
url: remoteUrlJson("Runtime URL"),
|
|
51
|
-
tls: remoteClientTlsJson(),
|
|
52
|
-
hop: secretRefJson(),
|
|
53
|
-
cwd: absolutePathJson("Working directory on your host"),
|
|
54
|
-
executable: { type: "string", title: "Installed executable on your host" },
|
|
55
|
-
model: { $ref: "final://schemas/model-picker" },
|
|
56
|
-
credentials: {
|
|
57
|
-
...credentialsJson(),
|
|
58
|
-
default: { payer: "agent-owner", tryInOrder: [{ kind: "harness-owned" }] }
|
|
59
|
-
},
|
|
60
|
-
permissionMode: permissionModeJson(Object.values(remotePermissionModeSchema.enum)),
|
|
61
|
-
instructions: instructionsJson(),
|
|
62
|
-
allowedTools: { type: "array", title: "Allowed tools", items: { type: "string" } }
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
const REMOTE_CLAUDE_CODE_DESCRIPTION = {
|
|
66
|
-
configSchema: REMOTE_CLAUDE_CODE_CONFIG_JSON_SCHEMA,
|
|
67
|
-
acp: {
|
|
68
|
-
transports: [AcpTransport.Ws, AcpTransport.Http],
|
|
69
|
-
mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio]
|
|
70
|
-
},
|
|
71
|
-
// Claude Code's own tools on your host, switched through its allow-lists.
|
|
72
|
-
baseTools: {
|
|
73
|
-
[BaseCapability.Shell]: {
|
|
74
|
-
provision: BaseToolProvision.HostDisableable,
|
|
75
|
-
nativeTools: ["Bash", "BashOutput", "KillShell"]
|
|
76
|
-
},
|
|
77
|
-
[BaseCapability.Files]: {
|
|
78
|
-
provision: BaseToolProvision.HostDisableable,
|
|
79
|
-
nativeTools: ["Read", "Write", "Edit", "Glob", "Grep", "NotebookEdit"]
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
// Other bound targets reach it as the sandbox MCP projection.
|
|
83
|
-
consumes: [SandboxWire.Mcp],
|
|
84
|
-
inference: {
|
|
85
|
-
vendors: [ModelVendor.Anthropic],
|
|
86
|
-
kinds: [
|
|
87
|
-
InferenceCredentialKind.HarnessOwned,
|
|
88
|
-
InferenceCredentialKind.Subscription,
|
|
89
|
-
InferenceCredentialKind.ApiKey,
|
|
90
|
-
InferenceCredentialKind.Platform
|
|
91
|
-
],
|
|
92
|
-
delivery: CredentialDelivery.AtOpen
|
|
93
|
-
},
|
|
94
|
-
supports: {
|
|
95
|
-
observe: true,
|
|
96
|
-
resumeReplay: true,
|
|
97
|
-
fork: true,
|
|
98
|
-
authorMeta: true,
|
|
99
|
-
nativeToolPolicy: false
|
|
100
|
-
},
|
|
101
|
-
promptWhileRunning: PromptWhileRunning.Inject,
|
|
102
|
-
sessionSurvivesDisconnect: true
|
|
103
|
-
};
|
|
104
|
-
const remoteClaudeCode = (config) => harnessBinding(SPECIFIER, config);
|
|
105
|
-
export {
|
|
106
|
-
REMOTE_CLAUDE_CODE_CONFIG_JSON_SCHEMA,
|
|
107
|
-
REMOTE_CLAUDE_CODE_DESCRIPTION,
|
|
108
|
-
SPECIFIER,
|
|
109
|
-
remoteClaudeCode,
|
|
110
|
-
remoteClaudeCodeConfigSchema,
|
|
111
|
-
remotePermissionModeSchema
|
|
112
|
-
};
|
|
113
|
-
//# sourceMappingURL=remote-claude-code.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 { 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\n// Auto-review is the nanocode Claude engine's; the Claude Code CLI behind the adapter takes\n// the other modes.\nexport const remotePermissionModeSchema = z.nativeEnum(ClaudePermissionMode).exclude(['Auto']);\n\nexport type RemoteClaudePermissionMode = z.output<typeof remotePermissionModeSchema>;\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: remotePermissionModeSchema.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(remotePermissionModeSchema.enum)),\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?: RemoteClaudePermissionMode | `${RemoteClaudePermissionMode}`;\n instructions?: InstructionInput[];\n allowedTools?: string[];\n}\n\nexport const remoteClaudeCode = (\n config: RemoteClaudeCodeConfigInputIface,\n): HarnessBindingOutputIface => harnessBinding(SPECIFIER, config);\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { HarnessClientTlsIface, SecretReaderIface } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { type SecretRefIface } from "./config-fields.mjs";
|
|
4
|
-
export interface RemoteClientTlsInputIface {
|
|
5
|
-
cert: SecretRefIface;
|
|
6
|
-
key: SecretRefIface;
|
|
7
|
-
ca?: SecretRefIface;
|
|
8
|
-
}
|
|
9
|
-
export declare const remoteClientTlsSchema: z.ZodObject<{
|
|
10
|
-
cert: z.ZodObject<{
|
|
11
|
-
secretKey: z.ZodString;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
key: z.ZodObject<{
|
|
14
|
-
secretKey: z.ZodString;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
ca: z.ZodOptional<z.ZodObject<{
|
|
17
|
-
secretKey: z.ZodString;
|
|
18
|
-
}, z.core.$strip>>;
|
|
19
|
-
}, z.core.$strict>;
|
|
20
|
-
export declare const remoteClientTlsJson: () => {
|
|
21
|
-
type: string;
|
|
22
|
-
title: string;
|
|
23
|
-
required: string[];
|
|
24
|
-
additionalProperties: boolean;
|
|
25
|
-
properties: {
|
|
26
|
-
cert: import("@finalai/agent-provider").JsonObject;
|
|
27
|
-
key: import("@finalai/agent-provider").JsonObject;
|
|
28
|
-
ca: import("@finalai/agent-provider").JsonObject;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export declare const resolveRemoteClientTls: (args: {
|
|
32
|
-
config: RemoteClientTlsInputIface | null | undefined;
|
|
33
|
-
secrets: SecretReaderIface;
|
|
34
|
-
url: string;
|
|
35
|
-
}) => Promise<HarnessClientTlsIface | undefined>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { secretRefJson, secretRefZod } from "./config-fields.mjs";
|
|
3
|
-
const remoteClientTlsSchema = z.strictObject({
|
|
4
|
-
cert: secretRefZod(),
|
|
5
|
-
key: secretRefZod(),
|
|
6
|
-
ca: secretRefZod().optional()
|
|
7
|
-
});
|
|
8
|
-
const remoteClientTlsJson = () => ({
|
|
9
|
-
type: "object",
|
|
10
|
-
title: "Client TLS",
|
|
11
|
-
required: ["cert", "key"],
|
|
12
|
-
additionalProperties: false,
|
|
13
|
-
properties: { cert: secretRefJson(), key: secretRefJson(), ca: secretRefJson() }
|
|
14
|
-
});
|
|
15
|
-
const resolveRemoteClientTls = async (args) => {
|
|
16
|
-
if (args.config == null) return void 0;
|
|
17
|
-
if (!["https:", "wss:"].includes(new URL(args.url).protocol))
|
|
18
|
-
throw new Error("Client TLS requires a secure harness endpoint");
|
|
19
|
-
const read = async (ref) => {
|
|
20
|
-
const value = await args.secrets.get(ref.secretKey);
|
|
21
|
-
if (value == null || value.length === 0)
|
|
22
|
-
throw new Error(`Client TLS secret '${ref.secretKey}' is not bound`);
|
|
23
|
-
return value;
|
|
24
|
-
};
|
|
25
|
-
const tls = {
|
|
26
|
-
cert: await read(args.config.cert),
|
|
27
|
-
key: await read(args.config.key)
|
|
28
|
-
};
|
|
29
|
-
if (args.config.ca != null) tls.ca = await read(args.config.ca);
|
|
30
|
-
return tls;
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
remoteClientTlsJson,
|
|
34
|
-
remoteClientTlsSchema,
|
|
35
|
-
resolveRemoteClientTls
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=remote-client-tls.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/harnesses/remote-client-tls.ts"],
|
|
4
|
-
"sourcesContent": ["import type { HarnessClientTlsIface, SecretReaderIface } from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport { secretRefJson, secretRefZod, type SecretRefIface } from \"./config-fields.mjs\";\n\nexport interface RemoteClientTlsInputIface {\n cert: SecretRefIface;\n key: SecretRefIface;\n ca?: SecretRefIface;\n}\n\nexport const remoteClientTlsSchema = z.strictObject({\n cert: secretRefZod(),\n key: secretRefZod(),\n ca: secretRefZod().optional(),\n});\n\nexport const remoteClientTlsJson = () => ({\n type: 'object',\n title: 'Client TLS',\n required: ['cert', 'key'],\n additionalProperties: false,\n properties: { cert: secretRefJson(), key: secretRefJson(), ca: secretRefJson() },\n});\n\nexport const resolveRemoteClientTls = async (args: {\n config: RemoteClientTlsInputIface | null | undefined;\n secrets: SecretReaderIface;\n url: string;\n}): Promise<HarnessClientTlsIface | undefined> => {\n if (args.config == null) return undefined;\n if (!['https:', 'wss:'].includes(new URL(args.url).protocol))\n throw new Error('Client TLS requires a secure harness endpoint');\n const read = async (ref: SecretRefIface) => {\n const value = await args.secrets.get(ref.secretKey);\n if (value == null || value.length === 0)\n throw new Error(`Client TLS secret '${ref.secretKey}' is not bound`);\n return value;\n };\n const tls: HarnessClientTlsIface = {\n cert: await read(args.config.cert),\n key: await read(args.config.key),\n };\n if (args.config.ca != null) tls.ca = await read(args.config.ca);\n return tls;\n};\n"],
|
|
5
|
-
"mappings": "AACA,YAAY,OAAO;AACnB,SAAS,eAAe,oBAAyC;AAQ1D,MAAM,wBAAwB,EAAE,aAAa;AAAA,EAClD,MAAM,aAAa;AAAA,EACnB,KAAK,aAAa;AAAA,EAClB,IAAI,aAAa,EAAE,SAAS;AAC9B,CAAC;AAEM,MAAM,sBAAsB,OAAO;AAAA,EACxC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU,CAAC,QAAQ,KAAK;AAAA,EACxB,sBAAsB;AAAA,EACtB,YAAY,EAAE,MAAM,cAAc,GAAG,KAAK,cAAc,GAAG,IAAI,cAAc,EAAE;AACjF;AAEO,MAAM,yBAAyB,OAAO,SAIK;AAChD,MAAI,KAAK,UAAU,KAAM,QAAO;AAChC,MAAI,CAAC,CAAC,UAAU,MAAM,EAAE,SAAS,IAAI,IAAI,KAAK,GAAG,EAAE,QAAQ;AACzD,UAAM,IAAI,MAAM,+CAA+C;AACjE,QAAM,OAAO,OAAO,QAAwB;AAC1C,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,IAAI,SAAS;AAClD,QAAI,SAAS,QAAQ,MAAM,WAAW;AACpC,YAAM,IAAI,MAAM,sBAAsB,IAAI,SAAS,gBAAgB;AACrE,WAAO;AAAA,EACT;AACA,QAAM,MAA6B;AAAA,IACjC,MAAM,MAAM,KAAK,KAAK,OAAO,IAAI;AAAA,IACjC,KAAK,MAAM,KAAK,KAAK,OAAO,GAAG;AAAA,EACjC;AACA,MAAI,KAAK,OAAO,MAAM,KAAM,KAAI,KAAK,MAAM,KAAK,KAAK,OAAO,EAAE;AAC9D,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { CodexApprovalPolicy, CodexSandboxMode, type CredentialsInput, type HarnessBindingOutputIface, type InstructionInput, type SecretRefIface, type SkillInput } from "./config-fields.mjs";
|
|
4
|
-
import { type RemoteClientTlsInputIface } from "./remote-client-tls.mjs";
|
|
5
|
-
import { CODEX_REASONING_LEVELS } from "./serverless-nanocode-codex.mjs";
|
|
6
|
-
export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/remote-codex";
|
|
7
|
-
export declare const approvalPolicySchema: z.ZodEnum<{
|
|
8
|
-
readonly Untrusted: CodexApprovalPolicy.Untrusted;
|
|
9
|
-
readonly OnRequest: CodexApprovalPolicy.OnRequest;
|
|
10
|
-
readonly Never: CodexApprovalPolicy.Never;
|
|
11
|
-
}>;
|
|
12
|
-
export type RemoteCodexApprovalPolicy = z.output<typeof approvalPolicySchema>;
|
|
13
|
-
export declare const remoteCodexConfigSchema: z.ZodObject<{
|
|
14
|
-
url: z.ZodString;
|
|
15
|
-
tls: z.ZodOptional<z.ZodObject<{
|
|
16
|
-
cert: z.ZodObject<{
|
|
17
|
-
secretKey: z.ZodString;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
key: z.ZodObject<{
|
|
20
|
-
secretKey: z.ZodString;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
ca: z.ZodOptional<z.ZodObject<{
|
|
23
|
-
secretKey: z.ZodString;
|
|
24
|
-
}, z.core.$strip>>;
|
|
25
|
-
}, z.core.$strict>>;
|
|
26
|
-
hop: z.ZodObject<{
|
|
27
|
-
secretKey: z.ZodString;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
30
|
-
executable: z.ZodOptional<z.ZodString>;
|
|
31
|
-
model: z.ZodOptional<z.ZodString>;
|
|
32
|
-
reasoning: z.ZodOptional<z.ZodEnum<typeof import("./config-fields.mjs").ReasoningLevel>>;
|
|
33
|
-
credentials: z.ZodObject<{
|
|
34
|
-
payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
|
|
35
|
-
tryInOrder: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
36
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Subscription>;
|
|
37
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
38
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
39
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
40
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
42
|
-
secret: z.ZodString;
|
|
43
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
44
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
45
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
47
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
48
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
49
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
50
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Platform>;
|
|
52
|
-
budget: z.ZodOptional<z.ZodString>;
|
|
53
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.HarnessOwned>;
|
|
55
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Custom>;
|
|
57
|
-
resolver: z.ZodString;
|
|
58
|
-
events: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("@finalai/agent-provider").DynamicEvent>>>;
|
|
59
|
-
}, z.core.$strip>]>>;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
|
-
approvalPolicy: z.ZodOptional<z.ZodEnum<{
|
|
62
|
-
readonly Untrusted: CodexApprovalPolicy.Untrusted;
|
|
63
|
-
readonly OnRequest: CodexApprovalPolicy.OnRequest;
|
|
64
|
-
readonly Never: CodexApprovalPolicy.Never;
|
|
65
|
-
}>>;
|
|
66
|
-
sandboxMode: z.ZodOptional<z.ZodEnum<typeof CodexSandboxMode>>;
|
|
67
|
-
instructions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
68
|
-
role: z.ZodEnum<typeof import("@finalai/agent-provider").InstructionRole>;
|
|
69
|
-
content: z.ZodString;
|
|
70
|
-
source: z.ZodOptional<z.ZodString>;
|
|
71
|
-
}, z.core.$strip>>>;
|
|
72
|
-
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
73
|
-
key: z.ZodString;
|
|
74
|
-
description: z.ZodOptional<z.ZodString>;
|
|
75
|
-
files: z.ZodArray<z.ZodObject<{
|
|
76
|
-
path: z.ZodString;
|
|
77
|
-
content: z.ZodString;
|
|
78
|
-
}, z.core.$strip>>;
|
|
79
|
-
}, z.core.$strip>>>;
|
|
80
|
-
}, z.core.$strict>;
|
|
81
|
-
export type RemoteCodexConfigIface = z.output<typeof remoteCodexConfigSchema>;
|
|
82
|
-
export declare const REMOTE_CODEX_CONFIG_JSON_SCHEMA: JsonSchema;
|
|
83
|
-
export declare const REMOTE_CODEX_DESCRIPTION: HarnessDescriptionIface;
|
|
84
|
-
export interface RemoteCodexConfigInputIface {
|
|
85
|
-
url: string;
|
|
86
|
-
tls?: RemoteClientTlsInputIface;
|
|
87
|
-
hop: SecretRefIface;
|
|
88
|
-
cwd?: string;
|
|
89
|
-
executable?: string;
|
|
90
|
-
model?: string;
|
|
91
|
-
reasoning?: (typeof CODEX_REASONING_LEVELS)[number] | `${(typeof CODEX_REASONING_LEVELS)[number]}`;
|
|
92
|
-
credentials: CredentialsInput;
|
|
93
|
-
approvalPolicy?: RemoteCodexApprovalPolicy | `${RemoteCodexApprovalPolicy}`;
|
|
94
|
-
sandboxMode?: CodexSandboxMode | `${CodexSandboxMode}`;
|
|
95
|
-
instructions?: InstructionInput[];
|
|
96
|
-
skills?: SkillInput[];
|
|
97
|
-
}
|
|
98
|
-
export declare const remoteCodex: (config: RemoteCodexConfigInputIface) => HarnessBindingOutputIface;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AcpTransport,
|
|
3
|
-
BaseCapability,
|
|
4
|
-
BaseToolProvision,
|
|
5
|
-
CredentialDelivery,
|
|
6
|
-
InferenceCredentialKind,
|
|
7
|
-
McpTransportKind,
|
|
8
|
-
PromptWhileRunning,
|
|
9
|
-
SandboxWire
|
|
10
|
-
} from "@finalai/agent-provider";
|
|
11
|
-
import * as z from "zod";
|
|
12
|
-
import {
|
|
13
|
-
absolutePathJson,
|
|
14
|
-
absolutePathZod,
|
|
15
|
-
CodexApprovalPolicy,
|
|
16
|
-
CodexSandboxMode,
|
|
17
|
-
configObjectJson,
|
|
18
|
-
credentialsJson,
|
|
19
|
-
credentialsZod,
|
|
20
|
-
harnessBinding,
|
|
21
|
-
instructionsJson,
|
|
22
|
-
instructionsZod,
|
|
23
|
-
permissionModeJson,
|
|
24
|
-
reasoningJson,
|
|
25
|
-
reasoningZod,
|
|
26
|
-
secretRefJson,
|
|
27
|
-
secretRefZod,
|
|
28
|
-
skillsJson,
|
|
29
|
-
skillsZod
|
|
30
|
-
} from "./config-fields.mjs";
|
|
31
|
-
import { ModelVendor } from "./model-reference.mjs";
|
|
32
|
-
import {
|
|
33
|
-
remoteClientTlsJson,
|
|
34
|
-
remoteClientTlsSchema
|
|
35
|
-
} from "./remote-client-tls.mjs";
|
|
36
|
-
import { remoteUrlJson, remoteUrlZod } from "./remote-url.mjs";
|
|
37
|
-
import { CODEX_REASONING_LEVELS } from "./serverless-nanocode-codex.mjs";
|
|
38
|
-
const SPECIFIER = "@finalai/final-agent-provider/harnesses/remote-codex";
|
|
39
|
-
const approvalPolicySchema = z.nativeEnum(CodexApprovalPolicy).exclude(["OnFailure"]);
|
|
40
|
-
const remoteCodexConfigSchema = z.strictObject({
|
|
41
|
-
url: remoteUrlZod(),
|
|
42
|
-
tls: remoteClientTlsSchema.optional(),
|
|
43
|
-
hop: secretRefZod(),
|
|
44
|
-
cwd: absolutePathZod().optional(),
|
|
45
|
-
executable: z.string().min(1).optional(),
|
|
46
|
-
model: z.string().min(1).optional(),
|
|
47
|
-
reasoning: reasoningZod(CODEX_REASONING_LEVELS).optional(),
|
|
48
|
-
credentials: credentialsZod(),
|
|
49
|
-
approvalPolicy: approvalPolicySchema.optional(),
|
|
50
|
-
sandboxMode: z.nativeEnum(CodexSandboxMode).optional(),
|
|
51
|
-
instructions: instructionsZod(),
|
|
52
|
-
skills: skillsZod()
|
|
53
|
-
});
|
|
54
|
-
const REMOTE_CODEX_CONFIG_JSON_SCHEMA = configObjectJson({
|
|
55
|
-
title: "Codex (your host)",
|
|
56
|
-
required: ["credentials", "url", "hop"],
|
|
57
|
-
properties: {
|
|
58
|
-
url: remoteUrlJson("Runtime URL"),
|
|
59
|
-
tls: remoteClientTlsJson(),
|
|
60
|
-
hop: secretRefJson(),
|
|
61
|
-
cwd: absolutePathJson("Working directory on your host"),
|
|
62
|
-
executable: { type: "string", title: "Installed executable on your host" },
|
|
63
|
-
model: { $ref: "final://schemas/model-picker" },
|
|
64
|
-
reasoning: reasoningJson(CODEX_REASONING_LEVELS),
|
|
65
|
-
credentials: {
|
|
66
|
-
...credentialsJson(),
|
|
67
|
-
default: { payer: "agent-owner", tryInOrder: [{ kind: "harness-owned" }] }
|
|
68
|
-
},
|
|
69
|
-
approvalPolicy: permissionModeJson(Object.values(approvalPolicySchema.enum)),
|
|
70
|
-
sandboxMode: {
|
|
71
|
-
type: "string",
|
|
72
|
-
title: "Sandbox mode",
|
|
73
|
-
enum: Object.values(CodexSandboxMode)
|
|
74
|
-
},
|
|
75
|
-
instructions: instructionsJson(),
|
|
76
|
-
skills: skillsJson()
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const REMOTE_CODEX_DESCRIPTION = {
|
|
80
|
-
configSchema: REMOTE_CODEX_CONFIG_JSON_SCHEMA,
|
|
81
|
-
acp: {
|
|
82
|
-
transports: [AcpTransport.Ws, AcpTransport.Http],
|
|
83
|
-
// ACP servers are bridged by the runtime and reach Codex as dynamic tools.
|
|
84
|
-
mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio]
|
|
85
|
-
},
|
|
86
|
-
// Codex's own tools on your host, under sandboxMode.
|
|
87
|
-
baseTools: {
|
|
88
|
-
[BaseCapability.Shell]: {
|
|
89
|
-
provision: BaseToolProvision.HostDisableable,
|
|
90
|
-
nativeTools: ["exec_command", "write_stdin"]
|
|
91
|
-
},
|
|
92
|
-
[BaseCapability.Files]: {
|
|
93
|
-
provision: BaseToolProvision.HostDisableable,
|
|
94
|
-
nativeTools: ["apply_patch"]
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
consumes: [SandboxWire.Mcp],
|
|
98
|
-
inference: {
|
|
99
|
-
vendors: [ModelVendor.OpenAI],
|
|
100
|
-
kinds: [
|
|
101
|
-
InferenceCredentialKind.HarnessOwned,
|
|
102
|
-
InferenceCredentialKind.Subscription,
|
|
103
|
-
InferenceCredentialKind.ApiKey,
|
|
104
|
-
InferenceCredentialKind.Platform
|
|
105
|
-
],
|
|
106
|
-
delivery: CredentialDelivery.AtOpen
|
|
107
|
-
},
|
|
108
|
-
// No observe: group routing falls back to prompts with replyExpected: false.
|
|
109
|
-
supports: {
|
|
110
|
-
observe: false,
|
|
111
|
-
resumeReplay: true,
|
|
112
|
-
fork: false,
|
|
113
|
-
authorMeta: true,
|
|
114
|
-
nativeToolPolicy: false
|
|
115
|
-
},
|
|
116
|
-
promptWhileRunning: PromptWhileRunning.Inject,
|
|
117
|
-
sessionSurvivesDisconnect: true
|
|
118
|
-
};
|
|
119
|
-
const remoteCodex = (config) => harnessBinding(SPECIFIER, config);
|
|
120
|
-
export {
|
|
121
|
-
REMOTE_CODEX_CONFIG_JSON_SCHEMA,
|
|
122
|
-
REMOTE_CODEX_DESCRIPTION,
|
|
123
|
-
SPECIFIER,
|
|
124
|
-
approvalPolicySchema,
|
|
125
|
-
remoteCodex,
|
|
126
|
-
remoteCodexConfigSchema
|
|
127
|
-
};
|
|
128
|
-
//# sourceMappingURL=remote-codex.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 { 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,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,sBAAsB,EAAE,SAAS;AAAA,EACzD,aAAa,eAAe;AAAA,EAC5B,gBAAgB,qBAAqB,SAAS;AAAA,EAC9C,aAAa,EAAE,WAAW,gBAAgB,EAAE,SAAS;AAAA,EACrD,cAAc,gBAAgB;AAAA,EAC9B,QAAQ,UAAU;AACpB,CAAC;AAIM,MAAM,kCAA8C,iBAAiB;AAAA,EAC1E,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,sBAAsB;AAAA,IAC/C,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,qBAAqB,IAAI,CAAC;AAAA,IAC3E,aAAa;AAAA,MACX,MAAM;AAAA,MACN,OAAO;AAAA,MACP,MAAM,OAAO,OAAO,gBAAgB;AAAA,IACtC;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B,QAAQ,WAAW;AAAA,EACrB;AACF,CAAC;AAEM,MAAM,2BAAoD;AAAA,EAC/D,cAAc;AAAA,EACd,KAAK;AAAA,IACH,YAAY,CAAC,aAAa,IAAI,aAAa,IAAI;AAAA;AAAA,IAE/C,KAAK,CAAC,iBAAiB,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
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { PiPermissionMode, type CredentialsInput, type HarnessBindingOutputIface, type InstructionInput, type SecretRefIface } from "./config-fields.mjs";
|
|
4
|
-
import { type RemoteClientTlsInputIface } from "./remote-client-tls.mjs";
|
|
5
|
-
import { PI_REASONING_LEVELS } from "./serverless-pi.mjs";
|
|
6
|
-
export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/remote-pi";
|
|
7
|
-
export declare const remotePiConfigSchema: z.ZodObject<{
|
|
8
|
-
url: z.ZodString;
|
|
9
|
-
tls: z.ZodOptional<z.ZodObject<{
|
|
10
|
-
cert: z.ZodObject<{
|
|
11
|
-
secretKey: z.ZodString;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
key: z.ZodObject<{
|
|
14
|
-
secretKey: z.ZodString;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
ca: z.ZodOptional<z.ZodObject<{
|
|
17
|
-
secretKey: z.ZodString;
|
|
18
|
-
}, z.core.$strip>>;
|
|
19
|
-
}, z.core.$strict>>;
|
|
20
|
-
hop: z.ZodObject<{
|
|
21
|
-
secretKey: z.ZodString;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
24
|
-
executable: z.ZodOptional<z.ZodString>;
|
|
25
|
-
model: z.ZodOptional<z.ZodString>;
|
|
26
|
-
reasoning: z.ZodOptional<z.ZodEnum<typeof import("./config-fields.mjs").ReasoningLevel>>;
|
|
27
|
-
credentials: z.ZodObject<{
|
|
28
|
-
payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
|
|
29
|
-
tryInOrder: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
30
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Subscription>;
|
|
31
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
32
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
33
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
34
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
36
|
-
secret: z.ZodString;
|
|
37
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
38
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
41
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
42
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
43
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
44
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Platform>;
|
|
46
|
-
budget: z.ZodOptional<z.ZodString>;
|
|
47
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.HarnessOwned>;
|
|
49
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Custom>;
|
|
51
|
-
resolver: z.ZodString;
|
|
52
|
-
events: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("@finalai/agent-provider").DynamicEvent>>>;
|
|
53
|
-
}, z.core.$strip>]>>;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
permissionMode: z.ZodOptional<z.ZodEnum<typeof PiPermissionMode>>;
|
|
56
|
-
instructions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
57
|
-
role: z.ZodEnum<typeof import("@finalai/agent-provider").InstructionRole>;
|
|
58
|
-
content: z.ZodString;
|
|
59
|
-
source: z.ZodOptional<z.ZodString>;
|
|
60
|
-
}, z.core.$strip>>>;
|
|
61
|
-
}, z.core.$strict>;
|
|
62
|
-
export type RemotePiConfigIface = z.output<typeof remotePiConfigSchema>;
|
|
63
|
-
export declare const REMOTE_PI_CONFIG_JSON_SCHEMA: JsonSchema;
|
|
64
|
-
export declare const REMOTE_PI_BASE_TOOLS: HarnessDescriptionIface['baseTools'];
|
|
65
|
-
export declare const REMOTE_PI_DESCRIPTION: HarnessDescriptionIface;
|
|
66
|
-
export interface RemotePiConfigInputIface {
|
|
67
|
-
url: string;
|
|
68
|
-
tls?: RemoteClientTlsInputIface;
|
|
69
|
-
hop: SecretRefIface;
|
|
70
|
-
cwd?: string;
|
|
71
|
-
executable?: string;
|
|
72
|
-
model?: string;
|
|
73
|
-
reasoning?: (typeof PI_REASONING_LEVELS)[number] | `${(typeof PI_REASONING_LEVELS)[number]}`;
|
|
74
|
-
credentials: CredentialsInput;
|
|
75
|
-
permissionMode?: PiPermissionMode | `${PiPermissionMode}`;
|
|
76
|
-
instructions?: InstructionInput[];
|
|
77
|
-
}
|
|
78
|
-
export declare const remotePi: (config: RemotePiConfigInputIface) => HarnessBindingOutputIface;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AcpTransport,
|
|
3
|
-
BaseToolProvision,
|
|
4
|
-
CredentialDelivery,
|
|
5
|
-
InferenceCredentialKind,
|
|
6
|
-
McpTransportKind,
|
|
7
|
-
PromptWhileRunning,
|
|
8
|
-
SandboxWire
|
|
9
|
-
} from "@finalai/agent-provider";
|
|
10
|
-
import * as z from "zod";
|
|
11
|
-
import {
|
|
12
|
-
absolutePathJson,
|
|
13
|
-
absolutePathZod,
|
|
14
|
-
configObjectJson,
|
|
15
|
-
credentialsJson,
|
|
16
|
-
credentialsZod,
|
|
17
|
-
harnessBinding,
|
|
18
|
-
instructionsJson,
|
|
19
|
-
instructionsZod,
|
|
20
|
-
permissionModeJson,
|
|
21
|
-
PiPermissionMode,
|
|
22
|
-
reasoningJson,
|
|
23
|
-
reasoningZod,
|
|
24
|
-
secretRefJson,
|
|
25
|
-
secretRefZod
|
|
26
|
-
} from "./config-fields.mjs";
|
|
27
|
-
import { ModelVendor } from "./model-reference.mjs";
|
|
28
|
-
import {
|
|
29
|
-
remoteClientTlsJson,
|
|
30
|
-
remoteClientTlsSchema
|
|
31
|
-
} from "./remote-client-tls.mjs";
|
|
32
|
-
import { remoteUrlJson, remoteUrlZod } from "./remote-url.mjs";
|
|
33
|
-
import { PI_BASE_TOOLS, PI_REASONING_LEVELS } from "./serverless-pi.mjs";
|
|
34
|
-
const SPECIFIER = "@finalai/final-agent-provider/harnesses/remote-pi";
|
|
35
|
-
const remotePiConfigSchema = z.strictObject({
|
|
36
|
-
url: remoteUrlZod(),
|
|
37
|
-
tls: remoteClientTlsSchema.optional(),
|
|
38
|
-
hop: secretRefZod(),
|
|
39
|
-
cwd: absolutePathZod().optional(),
|
|
40
|
-
executable: z.string().min(1).optional(),
|
|
41
|
-
model: z.string().min(1).optional(),
|
|
42
|
-
reasoning: reasoningZod(PI_REASONING_LEVELS).optional(),
|
|
43
|
-
credentials: credentialsZod(),
|
|
44
|
-
permissionMode: z.nativeEnum(PiPermissionMode).optional(),
|
|
45
|
-
instructions: instructionsZod()
|
|
46
|
-
});
|
|
47
|
-
const REMOTE_PI_CONFIG_JSON_SCHEMA = configObjectJson({
|
|
48
|
-
title: "Pi (your host)",
|
|
49
|
-
required: ["credentials", "url", "hop"],
|
|
50
|
-
properties: {
|
|
51
|
-
url: remoteUrlJson("Runtime URL"),
|
|
52
|
-
tls: remoteClientTlsJson(),
|
|
53
|
-
hop: secretRefJson(),
|
|
54
|
-
cwd: absolutePathJson("Working directory on your host"),
|
|
55
|
-
executable: { type: "string", title: "Installed executable on your host" },
|
|
56
|
-
model: { $ref: "final://schemas/model-picker" },
|
|
57
|
-
reasoning: reasoningJson(PI_REASONING_LEVELS),
|
|
58
|
-
credentials: {
|
|
59
|
-
...credentialsJson(),
|
|
60
|
-
default: { payer: "agent-owner", tryInOrder: [{ kind: "harness-owned" }] }
|
|
61
|
-
},
|
|
62
|
-
permissionMode: permissionModeJson(Object.values(PiPermissionMode)),
|
|
63
|
-
instructions: instructionsJson()
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
const REMOTE_PI_BASE_TOOLS = Object.fromEntries(
|
|
67
|
-
Object.entries(PI_BASE_TOOLS).map(([capability, declaration]) => [
|
|
68
|
-
capability,
|
|
69
|
-
{ ...declaration, provision: BaseToolProvision.HostDisableable }
|
|
70
|
-
])
|
|
71
|
-
);
|
|
72
|
-
const REMOTE_PI_DESCRIPTION = {
|
|
73
|
-
configSchema: REMOTE_PI_CONFIG_JSON_SCHEMA,
|
|
74
|
-
acp: {
|
|
75
|
-
transports: [AcpTransport.Ws, AcpTransport.Http],
|
|
76
|
-
mcp: [McpTransportKind.Acp, McpTransportKind.Http, McpTransportKind.Stdio]
|
|
77
|
-
},
|
|
78
|
-
// Pi's own tools stay on your host; bound targets are additive MCP servers.
|
|
79
|
-
baseTools: REMOTE_PI_BASE_TOOLS,
|
|
80
|
-
consumes: [SandboxWire.Mcp],
|
|
81
|
-
// Explicit Final credentials are delivered at open; omission keeps the user login.
|
|
82
|
-
inference: {
|
|
83
|
-
vendors: [ModelVendor.OpenRouter, ModelVendor.OpenAI, ModelVendor.Anthropic],
|
|
84
|
-
kinds: [
|
|
85
|
-
InferenceCredentialKind.HarnessOwned,
|
|
86
|
-
InferenceCredentialKind.ApiKey,
|
|
87
|
-
InferenceCredentialKind.Platform
|
|
88
|
-
],
|
|
89
|
-
delivery: CredentialDelivery.AtOpen
|
|
90
|
-
},
|
|
91
|
-
supports: { observe: true, resumeReplay: true, fork: false, authorMeta: true },
|
|
92
|
-
promptWhileRunning: PromptWhileRunning.Inject,
|
|
93
|
-
sessionSurvivesDisconnect: true
|
|
94
|
-
};
|
|
95
|
-
const remotePi = (config) => harnessBinding(SPECIFIER, config);
|
|
96
|
-
export {
|
|
97
|
-
REMOTE_PI_BASE_TOOLS,
|
|
98
|
-
REMOTE_PI_CONFIG_JSON_SCHEMA,
|
|
99
|
-
REMOTE_PI_DESCRIPTION,
|
|
100
|
-
SPECIFIER,
|
|
101
|
-
remotePi,
|
|
102
|
-
remotePiConfigSchema
|
|
103
|
-
};
|
|
104
|
-
//# sourceMappingURL=remote-pi.mjs.map
|