@orderful/droid 0.14.0 → 0.16.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 (204) hide show
  1. package/.claude/CLAUDE.md +31 -9
  2. package/CHANGELOG.md +35 -0
  3. package/dist/bin/droid.js +8 -8
  4. package/dist/bin/droid.js.map +1 -1
  5. package/dist/commands/config.js +1 -1
  6. package/dist/commands/config.js.map +1 -1
  7. package/dist/commands/install.js +3 -3
  8. package/dist/commands/install.js.map +1 -1
  9. package/dist/commands/setup.d.ts +1 -1
  10. package/dist/commands/setup.d.ts.map +1 -1
  11. package/dist/commands/setup.js +3 -3
  12. package/dist/commands/setup.js.map +1 -1
  13. package/dist/commands/skills.js +4 -4
  14. package/dist/commands/skills.js.map +1 -1
  15. package/dist/commands/tui/components/Badge.d.ts +13 -0
  16. package/dist/commands/tui/components/Badge.d.ts.map +1 -0
  17. package/dist/commands/tui/components/Badge.js +29 -0
  18. package/dist/commands/tui/components/Badge.js.map +1 -0
  19. package/dist/commands/tui/components/Markdown.d.ts +5 -0
  20. package/dist/commands/tui/components/Markdown.d.ts.map +1 -0
  21. package/dist/commands/tui/components/Markdown.js +42 -0
  22. package/dist/commands/tui/components/Markdown.js.map +1 -0
  23. package/dist/commands/tui/components/SettingsDetails.d.ts +5 -0
  24. package/dist/commands/tui/components/SettingsDetails.d.ts.map +1 -0
  25. package/dist/commands/tui/components/SettingsDetails.js +11 -0
  26. package/dist/commands/tui/components/SettingsDetails.js.map +1 -0
  27. package/dist/commands/tui/components/TabBar.d.ts +10 -0
  28. package/dist/commands/tui/components/TabBar.d.ts.map +1 -0
  29. package/dist/commands/tui/components/TabBar.js +7 -0
  30. package/dist/commands/tui/components/TabBar.js.map +1 -0
  31. package/dist/commands/tui/components/ToolDetails.d.ts +8 -0
  32. package/dist/commands/tui/components/ToolDetails.d.ts.map +1 -0
  33. package/dist/commands/tui/components/ToolDetails.js +35 -0
  34. package/dist/commands/tui/components/ToolDetails.js.map +1 -0
  35. package/dist/commands/tui/components/ToolItem.d.ts +9 -0
  36. package/dist/commands/tui/components/ToolItem.d.ts.map +1 -0
  37. package/dist/commands/tui/components/ToolItem.js +11 -0
  38. package/dist/commands/tui/components/ToolItem.js.map +1 -0
  39. package/dist/commands/tui/constants.d.ts +16 -0
  40. package/dist/commands/tui/constants.d.ts.map +1 -0
  41. package/dist/commands/tui/constants.js +17 -0
  42. package/dist/commands/tui/constants.js.map +1 -0
  43. package/dist/commands/tui/hooks/useAppUpdate.d.ts +13 -0
  44. package/dist/commands/tui/hooks/useAppUpdate.d.ts.map +1 -0
  45. package/dist/commands/tui/hooks/useAppUpdate.js +52 -0
  46. package/dist/commands/tui/hooks/useAppUpdate.js.map +1 -0
  47. package/dist/commands/tui/hooks/useToolUpdates.d.ts +22 -0
  48. package/dist/commands/tui/hooks/useToolUpdates.d.ts.map +1 -0
  49. package/dist/commands/tui/hooks/useToolUpdates.js +77 -0
  50. package/dist/commands/tui/hooks/useToolUpdates.js.map +1 -0
  51. package/dist/commands/tui/types.d.ts +5 -0
  52. package/dist/commands/tui/types.d.ts.map +1 -0
  53. package/dist/commands/tui/types.js +2 -0
  54. package/dist/commands/tui/types.js.map +1 -0
  55. package/dist/commands/tui/views/ReadmeViewer.d.ts +7 -0
  56. package/dist/commands/tui/views/ReadmeViewer.d.ts.map +1 -0
  57. package/dist/commands/tui/views/ReadmeViewer.js +56 -0
  58. package/dist/commands/tui/views/ReadmeViewer.js.map +1 -0
  59. package/dist/commands/tui/views/SetupScreen.d.ts +8 -0
  60. package/dist/commands/tui/views/SetupScreen.d.ts.map +1 -0
  61. package/dist/commands/tui/views/SetupScreen.js +114 -0
  62. package/dist/commands/tui/views/SetupScreen.js.map +1 -0
  63. package/dist/commands/tui/views/SkillConfigScreen.d.ts +8 -0
  64. package/dist/commands/tui/views/SkillConfigScreen.d.ts.map +1 -0
  65. package/dist/commands/tui/views/SkillConfigScreen.js +148 -0
  66. package/dist/commands/tui/views/SkillConfigScreen.js.map +1 -0
  67. package/dist/commands/tui/views/ToolExplorer.d.ts +8 -0
  68. package/dist/commands/tui/views/ToolExplorer.d.ts.map +1 -0
  69. package/dist/commands/tui/views/ToolExplorer.js +86 -0
  70. package/dist/commands/tui/views/ToolExplorer.js.map +1 -0
  71. package/dist/commands/tui/views/ToolUpdatePrompt.d.ts +10 -0
  72. package/dist/commands/tui/views/ToolUpdatePrompt.d.ts.map +1 -0
  73. package/dist/commands/tui/views/ToolUpdatePrompt.js +38 -0
  74. package/dist/commands/tui/views/ToolUpdatePrompt.js.map +1 -0
  75. package/dist/commands/tui/views/WelcomeScreen.d.ts +11 -0
  76. package/dist/commands/tui/views/WelcomeScreen.d.ts.map +1 -0
  77. package/dist/commands/tui/views/WelcomeScreen.js +46 -0
  78. package/dist/commands/tui/views/WelcomeScreen.js.map +1 -0
  79. package/dist/commands/tui.d.ts.map +1 -1
  80. package/dist/commands/tui.js +54 -756
  81. package/dist/commands/tui.js.map +1 -1
  82. package/dist/commands/uninstall.js +2 -2
  83. package/dist/commands/uninstall.js.map +1 -1
  84. package/dist/commands/update.js +1 -1
  85. package/dist/commands/update.js.map +1 -1
  86. package/dist/index.d.ts +4 -4
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +4 -4
  89. package/dist/index.js.map +1 -1
  90. package/dist/lib/agents.d.ts +7 -7
  91. package/dist/lib/agents.d.ts.map +1 -1
  92. package/dist/lib/agents.js +63 -41
  93. package/dist/lib/agents.js.map +1 -1
  94. package/dist/lib/config.d.ts +1 -1
  95. package/dist/lib/config.d.ts.map +1 -1
  96. package/dist/lib/config.js +1 -1
  97. package/dist/lib/config.js.map +1 -1
  98. package/dist/lib/platforms.d.ts +1 -1
  99. package/dist/lib/platforms.d.ts.map +1 -1
  100. package/dist/lib/platforms.js +1 -1
  101. package/dist/lib/platforms.js.map +1 -1
  102. package/dist/lib/skill-config.d.ts +1 -1
  103. package/dist/lib/skill-config.d.ts.map +1 -1
  104. package/dist/lib/skill-config.js +2 -2
  105. package/dist/lib/skill-config.js.map +1 -1
  106. package/dist/lib/skills.d.ts +2 -1
  107. package/dist/lib/skills.d.ts.map +1 -1
  108. package/dist/lib/skills.js +45 -12
  109. package/dist/lib/skills.js.map +1 -1
  110. package/dist/lib/tools.d.ts +1 -1
  111. package/dist/lib/tools.d.ts.map +1 -1
  112. package/dist/lib/tools.js +3 -3
  113. package/dist/lib/tools.js.map +1 -1
  114. package/dist/lib/types.d.ts +4 -0
  115. package/dist/lib/types.d.ts.map +1 -1
  116. package/dist/tools/README.md +79 -50
  117. package/dist/tools/brain/TOOL.yaml +1 -1
  118. package/dist/tools/brain/skills/brain/SKILL.md +1 -0
  119. package/dist/tools/brain/skills/brain-obsidian/SKILL.md +1 -0
  120. package/dist/tools/coach/TOOL.yaml +1 -1
  121. package/dist/tools/coach/skills/coach/SKILL.md +1 -0
  122. package/{src/tools/code-review/agents/edi-standards-reviewer/AGENT.md → dist/tools/code-review/agents/edi-standards-reviewer.md} +10 -0
  123. package/dist/tools/code-review/agents/{error-handling-reviewer/AGENT.md → error-handling-reviewer.md} +10 -0
  124. package/{src/tools/code-review/agents/test-coverage-analyzer/AGENT.md → dist/tools/code-review/agents/test-coverage-analyzer.md} +11 -0
  125. package/dist/tools/code-review/agents/{type-reviewer/AGENT.md → type-reviewer.md} +10 -0
  126. package/dist/tools/code-review/skills/code-review/SKILL.md +1 -0
  127. package/dist/tools/comments/TOOL.yaml +2 -2
  128. package/dist/tools/comments/skills/comments/SKILL.md +1 -0
  129. package/dist/tools/droid/skills/droid/SKILL.md +1 -0
  130. package/dist/tools/project/skills/project/SKILL.md +1 -0
  131. package/package.json +3 -3
  132. package/src/bin/droid.ts +8 -8
  133. package/src/commands/config.ts +1 -1
  134. package/src/commands/install.ts +3 -3
  135. package/src/commands/setup.test.ts +1 -1
  136. package/src/commands/setup.ts +3 -3
  137. package/src/commands/skills.ts +4 -4
  138. package/src/commands/tui/components/Badge.tsx +86 -0
  139. package/src/commands/tui/components/Markdown.tsx +48 -0
  140. package/src/commands/tui/components/SettingsDetails.tsx +70 -0
  141. package/src/commands/tui/components/TabBar.tsx +26 -0
  142. package/src/commands/tui/components/ToolDetails.tsx +117 -0
  143. package/src/commands/tui/components/ToolItem.tsx +39 -0
  144. package/src/commands/tui/constants.ts +17 -0
  145. package/src/commands/tui/hooks/useAppUpdate.ts +67 -0
  146. package/src/commands/tui/hooks/useToolUpdates.ts +110 -0
  147. package/src/commands/tui/types.ts +4 -0
  148. package/src/commands/tui/views/ReadmeViewer.tsx +93 -0
  149. package/src/commands/tui/views/SetupScreen.tsx +242 -0
  150. package/src/commands/tui/views/SkillConfigScreen.tsx +278 -0
  151. package/src/commands/tui/views/ToolExplorer.tsx +190 -0
  152. package/src/commands/tui/views/ToolUpdatePrompt.tsx +109 -0
  153. package/src/commands/tui/views/WelcomeScreen.tsx +149 -0
  154. package/src/commands/tui.tsx +65 -1588
  155. package/src/commands/uninstall.ts +2 -2
  156. package/src/commands/update.ts +1 -1
  157. package/src/index.ts +4 -4
  158. package/src/lib/agents.ts +68 -45
  159. package/src/lib/config.ts +1 -1
  160. package/src/lib/platforms.ts +1 -1
  161. package/src/lib/skill-config.ts +2 -2
  162. package/src/lib/skills.test.ts +28 -33
  163. package/src/lib/skills.ts +49 -12
  164. package/src/lib/tools.ts +3 -3
  165. package/src/lib/types.test.ts +1 -1
  166. package/src/lib/types.ts +5 -0
  167. package/src/lib/version.test.ts +1 -1
  168. package/src/tools/README.md +79 -50
  169. package/src/tools/brain/TOOL.yaml +1 -1
  170. package/src/tools/brain/skills/brain/SKILL.md +1 -0
  171. package/src/tools/brain/skills/brain-obsidian/SKILL.md +1 -0
  172. package/src/tools/coach/TOOL.yaml +1 -1
  173. package/src/tools/coach/skills/coach/SKILL.md +1 -0
  174. package/{dist/tools/code-review/agents/edi-standards-reviewer/AGENT.md → src/tools/code-review/agents/edi-standards-reviewer.md} +10 -0
  175. package/src/tools/code-review/agents/{error-handling-reviewer/AGENT.md → error-handling-reviewer.md} +10 -0
  176. package/{dist/tools/code-review/agents/test-coverage-analyzer/AGENT.md → src/tools/code-review/agents/test-coverage-analyzer.md} +11 -0
  177. package/src/tools/code-review/agents/{type-reviewer/AGENT.md → type-reviewer.md} +10 -0
  178. package/src/tools/code-review/skills/code-review/SKILL.md +1 -0
  179. package/src/tools/comments/TOOL.yaml +2 -2
  180. package/src/tools/comments/skills/comments/SKILL.md +1 -0
  181. package/src/tools/droid/skills/droid/SKILL.md +1 -0
  182. package/src/tools/project/skills/project/SKILL.md +1 -0
  183. package/dist/tools/brain/skills/brain/SKILL.yaml +0 -29
  184. package/dist/tools/brain/skills/brain-obsidian/SKILL.yaml +0 -42
  185. package/dist/tools/coach/skills/coach/SKILL.yaml +0 -25
  186. package/dist/tools/code-review/agents/edi-standards-reviewer/AGENT.yaml +0 -14
  187. package/dist/tools/code-review/agents/error-handling-reviewer/AGENT.yaml +0 -14
  188. package/dist/tools/code-review/agents/test-coverage-analyzer/AGENT.yaml +0 -14
  189. package/dist/tools/code-review/agents/type-reviewer/AGENT.yaml +0 -13
  190. package/dist/tools/code-review/skills/code-review/SKILL.yaml +0 -19
  191. package/dist/tools/comments/skills/comments/SKILL.yaml +0 -50
  192. package/dist/tools/droid/skills/droid/SKILL.yaml +0 -7
  193. package/dist/tools/project/skills/project/SKILL.yaml +0 -30
  194. package/src/tools/brain/skills/brain/SKILL.yaml +0 -29
  195. package/src/tools/brain/skills/brain-obsidian/SKILL.yaml +0 -42
  196. package/src/tools/coach/skills/coach/SKILL.yaml +0 -25
  197. package/src/tools/code-review/agents/edi-standards-reviewer/AGENT.yaml +0 -14
  198. package/src/tools/code-review/agents/error-handling-reviewer/AGENT.yaml +0 -14
  199. package/src/tools/code-review/agents/test-coverage-analyzer/AGENT.yaml +0 -14
  200. package/src/tools/code-review/agents/type-reviewer/AGENT.yaml +0 -13
  201. package/src/tools/code-review/skills/code-review/SKILL.yaml +0 -19
  202. package/src/tools/comments/skills/comments/SKILL.yaml +0 -50
  203. package/src/tools/droid/skills/droid/SKILL.yaml +0 -7
  204. package/src/tools/project/skills/project/SKILL.yaml +0 -30
