chatroom-cli 1.0.54 → 1.0.64

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 (108) hide show
  1. package/README.md +35 -27
  2. package/dist/index.js +12728 -339
  3. package/package.json +11 -10
  4. package/dist/api.d.ts +0 -11
  5. package/dist/api.d.ts.map +0 -1
  6. package/dist/api.js +0 -12
  7. package/dist/api.js.map +0 -1
  8. package/dist/commands/auth-login.d.ts +0 -10
  9. package/dist/commands/auth-login.d.ts.map +0 -1
  10. package/dist/commands/auth-login.js +0 -179
  11. package/dist/commands/auth-login.js.map +0 -1
  12. package/dist/commands/auth-logout.d.ts +0 -6
  13. package/dist/commands/auth-logout.d.ts.map +0 -1
  14. package/dist/commands/auth-logout.js +0 -21
  15. package/dist/commands/auth-logout.js.map +0 -1
  16. package/dist/commands/auth-status.d.ts +0 -6
  17. package/dist/commands/auth-status.d.ts.map +0 -1
  18. package/dist/commands/auth-status.js +0 -50
  19. package/dist/commands/auth-status.js.map +0 -1
  20. package/dist/commands/backlog.d.ts +0 -36
  21. package/dist/commands/backlog.d.ts.map +0 -1
  22. package/dist/commands/backlog.js +0 -310
  23. package/dist/commands/backlog.js.map +0 -1
  24. package/dist/commands/feature.d.ts +0 -14
  25. package/dist/commands/feature.d.ts.map +0 -1
  26. package/dist/commands/feature.js +0 -172
  27. package/dist/commands/feature.js.map +0 -1
  28. package/dist/commands/guidelines.d.ts +0 -17
  29. package/dist/commands/guidelines.d.ts.map +0 -1
  30. package/dist/commands/guidelines.js +0 -71
  31. package/dist/commands/guidelines.js.map +0 -1
  32. package/dist/commands/handoff.d.ts +0 -20
  33. package/dist/commands/handoff.d.ts.map +0 -1
  34. package/dist/commands/handoff.js +0 -83
  35. package/dist/commands/handoff.js.map +0 -1
  36. package/dist/commands/init.d.ts +0 -9
  37. package/dist/commands/init.d.ts.map +0 -1
  38. package/dist/commands/init.js +0 -23
  39. package/dist/commands/init.js.map +0 -1
  40. package/dist/commands/messages.d.ts +0 -24
  41. package/dist/commands/messages.d.ts.map +0 -1
  42. package/dist/commands/messages.js +0 -149
  43. package/dist/commands/messages.js.map +0 -1
  44. package/dist/commands/opencode-install.d.ts +0 -29
  45. package/dist/commands/opencode-install.d.ts.map +0 -1
  46. package/dist/commands/opencode-install.js +0 -416
  47. package/dist/commands/opencode-install.js.map +0 -1
  48. package/dist/commands/task-started.d.ts +0 -13
  49. package/dist/commands/task-started.d.ts.map +0 -1
  50. package/dist/commands/task-started.js +0 -107
  51. package/dist/commands/task-started.js.map +0 -1
  52. package/dist/commands/update.d.ts +0 -6
  53. package/dist/commands/update.d.ts.map +0 -1
  54. package/dist/commands/update.js +0 -78
  55. package/dist/commands/update.js.map +0 -1
  56. package/dist/commands/wait-for-task.d.ts +0 -18
  57. package/dist/commands/wait-for-task.d.ts.map +0 -1
  58. package/dist/commands/wait-for-task.js +0 -306
  59. package/dist/commands/wait-for-task.js.map +0 -1
  60. package/dist/config/defaults.d.ts +0 -12
  61. package/dist/config/defaults.d.ts.map +0 -1
  62. package/dist/config/defaults.js +0 -70
  63. package/dist/config/defaults.js.map +0 -1
  64. package/dist/config/loader.d.ts +0 -52
  65. package/dist/config/loader.d.ts.map +0 -1
  66. package/dist/config/loader.js +0 -202
  67. package/dist/config/loader.js.map +0 -1
  68. package/dist/config/schema.d.ts +0 -52
  69. package/dist/config/schema.d.ts.map +0 -1
  70. package/dist/config/schema.js +0 -99
  71. package/dist/config/schema.js.map +0 -1
  72. package/dist/config.d.ts +0 -20
  73. package/dist/config.d.ts.map +0 -1
  74. package/dist/config.js +0 -20
  75. package/dist/config.js.map +0 -1
  76. package/dist/convex-api/api.d.ts +0 -137
  77. package/dist/convex-api/api.js +0 -23
  78. package/dist/convex-api/index.d.ts +0 -102
  79. package/dist/convex-api/index.d.ts.map +0 -1
  80. package/dist/convex-api/index.js +0 -11
  81. package/dist/convex-api/index.js.map +0 -1
  82. package/dist/index.d.ts +0 -9
  83. package/dist/index.d.ts.map +0 -1
  84. package/dist/index.js.map +0 -1
  85. package/dist/infrastructure/auth/middleware.d.ts +0 -20
  86. package/dist/infrastructure/auth/middleware.d.ts.map +0 -1
  87. package/dist/infrastructure/auth/middleware.js +0 -96
  88. package/dist/infrastructure/auth/middleware.js.map +0 -1
  89. package/dist/infrastructure/auth/storage.d.ts +0 -58
  90. package/dist/infrastructure/auth/storage.d.ts.map +0 -1
  91. package/dist/infrastructure/auth/storage.js +0 -242
  92. package/dist/infrastructure/auth/storage.js.map +0 -1
  93. package/dist/infrastructure/convex/client.d.ts +0 -16
  94. package/dist/infrastructure/convex/client.d.ts.map +0 -1
  95. package/dist/infrastructure/convex/client.js +0 -40
  96. package/dist/infrastructure/convex/client.js.map +0 -1
  97. package/dist/infrastructure/history/storage.d.ts +0 -21
  98. package/dist/infrastructure/history/storage.d.ts.map +0 -1
  99. package/dist/infrastructure/history/storage.js +0 -56
  100. package/dist/infrastructure/history/storage.js.map +0 -1
  101. package/dist/utils/file-content.d.ts +0 -29
  102. package/dist/utils/file-content.d.ts.map +0 -1
  103. package/dist/utils/file-content.js +0 -51
  104. package/dist/utils/file-content.js.map +0 -1
  105. package/dist/version.d.ts +0 -14
  106. package/dist/version.d.ts.map +0 -1
  107. package/dist/version.js +0 -43
  108. package/dist/version.js.map +0 -1
