@finalai/agents 0.11.0 → 0.13.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 +128 -16
- package/dist/modules/agent-client/channels.mjs +216 -33
- package/dist/modules/agent-client/channels.mjs.map +2 -2
- package/dist/modules/agent-client/client.d.mts +91 -21
- package/dist/modules/agent-client/client.mjs +79 -24
- 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 +102 -0
- package/dist/modules/agent-client/conversation-resources.mjs +178 -0
- package/dist/modules/agent-client/conversation-resources.mjs.map +7 -0
- package/dist/modules/agent-client/conversations.d.mts +120 -38
- package/dist/modules/agent-client/conversations.mjs +386 -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 +48 -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 +72 -0
- package/dist/modules/agent-client/sandboxes.mjs +138 -0
- package/dist/modules/agent-client/sandboxes.mjs.map +7 -0
- package/dist/modules/agent-client/schedules.d.mts +9 -0
- package/dist/modules/agent-client/schedules.mjs +17 -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 +37 -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/final-channel.d.mts +0 -1
- package/dist/modules/authoring/final-channel.mjs +0 -2
- package/dist/modules/authoring/final-channel.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
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
# Release Scout
|
|
1
|
+
# Release Scout
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
One agent with one tool of each kind, and three ways to start it.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- `agent.ts` defines the agent. `lookup_release_notes` is a serverless tool: its
|
|
6
|
+
source is part of the agent's data and it runs on Final's runtime.
|
|
7
|
+
`find_order` is an in-process tool: it uses this app's database (`db.ts`) and
|
|
8
|
+
runs in the process that created the session.
|
|
9
|
+
- `run.ts` is the smallest caller. It provides a harness and the `issues`
|
|
10
|
+
integration and leaves `compute` out, so the model's files and shell run in
|
|
11
|
+
the script's own process. When the script exits the session carries on, and
|
|
12
|
+
`find_order` and the shell report themselves unavailable.
|
|
13
|
+
- `run-on-a-computer.ts` moves files and shell to a cloud computer with a
|
|
14
|
+
sandbox setup. Where the tools run does not change.
|
|
15
|
+
- `by-name.ts` fetches the published agent by name. A fetched agent is data
|
|
16
|
+
only, so its in-process tool cannot run there and the call fails with
|
|
17
|
+
`requirements_unmet`, naming `find_order`.
|
|
6
18
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Git and `gh` are pre-authenticated in the sandbox.
|
|
12
|
-
|
|
13
|
-
Conversation deliveries include session and turn ids. The example reconstructs each response with `session.response(turnId)` and waits for its durable completion, so a blank or failed turn cannot leave it waiting for a missed conversation event. Read receipts again with `conversation.deliveries({ messageId })` after a reconnect or for a delivery admitted under the queue policy.
|
|
19
|
+
Publish it with `final-agents publish examples/release-scout/agent.ts --name release-scout`
|
|
20
|
+
(with `FINAL_API_KEY` and `FINAL_PROJECT_ID` set), and print its document with
|
|
21
|
+
`final-agents print examples/release-scout/agent.ts`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineAgent, defineInProcessTool, defineServerlessTool, markdown } from '@finalai/agents';
|
|
2
|
+
import { FinalHarness } from '@finalai/agents/harnesses';
|
|
3
|
+
import * as z from 'zod';
|
|
4
|
+
import { orders } from './db.js';
|
|
5
|
+
|
|
6
|
+
// Self-contained, so it runs on Final's runtime: it keeps working when this app is not running.
|
|
7
|
+
const lookupReleaseNotes = defineServerlessTool({
|
|
8
|
+
description: 'Fetch the published notes for a release.',
|
|
9
|
+
inputSchema: z.object({ version: z.string() }),
|
|
10
|
+
execute: async ({ version }) => {
|
|
11
|
+
const response = await fetch(`https://releases.example.com/${version}.md`);
|
|
12
|
+
return { found: response.ok, notes: response.ok ? await response.text() : null };
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Uses this app's database connection, so it runs in the process that created the session.
|
|
17
|
+
const findOrder = defineInProcessTool({
|
|
18
|
+
description: 'Look up an order by id.',
|
|
19
|
+
inputSchema: z.object({ id: z.string() }),
|
|
20
|
+
execute: async ({ id }) => orders.find(id),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const agent = defineAgent({
|
|
24
|
+
name: 'Release Scout',
|
|
25
|
+
instructions: markdown('./instructions.md', { from: import.meta.url }),
|
|
26
|
+
// The key is the tool's name.
|
|
27
|
+
tools: { lookup_release_notes: lookupReleaseNotes, find_order: findOrder },
|
|
28
|
+
require: {
|
|
29
|
+
harness: {
|
|
30
|
+
// A limit: binding.
|
|
31
|
+
permissionMode: 'ask',
|
|
32
|
+
// A hint: binds nobody.
|
|
33
|
+
recommended: { harness: FinalHarness.Pi, model: 'gpt-6.1-sol', reasoning: 'high' },
|
|
34
|
+
},
|
|
35
|
+
// Keyed by capability: what the model drives.
|
|
36
|
+
compute: { files: 'write', shell: 'execute' },
|
|
37
|
+
integrations: {
|
|
38
|
+
issues: { description: 'Issue tracker', tools: { deny: ['delete_*'] } },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createClient, isRequirementsUnmetError } from '@finalai/agents/client';
|
|
2
|
+
import {
|
|
3
|
+
apiKey,
|
|
4
|
+
finalCredits,
|
|
5
|
+
serverlessNanocodeClaude,
|
|
6
|
+
subscription,
|
|
7
|
+
} from '@finalai/agents/harnesses';
|
|
8
|
+
|
|
9
|
+
// An agent is always an object. When all you have is a name, fetch it: the
|
|
10
|
+
// result is data only. Release Scout's `find_order` is an in-process tool, and
|
|
11
|
+
// this process does not hold its code, so starting it fails and names the tool.
|
|
12
|
+
// An agent meant to be started by callers that only fetch it uses serverless tools.
|
|
13
|
+
|
|
14
|
+
const key = process.env.FINAL_API_KEY;
|
|
15
|
+
const projectId = process.env.FINAL_PROJECT_ID;
|
|
16
|
+
if (key == null || projectId == null) throw new Error('Set FINAL_API_KEY and FINAL_PROJECT_ID');
|
|
17
|
+
|
|
18
|
+
// A server never lends its own process to an agent: an omitted capability fails instead.
|
|
19
|
+
const client = createClient({ auth: { apiKey: key }, localCompute: false });
|
|
20
|
+
const project = client.project({ id: projectId });
|
|
21
|
+
|
|
22
|
+
const agent = await project.agents.get({ name: 'release-scout' });
|
|
23
|
+
const linear = await project.integrations.get({ name: 'linear' });
|
|
24
|
+
const box = await project.sandboxes.get(process.env.SANDBOX_ID ?? 'asbx_missing');
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
await project.sessions.create({
|
|
28
|
+
agent,
|
|
29
|
+
provide: {
|
|
30
|
+
harness: serverlessNanocodeClaude({
|
|
31
|
+
model: 'claude-opus-5-5',
|
|
32
|
+
// This person's subscription, else the project's key, else Final's metered inference.
|
|
33
|
+
inference: [subscription(), apiKey('ANTHROPIC_API_KEY'), finalCredits()],
|
|
34
|
+
}),
|
|
35
|
+
compute: { files: box, shell: box },
|
|
36
|
+
integrations: { issues: linear },
|
|
37
|
+
},
|
|
38
|
+
message: 'Did 2.4.1 ship?',
|
|
39
|
+
});
|
|
40
|
+
} catch (cause) {
|
|
41
|
+
if (!isRequirementsUnmetError(cause)) throw cause;
|
|
42
|
+
for (const item of cause.requirements) console.log(`${item.kind} ${item.name}: ${item.problem}`);
|
|
43
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createClient } from '@finalai/agents/client';
|
|
2
|
+
import { finalCredits, serverlessPi } from '@finalai/agents/harnesses';
|
|
3
|
+
import { computer, defineSandboxSetup } from '@finalai/agents/sandboxes';
|
|
4
|
+
import { agent } from './agent.js';
|
|
5
|
+
|
|
6
|
+
// The same agent with the model's files and shell on a cloud computer. Where its
|
|
7
|
+
// tools run does not change.
|
|
8
|
+
|
|
9
|
+
const apiKey = process.env.FINAL_API_KEY;
|
|
10
|
+
const projectId = process.env.FINAL_PROJECT_ID;
|
|
11
|
+
if (apiKey == null || projectId == null) throw new Error('Set FINAL_API_KEY and FINAL_PROJECT_ID');
|
|
12
|
+
|
|
13
|
+
const client = createClient({ auth: { apiKey } });
|
|
14
|
+
const project = client.project({ id: projectId });
|
|
15
|
+
|
|
16
|
+
// Provider-neutral: what should be on the machine.
|
|
17
|
+
const setup = defineSandboxSetup({
|
|
18
|
+
repositories: [{ alias: 'app', url: 'https://github.com/acme/app.git', ref: 'main' }],
|
|
19
|
+
variables: { NPM_TOKEN: { secret: 'NPM_TOKEN' } },
|
|
20
|
+
steps: [{ cwd: 'app', run: 'pnpm install' }],
|
|
21
|
+
});
|
|
22
|
+
const box = await project.sandboxes.create(
|
|
23
|
+
computer({ image: 'docker.io/library/node:26-bookworm' }),
|
|
24
|
+
{
|
|
25
|
+
setup,
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
const linear = await project.integrations.get({ name: 'linear' });
|
|
29
|
+
// Pi itself runs as a worker program, in a Workers sandbox the session owns (created for you).
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
const { response } = await project.sessions.create({
|
|
33
|
+
agent,
|
|
34
|
+
provide: {
|
|
35
|
+
harness: serverlessPi({
|
|
36
|
+
model: 'gpt-6.1-sol',
|
|
37
|
+
reasoning: 'high',
|
|
38
|
+
inference: finalCredits(),
|
|
39
|
+
}),
|
|
40
|
+
// Must be the same sandbox.
|
|
41
|
+
compute: { files: box, shell: box },
|
|
42
|
+
integrations: { issues: linear },
|
|
43
|
+
},
|
|
44
|
+
message: 'Did 2.4.1 ship?',
|
|
45
|
+
});
|
|
46
|
+
console.log(await response?.text());
|
|
47
|
+
} finally {
|
|
48
|
+
await box.delete();
|
|
49
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createClient } from '@finalai/agents/client';
|
|
2
|
+
import { finalCredits, serverlessPi } from '@finalai/agents/harnesses';
|
|
3
|
+
import { oauth } from '@finalai/agents/integrations';
|
|
4
|
+
import { agent } from './agent.js';
|
|
5
|
+
|
|
6
|
+
// The smallest caller. Nothing is provided under `compute`, so the model's files
|
|
7
|
+
// and shell run in this script's process, on this machine. `find_order` runs
|
|
8
|
+
// here too; `lookup_release_notes` runs on Final's runtime from the agent's data.
|
|
9
|
+
|
|
10
|
+
const apiKey = process.env.FINAL_API_KEY;
|
|
11
|
+
const projectId = process.env.FINAL_PROJECT_ID;
|
|
12
|
+
if (apiKey == null || projectId == null) throw new Error('Set FINAL_API_KEY and FINAL_PROJECT_ID');
|
|
13
|
+
|
|
14
|
+
const client = createClient({ auth: { apiKey } });
|
|
15
|
+
// Everything below belongs to this project.
|
|
16
|
+
const project = client.project({ id: projectId });
|
|
17
|
+
|
|
18
|
+
const linear = await project.integrations.create({
|
|
19
|
+
name: 'linear',
|
|
20
|
+
mcp: { url: 'https://mcp.linear.app/mcp' },
|
|
21
|
+
auth: oauth({ credential: 'shared' }),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Pi runs as a worker program, in a Workers sandbox the session owns (created for you).
|
|
25
|
+
const { response } = await project.sessions.create({
|
|
26
|
+
agent,
|
|
27
|
+
provide: {
|
|
28
|
+
harness: serverlessPi({
|
|
29
|
+
model: 'gpt-6.1-sol',
|
|
30
|
+
reasoning: 'high',
|
|
31
|
+
inference: finalCredits(),
|
|
32
|
+
}),
|
|
33
|
+
integrations: { issues: linear },
|
|
34
|
+
},
|
|
35
|
+
message: 'Did 2.4.1 ship?',
|
|
36
|
+
});
|
|
37
|
+
// Leaving out `harness` or `issues` makes the call fail with `requirements_unmet`, naming what is missing.
|
|
38
|
+
console.log(await response?.text());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finalai/agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Agent authoring, client APIs, and CLI.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"README.md",
|
|
14
14
|
"LICENSE",
|
|
15
15
|
"NOTICE",
|
|
16
|
-
"HOSTING.md"
|
|
17
|
-
"THIRD_PARTY_NOTICES.md"
|
|
16
|
+
"HOSTING.md"
|
|
18
17
|
],
|
|
19
18
|
"type": "module",
|
|
20
19
|
"sideEffects": [
|
|
@@ -24,8 +23,8 @@
|
|
|
24
23
|
"exports": {
|
|
25
24
|
".": {
|
|
26
25
|
"types": "./dist/modules/index.d.mts",
|
|
27
|
-
"
|
|
28
|
-
"default": "./dist/modules/index.
|
|
26
|
+
"import": "./dist/modules/index.mjs",
|
|
27
|
+
"default": "./dist/modules/index.mjs"
|
|
29
28
|
},
|
|
30
29
|
"./client": {
|
|
31
30
|
"types": "./dist/modules/agent-client/index.d.mts",
|
|
@@ -37,10 +36,20 @@
|
|
|
37
36
|
"import": "./dist/modules/agent-client/acp.mjs",
|
|
38
37
|
"default": "./dist/modules/agent-client/acp.mjs"
|
|
39
38
|
},
|
|
40
|
-
"./
|
|
41
|
-
"types": "./dist/modules/
|
|
42
|
-
"import": "./dist/modules/
|
|
43
|
-
"default": "./dist/modules/
|
|
39
|
+
"./client/http": {
|
|
40
|
+
"types": "./dist/modules/agent-client/http.d.mts",
|
|
41
|
+
"import": "./dist/modules/agent-client/http.mjs",
|
|
42
|
+
"default": "./dist/modules/agent-client/http.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./client/local-host": {
|
|
45
|
+
"types": "./dist/modules/agent-client/local-host-protocol.d.mts",
|
|
46
|
+
"import": "./dist/modules/agent-client/local-host-protocol.mjs",
|
|
47
|
+
"default": "./dist/modules/agent-client/local-host-protocol.mjs"
|
|
48
|
+
},
|
|
49
|
+
"./client/sandbox-uri": {
|
|
50
|
+
"types": "./dist/modules/agent-client/sandbox-uri.d.mts",
|
|
51
|
+
"import": "./dist/modules/agent-client/sandbox-uri.mjs",
|
|
52
|
+
"default": "./dist/modules/agent-client/sandbox-uri.mjs"
|
|
44
53
|
},
|
|
45
54
|
"./approval": {
|
|
46
55
|
"types": "./dist/modules/authoring/approval.d.mts",
|
|
@@ -72,21 +81,20 @@
|
|
|
72
81
|
"import": "./dist/modules/sandboxes.mjs",
|
|
73
82
|
"default": "./dist/modules/sandboxes.mjs"
|
|
74
83
|
},
|
|
75
|
-
"./
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"default": "./dist/modules/authoring/final-channel.mjs"
|
|
84
|
+
"./integrations": {
|
|
85
|
+
"types": "./dist/modules/integrations.d.mts",
|
|
86
|
+
"import": "./dist/modules/integrations.mjs",
|
|
87
|
+
"default": "./dist/modules/integrations.mjs"
|
|
80
88
|
},
|
|
81
|
-
"./
|
|
82
|
-
"types": "./dist/modules/
|
|
83
|
-
"import": "./dist/modules/
|
|
84
|
-
"default": "./dist/modules/
|
|
89
|
+
"./verify": {
|
|
90
|
+
"types": "./dist/modules/verify.d.mts",
|
|
91
|
+
"import": "./dist/modules/verify.mjs",
|
|
92
|
+
"default": "./dist/modules/verify.mjs"
|
|
85
93
|
},
|
|
86
|
-
"./
|
|
87
|
-
"types": "./dist/modules/
|
|
88
|
-
"import": "./dist/modules/
|
|
89
|
-
"default": "./dist/modules/
|
|
94
|
+
"./webhooks": {
|
|
95
|
+
"types": "./dist/modules/webhooks.d.mts",
|
|
96
|
+
"import": "./dist/modules/webhooks.mjs",
|
|
97
|
+
"default": "./dist/modules/webhooks.mjs"
|
|
90
98
|
},
|
|
91
99
|
"./testing": {
|
|
92
100
|
"types": "./dist/modules/agent-client/test-fakes.d.mts",
|
|
@@ -97,7 +105,8 @@
|
|
|
97
105
|
"types": "./dist/modules/public.d.mts",
|
|
98
106
|
"import": "./dist/modules/public.mjs",
|
|
99
107
|
"default": "./dist/modules/public.mjs"
|
|
100
|
-
}
|
|
108
|
+
},
|
|
109
|
+
"./package.json": "./package.json"
|
|
101
110
|
},
|
|
102
111
|
"publishConfig": {
|
|
103
112
|
"access": "public",
|
|
@@ -105,11 +114,11 @@
|
|
|
105
114
|
},
|
|
106
115
|
"dependencies": {
|
|
107
116
|
"@agentclientprotocol/sdk": "1.8.0",
|
|
108
|
-
"@finalai/agent-definition": "0.
|
|
109
|
-
"@finalai/agent-protocol": "0.
|
|
110
|
-
"@finalai/agent-provider": "0.
|
|
111
|
-
"@finalai/final-agent-provider": "0.
|
|
112
|
-
"@finalai/websockets": "0.1.
|
|
117
|
+
"@finalai/agent-definition": "0.10.0",
|
|
118
|
+
"@finalai/agent-protocol": "0.10.0",
|
|
119
|
+
"@finalai/agent-provider": "0.11.0",
|
|
120
|
+
"@finalai/final-agent-provider": "0.12.0",
|
|
121
|
+
"@finalai/websockets": "0.1.8",
|
|
113
122
|
"ws": "^8.21.3",
|
|
114
123
|
"zod": "4.6.6"
|
|
115
124
|
},
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { type CommitDefinitionRequestIface, type CommitResultIface, type CompatibilityReportIface, type CompileResultIface, type ComputerSetupGuideDetailIface, type ComputerSetupGuideIface, type ComputerSetupGuideVersionIface, type CreateDefinitionRequestIface, type CredentialPolicyPreviewIface, type DefinitionChannelIface, type DefinitionCloneUrlIface, type DefinitionFilesIface, type DefinitionIface, type PreviewCredentialPolicyRequestIface, type ProviderEntryIface, type PublishComputerSetupGuideRequestIface, type PublishResultIface, type RevisionDiffIface, type RevisionIface, type ScheduleIface, type ScheduleRunResultIface, type UpdateScheduleRequestIface } from '@finalai/agent-protocol/agent-platform';
|
|
2
|
-
import { type ClientContextIface, type SignalOptionsIface } from "./context.mjs";
|
|
3
|
-
export interface DefinitionRefIface extends SignalOptionsIface {
|
|
4
|
-
/** Definition id or slug. */
|
|
5
|
-
definition: string;
|
|
6
|
-
}
|
|
7
|
-
export interface DefinitionsApiIface {
|
|
8
|
-
/** Compiles a draft into an immutable test snapshot without publishing or activating schedules/channels. */
|
|
9
|
-
testRevision: (args: DefinitionRefIface & {
|
|
10
|
-
ref: string;
|
|
11
|
-
}) => Promise<RevisionIface>;
|
|
12
|
-
previewCredentialPolicy: (args: DefinitionRefIface & PreviewCredentialPolicyRequestIface) => Promise<CredentialPolicyPreviewIface>;
|
|
13
|
-
/**
|
|
14
|
-
* With `projectId`, its definitions and those inherited from its ancestors. Without it,
|
|
15
|
-
* everything the caller can access (an API key: its parent project and every project it is
|
|
16
|
-
* granted; a person: every project they can read).
|
|
17
|
-
*/
|
|
18
|
-
list: (options?: SignalOptionsIface & {
|
|
19
|
-
cursor?: string;
|
|
20
|
-
limit?: number;
|
|
21
|
-
projectId?: string;
|
|
22
|
-
}) => Promise<{
|
|
23
|
-
definitions: DefinitionIface[];
|
|
24
|
-
nextCursor: string | null;
|
|
25
|
-
}>;
|
|
26
|
-
/**
|
|
27
|
-
* Creates the definition in `projectId` (editors of that project); omitted, the API key's parent
|
|
28
|
-
* project (a signed-in person's: My Work).
|
|
29
|
-
*/
|
|
30
|
-
create: (args: CreateDefinitionRequestIface & SignalOptionsIface) => Promise<DefinitionIface>;
|
|
31
|
-
get: (args: DefinitionRefIface) => Promise<DefinitionIface>;
|
|
32
|
-
/** Compiles the directory at `ref` server-side without publishing. */
|
|
33
|
-
compile: (args: DefinitionRefIface & {
|
|
34
|
-
ref: string;
|
|
35
|
-
harness?: string;
|
|
36
|
-
}) => Promise<CompileResultIface>;
|
|
37
|
-
commit: (args: DefinitionRefIface & CommitDefinitionRequestIface) => Promise<CommitResultIface>;
|
|
38
|
-
/** Publishes an immutable revision; activate:false leaves the live agent unchanged. */
|
|
39
|
-
publish: (args: DefinitionRefIface & {
|
|
40
|
-
ref: string;
|
|
41
|
-
note?: string;
|
|
42
|
-
activate?: boolean;
|
|
43
|
-
}) => Promise<PublishResultIface>;
|
|
44
|
-
/** The agent directory's files at `ref` (default branch when omitted). */
|
|
45
|
-
files: (args: DefinitionRefIface & {
|
|
46
|
-
ref?: string;
|
|
47
|
-
}) => Promise<DefinitionFilesIface>;
|
|
48
|
-
revisions: (args: DefinitionRefIface & {
|
|
49
|
-
cursor?: string;
|
|
50
|
-
}) => Promise<{
|
|
51
|
-
revisions: RevisionIface[];
|
|
52
|
-
nextCursor: string | null;
|
|
53
|
-
}>;
|
|
54
|
-
/**
|
|
55
|
-
* What changed in the compiled manifest between two revisions (revision ids
|
|
56
|
-
* or numbers); `to` defaults to the current revision.
|
|
57
|
-
*/
|
|
58
|
-
revisionDiff: (args: DefinitionRefIface & {
|
|
59
|
-
from: string | number;
|
|
60
|
-
to?: string | number;
|
|
61
|
-
}) => Promise<RevisionDiffIface>;
|
|
62
|
-
compatibility: (args: DefinitionRefIface & {
|
|
63
|
-
harness: string;
|
|
64
|
-
ref?: string;
|
|
65
|
-
}) => Promise<CompatibilityReportIface>;
|
|
66
|
-
/** The agent's live channel bindings and their public route URLs. */
|
|
67
|
-
channels: (args: DefinitionRefIface) => Promise<DefinitionChannelIface[]>;
|
|
68
|
-
/**
|
|
69
|
-
* Archives the definition: it leaves listings, its schedules and channel
|
|
70
|
-
* bindings stop, and new sessions are refused. Its repository is kept.
|
|
71
|
-
*/
|
|
72
|
-
archive: (args: DefinitionRefIface) => Promise<DefinitionIface>;
|
|
73
|
-
/**
|
|
74
|
-
* A short-lived, read-only git remote for a Final-hosted repository, for
|
|
75
|
-
* `git clone` (editors of the definition's project).
|
|
76
|
-
*/
|
|
77
|
-
cloneUrl: (args: DefinitionRefIface) => Promise<DefinitionCloneUrlIface>;
|
|
78
|
-
}
|
|
79
|
-
export interface ProvidersApiIface {
|
|
80
|
-
list: (options?: SignalOptionsIface) => Promise<ProviderEntryIface[]>;
|
|
81
|
-
}
|
|
82
|
-
export interface ComputerSetupGuidesApiIface {
|
|
83
|
-
list: (options?: SignalOptionsIface) => Promise<ComputerSetupGuideIface[]>;
|
|
84
|
-
/** Guide by slug or id, with its versions. */
|
|
85
|
-
get: (ref: string, options?: SignalOptionsIface) => Promise<ComputerSetupGuideDetailIface>;
|
|
86
|
-
/** Publishes a new version (creating the guide on first publish). */
|
|
87
|
-
publish: (args: PublishComputerSetupGuideRequestIface & SignalOptionsIface) => Promise<{
|
|
88
|
-
guide: ComputerSetupGuideIface;
|
|
89
|
-
version: ComputerSetupGuideVersionIface;
|
|
90
|
-
}>;
|
|
91
|
-
}
|
|
92
|
-
export type ScheduleRef = {
|
|
93
|
-
scheduleId: string;
|
|
94
|
-
} | {
|
|
95
|
-
agent: string;
|
|
96
|
-
key: string;
|
|
97
|
-
};
|
|
98
|
-
export interface SchedulesApiIface {
|
|
99
|
-
list: (options?: SignalOptionsIface & {
|
|
100
|
-
agent?: string;
|
|
101
|
-
}) => Promise<ScheduleIface[]>;
|
|
102
|
-
runNow: (args: ScheduleRef & SignalOptionsIface) => Promise<ScheduleRunResultIface>;
|
|
103
|
-
update: (args: {
|
|
104
|
-
scheduleId: string;
|
|
105
|
-
} & UpdateScheduleRequestIface & SignalOptionsIface) => Promise<ScheduleIface>;
|
|
106
|
-
}
|
|
107
|
-
export declare const createDefinitionsApi: ({ http }: ClientContextIface) => DefinitionsApiIface;
|
|
108
|
-
export declare const createProvidersApi: ({ http }: ClientContextIface) => ProvidersApiIface;
|
|
109
|
-
export declare const createComputerSetupGuidesApi: ({ http, }: ClientContextIface) => ComputerSetupGuidesApiIface;
|
|
110
|
-
export declare const createSchedulesApi: ({ http }: ClientContextIface) => SchedulesApiIface;
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
commitDefinitionRequestSchema,
|
|
3
|
-
commitResultSchema,
|
|
4
|
-
compatibilityReportSchema,
|
|
5
|
-
compileDefinitionRequestSchema,
|
|
6
|
-
compileResultSchema,
|
|
7
|
-
computerSetupGuideDetailSchema,
|
|
8
|
-
computerSetupGuideListSchema,
|
|
9
|
-
createDefinitionRequestSchema,
|
|
10
|
-
credentialPolicyPreviewSchema,
|
|
11
|
-
definitionChannelsResponseSchema,
|
|
12
|
-
definitionCloneUrlSchema,
|
|
13
|
-
definitionFilesSchema,
|
|
14
|
-
definitionListSchema,
|
|
15
|
-
definitionSchema,
|
|
16
|
-
previewCredentialPolicyRequestSchema,
|
|
17
|
-
providerListSchema,
|
|
18
|
-
publishComputerSetupGuideRequestSchema,
|
|
19
|
-
publishComputerSetupGuideResultSchema,
|
|
20
|
-
publishDefinitionRequestSchema,
|
|
21
|
-
publishResultSchema,
|
|
22
|
-
revisionDiffSchema,
|
|
23
|
-
revisionListSchema,
|
|
24
|
-
revisionSchema,
|
|
25
|
-
scheduleListSchema,
|
|
26
|
-
scheduleRunResultSchema,
|
|
27
|
-
scheduleSchema,
|
|
28
|
-
updateScheduleRequestSchema
|
|
29
|
-
} from "@finalai/agent-protocol/agent-platform";
|
|
30
|
-
import { encodePath } from "./context.mjs";
|
|
31
|
-
import { clientError, ClientErrorCode } from "./errors.mjs";
|
|
32
|
-
import { HttpMethod } from "./http.mjs";
|
|
33
|
-
const definitionPath = (definition, suffix = "") => `/v1/definitions/${encodePath(definition)}${suffix}`;
|
|
34
|
-
const createDefinitionsApi = ({ http }) => ({
|
|
35
|
-
testRevision: ({ definition, signal, ...value }) => http.request({
|
|
36
|
-
method: HttpMethod.Post,
|
|
37
|
-
path: definitionPath(definition, "/test-revision"),
|
|
38
|
-
body: { schema: compileDefinitionRequestSchema, value },
|
|
39
|
-
response: revisionSchema,
|
|
40
|
-
signal
|
|
41
|
-
}),
|
|
42
|
-
previewCredentialPolicy: ({ definition, signal, ...value }) => http.request({
|
|
43
|
-
method: HttpMethod.Post,
|
|
44
|
-
path: definitionPath(definition, "/credential-policy/preview"),
|
|
45
|
-
body: { schema: previewCredentialPolicyRequestSchema, value },
|
|
46
|
-
response: credentialPolicyPreviewSchema,
|
|
47
|
-
signal
|
|
48
|
-
}),
|
|
49
|
-
list: (options) => http.request({
|
|
50
|
-
method: HttpMethod.Get,
|
|
51
|
-
path: "/v1/definitions",
|
|
52
|
-
query: { cursor: options?.cursor, limit: options?.limit, projectId: options?.projectId },
|
|
53
|
-
response: definitionListSchema,
|
|
54
|
-
signal: options?.signal
|
|
55
|
-
}),
|
|
56
|
-
create: ({ signal, ...value }) => http.request({
|
|
57
|
-
method: HttpMethod.Post,
|
|
58
|
-
path: "/v1/definitions",
|
|
59
|
-
body: { schema: createDefinitionRequestSchema, value },
|
|
60
|
-
response: definitionSchema,
|
|
61
|
-
signal
|
|
62
|
-
}),
|
|
63
|
-
get: ({ definition, signal }) => http.request({
|
|
64
|
-
method: HttpMethod.Get,
|
|
65
|
-
path: definitionPath(definition),
|
|
66
|
-
response: definitionSchema,
|
|
67
|
-
signal
|
|
68
|
-
}),
|
|
69
|
-
compile: ({ definition, signal, ...value }) => http.request({
|
|
70
|
-
method: HttpMethod.Post,
|
|
71
|
-
path: definitionPath(definition, "/compile"),
|
|
72
|
-
body: { schema: compileDefinitionRequestSchema, value },
|
|
73
|
-
response: compileResultSchema,
|
|
74
|
-
signal
|
|
75
|
-
}),
|
|
76
|
-
commit: ({ definition, signal, ...value }) => http.request({
|
|
77
|
-
method: HttpMethod.Post,
|
|
78
|
-
path: definitionPath(definition, "/commit"),
|
|
79
|
-
body: { schema: commitDefinitionRequestSchema, value },
|
|
80
|
-
response: commitResultSchema,
|
|
81
|
-
signal
|
|
82
|
-
}),
|
|
83
|
-
publish: ({ definition, signal, ...value }) => http.request({
|
|
84
|
-
method: HttpMethod.Post,
|
|
85
|
-
path: definitionPath(definition, "/publish"),
|
|
86
|
-
body: { schema: publishDefinitionRequestSchema, value },
|
|
87
|
-
response: publishResultSchema,
|
|
88
|
-
signal
|
|
89
|
-
}),
|
|
90
|
-
files: ({ definition, ref, signal }) => http.request({
|
|
91
|
-
method: HttpMethod.Get,
|
|
92
|
-
path: definitionPath(definition, "/files"),
|
|
93
|
-
query: { ref },
|
|
94
|
-
response: definitionFilesSchema,
|
|
95
|
-
signal
|
|
96
|
-
}),
|
|
97
|
-
revisions: ({ definition, cursor, signal }) => http.request({
|
|
98
|
-
method: HttpMethod.Get,
|
|
99
|
-
path: definitionPath(definition, "/revisions"),
|
|
100
|
-
query: { cursor },
|
|
101
|
-
response: revisionListSchema,
|
|
102
|
-
signal
|
|
103
|
-
}),
|
|
104
|
-
revisionDiff: ({ definition, from, to, signal }) => http.request({
|
|
105
|
-
method: HttpMethod.Get,
|
|
106
|
-
path: definitionPath(definition, "/revisions/diff"),
|
|
107
|
-
query: { from, to },
|
|
108
|
-
response: revisionDiffSchema,
|
|
109
|
-
signal
|
|
110
|
-
}),
|
|
111
|
-
compatibility: ({ definition, harness, ref, signal }) => http.request({
|
|
112
|
-
method: HttpMethod.Get,
|
|
113
|
-
path: definitionPath(definition, "/compatibility"),
|
|
114
|
-
query: { harness, ref },
|
|
115
|
-
response: compatibilityReportSchema,
|
|
116
|
-
signal
|
|
117
|
-
}),
|
|
118
|
-
channels: async ({ definition, signal }) => (await http.request({
|
|
119
|
-
method: HttpMethod.Get,
|
|
120
|
-
path: definitionPath(definition, "/channels"),
|
|
121
|
-
response: definitionChannelsResponseSchema,
|
|
122
|
-
signal
|
|
123
|
-
})).channels,
|
|
124
|
-
archive: ({ definition, signal }) => http.request({
|
|
125
|
-
method: HttpMethod.Post,
|
|
126
|
-
path: definitionPath(definition, "/archive"),
|
|
127
|
-
response: definitionSchema,
|
|
128
|
-
signal
|
|
129
|
-
}),
|
|
130
|
-
cloneUrl: ({ definition, signal }) => http.request({
|
|
131
|
-
method: HttpMethod.Post,
|
|
132
|
-
path: definitionPath(definition, "/clone-url"),
|
|
133
|
-
response: definitionCloneUrlSchema,
|
|
134
|
-
signal
|
|
135
|
-
})
|
|
136
|
-
});
|
|
137
|
-
const createProvidersApi = ({ http }) => ({
|
|
138
|
-
list: async (options) => (await http.request({
|
|
139
|
-
method: HttpMethod.Get,
|
|
140
|
-
path: "/v1/providers",
|
|
141
|
-
response: providerListSchema,
|
|
142
|
-
signal: options?.signal
|
|
143
|
-
})).providers
|
|
144
|
-
});
|
|
145
|
-
const createComputerSetupGuidesApi = ({
|
|
146
|
-
http
|
|
147
|
-
}) => ({
|
|
148
|
-
list: async (options) => (await http.request({
|
|
149
|
-
method: HttpMethod.Get,
|
|
150
|
-
path: "/v1/computer-setup-guides",
|
|
151
|
-
response: computerSetupGuideListSchema,
|
|
152
|
-
signal: options?.signal
|
|
153
|
-
})).guides,
|
|
154
|
-
get: (ref, options) => http.request({
|
|
155
|
-
method: HttpMethod.Get,
|
|
156
|
-
path: `/v1/computer-setup-guides/${encodePath(ref)}`,
|
|
157
|
-
response: computerSetupGuideDetailSchema,
|
|
158
|
-
signal: options?.signal
|
|
159
|
-
}),
|
|
160
|
-
publish: ({ signal, ...value }) => http.request({
|
|
161
|
-
method: HttpMethod.Post,
|
|
162
|
-
path: "/v1/computer-setup-guides",
|
|
163
|
-
body: { schema: publishComputerSetupGuideRequestSchema, value },
|
|
164
|
-
response: publishComputerSetupGuideResultSchema,
|
|
165
|
-
signal
|
|
166
|
-
})
|
|
167
|
-
});
|
|
168
|
-
const createSchedulesApi = ({ http }) => {
|
|
169
|
-
const list = async (options) => (await http.request({
|
|
170
|
-
method: HttpMethod.Get,
|
|
171
|
-
path: "/v1/schedules",
|
|
172
|
-
query: { agent: options?.agent },
|
|
173
|
-
response: scheduleListSchema,
|
|
174
|
-
signal: options?.signal
|
|
175
|
-
})).schedules;
|
|
176
|
-
const scheduleIdOf = async (args) => {
|
|
177
|
-
if ("scheduleId" in args) return args.scheduleId;
|
|
178
|
-
const found = (await list({ agent: args.agent, signal: args.signal })).find(
|
|
179
|
-
(schedule) => schedule.key === args.key
|
|
180
|
-
);
|
|
181
|
-
if (found == null) {
|
|
182
|
-
throw clientError({
|
|
183
|
-
message: `No schedule ${args.key} on agent ${args.agent}`,
|
|
184
|
-
status: 0,
|
|
185
|
-
code: ClientErrorCode.NotFound
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
return found.id;
|
|
189
|
-
};
|
|
190
|
-
return {
|
|
191
|
-
list,
|
|
192
|
-
runNow: async (args) => http.request({
|
|
193
|
-
method: HttpMethod.Post,
|
|
194
|
-
path: `/v1/schedules/${encodePath(await scheduleIdOf(args))}/run-now`,
|
|
195
|
-
response: scheduleRunResultSchema,
|
|
196
|
-
signal: args.signal
|
|
197
|
-
}),
|
|
198
|
-
update: ({ scheduleId, signal, ...value }) => http.request({
|
|
199
|
-
method: HttpMethod.Patch,
|
|
200
|
-
path: `/v1/schedules/${encodePath(scheduleId)}`,
|
|
201
|
-
body: { schema: updateScheduleRequestSchema, value },
|
|
202
|
-
response: scheduleSchema,
|
|
203
|
-
signal
|
|
204
|
-
})
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
export {
|
|
208
|
-
createComputerSetupGuidesApi,
|
|
209
|
-
createDefinitionsApi,
|
|
210
|
-
createProvidersApi,
|
|
211
|
-
createSchedulesApi
|
|
212
|
-
};
|
|
213
|
-
//# sourceMappingURL=build.mjs.map
|