@within-7/minto 0.3.9 → 0.3.10

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 (141) hide show
  1. package/dist/commands/agents/AgentsCommand.js +459 -655
  2. package/dist/commands/agents/AgentsCommand.js.map +2 -2
  3. package/dist/commands/agents/types.js +1 -0
  4. package/dist/commands/agents/types.js.map +2 -2
  5. package/dist/commands/agents/utils/fileOperations.js +96 -36
  6. package/dist/commands/agents/utils/fileOperations.js.map +3 -3
  7. package/dist/commands/agents/utils/index.js +3 -1
  8. package/dist/commands/agents/utils/index.js.map +2 -2
  9. package/dist/commands/context.js +54 -23
  10. package/dist/commands/context.js.map +2 -2
  11. package/dist/commands/export.js +673 -93
  12. package/dist/commands/export.js.map +2 -2
  13. package/dist/commands/language.js +19 -46
  14. package/dist/commands/language.js.map +2 -2
  15. package/dist/commands/mcp-interactive.js +419 -217
  16. package/dist/commands/mcp-interactive.js.map +2 -2
  17. package/dist/commands/model.js +415 -66
  18. package/dist/commands/model.js.map +2 -2
  19. package/dist/commands/permissions.js +75 -49
  20. package/dist/commands/permissions.js.map +2 -2
  21. package/dist/commands/plugin.js +882 -185
  22. package/dist/commands/plugin.js.map +3 -3
  23. package/dist/commands/resume.js +1 -1
  24. package/dist/commands/resume.js.map +1 -1
  25. package/dist/commands/sandbox.js +168 -70
  26. package/dist/commands/sandbox.js.map +2 -2
  27. package/dist/commands/setup.js +593 -107
  28. package/dist/commands/setup.js.map +2 -2
  29. package/dist/commands/stats.js +188 -131
  30. package/dist/commands/stats.js.map +2 -2
  31. package/dist/commands/status.js +75 -13
  32. package/dist/commands/status.js.map +2 -2
  33. package/dist/commands/undo.js +138 -174
  34. package/dist/commands/undo.js.map +2 -2
  35. package/dist/commands.js.map +1 -1
  36. package/dist/components/Help.js +165 -32
  37. package/dist/components/Help.js.map +2 -2
  38. package/dist/components/InfoPanel/InfoPanel.js +123 -0
  39. package/dist/components/InfoPanel/InfoPanel.js.map +7 -0
  40. package/dist/components/InfoPanel/index.js +5 -0
  41. package/dist/components/InfoPanel/index.js.map +7 -0
  42. package/dist/components/InfoPanel/types.js +1 -0
  43. package/dist/components/InfoPanel/types.js.map +7 -0
  44. package/dist/components/ModelSelector/BrandTextInput.js +43 -0
  45. package/dist/components/ModelSelector/BrandTextInput.js.map +7 -0
  46. package/dist/components/ModelSelector/ModelSelector.js +419 -501
  47. package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
  48. package/dist/components/ModelSelector/WizardContainer.js +45 -0
  49. package/dist/components/ModelSelector/WizardContainer.js.map +7 -0
  50. package/dist/components/ModelSelector/index.js +1 -3
  51. package/dist/components/ModelSelector/index.js.map +2 -2
  52. package/dist/components/PromptInput.js +5 -5
  53. package/dist/components/PromptInput.js.map +2 -2
  54. package/dist/components/SimpleSelector/SimpleSelector.js +154 -0
  55. package/dist/components/SimpleSelector/SimpleSelector.js.map +7 -0
  56. package/dist/components/SimpleSelector/index.js +5 -0
  57. package/dist/components/SimpleSelector/index.js.map +7 -0
  58. package/dist/components/SimpleSelector/types.js +1 -0
  59. package/dist/components/SimpleSelector/types.js.map +7 -0
  60. package/dist/components/StatusOverlayContent.js +21 -0
  61. package/dist/components/StatusOverlayContent.js.map +7 -0
  62. package/dist/components/TabbedListView/ScrollableList.js +31 -5
  63. package/dist/components/TabbedListView/ScrollableList.js.map +2 -2
  64. package/dist/components/TabbedListView/TabbedListView.js +122 -47
  65. package/dist/components/TabbedListView/TabbedListView.js.map +2 -2
  66. package/dist/core/backupHook.js +29 -0
  67. package/dist/core/backupHook.js.map +7 -0
  68. package/dist/core/config/defaults.js +8 -2
  69. package/dist/core/config/defaults.js.map +2 -2
  70. package/dist/core/config/schema.js +14 -2
  71. package/dist/core/config/schema.js.map +2 -2
  72. package/dist/core/costTracker.js +0 -16
  73. package/dist/core/costTracker.js.map +2 -2
  74. package/dist/cost-tracker.js +0 -16
  75. package/dist/cost-tracker.js.map +2 -2
  76. package/dist/entrypoints/bootstrap.js +3 -1
  77. package/dist/entrypoints/bootstrap.js.map +2 -2
  78. package/dist/entrypoints/cli.js +32 -0
  79. package/dist/entrypoints/cli.js.map +2 -2
  80. package/dist/i18n/locales/en.js +300 -1
  81. package/dist/i18n/locales/en.js.map +2 -2
  82. package/dist/i18n/locales/zh-CN.js +301 -2
  83. package/dist/i18n/locales/zh-CN.js.map +2 -2
  84. package/dist/i18n/types.js.map +1 -1
  85. package/dist/services/customCommands.js +30 -8
  86. package/dist/services/customCommands.js.map +2 -2
  87. package/dist/services/plugins/lspServers.js +1 -1
  88. package/dist/services/plugins/lspServers.js.map +2 -2
  89. package/dist/services/plugins/pluginRuntime.js +2 -1
  90. package/dist/services/plugins/pluginRuntime.js.map +2 -2
  91. package/dist/services/plugins/pluginValidation.js +10 -3
  92. package/dist/services/plugins/pluginValidation.js.map +2 -2
  93. package/dist/services/plugins/skillMarketplace.js +16 -8
  94. package/dist/services/plugins/skillMarketplace.js.map +2 -2
  95. package/dist/services/systemReminder.js +17 -6
  96. package/dist/services/systemReminder.js.map +2 -2
  97. package/dist/tools/FileEditTool/FileEditTool.js +7 -0
  98. package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
  99. package/dist/tools/FileWriteTool/FileWriteTool.js +7 -0
  100. package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
  101. package/dist/tools/MultiEditTool/MultiEditTool.js +7 -0
  102. package/dist/tools/MultiEditTool/MultiEditTool.js.map +2 -2
  103. package/dist/tools/NotebookEditTool/NotebookEditTool.js +2 -0
  104. package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
  105. package/dist/tools/TaskTool/TaskTool.js +9 -6
  106. package/dist/tools/TaskTool/TaskTool.js.map +2 -2
  107. package/dist/types/PermissionMode.js.map +1 -1
  108. package/dist/types/plugin.js +2 -4
  109. package/dist/types/plugin.js.map +2 -2
  110. package/dist/utils/agentHookExecutor.js +1 -4
  111. package/dist/utils/agentHookExecutor.js.map +2 -2
  112. package/dist/utils/agentLoader.js +67 -13
  113. package/dist/utils/agentLoader.js.map +2 -2
  114. package/dist/utils/agentMemory.js.map +2 -2
  115. package/dist/utils/claudeCodeSync.js +439 -0
  116. package/dist/utils/claudeCodeSync.js.map +7 -0
  117. package/dist/utils/config.js +1 -23
  118. package/dist/utils/config.js.map +2 -2
  119. package/dist/utils/execFileNoThrow.js +2 -1
  120. package/dist/utils/execFileNoThrow.js.map +2 -2
  121. package/dist/utils/marketplaceManager.js +80 -43
  122. package/dist/utils/marketplaceManager.js.map +2 -2
  123. package/dist/utils/messages.js +2 -2
  124. package/dist/utils/messages.js.map +2 -2
  125. package/dist/utils/pluginInstaller.js +34 -24
  126. package/dist/utils/pluginInstaller.js.map +2 -2
  127. package/dist/utils/pluginLoader.js +48 -25
  128. package/dist/utils/pluginLoader.js.map +2 -2
  129. package/dist/utils/repoFetcher.js +110 -0
  130. package/dist/utils/repoFetcher.js.map +7 -0
  131. package/dist/utils/skillLoader.js +18 -6
  132. package/dist/utils/skillLoader.js.map +2 -2
  133. package/dist/utils/stringSubstitution.js +4 -5
  134. package/dist/utils/stringSubstitution.js.map +2 -2
  135. package/dist/utils/teamConfig.js +153 -13
  136. package/dist/utils/teamConfig.js.map +2 -2
  137. package/dist/utils/terminal.js +1 -1
  138. package/dist/utils/terminal.js.map +2 -2
  139. package/dist/version.js +2 -2
  140. package/dist/version.js.map +1 -1
  141. package/package.json +6 -6
