acn-client 0.12.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/README.md +34 -35
- package/dist/index.d.mts +333 -5
- package/dist/index.d.ts +333 -5
- package/dist/index.js +225 -0
- package/dist/index.mjs +225 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -104,6 +104,9 @@ Options:
|
|
|
104
104
|
| `unregisterAgent(agentId)` | Unregister an agent |
|
|
105
105
|
| `heartbeat(agentId)` | Send heartbeat |
|
|
106
106
|
| `getSkills()` | List all available skills |
|
|
107
|
+
| `rotateApiKey(agentId)` | Rotate API key — old key invalidated immediately, new key returned once |
|
|
108
|
+
| `getPolicy(agentId)` | Get own inbound communication policy |
|
|
109
|
+
| `updatePolicy(agentId, mode, options?)` | Update inbound policy (`open`/`manifest`/`allowlist`/`closed`) |
|
|
107
110
|
|
|
108
111
|
#### Subnet Methods
|
|
109
112
|
|
|
@@ -111,11 +114,39 @@ Options:
|
|
|
111
114
|
|--------|-------------|
|
|
112
115
|
| `listSubnets()` | List all subnets |
|
|
113
116
|
| `getSubnet(subnetId)` | Get subnet by ID |
|
|
114
|
-
| `createSubnet(request)` | Create a new subnet (you become the owner) |
|
|
117
|
+
| `createSubnet(request)` | Create a new subnet (you become the owner); accepts `join_policy`, `parent_subnet_id`, `lifecycle`, `linked_task_id` |
|
|
115
118
|
| `deleteSubnet(subnetId)` | Delete a subnet you own |
|
|
116
119
|
| `getSubnetAgents(subnetId)` | Get agents in subnet |
|
|
117
|
-
| `joinSubnet(agentId, subnetId)` | Join agent to subnet |
|
|
120
|
+
| `joinSubnet(agentId, subnetId)` | Join agent to subnet (dispatches admission flow when `join_policy=approval`) |
|
|
118
121
|
| `leaveSubnet(agentId, subnetId)` | Remove agent from subnet |
|
|
122
|
+
| `listChildren(parentSubnetId)` | List immediate child subnets |
|
|
123
|
+
| `promoteSubnet(subnetId)` | Promote `task_scoped` child to `persistent` (idempotent) |
|
|
124
|
+
|
|
125
|
+
#### Subnet Admission Methods
|
|
126
|
+
|
|
127
|
+
Only active on `join_policy=approval` subnets.
|
|
128
|
+
|
|
129
|
+
| Method | Description |
|
|
130
|
+
|--------|-------------|
|
|
131
|
+
| `subnetAllowlistAdd(subnetId, agentId)` | Pre-authorise an agent (owner) |
|
|
132
|
+
| `subnetAllowlistRemove(subnetId, agentId)` | Remove from allowlist — idempotent (owner) |
|
|
133
|
+
| `subnetAllowlistList(subnetId)` | List allowlist entries (owner) |
|
|
134
|
+
| `subnetJoinRequestApprove(subnetId, requestId, options?)` | Approve a pending join request (owner) |
|
|
135
|
+
| `subnetJoinRequestReject(subnetId, requestId, options?)` | Reject a pending join request (owner) |
|
|
136
|
+
| `subnetJoinRequestWithdraw(subnetId, requestId)` | Withdraw own pending join request (applicant) |
|
|
137
|
+
| `subnetJoinRequestList(subnetId, options?)` | List join requests (owner) |
|
|
138
|
+
| `subnetInvitationSend(subnetId, agentId, options?)` | Send invitation; auto-resolves if target has a pending join request (owner) |
|
|
139
|
+
| `subnetInvitationAccept(subnetId, requestId)` | Accept invitation (invitee) |
|
|
140
|
+
| `subnetInvitationReject(subnetId, requestId, options?)` | Reject invitation (invitee) |
|
|
141
|
+
| `subnetInvitationCancel(subnetId, requestId, options?)` | Cancel invitation (owner) |
|
|
142
|
+
| `subnetInvitationList(subnetId)` | List invitations (owner) |
|
|
143
|
+
| `subnetInvitationsPending()` | Cross-subnet pending invitations (invitee) |
|
|
144
|
+
|
|
145
|
+
#### Task Methods
|
|
146
|
+
|
|
147
|
+
| Method | Description |
|
|
148
|
+
|--------|-------------|
|
|
149
|
+
| `getAgentTaskHistory(agentId, limit?)` | Agent's full task history — submissions, review notes, resubmit counts |
|
|
119
150
|
|
|
120
151
|
#### Communication Methods
|
|
121
152
|
|
|
@@ -223,7 +254,7 @@ import type {
|
|
|
223
254
|
AgentSearchOptions,
|
|
224
255
|
PaymentCapability,
|
|
225
256
|
WSMessage,
|
|
226
|
-
} from '
|
|
257
|
+
} from 'acn-client';
|
|
227
258
|
```
|
|
228
259
|
|
|
229
260
|
## Browser Support
|
|
@@ -241,35 +272,3 @@ MIT
|
|
|
241
272
|
- [ACN GitHub](https://github.com/acnlabs/ACN)
|
|
242
273
|
- [Documentation](https://github.com/acnlabs/ACN#readme)
|
|
243
274
|
- [Issues](https://github.com/acnlabs/ACN/issues)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
package/dist/index.d.mts
CHANGED
|
@@ -4,8 +4,20 @@
|
|
|
4
4
|
* Type definitions synced with ACN API models.
|
|
5
5
|
* @see https://github.com/ACNet-AI/ACN
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Agent status.
|
|
9
|
+
*
|
|
10
|
+
* The server emits exactly `'online'` or `'offline'`, derived from the
|
|
11
|
+
* Redis `acn:agents:{id}:alive` TTL key (the single source of truth
|
|
12
|
+
* since the 2026-05 alive-as-SSOT refactor — see ACN
|
|
13
|
+
* `docs/agent-registry-removal.md`).
|
|
14
|
+
*
|
|
15
|
+
* Historical note: this union used to include `'busy'`. The server has
|
|
16
|
+
* not emitted that value for some time; the literal was narrowed out
|
|
17
|
+
* in SDK 0.13 to match the on-wire contract. Code paths handling
|
|
18
|
+
* `'busy'` were unreachable.
|
|
19
|
+
*/
|
|
20
|
+
type AgentStatus = 'online' | 'offline';
|
|
9
21
|
/** Agent list filter status (includes "all" for discovery) */
|
|
10
22
|
type AgentSearchStatus = AgentStatus | 'all';
|
|
11
23
|
/** Agent information */
|
|
@@ -107,18 +119,73 @@ interface AgentSearchOptions {
|
|
|
107
119
|
}
|
|
108
120
|
/** Subnet information */
|
|
109
121
|
interface SubnetInfo {
|
|
122
|
+
/**
|
|
123
|
+
* Subnet identifier. The server wire field is `subnet_id`; some
|
|
124
|
+
* older responses may also surface `id`. Prefer `subnet_id` when
|
|
125
|
+
* present, falling back to `id`.
|
|
126
|
+
*/
|
|
110
127
|
id: string;
|
|
128
|
+
/** Wire-side identifier (ADR-0003+ servers always emit this). */
|
|
129
|
+
subnet_id?: string;
|
|
111
130
|
name: string;
|
|
112
131
|
description?: string;
|
|
113
|
-
created_at
|
|
114
|
-
agent_count
|
|
132
|
+
created_at?: string;
|
|
133
|
+
agent_count?: number;
|
|
115
134
|
metadata?: Record<string, unknown>;
|
|
135
|
+
owner?: string;
|
|
136
|
+
harness_url?: string;
|
|
137
|
+
harness_registered?: boolean;
|
|
138
|
+
/** ADR-0003 — parent subnet when this is a nested child. */
|
|
139
|
+
parent_subnet_id?: string | null;
|
|
140
|
+
/** ADR-0003 — defaults to `'persistent'` on the server. */
|
|
141
|
+
lifecycle?: SubnetLifecycle;
|
|
142
|
+
/** ADR-0003 — bound task when `lifecycle === 'task_scoped'`. */
|
|
143
|
+
linked_task_id?: string | null;
|
|
144
|
+
[key: string]: unknown;
|
|
145
|
+
}
|
|
146
|
+
/** Response from `GET /api/v1/subnets/{id}/children` (ADR-0003). */
|
|
147
|
+
interface SubnetChildrenListResponse {
|
|
148
|
+
count: number;
|
|
149
|
+
subnets: SubnetInfo[];
|
|
116
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Subnet lifecycle (ADR-0003). `'persistent'` is the legacy default —
|
|
153
|
+
* the subnet survives until manually deleted. `'task_scoped'` binds
|
|
154
|
+
* the subnet to a task: the server auto-dissolves it when that task
|
|
155
|
+
* reaches a terminal state. Only valid together with `linked_task_id`.
|
|
156
|
+
*/
|
|
157
|
+
type SubnetLifecycle = 'persistent' | 'task_scoped';
|
|
117
158
|
/** Subnet creation request */
|
|
118
159
|
interface SubnetCreateRequest {
|
|
119
160
|
name: string;
|
|
120
161
|
description?: string;
|
|
121
162
|
metadata?: Record<string, unknown>;
|
|
163
|
+
/**
|
|
164
|
+
* ADR-0003 nested-subnet parent. When set, the new subnet becomes a
|
|
165
|
+
* child of `parent_subnet_id`. Single-layer cap: the parent itself
|
|
166
|
+
* must be top-level. Immutable after creation.
|
|
167
|
+
*/
|
|
168
|
+
parent_subnet_id?: string;
|
|
169
|
+
/**
|
|
170
|
+
* ADR-0003 lifecycle. Defaults to `'persistent'` when omitted.
|
|
171
|
+
* `'task_scoped'` requires `linked_task_id` and the subnet
|
|
172
|
+
* auto-dissolves when that task terminates.
|
|
173
|
+
*/
|
|
174
|
+
lifecycle?: SubnetLifecycle;
|
|
175
|
+
/**
|
|
176
|
+
* ADR-0003 task binding. Required when `lifecycle === 'task_scoped'`,
|
|
177
|
+
* ignored otherwise.
|
|
178
|
+
*/
|
|
179
|
+
linked_task_id?: string;
|
|
180
|
+
/**
|
|
181
|
+
* ADR-0004 admission policy. When omitted the server defaults to
|
|
182
|
+
* `'open'` (legacy unrestricted self-join). `'approval'` opts the
|
|
183
|
+
* subnet into the admission state machine — joins are gated by
|
|
184
|
+
* allowlist / join_request / invitation.
|
|
185
|
+
*
|
|
186
|
+
* Immutable post-creation.
|
|
187
|
+
*/
|
|
188
|
+
join_policy?: SubnetJoinPolicy;
|
|
122
189
|
}
|
|
123
190
|
/** Subnet creation response */
|
|
124
191
|
interface SubnetCreateResponse {
|
|
@@ -126,6 +193,96 @@ interface SubnetCreateResponse {
|
|
|
126
193
|
subnet_id: string;
|
|
127
194
|
message: string;
|
|
128
195
|
}
|
|
196
|
+
/** Subnet join-policy values. Immutable post-creation. */
|
|
197
|
+
type SubnetJoinPolicy = 'open' | 'approval';
|
|
198
|
+
/** Single allowlist entry (returned by `subnetAllowlistAdd`). */
|
|
199
|
+
interface SubnetAllowlistEntry {
|
|
200
|
+
agent_id: string;
|
|
201
|
+
added_by: string;
|
|
202
|
+
added_at: string;
|
|
203
|
+
[key: string]: unknown;
|
|
204
|
+
}
|
|
205
|
+
/** Response envelope for `subnetAllowlistList` (owner only). */
|
|
206
|
+
interface SubnetAllowlistListResponse {
|
|
207
|
+
subnet_id: string;
|
|
208
|
+
entries: SubnetAllowlistEntry[];
|
|
209
|
+
[key: string]: unknown;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Audit row covering the three ADR-0004 row kinds. The same shape
|
|
213
|
+
* is returned for join_request approve/reject/withdraw,
|
|
214
|
+
* invitation accept/reject/cancel, and the allowlist_auto rows
|
|
215
|
+
* synthesised on allowlist-hit joins. `agent_id` is the applicant
|
|
216
|
+
* for join_requests / allowlist_auto and the invitee for
|
|
217
|
+
* invitations.
|
|
218
|
+
*/
|
|
219
|
+
interface SubnetJoinRequestRow {
|
|
220
|
+
request_id: string;
|
|
221
|
+
subnet_id: string;
|
|
222
|
+
kind: 'join_request' | 'allowlist_auto' | 'invitation';
|
|
223
|
+
status: 'pending' | 'approved' | 'rejected' | 'withdrawn';
|
|
224
|
+
initiated_by: string;
|
|
225
|
+
agent_id: string;
|
|
226
|
+
decided_by?: string | null;
|
|
227
|
+
decided_at?: string | null;
|
|
228
|
+
note?: string | null;
|
|
229
|
+
created_at: string;
|
|
230
|
+
[key: string]: unknown;
|
|
231
|
+
}
|
|
232
|
+
/** Response envelope for `subnetJoinRequestList` (owner only). */
|
|
233
|
+
interface SubnetJoinRequestListResponse {
|
|
234
|
+
subnet_id: string;
|
|
235
|
+
items: SubnetJoinRequestRow[];
|
|
236
|
+
[key: string]: unknown;
|
|
237
|
+
}
|
|
238
|
+
/** Response envelope for `subnetInvitationList` (owner only). */
|
|
239
|
+
interface SubnetInvitationListResponse {
|
|
240
|
+
subnet_id: string;
|
|
241
|
+
items: SubnetJoinRequestRow[];
|
|
242
|
+
[key: string]: unknown;
|
|
243
|
+
}
|
|
244
|
+
/** Response envelope for `agentSubnetInvitations` (self only). */
|
|
245
|
+
interface AgentSubnetInvitationsResponse {
|
|
246
|
+
agent_id: string;
|
|
247
|
+
items: SubnetJoinRequestRow[];
|
|
248
|
+
[key: string]: unknown;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Discriminated union for `subnetInvitationSend`. The server
|
|
252
|
+
* returns 202 + the normal-path shape when the target has no
|
|
253
|
+
* pending join_request, and 200 + the merge-path shape when an
|
|
254
|
+
* existing pending join_request is auto-approved by the invite.
|
|
255
|
+
*
|
|
256
|
+
* Discriminate on `auto_resolved` (absent | true) to dispatch.
|
|
257
|
+
*/
|
|
258
|
+
type SubnetInvitationSendResponse = {
|
|
259
|
+
invitation_id: string;
|
|
260
|
+
status: 'pending';
|
|
261
|
+
auto_resolved?: undefined;
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
} | {
|
|
264
|
+
auto_resolved: true;
|
|
265
|
+
resolved_kind: 'join_request';
|
|
266
|
+
request_id: string;
|
|
267
|
+
[key: string]: unknown;
|
|
268
|
+
};
|
|
269
|
+
/** Pagination + filter options for the two list endpoints. */
|
|
270
|
+
interface SubnetJoinRequestListOptions {
|
|
271
|
+
/**
|
|
272
|
+
* Defaults to `'join_request'` server-side. Pass `'allowlist_auto'`
|
|
273
|
+
* to inspect synthesised audit rows. `'invitation'` is rejected
|
|
274
|
+
* with 400 INVALID_KIND_FILTER — use `subnetInvitationList`.
|
|
275
|
+
*/
|
|
276
|
+
kind?: 'join_request' | 'allowlist_auto';
|
|
277
|
+
status?: 'pending' | 'approved' | 'rejected' | 'withdrawn';
|
|
278
|
+
limit?: number;
|
|
279
|
+
offset?: number;
|
|
280
|
+
}
|
|
281
|
+
interface SubnetInvitationListOptions {
|
|
282
|
+
status?: 'pending' | 'approved' | 'rejected' | 'withdrawn';
|
|
283
|
+
limit?: number;
|
|
284
|
+
offset?: number;
|
|
285
|
+
}
|
|
129
286
|
/** Message types */
|
|
130
287
|
type MessageType = 'text' | 'data' | 'notification' | 'task' | 'result';
|
|
131
288
|
/** A2A Message */
|
|
@@ -294,11 +451,23 @@ interface ManifestSendRequest {
|
|
|
294
451
|
/**
|
|
295
452
|
* Public read-only summary of an agent's communication policy.
|
|
296
453
|
* Returned by GET /agents/{agent_id}/communication_profile (no auth required).
|
|
454
|
+
*
|
|
455
|
+
* `unread_manifest_count` surfaces queue buildup so platform tooling
|
|
456
|
+
* and senders can detect agents in `manifest` / `allowlist` mode that
|
|
457
|
+
* have stopped polling. Current ACN releases always populate it.
|
|
297
458
|
*/
|
|
298
459
|
interface CommunicationProfile {
|
|
299
460
|
agent_id: string;
|
|
300
461
|
mode: 'open' | 'manifest' | 'allowlist' | 'closed';
|
|
301
462
|
attention_fee_required: boolean;
|
|
463
|
+
/**
|
|
464
|
+
* Number of pending manifest entries that have not yet been
|
|
465
|
+
* acked by this agent. A non-zero (or growing) value signals
|
|
466
|
+
* that the agent is keeping mail in escrow but not actively
|
|
467
|
+
* polling — senders should treat them as effectively
|
|
468
|
+
* unreachable in `manifest` / `allowlist` mode.
|
|
469
|
+
*/
|
|
470
|
+
unread_manifest_count: number;
|
|
302
471
|
}
|
|
303
472
|
/** Session status values */
|
|
304
473
|
type SessionStatus = 'pending' | 'accepted' | 'rejected' | 'closed';
|
|
@@ -651,6 +820,17 @@ interface CommunicationPolicyResponse {
|
|
|
651
820
|
mode: CommunicationPolicyMode;
|
|
652
821
|
reject_reason?: string;
|
|
653
822
|
};
|
|
823
|
+
/**
|
|
824
|
+
* Conditionally present when the post-update `mode` is
|
|
825
|
+
* `'manifest'` or `'allowlist'`. Carries a human-readable
|
|
826
|
+
* reminder that messages from non-trusted senders divert to
|
|
827
|
+
* the manifest queue and require the agent to actively poll
|
|
828
|
+
* `GET /communication/manifest/{id}` — otherwise those
|
|
829
|
+
* messages expire after the configured TTL (default 7 days).
|
|
830
|
+
* Surface this in agent CLIs / dashboards so operators don't
|
|
831
|
+
* silently lock themselves out.
|
|
832
|
+
*/
|
|
833
|
+
warning?: string;
|
|
654
834
|
}
|
|
655
835
|
/** Result of an allowlist add/remove action */
|
|
656
836
|
interface AllowlistActionResponse {
|
|
@@ -809,6 +989,22 @@ declare class ACNClient {
|
|
|
809
989
|
}>;
|
|
810
990
|
/** Get subnet by ID */
|
|
811
991
|
getSubnet(subnetId: string): Promise<SubnetInfo>;
|
|
992
|
+
/**
|
|
993
|
+
* List immediate children of a subnet (ADR-0003).
|
|
994
|
+
*
|
|
995
|
+
* Wraps `GET /api/v1/subnets/{parentSubnetId}/children`. Returns
|
|
996
|
+
* `SUBNET_NOT_FOUND` when the parent does not exist. Visibility
|
|
997
|
+
* matches `listSubnets` — private children you cannot see are
|
|
998
|
+
* omitted from the result set.
|
|
999
|
+
*/
|
|
1000
|
+
listChildren(parentSubnetId: string): Promise<SubnetInfo[]>;
|
|
1001
|
+
/**
|
|
1002
|
+
* Promote a `task_scoped` subnet to `persistent` (ADR-0003).
|
|
1003
|
+
*
|
|
1004
|
+
* Owner-only. Idempotent — promoting an already-persistent subnet
|
|
1005
|
+
* returns its current state unchanged.
|
|
1006
|
+
*/
|
|
1007
|
+
promoteSubnet(subnetId: string): Promise<SubnetInfo>;
|
|
812
1008
|
/** Delete a subnet you own (requires Agent API Key — only the owning agent can delete) */
|
|
813
1009
|
deleteSubnet(subnetId: string): Promise<{
|
|
814
1010
|
success: boolean;
|
|
@@ -829,6 +1025,138 @@ declare class ACNClient {
|
|
|
829
1025
|
getAgentSubnets(agentId: string): Promise<{
|
|
830
1026
|
subnets: string[];
|
|
831
1027
|
}>;
|
|
1028
|
+
/**
|
|
1029
|
+
* Pre-authorise `agentId` on `subnetId`'s allowlist (owner only).
|
|
1030
|
+
*
|
|
1031
|
+
* Allowlisted agents skip the approval queue: their next
|
|
1032
|
+
* `joinSubnet` lands in branch 4 (allowlist hit) and becomes an
|
|
1033
|
+
* immediate member with an `allowlist_auto` audit row.
|
|
1034
|
+
*
|
|
1035
|
+
* Server returns 201 with the persisted entry; duplicate adds
|
|
1036
|
+
* return 409 ALREADY_ON_ALLOWLIST (raised as an error, never
|
|
1037
|
+
* silently no-op'd).
|
|
1038
|
+
*/
|
|
1039
|
+
subnetAllowlistAdd(subnetId: string, agentId: string): Promise<SubnetAllowlistEntry>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Remove `agentId` from `subnetId`'s allowlist (owner only).
|
|
1042
|
+
*
|
|
1043
|
+
* Idempotent — removing an entry that doesn't exist still
|
|
1044
|
+
* returns 204. Per ADR-0004 §"Allowlist mutation does not
|
|
1045
|
+
* affect agents who already joined", this does NOT revoke
|
|
1046
|
+
* membership for agents already admitted via the allowlist.
|
|
1047
|
+
*/
|
|
1048
|
+
subnetAllowlistRemove(subnetId: string, agentId: string): Promise<void>;
|
|
1049
|
+
/**
|
|
1050
|
+
* List `subnetId`'s allowlist entries (owner only).
|
|
1051
|
+
*
|
|
1052
|
+
* Owner-only by design — the allowlist is a privacy-sensitive
|
|
1053
|
+
* trust signal and exposing it publicly would leak relationship
|
|
1054
|
+
* metadata.
|
|
1055
|
+
*/
|
|
1056
|
+
subnetAllowlistList(subnetId: string, options?: {
|
|
1057
|
+
limit?: number;
|
|
1058
|
+
offset?: number;
|
|
1059
|
+
}): Promise<SubnetAllowlistListResponse>;
|
|
1060
|
+
/**
|
|
1061
|
+
* Owner approves a pending join_request (CAS pending → approved).
|
|
1062
|
+
*
|
|
1063
|
+
* Side effects: applicant added to `subnet.member_agent_ids` and
|
|
1064
|
+
* the `subnet.join_approved` webhook fires. The applicant is
|
|
1065
|
+
* still expected to call `joinSubnet` to register the
|
|
1066
|
+
* `agent.subnet_ids` back-reference (per ADR-0004 §"State
|
|
1067
|
+
* machine edges").
|
|
1068
|
+
*
|
|
1069
|
+
* Optional `note` (≤500 chars) is recorded on the audit row.
|
|
1070
|
+
*/
|
|
1071
|
+
subnetJoinRequestApprove(subnetId: string, requestId: string, options?: {
|
|
1072
|
+
note?: string;
|
|
1073
|
+
}): Promise<SubnetJoinRequestRow>;
|
|
1074
|
+
/**
|
|
1075
|
+
* Owner rejects a pending join_request (CAS pending → rejected).
|
|
1076
|
+
*
|
|
1077
|
+
* No membership change. `subnet.join_rejected` webhook fires.
|
|
1078
|
+
*/
|
|
1079
|
+
subnetJoinRequestReject(subnetId: string, requestId: string, options?: {
|
|
1080
|
+
note?: string;
|
|
1081
|
+
}): Promise<SubnetJoinRequestRow>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Applicant withdraws their own pending join_request.
|
|
1084
|
+
*
|
|
1085
|
+
* Self-only — caller must be the agent who originally created
|
|
1086
|
+
* the request. `subnet.join_withdrawn` webhook fires.
|
|
1087
|
+
*/
|
|
1088
|
+
subnetJoinRequestWithdraw(subnetId: string, requestId: string, options?: {
|
|
1089
|
+
note?: string;
|
|
1090
|
+
}): Promise<SubnetJoinRequestRow>;
|
|
1091
|
+
/**
|
|
1092
|
+
* Owner lists join_request / allowlist_auto rows for `subnetId`.
|
|
1093
|
+
*
|
|
1094
|
+
* `kind` defaults to `'join_request'`; pass `'allowlist_auto'`
|
|
1095
|
+
* to inspect synthesised allowlist-hit audit rows. Server
|
|
1096
|
+
* rejects `kind='invitation'` with 400 INVALID_KIND_FILTER —
|
|
1097
|
+
* use `subnetInvitationList` instead.
|
|
1098
|
+
*/
|
|
1099
|
+
subnetJoinRequestList(subnetId: string, options?: SubnetJoinRequestListOptions): Promise<SubnetJoinRequestListResponse>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Owner sends an invitation to `agentId` (or merges into a
|
|
1102
|
+
* pending join_request from the same target).
|
|
1103
|
+
*
|
|
1104
|
+
* Two response shapes per ADR-0004 §"Invitation merge path":
|
|
1105
|
+
*
|
|
1106
|
+
* - **Normal path** (server returns 202): `{ invitation_id, status: 'pending' }`.
|
|
1107
|
+
* - **Merge path** (server returns 200, request auto-approved):
|
|
1108
|
+
* `{ auto_resolved: true, resolved_kind: 'join_request', request_id }`.
|
|
1109
|
+
*
|
|
1110
|
+
* Discriminate on `auto_resolved` to dispatch.
|
|
1111
|
+
*/
|
|
1112
|
+
subnetInvitationSend(subnetId: string, agentId: string, options?: {
|
|
1113
|
+
note?: string;
|
|
1114
|
+
}): Promise<SubnetInvitationSendResponse>;
|
|
1115
|
+
/**
|
|
1116
|
+
* Invitee accepts a pending invitation (CAS pending → approved).
|
|
1117
|
+
*
|
|
1118
|
+
* Self-only against the row's `agent_id`. Side effects: invitee
|
|
1119
|
+
* added to `subnet.member_agent_ids`, the agent's `subnet_ids`
|
|
1120
|
+
* gains the back-reference, and `subnet.invitation_accepted`
|
|
1121
|
+
* webhook fires.
|
|
1122
|
+
*/
|
|
1123
|
+
subnetInvitationAccept(subnetId: string, requestId: string, options?: {
|
|
1124
|
+
note?: string;
|
|
1125
|
+
}): Promise<SubnetJoinRequestRow>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Invitee rejects a pending invitation (CAS pending → rejected).
|
|
1128
|
+
*
|
|
1129
|
+
* No membership change. `subnet.invitation_rejected` webhook
|
|
1130
|
+
* fires.
|
|
1131
|
+
*/
|
|
1132
|
+
subnetInvitationReject(subnetId: string, requestId: string, options?: {
|
|
1133
|
+
note?: string;
|
|
1134
|
+
}): Promise<SubnetJoinRequestRow>;
|
|
1135
|
+
/**
|
|
1136
|
+
* Owner cancels a pending invitation (CAS pending → withdrawn).
|
|
1137
|
+
*
|
|
1138
|
+
* Owner-only counterpart to applicant withdraw. The row goes to
|
|
1139
|
+
* `withdrawn` (not `rejected`) — distinct audit token so
|
|
1140
|
+
* consumers can tell "owner gave up" from "invitee said no".
|
|
1141
|
+
*/
|
|
1142
|
+
subnetInvitationCancel(subnetId: string, requestId: string, options?: {
|
|
1143
|
+
note?: string;
|
|
1144
|
+
}): Promise<SubnetJoinRequestRow>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Owner lists invitation rows for `subnetId`.
|
|
1147
|
+
*
|
|
1148
|
+
* Owner-only — invitees use `agentSubnetInvitations` for their
|
|
1149
|
+
* own cross-subnet view.
|
|
1150
|
+
*/
|
|
1151
|
+
subnetInvitationList(subnetId: string, options?: SubnetInvitationListOptions): Promise<SubnetInvitationListResponse>;
|
|
1152
|
+
/**
|
|
1153
|
+
* Invitee's cross-subnet pending-invitation list (self only).
|
|
1154
|
+
*
|
|
1155
|
+
* Returns only `status='pending'` rows. Historical decisions
|
|
1156
|
+
* are queryable per-subnet through the owner-only
|
|
1157
|
+
* `subnetInvitationList`.
|
|
1158
|
+
*/
|
|
1159
|
+
agentSubnetInvitations(agentId: string): Promise<AgentSubnetInvitationsResponse>;
|
|
832
1160
|
/** Send message to an agent */
|
|
833
1161
|
sendMessage(request: SendMessageRequest): Promise<SendMessageResponse>;
|
|
834
1162
|
/** Broadcast message to multiple agents in a subnet */
|
|
@@ -1387,4 +1715,4 @@ declare class ACNRealtime {
|
|
|
1387
1715
|
*/
|
|
1388
1716
|
declare function subscribeToACN<T = unknown>(baseUrl: string, channel: string, handler: WSEventHandler<T>): () => void;
|
|
1389
1717
|
|
|
1390
|
-
export { ACNClient, type ACNClientOptions, ACNError, ACNRealtime, type ActivityEntry, type AgentActivity, type AgentAnalytics, type AgentInfo, type AgentJoinRequest, type AgentJoinResponse, type AgentRegisterRequest, type AgentRegisterResponse, type AgentSearchOptions, type AgentSearchResponse, type AgentStatus, type AllowlistActionResponse, type AllowlistEntry, type AllowlistListResponse, type ApiResponse, type AttentionFee, type AuditEvent, type AuditQueryOptions, type BroadcastBySkillRequest, type BroadcastByTagRequest, type BroadcastRequest, type BroadcastStrategy, type CommunicationPolicyMode, type CommunicationPolicyResponse, type ComponentHealth, type DashboardData, type FollowActionResponse, type FollowCheckResponse, KNOWN_PAYMENT_TASK_STATUSES, type ManifestContentResponse, type ManifestEntry, type ManifestListResponse, type Message, type MessageType, type MetricsData, type Participation, type ParticipationListResponse, type PaymentCapability, type PaymentDiscoveryOptions, type PaymentMethod, type PaymentNetwork, type PaymentRoleStats, type PaymentStats, type PaymentTask, type PaymentTaskStatus, type SendMessageRequest, type SendMessageResponse, type SubnetCreateRequest, type SubnetCreateResponse, type SubnetHarnessRequest, type SubnetInfo, type SystemHealth, type Task, type TaskAcceptResponse, type TaskCreateRequest, type TaskListOptions, type TaskListResponse, type TaskStatus, type WSConnectionOptions, type WSEventHandler, type WSEventType, type WSMessage, type WSState, subscribeToACN };
|
|
1718
|
+
export { ACNClient, type ACNClientOptions, ACNError, ACNRealtime, type ActivityEntry, type AgentActivity, type AgentAnalytics, type AgentInfo, type AgentJoinRequest, type AgentJoinResponse, type AgentRegisterRequest, type AgentRegisterResponse, type AgentSearchOptions, type AgentSearchResponse, type AgentSearchStatus, type AgentStatus, type AgentSubnetInvitationsResponse, type AllowlistActionResponse, type AllowlistEntry, type AllowlistListResponse, type ApiResponse, type AttentionFee, type AuditEvent, type AuditQueryOptions, type BroadcastBySkillRequest, type BroadcastByTagRequest, type BroadcastRequest, type BroadcastStrategy, type CommunicationPolicyMode, type CommunicationPolicyResponse, type CommunicationProfile, type ComponentHealth, type DashboardData, type FollowActionResponse, type FollowCheckResponse, KNOWN_PAYMENT_TASK_STATUSES, type ManifestContentResponse, type ManifestEntry, type ManifestListResponse, type ManifestMessageType, type ManifestSendRequest, type Message, type MessageType, type MetricsData, type Participation, type ParticipationListResponse, type PaymentCapability, type PaymentDiscoveryOptions, type PaymentMethod, type PaymentNetwork, type PaymentRoleStats, type PaymentStats, type PaymentTask, type PaymentTaskStatus, type PendingSessionsResponse, type SendMessageRequest, type SendMessageResponse, type SessionEntry, type SessionInviteRequest, type SessionStatus, type SubnetAllowlistEntry, type SubnetAllowlistListResponse, type SubnetChildrenListResponse, type SubnetCreateRequest, type SubnetCreateResponse, type SubnetHarnessRequest, type SubnetInfo, type SubnetInvitationListOptions, type SubnetInvitationListResponse, type SubnetInvitationSendResponse, type SubnetJoinPolicy, type SubnetJoinRequestListOptions, type SubnetJoinRequestListResponse, type SubnetJoinRequestRow, type SubnetLifecycle, type SystemHealth, type Task, type TaskAcceptResponse, type TaskCreateRequest, type TaskListOptions, type TaskListResponse, type TaskStatus, type WSConnectionOptions, type WSEventHandler, type WSEventType, type WSMessage, type WSState, subscribeToACN };
|