@masons/agent-network 0.4.22 → 0.4.23
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/plugin.d.ts.map +1 -1
- package/dist/plugin.js +10 -16
- package/dist/sent-message-buffer.d.ts +1 -1
- package/dist/sent-message-buffer.d.ts.map +1 -1
- package/dist/sent-message-buffer.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +11 -10
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AA0HA,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,IAAI,CAAC;CACnE;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;kBA4BI,iBAAiB;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AA0HA,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,IAAI,CAAC;CACnE;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;kBA4BI,iBAAiB;CAuVhC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -281,26 +281,20 @@ const plugin = {
|
|
|
281
281
|
if (turnIsOwner) {
|
|
282
282
|
// Owner visiting via Passport — no routing warning needed.
|
|
283
283
|
// The LLM's text reply goes to the owner (the visitor IS the owner).
|
|
284
|
-
//
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
const timeStr = formatTimeAgo(n.timestamp);
|
|
292
|
-
return `• ${fromStr} (${timeStr}): "${n.content}"`;
|
|
293
|
-
})
|
|
294
|
-
.join("\n")
|
|
295
|
-
: "";
|
|
284
|
+
//
|
|
285
|
+
// DO NOT drain ownerNotesQueue here (#986). Notes are meant for
|
|
286
|
+
// non-Passport channels (Telegram/Feishu) where the owner can act
|
|
287
|
+
// on them — e.g., identity linking notifications require the owner
|
|
288
|
+
// to provide their Telegram ID, which only makes sense on Telegram.
|
|
289
|
+
// Draining here would consume notifications on the same turn that
|
|
290
|
+
// generated them, leaving nothing for the target channel.
|
|
296
291
|
dynamicContext =
|
|
297
292
|
"[Agent Network — Owner via Passport] Your owner (Principal) is talking to you " +
|
|
298
293
|
"via Passport (your public web chat page where visitors can reach you). " +
|
|
299
294
|
"This IS your owner — respond naturally, no need to ask who they are. " +
|
|
300
295
|
"Your text reply goes directly to your owner. " +
|
|
301
296
|
"You can share information freely — no information boundary applies. " +
|
|
302
|
-
"Do NOT use masons_note_for_owner — your owner is right here."
|
|
303
|
-
notesBlock;
|
|
297
|
+
"Do NOT use masons_note_for_owner — your owner is right here.";
|
|
304
298
|
}
|
|
305
299
|
else {
|
|
306
300
|
// Turn triggered by a remote agent/stranger — routing warning +
|
|
@@ -323,8 +317,8 @@ const plugin = {
|
|
|
323
317
|
const sentMsgs = sentMessageBuffer.getRecent(turnSender);
|
|
324
318
|
if (sentMsgs.length > 0) {
|
|
325
319
|
const lines = sentMsgs.map((m) => {
|
|
326
|
-
const preview = m.content.length >
|
|
327
|
-
? `${m.content.slice(0,
|
|
320
|
+
const preview = m.content.length > 500
|
|
321
|
+
? `${m.content.slice(0, 500)}...`
|
|
328
322
|
: m.content;
|
|
329
323
|
return `• (${formatTimeAgo(m.timestamp)}): "${preview}"`;
|
|
330
324
|
});
|
|
@@ -29,7 +29,7 @@ export declare class SentMessageBuffer {
|
|
|
29
29
|
/** Messages older than this are evicted. */
|
|
30
30
|
static readonly TTL_MS: number;
|
|
31
31
|
/** Max content length stored per message. Longer content is truncated at record time. */
|
|
32
|
-
static readonly MAX_CONTENT_LENGTH =
|
|
32
|
+
static readonly MAX_CONTENT_LENGTH = 1000;
|
|
33
33
|
/**
|
|
34
34
|
* Record an outgoing message to a contact.
|
|
35
35
|
* Called by `masons_send_message` after successful send.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sent-message-buffer.d.ts","sourceRoot":"","sources":["../src/sent-message-buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAoC;IAEnD,yCAAyC;IACzC,MAAM,CAAC,QAAQ,CAAC,eAAe,KAAK;IACpC,4CAA4C;IAC5C,MAAM,CAAC,QAAQ,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"sent-message-buffer.d.ts","sourceRoot":"","sources":["../src/sent-message-buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAoC;IAEnD,yCAAyC;IACzC,MAAM,CAAC,QAAQ,CAAC,eAAe,KAAK;IACpC,4CAA4C;IAC5C,MAAM,CAAC,QAAQ,CAAC,MAAM,SAAsB;IAC5C,yFAAyF;IACzF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,QAAQ;IAE1C;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IA2B9C;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE;IAoBzC;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd;AAMD,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -24,9 +24,9 @@ export class SentMessageBuffer {
|
|
|
24
24
|
/** Max messages retained per contact. */
|
|
25
25
|
static MAX_PER_CONTACT = 5;
|
|
26
26
|
/** Messages older than this are evicted. */
|
|
27
|
-
static TTL_MS =
|
|
27
|
+
static TTL_MS = 2 * 60 * 60 * 1000; // 2 hours
|
|
28
28
|
/** Max content length stored per message. Longer content is truncated at record time. */
|
|
29
|
-
static MAX_CONTENT_LENGTH =
|
|
29
|
+
static MAX_CONTENT_LENGTH = 1000;
|
|
30
30
|
/**
|
|
31
31
|
* Record an outgoing message to a contact.
|
|
32
32
|
* Called by `masons_send_message` after successful send.
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Plugin version — must match package.json. Validated by prepublishOnly. */
|
|
2
|
-
export const PLUGIN_VERSION = "0.4.
|
|
2
|
+
export const PLUGIN_VERSION = "0.4.23";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masons/agent-network",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.23",
|
|
4
4
|
"description": "MASONS plugin for OpenClaw — connect your agent to the agent network",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MASONS.ai <hello@masons.ai> (https://masons.ai)",
|
|
@@ -19,6 +19,15 @@
|
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"dev": "tsc --watch",
|
|
25
|
+
"test": "tsc -p test/tsconfig.json && node --test --loader ts-node/esm test/**/*.test.ts",
|
|
26
|
+
"lint": "biome check",
|
|
27
|
+
"format": "biome format --write",
|
|
28
|
+
"prepublishOnly": "bash scripts/check-version.sh && npm run build && npm run test",
|
|
29
|
+
"release": "pnpm publish --access public"
|
|
30
|
+
},
|
|
22
31
|
"files": [
|
|
23
32
|
"dist/",
|
|
24
33
|
"openclaw.plugin.json",
|
|
@@ -68,13 +77,5 @@
|
|
|
68
77
|
"@types/ws": "^8",
|
|
69
78
|
"ts-node": "^10",
|
|
70
79
|
"typescript": "^5"
|
|
71
|
-
},
|
|
72
|
-
"scripts": {
|
|
73
|
-
"build": "tsc",
|
|
74
|
-
"dev": "tsc --watch",
|
|
75
|
-
"test": "tsc -p test/tsconfig.json && node --test --loader ts-node/esm test/**/*.test.ts",
|
|
76
|
-
"lint": "biome check",
|
|
77
|
-
"format": "biome format --write",
|
|
78
|
-
"release": "pnpm publish --access public"
|
|
79
80
|
}
|
|
80
|
-
}
|
|
81
|
+
}
|