@cotal-ai/connector-core 0.166.2 → 0.167.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/dist/agent.d.ts +5 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +22 -5
- package/dist/agent.js.map +1 -1
- package/dist/docs-bundle.bin +0 -0
- package/dist/docs-bundle.generated.d.ts +1 -1
- package/dist/docs-bundle.generated.js +6 -6
- package/dist/docs-index.bin +0 -0
- package/dist/framing.d.ts +17 -4
- package/dist/framing.d.ts.map +1 -1
- package/dist/framing.js +50 -14
- package/dist/framing.js.map +1 -1
- package/dist/tool-specs.d.ts +7 -3
- package/dist/tool-specs.d.ts.map +1 -1
- package/dist/tool-specs.js +17 -8
- package/dist/tool-specs.js.map +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +3 -3
package/dist/docs-bundle.bin
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DocsBundle, DocsMetadata } from "./docs.js";
|
|
2
2
|
/** The installed Cotal version, for stamping the orientation card and other surfaces. */
|
|
3
|
-
export declare const DOCS_VERSION = "0.
|
|
3
|
+
export declare const DOCS_VERSION = "0.167.0";
|
|
4
4
|
export declare function loadDocsMetadata(): DocsMetadata;
|
|
5
5
|
/** Validate the coupled corpus before the index uses its UTF-16 source bounds. No body is decoded. */
|
|
6
6
|
export declare function loadDocsSourceLengths(): number[];
|
|
@@ -3,10 +3,10 @@ import { readFileSync } from "node:fs";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { gunzipSync } from "node:zlib";
|
|
5
5
|
/** The installed Cotal version, for stamping the orientation card and other surfaces. */
|
|
6
|
-
export const DOCS_VERSION = "0.
|
|
6
|
+
export const DOCS_VERSION = "0.167.0";
|
|
7
7
|
export function loadDocsMetadata() {
|
|
8
8
|
return {
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.167.0",
|
|
10
10
|
"pages": [
|
|
11
11
|
{
|
|
12
12
|
"slug": "what-is-cotal",
|
|
@@ -810,12 +810,12 @@ function corpusData() {
|
|
|
810
810
|
if (corpusPacked)
|
|
811
811
|
return corpusPacked;
|
|
812
812
|
const packed = readFileSync(join(import.meta.dirname, "docs-bundle.bin"));
|
|
813
|
-
if (packed.length !==
|
|
813
|
+
if (packed.length !== 1305262 || createHash("sha256").update(packed).digest("hex") !== "81216ab0e8939bfcde17f989a678923d952658ecfe4b07939d7a8942e0e6226b")
|
|
814
814
|
throw new Error("docs data file docs-bundle.bin beside this module is not the one built with it");
|
|
815
815
|
return (corpusPacked = packed);
|
|
816
816
|
}
|
|
817
|
-
const sourceBounds = [[0, 2205], [2205, 4000], [4000,
|
|
818
|
-
const sourceLengths = [4844, 4048,
|
|
817
|
+
const sourceBounds = [[0, 2205], [2205, 4000], [4000, 9448], [9448, 32141], [32141, 36665], [36665, 41046], [41046, 44774], [44774, 51735], [51735, 55839], [55839, 65636], [65636, 69788], [69788, 74306], [74306, 76624], [76624, 80635], [80635, 114693], [114693, 131018], [131018, 146894], [146894, 165300], [165300, 183316], [183316, 198770], [198770, 214898], [214898, 241247], [241247, 246977], [246977, 258218], [258218, 279440], [279440, 284339], [284339, 324372], [324372, 334327], [334327, 366197], [366197, 383869], [383869, 408646], [408646, 440219], [440219, 454803], [454803, 456757], [456757, 465969], [465969, 483169], [483169, 491279], [491279, 495242], [495242, 498623], [498623, 501926], [501926, 503431], [503431, 505701], [505701, 508549], [508549, 514857], [514857, 516786], [516786, 520490], [520490, 533181], [533181, 542483], [542483, 546197], [546197, 553700], [553700, 558832], [558832, 561836], [561836, 572543], [572543, 575520], [575520, 584240], [584240, 587230], [587230, 593812], [593812, 608521], [608521, 621545], [621545, 629195], [629195, 637003], [637003, 640352], [640352, 643301], [643301, 650858], [650858, 654574], [654574, 656784], [656784, 660246], [660246, 663663], [663663, 664777], [664777, 666526], [666526, 670189], [670189, 674970], [674970, 681655], [681655, 692165], [692165, 705481], [705481, 707896], [707896, 721516], [721516, 726903], [726903, 730978], [730978, 733487], [733487, 738529], [738529, 752775], [752775, 759637], [759637, 767022], [767022, 767839], [767839, 772690], [772690, 778783], [778783, 782465], [782465, 786706], [786706, 791877], [791877, 797458], [797458, 800880], [800880, 804471], [804471, 809636], [809636, 813279], [813279, 827424], [827424, 830242], [830242, 832925], [832925, 835592], [835592, 838137], [838137, 842157], [842157, 847221], [847221, 860327], [860327, 869097], [869097, 941781], [941781, 945044], [945044, 946392], [946392, 953742], [953742, 962840], [962840, 973826], [973826, 982637], [982637, 987820], [987820, 1260330], [1260330, 1299833], [1299833, 1305262]];
|
|
818
|
+
const sourceLengths = [4844, 4048, 13684, 90847, 12579, 10741, 38583, 18323, 9941, 85121, 37758, 11019, 5187, 9872, 93167, 44024, 44669, 52286, 49947, 44786, 44176, 75078, 14399, 30108, 61356, 11146, 118922, 27646, 96319, 50005, 74336, 97515, 40178, 8265, 23081, 46298, 22003, 9719, 8035, 7790, 3119, 5184, 6543, 16257, 4626, 8812, 33859, 23342, 9247, 48175, 12971, 7373, 28193, 7140, 22854, 6860, 16771, 39073, 34694, 19825, 19214, 8355, 7031, 19589, 8312, 5100, 8160, 9930, 2248, 5412, 9845, 11500, 16240, 26828, 34218, 5715, 37119, 12378, 9983, 8201, 13306, 98213, 17095, 18280, 1638, 11243, 15872, 8719, 10286, 12927, 14071, 7511, 9014, 12695, 8527, 38003, 6519, 6405, 6095, 6186, 9711, 12679, 37708, 22867, 213977, 7380, 2878, 18052, 23391, 28519, 21160, 12616, 791329, 111760, 22518];
|
|
819
819
|
const decodedBodies = [];
|
|
820
820
|
/** Validate the coupled corpus before the index uses its UTF-16 source bounds. No body is decoded. */
|
|
821
821
|
export function loadDocsSourceLengths() {
|
|
@@ -848,7 +848,7 @@ export function loadDocsBundle() {
|
|
|
848
848
|
/** The compact search index of that bundle: the sibling file docs-index.bin, read, checked and unzipped on the first search. */
|
|
849
849
|
export function loadDocsIndex() {
|
|
850
850
|
const packed = readFileSync(join(import.meta.dirname, "docs-index.bin"));
|
|
851
|
-
if (packed.length !==
|
|
851
|
+
if (packed.length !== 663023 || createHash("sha256").update(packed).digest("hex") !== "76fda5d6e89639091fccf3d0562fbcd86fd22bd69db8610e8d11855f8c27eb2b")
|
|
852
852
|
throw new Error("docs data file docs-index.bin beside this module is not the one built with it");
|
|
853
853
|
return gunzipSync(packed);
|
|
854
854
|
}
|
package/dist/docs-index.bin
CHANGED
|
Binary file
|
package/dist/framing.d.ts
CHANGED
|
@@ -3,7 +3,11 @@ export interface RenderedInboxPreview {
|
|
|
3
3
|
unread: number;
|
|
4
4
|
rows: string[];
|
|
5
5
|
}
|
|
6
|
-
/** Render a non-consuming inbox snapshot with the same provenance convention as `cotal_inbox`.
|
|
6
|
+
/** Render a non-consuming inbox snapshot with the same provenance convention as `cotal_inbox`.
|
|
7
|
+
* Each row's attribution, the sender's unverified marker included, is whole inside the row: the
|
|
8
|
+
* channel or role label is capped and the sender label gets the room the row has left, so only
|
|
9
|
+
* the body is cut. The bound is at least {@link MIN_PREVIEW_ROW} code points, which holds the
|
|
10
|
+
* longest attribution these caps allow. */
|
|
7
11
|
export declare function renderInboxPreview(snapshot: InboxSnapshot, maxRowCodePoints?: number): RenderedInboxPreview;
|
|
8
12
|
/**
|
|
9
13
|
* A PEER NAMES ITSELF, so its name is data and never framing.
|
|
@@ -22,9 +26,18 @@ export declare function renderInboxPreview(snapshot: InboxSnapshot, maxRowCodePo
|
|
|
22
26
|
* line breaks, and the two surfaces cannot drift into different scrub classes again.
|
|
23
27
|
*/
|
|
24
28
|
export declare function attributionSafe(s: string): string;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
/** The smallest bound {@link fmtFrom} accepts: the longer marker after one code point and `…`. */
|
|
30
|
+
export declare const FROM_MIN_CODE_POINTS: number;
|
|
31
|
+
/** A message's sender, by the label every other surface prints for that peer, marked as the
|
|
32
|
+
* sender's own claim. A sender writes its name and role into its payload and its presence row
|
|
33
|
+
* alike, so neither is bound to one principal; the `sender_id` a delivery frame prints is. A blank
|
|
34
|
+
* name is not a name: the frame uses the sender's id, and a role still follows it, marked as an
|
|
35
|
+
* unverified role so the id is never called a name.
|
|
36
|
+
*
|
|
37
|
+
* The result is at most `maxCodePoints` code points. A longer label is cut, ending in `…`, and the
|
|
38
|
+
* marker always follows it whole, so a caller that bounds the line it prints keeps the marker. A
|
|
39
|
+
* bound below {@link FROM_MIN_CODE_POINTS} cannot hold a marker and is refused. */
|
|
40
|
+
export declare function fmtFrom(i: InboxItem, maxCodePoints?: number): string;
|
|
28
41
|
/**
|
|
29
42
|
* A message body, indented so no line of it can reach column zero.
|
|
30
43
|
*
|
package/dist/framing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../src/framing.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAoBD
|
|
1
|
+
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../src/framing.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAoBD;;;;4CAI4C;AAC5C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,EAAE,gBAAgB,SAAM,GAAG,oBAAoB,CAOxG;AAeD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD;AAKD,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,QAAkC,CAAC;AAEpE;;;;;;;;oFAQoF;AACpF,wBAAgB,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,SAAuB,GAAG,MAAM,CAOlF;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAE5C;AAED;iGACiG;AACjG,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAOpD;AA4BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG9D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGxD"}
|
package/dist/framing.js
CHANGED
|
@@ -32,15 +32,29 @@ function boundedRow(row, maxCodePoints) {
|
|
|
32
32
|
const points = Array.from(row);
|
|
33
33
|
return points.length <= maxCodePoints ? row : `${points.slice(0, maxCodePoints - 1).join("")}…`;
|
|
34
34
|
}
|
|
35
|
-
/** Render a non-consuming inbox snapshot with the same provenance convention as `cotal_inbox`.
|
|
35
|
+
/** Render a non-consuming inbox snapshot with the same provenance convention as `cotal_inbox`.
|
|
36
|
+
* Each row's attribution, the sender's unverified marker included, is whole inside the row: the
|
|
37
|
+
* channel or role label is capped and the sender label gets the room the row has left, so only
|
|
38
|
+
* the body is cut. The bound is at least {@link MIN_PREVIEW_ROW} code points, which holds the
|
|
39
|
+
* longest attribution these caps allow. */
|
|
36
40
|
export function renderInboxPreview(snapshot, maxRowCodePoints = 240) {
|
|
37
|
-
if (!Number.isInteger(maxRowCodePoints) || maxRowCodePoints <
|
|
38
|
-
throw new Error(`inbox preview row bound must be a whole number from
|
|
41
|
+
if (!Number.isInteger(maxRowCodePoints) || maxRowCodePoints < MIN_PREVIEW_ROW || maxRowCodePoints > 1_000)
|
|
42
|
+
throw new Error(`inbox preview row bound must be a whole number from ${MIN_PREVIEW_ROW} to 1000, got ${maxRowCodePoints}`);
|
|
39
43
|
return {
|
|
40
44
|
unread: snapshot.unread,
|
|
41
|
-
rows: snapshot.items.map((item) => boundedRow(
|
|
45
|
+
rows: snapshot.items.map((item) => boundedRow(formatItem(item, "", maxRowCodePoints - 1).replace(PREVIEW_CONTROL, "\uFFFD"), maxRowCodePoints)),
|
|
42
46
|
};
|
|
43
47
|
}
|
|
48
|
+
/** The most code points a channel or role label takes in a bounded attribution. */
|
|
49
|
+
const LABEL_MAX_CODE_POINTS = 40;
|
|
50
|
+
/** The smallest preview row: a capped channel label, `@you`, and the smallest sender label with
|
|
51
|
+
* its marker, inside one row with room to spare. */
|
|
52
|
+
const MIN_PREVIEW_ROW = 80;
|
|
53
|
+
/** `s` cut to `max` code points, ending in `…` when it was longer. */
|
|
54
|
+
function capped(s, max) {
|
|
55
|
+
const points = Array.from(s);
|
|
56
|
+
return points.length <= max ? s : `${points.slice(0, max - 1).join("")}…`;
|
|
57
|
+
}
|
|
44
58
|
/**
|
|
45
59
|
* A PEER NAMES ITSELF, so its name is data and never framing.
|
|
46
60
|
*
|
|
@@ -60,11 +74,26 @@ export function renderInboxPreview(snapshot, maxRowCodePoints = 240) {
|
|
|
60
74
|
export function attributionSafe(s) {
|
|
61
75
|
return peerLabel({ name: s });
|
|
62
76
|
}
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
/** The most code points {@link fmtFrom} returns when its caller names no bound, marker included. */
|
|
78
|
+
const FROM_MAX_CODE_POINTS = 160;
|
|
79
|
+
/** The smallest bound {@link fmtFrom} accepts: the longer marker after one code point and `…`. */
|
|
80
|
+
export const FROM_MIN_CODE_POINTS = " (unverified name)".length + 2;
|
|
81
|
+
/** A message's sender, by the label every other surface prints for that peer, marked as the
|
|
82
|
+
* sender's own claim. A sender writes its name and role into its payload and its presence row
|
|
83
|
+
* alike, so neither is bound to one principal; the `sender_id` a delivery frame prints is. A blank
|
|
84
|
+
* name is not a name: the frame uses the sender's id, and a role still follows it, marked as an
|
|
85
|
+
* unverified role so the id is never called a name.
|
|
86
|
+
*
|
|
87
|
+
* The result is at most `maxCodePoints` code points. A longer label is cut, ending in `…`, and the
|
|
88
|
+
* marker always follows it whole, so a caller that bounds the line it prints keeps the marker. A
|
|
89
|
+
* bound below {@link FROM_MIN_CODE_POINTS} cannot hold a marker and is refused. */
|
|
90
|
+
export function fmtFrom(i, maxCodePoints = FROM_MAX_CODE_POINTS) {
|
|
91
|
+
if (!Number.isInteger(maxCodePoints) || maxCodePoints < FROM_MIN_CODE_POINTS)
|
|
92
|
+
throw new RangeError(`a sender label bound must be a whole number of at least ${FROM_MIN_CODE_POINTS} code points, got ${maxCodePoints}`);
|
|
93
|
+
const named = i.fromName.trim() !== "";
|
|
94
|
+
const label = peerLabel({ name: named ? i.fromName : i.fromId, ...(i.fromRole ? { role: i.fromRole } : {}) });
|
|
95
|
+
const marker = named ? " (unverified name)" : i.fromRole ? " (unverified role)" : "";
|
|
96
|
+
return `${capped(label, maxCodePoints - marker.length)}${marker}`;
|
|
68
97
|
}
|
|
69
98
|
/**
|
|
70
99
|
* A message body, indented so no line of it can reach column zero.
|
|
@@ -96,7 +125,7 @@ export function fmtDeliveryItem(i) {
|
|
|
96
125
|
...(i.contextId ? [`context_id=${field(i.contextId)}`] : []), ...(i.replyTo ? [`reply_to=${field(i.replyTo)}`] : [])];
|
|
97
126
|
return formatItem(i, `[${metadata.join(" ")}] `);
|
|
98
127
|
}
|
|
99
|
-
function formatItem(i, metadata = "") {
|
|
128
|
+
function formatItem(i, metadata = "", attributionMax) {
|
|
100
129
|
const h = i.historical ? "(history) " : ""; // backfilled on join, so it pre-dates you and is not live
|
|
101
130
|
// The broker's count, so a peer cannot forge or hide it: an earlier copy outlived its ack wait.
|
|
102
131
|
// That is a delivery fact, not evidence of a prior context handoff. A process restart also loses
|
|
@@ -110,11 +139,18 @@ function formatItem(i, metadata = "") {
|
|
|
110
139
|
// lease, so it is labelled as that and not as a peer's DM that wants an answer.
|
|
111
140
|
if (i.notice)
|
|
112
141
|
return `[${i.notice} notice from the delivery daemon] ${body}`;
|
|
142
|
+
// With a bound, the channel or role label is capped and the sender label takes the room left, so
|
|
143
|
+
// the attribution and its marker end inside the bound whatever the peer-chosen labels are.
|
|
144
|
+
const label = (s) => attributionMax === undefined ? attributionSafe(s ?? "") : capped(attributionSafe(s ?? ""), LABEL_MAX_CODE_POINTS);
|
|
145
|
+
const from = (head) => fmtFrom(i, attributionMax === undefined ? undefined : Math.min(FROM_MAX_CODE_POINTS, attributionMax - Array.from(head).length - "] ".length));
|
|
113
146
|
if (i.kind === "dm")
|
|
114
|
-
return `[DM from ${
|
|
115
|
-
if (i.kind === "anycast")
|
|
116
|
-
|
|
117
|
-
|
|
147
|
+
return `[DM from ${from("[DM from ")}] ${body}`;
|
|
148
|
+
if (i.kind === "anycast") {
|
|
149
|
+
const head = `[@${label(i.service)} from `;
|
|
150
|
+
return `${head}${from(head)}] ${body}`;
|
|
151
|
+
}
|
|
152
|
+
const head = `[#${label(i.channel)}${i.mentionsMe ? " @you" : ""} `;
|
|
153
|
+
return `${head}${from(head)}] ${body}`;
|
|
118
154
|
}
|
|
119
155
|
/**
|
|
120
156
|
* A message's channel, as a wake hint may name it.
|
package/dist/framing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framing.js","sourceRoot":"","sources":["../src/framing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAQlE;;;;;;;;;GASG;AACH,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAEjD,mGAAmG;AACnG,SAAS,UAAU,CAAC,GAAW,EAAE,aAAqB;IACpD,MAAM,MAAM,GAAG,KAAK,CAAC,IAA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;;;GAgBG;AACH,MAAM,UAAU,UAAU,CAAC,OAA2B;IACpD,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,OAAO,CAAC,IAAwB;IAC9C,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAChD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACxC,CAAC"}
|
package/dist/tool-specs.d.ts
CHANGED
|
@@ -133,7 +133,9 @@ export declare const READ_TAKE_ROUNDS = 8;
|
|
|
133
133
|
* remembering them, and name who sent them, so a peer spending that bound is visible rather than
|
|
134
134
|
* silent. Not a drop: nothing was cleared and the stream still holds them. */
|
|
135
135
|
export declare function aheadNote(items: readonly InboxItem[]): string;
|
|
136
|
-
/** Routing context for a `<channel …>` tag. Keys must be [A-Za-z0-9_] (others are dropped).
|
|
136
|
+
/** Routing context for a `<channel …>` tag. Keys must be [A-Za-z0-9_] (others are dropped). The
|
|
137
|
+
* sender's name and role are its own claim, so `from` is the marked label the frames print and
|
|
138
|
+
* `role` is scrubbed the same way; `from_id` is the identity the broker checked. */
|
|
137
139
|
export declare function channelMeta(i: InboxItem): Record<string, string>;
|
|
138
140
|
/**
|
|
139
141
|
* The channel a send with none goes to, from the channels the agent reads. A mesh that enforces
|
|
@@ -160,11 +162,13 @@ export declare function orientationCard(agent: MeshAgent, config: AgentConfig, s
|
|
|
160
162
|
/** The `cotal_send` success line: where the post went and the next move. It names the channel and
|
|
161
163
|
* any mention and makes no claim about who woke or how many received it, since nothing reports that
|
|
162
164
|
* to the sender. A name that was new before the post says so, with close matches first because a
|
|
163
|
-
* typo is the likely cause, and tells the sender to point others at it.
|
|
164
|
-
*
|
|
165
|
+
* typo is the likely cause, and tells the sender to point others at it. A name the channel list
|
|
166
|
+
* could not be read for is not called new: the line says the check failed and why. Whether a later
|
|
167
|
+
* joiner is shown the post is the channel's effective replay. */
|
|
165
168
|
export declare function sendResult(channel: string, mentions: readonly string[], receipt: {
|
|
166
169
|
known: boolean;
|
|
167
170
|
hints: readonly string[];
|
|
171
|
+
unchecked?: string;
|
|
168
172
|
}, replay: boolean): string;
|
|
169
173
|
/** The name a spawn result shows. A missing or whitespace-only name is the seat's id. */
|
|
170
174
|
export declare function shownSpawnName(name: string, id: string | undefined, role?: string): string;
|
package/dist/tool-specs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-specs.d.ts","sourceRoot":"","sources":["../src/tool-specs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAmB,MAAM,YAAY,CAAC;AAI9F,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAKzD;;gGAEgG;AAChG,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AA6JD;;;;;;;sGAOsG;AACtG,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;AAExD,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB;;;;8FAI0F;IAC1F,MAAM,EAAE,cAAc,CAAC;IACvB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,M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wBAAgB,WAAW,CAAC,CAAC,EAAE;IAC7B,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACpF,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;CAC9D,GAAG,MAAM,CAWT;AAED;0EAC0E;AAC1E,eAAO,MAAM,iBAAiB,sUACuS,CAAC;AA8BtU;;;;;;qEAMqE;AACrE,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,MAAM,SAAc,EACpB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,EACvB,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAC7B,cAAc,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,GACxC,aAAa,EAAE,CA+6CjB"}
|
package/dist/tool-specs.js
CHANGED
|
@@ -498,7 +498,7 @@ function heldNote(held, peek = false, stuckIds = new Set(), tier = "full") {
|
|
|
498
498
|
if (stuck.length) {
|
|
499
499
|
const named = stuck
|
|
500
500
|
.slice(0, NAMED_STUCK)
|
|
501
|
-
.map((i) => `${fmtFrom(i
|
|
501
|
+
.map((i) => `${fmtFrom(i, 40)} (${itemCost(i).toLocaleString("en-US")} chars)`)
|
|
502
502
|
.join(", ");
|
|
503
503
|
const rest = stuck.length - Math.min(NAMED_STUCK, stuck.length);
|
|
504
504
|
parts.push(`${stuck.length} message${stuck.length === 1 ? " is" : "s are"} larger than one response can carry: ${named}${rest ? `, and ${rest} more` : ""}. ${stuck.length === 1 ? "It stays" : "They stay"} buffered and uncleared, and once no smaller mail is waiting, each call delivers the next part of one of them; a message is cleared only after its last part goes out.`);
|
|
@@ -561,7 +561,7 @@ function renderPart(opts) {
|
|
|
561
561
|
: done
|
|
562
562
|
? "This was its last part, so it is now cleared."
|
|
563
563
|
: "It stays buffered and uncleared until its last part goes out; call cotal_inbox again for the next part.";
|
|
564
|
-
const head = `Part of a message larger than one response, from ${fmtFrom(opts.item
|
|
564
|
+
const head = `Part of a message larger than one response, from ${fmtFrom(opts.item, 40)}: characters ${fmt(opts.offset + 1)}-${fmt(end)} of ${fmt(total)}${opts.peek ? " (peek: nothing cleared)" : ""}. ${next}`;
|
|
565
565
|
const body = `${head}\n ${full.slice(opts.offset, end)}${heldNote(opts.others, opts.peek, opts.stuck, tier)}`;
|
|
566
566
|
return opts.warning ? `${body}\n\n${opts.warning}` : body;
|
|
567
567
|
};
|
|
@@ -643,7 +643,7 @@ const NAMED_AHEAD = 3;
|
|
|
643
643
|
export function aheadNote(items) {
|
|
644
644
|
if (!items.length)
|
|
645
645
|
return "";
|
|
646
|
-
const senders = [...new Set(items.map((i) =>
|
|
646
|
+
const senders = [...new Set(items.map((i) => (i.fromName.trim() || i.fromId.trim() ? fmtFrom(i, 40) : "(unnamed)")))];
|
|
647
647
|
const named = senders.slice(0, NAMED_AHEAD).join(", ");
|
|
648
648
|
const rest = senders.length - Math.min(NAMED_AHEAD, senders.length);
|
|
649
649
|
const one = items.length === 1;
|
|
@@ -698,11 +698,13 @@ function resolveFeedbackEmail(explicit, env) {
|
|
|
698
698
|
return undefined;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
/** Routing context for a `<channel …>` tag. Keys must be [A-Za-z0-9_] (others are dropped).
|
|
701
|
+
/** Routing context for a `<channel …>` tag. Keys must be [A-Za-z0-9_] (others are dropped). The
|
|
702
|
+
* sender's name and role are its own claim, so `from` is the marked label the frames print and
|
|
703
|
+
* `role` is scrubbed the same way; `from_id` is the identity the broker checked. */
|
|
702
704
|
export function channelMeta(i) {
|
|
703
|
-
const m = { kind: i.kind, from: i
|
|
705
|
+
const m = { kind: i.kind, from: fmtFrom(i), from_id: i.fromId };
|
|
704
706
|
if (i.fromRole)
|
|
705
|
-
m.role = i.fromRole;
|
|
707
|
+
m.role = attributionSafe(i.fromRole);
|
|
706
708
|
if (i.channel)
|
|
707
709
|
m.channel = i.channel;
|
|
708
710
|
if (i.service)
|
|
@@ -757,8 +759,9 @@ export async function orientationCard(agent, config, source, env, offered) {
|
|
|
757
759
|
/** The `cotal_send` success line: where the post went and the next move. It names the channel and
|
|
758
760
|
* any mention and makes no claim about who woke or how many received it, since nothing reports that
|
|
759
761
|
* to the sender. A name that was new before the post says so, with close matches first because a
|
|
760
|
-
* typo is the likely cause, and tells the sender to point others at it.
|
|
761
|
-
*
|
|
762
|
+
* typo is the likely cause, and tells the sender to point others at it. A name the channel list
|
|
763
|
+
* could not be read for is not called new: the line says the check failed and why. Whether a later
|
|
764
|
+
* joiner is shown the post is the channel's effective replay. */
|
|
762
765
|
export function sendResult(channel, mentions, receipt, replay) {
|
|
763
766
|
const at = `#${channel}`;
|
|
764
767
|
const named = mentions.map((n) => `@${n}`).join(", ");
|
|
@@ -767,6 +770,8 @@ export function sendResult(channel, mentions, receipt, replay) {
|
|
|
767
770
|
? `Posted to ${at} and mentioned ${named}. Agents on it see it too.`
|
|
768
771
|
: `Posted to ${at}. Agents on it see it; mention one to make it act.`;
|
|
769
772
|
const hint = receipt.hints.length ? ` Did you mean ${receipt.hints.map((h) => `#${h}`).join(", ")}?` : "";
|
|
773
|
+
if (receipt.unchecked !== undefined)
|
|
774
|
+
return `Posted to ${at}${mentions.length ? ` and mentioned ${named}` : ""}. Whether ${at} already existed could not be checked: ${receipt.unchecked.replace(/\.$/, "")}.${hint}`;
|
|
770
775
|
const later = replay
|
|
771
776
|
? "Others see it once they join; tell them where it is."
|
|
772
777
|
: "This channel doesn't replay history, so agents who join later won't see this post. Tell them where it is, and post again once they have joined.";
|
|
@@ -1277,6 +1282,10 @@ export function cotalToolSpecs(config, source = "connector", env, offered, empty
|
|
|
1277
1282
|
const target = channel ?? defaultSendChannel(config, joined);
|
|
1278
1283
|
if (target === undefined)
|
|
1279
1284
|
return err(`Couldn't send: ${sendNoDefaultRemedy(config, joined)}.`);
|
|
1285
|
+
// Bound by the post ACL before touching the mesh, as cotal_join is by the read ACL. Only a
|
|
1286
|
+
// mesh that enforces ACLs refuses the post, so only there is it refused here.
|
|
1287
|
+
if (isAuthed(config) && !channelInAllow(config.allowPublish, target))
|
|
1288
|
+
return err(`Can't post to #${target}: it's outside your post ACL (allowPublish: ${config.allowPublish.length ? config.allowPublish.map((c) => `#${c}`).join(", ") : "none"}). Nothing was sent.`);
|
|
1280
1289
|
const receipt = await agent.describeSendChannel(target);
|
|
1281
1290
|
const m = await agent.send(msg, target, mentions);
|
|
1282
1291
|
return ok(sendResult(m.channel ?? target, m.mentions ?? [], receipt, agent.channelInfo(m.channel ?? target).replay));
|