@genesislcap/ai-assistant 15.51.0 → 15.52.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/custom-elements.json +588 -588
- package/package.json +17 -17
|
@@ -6711,487 +6711,318 @@
|
|
|
6711
6711
|
},
|
|
6712
6712
|
{
|
|
6713
6713
|
"kind": "javascript-module",
|
|
6714
|
-
"path": "src/
|
|
6714
|
+
"path": "src/state/ai-assistant-slice.ts",
|
|
6715
6715
|
"declarations": [
|
|
6716
|
+
{
|
|
6717
|
+
"kind": "function",
|
|
6718
|
+
"name": "createDefaultSessionState",
|
|
6719
|
+
"return": {
|
|
6720
|
+
"type": {
|
|
6721
|
+
"text": "AiAssistantSessionState"
|
|
6722
|
+
}
|
|
6723
|
+
},
|
|
6724
|
+
"description": "Build a fresh default session state. A factory (not just a shared const) so\neach call returns independent collections — `resetSession` can hand back a\nclean slate without aliasing the initial state's arrays."
|
|
6725
|
+
},
|
|
6716
6726
|
{
|
|
6717
6727
|
"kind": "variable",
|
|
6718
|
-
"name": "
|
|
6719
|
-
"
|
|
6728
|
+
"name": "defaultSessionState",
|
|
6729
|
+
"type": {
|
|
6730
|
+
"text": "AiAssistantSessionState"
|
|
6731
|
+
}
|
|
6732
|
+
},
|
|
6733
|
+
{
|
|
6734
|
+
"kind": "variable",
|
|
6735
|
+
"name": "aiAssistantSlice"
|
|
6720
6736
|
}
|
|
6721
6737
|
],
|
|
6722
6738
|
"exports": [
|
|
6723
6739
|
{
|
|
6724
6740
|
"kind": "js",
|
|
6725
|
-
"name": "
|
|
6741
|
+
"name": "createDefaultSessionState",
|
|
6726
6742
|
"declaration": {
|
|
6727
|
-
"name": "
|
|
6728
|
-
"module": "src/
|
|
6743
|
+
"name": "createDefaultSessionState",
|
|
6744
|
+
"module": "src/state/ai-assistant-slice.ts"
|
|
6729
6745
|
}
|
|
6730
|
-
}
|
|
6731
|
-
]
|
|
6732
|
-
},
|
|
6733
|
-
{
|
|
6734
|
-
"kind": "javascript-module",
|
|
6735
|
-
"path": "src/provider/assistant-app-settings.ts",
|
|
6736
|
-
"declarations": [
|
|
6746
|
+
},
|
|
6737
6747
|
{
|
|
6738
|
-
"kind": "
|
|
6739
|
-
"name": "
|
|
6740
|
-
"
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6748
|
+
"kind": "js",
|
|
6749
|
+
"name": "defaultSessionState",
|
|
6750
|
+
"declaration": {
|
|
6751
|
+
"name": "defaultSessionState",
|
|
6752
|
+
"module": "src/state/ai-assistant-slice.ts"
|
|
6753
|
+
}
|
|
6754
|
+
},
|
|
6744
6755
|
{
|
|
6745
6756
|
"kind": "js",
|
|
6746
|
-
"name": "
|
|
6757
|
+
"name": "aiAssistantSlice",
|
|
6747
6758
|
"declaration": {
|
|
6748
|
-
"name": "
|
|
6749
|
-
"module": "src/
|
|
6759
|
+
"name": "aiAssistantSlice",
|
|
6760
|
+
"module": "src/state/ai-assistant-slice.ts"
|
|
6750
6761
|
}
|
|
6751
6762
|
}
|
|
6752
6763
|
]
|
|
6753
6764
|
},
|
|
6754
6765
|
{
|
|
6755
6766
|
"kind": "javascript-module",
|
|
6756
|
-
"path": "src/
|
|
6767
|
+
"path": "src/state/debug-event-log.ts",
|
|
6757
6768
|
"declarations": [
|
|
6758
6769
|
{
|
|
6759
|
-
"kind": "
|
|
6760
|
-
"
|
|
6761
|
-
"
|
|
6762
|
-
|
|
6770
|
+
"kind": "variable",
|
|
6771
|
+
"name": "META_EVENT_IMPORTANCE",
|
|
6772
|
+
"type": {
|
|
6773
|
+
"text": "Record<MetaEventType, MetaEventImportance>"
|
|
6774
|
+
},
|
|
6775
|
+
"default": "{\n 'turn.error': 'high',\n 'tool.failed': 'high',\n 'subagent.failed': 'high',\n 'file.read-failed': 'high',\n 'suggestions.failed': 'high',\n 'context.threshold-crossed': 'high',\n 'context.compacted': 'high',\n 'persistence.restore-orphan': 'high',\n // A save that did not land is silent data loss in progress: the transcript on screen\n // is no longer backed by the store, and every later turn widens the gap. GENC-1511.\n 'persistence.save-failed': 'high',\n\n 'assistant.connected': 'normal',\n 'assistant.disconnected': 'normal',\n 'assistant.popout': 'normal',\n 'assistant.popin': 'normal',\n 'driver.created': 'normal',\n 'state.changed': 'normal',\n 'turn.start': 'normal',\n 'turn.end': 'normal',\n 'turn.retry': 'normal',\n 'tool.unresolved': 'normal',\n 'subagent.started': 'normal',\n 'subagent.completed': 'normal',\n // One per routing decision, with what the classifier answered and what the call cost. Same\n // level as the handoff it produces: you read them together to follow how a turn was routed.\n 'routing.decided': 'normal',\n 'agent.handoff': 'normal',\n 'agent.pinned': 'normal',\n 'agent.unpinned': 'normal',\n 'provider.selected': 'normal',\n 'interaction.requested': 'normal',\n 'interaction.resolved': 'normal',\n // Bookkeeping about an already-finished turn; interesting when reconciling a session total.\n 'interaction.external-cost': 'normal',\n // Spend that was billed but could NOT be recorded (the message was trimmed/condensed away, or\n // the value was not real spend). 'high': it is the one way the session total goes quietly\n // wrong, so it must stand out when reconciling.\n 'interaction.external-cost-dropped': 'high',\n // What came of an answer, recorded by the tool that asked (see recordInteractionOutcome).\n 'interaction.outcome': 'normal',\n // An outcome that could not be recorded: the widget goes on showing only the answer.\n 'interaction.outcome-dropped': 'high',\n 'external-diagnostics.folded': 'normal',\n 'session.cleared': 'normal',\n 'session.switched': 'low',\n 'session.switch-deferred': 'low',\n 'persistence.restored': 'normal',\n 'persistence.suppressed': 'normal',\n 'persistence.not-resumable': 'normal',\n\n 'driver.wired': 'low',\n 'driver.unwired': 'low',\n 'context.updated': 'low',\n 'context.condensed': 'low',\n 'panel.toggled': 'low',\n 'persistence.toggled': 'low',\n 'persistence.saved': 'low',\n 'attachment.added': 'low',\n}",
|
|
6776
|
+
"description": "Importance is intrinsic to the event *type*, not the instance, so it's\ndefined once here and stamped automatically by recordMetaEvent — call\nsites never pass it. The `Record` is exhaustive: adding a `MetaEventType`\nwithout a level here is a compile error.\n\n- `high` — failures and hard limits you almost always want to see.\n- `normal` — meaningful session flow you read to follow what happened.\n- `low` — frequent UI / bookkeeping noise, usually safe to skip."
|
|
6777
|
+
},
|
|
6778
|
+
{
|
|
6779
|
+
"kind": "function",
|
|
6780
|
+
"name": "recordMetaEvent",
|
|
6781
|
+
"return": {
|
|
6782
|
+
"type": {
|
|
6783
|
+
"text": "void"
|
|
6784
|
+
}
|
|
6785
|
+
},
|
|
6786
|
+
"parameters": [
|
|
6763
6787
|
{
|
|
6764
|
-
"
|
|
6765
|
-
"name": "vendors",
|
|
6788
|
+
"name": "key",
|
|
6766
6789
|
"type": {
|
|
6767
|
-
"text": "
|
|
6768
|
-
}
|
|
6769
|
-
"readonly": true
|
|
6790
|
+
"text": "string"
|
|
6791
|
+
}
|
|
6770
6792
|
},
|
|
6771
6793
|
{
|
|
6772
|
-
"
|
|
6773
|
-
"name": "options",
|
|
6794
|
+
"name": "type",
|
|
6774
6795
|
"type": {
|
|
6775
|
-
"text": "
|
|
6776
|
-
}
|
|
6777
|
-
"privacy": "private",
|
|
6778
|
-
"readonly": true,
|
|
6779
|
-
"default": "options"
|
|
6796
|
+
"text": "MetaEventType"
|
|
6797
|
+
}
|
|
6780
6798
|
},
|
|
6781
6799
|
{
|
|
6782
|
-
"
|
|
6783
|
-
"
|
|
6800
|
+
"name": "detail",
|
|
6801
|
+
"optional": true,
|
|
6784
6802
|
"type": {
|
|
6785
|
-
"text": "
|
|
6786
|
-
}
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6803
|
+
"text": "Record<string, unknown>"
|
|
6804
|
+
}
|
|
6805
|
+
}
|
|
6806
|
+
],
|
|
6807
|
+
"description": "Append a meta event to the timeline for `key`. Once the buffer exceeds\nDEFAULT_MAX_META_EVENTS, evicts the oldest *non-`high`* event;\n`high`-importance events are never evicted. An empty `key` is bucketed under\n`''`, matching how drivers/stores handle an absent session identity, so\ncallers never need to guard."
|
|
6808
|
+
},
|
|
6809
|
+
{
|
|
6810
|
+
"kind": "function",
|
|
6811
|
+
"name": "recordTurnError",
|
|
6812
|
+
"return": {
|
|
6813
|
+
"type": {
|
|
6814
|
+
"text": "void"
|
|
6815
|
+
}
|
|
6816
|
+
},
|
|
6817
|
+
"parameters": [
|
|
6790
6818
|
{
|
|
6791
|
-
"
|
|
6792
|
-
"name": "registry",
|
|
6819
|
+
"name": "key",
|
|
6793
6820
|
"type": {
|
|
6794
|
-
"text": "
|
|
6795
|
-
}
|
|
6796
|
-
"privacy": "private",
|
|
6797
|
-
"readonly": true
|
|
6798
|
-
},
|
|
6799
|
-
{
|
|
6800
|
-
"kind": "field",
|
|
6801
|
-
"name": "listeners",
|
|
6802
|
-
"privacy": "private",
|
|
6803
|
-
"readonly": true,
|
|
6804
|
-
"default": "new Set<(vendor: AITierVendor) => void>()"
|
|
6821
|
+
"text": "string"
|
|
6822
|
+
}
|
|
6805
6823
|
},
|
|
6806
6824
|
{
|
|
6807
|
-
"
|
|
6808
|
-
"name": "_vendor",
|
|
6825
|
+
"name": "reason",
|
|
6809
6826
|
"type": {
|
|
6810
|
-
"text": "
|
|
6811
|
-
}
|
|
6812
|
-
"privacy": "private"
|
|
6827
|
+
"text": "TurnFailureReason"
|
|
6828
|
+
}
|
|
6813
6829
|
},
|
|
6814
6830
|
{
|
|
6815
|
-
"
|
|
6816
|
-
"
|
|
6831
|
+
"name": "detail",
|
|
6832
|
+
"optional": true,
|
|
6817
6833
|
"type": {
|
|
6818
|
-
"text": "
|
|
6819
|
-
}
|
|
6820
|
-
"readonly": true
|
|
6821
|
-
},
|
|
6822
|
-
{
|
|
6823
|
-
"kind": "method",
|
|
6824
|
-
"name": "switchTo",
|
|
6825
|
-
"return": {
|
|
6826
|
-
"type": {
|
|
6827
|
-
"text": "void"
|
|
6828
|
-
}
|
|
6829
|
-
},
|
|
6830
|
-
"parameters": [
|
|
6831
|
-
{
|
|
6832
|
-
"name": "vendor",
|
|
6833
|
-
"type": {
|
|
6834
|
-
"text": "string"
|
|
6835
|
-
}
|
|
6836
|
-
}
|
|
6837
|
-
],
|
|
6838
|
-
"description": "A user-driven switch: move the registry, then tell the app so it can persist the choice.\nAn unknown vendor is ignored."
|
|
6839
|
-
},
|
|
6840
|
-
{
|
|
6841
|
-
"kind": "method",
|
|
6842
|
-
"name": "adoptPersistedVendor",
|
|
6843
|
-
"return": {
|
|
6844
|
-
"type": {
|
|
6845
|
-
"text": "void"
|
|
6846
|
-
}
|
|
6847
|
-
},
|
|
6848
|
-
"parameters": [
|
|
6849
|
-
{
|
|
6850
|
-
"name": "vendor",
|
|
6851
|
-
"type": {
|
|
6852
|
-
"text": "string"
|
|
6853
|
-
}
|
|
6854
|
-
}
|
|
6855
|
-
],
|
|
6856
|
-
"description": "Adopt a vendor the app read back from its own store — the same registry move as\nTieredAIProviderSwitcher.switchTo, without the `onSwitch` callback, because this\nvalue came FROM the store and writing it back would be a pointless round-trip on load.\n\nExists because registration has to stay synchronous: an element that connects before the\ntoken is registered caches the platform's no-op fallback, so an app cannot await its\nstored preference before constructing this. It boots on `initialVendor` and adopts the\nstored one a moment later, through a registry that is mutable and held by reference."
|
|
6857
|
-
},
|
|
6858
|
-
{
|
|
6859
|
-
"kind": "method",
|
|
6860
|
-
"name": "subscribe",
|
|
6861
|
-
"return": {
|
|
6862
|
-
"type": {
|
|
6863
|
-
"text": "() => void"
|
|
6864
|
-
}
|
|
6865
|
-
},
|
|
6866
|
-
"parameters": [
|
|
6867
|
-
{
|
|
6868
|
-
"name": "listener",
|
|
6869
|
-
"type": {
|
|
6870
|
-
"text": "(vendor: string) => void"
|
|
6871
|
-
}
|
|
6872
|
-
}
|
|
6873
|
-
]
|
|
6874
|
-
},
|
|
6875
|
-
{
|
|
6876
|
-
"kind": "method",
|
|
6877
|
-
"name": "apply",
|
|
6878
|
-
"privacy": "private",
|
|
6879
|
-
"return": {
|
|
6880
|
-
"type": {
|
|
6881
|
-
"text": "void"
|
|
6882
|
-
}
|
|
6883
|
-
},
|
|
6884
|
-
"parameters": [
|
|
6885
|
-
{
|
|
6886
|
-
"name": "vendor",
|
|
6887
|
-
"type": {
|
|
6888
|
-
"text": "AITierVendor"
|
|
6889
|
-
}
|
|
6890
|
-
}
|
|
6891
|
-
],
|
|
6892
|
-
"description": "The registry move both entry points share, and nothing else."
|
|
6893
|
-
},
|
|
6894
|
-
{
|
|
6895
|
-
"kind": "method",
|
|
6896
|
-
"name": "build",
|
|
6897
|
-
"privacy": "private",
|
|
6898
|
-
"return": {
|
|
6899
|
-
"type": {
|
|
6900
|
-
"text": "Record<string, AIProvider>"
|
|
6901
|
-
}
|
|
6902
|
-
},
|
|
6903
|
-
"parameters": [
|
|
6904
|
-
{
|
|
6905
|
-
"name": "vendor",
|
|
6906
|
-
"type": {
|
|
6907
|
-
"text": "AITierVendor"
|
|
6908
|
-
}
|
|
6909
|
-
}
|
|
6910
|
-
]
|
|
6911
|
-
},
|
|
6912
|
-
{
|
|
6913
|
-
"kind": "method",
|
|
6914
|
-
"name": "isKnownVendor",
|
|
6915
|
-
"privacy": "private",
|
|
6916
|
-
"return": {
|
|
6917
|
-
"type": {
|
|
6918
|
-
"text": "vendor is AITierVendor"
|
|
6919
|
-
}
|
|
6920
|
-
},
|
|
6921
|
-
"parameters": [
|
|
6922
|
-
{
|
|
6923
|
-
"name": "vendor",
|
|
6924
|
-
"type": {
|
|
6925
|
-
"text": "string"
|
|
6926
|
-
}
|
|
6927
|
-
}
|
|
6928
|
-
]
|
|
6834
|
+
"text": "Record<string, unknown>"
|
|
6835
|
+
}
|
|
6929
6836
|
}
|
|
6930
|
-
]
|
|
6837
|
+
],
|
|
6838
|
+
"description": "Record a turn-ending failure (`turn.error`, importance `high`). The `reason`\nis typed so the high-importance triage surface stays consistent; pass any\ndiagnostic specifics (attempt counts, offending tool names, etc.) in `detail`."
|
|
6931
6839
|
},
|
|
6932
6840
|
{
|
|
6933
6841
|
"kind": "function",
|
|
6934
|
-
"name": "
|
|
6842
|
+
"name": "recordTurnRetry",
|
|
6935
6843
|
"return": {
|
|
6936
6844
|
"type": {
|
|
6937
|
-
"text": "
|
|
6845
|
+
"text": "void"
|
|
6938
6846
|
}
|
|
6939
6847
|
},
|
|
6940
6848
|
"parameters": [
|
|
6941
6849
|
{
|
|
6942
|
-
"name": "
|
|
6850
|
+
"name": "key",
|
|
6943
6851
|
"type": {
|
|
6944
|
-
"text": "
|
|
6852
|
+
"text": "string"
|
|
6945
6853
|
}
|
|
6946
6854
|
},
|
|
6947
6855
|
{
|
|
6948
|
-
"name": "
|
|
6856
|
+
"name": "reason",
|
|
6949
6857
|
"type": {
|
|
6950
|
-
"text": "
|
|
6858
|
+
"text": "TurnFailureReason"
|
|
6859
|
+
}
|
|
6860
|
+
},
|
|
6861
|
+
{
|
|
6862
|
+
"name": "detail",
|
|
6863
|
+
"optional": true,
|
|
6864
|
+
"type": {
|
|
6865
|
+
"text": "Record<string, unknown>"
|
|
6951
6866
|
}
|
|
6952
6867
|
}
|
|
6953
6868
|
],
|
|
6954
|
-
"description": "
|
|
6955
|
-
}
|
|
6956
|
-
],
|
|
6957
|
-
"exports": [
|
|
6958
|
-
{
|
|
6959
|
-
"kind": "js",
|
|
6960
|
-
"name": "TieredAIProviderSwitcher",
|
|
6961
|
-
"declaration": {
|
|
6962
|
-
"name": "TieredAIProviderSwitcher",
|
|
6963
|
-
"module": "src/provider/tiered-provider-switcher.ts"
|
|
6964
|
-
}
|
|
6965
|
-
},
|
|
6966
|
-
{
|
|
6967
|
-
"kind": "js",
|
|
6968
|
-
"name": "registerTieredAIProviders",
|
|
6969
|
-
"declaration": {
|
|
6970
|
-
"name": "registerTieredAIProviders",
|
|
6971
|
-
"module": "src/provider/tiered-provider-switcher.ts"
|
|
6972
|
-
}
|
|
6973
|
-
}
|
|
6974
|
-
]
|
|
6975
|
-
},
|
|
6976
|
-
{
|
|
6977
|
-
"kind": "javascript-module",
|
|
6978
|
-
"path": "src/styles/ai-colours.ts",
|
|
6979
|
-
"declarations": [
|
|
6980
|
-
{
|
|
6981
|
-
"kind": "variable",
|
|
6982
|
-
"name": "AI_COLOUR_AMBER",
|
|
6983
|
-
"type": {
|
|
6984
|
-
"text": "string"
|
|
6985
|
-
},
|
|
6986
|
-
"default": "'#feb60a'",
|
|
6987
|
-
"description": "Shared brand colours used across the AI animation effects\n(halo overlay border/glow and loading dot indicators).\nDefined once here so both stay in sync."
|
|
6988
|
-
},
|
|
6989
|
-
{
|
|
6990
|
-
"kind": "variable",
|
|
6991
|
-
"name": "AI_COLOUR_PINK",
|
|
6992
|
-
"type": {
|
|
6993
|
-
"text": "string"
|
|
6994
|
-
},
|
|
6995
|
-
"default": "'#ff0062'"
|
|
6996
|
-
},
|
|
6997
|
-
{
|
|
6998
|
-
"kind": "variable",
|
|
6999
|
-
"name": "AI_COLOUR_CYAN",
|
|
7000
|
-
"type": {
|
|
7001
|
-
"text": "string"
|
|
7002
|
-
},
|
|
7003
|
-
"default": "'#00dbf9'"
|
|
6869
|
+
"description": "Record a recoverable retry *within* a turn (`turn.retry`, importance `normal`)\n— e.g. one malformed/empty attempt that will be retried, as distinct from the\nfinal attempt that bails out as a `turn.error`. Include `attempt`/`maxAttempts`\nin `detail` so the timeline shows which try this was."
|
|
7004
6870
|
},
|
|
7005
6871
|
{
|
|
7006
|
-
"kind": "
|
|
7007
|
-
"name": "
|
|
7008
|
-
"
|
|
7009
|
-
"
|
|
6872
|
+
"kind": "function",
|
|
6873
|
+
"name": "getMetaEvents",
|
|
6874
|
+
"return": {
|
|
6875
|
+
"type": {
|
|
6876
|
+
"text": "ReadonlyArray<MetaEvent>"
|
|
6877
|
+
}
|
|
7010
6878
|
},
|
|
7011
|
-
"
|
|
6879
|
+
"parameters": [
|
|
6880
|
+
{
|
|
6881
|
+
"name": "key",
|
|
6882
|
+
"type": {
|
|
6883
|
+
"text": "string"
|
|
6884
|
+
}
|
|
6885
|
+
}
|
|
6886
|
+
],
|
|
6887
|
+
"description": "Returns the meta-event timeline for `key`, or an empty array if none recorded."
|
|
7012
6888
|
},
|
|
7013
6889
|
{
|
|
7014
|
-
"kind": "
|
|
7015
|
-
"name": "
|
|
7016
|
-
"
|
|
7017
|
-
"
|
|
6890
|
+
"kind": "function",
|
|
6891
|
+
"name": "mergeMetaEvents",
|
|
6892
|
+
"return": {
|
|
6893
|
+
"type": {
|
|
6894
|
+
"text": "void"
|
|
6895
|
+
}
|
|
7018
6896
|
},
|
|
7019
|
-
"
|
|
7020
|
-
|
|
6897
|
+
"parameters": [
|
|
6898
|
+
{
|
|
6899
|
+
"name": "targetKey",
|
|
6900
|
+
"type": {
|
|
6901
|
+
"text": "string"
|
|
6902
|
+
}
|
|
6903
|
+
},
|
|
6904
|
+
{
|
|
6905
|
+
"name": "events",
|
|
6906
|
+
"type": {
|
|
6907
|
+
"text": "readonly MetaEvent[]"
|
|
6908
|
+
}
|
|
6909
|
+
}
|
|
6910
|
+
],
|
|
6911
|
+
"description": "Merge pre-built meta events into the timeline for `targetKey`, **preserving each\nevent's original `timestamp`** (so it interleaves chronologically on export)\nwhile re-indexing onto the target buffer's monotonic counter. Used to fold a\nsub-agent's harvested events into the parent session — see\n`ChatDriver.invokeSubAgent`. Unlike recordMetaEvent it does not stamp a\nfresh timestamp; the same non-`high` eviction policy is applied once after the\nbatch so the buffer stays bounded."
|
|
7021
6912
|
},
|
|
7022
6913
|
{
|
|
7023
6914
|
"kind": "function",
|
|
7024
|
-
"name": "
|
|
6915
|
+
"name": "clearSession",
|
|
7025
6916
|
"return": {
|
|
7026
6917
|
"type": {
|
|
7027
|
-
"text": "
|
|
6918
|
+
"text": "void"
|
|
7028
6919
|
}
|
|
7029
6920
|
},
|
|
7030
6921
|
"parameters": [
|
|
7031
6922
|
{
|
|
7032
|
-
"name": "
|
|
6923
|
+
"name": "key",
|
|
7033
6924
|
"type": {
|
|
7034
|
-
"text": "
|
|
6925
|
+
"text": "string"
|
|
7035
6926
|
}
|
|
7036
6927
|
}
|
|
7037
6928
|
],
|
|
7038
|
-
"description": "
|
|
6929
|
+
"description": "Drop the entire timeline for `key`. Used to discard a sub-agent's transient\nper-invocation session once its events have been harvested into the parent, so\nthe module registry doesn't accumulate one orphaned bucket per sub-agent run."
|
|
6930
|
+
},
|
|
6931
|
+
{
|
|
6932
|
+
"kind": "variable",
|
|
6933
|
+
"name": "DEBUG_LOG_README",
|
|
6934
|
+
"type": {
|
|
6935
|
+
"text": "readonly string[]"
|
|
6936
|
+
},
|
|
6937
|
+
"default": "[\n 'This is an exported debug log for the Genesis AI assistant. Read it top-to-bottom.',\n \"`sessionUsage` is what this session spent: `costUsd` (USD, provider-reported per request and summed, cache discounts already applied) plus the four TOKEN BUCKETS — `uncachedInputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`. Those four are disjoint and safe to add up for a total-tokens figure; the per-message fields further down are NOT (see kind:'message'). Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a big token count against a small cost means the prompt was mostly cache hits, not a missing charge. It covers sub-agent turns and spend a compaction banked, so for the CONVERSATION it is the authoritative total: prefer it over re-summing the timeline, which can be short by whatever the ring buffers evicted. The same figures appear under `meta.context`. It is as current as the snapshot it came from: the assistant's own download stamps a fresh one, but a log stitched by another tool can carry an older one — compare `meta.timestamp` with the last timeline entry, and if it is well behind, read these totals as historical and fall back to summing the timeline. One scope caveat: it is derived from the transcript, so it excludes billed calls that produced no message (a blank or refused attempt that was retried — see kind:'turn'.`usage`). Summing the turns can therefore come out HIGHER than this, and the difference is exactly that discarded spend, not a double-count.\",\n \"What 'session' means for those figures: the CURRENT conversation under this session key (a host-supplied per-project id, or the element id + header title when the host supplies none) — which is not necessarily everything in `timeline`. It is re-derived from the live transcript, so it spans page loads only when the chat is being remembered, and a Clear resets it to zero. `timeline` is append-only regardless: it keeps every page load and the pre-Clear conversation, with the session.cleared event as the boundary. So on a long-lived log, read these totals as the latest conversation's and the earlier sections as history — not as a total of the whole file.\",\n '`timeline` is the entire session as one array, already sorted chronologically by `timestamp` (ISO 8601). Every entry has a `kind`.',\n 'Timestamps are millisecond-resolution; entries that share the same millisecond are ordered by a fixed kind rank (event, then turn, then message), which is a heuristic and may not reflect exact causal order within that millisecond — e.g. a user message and the turn it triggered, or a final assistant message and its turn.end event, can appear in either order depending on whether they landed in the same millisecond. Read the logical structure of a turn rather than over-interpreting the micro-ordering of co-timestamped entries of different kinds.',\n \"kind:'message' — the conversation. `role` is user/assistant/tool/system-event/synthetic-user; `agentName` says which agent produced it; `toolCalls`/`toolResult`/`interaction` carry tool and widget activity; `inputTokens`/`outputTokens`/`cost` are per-message LLM usage, where `inputTokens` is the WHOLE prompt for that request and `cacheReadTokens`/`cacheWriteTokens` BREAK IT DOWN rather than add to it — uncached input is `inputTokens` minus those two, and adding the cache fields to `inputTokens` counts the prompt twice. The cache fields are absent on providers that report no cache split (Gemini reports reads only, since implicit caching bills no write) and on messages persisted before they existed, so read them as 0 when missing. Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a large token count at a small cost means the prompt was mostly cache hits. `externalCostUsd` is any non-LLM cost a widget reported for its own external service calls (folded into the session cost total alongside `cost`). On model-produced assistant messages, `model` is the concrete model id that generated it (e.g. 'gemini-2.5-flash-lite') and `providerName` is the registry slot it resolved under (e.g. a tier name like 'high'/'low', or the default); together they attribute the message — and any tool calls it carries — to an exact model even across a mid-session vendor/tier switch, where one slot name can map to different models before and after the switch. Both are undefined on any entry that is NOT an LLM response: non-assistant roles (user/tool/system-event) and 'synthetic-user' echoes; assistant interaction/widget entries (empty content carrying an `interaction` — a rendered widget, not a model turn); driver-authored assistant fallbacks (the timeout, repeated-malformed-call, and empty-response apology messages); and messages restored from a session persisted before these fields existed. One partial case: on a genuine model turn whose provider exposes no `getStatus` (or reports no model), `providerName` is still set but `model` alone is undefined. A 'synthetic-user' message is a display-only echo of an interaction outcome (e.g. the answer a widget reported): it renders on the user's side of the chat and `agentName` is the agent that created it, but it is never sent to the LLM — so it has no matching 'turn' and the model learns the outcome only from the corresponding tool result.\",\n \"Sub-agent messages appear inline. When a tool delegates to a sub-agent (via `requestSubAgent`), the sub-agent's whole conversation — its own assistant/tool messages, each with their own `content`/`thinking`/`toolCalls`/`toolResult` and per-message `model`/`providerName`/`inputTokens`/`outputTokens`/`cacheReadTokens`/`cacheWriteTokens`/`cost` — is hoisted into the timeline as ordinary kind:'message' entries, interleaved by timestamp right after the tool call that spawned them (so you read the delegation top-to-bottom). A hoisted entry is marked: `subAgentDepth` is its delegation depth (1 for a sub-agent, 2 for a sub-agent's sub-agent, …), `subAgentOf` is the id of the parent tool call that spawned it (correlates it back even when two sub-agents run in one parent turn), `subAgentName` is the sub-agent's own name, and `agentName` is rewritten to a `\\\"<parent> › <sub-agent>\\\"` breadcrumb (composing when nested, e.g. `\\\"UI Builder › Planner › Grounding\\\"`). The sub-agent's per-LLM-call snapshots also surface as kind:'turn' entries with an N-M `turnIndex`, and subagent.started/completed (or subagent.failed) events bracket the run. Per-message `cost` on hoisted entries is already part of the session total (it is summed from the un-flattened history), so summing the top-level timeline does NOT double-count.\",\n \"kind:'turn' — one LLM call. `turnIndex` is a string: a top-level turn is the bare counter ('0', '1', …); a sub-agent's turns are numbered under the parent turn that activated them ('3-1', '3-2', …, and a nested sub-agent contributes '3-2-1', …), and `agentName` names the agent that ran the turn. `systemPrompt` and `toolNames` are what the model saw. A systemPrompt of '<repeated — identical to turn N>' was byte-identical to turn N and de-duplicated; the full prompt is shown whenever it changes (often because a stateful agent advanced), so prompt evolution is visible.\",\n \"kind:'turn'.`model`/`providerName`/`provider` — which model ran that call: the concrete model id, the registry slot it resolved under (a tier name like 'high'/'low', or the default), and the vendor. Recorded per CALL, so an agent whose `provider` selector varies by state — a flow that plans on a high tier and executes on a low one — has every step attributed, including calls that produced no message. `model` is the SERVING model where the provider reports one, so a turn answered by a server-side fallback names the model that answered rather than the one requested; it always matches the `model` on the message that call produced. Absent when the provider exposes no `getStatus` and the transport stamped nothing.\",\n \"kind:'turn'.`usage` — what that ONE call cost, in the same four-bucket + `costUsd` shape as `sessionUsage`. Absent while a call is in flight and on providers that report no usage. This is the SAME money as the message the call produced, not extra money: never add turn usage to message usage, and read a turn plus its message as one charge. Its distinct value is the calls that produced NO message — a blank or refused response is billed and then discarded before the retry, so the turn entry is the only record of that spend, and a turn with `usage` but no message after it is exactly that. `costUsd: 0` alongside a nonzero token count means the provider reported no price, not that the call was free.\",\n \"kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.\",\n \"kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.\",\n \"Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.\",\n 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused/context-exhausted/ai-service-error, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, for context-exhausted the estimated contextTokens against the guard that stopped the turn plus the iterations reached — the driver ending a runaway tool loop at the edge of the context window rather than issuing a request the provider would reject, so the transcript survives intact and can still be compacted, for ai-service-error the code (one of AI_SERVICE_ERROR_CODES, e.g. NO_API_KEY) and the status the AI service answered with — its own text goes to the browser console only, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused/context_exhausted/ai_service_error; budget_exhausted and provider_refused are terminal for the PARENT turn too, and so is ai_service_error when the refusal is about the service rather than the request and came from the vendor the parent calls — the parent stops rather than calling the model again into the same wall; after context_exhausted the parent goes on, but its own next call is likely to stop on the same guard), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), routing.decided (ONE PER ROUTING DECISION — see its own paragraph below), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',\n 'Sub-agent meta events: a sub-agent\\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `\"<parent> › <sub-agent>\"` breadcrumb that composes when nested (e.g. `\"UI Builder › Planner › Grounding\"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\\'s span.',\n \"`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.\",\n 'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',\n \"kind:'event' type 'routing.decided' — how ONE turn was routed, emitted by the orchestrating driver before the agent runs (and again after every handoff). `decision` is why that agent was chosen: 'classified' (the classifier ran and picked one), 'no-match' (it ran and answered -1 — nothing listed covers the request), 'ballot-exhausted' (every eligible specialist had already handed off this turn, so the ballot was empty and NO call was made — distinct from 'no-match', where one ran and declined), 'pinned' (a user pin or an active stateful flow owned the turn, so no call was made), 'single-candidate'/'no-specialists' (configuration left nothing to decide), 'provider-unavailable' (the registry default exposes no chat()), 'classifier-failed' (every attempt threw — `error` carries the last one). `to` names the agent and `fallback` says whether that agent is the fallback. `candidates` is what was actually ON THE BALLOT, in ballot order, so `index` — the classifier's own answer — indexes it directly; `excluded` names the specialists left off because they already handed off this turn, so the full eligible set is `candidates` ∪ `excluded`. `candidates` is absent on the four decisions that put nothing to a vote — 'pinned', 'single-candidate', 'no-specialists', 'ballot-exhausted'. It IS present on 'provider-unavailable', which is not an exception worth removing: the ballot was built there, it simply never got sent. `attempts` covers the retry ladder. `durationMs` is on EVERY routing.decided, and is the field to read when a decision looks wrong: the four decisions that can reach the fallback are told apart by the clock as much as by their name, because a fallback routing that resolved in tens of milliseconds made no network call at all whatever its `decision` says.\",\n \"kind:'event' type 'routing.decided'.`usage` — what that classifier call cost, in the same four-bucket + costUsd shape as `sessionUsage`, plus `model`. Absent on the decisions that make no call (see 'pinned' and the configuration ones). THIS SPEND IS NOT IN `sessionUsage`: a classifier call never enters the transcript and `sessionUsage` is derived from the transcript, so classifier cost is missing from the session total by construction, not by accident. Sum these events to close that gap — it is the one component of a session's real spend that the totals cannot see.\",\n 'To debug a failure: find the last turn.error or tool.failed, then read upward for the user message, the turn(s), and the agent/provider/state events that led into it. For a turn that went to the wrong agent, read its routing.decided first — `decision` says whether anything was actually asked.',\n]",
|
|
6938
|
+
"description": "Human/agent-facing guide emitted as the first key of the exported debug log,\nso whoever opens the JSON (often an AI agent) knows how to read it without\nreverse-engineering the shape. Kept here next to the event catalogue it\ndescribes — but proximity alone demonstrably did NOT keep the two in sync\n(`refusal` was missing from both reason lists for a whole release), so\n`debug-event-log.test.ts` now asserts that every `TurnFailureReason` and every\n`SubAgentFailureReason` is named here, and fails the build when one is added\nwithout a matching sentence. Enumerations below read as exhaustive and WILL be\ntrusted by an agent reading the JSON — keep them so."
|
|
7039
6939
|
}
|
|
7040
6940
|
],
|
|
7041
6941
|
"exports": [
|
|
7042
6942
|
{
|
|
7043
6943
|
"kind": "js",
|
|
7044
|
-
"name": "
|
|
7045
|
-
"declaration": {
|
|
7046
|
-
"name": "AI_COLOUR_AMBER",
|
|
7047
|
-
"module": "src/styles/ai-colours.ts"
|
|
7048
|
-
}
|
|
7049
|
-
},
|
|
7050
|
-
{
|
|
7051
|
-
"kind": "js",
|
|
7052
|
-
"name": "AI_COLOUR_PINK",
|
|
6944
|
+
"name": "META_EVENT_IMPORTANCE",
|
|
7053
6945
|
"declaration": {
|
|
7054
|
-
"name": "
|
|
7055
|
-
"module": "src/
|
|
6946
|
+
"name": "META_EVENT_IMPORTANCE",
|
|
6947
|
+
"module": "src/state/debug-event-log.ts"
|
|
7056
6948
|
}
|
|
7057
6949
|
},
|
|
7058
6950
|
{
|
|
7059
6951
|
"kind": "js",
|
|
7060
|
-
"name": "
|
|
6952
|
+
"name": "recordMetaEvent",
|
|
7061
6953
|
"declaration": {
|
|
7062
|
-
"name": "
|
|
7063
|
-
"module": "src/
|
|
6954
|
+
"name": "recordMetaEvent",
|
|
6955
|
+
"module": "src/state/debug-event-log.ts"
|
|
7064
6956
|
}
|
|
7065
6957
|
},
|
|
7066
6958
|
{
|
|
7067
6959
|
"kind": "js",
|
|
7068
|
-
"name": "
|
|
6960
|
+
"name": "TurnFailureReason",
|
|
7069
6961
|
"declaration": {
|
|
7070
|
-
"name": "
|
|
7071
|
-
"module": "src/
|
|
6962
|
+
"name": "TurnFailureReason",
|
|
6963
|
+
"module": "src/state/debug-event-log.ts"
|
|
7072
6964
|
}
|
|
7073
6965
|
},
|
|
7074
6966
|
{
|
|
7075
6967
|
"kind": "js",
|
|
7076
|
-
"name": "
|
|
6968
|
+
"name": "recordTurnError",
|
|
7077
6969
|
"declaration": {
|
|
7078
|
-
"name": "
|
|
7079
|
-
"module": "src/
|
|
6970
|
+
"name": "recordTurnError",
|
|
6971
|
+
"module": "src/state/debug-event-log.ts"
|
|
7080
6972
|
}
|
|
7081
6973
|
},
|
|
7082
6974
|
{
|
|
7083
6975
|
"kind": "js",
|
|
7084
|
-
"name": "
|
|
6976
|
+
"name": "recordTurnRetry",
|
|
7085
6977
|
"declaration": {
|
|
7086
|
-
"name": "
|
|
7087
|
-
"module": "src/
|
|
6978
|
+
"name": "recordTurnRetry",
|
|
6979
|
+
"module": "src/state/debug-event-log.ts"
|
|
7088
6980
|
}
|
|
7089
|
-
}
|
|
7090
|
-
]
|
|
7091
|
-
},
|
|
7092
|
-
{
|
|
7093
|
-
"kind": "javascript-module",
|
|
7094
|
-
"path": "src/styles/menu.ts",
|
|
7095
|
-
"declarations": [],
|
|
7096
|
-
"exports": []
|
|
7097
|
-
},
|
|
7098
|
-
{
|
|
7099
|
-
"kind": "javascript-module",
|
|
7100
|
-
"path": "src/styles/settings-section.ts",
|
|
7101
|
-
"declarations": [
|
|
7102
|
-
{
|
|
7103
|
-
"kind": "variable",
|
|
7104
|
-
"name": "assistantSettingsSectionTitleStyles",
|
|
7105
|
-
"type": {
|
|
7106
|
-
"text": "ElementStyles"
|
|
7107
|
-
},
|
|
7108
|
-
"default": "css`\n .ai-settings-section-title {\n display: flex;\n align-items: center;\n gap: calc(var(--design-unit) * 2px);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--neutral-foreground-hint);\n }\n`",
|
|
7109
|
-
"description": "Heading style for a settings-modal section, published so a host can title its own section.\n\nThe assistant renders no heading for the `settings-app` slot — no text and no icon — because\nonly the host knows what that section is. The consequence is that a host supplying one has to\nreproduce the styling of the built-in headings beside it, and a copied rule drifts the moment\neither side changes. So the declarations live here, are applied by the assistant's own\nheadings, and are exported for the host to apply to its.\n\nCompose it into a component's styles and put `ai-settings-section-title` on the heading:\n\n```ts\nimport { assistantSettingsSectionTitleStyles } from '@genesislcap/ai-assistant';\n\nconst styles = css`\n ${assistantSettingsSectionTitleStyles}\n :host { display: block; }\n`;\n```\n\nCarries no margin on purpose: spacing belongs to the surrounding layout, which differs\nbetween the assistant's own sections and a slotted one, and is the single declaration hosts\nhad to diverge on when they copied this rule."
|
|
7110
|
-
}
|
|
7111
|
-
],
|
|
7112
|
-
"exports": [
|
|
6981
|
+
},
|
|
7113
6982
|
{
|
|
7114
6983
|
"kind": "js",
|
|
7115
|
-
"name": "
|
|
6984
|
+
"name": "getMetaEvents",
|
|
7116
6985
|
"declaration": {
|
|
7117
|
-
"name": "
|
|
7118
|
-
"module": "src/
|
|
7119
|
-
}
|
|
7120
|
-
}
|
|
7121
|
-
]
|
|
7122
|
-
},
|
|
7123
|
-
{
|
|
7124
|
-
"kind": "javascript-module",
|
|
7125
|
-
"path": "src/state/ai-assistant-slice.ts",
|
|
7126
|
-
"declarations": [
|
|
7127
|
-
{
|
|
7128
|
-
"kind": "function",
|
|
7129
|
-
"name": "createDefaultSessionState",
|
|
7130
|
-
"return": {
|
|
7131
|
-
"type": {
|
|
7132
|
-
"text": "AiAssistantSessionState"
|
|
7133
|
-
}
|
|
7134
|
-
},
|
|
7135
|
-
"description": "Build a fresh default session state. A factory (not just a shared const) so\neach call returns independent collections — `resetSession` can hand back a\nclean slate without aliasing the initial state's arrays."
|
|
7136
|
-
},
|
|
7137
|
-
{
|
|
7138
|
-
"kind": "variable",
|
|
7139
|
-
"name": "defaultSessionState",
|
|
7140
|
-
"type": {
|
|
7141
|
-
"text": "AiAssistantSessionState"
|
|
6986
|
+
"name": "getMetaEvents",
|
|
6987
|
+
"module": "src/state/debug-event-log.ts"
|
|
7142
6988
|
}
|
|
7143
6989
|
},
|
|
7144
|
-
{
|
|
7145
|
-
"kind": "variable",
|
|
7146
|
-
"name": "aiAssistantSlice"
|
|
7147
|
-
}
|
|
7148
|
-
],
|
|
7149
|
-
"exports": [
|
|
7150
6990
|
{
|
|
7151
6991
|
"kind": "js",
|
|
7152
|
-
"name": "
|
|
6992
|
+
"name": "mergeMetaEvents",
|
|
7153
6993
|
"declaration": {
|
|
7154
|
-
"name": "
|
|
7155
|
-
"module": "src/state/
|
|
6994
|
+
"name": "mergeMetaEvents",
|
|
6995
|
+
"module": "src/state/debug-event-log.ts"
|
|
7156
6996
|
}
|
|
7157
6997
|
},
|
|
7158
6998
|
{
|
|
7159
6999
|
"kind": "js",
|
|
7160
|
-
"name": "
|
|
7000
|
+
"name": "clearSession",
|
|
7161
7001
|
"declaration": {
|
|
7162
|
-
"name": "
|
|
7163
|
-
"module": "src/state/
|
|
7002
|
+
"name": "clearSession",
|
|
7003
|
+
"module": "src/state/debug-event-log.ts"
|
|
7164
7004
|
}
|
|
7165
7005
|
},
|
|
7166
7006
|
{
|
|
7167
7007
|
"kind": "js",
|
|
7168
|
-
"name": "
|
|
7008
|
+
"name": "DEBUG_LOG_README",
|
|
7169
7009
|
"declaration": {
|
|
7170
|
-
"name": "
|
|
7171
|
-
"module": "src/state/
|
|
7010
|
+
"name": "DEBUG_LOG_README",
|
|
7011
|
+
"module": "src/state/debug-event-log.ts"
|
|
7172
7012
|
}
|
|
7173
7013
|
}
|
|
7174
7014
|
]
|
|
7175
7015
|
},
|
|
7176
7016
|
{
|
|
7177
7017
|
"kind": "javascript-module",
|
|
7178
|
-
"path": "src/state/
|
|
7018
|
+
"path": "src/state/driver-registry.ts",
|
|
7179
7019
|
"declarations": [
|
|
7180
|
-
{
|
|
7181
|
-
"kind": "variable",
|
|
7182
|
-
"name": "META_EVENT_IMPORTANCE",
|
|
7183
|
-
"type": {
|
|
7184
|
-
"text": "Record<MetaEventType, MetaEventImportance>"
|
|
7185
|
-
},
|
|
7186
|
-
"default": "{\n 'turn.error': 'high',\n 'tool.failed': 'high',\n 'subagent.failed': 'high',\n 'file.read-failed': 'high',\n 'suggestions.failed': 'high',\n 'context.threshold-crossed': 'high',\n 'context.compacted': 'high',\n 'persistence.restore-orphan': 'high',\n // A save that did not land is silent data loss in progress: the transcript on screen\n // is no longer backed by the store, and every later turn widens the gap. GENC-1511.\n 'persistence.save-failed': 'high',\n\n 'assistant.connected': 'normal',\n 'assistant.disconnected': 'normal',\n 'assistant.popout': 'normal',\n 'assistant.popin': 'normal',\n 'driver.created': 'normal',\n 'state.changed': 'normal',\n 'turn.start': 'normal',\n 'turn.end': 'normal',\n 'turn.retry': 'normal',\n 'tool.unresolved': 'normal',\n 'subagent.started': 'normal',\n 'subagent.completed': 'normal',\n // One per routing decision, with what the classifier answered and what the call cost. Same\n // level as the handoff it produces: you read them together to follow how a turn was routed.\n 'routing.decided': 'normal',\n 'agent.handoff': 'normal',\n 'agent.pinned': 'normal',\n 'agent.unpinned': 'normal',\n 'provider.selected': 'normal',\n 'interaction.requested': 'normal',\n 'interaction.resolved': 'normal',\n // Bookkeeping about an already-finished turn; interesting when reconciling a session total.\n 'interaction.external-cost': 'normal',\n // Spend that was billed but could NOT be recorded (the message was trimmed/condensed away, or\n // the value was not real spend). 'high': it is the one way the session total goes quietly\n // wrong, so it must stand out when reconciling.\n 'interaction.external-cost-dropped': 'high',\n // What came of an answer, recorded by the tool that asked (see recordInteractionOutcome).\n 'interaction.outcome': 'normal',\n // An outcome that could not be recorded: the widget goes on showing only the answer.\n 'interaction.outcome-dropped': 'high',\n 'external-diagnostics.folded': 'normal',\n 'session.cleared': 'normal',\n 'session.switched': 'low',\n 'session.switch-deferred': 'low',\n 'persistence.restored': 'normal',\n 'persistence.suppressed': 'normal',\n 'persistence.not-resumable': 'normal',\n\n 'driver.wired': 'low',\n 'driver.unwired': 'low',\n 'context.updated': 'low',\n 'context.condensed': 'low',\n 'panel.toggled': 'low',\n 'persistence.toggled': 'low',\n 'persistence.saved': 'low',\n 'attachment.added': 'low',\n}",
|
|
7187
|
-
"description": "Importance is intrinsic to the event *type*, not the instance, so it's\ndefined once here and stamped automatically by recordMetaEvent — call\nsites never pass it. The `Record` is exhaustive: adding a `MetaEventType`\nwithout a level here is a compile error.\n\n- `high` — failures and hard limits you almost always want to see.\n- `normal` — meaningful session flow you read to follow what happened.\n- `low` — frequent UI / bookkeeping noise, usually safe to skip."
|
|
7188
|
-
},
|
|
7189
7020
|
{
|
|
7190
7021
|
"kind": "function",
|
|
7191
|
-
"name": "
|
|
7022
|
+
"name": "getOrCreateDriver",
|
|
7192
7023
|
"return": {
|
|
7193
7024
|
"type": {
|
|
7194
|
-
"text": "
|
|
7025
|
+
"text": "AiDriver"
|
|
7195
7026
|
}
|
|
7196
7027
|
},
|
|
7197
7028
|
"parameters": [
|
|
@@ -7202,27 +7033,26 @@
|
|
|
7202
7033
|
}
|
|
7203
7034
|
},
|
|
7204
7035
|
{
|
|
7205
|
-
"name": "
|
|
7036
|
+
"name": "agentsKey",
|
|
7206
7037
|
"type": {
|
|
7207
|
-
"text": "
|
|
7038
|
+
"text": "string"
|
|
7208
7039
|
}
|
|
7209
7040
|
},
|
|
7210
7041
|
{
|
|
7211
|
-
"name": "
|
|
7212
|
-
"optional": true,
|
|
7042
|
+
"name": "factory",
|
|
7213
7043
|
"type": {
|
|
7214
|
-
"text": "
|
|
7044
|
+
"text": "() => AiDriver"
|
|
7215
7045
|
}
|
|
7216
7046
|
}
|
|
7217
7047
|
],
|
|
7218
|
-
"description": "
|
|
7048
|
+
"description": "Returns the existing driver for the given key, or calls the factory to create\nand register a new one. `agentsKey` is the fingerprint of the agents the\ndriver is being built for; it is recorded only when a driver is created (a\nreused driver keeps the fingerprint it was originally built with)."
|
|
7219
7049
|
},
|
|
7220
7050
|
{
|
|
7221
7051
|
"kind": "function",
|
|
7222
|
-
"name": "
|
|
7052
|
+
"name": "getDriver",
|
|
7223
7053
|
"return": {
|
|
7224
7054
|
"type": {
|
|
7225
|
-
"text": "
|
|
7055
|
+
"text": "AiDriver | undefined"
|
|
7226
7056
|
}
|
|
7227
7057
|
},
|
|
7228
7058
|
"parameters": [
|
|
@@ -7231,29 +7061,16 @@
|
|
|
7231
7061
|
"type": {
|
|
7232
7062
|
"text": "string"
|
|
7233
7063
|
}
|
|
7234
|
-
},
|
|
7235
|
-
{
|
|
7236
|
-
"name": "reason",
|
|
7237
|
-
"type": {
|
|
7238
|
-
"text": "TurnFailureReason"
|
|
7239
|
-
}
|
|
7240
|
-
},
|
|
7241
|
-
{
|
|
7242
|
-
"name": "detail",
|
|
7243
|
-
"optional": true,
|
|
7244
|
-
"type": {
|
|
7245
|
-
"text": "Record<string, unknown>"
|
|
7246
|
-
}
|
|
7247
7064
|
}
|
|
7248
7065
|
],
|
|
7249
|
-
"description": "
|
|
7066
|
+
"description": "Returns the existing driver for the given key, or `undefined`."
|
|
7250
7067
|
},
|
|
7251
7068
|
{
|
|
7252
7069
|
"kind": "function",
|
|
7253
|
-
"name": "
|
|
7070
|
+
"name": "getDriverAgentsKey",
|
|
7254
7071
|
"return": {
|
|
7255
7072
|
"type": {
|
|
7256
|
-
"text": "
|
|
7073
|
+
"text": "string | undefined"
|
|
7257
7074
|
}
|
|
7258
7075
|
},
|
|
7259
7076
|
"parameters": [
|
|
@@ -7262,29 +7079,16 @@
|
|
|
7262
7079
|
"type": {
|
|
7263
7080
|
"text": "string"
|
|
7264
7081
|
}
|
|
7265
|
-
},
|
|
7266
|
-
{
|
|
7267
|
-
"name": "reason",
|
|
7268
|
-
"type": {
|
|
7269
|
-
"text": "TurnFailureReason"
|
|
7270
|
-
}
|
|
7271
|
-
},
|
|
7272
|
-
{
|
|
7273
|
-
"name": "detail",
|
|
7274
|
-
"optional": true,
|
|
7275
|
-
"type": {
|
|
7276
|
-
"text": "Record<string, unknown>"
|
|
7277
|
-
}
|
|
7278
7082
|
}
|
|
7279
7083
|
],
|
|
7280
|
-
"description": "
|
|
7084
|
+
"description": "The agents fingerprint the registry driver for `key` was built with, or\n`undefined` if no driver is registered. Used by `agentsChanged` to decide\nwhether a sibling has already rebuilt the shared driver to the desired agents."
|
|
7281
7085
|
},
|
|
7282
7086
|
{
|
|
7283
7087
|
"kind": "function",
|
|
7284
|
-
"name": "
|
|
7088
|
+
"name": "deleteDriver",
|
|
7285
7089
|
"return": {
|
|
7286
7090
|
"type": {
|
|
7287
|
-
"text": "
|
|
7091
|
+
"text": "AiDriver | undefined"
|
|
7288
7092
|
}
|
|
7289
7093
|
},
|
|
7290
7094
|
"parameters": [
|
|
@@ -7295,35 +7099,100 @@
|
|
|
7295
7099
|
}
|
|
7296
7100
|
}
|
|
7297
7101
|
],
|
|
7298
|
-
"description": "
|
|
7102
|
+
"description": "Removes and returns the driver for the given key.\nUsed when agents change (driver must be rebuilt) or on explicit session teardown."
|
|
7103
|
+
}
|
|
7104
|
+
],
|
|
7105
|
+
"exports": [
|
|
7106
|
+
{
|
|
7107
|
+
"kind": "js",
|
|
7108
|
+
"name": "getOrCreateDriver",
|
|
7109
|
+
"declaration": {
|
|
7110
|
+
"name": "getOrCreateDriver",
|
|
7111
|
+
"module": "src/state/driver-registry.ts"
|
|
7112
|
+
}
|
|
7113
|
+
},
|
|
7114
|
+
{
|
|
7115
|
+
"kind": "js",
|
|
7116
|
+
"name": "getDriver",
|
|
7117
|
+
"declaration": {
|
|
7118
|
+
"name": "getDriver",
|
|
7119
|
+
"module": "src/state/driver-registry.ts"
|
|
7120
|
+
}
|
|
7121
|
+
},
|
|
7122
|
+
{
|
|
7123
|
+
"kind": "js",
|
|
7124
|
+
"name": "getDriverAgentsKey",
|
|
7125
|
+
"declaration": {
|
|
7126
|
+
"name": "getDriverAgentsKey",
|
|
7127
|
+
"module": "src/state/driver-registry.ts"
|
|
7128
|
+
}
|
|
7299
7129
|
},
|
|
7130
|
+
{
|
|
7131
|
+
"kind": "js",
|
|
7132
|
+
"name": "deleteDriver",
|
|
7133
|
+
"declaration": {
|
|
7134
|
+
"name": "deleteDriver",
|
|
7135
|
+
"module": "src/state/driver-registry.ts"
|
|
7136
|
+
}
|
|
7137
|
+
}
|
|
7138
|
+
]
|
|
7139
|
+
},
|
|
7140
|
+
{
|
|
7141
|
+
"kind": "javascript-module",
|
|
7142
|
+
"path": "src/state/interaction-context.ts",
|
|
7143
|
+
"declarations": [],
|
|
7144
|
+
"exports": []
|
|
7145
|
+
},
|
|
7146
|
+
{
|
|
7147
|
+
"kind": "javascript-module",
|
|
7148
|
+
"path": "src/state/session-store.ts",
|
|
7149
|
+
"declarations": [
|
|
7300
7150
|
{
|
|
7301
7151
|
"kind": "function",
|
|
7302
|
-
"name": "
|
|
7152
|
+
"name": "getSessionStore",
|
|
7303
7153
|
"return": {
|
|
7304
7154
|
"type": {
|
|
7305
|
-
"text": "
|
|
7155
|
+
"text": "SessionStoreReturn"
|
|
7306
7156
|
}
|
|
7307
7157
|
},
|
|
7308
7158
|
"parameters": [
|
|
7309
7159
|
{
|
|
7310
|
-
"name": "
|
|
7160
|
+
"name": "key",
|
|
7311
7161
|
"type": {
|
|
7312
7162
|
"text": "string"
|
|
7313
7163
|
}
|
|
7314
7164
|
},
|
|
7315
7165
|
{
|
|
7316
|
-
"name": "
|
|
7166
|
+
"name": "devTools",
|
|
7167
|
+
"optional": true,
|
|
7317
7168
|
"type": {
|
|
7318
|
-
"text": "
|
|
7169
|
+
"text": "boolean"
|
|
7319
7170
|
}
|
|
7320
7171
|
}
|
|
7321
7172
|
],
|
|
7322
|
-
"description": "
|
|
7173
|
+
"description": "Returns the session store for the given key, creating one if it does not\nalready exist. Omit `devTools` (or pass `undefined`) to defer to `isDev()`.\nPass `true` to force-enable or `false` to force-disable Redux DevTools."
|
|
7323
7174
|
},
|
|
7324
7175
|
{
|
|
7325
7176
|
"kind": "function",
|
|
7326
|
-
"name": "
|
|
7177
|
+
"name": "hasSessionStore",
|
|
7178
|
+
"return": {
|
|
7179
|
+
"type": {
|
|
7180
|
+
"text": "boolean"
|
|
7181
|
+
}
|
|
7182
|
+
},
|
|
7183
|
+
"parameters": [
|
|
7184
|
+
{
|
|
7185
|
+
"name": "key",
|
|
7186
|
+
"type": {
|
|
7187
|
+
"text": "string"
|
|
7188
|
+
}
|
|
7189
|
+
}
|
|
7190
|
+
],
|
|
7191
|
+
"description": "Returns true if a session store already exists for the given key."
|
|
7192
|
+
},
|
|
7193
|
+
{
|
|
7194
|
+
"kind": "function",
|
|
7195
|
+
"name": "deleteSessionStore",
|
|
7327
7196
|
"return": {
|
|
7328
7197
|
"type": {
|
|
7329
7198
|
"text": "void"
|
|
@@ -7337,328 +7206,459 @@
|
|
|
7337
7206
|
}
|
|
7338
7207
|
}
|
|
7339
7208
|
],
|
|
7340
|
-
"description": "
|
|
7341
|
-
},
|
|
7342
|
-
{
|
|
7343
|
-
"kind": "variable",
|
|
7344
|
-
"name": "DEBUG_LOG_README",
|
|
7345
|
-
"type": {
|
|
7346
|
-
"text": "readonly string[]"
|
|
7347
|
-
},
|
|
7348
|
-
"default": "[\n 'This is an exported debug log for the Genesis AI assistant. Read it top-to-bottom.',\n \"`sessionUsage` is what this session spent: `costUsd` (USD, provider-reported per request and summed, cache discounts already applied) plus the four TOKEN BUCKETS — `uncachedInputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`. Those four are disjoint and safe to add up for a total-tokens figure; the per-message fields further down are NOT (see kind:'message'). Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a big token count against a small cost means the prompt was mostly cache hits, not a missing charge. It covers sub-agent turns and spend a compaction banked, so for the CONVERSATION it is the authoritative total: prefer it over re-summing the timeline, which can be short by whatever the ring buffers evicted. The same figures appear under `meta.context`. It is as current as the snapshot it came from: the assistant's own download stamps a fresh one, but a log stitched by another tool can carry an older one — compare `meta.timestamp` with the last timeline entry, and if it is well behind, read these totals as historical and fall back to summing the timeline. One scope caveat: it is derived from the transcript, so it excludes billed calls that produced no message (a blank or refused attempt that was retried — see kind:'turn'.`usage`). Summing the turns can therefore come out HIGHER than this, and the difference is exactly that discarded spend, not a double-count.\",\n \"What 'session' means for those figures: the CURRENT conversation under this session key (a host-supplied per-project id, or the element id + header title when the host supplies none) — which is not necessarily everything in `timeline`. It is re-derived from the live transcript, so it spans page loads only when the chat is being remembered, and a Clear resets it to zero. `timeline` is append-only regardless: it keeps every page load and the pre-Clear conversation, with the session.cleared event as the boundary. So on a long-lived log, read these totals as the latest conversation's and the earlier sections as history — not as a total of the whole file.\",\n '`timeline` is the entire session as one array, already sorted chronologically by `timestamp` (ISO 8601). Every entry has a `kind`.',\n 'Timestamps are millisecond-resolution; entries that share the same millisecond are ordered by a fixed kind rank (event, then turn, then message), which is a heuristic and may not reflect exact causal order within that millisecond — e.g. a user message and the turn it triggered, or a final assistant message and its turn.end event, can appear in either order depending on whether they landed in the same millisecond. Read the logical structure of a turn rather than over-interpreting the micro-ordering of co-timestamped entries of different kinds.',\n \"kind:'message' — the conversation. `role` is user/assistant/tool/system-event/synthetic-user; `agentName` says which agent produced it; `toolCalls`/`toolResult`/`interaction` carry tool and widget activity; `inputTokens`/`outputTokens`/`cost` are per-message LLM usage, where `inputTokens` is the WHOLE prompt for that request and `cacheReadTokens`/`cacheWriteTokens` BREAK IT DOWN rather than add to it — uncached input is `inputTokens` minus those two, and adding the cache fields to `inputTokens` counts the prompt twice. The cache fields are absent on providers that report no cache split (Gemini reports reads only, since implicit caching bills no write) and on messages persisted before they existed, so read them as 0 when missing. Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a large token count at a small cost means the prompt was mostly cache hits. `externalCostUsd` is any non-LLM cost a widget reported for its own external service calls (folded into the session cost total alongside `cost`). On model-produced assistant messages, `model` is the concrete model id that generated it (e.g. 'gemini-2.5-flash-lite') and `providerName` is the registry slot it resolved under (e.g. a tier name like 'high'/'low', or the default); together they attribute the message — and any tool calls it carries — to an exact model even across a mid-session vendor/tier switch, where one slot name can map to different models before and after the switch. Both are undefined on any entry that is NOT an LLM response: non-assistant roles (user/tool/system-event) and 'synthetic-user' echoes; assistant interaction/widget entries (empty content carrying an `interaction` — a rendered widget, not a model turn); driver-authored assistant fallbacks (the timeout, repeated-malformed-call, and empty-response apology messages); and messages restored from a session persisted before these fields existed. One partial case: on a genuine model turn whose provider exposes no `getStatus` (or reports no model), `providerName` is still set but `model` alone is undefined. A 'synthetic-user' message is a display-only echo of an interaction outcome (e.g. the answer a widget reported): it renders on the user's side of the chat and `agentName` is the agent that created it, but it is never sent to the LLM — so it has no matching 'turn' and the model learns the outcome only from the corresponding tool result.\",\n \"Sub-agent messages appear inline. When a tool delegates to a sub-agent (via `requestSubAgent`), the sub-agent's whole conversation — its own assistant/tool messages, each with their own `content`/`thinking`/`toolCalls`/`toolResult` and per-message `model`/`providerName`/`inputTokens`/`outputTokens`/`cacheReadTokens`/`cacheWriteTokens`/`cost` — is hoisted into the timeline as ordinary kind:'message' entries, interleaved by timestamp right after the tool call that spawned them (so you read the delegation top-to-bottom). A hoisted entry is marked: `subAgentDepth` is its delegation depth (1 for a sub-agent, 2 for a sub-agent's sub-agent, …), `subAgentOf` is the id of the parent tool call that spawned it (correlates it back even when two sub-agents run in one parent turn), `subAgentName` is the sub-agent's own name, and `agentName` is rewritten to a `\\\"<parent> › <sub-agent>\\\"` breadcrumb (composing when nested, e.g. `\\\"UI Builder › Planner › Grounding\\\"`). The sub-agent's per-LLM-call snapshots also surface as kind:'turn' entries with an N-M `turnIndex`, and subagent.started/completed (or subagent.failed) events bracket the run. Per-message `cost` on hoisted entries is already part of the session total (it is summed from the un-flattened history), so summing the top-level timeline does NOT double-count.\",\n \"kind:'turn' — one LLM call. `turnIndex` is a string: a top-level turn is the bare counter ('0', '1', …); a sub-agent's turns are numbered under the parent turn that activated them ('3-1', '3-2', …, and a nested sub-agent contributes '3-2-1', …), and `agentName` names the agent that ran the turn. `systemPrompt` and `toolNames` are what the model saw. A systemPrompt of '<repeated — identical to turn N>' was byte-identical to turn N and de-duplicated; the full prompt is shown whenever it changes (often because a stateful agent advanced), so prompt evolution is visible.\",\n \"kind:'turn'.`model`/`providerName`/`provider` — which model ran that call: the concrete model id, the registry slot it resolved under (a tier name like 'high'/'low', or the default), and the vendor. Recorded per CALL, so an agent whose `provider` selector varies by state — a flow that plans on a high tier and executes on a low one — has every step attributed, including calls that produced no message. `model` is the SERVING model where the provider reports one, so a turn answered by a server-side fallback names the model that answered rather than the one requested; it always matches the `model` on the message that call produced. Absent when the provider exposes no `getStatus` and the transport stamped nothing.\",\n \"kind:'turn'.`usage` — what that ONE call cost, in the same four-bucket + `costUsd` shape as `sessionUsage`. Absent while a call is in flight and on providers that report no usage. This is the SAME money as the message the call produced, not extra money: never add turn usage to message usage, and read a turn plus its message as one charge. Its distinct value is the calls that produced NO message — a blank or refused response is billed and then discarded before the retry, so the turn entry is the only record of that spend, and a turn with `usage` but no message after it is exactly that. `costUsd: 0` alongside a nonzero token count means the provider reported no price, not that the call was free.\",\n \"kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.\",\n \"kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.\",\n \"Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.\",\n 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused/context-exhausted/ai-service-error, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, for context-exhausted the estimated contextTokens against the guard that stopped the turn plus the iterations reached — the driver ending a runaway tool loop at the edge of the context window rather than issuing a request the provider would reject, so the transcript survives intact and can still be compacted, for ai-service-error the code (one of AI_SERVICE_ERROR_CODES, e.g. NO_API_KEY) and the status the AI service answered with — its own text goes to the browser console only, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused/context_exhausted/ai_service_error; budget_exhausted and provider_refused are terminal for the PARENT turn too, and so is ai_service_error when the refusal is about the service rather than the request and came from the vendor the parent calls — the parent stops rather than calling the model again into the same wall; after context_exhausted the parent goes on, but its own next call is likely to stop on the same guard), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), routing.decided (ONE PER ROUTING DECISION — see its own paragraph below), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',\n 'Sub-agent meta events: a sub-agent\\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `\"<parent> › <sub-agent>\"` breadcrumb that composes when nested (e.g. `\"UI Builder › Planner › Grounding\"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\\'s span.',\n \"`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.\",\n 'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',\n \"kind:'event' type 'routing.decided' — how ONE turn was routed, emitted by the orchestrating driver before the agent runs (and again after every handoff). `decision` is why that agent was chosen: 'classified' (the classifier ran and picked one), 'no-match' (it ran and answered -1 — nothing listed covers the request), 'ballot-exhausted' (every eligible specialist had already handed off this turn, so the ballot was empty and NO call was made — distinct from 'no-match', where one ran and declined), 'pinned' (a user pin or an active stateful flow owned the turn, so no call was made), 'single-candidate'/'no-specialists' (configuration left nothing to decide), 'provider-unavailable' (the registry default exposes no chat()), 'classifier-failed' (every attempt threw — `error` carries the last one). `to` names the agent and `fallback` says whether that agent is the fallback. `candidates` is what was actually ON THE BALLOT, in ballot order, so `index` — the classifier's own answer — indexes it directly; `excluded` names the specialists left off because they already handed off this turn, so the full eligible set is `candidates` ∪ `excluded`. `candidates` is absent on the four decisions that put nothing to a vote — 'pinned', 'single-candidate', 'no-specialists', 'ballot-exhausted'. It IS present on 'provider-unavailable', which is not an exception worth removing: the ballot was built there, it simply never got sent. `attempts` covers the retry ladder. `durationMs` is on EVERY routing.decided, and is the field to read when a decision looks wrong: the four decisions that can reach the fallback are told apart by the clock as much as by their name, because a fallback routing that resolved in tens of milliseconds made no network call at all whatever its `decision` says.\",\n \"kind:'event' type 'routing.decided'.`usage` — what that classifier call cost, in the same four-bucket + costUsd shape as `sessionUsage`, plus `model`. Absent on the decisions that make no call (see 'pinned' and the configuration ones). THIS SPEND IS NOT IN `sessionUsage`: a classifier call never enters the transcript and `sessionUsage` is derived from the transcript, so classifier cost is missing from the session total by construction, not by accident. Sum these events to close that gap — it is the one component of a session's real spend that the totals cannot see.\",\n 'To debug a failure: find the last turn.error or tool.failed, then read upward for the user message, the turn(s), and the agent/provider/state events that led into it. For a turn that went to the wrong agent, read its routing.decided first — `decision` says whether anything was actually asked.',\n]",
|
|
7349
|
-
"description": "Human/agent-facing guide emitted as the first key of the exported debug log,\nso whoever opens the JSON (often an AI agent) knows how to read it without\nreverse-engineering the shape. Kept here next to the event catalogue it\ndescribes — but proximity alone demonstrably did NOT keep the two in sync\n(`refusal` was missing from both reason lists for a whole release), so\n`debug-event-log.test.ts` now asserts that every `TurnFailureReason` and every\n`SubAgentFailureReason` is named here, and fails the build when one is added\nwithout a matching sentence. Enumerations below read as exhaustive and WILL be\ntrusted by an agent reading the JSON — keep them so."
|
|
7209
|
+
"description": "Deletes the session store for the given key."
|
|
7350
7210
|
}
|
|
7351
7211
|
],
|
|
7352
7212
|
"exports": [
|
|
7353
7213
|
{
|
|
7354
7214
|
"kind": "js",
|
|
7355
|
-
"name": "
|
|
7215
|
+
"name": "getSessionStore",
|
|
7356
7216
|
"declaration": {
|
|
7357
|
-
"name": "
|
|
7358
|
-
"module": "src/state/
|
|
7217
|
+
"name": "getSessionStore",
|
|
7218
|
+
"module": "src/state/session-store.ts"
|
|
7359
7219
|
}
|
|
7360
7220
|
},
|
|
7361
7221
|
{
|
|
7362
7222
|
"kind": "js",
|
|
7363
|
-
"name": "
|
|
7223
|
+
"name": "hasSessionStore",
|
|
7364
7224
|
"declaration": {
|
|
7365
|
-
"name": "
|
|
7366
|
-
"module": "src/state/
|
|
7225
|
+
"name": "hasSessionStore",
|
|
7226
|
+
"module": "src/state/session-store.ts"
|
|
7367
7227
|
}
|
|
7368
7228
|
},
|
|
7369
7229
|
{
|
|
7370
7230
|
"kind": "js",
|
|
7371
|
-
"name": "
|
|
7231
|
+
"name": "deleteSessionStore",
|
|
7372
7232
|
"declaration": {
|
|
7373
|
-
"name": "
|
|
7374
|
-
"module": "src/state/
|
|
7233
|
+
"name": "deleteSessionStore",
|
|
7234
|
+
"module": "src/state/session-store.ts"
|
|
7375
7235
|
}
|
|
7376
7236
|
},
|
|
7377
7237
|
{
|
|
7378
7238
|
"kind": "js",
|
|
7379
|
-
"name": "
|
|
7239
|
+
"name": "SessionStoreReturn",
|
|
7380
7240
|
"declaration": {
|
|
7381
|
-
"name": "
|
|
7382
|
-
"module": "src/state/
|
|
7241
|
+
"name": "SessionStoreReturn",
|
|
7242
|
+
"module": "src/state/session-store.ts"
|
|
7383
7243
|
}
|
|
7384
7244
|
},
|
|
7385
7245
|
{
|
|
7386
7246
|
"kind": "js",
|
|
7387
|
-
"name": "
|
|
7247
|
+
"name": "AiAssistantSessionState",
|
|
7388
7248
|
"declaration": {
|
|
7389
|
-
"name": "
|
|
7390
|
-
"module": "src/state/
|
|
7249
|
+
"name": "AiAssistantSessionState",
|
|
7250
|
+
"module": "src/state/session-store.ts"
|
|
7391
7251
|
}
|
|
7392
|
-
}
|
|
7252
|
+
}
|
|
7253
|
+
]
|
|
7254
|
+
},
|
|
7255
|
+
{
|
|
7256
|
+
"kind": "javascript-module",
|
|
7257
|
+
"path": "src/provider/ai-provider-switcher.ts",
|
|
7258
|
+
"declarations": [
|
|
7393
7259
|
{
|
|
7394
|
-
"kind": "
|
|
7395
|
-
"name": "
|
|
7396
|
-
"
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
},
|
|
7260
|
+
"kind": "variable",
|
|
7261
|
+
"name": "AIProviderSwitcher",
|
|
7262
|
+
"description": "The DI token for the (AIProviderSwitcher:interface). Resolves a noop until the app\nregisters one."
|
|
7263
|
+
}
|
|
7264
|
+
],
|
|
7265
|
+
"exports": [
|
|
7401
7266
|
{
|
|
7402
7267
|
"kind": "js",
|
|
7403
|
-
"name": "
|
|
7268
|
+
"name": "AIProviderSwitcher",
|
|
7404
7269
|
"declaration": {
|
|
7405
|
-
"name": "
|
|
7406
|
-
"module": "src/
|
|
7270
|
+
"name": "AIProviderSwitcher",
|
|
7271
|
+
"module": "src/provider/ai-provider-switcher.ts"
|
|
7407
7272
|
}
|
|
7408
|
-
}
|
|
7273
|
+
}
|
|
7274
|
+
]
|
|
7275
|
+
},
|
|
7276
|
+
{
|
|
7277
|
+
"kind": "javascript-module",
|
|
7278
|
+
"path": "src/provider/assistant-app-settings.ts",
|
|
7279
|
+
"declarations": [
|
|
7409
7280
|
{
|
|
7410
|
-
"kind": "
|
|
7411
|
-
"name": "
|
|
7412
|
-
"
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
},
|
|
7281
|
+
"kind": "variable",
|
|
7282
|
+
"name": "AssistantAppSettingsProvider",
|
|
7283
|
+
"description": "The DI token for the (AssistantAppSettingsProvider:interface). Resolves a noop\nuntil the host registers one."
|
|
7284
|
+
}
|
|
7285
|
+
],
|
|
7286
|
+
"exports": [
|
|
7417
7287
|
{
|
|
7418
7288
|
"kind": "js",
|
|
7419
|
-
"name": "
|
|
7289
|
+
"name": "AssistantAppSettingsProvider",
|
|
7420
7290
|
"declaration": {
|
|
7421
|
-
"name": "
|
|
7422
|
-
"module": "src/
|
|
7291
|
+
"name": "AssistantAppSettingsProvider",
|
|
7292
|
+
"module": "src/provider/assistant-app-settings.ts"
|
|
7423
7293
|
}
|
|
7424
7294
|
}
|
|
7425
7295
|
]
|
|
7426
7296
|
},
|
|
7427
7297
|
{
|
|
7428
7298
|
"kind": "javascript-module",
|
|
7429
|
-
"path": "src/
|
|
7299
|
+
"path": "src/provider/tiered-provider-switcher.ts",
|
|
7430
7300
|
"declarations": [
|
|
7431
7301
|
{
|
|
7432
|
-
"kind": "
|
|
7433
|
-
"
|
|
7434
|
-
"
|
|
7435
|
-
|
|
7436
|
-
"text": "AiDriver"
|
|
7437
|
-
}
|
|
7438
|
-
},
|
|
7439
|
-
"parameters": [
|
|
7302
|
+
"kind": "class",
|
|
7303
|
+
"description": "Which cloud vendor backs the tier-shaped provider registry, plus the means to move it at\nruntime (GENC-1610).",
|
|
7304
|
+
"name": "TieredAIProviderSwitcher",
|
|
7305
|
+
"members": [
|
|
7440
7306
|
{
|
|
7441
|
-
"
|
|
7307
|
+
"kind": "field",
|
|
7308
|
+
"name": "vendors",
|
|
7442
7309
|
"type": {
|
|
7443
|
-
"text": "
|
|
7444
|
-
}
|
|
7310
|
+
"text": "readonly AITierVendor[]"
|
|
7311
|
+
},
|
|
7312
|
+
"readonly": true
|
|
7445
7313
|
},
|
|
7446
7314
|
{
|
|
7447
|
-
"
|
|
7315
|
+
"kind": "field",
|
|
7316
|
+
"name": "options",
|
|
7448
7317
|
"type": {
|
|
7449
|
-
"text": "
|
|
7450
|
-
}
|
|
7318
|
+
"text": "TieredAIProviderSwitcherOptions"
|
|
7319
|
+
},
|
|
7320
|
+
"privacy": "private",
|
|
7321
|
+
"readonly": true,
|
|
7322
|
+
"default": "options"
|
|
7451
7323
|
},
|
|
7452
7324
|
{
|
|
7453
|
-
"
|
|
7325
|
+
"kind": "field",
|
|
7326
|
+
"name": "defaultTier",
|
|
7454
7327
|
"type": {
|
|
7455
|
-
"text": "
|
|
7456
|
-
}
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
"
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7328
|
+
"text": "AITierId"
|
|
7329
|
+
},
|
|
7330
|
+
"privacy": "private",
|
|
7331
|
+
"readonly": true
|
|
7332
|
+
},
|
|
7333
|
+
{
|
|
7334
|
+
"kind": "field",
|
|
7335
|
+
"name": "registry",
|
|
7336
|
+
"type": {
|
|
7337
|
+
"text": "MutableAIProviderRegistry"
|
|
7338
|
+
},
|
|
7339
|
+
"privacy": "private",
|
|
7340
|
+
"readonly": true
|
|
7341
|
+
},
|
|
7342
|
+
{
|
|
7343
|
+
"kind": "field",
|
|
7344
|
+
"name": "listeners",
|
|
7345
|
+
"privacy": "private",
|
|
7346
|
+
"readonly": true,
|
|
7347
|
+
"default": "new Set<(vendor: AITierVendor) => void>()"
|
|
7348
|
+
},
|
|
7349
|
+
{
|
|
7350
|
+
"kind": "field",
|
|
7351
|
+
"name": "_vendor",
|
|
7352
|
+
"type": {
|
|
7353
|
+
"text": "AITierVendor"
|
|
7354
|
+
},
|
|
7355
|
+
"privacy": "private"
|
|
7356
|
+
},
|
|
7357
|
+
{
|
|
7358
|
+
"kind": "field",
|
|
7359
|
+
"name": "vendor",
|
|
7360
|
+
"type": {
|
|
7361
|
+
"text": "AITierVendor"
|
|
7362
|
+
},
|
|
7363
|
+
"readonly": true
|
|
7364
|
+
},
|
|
7365
|
+
{
|
|
7366
|
+
"kind": "method",
|
|
7367
|
+
"name": "switchTo",
|
|
7368
|
+
"return": {
|
|
7369
|
+
"type": {
|
|
7370
|
+
"text": "void"
|
|
7371
|
+
}
|
|
7372
|
+
},
|
|
7373
|
+
"parameters": [
|
|
7374
|
+
{
|
|
7375
|
+
"name": "vendor",
|
|
7376
|
+
"type": {
|
|
7377
|
+
"text": "string"
|
|
7378
|
+
}
|
|
7379
|
+
}
|
|
7380
|
+
],
|
|
7381
|
+
"description": "A user-driven switch: move the registry, then tell the app so it can persist the choice.\nAn unknown vendor is ignored."
|
|
7382
|
+
},
|
|
7383
|
+
{
|
|
7384
|
+
"kind": "method",
|
|
7385
|
+
"name": "adoptPersistedVendor",
|
|
7386
|
+
"return": {
|
|
7387
|
+
"type": {
|
|
7388
|
+
"text": "void"
|
|
7389
|
+
}
|
|
7390
|
+
},
|
|
7391
|
+
"parameters": [
|
|
7392
|
+
{
|
|
7393
|
+
"name": "vendor",
|
|
7394
|
+
"type": {
|
|
7395
|
+
"text": "string"
|
|
7396
|
+
}
|
|
7397
|
+
}
|
|
7398
|
+
],
|
|
7399
|
+
"description": "Adopt a vendor the app read back from its own store — the same registry move as\nTieredAIProviderSwitcher.switchTo, without the `onSwitch` callback, because this\nvalue came FROM the store and writing it back would be a pointless round-trip on load.\n\nExists because registration has to stay synchronous: an element that connects before the\ntoken is registered caches the platform's no-op fallback, so an app cannot await its\nstored preference before constructing this. It boots on `initialVendor` and adopts the\nstored one a moment later, through a registry that is mutable and held by reference."
|
|
7400
|
+
},
|
|
7401
|
+
{
|
|
7402
|
+
"kind": "method",
|
|
7403
|
+
"name": "subscribe",
|
|
7404
|
+
"return": {
|
|
7405
|
+
"type": {
|
|
7406
|
+
"text": "() => void"
|
|
7407
|
+
}
|
|
7408
|
+
},
|
|
7409
|
+
"parameters": [
|
|
7410
|
+
{
|
|
7411
|
+
"name": "listener",
|
|
7412
|
+
"type": {
|
|
7413
|
+
"text": "(vendor: string) => void"
|
|
7414
|
+
}
|
|
7415
|
+
}
|
|
7416
|
+
]
|
|
7417
|
+
},
|
|
7418
|
+
{
|
|
7419
|
+
"kind": "method",
|
|
7420
|
+
"name": "apply",
|
|
7421
|
+
"privacy": "private",
|
|
7422
|
+
"return": {
|
|
7423
|
+
"type": {
|
|
7424
|
+
"text": "void"
|
|
7425
|
+
}
|
|
7426
|
+
},
|
|
7427
|
+
"parameters": [
|
|
7428
|
+
{
|
|
7429
|
+
"name": "vendor",
|
|
7430
|
+
"type": {
|
|
7431
|
+
"text": "AITierVendor"
|
|
7432
|
+
}
|
|
7433
|
+
}
|
|
7434
|
+
],
|
|
7435
|
+
"description": "The registry move both entry points share, and nothing else."
|
|
7436
|
+
},
|
|
7437
|
+
{
|
|
7438
|
+
"kind": "method",
|
|
7439
|
+
"name": "build",
|
|
7440
|
+
"privacy": "private",
|
|
7441
|
+
"return": {
|
|
7442
|
+
"type": {
|
|
7443
|
+
"text": "Record<string, AIProvider>"
|
|
7444
|
+
}
|
|
7445
|
+
},
|
|
7446
|
+
"parameters": [
|
|
7447
|
+
{
|
|
7448
|
+
"name": "vendor",
|
|
7449
|
+
"type": {
|
|
7450
|
+
"text": "AITierVendor"
|
|
7451
|
+
}
|
|
7452
|
+
}
|
|
7453
|
+
]
|
|
7454
|
+
},
|
|
7470
7455
|
{
|
|
7471
|
-
"
|
|
7472
|
-
"
|
|
7473
|
-
|
|
7474
|
-
|
|
7456
|
+
"kind": "method",
|
|
7457
|
+
"name": "isKnownVendor",
|
|
7458
|
+
"privacy": "private",
|
|
7459
|
+
"return": {
|
|
7460
|
+
"type": {
|
|
7461
|
+
"text": "vendor is AITierVendor"
|
|
7462
|
+
}
|
|
7463
|
+
},
|
|
7464
|
+
"parameters": [
|
|
7465
|
+
{
|
|
7466
|
+
"name": "vendor",
|
|
7467
|
+
"type": {
|
|
7468
|
+
"text": "string"
|
|
7469
|
+
}
|
|
7470
|
+
}
|
|
7471
|
+
]
|
|
7475
7472
|
}
|
|
7476
|
-
]
|
|
7477
|
-
"description": "Returns the existing driver for the given key, or `undefined`."
|
|
7473
|
+
]
|
|
7478
7474
|
},
|
|
7479
7475
|
{
|
|
7480
7476
|
"kind": "function",
|
|
7481
|
-
"name": "
|
|
7477
|
+
"name": "registerTieredAIProviders",
|
|
7482
7478
|
"return": {
|
|
7483
7479
|
"type": {
|
|
7484
|
-
"text": "
|
|
7480
|
+
"text": "TieredAIProviderSwitcher"
|
|
7485
7481
|
}
|
|
7486
7482
|
},
|
|
7487
7483
|
"parameters": [
|
|
7488
7484
|
{
|
|
7489
|
-
"name": "
|
|
7485
|
+
"name": "container",
|
|
7490
7486
|
"type": {
|
|
7491
|
-
"text": "
|
|
7487
|
+
"text": "Container"
|
|
7492
7488
|
}
|
|
7493
|
-
}
|
|
7494
|
-
],
|
|
7495
|
-
"description": "The agents fingerprint the registry driver for `key` was built with, or\n`undefined` if no driver is registered. Used by `agentsChanged` to decide\nwhether a sibling has already rebuilt the shared driver to the desired agents."
|
|
7496
|
-
},
|
|
7497
|
-
{
|
|
7498
|
-
"kind": "function",
|
|
7499
|
-
"name": "deleteDriver",
|
|
7500
|
-
"return": {
|
|
7501
|
-
"type": {
|
|
7502
|
-
"text": "AiDriver | undefined"
|
|
7503
|
-
}
|
|
7504
|
-
},
|
|
7505
|
-
"parameters": [
|
|
7489
|
+
},
|
|
7506
7490
|
{
|
|
7507
|
-
"name": "
|
|
7491
|
+
"name": "options",
|
|
7508
7492
|
"type": {
|
|
7509
|
-
"text": "
|
|
7493
|
+
"text": "Omit<TieredAIProviderSwitcherOptions, 'container'>"
|
|
7510
7494
|
}
|
|
7511
7495
|
}
|
|
7512
7496
|
],
|
|
7513
|
-
"description": "
|
|
7497
|
+
"description": "Build a TieredAIProviderSwitcher — which registers the tier-shaped provider\nregistry — and put it on the (AIProviderSwitcher:variable) token. Call once at app\nbootstrap."
|
|
7514
7498
|
}
|
|
7515
7499
|
],
|
|
7516
7500
|
"exports": [
|
|
7517
7501
|
{
|
|
7518
7502
|
"kind": "js",
|
|
7519
|
-
"name": "
|
|
7520
|
-
"declaration": {
|
|
7521
|
-
"name": "getOrCreateDriver",
|
|
7522
|
-
"module": "src/state/driver-registry.ts"
|
|
7523
|
-
}
|
|
7524
|
-
},
|
|
7525
|
-
{
|
|
7526
|
-
"kind": "js",
|
|
7527
|
-
"name": "getDriver",
|
|
7528
|
-
"declaration": {
|
|
7529
|
-
"name": "getDriver",
|
|
7530
|
-
"module": "src/state/driver-registry.ts"
|
|
7531
|
-
}
|
|
7532
|
-
},
|
|
7533
|
-
{
|
|
7534
|
-
"kind": "js",
|
|
7535
|
-
"name": "getDriverAgentsKey",
|
|
7503
|
+
"name": "TieredAIProviderSwitcher",
|
|
7536
7504
|
"declaration": {
|
|
7537
|
-
"name": "
|
|
7538
|
-
"module": "src/
|
|
7505
|
+
"name": "TieredAIProviderSwitcher",
|
|
7506
|
+
"module": "src/provider/tiered-provider-switcher.ts"
|
|
7539
7507
|
}
|
|
7540
7508
|
},
|
|
7541
7509
|
{
|
|
7542
7510
|
"kind": "js",
|
|
7543
|
-
"name": "
|
|
7511
|
+
"name": "registerTieredAIProviders",
|
|
7544
7512
|
"declaration": {
|
|
7545
|
-
"name": "
|
|
7546
|
-
"module": "src/
|
|
7513
|
+
"name": "registerTieredAIProviders",
|
|
7514
|
+
"module": "src/provider/tiered-provider-switcher.ts"
|
|
7547
7515
|
}
|
|
7548
7516
|
}
|
|
7549
7517
|
]
|
|
7550
7518
|
},
|
|
7551
7519
|
{
|
|
7552
7520
|
"kind": "javascript-module",
|
|
7553
|
-
"path": "src/
|
|
7554
|
-
"declarations": [],
|
|
7555
|
-
"exports": []
|
|
7556
|
-
},
|
|
7557
|
-
{
|
|
7558
|
-
"kind": "javascript-module",
|
|
7559
|
-
"path": "src/state/session-store.ts",
|
|
7521
|
+
"path": "src/styles/ai-colours.ts",
|
|
7560
7522
|
"declarations": [
|
|
7561
7523
|
{
|
|
7562
|
-
"kind": "
|
|
7563
|
-
"name": "
|
|
7564
|
-
"
|
|
7565
|
-
"
|
|
7566
|
-
"text": "SessionStoreReturn"
|
|
7567
|
-
}
|
|
7524
|
+
"kind": "variable",
|
|
7525
|
+
"name": "AI_COLOUR_AMBER",
|
|
7526
|
+
"type": {
|
|
7527
|
+
"text": "string"
|
|
7568
7528
|
},
|
|
7569
|
-
"
|
|
7570
|
-
|
|
7571
|
-
"name": "key",
|
|
7572
|
-
"type": {
|
|
7573
|
-
"text": "string"
|
|
7574
|
-
}
|
|
7575
|
-
},
|
|
7576
|
-
{
|
|
7577
|
-
"name": "devTools",
|
|
7578
|
-
"optional": true,
|
|
7579
|
-
"type": {
|
|
7580
|
-
"text": "boolean"
|
|
7581
|
-
}
|
|
7582
|
-
}
|
|
7583
|
-
],
|
|
7584
|
-
"description": "Returns the session store for the given key, creating one if it does not\nalready exist. Omit `devTools` (or pass `undefined`) to defer to `isDev()`.\nPass `true` to force-enable or `false` to force-disable Redux DevTools."
|
|
7529
|
+
"default": "'#feb60a'",
|
|
7530
|
+
"description": "Shared brand colours used across the AI animation effects\n(halo overlay border/glow and loading dot indicators).\nDefined once here so both stay in sync."
|
|
7585
7531
|
},
|
|
7586
7532
|
{
|
|
7587
|
-
"kind": "
|
|
7588
|
-
"name": "
|
|
7589
|
-
"
|
|
7590
|
-
"
|
|
7591
|
-
"text": "boolean"
|
|
7592
|
-
}
|
|
7533
|
+
"kind": "variable",
|
|
7534
|
+
"name": "AI_COLOUR_PINK",
|
|
7535
|
+
"type": {
|
|
7536
|
+
"text": "string"
|
|
7593
7537
|
},
|
|
7594
|
-
"
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
"
|
|
7538
|
+
"default": "'#ff0062'"
|
|
7539
|
+
},
|
|
7540
|
+
{
|
|
7541
|
+
"kind": "variable",
|
|
7542
|
+
"name": "AI_COLOUR_CYAN",
|
|
7543
|
+
"type": {
|
|
7544
|
+
"text": "string"
|
|
7545
|
+
},
|
|
7546
|
+
"default": "'#00dbf9'"
|
|
7547
|
+
},
|
|
7548
|
+
{
|
|
7549
|
+
"kind": "variable",
|
|
7550
|
+
"name": "AI_COLOUR_VIOLET",
|
|
7551
|
+
"type": {
|
|
7552
|
+
"text": "string"
|
|
7553
|
+
},
|
|
7554
|
+
"default": "'#da00f7'"
|
|
7555
|
+
},
|
|
7556
|
+
{
|
|
7557
|
+
"kind": "variable",
|
|
7558
|
+
"name": "PIN_COLOURS",
|
|
7559
|
+
"type": {
|
|
7560
|
+
"text": "[\n AI_COLOUR_AMBER,\n AI_COLOUR_PINK,\n AI_COLOUR_CYAN,\n AI_COLOUR_VIOLET,\n]"
|
|
7561
|
+
},
|
|
7562
|
+
"default": "[\n AI_COLOUR_AMBER,\n AI_COLOUR_PINK,\n AI_COLOUR_CYAN,\n AI_COLOUR_VIOLET,\n]",
|
|
7563
|
+
"description": "Pin tint palette, cycled by an agent's position in the assistant's `agents`\narray. Lives here beside the other brand colours because two components need\nit: the composer's agent button tints its pin with the ACTIVE agent's colour,\nand the picker menu tints every row's dot — and those two have to agree, so\nthey read the same list and index it the same way."
|
|
7603
7564
|
},
|
|
7604
7565
|
{
|
|
7605
7566
|
"kind": "function",
|
|
7606
|
-
"name": "
|
|
7567
|
+
"name": "pinColourAt",
|
|
7607
7568
|
"return": {
|
|
7608
7569
|
"type": {
|
|
7609
|
-
"text": "
|
|
7570
|
+
"text": "string | undefined"
|
|
7610
7571
|
}
|
|
7611
7572
|
},
|
|
7612
7573
|
"parameters": [
|
|
7613
7574
|
{
|
|
7614
|
-
"name": "
|
|
7575
|
+
"name": "index",
|
|
7615
7576
|
"type": {
|
|
7616
|
-
"text": "
|
|
7577
|
+
"text": "number"
|
|
7617
7578
|
}
|
|
7618
7579
|
}
|
|
7619
7580
|
],
|
|
7620
|
-
"description": "
|
|
7581
|
+
"description": "The tint for the agent at `index` in the full agents array, or `undefined`\nwhen the index is out of range (an unknown or stale agent name)."
|
|
7621
7582
|
}
|
|
7622
7583
|
],
|
|
7623
7584
|
"exports": [
|
|
7624
7585
|
{
|
|
7625
7586
|
"kind": "js",
|
|
7626
|
-
"name": "
|
|
7587
|
+
"name": "AI_COLOUR_AMBER",
|
|
7627
7588
|
"declaration": {
|
|
7628
|
-
"name": "
|
|
7629
|
-
"module": "src/
|
|
7589
|
+
"name": "AI_COLOUR_AMBER",
|
|
7590
|
+
"module": "src/styles/ai-colours.ts"
|
|
7630
7591
|
}
|
|
7631
7592
|
},
|
|
7632
7593
|
{
|
|
7633
7594
|
"kind": "js",
|
|
7634
|
-
"name": "
|
|
7595
|
+
"name": "AI_COLOUR_PINK",
|
|
7635
7596
|
"declaration": {
|
|
7636
|
-
"name": "
|
|
7637
|
-
"module": "src/
|
|
7597
|
+
"name": "AI_COLOUR_PINK",
|
|
7598
|
+
"module": "src/styles/ai-colours.ts"
|
|
7638
7599
|
}
|
|
7639
7600
|
},
|
|
7640
7601
|
{
|
|
7641
7602
|
"kind": "js",
|
|
7642
|
-
"name": "
|
|
7603
|
+
"name": "AI_COLOUR_CYAN",
|
|
7643
7604
|
"declaration": {
|
|
7644
|
-
"name": "
|
|
7645
|
-
"module": "src/
|
|
7605
|
+
"name": "AI_COLOUR_CYAN",
|
|
7606
|
+
"module": "src/styles/ai-colours.ts"
|
|
7646
7607
|
}
|
|
7647
7608
|
},
|
|
7648
7609
|
{
|
|
7649
7610
|
"kind": "js",
|
|
7650
|
-
"name": "
|
|
7611
|
+
"name": "AI_COLOUR_VIOLET",
|
|
7651
7612
|
"declaration": {
|
|
7652
|
-
"name": "
|
|
7653
|
-
"module": "src/
|
|
7613
|
+
"name": "AI_COLOUR_VIOLET",
|
|
7614
|
+
"module": "src/styles/ai-colours.ts"
|
|
7654
7615
|
}
|
|
7655
7616
|
},
|
|
7656
7617
|
{
|
|
7657
7618
|
"kind": "js",
|
|
7658
|
-
"name": "
|
|
7619
|
+
"name": "PIN_COLOURS",
|
|
7659
7620
|
"declaration": {
|
|
7660
|
-
"name": "
|
|
7661
|
-
"module": "src/
|
|
7621
|
+
"name": "PIN_COLOURS",
|
|
7622
|
+
"module": "src/styles/ai-colours.ts"
|
|
7623
|
+
}
|
|
7624
|
+
},
|
|
7625
|
+
{
|
|
7626
|
+
"kind": "js",
|
|
7627
|
+
"name": "pinColourAt",
|
|
7628
|
+
"declaration": {
|
|
7629
|
+
"name": "pinColourAt",
|
|
7630
|
+
"module": "src/styles/ai-colours.ts"
|
|
7631
|
+
}
|
|
7632
|
+
}
|
|
7633
|
+
]
|
|
7634
|
+
},
|
|
7635
|
+
{
|
|
7636
|
+
"kind": "javascript-module",
|
|
7637
|
+
"path": "src/styles/menu.ts",
|
|
7638
|
+
"declarations": [],
|
|
7639
|
+
"exports": []
|
|
7640
|
+
},
|
|
7641
|
+
{
|
|
7642
|
+
"kind": "javascript-module",
|
|
7643
|
+
"path": "src/styles/settings-section.ts",
|
|
7644
|
+
"declarations": [
|
|
7645
|
+
{
|
|
7646
|
+
"kind": "variable",
|
|
7647
|
+
"name": "assistantSettingsSectionTitleStyles",
|
|
7648
|
+
"type": {
|
|
7649
|
+
"text": "ElementStyles"
|
|
7650
|
+
},
|
|
7651
|
+
"default": "css`\n .ai-settings-section-title {\n display: flex;\n align-items: center;\n gap: calc(var(--design-unit) * 2px);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--neutral-foreground-hint);\n }\n`",
|
|
7652
|
+
"description": "Heading style for a settings-modal section, published so a host can title its own section.\n\nThe assistant renders no heading for the `settings-app` slot — no text and no icon — because\nonly the host knows what that section is. The consequence is that a host supplying one has to\nreproduce the styling of the built-in headings beside it, and a copied rule drifts the moment\neither side changes. So the declarations live here, are applied by the assistant's own\nheadings, and are exported for the host to apply to its.\n\nCompose it into a component's styles and put `ai-settings-section-title` on the heading:\n\n```ts\nimport { assistantSettingsSectionTitleStyles } from '@genesislcap/ai-assistant';\n\nconst styles = css`\n ${assistantSettingsSectionTitleStyles}\n :host { display: block; }\n`;\n```\n\nCarries no margin on purpose: spacing belongs to the surrounding layout, which differs\nbetween the assistant's own sections and a slotted one, and is the single declaration hosts\nhad to diverge on when they copied this rule."
|
|
7653
|
+
}
|
|
7654
|
+
],
|
|
7655
|
+
"exports": [
|
|
7656
|
+
{
|
|
7657
|
+
"kind": "js",
|
|
7658
|
+
"name": "assistantSettingsSectionTitleStyles",
|
|
7659
|
+
"declaration": {
|
|
7660
|
+
"name": "assistantSettingsSectionTitleStyles",
|
|
7661
|
+
"module": "src/styles/settings-section.ts"
|
|
7662
7662
|
}
|
|
7663
7663
|
}
|
|
7664
7664
|
]
|