task-o-matic 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/commands/benchmark.js +203 -173
  2. package/dist/commands/install.d.ts +3 -0
  3. package/dist/commands/install.d.ts.map +1 -0
  4. package/dist/commands/install.js +150 -0
  5. package/dist/commands/prd.d.ts +5 -0
  6. package/dist/commands/prd.d.ts.map +1 -1
  7. package/dist/commands/prd.js +297 -189
  8. package/dist/commands/tasks/split.d.ts.map +1 -1
  9. package/dist/commands/tasks/split.js +129 -27
  10. package/dist/commands/utils/ai-parallel.d.ts +20 -0
  11. package/dist/commands/utils/ai-parallel.d.ts.map +1 -0
  12. package/dist/commands/utils/ai-parallel.js +115 -0
  13. package/dist/commands/workflow.d.ts.map +1 -1
  14. package/dist/commands/workflow.js +59 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +3 -1
  17. package/dist/lib/ai-service/gemini-proxy.d.ts +15 -0
  18. package/dist/lib/ai-service/gemini-proxy.d.ts.map +1 -0
  19. package/dist/lib/ai-service/gemini-proxy.js +90 -0
  20. package/dist/lib/ai-service/json-parser.d.ts +16 -4
  21. package/dist/lib/ai-service/json-parser.d.ts.map +1 -1
  22. package/dist/lib/ai-service/json-parser.js +93 -19
  23. package/dist/lib/ai-service/model-provider.d.ts.map +1 -1
  24. package/dist/lib/ai-service/model-provider.js +31 -2
  25. package/dist/lib/ai-service/prd-operations.d.ts.map +1 -1
  26. package/dist/lib/ai-service/prd-operations.js +21 -5
  27. package/dist/lib/ai-service/task-operations.d.ts.map +1 -1
  28. package/dist/lib/ai-service/task-operations.js +10 -2
  29. package/dist/lib/better-t-stack-cli.d.ts.map +1 -1
  30. package/dist/lib/better-t-stack-cli.js +6 -5
  31. package/dist/lib/config-validation.d.ts +9 -9
  32. package/dist/lib/config-validation.d.ts.map +1 -1
  33. package/dist/lib/config-validation.js +11 -3
  34. package/dist/lib/config.d.ts.map +1 -1
  35. package/dist/lib/config.js +11 -2
  36. package/dist/lib/git-utils.d.ts +35 -0
  37. package/dist/lib/git-utils.d.ts.map +1 -1
  38. package/dist/lib/git-utils.js +69 -0
  39. package/dist/lib/provider-defaults.json +11 -1
  40. package/dist/lib/task-loop-execution.d.ts.map +1 -1
  41. package/dist/lib/task-loop-execution.js +5 -1
  42. package/dist/services/benchmark.d.ts +14 -0
  43. package/dist/services/benchmark.d.ts.map +1 -1
  44. package/dist/services/benchmark.js +325 -0
  45. package/dist/services/tasks.d.ts.map +1 -1
  46. package/dist/services/tasks.js +25 -15
  47. package/dist/services/workflow.d.ts +12 -0
  48. package/dist/services/workflow.d.ts.map +1 -1
  49. package/dist/services/workflow.js +20 -0
  50. package/dist/test/commands.test.js +10 -10
  51. package/dist/test/model-parsing.test.d.ts +2 -0
  52. package/dist/test/model-parsing.test.d.ts.map +1 -0
  53. package/dist/test/model-parsing.test.js +73 -0
  54. package/dist/types/cli-options.d.ts +2 -0
  55. package/dist/types/cli-options.d.ts.map +1 -1
  56. package/dist/types/index.d.ts +13 -1
  57. package/dist/types/index.d.ts.map +1 -1
  58. package/dist/types/index.js +10 -0
  59. package/dist/types/workflow-options.d.ts +25 -0
  60. package/dist/types/workflow-options.d.ts.map +1 -1
  61. package/dist/utils/ai-operation-utility.d.ts.map +1 -1
  62. package/dist/utils/ai-operation-utility.js +26 -2
  63. package/dist/utils/metadata-utils.d.ts +1 -1
  64. package/dist/utils/streaming-utils.d.ts.map +1 -1
  65. package/dist/utils/streaming-utils.js +8 -0
  66. package/docs/agents/cli.md +19 -12
  67. package/package.json +1 -1
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.installCommand = void 0;
7
+ const commander_1 = require("commander");
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const fs_1 = require("fs");
10
+ const path_1 = require("path");
11
+ exports.installCommand = new commander_1.Command("install")
12
+ .description("Install task-o-matic documentation and agent guides into current project")
13
+ .argument("<target>", "Installation target: doc, claude, or agents")
14
+ .option("--force", "Overwrite existing files", false)
15
+ .action(async (target, options) => {
16
+ try {
17
+ // Validate target
18
+ const validTargets = ["doc", "claude", "agents"];
19
+ if (!validTargets.includes(target)) {
20
+ console.error(chalk_1.default.red(`Invalid target: ${target}`));
21
+ console.error(chalk_1.default.yellow(`Valid targets: ${validTargets.join(", ")}`));
22
+ process.exit(1);
23
+ }
24
+ // Get package docs directory
25
+ const packageDocsDir = getPackageDocsDir();
26
+ const currentDir = process.cwd();
27
+ // Execute based on target
28
+ switch (target) {
29
+ case "doc":
30
+ await installDoc(packageDocsDir, currentDir, options.force);
31
+ break;
32
+ case "claude":
33
+ await installClaude(packageDocsDir, currentDir, options.force);
34
+ break;
35
+ case "agents":
36
+ await installAgents(packageDocsDir, currentDir, options.force);
37
+ break;
38
+ }
39
+ }
40
+ catch (error) {
41
+ console.error(chalk_1.default.red("Install failed:"), error instanceof Error ? error.message : String(error));
42
+ process.exit(1);
43
+ }
44
+ });
45
+ function getPackageDocsDir() {
46
+ // Try multiple approaches to find the docs directory
47
+ let docsPath = (0, path_1.resolve)(__dirname, "../../docs");
48
+ // Check if we're in development (running from src/)
49
+ if (!(0, fs_1.existsSync)(docsPath)) {
50
+ docsPath = (0, path_1.resolve)(process.cwd(), "docs");
51
+ }
52
+ // Check if we're installed as a dependency
53
+ if (!(0, fs_1.existsSync)(docsPath)) {
54
+ try {
55
+ docsPath = require.resolve("task-o-matic/docs");
56
+ }
57
+ catch (e) {
58
+ // Ignore if not found
59
+ }
60
+ }
61
+ return docsPath;
62
+ }
63
+ async function installDoc(packageDocsDir, currentDir, force) {
64
+ console.log(chalk_1.default.blue("Installing task-o-matic help documentation..."));
65
+ const sourceFile = (0, path_1.join)(packageDocsDir, "task-o-matic_help.md");
66
+ const targetDir = (0, path_1.join)(currentDir, "docs");
67
+ const targetFile = (0, path_1.join)(targetDir, "task-o-matic_help.md");
68
+ // Check if source file exists
69
+ if (!(0, fs_1.existsSync)(sourceFile)) {
70
+ throw new Error(`Source file not found: ${sourceFile}`);
71
+ }
72
+ // Check if target already exists
73
+ if ((0, fs_1.existsSync)(targetFile) && !force) {
74
+ console.error(chalk_1.default.red("docs/task-o-matic_help.md already exists"));
75
+ console.log(chalk_1.default.yellow("Use --force to overwrite"));
76
+ return;
77
+ }
78
+ // Create docs directory if it doesn't exist
79
+ if (!(0, fs_1.existsSync)(targetDir)) {
80
+ (0, fs_1.mkdirSync)(targetDir, { recursive: true });
81
+ console.log(chalk_1.default.green(`✓ Created directory: docs/`));
82
+ }
83
+ // Copy the file
84
+ const content = (0, fs_1.readFileSync)(sourceFile, "utf-8");
85
+ (0, fs_1.writeFileSync)(targetFile, content, "utf-8");
86
+ console.log(chalk_1.default.green(`✓ Installed help documentation to docs/task-o-matic_help.md`));
87
+ }
88
+ async function installClaude(packageDocsDir, currentDir, force) {
89
+ console.log(chalk_1.default.blue("Installing Claude agent guide..."));
90
+ const sourceFile = (0, path_1.join)(packageDocsDir, "agents", "cli.md");
91
+ const targetFile = (0, path_1.join)(currentDir, "CLAUDE.md");
92
+ // Check if source file exists
93
+ if (!(0, fs_1.existsSync)(sourceFile)) {
94
+ throw new Error(`Source file not found: ${sourceFile}`);
95
+ }
96
+ // Check if target exists
97
+ if (!(0, fs_1.existsSync)(targetFile)) {
98
+ console.error(chalk_1.default.red("CLAUDE.md not found in current directory"));
99
+ console.log(chalk_1.default.yellow("Create a CLAUDE.md file first, then run this command"));
100
+ return;
101
+ }
102
+ // Check if content already exists
103
+ const existingContent = (0, fs_1.readFileSync)(targetFile, "utf-8");
104
+ const newContent = (0, fs_1.readFileSync)(sourceFile, "utf-8");
105
+ if (existingContent.includes(newContent.trim()) && !force) {
106
+ console.log(chalk_1.default.yellow("✓ Claude agent guide already present in CLAUDE.md"));
107
+ return;
108
+ }
109
+ // Append the content with proper formatting
110
+ const separator = "\n\n---\n\n";
111
+ const header = "\n\n# Task-o-matic CLI Agent Guide\n\n";
112
+ const contentToAppend = header + newContent + separator;
113
+ (0, fs_1.appendFileSync)(targetFile, contentToAppend, "utf-8");
114
+ console.log(chalk_1.default.green(`✓ Added Claude agent guide to CLAUDE.md`));
115
+ }
116
+ async function installAgents(packageDocsDir, currentDir, force) {
117
+ console.log(chalk_1.default.blue("Installing agents guide..."));
118
+ const sourceFile = (0, path_1.join)(packageDocsDir, "agents", "cli.md");
119
+ const targetFile = (0, path_1.join)(currentDir, "AGENTS.md");
120
+ // Check if source file exists
121
+ if (!(0, fs_1.existsSync)(sourceFile)) {
122
+ throw new Error(`Source file not found: ${sourceFile}`);
123
+ }
124
+ let existingContent = "";
125
+ const fileExists = (0, fs_1.existsSync)(targetFile);
126
+ if (fileExists) {
127
+ existingContent = (0, fs_1.readFileSync)(targetFile, "utf-8");
128
+ }
129
+ else {
130
+ // Create AGENTS.md with basic header
131
+ existingContent = "# AGENTS.md\n\nThis file contains agent integration guides.\n";
132
+ }
133
+ const newContent = (0, fs_1.readFileSync)(sourceFile, "utf-8");
134
+ // Check if content already exists
135
+ if (existingContent.includes(newContent.trim()) && !force) {
136
+ console.log(chalk_1.default.yellow("✓ Agent guide already present in AGENTS.md"));
137
+ return;
138
+ }
139
+ // Append the content with proper formatting
140
+ const separator = "\n\n---\n\n";
141
+ const header = "\n\n# Task-o-matic CLI Agent Guide\n\n";
142
+ const contentToAppend = header + newContent + separator;
143
+ if (fileExists) {
144
+ (0, fs_1.appendFileSync)(targetFile, contentToAppend, "utf-8");
145
+ }
146
+ else {
147
+ (0, fs_1.writeFileSync)(targetFile, existingContent + contentToAppend, "utf-8");
148
+ }
149
+ console.log(chalk_1.default.green(`✓ Added agent guide to AGENTS.md`));
150
+ }
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
3
  export declare const prdCommand: Command;
4
+ export declare function parseModelString(modelStr: string): {
5
+ provider?: string;
6
+ model: string;
7
+ reasoning?: string;
8
+ };
4
9
  //# sourceMappingURL=prd.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prd.d.ts","sourceRoot":"","sources":["../../src/commands/prd.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,eAAO,MAAM,UAAU,SAEtB,CAAC"}
1
+ {"version":3,"file":"prd.d.ts","sourceRoot":"","sources":["../../src/commands/prd.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,eAAO,MAAM,UAAU,SAEtB,CAAC;AAWF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAkDA"}