@adminide-stack/clock-tik-browser 12.0.34-alpha.0 → 12.0.34

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.
Files changed (64) hide show
  1. package/lib/pages/Home/AreaShots.d.ts +5 -0
  2. package/lib/pages/Home/AreaShots.d.ts.map +1 -0
  3. package/lib/pages/Home/AreaShots.js +209 -0
  4. package/lib/pages/Home/AreaShots.js.map +1 -0
  5. package/lib/pages/Home/HomePage.d.ts.map +1 -1
  6. package/lib/pages/Home/HomePage.js +22 -38
  7. package/lib/pages/Home/HomePage.js.map +1 -1
  8. package/lib/pages/Home/YantraMark.d.ts +11 -0
  9. package/lib/pages/Home/YantraMark.d.ts.map +1 -0
  10. package/lib/pages/Home/YantraMark.js +42 -0
  11. package/lib/pages/Home/YantraMark.js.map +1 -0
  12. package/lib/pages/Home/__tests__/chores.test.d.ts +2 -0
  13. package/lib/pages/Home/__tests__/chores.test.d.ts.map +1 -0
  14. package/lib/pages/Home/__tests__/media.test.d.ts +2 -0
  15. package/lib/pages/Home/__tests__/media.test.d.ts.map +1 -0
  16. package/lib/pages/Home/__tests__/placement.test.d.ts +2 -0
  17. package/lib/pages/Home/__tests__/placement.test.d.ts.map +1 -0
  18. package/lib/pages/Home/__tests__/stop.test.d.ts +2 -0
  19. package/lib/pages/Home/__tests__/stop.test.d.ts.map +1 -0
  20. package/lib/pages/Home/chat/ChoresChat.d.ts.map +1 -1
  21. package/lib/pages/Home/chat/ChoresChat.js +317 -47
  22. package/lib/pages/Home/chat/ChoresChat.js.map +1 -1
  23. package/lib/pages/Home/chat/ChoresPanel.d.ts +35 -0
  24. package/lib/pages/Home/chat/ChoresPanel.d.ts.map +1 -0
  25. package/lib/pages/Home/chat/ChoresPanel.js +323 -0
  26. package/lib/pages/Home/chat/ChoresPanel.js.map +1 -0
  27. package/lib/pages/Home/chat/chatTheme.d.ts +2 -1
  28. package/lib/pages/Home/chat/chatTheme.d.ts.map +1 -1
  29. package/lib/pages/Home/chat/chatTheme.js +475 -1
  30. package/lib/pages/Home/chat/chatTheme.js.map +1 -1
  31. package/lib/pages/Home/chat/chores.d.ts +143 -0
  32. package/lib/pages/Home/chat/chores.d.ts.map +1 -0
  33. package/lib/pages/Home/chat/chores.js +269 -0
  34. package/lib/pages/Home/chat/chores.js.map +1 -0
  35. package/lib/pages/Home/chat/lucy.d.ts.map +1 -1
  36. package/lib/pages/Home/chat/lucy.js +1 -1
  37. package/lib/pages/Home/chat/lucy.js.map +1 -1
  38. package/lib/pages/Home/chat/media.d.ts +15 -0
  39. package/lib/pages/Home/chat/media.d.ts.map +1 -0
  40. package/lib/pages/Home/chat/media.js +57 -0
  41. package/lib/pages/Home/chat/media.js.map +1 -0
  42. package/lib/pages/Home/chat/placement.d.ts +63 -0
  43. package/lib/pages/Home/chat/placement.d.ts.map +1 -0
  44. package/lib/pages/Home/chat/placement.js +87 -0
  45. package/lib/pages/Home/chat/placement.js.map +1 -0
  46. package/lib/pages/Home/chat/stop.d.ts +47 -0
  47. package/lib/pages/Home/chat/stop.d.ts.map +1 -0
  48. package/lib/pages/Home/chat/stop.js +101 -0
  49. package/lib/pages/Home/chat/stop.js.map +1 -0
  50. package/lib/pages/Home/chat/thread.d.ts +10 -1
  51. package/lib/pages/Home/chat/thread.d.ts.map +1 -1
  52. package/lib/pages/Home/chat/thread.js.map +1 -1
  53. package/lib/pages/Home/chat/tour/tourSteps.d.ts +3 -3
  54. package/lib/pages/Home/chat/tour/tourSteps.d.ts.map +1 -1
  55. package/lib/pages/Home/chat/tour/tourSteps.js +10 -2
  56. package/lib/pages/Home/chat/tour/tourSteps.js.map +1 -1
  57. package/lib/pages/Home/chat/useChores.d.ts +35 -0
  58. package/lib/pages/Home/chat/useChores.d.ts.map +1 -0
  59. package/lib/pages/Home/chat/useChores.js +145 -0
  60. package/lib/pages/Home/chat/useChores.js.map +1 -0
  61. package/lib/pages/Home/homeStyles.d.ts.map +1 -1
  62. package/lib/pages/Home/homeStyles.js +150 -23
  63. package/lib/pages/Home/homeStyles.js.map +1 -1
  64. package/package.json +3 -3
