@genesislcap/ai-assistant 15.26.0 → 15.27.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.
- package/dist/ai-assistant.api.json +150 -7
- package/dist/ai-assistant.d.ts +82 -99
- package/dist/chat-driver.cjs +460 -373
- package/dist/chat-driver.cjs.map +4 -4
- package/dist/chat-driver.mjs +460 -373
- package/dist/chat-driver.mjs.map +4 -4
- package/dist/custom-elements.json +682 -202
- package/dist/dts/components/chat-driver/chat-driver.d.ts +28 -200
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/interaction-controller.d.ts +99 -0
- package/dist/dts/components/chat-driver/interaction-controller.d.ts.map +1 -0
- package/dist/dts/components/chat-driver/turn-recorder.d.ts +191 -0
- package/dist/dts/components/chat-driver/turn-recorder.d.ts.map +1 -0
- package/dist/dts/components/settings-modal/settings-modal.template.d.ts +20 -0
- package/dist/dts/components/settings-modal/settings-modal.template.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +32 -1
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts +19 -0
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/dts/state/ai-assistant-slice.d.ts +7 -1
- package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-persistence-provider.d.ts +5 -0
- package/dist/dts/state/persistence/session-persistence-provider.d.ts.map +1 -1
- package/dist/dts/state/session-store.d.ts +1 -0
- package/dist/dts/state/session-store.d.ts.map +1 -1
- package/dist/dts/utils/format-message-timestamp.d.ts +77 -0
- package/dist/dts/utils/format-message-timestamp.d.ts.map +1 -0
- package/dist/dts/utils/resolve-preference-baseline.d.ts +18 -1
- package/dist/dts/utils/resolve-preference-baseline.d.ts.map +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +68 -404
- package/dist/esm/components/chat-driver/interaction-controller.js +235 -0
- package/dist/esm/components/chat-driver/turn-recorder.js +206 -0
- package/dist/esm/components/settings-modal/settings-modal.template.js +53 -2
- package/dist/esm/main/main.js +80 -17
- package/dist/esm/main/main.styles.js +75 -0
- package/dist/esm/main/main.template.js +43 -2
- package/dist/esm/state/ai-assistant-slice.js +5 -0
- package/dist/esm/utils/format-message-timestamp.js +126 -0
- package/dist/esm/utils/resolve-preference-baseline.js +54 -2
- package/package.json +16 -16
- package/sandbox/README.md +45 -2
- package/sandbox/sandbox.ts +95 -3
|
@@ -1775,6 +1775,12 @@
|
|
|
1775
1775
|
"kind": "javascript-module",
|
|
1776
1776
|
"path": "src/main/main.template.ts",
|
|
1777
1777
|
"declarations": [
|
|
1778
|
+
{
|
|
1779
|
+
"kind": "variable",
|
|
1780
|
+
"name": "messageTimestampTemplate",
|
|
1781
|
+
"default": "html<ChatMessage, FoundationAiAssistant>`\n <time\n class=\"message-timestamp\"\n part=\"message-timestamp\"\n datetime=\"${(m) => messageTimestampDateTime(m.timestamp)}\"\n >\n <span aria-hidden=\"true\">\n ${(m, c) => formatMessageTimestamp(m.timestamp, c.parent.timestampClock)}\n </span>\n <span class=\"visually-hidden\">${(m) => formatAbsoluteTimestamp(m.timestamp)}</span>\n </time>\n`",
|
|
1782
|
+
"description": "The timestamp shown beside the sender name (GENC-1257).\n\nTwo strings, not one. A screen reader announces a `<time>` element's TEXT — it has no\nimplicit ARIA role, and the `datetime` attribute is never surfaced to the user — so the\nrelative text is hidden from assistive tech and paired with a visually-hidden absolute\nstring. Otherwise AT would hear \"5 minutes ago\" with nothing to anchor it, and in\n`'hover'` mode would hear it for a timestamp sighted users never asked to see.\n`datetime` stays because it is correct HTML and useful to tooling, not for a11y.\n\nOnly the VISUAL reveal is hover-gated, in CSS — see `.message-timestamp`. `opacity: 0`\nleaves the element in the accessibility tree, so AT gets a time in both visible modes;\n`'off'` is the only mode that removes it.\n\nReads `timestampClock` rather than `Date.now()` so every row shares one invalidatable\nclock and a tick re-evaluates them all; see `FoundationAiAssistant.timestampClock`."
|
|
1783
|
+
},
|
|
1778
1784
|
{
|
|
1779
1785
|
"kind": "function",
|
|
1780
1786
|
"name": "FoundationAiAssistantTemplate",
|
|
@@ -1794,6 +1800,14 @@
|
|
|
1794
1800
|
}
|
|
1795
1801
|
],
|
|
1796
1802
|
"exports": [
|
|
1803
|
+
{
|
|
1804
|
+
"kind": "js",
|
|
1805
|
+
"name": "messageTimestampTemplate",
|
|
1806
|
+
"declaration": {
|
|
1807
|
+
"name": "messageTimestampTemplate",
|
|
1808
|
+
"module": "src/main/main.template.ts"
|
|
1809
|
+
}
|
|
1810
|
+
},
|
|
1797
1811
|
{
|
|
1798
1812
|
"kind": "js",
|
|
1799
1813
|
"name": "FoundationAiAssistantTemplate",
|
|
@@ -2232,6 +2246,42 @@
|
|
|
2232
2246
|
},
|
|
2233
2247
|
"description": "Current user-facing toggle state for agent switch indicator visibility."
|
|
2234
2248
|
},
|
|
2249
|
+
{
|
|
2250
|
+
"kind": "field",
|
|
2251
|
+
"name": "timestampDisplay",
|
|
2252
|
+
"type": {
|
|
2253
|
+
"text": "TimestampDisplay"
|
|
2254
|
+
},
|
|
2255
|
+
"description": "When each message shows its timestamp — `'off'`, `'hover'` (default) or `'always'`.\n\nFalls back to `DEFAULT_TIMESTAMP_DISPLAY` rather than `'off'` when there is no\nstore yet: this preference defaults ON, so the pre-store render must match the state\nthe baseline is about to resolve to, or timestamps would visibly pop in on connect."
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
"kind": "field",
|
|
2259
|
+
"name": "timestampClock",
|
|
2260
|
+
"type": {
|
|
2261
|
+
"text": "number"
|
|
2262
|
+
},
|
|
2263
|
+
"description": "Epoch ms the transcript's relative timestamps are measured against.\n\nA relative label is only correct at the instant it renders: FAST evaluates the\nbinding once, and an idle conversation never re-renders, so \"2 minutes ago\" would\nstill read \"2 minutes ago\" an hour later. Making the formatter read this observable\ninstead of `Date.now()` gives every row one shared, invalidatable clock — a tick\nre-evaluates them all."
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
"kind": "field",
|
|
2267
|
+
"name": "_timestampClockTimer",
|
|
2268
|
+
"type": {
|
|
2269
|
+
"text": "ReturnType<typeof setInterval> | undefined"
|
|
2270
|
+
},
|
|
2271
|
+
"privacy": "private",
|
|
2272
|
+
"description": "Handle for the `TIMESTAMP_CLOCK_INTERVAL_MS` ticker; undefined while stopped."
|
|
2273
|
+
},
|
|
2274
|
+
{
|
|
2275
|
+
"kind": "method",
|
|
2276
|
+
"name": "syncTimestampClock",
|
|
2277
|
+
"privacy": "private",
|
|
2278
|
+
"return": {
|
|
2279
|
+
"type": {
|
|
2280
|
+
"text": "void"
|
|
2281
|
+
}
|
|
2282
|
+
},
|
|
2283
|
+
"description": "Start or stop the timestamp clock to match the current mode and connection state.\n\nIdempotent, and safe to call from either lifecycle end — it is driven from\n`connectedCallback`, `disconnectedCallback` and the `timestampDisplay` setter, which\ncan fire in any order. Nothing runs while the mode is `'off'` (no binding reads the\nclock) or while disconnected (a timer outliving its element is a leak, and a\npopped-out view disconnects without the session ending)."
|
|
2284
|
+
},
|
|
2235
2285
|
{
|
|
2236
2286
|
"kind": "field",
|
|
2237
2287
|
"name": "enabledAnimations",
|
|
@@ -5848,18 +5898,6 @@
|
|
|
5848
5898
|
"declarations": [],
|
|
5849
5899
|
"exports": []
|
|
5850
5900
|
},
|
|
5851
|
-
{
|
|
5852
|
-
"kind": "javascript-module",
|
|
5853
|
-
"path": "src/types/ai-chat-widget.ts",
|
|
5854
|
-
"declarations": [],
|
|
5855
|
-
"exports": []
|
|
5856
|
-
},
|
|
5857
|
-
{
|
|
5858
|
-
"kind": "javascript-module",
|
|
5859
|
-
"path": "src/types/interaction-context.ts",
|
|
5860
|
-
"declarations": [],
|
|
5861
|
-
"exports": []
|
|
5862
|
-
},
|
|
5863
5901
|
{
|
|
5864
5902
|
"kind": "javascript-module",
|
|
5865
5903
|
"path": "src/utils/agents-key.ts",
|
|
@@ -6785,6 +6823,119 @@
|
|
|
6785
6823
|
"declarations": [],
|
|
6786
6824
|
"exports": []
|
|
6787
6825
|
},
|
|
6826
|
+
{
|
|
6827
|
+
"kind": "javascript-module",
|
|
6828
|
+
"path": "src/utils/format-message-timestamp.ts",
|
|
6829
|
+
"declarations": [
|
|
6830
|
+
{
|
|
6831
|
+
"kind": "variable",
|
|
6832
|
+
"name": "ABSOLUTE_FORMAT_OPTIONS",
|
|
6833
|
+
"type": {
|
|
6834
|
+
"text": "Intl.DateTimeFormatOptions"
|
|
6835
|
+
},
|
|
6836
|
+
"default": "{\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n hourCycle: 'h23',\n}",
|
|
6837
|
+
"description": "Field selection for the absolute tier.\n\nExported so tests can build their expectation from the same options rather than from a\nliteral: every field below renders differently per locale and time zone, so asserting\n`\"Sep\"` or `\"10\"` only asserts the machine the test happened to run on.\n\nLocale is left undefined so it follows the user's, and `hourCycle: 'h23'` pins the clock\nto 24-hour regardless — a locale-chosen 12-hour clock would add \"am\"/\"pm\" and widen the\nstring next to the sender name."
|
|
6838
|
+
},
|
|
6839
|
+
{
|
|
6840
|
+
"kind": "function",
|
|
6841
|
+
"name": "formatMessageTimestamp",
|
|
6842
|
+
"return": {
|
|
6843
|
+
"type": {
|
|
6844
|
+
"text": ""
|
|
6845
|
+
}
|
|
6846
|
+
},
|
|
6847
|
+
"parameters": [
|
|
6848
|
+
{
|
|
6849
|
+
"name": "iso",
|
|
6850
|
+
"type": {
|
|
6851
|
+
"text": "string | undefined"
|
|
6852
|
+
},
|
|
6853
|
+
"description": "ISO-8601 timestamp, as stamped by the driver on append."
|
|
6854
|
+
},
|
|
6855
|
+
{
|
|
6856
|
+
"name": "now",
|
|
6857
|
+
"type": {
|
|
6858
|
+
"text": "number"
|
|
6859
|
+
},
|
|
6860
|
+
"description": "Current epoch ms. Passed in rather than read, so tests pin the clock."
|
|
6861
|
+
}
|
|
6862
|
+
],
|
|
6863
|
+
"description": "Display text for a message timestamp, per the tiers above.\n\nA timestamp slightly in the future (clock skew between a server-stamped message and the\nbrowser) reads `Now` rather than a negative count — \"-3 minutes ago\" looks broken and\ntells the user nothing. That indulgence is bounded at an hour: beyond it the stamp is\nnot skew but bad data (a machine with a badly wrong clock, a hand-edited session), and\nshowing `Now` forever on every message would hide that. Past the bound it falls through\nto the absolute tier, which shows the user what the data actually says."
|
|
6864
|
+
},
|
|
6865
|
+
{
|
|
6866
|
+
"kind": "function",
|
|
6867
|
+
"name": "formatAbsoluteTimestamp",
|
|
6868
|
+
"return": {
|
|
6869
|
+
"type": {
|
|
6870
|
+
"text": ""
|
|
6871
|
+
}
|
|
6872
|
+
},
|
|
6873
|
+
"parameters": [
|
|
6874
|
+
{
|
|
6875
|
+
"name": "iso",
|
|
6876
|
+
"type": {
|
|
6877
|
+
"text": "string | undefined"
|
|
6878
|
+
},
|
|
6879
|
+
"description": "ISO-8601 timestamp, as stamped by the driver on append."
|
|
6880
|
+
}
|
|
6881
|
+
],
|
|
6882
|
+
"description": "The absolute rendering of a stamp, whatever its age — the accessible text behind a\nmessage timestamp.\n\nExists because the visible text is relative and a screen reader announces the element's\nTEXT, not its `datetime` attribute: `<time>` carries no implicit ARIA role, so the\nmachine-readable value reaches tooling and nobody else. The template pairs this with\n`aria-hidden` on the relative string so assistive tech hears one unambiguous time\ninstead of \"5 minutes ago\" with no anchor."
|
|
6883
|
+
},
|
|
6884
|
+
{
|
|
6885
|
+
"kind": "function",
|
|
6886
|
+
"name": "messageTimestampDateTime",
|
|
6887
|
+
"return": {
|
|
6888
|
+
"type": {
|
|
6889
|
+
"text": "string | null"
|
|
6890
|
+
}
|
|
6891
|
+
},
|
|
6892
|
+
"parameters": [
|
|
6893
|
+
{
|
|
6894
|
+
"name": "iso",
|
|
6895
|
+
"type": {
|
|
6896
|
+
"text": "string | undefined"
|
|
6897
|
+
},
|
|
6898
|
+
"description": "ISO-8601 timestamp, as stamped by the driver on append."
|
|
6899
|
+
}
|
|
6900
|
+
],
|
|
6901
|
+
"description": "The `datetime` attribute value for the rendered `<time>` element — the raw ISO string,\nwhich is what the HTML spec wants and what date-aware tooling reads. It is NOT an\naccessibility affordance: screen readers announce the element's text content instead.\n\nReturns `null`, not `''`, for a missing or unparseable stamp: FAST removes an attribute\nonly for `null`/`undefined` (see `DOM.setAttribute`), so an empty string would emit\n`datetime=\"\"`, which is invalid per spec and flagged by HTML validators."
|
|
6902
|
+
}
|
|
6903
|
+
],
|
|
6904
|
+
"exports": [
|
|
6905
|
+
{
|
|
6906
|
+
"kind": "js",
|
|
6907
|
+
"name": "ABSOLUTE_FORMAT_OPTIONS",
|
|
6908
|
+
"declaration": {
|
|
6909
|
+
"name": "ABSOLUTE_FORMAT_OPTIONS",
|
|
6910
|
+
"module": "src/utils/format-message-timestamp.ts"
|
|
6911
|
+
}
|
|
6912
|
+
},
|
|
6913
|
+
{
|
|
6914
|
+
"kind": "js",
|
|
6915
|
+
"name": "formatMessageTimestamp",
|
|
6916
|
+
"declaration": {
|
|
6917
|
+
"name": "formatMessageTimestamp",
|
|
6918
|
+
"module": "src/utils/format-message-timestamp.ts"
|
|
6919
|
+
}
|
|
6920
|
+
},
|
|
6921
|
+
{
|
|
6922
|
+
"kind": "js",
|
|
6923
|
+
"name": "formatAbsoluteTimestamp",
|
|
6924
|
+
"declaration": {
|
|
6925
|
+
"name": "formatAbsoluteTimestamp",
|
|
6926
|
+
"module": "src/utils/format-message-timestamp.ts"
|
|
6927
|
+
}
|
|
6928
|
+
},
|
|
6929
|
+
{
|
|
6930
|
+
"kind": "js",
|
|
6931
|
+
"name": "messageTimestampDateTime",
|
|
6932
|
+
"declaration": {
|
|
6933
|
+
"name": "messageTimestampDateTime",
|
|
6934
|
+
"module": "src/utils/format-message-timestamp.ts"
|
|
6935
|
+
}
|
|
6936
|
+
}
|
|
6937
|
+
]
|
|
6938
|
+
},
|
|
6788
6939
|
{
|
|
6789
6940
|
"kind": "javascript-module",
|
|
6790
6941
|
"path": "src/utils/format-usd.ts",
|
|
@@ -7407,8 +7558,27 @@
|
|
|
7407
7558
|
{
|
|
7408
7559
|
"kind": "javascript-module",
|
|
7409
7560
|
"path": "src/utils/resolve-preference-baseline.ts",
|
|
7410
|
-
"declarations": [
|
|
7411
|
-
|
|
7561
|
+
"declarations": [
|
|
7562
|
+
{
|
|
7563
|
+
"kind": "variable",
|
|
7564
|
+
"name": "DEFAULT_TIMESTAMP_DISPLAY",
|
|
7565
|
+
"type": {
|
|
7566
|
+
"text": "TimestampDisplay"
|
|
7567
|
+
},
|
|
7568
|
+
"default": "'hover'",
|
|
7569
|
+
"description": "The mode used when neither the host config nor stored prefs name a valid one."
|
|
7570
|
+
}
|
|
7571
|
+
],
|
|
7572
|
+
"exports": [
|
|
7573
|
+
{
|
|
7574
|
+
"kind": "js",
|
|
7575
|
+
"name": "DEFAULT_TIMESTAMP_DISPLAY",
|
|
7576
|
+
"declaration": {
|
|
7577
|
+
"name": "DEFAULT_TIMESTAMP_DISPLAY",
|
|
7578
|
+
"module": "src/utils/resolve-preference-baseline.ts"
|
|
7579
|
+
}
|
|
7580
|
+
}
|
|
7581
|
+
]
|
|
7412
7582
|
},
|
|
7413
7583
|
{
|
|
7414
7584
|
"kind": "javascript-module",
|
|
@@ -7738,6 +7908,18 @@
|
|
|
7738
7908
|
"declarations": [],
|
|
7739
7909
|
"exports": []
|
|
7740
7910
|
},
|
|
7911
|
+
{
|
|
7912
|
+
"kind": "javascript-module",
|
|
7913
|
+
"path": "src/types/ai-chat-widget.ts",
|
|
7914
|
+
"declarations": [],
|
|
7915
|
+
"exports": []
|
|
7916
|
+
},
|
|
7917
|
+
{
|
|
7918
|
+
"kind": "javascript-module",
|
|
7919
|
+
"path": "src/types/interaction-context.ts",
|
|
7920
|
+
"declarations": [],
|
|
7921
|
+
"exports": []
|
|
7922
|
+
},
|
|
7741
7923
|
{
|
|
7742
7924
|
"kind": "javascript-module",
|
|
7743
7925
|
"path": "src/components/activity-halo/activity-halo.ts",
|
|
@@ -9095,16 +9277,14 @@
|
|
|
9095
9277
|
},
|
|
9096
9278
|
{
|
|
9097
9279
|
"kind": "field",
|
|
9098
|
-
"name": "
|
|
9099
|
-
"
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
{
|
|
9103
|
-
"kind": "field",
|
|
9104
|
-
"name": "interactionContexts",
|
|
9280
|
+
"name": "interactions",
|
|
9281
|
+
"type": {
|
|
9282
|
+
"text": "InteractionController"
|
|
9283
|
+
},
|
|
9105
9284
|
"privacy": "private",
|
|
9106
|
-
"
|
|
9107
|
-
"description": "
|
|
9285
|
+
"readonly": true,
|
|
9286
|
+
"description": "Custom UI interactions: the pending call, its live context, and any host to delegate to.",
|
|
9287
|
+
"default": "new InteractionController({\n sessionKey,\n activityBus,\n activeAgentName: () => this.activeAgentName,\n appendToHistory: (message) => this.appendToHistory(message),\n patchInteractionMessage: (interactionId, patch) =>\n this.patchInteractionMessage(interactionId, patch),\n notifyHistoryUpdated: () => this.notifyHistoryUpdated(),\n emit: (event) => this.dispatchEvent(event),\n foldDiagnostics: (interactionId, harvested) =>\n this.turnRecorder.foldDiagnostics(interactionId, harvested),\n })"
|
|
9108
9288
|
},
|
|
9109
9289
|
{
|
|
9110
9290
|
"kind": "field",
|
|
@@ -9194,15 +9374,6 @@
|
|
|
9194
9374
|
},
|
|
9195
9375
|
"privacy": "private"
|
|
9196
9376
|
},
|
|
9197
|
-
{
|
|
9198
|
-
"kind": "field",
|
|
9199
|
-
"name": "hostInteractionRequester",
|
|
9200
|
-
"type": {
|
|
9201
|
-
"text": "<T>(\n componentName: string,\n data: any,\n options?: InteractionRequestOptions,\n ) => Promise<T> | undefined"
|
|
9202
|
-
},
|
|
9203
|
-
"privacy": "private",
|
|
9204
|
-
"description": "When set, `requestInteraction` delegates to this callback instead of using\nthis driver's own pending map. Wired by `invokeSubAgent` so a sub-agent's\nwidget renders in — and resolves through — the parent (ultimately the\nroot) driver, where the main UI is listening."
|
|
9205
|
-
},
|
|
9206
9377
|
{
|
|
9207
9378
|
"kind": "field",
|
|
9208
9379
|
"name": "providerHistoryTransform",
|
|
@@ -9362,63 +9533,14 @@
|
|
|
9362
9533
|
},
|
|
9363
9534
|
{
|
|
9364
9535
|
"kind": "field",
|
|
9365
|
-
"name": "
|
|
9366
|
-
"type": {
|
|
9367
|
-
"text": "TurnSnapshot[]"
|
|
9368
|
-
},
|
|
9369
|
-
"privacy": "private",
|
|
9370
|
-
"default": "[]",
|
|
9371
|
-
"description": "Ring buffer of per-LLM-call snapshots. Cap is configurable via\n`chatConfig.agent.maxTurnSnapshots`; older entries drop off as new ones\narrive. See TurnSnapshot for the captured shape."
|
|
9372
|
-
},
|
|
9373
|
-
{
|
|
9374
|
-
"kind": "field",
|
|
9375
|
-
"name": "externalDiagnostics",
|
|
9376
|
-
"type": {
|
|
9377
|
-
"text": "DiagnosticEntry[]"
|
|
9378
|
-
},
|
|
9379
|
-
"privacy": "private",
|
|
9380
|
-
"readonly": true,
|
|
9381
|
-
"default": "[]",
|
|
9382
|
-
"description": "`turn` + `message` diagnostic-log entries harvested from an out-of-band source (a resolved\ninteraction whose widget returned `InteractionResult.diagnostics` — e.g. a server-side\nChatDriver's debug log). `event` entries are NOT kept here — they're folded into the session's\nmeta-event registry via `mergeMetaEvents` (see `resolveInteraction`) so they inherit fresh host\nindices, and reach the log through `getMetaEvents`. Append-only; the host folds these into its\ndebug log alongside this driver's own timeline. Not cleared here — it lives with the driver\ninstance, like `turnSnapshots`, so a new chat (fresh driver) starts empty while a compaction\n(same instance) keeps it. (GENC-1461.)"
|
|
9383
|
-
},
|
|
9384
|
-
{
|
|
9385
|
-
"kind": "field",
|
|
9386
|
-
"name": "externalDiagnosticsBatches",
|
|
9387
|
-
"type": {
|
|
9388
|
-
"text": "number"
|
|
9389
|
-
},
|
|
9390
|
-
"privacy": "private",
|
|
9391
|
-
"default": "0",
|
|
9392
|
-
"description": "Monotonic count of external-diagnostics batches harvested this driver-lifetime. Namespaces each\nbatch's re-keyed `turn` entries so distinct server generations in one chat session can't collide\non `turnIndex` in the forward-capture persister (which dedups turns by that key). (GENC-1461.)"
|
|
9393
|
-
},
|
|
9394
|
-
{
|
|
9395
|
-
"kind": "field",
|
|
9396
|
-
"name": "globalTurnIndex",
|
|
9397
|
-
"type": {
|
|
9398
|
-
"text": "number"
|
|
9399
|
-
},
|
|
9400
|
-
"privacy": "private",
|
|
9401
|
-
"default": "0",
|
|
9402
|
-
"description": "Monotonic counter that survives agent swaps — useful for cross-referencing with history."
|
|
9403
|
-
},
|
|
9404
|
-
{
|
|
9405
|
-
"kind": "field",
|
|
9406
|
-
"name": "debugSnapshotter",
|
|
9407
|
-
"type": {
|
|
9408
|
-
"text": "() => unknown | undefined"
|
|
9409
|
-
},
|
|
9410
|
-
"privacy": "private",
|
|
9411
|
-
"description": "Captured from `applyAgent` so we don't store the whole `AgentConfig`."
|
|
9412
|
-
},
|
|
9413
|
-
{
|
|
9414
|
-
"kind": "field",
|
|
9415
|
-
"name": "maxTurnSnapshots",
|
|
9536
|
+
"name": "turnRecorder",
|
|
9416
9537
|
"type": {
|
|
9417
|
-
"text": "
|
|
9538
|
+
"text": "TurnRecorder"
|
|
9418
9539
|
},
|
|
9419
9540
|
"privacy": "private",
|
|
9420
9541
|
"readonly": true,
|
|
9421
|
-
"
|
|
9542
|
+
"description": "Per-turn snapshots, forwarded sub-agent snapshots, and harvested external diagnostics —\neverything the exported debug log draws from this driver.",
|
|
9543
|
+
"default": "new TurnRecorder(sessionKey, maxTurnSnapshots)"
|
|
9422
9544
|
},
|
|
9423
9545
|
{
|
|
9424
9546
|
"kind": "field",
|
|
@@ -9727,7 +9849,7 @@
|
|
|
9727
9849
|
"text": "Promise<void>"
|
|
9728
9850
|
}
|
|
9729
9851
|
},
|
|
9730
|
-
"description": "Tear down the driver: aborts the lifecycle signal so any in-flight provider\nrequest (and prompt/tool factories awaiting it) cancels instead of running\non to completion or the transport timeout. Called by the host on driver\nswap and by `OrchestratingDriver.dispose()`. Idempotent.\n\nDeliberately does NOT settle
|
|
9852
|
+
"description": "Tear down the driver: aborts the lifecycle signal so any in-flight provider\nrequest (and prompt/tool factories awaiting it) cancels instead of running\non to completion or the transport timeout. Called by the host on driver\nswap and by `OrchestratingDriver.dispose()`. Idempotent.\n\nDeliberately does NOT settle pending interactions here: dispose is never\nreached while one is pending. The only host-level dispose is the agent-swap\nrebuild, which is guarded by `isBusy()` — a pending interaction keeps the\ntool loop suspended (`busy === true`), so the swap is deferred until the\nwidget resolves. Sub-agent child disposes always have an empty pending map\n(widgets park on the parent via `setHostInteractionRequester`). A pending\ninteraction is instead settled by `resolveInteraction` (user response or\ntimeout), which also stamps history and reverts the chat-input override."
|
|
9731
9853
|
},
|
|
9732
9854
|
{
|
|
9733
9855
|
"kind": "method",
|
|
@@ -10174,7 +10296,7 @@
|
|
|
10174
10296
|
"text": "ReadonlyArray<TurnSnapshot>"
|
|
10175
10297
|
}
|
|
10176
10298
|
},
|
|
10177
|
-
"description": "Return the per-turn snapshots captured so far. Used by the host's debug\nlog exporter to show what the LLM saw on each turn — system prompt, tool\nsurface, and agent-supplied state (e.g. a machine snapshot).\n\nRing-buffered at `
|
|
10299
|
+
"description": "Return the per-turn snapshots captured so far. Used by the host's debug\nlog exporter to show what the LLM saw on each turn — system prompt, tool\nsurface, and agent-supplied state (e.g. a machine snapshot).\n\nRing-buffered at `maxTurnSnapshots`; older entries are dropped."
|
|
10178
10300
|
},
|
|
10179
10301
|
{
|
|
10180
10302
|
"kind": "method",
|
|
@@ -10184,12 +10306,29 @@
|
|
|
10184
10306
|
"text": "ReadonlyArray<DiagnosticEntry>"
|
|
10185
10307
|
}
|
|
10186
10308
|
},
|
|
10187
|
-
"description": "The `turn` + `message` diagnostic-log entries harvested from resolved interactions'\n`InteractionResult.diagnostics` (e.g. a server-side ChatDriver's collated debug log). The host\nconcatenates these into its own debug log so `downloadDebugLog`/the persisted diagnostics stream\ninclude external-engine logs; `event` entries are excluded here because they're merged into the\nsession's meta-event registry instead
|
|
10309
|
+
"description": "The `turn` + `message` diagnostic-log entries harvested from resolved interactions'\n`InteractionResult.diagnostics` (e.g. a server-side ChatDriver's collated debug log). The host\nconcatenates these into its own debug log so `downloadDebugLog`/the persisted diagnostics stream\ninclude external-engine logs; `event` entries are excluded here because they're merged into the\nsession's meta-event registry instead and reach the log via `getMetaEvents`. Opaque,\nchronologically sorted by the host at assemble time. (GENC-1461.)"
|
|
10188
10310
|
},
|
|
10189
10311
|
{
|
|
10190
|
-
"kind": "
|
|
10191
|
-
"name": "
|
|
10312
|
+
"kind": "field",
|
|
10313
|
+
"name": "contextGuard",
|
|
10314
|
+
"type": {
|
|
10315
|
+
"text": "ContextGuardPolicy | undefined"
|
|
10316
|
+
},
|
|
10317
|
+
"privacy": "private",
|
|
10318
|
+
"description": "Mid-loop context guard policy (GENC-1567). `undefined` disables the guard.\n\nCarries a MARGIN rather than an absolute threshold, and the difference is the\nwhole point: the threshold depends on the window of whichever provider the\nnext call resolves to, which the driver learns during the call and the host\ncannot know until afterwards. The host owns the policy; the driver applies it\nagainst the model actually being addressed."
|
|
10319
|
+
},
|
|
10320
|
+
{
|
|
10321
|
+
"kind": "field",
|
|
10322
|
+
"name": "lastResolvedContextLimit",
|
|
10323
|
+
"type": {
|
|
10324
|
+
"text": "number | undefined"
|
|
10325
|
+
},
|
|
10192
10326
|
"privacy": "private",
|
|
10327
|
+
"description": "Window of the provider the current call resolved to, if it reports one."
|
|
10328
|
+
},
|
|
10329
|
+
{
|
|
10330
|
+
"kind": "method",
|
|
10331
|
+
"name": "setContextGuard",
|
|
10193
10332
|
"return": {
|
|
10194
10333
|
"type": {
|
|
10195
10334
|
"text": "void"
|
|
@@ -10197,109 +10336,36 @@
|
|
|
10197
10336
|
},
|
|
10198
10337
|
"parameters": [
|
|
10199
10338
|
{
|
|
10200
|
-
"name": "
|
|
10339
|
+
"name": "policy",
|
|
10340
|
+
"optional": true,
|
|
10201
10341
|
"type": {
|
|
10202
|
-
"text": "
|
|
10342
|
+
"text": "ContextGuardPolicy"
|
|
10203
10343
|
}
|
|
10204
10344
|
}
|
|
10205
10345
|
],
|
|
10206
|
-
"description": "
|
|
10346
|
+
"description": "Set the mid-loop context guard. Its margin is deliberately far smaller than\nthe reserve that blocks NEW turns: that reserve exists so an accepted turn can\nspend it, and a guard set at the same line would kill every turn that used\nthe headroom it was given."
|
|
10207
10347
|
},
|
|
10208
10348
|
{
|
|
10209
10349
|
"kind": "method",
|
|
10210
|
-
"name": "
|
|
10350
|
+
"name": "contextExhausted",
|
|
10211
10351
|
"privacy": "private",
|
|
10212
10352
|
"return": {
|
|
10213
10353
|
"type": {
|
|
10214
|
-
"text": "
|
|
10354
|
+
"text": "{ estimated: number; threshold: number } | undefined"
|
|
10215
10355
|
}
|
|
10216
10356
|
},
|
|
10217
10357
|
"parameters": [
|
|
10218
10358
|
{
|
|
10219
|
-
"name": "
|
|
10220
|
-
"type": {
|
|
10221
|
-
"text": "string | undefined"
|
|
10222
|
-
}
|
|
10223
|
-
},
|
|
10224
|
-
{
|
|
10225
|
-
"name": "temperature",
|
|
10359
|
+
"name": "requestHistory",
|
|
10226
10360
|
"type": {
|
|
10227
|
-
"text": "
|
|
10361
|
+
"text": "readonly ChatMessage[]"
|
|
10228
10362
|
}
|
|
10229
10363
|
},
|
|
10230
10364
|
{
|
|
10231
|
-
"name": "
|
|
10365
|
+
"name": "pendingInput",
|
|
10366
|
+
"optional": true,
|
|
10232
10367
|
"type": {
|
|
10233
|
-
"text": "
|
|
10234
|
-
}
|
|
10235
|
-
},
|
|
10236
|
-
{
|
|
10237
|
-
"name": "tailContext",
|
|
10238
|
-
"type": {
|
|
10239
|
-
"text": "string | undefined"
|
|
10240
|
-
}
|
|
10241
|
-
}
|
|
10242
|
-
],
|
|
10243
|
-
"description": "Push one snapshot to the ring buffer. Called inside `runToolLoop` just\nbefore each LLM call — that's the latest point where the prompt, tool\nsurface, and agent state line up with what the model is about to see.\n\nReturns the pushed object so the caller can back-fill what only the response\nknows (`usage`). Mutating it after the fact is safe whether or not the ring\nbuffer has since evicted it — an evicted snapshot is simply no longer exported."
|
|
10244
|
-
},
|
|
10245
|
-
{
|
|
10246
|
-
"kind": "field",
|
|
10247
|
-
"name": "contextGuard",
|
|
10248
|
-
"type": {
|
|
10249
|
-
"text": "ContextGuardPolicy | undefined"
|
|
10250
|
-
},
|
|
10251
|
-
"privacy": "private",
|
|
10252
|
-
"description": "Mid-loop context guard policy (GENC-1567). `undefined` disables the guard.\n\nCarries a MARGIN rather than an absolute threshold, and the difference is the\nwhole point: the threshold depends on the window of whichever provider the\nnext call resolves to, which the driver learns during the call and the host\ncannot know until afterwards. The host owns the policy; the driver applies it\nagainst the model actually being addressed."
|
|
10253
|
-
},
|
|
10254
|
-
{
|
|
10255
|
-
"kind": "field",
|
|
10256
|
-
"name": "lastResolvedContextLimit",
|
|
10257
|
-
"type": {
|
|
10258
|
-
"text": "number | undefined"
|
|
10259
|
-
},
|
|
10260
|
-
"privacy": "private",
|
|
10261
|
-
"description": "Window of the provider the current call resolved to, if it reports one."
|
|
10262
|
-
},
|
|
10263
|
-
{
|
|
10264
|
-
"kind": "method",
|
|
10265
|
-
"name": "setContextGuard",
|
|
10266
|
-
"return": {
|
|
10267
|
-
"type": {
|
|
10268
|
-
"text": "void"
|
|
10269
|
-
}
|
|
10270
|
-
},
|
|
10271
|
-
"parameters": [
|
|
10272
|
-
{
|
|
10273
|
-
"name": "policy",
|
|
10274
|
-
"optional": true,
|
|
10275
|
-
"type": {
|
|
10276
|
-
"text": "ContextGuardPolicy"
|
|
10277
|
-
}
|
|
10278
|
-
}
|
|
10279
|
-
],
|
|
10280
|
-
"description": "Set the mid-loop context guard. Its margin is deliberately far smaller than\nthe reserve that blocks NEW turns: that reserve exists so an accepted turn can\nspend it, and a guard set at the same line would kill every turn that used\nthe headroom it was given."
|
|
10281
|
-
},
|
|
10282
|
-
{
|
|
10283
|
-
"kind": "method",
|
|
10284
|
-
"name": "contextExhausted",
|
|
10285
|
-
"privacy": "private",
|
|
10286
|
-
"return": {
|
|
10287
|
-
"type": {
|
|
10288
|
-
"text": "{ estimated: number; threshold: number } | undefined"
|
|
10289
|
-
}
|
|
10290
|
-
},
|
|
10291
|
-
"parameters": [
|
|
10292
|
-
{
|
|
10293
|
-
"name": "requestHistory",
|
|
10294
|
-
"type": {
|
|
10295
|
-
"text": "readonly ChatMessage[]"
|
|
10296
|
-
}
|
|
10297
|
-
},
|
|
10298
|
-
{
|
|
10299
|
-
"name": "pendingInput",
|
|
10300
|
-
"optional": true,
|
|
10301
|
-
"type": {
|
|
10302
|
-
"text": "{ content: string; attachments?: ChatAttachment[] }"
|
|
10368
|
+
"text": "{ content: string; attachments?: ChatAttachment[] }"
|
|
10303
10369
|
}
|
|
10304
10370
|
}
|
|
10305
10371
|
],
|
|
@@ -10321,7 +10387,8 @@
|
|
|
10321
10387
|
"text": "(history: ChatMessage[]) => ChatMessage[]"
|
|
10322
10388
|
}
|
|
10323
10389
|
}
|
|
10324
|
-
]
|
|
10390
|
+
],
|
|
10391
|
+
"description": "Optional transform applied to conversation history immediately before each LLM request.\nCleared when `undefined`. Does not alter stored history."
|
|
10325
10392
|
},
|
|
10326
10393
|
{
|
|
10327
10394
|
"kind": "method",
|
|
@@ -10553,7 +10620,7 @@
|
|
|
10553
10620
|
"description": "a positive delta in USD. Non-finite, zero and negative values are ignored."
|
|
10554
10621
|
}
|
|
10555
10622
|
],
|
|
10556
|
-
"description": "Add external (non-LLM) spend to an interaction's message AFTER it has resolved
|
|
10623
|
+
"description": "Add external (non-LLM) spend to an interaction's message AFTER it has resolved — for a widget\nthat resolves early so the assistant stops waiting, then keeps doing paid work on the user's\nbehalf. `InteractionController.recordExternalCost` explains why the resolution path cannot\ncarry this.\n\nAdditive by design: the caller reports a DELTA, not a running total, so repeated calls sum.\n\nDeliberately does NOT require the interaction to be pending, does not resurrect it, and has no\nloading/turn side effects — this is bookkeeping about a turn that already happened."
|
|
10557
10624
|
},
|
|
10558
10625
|
{
|
|
10559
10626
|
"kind": "method",
|
|
@@ -10601,22 +10668,28 @@
|
|
|
10601
10668
|
},
|
|
10602
10669
|
{
|
|
10603
10670
|
"kind": "method",
|
|
10604
|
-
"name": "
|
|
10671
|
+
"name": "patchInteractionMessage",
|
|
10605
10672
|
"privacy": "private",
|
|
10606
10673
|
"return": {
|
|
10607
10674
|
"type": {
|
|
10608
|
-
"text": "
|
|
10675
|
+
"text": "boolean"
|
|
10609
10676
|
}
|
|
10610
10677
|
},
|
|
10611
10678
|
"parameters": [
|
|
10612
10679
|
{
|
|
10613
|
-
"name": "
|
|
10680
|
+
"name": "interactionId",
|
|
10614
10681
|
"type": {
|
|
10615
10682
|
"text": "string"
|
|
10616
10683
|
}
|
|
10684
|
+
},
|
|
10685
|
+
{
|
|
10686
|
+
"name": "patch",
|
|
10687
|
+
"type": {
|
|
10688
|
+
"text": "(message: ChatMessage) => ChatMessage"
|
|
10689
|
+
}
|
|
10617
10690
|
}
|
|
10618
10691
|
],
|
|
10619
|
-
"description": "
|
|
10692
|
+
"description": "Replace the history message owning `interactionId`. `false` when it is no longer in history.\nDoes not announce the change — the interaction paths differ on whether they should."
|
|
10620
10693
|
},
|
|
10621
10694
|
{
|
|
10622
10695
|
"kind": "method",
|
|
@@ -10798,6 +10871,17 @@
|
|
|
10798
10871
|
}
|
|
10799
10872
|
}
|
|
10800
10873
|
]
|
|
10874
|
+
},
|
|
10875
|
+
{
|
|
10876
|
+
"kind": "method",
|
|
10877
|
+
"name": "notifyHistoryUpdated",
|
|
10878
|
+
"privacy": "private",
|
|
10879
|
+
"return": {
|
|
10880
|
+
"type": {
|
|
10881
|
+
"text": "void"
|
|
10882
|
+
}
|
|
10883
|
+
},
|
|
10884
|
+
"description": "Announce the current history to the host."
|
|
10801
10885
|
}
|
|
10802
10886
|
],
|
|
10803
10887
|
"events": [
|
|
@@ -10808,43 +10892,25 @@
|
|
|
10808
10892
|
}
|
|
10809
10893
|
},
|
|
10810
10894
|
{
|
|
10811
|
-
"name": "
|
|
10812
|
-
"type": {
|
|
10813
|
-
"text": "CustomEvent"
|
|
10814
|
-
}
|
|
10815
|
-
},
|
|
10816
|
-
{
|
|
10817
|
-
"name": "external-cost-recorded",
|
|
10818
|
-
"type": {
|
|
10819
|
-
"text": "CustomEvent"
|
|
10820
|
-
}
|
|
10821
|
-
},
|
|
10822
|
-
{
|
|
10823
|
-
"name": "history-updated",
|
|
10824
|
-
"type": {
|
|
10825
|
-
"text": "CustomEvent"
|
|
10826
|
-
}
|
|
10827
|
-
},
|
|
10828
|
-
{
|
|
10829
|
-
"name": "interaction-stop",
|
|
10895
|
+
"name": "sub-agent-history-updated",
|
|
10830
10896
|
"type": {
|
|
10831
10897
|
"text": "CustomEvent"
|
|
10832
10898
|
}
|
|
10833
10899
|
},
|
|
10834
10900
|
{
|
|
10835
|
-
"name": "sub-agent-
|
|
10901
|
+
"name": "sub-agent-start",
|
|
10836
10902
|
"type": {
|
|
10837
10903
|
"text": "CustomEvent"
|
|
10838
10904
|
}
|
|
10839
10905
|
},
|
|
10840
10906
|
{
|
|
10841
|
-
"name": "sub-agent-
|
|
10907
|
+
"name": "sub-agent-stop",
|
|
10842
10908
|
"type": {
|
|
10843
10909
|
"text": "CustomEvent"
|
|
10844
10910
|
}
|
|
10845
10911
|
},
|
|
10846
10912
|
{
|
|
10847
|
-
"name": "
|
|
10913
|
+
"name": "history-updated",
|
|
10848
10914
|
"type": {
|
|
10849
10915
|
"text": "CustomEvent"
|
|
10850
10916
|
}
|
|
@@ -10881,6 +10947,14 @@
|
|
|
10881
10947
|
"module": "./chat-driver.constants"
|
|
10882
10948
|
}
|
|
10883
10949
|
},
|
|
10950
|
+
{
|
|
10951
|
+
"kind": "js",
|
|
10952
|
+
"name": "TurnSnapshot",
|
|
10953
|
+
"declaration": {
|
|
10954
|
+
"name": "TurnSnapshot",
|
|
10955
|
+
"module": "./turn-recorder"
|
|
10956
|
+
}
|
|
10957
|
+
},
|
|
10884
10958
|
{
|
|
10885
10959
|
"kind": "js",
|
|
10886
10960
|
"name": "ChatDriver",
|
|
@@ -11166,6 +11240,196 @@
|
|
|
11166
11240
|
}
|
|
11167
11241
|
]
|
|
11168
11242
|
},
|
|
11243
|
+
{
|
|
11244
|
+
"kind": "javascript-module",
|
|
11245
|
+
"path": "src/components/chat-driver/interaction-controller.ts",
|
|
11246
|
+
"declarations": [
|
|
11247
|
+
{
|
|
11248
|
+
"kind": "class",
|
|
11249
|
+
"description": "Custom UI interactions: parking a tool handler on a widget, and settling it when the user (or a\ntimeout) answers.\n\nOwns the pending call and its live context, which are created and destroyed together. Everything\nelse it needs is the driver's history and event target, reached through `InteractionDeps`.",
|
|
11250
|
+
"name": "InteractionController",
|
|
11251
|
+
"members": [
|
|
11252
|
+
{
|
|
11253
|
+
"kind": "field",
|
|
11254
|
+
"name": "pending",
|
|
11255
|
+
"privacy": "private",
|
|
11256
|
+
"readonly": true,
|
|
11257
|
+
"default": "new Map<string, PendingInteraction>()"
|
|
11258
|
+
},
|
|
11259
|
+
{
|
|
11260
|
+
"kind": "field",
|
|
11261
|
+
"name": "contexts",
|
|
11262
|
+
"privacy": "private",
|
|
11263
|
+
"readonly": true,
|
|
11264
|
+
"default": "new Map<string, InteractionContextHandle>()",
|
|
11265
|
+
"description": "Live per-interaction contexts (GENC-1390), keyed by interactionId. Created in `request`\nalongside the pending entry, disposed + removed in `resolve`. Non-serialisable (sockets,\ntimers, subscriber sets), so they live here — not on the DOM, not in the persisted store — and\ntherefore survive the element remounts (layout reflow/drag, transcript re-render) that this\nfeature exists to make harmless. At most one is live at a time (see the\none-interaction-at-a-time guard in `request`)."
|
|
11266
|
+
},
|
|
11267
|
+
{
|
|
11268
|
+
"kind": "field",
|
|
11269
|
+
"name": "hostRequester",
|
|
11270
|
+
"type": {
|
|
11271
|
+
"text": "<T>(\n componentName: string,\n data: any,\n options?: InteractionRequestOptions,\n ) => Promise<T> | undefined"
|
|
11272
|
+
},
|
|
11273
|
+
"privacy": "private",
|
|
11274
|
+
"description": "When set, `request` delegates to this callback instead of using this controller's own pending\nmap. Wired by `invokeSubAgent` so a sub-agent's widget renders in — and resolves through — the\nparent (ultimately the root) driver, where the main UI is listening."
|
|
11275
|
+
},
|
|
11276
|
+
{
|
|
11277
|
+
"kind": "method",
|
|
11278
|
+
"name": "setHostRequester",
|
|
11279
|
+
"return": {
|
|
11280
|
+
"type": {
|
|
11281
|
+
"text": "void"
|
|
11282
|
+
}
|
|
11283
|
+
},
|
|
11284
|
+
"parameters": [
|
|
11285
|
+
{
|
|
11286
|
+
"name": "fn",
|
|
11287
|
+
"type": {
|
|
11288
|
+
"text": "<T>(componentName: string, data: any, options?: InteractionRequestOptions) => Promise<T>"
|
|
11289
|
+
}
|
|
11290
|
+
}
|
|
11291
|
+
],
|
|
11292
|
+
"description": "See `ChatDriver.setHostInteractionRequester`."
|
|
11293
|
+
},
|
|
11294
|
+
{
|
|
11295
|
+
"kind": "method",
|
|
11296
|
+
"name": "request",
|
|
11297
|
+
"return": {
|
|
11298
|
+
"type": {
|
|
11299
|
+
"text": "Promise<T>"
|
|
11300
|
+
}
|
|
11301
|
+
},
|
|
11302
|
+
"parameters": [
|
|
11303
|
+
{
|
|
11304
|
+
"name": "componentName",
|
|
11305
|
+
"type": {
|
|
11306
|
+
"text": "string"
|
|
11307
|
+
}
|
|
11308
|
+
},
|
|
11309
|
+
{
|
|
11310
|
+
"name": "data",
|
|
11311
|
+
"type": {
|
|
11312
|
+
"text": "any"
|
|
11313
|
+
}
|
|
11314
|
+
},
|
|
11315
|
+
{
|
|
11316
|
+
"name": "options",
|
|
11317
|
+
"optional": true,
|
|
11318
|
+
"type": {
|
|
11319
|
+
"text": "InteractionRequestOptions"
|
|
11320
|
+
}
|
|
11321
|
+
}
|
|
11322
|
+
],
|
|
11323
|
+
"description": "See `ChatDriver.requestInteraction`."
|
|
11324
|
+
},
|
|
11325
|
+
{
|
|
11326
|
+
"kind": "method",
|
|
11327
|
+
"name": "resolve",
|
|
11328
|
+
"return": {
|
|
11329
|
+
"type": {
|
|
11330
|
+
"text": "void"
|
|
11331
|
+
}
|
|
11332
|
+
},
|
|
11333
|
+
"parameters": [
|
|
11334
|
+
{
|
|
11335
|
+
"name": "interactionId",
|
|
11336
|
+
"type": {
|
|
11337
|
+
"text": "string"
|
|
11338
|
+
}
|
|
11339
|
+
},
|
|
11340
|
+
{
|
|
11341
|
+
"name": "result",
|
|
11342
|
+
"type": {
|
|
11343
|
+
"text": "any"
|
|
11344
|
+
}
|
|
11345
|
+
}
|
|
11346
|
+
],
|
|
11347
|
+
"description": "See `ChatDriver.resolveInteraction`. Warns and returns when the id is unknown — a widget can\nreport twice, and the second report has nothing left to settle."
|
|
11348
|
+
},
|
|
11349
|
+
{
|
|
11350
|
+
"kind": "method",
|
|
11351
|
+
"name": "recordExternalCost",
|
|
11352
|
+
"return": {
|
|
11353
|
+
"type": {
|
|
11354
|
+
"text": "boolean"
|
|
11355
|
+
}
|
|
11356
|
+
},
|
|
11357
|
+
"parameters": [
|
|
11358
|
+
{
|
|
11359
|
+
"name": "interactionId",
|
|
11360
|
+
"type": {
|
|
11361
|
+
"text": "string"
|
|
11362
|
+
}
|
|
11363
|
+
},
|
|
11364
|
+
{
|
|
11365
|
+
"name": "costUsd",
|
|
11366
|
+
"type": {
|
|
11367
|
+
"text": "number"
|
|
11368
|
+
}
|
|
11369
|
+
}
|
|
11370
|
+
],
|
|
11371
|
+
"description": "See `ChatDriver.recordExternalCost`.\n\n**Why this exists separately from `resolve`.** A widget's spend reaches the session total only\nthrough `InteractionResult.costUsd`, which is read exactly once — `resolve` does its whole job\nagainst a live pending entry and then deletes it. That is correct for the resolution itself,\nbut it assumes a widget stops costing money when it resolves, and several deliberately do not:\na widget that resolves EARLY so the assistant stops waiting (options shown, a preview\nrendered) may stay interactive for minutes afterwards and do more paid work on the user's\nbehalf. Re-emitting `interaction-completed` does not help — with the interaction gone from the\nmap the call is a silent no-op — so that spend had nowhere to go and was simply missing from\nthe figure shown to the user.\n\nTouches only `externalCostUsd`: the recorded `interaction.resolved` payload is left exactly as\nthe resolution wrote it, because this is not a second resolution and must not read like one."
|
|
11372
|
+
},
|
|
11373
|
+
{
|
|
11374
|
+
"kind": "method",
|
|
11375
|
+
"name": "context",
|
|
11376
|
+
"return": {
|
|
11377
|
+
"type": {
|
|
11378
|
+
"text": "InteractionContext | undefined"
|
|
11379
|
+
}
|
|
11380
|
+
},
|
|
11381
|
+
"parameters": [
|
|
11382
|
+
{
|
|
11383
|
+
"name": "interactionId",
|
|
11384
|
+
"type": {
|
|
11385
|
+
"text": "string"
|
|
11386
|
+
}
|
|
11387
|
+
}
|
|
11388
|
+
],
|
|
11389
|
+
"description": "See `ChatDriver.getInteractionContext`."
|
|
11390
|
+
},
|
|
11391
|
+
{
|
|
11392
|
+
"kind": "method",
|
|
11393
|
+
"name": "cancelAll",
|
|
11394
|
+
"return": {
|
|
11395
|
+
"type": {
|
|
11396
|
+
"text": "void"
|
|
11397
|
+
}
|
|
11398
|
+
},
|
|
11399
|
+
"parameters": [
|
|
11400
|
+
{
|
|
11401
|
+
"name": "message",
|
|
11402
|
+
"type": {
|
|
11403
|
+
"text": "string"
|
|
11404
|
+
}
|
|
11405
|
+
}
|
|
11406
|
+
],
|
|
11407
|
+
"description": "Resolve every in-flight interaction with a `'timeout'` result, closing its\nwidget read-only. Used when a sub-agent that owns the open widget times out:\nthe widget is parked in *this* driver's map (interactions resolve on the\nhost, not the child), so cancelling it here unblocks the sub-agent handler\nawaiting it. The \"one interaction at a time\" invariant means there is at\nmost one."
|
|
11408
|
+
},
|
|
11409
|
+
{
|
|
11410
|
+
"kind": "method",
|
|
11411
|
+
"name": "disposeContexts",
|
|
11412
|
+
"return": {
|
|
11413
|
+
"type": {
|
|
11414
|
+
"text": "void"
|
|
11415
|
+
}
|
|
11416
|
+
},
|
|
11417
|
+
"description": "Drop any live interaction contexts on driver teardown. Normally empty (a context is created\nand destroyed with its pending interaction, and dispose is not reached mid-interaction);\ndisposed defensively so a stray context can never leak an open socket/timer."
|
|
11418
|
+
}
|
|
11419
|
+
]
|
|
11420
|
+
}
|
|
11421
|
+
],
|
|
11422
|
+
"exports": [
|
|
11423
|
+
{
|
|
11424
|
+
"kind": "js",
|
|
11425
|
+
"name": "InteractionController",
|
|
11426
|
+
"declaration": {
|
|
11427
|
+
"name": "InteractionController",
|
|
11428
|
+
"module": "src/components/chat-driver/interaction-controller.ts"
|
|
11429
|
+
}
|
|
11430
|
+
}
|
|
11431
|
+
]
|
|
11432
|
+
},
|
|
11169
11433
|
{
|
|
11170
11434
|
"kind": "javascript-module",
|
|
11171
11435
|
"path": "src/components/chat-driver/turn-failures.ts",
|
|
@@ -11258,6 +11522,190 @@
|
|
|
11258
11522
|
}
|
|
11259
11523
|
]
|
|
11260
11524
|
},
|
|
11525
|
+
{
|
|
11526
|
+
"kind": "javascript-module",
|
|
11527
|
+
"path": "src/components/chat-driver/turn-recorder.ts",
|
|
11528
|
+
"declarations": [
|
|
11529
|
+
{
|
|
11530
|
+
"kind": "class",
|
|
11531
|
+
"description": "Everything the exported debug log draws from one driver: its own per-LLM-call snapshots, the\nones forwarded up from sub-agents, and the diagnostics harvested from resolved interactions.\n\nAll three feed the same timeline and all three are keyed in this driver's turn space, which is\nwhy they share an owner — a forwarded child turn and a harvested server turn are both re-labelled\nagainst the counter kept here.",
|
|
11532
|
+
"name": "TurnRecorder",
|
|
11533
|
+
"members": [
|
|
11534
|
+
{
|
|
11535
|
+
"kind": "field",
|
|
11536
|
+
"name": "buffer",
|
|
11537
|
+
"type": {
|
|
11538
|
+
"text": "TurnSnapshot[]"
|
|
11539
|
+
},
|
|
11540
|
+
"privacy": "private",
|
|
11541
|
+
"readonly": true,
|
|
11542
|
+
"default": "[]",
|
|
11543
|
+
"description": "Ring buffer of per-LLM-call snapshots, capped at `maxSnapshots`; older entries drop off as\nnew ones arrive."
|
|
11544
|
+
},
|
|
11545
|
+
{
|
|
11546
|
+
"kind": "field",
|
|
11547
|
+
"name": "turnIndex",
|
|
11548
|
+
"type": {
|
|
11549
|
+
"text": "number"
|
|
11550
|
+
},
|
|
11551
|
+
"privacy": "private",
|
|
11552
|
+
"default": "0",
|
|
11553
|
+
"description": "Monotonic counter that survives agent swaps — useful for cross-referencing with history."
|
|
11554
|
+
},
|
|
11555
|
+
{
|
|
11556
|
+
"kind": "field",
|
|
11557
|
+
"name": "externalEntries",
|
|
11558
|
+
"type": {
|
|
11559
|
+
"text": "DiagnosticEntry[]"
|
|
11560
|
+
},
|
|
11561
|
+
"privacy": "private",
|
|
11562
|
+
"readonly": true,
|
|
11563
|
+
"default": "[]",
|
|
11564
|
+
"description": "`turn` + `message` diagnostic entries harvested from an out-of-band source. `event` entries\nare NOT kept here — they are folded into the session's meta-event registry so they inherit\nfresh host indices, and reach the log through `getMetaEvents`. Append-only, and never cleared:\nit lives with the recorder, so a new chat (fresh driver) starts empty while a compaction (same\ninstance) keeps it. (GENC-1461.)"
|
|
11565
|
+
},
|
|
11566
|
+
{
|
|
11567
|
+
"kind": "field",
|
|
11568
|
+
"name": "externalBatches",
|
|
11569
|
+
"type": {
|
|
11570
|
+
"text": "number"
|
|
11571
|
+
},
|
|
11572
|
+
"privacy": "private",
|
|
11573
|
+
"default": "0",
|
|
11574
|
+
"description": "Monotonic count of external-diagnostics batches folded this driver-lifetime. Namespaces each\nbatch's re-keyed `turn` entries so distinct server generations in one chat session can't\ncollide on `turnIndex` in the forward-capture persister (which dedups turns by that key)."
|
|
11575
|
+
},
|
|
11576
|
+
{
|
|
11577
|
+
"kind": "field",
|
|
11578
|
+
"name": "snapshotter",
|
|
11579
|
+
"type": {
|
|
11580
|
+
"text": "() => unknown | undefined"
|
|
11581
|
+
},
|
|
11582
|
+
"privacy": "private",
|
|
11583
|
+
"description": "The active agent's `getDebugSnapshot`, captured on install so the whole config isn't held."
|
|
11584
|
+
},
|
|
11585
|
+
{
|
|
11586
|
+
"kind": "method",
|
|
11587
|
+
"name": "setSnapshotter",
|
|
11588
|
+
"return": {
|
|
11589
|
+
"type": {
|
|
11590
|
+
"text": "void"
|
|
11591
|
+
}
|
|
11592
|
+
},
|
|
11593
|
+
"parameters": [
|
|
11594
|
+
{
|
|
11595
|
+
"name": "snapshotter",
|
|
11596
|
+
"optional": true,
|
|
11597
|
+
"type": {
|
|
11598
|
+
"text": "() => unknown"
|
|
11599
|
+
}
|
|
11600
|
+
}
|
|
11601
|
+
],
|
|
11602
|
+
"description": "Point at the incoming agent's `getDebugSnapshot`, or clear it when the agent supplies none."
|
|
11603
|
+
},
|
|
11604
|
+
{
|
|
11605
|
+
"kind": "method",
|
|
11606
|
+
"name": "snapshots",
|
|
11607
|
+
"return": {
|
|
11608
|
+
"type": {
|
|
11609
|
+
"text": "ReadonlyArray<TurnSnapshot>"
|
|
11610
|
+
}
|
|
11611
|
+
},
|
|
11612
|
+
"description": "The per-turn snapshots captured so far — what the LLM saw on each turn: system prompt, tool\nsurface, and agent-supplied state (e.g. a machine snapshot)."
|
|
11613
|
+
},
|
|
11614
|
+
{
|
|
11615
|
+
"kind": "method",
|
|
11616
|
+
"name": "externalDiagnostics",
|
|
11617
|
+
"return": {
|
|
11618
|
+
"type": {
|
|
11619
|
+
"text": "ReadonlyArray<DiagnosticEntry>"
|
|
11620
|
+
}
|
|
11621
|
+
},
|
|
11622
|
+
"description": "The harvested `turn` + `message` diagnostic entries. Opaque, and chronologically sorted by the\nhost at assemble time."
|
|
11623
|
+
},
|
|
11624
|
+
{
|
|
11625
|
+
"kind": "method",
|
|
11626
|
+
"name": "record",
|
|
11627
|
+
"return": {
|
|
11628
|
+
"type": {
|
|
11629
|
+
"text": "TurnSnapshot"
|
|
11630
|
+
}
|
|
11631
|
+
},
|
|
11632
|
+
"parameters": [
|
|
11633
|
+
{
|
|
11634
|
+
"name": "turn",
|
|
11635
|
+
"type": {
|
|
11636
|
+
"text": "RecordedTurn"
|
|
11637
|
+
}
|
|
11638
|
+
}
|
|
11639
|
+
],
|
|
11640
|
+
"description": "Push one snapshot to the ring buffer. Called inside `runToolLoop` just\nbefore each LLM call — that's the latest point where the prompt, tool\nsurface, and agent state line up with what the model is about to see.\n\nReturns the pushed object so the caller can back-fill what only the response\nknows (`usage`). Mutating it after the fact is safe whether or not the ring\nbuffer has since evicted it — an evicted snapshot is simply no longer exported."
|
|
11641
|
+
},
|
|
11642
|
+
{
|
|
11643
|
+
"kind": "method",
|
|
11644
|
+
"name": "forwardSubAgent",
|
|
11645
|
+
"return": {
|
|
11646
|
+
"type": {
|
|
11647
|
+
"text": "void"
|
|
11648
|
+
}
|
|
11649
|
+
},
|
|
11650
|
+
"parameters": [
|
|
11651
|
+
{
|
|
11652
|
+
"name": "childSnapshots",
|
|
11653
|
+
"type": {
|
|
11654
|
+
"text": "ReadonlyArray<TurnSnapshot>"
|
|
11655
|
+
}
|
|
11656
|
+
}
|
|
11657
|
+
],
|
|
11658
|
+
"description": "Merge a sub-agent's turn snapshots into this driver's buffer so they surface\nas `kind:'turn'` entries in the exported debug log. The child runs as a\nseparate, discarded driver, so its snapshots would otherwise be lost. Each is\nre-labelled under the parent turn that activated the sub-agent: the child's\nown (numeric) turns become `\"<parentTurn>-1\"`, `\"-2\"`, … (1-based, in order);\nany already-forwarded grand-child labels (strings) have their leading segment\nremapped the same way, so nesting composes (`\"5-2\"` → `\"5-2-1\"`).\n\nNote: two sub-agents invoked in the *same* parent turn share the prefix, so\ntheir labels can repeat — `agentName` on each snapshot disambiguates them."
|
|
11659
|
+
},
|
|
11660
|
+
{
|
|
11661
|
+
"kind": "method",
|
|
11662
|
+
"name": "foldDiagnostics",
|
|
11663
|
+
"return": {
|
|
11664
|
+
"type": {
|
|
11665
|
+
"text": "void"
|
|
11666
|
+
}
|
|
11667
|
+
},
|
|
11668
|
+
"parameters": [
|
|
11669
|
+
{
|
|
11670
|
+
"name": "interactionId",
|
|
11671
|
+
"type": {
|
|
11672
|
+
"text": "string"
|
|
11673
|
+
}
|
|
11674
|
+
},
|
|
11675
|
+
{
|
|
11676
|
+
"name": "harvested",
|
|
11677
|
+
"type": {
|
|
11678
|
+
"text": "unknown"
|
|
11679
|
+
}
|
|
11680
|
+
}
|
|
11681
|
+
],
|
|
11682
|
+
"description": "Fold a widget's out-of-band diagnostics into this session — typically a server-side\nChatDriver's collated log, arriving on `InteractionResult.diagnostics` — so the host's debug\nlog and persisted diagnostics stream include them. Independent of the interaction's own\nmessage: these describe the widget's work, not that message. A non-array or empty harvest is\na no-op."
|
|
11683
|
+
},
|
|
11684
|
+
{
|
|
11685
|
+
"kind": "method",
|
|
11686
|
+
"name": "trim",
|
|
11687
|
+
"privacy": "private",
|
|
11688
|
+
"return": {
|
|
11689
|
+
"type": {
|
|
11690
|
+
"text": "void"
|
|
11691
|
+
}
|
|
11692
|
+
},
|
|
11693
|
+
"description": "Hold the ring buffer at its cap, dropping oldest-first."
|
|
11694
|
+
}
|
|
11695
|
+
]
|
|
11696
|
+
}
|
|
11697
|
+
],
|
|
11698
|
+
"exports": [
|
|
11699
|
+
{
|
|
11700
|
+
"kind": "js",
|
|
11701
|
+
"name": "TurnRecorder",
|
|
11702
|
+
"declaration": {
|
|
11703
|
+
"name": "TurnRecorder",
|
|
11704
|
+
"module": "src/components/chat-driver/turn-recorder.ts"
|
|
11705
|
+
}
|
|
11706
|
+
}
|
|
11707
|
+
]
|
|
11708
|
+
},
|
|
11261
11709
|
{
|
|
11262
11710
|
"kind": "javascript-module",
|
|
11263
11711
|
"path": "src/components/chat-interaction-wrapper/chat-interaction-wrapper.styles.ts",
|
|
@@ -12646,6 +13094,30 @@
|
|
|
12646
13094
|
"kind": "javascript-module",
|
|
12647
13095
|
"path": "src/components/settings-modal/settings-modal.template.ts",
|
|
12648
13096
|
"declarations": [
|
|
13097
|
+
{
|
|
13098
|
+
"kind": "function",
|
|
13099
|
+
"name": "timestampModePickerTemplate",
|
|
13100
|
+
"return": {
|
|
13101
|
+
"type": {
|
|
13102
|
+
"text": "ViewTemplate<FoundationAiAssistant>"
|
|
13103
|
+
}
|
|
13104
|
+
},
|
|
13105
|
+
"parameters": [
|
|
13106
|
+
{
|
|
13107
|
+
"name": "segmentedControlTag",
|
|
13108
|
+
"type": {
|
|
13109
|
+
"text": "string"
|
|
13110
|
+
}
|
|
13111
|
+
},
|
|
13112
|
+
{
|
|
13113
|
+
"name": "segmentedItemTag",
|
|
13114
|
+
"type": {
|
|
13115
|
+
"text": "string"
|
|
13116
|
+
}
|
|
13117
|
+
}
|
|
13118
|
+
],
|
|
13119
|
+
"description": "Three-way picker for TimestampDisplay (GENC-1257).\n\nThe design system's segmented control rather than the `switch` every other row uses,\nbecause the setting genuinely has three states — and rather than hand-rolled buttons\ncarrying `role=\"radio\"`, because ARIA roles supply semantics but never behaviour:\npromising a radio group means owning roving `tabindex` and arrow-key navigation.\n\n`SegmentedControl extends FASTRadioGroup` (and `SegmentedItem extends FASTRadio`), so\nthis IS the DS radio group — it inherits the whole keyboard pattern — just skinned as\nsegments rather than dots, which is the right affordance for three short mode labels.\n\nThe usual reason to avoid a DS control here does not apply. `RadioGroup.valueChanged`\nemits `change` whenever `value` is written — including the write this template's own\nbinding performs on render, exactly the phantom-change footgun the DS switch has\n(GENC-1351 #1). It is harmless because the `timestampDisplay` setter guards on\n`preferenceUnchanged`, as every preference setter does, so a render-time echo returns early\nand never reaches the store or marks preferences user-changed."
|
|
13120
|
+
},
|
|
12649
13121
|
{
|
|
12650
13122
|
"kind": "function",
|
|
12651
13123
|
"name": "SettingsModalTemplate",
|
|
@@ -12666,6 +13138,14 @@
|
|
|
12666
13138
|
}
|
|
12667
13139
|
],
|
|
12668
13140
|
"exports": [
|
|
13141
|
+
{
|
|
13142
|
+
"kind": "js",
|
|
13143
|
+
"name": "timestampModePickerTemplate",
|
|
13144
|
+
"declaration": {
|
|
13145
|
+
"name": "timestampModePickerTemplate",
|
|
13146
|
+
"module": "src/components/settings-modal/settings-modal.template.ts"
|
|
13147
|
+
}
|
|
13148
|
+
},
|
|
12669
13149
|
{
|
|
12670
13150
|
"kind": "js",
|
|
12671
13151
|
"name": "SettingsModalTemplate",
|