halfcode-compiler.xnl 0.3.0 → 0.3.1
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.d.ts +2 -1
- package/dist/application-assembly.js +2 -2
- package/dist/authoring-runtime.d.ts +20 -3
- package/dist/authoring-runtime.js +2 -2
- package/dist/code-execution-closure-CXORuheJ.d.ts +59 -0
- package/dist/{effective-content-identities-drMRhYE2.d.ts → effective-content-identities-Cf0ygCXk.d.ts} +1 -1
- package/dist/{index-CR7wJSSX.d.ts → index-B9Pp3Zgj.d.ts} +1 -1
- package/dist/{index-DboIOEr8.d.ts → index-By8x4reS.d.ts} +2 -33
- package/dist/{index-DI3WtuXq.d.ts → index-Csi_AIoU.d.ts} +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +3 -3
- package/dist/kind-definition.d.ts +1 -1
- package/dist/{resource-core-Brj8naBr.d.ts → resource-core-CoTu6FNS.d.ts} +2 -1
- package/dist/resource-core.d.ts +4 -3
- package/dist/resource-package-read-port-BLBb4cz5.d.ts +33 -0
- package/dist/resource-projection.d.ts +1 -1
- package/dist/skill-capsule.d.ts +1 -1
- package/dist/skill-capsule.js +1 -1
- package/dist/{src-B0Hja_dk.js → src-BX7wrSq1.js} +326 -2
- package/dist/{src-hrUy4DJ9.js → src-MPJZB76z.js} +51 -1
- package/dist/{src-DLJUCH0M.js → src-QI7NRyC8.js} +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { a as CodeExecutionEnvironment, c as FrozenCodeDependency, d as validateCodeClosure, i as CodeClosureError, l as FrozenCodeModule, n as CaptureCodeClosureInput, o as FrozenCodeAsset, r as CodeClosureCaptureRuntime, s as FrozenCodeClosure, t as CODE_CLOSURE_COMPILER_IDENTITY, u as captureCodeClosure } from "./code-execution-closure-CXORuheJ.js";
|
|
1
2
|
import { A as ObjectTargets, B as applicationAssemblyPackage, C as ObjectOperationDefinition, D as ObjectOperationTargetDeclaration, E as ObjectOperationOwnerKind, F as ResourceSource, G as loadApplicationAssembly, H as assertObjectOperationCall, I as SkillCapsuleDependency, K as resolveApplicationAssembly, L as SkillCapsuleResource, M as ResolveApplicationAssemblyOptions, N as ResolvedAssemblyPortBinding, O as ObjectTargetKindDefinition, P as ResourceInclude, R as TextMaterial, S as ObjectOperationContractError, T as ObjectOperationHandler, U as assertObjectOperationCatalog, V as assertExecuteObjectOperationRequest, W as assertObjectOperationDefinition, _ as ObjectInvocationMode, a as AssemblyResource, b as ObjectOperationCatalog, c as BusinessObjectSopResource, d as ExecuteObjectOperationRequest, f as JsonObject, g as ObjectInvocation, h as LoadApplicationAssemblyOptions, i as AssemblyPortBinding, j as PageObjectResource, k as ObjectTargetRef, l as CodeBinding, m as JsonValue, n as ApplicationScope, o as AuthoringModuleDescriptor, p as JsonPrimitive, q as resourceRefToFqn, r as AssemblyPort, s as BusinessObjectResource, t as ApplicationAssembly, u as ContractedCallableResource, v as ObjectOperationBehavior, w as ObjectOperationEffect, x as ObjectOperationConfig, y as ObjectOperationCall, z as TextResource } from "./index-DEikbOFh.js";
|
|
2
|
-
export { type ApplicationAssembly, type ApplicationScope, type AssemblyPort, type AssemblyPortBinding, type AssemblyResource, type AuthoringModuleDescriptor, type BusinessObjectResource, type BusinessObjectSopResource, type CodeBinding, type ContractedCallableResource, type ExecuteObjectOperationRequest, type JsonObject, type JsonPrimitive, type JsonValue, type LoadApplicationAssemblyOptions, type ObjectInvocation, type ObjectInvocationMode, type ObjectOperationBehavior, type ObjectOperationCall, type ObjectOperationCatalog, type ObjectOperationConfig, ObjectOperationContractError, type ObjectOperationDefinition, type ObjectOperationEffect, type ObjectOperationHandler, type ObjectOperationOwnerKind, type ObjectOperationTargetDeclaration, type ObjectTargetKindDefinition, type ObjectTargetRef, type ObjectTargets, type PageObjectResource, type ResolveApplicationAssemblyOptions, type ResolvedAssemblyPortBinding, type ResourceInclude, type ResourceSource, type SkillCapsuleDependency, type SkillCapsuleResource, type TextMaterial, type TextResource, applicationAssemblyPackage, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, loadApplicationAssembly, resolveApplicationAssembly, resourceRefToFqn };
|
|
3
|
+
export { type ApplicationAssembly, type ApplicationScope, type AssemblyPort, type AssemblyPortBinding, type AssemblyResource, type AuthoringModuleDescriptor, type BusinessObjectResource, type BusinessObjectSopResource, CODE_CLOSURE_COMPILER_IDENTITY, type CaptureCodeClosureInput, type CodeBinding, type CodeClosureCaptureRuntime, CodeClosureError, type CodeExecutionEnvironment, type ContractedCallableResource, type ExecuteObjectOperationRequest, type FrozenCodeAsset, type FrozenCodeClosure, type FrozenCodeDependency, type FrozenCodeModule, type JsonObject, type JsonPrimitive, type JsonValue, type LoadApplicationAssemblyOptions, type ObjectInvocation, type ObjectInvocationMode, type ObjectOperationBehavior, type ObjectOperationCall, type ObjectOperationCatalog, type ObjectOperationConfig, ObjectOperationContractError, type ObjectOperationDefinition, type ObjectOperationEffect, type ObjectOperationHandler, type ObjectOperationOwnerKind, type ObjectOperationTargetDeclaration, type ObjectTargetKindDefinition, type ObjectTargetRef, type ObjectTargets, type PageObjectResource, type ResolveApplicationAssemblyOptions, type ResolvedAssemblyPortBinding, type ResourceInclude, type ResourceSource, type SkillCapsuleDependency, type SkillCapsuleResource, type TextMaterial, type TextResource, applicationAssemblyPackage, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, captureCodeClosure, loadApplicationAssembly, resolveApplicationAssembly, resourceRefToFqn, validateCodeClosure };
|
|
@@ -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-
|
|
2
|
-
export { ObjectOperationContractError, applicationAssemblyPackage, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, loadApplicationAssembly, resolveApplicationAssembly, resourceRefToFqn };
|
|
1
|
+
import { a as assertObjectOperationCatalog, c as resolveApplicationAssembly, d as CodeClosureError, f as captureCodeClosure, i as assertObjectOperationCall, l as resourceRefToFqn, n as applicationAssemblyPackage, o as assertObjectOperationDefinition, p as validateCodeClosure, r as assertExecuteObjectOperationRequest, s as loadApplicationAssembly, t as ObjectOperationContractError, u as CODE_CLOSURE_COMPILER_IDENTITY } from "./src-BX7wrSq1.js";
|
|
2
|
+
export { CODE_CLOSURE_COMPILER_IDENTITY, CodeClosureError, ObjectOperationContractError, applicationAssemblyPackage, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, captureCodeClosure, loadApplicationAssembly, resolveApplicationAssembly, resourceRefToFqn, validateCodeClosure };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { $ as RESOURCE_ENVELOPE_VERSION,
|
|
2
|
-
import { n as ResourceLayerContentIdentityInput } from "./effective-content-identities-
|
|
1
|
+
import { $ as RESOURCE_ENVELOPE_VERSION, gt as EffectiveResourceRegistry, i as AuthoredResourceTree, o as KindSpecRevisionDescriptor, tt as SpecVersion } from "./index-By8x4reS.js";
|
|
2
|
+
import { n as ResourceLayerContentIdentityInput } from "./effective-content-identities-Cf0ygCXk.js";
|
|
3
|
+
import { a as CodeExecutionEnvironment, s as FrozenCodeClosure } from "./code-execution-closure-CXORuheJ.js";
|
|
4
|
+
import { l as CodeBinding } from "./index-DEikbOFh.js";
|
|
3
5
|
import { a as createAuthoringBindings, c as logger, i as RuntimeEffects, l as runWithRuntime, n as AuthoringRuntime, o as currentRuntime, r as Logger, s as invokeEffect, t as AuthoringBindings, u as runtimeAuthoringPackage } from "./index-Dg0imcjf.js";
|
|
4
6
|
//#region ../runtime-authoring/src/resource-authoring.d.ts
|
|
5
7
|
declare const RESOURCE_AUTHORING_SCHEMA_VERSION: "halfcode.resource-authoring/v1";
|
|
@@ -165,4 +167,19 @@ declare function deriveResourceAuthoringRegistryRevision(input: ResourceAuthorin
|
|
|
165
167
|
declare function planResourceAuthoring(runtime: ResourceAuthoringPlanningRuntime, input: ResourceAuthoringProposal, _config: ResourceAuthoringPlanningConfig): ResourceAuthoringPlan;
|
|
166
168
|
declare function applyResourceAuthoring(runtime: ResourceAuthoringRuntime, input: ResourceAuthoringPlan, config: ApplyResourceAuthoringConfig): Promise<ResourceAuthoringReceipt>;
|
|
167
169
|
//#endregion
|
|
168
|
-
|
|
170
|
+
//#region ../runtime-authoring/src/code-execution.d.ts
|
|
171
|
+
interface CodeClosureExecutionRuntime {
|
|
172
|
+
readonly environment: CodeExecutionEnvironment;
|
|
173
|
+
/** Explicit host exports for the exact identities declared in environment. */
|
|
174
|
+
readonly ambientModules?: Readonly<Record<string, unknown>>;
|
|
175
|
+
}
|
|
176
|
+
interface RestoredCodeClosure {
|
|
177
|
+
readonly binding: CodeBinding;
|
|
178
|
+
readonly closureDigest: string;
|
|
179
|
+
readonly exports: Readonly<Record<string, unknown>>;
|
|
180
|
+
}
|
|
181
|
+
/** Each restore owns a fresh module table; this is not an untrusted-code sandbox. */
|
|
182
|
+
declare function restoreCodeClosure(runtime: CodeClosureExecutionRuntime, input: FrozenCodeClosure, expectedDigest: string): RestoredCodeClosure;
|
|
183
|
+
declare function bindCodeClosure(runtime: CodeClosureExecutionRuntime, closure: FrozenCodeClosure, expectedDigest: string): (...args: unknown[]) => unknown;
|
|
184
|
+
//#endregion
|
|
185
|
+
export { ApplyResourceAuthoringConfig, AuthoringBindings, AuthoringRuntime, CodeClosureExecutionRuntime, Logger, RESOURCE_AUTHORING_SCHEMA_VERSION, ResourceAuthoringAuthorityInspection, ResourceAuthoringAuthorityInspector, ResourceAuthoringCatalogBinding, ResourceAuthoringDocumentUri, ResourceAuthoringEffectiveOriginReceipt, ResourceAuthoringError, ResourceAuthoringErrorCode, ResourceAuthoringExpectedAbsent, ResourceAuthoringExpectedPresent, ResourceAuthoringExpectedState, ResourceAuthoringInspectedRoot, ResourceAuthoringKindDefinition, ResourceAuthoringOperation, ResourceAuthoringPlan, ResourceAuthoringPlanningAuthority, ResourceAuthoringPlanningConfig, ResourceAuthoringPlanningRuntime, ResourceAuthoringPreparedWrite, ResourceAuthoringProposal, ResourceAuthoringReceipt, ResourceAuthoringRefreshCandidate, ResourceAuthoringRegistryRevisionInput, ResourceAuthoringRuntime, ResourceAuthoringSourceShape, ResourceAuthoringTransactionPort, RestoredCodeClosure, RuntimeEffects, applyResourceAuthoring, bindCodeClosure, createAuthoringBindings, currentRuntime, deriveResourceAuthoringRegistryRevision, invokeEffect, logger, planResourceAuthoring, restoreCodeClosure, runWithRuntime, runtimeAuthoringPackage };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as runWithRuntime, c as
|
|
2
|
-
export { RESOURCE_AUTHORING_SCHEMA_VERSION, ResourceAuthoringError, applyResourceAuthoring, createAuthoringBindings, currentRuntime, deriveResourceAuthoringRegistryRevision, invokeEffect, logger, planResourceAuthoring, runWithRuntime, runtimeAuthoringPackage };
|
|
1
|
+
import { a as runWithRuntime, c as restoreCodeClosure, d as applyResourceAuthoring, f as deriveResourceAuthoringRegistryRevision, i as logger, l as RESOURCE_AUTHORING_SCHEMA_VERSION, n as currentRuntime, o as runtimeAuthoringPackage, p as planResourceAuthoring, r as invokeEffect, s as bindCodeClosure, t as createAuthoringBindings, u as ResourceAuthoringError } from "./src-MPJZB76z.js";
|
|
2
|
+
export { RESOURCE_AUTHORING_SCHEMA_VERSION, ResourceAuthoringError, applyResourceAuthoring, bindCodeClosure, createAuthoringBindings, currentRuntime, deriveResourceAuthoringRegistryRevision, invokeEffect, logger, planResourceAuthoring, restoreCodeClosure, runWithRuntime, runtimeAuthoringPackage };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { a as ResourcePackageReadPort } from "./resource-package-read-port-BLBb4cz5.js";
|
|
2
|
+
import { l as CodeBinding } from "./index-DEikbOFh.js";
|
|
3
|
+
//#region ../application-assembly/src/code-execution-closure.d.ts
|
|
4
|
+
/** The complete emit profile is versioned; changing it invalidates old closures. */
|
|
5
|
+
declare const CODE_CLOSURE_COMPILER_IDENTITY = "typescript@5.9.3/commonjs-es2022-interop/closure-v2";
|
|
6
|
+
interface CodeExecutionEnvironment {
|
|
7
|
+
readonly hostIdentity: string;
|
|
8
|
+
readonly ambient: Readonly<Record<string, string>>;
|
|
9
|
+
}
|
|
10
|
+
interface CodeClosureCaptureRuntime {
|
|
11
|
+
readonly source: ResourcePackageReadPort;
|
|
12
|
+
}
|
|
13
|
+
interface CaptureCodeClosureInput {
|
|
14
|
+
readonly binding: CodeBinding;
|
|
15
|
+
readonly sourceRoot: string;
|
|
16
|
+
readonly entryPath: string;
|
|
17
|
+
/** Paths relative to sourceRoot; imports of non-code files require a declaration. */
|
|
18
|
+
readonly assets?: Readonly<Record<string, "text" | "json">>;
|
|
19
|
+
readonly environment: CodeExecutionEnvironment;
|
|
20
|
+
}
|
|
21
|
+
interface FrozenCodeDependency {
|
|
22
|
+
readonly specifier: string;
|
|
23
|
+
readonly kind: "module" | "asset" | "ambient";
|
|
24
|
+
readonly target: string;
|
|
25
|
+
}
|
|
26
|
+
interface FrozenCodeModule {
|
|
27
|
+
readonly path: string;
|
|
28
|
+
readonly source: string;
|
|
29
|
+
readonly sourceDigest: string;
|
|
30
|
+
readonly code: string;
|
|
31
|
+
readonly codeDigest: string;
|
|
32
|
+
readonly dependencies: readonly FrozenCodeDependency[];
|
|
33
|
+
}
|
|
34
|
+
interface FrozenCodeAsset {
|
|
35
|
+
readonly path: string;
|
|
36
|
+
readonly format: "text" | "json";
|
|
37
|
+
readonly content: string;
|
|
38
|
+
readonly contentDigest: string;
|
|
39
|
+
}
|
|
40
|
+
/** Immutable recovery material. Its digest must be pinned by the admitting owner. */
|
|
41
|
+
interface FrozenCodeClosure {
|
|
42
|
+
readonly format: "halfcode-code-closure/v1";
|
|
43
|
+
readonly compilerIdentity: string;
|
|
44
|
+
readonly binding: CodeBinding;
|
|
45
|
+
readonly entryPath: string;
|
|
46
|
+
readonly environment: CodeExecutionEnvironment;
|
|
47
|
+
readonly modules: readonly FrozenCodeModule[];
|
|
48
|
+
readonly assets: readonly FrozenCodeAsset[];
|
|
49
|
+
readonly digest: string;
|
|
50
|
+
}
|
|
51
|
+
declare class CodeClosureError extends Error {
|
|
52
|
+
readonly code: string;
|
|
53
|
+
constructor(code: string, message: string);
|
|
54
|
+
}
|
|
55
|
+
declare function captureCodeClosure(runtime: CodeClosureCaptureRuntime, input: CaptureCodeClosureInput): Promise<FrozenCodeClosure>;
|
|
56
|
+
/** Pure validation: no source reader, live imports, or module execution. */
|
|
57
|
+
declare function validateCodeClosure(closure: FrozenCodeClosure, environment: CodeExecutionEnvironment, expectedDigest: string): void;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { CodeExecutionEnvironment as a, FrozenCodeDependency as c, validateCodeClosure as d, CodeClosureError as i, FrozenCodeModule as l, CaptureCodeClosureInput as n, FrozenCodeAsset as o, CodeClosureCaptureRuntime as r, FrozenCodeClosure as s, CODE_CLOSURE_COMPILER_IDENTITY as t, captureCodeClosure as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as ResourceContentIdentity, ct as ResourceDigestContribution, gt as EffectiveResourceRegistry, i as AuthoredResourceTree } from "./index-By8x4reS.js";
|
|
2
2
|
//#region ../resource-core/src/effective-content-identities.d.ts
|
|
3
3
|
interface ResourceLayerContentIdentityInput {
|
|
4
4
|
readonly id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ApplicationAssembly } from "./index-DEikbOFh.js";
|
|
2
|
-
import { t as ResourceRegistry } from "./index-
|
|
2
|
+
import { t as ResourceRegistry } from "./index-Csi_AIoU.js";
|
|
3
3
|
//#region ../compiler-skill/src/index.d.ts
|
|
4
4
|
interface SkillDescriptor {
|
|
5
5
|
name: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { o as ResourcePackageReadPortOptions } from "./resource-package-read-port-BLBb4cz5.js";
|
|
1
2
|
//#region ../resource-core/src/canonical.d.ts
|
|
2
3
|
type Sha256Digest = `sha256:${string}`;
|
|
3
4
|
declare function compareCodeUnits(left: string, right: string): number;
|
|
@@ -106,38 +107,6 @@ declare function sha256Digest(value: string | Uint8Array): Sha256Digest;
|
|
|
106
107
|
declare function createResourceContentIdentity(input: CreateResourceContentIdentityInput): ResourceContentIdentity;
|
|
107
108
|
declare function buildResourceDependencySnapshot(input: BuildResourceDependencySnapshotInput): ResourceDependencySnapshot;
|
|
108
109
|
//#endregion
|
|
109
|
-
//#region ../resource-core/src/resource-package-read-port.d.ts
|
|
110
|
-
type ResourcePackageAwaitable<T> = T | PromiseLike<T>;
|
|
111
|
-
type ResourcePackageEntryKind = "file" | "directory" | "symlink" | "other";
|
|
112
|
-
interface ResourcePackageEntry {
|
|
113
|
-
readonly kind: ResourcePackageEntryKind;
|
|
114
|
-
}
|
|
115
|
-
interface ResourcePackageDirectoryEntry extends ResourcePackageEntry {
|
|
116
|
-
readonly name: string;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Storage-neutral source effect for one already-materialized ResourcePackage
|
|
120
|
-
* file view. Paths are canonical POSIX absolute coordinates scoped to the
|
|
121
|
-
* provider; they are never semantic resource provenance.
|
|
122
|
-
*/
|
|
123
|
-
interface ResourcePackageReadPort {
|
|
124
|
-
stat(sourcePath: string): ResourcePackageAwaitable<ResourcePackageEntry | undefined>;
|
|
125
|
-
readDirectory(sourcePath: string): ResourcePackageAwaitable<readonly ResourcePackageDirectoryEntry[] | undefined>;
|
|
126
|
-
readBytes(sourcePath: string): ResourcePackageAwaitable<Uint8Array | undefined>;
|
|
127
|
-
}
|
|
128
|
-
interface ResourcePackageReadPortOptions {
|
|
129
|
-
readonly port: ResourcePackageReadPort;
|
|
130
|
-
readonly rootPath?: string;
|
|
131
|
-
readonly manifestPath?: string;
|
|
132
|
-
}
|
|
133
|
-
declare class ResourcePackageSourcePathError extends TypeError {
|
|
134
|
-
constructor(message: string);
|
|
135
|
-
}
|
|
136
|
-
declare function canonicalResourcePackageSourcePath(input: string): string;
|
|
137
|
-
declare function joinResourcePackageSourcePath(base: string, ...segments: readonly string[]): string;
|
|
138
|
-
declare function dirnameResourcePackageSourcePath(sourcePath: string): string;
|
|
139
|
-
declare function relativeResourcePackageSourcePath(rootPath: string, sourcePath: string): string | undefined;
|
|
140
|
-
//#endregion
|
|
141
110
|
//#region ../resource-core/src/resource-version-contracts.d.ts
|
|
142
111
|
declare const RESOURCE_ENVELOPE_VERSION: "halfcode.resource-envelope/v1";
|
|
143
112
|
declare const CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS: Readonly<{
|
|
@@ -471,4 +440,4 @@ declare function validateResourceTree(options: LoadResourceTreeOptions): Promise
|
|
|
471
440
|
declare function loadResourceTreeFromReadPort(options: ResourcePackageReadPortOptions): Promise<AuthoredResourceTree>;
|
|
472
441
|
declare function validateResourceTreeFromReadPort(options: ResourcePackageReadPortOptions): Promise<ResourceDiagnostic[]>;
|
|
473
442
|
//#endregion
|
|
474
|
-
export { RESOURCE_ENVELOPE_VERSION as $, validateResourceTreeFromReadPort as A,
|
|
443
|
+
export { RESOURCE_ENVELOPE_VERSION as $, validateResourceTreeFromReadPort as A, KindSpecRevision as B, ResourceValue as C, Sha256Digest as Ct, loadResourceTree as D, SourceShape as E, digestCanonical as Et, KindContractLockReader as F, ReaderProfile as G, KindWriterRegistration as H, KindReaderRegistration as I, ResourceResolutionReceipt as J, ReaderTarget as K, KindSemanticContract as L, JsonSchema as M, JsonSchemaValidator as N, loadResourceTreeFromReadPort as O, KindContractLock as P, RESOURCE_ENVELOPE_FINGERPRINT as Q, KindSourceContract as R, ResourceValidationError as S, composeLayeredResourceRegistry as St, ResourceValueMap as T, compareCodeUnits as Tt, PortableSpec as U, KindSubjectOwner as V, PortableValue as W, CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS as X, SpecResolutionDefinition as Y, RESOURCE_ENVELOPE_CONTRACT as Z, ResourceRecord as _, ResourceLayerDescriptor as _t, AuthoredResourceTreeBuildResult as a, ResourceContentIdentity as at, ResourceTree as b, ResourceTombstone as bt, RegisteredKindDefinition as c, ResourceDigestContribution as ct, ResolvedResourceTree as d, createResourceContentIdentity as dt, ResourceMetadata as et, ResourceDescriptor as f, sha256Digest as ft, ResourceNode as g, EffectiveResourceRegistry as gt, ResourceKindContract as h, EffectiveResourceEntry as ht, AuthoredResourceTree as i, CreateResourceContentIdentityInput as it, CompatibilityPolicy as j, validateResourceTree as k, ResolvedResourceRecord as l, SnapshotResource as lt, ResourceIdentity as m, EffectiveKindDefinition as mt, AuthoredResourceRegistry as n, isSpecVersion as nt, KindSpecRevisionDescriptor as o, ResourceDependencyEdge as ot, ResourceDiagnostic as p, ComposeLayeredResourceRegistryInput as pt, ResolvedSpec as q, AuthoredResourceSpec as r, BuildResourceDependencySnapshotInput as rt, LoadResourceTreeOptions as s, ResourceDependencySnapshot as st, AuthoredResourceRecord as t, SpecVersion as tt, ResolvedResourceRegistry as u, buildResourceDependencySnapshot as ut, ResourceRegistry as v, ResourceLayerInput as vt, ResourceValueList as w, canonicalJson as wt, ResourceTreeBuildResult as x, ResourceTombstoneOrigin as xt, ResourceScalar as y, ResourceOrigin as yt, KindSourceShape as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ResourceDescriptor } from "./index-
|
|
1
|
+
import { f as ResourceDescriptor } from "./index-By8x4reS.js";
|
|
2
2
|
//#region ../resource-projection/src/index.d.ts
|
|
3
3
|
interface ResourceRegistry {
|
|
4
4
|
readonly byKind: ReadonlyMap<string, readonly ResourceDescriptor[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { $ as RESOURCE_ENVELOPE_VERSION, A as validateResourceTreeFromReadPort, B as KindSpecRevision, C as ResourceValue, Ct as Sha256Digest, D as loadResourceTree, E as SourceShape, Et as digestCanonical, F as KindContractLockReader, G as ReaderProfile, H as KindWriterRegistration, I as KindReaderRegistration, J as ResourceResolutionReceipt, K as ReaderTarget, L as KindSemanticContract, M as JsonSchema, N as JsonSchemaValidator, O as loadResourceTreeFromReadPort, P as KindContractLock, Q as RESOURCE_ENVELOPE_FINGERPRINT, R as KindSourceContract, S as ResourceValidationError, St as composeLayeredResourceRegistry, T as ResourceValueMap, Tt as compareCodeUnits, U as PortableSpec, V as KindSubjectOwner, W as PortableValue, X as CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS, Y as SpecResolutionDefinition, Z as RESOURCE_ENVELOPE_CONTRACT, _ as ResourceRecord, _t as ResourceLayerDescriptor, a as AuthoredResourceTreeBuildResult, at as ResourceContentIdentity, b as ResourceTree, bt as ResourceTombstone, c as RegisteredKindDefinition, ct as ResourceDigestContribution, d as ResolvedResourceTree, dt as createResourceContentIdentity, et as ResourceMetadata, f as ResourceDescriptor, ft as sha256Digest, g as ResourceNode, gt as EffectiveResourceRegistry, h as ResourceKindContract, ht as EffectiveResourceEntry, i as AuthoredResourceTree, it as CreateResourceContentIdentityInput, j as CompatibilityPolicy, k as validateResourceTree, l as ResolvedResourceRecord, lt as SnapshotResource, m as ResourceIdentity, mt as EffectiveKindDefinition, n as AuthoredResourceRegistry, nt as isSpecVersion, o as KindSpecRevisionDescriptor, ot as ResourceDependencyEdge, p as ResourceDiagnostic, pt as ComposeLayeredResourceRegistryInput, q as ResolvedSpec, r as AuthoredResourceSpec, rt as BuildResourceDependencySnapshotInput, s as LoadResourceTreeOptions, st as ResourceDependencySnapshot, t as AuthoredResourceRecord, tt as SpecVersion, u as ResolvedResourceRegistry, ut as buildResourceDependencySnapshot, v as ResourceRegistry, vt as ResourceLayerInput, w as ResourceValueList, wt as canonicalJson, x as ResourceTreeBuildResult, xt as ResourceTombstoneOrigin, y as ResourceScalar, yt as ResourceOrigin, z as KindSourceShape } from "./index-By8x4reS.js";
|
|
2
|
+
import { a as ResourcePackageReadPort, c as canonicalResourcePackageSourcePath, d as relativeResourcePackageSourcePath, i as ResourcePackageEntryKind, l as dirnameResourcePackageSourcePath, n as ResourcePackageDirectoryEntry, o as ResourcePackageReadPortOptions, r as ResourcePackageEntry, s as ResourcePackageSourcePathError, t as ResourcePackageAwaitable, u as joinResourcePackageSourcePath } from "./resource-package-read-port-BLBb4cz5.js";
|
|
3
|
+
import { a as ReadResourceMaterialInput, c as readResourceMaterial, i as createDirectoryResourcePackageReadPort, l as ResourceCompositionError, n as ResourceMetadataDecodeResult, o as ResourceMaterial, r as decodeResourceMetadata, s as ResourceMaterialError, t as ResourceMetadataDecodeInput } from "./resource-core-CoTu6FNS.js";
|
|
4
|
+
import { n as ResourceLayerContentIdentityInput, r as resolveEffectiveResourceContentIdentities, t as ResolveEffectiveResourceContentIdentitiesInput } from "./effective-content-identities-Cf0ygCXk.js";
|
|
5
|
+
import { a as CodeExecutionEnvironment, c as FrozenCodeDependency, d as validateCodeClosure, i as CodeClosureError, l as FrozenCodeModule, n as CaptureCodeClosureInput, o as FrozenCodeAsset, r as CodeClosureCaptureRuntime, s as FrozenCodeClosure, t as CODE_CLOSURE_COMPILER_IDENTITY, u as captureCodeClosure } from "./code-execution-closure-CXORuheJ.js";
|
|
1
6
|
import { A as ObjectTargets, B as applicationAssemblyPackage, C as ObjectOperationDefinition, D as ObjectOperationTargetDeclaration, E as ObjectOperationOwnerKind, F as ResourceSource, G as loadApplicationAssembly, H as assertObjectOperationCall, I as SkillCapsuleDependency, K as resolveApplicationAssembly, L as SkillCapsuleResource, M as ResolveApplicationAssemblyOptions, N as ResolvedAssemblyPortBinding, O as ObjectTargetKindDefinition, P as ResourceInclude, R as TextMaterial, S as ObjectOperationContractError, T as ObjectOperationHandler, U as assertObjectOperationCatalog, V as assertExecuteObjectOperationRequest, W as assertObjectOperationDefinition, _ as ObjectInvocationMode, a as AssemblyResource, b as ObjectOperationCatalog, c as BusinessObjectSopResource, d as ExecuteObjectOperationRequest, f as JsonObject, g as ObjectInvocation, h as LoadApplicationAssemblyOptions, i as AssemblyPortBinding, j as PageObjectResource, k as ObjectTargetRef, l as CodeBinding, m as JsonValue, n as ApplicationScope, o as AuthoringModuleDescriptor, p as JsonPrimitive, q as resourceRefToFqn, r as AssemblyPort, s as BusinessObjectResource, t as ApplicationAssembly, u as ContractedCallableResource, v as ObjectOperationBehavior, w as ObjectOperationEffect, x as ObjectOperationConfig, y as ObjectOperationCall, z as TextResource } from "./index-DEikbOFh.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as ReadResourceMaterialInput, c as readResourceMaterial, i as createDirectoryResourcePackageReadPort, l as ResourceCompositionError, n as ResourceMetadataDecodeResult, o as ResourceMaterial, r as decodeResourceMetadata, s as ResourceMaterialError, t as ResourceMetadataDecodeInput } from "./resource-core-Brj8naBr.js";
|
|
4
|
-
import { n as ResourceLayerContentIdentityInput, r as resolveEffectiveResourceContentIdentities, t as ResolveEffectiveResourceContentIdentitiesInput } from "./effective-content-identities-drMRhYE2.js";
|
|
5
|
-
import { S as skillCapsuleDistributionProjection, _ as applySkillCapsuleDistributionPlan, a as PlannedSkillCapsule, b as compilerSkillPackage, c as SkillCapsuleContentDigest, d as SkillCapsuleDistributionReceipt, f as SkillCapsuleIdentity, g as SkillReference, h as SkillDescriptor, i as PlanSkillCapsuleDistributionInput, l as SkillCapsuleDistributionError, m as SkillCapsuleProvenanceManifest, n as CompileResourceSkillCapsuleInput, o as PlannedSkillFile, p as SkillCapsulePlan, r as CompileSkillCapsuleInput, s as SkillCapsuleApplyStep, t as ApplySkillCapsuleDistributionOptions, u as SkillCapsuleDistributionPlan, v as compileResourceSkillCapsule, x as planSkillCapsuleDistribution, y as compileSkillCapsule } from "./index-CR7wJSSX.js";
|
|
7
|
+
import { S as skillCapsuleDistributionProjection, _ as applySkillCapsuleDistributionPlan, a as PlannedSkillCapsule, b as compilerSkillPackage, c as SkillCapsuleContentDigest, d as SkillCapsuleDistributionReceipt, f as SkillCapsuleIdentity, g as SkillReference, h as SkillDescriptor, i as PlanSkillCapsuleDistributionInput, l as SkillCapsuleDistributionError, m as SkillCapsuleProvenanceManifest, n as CompileResourceSkillCapsuleInput, o as PlannedSkillFile, p as SkillCapsulePlan, r as CompileSkillCapsuleInput, s as SkillCapsuleApplyStep, t as ApplySkillCapsuleDistributionOptions, u as SkillCapsuleDistributionPlan, v as compileResourceSkillCapsule, x as planSkillCapsuleDistribution, y as compileSkillCapsule } from "./index-B9Pp3Zgj.js";
|
|
6
8
|
import { CORE_KIND_READER_REGISTRATIONS, CORE_KIND_SPEC_REVISIONS, CORE_KIND_SUBJECT_OWNERS, CORE_RESOURCE_CONTRACT_REGISTRATIONS, KIND_DEFINITION_KIND_OWNER, KIND_DEFINITION_KIND_READER_REGISTRATION_V1, KIND_DEFINITION_KIND_SPEC_REVISION_V1, KIND_DEFINITION_SPEC_SCHEMA_V1, KindContractRegistry, KindDefinition, KindReaderRegistry, KindWriterRegistry, RESOURCE_PACKAGE_KIND_OWNER, RESOURCE_PACKAGE_KIND_READER_REGISTRATION_V1, RESOURCE_PACKAGE_KIND_SPEC_REVISION_V1, RESOURCE_PACKAGE_SPEC_SCHEMA_V1, ResolveResourceTreeInput, ResourceSourceMigrationDefinition, ResourceSourceMigrationRegistry, SpecResolutionRegistry, createKindContractLock, createKindSpecRevision, createKindSubjectOwner, createReaderProfile, exactSpecVersion, kindDefinitionPackage, resolveResourceTree, resolveSpec } from "./kind-definition.js";
|
|
7
9
|
//#region src/bundled-system-skills.d.ts
|
|
8
10
|
declare function loadHalfcodeResourceDslSystemSkillModule(): AuthoringModuleDescriptor;
|
|
9
11
|
declare function loadHalfcodeResourceDslSystemSkillPlan(): Promise<SkillCapsuleDistributionPlan>;
|
|
10
12
|
//#endregion
|
|
11
|
-
export { type ApplicationAssembly, type ApplicationScope, ApplySkillCapsuleDistributionOptions, type AssemblyPort, type AssemblyPortBinding, type AssemblyResource, AuthoredResourceRecord, AuthoredResourceRegistry, AuthoredResourceSpec, AuthoredResourceTree, AuthoredResourceTreeBuildResult, type AuthoringModuleDescriptor, BuildResourceDependencySnapshotInput, type BusinessObjectResource, type BusinessObjectSopResource, CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS, CORE_KIND_READER_REGISTRATIONS, CORE_KIND_SPEC_REVISIONS, CORE_KIND_SUBJECT_OWNERS, CORE_RESOURCE_CONTRACT_REGISTRATIONS, type CodeBinding, CompatibilityPolicy, CompileResourceSkillCapsuleInput, CompileSkillCapsuleInput, ComposeLayeredResourceRegistryInput, type ContractedCallableResource, CreateResourceContentIdentityInput, EffectiveKindDefinition, EffectiveResourceEntry, EffectiveResourceRegistry, type ExecuteObjectOperationRequest, type JsonObject, type JsonPrimitive, JsonSchema, JsonSchemaValidator, type JsonValue, KIND_DEFINITION_KIND_OWNER, KIND_DEFINITION_KIND_READER_REGISTRATION_V1, KIND_DEFINITION_KIND_SPEC_REVISION_V1, KIND_DEFINITION_SPEC_SCHEMA_V1, KindContractLock, KindContractLockReader, KindContractRegistry, KindDefinition, KindReaderRegistration, KindReaderRegistry, KindSemanticContract, KindSourceContract, KindSourceShape, KindSpecRevision, KindSpecRevisionDescriptor, KindSubjectOwner, KindWriterRegistration, KindWriterRegistry, type LoadApplicationAssemblyOptions, LoadResourceTreeOptions, type ObjectInvocation, type ObjectInvocationMode, type ObjectOperationBehavior, type ObjectOperationCall, type ObjectOperationCatalog, type ObjectOperationConfig, ObjectOperationContractError, type ObjectOperationDefinition, type ObjectOperationEffect, type ObjectOperationHandler, type ObjectOperationOwnerKind, type ObjectOperationTargetDeclaration, type ObjectTargetKindDefinition, type ObjectTargetRef, type ObjectTargets, type PageObjectResource, PlanSkillCapsuleDistributionInput, PlannedSkillCapsule, PlannedSkillFile, PortableSpec, PortableValue, RESOURCE_ENVELOPE_CONTRACT, RESOURCE_ENVELOPE_FINGERPRINT, RESOURCE_ENVELOPE_VERSION, RESOURCE_PACKAGE_KIND_OWNER, RESOURCE_PACKAGE_KIND_READER_REGISTRATION_V1, RESOURCE_PACKAGE_KIND_SPEC_REVISION_V1, RESOURCE_PACKAGE_SPEC_SCHEMA_V1, ReadResourceMaterialInput, ReaderProfile, ReaderTarget, RegisteredKindDefinition, type ResolveApplicationAssemblyOptions, ResolveEffectiveResourceContentIdentitiesInput, ResolveResourceTreeInput, type ResolvedAssemblyPortBinding, ResolvedResourceRecord, ResolvedResourceRegistry, ResolvedResourceTree, ResolvedSpec, ResourceCompositionError, ResourceContentIdentity, ResourceDependencyEdge, ResourceDependencySnapshot, ResourceDescriptor, ResourceDiagnostic, ResourceDigestContribution, ResourceIdentity, type ResourceInclude, ResourceKindContract, ResourceLayerContentIdentityInput, ResourceLayerDescriptor, ResourceLayerInput, ResourceMaterial, ResourceMaterialError, ResourceMetadata, ResourceMetadataDecodeInput, ResourceMetadataDecodeResult, ResourceNode, ResourceOrigin, ResourcePackageAwaitable, ResourcePackageDirectoryEntry, ResourcePackageEntry, ResourcePackageEntryKind, ResourcePackageReadPort, ResourcePackageReadPortOptions, ResourcePackageSourcePathError, ResourceRecord, ResourceRegistry, ResourceResolutionReceipt, ResourceScalar, type ResourceSource, ResourceSourceMigrationDefinition, ResourceSourceMigrationRegistry, ResourceTombstone, ResourceTombstoneOrigin, ResourceTree, ResourceTreeBuildResult, ResourceValidationError, ResourceValue, ResourceValueList, ResourceValueMap, type Sha256Digest, SkillCapsuleApplyStep, SkillCapsuleContentDigest, type SkillCapsuleDependency, SkillCapsuleDistributionError, SkillCapsuleDistributionPlan, SkillCapsuleDistributionReceipt, SkillCapsuleIdentity, SkillCapsulePlan, SkillCapsuleProvenanceManifest, type SkillCapsuleResource, SkillDescriptor, SkillReference, SnapshotResource, SourceShape, SpecResolutionDefinition, SpecResolutionRegistry, SpecVersion, type TextMaterial, type TextResource, applicationAssemblyPackage, applySkillCapsuleDistributionPlan, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, buildResourceDependencySnapshot, canonicalJson, canonicalResourcePackageSourcePath, compareCodeUnits, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, composeLayeredResourceRegistry, createDirectoryResourcePackageReadPort, createKindContractLock, createKindSpecRevision, createKindSubjectOwner, createReaderProfile, createResourceContentIdentity, decodeResourceMetadata, digestCanonical, dirnameResourcePackageSourcePath, exactSpecVersion, isSpecVersion, joinResourcePackageSourcePath, kindDefinitionPackage, loadApplicationAssembly, loadHalfcodeResourceDslSystemSkillModule, loadHalfcodeResourceDslSystemSkillPlan, loadResourceTree, loadResourceTreeFromReadPort, planSkillCapsuleDistribution, readResourceMaterial, relativeResourcePackageSourcePath, resolveApplicationAssembly, resolveEffectiveResourceContentIdentities, resolveResourceTree, resolveSpec, resourceRefToFqn, sha256Digest, skillCapsuleDistributionProjection, validateResourceTree, validateResourceTreeFromReadPort };
|
|
13
|
+
export { type ApplicationAssembly, type ApplicationScope, ApplySkillCapsuleDistributionOptions, type AssemblyPort, type AssemblyPortBinding, type AssemblyResource, AuthoredResourceRecord, AuthoredResourceRegistry, AuthoredResourceSpec, AuthoredResourceTree, AuthoredResourceTreeBuildResult, type AuthoringModuleDescriptor, BuildResourceDependencySnapshotInput, type BusinessObjectResource, type BusinessObjectSopResource, CODE_CLOSURE_COMPILER_IDENTITY, CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS, CORE_KIND_READER_REGISTRATIONS, CORE_KIND_SPEC_REVISIONS, CORE_KIND_SUBJECT_OWNERS, CORE_RESOURCE_CONTRACT_REGISTRATIONS, type CaptureCodeClosureInput, type CodeBinding, type CodeClosureCaptureRuntime, CodeClosureError, type CodeExecutionEnvironment, CompatibilityPolicy, CompileResourceSkillCapsuleInput, CompileSkillCapsuleInput, ComposeLayeredResourceRegistryInput, type ContractedCallableResource, CreateResourceContentIdentityInput, EffectiveKindDefinition, EffectiveResourceEntry, EffectiveResourceRegistry, type ExecuteObjectOperationRequest, type FrozenCodeAsset, type FrozenCodeClosure, type FrozenCodeDependency, type FrozenCodeModule, type JsonObject, type JsonPrimitive, JsonSchema, JsonSchemaValidator, type JsonValue, KIND_DEFINITION_KIND_OWNER, KIND_DEFINITION_KIND_READER_REGISTRATION_V1, KIND_DEFINITION_KIND_SPEC_REVISION_V1, KIND_DEFINITION_SPEC_SCHEMA_V1, KindContractLock, KindContractLockReader, KindContractRegistry, KindDefinition, KindReaderRegistration, KindReaderRegistry, KindSemanticContract, KindSourceContract, KindSourceShape, KindSpecRevision, KindSpecRevisionDescriptor, KindSubjectOwner, KindWriterRegistration, KindWriterRegistry, type LoadApplicationAssemblyOptions, LoadResourceTreeOptions, type ObjectInvocation, type ObjectInvocationMode, type ObjectOperationBehavior, type ObjectOperationCall, type ObjectOperationCatalog, type ObjectOperationConfig, ObjectOperationContractError, type ObjectOperationDefinition, type ObjectOperationEffect, type ObjectOperationHandler, type ObjectOperationOwnerKind, type ObjectOperationTargetDeclaration, type ObjectTargetKindDefinition, type ObjectTargetRef, type ObjectTargets, type PageObjectResource, PlanSkillCapsuleDistributionInput, PlannedSkillCapsule, PlannedSkillFile, PortableSpec, PortableValue, RESOURCE_ENVELOPE_CONTRACT, RESOURCE_ENVELOPE_FINGERPRINT, RESOURCE_ENVELOPE_VERSION, RESOURCE_PACKAGE_KIND_OWNER, RESOURCE_PACKAGE_KIND_READER_REGISTRATION_V1, RESOURCE_PACKAGE_KIND_SPEC_REVISION_V1, RESOURCE_PACKAGE_SPEC_SCHEMA_V1, ReadResourceMaterialInput, ReaderProfile, ReaderTarget, RegisteredKindDefinition, type ResolveApplicationAssemblyOptions, ResolveEffectiveResourceContentIdentitiesInput, ResolveResourceTreeInput, type ResolvedAssemblyPortBinding, ResolvedResourceRecord, ResolvedResourceRegistry, ResolvedResourceTree, ResolvedSpec, ResourceCompositionError, ResourceContentIdentity, ResourceDependencyEdge, ResourceDependencySnapshot, ResourceDescriptor, ResourceDiagnostic, ResourceDigestContribution, ResourceIdentity, type ResourceInclude, ResourceKindContract, ResourceLayerContentIdentityInput, ResourceLayerDescriptor, ResourceLayerInput, ResourceMaterial, ResourceMaterialError, ResourceMetadata, ResourceMetadataDecodeInput, ResourceMetadataDecodeResult, ResourceNode, ResourceOrigin, ResourcePackageAwaitable, ResourcePackageDirectoryEntry, ResourcePackageEntry, ResourcePackageEntryKind, ResourcePackageReadPort, ResourcePackageReadPortOptions, ResourcePackageSourcePathError, ResourceRecord, ResourceRegistry, ResourceResolutionReceipt, ResourceScalar, type ResourceSource, ResourceSourceMigrationDefinition, ResourceSourceMigrationRegistry, ResourceTombstone, ResourceTombstoneOrigin, ResourceTree, ResourceTreeBuildResult, ResourceValidationError, ResourceValue, ResourceValueList, ResourceValueMap, type Sha256Digest, SkillCapsuleApplyStep, SkillCapsuleContentDigest, type SkillCapsuleDependency, SkillCapsuleDistributionError, SkillCapsuleDistributionPlan, SkillCapsuleDistributionReceipt, SkillCapsuleIdentity, SkillCapsulePlan, SkillCapsuleProvenanceManifest, type SkillCapsuleResource, SkillDescriptor, SkillReference, SnapshotResource, SourceShape, SpecResolutionDefinition, SpecResolutionRegistry, SpecVersion, type TextMaterial, type TextResource, applicationAssemblyPackage, applySkillCapsuleDistributionPlan, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, buildResourceDependencySnapshot, canonicalJson, canonicalResourcePackageSourcePath, captureCodeClosure, compareCodeUnits, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, composeLayeredResourceRegistry, createDirectoryResourcePackageReadPort, createKindContractLock, createKindSpecRevision, createKindSubjectOwner, createReaderProfile, createResourceContentIdentity, decodeResourceMetadata, digestCanonical, dirnameResourcePackageSourcePath, exactSpecVersion, isSpecVersion, joinResourcePackageSourcePath, kindDefinitionPackage, loadApplicationAssembly, loadHalfcodeResourceDslSystemSkillModule, loadHalfcodeResourceDslSystemSkillPlan, loadResourceTree, loadResourceTreeFromReadPort, planSkillCapsuleDistribution, readResourceMaterial, relativeResourcePackageSourcePath, resolveApplicationAssembly, resolveEffectiveResourceContentIdentities, resolveResourceTree, resolveSpec, resourceRefToFqn, sha256Digest, skillCapsuleDistributionProjection, validateCodeClosure, validateResourceTree, validateResourceTreeFromReadPort };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { C as digestCanonical, D as dirnameResourcePackageSourcePath, E as canonicalResourcePackageSourcePath, O as joinResourcePackageSourcePath, S as compareCodeUnits, T as ResourcePackageSourcePathError, a as validateResourceTreeFromReadPort, b as ResourceCompositionError, c as RESOURCE_ENVELOPE_CONTRACT, d as isSpecVersion, g as sha256Digest, h as createResourceContentIdentity, i as validateResourceTree, k as relativeResourcePackageSourcePath, l as RESOURCE_ENVELOPE_FINGERPRINT, m as buildResourceDependencySnapshot, n as loadResourceTree, o as decodeResourceMetadata, r as loadResourceTreeFromReadPort, s as CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS, t as ResourceValidationError, u as RESOURCE_ENVELOPE_VERSION, w as createDirectoryResourcePackageReadPort, x as canonicalJson } from "./src-jggOQtq3.js";
|
|
2
2
|
import { t as resolveEffectiveResourceContentIdentities } from "./effective-content-identities-CV6XFBZy.js";
|
|
3
|
-
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-
|
|
3
|
+
import { a as assertObjectOperationCatalog, c as resolveApplicationAssembly, d as CodeClosureError, f as captureCodeClosure, i as assertObjectOperationCall, l as resourceRefToFqn, n as applicationAssemblyPackage, o as assertObjectOperationDefinition, p as validateCodeClosure, r as assertExecuteObjectOperationRequest, s as loadApplicationAssembly, t as ObjectOperationContractError, u as CODE_CLOSURE_COMPILER_IDENTITY } from "./src-BX7wrSq1.js";
|
|
4
4
|
import "./application-assembly.js";
|
|
5
5
|
import { ResourceMaterialError, composeLayeredResourceRegistry, readResourceMaterial } from "./resource-core.js";
|
|
6
6
|
import { CORE_KIND_READER_REGISTRATIONS, CORE_KIND_SPEC_REVISIONS, CORE_KIND_SUBJECT_OWNERS, CORE_RESOURCE_CONTRACT_REGISTRATIONS, KIND_DEFINITION_KIND_OWNER, KIND_DEFINITION_KIND_READER_REGISTRATION_V1, KIND_DEFINITION_KIND_SPEC_REVISION_V1, KIND_DEFINITION_SPEC_SCHEMA_V1, KindContractRegistry, KindReaderRegistry, KindWriterRegistry, RESOURCE_PACKAGE_KIND_OWNER, RESOURCE_PACKAGE_KIND_READER_REGISTRATION_V1, RESOURCE_PACKAGE_KIND_SPEC_REVISION_V1, RESOURCE_PACKAGE_SPEC_SCHEMA_V1, ResourceSourceMigrationRegistry, SpecResolutionRegistry, createKindContractLock, createKindSpecRevision, createKindSubjectOwner, createReaderProfile, exactSpecVersion, kindDefinitionPackage, resolveResourceTree, resolveSpec } from "./kind-definition.js";
|
|
7
|
-
import { a as compilerSkillPackage, i as compileSkillCapsule, n as applySkillCapsuleDistributionPlan, o as planSkillCapsuleDistribution, r as compileResourceSkillCapsule, s as skillCapsuleDistributionProjection, t as SkillCapsuleDistributionError } from "./src-
|
|
7
|
+
import { a as compilerSkillPackage, i as compileSkillCapsule, n as applySkillCapsuleDistributionPlan, o as planSkillCapsuleDistribution, r as compileResourceSkillCapsule, s as skillCapsuleDistributionProjection, t as SkillCapsuleDistributionError } from "./src-QI7NRyC8.js";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
//#region src/bundled-system-skills.ts
|
|
10
10
|
function loadHalfcodeResourceDslSystemSkillModule() {
|
|
@@ -22,4 +22,4 @@ async function loadHalfcodeResourceDslSystemSkillPlan() {
|
|
|
22
22
|
return bundled.default;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
-
export { CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS, CORE_KIND_READER_REGISTRATIONS, CORE_KIND_SPEC_REVISIONS, CORE_KIND_SUBJECT_OWNERS, CORE_RESOURCE_CONTRACT_REGISTRATIONS, KIND_DEFINITION_KIND_OWNER, KIND_DEFINITION_KIND_READER_REGISTRATION_V1, KIND_DEFINITION_KIND_SPEC_REVISION_V1, KIND_DEFINITION_SPEC_SCHEMA_V1, KindContractRegistry, KindReaderRegistry, KindWriterRegistry, ObjectOperationContractError, RESOURCE_ENVELOPE_CONTRACT, RESOURCE_ENVELOPE_FINGERPRINT, RESOURCE_ENVELOPE_VERSION, RESOURCE_PACKAGE_KIND_OWNER, RESOURCE_PACKAGE_KIND_READER_REGISTRATION_V1, RESOURCE_PACKAGE_KIND_SPEC_REVISION_V1, RESOURCE_PACKAGE_SPEC_SCHEMA_V1, ResourceCompositionError, ResourceMaterialError, ResourcePackageSourcePathError, ResourceSourceMigrationRegistry, ResourceValidationError, SkillCapsuleDistributionError, SpecResolutionRegistry, applicationAssemblyPackage, applySkillCapsuleDistributionPlan, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, buildResourceDependencySnapshot, canonicalJson, canonicalResourcePackageSourcePath, compareCodeUnits, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, composeLayeredResourceRegistry, createDirectoryResourcePackageReadPort, createKindContractLock, createKindSpecRevision, createKindSubjectOwner, createReaderProfile, createResourceContentIdentity, decodeResourceMetadata, digestCanonical, dirnameResourcePackageSourcePath, exactSpecVersion, isSpecVersion, joinResourcePackageSourcePath, kindDefinitionPackage, loadApplicationAssembly, loadHalfcodeResourceDslSystemSkillModule, loadHalfcodeResourceDslSystemSkillPlan, loadResourceTree, loadResourceTreeFromReadPort, planSkillCapsuleDistribution, readResourceMaterial, relativeResourcePackageSourcePath, resolveApplicationAssembly, resolveEffectiveResourceContentIdentities, resolveResourceTree, resolveSpec, resourceRefToFqn, sha256Digest, skillCapsuleDistributionProjection, validateResourceTree, validateResourceTreeFromReadPort };
|
|
25
|
+
export { CODE_CLOSURE_COMPILER_IDENTITY, CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS, CORE_KIND_READER_REGISTRATIONS, CORE_KIND_SPEC_REVISIONS, CORE_KIND_SUBJECT_OWNERS, CORE_RESOURCE_CONTRACT_REGISTRATIONS, CodeClosureError, KIND_DEFINITION_KIND_OWNER, KIND_DEFINITION_KIND_READER_REGISTRATION_V1, KIND_DEFINITION_KIND_SPEC_REVISION_V1, KIND_DEFINITION_SPEC_SCHEMA_V1, KindContractRegistry, KindReaderRegistry, KindWriterRegistry, ObjectOperationContractError, RESOURCE_ENVELOPE_CONTRACT, RESOURCE_ENVELOPE_FINGERPRINT, RESOURCE_ENVELOPE_VERSION, RESOURCE_PACKAGE_KIND_OWNER, RESOURCE_PACKAGE_KIND_READER_REGISTRATION_V1, RESOURCE_PACKAGE_KIND_SPEC_REVISION_V1, RESOURCE_PACKAGE_SPEC_SCHEMA_V1, ResourceCompositionError, ResourceMaterialError, ResourcePackageSourcePathError, ResourceSourceMigrationRegistry, ResourceValidationError, SkillCapsuleDistributionError, SpecResolutionRegistry, applicationAssemblyPackage, applySkillCapsuleDistributionPlan, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, buildResourceDependencySnapshot, canonicalJson, canonicalResourcePackageSourcePath, captureCodeClosure, compareCodeUnits, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, composeLayeredResourceRegistry, createDirectoryResourcePackageReadPort, createKindContractLock, createKindSpecRevision, createKindSubjectOwner, createReaderProfile, createResourceContentIdentity, decodeResourceMetadata, digestCanonical, dirnameResourcePackageSourcePath, exactSpecVersion, isSpecVersion, joinResourcePackageSourcePath, kindDefinitionPackage, loadApplicationAssembly, loadHalfcodeResourceDslSystemSkillModule, loadHalfcodeResourceDslSystemSkillPlan, loadResourceTree, loadResourceTreeFromReadPort, planSkillCapsuleDistribution, readResourceMaterial, relativeResourcePackageSourcePath, resolveApplicationAssembly, resolveEffectiveResourceContentIdentities, resolveResourceTree, resolveSpec, resourceRefToFqn, sha256Digest, skillCapsuleDistributionProjection, validateCodeClosure, validateResourceTree, validateResourceTreeFromReadPort };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as KindSpecRevision, F as KindContractLockReader, G as ReaderProfile, H as KindWriterRegistration, I as KindReaderRegistration, J as ResourceResolutionReceipt, K as ReaderTarget, L as KindSemanticContract, M as JsonSchema, N as JsonSchemaValidator, P as KindContractLock,
|
|
1
|
+
import { B as KindSpecRevision, Ct as Sha256Digest, F as KindContractLockReader, G as ReaderProfile, H as KindWriterRegistration, I as KindReaderRegistration, J as ResourceResolutionReceipt, K as ReaderTarget, L as KindSemanticContract, M as JsonSchema, N as JsonSchemaValidator, P as KindContractLock, R as KindSourceContract, U as PortableSpec, V as KindSubjectOwner, W as PortableValue, Y as SpecResolutionDefinition, d as ResolvedResourceTree, f as ResourceDescriptor, h as ResourceKindContract, i as AuthoredResourceTree, j as CompatibilityPolicy, q as ResolvedSpec, tt as SpecVersion, z as KindSourceShape } from "./index-By8x4reS.js";
|
|
2
2
|
//#region ../kind-definition/src/versioned-contracts.d.ts
|
|
3
3
|
declare class KindContractRegistry {
|
|
4
4
|
private readonly ownersByKind;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { et as ResourceMetadata, i as AuthoredResourceTree, p as ResourceDiagnostic
|
|
1
|
+
import { ct as ResourceDigestContribution, et as ResourceMetadata, i as AuthoredResourceTree, p as ResourceDiagnostic } from "./index-By8x4reS.js";
|
|
2
|
+
import { a as ResourcePackageReadPort } from "./resource-package-read-port-BLBb4cz5.js";
|
|
2
3
|
//#region ../resource-core/src/composition-error.d.ts
|
|
3
4
|
declare class ResourceCompositionError extends Error {
|
|
4
5
|
readonly diagnostics: readonly ResourceDiagnostic[];
|
package/dist/resource-core.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { $ as RESOURCE_ENVELOPE_VERSION, A as validateResourceTreeFromReadPort,
|
|
2
|
-
import { a as
|
|
3
|
-
import { n as
|
|
1
|
+
import { $ as RESOURCE_ENVELOPE_VERSION, A as validateResourceTreeFromReadPort, B as KindSpecRevision, C as ResourceValue, Ct as Sha256Digest, D as loadResourceTree, E as SourceShape, Et as digestCanonical, F as KindContractLockReader, G as ReaderProfile, H as KindWriterRegistration, I as KindReaderRegistration, J as ResourceResolutionReceipt, K as ReaderTarget, L as KindSemanticContract, M as JsonSchema, N as JsonSchemaValidator, O as loadResourceTreeFromReadPort, P as KindContractLock, Q as RESOURCE_ENVELOPE_FINGERPRINT, R as KindSourceContract, S as ResourceValidationError, St as composeLayeredResourceRegistry, T as ResourceValueMap, Tt as compareCodeUnits, U as PortableSpec, V as KindSubjectOwner, W as PortableValue, X as CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS, Y as SpecResolutionDefinition, Z as RESOURCE_ENVELOPE_CONTRACT, _ as ResourceRecord, _t as ResourceLayerDescriptor, a as AuthoredResourceTreeBuildResult, at as ResourceContentIdentity, b as ResourceTree, bt as ResourceTombstone, c as RegisteredKindDefinition, ct as ResourceDigestContribution, d as ResolvedResourceTree, dt as createResourceContentIdentity, et as ResourceMetadata, f as ResourceDescriptor, ft as sha256Digest, g as ResourceNode, gt as EffectiveResourceRegistry, h as ResourceKindContract, ht as EffectiveResourceEntry, i as AuthoredResourceTree, it as CreateResourceContentIdentityInput, j as CompatibilityPolicy, k as validateResourceTree, l as ResolvedResourceRecord, lt as SnapshotResource, m as ResourceIdentity, mt as EffectiveKindDefinition, n as AuthoredResourceRegistry, nt as isSpecVersion, o as KindSpecRevisionDescriptor, ot as ResourceDependencyEdge, p as ResourceDiagnostic, pt as ComposeLayeredResourceRegistryInput, q as ResolvedSpec, r as AuthoredResourceSpec, rt as BuildResourceDependencySnapshotInput, s as LoadResourceTreeOptions, st as ResourceDependencySnapshot, t as AuthoredResourceRecord, tt as SpecVersion, u as ResolvedResourceRegistry, ut as buildResourceDependencySnapshot, v as ResourceRegistry, vt as ResourceLayerInput, w as ResourceValueList, wt as canonicalJson, x as ResourceTreeBuildResult, xt as ResourceTombstoneOrigin, y as ResourceScalar, yt as ResourceOrigin, z as KindSourceShape } from "./index-By8x4reS.js";
|
|
2
|
+
import { a as ResourcePackageReadPort, c as canonicalResourcePackageSourcePath, d as relativeResourcePackageSourcePath, i as ResourcePackageEntryKind, l as dirnameResourcePackageSourcePath, n as ResourcePackageDirectoryEntry, o as ResourcePackageReadPortOptions, r as ResourcePackageEntry, s as ResourcePackageSourcePathError, t as ResourcePackageAwaitable, u as joinResourcePackageSourcePath } from "./resource-package-read-port-BLBb4cz5.js";
|
|
3
|
+
import { a as ReadResourceMaterialInput, c as readResourceMaterial, i as createDirectoryResourcePackageReadPort, l as ResourceCompositionError, n as ResourceMetadataDecodeResult, o as ResourceMaterial, r as decodeResourceMetadata, s as ResourceMaterialError, t as ResourceMetadataDecodeInput } from "./resource-core-CoTu6FNS.js";
|
|
4
|
+
import { n as ResourceLayerContentIdentityInput, r as resolveEffectiveResourceContentIdentities, t as ResolveEffectiveResourceContentIdentitiesInput } from "./effective-content-identities-Cf0ygCXk.js";
|
|
4
5
|
export { AuthoredResourceRecord, AuthoredResourceRegistry, AuthoredResourceSpec, AuthoredResourceTree, AuthoredResourceTreeBuildResult, BuildResourceDependencySnapshotInput, CORE_BOOTSTRAP_WRITER_SPEC_VERSIONS, CompatibilityPolicy, ComposeLayeredResourceRegistryInput, CreateResourceContentIdentityInput, EffectiveKindDefinition, EffectiveResourceEntry, EffectiveResourceRegistry, JsonSchema, JsonSchemaValidator, KindContractLock, KindContractLockReader, KindReaderRegistration, KindSemanticContract, KindSourceContract, KindSourceShape, KindSpecRevision, KindSpecRevisionDescriptor, KindSubjectOwner, KindWriterRegistration, LoadResourceTreeOptions, PortableSpec, PortableValue, RESOURCE_ENVELOPE_CONTRACT, RESOURCE_ENVELOPE_FINGERPRINT, RESOURCE_ENVELOPE_VERSION, ReadResourceMaterialInput, ReaderProfile, ReaderTarget, RegisteredKindDefinition, ResolveEffectiveResourceContentIdentitiesInput, ResolvedResourceRecord, ResolvedResourceRegistry, ResolvedResourceTree, ResolvedSpec, ResourceCompositionError, ResourceContentIdentity, ResourceDependencyEdge, ResourceDependencySnapshot, ResourceDescriptor, ResourceDiagnostic, ResourceDigestContribution, ResourceIdentity, ResourceKindContract, ResourceLayerContentIdentityInput, ResourceLayerDescriptor, ResourceLayerInput, ResourceMaterial, ResourceMaterialError, ResourceMetadata, ResourceMetadataDecodeInput, ResourceMetadataDecodeResult, ResourceNode, ResourceOrigin, ResourcePackageAwaitable, ResourcePackageDirectoryEntry, ResourcePackageEntry, ResourcePackageEntryKind, ResourcePackageReadPort, ResourcePackageReadPortOptions, ResourcePackageSourcePathError, ResourceRecord, ResourceRegistry, ResourceResolutionReceipt, ResourceScalar, ResourceTombstone, ResourceTombstoneOrigin, ResourceTree, ResourceTreeBuildResult, ResourceValidationError, ResourceValue, ResourceValueList, ResourceValueMap, type Sha256Digest, SnapshotResource, SourceShape, SpecResolutionDefinition, SpecVersion, buildResourceDependencySnapshot, canonicalJson, canonicalResourcePackageSourcePath, compareCodeUnits, composeLayeredResourceRegistry, createDirectoryResourcePackageReadPort, createResourceContentIdentity, decodeResourceMetadata, digestCanonical, dirnameResourcePackageSourcePath, isSpecVersion, joinResourcePackageSourcePath, loadResourceTree, loadResourceTreeFromReadPort, readResourceMaterial, relativeResourcePackageSourcePath, resolveEffectiveResourceContentIdentities, sha256Digest, validateResourceTree, validateResourceTreeFromReadPort };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region ../resource-core/src/resource-package-read-port.d.ts
|
|
2
|
+
type ResourcePackageAwaitable<T> = T | PromiseLike<T>;
|
|
3
|
+
type ResourcePackageEntryKind = "file" | "directory" | "symlink" | "other";
|
|
4
|
+
interface ResourcePackageEntry {
|
|
5
|
+
readonly kind: ResourcePackageEntryKind;
|
|
6
|
+
}
|
|
7
|
+
interface ResourcePackageDirectoryEntry extends ResourcePackageEntry {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Storage-neutral source effect for one already-materialized ResourcePackage
|
|
12
|
+
* file view. Paths are canonical POSIX absolute coordinates scoped to the
|
|
13
|
+
* provider; they are never semantic resource provenance.
|
|
14
|
+
*/
|
|
15
|
+
interface ResourcePackageReadPort {
|
|
16
|
+
stat(sourcePath: string): ResourcePackageAwaitable<ResourcePackageEntry | undefined>;
|
|
17
|
+
readDirectory(sourcePath: string): ResourcePackageAwaitable<readonly ResourcePackageDirectoryEntry[] | undefined>;
|
|
18
|
+
readBytes(sourcePath: string): ResourcePackageAwaitable<Uint8Array | undefined>;
|
|
19
|
+
}
|
|
20
|
+
interface ResourcePackageReadPortOptions {
|
|
21
|
+
readonly port: ResourcePackageReadPort;
|
|
22
|
+
readonly rootPath?: string;
|
|
23
|
+
readonly manifestPath?: string;
|
|
24
|
+
}
|
|
25
|
+
declare class ResourcePackageSourcePathError extends TypeError {
|
|
26
|
+
constructor(message: string);
|
|
27
|
+
}
|
|
28
|
+
declare function canonicalResourcePackageSourcePath(input: string): string;
|
|
29
|
+
declare function joinResourcePackageSourcePath(base: string, ...segments: readonly string[]): string;
|
|
30
|
+
declare function dirnameResourcePackageSourcePath(sourcePath: string): string;
|
|
31
|
+
declare function relativeResourcePackageSourcePath(rootPath: string, sourcePath: string): string | undefined;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ResourcePackageReadPort as a, canonicalResourcePackageSourcePath as c, relativeResourcePackageSourcePath as d, ResourcePackageEntryKind as i, dirnameResourcePackageSourcePath as l, ResourcePackageDirectoryEntry as n, ResourcePackageReadPortOptions as o, ResourcePackageEntry as r, ResourcePackageSourcePathError as s, ResourcePackageAwaitable as t, joinResourcePackageSourcePath as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as resourceProjectionPackage, t as ResourceRegistry } from "./index-
|
|
1
|
+
import { n as resourceProjectionPackage, t as ResourceRegistry } from "./index-Csi_AIoU.js";
|
|
2
2
|
export { ResourceRegistry, resourceProjectionPackage };
|
package/dist/skill-capsule.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { I as SkillCapsuleDependency } from "./index-DEikbOFh.js";
|
|
2
|
-
import { S as skillCapsuleDistributionProjection, _ as applySkillCapsuleDistributionPlan, a as PlannedSkillCapsule, b as compilerSkillPackage, c as SkillCapsuleContentDigest, d as SkillCapsuleDistributionReceipt, f as SkillCapsuleIdentity, g as SkillReference, h as SkillDescriptor, i as PlanSkillCapsuleDistributionInput, l as SkillCapsuleDistributionError, m as SkillCapsuleProvenanceManifest, n as CompileResourceSkillCapsuleInput, o as PlannedSkillFile, p as SkillCapsulePlan, r as CompileSkillCapsuleInput, s as SkillCapsuleApplyStep, t as ApplySkillCapsuleDistributionOptions, u as SkillCapsuleDistributionPlan, v as compileResourceSkillCapsule, x as planSkillCapsuleDistribution, y as compileSkillCapsule } from "./index-
|
|
2
|
+
import { S as skillCapsuleDistributionProjection, _ as applySkillCapsuleDistributionPlan, a as PlannedSkillCapsule, b as compilerSkillPackage, c as SkillCapsuleContentDigest, d as SkillCapsuleDistributionReceipt, f as SkillCapsuleIdentity, g as SkillReference, h as SkillDescriptor, i as PlanSkillCapsuleDistributionInput, l as SkillCapsuleDistributionError, m as SkillCapsuleProvenanceManifest, n as CompileResourceSkillCapsuleInput, o as PlannedSkillFile, p as SkillCapsulePlan, r as CompileSkillCapsuleInput, s as SkillCapsuleApplyStep, t as ApplySkillCapsuleDistributionOptions, u as SkillCapsuleDistributionPlan, v as compileResourceSkillCapsule, x as planSkillCapsuleDistribution, y as compileSkillCapsule } from "./index-B9Pp3Zgj.js";
|
|
3
3
|
export { ApplySkillCapsuleDistributionOptions, CompileResourceSkillCapsuleInput, CompileSkillCapsuleInput, PlanSkillCapsuleDistributionInput, PlannedSkillCapsule, PlannedSkillFile, SkillCapsuleApplyStep, SkillCapsuleContentDigest, type SkillCapsuleDependency, SkillCapsuleDistributionError, SkillCapsuleDistributionPlan, SkillCapsuleDistributionReceipt, SkillCapsuleIdentity, SkillCapsulePlan, SkillCapsuleProvenanceManifest, SkillDescriptor, SkillReference, applySkillCapsuleDistributionPlan, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, planSkillCapsuleDistribution, skillCapsuleDistributionProjection };
|
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-QI7NRyC8.js";
|
|
2
2
|
export { SkillCapsuleDistributionError, applySkillCapsuleDistributionPlan, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, planSkillCapsuleDistribution, skillCapsuleDistributionProjection };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { n as loadResourceTree } from "./src-jggOQtq3.js";
|
|
1
|
+
import { E as canonicalResourcePackageSourcePath, n as loadResourceTree } from "./src-jggOQtq3.js";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { parse } from "yaml";
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import ts from "typescript";
|
|
5
7
|
//#region ../application-assembly/src/internal-bindings.ts
|
|
6
8
|
const bindingsByDefinition = /* @__PURE__ */ new WeakMap();
|
|
7
9
|
const compilationsByAssembly = /* @__PURE__ */ new WeakMap();
|
|
@@ -24,6 +26,328 @@ function resolveObjectOperationCompilation(assembly, operationRef) {
|
|
|
24
26
|
return compilation;
|
|
25
27
|
}
|
|
26
28
|
//#endregion
|
|
29
|
+
//#region ../application-assembly/src/code-execution-closure.ts
|
|
30
|
+
/** The complete emit profile is versioned; changing it invalidates old closures. */
|
|
31
|
+
const CODE_CLOSURE_COMPILER_IDENTITY = "typescript@5.9.3/commonjs-es2022-interop/closure-v2";
|
|
32
|
+
var CodeClosureError = class extends Error {
|
|
33
|
+
code;
|
|
34
|
+
constructor(code, message) {
|
|
35
|
+
super(`${code}: ${message}`);
|
|
36
|
+
this.code = code;
|
|
37
|
+
this.name = "CodeClosureError";
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function fail$1(code, message) {
|
|
41
|
+
throw new CodeClosureError(code, message);
|
|
42
|
+
}
|
|
43
|
+
/** Reject active objects before reading values or invoking JSON serialization. */
|
|
44
|
+
function assertJsonData(value, ancestors = /* @__PURE__ */ new Set()) {
|
|
45
|
+
if (value === null || typeof value === "string" || typeof value === "boolean" || typeof value === "number" && Number.isFinite(value)) return;
|
|
46
|
+
if (typeof value !== "object") fail$1("invalid-closure-data", "Expected closed JSON data");
|
|
47
|
+
if (ancestors.has(value)) fail$1("invalid-closure-data", "Cyclic closure data is unsupported");
|
|
48
|
+
const prototype = Object.getPrototypeOf(value);
|
|
49
|
+
if (prototype !== (Array.isArray(value) ? Array.prototype : Object.prototype) && prototype !== null) fail$1("invalid-closure-data", "Exotic closure objects are unsupported");
|
|
50
|
+
ancestors.add(value);
|
|
51
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
52
|
+
if (Array.isArray(value) && key === "length") continue;
|
|
53
|
+
const property = Object.getOwnPropertyDescriptor(value, key);
|
|
54
|
+
if (typeof key !== "string" || !property.enumerable || !("value" in property)) fail$1("invalid-closure-data", "Accessors and non-JSON properties are unsupported");
|
|
55
|
+
if (Array.isArray(value) && (!/^(0|[1-9]\d*)$/.test(key) || Number(key) >= value.length)) fail$1("invalid-closure-data", "Array properties must be indexes");
|
|
56
|
+
assertJsonData(property.value, ancestors);
|
|
57
|
+
}
|
|
58
|
+
if (Array.isArray(value) && Object.keys(value).length !== value.length) fail$1("invalid-closure-data", "Sparse arrays are unsupported");
|
|
59
|
+
ancestors.delete(value);
|
|
60
|
+
}
|
|
61
|
+
function comparePaths(a, b) {
|
|
62
|
+
if (a < b) return -1;
|
|
63
|
+
return a > b ? 1 : 0;
|
|
64
|
+
}
|
|
65
|
+
function stable(value) {
|
|
66
|
+
if (Array.isArray(value)) return `[${value.map(stable).join(",")}]`;
|
|
67
|
+
if (value !== null && typeof value === "object") return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stable(value[key])}`).join(",")}}`;
|
|
68
|
+
return JSON.stringify(value);
|
|
69
|
+
}
|
|
70
|
+
function digest(value) {
|
|
71
|
+
return createHash("sha256").update(stable(value)).digest("hex");
|
|
72
|
+
}
|
|
73
|
+
function contentDigest(value) {
|
|
74
|
+
return createHash("sha256").update(value).digest("hex");
|
|
75
|
+
}
|
|
76
|
+
function freeze(value) {
|
|
77
|
+
if (value && typeof value === "object") {
|
|
78
|
+
for (const child of Object.values(value)) freeze(child);
|
|
79
|
+
Object.freeze(value);
|
|
80
|
+
}
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
function relativePath(path) {
|
|
84
|
+
if (!path || path.startsWith("/") || path.includes("\\") || path.includes("\0") || path.includes("?") || path.includes("#") || path.split("/").some((part) => !part || part === "." || part === "..")) fail$1("invalid-path", `Noncanonical closure path: ${path}`);
|
|
85
|
+
return path;
|
|
86
|
+
}
|
|
87
|
+
function localTarget(from, specifier) {
|
|
88
|
+
if (!specifier.startsWith("./") && !specifier.startsWith("../")) fail$1("outside-source-root", `Unsupported local path ${specifier}`);
|
|
89
|
+
if (/[\\\0?#]/.test(specifier)) fail$1("invalid-path", `Unsupported module specifier ${specifier}`);
|
|
90
|
+
const parts = from.split("/").slice(0, -1);
|
|
91
|
+
for (const part of specifier.split("/")) {
|
|
92
|
+
if (part === ".") continue;
|
|
93
|
+
if (part === "..") {
|
|
94
|
+
if (!parts.length) fail$1("outside-source-root", `${from} imports outside source root: ${specifier}`);
|
|
95
|
+
parts.pop();
|
|
96
|
+
} else {
|
|
97
|
+
if (!part) fail$1("invalid-path", specifier);
|
|
98
|
+
parts.push(part);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return relativePath(parts.join("/"));
|
|
102
|
+
}
|
|
103
|
+
const codeExtension = /\.(?:[cm]?[jt]s)$/;
|
|
104
|
+
function candidates(target) {
|
|
105
|
+
if (codeExtension.test(target)) {
|
|
106
|
+
const substituted = target.replace(/\.js$/, ".ts").replace(/\.mjs$/, ".mts").replace(/\.cjs$/, ".cts");
|
|
107
|
+
return [.../* @__PURE__ */ new Set([substituted, target])];
|
|
108
|
+
}
|
|
109
|
+
if (/\.[^/]+$/.test(target)) return [target];
|
|
110
|
+
return [target, ...[
|
|
111
|
+
".ts",
|
|
112
|
+
".js",
|
|
113
|
+
".mts",
|
|
114
|
+
".mjs",
|
|
115
|
+
".cts",
|
|
116
|
+
".cjs",
|
|
117
|
+
"/index.ts",
|
|
118
|
+
"/index.js"
|
|
119
|
+
].map((extension) => target + extension)];
|
|
120
|
+
}
|
|
121
|
+
function checkEnvironment(environment) {
|
|
122
|
+
assertJsonData(environment);
|
|
123
|
+
if (!environment || typeof environment.hostIdentity !== "string" || !environment.hostIdentity || !environment.ambient || Array.isArray(environment.ambient) || typeof environment.ambient !== "object") fail$1("invalid-environment", "Expected host identity and ambient identities");
|
|
124
|
+
for (const [specifier, identity] of Object.entries(environment.ambient)) if (!specifier || specifier.startsWith(".") || specifier.startsWith("/") || /[\\\0]/.test(specifier) || typeof identity !== "string" || !identity) fail$1("invalid-environment", `Invalid ambient identity: ${specifier}`);
|
|
125
|
+
}
|
|
126
|
+
function bindingEntry(binding) {
|
|
127
|
+
if (!binding || typeof binding.packageName !== "string" || !binding.packageName || typeof binding.exportName !== "string" || !binding.exportName || typeof binding.module !== "string" || !binding.module.startsWith("./")) fail$1("invalid-binding", "Closure binding requires a package-owned ./ module and export");
|
|
128
|
+
const entry = relativePath(binding.module.slice(2));
|
|
129
|
+
if (binding.moduleSpecifier !== `${binding.packageName}/${entry}`) fail$1("invalid-binding", "CodeBinding moduleSpecifier does not match package/module");
|
|
130
|
+
return entry;
|
|
131
|
+
}
|
|
132
|
+
function compile(path, source) {
|
|
133
|
+
if (ts.version !== "5.9.3") fail$1("compiler-mismatch", `Expected TypeScript 5.9.3; found ${ts.version}`);
|
|
134
|
+
const tree = ts.createSourceFile(path, source, ts.ScriptTarget.ES2022, true, /\.[cm]?js$/.test(path) ? ts.ScriptKind.JS : ts.ScriptKind.TS);
|
|
135
|
+
const specifiers = /* @__PURE__ */ new Set();
|
|
136
|
+
const walk = (node, functionDepth) => {
|
|
137
|
+
if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword) fail$1("unsupported-dynamic-import", `${path}: dynamic import cannot be frozen`);
|
|
138
|
+
if (ts.isIdentifier(node) && node.text === "require") fail$1("unsupported-require", `${path}: require and aliases are unsupported; use static imports`);
|
|
139
|
+
if (ts.isImportEqualsDeclaration(node)) fail$1("unsupported-require", `${path}: import-equals is unsupported`);
|
|
140
|
+
if (ts.isMetaProperty(node) && node.keywordToken === ts.SyntaxKind.ImportKeyword) fail$1("unsupported-import-meta", `${path}: import.meta is unsupported`);
|
|
141
|
+
if (!functionDepth && (ts.isAwaitExpression(node) || ts.isForOfStatement(node) && node.awaitModifier)) fail$1("unsupported-top-level-await", `${path}: top-level await is unsupported`);
|
|
142
|
+
if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) && node.moduleSpecifier) {
|
|
143
|
+
if (ts.isImportDeclaration(node) && node.importClause) {
|
|
144
|
+
const clause = node.importClause;
|
|
145
|
+
if (clause.isTypeOnly || !clause.name && clause.namedBindings && ts.isNamedImports(clause.namedBindings) && clause.namedBindings.elements.length > 0 && clause.namedBindings.elements.every((element) => element.isTypeOnly)) return;
|
|
146
|
+
}
|
|
147
|
+
if (ts.isExportDeclaration(node) && (node.isTypeOnly || node.exportClause && ts.isNamedExports(node.exportClause) && node.exportClause.elements.length > 0 && node.exportClause.elements.every((element) => element.isTypeOnly))) return;
|
|
148
|
+
if (!ts.isStringLiteral(node.moduleSpecifier)) fail$1("unsupported-import", `${path}: module specifier must be a string literal`);
|
|
149
|
+
if (node.attributes) fail$1("unsupported-import-attributes", `${path}: use declared closure assets without import attributes`);
|
|
150
|
+
specifiers.add(node.moduleSpecifier.text);
|
|
151
|
+
}
|
|
152
|
+
ts.forEachChild(node, (child) => walk(child, functionDepth + (ts.isFunctionLike(node) ? 1 : 0)));
|
|
153
|
+
};
|
|
154
|
+
walk(tree, 0);
|
|
155
|
+
const emitPath = path.replace(/\.mts$/, ".ts").replace(/\.mjs$/, ".js");
|
|
156
|
+
const emitted = ts.transpileModule(source, {
|
|
157
|
+
fileName: emitPath,
|
|
158
|
+
reportDiagnostics: true,
|
|
159
|
+
compilerOptions: {
|
|
160
|
+
target: ts.ScriptTarget.ES2022,
|
|
161
|
+
module: ts.ModuleKind.CommonJS,
|
|
162
|
+
esModuleInterop: true,
|
|
163
|
+
sourceMap: false,
|
|
164
|
+
inlineSourceMap: false,
|
|
165
|
+
removeComments: false
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
const errors = emitted.diagnostics?.filter((item) => item.category === ts.DiagnosticCategory.Error) ?? [];
|
|
169
|
+
if (errors.length) fail$1("invalid-source", `${path}: ${errors.map((item) => ts.flattenDiagnosticMessageText(item.messageText, " ")).join("; ")}`);
|
|
170
|
+
return {
|
|
171
|
+
code: emitted.outputText,
|
|
172
|
+
specifiers: [...specifiers].sort()
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
async function captureCodeClosure(runtime, input) {
|
|
176
|
+
checkEnvironment(input.environment);
|
|
177
|
+
const root = canonicalResourcePackageSourcePath(input.sourceRoot);
|
|
178
|
+
const sourcePath = canonicalResourcePackageSourcePath(input.entryPath);
|
|
179
|
+
const bindingPath = bindingEntry(input.binding);
|
|
180
|
+
const absolute = (path) => root === "/" ? `/${path}` : `${root}/${path}`;
|
|
181
|
+
const entryPath = candidates(bindingPath).find((candidate) => absolute(candidate) === sourcePath);
|
|
182
|
+
if (!entryPath) fail$1("invalid-binding", "entryPath must resolve CodeBinding.module within sourceRoot");
|
|
183
|
+
const declarations = { ...input.assets };
|
|
184
|
+
for (const [path, format] of Object.entries(declarations)) {
|
|
185
|
+
relativePath(path);
|
|
186
|
+
if (format !== "text" && format !== "json") fail$1("invalid-asset", `Unsupported asset format: ${format}`);
|
|
187
|
+
if (codeExtension.test(path)) fail$1("invalid-asset", `Code cannot be declared as an asset: ${path}`);
|
|
188
|
+
}
|
|
189
|
+
const modules = /* @__PURE__ */ new Map();
|
|
190
|
+
const assets = /* @__PURE__ */ new Map();
|
|
191
|
+
const hasFile = async (path) => {
|
|
192
|
+
const segments = absolute(path).slice(1).split("/");
|
|
193
|
+
for (let i = 1; i <= segments.length; i++) {
|
|
194
|
+
const prefix = `/${segments.slice(0, i).join("/")}`;
|
|
195
|
+
const info = await runtime.source.stat(prefix);
|
|
196
|
+
if (info?.kind === "symlink") fail$1("symlink-source", `Symlink source is unsupported: ${prefix}`);
|
|
197
|
+
if (i === segments.length) return info?.kind === "file";
|
|
198
|
+
}
|
|
199
|
+
return false;
|
|
200
|
+
};
|
|
201
|
+
const read = async (path) => {
|
|
202
|
+
if (!await hasFile(path)) fail$1("missing-source", `Missing source file: ${path}`);
|
|
203
|
+
const bytes = await runtime.source.readBytes(absolute(path));
|
|
204
|
+
if (!bytes) fail$1("missing-source", `Unreadable source file: ${path}`);
|
|
205
|
+
try {
|
|
206
|
+
return new TextDecoder("utf-8", {
|
|
207
|
+
fatal: true,
|
|
208
|
+
ignoreBOM: true
|
|
209
|
+
}).decode(bytes);
|
|
210
|
+
} catch {
|
|
211
|
+
return fail$1("invalid-source", `Expected UTF-8: ${path}`);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const visit = async (path) => {
|
|
215
|
+
if (modules.has(path)) return;
|
|
216
|
+
if (!codeExtension.test(path) || /\.d\.[cm]?ts$/.test(path)) fail$1("unsupported-module", `Expected executable TS/JS module: ${path}`);
|
|
217
|
+
const source = await read(path);
|
|
218
|
+
const result = compile(path, source);
|
|
219
|
+
const dependencies = [];
|
|
220
|
+
modules.set(path, {
|
|
221
|
+
path,
|
|
222
|
+
source,
|
|
223
|
+
sourceDigest: contentDigest(source),
|
|
224
|
+
code: result.code,
|
|
225
|
+
codeDigest: contentDigest(result.code),
|
|
226
|
+
dependencies
|
|
227
|
+
});
|
|
228
|
+
for (const specifier of result.specifiers) if (specifier.startsWith(".")) {
|
|
229
|
+
const target = localTarget(path, specifier);
|
|
230
|
+
if (Object.hasOwn(declarations, target)) dependencies.push({
|
|
231
|
+
specifier,
|
|
232
|
+
kind: "asset",
|
|
233
|
+
target
|
|
234
|
+
});
|
|
235
|
+
else {
|
|
236
|
+
if (!codeExtension.test(target) && /\.[^/]+$/.test(target)) fail$1("undeclared-asset", `${path}: asset must be declared: ${specifier}`);
|
|
237
|
+
let resolved;
|
|
238
|
+
for (const candidate of candidates(target)) if (await hasFile(candidate)) {
|
|
239
|
+
resolved = candidate;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
if (!resolved) fail$1("missing-module", `${path}: cannot freeze ${specifier}`);
|
|
243
|
+
dependencies.push({
|
|
244
|
+
specifier,
|
|
245
|
+
kind: "module",
|
|
246
|
+
target: resolved
|
|
247
|
+
});
|
|
248
|
+
await visit(resolved);
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
if (specifier.startsWith("/") || specifier.startsWith("file:") || specifier.includes("\\")) fail$1("outside-source-root", `${path}: ${specifier}`);
|
|
252
|
+
if (!Object.hasOwn(input.environment.ambient, specifier)) fail$1("undeclared-ambient", `${path}: ambient dependency not declared: ${specifier}`);
|
|
253
|
+
dependencies.push({
|
|
254
|
+
specifier,
|
|
255
|
+
kind: "ambient",
|
|
256
|
+
target: specifier
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
await visit(entryPath);
|
|
261
|
+
for (const [path, format] of Object.entries(declarations).sort(([a], [b]) => comparePaths(a, b))) {
|
|
262
|
+
const content = await read(path);
|
|
263
|
+
if (format === "json") try {
|
|
264
|
+
JSON.parse(content);
|
|
265
|
+
} catch {
|
|
266
|
+
fail$1("invalid-asset", `Invalid JSON asset: ${path}`);
|
|
267
|
+
}
|
|
268
|
+
assets.set(path, {
|
|
269
|
+
path,
|
|
270
|
+
format,
|
|
271
|
+
content,
|
|
272
|
+
contentDigest: contentDigest(content)
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
const payload = {
|
|
276
|
+
format: "halfcode-code-closure/v1",
|
|
277
|
+
compilerIdentity: CODE_CLOSURE_COMPILER_IDENTITY,
|
|
278
|
+
binding: { ...input.binding },
|
|
279
|
+
entryPath,
|
|
280
|
+
environment: {
|
|
281
|
+
hostIdentity: input.environment.hostIdentity,
|
|
282
|
+
ambient: { ...input.environment.ambient }
|
|
283
|
+
},
|
|
284
|
+
modules: [...modules.values()].sort((a, b) => comparePaths(a.path, b.path)),
|
|
285
|
+
assets: [...assets.values()]
|
|
286
|
+
};
|
|
287
|
+
const closure = {
|
|
288
|
+
...payload,
|
|
289
|
+
digest: digest(payload)
|
|
290
|
+
};
|
|
291
|
+
validateCodeClosure(closure, input.environment, closure.digest);
|
|
292
|
+
return freeze(closure);
|
|
293
|
+
}
|
|
294
|
+
/** Pure validation: no source reader, live imports, or module execution. */
|
|
295
|
+
function validateCodeClosure(closure, environment, expectedDigest) {
|
|
296
|
+
if (typeof expectedDigest !== "string" || !/^[a-f0-9]{64}$/.test(expectedDigest)) fail$1("invalid-digest", "A trusted expected digest is required");
|
|
297
|
+
assertJsonData(closure);
|
|
298
|
+
if (!closure || typeof closure !== "object" || closure.digest !== expectedDigest) fail$1("digest-mismatch", "Closure differs from the trusted expected digest");
|
|
299
|
+
const { digest: actualDigest, ...payload } = closure;
|
|
300
|
+
if (digest(payload) !== actualDigest) fail$1("digest-mismatch", "Closure contents do not match digest");
|
|
301
|
+
if (closure.format !== "halfcode-code-closure/v1") fail$1("unsupported-format", "Unsupported code closure format");
|
|
302
|
+
if (closure.compilerIdentity !== "typescript@5.9.3/commonjs-es2022-interop/closure-v2" || ts.version !== "5.9.3") fail$1("compiler-mismatch", "Closure compiler identity mismatch");
|
|
303
|
+
checkEnvironment(environment);
|
|
304
|
+
checkEnvironment(closure.environment);
|
|
305
|
+
if (stable(environment) !== stable(closure.environment)) fail$1("environment-mismatch", "Execution environment identity mismatch");
|
|
306
|
+
if (!candidates(bindingEntry(closure.binding)).includes(closure.entryPath)) fail$1("invalid-binding", "Closure entry does not match binding");
|
|
307
|
+
if (!Array.isArray(closure.modules) || !Array.isArray(closure.assets)) fail$1("invalid-closure", "Expected modules and assets");
|
|
308
|
+
const modules = /* @__PURE__ */ new Map();
|
|
309
|
+
const assets = /* @__PURE__ */ new Map();
|
|
310
|
+
for (const module of closure.modules) {
|
|
311
|
+
relativePath(module.path);
|
|
312
|
+
if (!codeExtension.test(module.path) || /\.d\.[cm]?ts$/.test(module.path) || modules.has(module.path) || typeof module.source !== "string" || typeof module.code !== "string" || !Array.isArray(module.dependencies)) fail$1("invalid-module", `Invalid module: ${module.path}`);
|
|
313
|
+
if (module.sourceDigest !== contentDigest(module.source) || module.codeDigest !== contentDigest(module.code)) fail$1("file-digest-mismatch", `Module content digest mismatch: ${module.path}`);
|
|
314
|
+
modules.set(module.path, module);
|
|
315
|
+
}
|
|
316
|
+
for (const asset of closure.assets) {
|
|
317
|
+
relativePath(asset.path);
|
|
318
|
+
if (assets.has(asset.path) || modules.has(asset.path) || codeExtension.test(asset.path) || typeof asset.content !== "string" || !["text", "json"].includes(asset.format)) fail$1("invalid-asset", `Invalid asset: ${asset.path}`);
|
|
319
|
+
if (asset.contentDigest !== contentDigest(asset.content)) fail$1("file-digest-mismatch", `Asset content digest mismatch: ${asset.path}`);
|
|
320
|
+
if (asset.format === "json") try {
|
|
321
|
+
JSON.parse(asset.content);
|
|
322
|
+
} catch {
|
|
323
|
+
fail$1("invalid-asset", `Invalid JSON asset: ${asset.path}`);
|
|
324
|
+
}
|
|
325
|
+
assets.set(asset.path, asset);
|
|
326
|
+
}
|
|
327
|
+
if (!modules.has(closure.entryPath)) fail$1("missing-entry", "Closure entry module is absent");
|
|
328
|
+
for (const module of modules.values()) {
|
|
329
|
+
const compiled = compile(module.path, module.source);
|
|
330
|
+
if (compiled.code !== module.code) fail$1("invalid-emit", `Compiled code differs from frozen source: ${module.path}`);
|
|
331
|
+
if (stable(compiled.specifiers) !== stable(module.dependencies.map((edge) => edge.specifier).sort())) fail$1("invalid-edge", `Dependency set differs from source: ${module.path}`);
|
|
332
|
+
for (const edge of module.dependencies) {
|
|
333
|
+
if (edge.specifier.startsWith(".")) {
|
|
334
|
+
const target = localTarget(module.path, edge.specifier);
|
|
335
|
+
if (edge.kind === "asset" && edge.target === target && assets.has(edge.target)) continue;
|
|
336
|
+
if (edge.kind === "module" && candidates(target).includes(edge.target) && modules.has(edge.target)) continue;
|
|
337
|
+
} else if (edge.kind === "ambient" && edge.target === edge.specifier && Object.hasOwn(environment.ambient, edge.target) && !edge.target.startsWith("/") && !edge.target.startsWith("file:")) continue;
|
|
338
|
+
fail$1("invalid-edge", `Invalid dependency target: ${module.path} -> ${edge.specifier}`);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const reachable = /* @__PURE__ */ new Set();
|
|
342
|
+
const visit = (path) => {
|
|
343
|
+
if (reachable.has(path)) return;
|
|
344
|
+
reachable.add(path);
|
|
345
|
+
for (const edge of modules.get(path).dependencies) if (edge.kind === "module") visit(edge.target);
|
|
346
|
+
};
|
|
347
|
+
visit(closure.entryPath);
|
|
348
|
+
if (reachable.size !== modules.size) fail$1("invalid-closure", "Closure contains unreachable modules");
|
|
349
|
+
}
|
|
350
|
+
//#endregion
|
|
27
351
|
//#region ../application-assembly/src/index.ts
|
|
28
352
|
var ObjectOperationContractError = class extends TypeError {
|
|
29
353
|
code;
|
|
@@ -642,4 +966,4 @@ const applicationAssemblyPackage = {
|
|
|
642
966
|
owns: "resource registry facts normalized for target-neutral compiler projections"
|
|
643
967
|
};
|
|
644
968
|
//#endregion
|
|
645
|
-
export { assertObjectOperationCatalog as a, resolveApplicationAssembly as c, assertObjectOperationCall as i, resourceRefToFqn as l, applicationAssemblyPackage as n, assertObjectOperationDefinition as o, assertExecuteObjectOperationRequest as r, loadApplicationAssembly as s, ObjectOperationContractError as t,
|
|
969
|
+
export { assertObjectOperationCatalog as a, resolveApplicationAssembly as c, CodeClosureError as d, captureCodeClosure as f, assertObjectOperationCall as i, resourceRefToFqn as l, resolveObjectOperationCompilation as m, applicationAssemblyPackage as n, assertObjectOperationDefinition as o, validateCodeClosure as p, assertExecuteObjectOperationRequest as r, loadApplicationAssembly as s, ObjectOperationContractError as t, CODE_CLOSURE_COMPILER_IDENTITY as u };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { d as isSpecVersion, u as RESOURCE_ENVELOPE_VERSION } from "./src-jggOQtq3.js";
|
|
2
2
|
import { t as resolveEffectiveResourceContentIdentities } from "./effective-content-identities-CV6XFBZy.js";
|
|
3
|
+
import { d as CodeClosureError, p as validateCodeClosure } from "./src-BX7wrSq1.js";
|
|
3
4
|
import { createHash } from "node:crypto";
|
|
4
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
6
|
//#region ../runtime-authoring/src/resource-authoring.ts
|
|
@@ -600,6 +601,55 @@ function fail(code, message) {
|
|
|
600
601
|
throw new ResourceAuthoringError(code, message);
|
|
601
602
|
}
|
|
602
603
|
//#endregion
|
|
604
|
+
//#region ../runtime-authoring/src/code-execution.ts
|
|
605
|
+
/** Each restore owns a fresh module table; this is not an untrusted-code sandbox. */
|
|
606
|
+
function restoreCodeClosure(runtime, input, expectedDigest) {
|
|
607
|
+
validateCodeClosure(input, runtime.environment, expectedDigest);
|
|
608
|
+
const closure = JSON.parse(JSON.stringify(input));
|
|
609
|
+
const ambient = /* @__PURE__ */ new Map();
|
|
610
|
+
for (const name of Object.keys(closure.environment.ambient)) {
|
|
611
|
+
if (!runtime.ambientModules || !Object.hasOwn(runtime.ambientModules, name)) throw new CodeClosureError("missing-ambient", `Missing explicit ambient exports: ${name}`);
|
|
612
|
+
ambient.set(name, runtime.ambientModules[name]);
|
|
613
|
+
}
|
|
614
|
+
const modules = new Map(closure.modules.map((module) => [module.path, module]));
|
|
615
|
+
const assets = new Map(closure.assets.map((asset) => [asset.path, asset.format === "json" ? JSON.parse(asset.content) : asset.content]));
|
|
616
|
+
const table = /* @__PURE__ */ new Map();
|
|
617
|
+
const load = (path) => {
|
|
618
|
+
const cached = table.get(path);
|
|
619
|
+
if (cached) return cached.exports;
|
|
620
|
+
const source = modules.get(path);
|
|
621
|
+
if (!source) throw new CodeClosureError("missing-module", `Frozen module absent: ${path}`);
|
|
622
|
+
const module = { exports: {} };
|
|
623
|
+
table.set(path, module);
|
|
624
|
+
const edges = new Map(source.dependencies.map((edge) => [edge.specifier, edge]));
|
|
625
|
+
const requireFrozen = (specifier) => {
|
|
626
|
+
const edge = edges.get(specifier);
|
|
627
|
+
if (!edge) throw new CodeClosureError("undeclared-dependency", `No frozen edge for ${path}: ${specifier}`);
|
|
628
|
+
if (edge.kind === "module") return load(edge.target);
|
|
629
|
+
if (edge.kind === "asset") return assets.get(edge.target);
|
|
630
|
+
return ambient.get(edge.target);
|
|
631
|
+
};
|
|
632
|
+
try {
|
|
633
|
+
new Function("require", "module", "exports", source.code)(requireFrozen, module, module.exports);
|
|
634
|
+
return module.exports;
|
|
635
|
+
} catch (error) {
|
|
636
|
+
table.delete(path);
|
|
637
|
+
throw error;
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
return Object.freeze({
|
|
641
|
+
binding: Object.freeze(closure.binding),
|
|
642
|
+
closureDigest: closure.digest,
|
|
643
|
+
exports: load(closure.entryPath)
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
function bindCodeClosure(runtime, closure, expectedDigest) {
|
|
647
|
+
const restored = restoreCodeClosure(runtime, closure, expectedDigest);
|
|
648
|
+
const callable = restored.exports[restored.binding.exportName];
|
|
649
|
+
if (typeof callable !== "function") throw new CodeClosureError("missing-export", `CodeBinding export is not callable: ${restored.binding.exportName}`);
|
|
650
|
+
return (...args) => Reflect.apply(callable, void 0, args);
|
|
651
|
+
}
|
|
652
|
+
//#endregion
|
|
603
653
|
//#region ../runtime-authoring/src/index.ts
|
|
604
654
|
const runtimeScope = new AsyncLocalStorage();
|
|
605
655
|
function runWithRuntime(runtime, callback) {
|
|
@@ -637,4 +687,4 @@ const runtimeAuthoringPackage = {
|
|
|
637
687
|
owns: "target-neutral deterministic-code runtime and effect boundary"
|
|
638
688
|
};
|
|
639
689
|
//#endregion
|
|
640
|
-
export { runWithRuntime as a,
|
|
690
|
+
export { runWithRuntime as a, restoreCodeClosure as c, applyResourceAuthoring as d, deriveResourceAuthoringRegistryRevision as f, logger as i, RESOURCE_AUTHORING_SCHEMA_VERSION as l, currentRuntime as n, runtimeAuthoringPackage as o, planResourceAuthoring as p, invokeEffect as r, bindCodeClosure as s, createAuthoringBindings as t, ResourceAuthoringError as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as resourceRefToFqn,
|
|
1
|
+
import { l as resourceRefToFqn, m as resolveObjectOperationCompilation } from "./src-BX7wrSq1.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";
|
package/dist/testing.js
CHANGED