@masons/agent-network 0.6.20 → 0.6.22

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 (55) hide show
  1. package/dist/channel-setup.d.ts +0 -1
  2. package/dist/channel-setup.d.ts.map +1 -1
  3. package/dist/channel-setup.js +20 -13
  4. package/dist/channel.d.ts.map +1 -1
  5. package/dist/channel.js +54 -44
  6. package/dist/cli-setup.d.ts.map +1 -1
  7. package/dist/cli-setup.js +13 -7
  8. package/dist/config.d.ts +2 -0
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/config.js +9 -1
  11. package/dist/connector-client.d.ts +35 -4
  12. package/dist/connector-client.d.ts.map +1 -1
  13. package/dist/connector-client.js +126 -19
  14. package/dist/conversation-manager-context.d.ts +4 -0
  15. package/dist/conversation-manager-context.d.ts.map +1 -0
  16. package/dist/conversation-manager-context.js +8 -0
  17. package/dist/conversation-manager.d.ts +29 -4
  18. package/dist/conversation-manager.d.ts.map +1 -1
  19. package/dist/conversation-manager.js +163 -14
  20. package/dist/handoff-acceptance.d.ts +11 -0
  21. package/dist/handoff-acceptance.d.ts.map +1 -0
  22. package/dist/handoff-acceptance.js +62 -0
  23. package/dist/handoff.d.ts +0 -1
  24. package/dist/handoff.d.ts.map +1 -1
  25. package/dist/handoff.js +4 -19
  26. package/dist/identity-format.d.ts +6 -0
  27. package/dist/identity-format.d.ts.map +1 -0
  28. package/dist/identity-format.js +30 -0
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/platform-client.d.ts +1 -0
  32. package/dist/platform-client.d.ts.map +1 -1
  33. package/dist/platform-client.js +24 -0
  34. package/dist/plugin.d.ts +2 -1
  35. package/dist/plugin.d.ts.map +1 -1
  36. package/dist/plugin.js +49 -30
  37. package/dist/sent-message-buffer.d.ts +2 -3
  38. package/dist/sent-message-buffer.d.ts.map +1 -1
  39. package/dist/sent-message-buffer.js +8 -11
  40. package/dist/tools.d.ts.map +1 -1
  41. package/dist/tools.js +97 -20
  42. package/dist/turn-context.d.ts +0 -4
  43. package/dist/turn-context.d.ts.map +1 -1
  44. package/dist/turn-context.js +0 -18
  45. package/dist/types.d.ts +10 -1
  46. package/dist/types.d.ts.map +1 -1
  47. package/dist/types.js +3 -1
  48. package/dist/version.d.ts +1 -1
  49. package/dist/version.js +1 -1
  50. package/dist/ws-heartbeat.d.ts +23 -0
  51. package/dist/ws-heartbeat.d.ts.map +1 -0
  52. package/dist/ws-heartbeat.js +63 -0
  53. package/openclaw.plugin.json +2 -1
  54. package/package.json +1 -1
  55. package/skills/agent-network/SKILL.md +9 -0
@@ -8,7 +8,6 @@ export interface ChannelSetupResult {
8
8
  status: "pending" | "completed" | "expired" | "failed";
9
9
  handoffUrl?: string;
10
10
  expiresAt?: number;
11
- agentHandle?: string;
12
11
  message?: string;
13
12
  }
14
13
  export declare function getDefaultChannelSetupOptions(): StartChannelSetupOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"channel-setup.d.ts","sourceRoot":"","sources":["../src/channel-setup.ts"],"names":[],"mappings":"AAiBA,UAAU,wBAAwB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IAMnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD,wBAAgB,6BAA6B,IAAI,wBAAwB,CAKxE;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAqC7B;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,GAAG,IAAI,CAejE;AAED,wBAAgB,yBAAyB,IAAI,kBAAkB,GAAG,IAAI,CAMrE;AAmED,wBAAgB,4BAA4B,IAAI,IAAI,CAGnD;AAED,eAAO,MAAM,oBAAoB,QAAqB,CAAC"}