@@ -1,40 +0,0 @@
1
- import { ConvexHttpClient } from 'convex/browser';
2
- /**
3
- * The default Convex URL for the chatroom cloud service.
4
- * Can be overridden with the CHATROOM_CONVEX_URL environment variable.
5
- */
6
- const DEFAULT_CONVEX_URL = 'https://chatroom-cloud.duskfare.com';
7
- /**
8
- * Get the Convex URL, checking for environment variable override.
9
- */
10
- export function getConvexUrl() {
11
- return process.env.CHATROOM_CONVEX_URL || DEFAULT_CONVEX_URL;
12
- }
13
- // For backwards compatibility - use getConvexUrl() instead
14
- export const CONVEX_URL = DEFAULT_CONVEX_URL;
15
- let client = null;
16
- let cachedUrl = null;
17
- /**
18
- * Get a singleton Convex HTTP client instance.
19
- * The client is lazily initialized on first use.
20
- */
21
- export async function getConvexClient() {
22
- const url = getConvexUrl();
23
- // Reset client if URL has changed
24
- if (client && cachedUrl !== url) {
25
- client = null;
26
- }
27
- if (!client) {
28
- cachedUrl = url;
29
- client = new ConvexHttpClient(url);
30
- }
31
- return client;
32
- }
33
- /**
34
- * Reset the client (useful for testing or reconnection)
35
- */
36
- export function resetConvexClient() {
37
- client = null;
38
- cachedUrl = null;
39
- }
40
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/infrastructure/convex/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,MAAM,kBAAkB,GAAG,qCAAqC,CAAC;AAEjE;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,kBAAkB,CAAC;AAC/D,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAE7C,IAAI,MAAM,GAA4B,IAAI,CAAC;AAC3C,IAAI,SAAS,GAAkB,IAAI,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,GAAG,GAAG,YAAY,EAAE,CAAC;IAE3B,kCAAkC;IAClC,IAAI,MAAM,IAAI,SAAS,KAAK,GAAG,EAAE,CAAC;QAChC,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,SAAS,GAAG,GAAG,CAAC;QAChB,MAAM,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,IAAI,CAAC;IACd,SAAS,GAAG,IAAI,CAAC;AACnB,CAAC"}
@@ -1,21 +0,0 @@
1
- interface ChatroomHistoryEntry {
2
- chatroomId: string;
3
- teamId: string;
4
- teamName: string;
5
- teamRoles: string[];
6
- createdAt: string;
7
- }
8
- /**
9
- * Load the chatroom history
10
- */
11
- export declare function listChatroomHistory(): Promise<ChatroomHistoryEntry[]>;
12
- /**
13
- * Save a chatroom to the history
14
- */
15
- export declare function saveChatroomHistory(entry: ChatroomHistoryEntry): Promise<void>;
16
- /**
17
- * Get the most recent chatroom from history
18
- */
19
- export declare function getMostRecentChatroom(): Promise<ChatroomHistoryEntry | null>;
20
- export {};
21
- //# sourceMappingURL=storage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/history/storage.ts"],"names":[],"mappings":"AAOA,UAAU,oBAAoB;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAkBD;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAc3E;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAWpF;AAED;;GAEG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAGlF"}
@@ -1,56 +0,0 @@
1
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
- import { homedir } from 'node:os';
3
- import { join } from 'node:path';
4
- const HISTORY_DIR = join(homedir(), '.chatroom', 'history');
5
- const HISTORY_FILE = 'chatrooms.json';
6
- /**
7
- * Ensure the history directory exists
8
- */
9
- function ensureHistoryDir() {
10
- if (!existsSync(HISTORY_DIR)) {
11
- mkdirSync(HISTORY_DIR, { recursive: true });
12
- }
13
- }
14
- /**
15
- * Get the path to the history file
16
- */
17
- function getHistoryPath() {
18
- return join(HISTORY_DIR, HISTORY_FILE);
19
- }
20
- /**
21
- * Load the chatroom history
22
- */
23
- export async function listChatroomHistory() {
24
- const historyPath = getHistoryPath();
25
- if (!existsSync(historyPath)) {
26
- return [];
27
- }
28
- try {
29
- const content = readFileSync(historyPath, 'utf-8');
30
- return JSON.parse(content);
31
- }
32
- catch {
33
- console.warn('Warning: Could not read chatroom history');
34
- return [];
35
- }
36
- }
37
- /**
38
- * Save a chatroom to the history
39
- */
40
- export async function saveChatroomHistory(entry) {
41
- ensureHistoryDir();
42
- const history = await listChatroomHistory();
43
- history.unshift(entry); // Add to beginning
44
- // Keep only the last 100 entries
45
- const trimmedHistory = history.slice(0, 100);
46
- const historyPath = getHistoryPath();
47
- writeFileSync(historyPath, JSON.stringify(trimmedHistory, null, 2), 'utf-8');
48
- }
49
- /**
50
- * Get the most recent chatroom from history
51
- */
52
- export async function getMostRecentChatroom() {
53
- const history = await listChatroomHistory();
54
- return history.length > 0 ? history[0] : null;
55
- }
56
- //# sourceMappingURL=storage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/infrastructure/history/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC5D,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAUtC;;GAEG;AACH,SAAS,gBAAgB;IACvB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,cAAc;IACrB,OAAO,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAA2B,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAA2B;IACnE,gBAAgB,EAAE,CAAC;IAEnB,MAAM,OAAO,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAC5C,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB;IAE3C,iCAAiC;IACjC,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAE7C,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAC/E,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,MAAM,OAAO,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAC5C,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC"}
@@ -1,29 +0,0 @@
1
- /**
2
- * Utility for reading content from files for CLI commands.
3
- *
4
- * All content-heavy CLI options (--message-file, --description-file, etc.)
5
- * use file-based input to avoid complex escape sequences in bash commands.
6
- * This makes the CLI more accessible to AI models that struggle with escaping.
7
- */
8
- /**
9
- * Read content from a file.
10
- *
11
- * @param filePath - Path to file containing content (relative or absolute)
12
- * @param optionName - Name of the option (for error messages, e.g., 'message-file')
13
- * @returns The file content as a string
14
- * @throws Error if file cannot be read
15
- *
16
- * @example
17
- * const msg = readFileContent('/tmp/message.md', 'message-file');
18
- *
19
- * @example
20
- * // Relative paths are resolved from CWD
21
- * const msg = readFileContent('./handoff.md', 'message-file');
22
- */
23
- export declare function readFileContent(filePath: string, optionName: string): string;
24
- /**
25
- * @deprecated Use readFileContent instead. This function is kept for backward compatibility.
26
- * Resolves content from either a direct string or a file path.
27
- */
28
- export declare function resolveContent(content: string | undefined, filePath: string | undefined, optionName: string): string | undefined;
29
- //# sourceMappingURL=file-content.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-content.d.ts","sourceRoot":"","sources":["../../src/utils/file-content.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAU5E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAapB"}
@@ -1,51 +0,0 @@
1
- /**
2
- * Utility for reading content from files for CLI commands.
3
- *
4
- * All content-heavy CLI options (--message-file, --description-file, etc.)
5
- * use file-based input to avoid complex escape sequences in bash commands.
6
- * This makes the CLI more accessible to AI models that struggle with escaping.
7
- */
8
- import { readFileSync } from 'fs';
9
- import { resolve } from 'path';
10
- /**
11
- * Read content from a file.
12
- *
13
- * @param filePath - Path to file containing content (relative or absolute)
14
- * @param optionName - Name of the option (for error messages, e.g., 'message-file')
15
- * @returns The file content as a string
16
- * @throws Error if file cannot be read
17
- *
18
- * @example
19
- * const msg = readFileContent('/tmp/message.md', 'message-file');
20
- *
21
- * @example
22
- * // Relative paths are resolved from CWD
23
- * const msg = readFileContent('./handoff.md', 'message-file');
24
- */
25
- export function readFileContent(filePath, optionName) {
26
- const absolutePath = resolve(process.cwd(), filePath);
27
- try {
28
- return readFileSync(absolutePath, 'utf-8');
29
- }
30
- catch (err) {
31
- const nodeErr = err;
32
- throw new Error(`Cannot read file for --${optionName}: ${absolutePath}\n` + `Reason: ${nodeErr.message}`);
33
- }
34
- }
35
- /**
36
- * @deprecated Use readFileContent instead. This function is kept for backward compatibility.
37
- * Resolves content from either a direct string or a file path.
38
- */
39
- export function resolveContent(content, filePath, optionName) {
40
- // Both provided - error
41
- if (content && filePath) {
42
- throw new Error(`Cannot specify both --${optionName} and --${optionName}-file`);
43
- }
44
- // File path provided - read from file
45
- if (filePath) {
46
- return readFileContent(filePath, `${optionName}-file`);
47
- }
48
- // Direct content or undefined
49
- return content;
50
- }
51
- //# sourceMappingURL=file-content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-content.js","sourceRoot":"","sources":["../../src/utils/file-content.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,UAAkB;IAClE,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;IACtD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAA4B,CAAC;QAC7C,MAAM,IAAI,KAAK,CACb,0BAA0B,UAAU,KAAK,YAAY,IAAI,GAAG,WAAW,OAAO,CAAC,OAAO,EAAE,CACzF,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA2B,EAC3B,QAA4B,EAC5B,UAAkB;IAElB,wBAAwB;IACxB,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,yBAAyB,UAAU,UAAU,UAAU,OAAO,CAAC,CAAC;IAClF,CAAC;IAED,sCAAsC;IACtC,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,eAAe,CAAC,QAAQ,EAAE,GAAG,UAAU,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,8BAA8B;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/dist/version.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * CLI Version Utility
3
- *
4
- * Reads the version from package.json to ensure consistency
5
- * between the CLI output and the published package version.
6
- */
7
- /**
8
- * Get the CLI version from package.json
9
- *
10
- * This function reads the version at runtime from the package.json file.
11
- * It handles both development (source) and production (dist) paths.
12
- */
13
- export declare function getVersion(): string;
14
- //# sourceMappingURL=version.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,MAAM,CA2BnC"}
package/dist/version.js DELETED
@@ -1,43 +0,0 @@
1
- /**
2
- * CLI Version Utility
3
- *
4
- * Reads the version from package.json to ensure consistency
5
- * between the CLI output and the published package version.
6
- */
7
- import { readFileSync } from 'node:fs';
8
- import { dirname, join } from 'node:path';
9
- import { fileURLToPath } from 'node:url';
10
- /**
11
- * Get the CLI version from package.json
12
- *
13
- * This function reads the version at runtime from the package.json file.
14
- * It handles both development (source) and production (dist) paths.
15
- */
16
- export function getVersion() {
17
- try {
18
- // Get the directory of this file
19
- const __filename = fileURLToPath(import.meta.url);
20
- const __dirname = dirname(__filename);
21
- // Try to find package.json - could be in parent dir (from src/) or two levels up (from dist/)
22
- const possiblePaths = [
23
- join(__dirname, '..', 'package.json'), // From src/version.ts -> package.json
24
- join(__dirname, '..', '..', 'package.json'), // From dist/version.js -> package.json
25
- ];
26
- for (const packagePath of possiblePaths) {
27
- try {
28
- const packageJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
29
- if (packageJson.version) {
30
- return packageJson.version;
31
- }
32
- }
33
- catch {
34
- // Try next path
35
- }
36
- }
37
- return 'unknown';
38
- }
39
- catch {
40
- return 'unknown';
41
- }
42
- }
43
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,CAAC;QACH,iCAAiC;QACjC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QAEtC,8FAA8F;QAC9F,MAAM,aAAa,GAAG;YACpB,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,sCAAsC;YAC7E,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,uCAAuC;SACrF,CAAC;QAEF,KAAK,MAAM,WAAW,IAAI,aAAa,EAAE,CAAC;YACxC,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;gBACnE,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;oBACxB,OAAO,WAAW,CAAC,OAAO,CAAC;gBAC7B,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,gBAAgB;YAClB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}