mcoda 0.1.32 → 0.1.34
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/estimate/EstimateCommands.d.ts.map +1 -1
- package/dist/commands/estimate/EstimateCommands.js +59 -1
- package/dist/commands/planning/CreateTasksCommand.d.ts +1 -0
- package/dist/commands/planning/CreateTasksCommand.d.ts.map +1 -1
- package/dist/commands/planning/CreateTasksCommand.js +37 -11
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EstimateCommands.d.ts","sourceRoot":"","sources":["../../../src/commands/estimate/EstimateCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,cAAc,EAGf,MAAM,aAAa,CAAC;AAErB,UAAU,UAAU;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB;AAmCD,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,KAAG,UA4HlD,CAAC;
|
|
1
|
+
{"version":3,"file":"EstimateCommands.d.ts","sourceRoot":"","sources":["../../../src/commands/estimate/EstimateCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,cAAc,EAGf,MAAM,aAAa,CAAC;AAErB,UAAU,UAAU;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB;AAmCD,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,KAAG,UA4HlD,CAAC;AAqHF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,MAwBjE,CAAC;AA2OF,qBAAa,gBAAgB;WACd,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAkEhD"}
|
|
@@ -176,7 +176,65 @@ export const parseEstimateArgs = (argv) => {
|
|
|
176
176
|
};
|
|
177
177
|
const ANSI_REGEX = /\x1b\[[0-9;]*m/g;
|
|
178
178
|
const stripAnsi = (value) => value.replace(ANSI_REGEX, "");
|
|
179
|
-
|
|
179
|
+
// Mirrors common wcwidth full-width ranges so CJK/emoji cells align in terminal output.
|
|
180
|
+
const isFullWidthCodePoint = (codePoint) => {
|
|
181
|
+
if (codePoint >= 0x1100 && codePoint <= 0x115f)
|
|
182
|
+
return true;
|
|
183
|
+
if (codePoint >= 0x2329 && codePoint <= 0x232a)
|
|
184
|
+
return true;
|
|
185
|
+
if (codePoint >= 0x2e80 && codePoint <= 0x303e)
|
|
186
|
+
return true;
|
|
187
|
+
if (codePoint >= 0x3040 && codePoint <= 0xa4cf)
|
|
188
|
+
return true;
|
|
189
|
+
if (codePoint >= 0xac00 && codePoint <= 0xd7a3)
|
|
190
|
+
return true;
|
|
191
|
+
if (codePoint >= 0xf900 && codePoint <= 0xfaff)
|
|
192
|
+
return true;
|
|
193
|
+
if (codePoint >= 0xfe10 && codePoint <= 0xfe19)
|
|
194
|
+
return true;
|
|
195
|
+
if (codePoint >= 0xfe30 && codePoint <= 0xfe6f)
|
|
196
|
+
return true;
|
|
197
|
+
if (codePoint >= 0xff00 && codePoint <= 0xff60)
|
|
198
|
+
return true;
|
|
199
|
+
if (codePoint >= 0xffe0 && codePoint <= 0xffe6)
|
|
200
|
+
return true;
|
|
201
|
+
if (codePoint >= 0x1f300 && codePoint <= 0x1f64f)
|
|
202
|
+
return true;
|
|
203
|
+
if (codePoint >= 0x1f900 && codePoint <= 0x1f9ff)
|
|
204
|
+
return true;
|
|
205
|
+
if (codePoint >= 0x20000 && codePoint <= 0x3fffd)
|
|
206
|
+
return true;
|
|
207
|
+
return false;
|
|
208
|
+
};
|
|
209
|
+
const isCombiningCodePoint = (codePoint) => {
|
|
210
|
+
if (codePoint >= 0x0300 && codePoint <= 0x036f)
|
|
211
|
+
return true;
|
|
212
|
+
if (codePoint >= 0x1ab0 && codePoint <= 0x1aff)
|
|
213
|
+
return true;
|
|
214
|
+
if (codePoint >= 0x1dc0 && codePoint <= 0x1dff)
|
|
215
|
+
return true;
|
|
216
|
+
if (codePoint >= 0x20d0 && codePoint <= 0x20ff)
|
|
217
|
+
return true;
|
|
218
|
+
if (codePoint >= 0xfe20 && codePoint <= 0xfe2f)
|
|
219
|
+
return true;
|
|
220
|
+
return false;
|
|
221
|
+
};
|
|
222
|
+
const visibleLength = (value) => {
|
|
223
|
+
const plain = stripAnsi(value);
|
|
224
|
+
if (!plain)
|
|
225
|
+
return 0;
|
|
226
|
+
let width = 0;
|
|
227
|
+
for (const ch of plain) {
|
|
228
|
+
// Zero-width shaping/selectors.
|
|
229
|
+
if (ch === "\u200d" || ch === "\ufe0e" || ch === "\ufe0f")
|
|
230
|
+
continue;
|
|
231
|
+
const codePoint = ch.codePointAt(0);
|
|
232
|
+
if (codePoint === undefined || isCombiningCodePoint(codePoint))
|
|
233
|
+
continue;
|
|
234
|
+
width += isFullWidthCodePoint(codePoint) ? 2 : 1;
|
|
235
|
+
}
|
|
236
|
+
return width;
|
|
237
|
+
};
|
|
180
238
|
const padVisible = (value, width) => {
|
|
181
239
|
const diff = width - visibleLength(value);
|
|
182
240
|
return diff > 0 ? `${value}${" ".repeat(diff)}` : value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateTasksCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/planning/CreateTasksCommand.ts"],"names":[],"mappings":"AAKA,UAAU,UAAU;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB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M,CAAA;CAAE,CAAC;AA2D5D,eAAO,MAAM,yBAAyB,GAAI,SAAS;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC,KAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAiD3C,CAAC;AAUF,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,EAAE,KAAG,UA0LrD,CAAC;AAEF,qBAAa,kBAAkB;WAChB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAsEhD"}
|
|
@@ -2,7 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import { promises as fs } from "node:fs";
|
|
3
3
|
import { CreateTasksService, WorkspaceResolver } from "@mcoda/core";
|
|
4
4
|
import { PathHelper } from "@mcoda/shared";
|
|
5
|
-
const usage = `mcoda create-tasks [INPUT...] [--workspace-root <path>] [--project-key <key>] [--agent <name>] [--agent-stream [true|false]] [--rate-agents] [--force] [--max-epics N] [--max-stories-per-epic N] [--max-tasks-per-story N] [--qa-profile <csv>] [--qa-entry-url <url>] [--qa-start-command <cmd>] [--qa-requires <csv>] [--sds-preflight-commit [true|false]] [--sds-preflight-commit-message <text>] [--quiet]`;
|
|
5
|
+
const usage = `mcoda create-tasks [INPUT...] [--workspace-root <path>] [--project-key <key>] [--agent <name>] [--agent-stream [true|false]] [--rate-agents] [--force] [--max-epics N] [--max-stories-per-epic N] [--max-tasks-per-story N] [--qa-profile <csv>] [--qa-entry-url <url>] [--qa-start-command <cmd>] [--qa-requires <csv>] [--sds-preflight-commit [true|false]] [--sds-preflight-commit-message <text>] [--unknown-epic-service-policy <auto-remediate|fail>] [--quiet]`;
|
|
6
6
|
const readWorkspaceConfig = async (mcodaDir) => {
|
|
7
7
|
const configPath = path.join(mcodaDir, "config.json");
|
|
8
8
|
try {
|
|
@@ -85,17 +85,13 @@ export const pickCreateTasksProjectKey = (options) => {
|
|
|
85
85
|
}
|
|
86
86
|
return { projectKey: configuredKey, warnings };
|
|
87
87
|
}
|
|
88
|
-
if (latestExisting) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
if (existing.length > 1) {
|
|
94
|
-
warnings.push(`Multiple task plan folders detected (${existing.map((item) => item.key).join(", ")}); using "${selected}".`);
|
|
95
|
-
}
|
|
96
|
-
return { projectKey: selected, warnings };
|
|
88
|
+
if (latestExisting && latestExisting !== derivedKey) {
|
|
89
|
+
warnings.push(`Existing task plans were found for "${latestExisting}", but using derived project key "${derivedKey}" to avoid accidental cross-project reuse. Pass --project-key to reuse an existing project.`);
|
|
90
|
+
}
|
|
91
|
+
if (existing.length > 1) {
|
|
92
|
+
warnings.push(`Multiple task plan folders detected (${existing.map((item) => item.key).join(", ")}); using derived project key "${derivedKey}".`);
|
|
97
93
|
}
|
|
98
|
-
return { projectKey:
|
|
94
|
+
return { projectKey: derivedKey, warnings };
|
|
99
95
|
};
|
|
100
96
|
const parseBooleanFlag = (value, defaultValue) => {
|
|
101
97
|
if (value === undefined)
|
|
@@ -125,6 +121,15 @@ export const parseCreateTasksArgs = (argv) => {
|
|
|
125
121
|
let qaRequires;
|
|
126
122
|
let sdsPreflightCommit = false;
|
|
127
123
|
let sdsPreflightCommitMessage;
|
|
124
|
+
let unknownEpicServicePolicy;
|
|
125
|
+
const normalizePolicy = (value) => {
|
|
126
|
+
if (!value)
|
|
127
|
+
return undefined;
|
|
128
|
+
const normalized = value.trim().toLowerCase();
|
|
129
|
+
if (normalized === "auto-remediate" || normalized === "fail")
|
|
130
|
+
return normalized;
|
|
131
|
+
return undefined;
|
|
132
|
+
};
|
|
128
133
|
for (let i = 0; i < argv.length; i += 1) {
|
|
129
134
|
const arg = argv[i];
|
|
130
135
|
if (arg.startsWith("--")) {
|
|
@@ -138,6 +143,15 @@ export const parseCreateTasksArgs = (argv) => {
|
|
|
138
143
|
sdsPreflightCommit = parseBooleanFlag(raw, true);
|
|
139
144
|
continue;
|
|
140
145
|
}
|
|
146
|
+
if (arg.startsWith("--unknown-epic-service-policy=")) {
|
|
147
|
+
const [, raw] = arg.split("=", 2);
|
|
148
|
+
const normalizedPolicy = normalizePolicy(raw);
|
|
149
|
+
if (!normalizedPolicy) {
|
|
150
|
+
throw new Error(`Invalid --unknown-epic-service-policy value: ${raw}. Expected auto-remediate or fail.`);
|
|
151
|
+
}
|
|
152
|
+
unknownEpicServicePolicy = normalizedPolicy;
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
141
155
|
switch (arg) {
|
|
142
156
|
case "--workspace-root":
|
|
143
157
|
workspaceRoot = argv[i + 1] ? path.resolve(argv[i + 1]) : undefined;
|
|
@@ -227,6 +241,16 @@ export const parseCreateTasksArgs = (argv) => {
|
|
|
227
241
|
sdsPreflightCommitMessage = argv[i + 1];
|
|
228
242
|
i += 1;
|
|
229
243
|
break;
|
|
244
|
+
case "--unknown-epic-service-policy": {
|
|
245
|
+
const value = argv[i + 1];
|
|
246
|
+
const normalizedPolicy = normalizePolicy(value);
|
|
247
|
+
if (!normalizedPolicy) {
|
|
248
|
+
throw new Error(`Invalid --unknown-epic-service-policy value: ${value ?? "(missing)"}. Expected auto-remediate or fail.`);
|
|
249
|
+
}
|
|
250
|
+
unknownEpicServicePolicy = normalizedPolicy;
|
|
251
|
+
i += 1;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
230
254
|
case "--quiet":
|
|
231
255
|
quiet = true;
|
|
232
256
|
break;
|
|
@@ -264,6 +288,7 @@ export const parseCreateTasksArgs = (argv) => {
|
|
|
264
288
|
qaRequires,
|
|
265
289
|
sdsPreflightCommit,
|
|
266
290
|
sdsPreflightCommitMessage,
|
|
291
|
+
unknownEpicServicePolicy,
|
|
267
292
|
inputs,
|
|
268
293
|
};
|
|
269
294
|
};
|
|
@@ -314,6 +339,7 @@ export class CreateTasksCommand {
|
|
|
314
339
|
qaRequires: parsed.qaRequires,
|
|
315
340
|
sdsPreflightCommit: parsed.sdsPreflightCommit,
|
|
316
341
|
sdsPreflightCommitMessage: parsed.sdsPreflightCommitMessage,
|
|
342
|
+
unknownEpicServicePolicy: parsed.unknownEpicServicePolicy,
|
|
317
343
|
});
|
|
318
344
|
const dbPath = PathHelper.getWorkspaceDbPath(workspace.workspaceRoot);
|
|
319
345
|
if (!parsed.quiet) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcoda",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"description": "Local-first CLI for planning, documentation, and execution workflows with agent assistance.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"yaml": "^2.4.2",
|
|
48
|
-
"@mcoda/
|
|
49
|
-
"@mcoda/
|
|
48
|
+
"@mcoda/core": "0.1.34",
|
|
49
|
+
"@mcoda/shared": "0.1.34"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@mcoda/db": "0.1.
|
|
53
|
-
"@mcoda/integrations": "0.1.
|
|
52
|
+
"@mcoda/db": "0.1.34",
|
|
53
|
+
"@mcoda/integrations": "0.1.34"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsc -p tsconfig.json",
|