@genesislcap/ai-assistant 14.421.0 → 14.421.1-FUI-2511.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 +191 -1
- package/dist/ai-assistant.d.ts +59 -0
- package/dist/dts/components/chat-driver/chat-driver.d.ts +32 -0
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/config/config.d.ts +20 -0
- package/dist/dts/config/config.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +6 -0
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts +16 -0
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/dts/state/ai-assistant-slice.d.ts +6 -0
- package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
- package/dist/dts/state/session-store.d.ts +2 -0
- package/dist/dts/state/session-store.d.ts.map +1 -1
- package/dist/dts/utils/history-transform.d.ts +13 -0
- package/dist/dts/utils/history-transform.d.ts.map +1 -0
- package/dist/esm/components/chat-driver/chat-driver.js +111 -12
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +8 -20
- package/dist/esm/config/config.js +18 -1
- package/dist/esm/main/main.js +43 -11
- package/dist/esm/main/main.styles.js +62 -0
- package/dist/esm/main/main.template.js +122 -71
- package/dist/esm/state/ai-assistant-slice.js +8 -0
- package/dist/esm/utils/history-transform.js +35 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/sub_agent.md +149 -211
- package/package.json +16 -16
- package/src/components/chat-driver/chat-driver.ts +158 -11
- package/src/components/orchestrating-driver/orchestrating-driver.ts +10 -22
- package/src/config/config.ts +24 -0
- package/src/main/main.styles.ts +62 -0
- package/src/main/main.template.ts +189 -117
- package/src/main/main.ts +43 -9
- package/src/state/ai-assistant-slice.ts +12 -0
- package/src/utils/history-transform.ts +40 -0
|
@@ -2056,6 +2056,37 @@
|
|
|
2056
2056
|
"isAbstract": false,
|
|
2057
2057
|
"name": "getRawHistory"
|
|
2058
2058
|
},
|
|
2059
|
+
{
|
|
2060
|
+
"kind": "Method",
|
|
2061
|
+
"canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getSubAgentCompletion:member(1)",
|
|
2062
|
+
"docComment": "/**\n * Returns the early-stop result set by `completeSubAgent`, if any. Called by a parent `ChatDriver` after running this instance as a sub-agent.\n */\n",
|
|
2063
|
+
"excerptTokens": [
|
|
2064
|
+
{
|
|
2065
|
+
"kind": "Content",
|
|
2066
|
+
"text": "getSubAgentCompletion(): "
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
"kind": "Content",
|
|
2070
|
+
"text": "{\n result: unknown;\n } | undefined"
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
"kind": "Content",
|
|
2074
|
+
"text": ";"
|
|
2075
|
+
}
|
|
2076
|
+
],
|
|
2077
|
+
"isStatic": false,
|
|
2078
|
+
"returnTypeTokenRange": {
|
|
2079
|
+
"startIndex": 1,
|
|
2080
|
+
"endIndex": 2
|
|
2081
|
+
},
|
|
2082
|
+
"releaseTag": "Beta",
|
|
2083
|
+
"isProtected": false,
|
|
2084
|
+
"overloadIndex": 1,
|
|
2085
|
+
"parameters": [],
|
|
2086
|
+
"isOptional": false,
|
|
2087
|
+
"isAbstract": false,
|
|
2088
|
+
"name": "getSubAgentCompletion"
|
|
2089
|
+
},
|
|
2059
2090
|
{
|
|
2060
2091
|
"kind": "Method",
|
|
2061
2092
|
"canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getSuggestions:member(1)",
|
|
@@ -2671,6 +2702,73 @@
|
|
|
2671
2702
|
],
|
|
2672
2703
|
"name": "createToolFold"
|
|
2673
2704
|
},
|
|
2705
|
+
{
|
|
2706
|
+
"kind": "Function",
|
|
2707
|
+
"canonicalReference": "@genesislcap/ai-assistant!defineAgent:function(1)",
|
|
2708
|
+
"docComment": "/**\n * Identity helper that infers the narrowest possible type for an agent config, preserving string literal types (including `name`) without requiring `as const`.\n *\n * Use this when you need `typeof myAgent` to carry the literal `name` type — for example, when wiring `ChatToolHandlers<typeof myAgent>`.\n * ```ts\n * const myAgent = defineAgent({ name: 'my_agent', ... });\n * type Handlers = ChatToolHandlers<typeof myAgent>;\n * // requestSubAgent name param is now typed as 'my_agent'\n * ```\n *\n * @beta\n */\n",
|
|
2709
|
+
"excerptTokens": [
|
|
2710
|
+
{
|
|
2711
|
+
"kind": "Content",
|
|
2712
|
+
"text": "export declare function defineAgent<const T extends "
|
|
2713
|
+
},
|
|
2714
|
+
{
|
|
2715
|
+
"kind": "Reference",
|
|
2716
|
+
"text": "AgentConfig",
|
|
2717
|
+
"canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
"kind": "Content",
|
|
2721
|
+
"text": ">(config: "
|
|
2722
|
+
},
|
|
2723
|
+
{
|
|
2724
|
+
"kind": "Content",
|
|
2725
|
+
"text": "T"
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
"kind": "Content",
|
|
2729
|
+
"text": "): "
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
"kind": "Content",
|
|
2733
|
+
"text": "T"
|
|
2734
|
+
},
|
|
2735
|
+
{
|
|
2736
|
+
"kind": "Content",
|
|
2737
|
+
"text": ";"
|
|
2738
|
+
}
|
|
2739
|
+
],
|
|
2740
|
+
"fileUrlPath": "src/config/config.ts",
|
|
2741
|
+
"returnTypeTokenRange": {
|
|
2742
|
+
"startIndex": 5,
|
|
2743
|
+
"endIndex": 6
|
|
2744
|
+
},
|
|
2745
|
+
"releaseTag": "Beta",
|
|
2746
|
+
"overloadIndex": 1,
|
|
2747
|
+
"parameters": [
|
|
2748
|
+
{
|
|
2749
|
+
"parameterName": "config",
|
|
2750
|
+
"parameterTypeTokenRange": {
|
|
2751
|
+
"startIndex": 3,
|
|
2752
|
+
"endIndex": 4
|
|
2753
|
+
},
|
|
2754
|
+
"isOptional": false
|
|
2755
|
+
}
|
|
2756
|
+
],
|
|
2757
|
+
"typeParameters": [
|
|
2758
|
+
{
|
|
2759
|
+
"typeParameterName": "T",
|
|
2760
|
+
"constraintTokenRange": {
|
|
2761
|
+
"startIndex": 1,
|
|
2762
|
+
"endIndex": 2
|
|
2763
|
+
},
|
|
2764
|
+
"defaultTypeTokenRange": {
|
|
2765
|
+
"startIndex": 0,
|
|
2766
|
+
"endIndex": 0
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
],
|
|
2770
|
+
"name": "defineAgent"
|
|
2771
|
+
},
|
|
2674
2772
|
{
|
|
2675
2773
|
"kind": "Function",
|
|
2676
2774
|
"canonicalReference": "@genesislcap/ai-assistant!expandToolTree:function(1)",
|
|
@@ -3454,6 +3552,15 @@
|
|
|
3454
3552
|
"text": "ChatMessage",
|
|
3455
3553
|
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
|
|
3456
3554
|
},
|
|
3555
|
+
{
|
|
3556
|
+
"kind": "Content",
|
|
3557
|
+
"text": "[];\n subAgents?: "
|
|
3558
|
+
},
|
|
3559
|
+
{
|
|
3560
|
+
"kind": "Reference",
|
|
3561
|
+
"text": "AgentConfig",
|
|
3562
|
+
"canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
|
|
3563
|
+
},
|
|
3457
3564
|
{
|
|
3458
3565
|
"kind": "Content",
|
|
3459
3566
|
"text": "[];\n } | {\n toolDefinitions: import(\"../utils/tool-fold\")."
|
|
@@ -3472,6 +3579,15 @@
|
|
|
3472
3579
|
"text": "ChatMessage",
|
|
3473
3580
|
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
|
|
3474
3581
|
},
|
|
3582
|
+
{
|
|
3583
|
+
"kind": "Content",
|
|
3584
|
+
"text": "[];\n subAgents?: "
|
|
3585
|
+
},
|
|
3586
|
+
{
|
|
3587
|
+
"kind": "Reference",
|
|
3588
|
+
"text": "AgentConfig",
|
|
3589
|
+
"canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
|
|
3590
|
+
},
|
|
3475
3591
|
{
|
|
3476
3592
|
"kind": "Content",
|
|
3477
3593
|
"text": "[];\n })[];\n activeSystemPrompt: string;\n activePrimerHistory: "
|
|
@@ -3493,7 +3609,7 @@
|
|
|
3493
3609
|
"isStatic": false,
|
|
3494
3610
|
"returnTypeTokenRange": {
|
|
3495
3611
|
"startIndex": 1,
|
|
3496
|
-
"endIndex":
|
|
3612
|
+
"endIndex": 18
|
|
3497
3613
|
},
|
|
3498
3614
|
"releaseTag": "Beta",
|
|
3499
3615
|
"isProtected": false,
|
|
@@ -3831,6 +3947,80 @@
|
|
|
3831
3947
|
"isProtected": false,
|
|
3832
3948
|
"isAbstract": false
|
|
3833
3949
|
},
|
|
3950
|
+
{
|
|
3951
|
+
"kind": "Property",
|
|
3952
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#liveSubAgentName:member",
|
|
3953
|
+
"docComment": "",
|
|
3954
|
+
"excerptTokens": [
|
|
3955
|
+
{
|
|
3956
|
+
"kind": "Content",
|
|
3957
|
+
"text": "get liveSubAgentName(): "
|
|
3958
|
+
},
|
|
3959
|
+
{
|
|
3960
|
+
"kind": "Content",
|
|
3961
|
+
"text": "string | null"
|
|
3962
|
+
},
|
|
3963
|
+
{
|
|
3964
|
+
"kind": "Content",
|
|
3965
|
+
"text": ";\n\nset liveSubAgentName(value: string | null);"
|
|
3966
|
+
}
|
|
3967
|
+
],
|
|
3968
|
+
"isReadonly": false,
|
|
3969
|
+
"isOptional": false,
|
|
3970
|
+
"releaseTag": "Beta",
|
|
3971
|
+
"name": "liveSubAgentName",
|
|
3972
|
+
"propertyTypeTokenRange": {
|
|
3973
|
+
"startIndex": 1,
|
|
3974
|
+
"endIndex": 2
|
|
3975
|
+
},
|
|
3976
|
+
"isStatic": false,
|
|
3977
|
+
"isProtected": false,
|
|
3978
|
+
"isAbstract": false
|
|
3979
|
+
},
|
|
3980
|
+
{
|
|
3981
|
+
"kind": "Property",
|
|
3982
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#liveSubAgentTrace:member",
|
|
3983
|
+
"docComment": "",
|
|
3984
|
+
"excerptTokens": [
|
|
3985
|
+
{
|
|
3986
|
+
"kind": "Content",
|
|
3987
|
+
"text": "get liveSubAgentTrace(): "
|
|
3988
|
+
},
|
|
3989
|
+
{
|
|
3990
|
+
"kind": "Reference",
|
|
3991
|
+
"text": "ChatMessage",
|
|
3992
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
|
|
3993
|
+
},
|
|
3994
|
+
{
|
|
3995
|
+
"kind": "Content",
|
|
3996
|
+
"text": "[]"
|
|
3997
|
+
},
|
|
3998
|
+
{
|
|
3999
|
+
"kind": "Content",
|
|
4000
|
+
"text": ";\n\nset liveSubAgentTrace(value: "
|
|
4001
|
+
},
|
|
4002
|
+
{
|
|
4003
|
+
"kind": "Reference",
|
|
4004
|
+
"text": "ChatMessage",
|
|
4005
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
|
|
4006
|
+
},
|
|
4007
|
+
{
|
|
4008
|
+
"kind": "Content",
|
|
4009
|
+
"text": "[]);"
|
|
4010
|
+
}
|
|
4011
|
+
],
|
|
4012
|
+
"isReadonly": false,
|
|
4013
|
+
"isOptional": false,
|
|
4014
|
+
"releaseTag": "Beta",
|
|
4015
|
+
"name": "liveSubAgentTrace",
|
|
4016
|
+
"propertyTypeTokenRange": {
|
|
4017
|
+
"startIndex": 1,
|
|
4018
|
+
"endIndex": 3
|
|
4019
|
+
},
|
|
4020
|
+
"isStatic": false,
|
|
4021
|
+
"isProtected": false,
|
|
4022
|
+
"isAbstract": false
|
|
4023
|
+
},
|
|
3834
4024
|
{
|
|
3835
4025
|
"kind": "Property",
|
|
3836
4026
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#messages:member",
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -290,6 +290,10 @@ declare interface BaseAgentConfig {
|
|
|
290
290
|
* Used to establish agent identity and behavioural rules.
|
|
291
291
|
*/
|
|
292
292
|
primerHistory?: ChatMessage[];
|
|
293
|
+
/**
|
|
294
|
+
* Sub-agents available to this agent's tool handlers via `requestSubAgent`.
|
|
295
|
+
*/
|
|
296
|
+
subAgents?: AgentConfig[];
|
|
293
297
|
}
|
|
294
298
|
|
|
295
299
|
/**
|
|
@@ -325,12 +329,33 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
325
329
|
/** Consecutive unknown-tool calls without a real tool call. Reset on real tool execution. */
|
|
326
330
|
private consecutiveUnknownToolCalls;
|
|
327
331
|
private readonly maxFoldOperations;
|
|
332
|
+
/** Sub-agents declared on the active agent config, keyed by name. */
|
|
333
|
+
private subAgentsMap;
|
|
334
|
+
/**
|
|
335
|
+
* Set by `completeSubAgent` inside a sub-agent tool handler. Checked at the
|
|
336
|
+
* same point in the loop as `REQUEST_CONTINUATION_TOOL` — after tool results
|
|
337
|
+
* are appended — so the exit path mirrors the system-call pattern.
|
|
338
|
+
* `undefined` means the loop has not been stopped early.
|
|
339
|
+
*/
|
|
340
|
+
private subAgentCompletion;
|
|
341
|
+
/**
|
|
342
|
+
* Trace from the most recently completed sub-agent invocation within the
|
|
343
|
+
* current tool iteration. Consumed and cleared by the back-patching step.
|
|
344
|
+
*/
|
|
345
|
+
private pendingSubAgentTrace;
|
|
328
346
|
constructor(aiProvider: AIProvider, toolHandlers?: ChatToolHandlers, toolDefinitions?: ChatToolDefinition[], systemPrompt?: string, primerHistory?: ChatMessage[], maxToolIterations?: number, maxFoldOperations?: number);
|
|
329
347
|
/**
|
|
330
348
|
* Swap in a new agent's configuration. Called by OrchestratingDriver before
|
|
331
349
|
* each specialist turn so the shared driver runs with the right tools and prompt.
|
|
332
350
|
*/
|
|
333
351
|
applyAgent(config: AgentConfig): void;
|
|
352
|
+
/**
|
|
353
|
+
* Returns the early-stop result set by `completeSubAgent`, if any.
|
|
354
|
+
* Called by a parent `ChatDriver` after running this instance as a sub-agent.
|
|
355
|
+
*/
|
|
356
|
+
getSubAgentCompletion(): {
|
|
357
|
+
result: unknown;
|
|
358
|
+
} | undefined;
|
|
334
359
|
/**
|
|
335
360
|
* Optional transform applied to conversation history immediately before each LLM request.
|
|
336
361
|
* Cleared when `undefined`. Does not alter stored history.
|
|
@@ -361,6 +386,17 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
361
386
|
*/
|
|
362
387
|
loadHistory(messages: ChatMessage[]): void;
|
|
363
388
|
sendMessage(userInput: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
389
|
+
/**
|
|
390
|
+
* Builds the context object passed to every tool handler call.
|
|
391
|
+
* Centralised here so fold shortcut dispatch and the main tool loop use the
|
|
392
|
+
* same context without duplication.
|
|
393
|
+
*/
|
|
394
|
+
private buildHandlerContext;
|
|
395
|
+
/**
|
|
396
|
+
* Creates a child `ChatDriver` for the named sub-agent, runs it to completion,
|
|
397
|
+
* and returns its structured result (or final text fallback) plus the trace.
|
|
398
|
+
*/
|
|
399
|
+
private invokeSubAgent;
|
|
364
400
|
/**
|
|
365
401
|
* Continue the tool loop from current history without appending a new user message.
|
|
366
402
|
* Used by OrchestratingDriver after an agent handoff.
|
|
@@ -461,6 +497,23 @@ export declare function createToolFold(config: {
|
|
|
461
497
|
exclusive?: boolean;
|
|
462
498
|
}): ToolFoldResult;
|
|
463
499
|
|
|
500
|
+
/**
|
|
501
|
+
* Identity helper that infers the narrowest possible type for an agent config,
|
|
502
|
+
* preserving string literal types (including `name`) without requiring `as const`.
|
|
503
|
+
*
|
|
504
|
+
* Use this when you need `typeof myAgent` to carry the literal `name` type —
|
|
505
|
+
* for example, when wiring `ChatToolHandlers<typeof myAgent>`.
|
|
506
|
+
*
|
|
507
|
+
* ```ts
|
|
508
|
+
* const myAgent = defineAgent({ name: 'my_agent', ... });
|
|
509
|
+
* type Handlers = ChatToolHandlers<typeof myAgent>;
|
|
510
|
+
* // requestSubAgent name param is now typed as 'my_agent'
|
|
511
|
+
* ```
|
|
512
|
+
*
|
|
513
|
+
* @beta
|
|
514
|
+
*/
|
|
515
|
+
export declare function defineAgent<const T extends AgentConfig>(config: T): T;
|
|
516
|
+
|
|
464
517
|
/**
|
|
465
518
|
* Expands a flat list of tool definitions into a nested tree by resolving fold
|
|
466
519
|
* metadata from the corresponding handlers. Use this for debug output so the
|
|
@@ -543,6 +596,10 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
543
596
|
/** Currently enabled animations. */
|
|
544
597
|
get enabledAnimations(): AiAssistantAnimation[];
|
|
545
598
|
set enabledAnimations(value: AiAssistantAnimation[]);
|
|
599
|
+
get liveSubAgentTrace(): ChatMessage[];
|
|
600
|
+
set liveSubAgentTrace(value: ChatMessage[]);
|
|
601
|
+
get liveSubAgentName(): string | null;
|
|
602
|
+
set liveSubAgentName(value: string | null);
|
|
546
603
|
/** Most recent prompt token count from the AI provider, if available. */
|
|
547
604
|
get contextTokens(): number | undefined;
|
|
548
605
|
set contextTokens(value: number | undefined);
|
|
@@ -659,6 +716,7 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
659
716
|
name: string;
|
|
660
717
|
systemPrompt?: string;
|
|
661
718
|
primerHistory?: ChatMessage[];
|
|
719
|
+
subAgents?: AgentConfig[];
|
|
662
720
|
} | {
|
|
663
721
|
toolDefinitions: ToolTreeNode[];
|
|
664
722
|
toolHandlers: any;
|
|
@@ -667,6 +725,7 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
667
725
|
name: string;
|
|
668
726
|
systemPrompt?: string;
|
|
669
727
|
primerHistory?: ChatMessage[];
|
|
728
|
+
subAgents?: AgentConfig[];
|
|
670
729
|
})[];
|
|
671
730
|
activeSystemPrompt: string;
|
|
672
731
|
activePrimerHistory: ChatMessage[];
|
|
@@ -42,12 +42,33 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
42
42
|
/** Consecutive unknown-tool calls without a real tool call. Reset on real tool execution. */
|
|
43
43
|
private consecutiveUnknownToolCalls;
|
|
44
44
|
private readonly maxFoldOperations;
|
|
45
|
+
/** Sub-agents declared on the active agent config, keyed by name. */
|
|
46
|
+
private subAgentsMap;
|
|
47
|
+
/**
|
|
48
|
+
* Set by `completeSubAgent` inside a sub-agent tool handler. Checked at the
|
|
49
|
+
* same point in the loop as `REQUEST_CONTINUATION_TOOL` — after tool results
|
|
50
|
+
* are appended — so the exit path mirrors the system-call pattern.
|
|
51
|
+
* `undefined` means the loop has not been stopped early.
|
|
52
|
+
*/
|
|
53
|
+
private subAgentCompletion;
|
|
54
|
+
/**
|
|
55
|
+
* Trace from the most recently completed sub-agent invocation within the
|
|
56
|
+
* current tool iteration. Consumed and cleared by the back-patching step.
|
|
57
|
+
*/
|
|
58
|
+
private pendingSubAgentTrace;
|
|
45
59
|
constructor(aiProvider: AIProvider, toolHandlers?: ChatToolHandlers, toolDefinitions?: ChatToolDefinition[], systemPrompt?: string, primerHistory?: ChatMessage[], maxToolIterations?: number, maxFoldOperations?: number);
|
|
46
60
|
/**
|
|
47
61
|
* Swap in a new agent's configuration. Called by OrchestratingDriver before
|
|
48
62
|
* each specialist turn so the shared driver runs with the right tools and prompt.
|
|
49
63
|
*/
|
|
50
64
|
applyAgent(config: AgentConfig): void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the early-stop result set by `completeSubAgent`, if any.
|
|
67
|
+
* Called by a parent `ChatDriver` after running this instance as a sub-agent.
|
|
68
|
+
*/
|
|
69
|
+
getSubAgentCompletion(): {
|
|
70
|
+
result: unknown;
|
|
71
|
+
} | undefined;
|
|
51
72
|
/**
|
|
52
73
|
* Optional transform applied to conversation history immediately before each LLM request.
|
|
53
74
|
* Cleared when `undefined`. Does not alter stored history.
|
|
@@ -78,6 +99,17 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
78
99
|
*/
|
|
79
100
|
loadHistory(messages: ChatMessage[]): void;
|
|
80
101
|
sendMessage(userInput: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Builds the context object passed to every tool handler call.
|
|
104
|
+
* Centralised here so fold shortcut dispatch and the main tool loop use the
|
|
105
|
+
* same context without duplication.
|
|
106
|
+
*/
|
|
107
|
+
private buildHandlerContext;
|
|
108
|
+
/**
|
|
109
|
+
* Creates a child `ChatDriver` for the named sub-agent, runs it to completion,
|
|
110
|
+
* and returns its structured result (or final text fallback) plus the trace.
|
|
111
|
+
*/
|
|
112
|
+
private invokeSubAgent;
|
|
81
113
|
/**
|
|
82
114
|
* Continue the tool loop from current history without appending a new user message.
|
|
83
115
|
* Used by OrchestratingDriver after an agent handoff.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EAGX,kBAAkB,EAClB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EAGX,kBAAkB,EAClB,gBAAgB,EAEjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQxE,wFAAwF;AACxF,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAMhE;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AAQ9E;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAA8C,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAA8C,MAAM,qBAAqB,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA+CxE;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,WAAY,YAAW,QAAQ;IAWpE,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAXzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA0B;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAsB;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAS;IACjD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAE3C,WAAW,CAAC,EAAE,WAAW,CAAC;gBAGP,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,WAAW,EAAE,EACtC,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;KACvB;IA6CR,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAIhE,MAAM,IAAI,OAAO;IAIjB,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAI1C,aAAa,IAAI,SAAS,WAAW,EAAE;IAIjC,cAAc,CAClB,OAAO,EAAE,WAAW,EAAE,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,eAAe,EAAE,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC;IASd,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0DrF,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIrF,OAAO,CAAC,UAAU;YAsBJ,QAAQ;IAkEtB,OAAO,CAAC,mBAAmB;CAO5B"}
|
|
@@ -21,6 +21,10 @@ interface BaseAgentConfig {
|
|
|
21
21
|
* Used to establish agent identity and behavioural rules.
|
|
22
22
|
*/
|
|
23
23
|
primerHistory?: ChatMessage[];
|
|
24
|
+
/**
|
|
25
|
+
* Sub-agents available to this agent's tool handlers via `requestSubAgent`.
|
|
26
|
+
*/
|
|
27
|
+
subAgents?: AgentConfig[];
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
30
|
* Configuration for a specialist agent.
|
|
@@ -63,5 +67,21 @@ export interface FallbackAgentConfig extends BaseAgentConfig {
|
|
|
63
67
|
* @beta
|
|
64
68
|
*/
|
|
65
69
|
export type AgentConfig = SpecialistAgentConfig | FallbackAgentConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Identity helper that infers the narrowest possible type for an agent config,
|
|
72
|
+
* preserving string literal types (including `name`) without requiring `as const`.
|
|
73
|
+
*
|
|
74
|
+
* Use this when you need `typeof myAgent` to carry the literal `name` type —
|
|
75
|
+
* for example, when wiring `ChatToolHandlers<typeof myAgent>`.
|
|
76
|
+
*
|
|
77
|
+
* ```ts
|
|
78
|
+
* const myAgent = defineAgent({ name: 'my_agent', ... });
|
|
79
|
+
* type Handlers = ChatToolHandlers<typeof myAgent>;
|
|
80
|
+
* // requestSubAgent name param is now typed as 'my_agent'
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @beta
|
|
84
|
+
*/
|
|
85
|
+
export declare function defineAgent<const T extends AgentConfig>(config: T): T;
|
|
66
86
|
export {};
|
|
67
87
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEpG,UAAU,eAAe;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACvC;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEpG,UAAU,eAAe;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACvC;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D;;OAEG;IACH,QAAQ,EAAE,IAAI,CAAC;IACf,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,qBAAqB,GAAG,mBAAmB,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,WAAW,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAErE"}
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
60
60
|
/** Currently enabled animations. */
|
|
61
61
|
get enabledAnimations(): AiAssistantAnimation[];
|
|
62
62
|
set enabledAnimations(value: AiAssistantAnimation[]);
|
|
63
|
+
get liveSubAgentTrace(): ChatMessage[];
|
|
64
|
+
set liveSubAgentTrace(value: ChatMessage[]);
|
|
65
|
+
get liveSubAgentName(): string | null;
|
|
66
|
+
set liveSubAgentName(value: string | null);
|
|
63
67
|
/** Most recent prompt token count from the AI provider, if available. */
|
|
64
68
|
get contextTokens(): number | undefined;
|
|
65
69
|
set contextTokens(value: number | undefined);
|
|
@@ -176,6 +180,7 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
176
180
|
name: string;
|
|
177
181
|
systemPrompt?: string;
|
|
178
182
|
primerHistory?: ChatMessage[];
|
|
183
|
+
subAgents?: AgentConfig[];
|
|
179
184
|
} | {
|
|
180
185
|
toolDefinitions: import("../utils/tool-fold").ToolTreeNode[];
|
|
181
186
|
toolHandlers: any;
|
|
@@ -184,6 +189,7 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
184
189
|
name: string;
|
|
185
190
|
systemPrompt?: string;
|
|
186
191
|
primerHistory?: ChatMessage[];
|
|
192
|
+
subAgents?: AgentConfig[];
|
|
187
193
|
})[];
|
|
188
194
|
activeSystemPrompt: string;
|
|
189
195
|
activePrimerHistory: ChatMessage[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EAGL,cAAc,EAIf,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AASpD,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EACjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EAGL,cAAc,EAIf,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AASpD,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EACjB,MAAM,cAAc,CAAC;AA6Bt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,IAAI;IAIxB,gBAAgB,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAIhC,gBAAgB,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;IAIlD,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAU5C,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,cAAc;YASR,iBAAiB;IAmC/B,eAAe;IAIf,qBAAqB,CAAC,UAAU,EAAE,MAAM;YAK1B,gBAAgB;YAuDhB,IAAI;IAkClB,OAAO,CAAC,yBAAyB;IAQjC,qBAAqB,CAAC,CAAC,EAAE,UAAU;IAYnC,0BAA0B,CAAC,CAAC,EAAE,KAAK;CAQpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,iDAymBlB,CAAC"}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whitespace in FAST templates
|
|
3
|
+
* ────────────────────────────
|
|
4
|
+
* The formatter adds newlines/indentation to static template string parts,
|
|
5
|
+
* which FAST renders as real text nodes. With `white-space: pre-wrap` these
|
|
6
|
+
* are visible as blank lines. To avoid this:
|
|
7
|
+
*
|
|
8
|
+
* - Apply `white-space: pre-wrap` only on leaf elements whose *content* needs
|
|
9
|
+
* it, never on containers.
|
|
10
|
+
* - Inside pre-wrap elements keep content on the same line as the opening tag:
|
|
11
|
+
* GOOD `<div>${expr}</div>` / BAD `<div>\n ${expr}\n</div>`
|
|
12
|
+
* - Extract shared or deeply-nested templates as named module-level consts to
|
|
13
|
+
* keep indentation shallow.
|
|
14
|
+
* - Chain adjacent `when()` calls as `${when(a,tA)}${when(b,tB)}` — separate
|
|
15
|
+
* lines let the formatter inject whitespace between them.
|
|
16
|
+
*/
|
|
1
17
|
import { ViewTemplate } from '@genesislcap/web-core';
|
|
2
18
|
import type { FoundationAiAssistant } from './main';
|
|
3
19
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAA2B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAiIpD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CA0ZpC,CAAC"}
|
|
@@ -20,6 +20,10 @@ export interface AiAssistantSessionState {
|
|
|
20
20
|
activeAgent: Omit<AgentConfig, 'toolHandlers'> | undefined;
|
|
21
21
|
/** Draft text in the input box — preserved across pop-in/pop-out cycles. */
|
|
22
22
|
inputValue: string;
|
|
23
|
+
/** Live trace from a currently-executing sub-agent. Cleared on sub-agent-stop. */
|
|
24
|
+
liveSubAgentTrace: ChatMessage[];
|
|
25
|
+
/** Name of the currently-executing sub-agent, or null when idle. */
|
|
26
|
+
liveSubAgentName: string | null;
|
|
23
27
|
}
|
|
24
28
|
export declare const defaultSessionState: AiAssistantSessionState;
|
|
25
29
|
export declare const aiAssistantSlice: import("@reduxjs/toolkit").Slice<AiAssistantSessionState, {
|
|
@@ -34,5 +38,7 @@ export declare const aiAssistantSlice: import("@reduxjs/toolkit").Slice<AiAssist
|
|
|
34
38
|
setContextLimit(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<number | undefined>): void;
|
|
35
39
|
setActiveAgent(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<Omit<AgentConfig, "toolHandlers"> | undefined>): void;
|
|
36
40
|
setInputValue(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<string>): void;
|
|
41
|
+
setLiveSubAgentTrace(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<ChatMessage[]>): void;
|
|
42
|
+
setLiveSubAgentName(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<string | null>): void;
|
|
37
43
|
}, "aiAssistant", "aiAssistant", {}>;
|
|
38
44
|
//# sourceMappingURL=ai-assistant-slice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-assistant-slice.d.ts","sourceRoot":"","sources":["../../../src/state/ai-assistant-slice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEnG;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB,EAAE,OAAO,CAAC;IAClC,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;IAC1C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,SAAS,CAAC;IAC3D,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"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CAAC,gBAAgB,CAAC;4FAGlC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;2FAGlC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;0FAGlC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,SAAS,CAAC;yFAG7D,aAAa,CAAC,MAAM,CAAC;gGAGd,aAAa,CAAC,WAAW,EAAE,CAAC;+FAG7B,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC;oCAKjE,CAAC"}
|
|
@@ -12,6 +12,8 @@ declare function makeStore(devTools: boolean | undefined): import("@genesislcap/
|
|
|
12
12
|
setContextLimit(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<number | undefined>): void;
|
|
13
13
|
setActiveAgent(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<Omit<import("..").AgentConfig, "toolHandlers"> | undefined>): void;
|
|
14
14
|
setInputValue(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<string>): void;
|
|
15
|
+
setLiveSubAgentTrace(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("@genesislcap/foundation-ai").ChatMessage[]>): void;
|
|
16
|
+
setLiveSubAgentName(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<string | null>): void;
|
|
15
17
|
}, "aiAssistant", "aiAssistant", {}>[]>;
|
|
16
18
|
/**
|
|
17
19
|
* Returns the session store for the given key, creating one if it does not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../src/state/session-store.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAIvD,iBAAS,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS
|
|
1
|
+
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../src/state/session-store.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAIvD,iBAAS,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS;;;;;;;;;;;;;;wCAM/C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAMnF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
+
/**
|
|
3
|
+
* Prepares history for the LLM only: masks tool call args and results from other
|
|
4
|
+
* agents so the active specialist is not confused by tools it does not have.
|
|
5
|
+
* Canonical history in `ChatDriver` stays unmasked for UI and logging.
|
|
6
|
+
*/
|
|
7
|
+
export declare function transformHistoryForAgent(history: ChatMessage[], agentName: string): ChatMessage[];
|
|
8
|
+
/**
|
|
9
|
+
* Applies a history cap for sub-agent context: the last `cap` messages are passed
|
|
10
|
+
* verbatim; older messages have their tool payloads masked.
|
|
11
|
+
*/
|
|
12
|
+
export declare function applyHistoryCap(history: readonly ChatMessage[], cap: number): ChatMessage[];
|
|
13
|
+
//# sourceMappingURL=history-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-transform.d.ts","sourceRoot":"","sources":["../../../src/utils/history-transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAoB9D;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE,CAKjG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,EAAE,CAG3F"}
|