@compilr-dev/cli 0.6.6 → 0.7.1

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 (35) hide show
  1. package/dist/commands-v2/handlers/core.js +10 -1
  2. package/dist/commands-v2/handlers/index.d.ts +1 -0
  3. package/dist/commands-v2/handlers/index.js +3 -0
  4. package/dist/commands-v2/handlers/settings.js +21 -5
  5. package/dist/commands-v2/handlers/skill.d.ts +10 -0
  6. package/dist/commands-v2/handlers/skill.js +63 -0
  7. package/dist/commands-v2/index.d.ts +1 -1
  8. package/dist/commands-v2/index.js +1 -1
  9. package/dist/commands-v2/registry.d.ts +4 -0
  10. package/dist/commands-v2/registry.js +19 -0
  11. package/dist/compilr-diff-companion.vsix +0 -0
  12. package/dist/index.js +8 -12
  13. package/dist/repl-helpers.d.ts +29 -1
  14. package/dist/repl-helpers.js +77 -7
  15. package/dist/repl-v2.js +29 -3
  16. package/dist/tools/delegation-status.d.ts +3 -12
  17. package/dist/tools/delegation-status.js +4 -123
  18. package/dist/tools/handoff.d.ts +9 -17
  19. package/dist/tools/handoff.js +28 -48
  20. package/dist/ui/conversation.js +1 -2
  21. package/dist/ui/markdown-renderer.d.ts +43 -0
  22. package/dist/ui/markdown-renderer.js +474 -0
  23. package/dist/ui/overlay/impl/artifact-detail-overlay-v2.js +1 -2
  24. package/dist/ui/overlay/impl/document-detail-overlay-v2.js +1 -2
  25. package/dist/ui/overlay/impl/help-overlay-v2.d.ts +7 -1
  26. package/dist/ui/overlay/impl/help-overlay-v2.js +19 -2
  27. package/dist/ui/overlay/impl/skill-detail-overlay-v2.d.ts +91 -0
  28. package/dist/ui/overlay/impl/skill-detail-overlay-v2.js +863 -0
  29. package/dist/ui/overlay/impl/skill-editor-overlay.d.ts +56 -0
  30. package/dist/ui/overlay/impl/skill-editor-overlay.js +493 -0
  31. package/dist/ui/overlay/impl/skills-overlay-v2.d.ts +83 -0
  32. package/dist/ui/overlay/impl/skills-overlay-v2.js +1095 -0
  33. package/dist/utils/skill-paths.d.ts +21 -0
  34. package/dist/utils/skill-paths.js +44 -0
  35. package/package.json +9 -6
