@aparte/core 1.4.0 → 1.6.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 (47) hide show
  1. package/dist/client/agent-runner.d.ts.map +1 -1
  2. package/dist/client/aparte-client.d.ts +6 -0
  3. package/dist/client/aparte-client.d.ts.map +1 -1
  4. package/dist/client/stream-adapter.d.ts +52 -2
  5. package/dist/client/stream-adapter.d.ts.map +1 -1
  6. package/dist/client/wire-history.d.ts +3 -2
  7. package/dist/client/wire-history.d.ts.map +1 -1
  8. package/dist/components/bubble/aparte-chat-bubble.d.ts +1 -1
  9. package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
  10. package/dist/components/conversation-list/aparte-conversation-list.d.ts +11 -0
  11. package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
  12. package/dist/components/launcher/aparte-launcher.d.ts +2 -0
  13. package/dist/components/launcher/aparte-launcher.d.ts.map +1 -1
  14. package/dist/components/sidebar/aparte-sidebar.d.ts +42 -5
  15. package/dist/components/sidebar/aparte-sidebar.d.ts.map +1 -1
  16. package/dist/components/viewport/aparte-chat-viewport.d.ts +5 -0
  17. package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
  18. package/dist/config/aparte-config.d.ts +69 -4
  19. package/dist/config/aparte-config.d.ts.map +1 -1
  20. package/dist/config/locale.d.ts +9 -0
  21. package/dist/config/locale.d.ts.map +1 -1
  22. package/dist/custom-elements.json +2244 -1659
  23. package/dist/{defer-hydration-lK-7XQXf.js → defer-hydration-W4yhnyfc.js} +406 -143
  24. package/dist/defer-hydration-W4yhnyfc.js.map +1 -0
  25. package/dist/generated/element-attributes.d.ts +4 -2
  26. package/dist/generated/element-attributes.d.ts.map +1 -1
  27. package/dist/index.css +1 -1
  28. package/dist/index.d.ts +6 -2
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +167 -90
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.node.d.ts +6 -2
  33. package/dist/index.node.d.ts.map +1 -1
  34. package/dist/index.node.js +52 -47
  35. package/dist/index.node.js.map +1 -1
  36. package/dist/renderers/segments/tool-call.d.ts.map +1 -1
  37. package/dist/transport/agent-handler.d.ts.map +1 -1
  38. package/dist/types/index.d.ts +1 -1
  39. package/dist/types/index.d.ts.map +1 -1
  40. package/dist/types/tools.d.ts +40 -0
  41. package/dist/types/tools.d.ts.map +1 -1
  42. package/dist/utils/segment-list.d.ts +49 -0
  43. package/dist/utils/segment-list.d.ts.map +1 -0
  44. package/dist/utils/tool-line.d.ts +36 -9
  45. package/dist/utils/tool-line.d.ts.map +1 -1
  46. package/package.json +2 -2
  47. package/dist/defer-hydration-lK-7XQXf.js.map +0 -1
@@ -793,6 +793,14 @@
793
793
  "module": "./types/index.js"
794
794
  }
795
795
  },
796
+ {
797
+ "kind": "js",
798
+ "name": "AparteToolRun",
799
+ "declaration": {
800
+ "name": "AparteToolRun",
801
+ "module": "./types/index.js"
802
+ }
803
+ },
796
804
  {
797
805
  "kind": "js",
798
806
  "name": "AparteToolRenderer",
@@ -841,6 +849,14 @@
841
849
  "module": "./types/index.js"
842
850
  }
843
851
  },
852
+ {
853
+ "kind": "js",
854
+ "name": "AparteToolLine",
855
+ "declaration": {
856
+ "name": "AparteToolLine",
857
+ "module": "./types/index.js"
858
+ }
859
+ },
844
860
  {
845
861
  "kind": "js",
846
862
  "name": "AparteToolCallView",
@@ -2449,6 +2465,38 @@
2449
2465
  "module": "./client/stream-adapter.js"
2450
2466
  }
2451
2467
  },
2468
+ {
2469
+ "kind": "js",
2470
+ "name": "runSubAgent",
2471
+ "declaration": {
2472
+ "name": "runSubAgent",
2473
+ "module": "./client/stream-adapter.js"
2474
+ }
2475
+ },
2476
+ {
2477
+ "kind": "js",
2478
+ "name": "startSubAgent",
2479
+ "declaration": {
2480
+ "name": "startSubAgent",
2481
+ "module": "./client/stream-adapter.js"
2482
+ }
2483
+ },
2484
+ {
2485
+ "kind": "js",
2486
+ "name": "AparteRunEventContext",
2487
+ "declaration": {
2488
+ "name": "AparteRunEventContext",
2489
+ "module": "./config/aparte-config.js"
2490
+ }
2491
+ },
2492
+ {
2493
+ "kind": "js",
2494
+ "name": "AparteRunEventObserver",
2495
+ "declaration": {
2496
+ "name": "AparteRunEventObserver",
2497
+ "module": "./config/aparte-config.js"
2498
+ }
2499
+ },
2452
2500
  {
2453
2501
  "kind": "js",
2454
2502
  "name": "createAgentStreamRunner",
@@ -2657,6 +2705,38 @@
2657
2705
  "module": "./utils/segments.js"
2658
2706
  }
2659
2707
  },
2708
+ {
2709
+ "kind": "js",
2710
+ "name": "createSegmentList",
2711
+ "declaration": {
2712
+ "name": "createSegmentList",
2713
+ "module": "./utils/segment-list.js"
2714
+ }
2715
+ },
2716
+ {
2717
+ "kind": "js",
2718
+ "name": "AparteSegmentList",
2719
+ "declaration": {
2720
+ "name": "AparteSegmentList",
2721
+ "module": "./utils/segment-list.js"
2722
+ }
2723
+ },
2724
+ {
2725
+ "kind": "js",
2726
+ "name": "pluralize",
2727
+ "declaration": {
2728
+ "name": "pluralize",
2729
+ "module": "./utils/plural.js"
2730
+ }
2731
+ },
2732
+ {
2733
+ "kind": "js",
2734
+ "name": "formatDuration",
2735
+ "declaration": {
2736
+ "name": "formatDuration",
2737
+ "module": "./utils/format-duration.js"
2738
+ }
2739
+ },
2660
2740
  {
2661
2741
  "kind": "js",
2662
2742
  "name": "AparteHostHandlersConfig",
@@ -3675,6 +3755,14 @@
3675
3755
  "module": "./types/index.js"
3676
3756
  }
3677
3757
  },
3758
+ {
3759
+ "kind": "js",
3760
+ "name": "AparteToolRun",
3761
+ "declaration": {
3762
+ "name": "AparteToolRun",
3763
+ "module": "./types/index.js"
3764
+ }
3765
+ },
3678
3766
  {
3679
3767
  "kind": "js",
3680
3768
  "name": "AparteToolRenderer",
@@ -3723,6 +3811,14 @@
3723
3811
  "module": "./types/index.js"
3724
3812
  }
3725
3813
  },
3814
+ {
3815
+ "kind": "js",
3816
+ "name": "AparteToolLine",
3817
+ "declaration": {
3818
+ "name": "AparteToolLine",
3819
+ "module": "./types/index.js"
3820
+ }
3821
+ },
3726
3822
  {
3727
3823
  "kind": "js",
3728
3824
  "name": "AparteToolCallView",
@@ -5235,6 +5331,38 @@
5235
5331
  "module": "./utils/segments.js"
5236
5332
  }
5237
5333
  },
5334
+ {
5335
+ "kind": "js",
5336
+ "name": "createSegmentList",
5337
+ "declaration": {
5338
+ "name": "createSegmentList",
5339
+ "module": "./utils/segment-list.js"
5340
+ }
5341
+ },
5342
+ {
5343
+ "kind": "js",
5344
+ "name": "AparteSegmentList",
5345
+ "declaration": {
5346
+ "name": "AparteSegmentList",
5347
+ "module": "./utils/segment-list.js"
5348
+ }
5349
+ },
5350
+ {
5351
+ "kind": "js",
5352
+ "name": "pluralize",
5353
+ "declaration": {
5354
+ "name": "pluralize",
5355
+ "module": "./utils/plural.js"
5356
+ }
5357
+ },
5358
+ {
5359
+ "kind": "js",
5360
+ "name": "formatDuration",
5361
+ "declaration": {
5362
+ "name": "formatDuration",
5363
+ "module": "./utils/format-duration.js"
5364
+ }
5365
+ },
5238
5366
  {
5239
5367
  "kind": "js",
5240
5368
  "name": "AparteHostHandlersConfig",
@@ -5291,6 +5419,38 @@
5291
5419
  "module": "./client/stream-adapter.js"
5292
5420
  }
5293
5421
  },
5422
+ {
5423
+ "kind": "js",
5424
+ "name": "runSubAgent",
5425
+ "declaration": {
5426
+ "name": "runSubAgent",
5427
+ "module": "./client/stream-adapter.js"
5428
+ }
5429
+ },
5430
+ {
5431
+ "kind": "js",
5432
+ "name": "startSubAgent",
5433
+ "declaration": {
5434
+ "name": "startSubAgent",
5435
+ "module": "./client/stream-adapter.js"
5436
+ }
5437
+ },
5438
+ {
5439
+ "kind": "js",
5440
+ "name": "AparteRunEventContext",
5441
+ "declaration": {
5442
+ "name": "AparteRunEventContext",
5443
+ "module": "./config/aparte-config.js"
5444
+ }
5445
+ },
5446
+ {
5447
+ "kind": "js",
5448
+ "name": "AparteRunEventObserver",
5449
+ "declaration": {
5450
+ "name": "AparteRunEventObserver",
5451
+ "module": "./config/aparte-config.js"
5452
+ }
5453
+ },
5294
5454
  {
5295
5455
  "kind": "js",
5296
5456
  "name": "createAgentStreamRunner",
@@ -5939,7 +6099,7 @@
5939
6099
  {
5940
6100
  "name": "event",
5941
6101
  "type": {
5942
- "text": "{ id: string; name: string; input: Record<string, unknown> }"
6102
+ "text": "{ id: string; name: string; input: Record<string, unknown>; agent?: { id: string; name?: string } }"
5943
6103
  }
5944
6104
  },
5945
6105
  {
@@ -6068,6 +6228,14 @@
6068
6228
  "default": "new Set<string>()",
6069
6229
  "description": "Replies a turn is running into right now, a pause it waits on included: a second\nload of their conversation must not start them again (`resumeDeferred`)."
6070
6230
  },
6231
+ {
6232
+ "kind": "field",
6233
+ "name": "_agentNames",
6234
+ "privacy": "private",
6235
+ "readonly": true,
6236
+ "default": "new Map<string, Map<string, string>>()",
6237
+ "description": "The name of each sub-agent of a turn in flight, by reply then `agentId`, as its\n`agent-start` gave it: what a paused run's question says about who asks. A pending\ncall carries only an `agentId`. Lives as long as the turn, never on the message."
6238
+ },
6071
6239
  {
6072
6240
  "kind": "method",
6073
6241
  "name": "_toolsForCurrentModel",
@@ -6649,6 +6817,12 @@
6649
6817
  "text": "AparteChatTargetElement"
6650
6818
  }
6651
6819
  },
6820
+ {
6821
+ "name": "messageId",
6822
+ "type": {
6823
+ "text": "string"
6824
+ }
6825
+ },
6652
6826
  {
6653
6827
  "name": "pending",
6654
6828
  "type": {
@@ -6698,7 +6872,7 @@
6698
6872
  {
6699
6873
  "name": "call",
6700
6874
  "type": {
6701
- "text": "AparteToolCall"
6875
+ "text": "AparteToolCall & Pick<Parameters<StreamApprovalResolver>[0], 'agent'>"
6702
6876
  }
6703
6877
  },
6704
6878
  {
@@ -7015,6 +7189,24 @@
7015
7189
  "default": "engineToolRefusal",
7016
7190
  "description": "What a refused tool call tells the model, and who refused it — engine's `toolRefusal`,\nunder core's roof. `reason` is the sentence the model reads (the refuser's own, else\nthe person's words quoted, else \"Tool execution was rejected by the user.\"); `by` and\n`instruction` are what a row shows the person.\n\nFor a runner that answers an agent the loop does not run (an AG-UI agent, a server):\nit writes the sentence the loop writes, so the model reads one refusal however it ran."
7017
7191
  },
7192
+ {
7193
+ "kind": "variable",
7194
+ "name": "runSubAgent",
7195
+ "type": {
7196
+ "text": "typeof engineRunSubAgent"
7197
+ },
7198
+ "default": "engineRunSubAgent",
7199
+ "description": "Run a sub-agent from inside a tool handler — engine's `runSubAgent`, under core's roof.\n`run` is the handler's `context.run`, `signal` its second argument; `request` is the\nsub-agent's own conversation. Its events reach the page as the sub-agent's: kept out of\nthe reply, and handed to the observers of AparteConfig.observeRunEvents.\n\nResolves `{ status, text }` and never rejects for a sub-agent that failed, so the tool\ndecides what the model reads. A handler called without a run (a browser tool answering\na paused server run) has nothing to open one from, and rejects with a clear error."
7200
+ },
7201
+ {
7202
+ "kind": "variable",
7203
+ "name": "startSubAgent",
7204
+ "type": {
7205
+ "text": "typeof engineStartSubAgent"
7206
+ },
7207
+ "default": "engineStartSubAgent",
7208
+ "description": "Start a sub-agent in the background, from inside a tool handler — engine's `startSubAgent`.\nThe handler answers at once and the model goes on, writing and calling tools, while the\nsub-agent works on its own line; the reply does not end before it is back. Once the model\nhas nothing more to say, the loop waits for the sub-agents still at work, tells the model\nhow each ended, and asks it again. A Stop, a pause of the run, the turn limit or a crash\nstop it."
7209
+ },
7018
7210
  {
7019
7211
  "kind": "function",
7020
7212
  "name": "createStreamAdapter",
@@ -7067,6 +7259,22 @@
7067
7259
  "module": "src/client/stream-adapter.ts"
7068
7260
  }
7069
7261
  },
7262
+ {
7263
+ "kind": "js",
7264
+ "name": "runSubAgent",
7265
+ "declaration": {
7266
+ "name": "runSubAgent",
7267
+ "module": "src/client/stream-adapter.ts"
7268
+ }
7269
+ },
7270
+ {
7271
+ "kind": "js",
7272
+ "name": "startSubAgent",
7273
+ "declaration": {
7274
+ "name": "startSubAgent",
7275
+ "module": "src/client/stream-adapter.ts"
7276
+ }
7277
+ },
7070
7278
  {
7071
7279
  "kind": "js",
7072
7280
  "name": "createStreamAdapter",
@@ -7195,7 +7403,7 @@
7195
7403
  "name": "options",
7196
7404
  "default": "{}",
7197
7405
  "type": {
7198
- "text": "{\n /**\n * Leave this message's paused calls unanswered: the request that RESUMES them\n * sends the envelope with those calls open, for the server to answer them.\n */\n openDeferred?: boolean;\n }"
7406
+ "text": "{\n /**\n * Leave this message's paused calls unanswered — and its calls still running: the\n * request that RESUMES them sends the envelope with those calls open, for the\n * server to answer them.\n */\n openDeferred?: boolean;\n }"
7199
7407
  }
7200
7408
  }
7201
7409
  ],
@@ -7367,453 +7575,846 @@
7367
7575
  },
