@aparte/core 0.32.0 → 1.0.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 (71) hide show
  1. package/README.md +30 -19
  2. package/dist/client/agent-runner.d.ts.map +1 -1
  3. package/dist/components/bubble/aparte-chat-bubble.d.ts +12 -0
  4. package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
  5. package/dist/components/composer/aparte-composer-send.d.ts.map +1 -1
  6. package/dist/components/context/aparte-context.d.ts +4 -11
  7. package/dist/components/context/aparte-context.d.ts.map +1 -1
  8. package/dist/components/launcher/aparte-launcher.d.ts.map +1 -1
  9. package/dist/components/scroll-rail/aparte-scroll-rail.d.ts +77 -5
  10. package/dist/components/scroll-rail/aparte-scroll-rail.d.ts.map +1 -1
  11. package/dist/components/sidebar/aparte-sidebar.d.ts.map +1 -1
  12. package/dist/components/split/aparte-split.d.ts.map +1 -1
  13. package/dist/components/suggestions/aparte-suggestions.d.ts +15 -1
  14. package/dist/components/suggestions/aparte-suggestions.d.ts.map +1 -1
  15. package/dist/components/suggestions/suggestion-blocks.d.ts +21 -1
  16. package/dist/components/suggestions/suggestion-blocks.d.ts.map +1 -1
  17. package/dist/components/viewport/aparte-chat-viewport.d.ts +7 -6
  18. package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
  19. package/dist/config/aparte-config.d.ts +56 -4
  20. package/dist/config/aparte-config.d.ts.map +1 -1
  21. package/dist/config/config-context.d.ts.map +1 -1
  22. package/dist/config/image-policy.d.ts +104 -0
  23. package/dist/config/image-policy.d.ts.map +1 -0
  24. package/dist/config/index.d.ts +1 -0
  25. package/dist/config/index.d.ts.map +1 -1
  26. package/dist/config/locale.d.ts +8 -10
  27. package/dist/config/locale.d.ts.map +1 -1
  28. package/dist/config/sanitize.d.ts +36 -0
  29. package/dist/config/sanitize.d.ts.map +1 -1
  30. package/dist/custom-elements.json +1236 -122
  31. package/dist/{defer-hydration-ggxlbvL9.js → defer-hydration-Dw5D80FC.js} +831 -68
  32. package/dist/defer-hydration-Dw5D80FC.js.map +1 -0
  33. package/dist/elicitation/panel.d.ts.map +1 -1
  34. package/dist/generated/element-attributes.d.ts +1 -3
  35. package/dist/generated/element-attributes.d.ts.map +1 -1
  36. package/dist/index.css +1 -1
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +473 -122
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.node.d.ts +2 -2
  42. package/dist/index.node.d.ts.map +1 -1
  43. package/dist/index.node.js +1 -1
  44. package/dist/index.node.js.map +1 -1
  45. package/dist/interop/dialog-triggers.d.ts.map +1 -1
  46. package/dist/interop/image-holds.d.ts +20 -0
  47. package/dist/interop/image-holds.d.ts.map +1 -0
  48. package/dist/renderers/citations.d.ts.map +1 -1
  49. package/dist/transport/agent-handler.d.ts +10 -0
  50. package/dist/transport/agent-handler.d.ts.map +1 -1
  51. package/dist/transport/agent-ticket.d.ts.map +1 -1
  52. package/dist/transport/backend-handler.d.ts +8 -0
  53. package/dist/transport/backend-handler.d.ts.map +1 -1
  54. package/dist/transport/backend-transport.d.ts.map +1 -1
  55. package/dist/transport/json-headers.d.ts +10 -0
  56. package/dist/transport/json-headers.d.ts.map +1 -0
  57. package/dist/transport/request-guard.d.ts +14 -0
  58. package/dist/transport/request-guard.d.ts.map +1 -0
  59. package/dist/types/events.d.ts +6 -13
  60. package/dist/types/events.d.ts.map +1 -1
  61. package/dist/types/index.d.ts +1 -1
  62. package/dist/types/index.d.ts.map +1 -1
  63. package/dist/types/models.d.ts +0 -34
  64. package/dist/types/models.d.ts.map +1 -1
  65. package/dist/types/segments.d.ts +0 -11
  66. package/dist/types/segments.d.ts.map +1 -1
  67. package/dist/utils/rendered-content.d.ts +3 -0
  68. package/dist/utils/rendered-content.d.ts.map +1 -0
  69. package/llms.txt +13 -0
  70. package/package.json +11 -4
  71. package/dist/defer-hydration-ggxlbvL9.js.map +0 -1
@@ -161,14 +161,6 @@
161
161
  "module": "./types/index.js"
162
162
  }
163
163
  },
164
- {
165
- "kind": "js",
166
- "name": "AparteMessageBranch",
167
- "declaration": {
168
- "name": "AparteMessageBranch",
169
- "module": "./types/index.js"
170
- }
171
- },
172
164
  {
173
165
  "kind": "js",
174
166
  "name": "AparteBubbleActionsConfig",
@@ -2217,6 +2209,22 @@
2217
2209
  "module": "./config/index.js"
2218
2210
  }
2219
2211
  },
2212
+ {
2213
+ "kind": "js",
2214
+ "name": "AparteImageDecision",
2215
+ "declaration": {
2216
+ "name": "AparteImageDecision",
2217
+ "module": "./config/index.js"
2218
+ }
2219
+ },
2220
+ {
2221
+ "kind": "js",
2222
+ "name": "AparteImagePolicy",
2223
+ "declaration": {
2224
+ "name": "AparteImagePolicy",
2225
+ "module": "./config/index.js"
2226
+ }
2227
+ },
2220
2228
  {
2221
2229
  "kind": "js",
2222
2230
  "name": "APARTE_DEFAULT_ICON_FALLBACKS",
@@ -2923,14 +2931,6 @@
2923
2931
  "module": "./types/index.js"
2924
2932
  }
2925
2933
  },
2926
- {
2927
- "kind": "js",
2928
- "name": "AparteMessageBranch",
2929
- "declaration": {
2930
- "name": "AparteMessageBranch",
2931
- "module": "./types/index.js"
2932
- }
2933
- },
2934
2934
  {
2935
2935
  "kind": "js",
2936
2936
  "name": "AparteBubbleActionsConfig",
@@ -4795,6 +4795,22 @@
4795
4795
  "module": "./config/index.js"
4796
4796
  }
4797
4797
  },
4798
+ {
4799
+ "kind": "js",
4800
+ "name": "AparteImageDecision",
4801
+ "declaration": {
4802
+ "name": "AparteImageDecision",
4803
+ "module": "./config/index.js"
4804
+ }
4805
+ },
4806
+ {
4807
+ "kind": "js",
4808
+ "name": "AparteImagePolicy",
4809
+ "declaration": {
4810
+ "name": "AparteImagePolicy",
4811
+ "module": "./config/index.js"
4812
+ }
4813
+ },
4798
4814
  {
4799
4815
  "kind": "js",
4800
4816
  "name": "APARTE_DEFAULT_ICON_FALLBACKS",
@@ -7229,6 +7245,33 @@
7229
7245
  "privacy": "private",
7230
7246
  "default": "defaultSanitizer"
7231
7247
  },
7248
+ {
7249
+ "kind": "field",
7250
+ "name": "_imagePolicy",
7251
+ "type": {
7252
+ "text": "AparteImagePolicy"
7253
+ },
7254
+ "privacy": "private",
7255
+ "default": "[]"
7256
+ },
7257
+ {
7258
+ "kind": "field",
7259
+ "name": "_imageDecider",
7260
+ "type": {
7261
+ "text": "ImageDecider"
7262
+ },
7263
+ "privacy": "private"
7264
+ },
7265
+ {
7266
+ "kind": "field",
7267
+ "name": "_imagePolicyNamed",
7268
+ "type": {
7269
+ "text": "boolean"
7270
+ },
7271
+ "privacy": "private",
7272
+ "default": "false",
7273
+ "description": "Whether the app named an image policy, the default included; see `decideImage`."
7274
+ },
7232
7275
  {
7233
7276
  "kind": "field",
7234
7277
  "name": "_systemPromptTemplate",
@@ -7859,7 +7902,95 @@
7859
7902
  }
7860
7903
  }
7861
7904
  ],
7862
- "description": "Run the active sanitizer over provider-produced HTML. Public so a\nstreaming-markdown provider (which appends DOM directly, bypassing\n`renderMarkdown`) can apply the same policy. Returns the input unchanged\nonly when sanitization was disabled via `setHtmlSanitizer(null)`."
7905
+ "description": "Run the active sanitizer over provider-produced HTML, then the image policy\n(AparteConfig.setImagePolicy| setImagePolicy): a picture the policy does not let\nload comes back as a link that loads it on a click. Public so a streaming-markdown\nprovider (which appends DOM directly, bypassing `renderMarkdown`) can apply the same\nrules. The image policy runs whichever sanitizer is set, none included, so replacing it\ndoes not turn a reply's pictures back into requests the reader never made."
7906
+ },
7907
+ {
7908
+ "kind": "method",
7909
+ "name": "setImagePolicy",
7910
+ "return": {
7911
+ "type": {
7912
+ "text": "void"
7913
+ }
7914
+ },
7915
+ "parameters": [
7916
+ {
7917
+ "name": "policy",
7918
+ "type": {
7919
+ "text": "AparteImagePolicy"
7920
+ }
7921
+ }
7922
+ ],
7923
+ "description": "Which pictures a model or a tool chose load before the reader asks — in a reply's\nMarkdown, in a card, in a tool's details. By default only `data:` and `blob:` pictures,\nwhich make no request: any other is held, drawn as a small link that says where it would\nload from, and loads in place when the reader clicks it.\n\nThe reason is that a picture fetches its address the moment it is shown, and a\nprompt-injected model can write the conversation into that address. Name what you trust:\n\n- a list — `'self'` for the page's own origin, an origin (`'https://cdn.example.com'`),\n or `'*'` for every picture;\n- a function, which gets the picture's address (resolved against the page) and answers\n `'load'`, `'hold'` or `'drop'`.\n\nEvery picture that loads goes with `referrerpolicy=\"no-referrer\"`. What is on screen is\ndrawn again under the new policy. A CSP `img-src` is the stronger rule beside this one:\nit also checks where a redirect leads, which no script on the page can see.",
7924
+ "examples": [
7925
+ "aparteGlobalConfig.setImagePolicy(['self', 'https://cdn.example.com']);",
7926
+ "aparteGlobalConfig.setImagePolicy((url) => url.startsWith('https://images.example.com/') ? 'load' : 'hold');"
7927
+ ]
7928
+ },
7929
+ {
7930
+ "kind": "method",
7931
+ "name": "decideImage",
7932
+ "return": {
7933
+ "type": {
7934
+ "text": "AparteImageDecision"
7935
+ }
7936
+ },
7937
+ "parameters": [
7938
+ {
7939
+ "name": "url",
7940
+ "type": {
7941
+ "text": "string"
7942
+ }
7943
+ }
7944
+ ],
7945
+ "description": "What the picture at `url` does under this config's image policy: `'load'`, `'hold'`\n(shown as a link that loads it on a click) or `'drop'`. For a plugin that draws pictures\nitself, as `@aparte/plugin-cards` does: ask before setting a `src`, because setting it is\nthe request."
7946
+ },
7947
+ {
7948
+ "kind": "method",
7949
+ "name": "_noteHeldImage",
7950
+ "privacy": "private",
7951
+ "return": {
7952
+ "type": {
7953
+ "text": "void"
7954
+ }
7955
+ },
7956
+ "parameters": [
7957
+ {
7958
+ "name": "url",
7959
+ "type": {
7960
+ "text": "string"
7961
+ }
7962
+ }
7963
+ ],
7964
+ "description": "The first picture the default policy holds, said once to the developer. A picture that\nwaits for a click with nothing in the console reads as a broken image to whoever wrote\nthe app, and the line that changes it cannot be guessed. Silent once the app names a\npolicy, whatever it is: `setImagePolicy([])` keeps the default and the silence."
7965
+ },
7966
+ {
7967
+ "kind": "method",
7968
+ "name": "showImage",
7969
+ "return": {
7970
+ "type": {
7971
+ "text": "void"
7972
+ }
7973
+ },
7974
+ "parameters": [
7975
+ {
7976
+ "name": "url",
7977
+ "type": {
7978
+ "text": "string"
7979
+ }
7980
+ }
7981
+ ],
7982
+ "description": "The reader chose to see the picture at `url`: from now on it loads wherever this\nconfig's image policy would only have held it (a picture the policy drops stays\ndropped). Core calls it when a held picture's link is clicked; a plugin calls it from\nits own \"Show images\", then draws again. Nothing on screen is redrawn by this call."
7983
+ },
7984
+ {
7985
+ "kind": "method",
7986
+ "name": "_heldImageWords",
7987
+ "privacy": "private",
7988
+ "return": {
7989
+ "type": {
7990
+ "text": "HeldImageWords"
7991
+ }
7992
+ },
7993
+ "description": "What a held picture says, in this config's language."
7863
7994
  },
