@agentshouse/mdruntime 0.1.0-c5d09b1c896fb → 0.1.0-c5f333dfa0583

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 (197) hide show
  1. package/AGENTS.md +225 -215
  2. package/README.md +9 -8
  3. package/dist/adapter.d.ts +64 -24
  4. package/dist/adapter.d.ts.map +1 -1
  5. package/dist/attached-model.d.ts +4 -1
  6. package/dist/attached-model.d.ts.map +1 -1
  7. package/dist/attached-model.js +13 -3
  8. package/dist/bootstrap.d.ts +15 -7
  9. package/dist/bootstrap.d.ts.map +1 -1
  10. package/dist/bootstrap.js +90 -61
  11. package/dist/chain.d.ts +11 -0
  12. package/dist/chain.d.ts.map +1 -0
  13. package/dist/chain.js +64 -0
  14. package/dist/change-set.d.ts +8 -9
  15. package/dist/change-set.d.ts.map +1 -1
  16. package/dist/change-set.js +10 -85
  17. package/dist/change.d.ts +31 -1
  18. package/dist/change.d.ts.map +1 -1
  19. package/dist/change.js +10 -1
  20. package/dist/chat/earlier.d.ts +10 -0
  21. package/dist/chat/earlier.d.ts.map +1 -0
  22. package/dist/chat/earlier.js +54 -0
  23. package/dist/chat/house.d.ts +25 -0
  24. package/dist/chat/house.d.ts.map +1 -0
  25. package/dist/chat/house.js +38 -0
  26. package/dist/chat/input.d.ts +3 -1
  27. package/dist/chat/input.d.ts.map +1 -1
  28. package/dist/chat/input.js +11 -18
  29. package/dist/chat/list.d.ts +2 -1
  30. package/dist/chat/list.d.ts.map +1 -1
  31. package/dist/chat/list.js +45 -5
  32. package/dist/chat/markdown.d.ts +1 -0
  33. package/dist/chat/markdown.d.ts.map +1 -1
  34. package/dist/chat/markdown.js +78 -20
  35. package/dist/chat/message.d.ts +1 -0
  36. package/dist/chat/message.d.ts.map +1 -1
  37. package/dist/chat/message.js +73 -11
  38. package/dist/chat/messages.d.ts +14 -1
  39. package/dist/chat/messages.d.ts.map +1 -1
  40. package/dist/chat/messages.js +79 -24
  41. package/dist/chat/name.d.ts +1 -0
  42. package/dist/chat/name.d.ts.map +1 -1
  43. package/dist/chat/name.js +1 -1
  44. package/dist/chat/opened.d.ts +1 -0
  45. package/dist/chat/opened.d.ts.map +1 -1
  46. package/dist/chat/opened.js +2 -0
  47. package/dist/chat/overlay.d.ts +1 -0
  48. package/dist/chat/overlay.d.ts.map +1 -1
  49. package/dist/chat/overlay.js +11 -5
  50. package/dist/chat/parts.d.ts +1 -0
  51. package/dist/chat/parts.d.ts.map +1 -1
  52. package/dist/chat/parts.js +3 -2
  53. package/dist/chat/pieces.d.ts +62 -0
  54. package/dist/chat/pieces.d.ts.map +1 -0
  55. package/dist/chat/pieces.js +1110 -0
  56. package/dist/chat/provider.d.ts +8 -1
  57. package/dist/chat/provider.d.ts.map +1 -1
  58. package/dist/chat/provider.js +98 -92
  59. package/dist/chat/question.d.ts +1 -1
  60. package/dist/chat/question.d.ts.map +1 -1
  61. package/dist/chat/question.js +7 -18
  62. package/dist/chat/ready.d.ts +5 -2
  63. package/dist/chat/ready.d.ts.map +1 -1
  64. package/dist/chat/ready.js +7 -5
  65. package/dist/chat/room-file.d.ts +8 -0
  66. package/dist/chat/room-file.d.ts.map +1 -0
  67. package/dist/chat/room-file.js +72 -0
  68. package/dist/chat/steady.d.ts +3 -0
  69. package/dist/chat/steady.d.ts.map +1 -0
  70. package/dist/chat/steady.js +26 -0
  71. package/dist/chat/style.d.ts.map +1 -1
  72. package/dist/chat/style.js +6 -1
  73. package/dist/chat.d.ts +3 -2
  74. package/dist/chat.d.ts.map +1 -1
  75. package/dist/chat.js +2 -2
  76. package/dist/client.d.ts +11 -2
  77. package/dist/client.d.ts.map +1 -1
  78. package/dist/client.js +45 -7
  79. package/dist/collection.d.ts +6 -19
  80. package/dist/collection.d.ts.map +1 -1
  81. package/dist/collection.js +30 -287
  82. package/dist/compile.d.ts +11 -0
  83. package/dist/compile.d.ts.map +1 -0
  84. package/dist/compile.js +712 -0
  85. package/dist/connection.d.ts +21 -8
  86. package/dist/connection.d.ts.map +1 -1
  87. package/dist/connection.js +2319 -688
  88. package/dist/conversation.d.ts +15 -3
  89. package/dist/conversation.d.ts.map +1 -1
  90. package/dist/conversation.js +233 -80
  91. package/dist/digest.d.ts +7 -0
  92. package/dist/digest.d.ts.map +1 -0
  93. package/dist/digest.js +113 -0
  94. package/dist/durability.d.ts +2 -1
  95. package/dist/durability.d.ts.map +1 -1
  96. package/dist/entry.d.ts +3 -1
  97. package/dist/entry.d.ts.map +1 -1
  98. package/dist/entry.js +18 -23
  99. package/dist/file.d.ts +2 -10
  100. package/dist/file.d.ts.map +1 -1
  101. package/dist/file.js +3 -120
  102. package/dist/host.d.ts +5 -4
  103. package/dist/host.d.ts.map +1 -1
  104. package/dist/host.js +55 -7
  105. package/dist/index.d.ts +8 -5
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +3 -0
  108. package/dist/live.d.ts +22 -0
  109. package/dist/live.d.ts.map +1 -0
  110. package/dist/live.js +123 -0
  111. package/dist/memory.d.ts +7 -3
  112. package/dist/memory.d.ts.map +1 -1
  113. package/dist/memory.js +39 -17
  114. package/dist/name.d.ts +4 -0
  115. package/dist/name.d.ts.map +1 -0
  116. package/dist/name.js +122 -0
  117. package/dist/observation.d.ts +14 -0
  118. package/dist/observation.d.ts.map +1 -1
  119. package/dist/observation.js +93 -3
  120. package/dist/opened.d.ts +22 -0
  121. package/dist/opened.d.ts.map +1 -0
  122. package/dist/opened.js +107 -0
  123. package/dist/outcome.d.ts +35 -4
  124. package/dist/outcome.d.ts.map +1 -1
  125. package/dist/outcome.js +28 -0
  126. package/dist/overlay.d.ts +2 -5
  127. package/dist/overlay.d.ts.map +1 -1
  128. package/dist/overlay.js +86 -171
  129. package/dist/query.d.ts +26 -2
  130. package/dist/query.d.ts.map +1 -1
  131. package/dist/query.js +34 -6
  132. package/dist/reach.d.ts +5 -1
  133. package/dist/reach.d.ts.map +1 -1
  134. package/dist/reach.js +167 -48
  135. package/dist/react.d.ts +1 -2
  136. package/dist/react.d.ts.map +1 -1
  137. package/dist/react.js +2 -14
  138. package/dist/readiness.d.ts +1 -1
  139. package/dist/readiness.d.ts.map +1 -1
  140. package/dist/reads.d.ts +11 -0
  141. package/dist/reads.d.ts.map +1 -0
  142. package/dist/reads.js +98 -0
  143. package/dist/recovery.d.ts +2 -2
  144. package/dist/recovery.d.ts.map +1 -1
  145. package/dist/recovery.js +8 -7
  146. package/dist/refresh.d.ts +12 -15
  147. package/dist/refresh.d.ts.map +1 -1
  148. package/dist/refresh.js +74 -51
  149. package/dist/replica.d.ts +55 -33
  150. package/dist/replica.d.ts.map +1 -1
  151. package/dist/replica.js +295 -186
  152. package/dist/room-draft.d.ts +3 -1
  153. package/dist/room-draft.d.ts.map +1 -1
  154. package/dist/room-draft.js +29 -22
  155. package/dist/rows.d.ts +29 -30
  156. package/dist/rows.d.ts.map +1 -1
  157. package/dist/rows.js +113 -64
  158. package/dist/save.d.ts +51 -14
  159. package/dist/save.d.ts.map +1 -1
  160. package/dist/save.js +518 -180
  161. package/dist/search.d.ts +19 -4
  162. package/dist/search.d.ts.map +1 -1
  163. package/dist/search.js +192 -35
  164. package/dist/seed.d.ts +16 -0
  165. package/dist/seed.d.ts.map +1 -0
  166. package/dist/seed.js +75 -0
  167. package/dist/shared.d.ts +8 -3
  168. package/dist/shared.d.ts.map +1 -1
  169. package/dist/shared.js +129 -66
  170. package/dist/store.d.ts +99 -71
  171. package/dist/store.d.ts.map +1 -1
  172. package/dist/store.js +461 -586
  173. package/dist/stored.d.ts +143 -0
  174. package/dist/stored.d.ts.map +1 -0
  175. package/dist/stored.js +561 -0
  176. package/dist/tables.d.ts +320 -0
  177. package/dist/tables.d.ts.map +1 -0
  178. package/dist/tables.js +537 -0
  179. package/dist/turn.d.ts +5 -3
  180. package/dist/turn.d.ts.map +1 -1
  181. package/dist/turn.js +51 -21
  182. package/dist/validation.d.ts +30 -0
  183. package/dist/validation.d.ts.map +1 -0
  184. package/dist/validation.js +162 -0
  185. package/dist/windows.d.ts +22 -0
  186. package/dist/windows.d.ts.map +1 -0
  187. package/dist/windows.js +89 -0
  188. package/dist/wire.d.ts +32 -0
  189. package/dist/wire.d.ts.map +1 -1
  190. package/dist/wire.js +8 -0
  191. package/package.json +10 -3
  192. package/dist/acquisition.d.ts +0 -14
  193. package/dist/acquisition.d.ts.map +0 -1
  194. package/dist/acquisition.js +0 -24
  195. package/dist/read-side.d.ts +0 -25
  196. package/dist/read-side.d.ts.map +0 -1
  197. package/dist/read-side.js +0 -642