7368
7576
  {
7369
7577
  "kind": "javascript-module",
7370
- "path": "src/config/action-provider.ts",
7578
+ "path": "src/components/index.ts",
7371
7579
  "declarations": [],
7372
- "exports": []
7373
- },
7374
- {
7375
- "kind": "javascript-module",
7376
- "path": "src/config/aparte-config.ts",
7377
- "declarations": [
7580
+ "exports": [
7378
7581
  {
7379
- "kind": "variable",
7380
- "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
7381
- "type": {
7382
- "text": "{\n copy: false,\n retry: false,\n edit: false,\n feedback: false,\n info: false,\n}"
7383
- },
7384
- "default": "{ copy: false, retry: false, edit: false, feedback: false, info: false, }",
7385
- "description": "The bubble-action defaults — all off: a message carries no button until the app asks for one.\n\nRetry and edit only do something when a host (`AparteClient`) re-sends and rewrites,\nand feedback/info only when the app listens for `aparte-feedback` /\n`aparte-message-info`; rendering them unconditionally showed dead buttons in every\ndisplay-only integration — ours included, which is how we found it. Copy is the one\ncore could honor alone, and it is off too: a help widget or a support chat is read,\nnot quoted, and a chat product that wants it turns it on in one line\n(`setBubbleActions({ copy: true })`).\n\nExported so a consumer can read the defaults instead of hard-coding them."
7582
+ "kind": "js",
7583
+ "name": "AparteChat",
7584
+ "declaration": {
7585
+ "name": "AparteChat",
7586
+ "module": "./chat/index.js"
7587
+ }
7386
7588
  },
7387
7589
  {
7388
- "kind": "variable",
7389
- "name": "APARTE_DEFAULT_HOST_HANDLERS",
7390
- "type": {
7391
- "text": "{\n attachmentPreview: false,\n filePreview: false,\n}"
7392
- },
7393
- "default": "{ attachmentPreview: false, filePreview: false, }",
7394
- "description": "The host-handler declarations — nothing declared.\n\nSame rule as APARTE_DEFAULT_BUBBLE_ACTIONS, applied outside the action bar: an\nimage tile you can click is a request core forwards to the app. Undeclared, it is\nnot rendered (and the tile is not even signalled as clickable) instead of doing\nnothing."
7590
+ "kind": "js",
7591
+ "name": "AparteChatBubble",
7592
+ "declaration": {
7593
+ "name": "AparteChatBubble",
7594
+ "module": "./bubble/index.js"
7595
+ }
7395
7596
  },
7396
7597
  {
7397
- "kind": "function",
7398
- "name": "renderingVersionOf",
7399
- "return": {
7400
- "type": {
7401
- "text": "number"
7402
- }
7403
- },
7404
- "parameters": [
7405
- {
7406
- "name": "cfg",
7407
- "type": {
7408
- "text": "AparteConfig"
7409
- }
7410
- }
7411
- ]
7598
+ "kind": "js",
7599
+ "name": "populateBubbleFromMessage",
7600
+ "declaration": {
7601
+ "name": "populateBubbleFromMessage",
7602
+ "module": "./bubble/index.js"
7603
+ }
7412
7604
  },
7413
7605
  {
7414
- "kind": "function",
7415
- "name": "onRenderersChange",
7416
- "return": {
7417
- "type": {
7418
- "text": "() => void"
7419
- }
7420
- },
7421
- "parameters": [
7422
- {
7423
- "name": "listener",
7424
- "type": {
7425
- "text": "(cfg: AparteConfig) => void"
7426
- }
7427
- }
7428
- ]
7606
+ "kind": "js",
7607
+ "name": "SyncableBubble",
7608
+ "declaration": {
7609
+ "name": "SyncableBubble",
7610
+ "module": "./bubble/index.js"
7611
+ }
7429
7612
  },
7430
7613
  {
7431
- "kind": "function",
7432
- "name": "notifyRenderersChanged",
7433
- "return": {
7434
- "type": {
7435
- "text": "void"
7436
- }
7437
- },
7438
- "parameters": [
7439
- {
7440
- "name": "cfg",
7441
- "type": {
7442
- "text": "AparteConfig"
7443
- }
7444
- }
7445
- ]
7614
+ "kind": "js",
7615
+ "name": "AparteChatStatus",
7616
+ "declaration": {
7617
+ "name": "AparteChatStatus",
7618
+ "module": "./status/index.js"
7619
+ }
7446
7620
  },
7447
7621
  {
7448
- "kind": "class",
7449
- "description": "Everything a chat is configured with: the providers and the selected model, the\ntransport and the keys, the tools, the renderers and render hooks, the Markdown and\nhighlight providers, the locale, the icons, the avatars, the actions.\n\naparteGlobalConfig is the one every chat on the page reads. A chat that needs a\nconfiguration of its own takes a `new AparteConfig()` attached to its element or to an\nancestor with attachConfig; the framework wrappers take it as their `config` prop.\n\nA change to what is drawn — providers, the model, the locale, icons, avatars, actions,\nrenderers — reaches the components already on the page: AparteConfig.subscribe| subscribe() listeners are\ncalled, and `aparte-config-change` is dispatched on `window` with the instance that changed.\nThe Markdown, streaming-Markdown and highlight providers are among them: a message drawn\nbefore they were set is drawn again with them (one still streaming, once it ends). The\nsanitizer, segment defaults, tools, tool renderers and summaries apply to what is drawn\nafter they are set, so set them before the chat renders; the transport, the keys and the\nsystem prompt apply from the next request.",
7450
- "name": "AparteConfig",
7451
- "members": [
7452
- {
7453
- "kind": "field",
7454
- "name": "_markdownProvider",
7455
- "type": {
7456
- "text": "AparteMarkdownProvider | undefined"
7457
- },
7458
- "privacy": "private"
7459
- },
7460
- {
7461
- "kind": "field",
7462
- "name": "_streamingMarkdownProvider",
7463
- "type": {
7464
- "text": "AparteStreamingMarkdownProvider | undefined"
7465
- },
7466
- "privacy": "private"
7467
- },
7468
- {
7469
- "kind": "field",
7470
- "name": "_highlightProvider",
7471
- "type": {
7472
- "text": "AparteHighlightProvider | undefined"
7473
- },
7474
- "privacy": "private"
7475
- },
7476
- {
7477
- "kind": "field",
7478
- "name": "_codeLanguageRenderers",
7479
- "privacy": "private",
7480
- "default": "new Map<string, AparteCodeLanguageRenderer>()"
7481
- },
7482
- {
7483
- "kind": "field",
7484
- "name": "_sanitizer",
7485
- "type": {
7486
- "text": "AparteSanitizer | null"
7487
- },
7488
- "privacy": "private",
7489
- "default": "defaultSanitizer"
7490
- },
7491
- {
7492
- "kind": "field",
7493
- "name": "_imagePolicy",
7494
- "type": {
7495
- "text": "AparteImagePolicy"
7496
- },
7497
- "privacy": "private",
7498
- "default": "[]"
7499
- },
7500
- {
7501
- "kind": "field",
7502
- "name": "_imageDecider",
7503
- "type": {
7504
- "text": "ImageDecider"
7505
- },
7506
- "privacy": "private"
7507
- },
7508
- {
7509
- "kind": "field",
7510
- "name": "_imagePolicyNamed",
7511
- "type": {
7512
- "text": "boolean"
7513
- },
7514
- "privacy": "private",
7515
- "default": "false",
7516
- "description": "Whether the app named an image policy, the default included; see `decideImage`."
7517
- },
7518
- {
7519
- "kind": "field",
7520
- "name": "_systemPromptTemplate",
7521
- "type": {
7522
- "text": "string | undefined"
7523
- },
7524
- "privacy": "private"
7525
- },
7526
- {
7527
- "kind": "field",
7528
- "name": "_systemPromptVarsProvider",
7529
- "type": {
7530
- "text": "AparteSystemPromptVarsProvider | undefined"
7531
- },
7532
- "privacy": "private"
7533
- },
7534
- {
7535
- "kind": "field",
7536
- "name": "_statusRenderer",
7537
- "type": {
7538
- "text": "AparteStatusRenderer | undefined"
7539
- },
7540
- "privacy": "private"
7541
- },
7542
- {
7543
- "kind": "field",
7544
- "name": "_errorRenderer",
7545
- "type": {
7546
- "text": "AparteErrorRenderer | undefined"
7547
- },
7548
- "privacy": "private"
7549
- },
7550
- {
7551
- "kind": "field",
7552
- "name": "_attachmentRenderer",
7553
- "type": {
7554
- "text": "AparteAttachmentRenderer | undefined"
7555
- },
7556
- "privacy": "private"
7557
- },
7558
- {
7559
- "kind": "field",
7560
- "name": "_siblingNavRenderer",
7561
- "type": {
7562
- "text": "AparteSiblingNavRenderer | undefined"
7563
- },
7564
- "privacy": "private"
7565
- },
7566
- {
7567
- "kind": "field",
7568
- "name": "_bubbleShellRenderer",
7569
- "type": {
7570
- "text": "AparteBubbleShellRenderer | undefined"
7571
- },
7572
- "privacy": "private"
7573
- },
7574
- {
7575
- "kind": "field",
7576
- "name": "_iconProvider",
7577
- "type": {
7578
- "text": "AparteIconProvider | undefined"
7579
- },
7580
- "privacy": "private"
7581
- },
7582
- {
7583
- "kind": "field",
7584
- "name": "_avatarProvider",
7585
- "type": {
7586
- "text": "AparteAvatarProvider | undefined"
7587
- },
7588
- "privacy": "private"
7589
- },
7590
- {
7591
- "kind": "field",
7592
- "name": "_keyProvider",
7593
- "type": {
7594
- "text": "AparteKeyProvider | undefined"
7595
- },
7596
- "privacy": "private"
7597
- },
7598
- {
7599
- "kind": "field",
7600
- "name": "_extraKeyProviders",
7601
- "type": {
7602
- "text": "Set<AparteKeyProvider>"
7603
- },
7604
- "privacy": "private",
7605
- "default": "new Set()",
7606
- "description": "Sources added with `registerKeyProvider` — consulted before `_keyProvider`,\nnewest first (see `getKey`)."
7607
- },
7608
- {
7609
- "kind": "field",
7610
- "name": "_locale",
7611
- "type": {
7612
- "text": "AparteLocale"
7613
- },
7614
- "privacy": "private",
7615
- "default": "APARTE_DEFAULT_LOCALE"
7616
- },
7617
- {
7618
- "kind": "field",
7619
- "name": "_actions",
7620
- "type": {
7621
- "text": "AparteAction[]"
7622
- },
7623
- "privacy": "private",
7624
- "default": "[]"
7625
- },
7626
- {
7627
- "kind": "field",
7628
- "name": "_listeners",
7629
- "type": {
7630
- "text": "Set<() => void>"
7631
- },
7632
- "privacy": "private",
7633
- "default": "new Set()"
7634
- },
7635
- {
7636
- "kind": "field",
7637
- "name": "_aiProviders",
7638
- "type": {
7639
- "text": "Map<string, AparteAIProvider>"
7640
- },
7641
- "privacy": "private",
7642
- "default": "new Map()"
7643
- },
7644
- {
7645
- "kind": "field",
7646
- "name": "_fetchedModels",
7647
- "type": {
7648
- "text": "Map<string, AparteAIModel[]>"
7649
- },
7650
- "privacy": "private",
7651
- "default": "new Map()",
7652
- "description": "What `refreshProviderModels()` last brought back, per provider.\n\n`getCurrentModel()` reads it beside `provider.getModels()`, the SYNCHRONOUS,\nhand-declared list, which every preset of `@aparte/provider-openai-compat`\nleaves empty because a compat endpoint's list is fetched at runtime. Without\nthe fetched list the current model resolves to `undefined`, and its declared\ncapabilities are unknown: `AparteClient._toolsForCurrentModel()` still sends the\ntools then, and it is the fetched list that lets a model which declares no\n`function_calling` be honoured."
7653
- },
7654
- {
7655
- "kind": "field",
7656
- "name": "_modelConfig",
7657
- "type": {
7658
- "text": "AparteModelConfig"
7659
- },
7660
- "privacy": "private",
7661
- "default": "{}"
7662
- },
7663
- {
7664
- "kind": "field",
7665
- "name": "_requireModelSelection",
7666
- "type": {
7667
- "text": "boolean"
7668
- },
7669
- "privacy": "private",
7670
- "default": "false",
7671
- "description": "Opt-in: gate the composer (block send + grey out) until a model is selected."
7672
- },
7673
- {
7674
- "kind": "field",
7675
- "name": "_elicitationAllowOther",
7676
- "type": {
7677
- "text": "boolean"
7678
- },
7679
- "privacy": "private",
7680
- "default": "true",
7681
- "description": "Host policy for the elicitation panel's free-text escape — see setElicitationOptions."
7682
- },
7683
- {
7684
- "kind": "field",
7685
- "name": "_elicitationLayout",
7686
- "type": {
7687
- "text": "'stepped' | 'stacked'"
7688
- },
7689
- "privacy": "private",
7690
- "default": "'stepped'"
7691
- },
7692
- {
7693
- "kind": "field",
7694
- "name": "_elicitationAnswerOnClick",
7695
- "type": {
7696
- "text": "boolean"
7697
- },
7698
- "privacy": "private",
7699
- "default": "true",
7700
- "description": "Whether a single choice answers on the click (buttons) or keeps its radios + the composer's button."
7701
- },
7702
- {
7703
- "kind": "field",
7704
- "name": "_elicitationFieldRenderer",
7705
- "type": {
7706
- "text": "AparteElicitationFieldRenderer | undefined | undefined"
7707
- },
7708
- "privacy": "private"
7709
- },
7622
+ "kind": "js",
7623
+ "name": "AparteChatViewport",
7624
+ "declaration": {
7625
+ "name": "AparteChatViewport",
7626
+ "module": "./viewport/index.js"
7627
+ }
7628
+ },
7629
+ {
7630
+ "kind": "js",
7631
+ "name": "AparteComposer",
7632
+ "declaration": {
7633
+ "name": "AparteComposer",
7634
+ "module": "./composer/index.js"
7635
+ }
7636
+ },
7637
+ {
7638
+ "kind": "js",
7639
+ "name": "AparteComposerInput",
7640
+ "declaration": {
7641
+ "name": "AparteComposerInput",
7642
+ "module": "./composer/index.js"
7643
+ }
7644
+ },
7645
+ {
7646
+ "kind": "js",
7647
+ "name": "AparteComposerSend",
7648
+ "declaration": {
7649
+ "name": "AparteComposerSend",
7650
+ "module": "./composer/index.js"
7651
+ }
7652
+ },
7653
+ {
7654
+ "kind": "js",
7655
+ "name": "AparteComposerCancel",
7656
+ "declaration": {
7657
+ "name": "AparteComposerCancel",
7658
+ "module": "./composer/index.js"
7659
+ }
7660
+ },
7661
+ {
7662
+ "kind": "js",
7663
+ "name": "AparteComposerAttachments",
7664
+ "declaration": {
7665
+ "name": "AparteComposerAttachments",
7666
+ "module": "./composer/index.js"
7667
+ }
7668
+ },
7669
+ {
7670
+ "kind": "js",
7671
+ "name": "AparteComposerAddAttachment",
7672
+ "declaration": {
7673
+ "name": "AparteComposerAddAttachment",
7674
+ "module": "./composer/index.js"
7675
+ }
7676
+ },
7677
+ {
7678
+ "kind": "js",
7679
+ "name": "AparteComposerAction",
7680
+ "declaration": {
7681
+ "name": "AparteComposerAction",
7682
+ "module": "./composer/index.js"
7683
+ }
7684
+ },
7685
+ {
7686
+ "kind": "js",
7687
+ "name": "AparteComposerToolbar",
7688
+ "declaration": {
7689
+ "name": "AparteComposerToolbar",
7690
+ "module": "./composer/index.js"
7691
+ }
7692
+ },
7693
+ {
7694
+ "kind": "js",
7695
+ "name": "AparteComposerEventMap",
7696
+ "declaration": {
7697
+ "name": "AparteComposerEventMap",
7698
+ "module": "./composer/index.js"
7699
+ }
7700
+ },
7701
+ {
7702
+ "kind": "js",
7703
+ "name": "AparteComposerEventType",
7704
+ "declaration": {
7705
+ "name": "AparteComposerEventType",
7706
+ "module": "./composer/index.js"
7707
+ }
7708
+ },
7709
+ {
7710
+ "kind": "js",
7711
+ "name": "AparteComposerState",
7712
+ "declaration": {
7713
+ "name": "AparteComposerState",
7714
+ "module": "./composer/index.js"
7715
+ }
7716
+ },
7717
+ {
7718
+ "kind": "js",
7719
+ "name": "AparteComposerChangeEventDetail",
7720
+ "declaration": {
7721
+ "name": "AparteComposerChangeEventDetail",
7722
+ "module": "./composer/index.js"
7723
+ }
7724
+ },
7725
+ {
7726
+ "kind": "js",
7727
+ "name": "AparteComposerPanelMode",
7728
+ "declaration": {
7729
+ "name": "AparteComposerPanelMode",
7730
+ "module": "./composer/index.js"
7731
+ }
7732
+ },
7733
+ {
7734
+ "kind": "js",
7735
+ "name": "AparteTypeToFocus",
7736
+ "declaration": {
7737
+ "name": "AparteTypeToFocus",
7738
+ "module": "./composer/index.js"
7739
+ }
7740
+ },
7741
+ {
7742
+ "kind": "js",
7743
+ "name": "AparteActionClickEventDetail",
7744
+ "declaration": {
7745
+ "name": "AparteActionClickEventDetail",
7746
+ "module": "./composer/index.js"
7747
+ }
7748
+ },
7749
+ {
7750
+ "kind": "js",
7751
+ "name": "AparteConversationList",
7752
+ "declaration": {
7753
+ "name": "AparteConversationList",
7754
+ "module": "./conversation-list/index.js"
7755
+ }
7756
+ },
7757
+ {
7758
+ "kind": "js",
7759
+ "name": "AparteConversationListItem",
7760
+ "declaration": {
7761
+ "name": "AparteConversationListItem",
7762
+ "module": "./conversation-list/index.js"
7763
+ }
7764
+ },
7765
+ {
7766
+ "kind": "js",
7767
+ "name": "AparteConversationSelectDetail",
7768
+ "declaration": {
7769
+ "name": "AparteConversationSelectDetail",
7770
+ "module": "./conversation-list/index.js"
7771
+ }
7772
+ },
7773
+ {
7774
+ "kind": "js",
7775
+ "name": "AparteConversationDeleteDetail",
7776
+ "declaration": {
7777
+ "name": "AparteConversationDeleteDetail",
7778
+ "module": "./conversation-list/index.js"
7779
+ }
7780
+ },
7781
+ {
7782
+ "kind": "js",
7783
+ "name": "AparteConversationArchiveDetail",
7784
+ "declaration": {
7785
+ "name": "AparteConversationArchiveDetail",
7786
+ "module": "./conversation-list/index.js"
7787
+ }
7788
+ },
7789
+ {
7790
+ "kind": "js",
7791
+ "name": "AparteConversationPinDetail",
7792
+ "declaration": {
7793
+ "name": "AparteConversationPinDetail",
7794
+ "module": "./conversation-list/index.js"
7795
+ }
7796
+ },
7797
+ {
7798
+ "kind": "js",
7799
+ "name": "AparteConversationRenameDetail",
7800
+ "declaration": {
7801
+ "name": "AparteConversationRenameDetail",
7802
+ "module": "./conversation-list/index.js"
7803
+ }
7804
+ },
7805
+ {
7806
+ "kind": "js",
7807
+ "name": "AparteConversationStatus",
7808
+ "declaration": {
7809
+ "name": "AparteConversationStatus",
7810
+ "module": "./conversation-list/index.js"
7811
+ }
7812
+ },
7813
+ {
7814
+ "kind": "js",
7815
+ "name": "AparteConversationStatusDetail",
7816
+ "declaration": {
7817
+ "name": "AparteConversationStatusDetail",
7818
+ "module": "./conversation-list/index.js"
7819
+ }
7820
+ },
7821
+ {
7822
+ "kind": "js",
7823
+ "name": "AparteSuggestions",
7824
+ "declaration": {
7825
+ "name": "AparteSuggestions",
7826
+ "module": "./suggestions/index.js"
7827
+ }
7828
+ },
7829
+ {
7830
+ "kind": "js",
7831
+ "name": "setupSuggestionBlocks",
7832
+ "declaration": {
7833
+ "name": "setupSuggestionBlocks",
7834
+ "module": "./suggestions/index.js"
7835
+ }
7836
+ },
7837
+ {
7838
+ "kind": "js",
7839
+ "name": "SUGGESTIONS_BLOCK_LANGUAGE",
7840
+ "declaration": {
7841
+ "name": "SUGGESTIONS_BLOCK_LANGUAGE",
7842
+ "module": "./suggestions/index.js"
7843
+ }
7844
+ },
7845
+ {
7846
+ "kind": "js",
7847
+ "name": "AparteSuggestion",
7848
+ "declaration": {
7849
+ "name": "AparteSuggestion",
7850
+ "module": "./suggestions/index.js"
7851
+ }
7852
+ },
7853
+ {
7854
+ "kind": "js",
7855
+ "name": "AparteSuggestionEventDetail",
7856
+ "declaration": {
7857
+ "name": "AparteSuggestionEventDetail",
7858
+ "module": "./suggestions/index.js"
7859
+ }
7860
+ },
7861
+ {
7862
+ "kind": "js",
7863
+ "name": "AparteContext",
7864
+ "declaration": {
7865
+ "name": "AparteContext",
7866
+ "module": "./context/index.js"
7867
+ }
7868
+ },
7869
+ {
7870
+ "kind": "js",
7871
+ "name": "AparteContextLevel",
7872
+ "declaration": {
7873
+ "name": "AparteContextLevel",
7874
+ "module": "./context/index.js"
7875
+ }
7876
+ },
7877
+ {
7878
+ "kind": "js",
7879
+ "name": "AparteContextThresholdEventDetail",
7880
+ "declaration": {
7881
+ "name": "AparteContextThresholdEventDetail",
7882
+ "module": "./context/index.js"
7883
+ }
7884
+ },
7885
+ {
7886
+ "kind": "js",
7887
+ "name": "AparteScrollRail",
7888
+ "declaration": {
7889
+ "name": "AparteScrollRail",
7890
+ "module": "./scroll-rail/index.js"
7891
+ }
7892
+ },
7893
+ {
7894
+ "kind": "js",
7895
+ "name": "AparteScrollRailJumpDetail",
7896
+ "declaration": {
7897
+ "name": "AparteScrollRailJumpDetail",
7898
+ "module": "./scroll-rail/index.js"
7899
+ }
7900
+ },
7901
+ {
7902
+ "kind": "js",
7903
+ "name": "AparteScrollRailEvery",
7904
+ "declaration": {
7905
+ "name": "AparteScrollRailEvery",
7906
+ "module": "./scroll-rail/index.js"
7907
+ }
7908
+ },
7909
+ {
7910
+ "kind": "js",
7911
+ "name": "AparteSidebar",
7912
+ "declaration": {
7913
+ "name": "AparteSidebar",
7914
+ "module": "./sidebar/index.js"
7915
+ }
7916
+ },
7917
+ {
7918
+ "kind": "js",
7919
+ "name": "AparteSidebarToggleDetail",
7920
+ "declaration": {
7921
+ "name": "AparteSidebarToggleDetail",
7922
+ "module": "./sidebar/index.js"
7923
+ }
7924
+ },
7925
+ {
7926
+ "kind": "js",
7927
+ "name": "AparteSplit",
7928
+ "declaration": {
7929
+ "name": "AparteSplit",
7930
+ "module": "./split/index.js"
7931
+ }
7932
+ },
7933
+ {
7934
+ "kind": "js",
7935
+ "name": "AparteSplitResizeDetail",
7936
+ "declaration": {
7937
+ "name": "AparteSplitResizeDetail",
7938
+ "module": "./split/index.js"
7939
+ }
7940
+ },
7941
+ {
7942
+ "kind": "js",
7943
+ "name": "AparteLauncher",
7944
+ "declaration": {
7945
+ "name": "AparteLauncher",
7946
+ "module": "./launcher/index.js"
7947
+ }
7948
+ },
7949
+ {
7950
+ "kind": "js",
7951
+ "name": "AparteLauncherToggleDetail",
7952
+ "declaration": {
7953
+ "name": "AparteLauncherToggleDetail",
7954
+ "module": "./launcher/index.js"
7955
+ }
7956
+ }
7957
+ ]
7958
+ },
7959
+ {
7960
+ "kind": "javascript-module",
7961
+ "path": "src/config/action-provider.ts",
7962
+ "declarations": [],
7963
+ "exports": []
7964
+ },
7965
+ {
7966
+ "kind": "javascript-module",
7967
+ "path": "src/config/aparte-config.ts",
7968
+ "declarations": [
7969
+ {
7970
+ "kind": "variable",
7971
+ "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
7972
+ "type": {
7973
+ "text": "{\n copy: false,\n retry: false,\n edit: false,\n feedback: false,\n info: false,\n}"
7974
+ },
7975
+ "default": "{ copy: false, retry: false, edit: false, feedback: false, info: false, }",
7976
+ "description": "The bubble-action defaults — all off: a message carries no button until the app asks for one.\n\nRetry and edit only do something when a host (`AparteClient`) re-sends and rewrites,\nand feedback/info only when the app listens for `aparte-feedback` /\n`aparte-message-info`; rendering them unconditionally showed dead buttons in every\ndisplay-only integration — ours included, which is how we found it. Copy is the one\ncore could honor alone, and it is off too: a help widget or a support chat is read,\nnot quoted, and a chat product that wants it turns it on in one line\n(`setBubbleActions({ copy: true })`).\n\nExported so a consumer can read the defaults instead of hard-coding them."
7977
+ },
7978
+ {
7979
+ "kind": "variable",
7980
+ "name": "APARTE_DEFAULT_HOST_HANDLERS",
7981
+ "type": {
7982
+ "text": "{\n attachmentPreview: false,\n filePreview: false,\n}"
7983
+ },
7984
+ "default": "{ attachmentPreview: false, filePreview: false, }",
7985
+ "description": "The host-handler declarations — nothing declared.\n\nSame rule as APARTE_DEFAULT_BUBBLE_ACTIONS, applied outside the action bar: an\nimage tile you can click is a request core forwards to the app. Undeclared, it is\nnot rendered (and the tile is not even signalled as clickable) instead of doing\nnothing."
7986
+ },
7987
+ {
7988
+ "kind": "function",
7989
+ "name": "renderingVersionOf",
7990
+ "return": {
7991
+ "type": {
7992
+ "text": "number"
7993
+ }
7994
+ },
7995
+ "parameters": [
7996
+ {
7997
+ "name": "cfg",
7998
+ "type": {
7999
+ "text": "AparteConfig"
8000
+ }
8001
+ }
8002
+ ]
8003
+ },
8004
+ {
8005
+ "kind": "function",
8006
+ "name": "onRenderersChange",
8007
+ "return": {
8008
+ "type": {
8009
+ "text": "() => void"
8010
+ }
8011
+ },
8012
+ "parameters": [
8013
+ {
8014
+ "name": "listener",
8015
+ "type": {
8016
+ "text": "(cfg: AparteConfig) => void"
8017
+ }
8018
+ }
8019
+ ]
8020
+ },
8021
+ {
8022
+ "kind": "function",
8023
+ "name": "notifyRenderersChanged",
8024
+ "return": {
8025
+ "type": {
8026
+ "text": "void"
8027
+ }
8028
+ },
8029
+ "parameters": [
8030
+ {
8031
+ "name": "cfg",
8032
+ "type": {
8033
+ "text": "AparteConfig"
8034
+ }
8035
+ }
8036
+ ]
8037
+ },
8038
+ {
8039
+ "kind": "class",
8040
+ "description": "Everything a chat is configured with: the providers and the selected model, the\ntransport and the keys, the tools, the renderers and render hooks, the Markdown and\nhighlight providers, the locale, the icons, the avatars, the actions.\n\naparteGlobalConfig is the one every chat on the page reads. A chat that needs a\nconfiguration of its own takes a `new AparteConfig()` attached to its element or to an\nancestor with attachConfig; the framework wrappers take it as their `config` prop.\n\nA change to what is drawn — providers, the model, the locale, icons, avatars, actions,\nrenderers — reaches the components already on the page: AparteConfig.subscribe| subscribe() listeners are\ncalled, and `aparte-config-change` is dispatched on `window` with the instance that changed.\nThe Markdown, streaming-Markdown and highlight providers are among them: a message drawn\nbefore they were set is drawn again with them (one still streaming, once it ends). The\nsanitizer, segment defaults, tools, tool renderers and summaries apply to what is drawn\nafter they are set, so set them before the chat renders; the transport, the keys and the\nsystem prompt apply from the next request.",
8041
+ "name": "AparteConfig",
8042
+ "members": [
7710
8043
  {
7711
8044
  "kind": "field",
7712
- "name": "_transport",
8045
+ "name": "_markdownProvider",
7713
8046
  "type": {
7714
- "text": "AparteTransport"
8047
+ "text": "AparteMarkdownProvider | undefined"
7715
8048
  },
7716
- "privacy": "private",
7717
- "default": "new AparteDirectTransport()"
8049
+ "privacy": "private"
7718
8050
  },
7719
8051
  {
7720
8052
  "kind": "field",
7721
- "name": "_modelPreferenceProvider",
8053
+ "name": "_streamingMarkdownProvider",
7722
8054
  "type": {
7723
- "text": "AparteModelPreferenceProvider | undefined"
8055
+ "text": "AparteStreamingMarkdownProvider | undefined"
7724
8056
  },
7725
8057
  "privacy": "private"
7726
8058
  },
7727
8059
  {
7728
8060
  "kind": "field",
7729
- "name": "_approvalPolicy",
8061
+ "name": "_highlightProvider",
7730
8062
  "type": {
7731
- "text": "AparteApprovalPolicy | null"
8063
+ "text": "AparteHighlightProvider | undefined"
7732
8064
  },
8065
+ "privacy": "private"
8066
+ },
8067
+ {
8068
+ "kind": "field",
8069
+ "name": "_codeLanguageRenderers",
7733
8070
  "privacy": "private",
7734
- "default": "null"
8071
+ "default": "new Map<string, AparteCodeLanguageRenderer>()"
7735
8072
  },
7736
8073
  {
7737
8074
  "kind": "field",
7738
- "name": "_compactor",
8075
+ "name": "_sanitizer",
7739
8076
  "type": {
7740
- "text": "AparteCompactor | null"
8077
+ "text": "AparteSanitizer | null"
7741
8078
  },
7742
8079
  "privacy": "private",
7743
- "default": "null"
8080
+ "default": "defaultSanitizer"
7744
8081
  },
7745
8082
  {
7746
8083
  "kind": "field",
7747
- "name": "_conversationManager",
8084
+ "name": "_imagePolicy",
7748
8085
  "type": {
7749
- "text": "AparteConversationManager | undefined"
8086
+ "text": "AparteImagePolicy"
7750
8087
  },
7751
- "privacy": "private"
8088
+ "privacy": "private",
8089
+ "default": "[]"
7752
8090
  },
7753
8091
  {
7754
8092
  "kind": "field",
7755
- "name": "_elicitationPresenters",
8093
+ "name": "_imageDecider",
7756
8094
  "type": {
7757
- "text": "Array<{ fn: AparteElicitationPresenter; owner?: HTMLElement }>"
8095
+ "text": "ImageDecider"
7758
8096
  },
7759
- "privacy": "private",
7760
- "default": "[]"
8097
+ "privacy": "private"
7761
8098
  },
7762
8099
  {
7763
8100
  "kind": "field",
7764
- "name": "_warnedNoPresenter",
8101
+ "name": "_imagePolicyNamed",
7765
8102
  "type": {
7766
8103
  "text": "boolean"
7767
8104
  },
7768
8105
  "privacy": "private",
7769
8106
  "default": "false",
7770
- "description": "Warn once per config, not once per request — a tool loop can ask repeatedly."
8107
+ "description": "Whether the app named an image policy, the default included; see `decideImage`."
7771
8108
  },
7772
8109
  {
7773
8110
  "kind": "field",
7774
- "name": "_elicitationQueue",
7775
- "privacy": "private",
7776
- "default": "new Map<HTMLElement | null, Promise<void>>()",
7777
- "description": "The tail of the queue of requests waiting for the human, or `null` when none is.\n\nOne request reaches the presenter at a time — not because a presenter could not\ncope, but because the COMPOSER cannot: it has one panel slot, and a second\nrequest would clobber the first's DOM. A second request WAITS: answering it\n`cancel` on the spot would be a refusal invented for a question nobody was ever\nshown.\n\nHere rather than in the presenter because this is the only place that sees\nEVERY request whatever raised it — a tool handler, an app's own button, the\ntool-approval gate. A custom presenter registered by a consumer gets the same\nprotection for free."
8111
+ "name": "_systemPromptTemplate",
8112
+ "type": {
8113
+ "text": "string | undefined"
8114
+ },
8115
+ "privacy": "private"
7778
8116
  },
7779
8117
  {
7780
8118
  "kind": "field",
7781
- "name": "_tools",
8119
+ "name": "_systemPromptVarsProvider",
7782
8120
  "type": {
7783
- "text": "Map<string, { tool: AparteTool; handler: AparteToolHandler }>"
8121
+ "text": "AparteSystemPromptVarsProvider | undefined"
7784
8122
  },
7785
- "privacy": "private",
7786
- "default": "new Map()"
8123
+ "privacy": "private"
7787
8124
  },
7788
8125
  {
7789
8126
  "kind": "field",
7790
- "name": "_toolRenderers",
7791
- "privacy": "private",
7792
- "default": "new ToolTable<AparteToolRenderer>()"
8127
+ "name": "_statusRenderer",
8128
+ "type": {
8129
+ "text": "AparteStatusRenderer | undefined"
8130
+ },
8131
+ "privacy": "private"
7793
8132
  },
7794
8133
  {
7795
8134
  "kind": "field",
7796
- "name": "_toolRendererOverrides",
7797
- "privacy": "private",
7798
- "default": "new Map<string, Array<{ renderer: AparteToolRenderer | undefined }>>()",
7799
- "description": "Per matcher: what it held below every override, then one entry per override — an object of its own, so two overrides of the same renderer are told apart."
8135
+ "name": "_errorRenderer",
8136
+ "type": {
8137
+ "text": "AparteErrorRenderer | undefined"
8138
+ },
8139
+ "privacy": "private"
7800
8140
  },
7801
8141
  {
7802
8142
  "kind": "field",
7803
- "name": "_overrideGeneration",
8143
+ "name": "_attachmentRenderer",
7804
8144
  "type": {
7805
- "text": "number"
8145
+ "text": "AparteAttachmentRenderer | undefined"
7806
8146
  },
7807
- "privacy": "private",
7808
- "default": "0",
7809
- "description": "Bumped by `reset()`: a restore function from before it must not undo what came after."
8147
+ "privacy": "private"
7810
8148
  },
7811
8149
  {
7812
8150
  "kind": "field",
7813
- "name": "_toolDisplays",
7814
- "privacy": "private",
8151
+ "name": "_siblingNavRenderer",
8152
+ "type": {
8153
+ "text": "AparteSiblingNavRenderer | undefined"
8154
+ },
8155
+ "privacy": "private"
8156
+ },
8157
+ {
8158
+ "kind": "field",
8159
+ "name": "_bubbleShellRenderer",
8160
+ "type": {
8161
+ "text": "AparteBubbleShellRenderer | undefined"
8162
+ },
8163
+ "privacy": "private"
8164
+ },
8165
+ {
8166
+ "kind": "field",
8167
+ "name": "_iconProvider",
8168
+ "type": {
8169
+ "text": "AparteIconProvider | undefined"
8170
+ },
8171
+ "privacy": "private"
8172
+ },
8173
+ {
8174
+ "kind": "field",
8175
+ "name": "_avatarProvider",
8176
+ "type": {
8177
+ "text": "AparteAvatarProvider | undefined"
8178
+ },
8179
+ "privacy": "private"
8180
+ },
8181
+ {
8182
+ "kind": "field",
8183
+ "name": "_keyProvider",
8184
+ "type": {
8185
+ "text": "AparteKeyProvider | undefined"
8186
+ },
8187
+ "privacy": "private"
8188
+ },
8189
+ {
8190
+ "kind": "field",
8191
+ "name": "_extraKeyProviders",
8192
+ "type": {
8193
+ "text": "Set<AparteKeyProvider>"
8194
+ },
8195
+ "privacy": "private",
8196
+ "default": "new Set()",
8197
+ "description": "Sources added with `registerKeyProvider` — consulted before `_keyProvider`,\nnewest first (see `getKey`)."
8198
+ },
8199
+ {
8200
+ "kind": "field",
8201
+ "name": "_locale",
8202
+ "type": {
8203
+ "text": "AparteLocale"
8204
+ },
8205
+ "privacy": "private",
8206
+ "default": "APARTE_DEFAULT_LOCALE"
8207
+ },
8208
+ {
8209
+ "kind": "field",
8210
+ "name": "_actions",
8211
+ "type": {
8212
+ "text": "AparteAction[]"
8213
+ },
8214
+ "privacy": "private",
8215
+ "default": "[]"
8216
+ },
8217
+ {
8218
+ "kind": "field",
8219
+ "name": "_listeners",
8220
+ "type": {
8221
+ "text": "Set<() => void>"
8222
+ },
8223
+ "privacy": "private",
8224
+ "default": "new Set()"
8225
+ },
8226
+ {
8227
+ "kind": "field",
8228
+ "name": "_aiProviders",
8229
+ "type": {
8230
+ "text": "Map<string, AparteAIProvider>"
8231
+ },
8232
+ "privacy": "private",
8233
+ "default": "new Map()"
8234
+ },
8235
+ {
8236
+ "kind": "field",
8237
+ "name": "_fetchedModels",
8238
+ "type": {
8239
+ "text": "Map<string, AparteAIModel[]>"
8240
+ },
8241
+ "privacy": "private",
8242
+ "default": "new Map()",
8243
+ "description": "What `refreshProviderModels()` last brought back, per provider.\n\n`getCurrentModel()` reads it beside `provider.getModels()`, the SYNCHRONOUS,\nhand-declared list, which every preset of `@aparte/provider-openai-compat`\nleaves empty because a compat endpoint's list is fetched at runtime. Without\nthe fetched list the current model resolves to `undefined`, and its declared\ncapabilities are unknown: `AparteClient._toolsForCurrentModel()` still sends the\ntools then, and it is the fetched list that lets a model which declares no\n`function_calling` be honoured."
8244
+ },
8245
+ {
8246
+ "kind": "field",
8247
+ "name": "_modelConfig",
8248
+ "type": {
8249
+ "text": "AparteModelConfig"
8250
+ },
8251
+ "privacy": "private",
8252
+ "default": "{}"
8253
+ },
8254
+ {
8255
+ "kind": "field",
8256
+ "name": "_requireModelSelection",
8257
+ "type": {
8258
+ "text": "boolean"
8259
+ },
8260
+ "privacy": "private",
8261
+ "default": "false",
8262
+ "description": "Opt-in: gate the composer (block send + grey out) until a model is selected."
8263
+ },
8264
+ {
8265
+ "kind": "field",
8266
+ "name": "_elicitationAllowOther",
8267
+ "type": {
8268
+ "text": "boolean"
8269
+ },
8270
+ "privacy": "private",
8271
+ "default": "true",
8272
+ "description": "Host policy for the elicitation panel's free-text escape — see setElicitationOptions."
8273
+ },
8274
+ {
8275
+ "kind": "field",
8276
+ "name": "_elicitationLayout",
8277
+ "type": {
8278
+ "text": "'stepped' | 'stacked'"
8279
+ },
8280
+ "privacy": "private",
8281
+ "default": "'stepped'"
8282
+ },
8283
+ {
8284
+ "kind": "field",
8285
+ "name": "_elicitationAnswerOnClick",
8286
+ "type": {
8287
+ "text": "boolean"
8288
+ },
8289
+ "privacy": "private",
8290
+ "default": "true",
8291
+ "description": "Whether a single choice answers on the click (buttons) or keeps its radios + the composer's button."
8292
+ },
8293
+ {
8294
+ "kind": "field",
8295
+ "name": "_elicitationFieldRenderer",
8296
+ "type": {
8297
+ "text": "AparteElicitationFieldRenderer | undefined | undefined"
8298
+ },
8299
+ "privacy": "private"
8300
+ },
8301
+ {
8302
+ "kind": "field",
8303
+ "name": "_transport",
8304
+ "type": {
8305
+ "text": "AparteTransport"
8306
+ },
8307
+ "privacy": "private",
8308
+ "default": "new AparteDirectTransport()"
8309
+ },
8310
+ {
8311
+ "kind": "field",
8312
+ "name": "_modelPreferenceProvider",
8313
+ "type": {
8314
+ "text": "AparteModelPreferenceProvider | undefined"
8315
+ },
8316
+ "privacy": "private"
8317
+ },
8318
+ {
8319
+ "kind": "field",
8320
+ "name": "_approvalPolicy",
8321
+ "type": {
8322
+ "text": "AparteApprovalPolicy | null"
8323
+ },
8324
+ "privacy": "private",
8325
+ "default": "null"
8326
+ },
8327
+ {
8328
+ "kind": "field",
8329
+ "name": "_compactor",
8330
+ "type": {
8331
+ "text": "AparteCompactor | null"
8332
+ },
8333
+ "privacy": "private",
8334
+ "default": "null"
8335
+ },
8336
+ {
8337
+ "kind": "field",
8338
+ "name": "_conversationManager",
8339
+ "type": {
8340
+ "text": "AparteConversationManager | undefined"
8341
+ },
8342
+ "privacy": "private"
8343
+ },
8344
+ {
8345
+ "kind": "field",
8346
+ "name": "_elicitationPresenters",
8347
+ "type": {
8348
+ "text": "Array<{ fn: AparteElicitationPresenter; owner?: HTMLElement }>"
8349
+ },
8350
+ "privacy": "private",
8351
+ "default": "[]"
8352
+ },
8353
+ {
8354
+ "kind": "field",
8355
+ "name": "_warnedNoPresenter",
8356
+ "type": {
8357
+ "text": "boolean"
8358
+ },
8359
+ "privacy": "private",
8360
+ "default": "false",
8361
+ "description": "Warn once per config, not once per request — a tool loop can ask repeatedly."
8362
+ },
8363
+ {
8364
+ "kind": "field",
8365
+ "name": "_elicitationQueue",
8366
+ "privacy": "private",
8367
+ "default": "new Map<HTMLElement | null, Promise<void>>()",
8368
+ "description": "The tail of the queue of requests waiting for the human, or `null` when none is.\n\nOne request reaches the presenter at a time — not because a presenter could not\ncope, but because the COMPOSER cannot: it has one panel slot, and a second\nrequest would clobber the first's DOM. A second request WAITS: answering it\n`cancel` on the spot would be a refusal invented for a question nobody was ever\nshown.\n\nHere rather than in the presenter because this is the only place that sees\nEVERY request whatever raised it — a tool handler, an app's own button, the\ntool-approval gate. A custom presenter registered by a consumer gets the same\nprotection for free."
8369
+ },
8370
+ {
8371
+ "kind": "field",
8372
+ "name": "_tools",
8373
+ "type": {
8374
+ "text": "Map<string, { tool: AparteTool; handler: AparteToolHandler }>"
8375
+ },
8376
+ "privacy": "private",
8377
+ "default": "new Map()"
8378
+ },
8379
+ {
8380
+ "kind": "field",
8381
+ "name": "_toolRenderers",
8382
+ "privacy": "private",
8383
+ "default": "new ToolTable<AparteToolRenderer>()"
8384
+ },
8385
+ {
8386
+ "kind": "field",
8387
+ "name": "_toolRendererOverrides",
8388
+ "privacy": "private",
8389
+ "default": "new Map<string, Array<{ renderer: AparteToolRenderer | undefined }>>()",
8390
+ "description": "Per matcher: what it held below every override, then one entry per override — an object of its own, so two overrides of the same renderer are told apart."
8391
+ },
8392
+ {
8393
+ "kind": "field",
8394
+ "name": "_overrideGeneration",
8395
+ "type": {
8396
+ "text": "number"
8397
+ },
8398
+ "privacy": "private",
8399
+ "default": "0",
8400
+ "description": "Bumped by `reset()`: a restore function from before it must not undo what came after."
8401
+ },
8402
+ {
8403
+ "kind": "field",
8404
+ "name": "_toolDisplays",
8405
+ "privacy": "private",
7815
8406
  "default": "new ToolTable<AparteToolDisplay>()"
7816
8407
  },
8408
+ {
8409
+ "kind": "field",
8410
+ "name": "_toolLineProvider",
8411
+ "type": {
8412
+ "text": "((segment: AparteToolCallSegment) => AparteToolLine | undefined) | null"
8413
+ },
8414
+ "privacy": "private",
8415
+ "default": "null",
8416
+ "description": "What a plugin says about a call, read after the app's display — see setToolLineProvider."
8417
+ },
7817
8418
  {
7818
8419
  "kind": "field",
7819
8420
  "name": "_streamBlocks",
@@ -7833,6 +8434,16 @@
7833
8434
  "privacy": "private",
7834
8435
  "default": "new Map()"
7835
8436
  },
8437
+ {
8438
+ "kind": "field",
8439
+ "name": "_runEventObservers",
8440
+ "type": {
8441
+ "text": "Array<{ fn: AparteRunEventObserver }>"
8442
+ },
8443
+ "privacy": "private",
8444
+ "default": "[]",
8445
+ "description": "One entry per registration, so each remover takes back its own — see observeRunEvents."
8446
+ },
7836
8447
  {
7837
8448
  "kind": "field",
7838
8449
  "name": "_hostHandlers",
@@ -9575,6 +10186,37 @@
9575
10186
  ],
9576
10187
  "description": "Whether a tool's calls draw nothing: its display says `hidden`, and no renderer is\nregistered for it MORE specifically. A `'*'` hide therefore leaves a tool with its\nown renderer drawn (a plugin's receipt), while a hide as specific as the renderer\nwins — the app said so for that tool. A hidden call stays in the message, in storage\nand in the model's history; only its row is empty."
9577
10188
  },
10189
+ {
10190
+ "kind": "method",
10191
+ "name": "setToolLineProvider",
10192
+ "return": {
10193
+ "type": {
10194
+ "text": "void"
10195
+ }
10196
+ },
10197
+ "parameters": [
10198
+ {
10199
+ "name": "provider",
10200
+ "type": {
10201
+ "text": "((segment: AparteToolCallSegment) => AparteToolLine | undefined) | null"
10202
+ }
10203
+ }
10204
+ ],
10205
+ "description": "Say more about a call than its display does: what ran it, what it is doing now, a\nshort note after its state. For a plugin that knows a call from the inside — a\nsub-agent's line is the line of the call that opened it.\n\nOne provider per config; `null` removes it. It is consulted AFTER the app's display,\nfield by field, so the app always wins: `label` and `target` are read when the display\ngives none, `details` when the display has no `details` key. `activity`, a second\nline under the name, and `note` show in every state they are given: give `activity` for\nthe call's whole life, or never, or the row changes height. A function, called whenever the\nrow is drawn, updated or relabelled — never text stored on the segment — so its words\nfollow a language switch. One that throws, or returns nothing, leaves the default\nline. A chat with a config of its own and no provider reads aparteGlobalConfig's.",
10206
+ "examples": [
10207
+ "aparteGlobalConfig.setToolLineProvider((segment) =>\n segment.toolCall.name === 'delegate' ? { activity: 'Reading the parser', note: '3 tools' } : undefined);"
10208
+ ]
10209
+ },
10210
+ {
10211
+ "kind": "method",
10212
+ "name": "getToolLineProvider",
10213
+ "return": {
10214
+ "type": {
10215
+ "text": "((segment: AparteToolCallSegment) => AparteToolLine | undefined) | null"
10216
+ }
10217
+ },
10218
+ "description": "The tool-line provider this config reads: its own, else the page's."
10219
+ },
9578
10220
  {
9579
10221
  "kind": "method",
9580
10222
  "name": "_dropToolDisplayField",
@@ -9775,6 +10417,37 @@
9775
10417
  },
9776
10418
  "description": "The registered block grammars, in registration order."
9777
10419
  },
10420
+ {
10421
+ "kind": "method",
10422
+ "name": "observeRunEvents",
10423
+ "return": {
10424
+ "type": {
10425
+ "text": "() => void"
10426
+ }
10427
+ },
10428
+ "parameters": [
10429
+ {
10430
+ "name": "observer",
10431
+ "type": {
10432
+ "text": "AparteRunEventObserver"
10433
+ }
10434
+ }
10435
+ ],
10436
+ "description": "Hear every event of a reply's run, before the reply handles it — including the\nevents of its sub-agents, which the reply never draws: an event that carries an\n`agentId`, and `agent-start` / `agent-end`, are kept out of the reply whether anyone\nobserves them or not. This is how a plugin draws a sub-agent's conversation.\n\nA chat hears the observers of its own config first, then those of\naparteGlobalConfig, the way a segment renderer is found: one registered once on\nthe page reaches a chat that carries a config of its own. An observer that throws is\nreported once per reply, and the reply goes on. Returns the function that removes it.",
10437
+ "examples": [
10438
+ "const stop = aparteGlobalConfig.observeRunEvents((event, { messageId }) => {\n if (event.type === 'agent-start') console.info(`${messageId}: ${event.name} started`);\n});"
10439
+ ]
10440
+ },
10441
+ {
10442
+ "kind": "method",
10443
+ "name": "getRunEventObservers",
10444
+ "return": {
10445
+ "type": {
10446
+ "text": "AparteRunEventObserver[]"
10447
+ }
10448
+ },
10449
+ "description": "The observers registered on this config, in registration order (read by the stream adapter)."
10450
+ },
9778
10451
  {
9779
10452
  "kind": "method",
9780
10453
  "name": "setConversationManager",
@@ -9940,7 +10613,7 @@
9940
10613
  "text": "void"
9941
10614
  }
9942
10615
  },
9943
- "description": "Put the configuration back to its defaults: the providers and the selected model,\nthe tools with their renderers and summaries, the renderers and render hooks, the\nMarkdown and highlight providers, the code-language renderers, the sanitizer, the system prompt, the locale, icons,\navatars, actions and host handlers, the conversation manager, the question presenters\nand their queue. Three things stay: the transport, the key sources added with\nAparteConfig.registerKeyProvider| registerKeyProvider() (an `AparteClient`'s\n`keyResolver` among them), and the AparteConfig.subscribe| subscribe() listeners."
10616
+ "description": "Put the configuration back to its defaults: the providers and the selected model,\nthe tools with their renderers and summaries, the tool-line provider, the renderers and render hooks, the\nMarkdown and highlight providers, the code-language renderers, the sanitizer, the system prompt, the locale, icons,\navatars, actions and host handlers, the conversation manager, the question presenters\nand their queue, the run-event observers. Three things stay: the transport, the key sources added with\nAparteConfig.registerKeyProvider| registerKeyProvider() (an `AparteClient`'s\n`keyResolver` among them), and the AparteConfig.subscribe| subscribe() listeners."
9944
10617
  },
9945
10618
  {
9946
10619
  "kind": "method",
@@ -10155,1035 +10828,354 @@
10155
10828
  "name": "fn",
10156
10829
  "type": {
10157
10830
  "text": "() => T"
10158
- }
10159
- }
10160
- ],
10161
- "description": "Run `fn` with `config` as the ambient render config (restored after)."
10162
- },
10163
- {
10164
- "kind": "function",
10165
- "name": "contextConfig",
10166
- "return": {
10167
- "type": {
10168
- "text": "AparteConfig"
10169
- }
10170
- },
10171
- "parameters": [
10172
- {
10173
- "name": "el",
10174
- "optional": true,
10175
- "type": {
10176
- "text": "Element | null"
10177
- }
10178
- }
10179
- ],
10180
- "description": "The ambient render config set by runWithConfig, else the config\nresolved from `el` (when provided), else the global singleton. Capture it\nsynchronously at the top of a renderer — never after an `await`."
10181
- }
10182
- ],
10183
- "exports": [
10184
- {
10185
- "kind": "js",
10186
- "name": "APARTE_HOST_ATTR",
10187
- "declaration": {
10188
- "name": "APARTE_HOST_ATTR",
10189
- "module": "src/config/config-context.ts"
10190
- }
10191
- },
10192
- {
10193
- "kind": "js",
10194
- "name": "attachConfig",
10195
- "declaration": {
10196
- "name": "attachConfig",
10197
- "module": "src/config/config-context.ts"
10198
- }
10199
- },
10200
- {
10201
- "kind": "js",
10202
- "name": "detachConfig",
10203
- "declaration": {
10204
- "name": "detachConfig",
10205
- "module": "src/config/config-context.ts"
10206
- }
10207
- },
10208
- {
10209
- "kind": "js",
10210
- "name": "resolveConfig",
10211
- "declaration": {
10212
- "name": "resolveConfig",
10213
- "module": "src/config/config-context.ts"
10214
- }
10215
- },
10216
- {
10217
- "kind": "js",
10218
- "name": "runWithConfig",
10219
- "declaration": {
10220
- "name": "runWithConfig",
10221
- "module": "src/config/config-context.ts"
10222
- }
10223
- },
10224
- {
10225
- "kind": "js",
10226
- "name": "contextConfig",
10227
- "declaration": {
10228
- "name": "contextConfig",
10229
- "module": "src/config/config-context.ts"
10230
- }
10231
- }
10232
- ]
10233
- },
10234
- {
10235
- "kind": "javascript-module",
10236
- "path": "src/config/config-subscribe.ts",
10237
- "declarations": [
10238
- {
10239
- "kind": "variable",
10240
- "name": "APARTE_CONFIG_CHANGE",
10241
- "type": {
10242
- "text": "string"
10243
- },
10244
- "default": "'aparte-config-change'",
10245
- "description": "The event `AparteConfig._notify()` dispatches on `window`."
10246
- },
10247
- {
10248
- "kind": "function",
10249
- "name": "subscribeConfigChange",
10250
- "return": {
10251
- "type": {
10252
- "text": "() => void"
10253
- }
10254
- },
10255
- "parameters": [
10256
- {
10257
- "name": "el",
10258
- "type": {
10259
- "text": "Element"
10260
- }
10261
- },
10262
- {
10263
- "name": "handler",
10264
- "type": {
10265
- "text": "() => void"
10266
- }
10267
- }
10268
- ]
10269
- }
10270
- ],
10271
- "exports": [
10272
- {
10273
- "kind": "js",
10274
- "name": "APARTE_CONFIG_CHANGE",
10275
- "declaration": {
10276
- "name": "APARTE_CONFIG_CHANGE",
10277
- "module": "src/config/config-subscribe.ts"
10278
- }
10279
- },
10280
- {
10281
- "kind": "js",
10282
- "name": "subscribeConfigChange",
10283
- "declaration": {
10284
- "name": "subscribeConfigChange",
10285
- "module": "src/config/config-subscribe.ts"
10286
- }
10287
- }
10288
- ]
10289
- },
10290
- {
10291
- "kind": "javascript-module",
10292
- "path": "src/config/elicitation-field-renderer.ts",
10293
- "declarations": [],
10294
- "exports": []
10295
- },
10296
- {
10297
- "kind": "javascript-module",
10298
- "path": "src/config/error-renderer.ts",
10299
- "declarations": [],
10300
- "exports": []
10301
- },
10302
- {
10303
- "kind": "javascript-module",
10304
- "path": "src/config/icon-provider.ts",
10305
- "declarations": [
10306
- {
10307
- "kind": "variable",
10308
- "name": "APARTE_DEFAULT_ICON_FALLBACKS",
10309
- "type": {
10310
- "text": "Record<AparteCoreIconName, string>"
10311
- },
10312
- "default": "APARTE_ICON_GLYPHS",
10313
- "description": "The default drawing for every name, assembled from `icons/glyphs.ts`.\n\n`getIcon()` reads this by a COMPUTED key, so a bundler cannot tell which entries a\nbuild reaches and keeps the object whole. That is the constraint that shapes the icon\nset: what belongs here is what core itself draws, and nothing else — an icon nobody\nrenders would still ship to everybody. Extra glyphs are individual exports a consumer\nimports by name, never members of this record."
10314
- }
10315
- ],
10316
- "exports": [
10317
- {
10318
- "kind": "js",
10319
- "name": "APARTE_DEFAULT_ICON_FALLBACKS",
10320
- "declaration": {
10321
- "name": "APARTE_DEFAULT_ICON_FALLBACKS",
10322
- "module": "src/config/icon-provider.ts"
10323
- }
10324
- }
10325
- ]
10326
- },
10327
- {
10328
- "kind": "javascript-module",
10329
- "path": "src/config/image-policy.ts",
10330
- "declarations": [
10331
- {
10332
- "kind": "function",
10333
- "name": "resolveImageAddress",
10334
- "return": {
10335
- "type": {
10336
- "text": "URL | null"
10337
- }
10338
- },
10339
- "parameters": [
10340
- {
10341
- "name": "address",
10342
- "type": {
10343
- "text": "string"
10344
- }
10345
- }
10346
- ],
10347
- "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."
10348
- },
10349
- {
10350
- "kind": "function",
10351
- "name": "sameImagePolicy",
10352
- "return": {
10353
- "type": {
10354
- "text": "boolean"
10355
- }
10356
- },
10357
- "parameters": [
10358
- {
10359
- "name": "a",
10360
- "type": {
10361
- "text": "AparteImagePolicy"
10362
- }
10363
- },
10364
- {
10365
- "name": "b",
10366
- "type": {
10367
- "text": "AparteImagePolicy"
10368
- }
10369
- }
10370
- ],
10371
- "description": "Whether two policies say the same thing: the same function, or lists with the same entries."
10372
- },
10373
- {
10374
- "kind": "function",
10375
- "name": "compileImagePolicy",
10376
- "return": {
10377
- "type": {
10378
- "text": "ImageDecider"
10379
- }
10380
- },
10381
- "parameters": [
10382
- {
10383
- "name": "policy",
10384
- "type": {
10385
- "text": "AparteImagePolicy"
10386
- }
10387
- }
10388
- ],
10389
- "description": "Turn a policy into the function every decision runs through."
10390
- },
10391
- {
10392
- "kind": "function",
10393
- "name": "decideImageAddress",
10394
- "return": {
10395
- "type": {
10396
- "text": "AparteImageDecision"
10397
- }
10398
- },
10399
- "parameters": [
10400
- {
10401
- "name": "decide",
10402
- "type": {
10403
- "text": "ImageDecider"
10404
- }
10405
- },
10406
- {
10407
- "name": "address",
10408
- "type": {
10409
- "text": "string"
10410
- }
10411
- },
10412
- {
10413
- "name": "shown",
10414
- "optional": true,
10415
- "type": {
10416
- "text": "ReadonlySet<string>"
10417
- }
10418
- }
10419
- ],
10420
- "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."
10421
- },
10422
- {
10423
- "kind": "function",
10424
- "name": "rememberShownImage",
10425
- "return": {
10426
- "type": {
10427
- "text": "void"
10428
- }
10429
- },
10430
- "parameters": [
10431
- {
10432
- "name": "owner",
10433
- "type": {
10434
- "text": "object"
10435
- }
10436
- },
10437
- {
10438
- "name": "address",
10439
- "type": {
10440
- "text": "string"
10441
- }
10442
- }
10443
- ],
10444
- "description": "Remember that the reader chose to see the picture at `address`, under `owner` (a config)."
10445
- },
10446
- {
10447
- "kind": "function",
10448
- "name": "shownImagesOf",
10449
- "return": {
10450
- "type": {
10451
- "text": "ReadonlySet<string> | undefined"
10452
- }
10453
- },
10454
- "parameters": [
10455
- {
10456
- "name": "owner",
10457
- "type": {
10458
- "text": "object"
10459
- }
10460
- }
10461
- ],
10462
- "description": "The pictures the reader chose to see under `owner`."
10463
- },
10464
- {
10465
- "kind": "function",
10466
- "name": "forgetShownImages",
10467
- "return": {
10468
- "type": {
10469
- "text": "void"
10470
- }
10471
- },
10472
- "parameters": [
10473
- {
10474
- "name": "owner",
10475
- "type": {
10476
- "text": "object"
10477
- }
10478
- }
10479
- ],
10480
- "description": "Forget them: a reset config starts from what its policy says."
10481
- },
10482
- {
10483
- "kind": "function",
10484
- "name": "parseSrcset",
10485
- "return": {
10486
- "type": {
10487
- "text": "SrcsetCandidate[]"
10488
- }
10489
- },
10490
- "parameters": [
10491
- {
10492
- "name": "value",
10493
- "type": {
10494
- "text": "string"
10495
- }
10496
- }
10497
- ],
10498
- "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."
10499
- },
10500
- {
10501
- "kind": "function",
10502
- "name": "srcsetUrls",
10503
- "return": {
10504
- "type": {
10505
- "text": "string[]"
10506
- }
10507
- },
10508
- "parameters": [
10509
- {
10510
- "name": "value",
10511
- "type": {
10512
- "text": "string"
10513
- }
10514
- }
10515
- ],
10516
- "description": "The addresses a `srcset` lists, as `parseSrcset` reads them."
10517
- },
10518
- {
10519
- "kind": "function",
10520
- "name": "imageHost",
10521
- "return": {
10522
- "type": {
10523
- "text": "string"
10524
- }
10525
- },
10526
- "parameters": [
10527
- {
10528
- "name": "address",
10529
- "type": {
10530
- "text": "string"
10531
- }
10532
- }
10533
- ],
10534
- "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."
10535
- },
10536
- {
10537
- "kind": "function",
10538
- "name": "heldImageHtml",
10539
- "return": {
10540
- "type": {
10541
- "text": "string"
10542
- }
10543
- },
10544
- "parameters": [
10545
- {
10546
- "name": "address",
10547
- "type": {
10548
- "text": "string"
10549
- }
10550
- },
10551
- {
10552
- "name": "alt",
10553
- "type": {
10554
- "text": "string"
10555
- }
10556
- },
10557
- {
10558
- "name": "words",
10559
- "type": {
10560
- "text": "HeldImageWords"
10561
- }
10562
- },
10563
- {
10564
- "name": "inLink",
10565
- "default": "false"
10566
- }
10567
- ],
10568
- "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."
10569
- },
10570
- {
10571
- "kind": "function",
10572
- "name": "applyImagePolicy",
10573
- "return": {
10574
- "type": {
10575
- "text": "string"
10576
- }
10577
- },
10578
- "parameters": [
10579
- {
10580
- "name": "html",
10581
- "type": {
10582
- "text": "string"
10583
- }
10584
- },
10585
- {
10586
- "name": "decide",
10587
- "type": {
10588
- "text": "(address: string) => AparteImageDecision"
10589
- }
10590
- },
10591
- {
10592
- "name": "words",
10593
- "type": {
10594
- "text": "() => HeldImageWords"
10595
- }
10596
- }
10597
- ],
10598
- "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."
10599
- },
10600
- {
10601
- "kind": "function",
10602
- "name": "applyImagePolicyWithoutDom",
10603
- "return": {
10604
- "type": {
10605
- "text": "string"
10606
- }
10607
- },
10608
- "parameters": [
10609
- {
10610
- "name": "html",
10611
- "type": {
10612
- "text": "string"
10613
- }
10614
- },
10615
- {
10616
- "name": "decide",
10617
- "type": {
10618
- "text": "(address: string) => AparteImageDecision"
10619
- }
10620
- },
10621
- {
10622
- "name": "words",
10623
- "type": {
10624
- "text": "() => HeldImageWords"
10625
- }
10626
- }
10627
- ],
10628
- "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."
10629
- }
10630
- ],
10631
- "exports": [
10632
- {
10633
- "kind": "js",
10634
- "name": "resolveImageAddress",
10635
- "declaration": {
10636
- "name": "resolveImageAddress",
10637
- "module": "src/config/image-policy.ts"
10638
- }
10639
- },
10640
- {
10641
- "kind": "js",
10642
- "name": "sameImagePolicy",
10643
- "declaration": {
10644
- "name": "sameImagePolicy",
10645
- "module": "src/config/image-policy.ts"
10646
- }
10647
- },
10648
- {
10649
- "kind": "js",
10650
- "name": "compileImagePolicy",
10651
- "declaration": {
10652
- "name": "compileImagePolicy",
10653
- "module": "src/config/image-policy.ts"
10654
- }
10655
- },
10656
- {
10657
- "kind": "js",
10658
- "name": "decideImageAddress",
10659
- "declaration": {
10660
- "name": "decideImageAddress",
10661
- "module": "src/config/image-policy.ts"
10662
- }
10663
- },
10664
- {
10665
- "kind": "js",
10666
- "name": "rememberShownImage",
10667
- "declaration": {
10668
- "name": "rememberShownImage",
10669
- "module": "src/config/image-policy.ts"
10670
- }
10671
- },
10672
- {
10673
- "kind": "js",
10674
- "name": "shownImagesOf",
10675
- "declaration": {
10676
- "name": "shownImagesOf",
10677
- "module": "src/config/image-policy.ts"
10678
- }
10679
- },
10680
- {
10681
- "kind": "js",
10682
- "name": "forgetShownImages",
10683
- "declaration": {
10684
- "name": "forgetShownImages",
10685
- "module": "src/config/image-policy.ts"
10686
- }
10687
- },
10688
- {
10689
- "kind": "js",
10690
- "name": "parseSrcset",
10691
- "declaration": {
10692
- "name": "parseSrcset",
10693
- "module": "src/config/image-policy.ts"
10694
- }
10695
- },
10696
- {
10697
- "kind": "js",
10698
- "name": "srcsetUrls",
10699
- "declaration": {
10700
- "name": "srcsetUrls",
10701
- "module": "src/config/image-policy.ts"
10702
- }
10703
- },
10704
- {
10705
- "kind": "js",
10706
- "name": "imageHost",
10707
- "declaration": {
10708
- "name": "imageHost",
10709
- "module": "src/config/image-policy.ts"
10710
- }
10711
- },
10712
- {
10713
- "kind": "js",
10714
- "name": "heldImageHtml",
10715
- "declaration": {
10716
- "name": "heldImageHtml",
10717
- "module": "src/config/image-policy.ts"
10718
- }
10719
- },
10720
- {
10721
- "kind": "js",
10722
- "name": "applyImagePolicy",
10723
- "declaration": {
10724
- "name": "applyImagePolicy",
10725
- "module": "src/config/image-policy.ts"
10726
- }
10727
- },
10728
- {
10729
- "kind": "js",
10730
- "name": "applyImagePolicyWithoutDom",
10731
- "declaration": {
10732
- "name": "applyImagePolicyWithoutDom",
10733
- "module": "src/config/image-policy.ts"
10734
- }
10735
- }
10736
- ]
10737
- },
10738
- {
10739
- "kind": "javascript-module",
10740
- "path": "src/config/index.ts",
10741
- "declarations": [],
10742
- "exports": [
10743
- {
10744
- "kind": "js",
10745
- "name": "aparteGlobalConfig",
10746
- "declaration": {
10747
- "name": "aparteGlobalConfig",
10748
- "module": "./aparte-config.js"
10749
- }
10750
- },
10751
- {
10752
- "kind": "js",
10753
- "name": "AparteConfig",
10754
- "declaration": {
10755
- "name": "AparteConfig",
10756
- "module": "./aparte-config.js"
10757
- }
10758
- },
10759
- {
10760
- "kind": "js",
10761
- "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
10762
- "declaration": {
10763
- "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
10764
- "module": "./aparte-config.js"
10765
- }
10766
- },
10767
- {
10768
- "kind": "js",
10769
- "name": "APARTE_DEFAULT_HOST_HANDLERS",
10770
- "declaration": {
10771
- "name": "APARTE_DEFAULT_HOST_HANDLERS",
10772
- "module": "./aparte-config.js"
10773
- }
10774
- },
10775
- {
10776
- "kind": "js",
10777
- "name": "resolveConfig",
10778
- "declaration": {
10779
- "name": "resolveConfig",
10780
- "module": "./config-context.js"
10781
- }
10782
- },
10783
- {
10784
- "kind": "js",
10785
- "name": "attachConfig",
10786
- "declaration": {
10787
- "name": "attachConfig",
10788
- "module": "./config-context.js"
10789
- }
10790
- },
10791
- {
10792
- "kind": "js",
10793
- "name": "detachConfig",
10794
- "declaration": {
10795
- "name": "detachConfig",
10796
- "module": "./config-context.js"
10797
- }
10798
- },
10799
- {
10800
- "kind": "js",
10801
- "name": "runWithConfig",
10802
- "declaration": {
10803
- "name": "runWithConfig",
10804
- "module": "./config-context.js"
10805
- }
10806
- },
10807
- {
10808
- "kind": "js",
10809
- "name": "contextConfig",
10810
- "declaration": {
10811
- "name": "contextConfig",
10812
- "module": "./config-context.js"
10813
- }
10814
- },
10815
- {
10816
- "kind": "js",
10817
- "name": "APARTE_HOST_ATTR",
10818
- "declaration": {
10819
- "name": "APARTE_HOST_ATTR",
10820
- "module": "./config-context.js"
10821
- }
10822
- },
10823
- {
10824
- "kind": "js",
10825
- "name": "subscribeConfigChange",
10826
- "declaration": {
10827
- "name": "subscribeConfigChange",
10828
- "module": "./config-subscribe.js"
10829
- }
10830
- },
10831
- {
10832
- "kind": "js",
10833
- "name": "APARTE_CONFIG_CHANGE",
10834
- "declaration": {
10835
- "name": "APARTE_CONFIG_CHANGE",
10836
- "module": "./config-subscribe.js"
10837
- }
10838
- },
10839
- {
10840
- "kind": "js",
10841
- "name": "AparteConfigAware",
10842
- "declaration": {
10843
- "name": "AparteConfigAware",
10844
- "module": "./config-context.js"
10845
- }
10846
- },
10847
- {
10848
- "kind": "js",
10849
- "name": "AparteConfigChangeEventDetail",
10850
- "declaration": {
10851
- "name": "AparteConfigChangeEventDetail",
10852
- "module": "./aparte-config.js"
10853
- }
10854
- },
10855
- {
10856
- "kind": "js",
10857
- "name": "AparteMarkdownProvider",
10858
- "declaration": {
10859
- "name": "AparteMarkdownProvider",
10860
- "module": "./aparte-config.js"
10861
- }
10862
- },
10863
- {
10864
- "kind": "js",
10865
- "name": "AparteStreamingMarkdownProvider",
10866
- "declaration": {
10867
- "name": "AparteStreamingMarkdownProvider",
10868
- "module": "./aparte-config.js"
10869
- }
10870
- },
10871
- {
10872
- "kind": "js",
10873
- "name": "AparteStreamingMarkdownRenderer",
10874
- "declaration": {
10875
- "name": "AparteStreamingMarkdownRenderer",
10876
- "module": "./aparte-config.js"
10877
- }
10878
- },
10879
- {
10880
- "kind": "js",
10881
- "name": "AparteCodeLanguageRenderer",
10882
- "declaration": {
10883
- "name": "AparteCodeLanguageRenderer",
10884
- "module": "./aparte-config.js"
10885
- }
10886
- },
10887
- {
10888
- "kind": "js",
10889
- "name": "AparteCodeLanguageContext",
10890
- "declaration": {
10891
- "name": "AparteCodeLanguageContext",
10892
- "module": "./aparte-config.js"
10893
- }
10894
- },
10895
- {
10896
- "kind": "js",
10897
- "name": "AparteHighlightProvider",
10898
- "declaration": {
10899
- "name": "AparteHighlightProvider",
10900
- "module": "./aparte-config.js"
10901
- }
10902
- },
10903
- {
10904
- "kind": "js",
10905
- "name": "AparteSystemPromptVarsProvider",
10906
- "declaration": {
10907
- "name": "AparteSystemPromptVarsProvider",
10908
- "module": "./aparte-config.js"
10909
- }
10910
- },
10911
- {
10912
- "kind": "js",
10913
- "name": "AparteModelPreference",
10914
- "declaration": {
10915
- "name": "AparteModelPreference",
10916
- "module": "./aparte-config.js"
10917
- }
10918
- },
10919
- {
10920
- "kind": "js",
10921
- "name": "AparteModelPreferenceProvider",
10922
- "declaration": {
10923
- "name": "AparteModelPreferenceProvider",
10924
- "module": "./aparte-config.js"
10925
- }
10926
- },
10927
- {
10928
- "kind": "js",
10929
- "name": "AparteSanitizer",
10930
- "declaration": {
10931
- "name": "AparteSanitizer",
10932
- "module": "./sanitize.js"
10933
- }
10934
- },
10935
- {
10936
- "kind": "js",
10937
- "name": "AparteImageDecision",
10938
- "declaration": {
10939
- "name": "AparteImageDecision",
10940
- "module": "./image-policy.js"
10941
- }
10942
- },
10943
- {
10944
- "kind": "js",
10945
- "name": "AparteImagePolicy",
10946
- "declaration": {
10947
- "name": "AparteImagePolicy",
10948
- "module": "./image-policy.js"
10949
- }
10950
- },
10951
- {
10952
- "kind": "js",
10953
- "name": "defaultSanitizer",
10954
- "declaration": {
10955
- "name": "defaultSanitizer",
10956
- "module": "./sanitize.js"
10957
- }
10958
- },
10959
- {
10960
- "kind": "js",
10961
- "name": "isSafeUrl",
10962
- "declaration": {
10963
- "name": "isSafeUrl",
10964
- "module": "./sanitize.js"
10965
- }
10966
- },
10967
- {
10968
- "kind": "js",
10969
- "name": "AparteIconProvider",
10970
- "declaration": {
10971
- "name": "AparteIconProvider",
10972
- "module": "./icon-provider.js"
10973
- }
10974
- },
10975
- {
10976
- "kind": "js",
10977
- "name": "AparteIconName",
10978
- "declaration": {
10979
- "name": "AparteIconName",
10980
- "module": "./icon-provider.js"
10981
- }
10982
- },
10983
- {
10984
- "kind": "js",
10985
- "name": "AparteCoreIconName",
10986
- "declaration": {
10987
- "name": "AparteCoreIconName",
10988
- "module": "./icon-provider.js"
10989
- }
10990
- },
10991
- {
10992
- "kind": "js",
10993
- "name": "APARTE_DEFAULT_ICON_FALLBACKS",
10994
- "declaration": {
10995
- "name": "APARTE_DEFAULT_ICON_FALLBACKS",
10996
- "module": "./icon-provider.js"
10997
- }
10998
- },
10999
- {
11000
- "kind": "js",
11001
- "name": "AparteAvatarProvider",
11002
- "declaration": {
11003
- "name": "AparteAvatarProvider",
11004
- "module": "./avatar-provider.js"
11005
- }
11006
- },
11007
- {
11008
- "kind": "js",
11009
- "name": "AparteStatusRenderer",
11010
- "declaration": {
11011
- "name": "AparteStatusRenderer",
11012
- "module": "./status-renderer.js"
11013
- }
11014
- },
11015
- {
11016
- "kind": "js",
11017
- "name": "AparteErrorRenderer",
11018
- "declaration": {
11019
- "name": "AparteErrorRenderer",
11020
- "module": "./error-renderer.js"
11021
- }
10831
+ }
10832
+ }
10833
+ ],
10834
+ "description": "Run `fn` with `config` as the ambient render config (restored after)."
11022
10835
  },
