auq-mcp-server 2.7.0 → 2.7.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.
Files changed (36) hide show
  1. package/dist/package.json +3 -3
  2. package/dist/src/config/__tests__/ConfigLoader.test.js +7 -7
  3. package/dist/src/config/defaults.js +1 -1
  4. package/dist/src/config/types.js +1 -1
  5. package/dist/src/i18n/types.js +0 -1
  6. package/dist/src/tui/shared/session-events.js +0 -1
  7. package/dist/src/tui/shared/themes/types.js +0 -1
  8. package/dist/src/tui/shared/types.js +0 -1
  9. package/dist/src/tui-opentui/ConfigContext.js +10 -0
  10. package/dist/src/tui-opentui/ThemeProvider.js +73 -0
  11. package/dist/src/tui-opentui/app.js +536 -0
  12. package/dist/src/tui-opentui/components/AnimatedGradient.js +56 -0
  13. package/dist/src/tui-opentui/components/ConfirmationDialog.js +89 -0
  14. package/dist/src/tui-opentui/components/CustomInput.js +25 -0
  15. package/dist/src/tui-opentui/components/ErrorBoundary.js +26 -0
  16. package/dist/src/tui-opentui/components/Footer.js +92 -0
  17. package/dist/src/tui-opentui/components/Header.js +46 -0
  18. package/dist/src/tui-opentui/components/MarkdownPrompt.js +13 -0
  19. package/dist/src/tui-opentui/components/OptionsList.js +258 -0
  20. package/dist/src/tui-opentui/components/QuestionDisplay.js +23 -0
  21. package/dist/src/tui-opentui/components/ReviewScreen.js +81 -0
  22. package/dist/src/tui-opentui/components/SessionDots.js +86 -0
  23. package/dist/src/tui-opentui/components/SessionPicker.js +162 -0
  24. package/dist/src/tui-opentui/components/SingleLineTextInput.js +9 -0
  25. package/dist/src/tui-opentui/components/StepperView.js +493 -0
  26. package/dist/src/tui-opentui/components/TabBar.js +79 -0
  27. package/dist/src/tui-opentui/components/ThemeIndicator.js +35 -0
  28. package/dist/src/tui-opentui/components/Toast.js +44 -0
  29. package/dist/src/tui-opentui/components/UpdateBadge.js +24 -0
  30. package/dist/src/tui-opentui/components/UpdateOverlay.js +162 -0
  31. package/dist/src/tui-opentui/components/WaitingScreen.js +44 -0
  32. package/dist/src/tui-opentui/hooks/useSessionWatcher.js +69 -0
  33. package/dist/src/tui-opentui/hooks/useTerminalDimensions.js +8 -0
  34. package/dist/src/tui-opentui/utils/syntaxStyle.js +64 -0
  35. package/dist/src/update/types.js +0 -1
  36. package/package.json +3 -3
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auq-mcp-server",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "auq": "dist/bin/auq.js"
@@ -15,7 +15,7 @@
15
15
  "packages/opencode-plugin"
16
16
  ],
17
17
  "scripts": {
18
- "build": "bun run sync-plugin-schemas && bun run generate:skill && tsc",
18
+ "build": "bun run sync-plugin-schemas && bun run generate:skill && tsc && tsc -p tsconfig.opentui.json",
19
19
  "prepare": "bun run build",
20
20
  "postinstall": "node scripts/postinstall.cjs",
21
21
  "release": "semantic-release",
@@ -29,7 +29,7 @@
29
29
  "validate:skill": "bunx skills-ref validate skills/ask-user-questions",
30
30
  "test": "vitest run",
31
31
  "format": "prettier --write . && eslint --fix .",
32
- "build:opentui": "tsc -p tsconfig.opentui.json --noEmit",
32
+ "build:opentui": "tsc -p tsconfig.opentui.json",
33
33
  "test:opentui": "bun test src/tui-opentui",
34
34
  "typecheck:all": "tsc --noEmit && tsc -p tsconfig.opentui.json --noEmit"
35
35
  },
@@ -133,13 +133,13 @@ describe("ConfigLoader", () => {
133
133
  });
134
134
  });
