@northtalk/ts 0.0.0-stage → 0.2.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.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -2
  3. package/UNICODE-LICENSE.txt +39 -0
  4. package/base64-DORMd3Hv.js +6621 -0
  5. package/binary-value-CEmh60GC.d.ts +15 -0
  6. package/capabilities-CH0FkRMq.js +1301 -0
  7. package/checker-Dc1jl2WH.js +6657 -0
  8. package/core-DptnvQT9.d.ts +14 -0
  9. package/debug-CQBxKnJB.d.ts +3065 -0
  10. package/debug.d.ts +3 -0
  11. package/debug.js +2 -0
  12. package/driver.d.ts +41 -0
  13. package/driver.js +152 -0
  14. package/encoding-nlrpj-Pb.js +99 -0
  15. package/engine-BGaJ9dAk.js +326 -0
  16. package/engine-vbYInVYF.d.ts +86 -0
  17. package/errors-LYJZ_c8h.js +3735 -0
  18. package/group-B742gg4T.js +10170 -0
  19. package/http-capability-CSTkw1Yt.js +728 -0
  20. package/http.d.ts +59 -0
  21. package/http.js +465 -0
  22. package/index.d.ts +651 -0
  23. package/index.js +44 -0
  24. package/manifest-BscyH_rW.d.ts +70 -0
  25. package/manifest-DjsxDSuB.js +129 -0
  26. package/message-layer.d.ts +12 -0
  27. package/message-layer.js +4 -0
  28. package/notify.d.ts +3 -0
  29. package/notify.js +2 -0
  30. package/objects-DJ3QtCCs.d.ts +640 -0
  31. package/objects-Db7IB5vQ.js +91 -0
  32. package/operation-promises-EgZXG5N_.js +23 -0
  33. package/package.json +70 -4
  34. package/readers-BFPuosPk.d.ts +25 -0
  35. package/readers-CjJHKHvH.js +482 -0
  36. package/request-pump-binary-DdY3X-yl.js +2246 -0
  37. package/router--71qvxtY.js +343 -0
  38. package/router-Zhrw5l__.d.ts +55 -0
  39. package/session.d.ts +9 -0
  40. package/session.js +3510 -0
  41. package/setup.d.ts +3 -0
  42. package/setup.js +193 -0
  43. package/sha256-B_kyYw3Z.js +124 -0
  44. package/sqlite.d.ts +74 -0
  45. package/sqlite.js +529 -0
  46. package/store-capability-OZp4hXmj.js +390 -0
  47. package/store-hJrRULMx.js +60 -0
  48. package/store.d.ts +21 -0
  49. package/store.js +4 -0
  50. package/user-capability-BK4Asg7D.js +276 -0
  51. package/wasm.d.ts +243 -0
  52. package/wasm.js +1737 -0
