@maycombhq/sdk 2.0.0-beta.28 → 2.0.0-beta.28.1
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 +158 -1
- package/npm/core/cancel.d.ts +7 -0
- package/npm/core/declared-links.d.ts +33 -0
- package/npm/core/facts-join.d.ts +14 -0
- package/npm/core/fs.d.ts +7 -0
- package/npm/core/link-candidates.d.ts +50 -1
- package/npm/core/printer.d.ts +16 -2
- package/npm/core/record-cache.d.ts +10 -0
- package/npm/index.js +82 -12
- package/package.json +1 -1
package/npm/core/api.d.ts
CHANGED
|
@@ -576,8 +576,32 @@ import { z } from "zod";
|
|
|
576
576
|
* `problems` by place, nothing written), writes them, then builds once, as one local job whose
|
|
577
577
|
* result is `MapEditsResult` (with the caller repos they touch). A problem may carry
|
|
578
578
|
* `problems`. Additive only.
|
|
579
|
+
* 3.14.0 (beta.28.1, "nothing slow runs silently"): the Connect panel's read and its preview as
|
|
580
|
+
* jobs. GET /api/links/candidates with `job=1` and POST /api/links/connect with `job: true`
|
|
581
|
+
* answer 202 JobAccepted at once; the job prints each step (its progress message is the last
|
|
582
|
+
* line it said), Stop (POST /api/jobs/{jobId}/cancel) ends it between steps, and its result's
|
|
583
|
+
* `answer` is the answer the request gives without `job` (or `problem`, refused). Without
|
|
584
|
+
* `job`, both answer as before. GET /api/facts/{repo}/preview takes `job=1` the same way (the
|
|
585
|
+
* panel after a correction). Additive only.
|
|
586
|
+
* Also in 3.14.0 (beta.28.1, field report 4): connecting two boxes never dead-ends. GET
|
|
587
|
+
* /api/links/candidates lists every call of A: one that has an arrow drawn is `joined` (with
|
|
588
|
+
* `joins`, the box it goes to), to move from the same panel; one the join ties to something no
|
|
589
|
+
* arrow is drawn for is `undrawn`, as loose as one that joins nothing; one placed outside to a
|
|
590
|
+
* target no box draws is listed `outside` with `joins`, where before it was left out; one with
|
|
591
|
+
* an arrow to this very box is `here` (`now`, its API: a pairing with that API is refused,
|
|
592
|
+
* 409); one a person paired with the box it goes to says who (`pairedBy`). POST
|
|
593
|
+
* /api/declared-links (and Edit the map's adds) from a box no System of the profiles is (a repo
|
|
594
|
+
* the manifest lists with no System) adds that System to the repo's profile first, and says so
|
|
595
|
+
* (`created`), and Undo of its last declaration takes that System away again (`removed`).
|
|
596
|
+
* Additive only.
|
|
597
|
+
* Also in 3.14.0 (beta.28.1, field report 5): Apply (POST /api/facts/{repo}/apply) writes the kept facts
|
|
598
|
+
* with the rejected ones left out (`verify --write` exit 3): its job ends done, code 0, and
|
|
599
|
+
* its result (`FactsApplyResult`) carries `leftOut`, how many facts were left out, beside the
|
|
600
|
+
* lines naming each with the file to fix it in. Additive only. Apply to every repo (POST
|
|
601
|
+
* /api/facts/apply-all) the same: a repo that wrote with facts left out is applied, and its
|
|
602
|
+
* result carries `leftOut` (all repos) and `leftOutRepos` (how many repos left some out).
|
|
579
603
|
*/
|
|
580
|
-
export declare const API_VERSION = "3.
|
|
604
|
+
export declare const API_VERSION = "3.14.0";
|
|
581
605
|
export declare const DEFAULT_PORT = 4321;
|
|
582
606
|
/** RFC 9457 problem details, used for every error. */
|
|
583
607
|
/**
|
|
@@ -4980,6 +5004,107 @@ export declare const MapEditsResult: z.ZodObject<{
|
|
|
4980
5004
|
}, z.core.$strip>>;
|
|
4981
5005
|
}, z.core.$strip>;
|
|
4982
5006
|
export type MapEditsResultT = z.infer<typeof MapEditsResult>;
|
|
5007
|
+
/**
|
|
5008
|
+
* 3.14.0: the result of POST /api/facts/{repo}/apply's job (GET /api/jobs/{id}'s `result`): its
|
|
5009
|
+
* code and the lines verify printed; `refused`, the listing of a build that waits for a confirm;
|
|
5010
|
+
* `leftOut` (beta.28.1), how many rejected facts the write left out (the lines name each); `next`,
|
|
5011
|
+
* a step to take first (Sync the repos).
|
|
5012
|
+
*/
|
|
5013
|
+
export declare const FactsApplyResult: z.ZodObject<{
|
|
5014
|
+
code: z.ZodNumber;
|
|
5015
|
+
lines: z.ZodArray<z.ZodString>;
|
|
5016
|
+
refused: z.ZodOptional<z.ZodObject<{
|
|
5017
|
+
reasons: z.ZodArray<z.ZodEnum<{
|
|
5018
|
+
"nothing-read": "nothing-read";
|
|
5019
|
+
empty: "empty";
|
|
5020
|
+
"unexplained-removals": "unexplained-removals";
|
|
5021
|
+
"large-removals": "large-removals";
|
|
5022
|
+
"hand-edits": "hand-edits";
|
|
5023
|
+
"not-upgraded": "not-upgraded";
|
|
5024
|
+
}>>;
|
|
5025
|
+
message: z.ZodString;
|
|
5026
|
+
removals: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5027
|
+
path: z.ZodString;
|
|
5028
|
+
kind: z.ZodString;
|
|
5029
|
+
id: z.ZodString;
|
|
5030
|
+
repos: z.ZodArray<z.ZodString>;
|
|
5031
|
+
explainedBy: z.ZodArray<z.ZodString>;
|
|
5032
|
+
reasons: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
5033
|
+
input: "input";
|
|
5034
|
+
build: "build";
|
|
5035
|
+
archived: "archived";
|
|
5036
|
+
manifest: "manifest";
|
|
5037
|
+
curated: "curated";
|
|
5038
|
+
slot: "slot";
|
|
5039
|
+
}>>>;
|
|
5040
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5041
|
+
what: z.ZodEnum<{
|
|
5042
|
+
other: "other";
|
|
5043
|
+
inputs: "inputs";
|
|
5044
|
+
"org-pack": "org-pack";
|
|
5045
|
+
proposals: "proposals";
|
|
5046
|
+
shared: "shared";
|
|
5047
|
+
answers: "answers";
|
|
5048
|
+
pairings: "pairings";
|
|
5049
|
+
curated: "curated";
|
|
5050
|
+
traffic: "traffic";
|
|
5051
|
+
federated: "federated";
|
|
5052
|
+
}>;
|
|
5053
|
+
path: z.ZodString;
|
|
5054
|
+
}, z.core.$strip>>>;
|
|
5055
|
+
}, z.core.$strip>>>;
|
|
5056
|
+
unexplained: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5057
|
+
path: z.ZodString;
|
|
5058
|
+
kind: z.ZodString;
|
|
5059
|
+
id: z.ZodString;
|
|
5060
|
+
repos: z.ZodArray<z.ZodString>;
|
|
5061
|
+
explainedBy: z.ZodArray<z.ZodString>;
|
|
5062
|
+
reasons: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
5063
|
+
input: "input";
|
|
5064
|
+
build: "build";
|
|
5065
|
+
archived: "archived";
|
|
5066
|
+
manifest: "manifest";
|
|
5067
|
+
curated: "curated";
|
|
5068
|
+
slot: "slot";
|
|
5069
|
+
}>>>;
|
|
5070
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5071
|
+
what: z.ZodEnum<{
|
|
5072
|
+
other: "other";
|
|
5073
|
+
inputs: "inputs";
|
|
5074
|
+
"org-pack": "org-pack";
|
|
5075
|
+
proposals: "proposals";
|
|
5076
|
+
shared: "shared";
|
|
5077
|
+
answers: "answers";
|
|
5078
|
+
pairings: "pairings";
|
|
5079
|
+
curated: "curated";
|
|
5080
|
+
traffic: "traffic";
|
|
5081
|
+
federated: "federated";
|
|
5082
|
+
}>;
|
|
5083
|
+
path: z.ZodString;
|
|
5084
|
+
}, z.core.$strip>>>;
|
|
5085
|
+
}, z.core.$strip>>>;
|
|
5086
|
+
allowRemovals: z.ZodOptional<z.ZodNumber>;
|
|
5087
|
+
edits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5088
|
+
path: z.ZodString;
|
|
5089
|
+
how: z.ZodEnum<{
|
|
5090
|
+
added: "added";
|
|
5091
|
+
changed: "changed";
|
|
5092
|
+
deleted: "deleted";
|
|
5093
|
+
}>;
|
|
5094
|
+
}, z.core.$strip>>>;
|
|
5095
|
+
discardEdits: z.ZodOptional<z.ZodNumber>;
|
|
5096
|
+
unread: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5097
|
+
repo: z.ZodString;
|
|
5098
|
+
why: z.ZodString;
|
|
5099
|
+
}, z.core.$strip>>>;
|
|
5100
|
+
command: z.ZodString;
|
|
5101
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
5102
|
+
}, z.core.$strip>>;
|
|
5103
|
+
leftOut: z.ZodOptional<z.ZodNumber>;
|
|
5104
|
+
leftOutRepos: z.ZodOptional<z.ZodNumber>;
|
|
5105
|
+
next: z.ZodOptional<z.ZodUnknown>;
|
|
5106
|
+
}, z.core.$strip>;
|
|
5107
|
+
export type FactsApplyResultT = z.infer<typeof FactsApplyResult>;
|
|
4983
5108
|
/**
|
|
4984
5109
|
* 3.12.0 (ADR 0195 point 6): GET /api/build/upgrade, the upgrade to source slots as a dry run,
|
|
4985
5110
|
* exactly what `atticus upgrade --json` lists under `slots`: every file `atticus upgrade --yes`
|
|
@@ -6243,6 +6368,17 @@ export declare const VerifyPreviewView: z.ZodObject<{
|
|
|
6243
6368
|
head: z.ZodString;
|
|
6244
6369
|
commit: z.ZodString;
|
|
6245
6370
|
}, z.core.$strip>>;
|
|
6371
|
+
confirm: z.ZodOptional<z.ZodObject<{
|
|
6372
|
+
removals: z.ZodOptional<z.ZodNumber>;
|
|
6373
|
+
edits: z.ZodOptional<z.ZodNumber>;
|
|
6374
|
+
refused: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
6375
|
+
"nothing-read": "nothing-read";
|
|
6376
|
+
empty: "empty";
|
|
6377
|
+
"unexplained-removals": "unexplained-removals";
|
|
6378
|
+
}>>>;
|
|
6379
|
+
upgrade: z.ZodOptional<z.ZodLiteral<true>>;
|
|
6380
|
+
command: z.ZodOptional<z.ZodString>;
|
|
6381
|
+
}, z.core.$strip>>;
|
|
6246
6382
|
staleCorrections: z.ZodArray<z.ZodString>;
|
|
6247
6383
|
}, z.core.$strip>>;
|
|
6248
6384
|
unavailable: z.ZodOptional<z.ZodEnum<{
|
|
@@ -13484,10 +13620,16 @@ export declare const CandidateCallView: z.ZodObject<{
|
|
|
13484
13620
|
outside: "outside";
|
|
13485
13621
|
left: "left";
|
|
13486
13622
|
missed: "missed";
|
|
13623
|
+
joined: "joined";
|
|
13487
13624
|
unresolved: "unresolved";
|
|
13625
|
+
undrawn: "undrawn";
|
|
13626
|
+
here: "here";
|
|
13488
13627
|
}>;
|
|
13489
13628
|
why: z.ZodOptional<z.ZodString>;
|
|
13490
13629
|
paired: z.ZodOptional<z.ZodString>;
|
|
13630
|
+
joins: z.ZodOptional<z.ZodString>;
|
|
13631
|
+
now: z.ZodOptional<z.ZodString>;
|
|
13632
|
+
pairedBy: z.ZodOptional<z.ZodString>;
|
|
13491
13633
|
suggestion: z.ZodOptional<z.ZodObject<{
|
|
13492
13634
|
api: z.ZodString;
|
|
13493
13635
|
score: z.ZodNumber;
|
|
@@ -13548,10 +13690,16 @@ export declare const LinkCandidatesView: z.ZodObject<{
|
|
|
13548
13690
|
outside: "outside";
|
|
13549
13691
|
left: "left";
|
|
13550
13692
|
missed: "missed";
|
|
13693
|
+
joined: "joined";
|
|
13551
13694
|
unresolved: "unresolved";
|
|
13695
|
+
undrawn: "undrawn";
|
|
13696
|
+
here: "here";
|
|
13552
13697
|
}>;
|
|
13553
13698
|
why: z.ZodOptional<z.ZodString>;
|
|
13554
13699
|
paired: z.ZodOptional<z.ZodString>;
|
|
13700
|
+
joins: z.ZodOptional<z.ZodString>;
|
|
13701
|
+
now: z.ZodOptional<z.ZodString>;
|
|
13702
|
+
pairedBy: z.ZodOptional<z.ZodString>;
|
|
13555
13703
|
suggestion: z.ZodOptional<z.ZodObject<{
|
|
13556
13704
|
api: z.ZodString;
|
|
13557
13705
|
score: z.ZodNumber;
|
|
@@ -14292,6 +14440,7 @@ export declare const ConnectLinksRequest: z.ZodObject<{
|
|
|
14292
14440
|
}, z.core.$strip>>>;
|
|
14293
14441
|
rule: z.ZodOptional<z.ZodBoolean>;
|
|
14294
14442
|
preview: z.ZodOptional<z.ZodBoolean>;
|
|
14443
|
+
job: z.ZodOptional<z.ZodBoolean>;
|
|
14295
14444
|
}, z.core.$strip>;
|
|
14296
14445
|
export declare const ConnectLinksResult: z.ZodObject<{
|
|
14297
14446
|
written: z.ZodBoolean;
|
|
@@ -14376,6 +14525,14 @@ export declare const FileChangeResult: z.ZodObject<{
|
|
|
14376
14525
|
}, z.core.$strip>>;
|
|
14377
14526
|
verify: z.ZodString;
|
|
14378
14527
|
commit: z.ZodString;
|
|
14528
|
+
created: z.ZodOptional<z.ZodObject<{
|
|
14529
|
+
system: z.ZodString;
|
|
14530
|
+
file: z.ZodString;
|
|
14531
|
+
}, z.core.$strip>>;
|
|
14532
|
+
removed: z.ZodOptional<z.ZodObject<{
|
|
14533
|
+
system: z.ZodString;
|
|
14534
|
+
file: z.ZodString;
|
|
14535
|
+
}, z.core.$strip>>;
|
|
14379
14536
|
}, z.core.$strip>;
|
|
14380
14537
|
/**
|
|
14381
14538
|
* ADR 0179: a stroke drawn on the canvas for a change (a call, a topic, a table, a step removed
|
package/npm/core/cancel.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ export declare class CancelledError extends Error {
|
|
|
3
3
|
}
|
|
4
4
|
/** Run `fn` with `signal` as the signal of everything it starts. */
|
|
5
5
|
export declare function withSignal<T>(signal: AbortSignal, fn: () => Promise<T>): Promise<T>;
|
|
6
|
+
/** Run `fn` with `commit` as what `commitCurrent()` inside it calls. */
|
|
7
|
+
export declare function withCommit<T>(commit: () => void, fn: () => Promise<T>): Promise<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Say the job this code runs in has started writing: Stop is no longer heard. True when a job
|
|
10
|
+
* heard it (it says a late Stop itself); false outside one.
|
|
11
|
+
*/
|
|
12
|
+
export declare function commitCurrent(): boolean;
|
|
6
13
|
/** The signal of the job this code runs in, if it runs in one. */
|
|
7
14
|
export declare function currentSignal(): AbortSignal | undefined;
|
|
8
15
|
/** Stop here when the job was cancelled. */
|
|
@@ -31,6 +31,12 @@ export declare class DeclareError extends Error {
|
|
|
31
31
|
readonly code: "not-found" | "invalid" | "exists";
|
|
32
32
|
constructor(code: "not-found" | "invalid" | "exists", message: string);
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* The re-review of beta.28.1: a short hash of the System as the canvas added it, in its comment,
|
|
36
|
+
* so Undo takes it away only while it is still exactly that (no field a person changed since).
|
|
37
|
+
*/
|
|
38
|
+
export declare const addedHash: (s: Record<string, unknown>) => string;
|
|
39
|
+
export declare const addedComment: (by: string, at: string, hash: string) => string;
|
|
34
40
|
/** The comment a declaration carries: which side, who and when. */
|
|
35
41
|
export declare const declaredComment: (by: string, at: string, side?: "publishes" | "listens") => string;
|
|
36
42
|
/**
|
|
@@ -41,6 +47,17 @@ export declare function declareLink(root: string, d: Declared, o: {
|
|
|
41
47
|
by: string;
|
|
42
48
|
at: string;
|
|
43
49
|
preview?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Beta.28.1 (field report 4): a system no profile has yet, which the canvas draws for a repo
|
|
52
|
+
* the manifest lists with no System of the profiles (the box takes the repo's id, or the
|
|
53
|
+
* manifest's `system`): added to its platform's profile in the same write, so a person
|
|
54
|
+
* declaring a link from that box never has to make the System first.
|
|
55
|
+
*/
|
|
56
|
+
create?: {
|
|
57
|
+
platform: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
owner?: string;
|
|
60
|
+
};
|
|
44
61
|
}): Promise<{
|
|
45
62
|
rel: string;
|
|
46
63
|
changes: LineChange[];
|
|
@@ -49,7 +66,18 @@ export declare function declareLink(root: string, d: Declared, o: {
|
|
|
49
66
|
before: string;
|
|
50
67
|
/** The bytes it wrote (what a take-back expects to find). */
|
|
51
68
|
wrote?: string;
|
|
69
|
+
/** Beta.28.1: the system added to the profile first (`create`), when it had none. */
|
|
70
|
+
created?: string;
|
|
52
71
|
}>;
|
|
72
|
+
/**
|
|
73
|
+
* Beta.28.1 (field hunt G5): `after`, a whole document as the yaml library writes it, with every
|
|
74
|
+
* line it has unchanged from `before` (the file as written, LF) given back as `before` wrote it:
|
|
75
|
+
* a flow list's padding (`[dv, qa, prod]`), its quotes, its spacing. `before` as the library
|
|
76
|
+
* writes it is lined up with `before` line for line (the library keeps the lines and comments of
|
|
77
|
+
* a document it only reads); a line of `after` that is one of those, in order, is that line of
|
|
78
|
+
* `before`. Where the two don't line up (the library joined or split a line), `after` as it is.
|
|
79
|
+
*/
|
|
80
|
+
export declare function keepUntouchedLines(written: string, after: string): string;
|
|
53
81
|
/**
|
|
54
82
|
* Undo: remove a declared topic or call from the system's list, exactly that one. Beta.28 (the
|
|
55
83
|
* review of Edit the map): only that item's lines go (and the list's key when it was the last),
|
|
@@ -59,11 +87,16 @@ export declare function undeclareLink(root: string, d: {
|
|
|
59
87
|
kind: "topic" | "call";
|
|
60
88
|
system: string;
|
|
61
89
|
value: string;
|
|
90
|
+
}, o?: {
|
|
91
|
+
/** A pairing or an answer names the system: a System the canvas added for it stays. */
|
|
92
|
+
inUse?: boolean;
|
|
62
93
|
}): Promise<{
|
|
63
94
|
rel: string;
|
|
64
95
|
changes: LineChange[];
|
|
65
96
|
before: string;
|
|
66
97
|
wrote: string;
|
|
98
|
+
/** S3: the System the canvas added, taken away with its last declaration. */
|
|
99
|
+
removed?: string;
|
|
67
100
|
}>;
|
|
68
101
|
/** A system's declarations, with who and when where the canvas wrote them. */
|
|
69
102
|
export declare function declaredOf(root: string, system: string): Promise<{
|
package/npm/core/facts-join.d.ts
CHANGED
|
@@ -608,6 +608,20 @@ export declare function keyRefIn(s: string | undefined): {
|
|
|
608
608
|
} | undefined;
|
|
609
609
|
/** Join every call of the estate's facts to the entry that serves it, or say why not. */
|
|
610
610
|
export declare function joinFacts(input: JoinFactsInput): FactsJoinResult;
|
|
611
|
+
/**
|
|
612
|
+
* Beta.28.1 (the review of "nothing slow runs silently"): joinFacts, giving way every
|
|
613
|
+
* JOIN_YIELD_EVERY calls, so a caller that awaits `tick` between (joinFactsAsync) lets a
|
|
614
|
+
* heartbeat, a Console line or a Stop through during a long join. The same join either way.
|
|
615
|
+
*/
|
|
616
|
+
export declare function joinFactsAsync(input: JoinFactsInput, tick: () => Promise<void>): Promise<FactsJoinResult>;
|
|
617
|
+
/** How many calls the join reads between two points where it gives way. */
|
|
618
|
+
export declare const JOIN_YIELD_EVERY = 200;
|
|
619
|
+
/** Work written as steps (a generator that yields where it may give way), run to its end. */
|
|
620
|
+
export declare function runSteps<T>(g: Generator<void, T, void>): T;
|
|
621
|
+
/** The same, awaiting `tick` at each point it may give way. */
|
|
622
|
+
export declare function runStepsAsync<T>(g: Generator<void, T, void>, tick: () => Promise<void>): Promise<T>;
|
|
623
|
+
/** joinFacts as steps: see joinFactsAsync. */
|
|
624
|
+
export declare function joinFactsSteps(input: JoinFactsInput): Generator<void, FactsJoinResult, void>;
|
|
611
625
|
/** The path a joined Interface records: the entry's, normalised (a gRPC or SOAP name as written). */
|
|
612
626
|
export declare function servedPath(e: Entry): string;
|
|
613
627
|
/** A gateway route's GatewayRoute id: `gw-<component>-<method>-<path>`, no dots (as a hop names one). */
|
package/npm/core/fs.d.ts
CHANGED
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
* it is retried a few times before giving up.
|
|
7
7
|
*/
|
|
8
8
|
export declare function writeFileAtomic(path: string, data: string | Uint8Array): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Copy a file the way `writeFileAtomic` writes one: to a temporary file beside the target, then
|
|
11
|
+
* renamed over it. The copy is made by the system (a copy-on-write clone where the file system
|
|
12
|
+
* has them, APFS, Btrfs or XFS; else a copy in the kernel), so the bytes never pass through
|
|
13
|
+
* JavaScript (beta.28.1: a 60-repo estate's build.json is 180 MB).
|
|
14
|
+
*/
|
|
15
|
+
export declare function copyFileAtomic(from: string, path: string): Promise<void>;
|
|
9
16
|
/** A file changed on disk between being read and being written back: nothing was written. */
|
|
10
17
|
export declare class FileChangedError extends Error {
|
|
11
18
|
readonly path: string;
|
|
@@ -8,7 +8,23 @@ import type { Fact } from "./schema/facts.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export type LooseStatus = "asked" | "missed" | "left" | "outside" | "unresolved"
|
|
10
10
|
/** Already paired by a person with an API of this box. */
|
|
11
|
-
| "paired"
|
|
11
|
+
| "paired"
|
|
12
|
+
/**
|
|
13
|
+
* Beta.28.1: the join ties it to another box (or this one) and an arrow is drawn for it:
|
|
14
|
+
* listed so it can be moved here from the same panel, never ticked unseen.
|
|
15
|
+
*/
|
|
16
|
+
| "joined"
|
|
17
|
+
/**
|
|
18
|
+
* Beta.28.1: the join ties it to something, and no arrow is drawn for it (its own component,
|
|
19
|
+
* or no Interface of it on the canvas): as loose as a call that joins nothing.
|
|
20
|
+
*/
|
|
21
|
+
| "undrawn"
|
|
22
|
+
/**
|
|
23
|
+
* The review of beta.28.1 (S2): the join ties it to this very box and an arrow is drawn for it
|
|
24
|
+
* (`now` the API it goes to): it goes here already, so nothing is suggested for it, and a
|
|
25
|
+
* pairing with the API it goes to would be a redundant line (refused).
|
|
26
|
+
*/
|
|
27
|
+
| "here";
|
|
12
28
|
export interface CandidateApi {
|
|
13
29
|
/** The entry's fact id, or the operation's id in the spec. */
|
|
14
30
|
id: string;
|
|
@@ -33,6 +49,18 @@ export interface CandidateCall {
|
|
|
33
49
|
why?: string;
|
|
34
50
|
/** For paired: the API it is paired with. */
|
|
35
51
|
paired?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Beta.28.1: the box the join ties it to now (a repo, or an outside target), for a call that
|
|
54
|
+
* is joined, undrawn or outside: where it goes, or would go, before it is moved.
|
|
55
|
+
*/
|
|
56
|
+
joins?: string;
|
|
57
|
+
/** For here: the API of this box it goes to now (an entry's fact id), when the join names one. */
|
|
58
|
+
now?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The review of beta.28.1 (N3): who paired it with the box it goes to now (another box): a
|
|
61
|
+
* pairing here replaces that person's word, which the panel says before it is written.
|
|
62
|
+
*/
|
|
63
|
+
pairedBy?: string;
|
|
36
64
|
suggestion?: {
|
|
37
65
|
api: string;
|
|
38
66
|
score: number;
|
|
@@ -100,4 +128,25 @@ export declare function linkCandidates(o: {
|
|
|
100
128
|
};
|
|
101
129
|
/** A's settings by key (its config facts with a value), to fill a call's `${key}` in. */
|
|
102
130
|
settings?: Readonly<Record<string, string>>;
|
|
131
|
+
/**
|
|
132
|
+
* Beta.28.1: whether the canvas draws a join's arrow (its Interface is in the catalog). A join
|
|
133
|
+
* of a call to its own component is never drawn, whatever this says. Default: every other is.
|
|
134
|
+
*/
|
|
135
|
+
drawn?: (j: FactsJoinResult["joins"][number]) => boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Beta.28.1: whether the canvas draws a call placed outside the estate to this target (an
|
|
138
|
+
* outside system of the profile takes it). Default: none is, so the call is listed loose.
|
|
139
|
+
*/
|
|
140
|
+
drawnOutside?: (target: string, call: string) => boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Whether a repo, a component or a system is drawn in the box connected to (a repo's own id,
|
|
143
|
+
* its components; a system's repos and their components). Default: the box's own id only.
|
|
144
|
+
*/
|
|
145
|
+
inBox?: (name: string) => boolean;
|
|
146
|
+
/**
|
|
147
|
+
* The review of beta.28.1 (S4): the box the built catalog draws a call's arrow to (an
|
|
148
|
+
* Interface current in it citing the call's line), for a call the join doesn't place: the
|
|
149
|
+
* canvas is what the person sees, so a drawn call is never listed as loose.
|
|
150
|
+
*/
|
|
151
|
+
drawnTo?: (call: string) => string | undefined;
|
|
103
152
|
}): LinkCandidates;
|
package/npm/core/printer.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR 0187: where a line printed by a command goes besides its own output, while it runs inside
|
|
3
|
+
* the app's job. The job (in the server) sets the printer; the command line's `main`, and the
|
|
4
|
+
* app's routes that run a command's code, pass each line they print to `printToCurrent`. Outside
|
|
5
|
+
* a job there is no printer and nothing happens. No schema here: the command line loads it first.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Beta.28.1: how a line is printed. `now`: a progress line (a step of long work), sent to the
|
|
9
|
+
* Console at once rather than in the next batch of lines, so it is there before the step's work
|
|
10
|
+
* keeps the thread.
|
|
11
|
+
*/
|
|
12
|
+
export interface PrintOptions {
|
|
13
|
+
now?: boolean;
|
|
14
|
+
}
|
|
1
15
|
/** Run `work` with every line printed inside it (at any depth, across awaits) going to `print`. */
|
|
2
|
-
export declare function withPrinter<T>(print: (line: string) => void, work: () => T): T;
|
|
16
|
+
export declare function withPrinter<T>(print: (line: string, o?: PrintOptions) => void, work: () => T): T;
|
|
3
17
|
/** Print a line to the job this code runs in, if any. */
|
|
4
|
-
export declare function printToCurrent(line: string): void;
|
|
18
|
+
export declare function printToCurrent(line: string, o?: PrintOptions): void;
|
|
@@ -23,6 +23,9 @@ export interface Parsed<T> {
|
|
|
23
23
|
rel: string;
|
|
24
24
|
value?: T;
|
|
25
25
|
problem?: string;
|
|
26
|
+
/** With `withStats`: the file's size and time (ms, floored) as this read found them (-1: none). */
|
|
27
|
+
size?: number;
|
|
28
|
+
mtimeMs?: number;
|
|
26
29
|
}
|
|
27
30
|
/** What a caller's parse says about one file. */
|
|
28
31
|
export type ParseOutcome<T> = {
|
|
@@ -49,4 +52,11 @@ export declare function readParsedFiles<T>(o: {
|
|
|
49
52
|
parse: (text: string, rel: string) => ParseOutcome<T>;
|
|
50
53
|
/** The root of the metarepo this run is working in; none means no cache (read-only). */
|
|
51
54
|
cacheRoot?: string;
|
|
55
|
+
/**
|
|
56
|
+
* False: the parses kept under `cacheRoot` are read, and nothing is written there (a preview,
|
|
57
|
+
* which writes nothing: beta.28.1, it parsed a 100,000-record catalog from its files).
|
|
58
|
+
*/
|
|
59
|
+
keep?: boolean;
|
|
60
|
+
/** Each file's size and time with its parse (beta.28.1: a write matches them to its own read). */
|
|
61
|
+
withStats?: boolean;
|
|
52
62
|
}): Promise<Parsed<T>[]>;
|
package/npm/index.js
CHANGED
|
@@ -7201,6 +7201,15 @@ var MapEditsResult = z31.object({
|
|
|
7201
7201
|
*/
|
|
7202
7202
|
refused: BuildRefusalView.optional()
|
|
7203
7203
|
});
|
|
7204
|
+
var FactsApplyResult = z31.object({
|
|
7205
|
+
code: z31.number().int(),
|
|
7206
|
+
lines: z31.array(z31.string()),
|
|
7207
|
+
refused: BuildRefusalView.optional(),
|
|
7208
|
+
leftOut: z31.number().int().positive().optional(),
|
|
7209
|
+
/** Apply to every repo's (POST /api/facts/apply-all): how many repos left facts out. */
|
|
7210
|
+
leftOutRepos: z31.number().int().positive().optional(),
|
|
7211
|
+
next: z31.unknown().optional()
|
|
7212
|
+
});
|
|
7204
7213
|
var CatalogUpgradeView = z31.object({
|
|
7205
7214
|
pending: z31.boolean(),
|
|
7206
7215
|
records: z31.number().int(),
|
|
@@ -7616,6 +7625,22 @@ var VerifyPreviewView = z31.object({
|
|
|
7616
7625
|
}).optional(),
|
|
7617
7626
|
/** The checkout's HEAD is past the facts' commit: verify reads the changed files' facts again. */
|
|
7618
7627
|
headMoved: z31.object({ head: z31.string(), commit: z31.string() }).optional(),
|
|
7628
|
+
/**
|
|
7629
|
+
* 3.14.0 (beta.28.1): what the Apply's guards will say (ADR 0195 point 4), absent when it
|
|
7630
|
+
* writes without a word. It waits for a person's confirm when its build removes more than
|
|
7631
|
+
* the guard's limit (`removals`, how many it lists) or files under catalog/generated were
|
|
7632
|
+
* changed by hand (`edits`, how many), with the command that confirms exactly them; it
|
|
7633
|
+
* refuses whatever is confirmed when `refused` lists reasons (removals nothing explains,
|
|
7634
|
+
* an empty build, nothing read), and no command is given; on a catalog from before the
|
|
7635
|
+
* slots (`upgrade`) the command is `atticus upgrade`.
|
|
7636
|
+
*/
|
|
7637
|
+
confirm: z31.object({
|
|
7638
|
+
removals: z31.number().int().optional(),
|
|
7639
|
+
edits: z31.number().int().optional(),
|
|
7640
|
+
refused: z31.array(z31.enum(["nothing-read", "empty", "unexplained-removals"])).optional(),
|
|
7641
|
+
upgrade: z31.literal(true).optional(),
|
|
7642
|
+
command: z31.string().optional()
|
|
7643
|
+
}).optional(),
|
|
7619
7644
|
/** Corrections on file that meet no fact in this read (kept, applied when it is read again). */
|
|
7620
7645
|
staleCorrections: z31.array(z31.string())
|
|
7621
7646
|
}).optional(),
|
|
@@ -9556,9 +9581,30 @@ var CandidateCallView = z31.object({
|
|
|
9556
9581
|
method: z31.string().optional(),
|
|
9557
9582
|
path: z31.string(),
|
|
9558
9583
|
at: z31.string(),
|
|
9559
|
-
|
|
9584
|
+
/**
|
|
9585
|
+
* 3.14: `joined`, a call with an arrow drawn already, listed so it can be moved to this box;
|
|
9586
|
+
* `undrawn`, a call the join ties to something no arrow is drawn for, as loose as any;
|
|
9587
|
+
* `here`, a call with an arrow to this very box (`now` its API), never suggested again.
|
|
9588
|
+
*/
|
|
9589
|
+
status: z31.enum([
|
|
9590
|
+
"asked",
|
|
9591
|
+
"missed",
|
|
9592
|
+
"left",
|
|
9593
|
+
"outside",
|
|
9594
|
+
"unresolved",
|
|
9595
|
+
"paired",
|
|
9596
|
+
"joined",
|
|
9597
|
+
"undrawn",
|
|
9598
|
+
"here"
|
|
9599
|
+
]),
|
|
9560
9600
|
why: z31.string().optional(),
|
|
9561
9601
|
paired: z31.string().optional(),
|
|
9602
|
+
/** 3.14: the box the call goes to now (a repo, or an outside target), before it is moved. */
|
|
9603
|
+
joins: z31.string().optional(),
|
|
9604
|
+
/** 3.14: for `here`, the API of this box the call goes to now. */
|
|
9605
|
+
now: z31.string().optional(),
|
|
9606
|
+
/** 3.14: who paired the call with the box it goes to now, when a person did. */
|
|
9607
|
+
pairedBy: z31.string().optional(),
|
|
9562
9608
|
suggestion: CandidateSuggestion.optional(),
|
|
9563
9609
|
/** 2.57: the APIs it most likely is, best first, at most three. */
|
|
9564
9610
|
suggestions: z31.array(CandidateSuggestion).max(3).optional(),
|
|
@@ -10003,7 +10049,12 @@ var ConnectLinksRequest = z31.object({
|
|
|
10003
10049
|
/** Answer A's open target question with /** to B, so calls read later follow it too. */
|
|
10004
10050
|
rule: z31.boolean().optional(),
|
|
10005
10051
|
/** Say what it would write and what the next verify --write changes; write nothing. */
|
|
10006
|
-
preview: z31.boolean().optional()
|
|
10052
|
+
preview: z31.boolean().optional(),
|
|
10053
|
+
/**
|
|
10054
|
+
* 3.14.0 (beta.28.1): run it as a job (202 and its id at once; its steps are the job's lines,
|
|
10055
|
+
* Stop ends it between them, and its result `answer` is this request's result, or `problem`).
|
|
10056
|
+
*/
|
|
10057
|
+
job: z31.boolean().optional()
|
|
10007
10058
|
});
|
|
10008
10059
|
var ConnectLinksResult = z31.object({
|
|
10009
10060
|
written: z31.boolean(),
|
|
@@ -10061,7 +10112,17 @@ var FileChangeResult = z31.object({
|
|
|
10061
10112
|
written: z31.boolean(),
|
|
10062
10113
|
files: z31.array(z31.object({ file: z31.string(), changes: z31.array(LineChangeView) })),
|
|
10063
10114
|
verify: z31.string(),
|
|
10064
|
-
commit: z31.string()
|
|
10115
|
+
commit: z31.string(),
|
|
10116
|
+
/**
|
|
10117
|
+
* 3.14: the System added to a profile first, for a declaration from a box no profile had (a
|
|
10118
|
+
* repo the manifest lists with no System): the person is told it was added, and where.
|
|
10119
|
+
*/
|
|
10120
|
+
created: z31.object({ system: z31.string(), file: z31.string() }).optional(),
|
|
10121
|
+
/**
|
|
10122
|
+
* 3.14: the System the canvas added for a declaration, taken away with its last one (Undo):
|
|
10123
|
+
* the person is told it went, and from where.
|
|
10124
|
+
*/
|
|
10125
|
+
removed: z31.object({ system: z31.string(), file: z31.string() }).optional()
|
|
10065
10126
|
});
|
|
10066
10127
|
var SketchStrokeRequest = z31.object({
|
|
10067
10128
|
stroke: z31.object({ kind: z31.enum(["call", "topic", "table", "remove", "retarget", "undo", "retire"]) }).passthrough(),
|
|
@@ -11661,8 +11722,13 @@ var OPS = {
|
|
|
11661
11722
|
id: "previewVerifyWrite",
|
|
11662
11723
|
summary: "After a correction: the commands to run (atticus verify <repo> --write, then the git steps with the exact files) and what that write will change in the facts and the catalog (links moved, added, removed; facts dropped or edited), computed in-process without writing (ADR 0149)",
|
|
11663
11724
|
tag: "workspace",
|
|
11664
|
-
params: [
|
|
11725
|
+
params: [
|
|
11726
|
+
p("repo"),
|
|
11727
|
+
q("fact", str3, "The fact corrected, for the branch and commit message"),
|
|
11728
|
+
q("job", str3, "3.14.0: 1 runs the preview as a job (202 JobAccepted; its steps are its lines, Stop ends it between them, its result `answer` is this view or `problem`)")
|
|
11729
|
+
],
|
|
11665
11730
|
ok: { status: 200, schema: "VerifyPreviewView", description: "OK" },
|
|
11731
|
+
alsoOk: { status: 202, schema: "JobAccepted", description: "Started as a job (`job=1`)" },
|
|
11666
11732
|
errors: [400, 404]
|
|
11667
11733
|
}
|
|
11668
11734
|
},
|
|
@@ -11783,14 +11849,14 @@ var OPS = {
|
|
|
11783
11849
|
"/api/facts/{repo}/apply": {
|
|
11784
11850
|
post: {
|
|
11785
11851
|
id: "applyFacts",
|
|
11786
|
-
summary: "2.65.0 (ADR 0183): run atticus verify <repo> --write, as Apply after an answer or a correction; 3.12.0: with the counts that confirm a refused build",
|
|
11852
|
+
summary: "2.65.0 (ADR 0183): run atticus verify <repo> --write, as Apply after an answer or a correction; 3.12.0: with the counts that confirm a refused build; 3.14.0: a rejected fact is left out and the rest written (leftOut in the result)",
|
|
11787
11853
|
tag: "workspace",
|
|
11788
11854
|
params: [p("repo")],
|
|
11789
11855
|
body: FactsApplyRequest,
|
|
11790
11856
|
ok: {
|
|
11791
11857
|
status: 202,
|
|
11792
11858
|
schema: "JobAccepted",
|
|
11793
|
-
description: "Started: its job's result is the code and the lines verify printed"
|
|
11859
|
+
description: "Started: its job's result is FactsApplyResult: the code and the lines verify printed, a refused build's listing, and (3.14.0) leftOut, how many rejected facts the write left out"
|
|
11794
11860
|
},
|
|
11795
11861
|
// 2.68.0: 409 while another local step (Apply, Propose, Bring in) runs.
|
|
11796
11862
|
errors: [400, 409]
|
|
@@ -12224,19 +12290,22 @@ var OPS = {
|
|
|
12224
12290
|
params: [
|
|
12225
12291
|
q("from", str3, "Box A: the caller's repo"),
|
|
12226
12292
|
q("to", str3, "Box B: a repo of the manifest"),
|
|
12227
|
-
q("system", str3, "Box B: an outside system of the profile (instead of to)")
|
|
12293
|
+
q("system", str3, "Box B: an outside system of the profile (instead of to)"),
|
|
12294
|
+
q("job", str3, "3.14.0: 1 runs the read as a job (202 JobAccepted; its steps are its lines, Stop ends it between them, its result `answer` is this view or `problem`)")
|
|
12228
12295
|
],
|
|
12229
12296
|
ok: { status: 200, schema: "LinkCandidatesView", description: "OK" },
|
|
12297
|
+
alsoOk: { status: 202, schema: "JobAccepted", description: "Started as a job (`job=1`)" },
|
|
12230
12298
|
errors: [400, 404]
|
|
12231
12299
|
}
|
|
12232
12300
|
},
|
|
12233
12301
|
"/api/links/connect": {
|
|
12234
12302
|
post: {
|
|
12235
12303
|
id: "connectLinks",
|
|
12236
|
-
summary: "Pair box A's calls with box B's APIs (ADR 0174, G1): a link line per pair in A's corrections, and with rule a /** answer; with preview, what it would write and the next verify --write changes",
|
|
12304
|
+
summary: "Pair box A's calls with box B's APIs (ADR 0174, G1): a link line per pair in A's corrections, and with rule a /** answer; with preview, what it would write and the next verify --write changes. 3.14.0: with `job: true`, 202 JobAccepted at once; the job's result `answer` is this result, or `problem`",
|
|
12237
12305
|
tag: "views",
|
|
12238
12306
|
body: ConnectLinksRequest,
|
|
12239
12307
|
ok: { status: 200, schema: "ConnectLinksResult", description: "OK" },
|
|
12308
|
+
alsoOk: { status: 202, schema: "JobAccepted", description: "Started as a job (`job: true`)" },
|
|
12240
12309
|
errors: [400, 404, 409, 422]
|
|
12241
12310
|
}
|
|
12242
12311
|
},
|
|
@@ -12291,7 +12360,7 @@ var OPS = {
|
|
|
12291
12360
|
ok: {
|
|
12292
12361
|
status: 202,
|
|
12293
12362
|
schema: "JobAccepted",
|
|
12294
|
-
description: "Started: its job's result is the code and the lines verify printed"
|
|
12363
|
+
description: "Started: its job's result is FactsApplyResult: the code and the lines verify printed, and (3.14.0) leftOut and leftOutRepos when repos wrote with rejected facts left out (applied, code 0)"
|
|
12295
12364
|
},
|
|
12296
12365
|
errors: [409]
|
|
12297
12366
|
}
|
|
@@ -14044,6 +14113,7 @@ var SPEC_CACHE_VERSION = `spec@${FLOW_SCHEMA_VERSION}.${SPEC_HEADER_SCHEMA_VERSI
|
|
|
14044
14113
|
// packages/core/dist/cancel.js
|
|
14045
14114
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
14046
14115
|
var store = new AsyncLocalStorage2();
|
|
14116
|
+
var commits = new AsyncLocalStorage2();
|
|
14047
14117
|
|
|
14048
14118
|
// packages/core/dist/assistant-actor.js
|
|
14049
14119
|
init_ai();
|
|
@@ -14613,13 +14683,13 @@ function fsScanCache(dir) {
|
|
|
14613
14683
|
throw new Error(`unsafe repo name: ${repo}`);
|
|
14614
14684
|
const keep = new Set(keepCommits);
|
|
14615
14685
|
let removed = 0;
|
|
14616
|
-
let
|
|
14686
|
+
let commits2;
|
|
14617
14687
|
try {
|
|
14618
|
-
|
|
14688
|
+
commits2 = await readdir2(join3(dir, repo));
|
|
14619
14689
|
} catch {
|
|
14620
14690
|
return 0;
|
|
14621
14691
|
}
|
|
14622
|
-
for (const c of
|
|
14692
|
+
for (const c of commits2) {
|
|
14623
14693
|
if (!keep.has(c)) {
|
|
14624
14694
|
await rm(join3(dir, repo, c), { recursive: true, force: true });
|
|
14625
14695
|
removed++;
|
package/package.json
CHANGED