7864
7995
  {
7865
7996
  "kind": "method",
@@ -9831,63 +9962,474 @@
9831
9962
  },
9832
9963
  {
9833
9964
  "kind": "javascript-module",
9834
- "path": "src/config/index.ts",
9835
- "declarations": [],
9836
- "exports": [
9837
- {
9838
- "kind": "js",
9839
- "name": "aparteGlobalConfig",
9840
- "declaration": {
9841
- "name": "aparteGlobalConfig",
9842
- "module": "./aparte-config.js"
9843
- }
9844
- },
9965
+ "path": "src/config/image-policy.ts",
9966
+ "declarations": [
9845
9967
  {
9846
- "kind": "js",
9847
- "name": "AparteConfig",
9848
- "declaration": {
9849
- "name": "AparteConfig",
9850
- "module": "./aparte-config.js"
9851
- }
9968
+ "kind": "function",
9969
+ "name": "resolveImageAddress",
9970
+ "return": {
9971
+ "type": {
9972
+ "text": "URL | null"
9973
+ }
9974
+ },
9975
+ "parameters": [
9976
+ {
9977
+ "name": "address",
9978
+ "type": {
9979
+ "text": "string"
9980
+ }
9981
+ }
9982
+ ],
9983
+ "description": "An address resolved the way the browser will resolve it, or `null` when it cannot be: a\nrelative one where there is no page to resolve it against (a server render), or no address."
9852
9984
  },
9853
9985
  {
9854
- "kind": "js",
9855
- "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
9856
- "declaration": {
9857
- "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
9858
- "module": "./aparte-config.js"
9859
- }
9986
+ "kind": "function",
9987
+ "name": "sameImagePolicy",
9988
+ "return": {
9989
+ "type": {
9990
+ "text": "boolean"
9991
+ }
9992
+ },
9993
+ "parameters": [
9994
+ {
9995
+ "name": "a",
9996
+ "type": {
9997
+ "text": "AparteImagePolicy"
9998
+ }
9999
+ },
10000
+ {
10001
+ "name": "b",
10002
+ "type": {
10003
+ "text": "AparteImagePolicy"
10004
+ }
10005
+ }
10006
+ ],
10007
+ "description": "Whether two policies say the same thing: the same function, or lists with the same entries."
9860
10008
  },
9861
10009
  {
9862
- "kind": "js",
9863
- "name": "APARTE_DEFAULT_HOST_HANDLERS",
9864
- "declaration": {
9865
- "name": "APARTE_DEFAULT_HOST_HANDLERS",
9866
- "module": "./aparte-config.js"
9867
- }
10010
+ "kind": "function",
10011
+ "name": "compileImagePolicy",
10012
+ "return": {
10013
+ "type": {
10014
+ "text": "ImageDecider"
10015
+ }
10016
+ },
10017
+ "parameters": [
10018
+ {
10019
+ "name": "policy",
10020
+ "type": {
10021
+ "text": "AparteImagePolicy"
10022
+ }
10023
+ }
10024
+ ],
10025
+ "description": "Turn a policy into the function every decision runs through."
9868
10026
  },
9869
10027
  {
9870
- "kind": "js",
9871
- "name": "resolveConfig",
9872
- "declaration": {
9873
- "name": "resolveConfig",
9874
- "module": "./config-context.js"
9875
- }
10028
+ "kind": "function",
10029
+ "name": "decideImageAddress",
10030
+ "return": {
10031
+ "type": {
10032
+ "text": "AparteImageDecision"
10033
+ }
10034
+ },
10035
+ "parameters": [
10036
+ {
10037
+ "name": "decide",
10038
+ "type": {
10039
+ "text": "ImageDecider"
10040
+ }
10041
+ },
10042
+ {
10043
+ "name": "address",
10044
+ "type": {
10045
+ "text": "string"
10046
+ }
10047
+ },
10048
+ {
10049
+ "name": "shown",
10050
+ "optional": true,
10051
+ "type": {
10052
+ "text": "ReadonlySet<string>"
10053
+ }
10054
+ }
10055
+ ],
10056
+ "description": "What the picture at `address` does. `data:` and `blob:` load, an address that is no web\naddress (`ftp:`, `mailto:`) goes, and the policy decides the rest — except that a picture the\nreader already chose to see (`shown`) loads when the policy would only have held it."
9876
10057
  },
9877
10058
  {
9878
- "kind": "js",
9879
- "name": "attachConfig",
9880
- "declaration": {
9881
- "name": "attachConfig",
9882
- "module": "./config-context.js"
9883
- }
10059
+ "kind": "function",
10060
+ "name": "rememberShownImage",
10061
+ "return": {
10062
+ "type": {
10063
+ "text": "void"
10064
+ }
10065
+ },
10066
+ "parameters": [
10067
+ {
10068
+ "name": "owner",
10069
+ "type": {
10070
+ "text": "object"
10071
+ }
10072
+ },
10073
+ {
10074
+ "name": "address",
10075
+ "type": {
10076
+ "text": "string"
10077
+ }
10078
+ }
10079
+ ],
10080
+ "description": "Remember that the reader chose to see the picture at `address`, under `owner` (a config)."
9884
10081
  },
9885
10082
  {
9886
- "kind": "js",
9887
- "name": "detachConfig",
9888
- "declaration": {
9889
- "name": "detachConfig",
9890
- "module": "./config-context.js"
10083
+ "kind": "function",
10084
+ "name": "shownImagesOf",
10085
+ "return": {
10086
+ "type": {
10087
+ "text": "ReadonlySet<string> | undefined"
10088
+ }
10089
+ },
10090
+ "parameters": [
10091
+ {
10092
+ "name": "owner",
10093
+ "type": {
10094
+ "text": "object"
10095
+ }
10096
+ }
10097
+ ],
10098
+ "description": "The pictures the reader chose to see under `owner`."
10099
+ },
10100
+ {
10101
+ "kind": "function",
10102
+ "name": "forgetShownImages",
10103
+ "return": {
10104
+ "type": {
10105
+ "text": "void"
10106
+ }
10107
+ },
10108
+ "parameters": [
10109
+ {
10110
+ "name": "owner",
10111
+ "type": {
10112
+ "text": "object"
10113
+ }
10114
+ }
10115
+ ],
10116
+ "description": "Forget them: a reset config starts from what its policy says."
10117
+ },
10118
+ {
10119
+ "kind": "function",
10120
+ "name": "parseSrcset",
10121
+ "return": {
10122
+ "type": {
10123
+ "text": "SrcsetCandidate[]"
10124
+ }
10125
+ },
10126
+ "parameters": [
10127
+ {
10128
+ "name": "value",
10129
+ "type": {
10130
+ "text": "string"
10131
+ }
10132
+ }
10133
+ ],
10134
+ "description": "A `srcset`, read as the HTML Standard's \"parse a srcset attribute\" reads it — in the details a\ndifference would turn into a request. Only ASCII whitespace separates: a JavaScript `\\s` also\nsplits on U+00A0 and U+FEFF, which a browser keeps inside an address (`&nbsp;data:…/../api/logout`\nis a path on the page's own site to it). An address runs to the next such space, so a `data:`\nURL keeps its commas; trailing commas end a candidate; a descriptor's parentheses do not nest\n(`1x ((), https://…` is two candidates to a browser, not one).\n\nA candidate with descriptors this does not know is left out. That is safe in one direction\nonly, and it is the direction the pass relies on: what reaches the page is never the model's\n`srcset` but one written again from these candidates (`writeSrcset`), so a browser can only\npick an address that was judged."
10135
+ },
10136
+ {
10137
+ "kind": "function",
10138
+ "name": "srcsetUrls",
10139
+ "return": {
10140
+ "type": {
10141
+ "text": "string[]"
10142
+ }
10143
+ },
10144
+ "parameters": [
10145
+ {
10146
+ "name": "value",
10147
+ "type": {
10148
+ "text": "string"
10149
+ }
10150
+ }
10151
+ ],
10152
+ "description": "The addresses a `srcset` lists, as `parseSrcset` reads them."
10153
+ },
10154
+ {
10155
+ "kind": "function",
10156
+ "name": "imageHost",
10157
+ "return": {
10158
+ "type": {
10159
+ "text": "string"
10160
+ }
10161
+ },
10162
+ "parameters": [
10163
+ {
10164
+ "name": "address",
10165
+ "type": {
10166
+ "text": "string"
10167
+ }
10168
+ }
10169
+ ],
10170
+ "description": "Where a held picture would load from, as the reader is shown it: the host, exactly — a\nlook-alike name is the reason to show it, which is also why its end, the part a reader\njudges by, is never cut (the chip wraps it) — and, for an address that resolves to no host\n(a relative one on a server), the address itself, cut short."
10171
+ },
10172
+ {
10173
+ "kind": "function",
10174
+ "name": "heldImageHtml",
10175
+ "return": {
10176
+ "type": {
10177
+ "text": "string"
10178
+ }
10179
+ },
10180
+ "parameters": [
10181
+ {
10182
+ "name": "address",
10183
+ "type": {
10184
+ "text": "string"
10185
+ }
10186
+ },
10187
+ {
10188
+ "name": "alt",
10189
+ "type": {
10190
+ "text": "string"
10191
+ }
10192
+ },
10193
+ {
10194
+ "name": "words",
10195
+ "type": {
10196
+ "text": "HeldImageWords"
10197
+ }
10198
+ },
10199
+ {
10200
+ "name": "inLink",
10201
+ "default": "false"
10202
+ }
10203
+ ],
10204
+ "description": "A held picture: a link to it that wears the tag recipe, names where it would load from, and\ncarries what it holds in two attributes, so a later pass can draw it again from them alone.\nWithout script it opens the picture in a new tab; with core's listener it loads in place.\n\nInside a link (`[![build](badge.svg)](https://ci…)`) it is a `<span role=\"button\">` instead: a\nlink inside a link is taken apart by the HTML parser, which would leave the reply's own link\nempty and the picture outside it."
10205
+ },
10206
+ {
10207
+ "kind": "function",
10208
+ "name": "applyImagePolicy",
10209
+ "return": {
10210
+ "type": {
10211
+ "text": "string"
10212
+ }
10213
+ },
10214
+ "parameters": [
10215
+ {
10216
+ "name": "html",
10217
+ "type": {
10218
+ "text": "string"
10219
+ }
10220
+ },
10221
+ {
10222
+ "name": "decide",
10223
+ "type": {
10224
+ "text": "(address: string) => AparteImageDecision"
10225
+ }
10226
+ },
10227
+ {
10228
+ "name": "words",
10229
+ "type": {
10230
+ "text": "() => HeldImageWords"
10231
+ }
10232
+ }
10233
+ ],
10234
+ "description": "Apply the policy to sanitized HTML. A picture's own address — its `src`, else its first\n`srcset` one — decides what it does: it loads, it is held (drawn as `heldImageHtml`), or it\ngoes. One that loads gains `referrerpolicy=\"no-referrer\"` and keeps, of its `srcset`, only the\ncandidates that load, written again (`writeSrcset`) so the browser picks among exactly what was\njudged; a `<source>` keeps its loading candidates the same way, or goes. A held picture already\nin the HTML is drawn again from what it carries, so running the pass twice gives what running\nit once gave, and a picture the reader chose to see stays shown however it was written.\n\nIn a browser it walks an inert `<template>`, where nothing it touches is fetched; without a\nDOM it reads the tags the way the sanitizer's own DOM-free path does."
10235
+ },
10236
+ {
10237
+ "kind": "function",
10238
+ "name": "applyImagePolicyWithoutDom",
10239
+ "return": {
10240
+ "type": {
10241
+ "text": "string"
10242
+ }
10243
+ },
10244
+ "parameters": [
10245
+ {
10246
+ "name": "html",
10247
+ "type": {
10248
+ "text": "string"
10249
+ }
10250
+ },
10251
+ {
10252
+ "name": "decide",
10253
+ "type": {
10254
+ "text": "(address: string) => AparteImageDecision"
10255
+ }
10256
+ },
10257
+ {
10258
+ "name": "words",
10259
+ "type": {
10260
+ "text": "() => HeldImageWords"
10261
+ }
10262
+ }
10263
+ ],
10264
+ "description": "The same pass for a runtime with no DOM (a server render, a Worker). Like the sanitizer's\nDOM-free path it is a safety net, not a parser: it reads tags with the sanitizer's own\nreader, leaves comments and raw-text elements alone, and writes back only what it changed.\nExported for the parity suite; not from the package barrel."
10265
+ }
10266
+ ],
10267
+ "exports": [
10268
+ {
10269
+ "kind": "js",
10270
+ "name": "resolveImageAddress",
10271
+ "declaration": {
10272
+ "name": "resolveImageAddress",
10273
+ "module": "src/config/image-policy.ts"
10274
+ }
10275
+ },
10276
+ {
10277
+ "kind": "js",
10278
+ "name": "sameImagePolicy",
10279
+ "declaration": {
10280
+ "name": "sameImagePolicy",
10281
+ "module": "src/config/image-policy.ts"
10282
+ }
10283
+ },
10284
+ {
10285
+ "kind": "js",
10286
+ "name": "compileImagePolicy",
10287
+ "declaration": {
10288
+ "name": "compileImagePolicy",
10289
+ "module": "src/config/image-policy.ts"
10290
+ }
10291
+ },
10292
+ {
10293
+ "kind": "js",
10294
+ "name": "decideImageAddress",
10295
+ "declaration": {
10296
+ "name": "decideImageAddress",
10297
+ "module": "src/config/image-policy.ts"
10298
+ }
10299
+ },
10300
+ {
10301
+ "kind": "js",
10302
+ "name": "rememberShownImage",
10303
+ "declaration": {
10304
+ "name": "rememberShownImage",
10305
+ "module": "src/config/image-policy.ts"
10306
+ }
10307
+ },
10308
+ {
10309
+ "kind": "js",
10310
+ "name": "shownImagesOf",
10311
+ "declaration": {
10312
+ "name": "shownImagesOf",
10313
+ "module": "src/config/image-policy.ts"
10314
+ }
10315
+ },
10316
+ {
10317
+ "kind": "js",
10318
+ "name": "forgetShownImages",
10319
+ "declaration": {
10320
+ "name": "forgetShownImages",
10321
+ "module": "src/config/image-policy.ts"
10322
+ }
10323
+ },
10324
+ {
10325
+ "kind": "js",
10326
+ "name": "parseSrcset",
10327
+ "declaration": {
10328
+ "name": "parseSrcset",
10329
+ "module": "src/config/image-policy.ts"
10330
+ }
10331
+ },
10332
+ {
10333
+ "kind": "js",
10334
+ "name": "srcsetUrls",
10335
+ "declaration": {
10336
+ "name": "srcsetUrls",
10337
+ "module": "src/config/image-policy.ts"
10338
+ }
10339
+ },
10340
+ {
10341
+ "kind": "js",
10342
+ "name": "imageHost",
10343
+ "declaration": {
10344
+ "name": "imageHost",
10345
+ "module": "src/config/image-policy.ts"
10346
+ }
10347
+ },
10348
+ {
10349
+ "kind": "js",
10350
+ "name": "heldImageHtml",
10351
+ "declaration": {
10352
+ "name": "heldImageHtml",
10353
+ "module": "src/config/image-policy.ts"
10354
+ }
10355
+ },
10356
+ {
10357
+ "kind": "js",
10358
+ "name": "applyImagePolicy",
10359
+ "declaration": {
10360
+ "name": "applyImagePolicy",
10361
+ "module": "src/config/image-policy.ts"
10362
+ }
10363
+ },
10364
+ {
10365
+ "kind": "js",
10366
+ "name": "applyImagePolicyWithoutDom",
10367
+ "declaration": {
10368
+ "name": "applyImagePolicyWithoutDom",
10369
+ "module": "src/config/image-policy.ts"
10370
+ }
10371
+ }
10372
+ ]
10373
+ },
10374
+ {
10375
+ "kind": "javascript-module",
10376
+ "path": "src/config/index.ts",
10377
+ "declarations": [],
10378
+ "exports": [
10379
+ {
10380
+ "kind": "js",
10381
+ "name": "aparteGlobalConfig",
10382
+ "declaration": {
10383
+ "name": "aparteGlobalConfig",
10384
+ "module": "./aparte-config.js"
10385
+ }
10386
+ },
10387
+ {
10388
+ "kind": "js",
10389
+ "name": "AparteConfig",
10390
+ "declaration": {
10391
+ "name": "AparteConfig",
10392
+ "module": "./aparte-config.js"
10393
+ }
10394
+ },
10395
+ {
10396
+ "kind": "js",
10397
+ "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
10398
+ "declaration": {
10399
+ "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
10400
+ "module": "./aparte-config.js"
10401
+ }
10402
+ },
10403
+ {
10404
+ "kind": "js",
10405
+ "name": "APARTE_DEFAULT_HOST_HANDLERS",
10406
+ "declaration": {
10407
+ "name": "APARTE_DEFAULT_HOST_HANDLERS",
10408
+ "module": "./aparte-config.js"
10409
+ }
10410
+ },
10411
+ {
10412
+ "kind": "js",
10413
+ "name": "resolveConfig",
10414
+ "declaration": {
10415
+ "name": "resolveConfig",
10416
+ "module": "./config-context.js"
10417
+ }
10418
+ },
10419
+ {
10420
+ "kind": "js",
10421
+ "name": "attachConfig",
10422
+ "declaration": {
10423
+ "name": "attachConfig",
10424
+ "module": "./config-context.js"
10425
+ }
10426
+ },
10427
+ {
10428
+ "kind": "js",
10429
+ "name": "detachConfig",
10430
+ "declaration": {
10431
+ "name": "detachConfig",
10432
+ "module": "./config-context.js"
9891
10433
  }
9892
10434
  },
9893
10435
  {
@@ -10026,6 +10568,22 @@
10026
10568
  "module": "./sanitize.js"
10027
10569
  }
10028
10570
  },
10571
+ {
10572
+ "kind": "js",
10573
+ "name": "AparteImageDecision",
10574
+ "declaration": {
10575
+ "name": "AparteImageDecision",
10576
+ "module": "./image-policy.js"
10577
+ }
10578
+ },
10579
+ {
10580
+ "kind": "js",
10581
+ "name": "AparteImagePolicy",
10582
+ "declaration": {
10583
+ "name": "AparteImagePolicy",
10584
+ "module": "./image-policy.js"
10585
+ }
10586
+ },
10029
10587
  {
10030
10588
  "kind": "js",
10031
10589
  "name": "defaultSanitizer",
@@ -10198,7 +10756,7 @@
10198
10756
  "type": {
10199
10757
  "text": "AparteLocale"
10200
10758
  },
10201
- "default": "{ inputPlaceholder: \"Type a message...\", sendButton: \"Send\", copy: \"Copy\", copied: \"Copied!\", retry: \"Retry\", thinking: \"Thinking\", elicitationOther: \"Other…\", elicitationOtherPlaceholder: \"Type your answer…\", elicitationOtherLabel: \"Custom answer\", submitButton: \"Submit\", stopButton: \"Stop\", elicitationRecommended: \"Recommended\", elicitationSkip: \"Skip\", elicitationHide: \"Hide for now\", elicitationWaiting: \"Waiting for your answer\", elicitationYes: \"Yes\", elicitationNo: \"No\", elicitationAnswerLabel: \"Your answer\", approvalInstructionPlaceholder: \"Or tell it what to do instead…\", approvalAsk: \"Allow {tool}?\", approvalWaiting: \"Waiting\", scrollToBottom: \"Scroll to bottom\", suggestionsLabel: \"Suggested prompts\", contextLabel: \"Context window\", contextSystem: \"System prompt\", contextTools: \"Tools\", contextSummary: \"Summary\", contextMessages: \"Messages\", contextOther: \"Other\", contextFree: \"Free\", contextTotal: \"Total\", contextReclaim: \"Compacting now would free ~{n} tokens\", contextCompactNow: \"Compact now\", compactionSummaryTitle: \"Conversation summary\", checkpointCount: \"{n} messages summarised for the model\", checkpointCountOne: \"1 message summarised for the model\", checkpointLegacy: \"Earlier messages were summarised\", checkpointGroup: \"Context summary\", checkpointShow: \"Show summary\", checkpointHide: \"Hide summary\", checkpointRestore: \"Restore\", checkpointRestoreConfirm: \"Send the original messages to the model again?\", checkpointPending: \"Summarising the context…\", checkpointFailed: \"Couldn't summarise the context\", toolRunning: \"Running\", toolCompleted: \"Done\", toolRejected: \"Rejected\", toolStopped: \"Stopped\", toolFailed: \"Failed\", toolInput: \"Input\", toolOutput: \"Output\", toolRejectedSaid: \"You said: “{instruction}”\", toolRefusedByPolicy: \"Refused by policy\", toolNotRunAfterRefusal: \"Not run: an earlier call was refused\", toolTimedOut: \"Timed out\", toolUnavailable: \"Not available here\", toolNoApprover: \"No one could approve it\", toolTurnLimit: \"Turn limit reached\", maxTurnsReached: \"Stopped after {n} turns to avoid an endless loop.\", sourcesCount: \"{n} sources\", sourcesOne: \"1 source\", sourcesCard: \"Sources\", sourcePrevious: \"Previous source\", sourceNext: \"Next source\", sourcePosition: \"Source {i} of {n}\", opensInNewTab: \"(opens in a new tab)\", questionDeclined: \"You declined to answer.\", artifactNotCreated: \"Not created\", thoughtFor: \"Thought for {duration}\", thought: \"Thought\", approvalOptionsLabel: \"Your decision\", approvalArgsLabel: \"Arguments\", actionUpload: \"Attach file\", removeAttachment: \"Remove {name}\", messageFrom: \"Message from {name}\", selectSearchPlaceholder: \"Search…\", selectSearchLabel: \"Search options\", loading: \"Loading…\", download: \"Download\", openArtifact: \"Open\", modelContextWindow: \"{n} context\", previewPending: \"Press Preview to run this artifact.\", sandboxError: \"The sandbox failed during generation.\", sandboxErrorHint: \"Common cause: the model produced invalid code (undefined variable, wrong argument type). Retry the request — the model may produce different code.\", preview: \"Preview\", code: \"Code\", generating: \"Generating…\", rebuildingPreview: \"Rebuilding preview…\", typing: \"Typing\", responseCutOff: \"Cut off at the model's length limit.\", error: \"Error\", errorUnreachable: \"The assistant can’t be reached right now. Try again in a moment.\", errorTimeout: \"The answer took too long. Try again in a moment.\", errorRefused: \"The assistant isn’t allowed to answer right now.\", errorRateLimited: \"Too many requests right now. Try again in a moment.\", errorTooLong: \"This conversation is too long for the model. Start a new one.\", errorFailed: \"The assistant couldn’t answer. Try again in a moment.\", errorNoAnswer: \"The assistant couldn’t answer this request.\", running: \"Running...\", run: \"Run\", file: \"File\", modelSelectorPlaceholder: \"Select a model...\", approvalModeLabel: \"Approval mode\", roleNameUser: \"You\", roleNameAssistant: \"Assistant\", yourMessage: \"Your message\", assistantResponse: \"Assistant response\", messageActions: \"Message actions\", edit: \"Edit message\", editConfirm: \"Send\", editCancel: \"Cancel\", feedbackPositive: \"Good response\", feedbackNegative: \"Bad response\", previousResponse: \"Previous response\", nextResponse: \"Next response\", approveTool: \"Approve\", rejectTool: \"Reject\", messageInfo: \"Details\", newChat: \"New Chat\", loadingConversations: \"Loading conversations\", conversationSearchEmpty: \"No conversation matches\", conversationList: \"Conversations\", loadingConversation: \"Loading the conversation\", deleteConversation: \"Delete\", archiveConversation: \"Archive\", unarchiveConversation: \"Unarchive\", conversationActions: \"Conversation actions\", conversationRunning: \"Answering\", conversationWaiting: \"Waiting for you\", renameConversation: \"Rename\", conversationTitle: \"Conversation title\", pinConversation: \"Pin\", unpinConversation: \"Unpin\", deleteConversationConfirm: \"Delete “{title}”?\", cancel: \"Cancel\", conversationGroupPinned: \"Pinned\", conversationGroupToday: \"Today\", conversationGroupYesterday: \"Yesterday\", conversationGroupWeek: \"Previous 7 days\", conversationGroupMonth: \"Previous 30 days\", scrollRailLabel: \"Conversation outline\", sidebarLabel: \"Conversations\", splitHandleLabel: \"Resize the panes\", launcherOpen: \"Open the chat\", launcherClose: \"Close the chat\", transcript: \"Transcript\" }",
10759
+ "default": "{ inputPlaceholder: \"Type a message...\", sendButton: \"Send\", copy: \"Copy\", copied: \"Copied!\", retry: \"Retry\", thinking: \"Thinking\", elicitationOther: \"Other…\", elicitationOtherPlaceholder: \"Type your answer…\", elicitationOtherLabel: \"Custom answer\", submitButton: \"Submit\", stopButton: \"Stop\", elicitationRecommended: \"Recommended\", elicitationSkip: \"Skip\", elicitationHide: \"Hide for now\", elicitationWaiting: \"Waiting for your answer\", elicitationYes: \"Yes\", elicitationNo: \"No\", elicitationAnswerLabel: \"Your answer\", approvalInstructionPlaceholder: \"Or tell it what to do instead…\", approvalAsk: \"Allow {tool}?\", approvalWaiting: \"Waiting\", scrollToBottom: \"Scroll to bottom\", suggestionsLabel: \"Suggested prompts\", contextLabel: \"Context window\", contextSystem: \"System prompt\", contextTools: \"Tools\", contextSummary: \"Summary\", contextMessages: \"Messages\", contextOther: \"Other\", contextFree: \"Free\", contextTotal: \"Total\", contextReclaim: \"Compacting now would free ~{n} tokens\", contextCompactNow: \"Compact now\", checkpointCount: \"{n} messages summarised for the model\", checkpointCountOne: \"1 message summarised for the model\", checkpointLegacy: \"Earlier messages were summarised\", checkpointGroup: \"Context summary\", checkpointShow: \"Show summary\", checkpointHide: \"Hide summary\", checkpointRestore: \"Restore\", checkpointRestoreConfirm: \"Send the original messages to the model again?\", checkpointPending: \"Summarising the context…\", checkpointFailed: \"Couldn't summarise the context\", toolRunning: \"Running\", toolCompleted: \"Done\", toolRejected: \"Rejected\", toolStopped: \"Stopped\", toolFailed: \"Failed\", toolInput: \"Input\", toolOutput: \"Output\", toolRejectedSaid: \"You said: “{instruction}”\", toolRefusedByPolicy: \"Refused by policy\", toolNotRunAfterRefusal: \"Not run: an earlier call was refused\", toolTimedOut: \"Timed out\", toolUnavailable: \"Not available here\", toolNoApprover: \"No one could approve it\", toolTurnLimit: \"Turn limit reached\", maxTurnsReached: \"Stopped after {n} turns to avoid an endless loop.\", sourcesCount: \"{n} sources\", sourcesOne: \"1 source\", sourcesCard: \"Sources\", sourcePrevious: \"Previous source\", sourceNext: \"Next source\", sourcePosition: \"Source {i} of {n}\", opensInNewTab: \"(opens in a new tab)\", imageLoad: \"Load the image from {host}\", imageLoadNamed: \"Load the image “{alt}” from {host}\", questionDeclined: \"You declined to answer.\", artifactNotCreated: \"Not created\", thoughtFor: \"Thought for {duration}\", thought: \"Thought\", approvalOptionsLabel: \"Your decision\", approvalArgsLabel: \"Arguments\", actionUpload: \"Attach file\", removeAttachment: \"Remove {name}\", messageFrom: \"Message from {name}\", selectSearchPlaceholder: \"Search…\", selectSearchLabel: \"Search options\", loading: \"Loading…\", download: \"Download\", openArtifact: \"Open\", modelContextWindow: \"{n} context\", previewPending: \"Press Preview to run this artifact.\", sandboxError: \"The sandbox failed during generation.\", sandboxErrorHint: \"Common cause: the model produced invalid code (undefined variable, wrong argument type). Retry the request — the model may produce different code.\", preview: \"Preview\", code: \"Code\", generating: \"Generating…\", rebuildingPreview: \"Rebuilding preview…\", typing: \"Typing\", responseCutOff: \"Cut off at the model's length limit.\", error: \"Error\", errorUnreachable: \"The assistant can’t be reached right now. Try again in a moment.\", errorTimeout: \"The answer took too long. Try again in a moment.\", errorRefused: \"The assistant isn’t allowed to answer right now.\", errorRateLimited: \"Too many requests right now. Try again in a moment.\", errorTooLong: \"This conversation is too long for the model. Start a new one.\", errorFailed: \"The assistant couldn’t answer. Try again in a moment.\", errorNoAnswer: \"The assistant couldn’t answer this request.\", running: \"Running...\", run: \"Run\", file: \"File\", modelSelectorPlaceholder: \"Select a model...\", approvalModeLabel: \"Approval mode\", roleNameUser: \"You\", roleNameAssistant: \"Assistant\", yourMessage: \"Your message\", assistantResponse: \"Assistant response\", messageActions: \"Message actions\", edit: \"Edit message\", editConfirm: \"Send\", editCancel: \"Cancel\", feedbackPositive: \"Good response\", feedbackNegative: \"Bad response\", previousResponse: \"Previous response\", nextResponse: \"Next response\", approveTool: \"Approve\", rejectTool: \"Reject\", messageInfo: \"Details\", newChat: \"New Chat\", loadingConversations: \"Loading conversations\", conversationSearchEmpty: \"No conversation matches\", conversationList: \"Conversations\", loadingConversation: \"Loading the conversation\", deleteConversation: \"Delete\", archiveConversation: \"Archive\", unarchiveConversation: \"Unarchive\", conversationActions: \"Conversation actions\", conversationRunning: \"Answering\", conversationWaiting: \"Waiting for you\", renameConversation: \"Rename\", conversationTitle: \"Conversation title\", pinConversation: \"Pin\", unpinConversation: \"Unpin\", deleteConversationConfirm: \"Delete “{title}”?\", cancel: \"Cancel\", conversationGroupPinned: \"Pinned\", conversationGroupToday: \"Today\", conversationGroupYesterday: \"Yesterday\", conversationGroupWeek: \"Previous 7 days\", conversationGroupMonth: \"Previous 30 days\", scrollRailLabel: \"Conversation outline\", sidebarLabel: \"Conversations\", splitHandleLabel: \"Resize the panes\", launcherOpen: \"Open the chat\", launcherClose: \"Close the chat\", transcript: \"Transcript\" }",
10202
10760
  "description": "Default English Locale (Zero-dependency)\nHardcoded to ensure the core works out-of-the-box."
10203
10761
  }
10204
10762
  ],
@@ -10223,6 +10781,39 @@
10223
10781
  "default": "new Set([ 'script', 'style', 'iframe', 'frame', 'frameset', 'object', 'embed', 'applet', 'form', 'button', 'textarea', 'select', 'option', 'optgroup', 'link', 'meta', 'base', 'title', 'head', 'html', 'body', 'template', 'noscript', 'svg', 'math', 'portal', ])",
10224
10782
  "description": "Tags dropped wholesale — content and all (never unwrapped to text).\n\nExported for the DOM-free path's own suite: both of `fallbackScrub`'s regexes\nare built from this Set, and the test that proves it loops over the Set rather\nthan a copy. Not re-exported from the package barrel — it is core's list, not\na contract."
10225
10783
  },
10784
+ {
10785
+ "kind": "variable",
10786
+ "name": "RESERVED_ATTRIBUTES",
10787
+ "default": "new Set([ 'data-aparte-chat', 'data-aparte-host', 'data-aparte-theme', 'data-aparte-split-pane', 'data-aparte-launcher-close', 'data-aparte-suggestions', 'data-aparte-bubble', 'data-aparte-empty', 'data-aparte-panel', 'data-aparte-panel-host', 'data-aparte-card-part', 'data-segment-id', 'data-action', ])",
10788
+ "description": "The attributes core READS, as a command or as a boundary, on an element it finds by\nwalking the DOM: a delegated click listener (`data-aparte-dialog-open`, the sidebar\nand split toggles, the launcher's close), the chat that owns a card's `send`\n(`data-aparte-chat`), the instance config a subtree resolves to (`data-aparte-host`),\nthe palette a subtree wears (`data-aparte-theme`), a checkpoint's Restore\n(`data-checkpoint-action`), the row a segment update targets (`data-segment-id`).\n\n`data-*` is otherwise kept (see `copyAttributes`), so these are the exceptions: model\nmarkup is text, and text cannot press a button or move a boundary core drew. The list\nis exact rather than the whole `data-aparte-` prefix on purpose — a Markdown provider\nwrites `data-aparte-open` before the sanitizer runs, and core marks its own state on\nDOM the sanitizer sees again (`data-aparte-highlighted`) — and\n`the-sanitizer-refuses-what-core-reads.test.ts` scans core's source so an attribute\nadded there cannot be forgotten here. Exported for that test; not from the barrel."
10789
+ },
10790
+ {
10791
+ "kind": "variable",
10792
+ "name": "RESERVED_ATTRIBUTE_PREFIXES",
10793
+ "type": {
10794
+ "text": "array"
10795
+ },
10796
+ "default": "['data-aparte-dialog-', 'data-aparte-sidebar-', 'data-checkpoint-']",
10797
+ "description": "Families of reserved attributes: `-open`/`-close`/`-static`, `-toggle`/`-search`, `-action`/`-reason`."
10798
+ },
10799
+ {
10800
+ "kind": "function",
10801
+ "name": "isReservedAttribute",
10802
+ "return": {
10803
+ "type": {
10804
+ "text": "boolean"
10805
+ }
10806
+ },
10807
+ "parameters": [
10808
+ {
10809
+ "name": "name",
10810
+ "type": {
10811
+ "text": "string"
10812
+ }
10813
+ }
10814
+ ],
10815
+ "description": "True when `name` (lower case) is an attribute core reads, so model markup may not carry it."
10816
+ },
10226
10817
  {
10227
10818
  "kind": "function",
10228
10819
  "name": "isSafeUrl",
@@ -10246,6 +10837,30 @@
10246
10837
  }
10247
10838
  ]