11023
10836
  {
11024
- "kind": "js",
11025
- "name": "AparteAttachmentRenderer",
11026
- "declaration": {
11027
- "name": "AparteAttachmentRenderer",
11028
- "module": "./attachment-renderer.js"
11029
- }
11030
- },
10837
+ "kind": "function",
10838
+ "name": "contextConfig",
10839
+ "return": {
10840
+ "type": {
10841
+ "text": "AparteConfig"
10842
+ }
10843
+ },
10844
+ "parameters": [
10845
+ {
10846
+ "name": "el",
10847
+ "optional": true,
10848
+ "type": {
10849
+ "text": "Element | null"
10850
+ }
10851
+ }
10852
+ ],
10853
+ "description": "The ambient render config set by runWithConfig, else the config\nresolved from `el` (when provided), else the global singleton. Capture it\nsynchronously at the top of a renderer — never after an `await`."
10854
+ }
10855
+ ],
10856
+ "exports": [
11031
10857
  {
11032
10858
  "kind": "js",
11033
- "name": "AparteElicitationFieldRenderer",
10859
+ "name": "APARTE_HOST_ATTR",
11034
10860
  "declaration": {
11035
- "name": "AparteElicitationFieldRenderer",
11036
- "module": "./elicitation-field-renderer.js"
10861
+ "name": "APARTE_HOST_ATTR",
10862
+ "module": "src/config/config-context.ts"
11037
10863
  }
11038
10864
  },
11039
10865
  {
11040
10866
  "kind": "js",
11041
- "name": "AparteElicitationFieldContext",
10867
+ "name": "attachConfig",
11042
10868
  "declaration": {
11043
- "name": "AparteElicitationFieldContext",
11044
- "module": "./elicitation-field-renderer.js"
10869
+ "name": "attachConfig",
10870
+ "module": "src/config/config-context.ts"
11045
10871
  }
11046
10872
  },
11047
10873
  {
11048
10874
  "kind": "js",
11049
- "name": "AparteElicitationFieldControl",
10875
+ "name": "detachConfig",
11050
10876
  "declaration": {
11051
- "name": "AparteElicitationFieldControl",
11052
- "module": "./elicitation-field-renderer.js"
10877
+ "name": "detachConfig",
10878
+ "module": "src/config/config-context.ts"
11053
10879
  }
11054
10880
  },
11055
10881
  {
11056
10882
  "kind": "js",
11057
- "name": "AparteSiblingNavRenderer",
10883
+ "name": "resolveConfig",
11058
10884
  "declaration": {
11059
- "name": "AparteSiblingNavRenderer",
11060
- "module": "./sibling-nav-renderer.js"
10885
+ "name": "resolveConfig",
10886
+ "module": "src/config/config-context.ts"
11061
10887
  }
11062
10888
  },
11063
10889
  {
11064
10890
  "kind": "js",
11065
- "name": "AparteBubbleShellRenderer",
10891
+ "name": "runWithConfig",
11066
10892
  "declaration": {
11067
- "name": "AparteBubbleShellRenderer",
11068
- "module": "./bubble-shell-renderer.js"
10893
+ "name": "runWithConfig",
10894
+ "module": "src/config/config-context.ts"
11069
10895
  }
11070
10896
  },
11071
10897
  {
11072
10898
  "kind": "js",
11073
- "name": "AparteLocale",
10899
+ "name": "contextConfig",
11074
10900
  "declaration": {
11075
- "name": "AparteLocale",
11076
- "module": "./locale.js"
10901
+ "name": "contextConfig",
10902
+ "module": "src/config/config-context.ts"
11077
10903
  }
11078
- },
10904
+ }
10905
+ ]
10906
+ },
10907
+ {
10908
+ "kind": "javascript-module",
10909
+ "path": "src/config/config-subscribe.ts",
10910
+ "declarations": [
11079
10911
  {
11080
- "kind": "js",
11081
- "name": "AparteLocaleExtensions",
11082
- "declaration": {
11083
- "name": "AparteLocaleExtensions",
11084
- "module": "./locale.js"
11085
- }
10912
+ "kind": "variable",
10913
+ "name": "APARTE_CONFIG_CHANGE",
10914
+ "type": {
10915
+ "text": "string"
10916
+ },
10917
+ "default": "'aparte-config-change'",
10918
+ "description": "The event `AparteConfig._notify()` dispatches on `window`."
11086
10919
  },
11087
10920
  {
11088
- "kind": "js",
11089
- "name": "APARTE_DEFAULT_LOCALE",
11090
- "declaration": {
11091
- "name": "APARTE_DEFAULT_LOCALE",
11092
- "module": "./locale.js"
11093
- }
11094
- },
10921
+ "kind": "function",
10922
+ "name": "subscribeConfigChange",
10923
+ "return": {
10924
+ "type": {
10925
+ "text": "() => void"
10926
+ }
10927
+ },
10928
+ "parameters": [
10929
+ {
10930
+ "name": "el",
10931
+ "type": {
10932
+ "text": "Element"
10933
+ }
10934
+ },
10935
+ {
10936
+ "name": "handler",
10937
+ "type": {
10938
+ "text": "() => void"
10939
+ }
10940
+ }
10941
+ ]
10942
+ }
10943
+ ],
10944
+ "exports": [
11095
10945
  {
11096
10946
  "kind": "js",
11097
- "name": "AparteAction",
10947
+ "name": "APARTE_CONFIG_CHANGE",
11098
10948
  "declaration": {
11099
- "name": "AparteAction",
11100
- "module": "./action-provider.js"
10949
+ "name": "APARTE_CONFIG_CHANGE",
10950
+ "module": "src/config/config-subscribe.ts"
11101
10951
  }
11102
10952
  },
11103
10953
  {
11104
10954
  "kind": "js",
11105
- "name": "AparteActionZone",
10955
+ "name": "subscribeConfigChange",
11106
10956
  "declaration": {
11107
- "name": "AparteActionZone",
11108
- "module": "./action-provider.js"
10957
+ "name": "subscribeConfigChange",
10958
+ "module": "src/config/config-subscribe.ts"
11109
10959
  }
11110
10960
  }
11111
10961
  ]
