@crubal/engine 0.0.0-stage → 0.4.0
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/LICENSE +202 -0
- package/README.md +97 -2
- package/dist/bin/crubal.d.ts +2 -0
- package/dist/bin/crubal.js +103 -0
- package/dist/bin/crubal.js.map +1 -0
- package/dist/src/access.d.ts +149 -0
- package/dist/src/access.js +584 -0
- package/dist/src/access.js.map +1 -0
- package/dist/src/acts.d.ts +531 -0
- package/dist/src/acts.js +1466 -0
- package/dist/src/acts.js.map +1 -0
- package/dist/src/address.d.ts +29 -0
- package/dist/src/address.js +59 -0
- package/dist/src/address.js.map +1 -0
- package/dist/src/arrival.d.ts +55 -0
- package/dist/src/arrival.js +127 -0
- package/dist/src/arrival.js.map +1 -0
- package/dist/src/browser.d.ts +10 -0
- package/dist/src/browser.js +13 -0
- package/dist/src/browser.js.map +1 -0
- package/dist/src/bundle.d.ts +74 -0
- package/dist/src/bundle.js +1108 -0
- package/dist/src/bundle.js.map +1 -0
- package/dist/src/canonical.d.ts +6 -0
- package/dist/src/canonical.js +47 -0
- package/dist/src/canonical.js.map +1 -0
- package/dist/src/carriers.d.ts +7 -0
- package/dist/src/carriers.js +33 -0
- package/dist/src/carriers.js.map +1 -0
- package/dist/src/conditions.d.ts +28 -0
- package/dist/src/conditions.js +227 -0
- package/dist/src/conditions.js.map +1 -0
- package/dist/src/corpus.d.ts +8 -0
- package/dist/src/corpus.js +1207 -0
- package/dist/src/corpus.js.map +1 -0
- package/dist/src/defs.d.ts +174 -0
- package/dist/src/defs.js +690 -0
- package/dist/src/defs.js.map +1 -0
- package/dist/src/dictionary.d.ts +77 -0
- package/dist/src/dictionary.js +629 -0
- package/dist/src/dictionary.js.map +1 -0
- package/dist/src/exchange.d.ts +259 -0
- package/dist/src/exchange.js +1088 -0
- package/dist/src/exchange.js.map +1 -0
- package/dist/src/forms.d.ts +16 -0
- package/dist/src/forms.js +181 -0
- package/dist/src/forms.js.map +1 -0
- package/dist/src/index.d.ts +32 -0
- package/dist/src/index.js +34 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lex.d.ts +21 -0
- package/dist/src/lex.js +142 -0
- package/dist/src/lex.js.map +1 -0
- package/dist/src/lifecycle.d.ts +92 -0
- package/dist/src/lifecycle.js +451 -0
- package/dist/src/lifecycle.js.map +1 -0
- package/dist/src/log.d.ts +91 -0
- package/dist/src/log.js +629 -0
- package/dist/src/log.js.map +1 -0
- package/dist/src/migrate.d.ts +129 -0
- package/dist/src/migrate.js +415 -0
- package/dist/src/migrate.js.map +1 -0
- package/dist/src/model.d.ts +81 -0
- package/dist/src/model.js +188 -0
- package/dist/src/model.js.map +1 -0
- package/dist/src/packages.d.ts +372 -0
- package/dist/src/packages.js +1158 -0
- package/dist/src/packages.js.map +1 -0
- package/dist/src/print-text.d.ts +7 -0
- package/dist/src/print-text.js +223 -0
- package/dist/src/print-text.js.map +1 -0
- package/dist/src/publish.d.ts +27 -0
- package/dist/src/publish.js +279 -0
- package/dist/src/publish.js.map +1 -0
- package/dist/src/read-text.d.ts +10 -0
- package/dist/src/read-text.js +400 -0
- package/dist/src/read-text.js.map +1 -0
- package/dist/src/records.d.ts +32 -0
- package/dist/src/records.js +104 -0
- package/dist/src/records.js.map +1 -0
- package/dist/src/review.d.ts +22 -0
- package/dist/src/review.js +198 -0
- package/dist/src/review.js.map +1 -0
- package/dist/src/rules.d.ts +101 -0
- package/dist/src/rules.js +670 -0
- package/dist/src/rules.js.map +1 -0
- package/dist/src/schedule.d.ts +24 -0
- package/dist/src/schedule.js +126 -0
- package/dist/src/schedule.js.map +1 -0
- package/dist/src/std-packages.d.ts +9 -0
- package/dist/src/std-packages.js +268 -0
- package/dist/src/std-packages.js.map +1 -0
- package/dist/src/store.d.ts +191 -0
- package/dist/src/store.js +671 -0
- package/dist/src/store.js.map +1 -0
- package/dist/src/surface.d.ts +47 -0
- package/dist/src/surface.js +92 -0
- package/dist/src/surface.js.map +1 -0
- package/dist/src/tree.d.ts +35 -0
- package/dist/src/tree.js +159 -0
- package/dist/src/tree.js.map +1 -0
- package/dist/src/units-table.d.ts +1 -0
- package/dist/src/units-table.js +200 -0
- package/dist/src/units-table.js.map +1 -0
- package/dist/src/units.d.ts +42 -0
- package/dist/src/units.js +98 -0
- package/dist/src/units.js.map +1 -0
- package/dist/src/versions.d.ts +10 -0
- package/dist/src/versions.js +27 -0
- package/dist/src/versions.js.map +1 -0
- package/dist/src/views.d.ts +372 -0
- package/dist/src/views.js +1170 -0
- package/dist/src/views.js.map +1 -0
- package/package.json +60 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type Instruction } from "./lifecycle.ts";
|
|
2
|
+
import { type Edge, type Permissions } from "./access.ts";
|
|
3
|
+
import { type ClassDef, type ClassLine, type Dictionary, type KindDef } from "./defs.ts";
|
|
4
|
+
import { type Recipe } from "./migrate.ts";
|
|
5
|
+
import type { JsonObject } from "./model.ts";
|
|
6
|
+
import { type PackageInfo, type Utility, type Lane, type Flow } from "./packages.ts";
|
|
7
|
+
import { type Rule } from "./rules.ts";
|
|
8
|
+
import { type Contract, type Keys } from "./store.ts";
|
|
9
|
+
import { type Display, type Filter, type Print, type Shape, type View, type ViewSet } from "./views.ts";
|
|
10
|
+
/** Everything the readers make of one package's text. */
|
|
11
|
+
export type Parsed = {
|
|
12
|
+
info: PackageInfo;
|
|
13
|
+
dict: Dictionary;
|
|
14
|
+
rules: Rule[];
|
|
15
|
+
contracts: Contract[];
|
|
16
|
+
views: ViewSet;
|
|
17
|
+
perms: Permissions;
|
|
18
|
+
edges: Edge[];
|
|
19
|
+
recipes: Recipe[]; /** The instruction blocks a version carries (10.7): issuer → its instructions. */
|
|
20
|
+
instructions: Map<string, Instruction[]>;
|
|
21
|
+
};
|
|
22
|
+
/** Read a package's text with every reader. */
|
|
23
|
+
export declare function parsePackage(source: string): Parsed;
|
|
24
|
+
export declare function kindJson(dict: Dictionary, k: KindDef): JsonObject;
|
|
25
|
+
export declare function classLineJson(l: ClassLine): JsonObject;
|
|
26
|
+
export declare function classJson(c: ClassDef): JsonObject;
|
|
27
|
+
export declare function ruleJson(r: Rule): JsonObject;
|
|
28
|
+
export declare function contractJson(c: Contract): JsonObject;
|
|
29
|
+
export declare function recipeJson(r: Recipe): JsonObject;
|
|
30
|
+
export declare function shapeJson(s: Shape): JsonObject;
|
|
31
|
+
/** A display's JSON form (12.9): the layout family, the slot lines, the tokens as an object, the words. */
|
|
32
|
+
export declare function displayJson(d: Display): JsonObject;
|
|
33
|
+
/** A print's JSON form (12.12): what it prints, its inches, its fields and its elements as written. */
|
|
34
|
+
export declare function printJson(p: Print): JsonObject;
|
|
35
|
+
export declare function filterJson(f: Filter): JsonObject;
|
|
36
|
+
export declare function viewJson(v: View): JsonObject;
|
|
37
|
+
/** The `role:` blocks, from the presets and menu items the access reader made of them (12.4). */
|
|
38
|
+
export declare function rolesJson(perms: Permissions): JsonObject[];
|
|
39
|
+
export declare function permissionsJson(perms: Permissions): JsonObject | undefined;
|
|
40
|
+
/** A utility block's JSON form (11.6). */
|
|
41
|
+
export declare function utilityJson(u: Utility): JsonObject;
|
|
42
|
+
/** A flow (12.11) in the bundle: as written, its stops as `{name, act?, of?}`, its done as `{filter, value}`. */
|
|
43
|
+
export declare function flowJson(f: Flow): JsonObject;
|
|
44
|
+
/** A lane (12.10) in the bundle: as written, its presses as `{word, to}`, its picks as `{filter, value}`. */
|
|
45
|
+
export declare function laneJson(s: Lane): JsonObject;
|
|
46
|
+
/** The whole package as the JSON document, without `hash` and `sig`. */
|
|
47
|
+
export declare function bundleOf(p: Parsed): JsonObject;
|
|
48
|
+
/** Quote a value when the text form would otherwise misread it (2.5). */
|
|
49
|
+
export declare function q(s: string): string;
|
|
50
|
+
/** A class line's text from its settings (5.3), the shorthand marks in their order (4.5). */
|
|
51
|
+
export declare function lineText(l: JsonObject, type?: string): string;
|
|
52
|
+
/** The text form of a bundle: the package header, then every member, in the long form. */
|
|
53
|
+
export declare function printBundle(b: JsonObject): string;
|
|
54
|
+
/** Read a bundle: print it to text and read the text, so there is one parser. */
|
|
55
|
+
export declare function readBundle(b: JsonObject): Parsed & {
|
|
56
|
+
text: string;
|
|
57
|
+
};
|
|
58
|
+
/** Read a bundle's definitions into a dictionary that already holds what the package extends. */
|
|
59
|
+
export declare function readBundleInto(b: JsonObject, into?: Dictionary): Dictionary;
|
|
60
|
+
/** An empty Parsed to read packages onto, in order. */
|
|
61
|
+
export declare function emptyParsed(): Parsed;
|
|
62
|
+
/**
|
|
63
|
+
* Read a bundle onto what is already read (the packages it extends, or the installed packages before the
|
|
64
|
+
* owner's own definitions): the dictionary grows, and a member of the same name replaces the earlier one.
|
|
65
|
+
*/
|
|
66
|
+
export declare function readBundleOnto(bundle: JsonObject, base: Parsed): Parsed;
|
|
67
|
+
export declare function bundleHash(b: JsonObject): string;
|
|
68
|
+
/** Sign a bundle with the owner's Ed25519 private key (the JWK `d`, base64url); sets `hash` and `sig`. */
|
|
69
|
+
export declare function signBundle(b: JsonObject, privateD: string, publicX: string): JsonObject;
|
|
70
|
+
/** Check a bundle's hash and, with the owner's published key, its signature. */
|
|
71
|
+
export declare function verifyBundle(b: JsonObject, keys?: Keys): {
|
|
72
|
+
valid: boolean;
|
|
73
|
+
reason?: string;
|
|
74
|
+
};
|