@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,53 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConversationKind,
|
|
3
|
-
Delivery,
|
|
4
|
-
ParticipantKind,
|
|
5
|
-
RoutingMode
|
|
6
|
-
} from "@finalai/agent-provider/room-surface";
|
|
7
|
-
const MAX_AGENT_HOP_DEPTH = 2;
|
|
8
|
-
const activeAgents = (participants) => participants.filter(
|
|
9
|
-
(participant) => participant.kind === ParticipantKind.Agent && !participant.left
|
|
10
|
-
);
|
|
11
|
-
const effectiveDefaultAgent = (participants) => {
|
|
12
|
-
const agents = activeAgents(participants);
|
|
13
|
-
return agents.find((agent) => agent.routingMode === RoutingMode.Default) ?? agents.find((agent) => agent.routingMode === RoutingMode.All) ?? null;
|
|
14
|
-
};
|
|
15
|
-
const routeMessage = (args) => {
|
|
16
|
-
const { conversation, message, participants } = args;
|
|
17
|
-
const agents = activeAgents(participants).filter(
|
|
18
|
-
(agent) => agent.id !== message.authorParticipantId && (message.agentAuthorDefinitionId == null || agent.definitionId !== message.agentAuthorDefinitionId)
|
|
19
|
-
);
|
|
20
|
-
if (agents.length === 0) {
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
const mentioned = new Set(message.mentionedParticipantIds);
|
|
24
|
-
const mayPrompt = message.hopDepth < MAX_AGENT_HOP_DEPTH;
|
|
25
|
-
const promptDelivery = mayPrompt ? Delivery.Prompt : Delivery.Observe;
|
|
26
|
-
if (conversation.kind === ConversationKind.Direct) {
|
|
27
|
-
return agents.map((agent) => ({ participantId: agent.id, delivery: promptDelivery }));
|
|
28
|
-
}
|
|
29
|
-
const anyAgentMentioned = agents.some((agent) => mentioned.has(agent.id));
|
|
30
|
-
const defaultAgent = effectiveDefaultAgent(participants);
|
|
31
|
-
return agents.flatMap((agent) => {
|
|
32
|
-
if (mentioned.has(agent.id)) {
|
|
33
|
-
return [{ participantId: agent.id, delivery: promptDelivery }];
|
|
34
|
-
}
|
|
35
|
-
if (agent.routingMode === RoutingMode.Mention || agent.routingMode == null) {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
if (!anyAgentMentioned && agent.id === defaultAgent?.id) {
|
|
39
|
-
return [{ participantId: agent.id, delivery: promptDelivery }];
|
|
40
|
-
}
|
|
41
|
-
return [{ participantId: agent.id, delivery: Delivery.Observe }];
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
const routeToParticipant = (participantId) => (args) => args.participants.some(
|
|
45
|
-
(participant) => participant.id === participantId && participant.kind === ParticipantKind.Agent && !participant.left
|
|
46
|
-
) ? [{ participantId, delivery: Delivery.Prompt }] : [];
|
|
47
|
-
export {
|
|
48
|
-
MAX_AGENT_HOP_DEPTH,
|
|
49
|
-
effectiveDefaultAgent,
|
|
50
|
-
routeMessage,
|
|
51
|
-
routeToParticipant
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=routing.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/channels/routing.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n ConversationKind,\n Delivery,\n ParticipantKind,\n RoutingMode,\n type ParticipantIface,\n type RouteArgsIface,\n type RouteDecisionIface,\n} from '@finalai/agent-provider/room-surface';\n\n// Agent-authored messages may prompt other agents only while the chain of\n// agent hops that produced them is shorter than this: a human\n// message (0) prompts A, A's reply (1) may prompt B, B's reply (2) prompts no one.\nexport const MAX_AGENT_HOP_DEPTH = 2;\n\nconst activeAgents = (participants: ParticipantIface[]): ParticipantIface[] =>\n participants.filter(\n (participant) => participant.kind === ParticipantKind.Agent && !participant.left,\n );\n\n// The agent a no-mention message goes to: the Default agent, else (no Default)\n// the earliest-joined All agent, which then acts as the Default. Participants\n// arrive in join order.\nexport const effectiveDefaultAgent = (\n participants: ParticipantIface[],\n): ParticipantIface | null => {\n const agents = activeAgents(participants);\n return (\n agents.find((agent) => agent.routingMode === RoutingMode.Default) ??\n agents.find((agent) => agent.routingMode === RoutingMode.All) ??\n null\n );\n};\n\n// Pure: who gets a message and how. Users never receive decisions.\nexport const routeMessage = (args: RouteArgsIface): RouteDecisionIface[] => {\n const { conversation, message, participants } = args;\n const agents = activeAgents(participants).filter(\n (agent) =>\n agent.id !== message.authorParticipantId &&\n (message.agentAuthorDefinitionId == null ||\n agent.definitionId !== message.agentAuthorDefinitionId),\n );\n if (agents.length === 0) {\n return [];\n }\n const mentioned = new Set(message.mentionedParticipantIds);\n const mayPrompt = message.hopDepth < MAX_AGENT_HOP_DEPTH;\n const promptDelivery = mayPrompt ? Delivery.Prompt : Delivery.Observe;\n\n if (conversation.kind === ConversationKind.Direct) {\n return agents.map((agent) => ({ participantId: agent.id, delivery: promptDelivery }));\n }\n\n const anyAgentMentioned = agents.some((agent) => mentioned.has(agent.id));\n const defaultAgent = effectiveDefaultAgent(participants);\n return agents.flatMap((agent): RouteDecisionIface[] => {\n if (mentioned.has(agent.id)) {\n return [{ participantId: agent.id, delivery: promptDelivery }];\n }\n if (agent.routingMode === RoutingMode.Mention || agent.routingMode == null) {\n return [];\n }\n if (!anyAgentMentioned && agent.id === defaultAgent?.id) {\n return [{ participantId: agent.id, delivery: promptDelivery }];\n }\n return [{ participantId: agent.id, delivery: Delivery.Observe }];\n });\n};\n\nexport const routeToParticipant =\n (participantId: string) =>\n (args: RouteArgsIface): RouteDecisionIface[] =>\n args.participants.some(\n (participant) =>\n participant.id === participantId &&\n participant.kind === ParticipantKind.Agent &&\n !participant.left,\n )\n ? [{ participantId, delivery: Delivery.Prompt }]\n : [];\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAKA,MAAM,sBAAsB;AAEnC,MAAM,eAAe,CAAC,iBACpB,aAAa;AAAA,EACX,CAAC,gBAAgB,YAAY,SAAS,gBAAgB,SAAS,CAAC,YAAY;AAC9E;AAKK,MAAM,wBAAwB,CACnC,iBAC4B;AAC5B,QAAM,SAAS,aAAa,YAAY;AACxC,SACE,OAAO,KAAK,CAAC,UAAU,MAAM,gBAAgB,YAAY,OAAO,KAChE,OAAO,KAAK,CAAC,UAAU,MAAM,gBAAgB,YAAY,GAAG,KAC5D;AAEJ;AAGO,MAAM,eAAe,CAAC,SAA+C;AAC1E,QAAM,EAAE,cAAc,SAAS,aAAa,IAAI;AAChD,QAAM,SAAS,aAAa,YAAY,EAAE;AAAA,IACxC,CAAC,UACC,MAAM,OAAO,QAAQ,wBACpB,QAAQ,2BAA2B,QAClC,MAAM,iBAAiB,QAAQ;AAAA,EACrC;AACA,MAAI,OAAO,WAAW,GAAG;AACvB,WAAO,CAAC;AAAA,EACV;AACA,QAAM,YAAY,IAAI,IAAI,QAAQ,uBAAuB;AACzD,QAAM,YAAY,QAAQ,WAAW;AACrC,QAAM,iBAAiB,YAAY,SAAS,SAAS,SAAS;AAE9D,MAAI,aAAa,SAAS,iBAAiB,QAAQ;AACjD,WAAO,OAAO,IAAI,CAAC,WAAW,EAAE,eAAe,MAAM,IAAI,UAAU,eAAe,EAAE;AAAA,EACtF;AAEA,QAAM,oBAAoB,OAAO,KAAK,CAAC,UAAU,UAAU,IAAI,MAAM,EAAE,CAAC;AACxE,QAAM,eAAe,sBAAsB,YAAY;AACvD,SAAO,OAAO,QAAQ,CAAC,UAAgC;AACrD,QAAI,UAAU,IAAI,MAAM,EAAE,GAAG;AAC3B,aAAO,CAAC,EAAE,eAAe,MAAM,IAAI,UAAU,eAAe,CAAC;AAAA,IAC/D;AACA,QAAI,MAAM,gBAAgB,YAAY,WAAW,MAAM,eAAe,MAAM;AAC1E,aAAO,CAAC;AAAA,IACV;AACA,QAAI,CAAC,qBAAqB,MAAM,OAAO,cAAc,IAAI;AACvD,aAAO,CAAC,EAAE,eAAe,MAAM,IAAI,UAAU,eAAe,CAAC;AAAA,IAC/D;AACA,WAAO,CAAC,EAAE,eAAe,MAAM,IAAI,UAAU,SAAS,QAAQ,CAAC;AAAA,EACjE,CAAC;AACH;AAEO,MAAM,qBACX,CAAC,kBACD,CAAC,SACC,KAAK,aAAa;AAAA,EAChB,CAAC,gBACC,YAAY,OAAO,iBACnB,YAAY,SAAS,gBAAgB,SACrC,CAAC,YAAY;AACjB,IACI,CAAC,EAAE,eAAe,UAAU,SAAS,OAAO,CAAC,IAC7C,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type DynamicSentinelIface, type HostedConnectionDefinitionIface, type McpClientConnectionDefinitionIface } from '@finalai/agent-definition/authoring';
|
|
2
|
-
export type FinalConnectionDefinitionIface = Omit<McpClientConnectionDefinitionIface, 'auth'>;
|
|
3
|
-
export interface FinalHostedConnectionDefinitionIface extends Omit<HostedConnectionDefinitionIface, 'binding'> {
|
|
4
|
-
readonly binding?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function defineFinalConnection<TConnection extends FinalConnectionDefinitionIface>(definition: TConnection): TConnection & {
|
|
7
|
-
readonly auth: {
|
|
8
|
-
readonly kind: 'final-session';
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare function defineFinalConnection(definition?: FinalHostedConnectionDefinitionIface): DynamicSentinelIface<McpClientConnectionDefinitionIface>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineMcpClientConnection,
|
|
3
|
-
defineHostedConnection
|
|
4
|
-
} from "@finalai/agent-definition/authoring";
|
|
5
|
-
function defineFinalConnection(definition = {}) {
|
|
6
|
-
if ("url" in definition)
|
|
7
|
-
return defineMcpClientConnection({ ...definition, auth: { kind: "final-session" } });
|
|
8
|
-
return defineHostedConnection({
|
|
9
|
-
...definition,
|
|
10
|
-
binding: definition.binding ?? "final"
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
defineFinalConnection
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=connections.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/connections.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n defineMcpClientConnection,\n defineHostedConnection,\n type DynamicSentinelIface,\n type HostedConnectionDefinitionIface,\n type McpClientConnectionDefinitionIface,\n} from '@finalai/agent-definition/authoring';\n\nexport type FinalConnectionDefinitionIface = Omit<McpClientConnectionDefinitionIface, 'auth'>;\n\nexport interface FinalHostedConnectionDefinitionIface extends Omit<\n HostedConnectionDefinitionIface,\n 'binding'\n> {\n readonly binding?: string;\n}\n\n// `connections/final.ts`: Final's MCP server as an ordinary connection. The\n// session service's broker resolves `final-session` auth to a grant scoped to\n// the calling session, which Final's MCP server runs the tools as.\nexport function defineFinalConnection<TConnection extends FinalConnectionDefinitionIface>(\n definition: TConnection,\n): TConnection & { readonly auth: { readonly kind: 'final-session' } };\nexport function defineFinalConnection(\n definition?: FinalHostedConnectionDefinitionIface,\n): DynamicSentinelIface<McpClientConnectionDefinitionIface>;\nexport function defineFinalConnection(\n definition: FinalConnectionDefinitionIface | FinalHostedConnectionDefinitionIface = {},\n): McpClientConnectionDefinitionIface | DynamicSentinelIface<McpClientConnectionDefinitionIface> {\n if ('url' in definition)\n return defineMcpClientConnection({ ...definition, auth: { kind: 'final-session' } });\n return defineHostedConnection({\n ...definition,\n binding: definition.binding ?? 'final',\n });\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AAoBA,SAAS,sBACd,aAAoF,CAAC,GACU;AAC/F,MAAI,SAAS;AACX,WAAO,0BAA0B,EAAE,GAAG,YAAY,MAAM,EAAE,MAAM,gBAAgB,EAAE,CAAC;AACrF,SAAO,uBAAuB;AAAA,IAC5B,GAAG;AAAA,IACH,SAAS,WAAW,WAAW;AAAA,EACjC,CAAC;AACH;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type InitializeResponse, type Stream } from '@agentclientprotocol/sdk/experimental/v2';
|
|
2
|
-
import { type AcpTransport, type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
3
|
-
export declare const FINAL_CLIENT_INFO: {
|
|
4
|
-
name: string;
|
|
5
|
-
version: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const DEFAULT_CONNECT_TIMEOUT_MS = 10000;
|
|
8
|
-
export declare const describeFromInitialize: (args: {
|
|
9
|
-
response: InitializeResponse;
|
|
10
|
-
transports: AcpTransport[];
|
|
11
|
-
configSchema: JsonSchema;
|
|
12
|
-
}) => HarnessDescriptionIface;
|
|
13
|
-
export declare const unprobedDescription: (args: {
|
|
14
|
-
transports: AcpTransport[];
|
|
15
|
-
configSchema: JsonSchema;
|
|
16
|
-
}) => HarnessDescriptionIface;
|
|
17
|
-
export declare const initializeOver: (args: {
|
|
18
|
-
stream: Stream;
|
|
19
|
-
timeoutMs: number;
|
|
20
|
-
}) => Promise<InitializeResponse>;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
client,
|
|
3
|
-
methods,
|
|
4
|
-
PROTOCOL_VERSION
|
|
5
|
-
} from "@agentclientprotocol/sdk/experimental/v2";
|
|
6
|
-
import {
|
|
7
|
-
advertisedFinalExtensions,
|
|
8
|
-
AdvertisedSandboxWire,
|
|
9
|
-
requireProtocolV2,
|
|
10
|
-
watchInitializeVersion
|
|
11
|
-
} from "@finalai/acp-session";
|
|
12
|
-
import {
|
|
13
|
-
CredentialDelivery,
|
|
14
|
-
DEFAULT_PROMPT_WHILE_RUNNING,
|
|
15
|
-
DEFAULT_SESSION_SURVIVES_DISCONNECT,
|
|
16
|
-
InferenceCredentialKind,
|
|
17
|
-
McpTransportKind,
|
|
18
|
-
SandboxWire
|
|
19
|
-
} from "@finalai/agent-provider";
|
|
20
|
-
const sandboxWireOf = {
|
|
21
|
-
[AdvertisedSandboxWire.HandleRpc]: SandboxWire.HandleRpc,
|
|
22
|
-
[AdvertisedSandboxWire.Mcp]: SandboxWire.Mcp
|
|
23
|
-
};
|
|
24
|
-
const FINAL_CLIENT_INFO = { name: "final-agent-sdk", version: "1.0.0" };
|
|
25
|
-
const DEFAULT_CONNECT_TIMEOUT_MS = 1e4;
|
|
26
|
-
const describeFromInitialize = (args) => {
|
|
27
|
-
const session = args.response.capabilities?.session;
|
|
28
|
-
const mcpCapabilities = session?.mcp;
|
|
29
|
-
const mcp = [];
|
|
30
|
-
if (mcpCapabilities?.acp != null) mcp.push(McpTransportKind.Acp);
|
|
31
|
-
if (mcpCapabilities?.http != null) mcp.push(McpTransportKind.Http);
|
|
32
|
-
if (mcpCapabilities?.stdio != null) mcp.push(McpTransportKind.Stdio);
|
|
33
|
-
const supports = advertisedFinalExtensions(args.response);
|
|
34
|
-
return {
|
|
35
|
-
configSchema: args.configSchema,
|
|
36
|
-
acp: { transports: args.transports, mcp },
|
|
37
|
-
// Native tools of an unknown program are its own business; bound targets
|
|
38
|
-
// reach it only as the sandbox MCP projection.
|
|
39
|
-
baseTools: {},
|
|
40
|
-
consumes: supports.consumes == null ? mcp.length > 0 ? [SandboxWire.Mcp] : [] : (
|
|
41
|
-
// The projection is an MCP server: it needs an MCP transport to arrive.
|
|
42
|
-
[...new Set(supports.consumes.map((wire) => sandboxWireOf[wire]))].filter(
|
|
43
|
-
(wire) => wire !== SandboxWire.Mcp || mcp.length > 0
|
|
44
|
-
)
|
|
45
|
-
),
|
|
46
|
-
inference: {
|
|
47
|
-
vendors: [],
|
|
48
|
-
kinds: [InferenceCredentialKind.HarnessOwned],
|
|
49
|
-
delivery: CredentialDelivery.AtOpen
|
|
50
|
-
},
|
|
51
|
-
supports: {
|
|
52
|
-
observe: supports.observe,
|
|
53
|
-
// session/resume with replayFrom is base ACP v2; an agent can opt out through _meta.
|
|
54
|
-
resumeReplay: supports.resumeReplay ?? true,
|
|
55
|
-
fork: session?.fork != null,
|
|
56
|
-
authorMeta: supports.authorMeta
|
|
57
|
-
},
|
|
58
|
-
// Nothing in a plain ACP v2 `initialize` declares these; assume the
|
|
59
|
-
// conservative profile.
|
|
60
|
-
promptWhileRunning: DEFAULT_PROMPT_WHILE_RUNNING,
|
|
61
|
-
sessionSurvivesDisconnect: DEFAULT_SESSION_SURVIVES_DISCONNECT
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
const unprobedDescription = (args) => ({
|
|
65
|
-
configSchema: args.configSchema,
|
|
66
|
-
acp: { transports: args.transports, mcp: [] },
|
|
67
|
-
baseTools: {},
|
|
68
|
-
consumes: [],
|
|
69
|
-
inference: {
|
|
70
|
-
vendors: [],
|
|
71
|
-
kinds: [InferenceCredentialKind.HarnessOwned],
|
|
72
|
-
delivery: CredentialDelivery.AtOpen
|
|
73
|
-
},
|
|
74
|
-
supports: { observe: false, resumeReplay: false, fork: false, authorMeta: false },
|
|
75
|
-
promptWhileRunning: DEFAULT_PROMPT_WHILE_RUNNING,
|
|
76
|
-
sessionSurvivesDisconnect: DEFAULT_SESSION_SURVIVES_DISCONNECT
|
|
77
|
-
});
|
|
78
|
-
const initializeOver = async (args) => {
|
|
79
|
-
const watch = watchInitializeVersion(args.stream);
|
|
80
|
-
const connection = client().connect(watch.stream);
|
|
81
|
-
const timeout = Promise.withResolvers();
|
|
82
|
-
const timer = setTimeout(
|
|
83
|
-
() => timeout.reject(new Error(`initialize did not complete within ${args.timeoutMs} ms`)),
|
|
84
|
-
args.timeoutMs
|
|
85
|
-
);
|
|
86
|
-
try {
|
|
87
|
-
return await Promise.race([
|
|
88
|
-
requireProtocolV2({
|
|
89
|
-
watch,
|
|
90
|
-
initialize: connection.agent.request(methods.agent.initialize, {
|
|
91
|
-
protocolVersion: PROTOCOL_VERSION,
|
|
92
|
-
info: FINAL_CLIENT_INFO,
|
|
93
|
-
capabilities: {}
|
|
94
|
-
})
|
|
95
|
-
}),
|
|
96
|
-
timeout.promise
|
|
97
|
-
]);
|
|
98
|
-
} finally {
|
|
99
|
-
clearTimeout(timer);
|
|
100
|
-
connection.close();
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
export {
|
|
104
|
-
DEFAULT_CONNECT_TIMEOUT_MS,
|
|
105
|
-
FINAL_CLIENT_INFO,
|
|
106
|
-
describeFromInitialize,
|
|
107
|
-
initializeOver,
|
|
108
|
-
unprobedDescription
|
|
109
|
-
};
|
|
110
|
-
//# sourceMappingURL=acp-describe.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/harnesses/acp-describe.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n client,\n methods,\n PROTOCOL_VERSION,\n type InitializeResponse,\n type Stream,\n} from '@agentclientprotocol/sdk/experimental/v2';\nimport {\n advertisedFinalExtensions,\n AdvertisedSandboxWire,\n requireProtocolV2,\n watchInitializeVersion,\n} from '@finalai/acp-session';\nimport {\n CredentialDelivery,\n DEFAULT_PROMPT_WHILE_RUNNING,\n DEFAULT_SESSION_SURVIVES_DISCONNECT,\n InferenceCredentialKind,\n McpTransportKind,\n SandboxWire,\n type AcpTransport,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\n\n// Describes an arbitrary ACP v2 agent from its `initialize` response: MCP\n// transports from `capabilities.session.mcp`, fork from\n// `capabilities.session.fork`, and Final's optional extensions from\n// `_meta[\"final.ai\"].supports`. A plain agent with no Final extension still\n// gets a complete description (\"a harness that implements no Final\n// extension works completely\"). The sandbox wires are `_meta[\"final.ai\"].consumes`\n// when the agent declares them, else the MCP projection whenever it takes MCP\n// servers.\n\nconst sandboxWireOf = {\n [AdvertisedSandboxWire.HandleRpc]: SandboxWire.HandleRpc,\n [AdvertisedSandboxWire.Mcp]: SandboxWire.Mcp,\n} satisfies Record<AdvertisedSandboxWire, SandboxWire>;\n\nexport const FINAL_CLIENT_INFO = { name: 'final-agent-sdk', version: '1.0.0' };\nexport const DEFAULT_CONNECT_TIMEOUT_MS = 10_000;\n\nexport const describeFromInitialize = (args: {\n response: InitializeResponse;\n transports: AcpTransport[];\n configSchema: JsonSchema;\n}): HarnessDescriptionIface => {\n const session = args.response.capabilities?.session;\n const mcpCapabilities = session?.mcp;\n const mcp: McpTransportKind[] = [];\n if (mcpCapabilities?.acp != null) mcp.push(McpTransportKind.Acp);\n if (mcpCapabilities?.http != null) mcp.push(McpTransportKind.Http);\n if (mcpCapabilities?.stdio != null) mcp.push(McpTransportKind.Stdio);\n const supports = advertisedFinalExtensions(args.response);\n return {\n configSchema: args.configSchema,\n acp: { transports: args.transports, mcp },\n // Native tools of an unknown program are its own business; bound targets\n // reach it only as the sandbox MCP projection.\n baseTools: {},\n consumes:\n supports.consumes == null\n ? mcp.length > 0\n ? [SandboxWire.Mcp]\n : []\n : // The projection is an MCP server: it needs an MCP transport to arrive.\n [...new Set(supports.consumes.map((wire) => sandboxWireOf[wire]))].filter(\n (wire) => wire !== SandboxWire.Mcp || mcp.length > 0,\n ),\n inference: {\n vendors: [],\n kinds: [InferenceCredentialKind.HarnessOwned],\n delivery: CredentialDelivery.AtOpen,\n },\n supports: {\n observe: supports.observe,\n // session/resume with replayFrom is base ACP v2; an agent can opt out through _meta.\n resumeReplay: supports.resumeReplay ?? true,\n fork: session?.fork != null,\n authorMeta: supports.authorMeta,\n },\n // Nothing in a plain ACP v2 `initialize` declares these; assume the\n // conservative profile.\n promptWhileRunning: DEFAULT_PROMPT_WHILE_RUNNING,\n sessionSurvivesDisconnect: DEFAULT_SESSION_SURVIVES_DISCONNECT,\n };\n};\n\n// Static description used before the remote has been reached (Build's config\n// form): nothing about the remote is known yet.\nexport const unprobedDescription = (args: {\n transports: AcpTransport[];\n configSchema: JsonSchema;\n}): HarnessDescriptionIface => ({\n configSchema: args.configSchema,\n acp: { transports: args.transports, mcp: [] },\n baseTools: {},\n consumes: [],\n inference: {\n vendors: [],\n kinds: [InferenceCredentialKind.HarnessOwned],\n delivery: CredentialDelivery.AtOpen,\n },\n supports: { observe: false, resumeReplay: false, fork: false, authorMeta: false },\n promptWhileRunning: DEFAULT_PROMPT_WHILE_RUNNING,\n sessionSurvivesDisconnect: DEFAULT_SESSION_SURVIVES_DISCONNECT,\n});\n\n// Runs `initialize` over a fresh stream and closes the connection. Any reply\n// but ACP v2 is `unsupported_protocol_version`: nothing in the plane\n// negotiates or converts v1.\nexport const initializeOver = async (args: {\n stream: Stream;\n timeoutMs: number;\n}): Promise<InitializeResponse> => {\n const watch = watchInitializeVersion(args.stream);\n const connection = client().connect(watch.stream);\n const timeout = Promise.withResolvers<never>();\n const timer = setTimeout(\n () => timeout.reject(new Error(`initialize did not complete within ${args.timeoutMs} ms`)),\n args.timeoutMs,\n );\n try {\n return await Promise.race([\n requireProtocolV2({\n watch,\n initialize: connection.agent.request(methods.agent.initialize, {\n protocolVersion: PROTOCOL_VERSION,\n info: FINAL_CLIENT_INFO,\n capabilities: {},\n }),\n }),\n timeout.promise,\n ]);\n } finally {\n clearTimeout(timer);\n connection.close();\n }\n};\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAWP,MAAM,gBAAgB;AAAA,EACpB,CAAC,sBAAsB,SAAS,GAAG,YAAY;AAAA,EAC/C,CAAC,sBAAsB,GAAG,GAAG,YAAY;AAC3C;AAEO,MAAM,oBAAoB,EAAE,MAAM,mBAAmB,SAAS,QAAQ;AACtE,MAAM,6BAA6B;AAEnC,MAAM,yBAAyB,CAAC,SAIR;AAC7B,QAAM,UAAU,KAAK,SAAS,cAAc;AAC5C,QAAM,kBAAkB,SAAS;AACjC,QAAM,MAA0B,CAAC;AACjC,MAAI,iBAAiB,OAAO,KAAM,KAAI,KAAK,iBAAiB,GAAG;AAC/D,MAAI,iBAAiB,QAAQ,KAAM,KAAI,KAAK,iBAAiB,IAAI;AACjE,MAAI,iBAAiB,SAAS,KAAM,KAAI,KAAK,iBAAiB,KAAK;AACnE,QAAM,WAAW,0BAA0B,KAAK,QAAQ;AACxD,SAAO;AAAA,IACL,cAAc,KAAK;AAAA,IACnB,KAAK,EAAE,YAAY,KAAK,YAAY,IAAI;AAAA;AAAA;AAAA,IAGxC,WAAW,CAAC;AAAA,IACZ,UACE,SAAS,YAAY,OACjB,IAAI,SAAS,IACX,CAAC,YAAY,GAAG,IAChB,CAAC;AAAA;AAAA,MAEH,CAAC,GAAG,IAAI,IAAI,SAAS,SAAS,IAAI,CAAC,SAAS,cAAc,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,QACjE,CAAC,SAAS,SAAS,YAAY,OAAO,IAAI,SAAS;AAAA,MACrD;AAAA;AAAA,IACN,WAAW;AAAA,MACT,SAAS,CAAC;AAAA,MACV,OAAO,CAAC,wBAAwB,YAAY;AAAA,MAC5C,UAAU,mBAAmB;AAAA,IAC/B;AAAA,IACA,UAAU;AAAA,MACR,SAAS,SAAS;AAAA;AAAA,MAElB,cAAc,SAAS,gBAAgB;AAAA,MACvC,MAAM,SAAS,QAAQ;AAAA,MACvB,YAAY,SAAS;AAAA,IACvB;AAAA;AAAA;AAAA,IAGA,oBAAoB;AAAA,IACpB,2BAA2B;AAAA,EAC7B;AACF;AAIO,MAAM,sBAAsB,CAAC,UAGJ;AAAA,EAC9B,cAAc,KAAK;AAAA,EACnB,KAAK,EAAE,YAAY,KAAK,YAAY,KAAK,CAAC,EAAE;AAAA,EAC5C,WAAW,CAAC;AAAA,EACZ,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,IACT,SAAS,CAAC;AAAA,IACV,OAAO,CAAC,wBAAwB,YAAY;AAAA,IAC5C,UAAU,mBAAmB;AAAA,EAC/B;AAAA,EACA,UAAU,EAAE,SAAS,OAAO,cAAc,OAAO,MAAM,OAAO,YAAY,MAAM;AAAA,EAChF,oBAAoB;AAAA,EACpB,2BAA2B;AAC7B;AAKO,MAAM,iBAAiB,OAAO,SAGF;AACjC,QAAM,QAAQ,uBAAuB,KAAK,MAAM;AAChD,QAAM,aAAa,OAAO,EAAE,QAAQ,MAAM,MAAM;AAChD,QAAM,UAAU,QAAQ,cAAqB;AAC7C,QAAM,QAAQ;AAAA,IACZ,MAAM,QAAQ,OAAO,IAAI,MAAM,sCAAsC,KAAK,SAAS,KAAK,CAAC;AAAA,IACzF,KAAK;AAAA,EACP;AACA,MAAI;AACF,WAAO,MAAM,QAAQ,KAAK;AAAA,MACxB,kBAAkB;AAAA,QAChB;AAAA,QACA,YAAY,WAAW,MAAM,QAAQ,QAAQ,MAAM,YAAY;AAAA,UAC7D,iBAAiB;AAAA,UACjB,MAAM;AAAA,UACN,cAAc,CAAC;AAAA,QACjB,CAAC;AAAA,MACH,CAAC;AAAA,MACD,QAAQ;AAAA,IACV,CAAC;AAAA,EACH,UAAE;AACA,iBAAa,KAAK;AAClB,eAAW,MAAM;AAAA,EACnB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { type CredentialsInput, type HarnessBindingOutputIface } from "./config-fields.mjs";
|
|
4
|
-
export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/local-stdio";
|
|
5
|
-
export declare const localStdioConfigSchema: z.ZodObject<{
|
|
6
|
-
credentials: z.ZodObject<{
|
|
7
|
-
payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
|
|
8
|
-
tryInOrder: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
9
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Subscription>;
|
|
10
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
11
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
12
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
13
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
15
|
-
secret: z.ZodString;
|
|
16
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
17
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
18
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
20
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
21
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
22
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Platform>;
|
|
25
|
-
budget: z.ZodOptional<z.ZodString>;
|
|
26
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.HarnessOwned>;
|
|
28
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Custom>;
|
|
30
|
-
resolver: z.ZodString;
|
|
31
|
-
events: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("@finalai/agent-provider").DynamicEvent>>>;
|
|
32
|
-
}, z.core.$strip>]>>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
command: z.ZodString;
|
|
35
|
-
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
36
|
-
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
37
|
-
}, z.core.$strict>;
|
|
38
|
-
export type LocalStdioConfigIface = z.output<typeof localStdioConfigSchema>;
|
|
39
|
-
export declare const LOCAL_STDIO_CONFIG_JSON_SCHEMA: JsonSchema;
|
|
40
|
-
export declare const LOCAL_STDIO_DESCRIPTION: HarnessDescriptionIface;
|
|
41
|
-
export interface LocalStdioConfigInputIface {
|
|
42
|
-
credentials: CredentialsInput;
|
|
43
|
-
command: string;
|
|
44
|
-
args?: string[];
|
|
45
|
-
env?: Record<string, string>;
|
|
46
|
-
}
|
|
47
|
-
export declare const localStdio: (config: LocalStdioConfigInputIface) => HarnessBindingOutputIface;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AcpTransport
|
|
3
|
-
} from "@finalai/agent-provider";
|
|
4
|
-
import * as z from "zod";
|
|
5
|
-
import { unprobedDescription } from "./acp-describe.mjs";
|
|
6
|
-
import {
|
|
7
|
-
configObjectJson,
|
|
8
|
-
credentialsJson,
|
|
9
|
-
credentialsZod,
|
|
10
|
-
harnessBinding
|
|
11
|
-
} from "./config-fields.mjs";
|
|
12
|
-
const SPECIFIER = "@finalai/final-agent-provider/harnesses/local-stdio";
|
|
13
|
-
const localStdioConfigSchema = z.strictObject({
|
|
14
|
-
credentials: credentialsZod(),
|
|
15
|
-
command: z.string().min(1),
|
|
16
|
-
args: z.array(z.string()).default([]),
|
|
17
|
-
env: z.record(z.string(), z.string()).default({})
|
|
18
|
-
});
|
|
19
|
-
const LOCAL_STDIO_CONFIG_JSON_SCHEMA = configObjectJson({
|
|
20
|
-
title: "Local stdio agent",
|
|
21
|
-
required: ["command", "credentials"],
|
|
22
|
-
properties: {
|
|
23
|
-
credentials: credentialsJson(),
|
|
24
|
-
command: { type: "string", title: "Command", minLength: 1 },
|
|
25
|
-
args: { type: "array", title: "Arguments", items: { type: "string" } },
|
|
26
|
-
env: { type: "object", title: "Environment", additionalProperties: { type: "string" } }
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
const LOCAL_STDIO_DESCRIPTION = unprobedDescription({
|
|
30
|
-
transports: [AcpTransport.Stdio],
|
|
31
|
-
configSchema: LOCAL_STDIO_CONFIG_JSON_SCHEMA
|
|
32
|
-
});
|
|
33
|
-
const localStdio = (config) => harnessBinding(SPECIFIER, config);
|
|
34
|
-
export {
|
|
35
|
-
LOCAL_STDIO_CONFIG_JSON_SCHEMA,
|
|
36
|
-
LOCAL_STDIO_DESCRIPTION,
|
|
37
|
-
SPECIFIER,
|
|
38
|
-
localStdio,
|
|
39
|
-
localStdioConfigSchema
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=local-stdio.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/harnesses/local-stdio.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n AcpTransport,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport { unprobedDescription } from \"./acp-describe.mjs\";\nimport {\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n} from \"./config-fields.mjs\";\n\n// Any stdio ACP v2 agent, spawned by the session service. Development, CI and\n// conformance only; never enabled for an organization.\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/local-stdio';\n\nexport const localStdioConfigSchema = z.strictObject({\n credentials: credentialsZod(),\n command: z.string().min(1),\n args: z.array(z.string()).default([]),\n env: z.record(z.string(), z.string()).default({}),\n});\n\nexport type LocalStdioConfigIface = z.output<typeof localStdioConfigSchema>;\n\nexport const LOCAL_STDIO_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n title: 'Local stdio agent',\n required: ['command', 'credentials'],\n properties: {\n credentials: credentialsJson(),\n command: { type: 'string', title: 'Command', minLength: 1 },\n args: { type: 'array', title: 'Arguments', items: { type: 'string' } },\n env: { type: 'object', title: 'Environment', additionalProperties: { type: 'string' } },\n },\n});\n\nexport const LOCAL_STDIO_DESCRIPTION: HarnessDescriptionIface = unprobedDescription({\n transports: [AcpTransport.Stdio],\n configSchema: LOCAL_STDIO_CONFIG_JSON_SCHEMA,\n});\n\nexport interface LocalStdioConfigInputIface {\n credentials: CredentialsInput;\n command: string;\n args?: string[];\n env?: Record<string, string>;\n}\n\nexport const localStdio = (config: LocalStdioConfigInputIface): HarnessBindingOutputIface =>\n harnessBinding(SPECIFIER, config);\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,OAGK;AACP,YAAY,OAAO;AACnB,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAKA,MAAM,YAAY;AAElB,MAAM,yBAAyB,EAAE,aAAa;AAAA,EACnD,aAAa,eAAe;AAAA,EAC5B,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACzB,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACpC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAIM,MAAM,iCAA6C,iBAAiB;AAAA,EACzE,OAAO;AAAA,EACP,UAAU,CAAC,WAAW,aAAa;AAAA,EACnC,YAAY;AAAA,IACV,aAAa,gBAAgB;AAAA,IAC7B,SAAS,EAAE,MAAM,UAAU,OAAO,WAAW,WAAW,EAAE;AAAA,IAC1D,MAAM,EAAE,MAAM,SAAS,OAAO,aAAa,OAAO,EAAE,MAAM,SAAS,EAAE;AAAA,IACrE,KAAK,EAAE,MAAM,UAAU,OAAO,eAAe,sBAAsB,EAAE,MAAM,SAAS,EAAE;AAAA,EACxF;AACF,CAAC;AAEM,MAAM,0BAAmD,oBAAoB;AAAA,EAClF,YAAY,CAAC,aAAa,KAAK;AAAA,EAC/B,cAAc;AAChB,CAAC;AASM,MAAM,aAAa,CAAC,WACzB,eAAe,WAAW,MAAM;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { PromptWhileRunning, type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { type CredentialsInput, type HarnessBindingOutputIface, type SecretRefIface } from "./config-fields.mjs";
|
|
4
|
-
import { type RemoteClientTlsInputIface } from "./remote-client-tls.mjs";
|
|
5
|
-
export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/remote-acp";
|
|
6
|
-
export declare enum HeaderValueKind {
|
|
7
|
-
Literal = "literal",
|
|
8
|
-
Secret = "secret"
|
|
9
|
-
}
|
|
10
|
-
export declare const remoteAcpConfigSchema: z.ZodObject<{
|
|
11
|
-
url: z.ZodString;
|
|
12
|
-
credentials: z.ZodObject<{
|
|
13
|
-
payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
|
|
14
|
-
tryInOrder: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Subscription>;
|
|
16
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
17
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
18
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
21
|
-
secret: z.ZodString;
|
|
22
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
23
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
26
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
27
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
28
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
29
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Platform>;
|
|
31
|
-
budget: z.ZodOptional<z.ZodString>;
|
|
32
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.HarnessOwned>;
|
|
34
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Custom>;
|
|
36
|
-
resolver: z.ZodString;
|
|
37
|
-
events: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("@finalai/agent-provider").DynamicEvent>>>;
|
|
38
|
-
}, z.core.$strip>]>>;
|
|
39
|
-
}, z.core.$strip>;
|
|
40
|
-
promptWhileRunning: z.ZodOptional<z.ZodEnum<typeof PromptWhileRunning>>;
|
|
41
|
-
tls: z.ZodOptional<z.ZodObject<{
|
|
42
|
-
cert: z.ZodObject<{
|
|
43
|
-
secretKey: z.ZodString;
|
|
44
|
-
}, z.core.$strip>;
|
|
45
|
-
key: z.ZodObject<{
|
|
46
|
-
secretKey: z.ZodString;
|
|
47
|
-
}, z.core.$strip>;
|
|
48
|
-
ca: z.ZodOptional<z.ZodObject<{
|
|
49
|
-
secretKey: z.ZodString;
|
|
50
|
-
}, z.core.$strip>>;
|
|
51
|
-
}, z.core.$strict>>;
|
|
52
|
-
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
53
|
-
kind: HeaderValueKind.Literal;
|
|
54
|
-
value: string;
|
|
55
|
-
}, string>>, z.ZodPipe<z.ZodObject<{
|
|
56
|
-
secretKey: z.ZodString;
|
|
57
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
58
|
-
kind: HeaderValueKind.Secret;
|
|
59
|
-
ref: {
|
|
60
|
-
secretKey: string;
|
|
61
|
-
};
|
|
62
|
-
}, {
|
|
63
|
-
secretKey: string;
|
|
64
|
-
}>>]>>>;
|
|
65
|
-
}, z.core.$strict>;
|
|
66
|
-
export type RemoteAcpConfigIface = z.output<typeof remoteAcpConfigSchema>;
|
|
67
|
-
export declare const REMOTE_ACP_CONFIG_JSON_SCHEMA: JsonSchema;
|
|
68
|
-
export declare const REMOTE_ACP_DESCRIPTION: HarnessDescriptionIface;
|
|
69
|
-
export interface RemoteAcpConfigInputIface {
|
|
70
|
-
credentials: CredentialsInput;
|
|
71
|
-
url: string;
|
|
72
|
-
promptWhileRunning?: `${PromptWhileRunning}`;
|
|
73
|
-
tls?: RemoteClientTlsInputIface;
|
|
74
|
-
headers?: Record<string, string | SecretRefIface>;
|
|
75
|
-
}
|
|
76
|
-
export declare const remoteAcp: (config: RemoteAcpConfigInputIface) => HarnessBindingOutputIface;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AcpTransport,
|
|
3
|
-
PromptWhileRunning
|
|
4
|
-
} from "@finalai/agent-provider";
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
import { unprobedDescription } from "./acp-describe.mjs";
|
|
7
|
-
import {
|
|
8
|
-
configObjectJson,
|
|
9
|
-
credentialsJson,
|
|
10
|
-
credentialsZod,
|
|
11
|
-
harnessBinding,
|
|
12
|
-
secretRefZod
|
|
13
|
-
} from "./config-fields.mjs";
|
|
14
|
-
import {
|
|
15
|
-
remoteClientTlsJson,
|
|
16
|
-
remoteClientTlsSchema
|
|
17
|
-
} from "./remote-client-tls.mjs";
|
|
18
|
-
import { remoteUrlJson, remoteUrlZod } from "./remote-url.mjs";
|
|
19
|
-
const SPECIFIER = "@finalai/final-agent-provider/harnesses/remote-acp";
|
|
20
|
-
var HeaderValueKind = /* @__PURE__ */ ((HeaderValueKind2) => {
|
|
21
|
-
HeaderValueKind2["Literal"] = "literal";
|
|
22
|
-
HeaderValueKind2["Secret"] = "secret";
|
|
23
|
-
return HeaderValueKind2;
|
|
24
|
-
})(HeaderValueKind || {});
|
|
25
|
-
const remoteAcpConfigSchema = z.strictObject({
|
|
26
|
-
url: remoteUrlZod(),
|
|
27
|
-
credentials: credentialsZod(),
|
|
28
|
-
// Plain ACP does not advertise this behavior; the host author declares its measured profile.
|
|
29
|
-
promptWhileRunning: z.nativeEnum(PromptWhileRunning).optional(),
|
|
30
|
-
tls: remoteClientTlsSchema.optional(),
|
|
31
|
-
// Literal values, or secret references resolved through the definition's bound secrets.
|
|
32
|
-
headers: z.record(
|
|
33
|
-
z.string().min(1),
|
|
34
|
-
z.union([
|
|
35
|
-
z.string().transform((value) => ({ kind: "literal" /* Literal */, value })),
|
|
36
|
-
secretRefZod().transform((ref) => ({ kind: "secret" /* Secret */, ref }))
|
|
37
|
-
])
|
|
38
|
-
).default({})
|
|
39
|
-
});
|
|
40
|
-
const REMOTE_ACP_CONFIG_JSON_SCHEMA = configObjectJson({
|
|
41
|
-
title: "ACP agent (URL)",
|
|
42
|
-
required: ["url", "credentials"],
|
|
43
|
-
properties: {
|
|
44
|
-
url: remoteUrlJson("ACP URL"),
|
|
45
|
-
credentials: credentialsJson(),
|
|
46
|
-
promptWhileRunning: {
|
|
47
|
-
type: "string",
|
|
48
|
-
title: "Prompt behavior while running",
|
|
49
|
-
description: "Measured host behavior; defaults to queue when omitted.",
|
|
50
|
-
enum: Object.values(PromptWhileRunning)
|
|
51
|
-
},
|
|
52
|
-
tls: remoteClientTlsJson(),
|
|
53
|
-
headers: {
|
|
54
|
-
type: "object",
|
|
55
|
-
title: "Headers",
|
|
56
|
-
additionalProperties: {
|
|
57
|
-
anyOf: [
|
|
58
|
-
{ type: "string" },
|
|
59
|
-
{
|
|
60
|
-
type: "object",
|
|
61
|
-
required: ["secretKey"],
|
|
62
|
-
additionalProperties: false,
|
|
63
|
-
properties: { secretKey: { type: "string", minLength: 1 } }
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
const REMOTE_ACP_DESCRIPTION = unprobedDescription({
|
|
71
|
-
transports: [AcpTransport.Ws, AcpTransport.Http],
|
|
72
|
-
configSchema: REMOTE_ACP_CONFIG_JSON_SCHEMA
|
|
73
|
-
});
|
|
74
|
-
const remoteAcp = (config) => harnessBinding(SPECIFIER, config);
|
|
75
|
-
export {
|
|
76
|
-
HeaderValueKind,
|
|
77
|
-
REMOTE_ACP_CONFIG_JSON_SCHEMA,
|
|
78
|
-
REMOTE_ACP_DESCRIPTION,
|
|
79
|
-
SPECIFIER,
|
|
80
|
-
remoteAcp,
|
|
81
|
-
remoteAcpConfigSchema
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=remote-acp.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/harnesses/remote-acp.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n AcpTransport,\n PromptWhileRunning,\n type HarnessDescriptionIface,\n type JsonSchema,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport { unprobedDescription } from \"./acp-describe.mjs\";\nimport {\n configObjectJson,\n credentialsJson,\n credentialsZod,\n harnessBinding,\n secretRefZod,\n type CredentialsInput,\n type HarnessBindingOutputIface,\n type SecretRefIface,\n} from \"./config-fields.mjs\";\nimport {\n remoteClientTlsJson,\n remoteClientTlsSchema,\n type RemoteClientTlsInputIface,\n} from \"./remote-client-tls.mjs\";\nimport { remoteUrlJson, remoteUrlZod } from \"./remote-url.mjs\";\n\n// Any ACP v2 agent at a URL. Its description comes from the remote's\n// `initialize`; inference is always harness-owned (the remote brings its own\n// model access and never receives a Final credential).\n\nexport const SPECIFIER = '@finalai/final-agent-provider/harnesses/remote-acp';\n\nexport enum HeaderValueKind {\n Literal = 'literal',\n Secret = 'secret',\n}\n\nexport const remoteAcpConfigSchema = z.strictObject({\n url: remoteUrlZod(),\n credentials: credentialsZod(),\n // Plain ACP does not advertise this behavior; the host author declares its measured profile.\n promptWhileRunning: z.nativeEnum(PromptWhileRunning).optional(),\n tls: remoteClientTlsSchema.optional(),\n // Literal values, or secret references resolved through the definition's bound secrets.\n headers: z\n .record(\n z.string().min(1),\n z.union([\n z.string().transform((value) => ({ kind: HeaderValueKind.Literal as const, value })),\n secretRefZod().transform((ref) => ({ kind: HeaderValueKind.Secret as const, ref })),\n ]),\n )\n .default({}),\n});\n\nexport type RemoteAcpConfigIface = z.output<typeof remoteAcpConfigSchema>;\n\nexport const REMOTE_ACP_CONFIG_JSON_SCHEMA: JsonSchema = configObjectJson({\n title: 'ACP agent (URL)',\n required: ['url', 'credentials'],\n properties: {\n url: remoteUrlJson('ACP URL'),\n credentials: credentialsJson(),\n promptWhileRunning: {\n type: 'string',\n title: 'Prompt behavior while running',\n description: 'Measured host behavior; defaults to queue when omitted.',\n enum: Object.values(PromptWhileRunning),\n },\n tls: remoteClientTlsJson(),\n headers: {\n type: 'object',\n title: 'Headers',\n additionalProperties: {\n anyOf: [\n { type: 'string' },\n {\n type: 'object',\n required: ['secretKey'],\n additionalProperties: false,\n properties: { secretKey: { type: 'string', minLength: 1 } },\n },\n ],\n },\n },\n },\n});\n\nexport const REMOTE_ACP_DESCRIPTION: HarnessDescriptionIface = unprobedDescription({\n transports: [AcpTransport.Ws, AcpTransport.Http],\n configSchema: REMOTE_ACP_CONFIG_JSON_SCHEMA,\n});\n\nexport interface RemoteAcpConfigInputIface {\n credentials: CredentialsInput;\n url: string;\n promptWhileRunning?: `${PromptWhileRunning}`;\n tls?: RemoteClientTlsInputIface;\n headers?: Record<string, string | SecretRefIface>;\n}\n\nexport const remoteAcp = (config: RemoteAcpConfigInputIface): HarnessBindingOutputIface =>\n harnessBinding(SPECIFIER, config);\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,YAAY,OAAO;AACnB,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,eAAe,oBAAoB;AAMrC,MAAM,YAAY;AAElB,IAAK,kBAAL,kBAAKA,qBAAL;AACL,EAAAA,iBAAA,aAAU;AACV,EAAAA,iBAAA,YAAS;AAFC,SAAAA;AAAA,GAAA;AAKL,MAAM,wBAAwB,EAAE,aAAa;AAAA,EAClD,KAAK,aAAa;AAAA,EAClB,aAAa,eAAe;AAAA;AAAA,EAE5B,oBAAoB,EAAE,WAAW,kBAAkB,EAAE,SAAS;AAAA,EAC9D,KAAK,sBAAsB,SAAS;AAAA;AAAA,EAEpC,SAAS,EACN;AAAA,IACC,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,IAChB,EAAE,MAAM;AAAA,MACN,EAAE,OAAO,EAAE,UAAU,CAAC,WAAW,EAAE,MAAM,yBAAkC,MAAM,EAAE;AAAA,MACnF,aAAa,EAAE,UAAU,CAAC,SAAS,EAAE,MAAM,uBAAiC,IAAI,EAAE;AAAA,IACpF,CAAC;AAAA,EACH,EACC,QAAQ,CAAC,CAAC;AACf,CAAC;AAIM,MAAM,gCAA4C,iBAAiB;AAAA,EACxE,OAAO;AAAA,EACP,UAAU,CAAC,OAAO,aAAa;AAAA,EAC/B,YAAY;AAAA,IACV,KAAK,cAAc,SAAS;AAAA,IAC5B,aAAa,gBAAgB;AAAA,IAC7B,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,MAAM,OAAO,OAAO,kBAAkB;AAAA,IACxC;AAAA,IACA,KAAK,oBAAoB;AAAA,IACzB,SAAS;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,MACP,sBAAsB;AAAA,QACpB,OAAO;AAAA,UACL,EAAE,MAAM,SAAS;AAAA,UACjB;AAAA,YACE,MAAM;AAAA,YACN,UAAU,CAAC,WAAW;AAAA,YACtB,sBAAsB;AAAA,YACtB,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,WAAW,EAAE,EAAE;AAAA,UAC5D;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAEM,MAAM,yBAAkD,oBAAoB;AAAA,EACjF,YAAY,CAAC,aAAa,IAAI,aAAa,IAAI;AAAA,EAC/C,cAAc;AAChB,CAAC;AAUM,MAAM,YAAY,CAAC,WACxB,eAAe,WAAW,MAAM;",
|
|
6
|
-
"names": ["HeaderValueKind"]
|
|
7
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { type HarnessDescriptionIface, type JsonSchema } from '@finalai/agent-provider';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
import { ClaudePermissionMode, type CredentialsInput, type HarnessBindingOutputIface, type InstructionInput, type SecretRefIface } from "./config-fields.mjs";
|
|
4
|
-
import { type RemoteClientTlsInputIface } from "./remote-client-tls.mjs";
|
|
5
|
-
export declare const SPECIFIER = "@finalai/final-agent-provider/harnesses/remote-claude-code";
|
|
6
|
-
export declare const remotePermissionModeSchema: z.ZodEnum<{
|
|
7
|
-
readonly Default: ClaudePermissionMode.Default;
|
|
8
|
-
readonly Plan: ClaudePermissionMode.Plan;
|
|
9
|
-
readonly AcceptEdits: ClaudePermissionMode.AcceptEdits;
|
|
10
|
-
readonly Bypass: ClaudePermissionMode.Bypass;
|
|
11
|
-
}>;
|
|
12
|
-
export type RemoteClaudePermissionMode = z.output<typeof remotePermissionModeSchema>;
|
|
13
|
-
export declare const remoteClaudeCodeConfigSchema: 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
|
-
credentials: z.ZodObject<{
|
|
33
|
-
payer: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialPayer>;
|
|
34
|
-
tryInOrder: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
35
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Subscription>;
|
|
36
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
37
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
38
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
41
|
-
secret: z.ZodString;
|
|
42
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
43
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
44
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
-
pin: z.ZodOptional<z.ZodString>;
|
|
46
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.ApiKey>;
|
|
47
|
-
owner: z.ZodEnum<typeof import("@finalai/agent-provider").CredentialOwner>;
|
|
48
|
-
vendor: z.ZodOptional<z.ZodString>;
|
|
49
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Platform>;
|
|
51
|
-
budget: z.ZodOptional<z.ZodString>;
|
|
52
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.HarnessOwned>;
|
|
54
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
-
kind: z.ZodLiteral<import("@finalai/agent-provider").CredentialNodeKind.Custom>;
|
|
56
|
-
resolver: z.ZodString;
|
|
57
|
-
events: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("@finalai/agent-provider").DynamicEvent>>>;
|
|
58
|
-
}, z.core.$strip>]>>;
|
|
59
|
-
}, z.core.$strip>;
|
|
60
|
-
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
61
|
-
readonly Default: ClaudePermissionMode.Default;
|
|
62
|
-
readonly Plan: ClaudePermissionMode.Plan;
|
|
63
|
-
readonly AcceptEdits: ClaudePermissionMode.AcceptEdits;
|
|
64
|
-
readonly Bypass: ClaudePermissionMode.Bypass;
|
|
65
|
-
}>>;
|
|
66
|
-
instructions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
67
|
-
role: z.ZodEnum<typeof import("@finalai/agent-provider").InstructionRole>;
|
|
68
|
-
content: z.ZodString;
|
|
69
|
-
source: z.ZodOptional<z.ZodString>;
|
|
70
|
-
}, z.core.$strip>>>;
|
|
71
|
-
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
-
}, z.core.$strict>;
|
|
73
|
-
export type RemoteClaudeCodeConfigIface = z.output<typeof remoteClaudeCodeConfigSchema>;
|
|
74
|
-
export declare const REMOTE_CLAUDE_CODE_CONFIG_JSON_SCHEMA: JsonSchema;
|
|
75
|
-
export declare const REMOTE_CLAUDE_CODE_DESCRIPTION: HarnessDescriptionIface;
|
|
76
|
-
export interface RemoteClaudeCodeConfigInputIface {
|
|
77
|
-
url: string;
|
|
78
|
-
tls?: RemoteClientTlsInputIface;
|
|
79
|
-
hop: SecretRefIface;
|
|
80
|
-
cwd?: string;
|
|
81
|
-
executable?: string;
|
|
82
|
-
model?: string;
|
|
83
|
-
credentials: CredentialsInput;
|
|
84
|
-
permissionMode?: RemoteClaudePermissionMode | `${RemoteClaudePermissionMode}`;
|
|
85
|
-
instructions?: InstructionInput[];
|
|
86
|
-
allowedTools?: string[];
|
|
87
|
-
}
|
|
88
|
-
export declare const remoteClaudeCode: (config: RemoteClaudeCodeConfigInputIface) => HarnessBindingOutputIface;
|