1
+ {"version":3,"file":"channel-setup.d.ts","sourceRoot":"","sources":["../src/channel-setup.ts"],"names":[],"mappings":"AAeA,UAAU,wBAAwB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IAMnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAOD,wBAAgB,6BAA6B,IAAI,wBAAwB,CAKxE;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAqC7B;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,GAAG,IAAI,CAcjE;AAED,wBAAgB,yBAAyB,IAAI,kBAAkB,GAAG,IAAI,CAMrE;AAmFD,wBAAgB,4BAA4B,IAAI,IAAI,CAGnD;AAED,eAAO,MAAM,oBAAoB,QAAqB,CAAC"}
@@ -1,8 +1,10 @@
1
- import { readExistingConnectorUrl, writeCredentials, } from "./config.js";
1
+ import createDebug from "debug";
2
+ import { readExistingConnectorUrl } from "./config.js";
2
3
  import { resolveConnectorUrlForSetup } from "./connector-url-boundary.js";
3
4
  import { beginBridgeHandoff, completeBridgeHandoff, DEFAULT_IDP_BASE_URL, HANDOFF_TIMEOUT_MS, SetupFlowError, } from "./handoff.js";
4
- import { assertHandoffDeadlineActive } from "./handoff-deadline.js";
5
+ import { acceptBridgeHandoff } from "./handoff-acceptance.js";
5
6
  import { DEFAULT_API_HOST } from "./platform-client.js";
7
+ const dbg = createDebug("agent-network:channel-setup");
6
8
  let pendingSetup = null;
7
9
  let lastSetupStatus = null;
