@compilr-dev/cli 0.6.0 → 0.6.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.
- package/dist/.tsbuildinfo.app +1 -1
- package/dist/.tsbuildinfo.data +1 -1
- package/dist/.tsbuildinfo.domain +1 -1
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +66 -1
- package/dist/commands-v2/handlers/project.d.ts +1 -0
- package/dist/commands-v2/handlers/project.js +36 -2
- package/dist/commands-v2/handlers/team.js +23 -3
- package/dist/compilr-diff-companion.vsix +0 -0
- package/dist/entitlements/index.d.ts +23 -0
- package/dist/entitlements/index.js +110 -0
- package/dist/guide/cli-guide-entries.d.ts +15 -0
- package/dist/guide/cli-guide-entries.js +99 -0
- package/dist/guide/index.d.ts +5 -4
- package/dist/guide/index.js +4 -3
- package/dist/guide/shared-content.js +188 -21
- package/dist/handlers/permission-handler.js +10 -3
- package/dist/index.js +18 -0
- package/dist/repl-v2.d.ts +16 -0
- package/dist/repl-v2.js +51 -17
- package/dist/tools/db-tools.d.ts +1 -1
- package/dist/tools/platform-adapter.d.ts +1 -1
- package/dist/tools/platform-adapter.js +6 -1
- package/dist/tools.js +6 -1
- package/dist/ui/overlay/impl/app-model-overlay-v2.d.ts +57 -0
- package/dist/ui/overlay/impl/app-model-overlay-v2.js +232 -0
- package/dist/ui/overlay/impl/custom-agent-form-overlay-v2.d.ts +23 -1
- package/dist/ui/overlay/impl/custom-agent-form-overlay-v2.js +203 -47
- package/dist/ui/overlay/impl/model-overlay-v2.js +2 -2
- package/dist/ui/overlay/impl/new-overlay-v2.d.ts +2 -2
- package/dist/ui/overlay/impl/new-overlay-v2.js +10 -17
- package/dist/ui/overlay/impl/team-overlay-v2.js +2 -2
- package/dist/ui/overlay/index.d.ts +1 -0
- package/dist/ui/overlay/index.js +1 -0
- package/package.json +4 -4
|
@@ -10,17 +10,8 @@
|
|
|
10
10
|
import { BaseOverlayV2, renderBorder, wrapText } from '../../base/index.js';
|
|
11
11
|
import { validateAgentId, isAgentIdTaken, PREDEFINED_ROLE_IDS, TOOL_GROUPS, PROFILE_INFO, getGroupsByTier, createDefaultToolConfig, getToolsForProfile, getDefinedSkillNames, checkSkillCompatibility, getSkillsByCategory, } from '@compilr-dev/sdk';
|
|
12
12
|
import { MODEL_TIERS, TIER_INFO } from '../../../models/index.js';
|
|
13
|
-
// Profile list for selection
|
|
14
|
-
const PROFILE_LIST =
|
|
15
|
-
'full',
|
|
16
|
-
'read-only',
|
|
17
|
-
'developer',
|
|
18
|
-
'security',
|
|
19
|
-
'docs',
|
|
20
|
-
'devops',
|
|
21
|
-
'qa',
|
|
22
|
-
'custom',
|
|
23
|
-
];
|
|
13
|
+
// Profile list for selection — derived from SDK's PROFILE_INFO
|
|
14
|
+
const PROFILE_LIST = Object.keys(PROFILE_INFO);
|
|
24
15
|
// =============================================================================
|
|
25
16
|
// Overlay Implementation
|
|
26
17
|
// =============================================================================
|
|
@@ -29,6 +20,7 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
29
20
|
id = 'custom-agent-form-overlay-v2';
|
|
30
21
|
existingCustomAgents;
|
|
31
22
|
teamAgentIds;
|
|
23
|
+
templates;
|
|
32
24
|
constructor(options) {
|
|
33
25
|
const fields = [
|
|
34
26
|
{
|
|
@@ -64,11 +56,12 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
64
56
|
value: '',
|
|
65
57
|
},
|
|
66
58
|
];
|
|
59
|
+
const hasTemplates = (options.templates?.length ?? 0) > 0;
|
|
67
60
|
super({
|
|
68
61
|
fields,
|
|
69
62
|
activeFieldIndex: 0,
|
|
70
63
|
cursorPos: 0,
|
|
71
|
-
currentStep: 'basic',
|
|
64
|
+
currentStep: hasTemplates ? 'template-select' : 'basic',
|
|
72
65
|
selectedProfile: 'full',
|
|
73
66
|
customGroups: new Set(),
|
|
74
67
|
profileListIndex: 0,
|
|
@@ -78,13 +71,20 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
78
71
|
skillListIndex: 0,
|
|
79
72
|
selectedModelTier: 'balanced',
|
|
80
73
|
tierListIndex: 1, // Default to balanced (index 1)
|
|
74
|
+
templateListIndex: 0,
|
|
75
|
+
systemPromptAddition: '',
|
|
76
|
+
saveAsTemplate: false,
|
|
77
|
+
templateName: '',
|
|
81
78
|
});
|
|
82
79
|
this.existingCustomAgents = options.existingCustomAgents;
|
|
83
80
|
this.teamAgentIds = options.teamAgentIds;
|
|
81
|
+
this.templates = options.templates ?? [];
|
|
84
82
|
this.minHeight = 25;
|
|
85
83
|
}
|
|
86
84
|
renderContent(context) {
|
|
87
85
|
switch (this.state.currentStep) {
|
|
86
|
+
case 'template-select':
|
|
87
|
+
return this.renderTemplateSelectStep(context);
|
|
88
88
|
case 'basic':
|
|
89
89
|
return this.renderBasicStep(context);
|
|
90
90
|
case 'tools':
|
|
@@ -93,17 +93,101 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
93
93
|
return this.renderSkillsStep(context);
|
|
94
94
|
case 'tier':
|
|
95
95
|
return this.renderTierStep(context);
|
|
96
|
+
case 'prompt':
|
|
97
|
+
return this.renderPromptStep(context);
|
|
96
98
|
default:
|
|
97
99
|
return this.renderBasicStep(context);
|
|
98
100
|
}
|
|
99
101
|
}
|
|
102
|
+
// ── Step 0: Template Selection ─────────────────────────────────────────
|
|
103
|
+
renderTemplateSelectStep(context) {
|
|
104
|
+
const s = context.styles;
|
|
105
|
+
const border = renderBorder(context.width, s);
|
|
106
|
+
const lines = [];
|
|
107
|
+
lines.push(border);
|
|
108
|
+
lines.push(` ${s.primaryBold('Create Custom Agent')}`);
|
|
109
|
+
lines.push(border);
|
|
110
|
+
lines.push('');
|
|
111
|
+
lines.push(` ${s.muted('Choose a starting point:')}`);
|
|
112
|
+
lines.push('');
|
|
113
|
+
// Item 0: "New from scratch"
|
|
114
|
+
const scratchSelected = this.state.templateListIndex === 0;
|
|
115
|
+
const scratchMarker = scratchSelected ? s.primary('›') : ' ';
|
|
116
|
+
lines.push(` ${scratchMarker} ${scratchSelected ? s.primaryBold('New from scratch') : 'New from scratch'}`);
|
|
117
|
+
lines.push(` ${s.muted('Define name, specialty, tools, and instructions')}`);
|
|
118
|
+
lines.push('');
|
|
119
|
+
// Template items
|
|
120
|
+
for (let i = 0; i < this.templates.length; i++) {
|
|
121
|
+
const tmpl = this.templates[i];
|
|
122
|
+
const isSelected = this.state.templateListIndex === i + 1;
|
|
123
|
+
const marker = isSelected ? s.primary('›') : ' ';
|
|
124
|
+
const nameStyle = isSelected ? s.primaryBold : s.secondary;
|
|
125
|
+
lines.push(` ${marker} ${nameStyle(tmpl.name)}`);
|
|
126
|
+
lines.push(` ${s.muted(tmpl.specialty)}`);
|
|
127
|
+
if (isSelected && tmpl.personality) {
|
|
128
|
+
lines.push(` ${s.muted('Personality:')} ${s.secondary(tmpl.personality)}`);
|
|
129
|
+
}
|
|
130
|
+
if (isSelected && tmpl.systemPromptAddition) {
|
|
131
|
+
const preview = tmpl.systemPromptAddition.length > 80
|
|
132
|
+
? tmpl.systemPromptAddition.slice(0, 80) + '...'
|
|
133
|
+
: tmpl.systemPromptAddition;
|
|
134
|
+
lines.push(` ${s.muted('Instructions:')} ${s.secondary(preview)}`);
|
|
135
|
+
}
|
|
136
|
+
lines.push('');
|
|
137
|
+
}
|
|
138
|
+
lines.push(border);
|
|
139
|
+
lines.push(s.muted(' ↑/↓ Navigate Enter Select Esc Cancel'));
|
|
140
|
+
lines.push(border);
|
|
141
|
+
return lines;
|
|
142
|
+
}
|
|
143
|
+
handleTemplateSelectKey(key) {
|
|
144
|
+
const totalItems = 1 + this.templates.length; // "New from scratch" + templates
|
|
145
|
+
if (key.name === 'up') {
|
|
146
|
+
if (this.state.templateListIndex > 0) {
|
|
147
|
+
this.state.templateListIndex--;
|
|
148
|
+
}
|
|
149
|
+
return this.rerender();
|
|
150
|
+
}
|
|
151
|
+
if (key.name === 'down') {
|
|
152
|
+
if (this.state.templateListIndex < totalItems - 1) {
|
|
153
|
+
this.state.templateListIndex++;
|
|
154
|
+
}
|
|
155
|
+
return this.rerender();
|
|
156
|
+
}
|
|
157
|
+
if (key.name === 'return') {
|
|
158
|
+
if (this.state.templateListIndex === 0) {
|
|
159
|
+
// "New from scratch" — go to basic step
|
|
160
|
+
this.state.currentStep = 'basic';
|
|
161
|
+
return this.rerender();
|
|
162
|
+
}
|
|
163
|
+
// Template selected — pre-fill fields and go to basic step
|
|
164
|
+
const tmpl = this.templates[this.state.templateListIndex - 1];
|
|
165
|
+
const setField = (id, value) => {
|
|
166
|
+
const f = this.state.fields.find((fld) => fld.id === id);
|
|
167
|
+
if (f)
|
|
168
|
+
f.value = value;
|
|
169
|
+
};
|
|
170
|
+
setField('displayName', tmpl.displayName);
|
|
171
|
+
setField('specialty', tmpl.specialty);
|
|
172
|
+
if (tmpl.personality)
|
|
173
|
+
setField('personality', tmpl.personality);
|
|
174
|
+
this.state.systemPromptAddition = tmpl.systemPromptAddition ?? '';
|
|
175
|
+
this.state.currentStep = 'basic';
|
|
176
|
+
return this.rerender();
|
|
177
|
+
}
|
|
178
|
+
if (key.name === 'escape') {
|
|
179
|
+
return this.close({ cancelled: true });
|
|
180
|
+
}
|
|
181
|
+
return this.noAction();
|
|
182
|
+
}
|
|
183
|
+
// ── Step 1: Basic Info ────────────────────────────────────────────────
|
|
100
184
|
renderBasicStep(context) {
|
|
101
185
|
const s = context.styles;
|
|
102
186
|
const lines = [];
|
|
103
187
|
const border = renderBorder(context.width, s);
|
|
104
188
|
// Header with step indicator
|
|
105
189
|
lines.push(border);
|
|
106
|
-
lines.push(` ${s.primaryBold('Create Custom Agent')} ${s.muted('- Step 1/
|
|
190
|
+
lines.push(` ${s.primaryBold('Create Custom Agent')} ${s.muted('- Step 1/5: Basic Info')}`);
|
|
107
191
|
lines.push(border);
|
|
108
192
|
lines.push('');
|
|
109
193
|
// Render each field
|
|
@@ -155,7 +239,7 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
155
239
|
const border = renderBorder(context.width, s);
|
|
156
240
|
// Header
|
|
157
241
|
lines.push(border);
|
|
158
|
-
lines.push(` ${s.primaryBold('Create Custom Agent')} ${s.muted('- Step 2/
|
|
242
|
+
lines.push(` ${s.primaryBold('Create Custom Agent')} ${s.muted('- Step 2/5: Tool Profile')}`);
|
|
159
243
|
lines.push(border);
|
|
160
244
|
lines.push('');
|
|
161
245
|
if (!this.state.inGroupSelection) {
|
|
@@ -224,7 +308,7 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
224
308
|
const border = renderBorder(context.width, s);
|
|
225
309
|
// Header
|
|
226
310
|
lines.push(border);
|
|
227
|
-
lines.push(` ${s.primaryBold('Create Custom Agent')} ${s.muted('- Step 3/
|
|
311
|
+
lines.push(` ${s.primaryBold('Create Custom Agent')} ${s.muted('- Step 3/5: Skills')}`);
|
|
228
312
|
lines.push(border);
|
|
229
313
|
lines.push('');
|
|
230
314
|
lines.push(` ${s.primary('Select skills to enable:')}`);
|
|
@@ -242,13 +326,12 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
242
326
|
const isEnabled = this.state.enabledSkills.has(skillName);
|
|
243
327
|
const isCompatible = compatibility.compatible;
|
|
244
328
|
const marker = isEnabled ? s.success('[x]') : '[ ]';
|
|
245
|
-
const labelStyle = isSelected
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
? s.error(` (needs: ${compatibility.missingRequired.slice(0, 2).join(', ')}...)`)
|
|
329
|
+
const labelStyle = isSelected ? s.primaryBold : s.secondary;
|
|
330
|
+
// Soft warning for incompatible skills (not blocking)
|
|
331
|
+
const warningBadge = !isCompatible
|
|
332
|
+
? s.warning(` ⚠ may need: ${compatibility.missingRequired.slice(0, 2).join(', ')}${compatibility.missingRequired.length > 2 ? '...' : ''}`)
|
|
250
333
|
: '';
|
|
251
|
-
lines.push(` ${marker} ${labelStyle(skillName)}${
|
|
334
|
+
lines.push(` ${marker} ${labelStyle(skillName)}${warningBadge}`);
|
|
252
335
|
globalIndex++;
|
|
253
336
|
}
|
|
254
337
|
lines.push('');
|
|
@@ -271,6 +354,8 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
271
354
|
return this.close({ cancelled: true });
|
|
272
355
|
}
|
|
273
356
|
switch (this.state.currentStep) {
|
|
357
|
+
case 'template-select':
|
|
358
|
+
return this.handleTemplateSelectKey(key);
|
|
274
359
|
case 'basic':
|
|
275
360
|
return this.handleBasicStepKey(key);
|
|
276
361
|
case 'tools':
|
|
@@ -279,6 +364,8 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
279
364
|
return this.handleSkillsStepKey(key);
|
|
280
365
|
case 'tier':
|
|
281
366
|
return this.handleTierStepKey(key);
|
|
367
|
+
case 'prompt':
|
|
368
|
+
return this.handlePromptStepKey(key);
|
|
282
369
|
default:
|
|
283
370
|
return this.noAction();
|
|
284
371
|
}
|
|
@@ -354,9 +441,9 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
354
441
|
if (field.value.length >= field.maxLength) {
|
|
355
442
|
return this.noAction();
|
|
356
443
|
}
|
|
357
|
-
// For agentId field, only allow lowercase letters, numbers, underscore
|
|
444
|
+
// For agentId field, only allow lowercase letters, numbers, underscore, dash
|
|
358
445
|
if (field.id === 'agentId') {
|
|
359
|
-
if (!/^[a-z0-9_]$/.test(key.char)) {
|
|
446
|
+
if (!/^[a-z0-9_-]$/.test(key.char)) {
|
|
360
447
|
// Auto-convert uppercase to lowercase
|
|
361
448
|
if (/^[A-Z]$/.test(key.char)) {
|
|
362
449
|
field.value = field.value.slice(0, this.state.cursorPos) + key.char.toLowerCase() + field.value.slice(this.state.cursorPos);
|
|
@@ -480,38 +567,27 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
480
567
|
if (key.name === 'space') {
|
|
481
568
|
const flatSkills = Object.values(getSkillsByCategory()).flat();
|
|
482
569
|
const skillName = flatSkills[this.state.skillListIndex];
|
|
483
|
-
//
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
else {
|
|
491
|
-
this.state.enabledSkills.add(skillName);
|
|
492
|
-
}
|
|
570
|
+
// Allow toggling regardless of compatibility (soft warning only)
|
|
571
|
+
if (this.state.enabledSkills.has(skillName)) {
|
|
572
|
+
this.state.enabledSkills.delete(skillName);
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
this.state.enabledSkills.add(skillName);
|
|
493
576
|
}
|
|
494
577
|
return this.rerender();
|
|
495
578
|
}
|
|
496
|
-
// 'a' - toggle all
|
|
579
|
+
// 'a' - toggle all skills
|
|
497
580
|
if (key.char === 'a') {
|
|
498
581
|
const flatSkills = Object.values(getSkillsByCategory()).flat();
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
const compatibility = checkSkillCompatibility(skillName, availableTools);
|
|
502
|
-
return !compatibility.compatible || this.state.enabledSkills.has(skillName);
|
|
503
|
-
});
|
|
504
|
-
if (allCompatibleEnabled) {
|
|
582
|
+
const allEnabled = flatSkills.every(skillName => this.state.enabledSkills.has(skillName));
|
|
583
|
+
if (allEnabled) {
|
|
505
584
|
// Clear all
|
|
506
585
|
this.state.enabledSkills.clear();
|
|
507
586
|
}
|
|
508
587
|
else {
|
|
509
|
-
// Enable all
|
|
588
|
+
// Enable all
|
|
510
589
|
for (const skillName of flatSkills) {
|
|
511
|
-
|
|
512
|
-
if (compatibility.compatible) {
|
|
513
|
-
this.state.enabledSkills.add(skillName);
|
|
514
|
-
}
|
|
590
|
+
this.state.enabledSkills.add(skillName);
|
|
515
591
|
}
|
|
516
592
|
}
|
|
517
593
|
return this.rerender();
|
|
@@ -529,7 +605,7 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
529
605
|
const border = renderBorder(context.width, s);
|
|
530
606
|
// Header
|
|
531
607
|
lines.push(border);
|
|
532
|
-
lines.push(` ${s.primaryBold('Create Custom Agent')} ${s.muted('- Step 4/
|
|
608
|
+
lines.push(` ${s.primaryBold('Create Custom Agent')} ${s.muted('- Step 4/5: Model Tier')}`);
|
|
533
609
|
lines.push(border);
|
|
534
610
|
lines.push('');
|
|
535
611
|
lines.push(` ${s.primary('Select the default model tier for this agent:')}`);
|
|
@@ -553,7 +629,7 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
553
629
|
}
|
|
554
630
|
lines.push('');
|
|
555
631
|
lines.push(border);
|
|
556
|
-
lines.push(s.muted(' ↑/↓ Navigate Enter
|
|
632
|
+
lines.push(s.muted(' ↑/↓ Navigate Enter Next ← Back Esc Cancel'));
|
|
557
633
|
lines.push(border);
|
|
558
634
|
return lines;
|
|
559
635
|
}
|
|
@@ -583,9 +659,86 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
583
659
|
this.state.selectedModelTier = MODEL_TIERS[this.state.tierListIndex];
|
|
584
660
|
return this.rerender();
|
|
585
661
|
}
|
|
662
|
+
if (key.name === 'return') {
|
|
663
|
+
this.state.currentStep = 'prompt';
|
|
664
|
+
return this.rerender();
|
|
665
|
+
}
|
|
666
|
+
return this.noAction();
|
|
667
|
+
}
|
|
668
|
+
// ── Step 5: Custom Instructions ─────────────────────────────────────────
|
|
669
|
+
renderPromptStep(context) {
|
|
670
|
+
const s = context.styles;
|
|
671
|
+
const border = renderBorder(context.width, s);
|
|
672
|
+
const lines = [];
|
|
673
|
+
lines.push(border);
|
|
674
|
+
lines.push(s.primaryBold(' Step 5: Custom Instructions (optional)'));
|
|
675
|
+
lines.push('');
|
|
676
|
+
lines.push(s.muted(' Add domain-specific instructions for this agent.'));
|
|
677
|
+
lines.push(s.muted(' These are appended to the agent\'s system prompt.'));
|
|
678
|
+
lines.push(s.muted(` Max 2000 chars. Current: ${String(this.state.systemPromptAddition.length)}/2000`));
|
|
679
|
+
lines.push('');
|
|
680
|
+
// Show current text or placeholder
|
|
681
|
+
if (this.state.systemPromptAddition) {
|
|
682
|
+
const wrapped = wrapText(this.state.systemPromptAddition, context.width - 6);
|
|
683
|
+
for (const line of wrapped) {
|
|
684
|
+
lines.push(` ${s.secondary(line)}`);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
lines.push(s.muted(' (empty — press any key to type, or Enter to skip)'));
|
|
689
|
+
}
|
|
690
|
+
// Save as template toggle
|
|
691
|
+
lines.push('');
|
|
692
|
+
if (this.state.saveAsTemplate) {
|
|
693
|
+
lines.push(` ${s.success('●')} ${s.primary('Save as template:')} ${s.secondary(this.state.templateName || '(enter name)')}`);
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
lines.push(` ${s.muted('○')} ${s.muted('Press')} ${s.primary('Ctrl+T')} ${s.muted('to also save as template')}`);
|
|
697
|
+
}
|
|
698
|
+
lines.push('');
|
|
699
|
+
lines.push(border);
|
|
700
|
+
lines.push(s.muted(' Type to edit Enter Create Backspace Delete Ctrl+T Template ← Back Esc Cancel'));
|
|
701
|
+
lines.push(border);
|
|
702
|
+
return lines;
|
|
703
|
+
}
|
|
704
|
+
handlePromptStepKey(key) {
|
|
705
|
+
// Left arrow - go back to tier step
|
|
706
|
+
if (key.name === 'left') {
|
|
707
|
+
this.state.currentStep = 'tier';
|
|
708
|
+
return this.rerender();
|
|
709
|
+
}
|
|
710
|
+
// Ctrl+T - toggle save as template
|
|
711
|
+
if (key.ctrl && key.name === 't') {
|
|
712
|
+
this.state.saveAsTemplate = !this.state.saveAsTemplate;
|
|
713
|
+
if (this.state.saveAsTemplate && !this.state.templateName) {
|
|
714
|
+
// Default template name to display name from Step 1
|
|
715
|
+
const displayName = this.state.fields.find((f) => f.id === 'displayName')?.value.trim() ?? '';
|
|
716
|
+
this.state.templateName = displayName;
|
|
717
|
+
}
|
|
718
|
+
return this.rerender();
|
|
719
|
+
}
|
|
720
|
+
// Enter - submit (done)
|
|
586
721
|
if (key.name === 'return') {
|
|
587
722
|
return this.submit();
|
|
588
723
|
}
|
|
724
|
+
// Backspace - delete last char
|
|
725
|
+
if (key.name === 'backspace') {
|
|
726
|
+
if (this.state.systemPromptAddition.length > 0) {
|
|
727
|
+
this.state.systemPromptAddition = this.state.systemPromptAddition.slice(0, -1);
|
|
728
|
+
}
|
|
729
|
+
return this.rerender();
|
|
730
|
+
}
|
|
731
|
+
// Escape - cancel
|
|
732
|
+
if (key.name === 'escape') {
|
|
733
|
+
return this.close({ cancelled: true });
|
|
734
|
+
}
|
|
735
|
+
// Printable character — append (respect max length)
|
|
736
|
+
if (key.raw.length === 1 && key.raw[0] >= 32) {
|
|
737
|
+
if (this.state.systemPromptAddition.length < 2000) {
|
|
738
|
+
this.state.systemPromptAddition += String.fromCharCode(key.raw[0]);
|
|
739
|
+
}
|
|
740
|
+
return this.rerender();
|
|
741
|
+
}
|
|
589
742
|
return this.noAction();
|
|
590
743
|
}
|
|
591
744
|
nextField() {
|
|
@@ -663,6 +816,7 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
663
816
|
displayName: getFieldValue('displayName'),
|
|
664
817
|
specialty: getFieldValue('specialty'),
|
|
665
818
|
personality: getFieldValue('personality') || undefined,
|
|
819
|
+
systemPromptAddition: this.state.systemPromptAddition.trim() || undefined,
|
|
666
820
|
toolConfig: createDefaultToolConfig(),
|
|
667
821
|
enabledSkills: [],
|
|
668
822
|
modelTier: 'balanced', // Default tier
|
|
@@ -682,11 +836,13 @@ export class CustomAgentFormOverlayV2 extends BaseOverlayV2 {
|
|
|
682
836
|
}
|
|
683
837
|
return this.close({
|
|
684
838
|
cancelled: false,
|
|
839
|
+
saveAsTemplate: this.state.saveAsTemplate ? (this.state.templateName || getFieldValue('displayName')) : undefined,
|
|
685
840
|
agent: {
|
|
686
841
|
id: getFieldValue('agentId'),
|
|
687
842
|
displayName: getFieldValue('displayName'),
|
|
688
843
|
specialty: getFieldValue('specialty'),
|
|
689
844
|
personality: getFieldValue('personality') || undefined,
|
|
845
|
+
systemPromptAddition: this.state.systemPromptAddition.trim() || undefined,
|
|
690
846
|
toolConfig,
|
|
691
847
|
enabledSkills: Array.from(this.state.enabledSkills),
|
|
692
848
|
modelTier: this.state.selectedModelTier,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { TabbedListOverlayV2, BaseScreen, pushScreen, popScreen, closeOverlay, stay, renderBorder, } from '../../base/index.js';
|
|
17
17
|
import { getSetting, setSetting } from '../../../settings/index.js';
|
|
18
18
|
import { hasApiKey, settingsProviderToCredentialKey } from '../../../utils/credentials.js';
|
|
19
|
-
import { TIER_INFO, getModelForTier, setTierOverride, clearTierOverride, validateModel, checkApiKeyStatus, getDefaultModelForTier, getModelInfo, getOthersProviders, getModelsForOthersProvider, getModelsForProvider, PROVIDER_METADATA,
|
|
19
|
+
import { MODEL_TIERS, TIER_INFO, getModelForTier, setTierOverride, clearTierOverride, validateModel, checkApiKeyStatus, getDefaultModelForTier, getModelInfo, getOthersProviders, getModelsForOthersProvider, getModelsForProvider, PROVIDER_METADATA,
|
|
20
20
|
// Ollama auto-detection
|
|
21
21
|
listOllamaModels, } from '../../../models/index.js';
|
|
22
22
|
import { hasApiKey as hasApiKeyForProvider, getMaskedKey, setApiKey, } from '../../../utils/credentials.js';
|
|
@@ -39,7 +39,7 @@ const PROVIDER_TABS = [
|
|
|
39
39
|
{ id: 'others', label: 'Others' },
|
|
40
40
|
];
|
|
41
41
|
/** All model tiers in display order */
|
|
42
|
-
const ALL_TIERS = [
|
|
42
|
+
const ALL_TIERS = [...MODEL_TIERS];
|
|
43
43
|
/**
|
|
44
44
|
* Get list items - tier items for primary providers, provider items for Others.
|
|
45
45
|
*/
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* 0. Project type (new vs existing)
|
|
9
9
|
* 1. Project name
|
|
10
10
|
* 2. Description
|
|
11
|
-
* 3.
|
|
11
|
+
* 3. (removed — was repo pattern)
|
|
12
12
|
* 4. Tech stack
|
|
13
13
|
* 5. Coding standards
|
|
14
14
|
* 6. Initialize git?
|
|
15
|
-
* 7.
|
|
15
|
+
* 7. (removed — was workflow mode)
|
|
16
16
|
* 8. Confirmation
|
|
17
17
|
*
|
|
18
18
|
* Note: All projects are tracked in the database. File-based backlog was deprecated.
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* 0. Project type (new vs existing)
|
|
9
9
|
* 1. Project name
|
|
10
10
|
* 2. Description
|
|
11
|
-
* 3.
|
|
11
|
+
* 3. (removed — was repo pattern)
|
|
12
12
|
* 4. Tech stack
|
|
13
13
|
* 5. Coding standards
|
|
14
14
|
* 6. Initialize git?
|
|
15
|
-
* 7.
|
|
15
|
+
* 7. (removed — was workflow mode)
|
|
16
16
|
* 8. Confirmation
|
|
17
17
|
*
|
|
18
18
|
* Note: All projects are tracked in the database. File-based backlog was deprecated.
|
|
@@ -79,7 +79,7 @@ export class NewProjectOverlayV2 extends BaseOverlayV2 {
|
|
|
79
79
|
projectType: null,
|
|
80
80
|
projectName: '',
|
|
81
81
|
description: '',
|
|
82
|
-
repoPattern:
|
|
82
|
+
repoPattern: 'single', // Default — two-repo option removed
|
|
83
83
|
techStack: null,
|
|
84
84
|
codingStandards: null,
|
|
85
85
|
initGit: true,
|
|
@@ -366,18 +366,12 @@ export class NewProjectOverlayV2 extends BaseOverlayV2 {
|
|
|
366
366
|
lines.push('');
|
|
367
367
|
lines.push(` Project: ${s.primary(this.state.projectName)}`);
|
|
368
368
|
lines.push(` Location: ${s.primary('./' + this.state.projectName + '/')}`);
|
|
369
|
-
lines.push(` Structure: ${s.primary(this.state.repoPattern === 'single' ? 'Single repo' : 'Two repos')}`);
|
|
370
369
|
lines.push(` Tech: ${s.primary(this.state.techStack ? TECH_STACK_LABELS[this.state.techStack] : 'Not set')}`);
|
|
371
370
|
lines.push(` Standards: ${s.primary(this.state.codingStandards ? CODING_STANDARDS_LABELS[this.state.codingStandards] : 'Not set')}`);
|
|
372
371
|
lines.push(` Git: ${s.primary(this.state.initGit ? 'Yes' : 'No')}`);
|
|
373
372
|
if (this.state.gitRemote) {
|
|
374
373
|
lines.push(` Remote: ${s.primary(this.state.gitRemote)}`);
|
|
375
374
|
}
|
|
376
|
-
lines.push(` Workflow: ${s.primary(WORKFLOW_MODE_LABELS[this.state.workflowMode])}`);
|
|
377
|
-
if (this.state.repoPattern === 'two-repo') {
|
|
378
|
-
lines.push('');
|
|
379
|
-
lines.push(s.muted(` Docs repo: ./${this.state.projectName}-docs/`));
|
|
380
|
-
}
|
|
381
375
|
lines.push('');
|
|
382
376
|
if (this.state.error) {
|
|
383
377
|
lines.push(s.error(` ${this.state.error}`));
|
|
@@ -518,7 +512,6 @@ export class NewProjectOverlayV2 extends BaseOverlayV2 {
|
|
|
518
512
|
lines.push(` Framework: ${s.primary(getFrameworkLabel(detected.framework))}`);
|
|
519
513
|
}
|
|
520
514
|
lines.push(` Git Remote: ${s.primary(this.state.gitRemote || 'None')}`);
|
|
521
|
-
lines.push(` Workflow: ${s.primary(WORKFLOW_MODE_LABELS[this.state.workflowMode])}`);
|
|
522
515
|
lines.push('');
|
|
523
516
|
lines.push(chalk.bold(' Will create:'));
|
|
524
517
|
if (!detected?.hasCompilrMd && !detected?.hasClaudeMd) {
|
|
@@ -582,7 +575,7 @@ export class NewProjectOverlayV2 extends BaseOverlayV2 {
|
|
|
582
575
|
this.state.gitRemoteInputMode = false;
|
|
583
576
|
this.state.gitRemote = '';
|
|
584
577
|
this.state.inputBuffer = '';
|
|
585
|
-
this.state.step = 7
|
|
578
|
+
this.state.step = 8; // Skip step 7 (workflow mode removed — always flexible)
|
|
586
579
|
this.state.selectedIndex = 0;
|
|
587
580
|
return this.rerender();
|
|
588
581
|
}
|
|
@@ -732,7 +725,7 @@ export class NewProjectOverlayV2 extends BaseOverlayV2 {
|
|
|
732
725
|
this.state.gitRemote = this.state.inputBuffer.trim();
|
|
733
726
|
this.state.gitRemoteInputMode = false;
|
|
734
727
|
this.state.inputBuffer = '';
|
|
735
|
-
this.state.step = 7
|
|
728
|
+
this.state.step = 8; // Skip step 7 (workflow mode removed)
|
|
736
729
|
this.state.selectedIndex = 0;
|
|
737
730
|
return this.rerender();
|
|
738
731
|
}
|
|
@@ -1131,7 +1124,7 @@ export class NewProjectOverlayV2 extends BaseOverlayV2 {
|
|
|
1131
1124
|
break;
|
|
1132
1125
|
case 2:
|
|
1133
1126
|
this.state.description = this.state.inputBuffer.trim();
|
|
1134
|
-
this.state.step = 3
|
|
1127
|
+
this.state.step = 4; // Skip step 3 (repo pattern removed)
|
|
1135
1128
|
this.state.selectedIndex = 0;
|
|
1136
1129
|
break;
|
|
1137
1130
|
case 3:
|
|
@@ -1179,8 +1172,8 @@ export class NewProjectOverlayV2 extends BaseOverlayV2 {
|
|
|
1179
1172
|
this.state.inputBuffer = this.state.description;
|
|
1180
1173
|
break;
|
|
1181
1174
|
case 4:
|
|
1182
|
-
this.state.step = 3
|
|
1183
|
-
this.state.
|
|
1175
|
+
this.state.step = 2; // Back to description (step 3 repo pattern removed)
|
|
1176
|
+
this.state.inputBuffer = this.state.description;
|
|
1184
1177
|
break;
|
|
1185
1178
|
case 5:
|
|
1186
1179
|
this.state.step = 4;
|
|
@@ -1195,8 +1188,8 @@ export class NewProjectOverlayV2 extends BaseOverlayV2 {
|
|
|
1195
1188
|
this.state.selectedIndex = this.state.initGit ? 0 : 1;
|
|
1196
1189
|
break;
|
|
1197
1190
|
case 8:
|
|
1198
|
-
this.state.step = 7
|
|
1199
|
-
this.state.selectedIndex =
|
|
1191
|
+
this.state.step = 6; // Back to git (step 7 workflow mode removed)
|
|
1192
|
+
this.state.selectedIndex = this.state.initGit ? 0 : 1;
|
|
1200
1193
|
break;
|
|
1201
1194
|
}
|
|
1202
1195
|
this.state.error = null;
|
|
@@ -13,7 +13,7 @@ import * as terminal from '../../terminal.js';
|
|
|
13
13
|
import { TabbedListOverlayV2, BaseScreen, stay, popScreen, closeOverlay, isEscape, isCtrlC, isEnter, isClose, extractPrintable, renderBorder, wrapText, renderProgressBar, formatTokens, } from '../../base/index.js';
|
|
14
14
|
import { ROLE_METADATA } from '../../../multi-agent/index.js';
|
|
15
15
|
import { PROFILE_INFO } from '@compilr-dev/sdk';
|
|
16
|
-
import { TIER_INFO, getModelForTier } from '../../../models/index.js';
|
|
16
|
+
import { MODEL_TIERS, TIER_INFO, getModelForTier } from '../../../models/index.js';
|
|
17
17
|
import { getSettings } from '../../../settings/index.js';
|
|
18
18
|
import { getRoleTierDefault, setRoleTierDefault } from '../../../settings/index.js';
|
|
19
19
|
const TABS = [
|
|
@@ -24,7 +24,7 @@ const TABS = [
|
|
|
24
24
|
// =============================================================================
|
|
25
25
|
// Detail Screen (View Agent Info)
|
|
26
26
|
// =============================================================================
|
|
27
|
-
const MODEL_TIERS_LIST = [
|
|
27
|
+
const MODEL_TIERS_LIST = [...MODEL_TIERS];
|
|
28
28
|
class AgentDetailScreen extends BaseScreen {
|
|
29
29
|
item;
|
|
30
30
|
styles;
|
|
@@ -27,6 +27,7 @@ export { AskUserSimpleOverlayV2, type AskUserSimpleOptionsV2, type AskUserSimple
|
|
|
27
27
|
export { GuardrailOverlayV2, type GuardrailConfirmOptionsV2, type GuardrailConfirmResultV2 } from './impl/guardrail-overlay-v2.js';
|
|
28
28
|
export { AskUserOverlayV2, type AskUserOptionsV2, type AskUserResultV2 } from './impl/ask-user-overlay-v2.js';
|
|
29
29
|
export { IterationLimitOverlayV2, type IterationLimitOptionsV2, type IterationLimitResultV2 } from './impl/iteration-limit-overlay-v2.js';
|
|
30
|
+
export { AppModelOverlayV2, type AppModelOverlayV2Options, type AppModelOverlayV2Result } from './impl/app-model-overlay-v2.js';
|
|
30
31
|
export { ModelWarningOverlayV2, type ModelWarningOptionsV2, type ModelWarningChoiceV2 } from './impl/model-warning-overlay-v2.js';
|
|
31
32
|
export { NewProjectOverlayV2, type NewProjectResultV2 } from './impl/new-overlay-v2.js';
|
|
32
33
|
export { InitSetupOverlayV2, type InitSetupResultV2 } from './impl/init-setup-overlay-v2.js';
|
package/dist/ui/overlay/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export { AskUserSimpleOverlayV2 } from './impl/ask-user-simple-overlay-v2.js';
|
|
|
29
29
|
export { GuardrailOverlayV2 } from './impl/guardrail-overlay-v2.js';
|
|
30
30
|
export { AskUserOverlayV2 } from './impl/ask-user-overlay-v2.js';
|
|
31
31
|
export { IterationLimitOverlayV2 } from './impl/iteration-limit-overlay-v2.js';
|
|
32
|
+
export { AppModelOverlayV2 } from './impl/app-model-overlay-v2.js';
|
|
32
33
|
export { ModelWarningOverlayV2 } from './impl/model-warning-overlay-v2.js';
|
|
33
34
|
export { NewProjectOverlayV2 } from './impl/new-overlay-v2.js';
|
|
34
35
|
export { InitSetupOverlayV2 } from './impl/init-setup-overlay-v2.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compilr-dev/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "AI-powered coding assistant CLI using @compilr-dev/agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@anthropic-ai/sdk": "^0.74.0",
|
|
57
|
-
"@compilr-dev/agents": "^0.
|
|
57
|
+
"@compilr-dev/agents": "^0.5.5",
|
|
58
58
|
"@compilr-dev/agents-coding": "^1.0.4",
|
|
59
59
|
"@compilr-dev/editor-core": "^0.0.2",
|
|
60
|
-
"@compilr-dev/factory": "^0.1.
|
|
60
|
+
"@compilr-dev/factory": "^0.1.30",
|
|
61
61
|
"@compilr-dev/logger": "^0.1.0",
|
|
62
|
-
"@compilr-dev/sdk": "^0.
|
|
62
|
+
"@compilr-dev/sdk": "^0.9.22",
|
|
63
63
|
"@compilr-dev/ui-core": "^0.0.1",
|
|
64
64
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
65
65
|
"better-sqlite3": "^12.5.0",
|