pi-pier 0.2.0 → 0.2.2
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 +1 -1
- package/src/index-master.ts +8 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-pier",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "pier: pi extension that fuses pi agent sessions with the herdr pane/tab orchestrator — todo_write loop closure + interactive subagents in isolated panes",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/index-master.ts
CHANGED
|
@@ -39,11 +39,11 @@ export interface MasterPluginMount {
|
|
|
39
39
|
|
|
40
40
|
async function loadEntry(
|
|
41
41
|
sessionRoot: Context,
|
|
42
|
-
|
|
42
|
+
useLoader: boolean,
|
|
43
43
|
name: string,
|
|
44
44
|
plugin: (ctx: Context) => void,
|
|
45
45
|
): Promise<void> {
|
|
46
|
-
if (
|
|
46
|
+
if (useLoader) {
|
|
47
47
|
const withLoader = sessionRoot as typeof sessionRoot & {
|
|
48
48
|
loader?: { create: (o: { name: string }) => Promise<unknown> };
|
|
49
49
|
};
|
|
@@ -56,6 +56,9 @@ async function loadEntry(
|
|
|
56
56
|
export async function mountMasterPlugins(m: MasterPluginMount): Promise<void> {
|
|
57
57
|
const cordisApp = await createCordisApp();
|
|
58
58
|
const sessionRoot = cordisApp.root;
|
|
59
|
+
// loader.create re-imports .ts via Node ESM — fails under node_modules (npm:pi-pier
|
|
60
|
+
// strip-types) and misses pi's typebox alias. HMR-only; production uses plugin().
|
|
61
|
+
const useLoader = cordisApp.loaderReady && cordisApp.hmrActive;
|
|
59
62
|
|
|
60
63
|
// Pipe server is created in the common segment; closing it from a core
|
|
61
64
|
// plugin would kill it on hmr reload (d87).
|
|
@@ -75,7 +78,7 @@ export async function mountMasterPlugins(m: MasterPluginMount): Promise<void> {
|
|
|
75
78
|
};
|
|
76
79
|
sessionRoot.provide('pi-herdr.terminal-deps', terminalDeps);
|
|
77
80
|
|
|
78
|
-
await loadEntry(sessionRoot,
|
|
81
|
+
await loadEntry(sessionRoot, useLoader, './core/terminal.ts', terminalPlugin);
|
|
79
82
|
|
|
80
83
|
sessionRoot.provide('pi-herdr.todo-deps', {
|
|
81
84
|
todos: m.todos,
|
|
@@ -87,7 +90,7 @@ export async function mountMasterPlugins(m: MasterPluginMount): Promise<void> {
|
|
|
87
90
|
},
|
|
88
91
|
state: m.todoUi,
|
|
89
92
|
});
|
|
90
|
-
await loadEntry(sessionRoot,
|
|
93
|
+
await loadEntry(sessionRoot, useLoader, './core/todo.ts', todoPlugin);
|
|
91
94
|
|
|
92
95
|
sessionRoot.provide('pi-herdr.subagent-deps', {
|
|
93
96
|
client: m.client,
|
|
@@ -105,7 +108,7 @@ export async function mountMasterPlugins(m: MasterPluginMount): Promise<void> {
|
|
|
105
108
|
terminalState: terminalDeps.state,
|
|
106
109
|
todos: m.todos,
|
|
107
110
|
});
|
|
108
|
-
await loadEntry(sessionRoot,
|
|
111
|
+
await loadEntry(sessionRoot, useLoader, './core/subagent.ts', subagentPlugin);
|
|
109
112
|
|
|
110
113
|
m.pi.on('session_shutdown', () => {
|
|
111
114
|
void disposeSessionRoot(sessionRoot);
|