@maycombhq/sdk 2.0.0-beta.2 → 2.0.0-beta.21

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 (54) hide show
  1. package/npm/core/ai-decisions.d.ts +360 -0
  2. package/npm/core/api.d.ts +5806 -1212
  3. package/npm/core/audit.d.ts +165 -0
  4. package/npm/core/catalog.d.ts +220 -66
  5. package/npm/core/contract-check.d.ts +261 -0
  6. package/npm/core/decision-batches.d.ts +29 -0
  7. package/npm/core/declared-links.d.ts +62 -0
  8. package/npm/core/eol.d.ts +5 -0
  9. package/npm/core/fact-paths.d.ts +14 -0
  10. package/npm/core/facts-callers.d.ts +2 -0
  11. package/npm/core/facts-join-prototype.d.ts +66 -4
  12. package/npm/core/facts-join-vendor.d.ts +20 -2
  13. package/npm/core/facts-join.d.ts +320 -1
  14. package/npm/core/facts-terms.d.ts +108 -0
  15. package/npm/core/fs.d.ts +23 -4
  16. package/npm/core/host-questions.d.ts +93 -1
  17. package/npm/core/index.d.ts +22 -0
  18. package/npm/core/link-candidates.d.ts +103 -0
  19. package/npm/core/link-evidence.d.ts +212 -0
  20. package/npm/core/manifest-edit.d.ts +53 -4
  21. package/npm/core/merge.d.ts +28 -0
  22. package/npm/core/metarepo.d.ts +18 -1
  23. package/npm/core/migrate.d.ts +3 -2
  24. package/npm/core/org-notes.d.ts +180 -0
  25. package/npm/core/orgpack-defaults.d.ts +22 -6
  26. package/npm/core/orgpack-load.d.ts +19 -0
  27. package/npm/core/profile-migrate.d.ts +11 -0
  28. package/npm/core/question-order.d.ts +23 -0
  29. package/npm/core/question-owners.d.ts +53 -0
  30. package/npm/core/question-proposals.d.ts +77 -0
  31. package/npm/core/question-roles.d.ts +24 -0
  32. package/npm/core/questions.d.ts +85 -6
  33. package/npm/core/repo-reads.d.ts +44 -0
  34. package/npm/core/roles-migrate.d.ts +9 -0
  35. package/npm/core/runtime-migrate.d.ts +18 -0
  36. package/npm/core/schema/ai.d.ts +57 -9
  37. package/npm/core/schema/common.d.ts +32 -8
  38. package/npm/core/schema/component-type.d.ts +193 -0
  39. package/npm/core/schema/conventions.d.ts +80 -0
  40. package/npm/core/schema/fact-corrections.d.ts +96 -2
  41. package/npm/core/schema/facts.d.ts +410 -1
  42. package/npm/core/schema/kinds.d.ts +230 -66
  43. package/npm/core/schema/orgpack.d.ts +110 -7
  44. package/npm/core/schema/question.d.ts +228 -5
  45. package/npm/core/schema/reading-rules.d.ts +51 -0
  46. package/npm/core/schema/repo-type.d.ts +20 -2
  47. package/npm/core/schema/review.d.ts +7 -7
  48. package/npm/core/schema/scan-verify.d.ts +87 -45
  49. package/npm/core/schema/version.d.ts +4 -1
  50. package/npm/core/schema/workspace.d.ts +29 -11
  51. package/npm/core/shared-maps.d.ts +146 -0
  52. package/npm/core/stack-helpers.d.ts +32 -0
  53. package/npm/index.js +5614 -2343
  54. package/package.json +1 -1