10248
10839
  },
10840
+ {
10841
+ "kind": "function",
10842
+ "name": "readTag",
10843
+ "return": {
10844
+ "type": {
10845
+ "text": "{ tag: string; attrs: Array<[string, string]>; end: number }"
10846
+ }
10847
+ },
10848
+ "parameters": [
10849
+ {
10850
+ "name": "html",
10851
+ "type": {
10852
+ "text": "string"
10853
+ }
10854
+ },
10855
+ {
10856
+ "name": "nameAt",
10857
+ "type": {
10858
+ "text": "number"
10859
+ }
10860
+ }
10861
+ ],
10862
+ "description": "One tag read from `nameAt` (the first letter of its name) the way a browser's tokenizer reads\nit: a quote ends where its match is, an unquoted value at a space or `>`, `/` and a closing\nquote separate attributes, the first of two equal names wins, and a value is read with the\nentities that can spell a checked character decoded. `end` is the index past its `>`, or `-1`\nwhen the text ends inside the tag.\n\nExported for the image policy's DOM-free pass (`image-policy.ts`), which has to find the same\ntags in the same text this scrub wrote; not from the package barrel."
10863
+ },
10249
10864
  {
10250
10865
  "kind": "function",
10251
10866
  "name": "defaultSanitizer",
@@ -10274,6 +10889,30 @@
10274
10889
  "module": "src/config/sanitize.ts"
10275
10890
  }
