xtrm-tools 0.7.2 → 0.7.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.
@@ -32,7 +32,7 @@ import {
32
32
  createWriteTool,
33
33
  } from "@mariozechner/pi-coding-agent";
34
34
  import { Box, Text, truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
35
- import { basename } from "node:path";
35
+ import { basename, join } from "node:path";
36
36
  import {
37
37
  cleanOutputLines,
38
38
  countPrefixedItems,
@@ -968,6 +968,7 @@ function isXtrmTheme(name: string | undefined): boolean {
968
968
  export default function xtrmUiExtension(pi: ExtensionAPI): void {
969
969
  let prefs: XtrmUiPrefs = { ...DEFAULT_PREFS };
970
970
  let previousThemeName: string | null = null;
971
+ const extensionThemeDir = join(__dirname, "themes");
971
972
 
972
973
  const getPrefs = () => prefs;
973
974
  const setPrefs = (p: XtrmUiPrefs) => { prefs = p; };
@@ -980,12 +981,20 @@ export default function xtrmUiExtension(pi: ExtensionAPI): void {
980
981
  applyXtrmChrome(ctx, prefs, getThinkingLevel);
981
982
  };
982
983
 
984
+ pi.on("resources_discover", async () => ({
985
+ themePaths: [extensionThemeDir],
986
+ }));
987
+
983
988
  pi.on("session_start", async (_event, ctx) => {
984
989
  prefs = loadPrefs(ctx.sessionManager.getEntries() as Array<MaybeCustomEntry>);
985
990
  if (!previousThemeName && !isXtrmTheme(ctx.ui.theme.name)) {
986
991
  previousThemeName = ctx.ui.theme.name ?? null;
987
992
  }
988
993
  refresh(ctx);
994
+
995
+ setTimeout(() => {
996
+ if (prefs.forceTheme) ctx.ui.setTheme(prefs.themeName);
997
+ }, 0);
989
998
  });
990
999
 
991
1000
  pi.on("session_switch", async (_event, ctx) => {
@@ -37,9 +37,13 @@
37
37
  "customMessageBg": "surfaceCustom",
38
38
  "customMessageText": "",
39
39
  "customMessageLabel": "accentBlue",
40
- "toolPendingBg": "surfaceAlt",
41
- "toolSuccessBg": "surfaceAlt",
42
- "toolErrorBg": "surfaceAlt",
40
+ "toolPendingBg": "surface",
41
+ "toolSuccessBg": "surface",
42
+ "toolErrorBg": "surface",
43
+ "toolUseBg": "surface",
44
+ "toolUsePendingBg": "surface",
45
+ "toolUseSuccessBg": "surface",
46
+ "toolUseErrorBg": "surface",
43
47
  "toolTitle": "",
44
48
  "toolOutput": "gray",
45
49
 
@@ -40,6 +40,10 @@
40
40
  "toolPendingBg": "surfaceAlt",
41
41
  "toolSuccessBg": "surfaceAlt",
42
42
  "toolErrorBg": "surfaceAlt",
43
+ "toolUseBg": "surfaceAlt",
44
+ "toolUsePendingBg": "surfaceAlt",
45
+ "toolUseSuccessBg": "surfaceAlt",
46
+ "toolUseErrorBg": "surfaceAlt",
43
47
  "toolTitle": "",
44
48
  "toolOutput": "gray",
45
49
 
@@ -32,7 +32,7 @@ import {
32
32
  createWriteTool,
33
33
  } from "@mariozechner/pi-coding-agent";
34
34
  import { Box, Text, truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
35
- import { basename } from "node:path";
35
+ import { basename, join } from "node:path";
36
36
  import {
37
37
  cleanOutputLines,
38
38
  countPrefixedItems,
@@ -968,6 +968,7 @@ function isXtrmTheme(name: string | undefined): boolean {
968
968
  export default function xtrmUiExtension(pi: ExtensionAPI): void {
969
969
  let prefs: XtrmUiPrefs = { ...DEFAULT_PREFS };
970
970
  let previousThemeName: string | null = null;
971
+ const extensionThemeDir = join(__dirname, "themes");
971
972
 
972
973
  const getPrefs = () => prefs;
973
974
  const setPrefs = (p: XtrmUiPrefs) => { prefs = p; };
@@ -980,12 +981,20 @@ export default function xtrmUiExtension(pi: ExtensionAPI): void {
980
981
  applyXtrmChrome(ctx, prefs, getThinkingLevel);
981
982
  };
982
983
 
984
+ pi.on("resources_discover", async () => ({
985
+ themePaths: [extensionThemeDir],
986
+ }));
987
+
983
988
  pi.on("session_start", async (_event, ctx) => {
984
989
  prefs = loadPrefs(ctx.sessionManager.getEntries() as Array<MaybeCustomEntry>);
985
990
  if (!previousThemeName && !isXtrmTheme(ctx.ui.theme.name)) {
986
991
  previousThemeName = ctx.ui.theme.name ?? null;
987
992
  }
988
993
  refresh(ctx);
994
+
995
+ setTimeout(() => {
996
+ if (prefs.forceTheme) ctx.ui.setTheme(prefs.themeName);
997
+ }, 0);
989
998
  });
990
999
 
991
1000
  pi.on("session_switch", async (_event, ctx) => {