@maycombhq/sdk 2.0.0-beta.28.3 → 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 +130 -7
- package/npm/core/cancel.d.ts +7 -0
- 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/glob-plain.d.ts +34 -0
- package/npm/core/hash-cache.d.ts +53 -0
- package/npm/core/index.d.ts +3 -0
- package/npm/core/link-candidates.d.ts +48 -0
- package/npm/core/repo-files.d.ts +6 -0
- package/npm/core/schema/ai.d.ts +2 -2
- package/npm/core/schema/orgpack.d.ts +1 -1
- package/npm/index.js +281 -34
- package/package.json +1 -1
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"]),
|
|
@@ -7232,6 +7245,19 @@ var FactsApplyResult = z31.object({
|
|
|
7232
7245
|
leftOut: z31.number().int().positive().optional(),
|
|
7233
7246
|
/** Apply to every repo's (POST /api/facts/apply-all): how many repos left facts out. */
|
|
7234
7247
|
leftOutRepos: z31.number().int().positive().optional(),
|
|
7248
|
+
/**
|
|
7249
|
+
* 3.16.0 (ADR 0198), POST /api/facts/apply-all's: the repos it applied (those that wrote with
|
|
7250
|
+
* facts left out too) and the repos it didn't (rejected facts, a refused build, no clone), each
|
|
7251
|
+
* list in id order. Neither when no repo was reached.
|
|
7252
|
+
*/
|
|
7253
|
+
applied: z31.array(z31.string()).optional(),
|
|
7254
|
+
notApplied: z31.array(z31.string()).optional(),
|
|
7255
|
+
/**
|
|
7256
|
+
* 3.16.0 (ADR 0198), POST /api/facts/apply-all's: Stop ended the run between two repos (its
|
|
7257
|
+
* job's state is `cancelled`). `applied` are applied whole; `notApplied` includes the repos it
|
|
7258
|
+
* never reached.
|
|
7259
|
+
*/
|
|
7260
|
+
stopped: z31.literal(true).optional(),
|
|
7235
7261
|
next: z31.unknown().optional()
|
|
7236
7262
|
});
|
|
7237
7263
|
var CatalogUpgradeView = z31.object({
|
|
@@ -8546,6 +8572,9 @@ var FactsApplyRequest = z31.strictObject({
|
|
|
8546
8572
|
discardEdits: z31.number().int().min(0).max(1e6).optional(),
|
|
8547
8573
|
plan: z31.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
8548
8574
|
});
|
|
8575
|
+
var FactsApplyAllRequest = z31.strictObject({
|
|
8576
|
+
repos: z31.array(z31.string().regex(/^[a-z0-9][a-z0-9._-]{0,99}$/i)).min(1).max(1e4).optional()
|
|
8577
|
+
});
|
|
8549
8578
|
var ScanRequest = z31.strictObject({
|
|
8550
8579
|
repos: z31.array(RecordId).optional(),
|
|
8551
8580
|
/** Ignore the cache and rescan everything. */
|
|
@@ -9623,6 +9652,34 @@ var CandidateCallView = z31.object({
|
|
|
9623
9652
|
]),
|
|
9624
9653
|
why: z31.string().optional(),
|
|
9625
9654
|
paired: z31.string().optional(),
|
|
9655
|
+
/**
|
|
9656
|
+
* 3.16 (ADR 0199): for `paired`, whether the map draws its arrow to this box: true once the
|
|
9657
|
+
* catalog has it (the repo was applied since the pairing), false while it doesn't.
|
|
9658
|
+
*/
|
|
9659
|
+
drawn: z31.boolean().optional(),
|
|
9660
|
+
/**
|
|
9661
|
+
* 3.16 (ADR 0199): for `paired`, the component both ends of the pairing are in: no arrow is
|
|
9662
|
+
* drawn between boxes for it, whatever is applied.
|
|
9663
|
+
*/
|
|
9664
|
+
inside: z31.string().optional(),
|
|
9665
|
+
/**
|
|
9666
|
+
* 3.16 (ADR 0199): the pairing `pairedBy` names is the AI's (ADR 0181), not confirmed by a
|
|
9667
|
+
* person. `pairedBy` is given for a `paired` call too.
|
|
9668
|
+
*/
|
|
9669
|
+
pairedAi: z31.boolean().optional(),
|
|
9670
|
+
/**
|
|
9671
|
+
* 3.16 (ADR 0199): the box the pairing `pairedBy` made names, when the call goes on from it
|
|
9672
|
+
* to `joins` (a gateway's route that forwards it).
|
|
9673
|
+
*/
|
|
9674
|
+
pairedWith: z31.string().optional(),
|
|
9675
|
+
/**
|
|
9676
|
+
* 3.16 (ADR 0199): why a call with a pairing goes to another box (`joins`) than the
|
|
9677
|
+
* pairing's, as the estate's join says: `forwarded`, the pairing is with a gateway's route
|
|
9678
|
+
* whose forwarding call reaches `joins` (one link, drawn from the caller to `joins`; for a
|
|
9679
|
+
* `paired` call `drawn` is of that arrow); `outranked`, the pairing is the AI's and a person's
|
|
9680
|
+
* answer names `joins` instead, so the pairing is not in effect.
|
|
9681
|
+
*/
|
|
9682
|
+
onward: z31.enum(["forwarded", "outranked"]).optional(),
|
|
9626
9683
|
/** 3.14: the box the call goes to now (a repo, or an outside target), before it is moved. */
|
|
9627
9684
|
joins: z31.string().optional(),
|
|
9628
9685
|
/** 3.14: for `here`, the API of this box the call goes to now. */
|
|
@@ -9661,7 +9718,14 @@ var LinkCandidatesView = z31.object({
|
|
|
9661
9718
|
/** No APIs of B on record: why, and how to get them (read the repo, verify it, or intake the spec). */
|
|
9662
9719
|
noApis: z31.object({ why: z31.enum(["not-read", "unverified", "no-spec"]), command: z31.string() }).optional(),
|
|
9663
9720
|
/** An open target question of A that one /** answer to B would close, with the calls it covers. */
|
|
9664
|
-
rule: z31.object({ question: z31.string(), calls: z31.number().int().min(0) }).optional()
|
|
9721
|
+
rule: z31.object({ question: z31.string(), calls: z31.number().int().min(0) }).optional(),
|
|
9722
|
+
/**
|
|
9723
|
+
* 3.16 (ADR 0199): A's corrections file is newer than A's last Apply (as a proposal's
|
|
9724
|
+
* `applyFirst` tells it): what a person paired or corrected since isn't on the map yet.
|
|
9725
|
+
*/
|
|
9726
|
+
applyPending: z31.boolean().optional(),
|
|
9727
|
+
/** 3.16 (ADR 0199): no catalog has been built yet, so the map draws nothing at all. */
|
|
9728
|
+
noCatalog: z31.boolean().optional()
|
|
9665
9729
|
});
|
|
9666
9730
|
var MatchLinksRequest = z31.object({ from: z31.string().min(1), to: LinkBox });
|
|
9667
9731
|
var MatchProposal = z31.object({
|
|
@@ -9952,7 +10016,12 @@ var OpenFolderView = z31.object({
|
|
|
9952
10016
|
var ReposPlanRequest = z31.strictObject({
|
|
9953
10017
|
urls: z31.string().max(2e5).optional(),
|
|
9954
10018
|
dir: z31.string().min(1).max(4096).optional(),
|
|
9955
|
-
platform: RecordId.optional()
|
|
10019
|
+
platform: RecordId.optional(),
|
|
10020
|
+
/**
|
|
10021
|
+
* 3.16.0 (ADR 0199): read as a job. 202 JobAccepted at once; the job says each folder as it
|
|
10022
|
+
* comes to it, hears Stop between folders, and its result's `answer` is the ReposPlanView.
|
|
10023
|
+
*/
|
|
10024
|
+
job: z31.boolean().optional()
|
|
9956
10025
|
}).refine((b) => !!b.urls?.trim() !== !!b.dir, "send urls or dir, one of them");
|
|
9957
10026
|
var PlannedRepoView = z31.object({
|
|
9958
10027
|
id: z31.string(),
|
|
@@ -10133,10 +10202,61 @@ var DeclareLinkRequest = z31.discriminatedUnion("kind", [
|
|
|
10133
10202
|
kind: z31.literal("call"),
|
|
10134
10203
|
system: z31.string().min(1),
|
|
10135
10204
|
/** `METHOD /path` as the gateway serves it, or the route's handler `proxy/flow`. */
|
|
10136
|
-
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(),
|
|
10137
10211
|
preview: z31.boolean().optional()
|
|
10138
10212
|
})
|
|
10139
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
|
+
});
|
|
10140
10260
|
var FileChangeResult = z31.object({
|
|
10141
10261
|
written: z31.boolean(),
|
|
10142
10262
|
files: z31.array(z31.object({ file: z31.string(), changes: z31.array(LineChangeView) })),
|
|
@@ -12384,14 +12504,15 @@ var OPS = {
|
|
|
12384
12504
|
"/api/facts/apply-all": {
|
|
12385
12505
|
post: {
|
|
12386
12506
|
id: "applyAllFacts",
|
|
12387
|
-
summary: "3.5.0 (ADR 0188): run atticus verify --all --write as a local job, as Apply after a declaration or an owner set on the canvas",
|
|
12507
|
+
summary: "3.5.0 (ADR 0188): run atticus verify --all --write as a local job, as Apply after a declaration or an owner set on the canvas; 3.16.0 (ADR 0198): with `repos`, only those repos (the ones whose corrections wait), in id order; 400 when one has no facts on file",
|
|
12388
12508
|
tag: "workspace",
|
|
12509
|
+
body: FactsApplyAllRequest,
|
|
12389
12510
|
ok: {
|
|
12390
12511
|
status: 202,
|
|
12391
12512
|
schema: "JobAccepted",
|
|
12392
|
-
description: "Started: its job's result is FactsApplyResult: the code and the lines verify printed,
|
|
12513
|
+
description: "Started: its job's result is FactsApplyResult: the code and the lines verify printed, (3.14.0) leftOut and leftOutRepos when repos wrote with rejected facts left out (applied, code 0), and (3.16.0) applied and notApplied, the repos by name"
|
|
12393
12514
|
},
|
|
12394
|
-
errors: [409]
|
|
12515
|
+
errors: [400, 409]
|
|
12395
12516
|
}
|
|
12396
12517
|
},
|
|
12397
12518
|
"/api/estate/join": {
|
|
@@ -12487,10 +12608,11 @@ var OPS = {
|
|
|
12487
12608
|
"/api/setup/repos/plan": {
|
|
12488
12609
|
post: {
|
|
12489
12610
|
id: "planRepos",
|
|
12490
|
-
summary: "The repos pasted clone URLs (one a line, up to 500) or a folder of clones (repos discover's own code, a dry run) would add: each normalised URL and the id repo add gives it, a clone URL a manifest lists already left out, a taken id given -2, and a folder's type from its files. A folder with several platforms and none given reads nothing and answers the platforms to choose from (`platforms`, no `platform`). Writes nothing",
|
|
12611
|
+
summary: "The repos pasted clone URLs (one a line, up to 500) or a folder of clones (repos discover's own code, a dry run) would add: each normalised URL and the id repo add gives it, a clone URL a manifest lists already left out, a taken id given -2, and a folder's type from its files. A folder with several platforms and none given reads nothing and answers the platforms to choose from (`platforms`, no `platform`). Writes nothing. 3.16.0 (ADR 0199): a folder's repo a manifest lists already is told by its clone URL and not read (`listed`), a folder that takes over a minute to read is skipped saying so (`skipped`), and with `job: true` the read is a job: 202 JobAccepted at once, a line a folder, Stop heard between folders, the plan in the job's result `answer` (or `problem`)",
|
|
12491
12612
|
tag: "run",
|
|
12492
12613
|
body: ReposPlanRequest,
|
|
12493
12614
|
ok: { status: 200, schema: "ReposPlanView", description: "OK" },
|
|
12615
|
+
alsoOk: { status: 202, schema: "JobAccepted", description: "Started as a job (`job: true`)" },
|
|
12494
12616
|
errors: [400, 404, 409, 422]
|
|
12495
12617
|
}
|
|
12496
12618
|
},
|
|
@@ -12654,6 +12776,19 @@ var OPS = {
|
|
|
12654
12776
|
errors: [400, 404, 409, 422]
|
|
12655
12777
|
}
|
|
12656
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
|
+
},
|
|
12657
12792
|
"/api/declared-links/undo": {
|
|
12658
12793
|
post: {
|
|
12659
12794
|
id: "undeclareLink",
|
|
@@ -13647,11 +13782,6 @@ init_common();
|
|
|
13647
13782
|
init_kinds();
|
|
13648
13783
|
init_kept_files();
|
|
13649
13784
|
|
|
13650
|
-
// packages/core/dist/cancel.js
|
|
13651
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
13652
|
-
var store = new AsyncLocalStorage();
|
|
13653
|
-
var commits = new AsyncLocalStorage();
|
|
13654
|
-
|
|
13655
13785
|
// packages/core/dist/gates-migrate.js
|
|
13656
13786
|
init_orgpack();
|
|
13657
13787
|
import { isMap as isMap6, isSeq as isSeq4, parseDocument as parseDocument6 } from "yaml";
|
|
@@ -13667,9 +13797,81 @@ import { isMap as isMap8, parseDocument as parseDocument8 } from "yaml";
|
|
|
13667
13797
|
// packages/core/dist/runtime-migrate.js
|
|
13668
13798
|
import { isMap as isMap9, parseDocument as parseDocument9 } from "yaml";
|
|
13669
13799
|
|
|
13800
|
+
// packages/core/dist/glob-plain.js
|
|
13801
|
+
var LINE_END = /[\n\r\u2028\u2029]/;
|
|
13802
|
+
function tidy(glob) {
|
|
13803
|
+
return glob.trim().replace(/\\/g, "/").replace(/^\.\//, "");
|
|
13804
|
+
}
|
|
13805
|
+
function hasLineEnd(path) {
|
|
13806
|
+
return LINE_END.test(path);
|
|
13807
|
+
}
|
|
13808
|
+
function plainGlob(glob, anyDepth = !glob.replace(/\/$/, "").includes("/")) {
|
|
13809
|
+
let g = tidy(glob);
|
|
13810
|
+
if (g.startsWith("/")) {
|
|
13811
|
+
g = g.slice(1);
|
|
13812
|
+
anyDepth = false;
|
|
13813
|
+
}
|
|
13814
|
+
return plainOf(g, anyDepth);
|
|
13815
|
+
}
|
|
13816
|
+
function plainOf(g, anyDepth) {
|
|
13817
|
+
const special = /[*?[{]/;
|
|
13818
|
+
if (!special.test(g))
|
|
13819
|
+
return { kind: anyDepth ? "name" : "is", text: g };
|
|
13820
|
+
if (!anyDepth)
|
|
13821
|
+
return void 0;
|
|
13822
|
+
const rest = g.slice(1);
|
|
13823
|
+
if (g.startsWith("*") && rest && !special.test(rest) && !rest.includes("/"))
|
|
13824
|
+
return { kind: "suffix", text: rest };
|
|
13825
|
+
const head = g.slice(0, -1);
|
|
13826
|
+
if (g.endsWith("*") && head && !special.test(head) && !head.includes("/"))
|
|
13827
|
+
return { kind: "prefix", text: head };
|
|
13828
|
+
return void 0;
|
|
13829
|
+
}
|
|
13830
|
+
function plainTest(g, path) {
|
|
13831
|
+
switch (g.kind) {
|
|
13832
|
+
case "is":
|
|
13833
|
+
return path === g.text;
|
|
13834
|
+
case "name":
|
|
13835
|
+
return path === g.text || path.endsWith(g.text) && path.charCodeAt(path.length - g.text.length - 1) === 47;
|
|
13836
|
+
case "suffix":
|
|
13837
|
+
return path.endsWith(g.text);
|
|
13838
|
+
case "prefix":
|
|
13839
|
+
return path.startsWith(g.text, path.lastIndexOf("/") + 1);
|
|
13840
|
+
}
|
|
13841
|
+
}
|
|
13842
|
+
function neededText(g) {
|
|
13843
|
+
let best = "";
|
|
13844
|
+
let run = "";
|
|
13845
|
+
const cut = () => {
|
|
13846
|
+
if (run.length > best.length)
|
|
13847
|
+
best = run;
|
|
13848
|
+
run = "";
|
|
13849
|
+
};
|
|
13850
|
+
for (let i = 0; i < g.length; i++) {
|
|
13851
|
+
const ch = g[i];
|
|
13852
|
+
if (ch === "*") {
|
|
13853
|
+
cut();
|
|
13854
|
+
if (g[i + 1] === "*")
|
|
13855
|
+
i += g[i + 2] === "/" ? 2 : 1;
|
|
13856
|
+
} else if (ch === "?")
|
|
13857
|
+
cut();
|
|
13858
|
+
else if (ch === "[" && g.indexOf("]", i + 2) >= 0) {
|
|
13859
|
+
cut();
|
|
13860
|
+
i = g.indexOf("]", i + 2);
|
|
13861
|
+
} else if (ch === "{" && g.indexOf("}", i) >= 0) {
|
|
13862
|
+
cut();
|
|
13863
|
+
i = g.indexOf("}", i);
|
|
13864
|
+
} else
|
|
13865
|
+
run += ch;
|
|
13866
|
+
}
|
|
13867
|
+
cut();
|
|
13868
|
+
return best;
|
|
13869
|
+
}
|
|
13870
|
+
|
|
13670
13871
|
// packages/core/dist/glob.js
|
|
13671
13872
|
var notSlash = (c) => c !== "/";
|
|
13672
|
-
var anyChar = (c) =>
|
|
13873
|
+
var anyChar = (c) => c !== "\n" && c !== "\r" && c !== "\u2028" && c !== "\u2029";
|
|
13874
|
+
var REMEMBERED = 4096;
|
|
13673
13875
|
var Builder = class {
|
|
13674
13876
|
states = [];
|
|
13675
13877
|
add(s) {
|
|
@@ -13689,9 +13891,6 @@ var Builder = class {
|
|
|
13689
13891
|
return this.add({ kind: "split", outs: [this.loop(anyChar, slash), next] });
|
|
13690
13892
|
}
|
|
13691
13893
|
};
|
|
13692
|
-
function tidy(glob) {
|
|
13693
|
-
return glob.trim().replace(/\\/g, "/").replace(/^\.\//, "");
|
|
13694
|
-
}
|
|
13695
13894
|
function compile(b, g, next) {
|
|
13696
13895
|
const pieces = [];
|
|
13697
13896
|
for (let i = 0; i < g.length; i++) {
|
|
@@ -13755,6 +13954,8 @@ function globMatcher(glob, anyDepth = !glob.replace(/\/$/, "").includes("/")) {
|
|
|
13755
13954
|
if (anyDepth)
|
|
13756
13955
|
start = b.folders(start);
|
|
13757
13956
|
const states = b.states;
|
|
13957
|
+
const plain = plainOf(g, anyDepth);
|
|
13958
|
+
const needed = neededText(g);
|
|
13758
13959
|
const close = (set, s) => {
|
|
13759
13960
|
const stack = [s];
|
|
13760
13961
|
while (stack.length) {
|
|
@@ -13768,23 +13969,57 @@ function globMatcher(glob, anyDepth = !glob.replace(/\/$/, "").includes("/")) {
|
|
|
13768
13969
|
stack.push(o);
|
|
13769
13970
|
}
|
|
13770
13971
|
};
|
|
13972
|
+
const lives = /* @__PURE__ */ new Map();
|
|
13973
|
+
let remembered = 0;
|
|
13974
|
+
const liveOf = (set) => {
|
|
13975
|
+
const sorted = [...set].sort((x, y) => x - y);
|
|
13976
|
+
const key = sorted.join(",");
|
|
13977
|
+
const had = lives.get(key);
|
|
13978
|
+
if (had)
|
|
13979
|
+
return had;
|
|
13980
|
+
const made = { set: sorted, accepts: set.has(end), next: /* @__PURE__ */ new Map(), ascii: [] };
|
|
13981
|
+
if (lives.size < REMEMBERED)
|
|
13982
|
+
lives.set(key, made);
|
|
13983
|
+
return made;
|
|
13984
|
+
};
|
|
13985
|
+
const first = /* @__PURE__ */ new Set();
|
|
13986
|
+
close(first, start);
|
|
13987
|
+
const begin = liveOf(first);
|
|
13988
|
+
const step = (from, code) => {
|
|
13989
|
+
const had = code < 128 ? from.ascii[code] : from.next.get(code);
|
|
13990
|
+
if (had !== void 0)
|
|
13991
|
+
return had;
|
|
13992
|
+
const c = String.fromCharCode(code);
|
|
13993
|
+
const next = /* @__PURE__ */ new Set();
|
|
13994
|
+
for (const s of from.set) {
|
|
13995
|
+
const st = states[s];
|
|
13996
|
+
if (st.kind === "char" && st.test(c))
|
|
13997
|
+
close(next, st.out);
|
|
13998
|
+
}
|
|
13999
|
+
const to = next.size ? liveOf(next) : null;
|
|
14000
|
+
if (remembered < REMEMBERED) {
|
|
14001
|
+
remembered++;
|
|
14002
|
+
if (code < 128)
|
|
14003
|
+
from.ascii[code] = to;
|
|
14004
|
+
else
|
|
14005
|
+
from.next.set(code, to);
|
|
14006
|
+
}
|
|
14007
|
+
return to;
|
|
14008
|
+
};
|
|
13771
14009
|
return {
|
|
13772
14010
|
test(path) {
|
|
13773
|
-
|
|
13774
|
-
|
|
14011
|
+
if (plain && !hasLineEnd(path))
|
|
14012
|
+
return plainTest(plain, path);
|
|
14013
|
+
if (needed && !path.includes(needed))
|
|
14014
|
+
return false;
|
|
14015
|
+
let live = begin;
|
|
13775
14016
|
for (let i = 0; i < path.length; i++) {
|
|
13776
|
-
const
|
|
13777
|
-
|
|
13778
|
-
for (const s of live) {
|
|
13779
|
-
const st = states[s];
|
|
13780
|
-
if (st.kind === "char" && st.test(c))
|
|
13781
|
-
close(next, st.out);
|
|
13782
|
-
}
|
|
13783
|
-
if (!next.size)
|
|
14017
|
+
const to = step(live, path.charCodeAt(i));
|
|
14018
|
+
if (!to)
|
|
13784
14019
|
return false;
|
|
13785
|
-
live =
|
|
14020
|
+
live = to;
|
|
13786
14021
|
}
|
|
13787
|
-
return live.
|
|
14022
|
+
return live.accepts;
|
|
13788
14023
|
}
|
|
13789
14024
|
};
|
|
13790
14025
|
}
|
|
@@ -13850,24 +14085,33 @@ function ignoreRules(text3, base) {
|
|
|
13850
14085
|
continue;
|
|
13851
14086
|
const anchored = line.includes("/");
|
|
13852
14087
|
try {
|
|
13853
|
-
|
|
14088
|
+
const glob = line.replace(/^\//, "");
|
|
14089
|
+
const plain = plainGlob(glob, !anchored);
|
|
14090
|
+
out.push({
|
|
14091
|
+
base,
|
|
14092
|
+
re: globMatcher(glob, !anchored),
|
|
14093
|
+
negate,
|
|
14094
|
+
dirOnly,
|
|
14095
|
+
...plain ? { plain } : {}
|
|
14096
|
+
});
|
|
13854
14097
|
} catch {
|
|
13855
14098
|
}
|
|
13856
14099
|
}
|
|
13857
14100
|
return out;
|
|
13858
14101
|
}
|
|
13859
14102
|
function ignoredBy(rules, path, isDir) {
|
|
13860
|
-
|
|
13861
|
-
for (
|
|
14103
|
+
const plainPath = !hasLineEnd(path);
|
|
14104
|
+
for (let i = rules.length - 1; i >= 0; i--) {
|
|
14105
|
+
const r = rules[i];
|
|
13862
14106
|
if (r.dirOnly && !isDir)
|
|
13863
14107
|
continue;
|
|
13864
14108
|
if (r.base && !path.startsWith(`${r.base}/`))
|
|
13865
14109
|
continue;
|
|
13866
14110
|
const rel = r.base ? path.slice(r.base.length + 1) : path;
|
|
13867
|
-
if (r.re.test(rel))
|
|
13868
|
-
|
|
14111
|
+
if (r.plain && plainPath ? plainTest(r.plain, rel) : r.re.test(rel))
|
|
14112
|
+
return !r.negate;
|
|
13869
14113
|
}
|
|
13870
|
-
return
|
|
14114
|
+
return false;
|
|
13871
14115
|
}
|
|
13872
14116
|
var byName = (a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0;
|
|
13873
14117
|
function folder(entries, rel, inherited, gitignore) {
|
|
@@ -14162,6 +14406,9 @@ init_question();
|
|
|
14162
14406
|
import { isMap as isMap11, isScalar as isScalar2, isSeq as isSeq6, parseDocument as parseDocument11 } from "yaml";
|
|
14163
14407
|
init_orgpack();
|
|
14164
14408
|
|
|
14409
|
+
// packages/core/dist/declarable-routes.js
|
|
14410
|
+
init_identity();
|
|
14411
|
+
|
|
14165
14412
|
// packages/core/dist/schema/reading-rules.js
|
|
14166
14413
|
import { z as z34 } from "zod";
|
|
14167
14414
|
var READING_RULES_SCHEMA_VERSION = 1;
|
package/package.json
CHANGED