@blackbelt-technology/pi-dashboard-extension 0.4.6 → 0.5.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/package.json +2 -2
- package/src/__tests__/build-provider-catalogue.test.ts +176 -0
- package/src/__tests__/markdown-image-inliner.test.ts +355 -0
- package/src/__tests__/openspec-activity-detector.test.ts +68 -0
- package/src/__tests__/prompt-expander.test.ts +45 -0
- package/src/__tests__/server-launcher.test.ts +24 -1
- package/src/bridge.ts +110 -1
- package/src/command-handler.ts +6 -0
- package/src/markdown-image-inliner.ts +268 -0
- package/src/prompt-expander.ts +50 -2
- package/src/provider-register.ts +117 -0
- package/src/server-launcher.ts +18 -1
- package/src/session-sync.ts +5 -0
package/src/server-launcher.ts
CHANGED
|
@@ -45,6 +45,23 @@ export function resolveServerCliPath(): string {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Build the environment object passed to the spawned server process.
|
|
50
|
+
* Always stamps DASHBOARD_STARTER=Bridge so the server knows it was
|
|
51
|
+
* launched by the pi bridge extension.
|
|
52
|
+
*/
|
|
53
|
+
export function buildSpawnEnv(
|
|
54
|
+
baseEnv: NodeJS.ProcessEnv = process.env,
|
|
55
|
+
): Record<string, string> {
|
|
56
|
+
// Spread process.env (may contain undefined values); filter them out.
|
|
57
|
+
const out: Record<string, string> = {};
|
|
58
|
+
for (const [k, v] of Object.entries(baseEnv)) {
|
|
59
|
+
if (v !== undefined) out[k] = v;
|
|
60
|
+
}
|
|
61
|
+
out["DASHBOARD_STARTER"] = "Bridge";
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
|
|
48
65
|
/**
|
|
49
66
|
* Build the spawn arguments from config.
|
|
50
67
|
*/
|
|
@@ -94,7 +111,7 @@ export async function launchServer(config: DashboardConfig): Promise<LaunchResul
|
|
|
94
111
|
const r = await spawnDetached({
|
|
95
112
|
cmd: process.execPath,
|
|
96
113
|
args: ["--import", loader, entry, ...args], // ban:raw-node-import-ok: entry gated by shouldUrlWrapEntry
|
|
97
|
-
env: { ...process.env },
|
|
114
|
+
env: { ...process.env, DASHBOARD_STARTER: "Bridge" },
|
|
98
115
|
logFd,
|
|
99
116
|
});
|
|
100
117
|
|
package/src/session-sync.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { detectSessionSource } from "./source-detector.js";
|
|
|
8
8
|
import { replayEntriesAsEvents } from "@blackbelt-technology/pi-dashboard-shared/state-replay.js";
|
|
9
9
|
import { gatherGitInfo, gatherJjInfo } from "./vcs-info.js";
|
|
10
10
|
import type { FlowInfo } from "@blackbelt-technology/pi-dashboard-shared/types.js";
|
|
11
|
+
import { buildProviderCatalogue } from "./provider-register.js";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Send full state sync to the server (session_register, commands, flows, models).
|
|
@@ -72,6 +73,8 @@ export function sendStateSync(
|
|
|
72
73
|
id: m.id,
|
|
73
74
|
}));
|
|
74
75
|
bc.connection.send({ type: "models_list", sessionId: bc.sessionId, models });
|
|
76
|
+
// See change: replace-hardcoded-provider-lists.
|
|
77
|
+
bc.connection.send({ type: "providers_list", sessionId: bc.sessionId, providers: buildProviderCatalogue() });
|
|
75
78
|
} catch { /* ignore */ }
|
|
76
79
|
}
|
|
77
80
|
}
|
|
@@ -164,6 +167,8 @@ export function handleSessionChange(
|
|
|
164
167
|
id: m.id,
|
|
165
168
|
}));
|
|
166
169
|
bc.connection.send({ type: "models_list", sessionId: bc.sessionId, models });
|
|
170
|
+
// See change: replace-hardcoded-provider-lists.
|
|
171
|
+
bc.connection.send({ type: "providers_list", sessionId: bc.sessionId, providers: buildProviderCatalogue() });
|
|
167
172
|
} catch { /* ignore */ }
|
|
168
173
|
}
|
|
169
174
|
}
|