@maycombhq/sdk 2.0.0-beta.1 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist → npm}/cache.d.ts +1 -1
- package/npm/core/api.d.ts +6098 -0
- package/npm/core/assistant-actor.d.ts +15 -0
- package/npm/core/branches.d.ts +21 -0
- package/npm/core/cancel.d.ts +9 -0
- package/npm/core/catalog.d.ts +4733 -0
- package/npm/core/change-types-migrate.d.ts +10 -0
- package/npm/core/cite.d.ts +54 -0
- package/npm/core/curated.d.ts +37 -0
- package/npm/core/facts-callers.d.ts +150 -0
- package/npm/core/facts-carry.d.ts +36 -0
- package/npm/core/facts-join-prototype.d.ts +177 -0
- package/npm/core/facts-join-vendor.d.ts +92 -0
- package/npm/core/facts-join.d.ts +256 -0
- package/npm/core/facts.d.ts +94 -0
- package/npm/core/fs.d.ts +47 -0
- package/npm/core/gates-migrate.d.ts +10 -0
- package/npm/core/host-questions.d.ts +24 -0
- package/npm/core/identity.d.ts +17 -0
- package/npm/core/index.d.ts +62 -0
- package/npm/core/json-schema.d.ts +20 -0
- package/npm/core/judgments.d.ts +63 -0
- package/npm/core/light.d.ts +8 -0
- package/npm/core/log.d.ts +49 -0
- package/npm/core/manifest-edit.d.ts +48 -0
- package/npm/core/merge.d.ts +78 -0
- package/npm/core/metarepo.d.ts +83 -0
- package/npm/core/migrate.d.ts +31 -0
- package/npm/core/migration-files.d.ts +13 -0
- package/npm/core/orgpack-defaults.d.ts +194 -0
- package/npm/core/orgpack-load.d.ts +86 -0
- package/npm/core/questions.d.ts +267 -0
- package/npm/core/record-cache.d.ts +52 -0
- package/npm/core/refs.d.ts +9 -0
- package/npm/core/repo-description.d.ts +44 -0
- package/npm/core/runtime-migrate.d.ts +11 -0
- package/npm/core/schema/ai.d.ts +397 -0
- package/npm/core/schema/change.d.ts +244 -0
- package/npm/core/schema/common.d.ts +135 -0
- package/npm/core/schema/dialect.d.ts +801 -0
- package/npm/core/schema/executors.d.ts +396 -0
- package/npm/core/schema/fact-corrections.d.ts +55 -0
- package/npm/core/schema/facts.d.ts +1476 -0
- package/npm/core/schema/frameworks.d.ts +371 -0
- package/npm/core/schema/judgment.d.ts +77 -0
- package/npm/core/schema/kinds.d.ts +5166 -0
- package/npm/core/schema/layout.d.ts +25 -0
- package/npm/core/schema/orgpack.d.ts +1167 -0
- package/npm/core/schema/plugin.d.ts +73 -0
- package/npm/core/schema/question.d.ts +152 -0
- package/npm/core/schema/repo-type.d.ts +109 -0
- package/npm/core/schema/review.d.ts +558 -0
- package/npm/core/schema/scan-settings.d.ts +34 -0
- package/npm/core/schema/scan-verify.d.ts +535 -0
- package/npm/core/schema/spec.d.ts +269 -0
- package/npm/core/schema/version.d.ts +9 -0
- package/npm/core/schema/workspace.d.ts +312 -0
- package/npm/core/serialize.d.ts +17 -0
- package/npm/core/sources-migrate.d.ts +15 -0
- package/npm/core/specs.d.ts +66 -0
- package/npm/core/tar-read.d.ts +13 -0
- package/npm/core/template.d.ts +101 -0
- package/npm/core/words.d.ts +13 -0
- package/npm/core/zip-read.d.ts +37 -0
- package/npm/core/zip.d.ts +13 -0
- package/npm/index.js +8892 -0
- package/{dist → npm}/plugin.d.ts +1 -1
- package/{dist → npm}/runner.d.ts +1 -1
- package/package.json +10 -11
- package/dist/cache.js +0 -115
- package/dist/cache.js.map +0 -1
- package/dist/fs-repo.js +0 -120
- package/dist/fs-repo.js.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/parse-cache.js +0 -275
- package/dist/parse-cache.js.map +0 -1
- package/dist/plugin.js +0 -85
- package/dist/plugin.js.map +0 -1
- package/dist/runner.js +0 -209
- package/dist/runner.js.map +0 -1
- package/dist/sandbox.js +0 -443
- package/dist/sandbox.js.map +0 -1
- /package/{dist → npm}/fs-repo.d.ts +0 -0
- /package/{dist → npm}/index.d.ts +0 -0
- /package/{dist → npm}/parse-cache.d.ts +0 -0
- /package/{dist → npm}/sandbox.d.ts +0 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Repo specs (ADR 0079): the spec template a repo type carries (C6,
|
|
4
|
+
* org-pack/repo-types/<id>/spec-template.yaml), the header of a repo's spec
|
|
5
|
+
* (specs/<repo>/spec.yaml) and the critic's last findings (specs/<repo>/findings.yaml).
|
|
6
|
+
*/
|
|
7
|
+
export declare const SPEC_TEMPLATE_SCHEMA_VERSION: 1;
|
|
8
|
+
export declare const SPEC_HEADER_SCHEMA_VERSION: 1;
|
|
9
|
+
export declare const SPEC_FINDINGS_SCHEMA_VERSION: 1;
|
|
10
|
+
/** What a step of a kind must record, besides its citation. */
|
|
11
|
+
export declare const STEP_REQUIREMENTS: readonly ["to", "store.table", "store.columns", "data.sends", "data.returns", "data.reads", "data.checks", "data.from", "data.to", "repeats"];
|
|
12
|
+
export type StepRequirement = (typeof STEP_REQUIREMENTS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* How triggers of a kind are found in the catalog: every Endpoint of these endpoint types, or
|
|
15
|
+
* every Interface over these vias and directions. A trigger kind without `from` (a page, a
|
|
16
|
+
* button) is found by the assistant, so the critic can't count them.
|
|
17
|
+
*/
|
|
18
|
+
export declare const TriggerSource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
19
|
+
kind: z.ZodLiteral<"Endpoint">;
|
|
20
|
+
endpointType: z.ZodArray<z.ZodString>;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"Interface">;
|
|
23
|
+
via: z.ZodArray<z.ZodString>;
|
|
24
|
+
direction: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
25
|
+
outbound: "outbound";
|
|
26
|
+
inbound: "inbound";
|
|
27
|
+
bidirectional: "bidirectional";
|
|
28
|
+
}>>>;
|
|
29
|
+
}, z.core.$strict>], "kind">;
|
|
30
|
+
export type TriggerSource = z.infer<typeof TriggerSource>;
|
|
31
|
+
/**
|
|
32
|
+
* How the critic tells a screen's own lines in a UI flow (ADR 0089): words, letter case
|
|
33
|
+
* aside, that a line naming a person's action, a page load or what the screen does after a
|
|
34
|
+
* response contains. An organisation with its own UI framework lists its own words.
|
|
35
|
+
*/
|
|
36
|
+
export declare const DEFAULT_UI_WORDS: {
|
|
37
|
+
readonly action: readonly ["submit", "click", "press", "tap", "button", "form", "input", "select", "change", "href", "link", "keyup", "keydown", "drop", "toggle"];
|
|
38
|
+
readonly page: readonly ["route", "path", "page", "load", "init", "mount", "effect", "created", "activated", "resolve", "view", "screen"];
|
|
39
|
+
readonly end: readonly ["navigate", "router", "redirect", "location", "route", "refresh", "reload", "render", "show", "display", "setstate", "set(", "emit", "alert", "error", "message", "toast", "notify", "dialog", "close"];
|
|
40
|
+
};
|
|
41
|
+
export declare const SpecUi: z.ZodObject<{
|
|
42
|
+
actionWords: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
43
|
+
pageWords: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
44
|
+
endWords: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
export type SpecUi = z.infer<typeof SpecUi>;
|
|
47
|
+
export declare const SpecTemplate: z.ZodObject<{
|
|
48
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
49
|
+
repoType: z.ZodString;
|
|
50
|
+
version: z.ZodNumber;
|
|
51
|
+
triggers: z.ZodArray<z.ZodObject<{
|
|
52
|
+
kind: z.ZodEnum<{
|
|
53
|
+
endpoint: "endpoint";
|
|
54
|
+
page: "page";
|
|
55
|
+
action: "action";
|
|
56
|
+
listener: "listener";
|
|
57
|
+
job: "job";
|
|
58
|
+
}>;
|
|
59
|
+
from: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
60
|
+
kind: z.ZodLiteral<"Endpoint">;
|
|
61
|
+
endpointType: z.ZodArray<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
63
|
+
kind: z.ZodLiteral<"Interface">;
|
|
64
|
+
via: z.ZodArray<z.ZodString>;
|
|
65
|
+
direction: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
66
|
+
outbound: "outbound";
|
|
67
|
+
inbound: "inbound";
|
|
68
|
+
bidirectional: "bidirectional";
|
|
69
|
+
}>>>;
|
|
70
|
+
}, z.core.$strict>], "kind">>;
|
|
71
|
+
why: z.ZodString;
|
|
72
|
+
}, z.core.$strict>>;
|
|
73
|
+
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
74
|
+
kind: z.ZodEnum<{
|
|
75
|
+
transform: "transform";
|
|
76
|
+
retry: "retry";
|
|
77
|
+
entry: "entry";
|
|
78
|
+
lookup: "lookup";
|
|
79
|
+
read: "read";
|
|
80
|
+
write: "write";
|
|
81
|
+
"call-out": "call-out";
|
|
82
|
+
publish: "publish";
|
|
83
|
+
validate: "validate";
|
|
84
|
+
branch: "branch";
|
|
85
|
+
log: "log";
|
|
86
|
+
respond: "respond";
|
|
87
|
+
loop: "loop";
|
|
88
|
+
}>;
|
|
89
|
+
requires: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
90
|
+
to: "to";
|
|
91
|
+
repeats: "repeats";
|
|
92
|
+
"store.table": "store.table";
|
|
93
|
+
"store.columns": "store.columns";
|
|
94
|
+
"data.sends": "data.sends";
|
|
95
|
+
"data.returns": "data.returns";
|
|
96
|
+
"data.reads": "data.reads";
|
|
97
|
+
"data.checks": "data.checks";
|
|
98
|
+
"data.from": "data.from";
|
|
99
|
+
"data.to": "data.to";
|
|
100
|
+
}>>>;
|
|
101
|
+
why: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strict>>>;
|
|
103
|
+
families: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
104
|
+
id: z.ZodString;
|
|
105
|
+
by: z.ZodLiteral<"resource">;
|
|
106
|
+
why: z.ZodString;
|
|
107
|
+
}, z.core.$strict>>>;
|
|
108
|
+
ui: z.ZodDefault<z.ZodObject<{
|
|
109
|
+
actionWords: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
110
|
+
pageWords: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
111
|
+
endWords: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
112
|
+
}, z.core.$strict>>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export type SpecTemplate = z.infer<typeof SpecTemplate>;
|
|
115
|
+
/** The spec template used for a repo with no repo type, or a type without its own template. */
|
|
116
|
+
export declare const DEFAULT_SPEC_TEMPLATE: SpecTemplate;
|
|
117
|
+
/** `<repoType>@<version>`, as a flow records it. */
|
|
118
|
+
export declare const templateRef: (t: SpecTemplate) => string;
|
|
119
|
+
/** The header of a repo's spec: specs/<repo>/spec.yaml. */
|
|
120
|
+
export declare const SpecHeader: z.ZodObject<{
|
|
121
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
122
|
+
repo: z.ZodString;
|
|
123
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
124
|
+
template: z.ZodString;
|
|
125
|
+
templateReviewed: z.ZodDefault<z.ZodBoolean>;
|
|
126
|
+
drafted: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
at: z.ZodISODateTime;
|
|
128
|
+
run: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
flows: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
131
|
+
files: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
132
|
+
questions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
export type SpecHeader = z.infer<typeof SpecHeader>;
|
|
135
|
+
/** One finding of the spec critic. */
|
|
136
|
+
export declare const SpecFinding: z.ZodObject<{
|
|
137
|
+
fingerprint: z.ZodString;
|
|
138
|
+
rule: z.ZodString;
|
|
139
|
+
target: z.ZodString;
|
|
140
|
+
evidence: z.ZodOptional<z.ZodString>;
|
|
141
|
+
message: z.ZodString;
|
|
142
|
+
seen: z.ZodDefault<z.ZodNumber>;
|
|
143
|
+
question: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
export type SpecFinding = z.infer<typeof SpecFinding>;
|
|
146
|
+
/** The critic's last findings: specs/<repo>/findings.yaml. */
|
|
147
|
+
export declare const SpecFindings: z.ZodObject<{
|
|
148
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
149
|
+
repo: z.ZodString;
|
|
150
|
+
checkedAt: z.ZodISODateTime;
|
|
151
|
+
draftedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
152
|
+
findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
153
|
+
fingerprint: z.ZodString;
|
|
154
|
+
rule: z.ZodString;
|
|
155
|
+
target: z.ZodString;
|
|
156
|
+
evidence: z.ZodOptional<z.ZodString>;
|
|
157
|
+
message: z.ZodString;
|
|
158
|
+
seen: z.ZodDefault<z.ZodNumber>;
|
|
159
|
+
question: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$strict>>>;
|
|
161
|
+
}, z.core.$strict>;
|
|
162
|
+
export type SpecFindings = z.infer<typeof SpecFindings>;
|
|
163
|
+
/** The template for a repo type: its own when the org pack has one, else the default. */
|
|
164
|
+
export declare function specTemplateFor(templates: readonly SpecTemplate[], repoType: string | undefined): SpecTemplate;
|
|
165
|
+
export declare const ESTATE_JOINS_SCHEMA_VERSION: 1;
|
|
166
|
+
/**
|
|
167
|
+
* How a call-out was matched to the flow its target starts: `interface`, through the catalog's
|
|
168
|
+
* Interface from the caller's component to the target (and its gateway route); `endpoint`, the
|
|
169
|
+
* step names the target's Endpoint id itself; `path`, no Interface, so by method and
|
|
170
|
+
* normalised path on the target component.
|
|
171
|
+
*/
|
|
172
|
+
export declare const ESTATE_JOIN_HOW: readonly ["interface", "endpoint", "path"];
|
|
173
|
+
/**
|
|
174
|
+
* Why a call-out wasn't joined: `no-target`, the catalog has no component or entry point it
|
|
175
|
+
* reaches; `no-flow`, it reaches an entry point no flow starts at; `no-citation`, one end
|
|
176
|
+
* (the caller's step or the callee's trigger) cites no file and line that exists;
|
|
177
|
+
* `family-mismatch` (ADR 0088), no flow starts at the entry point it reaches, and the only ones
|
|
178
|
+
* that stand for it do so through a family member spec check finds wrong.
|
|
179
|
+
*/
|
|
180
|
+
export declare const ESTATE_UNMATCHED_REASONS: readonly ["no-target", "no-flow", "no-citation", "family-mismatch"];
|
|
181
|
+
/** One call-out joined to the flow its target starts. Both ends cite a file and line. */
|
|
182
|
+
export declare const EstateJoin: z.ZodObject<{
|
|
183
|
+
from: z.ZodObject<{
|
|
184
|
+
repo: z.ZodString;
|
|
185
|
+
flow: z.ZodString;
|
|
186
|
+
step: z.ZodNumber;
|
|
187
|
+
evidence: z.ZodString;
|
|
188
|
+
}, z.core.$strict>;
|
|
189
|
+
to: z.ZodObject<{
|
|
190
|
+
repo: z.ZodString;
|
|
191
|
+
flow: z.ZodString;
|
|
192
|
+
trigger: z.ZodString;
|
|
193
|
+
evidence: z.ZodString;
|
|
194
|
+
}, z.core.$strict>;
|
|
195
|
+
entry: z.ZodString;
|
|
196
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
197
|
+
how: z.ZodEnum<{
|
|
198
|
+
path: "path";
|
|
199
|
+
endpoint: "endpoint";
|
|
200
|
+
interface: "interface";
|
|
201
|
+
}>;
|
|
202
|
+
}, z.core.$strict>;
|
|
203
|
+
export type EstateJoin = z.infer<typeof EstateJoin>;
|
|
204
|
+
/** A call-out that wasn't joined, with why. */
|
|
205
|
+
export declare const EstateUnmatched: z.ZodObject<{
|
|
206
|
+
from: z.ZodObject<{
|
|
207
|
+
repo: z.ZodString;
|
|
208
|
+
flow: z.ZodString;
|
|
209
|
+
step: z.ZodNumber;
|
|
210
|
+
evidence: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
entry: z.ZodString;
|
|
213
|
+
reason: z.ZodEnum<{
|
|
214
|
+
"no-target": "no-target";
|
|
215
|
+
"no-flow": "no-flow";
|
|
216
|
+
"no-citation": "no-citation";
|
|
217
|
+
"family-mismatch": "family-mismatch";
|
|
218
|
+
}>;
|
|
219
|
+
trigger: z.ZodOptional<z.ZodString>;
|
|
220
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
221
|
+
message: z.ZodString;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
export type EstateUnmatched = z.infer<typeof EstateUnmatched>;
|
|
224
|
+
/** specs/estate.yaml: every call-out of the metarepo's specs, joined or not (ADR 0085). */
|
|
225
|
+
export declare const EstateJoins: z.ZodObject<{
|
|
226
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
227
|
+
joinedAt: z.ZodISODateTime;
|
|
228
|
+
repos: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
229
|
+
joins: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
230
|
+
from: z.ZodObject<{
|
|
231
|
+
repo: z.ZodString;
|
|
232
|
+
flow: z.ZodString;
|
|
233
|
+
step: z.ZodNumber;
|
|
234
|
+
evidence: z.ZodString;
|
|
235
|
+
}, z.core.$strict>;
|
|
236
|
+
to: z.ZodObject<{
|
|
237
|
+
repo: z.ZodString;
|
|
238
|
+
flow: z.ZodString;
|
|
239
|
+
trigger: z.ZodString;
|
|
240
|
+
evidence: z.ZodString;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
entry: z.ZodString;
|
|
243
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
244
|
+
how: z.ZodEnum<{
|
|
245
|
+
path: "path";
|
|
246
|
+
endpoint: "endpoint";
|
|
247
|
+
interface: "interface";
|
|
248
|
+
}>;
|
|
249
|
+
}, z.core.$strict>>>;
|
|
250
|
+
unmatched: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
251
|
+
from: z.ZodObject<{
|
|
252
|
+
repo: z.ZodString;
|
|
253
|
+
flow: z.ZodString;
|
|
254
|
+
step: z.ZodNumber;
|
|
255
|
+
evidence: z.ZodOptional<z.ZodString>;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
entry: z.ZodString;
|
|
258
|
+
reason: z.ZodEnum<{
|
|
259
|
+
"no-target": "no-target";
|
|
260
|
+
"no-flow": "no-flow";
|
|
261
|
+
"no-citation": "no-citation";
|
|
262
|
+
"family-mismatch": "family-mismatch";
|
|
263
|
+
}>;
|
|
264
|
+
trigger: z.ZodOptional<z.ZodString>;
|
|
265
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
266
|
+
message: z.ZodString;
|
|
267
|
+
}, z.core.$strict>>>;
|
|
268
|
+
}, z.core.$strict>;
|
|
269
|
+
export type EstateJoins = z.infer<typeof EstateJoins>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Current catalog schema version. Bumping it requires an ADR and a migration.
|
|
3
|
+
* Version 2 (ADR 0031) added the Capability kind and changed no existing field.
|
|
4
|
+
* Version 3 (ADR 0125) added `required` on a Schema field, optional, and changed no other field.
|
|
5
|
+
*
|
|
6
|
+
* It lives in its own file, with no schema beside it, so the command line can print it in its
|
|
7
|
+
* help without loading zod (`@maycombhq/core/light`); `./common.js` exports it with C1.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SCHEMA_VERSION: 3;
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Repo and change-workspace files.
|
|
4
|
+
*
|
|
5
|
+
* - `org-pack/profiles/<platform>/repos.manifest.yaml` lists every repo of a platform
|
|
6
|
+
* (part of contract C6, org-pack schemas).
|
|
7
|
+
* - `openspec/changes/<change-id>/repos.yaml` records, for one change, the branch,
|
|
8
|
+
* worktree, PR and build of each repo the change touches. OpenSpec does not track a
|
|
9
|
+
* change across repos, so this file is Atticus's own.
|
|
10
|
+
*
|
|
11
|
+
* See ADR 0009.
|
|
12
|
+
*
|
|
13
|
+
* Version 2 (ADR 0128) added `description` on a repo, optional, and changed no other field.
|
|
14
|
+
*/
|
|
15
|
+
export declare const WORKSPACE_SCHEMA_VERSION: 2;
|
|
16
|
+
/** Every workspace-file schema version a reader accepts, oldest first. */
|
|
17
|
+
export declare const SUPPORTED_WORKSPACE_SCHEMA_VERSIONS: readonly [1, 2];
|
|
18
|
+
/**
|
|
19
|
+
* A workspace file's schema version. Version-1 files differ from version 2 only in this number
|
|
20
|
+
* (nothing they hold changed meaning), so they are read as they are and come back as version 2
|
|
21
|
+
* in memory; writers always write the current version, and `atticus upgrade` rewrites old files.
|
|
22
|
+
*/
|
|
23
|
+
export declare const WorkspaceSchemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
24
|
+
export declare const GitRef: z.ZodString;
|
|
25
|
+
/**
|
|
26
|
+
* A URL's host (lower case) and port (the scheme's when it names none), or undefined for a
|
|
27
|
+
* path with no host.
|
|
28
|
+
*/
|
|
29
|
+
export declare function urlHostPort(url: string): {
|
|
30
|
+
host: string;
|
|
31
|
+
port?: number;
|
|
32
|
+
} | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Whether a host a call names matches a manifest host pattern (ADR 0053, 0088): * is any part
|
|
35
|
+
* of a label; a pattern with a port matches only a call on that port.
|
|
36
|
+
*/
|
|
37
|
+
export declare function hostMatches(pattern: string, host: string, port?: number): boolean;
|
|
38
|
+
/** Whether a host pattern names a port. */
|
|
39
|
+
export declare const hostHasPort: (pattern: string) => boolean;
|
|
40
|
+
/** The longest a repo's description may be: one line a person reads at a glance. */
|
|
41
|
+
export declare const REPO_DESCRIPTION_MAX = 300;
|
|
42
|
+
/**
|
|
43
|
+
* Where a drafted description was read from, cited the way a fact is (ADR 0124): the file and
|
|
44
|
+
* the line. A description is prose, not a claim on one line, so there is no value to check; the
|
|
45
|
+
* cites say where to look when a person judges it.
|
|
46
|
+
*/
|
|
47
|
+
export declare const RepoDescriptionCite: z.ZodObject<{
|
|
48
|
+
file: z.ZodString;
|
|
49
|
+
line: z.ZodNumber;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export type RepoDescriptionCite = z.infer<typeof RepoDescriptionCite>;
|
|
52
|
+
/**
|
|
53
|
+
* What a repo is, in a person's words (ADR 0128): one line, so an opaque repo id can be read,
|
|
54
|
+
* placed and joined. `trust` follows how knowledge is trusted here: `verified` means a person
|
|
55
|
+
* wrote it or confirmed what the assistant drafted; `suggested` means the assistant drafted it
|
|
56
|
+
* from what it read and nobody has confirmed it yet. A suggested description is shown as
|
|
57
|
+
* unconfirmed wherever it is used and is never presented as a person's words, and it never
|
|
58
|
+
* overrides what a fact verified from code says.
|
|
59
|
+
*/
|
|
60
|
+
export declare const RepoDescription: z.ZodObject<{
|
|
61
|
+
text: z.ZodString;
|
|
62
|
+
trust: z.ZodDefault<z.ZodEnum<{
|
|
63
|
+
verified: "verified";
|
|
64
|
+
suggested: "suggested";
|
|
65
|
+
}>>;
|
|
66
|
+
by: z.ZodOptional<z.ZodString>;
|
|
67
|
+
at: z.ZodOptional<z.ZodISODateTime>;
|
|
68
|
+
cites: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
69
|
+
file: z.ZodString;
|
|
70
|
+
line: z.ZodNumber;
|
|
71
|
+
}, z.core.$strict>>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
export type RepoDescription = z.infer<typeof RepoDescription>;
|
|
74
|
+
export declare const ManifestRepo: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
url: z.ZodString;
|
|
77
|
+
description: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
text: z.ZodString;
|
|
79
|
+
trust: z.ZodDefault<z.ZodEnum<{
|
|
80
|
+
verified: "verified";
|
|
81
|
+
suggested: "suggested";
|
|
82
|
+
}>>;
|
|
83
|
+
by: z.ZodOptional<z.ZodString>;
|
|
84
|
+
at: z.ZodOptional<z.ZodISODateTime>;
|
|
85
|
+
cites: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
86
|
+
file: z.ZodString;
|
|
87
|
+
line: z.ZodNumber;
|
|
88
|
+
}, z.core.$strict>>>;
|
|
89
|
+
}, z.core.$strict>>;
|
|
90
|
+
defaultBranch: z.ZodDefault<z.ZodString>;
|
|
91
|
+
branches: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
92
|
+
type: z.ZodString;
|
|
93
|
+
owner: z.ZodString;
|
|
94
|
+
component: z.ZodOptional<z.ZodString>;
|
|
95
|
+
system: z.ZodOptional<z.ZodString>;
|
|
96
|
+
extractors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
97
|
+
dialects: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
98
|
+
sparse: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
99
|
+
build: z.ZodOptional<z.ZodString>;
|
|
100
|
+
archived: z.ZodDefault<z.ZodBoolean>;
|
|
101
|
+
hosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
102
|
+
modules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
103
|
+
path: z.ZodString;
|
|
104
|
+
component: z.ZodString;
|
|
105
|
+
hosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
106
|
+
}, z.core.$strict>>>;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
export type ManifestRepo = z.infer<typeof ManifestRepo>;
|
|
109
|
+
export declare const RepoManifest: z.ZodObject<{
|
|
110
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
111
|
+
platform: z.ZodString;
|
|
112
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
url: z.ZodString;
|
|
115
|
+
description: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
text: z.ZodString;
|
|
117
|
+
trust: z.ZodDefault<z.ZodEnum<{
|
|
118
|
+
verified: "verified";
|
|
119
|
+
suggested: "suggested";
|
|
120
|
+
}>>;
|
|
121
|
+
by: z.ZodOptional<z.ZodString>;
|
|
122
|
+
at: z.ZodOptional<z.ZodISODateTime>;
|
|
123
|
+
cites: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
124
|
+
file: z.ZodString;
|
|
125
|
+
line: z.ZodNumber;
|
|
126
|
+
}, z.core.$strict>>>;
|
|
127
|
+
}, z.core.$strict>>;
|
|
128
|
+
defaultBranch: z.ZodDefault<z.ZodString>;
|
|
129
|
+
branches: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
130
|
+
type: z.ZodString;
|
|
131
|
+
owner: z.ZodString;
|
|
132
|
+
component: z.ZodOptional<z.ZodString>;
|
|
133
|
+
system: z.ZodOptional<z.ZodString>;
|
|
134
|
+
extractors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
135
|
+
dialects: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
136
|
+
sparse: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
137
|
+
build: z.ZodOptional<z.ZodString>;
|
|
138
|
+
archived: z.ZodDefault<z.ZodBoolean>;
|
|
139
|
+
hosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
140
|
+
modules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
141
|
+
path: z.ZodString;
|
|
142
|
+
component: z.ZodString;
|
|
143
|
+
hosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
144
|
+
}, z.core.$strict>>>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
export type RepoManifest = z.infer<typeof RepoManifest>;
|
|
148
|
+
export declare const PullRequestState: z.ZodEnum<{
|
|
149
|
+
open: "open";
|
|
150
|
+
draft: "draft";
|
|
151
|
+
merged: "merged";
|
|
152
|
+
closed: "closed";
|
|
153
|
+
}>;
|
|
154
|
+
export declare const ChangeRepoPr: z.ZodObject<{
|
|
155
|
+
url: z.ZodURL;
|
|
156
|
+
number: z.ZodNumber;
|
|
157
|
+
state: z.ZodEnum<{
|
|
158
|
+
open: "open";
|
|
159
|
+
draft: "draft";
|
|
160
|
+
merged: "merged";
|
|
161
|
+
closed: "closed";
|
|
162
|
+
}>;
|
|
163
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
export declare const BuildStatus: z.ZodEnum<{
|
|
166
|
+
failed: "failed";
|
|
167
|
+
"not-run": "not-run";
|
|
168
|
+
running: "running";
|
|
169
|
+
passed: "passed";
|
|
170
|
+
}>;
|
|
171
|
+
export declare const ChangeRepoBuild: z.ZodObject<{
|
|
172
|
+
status: z.ZodEnum<{
|
|
173
|
+
failed: "failed";
|
|
174
|
+
"not-run": "not-run";
|
|
175
|
+
running: "running";
|
|
176
|
+
passed: "passed";
|
|
177
|
+
}>;
|
|
178
|
+
command: z.ZodOptional<z.ZodString>;
|
|
179
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
180
|
+
at: z.ZodOptional<z.ZodISODateTime>;
|
|
181
|
+
log: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
export declare const ChangeRepo: z.ZodObject<{
|
|
184
|
+
id: z.ZodString;
|
|
185
|
+
branch: z.ZodString;
|
|
186
|
+
base: z.ZodString;
|
|
187
|
+
baseSha: z.ZodOptional<z.ZodString>;
|
|
188
|
+
worktree: z.ZodString;
|
|
189
|
+
pr: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
url: z.ZodURL;
|
|
191
|
+
number: z.ZodNumber;
|
|
192
|
+
state: z.ZodEnum<{
|
|
193
|
+
open: "open";
|
|
194
|
+
draft: "draft";
|
|
195
|
+
merged: "merged";
|
|
196
|
+
closed: "closed";
|
|
197
|
+
}>;
|
|
198
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
199
|
+
}, z.core.$strict>>;
|
|
200
|
+
build: z.ZodDefault<z.ZodObject<{
|
|
201
|
+
status: z.ZodEnum<{
|
|
202
|
+
failed: "failed";
|
|
203
|
+
"not-run": "not-run";
|
|
204
|
+
running: "running";
|
|
205
|
+
passed: "passed";
|
|
206
|
+
}>;
|
|
207
|
+
command: z.ZodOptional<z.ZodString>;
|
|
208
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
209
|
+
at: z.ZodOptional<z.ZodISODateTime>;
|
|
210
|
+
log: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, z.core.$strict>>;
|
|
212
|
+
}, z.core.$strict>;
|
|
213
|
+
export type ChangeRepo = z.infer<typeof ChangeRepo>;
|
|
214
|
+
export declare const ChangeRepos: z.ZodObject<{
|
|
215
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
216
|
+
change: z.ZodString;
|
|
217
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
218
|
+
id: z.ZodString;
|
|
219
|
+
branch: z.ZodString;
|
|
220
|
+
base: z.ZodString;
|
|
221
|
+
baseSha: z.ZodOptional<z.ZodString>;
|
|
222
|
+
worktree: z.ZodString;
|
|
223
|
+
pr: z.ZodOptional<z.ZodObject<{
|
|
224
|
+
url: z.ZodURL;
|
|
225
|
+
number: z.ZodNumber;
|
|
226
|
+
state: z.ZodEnum<{
|
|
227
|
+
open: "open";
|
|
228
|
+
draft: "draft";
|
|
229
|
+
merged: "merged";
|
|
230
|
+
closed: "closed";
|
|
231
|
+
}>;
|
|
232
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
233
|
+
}, z.core.$strict>>;
|
|
234
|
+
build: z.ZodDefault<z.ZodObject<{
|
|
235
|
+
status: z.ZodEnum<{
|
|
236
|
+
failed: "failed";
|
|
237
|
+
"not-run": "not-run";
|
|
238
|
+
running: "running";
|
|
239
|
+
passed: "passed";
|
|
240
|
+
}>;
|
|
241
|
+
command: z.ZodOptional<z.ZodString>;
|
|
242
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
243
|
+
at: z.ZodOptional<z.ZodISODateTime>;
|
|
244
|
+
log: z.ZodOptional<z.ZodString>;
|
|
245
|
+
}, z.core.$strict>>;
|
|
246
|
+
}, z.core.$strict>>;
|
|
247
|
+
}, z.core.$strict>;
|
|
248
|
+
export type ChangeRepos = z.infer<typeof ChangeRepos>;
|
|
249
|
+
/**
|
|
250
|
+
* `openspec/changes/<change-id>/review/outcomes.yaml` (ADR 0045): what people measured after
|
|
251
|
+
* release against the brief's success measures. The measures themselves are read from the
|
|
252
|
+
* brief on every view; this file keeps only the values people recorded, each with who and when.
|
|
253
|
+
*/
|
|
254
|
+
export declare const OutcomeValue: z.ZodObject<{
|
|
255
|
+
value: z.ZodString;
|
|
256
|
+
by: z.ZodString;
|
|
257
|
+
at: z.ZodISODateTime;
|
|
258
|
+
note: z.ZodOptional<z.ZodString>;
|
|
259
|
+
}, z.core.$strict>;
|
|
260
|
+
export type OutcomeValue = z.infer<typeof OutcomeValue>;
|
|
261
|
+
export declare const OutcomeMeasure: z.ZodObject<{
|
|
262
|
+
id: z.ZodString;
|
|
263
|
+
measure: z.ZodString;
|
|
264
|
+
values: z.ZodArray<z.ZodObject<{
|
|
265
|
+
value: z.ZodString;
|
|
266
|
+
by: z.ZodString;
|
|
267
|
+
at: z.ZodISODateTime;
|
|
268
|
+
note: z.ZodOptional<z.ZodString>;
|
|
269
|
+
}, z.core.$strict>>;
|
|
270
|
+
}, z.core.$strict>;
|
|
271
|
+
export type OutcomeMeasure = z.infer<typeof OutcomeMeasure>;
|
|
272
|
+
export declare const ChangeOutcomes: z.ZodObject<{
|
|
273
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
274
|
+
change: z.ZodString;
|
|
275
|
+
measures: z.ZodArray<z.ZodObject<{
|
|
276
|
+
id: z.ZodString;
|
|
277
|
+
measure: z.ZodString;
|
|
278
|
+
values: z.ZodArray<z.ZodObject<{
|
|
279
|
+
value: z.ZodString;
|
|
280
|
+
by: z.ZodString;
|
|
281
|
+
at: z.ZodISODateTime;
|
|
282
|
+
note: z.ZodOptional<z.ZodString>;
|
|
283
|
+
}, z.core.$strict>>;
|
|
284
|
+
}, z.core.$strict>>;
|
|
285
|
+
}, z.core.$strict>;
|
|
286
|
+
export type ChangeOutcomes = z.infer<typeof ChangeOutcomes>;
|
|
287
|
+
/**
|
|
288
|
+
* catalog/baseline.yaml (ADR 0047): the as-is catalog a person accepted, the point every later
|
|
289
|
+
* scan, document and change is compared with. Written by `atticus baseline`; until it exists,
|
|
290
|
+
* Home shows the setup checklist.
|
|
291
|
+
*/
|
|
292
|
+
export declare const CatalogBaseline: z.ZodObject<{
|
|
293
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
294
|
+
acceptedBy: z.ZodString;
|
|
295
|
+
acceptedAt: z.ZodISODateTime;
|
|
296
|
+
kinds: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
297
|
+
systems: z.ZodArray<z.ZodString>;
|
|
298
|
+
note: z.ZodOptional<z.ZodString>;
|
|
299
|
+
}, z.core.$strict>;
|
|
300
|
+
export type CatalogBaseline = z.infer<typeof CatalogBaseline>;
|
|
301
|
+
/**
|
|
302
|
+
* `.atticus/metarepo.yaml` (ADR 0051), committed: which Atticus last upgraded this metarepo and
|
|
303
|
+
* the migrations it has had. An older Atticus refuses to upgrade a metarepo a newer one wrote.
|
|
304
|
+
*/
|
|
305
|
+
export declare const MetarepoStamp: z.ZodObject<{
|
|
306
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
307
|
+
atticus: z.ZodString;
|
|
308
|
+
upgradedAt: z.ZodISODateTime;
|
|
309
|
+
upgradedBy: z.ZodString;
|
|
310
|
+
migrations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
311
|
+
}, z.core.$strict>;
|
|
312
|
+
export type MetarepoStamp = z.infer<typeof MetarepoStamp>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CatalogRecord, type ParseResult } from "./catalog.js";
|
|
2
|
+
/** Recursively drop undefined values and order object keys canonically. Arrays keep their order. */
|
|
3
|
+
export declare function canonicalize(value: unknown, leading?: readonly string[]): unknown;
|
|
4
|
+
/**
|
|
5
|
+
* Canonical YAML for a record: fixed key order, two-space indent, no line folding,
|
|
6
|
+
* LF line endings and exactly one trailing newline. Serializing the parsed output
|
|
7
|
+
* again gives byte-identical text, so diffs only ever show real changes. Always written at
|
|
8
|
+
* the current schema version (a record built in memory as version 1 is the same record).
|
|
9
|
+
*/
|
|
10
|
+
export declare function serializeRecord(record: CatalogRecord): string;
|
|
11
|
+
/**
|
|
12
|
+
* Canonical YAML for any Atticus file (records, repos files, org-pack files): keys in
|
|
13
|
+
* `leading` first in that order, the rest alphabetical; same formatting as records.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toCanonicalYaml(value: unknown, leading?: readonly string[]): string;
|
|
16
|
+
/** Parse YAML text and validate it as a catalog record. Never throws. */
|
|
17
|
+
export declare function deserializeRecord(text: string): ParseResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sources.yaml moved up a version, changing nothing but the number and keeping the file's
|
|
3
|
+
* comments and order. Version 2 (ADR 0127) adds a wiki's `include` and `exclude`, and a wiki with
|
|
4
|
+
* neither reads every page, as in version 1. Version 3 (ADR 0132) adds authority, scope and the
|
|
5
|
+
* export types, and a wiki with none of them ranks as a team's and applies everywhere: what every
|
|
6
|
+
* page was before. So each step is the number only. By default every older version goes to the
|
|
7
|
+
* current one; `from` and `to` take one step (`atticus upgrade`'s sources-v2 and sources-v3).
|
|
8
|
+
*/
|
|
9
|
+
export declare function migrateSourcesText(text: string, o?: {
|
|
10
|
+
from?: number;
|
|
11
|
+
to?: number;
|
|
12
|
+
}): {
|
|
13
|
+
text: string;
|
|
14
|
+
changed: boolean;
|
|
15
|
+
};
|