@sdd-method/cli-core 0.1.0
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/LIBRARY_SPEC.md +36 -0
- package/LICENSE +201 -0
- package/NOTICE +17 -0
- package/README.md +67 -0
- package/dist/archetypes/index.d.ts +5 -0
- package/dist/archetypes/index.d.ts.map +1 -0
- package/dist/archetypes/index.js +5 -0
- package/dist/archetypes/index.js.map +1 -0
- package/dist/archetypes/registry.d.ts +12 -0
- package/dist/archetypes/registry.d.ts.map +1 -0
- package/dist/archetypes/registry.js +77 -0
- package/dist/archetypes/registry.js.map +1 -0
- package/dist/archetypes/render.d.ts +29 -0
- package/dist/archetypes/render.d.ts.map +1 -0
- package/dist/archetypes/render.js +110 -0
- package/dist/archetypes/render.js.map +1 -0
- package/dist/archetypes/repo-config.d.ts +30 -0
- package/dist/archetypes/repo-config.d.ts.map +1 -0
- package/dist/archetypes/repo-config.js +44 -0
- package/dist/archetypes/repo-config.js.map +1 -0
- package/dist/archetypes/types.d.ts +31 -0
- package/dist/archetypes/types.d.ts.map +1 -0
- package/dist/archetypes/types.js +2 -0
- package/dist/archetypes/types.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/list.d.ts +12 -0
- package/dist/list.d.ts.map +1 -0
- package/dist/list.js +64 -0
- package/dist/list.js.map +1 -0
- package/dist/mcp/envelope.d.ts +23 -0
- package/dist/mcp/envelope.d.ts.map +1 -0
- package/dist/mcp/envelope.js +30 -0
- package/dist/mcp/envelope.js.map +1 -0
- package/dist/mcp/index.d.ts +15 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +12 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/lifecycle.d.ts +15 -0
- package/dist/mcp/lifecycle.d.ts.map +1 -0
- package/dist/mcp/lifecycle.js +24 -0
- package/dist/mcp/lifecycle.js.map +1 -0
- package/dist/mcp/sdd-client.d.ts +36 -0
- package/dist/mcp/sdd-client.d.ts.map +1 -0
- package/dist/mcp/sdd-client.js +76 -0
- package/dist/mcp/sdd-client.js.map +1 -0
- package/dist/mcp/types.d.ts +25 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +13 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/pins/artifacts.d.ts +17 -0
- package/dist/pins/artifacts.d.ts.map +1 -0
- package/dist/pins/artifacts.js +12 -0
- package/dist/pins/artifacts.js.map +1 -0
- package/dist/pins/contracts.d.ts +17 -0
- package/dist/pins/contracts.d.ts.map +1 -0
- package/dist/pins/contracts.js +12 -0
- package/dist/pins/contracts.js.map +1 -0
- package/dist/pins/index.d.ts +5 -0
- package/dist/pins/index.d.ts.map +1 -0
- package/dist/pins/index.js +3 -0
- package/dist/pins/index.js.map +1 -0
- package/dist/repo-kind.d.ts +13 -0
- package/dist/repo-kind.d.ts.map +1 -0
- package/dist/repo-kind.js +42 -0
- package/dist/repo-kind.js.map +1 -0
- package/dist/stability/index.d.ts +22 -0
- package/dist/stability/index.d.ts.map +1 -0
- package/dist/stability/index.js +12 -0
- package/dist/stability/index.js.map +1 -0
- package/dist/validate/archetype-metadata-check.d.ts +24 -0
- package/dist/validate/archetype-metadata-check.d.ts.map +1 -0
- package/dist/validate/archetype-metadata-check.js +44 -0
- package/dist/validate/archetype-metadata-check.js.map +1 -0
- package/dist/validate/index.d.ts +5 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +3 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/manifest-check.d.ts +29 -0
- package/dist/validate/manifest-check.d.ts.map +1 -0
- package/dist/validate/manifest-check.js +96 -0
- package/dist/validate/manifest-check.js.map +1 -0
- package/dist/workspace.d.ts +7 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +31 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo-config entry writer — emits an `orchestration/repo-config/<domain>/<service>.yaml`
|
|
3
|
+
* stub for a newly-scaffolded service per the method-canonical layout from
|
|
4
|
+
* ADR 0106. The scaffolder name + version are parameterised so adopters
|
|
5
|
+
* stamp their own binary identity into the banner.
|
|
6
|
+
*/
|
|
7
|
+
import { access, mkdir, writeFile } from "node:fs/promises";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { stringify as stringifyYaml } from "yaml";
|
|
10
|
+
export async function writeRepoConfigEntry(inputs) {
|
|
11
|
+
const { sddRoot, domain, serviceName, serviceType, archetypeId, repoOrg, overwrite, scaffolderName, scaffolderVersion, dryRun, } = inputs;
|
|
12
|
+
const configDir = join(sddRoot, "orchestration/repo-config", domain);
|
|
13
|
+
const configPath = join(configDir, `${serviceName}.yaml`);
|
|
14
|
+
if (!overwrite && (await fileExists(configPath))) {
|
|
15
|
+
return {
|
|
16
|
+
status: "skipped",
|
|
17
|
+
path: configPath,
|
|
18
|
+
reason: `repo-config entry already exists at ${configPath} (pass overwrite: true to replace)`,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (dryRun === true) {
|
|
22
|
+
return { status: "written", path: configPath };
|
|
23
|
+
}
|
|
24
|
+
await mkdir(configDir, { recursive: true });
|
|
25
|
+
const body = {
|
|
26
|
+
repo: `${repoOrg}/${serviceName}`,
|
|
27
|
+
domain,
|
|
28
|
+
service_type: serviceType,
|
|
29
|
+
description: `Scaffolded by ${scaffolderName} v${scaffolderVersion} as ${archetypeId} archetype. Replace with a real description.`,
|
|
30
|
+
};
|
|
31
|
+
const yaml = `# ${serviceName} - scaffolded by ${scaffolderName} v${scaffolderVersion} (archetype: ${archetypeId})\n# Replace fields with real values as the service takes shape.\n\n${stringifyYaml(body)}`;
|
|
32
|
+
await writeFile(configPath, yaml, "utf8");
|
|
33
|
+
return { status: "written", path: configPath };
|
|
34
|
+
}
|
|
35
|
+
async function fileExists(path) {
|
|
36
|
+
try {
|
|
37
|
+
await access(path);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=repo-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-config.js","sourceRoot":"","sources":["../../src/archetypes/repo-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AA0BlD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAA6B;IAE7B,MAAM,EACJ,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAAW,EACX,WAAW,EACX,OAAO,EACP,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,MAAM,GACP,GAAG,MAAM,CAAC;IACX,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,2BAA2B,EAAE,MAAM,CAAC,CAAC;IACrE,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,WAAW,OAAO,CAAC,CAAC;IAE1D,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACjD,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,uCAAuC,UAAU,oCAAoC;SAC9F,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IACjD,CAAC;IAED,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5C,MAAM,IAAI,GAAG;QACX,IAAI,EAAE,GAAG,OAAO,IAAI,WAAW,EAAE;QACjC,MAAM;QACN,YAAY,EAAE,WAAW;QACzB,WAAW,EAAE,iBAAiB,cAAc,KAAK,iBAAiB,OAAO,WAAW,8CAA8C;KACnI,CAAC;IAEF,MAAM,IAAI,GAAG,KAAK,WAAW,oBAAoB,cAAc,KAAK,iBAAiB,gBAAgB,WAAW,uEAAuE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;IAC7M,MAAM,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAE1C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AACjD,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Profile } from "../repo-kind.js";
|
|
2
|
+
export interface ArchetypeDeclaration {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
applies_to_profile: Profile;
|
|
6
|
+
template_source: string;
|
|
7
|
+
service_type: string;
|
|
8
|
+
required_vars: string[];
|
|
9
|
+
optional_vars: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ArchetypeRegistry {
|
|
12
|
+
version: string;
|
|
13
|
+
archetypes: ArchetypeDeclaration[];
|
|
14
|
+
}
|
|
15
|
+
export interface RenderVars {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RenderedOutcome {
|
|
19
|
+
status: "rendered";
|
|
20
|
+
/** Files actually written to disk. Empty when `dryRun` is true. */
|
|
21
|
+
writtenFiles: string[];
|
|
22
|
+
/** Files skipped because they already existed and weren't in `overwritePaths`. */
|
|
23
|
+
skippedFiles: string[];
|
|
24
|
+
/** Files that would be written. Equal to writtenFiles outside dry-run; populated in dry-run. */
|
|
25
|
+
plannedFiles: string[];
|
|
26
|
+
}
|
|
27
|
+
export type RenderOutcome = RenderedOutcome | {
|
|
28
|
+
status: "refused";
|
|
29
|
+
reason: string;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/archetypes/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,oBAAoB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,mEAAmE;IACnE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,kFAAkF;IAClF,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gGAAgG;IAChG,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,MAAM,aAAa,GACrB,eAAe,GACf;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/archetypes/types.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { REPO_KIND_FILE, isRepoKind, profileFromRepoKind, readRepoKind, } from "./repo-kind.js";
|
|
2
|
+
export type { Profile, RepoKind } from "./repo-kind.js";
|
|
3
|
+
export { findSddRoot } from "./workspace.js";
|
|
4
|
+
export { discoverSddRepos } from "./list.js";
|
|
5
|
+
export type { DiscoveredRepo } from "./list.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/list.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sibling-SDD discovery — recursively walks one or more root paths and
|
|
3
|
+
* returns every directory carrying a `.sdd-repo-kind` marker. Implements
|
|
4
|
+
* the discovery half of the sibling-SDD layout convention from ADR 0045.
|
|
5
|
+
*/
|
|
6
|
+
import { type RepoKind } from "./repo-kind.js";
|
|
7
|
+
export interface DiscoveredRepo {
|
|
8
|
+
path: string;
|
|
9
|
+
kind: RepoKind;
|
|
10
|
+
}
|
|
11
|
+
export declare function discoverSddRepos(roots: readonly string[]): Promise<DiscoveredRepo[]>;
|
|
12
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;CAChB;AAgBD,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,cAAc,EAAE,CAAC,CAW3B"}
|
package/dist/list.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sibling-SDD discovery — recursively walks one or more root paths and
|
|
3
|
+
* returns every directory carrying a `.sdd-repo-kind` marker. Implements
|
|
4
|
+
* the discovery half of the sibling-SDD layout convention from ADR 0045.
|
|
5
|
+
*/
|
|
6
|
+
import { opendir } from "node:fs/promises";
|
|
7
|
+
import { join, resolve } from "node:path";
|
|
8
|
+
import { readRepoKind } from "./repo-kind.js";
|
|
9
|
+
const SKIP_DIRS = new Set([
|
|
10
|
+
"node_modules",
|
|
11
|
+
".git",
|
|
12
|
+
"dist",
|
|
13
|
+
"build",
|
|
14
|
+
".next",
|
|
15
|
+
".turbo",
|
|
16
|
+
".cache",
|
|
17
|
+
"coverage",
|
|
18
|
+
"tmp",
|
|
19
|
+
".venv",
|
|
20
|
+
"__pycache__",
|
|
21
|
+
]);
|
|
22
|
+
export async function discoverSddRepos(roots) {
|
|
23
|
+
const seen = new Set();
|
|
24
|
+
const repos = [];
|
|
25
|
+
for (const root of roots) {
|
|
26
|
+
const abs = resolve(root);
|
|
27
|
+
await walk(abs, seen, repos);
|
|
28
|
+
}
|
|
29
|
+
repos.sort((a, b) => a.path.localeCompare(b.path));
|
|
30
|
+
return repos;
|
|
31
|
+
}
|
|
32
|
+
async function walk(dir, seen, repos) {
|
|
33
|
+
if (seen.has(dir))
|
|
34
|
+
return;
|
|
35
|
+
seen.add(dir);
|
|
36
|
+
const kind = await tryReadRepoKind(dir);
|
|
37
|
+
if (kind) {
|
|
38
|
+
repos.push({ path: dir, kind });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let entries;
|
|
42
|
+
try {
|
|
43
|
+
entries = await opendir(dir);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
for await (const entry of entries) {
|
|
49
|
+
if (!entry.isDirectory())
|
|
50
|
+
continue;
|
|
51
|
+
if (SKIP_DIRS.has(entry.name))
|
|
52
|
+
continue;
|
|
53
|
+
await walk(join(dir, entry.name), seen, repos);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function tryReadRepoKind(dir) {
|
|
57
|
+
try {
|
|
58
|
+
return await readRepoKind(dir);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=list.js.map
|
package/dist/list.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAiB,MAAM,gBAAgB,CAAC;AAO7D,MAAM,SAAS,GAAwB,IAAI,GAAG,CAAC;IAC7C,cAAc;IACd,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,KAAK;IACL,OAAO;IACP,aAAa;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAwB;IAExB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,KAAK,GAAqB,EAAE,CAAC;IAEnC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1B,MAAM,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,UAAU,IAAI,CACjB,GAAW,EACX,IAAiB,EACjB,KAAuB;IAEvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAC1B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEd,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,OAAO;IACT,CAAC;IAED,IAAI,OAAgE,CAAC;IACrE,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IAED,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAClC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAAE,SAAS;QACnC,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,SAAS;QACxC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;AACH,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,GAAW;IACxC,IAAI,CAAC;QACH,OAAO,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response helpers for adopter MCP servers — keeps tool / resource
|
|
3
|
+
* response construction uniform across every adopter's MCP server.
|
|
4
|
+
*/
|
|
5
|
+
import type { McpErrorEnvelope } from "./types.js";
|
|
6
|
+
/** JSON body wrapped in the MCP content-array shape. */
|
|
7
|
+
export declare function jsonContent<T>(payload: T): {
|
|
8
|
+
content: Array<{
|
|
9
|
+
type: "text";
|
|
10
|
+
text: string;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
/** Error envelope wrapped in the MCP isError shape. */
|
|
14
|
+
export declare function errorContent(envelope: McpErrorEnvelope): {
|
|
15
|
+
isError: true;
|
|
16
|
+
content: Array<{
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
/** Deduplicate a source-URI array preserving first-occurrence order. */
|
|
22
|
+
export declare function dedupeSources(sources: readonly string[]): string[];
|
|
23
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/mcp/envelope.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,wDAAwD;AACxD,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG;IAC1C,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD,CAIA;AAED,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,gBAAgB,GAAG;IACxD,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD,CAKA;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAUlE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response helpers for adopter MCP servers — keeps tool / resource
|
|
3
|
+
* response construction uniform across every adopter's MCP server.
|
|
4
|
+
*/
|
|
5
|
+
/** JSON body wrapped in the MCP content-array shape. */
|
|
6
|
+
export function jsonContent(payload) {
|
|
7
|
+
return {
|
|
8
|
+
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Error envelope wrapped in the MCP isError shape. */
|
|
12
|
+
export function errorContent(envelope) {
|
|
13
|
+
return {
|
|
14
|
+
isError: true,
|
|
15
|
+
content: [{ type: "text", text: JSON.stringify(envelope, null, 2) }],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Deduplicate a source-URI array preserving first-occurrence order. */
|
|
19
|
+
export function dedupeSources(sources) {
|
|
20
|
+
const seen = new Set();
|
|
21
|
+
const out = [];
|
|
22
|
+
for (const s of sources) {
|
|
23
|
+
if (!seen.has(s)) {
|
|
24
|
+
seen.add(s);
|
|
25
|
+
out.push(s);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../src/mcp/envelope.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,wDAAwD;AACxD,MAAM,UAAU,WAAW,CAAI,OAAU;IAGvC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACpE,CAAC;AACJ,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,YAAY,CAAC,QAA0B;IAIrD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACrE,CAAC;AACJ,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,aAAa,CAAC,OAA0B;IACtD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACZ,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP envelope, lifecycle, and sdd-mcp composition client per ADR 0130.
|
|
3
|
+
*
|
|
4
|
+
* Scope: this module ships the generic envelope shape, the stdio
|
|
5
|
+
* transport lifecycle, and the downstream sdd-mcp client. Each adopter's
|
|
6
|
+
* own `src/mcp/` defines its server-specific resources, tools, and auth.
|
|
7
|
+
*/
|
|
8
|
+
export type { McpErrorEnvelope, CompositionResult } from "./types.js";
|
|
9
|
+
export { McpEnvelopeError } from "./types.js";
|
|
10
|
+
export { jsonContent, errorContent, dedupeSources } from "./envelope.js";
|
|
11
|
+
export { getSddClient, shutdownSddClient, parseSddToolResult, } from "./sdd-client.js";
|
|
12
|
+
export type { SddClientOptions, ParsedSddToolResult, } from "./sdd-client.js";
|
|
13
|
+
export { runMcpServer } from "./lifecycle.js";
|
|
14
|
+
export type { RunMcpServerOptions } from "./lifecycle.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP envelope, lifecycle, and sdd-mcp composition client per ADR 0130.
|
|
3
|
+
*
|
|
4
|
+
* Scope: this module ships the generic envelope shape, the stdio
|
|
5
|
+
* transport lifecycle, and the downstream sdd-mcp client. Each adopter's
|
|
6
|
+
* own `src/mcp/` defines its server-specific resources, tools, and auth.
|
|
7
|
+
*/
|
|
8
|
+
export { McpEnvelopeError } from "./types.js";
|
|
9
|
+
export { jsonContent, errorContent, dedupeSources } from "./envelope.js";
|
|
10
|
+
export { getSddClient, shutdownSddClient, parseSddToolResult, } from "./sdd-client.js";
|
|
11
|
+
export { runMcpServer } from "./lifecycle.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle helpers for adopter MCP servers — stdio transport setup,
|
|
3
|
+
* signal teardown, and downstream-client shutdown.
|
|
4
|
+
*/
|
|
5
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
+
export interface RunMcpServerOptions {
|
|
7
|
+
readonly server: McpServer;
|
|
8
|
+
/**
|
|
9
|
+
* Skip stdio connection and return immediately (for integration tests
|
|
10
|
+
* that drive the server via in-memory transport).
|
|
11
|
+
*/
|
|
12
|
+
readonly testMode?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function runMcpServer(opts: RunMcpServerOptions): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/mcp/lifecycle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB3E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle helpers for adopter MCP servers — stdio transport setup,
|
|
3
|
+
* signal teardown, and downstream-client shutdown.
|
|
4
|
+
*/
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
import { shutdownSddClient } from "./sdd-client.js";
|
|
7
|
+
export async function runMcpServer(opts) {
|
|
8
|
+
if (opts.testMode)
|
|
9
|
+
return;
|
|
10
|
+
const transport = new StdioServerTransport();
|
|
11
|
+
await opts.server.connect(transport);
|
|
12
|
+
await new Promise((resolve) => {
|
|
13
|
+
transport.onclose = () => {
|
|
14
|
+
resolve();
|
|
15
|
+
};
|
|
16
|
+
const onSignal = () => {
|
|
17
|
+
void opts.server.close().finally(() => resolve());
|
|
18
|
+
};
|
|
19
|
+
process.once("SIGTERM", onSignal);
|
|
20
|
+
process.once("SIGINT", onSignal);
|
|
21
|
+
});
|
|
22
|
+
await shutdownSddClient();
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../src/mcp/lifecycle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAWpD,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAyB;IAC1D,IAAI,IAAI,CAAC,QAAQ;QAAE,OAAO;IAE1B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAErC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAClC,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE;YACvB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QACF,MAAM,QAAQ,GAAG,GAAS,EAAE;YAC1B,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,MAAM,iBAAiB,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Downstream sdd-mcp client — the ADR 0130 default composition pattern.
|
|
3
|
+
*
|
|
4
|
+
* Spawns `sdd-cli mcp serve` as a subprocess and keeps a persistent MCP
|
|
5
|
+
* client connection for the session's lifetime. Adopter MCP servers use
|
|
6
|
+
* this to consult SDD content without propagating credentials.
|
|
7
|
+
*
|
|
8
|
+
* Auth is intentionally not propagated — sdd-mcp is unauthenticated by
|
|
9
|
+
* design (ADR 0128 §4.3). Any token the adopter server holds stays out
|
|
10
|
+
* of the env passed to the subprocess beyond what sdd-mcp's own
|
|
11
|
+
* workspace resolver needs (`SDD_REPO_PATH`).
|
|
12
|
+
*/
|
|
13
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
14
|
+
export interface SddClientOptions {
|
|
15
|
+
/** Absolute path to the SDD repo to pin the server at. Optional — sdd-mcp's workspace resolver auto-discovers siblings. */
|
|
16
|
+
readonly sddRepoPath?: string;
|
|
17
|
+
/** Command to launch sdd-cli. Default: `sdd-cli`. Adopters override for local builds. */
|
|
18
|
+
readonly sddCliCommand?: string;
|
|
19
|
+
/** Clients identify themselves so logs are traceable. */
|
|
20
|
+
readonly callerName: string;
|
|
21
|
+
readonly callerVersion: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function getSddClient(opts: SddClientOptions): Promise<Client>;
|
|
24
|
+
export declare function shutdownSddClient(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Extract `sources[]` and `pin_to_commit` from a tool-result body so
|
|
27
|
+
* callers can cite them per ADR 0130 §4.3. Shape-tolerant — tolerates
|
|
28
|
+
* absent fields.
|
|
29
|
+
*/
|
|
30
|
+
export interface ParsedSddToolResult {
|
|
31
|
+
readonly body: Record<string, unknown>;
|
|
32
|
+
readonly sources: readonly string[];
|
|
33
|
+
readonly pin: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function parseSddToolResult(content: unknown): ParsedSddToolResult;
|
|
36
|
+
//# sourceMappingURL=sdd-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdd-client.d.ts","sourceRoot":"","sources":["../../src/mcp/sdd-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE,MAAM,WAAW,gBAAgB;IAC/B,2HAA2H;IAC3H,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAID,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4B1E;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CASvD;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAsBxE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Downstream sdd-mcp client — the ADR 0130 default composition pattern.
|
|
3
|
+
*
|
|
4
|
+
* Spawns `sdd-cli mcp serve` as a subprocess and keeps a persistent MCP
|
|
5
|
+
* client connection for the session's lifetime. Adopter MCP servers use
|
|
6
|
+
* this to consult SDD content without propagating credentials.
|
|
7
|
+
*
|
|
8
|
+
* Auth is intentionally not propagated — sdd-mcp is unauthenticated by
|
|
9
|
+
* design (ADR 0128 §4.3). Any token the adopter server holds stays out
|
|
10
|
+
* of the env passed to the subprocess beyond what sdd-mcp's own
|
|
11
|
+
* workspace resolver needs (`SDD_REPO_PATH`).
|
|
12
|
+
*/
|
|
13
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
14
|
+
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
15
|
+
let cachedClient = null;
|
|
16
|
+
export async function getSddClient(opts) {
|
|
17
|
+
if (cachedClient)
|
|
18
|
+
return cachedClient;
|
|
19
|
+
const command = opts.sddCliCommand ?? "sdd-cli";
|
|
20
|
+
const env = {};
|
|
21
|
+
// Pass through only PATH, HOME, and (if set) SDD_REPO_PATH — everything
|
|
22
|
+
// else stays in the adopter process.
|
|
23
|
+
for (const key of ["PATH", "HOME"]) {
|
|
24
|
+
const v = process.env[key];
|
|
25
|
+
if (v !== undefined)
|
|
26
|
+
env[key] = v;
|
|
27
|
+
}
|
|
28
|
+
if (opts.sddRepoPath) {
|
|
29
|
+
env["SDD_REPO_PATH"] = opts.sddRepoPath;
|
|
30
|
+
}
|
|
31
|
+
else if (process.env["SDD_REPO_PATH"]) {
|
|
32
|
+
env["SDD_REPO_PATH"] = process.env["SDD_REPO_PATH"];
|
|
33
|
+
}
|
|
34
|
+
const transport = new StdioClientTransport({
|
|
35
|
+
command,
|
|
36
|
+
args: ["mcp", "serve"],
|
|
37
|
+
env,
|
|
38
|
+
});
|
|
39
|
+
const client = new Client({ name: opts.callerName, version: opts.callerVersion }, { capabilities: {} });
|
|
40
|
+
await client.connect(transport);
|
|
41
|
+
cachedClient = client;
|
|
42
|
+
return client;
|
|
43
|
+
}
|
|
44
|
+
export async function shutdownSddClient() {
|
|
45
|
+
if (cachedClient) {
|
|
46
|
+
try {
|
|
47
|
+
await cachedClient.close();
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
/* best-effort */
|
|
51
|
+
}
|
|
52
|
+
cachedClient = null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export function parseSddToolResult(content) {
|
|
56
|
+
const arr = content;
|
|
57
|
+
const first = arr?.[0];
|
|
58
|
+
if (!first || typeof first.text !== "string") {
|
|
59
|
+
return { body: {}, sources: [], pin: "HEAD" };
|
|
60
|
+
}
|
|
61
|
+
let parsed;
|
|
62
|
+
try {
|
|
63
|
+
parsed = JSON.parse(first.text);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return { body: {}, sources: [], pin: "HEAD" };
|
|
67
|
+
}
|
|
68
|
+
const sources = Array.isArray(parsed["sources"])
|
|
69
|
+
? parsed["sources"].filter((s) => typeof s === "string")
|
|
70
|
+
: [];
|
|
71
|
+
const pin = typeof parsed["pin_to_commit"] === "string"
|
|
72
|
+
? parsed["pin_to_commit"]
|
|
73
|
+
: "HEAD";
|
|
74
|
+
return { body: parsed, sources, pin };
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=sdd-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdd-client.js","sourceRoot":"","sources":["../../src/mcp/sdd-client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP types for adopter MCP servers. Mirrors the error-envelope
|
|
3
|
+
* shape from the method's MCP-server conventions (ADR 0128 §4).
|
|
4
|
+
*/
|
|
5
|
+
export interface McpErrorEnvelope {
|
|
6
|
+
readonly code: string;
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly remediation: string;
|
|
9
|
+
readonly context?: Record<string, unknown>;
|
|
10
|
+
readonly links?: ReadonlyArray<{
|
|
11
|
+
title: string;
|
|
12
|
+
url: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export declare class McpEnvelopeError extends Error {
|
|
16
|
+
readonly envelope: McpErrorEnvelope;
|
|
17
|
+
constructor(envelope: McpErrorEnvelope);
|
|
18
|
+
}
|
|
19
|
+
/** Result shape every composition-enabled tool returns per ADR 0130 §4.3. */
|
|
20
|
+
export interface CompositionResult<T> {
|
|
21
|
+
readonly payload: T;
|
|
22
|
+
readonly sources: readonly string[];
|
|
23
|
+
readonly pin_to_commit: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mcp/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;gBAExB,QAAQ,EAAE,gBAAgB;CAKvC;AAED,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP types for adopter MCP servers. Mirrors the error-envelope
|
|
3
|
+
* shape from the method's MCP-server conventions (ADR 0128 §4).
|
|
4
|
+
*/
|
|
5
|
+
export class McpEnvelopeError extends Error {
|
|
6
|
+
envelope;
|
|
7
|
+
constructor(envelope) {
|
|
8
|
+
super(envelope.message);
|
|
9
|
+
this.name = "McpEnvelopeError";
|
|
10
|
+
this.envelope = envelope;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/mcp/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,QAAQ,CAAmB;IAEpC,YAAY,QAA0B;QACpC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime artefact-pin verb delegation per ADR 0113.
|
|
3
|
+
*
|
|
4
|
+
* v0.1.0 ships the shape. Runtime delegation to the ADR 0113
|
|
5
|
+
* drift-detection surface is deferred — adopters implementing
|
|
6
|
+
* artefact-pin verbs today should compose against this shape and
|
|
7
|
+
* provide their own runtime until the upstream implementation lands.
|
|
8
|
+
*/
|
|
9
|
+
export interface ArtifactsVerbOptions {
|
|
10
|
+
subcommand: "list" | "check" | "probe" | "upgrade";
|
|
11
|
+
}
|
|
12
|
+
export interface ArtifactsVerbResult {
|
|
13
|
+
status: "unimplemented";
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function runArtifactsVerb(_options: ArtifactsVerbOptions): Promise<ArtifactsVerbResult>;
|
|
17
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/pins/artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CAI9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime artefact-pin verb delegation per ADR 0113.
|
|
3
|
+
*
|
|
4
|
+
* v0.1.0 ships the shape. Runtime delegation to the ADR 0113
|
|
5
|
+
* drift-detection surface is deferred — adopters implementing
|
|
6
|
+
* artefact-pin verbs today should compose against this shape and
|
|
7
|
+
* provide their own runtime until the upstream implementation lands.
|
|
8
|
+
*/
|
|
9
|
+
export async function runArtifactsVerb(_options) {
|
|
10
|
+
throw new Error("runArtifactsVerb: not implemented in v0.1.0. The artifacts verb shape is documented per ADR 0113; runtime delegation lands in a later release.");
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/pins/artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAA8B;IAE9B,MAAM,IAAI,KAAK,CACb,gJAAgJ,CACjJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-SDD contract-pin verb delegation per ADR 0110.
|
|
3
|
+
*
|
|
4
|
+
* v0.1.0 ships the shape. Runtime delegation to the ADR 0110
|
|
5
|
+
* consumer-manifest surface is deferred — adopters implementing
|
|
6
|
+
* contract-pin verbs today should compose against this shape and
|
|
7
|
+
* provide their own runtime until the upstream implementation lands.
|
|
8
|
+
*/
|
|
9
|
+
export interface ContractsVerbOptions {
|
|
10
|
+
subcommand: "list" | "check" | "probe" | "upgrade";
|
|
11
|
+
}
|
|
12
|
+
export interface ContractsVerbResult {
|
|
13
|
+
status: "unimplemented";
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function runContractsVerb(_options: ContractsVerbOptions): Promise<ContractsVerbResult>;
|
|
17
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/pins/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CAI9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-SDD contract-pin verb delegation per ADR 0110.
|
|
3
|
+
*
|
|
4
|
+
* v0.1.0 ships the shape. Runtime delegation to the ADR 0110
|
|
5
|
+
* consumer-manifest surface is deferred — adopters implementing
|
|
6
|
+
* contract-pin verbs today should compose against this shape and
|
|
7
|
+
* provide their own runtime until the upstream implementation lands.
|
|
8
|
+
*/
|
|
9
|
+
export async function runContractsVerb(_options) {
|
|
10
|
+
throw new Error("runContractsVerb: not implemented in v0.1.0. The contracts verb shape is documented per ADR 0110; runtime delegation lands in a later release.");
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/pins/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAA8B;IAE9B,MAAM,IAAI,KAAK,CACb,gJAAgJ,CACjJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { runContractsVerb } from "./contracts.js";
|
|
2
|
+
export type { ContractsVerbOptions, ContractsVerbResult, } from "./contracts.js";
|
|
3
|
+
export { runArtifactsVerb } from "./artifacts.js";
|
|
4
|
+
export type { ArtifactsVerbOptions, ArtifactsVerbResult, } from "./artifacts.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|