@agents24/node 0.4.0 → 0.5.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 (41) hide show
  1. package/README.md +26 -2
  2. package/compatibility.json +6 -6
  3. package/dist/bff.cjs +468 -51
  4. package/dist/bff.cjs.map +1 -1
  5. package/dist/bff.d.cts +23 -4
  6. package/dist/bff.d.ts +23 -4
  7. package/dist/bff.js +468 -51
  8. package/dist/bff.js.map +1 -1
  9. package/dist/{client-C5ui84wi.d.cts → client-xWr_OGEe.d.cts} +285 -86
  10. package/dist/{client-C5ui84wi.d.ts → client-xWr_OGEe.d.ts} +285 -86
  11. package/dist/index.cjs +177 -65
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +2 -2
  14. package/dist/index.d.ts +2 -2
  15. package/dist/index.js +177 -65
  16. package/dist/index.js.map +1 -1
  17. package/dist/types/bff-agent-resolution.d.ts +41 -0
  18. package/dist/types/bff-agent-resolution.d.ts.map +1 -0
  19. package/dist/types/bff-errors.d.ts +3 -0
  20. package/dist/types/bff-errors.d.ts.map +1 -0
  21. package/dist/types/bff.d.ts +6 -20
  22. package/dist/types/bff.d.ts.map +1 -1
  23. package/dist/types/client.d.ts +2 -2
  24. package/dist/types/client.d.ts.map +1 -1
  25. package/dist/types/embed.d.ts +7 -1
  26. package/dist/types/embed.d.ts.map +1 -1
  27. package/dist/types/generated/customerProfiles.d.ts +11 -0
  28. package/dist/types/generated/customerProfiles.d.ts.map +1 -0
  29. package/dist/types/generated/manifest.d.ts +1 -1
  30. package/dist/types/generated/manifest.d.ts.map +1 -1
  31. package/dist/types/generated/resourceInstallations.d.ts +6 -2
  32. package/dist/types/generated/resourceInstallations.d.ts.map +1 -1
  33. package/dist/types/generated/resourcePackages.d.ts +7 -3
  34. package/dist/types/generated/resourcePackages.d.ts.map +1 -1
  35. package/dist/types/generated/resourcePolicies.d.ts +3 -3
  36. package/dist/types/generated/resourcePolicies.d.ts.map +1 -1
  37. package/dist/types/types.d.ts +255 -69
  38. package/dist/types/types.d.ts.map +1 -1
  39. package/package.json +2 -2
  40. package/dist/types/generated/resourceBundles.d.ts +0 -12
  41. package/dist/types/generated/resourceBundles.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # `@agents24/node`
2
2
 
3
- Last Updated: 2026-08-13
3
+ Last Updated: 2026-08-24
4
4
 
5
5
  Trusted-server Agents24 SDK for organization-authenticated control-plane, server embed, authoring, artifact, client-deployment, and client-session mint operations. It supports Node 22 and 24 with ESM and CJS entrypoints.
6
6
 
7
+ `resourcePackages.validatePackage(...)` returns the authoritative package identity, diagnostics, and `package_hash` when the package compiles successfully. Use that hash value for safe preview/import retry semantics instead of independently hashing package contents.
8
+
7
9
  Runtime attachment uploads return durable metadata. Use `agents.createAttachmentContentAccess(...)` for internal attachments or `embed.createAttachmentContentAccess(...)` for server-embed attachments to mint a short-lived private inline or direct-download URL.
8
10
 