@@ -67,7 +67,7 @@ function setupAlternateScreenCleanup() {
67
67
  // Setup cleanup handlers once when module loads
68
68
  setupAlternateScreenCleanup();
69
69
  import { marked } from 'marked';
70
- import { markedTerminal } from 'marked-terminal';
70
+ import { markedTerminal } from '../../markdown-renderer.js';
71
71
  import { BaseOverlayV2 } from '../../base/overlay-base-v2.js';
72
72
  import { renderBorder, isCtrlC, isClose, isNavigateUp, isNavigateDown, isUpArrow, isDownArrow, isLeftArrow, isRightArrow, isHome, isEnd, isPageUp, isPageDown, isSpace, isBackspace, isDelete, isEnter, isTab, isEscape, isE, getPrintableChar, } from '../../base/index.js';
73
73
  import { documentRepository } from '../../../db/repositories/document-repository.js';
@@ -236,7 +236,6 @@ function postProcessInlineFormatting(text) {
236
236
  function renderMarkdownSync(content, termWidth) {
237
237
  const preprocessed = preprocessMarkdown(content);
238
238
  const options = getThemedMarkedOptions(termWidth);
239
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
240
239
  marked.use(markedTerminal(options));
241
240
  const rendered = marked.parse(preprocessed, { async: false });
242
241
  const postProcessed = postProcessInlineFormatting(rendered);
@@ -32,11 +32,17 @@ export interface HelpOverlayV2Options {
32
32
  }[];
33
33
  /** Get detailed info for a single command. */
34
34
  getCommand: (name: string) => CommandDetail | undefined;
35
+ /** Get custom skill and binding entries for the help list. */
36
+ getSkillEntries?: () => {
37
+ command: string;
38
+ description: string;
39
+ isBinding: boolean;
40
+ }[];
35
41
  }
36
42
  interface HelpItem {
37
43
  name: string;
38
44
  description: string;
39
- type: 'builtin' | 'custom';
45
+ type: 'builtin' | 'custom' | 'skill' | 'binding';
40
46
  /** For custom commands */
41
47
  prompt?: string;
42
48
  location?: 'project' | 'personal';
@@ -242,6 +242,17 @@ export class HelpOverlayV2 extends TabbedListOverlayV2 {
242
242
  location: cmd.location,
243
243
  });
244
244
  }
245
+ // Add custom skills and bindings
246
+ if (options.getSkillEntries) {
247
+ for (const entry of options.getSkillEntries()) {
248
+ items.push({
249
+ name: `/${entry.command}`,
250
+ description: entry.description,
251
+ type: entry.isBinding ? 'binding' : 'skill',
252
+ commandName: entry.command,
253
+ });
254
+ }
255
+ }
245
256
  super({
246
257
  title: VERSION,
247
258
  tabs: TABS,
@@ -253,7 +264,7 @@ export class HelpOverlayV2 extends TabbedListOverlayV2 {
253
264
  if (tabId === 'builtin')
254
265
  return item.type === 'builtin';
255
266
  if (tabId === 'custom')
256
- return item.type === 'custom';
267
+ return item.type === 'custom' || item.type === 'skill' || item.type === 'binding';
257
268
  return true;
258
269
  },
259
270
  getSearchText: (item) => `${item.name} ${item.description}`,
@@ -263,7 +274,13 @@ export class HelpOverlayV2 extends TabbedListOverlayV2 {
263
274
  ? styles.primary(item.name.padEnd(20))
264
275
  : styles.muted(item.name.padEnd(20));
265
276
  const desc = styles.muted(item.description);
266
- const badge = item.type === 'custom' ? styles.muted(' (custom)') : '';
277
+ let badge = '';
278
+ if (item.type === 'custom')
279
+ badge = styles.muted(' (custom)');
280
+ else if (item.type === 'skill')
281
+ badge = styles.secondary(' (skill)');
282
+ else if (item.type === 'binding')
283
+ badge = styles.secondary(' (binding)');
267
284
  return prefix + name + desc + badge;
268
285
  },
269
286
  footerHints: (searchMode) => {
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Skill Detail Overlay V2
3
+ *
4
+ * Fullscreen SKILL.md viewer AND editor with vim-style navigation.
5
+ * Copied from DocumentDetailOverlayV2 — adapted for file-based skills.
6
+ *
7
+ * Modes:
8
+ * - View: rendered markdown, scrollable (j/k, g/G, PgUp/PgDn)
9
+ * - Edit: raw markdown editing with cursor, line numbers, syntax highlighting
10
+ * - Diff: side-by-side diff against upstream SDK version (forked skills only)
11
+ *
12
+ * Features:
13
+ * - Full-screen viewing with markdown rendering
14
+ * - Vim-style navigation
15
+ * - Edit mode with raw markdown editing
16
+ * - Save to disk (Ctrl+S) with validation warnings
17
+ * - Dirty check with save prompt on exit
18
+ * - Diff view for forked skills (D key)
19
+ */
20
+ import { BaseOverlayV2 } from '../../base/overlay-base-v2.js';
21
+ import type { RenderContext, OverlayAction, KeyEvent } from '../types.js';
22
+ import { type ForkedFromMarker, type SkillDiffLine } from '@compilr-dev/sdk';
23
+ type SkillDetailMode = 'view' | 'edit' | 'diff';
24
+ interface SkillDetailState {
25
+ mode: SkillDetailMode;
26
+ contentLines: string[];
27
+ scrollOffset: number;
28
+ rawLines: string[];
29
+ cursorLine: number;
30
+ cursorColumn: number;
31
+ editScrollOffset: number;
32
+ isDirty: boolean;
33
+ originalContent: string;
34
+ showSavePrompt: boolean;
35
+ saveMessage: string | null;
36
+ diffLines: SkillDiffLine[] | null;
37
+ diffScrollOffset: number;
38
+ skillName: string;
39
+ scope: string;
40
+ forkedFrom: ForkedFromMarker | null;
41
+ boundCommands: string[];
42
+ validationWarnings: string[];
43
+ }
44
+ export interface SkillDetailResult {
45
+ /** Whether to go back to the list */
46
+ goBack: boolean;
47
+ /** Whether content was modified (caller should reload) */
48
+ modified: boolean;
49
+ }
50
+ export declare class SkillDetailOverlayV2 extends BaseOverlayV2<SkillDetailState, SkillDetailResult> {
51
+ readonly type: "inline";
52
+ readonly id = "skill-detail-overlay-v2";
53
+ readonly usesAlternateScreen = true;
54
+ private readonly filePath;
55
+ constructor(options: {
56
+ filePath: string;
57
+ skillName: string;
58
+ scope: string;
59
+ content: string;
60
+ forkedFrom?: ForkedFromMarker;
61
+ boundCommands?: string[];
62
+ });
63
+ onMount(): void;
64
+ onUnmount(): void;
65
+ protected renderContent(context: RenderContext): string[];
66
+ private renderViewMode;
67
+ private renderEditMode;
68
+ private renderLineWithCursor;
69
+ private ensureCursorVisible;
70
+ private renderDiffMode;
71
+ handleKey(key: KeyEvent): OverlayAction<SkillDetailResult>;
72
+ private handleViewModeKey;
73
+ private handleDiffModeKey;
74
+ private handleEditModeKey;
75
+ private handleSavePromptKey;
76
+ private moveCursorUp;
77
+ private moveCursorDown;
78
+ private moveCursorLeft;
79
+ private moveCursorRight;
80
+ private clampCursorColumn;
81
+ private getCurrentLine;
82
+ private insertText;
83
+ private handleBackspace;
84
+ private handleDeleteKey;
85
+ private handleEnter;
86
+ private saveSkill;
87
+ private exitEditMode;
88
+ private closeWith;
89
+ private renderAction;
90
+ }
91
+ export {};