@hachej/boring-ui-cli 0.1.61 → 0.1.62
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/server/modeApps.js +44 -2
- package/package.json +6 -6
package/dist/server/modeApps.js
CHANGED
|
@@ -367,6 +367,7 @@ async function createWorkspacesModeApp(opts) {
|
|
|
367
367
|
}
|
|
368
368
|
});
|
|
369
369
|
const bridges = /* @__PURE__ */ new Map();
|
|
370
|
+
const workspaceBridgeCores = /* @__PURE__ */ new Map();
|
|
370
371
|
const workspaceEventClosers = /* @__PURE__ */ new Map();
|
|
371
372
|
const pluginRuntimes = /* @__PURE__ */ new Map();
|
|
372
373
|
const pluginPiSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -379,6 +380,34 @@ async function createWorkspacesModeApp(opts) {
|
|
|
379
380
|
}
|
|
380
381
|
return bridge;
|
|
381
382
|
}
|
|
383
|
+
async function getWorkspaceBridgeCore(workspace) {
|
|
384
|
+
let core = workspaceBridgeCores.get(workspace.id);
|
|
385
|
+
if (core) return await core;
|
|
386
|
+
core = (async () => {
|
|
387
|
+
const pluginCollection = await workspaceAppServer.resolveWorkspaceAgentServerPluginCollection({
|
|
388
|
+
workspaceRoot: workspace.path,
|
|
389
|
+
bridge: getBridge(workspace.id),
|
|
390
|
+
defaultPluginPackages: pluginDiscovery.resolveCliDefaultPluginPackagePaths(),
|
|
391
|
+
installPluginAuthoring: false,
|
|
392
|
+
excludeDefaults: ["boring-ui-plugin-cli-package"]
|
|
393
|
+
});
|
|
394
|
+
const bridgeCore = workspaceServer.createWorkspaceBridgeRuntimeCore({
|
|
395
|
+
ownerWorkspaceId: workspace.id,
|
|
396
|
+
handlers: pluginCollection.workspaceBridgeHandlers ?? []
|
|
397
|
+
});
|
|
398
|
+
return {
|
|
399
|
+
registry: bridgeCore.registry,
|
|
400
|
+
idempotencyStore: new workspaceServer.InMemoryWorkspaceBridgeIdempotencyStore(),
|
|
401
|
+
extraTools: pluginCollection.agentOptions.extraTools ?? [],
|
|
402
|
+
preservedUiStateKeys: pluginCollection.preservedUiStateKeys ?? []
|
|
403
|
+
};
|
|
404
|
+
})().catch((error) => {
|
|
405
|
+
workspaceBridgeCores.delete(workspace.id);
|
|
406
|
+
throw error;
|
|
407
|
+
});
|
|
408
|
+
workspaceBridgeCores.set(workspace.id, core);
|
|
409
|
+
return await core;
|
|
410
|
+
}
|
|
382
411
|
async function requireWorkspace(workspaceId) {
|
|
383
412
|
const workspace = await registry.get(workspaceId);
|
|
384
413
|
if (!workspace) throw httpError("unknown workspace", 404);
|
|
@@ -446,6 +475,7 @@ async function createWorkspacesModeApp(opts) {
|
|
|
446
475
|
pluginRuntimes.delete(runtimeKey);
|
|
447
476
|
pluginPiSnapshots.delete(runtimeKey);
|
|
448
477
|
runtimeProvisioningByWorkspace.delete(workspace.id);
|
|
478
|
+
workspaceBridgeCores.delete(workspace.id);
|
|
449
479
|
bridges.delete(workspace.id);
|
|
450
480
|
diagnosticsStore.disposeWorkspace(workspace.id);
|
|
451
481
|
await runtimeHost.disposeWorkspace(workspace.id);
|
|
@@ -586,12 +616,24 @@ async function createWorkspacesModeApp(opts) {
|
|
|
586
616
|
getExtraTools: async ({ workspaceId, workspaceRoot, workspaceFsCapability }) => [
|
|
587
617
|
...workspaceServer.createWorkspaceUiTools(getBridge(workspaceId), {
|
|
588
618
|
workspaceRoot: workspaceFsCapability === "strong" ? workspaceRoot : void 0
|
|
589
|
-
})
|
|
619
|
+
}),
|
|
620
|
+
...(await getWorkspaceBridgeCore(await requireWorkspace(workspaceId))).extraTools
|
|
590
621
|
]
|
|
591
622
|
});
|
|
592
623
|
await app.register(workspaceServer.uiRoutes, {
|
|
593
624
|
getWorkspaceId: async (request) => (await workspaceFromRequest(request)).id,
|
|
594
|
-
getBridge: async (request) => getBridge((await workspaceFromRequest(request)).id)
|
|
625
|
+
getBridge: async (request) => getBridge((await workspaceFromRequest(request)).id),
|
|
626
|
+
getPreserveStateKeys: async (request) => (await getWorkspaceBridgeCore(await workspaceFromRequest(request))).preservedUiStateKeys
|
|
627
|
+
});
|
|
628
|
+
await app.register(workspaceServer.workspaceBridgeHttpRoutes, {
|
|
629
|
+
getRegistry: async (request) => (await getWorkspaceBridgeCore(await workspaceFromRequest(request))).registry,
|
|
630
|
+
getOwnerWorkspaceId: async (request) => (await workspaceFromRequest(request)).id,
|
|
631
|
+
getIdempotencyStore: async (request) => (await getWorkspaceBridgeCore(await workspaceFromRequest(request))).idempotencyStore,
|
|
632
|
+
browserAuthPolicy: {
|
|
633
|
+
resolve(input) {
|
|
634
|
+
return workspaceServer.createLocalCliBridgeAuthPolicy({ workspaceId: input.workspaceId }).resolve(input);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
595
637
|
});
|
|
596
638
|
app.get("/api/v1/runtime-plugin-diagnostics", async (request) => {
|
|
597
639
|
const workspace = await workspaceFromRequest(request);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachej/boring-ui-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.62",
|
|
4
4
|
"description": "Turn an agent into an app",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"lucide-react": "^1.8.0",
|
|
21
21
|
"typescript": "^5.8.3",
|
|
22
22
|
"vite": "^6.0.0",
|
|
23
|
-
"@hachej/boring-
|
|
24
|
-
"@hachej/boring-
|
|
25
|
-
"@hachej/boring-ui-
|
|
26
|
-
"@hachej/boring-workspace": "0.1.
|
|
27
|
-
"@hachej/boring-
|
|
23
|
+
"@hachej/boring-ui-kit": "0.1.62",
|
|
24
|
+
"@hachej/boring-agent": "0.1.62",
|
|
25
|
+
"@hachej/boring-ui-plugin-cli": "0.1.62",
|
|
26
|
+
"@hachej/boring-workspace": "0.1.62",
|
|
27
|
+
"@hachej/boring-ask-user": "0.1.62"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@tailwindcss/vite": "^4.0.0",
|