codymaster 4.1.3 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui/box.js CHANGED
@@ -17,6 +17,9 @@ exports.renderPriority = renderPriority;
17
17
  exports.renderSpeechBubble = renderSpeechBubble;
18
18
  exports.renderStepProgress = renderStepProgress;
19
19
  exports.renderFooter = renderFooter;
20
+ exports.renderCommandHeader = renderCommandHeader;
21
+ exports.renderKeyValue = renderKeyValue;
22
+ exports.renderResult = renderResult;
20
23
  exports.stripAnsi = stripAnsi;
21
24
  const chalk_1 = __importDefault(require("chalk"));
22
25
  const theme_1 = require("./theme");
@@ -178,6 +181,52 @@ function renderStepProgress(current, total) {
178
181
  function renderFooter(hints) {
179
182
  return ` ${hints.map(h => (0, theme_1.dim)(h)).join((0, theme_1.dim)(' • '))}`;
180
183
  }
184
+ // ─── Command Header ────────────────────────────────────────────────────────
185
+ /**
186
+ * Render a branded command header: ⚙️ Configuration
187
+ */
188
+ function renderCommandHeader(title, icon) {
189
+ const iconStr = icon ? `${icon} ` : '';
190
+ return `\n ${iconStr}${(0, theme_1.brand)(title)}\n`;
191
+ }
192
+ // ─── Key-Value Display ─────────────────────────────────────────────────────
193
+ /**
194
+ * Render aligned key-value pairs with branded styling
195
+ * Input: [['Version', '4.1.3'], ['Port', '4321']]
196
+ * Output:
197
+ * Version 4.1.3
198
+ * Port 4321
199
+ */
200
+ function renderKeyValue(pairs, opts) {
201
+ var _a, _b;
202
+ const indent = ' '.repeat((_a = opts === null || opts === void 0 ? void 0 : opts.indent) !== null && _a !== void 0 ? _a : 2);
203
+ const maxKey = (_b = opts === null || opts === void 0 ? void 0 : opts.keyWidth) !== null && _b !== void 0 ? _b : Math.max(...pairs.map(([k]) => k.length)) + 1;
204
+ return pairs.map(([key, value]) => {
205
+ const paddedKey = (key + ':').padEnd(maxKey + 1);
206
+ return `${indent}${(0, theme_1.dim)(paddedKey)} ${value}`;
207
+ }).join('\n');
208
+ }
209
+ // ─── Result Messages ───────────────────────────────────────────────────────
210
+ const RESULT_CONFIG = {
211
+ success: { icon: '✅', color: theme_1.success },
212
+ error: { icon: '❌', color: theme_1.error },
213
+ warning: { icon: '⚠️', color: theme_1.warning },
214
+ info: { icon: 'ℹ️', color: (s) => s },
215
+ };
216
+ /**
217
+ * Render standardized result message with optional detail lines
218
+ */
219
+ function renderResult(type, message, details) {
220
+ const cfg = RESULT_CONFIG[type];
221
+ const lines = [`\n ${cfg.icon} ${cfg.color(message)}`];
222
+ if (details) {
223
+ for (const d of details) {
224
+ lines.push(` ${d}`);
225
+ }
226
+ }
227
+ lines.push('');
228
+ return lines.join('\n');
229
+ }
181
230
  // ─── Utilities ─────────────────────────────────────────────────────────────
182
231
  /**
183
232
  * Strip ANSI escape codes for width calculations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codymaster",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "34 Skills. Ship 10x faster. AI-powered coding skill kit for Claude, Cursor, Gemini & more.",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -12,7 +12,6 @@
12
12
  "url": "https://github.com/tody-agent/codymaster/issues"
13
13
  },
14
14
  "bin": {
15
- "CodyMaster": "dist/index.js",
16
15
  "cm": "dist/index.js",
17
16
  "codymaster": "dist/index.js"
18
17
  },
@@ -78,7 +78,7 @@ Per `_shared/helpers.md#Load-Working-Memory` — focus on known edge cases and p
78
78
 
79
79
  Write one minimal test showing what should happen.
80
80
 
81
- <Good>
81
+ ::: tip Good
82
82
  ```typescript
83
83
  test('retries failed operations 3 times', async () => {
84
84
  let attempts = 0;
@@ -95,9 +95,9 @@ test('retries failed operations 3 times', async () => {
95
95
  });
96
96
  ```
97
97
  Clear name, tests real behavior, one thing
98
- </Good>
98
+ :::
99
99
 
100
- <Bad>
100
+ ::: danger Bad
101
101
  ```typescript
102
102
  test('retry works', async () => {
103
103
  const mock = jest.fn()
@@ -109,7 +109,7 @@ test('retry works', async () => {
109
109
  });
110
110
  ```
111
111
  Vague name, tests mock not code
112
- </Bad>
112
+ :::
113
113
 
114
114
  **Requirements:**
115
115
  - One behavior
@@ -137,7 +137,7 @@ Confirm:
137
137
 
138
138
  Write simplest code to pass the test.
139
139
 
140
- <Good>
140
+ ::: tip Good
141
141
  ```typescript
142
142
  async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
143
143
  for (let i = 0; i < 3; i++) {
@@ -151,9 +151,9 @@ async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
151
151
  }
152
152
  ```
153
153
  Just enough to pass
154
- </Good>
154
+ :::
155
155
 
156
- <Bad>
156
+ ::: danger Bad
157
157
  ```typescript
158
158
  async function retryOperation<T>(
159
159
  fn: () => Promise<T>,
@@ -167,7 +167,7 @@ async function retryOperation<T>(
167
167
  }
168
168
  ```
169
169
  Over-engineered
170
- </Bad>
170
+ :::
171
171
 
172
172
  Don't add features, refactor other code, or "improve" beyond the test.
173
173