9
11
  ```ts
@@ -31,6 +33,8 @@ const session = await agents24.clientSessions.createBackendSession(
31
33
 
32
34
  Administer deployments through `agents24.clientDeployments`; use `agents24.agents`, `agents24.runs`, and `agents24.embed` for trusted Agent operations. End-user token networking remains in `@agents24/client`.
33
35
 
36
+ For Git-owned Package V2 products, `agents24.resourcePackages.getExportability()` returns the closed machine-readable field-classification contract used by Bundle projection and pull. `agents24.resourceInstallations` includes `plan`, `planPull`, `downloadPull`, `acceptPull`, draft-only `apply`, `publish`, `get`, and related resource/discovery helpers. Pull is the reverse sync path from platform drafts into canonical local package files and verifies portable semantic equality before any write. `get(...)` exposes `latest_apply`, `latest_pull`, `last_sync_direction`, `last_synchronized_at`, `synchronized_package_hash`, divergence from the synchronized snapshot, and the latest pull summary.
37
+
34
38
  HITL V2 includes `respond` for Agent-requested user input. Its payload contains ordered answers with `question_id`, `selected_option_ids`, and optional `custom_text`; use the existing resume method and then reattach to the same run.
35
39
 
36
40
  Deployment administration uses reversible `lifecycle_status: "active" | "inactive"` updates and irreversible `clientDeployments.delete(...)`. Active deployments require a Resource Policy; removing it makes the deployment inactive and invalidates issued sessions. There is no `revoke()` method.
@@ -57,7 +61,27 @@ This package is server-only. Never expose an organization API key to browser cod
57
61
 
58
62
  ## Same-origin BFF
59
63
 
60
- `@agents24/node/bff` exports `createAgents24BffHandler(...)`. Mount its returned Fetch handler at a same-origin path, provide an API-key client plus Agent ID, and resolve a stable customer `subject`. Supply an optional `issuer` only when an authenticated customer needs organization-wide governance. The bridge keeps the API key, Agent, and optional exact Agent version on the server; it does not use a Client Deployment. It can explicitly use draft runtime only with `agents.execute`; direct clients stay published-only.
64
+ `@agents24/node/bff` exports `createAgents24BffHandler(...)`. Mount its
65
+ returned Fetch handler at a same-origin path, provide an API-key client plus
66
+ an `agents` array plus `conversationScope`, and resolve a stable customer
67
+ `subject`. Supply an optional `issuer` only when an authenticated customer
68
+ needs organization-wide governance. The bridge keeps the API key, configured
69
+ Agents, and any optional exact Agent versions on the server; it does not use a
70
+ Client Deployment. It can explicitly use draft runtime only with
71
+ `agents.execute`; direct clients stay published-only.
72
+
73
+ The root BFF surface is conversation-scoped and Agent-neutral: `/threads`,
74
+ `/threads/events`, `/threads/{threadId}`, `PATCH /threads/{threadId}/runtime-selection`,
75
+ and `DELETE /threads/{threadId}` operate across the configured Agent set.
76
+ Run-owned routes resolve the authoritative Agent from the stored run. The same
77
+ browser client continues to use `createBffAgentClient({ basePath })`.
78
+
79
+ Subject-only BFF principals use that stable subject directly with no identity
80
+ or Resource Policy preflight. When `issuer` is present, the BFF resolves one
81
+ opaque organization customer principal through
82
+ `agents24.embed.resolveCustomerPrincipal({ issuer, subject })`, caches that
83
+ lookup with a bounded 60-second single-flight window across conversation-scoped routes,
84
+ and fetches Resource Policy only for explicit policy/bootstrap UI needs.
61
85
 
62
86
  ## Customer Resource Policies
63
87
 
@@ -1,6 +1,6 @@
1
1
  {
2
- "contractHash": "4012be62020727eb18b7e88cdc8067dcc605e1ecbe9d5acd12c51268e351a289",
3
- "contractVersion": "0.2.0",
2
+ "contractHash": "55fa8df5285c62edb41ce640b217eafbb17f32296ead83ae1b8d34c96d0c21f1",
3
+ "contractVersion": "0.3.0",
4
4
  "corpus": "conformance/v1/corpus.json",
5
5
  "generatedBy": "@agents24/sdk-contract",
6
6
  "packages": {
@@ -19,7 +19,7 @@
19
19
  "runtime": "run-stream.v3"
20
20
  },
21
21
  "@agents24/node": {
22
- "contract": "4012be62020727eb18b7e88cdc8067dcc605e1ecbe9d5acd12c51268e351a289",
22
+ "contract": "55fa8df5285c62edb41ce640b217eafbb17f32296ead83ae1b8d34c96d0c21f1",
23
23
  "node": "^22.0.0 || ^24.0.0"
24
24
  },
25
25
  "@agents24/react": {
@@ -31,7 +31,7 @@
31
31
  "protocolOwner": "@agents24/client"
32
32
  },
33
33
  "agents24": {
34
- "contract": "4012be62020727eb18b7e88cdc8067dcc605e1ecbe9d5acd12c51268e351a289",
34
+ "contract": "55fa8df5285c62edb41ce640b217eafbb17f32296ead83ae1b8d34c96d0c21f1",
35
35
  "python": ">=3.10"
36
36
  }
37
37
  },
@@ -48,7 +48,7 @@
48
48
  "schemaVersion": "agents24.compatibility.v1",
49
49
  "targetOperationCounts": {
50
50
  "client": 22,
51
- "node": 93,
52
- "python": 84
51
+ "node": 106,
52
+ "python": 99
53
53
  }
54
54
  }