@finalai/agents 0.10.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.
Files changed (185) hide show
  1. package/HOSTING.md +334 -245
  2. package/README.md +214 -29
  3. package/dist/modules/agent-client/agent-input.d.mts +24 -0
  4. package/dist/modules/agent-client/agent-input.mjs +46 -0
  5. package/dist/modules/agent-client/agent-input.mjs.map +7 -0
  6. package/dist/modules/agent-client/channels.d.mts +52 -3
  7. package/dist/modules/agent-client/channels.mjs +71 -10
  8. package/dist/modules/agent-client/channels.mjs.map +2 -2
  9. package/dist/modules/agent-client/client.d.mts +85 -20
  10. package/dist/modules/agent-client/client.mjs +74 -21
  11. package/dist/modules/agent-client/client.mjs.map +2 -2
  12. package/dist/modules/agent-client/config-options.mjs +1 -2
  13. package/dist/modules/agent-client/config-options.mjs.map +2 -2
  14. package/dist/modules/agent-client/conversation-resources.d.mts +85 -0
  15. package/dist/modules/agent-client/conversation-resources.mjs +150 -0
  16. package/dist/modules/agent-client/conversation-resources.mjs.map +7 -0
  17. package/dist/modules/agent-client/conversations.d.mts +116 -38
  18. package/dist/modules/agent-client/conversations.mjs +379 -71
  19. package/dist/modules/agent-client/conversations.mjs.map +2 -2
  20. package/dist/modules/agent-client/defaults.d.mts +8 -0
  21. package/dist/modules/agent-client/defaults.mjs +77 -0
  22. package/dist/modules/agent-client/defaults.mjs.map +7 -0
  23. package/dist/modules/agent-client/errors.d.mts +22 -2
  24. package/dist/modules/agent-client/errors.mjs +19 -0
  25. package/dist/modules/agent-client/errors.mjs.map +2 -2
  26. package/dist/modules/agent-client/events.d.mts +62 -0
  27. package/dist/modules/agent-client/events.mjs +107 -0
  28. package/dist/modules/agent-client/events.mjs.map +7 -0
  29. package/dist/modules/agent-client/harnesses.d.mts +66 -0
  30. package/dist/modules/agent-client/harnesses.mjs +156 -0
  31. package/dist/modules/agent-client/harnesses.mjs.map +7 -0
  32. package/dist/modules/agent-client/http.d.mts +2 -1
  33. package/dist/modules/agent-client/http.mjs +21 -2
  34. package/dist/modules/agent-client/http.mjs.map +2 -2
  35. package/dist/modules/agent-client/index.d.mts +21 -6
  36. package/dist/modules/agent-client/index.mjs +26 -0
  37. package/dist/modules/agent-client/index.mjs.map +2 -2
  38. package/dist/modules/agent-client/integrations.d.mts +40 -0
  39. package/dist/modules/agent-client/integrations.mjs +92 -0
  40. package/dist/modules/agent-client/integrations.mjs.map +7 -0
  41. package/dist/modules/agent-client/local-host-protocol.d.mts +156 -0
  42. package/dist/modules/agent-client/local-host-protocol.mjs +258 -0
  43. package/dist/modules/agent-client/local-host-protocol.mjs.map +7 -0
  44. package/dist/modules/agent-client/local-host.d.mts +56 -0
  45. package/dist/modules/agent-client/local-host.mjs +200 -0
  46. package/dist/modules/agent-client/local-host.mjs.map +7 -0
  47. package/dist/modules/agent-client/oauth-clients.d.mts +36 -0
  48. package/dist/modules/agent-client/oauth-clients.mjs +67 -0
  49. package/dist/modules/agent-client/oauth-clients.mjs.map +7 -0
  50. package/dist/modules/agent-client/project-agents.d.mts +54 -0
  51. package/dist/modules/agent-client/project-agents.mjs +111 -0
  52. package/dist/modules/agent-client/project-agents.mjs.map +7 -0
  53. package/dist/modules/agent-client/project.d.mts +43 -0
  54. package/dist/modules/agent-client/project.mjs +66 -0
  55. package/dist/modules/agent-client/project.mjs.map +7 -0
  56. package/dist/modules/agent-client/projects.d.mts +61 -0
  57. package/dist/modules/agent-client/projects.mjs +145 -0
  58. package/dist/modules/agent-client/projects.mjs.map +7 -0
  59. package/dist/modules/agent-client/provide.d.mts +41 -0
  60. package/dist/modules/agent-client/provide.mjs +90 -0
  61. package/dist/modules/agent-client/provide.mjs.map +7 -0
  62. package/dist/modules/agent-client/publishers.d.mts +57 -0
  63. package/dist/modules/agent-client/publishers.mjs +109 -0
  64. package/dist/modules/agent-client/publishers.mjs.map +7 -0
  65. package/dist/modules/agent-client/requirements.d.mts +60 -0
  66. package/dist/modules/agent-client/requirements.mjs +83 -0
  67. package/dist/modules/agent-client/requirements.mjs.map +7 -0
  68. package/dist/modules/agent-client/sandbox-providers.d.mts +34 -0
  69. package/dist/modules/agent-client/sandbox-providers.mjs +75 -0
  70. package/dist/modules/agent-client/sandbox-providers.mjs.map +7 -0
  71. package/dist/modules/agent-client/sandbox-uri.d.mts +1 -1
  72. package/dist/modules/agent-client/sandbox-uri.mjs +4 -4
  73. package/dist/modules/agent-client/sandbox-uri.mjs.map +1 -1
  74. package/dist/modules/agent-client/sandboxes.d.mts +65 -0
  75. package/dist/modules/agent-client/sandboxes.mjs +130 -0
  76. package/dist/modules/agent-client/sandboxes.mjs.map +7 -0
  77. package/dist/modules/agent-client/schedules.d.mts +24 -0
  78. package/dist/modules/agent-client/schedules.mjs +56 -0
  79. package/dist/modules/agent-client/schedules.mjs.map +7 -0
  80. package/dist/modules/agent-client/sessions.d.mts +46 -8
  81. package/dist/modules/agent-client/sessions.mjs +91 -29
  82. package/dist/modules/agent-client/sessions.mjs.map +2 -2
  83. package/dist/modules/agent-client/start.d.mts +101 -0
  84. package/dist/modules/agent-client/start.mjs +260 -0
  85. package/dist/modules/agent-client/start.mjs.map +7 -0
  86. package/dist/modules/agent-client/test-fakes.d.mts +1 -0
  87. package/dist/modules/agent-client/test-fakes.mjs +3 -1
  88. package/dist/modules/agent-client/test-fakes.mjs.map +2 -2
  89. package/dist/modules/cli/agent-module.d.mts +39 -0
  90. package/dist/modules/cli/agent-module.mjs +89 -0
  91. package/dist/modules/cli/agent-module.mjs.map +7 -0
  92. package/dist/modules/cli/cli.d.mts +6 -6
  93. package/dist/modules/cli/cli.mjs +94 -120
  94. package/dist/modules/cli/cli.mjs.map +2 -2
  95. package/dist/modules/cli/conformance.d.mts +2 -6
  96. package/dist/modules/cli/conformance.mjs +5 -8
  97. package/dist/modules/cli/conformance.mjs.map +2 -2
  98. package/dist/modules/cli/main.mjs.map +1 -1
  99. package/dist/modules/cli/output.d.mts +0 -9
  100. package/dist/modules/cli/output.mjs +7 -85
  101. package/dist/modules/cli/output.mjs.map +2 -2
  102. package/dist/modules/harnesses.mjs.map +2 -2
  103. package/dist/modules/index.d.mts +0 -2
  104. package/dist/modules/index.mjs +0 -4
  105. package/dist/modules/index.mjs.map +2 -2
  106. package/dist/modules/integrations.d.mts +24 -0
  107. package/dist/modules/integrations.mjs +30 -0
  108. package/dist/modules/integrations.mjs.map +7 -0
  109. package/dist/modules/public.d.mts +10 -10
  110. package/dist/modules/public.mjs +29 -78
  111. package/dist/modules/public.mjs.map +2 -2
  112. package/dist/modules/sandboxes.d.mts +2 -0
  113. package/dist/modules/sandboxes.mjs +4 -0
  114. package/dist/modules/sandboxes.mjs.map +2 -2
  115. package/dist/modules/verify.d.mts +1 -0
  116. package/dist/modules/verify.mjs +2 -0
  117. package/dist/modules/verify.mjs.map +7 -0
  118. package/dist/modules/webhooks.d.mts +37 -0
  119. package/dist/modules/webhooks.mjs +100 -0
  120. package/dist/modules/webhooks.mjs.map +7 -0
  121. package/examples/release-scout/README.md +18 -10
  122. package/examples/release-scout/agent.ts +41 -0
  123. package/examples/release-scout/by-name.ts +43 -0
  124. package/examples/release-scout/db.ts +6 -0
  125. package/examples/release-scout/instructions.md +5 -0
  126. package/examples/release-scout/run-on-a-computer.ts +49 -0
  127. package/examples/release-scout/run.ts +38 -0
  128. package/package.json +42 -28
  129. package/dist/modules/agent-client/build.d.mts +0 -110
  130. package/dist/modules/agent-client/build.mjs +0 -213
  131. package/dist/modules/agent-client/build.mjs.map +0 -7
  132. package/dist/modules/authoring/index.d.mts +0 -1
  133. package/dist/modules/authoring/index.mjs +0 -2
  134. package/dist/modules/authoring/index.mjs.map +0 -7
  135. package/dist/modules/authoring/instructions.d.mts +0 -1
  136. package/dist/modules/authoring/instructions.mjs +0 -2
  137. package/dist/modules/authoring/instructions.mjs.map +0 -7
  138. package/dist/modules/authoring/providers.d.mts +0 -2
  139. package/dist/modules/authoring/providers.mjs +0 -1
  140. package/dist/modules/authoring/providers.mjs.map +0 -7
  141. package/dist/modules/cli/build.d.mts +0 -22
  142. package/dist/modules/cli/build.mjs +0 -77
  143. package/dist/modules/cli/build.mjs.map +0 -7
  144. package/dist/modules/cli/channel-install.d.mts +0 -12
  145. package/dist/modules/cli/channel-install.mjs +0 -25
  146. package/dist/modules/cli/channel-install.mjs.map +0 -7
  147. package/dist/modules/cli/channel-socket.d.mts +0 -9
  148. package/dist/modules/cli/channel-socket.mjs +0 -114
  149. package/dist/modules/cli/channel-socket.mjs.map +0 -7
  150. package/dist/modules/cli/dev.d.mts +0 -26
  151. package/dist/modules/cli/dev.mjs +0 -311
  152. package/dist/modules/cli/dev.mjs.map +0 -7
  153. package/dist/modules/cli/files.d.mts +0 -18
  154. package/dist/modules/cli/files.mjs +0 -66
  155. package/dist/modules/cli/files.mjs.map +0 -7
  156. package/dist/modules/cli/harness-descriptions.d.mts +0 -20
  157. package/dist/modules/cli/harness-descriptions.mjs +0 -70
  158. package/dist/modules/cli/harness-descriptions.mjs.map +0 -7
  159. package/dist/modules/cli/publish.d.mts +0 -15
  160. package/dist/modules/cli/publish.mjs +0 -92
  161. package/dist/modules/cli/publish.mjs.map +0 -7
  162. package/dist/modules/compile.d.mts +0 -3
  163. package/dist/modules/compile.mjs +0 -58
  164. package/dist/modules/compile.mjs.map +0 -7
  165. package/dist/modules/index.browser.d.mts +0 -4
  166. package/dist/modules/index.browser.mjs +0 -8
  167. package/dist/modules/index.browser.mjs.map +0 -7
  168. package/examples/custom-harness/README.md +0 -16
  169. package/examples/custom-harness/agent.ts +0 -154
  170. package/examples/custom-sandbox/README.md +0 -12
  171. package/examples/custom-sandbox/agent.ts +0 -14
  172. package/examples/custom-sandbox/sandbox.ts +0 -24
  173. package/examples/release-scout/agent/agent.ts +0 -22
  174. package/examples/release-scout/agent/channels/github-signature.ts +0 -27
  175. package/examples/release-scout/agent/channels/github.ts +0 -32
  176. package/examples/release-scout/agent/connections/linear.ts +0 -9
  177. package/examples/release-scout/agent/hooks/audit.ts +0 -24
  178. package/examples/release-scout/agent/instructions/org-context.ts +0 -26
  179. package/examples/release-scout/agent/instructions.md +0 -2
  180. package/examples/release-scout/agent/sandbox.ts +0 -20
  181. package/examples/release-scout/agent/schedules/daily-digest.md +0 -7
  182. package/examples/release-scout/agent/skills/triage/SKILL.md +0 -8
  183. package/examples/release-scout/agent/skills/triage/checklist.md +0 -3
  184. package/examples/release-scout/agent/tools/lookup_release_notes.ts +0 -24
  185. package/examples/release-scout/client.ts +0 -122
