@chipschat/acp 1.0.27 → 1.0.28

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.
@@ -1,9 +1,9 @@
1
1
  # Third-party notices
2
2
 
3
- `dist/main.js` in @chipschat/acp 1.0.27 carries these packages, bundled in. Each one's
3
+ `dist/main.js` in @chipschat/acp 1.0.28 carries these packages, bundled in. Each one's
4
4
  licence follows.
5
5
 
6
- ## @chipschat/harness 1.0.7 (Apache-2.0)
6
+ ## @chipschat/harness 1.0.8 (Apache-2.0)
7
7
 
8
8
  Apache License
9
9
  Version 2.0, January 2004
@@ -207,7 +207,7 @@ Apache License
207
207
  See the License for the specific language governing permissions and
208
208
  limitations under the License.
209
209
 
210
- ## @chipschat/protocol 1.0.7 (Apache-2.0)
210
+ ## @chipschat/protocol 1.0.8 (Apache-2.0)
211
211
 
212
212
  Apache License
213
213
  Version 2.0, January 2004
package/dist/main.js CHANGED
@@ -20442,39 +20442,6 @@ var serverFacts = external_exports.object({
20442
20442
  })
20443
20443
  }).describe("`GET /v1/server`: the server, as the people paired to it see it (ADR 0170).");
20444
20444
 
20445
- // node_modules/@chipschat/protocol/dist/src/room-files.js
20446
- var ROOM_FILES_IN_CONTEXT = 20;
20447
- var ROOM_FILES_CEILING = 200;
20448
- var ROOM_FILES_HEADING = "Files in this space:";
20449
- var roomFile = external_exports.object({
20450
- name: external_exports.string().min(1).max(255).describe("The file's name, which its versions share."),
20451
- version: external_exports.int().positive().describe("Which version this is: 1 for the first, counting each change of its bytes."),
20452
- attachment_id: id("attachment").describe("The attachment that is this version: what a post names in `replaces` when it changes it."),
20453
- sha256: external_exports.string().regex(/^[a-f0-9]{64}$/).describe("Lowercase hex digest of this version's bytes."),
20454
- byte_size: external_exports.int().nonnegative().describe("Size in bytes."),
20455
- mime_type: external_exports.string().min(1).max(255).describe("Sniffed from the bytes on upload."),
20456
- by: external_exports.object({
20457
- id: external_exports.string().min(1).max(120).describe("Their participant id."),
20458
- kind: external_exports.enum(["person", "harness", "agent", "system"]),
20459
- name: external_exports.string().min(1).max(120).describe("What they go by now.")
20460
- }).describe("Who posted this version, as a line's `from` says it."),
20461
- at: isoTimestamp.describe("When this version was posted."),
20462
- message_id: id("message").optional().describe("The message that posted this version."),
20463
- width: external_exports.int().positive().optional().describe("Pixels, for a photo or a video."),
20464
- height: external_exports.int().positive().optional().describe("Pixels, for a photo or a video."),
20465
- duration_ms: external_exports.int().nonnegative().optional().describe("Milliseconds, for a sound or a video."),
20466
- replaces: id("attachment").optional().describe("In one name's versions (`?name=`): the version this one was made from, as its post said (`message.post.replaces`). Absent where the post said nothing, or named no version of this file."),
20467
- url: external_exports.url().optional().describe("For a harness: a signed URL for this version, bound to its token, as a message's attachments are. Absent for a person, who fetches it by id."),
20468
- url_expires_at: isoTimestamp.optional().describe("When `url` stops working.")
20469
- }).describe("One of a room's files at one of its versions: the current one, in the room's list (ADR 0099).");
20470
- var roomFiles = external_exports.array(roomFile).max(ROOM_FILES_CEILING).describe("The current version of each of the room's files, newest first (ADR 0099); or, asked for one name (`?name=`), that name's versions, newest first (ADR 0100).");
20471
- function renderRoomFiles(files) {
20472
- if (files === void 0 || files.length === 0)
20473
- return "";
20474
- const lines2 = files.map((file3) => [file3.name, `v${file3.version}`, `by ${file3.by.name}`, file3.at, file3.url].filter((part) => part !== void 0).join(" \xB7 "));
20475
- return [ROOM_FILES_HEADING, ...lines2].join("\n");
20476
- }
20477
-
20478
20445
  // node_modules/@chipschat/protocol/dist/src/project.js
20479
20446
  var PROJECT_BRANCH = "main";
