@maycombhq/sdk 2.0.0-beta.22 → 2.0.0-beta.23
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/npm/core/api.d.ts +2693 -336
- package/npm/core/facts-join.d.ts +73 -1
- package/npm/core/fs.d.ts +8 -0
- package/npm/core/index.d.ts +4 -0
- package/npm/core/kept-files.d.ts +17 -0
- package/npm/core/light.d.ts +2 -0
- package/npm/core/log.d.ts +2 -0
- package/npm/core/manifest-edit.d.ts +21 -3
- package/npm/core/metarepo.d.ts +8 -0
- package/npm/core/orgpack-defaults.d.ts +3 -1
- package/npm/core/printer.d.ts +4 -0
- package/npm/core/question-owners.d.ts +4 -0
- package/npm/core/question-roles.d.ts +64 -4
- package/npm/core/questions.d.ts +14 -3
- package/npm/core/roles-migrate.d.ts +4 -3
- package/npm/core/run-log.d.ts +165 -0
- package/npm/core/schema/fact-corrections.d.ts +5 -0
- package/npm/core/schema/orgpack.d.ts +22 -6
- package/npm/core/schema/question.d.ts +55 -2
- package/npm/core/schema/scan-verify.d.ts +35 -0
- package/npm/core/setup-edit.d.ts +107 -0
- package/npm/index.js +1043 -43
- package/package.json +1 -1
|
@@ -77,20 +77,30 @@ export declare const Approver: z.ZodObject<{
|
|
|
77
77
|
* Words, not permissions: nothing is allowed or refused by team. The rest of the file stays
|
|
78
78
|
* deprecated (ADR 0073). A version-1 file is read as it is; `teams` needs version 2.
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Version 3 (ADR 0191) adds who takes each role on a change, so a new change's owners are
|
|
82
|
+
* suggested: a team's `roles` (each built-in or custom role id with the team's people who take
|
|
83
|
+
* it, for the changes on that team's repos) and the file's `defaults` (the organisation's person
|
|
84
|
+
* for a role when no team owning the change's repos names one). Both optional; a person accepts a
|
|
85
|
+
* suggestion, nothing is written by itself. A version-1 or version-2 file reads as it is.
|
|
86
|
+
*/
|
|
87
|
+
export declare const ROLES_SCHEMA_VERSION: 3;
|
|
81
88
|
export declare const Team: z.ZodObject<{
|
|
82
89
|
id: z.ZodString;
|
|
83
90
|
name: z.ZodOptional<z.ZodString>;
|
|
84
91
|
people: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
92
|
+
roles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
85
93
|
}, z.core.$strict>;
|
|
86
94
|
export type Team = z.infer<typeof Team>;
|
|
87
95
|
export declare const Roles: z.ZodObject<{
|
|
88
|
-
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
96
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
89
97
|
teams: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
90
98
|
id: z.ZodString;
|
|
91
99
|
name: z.ZodOptional<z.ZodString>;
|
|
92
100
|
people: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
101
|
+
roles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
93
102
|
}, z.core.$strict>>>;
|
|
103
|
+
defaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
94
104
|
custom: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
95
105
|
id: z.ZodString;
|
|
96
106
|
name: z.ZodString;
|
|
@@ -862,20 +872,26 @@ export declare const Runtime: z.ZodObject<{
|
|
|
862
872
|
"text-only": "text-only";
|
|
863
873
|
off: "off";
|
|
864
874
|
}>>;
|
|
865
|
-
modes: z.ZodDefault<z.ZodObject<{
|
|
875
|
+
modes: z.ZodDefault<z.ZodPipe<z.ZodObject<{
|
|
866
876
|
allowed: z.ZodArray<z.ZodEnum<{
|
|
867
877
|
model: "model";
|
|
868
878
|
"hand-off": "hand-off";
|
|
869
879
|
"headless-claude-code": "headless-claude-code";
|
|
870
880
|
"copilot-acp": "copilot-acp";
|
|
871
881
|
}>>;
|
|
872
|
-
default: z.ZodEnum<{
|
|
882
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
873
883
|
model: "model";
|
|
874
884
|
"hand-off": "hand-off";
|
|
875
885
|
"headless-claude-code": "headless-claude-code";
|
|
876
886
|
"copilot-acp": "copilot-acp";
|
|
877
|
-
}
|
|
878
|
-
}, z.core.$strict
|
|
887
|
+
}>>;
|
|
888
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
889
|
+
allowed: ("model" | "hand-off" | "headless-claude-code" | "copilot-acp")[];
|
|
890
|
+
default: "model" | "hand-off" | "headless-claude-code" | "copilot-acp";
|
|
891
|
+
}, {
|
|
892
|
+
allowed: ("model" | "hand-off" | "headless-claude-code" | "copilot-acp")[];
|
|
893
|
+
default?: "model" | "hand-off" | "headless-claude-code" | "copilot-acp" | undefined;
|
|
894
|
+
}>>>;
|
|
879
895
|
models: z.ZodDefault<z.ZodObject<{
|
|
880
896
|
allowed: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
881
897
|
recommended: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -33,7 +33,15 @@ import { z } from "zod";
|
|
|
33
33
|
* question: `askedOf` (the team or person a person's Ask routed it to) and `finding` (the gap it
|
|
34
34
|
* asks about, by change, gate, round and id). Both optional.
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Version 6 (ADR 0191, routing by what a question asks) adds two optional fields: `asks`, what the
|
|
38
|
+
* question asks (business, design or delivery), which the AI tags when it raises it and which
|
|
39
|
+
* decides the role that owns it (business → the product owner, or the business analyst from the
|
|
40
|
+
* stories on; design → the architect; delivery → the tech lead); and `routed`, a person's
|
|
41
|
+
* re-routing of it to another role (from which, by whom, when), with `role` holding the new one.
|
|
42
|
+
* Version-1 to version-5 files read as before and come back as version 6 in memory.
|
|
43
|
+
*/
|
|
44
|
+
export declare const QUESTION_SCHEMA_VERSION: 6;
|
|
37
45
|
/**
|
|
38
46
|
* ADR 0181 part 4: who owns a question on a change, by the phase that raised it. The product owner
|
|
39
47
|
* (Define), the architect (Design), the business analyst (Plan's stories) and the tech lead (Plan's
|
|
@@ -47,6 +55,31 @@ export declare const QuestionRole: z.ZodEnum<{
|
|
|
47
55
|
analysis: "analysis";
|
|
48
56
|
}>;
|
|
49
57
|
export type QuestionRole = z.infer<typeof QuestionRole>;
|
|
58
|
+
/**
|
|
59
|
+
* ADR 0191: what a question asks, by its level. `business`: what the change must do for whom (a
|
|
60
|
+
* rule, a limit, what happens when money is short); `design`: how the estate does it (a call, a
|
|
61
|
+
* timeout, a topic, a circuit breaker); `delivery`: how and when it is built and shipped (a repo, a
|
|
62
|
+
* migration's order, a test). The AI tags each question it raises; a person can re-route it.
|
|
63
|
+
*/
|
|
64
|
+
export declare const QUESTION_ASKS: readonly ["business", "design", "delivery"];
|
|
65
|
+
export declare const QuestionAsks: z.ZodEnum<{
|
|
66
|
+
business: "business";
|
|
67
|
+
delivery: "delivery";
|
|
68
|
+
design: "design";
|
|
69
|
+
}>;
|
|
70
|
+
export type QuestionAsks = z.infer<typeof QuestionAsks>;
|
|
71
|
+
/** ADR 0191: a person moved a question to another role: from which, by whom, when. */
|
|
72
|
+
export declare const QuestionRouted: z.ZodObject<{
|
|
73
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
74
|
+
product: "product";
|
|
75
|
+
architecture: "architecture";
|
|
76
|
+
delivery: "delivery";
|
|
77
|
+
analysis: "analysis";
|
|
78
|
+
}>>;
|
|
79
|
+
by: z.ZodString;
|
|
80
|
+
at: z.ZodISODateTime;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
export type QuestionRouted = z.infer<typeof QuestionRouted>;
|
|
50
83
|
/**
|
|
51
84
|
* ADR 0181: the runtimes whose runs Atticus records, so a decision can name its run: a Copilot
|
|
52
85
|
* session Atticus started (`copilot-acp`), or a hand-off run Atticus prepared for the person's
|
|
@@ -187,7 +220,7 @@ export declare const QuestionAnswer: z.ZodObject<{
|
|
|
187
220
|
}, z.core.$strict>;
|
|
188
221
|
export type QuestionAnswer = z.infer<typeof QuestionAnswer>;
|
|
189
222
|
export declare const Question: z.ZodObject<{
|
|
190
|
-
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
|
|
223
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>]>;
|
|
191
224
|
id: z.ZodString;
|
|
192
225
|
askedBy: z.ZodObject<{
|
|
193
226
|
step: z.ZodString;
|
|
@@ -223,6 +256,21 @@ export declare const Question: z.ZodObject<{
|
|
|
223
256
|
delivery: "delivery";
|
|
224
257
|
analysis: "analysis";
|
|
225
258
|
}>>;
|
|
259
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
260
|
+
business: "business";
|
|
261
|
+
delivery: "delivery";
|
|
262
|
+
design: "design";
|
|
263
|
+
}>>;
|
|
264
|
+
routed: z.ZodOptional<z.ZodObject<{
|
|
265
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
266
|
+
product: "product";
|
|
267
|
+
architecture: "architecture";
|
|
268
|
+
delivery: "delivery";
|
|
269
|
+
analysis: "analysis";
|
|
270
|
+
}>>;
|
|
271
|
+
by: z.ZodString;
|
|
272
|
+
at: z.ZodISODateTime;
|
|
273
|
+
}, z.core.$strict>>;
|
|
226
274
|
askedOf: z.ZodOptional<z.ZodString>;
|
|
227
275
|
finding: z.ZodOptional<z.ZodObject<{
|
|
228
276
|
change: z.ZodString;
|
|
@@ -362,6 +410,11 @@ export declare const QuestionDraft: z.ZodObject<{
|
|
|
362
410
|
delivery: "delivery";
|
|
363
411
|
analysis: "analysis";
|
|
364
412
|
}>>;
|
|
413
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
414
|
+
business: "business";
|
|
415
|
+
delivery: "delivery";
|
|
416
|
+
design: "design";
|
|
417
|
+
}>>;
|
|
365
418
|
sameAs: z.ZodOptional<z.ZodObject<{
|
|
366
419
|
id: z.ZodString;
|
|
367
420
|
verdict: z.ZodEnum<{
|
|
@@ -85,6 +85,11 @@ export declare const VerifyFix: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
85
85
|
delivery: "delivery";
|
|
86
86
|
analysis: "analysis";
|
|
87
87
|
}>>;
|
|
88
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
89
|
+
business: "business";
|
|
90
|
+
delivery: "delivery";
|
|
91
|
+
design: "design";
|
|
92
|
+
}>>;
|
|
88
93
|
sameAs: z.ZodOptional<z.ZodObject<{
|
|
89
94
|
id: z.ZodString;
|
|
90
95
|
verdict: z.ZodEnum<{
|
|
@@ -147,6 +152,11 @@ export declare const VerifyMissed: z.ZodObject<{
|
|
|
147
152
|
delivery: "delivery";
|
|
148
153
|
analysis: "analysis";
|
|
149
154
|
}>>;
|
|
155
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
156
|
+
business: "business";
|
|
157
|
+
delivery: "delivery";
|
|
158
|
+
design: "design";
|
|
159
|
+
}>>;
|
|
150
160
|
sameAs: z.ZodOptional<z.ZodObject<{
|
|
151
161
|
id: z.ZodString;
|
|
152
162
|
verdict: z.ZodEnum<{
|
|
@@ -219,6 +229,11 @@ export declare const VerifyWrong: z.ZodObject<{
|
|
|
219
229
|
delivery: "delivery";
|
|
220
230
|
analysis: "analysis";
|
|
221
231
|
}>>;
|
|
232
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
233
|
+
business: "business";
|
|
234
|
+
delivery: "delivery";
|
|
235
|
+
design: "design";
|
|
236
|
+
}>>;
|
|
222
237
|
sameAs: z.ZodOptional<z.ZodObject<{
|
|
223
238
|
id: z.ZodString;
|
|
224
239
|
verdict: z.ZodEnum<{
|
|
@@ -294,6 +309,11 @@ export declare const VerifyAnswer: z.ZodObject<{
|
|
|
294
309
|
delivery: "delivery";
|
|
295
310
|
analysis: "analysis";
|
|
296
311
|
}>>;
|
|
312
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
313
|
+
business: "business";
|
|
314
|
+
delivery: "delivery";
|
|
315
|
+
design: "design";
|
|
316
|
+
}>>;
|
|
297
317
|
sameAs: z.ZodOptional<z.ZodObject<{
|
|
298
318
|
id: z.ZodString;
|
|
299
319
|
verdict: z.ZodEnum<{
|
|
@@ -364,6 +384,11 @@ export declare const VerifyAnswer: z.ZodObject<{
|
|
|
364
384
|
delivery: "delivery";
|
|
365
385
|
analysis: "analysis";
|
|
366
386
|
}>>;
|
|
387
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
388
|
+
business: "business";
|
|
389
|
+
delivery: "delivery";
|
|
390
|
+
design: "design";
|
|
391
|
+
}>>;
|
|
367
392
|
sameAs: z.ZodOptional<z.ZodObject<{
|
|
368
393
|
id: z.ZodString;
|
|
369
394
|
verdict: z.ZodEnum<{
|
|
@@ -468,6 +493,11 @@ export declare const ScanVerifyProposal: z.ZodObject<{
|
|
|
468
493
|
delivery: "delivery";
|
|
469
494
|
analysis: "analysis";
|
|
470
495
|
}>>;
|
|
496
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
497
|
+
business: "business";
|
|
498
|
+
delivery: "delivery";
|
|
499
|
+
design: "design";
|
|
500
|
+
}>>;
|
|
471
501
|
sameAs: z.ZodOptional<z.ZodObject<{
|
|
472
502
|
id: z.ZodString;
|
|
473
503
|
verdict: z.ZodEnum<{
|
|
@@ -538,6 +568,11 @@ export declare const ScanVerifyProposal: z.ZodObject<{
|
|
|
538
568
|
delivery: "delivery";
|
|
539
569
|
analysis: "analysis";
|
|
540
570
|
}>>;
|
|
571
|
+
asks: z.ZodOptional<z.ZodEnum<{
|
|
572
|
+
business: "business";
|
|
573
|
+
delivery: "delivery";
|
|
574
|
+
design: "design";
|
|
575
|
+
}>>;
|
|
541
576
|
sameAs: z.ZodOptional<z.ZodObject<{
|
|
542
577
|
id: z.ZodString;
|
|
543
578
|
verdict: z.ZodEnum<{
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import { type LineChange } from "./manifest-edit.js";
|
|
3
|
+
/**
|
|
4
|
+
* ADR 0190: settings and setup are done in the app, "Edit, then Propose". Each edit writes one
|
|
5
|
+
* file of the org pack through its schema, keeping the file's comments, order and line endings,
|
|
6
|
+
* and shows the lines it changes before it writes (`preview`); Propose for review then opens the
|
|
7
|
+
* PR. Nothing here reaches a shared system, and no edit takes a secret: a setting whose name
|
|
8
|
+
* looks like one is refused by the runtime.yaml schema itself.
|
|
9
|
+
*/
|
|
10
|
+
/** runtime.yaml's outside systems the app sets up, in the order the Adapters panel shows them. */
|
|
11
|
+
export declare const ADAPTER_KINDS: readonly ["gitHost", "workTracker", "serviceDesk", "notify", "wiki", "design"];
|
|
12
|
+
export type AdapterKind = (typeof ADAPTER_KINDS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* The types runtime.yaml's schema takes for each, read from it so the two never drift (manual
|
|
15
|
+
* first: a person does the step and records the result, ADR 0032). `mock` is for tests and isn't
|
|
16
|
+
* offered; a file that has it shows it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ADAPTER_TYPES: Record<AdapterKind, readonly string[]>;
|
|
19
|
+
/**
|
|
20
|
+
* The settings Atticus itself reads for each kind (the manual adapters and the steps that name a
|
|
21
|
+
* repo on the Git host), each a value or a list. A live adapter's plugin may read more: those
|
|
22
|
+
* are written as further settings, checked by the same schema (never a secret's value).
|
|
23
|
+
*/
|
|
24
|
+
export declare const ADAPTER_FIELDS: Record<AdapterKind, readonly {
|
|
25
|
+
name: string;
|
|
26
|
+
list?: boolean;
|
|
27
|
+
}[]>;
|
|
28
|
+
export declare class SetupEditError extends Error {
|
|
29
|
+
readonly code: "invalid" | "not-found" | "exists";
|
|
30
|
+
constructor(code: "invalid" | "not-found" | "exists", message: string);
|
|
31
|
+
}
|
|
32
|
+
/** What an edit changed (or would change, with preview), file by file name. */
|
|
33
|
+
export interface FileEdit {
|
|
34
|
+
/** The file, relative to the metarepo ("/"-separated). */
|
|
35
|
+
path: string;
|
|
36
|
+
changes: LineChange[];
|
|
37
|
+
written: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** An adapter as the app sends it: its type and settings, or null to take it out. */
|
|
40
|
+
export interface AdapterValue {
|
|
41
|
+
type: string;
|
|
42
|
+
settings?: Record<string, string | number | boolean | string[]>;
|
|
43
|
+
}
|
|
44
|
+
/** The flow style a file uses (`[a]` or `[ a ]`), so a write keeps it and changes only its lines. */
|
|
45
|
+
export declare const flowPaddingOf: (text: string) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Set (or with null, take out) one outside system in runtime.yaml: `adapters.<kind>`, written as
|
|
48
|
+
* the type alone when it has no settings (`gitHost: manual`). The entry is edited in place: a
|
|
49
|
+
* setting sent as it is stays as it is (its comments, its style), one changed is that line, one
|
|
50
|
+
* left out is taken out. The whole file is checked with the Runtime schema first, so a type it
|
|
51
|
+
* doesn't take, or a setting named like a secret, is refused. With `baseSha256` (the file's
|
|
52
|
+
* sha256 as the form read it), a file changed since is refused (`exists`), never overwritten.
|
|
53
|
+
*/
|
|
54
|
+
export declare function setRuntimeAdapter(root: string, kind: AdapterKind, value: AdapterValue | null, o?: {
|
|
55
|
+
preview?: boolean;
|
|
56
|
+
baseSha256?: string;
|
|
57
|
+
}): Promise<FileEdit>;
|
|
58
|
+
/**
|
|
59
|
+
* The schema an org-pack file is read with, by its path in the org pack; none for other files.
|
|
60
|
+
* Matched in any case: on a disk that doesn't tell case apart (Windows, macOS) `Runtime.yaml` is
|
|
61
|
+
* runtime.yaml, and is checked as it.
|
|
62
|
+
*/
|
|
63
|
+
export declare function orgPackFileSchema(rel: string): z.ZodTypeAny | undefined;
|
|
64
|
+
/** A path in the org pack the raw editor may open: relative, inside it, a text file. */
|
|
65
|
+
export declare function orgPackFileRel(rel: string): string;
|
|
66
|
+
export declare const sha256Of: (text: string) => string;
|
|
67
|
+
/** An org-pack file as the raw editor shows it, with the schema it is checked with. */
|
|
68
|
+
export declare function readOrgPackFile(root: string, rel: string): Promise<{
|
|
69
|
+
path: string;
|
|
70
|
+
rel: string;
|
|
71
|
+
content: string;
|
|
72
|
+
sha256: string;
|
|
73
|
+
exists: boolean;
|
|
74
|
+
checked: boolean;
|
|
75
|
+
}>;
|
|
76
|
+
/** The problems Atticus would have reading this text as that org-pack file (empty when none). */
|
|
77
|
+
export declare function orgPackFileProblems(rel: string, content: string): string[];
|
|
78
|
+
/**
|
|
79
|
+
* The raw editor's write (the fallback for anything without a form): the file's whole text,
|
|
80
|
+
* checked with its schema, written onto the file as the person opened it (`baseSha256`, from
|
|
81
|
+
* readOrgPackFile; an edit meanwhile is refused), in the file's own line endings.
|
|
82
|
+
*/
|
|
83
|
+
export declare function writeOrgPackFile(root: string, rel: string, content: string, o: {
|
|
84
|
+
baseSha256: string;
|
|
85
|
+
preview?: boolean;
|
|
86
|
+
}): Promise<FileEdit>;
|
|
87
|
+
/** An integration pattern as the app's form gives it (patterns/<code>.yaml). */
|
|
88
|
+
export interface PatternInput {
|
|
89
|
+
code: string;
|
|
90
|
+
name: string;
|
|
91
|
+
definition: string;
|
|
92
|
+
interaction: string;
|
|
93
|
+
route: string;
|
|
94
|
+
targetType: string;
|
|
95
|
+
controls?: string[];
|
|
96
|
+
source: string;
|
|
97
|
+
version?: string;
|
|
98
|
+
status?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A new integration pattern from the form, as its own file `patterns/<code>.yaml` (the shape the
|
|
102
|
+
* starter pack's patterns have), checked with the pattern schema. A code already there is refused:
|
|
103
|
+
* an existing pattern is edited in the raw editor.
|
|
104
|
+
*/
|
|
105
|
+
export declare function addPattern(root: string, p: PatternInput, o?: {
|
|
106
|
+
preview?: boolean;
|
|
107
|
+
}): Promise<FileEdit>;
|