10276
10891
  },
10892
+ {
10893
+ "kind": "js",
10894
+ "name": "RESERVED_ATTRIBUTES",
10895
+ "declaration": {
10896
+ "name": "RESERVED_ATTRIBUTES",
10897
+ "module": "src/config/sanitize.ts"
10898
+ }
10899
+ },
10900
+ {
10901
+ "kind": "js",
10902
+ "name": "RESERVED_ATTRIBUTE_PREFIXES",
10903
+ "declaration": {
10904
+ "name": "RESERVED_ATTRIBUTE_PREFIXES",
10905
+ "module": "src/config/sanitize.ts"
10906
+ }
10907
+ },
10908
+ {
10909
+ "kind": "js",
10910
+ "name": "isReservedAttribute",
10911
+ "declaration": {
10912
+ "name": "isReservedAttribute",
10913
+ "module": "src/config/sanitize.ts"
10914
+ }
10915
+ },
10277
10916
  {
10278
10917
  "kind": "js",
10279
10918
  "name": "isSafeUrl",
@@ -10282,6 +10921,14 @@
10282
10921
  "module": "src/config/sanitize.ts"
10283
10922
  }
10284
10923
  },
10924
+ {
10925
+ "kind": "js",
10926
+ "name": "readTag",
10927
+ "declaration": {
10928
+ "name": "readTag",
10929
+ "module": "src/config/sanitize.ts"
10930
+ }
10931
+ },
10285
10932
  {
10286
10933
  "kind": "js",
10287
10934
  "name": "defaultSanitizer",
@@ -15142,6 +15789,58 @@
15142
15789
  }
