pi-archimedes 1.8.0 → 1.8.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/package.json +9 -9
- package/src/index.ts +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-archimedes",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
],
|
|
12
12
|
"main": "./src/index.ts",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@pi-archimedes/core": "1.8.
|
|
15
|
-
"@pi-archimedes/
|
|
16
|
-
"@pi-archimedes/ask": "1.8.
|
|
17
|
-
"@pi-archimedes/image-paste": "1.8.
|
|
18
|
-
"@pi-archimedes/subagent": "1.8.
|
|
19
|
-
"@pi-archimedes/
|
|
20
|
-
"@pi-archimedes/
|
|
21
|
-
"@pi-archimedes/
|
|
14
|
+
"@pi-archimedes/core": "1.8.1",
|
|
15
|
+
"@pi-archimedes/footer": "1.8.1",
|
|
16
|
+
"@pi-archimedes/ask": "1.8.1",
|
|
17
|
+
"@pi-archimedes/image-paste": "1.8.1",
|
|
18
|
+
"@pi-archimedes/subagent": "1.8.1",
|
|
19
|
+
"@pi-archimedes/notify": "1.8.1",
|
|
20
|
+
"@pi-archimedes/todo": "1.8.1",
|
|
21
|
+
"@pi-archimedes/diff": "1.8.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@earendil-works/pi-coding-agent": ">=0.1.0",
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,8 @@ import { openSettings } from "./settings.js"
|
|
|
16
16
|
|
|
17
17
|
// Module-level refs for shutdown (survive hot-reloads)
|
|
18
18
|
let imagePasteShutdown: (() => void) | undefined;
|
|
19
|
+
// Module-level ref for current session context (survives /reload, /new, /fork)
|
|
20
|
+
let currentCtx: ExtensionContext | undefined;
|
|
19
21
|
// Guard: tracks which lazy-loaded packages have been registered.
|
|
20
22
|
// session_start fires for /new, /resume, /fork, /reload — each tears down the
|
|
21
23
|
// old runtime and rebuilds, but pi itself stays loaded, so this module is
|
|
@@ -58,6 +60,9 @@ export default function (pi: ExtensionAPI): void {
|
|
|
58
60
|
pi.on("session_start", async (_event, ctx: ExtensionContext) => {
|
|
59
61
|
archTime(`session_start (factory was ${Date.now() - _moduleEvalAt}ms ago)`);
|
|
60
62
|
|
|
63
|
+
// Update module-level context ref so lazy-loaded callbacks always see current session
|
|
64
|
+
currentCtx = ctx;
|
|
65
|
+
|
|
61
66
|
// ── Parallel lazy-load all three packages (saves ~100ms vs sequential) ──
|
|
62
67
|
const [diffMod, ipMod, saMod] = await Promise.all([
|
|
63
68
|
import("@pi-archimedes/diff").catch((e) => { console.error("[archimedes] diff load failed:", e); return null; }),
|
|
@@ -67,7 +72,8 @@ export default function (pi: ExtensionAPI): void {
|
|
|
67
72
|
archTime("3 packages loaded in parallel");
|
|
68
73
|
|
|
69
74
|
if (diffMod && !registeredLazy.has("diff")) {
|
|
70
|
-
|
|
75
|
+
// currentCtx is set above before lazy loads, so it's always defined when this runs
|
|
76
|
+
diffMod.registerDiffTools(pi, () => currentCtx!.ui.theme, () => loadDiffConfig());
|
|
71
77
|
registeredLazy.add("diff");
|
|
72
78
|
}
|
|
73
79
|
if (ipMod) {
|