@nklisch/pi-enhanced 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/CHANGELOG.md +12 -0
- package/node_modules/@nklisch/pi-background-tasks/CHANGELOG.md +7 -0
- package/node_modules/@nklisch/pi-background-tasks/extensions/background-tasks.test.ts +105 -0
- package/node_modules/@nklisch/pi-background-tasks/extensions/background-tasks.ts +131 -44
- package/node_modules/@nklisch/pi-background-tasks/package.json +1 -1
- package/node_modules/@nklisch/pi-background-tasks/skills/background-tasks/SKILL.md +6 -7
- package/node_modules/@nklisch/pi-clearance/native/clearance-core.win32-x64-msvc.node +0 -0
- package/node_modules/@nklisch/pi-clearance/package.json +1 -1
- package/node_modules/@nklisch/pi-clearance/src/config/config-command-writer.ts +34 -17
- package/node_modules/@nklisch/pi-clearance/src/index.ts +34 -3
- package/node_modules/@nklisch/pi-clearance/src/packs/package-registration.ts +63 -36
- package/node_modules/@nklisch/pi-clearance/src/runtime/allow-request-message.ts +40 -1
- package/node_modules/@nklisch/pi-clearance/src/runtime/command-registry.ts +22 -2
- package/node_modules/@nklisch/pi-clearance/src/runtime/command-transforms.ts +50 -29
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/native-ui.ts +233 -49
- package/node_modules/@nklisch/pi-clearance/src/runtime/policy-cache.ts +19 -5
- package/node_modules/@nklisch/pi-conveniences/extensions/context-window-footer.ts +48 -13
- package/node_modules/@nklisch/pi-conveniences/package.json +1 -1
- package/node_modules/@nklisch/pi-fff-compat/extensions/fff-compat-search.ts +49 -42
- package/node_modules/@nklisch/pi-fff-compat/extensions/finder-lifecycle.ts +92 -0
- package/node_modules/@nklisch/pi-fff-compat/package.json +2 -2
- package/node_modules/@nklisch/pi-model-modes/package.json +1 -1
- package/node_modules/@nklisch/pi-model-modes/src/command-message.ts +30 -0
- package/node_modules/@nklisch/pi-model-modes/src/commands.ts +31 -15
- package/node_modules/@nklisch/pi-model-modes/src/style-command.ts +25 -14
- package/node_modules/@nklisch/pi-plugins/README.md +2 -2
- package/node_modules/@nklisch/pi-plugins/dist/application/subagent-hook-runtime.js +4 -1
- package/node_modules/@nklisch/pi-plugins/dist/application/subagent-hook-runtime.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/composition/background-update-coordinator.js +12 -3
- package/node_modules/@nklisch/pi-plugins/dist/composition/background-update-coordinator.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/infrastructure/process/command-runner.d.ts +1 -0
- package/node_modules/@nklisch/pi-plugins/dist/infrastructure/process/command-runner.js +19 -11
- package/node_modules/@nklisch/pi-plugins/dist/infrastructure/process/command-runner.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/pi/hooks/pi-hook-decision-adapter.js +36 -7
- package/node_modules/@nklisch/pi-plugins/dist/pi/hooks/pi-hook-decision-adapter.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/pi/manager/plugin-manager-component.js +14 -3
- package/node_modules/@nklisch/pi-plugins/dist/pi/manager/plugin-manager-component.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/pi/manager/plugin-manager-session.js +153 -54
- package/node_modules/@nklisch/pi-plugins/dist/pi/manager/plugin-manager-session.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/pi/plugin-manager-lifecycle.js +35 -8
- package/node_modules/@nklisch/pi-plugins/dist/pi/plugin-manager-lifecycle.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/runtime/mcp/pi-mcp-adapter-package.js +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/runtime/mcp/pi-mcp-adapter-runtime.js +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/runtime/subagents/pi-subagents-package.js +1 -1
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/CHANGELOG.md +7 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/package.json +1 -1
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/config/custom-agents.ts +22 -17
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/debug.ts +18 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/child-lifecycle.ts +22 -4
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/concurrency-limiter.ts +32 -8
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/create-subagent-session.ts +8 -7
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/lifecycle-interceptor.ts +25 -6
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/run-listeners.ts +6 -2
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/subagent-manager.ts +31 -16
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/subagent-session.ts +70 -32
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/subagent.ts +55 -50
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/workspace-bracket.ts +6 -2
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/observation/record-observer.ts +37 -34
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/observation/subagent-events-observer.ts +15 -14
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/foreground-runner.ts +31 -26
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/agent-widget.ts +51 -26
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/session-navigator.ts +100 -46
- package/node_modules/@nklisch/pi-plugins/package.json +3 -3
- package/package.json +4 -4
- package/test/verify-bundle.mjs +8 -0
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
visibleWidth,
|
|
39
39
|
} from "@earendil-works/pi-tui";
|
|
40
40
|
import type { AgentConfigLookup } from "#src/config/agent-types";
|
|
41
|
+
import { debugLog } from "#src/debug";
|
|
41
42
|
import type { SessionMessage } from "#src/types";
|
|
42
43
|
import { describeActivity, formatDuration, formatModelThinking, type Theme } from "#src/ui/display";
|
|
43
44
|
import { fileSnapshotSource, listNavigableAgents, liveSource, type NavigableSubagent, type RunDisplayMetadata, type TranscriptSource } from "#src/ui/session-navigation";
|
|
@@ -160,57 +161,69 @@ export class TranscriptOverlay implements Component {
|
|
|
160
161
|
this.done = done;
|
|
161
162
|
this.cwd = cwd;
|
|
162
163
|
this.markdownTheme = markdownTheme;
|
|
163
|
-
|
|
164
|
-
this.unsubscribe = source.subscribe(() => {
|
|
165
|
-
if (this.closed) return;
|
|
164
|
+
try {
|
|
166
165
|
this.content = this.rebuild();
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
166
|
+
} catch (error) {
|
|
167
|
+
debugLog("session navigator initial render", error);
|
|
168
|
+
this.content = new Container();
|
|
169
|
+
}
|
|
170
|
+
try {
|
|
171
|
+
this.unsubscribe = source.subscribe(() => this.refreshFromSource());
|
|
172
|
+
} catch (error) {
|
|
173
|
+
debugLog("session navigator subscribe", error);
|
|
174
|
+
}
|
|
175
|
+
if (this.isRunning()) {
|
|
176
|
+
this.runtimeInterval = setInterval(() => this.refreshRuntime(), 100);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
handleInput(data: string): void {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
try {
|
|
182
|
+
if (matchesKey(data, "escape") || matchesKey(data, "q")) {
|
|
183
|
+
this.closed = true;
|
|
184
|
+
this.clearRuntimeInterval();
|
|
185
|
+
this.done(undefined);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
187
188
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
189
|
+
const totalLines = this.buildContentLines(this.innerWidth()).length;
|
|
190
|
+
const viewportHeight = this.viewportHeight();
|
|
191
|
+
const maxScroll = Math.max(0, totalLines - viewportHeight);
|
|
192
|
+
|
|
193
|
+
if (matchesKey(data, "up") || matchesKey(data, "k")) {
|
|
194
|
+
this.scrollOffset = Math.max(0, this.scrollOffset - 1);
|
|
195
|
+
this.autoScroll = this.scrollOffset >= maxScroll;
|
|
196
|
+
} else if (matchesKey(data, "down") || matchesKey(data, "j")) {
|
|
197
|
+
this.scrollOffset = Math.min(maxScroll, this.scrollOffset + 1);
|
|
198
|
+
this.autoScroll = this.scrollOffset >= maxScroll;
|
|
199
|
+
} else if (matchesKey(data, "pageUp") || matchesKey(data, "shift+up")) {
|
|
200
|
+
this.scrollOffset = Math.max(0, this.scrollOffset - viewportHeight);
|
|
201
|
+
this.autoScroll = false;
|
|
202
|
+
} else if (matchesKey(data, "pageDown") || matchesKey(data, "shift+down")) {
|
|
203
|
+
this.scrollOffset = Math.min(maxScroll, this.scrollOffset + viewportHeight);
|
|
204
|
+
this.autoScroll = this.scrollOffset >= maxScroll;
|
|
205
|
+
} else if (matchesKey(data, "home")) {
|
|
206
|
+
this.scrollOffset = 0;
|
|
207
|
+
this.autoScroll = false;
|
|
208
|
+
} else if (matchesKey(data, "end")) {
|
|
209
|
+
this.scrollOffset = maxScroll;
|
|
210
|
+
this.autoScroll = true;
|
|
211
|
+
}
|
|
212
|
+
} catch (error) {
|
|
213
|
+
debugLog("session navigator input", error);
|
|
210
214
|
}
|
|
211
215
|
}
|
|
212
216
|
|
|
213
217
|
render(width: number): string[] {
|
|
218
|
+
try {
|
|
219
|
+
return this.renderSafe(width);
|
|
220
|
+
} catch (error) {
|
|
221
|
+
debugLog("session navigator render", error);
|
|
222
|
+
return [];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
private renderSafe(width: number): string[] {
|
|
214
227
|
if (width < 6) return [];
|
|
215
228
|
const th = this.theme;
|
|
216
229
|
const innerW = width - 4;
|
|
@@ -252,22 +265,63 @@ export class TranscriptOverlay implements Component {
|
|
|
252
265
|
|
|
253
266
|
// fallow-ignore-next-line unused-class-member
|
|
254
267
|
invalidate(): void {
|
|
255
|
-
|
|
268
|
+
try {
|
|
269
|
+
this.content.invalidate();
|
|
270
|
+
} catch (error) {
|
|
271
|
+
debugLog("session navigator invalidate", error);
|
|
272
|
+
}
|
|
256
273
|
}
|
|
257
274
|
|
|
258
275
|
dispose(): void {
|
|
259
276
|
this.closed = true;
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
277
|
+
const unsubscribe = this.unsubscribe;
|
|
278
|
+
this.unsubscribe = undefined;
|
|
279
|
+
if (unsubscribe) {
|
|
280
|
+
try {
|
|
281
|
+
unsubscribe();
|
|
282
|
+
} catch (error) {
|
|
283
|
+
debugLog("session navigator unsubscribe", error);
|
|
284
|
+
}
|
|
263
285
|
}
|
|
264
286
|
this.clearRuntimeInterval();
|
|
265
287
|
}
|
|
266
288
|
|
|
267
289
|
// ---- Private ----
|
|
268
290
|
|
|
291
|
+
private refreshFromSource(): void {
|
|
292
|
+
if (this.closed) return;
|
|
293
|
+
try {
|
|
294
|
+
this.content = this.rebuild();
|
|
295
|
+
this.tui.requestRender();
|
|
296
|
+
} catch (error) {
|
|
297
|
+
debugLog("session navigator live refresh", error);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
private refreshRuntime(): void {
|
|
302
|
+
try {
|
|
303
|
+
if (this.closed || !this.isRunning()) {
|
|
304
|
+
this.clearRuntimeInterval();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
this.tui.requestRender();
|
|
308
|
+
} catch (error) {
|
|
309
|
+
debugLog("session navigator runtime refresh", error);
|
|
310
|
+
this.clearRuntimeInterval();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
private isRunning(): boolean {
|
|
315
|
+
try {
|
|
316
|
+
return this.run.completedAt() === undefined;
|
|
317
|
+
} catch (error) {
|
|
318
|
+
debugLog("session navigator runtime state", error);
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
269
323
|
private clearRuntimeInterval(): void {
|
|
270
|
-
if (this.runtimeInterval) {
|
|
324
|
+
if (this.runtimeInterval !== undefined) {
|
|
271
325
|
clearInterval(this.runtimeInterval);
|
|
272
326
|
this.runtimeInterval = undefined;
|
|
273
327
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nklisch/pi-plugins",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Native marketplace and plugin lifecycle management for Pi, with Claude Code and Codex compatibility.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"@nklisch/pi-subagents"
|
|
68
68
|
],
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@nklisch/pi-mcp-adapter": "2.21.0-nklisch.
|
|
71
|
-
"@nklisch/pi-subagents": "18.1.0-nklisch.
|
|
70
|
+
"@nklisch/pi-mcp-adapter": "2.21.0-nklisch.1",
|
|
71
|
+
"@nklisch/pi-subagents": "18.1.0-nklisch.2",
|
|
72
72
|
"jiti": "2.7.0",
|
|
73
73
|
"semver": "7.8.1",
|
|
74
74
|
"smol-toml": "^1.7.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nklisch/pi-enhanced",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Pi, enhanced
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Pi, enhanced — one install for nklisch's full harness: policy-gated command review, plugin marketplace, subagents, background tasks, research tools, search, model modes, and a curated UX set.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "nklisch"
|
|
7
7
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"pi": {
|
|
30
30
|
"extensions": [
|
|
31
31
|
"./node_modules/@nklisch/pi-conveniences/extensions",
|
|
32
|
-
"./node_modules/@nklisch/pi-fff-compat/extensions",
|
|
32
|
+
"./node_modules/@nklisch/pi-fff-compat/extensions/fff-compat-search.ts",
|
|
33
33
|
"./node_modules/@nklisch/pi-model-modes/extensions/index.ts",
|
|
34
34
|
"./node_modules/@nklisch/pi-background-tasks/extensions/background-tasks.ts",
|
|
35
35
|
"./node_modules/@nklisch/pi-plugins/dist/pi/production-subagents-extension.js",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@nklisch/pi-clearance": "^0",
|
|
71
71
|
"@nklisch/pi-conveniences": "^0",
|
|
72
72
|
"@nklisch/pi-fff-compat": "^0",
|
|
73
|
-
"@nklisch/pi-mcp-adapter": "2.21.0-nklisch.
|
|
73
|
+
"@nklisch/pi-mcp-adapter": "2.21.0-nklisch.1",
|
|
74
74
|
"@nklisch/pi-model-modes": "^0",
|
|
75
75
|
"@nklisch/pi-plugins": "^0",
|
|
76
76
|
"@sinclair/typebox": "^0.34.49",
|
package/test/verify-bundle.mjs
CHANGED
|
@@ -34,6 +34,14 @@ const declared = [
|
|
|
34
34
|
].map((p) => p.replace(/^\.\//, ""));
|
|
35
35
|
|
|
36
36
|
const failures = [];
|
|
37
|
+
const fffCompatEntrypoint = "./node_modules/@nklisch/pi-fff-compat/extensions/fff-compat-search.ts";
|
|
38
|
+
if (!manifest.pi.extensions.includes(fffCompatEntrypoint)) {
|
|
39
|
+
failures.push(`${fffCompatEntrypoint} (FFF compatibility extension entrypoint not declared)`);
|
|
40
|
+
}
|
|
41
|
+
if (manifest.pi.extensions.includes("./node_modules/@nklisch/pi-fff-compat/extensions")) {
|
|
42
|
+
failures.push("node_modules/@nklisch/pi-fff-compat/extensions (directory would load non-extension helpers)");
|
|
43
|
+
}
|
|
44
|
+
|
|
37
45
|
for (const declaredPath of declared) {
|
|
38
46
|
// A declared path may be a directory, a single file, or a SKILL.md path.
|
|
39
47
|
// It is satisfied when the tarball contains the path itself or anything
|