15143
15790
  ]
15144
15791
  },
15792
+ {
15793
+ "kind": "javascript-module",
15794
+ "path": "src/interop/image-holds.ts",
15795
+ "declarations": [
15796
+ {
15797
+ "kind": "function",
15798
+ "name": "showHeldImage",
15799
+ "return": {
15800
+ "type": {
15801
+ "text": "void"
15802
+ }
15803
+ },
15804
+ "parameters": [
15805
+ {
15806
+ "name": "link",
15807
+ "type": {
15808
+ "text": "Element"
15809
+ }
15810
+ }
15811
+ ],
15812
+ "description": "Put the picture `link` holds in its place, and remember the reader chose to see it."
15813
+ },
15814
+ {
15815
+ "kind": "function",
15816
+ "name": "installImageHoldsOnce",
15817
+ "return": {
15818
+ "type": {
15819
+ "text": "void"
15820
+ }
15821
+ },
15822
+ "description": "Install the listeners once per document."
15823
+ }
15824
+ ],
15825
+ "exports": [
15826
+ {
15827
+ "kind": "js",
15828
+ "name": "showHeldImage",
15829
+ "declaration": {
15830
+ "name": "showHeldImage",
15831
+ "module": "src/interop/image-holds.ts"
15832
+ }
15833
+ },
15834
+ {
15835
+ "kind": "js",
15836
+ "name": "installImageHoldsOnce",
15837
+ "declaration": {
15838
+ "name": "installImageHoldsOnce",
15839
+ "module": "src/interop/image-holds.ts"
15840
+ }
15841
+ }
15842
+ ]
15843
+ },
15145
15844
  {
15146
15845
  "kind": "javascript-module",
15147
15846
  "path": "src/parsers/aparte-event-stream.ts",
@@ -17875,6 +18574,82 @@
17875
18574
  }
17876
18575
  ]
17877
18576
  },
18577
+ {
18578
+ "kind": "javascript-module",
18579
+ "path": "src/transport/json-headers.ts",
18580
+ "declarations": [
18581
+ {
18582
+ "kind": "function",
18583
+ "name": "jsonHeaders",
18584
+ "return": {
18585
+ "type": {
18586
+ "text": "Record<string, string>"
18587
+ }
18588
+ },
18589
+ "parameters": [
18590
+ {
18591
+ "name": "extra",
18592
+ "optional": true,
18593
+ "type": {
18594
+ "text": "Record<string, string>"
18595
+ }
18596
+ }
18597
+ ],
18598
+ "description": "The headers of a request to the library's own server handlers: the consumer's own, and a\n`Content-Type` of `application/json` that is the ONLY one.\n\n`{ 'Content-Type': 'application/json', ...theirs }` is two keys when theirs is spelled\n`content-type`, and `fetch` joins them into one header, `application/json, application/json`,\nwhich the handlers' content-type check (`refuseUnsafeRequest`) does not read as JSON."
18599
+ }
18600
+ ],
18601
+ "exports": [
18602
+ {
18603
+ "kind": "js",
18604
+ "name": "jsonHeaders",
18605
+ "declaration": {
18606
+ "name": "jsonHeaders",
18607
+ "module": "src/transport/json-headers.ts"
18608
+ }
18609
+ }
18610
+ ]
18611
+ },
18612
+ {
18613
+ "kind": "javascript-module",
18614
+ "path": "src/transport/request-guard.ts",
18615
+ "declarations": [
18616
+ {
18617
+ "kind": "function",
18618
+ "name": "refuseUnsafeRequest",
18619
+ "return": {
18620
+ "type": {
18621
+ "text": "Response | null"
18622
+ }
18623
+ },
18624
+ "parameters": [
18625
+ {
18626
+ "name": "req",
18627
+ "type": {
18628
+ "text": "Request"
18629
+ }
18630
+ },
18631
+ {
18632
+ "name": "allowedOrigins",
18633
+ "optional": true,
18634
+ "type": {
18635
+ "text": "readonly string[]"
18636
+ }
18637
+ }
18638
+ ],
18639
+ "description": "`415` unless the body is declared `application/json` (parameters such as `charset` ignored); `403` for an `Origin` the host did not list."
18640
+ }
18641
+ ],
18642
+ "exports": [
18643
+ {
18644
+ "kind": "js",
18645
+ "name": "refuseUnsafeRequest",
18646
+ "declaration": {
18647
+ "name": "refuseUnsafeRequest",
18648
+ "module": "src/transport/request-guard.ts"
18649
+ }
18650
+ }
18651
+ ]
18652
+ },
17878
18653
  {
17879
18654
  "kind": "javascript-module",
17880
18655
  "path": "src/transport/types.ts",
@@ -18328,14 +19103,6 @@
18328
19103
  "module": "./models.js"
18329
19104
  }
18330
19105
  },
18331
- {
18332
- "kind": "js",
18333
- "name": "AparteMessageBranch",
18334
- "declaration": {
18335
- "name": "AparteMessageBranch",
18336
- "module": "./models.js"
18337
- }
18338
- },
18339
19106
  {
18340
19107
  "kind": "js",
18341
19108
  "name": "AparteBubbleActionsConfig",
@@ -19952,6 +20719,40 @@
19952
20719
  }
19953
20720
  ]
19954
20721
  },
20722
+ {
20723
+ "kind": "javascript-module",
20724
+ "path": "src/utils/rendered-content.ts",
20725
+ "declarations": [
20726
+ {
20727
+ "kind": "function",
20728
+ "name": "inRenderedContent",
20729
+ "return": {
20730
+ "type": {
20731
+ "text": "boolean"
20732
+ }
20733
+ },
20734
+ "parameters": [
20735
+ {
20736
+ "name": "el",
20737
+ "type": {
20738
+ "text": "Element | null | undefined"
20739
+ }
20740
+ }
20741
+ ],
20742
+ "description": "True when `el` is inside the rendered body of a message (or a checkpoint's summary)."
20743
+ }
20744
+ ],
20745
+ "exports": [
20746
+ {
20747
+ "kind": "js",
20748
+ "name": "inRenderedContent",
20749
+ "declaration": {
20750
+ "name": "inRenderedContent",
20751
+ "module": "src/utils/rendered-content.ts"
20752
+ }
20753
+ }
20754
+ ]
20755
+ },
19955
20756
  {
19956
20757
  "kind": "javascript-module",
19957
20758
  "path": "src/utils/segments.ts",
@@ -21098,6 +21899,13 @@
21098
21899
  "default": "new Map<string, DrawnSegment>()",
21099
21900
  "description": "Every segment on screen, by id: see DrawnSegment."
21100
21901
  },
