auq-mcp-server 2.6.4 → 2.7.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.
- package/README.md +56 -2
- package/dist/bin/auq.js +36 -3
- package/dist/bin/tui-app.js +27 -6
- package/dist/package.json +7 -2
- package/dist/src/__tests__/schema-validation.test.js +61 -1
- package/dist/src/cli/commands/__tests__/fetch-answers.test.js +310 -0
- package/dist/src/cli/commands/__tests__/history.test.js +211 -0
- package/dist/src/cli/commands/answer.js +11 -0
- package/dist/src/cli/commands/config.js +48 -0
- package/dist/src/cli/commands/fetch-answers.js +205 -0
- package/dist/src/cli/commands/history.js +375 -0
- package/dist/src/config/__tests__/ConfigLoader.test.js +38 -0
- package/dist/src/config/defaults.js +1 -0
- package/dist/src/config/types.js +1 -0
- package/dist/src/core/ask-user-questions.js +63 -0
- package/dist/src/i18n/locales/en.js +2 -2
- package/dist/src/server.js +59 -2
- package/dist/src/session/ResponseFormatter.js +79 -2
- package/dist/src/session/SessionManager.js +36 -0
- package/dist/src/session/__tests__/ResponseFormatter.test.js +86 -0
- package/dist/src/session/__tests__/SessionManager.test.js +129 -0
- package/dist/src/shared/schemas.js +8 -0
- package/dist/src/tui/ThemeProvider.js +3 -3
- package/dist/src/tui/components/Header.js +2 -1
- package/dist/src/tui/components/OptionsList.js +1 -1
- package/dist/src/tui/components/SessionPicker.js +1 -1
- package/dist/src/tui/components/StepperView.js +1 -1
- package/dist/src/tui/components/__tests__/ConfirmationDialog.test.js +1 -1
- package/dist/src/tui/components/__tests__/Footer.test.js +1 -1
- package/dist/src/tui/components/__tests__/MarkdownPrompt.test.js +1 -1
- package/dist/src/tui/components/__tests__/ReviewScreen.test.js +1 -1
- package/dist/src/tui/components/__tests__/SessionDots.test.js +1 -1
- package/dist/src/tui/components/__tests__/SessionPicker.test.js +1 -1
- package/dist/src/tui/components/__tests__/StepperView.abandoned.test.js +1 -1
- package/dist/src/tui/components/__tests__/StepperView.keyboard.test.js +1 -1
- package/dist/src/tui/components/__tests__/StepperView.state.test.js +1 -1
- package/dist/src/tui/components/__tests__/WaitingScreen.test.js +1 -1
- package/dist/src/tui/shared/session-events.js +4 -0
- package/dist/src/tui/shared/themes/catppuccin-latte.js +130 -0
- package/dist/src/tui/shared/themes/catppuccin-mocha.js +131 -0
- package/dist/src/tui/shared/themes/dark.js +131 -0
- package/dist/src/tui/shared/themes/dracula.js +131 -0
- package/dist/src/tui/shared/themes/github-dark.js +129 -0
- package/dist/src/tui/shared/themes/github-light.js +129 -0
- package/dist/src/tui/shared/themes/gruvbox-dark.js +130 -0
- package/dist/src/tui/shared/themes/gruvbox-light.js +130 -0
- package/dist/src/tui/shared/themes/index.js +70 -0
- package/dist/src/tui/shared/themes/light.js +130 -0
- package/dist/src/tui/shared/themes/loader.js +111 -0
- package/dist/src/tui/shared/themes/monokai.js +132 -0
- package/dist/src/tui/shared/themes/nord.js +130 -0
- package/dist/src/tui/shared/themes/one-dark.js +131 -0
- package/dist/src/tui/shared/themes/rose-pine.js +131 -0
- package/dist/src/tui/shared/themes/solarized-dark.js +130 -0
- package/dist/src/tui/shared/themes/solarized-light.js +130 -0
- package/dist/src/tui/shared/themes/tokyo-night.js +131 -0
- package/dist/src/tui/shared/themes/types.js +1 -0
- package/dist/src/tui/shared/types.js +1 -0
- package/dist/src/tui/shared/utils/config.js +80 -0
- package/dist/src/tui/shared/utils/detectTheme.js +33 -0
- package/dist/src/tui/shared/utils/index.js +6 -0
- package/dist/src/tui/shared/utils/recommended.js +52 -0
- package/dist/src/tui/shared/utils/relativeTime.js +24 -0
- package/dist/src/tui/shared/utils/sessionSwitching.js +56 -0
- package/dist/src/tui/shared/utils/staleDetection.js +51 -0
- package/dist/src/tui/themes/catppuccin-latte.js +2 -127
- package/dist/src/tui/themes/catppuccin-mocha.js +2 -127
- package/dist/src/tui/themes/dark.js +2 -128
- package/dist/src/tui/themes/dracula.js +2 -127
- package/dist/src/tui/themes/github-dark.js +2 -126
- package/dist/src/tui/themes/github-light.js +2 -126
- package/dist/src/tui/themes/gruvbox-dark.js +2 -127
- package/dist/src/tui/themes/gruvbox-light.js +2 -127
- package/dist/src/tui/themes/index.js +2 -70
- package/dist/src/tui/themes/light.js +2 -127
- package/dist/src/tui/themes/loader.js +2 -111
- package/dist/src/tui/themes/monokai.js +2 -128
- package/dist/src/tui/themes/nord.js +2 -127
- package/dist/src/tui/themes/one-dark.js +2 -127
- package/dist/src/tui/themes/rose-pine.js +2 -128
- package/dist/src/tui/themes/solarized-dark.js +2 -127
- package/dist/src/tui/themes/solarized-light.js +2 -127
- package/dist/src/tui/themes/tokyo-night.js +2 -127
- package/dist/src/tui/themes/types.js +2 -1
- package/dist/src/tui/types.js +1 -1
- package/dist/src/tui/utils/__tests__/recommended.test.js +1 -1
- package/dist/src/tui/utils/__tests__/relativeTime.test.js +1 -1
- package/dist/src/tui/utils/__tests__/sessionSwitching.test.js +1 -1
- package/dist/src/tui/utils/__tests__/staleDetection.test.js +1 -1
- package/dist/src/tui/utils/config.js +1 -80
- package/dist/src/tui/utils/detectTheme.js +1 -22
- package/dist/src/tui/utils/recommended.js +1 -52
- package/dist/src/tui/utils/relativeTime.js +1 -24
- package/dist/src/tui/utils/sessionSwitching.js +1 -56
- package/dist/src/tui/utils/staleDetection.js +1 -51
- package/package.json +7 -2
|
@@ -1,51 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Stale Session Detection Utilities
|
|
3
|
-
*
|
|
4
|
-
* Pure functions for computing session staleness. No I/O or React dependencies.
|
|
5
|
-
* Design Decision 4: "Stale is computed flag, not persisted status"
|
|
6
|
-
* Design Decision 8: "Interaction resets stale check for that session"
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Default grace period in milliseconds (30 minutes).
|
|
10
|
-
* If a user interacted with a session within this window, it is not considered stale.
|
|
11
|
-
*/
|
|
12
|
-
export const DEFAULT_GRACE_PERIOD = 1800000; // 30 minutes
|
|
13
|
-
/**
|
|
14
|
-
* Determine whether a session should be considered stale based on its age,
|
|
15
|
-
* a configurable threshold, and an optional last-interaction timestamp.
|
|
16
|
-
*
|
|
17
|
-
* @param requestTimestamp - When the session was originally created (epoch ms)
|
|
18
|
-
* @param staleThreshold - Maximum allowed age before a session is stale (ms)
|
|
19
|
-
* @param lastInteraction - Last time the user interacted with this session (epoch ms)
|
|
20
|
-
* @param gracePeriod - Time after an interaction during which the session is not stale (ms)
|
|
21
|
-
* @returns true if the session is stale
|
|
22
|
-
*/
|
|
23
|
-
export function isSessionStale(requestTimestamp, staleThreshold, lastInteraction, gracePeriod = DEFAULT_GRACE_PERIOD) {
|
|
24
|
-
const now = Date.now();
|
|
25
|
-
// If the user interacted recently (within grace period), session is not stale
|
|
26
|
-
if (lastInteraction && now - lastInteraction < gracePeriod) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return now - requestTimestamp > staleThreshold;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Check whether a session has been explicitly marked as abandoned
|
|
33
|
-
* (e.g. AI disconnected).
|
|
34
|
-
*
|
|
35
|
-
* @param status - The session's current status string
|
|
36
|
-
* @returns true if status is "abandoned"
|
|
37
|
-
*/
|
|
38
|
-
export function isSessionAbandoned(status) {
|
|
39
|
-
return status === "abandoned";
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Build a human-readable toast message for a stale session.
|
|
43
|
-
*
|
|
44
|
-
* @param sessionTitle - Display name or ID of the session
|
|
45
|
-
* @param createdAtMs - Session creation time in epoch milliseconds
|
|
46
|
-
* @returns Formatted message string
|
|
47
|
-
*/
|
|
48
|
-
export function formatStaleToastMessage(sessionTitle, createdAtMs) {
|
|
49
|
-
const hoursAgo = Math.floor((Date.now() - createdAtMs) / 3600000);
|
|
50
|
-
return `Session "${sessionTitle}" may be orphaned (created ${hoursAgo}h ago)`;
|
|
51
|
-
}
|
|
1
|
+
export * from "../shared/utils/staleDetection.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auq-mcp-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"auq": "dist/bin/auq.js"
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
"generate:skill": "bun run scripts/generate-skill.ts",
|
|
29
29
|
"validate:skill": "bunx skills-ref validate skills/ask-user-questions",
|
|
30
30
|
"test": "vitest run",
|
|
31
|
-
"format": "prettier --write . && eslint --fix ."
|
|
31
|
+
"format": "prettier --write . && eslint --fix .",
|
|
32
|
+
"build:opentui": "tsc -p tsconfig.opentui.json --noEmit",
|
|
33
|
+
"test:opentui": "bun test src/tui-opentui",
|
|
34
|
+
"typecheck:all": "tsc --noEmit && tsc -p tsconfig.opentui.json --noEmit"
|
|
32
35
|
},
|
|
33
36
|
"keywords": [
|
|
34
37
|
"fastmcp",
|
|
@@ -50,6 +53,8 @@
|
|
|
50
53
|
"description": "An MCP server that provides a tool to ask a user questions via the terminal",
|
|
51
54
|
"dependencies": {
|
|
52
55
|
"@inkjs/ui": "^2.0.0",
|
|
56
|
+
"@opentui/core": "0.1.87",
|
|
57
|
+
"@opentui/react": "0.1.87",
|
|
53
58
|
"@modelcontextprotocol/sdk": "1.17.2",
|
|
54
59
|
"@types/uuid": "^10.0.0",
|
|
55
60
|
"chalk": "^5.6.2",
|