11112
10962
  },
11113
10963
  {
11114
10964
  "kind": "javascript-module",
11115
- "path": "src/config/locale.ts",
10965
+ "path": "src/config/elicitation-field-renderer.ts",
10966
+ "declarations": [],
10967
+ "exports": []
10968
+ },
10969
+ {
10970
+ "kind": "javascript-module",
10971
+ "path": "src/config/error-renderer.ts",
10972
+ "declarations": [],
10973
+ "exports": []
10974
+ },
10975
+ {
10976
+ "kind": "javascript-module",
10977
+ "path": "src/config/icon-provider.ts",
11116
10978
  "declarations": [
11117
10979
  {
11118
10980
  "kind": "variable",
11119
- "name": "APARTE_DEFAULT_LOCALE",
10981
+ "name": "APARTE_DEFAULT_ICON_FALLBACKS",
11120
10982
  "type": {
11121
- "text": "AparteLocale"
10983
+ "text": "Record<AparteCoreIconName, string>"
11122
10984
  },
11123
- "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\", turnWorking: \"Working…\", turnWorked: \"Worked {duration}\", turnUsed: \"Used {tools}\", turnTools: \"one:{n} tool|other:{n} tools\", feedbackReasonTitle: 'What went wrong?', feedbackReasonDismiss: 'Not now', triggersLoading: 'Loading…', triggersEmpty: 'No results', triggersError: 'This list could not be loaded', triggersRetry: 'Try again', triggersBack: 'Back', triggersCommandNew: 'Start a new conversation', triggersCommandStop: 'Stop the reply', triggersCommandRetry: 'Answer again', triggersCommandCopy: 'Copy the last reply', triggersCommandCompact: 'Summarise the earlier messages', triggersCompactNothing: 'There is nothing to compact yet', triggersCompactBusy: 'Wait for the reply to finish', triggersCompactNoWindow: 'This model does not say how much it can read', triggersCompactFailed: 'The summary could not be written', triggersCommandModel: 'Change the model', triggersCommandApproval: 'Change the approval mode', 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\", closeArtifact: \"Close\", artifactVersion: \"Version {n} of {total}\", previousVersion: \"Previous version\", nextVersion: \"Next version\", 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\", launcherHeading: \"Chat\", launcherMaximize: \"Expand the chat\", launcherRestore: \"Shrink the chat\", transcript: \"Transcript\" }",
11124
- "description": "Default English Locale (Zero-dependency)\nHardcoded to ensure the core works out-of-the-box."
10985
+ "default": "APARTE_ICON_GLYPHS",
10986
+ "description": "The default drawing for every name, assembled from `icons/glyphs.ts`.\n\n`getIcon()` reads this by a COMPUTED key, so a bundler cannot tell which entries a\nbuild reaches and keeps the object whole. That is the constraint that shapes the icon\nset: what belongs here is what core itself draws, and nothing else — an icon nobody\nrenders would still ship to everybody. Extra glyphs are individual exports a consumer\nimports by name, never members of this record."
11125
10987
  }
11126
10988
  ],
11127
10989
  "exports": [
11128
10990
  {
11129
10991
  "kind": "js",
11130
- "name": "APARTE_DEFAULT_LOCALE",
10992
+ "name": "APARTE_DEFAULT_ICON_FALLBACKS",
11131
10993
  "declaration": {
11132
- "name": "APARTE_DEFAULT_LOCALE",
11133
- "module": "src/config/locale.ts"
10994
+ "name": "APARTE_DEFAULT_ICON_FALLBACKS",
10995
+ "module": "src/config/icon-provider.ts"
11134
10996
  }
11135
10997
  }
11136
10998
  ]
11137
10999
  },
