mcoda 0.1.36 → 0.1.38
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/bin/McodaEntrypoint.d.ts.map +1 -1
- package/dist/bin/McodaEntrypoint.js +17 -1
- package/dist/commands/cloud/CloudCommands.d.ts +4 -0
- package/dist/commands/cloud/CloudCommands.d.ts.map +1 -0
- package/dist/commands/cloud/CloudCommands.js +249 -0
- package/dist/commands/config/ConfigCommands.d.ts +4 -0
- package/dist/commands/config/ConfigCommands.d.ts.map +1 -0
- package/dist/commands/config/ConfigCommands.js +33 -0
- package/dist/commands/planning/CreateTasksCommand.d.ts.map +1 -1
- package/dist/commands/planning/CreateTasksCommand.js +5 -1
- package/dist/commands/planning/RefineTasksCommand.d.ts +6 -0
- package/dist/commands/planning/RefineTasksCommand.d.ts.map +1 -1
- package/dist/commands/planning/RefineTasksCommand.js +23 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McodaEntrypoint.d.ts","sourceRoot":"","sources":["../../src/bin/McodaEntrypoint.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"McodaEntrypoint.d.ts","sourceRoot":"","sources":["../../src/bin/McodaEntrypoint.ts"],"names":[],"mappings":";AAiCA,qBAAa,eAAe;WACb,GAAG,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;CAqNxE"}
|
|
@@ -3,6 +3,8 @@ import { realpathSync } from "node:fs";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import packageJson from "../../package.json" with { type: "json" };
|
|
5
5
|
import { AgentsCommands } from "../commands/agents/AgentsCommands.js";
|
|
6
|
+
import { CloudCommands } from "../commands/cloud/CloudCommands.js";
|
|
7
|
+
import { ConfigCommands } from "../commands/config/ConfigCommands.js";
|
|
6
8
|
import { GatewayAgentCommand } from "../commands/agents/GatewayAgentCommand.js";
|
|
7
9
|
import { DocsCommands } from "../commands/docs/DocsCommands.js";
|
|
8
10
|
import { JobsCommands } from "../commands/jobs/JobsCommands.js";
|
|
@@ -83,8 +85,10 @@ export class McodaEntrypoint {
|
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
85
87
|
if (!command) {
|
|
86
|
-
throw new Error("Usage: mcoda <agent|gateway-agent|test-agent|agent-run|routing|docs|openapi|job|jobs|tokens|telemetry|create-tasks|migrate-tasks|refine-tasks|task-sufficiency-audit|sds-preflight|order-tasks|tasks|add-tests|work-on-tasks|gateway-trio|code-review|qa-tasks|backlog|task|task-detail|estimate|update|set-workspace|project-guidance|pdr|sds> [...args]\n" +
|
|
88
|
+
throw new Error("Usage: mcoda <agent|cloud|cloud-agent|config|gateway-agent|test-agent|agent-run|routing|docs|openapi|job|jobs|tokens|telemetry|create-tasks|migrate-tasks|refine-tasks|task-sufficiency-audit|sds-preflight|order-tasks|tasks|add-tests|work-on-tasks|gateway-trio|code-review|qa-tasks|backlog|task|task-detail|estimate|update|set-workspace|project-guidance|pdr|sds> [...args]\n" +
|
|
89
|
+
"Config: use `mcoda config set mswarm-api-key <KEY>` to persist an encrypted mswarm API key in the resolved global mcoda config file.\n" +
|
|
87
90
|
"Routing: use `mcoda routing defaults` to view/update workspace/global defaults, `mcoda routing preview|explain` to inspect agent selection/provenance (override → workspace_default → global_default).\n" +
|
|
91
|
+
"Cloud agents: use `mcoda cloud agent list|details|sync` to discover and materialize mswarm-managed remote agents.\n" +
|
|
88
92
|
"Aliases: `tasks order-by-deps` forwards to `order-tasks` (dependency-aware ordering), `task`/`task-detail` show a single task.\n" +
|
|
89
93
|
"Job commands (mcoda job --help for details): list|status|watch|logs|inspect|resume|cancel|tokens\n" +
|
|
90
94
|
"Jobs API required for job commands (set MCODA_API_BASE_URL/MCODA_JOBS_API_URL or workspace api.baseUrl). status/watch/logs exit non-zero on failed/cancelled jobs per SDS.");
|
|
@@ -93,6 +97,18 @@ export class McodaEntrypoint {
|
|
|
93
97
|
await AgentsCommands.run(rest);
|
|
94
98
|
return;
|
|
95
99
|
}
|
|
100
|
+
if (command === "cloud") {
|
|
101
|
+
await CloudCommands.run(rest);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (command === "config") {
|
|
105
|
+
await ConfigCommands.run(rest);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (command === "cloud-agent") {
|
|
109
|
+
await CloudCommands.run(["agent", ...rest]);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
96
112
|
if (command === "gateway-agent") {
|
|
97
113
|
await GatewayAgentCommand.run(rest);
|
|
98
114
|
return;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloudCommands.d.ts","sourceRoot":"","sources":["../../../src/commands/cloud/CloudCommands.ts"],"names":[],"mappings":"AAyLA,qBAAa,aAAa;WACX,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CA+EhD"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { MswarmApi } from "@mcoda/core";
|
|
2
|
+
const USAGE = `
|
|
3
|
+
Usage: mcoda cloud agent <list|details|sync> [options]
|
|
4
|
+
|
|
5
|
+
Subcommands:
|
|
6
|
+
agent list List mswarm cloud agents (supports --json)
|
|
7
|
+
--provider <NAME> Filter by provider
|
|
8
|
+
--limit <N> Limit returned agents
|
|
9
|
+
agent details <SLUG> Show a single mswarm cloud agent (supports --json)
|
|
10
|
+
agent sync Sync mswarm cloud agents into the local mcoda registry
|
|
11
|
+
--provider <NAME> Filter by provider before syncing
|
|
12
|
+
--limit <N> Limit synced agents
|
|
13
|
+
--agent-slug-prefix <P> Override the local managed-agent slug prefix
|
|
14
|
+
|
|
15
|
+
Connection options:
|
|
16
|
+
--base-url <URL> Override MCODA_MSWARM_BASE_URL (default: https://api.mswarm.org/)
|
|
17
|
+
--openai-base-url <URL> Override MCODA_MSWARM_OPENAI_BASE_URL for synced managed-agent execution
|
|
18
|
+
--api-key <KEY> Override MCODA_MSWARM_API_KEY
|
|
19
|
+
--timeout-ms <N> Override MCODA_MSWARM_TIMEOUT_MS
|
|
20
|
+
|
|
21
|
+
Environment:
|
|
22
|
+
MCODA_MSWARM_BASE_URL
|
|
23
|
+
MCODA_MSWARM_OPENAI_BASE_URL
|
|
24
|
+
MCODA_MSWARM_API_KEY
|
|
25
|
+
MCODA_MSWARM_TIMEOUT_MS
|
|
26
|
+
MCODA_MSWARM_AGENT_SLUG_PREFIX
|
|
27
|
+
Or persist the API key with: mcoda config set mswarm-api-key <KEY>
|
|
28
|
+
|
|
29
|
+
Flags:
|
|
30
|
+
--json Emit JSON for supported commands
|
|
31
|
+
--help Show this help
|
|
32
|
+
`.trim();
|
|
33
|
+
const parseArgs = (argv) => {
|
|
34
|
+
const flags = {};
|
|
35
|
+
const positionals = [];
|
|
36
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
37
|
+
const arg = argv[index];
|
|
38
|
+
if (arg.startsWith("--")) {
|
|
39
|
+
const key = arg.replace(/^--/, "");
|
|
40
|
+
const next = argv[index + 1];
|
|
41
|
+
if (next && !next.startsWith("--")) {
|
|
42
|
+
const current = flags[key];
|
|
43
|
+
if (current === undefined) {
|
|
44
|
+
flags[key] = next;
|
|
45
|
+
}
|
|
46
|
+
else if (Array.isArray(current)) {
|
|
47
|
+
flags[key] = [...current, next];
|
|
48
|
+
}
|
|
49
|
+
else if (typeof current === "string") {
|
|
50
|
+
flags[key] = [current, next];
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
flags[key] = [next];
|
|
54
|
+
}
|
|
55
|
+
index += 1;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
flags[key] = true;
|
|
59
|
+
}
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
positionals.push(arg);
|
|
63
|
+
}
|
|
64
|
+
return { flags, positionals };
|
|
65
|
+
};
|
|
66
|
+
const resolveString = (value) => {
|
|
67
|
+
if (value === undefined || typeof value === "boolean")
|
|
68
|
+
return undefined;
|
|
69
|
+
return Array.isArray(value) ? value[value.length - 1] : value;
|
|
70
|
+
};
|
|
71
|
+
const resolvePositiveInt = (value, label) => {
|
|
72
|
+
const raw = resolveString(value);
|
|
73
|
+
if (raw === undefined)
|
|
74
|
+
return undefined;
|
|
75
|
+
const parsed = Number.parseInt(raw, 10);
|
|
76
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
77
|
+
throw new Error(`Invalid ${label}; expected a positive integer`);
|
|
78
|
+
}
|
|
79
|
+
return parsed;
|
|
80
|
+
};
|
|
81
|
+
const formatNumber = (value) => value === undefined || Number.isNaN(value) ? "-" : String(value);
|
|
82
|
+
const formatCapabilities = (capabilities) => capabilities && capabilities.length > 0 ? capabilities.join(",") : "-";
|
|
83
|
+
const formatBoolean = (value) => value === undefined ? "-" : value ? "yes" : "no";
|
|
84
|
+
const pad = (value, width) => value.padEnd(width, " ");
|
|
85
|
+
const renderTable = (headers, rows) => {
|
|
86
|
+
const widths = headers.map((header, columnIndex) => Math.max(header.length, ...rows.map((row) => row[columnIndex]?.length ?? 0)));
|
|
87
|
+
const lines = [
|
|
88
|
+
headers.map((header, index) => pad(header, widths[index] ?? header.length)).join(" "),
|
|
89
|
+
widths.map((width) => "-".repeat(width)).join(" "),
|
|
90
|
+
...rows.map((row) => row.map((cell, index) => pad(cell, widths[index] ?? cell.length)).join(" ")),
|
|
91
|
+
];
|
|
92
|
+
return lines.join("\n");
|
|
93
|
+
};
|
|
94
|
+
const printAgentList = (agents) => {
|
|
95
|
+
if (agents.length === 0) {
|
|
96
|
+
// eslint-disable-next-line no-console
|
|
97
|
+
console.log("No cloud agents found.");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const headers = [
|
|
101
|
+
"REMOTE SLUG",
|
|
102
|
+
"PROVIDER",
|
|
103
|
+
"MODEL",
|
|
104
|
+
"RATING",
|
|
105
|
+
"REASON",
|
|
106
|
+
"MAX CPLX",
|
|
107
|
+
"TOOLS",
|
|
108
|
+
"HEALTH",
|
|
109
|
+
"PRICING",
|
|
110
|
+
"CAPABILITIES",
|
|
111
|
+
];
|
|
112
|
+
const rows = agents.map((agent) => [
|
|
113
|
+
agent.slug,
|
|
114
|
+
agent.provider,
|
|
115
|
+
agent.default_model,
|
|
116
|
+
formatNumber(agent.rating),
|
|
117
|
+
formatNumber(agent.reasoning_rating),
|
|
118
|
+
formatNumber(agent.max_complexity),
|
|
119
|
+
formatBoolean(agent.supports_tools),
|
|
120
|
+
agent.health_status ?? "-",
|
|
121
|
+
agent.pricing_version ?? "-",
|
|
122
|
+
formatCapabilities(agent.capabilities),
|
|
123
|
+
]);
|
|
124
|
+
// eslint-disable-next-line no-console
|
|
125
|
+
console.log(renderTable(headers, rows));
|
|
126
|
+
};
|
|
127
|
+
const printAgentDetails = (agent) => {
|
|
128
|
+
const entries = [
|
|
129
|
+
["Slug", agent.slug],
|
|
130
|
+
["Provider", agent.provider],
|
|
131
|
+
["Model", agent.default_model],
|
|
132
|
+
["Model ID", agent.model_id ?? "-"],
|
|
133
|
+
["Display name", agent.display_name ?? "-"],
|
|
134
|
+
["Description", agent.description ?? "-"],
|
|
135
|
+
["Rating", formatNumber(agent.rating)],
|
|
136
|
+
["Reasoning rating", formatNumber(agent.reasoning_rating)],
|
|
137
|
+
["Max complexity", formatNumber(agent.max_complexity)],
|
|
138
|
+
["Context window", formatNumber(agent.context_window)],
|
|
139
|
+
["Supports tools", formatBoolean(agent.supports_tools)],
|
|
140
|
+
["Supports reasoning", formatBoolean(agent.supports_reasoning)],
|
|
141
|
+
["Health", agent.health_status ?? "-"],
|
|
142
|
+
["Pricing version", agent.pricing_version ?? "-"],
|
|
143
|
+
["Pricing snapshot", agent.pricing_snapshot_id ?? "-"],
|
|
144
|
+
["Capabilities", formatCapabilities(agent.capabilities)],
|
|
145
|
+
];
|
|
146
|
+
const labelWidth = Math.max(...entries.map(([label]) => label.length));
|
|
147
|
+
for (const [label, value] of entries) {
|
|
148
|
+
// eslint-disable-next-line no-console
|
|
149
|
+
console.log(`${label.padEnd(labelWidth, " ")} : ${value}`);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const printSyncSummary = (summary) => {
|
|
153
|
+
// eslint-disable-next-line no-console
|
|
154
|
+
console.log(`Synced ${summary.agents.length} cloud agents (created=${summary.created}, updated=${summary.updated}).`);
|
|
155
|
+
if (summary.agents.length === 0) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const rows = summary.agents.map((record) => [
|
|
159
|
+
record.remoteSlug,
|
|
160
|
+
record.localSlug,
|
|
161
|
+
record.action,
|
|
162
|
+
record.provider,
|
|
163
|
+
record.defaultModel,
|
|
164
|
+
record.pricingVersion ?? "-",
|
|
165
|
+
]);
|
|
166
|
+
// eslint-disable-next-line no-console
|
|
167
|
+
console.log(renderTable(["REMOTE SLUG", "LOCAL SLUG", "ACTION", "PROVIDER", "MODEL", "PRICING"], rows));
|
|
168
|
+
};
|
|
169
|
+
export class CloudCommands {
|
|
170
|
+
static async run(argv) {
|
|
171
|
+
const [topic, rawSubcommand, ...rest] = argv;
|
|
172
|
+
if (!topic || argv.includes("--help") || argv.includes("-h")) {
|
|
173
|
+
// eslint-disable-next-line no-console
|
|
174
|
+
console.log(USAGE);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (topic !== "agent" && topic !== "agents") {
|
|
178
|
+
throw new Error(`Unknown cloud topic: ${topic}`);
|
|
179
|
+
}
|
|
180
|
+
const subcommand = rawSubcommand === "detail" || rawSubcommand === "show"
|
|
181
|
+
? "details"
|
|
182
|
+
: rawSubcommand;
|
|
183
|
+
if (!subcommand) {
|
|
184
|
+
// eslint-disable-next-line no-console
|
|
185
|
+
console.log(USAGE);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const parsed = parseArgs(rest);
|
|
189
|
+
const api = await MswarmApi.create({
|
|
190
|
+
baseUrl: resolveString(parsed.flags["base-url"]),
|
|
191
|
+
openAiBaseUrl: resolveString(parsed.flags["openai-base-url"]),
|
|
192
|
+
apiKey: resolveString(parsed.flags["api-key"]),
|
|
193
|
+
timeoutMs: resolvePositiveInt(parsed.flags["timeout-ms"], "--timeout-ms"),
|
|
194
|
+
agentSlugPrefix: resolveString(parsed.flags["agent-slug-prefix"]),
|
|
195
|
+
});
|
|
196
|
+
try {
|
|
197
|
+
switch (subcommand) {
|
|
198
|
+
case "list": {
|
|
199
|
+
const agents = await api.listCloudAgents({
|
|
200
|
+
provider: resolveString(parsed.flags.provider),
|
|
201
|
+
limit: resolvePositiveInt(parsed.flags.limit, "--limit"),
|
|
202
|
+
});
|
|
203
|
+
if (parsed.flags.json) {
|
|
204
|
+
// eslint-disable-next-line no-console
|
|
205
|
+
console.log(JSON.stringify(agents, null, 2));
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
printAgentList(agents);
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
case "details": {
|
|
213
|
+
const slug = parsed.positionals[0];
|
|
214
|
+
if (!slug) {
|
|
215
|
+
throw new Error("Usage: mcoda cloud agent details <SLUG> [--json]");
|
|
216
|
+
}
|
|
217
|
+
const agent = await api.getCloudAgent(slug);
|
|
218
|
+
if (parsed.flags.json) {
|
|
219
|
+
// eslint-disable-next-line no-console
|
|
220
|
+
console.log(JSON.stringify(agent, null, 2));
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
printAgentDetails(agent);
|
|
224
|
+
}
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
case "sync": {
|
|
228
|
+
const summary = await api.syncCloudAgents({
|
|
229
|
+
provider: resolveString(parsed.flags.provider),
|
|
230
|
+
limit: resolvePositiveInt(parsed.flags.limit, "--limit"),
|
|
231
|
+
});
|
|
232
|
+
if (parsed.flags.json) {
|
|
233
|
+
// eslint-disable-next-line no-console
|
|
234
|
+
console.log(JSON.stringify(summary, null, 2));
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
printSyncSummary(summary);
|
|
238
|
+
}
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
default:
|
|
242
|
+
throw new Error(`Unknown cloud subcommand: ${subcommand}`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
finally {
|
|
246
|
+
await api.close();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigCommands.d.ts","sourceRoot":"","sources":["../../../src/commands/config/ConfigCommands.ts"],"names":[],"mappings":"AAYA,qBAAa,cAAc;WACZ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAsBhD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MswarmConfigStore } from "@mcoda/core";
|
|
2
|
+
const USAGE = `
|
|
3
|
+
Usage: mcoda config set mswarm-api-key <KEY>
|
|
4
|
+
|
|
5
|
+
Subcommands:
|
|
6
|
+
set mswarm-api-key <KEY> Persist an encrypted global mswarm API key in the resolved global mcoda config file
|
|
7
|
+
|
|
8
|
+
Flags:
|
|
9
|
+
--help Show this help
|
|
10
|
+
`.trim();
|
|
11
|
+
export class ConfigCommands {
|
|
12
|
+
static async run(argv) {
|
|
13
|
+
const [subcommand, key, value] = argv;
|
|
14
|
+
if (!subcommand || argv.includes("--help") || argv.includes("-h")) {
|
|
15
|
+
// eslint-disable-next-line no-console
|
|
16
|
+
console.log(USAGE);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (subcommand !== "set") {
|
|
20
|
+
throw new Error(`Unknown config subcommand: ${subcommand}`);
|
|
21
|
+
}
|
|
22
|
+
if (key !== "mswarm-api-key") {
|
|
23
|
+
throw new Error(`Unknown config key: ${key ?? "<missing>"}`);
|
|
24
|
+
}
|
|
25
|
+
if (!value?.trim()) {
|
|
26
|
+
throw new Error("Usage: mcoda config set mswarm-api-key <KEY>");
|
|
27
|
+
}
|
|
28
|
+
const store = new MswarmConfigStore();
|
|
29
|
+
await store.saveApiKey(value);
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
31
|
+
console.log(`Saved encrypted mswarm API key to ${store.configPath()}.`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -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,sBAAsB,EAAE,OAAO,CAAC;IAChC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,wBAAwB,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACrD,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,KAAK,mBAAmB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,eAAO,MAAM,gBAAgB,QAIjB,CAAC;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AAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,KAAK,mBAAmB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,eAAO,MAAM,gBAAgB,QAIjB,CAAC;AAyDb,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,UAkNrD,CAAC;AAEF,qBAAa,kBAAkB;WAChB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CA2EhD"}
|
|
@@ -302,7 +302,7 @@ export const parseCreateTasksArgs = (argv) => {
|
|
|
302
302
|
workspaceRoot,
|
|
303
303
|
projectKey,
|
|
304
304
|
agentName,
|
|
305
|
-
agentStream: agentStream ??
|
|
305
|
+
agentStream: agentStream ?? Boolean(agentName),
|
|
306
306
|
rateAgents,
|
|
307
307
|
maxEpics: Number.isFinite(maxEpics) ? maxEpics : undefined,
|
|
308
308
|
maxStoriesPerEpic: Number.isFinite(maxStoriesPerEpic) ? maxStoriesPerEpic : undefined,
|
|
@@ -378,6 +378,10 @@ export class CreateTasksCommand {
|
|
|
378
378
|
`Stored in ${dbPath}.`,
|
|
379
379
|
`Job ID: ${result.jobId}, Command Run: ${result.commandRunId}`,
|
|
380
380
|
].join("\n"));
|
|
381
|
+
if (result.warnings.length > 0) {
|
|
382
|
+
// eslint-disable-next-line no-console
|
|
383
|
+
console.warn(result.warnings.join("\n"));
|
|
384
|
+
}
|
|
381
385
|
}
|
|
382
386
|
}
|
|
383
387
|
catch (error) {
|
|
@@ -35,6 +35,12 @@ export declare const pickRefineTasksProjectKey: (options: {
|
|
|
35
35
|
projectKey?: string;
|
|
36
36
|
warnings: string[];
|
|
37
37
|
};
|
|
38
|
+
export declare const getRefineResultStatus: (options: {
|
|
39
|
+
applied: boolean;
|
|
40
|
+
operations: number;
|
|
41
|
+
applyRequested: boolean;
|
|
42
|
+
dryRunRequested: boolean;
|
|
43
|
+
}) => "applied" | "dry_run" | "no_operations";
|
|
38
44
|
export declare const parseRefineTasksArgs: (argv: string[]) => ParsedRefineArgs;
|
|
39
45
|
export declare class RefineTasksCommand {
|
|
40
46
|
static run(argv: string[]): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefineTasksCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/planning/RefineTasksCommand.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,UAAU,gBAAgB;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;I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(", ");
|
|
75
75
|
};
|
|
76
|
+
export const getRefineResultStatus = (options) => {
|
|
77
|
+
if (options.applied)
|
|
78
|
+
return "applied";
|
|
79
|
+
if (options.operations === 0)
|
|
80
|
+
return "no_operations";
|
|
81
|
+
if (options.dryRunRequested || !options.applyRequested)
|
|
82
|
+
return "dry_run";
|
|
83
|
+
return "no_operations";
|
|
84
|
+
};
|
|
76
85
|
export const parseRefineTasksArgs = (argv) => {
|
|
77
86
|
let workspaceRoot;
|
|
78
87
|
let projectKey;
|
|
@@ -400,11 +409,18 @@ export class RefineTasksCommand {
|
|
|
400
409
|
...baseRequest,
|
|
401
410
|
maxTasks: parsed.maxTasks,
|
|
402
411
|
});
|
|
412
|
+
const operations = result.plan.operations.length;
|
|
413
|
+
const resultStatus = getRefineResultStatus({
|
|
414
|
+
applied: result.applied,
|
|
415
|
+
operations,
|
|
416
|
+
applyRequested: parsed.apply,
|
|
417
|
+
dryRunRequested: parsed.dryRun,
|
|
418
|
+
});
|
|
403
419
|
if (parsed.json) {
|
|
404
420
|
const warnings = [...commandWarnings, ...(result.plan.warnings ?? [])];
|
|
405
421
|
// eslint-disable-next-line no-console
|
|
406
422
|
console.log(JSON.stringify({
|
|
407
|
-
status:
|
|
423
|
+
status: resultStatus,
|
|
408
424
|
summary: result.summary,
|
|
409
425
|
plan: result.plan,
|
|
410
426
|
warnings,
|
|
@@ -412,9 +428,14 @@ export class RefineTasksCommand {
|
|
|
412
428
|
}
|
|
413
429
|
else {
|
|
414
430
|
const opSummary = formatCounts(result.plan.operations);
|
|
431
|
+
const appliedLabel = resultStatus === "applied"
|
|
432
|
+
? "yes"
|
|
433
|
+
: resultStatus === "dry_run"
|
|
434
|
+
? "no (dry run)"
|
|
435
|
+
: "no (no operations)";
|
|
415
436
|
const summaryLines = [
|
|
416
437
|
`Job: ${result.jobId}, Command Run: ${result.commandRunId}`,
|
|
417
|
-
`Applied: ${
|
|
438
|
+
`Applied: ${appliedLabel}`,
|
|
418
439
|
`Operations: ${result.plan.operations.length}${opSummary ? ` (${opSummary})` : ""}`,
|
|
419
440
|
result.summary
|
|
420
441
|
? `Tasks processed: ${result.summary.tasksProcessed}, affected: ${result.summary.tasksAffected}, story points delta: ${result.summary.storyPointsDelta ?? 0}`
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./commands/agents/AgentsCommands.js";
|
|
2
2
|
export * from "./bin/McodaEntrypoint.js";
|
|
3
|
+
export * from "./commands/cloud/CloudCommands.js";
|
|
4
|
+
export * from "./commands/config/ConfigCommands.js";
|
|
3
5
|
export * from "./commands/docs/DocsCommands.js";
|
|
4
6
|
export * from "./commands/jobs/JobsCommands.js";
|
|
5
7
|
export * from "./commands/openapi/OpenapiCommands.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./commands/agents/AgentsCommands.js";
|
|
2
2
|
export * from "./bin/McodaEntrypoint.js";
|
|
3
|
+
export * from "./commands/cloud/CloudCommands.js";
|
|
4
|
+
export * from "./commands/config/ConfigCommands.js";
|
|
3
5
|
export * from "./commands/docs/DocsCommands.js";
|
|
4
6
|
export * from "./commands/jobs/JobsCommands.js";
|
|
5
7
|
export * from "./commands/openapi/OpenapiCommands.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcoda",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
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/core": "0.1.
|
|
49
|
-
"@mcoda/shared": "0.1.
|
|
48
|
+
"@mcoda/core": "0.1.38",
|
|
49
|
+
"@mcoda/shared": "0.1.38"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@mcoda/db": "0.1.
|
|
53
|
-
"@mcoda/integrations": "0.1.
|
|
52
|
+
"@mcoda/db": "0.1.38",
|
|
53
|
+
"@mcoda/integrations": "0.1.38"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsc -p tsconfig.json",
|