claude-code-workflow 6.3.48 → 6.3.49
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/.claude/CLAUDE.md +6 -8
- package/.claude/agents/action-planning-agent.md +28 -45
- package/.claude/agents/cli-lite-planning-agent.md +93 -1
- package/.claude/agents/code-developer.md +144 -27
- package/.claude/commands/ccw-coordinator.md +175 -21
- package/.claude/commands/ccw-debug.md +832 -0
- package/.claude/commands/ccw.md +90 -9
- package/.claude/commands/cli/cli-init.md +1 -0
- package/.claude/commands/issue/convert-to-plan.md +718 -0
- package/.claude/commands/issue/from-brainstorm.md +382 -0
- package/.claude/commands/memory/tips.md +332 -0
- package/.claude/commands/workflow/analyze-with-file.md +804 -0
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +18 -43
- package/.claude/commands/workflow/brainstorm/role-analysis.md +705 -0
- package/.claude/commands/workflow/brainstorm-with-file.md +1153 -0
- package/.claude/commands/workflow/debug-with-file.md +7 -5
- package/.claude/commands/workflow/execute.md +6 -4
- package/.claude/commands/workflow/lite-plan.md +2 -2
- package/.claude/commands/workflow/plan-verify.md +162 -327
- package/.claude/commands/workflow/plan.md +162 -26
- package/.claude/commands/workflow/replan.md +78 -2
- package/.claude/commands/workflow/{review-fix.md → review-cycle-fix.md} +6 -6
- package/.claude/commands/workflow/review-module-cycle.md +2 -2
- package/.claude/commands/workflow/review-session-cycle.md +2 -2
- package/.claude/commands/workflow/tools/conflict-resolution.md +16 -26
- package/.claude/commands/workflow/tools/context-gather.md +81 -118
- package/.claude/commands/workflow/tools/task-generate-agent.md +94 -10
- package/.claude/skills/ccw-help/command.json +4 -4
- package/.claude/skills/lite-skill-generator/SKILL.md +650 -0
- package/.claude/skills/lite-skill-generator/templates/simple-skill.md +68 -0
- package/.claude/skills/lite-skill-generator/templates/style-guide.md +64 -0
- package/.claude/skills/skill-generator/SKILL.md +277 -85
- package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +4 -15
- package/.claude/skills/skill-generator/phases/02-structure-generation.md +72 -17
- package/.claude/skills/skill-generator/phases/03-phase-generation.md +218 -51
- package/.claude/skills/skill-generator/phases/04-specs-templates.md +111 -41
- package/.claude/skills/skill-generator/phases/05-validation.md +139 -56
- package/.claude/skills/skill-generator/templates/autonomous-action.md +78 -268
- package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +14 -0
- package/.claude/skills/skill-generator/templates/code-analysis-action.md +12 -0
- package/.claude/skills/skill-generator/templates/llm-action.md +12 -0
- package/.claude/skills/skill-generator/templates/script-template.md +368 -0
- package/.claude/skills/skill-generator/templates/sequential-phase.md +14 -0
- package/.claude/skills/skill-generator/templates/skill-md.md +14 -0
- package/.claude/skills/skill-tuning/SKILL.md +130 -266
- package/.claude/skills/skill-tuning/phases/orchestrator.md +95 -283
- package/.claude/skills/skill-tuning/specs/problem-taxonomy.md +90 -198
- package/.claude/skills/skill-tuning/specs/tuning-strategies.md +193 -1345
- package/.claude/workflows/cli-templates/schemas/plan-verify-agent-schema.json +47 -0
- package/.claude/workflows/cli-templates/schemas/verify-json-schema.json +158 -0
- package/.claude/workflows/cli-tools-usage.md +1 -1
- package/.codex/AGENTS.md +1 -3
- package/.codex/prompts/analyze-with-file.md +607 -0
- package/.codex/prompts/brainstorm-to-cycle.md +455 -0
- package/.codex/prompts/brainstorm-with-file.md +933 -0
- package/.codex/prompts/debug-with-file.md +15 -20
- package/.codex/skills/ccw-cli-tools/SKILL.md +559 -0
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +29 -5
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +2 -0
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +62 -20
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.js +5 -3
- package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
- package/ccw/dist/config/litellm-provider-models.d.ts +73 -0
- package/ccw/dist/config/litellm-provider-models.d.ts.map +1 -0
- package/ccw/dist/config/litellm-provider-models.js +172 -0
- package/ccw/dist/config/litellm-provider-models.js.map +1 -0
- package/ccw/dist/config/provider-models.d.ts +25 -51
- package/ccw/dist/config/provider-models.d.ts.map +1 -1
- package/ccw/dist/config/provider-models.js +84 -149
- package/ccw/dist/config/provider-models.js.map +1 -1
- package/ccw/dist/config/storage-paths.d.ts.map +1 -1
- package/ccw/dist/config/storage-paths.js +23 -5
- package/ccw/dist/config/storage-paths.js.map +1 -1
- package/ccw/dist/core/auth/csrf-middleware.js +3 -3
- package/ccw/dist/core/auth/csrf-middleware.js.map +1 -1
- package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
- package/ccw/dist/core/dashboard-generator.js +3 -1
- package/ccw/dist/core/dashboard-generator.js.map +1 -1
- package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/claude-routes.js +206 -14
- package/ccw/dist/core/routes/claude-routes.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/commands-routes.d.ts +7 -0
- package/ccw/dist/core/routes/commands-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/commands-routes.js +480 -0
- package/ccw/dist/core/routes/commands-routes.js.map +1 -0
- package/ccw/dist/core/routes/model-routes.d.ts +11 -0
- package/ccw/dist/core/routes/model-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/model-routes.js +112 -0
- package/ccw/dist/core/routes/model-routes.js.map +1 -0
- package/ccw/dist/core/routes/nav-status-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/nav-status-routes.js +84 -1
- package/ccw/dist/core/routes/nav-status-routes.js.map +1 -1
- package/ccw/dist/core/routes/provider-routes.d.ts +11 -0
- package/ccw/dist/core/routes/provider-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/provider-routes.js +67 -0
- package/ccw/dist/core/routes/provider-routes.js.map +1 -0
- package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/skills-routes.js +219 -7
- package/ccw/dist/core/routes/skills-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +58 -6
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +13 -0
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/mcp-server/index.js +2 -2
- package/ccw/dist/mcp-server/index.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts +48 -11
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +146 -50
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/cli-config-manager.d.ts +1 -13
- package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
- package/ccw/dist/tools/cli-config-manager.js +3 -27
- package/ccw/dist/tools/cli-config-manager.js.map +1 -1
- package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-core.js +7 -2
- package/ccw/dist/tools/cli-executor-core.js.map +1 -1
- package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.d.ts +11 -0
- package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.js +82 -2
- package/ccw/dist/tools/cli-history-store.js.map +1 -1
- package/ccw/dist/tools/command-registry.d.ts +7 -0
- package/ccw/dist/tools/command-registry.d.ts.map +1 -1
- package/ccw/dist/tools/command-registry.js +14 -1
- package/ccw/dist/tools/command-registry.js.map +1 -1
- package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -1
- package/ccw/dist/tools/generate-module-docs.js +11 -7
- package/ccw/dist/tools/generate-module-docs.js.map +1 -1
- package/ccw/dist/tools/litellm-executor.d.ts +1 -0
- package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-executor.js +11 -9
- package/ccw/dist/tools/litellm-executor.js.map +1 -1
- package/ccw/dist/types/skill-types.d.ts +97 -0
- package/ccw/dist/types/skill-types.d.ts.map +1 -0
- package/ccw/dist/types/skill-types.js +6 -0
- package/ccw/dist/types/skill-types.js.map +1 -0
- package/ccw/src/commands/cli.ts +36 -5
- package/ccw/src/commands/issue.ts +81 -26
- package/ccw/src/config/litellm-api-config-manager.ts +5 -3
- package/ccw/src/config/litellm-provider-models.ts +222 -0
- package/ccw/src/config/provider-models.ts +91 -190
- package/ccw/src/config/storage-paths.ts +20 -5
- package/ccw/src/core/auth/csrf-middleware.ts +3 -3
- package/ccw/src/core/dashboard-generator.ts +3 -1
- package/ccw/src/core/routes/claude-routes.ts +233 -15
- package/ccw/src/core/routes/cli-routes.ts +2 -3
- package/ccw/src/core/routes/commands-routes.ts +620 -0
- package/ccw/src/core/routes/nav-status-routes.ts +95 -1
- package/ccw/src/core/routes/provider-routes.ts +78 -0
- package/ccw/src/core/routes/skills-routes.ts +266 -45
- package/ccw/src/core/routes/system-routes.ts +102 -50
- package/ccw/src/core/server.ts +13 -0
- package/ccw/src/mcp-server/index.ts +2 -2
- package/ccw/src/templates/dashboard-css/18-cli-settings.css +35 -0
- package/ccw/src/templates/dashboard-css/37-commands.css +193 -0
- package/ccw/src/templates/dashboard-js/components/navigation.js +4 -0
- package/ccw/src/templates/dashboard-js/i18n.js +116 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +249 -4
- package/ccw/src/templates/dashboard-js/views/commands-manager.js +503 -0
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +7 -7
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2 -7
- package/ccw/src/templates/dashboard-js/views/skills-manager.js +164 -23
- package/ccw/src/templates/dashboard.html +7 -0
- package/ccw/src/tools/claude-cli-tools.ts +170 -56
- package/ccw/src/tools/cli-config-manager.ts +2 -33
- package/ccw/src/tools/cli-executor-core.ts +8 -2
- package/ccw/src/tools/cli-history-store.ts +92 -2
- package/ccw/src/tools/command-registry.ts +16 -1
- package/ccw/src/tools/generate-module-docs.ts +11 -7
- package/ccw/src/tools/litellm-executor.ts +13 -9
- package/ccw/src/types/skill-types.ts +99 -0
- package/package.json +1 -1
- package/.claude/commands/enhance-prompt.md +0 -93
- package/.claude/commands/memory/code-map-memory.md +0 -687
- package/.claude/commands/memory/docs.md +0 -615
- package/.claude/commands/memory/load-skill-memory.md +0 -182
- package/.claude/commands/memory/skill-memory.md +0 -525
- package/.claude/commands/memory/swagger-docs.md +0 -773
- package/.claude/commands/memory/tech-research-rules.md +0 -310
- package/.claude/commands/memory/workflow-skill-memory.md +0 -517
- package/.claude/commands/task/breakdown.md +0 -208
- package/.claude/commands/task/create.md +0 -152
- package/.claude/commands/task/execute.md +0 -270
- package/.claude/commands/task/replan.md +0 -441
- package/.claude/commands/version.md +0 -254
- package/.claude/commands/workflow/action-plan-verify.md +0 -485
- package/.claude/commands/workflow/brainstorm/api-designer.md +0 -587
- package/.claude/commands/workflow/brainstorm/data-architect.md +0 -220
- package/.claude/commands/workflow/brainstorm/product-manager.md +0 -200
- package/.claude/commands/workflow/brainstorm/product-owner.md +0 -200
- package/.claude/commands/workflow/brainstorm/scrum-master.md +0 -200
- package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
- package/.claude/commands/workflow/brainstorm/system-architect.md +0 -389
- package/.claude/commands/workflow/brainstorm/ui-designer.md +0 -221
- package/.claude/commands/workflow/brainstorm/ux-expert.md +0 -221
- package/.claude/commands/workflow/debug.md +0 -331
- package/.claude/commands/workflow/develop-with-file.md +0 -1044
- package/.claude/skills/ccw-loop/README.md +0 -303
- package/.claude/skills/skill-generator/templates/script-bash.md +0 -277
- package/.claude/skills/skill-generator/templates/script-python.md +0 -198
- package/.codex/prompts/debug.md +0 -318
- package/ccw/src/core/routes/mcp-routes.ts.backup +0 -549
|
@@ -186,6 +186,8 @@ interface Queue {
|
|
|
186
186
|
completed_count: number;
|
|
187
187
|
failed_count: number;
|
|
188
188
|
updated_at: string;
|
|
189
|
+
merged_into?: string; // Queue ID this was merged into
|
|
190
|
+
merged_at?: string; // Timestamp of merge
|
|
189
191
|
};
|
|
190
192
|
}
|
|
191
193
|
|
|
@@ -231,6 +233,37 @@ interface IssueOptions {
|
|
|
231
233
|
|
|
232
234
|
const ISSUES_DIR = '.workflow/issues';
|
|
233
235
|
|
|
236
|
+
// ============ Status Constants ============
|
|
237
|
+
|
|
238
|
+
const VALID_QUEUE_STATUSES = ['active', 'completed', 'archived', 'failed'] as const;
|
|
239
|
+
const VALID_ITEM_STATUSES = ['pending', 'ready', 'executing', 'completed', 'failed', 'blocked'] as const;
|
|
240
|
+
const VALID_ISSUE_STATUSES = ['registered', 'planning', 'planned', 'queued', 'executing', 'completed', 'failed', 'paused'] as const;
|
|
241
|
+
|
|
242
|
+
type QueueStatus = typeof VALID_QUEUE_STATUSES[number];
|
|
243
|
+
type QueueItemStatus = typeof VALID_ITEM_STATUSES[number];
|
|
244
|
+
type IssueStatus = typeof VALID_ISSUE_STATUSES[number];
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Validate queue status
|
|
248
|
+
*/
|
|
249
|
+
function validateQueueStatus(status: string): status is QueueStatus {
|
|
250
|
+
return VALID_QUEUE_STATUSES.includes(status as QueueStatus);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Validate queue item status
|
|
255
|
+
*/
|
|
256
|
+
function validateItemStatus(status: string): status is QueueItemStatus {
|
|
257
|
+
return VALID_ITEM_STATUSES.includes(status as QueueItemStatus);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Validate issue status
|
|
262
|
+
*/
|
|
263
|
+
function validateIssueStatus(status: string): status is IssueStatus {
|
|
264
|
+
return VALID_ISSUE_STATUSES.includes(status as IssueStatus);
|
|
265
|
+
}
|
|
266
|
+
|
|
234
267
|
// ============ Storage Layer (JSONL) ============
|
|
235
268
|
|
|
236
269
|
/**
|
|
@@ -744,7 +777,7 @@ interface MergeResult {
|
|
|
744
777
|
* Merge items from source queue into target queue
|
|
745
778
|
* - Skips duplicate items (same issue_id + solution_id)
|
|
746
779
|
* - Re-generates item IDs for merged items
|
|
747
|
-
* - Marks source queue as '
|
|
780
|
+
* - Marks source queue as 'archived' with metadata (or deletes if deleteSource=true)
|
|
748
781
|
* - Updates queue index
|
|
749
782
|
*/
|
|
750
783
|
function mergeQueues(target: Queue, source: Queue, options?: { deleteSource?: boolean }): MergeResult {
|
|
@@ -799,7 +832,7 @@ function mergeQueues(target: Queue, source: Queue, options?: { deleteSource?: bo
|
|
|
799
832
|
// Write updated target queue
|
|
800
833
|
writeQueue(target);
|
|
801
834
|
|
|
802
|
-
// Handle source queue: delete or mark as
|
|
835
|
+
// Handle source queue: delete or mark as archived
|
|
803
836
|
const index = readQueueIndex();
|
|
804
837
|
|
|
805
838
|
if (options?.deleteSource) {
|
|
@@ -810,8 +843,8 @@ function mergeQueues(target: Queue, source: Queue, options?: { deleteSource?: bo
|
|
|
810
843
|
}
|
|
811
844
|
index.queues = index.queues.filter(q => q.id !== source.id);
|
|
812
845
|
} else {
|
|
813
|
-
// Mark source queue as merged
|
|
814
|
-
source.status = '
|
|
846
|
+
// Mark source queue as archived (was merged)
|
|
847
|
+
source.status = 'archived';
|
|
815
848
|
if (!source._metadata) {
|
|
816
849
|
source._metadata = {
|
|
817
850
|
version: '2.1',
|
|
@@ -823,13 +856,13 @@ function mergeQueues(target: Queue, source: Queue, options?: { deleteSource?: bo
|
|
|
823
856
|
updated_at: new Date().toISOString()
|
|
824
857
|
};
|
|
825
858
|
}
|
|
826
|
-
|
|
827
|
-
|
|
859
|
+
source._metadata.merged_into = target.id;
|
|
860
|
+
source._metadata.merged_at = new Date().toISOString();
|
|
828
861
|
writeQueue(source);
|
|
829
862
|
|
|
830
863
|
const sourceEntry = index.queues.find(q => q.id === source.id);
|
|
831
864
|
if (sourceEntry) {
|
|
832
|
-
sourceEntry.status = '
|
|
865
|
+
sourceEntry.status = 'archived';
|
|
833
866
|
}
|
|
834
867
|
}
|
|
835
868
|
|
|
@@ -1806,13 +1839,12 @@ async function updateAction(issueId: string | undefined, options: IssueOptions):
|
|
|
1806
1839
|
const updates: Partial<Issue> = {};
|
|
1807
1840
|
|
|
1808
1841
|
if (options.status) {
|
|
1809
|
-
|
|
1810
|
-
if (!validStatuses.includes(options.status)) {
|
|
1842
|
+
if (!validateIssueStatus(options.status)) {
|
|
1811
1843
|
console.error(chalk.red(`Invalid status: ${options.status}`));
|
|
1812
|
-
console.error(chalk.gray(`Valid: ${
|
|
1844
|
+
console.error(chalk.gray(`Valid: ${VALID_ISSUE_STATUSES.join(', ')}`));
|
|
1813
1845
|
process.exit(1);
|
|
1814
1846
|
}
|
|
1815
|
-
updates.status = options.status
|
|
1847
|
+
updates.status = options.status;
|
|
1816
1848
|
|
|
1817
1849
|
// Auto-set timestamps based on status
|
|
1818
1850
|
if (options.status === 'planned') updates.planned_at = new Date().toISOString();
|
|
@@ -2233,7 +2265,7 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
|
|
|
2233
2265
|
process.exit(1);
|
|
2234
2266
|
}
|
|
2235
2267
|
|
|
2236
|
-
// mergeQueues marks source as '
|
|
2268
|
+
// mergeQueues marks source as 'archived' and updates index
|
|
2237
2269
|
const result = mergeQueues(targetQueue, sourceQueue);
|
|
2238
2270
|
|
|
2239
2271
|
if (options.json) {
|
|
@@ -2253,7 +2285,7 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
|
|
|
2253
2285
|
console.log(chalk.gray(` Skipped ${result.skippedDuplicates} duplicate items`));
|
|
2254
2286
|
}
|
|
2255
2287
|
console.log(chalk.gray(` Total items in target: ${result.totalItems}`));
|
|
2256
|
-
console.log(chalk.gray(` Source queue ${sourceQueueId}
|
|
2288
|
+
console.log(chalk.gray(` Source queue ${sourceQueueId} archived`));
|
|
2257
2289
|
} else {
|
|
2258
2290
|
console.log(chalk.yellow(`⚠ Merge skipped: ${result.reason}`));
|
|
2259
2291
|
}
|
|
@@ -2437,15 +2469,31 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
|
|
|
2437
2469
|
return;
|
|
2438
2470
|
}
|
|
2439
2471
|
|
|
2440
|
-
// Show current queue
|
|
2441
|
-
const queue =
|
|
2472
|
+
// Show current queue - use readQueue() to detect if queue actually exists
|
|
2473
|
+
const queue = readQueue();
|
|
2474
|
+
|
|
2475
|
+
// Handle no active queue case for all output modes
|
|
2476
|
+
if (!queue) {
|
|
2477
|
+
if (options.brief || options.json) {
|
|
2478
|
+
console.log(JSON.stringify({
|
|
2479
|
+
status: 'empty',
|
|
2480
|
+
message: 'No active queue',
|
|
2481
|
+
id: null,
|
|
2482
|
+
issue_ids: [],
|
|
2483
|
+
total: 0,
|
|
2484
|
+
items: []
|
|
2485
|
+
}, null, 2));
|
|
2486
|
+
return;
|
|
2487
|
+
}
|
|
2488
|
+
// Human-readable output handled below
|
|
2489
|
+
}
|
|
2442
2490
|
|
|
2443
2491
|
// Brief mode: minimal queue info (id, issue_ids, item summaries)
|
|
2444
2492
|
if (options.brief) {
|
|
2445
|
-
const items = queue
|
|
2493
|
+
const items = queue!.solutions || queue!.tasks || [];
|
|
2446
2494
|
const briefQueue = {
|
|
2447
|
-
id: queue
|
|
2448
|
-
issue_ids: queue
|
|
2495
|
+
id: queue!.id,
|
|
2496
|
+
issue_ids: queue!.issue_ids || [],
|
|
2449
2497
|
total: items.length,
|
|
2450
2498
|
pending: items.filter(i => i.status === 'pending').length,
|
|
2451
2499
|
executing: items.filter(i => i.status === 'executing').length,
|
|
@@ -2469,14 +2517,21 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
|
|
|
2469
2517
|
|
|
2470
2518
|
console.log(chalk.bold.cyan('\nActive Queue\n'));
|
|
2471
2519
|
|
|
2520
|
+
// Handle no queue case (human-readable)
|
|
2521
|
+
if (!queue) {
|
|
2522
|
+
console.log(chalk.yellow('No active queue'));
|
|
2523
|
+
console.log(chalk.gray('Create one: ccw issue queue add <issue-id>'));
|
|
2524
|
+
console.log(chalk.gray('Or list history: ccw issue queue list'));
|
|
2525
|
+
return;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2472
2528
|
// Support both solution-level and task-level queues
|
|
2473
2529
|
const items = queue.solutions || queue.tasks || [];
|
|
2474
2530
|
const isSolutionLevel = !!(queue.solutions && queue.solutions.length > 0);
|
|
2475
2531
|
|
|
2476
|
-
if (
|
|
2477
|
-
console.log(chalk.yellow(
|
|
2478
|
-
console.log(chalk.gray('
|
|
2479
|
-
console.log(chalk.gray('Or list history: ccw issue queue list'));
|
|
2532
|
+
if (items.length === 0) {
|
|
2533
|
+
console.log(chalk.yellow(`Queue ${queue.id} is empty`));
|
|
2534
|
+
console.log(chalk.gray('Add issues: ccw issue queue add <issue-id>'));
|
|
2480
2535
|
return;
|
|
2481
2536
|
}
|
|
2482
2537
|
|
|
@@ -2908,10 +2963,10 @@ async function retryAction(issueId: string | undefined, options: IssueOptions):
|
|
|
2908
2963
|
created_at: item.failure_details.timestamp
|
|
2909
2964
|
});
|
|
2910
2965
|
|
|
2911
|
-
//
|
|
2912
|
-
//
|
|
2966
|
+
// Reset issue status to 'queued' for re-execution
|
|
2967
|
+
// Failure details preserved in feedback for debugging
|
|
2913
2968
|
updateIssue(item.issue_id, {
|
|
2914
|
-
status: '
|
|
2969
|
+
status: 'queued',
|
|
2915
2970
|
updated_at: new Date().toISOString()
|
|
2916
2971
|
});
|
|
2917
2972
|
|
|
@@ -2927,7 +2982,7 @@ async function retryAction(issueId: string | undefined, options: IssueOptions):
|
|
|
2927
2982
|
item.failure_history.push(item.failure_details);
|
|
2928
2983
|
}
|
|
2929
2984
|
|
|
2930
|
-
// Reset QueueItem for retry (
|
|
2985
|
+
// Reset QueueItem for retry (Issue status also reset to 'queued')
|
|
2931
2986
|
item.status = 'pending';
|
|
2932
2987
|
item.failure_reason = undefined;
|
|
2933
2988
|
item.failure_details = undefined;
|
|
@@ -281,7 +281,8 @@ export function addEndpoint(
|
|
|
281
281
|
addClaudeApiEndpoint(homedir(), {
|
|
282
282
|
id: endpoint.id,
|
|
283
283
|
name: endpoint.id, // Use endpoint ID as tool name for CLI access
|
|
284
|
-
enabled: endpoint.enabled !== false
|
|
284
|
+
enabled: endpoint.enabled !== false,
|
|
285
|
+
model: endpoint.model // Sync model as primaryModel/secondaryModel
|
|
285
286
|
});
|
|
286
287
|
console.log(`[LiteLLM Config] Synced endpoint ${endpoint.id} to cli-tools.json (api-endpoint)`);
|
|
287
288
|
} catch (syncError) {
|
|
@@ -320,13 +321,14 @@ export function updateEndpoint(
|
|
|
320
321
|
|
|
321
322
|
saveConfig(baseDir, config);
|
|
322
323
|
|
|
323
|
-
// Sync enabled status to cli-tools.json
|
|
324
|
+
// Sync enabled status and model to cli-tools.json
|
|
324
325
|
const updatedEndpoint = config.endpoints[endpointIndex];
|
|
325
326
|
try {
|
|
326
327
|
addClaudeApiEndpoint(homedir(), {
|
|
327
328
|
id: updatedEndpoint.id,
|
|
328
329
|
name: updatedEndpoint.id,
|
|
329
|
-
enabled: updatedEndpoint.enabled !== false
|
|
330
|
+
enabled: updatedEndpoint.enabled !== false,
|
|
331
|
+
model: updatedEndpoint.model // Sync model as primaryModel/secondaryModel
|
|
330
332
|
});
|
|
331
333
|
console.log(`[LiteLLM Config] Synced endpoint ${updatedEndpoint.id} update to cli-tools.json`);
|
|
332
334
|
} catch (syncError) {
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Model Presets
|
|
3
|
+
*
|
|
4
|
+
* Predefined model information for each supported LLM provider.
|
|
5
|
+
* Used for UI dropdowns and validation.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { ProviderType } from '../types/litellm-api-config.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Model information metadata
|
|
12
|
+
*/
|
|
13
|
+
export interface ModelInfo {
|
|
14
|
+
/** Model identifier (used in API calls) */
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
/** Human-readable display name */
|
|
18
|
+
name: string;
|
|
19
|
+
|
|
20
|
+
/** Context window size in tokens */
|
|
21
|
+
contextWindow: number;
|
|
22
|
+
|
|
23
|
+
/** Whether this model supports prompt caching */
|
|
24
|
+
supportsCaching: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Embedding model information metadata
|
|
29
|
+
*/
|
|
30
|
+
export interface EmbeddingModelInfo {
|
|
31
|
+
/** Model identifier (used in API calls) */
|
|
32
|
+
id: string;
|
|
33
|
+
|
|
34
|
+
/** Human-readable display name */
|
|
35
|
+
name: string;
|
|
36
|
+
|
|
37
|
+
/** Embedding dimensions */
|
|
38
|
+
dimensions: number;
|
|
39
|
+
|
|
40
|
+
/** Maximum input tokens */
|
|
41
|
+
maxTokens: number;
|
|
42
|
+
|
|
43
|
+
/** Provider identifier */
|
|
44
|
+
provider: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Predefined models for each API format
|
|
50
|
+
* Used for UI selection and validation
|
|
51
|
+
* Note: Most providers use OpenAI-compatible format
|
|
52
|
+
*/
|
|
53
|
+
export const PROVIDER_MODELS: Record<ProviderType, ModelInfo[]> = {
|
|
54
|
+
// OpenAI-compatible format (used by OpenAI, DeepSeek, Ollama, etc.)
|
|
55
|
+
openai: [
|
|
56
|
+
{
|
|
57
|
+
id: 'gpt-4o',
|
|
58
|
+
name: 'GPT-4o',
|
|
59
|
+
contextWindow: 128000,
|
|
60
|
+
supportsCaching: true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'gpt-4o-mini',
|
|
64
|
+
name: 'GPT-4o Mini',
|
|
65
|
+
contextWindow: 128000,
|
|
66
|
+
supportsCaching: true
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'o1',
|
|
70
|
+
name: 'O1',
|
|
71
|
+
contextWindow: 200000,
|
|
72
|
+
supportsCaching: true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'deepseek-chat',
|
|
76
|
+
name: 'DeepSeek Chat',
|
|
77
|
+
contextWindow: 64000,
|
|
78
|
+
supportsCaching: false
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'deepseek-coder',
|
|
82
|
+
name: 'DeepSeek Coder',
|
|
83
|
+
contextWindow: 64000,
|
|
84
|
+
supportsCaching: false
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'llama3.2',
|
|
88
|
+
name: 'Llama 3.2',
|
|
89
|
+
contextWindow: 128000,
|
|
90
|
+
supportsCaching: false
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'qwen2.5-coder',
|
|
94
|
+
name: 'Qwen 2.5 Coder',
|
|
95
|
+
contextWindow: 32000,
|
|
96
|
+
supportsCaching: false
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
|
|
100
|
+
// Anthropic format
|
|
101
|
+
anthropic: [
|
|
102
|
+
{
|
|
103
|
+
id: 'claude-sonnet-4-20250514',
|
|
104
|
+
name: 'Claude Sonnet 4',
|
|
105
|
+
contextWindow: 200000,
|
|
106
|
+
supportsCaching: true
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: 'claude-3-5-sonnet-20241022',
|
|
110
|
+
name: 'Claude 3.5 Sonnet',
|
|
111
|
+
contextWindow: 200000,
|
|
112
|
+
supportsCaching: true
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: 'claude-3-5-haiku-20241022',
|
|
116
|
+
name: 'Claude 3.5 Haiku',
|
|
117
|
+
contextWindow: 200000,
|
|
118
|
+
supportsCaching: true
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'claude-3-opus-20240229',
|
|
122
|
+
name: 'Claude 3 Opus',
|
|
123
|
+
contextWindow: 200000,
|
|
124
|
+
supportsCaching: false
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
|
|
128
|
+
// Custom format
|
|
129
|
+
custom: [
|
|
130
|
+
{
|
|
131
|
+
id: 'custom-model',
|
|
132
|
+
name: 'Custom Model',
|
|
133
|
+
contextWindow: 128000,
|
|
134
|
+
supportsCaching: false
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Get models for a specific provider
|
|
141
|
+
* @param providerType - Provider type to get models for
|
|
142
|
+
* @returns Array of model information
|
|
143
|
+
*/
|
|
144
|
+
export function getModelsForProvider(providerType: ProviderType): ModelInfo[] {
|
|
145
|
+
return PROVIDER_MODELS[providerType] || [];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Predefined embedding models for each API format
|
|
150
|
+
* Used for UI selection and validation
|
|
151
|
+
*/
|
|
152
|
+
export const EMBEDDING_MODELS: Record<ProviderType, EmbeddingModelInfo[]> = {
|
|
153
|
+
// OpenAI embedding models
|
|
154
|
+
openai: [
|
|
155
|
+
{
|
|
156
|
+
id: 'text-embedding-3-small',
|
|
157
|
+
name: 'Text Embedding 3 Small',
|
|
158
|
+
dimensions: 1536,
|
|
159
|
+
maxTokens: 8191,
|
|
160
|
+
provider: 'openai'
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: 'text-embedding-3-large',
|
|
164
|
+
name: 'Text Embedding 3 Large',
|
|
165
|
+
dimensions: 3072,
|
|
166
|
+
maxTokens: 8191,
|
|
167
|
+
provider: 'openai'
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
id: 'text-embedding-ada-002',
|
|
171
|
+
name: 'Ada 002',
|
|
172
|
+
dimensions: 1536,
|
|
173
|
+
maxTokens: 8191,
|
|
174
|
+
provider: 'openai'
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
|
|
178
|
+
// Anthropic doesn't have embedding models
|
|
179
|
+
anthropic: [],
|
|
180
|
+
|
|
181
|
+
// Custom embedding models
|
|
182
|
+
custom: [
|
|
183
|
+
{
|
|
184
|
+
id: 'custom-embedding',
|
|
185
|
+
name: 'Custom Embedding',
|
|
186
|
+
dimensions: 1536,
|
|
187
|
+
maxTokens: 8192,
|
|
188
|
+
provider: 'custom'
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Get embedding models for a specific provider
|
|
195
|
+
* @param providerType - Provider type to get embedding models for
|
|
196
|
+
* @returns Array of embedding model information
|
|
197
|
+
*/
|
|
198
|
+
export function getEmbeddingModelsForProvider(providerType: ProviderType): EmbeddingModelInfo[] {
|
|
199
|
+
return EMBEDDING_MODELS[providerType] || [];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Get model information by ID within a provider
|
|
205
|
+
* @param providerType - Provider type
|
|
206
|
+
* @param modelId - Model identifier
|
|
207
|
+
* @returns Model information or undefined if not found
|
|
208
|
+
*/
|
|
209
|
+
export function getModelInfo(providerType: ProviderType, modelId: string): ModelInfo | undefined {
|
|
210
|
+
const models = PROVIDER_MODELS[providerType] || [];
|
|
211
|
+
return models.find(m => m.id === modelId);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Validate if a model ID is supported by a provider
|
|
216
|
+
* @param providerType - Provider type
|
|
217
|
+
* @param modelId - Model identifier to validate
|
|
218
|
+
* @returns true if model is valid for provider
|
|
219
|
+
*/
|
|
220
|
+
export function isValidModel(providerType: ProviderType, modelId: string): boolean {
|
|
221
|
+
return getModelInfo(providerType, modelId) !== undefined;
|
|
222
|
+
}
|