agent-yes 1.303.1 → 1.304.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.
Files changed (184) hide show
  1. package/README.md +54 -0
  2. package/default.config.yaml +5 -5
  3. package/dist/{JsonlStore-BpYZZTap.js → JsonlStore-CB_0sfdT.js} +5 -4
  4. package/dist/{SUPPORTED_CLIS-Dq9Lq9WJ.js → SUPPORTED_CLIS-C_1IiOj3.js} +2 -2
  5. package/dist/SUPPORTED_CLIS-Do3GHAY1.js +12 -0
  6. package/dist/{agentShare-suB6yPgO.js → agentShare-BvpEm-Fr.js} +10 -9
  7. package/dist/{askCli-BU3CNCLU.js → askCli-KmMf-3wA.js} +6 -6
  8. package/dist/{browser-BmxN1Ur9.js → browser-BAFPmEvN.js} +2 -2
  9. package/dist/{callback-Ctj3_Wxp.js → callback-BiSUhjw7.js} +6 -6
  10. package/dist/callback-SqLD2mMX.js +17 -0
  11. package/dist/{callbackCore-DSJWhqAe.js → callbackCore-BZ_10zyc.js} +1 -1
  12. package/dist/{callbackCore-BesbQ6-Z.js → callbackCore-Deve5pv3.js} +1 -1
  13. package/dist/{channels-j5nWuzlQ.js → channels-Y36S0ccW.js} +2 -2
  14. package/dist/cli.js +118 -13
  15. package/dist/{cmdDsh-2LP0grim.js → cmdDsh-DZ8bLsH7.js} +1 -1
  16. package/dist/cmdKill-CzSBfWmx.js +116 -0
  17. package/dist/{cmdPs-wc1j85fi.js → cmdPs-DBt23Qz0.js} +11 -10
  18. package/dist/{cwdConflictWarn-skQSMwEh.js → cwdConflictWarn-y-epQyOj.js} +21 -5
  19. package/dist/{cwdPassthroughHint-BUbWMoz0.js → cwdPassthroughHint-CzWh0hrw.js} +1 -1
  20. package/dist/{expose-Dawq1LxC.js → expose-Bhsn5yUz.js} +2 -2
  21. package/dist/forceKill-BDqxx4uQ.js +44 -0
  22. package/dist/{forkNested-CavHyWzA.js → forkNested-3heLs5XC.js} +45 -5
  23. package/dist/{globalPidIndex-CRB5KtyL.js → globalPidIndex-BsjlId-h.js} +6 -5
  24. package/dist/{globalPidIndex-BftWlg2V.js → globalPidIndex-uoz8Esqz.js} +2 -2
  25. package/dist/{hist-Cs0KFSUW.js → hist-DY16wm7g.js} +1 -1
  26. package/dist/{identity-DA7YI9km.js → identity-C0MxfwI2.js} +1 -1
  27. package/dist/{identity-Bk-aG_xl.js → identity-Ckav3-Up.js} +1 -1
  28. package/dist/index.js +7 -7
  29. package/dist/{initMsg-CcTqFtsp.js → initMsg-BEVDWYnv.js} +1 -1
  30. package/dist/{initMsg-D9KJnfgC.js → initMsg-GPU52N-j.js} +1 -1
  31. package/dist/liagent/box-BSIrRRc_.js +2320 -0
  32. package/dist/liagent/box-DloywR57.d.ts +409 -0
  33. package/dist/liagent/box.d.ts +3 -0
  34. package/dist/liagent/box.js +3 -0
  35. package/dist/liagent/cli.d.ts +1 -0
  36. package/dist/liagent/cli.js +908 -0
  37. package/dist/liagent/client.d.ts +28 -0
  38. package/dist/liagent/client.js +240 -0
  39. package/dist/liagent/echo-BvzPSI0x.js +86 -0
  40. package/dist/liagent/echo-W2RcMEny.d.ts +38 -0
  41. package/dist/liagent/hub.d.ts +405 -0
  42. package/dist/liagent/hub.js +1831 -0
  43. package/dist/liagent/index.d.ts +14 -0
  44. package/dist/liagent/index.js +10 -0
  45. package/dist/liagent/liagent.js +339 -0
  46. package/dist/liagent/mic-audio-C3Shud_F.js +754 -0
  47. package/dist/liagent/mic-audio-DMCWtEI-.d.ts +317 -0
  48. package/dist/liagent/mic-button-CtZHFBSG.js +651 -0
  49. package/dist/liagent/mic-button-Y0ioPetQ.d.ts +248 -0
  50. package/dist/liagent/mic.d.ts +3 -0
  51. package/dist/liagent/mic.js +4 -0
  52. package/dist/liagent/progress-CJs08bXb.js +473 -0
  53. package/dist/liagent/progress-CfE-meHr.d.ts +205 -0
  54. package/dist/liagent/progress.d.ts +2 -0
  55. package/dist/liagent/progress.js +3 -0
  56. package/dist/liagent/protocol.d.ts +324 -0
  57. package/dist/liagent/protocol.js +504 -0
  58. package/dist/liagent/speech-rate-DXeJjRTc.js +42 -0
  59. package/dist/liagent/state-tree-BZCmAknI.js +353 -0
  60. package/dist/liagent/tree-BrR7NwMf.js +710 -0
  61. package/dist/liagent/tree-HB9RhX_H.d.ts +295 -0
  62. package/dist/liagent/tree.d.ts +2 -0
  63. package/dist/liagent/tree.js +4 -0
  64. package/dist/liagent/ui-strings-B03le3fh.d.ts +27 -0
  65. package/dist/liagent/ui-strings-CJIwW5Gf.js +794 -0
  66. package/dist/liagent/ui.d.ts +394 -0
  67. package/dist/liagent/ui.js +5 -0
  68. package/dist/liagent/voice-D7yeS9VM.js +802 -0
  69. package/dist/liagent/voice-Qo7SCgi8.d.ts +308 -0
  70. package/dist/liagent/voice.d.ts +3 -0
  71. package/dist/liagent/voice.js +4 -0
  72. package/dist/{notifyDaemon-C7GlfJ1E.js → notifyDaemon-DkUB7GV2.js} +10 -9
  73. package/dist/{openBrowser-1cIo4dJL.js → openBrowser-CQAOIrD6.js} +1 -1
  74. package/dist/oxmgrService-DlYHmqyI.js +37 -0
  75. package/dist/oxmgrService-o9L3I6FX.js +3 -0
  76. package/dist/{parentLink-DoEWVGld.js → parentLink-BcAYcO9L.js} +2 -2
  77. package/dist/{parentLink-B58V1RVd.js → parentLink-MBUD3oY2.js} +2 -2
  78. package/dist/{parentPingLoop-C73bbmCE.js → parentPingLoop-DDO592Wh.js} +5 -5
  79. package/dist/{pidStore-433kvh9D.js → pidStore-C50VPk3E.js} +3 -3
  80. package/dist/pidStore-COkPjpW8.js +6 -0
  81. package/dist/{procStats-BvmrBrOs.js → procStats-DwTxj3rs.js} +1 -1
  82. package/dist/{remotes-MfdV9M8u.js → remotes-BqLoB5GR.js} +2 -2
  83. package/dist/{remotes-DevcBeLl.js → remotes-BsMGvAay.js} +3 -3
  84. package/dist/{roomReplyAlias-DFqg_6IU.js → roomReplyAlias-B-v76TA8.js} +3 -3
  85. package/dist/roomReplyAlias-BzWUBkQy.js +6 -0
  86. package/dist/{rustBinary-7VK7oLlW.js → rustBinary-BrJ2p8wy.js} +2 -2
  87. package/dist/{rustBinary-BV4LxMMn.js → rustBinary-vpfpWj1q.js} +2 -2
  88. package/dist/{schedule-Dp0qkNO1.js → schedule-Bzjhl6-h.js} +15 -44
  89. package/dist/schedulesCli-CLqieyQZ.js +784 -0
  90. package/dist/senderAncestry-CVHeKk1Y.js +173 -0
  91. package/dist/senderAncestry-KhAUPCQs.js +3 -0
  92. package/dist/{serve-BpOIIOVc.js → serve-XwFYE0cE.js} +67 -69
  93. package/dist/{serveRust-CbBrcUrg.js → serveRust-BfWkeL6T.js} +31 -4
  94. package/dist/{setup-DdIBk6Iv.js → setup-D4-s2VZw.js} +5 -5
  95. package/dist/{share-w5oRbvlj.js → share-CbFetL5H.js} +1 -1
  96. package/dist/{share-DrS3LYqf.js → share-_TPYAGWC.js} +1 -1
  97. package/dist/{shareCmd-DDENkBW2.js → shareCmd-DUBsVI3e.js} +10 -10
  98. package/dist/spawnGate-Dfj9V76w.js +5 -0
  99. package/dist/{spawnGate-lr3tvA6U.js → spawnGate-Dj_WaS29.js} +3 -3
  100. package/dist/{subcommands-DxgvDmZX.js → subcommands-B7YZJL8n.js} +471 -307
  101. package/dist/subcommands-BZPxFgkT.js +15 -0
  102. package/dist/{systemPathLink-SjUzgSiq.js → systemPathLink-Y3iC7bYV.js} +1 -1
  103. package/dist/{terminal-C2h7tpe0.js → terminal-13cGj3h6.js} +2 -2
  104. package/dist/terminal.js +1 -1
  105. package/dist/{todoAutomation-TTp_Qz9G.js → todoAutomation-CKlrxuZv.js} +2 -2
  106. package/dist/{todoCli-BWm5nZE0.js → todoCli-CU9vSJSJ.js} +6 -6
  107. package/dist/{todoIdentity-BvXZKWJI.js → todoIdentity-CzS1e7VL.js} +2 -2
  108. package/dist/{todoStore-C9RTz0Vs.js → todoStore-msRCEUi1.js} +2 -2
  109. package/dist/{tray-BeRSozJz.js → tray-CLktEN3G.js} +1 -1
  110. package/dist/{trayApp-QQjqhDv1.js → trayApp-5_OlvQcz.js} +2 -2
  111. package/dist/trayApp-DkAPo0m6.js +5 -0
  112. package/dist/{ts-6LF7f4fx.js → ts-njuddXQz.js} +126 -57
  113. package/dist/{versionChecker-Bc62HNf6.js → versionChecker-BJycAanp.js} +2 -2
  114. package/dist/{webrtcLink-va_gAR77.js → webrtcLink-DcvacEci.js} +1 -1
  115. package/dist/{webrtcLink-SsInrVHU.js → webrtcLink-WxS1nTIs.js} +1 -1
  116. package/dist/{webrtcRemote-BlGyNZDC.js → webrtcRemote-C3xQyf3u.js} +2 -2
  117. package/dist/{widget-Crb5zeHL.js → widget-DmRwOlco.js} +3 -3
  118. package/dist/widgets.js +1 -1
  119. package/dist/{workspaceConfig-BLWB5Wu9.js → workspaceConfig-DBgsu81B.js} +1 -1
  120. package/dist/{ws-DIbwNz8Z.js → ws-ByO6JO6m.js} +3 -3
  121. package/dist/{ws-BRhPG1Vy.js → ws-D0-Jg88z.js} +9 -8
  122. package/lab/ui/index.html +1 -1
  123. package/lab/ui/lab/posts/2026-08-11-slack-term-safe-writes.md +1 -1
  124. package/package.json +73 -8
  125. package/ts/JsonlStore.ts +10 -3
  126. package/ts/cli-idle.bun.spec.ts +1 -1
  127. package/ts/cli-idle.spec.ts +1 -1
  128. package/ts/cli.ts +35 -0
  129. package/ts/cmdKill.bun.spec.ts +155 -0
  130. package/ts/cmdKill.spec.ts +155 -0
  131. package/ts/cmdKill.ts +183 -0
  132. package/ts/composerGuard.edges.spec.ts +91 -0
  133. package/ts/composerGuard.spec.ts +53 -6
  134. package/ts/composerGuard.ts +42 -13
  135. package/ts/conptyModeFilter.spec.ts +30 -0
  136. package/ts/conptyModeFilter.ts +53 -0
  137. package/ts/copyLiagent.ts +42 -0
  138. package/ts/cwdConflictWarn.io.spec.ts +50 -0
  139. package/ts/cwdConflictWarn.spec.ts +34 -1
  140. package/ts/cwdConflictWarn.ts +43 -5
  141. package/ts/cwdGuard.spec.ts +110 -0
  142. package/ts/cwdGuard.ts +118 -0
  143. package/ts/forceKill.ts +52 -0
  144. package/ts/forkNested.bun.spec.ts +41 -0
  145. package/ts/forkNested.spec.ts +41 -0
  146. package/ts/forkNested.ts +48 -1
  147. package/ts/globalPidIndex.edges.spec.ts +125 -0
  148. package/ts/globalPidIndex.ts +6 -2
  149. package/ts/index.ts +13 -1
  150. package/ts/interruptSend.bun.spec.ts +99 -0
  151. package/ts/interruptSend.spec.ts +99 -0
  152. package/ts/interruptSend.ts +51 -0
  153. package/ts/lockRegistry.spec.ts +49 -0
  154. package/ts/lsRenderCache.spec.ts +58 -0
  155. package/ts/needsInput.edges.spec.ts +23 -0
  156. package/ts/parseCliArgs.ts +7 -0
  157. package/ts/pushGatePlan.spec.ts +147 -0
  158. package/ts/roomReplyAlias.io.spec.ts +81 -0
  159. package/ts/schedule.ts +5 -1
  160. package/ts/schedules.bun.spec.ts +397 -0
  161. package/ts/schedules.spec.ts +397 -0
  162. package/ts/schedules.ts +517 -0
  163. package/ts/schedulesCli.ts +386 -0
  164. package/ts/sendControl.bun.spec.ts +12 -0
  165. package/ts/senderAncestry.ts +1 -3
  166. package/ts/serve.ts +22 -33
  167. package/ts/serveRust.spec.ts +29 -2
  168. package/ts/serveRust.ts +27 -2
  169. package/ts/sizeNego.bun.spec.ts +9 -2
  170. package/ts/sizeNego.spec.ts +9 -2
  171. package/ts/sizeNego.ts +10 -5
  172. package/ts/subcommands.spec.ts +348 -9
  173. package/ts/subcommands.ts +513 -93
  174. package/ts/suggestAgents.spec.ts +33 -0
  175. package/ts/terminal/browser.ts +1 -1
  176. package/ts/todoParse.spec.ts +22 -1
  177. package/ts/todoParse.ts +19 -0
  178. package/dist/SUPPORTED_CLIS-ByO5twge.js +0 -12
  179. package/dist/callback-D7qfh_7p.js +0 -16
  180. package/dist/pidStore-BRlKRHXY.js +0 -6
  181. package/dist/roomReplyAlias-DuEkSSDI.js +0 -6
  182. package/dist/spawnGate-DeQBTX-o.js +0 -5
  183. package/dist/subcommands-DmiswRy4.js +0 -14
  184. package/dist/trayApp-C4TAvRvU.js +0 -5