@@ -0,0 +1,44 @@
1
+ import type { Fact, FactOf } from "./schema/facts.js";
2
+ import type { Question } from "./schema/question.js";
3
+ /**
4
+ * The commit a checkout is at, read from its `.git` files: HEAD, a loose ref or packed-refs,
5
+ * following a worktree's `gitdir:` and `commondir`. Undefined when there is no checkout.
6
+ */
7
+ export declare function headFromFiles(dir: string): Promise<string | undefined>;
8
+ /** Where a repo is checked out: the metarepo's workspace/<repo>, or the repo itself when adopted. */
9
+ export declare const checkoutDirOf: (root: string, repo: string) => string;
10
+ /**
11
+ * not-read: no facts and no verifier's report (a repo the readers alone mapped, or none);
12
+ * stale: the facts were read at another commit than the checkout is at; incomplete: facts were
13
+ * rejected, some aren't verified, there is no verifier's report, or files went unread; read: none
14
+ * of these.
15
+ */
16
+ export type RepoReadState = "not-read" | "stale" | "incomplete" | "read";
17
+ export interface RepoRead {
18
+ repo: string;
19
+ state: RepoReadState;
20
+ /** Why it is stale or incomplete, in words a person reads; empty when it is read. */
21
+ why: string[];
22
+ /** The command that reads it again or checks it. */
23
+ next?: string;
24
+ /** The commit its facts were read at, and the checkout's. */
25
+ commit?: string;
26
+ head?: string;
27
+ /** Its facts, for the questions that cite their lines. */
28
+ facts: Fact[];
29
+ }
30
+ /** The read of one repo (see `RepoRead`). Never throws: an unreadable file is a reason. */
31
+ export declare function repoReadOf(root: string, repo: string): Promise<RepoRead>;
32
+ /**
33
+ * The steps whose questions are about a link (ADR 0140): which repo or system answers a call
34
+ * (`facts-targets`, scanner's TARGETS_STEP; `estate-targets`, the estate join's) and which repo
35
+ * answers on a host (`scan-hosts`). Their answers join calls.
36
+ */
37
+ export declare const LINK_QUESTION_STEPS: ReadonlySet<string>;
38
+ export declare const isLinkQuestion: (q: Pick<Question, "askedBy">) => boolean;
39
+ /**
40
+ * The calls a link question asks about: a targets question's are the call facts of its repo on
41
+ * the lines it cites (one per call, a group's every call, Q1); a hosts question's are every call
42
+ * to its host, in any repo (its evidence cites only the first few). `facts` are the facts by repo.
43
+ */
44
+ export declare function callsOfQuestion(q: Pick<Question, "askedBy" | "repo" | "evidence" | "question">, facts: ReadonlyMap<string, readonly Fact[]>): FactOf<"call">[];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * roles.yaml version 1 → 2 (ADR 0140). Version 2 adds `teams`; a file without them names no
3
+ * team, as version 1 did, so the step writes the new number only and keeps the file's comments,
4
+ * order and line layout (`atticus upgrade`'s roles-v2).
5
+ */
6
+ export declare function migrateRolesText(text: string): {
7
+ text: string;
8
+ changed: boolean;
9
+ };
@@ -9,3 +9,21 @@ export declare function migrateRuntimeText(text: string): {
9
9
  text: string;
10
10
  changed: boolean;
11
11
  };
12
+ /**
13
+ * runtime.yaml to version 3 (ADR 0171), for a file that names copilot-acp (a mode, or the
14
+ * copilotAcp section): the number only, every other line as the person wrote it. A file that
15
+ * doesn't name it means the same at version 1 or 2, so it is left as it is.
16
+ */
17
+ export declare function migrateRuntimeV3Text(text: string): {
18
+ text: string;
19
+ changed: boolean;
20
+ };
21
+ /**
22
+ * runtime.yaml to version 4 (ADR 0181), for a file that sets `decide` (whether the AI decides
23
+ * pairings and option questions itself): the number only, every other line as the person wrote
24
+ * it. A file without it means the same at version 1 to 3, so it is left as it is.
25
+ */
26
+ export declare function migrateRuntimeV4Text(text: string): {
27
+ text: string;
28
+ changed: boolean;
29
+ };
@@ -4,10 +4,12 @@ import { z } from "zod";
4
4
  * context-pack manifests and run summaries are written per run. See ADR 0014.
5
5
  */
6
6
  export declare const AI_SCHEMA_VERSION: 1;
7
+ /** ADR 0171 adds copilot-acp: GitHub Copilot driven unattended through its Agent Client Protocol. */
7
8
  export declare const RuntimeKind: z.ZodEnum<{
8
9
  model: "model";
9
10
  "hand-off": "hand-off";
10
11
  "headless-claude-code": "headless-claude-code";
12
+ "copilot-acp": "copilot-acp";
11
13
  mock: "mock";
12
14
  replay: "replay";
13
15
  }>;
@@ -93,6 +95,7 @@ export declare const AgentDefinition: z.ZodObject<{
93
95
  model: "model";
94
96
  "hand-off": "hand-off";
95
97
  "headless-claude-code": "headless-claude-code";
98
+ "copilot-acp": "copilot-acp";
96
99
  mock: "mock";
97
100
  replay: "replay";
98
101
  }>>;
@@ -164,10 +167,33 @@ export type RunState = z.infer<typeof RunState>;
164
167
  /**
165
168
  * The run record's own version: 2 adds the tools a run's model called (ADR 0107 addendum); 3 how
166
169
  * its context was retrieved (ADR 0116): the model's expansion of the input and its order of the
167
- * candidates; 4 the step's class and the model that ran it (ADR 0121 addendum, per-step models).
168
- * A version 1, 2 or 3 record is read through `migrateRunSummary`, without what came later.
170
+ * candidates; 4 the step's class and the model that ran it (ADR 0121 addendum, per-step models);
171
+ * 5 the assistant program that ran it and its version (ADR 0171: the Copilot language server a
172
+ * copilot-acp run talked to); 6 the batch a hand-off was asked in and a batch's parts (ADR 0185:
173
+ * a stage's critic lenses in one prompt). A version 1 to 5 record is read through
174
+ * `migrateRunSummary`, without what came later.
169
175
  */
170
- export declare const RUN_SCHEMA_VERSION: 4;
176
+ export declare const RUN_SCHEMA_VERSION: 6;
177
+ /**
178
+ * One part of a batched hand-off (version 6, ADR 0185): its name (the section that answers it,
179
+ * `=== <name>`, a critic lens's name) and its own run, which keeps its own prompt, pack and answer.
180
+ */
181
+ export declare const RunPart: z.ZodObject<{
182
+ name: z.ZodString;
183
+ runId: z.ZodString;
184
+ }, z.core.$strict>;
185
+ export type RunPart = z.infer<typeof RunPart>;
186
+ /**
187
+ * The assistant program a run talked to (version 5, ADR 0171), as it named itself: the agent's
188
+ * name and version from the Agent Client Protocol's initialize answer, the protocol version both
189
+ * sides agreed, and the version `<command> --version` printed. Data, never instructions.
190
+ */
191
+ export declare const RunAssistant: z.ZodObject<{
192
+ name: z.ZodString;
193
+ version: z.ZodOptional<z.ZodString>;
194
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
195
+ }, z.core.$strict>;
196
+ export type RunAssistant = z.infer<typeof RunAssistant>;
171
197
  /**
172
198
  * How a run's context was retrieved (ADR 0116), when a model helped: what it read the input as
173
199
  * (search terms, the names it found, each mapped to an id the index has or said new, with the
@@ -237,7 +263,7 @@ export declare const RunTools: z.ZodObject<{
237
263
  export type RunTools = z.infer<typeof RunTools>;
238
264
  /** What goes into review/ for every run; full packs and transcripts stay in git-ignored .runs/. */
239
265
  export declare const RunSummary: z.ZodObject<{
240
- schemaVersion: z.ZodLiteral<4>;
266
+ schemaVersion: z.ZodLiteral<6>;
241
267
  runId: z.ZodString;
242
268
  change: z.ZodString;
243
269
  agent: z.ZodString;
@@ -245,6 +271,7 @@ export declare const RunSummary: z.ZodObject<{
245
271
  model: "model";
246
272
  "hand-off": "hand-off";
247
273
  "headless-claude-code": "headless-claude-code";
274
+ "copilot-acp": "copilot-acp";
248
275
  mock: "mock";
249
276
  replay: "replay";
250
277
  }>;
@@ -313,21 +340,32 @@ export declare const RunSummary: z.ZodObject<{
313
340
  quick: "quick";
314
341
  }>>;
315
342
  model: z.ZodOptional<z.ZodString>;
343
+ assistant: z.ZodOptional<z.ZodObject<{
344
+ name: z.ZodString;
345
+ version: z.ZodOptional<z.ZodString>;
346
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
347
+ }, z.core.$strict>>;
348
+ batch: z.ZodOptional<z.ZodString>;
349
+ parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
350
+ name: z.ZodString;
351
+ runId: z.ZodString;
352
+ }, z.core.$strict>>>;
316
353
  }, z.core.$strict>;