@@ -1,13 +1,21 @@
1
- # Release Scout client
1
+ # Release Scout
2
2
 
3
- `client.ts` exports separate operations so you choose which account mutations to run. Install `@finalai/agents` in a Node 26 project and import `connect`, `directSession`, `directConversation`, `groupConversation`, or `publish`. Create and publish Release Scout first; groups also require Deploy Bot. User participant IDs come from `client.people.all()`.
3
+ One agent with one tool of each kind, and three ways to start it.
4
4
 
5
- Every function accepts an abort signal. Decisions are reported for the caller to inspect: answer a permission with `conversation.respond({ decisionId, optionId })`, choosing an actual option from the decision, or answer an elicitation with its ACP outcome. No example approves a request automatically. Use `conversation.cancel()` to stop every agent in a room; `client.close()` stops local subscriptions and releases owned realtime connections.
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
- Definition publication compiles the repository ref and activates its definition schedules and channels. It is an explicit operation. Use `definitions.compile()` or `definitions.testRevision()` for an unpublished snapshot. `schedules.runNow({ agent: 'release-scout', key: 'daily-digest' })` triggers an existing schedule. `client.acp.connect({ agent: 'release-scout' })` opens a native ACP client connection.
8
-
9
- The published package includes this client and the complete authored definition under `examples/release-scout/agent/`. It declares billing in the harness credential chain and includes sandbox setup, instructions, skills, an authored tool, the Linear connection, a schedule, a hook and the GitHub webhook. Supply the declared secrets and provider credentials before publishing it.
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,6 @@
1
+ // Stands in for the application's own database connection.
2
+ const rows = new Map([['ord_1', { id: 'ord_1', version: '2.4.1', status: 'shipped' }]]);
3
+
4
+ export const orders = {
5
+ find: async (id: string) => rows.get(id) ?? null,
6
+ };
@@ -0,0 +1,5 @@
1
+ You answer questions about releases.
2
+
3
+ Read a release's published notes before saying whether a change shipped, and
4
+ link the issue that tracked it when there is one. Check an order with
5
+ `find_order` when someone asks whether their order has the fix.
@@ -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', repository: 'acme/app', 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.10.0",
3
+ "version": "0.12.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
- "node": "./dist/modules/index.mjs",
28
- "default": "./dist/modules/index.browser.mjs"
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
- "./instructions": {
41
- "types": "./dist/modules/authoring/instructions.d.mts",
42
- "import": "./dist/modules/authoring/instructions.mjs",
43
- "default": "./dist/modules/authoring/instructions.mjs"
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",
@@ -62,6 +71,11 @@
62
71
  "import": "./dist/modules/authoring/channels.mjs",
63
72
  "default": "./dist/modules/authoring/channels.mjs"
64
73
  },
