xtrm-tools 0.7.4 → 0.7.7
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/.xtrm/config/hooks.json +3 -0
- package/.xtrm/ext-src/auto-session-name/index.ts +29 -0
- package/.xtrm/ext-src/auto-session-name/package.json +16 -0
- package/.xtrm/ext-src/auto-update/index.ts +71 -0
- package/.xtrm/ext-src/auto-update/package.json +16 -0
- package/.xtrm/ext-src/beads/index.ts +232 -0
- package/.xtrm/ext-src/beads/package.json +19 -0
- package/.xtrm/ext-src/compact-header/index.ts +69 -0
- package/.xtrm/ext-src/compact-header/package.json +16 -0
- package/.xtrm/ext-src/core/adapter.ts +52 -0
- package/.xtrm/ext-src/core/guard-rules.ts +100 -0
- package/.xtrm/ext-src/core/lib.ts +3 -0
- package/.xtrm/ext-src/core/logger.ts +45 -0
- package/.xtrm/ext-src/core/package.json +18 -0
- package/.xtrm/ext-src/core/runner.ts +71 -0
- package/.xtrm/ext-src/core/session-state.ts +59 -0
- package/.xtrm/ext-src/custom-footer/.pi/structured-returns/83051fe4-97da-4e2c-bdaa-343b32f4e714.combined.log +7 -0
- package/.xtrm/ext-src/custom-footer/.pi/structured-returns/83051fe4-97da-4e2c-bdaa-343b32f4e714.stderr.log +0 -0
- package/.xtrm/ext-src/custom-footer/.pi/structured-returns/83051fe4-97da-4e2c-bdaa-343b32f4e714.stdout.log +7 -0
- package/.xtrm/ext-src/custom-footer/index.ts +398 -0
- package/.xtrm/ext-src/custom-footer/package.json +19 -0
- package/.xtrm/ext-src/custom-provider-qwen-cli/index.ts +363 -0
- package/.xtrm/ext-src/custom-provider-qwen-cli/package.json +1 -0
- package/.xtrm/ext-src/git-checkpoint/index.ts +53 -0
- package/.xtrm/ext-src/git-checkpoint/package.json +16 -0
- package/.xtrm/ext-src/lsp-bootstrap/index.ts +134 -0
- package/.xtrm/ext-src/lsp-bootstrap/package.json +17 -0
- package/.xtrm/ext-src/pi-serena-compact/index.ts +121 -0
- package/.xtrm/ext-src/pi-serena-compact/package.json +16 -0
- package/.xtrm/ext-src/quality-gates/index.ts +66 -0
- package/.xtrm/ext-src/quality-gates/package.json +19 -0
- package/.xtrm/ext-src/service-skills/index.ts +108 -0
- package/.xtrm/ext-src/service-skills/package.json +19 -0
- package/.xtrm/ext-src/session-flow/index.ts +96 -0
- package/.xtrm/ext-src/session-flow/package.json +19 -0
- package/.xtrm/ext-src/xtrm-loader/index.ts +152 -0
- package/.xtrm/ext-src/xtrm-loader/package.json +19 -0
- package/.xtrm/ext-src/xtrm-ui/format.ts +282 -0
- package/.xtrm/ext-src/xtrm-ui/index.ts +1112 -0
- package/.xtrm/ext-src/xtrm-ui/package.json +21 -0
- package/.xtrm/ext-src/xtrm-ui/themes/pidex-dark.json +85 -0
- package/.xtrm/ext-src/xtrm-ui/themes/pidex-light.json +85 -0
- package/cli/dist/index.cjs +64 -2
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xtrm/pi-xtrm-ui",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "XTRM UI: pi-dex chrome + pi-diff style write/edit rendering with custom-footer-safe ownership",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.ts"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@heyhuynhgiabuu/pi-diff": "^0.2.1"
|
|
12
|
+
},
|
|
13
|
+
"pi": {
|
|
14
|
+
"extensions": [
|
|
15
|
+
"./index.ts"
|
|
16
|
+
],
|
|
17
|
+
"themes": [
|
|
18
|
+
"./themes"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
+
"name": "pidex-dark",
|
|
4
|
+
"vars": {
|
|
5
|
+
"accentBlue": "#b8d3ff",
|
|
6
|
+
"accentCyan": "#b8d3ff",
|
|
7
|
+
"accentTeal": "#c7d2e0",
|
|
8
|
+
"successGreen": "#9fd59f",
|
|
9
|
+
"errorRed": "#ff9a9a",
|
|
10
|
+
"warningAmber": "#d2b48c",
|
|
11
|
+
"surface": "#000000",
|
|
12
|
+
"surfaceAlt": "#111111",
|
|
13
|
+
"surfaceMuted": "#1a1a1a",
|
|
14
|
+
"surfaceUser": "#1f1f1f",
|
|
15
|
+
"surfaceCustom": "#161616",
|
|
16
|
+
"gray": "#a7a7a7",
|
|
17
|
+
"dimGray": "#8a8a8a",
|
|
18
|
+
"borderGray": "#666666",
|
|
19
|
+
"borderBright": "#9a9a9a"
|
|
20
|
+
},
|
|
21
|
+
"colors": {
|
|
22
|
+
"accent": "accentBlue",
|
|
23
|
+
"border": "borderGray",
|
|
24
|
+
"borderAccent": "borderBright",
|
|
25
|
+
"borderMuted": "borderGray",
|
|
26
|
+
"success": "successGreen",
|
|
27
|
+
"error": "errorRed",
|
|
28
|
+
"warning": "warningAmber",
|
|
29
|
+
"muted": "gray",
|
|
30
|
+
"dim": "dimGray",
|
|
31
|
+
"text": "",
|
|
32
|
+
"thinkingText": "gray",
|
|
33
|
+
|
|
34
|
+
"selectedBg": "surfaceMuted",
|
|
35
|
+
"userMessageBg": "surfaceUser",
|
|
36
|
+
"userMessageText": "",
|
|
37
|
+
"customMessageBg": "surfaceCustom",
|
|
38
|
+
"customMessageText": "",
|
|
39
|
+
"customMessageLabel": "accentBlue",
|
|
40
|
+
"toolPendingBg": "surfaceAlt",
|
|
41
|
+
"toolSuccessBg": "surfaceAlt",
|
|
42
|
+
"toolErrorBg": "surfaceAlt",
|
|
43
|
+
"toolTitle": "",
|
|
44
|
+
"toolOutput": "gray",
|
|
45
|
+
|
|
46
|
+
"mdHeading": "warningAmber",
|
|
47
|
+
"mdLink": "accentBlue",
|
|
48
|
+
"mdLinkUrl": "dimGray",
|
|
49
|
+
"mdCode": "accentCyan",
|
|
50
|
+
"mdCodeBlock": "gray",
|
|
51
|
+
"mdCodeBlockBorder": "borderGray",
|
|
52
|
+
"mdQuote": "gray",
|
|
53
|
+
"mdQuoteBorder": "borderGray",
|
|
54
|
+
"mdHr": "borderGray",
|
|
55
|
+
"mdListBullet": "accentTeal",
|
|
56
|
+
|
|
57
|
+
"toolDiffAdded": "successGreen",
|
|
58
|
+
"toolDiffRemoved": "errorRed",
|
|
59
|
+
"toolDiffContext": "gray",
|
|
60
|
+
|
|
61
|
+
"syntaxComment": "#6b7280",
|
|
62
|
+
"syntaxKeyword": "#7aa2f7",
|
|
63
|
+
"syntaxFunction": "#c0caf5",
|
|
64
|
+
"syntaxVariable": "#a9b1d6",
|
|
65
|
+
"syntaxString": "#9ece6a",
|
|
66
|
+
"syntaxNumber": "#ff9e64",
|
|
67
|
+
"syntaxType": "#73daca",
|
|
68
|
+
"syntaxOperator": "#c0caf5",
|
|
69
|
+
"syntaxPunctuation": "#8f9bb3",
|
|
70
|
+
|
|
71
|
+
"thinkingOff": "borderGray",
|
|
72
|
+
"thinkingMinimal": "#707070",
|
|
73
|
+
"thinkingLow": "#7a7a7a",
|
|
74
|
+
"thinkingMedium": "#858585",
|
|
75
|
+
"thinkingHigh": "#8f8f8f",
|
|
76
|
+
"thinkingXhigh": "#999999",
|
|
77
|
+
|
|
78
|
+
"bashMode": "accentTeal"
|
|
79
|
+
},
|
|
80
|
+
"export": {
|
|
81
|
+
"pageBg": "#12161d",
|
|
82
|
+
"cardBg": "#171b22",
|
|
83
|
+
"infoBg": "#28230f"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
+
"name": "pidex-light",
|
|
4
|
+
"vars": {
|
|
5
|
+
"accentBlue": "#44546a",
|
|
6
|
+
"accentCyan": "#5f6b7a",
|
|
7
|
+
"accentTeal": "#5f6b7a",
|
|
8
|
+
"successGreen": "#587558",
|
|
9
|
+
"errorRed": "#a85f5f",
|
|
10
|
+
"warningAmber": "#8e7348",
|
|
11
|
+
"surface": "#ffffff",
|
|
12
|
+
"surfaceAlt": "#f1f1f1",
|
|
13
|
+
"surfaceMuted": "#e6e6e6",
|
|
14
|
+
"surfaceUser": "#f0f0f0",
|
|
15
|
+
"surfaceCustom": "#f5f5f5",
|
|
16
|
+
"gray": "#5f5f5f",
|
|
17
|
+
"dimGray": "#7a7a7a",
|
|
18
|
+
"borderGray": "#b9b9b9",
|
|
19
|
+
"borderBright": "#9f9f9f"
|
|
20
|
+
},
|
|
21
|
+
"colors": {
|
|
22
|
+
"accent": "accentBlue",
|
|
23
|
+
"border": "borderGray",
|
|
24
|
+
"borderAccent": "borderBright",
|
|
25
|
+
"borderMuted": "borderGray",
|
|
26
|
+
"success": "successGreen",
|
|
27
|
+
"error": "errorRed",
|
|
28
|
+
"warning": "warningAmber",
|
|
29
|
+
"muted": "gray",
|
|
30
|
+
"dim": "dimGray",
|
|
31
|
+
"text": "",
|
|
32
|
+
"thinkingText": "gray",
|
|
33
|
+
|
|
34
|
+
"selectedBg": "surfaceMuted",
|
|
35
|
+
"userMessageBg": "surfaceUser",
|
|
36
|
+
"userMessageText": "",
|
|
37
|
+
"customMessageBg": "surfaceCustom",
|
|
38
|
+
"customMessageText": "",
|
|
39
|
+
"customMessageLabel": "accentBlue",
|
|
40
|
+
"toolPendingBg": "surfaceAlt",
|
|
41
|
+
"toolSuccessBg": "surfaceAlt",
|
|
42
|
+
"toolErrorBg": "surfaceAlt",
|
|
43
|
+
"toolTitle": "",
|
|
44
|
+
"toolOutput": "gray",
|
|
45
|
+
|
|
46
|
+
"mdHeading": "warningAmber",
|
|
47
|
+
"mdLink": "accentBlue",
|
|
48
|
+
"mdLinkUrl": "dimGray",
|
|
49
|
+
"mdCode": "accentCyan",
|
|
50
|
+
"mdCodeBlock": "gray",
|
|
51
|
+
"mdCodeBlockBorder": "borderGray",
|
|
52
|
+
"mdQuote": "gray",
|
|
53
|
+
"mdQuoteBorder": "borderGray",
|
|
54
|
+
"mdHr": "borderGray",
|
|
55
|
+
"mdListBullet": "accentTeal",
|
|
56
|
+
|
|
57
|
+
"toolDiffAdded": "successGreen",
|
|
58
|
+
"toolDiffRemoved": "errorRed",
|
|
59
|
+
"toolDiffContext": "gray",
|
|
60
|
+
|
|
61
|
+
"syntaxComment": "#6b7280",
|
|
62
|
+
"syntaxKeyword": "#3569c8",
|
|
63
|
+
"syntaxFunction": "#3b4351",
|
|
64
|
+
"syntaxVariable": "#364152",
|
|
65
|
+
"syntaxString": "#3f7d3d",
|
|
66
|
+
"syntaxNumber": "#b06500",
|
|
67
|
+
"syntaxType": "#2c7a7b",
|
|
68
|
+
"syntaxOperator": "#3b4351",
|
|
69
|
+
"syntaxPunctuation": "#55606f",
|
|
70
|
+
|
|
71
|
+
"thinkingOff": "borderGray",
|
|
72
|
+
"thinkingMinimal": "#9d9d9d",
|
|
73
|
+
"thinkingLow": "#979797",
|
|
74
|
+
"thinkingMedium": "#919191",
|
|
75
|
+
"thinkingHigh": "#8b8b8b",
|
|
76
|
+
"thinkingXhigh": "#858585",
|
|
77
|
+
|
|
78
|
+
"bashMode": "accentTeal"
|
|
79
|
+
},
|
|
80
|
+
"export": {
|
|
81
|
+
"pageBg": "#f5f7fa",
|
|
82
|
+
"cardBg": "#ffffff",
|
|
83
|
+
"infoBg": "#fff5e6"
|
|
84
|
+
}
|
|
85
|
+
}
|
package/cli/dist/index.cjs
CHANGED
|
@@ -29623,11 +29623,15 @@ async function runClaudeRuntimeSyncPhase(opts) {
|
|
|
29623
29623
|
const hooksConfig = await import_fs_extra2.default.readJson(hooksConfigPath);
|
|
29624
29624
|
const projectHooksDir = import_path2.default.join(repoRoot, ".xtrm", "hooks");
|
|
29625
29625
|
const generatedHooks = resolveHooksForProjectRuntime(hooksConfig.hooks ?? {}, projectHooksDir);
|
|
29626
|
+
const generatedStatusLine = resolveStatusLineForProjectRuntime(hooksConfig.statusLine, projectHooksDir);
|
|
29626
29627
|
const settingsPath = isGlobal ? import_path2.default.join(import_os.default.homedir(), ".claude", "settings.json") : import_path2.default.join(repoRoot, ".claude", "settings.json");
|
|
29627
29628
|
const hasExistingSettings = await import_fs_extra2.default.pathExists(settingsPath);
|
|
29628
29629
|
const baseSettings = await readBaseSettings(settingsTemplatePath);
|
|
29629
29630
|
const existingSettings = hasExistingSettings ? await readSettings(settingsPath) : {};
|
|
29630
29631
|
const mergedSettings = hasExistingSettings ? { ...existingSettings, hooks: generatedHooks } : { ...baseSettings, hooks: generatedHooks };
|
|
29632
|
+
if (generatedStatusLine) {
|
|
29633
|
+
mergedSettings.statusLine = generatedStatusLine;
|
|
29634
|
+
}
|
|
29631
29635
|
if (prune) {
|
|
29632
29636
|
delete mergedSettings.enabledPlugins;
|
|
29633
29637
|
delete mergedSettings.extraKnownMarketplaces;
|
|
@@ -29671,6 +29675,7 @@ async function runClaudeRuntimeSyncPhase(opts) {
|
|
|
29671
29675
|
console.log(t.success(" \u2713 Removed plugin-era settings keys (enabledPlugins, extraKnownMarketplaces)"));
|
|
29672
29676
|
}
|
|
29673
29677
|
console.log(t.success(" \u2713 Claude settings hooks synced\n"));
|
|
29678
|
+
await ensureGlobalStatusLine();
|
|
29674
29679
|
return {
|
|
29675
29680
|
settingsPath,
|
|
29676
29681
|
hooksEventsWritten,
|
|
@@ -29678,6 +29683,24 @@ async function runClaudeRuntimeSyncPhase(opts) {
|
|
|
29678
29683
|
wroteSettings: true
|
|
29679
29684
|
};
|
|
29680
29685
|
}
|
|
29686
|
+
async function ensureGlobalStatusLine() {
|
|
29687
|
+
const homeDir = import_os.default.homedir();
|
|
29688
|
+
const statuslineHookPath = import_path2.default.join(homeDir, ".xtrm", "hooks", "statusline.mjs");
|
|
29689
|
+
const globalSettingsPath = import_path2.default.join(homeDir, ".claude", "settings.json");
|
|
29690
|
+
if (!await import_fs_extra2.default.pathExists(statuslineHookPath)) {
|
|
29691
|
+
return;
|
|
29692
|
+
}
|
|
29693
|
+
const expectedCommand = `node "${statuslineHookPath}"`;
|
|
29694
|
+
const settings = await readSettings(globalSettingsPath);
|
|
29695
|
+
const currentCommand = settings.statusLine?.command;
|
|
29696
|
+
if (currentCommand === expectedCommand) {
|
|
29697
|
+
return;
|
|
29698
|
+
}
|
|
29699
|
+
settings.statusLine = { type: "command", command: expectedCommand };
|
|
29700
|
+
await import_fs_extra2.default.ensureDir(import_path2.default.dirname(globalSettingsPath));
|
|
29701
|
+
await import_fs_extra2.default.writeJson(globalSettingsPath, settings, { spaces: 2 });
|
|
29702
|
+
console.log(t.success(` \u2713 Wired statusline \u2192 ~/.xtrm/hooks/statusline.mjs`));
|
|
29703
|
+
}
|
|
29681
29704
|
function resolveHooksForProjectRuntime(hooks, projectHooksDir) {
|
|
29682
29705
|
const normalizedHooksDir = normalizeHookCommandPath(projectHooksDir);
|
|
29683
29706
|
const rewrittenHooks = {};
|
|
@@ -29697,6 +29720,36 @@ function resolveHooksForProjectRuntime(hooks, projectHooksDir) {
|
|
|
29697
29720
|
}
|
|
29698
29721
|
return rewrittenHooks;
|
|
29699
29722
|
}
|
|
29723
|
+
function resolveStatusLineForProjectRuntime(statusLineConfig, projectHooksDir) {
|
|
29724
|
+
if (!statusLineConfig?.script) {
|
|
29725
|
+
return void 0;
|
|
29726
|
+
}
|
|
29727
|
+
const normalizedHooksDir = normalizeHookCommandPath(projectHooksDir);
|
|
29728
|
+
const resolvedScriptPath = resolveStatusLineScriptPath(statusLineConfig.script, normalizedHooksDir);
|
|
29729
|
+
return {
|
|
29730
|
+
type: "command",
|
|
29731
|
+
command: buildScriptCommand(statusLineConfig.script, resolvedScriptPath)
|
|
29732
|
+
};
|
|
29733
|
+
}
|
|
29734
|
+
function resolveStatusLineScriptPath(script, normalizedHooksDir) {
|
|
29735
|
+
const pluginRootPattern = /^(?:\$\{CLAUDE_PLUGIN_ROOT\}|\$CLAUDE_PLUGIN_ROOT)\/hooks\/(.+)$/;
|
|
29736
|
+
const pluginRootMatch = script.match(pluginRootPattern);
|
|
29737
|
+
if (pluginRootMatch?.[1]) {
|
|
29738
|
+
return normalizeHookCommandPath(import_path2.default.join(normalizedHooksDir, pluginRootMatch[1]));
|
|
29739
|
+
}
|
|
29740
|
+
return normalizeHookCommandPath(import_path2.default.join(normalizedHooksDir, script));
|
|
29741
|
+
}
|
|
29742
|
+
function buildScriptCommand(scriptName, resolvedPath) {
|
|
29743
|
+
const ext = import_path2.default.extname(scriptName).toLowerCase();
|
|
29744
|
+
if (ext === ".js" || ext === ".cjs" || ext === ".mjs") {
|
|
29745
|
+
return `node "${resolvedPath}"`;
|
|
29746
|
+
}
|
|
29747
|
+
if (ext === ".sh") {
|
|
29748
|
+
return `bash "${resolvedPath}"`;
|
|
29749
|
+
}
|
|
29750
|
+
const pythonBin = process.platform === "win32" ? "python" : "python3";
|
|
29751
|
+
return `${pythonBin} "${resolvedPath}"`;
|
|
29752
|
+
}
|
|
29700
29753
|
function rewritePluginRootCommandToProjectHookPath(command, normalizedHooksDir) {
|
|
29701
29754
|
const pluginRootPatterns = [
|
|
29702
29755
|
/\$\{CLAUDE_PLUGIN_ROOT\}\/hooks\/([^\s"']+)/g,
|
|
@@ -45867,8 +45920,17 @@ async function scaffoldSkillsDefaultFromPackage(params) {
|
|
|
45867
45920
|
const { packageRoot, userXtrmDir, dryRun } = params;
|
|
45868
45921
|
const sourceDir = import_path8.default.join(packageRoot, ".xtrm", "skills", "default");
|
|
45869
45922
|
const targetDir = import_path8.default.join(userXtrmDir, "skills", "default");
|
|
45870
|
-
|
|
45871
|
-
|
|
45923
|
+
const stat = await import_fs_extra13.default.lstat(targetDir).catch(() => null);
|
|
45924
|
+
if (stat) {
|
|
45925
|
+
if (stat.isSymbolicLink()) {
|
|
45926
|
+
const isValid = await import_fs_extra13.default.pathExists(targetDir);
|
|
45927
|
+
if (isValid) {
|
|
45928
|
+
return "noop";
|
|
45929
|
+
}
|
|
45930
|
+
await import_fs_extra13.default.remove(targetDir);
|
|
45931
|
+
} else {
|
|
45932
|
+
return "noop";
|
|
45933
|
+
}
|
|
45872
45934
|
}
|
|
45873
45935
|
if (dryRun) {
|
|
45874
45936
|
return "noop";
|