@jaggerxtrm/pi-extensions 0.9.1 → 0.9.3
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/extensions/auto-session-name/index.ts +1 -1
- package/extensions/auto-update/index.ts +1 -1
- package/extensions/beads/index.ts +2 -2
- package/extensions/compact-header/index.ts +3 -3
- package/extensions/custom-footer/index.ts +2 -2
- package/extensions/custom-provider-qwen-cli/index.ts +2 -2
- package/extensions/git-checkpoint/index.ts +1 -1
- package/extensions/lsp-bootstrap/index.ts +1 -1
- package/extensions/pi-serena-compact/index.ts +14 -14
- package/extensions/pi-serena-compact/package.json +2 -2
- package/extensions/quality-gates/index.ts +1 -1
- package/extensions/serena-pool/index.ts +1 -1
- package/extensions/serena-pool/package.json +1 -1
- package/extensions/service-skills/index.ts +1 -1
- package/extensions/session-flow/index.ts +2 -2
- package/extensions/sp-terminal-overlay/index.ts +2 -2
- package/extensions/xtrm-loader/index.ts +1 -1
- package/extensions/xtrm-ui/index.ts +6 -9
- package/package.json +1 -1
- package/src/core/adapter.ts +1 -1
- package/src/extensions/xtprompt.ts +3 -0
- package/src/index.ts +1 -1
- package/src/registry.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Automatically names sessions based on the first user message.
|
|
5
5
|
*/
|
|
6
|
-
import type { ExtensionAPI } from "@
|
|
6
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
7
7
|
|
|
8
8
|
export default function (pi: ExtensionAPI) {
|
|
9
9
|
let named = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-pi Auto Update — check for new oh-pi version on session start
|
|
3
3
|
*/
|
|
4
|
-
import type { ExtensionAPI } from "@
|
|
4
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
import { execSync } from "node:child_process";
|
|
6
6
|
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
2
|
-
import { isToolCallEventType, isBashToolResult } from "@
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { isToolCallEventType, isBashToolResult } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { SubprocessRunner, EventAdapter } from "../../src/core";
|
|
4
4
|
|
|
5
5
|
export default function (pi: ExtensionAPI) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-pi Compact Header — table-style startup info with dynamic column widths
|
|
3
3
|
*/
|
|
4
|
-
import type { ExtensionAPI } from "@
|
|
5
|
-
import { VERSION } from "@
|
|
6
|
-
import { truncateToWidth, visibleWidth } from "@
|
|
4
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import { VERSION } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
7
7
|
|
|
8
8
|
export default function (pi: ExtensionAPI) {
|
|
9
9
|
pi.on("session_start", async (_event, ctx) => {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Line 3: ◐ 4843.5 Rework project bootstrap... — beads claim or ○ 6 open
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ExtensionAPI } from "@
|
|
11
|
-
import { truncateToWidth, visibleWidth } from "@
|
|
10
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
11
|
+
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
12
12
|
|
|
13
13
|
import { SubprocessRunner, EventAdapter } from "../../src/core";
|
|
14
14
|
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* # Then /login qwen-cli, or set QWEN_CLI_API_KEY=...
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type { OAuthCredentials, OAuthLoginCallbacks } from "@
|
|
13
|
-
import type { ExtensionAPI } from "@
|
|
12
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "@earendil-works/pi-ai";
|
|
13
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
14
14
|
|
|
15
15
|
// =============================================================================
|
|
16
16
|
// Constants
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* When forking, offers to restore code to that point in history.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI } from "@
|
|
8
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
9
9
|
|
|
10
10
|
export default function (pi: ExtensionAPI) {
|
|
11
11
|
const checkpoints = new Map<string, string>();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { ExtensionAPI, ToolResultEvent } from "@
|
|
1
|
+
import type { ExtensionAPI, ToolResultEvent } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
|
|
3
3
|
// Serena/GitNexus MCP tool names that produce verbose output
|
|
4
4
|
const COMPACT_TOOLS = new Set([
|
|
5
5
|
// Serena symbol operations
|
|
6
6
|
"find_symbol",
|
|
7
|
-
"find_referencing_symbols",
|
|
7
|
+
"find_referencing_symbols",
|
|
8
8
|
"get_symbols_overview",
|
|
9
9
|
"jet_brains_find_symbol",
|
|
10
10
|
"jet_brains_find_referencing_symbols",
|
|
11
11
|
"jet_brains_get_symbols_overview",
|
|
12
12
|
"jet_brains_type_hierarchy",
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
// Serena file operations
|
|
15
15
|
"read_file",
|
|
16
16
|
"create_text_file",
|
|
@@ -18,30 +18,30 @@ const COMPACT_TOOLS = new Set([
|
|
|
18
18
|
"replace_lines",
|
|
19
19
|
"delete_lines",
|
|
20
20
|
"insert_at_line",
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
// Serena search/navigation
|
|
23
23
|
"search_for_pattern",
|
|
24
24
|
"list_dir",
|
|
25
25
|
"find_file",
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
// Serena symbol editing
|
|
28
28
|
"replace_symbol_body",
|
|
29
29
|
"insert_after_symbol",
|
|
30
30
|
"insert_before_symbol",
|
|
31
31
|
"rename_symbol",
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
// GitNexus
|
|
34
34
|
"gitnexus_query",
|
|
35
35
|
"gitnexus_context",
|
|
36
36
|
"gitnexus_impact",
|
|
37
37
|
"gitnexus_detect_changes",
|
|
38
38
|
"gitnexus_list_repos",
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
// Serena memory
|
|
41
41
|
"read_memory",
|
|
42
42
|
"write_memory",
|
|
43
43
|
"list_memories",
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
// Other verbose tools
|
|
46
46
|
"execute_shell_command",
|
|
47
47
|
"structured_return",
|
|
@@ -66,10 +66,10 @@ function getTextContent(content: Array<{ type: string; text?: string }>): string
|
|
|
66
66
|
|
|
67
67
|
function truncateLines(text: string, maxLines: number, maxLineLen = 180): string {
|
|
68
68
|
const lines = text.split("\n");
|
|
69
|
-
const truncated = lines.map(line =>
|
|
69
|
+
const truncated = lines.map(line =>
|
|
70
70
|
line.length > maxLineLen ? line.slice(0, maxLineLen) + "…" : line
|
|
71
71
|
);
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
if (truncated.length <= maxLines) return truncated.join("\n");
|
|
74
74
|
return truncated.slice(0, maxLines).join("\n") + `\n… +${truncated.length - maxLines} more lines`;
|
|
75
75
|
}
|
|
@@ -80,16 +80,16 @@ function compactResult(
|
|
|
80
80
|
maxLines: number = 6,
|
|
81
81
|
): Array<{ type: string; text: string }> {
|
|
82
82
|
const textContent = getTextContent(content);
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
if (!textContent) {
|
|
85
85
|
return [{ type: "text", text: "✓ No output" }];
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
// For certain tools, show more output
|
|
89
89
|
const effectiveMaxLines = PRESERVE_OUTPUT_TOOLS.has(toolName) ? 12 : maxLines;
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
const compacted = truncateLines(textContent, effectiveMaxLines, 180);
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
return [{ type: "text", text: compacted }];
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "index.ts",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@
|
|
16
|
-
"@
|
|
15
|
+
"@earendil-works/pi-coding-agent": "^0.80.0",
|
|
16
|
+
"@earendil-works/pi-tui": "^0.80.0"
|
|
17
17
|
},
|
|
18
18
|
"pi": {
|
|
19
19
|
"extensions": [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { SubprocessRunner, EventAdapter } from "../../src/core";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import * as fs from "node:fs";
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* controlling Serena is verifiably dead (pid+startTime check). Process-group
|
|
21
21
|
* kills are bounded to ours, so editor LSPs / tests / hooks are never touched.
|
|
22
22
|
*/
|
|
23
|
-
import type { ExtensionAPI } from "@
|
|
23
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
24
24
|
import { spawn, execFileSync } from "node:child_process";
|
|
25
25
|
import { connect } from "node:net";
|
|
26
26
|
import { existsSync, mkdirSync, openSync, writeSync, closeSync, readFileSync, unlinkSync, realpathSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
2
|
-
import { isBashToolResult } from "@
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { isBashToolResult } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { SubprocessRunner, EventAdapter } from "../../src/core";
|
|
4
4
|
|
|
5
5
|
function isClaimCommand(command: string): { isClaim: boolean; issueId: string | null } {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn, type ChildProcessWithoutNullStreams } from "node:child_process";
|
|
2
|
-
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@
|
|
3
|
-
import { matchesKey, truncateToWidth, visibleWidth } from "@
|
|
2
|
+
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import { matchesKey, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
4
4
|
|
|
5
5
|
const MAX_BUFFER_LINES = 2000;
|
|
6
6
|
const DEFAULT_VISIBLE_LINES = 24;
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
LsToolDetails,
|
|
21
21
|
ReadToolDetails,
|
|
22
22
|
ToolResultEvent,
|
|
23
|
-
} from "@
|
|
23
|
+
} from "@earendil-works/pi-coding-agent";
|
|
24
24
|
import {
|
|
25
25
|
CustomEditor,
|
|
26
26
|
createBashTool,
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
createLsTool,
|
|
31
31
|
createReadTool,
|
|
32
32
|
createWriteTool,
|
|
33
|
-
} from "@
|
|
34
|
-
import { Box, Text, truncateToWidth, visibleWidth } from "@
|
|
33
|
+
} from "@earendil-works/pi-coding-agent";
|
|
34
|
+
import { Box, Text, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
35
35
|
import { existsSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
36
36
|
import { basename, dirname, join } from "node:path";
|
|
37
37
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -184,14 +184,11 @@ function resolvePiCodingAgentEntryPath(): string {
|
|
|
184
184
|
|
|
185
185
|
candidates.push(
|
|
186
186
|
join(dirname(process.execPath), "..", "lib", "node_modules", "@earendil-works", "pi-coding-agent", "dist", "index.js"),
|
|
187
|
-
join(dirname(process.execPath), "..", "lib", "node_modules", "@mariozechner", "pi-coding-agent", "dist", "index.js"),
|
|
188
187
|
);
|
|
189
188
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
} catch {}
|
|
194
|
-
}
|
|
189
|
+
try {
|
|
190
|
+
candidates.push(maybeFileUrlToPath(import.meta.resolve("@earendil-works/pi-coding-agent")));
|
|
191
|
+
} catch {}
|
|
195
192
|
|
|
196
193
|
const entryPath = candidates.find((candidate) => existsSync(candidate));
|
|
197
194
|
if (!entryPath) throw new Error("Could not resolve pi-coding-agent entry path");
|
package/package.json
CHANGED
package/src/core/adapter.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as nodePath from "node:path";
|
|
3
3
|
|
|
4
|
-
import type { ExtensionAPI, ToolCallEvent } from "@
|
|
4
|
+
import type { ExtensionAPI, ToolCallEvent } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
import { PI_MUTATING_FILE_TOOLS } from "./guard-rules";
|
|
6
6
|
|
|
7
7
|
export class EventAdapter {
|
package/src/index.ts
CHANGED
package/src/registry.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
|
|
3
3
|
import autoSessionNameExtension from "./extensions/auto-session-name.ts";
|
|
4
4
|
import autoUpdateExtension from "./extensions/auto-update.ts";
|