@@ -0,0 +1,17 @@
1
+ export const colors = {
2
+ primary: '#6366f1',
3
+ bgSelected: '#2d2d2d',
4
+ border: '#3a3a3a',
5
+ text: '#e8e8e8',
6
+ textMuted: '#999999',
7
+ textDim: '#6a6a6a',
8
+ success: '#4ade80',
9
+ error: '#f87171',
10
+ // Component type badges
11
+ skill: '#ec4899', // pink/magenta
12
+ command: '#22d3ee', // cyan
13
+ agent: '#fbbf24', // yellow/amber
14
+ };
15
+ export const MAX_VISIBLE_ITEMS = 6;
16
+ export const MAX_VISIBLE_CONFIG_ITEMS = 4; // Each config item takes ~3 lines
17
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/commands/tui/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,wBAAwB;IACxB,KAAK,EAAE,SAAS,EAAM,eAAe;IACrC,OAAO,EAAE,SAAS,EAAI,OAAO;IAC7B,KAAK,EAAE,SAAS,EAAM,eAAe;CAC7B,CAAC;AAEX,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AACnC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,CAAC,kCAAkC"}
@@ -0,0 +1,13 @@
1
+ import { type UpdateInfo } from '../../../lib/version';
2
+ export interface UseAppUpdateOptions {
3
+ onUpdateSuccess: (message: string) => void;
4
+ onUpdateFailure: (error: string) => void;
5
+ }
6
+ export interface UseAppUpdateResult {
7
+ updateInfo: UpdateInfo;
8
+ isUpdating: boolean;
9
+ handleUpdate: () => void;
10
+ handleAlwaysUpdate: () => void;
11
+ }
12
+ export declare function useAppUpdate({ onUpdateSuccess, onUpdateFailure }: UseAppUpdateOptions): UseAppUpdateResult;
13
+ //# sourceMappingURL=useAppUpdate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAppUpdate.d.ts","sourceRoot":"","sources":["../../../../src/commands/tui/hooks/useAppUpdate.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGjF,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,wBAAgB,YAAY,CAAC,EAAE,eAAe,EAAE,eAAe,EAAE,EAAE,mBAAmB,GAAG,kBAAkB,CAiD1G"}
@@ -0,0 +1,52 @@
1
+ import { useState, useMemo } from 'react';
2
+ import { useApp } from 'ink';
3
+ import { getUpdateInfo, runUpdate } from '../../../lib/version';
4
+ import { setAutoUpdateConfig } from '../../../lib/config';
5
+ export function useAppUpdate({ onUpdateSuccess, onUpdateFailure }) {
6
+ const { exit } = useApp();
7
+ const [isUpdating, setIsUpdating] = useState(false);
8
+ const updateInfo = useMemo(() => getUpdateInfo(), []);
9
+ const handleUpdate = () => {
10
+ setIsUpdating(true);
11
+ // Run update in next tick to allow UI to show "Updating..."
12
+ setTimeout(() => {
13
+ const result = runUpdate();
14
+ if (result.success) {
15
+ // Build exit message with ANSI colors
16
+ const blue = '\x1b[38;2;99;102;241m'; // #6366f1
17
+ const dim = '\x1b[38;2;106;106;106m';
18
+ const reset = '\x1b[0m';
19
+ const message = `
20
+ ${dim}────────────────────────────────────────────────────────${reset}
21
+
22
+ ${dim}╔═════╗${reset}
23
+ ${dim}║${reset} ${blue}●${reset} ${blue}●${reset} ${dim}║${reset} ${blue}"It's quite possible this system${reset}
24
+ ${dim}╚═╦═╦═╝${reset} ${blue}is now fully operational."${reset}
25
+
26
+ Run ${blue}droid${reset} to start the new version.
27
+
28
+ ${dim}────────────────────────────────────────────────────────${reset}
29
+ `;
30
+ onUpdateSuccess(message);
31
+ exit();
32
+ }
33
+ else {
34
+ setIsUpdating(false);
35
+ onUpdateFailure(result.message);
36
+ }
37
+ }, 100);
38
+ };
39
+ const handleAlwaysUpdate = () => {
40
+ // Enable auto-update for app in config
41
+ setAutoUpdateConfig({ app: true });
42
+ // Then run the update
43
+ handleUpdate();
44
+ };
45
+ return {
46
+ updateInfo,
47
+ isUpdating,
48
+ handleUpdate,
49
+ handleAlwaysUpdate,
50
+ };
51
+ }
52
+ //# sourceMappingURL=useAppUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAppUpdate.js","sourceRoot":"","sources":["../../../../src/commands/tui/hooks/useAppUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,SAAS,EAAmB,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAc1D,MAAM,UAAU,YAAY,CAAC,EAAE,eAAe,EAAE,eAAe,EAAuB;IACpF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAA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ToolUpdateInfo } from '../../../lib/tools';
2
+ export interface UseToolUpdatesOptions {
3
+ onUpdateComplete: (result: {
4
+ successCount: number;
5
+ failCount: number;
6
+ updatedNames: string[];
7
+ silent: boolean;
8
+ }) => void;
9
+ }
10
+ export interface UseToolUpdatesResult {
11
+ toolUpdates: ToolUpdateInfo[];
12
+ isUpdatingTools: boolean;
13
+ autoUpdatedTools: string[];
14
+ checkForUpdates: () => {
15
+ updates: ToolUpdateInfo[];
16
+ shouldAutoUpdate: boolean;
17
+ };
18
+ updateAllTools: (updates?: ToolUpdateInfo[], silent?: boolean) => void;
19
+ enableAutoUpdateAndUpdate: () => void;
20
+ }
21
+ export declare function useToolUpdates({ onUpdateComplete }: UseToolUpdatesOptions): UseToolUpdatesResult;
22
+ //# sourceMappingURL=useToolUpdates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToolUpdates.d.ts","sourceRoot":"","sources":["../../../../src/commands/tui/hooks/useToolUpdates.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CAC1H;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM;QAAE,OAAO,EAAE,cAAc,EAAE,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAA;KAAE,CAAC;IAChF,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvE,yBAAyB,EAAE,MAAM,IAAI,CAAC;CACvC;AAED,wBAAgB,cAAc,CAAC,EAAE,gBAAgB,EAAE,EAAE,qBAAqB,GAAG,oBAAoB,CAoFhG"}
@@ -0,0 +1,77 @@
1
+ import { useState, useCallback } from 'react';
2
+ import { getBundledTools, isToolInstalled, getToolUpdateStatus, getToolsWithUpdates, } from '../../../lib/tools';
3
+ import { installSkill, updateSkill } from '../../../lib/skills';
4
+ import { getAutoUpdateConfig, setAutoUpdateConfig } from '../../../lib/config';
5
+ export function useToolUpdates({ onUpdateComplete }) {
6
+ const [toolUpdates, setToolUpdates] = useState([]);
7
+ const [isUpdatingTools, setIsUpdatingTools] = useState(false);
8
+ const [autoUpdatedTools, setAutoUpdatedTools] = useState([]);
9
+ const tools = getBundledTools();
10
+ // Ensure system tools are installed/updated (bypasses auto-update settings)
11
+ const ensureSystemTools = useCallback(() => {
12
+ const systemTools = tools.filter(t => t.system === true);
13
+ for (const systemTool of systemTools) {
14
+ const installed = isToolInstalled(systemTool.name);
15
+ const updateStatus = getToolUpdateStatus(systemTool.name);
16
+ if (!installed || updateStatus.hasUpdate) {
17
+ const primarySkill = systemTool.includes.skills.find(s => s.required)?.name || systemTool.name;
18
+ installSkill(primarySkill);
19
+ }
20
+ }
21
+ }, [tools]);
22
+ // Check for updates, returns info for caller to decide what to do
23
+ const checkForUpdates = useCallback(() => {
24
+ ensureSystemTools();
25
+ const updates = getToolsWithUpdates();
26
+ setToolUpdates(updates);
27
+ const autoUpdateConfig = getAutoUpdateConfig();
28
+ return {
29
+ updates,
30
+ shouldAutoUpdate: autoUpdateConfig.tools && updates.length > 0,
31
+ };
32
+ }, [ensureSystemTools]);
33
+ // Update all tools
34
+ const updateAllTools = useCallback((updates = toolUpdates, silent = false) => {
35
+ if (!silent) {
36
+ setIsUpdatingTools(true);
37
+ }
38
+ setTimeout(() => {
39
+ let successCount = 0;
40
+ let failCount = 0;
41
+ const updatedNames = [];
42
+ for (const tool of updates) {
43
+ const toolManifest = tools.find(t => t.name === tool.name);
44
+ if (toolManifest) {
45
+ const primarySkill = toolManifest.includes.skills.find(s => s.required)?.name || toolManifest.name;
46
+ const result = updateSkill(primarySkill);
47
+ if (result.success) {
48
+ successCount++;
49
+ updatedNames.push(tool.name);
50
+ }
51
+ else {
52
+ failCount++;
53
+ }
54
+ }
55
+ }
56
+ setIsUpdatingTools(false);
57
+ if (silent && updatedNames.length > 0) {
58
+ setAutoUpdatedTools(updatedNames);
59
+ }
60
+ onUpdateComplete({ successCount, failCount, updatedNames, silent });
61
+ }, 100);
62
+ }, [toolUpdates, tools, onUpdateComplete]);
63
+ // Enable auto-update and run updates
64
+ const enableAutoUpdateAndUpdate = useCallback(() => {
65
+ setAutoUpdateConfig({ tools: true });
66
+ updateAllTools();
67
+ }, [updateAllTools]);
68
+ return {
69
+ toolUpdates,
70
+ isUpdatingTools,
71
+ autoUpdatedTools,
72
+ checkForUpdates,
73
+ updateAllTools,
74
+ enableAutoUpdateAndUpdate,
75
+ };
76
+ }
77
+ //# sourceMappingURL=useToolUpdates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToolUpdates.js","sourceRoot":"","sources":["../../../../src/commands/tui/hooks/useToolUpdates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAgB/E,MAAM,UAAU,cAAc,CAAC,EAAE,gBAAgB,EAAyB;IACxE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAmB,EAAE,CAAC,CAAC;IACrE,MAAM,CAAC,eAAe,EAAE,kBAAk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,CAAC,CAAC;QACtE,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE3C,qCAAqC;IACrC,MAAM,yBAAyB,GAAG,WAAW,CAAC,GAAG,EAAE;QACjD,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrC,cAAc,EAAE,CAAC;IACnB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO;QACL,WAAW;QACX,eAAe;QACf,gBAAgB;QAChB,eAAe;QACf,cAAc;QACd,yBAAyB;KAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type Tab = 'tools' | 'settings';
2
+ export type View = 'welcome' | 'tool-updates' | 'setup' | 'menu' | 'detail' | 'configure' | 'readme' | 'explorer';
3
+ export type SetupStep = 'platform' | 'user_mention' | 'auto_update' | 'confirm';
4
+ export type ComponentType = 'skill' | 'command' | 'agent';
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/tui/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;AACvC,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAClH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,CAAC;AAChF,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/tui/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export interface ReadmeViewerProps {
2
+ title: string;
3
+ content: string;
4
+ onClose: () => void;
5
+ }
6
+ export declare function ReadmeViewer({ title, content, onClose }: ReadmeViewerProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=ReadmeViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadmeViewer.d.ts","sourceRoot":"","sources":["../../../../src/commands/tui/views/ReadmeViewer.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,iBAAiB,2CAiF1E"}
@@ -0,0 +1,56 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useInput } from 'ink';
3
+ import { useState, useMemo } from 'react';
4
+ import { colors } from '../constants';
5
+ import { MarkdownLine } from '../components/Markdown';
6
+ export function ReadmeViewer({ title, content, onClose }) {
7
+ const [scrollOffset, setScrollOffset] = useState(0);
8
+ const lines = useMemo(() => content.split('\n'), [content]);
9
+ const maxVisible = 20;
10
+ // Pre-compute code block state for each line
11
+ const lineStates = useMemo(() => {
12
+ const states = [];
13
+ let inCode = false;
14
+ for (const line of lines) {
15
+ if (line.startsWith('```')) {
16
+ states.push(false); // Delimiter itself is not "in" code block for styling
17
+ inCode = !inCode;
18
+ }
19
+ else {
20
+ states.push(inCode);
21
+ }
22
+ }
23
+ return states;
24
+ }, [lines]);
25
+ // Max offset: when at end, we have top indicator + (maxVisible-1) content lines
26
+ // So max offset is lines.length - (maxVisible - 1) = lines.length - maxVisible + 1
27
+ const maxOffset = Math.max(0, lines.length - maxVisible + 1);
28
+ useInput((input, key) => {
29
+ if (key.escape) {
30
+ onClose();
31
+ return;
32
+ }
33
+ if (key.upArrow) {
34
+ setScrollOffset((prev) => Math.max(0, prev - 1));
35
+ }
36
+ if (key.downArrow) {
37
+ setScrollOffset((prev) => Math.min(maxOffset, prev + 1));
38
+ }
39
+ if (key.pageDown || input === ' ') {
40
+ setScrollOffset((prev) => Math.min(maxOffset, prev + maxVisible));
41
+ }
42
+ if (key.pageUp) {
43
+ setScrollOffset((prev) => Math.max(0, prev - maxVisible));
44
+ }
45
+ });
46
+ // Adjust visible lines based on whether indicators are shown
47
+ const showTopIndicator = scrollOffset > 0;
48
+ // Reserve space for bottom indicator if not at end
49
+ const contentLines = maxVisible - (showTopIndicator ? 1 : 0);
50
+ const endIndex = Math.min(scrollOffset + contentLines, lines.length);
51
+ const showBottomIndicator = endIndex < lines.length;
52
+ const actualContentLines = contentLines - (showBottomIndicator ? 1 : 0);
53
+ const visibleLines = lines.slice(scrollOffset, scrollOffset + actualContentLines);
54
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: colors.text, bold: true, children: title }), _jsxs(Text, { color: colors.textDim, children: [" \u00B7 ", lines.length, " lines"] })] }), _jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: colors.border, paddingX: 1, children: [showTopIndicator && (_jsxs(Text, { color: colors.textDim, children: ["\u2191 ", scrollOffset, " more lines"] })), visibleLines.map((line, i) => (_jsx(MarkdownLine, { line: line, inCodeBlock: lineStates[scrollOffset + i] }, scrollOffset + i))), showBottomIndicator && (_jsxs(Text, { color: colors.textDim, children: ["\u2193 ", lines.length - scrollOffset - actualContentLines, " more lines"] }))] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.textDim, children: "\u2191\u2193 scroll \u00B7 space/pgdn page \u00B7 esc back" }) })] }));
55
+ }
56
+ //# sourceMappingURL=ReadmeViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadmeViewer.js","sourceRoot":"","sources":["../../../../src/commands/tui/views/ReadmeViewer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ACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type DroidConfig } from '../../../lib/types';
2
+ export interface SetupScreenProps {
3
+ onComplete: () => void;
4
+ onSkip: () => void;
5
+ initialConfig?: DroidConfig;
6
+ }
7
+ export declare function SetupScreen({ onComplete, onSkip, initialConfig }: SetupScreenProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=SetupScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetupScreen.d.ts","sourceRoot":"","sources":["../../../../src/commands/tui/views/SetupScreen.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAI/E,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,aAAa,CAAC,EAAE,WAAW,CAAC;CAC7B;AAOD,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,gBAAgB,2CA6NlF"}
@@ -0,0 +1,114 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useInput } from 'ink';
3
+ import TextInput from 'ink-text-input';
4
+ import { useState } from 'react';
5
+ import { colors } from '../constants';
6
+ import { Platform, BuiltInOutput } from '../../../lib/types';
7
+ import { loadConfig, saveConfig, getAutoUpdateConfig, setAutoUpdateConfig } from '../../../lib/config';
8
+ import { configurePlatformPermissions } from '../../setup';
9
+ const platformOptions = [
10
+ { label: 'Claude Code', value: Platform.ClaudeCode },
11
+ { label: 'OpenCode', value: Platform.OpenCode },
12
+ ];
13
+ export function SetupScreen({ onComplete, onSkip, initialConfig }) {
14
+ const [step, setStep] = useState('platform');
15
+ const [platform, setPlatform] = useState(initialConfig?.platform || Platform.ClaudeCode);
16
+ const [userMention, setUserMention] = useState(initialConfig?.user_mention || '@user');
17
+ const [selectedIndex, setSelectedIndex] = useState(0);
18
+ const [error, setError] = useState(null);
19
+ // Auto-update state
20
+ const existingAutoUpdate = getAutoUpdateConfig();
21
+ const [autoUpdateTools, setAutoUpdateTools] = useState(existingAutoUpdate.tools);
22
+ const [autoUpdateApp, setAutoUpdateApp] = useState(existingAutoUpdate.app);
23
+ const [autoUpdateSelectedIndex, setAutoUpdateSelectedIndex] = useState(0);
24
+ const steps = ['platform', 'user_mention', 'auto_update', 'confirm'];
25
+ const stepIndex = steps.indexOf(step);
26
+ const totalSteps = steps.length - 1; // Don't count confirm as a step
27
+ const handleUserMentionSubmit = () => {
28
+ // Auto-add @ prefix if missing
29
+ const mention = userMention.startsWith('@') ? userMention : `@${userMention}`;
30
+ setUserMention(mention);
31
+ setError(null);
32
+ setStep('auto_update');
33
+ setAutoUpdateSelectedIndex(0);
34
+ };
35
+ // Handle escape during text input (only intercept escape, nothing else)
36
+ useInput((input, key) => {
37
+ if (key.escape) {
38
+ setStep('platform');
39
+ setSelectedIndex(0);
40
+ }
41
+ }, { isActive: step === 'user_mention' });
42
+ // Handle all input for non-text-input steps
43
+ useInput((input, key) => {
44
+ if (key.escape) {
45
+ if (step === 'platform') {
46
+ onSkip();
47
+ }
48
+ else if (step === 'auto_update') {
49
+ setStep('user_mention');
50
+ }
51
+ else if (step === 'confirm') {
52
+ setStep('auto_update');
53
+ setAutoUpdateSelectedIndex(0);
54
+ }
55
+ return;
56
+ }
57
+ if (step === 'platform') {
58
+ if (key.upArrow)
59
+ setSelectedIndex((prev) => Math.max(0, prev - 1));
60
+ if (key.downArrow)
61
+ setSelectedIndex((prev) => Math.min(platformOptions.length - 1, prev + 1));
62
+ if (key.return) {
63
+ setPlatform(platformOptions[selectedIndex].value);
64
+ setStep('user_mention');
65
+ }
66
+ }
67
+ else if (step === 'auto_update') {
68
+ // 0 = auto-update tools, 1 = auto-update app, 2 = next button
69
+ if (key.upArrow)
70
+ setAutoUpdateSelectedIndex((prev) => Math.max(0, prev - 1));
71
+ if (key.downArrow)
72
+ setAutoUpdateSelectedIndex((prev) => Math.min(2, prev + 1));
73
+ if (key.return) {
74
+ if (autoUpdateSelectedIndex === 0) {
75
+ setAutoUpdateTools(!autoUpdateTools);
76
+ }
77
+ else if (autoUpdateSelectedIndex === 1) {
78
+ setAutoUpdateApp(!autoUpdateApp);
79
+ }
80
+ else {
81
+ setStep('confirm');
82
+ }
83
+ }
84
+ }
85
+ else if (step === 'confirm') {
86
+ if (key.return) {
87
+ const existingConfig = loadConfig();
88
+ const config = {
89
+ ...existingConfig,
90
+ platform: platform,
91
+ user_mention: userMention,
92
+ output_preference: BuiltInOutput.Terminal, // Default to terminal
93
+ };
94
+ saveConfig(config);
95
+ setAutoUpdateConfig({ tools: autoUpdateTools, app: autoUpdateApp });
96
+ configurePlatformPermissions(platform);
97
+ onComplete();
98
+ }
99
+ }
100
+ }, { isActive: step !== 'user_mention' });
101
+ const renderHeader = () => (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsxs(Text, { children: [_jsx(Text, { color: colors.textDim, children: "[" }), _jsx(Text, { color: colors.primary, children: "\u25CF" }), _jsx(Text, { color: colors.textDim, children: " " }), _jsx(Text, { color: colors.primary, children: "\u25CF" }), _jsx(Text, { color: colors.textDim, children: "] " }), _jsx(Text, { color: colors.text, bold: true, children: "droid setup" }), _jsxs(Text, { color: colors.textDim, children: [" \u00B7 Step ", Math.min(stepIndex + 1, totalSteps), " of ", totalSteps] })] }) }));
102
+ if (step === 'platform') {
103
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [renderHeader(), _jsx(Text, { color: colors.text, children: "Which platform are you using?" }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: platformOptions.map((option, index) => (_jsxs(Text, { children: [_jsxs(Text, { color: colors.textDim, children: [index === selectedIndex ? '>' : ' ', " "] }), _jsx(Text, { color: index === selectedIndex ? colors.text : colors.textMuted, children: option.label })] }, option.value))) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.textDim, children: "\u2191\u2193 select \u00B7 enter next \u00B7 esc skip" }) })] }));
104
+ }
105
+ if (step === 'user_mention') {
106
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [renderHeader(), _jsx(Text, { color: colors.text, children: "What @mention should be used for you?" }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: colors.textDim, children: '> ' }), _jsx(TextInput, { value: userMention, onChange: setUserMention, onSubmit: handleUserMentionSubmit, placeholder: "@user" })] }), error && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.error, children: error }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.textDim, children: "enter next \u00B7 esc back" }) })] }));
107
+ }
108
+ if (step === 'auto_update') {
109
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [renderHeader(), _jsx(Text, { color: colors.text, children: "Configure auto-update behaviour" }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Box, { children: _jsxs(Text, { children: [_jsxs(Text, { color: colors.textDim, children: [autoUpdateSelectedIndex === 0 ? '>' : ' ', " "] }), _jsxs(Text, { color: autoUpdateSelectedIndex === 0 ? colors.text : colors.textMuted, children: ["[", autoUpdateTools ? 'x' : ' ', "] Auto-update tools"] })] }) }), _jsx(Text, { color: colors.textDim, children: " Update tools automatically when droid starts" }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: colors.textDim, children: [autoUpdateSelectedIndex === 1 ? '>' : ' ', " "] }), _jsxs(Text, { color: autoUpdateSelectedIndex === 1 ? colors.text : colors.textMuted, children: ["[", autoUpdateApp ? 'x' : ' ', "] Auto-update app"] })] }) }), _jsx(Text, { color: colors.textDim, children: " Update droid automatically when a new version is available" })] }), _jsx(Box, { marginTop: 2, children: _jsxs(Text, { backgroundColor: autoUpdateSelectedIndex === 2 ? colors.primary : colors.bgSelected, color: autoUpdateSelectedIndex === 2 ? '#ffffff' : colors.textMuted, bold: autoUpdateSelectedIndex === 2, children: [' ', "Next", ' '] }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.textDim, children: "\u2191\u2193 select \u00B7 enter toggle/next \u00B7 esc back" }) })] }));
110
+ }
111
+ // Confirm step
112
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [renderHeader(), _jsx(Text, { color: colors.text, bold: true, children: "Review your settings" }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { children: [_jsx(Text, { color: colors.textDim, children: "Platform: " }), _jsx(Text, { color: colors.text, children: platform === Platform.ClaudeCode ? 'Claude Code' : 'OpenCode' })] }), _jsxs(Text, { children: [_jsx(Text, { color: colors.textDim, children: "Your @mention: " }), _jsx(Text, { color: colors.text, children: userMention })] }), _jsxs(Text, { children: [_jsx(Text, { color: colors.textDim, children: "Auto-update tools: " }), _jsx(Text, { color: colors.text, children: autoUpdateTools ? 'enabled' : 'disabled' })] }), _jsxs(Text, { children: [_jsx(Text, { color: colors.textDim, children: "Auto-update app: " }), _jsx(Text, { color: colors.text, children: autoUpdateApp ? 'enabled' : 'disabled' })] })] }), _jsx(Box, { marginTop: 2, children: _jsxs(Text, { backgroundColor: colors.primary, color: "#ffffff", bold: true, children: [' ', "Save", ' '] }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.textDim, children: "enter save \u00B7 esc back" }) })] }));
113
+ }
114
+ //# sourceMappingURL=SetupScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetupScreen.js","sourceRoot":"","sources":["../../../../src/commands/tui/views/SetupScreen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAoB,MAAM,oBAAoB,CAAC;AAC/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AAa,CAAC,CAAC,CAAC,UAAU,GAAQ,IAC3F,EACP,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,oCAA4B,EACvD,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,YAAG,WAAW,GAAQ,IACzC,EACP,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,oCAA4B,EACvD,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,YAAG,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,GAAQ,IACtE,EACP,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,oCAA4B,EACvD,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,YAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,GAAQ,IACpE,IACH,EACN,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,MAAC,IAAI,IAAC,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAC,SAAS,EAAC,IAAI,mBACxD,GAAG,UAAM,GAAG,IACR,GACH,EACN,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,2CAA8B,GACrD,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type SkillManifest } from '../../../lib/types';
2
+ export interface SkillConfigScreenProps {
3
+ skill: SkillManifest;
4
+ onComplete: () => void;
5
+ onCancel: () => void;
6
+ }
7
+ export declare function SkillConfigScreen({ skill, onComplete, onCancel }: SkillConfigScreenProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=SkillConfigScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillConfigScreen.d.ts","sourceRoot":"","sources":["../../../../src/commands/tui/views/SkillConfigScreen.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,aAAa,EAAuB,MAAM,oBAAoB,CAAC;AAG/F,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,sBAAsB,2CAwQxF"}
@@ -0,0 +1,148 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useInput } from 'ink';
3
+ import TextInput from 'ink-text-input';
4
+ import { useState, useMemo } from 'react';
5
+ import { loadSkillOverrides, saveSkillOverrides } from '../../../lib/config';
6
+ import { ConfigOptionType } from '../../../lib/types';
7
+ import { colors, MAX_VISIBLE_CONFIG_ITEMS } from '../constants';
8
+ export function SkillConfigScreen({ skill, onComplete, onCancel }) {
9
+ const configSchema = skill.config_schema || {};
10
+ const configKeys = Object.keys(configSchema);
11
+ const initialOverrides = useMemo(() => loadSkillOverrides(skill.name), [skill.name]);
12
+ // Initialize values from saved overrides or defaults
13
+ const [values, setValues] = useState(() => {
14
+ const initial = {};
15
+ for (const key of configKeys) {
16
+ const option = configSchema[key];
17
+ initial[key] = initialOverrides[key] ?? option.default ?? (option.type === ConfigOptionType.Boolean ? false : '');
18
+ }
19
+ return initial;
20
+ });
21
+ const [selectedIndex, setSelectedIndex] = useState(0);
22
+ const [scrollOffset, setScrollOffset] = useState(0);
23
+ const [editingField, setEditingField] = useState(null);
24
+ const [editValue, setEditValue] = useState('');
25
+ const [editingSelect, setEditingSelect] = useState(null);
26
+ const [selectOptionIndex, setSelectOptionIndex] = useState(0);
27
+ // Total items = config keys + Save button
28
+ const totalItems = configKeys.length + 1;
29
+ const handleSave = () => {
30
+ saveSkillOverrides(skill.name, values);
31
+ onComplete();
32
+ };
33
+ const handleSubmitEdit = () => {
34
+ if (editingField) {
35
+ setValues((prev) => ({ ...prev, [editingField]: editValue }));
36
+ setEditingField(null);
37
+ setEditValue('');
38
+ }
39
+ };
40
+ // Handle text input for string fields
41
+ useInput((input, key) => {
42
+ if (key.escape) {
43
+ setEditingField(null);
44
+ setEditValue('');
45
+ }
46
+ }, { isActive: editingField !== null });
47
+ // Handle select field editing
48
+ useInput((input, key) => {
49
+ if (!editingSelect)
50
+ return;
51
+ const option = configSchema[editingSelect];
52
+ if (!option?.options)
53
+ return;
54
+ if (key.escape) {
55
+ setEditingSelect(null);
56
+ return;
57
+ }
58
+ if (key.leftArrow || key.upArrow) {
59
+ setSelectOptionIndex((prev) => Math.max(0, prev - 1));
60
+ }
61
+ if (key.rightArrow || key.downArrow) {
62
+ setSelectOptionIndex((prev) => Math.min(option.options.length - 1, prev + 1));
63
+ }
64
+ if (key.return) {
65
+ setValues((prev) => ({ ...prev, [editingSelect]: option.options[selectOptionIndex] }));
66
+ setEditingSelect(null);
67
+ }
68
+ }, { isActive: editingSelect !== null });
69
+ // Handle navigation and actions when not editing
70
+ useInput((input, key) => {
71
+ if (key.escape) {
72
+ onCancel();
73
+ return;
74
+ }
75
+ if (key.upArrow) {
76
+ setSelectedIndex((prev) => {
77
+ const newIndex = Math.max(0, prev - 1);
78
+ // Scroll up if needed
79
+ if (newIndex < scrollOffset) {
80
+ setScrollOffset(newIndex);
81
+ }
82
+ return newIndex;
83
+ });
84
+ }
85
+ if (key.downArrow) {
86
+ // +1 for the Save button at the end
87
+ setSelectedIndex((prev) => {
88
+ const newIndex = Math.min(totalItems - 1, prev + 1);
89
+ // Scroll down if needed
90
+ if (newIndex >= scrollOffset + MAX_VISIBLE_CONFIG_ITEMS) {
91
+ setScrollOffset(newIndex - MAX_VISIBLE_CONFIG_ITEMS + 1);
92
+ }
93
+ return newIndex;
94
+ });
95
+ }
96
+ if (key.return) {
97
+ // Save button is at index === configKeys.length
98
+ if (selectedIndex === configKeys.length) {
99
+ handleSave();
100
+ return;
101
+ }
102
+ const key = configKeys[selectedIndex];
103
+ const option = configSchema[key];
104
+ if (option.type === ConfigOptionType.Boolean) {
105
+ // Toggle boolean
106
+ setValues((prev) => ({ ...prev, [key]: !prev[key] }));
107
+ }
108
+ else if (option.type === ConfigOptionType.Select && option.options) {
109
+ // Enter select edit mode
110
+ const currentValue = String(values[key] || option.options[0]);
111
+ const currentIndex = option.options.indexOf(currentValue);
112
+ setSelectOptionIndex(currentIndex >= 0 ? currentIndex : 0);
113
+ setEditingSelect(key);
114
+ }
115
+ else if (option.type === ConfigOptionType.String) {
116
+ // Enter edit mode for string
117
+ setEditingField(key);
118
+ setEditValue(String(values[key] || ''));
119
+ }
120
+ }
121
+ }, { isActive: editingField === null && editingSelect === null });
122
+ if (configKeys.length === 0) {
123
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: [_jsx(Text, { color: colors.textDim, children: "[" }), _jsx(Text, { color: colors.primary, children: "\u25CF" }), _jsx(Text, { color: colors.textDim, children: " " }), _jsx(Text, { color: colors.primary, children: "\u25CF" }), _jsx(Text, { color: colors.textDim, children: "] " }), _jsxs(Text, { color: colors.text, bold: true, children: ["configure ", skill.name] })] }) }), _jsx(Text, { color: colors.textMuted, children: "This skill has no configuration options." }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.textDim, children: "esc to go back" }) })] }));
124
+ }
125
+ // Calculate visible range
126
+ const visibleEndIndex = Math.min(scrollOffset + MAX_VISIBLE_CONFIG_ITEMS, totalItems);
127
+ const visibleConfigKeys = configKeys.slice(scrollOffset, Math.min(scrollOffset + MAX_VISIBLE_CONFIG_ITEMS, configKeys.length));
128
+ const showSaveButton = visibleEndIndex > configKeys.length || scrollOffset + MAX_VISIBLE_CONFIG_ITEMS > configKeys.length;
129
+ const showTopIndicator = scrollOffset > 0;
130
+ const showBottomIndicator = scrollOffset + MAX_VISIBLE_CONFIG_ITEMS < totalItems;
131
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: [_jsx(Text, { color: colors.textDim, children: "[" }), _jsx(Text, { color: colors.primary, children: "\u25CF" }), _jsx(Text, { color: colors.textDim, children: " " }), _jsx(Text, { color: colors.primary, children: "\u25CF" }), _jsx(Text, { color: colors.textDim, children: "] " }), _jsxs(Text, { color: colors.text, bold: true, children: ["configure ", skill.name] })] }) }), _jsxs(Box, { flexDirection: "column", children: [showTopIndicator && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: colors.textDim, children: [" \u2191 ", scrollOffset, " more"] }) })), visibleConfigKeys.map((configKey) => {
132
+ const actualIndex = configKeys.indexOf(configKey);
133
+ const option = configSchema[configKey];
134
+ const isSelected = selectedIndex === actualIndex;
135
+ const isEditing = editingField === configKey;
136
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { children: [_jsxs(Text, { color: colors.textDim, children: [isSelected ? '>' : ' ', " "] }), _jsx(Text, { color: isSelected ? colors.text : colors.textMuted, children: configKey })] }), _jsxs(Text, { color: colors.textDim, children: [" ", option.description] }), _jsxs(Box, { children: [_jsx(Text, { color: colors.textDim, children: " " }), option.type === ConfigOptionType.Boolean ? (_jsxs(Text, { color: colors.text, children: ["[", values[configKey] ? 'x' : ' ', "] ", values[configKey] ? 'enabled' : 'disabled'] })) : option.type === ConfigOptionType.Select && option.options ? (_jsx(Text, { color: colors.text, children: option.options.map((opt, i) => {
137
+ const isCurrentValue = String(values[configKey]) === opt;
138
+ const isEditingThis = editingSelect === configKey;
139
+ const isHighlighted = isEditingThis && selectOptionIndex === i;
140
+ return (_jsxs(Text, { children: [i > 0 && _jsx(Text, { color: colors.textDim, children: " \u00B7 " }), _jsx(Text, { color: isHighlighted ? '#ffffff' : isCurrentValue ? colors.primary : colors.textMuted, backgroundColor: isHighlighted ? colors.primary : undefined, children: isCurrentValue && !isEditingThis ? `[${opt}]` : isHighlighted ? ` ${opt} ` : opt })] }, opt));
141
+ }) })) : isEditing ? (_jsxs(Box, { children: [_jsx(Text, { color: colors.textDim, children: '> ' }), _jsx(TextInput, { value: editValue, onChange: setEditValue, onSubmit: handleSubmitEdit })] })) : (_jsx(Text, { color: colors.text, children: String(values[configKey]) || '(not set)' }))] })] }, configKey));
142
+ }), showSaveButton && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: colors.textDim, children: [selectedIndex === configKeys.length ? '>' : ' ', " "] }), _jsxs(Text, { backgroundColor: selectedIndex === configKeys.length ? colors.primary : undefined, color: selectedIndex === configKeys.length ? '#ffffff' : colors.textMuted, bold: selectedIndex === configKeys.length, children: [' ', "Save", ' '] })] }) })), showBottomIndicator && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: colors.textDim, children: [" \u2193 ", totalItems - scrollOffset - MAX_VISIBLE_CONFIG_ITEMS, " more"] }) }))] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.textDim, children: editingField
143
+ ? 'enter save · esc cancel'
144
+ : editingSelect
145
+ ? '←→ choose · enter select · esc cancel'
146
+ : '↑↓ select · enter toggle/edit · esc back' }) })] }));
147
+ }
148
+ //# sourceMappingURL=SkillConfigScreen.js.map