20480
20447
  function projectPath(spaceId) {
@@ -20628,6 +20595,39 @@ function renderProjectAsks(facts, options) {
20628
20595
  return lines2.join("\n");
20629
20596
  }
20630
20597
 
20598
+ // node_modules/@chipschat/protocol/dist/src/room-files.js
20599
+ var ROOM_FILES_IN_CONTEXT = 20;
20600
+ var ROOM_FILES_CEILING = 200;
20601
+ var ROOM_FILES_HEADING = "Files in this space:";
20602
+ var roomFile = external_exports.object({
20603
+ name: external_exports.string().min(1).max(255).describe("The file's name, which its versions share."),
20604
+ version: external_exports.int().positive().describe("Which version this is: 1 for the first, counting each change of its bytes."),
20605
+ attachment_id: id("attachment").describe("The attachment that is this version: what a post names in `replaces` when it changes it."),
20606
+ sha256: external_exports.string().regex(/^[a-f0-9]{64}$/).describe("Lowercase hex digest of this version's bytes."),
20607
+ byte_size: external_exports.int().nonnegative().describe("Size in bytes."),
20608
+ mime_type: external_exports.string().min(1).max(255).describe("Sniffed from the bytes on upload."),
20609
+ by: external_exports.object({
20610
+ id: external_exports.string().min(1).max(120).describe("Their participant id."),
20611
+ kind: external_exports.enum(["person", "harness", "agent", "system"]),
20612
+ name: external_exports.string().min(1).max(120).describe("What they go by now.")
20613
+ }).describe("Who posted this version, as a line's `from` says it."),
20614
+ at: isoTimestamp.describe("When this version was posted."),
20615
+ message_id: id("message").optional().describe("The message that posted this version."),
20616
+ width: external_exports.int().positive().optional().describe("Pixels, for a photo or a video."),
20617
+ height: external_exports.int().positive().optional().describe("Pixels, for a photo or a video."),
20618
+ duration_ms: external_exports.int().nonnegative().optional().describe("Milliseconds, for a sound or a video."),
20619
+ replaces: id("attachment").optional().describe("In one name's versions (`?name=`): the version this one was made from, as its post said (`message.post.replaces`). Absent where the post said nothing, or named no version of this file."),
20620
+ url: external_exports.url().optional().describe("For a harness: a signed URL for this version, bound to its token, as a message's attachments are. Absent for a person, who fetches it by id."),
20621
+ url_expires_at: isoTimestamp.optional().describe("When `url` stops working.")
20622
+ }).describe("One of a room's files at one of its versions: the current one, in the room's list (ADR 0099).");
20623
+ var roomFiles = external_exports.array(roomFile).max(ROOM_FILES_CEILING).describe("The current version of each of the room's files, newest first (ADR 0099); or, asked for one name (`?name=`), that name's versions, newest first (ADR 0100).");
20624
+ function renderRoomFiles(files) {
20625
+ if (files === void 0 || files.length === 0)
20626
+ return "";
20627
+ const lines2 = files.map((file3) => [file3.name, `v${file3.version}`, `by ${file3.by.name}`, file3.at, file3.url].filter((part) => part !== void 0).join(" \xB7 "));
20628
+ return [ROOM_FILES_HEADING, ...lines2].join("\n");
20629
+ }
20630
+
20631
20631
  // node_modules/@chipschat/protocol/dist/src/spend.js
20632
20632
  var SPEND_CEILING_MIN = 0.25;
20633
20633
  var SPEND_CEILING_MAX = 1e3;
@@ -20726,6 +20726,10 @@ var contextLine = external_exports.object({
20726
20726
  transcript: external_exports.string().max(MAX_TRANSCRIPT_LENGTH).optional().describe("On `said`: what a voice note said, as the server heard it (ADR 0054)."),
20727
20727
  files: external_exports.array(external_exports.string().min(1).max(255)).max(20).optional().describe("On `said`: the names of the files it carried."),
20728
20728
  addressed_to: external_exports.array(agentId).max(64).optional().describe("On `said`: the agents it was for (ADR 0081, ADR 0087), so a harness can leave out a line one of its agents already took a turn on. Absent on a message from before Chips said so."),
20729
+ to: external_exports.array(external_exports.object({
20730
+ id: agentId.describe("One of `addressed_to`."),
20731
+ name: external_exports.string().min(1).max(120).describe("What it goes by now.")
20732
+ })).max(64).optional().describe("On `said`: the agents it was for, each by what it goes by now, in `addressed_to`'s order. The plain form says them when the line was for an agent other than the one reading it, `Arjun, to Scout: \u2026`: a person's pick in the field leaves no @ in the words. Absent when it was for no agent, and from a Chips before it."),
20729
20733
  held: external_exports.literal(true).optional().describe("On `said`: the guard held it (ADR 0081), so it was for nobody."),
20730
20734
  name: external_exports.string().min(1).max(120).optional().describe("On `renamed`, for a participant: the name they took."),
20731
20735
  previous: external_exports.string().min(1).max(120).optional().describe("On `renamed`, for a participant: the name they went by until then."),
@@ -20767,11 +20771,18 @@ function wordsOf(line) {
20767
20771
  parts.push("(held by Chips until a person acts)");
20768
20772
  return parts.filter((part) => part !== "").join(" ");
20769
20773
  }
20770
- function renderLine(line) {
20774
+ function toWords(line, taker) {
20775
+ const to = line.to ?? [];
20776
+ const others = to.filter((each) => each.id !== taker).map((each) => each.name);
20777
+ if (others.length === 0)
20778
+ return "";
20779
+ return `, to ${namesInWords(others.length === to.length ? others : ["you", ...others])}`;
20780
+ }
20781
+ function renderLine(line, reading) {
20771
20782
  const name = line.from.name;
20772
20783
  switch (line.kind) {
20773
20784
  case "said":
20774
- return `${withRole(name, line.from)}: ${wordsOf(line)}`;
20785
+ return `${withRole(name, line.from)}${toWords(line, reading?.taker)}: ${wordsOf(line)}`;
20775
20786
  case "joined":
20776
20787
  return `(${name} joined the space)`;
20777
20788
  case "left":
@@ -20786,10 +20797,10 @@ function renderLine(line) {
20786
20797
  return `(${name} unarchived the space)`;
20787
20798
  }
20788
20799
  }
20789
- function renderContext(context) {
20800
+ function renderContext(context, reading) {
20790
20801
  if (context === void 0)
20791
20802
  return "";
20792
- const said = context.lines.length === 0 ? "" : [CONTEXT_HEADING, ...context.lines.map(renderLine)].join("\n");
20803
+ const said = context.lines.length === 0 ? "" : [CONTEXT_HEADING, ...context.lines.map((line) => renderLine(line, reading))].join("\n");
20793
20804
  return [said, renderRoomFiles(context.files)].filter((part) => part !== "").join("\n\n");
20794
20805
  }
20795
20806
  function renderAttachment(file3) {
@@ -20808,7 +20819,8 @@ function renderReplyingTo(replying, reading) {
20808
20819
  `${replier} is replying to ${whose} from ${saidWhen(replying.at, reading)}${gone}.`
20809
20820
  ];
20810
20821
  if (replying.before !== void 0 && replying.before.length > 0) {
20811
- said.push(REPLY_BEFORE_HEADING, ...replying.before.map(renderLine));
20822
+ const reader = { taker: reading.taker };
20823
+ said.push(REPLY_BEFORE_HEADING, ...replying.before.map((line) => renderLine(line, reader)));
20812
20824
  }
20813
20825
  if (replying.deleted === true)
20814
20826
  return said.join("\n");
@@ -25958,13 +25970,13 @@ function heldWords(answer, released = false) {
25958
25970
  return `Your last message in this space was held, so the agents it named do not have it yet: messages between the agents here are held${since} until a person acts. Until then, tell the person what is done and what is blocked, rather than asking the agents again.`;
25959
25971
  }
25960
25972
  var BEFORE_HEADING = "Said in this space before you joined:";
25961
- function beforeOf(message, options) {
25973
+ function beforeOf(message, options, taker) {
25962
25974
  const said = /* @__PURE__ */ new Set([
25963
25975
  message.message_id,
25964
25976
  ...(options.earlier ?? []).map((each) => each.message_id)
25965
25977
  ]);
25966
25978
  const lines2 = (options.before?.lines ?? []).filter((line) => line.message_id === void 0 || !said.has(line.message_id));
25967
- return lines2.length === 0 ? void 0 : [BEFORE_HEADING, ...lines2.map(renderLine)].join("\n");
25979
+ return lines2.length === 0 ? void 0 : [BEFORE_HEADING, ...lines2.map((line) => renderLine(line, { taker }))].join("\n");
25968
25980
  }
25969
25981
  function waitedWords(count) {
25970
25982
  return `${count} messages for you waited while you were working or away. They follow, oldest first. Answer them together in one reply, and where a later one changes or settles an earlier one, go by the later.`;
@@ -26013,8 +26025,9 @@ function promptFor(message, options = {}) {
26013
26025
  note,
26014
26026
  project,
26015
26027
  sending,
26016
- beforeOf(message, options),
26017
- renderContext(contextOf(message, options)),
26028
+ beforeOf(message, options, taker),
26029
+ // A line for another agent says whom it was for; one for the taker alone does not.
26030
+ renderContext(contextOf(message, options), { taker }),
26018
26031
  earlier.length === 0 ? void 0 : waitedWords(earlier.length + 1),
26019
26032
  ...earlier.flatMap((each) => saidOf(each, options, taker)),
26020
26033
  ...saidOf(message, options, taker),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipschat/acp",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "An agent that speaks the Agent Client Protocol, as a Chips harness of its kind: agents made from Chips, each in a folder of its own, each room a session.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -33,9 +33,9 @@
33
33
  "release": "npm run build && npm test && npm pack"
34
34
  },
35
35
  "devDependencies": {
36
- "@chipschat/conformance": "1.0.7",
37
- "@chipschat/harness": "1.0.7",
38
- "@chipschat/protocol": "1.0.7",
36
+ "@chipschat/conformance": "1.0.8",
37
+ "@chipschat/harness": "1.0.8",
38
+ "@chipschat/protocol": "1.0.8",
39
39
  "@types/node": "22.19.0",
40
40
  "esbuild": "0.27.7",
41
41
  "tsx": "4.21.0",