@miadi/companion-ui 0.0.0-stage → 0.1.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.
@@ -0,0 +1,122 @@
1
+ /**
2
+ * The conversation a person holds with an episode's companion seat, as data.
3
+ *
4
+ * Three sources meet here and nowhere else:
5
+ *
6
+ * - **takes**: what the person said, a recorded take filed in the episode under
7
+ * `captures/<take>/` with its English transcript;
8
+ * - **replies**: what the seat answered, one record per reply as the companion's
9
+ * phone page keeps them (`replies/<episode>.jsonl` in its state directory);
10
+ * - **voices**: the voice ledger's records of those replies. A reply is voiced
11
+ * in parts of at most 900 characters, each its own record, so one reply can be
12
+ * several voices.
13
+ *
14
+ * A voice whose `source` is `phone-capture` is a companion reply. Those voices
15
+ * belong to the conversation, not to the episode's other recordings, and
16
+ * `isCompanionVoice` is the one place that says so.
17
+ *
18
+ * Pure: no React, no DOM, no Node. `./node` reads the files; the host reads the
19
+ * ledger; this module joins them.
20
+ */
21
+ export type CompanionFeedback = "up" | "down";
22
+ /** A card under a reply for something it names: a diagram, a review, an issue, a file. */
23
+ export interface CompanionRelated {
24
+ label: string;
25
+ /** An absolute http(s) URL, as the phone page keeps it. */
26
+ href: string;
27
+ kind?: string;
28
+ }
29
+ /** One recorded take, as the episode files it. */
30
+ export interface CompanionTake {
31
+ /** The 12-digit take id, `yyMMddHHmmss`. */
32
+ id: string;
33
+ /** When the take was stored, ISO 8601. */
34
+ at: string;
35
+ /** The English transcript, `""` when the take has none yet. */
36
+ text: string;
37
+ /** The take's audio, relative to the episode folder. */
38
+ audioPath?: string;
39
+ /** What the take was for, when it said (`labelling` takes are not part of the conversation). */
40
+ purpose?: string;
41
+ }
42
+ /** One reply from the seat, as the companion's phone page keeps it. */
43
+ export interface CompanionReply {
44
+ id: string;
45
+ /** The take it answers, or null when the seat spoke first. */
46
+ take: string | null;
47
+ text: string;
48
+ /** Which seat wrote it, as the seat names itself (`claude-code@gaia`). */
49
+ seat: string;
50
+ /** The tmux session the seat ran in, from the reply's origin. */
51
+ session?: string;
52
+ at: string;
53
+ related?: CompanionRelated[];
54
+ /** The person's ruling on the reply, when given. */
55
+ feedback?: CompanionFeedback;
56
+ }
57
+ /** One voice-ledger record, reduced to what the conversation needs. */
58
+ export interface CompanionVoice {
59
+ id: string;
60
+ at: string;
61
+ text: string;
62
+ persona: string;
63
+ source?: string | null;
64
+ /** A playable URL, or null when the record carries no audio. */
65
+ src: string | null;
66
+ /** The tmux session of the voice's origin. */
67
+ session?: string;
68
+ }
69
+ export interface CompanionTakeTurn extends CompanionTake {
70
+ kind: "take";
71
+ }
72
+ export interface CompanionReplyTurn extends CompanionReply {
73
+ kind: "reply";
74
+ /** Who speaks: the persona that voiced it, else the seat key in its session name. */
75
+ persona: string;
76
+ /** Its voice, in the order of the text. Empty when it was never voiced. */
77
+ audio: CompanionVoice[];
78
+ /** True when no reply record was found and the turn was rebuilt from its voices. */
79
+ fromVoices?: boolean;
80
+ }
81
+ export type CompanionTurn = CompanionTakeTurn | CompanionReplyTurn;
82
+ export interface CompanionThread {
83
+ /** Takes and replies in the order they happened. */
84
+ turns: CompanionTurn[];
85
+ takes: number;
86
+ replies: number;
87
+ /** Sessions that wrote replies, newest last. */
88
+ sessions: string[];
89
+ }
90
+ /** The ledger `source` the companion's phone page voices its replies with. */
91
+ export declare const COMPANION_VOICE_SOURCE = "phone-capture";
92
+ /** True for a ledger voice that is a companion's reply, not another recording of the episode. */
93
+ export declare function isCompanionVoice(voice: {
94
+ source?: string | null;
95
+ }): boolean;
96
+ /**
97
+ * What the phone page sends to the voice layer for a reply: the glyph labels,
98
+ * headings, list marks, emphasis, code ticks and link targets removed. Kept equal
99
+ * to `speakable` in jgwill/miadi-orchestration-kit
100
+ * `claude/mia-episode-companion/phone-capture/server.mjs`, so a voice can be found
101
+ * in the reply it was cut from.
102
+ */
103
+ export declare function speakable(text: string): string;
104
+ /** The seat key a companion session name carries: `episode-120-mia-companion` → `mia`. */
105
+ export declare function seatOfSession(session: string | undefined): string | undefined;
106
+ /**
107
+ * The conversation, in order. Every reply gets the voices cut from its text. A
108
+ * companion voice that no reply record holds becomes a reply of its own, so a
109
+ * host that cannot read the phone page's records still shows what the seat said.
110
+ */
111
+ export declare function buildCompanionThread(input: {
112
+ takes?: readonly CompanionTake[];
113
+ replies?: readonly CompanionReply[];
114
+ voices?: readonly CompanionVoice[];
115
+ }): CompanionThread;
116
+ /** The take a reply answers, when it is in the thread. */
117
+ export declare function takeOf(thread: CompanionThread, reply: CompanionReplyTurn): CompanionTakeTurn | undefined;
118
+ /** `2026-10-12T15:32:05Z` → `2026-10-12 15:32 UTC`: the same on the server and in every browser. */
119
+ export declare function stampOf(at: string): string;
120
+ /** `mia` → `Mia`. */
121
+ export declare function personaLabel(persona: string): string;
122
+ //# sourceMappingURL=thread.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../src/thread.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAAA;AAE7C,0FAA0F;AAC1F,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAA;IACV,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAA;IACV,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,8DAA8D;IAC9D,IAAI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AgB,gBAAgB,CAAC,KAAK,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,OAAO,CAE3E;AAKD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS9C;AASD,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE7E;AAUD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,KAAK,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;IAChC,OAAO,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;IACnC,MAAM,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;CACnC,GAAG,eAAe,CAsElB;AAaD,0DAA0D;AAC1D,wBAAgB,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,GAAG,SAAS,CAExG;AAED,oGAAoG;AACpG,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAG1C;AAED,qBAAqB;AACrB,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD"}
package/dist/thread.js ADDED
@@ -0,0 +1,172 @@
1
+ /**
2
+ * The conversation a person holds with an episode's companion seat, as data.
3
+ *
4
+ * Three sources meet here and nowhere else:
5
+ *
6
+ * - **takes**: what the person said, a recorded take filed in the episode under
7
+ * `captures/<take>/` with its English transcript;
8
+ * - **replies**: what the seat answered, one record per reply as the companion's
9
+ * phone page keeps them (`replies/<episode>.jsonl` in its state directory);
10
+ * - **voices**: the voice ledger's records of those replies. A reply is voiced
11
+ * in parts of at most 900 characters, each its own record, so one reply can be
12
+ * several voices.
13
+ *
14
+ * A voice whose `source` is `phone-capture` is a companion reply. Those voices
15
+ * belong to the conversation, not to the episode's other recordings, and
16
+ * `isCompanionVoice` is the one place that says so.
17
+ *
18
+ * Pure: no React, no DOM, no Node. `./node` reads the files; the host reads the
19
+ * ledger; this module joins them.
20
+ */
21
+ /** The ledger `source` the companion's phone page voices its replies with. */
22
+ export const COMPANION_VOICE_SOURCE = "phone-capture";
23
+ /** True for a ledger voice that is a companion's reply, not another recording of the episode. */
24
+ export function isCompanionVoice(voice) {
25
+ return voice.source === COMPANION_VOICE_SOURCE;
26
+ }
27
+ /** Take purposes that belong to something else than the conversation. */
28
+ const NOT_CONVERSATION = new Set(["labelling"]);
29
+ /**
30
+ * What the phone page sends to the voice layer for a reply: the glyph labels,
31
+ * headings, list marks, emphasis, code ticks and link targets removed. Kept equal
32
+ * to `speakable` in jgwill/miadi-orchestration-kit
33
+ * `claude/mia-episode-companion/phone-capture/server.mjs`, so a voice can be found
34
+ * in the reply it was cut from.
35
+ */
36
+ export function speakable(text) {
37
+ return text
38
+ .split("\n")
39
+ .map((line) => line.replace(/^\s*(🧠|🌸)\s*:?\s*/u, "").replace(/^#+\s*/, "").replace(/^\s*[-*]\s+/, ""))
40
+ .join("\n")
41
+ .replace(/\*\*|__|`/g, "")
42
+ .replace(/\[([^\]]+)\]\([^)]+\)/g, "$1")
43
+ .replace(/\n{3,}/g, "\n\n")
44
+ .trim();
45
+ }
46
+ /** Letters and digits only, lower case: what survives every joint between parts. */
47
+ function letters(text) {
48
+ return text.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "");
49
+ }
50
+ const SESSION_SEAT = /^episode-\d+-([a-z][a-z0-9]*)-companion(?:-|$)/;
51
+ /** The seat key a companion session name carries: `episode-120-mia-companion` → `mia`. */
52
+ export function seatOfSession(session) {
53
+ return session ? SESSION_SEAT.exec(session)?.[1] : undefined;
54
+ }
55
+ function time(at) {
56
+ const t = Date.parse(at);
57
+ return Number.isFinite(t) ? t : 0;
58
+ }
59
+ /** Voices close enough in time and from one session are one reply when no record names it. */
60
+ const VOICE_GAP_MS = 120_000;
61
+ /**
62
+ * The conversation, in order. Every reply gets the voices cut from its text. A
63
+ * companion voice that no reply record holds becomes a reply of its own, so a
64
+ * host that cannot read the phone page's records still shows what the seat said.
65
+ */
66
+ export function buildCompanionThread(input) {
67
+ const takes = (input.takes ?? []).filter((take) => !take.purpose || !NOT_CONVERSATION.has(take.purpose));
68
+ const replies = [...(input.replies ?? [])].sort((a, b) => time(a.at) - time(b.at));
69
+ const voices = (input.voices ?? []).filter(isCompanionVoice).sort((a, b) => time(a.at) - time(b.at));
70
+ const spoken = replies.map((reply) => letters(speakable(reply.text)));
71
+ const audio = new Map();
72
+ const loose = [];
73
+ for (const voice of voices) {
74
+ const said = letters(voice.text);
75
+ let found = -1;
76
+ let offset = -1;
77
+ if (said) {
78
+ // The latest reply posted before the voice was made that holds its words. A reply
79
+ // can be voiced long after it was posted (Hear Mia renders on demand), never before.
80
+ for (let i = replies.length - 1; i >= 0; i--) {
81
+ const at = spoken[i].indexOf(said);
82
+ if (at < 0)
83
+ continue;
84
+ if (found < 0) {
85
+ found = i;
86
+ offset = at;
87
+ }
88
+ if (time(replies[i].at) <= time(voice.at) + 60_000) {
89
+ found = i;
90
+ offset = at;
91
+ break;
92
+ }
93
+ }
94
+ }
95
+ if (found < 0) {
96
+ loose.push(voice);
97
+ continue;
98
+ }
99
+ const id = replies[found].id;
100
+ audio.set(id, [...(audio.get(id) ?? []), { voice, offset }]);
101
+ }
102
+ const turns = takes.map((take) => ({ kind: "take", ...take }));
103
+ for (const reply of replies) {
104
+ const parts = (audio.get(reply.id) ?? []).sort((a, b) => a.offset - b.offset);
105
+ // A reply voiced twice keeps one voice per part: the first made.
106
+ const seen = new Set();
107
+ const kept = parts.filter((p) => (seen.has(p.offset) ? false : (seen.add(p.offset), true))).map((p) => p.voice);
108
+ turns.push({
109
+ kind: "reply",
110
+ ...reply,
111
+ persona: kept[0]?.persona || seatOfSession(reply.session) || "companion",
112
+ audio: kept,
113
+ });
114
+ }
115
+ for (const group of groupVoices(loose)) {
116
+ const first = group[0];
117
+ turns.push({
118
+ kind: "reply",
119
+ id: `voice:${first.id}`,
120
+ take: null,
121
+ text: group.map((v) => v.text).join("\n\n"),
122
+ seat: "",
123
+ ...(first.session ? { session: first.session } : {}),
124
+ at: first.at,
125
+ persona: first.persona || seatOfSession(first.session) || "companion",
126
+ audio: group,
127
+ fromVoices: true,
128
+ });
129
+ }
130
+ turns.sort((a, b) => time(a.at) - time(b.at));
131
+ const sessions = [];
132
+ for (const turn of turns) {
133
+ if (turn.kind !== "reply" || !turn.session)
134
+ continue;
135
+ const at = sessions.indexOf(turn.session);
136
+ if (at >= 0)
137
+ sessions.splice(at, 1);
138
+ sessions.push(turn.session);
139
+ }
140
+ return {
141
+ turns,
142
+ takes: turns.filter((t) => t.kind === "take").length,
143
+ replies: turns.filter((t) => t.kind === "reply").length,
144
+ sessions,
145
+ };
146
+ }
147
+ function groupVoices(voices) {
148
+ const groups = [];
149
+ for (const voice of voices) {
150
+ const last = groups.at(-1);
151
+ const previous = last?.at(-1);
152
+ if (last && previous && previous.session === voice.session && time(voice.at) - time(previous.at) <= VOICE_GAP_MS)
153
+ last.push(voice);
154
+ else
155
+ groups.push([voice]);
156
+ }
157
+ return groups;
158
+ }
159
+ /** The take a reply answers, when it is in the thread. */
160
+ export function takeOf(thread, reply) {
161
+ return reply.take ? thread.turns.find((t) => t.kind === "take" && t.id === reply.take) : undefined;
162
+ }
163
+ /** `2026-10-12T15:32:05Z` → `2026-10-12 15:32 UTC`: the same on the server and in every browser. */
164
+ export function stampOf(at) {
165
+ const m = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/.exec(at);
166
+ return m ? `${m[1]} ${m[2]} UTC` : at;
167
+ }
168
+ /** `mia` → `Mia`. */
169
+ export function personaLabel(persona) {
170
+ return persona ? persona[0].toUpperCase() + persona.slice(1) : persona;
171
+ }
172
+ //# sourceMappingURL=thread.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread.js","sourceRoot":"","sources":["../src/thread.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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M,CAAC,CAAC,CAAC,EAAE,CAAA;AACvC,CAAC;AAED,qBAAqB;AACrB,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;AACzE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,82 @@
1
1
  {
2
2
  "name": "@miadi/companion-ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "A companion seat in an episode, as React: the conversation a person held with the seat (their takes, its replies, each with its playback), and the opener that plans and opens the seat for an episode. Data and a transport in, intent out. No component holds a URL, a token or a chronicle root; ./node reads takes and replies from the files the companion writes.",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "type": "module",
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./thread": {
19
+ "types": "./dist/thread.d.ts",
20
+ "import": "./dist/thread.js",
21
+ "default": "./dist/thread.js"
22
+ },
23
+ "./seat": {
24
+ "types": "./dist/seat.d.ts",
25
+ "import": "./dist/seat.js",
26
+ "default": "./dist/seat.js"
27
+ },
28
+ "./node": {
29
+ "types": "./dist/node.d.ts",
30
+ "import": "./dist/node.js",
31
+ "default": "./dist/node.js"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "src",
38
+ "README.md"
39
+ ],
40
+ "peerDependencies": {
41
+ "react": ">=18",
42
+ "react-dom": ">=18"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "react-dom": {
46
+ "optional": true
47
+ }
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^22",
51
+ "@types/react": "^19",
52
+ "@types/react-dom": "^19",
53
+ "react": "^19",
54
+ "react-dom": "^19",
55
+ "typescript": "^5.4.0"
56
+ },
57
+ "engines": {
58
+ "node": ">=20"
59
+ },
60
+ "keywords": [
61
+ "miadi",
62
+ "chronicle",
63
+ "episode",
64
+ "companion",
65
+ "seat",
66
+ "dialogue",
67
+ "react"
68
+ ],
69
+ "repository": {
70
+ "type": "git",
71
+ "url": "git+https://github.com/jgwill/Miadi.git",
72
+ "directory": "packages/companion-ui"
73
+ },
74
+ "bugs": {
75
+ "url": "https://github.com/jgwill/Miadi/issues"
76
+ },
77
+ "scripts": {
78
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && ../../node_modules/.bin/tsc -p tsconfig.build.json",
79
+ "type-check": "../../node_modules/.bin/tsc -p tsconfig.build.json --noEmit",
80
+ "test": "npm run build && node --test test/*.test.mjs"
81
+ }
6
82
  }