package/index.d.ts ADDED
@@ -0,0 +1,651 @@
1
+
2
+ import { $n as EventEntry, $t as httpCapability, An as Outcome, At as ImmediateOp, B as CausalWork, Bn as canConvert, Bt as SegmentCoordinator, C as Requested, Cn as LibrarySource, Cr as SyntaxNode, Ct as Cost, D as SaveOptions, Dr as syntaxText, Dt as FireOp, En as compileLibrary, Er as syntaxSelector, Et as FieldShape, Fn as callFunction, Ft as PlainResult, G as Decimal, Gn as LoadError, Gt as defineCapability, H as RunAncestry, Hn as HostError, Ht as SegmentLifecycle, I as TsScript, In as defaultLimits, It as ReleaseHook, J as bool, Jn as SendFailedReason, Jt as Group, K as Kind, Kn as MailboxFull, Kt as shape, L as Verdict, Ln as deliver, Lt as ReleaseReason, M as Settlement, Mn as RunRecord, Mt as Operation, N as TsGroup, Nn as Script, Nt as Operations, O as ScriptCodeRequest, On as LimitName, Ot as Grant, Pn as UnitLoadError, Pt as PlainArg, Q as instant, Qn as EventBranch, Qt as HttpImpl, R as newGroup, Rn as loadScript, Rt as ScopeDecl, S as Report, Sn as LibraryOptions, Sr as SyntaxErrorCode, St as CoordinatedLifecycle, T as RestoreResult, Tn as codeIdentity, Tr as Trivia, Tt as ErrorDecl, U as RunDiscarded, Un as HostErrorCode, Ut as Shape, V as RunAccounting, Vn as waitUs, Vt as SegmentGrant, W as RunStarted, Wn as LoadDiagnostic, Wt as SuspendingOp, X as civilDate, Xn as BodyKind, Xt as Versions, Y as bytes, Yn as Body, Yt as Script$1, Z as dec, Zn as CodeUnit, Zt as coreVersions, _ as Message, _n as calendarCapability, _r as Lexer, _t as defineObjectKind, an as SqlParams, ar as BindingKind, at as range, b as PumpResult, bn as timerCapability, br as Token, bt as CapabilityDef, c as CancellationOptions, cn as SqliteBinding, cr as LibraryExport, ct as text, d as Decided, dn as LocaleImpl, dr as SemanticName, dt as parseInstant, en as UserImpl, er as Instruction, et as list, f as Deciding, fn as localeCapability, fr as SemanticNode, ft as HostObject, g as LoadOptions, gn as TimerImpl, gr as SourceSpan, gt as PropDef, h as Inspection, hn as Costs, hr as SemanticTree, ht as ObjectKindDef, in as storeCapability, ir as Binding, it as quantity, jn as Run, jt as LimitReached, k as ScriptSources, kn as Limits, kt as GrantContext, l as CarryOver, ln as SqliteImpl, lr as NameRole, lt as formatInstant, m as GroupOptions, mn as ConsoleImpl, mr as SemanticToken, mt as ObjectKind, nn as StoreImpl, nr as UnwindEntry, nt as nothing, on as SqlRows, or as ExportKind, ot as record, p as EffectFailure, pn as CalendarImpl, pr as SemanticScope, pt as ObjectElements, q as Value, qn as ScriptError, qt as Core, rn as add, rr as disassemble, rt as num, sn as SqlValue, sr as FunctionContract, tn as userCapability, tr as Operand, tt as map, u as Counters, un as sqliteCapability, ur as SemanticElement, ut as nowMicros, v as PendingCall, vn as clockCapability, vr as Mode, vt as GrantDecls, w as RestoreOptions, wn as OperationRef, wr as SyntaxRule, wt as EffectResult, x as PumpedRequest, xn as Library, xr as SyntaxElement, xt as CapabilityDefiner, y as PumpOptions, yn as consoleCapability, yr as TokType, yt as Call, z as restore, zn as NotImplementedError, zt as SegmentContext } from "./debug-CQBxKnJB.js";
3
+ import { a as encodeJson, c as PlainValue, d as toValue, f as talk, i as decodeJson, l as ToValueOptions, n as MessageDecl, o as encodeValue, r as exportManifest, s as FromValueOptions, t as ManifestSpec, u as fromValue } from "./manifest-BscyH_rW.js";
4
+ import { n as createCore, t as TsCore } from "./core-DptnvQT9.js";
5
+ import { a as decodeValue, o as readDisplay, t as FunctionResolver } from "./readers-BFPuosPk.js";
6
+ //#region src/generated/syntax.d.ts
7
+ export declare const grammar: {
8
+ reserved: string[];
9
+ labels: {
10
+ reserved: string[];
11
+ excluded: string[];
12
+ };
13
+ chunk: {
14
+ singular: string;
15
+ plural: string;
16
+ }[];
17
+ ordinals: string[];
18
+ properties: string[];
19
+ follow: string[];
20
+ decision: string[];
21
+ text_patterns: {
22
+ keywords: string[];
23
+ classes: string[];
24
+ anchors: string[];
25
+ phrases: string[];
26
+ };
27
+ binary_patterns: {
28
+ integer_types: string[];
29
+ size_units: string[];
30
+ byte_orders: string[];
31
+ };
32
+ };
33
+ export declare const units: ({
34
+ name: string;
35
+ kind: string;
36
+ calendar: boolean;
37
+ factor: string[];
38
+ plural?: undefined;
39
+ } | {
40
+ name: string;
41
+ plural: string;
42
+ kind: string;
43
+ calendar: boolean;
44
+ factor: string[];
45
+ })[];
46
+ declare const diagnosticCodes: readonly ["unknown name", "not a value", "name clash", "duplicate name", "duplicate offer", "not in recovery", "leaves recovery catch", "duplicate key", "unknown kind", "no conversion", "bad number", "pattern too large", "wrong argument count", "wrong argument", "wrong labels", "unknown operation", "wrong mode", "missing and wait", "needless and wait", "can't suspend here", "unknown import", "import cycle", "missing grant", "not in a library", "not in a script", "not in a lambda", "not in a guard", "not in a whose", "not in a join", "empty join", "not in a timeout", "empty timeout", "leaves finally", "outside a loop", "veto outside a decision", "after a suspension", "wrong message", "bad suffixes", "can't write", "not a property", "not constant", "default order", "initialiser failed", "nothing to fold", "no item chunk", "capture in repetition", "rest not last", "bits not whole bytes"];
47
+ export declare const builtins: readonly [{
48
+ readonly name: "min";
49
+ readonly kind: "function";
50
+ readonly contract: {
51
+ readonly required: 1;
52
+ readonly total: 1;
53
+ readonly variadic: true;
54
+ };
55
+ }, {
56
+ readonly name: "max";
57
+ readonly kind: "function";
58
+ readonly contract: {
59
+ readonly required: 1;
60
+ readonly total: 1;
61
+ readonly variadic: true;
62
+ };
63
+ }, {
64
+ readonly name: "codePoint";
65
+ readonly kind: "function";
66
+ readonly contract: {
67
+ readonly required: 1;
68
+ readonly total: 1;
69
+ readonly variadic: false;
70
+ };
71
+ }, {
72
+ readonly name: "fromCodePoint";
73
+ readonly kind: "function";
74
+ readonly contract: {
75
+ readonly required: 1;
76
+ readonly total: 1;
77
+ readonly variadic: false;
78
+ };
79
+ }, {
80
+ readonly name: "upper";
81
+ readonly kind: "function";
82
+ readonly contract: {
83
+ readonly required: 1;
84
+ readonly total: 1;
85
+ readonly variadic: false;
86
+ };
87
+ }, {
88
+ readonly name: "lower";
89
+ readonly kind: "function";
90
+ readonly contract: {
91
+ readonly required: 1;
92
+ readonly total: 1;
93
+ readonly variadic: false;
94
+ };
95
+ }, {
96
+ readonly name: "offset";
97
+ readonly kind: "function";
98
+ readonly contract: {
99
+ readonly required: 2;
100
+ readonly total: 2;
101
+ readonly variadic: false;
102
+ };
103
+ }, {
104
+ readonly name: "isDisposed";
105
+ readonly kind: "function";
106
+ readonly contract: {
107
+ readonly required: 1;
108
+ readonly total: 1;
109
+ readonly variadic: false;
110
+ };
111
+ }, {
112
+ readonly name: "objectKind";
113
+ readonly kind: "function";
114
+ readonly contract: {
115
+ readonly required: 1;
116
+ readonly total: 1;
117
+ readonly variadic: false;
118
+ };
119
+ }, {
120
+ readonly name: "rangeStart";
121
+ readonly kind: "function";
122
+ readonly contract: {
123
+ readonly required: 1;
124
+ readonly total: 1;
125
+ readonly variadic: false;
126
+ };
127
+ }, {
128
+ readonly name: "rangeEnd";
129
+ readonly kind: "function";
130
+ readonly contract: {
131
+ readonly required: 1;
132
+ readonly total: 1;
133
+ readonly variadic: false;
134
+ };
135
+ }, {
136
+ readonly name: "kindOf";
137
+ readonly kind: "function";
138
+ readonly contract: {
139
+ readonly required: 1;
140
+ readonly total: 1;
141
+ readonly variadic: false;
142
+ };
143
+ }, {
144
+ readonly name: "conforms";
145
+ readonly kind: "function";
146
+ readonly contract: {
147
+ readonly required: 2;
148
+ readonly total: 2;
149
+ readonly variadic: false;
150
+ };
151
+ }, {
152
+ readonly name: "check";
153
+ readonly kind: "function";
154
+ readonly contract: {
155
+ readonly required: 2;
156
+ readonly total: 2;
157
+ readonly variadic: false;
158
+ };
159
+ }, {
160
+ readonly name: "explain";
161
+ readonly kind: "function";
162
+ readonly contract: {
163
+ readonly required: 2;
164
+ readonly total: 2;
165
+ readonly variadic: false;
166
+ };
167
+ }, {
168
+ readonly name: "functionArity";
169
+ readonly kind: "function";
170
+ readonly contract: {
171
+ readonly required: 1;
172
+ readonly total: 1;
173
+ readonly variadic: false;
174
+ };
175
+ }, {
176
+ readonly name: "functionName";
177
+ readonly kind: "function";
178
+ readonly contract: {
179
+ readonly required: 1;
180
+ readonly total: 1;
181
+ readonly variadic: false;
182
+ };
183
+ }, {
184
+ readonly name: "abs";
185
+ readonly kind: "function";
186
+ readonly contract: {
187
+ readonly required: 1;
188
+ readonly total: 1;
189
+ readonly variadic: false;
190
+ };
191
+ }, {
192
+ readonly name: "floor";
193
+ readonly kind: "function";
194
+ readonly contract: {
195
+ readonly required: 1;
196
+ readonly total: 1;
197
+ readonly variadic: false;
198
+ };
199
+ }, {
200
+ readonly name: "ceiling";
201
+ readonly kind: "function";
202
+ readonly contract: {
203
+ readonly required: 1;
204
+ readonly total: 1;
205
+ readonly variadic: false;
206
+ };
207
+ }, {
208
+ readonly name: "truncate";
209
+ readonly kind: "function";
210
+ readonly contract: {
211
+ readonly required: 1;
212
+ readonly total: 1;
213
+ readonly variadic: false;
214
+ };
215
+ }, {
216
+ readonly name: "round";
217
+ readonly kind: "function";
218
+ readonly contract: {
219
+ readonly required: 1;
220
+ readonly total: 3;
221
+ readonly variadic: false;
222
+ };
223
+ }, {
224
+ readonly name: "sqrt";
225
+ readonly kind: "function";
226
+ readonly contract: {
227
+ readonly required: 1;
228
+ readonly total: 1;
229
+ readonly variadic: false;
230
+ };
231
+ }, {
232
+ readonly name: "exp";
233
+ readonly kind: "function";
234
+ readonly contract: {
235
+ readonly required: 1;
236
+ readonly total: 1;
237
+ readonly variadic: false;
238
+ };
239
+ }, {
240
+ readonly name: "ln";
241
+ readonly kind: "function";
242
+ readonly contract: {
243
+ readonly required: 1;
244
+ readonly total: 1;
245
+ readonly variadic: false;
246
+ };
247
+ }, {
248
+ readonly name: "log10";
249
+ readonly kind: "function";
250
+ readonly contract: {
251
+ readonly required: 1;
252
+ readonly total: 1;
253
+ readonly variadic: false;
254
+ };
255
+ }, {
256
+ readonly name: "power";
257
+ readonly kind: "function";
258
+ readonly contract: {
259
+ readonly required: 2;
260
+ readonly total: 2;
261
+ readonly variadic: false;
262
+ };
263
+ }, {
264
+ readonly name: "sin";
265
+ readonly kind: "function";
266
+ readonly contract: {
267
+ readonly required: 1;
268
+ readonly total: 1;
269
+ readonly variadic: false;
270
+ };
271
+ }, {
272
+ readonly name: "cos";
273
+ readonly kind: "function";
274
+ readonly contract: {
275
+ readonly required: 1;
276
+ readonly total: 1;
277
+ readonly variadic: false;
278
+ };
279
+ }, {
280
+ readonly name: "tan";
281
+ readonly kind: "function";
282
+ readonly contract: {
283
+ readonly required: 1;
284
+ readonly total: 1;
285
+ readonly variadic: false;
286
+ };
287
+ }, {
288
+ readonly name: "asin";
289
+ readonly kind: "function";
290
+ readonly contract: {
291
+ readonly required: 1;
292
+ readonly total: 1;
293
+ readonly variadic: false;
294
+ };
295
+ }, {
296
+ readonly name: "acos";
297
+ readonly kind: "function";
298
+ readonly contract: {
299
+ readonly required: 1;
300
+ readonly total: 1;
301
+ readonly variadic: false;
302
+ };
303
+ }, {
304
+ readonly name: "atan";
305
+ readonly kind: "function";
306
+ readonly contract: {
307
+ readonly required: 1;
308
+ readonly total: 1;
309
+ readonly variadic: false;
310
+ };
311
+ }, {
312
+ readonly name: "atan2";
313
+ readonly kind: "function";
314
+ readonly contract: {
315
+ readonly required: 2;
316
+ readonly total: 2;
317
+ readonly variadic: false;
318
+ };
319
+ }, {
320
+ readonly name: "degrees";
321
+ readonly kind: "function";
322
+ readonly contract: {
323
+ readonly required: 1;
324
+ readonly total: 1;
325
+ readonly variadic: false;
326
+ };
327
+ }, {
328
+ readonly name: "radians";
329
+ readonly kind: "function";
330
+ readonly contract: {
331
+ readonly required: 1;
332
+ readonly total: 1;
333
+ readonly variadic: false;
334
+ };
335
+ }, {
336
+ readonly name: "random";
337
+ readonly kind: "function";
338
+ readonly contract: {
339
+ readonly required: 1;
340
+ readonly total: 1;
341
+ readonly variadic: false;
342
+ };
343
+ }, {
344
+ readonly name: "fromFloat64";
345
+ readonly kind: "function";
346
+ readonly contract: {
347
+ readonly required: 1;
348
+ readonly total: 2;
349
+ readonly variadic: false;
350
+ };
351
+ }, {
352
+ readonly name: "fromFloat32";
353
+ readonly kind: "function";
354
+ readonly contract: {
355
+ readonly required: 1;
356
+ readonly total: 2;
357
+ readonly variadic: false;
358
+ };
359
+ }, {
360
+ readonly name: "toFloat64";
361
+ readonly kind: "function";
362
+ readonly contract: {
363
+ readonly required: 1;
364
+ readonly total: 2;
365
+ readonly variadic: false;
366
+ };
367
+ }, {
368
+ readonly name: "toFloat32";
369
+ readonly kind: "function";
370
+ readonly contract: {
371
+ readonly required: 1;
372
+ readonly total: 2;
373
+ readonly variadic: false;
374
+ };
375
+ }, {
376
+ readonly name: "year";
377
+ readonly kind: "function";
378
+ readonly contract: {
379
+ readonly required: 1;
380
+ readonly total: 1;
381
+ readonly variadic: false;
382
+ };
383
+ }, {
384
+ readonly name: "month";
385
+ readonly kind: "function";
386
+ readonly contract: {
387
+ readonly required: 1;
388
+ readonly total: 1;
389
+ readonly variadic: false;
390
+ };
391
+ }, {
392
+ readonly name: "day";
393
+ readonly kind: "function";
394
+ readonly contract: {
395
+ readonly required: 1;
396
+ readonly total: 1;
397
+ readonly variadic: false;
398
+ };
399
+ }, {
400
+ readonly name: "hour";
401
+ readonly kind: "function";
402
+ readonly contract: {
403
+ readonly required: 1;
404
+ readonly total: 1;
405
+ readonly variadic: false;
406
+ };
407
+ }, {
408
+ readonly name: "minute";
409
+ readonly kind: "function";
410
+ readonly contract: {
411
+ readonly required: 1;
412
+ readonly total: 1;
413
+ readonly variadic: false;
414
+ };
415
+ }, {
416
+ readonly name: "second";
417
+ readonly kind: "function";
418
+ readonly contract: {
419
+ readonly required: 1;
420
+ readonly total: 1;
421
+ readonly variadic: false;
422
+ };
423
+ }, {
424
+ readonly name: "microsecond";
425
+ readonly kind: "function";
426
+ readonly contract: {
427
+ readonly required: 1;
428
+ readonly total: 1;
429
+ readonly variadic: false;
430
+ };
431
+ }, {
432
+ readonly name: "weekday";
433
+ readonly kind: "function";
434
+ readonly contract: {
435
+ readonly required: 1;
436
+ readonly total: 1;
437
+ readonly variadic: false;
438
+ };
439
+ }, {
440
+ readonly name: "dayOfYear";
441
+ readonly kind: "function";
442
+ readonly contract: {
443
+ readonly required: 1;
444
+ readonly total: 1;
445
+ readonly variadic: false;
446
+ };
447
+ }, {
448
+ readonly name: "isoWeek";
449
+ readonly kind: "function";
450
+ readonly contract: {
451
+ readonly required: 1;
452
+ readonly total: 1;
453
+ readonly variadic: false;
454
+ };
455
+ }, {
456
+ readonly name: "isoWeekYear";
457
+ readonly kind: "function";
458
+ readonly contract: {
459
+ readonly required: 1;
460
+ readonly total: 1;
461
+ readonly variadic: false;
462
+ };
463
+ }, {
464
+ readonly name: "hasTime";
465
+ readonly kind: "function";
466
+ readonly contract: {
467
+ readonly required: 1;
468
+ readonly total: 1;
469
+ readonly variadic: false;
470
+ };
471
+ }, {
472
+ readonly name: "toCivil";
473
+ readonly kind: "function";
474
+ readonly contract: {
475
+ readonly required: 2;
476
+ readonly total: 2;
477
+ readonly variadic: false;
478
+ };
479
+ }, {
480
+ readonly name: "toInstant";
481
+ readonly kind: "function";
482
+ readonly contract: {
483
+ readonly required: 2;
484
+ readonly total: 2;
485
+ readonly variadic: false;
486
+ };
487
+ }, {
488
+ readonly name: "pi";
489
+ readonly kind: "constant";
490
+ }, {
491
+ readonly name: "newline";
492
+ readonly kind: "constant";
493
+ }, {
494
+ readonly name: "tab";
495
+ readonly kind: "constant";
496
+ }, {
497
+ readonly name: "quote";
498
+ readonly kind: "constant";
499
+ }, {
500
+ readonly name: "offerAvailable";
501
+ readonly kind: "function";
502
+ readonly contract: {
503
+ readonly required: 1;
504
+ readonly total: 1;
505
+ readonly variadic: false;
506
+ };
507
+ }];
508
+ //#endregion
509
+ //#region src/parser.d.ts
510
+ export declare class ParseError extends Error {
511
+ readonly tok: Token;
512
+ readonly code: SyntaxErrorCode;
513
+ /** A complete Session Entry was followed by additional input. */
514
+ trailingEntry: boolean;
515
+ constructor(tok: Token, code: SyntaxErrorCode, msg: string);
516
+ }
517
+ /** Only the first diagnostic is normative; later ones describe recovery. */
518
+ type RecoveryDiagnostic = {
519
+ error: ParseError;
520
+ recovery: boolean;
521
+ };
522
+ /** What an Entry is, decided on its first token (chapter 2, Entries). */
523
+ type EntryKind = 'declaration' | 'statement' | 'expression';
524
+ type ParseResult = {
525
+ error: null;
526
+ tree: SyntaxNode;
527
+ } | {
528
+ error: ParseError;
529
+ tree: null;
530
+ };
531
+ /** Parse a Script or Library. Invalid scalar source throws HostError. */
532
+ export declare const parseSource: (source: string) => ParseResult;
533
+ /** A lossless tooling parse, including malformed regions as Error nodes. */
534
+ type RecoveringParseResult = {
535
+ diagnostics: readonly RecoveryDiagnostic[];
536
+ error: ParseError | null;
537
+ tree: SyntaxNode;
538
+ };
539
+ /** Recover past syntax errors. Invalid scalar source still throws HostError. */
540
+ export declare const parseSourceRecovering: (source: string) => RecoveringParseResult;
541
+ type EntryResult = {
542
+ error: null;
543
+ kind: EntryKind | null;
544
+ tree: SyntaxNode;
545
+ } | {
546
+ error: ParseError;
547
+ /** The source ended before the Entry did, so more lines may finish it. */
548
+ incomplete: boolean;
549
+ tree: null;
550
+ };
551
+ /**
552
+ * Parse an Entry at a Session prompt (chapter 2, Entries). Its kind is null
553
+ * when it holds only blank lines and comments. Invalid scalar source throws
554
+ * HostError.
555
+ */
556
+ export declare const parseEntry: (source: string, isHandler: (name: string) => boolean) => EntryResult;
557
+ //#endregion
558
+ //#region src/checker.d.ts
559
+ type DiagnosticCode = (typeof diagnosticCodes)[number];
560
+ type Diagnostic = {
561
+ code: DiagnosticCode;
562
+ message: string;
563
+ span: SourceSpan;
564
+ };
565
+ type ExistingName = Pick<Binding, 'kind' | 'contract' | 'importedFrom'> & {
566
+ handler?: ExistingName;
567
+ maySuspend?: boolean;
568
+ };
569
+ type CheckOptions = {
570
+ /** Names in older code units when checking a Script extension. */
571
+ existing?: Readonly<Record<string, ExistingName>>;
572
+ /** A Script's Grants, to check its Capability calls against; none checks none. */
573
+ grants?: GrantDecls;
574
+ /** Exports supplied by the Library loader; kind-only entries defer call-count checks. */
575
+ libraries?: Readonly<Record<string, Readonly<Record<string, LibraryExport>>>>;
576
+ /** Literal property names mapped to setter availability, by bound Object name. */
577
+ objectProperties?: Readonly<Record<string, Readonly<Record<string, boolean>>>>;
578
+ /** Well-known Host Object names bound at load. */
579
+ objects?: readonly string[];
580
+ /** Setter availability for an Owning Script's me. */
581
+ ownerProperties?: Readonly<Record<string, boolean>>;
582
+ /** Whether the source is a Script (the default) or a Library. */
583
+ unit?: 'script' | 'library';
584
+ };
585
+ type SemanticResult = {
586
+ diagnostics: readonly Diagnostic[];
587
+ ok: boolean;
588
+ tree: SemanticTree;
589
+ };
590
+ type CheckResult = (SemanticResult & {
591
+ error: null;
592
+ }) | {
593
+ diagnostics: readonly Diagnostic[];
594
+ error: ParseError;
595
+ ok: false;
596
+ tree: null;
597
+ };
598
+ /**
599
+ * Resolve bindings and check writes, named calls, constants and control flow.
600
+ * On recovered syntax, omit malformed constructs and check retained code.
601
+ */
602
+ export declare const checkSyntax: (syntax: SyntaxNode, options?: CheckOptions) => SemanticResult;
603
+ export declare const checkSource: (source: string, options?: CheckOptions) => CheckResult;
604
+ //#endregion
605
+ //#region src/lowering.d.ts
606
+ /** A construct whose lowering the Spec leaves unsettled; not a load diagnostic. */
607
+ export declare class LoweringError extends Error {
608
+ readonly line: number;
609
+ readonly col: number;
610
+ constructor(line: number, col: number, message: string);
611
+ }
612
+ type CompileOptions = CheckOptions & {
613
+ /** The Script's or Library's name, which the disassembly's `unit` line shows. */
614
+ name: string;
615
+ };
616
+ type CompileResult = {
617
+ diagnostics: readonly Diagnostic[];
618
+ error: null;
619
+ unit: CodeUnit;
620
+ } | {
621
+ diagnostics: readonly Diagnostic[];
622
+ error: ParseError | null;
623
+ unit: null;
624
+ };
625
+ /** A checked Library's exports, for the Scripts and Libraries that import it. */
626
+ export declare const exportsOf: (tree: SemanticTree) => Record<string, Exclude<LibraryExport, string>>;
627
+ /** Lower a checked semantic tree into its code unit. */
628
+ export declare const lowerTree: (tree: SemanticTree, options: Pick<CompileOptions, "name" | "unit"> & {
629
+ existingVariables?: readonly string[];
630
+ }) => CodeUnit;
631
+ /**
632
+ * Parse, check and lower a Script or Library. The first syntax error, or any
633
+ * load diagnostic the checker reports, leaves no code unit.
634
+ */
635
+ export declare const compileSource: (source: string, options: CompileOptions) => CompileResult;
636
+ //#endregion
637
+ //#region src/generated/stdlib.d.ts
638
+ export declare const stdlibSources: Record<string, string>;
639
+ //#endregion
640
+ //#region src/documentation.d.ts
641
+ /**
642
+ * The source start of a top-level declaration including its attached marked
643
+ * comments. Tooling that submits it as an Entry keeps the exact block, even
644
+ * before an Import (which the Session Host refuses at the prompt).
645
+ */
646
+ export declare const declarationStart: (root: SyntaxNode, declaration: SyntaxNode) => number;
647
+ //#endregion
648
+ //#region src/selectors.d.ts
649
+ export declare const validMessageSelector: (message: string, arity: number) => boolean;
650
+ //#endregion
651
+ export { type Binding, type BindingKind, type Body, type BodyKind, type CalendarImpl, type Call, type CancellationOptions, type CapabilityDef, type CapabilityDefiner, type CarryOver, type CausalWork, type CheckOptions, type CheckResult, type CodeUnit, type CompileOptions, type CompileResult, Script as CompiledScript, type ConsoleImpl, type CoordinatedLifecycle, type Core, type Cost, type Costs, type Counters, type Decided, type Deciding, Decimal, type Diagnostic, type DiagnosticCode, type EffectFailure, type EffectResult, type EntryKind, type EntryResult, type ErrorDecl, type EventBranch, type EventEntry, type ExportKind, type FieldShape, type FireOp, type FromValueOptions, type FunctionContract, type FunctionResolver, type Grant, type GrantContext, type GrantDecls, type Group, type GroupOptions, HostError, type HostErrorCode, type HostObject, type HttpImpl, type ImmediateOp, type Inspection, type Instruction, type Kind, Lexer, type Library, type LibraryExport, type LibraryOptions, type LibrarySource, type LimitName, LimitReached, type Limits, type LoadDiagnostic, LoadError, type LoadOptions, type LocaleImpl, MailboxFull, type ManifestSpec, type Message, type MessageDecl, type Mode, type NameRole, NotImplementedError, type ObjectElements, type ObjectKind, type ObjectKindDef, type Operand, type Operation, type OperationRef, type Operations, type Outcome, type ParseResult, type PendingCall, type PlainArg, type PlainResult, type PlainValue, type PropDef, type PumpOptions, type PumpResult, type PumpedRequest, type RecoveringParseResult, type RecoveryDiagnostic, type ReleaseHook, type ReleaseReason, type Report, type Requested, type RestoreOptions, type RestoreResult, Run, type RunAccounting, type RunAncestry, type RunDiscarded, type RunRecord, type RunStarted, type SaveOptions, type ScopeDecl, type Script$1 as Script, type ScriptCodeRequest, ScriptError, type ScriptSources, type SegmentContext, type SegmentCoordinator, type SegmentGrant, type SegmentLifecycle, type SemanticElement, type SemanticName, type SemanticNode, type SemanticResult, type SemanticScope, type SemanticToken, type SemanticTree, type SendFailedReason, type Settlement, type Shape, type SourceSpan, type SqlParams, type SqlRows, type SqlValue, type SqliteBinding, type SqliteImpl, type StoreImpl, type SuspendingOp, type SyntaxElement, type SyntaxErrorCode, type SyntaxNode, type SyntaxRule, type TimerImpl, type ToValueOptions, type TokType, type Token, type Trivia, type TsCore, TsGroup, TsScript, UnitLoadError, type UnwindEntry, type UserImpl, Value, type Verdict, type Versions, add, bool, bytes, calendarCapability, callFunction, canConvert, civilDate, clockCapability, codeIdentity, compileLibrary, consoleCapability, coreVersions, createCore, dec, decodeJson, decodeValue, defaultLimits, defineCapability, defineObjectKind, deliver, disassemble, encodeJson, encodeValue, exportManifest, formatInstant, fromValue, httpCapability, instant, list, loadScript, localeCapability, map, newGroup, nothing, nowMicros, num, parseInstant, quantity, range, readDisplay, record, restore, shape, sqliteCapability, storeCapability, syntaxSelector, syntaxText, talk, text, timerCapability, toValue, userCapability, waitUs };
package/index.js ADDED
@@ -0,0 +1,44 @@
1
+
2
+ import { B as range, F as num, K as text, M as map, O as list, P as nothing, Qt as parseInstant, R as quantity, V as record, Xt as nowMicros, _ as dec, c as Decimal, d as bytes, i as ScriptError, it as builtins, l as Value, lt as units, m as civilDate, n as LoadError, ot as grammar, qt as formatInstant, r as MailboxFull, t as HostError, u as bool, w as instant, yt as unicodeVersion } from "./errors-LYJZ_c8h.js";
3
+ import { t as defineObjectKind } from "./objects-Db7IB5vQ.js";
4
+ import { i as defineCapability, m as Lexer, p as validMessageSelector, t as LimitReached, u as shape } from "./capabilities-CH0FkRMq.js";
5
+ import { a as ParseError, c as parseSourceRecovering, i as syntaxText, n as checkSyntax, o as parseEntry, p as declarationStart, r as syntaxSelector, s as parseSource, t as checkSource } from "./checker-Dc1jl2WH.js";
6
+ import { U as waitUs, Z as disassemble, ct as costModel, r as NotImplementedError, u as canConvert, ut as languageVersion } from "./base64-DORMd3Hv.js";
7
+ import { _ as loadScript, b as exportsOf, c as compileLibrary, d as Run, f as Script, g as deliver, h as defaultLimits, i as restore, m as callFunction, n as TsScript, p as UnitLoadError, r as newGroup, s as codeIdentity, t as TsGroup, u as stdlibSources, v as LoweringError, x as lowerTree, y as compileSource } from "./group-B742gg4T.js";
8
+ import { c as readDisplay, r as decodeValue } from "./readers-CjJHKHvH.js";
9
+ import { t as encodeValue } from "./encoding-nlrpj-Pb.js";
10
+ import { n as exportManifest } from "./manifest-DjsxDSuB.js";
11
+ import { a as fromValue, i as encodeJson, n as sqliteCapability, o as toValue, r as decodeJson, s as talk, t as httpCapability } from "./http-capability-CSTkw1Yt.js";
12
+ import { n as localeCapability, t as userCapability } from "./user-capability-BK4Asg7D.js";
13
+ import { a as clockCapability, i as calendarCapability, l as timerCapability, o as consoleCapability, r as storeCapability, t as add } from "./store-capability-OZp4hXmj.js";
14
+ //#region src/versions.ts
15
+ const coreVersions = Object.freeze({
16
+ language: languageVersion,
17
+ costModel: String(costModel.version),
18
+ unicode: unicodeVersion,
19
+ core: "ts/0.2.0",
20
+ saveFormat: String(11)
21
+ });
22
+ //#endregion
23
+ //#region src/core.ts
24
+ const core = Object.freeze({
25
+ defineCapability,
26
+ defineObjectKind,
27
+ clockCapability,
28
+ calendarCapability,
29
+ localeCapability,
30
+ timerCapability,
31
+ consoleCapability,
32
+ storeCapability,
33
+ sqliteCapability,
34
+ userCapability,
35
+ httpCapability,
36
+ compileLibrary,
37
+ newGroup,
38
+ restore,
39
+ versions: coreVersions
40
+ });
41
+ /** Return the process-wide Core, also used by the free-function helpers. */
42
+ const createCore = () => core;
43
+ //#endregion
44
+ export { Script as CompiledScript, Decimal, HostError, Lexer, LimitReached, LoadError, LoweringError, MailboxFull, NotImplementedError, ParseError, Run, ScriptError, TsGroup, TsScript, UnitLoadError, Value, add, bool, builtins, bytes, calendarCapability, callFunction, canConvert, checkSource, checkSyntax, civilDate, clockCapability, codeIdentity, compileLibrary, compileSource, consoleCapability, coreVersions, createCore, dec, declarationStart, decodeJson, decodeValue, defaultLimits, defineCapability, defineObjectKind, deliver, disassemble, encodeJson, encodeValue, exportManifest, exportsOf, formatInstant, fromValue, grammar, httpCapability, instant, list, loadScript, localeCapability, lowerTree, map, newGroup, nothing, nowMicros, num, parseEntry, parseInstant, parseSource, parseSourceRecovering, quantity, range, readDisplay, record, restore, shape, sqliteCapability, stdlibSources, storeCapability, syntaxSelector, syntaxText, talk, text, timerCapability, toValue, units, userCapability, validMessageSelector, waitUs };