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.
- package/dist/package.json +3 -3
- package/dist/src/config/__tests__/ConfigLoader.test.js +7 -7
- package/dist/src/config/defaults.js +1 -1
- package/dist/src/config/types.js +1 -1
- package/dist/src/i18n/types.js +0 -1
- package/dist/src/tui/shared/session-events.js +0 -1
- package/dist/src/tui/shared/themes/types.js +0 -1
- package/dist/src/tui/shared/types.js +0 -1
- package/dist/src/tui-opentui/ConfigContext.js +10 -0
- package/dist/src/tui-opentui/ThemeProvider.js +73 -0
- package/dist/src/tui-opentui/app.js +536 -0
- package/dist/src/tui-opentui/components/AnimatedGradient.js +56 -0
- package/dist/src/tui-opentui/components/ConfirmationDialog.js +89 -0
- package/dist/src/tui-opentui/components/CustomInput.js +25 -0
- package/dist/src/tui-opentui/components/ErrorBoundary.js +26 -0
- package/dist/src/tui-opentui/components/Footer.js +92 -0
- package/dist/src/tui-opentui/components/Header.js +46 -0
- package/dist/src/tui-opentui/components/MarkdownPrompt.js +13 -0
- package/dist/src/tui-opentui/components/OptionsList.js +258 -0
- package/dist/src/tui-opentui/components/QuestionDisplay.js +23 -0
- package/dist/src/tui-opentui/components/ReviewScreen.js +81 -0
- package/dist/src/tui-opentui/components/SessionDots.js +86 -0
- package/dist/src/tui-opentui/components/SessionPicker.js +162 -0
- package/dist/src/tui-opentui/components/SingleLineTextInput.js +9 -0
- package/dist/src/tui-opentui/components/StepperView.js +493 -0
- package/dist/src/tui-opentui/components/TabBar.js +79 -0
- package/dist/src/tui-opentui/components/ThemeIndicator.js +35 -0
- package/dist/src/tui-opentui/components/Toast.js +44 -0
- package/dist/src/tui-opentui/components/UpdateBadge.js +24 -0
- package/dist/src/tui-opentui/components/UpdateOverlay.js +162 -0
- package/dist/src/tui-opentui/components/WaitingScreen.js +44 -0
- package/dist/src/tui-opentui/hooks/useSessionWatcher.js +69 -0
- package/dist/src/tui-opentui/hooks/useTerminalDimensions.js +8 -0
- package/dist/src/tui-opentui/utils/syntaxStyle.js +64 -0
- package/dist/src/update/types.js +0 -1
- 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.
|
|
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
|
|
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 '
|
|
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("
|
|
139
|
+
expect(config.renderer).toBe("opentui");
|
|
140
140
|
});
|
|
141
|
-
it("should include renderer in DEFAULT_CONFIG as '
|
|
142
|
-
expect(DEFAULT_CONFIG.renderer).toBe("
|
|
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 '
|
|
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 ('
|
|
160
|
+
// Invalid enum value should be ignored, default ('opentui') used
|
|
161
161
|
expect(config.renderer).toBe(DEFAULT_CONFIG.renderer);
|
|
162
|
-
expect(config.renderer).toBe("
|
|
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);
|
package/dist/src/config/types.js
CHANGED
|
@@ -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("
|
|
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),
|
package/dist/src/i18n/types.js
CHANGED
|
@@ -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
|
+
}
|