@@ -0,0 +1,11 @@
1
+ import type { MdRuntimeClient } from './client.js';
2
+ import type { DocumentQuery, DocumentResult, GroupQuery, GroupResult, PendingResult } from './query.js';
3
+ type Rows = DocumentResult | GroupResult;
4
+ export type WindowAnswer = Rows | PendingResult;
5
+ export type WindowChain = {
6
+ want(count: number): void;
7
+ close(): void;
8
+ };
9
+ export declare function chainedWindows(runtime: MdRuntimeClient, query: DocumentQuery | GroupQuery, count: number, publish: (answers: readonly (WindowAnswer | null)[], settled: boolean) => void): WindowChain;
10
+ export {};
11
+ //# sourceMappingURL=chain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACX,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,KAAK,IAAI,GAAG,cAAc,GAAG,WAAW,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,aAAa,CAAC;AAEhD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAaF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,aAAa,GAAG,UAAU,EACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAC7E,WAAW,CAkEb"}
package/dist/chain.js ADDED
@@ -0,0 +1,64 @@
1
+ function answered(answer) {
2
+ return answer !== null && !('pending' in answer);
3
+ }
4
+ export function chainedWindows(runtime, query, count, publish) {
5
+ let links = [];
6
+ let wanted = count;
7
+ let closed = false;
8
+ const observe = runtime.observe;
9
+ const open = (after, shown) => {
10
+ const link = { after, observation: null, value: shown, fresh: false };
11
+ void observe('query', after === undefined ? query : { ...query, after }).then((observation) => {
12
+ if (closed || !links.includes(link)) {
13
+ observation.close();
14
+ return;
15
+ }
16
+ link.observation = observation;
17
+ const take = (value) => {
18
+ link.value = value;
19
+ link.fresh = true;
20
+ settle();
21
+ };
22
+ observation.subscribe(take);
23
+ take(observation.current());
24
+ }, () => { });
25
+ return link;
26
+ };
27
+ const settle = () => {
28
+ if (closed)
29
+ return;
30
+ const next = [];
31
+ for (let at = 0; at < wanted; at += 1) {
32
+ const before = next[at - 1];
33
+ if (before !== undefined && !before.fresh) {
34
+ next.push(...links.slice(at, wanted));
35
+ break;
36
+ }
37
+ if (before !== undefined && (!answered(before.value) || before.value.next === undefined)) {
38
+ break;
39
+ }
40
+ const after = before === undefined ? undefined : before.value.next;
41
+ const held = links[at];
42
+ next.push(held !== undefined && held.after === after ? held : open(after, held?.value ?? null));
43
+ }
44
+ for (const link of links)
45
+ if (!next.includes(link))
46
+ link.observation?.close();
47
+ links = next;
48
+ publish(links.map((link) => link.value), links.every((link) => link.fresh));
49
+ };
50
+ settle();
51
+ return {
52
+ want(count) {
53
+ if (count === wanted)
54
+ return;
55
+ wanted = count;
56
+ settle();
57
+ },
58
+ close() {
59
+ closed = true;
60
+ for (const link of links)
61
+ link.observation?.close();
62
+ },
63
+ };
64
+ }
@@ -1,10 +1,6 @@
1
- import { type Replica } from './replica.js';
2
- import { type Row } from './rows.js';
3
1
  export type DocumentChange = {
4
- locator: string;
5
- path: string;
6
- before: readonly Row[];
7
- after: readonly Row[];
2
+ readonly locator: string;
3
+ readonly path: string | null;
8
4
  };
