archidocs 1.4.0-beta.2 → 1.4.0-beta.4

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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/commands.d.ts +59 -6
  3. package/dist/cli/commands.js +30 -6
  4. package/dist/cli/init.js +1 -1
  5. package/dist/cli/run.js +27 -4
  6. package/dist/commands/gaps.d.ts +24 -0
  7. package/dist/commands/gaps.js +14 -0
  8. package/dist/commands/index.d.ts +1 -0
  9. package/dist/commands/index.js +1 -0
  10. package/dist/core/gaps.d.ts +53 -0
  11. package/dist/core/gaps.js +96 -0
  12. package/dist/core/index.d.ts +1 -0
  13. package/dist/core/index.js +1 -0
  14. package/dist/core/load.js +7 -3
  15. package/dist/guide/index.d.ts +76 -13
  16. package/dist/guide/index.js +60 -26
  17. package/dist/mcp/server.js +60 -15
  18. package/dist/render/sequence-svg.js +2 -2
  19. package/dist/render/svg.js +1 -1
  20. package/dist/schema/bundle.d.ts +14 -0
  21. package/dist/schema/bundle.js +5 -3
  22. package/dist/schema/workspace.d.ts +35 -0
  23. package/dist/schema/workspace.js +10 -0
  24. package/dist/viewer/assets/{index-CzXU8F_3.css → index-BL2vQQ6T.css} +1 -1
  25. package/dist/viewer/assets/{index-DmVLe9LK.js → index-Oy0Hpoqy.js} +8 -8
  26. package/dist/viewer/assets/sequence-svg-DDwcPtpC.js +2 -0
  27. package/dist/viewer/assets/svg-Cboa7QX_.js +2 -0
  28. package/dist/viewer/index.html +2 -2
  29. package/dist/writer/document.js +22 -1
  30. package/guide/SKILL.md +4 -4
  31. package/guide/topics/add-service.md +2 -1
  32. package/guide/topics/fill-gaps.md +87 -0
  33. package/guide/topics/relationships.md +24 -0
  34. package/package.json +1 -1
  35. package/schemas/model.schema.json +75 -0
  36. package/dist/viewer/assets/sequence-svg-BtEmwvN4.js +0 -2
  37. package/dist/viewer/assets/svg-DXIkkkSu.js +0 -2
@@ -2,14 +2,12 @@ import { readFile } from "node:fs/promises";
2
2
  import { ruleCatalogue } from "../core/catalogue.js";
3
3
  import { suggest } from "../core/suggest.js";
4
4
  /**
5
- * The authoring guide's Markdown, shipped beside the code in `guide/`. The
5
+ * The skills' guides, as Markdown shipped beside the code in `guide/`. The
6
6
  * module runs from dist/guide/ when installed and from src/guide/ in this
7
7
  * repo; both sit two levels below the package root.
8
8
  */
9
9
  const GUIDE_DIR = new URL("../../guide/", import.meta.url);