21902
+ {
21903
+ "kind": "field",
21904
+ "name": "_written",
21905
+ "privacy": "private",
21906
+ "default": "new Set<string>()",
21907
+ "description": "Segments written to with no `isStreaming: false` yet: settled when the message stops streaming."
21908
+ },
21101
21909
  {
21102
21910
  "kind": "field",
21103
21911
  "name": "_releasedWhileDetached",
@@ -21557,6 +22365,17 @@
21557
22365
  ],
21558
22366
  "description": "Append content to a segment"
21559
22367
  },
22368
+ {
22369
+ "kind": "method",
22370
+ "name": "_settleWrittenSegments",
22371
+ "privacy": "private",
22372
+ "return": {
22373
+ "type": {
22374
+ "text": "void"
22375
+ }
22376
+ },
22377
+ "description": "The message stopped streaming, so a segment it was still writing is finished too.\n\nA segment written to with no `isStreaming` flag — `appendToSegment` from a stream driven\nby hand, as the docs' own streaming demo does — goes through the incremental Markdown\nparser, which holds back what may still open a token (the full stop after `**bold**`)\nuntil it is told the text is complete. Nothing told it: the message ended with its tail\nmissing. Marked finished here, it is flushed and settled like any finished segment."
22378
+ },
21560
22379
  {
21561
22380
  "kind": "method",
21562
22381
  "name": "getSegments",
@@ -25300,7 +26119,7 @@
25300
26119
  "declarations": [
25301
26120
  {
25302
26121
  "kind": "class",
25303
- "description": "A gauge of the model's context window: how much of it the conversation uses, and what\nfills it.\n\nIt draws one number against the window. The number is what the last turn REPORTED —\n`aparte-message-done` carries the provider's usage, and the prompt tokens of the last call\nare the size of the context as the model saw it — for as long as nothing the model reads\nhas changed since. Once something has (a compaction summarised the history, a Restore\nbrought it back), the reported number describes a request that will not be sent again, so\nthe gauge measures the request that WOULD be sent and prefixes it with `~`: an estimate,\ncalibrated against the last reply, never a stale figure and never a blank. The measure is\n`measureContext`, the same one the compaction plugin decides on.\n\nThe WINDOW is the current model's `contextWindow` (a provider's `/models` fetch fills it\nin), or the `window` attribute when you know better. With no window, or before the first\nturn, it renders nothing — an affordance with nothing to show has no chrome to leave.\n\nTwo thresholds turn it `warn` then `danger` (`data-level`), and crossing one fires\n`aparte-context-threshold`. A turn the model refused as over its window\n(`USAGE_CONTEXT_EXCEEDED` on `aparte-message-error`) turns it `danger` whatever the number\nsays: the model has just said what the number could not.\n\nThe gauge is also a disclosure. It is a button (`aria-expanded`; click, Enter or Space) that\nopens a panel listing what the window holds — the system prompt, the tools, the summary\nof a compacted history, the messages — beside what is free. The parts are estimates and\nlabelled so; what the heuristic cannot see is `other`. When\n`@aparte/plugin-compaction` is registered as the compactor and can say what compacting\nwould do, the panel adds \"Compacting now would free ~N tokens\" and a **Compact now** button.\nWhile a compaction runs the element carries `data-compact=\"running\"`, and `\"failed\"` after a\nfailure, with Retry in the panel. Escape and a click outside close it; nothing opens on hover.\n\n`auto-compact` is deprecated: the plugin decides when to compact now (after a turn, and\nbefore a send that would overflow), so a page does not need the gauge to ask. It still\nworks — a turn that ends in `danger` dispatches `aparte-compact`, one request at a time,\nwith `auto: true` so the plugin can tell it from a button — and it will go away in a\nfuture major version.\n\nA new chat or a conversation loaded in place of the last replaces the reading: it is\ncleared on `aparte-reset-done` and, for a stored conversation, read from its last reply on\n`aparte-conversation-loaded`. A restored reading never asks for a compaction, whatever its\nlevel — that stays tied to the end of a turn.\n\nThe bar wears the `aparte-progress` recipe. `variant=\"ring\"` draws the same reading\nas a ring with the percentage beside it — for a toolbar, where a bar wants a width\nand a ring wants none; the full reading is the ring's `title`. The two share the\nlevels, the events, the panel and the accessible name; only the drawing differs.",
26122
+ "description": "A gauge of the model's context window: how much of it the conversation uses, and what\nfills it.\n\nIt draws one number against the window. The number is what the last turn REPORTED —\n`aparte-message-done` carries the provider's usage, and the prompt tokens of the last call\nare the size of the context as the model saw it — for as long as nothing the model reads\nhas changed since. Once something has (a compaction summarised the history, a Restore\nbrought it back), the reported number describes a request that will not be sent again, so\nthe gauge measures the request that WOULD be sent and prefixes it with `~`: an estimate,\ncalibrated against the last reply, never a stale figure and never a blank. The measure is\n`measureContext`, the same one the compaction plugin decides on.\n\nThe WINDOW is the current model's `contextWindow` (a provider's `/models` fetch fills it\nin), or the `window` attribute when you know better. With no window, or before the first\nturn, it renders nothing — an affordance with nothing to show has no chrome to leave.\n\nTwo thresholds turn it `warn` then `danger` (`data-level`), and crossing one fires\n`aparte-context-threshold`. A turn the model refused as over its window\n(`USAGE_CONTEXT_EXCEEDED` on `aparte-message-error`) turns it `danger` whatever the number\nsays: the model has just said what the number could not.\n\nThe gauge is also a disclosure. It is a button (`aria-expanded`; click, Enter or Space) that\nopens a panel listing what the window holds — the system prompt, the tools, the summary\nof a compacted history, the messages — beside what is free. The parts are estimates and\nlabelled so; what the heuristic cannot see is `other`. When\n`@aparte/plugin-compaction` is registered as the compactor and can say what compacting\nwould do, the panel adds \"Compacting now would free ~N tokens\" and a **Compact now** button.\nWhile a compaction runs the element carries `data-compact=\"running\"`, and `\"failed\"` after a\nfailure, with Retry in the panel. Escape and a click outside close it; nothing opens on hover.\n\nThe gauge never asks for a compaction by itself: `@aparte/plugin-compaction` decides when to\ncompact (after a turn, and before a send that would overflow).\n\nA new chat or a conversation loaded in place of the last replaces the reading: it is\ncleared on `aparte-reset-done` and, for a stored conversation, read from its last reply on\n`aparte-conversation-loaded`.\n\nThe bar wears the `aparte-progress` recipe. `variant=\"ring\"` draws the same reading\nas a ring with the percentage beside it — for a toolbar, where a bar wants a width\nand a ring wants none; the full reading is the ring's `title`. The two share the\nlevels, the events, the panel and the accessible name; only the drawing differs.",
25304
26123
  "name": "AparteContext",
25305
26124
  "cssProperties": [
25306
26125
  {
@@ -25329,15 +26148,6 @@
25329
26148
  "privacy": "private",
25330
26149
  "default": "null"
25331
26150
  },
25332
- {
25333
- "kind": "field",
25334
- "name": "_compactRequested",
25335
- "type": {
25336
- "text": "boolean"
25337
- },
25338
- "privacy": "private",
25339
- "default": "false"
25340
- },
25341
26151
  {
25342
26152
  "kind": "field",
25343
26153
  "name": "_lastDone",
@@ -25485,8 +26295,7 @@
25485
26295
  {
25486
26296
  "kind": "field",
25487
26297
  "name": "_onCompactError",
25488
- "privacy": "private",
25489
- "description": "A failed compaction spends the request too; the next `danger` asks again."
26298
+ "privacy": "private"
25490
26299
  },
25491
26300
  {
25492
26301
  "kind": "field",
@@ -25633,13 +26442,7 @@
25633
26442
  "type": {
25634
26443
  "text": "void"
25635
26444
  }
25636
- },
25637
- "parameters": [
25638
- {
25639
- "name": "askToCompact",
25640
- "default": "false"
25641
- }
25642
- ]
26445
+ }
25643
26446
  },
25644
26447
  {
25645
26448
  "kind": "method",
@@ -25810,7 +26613,7 @@
25810
26613
  "type": {
25811
26614
  "text": "CustomEvent<AparteCompactEventDetail>"
25812
26615
  },
25813
- "description": "Dispatched on `window` when the deprecated `auto-compact` is set and a turn ends in `danger` (`auto: true`, with the `window` it measured against), and by Retry in the panel when no compactor is registered. One automatic request at a time — the next turn in `danger` asks again once the plugin has answered. `@aparte/plugin-compaction` answers it; with no listener nothing happens.",
26616
+ "description": "Dispatched on `window` by Retry in the panel when no compactor is registered. `@aparte/plugin-compaction` answers it; with no listener nothing happens.",
25814
26617
  "name": "aparte-compact"
25815
26618
  }
25816
26619
  ],
@@ -25857,13 +26660,6 @@
25857
26660
  },
25858
26661
  "description": "Tokens in use before a turn of this page has reported any: a restored conversation's last usage. The next turn's usage replaces it."
25859
26662
  },
