@maycombhq/sdk 2.0.0-beta.28.4 → 2.0.0-beta.28.5
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 +72 -7
- package/npm/core/contract-check.d.ts +17 -2
- package/npm/core/declarable-routes.d.ts +52 -0
- package/npm/core/declared-links.d.ts +6 -0
- package/npm/core/facts-callers.d.ts +21 -1
- package/npm/core/field-places.d.ts +109 -0
- package/npm/core/file-pool.d.ts +14 -3
- package/npm/core/fs.d.ts +94 -1
- package/npm/core/hash-cache.d.ts +53 -0
- package/npm/core/index.d.ts +3 -0
- package/npm/core/schema/ai.d.ts +2 -2
- package/npm/core/schema/orgpack.d.ts +1 -1
- package/npm/index.js +81 -7
- package/package.json +1 -1
package/npm/core/api.d.ts
CHANGED
|
@@ -648,8 +648,21 @@ import { z } from "zod";
|
|
|
648
648
|
* and on other boxes' rows `pairedWith`), an AI pairing a person's answer outranks says that
|
|
649
649
|
* (`onward: outranked`), and the view says when no catalog is built yet (`noCatalog`).
|
|
650
650
|
* Additive only.
|
|
651
|
+
* 3.17.0 (ADR 0200, a field report on beta.28.4: a line drawn from another team's system to a
|
|
652
|
+
* gateway proxy was turned round): GET /api/declared-links/routes lists what a system can be
|
|
653
|
+
* declared to call: the repos that have gateway routes (`gateways`) and, with `repo`, that
|
|
654
|
+
* repo's routes to pick from (`target`: each with its method, path, handler, the line it was
|
|
655
|
+
* read from, the words that declare it, whether the system declared it already, and any other
|
|
656
|
+
* repo the same words land on), or that it has none (`gateway: false`, with its entries
|
|
657
|
+
* counted, its manifest `type`, and `looksLikeGateway` when that type reads like a gateway's
|
|
658
|
+
* but isn't one the join takes): a declared call lands only on a gateway route. `inProfile`
|
|
659
|
+
* is false for a system only the code names, whose declaration would be refused. POST /api/declared-links, for
|
|
660
|
+
* `kind: call`, takes `routes` (1 to 200) in place of `route`: each is one line of the
|
|
661
|
+
* profile, written once, in a fixed order (sorted) whatever order they come in, in one write;
|
|
662
|
+
* 409 and nothing written when the profile has one already; 400 with neither or both. A
|
|
663
|
+
* request with `route` answers as before. Additive only.
|
|
651
664
|
*/
|
|
652
|
-
export declare const API_VERSION = "3.
|
|
665
|
+
export declare const API_VERSION = "3.17.0";
|
|
653
666
|
export declare const DEFAULT_PORT = 4321;
|
|
654
667
|
/** RFC 9457 problem details, used for every error. */
|
|
655
668
|
/**
|
|
@@ -2319,10 +2332,10 @@ export declare const RunView: z.ZodObject<{
|
|
|
2319
2332
|
}, z.core.$strict>>;
|
|
2320
2333
|
stepClass: z.ZodOptional<z.ZodEnum<{
|
|
2321
2334
|
read: "read";
|
|
2335
|
+
quick: "quick";
|
|
2322
2336
|
draft: "draft";
|
|
2323
2337
|
critic: "critic";
|
|
2324
2338
|
knowledge: "knowledge";
|
|
2325
|
-
quick: "quick";
|
|
2326
2339
|
}>>;
|
|
2327
2340
|
model: z.ZodOptional<z.ZodString>;
|
|
2328
2341
|
assistant: z.ZodOptional<z.ZodObject<{
|
|
@@ -2429,10 +2442,10 @@ export declare const RunListItem: z.ZodObject<{
|
|
|
2429
2442
|
}, z.core.$strict>>;
|
|
2430
2443
|
stepClass: z.ZodOptional<z.ZodEnum<{
|
|
2431
2444
|
read: "read";
|
|
2445
|
+
quick: "quick";
|
|
2432
2446
|
draft: "draft";
|
|
2433
2447
|
critic: "critic";
|
|
2434
2448
|
knowledge: "knowledge";
|
|
2435
|
-
quick: "quick";
|
|
2436
2449
|
}>>;
|
|
2437
2450
|
model: z.ZodOptional<z.ZodString>;
|
|
2438
2451
|
assistant: z.ZodOptional<z.ZodObject<{
|
|
@@ -2558,10 +2571,10 @@ export declare const RunDoneView: z.ZodObject<{
|
|
|
2558
2571
|
}, z.core.$strict>>;
|
|
2559
2572
|
stepClass: z.ZodOptional<z.ZodEnum<{
|
|
2560
2573
|
read: "read";
|
|
2574
|
+
quick: "quick";
|
|
2561
2575
|
draft: "draft";
|
|
2562
2576
|
critic: "critic";
|
|
2563
2577
|
knowledge: "knowledge";
|
|
2564
|
-
quick: "quick";
|
|
2565
2578
|
}>>;
|
|
2566
2579
|
model: z.ZodOptional<z.ZodString>;
|
|
2567
2580
|
assistant: z.ZodOptional<z.ZodObject<{
|
|
@@ -2693,10 +2706,10 @@ export declare const RunList: z.ZodObject<{
|
|
|
2693
2706
|
}, z.core.$strict>>;
|
|
2694
2707
|
stepClass: z.ZodOptional<z.ZodEnum<{
|
|
2695
2708
|
read: "read";
|
|
2709
|
+
quick: "quick";
|
|
2696
2710
|
draft: "draft";
|
|
2697
2711
|
critic: "critic";
|
|
2698
2712
|
knowledge: "knowledge";
|
|
2699
|
-
quick: "quick";
|
|
2700
2713
|
}>>;
|
|
2701
2714
|
model: z.ZodOptional<z.ZodString>;
|
|
2702
2715
|
assistant: z.ZodOptional<z.ZodObject<{
|
|
@@ -2812,10 +2825,10 @@ export declare const RunTranscript: z.ZodObject<{
|
|
|
2812
2825
|
}, z.core.$strict>>;
|
|
2813
2826
|
stepClass: z.ZodOptional<z.ZodEnum<{
|
|
2814
2827
|
read: "read";
|
|
2828
|
+
quick: "quick";
|
|
2815
2829
|
draft: "draft";
|
|
2816
2830
|
critic: "critic";
|
|
2817
2831
|
knowledge: "knowledge";
|
|
2818
|
-
quick: "quick";
|
|
2819
2832
|
}>>;
|
|
2820
2833
|
model: z.ZodOptional<z.ZodString>;
|
|
2821
2834
|
assistant: z.ZodOptional<z.ZodObject<{
|
|
@@ -14646,9 +14659,59 @@ export declare const DeclareLinkRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
14646
14659
|
}, z.core.$strip>, z.ZodObject<{
|
|
14647
14660
|
kind: z.ZodLiteral<"call">;
|
|
14648
14661
|
system: z.ZodString;
|
|
14649
|
-
route: z.ZodString
|
|
14662
|
+
route: z.ZodOptional<z.ZodString>;
|
|
14663
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14650
14664
|
preview: z.ZodOptional<z.ZodBoolean>;
|
|
14651
14665
|
}, z.core.$strip>], "kind">;
|
|
14666
|
+
/** 3.17 (ADR 0200): a gateway route a system can be declared to call. */
|
|
14667
|
+
export declare const DeclarableRouteView: z.ZodObject<{
|
|
14668
|
+
id: z.ZodString;
|
|
14669
|
+
method: z.ZodOptional<z.ZodString>;
|
|
14670
|
+
path: z.ZodString;
|
|
14671
|
+
handler: z.ZodOptional<z.ZodString>;
|
|
14672
|
+
at: z.ZodString;
|
|
14673
|
+
say: z.ZodString;
|
|
14674
|
+
declared: z.ZodOptional<z.ZodBoolean>;
|
|
14675
|
+
also: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14676
|
+
}, z.core.$strip>;
|
|
14677
|
+
/**
|
|
14678
|
+
* 3.17 (ADR 0200): what a system can be declared to call. `gateways`: the repos that have
|
|
14679
|
+
* gateway routes. `target`: the repo asked about, its routes by path then method, or
|
|
14680
|
+
* `gateway: false` for a repo with none (a declared call lands only on a gateway route).
|
|
14681
|
+
*/
|
|
14682
|
+
export declare const DeclarableRoutesView: z.ZodObject<{
|
|
14683
|
+
system: z.ZodString;
|
|
14684
|
+
inProfile: z.ZodBoolean;
|
|
14685
|
+
gateways: z.ZodArray<z.ZodObject<{
|
|
14686
|
+
repo: z.ZodString;
|
|
14687
|
+
routes: z.ZodNumber;
|
|
14688
|
+
}, z.core.$strip>>;
|
|
14689
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
14690
|
+
repo: z.ZodString;
|
|
14691
|
+
gateway: z.ZodBoolean;
|
|
14692
|
+
routes: z.ZodArray<z.ZodObject<{
|
|
14693
|
+
id: z.ZodString;
|
|
14694
|
+
method: z.ZodOptional<z.ZodString>;
|
|
14695
|
+
path: z.ZodString;
|
|
14696
|
+
handler: z.ZodOptional<z.ZodString>;
|
|
14697
|
+
at: z.ZodString;
|
|
14698
|
+
say: z.ZodString;
|
|
14699
|
+
declared: z.ZodOptional<z.ZodBoolean>;
|
|
14700
|
+
also: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14701
|
+
}, z.core.$strip>>;
|
|
14702
|
+
entries: z.ZodNumber;
|
|
14703
|
+
type: z.ZodOptional<z.ZodString>;
|
|
14704
|
+
manifest: z.ZodOptional<z.ZodString>;
|
|
14705
|
+
looksLikeGateway: z.ZodOptional<z.ZodBoolean>;
|
|
14706
|
+
notRead: z.ZodOptional<z.ZodObject<{
|
|
14707
|
+
why: z.ZodEnum<{
|
|
14708
|
+
"not-read": "not-read";
|
|
14709
|
+
unverified: "unverified";
|
|
14710
|
+
}>;
|
|
14711
|
+
command: z.ZodString;
|
|
14712
|
+
}, z.core.$strip>>;
|
|
14713
|
+
}, z.core.$strip>>;
|
|
14714
|
+
}, z.core.$strip>;
|
|
14652
14715
|
export declare const FileChangeResult: z.ZodObject<{
|
|
14653
14716
|
written: z.ZodBoolean;
|
|
14654
14717
|
files: z.ZodArray<z.ZodObject<{
|
|
@@ -14963,6 +15026,8 @@ export declare const RuleFromPairingResult: z.ZodObject<{
|
|
|
14963
15026
|
export type RuleFromPairingResultT = z.infer<typeof RuleFromPairingResult>;
|
|
14964
15027
|
export type DeclareLinkRequestT = z.infer<typeof DeclareLinkRequest>;
|
|
14965
15028
|
export type FileChangeResultT = z.infer<typeof FileChangeResult>;
|
|
15029
|
+
export type DeclarableRouteViewT = z.infer<typeof DeclarableRouteView>;
|
|
15030
|
+
export type DeclarableRoutesViewT = z.infer<typeof DeclarableRoutesView>;
|
|
14966
15031
|
export type SketchStrokeRequestT = z.infer<typeof SketchStrokeRequest>;
|
|
14967
15032
|
export type SketchResultT = z.infer<typeof SketchResult>;
|
|
14968
15033
|
export type AddableViewT = z.infer<typeof AddableView>;
|
|
@@ -153,7 +153,11 @@ export interface ContractMismatch {
|
|
|
153
153
|
/** What it reaches: an entry of the estate, or an outside system. */
|
|
154
154
|
entry?: FactEnd;
|
|
155
155
|
system?: string;
|
|
156
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* `mismatch`: the two sides disagree; `unconfirmed`: a mapping on the way isn't traced, or the
|
|
158
|
+
* difference rests on a field whose place in its payload the facts don't give (the message
|
|
159
|
+
* says which).
|
|
160
|
+
*/
|
|
157
161
|
status: "mismatch" | "unconfirmed";
|
|
158
162
|
kind: ContractKind;
|
|
159
163
|
side?: "request" | "response" | "message";
|
|
@@ -164,7 +168,7 @@ export interface ContractMismatch {
|
|
|
164
168
|
receiver: ContractEnd;
|
|
165
169
|
/** The mapping lines the comparison went through (`repo path:line`), in order. */
|
|
166
170
|
via?: string[];
|
|
167
|
-
/** The mapping that isn't traced, when `unconfirmed
|
|
171
|
+
/** The mapping that isn't traced, when `unconfirmed` for that reason. */
|
|
168
172
|
untraced?: string;
|
|
169
173
|
message: string;
|
|
170
174
|
}
|
|
@@ -231,6 +235,17 @@ export declare const CONTRACT_WORDS: {
|
|
|
231
235
|
errorUnlisted: (status: string, r: string, rAt: string, s: string, spec: boolean) => string;
|
|
232
236
|
errorUnanswered: (status: string, s: string, sAt: string, r: string) => string;
|
|
233
237
|
unconfirmed: (message: string, untraced: string) => string;
|
|
238
|
+
/** Addendum of 2026-11-17: a difference that rests on a place the facts don't give. */
|
|
239
|
+
unplaced: (message: string, why: string) => string;
|
|
240
|
+
place: (why: string) => string;
|
|
241
|
+
shared: (n: number, tail: string, r: string) => string;
|
|
242
|
+
noRoot: (s: string, side: string) => string;
|
|
243
|
+
nothingInside: (s: string, name: string) => string;
|
|
244
|
+
unlisted: (r: string, name: string) => string;
|
|
245
|
+
itemsUnread: (r: string, name: string) => string;
|
|
246
|
+
elsewhere: (names: readonly string[]) => string;
|
|
247
|
+
renamed: (name: string) => string;
|
|
248
|
+
sameAt: (names: readonly string[]) => string;
|
|
234
249
|
};
|
|
235
250
|
/**
|
|
236
251
|
* The `transform` a reader gives the field fact that names a publish's or listener's message type
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { JoinRepo } from "./facts-join.js";
|
|
2
|
+
/**
|
|
3
|
+
* ADR 0200: the gateway routes a person can declare a caller of, listed to pick from. A declared
|
|
4
|
+
* call (the profile's `calls`, A-callers) lands only on a gateway route: an entry of a gateway
|
|
5
|
+
* repo, or any repo's entry under a proxy bundle folder. An ordinary service's entry is not one,
|
|
6
|
+
* and the join places no declaration on it. The routes come from the same rule the join uses
|
|
7
|
+
* (`gatewayRouteFacts`), and the words offered for each are words the join places on it
|
|
8
|
+
* (`declaredRouteMatches`). Pure.
|
|
9
|
+
*/
|
|
10
|
+
export interface DeclarableRoute {
|
|
11
|
+
/** The route's entry fact. */
|
|
12
|
+
id: string;
|
|
13
|
+
method?: string;
|
|
14
|
+
path: string;
|
|
15
|
+
/** The handler or proxy flow that serves it, where the facts name one. */
|
|
16
|
+
handler?: string;
|
|
17
|
+
/** path:line of the line it was read from. */
|
|
18
|
+
at: string;
|
|
19
|
+
/**
|
|
20
|
+
* What the declaration says to mean this route: `METHOD /path` where no other route of the
|
|
21
|
+
* estate is served on those words, else its handler where that names only this one.
|
|
22
|
+
*/
|
|
23
|
+
say: string;
|
|
24
|
+
/** The system declared it already (by either way of naming it). */
|
|
25
|
+
declared?: true;
|
|
26
|
+
/** The other repos whose route the same words name: the declaration lands there too. */
|
|
27
|
+
also?: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface DeclarableRoutes {
|
|
30
|
+
/** The repo has gateway routes. */
|
|
31
|
+
gateway: boolean;
|
|
32
|
+
routes: DeclarableRoute[];
|
|
33
|
+
/** How many entries the repo has on record, routes or not. */
|
|
34
|
+
entries: number;
|
|
35
|
+
}
|
|
36
|
+
interface Input {
|
|
37
|
+
repos: readonly JoinRepo[];
|
|
38
|
+
/** The gateway bundle folders, as given to the join (the estate's conventions). */
|
|
39
|
+
bundleFolders?: readonly string[] | undefined;
|
|
40
|
+
}
|
|
41
|
+
/** The gateway routes of `repo`, by path then method, each with the words that declare it. */
|
|
42
|
+
export declare function declarableRoutes(input: Input & {
|
|
43
|
+
repo: string;
|
|
44
|
+
/** The routes the system declared already, as its profile says them. */
|
|
45
|
+
declared: readonly string[];
|
|
46
|
+
}): DeclarableRoutes;
|
|
47
|
+
/** The repos that have gateway routes, by id, with how many. */
|
|
48
|
+
export declare function declarableGateways(input: Input): {
|
|
49
|
+
repo: string;
|
|
50
|
+
routes: number;
|
|
51
|
+
}[];
|
|
52
|
+
export {};
|
|
@@ -15,6 +15,12 @@ export type Declared = {
|
|
|
15
15
|
kind: "call";
|
|
16
16
|
system: string;
|
|
17
17
|
route: string;
|
|
18
|
+
}
|
|
19
|
+
/** ADR 0200: several gateway routes in one write, one line each. */
|
|
20
|
+
| {
|
|
21
|
+
kind: "call";
|
|
22
|
+
system: string;
|
|
23
|
+
routes: readonly string[];
|
|
18
24
|
};
|
|
19
25
|
export interface DeclaredOnFile {
|
|
20
26
|
kind: "topic" | "call";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CatalogRecord } from "./catalog.js";
|
|
2
2
|
import { type FacingWords, type FactEnd, type FactsJoinResult, type GatewayFacing, type JoinRepo } from "./facts-join.js";
|
|
3
|
-
import type { CallerKind } from "./schema/facts.js";
|
|
3
|
+
import type { CallerKind, FactOf } from "./schema/facts.js";
|
|
4
4
|
import type { Profile } from "./schema/orgpack.js";
|
|
5
5
|
/**
|
|
6
6
|
* Who a gateway route lets in (ADR 0124 addendum A-callers). A route's own files usually name
|
|
@@ -127,6 +127,26 @@ export declare function declaredCallsOf(profiles: readonly {
|
|
|
127
127
|
platform: string;
|
|
128
128
|
profile?: Profile;
|
|
129
129
|
}[]): DeclaredCallInput[];
|
|
130
|
+
/**
|
|
131
|
+
* Whether the route a person named (a declared call's `route`) is this gateway route: its handler
|
|
132
|
+
* (`proxy/flow`, any case), or `METHOD /path` as the gateway serves it (ANY for a route read with
|
|
133
|
+
* no method; a trailing slash is neither here nor there). The one rule, for the join and for the
|
|
134
|
+
* routes offered to declare (ADR 0200).
|
|
135
|
+
*/
|
|
136
|
+
export declare function declaredRouteMatches(route: {
|
|
137
|
+
handler?: string | undefined;
|
|
138
|
+
method?: string | undefined;
|
|
139
|
+
path: string;
|
|
140
|
+
}, said: string): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* The entry facts of the estate that are gateway routes (A-callers): every entry of a gateway
|
|
143
|
+
* repo, and any repo's entry cited under a proxy bundle folder. The one rule, for the join and
|
|
144
|
+
* for the routes offered to declare (ADR 0200).
|
|
145
|
+
*/
|
|
146
|
+
export declare function gatewayRouteFacts(repos: readonly JoinRepo[], bundleFolders?: readonly string[]): {
|
|
147
|
+
repo: string;
|
|
148
|
+
fact: FactOf<"entry">;
|
|
149
|
+
}[];
|
|
130
150
|
/** Who each gateway route of the estate lets in, and the chain from each declared caller. */
|
|
131
151
|
export declare function joinCallers(input: JoinCallersInput): CallersResult;
|
|
132
152
|
/** A chain in one line: `Harbor Desk (declared; app harbor-desk-portal) → edge-gateway … → …`. */
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Fact, FactOf } from "./schema/facts.js";
|
|
2
|
+
/**
|
|
3
|
+
* A field's place in its payload, built from the facts alone (ADR 0164, addendum of 2026-11-17).
|
|
4
|
+
*
|
|
5
|
+
* A reader writes one field fact per field of each class a payload is made of, each cited on its
|
|
6
|
+
* declaration in the class's own file, by the name the field has there: `depot`, not
|
|
7
|
+
* `receipt.stamps[].depot`. What says where a class sits is the field that holds it: a
|
|
8
|
+
* field whose declared type names the class (`List<Stamp> stamps`). So, per
|
|
9
|
+
* owner and side:
|
|
10
|
+
*
|
|
11
|
+
* - **A class** is the fields cited in one file (the verifier checked each on its line, so the
|
|
12
|
+
* file is the one thing about membership that is not the reader's choice of words). Where one
|
|
13
|
+
* file holds several classes, the fields whose id carries a type's name
|
|
14
|
+
* (`field.stamp.reason`) are that type's.
|
|
15
|
+
* - **A parent** of a class is a field of the same owner and side whose type names it: the
|
|
16
|
+
* fact's `type`, and where that is left out the type the cited line declares for it. A list
|
|
17
|
+
* gives `[]`; a wrapper that only passes its value on (`Optional<X>`, `ResponseEntity<X>`) is
|
|
18
|
+
* no level. A map gives a place nobody can name (its keys are data). A class named inside any
|
|
19
|
+
* other generic type (`Page<Item>`) is placed through that type's own fields when they are on
|
|
20
|
+
* record (`Envelope<Order>` with `T content`), and has no place anyone can name when not.
|
|
21
|
+
* - **A path** is the parent's path, then the field's name; through as many levels as the facts
|
|
22
|
+
* hold, at every place a class is reached from, never round a class that holds itself twice.
|
|
23
|
+
* - **An envelope mapping** (`mappedTo` a field, `transform: envelope …`, ADR 0164 §2) places
|
|
24
|
+
* one field under another, as before; where the field's class is itself held, by type, by a
|
|
25
|
+
* field under that envelope, the type's path is the place (`data.customer.name`).
|
|
26
|
+
* - **A dotted name** (`receipt.depot_token`) is the reader's own path: where it starts with the
|
|
27
|
+
* end of its class's place it is not prefixed again. It places itself only, never its siblings.
|
|
28
|
+
* - **Roots**: every class no field points at that holds another class is a root (a body and
|
|
29
|
+
* an error body, a base class and the class that extends it): its fields are top-level.
|
|
30
|
+
*
|
|
31
|
+
* A field whose place isn't sure carries `unplaced`, the reason in words. Two kinds. A doubt that
|
|
32
|
+
* only says *where* (a class nothing points at beside classes that hold others; classes that
|
|
33
|
+
* only hold each other) matters only to a difference that depends on where: the check ignores
|
|
34
|
+
* it when the other side has that name nowhere, or once. A doubt that `decides` (a map; a
|
|
35
|
+
* generic type whose shape isn't on record; an envelope mapping and a type that name different
|
|
36
|
+
* parents; a dotted name that doesn't fit its class's place; more places than are compared)
|
|
37
|
+
* leaves any difference on the field unconfirmed.
|
|
38
|
+
*
|
|
39
|
+
* Pure: the same fields give the same places whatever order they come in. No file is read.
|
|
40
|
+
*/
|
|
41
|
+
type Field = FactOf<"field">;
|
|
42
|
+
/** One place a field has on the wire. */
|
|
43
|
+
export interface FieldPlace {
|
|
44
|
+
/** The path from the payload's root: `receipt.stamps[].depot`. */
|
|
45
|
+
name: string;
|
|
46
|
+
/** The ids of the fields that hold it, from the root down. */
|
|
47
|
+
via: string[];
|
|
48
|
+
/** Why the place isn't sure, in words. */
|
|
49
|
+
unplaced?: string;
|
|
50
|
+
/** The doubt holds whatever the other side has: any difference on the field is unconfirmed. */
|
|
51
|
+
decides?: true;
|
|
52
|
+
/** The place is a second turn round a class that holds itself. */
|
|
53
|
+
again?: true;
|
|
54
|
+
/**
|
|
55
|
+
* The path starts at a class nothing holds that holds others, and nothing on the way is in
|
|
56
|
+
* doubt: built, not just written. `root` is that class (its file).
|
|
57
|
+
*/
|
|
58
|
+
sure?: true;
|
|
59
|
+
root?: string;
|
|
60
|
+
}
|
|
61
|
+
/** A class whose place in a payload isn't on record. */
|
|
62
|
+
export interface LooseClass {
|
|
63
|
+
owner: string;
|
|
64
|
+
side: string;
|
|
65
|
+
/** The class as its file names it. */
|
|
66
|
+
class: string;
|
|
67
|
+
file: string;
|
|
68
|
+
/** Its fields' ids. */
|
|
69
|
+
fields: string[];
|
|
70
|
+
why: string;
|
|
71
|
+
}
|
|
72
|
+
/** A class a type names, and how the type holds it. */
|
|
73
|
+
interface TypeRef {
|
|
74
|
+
ident: string;
|
|
75
|
+
/** `inside`: within a generic type that is no list, wrapper or map (`outer`). */
|
|
76
|
+
kind: "one" | "list" | "map" | "inside";
|
|
77
|
+
outer?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The identifiers a type names, each with how it is held: alone, in a list (`List<X>`, `X[]`,
|
|
81
|
+
* `[]X`, `list[X]`, `repeated X`), in a map, or inside another generic type. A qualified name
|
|
82
|
+
* counts by its last part; quoted values (an enum's) are left out.
|
|
83
|
+
*/
|
|
84
|
+
export declare function typeRefs(type: string): TypeRef[];
|
|
85
|
+
/**
|
|
86
|
+
* The type the cited line declares for the field, when the fact has none: the line's text is the
|
|
87
|
+
* quote, the field the token that reads as its cited value or its name (`depotToken` for
|
|
88
|
+
* `depot_token`). Java, C#, Kotlin, TypeScript, Python and Go forms; anything else gives nothing.
|
|
89
|
+
*/
|
|
90
|
+
export declare function declaredTypeOf(f: Pick<Field, "name" | "type" | "cite">): string | undefined;
|
|
91
|
+
export interface FieldPlaces {
|
|
92
|
+
/** Each field's places, by id; a header's and a field with no class is its own name. */
|
|
93
|
+
of: (f: Field) => FieldPlace[];
|
|
94
|
+
/** The classes whose place isn't on record. */
|
|
95
|
+
loose: () => Omit<LooseClass, "owner" | "side">[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The places of the fields of one owner and side (mapping facts between two payloads and a
|
|
99
|
+
* mapper's dropped end left out by the caller).
|
|
100
|
+
*/
|
|
101
|
+
export declare function placeFields(input: readonly Field[], side: string): FieldPlaces;
|
|
102
|
+
/**
|
|
103
|
+
* The classes of a repo's payloads whose place isn't on record (for `atticus verify`): per entry
|
|
104
|
+
* or call and side, each class no field of that payload reaches, with why. The fields are those
|
|
105
|
+
* the contract check compares: a mapping between two payloads (a gateway policy's) and the end
|
|
106
|
+
* of a mapper that doesn't travel are left out, as `checkContracts` leaves them.
|
|
107
|
+
*/
|
|
108
|
+
export declare function looseFieldClasses(facts: readonly Fact[]): LooseClass[];
|
|
109
|
+
export {};
|
package/npm/core/file-pool.d.ts
CHANGED
|
@@ -63,11 +63,22 @@ export declare function textShaOf(bytes: Buffer): string;
|
|
|
63
63
|
export declare function hashFilesIn(dir: string, rels: readonly string[], o?: {
|
|
64
64
|
raw?: boolean;
|
|
65
65
|
signal?: AbortSignal;
|
|
66
|
-
|
|
66
|
+
ctime?: boolean;
|
|
67
|
+
}): Promise<(FileHash & {
|
|
68
|
+
ctimeMs?: number;
|
|
69
|
+
ino?: number;
|
|
70
|
+
})[]>;
|
|
67
71
|
/**
|
|
68
72
|
* Every named file's size and time (ms, floored), in the order of `rels`; none for one not there.
|
|
69
|
-
* With `signal`, a stop ends the read part way and fails the call with CancelledError.
|
|
73
|
+
* With `signal`, a stop ends the read part way and fails the call with CancelledError. With
|
|
74
|
+
* `ctime`, each file's change time too (`ctimeMs`: the last change of its bytes or its times,
|
|
75
|
+
* which no program sets) and its identity (`ino`: the inode, NTFS's file id; 0 where the
|
|
76
|
+
* platform reports none): hash-cache.ts keeps a hash by them.
|
|
70
77
|
*/
|
|
71
78
|
export declare function statFilesIn(dir: string, rels: readonly string[], o?: {
|
|
72
79
|
signal?: AbortSignal;
|
|
73
|
-
|
|
80
|
+
ctime?: boolean;
|
|
81
|
+
}): Promise<((FileStat & {
|
|
82
|
+
ctimeMs?: number;
|
|
83
|
+
ino?: number;
|
|
84
|
+
}) | undefined)[]>;
|
package/npm/core/fs.d.ts
CHANGED
|
@@ -21,7 +21,19 @@ export declare function writeFileAtomic(path: string, data: string | Uint8Array,
|
|
|
21
21
|
sha: string;
|
|
22
22
|
writtenAt: number;
|
|
23
23
|
}) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Only the quick tries when the file is held (`HeldOptions`): a cache's write, which may
|
|
26
|
+
* fail at no cost, never waits the long wait.
|
|
27
|
+
*/
|
|
28
|
+
quick?: boolean;
|
|
24
29
|
}): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Write a file unless it already holds exactly these bytes: then it is left alone, its time
|
|
32
|
+
* too, and false is returned (beta.28.5: a run that works out a file's content again never
|
|
33
|
+
* replaces the file with itself; on Windows each replacement is a chance to meet a program that
|
|
34
|
+
* holds the file, and a time that moved for nothing makes every reader of it read it again).
|
|
35
|
+
*/
|
|
36
|
+
export declare function writeFileIfDiffers(path: string, data: string): Promise<boolean>;
|
|
25
37
|
/**
|
|
26
38
|
* Copy a file the way `writeFileAtomic` writes one: to a temporary file beside the target, then
|
|
27
39
|
* renamed over it. The copy is made by the system (a copy-on-write clone where the file system
|
|
@@ -40,7 +52,88 @@ export declare class FileChangedError extends Error {
|
|
|
40
52
|
* an editor) is never overwritten: that throws FileChangedError instead.
|
|
41
53
|
*/
|
|
42
54
|
export declare function writeFileIfUnchanged(path: string, before: string | undefined, data: string): Promise<void>;
|
|
43
|
-
|
|
55
|
+
/**
|
|
56
|
+
* How long a write waits on Windows for a file another program holds (beta.28.5): the owner's
|
|
57
|
+
* run over forty repos ended on a raw EPERM after the 5 s there were, a file of the facts folder
|
|
58
|
+
* open in an editor or read by an assistant's session at that moment.
|
|
59
|
+
*/
|
|
60
|
+
export declare const HELD_WAIT_MS = 45000;
|
|
61
|
+
/**
|
|
62
|
+
* The wait once a file has stayed held in this process: a cause that doesn't go away (a
|
|
63
|
+
* read-only folder, a program that keeps the folder open) costs the long wait once, not once a
|
|
64
|
+
* file or once a repo of a run over forty.
|
|
65
|
+
*/
|
|
66
|
+
export declare const HELD_AGAIN_MS = 5000;
|
|
67
|
+
/**
|
|
68
|
+
* Tests' Windows: a rename and a removal that fail, a wait that takes no time, the platform,
|
|
69
|
+
* where the line that says a write is waiting goes (standard error by default), and the
|
|
70
|
+
* temporary file's removal.
|
|
71
|
+
*/
|
|
72
|
+
export declare const fsHooks: {
|
|
73
|
+
rename?: (from: string, to: string) => Promise<void>;
|
|
74
|
+
/** `removeHeld`'s removal. */
|
|
75
|
+
remove?: (path: string) => Promise<void>;
|
|
76
|
+
sleep?: (ms: number) => Promise<void>;
|
|
77
|
+
platform?: NodeJS.Platform;
|
|
78
|
+
say?: (line: string) => void;
|
|
79
|
+
/** The removal of a failed write's temporary file. */
|
|
80
|
+
rm?: (path: string) => Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A file stayed held by another program (Windows: open in an editor, read by an assistant's
|
|
84
|
+
* session, scanned) for the whole wait: nothing was written, the file is as it was, and the
|
|
85
|
+
* temporary file is removed. A run over several repos reports the repo and goes on.
|
|
86
|
+
*/
|
|
87
|
+
export declare class FileHeldError extends Error {
|
|
88
|
+
readonly path: string;
|
|
89
|
+
readonly waitedMs: number;
|
|
90
|
+
readonly cause?: unknown | undefined;
|
|
91
|
+
readonly code = "ATTICUS_FILE_HELD";
|
|
92
|
+
constructor(path: string, waitedMs: number, cause?: unknown | undefined);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Whether an error is the file system's (a file held, no room, no permission, too many open
|
|
96
|
+
* files: Node's system errors, which name the call that failed) rather than a bug. A run over
|
|
97
|
+
* several repos says such a repo is not applied and goes on; any other error is thrown on.
|
|
98
|
+
*/
|
|
99
|
+
export declare function isFileSystemError(e: unknown): boolean;
|
|
100
|
+
/** Tests: forget that a file stayed held. */
|
|
101
|
+
export declare function forgetHeld(): void;
|
|
102
|
+
/**
|
|
103
|
+
* The signal that ends a wait for a held file besides the job's own (`currentSignal`): a
|
|
104
|
+
* command run in a terminal sets its Ctrl+C here, and clears it when it ends.
|
|
105
|
+
*/
|
|
106
|
+
export declare function setHeldWaitSignal(signal: AbortSignal | undefined): void;
|
|
107
|
+
/** How a held file is waited for. */
|
|
108
|
+
export interface HeldOptions {
|
|
109
|
+
/**
|
|
110
|
+
* Only the quick tries (about 5 s), then the system's error, as before beta.28.5: a cache's
|
|
111
|
+
* write, which may fail at no cost, and a folder's rename.
|
|
112
|
+
*/
|
|
113
|
+
quick?: boolean;
|
|
114
|
+
/** Ends the wait too (CancelledError), besides the job's Stop and the terminal's Ctrl+C. */
|
|
115
|
+
signal?: AbortSignal;
|
|
116
|
+
/** The quick tries (9: about 5 s). */
|
|
117
|
+
tries?: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Remove the temporary files an earlier run left in `dir` for the files whose names start with
|
|
121
|
+
* `prefix` (a write whose temporary file could not be removed, or a process that was killed):
|
|
122
|
+
* those older than an hour, so a write in progress in another process is never touched. Says
|
|
123
|
+
* which it removed; a folder that can't be listed or a file that can't be removed is no error.
|
|
124
|
+
*/
|
|
125
|
+
export declare function sweepStaleTmp(dir: string, prefix: string): Promise<string[]>;
|
|
126
|
+
/**
|
|
127
|
+
* Rename, waiting for a held target as `retryHeld` says. The third argument is the options, or
|
|
128
|
+
* the number of quick tries (as before beta.28.5).
|
|
129
|
+
*/
|
|
130
|
+
export declare function renameRetrying(from: string, to: string, o?: HeldOptions | number): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Remove a file, waiting for one another program holds as a write waits (beta.28.5, the
|
|
133
|
+
* review: a plain `rm` of a held file threw the system's EPERM and ended a run over forty
|
|
134
|
+
* repos, as the rename had). A file that isn't there is no error.
|
|
135
|
+
*/
|
|
136
|
+
export declare function removeHeld(path: string, o?: HeldOptions): Promise<void>;
|
|
44
137
|
export interface LockInfo {
|
|
45
138
|
pid: number;
|
|
46
139
|
host: string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type FileHash } from "./file-pool.js";
|
|
2
|
+
/**
|
|
3
|
+
* The text hashes of a folder's files, kept between runs (beta.28.5, the owner's field report of
|
|
4
|
+
* beta.28.4: every build spent 20 to 34 s "reading the catalog's files to check the build" on a
|
|
5
|
+
* Windows laptop with antivirus, 12,832 record files opened and hashed by each command of a run
|
|
6
|
+
* of forty, although none had changed; an open is what such a machine makes slow, a stat is not).
|
|
7
|
+
*
|
|
8
|
+
* Each file's hash (`textShaOf`, what `hashFilesIn` gives) is kept in
|
|
9
|
+
* `<cacheRoot>/.atticus/cache/`, by the file's path, size and modification time, under the rule
|
|
10
|
+
* the kept parses go by (record-cache.ts, ADR 0119 with its addendum, Git's "racily clean"):
|
|
11
|
+
*
|
|
12
|
+
* - a file whose size, time, change time or identity (its inode, NTFS's file id; not compared
|
|
13
|
+
* where the platform reports none) is another than the one its hash was kept by is read
|
|
14
|
+
* and hashed. The change time (ctime) is the system's own record of the last change to the
|
|
15
|
+
* file's bytes or its times, and no program sets it: an edit that puts the file's time back
|
|
16
|
+
* (a copy that keeps times, a restore) still moves it, which size and time alone would miss;
|
|
17
|
+
* - so is a file whose time or change time is within `RACY_MS` of the moment its hash was kept
|
|
18
|
+
* (a same-size edit within the timestamp's grain could keep them), until a later read finds
|
|
19
|
+
* it older;
|
|
20
|
+
* - any other file is not opened: any edit after its hash was kept has a later change time.
|
|
21
|
+
*
|
|
22
|
+
* So a hand edit of a record file is seen as it was before (the build's guards compare these
|
|
23
|
+
* hashes with build.json's), a same-size edit included, and a run with nothing changed costs a
|
|
24
|
+
* stat per file. The cache is derived, local to this machine and never committed; one that can't
|
|
25
|
+
* be read costs the hashes, one that can't be written costs the next run's. A read that names no
|
|
26
|
+
* `cacheRoot` keeps nothing and writes nothing (ADR 0038), and one with `keep: false` (a
|
|
27
|
+
* preview) reads what is kept and writes nothing.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Tests hear how many files each call opened and hashed; with `off`, every file is read and
|
|
31
|
+
* hashed and nothing is kept, as before there were kept hashes (an equivalence test's other side).
|
|
32
|
+
*/
|
|
33
|
+
export declare const hashCacheHooks: {
|
|
34
|
+
onHashed?: (files: number) => void;
|
|
35
|
+
off?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Every named file under `dir` with its text hash, size and time, in the order of `files`, as
|
|
39
|
+
* `hashFilesIn` gives them: from the hashes kept under `cacheRoot` for the files that haven't
|
|
40
|
+
* changed since, from the files for the rest. A file that can't be opened fails the call, as
|
|
41
|
+
* there (ENOENT for one gone since it was listed).
|
|
42
|
+
*/
|
|
43
|
+
export declare function hashFilesKept(o: {
|
|
44
|
+
dir: string;
|
|
45
|
+
/** Relative to `dir`, with forward slashes. */
|
|
46
|
+
files: readonly string[];
|
|
47
|
+
/** The metarepo this run is working in; none: every file is hashed and nothing is kept. */
|
|
48
|
+
cacheRoot?: string;
|
|
49
|
+
/** False: the kept hashes are read and nothing is written (a preview). */
|
|
50
|
+
keep?: boolean;
|
|
51
|
+
/** A job's Stop: ends the read with CancelledError; nothing is kept of a stopped read. */
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}): Promise<FileHash[]>;
|
package/npm/core/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from "./org-notes.js";
|
|
|
16
16
|
export * from "./link-evidence.js";
|
|
17
17
|
export * from "./shared-maps.js";
|
|
18
18
|
export * from "./contract-check.js";
|
|
19
|
+
export * from "./field-places.js";
|
|
19
20
|
export * from "./audit.js";
|
|
20
21
|
export * from "./canary.js";
|
|
21
22
|
export * from "./stack-helpers.js";
|
|
@@ -61,6 +62,7 @@ export * from "./glob.js";
|
|
|
61
62
|
export * from "./repo-files.js";
|
|
62
63
|
export * from "./record-cache.js";
|
|
63
64
|
export * from "./file-pool.js";
|
|
65
|
+
export * from "./hash-cache.js";
|
|
64
66
|
export * from "./kept-files.js";
|
|
65
67
|
export * from "./log.js";
|
|
66
68
|
export * from "./run-log.js";
|
|
@@ -92,4 +94,5 @@ export * from "./link-candidates.js";
|
|
|
92
94
|
export * from "./ai-decisions.js";
|
|
93
95
|
export * from "./decision-batches.js";
|
|
94
96
|
export * from "./declared-links.js";
|
|
97
|
+
export * from "./declarable-routes.js";
|
|
95
98
|
export * from "./schema/reading-rules.js";
|
package/npm/core/schema/ai.d.ts
CHANGED
|
@@ -334,10 +334,10 @@ export declare const RunSummary: z.ZodObject<{
|
|
|
334
334
|
}, z.core.$strict>>;
|
|
335
335
|
stepClass: z.ZodOptional<z.ZodEnum<{
|
|
336
336
|
read: "read";
|
|
337
|
+
quick: "quick";
|
|
337
338
|
draft: "draft";
|
|
338
339
|
critic: "critic";
|
|
339
340
|
knowledge: "knowledge";
|
|
340
|
-
quick: "quick";
|
|
341
341
|
}>>;
|
|
342
342
|
model: z.ZodOptional<z.ZodString>;
|
|
343
343
|
assistant: z.ZodOptional<z.ZodObject<{
|
|
@@ -416,7 +416,7 @@ export declare const readRunSummary: (raw: unknown) => z.ZodSafeParseResult<{
|
|
|
416
416
|
} | undefined;
|
|
417
417
|
meaning?: string | undefined;
|
|
418
418
|
} | undefined;
|
|
419
|
-
stepClass?: "read" | "
|
|
419
|
+
stepClass?: "read" | "quick" | "draft" | "critic" | "knowledge" | undefined;
|
|
420
420
|
model?: string | undefined;
|
|
421
421
|
assistant?: {
|
|
422
422
|
name: string;
|
|
@@ -772,10 +772,10 @@ export type AssistantId = z.infer<typeof AssistantId>;
|
|
|
772
772
|
export declare const STEP_CLASSES: readonly ["read", "draft", "critic", "knowledge", "quick"];
|
|
773
773
|
export declare const StepClass: z.ZodEnum<{
|
|
774
774
|
read: "read";
|
|
775
|
+
quick: "quick";
|
|
775
776
|
draft: "draft";
|
|
776
777
|
critic: "critic";
|
|
777
778
|
knowledge: "knowledge";
|
|
778
|
-
quick: "quick";
|
|
779
779
|
}>;
|
|
780
780
|
export type StepClass = z.infer<typeof StepClass>;
|
|
781
781
|
/**
|
package/npm/index.js
CHANGED
|
@@ -5289,6 +5289,12 @@ var KNOWN_KINDS = new Set(FACT_KINDS);
|
|
|
5289
5289
|
// packages/core/dist/host-questions.js
|
|
5290
5290
|
import { isAlias, isMap as isMap4, isNode, isSeq as isSeq2, parseDocument as parseDocument4, visit, YAMLSeq } from "yaml";
|
|
5291
5291
|
|
|
5292
|
+
// packages/core/dist/cancel.js
|
|
5293
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5294
|
+
var store = new AsyncLocalStorage();
|
|
5295
|
+
var commits = new AsyncLocalStorage();
|
|
5296
|
+
var releases = new AsyncLocalStorage();
|
|
5297
|
+
|
|
5292
5298
|
// packages/core/dist/fs.js
|
|
5293
5299
|
init_kept_files();
|
|
5294
5300
|
|
|
@@ -5441,6 +5447,13 @@ var SharedMapFile = z15.strictObject({
|
|
|
5441
5447
|
|
|
5442
5448
|
// packages/core/dist/contract-check.js
|
|
5443
5449
|
import { z as z16 } from "zod";
|
|
5450
|
+
|
|
5451
|
+
// packages/core/dist/field-places.js
|
|
5452
|
+
var LISTS = new Set("List ArrayList LinkedList Set HashSet LinkedHashSet TreeSet SortedSet Collection Iterable Iterator Stream Flux Queue Deque IEnumerable IList ICollection IReadOnlyList IReadOnlyCollection ISet ImmutableList ImmutableArray ImmutableSet Array ReadonlyArray MutableList MutableSet Sequence Seq Vec Slice list set tuple frozenset".split(" "));
|
|
5453
|
+
var MAPS = new Set("Map HashMap LinkedHashMap TreeMap SortedMap ConcurrentHashMap MutableMap Dictionary IDictionary IReadOnlyDictionary ImmutableDictionary Record Dict dict Mapping map".split(" "));
|
|
5454
|
+
var PASS = new Set("Optional Option Maybe Nullable Mono Single CompletableFuture CompletionStage Future Promise Task ValueTask Awaited Lazy Provider Supplier ResponseEntity HttpEntity ActionResult Partial Readonly Required Union Annotated Final Box Rc Arc".split(" "));
|
|
5455
|
+
|
|
5456
|
+
// packages/core/dist/contract-check.js
|
|
5444
5457
|
init_identity();
|
|
5445
5458
|
var SpecField = z16.strictObject({
|
|
5446
5459
|
side: z16.enum(["request", "response", "message"]),
|
|
@@ -10189,10 +10202,61 @@ var DeclareLinkRequest = z31.discriminatedUnion("kind", [
|
|
|
10189
10202
|
kind: z31.literal("call"),
|
|
10190
10203
|
system: z31.string().min(1),
|
|
10191
10204
|
/** `METHOD /path` as the gateway serves it, or the route's handler `proxy/flow`. */
|
|
10192
|
-
route: z31.string().min(1).max(300),
|
|
10205
|
+
route: z31.string().min(1).max(300).optional(),
|
|
10206
|
+
/**
|
|
10207
|
+
* 3.17 (ADR 0200): several routes in place of `route`, as GET /api/declared-links/routes
|
|
10208
|
+
* says them (`say`): one line each, written once, sorted, in one write.
|
|
10209
|
+
*/
|
|
10210
|
+
routes: z31.array(z31.string().min(1).max(300)).min(1).max(200).optional(),
|
|
10193
10211
|
preview: z31.boolean().optional()
|
|
10194
10212
|
})
|
|
10195
10213
|
]);
|
|
10214
|
+
var DeclarableRouteView = z31.object({
|
|
10215
|
+
/** The route's entry fact. */
|
|
10216
|
+
id: z31.string(),
|
|
10217
|
+
method: z31.string().optional(),
|
|
10218
|
+
path: z31.string(),
|
|
10219
|
+
/** The handler or proxy flow that serves it, where the facts name one. */
|
|
10220
|
+
handler: z31.string().optional(),
|
|
10221
|
+
/** path:line of the line it was read from. */
|
|
10222
|
+
at: z31.string(),
|
|
10223
|
+
/** The words that declare it: what to send as a `routes` item. */
|
|
10224
|
+
say: z31.string(),
|
|
10225
|
+
/** The system declared it already. */
|
|
10226
|
+
declared: z31.boolean().optional(),
|
|
10227
|
+
/** The other repos whose route the same words name: the declaration lands there too. */
|
|
10228
|
+
also: z31.array(z31.string()).optional()
|
|
10229
|
+
});
|
|
10230
|
+
var DeclarableRoutesView = z31.object({
|
|
10231
|
+
/** The system the box is (a repo's id is the system its box is drawn as). */
|
|
10232
|
+
system: z31.string(),
|
|
10233
|
+
/**
|
|
10234
|
+
* A profile has the system, or the write adds it first (a repo's own box, 3.14 `created`).
|
|
10235
|
+
* False for a system only the code names: a declaration from it is refused (404) until a
|
|
10236
|
+
* system of that id is added to a profile (POST /api/boxes).
|
|
10237
|
+
*/
|
|
10238
|
+
inProfile: z31.boolean(),
|
|
10239
|
+
gateways: z31.array(z31.object({ repo: z31.string(), routes: z31.number().int().min(0) })),
|
|
10240
|
+
target: z31.object({
|
|
10241
|
+
repo: z31.string(),
|
|
10242
|
+
gateway: z31.boolean(),
|
|
10243
|
+
routes: z31.array(DeclarableRouteView),
|
|
10244
|
+
/** How many entries the repo has on record, routes or not. */
|
|
10245
|
+
entries: z31.number().int().min(0),
|
|
10246
|
+
/** The repo's type as its manifest says it, and the manifest's file. */
|
|
10247
|
+
type: z31.string().optional(),
|
|
10248
|
+
manifest: z31.string().optional(),
|
|
10249
|
+
/**
|
|
10250
|
+
* `gateway` is false, and the repo's type reads like a gateway's (as GET
|
|
10251
|
+
* /api/links/candidates tells a route): the join takes only the type `gateway` (or
|
|
10252
|
+
* `gateway-…`) or a proxy bundle folder, so setting the type to `gateway` in `manifest`
|
|
10253
|
+
* makes its entries routes.
|
|
10254
|
+
*/
|
|
10255
|
+
looksLikeGateway: z31.boolean().optional(),
|
|
10256
|
+
/** Nothing of the repo is on record: why, and the step that reads it. */
|
|
10257
|
+
notRead: z31.object({ why: z31.enum(["not-read", "unverified"]), command: z31.string() }).optional()
|
|
10258
|
+
}).optional()
|
|
10259
|
+
});
|
|
10196
10260
|
var FileChangeResult = z31.object({
|
|
10197
10261
|
written: z31.boolean(),
|
|
10198
10262
|
files: z31.array(z31.object({ file: z31.string(), changes: z31.array(LineChangeView) })),
|
|
@@ -12712,6 +12776,19 @@ var OPS = {
|
|
|
12712
12776
|
errors: [400, 404, 409, 422]
|
|
12713
12777
|
}
|
|
12714
12778
|
},
|
|
12779
|
+
"/api/declared-links/routes": {
|
|
12780
|
+
get: {
|
|
12781
|
+
id: "getDeclarableRoutes",
|
|
12782
|
+
summary: "3.17.0 (ADR 0200): what a system can be declared to call: the repos that have gateway routes and, with `repo`, that repo's routes to pick from, or that it has none (a declared call lands only on a gateway route)",
|
|
12783
|
+
tag: "workspace",
|
|
12784
|
+
params: [
|
|
12785
|
+
q("system", str3, "A system of the profiles, or the repo whose box it is drawn as"),
|
|
12786
|
+
q("repo", str3, "A repo of the manifest: its routes are listed")
|
|
12787
|
+
],
|
|
12788
|
+
ok: { status: 200, schema: "DeclarableRoutesView", description: "OK" },
|
|
12789
|
+
errors: [400, 404]
|
|
12790
|
+
}
|
|
12791
|
+
},
|
|
12715
12792
|
"/api/declared-links/undo": {
|
|
12716
12793
|
post: {
|
|
12717
12794
|
id: "undeclareLink",
|
|
@@ -13705,12 +13782,6 @@ init_common();
|
|
|
13705
13782
|
init_kinds();
|
|
13706
13783
|
init_kept_files();
|
|
13707
13784
|
|
|
13708
|
-
// packages/core/dist/cancel.js
|
|
13709
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
13710
|
-
var store = new AsyncLocalStorage();
|
|
13711
|
-
var commits = new AsyncLocalStorage();
|
|
13712
|
-
var releases = new AsyncLocalStorage();
|
|
13713
|
-
|
|
13714
13785
|
// packages/core/dist/gates-migrate.js
|
|
13715
13786
|
init_orgpack();
|
|
13716
13787
|
import { isMap as isMap6, isSeq as isSeq4, parseDocument as parseDocument6 } from "yaml";
|
|
@@ -14335,6 +14406,9 @@ init_question();
|
|
|
14335
14406
|
import { isMap as isMap11, isScalar as isScalar2, isSeq as isSeq6, parseDocument as parseDocument11 } from "yaml";
|
|
14336
14407
|
init_orgpack();
|
|
14337
14408
|
|
|
14409
|
+
// packages/core/dist/declarable-routes.js
|
|
14410
|
+
init_identity();
|
|
14411
|
+
|
|
14338
14412
|
// packages/core/dist/schema/reading-rules.js
|
|
14339
14413
|
import { z as z34 } from "zod";
|
|
14340
14414
|
var READING_RULES_SCHEMA_VERSION = 1;
|
package/package.json
CHANGED