@@ -1,43 +1,176 @@
1
+ import React from "react";
2
+ import { hasCustomCommands } from "../services/customCommands.js";
1
3
  import { PRODUCT_COMMAND, PRODUCT_NAME } from "../constants/product.js";
2
- import {
3
- hasCustomCommands
4
- } from "../services/customCommands.js";
5
- import * as React from "react";
6
- import { Box, Text, useInput } from "ink";
7
- import { getTheme } from "../utils/theme.js";
8
- import { PressEnterToContinue } from "./PressEnterToContinue.js";
9
4
  import { MACRO } from "../constants/macros.js";
5
+ import { SEMANTIC_COLORS } from "../constants/colors.js";
6
+ import { InfoPanel } from "./InfoPanel/index.js";
10
7
  import { t } from "../i18n/index.js";
8
+ function buildUsageSection() {
9
+ return {
10
+ title: t("help.usageModes"),
11
+ items: [
12
+ { label: "REPL", value: `${PRODUCT_COMMAND} (interactive session)` },
13
+ {
14
+ label: t("help.nonInteractive"),
15
+ value: `${PRODUCT_COMMAND} -p "question"`
16
+ },
17
+ {
18
+ label: t("help.options"),
19
+ value: t("help.runForOptions", { command: PRODUCT_COMMAND }),
20
+ valueColor: SEMANTIC_COLORS.dim
21
+ }
22
+ ]
23
+ };
24
+ }
25
+ function buildCommonTasksSection() {
26
+ return {
27
+ title: t("help.commonTasks"),
28
+ items: [
29
+ {
30
+ label: "\u2022 Ask questions",
31
+ value: "How does foo.py work?",
32
+ valueColor: SEMANTIC_COLORS.dim
33
+ },
34
+ {
35
+ label: "\u2022 Edit files",
36
+ value: "Update bar.ts to...",
37
+ valueColor: SEMANTIC_COLORS.dim
38
+ },
39
+ {
40
+ label: "\u2022 Fix errors",
41
+ value: "cargo build",
42
+ valueColor: SEMANTIC_COLORS.dim
43
+ },
44
+ {
45
+ label: "\u2022 Run commands",
46
+ value: "/help",
47
+ valueColor: SEMANTIC_COLORS.dim
48
+ },
49
+ {
50
+ label: "\u2022 Run bash",
51
+ value: "!ls",
52
+ valueColor: SEMANTIC_COLORS.dim
53
+ }
54
+ ]
55
+ };
56
+ }
57
+ function buildModeSystemsSection() {
58
+ return {
59
+ title: t("help.modeSystems"),
60
+ items: [
61
+ {
62
+ label: "",
63
+ value: t("help.safetyModes"),
64
+ valueColor: SEMANTIC_COLORS.secondary
65
+ },
66
+ { label: " --yolo", value: "Skip all confirmations" },
67
+ { label: " --smart", value: "Dangerous tools require confirmation" },
68
+ { label: " --strict", value: "All tools require confirmation" },
69
+ { label: " --free", value: "Free mode (no restrictions)" },
70
+ {
71
+ label: "",
72
+ value: t("help.permissionModes"),
73
+ valueColor: SEMANTIC_COLORS.secondary
74
+ },
75
+ { label: " default", value: "Standard confirmation flow" },
76
+ { label: " acceptEdits", value: "Auto-approve file edits" },
77
+ { label: " plan", value: "Plan mode (no modifications)" },
78
+ { label: " bypass", value: "Skip all permission checks" }
79
+ ]
80
+ };
81
+ }
82
+ function buildBuiltInSection(commands) {
83
+ const builtInCommands = commands.filter(
84
+ (cmd) => !cmd.isHidden && !cmd.name.startsWith("project:") && !cmd.name.startsWith("user:") && !cmd.name.startsWith("plugin:") && !cmd.name.startsWith("mcp:")
85
+ ).sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()));
86
+ const items = builtInCommands.map((cmd) => ({
87
+ label: `/${cmd.name}`,
88
+ value: cmd.description
89
+ }));
90
+ return { title: t("help.builtInCommands"), items };
91
+ }
92
+ function buildCustomSection(commands) {
93
+ const customCommands = commands.filter(
94
+ (cmd) => !cmd.isHidden && (cmd.name.startsWith("project:") || cmd.name.startsWith("user:"))
95
+ ).sort(
96
+ (a, b) => a.userFacingName().localeCompare(b.userFacingName())
97
+ );
98
+ if (customCommands.length === 0) return null;
99
+ const items = customCommands.map((cmd) => ({
100
+ label: `/${cmd.name}`,
101
+ value: `${cmd.description}${cmd.scope ? ` [${cmd.scope}]` : ""}`
102
+ }));
103
+ return { title: t("help.customCommands"), items };
104
+ }
105
+ function buildPluginSection(commands) {
106
+ const pluginCommands = commands.filter((cmd) => !cmd.isHidden && cmd.name.startsWith("plugin:")).sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()));
107
+ if (pluginCommands.length === 0) return null;
108
+ const items = pluginCommands.map((cmd) => ({
109
+ label: `/${cmd.name}`,
110
+ value: cmd.description
111
+ }));
112
+ return { title: t("help.pluginCommands"), items };
113
+ }
114
+ function buildMcpSection(commands) {
115
+ const mcpCommands = commands.filter((cmd) => !cmd.isHidden && cmd.name.startsWith("mcp:")).sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()));
116
+ if (mcpCommands.length === 0) return null;
117
+ const items = mcpCommands.map((cmd) => ({
118
+ label: `/${cmd.name}`,
119
+ value: cmd.description
120
+ }));
121
+ return { title: t("help.mcpCommands"), items };
122
+ }
123
+ function buildPrioritySection() {
124
+ return {
125
+ title: t("help.commandPriority"),
126
+ items: [
127
+ {
128
+ label: "1.",
129
+ value: "Built-in commands",
130
+ valueColor: SEMANTIC_COLORS.dim
131
+ },
132
+ {
133
+ label: "2.",
134
+ value: "Custom commands (project: / user:)",
135
+ valueColor: SEMANTIC_COLORS.dim
136
+ },
137
+ {
138
+ label: "3.",
139
+ value: "Plugin commands",
140
+ valueColor: SEMANTIC_COLORS.dim
141
+ },
142
+ { label: "4.", value: "MCP commands", valueColor: SEMANTIC_COLORS.dim }
143
+ ]
144
+ };
145
+ }
11
146
  function Help({
12
147
  commands,
13
148
  onClose
14
149
  }) {
15
- const theme = getTheme();
16
- const moreHelp = `Learn more at: ${MACRO.README_URL}`;
17
- const filteredCommands = commands.filter((cmd) => !cmd.isHidden);
18
- const builtInCommands = filteredCommands.filter(
19
- (cmd) => !cmd.name.startsWith("project:") && !cmd.name.startsWith("user:") && !cmd.name.startsWith("plugin:") && !cmd.name.startsWith("mcp:")
20
- ).sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()));
21
- const customCommands = filteredCommands.filter(
22
- (cmd) => cmd.name.startsWith("project:") || cmd.name.startsWith("user:")
23
- ).sort(
24
- (a, b) => a.userFacingName().localeCompare(b.userFacingName())
150
+ const sections = [];
151
+ sections.push(buildUsageSection());
152
+ sections.push(buildCommonTasksSection());
153
+ sections.push(buildModeSystemsSection());
154
+ sections.push(buildBuiltInSection(commands));
155
+ const customSection = buildCustomSection(commands);
156
+ if (customSection) sections.push(customSection);
157
+ const pluginSection = buildPluginSection(commands);
158
+ if (pluginSection) sections.push(pluginSection);
159
+ const mcpSection = buildMcpSection(commands);
160
+ if (mcpSection) sections.push(mcpSection);
161
+ const hasExtended = hasCustomCommands() || customSection || pluginSection || mcpSection;
162
+ if (hasExtended) {
163
+ sections.push(buildPrioritySection());
164
+ }
165
+ return /* @__PURE__ */ React.createElement(
166
+ InfoPanel,
167
+ {
168
+ title: t("commands.help.title"),
169
+ subtitle: `${PRODUCT_NAME} v${MACRO.VERSION}`,
170
+ sections,
171
+ onClose
172
+ }
25
173
  );
26
- const pluginCommands = filteredCommands.filter((cmd) => cmd.name.startsWith("plugin:")).sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()));
27
- const mcpCommands = filteredCommands.filter((cmd) => cmd.name.startsWith("mcp:")).sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()));
28
- const [count, setCount] = React.useState(0);
29
- React.useEffect(() => {
30
- const timer = setTimeout(() => {
31
- if (count < 3) {
32
- setCount(count + 1);
33
- }
34
- }, 250);
35
- return () => clearTimeout(timer);
36
- }, [count]);
37
- useInput((_, key) => {
38
- if (key.return || key.escape) onClose();
39
- });
40
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", padding: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.minto }, `${PRODUCT_NAME} v${MACRO.VERSION}`), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, null, t("help.productDescription", { product: PRODUCT_NAME }))), count >= 1 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, t("help.usageModes")), /* @__PURE__ */ React.createElement(Text, null, "\u2022 REPL: ", /* @__PURE__ */ React.createElement(Text, { bold: true }, PRODUCT_COMMAND), " (interactive session)"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", t("help.nonInteractive"), " ", /* @__PURE__ */ React.createElement(Text, { bold: true }, PRODUCT_COMMAND, ' -p "question"')), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, t("help.runForOptions", { command: PRODUCT_COMMAND })))), count >= 2 && /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true }, t("help.commonTasks")), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", t("help.taskAskQuestions"), " ", /* @__PURE__ */ React.createElement(Text, { color: getTheme().secondaryText }, "> How does foo.py work?")), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", t("help.taskEditFiles"), " ", /* @__PURE__ */ React.createElement(Text, { color: getTheme().secondaryText }, "> Update bar.ts to...")), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", t("help.taskFixErrors"), " ", /* @__PURE__ */ React.createElement(Text, { color: getTheme().secondaryText }, "> cargo build")), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", t("help.taskRunCommands"), " ", /* @__PURE__ */ React.createElement(Text, { color: getTheme().secondaryText }, "> /help")), /* @__PURE__ */ React.createElement(Text, null, "\u2022 ", t("help.taskRunBash"), " ", /* @__PURE__ */ React.createElement(Text, { color: getTheme().secondaryText }, "> !ls")), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true }, t("help.modeSystems")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.safetyModes")), /* @__PURE__ */ React.createElement(Box, { marginLeft: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.safetyModeYolo")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.safetyModeSmart")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.safetyModeStrict")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.safetyModeFree"))), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.permissionModes")), /* @__PURE__ */ React.createElement(Box, { marginLeft: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.permissionModeDefault")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.permissionModeAcceptEdits")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.permissionModePlan")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.permissionModeBypass"))), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText, italic: true }, t("help.modeInteraction")))), count >= 3 && /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true }, t("help.builtInCommands")), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, builtInCommands.map((cmd, i) => /* @__PURE__ */ React.createElement(Box, { key: i, marginLeft: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, `/${cmd.name}`), /* @__PURE__ */ React.createElement(Text, null, " - ", cmd.description)))), customCommands.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, t("help.customCommands"))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, customCommands.map((cmd, i) => /* @__PURE__ */ React.createElement(Box, { key: i, marginLeft: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.minto }, `/${cmd.name}`), /* @__PURE__ */ React.createElement(Text, null, " - ", cmd.description), cmd.aliases && cmd.aliases.length > 0 && /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, " ", "(aliases: ", cmd.aliases.join(", "), ")"), cmd.scope && /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, " [", cmd.scope, "]"))))), pluginCommands.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, t("help.pluginCommands"))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, pluginCommands.map((cmd, i) => /* @__PURE__ */ React.createElement(Box, { key: i, marginLeft: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.minto }, `/${cmd.name}`), /* @__PURE__ */ React.createElement(Text, null, " - ", cmd.description), cmd.aliases && cmd.aliases.length > 0 && /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, " ", "(aliases: ", cmd.aliases.join(", "), ")"))))), mcpCommands.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, t("help.mcpCommands"))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, mcpCommands.map((cmd, i) => /* @__PURE__ */ React.createElement(Box, { key: i, marginLeft: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.minto }, `/${cmd.name}`), /* @__PURE__ */ React.createElement(Text, null, " - ", cmd.description), cmd.aliases && cmd.aliases.length > 0 && /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, " ", "(aliases: ", cmd.aliases.join(", "), ")"))))), (hasCustomCommands() || customCommands.length > 0 || pluginCommands.length > 0 || mcpCommands.length > 0) && /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.commandPriority")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.priorityBuiltIn")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.priorityCustom")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.priorityPlugin")), /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.priorityMcp")), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, t("help.refreshCommandsHint"))))), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: theme.secondaryText }, moreHelp)), /* @__PURE__ */ React.createElement(Box, { marginTop: 2 }, /* @__PURE__ */ React.createElement(PressEnterToContinue, null)));
41
174
  }
