@ccmsg/protocol 1.17.0 → 1.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccmsg/protocol",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "Wire contract (schema + types + op attribute table) shared by the ccmsg daemon and web UI",
5
5
  "license": "MIT",
6
6
  "author": "kawaz",
@@ -24,7 +24,17 @@ import { Sid, Timestamp } from "../identifiers.ts";
24
24
  * Segments after the first carry the spelling of whatever named them, which is
25
25
  * why they are not held to snake_case: `tool:Bash` and `hook:PreToolUse` are
26
26
  * the harness's words, and rewriting them would leave the reader unable to
27
- * match what it sees against what it ran. */
27
+ * match what it sees against what it ran.
28
+ *
29
+ * Under `message`, the second segment is **a relation read from the subject**:
30
+ * `parent` is whoever started this agent, `sub` a throwaway agent it started,
31
+ * `team` a named counterpart that goes on standing, `session` another session
32
+ * over ccmsg. The one exception is `user` — a person is not a relation to
33
+ * anyone, but the user, standing alone. A harness's own name for a party is
34
+ * never a type: `message:main` would read as the main session's traffic being
35
+ * overheard wherever it happens, when what is meant is the party this subject
36
+ * answers to — which is what `parent` says. The literal names (`main`, a
37
+ * lead's, a teammate's) are kept in `harness_name` on the item. */
28
38
  export const TranscriptItemType = Type.String({
29
39
  pattern: "^[a-z]+(?::[A-Za-z0-9_.-]+)*$",
30
40
  $id: "TranscriptItemType",
@@ -190,10 +200,10 @@ const MessageUserOut = item(Type.Literal("message:user:out"), { text: Text });
190
200
  * unnameable. */
191
201
  const MessageParentIn = item(Type.Literal("message:parent:in"), {
192
202
  text: Text,
193
- /** The parent as the harness named it where this arrived — `main`, a lead's
194
- * name, the agent above. Left out when the record says only that it came from
195
- * above, which is the case for the brief an agent opens with. */
196
- from: Type.Optional(Type.String()),
203
+ /** The harness's own name for the parent — `main`, a lead's name, the agent
204
+ * above. Left out when the record says only that it came from above, which is
205
+ * the case for the brief an agent opens with. */
206
+ harness_name: Type.Optional(Type.String()),
197
207
  msg_id: Type.Optional(Type.String()),
198
208
  });
199
209
 
@@ -202,8 +212,8 @@ const MessageParentIn = item(Type.Literal("message:parent:in"), {
202
212
  const MessageParentOutSent = item(Type.Literal("message:parent:out"), {
203
213
  ...USE_FIELDS,
204
214
  text: Text,
205
- /** The parent as the subject addressed it, in the harness's spelling. */
206
- to: Type.Optional(Type.String()),
215
+ /** The harness's own name for the parent, as the subject addressed it. */
216
+ harness_name: Type.Optional(Type.String()),
207
217
  summary: Type.Optional(Type.String()),
208
218
  });
209
219
 
@@ -223,7 +233,7 @@ const MessageTeamOut = item(Type.Literal("message:team:out"), {
223
233
  ...USE_FIELDS,
224
234
  text: Text,
225
235
  /** The teammate addressed, by the name it stands under. */
226
- to: Type.Optional(Type.String()),
236
+ harness_name: Type.Optional(Type.String()),
227
237
  summary: Type.Optional(Type.String()),
228
238
  agent_id: Type.Optional(Type.String()),
229
239
  /** Present on the call that started the teammate, absent on the ones that
@@ -236,7 +246,8 @@ const MessageTeamOut = item(Type.Literal("message:team:out"), {
236
246
  * was written. */
237
247
  const MessageTeamInSaid = item(Type.Literal("message:team:in"), {
238
248
  text: Text,
239
- from: Type.Optional(Type.String()),
249
+ /** The name the teammate stands under. */
250
+ harness_name: Type.Optional(Type.String()),
240
251
  msg_id: Type.Optional(Type.String()),
241
252
  });
242
253
 
@@ -244,6 +255,7 @@ const MessageTeamInSaid = item(Type.Literal("message:team:in"), {
244
255
  const MessageTeamInDone = item(Type.Literal("message:team:in"), {
245
256
  ...RESULT_FIELDS,
246
257
  text: Text,
258
+ harness_name: Type.Optional(Type.String()),
247
259
  agent_id: Type.Optional(Type.String()),
248
260
  status: Type.Optional(Type.String()),
249
261
  duration_ms: Type.Optional(Type.Integer({ minimum: 0 })),
@@ -310,7 +310,7 @@ export const TRANSCRIPT_ITEMS: Static<typeof TranscriptItem>[] = [
310
310
  result_item: "d4c1a0b2:0",
311
311
  tool_use_id: "toolu_01Tm5XYp",
312
312
  text: "契約に message:parent と message:team を足して",
313
- to: "contract-dump-items",
313
+ harness_name: "contract-dump-items",
314
314
  agent_id: "b83e0f114",
315
315
  subagent_type: "opus5-worker-high",
316
316
  },
@@ -321,7 +321,7 @@ export const TRANSCRIPT_ITEMS: Static<typeof TranscriptItem>[] = [
321
321
  type: "message:team:in",
322
322
  at: FIXTURE_NOW - 2_900_000,
323
323
  text: "fixtures まで通ったので ci を回す",
324
- from: "contract-dump-items",
324
+ harness_name: "contract-dump-items",
325
325
  },
326
326
  {
327
327
  id: "d4c1a0b2:0",
@@ -363,7 +363,7 @@ export const TRANSCRIPT_ITEMS_AGENT_SUBJECT: Static<typeof TranscriptItem>[] = [
363
363
  role: "use",
364
364
  tool_use_id: "toolu_01Qz8Vbn",
365
365
  text: "型一覧は 4 群に分けた。preset の例まで直してよいか",
366
- to: "main",
366
+ harness_name: "main",
367
367
  summary: "型一覧の分け方を確認",
368
368
  },
369
369
  {