25860
- {
25861
- "type": {
25862
- "text": "boolean"
25863
- },
25864
- "description": "Deprecated, still works. Dispatch `aparte-compact` (with `auto: true`) on each turn that ends in `danger`, one request at a time. `@aparte/plugin-compaction` decides when to compact by itself now, so leave this off.",
25865
- "name": "auto-compact"
25866
- },
25867
26663
  {
25868
26664
  "type": {
25869
26665
  "text": "string"
@@ -27483,7 +28279,7 @@
27483
28279
  "declarations": [
27484
28280
  {
27485
28281
  "kind": "class",
27486
- "description": "A rail of ticks beside the transcript — one per turn — that shows where you are in a\nlong conversation and jumps back to any message on a click.\n\nThe thing every long chat is missing and no product ships natively: the scrollbar says\nhow far down you are, not which question you are under. This is the minimap of a code\neditor reduced to its ticks, the search marks of a browser's scrollbar, the scrollspy\nof a documentation site — the same ancestry, applied to turns. A tick per USER message\nby default, because a user's turns are the questions and a rail with a tick per reply\nis unreadable on a long thread; `every=\"message\"` marks each one.\n\nIt owns nothing of the transcript: the viewport keeps its scroll, the bubbles keep\ntheir markup, and the rail only READS them — which bubbles exist (a mutation observer\non the chat), which one is under the reader (an intersection observer on the scroll\nsurface, never scroll arithmetic), and the first few words of each for the tick's\nname. A click is a `scrollIntoView` on the bubble, announced first by a cancelable\n`aparte-scroll-rail-jump` so a host that pages history in can load it before the\njump. Honoured by core alone, so it is live by default.\n\nPlace it as a direct child of `<aparte-chat>` (or the wrapper's `[data-aparte-chat]`\nhost): the stylesheet floats it on the transcript's end edge, centred on the transcript\nand clear of a classic scrollbar, and hides it under a coarse pointer, where a 2px\ntick is not a target. Under two ticks it renders nothing — a rail with one mark says\nnothing. It is a list, not a minimap: it takes the height of its ticks, up to a share\nof the transcript (`--aparte-scroll-rail-share`, 60%). When more turns exist than 24px\ntargets fit in that, the pitch tightens to what fits, down to a 6px floor; past that\nthe rail scrolls itself so the current tick is always in view, and the arrow keys walk\nevery tick whatever the pitch.",
28282
+ "description": "A rail of ticks beside the transcript — one per turn — that shows where you are in a\nlong conversation and jumps back to any message on a click.\n\nThe thing every long chat is missing and no product ships natively: the scrollbar says\nhow far down you are, not which question you are under. This is the minimap of a code\neditor reduced to its ticks, the search marks of a browser's scrollbar, the scrollspy\nof a documentation site — the same ancestry, applied to turns. A tick per USER message\nby default, because a user's turns are the questions and a rail with a tick per reply\nis unreadable on a long thread; `every=\"message\"` marks each one.\n\nIt owns nothing of the transcript: the viewport keeps its scroll, the bubbles keep\ntheir markup, and the rail only READS them — which bubbles exist (a mutation observer\non the chat), which one is under the reader (an intersection observer on the scroll\nsurface, never scroll arithmetic), and the first few words of each for the tick's\nname. A click is a `scrollIntoView` on the bubble, announced first by a cancelable\n`aparte-scroll-rail-jump` so a host that pages history in can load it before the\njump. Honoured by core alone, so it is live by default.\n\nPlace it as a direct child of `<aparte-chat>` (or the wrapper's `[data-aparte-chat]`\nhost): the stylesheet floats it on the transcript's end edge, centred on the transcript\nand clear of a classic scrollbar, and hides it under a coarse pointer, where a 2px\ntick is not a target. Under two ticks it renders nothing — a rail with one mark says\nnothing. It is a list, not a minimap: it takes the height of its ticks, up to a share\nof the transcript (`--aparte-scroll-rail-share`, 60%). When more turns exist than 24px\ntargets fit in that, the pitch tightens to what fits, down to a 6px floor; past that\nthe rail scrolls itself so the current tick is always in view, and the arrow keys walk\nevery tick whatever the pitch. The rail is one Tab stop, the current tick: Tab crosses\nit once, however long the conversation, and the arrows, Home and End move inside it.",
27487
28283
  "name": "AparteScrollRail",
27488
28284
  "cssProperties": [
27489
28285
  {
@@ -27565,6 +28361,16 @@
27565
28361
  "privacy": "private",
27566
28362
  "default": "null"
27567
28363
  },
28364
+ {
28365
+ "kind": "field",
28366
+ "name": "_sized",
28367
+ "type": {
28368
+ "text": "HTMLElement[]"
28369
+ },
28370
+ "privacy": "private",
28371
+ "default": "[]",
28372
+ "description": "The boxes the resize observer watches: the host, the transcript and its scroll surface."
28373
+ },
27568
28374
  {
27569
28375
  "kind": "field",
27570
28376
  "name": "_intersections",
@@ -27584,6 +28390,16 @@
27584
28390
  "default": "[]",
27585
28391
  "description": "The bubbles the intersection observer watches — compared by identity, so a re-rendered bubble is re-observed."
27586
28392
  },
28393
+ {
28394
+ "kind": "field",
28395
+ "name": "_bandTargets",
28396
+ "type": {
28397
+ "text": "HTMLElement[]"
28398
+ },
28399
+ "privacy": "private",
28400
+ "default": "[]",
28401
+ "description": "Every message the reading band watches: the ticked ones and, with `every=\"user\"`, the\nreplies too, each read under the question above it."
28402
+ },
27587
28403
  {
27588
28404
  "kind": "field",
27589
28405
  "name": "_observedSurface",
@@ -27596,12 +28412,36 @@
27596
28412
  },
27597
28413
  {
27598
28414
  "kind": "field",
27599
- "name": "_rebuildQueued",
28415
+ "name": "_frameQueued",
27600
28416
  "type": {
27601
28417
  "text": "boolean"
27602
28418
  },
27603
28419
  "privacy": "private",
27604
- "default": "false"
28420
+ "default": "false",
28421
+ "description": "One frame does the queued work: a full rebuild when bubbles came or went, else the re-labels."
28422
+ },
28423
+ {
28424
+ "kind": "field",
28425
+ "name": "_rebuildWanted",
28426
+ "type": {
28427
+ "text": "boolean"
28428
+ },
28429
+ "privacy": "private",
28430
+ "default": "false"
28431
+ },
28432
+ {
28433
+ "kind": "field",
28434
+ "name": "_relabel",
28435
+ "privacy": "private",
28436
+ "default": "new Set<HTMLElement>()",
28437
+ "description": "Ticked bubbles whose text changed since the last frame: only their names can have moved."
28438
+ },
28439
+ {
28440
+ "kind": "field",
28441
+ "name": "_excerpts",
28442
+ "privacy": "private",
28443
+ "default": "new WeakMap<Element, string>()",
28444
+ "description": "Each message's excerpt, read once and forgotten when a mutation touches its text: a\nrebuild re-read the head of all 500 questions of a long conversation, twice a turn, for\nnames that had not changed."
27605
28445
  },
27606
28446
  {
27607
28447
  "kind": "field",
@@ -27625,15 +28465,15 @@
27625
28465
  "kind": "field",
27626
28466
  "name": "_visible",
27627
28467
  "privacy": "private",
27628
- "default": "new Map<string, number>()",
27629
- "description": "Visible ratio per message id in the reading band, from the intersection observer."
28468
+ "default": "new WeakMap<Element, number>()",
28469
+ "description": "Visible ratio per message in the reading band, from the intersection observer. Keyed by\nthe element, not its id: an id changed in place keeps what the observer saw, and a\nbubble that left is let go with it."
27630
28470
  },
27631
28471
  {
27632
28472
  "kind": "field",
27633
28473
  "name": "_onScreen",
27634
28474
  "privacy": "private",
27635
- "default": "new Set<string>()",
27636
- "description": "The bubbles on screen at all, from the second observer; only the last one is read."
28475
+ "default": "new WeakSet<Element>()",
28476
+ "description": "Whether the last question is on screen at all, from the second observer."
27637
28477
  },
27638
28478
  {
27639
28479
  "kind": "field",
@@ -27748,7 +28588,79 @@
27748
28588
  "text": "void"
27749
28589
  }
27750
28590
  },
27751
- "description": "Coalesce a burst of mutations (a streaming reply is one per token) into one rebuild."
28591
+ "description": "Coalesce a burst of mutations into one frame of work: a rebuild, which re-names every tick too."
28592
+ },
28593
+ {
28594
+ "kind": "method",
28595
+ "name": "_queueRelabel",
28596
+ "privacy": "private",
28597
+ "return": {
28598
+ "type": {
28599
+ "text": "void"
28600
+ }
28601
+ },
28602
+ "parameters": [
28603
+ {
28604
+ "name": "bubble",
28605
+ "type": {
28606
+ "text": "HTMLElement"
28607
+ }
28608
+ }
28609
+ ]
28610
+ },
28611
+ {
28612
+ "kind": "method",
28613
+ "name": "_queueFrame",
28614
+ "privacy": "private",
28615
+ "return": {
28616
+ "type": {
28617
+ "text": "void"
28618
+ }
28619
+ }
28620
+ },
28621
+ {
28622
+ "kind": "method",
28623
+ "name": "_ticked",
28624
+ "privacy": "private",
28625
+ "return": {
28626
+ "type": {
28627
+ "text": "boolean"
28628
+ }
28629
+ },
28630
+ "parameters": [
28631
+ {
28632
+ "name": "bubble",
28633
+ "type": {
28634
+ "text": "HTMLElement"
28635
+ }
28636
+ }
28637
+ ],
28638
+ "description": "Whether a bubble has a tick: every message with `every=\"message\"`, else the user's."
28639
+ },
28640
+ {
28641
+ "kind": "method",
28642
+ "name": "_label",
28643
+ "privacy": "private",
28644
+ "return": {
28645
+ "type": {
28646
+ "text": "void"
28647
+ }
28648
+ },
28649
+ "parameters": [
28650
+ {
28651
+ "name": "bubble",
28652
+ "type": {
28653
+ "text": "HTMLElement"
28654
+ }
28655
+ },
28656
+ {
28657
+ "name": "locale",
28658
+ "type": {
28659
+ "text": "AparteLocale"
28660
+ }
28661
+ }
28662
+ ],
28663
+ "description": "Re-name one bubble's tick, written only when the name changed."
27752
28664
  },
27753
28665
  {
27754
28666
  "kind": "method",
@@ -27771,6 +28683,17 @@
27771
28683
  },
27772
28684
  "description": "The element that scrolls: the vanilla container, or the viewport itself under a wrapper."
27773
28685
  },
28686
+ {
28687
+ "kind": "method",
28688
+ "name": "_messages",
28689
+ "privacy": "private",
28690
+ "return": {
28691
+ "type": {
28692
+ "text": "HTMLElement[]"
28693
+ }
28694
+ },
28695
+ "description": "Every message bubble of the transcript, in document order."
28696
+ },
27774
28697
  {
27775
28698
  "kind": "method",
27776
28699
  "name": "_bubbles",
@@ -27779,7 +28702,17 @@
27779
28702
  "type": {
27780
28703
  "text": "HTMLElement[]"
27781
28704
  }
27782
- }
28705
+ },
28706
+ "parameters": [
28707
+ {
28708
+ "name": "all",
28709
+ "default": "this._messages()",
28710
+ "type": {
28711
+ "text": "HTMLElement[]"
28712
+ }
28713
+ }
28714
+ ],
28715
+ "description": "The bubbles that get a tick, from all of them."
27783
28716
  },
27784
28717
  {
27785
28718
  "kind": "method",
@@ -27815,6 +28748,12 @@
27815
28748
  "type": {
27816
28749
  "text": "HTMLElement"
27817
28750
  }
28751
+ },
28752
+ {
28753
+ "name": "locale",
28754
+ "type": {
28755
+ "text": "AparteLocale"
28756
+ }
27818
28757
  }
27819
28758
  ]
27820
28759
  },
@@ -27854,9 +28793,15 @@
27854
28793
  "type": {
27855
28794
  "text": "HTMLElement[]"
27856
28795
  }
28796
+ },
28797
+ {
28798
+ "name": "all",
28799
+ "type": {
28800
+ "text": "HTMLElement[]"
28801
+ }
27857
28802
  }
27858
28803
  ],
27859
- "description": "Which tick is current is read, not computed: the scroll surface is the root and an\nintersection observer reports which bubbles reach a reading band — the top 30% of\nthe surface, from its very top so that the bubble a jump aligned there counts. The\nrule is a scrollspy's: the LAST question that has reached the band is the one the\nreader is under. (The largest visible share would name the first of three questions\nsitting in the band at the bottom of a thread of short turns.) The one scroll\nposition read is the bottom, because there the reader is under the latest question\nwhatever the band holds, and the observer has nothing to report on the last few\npixels."
28804
+ "description": "Which tick is current is read, not computed: the scroll surface is the root and an\nintersection observer reports which bubbles reach a reading band — the top 30% of\nthe surface, from its very top so that the bubble a jump aligned there counts. The\nrule is a scrollspy's: the LAST question that has reached the band is the one the\nreader is under. (The largest visible share would name the first of three questions\nsitting in the band at the bottom of a thread of short turns.) The one scroll\nposition read is the bottom, because there the reader is under the latest question\nwhatever the band holds, and the observer has nothing to report on the last few\npixels.\n\nThe replies are watched too, and a reply in the band is read under its question. With\nthe questions alone the band was empty whenever the reader was inside a long reply, and\nnothing moved the mark when the layout did: a bubble never rendered has an estimated\nheight (`content-visibility`) and takes its real one once the scroll has stopped, so a\nstill reader's question changed with no scroll and no question crossing the band. The\nobserver reports a reply entering the band whatever moved it."
27860
28805
  },
