@genesislcap/ai-assistant 15.106.0 → 15.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-assistant.api.json +1 -1
- package/dist/ai-assistant.d.ts +6 -4
- package/dist/chat-driver.cjs +108 -42
- package/dist/chat-driver.cjs.map +2 -2
- package/dist/chat-driver.mjs +108 -42
- package/dist/chat-driver.mjs.map +2 -2
- package/dist/custom-elements.json +67 -3
- package/dist/dts/chat-driver-node.d.ts +1 -1
- package/dist/dts/chat-driver-node.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/turn-recorder.d.ts +48 -12
- package/dist/dts/components/chat-driver/turn-recorder.d.ts.map +1 -1
- package/dist/dts/genesis/config.d.ts.map +1 -1
- package/dist/dts/state/persistence/diagnostics-cursors.d.ts +4 -1
- package/dist/dts/state/persistence/diagnostics-cursors.d.ts.map +1 -1
- package/dist/dts/state/persistence/diagnostics.d.ts +24 -0
- package/dist/dts/state/persistence/diagnostics.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-persister.d.ts +2 -2
- package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +42 -19
- package/dist/esm/components/chat-driver/turn-recorder.js +57 -35
- package/dist/esm/genesis/config.js +1 -1
- package/dist/esm/genesis/consumes.js +1 -1
- package/dist/esm/state/debug-event-log.js +4 -4
- package/dist/esm/state/persistence/diagnostics.js +9 -4
- package/dist/esm/state/persistence/session-persister.js +6 -5
- package/dist/genesis-consumes.cjs +1 -1
- package/dist/genesis-consumes.cjs.map +2 -2
- package/dist/genesis-consumes.mjs +1 -1
- package/dist/genesis-consumes.mjs.map +2 -2
- package/docs/genesis.md +2 -2
- package/docs/sub_agent.md +28 -16
- package/package.json +17 -17
- package/scripts/smoke-genesis-consumes-node.mjs +1 -1
package/docs/sub_agent.md
CHANGED
|
@@ -92,13 +92,21 @@ interface SubAgentRequestOptions {
|
|
|
92
92
|
task?: string;
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
95
|
+
* Keeps the last N parent messages verbatim and masks the tool call
|
|
96
|
+
* args and results in older ones. Every message, and all plain
|
|
97
|
+
* user/assistant text, is still sent. Ignored when `inheritHistory`
|
|
98
|
+
* is `false`.
|
|
99
99
|
*/
|
|
100
100
|
historyCap?: number;
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Whether the sub-agent starts from the parent's history. Defaults to
|
|
104
|
+
* `true`. `false` sends none of it: the sub-agent starts from the
|
|
105
|
+
* `[Sub-agent context]` message (if `context` is given) and its own
|
|
106
|
+
* `primerHistory`, then `task`.
|
|
107
|
+
*/
|
|
108
|
+
inheritHistory?: boolean;
|
|
109
|
+
|
|
102
110
|
/**
|
|
103
111
|
* Extra dynamic data for this invocation. Injected as a primer message
|
|
104
112
|
* immediately before the task, so the sub-agent sees it naturally as
|
|
@@ -262,28 +270,32 @@ The default (`{ name: string }`) leaves the name as `string` — no breaking cha
|
|
|
262
270
|
|
|
263
271
|
By default the sub-agent receives a snapshot of the full parent conversation history as context. The in-flight assistant message (the one containing the tool call that triggered the sub-agent) is excluded — it has unresolved tool calls that would confuse the sub-agent. Anything appended after it during the same batch is cut too: a widget the tool showed, the user's reply to it, a notice. Pass what the sub-agent needs from those through `task` or `context`.
|
|
264
272
|
|
|
265
|
-
Use `historyCap` to
|
|
273
|
+
Use `historyCap` to trim the tool payloads in older history. It is set per call:
|
|
266
274
|
|
|
267
275
|
```ts
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
// ...
|
|
273
|
-
},
|
|
274
|
-
],
|
|
276
|
+
await context.requestSubAgent('trade_file_extractor', {
|
|
277
|
+
historyCap: 2, // keep the last 2 parent messages verbatim; mask tool payloads in older ones
|
|
278
|
+
task: '...',
|
|
279
|
+
});
|
|
275
280
|
```
|
|
276
281
|
|
|
277
|
-
|
|
282
|
+
`historyCap` does not drop messages. Every message, and all plain user and assistant text, is still sent. Only the tool call args and results in messages older than the cap are replaced with a placeholder — the same masking used by the orchestrating driver for cross-agent history.
|
|
283
|
+
|
|
284
|
+
### Sending no parent history
|
|
285
|
+
|
|
286
|
+
Set `inheritHistory: false` to send none of the parent's history. The sub-agent's starting messages are then only the `[Sub-agent context]` message (when `context` is given) and the sub-agent's own `primerHistory`, followed by `task`. `historyCap` is ignored.
|
|
278
287
|
|
|
279
288
|
```ts
|
|
280
289
|
await context.requestSubAgent('trade_file_extractor', {
|
|
281
|
-
|
|
282
|
-
|
|
290
|
+
inheritHistory: false,
|
|
291
|
+
context: { fileName, sheetName },
|
|
292
|
+
task: 'Extract the trades from this sheet.',
|
|
283
293
|
});
|
|
284
294
|
```
|
|
285
295
|
|
|
286
|
-
|
|
296
|
+
Use it for a one-shot sub-agent that gets everything it needs through `task` and `context`. It saves the tokens of the inherited history, and keeps the parent's conversation, including any content the parent has read, out of the sub-agent's input.
|
|
297
|
+
|
|
298
|
+
On Gemini 2.5 models, a sub-agent whose `primerHistory` has no assistant turn sends a user-only first request together with a tools array (sub-agents always force tool use). That is the shape reported to trigger an empty response from Gemini 2.5; the transport-level fix is not implemented yet. Give such a sub-agent a `primerHistory` that includes an innocuous assistant turn, such as a greeting pair. See [gemini-empty-response.md](./gemini-empty-response.md).
|
|
287
299
|
|
|
288
300
|
---
|
|
289
301
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/ai-assistant",
|
|
3
3
|
"description": "Genesis AI Assistant micro-frontend",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.108.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/dts/index.d.ts",
|
|
@@ -102,31 +102,31 @@
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@genesislcap/foundation-comms": "15.
|
|
106
|
-
"@genesislcap/foundation-testing": "15.
|
|
107
|
-
"@genesislcap/genx": "15.
|
|
108
|
-
"@genesislcap/ts-builder": "15.
|
|
109
|
-
"@genesislcap/uvu-playwright-builder": "15.
|
|
110
|
-
"@genesislcap/vite-builder": "15.
|
|
111
|
-
"@genesislcap/webpack-builder": "15.
|
|
105
|
+
"@genesislcap/foundation-comms": "15.108.0",
|
|
106
|
+
"@genesislcap/foundation-testing": "15.108.0",
|
|
107
|
+
"@genesislcap/genx": "15.108.0",
|
|
108
|
+
"@genesislcap/ts-builder": "15.108.0",
|
|
109
|
+
"@genesislcap/uvu-playwright-builder": "15.108.0",
|
|
110
|
+
"@genesislcap/vite-builder": "15.108.0",
|
|
111
|
+
"@genesislcap/webpack-builder": "15.108.0",
|
|
112
112
|
"@types/dompurify": "^3.0.5",
|
|
113
113
|
"@types/marked": "^5.0.2",
|
|
114
114
|
"esbuild": "0.25.12"
|
|
115
115
|
},
|
|
116
116
|
"dependencies": {
|
|
117
|
-
"@genesislcap/foundation-ai": "15.
|
|
118
|
-
"@genesislcap/foundation-logger": "15.
|
|
119
|
-
"@genesislcap/foundation-notifications": "15.
|
|
120
|
-
"@genesislcap/foundation-redux": "15.
|
|
121
|
-
"@genesislcap/foundation-ui": "15.
|
|
122
|
-
"@genesislcap/foundation-utils": "15.
|
|
123
|
-
"@genesislcap/rapid-design-system": "15.
|
|
124
|
-
"@genesislcap/web-core": "15.
|
|
117
|
+
"@genesislcap/foundation-ai": "15.108.0",
|
|
118
|
+
"@genesislcap/foundation-logger": "15.108.0",
|
|
119
|
+
"@genesislcap/foundation-notifications": "15.108.0",
|
|
120
|
+
"@genesislcap/foundation-redux": "15.108.0",
|
|
121
|
+
"@genesislcap/foundation-ui": "15.108.0",
|
|
122
|
+
"@genesislcap/foundation-utils": "15.108.0",
|
|
123
|
+
"@genesislcap/rapid-design-system": "15.108.0",
|
|
124
|
+
"@genesislcap/web-core": "15.108.0",
|
|
125
125
|
"dompurify": "^3.3.1",
|
|
126
126
|
"marked": "^17.0.3"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
|
-
"@genesislcap/foundation-comms": "15.
|
|
129
|
+
"@genesislcap/foundation-comms": "15.108.0"
|
|
130
130
|
},
|
|
131
131
|
"peerDependenciesMeta": {
|
|
132
132
|
"@genesislcap/foundation-comms": {
|