@@ -0,0 +1,394 @@
1
+ import { T as Frontier, w as Assignee } from "./tree-HB9RhX_H.js";
2
+ import { a as isZh, i as UiStrings, n as UI_EN, o as treeDefaults, r as UI_ZH, s as uiStrings, t as TREE_ZH } from "./ui-strings-B03le3fh.js";
3
+ import { a as dice, c as normalizeEcho, i as EchoScore, n as ECHO_SIMILARITY, o as echoScore, r as ECHO_WINDOW_MS, s as grams, t as ECHO_MIN_CHARS } from "./echo-W2RcMEny.js";
4
+
5
+ //#region src/tree-nav.d.ts
6
+ /**
7
+ * Navigating a tree by detents: a pure reducer, `treeNav(state, event)`.
8
+ * Generic: any tree (the chat box's tree view uses it).
9
+ *
10
+ * The view: at each level the collapsed siblings sit in a row of chips; one
11
+ * node is expanded at a time along one branch (an accordion), its subtree
12
+ * shown `expanded[id]` levels deep. A focused node takes the gestures.
13
+ *
14
+ * - Dragging right by k cells expands the focused node one level per cell,
15
+ * up to `maxDetent` (min(3, its subtree's height)); a leaf can't expand.
16
+ * - Dragging left collapses one level per cell: first the focused node's own
17
+ * depth, deepest level first; past its own level the focus moves to its
18
+ * parent, whose depth then drops by one; at a top-level chip with nothing
19
+ * expanded there is nothing left to collapse.
20
+ * - At either limit the reducer stops: no wrap-around, the SAME state object
21
+ * back (or once, the state with `atLimit` set), so the view can rubber-band.
22
+ * - A drag previews (`preview`) and commits only on `dragEnd`.
23
+ *
24
+ * It is not a counter: the result depends on the path (the focus moves, and
25
+ * each node has its own depth), so "expand 2 then collapse 1" and "collapse 1
26
+ * then expand 2" can differ.
27
+ */
28
+ /** The tree as the reducer sees it: ids, parents, children in order. */
29
+ type NavIndex = {
30
+ roots: string[];
31
+ parent: Map<string, string | null>;
32
+ children: Map<string, string[]>;
33
+ };
34
+ /** Build a NavIndex from any tree. */
35
+ declare function indexTree<N>(roots: readonly N[], childrenOf: (n: N) => readonly N[], idOf: (n: N, parentId: string | null, i: number) => string): NavIndex;
36
+ /** Levels below a node: 0 for a leaf. */
37
+ declare function height(ix: NavIndex, id: string): number;
38
+ /** How deep a node can open: min(3, its subtree's height); 0 for a leaf. */
39
+ declare const MAX_DETENT = 3;
40
+ declare function maxDetent(ix: NavIndex, id: string): number;
41
+ type TreeNavState = {
42
+ focusId: string | null; /** Depth per node, along one branch (the accordion). */
43
+ expanded: Readonly<Record<string, number>>; /** The drag's cells so far (signed), 0 when not dragging. */
44
+ detent: number; /** Hit a limit on the last step: the view resists. */
45
+ atLimit?: "max" | "min"; /** While dragging: the committed state the drag started from. */
46
+ base?: TreeNavState;
47
+ };
48
+ type TreeNavEvent = {
49
+ type: "dragStart";
50
+ } | {
51
+ type: "dragMove";
52
+ cells: number;
53
+ } | {
54
+ type: "dragEnd";
55
+ } | {
56
+ type: "dragCancel";
57
+ } | {
58
+ type: "tapChip";
59
+ id: string;
60
+ } | {
61
+ type: "key";
62
+ key: string;
63
+ } | {
64
+ type: "collapseAll";
65
+ };
66
+ declare const initialNav: (ix: NavIndex) => TreeNavState;
67
+ /** Is a node on screen: a top-level chip, or within an expanded ancestor's depth. */
68
+ declare function isVisible(ix: NavIndex, s: Pick<TreeNavState, "expanded">, id: string): boolean;
69
+ declare function treeNav(ix: NavIndex, s: TreeNavState, ev: TreeNavEvent): TreeNavState;
70
+ /** One detent of the tree button's drag: about the button's width. */
71
+ declare const TREE_DETENT_PX = 40;
72
+ /** How many cells a single drag can reach each way. */
73
+ declare const TREE_DRAG_CELLS = 6;
74
+ /** The tree drag's feel: the card swipe's snap and hysteresis (detent.ts). */
75
+ declare const TREE_HYSTERESIS = 0.1;
76
+ declare const TREE_SNAP = 0.6;
77
+ declare const TREE_STRETCH = 0.3;
78
+ /** Cells of a horizontal drag `dx`, from the cells it was at (hysteresis). */
79
+ declare function dragCells(dx: number, from: number): number;
80
+ /**
81
+ * Where the tree button's preview sits for a drag `dx`: snapping to the
82
+ * detents, and past a limit only rubber-banding (STRETCH of the travel
83
+ * beyond `limitCells`), released back to the detent.
84
+ */
85
+ declare function dragOffset(dx: number, limitCells?: number): number;
86
+ //#endregion
87
+ //#region src/detent.d.ts
88
+ /**
89
+ * Detents: a drag quantised into levels, each one a cell of travel, with a
90
+ * light magnetic hold and hysteresis: the feel of a card swipe, and of the
91
+ * chat's tree button.
92
+ *
93
+ * While dragging, the thing follows a smooth staircase of the finger:
94
+ * t = f / cell, x = unit · (t − snap·sin(2πt) / 2π)
95
+ * whose slope is 1 − snap on a level (it holds, yet gives a little) and
96
+ * 1 + snap between levels (it slides into the next one). Past the last level
97
+ * it stretches at `stretch` (rubber band) up to `stop`.
98
+ */
99
+ type DetentFeel = {
100
+ /** Finger travel per level, px. */cell: number; /** The visual unit (px moved per level). */
101
+ unit: number; /** Levels each way (or `[min, max]` levels when the two sides differ). */
102
+ max: number;
103
+ min?: number; /** How strongly a level holds (0..<1). */
104
+ snap: number; /** Past the last level the thing follows this much of the finger… */
105
+ stretch: number; /** …up to this far out, px. */
106
+ stop: number;
107
+ };
108
+ /** The thing's position for a finger travel: the snapping staircase, then the rubber band. */
109
+ declare function snapDetent(finger: number, o: DetentFeel): number;
110
+ /**
111
+ * The level after `t` cells of travel, from level `from`, with hysteresis
112
+ * both ways: it moves on only `hysteresis` past a midpoint, so a finger
113
+ * resting on a boundary never flickers.
114
+ */
115
+ declare function detentLevel(t: number, from: number, o: {
116
+ min: number;
117
+ max: number;
118
+ hysteresis: number;
119
+ }): number;
120
+ //#endregion
121
+ //#region src/float-lines.d.ts
122
+ /**
123
+ * The minimized chat's floating lines: a message that arrives while the chat is
124
+ * minimized floats above the bar for as long as it takes to read it twice,
125
+ * then fades. Hovering or touching the lines pauses their timers.
126
+ */
127
+ /** Characters per second read in CJK scripts (Han, kana, Hangul). */
128
+ declare const READ_RATE_CJK = 6;
129
+ /** Characters per second for everything else (~180 words per minute). */
130
+ declare const READ_RATE_LATIN = 15;
131
+ /** A line stays up for this many reading times... */
132
+ declare const DWELL_FACTOR = 2;
133
+ /** ...and never less than this. */
134
+ declare const DWELL_MIN_MS = 2500;
135
+ /** The slow fade-out once the dwell is over (gone at once under reduced motion). */
136
+ declare const FADE_MS = 10000;
137
+ /** At most this many lines float at once; the oldest goes first. */
138
+ declare const FLOAT_MAX = 6;
139
+ /** Seconds to read `text` once: CJK characters at 6/s, the rest at 15/s. */
140
+ declare function readTime(text: string): number;
141
+ /** How long a floating line stays before it fades, in ms. */
142
+ declare function dwellMs(text: string): number;
143
+ /**
144
+ * One line's countdown: a single setTimeout, stopped by `pause` and restarted
145
+ * by `resume` with the time that was left. Clock and timers are injected for
146
+ * tests.
147
+ */
148
+ declare function createDwellTimer(d: {
149
+ ms: number;
150
+ onDone: () => void;
151
+ now?: () => number;
152
+ setTimer?: (f: () => void, ms: number) => unknown;
153
+ clearTimer?: (t: unknown) => void;
154
+ }): {
155
+ pause(): void;
156
+ resume(): void;
157
+ cancel(): void; /** The time left, in ms (frozen while paused). */
158
+ remaining: () => number;
159
+ };
160
+ /** The latest message floats on minimize only if it arrived at most this long ago. */
161
+ declare const MINIMIZE_FLOAT_MAX_AGE_MS: number;
162
+ /**
163
+ * When this widget first saw each message, by id — this device's clock, never
164
+ * the message's own `at` (another clock, which may be skewed). New messages
165
+ * are told by id, not by the list's length: the host caps its history, so
166
+ * once full the list stays the same length as new lines push old ones out.
167
+ */
168
+ declare function createArrivals(): {
169
+ /**
170
+ * The messages not seen before, in order. The first non-empty list is the
171
+ * history: it is recorded, but `history` says not to float it.
172
+ */
173
+ see<M extends {
174
+ id: string;
175
+ }>(messages: M[], now: number): {
176
+ fresh: M[];
177
+ history: boolean;
178
+ }; /** When it was first seen here (undefined: never). */
179
+ at: (id: string) => number | undefined; /** Its place in arrival order (undefined: never seen). */
180
+ seqOf: (id: string) => number | undefined; /** The last place handed out: everything up to here has arrived. */
181
+ seq: () => number;
182
+ };
183
+ /**
184
+ * The minimized bar's unread badge: the agent's messages that arrived after
185
+ * `readSeq` (the arrival order when the chat was last open, or the history
186
+ * loaded). By arrival, not by list position: a capped list keeps its length.
187
+ */
188
+ declare function countUnread<M extends {
189
+ id: string;
190
+ from: string;
191
+ }>(messages: M[], seqOf: (id: string) => number | undefined, readSeq: number): number;
192
+ /**
193
+ * At the moment the chat is minimized, the latest message (from anyone) is
194
+ * treated as unread and floats, unless it arrived here more than
195
+ * MINIMIZE_FLOAT_MAX_AGE_MS ago. Its dwell starts then, not when it arrived.
196
+ */
197
+ declare function minimizeFloat<M extends {
198
+ id: string;
199
+ }>(messages: M[], now: number, arrivedAt: (id: string) => number | undefined): M | null;
200
+ /**
201
+ * A floating line's life: "dwell" (fully visible) → "fade" (FADE_MS of
202
+ * opacity going down) → "gone". Paused (hovered, touched, a scrub) during the
203
+ * dwell, its time is frozen; paused during the fade, it is "held" at full
204
+ * opacity, and the fade starts over from full once released. Under reduced
205
+ * motion the dwell's end is the end. Timers are injected for tests.
206
+ */
207
+ type FloatPhase = "dwell" | "fade" | "held" | "gone";
208
+ declare function createFloatLife(d: {
209
+ ms: number;
210
+ fadeMs?: number;
211
+ reducedMotion?: boolean;
212
+ paused?: boolean;
213
+ onPhase: (p: FloatPhase) => void;
214
+ now?: () => number;
215
+ setTimer?: (f: () => void, ms: number) => unknown;
216
+ clearTimer?: (t: unknown) => void;
217
+ }): {
218
+ pause(): void;
219
+ resume(): void;
220
+ cancel(): void;
221
+ phase: () => FloatPhase;
222
+ };
223
+ //#endregion
224
+ //#region src/anchor.d.ts
225
+ /**
226
+ * Where the minimized chat's floating box (its floating lines, the frontier,
227
+ * the tree) goes: on the side of the bar it hangs from. The bar in the right
228
+ * third of the screen: the box's right edge on the bar's; the left third: left
229
+ * edges together; the middle: centred on it. Always inside the viewport less
230
+ * the safe areas and an 8px gutter.
231
+ */
232
+ type AnchorSide = "left" | "center" | "right";
233
+ declare const ANCHOR_GUTTER_PX = 8;
234
+ /** The bar's side of the screen, by its centre: thirds. */
235
+ declare function anchorSide(barLeft: number, barRight: number, vw: number): AnchorSide;
236
+ /** The box's left edge (viewport px) for its width, anchored to the bar and clamped. */
237
+ declare function placeBox(d: {
238
+ barLeft: number;
239
+ barRight: number;
240
+ boxWidth: number;
241
+ vw: number;
242
+ insetLeft?: number;
243
+ insetRight?: number;
244
+ gutter?: number;
245
+ }): {
246
+ side: AnchorSide;
247
+ left: number;
248
+ };
249
+ //#endregion
250
+ //#region src/frontier-view.d.ts
251
+ declare const FRONTIER_ROWS: readonly [{
252
+ readonly key: "done";
253
+ readonly mark: "✓";
254
+ readonly label: "Last done";
255
+ }, {
256
+ readonly key: "doing";
257
+ readonly mark: "▶";
258
+ readonly label: "In progress";
259
+ }, {
260
+ readonly key: "next";
261
+ readonly mark: "›";
262
+ readonly label: "Next";
263
+ }];
264
+ /** Visible characters of an agent id at the line's end. */
265
+ declare const SHORT_ID_LEN = 6;
266
+ /** Longer than this, an "id" is more likely a token than a slug: hidden. */
267
+ declare const MAX_ID_LEN = 64;
268
+ /** How long a touch must rest on the id to show the full one. */
269
+ declare const LONG_PRESS_MS = 500;
270
+ /**
271
+ * The agent id to show, or null. Only agents have one shown, and only an
272
+ * opaque slug: anything that looks like a host, a path, a pid:port or a
273
+ * token (a dot, colon or slash, or over 64 characters) is dropped.
274
+ */
275
+ declare function shownAgentId(a: Assignee | undefined): string | null;
276
+ /** The last SHORT_ID_LEN characters, for the line's end. */
277
+ declare const shortId: (id: string) => string;
278
+ /** The `〔N〕` after a group's summary; nothing for a single item. */
279
+ declare const countBadge: (n: number | undefined) => string;
280
+ /** One frontier line as the minimized bar draws it. */
281
+ type FrontierLine = {
282
+ /** A group's ≈ summary (several items), else the one item's title. */text: string;
283
+ count: number;
284
+ assignee?: Assignee; /** A group's members (only when count > 1), each with its breadcrumb. */
285
+ items?: {
286
+ title: string;
287
+ path: string;
288
+ assignee?: Assignee;
289
+ }[];
290
+ };
291
+ type FrontierView = {
292
+ done?: FrontierLine;
293
+ doing?: FrontierLine;
294
+ next?: FrontierLine;
295
+ };
296
+ /**
297
+ * The bar's lines from state-tree.ts frontier(): a group as its summary (or,
298
+ * without one, its first item's title) and count, its items with breadcrumbs;
299
+ * one item as its title. Undefined when there is nothing to show.
300
+ */
301
+ declare function frontierView(f: Frontier): FrontierView | undefined;
302
+ //#endregion
303
+ //#region src/speech-rate.d.ts
304
+ /**
305
+ * How fast the agent's replies are read aloud: a per-device setting
306
+ * (localStorage `liagent:speech-rate`), picked in the chat's menu. Applied
307
+ * from the next utterance, on both outputs (the speech utterance's rate, or a cloud
308
+ * voice's playbackRate with the pitch kept).
309
+ */
310
+ declare const SPEECH_RATE_KEY = "liagent:speech-rate";
311
+ declare const SPEECH_RATES: readonly [1, 1.25, 1.5, 2];
312
+ declare const DEFAULT_SPEECH_RATE = 1.5;
313
+ type Store = {
314
+ getItem(k: string): string | null;
315
+ setItem(k: string, v: string): void;
316
+ };
317
+ /** The saved rate, if it is one of SPEECH_RATES; else the default. */
318
+ declare function speechRate(s?: Store | null): number;
319
+ /** Save a rate (one of SPEECH_RATES; anything else is ignored). */
320
+ declare function setSpeechRate(rate: number, s?: Store | null): void;
321
+ //#endregion
322
+ //#region src/tap-gesture.d.ts
323
+ /**
324
+ * One tap or two (the chat box's grip): a single tap acts only once
325
+ * `delayMs` pass without a second; a second tap inside that window cancels it
326
+ * and acts as a double tap. Timers are injected for tests.
327
+ */
328
+ declare const DOUBLE_TAP_MS = 280;
329
+ declare function createTapper(d: {
330
+ onSingle: () => void;
331
+ onDouble: () => void;
332
+ delayMs?: number;
333
+ setTimer?: (f: () => void, ms: number) => unknown;
334
+ clearTimer?: (t: unknown) => void;
335
+ }): {
336
+ tap(): void; /** Drop a single tap still waiting (unmount). */
337
+ cancel(): void;
338
+ };
339
+ /** How long after a drag ends its click is still "the click that ended a drag". */
340
+ declare const DRAG_CLICK_MS = 400;
341
+ /**
342
+ * Tells the click that ends a drag from a real tap. The flag is cleared by
343
+ * the next pointerdown and expires after DRAG_CLICK_MS, so a browser that
344
+ * sends no click after a touch drag (iOS) never swallows the next tap.
345
+ */
346
+ declare function createDragFlag(now?: () => number): {
347
+ /** A press starts: whatever came before is over. */down(): void; /** A press that moved has ended. */
348
+ dragEnded(): void; /** For the click that follows: was it the end of a drag? (Read once.) */
349
+ wasDrag(): boolean;
350
+ };
351
+ /** A press must move this far before it counts as a drag, and its axis is locked. */
352
+ declare const AXIS_LOCK_PX = 8;
353
+ /**
354
+ * One press on the mic, told apart by its first AXIS_LOCK_PX of movement:
355
+ * under that it stays a tap (the mic toggles); then it locks to an axis for
356
+ * the rest of the press — "y" scrubs the chat history, "x" moves the bar.
357
+ * `up` says whether the click that follows must be swallowed (any lock).
358
+ */
359
+ declare function createAxisLock(lockPx?: number): {
360
+ down(x: number, y: number): void; /** The locked axis and the movement since the press, or null while still a tap. */
361
+ move(x: number, y: number): {
362
+ axis: "x" | "y";
363
+ dx: number;
364
+ dy: number;
365
+ } | null; /** The press ends: the axis it locked to (null = it was a tap). */
366
+ up(): "x" | "y" | null;
367
+ axis: () => "x" | "y" | null;
368
+ };
369
+ /** Pixels of vertical drag per message line scrubbed. */
370
+ declare const SCRUB_STEP_PX = 28;
371
+ /**
372
+ * Where a scrub lands: `back` lines from the newest, from where it started and
373
+ * the finger's vertical travel. Finger down = older (as the expanded log's
374
+ * swipe: the content follows the finger), clamped to [0, max].
375
+ */
376
+ declare function scrubBack(startBack: number, dy: number, max: number, step?: number): number;
377
+ /**
378
+ * A press held for `ms` (500 by default) without moving off: `onLong` fires
379
+ * once. `down` starts it; `up` or `cancel` (the press ended or moved away)
380
+ * stops it. Timers are injected for tests.
381
+ */
382
+ declare function createLongPress(d: {
383
+ onLong: () => void;
384
+ ms?: number;
385
+ setTimer?: (f: () => void, ms: number) => unknown;
386
+ clearTimer?: (t: unknown) => void;
387
+ }): {
388
+ down(): void; /** The press ended: whether it was a long press. */
389
+ up(): boolean;
390
+ cancel: () => void;
391
+ };
392
+ //#endregion
393
+ export { ANCHOR_GUTTER_PX, AXIS_LOCK_PX, AnchorSide, DEFAULT_SPEECH_RATE, DOUBLE_TAP_MS, DRAG_CLICK_MS, DWELL_FACTOR, DWELL_MIN_MS, DetentFeel, ECHO_MIN_CHARS, ECHO_SIMILARITY, ECHO_WINDOW_MS, EchoScore, FADE_MS, FLOAT_MAX, FRONTIER_ROWS, FloatPhase, FrontierLine, FrontierView, LONG_PRESS_MS, MAX_DETENT, MAX_ID_LEN, MINIMIZE_FLOAT_MAX_AGE_MS, NavIndex, READ_RATE_CJK, READ_RATE_LATIN, SCRUB_STEP_PX, SHORT_ID_LEN, SPEECH_RATES, SPEECH_RATE_KEY, TREE_DETENT_PX, TREE_DRAG_CELLS, TREE_HYSTERESIS, TREE_SNAP, TREE_STRETCH, TREE_ZH, TreeNavEvent, TreeNavState, UI_EN, UI_ZH, UiStrings, anchorSide, countBadge, countUnread, createArrivals, createAxisLock, createDragFlag, createDwellTimer, createFloatLife, createLongPress, createTapper, detentLevel, dice, dragCells, dragOffset, dwellMs, echoScore, frontierView, grams, height, indexTree, initialNav, isVisible, isZh, maxDetent, minimizeFloat, normalizeEcho, placeBox, readTime, scrubBack, setSpeechRate, shortId, shownAgentId, snapDetent, speechRate, treeDefaults, treeNav, uiStrings };
394
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { $ as maxDetent, A as FLOAT_MAX, B as readTime, C as shownAgentId, D as DWELL_FACTOR, E as placeBox, F as createArrivals, G as TREE_SNAP, H as TREE_DETENT_PX, I as createDwellTimer, J as dragOffset, K as TREE_STRETCH, L as createFloatLife, M as READ_RATE_CJK, N as READ_RATE_LATIN, O as DWELL_MIN_MS, P as countUnread, Q as isVisible, R as dwellMs, S as shortId, T as anchorSide, U as TREE_DRAG_CELLS, V as MAX_DETENT, W as TREE_HYSTERESIS, X as indexTree, Y as height, Z as initialNav, _ as LONG_PRESS_MS, a as treeDefaults, b as countBadge, c as DOUBLE_TAP_MS, d as createAxisLock, et as treeNav, f as createDragFlag, g as FRONTIER_ROWS, h as scrubBack, i as isZh, j as MINIMIZE_FLOAT_MAX_AGE_MS, k as FADE_MS, l as DRAG_CLICK_MS, m as createTapper, n as UI_EN, nt as snapDetent, o as uiStrings, p as createLongPress, q as dragCells, r as UI_ZH, s as AXIS_LOCK_PX, t as TREE_ZH, tt as detentLevel, u as SCRUB_STEP_PX, v as MAX_ID_LEN, w as ANCHOR_GUTTER_PX, x as frontierView, y as SHORT_ID_LEN, z as minimizeFloat } from "./ui-strings-CJIwW5Gf.js";
2
+ import { a as speechRate, i as setSpeechRate, n as SPEECH_RATES, r as SPEECH_RATE_KEY, t as DEFAULT_SPEECH_RATE } from "./speech-rate-DXeJjRTc.js";
3
+ import { a as echoScore, i as dice, n as ECHO_SIMILARITY, o as grams, r as ECHO_WINDOW_MS, s as normalizeEcho, t as ECHO_MIN_CHARS } from "./echo-BvzPSI0x.js";
4
+
5
+ export { ANCHOR_GUTTER_PX, AXIS_LOCK_PX, DEFAULT_SPEECH_RATE, DOUBLE_TAP_MS, DRAG_CLICK_MS, DWELL_FACTOR, DWELL_MIN_MS, ECHO_MIN_CHARS, ECHO_SIMILARITY, ECHO_WINDOW_MS, FADE_MS, FLOAT_MAX, FRONTIER_ROWS, LONG_PRESS_MS, MAX_DETENT, MAX_ID_LEN, MINIMIZE_FLOAT_MAX_AGE_MS, READ_RATE_CJK, READ_RATE_LATIN, SCRUB_STEP_PX, SHORT_ID_LEN, SPEECH_RATES, SPEECH_RATE_KEY, TREE_DETENT_PX, TREE_DRAG_CELLS, TREE_HYSTERESIS, TREE_SNAP, TREE_STRETCH, TREE_ZH, UI_EN, UI_ZH, anchorSide, countBadge, countUnread, createArrivals, createAxisLock, createDragFlag, createDwellTimer, createFloatLife, createLongPress, createTapper, detentLevel, dice, dragCells, dragOffset, dwellMs, echoScore, frontierView, grams, height, indexTree, initialNav, isVisible, isZh, maxDetent, minimizeFloat, normalizeEcho, placeBox, readTime, scrubBack, setSpeechRate, shortId, shownAgentId, snapDetent, speechRate, treeDefaults, treeNav, uiStrings };