@omercnet/paseo-agent-crew 0.3.0-next.137.1 → 0.3.0-next.146.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/README.md +1 -1
- package/client/crew.ts +39 -4
- package/package.json +1 -1
- package/paseo-plugin.json +2 -3
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ bun run test:coverage
|
|
|
129
129
|
bun run typecheck
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
The manifest
|
|
132
|
+
The manifest requires Paseo `^0.9.0`. The project pins `@getpaseo/cli`, `@getpaseo/client`,
|
|
133
133
|
`@getpaseo/plugin`, and `@getpaseo/protocol` to `0.9.0` for development. React 19.1 and
|
|
134
134
|
React Native 0.81 match the host.
|
|
135
135
|
|
package/client/crew.ts
CHANGED
|
@@ -6,11 +6,46 @@ export type AgentEntry = Awaited<ReturnType<PaseoApi["agents"]["list"]>>["entrie
|
|
|
6
6
|
type AgentSnapshot = AgentEntry["agent"];
|
|
7
7
|
|
|
8
8
|
export function listenToCrewDirectory(paseo: PaseoApi, invalidate: () => void): () => void {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
let closed = false;
|
|
10
|
+
let removeAgentObserver: (() => void) | undefined;
|
|
11
|
+
let removeWorkspaceObserver: (() => void) | undefined;
|
|
12
|
+
let releaseAgentSubscription: (() => Promise<void>) | undefined;
|
|
13
|
+
let releaseWorkspaceSubscription: (() => Promise<void>) | undefined;
|
|
14
|
+
|
|
15
|
+
void paseo.agents
|
|
16
|
+
.list({ subscribe: {} })
|
|
17
|
+
.then(({ subscription }) => {
|
|
18
|
+
if (closed) return subscription.release();
|
|
19
|
+
releaseAgentSubscription = () => subscription.release();
|
|
20
|
+
removeAgentObserver = subscription.subscribe({
|
|
21
|
+
snapshot: invalidate,
|
|
22
|
+
update: invalidate,
|
|
23
|
+
});
|
|
24
|
+
})
|
|
25
|
+
.catch((error: unknown) => {
|
|
26
|
+
if (!closed) console.error("Agent Crew agent observation failed", error);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
void paseo.workspaces
|
|
30
|
+
.list({ subscribe: {} })
|
|
31
|
+
.then(({ subscription }) => {
|
|
32
|
+
if (closed) return subscription.release();
|
|
33
|
+
releaseWorkspaceSubscription = () => subscription.release();
|
|
34
|
+
removeWorkspaceObserver = subscription.subscribe({
|
|
35
|
+
snapshot: invalidate,
|
|
36
|
+
update: invalidate,
|
|
37
|
+
});
|
|
38
|
+
})
|
|
39
|
+
.catch((error: unknown) => {
|
|
40
|
+
if (!closed) console.error("Agent Crew workspace observation failed", error);
|
|
41
|
+
});
|
|
42
|
+
|
|
11
43
|
return () => {
|
|
12
|
-
|
|
13
|
-
|
|
44
|
+
closed = true;
|
|
45
|
+
removeAgentObserver?.();
|
|
46
|
+
removeWorkspaceObserver?.();
|
|
47
|
+
void releaseAgentSubscription?.();
|
|
48
|
+
void releaseWorkspaceSubscription?.();
|
|
14
49
|
};
|
|
15
50
|
}
|
|
16
51
|
|
package/package.json
CHANGED
package/paseo-plugin.json
CHANGED