@jmfederico/pi-web 1.202610.2 → 1.202610.4
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/client/assets/{index-DUsqiytv.js → index-BAl5IbYx.js} +378 -357
- package/dist/client/index.html +1 -1
- package/dist/pi-packages/captains-log/dist/companion.js +1 -1
- package/dist/pi-packages/relays/extensions/index.js +1 -0
- package/dist/pi-web-plugins/git/server-plugin.js +3 -3
- package/dist/pi-web-plugins/git/workspaceDiscoveryHooks.js +8 -2
- package/dist/pi-web-plugins/mermaid/browser/mermaid-engine.js +391 -389
- package/dist/server/sessions/piSessionService.js +178 -14
- package/dist/server/sessions/piSessionService.js.map +1 -1
- package/dist/server/sessions/queuedMessageMutation.js +168 -0
- package/dist/server/sessions/queuedMessageMutation.js.map +1 -0
- package/dist/server/sessions/sessionRoutes.js +10 -0
- package/dist/server/sessions/sessionRoutes.js.map +1 -1
- package/dist/server/sessions/spawnSessionTool.js +1 -0
- package/dist/server/sessions/spawnSessionTool.js.map +1 -1
- package/dist/server/sessions/spawnSubsessionTool.js +1 -0
- package/dist/server/sessions/spawnSubsessionTool.js.map +1 -1
- package/dist/shared/apiTypes.js.map +1 -1
- package/dist/shared/federatedRoutes.js +1 -0
- package/dist/shared/federatedRoutes.js.map +1 -1
- package/docs/config.md +12 -0
- package/docs/plugins.md +2 -0
- package/examples/session-bridge-plugin/src/companion.ts +1 -1
- package/package.json +8 -8
package/dist/client/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
10
10
|
<link rel="manifest" crossorigin="use-credentials" href="./manifest.webmanifest" />
|
|
11
11
|
<style>:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--pi-control-font-size:16px;--pi-control-font-family:system-ui, sans-serif;--pi-control-monospace-font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;--pi-bg:#0d1117;--pi-surface:#161b22;--pi-surface-hover:#21262d;--pi-terminal-bg:#05070a;--pi-terminal-text:#e6edf3;--pi-border:#30363d;--pi-border-muted:#21262d;--pi-text:#e6edf3;--pi-text-secondary:#c9d1d9;--pi-text-bright:#f0f6fc;--pi-muted:#8b949e;--pi-dim:#6e7681;--pi-accent:#58a6ff;--pi-accent-border:#2f81f7;--pi-selection-bg:#0d2847;--pi-success:#3fb950;--pi-success-border:#238636;--pi-success-bg:#0f1b12;--pi-success-surface:#0f2a16;--pi-success-ring:#3fb95055;--pi-warning:#d29922;--pi-warning-border:#6e5200;--pi-warning-surface:#1f1a10;--pi-danger:#ff7b72;--pi-purple:#d2a8ff;--pi-purple-border:#a371f7;--pi-purple-surface:#21132f;--pi-overlay:#0008;--pi-shadow-soft:#0006;--pi-shadow:#0008;--pi-shadow-strong:#000b;--pi-bg-overlay-soft:#0d1117dd;--pi-bg-overlay:#0d1117e6;--pi-success-bg-overlay:#0f1b12ee;--pi-terminal-selection:#264f78}html,body{background:var(--pi-bg);height:100%;color:var(--pi-text);margin:0;overflow:hidden}body{min-height:100dvh}</style>
|
|
12
|
-
<script type="module" crossorigin src="./assets/index-
|
|
12
|
+
<script type="module" crossorigin src="./assets/index-BAl5IbYx.js"></script>
|
|
13
13
|
<link rel="modulepreload" crossorigin href="./assets/vendor-editor-core-C2PJX3uW.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="./assets/vendor-editor-languages-CS6n1J8n.js">
|
|
15
15
|
</head>
|
|
@@ -14,7 +14,7 @@ export default function companion(pi) {
|
|
|
14
14
|
pi.on("before_agent_start", (event) => {
|
|
15
15
|
if (!active)
|
|
16
16
|
return;
|
|
17
|
-
if (!active.started && event.prompt === active.prompt) {
|
|
17
|
+
if (!active.started && "prompt" in event && event.prompt === active.prompt) {
|
|
18
18
|
active.started = true;
|
|
19
19
|
if (event.prompt === PIRATE_INTRO)
|
|
20
20
|
pi.appendEntry(PIRATE_MARKER, {});
|
|
@@ -12,6 +12,7 @@ const DispatchParams = Type.Object({
|
|
|
12
12
|
cwd: Type.Optional(Type.String({ description: "Target workspace of the same registered project. Omit to use this session's workspace." })),
|
|
13
13
|
model: Type.Optional(Type.String({ description: 'Exact provider/model-id override. Set only when instructed to select a specific model or choose an appropriate one; otherwise omit to inherit.' })),
|
|
14
14
|
thinkingLevel: Type.Optional(Type.Enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"], {
|
|
15
|
+
type: "string",
|
|
15
16
|
description: "Thinking-level override. Set only when instructed to select a level or choose an appropriate one; otherwise omit to inherit. Pi clamps valid levels to the selected model.",
|
|
16
17
|
})),
|
|
17
18
|
}, { additionalProperties: false });
|
|
@@ -25,16 +25,16 @@ const plugin = {
|
|
|
25
25
|
name: "Git",
|
|
26
26
|
activate(context) {
|
|
27
27
|
return {
|
|
28
|
-
workspaceProvider: createGitWorkspaceProvider(context),
|
|
28
|
+
workspaceProvider: createGitWorkspaceProvider(context, process.env["PI_WEB_INSTANCE_NAMESPACE"] ?? ""),
|
|
29
29
|
peer: { request: (request) => requestGitBackend(context, request) },
|
|
30
30
|
};
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
export default plugin;
|
|
34
|
-
export function createGitWorkspaceProvider(context) {
|
|
34
|
+
export function createGitWorkspaceProvider(context, instanceNamespace = "") {
|
|
35
35
|
return Object.freeze({
|
|
36
36
|
fallback: true,
|
|
37
|
-
integration: createWorkspaceDiscoveryHooks(context, (cwd, args, signal) => runGit(context, cwd, args, signal)),
|
|
37
|
+
integration: createWorkspaceDiscoveryHooks(context, (cwd, args, signal) => runGit(context, cwd, args, signal), process.execPath, instanceNamespace),
|
|
38
38
|
async probe(project, signal) {
|
|
39
39
|
const result = await runGit(context, project.path, ["rev-parse", "--is-inside-work-tree"], signal);
|
|
40
40
|
if (result.signal !== null)
|
|
@@ -4,7 +4,10 @@ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
|
4
4
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
5
5
|
const EVENT = "post-checkout";
|
|
6
6
|
/** Git owns the hook policy; the host owns settings snapshots and notification attribution/transport. */
|
|
7
|
-
export function createWorkspaceDiscoveryHooks(context, runGit, nodeExecutable = process.execPath) {
|
|
7
|
+
export function createWorkspaceDiscoveryHooks(context, runGit, nodeExecutable = process.execPath, instanceNamespace = "") {
|
|
8
|
+
if (instanceNamespace !== "" && !/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/u.test(instanceNamespace)) {
|
|
9
|
+
throw new Error("PI_WEB_INSTANCE_NAMESPACE must be 1–32 letters, digits, underscores or hyphens, starting with a letter or digit");
|
|
10
|
+
}
|
|
8
11
|
if (!isAbsolute(nodeExecutable))
|
|
9
12
|
throw new Error("Git hook runtime must be an absolute executable path");
|
|
10
13
|
// Serialize this activation's config edits, including registrations sharing a
|
|
@@ -39,7 +42,10 @@ export function createWorkspaceDiscoveryHooks(context, runGit, nodeExecutable =
|
|
|
39
42
|
const identity = createHash("sha256")
|
|
40
43
|
.update(JSON.stringify(["packaged-helper", context.pluginId, resolve(context.dataDirectory), project.id]))
|
|
41
44
|
.digest("hex");
|
|
42
|
-
|
|
45
|
+
// Keep the unnamespaced production identity byte-for-byte compatible.
|
|
46
|
+
// The name also scopes ownership records; never adopt another instance's hook.
|
|
47
|
+
const prefix = instanceNamespace === "" ? "" : `${instanceNamespace}-`;
|
|
48
|
+
const name = `pi-web-workspace-discovery-${prefix}${identity}`;
|
|
43
49
|
const helper = join(context.packageRoot, "workspace-discovery-notify.cjs");
|
|
44
50
|
const registration = join(context.dataDirectory, "workspace-discovery", `${name}.registration.json`);
|
|
45
51
|
const notifier = context.workspaceNotifications?.command(project.id);
|