42
175
  export {
43
176
  Help
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/Help.tsx"],
4
- "sourcesContent": ["import { Command } from '@commands'\nimport { PRODUCT_COMMAND, PRODUCT_NAME } from '@constants/product'\nimport {\n getCustomCommandDirectories,\n hasCustomCommands,\n type CustomCommandWithScope,\n} from '@services/customCommands'\nimport * as React from 'react'\nimport { Box, Text, useInput } from 'ink'\nimport { getTheme } from '@utils/theme'\nimport { PressEnterToContinue } from './PressEnterToContinue'\nimport { MACRO } from '@constants/macros'\nimport { t } from '@i18n'\n\n/**\n * Help Component - Interactive help system with progressive disclosure\n *\n * This component provides a comprehensive help interface that progressively\n * reveals information to avoid overwhelming users. It categorizes commands\n * into built-in and custom types, providing clear guidance on usage.\n *\n * The progressive disclosure pattern (count-based) ensures users can absorb\n * information at their own pace while maintaining a responsive interface.\n */\nexport function Help({\n commands,\n onClose,\n}: {\n commands: Command[]\n onClose: () => void\n}): React.ReactNode {\n const theme = getTheme()\n const moreHelp = `Learn more at: ${MACRO.README_URL}`\n\n // Filter out hidden commands from the help display\n const filteredCommands = commands.filter(cmd => !cmd.isHidden)\n\n // Categorize commands by their source/type\n const builtInCommands = filteredCommands\n .filter(\n cmd =>\n !cmd.name.startsWith('project:') &&\n !cmd.name.startsWith('user:') &&\n !cmd.name.startsWith('plugin:') &&\n !cmd.name.startsWith('mcp:'),\n )\n .sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()))\n\n // Custom commands (user: and project: prefixes)\n const customCommands = filteredCommands\n .filter(\n cmd => cmd.name.startsWith('project:') || cmd.name.startsWith('user:'),\n )\n .sort((a, b) =>\n a.userFacingName().localeCompare(b.userFacingName()),\n ) as CustomCommandWithScope[]\n\n // Plugin commands\n const pluginCommands = filteredCommands\n .filter(cmd => cmd.name.startsWith('plugin:'))\n .sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()))\n\n // MCP commands\n const mcpCommands = filteredCommands\n .filter(cmd => cmd.name.startsWith('mcp:'))\n .sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()))\n\n // Progressive disclosure state for managing information flow\n const [count, setCount] = React.useState(0)\n\n // Timer-based progressive disclosure to prevent information overload\n React.useEffect(() => {\n const timer = setTimeout(() => {\n if (count < 3) {\n setCount(count + 1)\n }\n }, 250)\n\n return () => clearTimeout(timer)\n }, [count])\n\n // Handle Enter or Esc key to close help\n useInput((_, key) => {\n if (key.return || key.escape) onClose()\n })\n\n return (\n <Box flexDirection=\"column\" padding={1}>\n <Text bold color={theme.minto}>\n {`${PRODUCT_NAME} v${MACRO.VERSION}`}\n </Text>\n\n <Box marginTop={1} flexDirection=\"column\">\n <Text>{t('help.productDescription', { product: PRODUCT_NAME })}</Text>\n </Box>\n\n {count >= 1 && (\n <Box flexDirection=\"column\" marginTop={1}>\n <Text bold>{t('help.usageModes')}</Text>\n <Text>\n \u2022 REPL: <Text bold>{PRODUCT_COMMAND}</Text> (interactive session)\n </Text>\n <Text>\n \u2022 {t('help.nonInteractive')}{' '}\n <Text bold>{PRODUCT_COMMAND} -p &quot;question&quot;</Text>\n </Text>\n <Box marginTop={1}>\n <Text>{t('help.runForOptions', { command: PRODUCT_COMMAND })}</Text>\n </Box>\n </Box>\n )}\n\n {count >= 2 && (\n <Box marginTop={1} flexDirection=\"column\">\n <Text bold>{t('help.commonTasks')}</Text>\n <Text>\n \u2022 {t('help.taskAskQuestions')}{' '}\n <Text color={getTheme().secondaryText}>\n &gt; How does foo.py work?\n </Text>\n </Text>\n <Text>\n \u2022 {t('help.taskEditFiles')}{' '}\n <Text color={getTheme().secondaryText}>\n &gt; Update bar.ts to...\n </Text>\n </Text>\n <Text>\n \u2022 {t('help.taskFixErrors')}{' '}\n <Text color={getTheme().secondaryText}>&gt; cargo build</Text>\n </Text>\n <Text>\n \u2022 {t('help.taskRunCommands')}{' '}\n <Text color={getTheme().secondaryText}>&gt; /help</Text>\n </Text>\n <Text>\n \u2022 {t('help.taskRunBash')}{' '}\n <Text color={getTheme().secondaryText}>&gt; !ls</Text>\n </Text>\n\n <Box marginTop={1} flexDirection=\"column\">\n <Text bold>{t('help.modeSystems')}</Text>\n <Text color={theme.secondaryText}>{t('help.safetyModes')}</Text>\n <Box marginLeft={1} flexDirection=\"column\">\n <Text color={theme.secondaryText}>\n {t('help.safetyModeYolo')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.safetyModeSmart')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.safetyModeStrict')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.safetyModeFree')}\n </Text>\n </Box>\n <Text color={theme.secondaryText}>{t('help.permissionModes')}</Text>\n <Box marginLeft={1} flexDirection=\"column\">\n <Text color={theme.secondaryText}>\n {t('help.permissionModeDefault')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.permissionModeAcceptEdits')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.permissionModePlan')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.permissionModeBypass')}\n </Text>\n </Box>\n <Text color={theme.secondaryText} italic>\n {t('help.modeInteraction')}\n </Text>\n </Box>\n </Box>\n )}\n\n {count >= 3 && (\n <Box marginTop={1} flexDirection=\"column\">\n <Text bold>{t('help.builtInCommands')}</Text>\n\n <Box flexDirection=\"column\">\n {builtInCommands.map((cmd, i) => (\n <Box key={i} marginLeft={1}>\n <Text bold>{`/${cmd.name}`}</Text>\n <Text> - {cmd.description}</Text>\n </Box>\n ))}\n </Box>\n\n {customCommands.length > 0 && (\n <>\n <Box marginTop={1}>\n <Text bold>{t('help.customCommands')}</Text>\n </Box>\n\n <Box flexDirection=\"column\">\n {customCommands.map((cmd, i) => (\n <Box key={i} marginLeft={1}>\n <Text bold color={theme.minto}>{`/${cmd.name}`}</Text>\n <Text> - {cmd.description}</Text>\n {cmd.aliases && cmd.aliases.length > 0 && (\n <Text color={theme.secondaryText}>\n {' '}\n (aliases: {cmd.aliases.join(', ')})\n </Text>\n )}\n {/* Show scope indicator for debugging */}\n {cmd.scope && (\n <Text color={theme.secondaryText}> [{cmd.scope}]</Text>\n )}\n </Box>\n ))}\n </Box>\n </>\n )}\n\n {pluginCommands.length > 0 && (\n <>\n <Box marginTop={1}>\n <Text bold>{t('help.pluginCommands')}</Text>\n </Box>\n\n <Box flexDirection=\"column\">\n {pluginCommands.map((cmd, i) => (\n <Box key={i} marginLeft={1}>\n <Text bold color={theme.minto}>{`/${cmd.name}`}</Text>\n <Text> - {cmd.description}</Text>\n {cmd.aliases && cmd.aliases.length > 0 && (\n <Text color={theme.secondaryText}>\n {' '}\n (aliases: {cmd.aliases.join(', ')})\n </Text>\n )}\n </Box>\n ))}\n </Box>\n </>\n )}\n\n {mcpCommands.length > 0 && (\n <>\n <Box marginTop={1}>\n <Text bold>{t('help.mcpCommands')}</Text>\n </Box>\n\n <Box flexDirection=\"column\">\n {mcpCommands.map((cmd, i) => (\n <Box key={i} marginLeft={1}>\n <Text bold color={theme.minto}>{`/${cmd.name}`}</Text>\n <Text> - {cmd.description}</Text>\n {cmd.aliases && cmd.aliases.length > 0 && (\n <Text color={theme.secondaryText}>\n {' '}\n (aliases: {cmd.aliases.join(', ')})\n </Text>\n )}\n </Box>\n ))}\n </Box>\n </>\n )}\n\n {/* Show command loading information */}\n {(hasCustomCommands() ||\n customCommands.length > 0 ||\n pluginCommands.length > 0 ||\n mcpCommands.length > 0) && (\n <Box marginTop={1} flexDirection=\"column\">\n <Text color={theme.secondaryText}>\n {t('help.commandPriority')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.priorityBuiltIn')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.priorityCustom')}\n </Text>\n <Text color={theme.secondaryText}>\n {t('help.priorityPlugin')}\n </Text>\n <Text color={theme.secondaryText}>{t('help.priorityMcp')}</Text>\n <Box marginTop={1}>\n <Text color={theme.secondaryText}>\n {t('help.refreshCommandsHint')}\n </Text>\n </Box>\n </Box>\n )}\n </Box>\n )}\n\n <Box marginTop={1}>\n <Text color={theme.secondaryText}>{moreHelp}</Text>\n </Box>\n\n <Box marginTop={2}>\n <PressEnterToContinue />\n </Box>\n </Box>\n )\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AAC,QAAK,MAAI,QAAE,EAAE,kBAAkB,CAAE,CACpC,GAEA,oCAAC,OAAI,eAAc,YAChB,YAAY,IAAI,CAAC,KAAK,MACrB,oCAAC,OAAI,KAAK,GAAG,YAAY,KACvB,oCAAC,QAAK,MAAI,MAAC,OAAO,MAAM,SAAQ,IAAI,IAAI,IAAI,EAAG,GAC/C,oCAAC,YAAK,OAAI,IAAI,WAAY,GACzB,IAAI,WAAW,IAAI,QAAQ,SAAS,KACnC,oCAAC,QAAK,OAAO,MAAM,iBAChB,KAAI,cACM,IAAI,QAAQ,KAAK,IAAI,GAAE,GACpC,CAEJ,CACD,CACH,CACF,IAIA,kBAAkB,KAClB,eAAe,SAAS,KACxB,eAAe,SAAS,KACxB,YAAY,SAAS,MACrB,oCAAC,OAAI,WAAW,GAAG,eAAc,YAC/B,oCAAC,QAAK,OAAO,MAAM,iBAChB,EAAE,sBAAsB,CAC3B,GACA,oCAAC,QAAK,OAAO,MAAM,iBAChB,EAAE,sBAAsB,CAC3B,GACA,oCAAC,QAAK,OAAO,MAAM,iBAChB,EAAE,qBAAqB,CAC1B,GACA,oCAAC,QAAK,OAAO,MAAM,iBAChB,EAAE,qBAAqB,CAC1B,GACA,oCAAC,QAAK,OAAO,MAAM,iBAAgB,EAAE,kBAAkB,CAAE,GACzD,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAO,MAAM,iBAChB,EAAE,0BAA0B,CAC/B,CACF,CACF,CAEJ,GAGF,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAO,MAAM,iBAAgB,QAAS,CAC9C,GAEA,oCAAC,OAAI,WAAW,KACd,oCAAC,0BAAqB,CACxB,CACF;AAEJ;",
4
+ "sourcesContent": ["/**\n * Help Component\n *\n * Displays comprehensive help using InfoPanel for consistent UI.\n * Shows all information immediately (no progressive disclosure timer).\n */\n\nimport React from 'react'\nimport type { Command } from '@commands'\nimport type { CustomCommandWithScope } from '@services/customCommands'\nimport { hasCustomCommands } from '@services/customCommands'\nimport { PRODUCT_COMMAND, PRODUCT_NAME } from '@constants/product'\nimport { MACRO } from '@constants/macros'\nimport { SEMANTIC_COLORS } from '@constants/colors'\nimport { InfoPanel } from '@components/InfoPanel'\nimport type { InfoSection, InfoItem } from '@components/InfoPanel'\nimport { t } from '@i18n'\n\nfunction buildUsageSection(): InfoSection {\n return {\n title: t('help.usageModes'),\n items: [\n { label: 'REPL', value: `${PRODUCT_COMMAND} (interactive session)` },\n {\n label: t('help.nonInteractive'),\n value: `${PRODUCT_COMMAND} -p \"question\"`,\n },\n {\n label: t('help.options'),\n value: t('help.runForOptions', { command: PRODUCT_COMMAND }),\n valueColor: SEMANTIC_COLORS.dim,\n },\n ],\n }\n}\n\nfunction buildCommonTasksSection(): InfoSection {\n return {\n title: t('help.commonTasks'),\n items: [\n {\n label: '\\u2022 Ask questions',\n value: 'How does foo.py work?',\n valueColor: SEMANTIC_COLORS.dim,\n },\n {\n label: '\\u2022 Edit files',\n value: 'Update bar.ts to...',\n valueColor: SEMANTIC_COLORS.dim,\n },\n {\n label: '\\u2022 Fix errors',\n value: 'cargo build',\n valueColor: SEMANTIC_COLORS.dim,\n },\n {\n label: '\\u2022 Run commands',\n value: '/help',\n valueColor: SEMANTIC_COLORS.dim,\n },\n {\n label: '\\u2022 Run bash',\n value: '!ls',\n valueColor: SEMANTIC_COLORS.dim,\n },\n ],\n }\n}\n\nfunction buildModeSystemsSection(): InfoSection {\n return {\n title: t('help.modeSystems'),\n items: [\n {\n label: '',\n value: t('help.safetyModes'),\n valueColor: SEMANTIC_COLORS.secondary,\n },\n { label: ' --yolo', value: 'Skip all confirmations' },\n { label: ' --smart', value: 'Dangerous tools require confirmation' },\n { label: ' --strict', value: 'All tools require confirmation' },\n { label: ' --free', value: 'Free mode (no restrictions)' },\n {\n label: '',\n value: t('help.permissionModes'),\n valueColor: SEMANTIC_COLORS.secondary,\n },\n { label: ' default', value: 'Standard confirmation flow' },\n { label: ' acceptEdits', value: 'Auto-approve file edits' },\n { label: ' plan', value: 'Plan mode (no modifications)' },\n { label: ' bypass', value: 'Skip all permission checks' },\n ],\n }\n}\n\nfunction buildBuiltInSection(commands: Command[]): InfoSection {\n const builtInCommands = commands\n .filter(\n cmd =>\n !cmd.isHidden &&\n !cmd.name.startsWith('project:') &&\n !cmd.name.startsWith('user:') &&\n !cmd.name.startsWith('plugin:') &&\n !cmd.name.startsWith('mcp:'),\n )\n .sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()))\n\n const items: InfoItem[] = builtInCommands.map(cmd => ({\n label: `/${cmd.name}`,\n value: cmd.description,\n }))\n\n return { title: t('help.builtInCommands'), items }\n}\n\nfunction buildCustomSection(commands: Command[]): InfoSection | null {\n const customCommands = commands\n .filter(\n cmd =>\n !cmd.isHidden &&\n (cmd.name.startsWith('project:') || cmd.name.startsWith('user:')),\n )\n .sort((a, b) =>\n a.userFacingName().localeCompare(b.userFacingName()),\n ) as CustomCommandWithScope[]\n\n if (customCommands.length === 0) return null\n\n const items: InfoItem[] = customCommands.map(cmd => ({\n label: `/${cmd.name}`,\n value: `${cmd.description}${cmd.scope ? ` [${cmd.scope}]` : ''}`,\n }))\n\n return { title: t('help.customCommands'), items }\n}\n\nfunction buildPluginSection(commands: Command[]): InfoSection | null {\n const pluginCommands = commands\n .filter(cmd => !cmd.isHidden && cmd.name.startsWith('plugin:'))\n .sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()))\n\n if (pluginCommands.length === 0) return null\n\n const items: InfoItem[] = pluginCommands.map(cmd => ({\n label: `/${cmd.name}`,\n value: cmd.description,\n }))\n\n return { title: t('help.pluginCommands'), items }\n}\n\nfunction buildMcpSection(commands: Command[]): InfoSection | null {\n const mcpCommands = commands\n .filter(cmd => !cmd.isHidden && cmd.name.startsWith('mcp:'))\n .sort((a, b) => a.userFacingName().localeCompare(b.userFacingName()))\n\n if (mcpCommands.length === 0) return null\n\n const items: InfoItem[] = mcpCommands.map(cmd => ({\n label: `/${cmd.name}`,\n value: cmd.description,\n }))\n\n return { title: t('help.mcpCommands'), items }\n}\n\nfunction buildPrioritySection(): InfoSection {\n return {\n title: t('help.commandPriority'),\n items: [\n {\n label: '1.',\n value: 'Built-in commands',\n valueColor: SEMANTIC_COLORS.dim,\n },\n {\n label: '2.',\n value: 'Custom commands (project: / user:)',\n valueColor: SEMANTIC_COLORS.dim,\n },\n {\n label: '3.',\n value: 'Plugin commands',\n valueColor: SEMANTIC_COLORS.dim,\n },\n { label: '4.', value: 'MCP commands', valueColor: SEMANTIC_COLORS.dim },\n ],\n }\n}\n\nexport function Help({\n commands,\n onClose,\n}: {\n commands: Command[]\n onClose: () => void\n}): React.ReactNode {\n const sections: InfoSection[] = []\n\n // Usage modes\n sections.push(buildUsageSection())\n\n // Common tasks\n sections.push(buildCommonTasksSection())\n\n // Mode systems\n sections.push(buildModeSystemsSection())\n\n // Built-in commands\n sections.push(buildBuiltInSection(commands))\n\n // Custom commands (if any)\n const customSection = buildCustomSection(commands)\n if (customSection) sections.push(customSection)\n\n // Plugin commands (if any)\n const pluginSection = buildPluginSection(commands)\n if (pluginSection) sections.push(pluginSection)\n\n // MCP commands (if any)\n const mcpSection = buildMcpSection(commands)\n if (mcpSection) sections.push(mcpSection)\n\n // Priority info (if any non-built-in commands exist)\n const hasExtended =\n hasCustomCommands() || customSection || pluginSection || mcpSection\n if (hasExtended) {\n sections.push(buildPrioritySection())\n }\n\n return (\n <InfoPanel\n title={t('commands.help.title')}\n subtitle={`${PRODUCT_NAME} v${MACRO.VERSION}`}\n sections={sections}\n onClose={onClose}\n />\n )\n}\n"],
5
+ "mappings": "AAOA,OAAO,WAAW;AAGlB,SAAS,yBAAyB;AAClC,SAAS,iBAAiB,oBAAoB;AAC9C,SAAS,aAAa;AACtB,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAE1B,SAAS,SAAS;AAElB,SAAS,oBAAiC;AACxC,SAAO;AAAA,IACL,OAAO,EAAE,iBAAiB;AAAA,IAC1B,OAAO;AAAA,MACL,EAAE,OAA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AAI;AAAA,IACxE;AAAA,EACF;AACF;AAEO,SAAS,KAAK;AAAA,EACnB;AAAA,EACA;AACF,GAGoB;AAClB,QAAM,WAA0B,CAAC;AAGjC,WAAS,KAAK,kBAAkB,CAAC;AAGjC,WAAS,KAAK,wBAAwB,CAAC;AAGvC,WAAS,KAAK,wBAAwB,CAAC;AAGvC,WAAS,KAAK,oBAAoB,QAAQ,CAAC;AAG3C,QAAM,gBAAgB,mBAAmB,QAAQ;AACjD,MAAI,cAAe,UAAS,KAAK,aAAa;AAG9C,QAAM,gBAAgB,mBAAmB,QAAQ;AACjD,MAAI,cAAe,UAAS,KAAK,aAAa;AAG9C,QAAM,aAAa,gBAAgB,QAAQ;AAC3C,MAAI,WAAY,UAAS,KAAK,UAAU;AAGxC,QAAM,cACJ,kBAAkB,KAAK,iBAAiB,iBAAiB;AAC3D,MAAI,aAAa;AACf,aAAS,KAAK,qBAAqB,CAAC;AAAA,EACtC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,qBAAqB;AAAA,MAC9B,UAAU,GAAG,YAAY,KAAK,MAAM,OAAO;AAAA,MAC3C;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,123 @@
1
+ import React from "react";
2
+ import { Box, Text, useInput } from "ink";
3
+ import { BRAND_GRADIENT, SEMANTIC_COLORS } from "../../constants/colors.js";
4
+ import { StatusOverlayContent } from "../StatusOverlayContent.js";
5
+ import { t } from "../../i18n/index.js";
6
+ function renderProgressBar(percent, width = 20, color) {
7
+ const clamped = Math.min(100, Math.max(0, percent));
8
+ const filled = Math.round(clamped / 100 * width);
9
+ const empty = width - filled;
10
+ const barColor = color || getProgressColor(clamped);
11
+ return /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: barColor }, "\u2588".repeat(filled)), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.muted }, "\u2591".repeat(empty)), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", clamped.toFixed(0), "%"));
12
+ }
13
+ function getProgressColor(percent) {
14
+ if (percent < 50) return SEMANTIC_COLORS.success;
15
+ if (percent < 80) return BRAND_GRADIENT.MIDDLE;
16
+ return SEMANTIC_COLORS.error;
17
+ }
18
+ function renderDelta(delta) {
19
+ const prefix = delta.value > 0 ? "+" : "";
20
+ const color = delta.value > 0 ? SEMANTIC_COLORS.success : delta.value < 0 ? SEMANTIC_COLORS.error : SEMANTIC_COLORS.dim;
21
+ return /* @__PURE__ */ React.createElement(Text, { color }, "(", prefix, delta.value, delta.label ? ` ${delta.label}` : "", ")");
22
+ }
23
+ const InfoItemRow = ({ item }) => {
24
+ return /* @__PURE__ */ React.createElement(Box, { paddingLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, item.label.padEnd(18)), /* @__PURE__ */ React.createElement(Text, { color: item.valueColor || SEMANTIC_COLORS.secondary }, item.value), item.progress && /* @__PURE__ */ React.createElement(Text, null, " ", renderProgressBar(
25
+ item.progress.percent,
26
+ item.progress.width,
27
+ item.progress.color
28
+ )), item.delta && /* @__PURE__ */ React.createElement(Text, null, " ", renderDelta(item.delta)));
29
+ };
30
+ const InfoSectionView = ({ section }) => {
31
+ return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { bold: true, color: SEMANTIC_COLORS.secondary }, section.title)), section.items.map((item, index) => /* @__PURE__ */ React.createElement(InfoItemRow, { key: `${section.title}-${index}`, item })));
32
+ };
33
+ function InfoPanel({
34
+ title,
35
+ subtitle,
36
+ sections,
37
+ actions,
38
+ onClose,
39
+ statusOverlay,
40
+ isActive = true
41
+ }) {
42
+ useInput(
43
+ (input, key) => {
44
+ if (statusOverlay && statusOverlay.type !== "loading") {
45
+ if (key.escape || key.return) {
46
+ onClose();
47
+ }
48
+ return;
49
+ }
50
+ if (statusOverlay) return;
51
+ if (key.escape) {
52
+ onClose();
53
+ return;
54
+ }
55
+ if (actions) {
56
+ for (const action of actions) {
57
+ const actionKey = action.key.toLowerCase();
58
+ if (input.toLowerCase() === actionKey || (actionKey === "enter" || actionKey === "return") && key.return) {
59
+ action.onPress();
60
+ return;
61
+ }
62
+ }
63
+ }
64
+ if (key.return && (!actions || actions.length === 0)) {
65
+ onClose();
66
+ return;
67
+ }
68
+ },
69
+ { isActive }
70
+ );
71
+ const buildFooterHint = () => {
72
+ if (statusOverlay) {
73
+ return statusOverlay.type === "loading" ? "" : t("ui.infoPanel.dismissHint");
74
+ }
75
+ if (actions && actions.length > 0) {
76
+ const actionHints = actions.map((a) => `${a.keyLabel} ${a.description}`).join(" \xB7 ");
77
+ return `${actionHints} \xB7 Esc ${t("ui.hints.close")}`;
78
+ }
79
+ return t("ui.infoPanel.continueHint");
80
+ };
81
+ const footerHint = buildFooterHint();
82
+ return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React.createElement(
83
+ Box,
84
+ {
85
+ borderTop: true,
86
+ borderBottom: false,
87
+ borderLeft: false,
88
+ borderRight: false,
89
+ borderColor: BRAND_GRADIENT.START,
90
+ borderStyle: "single",
91
+ width: "100%",
92
+ paddingX: 1,
93
+ flexDirection: "column"
94
+ },
95
+ /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: BRAND_GRADIENT.START }, "\u25C6"), /* @__PURE__ */ React.createElement(Text, { bold: true, color: SEMANTIC_COLORS.secondary }, " ", title), subtitle && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " ", subtitle))
96
+ ), /* @__PURE__ */ React.createElement(
97
+ Box,
98
+ {
99
+ flexDirection: "column",
100
+ borderTop: false,
101
+ borderBottom: true,
102
+ borderLeft: false,
103
+ borderRight: false,
104
+ borderColor: BRAND_GRADIENT.START,
105
+ borderStyle: "single",
106
+ width: "100%",
107
+ paddingX: 1,
108
+ paddingY: 1
109
+ },
110
+ statusOverlay ? /* @__PURE__ */ React.createElement(
111
+ StatusOverlayContent,
112
+ {
113
+ type: statusOverlay.type,
114
+ message: statusOverlay.message
115
+ }
116
+ ) : /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, sections.map((section, index) => /* @__PURE__ */ React.createElement(InfoSectionView, { key: `section-${index}`, section }))),
117
+ footerHint && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.muted }, footerHint))
118
+ ));
119
+ }
120
+ export {
121
+ InfoPanel
122
+ };
123
+ //# sourceMappingURL=InfoPanel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/InfoPanel/InfoPanel.tsx"],
4
+ "sourcesContent": ["/**\n * InfoPanel Component\n *\n * A read-only info display with brand-consistent borders,\n * sectioned content, optional progress bars, deltas, and actions.\n *\n * Visual pattern:\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 (BRAND_GRADIENT.START border)\n * \u25C6 Title subtitle\n *\n * Section Title\n * label1 value1 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591 45%\n * label2 value2 (+3 vs yesterday)\n * label3 value3\n *\n * Enter Close \u00B7 T Toggle \u00B7 Esc Close\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 (BRAND_GRADIENT.START border)\n */\n\nimport React from 'react'\nimport { Box, Text, useInput } from 'ink'\nimport { BRAND_GRADIENT, SEMANTIC_COLORS } from '@constants/colors'\nimport { StatusOverlayContent } from '@components/StatusOverlayContent'\nimport { t } from '@i18n'\nimport type {\n InfoPanelProps,\n InfoItem,\n InfoSection,\n InfoPanelProgress,\n InfoPanelDelta,\n} from './types'\n\n/**\n * Render an ASCII progress bar\n */\nfunction renderProgressBar(\n percent: number,\n width: number = 20,\n color?: string,\n): React.ReactNode {\n const clamped = Math.min(100, Math.max(0, percent))\n const filled = Math.round((clamped / 100) * width)\n const empty = width - filled\n\n const barColor = color || getProgressColor(clamped)\n\n return (\n <Text>\n <Text color={barColor}>{'\u2588'.repeat(filled)}</Text>\n <Text color={SEMANTIC_COLORS.muted}>{'\u2591'.repeat(empty)}</Text>\n <Text color={SEMANTIC_COLORS.dim}> {clamped.toFixed(0)}%</Text>\n </Text>\n )\n}\n\n/**\n * Get color based on percentage\n */\nfunction getProgressColor(percent: number): string {\n if (percent < 50) return SEMANTIC_COLORS.success\n if (percent < 80) return BRAND_GRADIENT.MIDDLE\n return SEMANTIC_COLORS.error\n}\n\n/**\n * Render a delta indicator\n */\nfunction renderDelta(delta: InfoPanelDelta): React.ReactNode {\n const prefix = delta.value > 0 ? '+' : ''\n const color =\n delta.value > 0\n ? SEMANTIC_COLORS.success\n : delta.value < 0\n ? SEMANTIC_COLORS.error\n : SEMANTIC_COLORS.dim\n\n return (\n <Text color={color}>\n ({prefix}\n {delta.value}\n {delta.label ? ` ${delta.label}` : ''})\n </Text>\n )\n}\n\n/**\n * Render a single info item\n */\nconst InfoItemRow: React.FC<{ item: InfoItem }> = ({ item }) => {\n return (\n <Box paddingLeft={2}>\n <Text color={SEMANTIC_COLORS.dim}>{item.label.padEnd(18)}</Text>\n <Text color={item.valueColor || SEMANTIC_COLORS.secondary}>\n {item.value}\n </Text>\n {item.progress && (\n <Text>\n {' '}\n {renderProgressBar(\n item.progress.percent,\n item.progress.width,\n item.progress.color,\n )}\n </Text>\n )}\n {item.delta && <Text> {renderDelta(item.delta)}</Text>}\n </Box>\n )\n}\n\n/**\n * Render a section with title and items\n */\nconst InfoSectionView: React.FC<{ section: InfoSection }> = ({ section }) => {\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n <Box>\n <Text bold color={SEMANTIC_COLORS.secondary}>\n {section.title}\n </Text>\n </Box>\n {section.items.map((item, index) => (\n <InfoItemRow key={`${section.title}-${index}`} item={item} />\n ))}\n </Box>\n )\n}\n\nexport function InfoPanel({\n title,\n subtitle,\n sections,\n actions,\n onClose,\n statusOverlay,\n isActive = true,\n}: InfoPanelProps) {\n // Keyboard input handling\n useInput(\n (input, key) => {\n // Status overlay: success/error -> ESC/Enter closes\n if (statusOverlay && statusOverlay.type !== 'loading') {\n if (key.escape || key.return) {\n onClose()\n }\n return\n }\n\n // Status overlay: loading -> ignore all input\n if (statusOverlay) return\n\n // Escape always closes\n if (key.escape) {\n onClose()\n return\n }\n\n // Check action keys\n if (actions) {\n for (const action of actions) {\n const actionKey = action.key.toLowerCase()\n if (\n input.toLowerCase() === actionKey ||\n ((actionKey === 'enter' || actionKey === 'return') && key.return)\n ) {\n action.onPress()\n return\n }\n }\n }\n\n // Enter closes when no actions defined\n if (key.return && (!actions || actions.length === 0)) {\n onClose()\n return\n }\n },\n { isActive },\n )\n\n // Build footer hint\n const buildFooterHint = (): string => {\n if (statusOverlay) {\n return statusOverlay.type === 'loading'\n ? ''\n : t('ui.infoPanel.dismissHint')\n }\n\n if (actions && actions.length > 0) {\n const actionHints = actions\n .map(a => `${a.keyLabel} ${a.description}`)\n .join(' \\u00B7 ')\n return `${actionHints} \\u00B7 Esc ${t('ui.hints.close')}`\n }\n\n return t('ui.infoPanel.continueHint')\n }\n\n const footerHint = buildFooterHint()\n\n return (\n <Box flexDirection=\"column\" width=\"100%\">\n {/* Header bar with top border */}\n <Box\n borderTop={true}\n borderBottom={false}\n borderLeft={false}\n borderRight={false}\n borderColor={BRAND_GRADIENT.START}\n borderStyle=\"single\"\n width=\"100%\"\n paddingX={1}\n flexDirection=\"column\"\n >\n {/* Title with brand color */}\n <Box>\n <Text color={BRAND_GRADIENT.START}>{'\\u25C6'}</Text>\n <Text bold color={SEMANTIC_COLORS.secondary}>\n {' '}\n {title}\n </Text>\n {subtitle && (\n <Text color={SEMANTIC_COLORS.dim}>\n {' '}\n {subtitle}\n </Text>\n )}\n </Box>\n </Box>\n\n {/* Content container with bottom border */}\n <Box\n flexDirection=\"column\"\n borderTop={false}\n borderBottom={true}\n borderLeft={false}\n borderRight={false}\n borderColor={BRAND_GRADIENT.START}\n borderStyle=\"single\"\n width=\"100%\"\n paddingX={1}\n paddingY={1}\n >\n {statusOverlay ? (\n <StatusOverlayContent\n type={statusOverlay.type}\n message={statusOverlay.message}\n />\n ) : (\n <Box flexDirection=\"column\">\n {sections.map((section, index) => (\n <InfoSectionView key={`section-${index}`} section={section} />\n ))}\n </Box>\n )}\n\n {/* Footer Hint */}\n {footerHint && (\n <Box marginTop={1}>\n <Text color={SEMANTIC_COLORS.muted}>{footerHint}</Text>\n </Box>\n )}\n </Box>\n </Box>\n )\n}\n"],
5
+ "mappings": "AAmBA,OAAO,WAAW;AAClB,SAAS,KAAK,MAAM,gBAAgB;AACpC,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAYlB,SAAS,kBACP,SACA,QAAgB,IAChB,OACiB;AACjB,QAAM,UAAU,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC;AAClD,QAAM,SAAS,KAAK,MAAO,UAAU,MAAO,KAAK;AACjD,QAAM,QAAQ,QAAQ;AAEtB,QAAM,WAAW,SAAS,iBAAiB,OAAO;AAElD,SACE,oCAAC,YACC,oCAAC,QAAK,OAAO,YAAW,SAAI,OAAO,MAAM,CAAE,GAC3C,oCAAC,QAAK,OAAO,gBAAgB,SAAQ,SAAI,OAAO,KAAK,CAAE,GACvD,oCAAC,QAAK,OAAO,gBAAgB,OAAK,KAAE,QAAQ,QAAQ,CAAC,GAAE,GAAC,CAC1D;AAEJ;AAKA,SAAS,iBAAiB,SAAyB;AACjD,MAAI,UAAU,GAAI,QAAO,gBAAgB;AACzC,MAAI,UA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,OAC1B,MACA,QACH,CAEJ;AAAA,EACF,GAGA;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,WAAW;AAAA,MACX,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,aAAa,eAAe;AAAA,MAC5B,aAAY;AAAA,MACZ,OAAM;AAAA,MACN,UAAU;AAAA,MACV,UAAU;AAAA;AAAA,IAET,gBACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,cAAc;AAAA,QACpB,SAAS,cAAc;AAAA;AAAA,IACzB,IAEA,oCAAC,OAAI,eAAc,YAChB,SAAS,IAAI,CAAC,SAAS,UACtB,oCAAC,mBAAgB,KAAK,WAAW,KAAK,IAAI,SAAkB,CAC7D,CACH;AAAA,IAID,cACC,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAO,gBAAgB,SAAQ,UAAW,CAClD;AAAA,EAEJ,CACF;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ import { InfoPanel } from "./InfoPanel.js";
2
+ export {
3
+ InfoPanel
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/InfoPanel/index.ts"],
4
+ "sourcesContent": ["/**\n * InfoPanel Component Exports\n *\n * A read-only info display component for commands that show status/data.\n */\n\nexport { InfoPanel } from './InfoPanel'\nexport type {\n InfoPanelProps,\n InfoSection,\n InfoItem,\n InfoPanelAction,\n InfoPanelProgress,\n InfoPanelDelta,\n StatusOverlay,\n} from './types'\n"],
5
+ "mappings": "AAMA,SAAS,iBAAiB;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,43 @@
1
+ import React from "react";
2
+ import { Box, Text } from "ink";
3
+ import { BRAND_GRADIENT, SEMANTIC_COLORS } from "../../constants/colors.js";
4
+ import { SimpleSpinner } from "../Spinner.js";
5
+ import TextInput from "../TextInput.js";
6
+ import { WizardContainer } from "./WizardContainer.js";
7
+ function BrandTextInput({
8
+ title,
9
+ description,
10
+ placeholder,
11
+ value,
12
+ onChange,
13
+ onSubmit,
14
+ mask,
15
+ error,
16
+ isLoading,
17
+ loadingText,
18
+ hint,
19
+ footerHint,
20
+ cursorOffset,
21
+ onChangeCursorOffset
22
+ }) {
23
+ const footer = footerHint ? /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.muted }, footerHint) : void 0;
24
+ return /* @__PURE__ */ React.createElement(WizardContainer, { title, footer }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.secondary }, description)), hint && /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, hint), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: BRAND_GRADIENT.START }, "\u25B8", " "), /* @__PURE__ */ React.createElement(
25
+ TextInput,
26
+ {
27
+ placeholder,
28
+ value,
29
+ onChange,
30
+ onSubmit,
31
+ mask,
32
+ columns: 500,
33
+ cursorOffset,
34
+ onChangeCursorOffset,
35
+ showCursor: !isLoading,
36
+ focus: !isLoading
37
+ }
38
+ )), isLoading && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(SimpleSpinner, null), /* @__PURE__ */ React.createElement(Text, { color: BRAND_GRADIENT.MIDDLE }, " ", loadingText || "Loading...")), error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.error }, error)));
39
+ }
40
+ export {
41
+ BrandTextInput
42
+ };
43
+ //# sourceMappingURL=BrandTextInput.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ModelSelector/BrandTextInput.tsx"],
4
+ "sourcesContent": ["/**\n * BrandTextInput Component\n *\n * Standardized text input wrapper using WizardContainer.\n * Provides consistent layout for all wizard text input screens:\n * title, description, input field, action hints, error/loading display.\n */\n\nimport React from 'react'\nimport { Box, Text } from 'ink'\nimport { BRAND_GRADIENT, SEMANTIC_COLORS } from '@constants/colors'\nimport { SimpleSpinner } from '@components/Spinner'\nimport TextInput from '../TextInput'\nimport { WizardContainer } from './WizardContainer'\n\ntype BrandTextInputProps = {\n title: string\n description: string\n placeholder: string\n value: string\n onChange: (value: string) => void\n onSubmit: (value: string) => void\n mask?: string\n error?: string | null\n isLoading?: boolean\n loadingText?: string\n hint?: React.ReactNode\n footerHint?: string\n cursorOffset?: number\n onChangeCursorOffset?: (offset: number) => void\n}\n\nexport function BrandTextInput({\n title,\n description,\n placeholder,\n value,\n onChange,\n onSubmit,\n mask,\n error,\n isLoading,\n loadingText,\n hint,\n footerHint,\n cursorOffset,\n onChangeCursorOffset,\n}: BrandTextInputProps) {\n const footer = footerHint ? (\n <Text color={SEMANTIC_COLORS.muted}>{footerHint}</Text>\n ) : undefined\n\n return (\n <WizardContainer title={title} footer={footer}>\n {/* Description */}\n <Box flexDirection=\"column\" marginBottom={1}>\n <Text color={SEMANTIC_COLORS.secondary}>{description}</Text>\n </Box>\n\n {/* Provider-specific hints */}\n {hint && <Box marginBottom={1}>{hint}</Box>}\n\n {/* Input field */}\n <Box>\n <Text color={BRAND_GRADIENT.START}>{'\\u25B8'} </Text>\n <TextInput\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n onSubmit={onSubmit}\n mask={mask}\n columns={500}\n cursorOffset={cursorOffset}\n onChangeCursorOffset={onChangeCursorOffset}\n showCursor={!isLoading}\n focus={!isLoading}\n />\n </Box>\n\n {/* Loading state */}\n {isLoading && (\n <Box marginTop={1}>\n <SimpleSpinner />\n <Text color={BRAND_GRADIENT.MIDDLE}>\n {' '}\n {loadingText || 'Loading...'}\n </Text>\n </Box>\n )}\n\n {/* Error state */}\n {error && (\n <Box marginTop={1}>\n <Text color={SEMANTIC_COLORS.error}>{error}</Text>\n </Box>\n )}\n </WizardContainer>\n )\n}\n"],
5
+ "mappings": "AAQA,OAAO,WAAW;AAClB,SAAS,KAAK,YAAY;AAC1B,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,qBAAqB;AAC9B,OAAO,eAAe;AACtB,SAAS,uBAAuB;AAmBzB,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,SAAS,aACb,oCAAC,QAAK,OAAO,gBAAgB,SAAQ,UAAW,IAC9C;AAEJ,SACE,oCAAC,mBAAgB,OAAc,UAE7B,oCAAC,OAAI,eAAc,UAAS,cAAc,KACxC,oCAAC,QAAK,OAAO,gBAAgB,aAAY,WAAY,CACvD,GAGC,QAAQ,oCAAC,OAAI,cAAc,KAAI,IAAK,GAGrC,oCAAC,WACC,oCAAC,QAAK,OAAO,eAAe,SAAQ,UAAS,GAAC,GAC9C;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,YAAY,CAAC;AAAA,MACb,OAAO,CAAC;AAAA;AAAA,EACV,CACF,GAGC,aACC,oCAAC,OAAI,WAAW,KACd,oCAAC,mBAAc,GACf,oCAAC,QAAK,OAAO,eAAe,UACzB,KACA,eAAe,YAClB,CACF,GAID,SACC,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAO,gBAAgB,SAAQ,KAAM,CAC7C,CAEJ;AAEJ;",
6
+ "names": []
7
+ }