@prestack/thread 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +227 -0
- package/dist/core/attach.js +21 -0
- package/dist/core/descend.js +6 -3
- package/dist/core/generators/commit.js +55 -3
- package/dist/core/generators/dev.d.ts +1 -0
- package/dist/core/generators/dev.js +69 -0
- package/dist/derivation/generators/build.d.ts +3 -1
- package/dist/derivation/generators/build.js +104 -22
- package/dist/derivation/generators/release.js +74 -25
- package/dist/derivation/release.js +3 -3
- package/dist/integrations/cli.d.ts +0 -1
- package/dist/integrations/cli.js +69 -11
- package/dist/integrations/declared.d.ts +2 -0
- package/dist/integrations/declared.js +6 -1
- package/dist/integrations/pglite.js +13 -3
- package/dist/integrations/target.d.ts +3 -0
- package/dist/integrity/attach.js +1 -5
- package/dist/integrity/slopnators/sl_stale_path.js +10 -0
- package/dist/operations/access.js +3 -2
- package/dist/operations/capabilities.d.ts +2 -0
- package/dist/operations/capabilities.js +2 -0
- package/dist/operations/generators/capability.js +237 -24
- package/dist/operations/generators/compile.js +150 -50
- package/dist/operations/generators/seed.d.ts +3 -0
- package/dist/operations/generators/seed.js +25 -3
- package/dist/operations/nodes.d.ts +2 -2
- package/package.json +1 -1
- package/dist/core/actor.ts +0 -21
- package/dist/core/attach.ts +0 -613
- package/dist/core/chain.ts +0 -145
- package/dist/core/condition.ts +0 -227
- package/dist/core/descend.ts +0 -1185
- package/dist/core/errors/catalogue.ts +0 -314
- package/dist/core/errors/classes.ts +0 -51
- package/dist/core/errors/error.ts +0 -152
- package/dist/core/errors/namespaces.ts +0 -19
- package/dist/core/finding.ts +0 -37
- package/dist/core/generators/commit.ts +0 -157
- package/dist/core/init.ts +0 -222
- package/dist/core/invoked.ts +0 -52
- package/dist/core/round.ts +0 -74
- package/dist/core/rows.ts +0 -506
- package/dist/core/scope.ts +0 -20
- package/dist/core/thread.ts +0 -29
- package/dist/core/tree.ts +0 -90
- package/dist/core/types.ts +0 -351
- package/dist/derivation/attach.ts +0 -57
- package/dist/derivation/generators/build.ts +0 -371
- package/dist/derivation/generators/check.ts +0 -118
- package/dist/derivation/generators/determinism.ts +0 -145
- package/dist/derivation/generators/release.ts +0 -236
- package/dist/derivation/release.ts +0 -43
- package/dist/integrations/attach.ts +0 -187
- package/dist/integrations/cli.ts +0 -606
- package/dist/integrations/declared.ts +0 -34
- package/dist/integrations/disk.ts +0 -466
- package/dist/integrations/generators/read.ts +0 -127
- package/dist/integrations/generators/vault.ts +0 -210
- package/dist/integrations/https.ts +0 -216
- package/dist/integrations/pglite.ts +0 -206
- package/dist/integrations/secret.ts +0 -54
- package/dist/integrations/target.ts +0 -672
- package/dist/integrations/vault.ts +0 -148
- package/dist/integrity/attach.ts +0 -150
- package/dist/integrity/check-threads.ts +0 -166
- package/dist/integrity/constraint.ts +0 -1246
- package/dist/integrity/generators/compiler.ts +0 -138
- package/dist/integrity/generators/gate.ts +0 -227
- package/dist/integrity/generators/issues.ts +0 -160
- package/dist/integrity/generators/publish.ts +0 -233
- package/dist/integrity/generators/trial.ts +0 -359
- package/dist/integrity/lint.ts +0 -214
- package/dist/integrity/lsp/bin.ts +0 -44
- package/dist/integrity/lsp/diagnostics.ts +0 -92
- package/dist/integrity/lsp/findings.ts +0 -63
- package/dist/integrity/lsp/lint.ts +0 -124
- package/dist/integrity/lsp/protocol.ts +0 -78
- package/dist/integrity/lsp/server.ts +0 -224
- package/dist/integrity/slopnator.ts +0 -324
- package/dist/integrity/slopnators/sl_broken_lineage.ts +0 -38
- package/dist/integrity/slopnators/sl_declared_elsewhere.ts +0 -60
- package/dist/integrity/slopnators/sl_derived_drift.ts +0 -101
- package/dist/integrity/slopnators/sl_door_in_a_node.ts +0 -250
- package/dist/integrity/slopnators/sl_hardcoded_style.ts +0 -55
- package/dist/integrity/slopnators/sl_inert_island.ts +0 -84
- package/dist/integrity/slopnators/sl_inert_slopnator.ts +0 -93
- package/dist/integrity/slopnators/sl_missing_row.ts +0 -140
- package/dist/integrity/slopnators/sl_no_barrel.ts +0 -48
- package/dist/integrity/slopnators/sl_no_child_process.ts +0 -100
- package/dist/integrity/slopnators/sl_no_comment.ts +0 -43
- package/dist/integrity/slopnators/sl_no_dispatch_bypass.ts +0 -276
- package/dist/integrity/slopnators/sl_no_import_cycle.ts +0 -66
- package/dist/integrity/slopnators/sl_no_such_command.ts +0 -81
- package/dist/integrity/slopnators/sl_only_takes_a_literal.ts +0 -63
- package/dist/integrity/slopnators/sl_outside_an_operation.ts +0 -25
- package/dist/integrity/slopnators/sl_screen_holds_only_declared.ts +0 -70
- package/dist/integrity/slopnators/sl_secret_literal.ts +0 -68
- package/dist/integrity/slopnators/sl_stale_path.ts +0 -178
- package/dist/integrity/slopnators/sl_twice_meant.ts +0 -57
- package/dist/integrity/slopnators/sl_twice_parented.ts +0 -82
- package/dist/integrity/slopnators/sl_undeclared_crossing.ts +0 -481
- package/dist/integrity/slopnators/sl_undeclared_destination.ts +0 -113
- package/dist/integrity/slopnators/sl_undeclared_element.ts +0 -44
- package/dist/integrity/slopnators/sl_undeclared_list.ts +0 -358
- package/dist/integrity/slopnators/sl_undeclared_node.ts +0 -75
- package/dist/integrity/slopnators/sl_undeclared_operation.ts +0 -257
- package/dist/integrity/slopnators/sl_undeclared_variant.ts +0 -152
- package/dist/integrity/slopnators/sl_undeclared_webhook.ts +0 -108
- package/dist/integrity/slopnators/sl_underived_route.ts +0 -72
- package/dist/integrity/slopnators/sl_undescribed.ts +0 -65
- package/dist/integrity/slopnators/sl_ungoverned_island.ts +0 -60
- package/dist/integrity/slopnators/sl_unlisted_program.ts +0 -46
- package/dist/integrity/slopnators/sl_unnamed_island.ts +0 -41
- package/dist/integrity/slopnators/sl_unpaired_member.ts +0 -139
- package/dist/integrity/slopnators/sl_unpaired_slopnator.ts +0 -71
- package/dist/integrity/slopnators/sl_unprefixed_member.ts +0 -110
- package/dist/integrity/slopnators/sl_unthreaded.ts +0 -421
- package/dist/integrity/slopnators/sl_untranslated_key.ts +0 -140
- package/dist/integrity/slopnators/sl_unvaulted_secret.ts +0 -132
- package/dist/integrity/slopnators/sl_unversioned.ts +0 -52
- package/dist/integrity/sweep.ts +0 -395
- package/dist/knowledge/attach.ts +0 -327
- package/dist/knowledge/generators/docsgen.ts +0 -186
- package/dist/knowledge/generators/glossary.ts +0 -73
- package/dist/knowledge/glossary.ts +0 -6
- package/dist/operations/access.ts +0 -131
- package/dist/operations/attach.ts +0 -408
- package/dist/operations/capabilities.ts +0 -88
- package/dist/operations/dispatch.ts +0 -294
- package/dist/operations/error-results.ts +0 -31
- package/dist/operations/generators/capability.ts +0 -1054
- package/dist/operations/generators/compile.ts +0 -701
- package/dist/operations/generators/permits.ts +0 -229
- package/dist/operations/generators/seed.ts +0 -359
- package/dist/operations/generators/trial.ts +0 -666
- package/dist/operations/nodes.ts +0 -53
- package/dist/operations/operations.ts +0 -91
- package/dist/operations/result.ts +0 -28
|
@@ -50,6 +50,11 @@ export function builtFrom(row, known) {
|
|
|
50
50
|
const found = (row.requires ?? []).filter((one) => known.has(one));
|
|
51
51
|
return found.length === 1 ? found[0] : undefined;
|
|
52
52
|
}
|
|
53
|
+
export const HOLDING = {
|
|
54
|
+
nd_repeat: () => '1',
|
|
55
|
+
nd_branch: (first) => `async () => ${quoted(first)}`,
|
|
56
|
+
};
|
|
57
|
+
export const stepsOf = (one) => [...one.nodes, ...[...one.within.values()].flat()];
|
|
53
58
|
const reaches = (pass, one) => pass.stated.has(one) && !under(pass, one, NODES_ID);
|
|
54
59
|
const waiting = (held) => held !== undefined && ts.isNumericLiteral(held) ? Number(held.text.replace(/_/g, '')) : undefined;
|
|
55
60
|
export function operations(pass, known) {
|
|
@@ -64,6 +69,7 @@ export function operations(pass, known) {
|
|
|
64
69
|
nodes: [],
|
|
65
70
|
takes: [],
|
|
66
71
|
body: undefined,
|
|
72
|
+
within: new Map(),
|
|
67
73
|
wants: new Set(stated?.takes ?? []),
|
|
68
74
|
requires: asked.filter((one) => reaches(pass, one)),
|
|
69
75
|
stray: asked.filter((one) => !reaches(pass, one)),
|
|
@@ -72,8 +78,17 @@ export function operations(pass, known) {
|
|
|
72
78
|
found.set(id, made);
|
|
73
79
|
return made;
|
|
74
80
|
};
|
|
81
|
+
const steps = new Map();
|
|
75
82
|
for (const [at, threadings] of pass.threaded) {
|
|
76
83
|
for (const one of threadings) {
|
|
84
|
+
const holder = steps.get(one.by);
|
|
85
|
+
if (holder !== undefined && one.list === 'seeds') {
|
|
86
|
+
const within = held(holder).within;
|
|
87
|
+
within.set(one.by, [...(within.get(one.by) ?? []), one.row]);
|
|
88
|
+
if (one.row.id !== undefined)
|
|
89
|
+
steps.set(one.row.id, holder);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
77
92
|
if (!isOperation(pass, one.by))
|
|
78
93
|
continue;
|
|
79
94
|
if (one.list === 'derives' && one.row.by === COMPILES)
|
|
@@ -82,8 +97,11 @@ export function operations(pass, known) {
|
|
|
82
97
|
const mine = held(one.by);
|
|
83
98
|
if (mine.wants.has(one.row.id ?? ''))
|
|
84
99
|
mine.takes.push(one.row);
|
|
85
|
-
else
|
|
100
|
+
else {
|
|
86
101
|
mine.nodes.push(one.row);
|
|
102
|
+
if (one.row.id !== undefined)
|
|
103
|
+
steps.set(one.row.id, one.by);
|
|
104
|
+
}
|
|
87
105
|
}
|
|
88
106
|
}
|
|
89
107
|
}
|
|
@@ -166,14 +184,18 @@ function planned(bodies) {
|
|
|
166
184
|
for (const row of one.takes)
|
|
167
185
|
if (row.at !== undefined)
|
|
168
186
|
found.push({ at: row.at, derived: false, text: takesFile(row.at) });
|
|
169
|
-
for (const row of one
|
|
187
|
+
for (const row of stepsOf(one)) {
|
|
170
188
|
const from = builtFrom(row, known);
|
|
171
189
|
const takes = one.takes[0]?.at;
|
|
172
190
|
if (row.at === undefined || from === undefined || takes === undefined)
|
|
173
191
|
continue;
|
|
174
192
|
const path = resolve(ROOT, row.at);
|
|
175
193
|
const held = existsSync(path) ? readFileSync(path, 'utf8') : undefined;
|
|
176
|
-
const
|
|
194
|
+
const first = one.within.get(String(row.id))?.[0]?.id;
|
|
195
|
+
const fresh = first === undefined ? undefined : HOLDING[from]?.(first);
|
|
196
|
+
const written = held === undefined ? undefined : blockIn(held);
|
|
197
|
+
const untouched = held === undefined || written === scaffold(from, String(row.id));
|
|
198
|
+
const block = bodies.get(row.at) ?? (fresh !== undefined && untouched ? fresh : written);
|
|
177
199
|
if (held !== undefined && block === undefined) {
|
|
178
200
|
found.push({
|
|
179
201
|
at: row.at,
|
|
@@ -14,7 +14,7 @@ export declare const nd_read: <I, R extends string = never>(block: (opened: Read
|
|
|
14
14
|
export declare const nd_action: <I, R extends string = never>(block: (opened: Opened<R>, held: Held<I>) => Promise<unknown>) => {
|
|
15
15
|
type: 'nd_action';
|
|
16
16
|
};
|
|
17
|
-
export declare const nd_branch: <I, R extends string = never>(choose: (opened: Reads<Opened<R>>, held: Held<I>) => Promise<string>, ways
|
|
17
|
+
export declare const nd_branch: <I, R extends string = never>(choose: (opened: Reads<Opened<R>>, held: Held<I>) => Promise<string>, ways?: Readonly<Record<string, (opened: Opened<R>, held: Held<I>) => Promise<unknown>>>) => {
|
|
18
18
|
type: 'nd_branch';
|
|
19
19
|
};
|
|
20
20
|
export declare const nd_each: <I, R extends string = never>(over: (held: Held<I>) => readonly unknown[], block: (item: unknown, opened: Opened<R>, held: Held<I>) => Promise<unknown>) => {
|
|
@@ -23,7 +23,7 @@ export declare const nd_each: <I, R extends string = never>(over: (held: Held<I>
|
|
|
23
23
|
export declare const nd_parallel: <I, R extends string = never>(blocks: readonly ((opened: Opened<R>, held: Held<I>) => Promise<unknown>)[]) => {
|
|
24
24
|
type: 'nd_parallel';
|
|
25
25
|
};
|
|
26
|
-
export declare const nd_repeat: <I, R extends string = never>(ceiling: number, block
|
|
26
|
+
export declare const nd_repeat: <I, R extends string = never>(ceiling: number, block?: (pass: number, carried: unknown, opened: Opened<R>, held: Held<I>) => Promise<{
|
|
27
27
|
readonly done: boolean;
|
|
28
28
|
readonly value: unknown;
|
|
29
29
|
}>) => {
|
package/package.json
CHANGED
package/dist/core/actor.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type Env = 'sandbox' | 'production'
|
|
2
|
-
|
|
3
|
-
export const ENVIRONMENT = [
|
|
4
|
-
['run', 'x-request-id', 'crypto.randomUUID()'],
|
|
5
|
-
['address', 'x-forwarded-for', null],
|
|
6
|
-
['device', 'user-agent', null],
|
|
7
|
-
['replay', 'idempotency-key', null],
|
|
8
|
-
['moment', null, 'new Date().toISOString()'],
|
|
9
|
-
] as const
|
|
10
|
-
|
|
11
|
-
export type Environment = { readonly [K in (typeof ENVIRONMENT)[number][0]]?: string }
|
|
12
|
-
|
|
13
|
-
export type Actor = Environment & {
|
|
14
|
-
readonly id: string | null
|
|
15
|
-
readonly roles: readonly string[]
|
|
16
|
-
readonly entitlements: readonly string[]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const PUBLIC_ROLE = 'role_public'
|
|
20
|
-
|
|
21
|
-
export const ANONYMOUS: Actor = { id: null, roles: [PUBLIC_ROLE], entitlements: [] }
|