task-o-matic 0.0.21 → 0.0.23
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/commands/install.d.ts +3 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +150 -0
- package/dist/commands/prd.d.ts +5 -0
- package/dist/commands/prd.d.ts.map +1 -1
- package/dist/commands/prd.js +297 -189
- package/dist/commands/tasks/split.d.ts.map +1 -1
- package/dist/commands/tasks/split.js +129 -27
- package/dist/commands/utils/ai-parallel.d.ts +20 -0
- package/dist/commands/utils/ai-parallel.d.ts.map +1 -0
- package/dist/commands/utils/ai-parallel.js +115 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/ai-service/gemini-proxy.d.ts +15 -0
- package/dist/lib/ai-service/gemini-proxy.d.ts.map +1 -0
- package/dist/lib/ai-service/gemini-proxy.js +90 -0
- package/dist/lib/ai-service/json-parser.d.ts +16 -4
- package/dist/lib/ai-service/json-parser.d.ts.map +1 -1
- package/dist/lib/ai-service/json-parser.js +93 -19
- package/dist/lib/ai-service/model-provider.d.ts.map +1 -1
- package/dist/lib/ai-service/model-provider.js +31 -2
- package/dist/lib/ai-service/prd-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/prd-operations.js +21 -5
- package/dist/lib/ai-service/task-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/task-operations.js +10 -2
- package/dist/lib/better-t-stack-cli.d.ts.map +1 -1
- package/dist/lib/better-t-stack-cli.js +6 -5
- package/dist/lib/config-validation.d.ts +9 -9
- package/dist/lib/config-validation.d.ts.map +1 -1
- package/dist/lib/config-validation.js +11 -3
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +11 -2
- package/dist/lib/provider-defaults.json +11 -1
- package/dist/services/tasks.d.ts.map +1 -1
- package/dist/services/tasks.js +25 -15
- package/dist/test/commands.test.js +10 -10
- package/dist/test/model-parsing.test.d.ts +2 -0
- package/dist/test/model-parsing.test.d.ts.map +1 -0
- package/dist/test/model-parsing.test.js +73 -0
- package/dist/types/cli-options.d.ts +2 -0
- package/dist/types/cli-options.d.ts.map +1 -1
- package/dist/types/index.d.ts +12 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +10 -0
- package/dist/utils/ai-operation-utility.d.ts.map +1 -1
- package/dist/utils/ai-operation-utility.js +26 -2
- package/dist/utils/metadata-utils.d.ts +1 -1
- package/dist/utils/streaming-utils.d.ts.map +1 -1
- package/dist/utils/streaming-utils.js +4 -0
- package/docs/agents/cli.md +19 -12
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,cAAc,SAkCvB,CAAC"}
|
|
@@ -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
|
+
}
|
package/dist/commands/prd.d.ts
CHANGED
|
@@ -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;
|
|
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"}
|