@genesislcap/ai-assistant 15.24.2 → 15.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-assistant.api.json +1065 -33
- package/dist/ai-assistant.d.ts +288 -102
- package/dist/chat-driver.cjs +630 -378
- package/dist/chat-driver.cjs.map +4 -4
- package/dist/chat-driver.mjs +630 -378
- package/dist/chat-driver.mjs.map +4 -4
- package/dist/custom-elements.json +1198 -388
- package/dist/dts/components/agent-session/agent-session.d.ts +134 -0
- package/dist/dts/components/agent-session/agent-session.d.ts.map +1 -0
- package/dist/dts/components/agent-session/index.d.ts +2 -0
- package/dist/dts/components/agent-session/index.d.ts.map +1 -0
- package/dist/dts/components/ai-driver/ai-driver.d.ts +31 -4
- package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.constants.d.ts +52 -0
- package/dist/dts/components/chat-driver/chat-driver.constants.d.ts.map +1 -0
- package/dist/dts/components/chat-driver/chat-driver.d.ts +100 -82
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/fold-controller.d.ts +82 -0
- package/dist/dts/components/chat-driver/fold-controller.d.ts.map +1 -0
- package/dist/dts/components/chat-driver/turn-failures.d.ts +20 -1
- package/dist/dts/components/chat-driver/turn-failures.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +14 -24
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +6 -16
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/suggestions/generate-suggestions.d.ts +35 -0
- package/dist/dts/suggestions/generate-suggestions.d.ts.map +1 -0
- package/dist/dts/utils/agents-key.d.ts +10 -0
- package/dist/dts/utils/agents-key.d.ts.map +1 -0
- package/dist/dts/utils/resolve-turn-input.d.ts +9 -0
- package/dist/dts/utils/resolve-turn-input.d.ts.map +1 -0
- package/dist/esm/components/agent-session/agent-session.js +208 -0
- package/dist/esm/components/agent-session/index.js +1 -0
- package/dist/esm/components/chat-driver/chat-driver.constants.js +72 -0
- package/dist/esm/components/chat-driver/chat-driver.js +190 -395
- package/dist/esm/components/chat-driver/fold-controller.js +184 -0
- package/dist/esm/components/chat-driver/turn-failures.js +14 -0
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +48 -131
- package/dist/esm/index.js +1 -0
- package/dist/esm/main/main.js +11 -38
- package/dist/esm/suggestions/generate-suggestions.js +123 -0
- package/dist/esm/utils/agents-key.js +24 -0
- package/dist/esm/utils/resolve-turn-input.js +16 -0
- package/docs/migration-GENC-1580.md +44 -36
- package/package.json +16 -16
|
@@ -574,6 +574,14 @@
|
|
|
574
574
|
"package": "./components/agent-picker"
|
|
575
575
|
}
|
|
576
576
|
},
|
|
577
|
+
{
|
|
578
|
+
"kind": "js",
|
|
579
|
+
"name": "*",
|
|
580
|
+
"declaration": {
|
|
581
|
+
"name": "*",
|
|
582
|
+
"package": "./components/agent-session"
|
|
583
|
+
}
|
|
584
|
+
},
|
|
577
585
|
{
|
|
578
586
|
"kind": "js",
|
|
579
587
|
"name": "*",
|
|
@@ -2508,7 +2516,7 @@
|
|
|
2508
2516
|
"type": {
|
|
2509
2517
|
"text": "number"
|
|
2510
2518
|
},
|
|
2511
|
-
"description": "Aggregated USD cost across every chat turn in this session.\n\nRead-only
|
|
2519
|
+
"description": "Aggregated USD cost across every chat turn in this session.\n\nRead-only: a projection of `sessionUsage`, so an assigned figure would be overwritten by\nthe next transcript change.",
|
|
2512
2520
|
"readonly": true
|
|
2513
2521
|
},
|
|
2514
2522
|
{
|
|
@@ -2977,7 +2985,7 @@
|
|
|
2977
2985
|
"text": "OrchestratingDriver | undefined"
|
|
2978
2986
|
},
|
|
2979
2987
|
"privacy": "private",
|
|
2980
|
-
"description": "This element's driver as an orchestrator, or `undefined` when the session is
|
|
2988
|
+
"description": "This element's driver as an orchestrator, or `undefined` when the session is running a bare\n`ChatDriver`. The only place in this element that narrows the type; the test itself lives in\n`asOrchestrator`, shared with the session persister.",
|
|
2981
2989
|
"readonly": true
|
|
2982
2990
|
},
|
|
2983
2991
|
{
|
|
@@ -3289,26 +3297,6 @@
|
|
|
3289
3297
|
}
|
|
3290
3298
|
}
|
|
3291
3299
|
},
|
|
3292
|
-
{
|
|
3293
|
-
"kind": "method",
|
|
3294
|
-
"name": "getAgentsKey",
|
|
3295
|
-
"privacy": "private",
|
|
3296
|
-
"return": {
|
|
3297
|
-
"type": {
|
|
3298
|
-
"text": "string"
|
|
3299
|
-
}
|
|
3300
|
-
},
|
|
3301
|
-
"parameters": [
|
|
3302
|
-
{
|
|
3303
|
-
"name": "agents",
|
|
3304
|
-
"optional": true,
|
|
3305
|
-
"type": {
|
|
3306
|
-
"text": "AgentConfig[]"
|
|
3307
|
-
}
|
|
3308
|
-
}
|
|
3309
|
-
],
|
|
3310
|
-
"description": "Returns a stable fingerprint for an agents array based on agent names and tool handler keys."
|
|
3311
|
-
},
|
|
3312
3300
|
{
|
|
3313
3301
|
"kind": "method",
|
|
3314
3302
|
"name": "warnUnreachableStatefulAgents",
|
|
@@ -3557,7 +3545,7 @@
|
|
|
3557
3545
|
"text": "void"
|
|
3558
3546
|
}
|
|
3559
3547
|
},
|
|
3560
|
-
"description": "
|
|
3548
|
+
"description": "Transcript side effects, called from the `messages` setter after it dispatches to the store."
|
|
3561
3549
|
},
|
|
3562
3550
|
{
|
|
3563
3551
|
"kind": "method",
|
|
@@ -5699,6 +5687,161 @@
|
|
|
5699
5687
|
}
|
|
5700
5688
|
]
|
|
5701
5689
|
},
|
|
5690
|
+
{
|
|
5691
|
+
"kind": "javascript-module",
|
|
5692
|
+
"path": "src/suggestions/generate-suggestions.ts",
|
|
5693
|
+
"declarations": [
|
|
5694
|
+
{
|
|
5695
|
+
"kind": "variable",
|
|
5696
|
+
"name": "SUGGESTIONS_SYSTEM_PROMPT",
|
|
5697
|
+
"description": "The system prompt sets the role only.\n\nConcrete instructions live in the user message *after* the transcript, so the context\nimmediately preceding the model is \"here is data, now do X\" rather than \"here is a dialogue,\ncontinue it\". This matters for Anthropic — without it, Claude reads the transcript as an\nin-progress conversation and produces a normal assistant turn instead of a list."
|
|
5698
|
+
},
|
|
5699
|
+
{
|
|
5700
|
+
"kind": "function",
|
|
5701
|
+
"name": "buildSuggestionsPrompt",
|
|
5702
|
+
"return": {
|
|
5703
|
+
"type": {
|
|
5704
|
+
"text": "string"
|
|
5705
|
+
}
|
|
5706
|
+
},
|
|
5707
|
+
"parameters": [
|
|
5708
|
+
{
|
|
5709
|
+
"name": "ctx",
|
|
5710
|
+
"type": {
|
|
5711
|
+
"text": "SuggestionsContext"
|
|
5712
|
+
}
|
|
5713
|
+
},
|
|
5714
|
+
{
|
|
5715
|
+
"name": "history",
|
|
5716
|
+
"type": {
|
|
5717
|
+
"text": "ChatMessage[]"
|
|
5718
|
+
}
|
|
5719
|
+
},
|
|
5720
|
+
{
|
|
5721
|
+
"name": "prompt",
|
|
5722
|
+
"type": {
|
|
5723
|
+
"text": "string"
|
|
5724
|
+
}
|
|
5725
|
+
},
|
|
5726
|
+
{
|
|
5727
|
+
"name": "count",
|
|
5728
|
+
"type": {
|
|
5729
|
+
"text": "number"
|
|
5730
|
+
}
|
|
5731
|
+
},
|
|
5732
|
+
{
|
|
5733
|
+
"name": "allAgentInfo",
|
|
5734
|
+
"optional": true,
|
|
5735
|
+
"type": {
|
|
5736
|
+
"text": "AllAgentSummary[]"
|
|
5737
|
+
}
|
|
5738
|
+
}
|
|
5739
|
+
],
|
|
5740
|
+
"description": "Build the user message: starter prompts for an empty transcript, follow-ups otherwise."
|
|
5741
|
+
},
|
|
5742
|
+
{
|
|
5743
|
+
"kind": "function",
|
|
5744
|
+
"name": "parseSuggestions",
|
|
5745
|
+
"return": {
|
|
5746
|
+
"type": {
|
|
5747
|
+
"text": "string[]"
|
|
5748
|
+
}
|
|
5749
|
+
},
|
|
5750
|
+
"parameters": [
|
|
5751
|
+
{
|
|
5752
|
+
"name": "text",
|
|
5753
|
+
"type": {
|
|
5754
|
+
"text": "string"
|
|
5755
|
+
}
|
|
5756
|
+
},
|
|
5757
|
+
{
|
|
5758
|
+
"name": "count",
|
|
5759
|
+
"type": {
|
|
5760
|
+
"text": "number"
|
|
5761
|
+
}
|
|
5762
|
+
}
|
|
5763
|
+
],
|
|
5764
|
+
"description": "Lenient parsing, as a backstop: even with the strict format above, models slip in numbering,\nbullets or surrounding markdown."
|
|
5765
|
+
},
|
|
5766
|
+
{
|
|
5767
|
+
"kind": "function",
|
|
5768
|
+
"name": "generateSuggestions",
|
|
5769
|
+
"return": {
|
|
5770
|
+
"type": {
|
|
5771
|
+
"text": "Promise<string[]>"
|
|
5772
|
+
}
|
|
5773
|
+
},
|
|
5774
|
+
"parameters": [
|
|
5775
|
+
{
|
|
5776
|
+
"name": "ctx",
|
|
5777
|
+
"type": {
|
|
5778
|
+
"text": "SuggestionsContext"
|
|
5779
|
+
}
|
|
5780
|
+
},
|
|
5781
|
+
{
|
|
5782
|
+
"name": "history",
|
|
5783
|
+
"type": {
|
|
5784
|
+
"text": "ChatMessage[]"
|
|
5785
|
+
}
|
|
5786
|
+
},
|
|
5787
|
+
{
|
|
5788
|
+
"name": "prompt",
|
|
5789
|
+
"type": {
|
|
5790
|
+
"text": "string"
|
|
5791
|
+
}
|
|
5792
|
+
},
|
|
5793
|
+
{
|
|
5794
|
+
"name": "count",
|
|
5795
|
+
"type": {
|
|
5796
|
+
"text": "number"
|
|
5797
|
+
}
|
|
5798
|
+
},
|
|
5799
|
+
{
|
|
5800
|
+
"name": "allAgentInfo",
|
|
5801
|
+
"optional": true,
|
|
5802
|
+
"type": {
|
|
5803
|
+
"text": "AllAgentSummary[]"
|
|
5804
|
+
}
|
|
5805
|
+
}
|
|
5806
|
+
],
|
|
5807
|
+
"description": "Suggested prompts for the composer.\n\nBest-effort throughout: a default provider with no `prompt()` means no suggestions, not an\nerror, because this is an out-of-turn UI helper."
|
|
5808
|
+
}
|
|
5809
|
+
],
|
|
5810
|
+
"exports": [
|
|
5811
|
+
{
|
|
5812
|
+
"kind": "js",
|
|
5813
|
+
"name": "SUGGESTIONS_SYSTEM_PROMPT",
|
|
5814
|
+
"declaration": {
|
|
5815
|
+
"name": "SUGGESTIONS_SYSTEM_PROMPT",
|
|
5816
|
+
"module": "src/suggestions/generate-suggestions.ts"
|
|
5817
|
+
}
|
|
5818
|
+
},
|
|
5819
|
+
{
|
|
5820
|
+
"kind": "js",
|
|
5821
|
+
"name": "buildSuggestionsPrompt",
|
|
5822
|
+
"declaration": {
|
|
5823
|
+
"name": "buildSuggestionsPrompt",
|
|
5824
|
+
"module": "src/suggestions/generate-suggestions.ts"
|
|
5825
|
+
}
|
|
5826
|
+
},
|
|
5827
|
+
{
|
|
5828
|
+
"kind": "js",
|
|
5829
|
+
"name": "parseSuggestions",
|
|
5830
|
+
"declaration": {
|
|
5831
|
+
"name": "parseSuggestions",
|
|
5832
|
+
"module": "src/suggestions/generate-suggestions.ts"
|
|
5833
|
+
}
|
|
5834
|
+
},
|
|
5835
|
+
{
|
|
5836
|
+
"kind": "js",
|
|
5837
|
+
"name": "generateSuggestions",
|
|
5838
|
+
"declaration": {
|
|
5839
|
+
"name": "generateSuggestions",
|
|
5840
|
+
"module": "src/suggestions/generate-suggestions.ts"
|
|
5841
|
+
}
|
|
5842
|
+
}
|
|
5843
|
+
]
|
|
5844
|
+
},
|
|
5702
5845
|
{
|
|
5703
5846
|
"kind": "javascript-module",
|
|
5704
5847
|
"path": "src/tags/index.ts",
|
|
@@ -5717,6 +5860,41 @@
|
|
|
5717
5860
|
"declarations": [],
|
|
5718
5861
|
"exports": []
|
|
5719
5862
|
},
|
|
5863
|
+
{
|
|
5864
|
+
"kind": "javascript-module",
|
|
5865
|
+
"path": "src/utils/agents-key.ts",
|
|
5866
|
+
"declarations": [
|
|
5867
|
+
{
|
|
5868
|
+
"kind": "function",
|
|
5869
|
+
"name": "agentsKey",
|
|
5870
|
+
"return": {
|
|
5871
|
+
"type": {
|
|
5872
|
+
"text": "string"
|
|
5873
|
+
}
|
|
5874
|
+
},
|
|
5875
|
+
"parameters": [
|
|
5876
|
+
{
|
|
5877
|
+
"name": "agents",
|
|
5878
|
+
"optional": true,
|
|
5879
|
+
"type": {
|
|
5880
|
+
"text": "AgentConfig[]"
|
|
5881
|
+
}
|
|
5882
|
+
}
|
|
5883
|
+
],
|
|
5884
|
+
"description": "A stable fingerprint for an agents array, compared against the installed driver's to decide\nwhether an `agents` change needs the driver rebuilt.\n\nSo it must change when the driver's tool surface would, and not otherwise: handler key order is\nsorted out, agent order is significant."
|
|
5885
|
+
}
|
|
5886
|
+
],
|
|
5887
|
+
"exports": [
|
|
5888
|
+
{
|
|
5889
|
+
"kind": "js",
|
|
5890
|
+
"name": "agentsKey",
|
|
5891
|
+
"declaration": {
|
|
5892
|
+
"name": "agentsKey",
|
|
5893
|
+
"module": "src/utils/agents-key.ts"
|
|
5894
|
+
}
|
|
5895
|
+
}
|
|
5896
|
+
]
|
|
5897
|
+
},
|
|
5720
5898
|
{
|
|
5721
5899
|
"kind": "javascript-module",
|
|
5722
5900
|
"path": "src/utils/animated-panel-toggle.ts",
|
|
@@ -7232,6 +7410,46 @@
|
|
|
7232
7410
|
"declarations": [],
|
|
7233
7411
|
"exports": []
|
|
7234
7412
|
},
|
|
7413
|
+
{
|
|
7414
|
+
"kind": "javascript-module",
|
|
7415
|
+
"path": "src/utils/resolve-turn-input.ts",
|
|
7416
|
+
"declarations": [
|
|
7417
|
+
{
|
|
7418
|
+
"kind": "function",
|
|
7419
|
+
"name": "resolveTurnInput",
|
|
7420
|
+
"return": {
|
|
7421
|
+
"type": {
|
|
7422
|
+
"text": "Promise<T | undefined>"
|
|
7423
|
+
}
|
|
7424
|
+
},
|
|
7425
|
+
"parameters": [
|
|
7426
|
+
{
|
|
7427
|
+
"name": "input",
|
|
7428
|
+
"type": {
|
|
7429
|
+
"text": "T | ((ctx: SystemPromptContext) => T | Promise<T>) | undefined"
|
|
7430
|
+
}
|
|
7431
|
+
},
|
|
7432
|
+
{
|
|
7433
|
+
"name": "ctx",
|
|
7434
|
+
"type": {
|
|
7435
|
+
"text": "SystemPromptContext"
|
|
7436
|
+
}
|
|
7437
|
+
}
|
|
7438
|
+
],
|
|
7439
|
+
"description": "Resolve a config input that may be a static value or a per-turn resolver.\n\n`undefined` in, `undefined` out — an unset input stays unset rather than resolving to a default\nthe caller never asked for."
|
|
7440
|
+
}
|
|
7441
|
+
],
|
|
7442
|
+
"exports": [
|
|
7443
|
+
{
|
|
7444
|
+
"kind": "js",
|
|
7445
|
+
"name": "resolveTurnInput",
|
|
7446
|
+
"declaration": {
|
|
7447
|
+
"name": "resolveTurnInput",
|
|
7448
|
+
"module": "src/utils/resolve-turn-input.ts"
|
|
7449
|
+
}
|
|
7450
|
+
}
|
|
7451
|
+
]
|
|
7452
|
+
},
|
|
7235
7453
|
{
|
|
7236
7454
|
"kind": "javascript-module",
|
|
7237
7455
|
"path": "src/utils/strip-agent-handlers.ts",
|
|
@@ -7869,59 +8087,318 @@
|
|
|
7869
8087
|
},
|
|
7870
8088
|
{
|
|
7871
8089
|
"kind": "javascript-module",
|
|
7872
|
-
"path": "src/components/
|
|
7873
|
-
"declarations": [],
|
|
7874
|
-
"exports": []
|
|
7875
|
-
},
|
|
7876
|
-
{
|
|
7877
|
-
"kind": "javascript-module",
|
|
7878
|
-
"path": "src/components/ai-driver/index.ts",
|
|
7879
|
-
"declarations": [],
|
|
7880
|
-
"exports": [
|
|
7881
|
-
{
|
|
7882
|
-
"kind": "js",
|
|
7883
|
-
"name": "AiDriver",
|
|
7884
|
-
"declaration": {
|
|
7885
|
-
"name": "AiDriver",
|
|
7886
|
-
"module": "./ai-driver"
|
|
7887
|
-
}
|
|
7888
|
-
}
|
|
7889
|
-
]
|
|
7890
|
-
},
|
|
7891
|
-
{
|
|
7892
|
-
"kind": "javascript-module",
|
|
7893
|
-
"path": "src/components/chat-bubble/chat-bubble.styles.ts",
|
|
7894
|
-
"declarations": [
|
|
7895
|
-
{
|
|
7896
|
-
"kind": "variable",
|
|
7897
|
-
"name": "styles",
|
|
7898
|
-
"default": "css`\n :host {\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 9999;\n overflow: visible;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .bubble {\n position: absolute;\n width: 62px;\n height: 62px;\n border-radius: 50%;\n cursor: grab;\n pointer-events: all;\n overflow: visible;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n transition:\n transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),\n box-shadow 0.25s ease;\n background: linear-gradient(135deg, #0e1628 0%, #192340 100%);\n box-shadow: 0 4px 20px rgb(0 0 0 / 45%);\n border: 2px solid rgb(255 255 255 / 15%);\n color: white;\n }\n\n .bubble img {\n width: 62px;\n height: 62px;\n border-radius: 50%;\n object-fit: cover;\n pointer-events: none;\n box-shadow: 0 4px 20px rgb(0 0 0 / 45%);\n border: 2px solid rgb(255 255 255 / 15%);\n }\n\n .bubble svg {\n pointer-events: none;\n }\n\n .bubble:hover,\n .bubble.hovered {\n transform: scale(1.18);\n }\n\n .bubble:hover img,\n .bubble.hovered img {\n box-shadow:\n 0 6px 32px rgb(0 100 255 / 55%),\n 0 0 0 3px rgb(0 120 255 / 35%);\n }\n\n .bubble:active {\n cursor: grabbing;\n }\n\n .tooltip {\n position: absolute;\n bottom: calc(100% + 10px);\n background: linear-gradient(135deg, #0078ff 0%, #0050d0 100%);\n color: #fff;\n font-size: 0.78em;\n font-weight: 600;\n letter-spacing: 0.03em;\n white-space: nowrap;\n padding: 5px 10px;\n border-radius: 8px;\n box-shadow: 0 4px 14px rgb(0 120 255 / 45%);\n pointer-events: none;\n opacity: 0%;\n translate: 0 4px;\n transition:\n opacity 0.18s ease,\n translate 0.18s ease;\n }\n\n .tooltip::after {\n content: '';\n position: absolute;\n top: 100%;\n left: var(--arrow-left, 50%);\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-top-color: #0050d0;\n }\n\n .bubble:hover .tooltip,\n .bubble.hovered .tooltip {\n opacity: 100%;\n translate: 0 0;\n }\n\n .pulse-ring {\n position: absolute;\n width: 62px;\n height: 62px;\n border-radius: 50%;\n border: 2px solid rgb(0 120 255 / 50%);\n animation: pulse 2.5s ease-out infinite;\n pointer-events: none;\n }\n\n @keyframes pulse {\n 0% {\n transform: scale(1);\n opacity: 70%;\n }\n\n 70% {\n transform: scale(1.5);\n opacity: 0%;\n }\n\n 100% {\n transform: scale(1.5);\n opacity: 0%;\n }\n }\n\n .dialog {\n position: absolute;\n box-sizing: border-box;\n width: 400px;\n height: 520px;\n min-width: 300px;\n min-height: 300px;\n max-width: 50vw;\n max-height: calc(100vh - 40px);\n background: var(--neutral-layer-1);\n border-radius: 14px;\n box-shadow:\n 0 12px 50px rgb(0 0 0 / 55%),\n 0 0 0 1px rgb(255 255 255 / 6%);\n pointer-events: all;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n resize: both;\n border: 1px solid var(--neutral-stroke-rest);\n animation: dialog-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n @keyframes dialog-in {\n from {\n opacity: 0%;\n transform: scale(0.85) translateY(12px);\n }\n\n to {\n opacity: 100%;\n transform: scale(1) translateY(0);\n }\n }\n\n @keyframes dialog-out {\n from {\n opacity: 100%;\n transform: scale(1) translateY(0);\n }\n\n to {\n opacity: 0%;\n transform: scale(0.85) translateY(12px);\n }\n }\n\n .dialog.closing {\n animation: dialog-out 0.2s cubic-bezier(0.4, 0, 0.6, 1) forwards;\n }\n\n .dialog-content {\n flex: 1;\n overflow: hidden;\n display: flex;\n min-height: 0;\n }\n\n .dialog-content ::slotted(*) {\n display: flex;\n flex: 1;\n width: 100%;\n min-height: 0;\n }\n`"
|
|
7899
|
-
}
|
|
7900
|
-
],
|
|
7901
|
-
"exports": [
|
|
7902
|
-
{
|
|
7903
|
-
"kind": "js",
|
|
7904
|
-
"name": "styles",
|
|
7905
|
-
"declaration": {
|
|
7906
|
-
"name": "styles",
|
|
7907
|
-
"module": "src/components/chat-bubble/chat-bubble.styles.ts"
|
|
7908
|
-
}
|
|
7909
|
-
}
|
|
7910
|
-
]
|
|
7911
|
-
},
|
|
7912
|
-
{
|
|
7913
|
-
"kind": "javascript-module",
|
|
7914
|
-
"path": "src/components/chat-bubble/chat-bubble.template.ts",
|
|
8090
|
+
"path": "src/components/agent-session/agent-session.ts",
|
|
7915
8091
|
"declarations": [
|
|
7916
8092
|
{
|
|
7917
|
-
"kind": "
|
|
7918
|
-
"
|
|
7919
|
-
"
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
8093
|
+
"kind": "class",
|
|
8094
|
+
"description": "The stateful-agent contract: which agent is active, whether a flow or a user pin holds routing,\nand the `onActivate` / `onDeactivate` lifecycle around a swap. Either driver can own one.\n\nKnows nothing about routing, tool surfaces or transcripts — whether an agent is terminal, the\ncontinuation tool, the handoff marker in history all stay with the orchestrator, which is the\nonly thing with agents to route between.",
|
|
8095
|
+
"name": "AgentSession",
|
|
8096
|
+
"members": [
|
|
8097
|
+
{
|
|
8098
|
+
"kind": "field",
|
|
8099
|
+
"name": "lifecycleAbortController",
|
|
8100
|
+
"privacy": "private",
|
|
8101
|
+
"readonly": true,
|
|
8102
|
+
"default": "new AbortController()",
|
|
8103
|
+
"description": "Aborted on disposal. Threaded into `AgentLifecycleContext.signal` so long-running\n`onActivate` work can bail if the session disconnects."
|
|
8104
|
+
},
|
|
8105
|
+
{
|
|
8106
|
+
"kind": "field",
|
|
8107
|
+
"name": "active",
|
|
8108
|
+
"type": {
|
|
8109
|
+
"text": "AgentConfig | undefined"
|
|
8110
|
+
},
|
|
8111
|
+
"privacy": "private"
|
|
8112
|
+
},
|
|
8113
|
+
{
|
|
8114
|
+
"kind": "field",
|
|
8115
|
+
"name": "pinned",
|
|
8116
|
+
"type": {
|
|
8117
|
+
"text": "string | null"
|
|
8118
|
+
},
|
|
8119
|
+
"privacy": "private",
|
|
8120
|
+
"default": "null",
|
|
8121
|
+
"description": "Sticky user pick from the picker (or the host's `setAgent` API). Only changes on explicit\nuser action. Survives flow completion: when a stateful agent releases, the user-pin stays put\nand routing falls back to it on the next turn."
|
|
8122
|
+
},
|
|
8123
|
+
{
|
|
8124
|
+
"kind": "field",
|
|
8125
|
+
"name": "flowOwner",
|
|
8126
|
+
"type": {
|
|
8127
|
+
"text": "string | null"
|
|
8128
|
+
},
|
|
8129
|
+
"privacy": "private",
|
|
8130
|
+
"default": "null",
|
|
8131
|
+
"description": "Transient flow lock — set when a stateful agent activates, cleared on release. While\nnon-null, routing precedence goes to this agent and the picker is locked. Independent of\nthe user pin so completing a flow doesn't wipe the user's sticky choice."
|
|
8132
|
+
},
|
|
8133
|
+
{
|
|
8134
|
+
"kind": "field",
|
|
8135
|
+
"name": "restoredStates",
|
|
8136
|
+
"type": {
|
|
8137
|
+
"text": "Record<string, unknown>"
|
|
8138
|
+
},
|
|
8139
|
+
"privacy": "private",
|
|
8140
|
+
"default": "{}",
|
|
8141
|
+
"description": "Per-agent restored state for a rehydrated session, keyed by agent name. Primed by the host on\nrestore; each entry is passed to that agent's `onActivate` as `ctx.restored` on its next\nactivation, then deleted so a later re-activation starts fresh."
|
|
8142
|
+
},
|
|
8143
|
+
{
|
|
8144
|
+
"kind": "method",
|
|
8145
|
+
"name": "getActive",
|
|
8146
|
+
"return": {
|
|
8147
|
+
"type": {
|
|
8148
|
+
"text": "AgentConfig | undefined"
|
|
8149
|
+
}
|
|
8150
|
+
},
|
|
8151
|
+
"description": "The active agent, or `undefined` before the first activation and after a release."
|
|
8152
|
+
},
|
|
8153
|
+
{
|
|
8154
|
+
"kind": "method",
|
|
8155
|
+
"name": "getPinned",
|
|
8156
|
+
"return": {
|
|
8157
|
+
"type": {
|
|
8158
|
+
"text": "string | null"
|
|
8159
|
+
}
|
|
8160
|
+
},
|
|
8161
|
+
"description": "The sticky user pin, or `null` for automatic routing."
|
|
8162
|
+
},
|
|
8163
|
+
{
|
|
8164
|
+
"kind": "method",
|
|
8165
|
+
"name": "getFlowOwner",
|
|
8166
|
+
"return": {
|
|
8167
|
+
"type": {
|
|
8168
|
+
"text": "string | null"
|
|
8169
|
+
}
|
|
8170
|
+
},
|
|
8171
|
+
"description": "The transient flow lock, or `null` when no flow holds routing."
|
|
8172
|
+
},
|
|
8173
|
+
{
|
|
8174
|
+
"kind": "method",
|
|
8175
|
+
"name": "getLockedName",
|
|
8176
|
+
"return": {
|
|
8177
|
+
"type": {
|
|
8178
|
+
"text": "string | null"
|
|
8179
|
+
}
|
|
8180
|
+
},
|
|
8181
|
+
"description": "The name routing is locked to, flow lock first. A flow in progress outranks the user's\nsticky pick for the duration of the flow; neither being set means automatic routing."
|
|
8182
|
+
},
|
|
8183
|
+
{
|
|
8184
|
+
"kind": "method",
|
|
8185
|
+
"name": "setPinned",
|
|
8186
|
+
"return": {
|
|
8187
|
+
"type": {
|
|
8188
|
+
"text": "void"
|
|
8189
|
+
}
|
|
8190
|
+
},
|
|
8191
|
+
"parameters": [
|
|
8192
|
+
{
|
|
8193
|
+
"name": "name",
|
|
8194
|
+
"type": {
|
|
8195
|
+
"text": "string | null"
|
|
8196
|
+
}
|
|
8197
|
+
}
|
|
8198
|
+
],
|
|
8199
|
+
"description": "Set the sticky user pin. `null` returns to automatic routing."
|
|
8200
|
+
},
|
|
8201
|
+
{
|
|
8202
|
+
"kind": "method",
|
|
8203
|
+
"name": "setFlowOwner",
|
|
8204
|
+
"return": {
|
|
8205
|
+
"type": {
|
|
8206
|
+
"text": "void"
|
|
8207
|
+
}
|
|
8208
|
+
},
|
|
8209
|
+
"parameters": [
|
|
8210
|
+
{
|
|
8211
|
+
"name": "name",
|
|
8212
|
+
"type": {
|
|
8213
|
+
"text": "string | null"
|
|
8214
|
+
}
|
|
8215
|
+
}
|
|
8216
|
+
],
|
|
8217
|
+
"description": "Set the flow-owner lock directly — used to restore state on driver reconstruction\n(agents-array changes, pop-in/pop-out), not to steer routing. Writes without firing hooks or\nreporting a transition, because the flow it names is already running."
|
|
8218
|
+
},
|
|
8219
|
+
{
|
|
8220
|
+
"kind": "method",
|
|
8221
|
+
"name": "primeRestoredStates",
|
|
8222
|
+
"return": {
|
|
8223
|
+
"type": {
|
|
8224
|
+
"text": "void"
|
|
8225
|
+
}
|
|
8226
|
+
},
|
|
8227
|
+
"parameters": [
|
|
8228
|
+
{
|
|
8229
|
+
"name": "snapshots",
|
|
8230
|
+
"type": {
|
|
8231
|
+
"text": "Record<string, unknown>"
|
|
8232
|
+
}
|
|
8233
|
+
}
|
|
8234
|
+
],
|
|
8235
|
+
"description": "Prime per-agent restored state for a rehydrated session. Replaces any pending entries."
|
|
8236
|
+
},
|
|
8237
|
+
{
|
|
8238
|
+
"kind": "method",
|
|
8239
|
+
"name": "hasRestoredState",
|
|
8240
|
+
"return": {
|
|
8241
|
+
"type": {
|
|
8242
|
+
"text": "boolean"
|
|
8243
|
+
}
|
|
8244
|
+
},
|
|
8245
|
+
"parameters": [
|
|
8246
|
+
{
|
|
8247
|
+
"name": "agentName",
|
|
8248
|
+
"type": {
|
|
8249
|
+
"text": "string"
|
|
8250
|
+
}
|
|
8251
|
+
}
|
|
8252
|
+
],
|
|
8253
|
+
"description": "Whether a restored snapshot is waiting for this agent's next activation."
|
|
8254
|
+
},
|
|
8255
|
+
{
|
|
8256
|
+
"kind": "method",
|
|
8257
|
+
"name": "activate",
|
|
8258
|
+
"return": {
|
|
8259
|
+
"type": {
|
|
8260
|
+
"text": "Promise<AgentTransition>"
|
|
8261
|
+
}
|
|
8262
|
+
},
|
|
8263
|
+
"parameters": [
|
|
8264
|
+
{
|
|
8265
|
+
"name": "agent",
|
|
8266
|
+
"type": {
|
|
8267
|
+
"text": "AgentConfig"
|
|
8268
|
+
}
|
|
8269
|
+
}
|
|
8270
|
+
],
|
|
8271
|
+
"description": "Make `agent` active, firing the lifecycle hooks around the swap: outgoing `onDeactivate`\nfirst, then incoming `onActivate`. Both are awaited so heavy activation work (a machine\nrestore, say) completes before the agent's first turn runs, and a throw from either is logged\nrather than propagated — an agent whose hook fails still activates.\n\nRe-activating the same agent by name is not a switch: no hooks fire, no lock moves, and no\nhandoff is recorded. That guard matters because a per-turn re-resolve calls through here."
|
|
8272
|
+
},
|
|
8273
|
+
{
|
|
8274
|
+
"kind": "method",
|
|
8275
|
+
"name": "release",
|
|
8276
|
+
"return": {
|
|
8277
|
+
"type": {
|
|
8278
|
+
"text": "Promise<AgentTransition | undefined>"
|
|
8279
|
+
}
|
|
8280
|
+
},
|
|
8281
|
+
"description": "Release the active agent: fire `onDeactivate` and drop the flow lock.\n\nThe user pin is intentionally **not** cleared — someone who explicitly picked this agent\nshould stay on it after the flow ends, so the next message starts a fresh flow on the same\nagent rather than routing through the classifier.\n\nReturns `undefined` when there was no active agent, so a caller can skip its events."
|
|
8282
|
+
},
|
|
8283
|
+
{
|
|
8284
|
+
"kind": "method",
|
|
8285
|
+
"name": "dispose",
|
|
8286
|
+
"return": {
|
|
8287
|
+
"type": {
|
|
8288
|
+
"text": "Promise<void>"
|
|
8289
|
+
}
|
|
8290
|
+
},
|
|
8291
|
+
"description": "Fire `onDeactivate` on the active agent and abort pending lifecycle work, for session\nteardown, so machines release resources cleanly. The session is not reusable afterwards: the\nabort signal stays aborted, so a later `activate` would hand its hook a dead signal.\n\n`onDeactivate` runs **before** the abort, deliberately: teardown that needs to flush state\nwould otherwise be handed an already-aborted signal and have to skip its own work. The cost is\nthat an `onActivate` still in flight keeps running until `onDeactivate` finishes — both hold\nthe same signal. Acceptable because the two are sequenced by `activate`, so overlap only\nhappens if a hook resolves before the work it started; a hook that must stop immediately\nshould own its own cancellation."
|
|
8292
|
+
},
|
|
8293
|
+
{
|
|
8294
|
+
"kind": "method",
|
|
8295
|
+
"name": "fireDeactivate",
|
|
8296
|
+
"privacy": "private",
|
|
8297
|
+
"return": {
|
|
8298
|
+
"type": {
|
|
8299
|
+
"text": "Promise<void>"
|
|
8300
|
+
}
|
|
8301
|
+
},
|
|
8302
|
+
"parameters": [
|
|
8303
|
+
{
|
|
8304
|
+
"name": "agent",
|
|
8305
|
+
"type": {
|
|
8306
|
+
"text": "AgentConfig"
|
|
8307
|
+
}
|
|
8308
|
+
},
|
|
8309
|
+
{
|
|
8310
|
+
"name": "reason",
|
|
8311
|
+
"type": {
|
|
8312
|
+
"text": "'switch' | 'release' | 'dispose'"
|
|
8313
|
+
}
|
|
8314
|
+
}
|
|
8315
|
+
],
|
|
8316
|
+
"description": "The one place `onDeactivate` is invoked. `reason` only reaches the warning text, which is what\ntells a log reader which path fired."
|
|
8317
|
+
}
|
|
8318
|
+
]
|
|
8319
|
+
}
|
|
8320
|
+
],
|
|
8321
|
+
"exports": [
|
|
8322
|
+
{
|
|
8323
|
+
"kind": "js",
|
|
8324
|
+
"name": "AgentSession",
|
|
8325
|
+
"declaration": {
|
|
8326
|
+
"name": "AgentSession",
|
|
8327
|
+
"module": "src/components/agent-session/agent-session.ts"
|
|
8328
|
+
}
|
|
8329
|
+
}
|
|
8330
|
+
]
|
|
8331
|
+
},
|
|
8332
|
+
{
|
|
8333
|
+
"kind": "javascript-module",
|
|
8334
|
+
"path": "src/components/agent-session/index.ts",
|
|
8335
|
+
"declarations": [],
|
|
8336
|
+
"exports": [
|
|
8337
|
+
{
|
|
8338
|
+
"kind": "js",
|
|
8339
|
+
"name": "*",
|
|
8340
|
+
"declaration": {
|
|
8341
|
+
"name": "*",
|
|
8342
|
+
"package": "./agent-session"
|
|
8343
|
+
}
|
|
8344
|
+
}
|
|
8345
|
+
]
|
|
8346
|
+
},
|
|
8347
|
+
{
|
|
8348
|
+
"kind": "javascript-module",
|
|
8349
|
+
"path": "src/components/ai-driver/ai-driver.ts",
|
|
8350
|
+
"declarations": [],
|
|
8351
|
+
"exports": []
|
|
8352
|
+
},
|
|
8353
|
+
{
|
|
8354
|
+
"kind": "javascript-module",
|
|
8355
|
+
"path": "src/components/ai-driver/index.ts",
|
|
8356
|
+
"declarations": [],
|
|
8357
|
+
"exports": [
|
|
8358
|
+
{
|
|
8359
|
+
"kind": "js",
|
|
8360
|
+
"name": "AiDriver",
|
|
8361
|
+
"declaration": {
|
|
8362
|
+
"name": "AiDriver",
|
|
8363
|
+
"module": "./ai-driver"
|
|
8364
|
+
}
|
|
8365
|
+
}
|
|
8366
|
+
]
|
|
8367
|
+
},
|
|
8368
|
+
{
|
|
8369
|
+
"kind": "javascript-module",
|
|
8370
|
+
"path": "src/components/chat-bubble/chat-bubble.styles.ts",
|
|
8371
|
+
"declarations": [
|
|
8372
|
+
{
|
|
8373
|
+
"kind": "variable",
|
|
8374
|
+
"name": "styles",
|
|
8375
|
+
"default": "css`\n :host {\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 9999;\n overflow: visible;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .bubble {\n position: absolute;\n width: 62px;\n height: 62px;\n border-radius: 50%;\n cursor: grab;\n pointer-events: all;\n overflow: visible;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n transition:\n transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),\n box-shadow 0.25s ease;\n background: linear-gradient(135deg, #0e1628 0%, #192340 100%);\n box-shadow: 0 4px 20px rgb(0 0 0 / 45%);\n border: 2px solid rgb(255 255 255 / 15%);\n color: white;\n }\n\n .bubble img {\n width: 62px;\n height: 62px;\n border-radius: 50%;\n object-fit: cover;\n pointer-events: none;\n box-shadow: 0 4px 20px rgb(0 0 0 / 45%);\n border: 2px solid rgb(255 255 255 / 15%);\n }\n\n .bubble svg {\n pointer-events: none;\n }\n\n .bubble:hover,\n .bubble.hovered {\n transform: scale(1.18);\n }\n\n .bubble:hover img,\n .bubble.hovered img {\n box-shadow:\n 0 6px 32px rgb(0 100 255 / 55%),\n 0 0 0 3px rgb(0 120 255 / 35%);\n }\n\n .bubble:active {\n cursor: grabbing;\n }\n\n .tooltip {\n position: absolute;\n bottom: calc(100% + 10px);\n background: linear-gradient(135deg, #0078ff 0%, #0050d0 100%);\n color: #fff;\n font-size: 0.78em;\n font-weight: 600;\n letter-spacing: 0.03em;\n white-space: nowrap;\n padding: 5px 10px;\n border-radius: 8px;\n box-shadow: 0 4px 14px rgb(0 120 255 / 45%);\n pointer-events: none;\n opacity: 0%;\n translate: 0 4px;\n transition:\n opacity 0.18s ease,\n translate 0.18s ease;\n }\n\n .tooltip::after {\n content: '';\n position: absolute;\n top: 100%;\n left: var(--arrow-left, 50%);\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-top-color: #0050d0;\n }\n\n .bubble:hover .tooltip,\n .bubble.hovered .tooltip {\n opacity: 100%;\n translate: 0 0;\n }\n\n .pulse-ring {\n position: absolute;\n width: 62px;\n height: 62px;\n border-radius: 50%;\n border: 2px solid rgb(0 120 255 / 50%);\n animation: pulse 2.5s ease-out infinite;\n pointer-events: none;\n }\n\n @keyframes pulse {\n 0% {\n transform: scale(1);\n opacity: 70%;\n }\n\n 70% {\n transform: scale(1.5);\n opacity: 0%;\n }\n\n 100% {\n transform: scale(1.5);\n opacity: 0%;\n }\n }\n\n .dialog {\n position: absolute;\n box-sizing: border-box;\n width: 400px;\n height: 520px;\n min-width: 300px;\n min-height: 300px;\n max-width: 50vw;\n max-height: calc(100vh - 40px);\n background: var(--neutral-layer-1);\n border-radius: 14px;\n box-shadow:\n 0 12px 50px rgb(0 0 0 / 55%),\n 0 0 0 1px rgb(255 255 255 / 6%);\n pointer-events: all;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n resize: both;\n border: 1px solid var(--neutral-stroke-rest);\n animation: dialog-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n @keyframes dialog-in {\n from {\n opacity: 0%;\n transform: scale(0.85) translateY(12px);\n }\n\n to {\n opacity: 100%;\n transform: scale(1) translateY(0);\n }\n }\n\n @keyframes dialog-out {\n from {\n opacity: 100%;\n transform: scale(1) translateY(0);\n }\n\n to {\n opacity: 0%;\n transform: scale(0.85) translateY(12px);\n }\n }\n\n .dialog.closing {\n animation: dialog-out 0.2s cubic-bezier(0.4, 0, 0.6, 1) forwards;\n }\n\n .dialog-content {\n flex: 1;\n overflow: hidden;\n display: flex;\n min-height: 0;\n }\n\n .dialog-content ::slotted(*) {\n display: flex;\n flex: 1;\n width: 100%;\n min-height: 0;\n }\n`"
|
|
8376
|
+
}
|
|
8377
|
+
],
|
|
8378
|
+
"exports": [
|
|
8379
|
+
{
|
|
8380
|
+
"kind": "js",
|
|
8381
|
+
"name": "styles",
|
|
8382
|
+
"declaration": {
|
|
8383
|
+
"name": "styles",
|
|
8384
|
+
"module": "src/components/chat-bubble/chat-bubble.styles.ts"
|
|
8385
|
+
}
|
|
8386
|
+
}
|
|
8387
|
+
]
|
|
8388
|
+
},
|
|
8389
|
+
{
|
|
8390
|
+
"kind": "javascript-module",
|
|
8391
|
+
"path": "src/components/chat-bubble/chat-bubble.template.ts",
|
|
8392
|
+
"declarations": [
|
|
8393
|
+
{
|
|
8394
|
+
"kind": "function",
|
|
8395
|
+
"name": "AiChatBubbleTemplate",
|
|
8396
|
+
"return": {
|
|
8397
|
+
"type": {
|
|
8398
|
+
"text": "ViewTemplate<AiChatBubble>"
|
|
8399
|
+
}
|
|
8400
|
+
}
|
|
8401
|
+
}
|
|
7925
8402
|
],
|
|
7926
8403
|
"exports": [
|
|
7927
8404
|
{
|
|
@@ -8363,8 +8840,61 @@
|
|
|
8363
8840
|
},
|
|
8364
8841
|
{
|
|
8365
8842
|
"kind": "javascript-module",
|
|
8366
|
-
"path": "src/components/chat-driver/chat-driver.ts",
|
|
8843
|
+
"path": "src/components/chat-driver/chat-driver.constants.ts",
|
|
8367
8844
|
"declarations": [
|
|
8845
|
+
{
|
|
8846
|
+
"kind": "variable",
|
|
8847
|
+
"name": "DEFAULT_MAX_TOOL_ITERATIONS",
|
|
8848
|
+
"type": {
|
|
8849
|
+
"text": "number"
|
|
8850
|
+
},
|
|
8851
|
+
"default": "50",
|
|
8852
|
+
"description": "Tuning constants for the tool loop — caps, retry ceilings, and the two retry nudges."
|
|
8853
|
+
},
|
|
8854
|
+
{
|
|
8855
|
+
"kind": "variable",
|
|
8856
|
+
"name": "DEFAULT_MAX_FOLD_OPERATIONS",
|
|
8857
|
+
"type": {
|
|
8858
|
+
"text": "number"
|
|
8859
|
+
},
|
|
8860
|
+
"default": "5"
|
|
8861
|
+
},
|
|
8862
|
+
{
|
|
8863
|
+
"kind": "variable",
|
|
8864
|
+
"name": "DEFAULT_MAX_TURN_SNAPSHOTS",
|
|
8865
|
+
"type": {
|
|
8866
|
+
"text": "number"
|
|
8867
|
+
},
|
|
8868
|
+
"default": "400"
|
|
8869
|
+
},
|
|
8870
|
+
{
|
|
8871
|
+
"kind": "variable",
|
|
8872
|
+
"name": "DEFAULT_MAX_UNKNOWN_TOOL_CALLS",
|
|
8873
|
+
"type": {
|
|
8874
|
+
"text": "number"
|
|
8875
|
+
},
|
|
8876
|
+
"default": "5"
|
|
8877
|
+
},
|
|
8878
|
+
{
|
|
8879
|
+
"kind": "variable",
|
|
8880
|
+
"name": "MAX_STALE_TOOL_CALLS"
|
|
8881
|
+
},
|
|
8882
|
+
{
|
|
8883
|
+
"kind": "variable",
|
|
8884
|
+
"name": "MAX_MALFORMED_RETRIES",
|
|
8885
|
+
"type": {
|
|
8886
|
+
"text": "number"
|
|
8887
|
+
},
|
|
8888
|
+
"default": "5"
|
|
8889
|
+
},
|
|
8890
|
+
{
|
|
8891
|
+
"kind": "variable",
|
|
8892
|
+
"name": "MAX_EMPTY_RESPONSE_RETRIES",
|
|
8893
|
+
"type": {
|
|
8894
|
+
"text": "number"
|
|
8895
|
+
},
|
|
8896
|
+
"default": "3"
|
|
8897
|
+
},
|
|
8368
8898
|
{
|
|
8369
8899
|
"kind": "variable",
|
|
8370
8900
|
"name": "MALFORMED_CALL_NUDGE",
|
|
@@ -8383,6 +8913,23 @@
|
|
|
8383
8913
|
"default": "\"IMPORTANT: Your previous attempt returned nothing at all, which is never a valid response. Answer the user's last message now, in prose — even if all you can honestly say is that you cannot help with it and why. If a tool is the right way to answer, call it. Do not return an empty response.\"",
|
|
8384
8914
|
"description": "Framed-tail nudge added to a retry after an EMPTY response.\n\nRewritten in GENC-1573. The previous copy (\"You must respond to the user's message. Call the\nappropriate tool or provide a text response\") told a model that had just returned nothing to\nrespond, without naming the one exit available to an agent that genuinely cannot act: saying so.\nAcross nine failures in the measured session it changed nothing — all 29 attempts came back at\n8–9 output tokens — and most of those were on a tool-less agent, for which \"call the appropriate\ntool\" is not an option at all. This version names the honest answer explicitly."
|
|
8385
8915
|
},
|
|
8916
|
+
{
|
|
8917
|
+
"kind": "variable",
|
|
8918
|
+
"name": "MAX_SETUP_TRANSPORT_RETRIES",
|
|
8919
|
+
"type": {
|
|
8920
|
+
"text": "number"
|
|
8921
|
+
},
|
|
8922
|
+
"default": "3"
|
|
8923
|
+
},
|
|
8924
|
+
{
|
|
8925
|
+
"kind": "variable",
|
|
8926
|
+
"name": "HARVESTED_SUBAGENT_EVENTS",
|
|
8927
|
+
"type": {
|
|
8928
|
+
"text": "ReadonlySet<MetaEventType>"
|
|
8929
|
+
},
|
|
8930
|
+
"default": "new Set([\n 'turn.retry',\n 'turn.error',\n 'tool.failed',\n 'tool.unresolved',\n])",
|
|
8931
|
+
"description": "Sub-agent meta events worth folding into the parent's debug timeline: the\nper-attempt and per-failure signals that do NOT otherwise surface in the\nsub-agent's (now hoisted) messages — a retried-away malformed/empty attempt\nproduces no message, and the stale-vs-hallucinated/streak diagnostics live only\non the event. High-volume, message-derivable events (turn.start/turn.end,\nprovider.selected, context.updated) are intentionally excluded: read the\nsub-agent's hoisted messages for model/tokens/cost and turn-by-turn activity.\nSee `ChatDriver.invokeSubAgent`."
|
|
8932
|
+
},
|
|
8386
8933
|
{
|
|
8387
8934
|
"kind": "variable",
|
|
8388
8935
|
"name": "REQUEST_CONTINUATION_TOOL",
|
|
@@ -8392,6 +8939,127 @@
|
|
|
8392
8939
|
"default": "'request_continuation'",
|
|
8393
8940
|
"description": "Name reserved for the cross-agent handoff tool — injected by OrchestratingDriver."
|
|
8394
8941
|
},
|
|
8942
|
+
{
|
|
8943
|
+
"kind": "variable",
|
|
8944
|
+
"name": "HANDOFF_TOOL_RESULT_PLACEHOLDER",
|
|
8945
|
+
"type": {
|
|
8946
|
+
"text": "string"
|
|
8947
|
+
},
|
|
8948
|
+
"default": "'Handoff to another specialist — routing continues on the next turn.'",
|
|
8949
|
+
"description": "Paired in history for each `request_continuation` so tool_calls stay balanced for the provider."
|
|
8950
|
+
}
|
|
8951
|
+
],
|
|
8952
|
+
"exports": [
|
|
8953
|
+
{
|
|
8954
|
+
"kind": "js",
|
|
8955
|
+
"name": "DEFAULT_MAX_TOOL_ITERATIONS",
|
|
8956
|
+
"declaration": {
|
|
8957
|
+
"name": "DEFAULT_MAX_TOOL_ITERATIONS",
|
|
8958
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
8959
|
+
}
|
|
8960
|
+
},
|
|
8961
|
+
{
|
|
8962
|
+
"kind": "js",
|
|
8963
|
+
"name": "DEFAULT_MAX_FOLD_OPERATIONS",
|
|
8964
|
+
"declaration": {
|
|
8965
|
+
"name": "DEFAULT_MAX_FOLD_OPERATIONS",
|
|
8966
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
8967
|
+
}
|
|
8968
|
+
},
|
|
8969
|
+
{
|
|
8970
|
+
"kind": "js",
|
|
8971
|
+
"name": "DEFAULT_MAX_TURN_SNAPSHOTS",
|
|
8972
|
+
"declaration": {
|
|
8973
|
+
"name": "DEFAULT_MAX_TURN_SNAPSHOTS",
|
|
8974
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
8975
|
+
}
|
|
8976
|
+
},
|
|
8977
|
+
{
|
|
8978
|
+
"kind": "js",
|
|
8979
|
+
"name": "DEFAULT_MAX_UNKNOWN_TOOL_CALLS",
|
|
8980
|
+
"declaration": {
|
|
8981
|
+
"name": "DEFAULT_MAX_UNKNOWN_TOOL_CALLS",
|
|
8982
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
8983
|
+
}
|
|
8984
|
+
},
|
|
8985
|
+
{
|
|
8986
|
+
"kind": "js",
|
|
8987
|
+
"name": "MAX_STALE_TOOL_CALLS",
|
|
8988
|
+
"declaration": {
|
|
8989
|
+
"name": "MAX_STALE_TOOL_CALLS",
|
|
8990
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
8991
|
+
}
|
|
8992
|
+
},
|
|
8993
|
+
{
|
|
8994
|
+
"kind": "js",
|
|
8995
|
+
"name": "MAX_MALFORMED_RETRIES",
|
|
8996
|
+
"declaration": {
|
|
8997
|
+
"name": "MAX_MALFORMED_RETRIES",
|
|
8998
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
8999
|
+
}
|
|
9000
|
+
},
|
|
9001
|
+
{
|
|
9002
|
+
"kind": "js",
|
|
9003
|
+
"name": "MAX_EMPTY_RESPONSE_RETRIES",
|
|
9004
|
+
"declaration": {
|
|
9005
|
+
"name": "MAX_EMPTY_RESPONSE_RETRIES",
|
|
9006
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
9007
|
+
}
|
|
9008
|
+
},
|
|
9009
|
+
{
|
|
9010
|
+
"kind": "js",
|
|
9011
|
+
"name": "MALFORMED_CALL_NUDGE",
|
|
9012
|
+
"declaration": {
|
|
9013
|
+
"name": "MALFORMED_CALL_NUDGE",
|
|
9014
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
9015
|
+
}
|
|
9016
|
+
},
|
|
9017
|
+
{
|
|
9018
|
+
"kind": "js",
|
|
9019
|
+
"name": "EMPTY_RESPONSE_NUDGE",
|
|
9020
|
+
"declaration": {
|
|
9021
|
+
"name": "EMPTY_RESPONSE_NUDGE",
|
|
9022
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
9023
|
+
}
|
|
9024
|
+
},
|
|
9025
|
+
{
|
|
9026
|
+
"kind": "js",
|
|
9027
|
+
"name": "MAX_SETUP_TRANSPORT_RETRIES",
|
|
9028
|
+
"declaration": {
|
|
9029
|
+
"name": "MAX_SETUP_TRANSPORT_RETRIES",
|
|
9030
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
9031
|
+
}
|
|
9032
|
+
},
|
|
9033
|
+
{
|
|
9034
|
+
"kind": "js",
|
|
9035
|
+
"name": "HARVESTED_SUBAGENT_EVENTS",
|
|
9036
|
+
"declaration": {
|
|
9037
|
+
"name": "HARVESTED_SUBAGENT_EVENTS",
|
|
9038
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
9039
|
+
}
|
|
9040
|
+
},
|
|
9041
|
+
{
|
|
9042
|
+
"kind": "js",
|
|
9043
|
+
"name": "REQUEST_CONTINUATION_TOOL",
|
|
9044
|
+
"declaration": {
|
|
9045
|
+
"name": "REQUEST_CONTINUATION_TOOL",
|
|
9046
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
9047
|
+
}
|
|
9048
|
+
},
|
|
9049
|
+
{
|
|
9050
|
+
"kind": "js",
|
|
9051
|
+
"name": "HANDOFF_TOOL_RESULT_PLACEHOLDER",
|
|
9052
|
+
"declaration": {
|
|
9053
|
+
"name": "HANDOFF_TOOL_RESULT_PLACEHOLDER",
|
|
9054
|
+
"module": "src/components/chat-driver/chat-driver.constants.ts"
|
|
9055
|
+
}
|
|
9056
|
+
}
|
|
9057
|
+
]
|
|
9058
|
+
},
|
|
9059
|
+
{
|
|
9060
|
+
"kind": "javascript-module",
|
|
9061
|
+
"path": "src/components/chat-driver/chat-driver.ts",
|
|
9062
|
+
"declarations": [
|
|
8395
9063
|
{
|
|
8396
9064
|
"kind": "class",
|
|
8397
9065
|
"description": "",
|
|
@@ -8594,23 +9262,11 @@
|
|
|
8594
9262
|
},
|
|
8595
9263
|
{
|
|
8596
9264
|
"kind": "field",
|
|
8597
|
-
"name": "
|
|
8598
|
-
"type": {
|
|
8599
|
-
"text": "FoldStackFrame[]"
|
|
8600
|
-
},
|
|
8601
|
-
"privacy": "private",
|
|
8602
|
-
"default": "[]",
|
|
8603
|
-
"description": "Stack of fold frames — grows when a fold opens, shrinks when it closes."
|
|
8604
|
-
},
|
|
8605
|
-
{
|
|
8606
|
-
"kind": "field",
|
|
8607
|
-
"name": "consecutiveFoldOps",
|
|
8608
|
-
"type": {
|
|
8609
|
-
"text": "number"
|
|
8610
|
-
},
|
|
9265
|
+
"name": "folds",
|
|
8611
9266
|
"privacy": "private",
|
|
8612
|
-
"
|
|
8613
|
-
"
|
|
9267
|
+
"readonly": true,
|
|
9268
|
+
"default": "new FoldController({\n getDefinitions: () => this.toolDefinitions,\n setDefinitions: (defs) => {\n this.toolDefinitions = defs;\n },\n getHandlers: () => this.toolHandlers,\n setHandlers: (handlers) => {\n this.toolHandlers = handlers;\n },\n handlerContext: (activeToolCallId) => this.buildHandlerContext(activeToolCallId),\n })",
|
|
9269
|
+
"description": "Tool folds: the open-fold stack, the no-progress counter, and the tool-surface swap."
|
|
8614
9270
|
},
|
|
8615
9271
|
{
|
|
8616
9272
|
"kind": "field",
|
|
@@ -8971,6 +9627,17 @@
|
|
|
8971
9627
|
"description": "Session identity used to file meta events onto the shared debug-log timeline.",
|
|
8972
9628
|
"default": "sessionKey"
|
|
8973
9629
|
},
|
|
9630
|
+
{
|
|
9631
|
+
"kind": "field",
|
|
9632
|
+
"name": "deferAgentRelease",
|
|
9633
|
+
"type": {
|
|
9634
|
+
"text": "boolean"
|
|
9635
|
+
},
|
|
9636
|
+
"privacy": "private",
|
|
9637
|
+
"readonly": true,
|
|
9638
|
+
"description": "See ChatDriverConfig.deferAgentRelease.",
|
|
9639
|
+
"default": "deferAgentRelease"
|
|
9640
|
+
},
|
|
8974
9641
|
{
|
|
8975
9642
|
"kind": "field",
|
|
8976
9643
|
"name": "activityBus",
|
|
@@ -9057,7 +9724,7 @@
|
|
|
9057
9724
|
"name": "dispose",
|
|
9058
9725
|
"return": {
|
|
9059
9726
|
"type": {
|
|
9060
|
-
"text": "void"
|
|
9727
|
+
"text": "Promise<void>"
|
|
9061
9728
|
}
|
|
9062
9729
|
},
|
|
9063
9730
|
"description": "Tear down the driver: aborts the lifecycle signal so any in-flight provider\nrequest (and prompt/tool factories awaiting it) cancels instead of running\non to completion or the transport timeout. Called by the host on driver\nswap and by `OrchestratingDriver.dispose()`. Idempotent.\n\nDeliberately does NOT settle `pendingInteractions` here: dispose is never\nreached while one is pending. The only host-level dispose is the agent-swap\nrebuild, which is guarded by `isBusy()` — a pending interaction keeps the\ntool loop suspended (`busy === true`), so the swap is deferred until the\nwidget resolves. Sub-agent child disposes always have an empty pending map\n(widgets park on the parent via `setHostInteractionRequester`). A pending\ninteraction is instead settled by `resolveInteraction` (user response or\ntimeout), which also stamps history and reverts the chat-input override."
|
|
@@ -9105,40 +9772,6 @@
|
|
|
9105
9772
|
},
|
|
9106
9773
|
"description": "Finish a turn whose signal aborted. A user cancel adds a subtle \"Stopped.\"\nmarker; a dispose-driven abort stops quietly (the widget is gone and the\ncached history would otherwise gain a stray marker on remount)."
|
|
9107
9774
|
},
|
|
9108
|
-
{
|
|
9109
|
-
"kind": "method",
|
|
9110
|
-
"name": "turnDone",
|
|
9111
|
-
"privacy": "private",
|
|
9112
|
-
"return": {
|
|
9113
|
-
"type": {
|
|
9114
|
-
"text": "ChatDriverResult"
|
|
9115
|
-
}
|
|
9116
|
-
},
|
|
9117
|
-
"parameters": [
|
|
9118
|
-
{
|
|
9119
|
-
"name": "failureReason",
|
|
9120
|
-
"optional": true,
|
|
9121
|
-
"type": {
|
|
9122
|
-
"text": "TurnFailureReason"
|
|
9123
|
-
}
|
|
9124
|
-
},
|
|
9125
|
-
{
|
|
9126
|
-
"name": "budget",
|
|
9127
|
-
"optional": true,
|
|
9128
|
-
"type": {
|
|
9129
|
-
"text": "BudgetDetail"
|
|
9130
|
-
}
|
|
9131
|
-
},
|
|
9132
|
-
{
|
|
9133
|
-
"name": "providerRefused",
|
|
9134
|
-
"optional": true,
|
|
9135
|
-
"type": {
|
|
9136
|
-
"text": "ProviderRefusedDetail"
|
|
9137
|
-
}
|
|
9138
|
-
}
|
|
9139
|
-
],
|
|
9140
|
-
"description": "Build the `done` loop result, carrying the typed failure reason when the turn\nbailed (PTC-0). The discriminant stays `'done'` either way — the same value a\nclean turn returns — so consumers matching on `reason === 'done'` are unchanged;\n`failureReason` is simply present on a failure and absent on success. Omitted\n(rather than set to `undefined`) so a happy-path result stays byte-identical to\nthe historical `{ reason: 'done' }`."
|
|
9141
|
-
},
|
|
9142
9775
|
{
|
|
9143
9776
|
"kind": "method",
|
|
9144
9777
|
"name": "endTurnWithFailure",
|
|
@@ -9239,6 +9872,88 @@
|
|
|
9239
9872
|
],
|
|
9240
9873
|
"description": "Build the `tool-loop-end` event detail for a turn's result. A failure carries a\n`{ failureReason }` detail; a clean turn emits `undefined` — the historical shape,\nkept byte-identical so subscribers see exactly what they always have.\n\nA budget failure additionally carries `vendor` — the concrete vendor\n(`'anthropic'`/`'gemini'`) the walled turn resolved to, which the driver knows\nand used to discard. Optional and additive: a subscriber reading only\n`failureReason` is unaffected, a non-budget failure still emits the historical\n`{ failureReason }` with no `vendor` key, and the value is a plain string so\nthe detail stays structured-cloneable for the cross-tab hop. It is the field a\nper-vendor budget model needs and the one that would be awkward to retrofit."
|
|
9241
9874
|
},
|
|
9875
|
+
{
|
|
9876
|
+
"kind": "method",
|
|
9877
|
+
"name": "activateAgent",
|
|
9878
|
+
"return": {
|
|
9879
|
+
"type": {
|
|
9880
|
+
"text": "Promise<void>"
|
|
9881
|
+
}
|
|
9882
|
+
},
|
|
9883
|
+
"parameters": [
|
|
9884
|
+
{
|
|
9885
|
+
"name": "config",
|
|
9886
|
+
"type": {
|
|
9887
|
+
"text": "AgentConfig"
|
|
9888
|
+
}
|
|
9889
|
+
}
|
|
9890
|
+
],
|
|
9891
|
+
"description": "Make `config` the active agent, firing its lifecycle hooks — `onDeactivate` on the outgoing\nagent, then `onActivate` on this one — before installing it.\n\nThis is the entry point a host should use. ChatDriver.applyAgent installs a config\n*without* firing hooks, which is right for the two callers that need it (the orchestrator,\nwhich fires them through the shared session, and `invokeSubAgent`, where a child's config is\nnot an activation) and wrong for everyone else."
|
|
9892
|
+
},
|
|
9893
|
+
{
|
|
9894
|
+
"kind": "method",
|
|
9895
|
+
"name": "getActiveAgent",
|
|
9896
|
+
"return": {
|
|
9897
|
+
"type": {
|
|
9898
|
+
"text": "AgentConfig | undefined"
|
|
9899
|
+
}
|
|
9900
|
+
},
|
|
9901
|
+
"description": "{@inheritDoc AiDriver.getActiveAgent}"
|
|
9902
|
+
},
|
|
9903
|
+
{
|
|
9904
|
+
"kind": "method",
|
|
9905
|
+
"name": "primeRestoredAgentState",
|
|
9906
|
+
"return": {
|
|
9907
|
+
"type": {
|
|
9908
|
+
"text": "void"
|
|
9909
|
+
}
|
|
9910
|
+
},
|
|
9911
|
+
"parameters": [
|
|
9912
|
+
{
|
|
9913
|
+
"name": "snapshots",
|
|
9914
|
+
"type": {
|
|
9915
|
+
"text": "Record<string, unknown>"
|
|
9916
|
+
}
|
|
9917
|
+
}
|
|
9918
|
+
],
|
|
9919
|
+
"description": "{@inheritDoc AiDriver.primeRestoredAgentState}"
|
|
9920
|
+
},
|
|
9921
|
+
{
|
|
9922
|
+
"kind": "method",
|
|
9923
|
+
"name": "setPinnedAgent",
|
|
9924
|
+
"return": {
|
|
9925
|
+
"type": {
|
|
9926
|
+
"text": "void"
|
|
9927
|
+
}
|
|
9928
|
+
},
|
|
9929
|
+
"parameters": [
|
|
9930
|
+
{
|
|
9931
|
+
"name": "name",
|
|
9932
|
+
"type": {
|
|
9933
|
+
"text": "string | null"
|
|
9934
|
+
}
|
|
9935
|
+
}
|
|
9936
|
+
],
|
|
9937
|
+
"description": "Record the sticky agent pin. See AiDriver.setPinnedAgent for the contract.\n\nRecorded, not acted on: this driver has one agent and nothing to route between, so a pin\nchanges no behaviour here. It is still honoured as state, because the session outlives the\nquestion of which driver is holding it — a host that pins before an orchestrator is built\nwould otherwise lose the pick."
|
|
9938
|
+
},
|
|
9939
|
+
{
|
|
9940
|
+
"kind": "method",
|
|
9941
|
+
"name": "setFlowOwner",
|
|
9942
|
+
"return": {
|
|
9943
|
+
"type": {
|
|
9944
|
+
"text": "void"
|
|
9945
|
+
}
|
|
9946
|
+
},
|
|
9947
|
+
"parameters": [
|
|
9948
|
+
{
|
|
9949
|
+
"name": "name",
|
|
9950
|
+
"type": {
|
|
9951
|
+
"text": "string | null"
|
|
9952
|
+
}
|
|
9953
|
+
}
|
|
9954
|
+
],
|
|
9955
|
+
"description": "Record the transient flow lock. See AiDriver.setFlowOwner for the contract.\n\nRecorded, not acted on, for the same reason as ChatDriver.setPinnedAgent."
|
|
9956
|
+
},
|
|
9242
9957
|
{
|
|
9243
9958
|
"kind": "method",
|
|
9244
9959
|
"name": "applyAgent",
|
|
@@ -9255,7 +9970,7 @@
|
|
|
9255
9970
|
}
|
|
9256
9971
|
}
|
|
9257
9972
|
],
|
|
9258
|
-
"description": "
|
|
9973
|
+
"description": "Install `config` as the active agent **without firing lifecycle hooks**.\n\nPrefer ChatDriver.activateAgent unless you are deliberately skipping the hooks. Two\ncallers are: `OrchestratingDriver`, which fires them through the shared\nChatDriver.agentSession and then installs a decorated config, and `invokeSubAgent`,\nwhere the child driver's config is a tool surface rather than an activation.\n\nRenamed to `installAgent` in a follow-up (GENC-1580) — see `docs/migration-GENC-1580.md`.\nUntil then the name says less than it should, so do not add a third caller to this path\nwithout checking which of the two above it resembles."
|
|
9259
9974
|
},
|
|
9260
9975
|
{
|
|
9261
9976
|
"kind": "method",
|
|
@@ -9344,53 +10059,28 @@
|
|
|
9344
10059
|
},
|
|
9345
10060
|
{
|
|
9346
10061
|
"kind": "method",
|
|
9347
|
-
"name": "resolveStatusForProvider",
|
|
9348
|
-
"privacy": "private",
|
|
9349
|
-
"return": {
|
|
9350
|
-
"type": {
|
|
9351
|
-
"text": "Promise<{ model?: string; provider?: AIProviderType; contextLimit?: number }>"
|
|
9352
|
-
}
|
|
9353
|
-
},
|
|
9354
|
-
"parameters": [
|
|
9355
|
-
{
|
|
9356
|
-
"name": "name",
|
|
9357
|
-
"type": {
|
|
9358
|
-
"text": "string"
|
|
9359
|
-
}
|
|
9360
|
-
},
|
|
9361
|
-
{
|
|
9362
|
-
"name": "provider",
|
|
9363
|
-
"type": {
|
|
9364
|
-
"text": "AIProvider"
|
|
9365
|
-
}
|
|
9366
|
-
}
|
|
9367
|
-
],
|
|
9368
|
-
"description": "Resolve model id and vendor from a provider via its optional `getStatus()`,\nmemoised by registry name. Used to stamp `model` and `provider` onto outgoing\nmessages. Best-effort: a provider without `getStatus`, a null status, or a\nthrow all yield empty fields — attribution is diagnostic, never load-bearing."
|
|
9369
|
-
},
|
|
9370
|
-
{
|
|
9371
|
-
"kind": "method",
|
|
9372
|
-
"name": "resolveTurnInput",
|
|
10062
|
+
"name": "resolveStatusForProvider",
|
|
9373
10063
|
"privacy": "private",
|
|
9374
10064
|
"return": {
|
|
9375
10065
|
"type": {
|
|
9376
|
-
"text": "Promise<
|
|
10066
|
+
"text": "Promise<{ model?: string; provider?: AIProviderType; contextLimit?: number }>"
|
|
9377
10067
|
}
|
|
9378
10068
|
},
|
|
9379
10069
|
"parameters": [
|
|
9380
10070
|
{
|
|
9381
|
-
"name": "
|
|
10071
|
+
"name": "name",
|
|
9382
10072
|
"type": {
|
|
9383
|
-
"text": "
|
|
10073
|
+
"text": "string"
|
|
9384
10074
|
}
|
|
9385
10075
|
},
|
|
9386
10076
|
{
|
|
9387
|
-
"name": "
|
|
10077
|
+
"name": "provider",
|
|
9388
10078
|
"type": {
|
|
9389
|
-
"text": "
|
|
10079
|
+
"text": "AIProvider"
|
|
9390
10080
|
}
|
|
9391
10081
|
}
|
|
9392
10082
|
],
|
|
9393
|
-
"description": "Resolve a
|
|
10083
|
+
"description": "Resolve model id and vendor from a provider via its optional `getStatus()`,\nmemoised by registry name. Used to stamp `model` and `provider` onto outgoing\nmessages. Best-effort: a provider without `getStatus`, a null status, or a\nthrow all yield empty fields — attribution is diagnostic, never load-bearing."
|
|
9394
10084
|
},
|
|
9395
10085
|
{
|
|
9396
10086
|
"kind": "method",
|
|
@@ -9465,6 +10155,17 @@
|
|
|
9465
10155
|
},
|
|
9466
10156
|
"description": "Returns true if `releaseAgent` was called during the most recent turn.\nConsumed by the orchestrator to trigger the auto-pin release path."
|
|
9467
10157
|
},
|
|
10158
|
+
{
|
|
10159
|
+
"kind": "method",
|
|
10160
|
+
"name": "releaseIfRequested",
|
|
10161
|
+
"privacy": "private",
|
|
10162
|
+
"return": {
|
|
10163
|
+
"type": {
|
|
10164
|
+
"text": "Promise<void>"
|
|
10165
|
+
}
|
|
10166
|
+
},
|
|
10167
|
+
"description": "Act on a `releaseAgent` call from a tool handler: fire `onDeactivate` and drop the flow lock,\nso the next turn starts clean and the persister does not serialize a flow that is over.\n\nNo-op when the owner handles release (ChatDriverConfig.deferAgentRelease). The flag is\ncleared here rather than only at the next `sendMessage`, so the signal cannot be acted on twice\nand release a later agent that never asked."
|
|
10168
|
+
},
|
|
9468
10169
|
{
|
|
9469
10170
|
"kind": "method",
|
|
9470
10171
|
"name": "getTurnSnapshots",
|
|
@@ -9694,7 +10395,8 @@
|
|
|
9694
10395
|
"text": "AllAgentSummary[]"
|
|
9695
10396
|
}
|
|
9696
10397
|
}
|
|
9697
|
-
]
|
|
10398
|
+
],
|
|
10399
|
+
"description": "{@inheritDoc AiDriver.getSuggestions}"
|
|
9698
10400
|
},
|
|
9699
10401
|
{
|
|
9700
10402
|
"kind": "method",
|
|
@@ -10011,27 +10713,272 @@
|
|
|
10011
10713
|
},
|
|
10012
10714
|
{
|
|
10013
10715
|
"kind": "method",
|
|
10014
|
-
"name": "continueFromHistory",
|
|
10716
|
+
"name": "continueFromHistory",
|
|
10717
|
+
"return": {
|
|
10718
|
+
"type": {
|
|
10719
|
+
"text": "Promise<ChatDriverResult>"
|
|
10720
|
+
}
|
|
10721
|
+
},
|
|
10722
|
+
"parameters": [
|
|
10723
|
+
{
|
|
10724
|
+
"name": "transientPrimer",
|
|
10725
|
+
"optional": true,
|
|
10726
|
+
"type": {
|
|
10727
|
+
"text": "ChatMessage[]"
|
|
10728
|
+
}
|
|
10729
|
+
}
|
|
10730
|
+
],
|
|
10731
|
+
"description": "Continue the tool loop from current history without appending a new user message.\nUsed by OrchestratingDriver after an agent handoff."
|
|
10732
|
+
},
|
|
10733
|
+
{
|
|
10734
|
+
"kind": "method",
|
|
10735
|
+
"name": "runToolLoop",
|
|
10736
|
+
"privacy": "private",
|
|
10737
|
+
"return": {
|
|
10738
|
+
"type": {
|
|
10739
|
+
"text": "Promise<ChatDriverResult>"
|
|
10740
|
+
}
|
|
10741
|
+
},
|
|
10742
|
+
"parameters": [
|
|
10743
|
+
{
|
|
10744
|
+
"name": "userInput",
|
|
10745
|
+
"type": {
|
|
10746
|
+
"text": "string"
|
|
10747
|
+
}
|
|
10748
|
+
},
|
|
10749
|
+
{
|
|
10750
|
+
"name": "attachments",
|
|
10751
|
+
"optional": true,
|
|
10752
|
+
"type": {
|
|
10753
|
+
"text": "ChatAttachment[]"
|
|
10754
|
+
}
|
|
10755
|
+
},
|
|
10756
|
+
{
|
|
10757
|
+
"name": "transientPrimer",
|
|
10758
|
+
"optional": true,
|
|
10759
|
+
"type": {
|
|
10760
|
+
"text": "ChatMessage[]"
|
|
10761
|
+
}
|
|
10762
|
+
}
|
|
10763
|
+
]
|
|
10764
|
+
},
|
|
10765
|
+
{
|
|
10766
|
+
"kind": "method",
|
|
10767
|
+
"name": "appendDriverNotice",
|
|
10768
|
+
"privacy": "private",
|
|
10769
|
+
"return": {
|
|
10770
|
+
"type": {
|
|
10771
|
+
"text": "void"
|
|
10772
|
+
}
|
|
10773
|
+
},
|
|
10774
|
+
"parameters": [
|
|
10775
|
+
{
|
|
10776
|
+
"name": "content",
|
|
10777
|
+
"type": {
|
|
10778
|
+
"text": "string"
|
|
10779
|
+
}
|
|
10780
|
+
}
|
|
10781
|
+
],
|
|
10782
|
+
"description": "Append prose the DRIVER wrote rather than the model — a failure notice, a limit explanation,\nthe budget wall. Renders as an ordinary assistant bubble and is flagged\n`excludeFromProvider`, so it never re-enters the next request.\n\nEvery such notice must go through here. Written as one funnel rather than a flag repeated at\neleven call sites because the failure mode is silent: a notice that keeps the flag reads\nidentically in the transcript to one that loses it, and the damage only shows up a turn later\nas the model echoing its own error message. Measured (GENC-1573): with the empty-response\nnotice in history, the next turn reproduced it verbatim in 45 output tokens — succeeding,\nwith no retry and no `turn.error`, while still showing the user a failure. From there the\nloop sustains itself whether or not the model answers, which is why \"try again\" never worked.\n\nNot for anything the model produced, and not for a widget/interaction message: those are real\nturn content and the model must keep seeing them."
|
|
10783
|
+
},
|
|
10784
|
+
{
|
|
10785
|
+
"kind": "method",
|
|
10786
|
+
"name": "appendToHistory",
|
|
10787
|
+
"privacy": "private",
|
|
10788
|
+
"return": {
|
|
10789
|
+
"type": {
|
|
10790
|
+
"text": "void"
|
|
10791
|
+
}
|
|
10792
|
+
},
|
|
10793
|
+
"parameters": [
|
|
10794
|
+
{
|
|
10795
|
+
"name": "message",
|
|
10796
|
+
"type": {
|
|
10797
|
+
"text": "ChatMessage"
|
|
10798
|
+
}
|
|
10799
|
+
}
|
|
10800
|
+
]
|
|
10801
|
+
}
|
|
10802
|
+
],
|
|
10803
|
+
"events": [
|
|
10804
|
+
{
|
|
10805
|
+
"name": "provider-changed",
|
|
10806
|
+
"type": {
|
|
10807
|
+
"text": "CustomEvent"
|
|
10808
|
+
}
|
|
10809
|
+
},
|
|
10810
|
+
{
|
|
10811
|
+
"name": "interaction-start",
|
|
10812
|
+
"type": {
|
|
10813
|
+
"text": "CustomEvent"
|
|
10814
|
+
}
|
|
10815
|
+
},
|
|
10816
|
+
{
|
|
10817
|
+
"name": "external-cost-recorded",
|
|
10818
|
+
"type": {
|
|
10819
|
+
"text": "CustomEvent"
|
|
10820
|
+
}
|
|
10821
|
+
},
|
|
10822
|
+
{
|
|
10823
|
+
"name": "history-updated",
|
|
10824
|
+
"type": {
|
|
10825
|
+
"text": "CustomEvent"
|
|
10826
|
+
}
|
|
10827
|
+
},
|
|
10828
|
+
{
|
|
10829
|
+
"name": "interaction-stop",
|
|
10830
|
+
"type": {
|
|
10831
|
+
"text": "CustomEvent"
|
|
10832
|
+
}
|
|
10833
|
+
},
|
|
10834
|
+
{
|
|
10835
|
+
"name": "sub-agent-history-updated",
|
|
10836
|
+
"type": {
|
|
10837
|
+
"text": "CustomEvent"
|
|
10838
|
+
}
|
|
10839
|
+
},
|
|
10840
|
+
{
|
|
10841
|
+
"name": "sub-agent-start",
|
|
10842
|
+
"type": {
|
|
10843
|
+
"text": "CustomEvent"
|
|
10844
|
+
}
|
|
10845
|
+
},
|
|
10846
|
+
{
|
|
10847
|
+
"name": "sub-agent-stop",
|
|
10848
|
+
"type": {
|
|
10849
|
+
"text": "CustomEvent"
|
|
10850
|
+
}
|
|
10851
|
+
}
|
|
10852
|
+
],
|
|
10853
|
+
"superclass": {
|
|
10854
|
+
"name": "EventTarget",
|
|
10855
|
+
"module": "src/components/chat-driver/chat-driver.ts"
|
|
10856
|
+
}
|
|
10857
|
+
}
|
|
10858
|
+
],
|
|
10859
|
+
"exports": [
|
|
10860
|
+
{
|
|
10861
|
+
"kind": "js",
|
|
10862
|
+
"name": "EMPTY_RESPONSE_NUDGE",
|
|
10863
|
+
"declaration": {
|
|
10864
|
+
"name": "EMPTY_RESPONSE_NUDGE",
|
|
10865
|
+
"module": "./chat-driver.constants"
|
|
10866
|
+
}
|
|
10867
|
+
},
|
|
10868
|
+
{
|
|
10869
|
+
"kind": "js",
|
|
10870
|
+
"name": "MALFORMED_CALL_NUDGE",
|
|
10871
|
+
"declaration": {
|
|
10872
|
+
"name": "MALFORMED_CALL_NUDGE",
|
|
10873
|
+
"module": "./chat-driver.constants"
|
|
10874
|
+
}
|
|
10875
|
+
},
|
|
10876
|
+
{
|
|
10877
|
+
"kind": "js",
|
|
10878
|
+
"name": "REQUEST_CONTINUATION_TOOL",
|
|
10879
|
+
"declaration": {
|
|
10880
|
+
"name": "REQUEST_CONTINUATION_TOOL",
|
|
10881
|
+
"module": "./chat-driver.constants"
|
|
10882
|
+
}
|
|
10883
|
+
},
|
|
10884
|
+
{
|
|
10885
|
+
"kind": "js",
|
|
10886
|
+
"name": "ChatDriver",
|
|
10887
|
+
"declaration": {
|
|
10888
|
+
"name": "ChatDriver",
|
|
10889
|
+
"module": "src/components/chat-driver/chat-driver.ts"
|
|
10890
|
+
}
|
|
10891
|
+
}
|
|
10892
|
+
]
|
|
10893
|
+
},
|
|
10894
|
+
{
|
|
10895
|
+
"kind": "javascript-module",
|
|
10896
|
+
"path": "src/components/chat-driver/fold-controller.ts",
|
|
10897
|
+
"declarations": [
|
|
10898
|
+
{
|
|
10899
|
+
"kind": "class",
|
|
10900
|
+
"description": "Tool folds: grouping tools behind a facade so the model sees a small surface, and swapping the\nsurface as it opens and closes them.\n\nOwns the fold stack and the no-progress counter. Everything else it needs is the driver's tool\nsurface, reached through FoldDeps.",
|
|
10901
|
+
"name": "FoldController",
|
|
10902
|
+
"members": [
|
|
10903
|
+
{
|
|
10904
|
+
"kind": "field",
|
|
10905
|
+
"name": "stack",
|
|
10906
|
+
"type": {
|
|
10907
|
+
"text": "FoldStackFrame[]"
|
|
10908
|
+
},
|
|
10909
|
+
"privacy": "private",
|
|
10910
|
+
"default": "[]"
|
|
10911
|
+
},
|
|
10912
|
+
{
|
|
10913
|
+
"kind": "field",
|
|
10914
|
+
"name": "consecutiveOps",
|
|
10915
|
+
"type": {
|
|
10916
|
+
"text": "number"
|
|
10917
|
+
},
|
|
10918
|
+
"privacy": "private",
|
|
10919
|
+
"default": "0",
|
|
10920
|
+
"description": "Consecutive fold opens/closes with no tool call between them. A model that only opens and\ncloses is making no progress, and the loop breaks out past a ceiling."
|
|
10921
|
+
},
|
|
10922
|
+
{
|
|
10923
|
+
"kind": "method",
|
|
10924
|
+
"name": "reset",
|
|
10925
|
+
"return": {
|
|
10926
|
+
"type": {
|
|
10927
|
+
"text": "void"
|
|
10928
|
+
}
|
|
10929
|
+
},
|
|
10930
|
+
"description": "Drop all fold state. Called on an agent swap — each agent starts outside every fold."
|
|
10931
|
+
},
|
|
10932
|
+
{
|
|
10933
|
+
"kind": "method",
|
|
10934
|
+
"name": "activeNames",
|
|
10935
|
+
"return": {
|
|
10936
|
+
"type": {
|
|
10937
|
+
"text": "string[]"
|
|
10938
|
+
}
|
|
10939
|
+
},
|
|
10940
|
+
"description": "Names of the currently open folds, outermost first."
|
|
10941
|
+
},
|
|
10942
|
+
{
|
|
10943
|
+
"kind": "field",
|
|
10944
|
+
"name": "depth",
|
|
10945
|
+
"type": {
|
|
10946
|
+
"text": "number"
|
|
10947
|
+
},
|
|
10948
|
+
"readonly": true
|
|
10949
|
+
},
|
|
10950
|
+
{
|
|
10951
|
+
"kind": "field",
|
|
10952
|
+
"name": "topName",
|
|
10953
|
+
"type": {
|
|
10954
|
+
"text": "string | undefined"
|
|
10955
|
+
},
|
|
10956
|
+
"description": "The innermost open fold's name, or `undefined` when none is open.",
|
|
10957
|
+
"readonly": true
|
|
10958
|
+
},
|
|
10959
|
+
{
|
|
10960
|
+
"kind": "method",
|
|
10961
|
+
"name": "noteOp",
|
|
10962
|
+
"return": {
|
|
10963
|
+
"type": {
|
|
10964
|
+
"text": "number"
|
|
10965
|
+
}
|
|
10966
|
+
},
|
|
10967
|
+
"description": "Count one fold operation and return the new consecutive total."
|
|
10968
|
+
},
|
|
10969
|
+
{
|
|
10970
|
+
"kind": "method",
|
|
10971
|
+
"name": "clearOps",
|
|
10015
10972
|
"return": {
|
|
10016
10973
|
"type": {
|
|
10017
|
-
"text": "
|
|
10974
|
+
"text": "void"
|
|
10018
10975
|
}
|
|
10019
10976
|
},
|
|
10020
|
-
"
|
|
10021
|
-
{
|
|
10022
|
-
"name": "transientPrimer",
|
|
10023
|
-
"optional": true,
|
|
10024
|
-
"type": {
|
|
10025
|
-
"text": "ChatMessage[]"
|
|
10026
|
-
}
|
|
10027
|
-
}
|
|
10028
|
-
],
|
|
10029
|
-
"description": "Continue the tool loop from current history without appending a new user message.\nUsed by OrchestratingDriver after an agent handoff."
|
|
10977
|
+
"description": "Real work happened, so the no-progress streak restarts."
|
|
10030
10978
|
},
|
|
10031
10979
|
{
|
|
10032
10980
|
"kind": "method",
|
|
10033
|
-
"name": "
|
|
10034
|
-
"privacy": "private",
|
|
10981
|
+
"name": "foldFor",
|
|
10035
10982
|
"return": {
|
|
10036
10983
|
"type": {
|
|
10037
10984
|
"text": "ToolFold | undefined"
|
|
@@ -10045,12 +10992,11 @@
|
|
|
10045
10992
|
}
|
|
10046
10993
|
}
|
|
10047
10994
|
],
|
|
10048
|
-
"description": "
|
|
10995
|
+
"description": "Fold metadata for a tool name, or `undefined` if it is not a fold facade."
|
|
10049
10996
|
},
|
|
10050
10997
|
{
|
|
10051
10998
|
"kind": "method",
|
|
10052
|
-
"name": "
|
|
10053
|
-
"privacy": "private",
|
|
10999
|
+
"name": "findContaining",
|
|
10054
11000
|
"return": {
|
|
10055
11001
|
"type": {
|
|
10056
11002
|
"text": "string | null"
|
|
@@ -10071,12 +11017,11 @@
|
|
|
10071
11017
|
}
|
|
10072
11018
|
}
|
|
10073
11019
|
],
|
|
10074
|
-
"description": "
|
|
11020
|
+
"description": "Which fold to **open** to reach `toolName`, or `null` if no registered fold contains it.\n\nReturns the outermost *registered* ancestor, not the innermost fold holding the tool — the one\nconsumer uses the answer to tell the model what to call next, and a nested fold cannot be\nopened before its parent. The recursion therefore only descends through closed folds: once a\nfold is open its children are top-level in the live handler map and match directly."
|
|
10075
11021
|
},
|
|
10076
11022
|
{
|
|
10077
11023
|
"kind": "method",
|
|
10078
|
-
"name": "
|
|
10079
|
-
"privacy": "private",
|
|
11024
|
+
"name": "hidingTool",
|
|
10080
11025
|
"return": {
|
|
10081
11026
|
"type": {
|
|
10082
11027
|
"text": "string | null"
|
|
@@ -10090,37 +11035,11 @@
|
|
|
10090
11035
|
}
|
|
10091
11036
|
}
|
|
10092
11037
|
],
|
|
10093
|
-
"description": "If an open fold is hiding a previously-available tool,
|
|
10094
|
-
},
|
|
10095
|
-
{
|
|
10096
|
-
"kind": "method",
|
|
10097
|
-
"name": "applyFoldToolSet",
|
|
10098
|
-
"privacy": "private",
|
|
10099
|
-
"return": {
|
|
10100
|
-
"type": {
|
|
10101
|
-
"text": "void"
|
|
10102
|
-
}
|
|
10103
|
-
},
|
|
10104
|
-
"parameters": [
|
|
10105
|
-
{
|
|
10106
|
-
"name": "fold",
|
|
10107
|
-
"type": {
|
|
10108
|
-
"text": "ToolFold"
|
|
10109
|
-
}
|
|
10110
|
-
},
|
|
10111
|
-
{
|
|
10112
|
-
"name": "foldName",
|
|
10113
|
-
"type": {
|
|
10114
|
-
"text": "string"
|
|
10115
|
-
}
|
|
10116
|
-
}
|
|
10117
|
-
],
|
|
10118
|
-
"description": "Install the fold's inner tool set, replacing (exclusive) or extending (non-exclusive)\nthe current tool set. Also injects the close tool. Does NOT touch the fold stack."
|
|
11038
|
+
"description": "If an open fold is hiding a previously-available tool, the fold to close to start getting it\nback, else `null`.\n\nOnly exclusive folds hide tools — they replace the tool set on open rather than extending it —\nso a base tool that was visible beforehand sits in a frame's `previousHandlers` but not in the\nlive map. Only the top fold's `close_` tool is active, so that is always the actionable step:\nclosing repeatedly walks back to a tool further down the stack."
|
|
10119
11039
|
},
|
|
10120
11040
|
{
|
|
10121
11041
|
"kind": "method",
|
|
10122
|
-
"name": "
|
|
10123
|
-
"privacy": "private",
|
|
11042
|
+
"name": "open",
|
|
10124
11043
|
"return": {
|
|
10125
11044
|
"type": {
|
|
10126
11045
|
"text": "Promise<string>"
|
|
@@ -10153,83 +11072,49 @@
|
|
|
10153
11072
|
}
|
|
10154
11073
|
}
|
|
10155
11074
|
],
|
|
10156
|
-
"description": "Open a fold: push a
|
|
10157
|
-
},
|
|
10158
|
-
{
|
|
10159
|
-
"kind": "method",
|
|
10160
|
-
"name": "pushFoldFrame",
|
|
10161
|
-
"privacy": "private",
|
|
10162
|
-
"return": {
|
|
10163
|
-
"type": {
|
|
10164
|
-
"text": "void"
|
|
10165
|
-
}
|
|
10166
|
-
},
|
|
10167
|
-
"parameters": [
|
|
10168
|
-
{
|
|
10169
|
-
"name": "foldName",
|
|
10170
|
-
"type": {
|
|
10171
|
-
"text": "string"
|
|
10172
|
-
}
|
|
10173
|
-
}
|
|
10174
|
-
]
|
|
11075
|
+
"description": "Open a fold: push a frame, swap the tool set, and return the response for the model."
|
|
10175
11076
|
},
|
|
10176
11077
|
{
|
|
10177
11078
|
"kind": "method",
|
|
10178
|
-
"name": "
|
|
10179
|
-
"privacy": "private",
|
|
11079
|
+
"name": "close",
|
|
10180
11080
|
"return": {
|
|
10181
11081
|
"type": {
|
|
10182
11082
|
"text": "string"
|
|
10183
11083
|
}
|
|
10184
11084
|
},
|
|
10185
|
-
"description": "Close the top fold: pop the
|
|
11085
|
+
"description": "Close the top fold: pop the frame, restore the tool set it captured."
|
|
10186
11086
|
},
|
|
10187
11087
|
{
|
|
10188
11088
|
"kind": "method",
|
|
10189
|
-
"name": "
|
|
10190
|
-
"privacy": "private",
|
|
11089
|
+
"name": "systemPromptSuffix",
|
|
10191
11090
|
"return": {
|
|
10192
11091
|
"type": {
|
|
10193
11092
|
"text": "string"
|
|
10194
11093
|
}
|
|
10195
11094
|
},
|
|
10196
|
-
"description": "
|
|
11095
|
+
"description": "The fold-awareness suffix appended to the system prompt on each LLM call."
|
|
10197
11096
|
},
|
|
10198
11097
|
{
|
|
10199
11098
|
"kind": "method",
|
|
10200
|
-
"name": "
|
|
11099
|
+
"name": "pushFrame",
|
|
10201
11100
|
"privacy": "private",
|
|
10202
11101
|
"return": {
|
|
10203
11102
|
"type": {
|
|
10204
|
-
"text": "
|
|
11103
|
+
"text": "void"
|
|
10205
11104
|
}
|
|
10206
11105
|
},
|
|
10207
11106
|
"parameters": [
|
|
10208
11107
|
{
|
|
10209
|
-
"name": "
|
|
11108
|
+
"name": "foldName",
|
|
10210
11109
|
"type": {
|
|
10211
11110
|
"text": "string"
|
|
10212
11111
|
}
|
|
10213
|
-
},
|
|
10214
|
-
{
|
|
10215
|
-
"name": "attachments",
|
|
10216
|
-
"optional": true,
|
|
10217
|
-
"type": {
|
|
10218
|
-
"text": "ChatAttachment[]"
|
|
10219
|
-
}
|
|
10220
|
-
},
|
|
10221
|
-
{
|
|
10222
|
-
"name": "transientPrimer",
|
|
10223
|
-
"optional": true,
|
|
10224
|
-
"type": {
|
|
10225
|
-
"text": "ChatMessage[]"
|
|
10226
|
-
}
|
|
10227
11112
|
}
|
|
10228
11113
|
]
|
|
10229
11114
|
},
|
|
10230
11115
|
{
|
|
10231
11116
|
"kind": "method",
|
|
10232
|
-
"name": "
|
|
11117
|
+
"name": "applyToolSet",
|
|
10233
11118
|
"privacy": "private",
|
|
10234
11119
|
"return": {
|
|
10235
11120
|
"type": {
|
|
@@ -10238,120 +11123,30 @@
|
|
|
10238
11123
|
},
|
|
10239
11124
|
"parameters": [
|
|
10240
11125
|
{
|
|
10241
|
-
"name": "
|
|
11126
|
+
"name": "fold",
|
|
10242
11127
|
"type": {
|
|
10243
|
-
"text": "
|
|
11128
|
+
"text": "ToolFold"
|
|
10244
11129
|
}
|
|
10245
|
-
}
|
|
10246
|
-
],
|
|
10247
|
-
"description": "Append prose the DRIVER wrote rather than the model — a failure notice, a limit explanation,\nthe budget wall. Renders as an ordinary assistant bubble and is flagged\n`excludeFromProvider`, so it never re-enters the next request.\n\nEvery such notice must go through here. Written as one funnel rather than a flag repeated at\neleven call sites because the failure mode is silent: a notice that keeps the flag reads\nidentically in the transcript to one that loses it, and the damage only shows up a turn later\nas the model echoing its own error message. Measured (GENC-1573): with the empty-response\nnotice in history, the next turn reproduced it verbatim in 45 output tokens — succeeding,\nwith no retry and no `turn.error`, while still showing the user a failure. From there the\nloop sustains itself whether or not the model answers, which is why \"try again\" never worked.\n\nNot for anything the model produced, and not for a widget/interaction message: those are real\nturn content and the model must keep seeing them."
|
|
10248
|
-
},
|
|
10249
|
-
{
|
|
10250
|
-
"kind": "method",
|
|
10251
|
-
"name": "appendToHistory",
|
|
10252
|
-
"privacy": "private",
|
|
10253
|
-
"return": {
|
|
10254
|
-
"type": {
|
|
10255
|
-
"text": "void"
|
|
10256
|
-
}
|
|
10257
|
-
},
|
|
10258
|
-
"parameters": [
|
|
11130
|
+
},
|
|
10259
11131
|
{
|
|
10260
|
-
"name": "
|
|
11132
|
+
"name": "foldName",
|
|
10261
11133
|
"type": {
|
|
10262
|
-
"text": "
|
|
11134
|
+
"text": "string"
|
|
10263
11135
|
}
|
|
10264
11136
|
}
|
|
10265
|
-
]
|
|
10266
|
-
|
|
10267
|
-
],
|
|
10268
|
-
"events": [
|
|
10269
|
-
{
|
|
10270
|
-
"name": "provider-changed",
|
|
10271
|
-
"type": {
|
|
10272
|
-
"text": "CustomEvent"
|
|
10273
|
-
}
|
|
10274
|
-
},
|
|
10275
|
-
{
|
|
10276
|
-
"name": "interaction-start",
|
|
10277
|
-
"type": {
|
|
10278
|
-
"text": "CustomEvent"
|
|
10279
|
-
}
|
|
10280
|
-
},
|
|
10281
|
-
{
|
|
10282
|
-
"name": "external-cost-recorded",
|
|
10283
|
-
"type": {
|
|
10284
|
-
"text": "CustomEvent"
|
|
10285
|
-
}
|
|
10286
|
-
},
|
|
10287
|
-
{
|
|
10288
|
-
"name": "history-updated",
|
|
10289
|
-
"type": {
|
|
10290
|
-
"text": "CustomEvent"
|
|
10291
|
-
}
|
|
10292
|
-
},
|
|
10293
|
-
{
|
|
10294
|
-
"name": "interaction-stop",
|
|
10295
|
-
"type": {
|
|
10296
|
-
"text": "CustomEvent"
|
|
10297
|
-
}
|
|
10298
|
-
},
|
|
10299
|
-
{
|
|
10300
|
-
"name": "sub-agent-history-updated",
|
|
10301
|
-
"type": {
|
|
10302
|
-
"text": "CustomEvent"
|
|
10303
|
-
}
|
|
10304
|
-
},
|
|
10305
|
-
{
|
|
10306
|
-
"name": "sub-agent-start",
|
|
10307
|
-
"type": {
|
|
10308
|
-
"text": "CustomEvent"
|
|
10309
|
-
}
|
|
10310
|
-
},
|
|
10311
|
-
{
|
|
10312
|
-
"name": "sub-agent-stop",
|
|
10313
|
-
"type": {
|
|
10314
|
-
"text": "CustomEvent"
|
|
10315
|
-
}
|
|
11137
|
+
],
|
|
11138
|
+
"description": "Install the fold's inner tool set, replacing it (exclusive) or extending it (non-exclusive),\nand inject the close tool. Does not touch the stack."
|
|
10316
11139
|
}
|
|
10317
|
-
]
|
|
10318
|
-
"superclass": {
|
|
10319
|
-
"name": "EventTarget",
|
|
10320
|
-
"module": "src/components/chat-driver/chat-driver.ts"
|
|
10321
|
-
}
|
|
11140
|
+
]
|
|
10322
11141
|
}
|
|
10323
11142
|
],
|
|
10324
11143
|
"exports": [
|
|
10325
11144
|
{
|
|
10326
11145
|
"kind": "js",
|
|
10327
|
-
"name": "
|
|
10328
|
-
"declaration": {
|
|
10329
|
-
"name": "MALFORMED_CALL_NUDGE",
|
|
10330
|
-
"module": "src/components/chat-driver/chat-driver.ts"
|
|
10331
|
-
}
|
|
10332
|
-
},
|
|
10333
|
-
{
|
|
10334
|
-
"kind": "js",
|
|
10335
|
-
"name": "EMPTY_RESPONSE_NUDGE",
|
|
10336
|
-
"declaration": {
|
|
10337
|
-
"name": "EMPTY_RESPONSE_NUDGE",
|
|
10338
|
-
"module": "src/components/chat-driver/chat-driver.ts"
|
|
10339
|
-
}
|
|
10340
|
-
},
|
|
10341
|
-
{
|
|
10342
|
-
"kind": "js",
|
|
10343
|
-
"name": "REQUEST_CONTINUATION_TOOL",
|
|
10344
|
-
"declaration": {
|
|
10345
|
-
"name": "REQUEST_CONTINUATION_TOOL",
|
|
10346
|
-
"module": "src/components/chat-driver/chat-driver.ts"
|
|
10347
|
-
}
|
|
10348
|
-
},
|
|
10349
|
-
{
|
|
10350
|
-
"kind": "js",
|
|
10351
|
-
"name": "ChatDriver",
|
|
11146
|
+
"name": "FoldController",
|
|
10352
11147
|
"declaration": {
|
|
10353
|
-
"name": "
|
|
10354
|
-
"module": "src/components/chat-driver/
|
|
11148
|
+
"name": "FoldController",
|
|
11149
|
+
"module": "src/components/chat-driver/fold-controller.ts"
|
|
10355
11150
|
}
|
|
10356
11151
|
}
|
|
10357
11152
|
]
|
|
@@ -10393,6 +11188,39 @@
|
|
|
10393
11188
|
"kind": "variable",
|
|
10394
11189
|
"name": "Record",
|
|
10395
11190
|
"description": "The terminal outcomes of a tool loop.\n\n`contextGuard` and `contextOverflow` share a `subReason` because one failure is reached\ntwo ways the user experiences differently: the guard stops at the edge of the window with\nthe transcript intact, so its copy can point at compaction, while an overflow means the\nprovider has already rejected the request.\n\nThree entries take their copy from `@genesislcap/foundation-ai`, which owns the default\nmessage for every failure it also exports an error class for. The rest is for conditions\nthis driver detects itself, which have no upstream home."
|
|
11191
|
+
},
|
|
11192
|
+
{
|
|
11193
|
+
"kind": "function",
|
|
11194
|
+
"name": "turnDone",
|
|
11195
|
+
"return": {
|
|
11196
|
+
"type": {
|
|
11197
|
+
"text": "ChatDriverResult"
|
|
11198
|
+
}
|
|
11199
|
+
},
|
|
11200
|
+
"parameters": [
|
|
11201
|
+
{
|
|
11202
|
+
"name": "failureReason",
|
|
11203
|
+
"optional": true,
|
|
11204
|
+
"type": {
|
|
11205
|
+
"text": "TurnFailureReason"
|
|
11206
|
+
}
|
|
11207
|
+
},
|
|
11208
|
+
{
|
|
11209
|
+
"name": "budget",
|
|
11210
|
+
"optional": true,
|
|
11211
|
+
"type": {
|
|
11212
|
+
"text": "BudgetDetail"
|
|
11213
|
+
}
|
|
11214
|
+
},
|
|
11215
|
+
{
|
|
11216
|
+
"name": "providerRefused",
|
|
11217
|
+
"optional": true,
|
|
11218
|
+
"type": {
|
|
11219
|
+
"text": "ProviderRefusedDetail"
|
|
11220
|
+
}
|
|
11221
|
+
}
|
|
11222
|
+
],
|
|
11223
|
+
"description": "Build the `done` loop result, carrying the typed failure reason when the turn bailed (PTC-0).\n\nThe discriminant stays `'done'` either way, so consumers matching on `reason === 'done'` are\nunchanged. Both payloads are omitted rather than set to `undefined`, which keeps a happy-path\nresult byte-identical to `{ reason: 'done' }` for a consumer that structurally compares it."
|
|
10396
11224
|
}
|
|
10397
11225
|
],
|
|
10398
11226
|
"exports": [
|
|
@@ -10419,6 +11247,14 @@
|
|
|
10419
11247
|
"name": "Record",
|
|
10420
11248
|
"module": "src/components/chat-driver/turn-failures.ts"
|
|
10421
11249
|
}
|
|
11250
|
+
},
|
|
11251
|
+
{
|
|
11252
|
+
"kind": "js",
|
|
11253
|
+
"name": "turnDone",
|
|
11254
|
+
"declaration": {
|
|
11255
|
+
"name": "turnDone",
|
|
11256
|
+
"module": "src/components/chat-driver/turn-failures.ts"
|
|
11257
|
+
}
|
|
10422
11258
|
}
|
|
10423
11259
|
]
|
|
10424
11260
|
},
|
|
@@ -10749,7 +11585,7 @@
|
|
|
10749
11585
|
},
|
|
10750
11586
|
"privacy": "private",
|
|
10751
11587
|
"readonly": true,
|
|
10752
|
-
"default": "new ChatDriver(providerRegistry, {\n maxToolIterations: options.maxToolIterations,\n maxFoldOperations: options.maxFoldOperations,\n maxTurnSnapshots: options.maxTurnSnapshots,\n sessionKey: this.sessionKey,\n activityBus: options.activityBus,\n budgetExhaustedMessage: options.budgetExhaustedMessage,\n })"
|
|
11588
|
+
"default": "new ChatDriver(providerRegistry, {\n maxToolIterations: options.maxToolIterations,\n maxFoldOperations: options.maxFoldOperations,\n maxTurnSnapshots: options.maxTurnSnapshots,\n sessionKey: this.sessionKey,\n activityBus: options.activityBus,\n budgetExhaustedMessage: options.budgetExhaustedMessage,\n // This driver releases after the turn so it can fire the host-facing events; see the option.\n deferAgentRelease: true,\n })"
|
|
10753
11589
|
},
|
|
10754
11590
|
{
|
|
10755
11591
|
"kind": "field",
|
|
@@ -10807,11 +11643,13 @@
|
|
|
10807
11643
|
},
|
|
10808
11644
|
{
|
|
10809
11645
|
"kind": "field",
|
|
10810
|
-
"name": "
|
|
11646
|
+
"name": "agentSession",
|
|
11647
|
+
"type": {
|
|
11648
|
+
"text": "AgentSession"
|
|
11649
|
+
},
|
|
10811
11650
|
"privacy": "private",
|
|
10812
|
-
"
|
|
10813
|
-
"
|
|
10814
|
-
"description": "Aborted on driver disposal. Threaded into `AgentLifecycleContext.signal`\nso long-running `onActivate` work can bail if the session disconnects."
|
|
11651
|
+
"description": "The stateful-agent contract (§7.1): active agent, user pin, flow lock, restored state, and\nthe `onActivate` / `onDeactivate` hooks.\n\n**The inner driver's session, not one of our own.** One session is the invariant: two would\nlet the outer and inner driver disagree about which agent is active, and the inner one would\nnever be activated at all, because this driver installs a *decorated* config through\n`applyAgent` rather than going via `ChatDriver.activateAgent`. This driver keeps the routing\ndecisions; the session owns the lifecycle.",
|
|
11652
|
+
"readonly": true
|
|
10815
11653
|
},
|
|
10816
11654
|
{
|
|
10817
11655
|
"kind": "field",
|
|
@@ -10833,42 +11671,14 @@
|
|
|
10833
11671
|
"default": "false",
|
|
10834
11672
|
"description": "Whether the CURRENT turn's user message has reached the inner driver's\nhistory. False through the pre-first-turn classify (where the only echo of\nthe message is an optimistic `history-updated` dispatch), true from the\nmoment `chatDriver.sendMessage` is entered — including through every later\nhandoff classify. Read by the budget-wall catch in `sendMessage` to decide\nwhether `reportBudgetExhausted` must append the message itself: appending\nit when already appended duplicated it; not appending it when unappended\nmade it vanish. Reset at the top of each `runOrchestratedTurn`."
|
|
10835
11673
|
},
|
|
10836
|
-
{
|
|
10837
|
-
"kind": "field",
|
|
10838
|
-
"name": "pinnedAgentName",
|
|
10839
|
-
"type": {
|
|
10840
|
-
"text": "string | null"
|
|
10841
|
-
},
|
|
10842
|
-
"privacy": "private",
|
|
10843
|
-
"default": "null",
|
|
10844
|
-
"description": "Sticky user pick from the picker (or the host's `setAgent` API). Only\nchanges on explicit user action. Survives flow completion: when a stateful\nagent releases, the user-pin stays put and routing falls back to it on\nthe next turn."
|
|
10845
|
-
},
|
|
10846
|
-
{
|
|
10847
|
-
"kind": "field",
|
|
10848
|
-
"name": "flowOwnerAgentName",
|
|
10849
|
-
"type": {
|
|
10850
|
-
"text": "string | null"
|
|
10851
|
-
},
|
|
10852
|
-
"privacy": "private",
|
|
10853
|
-
"default": "null",
|
|
10854
|
-
"description": "Transient flow lock — set when a stateful agent's `onActivate` fires,\ncleared by `releaseActiveAgent`. While non-null, routing precedence goes\nto this agent and the picker is locked. Independent of\n`pinnedAgentName` so completing a flow doesn't wipe the user's sticky\nchoice."
|
|
10855
|
-
},
|
|
10856
|
-
{
|
|
10857
|
-
"kind": "field",
|
|
10858
|
-
"name": "restoredAgentStates",
|
|
10859
|
-
"type": {
|
|
10860
|
-
"text": "Record<string, unknown>"
|
|
10861
|
-
},
|
|
10862
|
-
"privacy": "private",
|
|
10863
|
-
"default": "{}",
|
|
10864
|
-
"description": "Per-agent restored state for a rehydrated session, keyed by agent name.\nPrimed by the host on restore; each entry is passed to that agent's\n`onActivate` as `ctx.restored` on its next activation, then deleted so a\nlater re-activation starts fresh."
|
|
10865
|
-
},
|
|
10866
11674
|
{
|
|
10867
11675
|
"kind": "field",
|
|
10868
11676
|
"name": "activeAgent",
|
|
10869
11677
|
"type": {
|
|
10870
11678
|
"text": "AgentConfig | undefined"
|
|
10871
|
-
}
|
|
11679
|
+
},
|
|
11680
|
+
"description": "The active agent, or `undefined` before the first activation and after a release.\n\nKept as an accessor over `agentSession` rather than removed: it is a public member of an\nexported class, so nothing in this package reading it is not the same as nothing reading it.",
|
|
11681
|
+
"readonly": true
|
|
10872
11682
|
},
|
|
10873
11683
|
{
|
|
10874
11684
|
"kind": "method",
|