groundwork-mcp 0.1.0 → 0.2.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/NOTICE CHANGED
@@ -2,4 +2,4 @@ Groundwork
2
2
  Copyright 2026 The Groundwork Authors
3
3
 
4
4
  This product includes software developed by The Groundwork Authors
5
- (https://github.com/ganjilive/groundwork).
5
+ (https://github.com/IdeatorlabsAB/groundwork).
package/README.md CHANGED
@@ -26,7 +26,7 @@ claude mcp add groundwork -- npx -y groundwork-mcp
26
26
  Or install the plugin, which adds the MCP server and a skill that teaches Claude when to use it:
27
27
 
28
28
  ```
29
- /plugin marketplace add ganjilive/groundwork
29
+ /plugin marketplace add IdeatorlabsAB/groundwork
30
30
  /plugin install groundwork@groundwork
31
31
  ```
32
32
 
@@ -49,6 +49,7 @@ npx -p groundwork-mcp groundwork init # create groundwork/config.yml
49
49
  npx -p groundwork-mcp groundwork validate # check every item and link; exits 1 on errors
50
50
  npx -p groundwork-mcp groundwork trace REQ-0002
51
51
  npx -p groundwork-mcp groundwork list hypothesis
52
+ npx -p groundwork-mcp groundwork import --to <web app> # see "Groundwork for teams"
52
53
  ```
53
54
 
54
55
  `trace` shows the chain behind an item (from [examples/acme](examples/acme)):
@@ -114,7 +115,17 @@ Insights hold what customers said, and these files usually end up in git. Ground
114
115
 
115
116
  ## Groundwork for teams
116
117
 
117
- The Groundwork web app adds dashboards, reports, a visual evidence graph, approvals with an audit trail and Linear sync for people who don't live in a terminal. You can import a `groundwork/` folder into it. The web app is a separate, paid product; this project is and stays open source.
118
+ The Groundwork web app adds dashboards, reports, a visual evidence graph, approvals with an audit trail and Linear sync for people who don't live in a terminal. It's a separate, paid product; this project is and stays open source.
119
+
120
+ To move a project into it, create an agent token in the web app (**Settings → Connect an agent**), then:
121
+
122
+ ```sh
123
+ export GROUNDWORK_TOKEN=gw_…
124
+ npx -p groundwork-mcp groundwork import --to https://your-groundwork-app --dry-run # see what would happen
125
+ npx -p groundwork-mcp groundwork import --to https://your-groundwork-app
126
+ ```
127
+
128
+ Every item keeps its links, and its original id (`INS-0001`) is stored with it. Running the import again skips items already there (`--overwrite` replaces them). Afterwards `groundwork/config.yml` says `migrated:`, so local tools only read the files and the web app is where changes go. The command prints how to point your agent at the web app's MCP server.
118
129
 
119
130
  ## Contributing
120
131
 
@@ -887,7 +887,7 @@ function validate(loaded, config) {
887
887
  import { randomUUID } from "crypto";
888
888
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
889
889
  import { z as z4 } from "zod";
890
- var VERSION = true ? "0.1.0" : "0.0.0-dev";
890
+ var VERSION = true ? "0.2.0" : "0.0.0-dev";
891
891
  var { insightInput: insightInput2, hypothesisInput: hypothesisInput2, experimentInput: experimentInput2, findingInput: findingInput2, requirementInput: requirementInput2, PATCHES } = localSchemas;
892
892
  var INSTRUCTIONS = `Groundwork keeps this product's evidence and decisions as linked Markdown files in the groundwork/ folder, as a chain:
893
893
  insight -> hypothesis -> experiment -> finding -> requirement.
@@ -1521,4 +1521,4 @@ export {
1521
1521
  outgoing,
1522
1522
  buildServer
1523
1523
  };
1524
- //# sourceMappingURL=chunk-3W4X6WV2.js.map
1524
+ //# sourceMappingURL=chunk-5LIKTHEE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildServer,
3
3
  findRoot
4
- } from "./chunk-3W4X6WV2.js";
4
+ } from "./chunk-5LIKTHEE.js";
5
5
 
6
6
  // src/mcp/run.ts
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -13,4 +13,4 @@ async function runMcp() {
13
13
  export {
14
14
  runMcp
15
15
  };
16
- //# sourceMappingURL=chunk-NRKF6WRA.js.map
16
+ //# sourceMappingURL=chunk-7CAQUVOH.js.map
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runMcp
4
- } from "./chunk-NRKF6WRA.js";
4
+ } from "./chunk-7CAQUVOH.js";
5
5
  import {
6
6
  COLLECTIONS,
7
7
  ConfigError,
@@ -15,11 +15,71 @@ import {
15
15
  readConfig,
16
16
  validate,
17
17
  writeConfig
18
- } from "./chunk-3W4X6WV2.js";
18
+ } from "./chunk-5LIKTHEE.js";
19
19
 