@@ -0,0 +1,269 @@
1
+ /** The slug every Clockbook chore is recorded under, on the Task API too (`surface:clockbook`). */
2
+ const CLOCKBOOK_SURFACE = 'clockbook';
3
+ /** The lane a chore's turns are recorded in. */
4
+ const CHORE_LANE = 'chore';
5
+ /**
6
+ * How long one turn may run on the agent before the agent cuts it off. A turn's record adds the
7
+ * kit's grace to this before it reads as stopped responding.
8
+ */
9
+ const CHORE_TURN_BUDGET_MS = 20 * 60_000;
10
+ /** How much of Lucy's answer a turn keeps for the panel; all of it is in the chat. */
11
+ const ANSWER_KEPT = 2_000;
12
+ /** Finished chores the panel lists, newest first. */
13
+ const DONE_SHOWN = 8;
14
+ /** And for how long after they finished. */
15
+ const DONE_FOR_MS = 7 * 24 * 60 * 60_000;
16
+ /**
17
+ * A chore done this fast was a quick answer ("thanks!", a phone number) the person watched arrive:
18
+ * the chat has it, and the list of what Lucy did is better without it.
19
+ */
20
+ const QUICK_ANSWER_MS = 20_000;
21
+ /** The reply a chat turn reports, as the agent puts it on the record: `result.text`. */
22
+ function replyOf(result) {
23
+ const text = result?.text;
24
+ return typeof text === 'string' && text.trim() ? text : undefined;
25
+ }
26
+ function turnFromTask(task, live) {
27
+ const text = replyOf(task.result) ?? task.text;
28
+ return {
29
+ id: task.id,
30
+ chore: task.handle.boardId || task.id,
31
+ title: task.title,
32
+ brief: task.brief,
33
+ state: task.state,
34
+ createdAt: task.createdAt,
35
+ ...(task.endedAt ? {
36
+ endedAt: task.endedAt
37
+ } : {}),
38
+ ...(task.progress ? {
39
+ progress: task.progress
40
+ } : {}),
41
+ ...(text ? {
42
+ text
43
+ } : {}),
44
+ ...(task.error ? {
45
+ error: task.error
46
+ } : {}),
47
+ ...(live ? {
48
+ live: true
49
+ } : {}),
50
+ ...(task.deadlineAt ? {
51
+ deadlineAt: task.deadlineAt
52
+ } : {})
53
+ };
54
+ }
55
+ function turnFromJob(job) {
56
+ const board = job.handle?.boardId;
57
+ // A short reply rides on the record's results as a text line; a longer one is the result itself.
58
+ const text = replyOf(job.result) ?? job.results?.find(r => r.kind === 'text' && r.title)?.title;
59
+ const progress = job.stage ? job.stage.detail || job.stage.label : job.progress;
60
+ return {
61
+ id: job.id,
62
+ chore: typeof board === 'string' && board ? board : job.id,
63
+ title: job.title,
64
+ brief: job.brief,
65
+ state: job.state,
66
+ createdAt: job.createdAt,
67
+ remote: true,
68
+ ...(job.endedAt ? {
69
+ endedAt: job.endedAt
70
+ } : {}),
71
+ ...(progress ? {
72
+ progress
73
+ } : {}),
74
+ ...(text ? {
75
+ text
76
+ } : {}),
77
+ ...(job.error ? {
78
+ error: job.error
79
+ } : {}),
80
+ ...(job.deadlineAt ? {
81
+ deadlineAt: job.deadlineAt
82
+ } : {})
83
+ };
84
+ }
85
+ /**
86
+ * Every turn the panel knows of: this browser's tasks, then the records of turns that ran in
87
+ * another browser and have no task here. A record the mirror wrote for one of this browser's tasks
88
+ * is that task, by its id or its server id.
89
+ */
90
+ function choreTurns(tasks, jobs, {
91
+ isLive,
92
+ owner
93
+ }) {
94
+ // The kit's store hides another account's tasks once told who is looking; this holds before then too.
95
+ const local = tasks.filter(task => task.surface === CLOCKBOOK_SURFACE && (!owner || !task.owner || task.owner === owner));
96
+ const ids = new Set(local.map(task => task.id));
97
+ const remoteIds = new Set(local.flatMap(task => task.remoteId ? [task.remoteId] : []));
98
+ const turns = local.map(task => turnFromTask(task, isLive(task.id)));
99
+ for (const job of jobs) {
100
+ if (job.surface !== CLOCKBOOK_SURFACE || ids.has(job.id)) continue;
101
+ if (job.remoteId && remoteIds.has(job.remoteId)) continue;
102
+ // An older backend lists the whole organization's records, so someone else's can come along.
103
+ if (owner && job.owner && job.owner !== owner) continue;
104
+ turns.push(turnFromJob(job));
105
+ }
106
+ return turns;
107
+ }
108
+ const byCreated = (a, b) => a.createdAt - b.createdAt;
109
+ const endOf = turn => turn.endedAt ?? turn.createdAt;
110
+ /** Running long past its deadline with nothing in this page streaming it. */
111
+ function isStale(turn, now) {
112
+ return turn.state === 'running' && !turn.live && turn.deadlineAt !== undefined && now > turn.deadlineAt;
113
+ }
114
+ /**
115
+ * The panel's chores from their turns.
116
+ *
117
+ * The agent runs one turn at a time, so a turn handed over while another of this browser's turns
118
+ * runs waits for it: until anything at all is heard of it, its chore is queued. A question waiting
119
+ * for an answer puts its chore first, whatever else its turns are doing. A finished chore ended the
120
+ * way its last turn to end did: an answer can be done before the turn it let carry on.
121
+ */
122
+ function choreList(turns, options = {}) {
123
+ const now = options.now ?? Date.now();
124
+ const groups = new Map();
125
+ for (const turn of turns) {
126
+ const group = groups.get(turn.chore);
127
+ if (group) group.push(turn);else groups.set(turn.chore, [turn]);
128
+ }
129
+ // The turn the agent is on: the oldest of this browser's that is still going.
130
+ const first = turns.filter(t => t.state === 'running' && !t.remote && !isStale(t, now)).sort(byCreated)[0]?.id;
131
+ const list = {
132
+ asking: [],
133
+ working: [],
134
+ queued: [],
135
+ done: [],
136
+ active: 0
137
+ };
138
+ for (const [id, unsorted] of groups) {
139
+ const group = [...unsorted].sort(byCreated);
140
+ const head = group[0];
141
+ const settled = group.filter(t => t.state !== 'running').sort((a, b) => endOf(a) - endOf(b));
142
+ const last = settled[settled.length - 1] ?? group[group.length - 1];
143
+ const answered = [...settled].reverse().find(t => t.text?.trim());
144
+ const chore = {
145
+ id,
146
+ title: head.title,
147
+ brief: head.brief,
148
+ status: 'done',
149
+ startedAt: head.createdAt,
150
+ turns: group.map(t => t.id),
151
+ ...(answered?.text ? {
152
+ answer: answered.text
153
+ } : {}),
154
+ ...(group.every(t => t.remote) ? {
155
+ remote: true
156
+ } : {})
157
+ };
158
+ if (options.asking && group.some(t => t.id === options.asking)) {
159
+ list.asking.push({
160
+ ...chore,
161
+ status: 'asking'
162
+ });
163
+ continue;
164
+ }
165
+ const running = group.filter(t => t.state === 'running' && !isStale(t, now));
166
+ if (running.length) {
167
+ const waiting = running.every(t => t.live && !t.progress && t.id !== first);
168
+ const progress = [...running].reverse().find(t => t.progress)?.progress;
169
+ const shown = {
170
+ ...chore,
171
+ status: waiting ? 'queued' : 'working',
172
+ ...(progress ? {
173
+ progress
174
+ } : {}),
175
+ ...(running.some(t => t.live) ? {} : {
176
+ background: true
177
+ })
178
+ };
179
+ if (waiting) list.queued.push(shown);else list.working.push(shown);
180
+ continue;
181
+ }
182
+ const stale = group.some(t => isStale(t, now));
183
+ list.done.push({
184
+ ...chore,
185
+ status: last.state === 'succeeded' && !stale ? 'done' : 'failed',
186
+ endedAt: Math.max(...group.map(endOf)),
187
+ ...(last.error ? {
188
+ error: last.error
189
+ } : {}),
190
+ ...(stale ? {
191
+ stale: true
192
+ } : {})
193
+ });
194
+ }
195
+ const byStart = (a, b) => a.startedAt - b.startedAt;
196
+ list.asking.sort(byStart);
197
+ list.working.sort(byStart);
198
+ list.queued.sort(byStart);
199
+ list.done = list.done.filter(c => c.status === 'failed' || (c.endedAt ?? c.startedAt) - c.startedAt >= QUICK_ANSWER_MS).filter(c => now - (c.endedAt ?? c.startedAt) < DONE_FOR_MS).sort((a, b) => (b.endedAt ?? b.startedAt) - (a.endedAt ?? a.startedAt)).slice(0, DONE_SHOWN);
200
+ list.active = list.asking.length + list.working.length + list.queued.length;
201
+ return list;
202
+ }
203
+ /**
204
+ * `text` cut to fit `max` characters with its ellipsis: at the last whole word, unless that leaves
205
+ * less than `keep` of the room.
206
+ */
207
+ function shorten(text, max, keep) {
208
+ if (text.length <= max) return text;
209
+ const room = text.slice(0, max - 1);
210
+ const end = /\s/.test(text[max - 1]) ? room.length : room.lastIndexOf(' ');
211
+ return `${(end > max * keep ? room.slice(0, end) : room).replace(/[\s,.;:!?-]+$/, '')}…`;
212
+ }
213
+ /** A chore's name in the list: the first line of what the person typed, kept short. */
214
+ function choreTitle(text, max = 60) {
215
+ const line = (text.split('\n').find(l => l.trim()) ?? '').replace(/\[([^\]]*)\]\([^)]*\)/g, '$1').replace(/[*_`#>~]+/g, '').replace(/\s+/g, ' ').trim();
216
+ return line ? shorten(line, max, 0.6) : 'A chore for Lucy';
217
+ }
218
+ /** How long Lucy has been on one: "just now", "4 min", "1 hr 20 min". */
219
+ function elapsedLabel(ms) {
220
+ const minutes = Math.floor(Math.max(0, ms) / 60_000);
221
+ if (minutes < 1) return 'just now';
222
+ if (minutes < 60) return `${minutes} min`;
223
+ const hours = Math.floor(minutes / 60);
224
+ const rest = minutes % 60;
225
+ return rest ? `${hours} hr ${rest} min` : `${hours} hr`;
226
+ }
227
+ /**
228
+ * What a run the person stopped is settled with: the kit's `STOPPED_ERROR` (tasks/reconcile), which
229
+ * no later verdict revives. Repeated here because this file imports nothing at run time.
230
+ */
231
+ const STOPPED = 'Stopped';
232
+ /** The line under a chore's name in the list: where it stands, and since when. */
233
+ function choreLine(chore, now = Date.now()) {
234
+ const ended = agoLabel(chore.endedAt ?? chore.startedAt, now);
235
+ switch (chore.status) {
236
+ case 'asking':
237
+ return 'Lucy has a question for you';
238
+ case 'queued':
239
+ return 'Starts when Lucy finishes the one before';
240
+ case 'working':
241
+ {
242
+ const doing = chore.progress || (chore.background ? 'Still on it' : 'Getting started…');
243
+ return `${doing} · ${elapsedLabel(now - chore.startedAt)}`;
244
+ }
245
+ case 'done':
246
+ return `Done · ${ended}`;
247
+ default:
248
+ if (chore.stale) return `Stopped responding · ${ended}`;
249
+ return `${chore.error === STOPPED ? 'Stopped' : 'Didn’t finish'} · ${ended}`;
250
+ }
251
+ }
252
+ /** When one finished: "just now", "5 min ago", "2 hr ago", "yesterday", "3 days ago". */
253
+ function agoLabel(at, now = Date.now()) {
254
+ const minutes = Math.floor(Math.max(0, now - at) / 60_000);
255
+ if (minutes < 1) return 'just now';
256
+ if (minutes < 60) return `${minutes} min ago`;
257
+ const hours = Math.floor(minutes / 60);
258
+ if (hours < 24) return `${hours} hr ago`;
259
+ const days = Math.floor(hours / 24);
260
+ return days === 1 ? 'yesterday' : `${days} days ago`;
261
+ }
262
+ /**
263
+ * A reply as plain sentences, for the panel's look at a chore: no markdown marks, a link by its
264
+ * label, pictures left out (the panel draws them on their own), short enough to read at a glance.
265
+ */
266
+ function plainText(markdown, max = 600) {
267
+ const text = markdown.replace(/!\[[^\]]*\]\([^)]*\)/g, '').replace(/\[([^\]]*)\]\([^)]*\)/g, '$1').replace(/^[ \t]{0,3}#{1,6}[ \t]+/gm, '').replace(/^[ \t]*[-*+][ \t]+/gm, '• ').replace(/\*|__|`/g, '').replace(/[ \t]+\n/g, '\n').replace(/\n{3,}/g, '\n\n').trim();
268
+ return shorten(text, max, 0.8);
269
+ }export{ANSWER_KEPT,CHORE_LANE,CHORE_TURN_BUDGET_MS,CLOCKBOOK_SURFACE,DONE_FOR_MS,DONE_SHOWN,QUICK_ANSWER_MS,STOPPED,agoLabel,choreLine,choreList,choreTitle,choreTurns,elapsedLabel,plainText,turnFromJob,turnFromTask};//# sourceMappingURL=chores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chores.js","sources":["../../../../src/pages/Home/chat/chores.ts"],"sourcesContent":[null],"names":[],"mappings":"AAcA;AACO,MAAM,iBAAiB,GAAG;AACjC;AACO,MAAM,UAAU,GAAG;AAC1B;;;AAGG;AACU,MAAA,oBAAoB,GAAG,EAAE,GAAG;AACzC;AACO,MAAM,WAAW,GAAG;AAC3B;AACO,MAAM,UAAU,GAAG;AAC1B;AACa,MAAA,WAAW,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG;AACzC;;;AAGG;AACI,MAAM,eAAe,GAAG;AA2B/B;AACA,SAAS,OAAO,CAAC,MAAe,EAAA;AAC5B,EAAA,MAAA,IAAU,GAAA,MAAoD,EAAA;AAC9D,EAAA,OAAA,WAAkB,KAAA,QAAa,IAAA,SAAS,EAAI,GAAG,IAAE,GAAK;AAC1D;AAEgB,SAAA,YAAY,CAAC,IAAiB,EAAE,IAAa,EAAA;AACzD,EAAA,MAAA,IAAU,GAAA,OAAU,CAAA,IAAK,CAAA,MAAO,CAAA,IAAK,IAAA,CA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AAA,QAAA,KAAA,KAAA,CAAA,UAAA,GAAA,aAAA,GAAA,kBAAA,CAAA;AACH,gBAAgB,EAAS,KAAA,CAAA,kBAAyB,GAAG,GAAA,KAAA,CAAA,SAAA,CAAA,CAAA,CAAA;;AAE5C,IAAA,KAAA,MAAA;AACA,MAAA,OAAA,CAAA,OAAQ,EAAA,KAAA,CAAA,CAAA;AACR,IAAA;AACA,MAAA,IAAA,KAAA,CAAO,KAAC,EAAA,OAAA,CAAA,qBAA6B,EAAA,KAAA,CAAA,CAAA;AACrC,MAAA,OAAA,CAAA,EAAO,KAAC,CAAA,KAAU,KAAK,OAAA,GAAA,SAAA,GAAA,eAAA,CAAA,GAAA,EAAA,KAAA,CAAA,CAAA;AACvB;AACA;AACA;AACE,SAAA,QAAY,CAAE,IAAK,GAAA,GAAK,IAAA,CAAA,GAAA,EAAA,EAAA;AACnC,EAAC,MAAA,OAAA,GAAA,IAAA,CAAA,KAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,EAAA,GAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"lucy.d.ts","sourceRoot":"","sources":["../../../../src/pages/Home/chat/lucy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QAgBnB,CAAC"}
1
+ {"version":3,"file":"lucy.d.ts","sourceRoot":"","sources":["../../../../src/pages/Home/chat/lucy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QAoBnB,CAAC"}
@@ -4,4 +4,4 @@
4
4
  * (tools, connectors and skills stay as they are), once, when the session opens. It names the
5
5
  * skills that fit the page's chores; which one a request needs is still the model's call.
6
6
  */
7
- const LUCY_SYSTEM_PROMPT = ['You are Lucy, the assistant on Clockbook (clockbook.com). People come here to hand over the life admin that eats their', 'evenings: phone calls to companies (cancelling, lowering a bill, refunds, disputes, waiting on hold), scheduling calls and', 'appointments, bills and subscriptions, groceries and shopping, family logistics, home repairs and travel.', '', 'Do the chore with your tools, connectors and skills instead of telling the person how to do it themselves. Calling a', 'business for them is the yantra-phone-calls skill; putting a call, meeting or appointment on their calendar is the', 'yantra-calendar-booking skill. When a connector needs their account, ask them to connect it rather than asking for a', 'password or token.', '', 'Before anything that spends money, changes an account, or commits them to something they have not agreed to, say', 'exactly what you will do and wait for their yes. When one detail is missing (which provider, a city or ZIP, a time', 'window, the name on the account), ask for just that, in one short question.', '', 'Keep replies short and plain: what you did, what happened, and what is next. Never invent a phone number, a price or', 'an outcome.'].join('\n');export{LUCY_SYSTEM_PROMPT};//# sourceMappingURL=lucy.js.map
7
+ const LUCY_SYSTEM_PROMPT = ['You are Lucy, the assistant on Clockbook (clockbook.com). People come here to hand over the life admin that eats their', 'evenings: phone calls to companies (cancelling, lowering a bill, refunds, disputes, waiting on hold), scheduling calls and', 'appointments, bills and subscriptions, groceries and shopping, family logistics, home repairs and travel.', '', 'Do the chore with your tools, connectors and skills instead of telling the person how to do it themselves. Calling a', 'business for them is the yantra-phone-calls skill; putting a call, meeting or appointment on their calendar is the', 'yantra-calendar-booking skill. When a connector needs their account, ask them to connect it rather than asking for a', 'password or token.', '', 'Before anything that spends money, changes an account, or commits them to something they have not agreed to, say', 'exactly what you will do and ask for their yes with a question card (below), offering "Yes, go ahead" and "Not now";', 'do it only after a yes. When something is missing (which provider, a city or ZIP, a time window, the name on the', 'account) or there is a choice to make, ask with a question card too, the likely answers as its options, never in prose.', '', 'When you make something, show it rather than describe it: put each image on a line of its own as', '![a short caption](its https link), and each video or sound clip on a line of its own as [a short caption](its https link).', '', 'Keep replies short and plain: what you did, what happened, and what is next. Never invent a phone number, a price or', 'an outcome.'].join('\n');export{LUCY_SYSTEM_PROMPT};//# sourceMappingURL=lucy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lucy.js","sources":["../../../../src/pages/Home/chat/lucy.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;AAKG;AACU,MAAA,kBAAkB,GAAG,CAAA,wHAAA,EAAA,4HAAA,EAAA,2GAAA,EAAA,EAAA,EAAA,sHAAA,EAAA,oHAAA,EAAA,sHAAA,EAAA,oBAAA,EAAA,EAAA,EAAA,kHAAA,EAAA,oHAAA,EAAA,6EAAA,EAAA,EAAA,EAAA,sHAAA,EAAA,aAAA,CAAA,CAAA,IAAA,CAAA,IAAA"}
1
+ {"version":3,"file":"lucy.js","sources":["../../../../src/pages/Home/chat/lucy.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;AAKG;AACU,MAAA,kBAAkB,GAAG,CAAA,wHAAA,EAAA,4HAAA,EAAA,2GAAA,EAAA,EAAA,EAAA,sHAAA,EAAA,oHAAA,EAAA,sHAAA,EAAA,oBAAA,EAAA,EAAA,EAAA,kHAAA,EAAA,sHAAA,EAAA,kHAAA,EAAA,yHAAA,EAAA,EAAA,EAAA,kGAAA,EAAA,6HAAA,EAAA,EAAA,EAAA,sHAAA,EAAA,aAAA,CAAA,CAAA,IAAA,CAAA,IAAA"}
@@ -0,0 +1,15 @@
1
+ export interface PlayableMedia {
2
+ kind: 'video' | 'audio';
3
+ url: string;
4
+ label: string;
5
+ }
6
+ export interface ShownReply {
7
+ /** The reply without its envelopes, every image it made a figure of its own. */
8
+ content: string;
9
+ /** Videos and sound clips it made, to play under it. */
10
+ media: PlayableMedia[];
11
+ }
12
+ /** What an https link points at, by its path: a signed link's query string is not part of it. */
13
+ export declare function mediaKind(url: string): 'image' | 'video' | 'audio' | '';
14
+ export declare function showReply(content: string): ShownReply;
15
+ //# sourceMappingURL=media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../../src/pages/Home/chat/media.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACvB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,KAAK,EAAE,aAAa,EAAE,CAAC;CAC1B;AAgBD,iGAAiG;AACjG,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,EAAE,CAQvE;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAuBrD"}
@@ -0,0 +1,57 @@
1
+ import {parseChatWidget,formatChatImage}from'@yantra/surface-kit/chat';/**
2
+ * What the agent made, made visible in the chat. The kit's AgentChat draws an image only from
3
+ * `![caption](https link)` on a line of its own. The agent also hands media over as a
4
+ * `yantra:widget` envelope, which the kit strips and draws only where the host fills its `media`
5
+ * slot - Clockbook fills none, so the picture vanished - or as a plain link to the file. So each
6
+ * reply is put right before it is drawn: images become figures under its text, and videos and sound
7
+ * clips are lifted out for the chat to play under the reply (ChoresChat).
8
+ */
9
+ /** Images already drawn as figures: `![caption](src)`. */
10
+ const FIGURE = /!\[[^\]]*\]\(\s*(\S+?)\s*\)/g;
11
+ /** A plain link, not a figure: `[label](https://…)`. */
12
+ const LINK = /(?<!!)\[([^\]]*)\]\(\s*(https:\/\/[^\s)]+)\s*\)/g;
13
+ const EXTENSIONS = [['image', /\.(png|jpe?g|gif|webp|avif)$/i], ['video', /\.(mp4|webm|mov|m4v)$/i], ['audio', /\.(mp3|wav|m4a|aac|ogg|oga|flac|opus)$/i]];
14
+ function text(value) {
15
+ return typeof value === 'string' ? value.trim() : '';
16
+ }
17
+ /** What an https link points at, by its path: a signed link's query string is not part of it. */
18
+ function mediaKind(url) {
19
+ try {
20
+ const {
21
+ protocol,
22
+ pathname
23
+ } = new URL(url);
24
+ if (protocol !== 'https:') return '';
25
+ return EXTENSIONS.find(([, ext]) => ext.test(pathname))?.[0] ?? '';
26
+ } catch {
27
+ return '';
28
+ }
29
+ }
30
+ function showReply(content) {
31
+ const parsed = parseChatWidget(content);
32
+ const drawn = new Set(Array.from(parsed.content.matchAll(FIGURE), match => match[1]));
33
+ const figures = [];
34
+ const media = [];
35
+ // Only https ever loads, and each file shows once however many times the reply names it.
36
+ const add = (kind, url, label) => {
37
+ if (!url.toLowerCase().startsWith('https://') || drawn.has(url)) return;
38
+ if (kind === 'image') figures.push(formatChatImage(url, label || 'Image'));else if (kind === 'video' || kind === 'audio') media.push({
39
+ kind,
40
+ url,
41
+ label
42
+ });else return;
43
+ drawn.add(url);
44
+ };
45
+ for (const {
46
+ attachment
47
+ } of parsed.widgets) {
48
+ const url = text(attachment?.url) || text(attachment?.src);
49
+ const kind = text(attachment?.kind) || text(attachment?.type) || mediaKind(url);
50
+ add(kind, url, text(attachment?.title) || text(attachment?.alt) || text(attachment?.name));
51
+ }
52
+ for (const [, label, url] of parsed.content.matchAll(LINK)) add(mediaKind(url), url, text(label));
53
+ return {
54
+ content: figures.length ? `${parsed.content.trimEnd()}\n\n${figures.join('\n\n')}` : parsed.content,
55
+ media
56
+ };
57
+ }export{mediaKind,showReply};//# sourceMappingURL=media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.js","sources":["../../../../src/pages/Home/chat/media.ts"],"sourcesContent":[null],"names":[],"mappings":"uEAAA;;;;;;;AAOG;AAgBH;AACA,MAAM,MAAM,GAAG,8BAA8B;AAC7C;AACA,MAAM,IAAI,GAAG,kDAAkD;AAC/D,MAAM,UAAU,GAA6E,CAAA,CAAA,OAAA,EAAA,+BAAA,CAAA,EAAA,CAAA,OAAA,EAAA,wBAAA,CAAA,EAAA,CAAA,OAAA,EAAA,yCAAA,CAAA,CAAA;SACxF,IAAS,CAAA,KAAA,EAAA;SACT,OAAS,KAAA,KAAA,QAAA,GAAA,KAAyB,CAAA,IAAA,EAAA,GAAA,EAAA;;;AAI9B,SAAmB,SAAA,CAAA,GAAA,EAAA;AACxB,EAAA,IAAA;AACJ,IAAC,MAAA;AAED,MAAiG,QAAA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,GAAA,IAAA,CAAA,UAAA,EAAA,IAAA,CAAA,IAAA,IAAA,CAAA,UAAA,EAAA,IAAA,CAAA,IAAA,SAAA,CAAA,GAAA,CAAA;IACF,GAAK,CAAA,IAAA,EAAA,GAAQ,EAAU,IAAA,CAAA,UAAY,EAAA,KAAQ,CAAA,IAAA,IAAG,CAAA,UAAA,EAAA,GAAA,CAAA,IAAA,IAAA,CAAA,UAAA,EAAA,IAAA,CAAA,CAAA;AAC1C;aACM,GAAA,KAAO,EAAI,GAAC,WAAY,CAAA,OAAS,CAAA,QAAe,CAAA,IAAA,CAAA,EAAA,oBAAoB,GAAC,EAAI,IAAC,CAAA,KAAA,CAAA,CAAA;SAC7E;IACP,OAAC,EAAA,OAAA,CAAA,MAAA,GAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,OAAA,EAAA,CAAA,IAAA,EAAA,OAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,CAAA,OAAA;AACD,IAAA;AAA4D,GAAA;"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Where a chore's answer goes in the thread when it comes back without the page that asked: Lucy
3
+ * kept working with the tab closed, and the agent's report is what arrives (useChores). Both sides
4
+ * of every turn carry the turn's task id (ThreadMessage `task`), which is how the answer finds the
5
+ * reply it completes, or the message it answers.
6
+ */
7
+ import type { ThreadMessage } from './thread';
8
+ /** The task a message belongs to. It came back from storage, so it is checked like the rest. */
9
+ export declare function taskOf(message: {
10
+ task?: unknown;
11
+ }): string;
12
+ export interface PlacedReply {
13
+ /** For a reply that is added rather than rewritten. */
14
+ id: string;
15
+ createdAt: string;
16
+ content: string;
17
+ /** The chore to send again from "Try again", when the answer is that it did not go through. */
18
+ retry?: string;
19
+ }
20
+ /**
21
+ * The thread with a turn's answer in place: Lucy's reply to it rewritten with what she finished
22
+ * with, else a reply added right after the message that asked. Null when the turn is not in this
23
+ * thread, as after a new chat.
24
+ */
25
+ export declare function placeReply(messages: readonly ThreadMessage[], task: string, reply: PlacedReply): ThreadMessage[] | null;
26
+ /**
27
+ * What the chat says under a turn whose stream dropped while the agent had it: she is still on it,
28
+ * and the answer is on its way. Taken back off if the answer turns out to be a failure.
29
+ */
30
+ export declare const STILL_ON_IT = "The connection dropped, but Lucy is still on this. Her answer will show up here.";
31
+ /** What the chat says under a turn that came back with no words at all. A later answer takes it back. */
32
+ export declare const NO_ANSWER_REPLY = "Lucy did not get an answer back. Try sending that again.";
33
+ /** A turn that settled with nothing in this page streaming it (useChores), as the thread needs it. */
34
+ export interface SettledTurn {
35
+ task: string;
36
+ state: 'succeeded' | 'failed';
37
+ /** What Lucy finished with. */
38
+ answer?: string;
39
+ /** The agent's own verdict is that it could not finish, so it can be sent again. */
40
+ agentFailed?: boolean;
41
+ /** The person stopped it, and the thread already says so. */
42
+ stopped?: boolean;
43
+ /** What was asked, for "Try again". */
44
+ prompt: string;
45
+ }
46
+ /**
47
+ * The thread once a settled turn is in it, or null when nothing changes. Her answer takes the place
48
+ * of the reply that stopped short. Or she could not finish, and it can be sent again. Or its answer
49
+ * never came back, because the page that asked closed before anything reported on it: the chore may
50
+ * well have been done, so she is asked about it rather than told to do it again. A turn that
51
+ * finished with nothing to say takes back the chat's "did not get an answer back".
52
+ */
53
+ export declare function settleInThread(messages: readonly ThreadMessage[], turn: SettledTurn, added: {
54
+ id: string;
55
+ createdAt: string;
56
+ }): ThreadMessage[] | null;
57
+ /**
58
+ * The turn whose reply asks the question still waiting for an answer, '' when none does. The kit's
59
+ * rule (pendingAskUser): the last of Lucy's questions, with nothing from the person after it.
60
+ * `asks` says whether a reply holds a question card.
61
+ */
62
+ export declare function askingTurn(messages: readonly ThreadMessage[], asks: (content: string) => boolean): string;
63
+ //# sourceMappingURL=placement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placement.d.ts","sourceRoot":"","sources":["../../../../src/pages/Home/chat/placement.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAA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E,MAAM,KAAK,OAAO,GAAG,MAAM,CAOzG"}
@@ -0,0 +1,87 @@
1
+ /** The task a message belongs to. It came back from storage, so it is checked like the rest. */
2
+ function taskOf(message) {
3
+ return typeof message.task === 'string' ? message.task : '';
4
+ }
5
+ /**
6
+ * The thread with a turn's answer in place: Lucy's reply to it rewritten with what she finished
7
+ * with, else a reply added right after the message that asked. Null when the turn is not in this
8
+ * thread, as after a new chat.
9
+ */
10
+ function placeReply(messages, task, reply) {
11
+ if (!task) return null;
12
+ for (let i = messages.length - 1; i >= 0; i--) {
13
+ if (messages[i].role !== 'assistant' || taskOf(messages[i]) !== task) continue;
14
+ const next = [...messages];
15
+ next[i] = {
16
+ ...messages[i],
17
+ content: reply.content,
18
+ retry: reply.retry
19
+ };
20
+ return next;
21
+ }
22
+ const asked = messages.findIndex(m => m.role === 'user' && taskOf(m) === task);
23
+ if (asked < 0) return null;
24
+ const added = {
25
+ id: reply.id,
26
+ role: 'assistant',
27
+ content: reply.content,
28
+ createdAt: reply.createdAt,
29
+ task,
30
+ ...(reply.retry ? {
31
+ retry: reply.retry
32
+ } : {})
33
+ };
34
+ return [...messages.slice(0, asked + 1), added, ...messages.slice(asked + 1)];
35
+ }
36
+ /**
37
+ * What the chat says under a turn whose stream dropped while the agent had it: she is still on it,
38
+ * and the answer is on its way. Taken back off if the answer turns out to be a failure.
39
+ */
40
+ const STILL_ON_IT = 'The connection dropped, but Lucy is still on this. Her answer will show up here.';
41
+ /** What the chat says under a turn that came back with no words at all. A later answer takes it back. */
42
+ const NO_ANSWER_REPLY = 'Lucy did not get an answer back. Try sending that again.';
43
+ /**
44
+ * The thread once a settled turn is in it, or null when nothing changes. Her answer takes the place
45
+ * of the reply that stopped short. Or she could not finish, and it can be sent again. Or its answer
46
+ * never came back, because the page that asked closed before anything reported on it: the chore may
47
+ * well have been done, so she is asked about it rather than told to do it again. A turn that
48
+ * finished with nothing to say takes back the chat's "did not get an answer back".
49
+ */
50
+ function settleInThread(messages, turn, added) {
51
+ const said = [...messages].reverse().find(m => m.role === 'assistant' && taskOf(m) === turn.task);
52
+ if (turn.state === 'succeeded') {
53
+ if (turn.answer?.trim()) return placeReply(messages, turn.task, {
54
+ ...added,
55
+ content: turn.answer
56
+ });
57
+ if (!said?.retry) return null;
58
+ if (said.content === NO_ANSWER_REPLY) return messages.filter(m => m !== said);
59
+ return messages.map(m => m === said ? {
60
+ ...m,
61
+ retry: undefined
62
+ } : m);
63
+ }
64
+ if (turn.stopped) return null;
65
+ const before = (said?.content ?? '').replace(STILL_ON_IT, '').trim();
66
+ const note = turn.agentFailed ? 'Lucy couldn’t finish this one.' : 'The page closed before Lucy’s answer came back here. Ask her how it went.';
67
+ return placeReply(messages, turn.task, {
68
+ ...added,
69
+ content: before ? `${before}\n\n${note}` : note,
70
+ ...(turn.agentFailed ? {
71
+ retry: turn.prompt
72
+ } : {})
73
+ });
74
+ }
75
+ /**
76
+ * The turn whose reply asks the question still waiting for an answer, '' when none does. The kit's
77
+ * rule (pendingAskUser): the last of Lucy's questions, with nothing from the person after it.
78
+ * `asks` says whether a reply holds a question card.
79
+ */
80
+ function askingTurn(messages, asks) {
81
+ for (let i = messages.length - 1; i >= 0; i--) {
82
+ const message = messages[i];
83
+ if (message.role === 'user') return '';
84
+ if (message.role === 'assistant' && asks(message.content)) return taskOf(message);
85
+ }
86
+ return '';
87
+ }export{NO_ANSWER_REPLY,STILL_ON_IT,askingTurn,placeReply,settleInThread,taskOf};//# sourceMappingURL=placement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placement.js","sources":["../../../../src/pages/Home/chat/placement.ts"],"sourcesContent":[null],"names":[],"mappings":"AAQA;AACM,SAAU,MAAM,CAAC,OAA2B,EAAA;AAC9C,EAAA,OAAA,cAAqB,CAAA,IAAK,KAAA,WAAc,OAAE,CAAA,IAAY,GAAC,EAAE;AAC7D;AAWA;;;;AAIG;SACa,UAAU,CACtB,QAAkC,EAClC,IAAY,EACZ,KAAkB,EAAA;AAElB,EAAA,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EAAA,OAAA,EAAA;AACd,IAAC,IAAA,OAAA,CAAA,IAAA,KAAA,WAAA,IAAA,IAAA,CAAA,OAAA,CAAA,OAAA,CAAA,EAAA,OAAA,MAAA,CAAA,OAAA,CAAA;;;"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Stop, and New chat while Lucy works: the agent is told to stop the turn, not only the page to stop
3
+ * listening. A closed stream does not stop a turn. The agent finishes it and reports to the chore's
4
+ * record, which is what lets a chore outlive the page, so a chore stopped only here went on anyway
5
+ * and its record ended done while the chat said "Stopped".
6
+ *
7
+ * The agent runs one turn at a time on a session. A turn sent while another runs waits in its queue,
8
+ * and the word to stop (`/v1/chat/cancel`) reaches only the turn it is on: the one behind may start
9
+ * the moment that one stops, and go on with nobody listening. So a turn still waiting is listened to
10
+ * until the agent is heard on it, and is stopped then too. And when the agent refuses a turn rather
11
+ * than queue it, the kit moves the conversation to a fork of the session (`postAgentChatStream`'s
12
+ * stuck-session recovery): the turns under way can be on two sessions, each told on its own.
13
+ */
14
+ /** A turn this page is streaming. */
15
+ export interface LiveTurn {
16
+ controller: AbortController;
17
+ /** The session the agent runs it on; '' until it is known. */
18
+ sessionId: string;
19
+ /** When the agent was first heard on it (ms): it is on this turn, not holding it in its queue. */
20
+ heardAt?: number;
21
+ /** Settles once the agent has been told to stop it. Absent when nobody asked it to (signing out). */
22
+ stopped?: Promise<unknown>;
23
+ /** While a stopped turn waits in the agent's queue: called when the agent is first heard on it. */
24
+ onHeard?: () => void;
25
+ }
26
+ /** Tells the agent to stop the turn it is on in a session: the kit's `cancelAgentTurn`. */
27
+ export type CancelTurn = (sessionId: string) => Promise<unknown>;
28
+ /** How long a stopped turn waits for the agent to answer before it settles anyway. */
29
+ export declare const STOP_WAIT_MS = 4000;
30
+ /**
31
+ * How long a turn waiting in the agent's queue is listened to after a Stop, for the agent to start
32
+ * on it (and be stopped there) or let it go. Past this it is let go, and could still run.
33
+ */
34
+ export declare const QUEUED_HOLD_MS = 10000;
35
+ export interface StopOptions {
36
+ waitMs?: number;
37
+ holdMs?: number;
38
+ }
39
+ /**
40
+ * Stop every turn under way. On each session they run on, `cancel` tells the agent once to stop
41
+ * the turn it is on, which stops being listened to - as does one it was on before - and any turn
42
+ * waiting behind it is held (see the header). A turn whose session is not known yet has not
43
+ * reached the agent, so stopping the listening is enough. A turn already being stopped is left as
44
+ * it is. Resolves once each turn has its answer, or its time ran out.
45
+ */
46
+ export declare function stopTurns(turns: Iterable<LiveTurn>, cancel: CancelTurn, options?: StopOptions): Promise<void>;
47
+ //# sourceMappingURL=stop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../../../src/pages/Home/chat/stop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,qCAAqC;AACrC,MAAM,WAAW,QAAQ;IACrB,UAAU,EAAE,eAAe,CAAC;IAC5B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qGAAqG;IACrG,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3B,mGAAmG;IACnG,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,2FAA2F;AAC3F,MAAM,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEjE,sFAAsF;AACtF,eAAO,MAAM,YAAY,OAAQ,CAAC;AAClC;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAS,CAAC;AAErC,MAAM,WAAW,WAAW;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AA2CD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BjH"}