11138
11000
  {
11139
11001
  "kind": "javascript-module",
11140
- "path": "src/config/sanitize.ts",
11002
+ "path": "src/config/image-policy.ts",
11141
11003
  "declarations": [
11142
11004
  {
11143
- "kind": "variable",
11144
- "name": "DANGEROUS_TAGS",
11145
- "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', ])",
11146
- "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."
11005
+ "kind": "function",
11006
+ "name": "resolveImageAddress",
11007
+ "return": {
11008
+ "type": {
11009
+ "text": "URL | null"
11010
+ }
11011
+ },
11012
+ "parameters": [
11013
+ {
11014
+ "name": "address",
11015
+ "type": {
11016
+ "text": "string"
11017
+ }
11018
+ }
11019
+ ],
11020
+ "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."
11147
11021
  },
11148
11022
  {
11149
- "kind": "variable",
11150
- "name": "RESERVED_ATTRIBUTES",
11151
- "default": "new Set([ 'data-aparte-chat', 'data-aparte-host', 'data-aparte-theme', 'data-aparte-split-pane', 'data-aparte-launcher-close', 'data-aparte-launcher-maximize', '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', ])",
11152
- "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 and maximize), 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."
11023
+ "kind": "function",
11024
+ "name": "sameImagePolicy",
11025
+ "return": {
11026
+ "type": {
11027
+ "text": "boolean"
11028
+ }
11029
+ },
11030
+ "parameters": [
11031
+ {
11032
+ "name": "a",
11033
+ "type": {
11034
+ "text": "AparteImagePolicy"
11035
+ }
11036
+ },
11037
+ {
11038
+ "name": "b",
11039
+ "type": {
11040
+ "text": "AparteImagePolicy"
11041
+ }
11042
+ }
11043
+ ],
11044
+ "description": "Whether two policies say the same thing: the same function, or lists with the same entries."
11153
11045
  },
11154
11046
  {
11155
- "kind": "variable",
11156
- "name": "RESERVED_ATTRIBUTE_PREFIXES",
11157
- "type": {
11158
- "text": "array"
11047
+ "kind": "function",
11048
+ "name": "compileImagePolicy",
11049
+ "return": {
11050
+ "type": {
11051
+ "text": "ImageDecider"
11052
+ }
11159
11053
  },
11160
- "default": "['data-aparte-dialog-', 'data-aparte-sidebar-', 'data-checkpoint-']",
11161
- "description": "Families of reserved attributes: `-open`/`-close`/`-static`, `-toggle`/`-search`, `-action`/`-reason`."
11054
+ "parameters": [
11055
+ {
11056
+ "name": "policy",
11057
+ "type": {
11058
+ "text": "AparteImagePolicy"
11059
+ }
11060
+ }
11061
+ ],
11062
+ "description": "Turn a policy into the function every decision runs through."
11162
11063
  },
11163
11064
  {
11164
11065
  "kind": "function",
11165
- "name": "isReservedAttribute",
11066
+ "name": "decideImageAddress",
11166
11067
  "return": {
11167
11068
  "type": {
11168
- "text": "boolean"
11069
+ "text": "AparteImageDecision"
11169
11070
  }
11170
11071
  },
11171
11072
  "parameters": [
11172
11073
  {
11173
- "name": "name",
11074
+ "name": "decide",
11075
+ "type": {
11076
+ "text": "ImageDecider"
11077
+ }
11078
+ },
11079
+ {
11080
+ "name": "address",
11174
11081
  "type": {
11175
11082
  "text": "string"
11176
11083
  }
11084
+ },
11085
+ {
11086
+ "name": "shown",
11087
+ "optional": true,
11088
+ "type": {
11089
+ "text": "ReadonlySet<string>"
11090
+ }
11177
11091
  }
11178
11092
  ],
11179
- "description": "True when `name` (lower case) is an attribute core reads, so model markup may not carry it."
11093
+ "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."
11180
11094
  },
11181
11095
  {
11182
11096
  "kind": "function",
11183
- "name": "isSafeUrl",
11097
+ "name": "rememberShownImage",
11184
11098
  "return": {
11185
11099
  "type": {
11186
- "text": "boolean"
11100
+ "text": "void"
11101
+ }
11102
+ },
11103
+ "parameters": [
11104
+ {
11105
+ "name": "owner",
11106
+ "type": {
11107
+ "text": "object"
11108
+ }
11109
+ },
11110
+ {
11111
+ "name": "address",
11112
+ "type": {
11113
+ "text": "string"
11114
+ }
11115
+ }
11116
+ ],
11117
+ "description": "Remember that the reader chose to see the picture at `address`, under `owner` (a config)."
11118
+ },
11119
+ {
11120
+ "kind": "function",
11121
+ "name": "shownImagesOf",
11122
+ "return": {
11123
+ "type": {
11124
+ "text": "ReadonlySet<string> | undefined"
11125
+ }
11126
+ },
11127
+ "parameters": [
11128
+ {
11129
+ "name": "owner",
11130
+ "type": {
11131
+ "text": "object"
11132
+ }
11133
+ }
11134
+ ],
11135
+ "description": "The pictures the reader chose to see under `owner`."
11136
+ },
11137
+ {
11138
+ "kind": "function",
11139
+ "name": "forgetShownImages",
11140
+ "return": {
11141
+ "type": {
11142
+ "text": "void"
11143
+ }
11144
+ },
11145
+ "parameters": [
11146
+ {
11147
+ "name": "owner",
11148
+ "type": {
11149
+ "text": "object"
11150
+ }
11151
+ }
11152
+ ],
11153
+ "description": "Forget them: a reset config starts from what its policy says."
11154
+ },
11155
+ {
11156
+ "kind": "function",
11157
+ "name": "parseSrcset",
11158
+ "return": {
11159
+ "type": {
11160
+ "text": "SrcsetCandidate[]"
11161
+ }
11162
+ },
11163
+ "parameters": [
11164
+ {
11165
+ "name": "value",
11166
+ "type": {
11167
+ "text": "string"
11168
+ }
11169
+ }
11170
+ ],
11171
+ "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."
11172
+ },
11173
+ {
11174
+ "kind": "function",
11175
+ "name": "srcsetUrls",
11176
+ "return": {
11177
+ "type": {
11178
+ "text": "string[]"
11187
11179
  }
11188
11180
  },
11189
11181
  "parameters": [
@@ -11192,21 +11184,68 @@
11192
11184
  "type": {
11193
11185
  "text": "string"
11194
11186
  }
11187
+ }
11188
+ ],
11189
+ "description": "The addresses a `srcset` lists, as `parseSrcset` reads them."
11190
+ },
11191
+ {
11192
+ "kind": "function",
11193
+ "name": "imageHost",
11194
+ "return": {
11195
+ "type": {
11196
+ "text": "string"
11197
+ }
11198
+ },
11199
+ "parameters": [
11200
+ {
11201
+ "name": "address",
11202
+ "type": {
11203
+ "text": "string"
11204
+ }
11205
+ }
11206
+ ],
11207
+ "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."
11208
+ },
11209
+ {
11210
+ "kind": "function",
11211
+ "name": "heldImageHtml",
11212
+ "return": {
11213
+ "type": {
11214
+ "text": "string"
11215
+ }
11216
+ },
11217
+ "parameters": [
11218
+ {
11219
+ "name": "address",
11220
+ "type": {
11221
+ "text": "string"
11222
+ }
11195
11223
  },
11196
11224
  {
11197
- "name": "tag",
11225
+ "name": "alt",
11198
11226
  "type": {
11199
11227
  "text": "string"
11200
11228
  }
11229
+ },
11230
+ {
11231
+ "name": "words",
11232
+ "type": {
11233
+ "text": "HeldImageWords"
11234
+ }
11235
+ },
11236
+ {
11237
+ "name": "inLink",
11238
+ "default": "false"
11201
11239
  }
11202
- ]
11240
+ ],
11241
+ "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."
11203
11242
  },
11204
11243
  {
11205
11244
  "kind": "function",
11206
- "name": "readTag",
11245
+ "name": "applyImagePolicy",
11207
11246
  "return": {
11208
11247
  "type": {
11209
- "text": "{ tag: string; attrs: Array<[string, string]>; end: number }"
11248
+ "text": "string"
11210
11249
  }
11211
11250
  },
11212
11251
  "parameters": [
@@ -11217,17 +11256,23 @@
11217
11256
  }
11218
11257
  },
11219
11258
  {
11220
- "name": "nameAt",
11259
+ "name": "decide",
11221
11260
  "type": {
11222
- "text": "number"
11261
+ "text": "(address: string) => AparteImageDecision"
11262
+ }
11263
+ },
11264
+ {
11265
+ "name": "words",
11266
+ "type": {
11267
+ "text": "() => HeldImageWords"
11223
11268
  }
11224
11269
  }
11225
11270
  ],
11226
- "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."
11271
+ "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."
11227
11272
  },
