@iloveagents/foundry-agent 0.1.5 → 1.0.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @iloveagents/foundry-agent
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9105483: shell: ChatConversationConfig API + sticky-runtime threadId
|
|
8
|
+
|
|
9
|
+
Lets a downstream module (e.g. `@ltwlf/spaces-web-ui`) attach a
|
|
10
|
+
`ChatConversationConfig` to its `ChatModule`. The shell then:
|
|
11
|
+
- Pre-mints a fresh thread UUID via `useRef` so the AG-UI runtime's
|
|
12
|
+
`threadId` is defined from first render — no `undefined → defined`
|
|
13
|
+
remount mid-conversation when the user sends the first message.
|
|
14
|
+
- Calls `config.useStickyConversationId()` (when declared) and
|
|
15
|
+
feeds the resulting id into the runtime so the chat stays "live"
|
|
16
|
+
while the user browses non-chat routes (Workspaces, Jobs, etc.).
|
|
17
|
+
- Per-config keyed child components (`StickyAwareRuntime` vs
|
|
18
|
+
`UrlOnlyRuntime`) so optional hooks satisfy Rules-of-Hooks across
|
|
19
|
+
multi-module config swaps.
|
|
20
|
+
|
|
21
|
+
UI: collapsible nav groups in `sidebar.tsx` with persisted state via
|
|
22
|
+
`useSyncExternalStore` + localStorage, plus stable group ordering via
|
|
23
|
+
new `priority` field in `nav-config.ts`.
|
|
24
|
+
|
|
25
|
+
`ag-ui-runtime-provider.tsx` accepts an external `threadId` and
|
|
26
|
+
`historyAdapterFactory` so the consuming app can wire its own
|
|
27
|
+
persistence (e.g. `ThreadHistoryAdapter` → REST `/api/conversations`).
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 2b10540: Fix `citationStore.clear()` so the registered handler survives per-conversation resets.
|
|
32
|
+
|
|
33
|
+
The previous implementation wiped both `results` AND `handler`. `useNewConversation` calls `clear()` on every "New Thread" click. Combined with the `registerOnce`-style handler registration in feature modules (e.g. SPACES' `registerSpacesCitationHandler`), the result was that all `[n]` citation markers in chat became inert non-clickable spans for the rest of the session after the first new-thread click. `clear()` now resets `results` only — the handler is module-level state and must persist.
|
|
34
|
+
|
|
3
35
|
## 0.1.5
|
|
4
36
|
|
|
5
37
|
## 0.1.4
|
package/package.json
CHANGED
|
@@ -33,14 +33,20 @@ describe("citationStore", () => {
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
describe("clear", () => {
|
|
36
|
-
it("resets results
|
|
36
|
+
it("resets results but preserves the registered handler", () => {
|
|
37
|
+
// The handler is registered once at app boot by a feature module
|
|
38
|
+
// (e.g. SPACES). It MUST survive "New Thread" / per-conversation
|
|
39
|
+
// resets — otherwise every [n] marker in chat becomes inert after
|
|
40
|
+
// the first new-thread click, since the registration guard
|
|
41
|
+
// suppresses re-binding for the rest of the session.
|
|
42
|
+
const handler: CitationHandler = { openCitation: () => {} };
|
|
37
43
|
citationStore.getState().setResults([mockResult]);
|
|
38
|
-
citationStore.getState().setHandler(
|
|
44
|
+
citationStore.getState().setHandler(handler);
|
|
39
45
|
|
|
40
46
|
citationStore.getState().clear();
|
|
41
47
|
|
|
42
48
|
expect(citationStore.getState().results).toEqual([]);
|
|
43
|
-
expect(citationStore.getState().handler).
|
|
49
|
+
expect(citationStore.getState().handler).toBe(handler);
|
|
44
50
|
});
|
|
45
51
|
});
|
|
46
52
|
});
|
|
@@ -26,7 +26,14 @@ interface CitationState {
|
|
|
26
26
|
setResults: (results: CitationResult[]) => void;
|
|
27
27
|
/** Register a handler for citation click actions */
|
|
28
28
|
setHandler: (handler: CitationHandler) => void;
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Reset per-conversation state. Clears ``results`` only — the handler
|
|
31
|
+
* is module-level state registered once at app boot by feature modules
|
|
32
|
+
* (e.g. ``registerSpacesCitationHandler``) and must persist across
|
|
33
|
+
* conversations. Wiping it on "New Thread" produced inert ``[n]``
|
|
34
|
+
* markers for the rest of the session, since the registration guard
|
|
35
|
+
* (``registerOnce`` in spaces ``use-spaces-init``) suppresses re-binding.
|
|
36
|
+
*/
|
|
30
37
|
clear: () => void;
|
|
31
38
|
}
|
|
32
39
|
|
|
@@ -41,5 +48,5 @@ export const citationStore = createStore<CitationState>((set) => ({
|
|
|
41
48
|
handler: null,
|
|
42
49
|
setResults: (results) => set({ results }),
|
|
43
50
|
setHandler: (handler) => set({ handler }),
|
|
44
|
-
clear: () => set({ results: []
|
|
51
|
+
clear: () => set({ results: [] }),
|
|
45
52
|
}));
|