eliscript 0.0.2 → 0.0.3
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 +9 -7
- package/browser/host.mjs +643 -11
- package/browser/worker.mjs +6 -3
- package/dist/browser/host.mjs +643 -11
- package/dist/browser/worker.mjs +6 -3
- package/dist/compiler-artifact.json +1 -1
- package/dist/literal-sources/runtime/core/collection.eli +76 -16
- package/dist/literal-sources/runtime/core/metadata.eli +25 -8
- package/dist/literal-sources/runtime/core/vector.eli +7 -2
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +18 -7
- package/dist/literal-sources/stdlib/managed-literals.eli +121 -66
- package/dist/stage3-release.json +1 -1
- package/package.json +10 -2
- package/stdlib/core/zipper.eli +73 -40
- package/stdlib/managed-literal-protocols.eli +18 -7
- package/stdlib/managed-literals.eli +121 -66
- package/stdlib/managed-runtime-collection.eli +76 -16
- package/stdlib/managed-runtime-metadata.eli +25 -8
- package/stdlib/managed-runtime-vector.eli +7 -2
- package/tools/backends/dist/release-cli.mjs +2 -0
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/stage3-targets.mjs +121 -114
- package/bootstrap/host/eliscript-cli-legacy.mjs +0 -37
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
extend-protocol-category extend-protocol-type implements-protocol? protocol-method)
|
|
4
4
|
(import "../../stdlib/managed-literal-protocols.eli"
|
|
5
5
|
I_COUNTED I_EMPTYABLE I_CONJ I_INDEXED I_LOOKUP I_ASSOCIATIVE I_REDUCE I_KV_REDUCE I_MAP I_SET I_STACK I_REVERSIBLE I_SEQABLE
|
|
6
|
+
COLLECTION_COUNT COLLECTION_EMPTY COLLECTION_CONJ COLLECTION_GET COLLECTION_ASSOC
|
|
7
|
+
COLLECTION_CONTAINS COLLECTION_NTH COLLECTION_SEQ COLLECTION_REDUCE COLLECTION_REDUCE_KV COLLECTION_DISSOC COLLECTION_DISJ
|
|
8
|
+
COLLECTION_PEEK COLLECTION_POP COLLECTION_RSEQ
|
|
6
9
|
managed-literal-is-reduced managed-literal-reduced managed-literal-unreduced
|
|
7
10
|
managed-literal-reduce-iterable managed-literal-sequence-view managed-literal-unbounded-sequence-view
|
|
8
11
|
managed-literal-install-slot managed-literal-checked-count ManagedLiteralSequenceView
|
|
@@ -478,7 +481,30 @@
|
|
|
478
481
|
(extend-protocol-category IStack "null" (js-object :peek (lambda (&rest ignored) nil) :pop (lambda (&rest ignored) nil)))
|
|
479
482
|
(extend-protocol-category IReversible "null" (js-object :rseq (lambda (&rest ignored) nil)))
|
|
480
483
|
|
|
481
|
-
(
|
|
484
|
+
(defconst count-method (protocol-method ICounted "count"))
|
|
485
|
+
(defconst empty-method (protocol-method IEmptyable "empty"))
|
|
486
|
+
(defconst conj-method (protocol-method IConj "conj"))
|
|
487
|
+
(defconst get-method (protocol-method ILookup "get"))
|
|
488
|
+
(defconst assoc-method (protocol-method IAssociative "assoc"))
|
|
489
|
+
(defconst contains-method (protocol-method IAssociative "contains"))
|
|
490
|
+
(defconst nth-method (protocol-method IIndexed "nth"))
|
|
491
|
+
(defconst seq-method (protocol-method ISeqable "seq"))
|
|
492
|
+
(defconst reduce-method (protocol-method IReduce "reduce"))
|
|
493
|
+
(defconst reduce-kv-method (protocol-method IKVReduce "reduceKV"))
|
|
494
|
+
(defconst dissoc-method (protocol-method IMap "dissoc"))
|
|
495
|
+
(defconst disj-method (protocol-method ISet "disj"))
|
|
496
|
+
(defconst peek-method (protocol-method IStack "peek"))
|
|
497
|
+
(defconst pop-method (protocol-method IStack "pop"))
|
|
498
|
+
(defconst rseq-method (protocol-method IReversible "rseq"))
|
|
499
|
+
|
|
500
|
+
(defun directSlot (value slot)
|
|
501
|
+
(when (and (not (nullish? value))
|
|
502
|
+
(or (= (js* "typeof value") "object") (= (js* "typeof value") "function")))
|
|
503
|
+
(let ((method (aref value slot)))
|
|
504
|
+
(when (= (js* "typeof method") "function") method))))
|
|
505
|
+
(defun count (collection)
|
|
506
|
+
(let ((slot (directSlot collection COLLECTION_COUNT)))
|
|
507
|
+
(managed-literal-checked-count (if (not (nullish? slot)) (js-call slot :call collection) (funcall count-method collection)))))
|
|
482
508
|
(defun isCounted (collection) (implements-protocol? ICounted collection))
|
|
483
509
|
(defun isIndexed (collection) (implements-protocol? IIndexed collection))
|
|
484
510
|
(defun isSeqable (collection) (implements-protocol? ISeqable collection))
|
|
@@ -516,50 +542,84 @@
|
|
|
516
542
|
(let ((value (aref values index)))
|
|
517
543
|
(if (truth (js-call seen :has value)) (setq distinct false) (setq seen (js-call seen :conj value))))
|
|
518
544
|
(setq index (1+ index))) distinct))
|
|
519
|
-
(defun empty (collection)
|
|
545
|
+
(defun empty (collection)
|
|
546
|
+
(let ((slot (directSlot collection COLLECTION_EMPTY)))
|
|
547
|
+
(if (not (nullish? slot)) (js-call slot :call collection) (funcall empty-method collection))))
|
|
520
548
|
(defun conj (collection &rest values)
|
|
521
549
|
(let ((result collection) (index 0))
|
|
522
|
-
(while (< index (js-length values))
|
|
550
|
+
(while (< index (js-length values))
|
|
551
|
+
(let ((slot (directSlot result COLLECTION_CONJ)) (value (aref values index)))
|
|
552
|
+
(setq result (if (not (nullish? slot)) (js-call slot :call result value) (funcall conj-method result value))
|
|
553
|
+
index (1+ index))))
|
|
554
|
+
result))
|
|
523
555
|
(defun get (collection key &optional not-found)
|
|
524
|
-
(
|
|
556
|
+
(let ((slot (directSlot collection COLLECTION_GET)) (fallback (if (undefined? not-found) nil not-found)))
|
|
557
|
+
(if (not (nullish? slot)) (js-call slot :call collection key fallback) (funcall get-method collection key fallback))))
|
|
525
558
|
(defun assoc (&rest arguments)
|
|
526
559
|
(unless (and (>= (js-length arguments) 3) (= (% (- (js-length arguments) 1) 2) 0))
|
|
527
560
|
(fail "assoc requires a collection followed by one or more key/value pairs"))
|
|
528
561
|
(let ((result (aref arguments 0)) (index 1))
|
|
529
562
|
(while (< index (js-length arguments))
|
|
530
|
-
(
|
|
563
|
+
(let ((slot (directSlot result COLLECTION_ASSOC))
|
|
564
|
+
(key (aref arguments index)) (value (aref arguments (1+ index))))
|
|
565
|
+
(setq result (if (not (nullish? slot)) (js-call slot :call result key value) (funcall assoc-method result key value))
|
|
566
|
+
index (+ index 2)))) result))
|
|
531
567
|
(defun contains (collection key)
|
|
532
|
-
(let ((
|
|
568
|
+
(let* ((slot (directSlot collection COLLECTION_CONTAINS))
|
|
569
|
+
(result (if (not (nullish? slot)) (js-call slot :call collection key) (funcall contains-method collection key))))
|
|
533
570
|
(unless (= (js* "typeof result") "boolean") (fail "IAssociative/contains must return a boolean")) result))
|
|
534
571
|
(defun nth (collection index &rest not-found)
|
|
535
|
-
(
|
|
572
|
+
(let ((slot (directSlot collection COLLECTION_NTH)))
|
|
573
|
+
(if (= (js-length not-found) 0)
|
|
574
|
+
(if (not (nullish? slot)) (js-call slot :call collection index) (funcall nth-method collection index))
|
|
575
|
+
(if (not (nullish? slot)) (js-call slot :call collection index (aref not-found 0)) (funcall nth-method collection index (aref not-found 0))))))
|
|
536
576
|
(defun checkedSequence (result message)
|
|
537
577
|
(if (nil? result) nil
|
|
538
578
|
(progn (when (or (undefined? result) (not (callable? (aref result (aref globalThis/Symbol "iterator"))))) (fail message)) result)))
|
|
539
|
-
(defun seq (collection)
|
|
579
|
+
(defun seq (collection)
|
|
580
|
+
(let ((slot (directSlot collection COLLECTION_SEQ)))
|
|
581
|
+
(checkedSequence (if (not (nullish? slot)) (js-call slot :call collection) (funcall seq-method collection))
|
|
582
|
+
"ISeqable/seq must return null or an iterable sequence view")))
|
|
540
583
|
(defun isEmpty (collection) (nil? (seq collection)))
|
|
541
584
|
(defun notEmpty (collection) (if (isEmpty collection) nil collection))
|
|
542
585
|
(defun reduce (collection reducer &rest initial)
|
|
543
586
|
(unless (callable? reducer) (fail "collection reducer must be a function"))
|
|
544
|
-
(
|
|
545
|
-
(
|
|
587
|
+
(let ((slot (directSlot collection COLLECTION_REDUCE)))
|
|
588
|
+
(managed-literal-unreduced (if (= (js-length initial) 0)
|
|
589
|
+
(if (not (nullish? slot)) (js-call slot :call collection reducer) (funcall reduce-method collection reducer))
|
|
590
|
+
(if (not (nullish? slot)) (js-call slot :call collection reducer (aref initial 0)) (funcall reduce-method collection reducer (aref initial 0)))))))
|
|
546
591
|
(defun reduceKV (&rest arguments)
|
|
547
592
|
(unless (= (js-length arguments) 3) (fail "reduceKV requires a collection, reducer, and initial value"))
|
|
548
593
|
(unless (callable? (aref arguments 1)) (fail "key/value reducer must be a function"))
|
|
549
|
-
(
|
|
594
|
+
(let* ((collection (aref arguments 0)) (slot (directSlot collection COLLECTION_REDUCE_KV)))
|
|
595
|
+
(managed-literal-unreduced (if (not (nullish? slot))
|
|
596
|
+
(js-call slot :call collection (aref arguments 1) (aref arguments 2))
|
|
597
|
+
(funcall reduce-kv-method collection (aref arguments 1) (aref arguments 2))))))
|
|
550
598
|
(defun dissoc (collection &rest keys)
|
|
551
599
|
(let ((result collection) (index 0))
|
|
552
|
-
(while (< index (js-length keys))
|
|
600
|
+
(while (< index (js-length keys))
|
|
601
|
+
(let ((slot (directSlot result COLLECTION_DISSOC)) (key (aref keys index)))
|
|
602
|
+
(setq result (if (not (nullish? slot)) (js-call slot :call result key) (funcall dissoc-method result key))
|
|
603
|
+
index (1+ index)))) result))
|
|
553
604
|
(defun disj (collection &rest values)
|
|
554
605
|
(let ((result collection) (index 0))
|
|
555
|
-
(while (< index (js-length values))
|
|
606
|
+
(while (< index (js-length values))
|
|
607
|
+
(let ((slot (directSlot result COLLECTION_DISJ)) (value (aref values index)))
|
|
608
|
+
(setq result (if (not (nullish? slot)) (js-call slot :call result value) (funcall disj-method result value))
|
|
609
|
+
index (1+ index)))) result))
|
|
556
610
|
(defun peek (&rest arguments)
|
|
557
|
-
(unless (= (js-length arguments) 1) (fail "peek requires exactly one collection"))
|
|
611
|
+
(unless (= (js-length arguments) 1) (fail "peek requires exactly one collection"))
|
|
612
|
+
(let* ((collection (aref arguments 0)) (slot (directSlot collection COLLECTION_PEEK)))
|
|
613
|
+
(if (not (nullish? slot)) (js-call slot :call collection) (funcall peek-method collection))))
|
|
558
614
|
(defun pop (&rest arguments)
|
|
559
|
-
(unless (= (js-length arguments) 1) (fail "pop requires exactly one collection"))
|
|
615
|
+
(unless (= (js-length arguments) 1) (fail "pop requires exactly one collection"))
|
|
616
|
+
(let* ((collection (aref arguments 0)) (slot (directSlot collection COLLECTION_POP)))
|
|
617
|
+
(if (not (nullish? slot)) (js-call slot :call collection) (funcall pop-method collection))))
|
|
560
618
|
(defun rseq (&rest arguments)
|
|
561
619
|
(unless (= (js-length arguments) 1) (fail "rseq requires exactly one collection"))
|
|
562
|
-
(
|
|
620
|
+
(let* ((collection (aref arguments 0)) (slot (directSlot collection COLLECTION_RSEQ)))
|
|
621
|
+
(checkedSequence (if (not (nullish? slot)) (js-call slot :call collection) (funcall rseq-method collection))
|
|
622
|
+
"IReversible/rseq must return null or an iterable sequence view")))
|
|
563
623
|
(defun reduced (value) (managed-literal-reduced value))
|
|
564
624
|
(defun isReduced (value) (managed-literal-is-reduced value))
|
|
565
625
|
(defun unreduced (value) (managed-literal-unreduced value))
|
|
@@ -1,21 +1,38 @@
|
|
|
1
1
|
(module eliscript.managed-runtime-metadata
|
|
2
2
|
(import "./map.mjs" isPersistentHashMap)
|
|
3
3
|
(import "../../stdlib/core/protocol.eli" implements-protocol-operation? protocol-method)
|
|
4
|
-
(import "../../stdlib/managed-literal-protocols.eli" I_META I_WITH_META)
|
|
4
|
+
(import "../../stdlib/managed-literal-protocols.eli" I_META I_WITH_META METADATA_READ METADATA_WITH)
|
|
5
5
|
(defconst IMeta I_META)
|
|
6
6
|
(defconst IWithMeta I_WITH_META)
|
|
7
|
+
(defconst meta-method (protocol-method IMeta "meta"))
|
|
8
|
+
(defconst with-meta-method (protocol-method IWithMeta "withMeta"))
|
|
9
|
+
(defun directMetaSlot (value slot)
|
|
10
|
+
(when (and (not (nullish? value))
|
|
11
|
+
(or (= (js* "typeof value") "object") (= (js* "typeof value") "function")))
|
|
12
|
+
(let ((method (aref value slot)))
|
|
13
|
+
(when (= (js* "typeof method") "function") method))))
|
|
7
14
|
(defun supportsMetadata (value)
|
|
8
|
-
(and (
|
|
9
|
-
|
|
15
|
+
(if (and (not (nullish? (directMetaSlot value METADATA_READ)))
|
|
16
|
+
(not (nullish? (directMetaSlot value METADATA_WITH))))
|
|
17
|
+
t
|
|
18
|
+
(and (implements-protocol-operation? IMeta "meta" value)
|
|
19
|
+
(implements-protocol-operation? IWithMeta "withMeta" value))))
|
|
10
20
|
(defun meta (value)
|
|
11
|
-
(
|
|
12
|
-
(
|
|
21
|
+
(let ((slot (directMetaSlot value METADATA_READ)))
|
|
22
|
+
(if (not (nullish? slot))
|
|
23
|
+
(js-call slot :call value)
|
|
24
|
+
(if (implements-protocol-operation? IMeta "meta" value)
|
|
25
|
+
(funcall meta-method value) nil))))
|
|
13
26
|
(defun withMeta (value metadata)
|
|
14
27
|
(unless (or (nil? metadata) (isPersistentHashMap metadata))
|
|
15
28
|
(throw (new globalThis/TypeError "metadata must be null or a persistent hash map")))
|
|
16
|
-
(
|
|
17
|
-
(
|
|
18
|
-
|
|
29
|
+
(let ((slot (directMetaSlot value METADATA_WITH)))
|
|
30
|
+
(if (not (nullish? slot))
|
|
31
|
+
(js-call slot :call value metadata)
|
|
32
|
+
(progn
|
|
33
|
+
(unless (implements-protocol-operation? IWithMeta "withMeta" value)
|
|
34
|
+
(throw (new globalThis/TypeError "value does not support metadata")))
|
|
35
|
+
(funcall with-meta-method value metadata)))))
|
|
19
36
|
(defun varyMeta (value transform &rest arguments)
|
|
20
37
|
(unless (= (js* "typeof transform") "function")
|
|
21
38
|
(throw (new globalThis/TypeError "metadata transform must be a function")))
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
(module eliscript.managed-runtime-vector
|
|
2
2
|
(import "../../stdlib/managed-literals.eli"
|
|
3
|
-
PersistentVector literal-vector literal-subvec literal-instance? literal-type literal-export-value)
|
|
3
|
+
PersistentVector literal-vector literal-vector-from-array-values literal-subvec literal-instance? literal-type literal-export-value)
|
|
4
4
|
|
|
5
5
|
(defconst EMPTY_VECTOR (literal-vector))
|
|
6
6
|
(defconst view-states (new globalThis/WeakMap))
|
|
7
|
-
(
|
|
7
|
+
(defconst freeze Object/freeze)
|
|
8
|
+
(defun persistentVector (&rest values)
|
|
9
|
+
(if (= (js-length values) 0) EMPTY_VECTOR
|
|
10
|
+
(progn
|
|
11
|
+
(when (<= (js-length values) 32) (funcall freeze values))
|
|
12
|
+
(literal-vector-from-array-values values))))
|
|
8
13
|
(defun isPersistentVector (value) (literal-instance? value PersistentVector))
|
|
9
14
|
(defun subvec (vector start &optional end) (literal-subvec vector start end))
|
|
10
15
|
(defun readPersistentVectorView (value)
|
|
@@ -354,6 +354,8 @@ async function prepareReleasePackage(options = null) {
|
|
|
354
354
|
return (await (async (packaged_metadata) => {
|
|
355
355
|
return (await (async (release_receipt) => {
|
|
356
356
|
return (await (async () => {
|
|
357
|
+
Reflect.deleteProperty(packaged_metadata, "frontendIR");
|
|
358
|
+
Reflect.deleteProperty(packaged_metadata, "literalIR");
|
|
357
359
|
await (saveCompilerMetadata(resolve(root, "dist/compiler-artifact.json"), packaged_metadata));
|
|
358
360
|
return await (saveCompilerMetadata(resolve(root, "dist/stage3-release.json"), release_receipt));
|
|
359
361
|
})());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-cli.mjs","sources":["../eliscript/release-cli.eli"],"sourcesContent":["(module tools.backends.release-cli\n (import \"node:fs/promises\" readFile writeFile mkdir cp)\n (import \"node:fs\" existsSync)\n (import \"node:path\" resolve dirname join relative isAbsolute sep)\n (import \"node:url\" fileURLToPath)\n (import \"node:util\" parseArgs isDeepStrictEqual)\n (import \"../build.mjs\" root)\n (import \"../compiler-cli-legacy.mjs\" runCompilerCLI)\n (import \"../compiler-bootstrap.mjs\" compilerFailure saveCompilerMetadata)\n (import \"../compiler-build.mjs\" independentCompilerProductIdentity)\n (import \"../compiler-metadata.mjs\" readCompilerMetadata)\n (import \"../compiler-matrix.mjs\" loadCompilerMatrixCorpus)\n (import \"./bootstrap-js-stages.mjs\" bootstrapJsStages)\n (import \"../stage3-targets.mjs\" runStage3Targets authenticateStage3Targets)\n\n (defconst release-help\n \"Eliscript JavaScript compiler bootstrap and final outputs\\n\\n bootstrap --stage0-manifest FILE --output DIRECTORY\\n verify-bootstrap [--bootstrap-manifest FILE]\\n targets [--bootstrap-manifest FILE] [--corpus-records FILE] [--output DIRECTORY] [--functional-runtime-profile small]\\n compile [--bootstrap-manifest FILE] --input SOURCE --target javascript|wasm|native --output PATH\\n compile [--bootstrap-manifest FILE] --project ENTRY --root DIRECTORY --target TARGET --output PATH\\n request [--bootstrap-manifest FILE] --request FILE [--output PATH]\\n package [--bootstrap-manifest FILE] --output DIRECTORY\\n prepare-release-package [--bootstrap-manifest FILE]\\n\\nEmacs generates JavaScript stage0. stage0 -> stage1 -> stage2 -> stage3 all run as JavaScript.\\nOnly stage3 supplies the final javascript, wasm and native program outputs.\\nThe stage2/stage3 fixed point is verified before a final compiler is used.\\nFunctional small resources explicitly defer the original sequence capacity acceptance.\\n\")\n\n (defun release-default (value fallback) (if (undefined? value) fallback value))\n (defun release-type-error (message) (throw (new globalThis.TypeError message)))\n (defun default-release-manifest ()\n (let ((bootstrap-path (resolve root \"dist/bootstrap-release/bootstrap.json\"))\n (release-path (resolve root \"dist/stage3-release.json\")))\n (if (and (not (existsSync bootstrap-path)) (existsSync release-path))\n release-path\n bootstrap-path)))\n (defun release-manifest (values)\n (resolve (release-default (get values :bootstrap-manifest)\n (release-default (get (get globalThis.process :env) :ELISCRIPT_BOOTSTRAP_MANIFEST)\n (default-release-manifest)))))\n\n (defasync resolveReleaseCompiler (&optional options)\n (let ((settings (if (undefined? options) (js-object) options)))\n (unless (and settings (= (value-type settings) \"object\") (not (Array/isArray settings)))\n (release-type-error \"final compiler options must be an object\"))\n (await (authenticateStage3Targets\n (js-object :bootstrapManifestPath (release-default (get settings :bootstrapManifestPath)\n (release-manifest (js-object))) :stage3MetadataPath (get settings :stage3MetadataPath))))))\n\n (defun release-forward-arguments (arguments metadata-path)\n (let ((result (js-array)) (index 0) (artifact false))\n (while (< index (js-length arguments))\n (let ((value (aref arguments index)))\n (cond\n ((or (= value \"--bootstrap-manifest\") (= value \"--host\"))\n (setq index (1+ index)))\n ((or (js-call value :startsWith \"--bootstrap-manifest=\")\n (js-call value :startsWith \"--host=\")) nil)\n (t\n (when (or (= value \"--compiler-artifact\")\n (js-call value :startsWith \"--compiler-artifact=\")) (setq artifact t))\n (js-call result :push value))))\n (setq index (1+ index)))\n (unless artifact (js-call result :push \"--compiler-artifact\" metadata-path)) result))\n\n (defasync verify-release-bootstrap (values)\n ;; Read-only verification is deliberately independent of public runtime\n ;; preparation and compiler dispatch. The authenticator rereads and compares\n ;; every declared product byte and the original fixed-point receipt.\n (js-call (Object/keys values) :forEach (lambda (key)\n (unless (js-call (js-array \"bootstrap-manifest\" \"json-errors\") :includes key)\n (release-type-error (+ \"verify-bootstrap does not accept \" key)))))\n (let* ((certified (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)))))\n (source (get certified :sourceIdentity)))\n (js-object :format \"eliscript-bootstrap-verification\" :version 1\n :scope \"stage2-stage3-complete-products\" :verification \"identical\"\n :bootstrapManifestPath (get certified :bootstrapManifestPath)\n :fileCount (get certified :fixedPointFileCount)\n :stage2 (js-object :stage 2 :metadataPath (get certified :stage2MetadataPath)\n :productSha256 (get (get certified :stage2ProductIdentity) :sha256))\n :stage3 (js-object :stage 3 :metadataPath (get certified :stage3MetadataPath)\n :productSha256 (get (get certified :productIdentity) :sha256))\n :sourceIdentity (js-object :entry (get source :entry) :encoding (get source :encoding)\n :sha256 (get source :sha256)))))\n\n (defasync require-prepared-runtime (certified)\n (let* ((metadata-path (get certified :stage3MetadataPath))\n (metadata (await (readCompilerMetadata metadata-path)))\n (supports (js-call (get metadata :modules) :filter\n (lambda (record) (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\"\n \"runtime/unicode-case-data.mjs\") :includes (get record :id))))) (index 0))\n (while (< index (js-length supports))\n (let* ((support (aref supports index))\n (actual (await (readFile (resolve (dirname metadata-path) (get support :path)))))\n (prepared (await (readFile (resolve root (get support :id))))))\n (unless (isDeepStrictEqual actual prepared)\n (release-type-error \"prepare-release-package must install the final stage3 runtime before compiler execution\")))\n (setq index (1+ index)))))\n\n (defun release-write (io text)\n (if (and io (= (value-type (get io :write)) \"function\"))\n (js-call io :write text)\n (js-call (get globalThis.process :stdout) :write text)))\n\n (defun release-progress (event)\n ;; Only scalar progress is observed; a broken output pipe cannot replace\n ;; the compiler's result or original exception.\n (try\n (let ((record (js-object))\n (fields (js-array \"phase\" \"stage\" \"generation\" \"target\" \"filename\" \"index\" \"completed\" \"total\"))\n (index 0))\n (while (< index (js-length fields))\n (let* ((key (aref fields index)) (value (get event key)))\n (when (or (= (value-type value) \"string\") (= (value-type value) \"number\"))\n (put record key value)))\n (setq index (1+ index)))\n (js-call (get globalThis.process :stderr) :write (+ \"eliscript release \" (JSON/stringify record) \"\\n\")))\n (catch ignored nil)))\n\n (defasync release-corpus-path (values output)\n (if (not (undefined? (get values :corpus-records))) (resolve (get values :corpus-records))\n (let* ((corpus (await (loadCompilerMatrixCorpus (js-object :sourceRoot root))))\n (path (resolve output \"original-corpus.json\")))\n (await (mkdir output (js-object :recursive t)))\n (await (writeFile path (get corpus :recordsBytes))) path)))\n\n (defasync copy-if-different (source destination)\n (unless (= (resolve source) (resolve destination))\n (await (mkdir (dirname destination) (js-object :recursive t)))\n (await (cp source destination))))\n\n (defasync prepareReleasePackage (&optional options)\n (let* ((settings (if (undefined? options) (js-object) options))\n (certified (await (resolveReleaseCompiler settings)))\n (metadata-path (get certified :stage3MetadataPath))\n (metadata (await (readCompilerMetadata metadata-path)))\n (directory (dirname metadata-path)) (modules (get metadata :modules)) (index 0))\n (unless (and (= (get metadata :host) \"javascript\") (Array/isArray modules) (> (js-length modules) 0))\n (release-type-error \"stage3 package requires the complete JavaScript module graph\"))\n ;; Copy the actual final frontend modules into the established public\n ;; compiler paths. The full authenticated stage3 remains alongside them.\n (while (< index (js-length modules))\n (let* ((record (aref modules index)) (id (get record :id))\n (module-path (release-default (get record :path) id)))\n (unless (and (= (value-type id) \"string\") (= (value-type module-path) \"string\")\n (not (isAbsolute id)) (not (js-call id :includes \"\\\\\"))\n (not (js-call (js-call id :split \"/\") :includes \"..\")))\n (release-type-error \"stage3 package contains an invalid module path\"))\n (let* ((source (resolve directory module-path))\n (part (relative directory source)) (destination (resolve root \"dist\" id)))\n (when (or (isAbsolute part) (= part \"..\") (js-call part :startsWith (+ \"..\" sep)))\n (release-type-error \"stage3 package source escapes its artifact\"))\n (await (copy-if-different source destination))\n (when (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\" \"runtime/unicode-case-data.mjs\") :includes id)\n (await (copy-if-different source (resolve root id))))\n (when (= (value-type (get record :sourceMapPath)) \"string\")\n (await (copy-if-different (resolve directory (get record :sourceMapPath)) (+ destination \".map\")))\n (when (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\" \"runtime/unicode-case-data.mjs\") :includes id)\n (await (copy-if-different (resolve directory (get record :sourceMapPath))\n (resolve root (+ id \".map\"))))))))\n (setq index (1+ index)))\n (let ((runtime-rel (release-default (get metadata :runtimePath) \"runtime.eli\"))\n (literals (release-default (get metadata :literalSources) (js-array)))\n (lit-index 0))\n (await (copy-if-different (resolve directory \"package.json\") (resolve root \"dist/package.json\")))\n (await (copy-if-different (resolve directory runtime-rel) (resolve root \"dist\" runtime-rel)))\n (while (< lit-index (js-length literals))\n (let* ((item (aref literals lit-index))\n (lit-path (get item :path)))\n (when (= (value-type lit-path) \"string\")\n (await (copy-if-different (resolve directory lit-path) (resolve root \"dist\" lit-path)))))\n (setq lit-index (1+ lit-index))))\n (unless (= (resolve directory) (resolve root \"dist\"))\n (let* ((all-files (get (get metadata :artifactIdentity) :files))\n (packaged-files (js-call all-files :filter\n (lambda (entry) (not (js-call (get entry :path) :startsWith \"ir/\")))))\n (file-index 0))\n (while (< file-index (js-length packaged-files))\n (let ((rel-path (get (aref packaged-files file-index) :path)))\n (await (copy-if-different (resolve directory rel-path) (resolve root \"dist\" rel-path))))\n (setq file-index (1+ file-index)))\n (let* ((packaged-product-identity (independentCompilerProductIdentity\n (js-object :host (get metadata :host) :nativeTarget (get metadata :nativeTarget)\n :files packaged-files :descriptor (get metadata :descriptor) :typed (get metadata :typed))))\n (packaged-metadata (Object/assign (js-object) metadata\n (js-object :artifactIdentity (js-object :algorithm \"sha256\" :files packaged-files)\n :productIdentity packaged-product-identity\n :stage3FullProductIdentity (get metadata :productIdentity))))\n (release-receipt (js-object\n :format \"eliscript-stage3-release\" :version 1 :status \"accepted\"\n :scope \"stage2-stage3-complete-products\" :verification \"identical\"\n :metadataPath \"compiler-artifact.json\"\n :fixedPointFileCount (get certified :fixedPointFileCount)\n :formalSourceIdentity (get certified :sourceIdentity)\n :artifactSourceIdentity (get metadata :sourceIdentity)\n :stage2ProductIdentity (get certified :stage2ProductIdentity)\n :stage3ProductIdentity (get certified :productIdentity)\n :packagedProductIdentity packaged-product-identity)))\n (await (saveCompilerMetadata (resolve root \"dist/compiler-artifact.json\") packaged-metadata))\n (await (saveCompilerMetadata (resolve root \"dist/stage3-release.json\") release-receipt)))))\n certified))\n\n (defasync runReleaseCLI (arguments &optional io)\n (unless (and (Array/isArray arguments)\n (js-call arguments :every (lambda (value) (= (value-type value) \"string\"))))\n (release-type-error \"compiler CLI requires an argument array\"))\n (let* ((parsed (parseArgs (js-object :args arguments :allowPositionals t :strict t\n :options (js-object\n :help (js-object :type \"boolean\" :short \"h\")\n :json-errors (js-object :type \"boolean\")\n :host (js-object :type \"string\") :hosts (js-object :type \"string\")\n :seed (js-object :type \"boolean\") :profile (js-object :type \"string\")\n :stage0-manifest (js-object :type \"string\")\n :bootstrap-manifest (js-object :type \"string\")\n :compiler-artifact (js-object :type \"string\")\n :corpus-records (js-object :type \"string\")\n :functional-runtime-profile (js-object :type \"string\")\n :output (js-object :type \"string\" :short \"o\")\n :input (js-object :type \"string\" :short \"i\")\n :project (js-object :type \"string\") :root (js-object :type \"string\")\n :target (js-object :type \"string\") :request (js-object :type \"string\")\n :runtime (js-object :type \"string\") :host-modules (js-object :type \"string\")\n :macro-capability (js-object :type \"string\" :multiple t)\n :macro-dependency (js-object :type \"string\" :multiple t)\n :source-map (js-object :type \"boolean\") :debug (js-object :type \"boolean\")\n :native-target (js-object :type \"string\") :native-format (js-object :type \"string\")))))\n (values (get parsed :values)) (positionals (get parsed :positionals))\n (command (aref positionals 0)))\n (if (get values :help) (release-write io release-help)\n (progn\n (when (or (get values :hosts)\n (and (not (undefined? (get values :host))) (/= (get values :host) \"javascript\")))\n (release-type-error \"this release supports only a JavaScript compiler host\"))\n (unless (= (js-length positionals) 1) (release-type-error \"provide exactly one compiler command\"))\n (unless (undefined? (get values :functional-runtime-profile))\n (unless (and (= command \"targets\") (= (get values :functional-runtime-profile) \"small\"))\n (release-type-error \"functionalRuntimeProfile is supported only as targets --functional-runtime-profile small\")))\n (when (js-call (js-array \"compiler-grid\" \"matrix\" \"bootstrap-all\" \"build\") :includes command)\n (release-type-error \"cancelled compiler-host or grid command; use the JavaScript bootstrap\"))\n (cond\n ((= command \"verify-bootstrap\")\n (let ((report (await (verify-release-bootstrap values))))\n (release-write io (+ (JSON/stringify report) \"\\n\")) report))\n ((= command \"bootstrap\")\n (unless (and (get values :stage0-manifest) (get values :output))\n (release-type-error \"bootstrap requires --stage0-manifest and --output\"))\n (release-progress (js-object :phase \"bootstrap-start\"))\n (let ((result (await (bootstrapJsStages\n (js-object :stage0ManifestPath (resolve (get values :stage0-manifest))\n :sourceRoot (resolve (release-default (get values :root) root))\n :outputRoot (resolve (get values :output)) :onStage release-progress)))))\n (release-write io (+ (get result :manifestPath) \"\\n\")) result))\n ((= command \"targets\")\n (await (require-prepared-runtime (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact))))))\n (let* ((output (resolve (release-default (get values :output) (resolve root \"dist/bootstrap-release/targets\"))))\n (corpus-path (await (release-corpus-path values output))))\n (release-progress (js-object :phase \"targets-start\"))\n (let ((result (await (runStage3Targets\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact) :corpusRecordsPath corpus-path\n :functionalRuntimeProfile (get values :functional-runtime-profile)\n :outputRoot output :nativeTarget (release-default (get values :native-target)\n (if (= (get globalThis.process :platform) \"linux\") \"arm64-linux\" \"arm64-macos\"))\n :onStage release-progress)))))\n (release-write io (+ (if (= (value-type result) \"string\") result\n (release-default (get result :reportPath) (release-default (get result :manifestPath) \"targets-complete\"))) \"\\n\")) result)))\n ((= command \"prepare-release-package\")\n (let ((result (await (prepareReleasePackage (js-object :bootstrapManifestPath (release-manifest values))))))\n (release-write io (+ (get result :stage3MetadataPath) \"\\n\")) result))\n ((js-call (js-array \"compile\" \"request\" \"package\") :includes command)\n (let ((certified (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact))))))\n (await (require-prepared-runtime certified))\n (await (runCompilerCLI (release-forward-arguments arguments (get certified :stage3MetadataPath))))))\n (t (release-type-error (+ \"unsupported compiler command: \" command))))))))\n\n (defun renderReleaseCLIError (error &optional options)\n (if (and options (get options :json))\n (JSON/stringify (js-object :format \"eliscript-compiler-cli-error\" :version 1 :error (compilerFailure error)))\n (let ((record (compilerFailure error)))\n (release-default (get record :stack) (JSON/stringify record nil 2)))))\n\n (when (and (aref (get globalThis.process :argv) 1)\n (= (resolve (aref (get globalThis.process :argv) 1)) (fileURLToPath (js* \"import.meta.url\"))))\n (js-call (runReleaseCLI (js-call (get globalThis.process :argv) :slice 2)) :catch\n (lambda (error)\n (js-call (get globalThis.process :stderr) :write\n (+ (renderReleaseCLIError error (js-object :json\n (js-call (get globalThis.process :argv) :includes \"--json-errors\"))) \"\\n\"))\n (put globalThis.process :exitCode 1))))\n (export runReleaseCLI resolveReleaseCompiler renderReleaseCLIError prepareReleasePackage))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACE,QAA2B,UAAS,WAAU,OAAM;AACpD,QAAkB;AAClB,QAAoB,SAAQ,SAAQ,MAAK,UAAS,YAAW;AAC7D,QAAmB;AACnB,QAAoB,WAAU;AAC9B,QAAuB;AACvB,QAAqC;AACrC,QAAoC,iBAAgB;AACpD,QAAgC;AAChC,QAAmC;AACnC,QAAiC;AACjC,QAAoC;AACpC,QAAgC,kBAAiB;AAEjD,qBACE;;AAEF,yBAAwB,OAAM;EAAU,IAAI,CAAY;IAAO,OAAA;;IAAS,OAAA;;;AACxE,4BAA2B;EAAS,OAAA,0DAAO,KAAK,sBAAqB;;AACrE;EACE;gCAAuB,QAAQ,MAAK;gCACf,QAAQ,MAAK;;UAD5B;UACA;MACJ,uBAAI,qEAAwC,WAAW,sCAA9C,qBAAM,WAAW;QACxB,OAAA;;QACA,OAAA;;;;;AACN,0BAAyB;EACvB,OAAC,QAAS,gBAAgB,CAAK,QAAO,uBACnC,gBAAgB,CAAK,CAAK,oBAAmB,QAAM,iCACjD;;AAEP,sCAA4C;EAC1C,OAAA,eAAM;IACJ,yBAAQ,sEAAc,CAAG,s7BAAY,cAAU,aAAU,qBAAM,cAAc,qCAAhE;MACV,mBAAmB;;IACtB,OAAA,OAAQ,0BACN,EAAW,yBAAwB,gBAAgB,CAAK,UAAS,0BAC9D,iBAAiB,QAAc,sBAAoB,CAAK,UAAS;KALxD,CAAI,CAAY,yBAAS,OAAY;;AAOvD,mCAAkC,YAAU;EAC1C;gCAAc;gCAAmB;gCAAa;;UAAxC;UAAoB;UAAU;MAClC,OAAO,kCAAG,OAAM,EAAW;QACzB;s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BAAmB;EACzE,OAAA,EAAK,oBAAmB,cAAU;;AACxC,QAAQ,eAAc,wBAAuB,uBAAsB"}
|
|
1
|
+
{"version":3,"file":"release-cli.mjs","sources":["../eliscript/release-cli.eli"],"sourcesContent":["(module tools.backends.release-cli\n (import \"node:fs/promises\" readFile writeFile mkdir cp)\n (import \"node:fs\" existsSync)\n (import \"node:path\" resolve dirname join relative isAbsolute sep)\n (import \"node:url\" fileURLToPath)\n (import \"node:util\" parseArgs isDeepStrictEqual)\n (import \"../build.mjs\" root)\n (import \"../compiler-cli-legacy.mjs\" runCompilerCLI)\n (import \"../compiler-bootstrap.mjs\" compilerFailure saveCompilerMetadata)\n (import \"../compiler-build.mjs\" independentCompilerProductIdentity)\n (import \"../compiler-metadata.mjs\" readCompilerMetadata)\n (import \"../compiler-matrix.mjs\" loadCompilerMatrixCorpus)\n (import \"./bootstrap-js-stages.mjs\" bootstrapJsStages)\n (import \"../stage3-targets.mjs\" runStage3Targets authenticateStage3Targets)\n\n (defconst release-help\n \"Eliscript JavaScript compiler bootstrap and final outputs\\n\\n bootstrap --stage0-manifest FILE --output DIRECTORY\\n verify-bootstrap [--bootstrap-manifest FILE]\\n targets [--bootstrap-manifest FILE] [--corpus-records FILE] [--output DIRECTORY] [--functional-runtime-profile small]\\n compile [--bootstrap-manifest FILE] --input SOURCE --target javascript|wasm|native --output PATH\\n compile [--bootstrap-manifest FILE] --project ENTRY --root DIRECTORY --target TARGET --output PATH\\n request [--bootstrap-manifest FILE] --request FILE [--output PATH]\\n package [--bootstrap-manifest FILE] --output DIRECTORY\\n prepare-release-package [--bootstrap-manifest FILE]\\n\\nEmacs generates JavaScript stage0. stage0 -> stage1 -> stage2 -> stage3 all run as JavaScript.\\nOnly stage3 supplies the final javascript, wasm and native program outputs.\\nThe stage2/stage3 fixed point is verified before a final compiler is used.\\nFunctional small resources explicitly defer the original sequence capacity acceptance.\\n\")\n\n (defun release-default (value fallback) (if (undefined? value) fallback value))\n (defun release-type-error (message) (throw (new globalThis.TypeError message)))\n (defun default-release-manifest ()\n (let ((bootstrap-path (resolve root \"dist/bootstrap-release/bootstrap.json\"))\n (release-path (resolve root \"dist/stage3-release.json\")))\n (if (and (not (existsSync bootstrap-path)) (existsSync release-path))\n release-path\n bootstrap-path)))\n (defun release-manifest (values)\n (resolve (release-default (get values :bootstrap-manifest)\n (release-default (get (get globalThis.process :env) :ELISCRIPT_BOOTSTRAP_MANIFEST)\n (default-release-manifest)))))\n\n (defasync resolveReleaseCompiler (&optional options)\n (let ((settings (if (undefined? options) (js-object) options)))\n (unless (and settings (= (value-type settings) \"object\") (not (Array/isArray settings)))\n (release-type-error \"final compiler options must be an object\"))\n (await (authenticateStage3Targets\n (js-object :bootstrapManifestPath (release-default (get settings :bootstrapManifestPath)\n (release-manifest (js-object))) :stage3MetadataPath (get settings :stage3MetadataPath))))))\n\n (defun release-forward-arguments (arguments metadata-path)\n (let ((result (js-array)) (index 0) (artifact false))\n (while (< index (js-length arguments))\n (let ((value (aref arguments index)))\n (cond\n ((or (= value \"--bootstrap-manifest\") (= value \"--host\"))\n (setq index (1+ index)))\n ((or (js-call value :startsWith \"--bootstrap-manifest=\")\n (js-call value :startsWith \"--host=\")) nil)\n (t\n (when (or (= value \"--compiler-artifact\")\n (js-call value :startsWith \"--compiler-artifact=\")) (setq artifact t))\n (js-call result :push value))))\n (setq index (1+ index)))\n (unless artifact (js-call result :push \"--compiler-artifact\" metadata-path)) result))\n\n (defasync verify-release-bootstrap (values)\n ;; Read-only verification is deliberately independent of public runtime\n ;; preparation and compiler dispatch. The authenticator rereads and compares\n ;; every declared product byte and the original fixed-point receipt.\n (js-call (Object/keys values) :forEach (lambda (key)\n (unless (js-call (js-array \"bootstrap-manifest\" \"json-errors\") :includes key)\n (release-type-error (+ \"verify-bootstrap does not accept \" key)))))\n (let* ((certified (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)))))\n (source (get certified :sourceIdentity)))\n (js-object :format \"eliscript-bootstrap-verification\" :version 1\n :scope \"stage2-stage3-complete-products\" :verification \"identical\"\n :bootstrapManifestPath (get certified :bootstrapManifestPath)\n :fileCount (get certified :fixedPointFileCount)\n :stage2 (js-object :stage 2 :metadataPath (get certified :stage2MetadataPath)\n :productSha256 (get (get certified :stage2ProductIdentity) :sha256))\n :stage3 (js-object :stage 3 :metadataPath (get certified :stage3MetadataPath)\n :productSha256 (get (get certified :productIdentity) :sha256))\n :sourceIdentity (js-object :entry (get source :entry) :encoding (get source :encoding)\n :sha256 (get source :sha256)))))\n\n (defasync require-prepared-runtime (certified)\n (let* ((metadata-path (get certified :stage3MetadataPath))\n (metadata (await (readCompilerMetadata metadata-path)))\n (supports (js-call (get metadata :modules) :filter\n (lambda (record) (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\"\n \"runtime/unicode-case-data.mjs\") :includes (get record :id))))) (index 0))\n (while (< index (js-length supports))\n (let* ((support (aref supports index))\n (actual (await (readFile (resolve (dirname metadata-path) (get support :path)))))\n (prepared (await (readFile (resolve root (get support :id))))))\n (unless (isDeepStrictEqual actual prepared)\n (release-type-error \"prepare-release-package must install the final stage3 runtime before compiler execution\")))\n (setq index (1+ index)))))\n\n (defun release-write (io text)\n (if (and io (= (value-type (get io :write)) \"function\"))\n (js-call io :write text)\n (js-call (get globalThis.process :stdout) :write text)))\n\n (defun release-progress (event)\n ;; Only scalar progress is observed; a broken output pipe cannot replace\n ;; the compiler's result or original exception.\n (try\n (let ((record (js-object))\n (fields (js-array \"phase\" \"stage\" \"generation\" \"target\" \"filename\" \"index\" \"completed\" \"total\"))\n (index 0))\n (while (< index (js-length fields))\n (let* ((key (aref fields index)) (value (get event key)))\n (when (or (= (value-type value) \"string\") (= (value-type value) \"number\"))\n (put record key value)))\n (setq index (1+ index)))\n (js-call (get globalThis.process :stderr) :write (+ \"eliscript release \" (JSON/stringify record) \"\\n\")))\n (catch ignored nil)))\n\n (defasync release-corpus-path (values output)\n (if (not (undefined? (get values :corpus-records))) (resolve (get values :corpus-records))\n (let* ((corpus (await (loadCompilerMatrixCorpus (js-object :sourceRoot root))))\n (path (resolve output \"original-corpus.json\")))\n (await (mkdir output (js-object :recursive t)))\n (await (writeFile path (get corpus :recordsBytes))) path)))\n\n (defasync copy-if-different (source destination)\n (unless (= (resolve source) (resolve destination))\n (await (mkdir (dirname destination) (js-object :recursive t)))\n (await (cp source destination))))\n\n (defasync prepareReleasePackage (&optional options)\n (let* ((settings (if (undefined? options) (js-object) options))\n (certified (await (resolveReleaseCompiler settings)))\n (metadata-path (get certified :stage3MetadataPath))\n (metadata (await (readCompilerMetadata metadata-path)))\n (directory (dirname metadata-path)) (modules (get metadata :modules)) (index 0))\n (unless (and (= (get metadata :host) \"javascript\") (Array/isArray modules) (> (js-length modules) 0))\n (release-type-error \"stage3 package requires the complete JavaScript module graph\"))\n ;; Copy the actual final frontend modules into the established public\n ;; compiler paths. The full authenticated stage3 remains alongside them.\n (while (< index (js-length modules))\n (let* ((record (aref modules index)) (id (get record :id))\n (module-path (release-default (get record :path) id)))\n (unless (and (= (value-type id) \"string\") (= (value-type module-path) \"string\")\n (not (isAbsolute id)) (not (js-call id :includes \"\\\\\"))\n (not (js-call (js-call id :split \"/\") :includes \"..\")))\n (release-type-error \"stage3 package contains an invalid module path\"))\n (let* ((source (resolve directory module-path))\n (part (relative directory source)) (destination (resolve root \"dist\" id)))\n (when (or (isAbsolute part) (= part \"..\") (js-call part :startsWith (+ \"..\" sep)))\n (release-type-error \"stage3 package source escapes its artifact\"))\n (await (copy-if-different source destination))\n (when (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\" \"runtime/unicode-case-data.mjs\") :includes id)\n (await (copy-if-different source (resolve root id))))\n (when (= (value-type (get record :sourceMapPath)) \"string\")\n (await (copy-if-different (resolve directory (get record :sourceMapPath)) (+ destination \".map\")))\n (when (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\" \"runtime/unicode-case-data.mjs\") :includes id)\n (await (copy-if-different (resolve directory (get record :sourceMapPath))\n (resolve root (+ id \".map\"))))))))\n (setq index (1+ index)))\n (let ((runtime-rel (release-default (get metadata :runtimePath) \"runtime.eli\"))\n (literals (release-default (get metadata :literalSources) (js-array)))\n (lit-index 0))\n (await (copy-if-different (resolve directory \"package.json\") (resolve root \"dist/package.json\")))\n (await (copy-if-different (resolve directory runtime-rel) (resolve root \"dist\" runtime-rel)))\n (while (< lit-index (js-length literals))\n (let* ((item (aref literals lit-index))\n (lit-path (get item :path)))\n (when (= (value-type lit-path) \"string\")\n (await (copy-if-different (resolve directory lit-path) (resolve root \"dist\" lit-path)))))\n (setq lit-index (1+ lit-index))))\n (unless (= (resolve directory) (resolve root \"dist\"))\n (let* ((all-files (get (get metadata :artifactIdentity) :files))\n (packaged-files (js-call all-files :filter\n (lambda (entry) (not (js-call (get entry :path) :startsWith \"ir/\")))))\n (file-index 0))\n (while (< file-index (js-length packaged-files))\n (let ((rel-path (get (aref packaged-files file-index) :path)))\n (await (copy-if-different (resolve directory rel-path) (resolve root \"dist\" rel-path))))\n (setq file-index (1+ file-index)))\n (let* ((packaged-product-identity (independentCompilerProductIdentity\n (js-object :host (get metadata :host) :nativeTarget (get metadata :nativeTarget)\n :files packaged-files :descriptor (get metadata :descriptor) :typed (get metadata :typed))))\n (packaged-metadata (Object/assign (js-object) metadata\n (js-object :artifactIdentity (js-object :algorithm \"sha256\" :files packaged-files)\n :productIdentity packaged-product-identity\n :stage3FullProductIdentity (get metadata :productIdentity))))\n (release-receipt (js-object\n :format \"eliscript-stage3-release\" :version 1 :status \"accepted\"\n :scope \"stage2-stage3-complete-products\" :verification \"identical\"\n :metadataPath \"compiler-artifact.json\"\n :fixedPointFileCount (get certified :fixedPointFileCount)\n :formalSourceIdentity (get certified :sourceIdentity)\n :artifactSourceIdentity (get metadata :sourceIdentity)\n :stage2ProductIdentity (get certified :stage2ProductIdentity)\n :stage3ProductIdentity (get certified :productIdentity)\n :packagedProductIdentity packaged-product-identity)))\n (Reflect/deleteProperty packaged-metadata \"frontendIR\")\n (Reflect/deleteProperty packaged-metadata \"literalIR\")\n (await (saveCompilerMetadata (resolve root \"dist/compiler-artifact.json\") packaged-metadata))\n (await (saveCompilerMetadata (resolve root \"dist/stage3-release.json\") release-receipt)))))\n certified))\n\n (defasync runReleaseCLI (arguments &optional io)\n (unless (and (Array/isArray arguments)\n (js-call arguments :every (lambda (value) (= (value-type value) \"string\"))))\n (release-type-error \"compiler CLI requires an argument array\"))\n (let* ((parsed (parseArgs (js-object :args arguments :allowPositionals t :strict t\n :options (js-object\n :help (js-object :type \"boolean\" :short \"h\")\n :json-errors (js-object :type \"boolean\")\n :host (js-object :type \"string\") :hosts (js-object :type \"string\")\n :seed (js-object :type \"boolean\") :profile (js-object :type \"string\")\n :stage0-manifest (js-object :type \"string\")\n :bootstrap-manifest (js-object :type \"string\")\n :compiler-artifact (js-object :type \"string\")\n :corpus-records (js-object :type \"string\")\n :functional-runtime-profile (js-object :type \"string\")\n :output (js-object :type \"string\" :short \"o\")\n :input (js-object :type \"string\" :short \"i\")\n :project (js-object :type \"string\") :root (js-object :type \"string\")\n :target (js-object :type \"string\") :request (js-object :type \"string\")\n :runtime (js-object :type \"string\") :host-modules (js-object :type \"string\")\n :macro-capability (js-object :type \"string\" :multiple t)\n :macro-dependency (js-object :type \"string\" :multiple t)\n :source-map (js-object :type \"boolean\") :debug (js-object :type \"boolean\")\n :native-target (js-object :type \"string\") :native-format (js-object :type \"string\")))))\n (values (get parsed :values)) (positionals (get parsed :positionals))\n (command (aref positionals 0)))\n (if (get values :help) (release-write io release-help)\n (progn\n (when (or (get values :hosts)\n (and (not (undefined? (get values :host))) (/= (get values :host) \"javascript\")))\n (release-type-error \"this release supports only a JavaScript compiler host\"))\n (unless (= (js-length positionals) 1) (release-type-error \"provide exactly one compiler command\"))\n (unless (undefined? (get values :functional-runtime-profile))\n (unless (and (= command \"targets\") (= (get values :functional-runtime-profile) \"small\"))\n (release-type-error \"functionalRuntimeProfile is supported only as targets --functional-runtime-profile small\")))\n (when (js-call (js-array \"compiler-grid\" \"matrix\" \"bootstrap-all\" \"build\") :includes command)\n (release-type-error \"cancelled compiler-host or grid command; use the JavaScript bootstrap\"))\n (cond\n ((= command \"verify-bootstrap\")\n (let ((report (await (verify-release-bootstrap values))))\n (release-write io (+ (JSON/stringify report) \"\\n\")) report))\n ((= command \"bootstrap\")\n (unless (and (get values :stage0-manifest) (get values :output))\n (release-type-error \"bootstrap requires --stage0-manifest and --output\"))\n (release-progress (js-object :phase \"bootstrap-start\"))\n (let ((result (await (bootstrapJsStages\n (js-object :stage0ManifestPath (resolve (get values :stage0-manifest))\n :sourceRoot (resolve (release-default (get values :root) root))\n :outputRoot (resolve (get values :output)) :onStage release-progress)))))\n (release-write io (+ (get result :manifestPath) \"\\n\")) result))\n ((= command \"targets\")\n (await (require-prepared-runtime (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact))))))\n (let* ((output (resolve (release-default (get values :output) (resolve root \"dist/bootstrap-release/targets\"))))\n (corpus-path (await (release-corpus-path values output))))\n (release-progress (js-object :phase \"targets-start\"))\n (let ((result (await (runStage3Targets\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact) :corpusRecordsPath corpus-path\n :functionalRuntimeProfile (get values :functional-runtime-profile)\n :outputRoot output :nativeTarget (release-default (get values :native-target)\n (if (= (get globalThis.process :platform) \"linux\") \"arm64-linux\" \"arm64-macos\"))\n :onStage release-progress)))))\n (release-write io (+ (if (= (value-type result) \"string\") result\n (release-default (get result :reportPath) (release-default (get result :manifestPath) \"targets-complete\"))) \"\\n\")) result)))\n ((= command \"prepare-release-package\")\n (let ((result (await (prepareReleasePackage (js-object :bootstrapManifestPath (release-manifest values))))))\n (release-write io (+ (get result :stage3MetadataPath) \"\\n\")) result))\n ((js-call (js-array \"compile\" \"request\" \"package\") :includes command)\n (let ((certified (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact))))))\n (await (require-prepared-runtime certified))\n (await (runCompilerCLI (release-forward-arguments arguments (get certified :stage3MetadataPath))))))\n (t (release-type-error (+ \"unsupported compiler command: \" command))))))))\n\n (defun renderReleaseCLIError (error &optional options)\n (if (and options (get options :json))\n (JSON/stringify (js-object :format \"eliscript-compiler-cli-error\" :version 1 :error (compilerFailure error)))\n (let ((record (compilerFailure error)))\n (release-default (get record :stack) (JSON/stringify record nil 2)))))\n\n (when (and (aref (get globalThis.process :argv) 1)\n (= (resolve (aref (get globalThis.process :argv) 1)) (fileURLToPath (js* \"import.meta.url\"))))\n (js-call (runReleaseCLI (js-call (get globalThis.process :argv) :slice 2)) :catch\n (lambda (error)\n (js-call (get globalThis.process :stderr) :write\n (+ (renderReleaseCLIError error (js-object :json\n (js-call (get globalThis.process :argv) :includes \"--json-errors\"))) \"\\n\"))\n (put globalThis.process :exitCode 1))))\n (export runReleaseCLI resolveReleaseCompiler renderReleaseCLIError prepareReleasePackage))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACE,QAA2B,UAAS,WAAU,OAAM;AACpD,QAAkB;AAClB,QAAoB,SAAQ,SAAQ,MAAK,UAAS,YAAW;AAC7D,QAAmB;AACnB,QAAoB,WAAU;AAC9B,QAAuB;AACvB,QAAqC;AACrC,QAAoC,iBAAgB;AACpD,QAAgC;AAChC,QAAmC;AACnC,QAAiC;AACjC,QAAoC;AACpC,QAAgC,kBAAiB;AAEjD,qBACE;;AAEF,yBAAwB,OAAM;EAAU,IAAI,CAAY;IAAO,OAAA;;IAAS,OAAA;;;AACxE,4BAA2B;EAAS,OAAA,0DAAO,KAAK,sBAAqB;;AACrE;EACE;gCAAuB,QAAQ,MAAK;gCACf,QAAQ,MAAK;;UAD5B;UACA;MACJ,uBAAI,qE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