10
- /** The skill's name, as its stub and the full SKILL.md both declare it. */
11
- export const SKILL_NAME = "archidocs-authoring";
12
- /** The guide's topics, in the order they are listed. `rules` is generated from the rule registry. */
10
+ /** The authoring guide's topics, in the order they are listed. `rules` is generated from the rule registry. */
13
11
  export const topics = [
14
12
  { id: "bootstrap", summary: "Declare an existing codebase's Services, Relationships and Deployments in one pass, from an approved inventory." },
15
13
  { id: "add-service", summary: "Add one Service with its Components, Relationships and Deployments." },
@@ -18,41 +16,77 @@ export const topics = [
18
16
  { id: "dynamic-view", summary: "Draft a scenario as Steps over existing Relationships, adding missing ones." },
19
17
  { id: "saved-view", summary: "Save a structural or Deployment View with selectors and a Lens." },
20
18
  { id: "propose-adr", summary: "Propose an ADR linked to the Elements and Views it affects." },
19
+ { id: "fill-gaps", summary: "Interview the user about the fields the Model leaves empty, proposing each value from evidence in the code and writing it as it is confirmed." },
21
20
  { id: "change", summary: "Rename, move or remove, working through refused removals by their references." },
22
21
  { id: "rules", summary: "Every `check` rule id: what it means, a failing example and the fix." },
23
22
  ];
23
+ /** Every skill, authoring first. */
24
+ export const skills = [
25
+ {
26
+ id: "authoring",
27
+ name: "archidocs-authoring",
28
+ description: "Edit the Archidocs architecture Model. Use when bootstrapping a Project from code, adding or changing Services, Relationships, Deployments or Views, proposing an ADR, or finding and filling documentation gaps.",
29
+ dir: "",
30
+ topics,
31
+ },
32
+ ];
33
+ /** The authoring skill's name, as its stub and the full SKILL.md both declare it. */
34
+ export const SKILL_NAME = skills[0].name;
24
35
  /**
25
- * The guide as `get_authoring_guide` and `archidocs guide` serve it: with no
26
- * topic, SKILL.md followed by the list of topics; with one, that topic's
27
- * reference file.
36
+ * A skill's guide as `get_guide` and `archidocs guide --skill` serve it: with
37
+ * no topic, its SKILL.md, followed by its list of topics if it has any; with
38
+ * one, that topic's reference file. An unknown skill names the closest one.
28
39
  */
29
- export async function authoringGuide(topic) {
40
+ export async function guide(skill, topic) {
41
+ const found = skills.find((s) => s.id === skill);
42
+ if (!found) {
43
+ const ids = skills.map((s) => s.id);
44
+ const suggestion = suggest(skill, ids);
45
+ return { ok: false, message: `Unknown skill "${skill}"${suggestion ? `; did you mean "${suggestion}"?` : ""} Skills: ${ids.join(", ")}.`, ...(suggestion ? { suggestion } : {}) };
46
+ }
47
+ return skillGuide(found, topic);
48
+ }
49
+ /** One skill's guide, for `guide` once the skill is found. */
50
+ export async function skillGuide(skill, topic) {
51
+ const own = skill.topics ?? [];
30
52
  if (topic === undefined) {
31
- const skill = await readFile(new URL("SKILL.md", GUIDE_DIR), "utf8");
32
- const list = ["## Topics", "", ...topics.map((t) => `- \`${t.id}\`: ${t.summary}`)];
33
- return { ok: true, topic: null, text: `${skill.trimEnd()}\n\n${list.join("\n")}\n` };
53
+ const text = (await readFile(new URL(`${skill.dir}SKILL.md`, GUIDE_DIR), "utf8")).trimEnd();
54
+ const list = own.length ? ["", "", "## Topics", "", ...own.map((t) => `- \`${t.id}\`: ${t.summary}`)].join("\n") : "";
55
+ return { ok: true, skill: skill.id, topic: null, text: `${text}${list}\n` };
34
56
  }
35
- const found = topics.find((t) => t.id === topic);
57
+ if (!own.length)
58
+ return { ok: false, message: `The skill "${skill.id}" has no topics; load it with no topic.` };
59
+ const found = own.find((t) => t.id === topic);
36
60
  if (!found) {
37
- const suggestion = suggest(topic, topics.map((t) => t.id));
38
- return { ok: false, message: `Unknown topic "${topic}"${suggestion ? `; did you mean "${suggestion}"?` : ""} Topics: ${topics.map((t) => t.id).join(", ")}.`, ...(suggestion ? { suggestion } : {}) };
61
+ const suggestion = suggest(topic, own.map((t) => t.id));
62
+ return { ok: false, message: `Unknown topic "${topic}"${suggestion ? `; did you mean "${suggestion}"?` : ""} Topics: ${own.map((t) => t.id).join(", ")}.`, ...(suggestion ? { suggestion } : {}) };
39
63
  }
40
- if (found.id === "rules")
41
- return { ok: true, topic: found.id, text: ruleCatalogue() };
42
- return { ok: true, topic: found.id, text: await readFile(new URL(`topics/${found.id}.md`, GUIDE_DIR), "utf8") };
64
+ if (skill.id === "authoring" && found.id === "rules")
65
+ return { ok: true, skill: skill.id, topic: found.id, text: ruleCatalogue() };
66
+ return { ok: true, skill: skill.id, topic: found.id, text: await readFile(new URL(`${skill.dir}topics/${found.id}.md`, GUIDE_DIR), "utf8") };
43
67
  }
68
+ /** The authoring guide, as `get_authoring_guide` and `archidocs guide` without `--skill` serve it. */
69
+ export const authoringGuide = (topic) => guide("authoring", topic);
70
+ const titleOf = (id) => `Archidocs ${id.replaceAll("-", " ")}`;
44
71
  /**
45
- * The thin SKILL.md that `archidocs init` installs in a repo, naming the
46
- * command that runs archidocs there (`runner`, such as `npx archidocs`). It
47
- * only points at the served guide, so it never goes stale, and uses only the
48
- * portable frontmatter fields.
72
+ * The thin SKILL.md that `archidocs init` installs in a repo for one skill,
73
+ * naming the command that runs archidocs there (`runner`, such as `npx
74
+ * archidocs`). It only points at the served guide, so it never goes stale, and
75
+ * uses only the portable frontmatter fields.
49
76
  */
50
- export const skillStub = (runner) => `---
51
- name: ${SKILL_NAME}
52
- description: Edit the Archidocs architecture Model. Use when bootstrapping a Project from code, adding or changing Services, Relationships, Deployments or Views, or proposing an ADR.
77
+ export function skillStub(id, runner) {
78
+ const skill = skills.find((s) => s.id === id);
79
+ const cli = (args) => `\`${runner} guide ${args}\``;
80
+ const load = skill.id === "authoring"
81
+ ? `Before editing the Model, load the full guide: call \`get_guide("authoring")\` on the Archidocs MCP server (\`get_authoring_guide\` on a server older than \`get_guide\`), or run ${cli("--skill authoring")} when no Archidocs MCP server is connected. It lists the topics; load the one for the task with \`get_guide("authoring", topic)\` or ${cli("<topic> --skill authoring")}, and follow it.`
82
+ : `Before you start, load the full guide: call \`get_guide("${skill.id}")\` on the Archidocs MCP server, or run ${cli(`--skill ${skill.id}`)} when no Archidocs MCP server is connected, and follow it.`;
83
+ return `---
84
+ name: ${skill.name}
85
+ description: ${skill.description}
53
86
  ---
54
87
 
55
- # Archidocs authoring
88
+ # ${titleOf(skill.id)}
56
89
 
57
- Before editing the Model, load the full guide: call the \`get_authoring_guide\` tool of the Archidocs MCP server, or run \`${runner} guide\` when no Archidocs MCP server is connected. It lists the topics; load the one for the task with \`get_authoring_guide(topic)\` or \`${runner} guide <topic>\`, and follow it.${runner === "archidocs" ? "" : ` In this repo, run every \`archidocs\` command as \`${runner}\`.`}
90
+ ${load}${runner === "archidocs" ? "" : ` In this repo, run every \`archidocs\` command as \`${runner}\`.`}
58
91
  `;
92
+ }
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  import { getDeployments } from "../core/deployments.js";
4
4
  import { withDocs } from "../core/rules.js";
5
5
  import { search } from "../core/search.js";
6
- import { changeKinds, countChanges, deriveEdges, diff, filterChanges, findPaths, getImpact, levelOf, listOwned, resolveScope, scopeMatcher, } from "../core/index.js";
6
+ import { changeKinds, countChanges, deriveEdges, diff, filterChanges, findPaths, formatGaps, gapNames, getImpact, listGaps, levelOf, listOwned, resolveScope, scopeMatcher, } from "../core/index.js";
7
7
  import { suggest } from "../core/suggest.js";
8
8
  import { describeLens, isScaled, listViews, resolveView } from "../core/views/index.js";
9
9
  import { listAdrs } from "../core/adrs.js";
@@ -13,7 +13,7 @@ import { POINT_GRAMMAR, touching } from "../revisions/index.js";
13
13
  import { pastOf } from "./history.js";
14
14
  import { registerWriteTools } from "./writes.js";
15
15
  import { callLine } from "./announce.js";
16
- import { authoringGuide, topics } from "../guide/index.js";
16
+ import { authoringGuide, guide as skillGuide, skills, topics } from "../guide/index.js";
17
17
  const ok = (data, text) => ({ ok: true, data, text });
18
18
  const fail = (code, message, suggestions) => ({ ok: false, code, message, ...(suggestions ? { suggestions } : {}) });
19
19
  /**
@@ -157,7 +157,9 @@ export function createServer(options) {
157
157
  ["technology", "technology" in element ? element.technology : null],
158
158
  ["external", "external" in element && element.external ? "yes" : null],
159
159
  ["tags", element.tags.join(", ")],
160
+ ["repository", "repository" in element ? element.repository : null],
160
161
  ["links", element.links.map((l) => `[${l.label}](${l.url})`).join(", ")],
162
+ ["metadata", Object.entries(element.metadata).map(([k, v]) => `${k}: ${v}`).join(", ")],
161
163
  ["children", children.map(label).join(", ")],
162
164
  ["deployments", deployments.map((d) => `${d.environment} on ${d.target}${d.url ? ` (${d.url})` : ""}`).join(", ")],
163
165
  ["uses", relationships.out.map((r) => `${r.to}${r.description ? ` (${r.description})` : ""}`).join(", ")],
@@ -419,6 +421,30 @@ export function createServer(options) {
419
421
  ]),
420
422
  ].join("\n"));
421
423
  });
424
+ tool("list_gaps", {
425
+ title: "List gaps",
426
+ description: "What the Model leaves empty, grouped by Project and Owner Team: an Element's `description`; a Service's or Component's `technology`; for a Service you run (`type: app`, not external) its `repository`, its `deployments` when it has none (any non-external Service), and `api-docs` when a non-Person calls it and no `links` label or Deployment `endpoints` name mentions api, openapi or swagger; a Relationship's `description` and `technology`, and an async one's `channel`; a Deployment `url` of a Service you run. Tags, links, metadata and Owners are never gaps. Use it to find what to fill.",
427
+ input: z.object({
428
+ project: z.string().min(1).optional().describe("Only this Project's gaps"),
429
+ owner: z.string().min(1).optional().describe("Only the gaps of items this Team owns"),
430
+ }),
431
+ output: z.object({
432
+ total: z.number(),
433
+ gaps: z.array(z.object({
434
+ project: z.string(),
435
+ owner: z.string(),
436
+ item: z.object({ kind: z.enum(["element", "relationship", "deployment"]), id: z.string() }),
437
+ missing: z.array(z.enum(gapNames)),
438
+ })),
439
+ }),
440
+ }, ({ project, owner }, { bundle }) => {
441
+ if (project !== undefined && !bundle.projects.some((p) => p.id === project))
442
+ return notFound("Project", project, bundle.projects.map((p) => p.id));
443
+ if (owner !== undefined && !bundle.teams.some((t) => t.id === owner))
444
+ return notFound("Team", owner, bundle.teams.map((t) => t.id));
445
+ const gaps = listGaps(bundle, { ...(project === undefined ? {} : { project }), ...(owner === undefined ? {} : { owner }) });
446
+ return ok({ total: gaps.length, gaps }, gaps.length ? `${count(gaps.length, "item")} with gaps.\n${formatGaps(gaps, bundle)}` : "No gaps.");
447
+ });
422
448
  tool("list_owned", {
423
449
  title: "List owned",
424
450
  description: "The Elements and Deployment Targets a Team owns, grouped by kind, each with counts of the other Teams upstream (depending on it) and downstream (it depends on). An Element is listed under its own Owner, whoever owns its parent.",
@@ -634,27 +660,46 @@ export function createServer(options) {
634
660
  ...issues.map((i) => `- ${i.file}:${i.line} ${i.severity} ${i.rule}: ${i.message}`),
635
661
  ].join("\n"));
636
662
  });
637
- const GuideInput = z.object({
638
- topic: z.string().min(1).optional().describe(`One topic's reference file: ${topics.map((t) => t.id).join(", ")}`),
639
- // Taken like every read tool's, but the guide ships with this Archidocs, so it is the same at every point.
663
+ // Taken like every read tool's, but the guides ship with this Archidocs, so they are the same at every point.
664
+ const topicArg = (of) => z.string().min(1).optional().describe(`One topic's reference file${of}`);
665
+ const GuideOutput = z.object({ topic: z.string().nullable(), topics: z.array(z.object({ id: z.string(), summary: z.string() })), text: z.string() });
666
+ /** A guide as a tool result: the ids of what was served, the skill's topics and the text. */
667
+ const guideResult = (served, extra) => {
668
+ if (!served.ok)
669
+ return toResult(fail("not_found", served.message, served.suggestion ? [served.suggestion] : undefined));
670
+ return toResult(ok({ ...extra(served), topic: served.topic, topics: [...(skills.find((s) => s.id === served.skill)?.topics ?? [])].map((t) => ({ ...t })), text: served.text }, served.text));
671
+ };
672
+ const GetGuideInput = z.object({
673
+ skill: z.string().min(1).describe(`The skill: ${skills.map((s) => s.id).join(", ")}`),
674
+ topic: topicArg(`, for a skill that has topics; authoring's are ${topics.map((t) => t.id).join(", ")}`),
640
675
  at: At.optional(),
641
676
  });
642
- server.registerTool("get_authoring_guide", {
643
- title: "Authoring guide",
644
- description: "How to edit the Model with the write tools. With no topic: the archidocs-authoring skill (the Model, the edit loop) and its list of topics. With a topic: that flow's reference file; `rules` is the catalog of every check rule. Load it before writing.",
645
- inputSchema: advertise(GuideInput),
646
- outputSchema: z.object({ topic: z.string().nullable(), topics: z.array(z.object({ id: z.string(), summary: z.string() })), text: z.string() }),
677
+ server.registerTool("get_guide", {
678
+ title: "Skill guide",
679
+ description: "Load an Archidocs agent skill's full guide, from this version. With no topic: the skill's SKILL.md, and for `authoring` (the Model, the edit loop) its list of topics. With a topic: that flow's reference file; authoring's `rules` is the catalog of every check rule. Load `authoring` before writing.",
680
+ inputSchema: advertise(GetGuideInput),
681
+ outputSchema: GuideOutput.extend({ skill: z.string() }),
647
682
  annotations: { readOnlyHint: true, openWorldHint: false },
648
683
  },
649
- // The guide ships with this version, so it answers whatever the state of the source.
684
+ // The guides ship with this version, so they answer whatever the state of the source.
650
685
  async (raw) => {
686
+ const args = GetGuideInput.safeParse(raw ?? {});
687
+ if (!args.success)
688
+ return toResult(fail("invalid_input", z.prettifyError(args.error)));
689
+ return guideResult(await skillGuide(args.data.skill, args.data.topic), (g) => ({ skill: g.skill }));
690
+ });
691
+ const GuideInput = z.object({ topic: topicArg(`: ${topics.map((t) => t.id).join(", ")}`), at: At.optional() });
692
+ server.registerTool("get_authoring_guide", {
693
+ title: "Authoring guide (deprecated)",
694
+ description: "Deprecated in favour of `get_guide`, which serves every skill: this returns the same as `get_guide(\"authoring\", topic)`. With no topic: the archidocs-authoring skill (the Model, the edit loop) and its list of topics. With a topic: that flow's reference file; `rules` is the catalog of every check rule.",
695
+ inputSchema: advertise(GuideInput),
696
+ outputSchema: GuideOutput,
697
+ annotations: { readOnlyHint: true, openWorldHint: false },
698
+ }, async (raw) => {
651
699
  const args = GuideInput.safeParse(raw ?? {});
652
700
  if (!args.success)
653
701
  return toResult(fail("invalid_input", z.prettifyError(args.error)));
654
- const guide = await authoringGuide(args.data.topic);
655
- if (!guide.ok)
656
- return toResult(fail("not_found", guide.message, guide.suggestion ? [guide.suggestion] : undefined));
657
- return toResult(ok({ topic: guide.topic, topics: topics.map((t) => ({ ...t })), text: guide.text }, guide.text));
702
+ return guideResult(await authoringGuide(args.data.topic), () => ({}));
658
703
  });
659
704
  registerWriteTools(server, source, writesAllowed ? undefined : readOnlyReason, logged);
660
705
  return server;
@@ -51,8 +51,8 @@ export function renderSequenceSvg({ bundle, view, source, brokers = false, theme
51
51
  ].join("\n");
52
52
  }
53
53
  /** Arrowheads: filled for sync calls, open for async and returns. */
54
- export const heads = (fill) => `<marker id="head-filled" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="${fill}"/></marker>` +
55
- `<marker id="head-open" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10" fill="none" stroke="${fill}" stroke-width="1.5"/></marker>`;
54
+ export const heads = (fill) => `<marker id="head-filled" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="${fill}"/></marker>` +
55
+ `<marker id="head-open" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,0 L10,5 L0,10" fill="none" stroke="${fill}" stroke-width="1.5"/></marker>`;
56
56
  const lifeline = (c, x, layout) => `<path d="M${fmt(x)},${HEADER_BOX} L${fmt(x)},${fmt(layout.height - 10)}" fill="none" stroke="${c.faint}" stroke-dasharray="3 4"/>`;
57
57
  function header(c, id, x, w, element, team) {
58
58
  const left = x - w / 2;
@@ -74,7 +74,7 @@ export function renderSvg({ bundle, view, layout, source, theme = "light", label
74
74
  "",
75
75
  ].join("\n");
76
76
  }
77
- const marker = (id, fill) => `<marker id="${id}" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="${fill}"/></marker>`;
77
+ const marker = (id, fill) => `<marker id="${id}" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="${fill}"/></marker>`;
78
78
  /** A broker's vertical stripes, in the rule colour. */
79
79
  const brokerPattern = (c) => `<pattern id="broker" width="12" height="12" patternUnits="userSpaceOnUse"><rect x="8" width="4" height="12" fill="${c.rule}"/></pattern>`;
80
80
  /** A rectangle with its own radius per corner (top-left, top-right, bottom-right, bottom-left), as a path. */
@@ -10,6 +10,7 @@ export declare const BundleElement: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
10
  label: z.ZodString;
11
11
  url: z.ZodString;
12
12
  }, z.core.$strip>>;
13
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
13
14
  id: z.ZodString;
14
15
  kind: z.ZodLiteral<"person">;
15
16
  source: z.ZodObject<{
@@ -26,9 +27,11 @@ export declare const BundleElement: z.ZodDiscriminatedUnion<[z.ZodObject<{
26
27
  label: z.ZodString;
27
28
  url: z.ZodString;
28
29
  }, z.core.$strip>>;
30
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
29
31
  id: z.ZodString;
30
32
  kind: z.ZodLiteral<"system">;
31
33
  external: z.ZodBoolean;
34
+ repository: z.ZodNullable<z.ZodString>;
32
35
  source: z.ZodObject<{
33
36
  file: z.ZodString;
34
37
  line: z.ZodNumber;
@@ -43,6 +46,7 @@ export declare const BundleElement: z.ZodDiscriminatedUnion<[z.ZodObject<{
43
46
  label: z.ZodString;
44
47
  url: z.ZodString;
45
48
  }, z.core.$strip>>;
49
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
46
50
  id: z.ZodString;
47
51
  kind: z.ZodLiteral<"service">;
48
52
  type: z.ZodEnum<{
@@ -52,6 +56,7 @@ export declare const BundleElement: z.ZodDiscriminatedUnion<[z.ZodObject<{
52
56
  }>;
53
57
  technology: z.ZodNullable<z.ZodString>;
54
58
  external: z.ZodBoolean;
59
+ repository: z.ZodNullable<z.ZodString>;
55
60
  source: z.ZodObject<{
56
61
  file: z.ZodString;
57
62
  line: z.ZodNumber;
@@ -66,9 +71,11 @@ export declare const BundleElement: z.ZodDiscriminatedUnion<[z.ZodObject<{
66
71
  label: z.ZodString;
67
72
  url: z.ZodString;
68
73
  }, z.core.$strip>>;
74
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
69
75
  id: z.ZodString;
70
76
  kind: z.ZodLiteral<"component">;
71
77
  technology: z.ZodNullable<z.ZodString>;
78
+ repository: z.ZodNullable<z.ZodString>;
72
79
  source: z.ZodObject<{
73
80
  file: z.ZodString;
74
81
  line: z.ZodNumber;
@@ -470,6 +477,7 @@ export declare const Bundle: z.ZodObject<{
470
477
  label: z.ZodString;
471
478
  url: z.ZodString;
472
479
  }, z.core.$strip>>;
480
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
473
481
  id: z.ZodString;
474
482
  kind: z.ZodLiteral<"person">;
475
483
  source: z.ZodObject<{
@@ -486,9 +494,11 @@ export declare const Bundle: z.ZodObject<{
486
494
  label: z.ZodString;
487
495
  url: z.ZodString;
488
496
  }, z.core.$strip>>;
497
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
489
498
  id: z.ZodString;
490
499
  kind: z.ZodLiteral<"system">;
491
500
  external: z.ZodBoolean;
501
+ repository: z.ZodNullable<z.ZodString>;
492
502
  source: z.ZodObject<{
493
503
  file: z.ZodString;
494
504
  line: z.ZodNumber;
@@ -503,6 +513,7 @@ export declare const Bundle: z.ZodObject<{
503
513
  label: z.ZodString;
504
514
  url: z.ZodString;
505
515
  }, z.core.$strip>>;
516
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
506
517
  id: z.ZodString;
507
518
  kind: z.ZodLiteral<"service">;
508
519
  type: z.ZodEnum<{
@@ -512,6 +523,7 @@ export declare const Bundle: z.ZodObject<{
512
523
  }>;
513
524
  technology: z.ZodNullable<z.ZodString>;
514
525
  external: z.ZodBoolean;
526
+ repository: z.ZodNullable<z.ZodString>;
515
527
  source: z.ZodObject<{
516
528
  file: z.ZodString;
517
529
  line: z.ZodNumber;
@@ -526,9 +538,11 @@ export declare const Bundle: z.ZodObject<{
526
538
  label: z.ZodString;
527
539
  url: z.ZodString;
528
540
  }, z.core.$strip>>;
541
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
529
542
  id: z.ZodString;
530
543
  kind: z.ZodLiteral<"component">;
531
544
  technology: z.ZodNullable<z.ZodString>;
545
+ repository: z.ZodNullable<z.ZodString>;
532
546
  source: z.ZodObject<{
533
547
  file: z.ZodString;
534
548
  line: z.ZodNumber;
@@ -11,6 +11,8 @@ const elementFields = {
11
11
  owner: z.string(),
12
12
  tags: z.array(z.string()),
13
13
  links: z.array(Link),
14
+ /** Free-form facts, values as written in YAML turned to strings, in declared order. */
15
+ metadata: z.record(z.string(), z.string()),
14
16
  };
15
17
  /**
16
18
  * One Element: qualified id, kind, parent (qualified id or null), the
@@ -22,9 +24,9 @@ const element = (kind, fields) => {
22
24
  };
23
25
  export const BundleElement = z.discriminatedUnion("kind", [
24
26
  element("person", {}),
25
- element("system", { external: z.boolean() }),
26
- element("service", { type: z.enum(["app", "datastore", "broker"]), technology: z.string().nullable(), external: z.boolean() }),
27
- element("component", { technology: z.string().nullable() }),
27
+ element("system", { external: z.boolean(), repository: z.string().nullable() }),
28
+ element("service", { type: z.enum(["app", "datastore", "broker"]), technology: z.string().nullable(), external: z.boolean(), repository: z.string().nullable() }),
29
+ element("component", { technology: z.string().nullable(), repository: z.string().nullable() }),
28
30
  ]);
29
31
  /** A Deployment Target: qualified id, parent Target (qualified id or null) and its effective Owner. */
30
32
  export const BundleTarget = z.object({
@@ -58,6 +58,8 @@ export declare const Relationship: z.ZodObject<{
58
58
  channel: z.ZodOptional<z.ZodString>;
59
59
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
60
  }, z.core.$strict>;
61
+ /** An Element's free-form facts: what a team wants to record that the Model has no field for. */
62
+ export declare const Metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
61
63
  export declare const Person: z.ZodObject<{
62
64
  name: z.ZodString;
63
65
  description: z.ZodOptional<z.ZodString>;
@@ -67,6 +69,7 @@ export declare const Person: z.ZodObject<{
67
69
  label: z.ZodString;
68
70
  url: z.ZodURL;
69
71
  }, z.core.$strict>>>;
72
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
70
73
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
74
  to: z.ZodString;
72
75
  id: z.ZodOptional<z.ZodString>;
@@ -83,6 +86,7 @@ export declare const Person: z.ZodObject<{
83
86
  }, z.core.$strict>;
84
87
  export declare const Component: z.ZodObject<{
85
88
  technology: z.ZodOptional<z.ZodString>;
89
+ repository: z.ZodOptional<z.ZodURL>;
86
90
  in: z.ZodOptional<z.ZodString>;
87
91
  name: z.ZodString;
88
92
  description: z.ZodOptional<z.ZodString>;
@@ -92,6 +96,7 @@ export declare const Component: z.ZodObject<{
92
96
  label: z.ZodString;
93
97
  url: z.ZodURL;
94
98
  }, z.core.$strict>>>;
99
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
95
100
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
96
101
  to: z.ZodString;
97
102
  id: z.ZodOptional<z.ZodString>;
@@ -113,10 +118,12 @@ export declare const Service: z.ZodObject<{
113
118
  broker: "broker";
114
119
  }>>;
115
120
  technology: z.ZodOptional<z.ZodString>;
121
+ repository: z.ZodOptional<z.ZodURL>;
116
122
  external: z.ZodOptional<z.ZodBoolean>;
117
123
  in: z.ZodOptional<z.ZodString>;
118
124
  components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
119
125
  technology: z.ZodOptional<z.ZodString>;
126
+ repository: z.ZodOptional<z.ZodURL>;
120
127
  in: z.ZodOptional<z.ZodString>;
121
128
  name: z.ZodString;
122
129
  description: z.ZodOptional<z.ZodString>;
@@ -126,6 +133,7 @@ export declare const Service: z.ZodObject<{
126
133
  label: z.ZodString;
127
134
  url: z.ZodURL;
128
135
  }, z.core.$strict>>>;
136
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
129
137
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
130
138
  to: z.ZodString;
131
139
  id: z.ZodOptional<z.ZodString>;
@@ -148,6 +156,7 @@ export declare const Service: z.ZodObject<{
148
156
  label: z.ZodString;
149
157
  url: z.ZodURL;
150
158
  }, z.core.$strict>>>;
159
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
151
160
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
161
  to: z.ZodString;
153
162
  id: z.ZodOptional<z.ZodString>;
@@ -164,6 +173,7 @@ export declare const Service: z.ZodObject<{
164
173
  }, z.core.$strict>;
165
174
  export declare const System: z.ZodObject<{
166
175
  external: z.ZodOptional<z.ZodBoolean>;
176
+ repository: z.ZodOptional<z.ZodURL>;
167
177
  services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
168
178
  type: z.ZodOptional<z.ZodEnum<{
169
179
  app: "app";
@@ -171,10 +181,12 @@ export declare const System: z.ZodObject<{
171
181
  broker: "broker";
172
182
  }>>;
173
183
  technology: z.ZodOptional<z.ZodString>;
184
+ repository: z.ZodOptional<z.ZodURL>;
174
185
  external: z.ZodOptional<z.ZodBoolean>;
175
186
  in: z.ZodOptional<z.ZodString>;
176
187
  components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
177
188
  technology: z.ZodOptional<z.ZodString>;
189
+ repository: z.ZodOptional<z.ZodURL>;
178
190
  in: z.ZodOptional<z.ZodString>;
179
191
  name: z.ZodString;
180
192
  description: z.ZodOptional<z.ZodString>;
@@ -184,6 +196,7 @@ export declare const System: z.ZodObject<{
184
196
  label: z.ZodString;
185
197
  url: z.ZodURL;
186
198
  }, z.core.$strict>>>;
199
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
187
200
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
188
201
  to: z.ZodString;
189
202
  id: z.ZodOptional<z.ZodString>;
@@ -206,6 +219,7 @@ export declare const System: z.ZodObject<{
206
219
  label: z.ZodString;
207
220
  url: z.ZodURL;
208
221
  }, z.core.$strict>>>;
222
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
209
223
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
210
224
  to: z.ZodString;
211
225
  id: z.ZodOptional<z.ZodString>;
@@ -228,6 +242,7 @@ export declare const System: z.ZodObject<{
228
242
  label: z.ZodString;
229
243
  url: z.ZodURL;
230
244
  }, z.core.$strict>>>;
245
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
231
246
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
232
247
  to: z.ZodString;
233
248
  id: z.ZodOptional<z.ZodString>;
@@ -591,6 +606,7 @@ export declare const ModelFile: z.ZodObject<{
591
606
  label: z.ZodString;
592
607
  url: z.ZodURL;
593
608
  }, z.core.$strict>>>;
609
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
594
610
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
595
611
  to: z.ZodString;
596
612
  id: z.ZodOptional<z.ZodString>;
@@ -607,6 +623,7 @@ export declare const ModelFile: z.ZodObject<{
607
623
  }, z.core.$strict>>>;
608
624
  systems: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
609
625
  external: z.ZodOptional<z.ZodBoolean>;
626
+ repository: z.ZodOptional<z.ZodURL>;
610
627
  services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
611
628
  type: z.ZodOptional<z.ZodEnum<{
612
629
  app: "app";
@@ -614,10 +631,12 @@ export declare const ModelFile: z.ZodObject<{
614
631
  broker: "broker";
615
632
  }>>;
616
633
  technology: z.ZodOptional<z.ZodString>;
634
+ repository: z.ZodOptional<z.ZodURL>;
617
635
  external: z.ZodOptional<z.ZodBoolean>;
618
636
  in: z.ZodOptional<z.ZodString>;
619
637
  components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
620
638
  technology: z.ZodOptional<z.ZodString>;
639
+ repository: z.ZodOptional<z.ZodURL>;
621
640
  in: z.ZodOptional<z.ZodString>;
622
641
  name: z.ZodString;
623
642
  description: z.ZodOptional<z.ZodString>;
@@ -627,6 +646,7 @@ export declare const ModelFile: z.ZodObject<{
627
646
  label: z.ZodString;
628
647
  url: z.ZodURL;
629
648
  }, z.core.$strict>>>;
649
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
630
650
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
631
651
  to: z.ZodString;
632
652
  id: z.ZodOptional<z.ZodString>;
@@ -649,6 +669,7 @@ export declare const ModelFile: z.ZodObject<{
649
669
  label: z.ZodString;
650
670
  url: z.ZodURL;
651
671
  }, z.core.$strict>>>;
672
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
652
673
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
653
674
  to: z.ZodString;
654
675
  id: z.ZodOptional<z.ZodString>;
@@ -671,6 +692,7 @@ export declare const ModelFile: z.ZodObject<{
671
692
  label: z.ZodString;
672
693
  url: z.ZodURL;
673
694
  }, z.core.$strict>>>;
695
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
674
696
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
675
697
  to: z.ZodString;
676
698
  id: z.ZodOptional<z.ZodString>;
@@ -692,10 +714,12 @@ export declare const ModelFile: z.ZodObject<{
692
714
  broker: "broker";
693
715
  }>>;
694
716
  technology: z.ZodOptional<z.ZodString>;
717
+ repository: z.ZodOptional<z.ZodURL>;
695
718
  external: z.ZodOptional<z.ZodBoolean>;
696
719
  in: z.ZodOptional<z.ZodString>;
697
720
  components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
698
721
  technology: z.ZodOptional<z.ZodString>;
722
+ repository: z.ZodOptional<z.ZodURL>;
699
723
  in: z.ZodOptional<z.ZodString>;
700
724
  name: z.ZodString;
701
725
  description: z.ZodOptional<z.ZodString>;
@@ -705,6 +729,7 @@ export declare const ModelFile: z.ZodObject<{
705
729
  label: z.ZodString;
706
730
  url: z.ZodURL;
707
731
  }, z.core.$strict>>>;
732
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
708
733
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
709
734
  to: z.ZodString;
710
735
  id: z.ZodOptional<z.ZodString>;
@@ -727,6 +752,7 @@ export declare const ModelFile: z.ZodObject<{
727
752
  label: z.ZodString;
728
753
  url: z.ZodURL;
729
754
  }, z.core.$strict>>>;
755
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
730
756
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
731
757
  to: z.ZodString;
732
758
  id: z.ZodOptional<z.ZodString>;
@@ -743,6 +769,7 @@ export declare const ModelFile: z.ZodObject<{
743
769
  }, z.core.$strict>>>;
744
770
  components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
745
771
  technology: z.ZodOptional<z.ZodString>;
772
+ repository: z.ZodOptional<z.ZodURL>;
746
773
  in: z.ZodOptional<z.ZodString>;
747
774
  name: z.ZodString;
748
775
  description: z.ZodOptional<z.ZodString>;
@@ -752,6 +779,7 @@ export declare const ModelFile: z.ZodObject<{
752
779
  label: z.ZodString;
753
780
  url: z.ZodURL;
754
781
  }, z.core.$strict>>>;
782
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
755
783
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
756
784
  to: z.ZodString;
757
785
  id: z.ZodOptional<z.ZodString>;
@@ -973,6 +1001,7 @@ export declare const shallow: {
973
1001
  label: z.ZodString;
974
1002
  url: z.ZodURL;
975
1003
  }, z.core.$strict>>>;
1004
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
976
1005
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
977
1006
  to: z.ZodString;
978
1007
  id: z.ZodOptional<z.ZodString>;
@@ -989,6 +1018,7 @@ export declare const shallow: {
989
1018
  }, z.core.$strict>;
990
1019
  readonly system: z.ZodObject<{
991
1020
  external: z.ZodOptional<z.ZodBoolean>;
1021
+ repository: z.ZodOptional<z.ZodURL>;
992
1022
  name: z.ZodString;
993
1023
  description: z.ZodOptional<z.ZodString>;
994
1024
  owner: z.ZodOptional<z.ZodString>;
@@ -997,6 +1027,7 @@ export declare const shallow: {
997
1027
  label: z.ZodString;
998
1028
  url: z.ZodURL;
999
1029
  }, z.core.$strict>>>;
1030
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1000
1031
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
1001
1032
  to: z.ZodString;
1002
1033
  id: z.ZodOptional<z.ZodString>;
@@ -1019,6 +1050,7 @@ export declare const shallow: {
1019
1050
  broker: "broker";
1020
1051
  }>>;
1021
1052
  technology: z.ZodOptional<z.ZodString>;
1053
+ repository: z.ZodOptional<z.ZodURL>;
1022
1054
  external: z.ZodOptional<z.ZodBoolean>;
1023
1055
  in: z.ZodOptional<z.ZodString>;
1024
1056
  name: z.ZodString;
@@ -1029,6 +1061,7 @@ export declare const shallow: {
1029
1061
  label: z.ZodString;
1030
1062
  url: z.ZodURL;
1031
1063
  }, z.core.$strict>>>;
1064
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1032
1065
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
1033
1066
  to: z.ZodString;
1034
1067
  id: z.ZodOptional<z.ZodString>;
@@ -1046,6 +1079,7 @@ export declare const shallow: {
1046
1079
  }, z.core.$strict>;
1047
1080
  readonly component: z.ZodObject<{
1048
1081
  technology: z.ZodOptional<z.ZodString>;
1082
+ repository: z.ZodOptional<z.ZodURL>;
1049
1083
  in: z.ZodOptional<z.ZodString>;
1050
1084
  name: z.ZodString;
1051
1085
  description: z.ZodOptional<z.ZodString>;
@@ -1055,6 +1089,7 @@ export declare const shallow: {
1055
1089
  label: z.ZodString;
1056
1090
  url: z.ZodURL;
1057
1091
  }, z.core.$strict>>>;
1092
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1058
1093
  relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
1059
1094
  to: z.ZodString;
1060
1095
  id: z.ZodOptional<z.ZodString>;