11228
11273
  {
11229
11274
  "kind": "function",
11230
- "name": "defaultSanitizer",
11275
+ "name": "applyImagePolicyWithoutDom",
11231
11276
  "return": {
11232
11277
  "type": {
11233
11278
  "text": "string"
@@ -11239,601 +11284,846 @@
11239
11284
  "type": {
11240
11285
  "text": "string"
11241
11286
  }
11287
+ },
11288
+ {
11289
+ "name": "decide",
11290
+ "type": {
11291
+ "text": "(address: string) => AparteImageDecision"
11292
+ }
11293
+ },
11294
+ {
11295
+ "name": "words",
11296
+ "type": {
11297
+ "text": "() => HeldImageWords"
11298
+ }
11242
11299
  }
11243
11300
  ],
11244
- "description": "The built-in sanitizer. Parses `html` with the platform DOMParser, rebuilds an\nallowlisted tree, and re-serializes it. Falls back to a regex scrub only when\nno DOMParser exists (non-browser runtime)."
11301
+ "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."
11302
+ }
11303
+ ],
11304
+ "exports": [
11305
+ {
11306
+ "kind": "js",
11307
+ "name": "resolveImageAddress",
11308
+ "declaration": {
11309
+ "name": "resolveImageAddress",
11310
+ "module": "src/config/image-policy.ts"
11311
+ }
11312
+ },
11313
+ {
11314
+ "kind": "js",
11315
+ "name": "sameImagePolicy",
11316
+ "declaration": {
11317
+ "name": "sameImagePolicy",
11318
+ "module": "src/config/image-policy.ts"
11319
+ }
11320
+ },
11321
+ {
11322
+ "kind": "js",
11323
+ "name": "compileImagePolicy",
11324
+ "declaration": {
11325
+ "name": "compileImagePolicy",
11326
+ "module": "src/config/image-policy.ts"
11327
+ }
11328
+ },
11329
+ {
11330
+ "kind": "js",
11331
+ "name": "decideImageAddress",
11332
+ "declaration": {
11333
+ "name": "decideImageAddress",
11334
+ "module": "src/config/image-policy.ts"
11335
+ }
11336
+ },
11337
+ {
11338
+ "kind": "js",
11339
+ "name": "rememberShownImage",
11340
+ "declaration": {
11341
+ "name": "rememberShownImage",
11342
+ "module": "src/config/image-policy.ts"
11343
+ }
11344
+ },
11345
+ {
11346
+ "kind": "js",
11347
+ "name": "shownImagesOf",
11348
+ "declaration": {
11349
+ "name": "shownImagesOf",
11350
+ "module": "src/config/image-policy.ts"
11351
+ }
11352
+ },
11353
+ {
11354
+ "kind": "js",
11355
+ "name": "forgetShownImages",
11356
+ "declaration": {
11357
+ "name": "forgetShownImages",
11358
+ "module": "src/config/image-policy.ts"
11359
+ }
11360
+ },
11361
+ {
11362
+ "kind": "js",
11363
+ "name": "parseSrcset",
11364
+ "declaration": {
11365
+ "name": "parseSrcset",
11366
+ "module": "src/config/image-policy.ts"
11367
+ }
11368
+ },
11369
+ {
11370
+ "kind": "js",
11371
+ "name": "srcsetUrls",
11372
+ "declaration": {
11373
+ "name": "srcsetUrls",
11374
+ "module": "src/config/image-policy.ts"
11375
+ }
11376
+ },
11377
+ {
11378
+ "kind": "js",
11379
+ "name": "imageHost",
11380
+ "declaration": {
11381
+ "name": "imageHost",
11382
+ "module": "src/config/image-policy.ts"
11383
+ }
11384
+ },
11385
+ {
11386
+ "kind": "js",
11387
+ "name": "heldImageHtml",
11388
+ "declaration": {
11389
+ "name": "heldImageHtml",
11390
+ "module": "src/config/image-policy.ts"
11391
+ }
11392
+ },
11393
+ {
11394
+ "kind": "js",
11395
+ "name": "applyImagePolicy",
11396
+ "declaration": {
11397
+ "name": "applyImagePolicy",
11398
+ "module": "src/config/image-policy.ts"
11399
+ }
11400
+ },
11401
+ {
11402
+ "kind": "js",
11403
+ "name": "applyImagePolicyWithoutDom",
11404
+ "declaration": {
11405
+ "name": "applyImagePolicyWithoutDom",
11406
+ "module": "src/config/image-policy.ts"
11407
+ }
11245
11408
  }
11246
- ],
11409
+ ]
11410
+ },
11411
+ {
11412
+ "kind": "javascript-module",
11413
+ "path": "src/config/index.ts",
11414
+ "declarations": [],
11247
11415
  "exports": [
11248
11416
  {
11249
11417
  "kind": "js",
11250
- "name": "DANGEROUS_TAGS",
11418
+ "name": "aparteGlobalConfig",
11251
11419
  "declaration": {
11252
- "name": "DANGEROUS_TAGS",
11253
- "module": "src/config/sanitize.ts"
11420
+ "name": "aparteGlobalConfig",
11421
+ "module": "./aparte-config.js"
11254
11422
  }
11255
11423
  },
11256
11424
  {
11257
11425
  "kind": "js",
11258
- "name": "RESERVED_ATTRIBUTES",
11426
+ "name": "AparteConfig",
11259
11427
  "declaration": {
11260
- "name": "RESERVED_ATTRIBUTES",
11261
- "module": "src/config/sanitize.ts"
11428
+ "name": "AparteConfig",
11429
+ "module": "./aparte-config.js"
11262
11430
  }
11263
11431
  },
11264
11432
  {
11265
11433
  "kind": "js",
11266
- "name": "RESERVED_ATTRIBUTE_PREFIXES",
11434
+ "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
11267
11435
  "declaration": {
11268
- "name": "RESERVED_ATTRIBUTE_PREFIXES",
11269
- "module": "src/config/sanitize.ts"
11436
+ "name": "APARTE_DEFAULT_BUBBLE_ACTIONS",
11437
+ "module": "./aparte-config.js"
11270
11438
  }
11271
11439
  },
11272
11440
  {
11273
11441
  "kind": "js",
11274
- "name": "isReservedAttribute",
11442
+ "name": "APARTE_DEFAULT_HOST_HANDLERS",
11275
11443
  "declaration": {
11276
- "name": "isReservedAttribute",
11277
- "module": "src/config/sanitize.ts"
11444
+ "name": "APARTE_DEFAULT_HOST_HANDLERS",
11445
+ "module": "./aparte-config.js"
11278
11446
  }
11279
11447
  },
11280
11448
  {
11281
11449
  "kind": "js",
11282
- "name": "isSafeUrl",
11450
+ "name": "resolveConfig",
11283
11451
  "declaration": {
11284
- "name": "isSafeUrl",
11285
- "module": "src/config/sanitize.ts"
11452
+ "name": "resolveConfig",
11453
+ "module": "./config-context.js"
11286
11454
  }
11287
11455
  },
11288
11456
  {
11289
11457
  "kind": "js",
11290
- "name": "readTag",
11458
+ "name": "attachConfig",
11291
11459
  "declaration": {
11292
- "name": "readTag",
11293
- "module": "src/config/sanitize.ts"
11460
+ "name": "attachConfig",
11461
+ "module": "./config-context.js"
11294
11462
  }
11295
11463
  },
11296
11464
  {
11297
11465
  "kind": "js",
11298
- "name": "defaultSanitizer",
11466
+ "name": "detachConfig",
11299
11467
  "declaration": {
11300
- "name": "defaultSanitizer",
11301
- "module": "src/config/sanitize.ts"
11468
+ "name": "detachConfig",
11469
+ "module": "./config-context.js"
11302
11470
  }
11303
- }
11304
- ]
11305
- },
11306
- {
11307
- "kind": "javascript-module",
11308
- "path": "src/config/sibling-nav-renderer.ts",
11309
- "declarations": [],
11310
- "exports": []
11311
- },
11312
- {
11313
- "kind": "javascript-module",
11314
- "path": "src/config/status-renderer.ts",
11315
- "declarations": [],
11316
- "exports": []
11317
- },
11318
- {
11319
- "kind": "javascript-module",
11320
- "path": "src/config/tool-table.ts",
11321
- "declarations": [
11471
+ },
11322
11472
  {
11323
- "kind": "class",
11324
- "description": "",
11325
- "name": "ToolTable",
11326
- "members": [
11327
- {
11328
- "kind": "field",
11329
- "name": "exact",
11330
- "privacy": "private",
11331
- "readonly": true,
11332
- "default": "new Map<string, T>()"
11333
- },
11334
- {
11335
- "kind": "field",
11336
- "name": "patterns",
11337
- "privacy": "private",
11338
- "readonly": true,
11339
- "default": "new Map<string, { re: RegExp; value: T }>()"
11340
- },
11341
- {
11342
- "kind": "field",
11343
- "name": "any",
11344
- "type": {
11345
- "text": "T | undefined"
11346
- },
11347
- "privacy": "private"
11348
- },
11349
- {
11350
- "kind": "method",
11351
- "name": "get",
11352
- "return": {
11353
- "type": {
11354
- "text": "T | undefined"
11355
- }
11356
- },
11357
- "parameters": [
11358
- {
11359
- "name": "match",
11360
- "type": {
11361
- "text": "AparteToolMatcher"
11362
- }
11363
- }
11364
- ],
11365
- "description": "The value registered under exactly this matcher — not a resolution."
11366
- },
11367
- {
11368
- "kind": "method",
11369
- "name": "set",
11370
- "return": {
11371
- "type": {
11372
- "text": "void"
11373
- }
11374
- },
11375
- "parameters": [
11376
- {
11377
- "name": "match",
11378
- "type": {
11379
- "text": "AparteToolMatcher"
11380
- }
11381
- },
11382
- {
11383
- "name": "value",
11384
- "type": {
11385
- "text": "T"
11386
- }
11387
- }
11388
- ]
11389
- },
11390
- {
11391
- "kind": "method",
11392
- "name": "delete",
11393
- "return": {
11394
- "type": {
11395
- "text": "void"
11396
- }
11397
- },
11398
- "parameters": [
11399
- {
11400
- "name": "match",
11401
- "type": {
11402
- "text": "AparteToolMatcher"
11403
- }
11404
- }
11405
- ]
11406
- },
11407
- {
11408
- "kind": "method",
11409
- "name": "resolve",
11410
- "return": {
11411
- "type": {
11412
- "text": "{ value: T; level: ToolMatchLevel } | undefined"
11413
- }
11414
- },
11415
- "parameters": [
11416
- {
11417
- "name": "name",
11418
- "type": {
11419
- "text": "string"
11420
- }
11421
- }
11422
- ],
11423
- "description": "The value that applies to a tool named `name`, and how specifically it names it."
11424
- },
11425
- {
11426
- "kind": "method",
11427
- "name": "values",
11428
- "return": {
11429
- "type": {
11430
- "text": "T[]"
11431
- }
11432
- },
11433
- "description": "Every value registered, whatever its matcher."
11434
- },
11435
- {
11436
- "kind": "method",
11437
- "name": "clear",
11438
- "return": {
11439
- "type": {
11440
- "text": "void"
11441
- }
11442
- }
11443
- }
11444
- ]
11445
- }
11446
- ],
11447
- "exports": [
11473
+ "kind": "js",
11474
+ "name": "runWithConfig",
11475
+ "declaration": {
11476
+ "name": "runWithConfig",
11477
+ "module": "./config-context.js"
11478
+ }
11479
+ },
11448
11480
  {
11449
11481
  "kind": "js",
11450
- "name": "ToolTable",
11482
+ "name": "contextConfig",
11451
11483
  "declaration": {
11452
- "name": "ToolTable",
11453
- "module": "src/config/tool-table.ts"
11484
+ "name": "contextConfig",
11485
+ "module": "./config-context.js"
11454
11486
  }
11455
- }
11456
- ]
11457
- },
11458
- {
11459
- "kind": "javascript-module",
11460
- "path": "src/components/index.ts",
11461
- "declarations": [],
11462
- "exports": [
11487
+ },
11463
11488
  {
11464
11489
  "kind": "js",
11465
- "name": "AparteChat",
11490
+ "name": "APARTE_HOST_ATTR",
11466
11491
  "declaration": {
11467
- "name": "AparteChat",
11468
- "module": "./chat/index.js"
11492
+ "name": "APARTE_HOST_ATTR",
11493
+ "module": "./config-context.js"
11469
11494
  }
11470
11495
  },
11471
11496
  {
11472
11497
  "kind": "js",
11473
- "name": "AparteChatBubble",
11498
+ "name": "subscribeConfigChange",
11474
11499
  "declaration": {
11475
- "name": "AparteChatBubble",
11476
- "module": "./bubble/index.js"
11500
+ "name": "subscribeConfigChange",
11501
+ "module": "./config-subscribe.js"
11477
11502
  }
11478
11503
  },
11479
11504
  {
11480
11505
  "kind": "js",
11481
- "name": "populateBubbleFromMessage",
11506
+ "name": "APARTE_CONFIG_CHANGE",
11482
11507
  "declaration": {
11483
- "name": "populateBubbleFromMessage",
11484
- "module": "./bubble/index.js"
11508
+ "name": "APARTE_CONFIG_CHANGE",
11509
+ "module": "./config-subscribe.js"
11485
11510
  }
11486
11511
  },
11487
11512
  {
11488
11513
  "kind": "js",
11489
- "name": "SyncableBubble",
11514
+ "name": "AparteConfigAware",
11490
11515
  "declaration": {
11491
- "name": "SyncableBubble",
11492
- "module": "./bubble/index.js"
11516
+ "name": "AparteConfigAware",
11517
+ "module": "./config-context.js"
11493
11518
  }
11494
11519
  },
11495
11520
  {
11496
11521
  "kind": "js",
11497
- "name": "AparteChatStatus",
11522
+ "name": "AparteConfigChangeEventDetail",
11498
11523
  "declaration": {
11499
- "name": "AparteChatStatus",
11500
- "module": "./status/index.js"
11524
+ "name": "AparteConfigChangeEventDetail",
11525
+ "module": "./aparte-config.js"
11501
11526
  }
11502
11527
  },
11503
11528
  {
11504
11529
  "kind": "js",
11505
- "name": "AparteChatViewport",
11530
+ "name": "AparteMarkdownProvider",
11506
11531
  "declaration": {
11507
- "name": "AparteChatViewport",
11508
- "module": "./viewport/index.js"
11532
+ "name": "AparteMarkdownProvider",
11533
+ "module": "./aparte-config.js"
11509
11534
  }
11510
11535
  },
11511
11536
  {
11512
11537
  "kind": "js",
11513
- "name": "AparteComposer",
11538
+ "name": "AparteStreamingMarkdownProvider",
11514
11539
  "declaration": {
11515
- "name": "AparteComposer",
11516
- "module": "./composer/index.js"
11540
+ "name": "AparteStreamingMarkdownProvider",
11541
+ "module": "./aparte-config.js"
11517
11542
  }
11518
11543
  },
11519
11544
  {
11520
11545
  "kind": "js",
11521
- "name": "AparteComposerInput",
11546
+ "name": "AparteStreamingMarkdownRenderer",
11522
11547
  "declaration": {
11523
- "name": "AparteComposerInput",
11524
- "module": "./composer/index.js"
11548
+ "name": "AparteStreamingMarkdownRenderer",
11549
+ "module": "./aparte-config.js"
11525
11550
  }
11526
11551
  },
11527
11552
  {
11528
11553
  "kind": "js",
11529
- "name": "AparteComposerSend",
11554
+ "name": "AparteCodeLanguageRenderer",
11530
11555
  "declaration": {
11531
- "name": "AparteComposerSend",
11532
- "module": "./composer/index.js"
11556
+ "name": "AparteCodeLanguageRenderer",
11557
+ "module": "./aparte-config.js"
11533
11558
  }
11534
11559
  },
11535
11560
  {
11536
11561
  "kind": "js",
11537
- "name": "AparteComposerCancel",
11562
+ "name": "AparteCodeLanguageContext",
11538
11563
  "declaration": {
11539
- "name": "AparteComposerCancel",
11540
- "module": "./composer/index.js"
11564
+ "name": "AparteCodeLanguageContext",
11565
+ "module": "./aparte-config.js"
11541
11566
  }
11542
11567
  },
11543
11568
  {
11544
11569
  "kind": "js",
11545
- "name": "AparteComposerAttachments",
11570
+ "name": "AparteHighlightProvider",
11546
11571
  "declaration": {
11547
- "name": "AparteComposerAttachments",
11548
- "module": "./composer/index.js"
11572
+ "name": "AparteHighlightProvider",
11573
+ "module": "./aparte-config.js"
11549
11574
  }
11550
11575
  },
11551
11576
  {
11552
11577
  "kind": "js",
11553
- "name": "AparteComposerAddAttachment",
11578
+ "name": "AparteSystemPromptVarsProvider",
11554
11579
  "declaration": {
11555
- "name": "AparteComposerAddAttachment",
11556
- "module": "./composer/index.js"
11580
+ "name": "AparteSystemPromptVarsProvider",
11581
+ "module": "./aparte-config.js"
11557
11582
  }
11558
11583
  },
11559
11584
  {
11560
11585
  "kind": "js",
11561
- "name": "AparteComposerAction",
11586
+ "name": "AparteModelPreference",
11562
11587
  "declaration": {
11563
- "name": "AparteComposerAction",
11564
- "module": "./composer/index.js"
11588
+ "name": "AparteModelPreference",
11589
+ "module": "./aparte-config.js"
11565
11590
  }
11566
11591
  },
11567
11592
  {
11568
11593
  "kind": "js",
11569
- "name": "AparteComposerToolbar",
11594
+ "name": "AparteModelPreferenceProvider",
11570
11595
  "declaration": {
11571
- "name": "AparteComposerToolbar",
11572
- "module": "./composer/index.js"
11596
+ "name": "AparteModelPreferenceProvider",
11597
+ "module": "./aparte-config.js"
11573
11598
  }
11574
11599
  },
11575
11600
  {
11576
11601
  "kind": "js",
11577
- "name": "AparteComposerEventMap",
11602
+ "name": "AparteSanitizer",
11578
11603
  "declaration": {
11579
- "name": "AparteComposerEventMap",
11580
- "module": "./composer/index.js"
11604
+ "name": "AparteSanitizer",
11605
+ "module": "./sanitize.js"
11581
11606
  }
11582
11607
  },
11583
11608
  {
11584
11609
  "kind": "js",
11585
- "name": "AparteComposerEventType",
11610
+ "name": "AparteImageDecision",
11586
11611
  "declaration": {
11587
- "name": "AparteComposerEventType",
11588
- "module": "./composer/index.js"
11612
+ "name": "AparteImageDecision",
11613
+ "module": "./image-policy.js"
11589
11614
  }
11590
11615
  },
11591
11616
  {
11592
11617
  "kind": "js",
11593
- "name": "AparteComposerState",
11618
+ "name": "AparteImagePolicy",
11594
11619
  "declaration": {
11595
- "name": "AparteComposerState",
11596
- "module": "./composer/index.js"
11620
+ "name": "AparteImagePolicy",
11621
+ "module": "./image-policy.js"
11597
11622
  }
11598
11623
  },
11599
11624
  {
11600
11625
  "kind": "js",
11601
- "name": "AparteComposerChangeEventDetail",
11626
+ "name": "defaultSanitizer",
11602
11627
  "declaration": {
11603
- "name": "AparteComposerChangeEventDetail",
11604
- "module": "./composer/index.js"
11628
+ "name": "defaultSanitizer",
11629
+ "module": "./sanitize.js"
11605
11630
  }
11606
11631
  },
11607
11632
  {
11608
11633
  "kind": "js",
11609
- "name": "AparteComposerPanelMode",
11634
+ "name": "isSafeUrl",
11610
11635
  "declaration": {
11611
- "name": "AparteComposerPanelMode",
11612
- "module": "./composer/index.js"
11636
+ "name": "isSafeUrl",
11637
+ "module": "./sanitize.js"
11613
11638
  }
11614
11639
  },
11615
11640
  {
11616
11641
  "kind": "js",
11617
- "name": "AparteTypeToFocus",
11642
+ "name": "AparteIconProvider",
11618
11643
  "declaration": {
11619
- "name": "AparteTypeToFocus",
11620
- "module": "./composer/index.js"
11644
+ "name": "AparteIconProvider",
11645
+ "module": "./icon-provider.js"
11621
11646
  }
11622
11647
  },
11623
11648
  {
11624
11649
  "kind": "js",
11625
- "name": "AparteActionClickEventDetail",
11650
+ "name": "AparteIconName",
11626
11651
  "declaration": {
11627
- "name": "AparteActionClickEventDetail",
11628
- "module": "./composer/index.js"
11652
+ "name": "AparteIconName",
11653
+ "module": "./icon-provider.js"
11629
11654
  }
11630
11655
  },
11631
11656
  {
11632
11657
  "kind": "js",
11633
- "name": "AparteConversationList",
11658
+ "name": "AparteCoreIconName",
11634
11659
  "declaration": {
11635
- "name": "AparteConversationList",
11636
- "module": "./conversation-list/index.js"
11660
+ "name": "AparteCoreIconName",
11661
+ "module": "./icon-provider.js"
11637
11662
  }
11638
11663
  },
11639
11664
  {
11640
11665
  "kind": "js",
11641
- "name": "AparteConversationListItem",
11666
+ "name": "APARTE_DEFAULT_ICON_FALLBACKS",
11642
11667
  "declaration": {
11643
- "name": "AparteConversationListItem",
11644
- "module": "./conversation-list/index.js"
11668
+ "name": "APARTE_DEFAULT_ICON_FALLBACKS",
11669
+ "module": "./icon-provider.js"
11645
11670
  }
11646
11671
  },
11647
11672
  {
11648
11673
  "kind": "js",
11649
- "name": "AparteConversationSelectDetail",
11674
+ "name": "AparteAvatarProvider",
11650
11675
  "declaration": {
11651
- "name": "AparteConversationSelectDetail",
11652
- "module": "./conversation-list/index.js"
11676
+ "name": "AparteAvatarProvider",
11677
+ "module": "./avatar-provider.js"
11653
11678
  }
11654
11679
  },
11655
11680
  {
11656
11681
  "kind": "js",
11657
- "name": "AparteConversationDeleteDetail",
11682
+ "name": "AparteStatusRenderer",
11658
11683
  "declaration": {
11659
- "name": "AparteConversationDeleteDetail",
11660
- "module": "./conversation-list/index.js"
11684
+ "name": "AparteStatusRenderer",
11685
+ "module": "./status-renderer.js"
11661
11686
  }
11662
11687
  },
11663
11688
  {
11664
11689
  "kind": "js",
11665
- "name": "AparteConversationArchiveDetail",
11690
+ "name": "AparteErrorRenderer",
11666
11691
  "declaration": {
11667
- "name": "AparteConversationArchiveDetail",
11668
- "module": "./conversation-list/index.js"
11692
+ "name": "AparteErrorRenderer",
11693
+ "module": "./error-renderer.js"
11669
11694
  }
11670
11695
  },
11671
11696
  {
11672
11697
  "kind": "js",
11673
- "name": "AparteConversationPinDetail",
11698
+ "name": "AparteAttachmentRenderer",
11674
11699
  "declaration": {
11675
- "name": "AparteConversationPinDetail",
11676
- "module": "./conversation-list/index.js"
11700
+ "name": "AparteAttachmentRenderer",
11701
+ "module": "./attachment-renderer.js"
11677
11702
  }
11678
11703
  },
11679
11704
  {
11680
11705
  "kind": "js",
11681
- "name": "AparteConversationRenameDetail",
11706
+ "name": "AparteElicitationFieldRenderer",
11682
11707
  "declaration": {
11683
- "name": "AparteConversationRenameDetail",
11684
- "module": "./conversation-list/index.js"
11708
+ "name": "AparteElicitationFieldRenderer",
11709
+ "module": "./elicitation-field-renderer.js"
11685
11710
  }
11686
11711
  },
11687
11712
  {
11688
11713
  "kind": "js",
11689
- "name": "AparteConversationStatus",
11714
+ "name": "AparteElicitationFieldContext",
11690
11715
  "declaration": {
11691
- "name": "AparteConversationStatus",
11692
- "module": "./conversation-list/index.js"
11716
+ "name": "AparteElicitationFieldContext",
11717
+ "module": "./elicitation-field-renderer.js"
11693
11718
  }
11694
11719
  },
11695
11720
  {
11696
11721
  "kind": "js",
11697
- "name": "AparteConversationStatusDetail",
11722
+ "name": "AparteElicitationFieldControl",
11698
11723
  "declaration": {
11699
- "name": "AparteConversationStatusDetail",
11700
- "module": "./conversation-list/index.js"
11724
+ "name": "AparteElicitationFieldControl",
11725
+ "module": "./elicitation-field-renderer.js"
11701
11726
  }
11702
11727
  },
11703
11728
  {
11704
11729
  "kind": "js",
11705
- "name": "AparteSuggestions",
11730
+ "name": "AparteSiblingNavRenderer",
11706
11731
  "declaration": {
11707
- "name": "AparteSuggestions",
11708
- "module": "./suggestions/index.js"
11732
+ "name": "AparteSiblingNavRenderer",
11733
+ "module": "./sibling-nav-renderer.js"
11709
11734
  }
11710
11735
  },
11711
11736
  {
11712
11737
  "kind": "js",
11713
- "name": "setupSuggestionBlocks",
11738
+ "name": "AparteBubbleShellRenderer",
11714
11739
  "declaration": {
11715
- "name": "setupSuggestionBlocks",
11716
- "module": "./suggestions/index.js"
11740
+ "name": "AparteBubbleShellRenderer",
11741
+ "module": "./bubble-shell-renderer.js"
11717
11742
  }
11718
11743
  },
11719
11744
  {
11720
11745
  "kind": "js",
11721
- "name": "SUGGESTIONS_BLOCK_LANGUAGE",
11746
+ "name": "AparteLocale",
11722
11747
  "declaration": {
11723
- "name": "SUGGESTIONS_BLOCK_LANGUAGE",
11724
- "module": "./suggestions/index.js"
11748
+ "name": "AparteLocale",
11749
+ "module": "./locale.js"
11725
11750
  }
11726
11751
  },
11727
11752
  {
11728
11753
  "kind": "js",
11729
- "name": "AparteSuggestion",
11754
+ "name": "AparteLocaleExtensions",
11730
11755
  "declaration": {
11731
- "name": "AparteSuggestion",
11732
- "module": "./suggestions/index.js"
11756
+ "name": "AparteLocaleExtensions",
11757
+ "module": "./locale.js"
11733
11758
  }
11734
11759
  },
11735
11760
  {
11736
11761
  "kind": "js",
11737
- "name": "AparteSuggestionEventDetail",
11762
+ "name": "APARTE_DEFAULT_LOCALE",
11738
11763
  "declaration": {
11739
- "name": "AparteSuggestionEventDetail",
11740
- "module": "./suggestions/index.js"
11764
+ "name": "APARTE_DEFAULT_LOCALE",
11765
+ "module": "./locale.js"
11741
11766
  }
11742
11767
  },
11743
11768
  {
11744
11769
  "kind": "js",
11745
- "name": "AparteContext",
11770
+ "name": "AparteAction",
11746
11771
  "declaration": {
11747
- "name": "AparteContext",
11748
- "module": "./context/index.js"
11772
+ "name": "AparteAction",
11773
+ "module": "./action-provider.js"
11774
+ }
11775
+ },
11776
+ {
11777
+ "kind": "js",
11778
+ "name": "AparteActionZone",
11779
+ "declaration": {
11780
+ "name": "AparteActionZone",
11781
+ "module": "./action-provider.js"
11782
+ }
11783
+ }
11784
+ ]
11785
+ },
11786
+ {
11787
+ "kind": "javascript-module",
11788
+ "path": "src/config/locale.ts",
11789
+ "declarations": [
11790
+ {
11791
+ "kind": "variable",
11792
+ "name": "APARTE_DEFAULT_LOCALE",
11793
+ "type": {
11794
+ "text": "AparteLocale"
11795
+ },
11796
+ "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}?\", approvalAskBy: \"Allow {tool} for {agent}?\", 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\", turnWorking: \"Working…\", turnWorked: \"Worked {duration}\", turnUsed: \"Used {tools}\", turnTools: \"one:{n} tool|other:{n} tools\", feedbackReasonTitle: 'What went wrong?', feedbackReasonDismiss: 'Not now', triggersLoading: 'Loading…', triggersEmpty: 'No results', triggersError: 'This list could not be loaded', triggersRetry: 'Try again', triggersBack: 'Back', triggersCommandNew: 'Start a new conversation', triggersCommandStop: 'Stop the reply', triggersCommandRetry: 'Answer again', triggersCommandCopy: 'Copy the last reply', triggersCommandCompact: 'Summarise the earlier messages', triggersCompactNothing: 'There is nothing to compact yet', triggersCompactBusy: 'Wait for the reply to finish', triggersCompactNoWindow: 'This model does not say how much it can read', triggersCompactFailed: 'The summary could not be written', triggersCommandModel: 'Change the model', triggersCommandApproval: 'Change the approval mode', 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\", closeArtifact: \"Close\", artifactVersion: \"Version {n} of {total}\", previousVersion: \"Previous version\", nextVersion: \"Next version\", 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\", launcherHeading: \"Chat\", launcherMaximize: \"Expand the chat\", launcherRestore: \"Shrink the chat\", transcript: \"Transcript\" }",
11797
+ "description": "Default English Locale (Zero-dependency)\nHardcoded to ensure the core works out-of-the-box."
11798
+ }
11799
+ ],
11800
+ "exports": [
11801
+ {
11802
+ "kind": "js",
11803
+ "name": "APARTE_DEFAULT_LOCALE",
11804
+ "declaration": {
11805
+ "name": "APARTE_DEFAULT_LOCALE",
11806
+ "module": "src/config/locale.ts"
11749
11807
  }
11808
+ }
11809
+ ]
11810
+ },
11811
+ {
11812
+ "kind": "javascript-module",
11813
+ "path": "src/config/sanitize.ts",
11814
+ "declarations": [
11815
+ {
11816
+ "kind": "variable",
11817
+ "name": "DANGEROUS_TAGS",
11818
+ "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', ])",
11819
+ "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."
11820
+ },
11821
+ {
11822
+ "kind": "variable",
11823
+ "name": "RESERVED_ATTRIBUTES",
11824
+ "default": "new Set([ 'data-aparte-chat', 'data-aparte-host', 'data-aparte-theme', 'data-aparte-split-pane', 'data-aparte-launcher-close', 'data-aparte-launcher-maximize', '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', ])",
11825
+ "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 and maximize), 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."
11826
+ },
11827
+ {
11828
+ "kind": "variable",
11829
+ "name": "RESERVED_ATTRIBUTE_PREFIXES",
11830
+ "type": {
11831
+ "text": "array"
11832
+ },
11833
+ "default": "['data-aparte-dialog-', 'data-aparte-sidebar-', 'data-checkpoint-']",
11834
+ "description": "Families of reserved attributes: `-open`/`-close`/`-static`, `-toggle`/`-search`, `-action`/`-reason`."
11835
+ },
11836
+ {
11837
+ "kind": "function",
11838
+ "name": "isReservedAttribute",
11839
+ "return": {
11840
+ "type": {
11841
+ "text": "boolean"
11842
+ }
11843
+ },
11844
+ "parameters": [
11845
+ {
11846
+ "name": "name",
11847
+ "type": {
11848
+ "text": "string"
11849
+ }
11850
+ }
11851
+ ],
11852
+ "description": "True when `name` (lower case) is an attribute core reads, so model markup may not carry it."
11750
11853
  },
11751
11854
  {
11752
- "kind": "js",
11753
- "name": "AparteContextLevel",
11754
- "declaration": {
11755
- "name": "AparteContextLevel",
11756
- "module": "./context/index.js"
11757
- }
11855
+ "kind": "function",
11856
+ "name": "isSafeUrl",
11857
+ "return": {
11858
+ "type": {
11859
+ "text": "boolean"
11860
+ }
11861
+ },
11862
+ "parameters": [
11863
+ {
11864
+ "name": "value",
11865
+ "type": {
11866
+ "text": "string"
11867
+ }
11868
+ },
11869
+ {
11870
+ "name": "tag",
11871
+ "type": {
11872
+ "text": "string"
11873
+ }
11874
+ }
11875
+ ]
11758
11876
  },
11759
11877
  {
11760
- "kind": "js",
11761
- "name": "AparteContextThresholdEventDetail",
11762
- "declaration": {
11763
- "name": "AparteContextThresholdEventDetail",
11764
- "module": "./context/index.js"
11765
- }
11878
+ "kind": "function",
11879
+ "name": "readTag",
11880
+ "return": {
11881
+ "type": {
11882
+ "text": "{ tag: string; attrs: Array<[string, string]>; end: number }"
11883
+ }
11884
+ },
11885
+ "parameters": [
11886
+ {
11887
+ "name": "html",
11888
+ "type": {
11889
+ "text": "string"
11890
+ }
11891
+ },
11892
+ {
11893
+ "name": "nameAt",
11894
+ "type": {
11895
+ "text": "number"
11896
+ }
11897
+ }
11898
+ ],
11899
+ "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."
11766
11900
  },
11767
11901
  {
11768
- "kind": "js",
11769
- "name": "AparteScrollRail",
11770
- "declaration": {
11771
- "name": "AparteScrollRail",
11772
- "module": "./scroll-rail/index.js"
11773
- }
11774
- },
11902
+ "kind": "function",
11903
+ "name": "defaultSanitizer",
11904
+ "return": {
11905
+ "type": {
11906
+ "text": "string"
11907
+ }
11908
+ },
11909
+ "parameters": [
11910
+ {
11911
+ "name": "html",
11912
+ "type": {
11913
+ "text": "string"
11914
+ }
11915
+ }
11916
+ ],
11917
+ "description": "The built-in sanitizer. Parses `html` with the platform DOMParser, rebuilds an\nallowlisted tree, and re-serializes it. Falls back to a regex scrub only when\nno DOMParser exists (non-browser runtime)."
11918
+ }
11919
+ ],
11920
+ "exports": [
11775
11921
  {
11776
11922
  "kind": "js",
11777
- "name": "AparteScrollRailJumpDetail",
11923
+ "name": "DANGEROUS_TAGS",
11778
11924
  "declaration": {
11779
- "name": "AparteScrollRailJumpDetail",
11780
- "module": "./scroll-rail/index.js"
11925
+ "name": "DANGEROUS_TAGS",
11926
+ "module": "src/config/sanitize.ts"
11781
11927
  }
11782
11928
  },
11783
11929
  {
11784
11930
  "kind": "js",
11785
- "name": "AparteScrollRailEvery",
11931
+ "name": "RESERVED_ATTRIBUTES",
11786
11932
  "declaration": {
11787
- "name": "AparteScrollRailEvery",
11788
- "module": "./scroll-rail/index.js"
11933
+ "name": "RESERVED_ATTRIBUTES",
11934
+ "module": "src/config/sanitize.ts"
11789
11935
  }
11790
11936
  },
11791
11937
  {
11792
11938
  "kind": "js",
11793
- "name": "AparteSidebar",
11939
+ "name": "RESERVED_ATTRIBUTE_PREFIXES",
11794
11940
  "declaration": {
11795
- "name": "AparteSidebar",
11796
- "module": "./sidebar/index.js"
11941
+ "name": "RESERVED_ATTRIBUTE_PREFIXES",
11942
+ "module": "src/config/sanitize.ts"
11797
11943
  }
11798
11944
  },
11799
11945
  {
11800
11946
  "kind": "js",
11801
- "name": "AparteSidebarToggleDetail",
11947
+ "name": "isReservedAttribute",
11802
11948
  "declaration": {
11803
- "name": "AparteSidebarToggleDetail",
11804
- "module": "./sidebar/index.js"
11949
+ "name": "isReservedAttribute",
11950
+ "module": "src/config/sanitize.ts"
11805
11951
  }
11806
11952
  },
11807
11953
  {
11808
11954
  "kind": "js",
11809
- "name": "AparteSplit",
11955
+ "name": "isSafeUrl",
11810
11956
  "declaration": {
11811
- "name": "AparteSplit",
11812
- "module": "./split/index.js"
11957
+ "name": "isSafeUrl",
11958
+ "module": "src/config/sanitize.ts"
11813
11959
  }
11814
11960
  },
11815
11961
  {
11816
11962
  "kind": "js",
11817
- "name": "AparteSplitResizeDetail",
11963
+ "name": "readTag",
11818
11964
  "declaration": {
11819
- "name": "AparteSplitResizeDetail",
11820
- "module": "./split/index.js"
11965
+ "name": "readTag",
11966
+ "module": "src/config/sanitize.ts"
11821
11967
  }
11822
11968
  },
11823
11969
  {
11824
11970
  "kind": "js",
11825
- "name": "AparteLauncher",
11971
+ "name": "defaultSanitizer",
11826
11972
  "declaration": {
11827
- "name": "AparteLauncher",
11828
- "module": "./launcher/index.js"
11973
+ "name": "defaultSanitizer",
11974
+ "module": "src/config/sanitize.ts"
11829
11975
  }
11830
- },
11976
+ }
11977
+ ]
11978
+ },
11979
+ {
11980
+ "kind": "javascript-module",
11981
+ "path": "src/config/sibling-nav-renderer.ts",
11982
+ "declarations": [],
11983
+ "exports": []
11984
+ },
11985
+ {
11986
+ "kind": "javascript-module",
11987
+ "path": "src/config/status-renderer.ts",
11988
+ "declarations": [],
11989
+ "exports": []
11990
+ },
11991
+ {
11992
+ "kind": "javascript-module",
11993
+ "path": "src/config/tool-table.ts",
11994
+ "declarations": [
11995
+ {
11996
+ "kind": "class",
11997
+ "description": "",
11998
+ "name": "ToolTable",
11999
+ "members": [
12000
+ {
12001
+ "kind": "field",
12002
+ "name": "exact",
12003
+ "privacy": "private",
12004
+ "readonly": true,
12005
+ "default": "new Map<string, T>()"
12006
+ },
12007
+ {
12008
+ "kind": "field",
12009
+ "name": "patterns",
12010
+ "privacy": "private",
12011
+ "readonly": true,
12012
+ "default": "new Map<string, { re: RegExp; value: T }>()"
12013
+ },
12014
+ {
12015
+ "kind": "field",
12016
+ "name": "any",
12017
+ "type": {
12018
+ "text": "T | undefined"
12019
+ },
12020
+ "privacy": "private"
12021
+ },
12022
+ {
12023
+ "kind": "method",
12024
+ "name": "get",
12025
+ "return": {
12026
+ "type": {
12027
+ "text": "T | undefined"
12028
+ }
12029
+ },
12030
+ "parameters": [
12031
+ {
12032
+ "name": "match",
12033
+ "type": {
12034
+ "text": "AparteToolMatcher"
12035
+ }
12036
+ }
12037
+ ],
12038
+ "description": "The value registered under exactly this matcher — not a resolution."
12039
+ },
12040
+ {
12041
+ "kind": "method",
12042
+ "name": "set",
12043
+ "return": {
12044
+ "type": {
12045
+ "text": "void"
12046
+ }
12047
+ },
12048
+ "parameters": [
12049
+ {
12050
+ "name": "match",
12051
+ "type": {
12052
+ "text": "AparteToolMatcher"
12053
+ }
12054
+ },
12055
+ {
12056
+ "name": "value",
12057
+ "type": {
12058
+ "text": "T"
12059
+ }
12060
+ }
12061
+ ]
12062
+ },
12063
+ {
12064
+ "kind": "method",
12065
+ "name": "delete",
12066
+ "return": {
12067
+ "type": {
12068
+ "text": "void"
12069
+ }
12070
+ },
12071
+ "parameters": [
12072
+ {
12073
+ "name": "match",
12074
+ "type": {
12075
+ "text": "AparteToolMatcher"
12076
+ }
12077
+ }
12078
+ ]
12079
+ },
12080
+ {
12081
+ "kind": "method",
12082
+ "name": "resolve",
12083
+ "return": {
12084
+ "type": {
12085
+ "text": "{ value: T; level: ToolMatchLevel } | undefined"
12086
+ }
12087
+ },
12088
+ "parameters": [
12089
+ {
12090
+ "name": "name",
12091
+ "type": {
12092
+ "text": "string"
12093
+ }
12094
+ }
12095
+ ],
12096
+ "description": "The value that applies to a tool named `name`, and how specifically it names it."
12097
+ },
12098
+ {
12099
+ "kind": "method",
12100
+ "name": "values",
12101
+ "return": {
12102
+ "type": {
12103
+ "text": "T[]"
12104
+ }
12105
+ },
12106
+ "description": "Every value registered, whatever its matcher."
12107
+ },
12108
+ {
12109
+ "kind": "method",
12110
+ "name": "clear",
12111
+ "return": {
12112
+ "type": {
12113
+ "text": "void"
12114
+ }
12115
+ }
12116
+ }
12117
+ ]
12118
+ }
12119
+ ],
12120
+ "exports": [
11831
12121
  {
11832
12122
  "kind": "js",
11833
- "name": "AparteLauncherToggleDetail",
12123
+ "name": "ToolTable",
11834
12124
  "declaration": {
11835
- "name": "AparteLauncherToggleDetail",
11836
- "module": "./launcher/index.js"
12125
+ "name": "ToolTable",
12126
+ "module": "src/config/tool-table.ts"
11837
12127
  }
11838
12128
  }
11839
12129
  ]
@@ -20312,6 +20602,14 @@
20312
20602
  "module": "./tools.js"
20313
20603
  }
