@feedmepos/mf-miniprogram-v2 0.1.0-dev.38 → 0.1.0-dev.39
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/{ControlPlaneView-DZoVMSTs.js → ControlPlaneView-BkNnhN9g.js} +5595 -5316
- package/dist/app.js +1 -1
- package/dist/package.json +1 -1
- package/dist/src/composables/latestPoller.d.ts +14 -0
- package/dist/src/composables/useAgentBridge.d.ts +35 -0
- package/dist/src/composables/useProject.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/app.js
CHANGED
package/dist/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PollResult<T> {
|
|
2
|
+
value: T;
|
|
3
|
+
done: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface LatestPollerOptions {
|
|
6
|
+
intervalMs: number;
|
|
7
|
+
maxAttempts: number;
|
|
8
|
+
wait?: (intervalMs: number, signal: AbortSignal) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createLatestPoller(options: LatestPollerOptions): {
|
|
11
|
+
start: <T>(request: (signal: AbortSignal) => Promise<PollResult<T>>, apply: (value: T) => void) => Promise<void>;
|
|
12
|
+
cancel: () => void;
|
|
13
|
+
dispose: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presence + command channel for the agent's preview tools.
|
|
3
|
+
*
|
|
4
|
+
* The agent cannot see a rendered SPA from inside its sandbox, so its
|
|
5
|
+
* preview_* tools are executed by a browser: the control plane pushes the
|
|
6
|
+
* command down this WebSocket and this tab relays it into the preview iframe.
|
|
7
|
+
*
|
|
8
|
+
* Several tabs can watch one session. Exactly one of them holds control and is
|
|
9
|
+
* the only one the agent ever drives — fanning a click out to every open tab
|
|
10
|
+
* would both duplicate the action and race the answers back. Control follows
|
|
11
|
+
* the conversation: sending a prompt moves it to the tab that sent it (see
|
|
12
|
+
* useChat.sendMessage), which is why there is no manual takeover control.
|
|
13
|
+
*
|
|
14
|
+
* The server owns the election; this composable only reflects it. It is a
|
|
15
|
+
* module-level singleton because two consumers need the same socket — the
|
|
16
|
+
* preview panel, which executes commands against its iframe, and the chat send
|
|
17
|
+
* path, which claims control — and only one workspace is ever open per page.
|
|
18
|
+
*/
|
|
19
|
+
export type AgentBridgePresence = {
|
|
20
|
+
clientCount: number;
|
|
21
|
+
controllerId: string | null;
|
|
22
|
+
};
|
|
23
|
+
/** Runs one command against this tab's preview iframe. */
|
|
24
|
+
export type AgentCommandExecutor = (command: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
25
|
+
export declare function useAgentBridge(): {
|
|
26
|
+
connected: import("vue").Ref<boolean, boolean>;
|
|
27
|
+
isController: import("vue").Ref<boolean, boolean>;
|
|
28
|
+
clientCount: import("vue").Ref<number, number>;
|
|
29
|
+
lastError: import("vue").Ref<string | null, string | null>;
|
|
30
|
+
attach: (businessId: string, sessionId: string) => Promise<void>;
|
|
31
|
+
detach: () => void;
|
|
32
|
+
setExecutor: (fn: AgentCommandExecutor | null) => void;
|
|
33
|
+
takeControl: () => boolean;
|
|
34
|
+
};
|
|
35
|
+
export type AgentBridgeStore = ReturnType<typeof useAgentBridge>;
|
|
@@ -163,7 +163,7 @@ export declare function useProject(): {
|
|
|
163
163
|
refreshProject: () => Promise<ProjectSummary>;
|
|
164
164
|
provisionProject: () => Promise<ProjectSummary>;
|
|
165
165
|
refreshSessions: () => Promise<void>;
|
|
166
|
-
refreshReleases: () => Promise<{
|
|
166
|
+
refreshReleases: (signal?: AbortSignal) => Promise<{
|
|
167
167
|
releases: ReleaseSummary[];
|
|
168
168
|
}>;
|
|
169
169
|
selectRelease: (releaseId: string) => Promise<void>;
|