@masons/agent-network 0.6.13 → 0.6.15
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/dist/channel.d.ts.map +1 -1
- package/dist/channel.js +4 -8
- package/dist/connector-client.d.ts +0 -3
- package/dist/connector-client.d.ts.map +1 -1
- package/dist/connector-client.js +3 -61
- package/dist/connector-url-boundary.d.ts +0 -5
- package/dist/connector-url-boundary.d.ts.map +1 -1
- package/dist/connector-url-boundary.js +0 -13
- package/dist/conversation-manager.d.ts +3 -2
- package/dist/conversation-manager.d.ts.map +1 -1
- package/dist/conversation-manager.js +59 -18
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +14 -8
- package/dist/turn-context.d.ts +2 -0
- package/dist/turn-context.d.ts.map +1 -1
- package/dist/turn-context.js +9 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/channel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,kCAAkC,CAAC;AAY1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AA2C9D,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAEvD;AAOD,wBAAgB,2BAA2B,IAAI,OAAO,CAIrD;AAGD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE/D;AAaD,iBAAS,iCAAiC,CACxC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA6BzB;AAED,eAAO,MAAM,4CAA4C,0CACtB,CAAC;AA0dpC,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,mBAAmB,CA4NlE,CAAC"}
|
package/dist/channel.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import createDebug from "debug";
|
|
3
|
-
import { clearConnectorClient, clearConversationManager, extractNetworkConfig, getDmScope, initConnectorClient, initConversationManager, initToolConfig, isIdentityLinksConfigured,
|
|
3
|
+
import { clearConnectorClient, clearConversationManager, extractNetworkConfig, getDmScope, initConnectorClient, initConversationManager, initToolConfig, isIdentityLinksConfigured, requirePluginRuntime, } from "./config.js";
|
|
4
4
|
import { ConnectorClient } from "./connector-client.js";
|
|
5
|
-
import { resolveMstpAuthority } from "./connector-url-boundary.js";
|
|
6
5
|
import { ConversationManager } from "./conversation-manager.js";
|
|
7
6
|
import { clearEnvironmentContext } from "./environment-context.js";
|
|
8
7
|
import { extractHandleFromAddress } from "./handle-utils.js";
|
|
9
8
|
import { clearOwnerState, isOwnerAddress, markOwnerAddress, setCurrentTurnIsOwner, setCurrentTurnOwnerSignal, } from "./owner-session-state.js";
|
|
10
9
|
import { createReplyTraceMetadata, ensureTraceMetadata, } from "./trace-metadata.js";
|
|
11
|
-
import { setCurrentTurnSender } from "./turn-context.js";
|
|
10
|
+
import { setCurrentTurnSender, setCurrentTurnSenderAddress, } from "./turn-context.js";
|
|
12
11
|
import { checkForUpdate } from "./update-check.js";
|
|
13
12
|
const dbg = createDebug("agent-network:channel");
|
|
14
13
|
let notificationAttempted = false;
|
|
@@ -169,6 +168,7 @@ async function handleAddressedMessage(event, conversationManager, client, ctx) {
|
|
|
169
168
|
conversationManager.registerInbound(contact, fromAddress);
|
|
170
169
|
}
|
|
171
170
|
setCurrentTurnSender(conversationManager.getContactByAddress(fromAddress) ?? null);
|
|
171
|
+
setCurrentTurnSenderAddress(fromAddress);
|
|
172
172
|
let runtime;
|
|
173
173
|
try {
|
|
174
174
|
runtime = requirePluginRuntime();
|
|
@@ -353,11 +353,7 @@ export const agentNetworkChannel = {
|
|
|
353
353
|
initToolConfig(ctx.cfg);
|
|
354
354
|
const { connectorUrl, token } = ctx.account;
|
|
355
355
|
const client = new ConnectorClient(connectorUrl, token);
|
|
356
|
-
const
|
|
357
|
-
apiHost: requirePlatformConfig().apiHost,
|
|
358
|
-
connectorUrl,
|
|
359
|
-
});
|
|
360
|
-
const conversationManager = new ConversationManager(client, mstpAuthority);
|
|
356
|
+
const conversationManager = new ConversationManager(client);
|
|
361
357
|
const state = {
|
|
362
358
|
client,
|
|
363
359
|
conversationManager,
|
|
@@ -27,7 +27,6 @@ export declare class ConnectorClient extends EventEmitter {
|
|
|
27
27
|
private registerReject;
|
|
28
28
|
private registerTimer;
|
|
29
29
|
private lastKnownSeq;
|
|
30
|
-
private highestWireSeq;
|
|
31
30
|
private readonly pendingSeqMessages;
|
|
32
31
|
private readonly seenPayloadIds;
|
|
33
32
|
private readonly seenPayloadIdOrder;
|
|
@@ -56,8 +55,6 @@ export declare class ConnectorClient extends EventEmitter {
|
|
|
56
55
|
private dispatchAddressed;
|
|
57
56
|
private handleAddressedMessage;
|
|
58
57
|
private handleDeliverySkip;
|
|
59
|
-
private adoptLedgerDeliveryCursor;
|
|
60
|
-
private adoptDeliveredFloor;
|
|
61
58
|
private acceptContiguous;
|
|
62
59
|
private drainPendingSeqMessagesFrom;
|
|
63
60
|
private rememberPayloadId;
|
|
@@ -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,oBAAoB,EAEzB,KAAK,mBAAmB,EAcxB,KAAK,YAAY,EACjB,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
registerTimer = null;
|
|
38
38
|
lastKnownSeq;
|
|
39
|
-
highestWireSeq = 0;
|
|
40
39
|
pendingSeqMessages = new Map();
|
|
41
40
|
seenPayloadIds = new Set();
|
|
42
41
|
seenPayloadIdOrder = [];
|
|
@@ -127,7 +126,6 @@ export class ConnectorClient extends EventEmitter {
|
|
|
127
126
|
const ws = new WebSocket(this.url, { handshakeTimeout: 10_000 });
|
|
128
127
|
this.ws = ws;
|
|
129
128
|
ws.on("open", () => {
|
|
130
|
-
this.highestWireSeq = 0;
|
|
131
129
|
this.sendRegister();
|
|
132
130
|
this.startRegisterTimeout();
|
|
133
131
|
});
|
|
@@ -214,34 +212,10 @@ export class ConnectorClient extends EventEmitter {
|
|
|
214
212
|
return;
|
|
215
213
|
}
|
|
216
214
|
if (isDeliveryCursor(parsed)) {
|
|
217
|
-
if (parsed.deliveredSeq !== undefined &&
|
|
218
|
-
parsed.deliveredSeq > this.highestWireSeq) {
|
|
219
|
-
this.highestWireSeq = parsed.deliveredSeq;
|
|
220
|
-
}
|
|
221
215
|
const floor = this.lastKnownSeq ?? 0;
|
|
222
|
-
dbg("DELIVERY_CURSOR deliverySeq=%d deliveredSeq=%s local=%d", parsed.deliverySeq, parsed.deliveredSeq ?? "none", floor);
|
|
223
|
-
if (parsed.
|
|
224
|
-
this.
|
|
225
|
-
}
|
|
226
|
-
const reconciledFloor = this.lastKnownSeq ?? 0;
|
|
227
|
-
if (parsed.deliverySeq > reconciledFloor) {
|
|
228
|
-
this.requestGapFill(reconciledFloor);
|
|
229
|
-
}
|
|
230
|
-
else if (parsed.deliveredSeq !== undefined &&
|
|
231
|
-
this.lastKnownSeq !== undefined &&
|
|
232
|
-
parsed.deliveredSeq < this.lastKnownSeq) {
|
|
233
|
-
if (parsed.deliverySeq < this.lastKnownSeq &&
|
|
234
|
-
this.highestWireSeq <= parsed.deliverySeq) {
|
|
235
|
-
const adopted = parsed.deliveredSeq;
|
|
236
|
-
console.warn(`[agent-network] delivery cursor unattainable: local claim ${this.lastKnownSeq} exceeds the ledger's highest reserved seq ${parsed.deliverySeq}; adopting the ledger floor ${adopted}. Messages are being recovered from that point.`);
|
|
237
|
-
this.adoptLedgerDeliveryCursor(adopted);
|
|
238
|
-
if (parsed.deliverySeq > adopted) {
|
|
239
|
-
this.requestGapFill(adopted);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
this.ackDelivery(this.lastKnownSeq);
|
|
244
|
-
}
|
|
216
|
+
dbg("DELIVERY_CURSOR (legacy) deliverySeq=%d deliveredSeq=%s local=%d", parsed.deliverySeq, parsed.deliveredSeq ?? "none", floor);
|
|
217
|
+
if (parsed.deliverySeq > floor) {
|
|
218
|
+
this.requestGapFill(floor);
|
|
245
219
|
}
|
|
246
220
|
return;
|
|
247
221
|
}
|
|
@@ -265,8 +239,6 @@ export class ConnectorClient extends EventEmitter {
|
|
|
265
239
|
this.emit("message_received", message);
|
|
266
240
|
return;
|
|
267
241
|
}
|
|
268
|
-
if (message.seq > this.highestWireSeq)
|
|
269
|
-
this.highestWireSeq = message.seq;
|
|
270
242
|
const floor = this.lastKnownSeq ?? 0;
|
|
271
243
|
if (message.seq <= floor)
|
|
272
244
|
return;
|
|
@@ -278,8 +250,6 @@ export class ConnectorClient extends EventEmitter {
|
|
|
278
250
|
this.acceptContiguous(message);
|
|
279
251
|
}
|
|
280
252
|
handleDeliverySkip(event) {
|
|
281
|
-
if (event.seq > this.highestWireSeq)
|
|
282
|
-
this.highestWireSeq = event.seq;
|
|
283
253
|
const floor = this.lastKnownSeq ?? 0;
|
|
284
254
|
if (event.seq <= floor)
|
|
285
255
|
return;
|
|
@@ -291,28 +261,6 @@ export class ConnectorClient extends EventEmitter {
|
|
|
291
261
|
this.drainPendingSeqMessagesFrom(event.seq + 1);
|
|
292
262
|
this.ackDelivery(this.lastKnownSeq);
|
|
293
263
|
}
|
|
294
|
-
adoptLedgerDeliveryCursor(seq) {
|
|
295
|
-
this.pendingSeqMessages.clear();
|
|
296
|
-
this.seenPayloadIds.clear();
|
|
297
|
-
this.seenPayloadIdOrder.length = 0;
|
|
298
|
-
this.lastKnownSeq = seq;
|
|
299
|
-
}
|
|
300
|
-
adoptDeliveredFloor(seq) {
|
|
301
|
-
if (!Number.isInteger(seq) || seq < 0)
|
|
302
|
-
return;
|
|
303
|
-
const floor = this.lastKnownSeq ?? 0;
|
|
304
|
-
if (seq <= floor)
|
|
305
|
-
return;
|
|
306
|
-
this.lastKnownSeq = seq;
|
|
307
|
-
for (const pendingSeq of [...this.pendingSeqMessages.keys()]) {
|
|
308
|
-
if (pendingSeq <= seq)
|
|
309
|
-
this.pendingSeqMessages.delete(pendingSeq);
|
|
310
|
-
}
|
|
311
|
-
this.drainPendingSeqMessagesFrom(seq + 1);
|
|
312
|
-
if (this.lastKnownSeq > seq) {
|
|
313
|
-
this.ackDelivery(this.lastKnownSeq);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
264
|
acceptContiguous(message) {
|
|
317
265
|
const seq = message.seq;
|
|
318
266
|
if (typeof seq !== "number")
|
|
@@ -367,12 +315,6 @@ export class ConnectorClient extends EventEmitter {
|
|
|
367
315
|
}
|
|
368
316
|
dbg("delivery cursor initialized from register ack: %d", ack.deliverySeq);
|
|
369
317
|
}
|
|
370
|
-
else if (typeof ack.deliverySeq === "number" &&
|
|
371
|
-
this.lastKnownSeq !== undefined &&
|
|
372
|
-
ack.deliverySeq < this.lastKnownSeq) {
|
|
373
|
-
this.ackDelivery(this.lastKnownSeq);
|
|
374
|
-
dbg("delivery cursor re-ack requested: server=%d local=%d", ack.deliverySeq, this.lastKnownSeq);
|
|
375
|
-
}
|
|
376
318
|
this.backoffMs = BACKOFF_INITIAL_MS;
|
|
377
319
|
this.alreadyConnectedRetries = 0;
|
|
378
320
|
this.resolveRegister();
|
|
@@ -9,9 +9,4 @@ export declare function resolveConnectorUrlForSetup(input: {
|
|
|
9
9
|
configuredConnectorUrl?: string;
|
|
10
10
|
defaultConnectorUrl?: string;
|
|
11
11
|
}): string;
|
|
12
|
-
export declare const MASONS_CLOUD_IDENTITY_AUTHORITY_BY_API_HOST: Record<string, string>;
|
|
13
|
-
export declare function resolveMstpAuthority(input: {
|
|
14
|
-
apiHost: string;
|
|
15
|
-
connectorUrl: string;
|
|
16
|
-
}): string;
|
|
17
12
|
//# sourceMappingURL=connector-url-boundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector-url-boundary.d.ts","sourceRoot":"","sources":["../src/connector-url-boundary.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGrE,CAAC;AAEF,eAAO,MAAM,qCAAqC,aAGhD,CAAC;AAEH,qBAAa,8BAA+B,SAAQ,KAAK;IAC9C,IAAI,SAAoC;CAClD;AA+CD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,MAAM,CA4BT
|
|
1
|
+
{"version":3,"file":"connector-url-boundary.d.ts","sourceRoot":"","sources":["../src/connector-url-boundary.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGrE,CAAC;AAEF,eAAO,MAAM,qCAAqC,aAGhD,CAAC;AAEH,qBAAa,8BAA+B,SAAQ,KAAK;IAC9C,IAAI,SAAoC;CAClD;AA+CD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,MAAM,CA4BT"}
|
|
@@ -64,16 +64,3 @@ export function resolveConnectorUrlForSetup(input) {
|
|
|
64
64
|
}
|
|
65
65
|
throw new ConnectorUrlConfigurationError(`connectorUrl is required for self-hosted apiHost "${normalizeHost(input.apiHost)}". Configure the Connector transport URL explicitly; the MASONS preview Connector default is only used for MASONS Cloud accounts.`);
|
|
66
66
|
}
|
|
67
|
-
export const MASONS_CLOUD_IDENTITY_AUTHORITY_BY_API_HOST = {
|
|
68
|
-
"api.masons.ai": "masons.ai",
|
|
69
|
-
"preview-api.masons.ai": "preview.masons.ai",
|
|
70
|
-
};
|
|
71
|
-
export function resolveMstpAuthority(input) {
|
|
72
|
-
const cloudAuthority = MASONS_CLOUD_IDENTITY_AUTHORITY_BY_API_HOST[normalizeHost(input.apiHost)];
|
|
73
|
-
if (cloudAuthority)
|
|
74
|
-
return cloudAuthority;
|
|
75
|
-
const parsed = parseUrl(input.connectorUrl);
|
|
76
|
-
if (parsed)
|
|
77
|
-
return parsed.host;
|
|
78
|
-
return input.connectorUrl.replace(/^wss?:\/\//, "").replace(/\/.*$/, "");
|
|
79
|
-
}
|
|
@@ -28,9 +28,9 @@ export interface InboundEnvelope {
|
|
|
28
28
|
export declare const REPLY_CORRELATION_MAX_AGE_MS: number;
|
|
29
29
|
export declare class ConversationManager {
|
|
30
30
|
private readonly client;
|
|
31
|
-
private readonly mstpAuthority;
|
|
32
31
|
private readonly conversations;
|
|
33
|
-
|
|
32
|
+
private readonly pendingOutreach;
|
|
33
|
+
constructor(client: ConnectorClient);
|
|
34
34
|
send(contact: string, content: string, metadata?: Record<string, unknown>): Promise<SendResult>;
|
|
35
35
|
registerInbound(contact: string, address: string): void;
|
|
36
36
|
recordInboundEnvelope(address: string, envelope: Omit<InboundEnvelope, "receivedAt">): void;
|
|
@@ -40,6 +40,7 @@ export declare class ConversationManager {
|
|
|
40
40
|
endConversation(contact: string): boolean;
|
|
41
41
|
commitEndedConversations(): void;
|
|
42
42
|
resolveAddress(contact: string): string;
|
|
43
|
+
private resolveContactForSend;
|
|
43
44
|
extractHandle(address: string): string;
|
|
44
45
|
private ensureConversationEntry;
|
|
45
46
|
_resetForTesting(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-manager.d.ts","sourceRoot":"","sources":["../src/conversation-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation-manager.d.ts","sourceRoot":"","sources":["../src/conversation-manager.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,uBAAuB,CAAC;AAa7E,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,GAAG,QAAQ,CAAC;IAchC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,GAAG,QAAQ,CAAC;CACjC;AAuBD,MAAM,WAAW,eAAe;IAE9B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AASD,eAAO,MAAM,4BAA4B,QAAc,CAAC;AA0CxD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAGzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAwC;IAiBtE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;gBAEzC,MAAM,EAAE,eAAe;IAsB7B,IAAI,CACR,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,OAAO,CAAC,UAAU,CAAC;IA0HtB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAYvD,qBAAqB,CACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,GAC5C,IAAI;IAmBP,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAkBxD,iBAAiB,IAAI,mBAAmB,EAAE;IAwB1C,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAiBzC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAoCzC,wBAAwB,IAAI,IAAI;IAuChC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAwBvC,OAAO,CAAC,qBAAqB;IAuC7B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAQtC,OAAO,CAAC,uBAAuB;IAiC/B,gBAAgB,IAAI,IAAI;CAGzB"}
|
|
@@ -18,16 +18,30 @@ function formatErrorMessage(code, to) {
|
|
|
18
18
|
function normalizeHandleContact(contact) {
|
|
19
19
|
return contact.startsWith("@") ? contact.slice(1) : contact;
|
|
20
20
|
}
|
|
21
|
+
function isRoutableAddress(value) {
|
|
22
|
+
return (value.startsWith("mstps://") ||
|
|
23
|
+
value.startsWith("mstp://") ||
|
|
24
|
+
value.startsWith("passport:"));
|
|
25
|
+
}
|
|
21
26
|
export class ConversationManager {
|
|
22
27
|
client;
|
|
23
|
-
mstpAuthority;
|
|
24
28
|
conversations = new Map();
|
|
25
|
-
|
|
29
|
+
pendingOutreach = new Set();
|
|
30
|
+
constructor(client) {
|
|
26
31
|
this.client = client;
|
|
27
|
-
this.mstpAuthority = mstpAuthority;
|
|
28
32
|
}
|
|
29
33
|
async send(contact, content, metadata) {
|
|
30
|
-
const
|
|
34
|
+
const resolution = this.resolveContactForSend(contact);
|
|
35
|
+
if (resolution.ambiguous) {
|
|
36
|
+
const message = `'${contact}' matches more than one of your connections. Use the full address from masons_list_connections instead of the bare handle.`;
|
|
37
|
+
dbg("send refused: ambiguous contact=%s", contact);
|
|
38
|
+
return {
|
|
39
|
+
status: "failed",
|
|
40
|
+
error: message,
|
|
41
|
+
errorCode: "AMBIGUOUS_CONTACT",
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const address = resolution.address;
|
|
31
45
|
let wireMetadata;
|
|
32
46
|
let sendTraceId;
|
|
33
47
|
let envelope = metadata === undefined
|
|
@@ -60,7 +74,12 @@ export class ConversationManager {
|
|
|
60
74
|
}
|
|
61
75
|
try {
|
|
62
76
|
const ack = await this.client.send(address, content, "text", wireMetadata);
|
|
63
|
-
|
|
77
|
+
if (isRoutableAddress(address)) {
|
|
78
|
+
this.ensureConversationEntry(this.extractHandle(address), address, "local");
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.pendingOutreach.add(address.toLowerCase());
|
|
82
|
+
}
|
|
64
83
|
dbg("send contact=%s address=%s status=%s traceId=%s spanName=send", contact, address, ack.status, sendTraceId);
|
|
65
84
|
return { status: "sent" };
|
|
66
85
|
}
|
|
@@ -116,7 +135,12 @@ export class ConversationManager {
|
|
|
116
135
|
return this.conversations.has(address);
|
|
117
136
|
}
|
|
118
137
|
endConversation(contact) {
|
|
119
|
-
const
|
|
138
|
+
const resolution = this.resolveContactForSend(contact);
|
|
139
|
+
if (resolution.ambiguous) {
|
|
140
|
+
dbg("endConversation refused: ambiguous contact=%s", contact);
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
const address = resolution.address;
|
|
120
144
|
const entry = this.conversations.get(address);
|
|
121
145
|
if (entry && !entry.ended) {
|
|
122
146
|
entry.ended = true;
|
|
@@ -139,32 +163,49 @@ export class ConversationManager {
|
|
|
139
163
|
}
|
|
140
164
|
}
|
|
141
165
|
resolveAddress(contact) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (contact
|
|
146
|
-
return contact;
|
|
166
|
+
return this.resolveContactForSend(contact).address;
|
|
167
|
+
}
|
|
168
|
+
resolveContactForSend(contact) {
|
|
169
|
+
if (isRoutableAddress(contact)) {
|
|
170
|
+
return { address: contact, ambiguous: false };
|
|
147
171
|
}
|
|
148
172
|
const normalizedContact = normalizeHandleContact(contact);
|
|
149
173
|
if (this.conversations.has(normalizedContact)) {
|
|
150
|
-
return normalizedContact;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
174
|
+
return { address: normalizedContact, ambiguous: false };
|
|
175
|
+
}
|
|
176
|
+
let first;
|
|
177
|
+
let ambiguous = false;
|
|
178
|
+
for (const addr of this.conversations.keys()) {
|
|
179
|
+
if (extractHandleFromAddress(addr).toLowerCase() !==
|
|
180
|
+
normalizedContact.toLowerCase()) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (first === undefined) {
|
|
184
|
+
first = addr;
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
ambiguous = true;
|
|
188
|
+
break;
|
|
155
189
|
}
|
|
156
|
-
|
|
190
|
+
if (first !== undefined)
|
|
191
|
+
return { address: first, ambiguous };
|
|
192
|
+
return { address: normalizedContact, ambiguous: false };
|
|
157
193
|
}
|
|
158
194
|
extractHandle(address) {
|
|
159
195
|
return extractHandleFromAddress(address);
|
|
160
196
|
}
|
|
161
197
|
ensureConversationEntry(contact, address, initiatedBy) {
|
|
162
198
|
if (!this.conversations.has(address)) {
|
|
199
|
+
const outreachKey = extractHandleFromAddress(address).toLowerCase();
|
|
200
|
+
let origin = initiatedBy;
|
|
201
|
+
if (origin === "remote" && this.pendingOutreach.delete(outreachKey)) {
|
|
202
|
+
origin = "local";
|
|
203
|
+
}
|
|
163
204
|
this.conversations.set(address, {
|
|
164
205
|
contact,
|
|
165
206
|
address,
|
|
166
207
|
lastMessageAt: Date.now(),
|
|
167
|
-
initiatedBy,
|
|
208
|
+
initiatedBy: origin,
|
|
168
209
|
});
|
|
169
210
|
}
|
|
170
211
|
else {
|
package/dist/plugin.d.ts
CHANGED
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAqFA,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAC/B,MAAM,GAAG,SAAS,CA6EpB;AAKD,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,YAAY,CACV,IAAI,EAAE,OAAO,EACb,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,IAAI,CAAC;IACR,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,IAAI,CAAC;CACnE;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAaI,iBAAiB;CAqYhC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -7,7 +7,7 @@ import { ownerNotesQueue } from "./owner-notes.js";
|
|
|
7
7
|
import { consumeCurrentTurnIsOwner, consumeCurrentTurnOwnerSignal, } from "./owner-session-state.js";
|
|
8
8
|
import { sentMessageBuffer } from "./sent-message-buffer.js";
|
|
9
9
|
import { registerTools } from "./tools.js";
|
|
10
|
-
import { consumeCurrentTurnSender, setCurrentTurnChannelId, setCurrentTurnIsOwnerForTools, setCurrentTurnOwnerSignalForTools, } from "./turn-context.js";
|
|
10
|
+
import { consumeCurrentTurnSender, consumeCurrentTurnSenderAddress, setCurrentTurnChannelId, setCurrentTurnIsOwnerForTools, setCurrentTurnOwnerSignalForTools, } from "./turn-context.js";
|
|
11
11
|
import { getUpdateInfo } from "./update-check.js";
|
|
12
12
|
import { PLUGIN_VERSION } from "./version.js";
|
|
13
13
|
function formatTimeAgo(timestamp) {
|
|
@@ -38,7 +38,7 @@ function drainAndFormatNotes(reportInstruction) {
|
|
|
38
38
|
reportInstruction);
|
|
39
39
|
}
|
|
40
40
|
const MAX_INTERACTIONS = 5;
|
|
41
|
-
function buildInteractionContext(channelId, turnSender) {
|
|
41
|
+
export function buildInteractionContext(channelId, turnSender, turnSenderAddress) {
|
|
42
42
|
const cm = getConversationManager();
|
|
43
43
|
if (!cm)
|
|
44
44
|
return undefined;
|
|
@@ -53,19 +53,24 @@ function buildInteractionContext(channelId, turnSender) {
|
|
|
53
53
|
? `[Active interactions (showing ${sorted.length} of ${conversations.length})]`
|
|
54
54
|
: "[Active interactions]";
|
|
55
55
|
const lines = sorted.map((c) => {
|
|
56
|
-
const who =
|
|
56
|
+
const who = c.contact === c.address ? c.address : `${c.contact} (${c.address})`;
|
|
57
57
|
const initiated = c.initiatedBy === "local" ? "you initiated" : "they initiated";
|
|
58
58
|
const when = formatTimeAgo(c.lastMessageAt);
|
|
59
59
|
return `• ${who} — ${initiated} — last activity ${when}`;
|
|
60
60
|
});
|
|
61
61
|
const isNetworkTurn = channelId === "agent-network";
|
|
62
62
|
if (isNetworkTurn && turnSender) {
|
|
63
|
-
const senderConvo =
|
|
63
|
+
const senderConvo = turnSenderAddress
|
|
64
|
+
? conversations.find((c) => c.address === turnSenderAddress)
|
|
65
|
+
: undefined;
|
|
64
66
|
const initiated = senderConvo?.initiatedBy === "local"
|
|
65
67
|
? "You initiated this interaction."
|
|
66
68
|
: "They initiated this interaction.";
|
|
69
|
+
const from = turnSenderAddress && turnSenderAddress !== turnSender
|
|
70
|
+
? `${turnSender} (${turnSenderAddress})`
|
|
71
|
+
: turnSender;
|
|
67
72
|
return (`${header}\n${lines.join("\n")}\n` +
|
|
68
|
-
`[This turn] From
|
|
73
|
+
`[This turn] From ${from}. ${initiated}\n` +
|
|
69
74
|
"Your text reply goes to this sender. " +
|
|
70
75
|
"To report to your owner: masons_note_for_owner.");
|
|
71
76
|
}
|
|
@@ -137,6 +142,7 @@ const plugin = {
|
|
|
137
142
|
const turnIsOwner = consumeCurrentTurnIsOwner();
|
|
138
143
|
const turnOwnerSignal = consumeCurrentTurnOwnerSignal();
|
|
139
144
|
const turnSender = consumeCurrentTurnSender();
|
|
145
|
+
const turnSenderAddress = consumeCurrentTurnSenderAddress();
|
|
140
146
|
setCurrentTurnChannelId(channelId ?? null);
|
|
141
147
|
setCurrentTurnIsOwnerForTools(turnIsOwner);
|
|
142
148
|
setCurrentTurnOwnerSignalForTools(turnOwnerSignal);
|
|
@@ -207,7 +213,7 @@ const plugin = {
|
|
|
207
213
|
"on the agent network. Your text reply will be sent to that sender — " +
|
|
208
214
|
"your owner (Principal) will NOT see it. To report something to your owner, " +
|
|
209
215
|
"call masons_note_for_owner.";
|
|
210
|
-
const interactionCtx = buildInteractionContext(channelId, turnSender);
|
|
216
|
+
const interactionCtx = buildInteractionContext(channelId, turnSender, turnSenderAddress);
|
|
211
217
|
if (interactionCtx) {
|
|
212
218
|
dynamicContext += `\n\n${interactionCtx}`;
|
|
213
219
|
}
|
|
@@ -221,7 +227,7 @@ const plugin = {
|
|
|
221
227
|
return `• (${formatTimeAgo(m.timestamp)}): "${preview}"`;
|
|
222
228
|
});
|
|
223
229
|
dynamicContext +=
|
|
224
|
-
`\n\n[Your recent messages to
|
|
230
|
+
`\n\n[Your recent messages to ${turnSender}]\n` +
|
|
225
231
|
lines.join("\n");
|
|
226
232
|
}
|
|
227
233
|
}
|
|
@@ -242,7 +248,7 @@ const plugin = {
|
|
|
242
248
|
? `${dynamicContext}\n\n${nudge}`
|
|
243
249
|
: nudge;
|
|
244
250
|
}
|
|
245
|
-
const interactionCtx = buildInteractionContext(channelId, null);
|
|
251
|
+
const interactionCtx = buildInteractionContext(channelId, null, null);
|
|
246
252
|
if (interactionCtx) {
|
|
247
253
|
dynamicContext = dynamicContext
|
|
248
254
|
? `${dynamicContext}\n\n${interactionCtx}`
|
package/dist/turn-context.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { OwnerSignal } from "./owner-session-state.js";
|
|
2
2
|
export declare function setCurrentTurnSender(contact: string | null): void;
|
|
3
|
+
export declare function setCurrentTurnSenderAddress(address: string | null): void;
|
|
3
4
|
export declare function setCurrentTurnChannelId(channelId: string | null): void;
|
|
4
5
|
export declare function setCurrentTurnIsOwnerForTools(value: boolean): void;
|
|
5
6
|
export declare function setCurrentTurnOwnerSignalForTools(signal: OwnerSignal): void;
|
|
6
7
|
export declare function consumeCurrentTurnSender(): string | null;
|
|
8
|
+
export declare function consumeCurrentTurnSenderAddress(): string | null;
|
|
7
9
|
export declare function getCurrentTurnChannelId(): string | null;
|
|
8
10
|
export declare function getCurrentTurnIsOwnerNonConsuming(): boolean;
|
|
9
11
|
export declare function getCurrentTurnOwnerSignal(): OwnerSignal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-context.d.ts","sourceRoot":"","sources":["../src/turn-context.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"turn-context.d.ts","sourceRoot":"","sources":["../src/turn-context.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAyC5D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAEjE;AAUD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAExE;AAOD,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAEtE;AAOD,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAElE;AAUD,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAE3E;AAUD,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,IAAI,CAIxD;AAGD,wBAAgB,+BAA+B,IAAI,MAAM,GAAG,IAAI,CAI/D;AAMD,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAEvD;AAMD,wBAAgB,iCAAiC,IAAI,OAAO,CAE3D;AAOD,wBAAgB,yBAAyB,IAAI,WAAW,CAEvD"}
|
package/dist/turn-context.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
let currentTurnSender = null;
|
|
2
|
+
let currentTurnSenderAddress = null;
|
|
2
3
|
let currentTurnChannelId = null;
|
|
3
4
|
let currentTurnIsOwner = false;
|
|
4
5
|
let currentTurnOwnerSignalForTools = null;
|
|
5
6
|
export function setCurrentTurnSender(contact) {
|
|
6
7
|
currentTurnSender = contact;
|
|
7
8
|
}
|
|
9
|
+
export function setCurrentTurnSenderAddress(address) {
|
|
10
|
+
currentTurnSenderAddress = address;
|
|
11
|
+
}
|
|
8
12
|
export function setCurrentTurnChannelId(channelId) {
|
|
9
13
|
currentTurnChannelId = channelId;
|
|
10
14
|
}
|
|
@@ -19,6 +23,11 @@ export function consumeCurrentTurnSender() {
|
|
|
19
23
|
currentTurnSender = null;
|
|
20
24
|
return value;
|
|
21
25
|
}
|
|
26
|
+
export function consumeCurrentTurnSenderAddress() {
|
|
27
|
+
const value = currentTurnSenderAddress;
|
|
28
|
+
currentTurnSenderAddress = null;
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
22
31
|
export function getCurrentTurnChannelId() {
|
|
23
32
|
return currentTurnChannelId;
|
|
24
33
|
}
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAQ1C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAGD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,QAAQ,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;CACnB;AAGD,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,cAAc,CAAC;IAEtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,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sBAAsB,GAC9B,gBAAgB,GAChB,YAAY,GACZ,qBAAqB,GACrB,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,CAAC;AAoBzB,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,gBAAgB,CAErE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,YAAY,CAM7D;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,qBAAqB,CAS/B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,oBAAoB,CAO7E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,mBAAmB,CAO3E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,mBAAmB,CAa3E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,iBAAiB,CAYvE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,oBAAoB,CAO7E"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PLUGIN_VERSION = "0.6.
|
|
1
|
+
export declare const PLUGIN_VERSION = "0.6.15";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PLUGIN_VERSION = "0.6.
|
|
1
|
+
export const PLUGIN_VERSION = "0.6.15";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masons/agent-network",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"description": "MASONS Agent Network — OpenClaw channel plugin for connecting agent runtimes to the Agent Network over MSTP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MASONS.ai <hello@masons.ai> (https://masons.ai)",
|