@cueloop/client 0.1.0-alpha.100 → 0.1.0-alpha.102
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/package.json +5 -5
- package/src/annotations/components/AnnotationCards.tsx +15 -1
- package/src/annotations/use-annotation-surface.tsx +64 -21
- package/src/app/App.thread-agent.test.ts +8 -0
- package/src/app/App.tsx +23 -6
- package/src/diff/components/AnnotatableFileView.tsx +2 -2
- package/src/diff/components/DiffContentView.tsx +3 -3
- package/src/integrations/components/ShareDialog.agent.test.tsx +50 -0
- package/src/integrations/components/ShareDialog.tsx +27 -3
- package/src/integrations/components/share-dialog-store.ts +4 -0
- package/src/markdown/components/ThreadView.tsx +4 -4
- package/src/thread/agent-transcript.ts +11 -10
- package/src/thread/components/AgentThreadPane.test.tsx +335 -4
- package/src/thread/components/AgentThreadPane.tsx +61 -31
- package/src/thread/thread-controller.ts +30 -22
- package/src/thread/use-thread-agent.ts +7 -1
|
@@ -8,7 +8,7 @@ export type ThreadAgentClient = Pick<
|
|
|
8
8
|
DaemonClient,
|
|
9
9
|
"agentGet" | "agentPrompt" | "agentCancel" | "agentComment" | "agentPermission"
|
|
10
10
|
> &
|
|
11
|
-
Partial<Pick<DaemonClient, "agentConfigure"
|
|
11
|
+
Partial<Pick<DaemonClient, "agentConfigure" | "onEvent">> & { canControlAgent?: boolean };
|
|
12
12
|
|
|
13
13
|
/** Subscribe to durable agent state; unmount closes only this client connection. */
|
|
14
14
|
export function useThreadAgent(id: string, home?: string, injected?: ThreadAgentClient) {
|
|
@@ -48,6 +48,12 @@ export function useThreadAgent(id: string, home?: string, injected?: ThreadAgent
|
|
|
48
48
|
void (async () => {
|
|
49
49
|
try {
|
|
50
50
|
if (injected) {
|
|
51
|
+
unsubscribe = injected.onEvent?.((event) => {
|
|
52
|
+
if (event.event === "agent.updated" && event.sessionId === id)
|
|
53
|
+
void refresh(injected).catch((error) => {
|
|
54
|
+
if (!cancelled) setError(String(error));
|
|
55
|
+
});
|
|
56
|
+
});
|
|
51
57
|
await refresh(injected);
|
|
52
58
|
await configure(injected);
|
|
53
59
|
|