27861
28806
  {
27862
28807
  "kind": "method",
@@ -27895,6 +28840,36 @@
27895
28840
  }
27896
28841
  }
27897
28842
  },
28843
+ {
28844
+ "kind": "method",
28845
+ "name": "_lastAbove",
28846
+ "privacy": "private",
28847
+ "return": {
28848
+ "type": {
28849
+ "text": "string | null"
28850
+ }
28851
+ },
28852
+ "description": "The last question whose top is above the reading band's lower edge: by halves, since\nthe questions are in document order and their tops only grow. A question never\nrendered has its estimated height (`content-visibility`), which keeps that order.\n`null` when no question is above the edge or nothing is laid out, and the mark stays\nas it was."
28853
+ },
28854
+ {
28855
+ "kind": "method",
28856
+ "name": "_markFor",
28857
+ "privacy": "private",
28858
+ "return": {
28859
+ "type": {
28860
+ "text": "string"
28861
+ }
28862
+ },
28863
+ "parameters": [
28864
+ {
28865
+ "name": "bubble",
28866
+ "type": {
28867
+ "text": "HTMLElement"
28868
+ }
28869
+ }
28870
+ ],
28871
+ "description": "The tick a message is read under: its own, else the question above it, as the band reads a reply."
28872
+ },
27898
28873
  {
27899
28874
  "kind": "method",
27900
28875
  "name": "_setCurrent",
@@ -27913,6 +28888,59 @@
27913
28888
  }
27914
28889
  ]
27915
28890
  },
28891
+ {
28892
+ "kind": "method",
28893
+ "name": "_syncTabStop",
28894
+ "privacy": "private",
28895
+ "return": {
28896
+ "type": {
28897
+ "text": "void"
28898
+ }
28899
+ },
28900
+ "parameters": [
28901
+ {
28902
+ "name": "ignoreFocus",
28903
+ "default": "false"
28904
+ }
28905
+ ],
28906
+ "description": "One Tab stop for the whole rail, as in a toolbar: the tick that has the focus, else\nthe current one, else the last. Every tick was a button in the tab order, so a\nkeyboard reader crossed 500 of them between the transcript and the composer of a\nlong conversation; the arrows, Home and End walk the rail instead."
28907
+ },
28908
+ {
28909
+ "kind": "field",
28910
+ "name": "_onFocusIn",
28911
+ "privacy": "private",
28912
+ "description": "The stop follows the focus onto a tick, however it got there: the arrows, a click (a\nclick on the current tick moved the focus but not the stop, which made two), a host's\n`focus()`."
28913
+ },
28914
+ {
28915
+ "kind": "field",
28916
+ "name": "_onFocusOut",
28917
+ "privacy": "private",
28918
+ "description": "Leaving the rail, the stop goes back to the current tick: Tab back in lands where the reader is."
28919
+ },
28920
+ {
28921
+ "kind": "method",
28922
+ "name": "_setTabStop",
28923
+ "privacy": "private",
28924
+ "return": {
28925
+ "type": {
28926
+ "text": "void"
28927
+ }
28928
+ },
28929
+ "parameters": [
28930
+ {
28931
+ "name": "stop",
28932
+ "type": {
28933
+ "text": "HTMLElement"
28934
+ }
28935
+ },
28936
+ {
28937
+ "name": "ticks",
28938
+ "type": {
28939
+ "text": "HTMLElement[]"
28940
+ }
28941
+ }
28942
+ ]
28943
+ },
27916
28944
  {
27917
28945
  "kind": "method",
27918
28946
  "name": "_reveal",
@@ -27932,6 +28960,17 @@
27932
28960
  ],
27933
28961
  "description": "Past the floor the rail scrolls itself: the current tick is kept inside its window."
27934
28962
  },
28963
+ {
28964
+ "kind": "method",
28965
+ "name": "_watchSizes",
28966
+ "privacy": "private",
28967
+ "return": {
28968
+ "type": {
28969
+ "text": "void"
28970
+ }
28971
+ },
28972
+ "description": "Point the resize observer at the boxes the geometry is read from. Re-pointed on each\nrebuild: a viewport a wrapper mounts after the rail, or replaces, was never watched, and\nthe panel or composer that resized it later left the rail measuring the old box. The\nscroll surface is watched for itself: a classic scrollbar appearing narrows it without\nresizing the viewport, and the rail has to move clear of the bar."
28973
+ },
27935
28974
  {
27936
28975
  "kind": "method",
27937
28976
  "name": "_write",
@@ -30041,6 +31080,56 @@
30041
31080
  }
30042
31081
  }
30043
31082
  },
31083
+ {
31084
+ "kind": "field",
31085
+ "name": "_sending",
31086
+ "type": {
31087
+ "text": "boolean"
31088
+ },
31089
+ "privacy": "private",
31090
+ "default": "false"
31091
+ },
31092
+ {
31093
+ "kind": "field",
31094
+ "name": "_sendingTimer",
31095
+ "type": {
31096
+ "text": "ReturnType<typeof setTimeout> | undefined"
31097
+ },
31098
+ "privacy": "private"
31099
+ },
31100
+ {
31101
+ "kind": "field",
31102
+ "name": "_stopHolding",
31103
+ "privacy": "private"
31104
+ },
31105
+ {
31106
+ "kind": "field",
31107
+ "name": "_onTurnStart",
31108
+ "privacy": "private",
31109
+ "description": "The latch ends when ITS chat's turn starts. Another chat's `aparte-message-start` crosses the\nwindow too, and must not release it: the second chip would then send a second message while the\nfirst is still being built. The composer's own rule: an event naming no chat is for every chat."
31110
+ },
31111
+ {
31112
+ "kind": "method",
31113
+ "name": "_ownChatId",
31114
+ "privacy": "private",
31115
+ "return": {
31116
+ "type": {
31117
+ "text": "string | undefined"
31118
+ }
31119
+ },
31120
+ "description": "The chat the sending composer belongs to: its `target`, else the id of the chat host above it."
31121
+ },
31122
+ {
31123
+ "kind": "method",
31124
+ "name": "_holdUntilStreaming",
31125
+ "privacy": "private",
31126
+ "return": {
31127
+ "type": {
31128
+ "text": "void"
31129
+ }
31130
+ },
31131
+ "description": "A chip sent: no other chip sends until the turn has started, or a second has passed without one."
31132
+ },
30044
31133
  {
30045
31134
  "kind": "method",
30046
31135
  "name": "_activate",
@@ -30096,7 +31185,7 @@
30096
31185
  "type": {
30097
31186
  "text": "boolean"
30098
31187
  },
30099
- "description": "Shows the replies the LAST message offered instead of fixed starters: a code block in language `suggestions` in that answer (`setupSuggestionBlocks`), e.g. the free times a booking bot proposes. Empty until an answer offers some, emptied the moment a message is sent, and when the last message is the person's."
31188
+ "description": "Shows the replies the LAST message offered instead of fixed starters: a code block in language `suggestions` in that answer (`setupSuggestionBlocks`), e.g. the free times a booking bot proposes. Written by the model, so a reply sends what its chip shows: its label, never a `prompt`. Empty until an answer offers some, emptied the moment a message is sent, and when the last message is the person's."
30100
31189
  },
30101
31190
  {
30102
31191
  "type": {
@@ -30202,6 +31291,24 @@
30202
31291
  "default": "'suggestions'",
30203
31292
  "description": "The language the block is written in."
30204
31293
  },
31294
+ {
31295
+ "kind": "function",
31296
+ "name": "visibleReply",
31297
+ "return": {
31298
+ "type": {
31299
+ "text": "string | null"
31300
+ }
31301
+ },
31302
+ "parameters": [
31303
+ {
31304
+ "name": "reply",
31305
+ "type": {
31306
+ "text": "Reply"
31307
+ }
31308
+ }
31309
+ ],
31310
+ "description": "A model-written reply, reduced to what its button shows: the label alone, never a `prompt`.\nRuns of whitespace collapse to one space. `null` for a reply with no label to see (blank),\na label with anything in it that draws nothing or reorders what is drawn (bidi controls,\ntag characters, variation selectors, stray joiners), and a label past 100 characters: what\nis sent must be exactly what the person can read on the chip."
31311
+ },
30205
31312
  {
30206
31313
  "kind": "function",
30207
31314
  "name": "setupSuggestionBlocks",
@@ -30231,6 +31338,14 @@
30231
31338
  "module": "src/components/suggestions/suggestion-blocks.ts"
30232
31339
  }
30233
31340
  },
31341
+ {
31342
+ "kind": "js",
31343
+ "name": "visibleReply",
31344
+ "declaration": {
31345
+ "name": "visibleReply",
31346
+ "module": "src/components/suggestions/suggestion-blocks.ts"
31347
+ }
31348
+ },
30234
31349
  {
30235
31350
  "kind": "js",
30236
31351
  "name": "setupSuggestionBlocks",
@@ -30685,6 +31800,16 @@
30685
31800
  "default": "false",
30686
31801
  "description": "When true, _reRenderActivePath() only dispatches aparte-path-changed without\ntouching the DOM. Set via setFrameworkManagedDOM(true) when a framework\n(e.g. Angular) owns the bubble elements."
30687
31802
  },
31803
+ {
31804
+ "kind": "field",
31805
+ "name": "_bulkAppend",
31806
+ "type": {
31807
+ "text": "boolean"
31808
+ },
31809
+ "privacy": "private",
31810
+ "default": "false",
31811
+ "description": "Inside `setMessages`: each append leaves the layout work to the end of the loop."
31812
+ },
30688
31813
  {
30689
31814
  "kind": "field",
30690
31815
  "name": "loading",
@@ -30755,7 +31880,7 @@
30755
31880
  "text": "void"
30756
31881
  }
30757
31882
  },
30758
- "description": "Mirror `locale.direction` onto the scroll container."
31883
+ "description": "Mirror `locale.direction` onto the scroll surface: the container, or the viewport itself\nwhen a framework renders the messages — a wrapper's transcript stayed left to right\nunder a right-to-left locale while its composer turned."
30759
31884
  },
30760
31885
  {
30761
31886
  "kind": "method",
@@ -31416,17 +32541,6 @@
31416
32541
  ],
31417
32542
  "description": "Clear all messages and remove all bubble elements from the DOM.\nAlso dispatches a aparte-reset-done event.\n\nIn framework-managed mode the DOM is owned by the host framework\n(Angular"
31418
32543
  },
31419
- {
31420
- "kind": "method",
31421
- "name": "clearMessages",
31422
- "return": {
31423
- "type": {
31424
- "text": "void"
31425
- }
31426
- },
31427
- "description": "Clear all messages",
31428
- "deprecated": "Use clearAll() to also remove DOM bubbles"
31429
- },
31430
32544
  {
31431
32545
  "kind": "method",
31432
32546
  "name": "setMessages",