@mcoda/shared 0.1.3
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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/crypto/CryptoHelper.d.ts +15 -0
- package/dist/crypto/CryptoHelper.d.ts.map +1 -0
- package/dist/crypto/CryptoHelper.js +54 -0
- package/dist/errors/ErrorFactory.d.ts +3 -0
- package/dist/errors/ErrorFactory.d.ts.map +1 -0
- package/dist/errors/ErrorFactory.js +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/logging/Logger.d.ts +3 -0
- package/dist/logging/Logger.d.ts.map +1 -0
- package/dist/logging/Logger.js +2 -0
- package/dist/metadata/CommandMetadata.d.ts +6 -0
- package/dist/metadata/CommandMetadata.d.ts.map +1 -0
- package/dist/metadata/CommandMetadata.js +152 -0
- package/dist/openapi/OpenApiTypes.d.ts +276 -0
- package/dist/openapi/OpenApiTypes.d.ts.map +1 -0
- package/dist/openapi/OpenApiTypes.js +1 -0
- package/dist/paths/PathHelper.d.ts +12 -0
- package/dist/paths/PathHelper.d.ts.map +1 -0
- package/dist/paths/PathHelper.js +24 -0
- package/dist/qa/QaProfile.d.ts +15 -0
- package/dist/qa/QaProfile.d.ts.map +1 -0
- package/dist/qa/QaProfile.js +1 -0
- package/dist/utils/UtilityService.d.ts +3 -0
- package/dist/utils/UtilityService.d.ts.map +1 -0
- package/dist/utils/UtilityService.js +2 -0
- package/package.json +40 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 bekir dag
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class CryptoHelper {
|
|
2
|
+
private static loadOrCreateKey;
|
|
3
|
+
/**
|
|
4
|
+
* Encrypts a plaintext payload using AES-256-GCM and returns a base64 blob
|
|
5
|
+
* that contains IV + auth tag + ciphertext. The encryption key is stored
|
|
6
|
+
* under ~/.mcoda/ with user-only permissions.
|
|
7
|
+
*/
|
|
8
|
+
static encryptSecret(plaintext: string): Promise<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Decrypts a secret previously produced by encryptSecret. Throws if the
|
|
11
|
+
* payload is malformed or the authentication tag does not validate.
|
|
12
|
+
*/
|
|
13
|
+
static decryptSecret(payload: string): Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=CryptoHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CryptoHelper.d.ts","sourceRoot":"","sources":["../../src/crypto/CryptoHelper.ts"],"names":[],"mappings":"AAWA,qBAAa,YAAY;mBACF,eAAe;IAepC;;;;OAIG;WACU,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAS9D;;;OAGG;WACU,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAW7D"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
4
|
+
import { PathHelper } from "../paths/PathHelper.js";
|
|
5
|
+
const KEY_FILENAME = "mcoda.key";
|
|
6
|
+
const IV_LENGTH = 12; // AES-GCM recommended IV size
|
|
7
|
+
const AUTH_TAG_LENGTH = 16;
|
|
8
|
+
const KEY_LENGTH = 32; // 256-bit
|
|
9
|
+
export class CryptoHelper {
|
|
10
|
+
static async loadOrCreateKey() {
|
|
11
|
+
const dir = PathHelper.getGlobalMcodaDir();
|
|
12
|
+
await PathHelper.ensureDir(dir);
|
|
13
|
+
const keyPath = path.join(dir, KEY_FILENAME);
|
|
14
|
+
try {
|
|
15
|
+
const existing = await fs.readFile(keyPath);
|
|
16
|
+
if (existing.length === KEY_LENGTH)
|
|
17
|
+
return existing;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
/* ignored */
|
|
21
|
+
}
|
|
22
|
+
const key = randomBytes(KEY_LENGTH);
|
|
23
|
+
await fs.writeFile(keyPath, key, { mode: 0o600 });
|
|
24
|
+
return key;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Encrypts a plaintext payload using AES-256-GCM and returns a base64 blob
|
|
28
|
+
* that contains IV + auth tag + ciphertext. The encryption key is stored
|
|
29
|
+
* under ~/.mcoda/ with user-only permissions.
|
|
30
|
+
*/
|
|
31
|
+
static async encryptSecret(plaintext) {
|
|
32
|
+
const key = await this.loadOrCreateKey();
|
|
33
|
+
const iv = randomBytes(IV_LENGTH);
|
|
34
|
+
const cipher = createCipheriv("aes-256-gcm", key, iv);
|
|
35
|
+
const ciphertext = Buffer.concat([cipher.update(plaintext, "utf8"), cipher.final()]);
|
|
36
|
+
const authTag = cipher.getAuthTag();
|
|
37
|
+
return Buffer.concat([iv, authTag, ciphertext]).toString("base64");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Decrypts a secret previously produced by encryptSecret. Throws if the
|
|
41
|
+
* payload is malformed or the authentication tag does not validate.
|
|
42
|
+
*/
|
|
43
|
+
static async decryptSecret(payload) {
|
|
44
|
+
const buffer = Buffer.from(payload, "base64");
|
|
45
|
+
const iv = buffer.subarray(0, IV_LENGTH);
|
|
46
|
+
const authTag = buffer.subarray(IV_LENGTH, IV_LENGTH + AUTH_TAG_LENGTH);
|
|
47
|
+
const ciphertext = buffer.subarray(IV_LENGTH + AUTH_TAG_LENGTH);
|
|
48
|
+
const key = await this.loadOrCreateKey();
|
|
49
|
+
const decipher = createDecipheriv("aes-256-gcm", key, iv);
|
|
50
|
+
decipher.setAuthTag(authTag);
|
|
51
|
+
const plaintext = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
|
|
52
|
+
return plaintext.toString("utf8");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorFactory.d.ts","sourceRoot":"","sources":["../../src/errors/ErrorFactory.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;CAAG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./crypto/CryptoHelper.js";
|
|
2
|
+
export * from "./paths/PathHelper.js";
|
|
3
|
+
export * from "./openapi/OpenApiTypes.js";
|
|
4
|
+
export * from "./qa/QaProfile.js";
|
|
5
|
+
export * from "./metadata/CommandMetadata.js";
|
|
6
|
+
export type { BacklogLaneTotals, BacklogTotals, BacklogSummary, EffectiveVelocity, EstimateResult, EstimateDurations, EstimateEtas, VelocitySource, AgentHealth, AgentHealthStatus, RoutingDefaults, RoutingDefault, RoutingProvenance, RoutingCandidate, RoutingPreview, RoutingDefaultsUpdate, RefineTasksRequest, RefineTasksPlan, RefineTasksResult, RefineStrategy, RefineOperation, UpdateTaskOp, SplitTaskOp, MergeTasksOp, UpdateEstimateOp, UpdateInfo, UpdateChannel, ApplyUpdateResponse, } from "./openapi/OpenApiTypes.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,mBAAmB,GACpB,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/logging/Logger.ts"],"names":[],"mappings":"AAAA,qBAAa,MAAM;CAAG"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const canonicalizeCommandName: (commandName: string) => string;
|
|
2
|
+
export declare const getCommandRequiredCapabilities: (commandName: string) => string[];
|
|
3
|
+
export declare const getKnownCommands: () => string[];
|
|
4
|
+
export declare const getKnownDocdexScopes: () => string[];
|
|
5
|
+
export declare const getKnownQaProfiles: () => string[];
|
|
6
|
+
//# sourceMappingURL=CommandMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandMetadata.d.ts","sourceRoot":"","sources":["../../src/metadata/CommandMetadata.ts"],"names":[],"mappings":"AAsIA,eAAO,MAAM,uBAAuB,GAAI,aAAa,MAAM,KAAG,MAS7D,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,aAAa,MAAM,KAAG,MAAM,EAI1E,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAO,MAAM,EAGzC,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAO,MAAM,EAG7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAO,MAAM,EAG3C,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import YAML from "yaml";
|
|
5
|
+
const FALLBACK_CAPABILITIES = {
|
|
6
|
+
"create-tasks": ["plan"],
|
|
7
|
+
"refine-tasks": ["plan"],
|
|
8
|
+
"work-on-tasks": ["code_write"],
|
|
9
|
+
"code-review": ["code_review"],
|
|
10
|
+
"qa-tasks": ["qa_interpretation"],
|
|
11
|
+
pdr: ["docdex_query"],
|
|
12
|
+
sds: ["docdex_query"],
|
|
13
|
+
"openapi-from-docs": ["docdex_query"],
|
|
14
|
+
"order-tasks": ["plan"],
|
|
15
|
+
"gateway-agent": ["plan", "docdex_query"],
|
|
16
|
+
};
|
|
17
|
+
const COMMAND_ALIASES = {
|
|
18
|
+
"create-tasks": ["create_tasks", "create tasks"],
|
|
19
|
+
"refine-tasks": ["refine_tasks", "refine tasks", "refine-task"],
|
|
20
|
+
"work-on-tasks": ["work_on_tasks", "work on tasks"],
|
|
21
|
+
"code-review": ["code_review", "code review"],
|
|
22
|
+
"qa-tasks": ["qa_tasks", "qa tasks"],
|
|
23
|
+
"order-tasks": ["tasks:order", "order_tasks", "tasks order"],
|
|
24
|
+
pdr: ["docs:pdr:generate", "docs-pdr-generate", "pdr-generate", "docs-pdr"],
|
|
25
|
+
sds: ["docs:sds:generate", "docs-sds-generate", "sds-generate", "docs-sds"],
|
|
26
|
+
"openapi-from-docs": ["openapi", "openapi_from_docs", "openapi-from-docs"],
|
|
27
|
+
"gateway-agent": ["gateway", "gateway agent", "gateway_agent"],
|
|
28
|
+
};
|
|
29
|
+
let cache = null;
|
|
30
|
+
const tryResolveOpenapiPath = () => {
|
|
31
|
+
if (process.env.MCODA_OPENAPI_PATH)
|
|
32
|
+
return process.env.MCODA_OPENAPI_PATH;
|
|
33
|
+
const cwdCandidate = path.resolve(process.cwd(), "openapi", "mcoda.yaml");
|
|
34
|
+
if (fs.existsSync(cwdCandidate))
|
|
35
|
+
return cwdCandidate;
|
|
36
|
+
try {
|
|
37
|
+
const here = fileURLToPath(import.meta.url);
|
|
38
|
+
const candidate = path.resolve(here, "../../../../openapi/mcoda.yaml");
|
|
39
|
+
if (fs.existsSync(candidate))
|
|
40
|
+
return candidate;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
/* ignore */
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
};
|
|
47
|
+
const loadOpenapiSpec = () => {
|
|
48
|
+
const openapiPath = tryResolveOpenapiPath();
|
|
49
|
+
if (!openapiPath)
|
|
50
|
+
return undefined;
|
|
51
|
+
try {
|
|
52
|
+
const raw = fs.readFileSync(openapiPath, "utf8");
|
|
53
|
+
return YAML.parse(raw);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const normalize = (value) => value.trim().toLowerCase().replace(/[_\s]+/g, "-");
|
|
60
|
+
const extractFromSpec = (spec) => {
|
|
61
|
+
const byCommand = new Map();
|
|
62
|
+
const docdexScopes = new Set();
|
|
63
|
+
const qaProfiles = new Set();
|
|
64
|
+
if (!spec) {
|
|
65
|
+
return { byCommand, knownCommands: new Set(), docdexScopes, qaProfiles };
|
|
66
|
+
}
|
|
67
|
+
const ext = spec["x-mcoda-command-capabilities"];
|
|
68
|
+
if (ext) {
|
|
69
|
+
for (const [key, value] of Object.entries(ext)) {
|
|
70
|
+
const canonical = normalize(key);
|
|
71
|
+
const required = Array.isArray(value?.required) ? value.required.map(String) : [];
|
|
72
|
+
byCommand.set(canonical, { required });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// As a fallback, also scan operations with x-mcoda-cli.name metadata.
|
|
76
|
+
const paths = spec.paths ?? {};
|
|
77
|
+
for (const [, operations] of Object.entries(paths)) {
|
|
78
|
+
for (const op of Object.values(operations)) {
|
|
79
|
+
const docdex = op?.["x-mcoda-docdex-profile"];
|
|
80
|
+
if (docdex) {
|
|
81
|
+
docdexScopes.add(normalize(docdex));
|
|
82
|
+
}
|
|
83
|
+
const cliName = op?.["x-mcoda-cli.name"];
|
|
84
|
+
if (!cliName)
|
|
85
|
+
continue;
|
|
86
|
+
const required = Array.isArray(op?.["x-mcoda-required-capabilities"])
|
|
87
|
+
? op["x-mcoda-required-capabilities"]
|
|
88
|
+
: [];
|
|
89
|
+
const canonical = normalize(cliName);
|
|
90
|
+
const existing = byCommand.get(canonical);
|
|
91
|
+
byCommand.set(canonical, { required: required.length ? required : existing?.required });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const knownCommands = new Set(byCommand.keys());
|
|
95
|
+
const docdexExt = spec["x-mcoda-docdex-profiles"];
|
|
96
|
+
if (Array.isArray(docdexExt)) {
|
|
97
|
+
docdexExt.forEach((scope) => docdexScopes.add(normalize(scope)));
|
|
98
|
+
}
|
|
99
|
+
const qaExt = spec["x-mcoda-qa-profiles"];
|
|
100
|
+
if (Array.isArray(qaExt)) {
|
|
101
|
+
qaExt.forEach((profile) => qaProfiles.add(normalize(profile)));
|
|
102
|
+
}
|
|
103
|
+
// If QA profiles are modeled as an enum in components, capture those too.
|
|
104
|
+
const qaEnum = (spec?.components?.schemas?.QaProfileName?.enum ?? []);
|
|
105
|
+
qaEnum.forEach((profile) => qaProfiles.add(normalize(profile)));
|
|
106
|
+
return { byCommand, knownCommands, docdexScopes, qaProfiles };
|
|
107
|
+
};
|
|
108
|
+
const ensureCache = () => {
|
|
109
|
+
if (cache)
|
|
110
|
+
return cache;
|
|
111
|
+
const spec = loadOpenapiSpec();
|
|
112
|
+
cache = extractFromSpec(spec);
|
|
113
|
+
// Seed fallback commands if spec was missing or incomplete.
|
|
114
|
+
for (const [cmd, caps] of Object.entries(FALLBACK_CAPABILITIES)) {
|
|
115
|
+
const canonical = normalize(cmd);
|
|
116
|
+
if (!cache.byCommand.has(canonical)) {
|
|
117
|
+
cache.byCommand.set(canonical, { required: caps });
|
|
118
|
+
}
|
|
119
|
+
cache.knownCommands.add(canonical);
|
|
120
|
+
}
|
|
121
|
+
return cache;
|
|
122
|
+
};
|
|
123
|
+
export const canonicalizeCommandName = (commandName) => {
|
|
124
|
+
const normalized = normalize(commandName);
|
|
125
|
+
const { knownCommands } = ensureCache();
|
|
126
|
+
if (knownCommands.has(normalized))
|
|
127
|
+
return normalized;
|
|
128
|
+
for (const [canonical, aliases] of Object.entries(COMMAND_ALIASES)) {
|
|
129
|
+
if (normalize(canonical) === normalized)
|
|
130
|
+
return canonical;
|
|
131
|
+
if (aliases.some((alias) => normalize(alias) === normalized))
|
|
132
|
+
return canonical;
|
|
133
|
+
}
|
|
134
|
+
return normalized;
|
|
135
|
+
};
|
|
136
|
+
export const getCommandRequiredCapabilities = (commandName) => {
|
|
137
|
+
const canonical = canonicalizeCommandName(commandName);
|
|
138
|
+
const { byCommand } = ensureCache();
|
|
139
|
+
return byCommand.get(canonical)?.required ?? [];
|
|
140
|
+
};
|
|
141
|
+
export const getKnownCommands = () => {
|
|
142
|
+
const { knownCommands } = ensureCache();
|
|
143
|
+
return Array.from(knownCommands).sort();
|
|
144
|
+
};
|
|
145
|
+
export const getKnownDocdexScopes = () => {
|
|
146
|
+
const { docdexScopes } = ensureCache();
|
|
147
|
+
return Array.from(docdexScopes).sort();
|
|
148
|
+
};
|
|
149
|
+
export const getKnownQaProfiles = () => {
|
|
150
|
+
const { qaProfiles } = ensureCache();
|
|
151
|
+
return Array.from(qaProfiles).sort();
|
|
152
|
+
};
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
export type AgentHealthStatus = "healthy" | "degraded" | "unreachable";
|
|
2
|
+
export interface Agent {
|
|
3
|
+
id: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
adapter: string;
|
|
6
|
+
defaultModel?: string;
|
|
7
|
+
rating?: number;
|
|
8
|
+
reasoningRating?: number;
|
|
9
|
+
bestUsage?: string;
|
|
10
|
+
costPerMillion?: number;
|
|
11
|
+
config?: Record<string, unknown>;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
capabilities?: string[];
|
|
15
|
+
health?: AgentHealth;
|
|
16
|
+
models?: AgentModel[];
|
|
17
|
+
prompts?: AgentPromptManifest;
|
|
18
|
+
auth?: AgentAuthMetadata;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateAgentInput {
|
|
21
|
+
slug: string;
|
|
22
|
+
adapter: string;
|
|
23
|
+
defaultModel?: string;
|
|
24
|
+
rating?: number;
|
|
25
|
+
reasoningRating?: number;
|
|
26
|
+
bestUsage?: string;
|
|
27
|
+
costPerMillion?: number;
|
|
28
|
+
config?: Record<string, unknown>;
|
|
29
|
+
capabilities?: string[];
|
|
30
|
+
prompts?: AgentPromptManifest;
|
|
31
|
+
models?: AgentModel[];
|
|
32
|
+
}
|
|
33
|
+
export interface UpdateAgentInput {
|
|
34
|
+
adapter?: string;
|
|
35
|
+
defaultModel?: string;
|
|
36
|
+
rating?: number;
|
|
37
|
+
reasoningRating?: number;
|
|
38
|
+
bestUsage?: string;
|
|
39
|
+
costPerMillion?: number;
|
|
40
|
+
config?: Record<string, unknown>;
|
|
41
|
+
capabilities?: string[];
|
|
42
|
+
prompts?: AgentPromptManifest;
|
|
43
|
+
models?: AgentModel[];
|
|
44
|
+
}
|
|
45
|
+
export interface AgentCapability {
|
|
46
|
+
agentId: string;
|
|
47
|
+
capability: string;
|
|
48
|
+
}
|
|
49
|
+
export interface AgentModel {
|
|
50
|
+
agentId: string;
|
|
51
|
+
modelName: string;
|
|
52
|
+
isDefault?: boolean;
|
|
53
|
+
config?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export interface AgentPromptManifest {
|
|
56
|
+
agentId?: string;
|
|
57
|
+
jobPrompt?: string;
|
|
58
|
+
characterPrompt?: string;
|
|
59
|
+
commandPrompts?: Record<string, string>;
|
|
60
|
+
jobPath?: string;
|
|
61
|
+
characterPath?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface AgentAuthMetadata {
|
|
64
|
+
agentId: string;
|
|
65
|
+
configured: boolean;
|
|
66
|
+
lastUpdatedAt?: string;
|
|
67
|
+
lastVerifiedAt?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface AgentAuthSecret extends AgentAuthMetadata {
|
|
70
|
+
encryptedSecret: string;
|
|
71
|
+
}
|
|
72
|
+
export interface AgentAuthRequest {
|
|
73
|
+
secret: string;
|
|
74
|
+
}
|
|
75
|
+
export type UpdateChannel = "stable" | "beta" | "nightly";
|
|
76
|
+
export interface UpdateInfo {
|
|
77
|
+
currentVersion: string;
|
|
78
|
+
latestVersion: string;
|
|
79
|
+
channel: UpdateChannel;
|
|
80
|
+
updateAvailable: boolean;
|
|
81
|
+
notes?: string | null;
|
|
82
|
+
}
|
|
83
|
+
export interface ApplyUpdateResponse {
|
|
84
|
+
status: "started" | "already_up_to_date" | "completed";
|
|
85
|
+
logFile?: string | null;
|
|
86
|
+
}
|
|
87
|
+
export interface AgentHealth {
|
|
88
|
+
agentId: string;
|
|
89
|
+
status: AgentHealthStatus;
|
|
90
|
+
lastCheckedAt: string;
|
|
91
|
+
latencyMs?: number;
|
|
92
|
+
details?: Record<string, unknown>;
|
|
93
|
+
}
|
|
94
|
+
export interface WorkspaceDefault {
|
|
95
|
+
workspaceId: string;
|
|
96
|
+
commandName: string;
|
|
97
|
+
agentId: string;
|
|
98
|
+
qaProfile?: string;
|
|
99
|
+
docdexScope?: string;
|
|
100
|
+
updatedAt?: string;
|
|
101
|
+
}
|
|
102
|
+
export type RoutingDefault = WorkspaceDefault;
|
|
103
|
+
export type RoutingDefaults = RoutingDefault[];
|
|
104
|
+
export type RoutingProvenance = "override" | "workspace_default" | "global_default";
|
|
105
|
+
export interface RoutingCandidate {
|
|
106
|
+
agent: Agent;
|
|
107
|
+
agentId: string;
|
|
108
|
+
agentSlug?: string;
|
|
109
|
+
source: RoutingProvenance;
|
|
110
|
+
capabilities?: string[];
|
|
111
|
+
health?: AgentHealth;
|
|
112
|
+
missingCapabilities?: string[];
|
|
113
|
+
notes?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface RoutingPreview {
|
|
116
|
+
workspaceId: string;
|
|
117
|
+
commandName: string;
|
|
118
|
+
resolvedAgent: Agent;
|
|
119
|
+
provenance?: RoutingProvenance;
|
|
120
|
+
requiredCapabilities?: string[];
|
|
121
|
+
qaProfile?: string;
|
|
122
|
+
docdexScope?: string;
|
|
123
|
+
notes?: string;
|
|
124
|
+
candidates?: RoutingCandidate[];
|
|
125
|
+
}
|
|
126
|
+
export interface RoutingDefaultsUpdate {
|
|
127
|
+
set?: Record<string, string>;
|
|
128
|
+
reset?: string[];
|
|
129
|
+
qaProfile?: string;
|
|
130
|
+
docdexScope?: string;
|
|
131
|
+
}
|
|
132
|
+
export type VelocitySource = "config" | "empirical" | "mixed";
|
|
133
|
+
export interface BacklogLaneTotals {
|
|
134
|
+
tasks: number;
|
|
135
|
+
story_points: number;
|
|
136
|
+
}
|
|
137
|
+
export interface BacklogTotals {
|
|
138
|
+
implementation: BacklogLaneTotals;
|
|
139
|
+
review: BacklogLaneTotals;
|
|
140
|
+
qa: BacklogLaneTotals;
|
|
141
|
+
done: BacklogLaneTotals;
|
|
142
|
+
}
|
|
143
|
+
export interface BacklogSummary {
|
|
144
|
+
scope: {
|
|
145
|
+
project?: string;
|
|
146
|
+
epic?: string;
|
|
147
|
+
story?: string;
|
|
148
|
+
assignee?: string;
|
|
149
|
+
};
|
|
150
|
+
totals: BacklogTotals;
|
|
151
|
+
}
|
|
152
|
+
export interface EffectiveVelocity {
|
|
153
|
+
implementationSpPerHour: number;
|
|
154
|
+
reviewSpPerHour: number;
|
|
155
|
+
qaSpPerHour: number;
|
|
156
|
+
source: VelocitySource;
|
|
157
|
+
windowTasks?: 10 | 20 | 50;
|
|
158
|
+
samples?: {
|
|
159
|
+
implementation?: number;
|
|
160
|
+
review?: number;
|
|
161
|
+
qa?: number;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export interface EstimateDurations {
|
|
165
|
+
implementationHours: number | null;
|
|
166
|
+
reviewHours: number | null;
|
|
167
|
+
qaHours: number | null;
|
|
168
|
+
totalHours: number | null;
|
|
169
|
+
}
|
|
170
|
+
export interface EstimateEtas {
|
|
171
|
+
readyToReviewEta?: string;
|
|
172
|
+
readyToQaEta?: string;
|
|
173
|
+
completeEta?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface EstimateResult {
|
|
176
|
+
scope: {
|
|
177
|
+
project?: string;
|
|
178
|
+
epic?: string;
|
|
179
|
+
story?: string;
|
|
180
|
+
assignee?: string;
|
|
181
|
+
workspaceId: string;
|
|
182
|
+
};
|
|
183
|
+
backlogTotals: BacklogTotals;
|
|
184
|
+
effectiveVelocity: EffectiveVelocity;
|
|
185
|
+
durationsHours: EstimateDurations;
|
|
186
|
+
etas: EstimateEtas;
|
|
187
|
+
}
|
|
188
|
+
export type RefineStrategy = "split" | "merge" | "enrich" | "estimate" | "auto";
|
|
189
|
+
export interface RefineTasksRequest {
|
|
190
|
+
projectKey: string;
|
|
191
|
+
epicKey?: string;
|
|
192
|
+
userStoryKey?: string;
|
|
193
|
+
taskKeys?: string[];
|
|
194
|
+
statusFilter?: string[];
|
|
195
|
+
strategy?: RefineStrategy;
|
|
196
|
+
maxTasks?: number;
|
|
197
|
+
dryRun?: boolean;
|
|
198
|
+
agentIdOverride?: string;
|
|
199
|
+
planInPath?: string;
|
|
200
|
+
planOutPath?: string;
|
|
201
|
+
}
|
|
202
|
+
export interface UpdateTaskOp {
|
|
203
|
+
op: "update_task";
|
|
204
|
+
taskKey: string;
|
|
205
|
+
updates: {
|
|
206
|
+
title?: string;
|
|
207
|
+
description?: string;
|
|
208
|
+
acceptanceCriteria?: string[];
|
|
209
|
+
type?: string;
|
|
210
|
+
storyPoints?: number | null;
|
|
211
|
+
priority?: number | null;
|
|
212
|
+
metadata?: Record<string, unknown>;
|
|
213
|
+
status?: string;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
export interface SplitChildTask {
|
|
217
|
+
title: string;
|
|
218
|
+
description?: string;
|
|
219
|
+
acceptanceCriteria?: string[];
|
|
220
|
+
type?: string;
|
|
221
|
+
storyPoints?: number | null;
|
|
222
|
+
priority?: number | null;
|
|
223
|
+
metadata?: Record<string, unknown>;
|
|
224
|
+
dependsOn?: string[];
|
|
225
|
+
}
|
|
226
|
+
export interface SplitTaskOp {
|
|
227
|
+
op: "split_task";
|
|
228
|
+
taskKey: string;
|
|
229
|
+
keepParent?: boolean;
|
|
230
|
+
parentUpdates?: UpdateTaskOp["updates"];
|
|
231
|
+
children: SplitChildTask[];
|
|
232
|
+
}
|
|
233
|
+
export interface MergeTasksOp {
|
|
234
|
+
op: "merge_tasks";
|
|
235
|
+
targetTaskKey: string;
|
|
236
|
+
sourceTaskKeys: string[];
|
|
237
|
+
updates?: UpdateTaskOp["updates"];
|
|
238
|
+
cancelSources?: boolean;
|
|
239
|
+
}
|
|
240
|
+
export interface UpdateEstimateOp {
|
|
241
|
+
op: "update_estimate";
|
|
242
|
+
taskKey: string;
|
|
243
|
+
storyPoints?: number | null;
|
|
244
|
+
type?: string;
|
|
245
|
+
priority?: number | null;
|
|
246
|
+
}
|
|
247
|
+
export type RefineOperation = UpdateTaskOp | SplitTaskOp | MergeTasksOp | UpdateEstimateOp;
|
|
248
|
+
export interface RefineTasksPlan {
|
|
249
|
+
strategy?: RefineStrategy;
|
|
250
|
+
operations: RefineOperation[];
|
|
251
|
+
warnings?: string[];
|
|
252
|
+
metadata?: {
|
|
253
|
+
generatedAt: string;
|
|
254
|
+
projectKey: string;
|
|
255
|
+
epicKeys?: string[];
|
|
256
|
+
storyKeys?: string[];
|
|
257
|
+
jobId?: string;
|
|
258
|
+
commandRunId?: string;
|
|
259
|
+
strategy?: RefineStrategy;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
export interface RefineTasksResult {
|
|
263
|
+
jobId: string;
|
|
264
|
+
commandRunId: string;
|
|
265
|
+
plan: RefineTasksPlan;
|
|
266
|
+
applied: boolean;
|
|
267
|
+
createdTasks?: string[];
|
|
268
|
+
updatedTasks?: string[];
|
|
269
|
+
cancelledTasks?: string[];
|
|
270
|
+
summary?: {
|
|
271
|
+
tasksProcessed: number;
|
|
272
|
+
tasksAffected: number;
|
|
273
|
+
storyPointsDelta?: number;
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=OpenApiTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenApiTypes.d.ts","sourceRoot":"","sources":["../../src/openapi/OpenApiTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAEvE,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;I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M,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility helpers for resolving mcoda paths in both global and workspace scopes.
|
|
3
|
+
* The helpers intentionally avoid touching any other layer to keep shared free of deps.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PathHelper {
|
|
6
|
+
static getGlobalMcodaDir(): string;
|
|
7
|
+
static getGlobalDbPath(): string;
|
|
8
|
+
static getWorkspaceDir(cwd?: string): string;
|
|
9
|
+
static getWorkspaceDbPath(cwd?: string): string;
|
|
10
|
+
static ensureDir(dir: string): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=PathHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathHelper.d.ts","sourceRoot":"","sources":["../../src/paths/PathHelper.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,qBAAa,UAAU;IACrB,MAAM,CAAC,iBAAiB,IAAI,MAAM;IAIlC,MAAM,CAAC,eAAe,IAAI,MAAM;IAIhC,MAAM,CAAC,eAAe,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM;IAI3D,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM;WAIjD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { promises as fs } from "node:fs";
|
|
4
|
+
/**
|
|
5
|
+
* Utility helpers for resolving mcoda paths in both global and workspace scopes.
|
|
6
|
+
* The helpers intentionally avoid touching any other layer to keep shared free of deps.
|
|
7
|
+
*/
|
|
8
|
+
export class PathHelper {
|
|
9
|
+
static getGlobalMcodaDir() {
|
|
10
|
+
return path.join(os.homedir(), ".mcoda");
|
|
11
|
+
}
|
|
12
|
+
static getGlobalDbPath() {
|
|
13
|
+
return path.join(this.getGlobalMcodaDir(), "mcoda.db");
|
|
14
|
+
}
|
|
15
|
+
static getWorkspaceDir(cwd = process.cwd()) {
|
|
16
|
+
return path.join(cwd, ".mcoda");
|
|
17
|
+
}
|
|
18
|
+
static getWorkspaceDbPath(cwd = process.cwd()) {
|
|
19
|
+
return path.join(this.getWorkspaceDir(cwd), "mcoda.db");
|
|
20
|
+
}
|
|
21
|
+
static async ensureDir(dir) {
|
|
22
|
+
await fs.mkdir(dir, { recursive: true });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface QaProfile {
|
|
2
|
+
name: string;
|
|
3
|
+
runner?: 'cli' | 'chromium' | 'maestro' | string;
|
|
4
|
+
level?: string;
|
|
5
|
+
test_command?: string;
|
|
6
|
+
working_dir?: string;
|
|
7
|
+
env?: Record<string, string>;
|
|
8
|
+
default?: boolean;
|
|
9
|
+
matcher?: {
|
|
10
|
+
task_types?: string[];
|
|
11
|
+
tags?: string[];
|
|
12
|
+
};
|
|
13
|
+
install_command?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=QaProfile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QaProfile.d.ts","sourceRoot":"","sources":["../../src/qa/QaProfile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE;QACR,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IACF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UtilityService.d.ts","sourceRoot":"","sources":["../../src/utils/UtilityService.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;CAAG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcoda/shared",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Shared utilities and schemas for mcoda.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"!dist/**/__tests__/**",
|
|
11
|
+
"!dist/**/*.test.*",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc -p tsconfig.json",
|
|
18
|
+
"lint": "echo \"lint not configured\"",
|
|
19
|
+
"test": "pnpm run build && node ../../scripts/run-node-tests.js dist"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=20"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/bekirdag/mcoda.git"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/bekirdag/mcoda/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/bekirdag/mcoda#readme",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"author": "bekir dag",
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"yaml": "^2.4.2"
|
|
39
|
+
}
|
|
40
|
+
}
|