auq-mcp-server 2.7.1 → 3.0.0

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 (34) hide show
  1. package/dist/bin/tui-app.js +3 -2
  2. package/dist/package.json +3 -3
  3. package/dist/src/i18n/types.js +0 -1
  4. package/dist/src/tui/shared/session-events.js +0 -1
  5. package/dist/src/tui/shared/themes/types.js +0 -1
  6. package/dist/src/tui/shared/types.js +0 -1
  7. package/dist/src/tui-opentui/ConfigContext.js +10 -0
  8. package/dist/src/tui-opentui/ThemeProvider.js +73 -0
  9. package/dist/src/tui-opentui/app.js +536 -0
  10. package/dist/src/tui-opentui/components/AnimatedGradient.js +56 -0
  11. package/dist/src/tui-opentui/components/ConfirmationDialog.js +89 -0
  12. package/dist/src/tui-opentui/components/CustomInput.js +25 -0
  13. package/dist/src/tui-opentui/components/ErrorBoundary.js +26 -0
  14. package/dist/src/tui-opentui/components/Footer.js +92 -0
  15. package/dist/src/tui-opentui/components/Header.js +46 -0
  16. package/dist/src/tui-opentui/components/MarkdownPrompt.js +13 -0
  17. package/dist/src/tui-opentui/components/OptionsList.js +258 -0
  18. package/dist/src/tui-opentui/components/QuestionDisplay.js +23 -0
  19. package/dist/src/tui-opentui/components/ReviewScreen.js +81 -0
  20. package/dist/src/tui-opentui/components/SessionDots.js +86 -0
  21. package/dist/src/tui-opentui/components/SessionPicker.js +162 -0
  22. package/dist/src/tui-opentui/components/SingleLineTextInput.js +9 -0
  23. package/dist/src/tui-opentui/components/StepperView.js +493 -0
  24. package/dist/src/tui-opentui/components/TabBar.js +79 -0
  25. package/dist/src/tui-opentui/components/ThemeIndicator.js +35 -0
  26. package/dist/src/tui-opentui/components/Toast.js +44 -0
  27. package/dist/src/tui-opentui/components/UpdateBadge.js +24 -0
  28. package/dist/src/tui-opentui/components/UpdateOverlay.js +162 -0
  29. package/dist/src/tui-opentui/components/WaitingScreen.js +44 -0
  30. package/dist/src/tui-opentui/hooks/useSessionWatcher.js +69 -0
  31. package/dist/src/tui-opentui/hooks/useTerminalDimensions.js +8 -0
  32. package/dist/src/tui-opentui/utils/syntaxStyle.js +64 -0
  33. package/dist/src/update/types.js +0 -1
  34. package/package.json +3 -3
@@ -594,8 +594,9 @@ export const runTui = async (config) => {
594
594
  await runOpenTui(mergedConfig);
595
595
  }
596
596
  catch (err) {
597
- console.warn(`⚠️ OpenTUI failed to initialize: ${err instanceof Error ? err.message : String(err)}. Falling back to ink renderer.`);
598
- await runInkTui(mergedConfig);
597
+ console.error(`❌ OpenTUI failed to initialize: ${err instanceof Error ? err.message : String(err)}`);
598
+ console.error(`\n To use the legacy ink renderer, set AUQ_RENDERER=ink or add "renderer": "ink" to your .auqrc.json\n`);
599
+ process.exit(1);
599
600
  }
600
601
  }
601
602
  else {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auq-mcp-server",
3
- "version": "2.7.1",
3
+ "version": "3.0.0",
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
  },
@@ -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
+ }