@northtalk/ts 0.3.0 → 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/README.md +1 -1
- package/{base64-DA7UgjG2.js → base64-Dtqaz_0A.js} +3 -3
- package/{binary-value-BcHcwVLO.d.ts → binary-value-Bb6HPDtM.d.ts} +1 -1
- package/{capabilities-BCw9uREe.js → capabilities-Bi5Qm6Fr.js} +10 -1
- package/{checker-Dmnm2SeU.js → checker-DMI4LiRm.js} +13 -5
- package/core-BzGUgjL6.d.ts +22 -0
- package/{debug-CY9x_Wsi.d.ts → debug-C72o2pZy.d.ts} +475 -45
- package/debug.d.ts +2 -2
- package/debug.js +1 -1
- package/{driver-CwmL5M32.d.ts → driver-ClV_UDEK.d.ts} +1 -1
- package/driver.d.ts +1 -1
- package/driver.js +1 -1
- package/{encoding-BUhsrLPK.js → encoding-C3Q7pIC9.js} +2 -2
- package/{engine-Dj9My1qX.js → engine-BpdGfAND.js} +6 -6
- package/{engine-CCzaBIoi.d.ts → engine-Dtby_FkE.d.ts} +2 -2
- package/{errors-CPPJmAAh.js → errors-BKJES3Zu.js} +1 -1
- package/{group-CnpvKoLw.js → group-vuUL2tq-.js} +5903 -1387
- package/http.d.ts +1 -1
- package/http.js +3 -3
- package/index-ByF5j53i.d.ts +779 -0
- package/index.d.ts +5 -659
- package/index.js +16 -15
- package/{inline-grants-Bvk-2aUL.js → inline-grants-Cx0Z9XAt.js} +25 -20
- package/{manifest-BTwN3NiP.js → manifest-Dw-8Unmf.js} +124 -5
- package/message-layer.d.ts +2 -2
- package/message-layer.js +2 -2
- package/notify.d.ts +1 -1
- package/notify.js +1 -1
- package/{objects-CawjPfhl.js → objects-BC4fS0vq.js} +1 -1
- package/{objects-BdWn56Ia.d.ts → objects-Dnqor7Gn.d.ts} +11 -3
- package/package.json +1 -1
- package/{readers-C2YMRjC3.js → readers-B5e5bBrY.js} +2 -2
- package/{readers-DMCXzY3X.d.ts → readers-DAFVvvq4.d.ts} +1 -1
- package/{request-pump-binary-Cp3RGZIJ.js → request-pump-binary-BjnyqXV5.js} +4 -4
- package/{router-BSREiSux.js → router-BCHEfs4x.js} +5 -5
- package/{router-BE5Tbbd7.d.ts → router-BspOCPA0.d.ts} +2 -2
- package/session.d.ts +40 -2
- package/session.js +109 -27
- package/setup.d.ts +1 -1
- package/setup.js +4 -4
- package/sha256-9CGf5BS_.js +168 -0
- package/sqlite.d.ts +4 -4
- package/sqlite.js +26 -20
- package/{store-DwESnByX.js → store-DTQa0lyE.js} +2 -2
- package/{store-capability-BYghoYSd.js → store-capability-BxXgiRM7.js} +4 -4
- package/store.d.ts +2 -2
- package/store.js +2 -2
- package/{user-capability-kDFbi3sm.js → user-capability-5-IvCeZI.js} +5 -5
- package/wasm.d.ts +10 -6
- package/wasm.js +50 -27
- package/core-D902b5Nu.d.ts +0 -14
- package/manifest-CeavwKxo.d.ts +0 -122
- package/sha256-B_kyYw3Z.js +0 -124
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ A Host can create a Group ready to pump from the event loop with `newDrivenGroup
|
|
|
32
32
|
| Import | Holds |
|
|
33
33
|
| ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
34
34
|
| `@northtalk/ts` | Values, Groups, Scripts, Libraries, Capabilities, Object Kinds, save and restore, and the parser and checker |
|
|
35
|
-
| `@northtalk/ts/session` | The Session Host, for a REPL
|
|
35
|
+
| `@northtalk/ts/session` | The Session Host, for a REPL, and Session Transcripts |
|
|
36
36
|
| `@northtalk/ts/driver` | `newDrivenGroup` and `autoDrive`, which pump a Group from the event loop |
|
|
37
37
|
| `@northtalk/ts/store` | The Store Standard Capability |
|
|
38
38
|
| `@northtalk/ts/notify` | The Store notification router |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { $ as textStorage, $t as
|
|
3
|
-
import { _ as runTask, d as shapeDiagnostics, l as pathValue, o as diagnosticRecord, r as decodeShape } from "./capabilities-
|
|
2
|
+
import { $ as textStorage, $t as weekday, A as listValues, At as negate, B as ownedMapPairs, Bt as civilDays, Ct as div, Dt as isInteger, E as instantOf, Et as integerOf, Ft as DateRangeError, Gt as dayOfYear, H as quantity, Ht as civilOfDays, I as mapWithEntry, It as US_PER_DAY, J as sliceText, Jt as isoWeek, L as nothing, Lt as US_PER_SECOND, M as literalDigits, Mt as roundRatio, N as map, Nt as subtract, Ot as mod, Pt as withinLimits, Q as text, Qt as parseInstantText, R as num, Rt as addMonths, St as digitsOf, Tt as formatDec, U as quantityOf, Ut as civilOfUs, V as patternValue, W as range, Wt as civilUs, X as smallNumber, Xt as parseCivil, Y as smallInteger, _ as concatText, _t as ArithmeticError, an as lower, at as parseUnit, b as displayText, bt as decOf, cn as simpleFold, ct as toBase, en as assertScalarText, et as trimWhiteSpace, f as bytesOf, g as compareBytes, h as civilOf, in as isWhiteSpace, it as ownUnit, j as listWithItem, jt as powerInteger, k as list, kt as multiply, ln as upper, nn as charactersAt, nt as combine, on as normalizeNFC, ot as powerOf, p as canonicalNumber, rn as generalCategory, rt as fromBase, sn as scalarCount, st as sameDimension, tn as characterBoundaries, tt as UnitError, u as bool, ut as unitText, v as dec, vt as add, wt as divide, x as extendList, xt as digitCount$1, y as decimalParts, yt as compareDec, zt as checkInstant } from "./errors-BKJES3Zu.js";
|
|
3
|
+
import { _ as runTask, d as shapeDiagnostics, l as pathValue, o as diagnosticRecord, r as decodeShape } from "./capabilities-Bi5Qm6Fr.js";
|
|
4
4
|
//#region src/generated/machine.ts
|
|
5
5
|
const instructions = [
|
|
6
6
|
{
|
|
@@ -7089,4 +7089,4 @@ const fromBase64 = (s) => {
|
|
|
7089
7089
|
return toBase64(out) === s ? out : void 0;
|
|
7090
7090
|
};
|
|
7091
7091
|
//#endregion
|
|
7092
|
-
export {
|
|
7092
|
+
export { sizeOf as $, matchesOf as A, smallOf as B, integerValue as C, makePatternValue as D, keyText as E, property as F, wrongKind as G, subjectText as H, randomBound as I, fixedRates as J, cacheBuild as K, search as L, negated as M, outOfRange as N, makeRange as O, prepareConversion as P, resetMeasured as Q, setKey as R, hasKey as S, isKind as T, textForm as U, splice as V, waitUs as W, partSize as X, keysContents as Y, rateOf as Z, convert as _, appendTo as a, capturesOf$1 as at, equals as b, builtinDefaults as c, quantityText as ct, chunkDelete as d, compareText as dt, arityOf as et, chunkGet as f, costModel as ft, concat as g, reservedErrorKeys as gt, comparison as h, limitDefaults as ht, ScriptError as i, opcodes as it, member as j, matchCaptures as k, byteOf as l, splicesOf as lt, chunkThere as m, languageVersion as mt, toBase64 as n, functionHead as nt, arithmetic as o, numberText as ot, chunkSet as p, errorMessages as pt, charge as q, NotImplementedError as r, instructionSpec as rt, builtin as s, patternSource as st, fromBase64 as t, disassemble as tt, canConvert as u, textDisplay as ut, decodeUtf8 as v, isEmpty as w, getKey as x, deleteKey as y, smallArithmetic as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { A as listValues, D as isDecimal, L as nothing, N as map, Q as text, R as num, T as instant, at as parseUnit, d as bytes, en as assertScalarText, ht as unitKinds, l as Value, lt as unitEntry, o as invalidValue, pt as grammar, t as HostError, tt as UnitError, u as bool, ut as unitText, v as dec } from "./errors-BKJES3Zu.js";
|
|
3
3
|
//#region src/tasks.ts
|
|
4
4
|
const runTask = (root) => {
|
|
5
5
|
const stack = [root];
|
|
@@ -1140,6 +1140,14 @@ const hasHooks = (lifecycle) => !!lifecycle && typeof lifecycle === "object" &&
|
|
|
1140
1140
|
"commit",
|
|
1141
1141
|
"rollback"
|
|
1142
1142
|
].every((phase) => typeof lifecycle[phase] === "function");
|
|
1143
|
+
const checkMetering = (op) => {
|
|
1144
|
+
if (op.metering === void 0) return;
|
|
1145
|
+
if (op.metering === "read-only") {
|
|
1146
|
+
if (op.mode === "fire-and-forget" || op.segmentBound || op.scope) invalidValue("read-only metering needs an immediate or suspending Operation without scope or segmentBound");
|
|
1147
|
+
} else if (op.metering === "segment-bound") {
|
|
1148
|
+
if (op.mode !== "immediate" || op.segmentBound !== true) invalidValue("segment-bound metering needs an immediate segmentBound Operation");
|
|
1149
|
+
} else invalidValue("metering must be read-only or segment-bound");
|
|
1150
|
+
};
|
|
1143
1151
|
/**
|
|
1144
1152
|
* Define a Capability whose Host functions take and return Values. The
|
|
1145
1153
|
* standard Capabilities and replay Stubs use this form.
|
|
@@ -1163,6 +1171,7 @@ const defineValueCapability = (name, ops, lifecycle, release) => {
|
|
|
1163
1171
|
if (op.description !== void 0 && typeof op.description !== "string") invalidValue("description must be text");
|
|
1164
1172
|
if (op.examples !== void 0 && (!Array.isArray(op.examples) || [...op.examples].some((example) => typeof example !== "string"))) invalidValue("examples must be a list of text");
|
|
1165
1173
|
const metadata = op;
|
|
1174
|
+
checkMetering(metadata);
|
|
1166
1175
|
if (metadata.segmentBound !== void 0 && typeof metadata.segmentBound !== "boolean") invalidValue("segmentBound must be Boolean");
|
|
1167
1176
|
if (metadata.segmentBound && (op.mode !== "immediate" || !lifecycle)) invalidValue("Segment-bound Operations require immediate mode and lifecycle hooks");
|
|
1168
1177
|
const scope = metadata.scope;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { M as literalDigits,
|
|
3
|
-
import { _ as runTask, g as RESERVED, h as Lexer, n as acceptsArgumentCount } from "./capabilities-
|
|
2
|
+
import { M as literalDigits, at as parseUnit, dt as builtins, ft as diagnosticCodes, gt as units, lt as unitEntry, mt as libraryExports, on as normalizeNFC, pt as grammar, tt as UnitError, ut as unitText } from "./errors-BKJES3Zu.js";
|
|
3
|
+
import { _ as runTask, g as RESERVED, h as Lexer, n as acceptsArgumentCount } from "./capabilities-Bi5Qm6Fr.js";
|
|
4
4
|
//#region src/constructs.ts
|
|
5
5
|
/** Chapter 3's kind names. */
|
|
6
6
|
const kindNames = /* @__PURE__ */ new Set([
|
|
@@ -2092,9 +2092,12 @@ const leadingDoc = (entry) => {
|
|
|
2092
2092
|
* for any other value. A Lambda's is empty, and a stale Function Value keeps
|
|
2093
2093
|
* its code's documentation, through save and restore too.
|
|
2094
2094
|
*/
|
|
2095
|
-
const functionDoc = (value) => {
|
|
2095
|
+
const functionDoc = (value, retained) => {
|
|
2096
2096
|
const fn = value.asFunction();
|
|
2097
|
-
|
|
2097
|
+
if (!fn) return null;
|
|
2098
|
+
const doc = codeDoc(fn.code);
|
|
2099
|
+
const stale = fn.code;
|
|
2100
|
+
return doc || !stale.unit || !stale.head?.name ? doc : retained?.get(stale.unit)?.get(stale.head.name) ?? "";
|
|
2098
2101
|
};
|
|
2099
2102
|
const codeDoc = (code) => {
|
|
2100
2103
|
const c = code;
|
|
@@ -3261,8 +3264,13 @@ var Parser = class Parser {
|
|
|
3261
3264
|
}
|
|
3262
3265
|
fail(t, expected) {
|
|
3263
3266
|
if (t.t === "error") this.lexicalFailure(t);
|
|
3267
|
+
if (this.unitWithoutNumber(t)) throw new ParseError(t, "unit without number", `a Unit follows only a number: write \`x as ${t.v}\`, \`x * 1 ${t.v}\`, or the Unit in the Constant`);
|
|
3264
3268
|
throw new ParseError(t, "unexpected token", `expected ${expected}, found ${t.t === "nl" ? "end of line" : t.t === "eof" ? "end of source" : `\`${t.v}\``}`);
|
|
3265
3269
|
}
|
|
3270
|
+
unitWithoutNumber(t) {
|
|
3271
|
+
const p = this.prev;
|
|
3272
|
+
return t.t === "word" && unitEntry(t.v) !== void 0 && p !== null && p.line === t.line && (this.isName(p) || p.t === "op" && (p.v === ")" || p.v === "]"));
|
|
3273
|
+
}
|
|
3266
3274
|
at(t, n) {
|
|
3267
3275
|
if (n.line === void 0) {
|
|
3268
3276
|
n.line = t.line;
|
|
@@ -6855,4 +6863,4 @@ const checkSource = (source, options = {}) => checkParsedSource(parseSource(sour
|
|
|
6855
6863
|
/** Internal compilation path; public semantic trees retain all productions. */
|
|
6856
6864
|
const checkSourceForLoad = (source, options = {}) => checkParsedSource(parseSourceForLoad(source), options);
|
|
6857
6865
|
//#endregion
|
|
6858
|
-
export {
|
|
6866
|
+
export { viewSource as _, syntaxText as a, parseSource as c, operationUses as d, declarationDocs as f, checkDecisionCalls as g, leadingDoc as h, syntaxSelector as i, parseSourceRecovering as l, functionDoc as m, checkSourceForLoad as n, ParseError as o, declarationStart as p, checkSyntax as r, parseEntry as s, checkSource as t, checkEffectCall as u, kindNames as v };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference lib="esnext.disposable" />
|
|
2
|
+
import { An as compileLibrary, B as restore, Zt as Core, vt as defineObjectKind, z as newGroup } from "./debug-C72o2pZy.js";
|
|
3
|
+
//#region src/save-format.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A save's State Fingerprint (ADR 0142), read from its header and frames
|
|
6
|
+
* without hashing its known sections' bodies, once the body digest checks.
|
|
7
|
+
*/
|
|
8
|
+
declare const stateFingerprint: (bytes: Uint8Array) => Uint8Array;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/core.d.ts
|
|
11
|
+
/** The TS Core: the embedding interface's Core, with its Groups typed as TsGroup. */
|
|
12
|
+
type TsCore = Omit<Core, 'compileLibrary' | 'defineObjectKind' | 'newGroup' | 'restore' | 'stateFingerprint'> & {
|
|
13
|
+
compileLibrary: typeof compileLibrary;
|
|
14
|
+
defineObjectKind: typeof defineObjectKind;
|
|
15
|
+
newGroup: typeof newGroup;
|
|
16
|
+
restore: typeof restore;
|
|
17
|
+
stateFingerprint: typeof stateFingerprint;
|
|
18
|
+
};
|
|
19
|
+
/** Return the process-wide Core, also used by the free-function helpers. */
|
|
20
|
+
declare const createCore: () => TsCore;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { createCore as n, TsCore as t };
|