317
354
  export type RunSummary = z.infer<typeof RunSummary>;
318
355
  /**
319
- * A stored run record at the current version: version 1 (before tools), 2 (before retrieval) and
320
- * 3 (before the step's class and model) read as version 4 without them; anything else is
321
- * returned as it is, for the schema to judge.
356
+ * A stored run record at the current version: version 1 (before tools), 2 (before retrieval), 3
357
+ * (before the step's class and model), 4 (before the assistant program, ADR 0171) and 5 (before
358
+ * batches, ADR 0185) read as version 6 without them; anything else is returned as it is, for the
359
+ * schema to judge.
322
360
  */
323
361
  export declare function migrateRunSummary(raw: unknown): unknown;
324
362
  /** Read a stored run record of any version (ADR 0107 addendum). */
325
363
  export declare const readRunSummary: (raw: unknown) => z.ZodSafeParseResult<{
326
- schemaVersion: 4;
364
+ schemaVersion: 6;
327
365
  runId: string;
328
366
  change: string;
329
367
  agent: string;
330
- runtime: "model" | "hand-off" | "headless-claude-code" | "mock" | "replay";
368
+ runtime: "model" | "hand-off" | "headless-claude-code" | "copilot-acp" | "mock" | "replay";
331
369
  state: "failed" | "prepared" | "waiting" | "produced" | "validated" | "cancelled";
332
370
  startedAt: string;
333
371
  contextManifestSha256: string;
@@ -380,6 +418,16 @@ export declare const readRunSummary: (raw: unknown) => z.ZodSafeParseResult<{
380
418
  } | undefined;
381
419
  stepClass?: "read" | "draft" | "critic" | "knowledge" | "quick" | undefined;
382
420
  model?: string | undefined;
421
+ assistant?: {
422
+ name: string;
423
+ version?: string | undefined;
424
+ protocolVersion?: number | undefined;
425
+ } | undefined;
426
+ batch?: string | undefined;
427
+ parts?: {
428
+ name: string;
429
+ runId: string;
430
+ }[] | undefined;
383
431
  }>;