74
+ "./channels/final": {
75
+ "types": "./dist/modules/authoring/final-channel.d.mts",
76
+ "import": "./dist/modules/authoring/final-channel.mjs",
77
+ "default": "./dist/modules/authoring/final-channel.mjs"
78
+ },
65
79
  "./harnesses": {
66
80
  "types": "./dist/modules/harnesses.d.mts",
67
81
  "import": "./dist/modules/harnesses.mjs",
@@ -72,21 +86,20 @@
72
86
  "import": "./dist/modules/sandboxes.mjs",
73
87
  "default": "./dist/modules/sandboxes.mjs"
74
88
  },
75
- "./package.json": "./package.json",
76
- "./channels/final": {
77
- "types": "./dist/modules/authoring/final-channel.d.mts",
78
- "import": "./dist/modules/authoring/final-channel.mjs",
79
- "default": "./dist/modules/authoring/final-channel.mjs"
89
+ "./integrations": {
90
+ "types": "./dist/modules/integrations.d.mts",
91
+ "import": "./dist/modules/integrations.mjs",
92
+ "default": "./dist/modules/integrations.mjs"
80
93
  },
81
- "./client/http": {
82
- "types": "./dist/modules/agent-client/http.d.mts",
83
- "import": "./dist/modules/agent-client/http.mjs",
84
- "default": "./dist/modules/agent-client/http.mjs"
94
+ "./verify": {
95
+ "types": "./dist/modules/verify.d.mts",
96
+ "import": "./dist/modules/verify.mjs",
97
+ "default": "./dist/modules/verify.mjs"
85
98
  },
86
- "./client/sandbox-uri": {
87
- "types": "./dist/modules/agent-client/sandbox-uri.d.mts",
88
- "import": "./dist/modules/agent-client/sandbox-uri.mjs",
89
- "default": "./dist/modules/agent-client/sandbox-uri.mjs"
99
+ "./webhooks": {
100
+ "types": "./dist/modules/webhooks.d.mts",
101
+ "import": "./dist/modules/webhooks.mjs",
102
+ "default": "./dist/modules/webhooks.mjs"
90
103
  },
91
104
  "./testing": {
92
105
  "types": "./dist/modules/agent-client/test-fakes.d.mts",
@@ -97,7 +110,8 @@
97
110
  "types": "./dist/modules/public.d.mts",
98
111
  "import": "./dist/modules/public.mjs",
99
112
  "default": "./dist/modules/public.mjs"
100
- }
113
+ },
114
+ "./package.json": "./package.json"
101
115
  },
102
116
  "publishConfig": {
103
117
  "access": "public",
@@ -105,11 +119,11 @@
105
119
  },
106
120
  "dependencies": {
107
121
  "@agentclientprotocol/sdk": "1.8.0",
108
- "@finalai/agent-definition": "0.7.0",
109
- "@finalai/agent-protocol": "0.8.0",
110
- "@finalai/agent-provider": "0.8.0",
111
- "@finalai/final-agent-provider": "0.9.0",
112
- "@finalai/websockets": "0.1.7",
122
+ "@finalai/agent-definition": "0.9.0",
123
+ "@finalai/agent-protocol": "0.9.0",
124
+ "@finalai/agent-provider": "0.10.0",
125
+ "@finalai/final-agent-provider": "0.11.0",
126
+ "@finalai/websockets": "0.1.8",
113
127
  "ws": "^8.21.3",
114
128
  "zod": "4.6.6"
115
129
  },
@@ -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;