@finalai/agents 0.11.0 → 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 +214 -29
- package/dist/modules/agent-client/agent-input.d.mts +24 -0
- package/dist/modules/agent-client/agent-input.mjs +46 -0
- package/dist/modules/agent-client/agent-input.mjs.map +7 -0
- package/dist/modules/agent-client/channels.d.mts +52 -3
- package/dist/modules/agent-client/channels.mjs +71 -10
- package/dist/modules/agent-client/channels.mjs.map +2 -2
- package/dist/modules/agent-client/client.d.mts +85 -20
- package/dist/modules/agent-client/client.mjs +74 -21
- package/dist/modules/agent-client/client.mjs.map +2 -2
- package/dist/modules/agent-client/config-options.mjs +1 -2
- package/dist/modules/agent-client/config-options.mjs.map +2 -2
- package/dist/modules/agent-client/conversation-resources.d.mts +85 -0
- package/dist/modules/agent-client/conversation-resources.mjs +150 -0
- package/dist/modules/agent-client/conversation-resources.mjs.map +7 -0
- package/dist/modules/agent-client/conversations.d.mts +116 -38
- package/dist/modules/agent-client/conversations.mjs +379 -71
- package/dist/modules/agent-client/conversations.mjs.map +2 -2
- package/dist/modules/agent-client/defaults.d.mts +8 -0
- package/dist/modules/agent-client/defaults.mjs +77 -0
- package/dist/modules/agent-client/defaults.mjs.map +7 -0
- package/dist/modules/agent-client/errors.d.mts +22 -2
- package/dist/modules/agent-client/errors.mjs +19 -0
- package/dist/modules/agent-client/errors.mjs.map +2 -2
- package/dist/modules/agent-client/events.d.mts +62 -0
- package/dist/modules/agent-client/events.mjs +107 -0
- package/dist/modules/agent-client/events.mjs.map +7 -0
- package/dist/modules/agent-client/harnesses.d.mts +66 -0
- package/dist/modules/agent-client/harnesses.mjs +156 -0
- package/dist/modules/agent-client/harnesses.mjs.map +7 -0
- package/dist/modules/agent-client/http.d.mts +2 -1
- package/dist/modules/agent-client/http.mjs +21 -2
- package/dist/modules/agent-client/http.mjs.map +2 -2
- package/dist/modules/agent-client/index.d.mts +21 -6
- package/dist/modules/agent-client/index.mjs +26 -0
- package/dist/modules/agent-client/index.mjs.map +2 -2
- package/dist/modules/agent-client/integrations.d.mts +40 -0
- package/dist/modules/agent-client/integrations.mjs +92 -0
- package/dist/modules/agent-client/integrations.mjs.map +7 -0
- package/dist/modules/agent-client/local-host-protocol.d.mts +156 -0
- package/dist/modules/agent-client/local-host-protocol.mjs +258 -0
- package/dist/modules/agent-client/local-host-protocol.mjs.map +7 -0
- package/dist/modules/agent-client/local-host.d.mts +56 -0
- package/dist/modules/agent-client/local-host.mjs +200 -0
- package/dist/modules/agent-client/local-host.mjs.map +7 -0
- package/dist/modules/agent-client/oauth-clients.d.mts +36 -0
- package/dist/modules/agent-client/oauth-clients.mjs +67 -0
- package/dist/modules/agent-client/oauth-clients.mjs.map +7 -0
- package/dist/modules/agent-client/project-agents.d.mts +54 -0
- package/dist/modules/agent-client/project-agents.mjs +111 -0
- package/dist/modules/agent-client/project-agents.mjs.map +7 -0
- package/dist/modules/agent-client/project.d.mts +43 -0
- package/dist/modules/agent-client/project.mjs +66 -0
- package/dist/modules/agent-client/project.mjs.map +7 -0
- package/dist/modules/agent-client/projects.d.mts +61 -0
- package/dist/modules/agent-client/projects.mjs +145 -0
- package/dist/modules/agent-client/projects.mjs.map +7 -0
- package/dist/modules/agent-client/provide.d.mts +41 -0
- package/dist/modules/agent-client/provide.mjs +90 -0
- package/dist/modules/agent-client/provide.mjs.map +7 -0
- package/dist/modules/agent-client/publishers.d.mts +57 -0
- package/dist/modules/agent-client/publishers.mjs +109 -0
- package/dist/modules/agent-client/publishers.mjs.map +7 -0
- package/dist/modules/agent-client/requirements.d.mts +60 -0
- package/dist/modules/agent-client/requirements.mjs +83 -0
- package/dist/modules/agent-client/requirements.mjs.map +7 -0
- package/dist/modules/agent-client/sandbox-providers.d.mts +34 -0
- package/dist/modules/agent-client/sandbox-providers.mjs +75 -0
- package/dist/modules/agent-client/sandbox-providers.mjs.map +7 -0
- package/dist/modules/agent-client/sandbox-uri.d.mts +1 -1
- package/dist/modules/agent-client/sandbox-uri.mjs +4 -4
- package/dist/modules/agent-client/sandbox-uri.mjs.map +1 -1
- package/dist/modules/agent-client/sandboxes.d.mts +65 -0
- package/dist/modules/agent-client/sandboxes.mjs +130 -0
- package/dist/modules/agent-client/sandboxes.mjs.map +7 -0
- package/dist/modules/agent-client/schedules.d.mts +24 -0
- package/dist/modules/agent-client/schedules.mjs +56 -0
- package/dist/modules/agent-client/schedules.mjs.map +7 -0
- package/dist/modules/agent-client/sessions.d.mts +46 -8
- package/dist/modules/agent-client/sessions.mjs +91 -29
- package/dist/modules/agent-client/sessions.mjs.map +2 -2
- package/dist/modules/agent-client/start.d.mts +101 -0
- package/dist/modules/agent-client/start.mjs +260 -0
- package/dist/modules/agent-client/start.mjs.map +7 -0
- package/dist/modules/agent-client/test-fakes.d.mts +1 -0
- package/dist/modules/agent-client/test-fakes.mjs +3 -1
- package/dist/modules/agent-client/test-fakes.mjs.map +2 -2
- package/dist/modules/cli/agent-module.d.mts +39 -0
- package/dist/modules/cli/agent-module.mjs +89 -0
- package/dist/modules/cli/agent-module.mjs.map +7 -0
- package/dist/modules/cli/cli.d.mts +6 -6
- package/dist/modules/cli/cli.mjs +94 -120
- package/dist/modules/cli/cli.mjs.map +2 -2
- package/dist/modules/cli/conformance.d.mts +2 -6
- package/dist/modules/cli/conformance.mjs +5 -8
- package/dist/modules/cli/conformance.mjs.map +2 -2
- package/dist/modules/cli/main.mjs.map +1 -1
- package/dist/modules/cli/output.d.mts +0 -9
- package/dist/modules/cli/output.mjs +7 -85
- package/dist/modules/cli/output.mjs.map +2 -2
- package/dist/modules/harnesses.mjs.map +2 -2
- package/dist/modules/index.d.mts +0 -2
- package/dist/modules/index.mjs +0 -4
- package/dist/modules/index.mjs.map +2 -2
- package/dist/modules/integrations.d.mts +24 -0
- package/dist/modules/integrations.mjs +30 -0
- package/dist/modules/integrations.mjs.map +7 -0
- package/dist/modules/public.d.mts +10 -10
- package/dist/modules/public.mjs +29 -78
- package/dist/modules/public.mjs.map +2 -2
- package/dist/modules/sandboxes.d.mts +2 -0
- package/dist/modules/sandboxes.mjs +4 -0
- package/dist/modules/sandboxes.mjs.map +2 -2
- package/dist/modules/verify.d.mts +1 -0
- package/dist/modules/verify.mjs +2 -0
- package/dist/modules/verify.mjs.map +7 -0
- package/dist/modules/webhooks.d.mts +37 -0
- package/dist/modules/webhooks.mjs +100 -0
- package/dist/modules/webhooks.mjs.map +7 -0
- package/examples/release-scout/README.md +18 -10
- package/examples/release-scout/agent.ts +41 -0
- package/examples/release-scout/by-name.ts +43 -0
- package/examples/release-scout/db.ts +6 -0
- package/examples/release-scout/instructions.md +5 -0
- package/examples/release-scout/run-on-a-computer.ts +49 -0
- package/examples/release-scout/run.ts +38 -0
- package/package.json +42 -28
- package/dist/modules/agent-client/build.d.mts +0 -110
- package/dist/modules/agent-client/build.mjs +0 -213
- package/dist/modules/agent-client/build.mjs.map +0 -7
- package/dist/modules/authoring/index.d.mts +0 -1
- package/dist/modules/authoring/index.mjs +0 -2
- package/dist/modules/authoring/index.mjs.map +0 -7
- package/dist/modules/authoring/instructions.d.mts +0 -1
- package/dist/modules/authoring/instructions.mjs +0 -2
- package/dist/modules/authoring/instructions.mjs.map +0 -7
- package/dist/modules/authoring/providers.d.mts +0 -2
- package/dist/modules/authoring/providers.mjs +0 -1
- package/dist/modules/authoring/providers.mjs.map +0 -7
- package/dist/modules/cli/build.d.mts +0 -22
- package/dist/modules/cli/build.mjs +0 -77
- package/dist/modules/cli/build.mjs.map +0 -7
- package/dist/modules/cli/channel-install.d.mts +0 -12
- package/dist/modules/cli/channel-install.mjs +0 -25
- package/dist/modules/cli/channel-install.mjs.map +0 -7
- package/dist/modules/cli/channel-socket.d.mts +0 -9
- package/dist/modules/cli/channel-socket.mjs +0 -114
- package/dist/modules/cli/channel-socket.mjs.map +0 -7
- package/dist/modules/cli/dev.d.mts +0 -26
- package/dist/modules/cli/dev.mjs +0 -311
- package/dist/modules/cli/dev.mjs.map +0 -7
- package/dist/modules/cli/files.d.mts +0 -18
- package/dist/modules/cli/files.mjs +0 -66
- package/dist/modules/cli/files.mjs.map +0 -7
- package/dist/modules/cli/harness-descriptions.d.mts +0 -20
- package/dist/modules/cli/harness-descriptions.mjs +0 -70
- package/dist/modules/cli/harness-descriptions.mjs.map +0 -7
- package/dist/modules/cli/publish.d.mts +0 -15
- package/dist/modules/cli/publish.mjs +0 -92
- package/dist/modules/cli/publish.mjs.map +0 -7
- package/dist/modules/compile.d.mts +0 -3
- package/dist/modules/compile.mjs +0 -58
- package/dist/modules/compile.mjs.map +0 -7
- package/dist/modules/index.browser.d.mts +0 -4
- package/dist/modules/index.browser.mjs +0 -8
- package/dist/modules/index.browser.mjs.map +0 -7
- package/examples/custom-harness/README.md +0 -16
- package/examples/custom-harness/agent.ts +0 -154
- package/examples/custom-sandbox/README.md +0 -12
- package/examples/custom-sandbox/agent.ts +0 -14
- package/examples/custom-sandbox/sandbox.ts +0 -24
- package/examples/release-scout/agent/agent.ts +0 -22
- package/examples/release-scout/agent/channels/github-signature.ts +0 -27
- package/examples/release-scout/agent/channels/github.ts +0 -32
- package/examples/release-scout/agent/connections/linear.ts +0 -9
- package/examples/release-scout/agent/hooks/audit.ts +0 -24
- package/examples/release-scout/agent/instructions/org-context.ts +0 -26
- package/examples/release-scout/agent/instructions.md +0 -2
- package/examples/release-scout/agent/sandbox.ts +0 -20
- package/examples/release-scout/agent/schedules/daily-digest.md +0 -7
- package/examples/release-scout/agent/skills/triage/SKILL.md +0 -8
- package/examples/release-scout/agent/skills/triage/checklist.md +0 -3
- package/examples/release-scout/agent/tools/lookup_release_notes.ts +0 -24
- package/examples/release-scout/client.ts +0 -122
package/dist/modules/cli/cli.mjs
CHANGED
|
@@ -1,60 +1,42 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
1
|
import { parseArgs } from "node:util";
|
|
2
|
+
import { documentOf } from "@finalai/agent-definition";
|
|
3
3
|
import * as z from "zod";
|
|
4
|
-
import { createClient } from "../agent-client/client.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { runBuild } from "./build.mjs";
|
|
4
|
+
import { createClient, DEFAULT_AGENTS_HOST } from "../agent-client/client.mjs";
|
|
5
|
+
import { DefinitionKind, loadDefinitionModule } from "./agent-module.mjs";
|
|
7
6
|
import { runConformance } from "./conformance.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { gitListFiles } from "./files.mjs";
|
|
10
|
-
import { runPublish } from "./publish.mjs";
|
|
11
|
-
const DEFAULT_AGENTS_HOST = "https://agent-session.final.ai/api";
|
|
12
|
-
const DEFAULT_COMMIT_MESSAGE = "Publish with final agents publish";
|
|
7
|
+
import { errorLines } from "./output.mjs";
|
|
13
8
|
const USAGE = [
|
|
14
9
|
"usage: final-agents <command> [options]",
|
|
15
10
|
"",
|
|
16
11
|
"commands:",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
" publish
|
|
20
|
-
" channel install <key> --revision <id> --project <id> --install <id> [--replace] install or explicitly update a published channel",
|
|
12
|
+
" print <module> write the document of the agent, harness or ACP adapter",
|
|
13
|
+
" the module exports, as JSON",
|
|
14
|
+
" publish <module> --name <name> store it and point <name> at it in a project",
|
|
21
15
|
" conformance <module> run the harness conformance kit against a harness the module exports",
|
|
22
16
|
"",
|
|
23
17
|
"options:",
|
|
24
|
-
" --
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
" --
|
|
28
|
-
" --
|
|
29
|
-
" --
|
|
30
|
-
" --
|
|
31
|
-
` --port <port> dev: port to listen on (default ${DEFAULT_DEV_PORT})`,
|
|
32
|
-
' --export <name> conformance: the export to test (default "default"): a HarnessIface or { harness, dial }',
|
|
33
|
-
" --profile <name> conformance: final (default) or plain-acp-v2",
|
|
18
|
+
" --export <name> the export to use (print and publish: an agent, a harness or an ACP adapter,",
|
|
19
|
+
" found by itself when omitted;",
|
|
20
|
+
' conformance: a HarnessIface or { harness, dial }, default "default")',
|
|
21
|
+
" --name <name> publish: the name to point at it",
|
|
22
|
+
" --project <id> publish: the project (overrides FINAL_PROJECT_ID)",
|
|
23
|
+
" --host <url> agents API (overrides FINAL_API_HOST; default " + DEFAULT_AGENTS_HOST + ")",
|
|
24
|
+
" --profile <name> conformance: final (default), final-required (ACP adapters) or plain-acp-v2",
|
|
34
25
|
" --timeout <ms> conformance: per-case timeout",
|
|
35
26
|
" --json conformance: print the report as JSON",
|
|
36
27
|
"",
|
|
37
|
-
"
|
|
38
|
-
"FINAL_API_HOST selects the deployment for build and publish; it does not rewrite authored URLs.",
|
|
39
|
-
`dev reads route secrets from AGENT_LOCAL_SECRETS_JSON ({"name": "value"}), limited to the manifest's secrets.`
|
|
28
|
+
"publish authenticates with FINAL_API_KEY. print calls nothing."
|
|
40
29
|
].join("\n");
|
|
41
30
|
const envSchema = z.object({
|
|
42
31
|
FINAL_API_KEY: z.string().min(1).optional(),
|
|
43
|
-
FINAL_API_HOST: z.string().url().optional()
|
|
32
|
+
FINAL_API_HOST: z.string().url().optional(),
|
|
33
|
+
FINAL_PROJECT_ID: z.string().min(1).optional()
|
|
44
34
|
});
|
|
45
35
|
const optionsConfig = {
|
|
46
|
-
host: { type: "string" },
|
|
47
|
-
agent: { type: "string" },
|
|
48
|
-
ref: { type: "string" },
|
|
49
|
-
message: { type: "string" },
|
|
50
|
-
note: { type: "string" },
|
|
51
|
-
"no-activate": { type: "boolean" },
|
|
52
|
-
port: { type: "string" },
|
|
53
|
-
project: { type: "string" },
|
|
54
|
-
install: { type: "string" },
|
|
55
|
-
replace: { type: "boolean" },
|
|
56
|
-
revision: { type: "string" },
|
|
57
36
|
export: { type: "string" },
|
|
37
|
+
name: { type: "string" },
|
|
38
|
+
project: { type: "string" },
|
|
39
|
+
host: { type: "string" },
|
|
58
40
|
profile: { type: "string" },
|
|
59
41
|
timeout: { type: "string" },
|
|
60
42
|
json: { type: "boolean" },
|
|
@@ -77,101 +59,32 @@ const runAgentsCommand = async (deps) => {
|
|
|
77
59
|
return 2;
|
|
78
60
|
}
|
|
79
61
|
const { values, positionals } = parsedArgs.parsed;
|
|
80
|
-
const [command,
|
|
62
|
+
const [command, moduleArg, ...extra] = positionals;
|
|
81
63
|
if (values.help === true || command == null || command === "help") {
|
|
82
64
|
(command == null && values.help !== true ? output.stderr : output.stdout)(USAGE);
|
|
83
65
|
return command == null && values.help !== true ? 2 : 0;
|
|
84
66
|
}
|
|
85
|
-
if (extra.length > 0
|
|
67
|
+
if (extra.length > 0) {
|
|
86
68
|
output.stderr(`error: unexpected arguments: ${extra.join(" ")}`);
|
|
87
69
|
return 2;
|
|
88
70
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
output.stderr(
|
|
92
|
-
"error: FINAL_API_KEY must be nonempty and FINAL_API_HOST must be an absolute URL"
|
|
93
|
-
);
|
|
71
|
+
if (command !== "print" && command !== "publish" && command !== "conformance") {
|
|
72
|
+
output.stderr(`error: unknown command ${command}`);
|
|
73
|
+
output.stderr(USAGE);
|
|
94
74
|
return 2;
|
|
95
75
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
host: values.host ?? env.data.FINAL_API_HOST ?? DEFAULT_AGENTS_HOST,
|
|
100
|
-
auth: { apiKey: key },
|
|
101
|
-
fetch: deps.fetch
|
|
102
|
-
});
|
|
103
|
-
if (command === "channel") {
|
|
104
|
-
const channelKey = extra[0];
|
|
105
|
-
if (dirArg !== "install" || channelKey == null || values.revision == null || values.project == null || values.install == null) {
|
|
106
|
-
output.stderr(
|
|
107
|
-
"error: channel install needs <key> --revision <id> --project <id> --install <id>"
|
|
108
|
-
);
|
|
109
|
-
return 2;
|
|
110
|
-
}
|
|
111
|
-
if (apiKey == null) {
|
|
112
|
-
output.stderr("error: set FINAL_API_KEY to a Final API key");
|
|
113
|
-
return 2;
|
|
114
|
-
}
|
|
115
|
-
return runChannelInstall({
|
|
116
|
-
channelKey,
|
|
117
|
-
revisionId: values.revision,
|
|
118
|
-
replace: values.replace,
|
|
119
|
-
projectId: values.project,
|
|
120
|
-
connectorInstallId: values.install,
|
|
121
|
-
client: client(apiKey),
|
|
122
|
-
output
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
if (command === "build") {
|
|
126
|
-
return runBuild({ dir, client: apiKey == null ? null : client(apiKey), output });
|
|
127
|
-
}
|
|
128
|
-
if (command === "dev") {
|
|
129
|
-
const port = values.port == null ? DEFAULT_DEV_PORT : Number(values.port);
|
|
130
|
-
if (!Number.isInteger(port) || port < 0 || port > 65535) {
|
|
131
|
-
output.stderr(`error: --port must be a port number`);
|
|
132
|
-
return 2;
|
|
133
|
-
}
|
|
134
|
-
return runDev({
|
|
135
|
-
dir,
|
|
136
|
-
port,
|
|
137
|
-
env: deps.env,
|
|
138
|
-
output,
|
|
139
|
-
signal: deps.signal ?? new AbortController().signal
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
if (command === "publish") {
|
|
143
|
-
if (values.agent == null) {
|
|
144
|
-
output.stderr("error: publish needs --agent <slug>");
|
|
145
|
-
return 2;
|
|
146
|
-
}
|
|
147
|
-
if (apiKey == null) {
|
|
148
|
-
output.stderr("error: set FINAL_API_KEY to a Final API key");
|
|
149
|
-
return 2;
|
|
150
|
-
}
|
|
151
|
-
return runPublish({
|
|
152
|
-
dir,
|
|
153
|
-
agent: values.agent,
|
|
154
|
-
ref: values.ref ?? null,
|
|
155
|
-
message: values.message ?? DEFAULT_COMMIT_MESSAGE,
|
|
156
|
-
note: values.note ?? null,
|
|
157
|
-
activate: values["no-activate"] === true ? false : void 0,
|
|
158
|
-
client: client(apiKey),
|
|
159
|
-
listFiles: deps.listFiles ?? gitListFiles,
|
|
160
|
-
output
|
|
161
|
-
});
|
|
76
|
+
if (moduleArg == null) {
|
|
77
|
+
output.stderr(`error: ${command} needs <module>`);
|
|
78
|
+
return 2;
|
|
162
79
|
}
|
|
163
80
|
if (command === "conformance") {
|
|
164
|
-
if (dirArg == null) {
|
|
165
|
-
output.stderr("error: conformance needs <module>");
|
|
166
|
-
return 2;
|
|
167
|
-
}
|
|
168
81
|
const timeoutMs = values.timeout == null ? null : Number(values.timeout);
|
|
169
82
|
if (timeoutMs != null && (!Number.isInteger(timeoutMs) || timeoutMs <= 0)) {
|
|
170
83
|
output.stderr("error: --timeout must be a positive number of milliseconds");
|
|
171
84
|
return 2;
|
|
172
85
|
}
|
|
173
86
|
return runConformance({
|
|
174
|
-
module:
|
|
87
|
+
module: moduleArg,
|
|
175
88
|
exportName: values.export ?? "default",
|
|
176
89
|
profile: values.profile ?? "final",
|
|
177
90
|
timeoutMs,
|
|
@@ -182,12 +95,73 @@ const runAgentsCommand = async (deps) => {
|
|
|
182
95
|
signal: deps.signal
|
|
183
96
|
});
|
|
184
97
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
98
|
+
const env = envSchema.safeParse(deps.env);
|
|
99
|
+
if (!env.success) {
|
|
100
|
+
output.stderr(
|
|
101
|
+
"error: FINAL_API_KEY must be nonempty and FINAL_API_HOST must be an absolute URL"
|
|
102
|
+
);
|
|
103
|
+
return 2;
|
|
104
|
+
}
|
|
105
|
+
const loaded = await loadDefinitionModule({
|
|
106
|
+
module: moduleArg,
|
|
107
|
+
exportName: values.export ?? null,
|
|
108
|
+
cwd: deps.cwd,
|
|
109
|
+
importModule: deps.importModule,
|
|
110
|
+
documentOf: deps.documentOf ?? documentOf
|
|
111
|
+
});
|
|
112
|
+
if (!loaded.ok) {
|
|
113
|
+
output.stderr(`error: ${loaded.message}`);
|
|
114
|
+
return 1;
|
|
115
|
+
}
|
|
116
|
+
if (command === "print") {
|
|
117
|
+
output.stdout(JSON.stringify(loaded.document, null, 2));
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
if (values.name == null) {
|
|
121
|
+
output.stderr("error: publish needs --name <name>");
|
|
122
|
+
return 2;
|
|
123
|
+
}
|
|
124
|
+
const projectId = values.project ?? env.data.FINAL_PROJECT_ID;
|
|
125
|
+
if (projectId == null) {
|
|
126
|
+
output.stderr("error: publish needs --project <id> or FINAL_PROJECT_ID");
|
|
127
|
+
return 2;
|
|
128
|
+
}
|
|
129
|
+
const apiKey = env.data.FINAL_API_KEY;
|
|
130
|
+
if (apiKey == null) {
|
|
131
|
+
output.stderr("error: set FINAL_API_KEY to a Final API key");
|
|
132
|
+
return 2;
|
|
133
|
+
}
|
|
134
|
+
const agentDocument = loaded.kind === DefinitionKind.Agent ? loaded.document : null;
|
|
135
|
+
const client = createClient({
|
|
136
|
+
host: values.host ?? env.data.FINAL_API_HOST ?? DEFAULT_AGENTS_HOST,
|
|
137
|
+
auth: { apiKey },
|
|
138
|
+
fetch: deps.fetch,
|
|
139
|
+
localCompute: false,
|
|
140
|
+
// The document is already made; publishing sends exactly it.
|
|
141
|
+
agentCodec: {
|
|
142
|
+
documentOf: () => {
|
|
143
|
+
if (agentDocument == null) throw new Error("Only an agent has an agent document");
|
|
144
|
+
return agentDocument;
|
|
145
|
+
},
|
|
146
|
+
inProcessCodeOf: () => ({ tools: {}, hooks: {}, approvals: {} })
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
try {
|
|
150
|
+
const project = client.project({ id: projectId });
|
|
151
|
+
const name = values.name;
|
|
152
|
+
const signal = deps.signal;
|
|
153
|
+
const published = loaded.kind === DefinitionKind.Agent ? await project.agents.publish({ agent: loaded.agent, name, signal }) : loaded.kind === DefinitionKind.Harness ? await project.harnesses.publish({ harness: loaded.document, name, signal }) : await project.acpAdapters.publish({ adapter: loaded.document, name, signal });
|
|
154
|
+
output.stdout(`published ${published.name}: ${published.hash}`);
|
|
155
|
+
if ("id" in published && published.id != null) output.stdout(`id: ${published.id}`);
|
|
156
|
+
return 0;
|
|
157
|
+
} catch (cause) {
|
|
158
|
+
for (const line of errorLines(cause)) output.stderr(line);
|
|
159
|
+
return 1;
|
|
160
|
+
} finally {
|
|
161
|
+
client.close();
|
|
162
|
+
}
|
|
188
163
|
};
|
|
189
164
|
export {
|
|
190
|
-
DEFAULT_AGENTS_HOST,
|
|
191
165
|
runAgentsCommand
|
|
192
166
|
};
|
|
193
167
|
//# sourceMappingURL=cli.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/cli/cli.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"sourcesContent": ["import { parseArgs } from 'node:util';\nimport { documentOf, type AgentIface } from '@finalai/agent-definition';\nimport type { AgentDocumentIface } from '@finalai/agent-provider/document';\nimport * as z from 'zod';\nimport { createClient, DEFAULT_AGENTS_HOST, type AgentClientIface } from \"../agent-client/client.mjs\";\nimport type { FetchIface } from \"../agent-client/http.mjs\";\nimport { DefinitionKind, loadDefinitionModule, type ImportModule } from \"./agent-module.mjs\";\nimport { runConformance } from \"./conformance.mjs\";\nimport { errorLines, type OutputIface } from \"./output.mjs\";\n\n// `final-agents`: `print` writes the document of an agent, a harness or an\n// ACP adapter, `publish` gives it a name in a project, `conformance` checks a\n// harness implementation. Nothing is built or deployed: each is data.\n\nconst USAGE = [\n 'usage: final-agents <command> [options]',\n '',\n 'commands:',\n ' print <module> write the document of the agent, harness or ACP adapter',\n ' the module exports, as JSON',\n ' publish <module> --name <name> store it and point <name> at it in a project',\n ' conformance <module> run the harness conformance kit against a harness the module exports',\n '',\n 'options:',\n ' --export <name> the export to use (print and publish: an agent, a harness or an ACP adapter,',\n ' found by itself when omitted;',\n ' conformance: a HarnessIface or { harness, dial }, default \"default\")',\n ' --name <name> publish: the name to point at it',\n ' --project <id> publish: the project (overrides FINAL_PROJECT_ID)',\n ' --host <url> agents API (overrides FINAL_API_HOST; default ' +\n DEFAULT_AGENTS_HOST +\n ')',\n ' --profile <name> conformance: final (default), final-required (ACP adapters) or plain-acp-v2',\n ' --timeout <ms> conformance: per-case timeout',\n ' --json conformance: print the report as JSON',\n '',\n 'publish authenticates with FINAL_API_KEY. print calls nothing.',\n].join('\\n');\n\nconst envSchema = z.object({\n FINAL_API_KEY: z.string().min(1).optional(),\n FINAL_API_HOST: z.string().url().optional(),\n FINAL_PROJECT_ID: z.string().min(1).optional(),\n});\n\nexport interface AgentsCliDepsIface {\n argv: string[];\n env: Record<string, string | undefined>;\n cwd: string;\n output: OutputIface;\n // Seams: API requests, module loading and document making.\n fetch?: FetchIface;\n importModule?: ImportModule;\n documentOf?: (agent: AgentIface) => AgentDocumentIface;\n // Ends long-running commands; main.ts aborts it on SIGINT and SIGTERM.\n signal?: AbortSignal;\n}\n\nconst optionsConfig = {\n export: { type: 'string' },\n name: { type: 'string' },\n project: { type: 'string' },\n host: { type: 'string' },\n profile: { type: 'string' },\n timeout: { type: 'string' },\n json: { type: 'boolean' },\n help: { type: 'boolean', short: 'h' },\n} as const;\n\nconst parseCommandLine = (argv: string[]) =>\n parseArgs({ args: argv, options: optionsConfig, allowPositionals: true });\n\ntype ParsedResult =\n | { ok: true; parsed: ReturnType<typeof parseCommandLine> }\n | { ok: false; message: string };\n\nconst parse = (argv: string[]): ParsedResult => {\n try {\n return { ok: true, parsed: parseCommandLine(argv) };\n } catch (cause) {\n return { ok: false, message: cause instanceof Error ? cause.message : String(cause) };\n }\n};\n\nexport const runAgentsCommand = async (deps: AgentsCliDepsIface): Promise<number> => {\n const { output } = deps;\n const parsedArgs = parse(deps.argv);\n if (!parsedArgs.ok) {\n output.stderr(`error: ${parsedArgs.message}`);\n output.stderr(USAGE);\n return 2;\n }\n const { values, positionals } = parsedArgs.parsed;\n const [command, moduleArg, ...extra] = positionals;\n if (values.help === true || command == null || command === 'help') {\n (command == null && values.help !== true ? output.stderr : output.stdout)(USAGE);\n return command == null && values.help !== true ? 2 : 0;\n }\n if (extra.length > 0) {\n output.stderr(`error: unexpected arguments: ${extra.join(' ')}`);\n return 2;\n }\n if (command !== 'print' && command !== 'publish' && command !== 'conformance') {\n output.stderr(`error: unknown command ${command}`);\n output.stderr(USAGE);\n return 2;\n }\n if (moduleArg == null) {\n output.stderr(`error: ${command} needs <module>`);\n return 2;\n }\n\n if (command === 'conformance') {\n const timeoutMs = values.timeout == null ? null : Number(values.timeout);\n if (timeoutMs != null && (!Number.isInteger(timeoutMs) || timeoutMs <= 0)) {\n output.stderr('error: --timeout must be a positive number of milliseconds');\n return 2;\n }\n return runConformance({\n module: moduleArg,\n exportName: values.export ?? 'default',\n profile: values.profile ?? 'final',\n timeoutMs,\n json: values.json === true,\n cwd: deps.cwd,\n output,\n importModule: deps.importModule,\n signal: deps.signal,\n });\n }\n\n const env = envSchema.safeParse(deps.env);\n if (!env.success) {\n output.stderr(\n 'error: FINAL_API_KEY must be nonempty and FINAL_API_HOST must be an absolute URL',\n );\n return 2;\n }\n const loaded = await loadDefinitionModule({\n module: moduleArg,\n exportName: values.export ?? null,\n cwd: deps.cwd,\n importModule: deps.importModule,\n documentOf: deps.documentOf ?? documentOf,\n });\n if (!loaded.ok) {\n output.stderr(`error: ${loaded.message}`);\n return 1;\n }\n\n if (command === 'print') {\n output.stdout(JSON.stringify(loaded.document, null, 2));\n return 0;\n }\n\n if (values.name == null) {\n output.stderr('error: publish needs --name <name>');\n return 2;\n }\n const projectId = values.project ?? env.data.FINAL_PROJECT_ID;\n if (projectId == null) {\n output.stderr('error: publish needs --project <id> or FINAL_PROJECT_ID');\n return 2;\n }\n const apiKey = env.data.FINAL_API_KEY;\n if (apiKey == null) {\n output.stderr('error: set FINAL_API_KEY to a Final API key');\n return 2;\n }\n const agentDocument = loaded.kind === DefinitionKind.Agent ? loaded.document : null;\n const client: AgentClientIface = createClient({\n host: values.host ?? env.data.FINAL_API_HOST ?? DEFAULT_AGENTS_HOST,\n auth: { apiKey },\n fetch: deps.fetch,\n localCompute: false,\n // The document is already made; publishing sends exactly it.\n agentCodec: {\n documentOf: () => {\n if (agentDocument == null) throw new Error('Only an agent has an agent document');\n return agentDocument;\n },\n inProcessCodeOf: () => ({ tools: {}, hooks: {}, approvals: {} }),\n },\n });\n try {\n const project = client.project({ id: projectId });\n const name = values.name;\n const signal = deps.signal;\n const published =\n loaded.kind === DefinitionKind.Agent\n ? await project.agents.publish({ agent: loaded.agent, name, signal })\n : loaded.kind === DefinitionKind.Harness\n ? await project.harnesses.publish({ harness: loaded.document, name, signal })\n : await project.acpAdapters.publish({ adapter: loaded.document, name, signal });\n output.stdout(`published ${published.name}: ${published.hash}`);\n if ('id' in published && published.id != null) output.stdout(`id: ${published.id}`);\n return 0;\n } catch (cause) {\n for (const line of errorLines(cause)) output.stderr(line);\n return 1;\n } finally {\n client.close();\n }\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,kBAAmC;AAE5C,YAAY,OAAO;AACnB,SAAS,cAAc,2BAAkD;AAEzE,SAAS,gBAAgB,4BAA+C;AACxE,SAAS,sBAAsB;AAC/B,SAAS,kBAAoC;AAM7C,MAAM,QAAQ;AAAA,EACZ;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,yEACE,sBACA;AAAA,EACF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,MAAM,YAAY,EAAE,OAAO;AAAA,EACzB,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAC1C,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC1C,kBAAkB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAC/C,CAAC;AAeD,MAAM,gBAAgB;AAAA,EACpB,QAAQ,EAAE,MAAM,SAAS;AAAA,EACzB,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,SAAS,EAAE,MAAM,SAAS;AAAA,EAC1B,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,SAAS,EAAE,MAAM,SAAS;AAAA,EAC1B,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-1,12 +1,9 @@
|
|
|
1
1
|
import { type HarnessEndpointIface, type HarnessIface } from '@finalai/agent-provider';
|
|
2
2
|
import { type ConformanceStreamIface, type HarnessConformanceReportIface, type RunHarnessConformanceArgsIface } from '@finalai/agent-provider/conformance';
|
|
3
|
-
import
|
|
3
|
+
import { type ImportModule, type ModuleNamespace } from "./agent-module.mjs";
|
|
4
4
|
import type { OutputIface } from "./output.mjs";
|
|
5
|
-
|
|
6
|
-
/** An imported module's exports, before the conformance export is parsed. */
|
|
7
|
-
export type ModuleNamespace = z.output<typeof moduleNamespaceSchema>;
|
|
5
|
+
export type { ImportModule, ModuleNamespace } from "./agent-module.mjs";
|
|
8
6
|
type ModuleExport = ModuleNamespace[string];
|
|
9
|
-
export type ImportModule = (url: string) => Promise<ModuleNamespace>;
|
|
10
7
|
export interface ConformanceTargetIface {
|
|
11
8
|
harness: HarnessIface;
|
|
12
9
|
dial: RunHarnessConformanceArgsIface['dial'];
|
|
@@ -33,4 +30,3 @@ export declare const runConformance: (args: {
|
|
|
33
30
|
importModule?: ImportModule;
|
|
34
31
|
signal?: AbortSignal;
|
|
35
32
|
}) => Promise<number>;
|
|
36
|
-
export {};
|
|
@@ -19,15 +19,11 @@ import { resolve } from "node:path";
|
|
|
19
19
|
import { pathToFileURL } from "node:url";
|
|
20
20
|
import WebSocket from "ws";
|
|
21
21
|
import * as z from "zod";
|
|
22
|
-
|
|
23
|
-
const importModule = async (url) => moduleNamespaceSchema.parse(await import(
|
|
24
|
-
/* @vite-ignore */
|
|
25
|
-
url
|
|
26
|
-
));
|
|
22
|
+
import { importModule } from "./agent-module.mjs";
|
|
27
23
|
const functionCheck = z.function();
|
|
28
24
|
const isFunction = (value) => functionCheck.safeParse(value).success;
|
|
29
25
|
const harnessMethodsSchema = z.looseObject({
|
|
30
|
-
|
|
26
|
+
definition: z.looseObject({}),
|
|
31
27
|
open: z.custom(isFunction),
|
|
32
28
|
resume: z.custom(isFunction),
|
|
33
29
|
park: z.custom(isFunction),
|
|
@@ -120,8 +116,9 @@ const dialHarnessEndpoint = async (endpoint) => {
|
|
|
120
116
|
return { ...stream, close: () => child.kill("SIGTERM") };
|
|
121
117
|
}
|
|
122
118
|
case AcpTransport.Relay:
|
|
119
|
+
case AcpTransport.Sandbox:
|
|
123
120
|
throw new Error(
|
|
124
|
-
|
|
121
|
+
`${endpoint.transport} endpoints are dialed by the session plane; export { harness, dial } to run them here`
|
|
125
122
|
);
|
|
126
123
|
}
|
|
127
124
|
};
|
|
@@ -163,7 +160,7 @@ const runConformance = async (args) => {
|
|
|
163
160
|
const profile = z.nativeEnum(ConformanceProfile).safeParse(args.profile);
|
|
164
161
|
if (!profile.success) {
|
|
165
162
|
args.output.stderr(
|
|
166
|
-
`error: --profile must be ${Object.values(ConformanceProfile).join("
|
|
163
|
+
`error: --profile must be one of ${Object.values(ConformanceProfile).join(", ")}`
|
|
167
164
|
);
|
|
168
165
|
return 2;
|
|
169
166
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/cli/conformance.ts"],
|
|
4
|
-
"sourcesContent": ["import { createHttpStream } from '@agentclientprotocol/sdk/experimental/http-client';\nimport { ndJsonStream } from '@agentclientprotocol/sdk/experimental/v2';\nimport { createWebSocketStream } from '@agentclientprotocol/sdk/experimental/ws-client';\nimport {\n AcpTransport,\n type HarnessEndpointIface,\n type HarnessIface,\n} from '@finalai/agent-provider';\nimport {\n ConformanceCaseStatus,\n ConformanceProfile,\n conformanceOpenArgs,\n runHarnessConformance,\n type ConformanceStreamIface,\n type HarnessConformanceReportIface,\n type RunHarnessConformanceArgsIface,\n} from '@finalai/agent-provider/conformance';\nimport {\n configureNodeClientWebSocket,\n createNodeClientTlsSession,\n} from '@finalai/websockets/node-client-tls';\nimport { spawn } from 'node:child_process';\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport WebSocket from 'ws';\nimport * as z from 'zod';\nimport type { OutputIface } from \"./output.mjs\";\n\n// `final-agents conformance <module>` exercises the public lifecycle and ACP\n// contracts of a harness exported by a module. The export is a HarnessIface, or `{ harness, dial }
|
|
5
|
-
"mappings": "AAAA,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAC9B,OAAO,eAAe;AACtB,YAAY,OAAO;
|
|
4
|
+
"sourcesContent": ["import { createHttpStream } from '@agentclientprotocol/sdk/experimental/http-client';\nimport { ndJsonStream } from '@agentclientprotocol/sdk/experimental/v2';\nimport { createWebSocketStream } from '@agentclientprotocol/sdk/experimental/ws-client';\nimport {\n AcpTransport,\n type HarnessEndpointIface,\n type HarnessIface,\n} from '@finalai/agent-provider';\nimport {\n ConformanceCaseStatus,\n ConformanceProfile,\n conformanceOpenArgs,\n runHarnessConformance,\n type ConformanceStreamIface,\n type HarnessConformanceReportIface,\n type RunHarnessConformanceArgsIface,\n} from '@finalai/agent-provider/conformance';\nimport {\n configureNodeClientWebSocket,\n createNodeClientTlsSession,\n} from '@finalai/websockets/node-client-tls';\nimport { spawn } from 'node:child_process';\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport WebSocket from 'ws';\nimport * as z from 'zod';\nimport { importModule, type ImportModule, type ModuleNamespace } from \"./agent-module.mjs\";\nimport type { OutputIface } from \"./output.mjs\";\n\nexport type { ImportModule, ModuleNamespace } from \"./agent-module.mjs\";\n\n// `final-agents conformance <module>` exercises the public lifecycle and ACP\n// contracts of a harness exported by a module. The export is a HarnessIface (its definition\n// and lifecycle), or `{ harness, dial }` (with optional `nativeSessionId`) when its endpoints\n// need a dialer of its own.\n\ntype ModuleExport = ModuleNamespace[string];\n\nexport interface ConformanceTargetIface {\n harness: HarnessIface;\n dial: RunHarnessConformanceArgsIface['dial'];\n nativeSessionId?: RunHarnessConformanceArgsIface['nativeSessionId'];\n}\n\n// zod's function check, so functions from any realm qualify.\nconst functionCheck = z.function();\nconst isFunction = (value: ModuleExport): boolean => functionCheck.safeParse(value).success;\n\nconst harnessMethodsSchema = z.looseObject({\n definition: z.looseObject({}),\n open: z.custom(isFunction),\n resume: z.custom(isFunction),\n park: z.custom(isFunction),\n close: z.custom(isFunction),\n health: z.custom(isFunction),\n});\n// An object with the methods, or a callable carrying them.\nconst harnessSchema = z.custom<HarnessIface>(\n (value) =>\n harnessMethodsSchema.safeParse(isFunction(value) ? Object.assign({}, value) : value).success,\n);\nconst dialSchema = z.custom<ConformanceTargetIface['dial']>(\n isFunction,\n '`dial` must be a function',\n);\nconst nativeSessionIdSchema = z.custom<NonNullable<ConformanceTargetIface['nativeSessionId']>>(\n isFunction,\n '`nativeSessionId` must be a function',\n);\nconst targetFieldsSchema = z.looseObject({\n harness: harnessSchema,\n dial: dialSchema.optional(),\n nativeSessionId: nativeSessionIdSchema.optional(),\n});\n\n// Dials the endpoint kinds a harness outside Final can return: stdio programs,\n// Streamable HTTP and WebSocket, including header authentication and client TLS.\n// Relay endpoints are Final-managed.\nexport const dialHarnessEndpoint = async (\n endpoint: HarnessEndpointIface,\n): Promise<ConformanceStreamIface> => {\n switch (endpoint.transport) {\n case AcpTransport.Http: {\n const headers = { ...endpoint.headers, ...(await endpoint.resolveHeaders?.()) };\n const tlsSession =\n endpoint.tls == null ? null : createNodeClientTlsSession({ tls: endpoint.tls });\n const stream = createHttpStream(endpoint.url, {\n headers,\n cookies: 'omit',\n fetch: tlsSession?.fetch,\n });\n return {\n ...stream,\n close: () => {\n void stream.writable.close().catch(() => undefined);\n void tlsSession?.close().catch(() => undefined);\n },\n };\n }\n case AcpTransport.Ws: {\n const headers = { ...endpoint.headers, ...(await endpoint.resolveHeaders?.()) };\n const stream = createWebSocketStream(endpoint.url, {\n cookies: 'omit',\n headers,\n WebSocket: configureNodeClientWebSocket({ constructor: WebSocket, tls: endpoint.tls }),\n });\n return {\n ...stream,\n close: () => void stream.writable.close().catch(() => undefined),\n };\n }\n case AcpTransport.Stdio: {\n const child = spawn(endpoint.command, endpoint.args, {\n env: { ...process.env, ...endpoint.env },\n stdio: ['pipe', 'pipe', 'inherit'],\n });\n child.stdin.on('error', () => undefined);\n let open = true;\n const input = new ReadableStream<Uint8Array>({\n start: (controller) => {\n child.stdout.on('data', (chunk: Buffer) => {\n if (open) controller.enqueue(new Uint8Array(chunk));\n });\n child.stdout.on('end', () => {\n if (!open) return;\n open = false;\n controller.close();\n });\n child.on('error', (error) => {\n if (!open) return;\n open = false;\n controller.error(error);\n });\n },\n cancel: () => {\n open = false;\n child.stdout.destroy();\n },\n });\n const output = new WritableStream<Uint8Array>({\n write: (chunk) =>\n new Promise<void>((done, fail) => {\n child.stdin.write(chunk, (error) => (error == null ? done() : fail(error)));\n }),\n close: () => {\n child.stdin.end();\n },\n });\n const stream = ndJsonStream(output, input);\n return { ...stream, close: () => child.kill('SIGTERM') };\n }\n case AcpTransport.Relay:\n case AcpTransport.Sandbox:\n throw new Error(\n `${endpoint.transport} endpoints are dialed by the session plane; export { harness, dial } to run them here`,\n );\n }\n};\n\nexport type ConformanceTargetResult =\n | { ok: true; target: ConformanceTargetIface }\n | { ok: false; message: string };\n\n// The export as a conformance target: a HarnessIface (dialed built in), or\n// `{ harness, dial?, nativeSessionId? }`.\nexport const conformanceTargetOf = (value: ModuleExport): ConformanceTargetResult => {\n const harness = harnessSchema.safeParse(value);\n if (harness.success)\n return { ok: true, target: { harness: harness.data, dial: dialHarnessEndpoint } };\n const fields = targetFieldsSchema.safeParse(value);\n if (!fields.success) {\n const issue = fields.error.issues.find((entry) => entry.path[0] !== 'harness');\n return {\n ok: false,\n message:\n issue?.message ??\n 'the export must be a HarnessIface or { harness, dial?, nativeSessionId? }',\n };\n }\n return {\n ok: true,\n target: {\n harness: fields.data.harness,\n dial: fields.data.dial ?? dialHarnessEndpoint,\n nativeSessionId: fields.data.nativeSessionId,\n },\n };\n};\n\nconst statusLabel = {\n [ConformanceCaseStatus.Passed]: 'pass',\n [ConformanceCaseStatus.Failed]: 'FAIL',\n [ConformanceCaseStatus.Skipped]: 'skip',\n} satisfies Record<ConformanceCaseStatus, string>;\n\nexport const reportLines = (report: HarnessConformanceReportIface): string[] => [\n `profile: ${report.profile}`,\n ...report.cases.map((entry) => {\n const why = entry.error ?? entry.detail;\n return `${statusLabel[entry.status]} ${entry.name}${why == null ? '' : ` (${why})`}`;\n }),\n report.passed ? 'conformance: passed' : 'conformance: failed',\n];\n\nexport const runConformance = async (args: {\n module: string;\n exportName: string;\n profile: string;\n timeoutMs: number | null;\n json: boolean;\n cwd: string;\n output: OutputIface;\n importModule?: ImportModule;\n // SIGINT/SIGTERM (main.ts): the kit has no cancellation, so the command stops\n // waiting for it and the process exits.\n signal?: AbortSignal;\n}): Promise<number> => {\n const profile = z.nativeEnum(ConformanceProfile).safeParse(args.profile);\n if (!profile.success) {\n args.output.stderr(\n `error: --profile must be one of ${Object.values(ConformanceProfile).join(', ')}`,\n );\n return 2;\n }\n const url = pathToFileURL(resolve(args.cwd, args.module)).href;\n let loaded: ModuleNamespace;\n try {\n loaded = await (args.importModule ?? importModule)(url);\n } catch (cause) {\n args.output.stderr(\n `error: cannot load ${args.module}: ${cause instanceof Error ? cause.message : String(cause)}`,\n );\n return 1;\n }\n if (!(args.exportName in loaded)) {\n args.output.stderr(`error: ${args.module} has no export ${args.exportName}`);\n return 1;\n }\n const parsed = conformanceTargetOf(loaded[args.exportName]);\n if (!parsed.ok) {\n args.output.stderr(`error: ${args.module}#${args.exportName}: ${parsed.message}`);\n return 1;\n }\n const target = parsed.target;\n const run = runHarnessConformance({\n harness: target.harness,\n dial: target.dial,\n nativeSessionId: target.nativeSessionId,\n profile: profile.data,\n openArgs: conformanceOpenArgs(),\n timeoutMs: args.timeoutMs ?? undefined,\n cwd: args.cwd,\n });\n const signal = args.signal;\n const interrupted =\n signal == null\n ? null\n : new Promise<null>((done) => {\n if (signal.aborted) done(null);\n else signal.addEventListener('abort', () => done(null), { once: true });\n });\n const report = await (interrupted == null ? run : Promise.race([run, interrupted]));\n if (report == null) {\n run.catch(() => undefined);\n args.output.stderr('conformance: interrupted');\n return 130;\n }\n if (args.json) args.output.stdout(JSON.stringify(report, null, 2));\n else for (const line of reportLines(report)) args.output.stdout(line);\n return report.passed ? 0 : 1;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAC9B,OAAO,eAAe;AACtB,YAAY,OAAO;AACnB,SAAS,oBAA6D;AAmBtE,MAAM,gBAAgB,EAAE,SAAS;AACjC,MAAM,aAAa,CAAC,UAAiC,cAAc,UAAU,KAAK,EAAE;AAEpF,MAAM,uBAAuB,EAAE,YAAY;AAAA,EACzC,YAAY,EAAE,YAAY,CAAC,CAAC;AAAA,EAC5B,MAAM,EAAE,OAAO,UAAU;AAAA,EACzB,QAAQ,EAAE,OAAO,UAAU;AAAA,EAC3B,MAAM,EAAE,OAAO,UAAU;AAAA,EACzB,OAAO,EAAE,OAAO,UAAU;AAAA,EAC1B,QAAQ,EAAE,OAAO,UAAU;AAC7B,CAAC;AAED,MAAM,gBAAgB,EAAE;AAAA,EACtB,CAAC,UACC,qBAAqB,UAAU,WAAW,KAAK,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,IAAI,KAAK,EAAE;AACzF;AACA,MAAM,aAAa,EAAE;AAAA,EACnB;AAAA,EACA;AACF;AACA,MAAM,wBAAwB,EAAE;AAAA,EAC9B;AAAA,EACA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MAAM,CAAC,CAAC;AAAA,MAC5D,YAAW,QAAQ,YAAY,MAAM,EAAG,MAAK,OAAO,OAAO,IAAI;AACpE,SAAO,OAAO,SAAS,IAAI;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/cli/main.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\nimport 'zod/compile';\nimport { runAgentsCommand } from \"./cli.mjs\";\n\n// `final-agents
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\nimport 'zod/compile';\nimport { runAgentsCommand } from \"./cli.mjs\";\n\n// `final-agents print|publish|conformance`: `final agents \u2026` until a general `final` CLI exists.\n\nconst stop = new AbortController();\nfor (const signal of ['SIGINT', 'SIGTERM'] as const) process.once(signal, () => stop.abort());\n\nprocess.exit(\n await runAgentsCommand({\n argv: process.argv.slice(2),\n env: process.env,\n cwd: process.cwd(),\n signal: stop.signal,\n output: {\n stdout: (line) => process.stdout.write(`${line}\\n`),\n stderr: (line) => process.stderr.write(`${line}\\n`),\n },\n }),\n);\n"],
|
|
5
5
|
"mappings": ";AACA,OAAO;AACP,SAAS,wBAAwB;AAIjC,MAAM,OAAO,IAAI,gBAAgB;AACjC,WAAW,UAAU,CAAC,UAAU,SAAS,EAAY,SAAQ,KAAK,QAAQ,MAAM,KAAK,MAAM,CAAC;AAE5F,QAAQ;AAAA,EACN,MAAM,iBAAiB;AAAA,IACrB,MAAM,QAAQ,KAAK,MAAM,CAAC;AAAA,IAC1B,KAAK,QAAQ;AAAA,IACb,KAAK,QAAQ,IAAI;AAAA,IACjB,QAAQ,KAAK;AAAA,IACb,QAAQ;AAAA,MACN,QAAQ,CAAC,SAAS,QAAQ,OAAO,MAAM,GAAG,IAAI;AAAA,CAAI;AAAA,MAClD,QAAQ,CAAC,SAAS,QAAQ,OAAO,MAAM,GAAG,IAAI;AAAA,CAAI;AAAA,IACpD;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import type { CompatibilityReportIface } from '@finalai/agent-definition/compatibility';
|
|
2
|
-
import type { DiagnosticIface } from '@finalai/agent-definition/compiler';
|
|
3
|
-
import { type AgentManifestIface } from '@finalai/agent-provider';
|
|
4
|
-
import { type PublishResultIface } from "../agent-client/index.mjs";
|
|
5
1
|
export interface OutputIface {
|
|
6
2
|
stdout: (line: string) => void;
|
|
7
3
|
stderr: (line: string) => void;
|
|
8
4
|
}
|
|
9
|
-
export declare const manifestSummaryLines: (manifest: AgentManifestIface) => string[];
|
|
10
|
-
export declare const hookLines: (manifest: AgentManifestIface) => string[];
|
|
11
|
-
export declare const reportLines: (report: CompatibilityReportIface) => string[];
|
|
12
|
-
export declare const diagnosticLine: (item: DiagnosticIface) => string;
|
|
13
5
|
export declare const errorLines: (cause: unknown) => string[];
|
|
14
|
-
export declare const publishResultLines: (result: PublishResultIface) => string[];
|