halfcode-compiler.xnl 0.2.4 → 0.2.5
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/dist/application-assembly.js +1 -1
- package/dist/index.js +3 -3
- package/dist/resource-core.js +1 -1
- package/dist/skill-capsule.js +1 -1
- package/dist/{src-Bj7BZokJ.js → src-BGFskWEk.js} +39 -5
- package/dist/{src-ClihwpeP.js → src-BJ5cQQ7P.js} +1 -1
- package/dist/{src-6nezdi57.js → src-BxwHmx6r.js} +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as assertObjectOperationCatalog, c as resolveApplicationAssembly, i as assertObjectOperationCall, l as resourceRefToFqn, n as applicationAssemblyPackage, o as assertObjectOperationDefinition, r as assertExecuteObjectOperationRequest, s as loadApplicationAssembly, t as ObjectOperationContractError } from "./src-
|
|
1
|
+
import { a as assertObjectOperationCatalog, c as resolveApplicationAssembly, i as assertObjectOperationCall, l as resourceRefToFqn, n as applicationAssemblyPackage, o as assertObjectOperationDefinition, r as assertExecuteObjectOperationRequest, s as loadApplicationAssembly, t as ObjectOperationContractError } from "./src-BxwHmx6r.js";
|
|
2
2
|
export { ObjectOperationContractError, applicationAssemblyPackage, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, loadApplicationAssembly, resolveApplicationAssembly, resourceRefToFqn };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as ResourceCompositionError, a as CODE_PACKAGE_ENTRY_CONTRIBUTION_KEY, c as admitCodePackages, d as buildResourceDependencySnapshot, f as createResourceContentIdentity, l as loadCodePackageModule, n as loadResourceTree, o as CodePackageLoadError, p as sha256Digest, r as validateResourceTree, s as admitCodePackageExports, t as ResourceValidationError } from "./src-
|
|
2
|
-
import { a as assertObjectOperationCatalog, c as resolveApplicationAssembly, i as assertObjectOperationCall, l as resourceRefToFqn, n as applicationAssemblyPackage, o as assertObjectOperationDefinition, r as assertExecuteObjectOperationRequest, s as loadApplicationAssembly, t as ObjectOperationContractError } from "./src-
|
|
1
|
+
import { _ as ResourceCompositionError, a as CODE_PACKAGE_ENTRY_CONTRIBUTION_KEY, c as admitCodePackages, d as buildResourceDependencySnapshot, f as createResourceContentIdentity, l as loadCodePackageModule, n as loadResourceTree, o as CodePackageLoadError, p as sha256Digest, r as validateResourceTree, s as admitCodePackageExports, t as ResourceValidationError } from "./src-BGFskWEk.js";
|
|
2
|
+
import { a as assertObjectOperationCatalog, c as resolveApplicationAssembly, i as assertObjectOperationCall, l as resourceRefToFqn, n as applicationAssemblyPackage, o as assertObjectOperationDefinition, r as assertExecuteObjectOperationRequest, s as loadApplicationAssembly, t as ObjectOperationContractError } from "./src-BxwHmx6r.js";
|
|
3
3
|
import "./application-assembly.js";
|
|
4
4
|
import { composeLayeredResourceRegistry, resolveEffectiveResourceContentIdentities } from "./resource-core.js";
|
|
5
|
-
import { a as compilerSkillPackage, i as compileSkillCapsule, n as applySkillCapsuleDistributionPlan, o as planSkillCapsuleDistribution, r as compileResourceSkillCapsule, s as skillCapsuleDistributionProjection, t as SkillCapsuleDistributionError } from "./src-
|
|
5
|
+
import { a as compilerSkillPackage, i as compileSkillCapsule, n as applySkillCapsuleDistributionPlan, o as planSkillCapsuleDistribution, r as compileResourceSkillCapsule, s as skillCapsuleDistributionProjection, t as SkillCapsuleDistributionError } from "./src-BJ5cQQ7P.js";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
//#region src/bundled-system-skills.ts
|
|
8
8
|
function loadHalfcodeResourceDslSystemSkillModule() {
|
package/dist/resource-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as ResourceCompositionError, a as CODE_PACKAGE_ENTRY_CONTRIBUTION_KEY, c as admitCodePackages, d as buildResourceDependencySnapshot, f as createResourceContentIdentity, g as markEffectiveRegistryAuthentic, h as isEffectiveRegistryAuthentic, i as readonlyMap, l as loadCodePackageModule, m as effectiveRegistryLayerBindings, n as loadResourceTree, o as CodePackageLoadError, p as sha256Digest, r as validateResourceTree, s as admitCodePackageExports, t as ResourceValidationError, u as isLoadedResourceTreeAuthentic, v as compareCodeUnits, y as digestCanonical } from "./src-
|
|
1
|
+
import { _ as ResourceCompositionError, a as CODE_PACKAGE_ENTRY_CONTRIBUTION_KEY, c as admitCodePackages, d as buildResourceDependencySnapshot, f as createResourceContentIdentity, g as markEffectiveRegistryAuthentic, h as isEffectiveRegistryAuthentic, i as readonlyMap, l as loadCodePackageModule, m as effectiveRegistryLayerBindings, n as loadResourceTree, o as CodePackageLoadError, p as sha256Digest, r as validateResourceTree, s as admitCodePackageExports, t as ResourceValidationError, u as isLoadedResourceTreeAuthentic, v as compareCodeUnits, y as digestCanonical } from "./src-BGFskWEk.js";
|
|
2
2
|
//#region ../resource-core/src/layered-registry.ts
|
|
3
3
|
function composeLayeredResourceRegistry(input) {
|
|
4
4
|
const diagnostics = [];
|
package/dist/skill-capsule.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as compilerSkillPackage, i as compileSkillCapsule, n as applySkillCapsuleDistributionPlan, o as planSkillCapsuleDistribution, r as compileResourceSkillCapsule, s as skillCapsuleDistributionProjection, t as SkillCapsuleDistributionError } from "./src-
|
|
1
|
+
import { a as compilerSkillPackage, i as compileSkillCapsule, n as applySkillCapsuleDistributionPlan, o as planSkillCapsuleDistribution, r as compileResourceSkillCapsule, s as skillCapsuleDistributionProjection, t as SkillCapsuleDistributionError } from "./src-BJ5cQQ7P.js";
|
|
2
2
|
export { SkillCapsuleDistributionError, applySkillCapsuleDistributionPlan, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, planSkillCapsuleDistribution, skillCapsuleDistributionProjection };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { n as wordToString, t as parseXnl } from "./dist-Bkv7YeVi.js";
|
|
2
|
-
import { readFile, readdir, realpath, stat } from "node:fs/promises";
|
|
2
|
+
import { mkdtemp, readFile, readdir, realpath, rm, stat, writeFile } from "node:fs/promises";
|
|
3
3
|
import { dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
|
-
import {
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
import { pathToFileURL } from "node:url";
|
|
6
7
|
//#region ../resource-core/src/canonical.ts
|
|
7
8
|
function compareCodeUnits(left, right) {
|
|
8
9
|
if (left < right) return -1;
|
|
@@ -379,6 +380,26 @@ const nodeCodePackageRuntime = Object.freeze({
|
|
|
379
380
|
realpath,
|
|
380
381
|
readFile,
|
|
381
382
|
stat,
|
|
383
|
+
prepareModuleSource: async ({ bytes }) => {
|
|
384
|
+
const directory = await mkdtemp(join(tmpdir(), "halfcode-code-package-module-"));
|
|
385
|
+
const sourcePath = join(directory, "entry.mjs");
|
|
386
|
+
try {
|
|
387
|
+
await writeFile(sourcePath, bytes, { flag: "wx" });
|
|
388
|
+
} catch (error) {
|
|
389
|
+
await rm(directory, {
|
|
390
|
+
recursive: true,
|
|
391
|
+
force: true
|
|
392
|
+
}).catch(() => void 0);
|
|
393
|
+
throw error;
|
|
394
|
+
}
|
|
395
|
+
return Object.freeze({
|
|
396
|
+
url: pathToFileURL(sourcePath).href,
|
|
397
|
+
dispose: async () => rm(directory, {
|
|
398
|
+
recursive: true,
|
|
399
|
+
force: true
|
|
400
|
+
})
|
|
401
|
+
});
|
|
402
|
+
},
|
|
382
403
|
importModule: async (url) => import(url)
|
|
383
404
|
});
|
|
384
405
|
var CodePackageLoadError = class extends Error {
|
|
@@ -458,13 +479,26 @@ async function loadCodePackageModuleWithRuntime(runtime, input) {
|
|
|
458
479
|
if (entry.diagnostics.length > 0 || !entry.entryPath || !entry.bytes) throw new CodePackageLoadError(entry.diagnostics);
|
|
459
480
|
const contribution = identity.contributions.find((item) => item.key === CODE_PACKAGE_ENTRY_CONTRIBUTION_KEY);
|
|
460
481
|
if (!contribution || contribution.digest !== sha256Digest(entry.bytes) || contribution.sourceUri !== entry.sourceUri) throw loadError("RESOURCE_CODE_PACKAGE_REVISION_STALE", `${record.documentUri}#CodeBinding`, `CodePackage entry for '${record.resourceId}' changed after its ResourceTree was loaded.`);
|
|
461
|
-
|
|
482
|
+
let preparedSource;
|
|
483
|
+
try {
|
|
484
|
+
preparedSource = await runtime.prepareModuleSource({
|
|
485
|
+
bytes: entry.bytes,
|
|
486
|
+
revision: identity.contentDigest
|
|
487
|
+
});
|
|
488
|
+
} catch {
|
|
489
|
+
throw loadError("RESOURCE_CODE_PACKAGE_IMPORT_PREPARE_FAILED", `${record.documentUri}#CodeBinding`, `CodePackage entry for '${record.resourceId}' could not be prepared for import.`);
|
|
490
|
+
}
|
|
462
491
|
let moduleNamespace;
|
|
492
|
+
let importFailed = false;
|
|
463
493
|
try {
|
|
464
|
-
moduleNamespace = await runtime.importModule(url);
|
|
494
|
+
moduleNamespace = await runtime.importModule(preparedSource.url);
|
|
465
495
|
} catch {
|
|
466
|
-
|
|
496
|
+
importFailed = true;
|
|
497
|
+
moduleNamespace = Object.freeze({});
|
|
467
498
|
}
|
|
499
|
+
const cleanupFailed = await preparedSource.dispose().then(() => false, () => true);
|
|
500
|
+
if (importFailed) throw loadError("RESOURCE_CODE_PACKAGE_IMPORT_FAILED", `${record.documentUri}#CodeBinding`, `CodePackage entry for '${record.resourceId}' could not be imported.`);
|
|
501
|
+
if (cleanupFailed) throw loadError("RESOURCE_CODE_PACKAGE_IMPORT_CLEANUP_FAILED", `${record.documentUri}#CodeBinding`, `CodePackage entry for '${record.resourceId}' could not be cleaned up after import.`);
|
|
468
502
|
if (binding.exportName && !(binding.exportName in moduleNamespace)) throw loadError("RESOURCE_CODE_PACKAGE_EXPORT_MISSING", `${record.documentUri}#CodeBinding`, `CodePackage entry for '${record.resourceId}' does not export '${binding.exportName}'.`);
|
|
469
503
|
const currentBytes = await runtime.readFile(entry.entryPath).catch(() => void 0);
|
|
470
504
|
if (!currentBytes || sha256Digest(currentBytes) !== contribution.digest) throw loadError("RESOURCE_CODE_PACKAGE_REVISION_STALE", `${record.documentUri}#CodeBinding`, `CodePackage entry for '${record.resourceId}' changed while it was being imported.`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as resourceRefToFqn, u as resolveObjectOperationCompilation } from "./src-
|
|
1
|
+
import { l as resourceRefToFqn, u as resolveObjectOperationCompilation } from "./src-BxwHmx6r.js";
|
|
2
2
|
import { c as unsafeUnicodeCodeUnitIssue, i as planResourceMappings, o as safePathLexicalIssue, r as parseResourceMappings, t as ResourceMappingPathError } from "./src-25wZPUyX.js";
|
|
3
3
|
import { lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
4
4
|
import { basename, dirname, join, posix, resolve } from "node:path";
|