9
5
  export type MessageChange = {
10
6
  conversation: string;
@@ -23,13 +19,16 @@ export type ChangeSet = {
23
19
  messages: readonly MessageChange[];
24
20
  conversations: readonly string[];
25
21
  };
26
- export declare function changeSet(locator: string, before: Replica | null, after: Replica | null, changed?: {
22
+ type Changed = {
23
+ documents?: readonly string[] | null;
27
24
  drafts?: readonly string[];
28
25
  room?: boolean;
29
26
  queue?: boolean;
30
27
  presentation?: string;
31
- }): ChangeSet;
32
- export declare function entering(locator: string, replica: Replica, paths: readonly string[]): ChangeSet;
28
+ };
29
+ export declare function changeSet(locator: string, changed?: Changed): ChangeSet;
33
30
  export declare function conversationChangeSet(messages: readonly MessageChange[], conversations: readonly string[]): ChangeSet;
34
31
  export declare function mergeChangeSets(sets: readonly ChangeSet[]): ChangeSet;
32
+ export declare function touches(set: ChangeSet, locator: string, path: string): boolean;
33
+ export {};
35
34
  //# sourceMappingURL=change-set.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiC,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAwB,KAAK,GAAG,EAAE,MAAM,WAAW,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,EAAE,CAAC;IACvB,KAAK,EAAE,SAAS,GAAG,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAA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passingFrontmatter } from './collection.js';
2
- import { binaryRecord } from './binary.js';
3
- import { changedPaths, sameBinary, sameChange } from './overlay.js';
4
- import { beneath } from './paths.js';
5
- import { compositionOf, sameMembership } from './replica.js';
6
- import { markdownPath, rowsOf } from './rows.js';
7
- function rowsAt(locator, replica, path) {
8
- if (replica === null)
9
- return [];
10
- const visible = replica.visible;
11
- const document = markdownPath(path) ? passingFrontmatter(visible.collection, path) : null;
12
- const held = visible.documents[path] !== undefined && document !== undefined;
13
- const binary = visible.binaries[path];
14
- if (!held && binary === undefined)
15
- return [];
16
- return rowsOf(locator, path, document ?? null, compositionOf(replica.confirmed.record), visible.changes[path] ?? null, visible.fileIds[path] ?? null, binary === undefined ? null : binaryRecord(path, binary, visible.revisions[path]));
17
- }
18
- function modelShape(model) {
19
- return model.status === 'unavailable' ? 'unavailable' : JSON.stringify(model.types);
20
- }
21
- export function changeSet(locator, before, after, changed = {}) {
22
- const documents = [];
23
- const oldRoom = before?.confirmed.record;
24
- const newRoom = after?.confirmed.record;
25
- const collectionChanged = oldRoom !== undefined &&
26
- newRoom !== undefined &&
27
- modelShape(oldRoom.model) !== modelShape(newRoom.model);
28
- const selectionChanged = oldRoom !== undefined &&
29
- newRoom !== undefined &&
30
- modelShape(oldRoom.selectionModel) !== modelShape(newRoom.selectionModel);
31
- const reclassified = oldRoom !== undefined && newRoom !== undefined && !sameMembership(oldRoom, newRoom);
32
- const paths = before === null || after === null || collectionChanged || selectionChanged || reclassified
33
- ? new Set([
34
- ...Object.keys(before?.visible.documents ?? {}),
35
- ...Object.keys(after?.visible.documents ?? {}),
36
- ...Object.keys(before?.visible.binaries ?? {}),
37
- ...Object.keys(after?.visible.binaries ?? {}),
38
- ])
39
- : changedPaths(before.visible, after.visible);
40
- for (const path of paths) {
41
- if (after?.visible.documents[path] === undefined &&
42
- after?.visible.binaries[path] === undefined &&
43
- before?.visible.documents[path] === undefined &&
44
- before?.visible.binaries[path] === undefined)
45
- continue;
46
- const selected = newRoom?.typedSelection?.roots.some((root) => beneath(root, path)) ?? false;
47
- const retyped = selected ? selectionChanged : collectionChanged;
48
- if (before?.visible.documents[path] === after?.visible.documents[path] &&
49
- sameBinary(before?.visible.binaries[path], after?.visible.binaries[path]) &&
50
- before?.visible.revisions[path] === after?.visible.revisions[path] &&
51
- before?.visible.fileIds[path] === after?.visible.fileIds[path] &&
52
- sameChange(before?.visible.changes[path], after?.visible.changes[path]) &&
53
- !retyped &&
54
- !reclassified)
55
- continue;
56
- documents.push({
57
- locator,
58
- path,
59
- get before() {
60
- return rowsAt(locator, before, path);
61
- },
62
- get after() {
63
- return rowsAt(locator, after, path);
64
- },
65
- });
66
- }
1
+ export function changeSet(locator, changed = {}) {
2
+ const documents = changed.documents;
67
3
  return {
68
- documents,
4
+ documents: documents === undefined
5
+ ? []
6
+ : documents === null
7
+ ? [{ locator, path: null }]
8
+ : documents.map((path) => ({ locator, path })),
69
9
  drafts: (changed.drafts ?? []).map((path) => ({ locator, path })),
70
10
  rooms: changed.room ? [locator] : [],
71
11
  queues: changed.queue ? [locator] : [],
@@ -74,24 +14,6 @@ export function changeSet(locator, before, after, changed = {}) {
74
14
  conversations: [],
75
15
  };
76
16
  }
77
- export function entering(locator, replica, paths) {
78
- return {
79
- documents: paths.map((path) => ({
80
- locator,
81
- path,
82
- before: [],
83
- get after() {
84
- return rowsAt(locator, replica, path);
85
- },
86
- })),
87
- drafts: [],
88
- rooms: [],
89
- queues: [],
90
- presentations: [],
91
- messages: [],
92
- conversations: [],
93
- };
94
- }
95
17
  export function conversationChangeSet(messages, conversations) {
96
18
  return {
97
19
  documents: [],
@@ -114,3 +36,6 @@ export function mergeChangeSets(sets) {
114
36
  conversations: [...new Set(sets.flatMap((set) => set.conversations))],
115
37
  };
116
38
  }
39
+ export function touches(set, locator, path) {
40
+ return set.documents.some((change) => change.locator === locator && (change.path === null || change.path === path));
41
+ }
package/dist/change.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { BinaryFile, HeadChange } from './adapter.js';
1
2
  export type Change = {
2
3
  readonly kind: 'field';
3
4
  readonly path: string;
@@ -29,7 +30,6 @@ export type Change = {
29
30
  readonly kind: 'binary';
30
31
  readonly path: string;
31
32
  readonly localId: string;
32
- readonly blob: Blob;
33
33
  readonly byteLength: number;
34
34
  readonly mediaType: string;
35
35
  readonly sha256: string;
@@ -40,6 +40,32 @@ export type Change = {
40
40
  } | {
41
41
  readonly kind: 'remove';
42
42
  readonly path: string;
43
+ } | (Arriving & {
44
+ readonly content: string;
45
+ }) | (Arriving & {
46
+ readonly binary: BinaryFile;
47
+ });
48
+ type Arriving = {
49
+ readonly kind: 'arrival';
50
+ readonly path: string;
51
+ readonly revision?: string;
52
+ readonly fileId?: string;
53
+ readonly change?: HeadChange;
54
+ };
55
+ export type RoomMove = {
56
+ readonly source: {
57
+ readonly room: string;
58
+ readonly baseRoomVersion: string;
59
+ };
60
+ readonly destination: {
61
+ readonly room: string;
62
+ readonly baseRoomVersion: string;
63
+ readonly handle: string;
64
+ };
65
+ readonly moves: readonly {
66
+ readonly path: string;
67
+ readonly to: string;
68
+ }[];
43
69
  };
44
70
  export type Precondition = {
45
71
  readonly kind: 'field';
@@ -81,9 +107,13 @@ export type ChangeBatch = {
81
107
  readonly changes: readonly Change[];
82
108
  readonly preconditions: readonly Precondition[];
83
109
  readonly writtenBy?: WrittenBy;
110
+ readonly between?: RoomMove;
84
111
  };
85
112
  export declare function immutable(batch: ChangeBatch): ChangeBatch;
113
+ export declare function partnerOf(batch: ChangeBatch, locator: string): string | null;
114
+ export declare function leaving(batch: ChangeBatch, locator: string): boolean;
86
115
  export declare function landing(changes: readonly Change[], index: number, path: string): string | null;
87
116
  export declare function departure(changes: readonly Change[], index: number): string;
88
117
  export declare function queuedFile(batch: ChangeBatch, path: string, localId: string): number;
118
+ export {};
89
119
  //# sourceMappingURL=change.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../src/change.ts"],"names":[],"mappings":"AAAA,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AM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,CAAC,EAAE,OAAO,YAAY,EAAE,iBAAiB,CAAC;IACpD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;CAC7B,CAAC;AAUF,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAEzD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI5E;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ9F;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAOpF"}
package/dist/change.js CHANGED
@@ -1,7 +1,7 @@
1
1
  function frozen(value) {
2
2
  if (Array.isArray(value))
3
3
  return Object.freeze(value.map((item) => frozen(item)));
4
- if (value === null || typeof value !== 'object' || value instanceof Blob)
4
+ if (value === null || typeof value !== 'object')
5
5
  return value;
6
6
  const copy = {};
7
7
  for (const [name, item] of Object.entries(value))
@@ -11,6 +11,15 @@ function frozen(value) {
11
11
  export function immutable(batch) {
12
12
  return frozen(batch);
13
13
  }
14
+ export function partnerOf(batch, locator) {
15
+ const between = batch.between;
16
+ if (between === undefined)
17
+ return null;
18
+ return between.source.room === locator ? between.destination.room : between.source.room;
19
+ }
20
+ export function leaving(batch, locator) {
21
+ return batch.between?.source.room === locator;
22
+ }
14
23
  export function landing(changes, index, path) {
15
24
  let at = path;
16
25
  for (const change of changes.slice(index + 1)) {
@@ -0,0 +1,10 @@
1
+ import type { MdRuntimeClient } from '../client.js';
2
+ import type { ConversationView } from '../conversation.js';
3
+ export declare const CHAT_WINDOW = 50;
4
+ export type Paged = {
5
+ readonly view: ConversationView | null;
6
+ readonly hasEarlier: boolean;
7
+ loadEarlier(): Promise<void>;
8
+ };
9
+ export declare function useEarlier(client: MdRuntimeClient, thread: string | null, held: ConversationView | null): Paged;
10
+ //# sourceMappingURL=earlier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"earlier.d.ts","sourceRoot":"","sources":["../../src/chat/earlier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,WAAW,KAAK,CAAC;AAU9B,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAuBF,wBAAgB,UAAU,CACxB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAC5B,KAAK,CA8BP"}
@@ -0,0 +1,54 @@
1
+ import { useCallback, useMemo, useState } from 'react';
2
+ export const CHAT_WINDOW = 50;
3
+ function slidOut(before, after) {
4
+ if (before === null || before.conversation !== after.conversation)
5
+ return [];
6
+ const kept = new Set(after.messages.map((one) => one.identity));
7
+ const left = [];
8
+ for (const message of before.messages) {
9
+ if (kept.has(message.identity))
10
+ break;
11
+ left.push(message);
12
+ }
13
+ return left;
14
+ }
15
+ function joined(held, earlier) {
16
+ const { next: _live, ...view } = held;
17
+ const live = new Set(held.messages.map((one) => one.identity));
18
+ return {
19
+ ...view,
20
+ messages: [...earlier.messages.filter((one) => !live.has(one.identity)), ...held.messages],
21
+ ...(earlier.next === undefined ? {} : { next: earlier.next }),
22
+ };
23
+ }
24
+ export function useEarlier(client, thread, held) {
25
+ const [earlier, setEarlier] = useState(null);
26
+ const [seen, setSeen] = useState(held);
27
+ const whole = held !== null && held.next === undefined;
28
+ let current = earlier !== null && earlier.thread === thread && !whole ? earlier : null;
29
+ if (current !== earlier)
30
+ setEarlier(current);
31
+ if (seen !== held) {
32
+ setSeen(held);
33
+ const carried = held === null ? [] : slidOut(seen, held);
34
+ if (thread !== null && carried.length > 0) {
35
+ const base = current ?? { thread, messages: [], next: seen?.next };
36
+ current = { ...base, messages: [...base.messages, ...carried] };
37
+ setEarlier(current);
38
+ }
39
+ }
40
+ const view = useMemo(() => (held === null || current === null ? held : joined(held, current)), [held, current]);
41
+ const next = current === null ? held?.next : current.next;
42
+ const loadEarlier = useCallback(async () => {
43
+ if (thread === null || next === undefined)
44
+ return;
45
+ const older = await client.conversation.read(thread, { limit: CHAT_WINDOW, after: next });
46
+ setEarlier((now) => {
47
+ const base = now !== null && now.thread === thread ? now : { thread, messages: [], next };
48
+ if (base.next !== next)
49
+ return now;
50
+ return { thread, messages: [...older.messages, ...base.messages], next: older.next };
51
+ });
52
+ }, [client, thread, next]);
53
+ return { view, hasEarlier: next !== undefined, loadEarlier };
54
+ }
@@ -0,0 +1,25 @@
1
+ export type HouseSource = {
2
+ readonly kind: 'request';
3
+ readonly request: string;
4
+ readonly routine: string;
5
+ readonly version: number;
6
+ readonly requester: {
7
+ readonly name: string;
8
+ readonly room: boolean;
9
+ };
10
+ readonly room: {
11
+ readonly ref: string;
12
+ readonly name: string;
13
+ };
14
+ readonly approved: string | null;
15
+ } | {
16
+ readonly kind: 'mail';
17
+ readonly agent: string;
18
+ readonly owner: string;
19
+ };
20
+ export type ChatRequest = {
21
+ readonly request: string;
22
+ readonly room: string;
23
+ };
24
+ export declare function sourceOf(value: unknown): HouseSource | null;
25
+ //# sourceMappingURL=house.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"house.d.ts","sourceRoot":"","sources":["../../src/chat/house.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GACnB;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;IACtE,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAgC9E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAO3D"}
@@ -0,0 +1,38 @@
1
+ import { record, text } from './read.js';
2
+ function requestOf(source) {
3
+ const request = text(source, 'request');
4
+ const routine = record(source.routine);
5
+ const name = text(routine, 'name');
6
+ const version = routine.version;
7
+ const requester = record(source.requester);
8
+ const by = text(requester, 'name');
9
+ const room = record(source.room);
10
+ const ref = text(room, 'ref');
11
+ const called = text(room, 'name');
12
+ if (request === null ||
13
+ name === null ||
14
+ typeof version !== 'number' ||
15
+ by === null ||
16
+ ref === null ||
17
+ called === null)
18
+ return null;
19
+ return {
20
+ kind: 'request',
21
+ request,
22
+ routine: name,
23
+ version,
24
+ requester: { name: by, room: text(requester, 'room') !== null },
25
+ room: { ref, name: called },
26
+ approved: text(source, 'approved_at'),
27
+ };
28
+ }
29
+ export function sourceOf(value) {
30
+ const source = record(value);
31
+ if (source.kind === 'request')
32
+ return requestOf(source);
33
+ if (source.kind !== 'mail')
34
+ return null;
35
+ const agent = text(record(source.agent), 'name');
36
+ const owner = text(record(source.owner), 'name');
37
+ return agent === null || owner === null ? null : { kind: 'mail', agent, owner };
38
+ }
@@ -1,9 +1,11 @@
1
1
  import { type ReactElement, type ReactNode } from 'react';
2
+ import type { ChatRequest } from './house.js';
2
3
  import { type ChatNoteProps } from './kit.js';
3
4
  export type ChatInputProps = {
4
5
  readonly messageLength?: number;
5
6
  readonly note?: (note: ChatNoteProps) => ReactNode;
6
7
  readonly autoFocus?: boolean;
8
+ readonly decision?: (request: ChatRequest) => ReactNode;
7
9
  };
8
- export declare function ChatInput({ messageLength, note, autoFocus, }: ChatInputProps): ReactElement;
10
+ export declare function ChatInput({ messageLength, note, autoFocus, decision, }: ChatInputProps): ReactElement;
9
11
  //# sourceMappingURL=input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/chat/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAqBlG,OAAO,EAAsD,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAMlG,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,SAAS,CAAC;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAiGF,wBAAgB,SAAS,CAAC,EACxB,aAAa,EACb,IAAY,EACZ,SAAiB,GAClB,EAAE,cAAc,GAAG,YAAY,CA+K/B"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/chat/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAmBlG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAsD,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAMlG,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,SAAS,CAAC;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,CAAC;CACzD,CAAC;AAgFF,wBAAgB,SAAS,CAAC,EACxB,aAAa,EACb,IAAY,EACZ,SAAiB,EACjB,QAAQ,GACT,EAAE,cAAc,GAAG,YAAY,CA4K/B"}
@@ -1,13 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext, useEffect, useMemo, useRef } from 'react';
3
- import { ComposerPrimitive, useAui, useAuiState, } from '@assistant-ui/react';
3
+ import { ComposerPrimitive, useAuiState, } from '@assistant-ui/react';
4
4
  import { DropdownMenu } from 'radix-ui';
5
5
  import ArrowUp from 'lucide-react/dist/esm/icons/arrow-up.mjs';
6
6
  import Check from 'lucide-react/dist/esm/icons/check.mjs';
7
7
  import ChevronDown from 'lucide-react/dist/esm/icons/chevron-down.mjs';
8
8
  import CornerDownRight from 'lucide-react/dist/esm/icons/corner-down-right.mjs';
9
9
  import ListEnd from 'lucide-react/dist/esm/icons/list-end.mjs';
10
- import Paperclip from 'lucide-react/dist/esm/icons/paperclip.mjs';
11
10
  import Pencil from 'lucide-react/dist/esm/icons/pencil.mjs';
12
11
  import Plus from 'lucide-react/dist/esm/icons/plus.mjs';
13
12
  import Square from 'lucide-react/dist/esm/icons/square.mjs';
@@ -42,10 +41,6 @@ function commandsFound(commands, query) {
42
41
  const within = commands.filter((one) => !named.includes(one) && one.name.toLowerCase().includes(asked));
43
42
  return [...named, ...within].map(commandItem);
44
43
  }
45
- function Attached({ id, name }) {
46
- const aui = useAui();
47
- return (_jsxs("span", { className: "ahc-chip ahc-chip--removable", children: [_jsx(Paperclip, { "aria-hidden": "true" }), _jsx(Name, { text: name }), _jsx(IconButton, { label: `Remove ${name}`, compact: true, onClick: () => void aui.composer().attachment({ id }).remove(), children: _jsx(X, { "aria-hidden": "true" }) })] }));
48
- }
49
44
  function Picker({ option, choose, }) {
50
45
  const container = useContext(Portal);
51
46
  return (_jsxs(DropdownMenu.Root, { modal: false, children: [_jsxs(DropdownMenu.Trigger, { className: "ahc-btn ahc-picker", "aria-label": option.name, title: option.name, children: [_jsx(Name, { text: option.values.find((one) => one.value === option.value)?.name ?? option.value }), _jsx(ChevronDown, { "aria-hidden": "true" })] }), _jsx(DropdownMenu.Portal, { container: container, children: _jsxs(DropdownMenu.Content, { className: "ahc-menu", side: "top", align: "start", children: [_jsx(DropdownMenu.Label, { className: "ahc-menu__heading", children: option.name }), _jsx(DropdownMenu.RadioGroup, { value: option.value, onValueChange: (value) => {
@@ -56,10 +51,10 @@ function Picker({ option, choose, }) {
56
51
  function noted(note) {
57
52
  return _jsx(ChatNote, { ...note });
58
53
  }
59
- export function ChatInput({ messageLength, note = noted, autoFocus = false, }) {
54
+ export function ChatInput({ messageLength, note = noted, autoFocus = false, decision, }) {
60
55
  const chat = useChat();
56
+ const { attach } = chat;
61
57
  const { client } = useChatScope();
62
- const aui = useAui();
63
58
  const opened = useOpened();
64
59
  const { lone, commands, context, queued, running } = opened;
65
60
  const conversation = chat.conversation ?? '';
@@ -71,7 +66,6 @@ export function ChatInput({ messageLength, note = noted, autoFocus = false, }) {
71
66
  input.current?.focus();
72
67
  }, [autoFocus, thread]);
73
68
  const typed = useAuiState((s) => s.composer.text);
74
- const attached = useAuiState((s) => s.composer.attachments.length > 0);
75
69
  const fault = messageLength !== undefined && typed.length > messageLength
76
70
  ? `Keep it to ${messageLength} characters.`
77
71
  : null;
@@ -88,12 +82,11 @@ export function ChatInput({ messageLength, note = noted, autoFocus = false, }) {
88
82
  chat.edit(id);
89
83
  input.current?.focus();
90
84
  };
91
- const drafted = typed.trim() !== '' || attached;
92
- const readOnly = opened.deleted;
93
- return (_jsx(Scoped, { children: _jsxs("div", { className: "ahc-input-area", children: [readOnly || queued.length === 0 ? null : (_jsxs("div", { role: "group", "aria-label": "Queued messages", className: "ahc-queue", children: [_jsxs("div", { className: "ahc-queue__head", children: [_jsx(ListEnd, { "aria-hidden": "true" }), _jsx("span", { className: "ahc-queue__said", children: `${queued.length} ${queued.length === 1 ? 'message waits' : 'messages wait'} for ${opened.name} to finish` }), running ? (_jsx(Button, { variant: "outline", compact: true, onClick: interrupt, children: "Send now" })) : null] }), queued.map((item) => (_jsxs("div", { className: "ahc-queue-row", children: [_jsx(CornerDownRight, { "aria-hidden": "true", className: "ahc-muted" }), _jsx("span", { className: "ahc-queue-row__text", children: item.text }), _jsx(IconButton, { label: "Edit queued message", compact: true, onClick: () => edit(item.id), children: _jsx(Pencil, { "aria-hidden": "true" }) }), _jsx(IconButton, { label: "Remove queued message", compact: true, onClick: () => chat.unqueue(item.id), children: _jsx(X, { "aria-hidden": "true" }) })] }, item.id)))] })), readOnly ? null : (_jsx(ComposerPrimitive.Root, { className: "ahc-composer", children: _jsxs(ComposerPrimitive.Unstable_TriggerPopoverRoot, { children: [commands.length === 0 ? null : (_jsxs(ComposerPrimitive.Unstable_TriggerPopover, { char: COMMAND, matcher: atStart, adapter: listed, "aria-label": "Commands", className: "ahc-menu ahc-commands", children: [_jsx(ComposerPrimitive.Unstable_TriggerPopover.Directive, { formatter: commanded }), _jsx(ComposerPrimitive.Unstable_TriggerPopoverItems, { children: (items) => items.map((item, index) => (_jsx(ComposerPrimitive.Unstable_TriggerPopoverItem, { item: item, index: index, className: "ahc-row ahc-row--two", children: _jsxs("span", { className: "ahc-row__label", children: [_jsx("span", { className: "ahc-row__title ahc-mono", children: item.label }), _jsx("span", { className: "ahc-row__sub", children: item.description })] }) }, item.id))) })] })), attached ? (_jsx("div", { className: "ahc-chips", children: _jsx(ComposerPrimitive.Attachments, { children: ({ attachment }) => _jsx(Attached, { id: attachment.id, name: attachment.name }) }) })) : null, _jsx(ComposerPrimitive.Input, { asChild: true, "aria-label": "Message", placeholder: lone === null ? `Message ${opened.name}` : lone.field.prompt, submitMode: fault === null ? 'enter' : 'none', children: _jsx("textarea", { ref: input, className: "ahc-composer__input", rows: 1 }) }), _jsxs("div", { className: "ahc-composer__bar", children: [_jsx(IconButton, { label: "Add files", onClick: () => picker.current?.click(), children: _jsx(Plus, { size: 20, "aria-hidden": "true" }) }), _jsx("input", { ref: picker, type: "file", multiple: true, hidden: true, onChange: (event) => {
94
- const chosen = [...(event.target.files ?? [])];
95
- event.target.value = '';
96
- for (const file of chosen)
97
- void aui.composer().addAttachment(file);
98
- } }), opened.options.map((option) => (_jsx(Picker, { option: option, choose: chat.choose }, option.id))), _jsx("span", { className: "ahc-spacer" }), context === null ? null : (_jsx("span", { title: "Context in use", className: "ahc-meta", children: contextText(context) })), running ? (_jsx("button", { type: "button", className: `ahc-btn ahc-btn--icon ${drafted ? 'ahc-btn--outline' : 'ahc-btn--ink'}`, "aria-label": "Stop", title: "Stop", onClick: interrupt, children: _jsx(Square, { "aria-hidden": "true" }) })) : null, running && !drafted ? null : (_jsx(ComposerPrimitive.Send, { className: "ahc-btn ahc-btn--icon ahc-btn--ink", "aria-label": running ? 'Queue message' : 'Send', disabled: fault !== null, children: _jsx(ArrowUp, { size: 20, "aria-hidden": "true" }) }))] })] }) })), fault === null ? null : (_jsx("p", { className: "ahc-note", role: "status", "data-state": "refused", children: fault })), note({ outcome: chat.acting.outcome }), note({ outcome: chat.sending.outcome, again: chat.sending.again ?? undefined })] }) }));
85
+ const drafted = typed.trim() !== '';
86
+ const readOnly = opened.deleted || opened.waits;
87
+ return (_jsx(Scoped, { children: _jsxs("div", { className: "ahc-input-area", children: [readOnly || queued.length === 0 ? null : (_jsxs("div", { role: "group", "aria-label": "Queued messages", className: "ahc-queue", children: [_jsxs("div", { className: "ahc-queue__head", children: [_jsx(ListEnd, { "aria-hidden": "true" }), _jsx("span", { className: "ahc-queue__said", children: `${queued.length} ${queued.length === 1 ? 'message waits' : 'messages wait'} for ${opened.name} to finish` }), running ? (_jsx(Button, { variant: "outline", compact: true, onClick: interrupt, children: "Send now" })) : null] }), queued.map((item) => (_jsxs("div", { className: "ahc-queue-row", children: [_jsx(CornerDownRight, { "aria-hidden": "true", className: "ahc-muted" }), _jsx("span", { className: "ahc-queue-row__text", children: item.text }), _jsx(IconButton, { label: "Edit queued message", compact: true, onClick: () => edit(item.id), children: _jsx(Pencil, { "aria-hidden": "true" }) }), _jsx(IconButton, { label: "Remove queued message", compact: true, onClick: () => chat.unqueue(item.id), children: _jsx(X, { "aria-hidden": "true" }) })] }, item.id)))] })), readOnly ? null : (_jsx(ComposerPrimitive.Root, { className: "ahc-composer", children: _jsxs(ComposerPrimitive.Unstable_TriggerPopoverRoot, { children: [commands.length === 0 ? null : (_jsxs(ComposerPrimitive.Unstable_TriggerPopover, { char: COMMAND, matcher: atStart, adapter: listed, "aria-label": "Commands", className: "ahc-menu ahc-commands", children: [_jsx(ComposerPrimitive.Unstable_TriggerPopover.Directive, { formatter: commanded }), _jsx(ComposerPrimitive.Unstable_TriggerPopoverItems, { children: (items) => items.map((item, index) => (_jsx(ComposerPrimitive.Unstable_TriggerPopoverItem, { item: item, index: index, className: "ahc-row ahc-row--two", children: _jsxs("span", { className: "ahc-row__label", children: [_jsx("span", { className: "ahc-row__title ahc-mono", children: item.label }), _jsx("span", { className: "ahc-row__sub", children: item.description })] }) }, item.id))) })] })), _jsx(ComposerPrimitive.Input, { asChild: true, "aria-label": "Message", placeholder: lone === null ? `Message ${opened.name}` : lone.field.prompt, submitMode: fault === null ? 'enter' : 'none', children: _jsx("textarea", { ref: input, className: "ahc-composer__input", rows: 1 }) }), _jsxs("div", { className: "ahc-composer__bar", children: [attach === null ? null : (_jsxs(_Fragment, { children: [_jsx(IconButton, { label: "Add files", onClick: () => picker.current?.click(), children: _jsx(Plus, { size: 20, "aria-hidden": "true" }) }), _jsx("input", { ref: picker, type: "file", multiple: true, hidden: true, onChange: (event) => {
88
+ const chosen = [...(event.target.files ?? [])];
89
+ event.target.value = '';
90
+ void attach(chosen);
91
+ } })] })), opened.options.map((option) => (_jsx(Picker, { option: option, choose: chat.choose }, option.id))), _jsx("span", { className: "ahc-spacer" }), context === null ? null : (_jsx("span", { title: "Context in use", className: "ahc-meta", children: contextText(context) })), running ? (_jsx("button", { type: "button", className: `ahc-btn ahc-btn--icon ${drafted ? 'ahc-btn--outline' : 'ahc-btn--ink'}`, "aria-label": "Stop", title: "Stop", onClick: interrupt, children: _jsx(Square, { "aria-hidden": "true" }) })) : null, running && !drafted ? null : (_jsx(ComposerPrimitive.Send, { className: "ahc-btn ahc-btn--icon ahc-btn--ink", "aria-label": running ? 'Queue message' : 'Send', disabled: fault !== null, children: _jsx(ArrowUp, { size: 20, "aria-hidden": "true" }) }))] })] }) })), opened.deleted || opened.waiting === null ? null : decision?.(opened.waiting), fault === null ? null : (_jsx("p", { className: "ahc-note", role: "status", "data-state": "refused", children: fault })), note({ outcome: chat.acting.outcome }), note({ outcome: chat.sending.outcome, again: chat.sending.again ?? undefined })] }) }));
99
92
  }
@@ -1,4 +1,5 @@
1
1
  import { type ComponentType, type ReactElement, type ReactNode } from 'react';
2
+ import type { ChatState } from './provider.js';
2
3
  export type AgentLook = {
3
4
  readonly AgentLink?: ComponentType<{
4
5
  agent: string;
@@ -17,7 +18,7 @@ export type ChatMessageListProps = {
17
18
  };
18
19
  readonly onLink?: (href: string) => void;
19
20
  readonly footer?: ReactNode;
20
- readonly waiting?: string | null;
21
+ readonly waiting?: (chat: ChatState) => string | null;
21
22
  readonly children?: ReactNode;
22
23
  };
23
24
  export declare function ChatMessageList({ components, onLink, footer, waiting, children, }: ChatMessageListProps): ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/chat/list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAaf,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,SAAS,CAAC,EACf,aAAa,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,SAAS,CAAC;QACpB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;KACpC,CAAC,GACF,SAAS,CAAC;IACd,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;IAC9E,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAA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