@compilr-dev/cli 0.4.0 → 0.5.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.
- package/README.md +30 -12
- package/dist/agent.d.ts +74 -1
- package/dist/agent.js +259 -76
- package/dist/anchors/index.d.ts +9 -0
- package/dist/anchors/index.js +9 -0
- package/dist/anchors/project-anchors.d.ts +79 -0
- package/dist/anchors/project-anchors.js +202 -0
- package/dist/commands/handler-types.d.ts +68 -0
- package/dist/commands/handler-types.js +8 -0
- package/dist/commands/handlers/agent-commands.d.ts +13 -0
- package/dist/commands/handlers/agent-commands.js +305 -0
- package/dist/commands/handlers/design-commands.d.ts +15 -0
- package/dist/commands/handlers/design-commands.js +334 -0
- package/dist/commands/handlers/index.d.ts +20 -0
- package/dist/commands/handlers/index.js +43 -0
- package/dist/commands/handlers/overlay-commands.d.ts +21 -0
- package/dist/commands/handlers/overlay-commands.js +287 -0
- package/dist/commands/handlers/project-commands.d.ts +11 -0
- package/dist/commands/handlers/project-commands.js +167 -0
- package/dist/commands/handlers/simple-commands.d.ts +19 -0
- package/dist/commands/handlers/simple-commands.js +144 -0
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/registry.d.ts +50 -0
- package/dist/commands/registry.js +75 -0
- package/dist/commands-v2/handlers/context.d.ts +13 -0
- package/dist/commands-v2/handlers/context.js +348 -0
- package/dist/commands-v2/handlers/core.d.ts +13 -0
- package/dist/commands-v2/handlers/core.js +165 -0
- package/dist/commands-v2/handlers/debug.d.ts +11 -0
- package/dist/commands-v2/handlers/debug.js +159 -0
- package/dist/commands-v2/handlers/index.d.ts +12 -0
- package/dist/commands-v2/handlers/index.js +24 -0
- package/dist/commands-v2/handlers/project.d.ts +22 -0
- package/dist/commands-v2/handlers/project.js +814 -0
- package/dist/commands-v2/handlers/settings.d.ts +15 -0
- package/dist/commands-v2/handlers/settings.js +235 -0
- package/dist/commands-v2/index.d.ts +13 -0
- package/dist/commands-v2/index.js +15 -0
- package/dist/commands-v2/registry.d.ts +37 -0
- package/dist/commands-v2/registry.js +80 -0
- package/dist/commands-v2/types.d.ts +75 -0
- package/dist/commands-v2/types.js +7 -0
- package/dist/commands.js +110 -7
- package/dist/index.js +288 -29
- package/dist/input-handlers/index.d.ts +7 -0
- package/dist/input-handlers/index.js +7 -0
- package/dist/input-handlers/memory-handler.d.ts +26 -0
- package/dist/input-handlers/memory-handler.js +68 -0
- package/dist/repl-helpers.d.ts +63 -0
- package/dist/repl-helpers.js +318 -0
- package/dist/repl-v2.d.ts +155 -0
- package/dist/repl-v2.js +774 -0
- package/dist/repl.d.ts +32 -4
- package/dist/repl.js +250 -977
- package/dist/settings/index.d.ts +23 -0
- package/dist/settings/index.js +48 -0
- package/dist/settings/paths.d.ts +110 -0
- package/dist/settings/paths.js +264 -0
- package/dist/templates/compilr-md.js +7 -4
- package/dist/templates/index.js +3 -4
- package/dist/themes/colors.js +3 -1
- package/dist/themes/registry.d.ts +5 -36
- package/dist/themes/registry.js +11 -95
- package/dist/themes/types.d.ts +3 -38
- package/dist/themes/types.js +2 -2
- package/dist/tools/anchor-tools.d.ts +31 -0
- package/dist/tools/anchor-tools.js +255 -0
- package/dist/tools/backlog-wrappers.d.ts +54 -0
- package/dist/tools/backlog-wrappers.js +338 -0
- package/dist/tools/backlog.js +1 -1
- package/dist/tools/db-tools.d.ts +65 -0
- package/dist/tools/db-tools.js +19 -0
- package/dist/tools/document-db.d.ts +43 -0
- package/dist/tools/document-db.js +220 -0
- package/dist/tools/project-db.d.ts +102 -0
- package/dist/tools/project-db.js +370 -0
- package/dist/tools/workitem-db.d.ts +103 -0
- package/dist/tools/workitem-db.js +549 -0
- package/dist/tools.js +13 -3
- package/dist/ui/agents-overlay-v2.d.ts +43 -0
- package/dist/ui/agents-overlay-v2.js +809 -0
- package/dist/ui/agents-overlay.d.ts +5 -5
- package/dist/ui/agents-overlay.js +782 -420
- package/dist/ui/anchors-overlay.d.ts +12 -0
- package/dist/ui/anchors-overlay.js +775 -0
- package/dist/ui/arch-type-overlay.d.ts +1 -6
- package/dist/ui/arch-type-overlay.js +175 -203
- package/dist/ui/ask-user-overlay-v2.d.ts +26 -0
- package/dist/ui/ask-user-overlay-v2.js +555 -0
- package/dist/ui/ask-user-overlay.d.ts +2 -2
- package/dist/ui/ask-user-overlay.js +443 -535
- package/dist/ui/ask-user-simple-overlay-v2.d.ts +25 -0
- package/dist/ui/ask-user-simple-overlay-v2.js +215 -0
- package/dist/ui/ask-user-simple-overlay.d.ts +2 -2
- package/dist/ui/ask-user-simple-overlay.js +182 -209
- package/dist/ui/backlog-overlay.d.ts +16 -1
- package/dist/ui/backlog-overlay.js +525 -659
- package/dist/ui/base/index.d.ts +26 -0
- package/dist/ui/base/index.js +33 -0
- package/dist/ui/base/inline-overlay-utils.d.ts +217 -0
- package/dist/ui/base/inline-overlay-utils.js +320 -0
- package/dist/ui/base/inline-overlay.d.ts +159 -0
- package/dist/ui/base/inline-overlay.js +257 -0
- package/dist/ui/base/key-utils.d.ts +15 -0
- package/dist/ui/base/key-utils.js +30 -0
- package/dist/ui/base/overlay-base-v2.d.ts +193 -0
- package/dist/ui/base/overlay-base-v2.js +246 -0
- package/dist/ui/base/overlay-base.d.ts +156 -0
- package/dist/ui/base/overlay-base.js +238 -0
- package/dist/ui/base/overlay-lifecycle.d.ts +65 -0
- package/dist/ui/base/overlay-lifecycle.js +159 -0
- package/dist/ui/base/overlay-types.d.ts +185 -0
- package/dist/ui/base/overlay-types.js +7 -0
- package/dist/ui/base/render-utils.d.ts +8 -0
- package/dist/ui/base/render-utils.js +11 -0
- package/dist/ui/base/screen-stack.d.ts +148 -0
- package/dist/ui/base/screen-stack.js +184 -0
- package/dist/ui/base/tabbed-list-overlay-v2.d.ts +103 -0
- package/dist/ui/base/tabbed-list-overlay-v2.js +317 -0
- package/dist/ui/base/tabbed-list-overlay.d.ts +153 -0
- package/dist/ui/base/tabbed-list-overlay.js +369 -0
- package/dist/ui/commands-overlay-v2.d.ts +33 -0
- package/dist/ui/commands-overlay-v2.js +441 -0
- package/dist/ui/commands-overlay.d.ts +7 -2
- package/dist/ui/commands-overlay.js +384 -355
- package/dist/ui/config-overlay.d.ts +5 -4
- package/dist/ui/config-overlay.js +243 -513
- package/dist/ui/conversation.d.ts +75 -4
- package/dist/ui/conversation.js +374 -161
- package/dist/ui/docs-overlay.d.ts +17 -0
- package/dist/ui/docs-overlay.js +303 -0
- package/dist/ui/ephemeral.d.ts +1 -1
- package/dist/ui/ephemeral.js +1 -1
- package/dist/ui/features/index.d.ts +34 -0
- package/dist/ui/features/index.js +34 -0
- package/dist/ui/features/input-feature.d.ts +85 -0
- package/dist/ui/features/input-feature.js +238 -0
- package/dist/ui/features/list-feature.d.ts +155 -0
- package/dist/ui/features/list-feature.js +244 -0
- package/dist/ui/features/pagination-feature.d.ts +154 -0
- package/dist/ui/features/pagination-feature.js +238 -0
- package/dist/ui/features/search-feature.d.ts +148 -0
- package/dist/ui/features/search-feature.js +185 -0
- package/dist/ui/features/tab-feature.d.ts +194 -0
- package/dist/ui/features/tab-feature.js +307 -0
- package/dist/ui/footer-v2.d.ts +222 -0
- package/dist/ui/footer-v2.js +1349 -0
- package/dist/ui/footer.d.ts +107 -0
- package/dist/ui/footer.js +359 -67
- package/dist/ui/guardrail-overlay.d.ts +29 -0
- package/dist/ui/guardrail-overlay.js +145 -0
- package/dist/ui/help-overlay-v2.d.ts +34 -0
- package/dist/ui/help-overlay-v2.js +309 -0
- package/dist/ui/help-overlay.d.ts +16 -0
- package/dist/ui/help-overlay.js +316 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -3
- package/dist/ui/init-overlay-v2.d.ts +34 -0
- package/dist/ui/init-overlay-v2.js +600 -0
- package/dist/ui/init-overlay.d.ts +12 -2
- package/dist/ui/init-overlay.js +349 -270
- package/dist/ui/input-prompt-v2.d.ts +1 -0
- package/dist/ui/input-prompt-v2.js +14 -6
- package/dist/ui/input-prompt.d.ts +116 -33
- package/dist/ui/input-prompt.js +536 -337
- package/dist/ui/iteration-limit-overlay-v2.d.ts +21 -0
- package/dist/ui/iteration-limit-overlay-v2.js +114 -0
- package/dist/ui/iteration-limit-overlay.d.ts +2 -2
- package/dist/ui/iteration-limit-overlay.js +92 -128
- package/dist/ui/keys-overlay-v2.d.ts +41 -0
- package/dist/ui/keys-overlay-v2.js +248 -0
- package/dist/ui/keys-overlay.d.ts +1 -0
- package/dist/ui/keys-overlay.js +203 -141
- package/dist/ui/line-utils.d.ts +88 -0
- package/dist/ui/line-utils.js +150 -0
- package/dist/ui/live-region.d.ts +161 -0
- package/dist/ui/live-region.js +387 -0
- package/dist/ui/mascot/expressions.d.ts +32 -0
- package/dist/ui/mascot/expressions.js +213 -0
- package/dist/ui/mascot/index.d.ts +8 -0
- package/dist/ui/mascot/index.js +8 -0
- package/dist/ui/mascot/renderer.d.ts +19 -0
- package/dist/ui/mascot/renderer.js +97 -0
- package/dist/ui/mascot-overlay-v2.d.ts +41 -0
- package/dist/ui/mascot-overlay-v2.js +138 -0
- package/dist/ui/mascot-overlay.d.ts +21 -0
- package/dist/ui/mascot-overlay.js +146 -0
- package/dist/ui/model-overlay-v2.d.ts +49 -0
- package/dist/ui/model-overlay-v2.js +118 -0
- package/dist/ui/model-overlay.d.ts +27 -0
- package/dist/ui/model-overlay.js +221 -0
- package/dist/ui/model-warning-overlay.js +3 -5
- package/dist/ui/new-overlay.d.ts +34 -0
- package/dist/ui/new-overlay.js +604 -0
- package/dist/ui/overlay/impl/agents-overlay-v2.d.ts +45 -0
- package/dist/ui/overlay/impl/agents-overlay-v2.js +825 -0
- package/dist/ui/overlay/impl/anchors-overlay-v2.d.ts +47 -0
- package/dist/ui/overlay/impl/anchors-overlay-v2.js +783 -0
- package/dist/ui/overlay/impl/arch-type-overlay-v2.d.ts +37 -0
- package/dist/ui/overlay/impl/arch-type-overlay-v2.js +240 -0
- package/dist/ui/overlay/impl/ask-user-overlay-v2.d.ts +72 -0
- package/dist/ui/overlay/impl/ask-user-overlay-v2.js +584 -0
- package/dist/ui/overlay/impl/ask-user-simple-overlay-v2.d.ts +46 -0
- package/dist/ui/overlay/impl/ask-user-simple-overlay-v2.js +204 -0
- package/dist/ui/overlay/impl/backlog-overlay-v2.d.ts +49 -0
- package/dist/ui/overlay/impl/backlog-overlay-v2.js +642 -0
- package/dist/ui/overlay/impl/commands-overlay-v2.d.ts +33 -0
- package/dist/ui/overlay/impl/commands-overlay-v2.js +441 -0
- package/dist/ui/overlay/impl/config-overlay-v2.d.ts +100 -0
- package/dist/ui/overlay/impl/config-overlay-v2.js +654 -0
- package/dist/ui/overlay/impl/dashboard-overlay-v2.d.ts +55 -0
- package/dist/ui/overlay/impl/dashboard-overlay-v2.js +359 -0
- package/dist/ui/overlay/impl/docs-overlay-v2.d.ts +45 -0
- package/dist/ui/overlay/impl/docs-overlay-v2.js +114 -0
- package/dist/ui/overlay/impl/document-detail-overlay-v2.d.ts +77 -0
- package/dist/ui/overlay/impl/document-detail-overlay-v2.js +1071 -0
- package/dist/ui/overlay/impl/guardrail-overlay-v2.d.ts +43 -0
- package/dist/ui/overlay/impl/guardrail-overlay-v2.js +114 -0
- package/dist/ui/overlay/impl/help-overlay-v2.d.ts +34 -0
- package/dist/ui/overlay/impl/help-overlay-v2.js +309 -0
- package/dist/ui/overlay/impl/init-overlay-v2.d.ts +77 -0
- package/dist/ui/overlay/impl/init-overlay-v2.js +593 -0
- package/dist/ui/overlay/impl/init-setup-overlay-v2.d.ts +25 -0
- package/dist/ui/overlay/impl/init-setup-overlay-v2.js +97 -0
- package/dist/ui/overlay/impl/iteration-limit-overlay-v2.d.ts +35 -0
- package/dist/ui/overlay/impl/iteration-limit-overlay-v2.js +105 -0
- package/dist/ui/overlay/impl/keys-overlay-v2.d.ts +41 -0
- package/dist/ui/overlay/impl/keys-overlay-v2.js +248 -0
- package/dist/ui/overlay/impl/mascot-overlay-v2.d.ts +41 -0
- package/dist/ui/overlay/impl/mascot-overlay-v2.js +138 -0
- package/dist/ui/overlay/impl/model-overlay-v2.d.ts +49 -0
- package/dist/ui/overlay/impl/model-overlay-v2.js +118 -0
- package/dist/ui/overlay/impl/model-warning-overlay-v2.d.ts +46 -0
- package/dist/ui/overlay/impl/model-warning-overlay-v2.js +132 -0
- package/dist/ui/overlay/impl/new-overlay-v2.d.ts +77 -0
- package/dist/ui/overlay/impl/new-overlay-v2.js +593 -0
- package/dist/ui/overlay/impl/permission-overlay-v2.d.ts +36 -0
- package/dist/ui/overlay/impl/permission-overlay-v2.js +380 -0
- package/dist/ui/overlay/impl/projects-overlay-v2.d.ts +36 -0
- package/dist/ui/overlay/impl/projects-overlay-v2.js +499 -0
- package/dist/ui/overlay/impl/theme-overlay-v2.d.ts +42 -0
- package/dist/ui/overlay/impl/theme-overlay-v2.js +135 -0
- package/dist/ui/overlay/impl/tools-overlay-v2.d.ts +47 -0
- package/dist/ui/overlay/impl/tools-overlay-v2.js +218 -0
- package/dist/ui/overlay/impl/tutorial-overlay-v2.d.ts +31 -0
- package/dist/ui/overlay/impl/tutorial-overlay-v2.js +1035 -0
- package/dist/ui/overlay/impl/workflow-overlay-v2.d.ts +80 -0
- package/dist/ui/overlay/impl/workflow-overlay-v2.js +637 -0
- package/dist/ui/overlay/index.d.ts +33 -0
- package/dist/ui/overlay/index.js +35 -0
- package/dist/ui/overlay/key-utils.d.ts +6 -0
- package/dist/ui/overlay/key-utils.js +6 -0
- package/dist/ui/overlay/overlay-types.d.ts +128 -0
- package/dist/ui/overlay/overlay-types.js +22 -0
- package/dist/ui/overlay/types.d.ts +135 -0
- package/dist/ui/overlay/types.js +22 -0
- package/dist/ui/overlays/help-overlay-v2.d.ts +28 -0
- package/dist/ui/overlays/help-overlay-v2.js +198 -0
- package/dist/ui/overlays/index.d.ts +11 -0
- package/dist/ui/overlays/index.js +11 -0
- package/dist/ui/overlays.d.ts +0 -4
- package/dist/ui/overlays.js +0 -444
- package/dist/ui/permission-overlay-v2.d.ts +36 -0
- package/dist/ui/permission-overlay-v2.js +380 -0
- package/dist/ui/permission-overlay.d.ts +1 -1
- package/dist/ui/permission-overlay.js +186 -298
- package/dist/ui/projects-overlay.d.ts +19 -0
- package/dist/ui/projects-overlay.js +484 -0
- package/dist/ui/providers/types.d.ts +178 -0
- package/dist/ui/providers/types.js +9 -0
- package/dist/ui/render-modes.d.ts +36 -0
- package/dist/ui/render-modes.js +44 -0
- package/dist/ui/startup-menu.d.ts +36 -0
- package/dist/ui/startup-menu.js +236 -0
- package/dist/ui/subagent-renderer.d.ts +117 -0
- package/dist/ui/subagent-renderer.js +334 -0
- package/dist/ui/terminal-codes.d.ts +94 -0
- package/dist/ui/terminal-codes.js +124 -0
- package/dist/ui/terminal-renderer.d.ts +221 -0
- package/dist/ui/terminal-renderer.js +751 -0
- package/dist/ui/terminal-ui.d.ts +463 -0
- package/dist/ui/terminal-ui.js +2296 -0
- package/dist/ui/terminal.d.ts +20 -0
- package/dist/ui/terminal.js +72 -0
- package/dist/ui/theme-overlay-v2.d.ts +42 -0
- package/dist/ui/theme-overlay-v2.js +135 -0
- package/dist/ui/theme-overlay.d.ts +24 -0
- package/dist/ui/theme-overlay.js +127 -0
- package/dist/ui/todo-zone.js +53 -25
- package/dist/ui/tool-formatters.d.ts +16 -0
- package/dist/ui/tool-formatters.js +516 -0
- package/dist/ui/tools-overlay-v2.d.ts +47 -0
- package/dist/ui/tools-overlay-v2.js +218 -0
- package/dist/ui/tools-overlay.d.ts +10 -2
- package/dist/ui/tools-overlay.js +172 -220
- package/dist/ui/tutorial-overlay-v2.d.ts +31 -0
- package/dist/ui/tutorial-overlay-v2.js +1035 -0
- package/dist/ui/tutorial-overlay.d.ts +1 -0
- package/dist/ui/tutorial-overlay.js +400 -302
- package/dist/ui/workflow-overlay.d.ts +22 -0
- package/dist/ui/workflow-overlay.js +636 -0
- package/dist/utils/debug-log.d.ts +28 -0
- package/dist/utils/debug-log.js +57 -0
- package/dist/utils/model-tiers.js +1 -1
- package/dist/utils/path-safety.d.ts +56 -0
- package/dist/utils/path-safety.js +239 -0
- package/dist/workflow/guided-mode-injector.d.ts +42 -0
- package/dist/workflow/guided-mode-injector.js +191 -0
- package/dist/workflow/index.d.ts +8 -0
- package/dist/workflow/index.js +8 -0
- package/dist/workflow/step-criteria.d.ts +62 -0
- package/dist/workflow/step-criteria.js +150 -0
- package/dist/workflow/step-tracker.d.ts +92 -0
- package/dist/workflow/step-tracker.js +141 -0
- package/package.json +12 -5
package/dist/themes/registry.js
CHANGED
|
@@ -1,108 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme Registry
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Re-exports theme query functions from @compilr-dev/editor-core/themes.
|
|
5
|
+
* CLI-specific persistence in ~/.compilr-dev/settings.json
|
|
6
6
|
*/
|
|
7
7
|
import * as fs from 'fs';
|
|
8
8
|
import * as path from 'path';
|
|
9
9
|
import * as os from 'os';
|
|
10
10
|
// =============================================================================
|
|
11
|
+
// Re-export theme query functions from editor-core
|
|
12
|
+
// =============================================================================
|
|
13
|
+
export { getAllThemes, getCuratedThemes, getThemeById, searchThemes, filterThemesByType, searchAndFilterThemes, getThemeStats as getThemeCount, } from '@compilr-dev/editor-core/themes';
|
|
14
|
+
import { getAllThemes, getThemeById, DEFAULT_THEME_ID, } from '@compilr-dev/editor-core/themes';
|
|
15
|
+
// =============================================================================
|
|
11
16
|
// Constants
|
|
12
17
|
// =============================================================================
|
|
13
18
|
const CONFIG_DIR = path.join(os.homedir(), '.compilr-dev');
|
|
14
19
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'settings.json');
|
|
15
|
-
const DEFAULT_THEME =
|
|
16
|
-
// =============================================================================
|
|
17
|
-
// Theme Data (loaded once)
|
|
18
|
-
// =============================================================================
|
|
19
|
-
// Load themes from JSON file
|
|
20
|
-
// Resolve path relative to this file's location (works in both src and dist)
|
|
21
|
-
import { fileURLToPath } from 'url';
|
|
22
|
-
import { dirname } from 'path';
|
|
23
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
24
|
-
const __dirname = dirname(__filename);
|
|
25
|
-
// Try multiple possible locations for themes.json
|
|
26
|
-
function loadThemes() {
|
|
27
|
-
const possiblePaths = [
|
|
28
|
-
path.join(__dirname, '../data/themes.json'), // dist/themes -> dist/data
|
|
29
|
-
path.join(__dirname, '../../src/data/themes.json'), // dist/themes -> src/data
|
|
30
|
-
path.join(__dirname, '../../data/themes.json'), // src/themes -> data (if running from src)
|
|
31
|
-
];
|
|
32
|
-
for (const themePath of possiblePaths) {
|
|
33
|
-
if (fs.existsSync(themePath)) {
|
|
34
|
-
const data = fs.readFileSync(themePath, 'utf-8');
|
|
35
|
-
return JSON.parse(data);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
throw new Error(`themes.json not found. Tried: ${possiblePaths.join(', ')}`);
|
|
39
|
-
}
|
|
40
|
-
const themesData = loadThemes();
|
|
41
|
-
// =============================================================================
|
|
42
|
-
// Theme Query Functions
|
|
43
|
-
// =============================================================================
|
|
44
|
-
/**
|
|
45
|
-
* Get all available themes
|
|
46
|
-
*/
|
|
47
|
-
export function getAllThemes() {
|
|
48
|
-
return themesData;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get curated/featured themes
|
|
52
|
-
*/
|
|
53
|
-
export function getCuratedThemes() {
|
|
54
|
-
return themesData.filter((t) => t.curated);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get theme by ID
|
|
58
|
-
*/
|
|
59
|
-
export function getThemeById(id) {
|
|
60
|
-
return themesData.find((t) => t.id === id);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Search themes by name (case-insensitive)
|
|
64
|
-
*/
|
|
65
|
-
export function searchThemes(query) {
|
|
66
|
-
if (!query.trim())
|
|
67
|
-
return themesData;
|
|
68
|
-
const lower = query.toLowerCase();
|
|
69
|
-
return themesData.filter((t) => t.name.toLowerCase().includes(lower));
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Filter themes by type
|
|
73
|
-
*/
|
|
74
|
-
export function filterThemesByType(type) {
|
|
75
|
-
if (type === 'all')
|
|
76
|
-
return themesData;
|
|
77
|
-
return themesData.filter((t) => t.type === type);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Search and filter themes
|
|
81
|
-
*/
|
|
82
|
-
export function searchAndFilterThemes(query, type) {
|
|
83
|
-
let results = themesData;
|
|
84
|
-
// Apply type filter
|
|
85
|
-
if (type !== 'all') {
|
|
86
|
-
results = results.filter((t) => t.type === type);
|
|
87
|
-
}
|
|
88
|
-
// Apply search
|
|
89
|
-
if (query.trim()) {
|
|
90
|
-
const lower = query.toLowerCase();
|
|
91
|
-
results = results.filter((t) => t.name.toLowerCase().includes(lower));
|
|
92
|
-
}
|
|
93
|
-
return results;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Get theme count
|
|
97
|
-
*/
|
|
98
|
-
export function getThemeCount() {
|
|
99
|
-
return {
|
|
100
|
-
total: themesData.length,
|
|
101
|
-
dark: themesData.filter((t) => t.type === 'dark').length,
|
|
102
|
-
light: themesData.filter((t) => t.type === 'light').length,
|
|
103
|
-
curated: themesData.filter((t) => t.curated).length,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
20
|
+
const DEFAULT_THEME = DEFAULT_THEME_ID;
|
|
106
21
|
/**
|
|
107
22
|
* Load settings from config file
|
|
108
23
|
*/
|
|
@@ -172,8 +87,9 @@ export function getCurrentTheme() {
|
|
|
172
87
|
return defaultTheme;
|
|
173
88
|
}
|
|
174
89
|
// Ultimate fallback - first theme in list
|
|
175
|
-
|
|
176
|
-
|
|
90
|
+
const allThemes = getAllThemes();
|
|
91
|
+
currentThemeCache = allThemes[0];
|
|
92
|
+
return allThemes[0];
|
|
177
93
|
}
|
|
178
94
|
/**
|
|
179
95
|
* Set current theme
|
package/dist/themes/types.d.ts
CHANGED
|
@@ -1,45 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme Types
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Re-exports core types from @compilr-dev/editor-core/themes.
|
|
5
|
+
* CLI-specific types (ThemeConfig, ThemeStyleFunctions) defined here.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
/** Unique identifier (e.g., "compilr-dark", "dracula") */
|
|
9
|
-
id: string;
|
|
10
|
-
/** Display name (e.g., "compilr.dev Dark", "Dracula") */
|
|
11
|
-
name: string;
|
|
12
|
-
/** Theme type */
|
|
13
|
-
type: 'dark' | 'light';
|
|
14
|
-
/** Source of the theme (e.g., "custom", "ghostty") */
|
|
15
|
-
source: string;
|
|
16
|
-
/** Theme author */
|
|
17
|
-
author?: string;
|
|
18
|
-
/** Color palette */
|
|
19
|
-
colors: ThemeColors;
|
|
20
|
-
/** Whether this is a curated/featured theme */
|
|
21
|
-
curated?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface ThemeColors {
|
|
24
|
-
/** Background color (e.g., "#0A0A0A") */
|
|
25
|
-
background: string;
|
|
26
|
-
/** Foreground/text color (e.g., "#FAFAFA") */
|
|
27
|
-
foreground: string;
|
|
28
|
-
/** Primary accent color (e.g., "#FF5722") */
|
|
29
|
-
primary: string;
|
|
30
|
-
/** Secondary accent color */
|
|
31
|
-
secondary?: string;
|
|
32
|
-
/** Border color */
|
|
33
|
-
border: string;
|
|
34
|
-
/** Card/panel background color */
|
|
35
|
-
card?: string;
|
|
36
|
-
/** Muted/dim text color */
|
|
37
|
-
muted: string;
|
|
38
|
-
/** Selection highlight color */
|
|
39
|
-
selection: string;
|
|
40
|
-
/** Cursor color */
|
|
41
|
-
cursor: string;
|
|
42
|
-
}
|
|
7
|
+
export type { Theme, ThemeColors } from '@compilr-dev/editor-core/themes';
|
|
43
8
|
export interface ThemeConfig {
|
|
44
9
|
/** Currently selected theme ID */
|
|
45
10
|
currentTheme: string;
|
package/dist/themes/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme Types
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Re-exports core types from @compilr-dev/editor-core/themes.
|
|
5
|
+
* CLI-specific types (ThemeConfig, ThemeStyleFunctions) defined here.
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchor Tools - Agent tools for managing anchors
|
|
3
|
+
*
|
|
4
|
+
* Provides anchor_add and anchor_remove tools that allow
|
|
5
|
+
* the agent to add critical context that survives compaction.
|
|
6
|
+
*/
|
|
7
|
+
interface AnchorAddInput {
|
|
8
|
+
/** The anchor content - critical information to preserve */
|
|
9
|
+
content: string;
|
|
10
|
+
/** Priority level: 'critical' | 'safety' | 'info' (default: 'info') */
|
|
11
|
+
priority?: 'critical' | 'safety' | 'info';
|
|
12
|
+
/** Scope: 'global' or 'project' (default: 'project' if active project, else 'global') */
|
|
13
|
+
scope?: 'global' | 'project';
|
|
14
|
+
/** Tags for categorization */
|
|
15
|
+
tags?: string[];
|
|
16
|
+
}
|
|
17
|
+
interface AnchorRemoveInput {
|
|
18
|
+
/** ID of the anchor to remove */
|
|
19
|
+
id: string;
|
|
20
|
+
}
|
|
21
|
+
interface AnchorListInput {
|
|
22
|
+
/** Filter by scope: 'global' | 'project' | 'all' (default: 'all') */
|
|
23
|
+
scope?: 'global' | 'project' | 'all';
|
|
24
|
+
/** Filter by priority */
|
|
25
|
+
priority?: 'critical' | 'safety' | 'info';
|
|
26
|
+
}
|
|
27
|
+
export declare const anchorAddTool: import("@compilr-dev/agents").Tool<AnchorAddInput>;
|
|
28
|
+
export declare const anchorRemoveTool: import("@compilr-dev/agents").Tool<AnchorRemoveInput>;
|
|
29
|
+
export declare const anchorListTool: import("@compilr-dev/agents").Tool<AnchorListInput>;
|
|
30
|
+
export declare const allAnchorTools: (import("@compilr-dev/agents").Tool<AnchorAddInput> | import("@compilr-dev/agents").Tool<AnchorRemoveInput>)[];
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchor Tools - Agent tools for managing anchors
|
|
3
|
+
*
|
|
4
|
+
* Provides anchor_add and anchor_remove tools that allow
|
|
5
|
+
* the agent to add critical context that survives compaction.
|
|
6
|
+
*/
|
|
7
|
+
import { defineTool } from '@compilr-dev/agents';
|
|
8
|
+
import { getGlobalAnchorManager, getAnchorManager, } from '../anchors/index.js';
|
|
9
|
+
import { getActiveProject } from './project-db.js';
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// anchor_add Tool
|
|
12
|
+
// =============================================================================
|
|
13
|
+
export const anchorAddTool = defineTool({
|
|
14
|
+
name: 'anchor_add',
|
|
15
|
+
description: 'Add critical information that must survive context compaction. ' +
|
|
16
|
+
'Use this for: project context, important decisions, user preferences, ' +
|
|
17
|
+
'architectural constraints, or any information that should persist across the entire conversation. ' +
|
|
18
|
+
'Anchors are always included at the top of the context window.',
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {
|
|
22
|
+
content: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'The critical information to preserve. Keep it concise but complete.',
|
|
25
|
+
},
|
|
26
|
+
priority: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
enum: ['critical', 'safety', 'info'],
|
|
29
|
+
description: 'Priority level. "critical" for must-never-forget info (user preferences, key constraints), ' +
|
|
30
|
+
'"safety" for safety-related context, "info" for general helpful context.',
|
|
31
|
+
},
|
|
32
|
+
scope: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
enum: ['global', 'project'],
|
|
35
|
+
description: 'Scope for the anchor. "global" persists across all projects, ' +
|
|
36
|
+
'"project" is specific to the current project (requires active project).',
|
|
37
|
+
},
|
|
38
|
+
tags: {
|
|
39
|
+
type: 'array',
|
|
40
|
+
items: { type: 'string' },
|
|
41
|
+
description: 'Optional tags for categorization (e.g., ["architecture", "decision"])',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: ['content'],
|
|
45
|
+
},
|
|
46
|
+
execute: (input) => {
|
|
47
|
+
try {
|
|
48
|
+
// Validate content
|
|
49
|
+
if (!input.content || input.content.trim().length === 0) {
|
|
50
|
+
return Promise.resolve({
|
|
51
|
+
success: false,
|
|
52
|
+
error: 'Anchor content is required and cannot be empty',
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const content = input.content.trim();
|
|
56
|
+
const priority = input.priority ?? 'info';
|
|
57
|
+
const activeProject = getActiveProject();
|
|
58
|
+
// Determine scope
|
|
59
|
+
let scope = input.scope;
|
|
60
|
+
if (!scope) {
|
|
61
|
+
scope = activeProject ? 'project' : 'global';
|
|
62
|
+
}
|
|
63
|
+
// Validate project scope
|
|
64
|
+
if (scope === 'project' && !activeProject) {
|
|
65
|
+
return Promise.resolve({
|
|
66
|
+
success: false,
|
|
67
|
+
error: 'Cannot add project-scoped anchor: no active project. Use scope: "global" instead.',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// Get project ID for project-scoped anchors (validated above that activeProject exists)
|
|
71
|
+
const projectId = scope === 'project' && activeProject
|
|
72
|
+
? String(activeProject.id)
|
|
73
|
+
: undefined;
|
|
74
|
+
// Get the appropriate manager
|
|
75
|
+
const manager = scope === 'global'
|
|
76
|
+
? getGlobalAnchorManager()
|
|
77
|
+
: getAnchorManager(projectId ?? '');
|
|
78
|
+
// Add the anchor
|
|
79
|
+
const anchor = manager.add({
|
|
80
|
+
content,
|
|
81
|
+
priority,
|
|
82
|
+
scope: 'persistent', // Anchors persist across sessions
|
|
83
|
+
tags: input.tags,
|
|
84
|
+
projectId,
|
|
85
|
+
});
|
|
86
|
+
return Promise.resolve({
|
|
87
|
+
success: true,
|
|
88
|
+
result: {
|
|
89
|
+
id: anchor.id,
|
|
90
|
+
content: anchor.content,
|
|
91
|
+
priority: anchor.priority,
|
|
92
|
+
scope: scope,
|
|
93
|
+
tags: anchor.tags,
|
|
94
|
+
message: `Anchor added successfully (${scope} scope, ${priority} priority)`,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
return Promise.resolve({
|
|
100
|
+
success: false,
|
|
101
|
+
error: `Failed to add anchor: ${err instanceof Error ? err.message : String(err)}`,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
// =============================================================================
|
|
107
|
+
// anchor_remove Tool
|
|
108
|
+
// =============================================================================
|
|
109
|
+
export const anchorRemoveTool = defineTool({
|
|
110
|
+
name: 'anchor_remove',
|
|
111
|
+
description: 'Remove an anchor by its ID. Use this to clean up outdated or no longer relevant anchors. ' +
|
|
112
|
+
'Use anchor_list first to see available anchors and their IDs.',
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: {
|
|
116
|
+
id: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
description: 'The ID of the anchor to remove',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
required: ['id'],
|
|
122
|
+
},
|
|
123
|
+
execute: (input) => {
|
|
124
|
+
try {
|
|
125
|
+
if (!input.id || input.id.trim().length === 0) {
|
|
126
|
+
return Promise.resolve({
|
|
127
|
+
success: false,
|
|
128
|
+
error: 'Anchor ID is required',
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
const id = input.id.trim();
|
|
132
|
+
const activeProject = getActiveProject();
|
|
133
|
+
// Try to remove from project anchors first, then global
|
|
134
|
+
let removed = false;
|
|
135
|
+
let scope = 'unknown';
|
|
136
|
+
if (activeProject) {
|
|
137
|
+
const projectManager = getAnchorManager(String(activeProject.id));
|
|
138
|
+
if (projectManager.has(id)) {
|
|
139
|
+
removed = projectManager.remove(id);
|
|
140
|
+
scope = 'project';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (!removed) {
|
|
144
|
+
const globalManager = getGlobalAnchorManager();
|
|
145
|
+
if (globalManager.has(id)) {
|
|
146
|
+
removed = globalManager.remove(id);
|
|
147
|
+
scope = 'global';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (!removed) {
|
|
151
|
+
return Promise.resolve({
|
|
152
|
+
success: false,
|
|
153
|
+
error: `Anchor with ID "${id}" not found`,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return Promise.resolve({
|
|
157
|
+
success: true,
|
|
158
|
+
result: {
|
|
159
|
+
id,
|
|
160
|
+
scope,
|
|
161
|
+
message: `Anchor removed successfully (was ${scope} scope)`,
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
return Promise.resolve({
|
|
167
|
+
success: false,
|
|
168
|
+
error: `Failed to remove anchor: ${err instanceof Error ? err.message : String(err)}`,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
// =============================================================================
|
|
174
|
+
// anchor_list Tool
|
|
175
|
+
// =============================================================================
|
|
176
|
+
export const anchorListTool = defineTool({
|
|
177
|
+
name: 'anchor_list',
|
|
178
|
+
description: 'List all anchors. Returns anchor IDs, content, priority, and scope. ' +
|
|
179
|
+
'Use this to see what persistent context is available before adding or removing anchors.',
|
|
180
|
+
inputSchema: {
|
|
181
|
+
type: 'object',
|
|
182
|
+
properties: {
|
|
183
|
+
scope: {
|
|
184
|
+
type: 'string',
|
|
185
|
+
enum: ['global', 'project', 'all'],
|
|
186
|
+
description: 'Filter by scope: "global", "project", or "all" (default: "all")',
|
|
187
|
+
},
|
|
188
|
+
priority: {
|
|
189
|
+
type: 'string',
|
|
190
|
+
enum: ['critical', 'safety', 'info'],
|
|
191
|
+
description: 'Filter by priority level',
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
execute: (input) => {
|
|
196
|
+
try {
|
|
197
|
+
const activeProject = getActiveProject();
|
|
198
|
+
const scope = input.scope ?? 'all';
|
|
199
|
+
const anchors = [];
|
|
200
|
+
// Collect global anchors
|
|
201
|
+
if (scope === 'global' || scope === 'all') {
|
|
202
|
+
const globalManager = getGlobalAnchorManager();
|
|
203
|
+
const globalAnchors = globalManager.getAll({ priority: input.priority });
|
|
204
|
+
for (const anchor of globalAnchors) {
|
|
205
|
+
anchors.push({
|
|
206
|
+
id: anchor.id,
|
|
207
|
+
content: anchor.content,
|
|
208
|
+
priority: anchor.priority,
|
|
209
|
+
scope: 'global',
|
|
210
|
+
tags: anchor.tags,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// Collect project anchors
|
|
215
|
+
if ((scope === 'project' || scope === 'all') && activeProject) {
|
|
216
|
+
const projectManager = getAnchorManager(String(activeProject.id));
|
|
217
|
+
const projectAnchors = projectManager.getAll({ priority: input.priority });
|
|
218
|
+
for (const anchor of projectAnchors) {
|
|
219
|
+
anchors.push({
|
|
220
|
+
id: anchor.id,
|
|
221
|
+
content: anchor.content,
|
|
222
|
+
priority: anchor.priority,
|
|
223
|
+
scope: 'project',
|
|
224
|
+
tags: anchor.tags,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// Sort by priority (critical first)
|
|
229
|
+
const priorityOrder = { critical: 0, safety: 1, info: 2 };
|
|
230
|
+
anchors.sort((a, b) => {
|
|
231
|
+
const pa = priorityOrder[a.priority] ?? 2;
|
|
232
|
+
const pb = priorityOrder[b.priority] ?? 2;
|
|
233
|
+
return pa - pb;
|
|
234
|
+
});
|
|
235
|
+
return Promise.resolve({
|
|
236
|
+
success: true,
|
|
237
|
+
result: {
|
|
238
|
+
count: anchors.length,
|
|
239
|
+
activeProject: activeProject?.displayName ?? null,
|
|
240
|
+
anchors,
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
return Promise.resolve({
|
|
246
|
+
success: false,
|
|
247
|
+
error: `Failed to list anchors: ${err instanceof Error ? err.message : String(err)}`,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
// =============================================================================
|
|
253
|
+
// Export all anchor tools
|
|
254
|
+
// =============================================================================
|
|
255
|
+
export const allAnchorTools = [anchorAddTool, anchorRemoveTool, anchorListTool];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backlog Tool Wrappers
|
|
3
|
+
*
|
|
4
|
+
* These wrappers provide `backlog_read` and `backlog_write` tools that skills expect,
|
|
5
|
+
* but internally delegate to the `workitem_*` database tools.
|
|
6
|
+
*
|
|
7
|
+
* This allows library skills (which reference backlog_*) to work seamlessly
|
|
8
|
+
* with the CLI's database-backed workitem system.
|
|
9
|
+
*/
|
|
10
|
+
interface BacklogReadInput {
|
|
11
|
+
/** Get a specific item by ID */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** Filter by status */
|
|
14
|
+
status?: 'backlog' | 'in-progress' | 'done' | 'blocked';
|
|
15
|
+
/** Filter by type */
|
|
16
|
+
type?: 'feature' | 'bug' | 'chore' | 'spike';
|
|
17
|
+
/** Filter by priority */
|
|
18
|
+
priority?: 'critical' | 'high' | 'medium' | 'low';
|
|
19
|
+
/** Search in title and description */
|
|
20
|
+
search?: string;
|
|
21
|
+
/** Maximum items to return (default: 20) */
|
|
22
|
+
limit?: number;
|
|
23
|
+
}
|
|
24
|
+
export declare const backlogReadTool: import("@compilr-dev/agents").Tool<BacklogReadInput>;
|
|
25
|
+
interface BacklogWriteInput {
|
|
26
|
+
/** Action to perform */
|
|
27
|
+
action: 'add' | 'update' | 'delete' | 'replace';
|
|
28
|
+
/** Item to add or update (required for add/update) */
|
|
29
|
+
item?: {
|
|
30
|
+
id?: string;
|
|
31
|
+
type?: 'feature' | 'bug' | 'chore' | 'spike';
|
|
32
|
+
title?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
status?: 'backlog' | 'in-progress' | 'done' | 'blocked';
|
|
35
|
+
priority?: 'critical' | 'high' | 'medium' | 'low';
|
|
36
|
+
};
|
|
37
|
+
/** Item ID to delete (required for delete) */
|
|
38
|
+
deleteId?: string;
|
|
39
|
+
/** Full list of items (required for replace action) */
|
|
40
|
+
items?: Array<{
|
|
41
|
+
id?: string;
|
|
42
|
+
type: 'feature' | 'bug' | 'chore' | 'spike';
|
|
43
|
+
title: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
status?: 'backlog' | 'in-progress' | 'done' | 'blocked';
|
|
46
|
+
priority?: 'critical' | 'high' | 'medium' | 'low';
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
export declare const backlogWriteTool: import("@compilr-dev/agents").Tool<BacklogWriteInput>;
|
|
50
|
+
/**
|
|
51
|
+
* All backlog wrapper tools
|
|
52
|
+
*/
|
|
53
|
+
export declare const backlogWrapperTools: (import("@compilr-dev/agents").Tool<BacklogReadInput> | import("@compilr-dev/agents").Tool<BacklogWriteInput>)[];
|
|
54
|
+
export {};
|