135
135
  describe("renderer config options", () => {
136
- it("should have 'ink' as default renderer when no config files exist", () => {
136
+ it("should have 'opentui' as default renderer when no config files exist", () => {
137
137
  vi.mocked(fs.existsSync).mockReturnValue(false);
138
138
  const config = loadConfig();
139
- expect(config.renderer).toBe("ink");
139
+ expect(config.renderer).toBe("opentui");
140
140
  });
141
- it("should include renderer in DEFAULT_CONFIG as 'ink'", () => {
142
- expect(DEFAULT_CONFIG.renderer).toBe("ink");
141
+ it("should include renderer in DEFAULT_CONFIG as 'opentui'", () => {
142
+ expect(DEFAULT_CONFIG.renderer).toBe("opentui");
143
143
  });
144
144
  it("should load renderer: 'opentui' from config file", () => {
145
145
  vi.mocked(fs.existsSync).mockReturnValue(true);
@@ -153,13 +153,13 @@ describe("ConfigLoader", () => {
153
153
  const config = loadConfig();
154
154
  expect(config.renderer).toBe("ink");
155
155
  });
156
- it("should fall back to 'ink' for invalid renderer value", () => {
156
+ it("should fall back to 'opentui' for invalid renderer value", () => {
157
157
  vi.mocked(fs.existsSync).mockReturnValue(true);
158
158
  vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify({ renderer: "chrome" }));
159
159
  const config = loadConfig();
160
- // Invalid enum value should be ignored, default ('ink') used
160
+ // Invalid enum value should be ignored, default ('opentui') used
161
161
  expect(config.renderer).toBe(DEFAULT_CONFIG.renderer);
162
- expect(config.renderer).toBe("ink");
162
+ expect(config.renderer).toBe("opentui");
163
163
  });
164
164
  it("should preserve other config values alongside renderer setting", () => {
165
165
  vi.mocked(fs.existsSync).mockReturnValue(true);
@@ -8,7 +8,7 @@ export const DEFAULT_CONFIG = {
8
8
  language: "auto",
9
9
  theme: "system",
10
10
  autoSelectRecommended: true,
11
- renderer: "ink",
11
+ renderer: "opentui",
12
12
  staleThreshold: 7200000, // 2 hours in ms
13
13
  notifyOnStale: true,
14
14
  staleAction: "warn",
@@ -21,7 +21,7 @@ export const AUQConfigSchema = z.object({
21
21
  language: z.string().default("auto"),
22
22
  theme: z.string().default("system"),
23
23
  autoSelectRecommended: z.boolean().default(true),
24
- renderer: z.enum(["ink", "opentui"]).default("ink"),
24
+ renderer: z.enum(["ink", "opentui"]).default("opentui"),
25
25
  // Stale/Orphan Session Detection
26
26
  staleThreshold: z.number().min(0).default(7200000), // 2 hours in ms
27
27
  notifyOnStale: z.boolean().default(true),
@@ -1,2 +1 @@
1
1
  // Translation key types for type-safe internationalization
2
- export {};
@@ -1,4 +1,3 @@
1
1
  /**
2
2
  * Shared session event types for both ink and OpenTUI TUI implementations.
3
3
  */
4
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "@opentui/react/jsx-runtime";
2
+ import { createContext, useContext } from "react";
3
+ import { DEFAULT_CONFIG } from "../config/defaults.js";
4
+ const ConfigContext = createContext({ config: DEFAULT_CONFIG });
5
+ export function ConfigProvider({ config, children, }) {
6
+ return (_jsx(ConfigContext.Provider, { value: { config }, children: children }));
7
+ }
8
+ export function useConfig() {
9
+ return useContext(ConfigContext).config;
10
+ }
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx } from "@opentui/react/jsx-runtime";
2
+ import { createContext, useCallback, useContext, useEffect, useMemo, useState, } from "react";
3
+ import { useKeyboard } from "@opentui/react";
4
+ import { getTheme, listThemes, hasTheme, darkTheme, } from "../tui/shared/themes/index.js";
5
+ import { detectSystemTheme } from "../tui/shared/utils/detectTheme.js";
6
+ import { getSavedTheme, saveTheme } from "../tui/shared/utils/config.js";
7
+ import { generateSyntaxStyle } from "./utils/syntaxStyle.js";
8
+ // ---------------------------------------------------------------------------
9
+ // Context
10
+ // ---------------------------------------------------------------------------
11
+ const ThemeContext = createContext(null);
12
+ /**
13
+ * Consume the nearest ThemeProvider.
14
+ * Throws if called outside of one (fail-fast, no silent undefined).
15
+ */
16
+ export function useTheme() {
17
+ const ctx = useContext(ThemeContext);
18
+ if (!ctx) {
19
+ throw new Error("useTheme must be used within a ThemeProvider");
20
+ }
21
+ return ctx;
22
+ }
23
+ // ---------------------------------------------------------------------------
24
+ // Internals
25
+ // ---------------------------------------------------------------------------
26
+ /** Resolve a ThemeMode into a concrete Theme object. */
27
+ function resolveTheme(mode) {
28
+ if (mode === "system") {
29
+ const detected = detectSystemTheme();
30
+ return getTheme(detected) ?? darkTheme;
31
+ }
32
+ return getTheme(mode) ?? darkTheme;
33
+ }
34
+ /**
35
+ * Determine initial theme:
36
+ * 1. Explicit prop override (if not "system")
37
+ * 2. Persisted user preference from config
38
+ * 3. Fallback to "system"
39
+ */
40
+ function getInitialTheme(prop) {
41
+ if (prop && prop !== "system")
42
+ return prop;
43
+ const saved = getSavedTheme();
44
+ if (saved && (saved === "system" || hasTheme(saved)))
45
+ return saved;
46
+ return "system";
47
+ }
48
+ export function ThemeProvider({ initialTheme, children, }) {
49
+ const [themeName, setThemeName] = useState(() => getInitialTheme(initialTheme));
50
+ // Resolve the full Theme + SyntaxStyle when the mode changes.
51
+ const theme = useMemo(() => resolveTheme(themeName), [themeName]);
52
+ const syntaxStyle = useMemo(() => generateSyntaxStyle(theme), [theme]);
53
+ const cycleTheme = useCallback(() => {
54
+ setThemeName((current) => {
55
+ const allThemes = ["system", ...listThemes()];
56
+ const idx = allThemes.indexOf(current);
57
+ const next = (idx + 1) % allThemes.length;
58
+ return allThemes[next];
59
+ });
60
+ }, []);
61
+ // Ctrl+T to cycle theme — matches ink behaviour.
62
+ useKeyboard((key) => {
63
+ if (key.ctrl && key.name === "t") {
64
+ cycleTheme();
65
+ }
66
+ });
67
+ // Persist theme choice whenever it changes.
68
+ useEffect(() => {
69
+ saveTheme(themeName);
70
+ }, [themeName]);
71
+ const value = useMemo(() => ({ theme, themeName, syntaxStyle, cycleTheme }), [theme, themeName, syntaxStyle, cycleTheme]);
72
+ return (_jsx(ThemeContext.Provider, { value: value, children: children }));
73
+ }