20314
20604
  },
20605
+ {
20606
+ "kind": "js",
20607
+ "name": "AparteToolRun",
20608
+ "declaration": {
20609
+ "name": "AparteToolRun",
20610
+ "module": "./tools.js"
20611
+ }
20612
+ },
20315
20613
  {
20316
20614
  "kind": "js",
20317
20615
  "name": "AparteToolRenderer",
@@ -20360,6 +20658,14 @@
20360
20658
  "module": "./tools.js"
20361
20659
  }
20362
20660
  },
20661
+ {
20662
+ "kind": "js",
20663
+ "name": "AparteToolLine",
20664
+ "declaration": {
20665
+ "name": "AparteToolLine",
20666
+ "module": "./tools.js"
20667
+ }
20668
+ },
20363
20669
  {
20364
20670
  "kind": "js",
20365
20671
  "name": "AparteToolCallView",
@@ -21528,6 +21834,40 @@
21528
21834
  }
21529
21835
  ]
21530
21836
  },
21837
+ {
21838
+ "kind": "javascript-module",
21839
+ "path": "src/utils/segment-list.ts",
21840
+ "declarations": [
21841
+ {
21842
+ "kind": "function",
21843
+ "name": "createSegmentList",
21844
+ "return": {
21845
+ "type": {
21846
+ "text": "AparteSegmentList"
21847
+ }
21848
+ },
21849
+ "parameters": [
21850
+ {
21851
+ "name": "opts",
21852
+ "type": {
21853
+ "text": "{\n messageId: string;\n segments?: readonly AparteSegment[];\n config?: AparteConfig;\n}"
21854
+ }
21855
+ }
21856
+ ],
21857
+ "description": "A segment list a stream adapter can write into, stamped like a message's.\n\n`messageId` is the id stamped on each segment — the message the list belongs to. With a\n`config`, a segment joining the list takes that config's segment defaults\n(`setSegmentDefaults`), as it would in a chat. `segments` is a list saved earlier, adopted.\n\n`addSegment` and `updateSegment` are the writes; `updateMessage` and `setUsage` do nothing\n(there is no message here), and `dispatchEvent` dispatches nothing: the events of the run\nare the caller's to hear, with `observeRunEvents`."
21858
+ }
21859
+ ],
21860
+ "exports": [
21861
+ {
21862
+ "kind": "js",
21863
+ "name": "createSegmentList",
21864
+ "declaration": {
21865
+ "name": "createSegmentList",
21866
+ "module": "src/utils/segment-list.ts"
21867
+ }
21868
+ }
21869
+ ]
21870
+ },
21531
21871
  {
21532
21872
  "kind": "javascript-module",
21533
21873
  "path": "src/utils/segments.ts",
@@ -21966,6 +22306,30 @@
21966
22306
  "kind": "javascript-module",
21967
22307
  "path": "src/utils/tool-line.ts",
21968
22308
  "declarations": [
22309
+ {
22310
+ "kind": "function",
22311
+ "name": "toolLineOf",
22312
+ "return": {
22313
+ "type": {
22314
+ "text": "AparteToolLine | undefined"
22315
+ }
22316
+ },
22317
+ "parameters": [
22318
+ {
22319
+ "name": "segment",
22320
+ "type": {
22321
+ "text": "AparteToolCallSegment"
22322
+ }
22323
+ },
22324
+ {
22325
+ "name": "config",
22326
+ "type": {
22327
+ "text": "AparteConfig"
22328
+ }
22329
+ }
22330
+ ],
22331
+ "description": "What the config's tool-line provider says about this call (`setToolLineProvider`), or\n`undefined` when there is none, it says nothing, or it throws — the default line then.\nCalled at every draw, update and relabel, never stored: its words follow the locale."
22332
+ },
21969
22333
  {
21970
22334
  "kind": "function",
21971
22335
  "name": "toolNameOf",
@@ -21986,9 +22350,16 @@
21986
22350
  "type": {
21987
22351
  "text": "AparteConfig"
21988
22352
  }
22353
+ },
22354
+ {
22355
+ "name": "line",
22356
+ "default": "toolLineOf(segment, config)",
22357
+ "type": {
22358
+ "text": "AparteToolLine | undefined"
22359
+ }
21989
22360
  }
21990
22361
  ],
21991
- "description": "The name a call goes by: the label its display declares (`registerToolDisplay`), else\nthe identifier — the app's wire format, which core never turns into words on its own.\nA label that throws or says nothing costs the call its label, not its render."
22362
+ "description": "The name a call goes by: the label its display declares (`registerToolDisplay`), else the\nlabel the tool-line provider gives, else the identifier — the app's wire format, which\ncore never turns into words on its own. A label that throws or says nothing costs the\ncall its label, not its render.\n\n`line` is the provider's answer when the caller already asked for it (the row asks once\nper draw); left out, it is asked here."
21992
22363
  },
21993
22364
  {
21994
22365
  "kind": "function",
@@ -22010,12 +22381,100 @@
22010
22381
  "type": {
22011
22382
  "text": "AparteConfig"
22012
22383
  }
22384
+ },
22385
+ {
22386
+ "name": "line",
22387
+ "default": "toolLineOf(segment, config)",
22388
+ "type": {
22389
+ "text": "AparteToolLine | undefined"
22390
+ }
22391
+ }
22392
+ ],
22393
+ "description": "What a call targets, from the summary its display declares, else the target the\ntool-line provider gives — `''` when neither says anything, or when the summary throws:\na summary reads model-chosen input, and a bad one must cost the call its one line, not\nthe bubble its render."
22394
+ },
22395
+ {
22396
+ "kind": "function",
22397
+ "name": "toolTargetPartsOf",
22398
+ "return": {
22399
+ "type": {
22400
+ "text": "{ text: string; isWords: boolean }"
22401
+ }
22402
+ },
22403
+ "parameters": [
22404
+ {
22405
+ "name": "segment",
22406
+ "type": {
22407
+ "text": "AparteToolCallSegment"
22408
+ }
22409
+ },
22410
+ {
22411
+ "name": "config",
22412
+ "type": {
22413
+ "text": "AparteConfig"
22414
+ }
22415
+ },
22416
+ {
22417
+ "name": "line",
22418
+ "default": "toolLineOf(segment, config)",
22419
+ "type": {
22420
+ "text": "AparteToolLine | undefined"
22421
+ }
22422
+ }
22423
+ ],
22424
+ "description": "The target and where it came from: `isWords` when the tool-line provider gave it (a\nsentence for a person — a sub-agent's task), not the app's summary, which is read off the\narguments (a path, a command) and keeps the code face on an agent's row."
22425
+ },
22426
+ {
22427
+ "kind": "function",
22428
+ "name": "toolActivityOf",
22429
+ "return": {
22430
+ "type": {
22431
+ "text": "string"
22432
+ }
22433
+ },
22434
+ "parameters": [
22435
+ {
22436
+ "name": "_segment",
22437
+ "type": {
22438
+ "text": "AparteToolCallSegment"
22439
+ }
22440
+ },
22441
+ {
22442
+ "name": "line",
22443
+ "type": {
22444
+ "text": "AparteToolLine | undefined"
22445
+ }
22446
+ }
22447
+ ],
22448
+ "description": "The row's second line, from the tool-line provider, in every state it gives one: what the\ncall is doing now, and once it is over what it did. Core says nothing there on its own."
22449
+ },
22450
+ {
22451
+ "kind": "function",
22452
+ "name": "toolLineNoteOf",
22453
+ "return": {
22454
+ "type": {
22455
+ "text": "string"
22456
+ }
22457
+ },
22458
+ "parameters": [
22459
+ {
22460
+ "name": "line",
22461
+ "type": {
22462
+ "text": "AparteToolLine | undefined"
22463
+ }
22013
22464
  }
22014
22465
  ],
22015
- "description": "What a call targets, from the summary its display declares — `''` when there is none,\nor when it throws: a summary reads model-chosen input, and a bad one must cost the call\nits one line, not the bubble its render."
22466
+ "description": "The provider's trailing note, in every state."
22016
22467
  }
22017
22468
  ],
22018
22469
  "exports": [
22470
+ {
22471
+ "kind": "js",
22472
+ "name": "toolLineOf",
22473
+ "declaration": {
22474
+ "name": "toolLineOf",
22475
+ "module": "src/utils/tool-line.ts"
22476
+ }
22477
+ },
22019
22478
  {
22020
22479
  "kind": "js",
22021
22480
  "name": "toolNameOf",
@@ -22031,6 +22490,30 @@
22031
22490
  "name": "toolTargetOf",
22032
22491
  "module": "src/utils/tool-line.ts"
22033
22492
  }
22493
+ },
22494
+ {
22495
+ "kind": "js",
22496
+ "name": "toolTargetPartsOf",
22497
+ "declaration": {
22498
+ "name": "toolTargetPartsOf",
22499
+ "module": "src/utils/tool-line.ts"
22500
+ }
22501
+ },
22502
+ {
22503
+ "kind": "js",
22504
+ "name": "toolActivityOf",
22505
+ "declaration": {
22506
+ "name": "toolActivityOf",
22507
+ "module": "src/utils/tool-line.ts"
22508
+ }
22509
+ },
22510
+ {
22511
+ "kind": "js",
22512
+ "name": "toolLineNoteOf",
22513
+ "declaration": {
22514
+ "name": "toolLineNoteOf",
22515
+ "module": "src/utils/tool-line.ts"
22516
+ }
22034
22517
  }
22035
22518
  ]
22036
22519
  },
@@ -23616,7 +24099,7 @@
23616
24099
  }
23617
24100
  }
23618
24101
  ],
23619
- "description": "What a call goes by on screen: the label the app gave it, else its identifier."
24102
+ "description": "What a call goes by on screen — the name its row shows, through the same function."
23620
24103
  },
23621
24104
  {
23622
24105
  "kind": "method",
@@ -29253,6 +29736,13 @@
29253
29736
  },
29254
29737
  "description": "Reflected BY the element while `filter()` holds a query no title matches. Read-only.",
29255
29738
  "name": "data-no-match"
29739
+ },
29740
+ {
29741
+ "type": {
29742
+ "text": "string"
29743
+ },
29744
+ "description": "The id of the chat this list drives, for a page with more than one chat or a list placed beside its chat: a row's click then opens the conversation in that chat alone (`targetId` in `aparte-conversation-select`), and `manage` acts on that chat's conversation manager. Read at every gesture rather than observed. Without it, a click is for every chat of the page, and `manage` finds the manager where the list sits.",
29745
+ "name": "target"
29256
29746
  }
29257
29747
  ],
29258
29748
  "superclass": {
@@ -30287,6 +30777,17 @@
30287
30777
  ],
30288
30778
  "description": "A modal dialog open inside the card, with the key pressed inside it. The browser\ncloses it on Escape — unless the keydown was cancelled, which is what closing the\nlauncher would do: the dialog refused its close request and the card hidden under it.\nAn engine that cannot tell a modal dialog from one opened with `show()` (no `:modal`)\nleaves the key to the dialog, which is the answer that loses nothing."
30289
30779
  },
30780
+ {
30781
+ "kind": "method",
30782
+ "name": "_drawerOpen",
30783
+ "privacy": "private",
30784
+ "return": {
30785
+ "type": {
30786
+ "text": "boolean"
30787
+ }
30788
+ },
30789
+ "description": "A sidebar open as a drawer inside the card: Escape closes it before it closes the chat."
30790
+ },
30290
30791
  {
30291
30792
  "kind": "field",
30292
30793
  "name": "_onKeydown",
@@ -31367,7 +31868,7 @@
31367
31868
  "declarations": [
31368
31869
  {
31369
31870
  "kind": "class",
31370
- "description": "The column beside the chat — conversations, a new-chat button, a search field, an\naccount row — as an element, because it has behaviour: it collapses, it becomes a\ndrawer on a narrow window, and its search field filters the conversation list.\n\nWhat it does NOT own is its content. Children are yours, in the order you want them:\na `.aparte-sidebar__header`, a `.aparte-sidebar__search`, a `.aparte-sidebar__body`\nholding the `<aparte-conversation-list>`, a `.aparte-sidebar__footer`. The\nstylesheet lays those out and draws nothing you did not put there — the recipe\n(`.aparte-sidebar`, in `styles/shell/sidebar.css`) is the look, this element is\nthe three behaviours.\n\n**Collapse.** `collapsed` is an attribute, reflected, so the host can set it, read\nit and persist it. Any element carrying `data-aparte-sidebar-toggle` anywhere on\nthe page toggles the nearest sidebar (or the one whose id the attribute names), so\na hamburger in the header needs no script — and the sidebar keeps `aria-expanded`\nand `aria-controls` on that control in step, whoever changed the state (it gives\nitself an id when the host wrote none). `aparte-sidebar-toggle` fires on every\nchange, whoever caused it.\n\n**Drawer.** Under 48rem of window the sidebar leaves the flow and slides over the\npage (`data-drawer`, set by the element from a media query); open, it draws a\nscrim, moves the focus to its first focusable child, closes on Escape from anywhere\non the page or on a click outside, and hands the focus back to the control that\nopened it. Nothing here is a portal: the drawer is the same element in the same\nplace, positioned fixed, which is all a sidebar needs and what a dialog would not\nget away with. Collapsed — folded as a column or slid off as a drawer — it carries\n`inert` and `aria-hidden`, so nothing invisible keeps a tab stop.\n\n**Search.** An input carrying `data-aparte-sidebar-search` filters the conversation\nlist below it by title as the user types — rows that do not match are hidden, and a\ndate group with nothing left hides with them. Client-side, on the titles the list\nalready has: an index over message bodies is the storage adapter's business.",
31871
+ "description": "The column beside the chat — conversations, a new-chat button, a search field, an\naccount row — as an element, because it has behaviour: it collapses, it becomes a\ndrawer on a narrow window, and its search field filters the conversation list.\n\nWhat it does NOT own is its content. Children are yours, in the order you want them:\na `.aparte-sidebar__header`, a `.aparte-sidebar__search`, a `.aparte-sidebar__body`\nholding the `<aparte-conversation-list>`, a `.aparte-sidebar__footer`. The\nstylesheet lays those out and draws nothing you did not put there — the recipe\n(`.aparte-sidebar`, in `styles/shell/sidebar.css`) is the look, this element is\nthe three behaviours.\n\n**Collapse.** `collapsed` is an attribute, reflected, so the host can set it, read\nit and persist it. Any element carrying `data-aparte-sidebar-toggle` anywhere on\nthe page toggles its sidebar: the one it is in, else the one of the `.aparte-app-shell`\nit is in, else the first of the page (or the one whose id the attribute names). So\na hamburger in the header needs no script — and the sidebar keeps `aria-expanded`\nand `aria-controls` on that control in step, whoever changed the state (it gives\nitself an id when the host wrote none). `aparte-sidebar-toggle` fires on every\nchange, whoever caused it.\n\n**Drawer.** Under 48rem of window the sidebar leaves the flow and slides over the\npage (`data-drawer`, set by the element from a media query); open, it draws a\nscrim, moves the focus to its first focusable child, closes on Escape from anywhere\non the page or on a click outside, and hands the focus back to the control that\nopened it. Nothing here is a portal: the drawer is the same element in the same\nplace, positioned fixed, which is all a sidebar needs and what a dialog would not\nget away with. Collapsed — folded as a column or slid off as a drawer — it carries\n`inert` and `aria-hidden`, so nothing invisible keeps a tab stop.\n\n**In the floating chat.** Inside `<aparte-launcher>` the chat is a card a few hundred pixels\nwide in the widest window, so a sidebar that is the direct child of the card's\n`.aparte-app-shell` follows the chat and not the window: a drawer in the card, held by the\nshell, whose scrim covers the card and not the page; a column again once the chat fills the\nwindow (maximized, unless `maximizable=\"panel\"`, which is still narrow); and closed when the\nchat closes. `breakpoint=\"none\"` keeps it a column there too. Anywhere else in a card it\nfollows the window, as it does on a page.\n\n**Search.** An input carrying `data-aparte-sidebar-search` filters the conversation\nlist below it by title as the user types — rows that do not match are hidden, and a\ndate group with nothing left hides with them. Client-side, on the titles the list\nalready has: an index over message bodies is the storage adapter's business.",
31371
31872
  "name": "AparteSidebar",
31372
31873
  "cssProperties": [
31373
31874
  {
@@ -31464,6 +31965,25 @@
31464
31965
  "default": "false",
31465
31966
  "description": "Raised around `_applyDrawer`'s own writes, so the breakpoint is never read as a host's intent."
31466
31967
  },
31968
+ {
31969
+ "kind": "field",
31970
+ "name": "_launcher",
31971
+ "type": {
31972
+ "text": "Element | null"
31973
+ },
31974
+ "privacy": "private",
31975
+ "default": "null",
31976
+ "description": "The floating chat this sidebar is in, if any: its size decides the drawer, not the window's."
31977
+ },
31978
+ {
31979
+ "kind": "field",
31980
+ "name": "_launcherWatch",
31981
+ "type": {
31982
+ "text": "MutationObserver | null"
31983
+ },
31984
+ "privacy": "private",
31985
+ "default": "null"
31986
+ },
31467
31987
  {
31468
31988
  "kind": "field",
31469
31989
  "name": "_ownHidden",
@@ -31508,7 +32028,7 @@
31508
32028
  "type": {
31509
32029
  "text": "boolean"
31510
32030
  },
31511
- "description": "True while the window is under the breakpoint and the sidebar is a drawer.",
32031
+ "description": "True while the sidebar is a drawer: the window is under the breakpoint, or it is in a floating chat's card.",
31512
32032
  "readonly": true
31513
32033
  },
31514
32034
  {
@@ -31522,6 +32042,50 @@
31522
32042
  },
31523
32043
  "description": "The drawer's media query, from the `breakpoint` attribute: a length (`48rem`, the\ndefault, or `640px`), or `none` for a column that never becomes a drawer — which\na narrow host that has room for it wants, and a documentation frame needs."
31524
32044
  },
32045
+ {
32046
+ "kind": "method",
32047
+ "name": "_wantsDrawer",
32048
+ "privacy": "private",
32049
+ "return": {
32050
+ "type": {
32051
+ "text": "boolean"
32052
+ }
32053
+ },
32054
+ "description": "A drawer under the window's breakpoint, and in the card of a floating chat whatever\nthe window: the card is narrow in the widest one. `breakpoint=\"none\"` is the host's\nword for a column at any width, and it holds in a card too."
32055
+ },
32056
+ {
32057
+ "kind": "method",
32058
+ "name": "_inCard",
32059
+ "privacy": "private",
32060
+ "return": {
32061
+ "type": {
32062
+ "text": "boolean"
32063
+ }
32064
+ },
32065
+ "description": "In a floating chat that does not fill the window: its card, or the panel\n`maximizable=\"panel\"` runs along the window's edge, which is as narrow. Only as the\nchild of the card's shell, which is what holds the drawer there: anywhere else in a\ncard a drawer is fixed to the window, and one forced on a wide window would open over\nthe page the chat floats on."
32066
+ },
32067
+ {
32068
+ "kind": "method",
32069
+ "name": "_followLauncher",
32070
+ "privacy": "private",
32071
+ "return": {
32072
+ "type": {
32073
+ "text": "void"
32074
+ }
32075
+ },
32076
+ "description": "The floating chat opened, closed or changed size. Its size decides the drawer, and a\ndrawer does not outlive the chat it is in: left open under a closed chat it would still\nanswer Escape for the whole page, and stand over the chat when it opens again."
32077
+ },
32078
+ {
32079
+ "kind": "method",
32080
+ "name": "_cardShell",
32081
+ "privacy": "private",
32082
+ "return": {
32083
+ "type": {
32084
+ "text": "Element | null"
32085
+ }
32086
+ },
32087
+ "description": "The shell the scrim covers in a floating chat, when the sidebar is that shell's own\nchild: the stylesheet positions the drawer against it there (`sidebar.css`)."
32088
+ },
31525
32089
  {
31526
32090
  "kind": "method",
31527
32091
  "name": "open",
@@ -31747,13 +32311,13 @@
31747
32311
  "type": {
31748
32312
  "text": "string"
31749
32313
  },
31750
- "description": "The window width under which the sidebar becomes a drawer: a length (default `48rem`), or `none` for a column that never does."
32314
+ "description": "The window width under which the sidebar becomes a drawer: a length (default `48rem`), or `none` for a column that never does, in a floating chat's card included."
31751
32315
  },
31752
32316
  {
31753
32317
  "type": {
31754
32318
  "text": "boolean"
31755
32319
  },
31756
- "description": "Reflected BY the element while the window is narrower than `breakpoint` (48rem unless you set it). Read-only.",
32320
+ "description": "Reflected BY the element while the window is narrower than `breakpoint` (48rem unless you set it), and in the card of an `<aparte-launcher>` when it is the direct child of the card's `.aparte-app-shell`. Read-only.",
31757
32321
  "name": "data-drawer"
31758
32322
  }
31759
32323
  ],
@@ -35118,6 +35682,27 @@
35118
35682
  }
35119
35683
  }
