@chipschat/acp 1.0.28 → 1.0.29

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.28 carries these packages, bundled in. Each one's
3
+ `dist/main.js` in @chipschat/acp 1.0.29 carries these packages, bundled in. Each one's
4
4
  licence follows.
5
5
 
6
- ## @chipschat/harness 1.0.8 (Apache-2.0)
6
+ ## @chipschat/harness 1.0.9 (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.8 (Apache-2.0)
210
+ ## @chipschat/protocol 1.0.9 (Apache-2.0)
211
211
 
212
212
  Apache License
213
213
  Version 2.0, January 2004
package/dist/main.js CHANGED
@@ -20676,6 +20676,7 @@ var roomNote = external_exports.object({
20676
20676
  members: external_exports.array(roomMember).max(500).describe("The room's people, then its agents, each by name, anybody removed left out."),
20677
20677
  notes: external_exports.record(external_exports.string().max(120), external_exports.string().max(64e3)).describe("The note for each who takes the turn (`for`), by their id: who is here, with handles, and that only those @-mentioned act. A harness puts it at the top of the turn."),
20678
20678
  rules: external_exports.record(external_exports.string().max(120), external_exports.string().max(4e3)).optional().describe("How the space works, for each who takes the turn, by their id: the words its note ends with (ADR 0250), that everyone here reads what it writes and, beside other agents, what an @ does and when to answer NO_REPLY. They stay the same while the space's agents do, so a harness whose session keeps its earlier turns may say them once, and the note without them after."),
20679
+ about_message: external_exports.record(external_exports.string().max(120), external_exports.string().max(4e3)).optional().describe("What Chips says of this message to each who takes the turn, by their id: the words their note opens with when it has any. They say that the message is theirs though nothing @-mentions them, that it went to several agents or to all, that it comes to the lead as nobody's turn, that the agent it was for has not picked it up, or that it arrives late. A harness may say them beside the message and the note without them (`noteAndAbout`), as the SDK's `promptFor` does: on a session's first turn the note is far above the message. Absent when no taker's note says anything of the message."),
20679
20680
  working: external_exports.array(roomWork).max(500).optional().describe("The room's agents with a turn going as Chips sends this one (ADR 0104), the takers' own included. A turn nothing has been heard from for ten minutes is not counted."),
20680
20681
  idle: external_exports.array(roomIdle).max(500).optional().describe("The room's other agents that have had a turn here: how long since the last one ended (ADR 0104)."),
20681
20682
  away: external_exports.array(roomAway).max(500).optional().describe("The room's agents that can't answer as Chips sends this turn (ADR 0291): offline, or their harness says something is wrong. Work handed to one of them waits.")
@@ -20687,6 +20688,13 @@ function noteWithoutRules(room, taker) {
20687
20688
  return note;
20688
20689
  return note.slice(0, note.length - rules.length).trimEnd();
20689
20690
  }
20691
+ function noteAndAbout(note, room, taker) {
20692
+ const about = room?.about_message?.[taker];
20693
+ if (note === void 0 || about === void 0 || about === "" || !note.startsWith(about)) {
20694
+ return { note, about: void 0 };
20695
+ }
20696
+ return { note: note.slice(about.length).trimStart(), about };
20697
+ }
20690
20698
  var MONTHS = [
20691
20699
  "January",
20692
20700
  "February",
@@ -25981,8 +25989,21 @@ function beforeOf(message, options, taker) {
25981
25989
  function waitedWords(count) {
25982
25990
  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.`;
25983
25991
  }
25992
+ function forWords(message, taker) {
25993
+ if (taker === void 0 || !othersBeside(message, taker))
25994
+ return "";
25995
+ const members2 = message.room?.members ?? [];
25996
+ const to = (message.addressed_to ?? []).flatMap((id2) => {
25997
+ const member = members2.find((each) => each.participant_id === id2);
25998
+ return member === void 0 ? [] : [{ id: id2, name: member.name }];
25999
+ });
26000
+ if (to.length === 0)
26001
+ return "";
26002
+ const others = to.filter((each) => each.id !== taker).map((each) => each.name);
26003
+ return `, to ${namesInWords(others.length === to.length ? others : ["you", ...others])}`;
26004
+ }
25984
26005
  function saidOf(message, options, taker) {
25985
- const who2 = options.sayWho === false ? "" : `${withRole(message.from.display_name, message.from)}: `;
26006
+ const who2 = options.sayWho === false ? "" : `${withRole(message.from.display_name, message.from)}${forWords(message, taker)}: `;
25986
26007
  const files = (message.attachments ?? []).map(renderAttachment);
25987
26008
  const replying = renderReplyingTo(message.replying_to, {
25988
26009
  sender: {
@@ -26015,7 +26036,8 @@ function promptFor(message, options = {}) {
26015
26036
  const held = options.rulesHeld === true;
26016
26037
  const earlier = options.earlier ?? [];
26017
26038
  const notes = message.room?.notes ?? {};
26018
- const note = taker === void 0 ? void 0 : held ? noteWithoutRules(message.room, taker) : notes[taker];
26039
+ const whole2 = taker === void 0 ? void 0 : held ? noteWithoutRules(message.room, taker) : notes[taker];
26040
+ const { note, about } = taker === void 0 ? { note: whole2, about: void 0 } : noteAndAbout(whole2, message.room, taker);
26019
26041
  const sending = options.sendsFiles === true && !held ? sendingFiles({ project: options.project !== void 0 }) : void 0;
26020
26042
  const project = options.project === void 0 ? void 0 : held ? renderProjectFacts(options.project) : renderProjectNote(options.project, { othersInRoom: othersBeside(message, taker) });
26021
26043
  return [
@@ -26030,6 +26052,7 @@ function promptFor(message, options = {}) {
26030
26052
  renderContext(contextOf(message, options), { taker }),
26031
26053
  earlier.length === 0 ? void 0 : waitedWords(earlier.length + 1),
26032
26054
  ...earlier.flatMap((each) => saidOf(each, options, taker)),
26055
+ about,
26033
26056
  ...saidOf(message, options, taker),
26034
26057
  sinceOf(options)
26035
26058
  ].filter((part) => part !== void 0 && part !== "").join("\n\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipschat/acp",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
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.8",
37
- "@chipschat/harness": "1.0.8",
38
- "@chipschat/protocol": "1.0.8",
36
+ "@chipschat/conformance": "1.0.9",
37
+ "@chipschat/harness": "1.0.9",
38
+ "@chipschat/protocol": "1.0.9",
39
39
  "@types/node": "22.19.0",
40
40
  "esbuild": "0.27.7",
41
41
  "tsx": "4.21.0",