claude-flow-novice 1.3.0 โ 1.3.2
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-flow-novice/preferences/generation.json +147 -0
- package/.claude-flow-novice/preferences/language-configs/javascript.json +51 -0
- package/.claude-flow-novice/preferences/language-configs/python.json +50 -0
- package/.claude-flow-novice/preferences/language-configs/rust.json +237 -0
- package/.claude-flow-novice/preferences/language-configs/typescript.json +54 -0
- package/.claude-flow-novice/preferences/project-local.json +91 -0
- package/.claude-flow-novice/preferences/resource-delegation.json +120 -0
- package/.claude-flow-novice/preferences/team-shared.json +195 -0
- package/.claude-flow-novice/preferences/user-global.json +247 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-JAVASCRIPT.md +769 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-PYTHON.md +1214 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-RUST.md +475 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-TYPESCRIPT.md +851 -0
- package/.claude-flow-novice/templates/claude-md-templates/README.md +263 -0
- package/CLAUDE.md +81 -0
- package/README-NPM.md +0 -0
- package/package.json +11 -7
- package/scripts/build/README.md +167 -0
- package/scripts/build/build-config.js +27 -0
- package/scripts/build/build-prompt-copier.sh +30 -0
- package/scripts/build/performance-monitor.js +869 -0
- package/scripts/build/prepare-publish.js +150 -0
- package/scripts/build/typescript-fixer.js +621 -0
- package/scripts/build/unified-builder.sh +428 -0
- package/scripts/build/update-bin-version.js +32 -0
- package/scripts/dev/README.md +264 -0
- package/scripts/dev/claude-flow-wrapper.sh +35 -0
- package/scripts/dev/claude-monitor.py +419 -0
- package/scripts/dev/claude-sparc.sh +562 -0
- package/scripts/dev/claude-wrapper.sh +17 -0
- package/scripts/dev/demo-phase3-compliance.js +172 -0
- package/scripts/dev/demo-task-system.ts +224 -0
- package/scripts/dev/deployment-validator.js +315 -0
- package/scripts/dev/spawn-claude-terminal.sh +32 -0
- package/scripts/dev/start-portal.sh +506 -0
- package/scripts/dev/start-web-ui.js +15 -0
- package/scripts/dev/stop-portal.sh +311 -0
- package/scripts/dev/validate-examples.ts +288 -0
- package/scripts/dev/validate-phase2.cjs +451 -0
- package/scripts/dev/validate-phase2.js +785 -0
- package/scripts/dev/validate-phase3.cjs +208 -0
- package/scripts/dev/validate-security-remediation.js +1 -0
- package/scripts/legacy/README.md +272 -0
- package/scripts/legacy/batch-fix-ts.sh +54 -0
- package/scripts/legacy/build-migration.sh +105 -0
- package/scripts/legacy/build-monitor.js +209 -0
- package/scripts/legacy/build-with-filter.sh +84 -0
- package/scripts/legacy/build-workaround.sh +71 -0
- package/scripts/legacy/fix-ts-advanced.js +358 -0
- package/scripts/legacy/fix-ts-final.sh +50 -0
- package/scripts/legacy/fix-ts-targeted.sh +49 -0
- package/scripts/legacy/fix-typescript-errors.js +305 -0
- package/scripts/legacy/force-build.sh +63 -0
- package/scripts/legacy/optimize-performance.js +400 -0
- package/scripts/legacy/performance-monitor.js +263 -0
- package/scripts/legacy/performance-monitoring.js +532 -0
- package/scripts/legacy/performance-test-runner.js +645 -0
- package/scripts/legacy/quick-fix-ts.js +281 -0
- package/scripts/legacy/safe-build.sh +63 -0
- package/scripts/migration/README.md +434 -0
- package/scripts/migration/install-arm64.js +78 -0
- package/scripts/migration/install.js +83 -0
- package/scripts/migration/migrate-hooks.js +173 -0
- package/scripts/migration/migration-examples.ts +318 -0
- package/scripts/optimization/build-optimizer.js +438 -0
- package/scripts/optimization/config-validator.js +761 -0
- package/scripts/optimization/test-optimization.js +432 -0
- package/scripts/optimization/unified-activation.js +839 -0
- package/scripts/performance/ACTIVATION_COMMANDS.md +292 -0
- package/scripts/performance/sqlite-enhanced-activation.sh +583 -0
- package/scripts/performance/test-enhanced-backend.sh +504 -0
- package/scripts/performance-test-runner.js +698 -0
- package/scripts/security/README.md +339 -0
- package/scripts/security/install-git-hooks.sh +132 -0
- package/scripts/security/ruv-swarm-safe.js +74 -0
- package/scripts/test/README.md +236 -0
- package/scripts/test/check-links.ts +274 -0
- package/scripts/test/check-performance-regression.ts +168 -0
- package/scripts/test/coverage-report.ts +692 -0
- package/scripts/test/generate-swarm-tests.js +633 -0
- package/scripts/test/integration-test-validation.cjs +253 -0
- package/scripts/test/load-test-swarm.js +576 -0
- package/scripts/test/run-phase3-compliance-tests.js +427 -0
- package/scripts/test/test-batch-tasks.ts +29 -0
- package/scripts/test/test-byzantine-resolution.js +246 -0
- package/scripts/test/test-claude-spawn-options.sh +63 -0
- package/scripts/test/test-cli-wizard.js +331 -0
- package/scripts/test/test-comprehensive.js +401 -0
- package/scripts/test/test-coordination-features.ts +238 -0
- package/scripts/test/test-fallback-systems.js +276 -0
- package/scripts/test/test-init-command.ts +302 -0
- package/scripts/test/test-mcp.ts +251 -0
- package/scripts/test/test-runner.ts +568 -0
- package/scripts/test/test-swarm-integration.sh +92 -0
- package/scripts/test/test-swarm.ts +142 -0
- package/scripts/test/validation-summary.ts +408 -0
- package/scripts/utils/README.md +261 -0
- package/scripts/utils/clean-build-artifacts.sh +94 -0
- package/scripts/utils/cleanup-root.sh +69 -0
- package/scripts/utils/fix-cliffy-imports.js +307 -0
- package/scripts/utils/fix-duplicate-imports.js +114 -0
- package/scripts/utils/fix-error-handling.cjs +70 -0
- package/scripts/utils/fix-import-paths.js +104 -0
- package/scripts/utils/fix-imports.js +116 -0
- package/scripts/utils/fix-shebang.js +78 -0
- package/scripts/utils/fix-test-modules.js +27 -0
- package/scripts/utils/fix-timezone-issue-246.js +200 -0
- package/scripts/utils/fix-ts-comprehensive.py +182 -0
- package/scripts/utils/fix-ts-targeted-batch.js +250 -0
- package/scripts/utils/remove-benchmark-conflicts.sh +140 -0
- package/scripts/utils/simple-test-fixer.js +190 -0
- package/scripts/utils/validate-metrics-structure.cjs +144 -0
- package/scripts/verify-mcp-server.js +86 -0
- package/src/cli/simple-commands/__tests__/agent.test.js +291 -0
- package/src/cli/simple-commands/__tests__/memory.test.js +8 -0
- package/src/cli/simple-commands/__tests__/swarm.test.js +371 -0
- package/src/cli/simple-commands/__tests__/task.test.js +8 -0
- package/src/cli/simple-commands/agent.js +216 -0
- package/src/cli/simple-commands/analysis.js +570 -0
- package/src/cli/simple-commands/automation-executor.js +1603 -0
- package/src/cli/simple-commands/automation.js +627 -0
- package/src/cli/simple-commands/batch-manager.js +338 -0
- package/src/cli/simple-commands/claude-telemetry.js +311 -0
- package/src/cli/simple-commands/claude-track.js +102 -0
- package/src/cli/simple-commands/concurrent-display.js +348 -0
- package/src/cli/simple-commands/config.js +319 -0
- package/src/cli/simple-commands/coordination.js +307 -0
- package/src/cli/simple-commands/enhanced-ui-views.js +654 -0
- package/src/cli/simple-commands/enhanced-webui-complete.js +1038 -0
- package/src/cli/simple-commands/fix-hook-variables.js +363 -0
- package/src/cli/simple-commands/github/gh-coordinator.js +605 -0
- package/src/cli/simple-commands/github/github-api.js +624 -0
- package/src/cli/simple-commands/github/init.js +543 -0
- package/src/cli/simple-commands/github.js +377 -0
- package/src/cli/simple-commands/goal.js +145 -0
- package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +311 -0
- package/src/cli/simple-commands/hive-mind/communication.js +740 -0
- package/src/cli/simple-commands/hive-mind/core.js +1031 -0
- package/src/cli/simple-commands/hive-mind/db-optimizer.js +872 -0
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1364 -0
- package/src/cli/simple-commands/hive-mind/memory.js +1292 -0
- package/src/cli/simple-commands/hive-mind/performance-optimizer.js +618 -0
- package/src/cli/simple-commands/hive-mind/performance-test.js +373 -0
- package/src/cli/simple-commands/hive-mind/queen.js +809 -0
- package/src/cli/simple-commands/hive-mind/session-manager.js +1223 -0
- package/src/cli/simple-commands/hive-mind-optimize.js +361 -0
- package/src/cli/simple-commands/hive-mind-wizard.js +281 -0
- package/src/cli/simple-commands/hive-mind.js +3112 -0
- package/src/cli/simple-commands/hive.js +140 -0
- package/src/cli/simple-commands/hook-safety.js +671 -0
- package/src/cli/simple-commands/hooks.js +1268 -0
- package/src/cli/simple-commands/init/.claude/checkpoints/1756224542.json +7 -0
- package/src/cli/simple-commands/init/.claude/checkpoints/1756224544.json +8 -0
- package/src/cli/simple-commands/init/README.md +106 -0
- package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +488 -0
- package/src/cli/simple-commands/init/agent-copier.js +347 -0
- package/src/cli/simple-commands/init/batch-init.js +663 -0
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +438 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +876 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +356 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +501 -0
- package/src/cli/simple-commands/init/claude-commands/slash-commands.js +57 -0
- package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +296 -0
- package/src/cli/simple-commands/init/copy-revised-templates.js +175 -0
- package/src/cli/simple-commands/init/executable-wrapper.js +122 -0
- package/src/cli/simple-commands/init/gitignore-updater.js +137 -0
- package/src/cli/simple-commands/init/help.js +110 -0
- package/src/cli/simple-commands/init/hive-mind-init.js +749 -0
- package/src/cli/simple-commands/init/index.js +1953 -0
- package/src/cli/simple-commands/init/performance-monitor.js +344 -0
- package/src/cli/simple-commands/init/rollback/backup-manager.js +542 -0
- package/src/cli/simple-commands/init/rollback/index.js +399 -0
- package/src/cli/simple-commands/init/rollback/recovery-manager.js +778 -0
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +521 -0
- package/src/cli/simple-commands/init/rollback/state-tracker.js +486 -0
- package/src/cli/simple-commands/init/sparc/roo-readme.js +61 -0
- package/src/cli/simple-commands/init/sparc/roomodes-config.js +102 -0
- package/src/cli/simple-commands/init/sparc/workflows.js +40 -0
- package/src/cli/simple-commands/init/sparc-structure.js +68 -0
- package/src/cli/simple-commands/init/template-copier.js +640 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md +1185 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +265 -0
- package/src/cli/simple-commands/init/templates/claude-flow-universal +81 -0
- package/src/cli/simple-commands/init/templates/claude-flow.bat +18 -0
- package/src/cli/simple-commands/init/templates/claude-flow.ps1 +24 -0
- package/src/cli/simple-commands/init/templates/claude-md.js +1101 -0
- package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +162 -0
- package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +122 -0
- package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +85 -0
- package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +121 -0
- package/src/cli/simple-commands/init/templates/commands/helpers/standard-checkpoint-hooks.sh +179 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +116 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +117 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +112 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +112 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +111 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +118 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +118 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +117 -0
- package/src/cli/simple-commands/init/templates/coordination-md.js +340 -0
- package/src/cli/simple-commands/init/templates/coordination.md +16 -0
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +2347 -0
- package/src/cli/simple-commands/init/templates/github-safe-enhanced.js +331 -0
- package/src/cli/simple-commands/init/templates/github-safe.js +106 -0
- package/src/cli/simple-commands/init/templates/memory-bank-md.js +259 -0
- package/src/cli/simple-commands/init/templates/memory-bank.md +16 -0
- package/src/cli/simple-commands/init/templates/readme-files.js +72 -0
- package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +430 -0
- package/src/cli/simple-commands/init/templates/settings.json +109 -0
- package/src/cli/simple-commands/init/templates/settings.json.enhanced +35 -0
- package/src/cli/simple-commands/init/templates/sparc-modes.js +1401 -0
- package/src/cli/simple-commands/init/templates/verification-claude-md.js +432 -0
- package/src/cli/simple-commands/init/validation/config-validator.js +354 -0
- package/src/cli/simple-commands/init/validation/health-checker.js +599 -0
- package/src/cli/simple-commands/init/validation/index.js +388 -0
- package/src/cli/simple-commands/init/validation/mode-validator.js +387 -0
- package/src/cli/simple-commands/init/validation/post-init-validator.js +390 -0
- package/src/cli/simple-commands/init/validation/pre-init-validator.js +290 -0
- package/src/cli/simple-commands/init/validation/test-runner.js +488 -0
- package/src/cli/simple-commands/init.js +4 -0
- package/src/cli/simple-commands/mcp-health.js +163 -0
- package/src/cli/simple-commands/mcp-integration-layer.js +689 -0
- package/src/cli/simple-commands/mcp.js +420 -0
- package/src/cli/simple-commands/memory-consolidation.js +631 -0
- package/src/cli/simple-commands/memory.js +345 -0
- package/src/cli/simple-commands/migrate-hooks.js +63 -0
- package/src/cli/simple-commands/monitor.js +417 -0
- package/src/cli/simple-commands/neural.js +148 -0
- package/src/cli/simple-commands/pair-autofix-only.js +755 -0
- package/src/cli/simple-commands/pair-basic.js +751 -0
- package/src/cli/simple-commands/pair-old.js +623 -0
- package/src/cli/simple-commands/pair-working.js +849 -0
- package/src/cli/simple-commands/pair.js +849 -0
- package/src/cli/simple-commands/performance-hooks.js +149 -0
- package/src/cli/simple-commands/performance-metrics.js +601 -0
- package/src/cli/simple-commands/process-ui-enhanced.js +821 -0
- package/src/cli/simple-commands/process-ui.js +274 -0
- package/src/cli/simple-commands/realtime-update-system.js +659 -0
- package/src/cli/simple-commands/sparc/architecture.js +1750 -0
- package/src/cli/simple-commands/sparc/commands.js +575 -0
- package/src/cli/simple-commands/sparc/completion.js +1831 -0
- package/src/cli/simple-commands/sparc/coordinator.js +1045 -0
- package/src/cli/simple-commands/sparc/index.js +321 -0
- package/src/cli/simple-commands/sparc/phase-base.js +430 -0
- package/src/cli/simple-commands/sparc/pseudocode.js +984 -0
- package/src/cli/simple-commands/sparc/refinement.js +1856 -0
- package/src/cli/simple-commands/sparc/specification.js +736 -0
- package/src/cli/simple-commands/sparc-modes/architect.js +125 -0
- package/src/cli/simple-commands/sparc-modes/ask.js +126 -0
- package/src/cli/simple-commands/sparc-modes/code.js +148 -0
- package/src/cli/simple-commands/sparc-modes/debug.js +112 -0
- package/src/cli/simple-commands/sparc-modes/devops.js +137 -0
- package/src/cli/simple-commands/sparc-modes/docs-writer.js +38 -0
- package/src/cli/simple-commands/sparc-modes/generic.js +34 -0
- package/src/cli/simple-commands/sparc-modes/index.js +201 -0
- package/src/cli/simple-commands/sparc-modes/integration.js +55 -0
- package/src/cli/simple-commands/sparc-modes/mcp.js +38 -0
- package/src/cli/simple-commands/sparc-modes/monitoring.js +38 -0
- package/src/cli/simple-commands/sparc-modes/optimization.js +38 -0
- package/src/cli/simple-commands/sparc-modes/security-review.js +130 -0
- package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +167 -0
- package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +38 -0
- package/src/cli/simple-commands/sparc-modes/supabase-admin.js +149 -0
- package/src/cli/simple-commands/sparc-modes/swarm.js +436 -0
- package/src/cli/simple-commands/sparc-modes/tdd.js +112 -0
- package/src/cli/simple-commands/sparc-modes/tutorial.js +277 -0
- package/src/cli/simple-commands/sparc.js +530 -0
- package/src/cli/simple-commands/start-ui.js +147 -0
- package/src/cli/simple-commands/start-wrapper.js +285 -0
- package/src/cli/simple-commands/start.js +2 -0
- package/src/cli/simple-commands/status.js +303 -0
- package/src/cli/simple-commands/stream-chain-clean.js +221 -0
- package/src/cli/simple-commands/stream-chain-fixed.js +89 -0
- package/src/cli/simple-commands/stream-chain-real.js +408 -0
- package/src/cli/simple-commands/stream-chain-working.js +323 -0
- package/src/cli/simple-commands/stream-chain.js +491 -0
- package/src/cli/simple-commands/stream-processor.js +340 -0
- package/src/cli/simple-commands/swarm-executor.js +253 -0
- package/src/cli/simple-commands/swarm-metrics-integration.js +371 -0
- package/src/cli/simple-commands/swarm-ui.js +741 -0
- package/src/cli/simple-commands/swarm-webui-integration.js +311 -0
- package/src/cli/simple-commands/swarm.js +2277 -0
- package/src/cli/simple-commands/task.js +228 -0
- package/src/cli/simple-commands/templates/mle-star-workflow.json +294 -0
- package/src/cli/simple-commands/timestamp-fix.js +104 -0
- package/src/cli/simple-commands/token-tracker.js +372 -0
- package/src/cli/simple-commands/tool-execution-framework.js +555 -0
- package/src/cli/simple-commands/train-and-stream.js +354 -0
- package/src/cli/simple-commands/training-pipeline.js +874 -0
- package/src/cli/simple-commands/training.js +288 -0
- package/src/cli/simple-commands/verification-hooks.js +336 -0
- package/src/cli/simple-commands/verification-integration.js +464 -0
- package/src/cli/simple-commands/verification-training-integration.js +646 -0
- package/src/cli/simple-commands/verification.js +551 -0
- package/src/cli/simple-commands/web-server.js +929 -0
- package/src/cli/simple-commands/webui-validator.js +136 -0
- package/src/language/README.md +503 -0
- package/src/language/claude-md-generator.js +618 -0
- package/src/language/cli.js +422 -0
- package/src/language/example.js +347 -0
- package/src/language/integration-system.js +619 -0
- package/src/language/language-detector.js +581 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// task.js - Task management commands with improved argument parsing
|
|
2
|
+
import { printSuccess, printError, printWarning } from '../utils.js';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
|
|
5
|
+
export async function taskCommand(subArgs, flags) {
|
|
6
|
+
const taskCmd = subArgs[0];
|
|
7
|
+
|
|
8
|
+
switch (taskCmd) {
|
|
9
|
+
case 'create':
|
|
10
|
+
await createTask(subArgs, flags);
|
|
11
|
+
break;
|
|
12
|
+
|
|
13
|
+
case 'list':
|
|
14
|
+
await listTasks(subArgs, flags);
|
|
15
|
+
break;
|
|
16
|
+
|
|
17
|
+
case 'status':
|
|
18
|
+
await showTaskStatus(subArgs, flags);
|
|
19
|
+
break;
|
|
20
|
+
|
|
21
|
+
case 'cancel':
|
|
22
|
+
await cancelTask(subArgs, flags);
|
|
23
|
+
break;
|
|
24
|
+
|
|
25
|
+
case 'workflow':
|
|
26
|
+
await executeWorkflow(subArgs, flags);
|
|
27
|
+
break;
|
|
28
|
+
|
|
29
|
+
case 'coordination':
|
|
30
|
+
await manageCoordination(subArgs, flags);
|
|
31
|
+
break;
|
|
32
|
+
|
|
33
|
+
default:
|
|
34
|
+
showTaskHelp();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function createTask(subArgs, flags) {
|
|
39
|
+
// Use commander for robust argument parsing
|
|
40
|
+
const program = new Command()
|
|
41
|
+
.exitOverride()
|
|
42
|
+
.allowUnknownOption()
|
|
43
|
+
.option('--priority <value>', 'Set task priority (1-10)', '5');
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
// Parse the arguments starting from the create command
|
|
47
|
+
program.parse(subArgs, { from: 'user' });
|
|
48
|
+
} catch (err) {
|
|
49
|
+
// Continue even if commander throws
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const opts = program.opts();
|
|
53
|
+
const args = program.args;
|
|
54
|
+
|
|
55
|
+
// Extract task type and description with proper quote handling
|
|
56
|
+
const taskType = args[1]; // First arg after 'create'
|
|
57
|
+
|
|
58
|
+
// Join remaining args for description, handling quoted strings properly
|
|
59
|
+
let description = '';
|
|
60
|
+
if (args.length > 2) {
|
|
61
|
+
// If the description starts with a quote, find the matching end quote
|
|
62
|
+
const descriptionArgs = args.slice(2);
|
|
63
|
+
description = parseQuotedDescription(descriptionArgs);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!taskType || !description) {
|
|
67
|
+
printError('Usage: task create <type> "<description>"');
|
|
68
|
+
console.log('Types: research, code, analysis, coordination, general');
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const taskId = `task_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
73
|
+
const priority = opts.priority || '5';
|
|
74
|
+
|
|
75
|
+
printSuccess(`Creating ${taskType} task: ${taskId}`);
|
|
76
|
+
console.log(`๐ Description: ${description}`);
|
|
77
|
+
console.log(`โก Priority: ${priority}/10`);
|
|
78
|
+
console.log(`๐ท๏ธ Type: ${taskType}`);
|
|
79
|
+
console.log('๐
Status: Queued');
|
|
80
|
+
console.log('\n๐ Note: Task queued for execution when orchestrator starts');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function parseQuotedDescription(args) {
|
|
84
|
+
const fullString = args.join(' ');
|
|
85
|
+
|
|
86
|
+
// Check if it starts with a quote
|
|
87
|
+
if (fullString.startsWith('"') || fullString.startsWith("'")) {
|
|
88
|
+
const quoteChar = fullString[0];
|
|
89
|
+
const endIndex = fullString.lastIndexOf(quoteChar);
|
|
90
|
+
|
|
91
|
+
if (endIndex > 0) {
|
|
92
|
+
// Extract the quoted content
|
|
93
|
+
return fullString.substring(1, endIndex);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// If not quoted or improperly quoted, return the full string
|
|
98
|
+
return fullString;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async function listTasks(subArgs, flags) {
|
|
102
|
+
const program = new Command()
|
|
103
|
+
.exitOverride()
|
|
104
|
+
.allowUnknownOption()
|
|
105
|
+
.option('--filter <status>', 'Filter by task status')
|
|
106
|
+
.option('--verbose', 'Show detailed output')
|
|
107
|
+
.option('-v', 'Show detailed output');
|
|
108
|
+
|
|
109
|
+
try {
|
|
110
|
+
program.parse(subArgs, { from: 'user' });
|
|
111
|
+
} catch (err) {
|
|
112
|
+
// Continue
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const opts = program.opts();
|
|
116
|
+
const filter = opts.filter;
|
|
117
|
+
const verbose = opts.verbose || opts.v;
|
|
118
|
+
|
|
119
|
+
printSuccess('Task queue:');
|
|
120
|
+
|
|
121
|
+
if (filter) {
|
|
122
|
+
console.log(`๐ Filtered by status: ${filter}`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
console.log('๐ No active tasks (orchestrator not running)');
|
|
126
|
+
console.log('\nTask statuses: queued, running, completed, failed, cancelled');
|
|
127
|
+
|
|
128
|
+
if (verbose) {
|
|
129
|
+
console.log('\nTo create tasks:');
|
|
130
|
+
console.log(' claude-flow task create research "Market analysis"');
|
|
131
|
+
console.log(' claude-flow task create code "Implement API"');
|
|
132
|
+
console.log(' claude-flow task create analysis "Data processing"');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async function showTaskStatus(subArgs, flags) {
|
|
137
|
+
const taskId = subArgs[1];
|
|
138
|
+
|
|
139
|
+
if (!taskId) {
|
|
140
|
+
printError('Usage: task status <task-id>');
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
printSuccess(`Task status: ${taskId}`);
|
|
145
|
+
console.log('๐ Task details would include:');
|
|
146
|
+
console.log(' Status, progress, assigned agent, execution time, results');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
async function cancelTask(subArgs, flags) {
|
|
150
|
+
const taskId = subArgs[1];
|
|
151
|
+
|
|
152
|
+
if (!taskId) {
|
|
153
|
+
printError('Usage: task cancel <task-id>');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
printSuccess(`Cancelling task: ${taskId}`);
|
|
158
|
+
console.log('๐ Task would be gracefully cancelled');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function executeWorkflow(subArgs, flags) {
|
|
162
|
+
const workflowFile = subArgs[1];
|
|
163
|
+
|
|
164
|
+
if (!workflowFile) {
|
|
165
|
+
printError('Usage: task workflow <workflow-file>');
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
printSuccess(`Executing workflow: ${workflowFile}`);
|
|
170
|
+
console.log('๐ Workflow execution would include:');
|
|
171
|
+
console.log(' - Parsing workflow definition');
|
|
172
|
+
console.log(' - Creating dependent tasks');
|
|
173
|
+
console.log(' - Orchestrating execution');
|
|
174
|
+
console.log(' - Progress tracking');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async function manageCoordination(subArgs, flags) {
|
|
178
|
+
const coordCmd = subArgs[1];
|
|
179
|
+
|
|
180
|
+
switch (coordCmd) {
|
|
181
|
+
case 'status':
|
|
182
|
+
printSuccess('Task coordination status:');
|
|
183
|
+
console.log('๐ฏ Coordination engine: Not running');
|
|
184
|
+
console.log(' Active coordinators: 0');
|
|
185
|
+
console.log(' Pending tasks: 0');
|
|
186
|
+
console.log(' Resource utilization: 0%');
|
|
187
|
+
break;
|
|
188
|
+
|
|
189
|
+
case 'optimize':
|
|
190
|
+
printSuccess('Optimizing task coordination...');
|
|
191
|
+
console.log('โก Optimization would include:');
|
|
192
|
+
console.log(' - Task dependency analysis');
|
|
193
|
+
console.log(' - Resource allocation optimization');
|
|
194
|
+
console.log(' - Parallel execution planning');
|
|
195
|
+
break;
|
|
196
|
+
|
|
197
|
+
default:
|
|
198
|
+
console.log('Coordination commands: status, optimize');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function showTaskHelp() {
|
|
203
|
+
console.log('Task commands:');
|
|
204
|
+
console.log(' create <type> "<description>" Create new task');
|
|
205
|
+
console.log(' list [--filter <status>] List tasks');
|
|
206
|
+
console.log(' status <id> Show task details');
|
|
207
|
+
console.log(' cancel <id> Cancel running task');
|
|
208
|
+
console.log(' workflow <file> Execute workflow file');
|
|
209
|
+
console.log(' coordination <status|optimize> Manage coordination');
|
|
210
|
+
console.log();
|
|
211
|
+
console.log('Task Types:');
|
|
212
|
+
console.log(' research Information gathering and analysis');
|
|
213
|
+
console.log(' code Software development tasks');
|
|
214
|
+
console.log(' analysis Data processing and insights');
|
|
215
|
+
console.log(' coordination Task orchestration and management');
|
|
216
|
+
console.log(' general General purpose tasks');
|
|
217
|
+
console.log();
|
|
218
|
+
console.log('Options:');
|
|
219
|
+
console.log(' --priority <1-10> Set task priority');
|
|
220
|
+
console.log(' --filter <status> Filter by status');
|
|
221
|
+
console.log(' --verbose, -v Show detailed output');
|
|
222
|
+
console.log();
|
|
223
|
+
console.log('Examples:');
|
|
224
|
+
console.log(' claude-flow task create research "Market analysis" --priority 8');
|
|
225
|
+
console.log(' claude-flow task list --filter running');
|
|
226
|
+
console.log(' claude-flow task workflow examples/development-workflow.json');
|
|
227
|
+
console.log(' claude-flow task coordination status');
|
|
228
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "MLE-STAR Machine Learning Engineering Workflow",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Complete Machine Learning Engineering workflow using MLE-STAR methodology (Search and Targeted Refinement)",
|
|
5
|
+
"variables": {
|
|
6
|
+
"dataset_path": "data/ml_dataset.csv",
|
|
7
|
+
"target_metric": "accuracy",
|
|
8
|
+
"model_output_dir": "models/",
|
|
9
|
+
"experiment_name": "mle-star-experiment",
|
|
10
|
+
"search_iterations": 3,
|
|
11
|
+
"refinement_iterations": 5
|
|
12
|
+
},
|
|
13
|
+
"agents": [
|
|
14
|
+
{
|
|
15
|
+
"id": "search_agent",
|
|
16
|
+
"type": "researcher",
|
|
17
|
+
"name": "Web Search & Foundation Agent",
|
|
18
|
+
"config": {
|
|
19
|
+
"capabilities": ["web_search", "model_research", "approach_validation"],
|
|
20
|
+
"search_depth": "comprehensive",
|
|
21
|
+
"domains": ["machine_learning", "data_science", "kaggle_solutions"]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "foundation_agent",
|
|
26
|
+
"type": "coder",
|
|
27
|
+
"name": "Foundation Model Builder",
|
|
28
|
+
"config": {
|
|
29
|
+
"capabilities": ["data_preprocessing", "initial_modeling", "baseline_creation"],
|
|
30
|
+
"programming_languages": ["python", "jupyter"],
|
|
31
|
+
"frameworks": ["scikit-learn", "pandas", "numpy", "matplotlib"]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "refinement_agent",
|
|
36
|
+
"type": "optimizer",
|
|
37
|
+
"name": "Targeted Refinement Specialist",
|
|
38
|
+
"config": {
|
|
39
|
+
"capabilities": ["feature_engineering", "model_optimization", "hyperparameter_tuning"],
|
|
40
|
+
"optimization_methods": ["grid_search", "bayesian", "evolutionary"],
|
|
41
|
+
"ablation_analysis": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "ensemble_agent",
|
|
46
|
+
"type": "architect",
|
|
47
|
+
"name": "Ensemble & Meta-Learning Expert",
|
|
48
|
+
"config": {
|
|
49
|
+
"capabilities": ["model_stacking", "ensemble_methods", "meta_learning"],
|
|
50
|
+
"ensemble_strategies": ["voting", "stacking", "blending", "dynamic_weighting"]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "validation_agent",
|
|
55
|
+
"type": "tester",
|
|
56
|
+
"name": "Validation & Debugging Agent",
|
|
57
|
+
"config": {
|
|
58
|
+
"capabilities": ["cross_validation", "error_detection", "data_leakage_prevention"],
|
|
59
|
+
"validation_strategies": ["stratified_kfold", "time_series_split", "leave_one_out"],
|
|
60
|
+
"debugging_tools": ["profiling", "error_correction", "data_integrity_checks"]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "orchestrator",
|
|
65
|
+
"type": "coordinator",
|
|
66
|
+
"name": "MLE-STAR Orchestrator",
|
|
67
|
+
"config": {
|
|
68
|
+
"capabilities": ["workflow_coordination", "performance_tracking", "resource_management"],
|
|
69
|
+
"coordination_mode": "adaptive",
|
|
70
|
+
"monitoring_enabled": true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"tasks": [
|
|
75
|
+
{
|
|
76
|
+
"id": "web_search_phase",
|
|
77
|
+
"name": "Web Search for ML Approaches",
|
|
78
|
+
"type": "research",
|
|
79
|
+
"description": "Search web for state-of-the-art ML approaches, model architectures, and proven solutions for the given problem domain",
|
|
80
|
+
"assignTo": "search_agent",
|
|
81
|
+
"input": {
|
|
82
|
+
"problem_type": "${dataset_analysis.problem_type}",
|
|
83
|
+
"data_characteristics": "${dataset_analysis.characteristics}",
|
|
84
|
+
"search_queries": [
|
|
85
|
+
"latest machine learning models ${problem_type}",
|
|
86
|
+
"kaggle winning solutions ${problem_type}",
|
|
87
|
+
"state-of-the-art ${problem_type} benchmarks",
|
|
88
|
+
"feature engineering techniques ${problem_type}"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"timeout": 900,
|
|
92
|
+
"retries": 2,
|
|
93
|
+
"output": {
|
|
94
|
+
"recommended_approaches": "array",
|
|
95
|
+
"model_cards": "array",
|
|
96
|
+
"benchmark_results": "object",
|
|
97
|
+
"implementation_examples": "array"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "dataset_analysis",
|
|
102
|
+
"name": "Dataset Analysis & Profiling",
|
|
103
|
+
"type": "analysis",
|
|
104
|
+
"description": "Comprehensive analysis of dataset characteristics, quality, and problem type identification",
|
|
105
|
+
"assignTo": "foundation_agent",
|
|
106
|
+
"input": {
|
|
107
|
+
"dataset_path": "${dataset_path}",
|
|
108
|
+
"target": "${target_column}"
|
|
109
|
+
},
|
|
110
|
+
"timeout": 300,
|
|
111
|
+
"output": {
|
|
112
|
+
"problem_type": "string",
|
|
113
|
+
"characteristics": "object",
|
|
114
|
+
"data_quality_report": "object",
|
|
115
|
+
"recommended_preprocessing": "array"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "foundation_building",
|
|
120
|
+
"name": "Foundation Model Creation",
|
|
121
|
+
"type": "implementation",
|
|
122
|
+
"description": "Build initial ML pipeline based on web search findings and dataset analysis",
|
|
123
|
+
"assignTo": "foundation_agent",
|
|
124
|
+
"depends": ["web_search_phase", "dataset_analysis"],
|
|
125
|
+
"input": {
|
|
126
|
+
"search_results": "${web_search_phase.output}",
|
|
127
|
+
"dataset_info": "${dataset_analysis.output}",
|
|
128
|
+
"approaches_to_implement": "${web_search_phase.output.recommended_approaches}"
|
|
129
|
+
},
|
|
130
|
+
"timeout": 1800,
|
|
131
|
+
"output": {
|
|
132
|
+
"baseline_models": "array",
|
|
133
|
+
"preprocessing_pipeline": "object",
|
|
134
|
+
"initial_results": "object",
|
|
135
|
+
"code_components": "object"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "ablation_analysis",
|
|
140
|
+
"name": "Component Impact Analysis",
|
|
141
|
+
"type": "analysis",
|
|
142
|
+
"description": "Systematically analyze which pipeline components have the highest performance impact",
|
|
143
|
+
"assignTo": "refinement_agent",
|
|
144
|
+
"depends": ["foundation_building"],
|
|
145
|
+
"input": {
|
|
146
|
+
"foundation_pipeline": "${foundation_building.output}",
|
|
147
|
+
"baseline_performance": "${foundation_building.output.initial_results}",
|
|
148
|
+
"components_to_test": [
|
|
149
|
+
"data_preprocessing",
|
|
150
|
+
"feature_engineering",
|
|
151
|
+
"model_selection",
|
|
152
|
+
"hyperparameters"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"timeout": 1200,
|
|
156
|
+
"output": {
|
|
157
|
+
"component_rankings": "array",
|
|
158
|
+
"impact_scores": "object",
|
|
159
|
+
"highest_impact_component": "string",
|
|
160
|
+
"improvement_opportunities": "array"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "targeted_refinement",
|
|
165
|
+
"name": "Iterative Component Refinement",
|
|
166
|
+
"type": "optimization",
|
|
167
|
+
"description": "Deep, focused improvements on the highest-impact pipeline components identified through ablation",
|
|
168
|
+
"assignTo": "refinement_agent",
|
|
169
|
+
"depends": ["ablation_analysis"],
|
|
170
|
+
"input": {
|
|
171
|
+
"target_component": "${ablation_analysis.output.highest_impact_component}",
|
|
172
|
+
"baseline_performance": "${ablation_analysis.output.impact_scores}",
|
|
173
|
+
"improvement_strategies": "${ablation_analysis.output.improvement_opportunities}",
|
|
174
|
+
"max_iterations": "${refinement_iterations}"
|
|
175
|
+
},
|
|
176
|
+
"timeout": 2400,
|
|
177
|
+
"output": {
|
|
178
|
+
"optimized_components": "object",
|
|
179
|
+
"performance_improvements": "object",
|
|
180
|
+
"refinement_history": "array",
|
|
181
|
+
"best_configuration": "object"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "ensemble_creation",
|
|
186
|
+
"name": "Adaptive Ensemble Building",
|
|
187
|
+
"type": "architecture",
|
|
188
|
+
"description": "Intelligently combine models using advanced ensemble techniques, not just averaging",
|
|
189
|
+
"assignTo": "ensemble_agent",
|
|
190
|
+
"depends": ["targeted_refinement"],
|
|
191
|
+
"input": {
|
|
192
|
+
"base_models": "${targeted_refinement.output.optimized_components}",
|
|
193
|
+
"individual_performances": "${targeted_refinement.output.performance_improvements}",
|
|
194
|
+
"ensemble_strategies": [
|
|
195
|
+
"stacking_with_meta_learner",
|
|
196
|
+
"dynamic_weighting",
|
|
197
|
+
"bayesian_model_averaging",
|
|
198
|
+
"mixture_of_experts"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"timeout": 1800,
|
|
202
|
+
"output": {
|
|
203
|
+
"ensemble_model": "object",
|
|
204
|
+
"ensemble_performance": "object",
|
|
205
|
+
"combination_strategy": "string",
|
|
206
|
+
"meta_learner_details": "object"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"id": "validation_and_debugging",
|
|
211
|
+
"name": "Comprehensive Validation & Error Correction",
|
|
212
|
+
"type": "testing",
|
|
213
|
+
"description": "Rigorous validation with data leakage prevention, error correction, and performance verification",
|
|
214
|
+
"assignTo": "validation_agent",
|
|
215
|
+
"depends": ["ensemble_creation"],
|
|
216
|
+
"input": {
|
|
217
|
+
"final_model": "${ensemble_creation.output.ensemble_model}",
|
|
218
|
+
"full_pipeline": "${targeted_refinement.output.best_configuration}",
|
|
219
|
+
"validation_config": {
|
|
220
|
+
"cv_folds": 5,
|
|
221
|
+
"test_size": 0.2,
|
|
222
|
+
"stratification": true,
|
|
223
|
+
"random_seed": 42
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"timeout": 900,
|
|
227
|
+
"output": {
|
|
228
|
+
"validation_results": "object",
|
|
229
|
+
"cross_validation_scores": "array",
|
|
230
|
+
"data_leakage_check": "boolean",
|
|
231
|
+
"error_analysis": "object",
|
|
232
|
+
"final_performance_metrics": "object"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"id": "model_deployment_prep",
|
|
237
|
+
"name": "Production Readiness & Deployment",
|
|
238
|
+
"type": "deployment",
|
|
239
|
+
"description": "Prepare model for production deployment with monitoring, versioning, and documentation",
|
|
240
|
+
"assignTo": "orchestrator",
|
|
241
|
+
"depends": ["validation_and_debugging"],
|
|
242
|
+
"input": {
|
|
243
|
+
"validated_model": "${validation_and_debugging.output}",
|
|
244
|
+
"performance_benchmarks": "${validation_and_debugging.output.final_performance_metrics}",
|
|
245
|
+
"deployment_target": "production"
|
|
246
|
+
},
|
|
247
|
+
"timeout": 600,
|
|
248
|
+
"condition": "${validation_and_debugging.output.final_performance_metrics.accuracy} > 0.85",
|
|
249
|
+
"output": {
|
|
250
|
+
"deployment_package": "object",
|
|
251
|
+
"model_documentation": "object",
|
|
252
|
+
"monitoring_config": "object",
|
|
253
|
+
"deployment_instructions": "string"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
"dependencies": {
|
|
258
|
+
"foundation_building": ["web_search_phase", "dataset_analysis"],
|
|
259
|
+
"ablation_analysis": ["foundation_building"],
|
|
260
|
+
"targeted_refinement": ["ablation_analysis"],
|
|
261
|
+
"ensemble_creation": ["targeted_refinement"],
|
|
262
|
+
"validation_and_debugging": ["ensemble_creation"],
|
|
263
|
+
"model_deployment_prep": ["validation_and_debugging"]
|
|
264
|
+
},
|
|
265
|
+
"settings": {
|
|
266
|
+
"maxConcurrency": 3,
|
|
267
|
+
"timeout": 7200,
|
|
268
|
+
"retryPolicy": "exponential",
|
|
269
|
+
"failurePolicy": "continue",
|
|
270
|
+
"quality_threshold": 0.8,
|
|
271
|
+
"enable_monitoring": true,
|
|
272
|
+
"save_intermediate_results": true,
|
|
273
|
+
"auto_documentation": true
|
|
274
|
+
},
|
|
275
|
+
"metadata": {
|
|
276
|
+
"methodology": "MLE-STAR",
|
|
277
|
+
"version": "2.0.0",
|
|
278
|
+
"created_by": "Claude Flow Automation",
|
|
279
|
+
"tags": ["machine_learning", "automation", "mle_star", "ensemble", "optimization"],
|
|
280
|
+
"description_detailed": "This workflow implements the MLE-STAR (Machine Learning Engineering via Search and Targeted Refinement) methodology. It starts with web search to find state-of-the-art approaches, builds a foundation model, performs ablation analysis to identify high-impact components, then deeply refines those components before creating intelligent ensembles and comprehensive validation.",
|
|
281
|
+
"success_criteria": [
|
|
282
|
+
"Performance improvement over baseline > 5%",
|
|
283
|
+
"No data leakage detected",
|
|
284
|
+
"Cross-validation score variance < 0.05",
|
|
285
|
+
"All components properly documented"
|
|
286
|
+
],
|
|
287
|
+
"expected_runtime": "2-4 hours",
|
|
288
|
+
"resource_requirements": {
|
|
289
|
+
"memory": "8GB+",
|
|
290
|
+
"storage": "10GB+",
|
|
291
|
+
"compute": "4+ CPU cores recommended"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fix for hive-mind creation time issue #246
|
|
3
|
+
* This file demonstrates how to properly handle timezones in hive-mind displays
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
getLocalTimestamp,
|
|
8
|
+
convertToLocalTime,
|
|
9
|
+
formatTimestampForDisplay,
|
|
10
|
+
getTimezoneInfo,
|
|
11
|
+
} from '../../utils/timezone-utils.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Fixed function to create session with proper timezone handling
|
|
15
|
+
*/
|
|
16
|
+
export function createSessionWithProperTimezone(objective, options = {}) {
|
|
17
|
+
const sessionId = `session-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
18
|
+
|
|
19
|
+
// Store both UTC timestamp (for consistency) and timezone info
|
|
20
|
+
const utcTimestamp = new Date().toISOString();
|
|
21
|
+
const localTimestamp = getLocalTimestamp();
|
|
22
|
+
const timezoneInfo = getTimezoneInfo();
|
|
23
|
+
|
|
24
|
+
const session = {
|
|
25
|
+
id: sessionId,
|
|
26
|
+
objective,
|
|
27
|
+
createdAt: utcTimestamp,
|
|
28
|
+
createdAtLocal: localTimestamp,
|
|
29
|
+
timezone: timezoneInfo,
|
|
30
|
+
status: 'active',
|
|
31
|
+
...options,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return session;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Fixed function to display session info with proper timezone
|
|
39
|
+
*/
|
|
40
|
+
export function displaySessionInfo(session) {
|
|
41
|
+
const timeDisplay = formatTimestampForDisplay(session.createdAt);
|
|
42
|
+
|
|
43
|
+
console.log(`๐ Hive Mind Session`);
|
|
44
|
+
console.log(`๐ ID: ${session.id}`);
|
|
45
|
+
console.log(`๐ฏ Objective: ${session.objective}`);
|
|
46
|
+
console.log(`โฐ Created: ${timeDisplay.display}`);
|
|
47
|
+
console.log(`๐ Timezone: ${session.timezone?.name || 'Unknown'}`);
|
|
48
|
+
console.log(`๐ Status: ${session.status}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Fixed function to list sessions with proper timezone display
|
|
53
|
+
*/
|
|
54
|
+
export function listSessionsWithTimezone(sessions) {
|
|
55
|
+
console.log('๐ Hive Mind Sessions:\n');
|
|
56
|
+
|
|
57
|
+
if (sessions.length === 0) {
|
|
58
|
+
console.log('No sessions found.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Table header
|
|
63
|
+
console.log('ID'.padEnd(25) + 'Objective'.padEnd(30) + 'Created'.padEnd(25) + 'Status');
|
|
64
|
+
console.log('-'.repeat(100));
|
|
65
|
+
|
|
66
|
+
sessions.forEach((session) => {
|
|
67
|
+
const timeDisplay = formatTimestampForDisplay(session.createdAt);
|
|
68
|
+
const id = session.id.length > 22 ? session.id.substr(0, 22) + '...' : session.id;
|
|
69
|
+
const objective =
|
|
70
|
+
session.objective.length > 27 ? session.objective.substr(0, 27) + '...' : session.objective;
|
|
71
|
+
|
|
72
|
+
console.log(
|
|
73
|
+
id.padEnd(25) + objective.padEnd(30) + timeDisplay.relative.padEnd(25) + session.status,
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
console.log(`\n๐ก Times shown in your timezone: ${getTimezoneInfo().name}`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Example usage and test function
|
|
82
|
+
*/
|
|
83
|
+
export function demonstrateTimezonefix() {
|
|
84
|
+
console.log('๐งช Testing timezone fix for issue #246\n');
|
|
85
|
+
|
|
86
|
+
// Show timezone info
|
|
87
|
+
const tz = getTimezoneInfo();
|
|
88
|
+
console.log(`๐ Your timezone: ${tz.name} (${tz.abbreviation})`);
|
|
89
|
+
console.log(`โฐ UTC offset: ${tz.offset > 0 ? '+' : ''}${tz.offset} hours\n`);
|
|
90
|
+
|
|
91
|
+
// Create sample session
|
|
92
|
+
const session = createSessionWithProperTimezone('Build microservices API', {
|
|
93
|
+
queenType: 'strategic',
|
|
94
|
+
maxWorkers: 6,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// Display with proper timezone
|
|
98
|
+
displaySessionInfo(session);
|
|
99
|
+
|
|
100
|
+
console.log('\n๐ Session list example:');
|
|
101
|
+
listSessionsWithTimezone([session]);
|
|
102
|
+
|
|
103
|
+
console.log("\nโ
Fix applied - timestamps now show in user's local timezone!");
|
|
104
|
+
}
|