384
432
  /** A recorded model output for the replay runtime, keyed by agent and prompt hash. */
385
433
  export declare const Recording: z.ZodObject<{
@@ -3,15 +3,16 @@ import { SCHEMA_VERSION } from "./version.js";
3
3
  /** Current catalog schema version (defined in ./version.js, which loads no schema). */
4
4
  export { SCHEMA_VERSION };
5
5
  /** Every catalog schema version a reader accepts, oldest first. */
6
- export declare const SUPPORTED_SCHEMA_VERSIONS: readonly [1, 2, 3];
6
+ export declare const SUPPORTED_SCHEMA_VERSIONS: readonly [1, 2, 3, 4, 5];
7
7
  /**
8
- * A record's schema version. Version-1 and version-2 files differ from version 3 only in this
9
- * number (nothing they hold changed meaning), so they are read as they are and come back as
10
- * version 3 in memory; writers always write the current version, and `migrateCatalog` rewrites
11
- * old files. The type stays `1 | 2 | 3` so code that builds older records in memory keeps
12
- * compiling until it is updated.
8
+ * A record's schema version. Version-1 to -4 files differ from version 5 only in this number
9
+ * (nothing they hold changed meaning: version 4, ADR 0164, only added `protobuf` to a Schema's
10
+ * formats; version 5, ADR 0181, only added the evidence source `ai` and its `run`), so they are
11
+ * read as they are and come back as version 5 in memory; writers always write the current
12
+ * version, and `migrateCatalog` rewrites old files. The type stays `1 | 2 | 3 | 4 | 5` so code
13
+ * that builds older records in memory keeps compiling until it is updated.
13
14
  */
14
- export declare const SchemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
15
+ export declare const SchemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
15
16
  /**
16
17
  * Stable record id. Lowercase slug, safe as a file name on Linux, macOS and Windows
17
18
  * (no ":" or "/"), so every record can live in its own file named by its id.
@@ -49,6 +50,25 @@ export declare const EvidenceSource: z.ZodEnum<{
49
50
  document: "document";
50
51
  export: "export";
51
52
  manual: "manual";
53
+ ai: "ai";
54
+ }>;
55
+ /**
56
+ * The evidence sources a dialect (C2) or a finding (C3) may name: every source but `ai` (ADR 0181),
57
+ * which only Atticus writes, for a link the AI decided. C2 and C3 are unchanged by it.
58
+ */
59
+ export declare const RuleEvidenceSource: z.ZodEnum<{
60
+ code: "code";
61
+ config: "config";
62
+ spec: "spec";
63
+ gateway: "gateway";
64
+ "event-config": "event-config";
65
+ infrastructure: "infrastructure";
66
+ pipeline: "pipeline";
67
+ migration: "migration";
68
+ diagram: "diagram";
69
+ document: "document";
70
+ export: "export";
71
+ manual: "manual";
52
72
  }>;
53
73
  export declare const Evidence: z.ZodObject<{
54
74
  source: z.ZodEnum<{
@@ -64,6 +84,7 @@ export declare const Evidence: z.ZodObject<{
64
84
  document: "document";
65
85
  export: "export";
66
86
  manual: "manual";
87
+ ai: "ai";
67
88
  }>;
68
89
  repo: z.ZodOptional<z.ZodString>;
69
90
  path: z.ZodOptional<z.ZodString>;
@@ -80,12 +101,13 @@ export declare const Evidence: z.ZodObject<{
80
101
  definition: "definition";
81
102
  }>>;
82
103
  by: z.ZodOptional<z.ZodString>;
104
+ run: z.ZodOptional<z.ZodString>;
83
105
  }, z.core.$strict>;
84
106
  export declare const IsoDate: z.ZodISODate;
85
107
  export declare const IsoDateTime: z.ZodISODateTime;
86
108
  /** Fields every record carries. `kind` is added per record type. */
87
109
  export declare const commonFields: {
88
- schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
110
+ schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
89
111
  id: z.ZodString;
90
112
  status: z.ZodEnum<{
91
113
  current: "current";
@@ -113,6 +135,7 @@ export declare const commonFields: {
113
135
  document: "document";
114
136
  export: "export";
115
137
  manual: "manual";
138
+ ai: "ai";
116
139
  }>;
117
140
  repo: z.ZodOptional<z.ZodString>;
118
141
  path: z.ZodOptional<z.ZodString>;
@@ -129,6 +152,7 @@ export declare const commonFields: {
129
152
  definition: "definition";
130
153
  }>>;
131
154
  by: z.ZodOptional<z.ZodString>;
155
+ run: z.ZodOptional<z.ZodString>;
132
156
  }, z.core.$strict>>;
133
157
  flags: z.ZodOptional<z.ZodArray<z.ZodString>>;
134
158
  };
@@ -0,0 +1,193 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * A component type (ADR 0180, C6): org-pack/component-types/<id>/type.yaml, with an optional
4
+ * notes.md beside it. What a kind of component in the organisation is (a BFF, a gateway proxy,
5
+ * a mainframe program, a kind of its own), how the assistant recognises one when it reads a
6
+ * repo (signals it cites), where one usually runs, how the canvas draws it, and what one must
7
+ * and must not do. Atticus's own types (`Component.type`'s documented values, ADR 0040) are the
8
+ * default set in the same shape; an organisation adds types, rewords a built-in under its own
9
+ * id, or switches one off. A type's notes are data in prompts, never instructions.
10
+ */
11
+ export declare const COMPONENT_TYPE_SCHEMA_VERSION: 1;
12
+ /** How a read recognises a component of the type: something on a line the assistant can cite. */
13
+ export declare const TypeSignal: z.ZodObject<{
14
+ kind: z.ZodEnum<{
15
+ file: "file";
16
+ path: "path";
17
+ dependency: "dependency";
18
+ framework: "framework";
19
+ annotation: "annotation";
20
+ "repo-type": "repo-type";
21
+ words: "words";
22
+ }>;
23
+ value: z.ZodString;
24
+ why: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strict>;
26
+ export type TypeSignal = z.infer<typeof TypeSignal>;
27
+ export declare const TYPE_SHAPES: readonly ["box", "rounded", "hexagon", "cylinder", "diamond", "parallelogram", "circle"];
28
+ /** The file's fields as written (ComponentType checks them and fills in a switched-off type's words). */
29
+ export declare const ComponentTypeShape: z.ZodObject<{
30
+ schemaVersion: z.ZodLiteral<1>;
31
+ id: z.ZodString;
32
+ name: z.ZodOptional<z.ZodString>;
33
+ description: z.ZodOptional<z.ZodString>;
34
+ owner: z.ZodOptional<z.ZodString>;
35
+ signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
36
+ kind: z.ZodEnum<{
37
+ file: "file";
38
+ path: "path";
39
+ dependency: "dependency";
40
+ framework: "framework";
41
+ annotation: "annotation";
42
+ "repo-type": "repo-type";
43
+ words: "words";
44
+ }>;
45
+ value: z.ZodString;
46
+ why: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strict>>>;
48
+ runsOn: z.ZodOptional<z.ZodObject<{
49
+ platform: z.ZodOptional<z.ZodString>;
50
+ cloud: z.ZodOptional<z.ZodString>;
51
+ framework: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strict>>;
53
+ draws: z.ZodOptional<z.ZodObject<{
54
+ shape: z.ZodOptional<z.ZodEnum<{
55
+ box: "box";
56
+ rounded: "rounded";
57
+ hexagon: "hexagon";
58
+ cylinder: "cylinder";
59
+ diamond: "diamond";
60
+ parallelogram: "parallelogram";
61
+ circle: "circle";
62
+ }>>;
63
+ colour: z.ZodOptional<z.ZodString>;
64
+ badge: z.ZodOptional<z.ZodString>;
65
+ }, z.core.$strict>>;
66
+ must: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
+ mustNot: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ off: z.ZodOptional<z.ZodBoolean>;
69
+ notes: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strict>;
71
+ /**
72
+ * A kind of component, in the organisation's words: org-pack/component-types/<id>/type.yaml.
73
+ * `name` and `description` are required unless the file switches a built-in off.
74
+ */
75
+ export declare const ComponentType: z.ZodPipe<z.ZodObject<{
76
+ schemaVersion: z.ZodLiteral<1>;
77
+ id: z.ZodString;
78
+ name: z.ZodOptional<z.ZodString>;
79
+ description: z.ZodOptional<z.ZodString>;
80
+ owner: z.ZodOptional<z.ZodString>;
81
+ signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
82
+ kind: z.ZodEnum<{
83
+ file: "file";
84
+ path: "path";
85
+ dependency: "dependency";
86
+ framework: "framework";
87
+ annotation: "annotation";
88
+ "repo-type": "repo-type";
89
+ words: "words";
90
+ }>;
91
+ value: z.ZodString;
92
+ why: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$strict>>>;
94
+ runsOn: z.ZodOptional<z.ZodObject<{
95
+ platform: z.ZodOptional<z.ZodString>;
96
+ cloud: z.ZodOptional<z.ZodString>;
97
+ framework: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strict>>;
99
+ draws: z.ZodOptional<z.ZodObject<{
100
+ shape: z.ZodOptional<z.ZodEnum<{
101
+ box: "box";
102
+ rounded: "rounded";
103
+ hexagon: "hexagon";
104
+ cylinder: "cylinder";
105
+ diamond: "diamond";
106
+ parallelogram: "parallelogram";
107
+ circle: "circle";
108
+ }>>;
109
+ colour: z.ZodOptional<z.ZodString>;
110
+ badge: z.ZodOptional<z.ZodString>;
111
+ }, z.core.$strict>>;
112
+ must: z.ZodOptional<z.ZodArray<z.ZodString>>;
113
+ mustNot: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ off: z.ZodOptional<z.ZodBoolean>;
115
+ notes: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strict>, z.ZodTransform<{
117
+ name: string;
118
+ description: string;
119
+ schemaVersion: 1;
120
+ id: string;
121
+ signals: {
122
+ kind: "file" | "path" | "dependency" | "framework" | "annotation" | "repo-type" | "words";
123
+ value: string;
124
+ why?: string | undefined;
125
+ }[];
126
+ owner?: string | undefined;
127
+ runsOn?: {
128
+ platform?: string | undefined;
129
+ cloud?: string | undefined;
130
+ framework?: string | undefined;
131
+ } | undefined;
132
+ draws?: {
133
+ shape?: "box" | "rounded" | "hexagon" | "cylinder" | "diamond" | "parallelogram" | "circle" | undefined;
134
+ colour?: string | undefined;
135
+ badge?: string | undefined;
136
+ } | undefined;
137
+ must?: string[] | undefined;
138
+ mustNot?: string[] | undefined;
139
+ off?: boolean | undefined;
140
+ notes?: string | undefined;
141
+ }, {
142
+ schemaVersion: 1;
143
+ id: string;
144
+ signals: {
145
+ kind: "file" | "path" | "dependency" | "framework" | "annotation" | "repo-type" | "words";
146
+ value: string;
147
+ why?: string | undefined;
148
+ }[];
149
+ name?: string | undefined;
150
+ description?: string | undefined;
151
+ owner?: string | undefined;
152
+ runsOn?: {
153
+ platform?: string | undefined;
154
+ cloud?: string | undefined;
155
+ framework?: string | undefined;
156
+ } | undefined;
157
+ draws?: {
158
+ shape?: "box" | "rounded" | "hexagon" | "cylinder" | "diamond" | "parallelogram" | "circle" | undefined;
159
+ colour?: string | undefined;
160
+ badge?: string | undefined;
161
+ } | undefined;
162
+ must?: string[] | undefined;
163
+ mustNot?: string[] | undefined;
164
+ off?: boolean | undefined;
165
+ notes?: string | undefined;
166
+ }>>;
167
+ export type ComponentType = z.infer<typeof ComponentType>;
168
+ /** A type as loaded: the file's words, and the notes.md body when there is one. */
169
+ export interface LoadedComponentType extends ComponentType {
170
+ /** The notes file's text, as written (Markdown). */
171
+ notesText?: string;
172
+ /** `builtin`, or the org pack. */
173
+ source: "builtin" | "org-pack";
174
+ }
175
+ /** Atticus's own component types (ADR 0040's documented values), in the org pack's shape. */
176
+ export declare const BUILTIN_COMPONENT_TYPES: readonly LoadedComponentType[];
177
+ /**
178
+ * The organisation's set: Atticus's built-ins, each replaced by an org-pack type of the same id
179
+ * (its words win) or taken out by one with `off`, then the organisation's own types, in id order.
180
+ */
181
+ export declare function effectiveComponentTypes(pack: readonly LoadedComponentType[]): LoadedComponentType[];
182
+ /**
183
+ * The types as `atticus map <repo> --estimate` lists them for the reader: each with its id, its
184
+ * description and the signals it rests on, in a data block. The reader writes one `component`
185
+ * fact per component with the type it fits, citing the line that shows a signal.
186
+ */
187
+ export declare function componentTypesText(types: readonly LoadedComponentType[]): string;
188
+ /**
189
+ * What a type must and must not do, for a stage drafting a new component or a review: each
190
+ * line quoted, in a data block, with the type's notes file named (not read into the prompt whole:
191
+ * a person's write-up can be long; the stage reads it from the file when it needs it).
192
+ */
193
+ export declare function componentTypeRulesText(types: readonly LoadedComponentType[], packRel: string): string;
@@ -0,0 +1,80 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Contract C6: the house conventions a read leans on (ADR 0147), `org-pack/conventions.yaml`.
4
+ * A new, optional file: a pack without it reads with the defaults below, which are the lists
5
+ * Atticus had written into its code before, so nothing changes until an organisation writes one.
6
+ * Every key is optional; a key given replaces its default list whole (it doesn't add to it), so
7
+ * an organisation can take a word out as well as put one in.
8
+ */
9
+ /**
10
+ * Version 2 (ADR 0163) adds `notes`, the organisation-wide notes every read is handed beside its
11
+ * repo type's. A version-1 file reads as it is and comes back as version 2 in memory.
12
+ */
13
+ export declare const CONVENTIONS_SCHEMA_VERSION: 2;
14
+ /** The folders an API spec is kept in, as a gateway's repo keeps its proxy's spec. */
15
+ export declare const DEFAULT_API_SPEC_FOLDERS: readonly ["oas", "openapi", "swagger", "asyncapi", "api-spec", "api-specs", "apispec", "apispecs"];
16
+ /** The folders of a gateway's proxy bundles: an entry under one is a gateway route, whatever the repo. */
17
+ export declare const DEFAULT_GATEWAY_BUNDLE_FOLDERS: readonly ["apiproxy", "sharedflowbundle"];
18
+ /** The words a virtual host or a gateway's config uses for each side of the organisation. */
19
+ export declare const DEFAULT_FACING_WORDS: {
20
+ readonly internal: readonly ["internal", "private", "intranet", "inside"];
21
+ readonly external: readonly ["external", "partner", "public", "internet", "egress"];
22
+ };
23
+ /** Folders whose files hold nothing of what a repo serves, calls or stores: tests and fixtures. */
24
+ export declare const DEFAULT_NOT_PRODUCT_FOLDERS: readonly ["src/test", "src/it", "test", "tests", "__tests__", "__mocks__", "spec", "specs", "e2e", "testdata", "test-data", "fixtures"];
25
+ /** Folders whose strings aren't the product's (generated, built, vendored), for the skipped-lines note. */
26
+ export declare const DEFAULT_NOT_READ_FOLDERS: readonly ["generated", "generated-sources", "__generated__", "gen", "dist", "build", "out", "target", "bin", "obj", "node_modules", "vendor", "vendored", "third_party", "third-party", ".next", ".nuxt", "coverage"];
27
+ /**
28
+ * A framework the organisation tells Atticus about (verify's framework table, ADR 0124 addendum
29
+ * A-framework): what a declaration in a build file means. Looked at before the built-in table,
30
+ * so an entry here can also say what a known declaration means in this house.
31
+ */
32
+ export declare const ConventionFramework: z.ZodObject<{
33
+ declares: z.ZodString;
34
+ name: z.ZodString;
35
+ topic: z.ZodOptional<z.ZodString>;
36
+ shape: z.ZodOptional<z.ZodEnum<{
37
+ "batch-job": "batch-job";
38
+ rest: "rest";
39
+ store: "store";
40
+ screen: "screen";
41
+ }>>;
42
+ }, z.core.$strict>;
43
+ export type ConventionFramework = z.infer<typeof ConventionFramework>;
44
+ export declare const Conventions: z.ZodObject<{
45
+ schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
46
+ apiSpecFolders: z.ZodDefault<z.ZodArray<z.ZodString>>;
47
+ gatewayBundleFolders: z.ZodDefault<z.ZodArray<z.ZodString>>;
48
+ facing: z.ZodDefault<z.ZodObject<{
49
+ internal: z.ZodDefault<z.ZodArray<z.ZodString>>;
50
+ external: z.ZodDefault<z.ZodArray<z.ZodString>>;
51
+ }, z.core.$strict>>;
52
+ frameworks: z.ZodDefault<z.ZodArray<z.ZodObject<{
53
+ declares: z.ZodString;
54
+ name: z.ZodString;
55
+ topic: z.ZodOptional<z.ZodString>;
56
+ shape: z.ZodOptional<z.ZodEnum<{
57
+ "batch-job": "batch-job";
58
+ rest: "rest";
59
+ store: "store";
60
+ screen: "screen";
61
+ }>>;
62
+ }, z.core.$strict>>>;
63
+ notProductFolders: z.ZodDefault<z.ZodArray<z.ZodString>>;
64
+ notReadFolders: z.ZodDefault<z.ZodArray<z.ZodString>>;
65
+ housePrefixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
66
+ notes: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
+ }, z.core.$strict>;
68
+ export type Conventions = z.infer<typeof Conventions>;
69
+ /** The conventions of a pack without conventions.yaml: the built-in lists. */
70
+ export declare const DEFAULT_CONVENTIONS: Conventions;
71
+ /**
72
+ * A test for a path under one of these folders, as whole segments anywhere in it: `(^|/)(a|b)/`.
73
+ * `tail` follows the folder (default: anything). Matches nothing when the list is empty.
74
+ */
75
+ export declare function underFolders(folders: readonly string[], o?: {
76
+ tail?: string;
77
+ flags?: string;
78
+ }): RegExp;
79
+ /** An entry cited under one of these folders is a gateway route (default: the built-in bundle folders). */
80
+ export declare function gatewayBundleTest(folders?: readonly string[]): RegExp;