@genesislcap/ai-assistant 15.78.0 → 15.78.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 +64 -4
- package/dist/ai-assistant.d.ts +32 -9
- package/dist/chat-driver.cjs.map +1 -1
- package/dist/chat-driver.mjs.map +1 -1
- package/dist/custom-elements.json +568 -440
- package/dist/dts/config/config.d.ts +2 -2
- package/dist/dts/config/define-stateful-agent.d.ts +1 -1
- package/dist/dts/main/main.d.ts +23 -5
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/state/ai-assistant-slice.d.ts +4 -5
- package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-snapshot.d.ts +19 -6
- package/dist/dts/state/persistence/session-snapshot.d.ts.map +1 -1
- package/dist/dts/state/session-store.d.ts.map +1 -1
- package/dist/dts/utils/attachment-note.d.ts +18 -0
- package/dist/dts/utils/attachment-note.d.ts.map +1 -0
- package/dist/esm/main/main.js +58 -15
- package/dist/esm/main/main.template.js +2 -2
- package/dist/esm/state/persistence/session-persister.js +24 -21
- package/dist/esm/state/persistence/session-snapshot.js +20 -7
- package/dist/esm/utils/attachment-note.js +19 -0
- package/docs/styling.md +1 -1
- package/package.json +17 -17
- package/sandbox/fixtures.ts +3 -3
|
@@ -22,24 +22,26 @@ export function createPersistedSession(input) {
|
|
|
22
22
|
* unit-testable independent of the save path:
|
|
23
23
|
* - `resumeMessage`: the agent's `notResumableMessage` when non-blank, else the
|
|
24
24
|
* passed default.
|
|
25
|
-
* - `resumePrompt`: the
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* - `resumePrompt`: the last user message in the transcript — the request that was
|
|
26
|
+
* in flight — falling back to the captured flow-activating prompt when there is
|
|
27
|
+
* none; `undefined` when neither exists.
|
|
28
28
|
*
|
|
29
29
|
* @internal
|
|
30
30
|
*/
|
|
31
31
|
export function resolveNonResumableNotice(input) {
|
|
32
|
-
var _a, _b;
|
|
32
|
+
var _a, _b, _c;
|
|
33
33
|
const custom = input.notResumableMessage;
|
|
34
34
|
const resumeMessage = custom && custom.trim() ? custom : input.defaultMessage;
|
|
35
|
-
|
|
35
|
+
// Not the activation prompt first: a flow lock can outlive the turn that took it, and the
|
|
36
|
+
// freeze keeps the transcript through this message, so restore finds it already there.
|
|
37
|
+
const resumePrompt = (_c = (_b = (_a = input.messages[lastUserMessageIndex(input.messages)]) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : input.flowActivationPrompt) !== null && _c !== void 0 ? _c : undefined;
|
|
36
38
|
return { resumeMessage, resumePrompt };
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
41
|
* Index of the last `user`-role message in `messages`, or `-1` when there is none.
|
|
40
42
|
* The single backward scan behind "what did the user last say" — used to slice the
|
|
41
|
-
* transcript to a clean boundary (`keepThroughLastUserMessage`) and to
|
|
42
|
-
* flow
|
|
43
|
+
* transcript to a clean boundary (`keepThroughLastUserMessage`) and to pick the
|
|
44
|
+
* prompt an interrupted flow hands back. Allocation-free (no reversed copy).
|
|
43
45
|
*
|
|
44
46
|
* @internal
|
|
45
47
|
*/
|
|
@@ -51,6 +53,17 @@ export function lastUserMessageIndex(messages) {
|
|
|
51
53
|
}
|
|
52
54
|
return -1;
|
|
53
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* The files of the message an interrupted `prompt` came from: the last user message in
|
|
58
|
+
* `messages`, when its text is the prompt. An older snapshot's prompt can be another text, and
|
|
59
|
+
* that message's files are not its own.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export function interruptedPromptFiles(messages, prompt) {
|
|
64
|
+
const sent = messages[lastUserMessageIndex(messages)];
|
|
65
|
+
return prompt && (sent === null || sent === void 0 ? void 0 : sent.content) === prompt ? sent.attachments : undefined;
|
|
66
|
+
}
|
|
54
67
|
/**
|
|
55
68
|
* Type guard: is `value` a {@link PersistedSession} we can safely restore?
|
|
56
69
|
* Gates on matching schema version, same host, and a messages array — the
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The line naming the files under a message sent with attachments. Built and taken off only
|
|
3
|
+
* here, so the two can't drift.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
const attachmentNote = (files) => (files === null || files === void 0 ? void 0 : files.length) ? `\n\n*Attached: ${files.map((f) => f.name).join(', ')}*` : '';
|
|
8
|
+
/** What a message sent with `files` is stored and shown as: the typed text, then the line. */
|
|
9
|
+
export function withAttachmentNote(typed, files) {
|
|
10
|
+
return typed + attachmentNote(files);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The typed text of a message stored with `files`. Takes off only the line those files add, so
|
|
14
|
+
* nothing the user typed is cut.
|
|
15
|
+
*/
|
|
16
|
+
export function withoutAttachmentNote(text, files) {
|
|
17
|
+
const note = attachmentNote(files);
|
|
18
|
+
return note && text.endsWith(note) ? text.slice(0, -note.length) : text;
|
|
19
|
+
}
|
package/docs/styling.md
CHANGED
|
@@ -266,7 +266,7 @@ one round-icon-button shape; the agent one additionally carries a label.
|
|
|
266
266
|
| `composer-bar` | The control bar under the textarea |
|
|
267
267
|
| `composer-bar-start` / `composer-bar-end` | The leading (agent / attach / ⋮) and trailing (Stop, Send) clusters |
|
|
268
268
|
| `input` | The textarea |
|
|
269
|
-
| `agent-toggle-button` | Agent button — a `sitemap` glyph under orchestration, the pinned agent's tinted pin otherwise |
|
|
269
|
+
| `agent-toggle-button` | Agent button — a `sitemap` glyph under orchestration, the pinned agent's tinted pin otherwise (the flow owner's while a guided flow holds the picker) |
|
|
270
270
|
| `attach-button` | Attach (paperclip) |
|
|
271
271
|
| `session-menu-button` | Session options (⋮) |
|
|
272
272
|
| `stop-button` | Stop, shown only while a turn runs |
|
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.78.
|
|
4
|
+
"version": "15.78.1",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/ai-assistant.d.ts",
|
|
@@ -92,31 +92,31 @@
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@genesislcap/foundation-comms": "15.78.
|
|
96
|
-
"@genesislcap/foundation-testing": "15.78.
|
|
97
|
-
"@genesislcap/genx": "15.78.
|
|
98
|
-
"@genesislcap/ts-builder": "15.78.
|
|
99
|
-
"@genesislcap/uvu-playwright-builder": "15.78.
|
|
100
|
-
"@genesislcap/vite-builder": "15.78.
|
|
101
|
-
"@genesislcap/webpack-builder": "15.78.
|
|
95
|
+
"@genesislcap/foundation-comms": "15.78.1",
|
|
96
|
+
"@genesislcap/foundation-testing": "15.78.1",
|
|
97
|
+
"@genesislcap/genx": "15.78.1",
|
|
98
|
+
"@genesislcap/ts-builder": "15.78.1",
|
|
99
|
+
"@genesislcap/uvu-playwright-builder": "15.78.1",
|
|
100
|
+
"@genesislcap/vite-builder": "15.78.1",
|
|
101
|
+
"@genesislcap/webpack-builder": "15.78.1",
|
|
102
102
|
"@types/dompurify": "^3.0.5",
|
|
103
103
|
"@types/marked": "^5.0.2",
|
|
104
104
|
"esbuild": "0.25.12"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@genesislcap/foundation-ai": "15.78.
|
|
108
|
-
"@genesislcap/foundation-logger": "15.78.
|
|
109
|
-
"@genesislcap/foundation-notifications": "15.78.
|
|
110
|
-
"@genesislcap/foundation-redux": "15.78.
|
|
111
|
-
"@genesislcap/foundation-ui": "15.78.
|
|
112
|
-
"@genesislcap/foundation-utils": "15.78.
|
|
113
|
-
"@genesislcap/rapid-design-system": "15.78.
|
|
114
|
-
"@genesislcap/web-core": "15.78.
|
|
107
|
+
"@genesislcap/foundation-ai": "15.78.1",
|
|
108
|
+
"@genesislcap/foundation-logger": "15.78.1",
|
|
109
|
+
"@genesislcap/foundation-notifications": "15.78.1",
|
|
110
|
+
"@genesislcap/foundation-redux": "15.78.1",
|
|
111
|
+
"@genesislcap/foundation-ui": "15.78.1",
|
|
112
|
+
"@genesislcap/foundation-utils": "15.78.1",
|
|
113
|
+
"@genesislcap/rapid-design-system": "15.78.1",
|
|
114
|
+
"@genesislcap/web-core": "15.78.1",
|
|
115
115
|
"dompurify": "^3.3.1",
|
|
116
116
|
"marked": "^17.0.3"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
|
-
"@genesislcap/foundation-comms": "^15.78.
|
|
119
|
+
"@genesislcap/foundation-comms": "^15.78.1"
|
|
120
120
|
},
|
|
121
121
|
"peerDependenciesMeta": {
|
|
122
122
|
"@genesislcap/foundation-comms": {
|
package/sandbox/fixtures.ts
CHANGED
|
@@ -20,9 +20,9 @@ const STUB_PROMPT = 'Sandbox stub. Replies are canned.';
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Six specialists plus a fallback. The sandbox slices this list, so ordering is
|
|
23
|
-
* load-bearing in one place:
|
|
24
|
-
*
|
|
25
|
-
* changes.
|
|
23
|
+
* load-bearing in one place: pin colours are picked by index (the chip's
|
|
24
|
+
* `agentButtonColour` and the picker's dots), so slicing from the front keeps a
|
|
25
|
+
* given agent's pin colour stable as the count changes.
|
|
26
26
|
*/
|
|
27
27
|
const SPECIALISTS: AgentConfig[] = [
|
|
28
28
|
{
|