8
10
  export function getDefaultChannelSetupOptions() {
@@ -59,7 +61,6 @@ export function getChannelSetupStatus() {
59
61
  return null;
60
62
  return {
61
63
  status: lastSetupStatus.status,
62
- agentHandle: lastSetupStatus.agentHandle,
63
64
  message: lastSetupStatus.message,
64
65
  };
65
66
  }
@@ -88,20 +89,22 @@ async function completePendingSetup(record) {
88
89
  const handoff = await completeBridgeHandoff(record.session);
89
90
  if (pendingSetup !== record)
90
91
  return;
91
- const creds = {
92
+ const receipt = await acceptBridgeHandoff({
93
+ handoff,
94
+ apiHost: record.apiHost,
92
95
  connectorUrl: record.connectorUrl,
93
- token: handoff.token,
94
- };
95
- await writeCredentials(creds, record.apiHost, record.idpBaseUrl, record.invitedBy, () => assertHandoffDeadlineActive(record.session.expiresAt));
96
+ idpBaseUrl: record.idpBaseUrl,
97
+ pendingTarget: record.invitedBy,
98
+ expiresAt: record.session.expiresAt,
99
+ });
96
100
  lastSetupStatus = {
97
101
  status: "completed",
98
- agentHandle: handoff.agent.handle,
99
- message: `Setup completed for @${handoff.agent.handle}.`,
102
+ message: receipt,
100
103
  finishedAt: Date.now(),
101
104
  };
102
105
  }
103
106
  catch (err) {
104
- if (pendingSetup !== record)
107
+ if (pendingSetup !== record && !supersedesGenericExpiry(err))
105
108
  return;
106
109
  lastSetupStatus = {
107
110
  status: isExpiryError(err) ? "expired" : "failed",
@@ -115,6 +118,11 @@ async function completePendingSetup(record) {
115
118
  }
116
119
  }
117
120
  }
121
+ function supersedesGenericExpiry(err) {
122
+ return (err instanceof SetupFlowError &&
123
+ pendingSetup === null &&
124
+ lastSetupStatus?.status === "expired");
125
+ }
118
126
  function isExpiryError(err) {
119
127
  if (!(err instanceof SetupFlowError))
120
128
  return false;
@@ -123,9 +131,8 @@ function isExpiryError(err) {
123
131
  function safeSetupErrorMessage(err) {
124
132
  if (err instanceof SetupFlowError)
125
133
  return err.message;
126
- if (err instanceof Error)
127
- return `Setup failed (${err.message}). Re-run setup.`;
128
- return "Setup failed. Re-run setup.";
134
+ dbg("setup failed with an unexpected error: %O", err);
135
+ return "Setup failed for an unexpected reason; check debug logs.";
129
136
  }
130
137
  export function _resetChannelSetupForTesting() {
131
138
  pendingSetup = null;
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,kCAAkC,CAAC;AAa1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAuD9D,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAEvD;AAOD,wBAAgB,2BAA2B,IAAI,OAAO,CAIrD;AAGD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE/D;AAeD,wBAAgB,sCAAsC,CACpD,oBAAoB,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,EACjF,MAAM,EAAE;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,GACA,MAAM,CAiBR;AAED,iBAAS,iCAAiC,CACxC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,gBAAgB,UAAQ,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8CzB;AAED,eAAO,MAAM,4CAA4C,0CACtB,CAAC;AAokBpC,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,mBAAmB,CAuRlE,CAAC"}
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,kCAAkC,CAAC;AAa1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAwD9D,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAEvD;AAOD,wBAAgB,2BAA2B,IAAI,OAAO,CAIrD;AAGD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE/D;AAeD,wBAAgB,sCAAsC,CACpD,oBAAoB,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,EACjF,MAAM,EAAE;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,GACA,MAAM,CAiBR;AAED,iBAAS,iCAAiC,CACxC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,gBAAgB,UAAQ,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8CzB;AAED,eAAO,MAAM,4CAA4C,0CACtB,CAAC;AAkkBpC,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,mBAAmB,CAkSlE,CAAC"}
package/dist/channel.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import createDebug from "debug";
3
3
  import { clearConnectorClient, clearConversationManager, extractNetworkConfig, getDmScope, initConnectorClient, initConversationManager, initToolConfig, isIdentityLinksConfigured, requirePlatformConfig, requirePluginRuntime, } from "./config.js";
4
- import { ConnectorClient } from "./connector-client.js";
4
+ import { ConnectorClient, ConnectorError, SendOutcomeUnknownError, } from "./connector-client.js";
5
5
  import { ConversationManager } from "./conversation-manager.js";
6
+ import { runWithConversationManagerContext } from "./conversation-manager-context.js";
6
7
  import { clearEnvironmentContext } from "./environment-context.js";
7
8
  import { extractHandleFromAddress } from "./handle-utils.js";
8
9
  import { clearOwnerState, isOwnerAddress, markOwnerAddress, setCurrentTurnIsOwner, setCurrentTurnOwnerSignal, } from "./owner-session-state.js";
@@ -10,7 +11,6 @@ import { ServicesRetainedRecipientConsumer, } from "./services-retained-recipien
10
11
  import { isServicesRetainedReplyContext, runWithServicesRetainedReplyContext, } from "./services-retained-reply-context.js";
11
12
  import { runWithServicesRetainedToolPolicy } from "./services-retained-tool-policy.js";
12
13
  import { createReplyTraceMetadata, ensureTraceMetadata, } from "./trace-metadata.js";
13
- import { setCurrentTurnSender, setCurrentTurnSenderAddress, } from "./turn-context.js";
14
14
  import { checkForUpdate } from "./update-check.js";
15
15
  const dbg = createDebug("agent-network:channel");
16
16
  const SERVICES_RETAINED_INBOX_PEER = "agent-network:services-retained-node-inbox";
@@ -115,34 +115,27 @@ function deriveSenderName(event) {
115
115
  if (visitorName && typeof visitorName === "string") {
116
116
  return visitorName;
117
117
  }
118
- return extractHandleFromAddress(event.from);
118
+ return event.from;
119
119
  }
120
120
  function deriveNodeName(nodeRef, fromAddress) {
121
121
  if (nodeRef.displayName)
122
122
  return nodeRef.displayName;
123
123
  if (nodeRef.handle)
124
124
  return nodeRef.handle;
125
- return extractHandleFromAddress(fromAddress);
125
+ return fromAddress;
126
126
  }
127
- const DEDUP_WINDOW_MS = 60_000;
128
- const recentMessages = new Map();
129
- function isDuplicate(from, content, sentAt) {
130
- if (!sentAt)
131
- return false;
132
- const key = `${from}\0${content}\0${sentAt}`;
133
- const now = Date.now();
134
- const seen = recentMessages.get(key);
135
- if (seen && now - seen < DEDUP_WINDOW_MS) {
136
- return true;
137
- }
138
- recentMessages.set(key, now);
139
- if (recentMessages.size > 200) {
140
- for (const [k, ts] of recentMessages) {
141
- if (now - ts > DEDUP_WINDOW_MS)
142
- recentMessages.delete(k);
143
- }
144
- }
145
- return false;
127
+ function agentReadableAddressedBody(event) {
128
+ const facts = [
129
+ ...(event.messageId === undefined
130
+ ? []
131
+ : [`message_id=${JSON.stringify(event.messageId)}`]),
132
+ ...(event.sentAt === undefined
133
+ ? []
134
+ : [`sent_at=${JSON.stringify(event.sentAt)}`]),
135
+ ];
136
+ if (facts.length === 0)
137
+ return event.content;
138
+ return [`[MASONS message facts: ${facts.join("; ")}]`, event.content].join("\n\n");
146
139
  }
147
140
  async function handleAddressedMessage(event, conversationManager, client, ctx, options = {}) {
148
141
  const fromAddress = event.from;
@@ -155,11 +148,6 @@ async function handleAddressedMessage(event, conversationManager, client, ctx, o
155
148
  console.warn(`[agent-network:channel] invalid traceparent from=${fromAddress} traceId=${inboundTrace.traceId} spanName=receive`);
156
149
  }
157
150
  }
158
- if (options.servicesRetained === undefined &&
159
- isDuplicate(fromAddress, event.content, event.sentAt)) {
160
- dbg("duplicate message suppressed from=%s sentAt=%s", fromAddress, event.sentAt);
161
- return true;
162
- }
163
151
  const inboundCorrelationId = typeof metadata.correlation_id === "string"
164
152
  ? metadata.correlation_id
165
153
  : undefined;
@@ -204,11 +192,10 @@ async function handleAddressedMessage(event, conversationManager, client, ctx, o
204
192
  (nodeRef ? deriveNodeName(nodeRef, fromAddress) : deriveSenderName(event));
205
193
  const replyAddress = options.routableReplyAddress ??
206
194
  (options.servicesRetained ? undefined : fromAddress);
207
- if (replyAddress && !conversationManager.getContactByAddress(replyAddress)) {
195
+ if (replyAddress &&
196
+ !conversationManager.refreshInboundPortrayal(contact, replyAddress)) {
208
197
  conversationManager.registerInbound(contact, replyAddress);
209
198
  }
210
- setCurrentTurnSender(contact);
211
- setCurrentTurnSenderAddress(replyAddress ?? null);
212
199
  let runtime;
213
200
  try {
214
201
  runtime = requirePluginRuntime();
@@ -247,7 +234,9 @@ async function handleAddressedMessage(event, conversationManager, client, ctx, o
247
234
  })
248
235
  : route.sessionKey;
249
236
  const msgCtx = runtime.channel.reply.finalizeInboundContext({
250
- Body: event.content,
237
+ Body: options.servicesRetained === undefined
238
+ ? agentReadableAddressedBody(event)
239
+ : event.content,
251
240
  RawBody: event.content,
252
241
  CommandBody: event.content,
253
242
  From: senderId,
@@ -321,25 +310,39 @@ async function handleAddressedMessage(event, conversationManager, client, ctx, o
321
310
  messageId: inboundMessageId,
322
311
  });
323
312
  const deliverResult = await conversationManager.send(replyAddress, text, replyTrace.metadata);
313
+ dbg("deliver reply senderId=%s status=%s ackStatus=%s contentLength=%d traceId=%s originalTraceId=%s spanName=send", senderId, deliverResult.status, deliverResult.status === "sent"
314
+ ? deliverResult.acknowledgementStatus
315
+ : "(none)", text.length, replyTrace.traceId, replyTrace.originalTraceId ?? "(absent)");
324
316
  if (deliverResult.status === "sent") {
325
317
  replyRouted = true;
326
318
  }
319
+ else if (deliverResult.status === "unknown") {
320
+ throw new SendOutcomeUnknownError(deliverResult.messageId, deliverResult.reason);
321
+ }
327
322
  else {
328
- console.warn(`[agent-network:${ctx.accountId}] reply send FAILED to=${senderId} code=${deliverResult.errorCode ?? "(none)"} error=${deliverResult.error ?? "(none)"}`);
323
+ throw new ConnectorError(deliverResult.error ?? "Agent Network send failed", deliverResult.errorCode ?? "SEND_FAILED", replyAddress);
329
324
  }
330
- dbg("deliver reply senderId=%s status=%s contentLength=%d traceId=%s originalTraceId=%s spanName=send", senderId, deliverResult.status, text.length, replyTrace.traceId, replyTrace.originalTraceId ?? "(absent)");
331
325
  },
332
326
  onError: (err) => {
333
327
  dispatchError = err;
334
- console.error(`[agent-network:${ctx.accountId}] dispatch error:`, err);
328
+ if (err instanceof SendOutcomeUnknownError) {
329
+ console.warn(`[agent-network:${ctx.accountId}] reply send OUTCOME UNKNOWN to=${senderId} messageId=${err.messageId} reason=${err.reason}`);
330
+ }
331
+ else if (err instanceof ConnectorError) {
332
+ console.warn(`[agent-network:${ctx.accountId}] reply send FAILED to=${senderId} code=${err.code} error=${err.message}`);
333
+ }
334
+ else {
335
+ console.error(`[agent-network:${ctx.accountId}] dispatch error:`, err);
336
+ }
335
337
  },
336
338
  },
337
339
  });
340
+ const dispatchInConversationManagerContext = () => runWithConversationManagerContext(conversationManager, dispatch);
338
341
  if (options.servicesRetained) {
339
- await runWithServicesRetainedToolPolicy(runtimeSessionKey, () => runWithServicesRetainedReplyContext(dispatch));
342
+ await runWithServicesRetainedToolPolicy(runtimeSessionKey, () => runWithServicesRetainedReplyContext(dispatchInConversationManagerContext));
340
343
  }
341
344
  else {
342
- await dispatch();
345
+ await dispatchInConversationManagerContext();
343
346
  }
344
347
  if (dispatchError)
345
348
  throw dispatchError;
@@ -383,8 +386,9 @@ function servicesRetainedBody(message) {
383
386
  const sender = servicesRetainedSenderName(message);
384
387
  const displayName = message.envelope.sender.display_name;
385
388
  const handle = message.envelope.sender.handle;
389
+ const sentAt = message.envelope.sent_at;
386
390
  return [
387
- `[MASONS canonical message_ref=${JSON.stringify(message.envelope.message_ref)}; sender_display_name=${displayName === undefined ? "absent" : JSON.stringify(displayName)}; sender_handle=${handle === undefined ? "absent" : JSON.stringify(handle)}; sender_label=${JSON.stringify(sender)}; content_type=${JSON.stringify(message.contentType)}]`,
391
+ `[MASONS canonical message_ref=${JSON.stringify(message.envelope.message_ref)}; sent_at=${sentAt === undefined ? "absent" : JSON.stringify(sentAt)}; sender_display_name=${displayName === undefined ? "absent" : JSON.stringify(displayName)}; sender_handle=${handle === undefined ? "absent" : JSON.stringify(handle)}; sender_label=${JSON.stringify(sender)}; content_type=${JSON.stringify(message.contentType)}]`,
388
392
  message.envelope.content,
389
393
  ].join("\n\n");
390
394
  }
@@ -444,13 +448,19 @@ export const agentNetworkChannel = {
444
448
  }
445
449
  const state = ctx.accountId ? accounts.get(ctx.accountId) : undefined;
446
450
  if (!state)
447
- return { channel: "agent-network", messageId: "" };
451
+ throw new Error("Agent Network account unavailable");
448
452
  const result = await state.conversationManager.send(ctx.to, ctx.text);
449
- dbg("sendText to=%s status=%s contentLength=%d", ctx.to, result.status, ctx.text.length);
450
- return {
451
- channel: "agent-network",
452
- messageId: `an:${randomUUID()}`,
453
- };
453
+ dbg("sendText to=%s status=%s ackStatus=%s contentLength=%d", ctx.to, result.status, result.status === "sent" ? result.acknowledgementStatus : "(none)", ctx.text.length);
454
+ if (result.status === "sent") {
455
+ return { channel: "agent-network", messageId: result.messageId };
456
+ }
457
+ if (result.status === "unknown") {
458
+ throw new SendOutcomeUnknownError(result.messageId, result.reason);
459
+ }
460
+ if (result.errorCode) {
461
+ throw new ConnectorError(result.error ?? result.errorCode, result.errorCode, ctx.to);
462
+ }
463
+ throw new Error(result.error ?? "Agent Network send failed");
454
464
  },
455
465
  },
456
466
  gateway: {
@@ -1 +1 @@
1
- {"version":3,"file":"cli-setup.d.ts","sourceRoot":"","sources":["../src/cli-setup.ts"],"names":[],"mappings":"AA0FA,UAAU,eAAe;IACvB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAOD,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAwFD,wBAAsB,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+EhE"}
1
+ {"version":3,"file":"cli-setup.d.ts","sourceRoot":"","sources":["../src/cli-setup.ts"],"names":[],"mappings":"AA8FA,UAAU,eAAe;IACvB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAOD,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAmFD,wBAAsB,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2EhE"}
package/dist/cli-setup.js CHANGED
@@ -1,13 +1,12 @@
1
- import { readExistingConnectorUrl, writeCredentials } from "./config.js";
1
+ import { readExistingConnectorUrl } from "./config.js";
2
2
  import { ConnectorUrlConfigurationError, resolveConnectorUrlForSetup, } from "./connector-url-boundary.js";
3
3
  import { beginBridgeHandoff, completeBridgeHandoff, DEFAULT_IDP_BASE_URL, SetupFlowError, } from "./handoff.js";
4
- import { assertHandoffDeadlineActive } from "./handoff-deadline.js";
4
+ import { acceptBridgeHandoff } from "./handoff-acceptance.js";
5
5
  import { DEFAULT_API_HOST, DEFAULT_CONNECTOR_URL, PlatformApiError, } from "./platform-client.js";
6
- async function serverBridgeHandoffFlow(apiHost, idpBaseUrl, runtime, channelInput) {
6
+ async function serverBridgeHandoffFlow(apiHost, idpBaseUrl, runtime) {
7
7
  const session = await beginBridgeHandoff({
8
8
  apiHost,
9
9
  idpBaseUrl,
10
- channelInput,
11
10
  });
12
11
  runtime.writeStdout([
13
12
  "",
@@ -29,7 +28,7 @@ export async function login(ctx) {
29
28
  : DEFAULT_IDP_BASE_URL;
30
29
  let completed;
31
30
  try {
32
- completed = await serverBridgeHandoffFlow(apiHost, idpBaseUrl, ctx.runtime, ctx.channelInput);
31
+ completed = await serverBridgeHandoffFlow(apiHost, idpBaseUrl, ctx.runtime);
33
32
  }
34
33
  catch (err) {
35
34
  if (err instanceof SetupFlowError) {
@@ -61,8 +60,15 @@ export async function login(ctx) {
61
60
  }
62
61
  throw err;
63
62
  }
63
+ let receipt;
64
64
  try {
65
- await writeCredentials({ connectorUrl, token: handoff.token }, apiHost, idpBaseUrl, undefined, () => assertHandoffDeadlineActive(completed.expiresAt));
65
+ receipt = await acceptBridgeHandoff({
66
+ handoff,
67
+ apiHost,
68
+ connectorUrl,
69
+ idpBaseUrl,
70
+ expiresAt: completed.expiresAt,
71
+ });
66
72
  }
67
73
  catch (err) {
68
74
  if (err instanceof SetupFlowError) {
@@ -71,5 +77,5 @@ export async function login(ctx) {
71
77
  }
72
78
  throw err;
73
79
  }
74
- ctx.runtime.log(`✓ Connected as @${handoff.agent.handle}`);
80
+ ctx.runtime.log(`✓ ${receipt}`);
75
81
  }
package/dist/config.d.ts CHANGED
@@ -18,9 +18,11 @@ export declare function clearPluginRuntime(): void;
18
18
  export declare function requirePluginRuntime(): unknown;
19
19
  export declare function requirePlatformConfig(): PlatformClientConfig;
20
20
  export declare function requireApiKey(): string;
21
+ export declare function hasApiKey(): boolean;
21
22
  export declare function getPendingTarget(): string | null;
22
23
  export declare function isProfileNeeded(): boolean;
23
24
  export declare function requireConnectorClient(): ConnectorClient;
25
+ export declare function getConnectorClient(): ConnectorClient | null;
24
26
  export interface NetworkCredentials {
25
27
  connectorUrl: string;
26
28
  token: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,s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ACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAQD,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAW5E;AAoBD,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,kBAAkB,EACzB,OAAO,CAAC,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,MAAM,EACtB,gBAAgB,CAAC,EAAE,MAAM,IAAI,GAC5B,OAAO,CAAC,IAAI,CAAC,CA4Cf;AAUD,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrE;AASD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CASvD;AAYD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAOvD;AAUD,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAOzD;AAwCD,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,IAAI,CAAC,CAsBf;AAQD,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B1E;AAOD,MAAM,WAAW,YAAY;IAE3B,cAAc,EAAE,OAAO,CAAC;IAExB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,YAAY,EAAE,OAAO,CAAC;CACvB;AASD,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,CA2BhE;AAOD,wBAAgB,gBAAgB,IAAI,IAAI,CAWvC"}
package/dist/config.js CHANGED
@@ -108,6 +108,9 @@ export function requireApiKey() {
108
108
  }
109
109
  return storedApiKey;
110
110
  }
111
+ export function hasApiKey() {
112
+ return Boolean(storedApiKey);
113
+ }
111
114
  export function getPendingTarget() {
112
115
  return storedPendingTarget;
113
116
  }
@@ -120,6 +123,9 @@ export function requireConnectorClient() {
120
123
  }
121
124
  return storedConnectorClient;
122
125
  }
126
+ export function getConnectorClient() {
127
+ return storedConnectorClient;
128
+ }
123
129
  function ensureNetworkSection(config) {
124
130
  if (typeof config.channels !== "object" || config.channels === null) {
125
131
  config.channels = {};
@@ -155,7 +161,6 @@ export async function writeCredentials(creds, apiHost, idpBaseUrl, pendingTarget
155
161
  };
156
162
  if (apiHost) {
157
163
  section.apiHost = apiHost;
158
- platformConfig = { apiHost };
159
164
  }
160
165
  if (idpBaseUrl) {
161
166
  section.idpBaseUrl = idpBaseUrl;
@@ -165,6 +170,9 @@ export async function writeCredentials(creds, apiHost, idpBaseUrl, pendingTarget
165
170
  }
166
171
  await persistConfig(config, assertCanPersist);
167
172
  storedApiKey = creds.token;
173
+ if (apiHost) {
174
+ platformConfig = { apiHost };
175
+ }
168
176
  if (pendingTarget) {
169
177
  storedPendingTarget = pendingTarget;
170
178
  }
@@ -1,14 +1,24 @@
1
1
  import { EventEmitter } from "node:events";
2
- import { type AddressedMessageEvent, type CustodyPendingEvent, type DeliveryPendingEvent, type DeliveryStatusEvent, type SendAckEvent, type StructuredErrorEvent } from "./types.js";
2
+ import { type AddressedMessageEvent, type CustodyPendingEvent, type DeliveryPendingEvent, type DeliveryStatusEvent, type ObservedSendAckEvent, type StructuredErrorEvent } from "./types.js";
3
+ import { type WsHeartbeatOptions } from "./ws-heartbeat.js";
3
4
  export declare class ConnectorError extends Error {
4
5
  readonly code: string;
5
6
  readonly to?: string;
6
7
  constructor(message: string, code: string, to?: string);
7
8
  }
9
+ export type SendOutcomeUnknownReason = "ack_timeout" | "connection_closed";
10
+ export declare class SendOutcomeUnknownError extends Error {
11
+ readonly code: "SEND_OUTCOME_UNKNOWN";
12
+ readonly retryable: false;
13
+ readonly attempts: 1;
14
+ readonly messageId: string;
15
+ readonly reason: SendOutcomeUnknownReason;
16
+ constructor(messageId: string, reason: SendOutcomeUnknownReason);
17
+ }
8
18
  type ConnectorClientEvents = {
9
19
  message_received: (event: AddressedMessageEvent) => void;
10
20
  custody_pending: (event: CustodyPendingEvent) => void;
11
- send_ack: (event: SendAckEvent) => void;
21
+ send_ack: (event: ObservedSendAckEvent) => void;
12
22
  delivery_pending: (event: DeliveryPendingEvent) => void;
13
23
  delivery_status: (event: DeliveryStatusEvent) => void;
14
24
  structured_error: (event: StructuredErrorEvent) => void;
@@ -16,6 +26,20 @@ type ConnectorClientEvents = {
16
26
  connected: () => void;
17
27
  disconnected: () => void;
18
28
  };
29
+ export interface ConnectorClientOptions {
30
+ keepalive?: Pick<WsHeartbeatOptions, "intervalMs" | "probeTimeoutMs" | "missesBeforeDisconnect">;
31
+ }
32
+ export type ChannelState = "connecting" | "connected" | "reconnecting" | "disconnected";
33
+ export type RegistrationOutcome = {
34
+ state: "accepted";
35
+ } | {
36
+ state: "refused";
37
+ reason: string;
38
+ } | {
39
+ state: "replaced";
40
+ } | {
41
+ state: "none";
42
+ };
19
43
  export declare class ConnectorClient extends EventEmitter {
20
44
  private readonly url;
21
45
  private readonly token;
@@ -24,18 +48,24 @@ export declare class ConnectorClient extends EventEmitter {
24
48
  private backoffMs;
25
49
  private alreadyConnectedRetries;
26
50
  private reconnectTimer;
51
+ private keepalive;
52
+ private readonly keepaliveOptions;
27
53
  private registerResolve;
28
54
  private registerReject;
29
55
  private registerTimer;
56
+ private registration;
57
+ private everDropped;
30
58
  private lastKnownSeq;
31
59
  private readonly pendingSeqMessages;
32
60
  private readonly seenPayloadIds;
33
61
  private readonly seenPayloadIdOrder;
34
62
  private pendingSends;
35
- constructor(url: string, token: string);
63
+ constructor(url: string, token: string, options?: ConnectorClientOptions);
36
64
  connect(): Promise<void>;
37
65
  disconnect(): void;
38
- send(to: string, content: string, contentType?: string, metadata?: Record<string, unknown>): Promise<SendAckEvent>;
66
+ getChannelState(): ChannelState;
67
+ getRegistration(): RegistrationOutcome;
68
+ send(to: string, content: string, contentType?: string, metadata?: Record<string, unknown>): Promise<ObservedSendAckEvent>;
39
69
  sendTyping(to: string, isTyping: boolean): boolean;
40
70
  ackDelivery(upToSeq: number): boolean;
41
71
  requestGapFill(sinceSeq: number): boolean;
@@ -70,6 +100,7 @@ export declare class ConnectorClient extends EventEmitter {
70
100
  private clearReconnectTimer;
71
101
  private cleanupConnection;
72
102
  private sendEvent;
103
+ private sendSerializedEvent;
73
104
  }
74
105
  export {};
75
106
  //# sourceMappingURL=connector-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connector-client.d.ts","sourceRoot":"","sources":["../src/connector-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,OAAO,EAEL,KAAK,qBAAqB,EAI1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EAexB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AA2BpB,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;gBACT,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM;CAMvD;AAID,KAAK,qBAAqB,GAAG;IAC3B,gBAAgB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACzD,eAAe,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACtD,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACtD,gBAAgB,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACxD,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC9B,SAA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