20
20
  // src/cli.ts
21
21
  import { parseArgs } from "util";
22
- var VERSION = true ? "0.1.0" : "0.0.0-dev";
22
+
23
+ // src/store/import.ts
24
+ var BUNDLE_FORMAT = "groundwork-files";
25
+ var MAX_BYTES = 4e6;
26
+ var ImportError = class extends Error {
27
+ constructor(message, problems = []) {
28
+ super(message);
29
+ this.problems = problems;
30
+ }
31
+ problems;
32
+ };
33
+ function buildBundle(root, opts = {}) {
34
+ const config = readConfig(root);
35
+ const loaded = load(root);
36
+ const problems = validate(loaded, config).filter((p) => p.level === "error");
37
+ if (problems.length) throw new ImportError(`Fix ${problems.length} error${problems.length === 1 ? "" : "s"} first (run groundwork validate).`, problems);
38
+ const { activity: _activity, ...items } = loaded.items;
39
+ void _activity;
40
+ return {
41
+ format: BUNDLE_FORMAT,
42
+ schemaVersion: 1,
43
+ config: { name: config.name, productAreas: config.productAreas, products: config.products, people: config.people },
44
+ items,
45
+ dryRun: Boolean(opts.dryRun),
46
+ overwrite: Boolean(opts.overwrite)
47
+ };
48
+ }
49
+ async function runImport(opts) {
50
+ let origin;
51
+ try {
52
+ const u = new URL(opts.to);
53
+ if (u.protocol !== "https:" && !["localhost", "127.0.0.1"].includes(u.hostname)) throw new Error();
54
+ origin = u.origin;
55
+ } catch {
56
+ throw new ImportError(`--to must be the web app's https address, e.g. https://groundwork.example.com (got "${opts.to}").`);
57
+ }
58
+ if (!/^gw_[A-Za-z0-9_-]{20,100}$/.test(opts.token)) {
59
+ throw new ImportError("That doesn't look like a Groundwork agent token (gw_\u2026). Create one in the web app: Settings \u2192 Connect an agent.");
60
+ }
61
+ const body = JSON.stringify(buildBundle(opts.root, opts));
62
+ if (body.length > MAX_BYTES) throw new ImportError(`This project is ${(body.length / 1e6).toFixed(1)} MB, more than an import can take (4 MB).`);
63
+ const res = await (opts.fetch ?? fetch)(`${origin}/api/import`, {
64
+ method: "POST",
65
+ headers: { "content-type": "application/json", authorization: `Bearer ${opts.token}` },
66
+ body
67
+ });
68
+ const text = await res.text();
69
+ let data;
70
+ try {
71
+ data = JSON.parse(text);
72
+ } catch {
73
+ throw new ImportError(`The web app answered ${res.status} without JSON. Is ${origin} a Groundwork web app?`);
74
+ }
75
+ if (!res.ok) throw new ImportError(data.error?.message ?? `The import failed (${res.status}).`);
76
+ const report = data;
77
+ if (!report.dryRun) writeConfig(opts.root, { ...readConfig(opts.root), migrated: report.url });
78
+ return report;
79
+ }
80
+
81
+ // src/cli.ts
82
+ var VERSION = true ? "0.2.0" : "0.0.0-dev";
23
83
  var HELP = `groundwork ${VERSION}: product evidence as linked files in your repo
24
84
 
25
85
  Usage:
@@ -27,6 +87,8 @@ Usage:
27
87
  groundwork validate [--json] Check every item and link. Exits 1 on errors (use it in CI)
28
88
  groundwork trace <ID> Show the evidence chain behind an item, e.g. REQ-0003
29
89
  groundwork list [kind] List items, optionally only one kind
90
+ groundwork import --to <web app url> Move this project into the Groundwork web app
91
+ [--dry-run] [--overwrite] (token from $GROUNDWORK_TOKEN)
30
92
  groundwork mcp Run the MCP server over stdio (same as groundwork-mcp)
31
93
 
32
94
  Connect your agent (Claude Code):
@@ -122,10 +184,49 @@ function cmdList(kind) {
122
184
  }
123
185
  return 0;
124
186
  }
187
+ async function cmdImport(to, token, dryRun, overwrite) {
188
+ if (!to || !token) {
189
+ console.error("Usage: GROUNDWORK_TOKEN=gw_\u2026 groundwork import --to https://<your Groundwork web app> [--dry-run] [--overwrite]");
190
+ console.error("Create the token in the web app: Settings \u2192 Connect an agent.");
191
+ return 1;
192
+ }
193
+ const root = findRoot();
194
+ const already = readConfig(root).migrated;
195
+ if (already && !dryRun) console.log(dim(`This folder was imported before (${already}). Items already there are ${overwrite ? "replaced" : "skipped"}.`));
196
+ try {
197
+ const r = await runImport({ root, to, token, dryRun, overwrite });
198
+ console.log(`${dryRun ? bold("Dry run, nothing saved. ") : ""}${r.workspace}: ${r.created} new, ${r.updated} replaced, ${r.skipped} already there.`);
199
+ if (r.addedAreas.length) console.log(`Product areas added: ${r.addedAreas.join(", ")}`);
200
+ if (r.addedProducts.length) console.log(`Products added: ${r.addedProducts.join(", ")}`);
201
+ for (const w of r.warnings) console.log(`${yellow("warning")} ${w}`);
202
+ if (!dryRun) {
203
+ console.log(green(`Imported. Open ${r.url}`));
204
+ console.log(`
205
+ ${DIR}/config.yml now says migrated, so local tools only read these files. Point your agent at the web app:`);
206
+ console.log(` claude mcp remove groundwork`);
207
+ console.log(` claude mcp add --transport http groundwork ${new URL(r.url).origin}/api/mcp --header "Authorization: Bearer $GROUNDWORK_TOKEN"`);
208
+ }
209
+ return 0;
210
+ } catch (e) {
211
+ if (!(e instanceof ImportError)) throw e;
212
+ console.error(red(e.message));
213
+ for (const p of e.problems.slice(0, 20)) console.error(` ${p.file}: ${p.message}`);
214
+ return 1;
215
+ }
216
+ }
125
217
  async function main() {
126
218
  const { values, positionals } = parseArgs({
127
219
  allowPositionals: true,
128
- options: { name: { type: "string" }, json: { type: "boolean" }, help: { type: "boolean", short: "h" }, version: { type: "boolean", short: "v" } }
220
+ options: {
221
+ name: { type: "string" },
222
+ json: { type: "boolean" },
223
+ to: { type: "string" },
224
+ token: { type: "string" },
225
+ "dry-run": { type: "boolean" },
226
+ overwrite: { type: "boolean" },
227
+ help: { type: "boolean", short: "h" },
228
+ version: { type: "boolean", short: "v" }
229
+ }
129
230
  });
130
231
  const [cmd, arg] = positionals;
131
232
  if (values.version) return console.log(VERSION), 0;
@@ -140,6 +241,8 @@ async function main() {
140
241
  return cmdTrace(arg.toUpperCase());
141
242
  case "list":
142
243
  return cmdList(arg);
244
+ case "import":
245
+ return cmdImport(values.to, values.token ?? process.env.GROUNDWORK_TOKEN, Boolean(values["dry-run"]), Boolean(values.overwrite));
143
246
  case "mcp":
144
247
  await runMcp();
145
248
  return -1;
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { parseArgs } from \"node:util\";\nimport { KIND, type Kind } from \"./core/schemas\";\nimport type { Requirement } from \"./core/types\";\nimport { kindOf } from \"./core/requirements\";\nimport { ConfigError, DIR, findRoot, isInitialized, readConfig, writeConfig } from \"./store/config\";\nimport { COLLECTIONS, load, type Loaded } from \"./store/files\";\nimport { validate } from \"./store/validate\";\nimport { outgoing } from \"./mcp/server\";\nimport { runMcp } from \"./mcp/run\";\n\ndeclare const __VERSION__: string;\nconst VERSION = typeof __VERSION__ === \"string\" ? __VERSION__ : \"0.0.0-dev\";\n\nconst HELP = `groundwork ${VERSION}: product evidence as linked files in your repo\n\nUsage:\n groundwork init [--name <product>] Create groundwork/config.yml in this folder\n groundwork validate [--json] Check every item and link. Exits 1 on errors (use it in CI)\n groundwork trace <ID> Show the evidence chain behind an item, e.g. REQ-0003\n groundwork list [kind] List items, optionally only one kind\n groundwork mcp Run the MCP server over stdio (same as groundwork-mcp)\n\nConnect your agent (Claude Code):\n claude mcp add groundwork -- npx -y groundwork-mcp\n`;\n\nconst useColor = process.stdout.isTTY && !process.env.NO_COLOR;\nconst paint = (code: number) => (s: string) => (useColor ? `\\x1b[${code}m${s}\\x1b[0m` : s);\nconst dim = paint(2);\nconst red = paint(31);\nconst yellow = paint(33);\nconst green = paint(32);\nconst bold = paint(1);\n\ntype Item = { id: string; title: string; status?: string; verdict?: string };\n\nfunction index(loaded: Loaded) {\n const byId = new Map<string, { kind: Kind; item: Item }>();\n for (const kind of KIND.options) for (const item of loaded.items[COLLECTIONS[kind]] as Item[]) byId.set(item.id, { kind, item });\n return byId;\n}\n\nfunction label(kind: Kind, item: Item) {\n const tags = [\n kind === \"requirement\" ? kindOf(item as unknown as Requirement) : undefined,\n item.status,\n item.verdict && item.verdict !== item.status ? item.verdict : undefined,\n ].filter(Boolean);\n return `${bold(item.id)} ${item.title}${tags.length ? dim(` (${tags.join(\", \")})`) : \"\"}`;\n}\n\nfunction cmdInit(name?: string) {\n const root = process.cwd();\n if (isInitialized(root)) {\n console.log(`${DIR}/config.yml already exists.`);\n return 0;\n }\n const config = readConfig(root);\n writeConfig(root, name ? { ...config, name } : config);\n console.log(`Created ${DIR}/config.yml. Add your product areas, products and people there.`);\n console.log(`\\nConnect your agent:\\n claude mcp add groundwork -- npx -y groundwork-mcp`);\n return 0;\n}\n\nfunction cmdValidate(json: boolean) {\n const root = findRoot();\n const problems = validate(load(root), readConfig(root));\n const errors = problems.filter((p) => p.level === \"error\");\n if (json) {\n console.log(JSON.stringify({ ok: !errors.length, problems }, null, 2));\n } else {\n for (const p of problems) console.log(`${p.level === \"error\" ? red(\"error\") : yellow(\"warning\")} ${p.file}: ${p.message}`);\n const counts = `${errors.length} error${errors.length === 1 ? \"\" : \"s\"}, ${problems.length - errors.length} warning${problems.length - errors.length === 1 ? \"\" : \"s\"}`;\n console.log(errors.length ? red(counts) : green(problems.length ? counts : \"All items and links are valid.\"));\n }\n return errors.length ? 1 : 0;\n}\n\nfunction cmdTrace(id: string) {\n const loaded = load(findRoot());\n const byId = index(loaded);\n const root = byId.get(id);\n if (!root) {\n console.error(red(`No item with id ${id}.`));\n return 1;\n }\n console.log(label(root.kind, root.item));\n const seen = new Set([id]);\n const walk = (cur: string, prefix: string) => {\n const hit = byId.get(cur)!;\n const next = outgoing(hit.kind, hit.item as never).filter((x) => byId.has(x));\n next.forEach((x, i) => {\n const last = i === next.length - 1;\n const child = byId.get(x)!;\n const again = seen.has(x);\n console.log(`${prefix}${last ? \"└─ \" : \"├─ \"}${dim(child.kind)} ${label(child.kind, child.item)}${again ? dim(\" (shown above)\") : \"\"}`);\n if (!again) {\n seen.add(x);\n walk(x, prefix + (last ? \" \" : \"│ \"));\n }\n });\n };\n walk(id, \"\");\n const dangling = outgoing(root.kind, root.item as never).filter((x) => !byId.has(x));\n if (dangling.length) console.log(red(`Links to missing items: ${dangling.join(\", \")}`));\n return 0;\n}\n\nfunction cmdList(kind?: string) {\n if (kind && !KIND.options.includes(kind as Kind)) {\n console.error(red(`Unknown kind \"${kind}\". Use one of: ${KIND.options.join(\", \")}.`));\n return 1;\n }\n const loaded = load(findRoot());\n for (const k of kind ? [kind as Kind] : KIND.options) {\n const items = loaded.items[COLLECTIONS[k]] as Item[];\n if (!items.length) continue;\n console.log(bold(`${COLLECTIONS[k]} (${items.length})`));\n for (const item of [...items].sort((a, b) => a.id.localeCompare(b.id))) console.log(` ${label(k, item)}`);\n }\n return 0;\n}\n\nasync function main(): Promise<number> {\n const { values, positionals } = parseArgs({\n allowPositionals: true,\n options: { name: { type: \"string\" }, json: { type: \"boolean\" }, help: { type: \"boolean\", short: \"h\" }, version: { type: \"boolean\", short: \"v\" } },\n });\n const [cmd, arg] = positionals;\n if (values.version) return console.log(VERSION), 0;\n if (values.help || !cmd || cmd === \"help\") return console.log(HELP), 0;\n switch (cmd) {\n case \"init\":\n return cmdInit(values.name);\n case \"validate\":\n return cmdValidate(Boolean(values.json));\n case \"trace\":\n if (!arg) return console.error(\"Usage: groundwork trace <ID>\"), 1;\n return cmdTrace(arg.toUpperCase());\n case \"list\":\n return cmdList(arg);\n case \"mcp\":\n await runMcp();\n return -1; // keep running\n default:\n console.error(`Unknown command \"${cmd}\".\\n\\n${HELP}`);\n return 1;\n }\n}\n\nmain()\n .then((code) => {\n if (code >= 0) process.exit(code);\n })\n .catch((e) => {\n console.error(red(e instanceof ConfigError ? e.message : `groundwork: ${(e as Error).message}`));\n process.exit(1);\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,SAAS,iBAAiB;AAW1B,IAAM,UAAU,OAAkC,UAAc;AAEhE,IAAM,OAAO,cAAc,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAalC,IAAM,WAAW,QAAQ,OAAO,SAAS,CAAC,QAAQ,IAAI;AACt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AAQ,YAAY,IAAI,UAAU;AAAA,IACxC,kBAAkB;AAAA,IAClB,SAAS,EAAE,MAAM,EAAE,MAAM,SAAS,GAAG,MAAM,EAAE,MAAM,UAAU,GAAG,MAAM,EAAE,MAAM,WAAW,OAAO,IAAI,GAAG,SAAS,EAAE,MAAM,WAAW,OAAO,IAAI,EAAE;AAAA,EAClJ,CAAC;AACD,QAAM,CAAC,KAAK,GAAG,IAAI;AACnB,MAAI,OAAO,QAAS,QAAO,QAAQ,IAAI,OAAO,GAAG;AACjD,MAAI,OAAO,QAAQ,CAAC,OAAO,QAAQ,OAAQ,QAAO,QAAQ,IAAI,IAAI,GAAG;AACrE,UAAQ,KAAK;AAAA,IACX,KAAK;AACH,aAAO,QAAQ,OAAO,IAAI;AAAA,IAC5B,KAAK;AACH,aAAO,YAAY,QAAQ,OAAO,IAAI,CAAC;AAAA,IACzC,KAAK;AACH,UAAI,CAAC,IAAK,QAAO,QAAQ,MAAM,8BAA8B,GAAG;AAChE,aAAO,SAAS,IAAI,YAAY,CAAC;AAAA,IACnC,KAAK;AACH,aAAO,QAAQ,GAAG;AAAA,IACpB,KAAK;AACH,YAAM,OAAO;AACb,aAAO;AAAA;AAAA,IACT;AACE,cAAQ,MAAM,oBAAoB,GAAG;AAAA;AAAA,EAAS,IAAI,EAAE;AACpD,aAAO;AAAA,EACX;AACF;AAEA,KAAK,EACF,KAAK,CAAC,SAAS;AACd,MAAI,QAAQ,EAAG,SAAQ,KAAK,IAAI;AAClC,CAAC,EACA,MAAM,CAAC,MAAM;AACZ,UAAQ,MAAM,IAAI,aAAa,cAAc,EAAE,UAAU,eAAgB,EAAY,OAAO,EAAE,CAAC;AAC/F,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/cli.ts","../src/store/import.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { parseArgs } from \"node:util\";\nimport { KIND, type Kind } from \"./core/schemas\";\nimport type { Requirement } from \"./core/types\";\nimport { kindOf } from \"./core/requirements\";\nimport { ConfigError, DIR, findRoot, isInitialized, readConfig, writeConfig } from \"./store/config\";\nimport { COLLECTIONS, load, type Loaded } from \"./store/files\";\nimport { validate } from \"./store/validate\";\nimport { outgoing } from \"./mcp/server\";\nimport { runMcp } from \"./mcp/run\";\nimport { ImportError, runImport } from \"./store/import\";\n\ndeclare const __VERSION__: string;\nconst VERSION = typeof __VERSION__ === \"string\" ? __VERSION__ : \"0.0.0-dev\";\n\nconst HELP = `groundwork ${VERSION}: product evidence as linked files in your repo\n\nUsage:\n groundwork init [--name <product>] Create groundwork/config.yml in this folder\n groundwork validate [--json] Check every item and link. Exits 1 on errors (use it in CI)\n groundwork trace <ID> Show the evidence chain behind an item, e.g. REQ-0003\n groundwork list [kind] List items, optionally only one kind\n groundwork import --to <web app url> Move this project into the Groundwork web app\n [--dry-run] [--overwrite] (token from $GROUNDWORK_TOKEN)\n groundwork mcp Run the MCP server over stdio (same as groundwork-mcp)\n\nConnect your agent (Claude Code):\n claude mcp add groundwork -- npx -y groundwork-mcp\n`;\n\nconst useColor = process.stdout.isTTY && !process.env.NO_COLOR;\nconst paint = (code: number) => (s: string) => (useColor ? `\\x1b[${code}m${s}\\x1b[0m` : s);\nconst dim = paint(2);\nconst red = paint(31);\nconst yellow = paint(33);\nconst green = paint(32);\nconst bold = paint(1);\n\ntype Item = { id: string; title: string; status?: string; verdict?: string };\n\nfunction index(loaded: Loaded) {\n const byId = new Map<string, { kind: Kind; item: Item }>();\n for (const kind of KIND.options) for (const item of loaded.items[COLLECTIONS[kind]] as Item[]) byId.set(item.id, { kind, item });\n return byId;\n}\n\nfunction label(kind: Kind, item: Item) {\n const tags = [\n kind === \"requirement\" ? kindOf(item as unknown as Requirement) : undefined,\n item.status,\n item.verdict && item.verdict !== item.status ? item.verdict : undefined,\n ].filter(Boolean);\n return `${bold(item.id)} ${item.title}${tags.length ? dim(` (${tags.join(\", \")})`) : \"\"}`;\n}\n\nfunction cmdInit(name?: string) {\n const root = process.cwd();\n if (isInitialized(root)) {\n console.log(`${DIR}/config.yml already exists.`);\n return 0;\n }\n const config = readConfig(root);\n writeConfig(root, name ? { ...config, name } : config);\n console.log(`Created ${DIR}/config.yml. Add your product areas, products and people there.`);\n console.log(`\\nConnect your agent:\\n claude mcp add groundwork -- npx -y groundwork-mcp`);\n return 0;\n}\n\nfunction cmdValidate(json: boolean) {\n const root = findRoot();\n const problems = validate(load(root), readConfig(root));\n const errors = problems.filter((p) => p.level === \"error\");\n if (json) {\n console.log(JSON.stringify({ ok: !errors.length, problems }, null, 2));\n } else {\n for (const p of problems) console.log(`${p.level === \"error\" ? red(\"error\") : yellow(\"warning\")} ${p.file}: ${p.message}`);\n const counts = `${errors.length} error${errors.length === 1 ? \"\" : \"s\"}, ${problems.length - errors.length} warning${problems.length - errors.length === 1 ? \"\" : \"s\"}`;\n console.log(errors.length ? red(counts) : green(problems.length ? counts : \"All items and links are valid.\"));\n }\n return errors.length ? 1 : 0;\n}\n\nfunction cmdTrace(id: string) {\n const loaded = load(findRoot());\n const byId = index(loaded);\n const root = byId.get(id);\n if (!root) {\n console.error(red(`No item with id ${id}.`));\n return 1;\n }\n console.log(label(root.kind, root.item));\n const seen = new Set([id]);\n const walk = (cur: string, prefix: string) => {\n const hit = byId.get(cur)!;\n const next = outgoing(hit.kind, hit.item as never).filter((x) => byId.has(x));\n next.forEach((x, i) => {\n const last = i === next.length - 1;\n const child = byId.get(x)!;\n const again = seen.has(x);\n console.log(`${prefix}${last ? \"└─ \" : \"├─ \"}${dim(child.kind)} ${label(child.kind, child.item)}${again ? dim(\" (shown above)\") : \"\"}`);\n if (!again) {\n seen.add(x);\n walk(x, prefix + (last ? \" \" : \"│ \"));\n }\n });\n };\n walk(id, \"\");\n const dangling = outgoing(root.kind, root.item as never).filter((x) => !byId.has(x));\n if (dangling.length) console.log(red(`Links to missing items: ${dangling.join(\", \")}`));\n return 0;\n}\n\nfunction cmdList(kind?: string) {\n if (kind && !KIND.options.includes(kind as Kind)) {\n console.error(red(`Unknown kind \"${kind}\". Use one of: ${KIND.options.join(\", \")}.`));\n return 1;\n }\n const loaded = load(findRoot());\n for (const k of kind ? [kind as Kind] : KIND.options) {\n const items = loaded.items[COLLECTIONS[k]] as Item[];\n if (!items.length) continue;\n console.log(bold(`${COLLECTIONS[k]} (${items.length})`));\n for (const item of [...items].sort((a, b) => a.id.localeCompare(b.id))) console.log(` ${label(k, item)}`);\n }\n return 0;\n}\n\nasync function cmdImport(to: string | undefined, token: string | undefined, dryRun: boolean, overwrite: boolean) {\n if (!to || !token) {\n console.error(\"Usage: GROUNDWORK_TOKEN=gw_… groundwork import --to https://<your Groundwork web app> [--dry-run] [--overwrite]\");\n console.error(\"Create the token in the web app: Settings → Connect an agent.\");\n return 1;\n }\n const root = findRoot();\n const already = readConfig(root).migrated;\n if (already && !dryRun) console.log(dim(`This folder was imported before (${already}). Items already there are ${overwrite ? \"replaced\" : \"skipped\"}.`));\n try {\n const r = await runImport({ root, to, token, dryRun, overwrite });\n console.log(`${dryRun ? bold(\"Dry run, nothing saved. \") : \"\"}${r.workspace}: ${r.created} new, ${r.updated} replaced, ${r.skipped} already there.`);\n if (r.addedAreas.length) console.log(`Product areas added: ${r.addedAreas.join(\", \")}`);\n if (r.addedProducts.length) console.log(`Products added: ${r.addedProducts.join(\", \")}`);\n for (const w of r.warnings) console.log(`${yellow(\"warning\")} ${w}`);\n if (!dryRun) {\n console.log(green(`Imported. Open ${r.url}`));\n console.log(`\\n${DIR}/config.yml now says migrated, so local tools only read these files. Point your agent at the web app:`);\n console.log(` claude mcp remove groundwork`);\n console.log(` claude mcp add --transport http groundwork ${new URL(r.url).origin}/api/mcp --header \"Authorization: Bearer $GROUNDWORK_TOKEN\"`);\n }\n return 0;\n } catch (e) {\n if (!(e instanceof ImportError)) throw e;\n console.error(red(e.message));\n for (const p of e.problems.slice(0, 20)) console.error(` ${p.file}: ${p.message}`);\n return 1;\n }\n}\n\nasync function main(): Promise<number> {\n const { values, positionals } = parseArgs({\n allowPositionals: true,\n options: {\n name: { type: \"string\" },\n json: { type: \"boolean\" },\n to: { type: \"string\" },\n token: { type: \"string\" },\n \"dry-run\": { type: \"boolean\" },\n overwrite: { type: \"boolean\" }, help: { type: \"boolean\", short: \"h\" }, version: { type: \"boolean\", short: \"v\" } },\n });\n const [cmd, arg] = positionals;\n if (values.version) return console.log(VERSION), 0;\n if (values.help || !cmd || cmd === \"help\") return console.log(HELP), 0;\n switch (cmd) {\n case \"init\":\n return cmdInit(values.name);\n case \"validate\":\n return cmdValidate(Boolean(values.json));\n case \"trace\":\n if (!arg) return console.error(\"Usage: groundwork trace <ID>\"), 1;\n return cmdTrace(arg.toUpperCase());\n case \"list\":\n return cmdList(arg);\n case \"import\":\n return cmdImport(values.to, values.token ?? process.env.GROUNDWORK_TOKEN, Boolean(values[\"dry-run\"]), Boolean(values.overwrite));\n case \"mcp\":\n await runMcp();\n return -1; // keep running\n default:\n console.error(`Unknown command \"${cmd}\".\\n\\n${HELP}`);\n return 1;\n }\n}\n\nmain()\n .then((code) => {\n if (code >= 0) process.exit(code);\n })\n .catch((e) => {\n console.error(red(e instanceof ConfigError ? e.message : `groundwork: ${(e as Error).message}`));\n process.exit(1);\n });\n","import { readConfig, writeConfig } from \"./config\";\nimport { load } from \"./files\";\nimport { validate, type Problem } from \"./validate\";\n\n/**\n * Moving a project into the Groundwork web app: send every item to its /api/import endpoint, then mark the folder\n * as migrated so local tools stop writing (the web app is where changes go from then on).\n */\n\nexport const BUNDLE_FORMAT = \"groundwork-files\";\n/** Hosting platforms cap request bodies around 4.5 MB. */\nconst MAX_BYTES = 4_000_000;\n\nexport interface ImportReport {\n workspace: string;\n url: string;\n dryRun: boolean;\n created: number;\n updated: number;\n skipped: number;\n addedAreas: string[];\n addedProducts: string[];\n warnings: string[];\n ids: Record<string, string>;\n}\n\nexport class ImportError extends Error {\n constructor(\n message: string,\n readonly problems: Problem[] = [],\n ) {\n super(message);\n }\n}\n\nexport function buildBundle(root: string, opts: { dryRun?: boolean; overwrite?: boolean } = {}) {\n const config = readConfig(root);\n const loaded = load(root);\n const problems = validate(loaded, config).filter((p) => p.level === \"error\");\n if (problems.length) throw new ImportError(`Fix ${problems.length} error${problems.length === 1 ? \"\" : \"s\"} first (run groundwork validate).`, problems);\n const { activity: _activity, ...items } = loaded.items;\n void _activity;\n return {\n format: BUNDLE_FORMAT,\n schemaVersion: 1,\n config: { name: config.name, productAreas: config.productAreas, products: config.products, people: config.people },\n items,\n dryRun: Boolean(opts.dryRun),\n overwrite: Boolean(opts.overwrite),\n };\n}\n\nexport async function runImport(opts: {\n root: string;\n /** The web app's address, e.g. https://groundwork.example.com */\n to: string;\n token: string;\n dryRun?: boolean;\n overwrite?: boolean;\n fetch?: typeof fetch;\n}): Promise<ImportReport> {\n let origin: string;\n try {\n const u = new URL(opts.to);\n if (u.protocol !== \"https:\" && ![\"localhost\", \"127.0.0.1\"].includes(u.hostname)) throw new Error();\n origin = u.origin;\n } catch {\n throw new ImportError(`--to must be the web app's https address, e.g. https://groundwork.example.com (got \"${opts.to}\").`);\n }\n if (!/^gw_[A-Za-z0-9_-]{20,100}$/.test(opts.token)) {\n throw new ImportError(\"That doesn't look like a Groundwork agent token (gw_…). Create one in the web app: Settings → Connect an agent.\");\n }\n const body = JSON.stringify(buildBundle(opts.root, opts));\n if (body.length > MAX_BYTES) throw new ImportError(`This project is ${(body.length / 1e6).toFixed(1)} MB, more than an import can take (4 MB).`);\n\n const res = await (opts.fetch ?? fetch)(`${origin}/api/import`, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", authorization: `Bearer ${opts.token}` },\n body,\n });\n const text = await res.text();\n let data: unknown;\n try {\n data = JSON.parse(text);\n } catch {\n throw new ImportError(`The web app answered ${res.status} without JSON. Is ${origin} a Groundwork web app?`);\n }\n if (!res.ok) throw new ImportError((data as { error?: { message?: string } }).error?.message ?? `The import failed (${res.status}).`);\n const report = data as ImportReport;\n if (!report.dryRun) writeConfig(opts.root, { ...readConfig(opts.root), migr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
@@ -53,7 +53,7 @@ import {
53
53
  targetLabel,
54
54
  validate,
55
55
  writeConfig
56
- } from "./chunk-3W4X6WV2.js";
56
+ } from "./chunk-5LIKTHEE.js";
57
57
 
58
58
  // src/core/trace.ts
59
59
  function trailForRequirement(r, g) {
package/dist/mcp.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runMcp
4
- } from "./chunk-NRKF6WRA.js";
5
- import "./chunk-3W4X6WV2.js";
4
+ } from "./chunk-7CAQUVOH.js";
5
+ import "./chunk-5LIKTHEE.js";
6
6
 
7
7
  // src/mcp/main.ts
8
8
  runMcp().catch((e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundwork-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Keep product evidence (insights, hypotheses, experiments, findings, requirements) as linked Markdown files in your repo, written by your own coding agent over MCP.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -35,10 +35,10 @@
35
35
  ],
36
36
  "repository": {
37
37
  "type": "git",
38
- "url": "git+https://github.com/ganjilive/groundwork.git"
38
+ "url": "git+https://github.com/IdeatorlabsAB/groundwork.git"
39
39
  },
40
- "homepage": "https://github.com/ganjilive/groundwork#readme",
41
- "bugs": "https://github.com/ganjilive/groundwork/issues",
40
+ "homepage": "https://github.com/IdeatorlabsAB/groundwork#readme",
41
+ "bugs": "https://github.com/IdeatorlabsAB/groundwork/issues",
42
42
  "scripts": {
43
43
  "build": "tsup",
44
44
  "dev": "tsup --watch",