35120
35684
  },
35685
+ {
35686
+ "kind": "method",
35687
+ "name": "_fitsOnceCentred",
35688
+ "privacy": "private",
35689
+ "return": {
35690
+ "type": {
35691
+ "text": "boolean"
35692
+ }
35693
+ },
35694
+ "description": "The transcript will fit once the room the centring spacer under the composer still\nholds (`center-empty`, or a wrapper's auto-centre) is back. That room is 0 once the\nslide is over, and outside those layouts."
35695
+ },
35696
+ {
35697
+ "kind": "method",
35698
+ "name": "_centringRoom",
35699
+ "privacy": "private",
35700
+ "return": {
35701
+ "type": {
35702
+ "text": "number"
35703
+ }
35704
+ }
35705
+ },
35121
35706
  {
35122
35707
  "kind": "method",
35123
35708
  "name": "_gliding",
@@ -36677,7 +37262,7 @@
36677
37262
  "type": {
36678
37263
  "text": "AparteSegmentRenderer<AparteToolCallSegment>"
36679
37264
  },
36680
- "default": "{ type: 'tool_call', render: (segment) => { const name = segment.toolCall?.name ?? 'tool'; /* * A tool waiting for a person is a STATE of the pill now, not a control. * * The Approve / Reject buttons were here, and they were the only decision * surface in the whole library that lived in the transcript. They are at the * composer now, which is where every other request for the user already went — * so this is the ANCHOR: the thing you scroll to, and the thing the panel is * about. Nothing clickable, no role, no tab stop, no pointer (ratified decision * #8: an undeclared affordance is not half-rendered either). * * It also fixes a defect by construction rather than by guarding: a segment * restored from storage used to repaint live buttons wired to a listener that * had gone with the page. * * And removing the branch un-shadows a seam that was said to be missing. It ran * BEFORE the per-tool renderer lookup below, so `registerToolRenderer` could * never draw anything while a tool awaited approval. The lookup is now first, * and a tool renders its own surface at every status. */ if (contextConfig().isToolHidden(name)) return placeholderMarkup(segment); const customRenderer = contextConfig().getToolRenderer(name); if (customRenderer) { // Its stylesheet, here as well as on the live path: this is what runs when a // stored conversation is re-rendered, and nothing replays `tool-start` for // history. Idempotent, keyed by renderer. injectToolRendererStyles(name, customRenderer); // Drawing nothing hides the call, the same element as a display's `hidden` // — it used to bring back the default row here while the live path dropped // the call, so a reload showed what the live chat had hidden. const out = customRenderer.render(segment); if (out instanceof HTMLElement) { drawnBy.set(out, customRenderer); behind.set(out, customRenderer); } return out || placeholderMarkup(segment); } return drawDefault(segment, behindOf(segment)); }, /** * The pill's glyphs, and the label it wears while a person is deciding. * * The two highest-stakes strings in the library — the approval labels — are no * longer here: they are on the panel, which relabels itself. This still matters * though, because the request the pill describes stays open for as long as * somebody takes to decide, which is exactly long enough for a language switch. * * No child node is added or removed, per the relabel contract. */ relabel: (element, segment) => { if (isPlaceholder(element)) return; const cfg = contextConfig(); // A registered renderer owns its markup, so none of the selectors below exist // in it; its own `relabel` — when it declares one — is the only thing that can // re-read the locale for it. const custom = drawerOf(element, cfg.getToolRenderer(segment.toolCall?.name) ?? null); if (custom) { custom.relabel?.(element, segment); return; } const icon = element.querySelector('.aparte-tool-icon'); if (icon) icon.innerHTML = iconOf(segment); setName(element, segment); setTarget(element, segment); setNote(element, segment); // The part labels are locale text too; the parts themselves stay (relabel adds none). const inputLabel = element.querySelector('[data-part=\"input\"] .aparte-tool-part-label'); if (inputLabel) inputLabel.textContent = cfg.t('toolInput'); element.querySelector('[data-part=\"input\"] .aparte-tool-part-body')?.setAttribute('aria-label', cfg.t('toolInput')); const outcome = outcomeOf(segment); const outputLabel = element.querySelector('[data-part=\"output\"] .aparte-tool-part-label'); if (outputLabel && outcome) outputLabel.textContent = cfg.t(outcome.key); if (outcome) element.querySelector('[data-part=\"output\"] .aparte-tool-part-body')?.setAttribute('aria-label', cfg.t(outcome.key)); for (const button of element.querySelectorAll<HTMLElement>('.aparte-tool-copy')) relabelCopyButton(button); // An app's detail may hold words in the reader's language too: its function is // asked again, and what it draws now is written into the nodes already there. const appDetail = appDetailOf(element); if (appDetail) { const behind = behindOf(segment); if (behind.kind === 'body') relabelBody(appDetail, behind.body); } // Through `stateBadge`, which is the whole point of it existing. // // This used to rebuild the badge by hand as the ICON ALONE, so any config change // — `setLocale`, `setIconProvider`, `registerTool`, `reset()`, anything that // calls `_notify()` — permanently deleted the localized state word that // `stateBadge` renders beside it. \"✓ Done\" became \"✓\", and `pending`'s \"Running\" // became empty. Four of five statuses regressed; only `awaiting-approval` // survived, because a second line below re-wrote it. // // Which is exactly what `stateBadge`'s own docblock says it prevents: \"One // function so `render` and `update` cannot disagree\". `relabel` was never folded // in. It is now, so there is no third spelling of the badge to keep in step — // and the approval-waiting special case goes with it, since `stateBadge` already // returns the localized `approvalWaiting` for that status. const statusEl = element.querySelector('.aparte-tool-state'); if (statusEl) statusEl.innerHTML = stateBadge(segment); setQuiet(element, segment); }, /** * Patch in place. NEVER re-render, and never touch `open`. * * Without an `update` the bubble replaces the element wholesale — and a tool call * changes status several times per turn, so a disclosure the reader opened would * slam shut under them every time. The same rule the reasoning block has, for the * same reason: `collapsed` is honoured only when an update explicitly carries it. * * The one case that cannot be patched is a change of ELEMENT: a call that had * neither arguments nor a result rendered as a plain pill, and gaining a result * makes it a `<details>`. That falls back to a rebuild, which costs nothing because * there was no disclosure to lose. */ update: (element, segment) => { const status = segment.status ?? 'pending'; const hidden = contextConfig().isToolHidden(segment.toolCall?.name ?? 'tool'); // A hidden call stays hidden: its placeholder only follows the status. if (hidden && isPlaceholder(element)) { element.setAttribute('data-status', status); return; } /* * Three cases this cannot patch, and each rebuilds instead. * * A registered tool renderer owns the WHOLE markup, so none of the selectors * below exist in it — patching would fail silently and that segment would * simply stop updating. Before this file had an `update` at all, the bubble * rebuilt on every change, which re-invoked their render; a rebuild keeps that * behaviour exactly. * * And a change of ELEMENT: a call with neither arguments nor a result renders * as a plain pill, and gaining either makes it a `<details>`. Nothing is lost * there — there was no disclosure to keep open. * * And a change of what is BEHIND the line, the app's detail for core's parts or * the other way: patched, the parts would be written around the app's markup. * That happens when a display gains or drops `details` while a turn is still * streaming, before the bubble redraws. */ // The renderer that DREW this row, and the one in effect now. They differ when one // was registered or dropped since; the row is then rebuilt by the current one. const custom = hidden ? null : (contextConfig().getToolRenderer(segment.toolCall?.name) ?? null); const drawn = isPlaceholder(element) ? null : drawerOf(element, custom); // A registered renderer that declares `update` owns the patch — a mounted // preview or an opened disclosure in its markup survives the change. One // that does not is rebuilt, as it always was. // Never on a placeholder: it is not the renderer's markup, and a call it drew as // nothing may draw something now — a rebuild asks it. if (drawn && drawn === custom && drawn.update && !isPlaceholder(element)) { drawn.update(element, segment); return; } const rebuild = (out: HTMLElement | string): void => { // A `<template>`, not the bubble's own converter: this file is a renderer // and must not import from the component that consumes it. const tpl = document.createElement('template'); tpl.innerHTML = typeof out === 'string' ? out.trim() : ''; const rebuilt = (typeof out === 'string' ? tpl.content.firstElementChild : out) as HTMLElement | null; if (rebuilt) { // The bubble stamps a renderer's root on its own render; this path must too, // or the next update misses the row and the whole bubble is drawn again. if (!rebuilt.hasAttribute('data-segment-id')) rebuilt.setAttribute('data-segment-id', segment.id); // This row is replaced HERE, not by the bubble: what drew it cleans up first // (the bubble follows the new element and cleans that one up when it goes). toolCallRenderer.cleanup?.(element, segment); element.replaceWith(rebuilt); toolCallRenderer.setup?.(rebuilt, segment); } }; if (custom || drawn || hidden || isPlaceholder(element)) { rebuild(toolCallRenderer.render(segment)); return; } // Asked here, past the hide and the renderer, so an app's `details` is never asked // for a call it cannot draw — and once: a rebuild draws with this same answer. const behind = behindOf(segment); const input = behind.kind === 'parts' ? describeInput(segment) : ''; const outcome = behind.kind === 'parts' ? outcomeOf(segment) : null; const wantsDetail = behind.kind === 'body' || !!input || !!outcome; const holdsAppDetail = !!appDetailOf(element); if (wantsDetail !== (element.tagName === 'DETAILS') || (wantsDetail && (behind.kind === 'body') !== holdsAppDetail)) { rebuild(drawDefault(segment, behind)); return; } element.setAttribute('data-status', status); const badge = element.querySelector('.aparte-tool-state'); if (badge) badge.innerHTML = stateBadge(segment); setQuiet(element, segment); setName(element, segment); setTarget(element, segment); setNote(element, segment); if (behind.kind === 'body') { setBody(element, behind.body); return; } setPart(element, 'input', input, 'toolInput'); setPart(element, 'output', outcome?.text ?? '', outcome?.key ?? 'toolOutput'); highlightParts(element); }, setup: (element, segment) => { // Set up right after `render`, so the renderer in effect now is the one behind the // row: remembered for its updates, its relabels and its cleanup. const hidden = contextConfig().isToolHidden(segment.toolCall?.name ?? 'tool'); const customRenderer = hidden ? undefined : contextConfig().getToolRenderer(segment.toolCall?.name); if (customRenderer) behind.set(element, customRenderer); if (isPlaceholder(element)) return; // The one control of ours is each part's copy button. The approval buttons that // used to be wired here dispatched `aparte-tool-decision`; the decision is // answered at the composer now, and the transcript holds no decision control. wireParts(element); highlightParts(element); if (customRenderer) drawnBy.set(element, customRenderer); customRenderer?.setup?.(element, segment); }, /** * The row leaves for good: the registered renderer that drew it, if any, cleans up. A * cleanup that throws is reported and goes no further: the row is replaced or removed * all the same, and the stream that caused it is not interrupted. */ cleanup: (element, segment) => { behind.delete(element); const custom = drawnBy.get(element); if (!custom) return; drawnBy.delete(element); try { custom.cleanup?.(element, segment); } catch (err) { console.error('[aparte] a tool renderer\\'s cleanup threw', err); } }, // CSS lives in styles/segment/ — see that folder for why a // built-in's rules belong there. `getStyles` stays for a CONSUMER's renderer, which // has no other way onto the page. getStyles: () => '' }"
37265
+ "default": "{ type: 'tool_call', render: (segment) => { const name = segment.toolCall?.name ?? 'tool'; /* * A tool waiting for a person is a STATE of the pill now, not a control. * * The Approve / Reject buttons were here, and they were the only decision * surface in the whole library that lived in the transcript. They are at the * composer now, which is where every other request for the user already went — * so this is the ANCHOR: the thing you scroll to, and the thing the panel is * about. Nothing clickable, no role, no tab stop, no pointer (ratified decision * #8: an undeclared affordance is not half-rendered either). * * It also fixes a defect by construction rather than by guarding: a segment * restored from storage used to repaint live buttons wired to a listener that * had gone with the page. * * And removing the branch un-shadows a seam that was said to be missing. It ran * BEFORE the per-tool renderer lookup below, so `registerToolRenderer` could * never draw anything while a tool awaited approval. The lookup is now first, * and a tool renders its own surface at every status. */ if (contextConfig().isToolHidden(name)) return placeholderMarkup(segment); const customRenderer = contextConfig().getToolRenderer(name); if (customRenderer) { // Its stylesheet, here as well as on the live path: this is what runs when a // stored conversation is re-rendered, and nothing replays `tool-start` for // history. Idempotent, keyed by renderer. injectToolRendererStyles(name, customRenderer); // Drawing nothing hides the call, the same element as a display's `hidden` // — it used to bring back the default row here while the live path dropped // the call, so a reload showed what the live chat had hidden. const out = customRenderer.render(segment); if (out instanceof HTMLElement) { drawnBy.set(out, customRenderer); behind.set(out, customRenderer); } return out || placeholderMarkup(segment); } const line = toolLineOf(segment, contextConfig()); return drawDefault(segment, behindOf(segment, line), line); }, /** * The pill's glyphs, and the label it wears while a person is deciding. * * The two highest-stakes strings in the library — the approval labels — are no * longer here: they are on the panel, which relabels itself. This still matters * though, because the request the pill describes stays open for as long as * somebody takes to decide, which is exactly long enough for a language switch. * * No child node is added or removed, per the relabel contract. */ relabel: (element, segment) => { if (isPlaceholder(element)) return; const cfg = contextConfig(); // A registered renderer owns its markup, so none of the selectors below exist // in it; its own `relabel` — when it declares one — is the only thing that can // re-read the locale for it. const custom = drawerOf(element, cfg.getToolRenderer(segment.toolCall?.name) ?? null); if (custom) { custom.relabel?.(element, segment); return; } // The provider is asked again: its words are in the reader's language too. const line = toolLineOf(segment, cfg); const icon = element.querySelector('.aparte-tool-icon'); if (icon) icon.innerHTML = iconOf(segment); setName(element, segment, line); setTarget(element, segment, line); setActivity(element, segment, line); setNote(element, segment, line); // The part labels are locale text too; the parts themselves stay (relabel adds none). const inputLabel = element.querySelector('[data-part=\"input\"] .aparte-tool-part-label'); if (inputLabel) inputLabel.textContent = cfg.t('toolInput'); element.querySelector('[data-part=\"input\"] .aparte-tool-part-body')?.setAttribute('aria-label', cfg.t('toolInput')); const outcome = outcomeOf(segment); const outputLabel = element.querySelector('[data-part=\"output\"] .aparte-tool-part-label'); if (outputLabel && outcome) outputLabel.textContent = cfg.t(outcome.key); if (outcome) element.querySelector('[data-part=\"output\"] .aparte-tool-part-body')?.setAttribute('aria-label', cfg.t(outcome.key)); for (const button of element.querySelectorAll<HTMLElement>('.aparte-tool-copy')) relabelCopyButton(button); // An app's detail may hold words in the reader's language too: its function is // asked again, and what it draws now is written into the nodes already there. const appDetail = appDetailOf(element); if (appDetail) { const behind = behindOf(segment, line); if (behind.kind === 'body') relabelBody(appDetail, behind.body); } // Through `stateBadge`, which is the whole point of it existing. // // This used to rebuild the badge by hand as the ICON ALONE, so any config change // — `setLocale`, `setIconProvider`, `registerTool`, `reset()`, anything that // calls `_notify()` — permanently deleted the localized state word that // `stateBadge` renders beside it. \"✓ Done\" became \"✓\", and `pending`'s \"Running\" // became empty. Four of five statuses regressed; only `awaiting-approval` // survived, because a second line below re-wrote it. // // Which is exactly what `stateBadge`'s own docblock says it prevents: \"One // function so `render` and `update` cannot disagree\". `relabel` was never folded // in. It is now, so there is no third spelling of the badge to keep in step — // and the approval-waiting special case goes with it, since `stateBadge` already // returns the localized `approvalWaiting` for that status. const statusEl = element.querySelector('.aparte-tool-state'); if (statusEl) statusEl.innerHTML = stateBadge(segment); setQuiet(element, segment); }, /** * Patch in place. NEVER re-render, and never touch `open`. * * Without an `update` the bubble replaces the element wholesale — and a tool call * changes status several times per turn, so a disclosure the reader opened would * slam shut under them every time. The same rule the reasoning block has, for the * same reason: `collapsed` is honoured only when an update explicitly carries it. * * The one case that cannot be patched is a change of ELEMENT: a call that had * neither arguments nor a result rendered as a plain pill, and gaining a result * makes it a `<details>`. That falls back to a rebuild, which costs nothing because * there was no disclosure to lose. */ update: (element, segment) => { const status = segment.status ?? 'pending'; const hidden = contextConfig().isToolHidden(segment.toolCall?.name ?? 'tool'); // A hidden call stays hidden: its placeholder only follows the status. if (hidden && isPlaceholder(element)) { element.setAttribute('data-status', status); return; } /* * Three cases this cannot patch, and each rebuilds instead. * * A registered tool renderer owns the WHOLE markup, so none of the selectors * below exist in it — patching would fail silently and that segment would * simply stop updating. Before this file had an `update` at all, the bubble * rebuilt on every change, which re-invoked their render; a rebuild keeps that * behaviour exactly. * * And a change of ELEMENT: a call with neither arguments nor a result renders * as a plain pill, and gaining either makes it a `<details>`. Nothing is lost * there — there was no disclosure to keep open. * * And a change of what is BEHIND the line, the app's detail for core's parts or * the other way: patched, the parts would be written around the app's markup. * That happens when a display gains or drops `details` while a turn is still * streaming, before the bubble redraws. */ // The renderer that DREW this row, and the one in effect now. They differ when one // was registered or dropped since; the row is then rebuilt by the current one. const custom = hidden ? null : (contextConfig().getToolRenderer(segment.toolCall?.name) ?? null); const drawn = isPlaceholder(element) ? null : drawerOf(element, custom); // A registered renderer that declares `update` owns the patch — a mounted // preview or an opened disclosure in its markup survives the change. One // that does not is rebuilt, as it always was. // Never on a placeholder: it is not the renderer's markup, and a call it drew as // nothing may draw something now — a rebuild asks it. if (drawn && drawn === custom && drawn.update && !isPlaceholder(element)) { drawn.update(element, segment); return; } const rebuild = (out: HTMLElement | string): void => { // A `<template>`, not the bubble's own converter: this file is a renderer // and must not import from the component that consumes it. const tpl = document.createElement('template'); tpl.innerHTML = typeof out === 'string' ? out.trim() : ''; const rebuilt = (typeof out === 'string' ? tpl.content.firstElementChild : out) as HTMLElement | null; if (rebuilt) { // The bubble stamps a renderer's root on its own render; this path must too, // or the next update misses the row and the whole bubble is drawn again. if (!rebuilt.hasAttribute('data-segment-id')) rebuilt.setAttribute('data-segment-id', segment.id); // This row is replaced HERE, not by the bubble: what drew it cleans up first // (the bubble follows the new element and cleans that one up when it goes). toolCallRenderer.cleanup?.(element, segment); element.replaceWith(rebuilt); toolCallRenderer.setup?.(rebuilt, segment); } }; if (custom || drawn || hidden || isPlaceholder(element)) { rebuild(toolCallRenderer.render(segment)); return; } // Asked here, past the hide and the renderer, so an app's `details` is never asked // for a call it cannot draw — and once: a rebuild draws with this same answer. const line = toolLineOf(segment, contextConfig()); const behind = behindOf(segment, line); const input = behind.kind === 'parts' ? describeInput(segment) : ''; const outcome = behind.kind === 'parts' ? outcomeOf(segment) : null; const wantsDetail = behind.kind === 'body' || !!input || !!outcome; const holdsAppDetail = !!appDetailOf(element); if (wantsDetail !== (element.tagName === 'DETAILS') || (wantsDetail && (behind.kind === 'body') !== holdsAppDetail)) { rebuild(drawDefault(segment, behind, line)); return; } element.setAttribute('data-status', status); const badge = element.querySelector('.aparte-tool-state'); if (badge) badge.innerHTML = stateBadge(segment); setQuiet(element, segment); setName(element, segment, line); setTarget(element, segment, line); setActivity(element, segment, line); setNote(element, segment, line); if (behind.kind === 'body') { setBody(element, behind.body); return; } setPart(element, 'input', input, 'toolInput'); setPart(element, 'output', outcome?.text ?? '', outcome?.key ?? 'toolOutput'); highlightParts(element); }, setup: (element, segment) => { // Set up right after `render`, so the renderer in effect now is the one behind the // row: remembered for its updates, its relabels and its cleanup. const hidden = contextConfig().isToolHidden(segment.toolCall?.name ?? 'tool'); const customRenderer = hidden ? undefined : contextConfig().getToolRenderer(segment.toolCall?.name); if (customRenderer) behind.set(element, customRenderer); if (isPlaceholder(element)) return; // The one control of ours is each part's copy button. The approval buttons that // used to be wired here dispatched `aparte-tool-decision`; the decision is // answered at the composer now, and the transcript holds no decision control. wireParts(element); highlightParts(element); if (customRenderer) drawnBy.set(element, customRenderer); customRenderer?.setup?.(element, segment); }, /** * The row leaves for good: the registered renderer that drew it, if any, cleans up. A * cleanup that throws is reported and goes no further: the row is replaced or removed * all the same, and the stream that caused it is not interrupted. */ cleanup: (element, segment) => { behind.delete(element); const custom = drawnBy.get(element); if (!custom) return; drawnBy.delete(element); try { custom.cleanup?.(element, segment); } catch (err) { console.error('[aparte] a tool renderer\\'s cleanup threw', err); } }, // CSS lives in styles/segment/ — see that folder for why a // built-in's rules belong there. `getStyles` stays for a CONSUMER's renderer, which // has no other way onto the page. getStyles: () => '' }"
36681
37266
  }
36682
37267
  ],
36683
37268
  "exports": [