halfcode-compiler.xnl 0.2.6 → 0.2.8
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-X6R_4lMW.d.ts → index-B515mMkO.d.ts} +1 -1
- package/dist/{index-CEJBgfBZ.d.ts → index-CDIT65pI.d.ts} +2 -33
- package/dist/{index-DkqggaxV.d.ts → index-CF4nEkOi.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/kind-definition.d.ts +1 -1
- package/dist/resource-core-C8IonwKw.d.ts +41 -0
- package/dist/resource-core.d.ts +3 -3
- package/dist/resource-core.js +90 -4
- 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-t2lJrIJe.js → src-3pnDAjBD.js} +1 -1
- package/dist/{src-m2ZrS5dQ.js → src-CaQ25rMj.js} +1 -1
- package/dist/{src-DvYk6l4v.js → src-D3qSzGFn.js} +96 -290
- package/dist/system-skills/resource-dsl/documents.md +15 -25
- package/dist/system-skills/resource-dsl/files.md +2 -0
- package/dist/system-skills/sys-halfcode-resource-dsl.plan.js +8 -8
- package/package.json +1 -1
- package/dist/resource-core-zEONBZ_o.d.ts +0 -20
|
@@ -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-3pnDAjBD.js";
|
|
2
2
|
export { ObjectOperationContractError, applicationAssemblyPackage, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, loadApplicationAssembly, resolveApplicationAssembly, resourceRefToFqn };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ApplicationAssembly } from "./index-Cqh9pEBa.js";
|
|
2
|
-
import { t as ResourceRegistry } from "./index-
|
|
2
|
+
import { t as ResourceRegistry } from "./index-CF4nEkOi.js";
|
|
3
3
|
//#region ../compiler-skill/src/index.d.ts
|
|
4
4
|
interface SkillDescriptor {
|
|
5
5
|
name: string;
|
|
@@ -103,38 +103,8 @@ declare function sha256Digest(value: string | Uint8Array): Sha256Digest;
|
|
|
103
103
|
declare function createResourceContentIdentity(input: CreateResourceContentIdentityInput): ResourceContentIdentity;
|
|
104
104
|
declare function buildResourceDependencySnapshot(input: BuildResourceDependencySnapshotInput): ResourceDependencySnapshot;
|
|
105
105
|
//#endregion
|
|
106
|
-
//#region ../resource-core/src/code-package.d.ts
|
|
107
|
-
declare const CODE_PACKAGE_ENTRY_CONTRIBUTION_KEY = "code-binding:module";
|
|
108
|
-
interface CodePackageBinding {
|
|
109
|
-
readonly resourceId: string;
|
|
110
|
-
readonly moduleUri: string;
|
|
111
|
-
readonly exportName?: string;
|
|
112
|
-
}
|
|
113
|
-
interface LoadedCodePackageModule {
|
|
114
|
-
readonly resourceId: string;
|
|
115
|
-
readonly binding: CodePackageBinding;
|
|
116
|
-
readonly revision: string;
|
|
117
|
-
readonly moduleNamespace: Readonly<Record<string, unknown>>;
|
|
118
|
-
}
|
|
119
|
-
interface LoadCodePackageModuleInput {
|
|
120
|
-
readonly tree: LoadedResourceTree;
|
|
121
|
-
readonly resourceId: string;
|
|
122
|
-
readonly rootDir: string;
|
|
123
|
-
}
|
|
124
|
-
interface CodePackageExportContract<T> {
|
|
125
|
-
isDefinition(value: unknown): value is T;
|
|
126
|
-
identityOf(value: T): string;
|
|
127
|
-
}
|
|
128
|
-
declare class CodePackageLoadError extends Error {
|
|
129
|
-
readonly diagnostics: readonly ResourceDiagnostic[];
|
|
130
|
-
constructor(diagnostics: readonly ResourceDiagnostic[]);
|
|
131
|
-
}
|
|
132
|
-
declare function loadCodePackageModule(input: LoadCodePackageModuleInput): Promise<LoadedCodePackageModule>;
|
|
133
|
-
declare function admitCodePackageExports<T>(loaded: LoadedCodePackageModule, contract: CodePackageExportContract<T>): readonly T[];
|
|
134
|
-
declare function admitCodePackages<T>(loaded: readonly LoadedCodePackageModule[], contract: CodePackageExportContract<T>): readonly T[];
|
|
135
|
-
//#endregion
|
|
136
106
|
//#region ../resource-core/src/index.d.ts
|
|
137
|
-
type SourceShape = "single-file" | "directory" | "manifest"
|
|
107
|
+
type SourceShape = "single-file" | "directory" | "manifest";
|
|
138
108
|
interface ResourceIdentity {
|
|
139
109
|
kind: string;
|
|
140
110
|
fqn?: string;
|
|
@@ -194,7 +164,6 @@ interface ResourceTree {
|
|
|
194
164
|
}
|
|
195
165
|
interface LoadedResourceTree extends ResourceTree {
|
|
196
166
|
readonly contentIdentities: ReadonlyMap<string, ResourceContentIdentity>;
|
|
197
|
-
readonly codePackageBindings: ReadonlyMap<string, CodePackageBinding>;
|
|
198
167
|
}
|
|
199
168
|
interface ResourceDiagnostic {
|
|
200
169
|
code: string;
|
|
@@ -220,4 +189,4 @@ declare class ResourceValidationError extends Error {
|
|
|
220
189
|
declare function loadResourceTree(options: LoadResourceTreeOptions): Promise<LoadedResourceTree>;
|
|
221
190
|
declare function validateResourceTree(options: LoadResourceTreeOptions): Promise<ResourceDiagnostic[]>;
|
|
222
191
|
//#endregion
|
|
223
|
-
export {
|
|
192
|
+
export { buildResourceDependencySnapshot as A, ResourceTombstone as B, BuildResourceDependencySnapshotInput as C, ResourceDependencySnapshot as D, ResourceDependencyEdge as E, EffectiveResourceEntry as F, composeLayeredResourceRegistry as H, EffectiveResourceRegistry as I, ResourceLayerDescriptor as L, sha256Digest as M, ComposeLayeredResourceRegistryInput as N, ResourceDigestContribution as O, EffectiveKindDefinition as P, ResourceLayerInput as R, validateResourceTree as S, ResourceContentIdentity as T, Sha256Digest as U, ResourceTombstoneOrigin as V, ResourceValue as _, ResourceDescriptor as a, SourceShape as b, ResourceKindContract as c, ResourceRecord as d, ResourceRegistry as f, ResourceValidationError as g, ResourceTreeBuildResult as h, RegisteredKindDefinition as i, createResourceContentIdentity as j, SnapshotResource as k, ResourceMetadata as l, ResourceTree as m, LoadedResourceTree as n, ResourceDiagnostic as o, ResourceScalar as p, LoadedResourceTreeBuildResult as r, ResourceIdentity as s, LoadResourceTreeOptions as t, ResourceNode as u, ResourceValueList as v, CreateResourceContentIdentityInput as w, loadResourceTree as x, ResourceValueMap as y, ResourceOrigin as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ResourceDescriptor } from "./index-
|
|
1
|
+
import { a as ResourceDescriptor } from "./index-CDIT65pI.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,9 +1,9 @@
|
|
|
1
1
|
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-Cqh9pEBa.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import {
|
|
4
|
-
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 { A as buildResourceDependencySnapshot, B as ResourceTombstone, C as BuildResourceDependencySnapshotInput, D as ResourceDependencySnapshot, E as ResourceDependencyEdge, F as EffectiveResourceEntry, H as composeLayeredResourceRegistry, I as EffectiveResourceRegistry, L as ResourceLayerDescriptor, M as sha256Digest, N as ComposeLayeredResourceRegistryInput, O as ResourceDigestContribution, P as EffectiveKindDefinition, R as ResourceLayerInput, S as validateResourceTree, T as ResourceContentIdentity, U as Sha256Digest, V as ResourceTombstoneOrigin, _ as ResourceValue, a as ResourceDescriptor, b as SourceShape, c as ResourceKindContract, d as ResourceRecord, f as ResourceRegistry, g as ResourceValidationError, h as ResourceTreeBuildResult, i as RegisteredKindDefinition, j as createResourceContentIdentity, k as SnapshotResource, l as ResourceMetadata, m as ResourceTree, n as LoadedResourceTree, o as ResourceDiagnostic, p as ResourceScalar, r as LoadedResourceTreeBuildResult, s as ResourceIdentity, t as LoadResourceTreeOptions, u as ResourceNode, v as ResourceValueList, w as CreateResourceContentIdentityInput, x as loadResourceTree, y as ResourceValueMap, z as ResourceOrigin } from "./index-CDIT65pI.js";
|
|
3
|
+
import { a as ResolveEffectiveResourceContentIdentitiesInput, c as ResourceCompositionError, i as readResourceMaterial, n as ResourceMaterial, o as ResourceLayerContentIdentityInput, r as ResourceMaterialError, s as resolveEffectiveResourceContentIdentities, t as ReadResourceMaterialInput } from "./resource-core-C8IonwKw.js";
|
|
4
|
+
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-B515mMkO.js";
|
|
5
5
|
//#region src/bundled-system-skills.d.ts
|
|
6
6
|
declare function loadHalfcodeResourceDslSystemSkillModule(): AuthoringModuleDescriptor;
|
|
7
7
|
declare function loadHalfcodeResourceDslSystemSkillPlan(): Promise<SkillCapsuleDistributionPlan>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { type ApplicationAssembly, type ApplicationScope, ApplySkillCapsuleDistributionOptions, type AssemblyPort, type AssemblyPortBinding, type AssemblyResource, type AuthoringModuleDescriptor, BuildResourceDependencySnapshotInput, type BusinessObjectResource, type BusinessObjectSopResource,
|
|
9
|
+
export { type ApplicationAssembly, type ApplicationScope, ApplySkillCapsuleDistributionOptions, type AssemblyPort, type AssemblyPortBinding, type AssemblyResource, type AuthoringModuleDescriptor, BuildResourceDependencySnapshotInput, type BusinessObjectResource, type BusinessObjectSopResource, type CodeBinding, CompileResourceSkillCapsuleInput, CompileSkillCapsuleInput, ComposeLayeredResourceRegistryInput, type ContractedCallableResource, CreateResourceContentIdentityInput, EffectiveKindDefinition, EffectiveResourceEntry, EffectiveResourceRegistry, type ExecuteObjectOperationRequest, type JsonObject, type JsonPrimitive, type JsonValue, type LoadApplicationAssemblyOptions, LoadResourceTreeOptions, LoadedResourceTree, LoadedResourceTreeBuildResult, 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, ReadResourceMaterialInput, RegisteredKindDefinition, type ResolveApplicationAssemblyOptions, ResolveEffectiveResourceContentIdentitiesInput, type ResolvedAssemblyPortBinding, ResourceCompositionError, ResourceContentIdentity, ResourceDependencyEdge, ResourceDependencySnapshot, ResourceDescriptor, ResourceDiagnostic, ResourceDigestContribution, ResourceIdentity, type ResourceInclude, ResourceKindContract, ResourceLayerContentIdentityInput, ResourceLayerDescriptor, ResourceLayerInput, ResourceMaterial, ResourceMaterialError, ResourceMetadata, ResourceNode, ResourceOrigin, ResourceRecord, ResourceRegistry, ResourceScalar, type ResourceSource, 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, type TextMaterial, type TextResource, applicationAssemblyPackage, applySkillCapsuleDistributionPlan, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, buildResourceDependencySnapshot, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, composeLayeredResourceRegistry, createResourceContentIdentity, loadApplicationAssembly, loadHalfcodeResourceDslSystemSkillModule, loadHalfcodeResourceDslSystemSkillPlan, loadResourceTree, planSkillCapsuleDistribution, readResourceMaterial, resolveApplicationAssembly, resolveEffectiveResourceContentIdentities, resourceRefToFqn, sha256Digest, skillCapsuleDistributionProjection, validateResourceTree };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
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 { c as sha256Digest, f as ResourceCompositionError, n as loadResourceTree, o as buildResourceDependencySnapshot, r as validateResourceTree, s as createResourceContentIdentity, t as ResourceValidationError } from "./src-D3qSzGFn.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-3pnDAjBD.js";
|
|
3
3
|
import "./application-assembly.js";
|
|
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-
|
|
4
|
+
import { ResourceMaterialError, composeLayeredResourceRegistry, readResourceMaterial, 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-CaQ25rMj.js";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
//#region src/bundled-system-skills.ts
|
|
8
8
|
function loadHalfcodeResourceDslSystemSkillModule() {
|
|
@@ -20,4 +20,4 @@ async function loadHalfcodeResourceDslSystemSkillPlan() {
|
|
|
20
20
|
return bundled.default;
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
|
-
export {
|
|
23
|
+
export { ObjectOperationContractError, ResourceCompositionError, ResourceMaterialError, ResourceValidationError, SkillCapsuleDistributionError, applicationAssemblyPackage, applySkillCapsuleDistributionPlan, assertExecuteObjectOperationRequest, assertObjectOperationCall, assertObjectOperationCatalog, assertObjectOperationDefinition, buildResourceDependencySnapshot, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, composeLayeredResourceRegistry, createResourceContentIdentity, loadApplicationAssembly, loadHalfcodeResourceDslSystemSkillModule, loadHalfcodeResourceDslSystemSkillPlan, loadResourceTree, planSkillCapsuleDistribution, readResourceMaterial, resolveApplicationAssembly, resolveEffectiveResourceContentIdentities, resourceRefToFqn, sha256Digest, skillCapsuleDistributionProjection, validateResourceTree };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ResourceDescriptor, c as ResourceKindContract } from "./index-
|
|
1
|
+
import { a as ResourceDescriptor, c as ResourceKindContract } from "./index-CDIT65pI.js";
|
|
2
2
|
//#region ../kind-definition/src/index.d.ts
|
|
3
3
|
interface KindDefinition extends ResourceDescriptor, ResourceKindContract {
|
|
4
4
|
kind: "KindDefinition";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { I as EffectiveResourceRegistry, O as ResourceDigestContribution, T as ResourceContentIdentity, n as LoadedResourceTree, o as ResourceDiagnostic } from "./index-CDIT65pI.js";
|
|
2
|
+
//#region ../resource-core/src/composition-error.d.ts
|
|
3
|
+
declare class ResourceCompositionError extends Error {
|
|
4
|
+
readonly diagnostics: readonly ResourceDiagnostic[];
|
|
5
|
+
constructor(diagnostics: readonly ResourceDiagnostic[]);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../resource-core/src/effective-content-identities.d.ts
|
|
9
|
+
interface ResourceLayerContentIdentityInput {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly tree: LoadedResourceTree;
|
|
12
|
+
}
|
|
13
|
+
interface ResolveEffectiveResourceContentIdentitiesInput {
|
|
14
|
+
readonly registry: EffectiveResourceRegistry;
|
|
15
|
+
readonly layers: readonly ResourceLayerContentIdentityInput[];
|
|
16
|
+
readonly contributions?: ReadonlyMap<string, readonly ResourceDigestContribution[]>;
|
|
17
|
+
}
|
|
18
|
+
declare function resolveEffectiveResourceContentIdentities(input: ResolveEffectiveResourceContentIdentitiesInput): ReadonlyMap<string, ResourceContentIdentity>;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ../resource-core/src/resource-material.d.ts
|
|
21
|
+
interface ReadResourceMaterialInput {
|
|
22
|
+
readonly tree: LoadedResourceTree;
|
|
23
|
+
readonly rootDir: string;
|
|
24
|
+
readonly resourceId: string;
|
|
25
|
+
readonly uri: string;
|
|
26
|
+
}
|
|
27
|
+
interface ResourceMaterial {
|
|
28
|
+
readonly resourceId: string;
|
|
29
|
+
readonly uri: string;
|
|
30
|
+
readonly sourceUri: string;
|
|
31
|
+
readonly digest: string;
|
|
32
|
+
readonly contribution: ResourceDigestContribution;
|
|
33
|
+
bytes(): Uint8Array;
|
|
34
|
+
}
|
|
35
|
+
declare class ResourceMaterialError extends Error {
|
|
36
|
+
readonly diagnostics: readonly ResourceDiagnostic[];
|
|
37
|
+
constructor(diagnostics: readonly ResourceDiagnostic[]);
|
|
38
|
+
}
|
|
39
|
+
declare function readResourceMaterial(input: ReadResourceMaterialInput): Promise<ResourceMaterial>;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ResolveEffectiveResourceContentIdentitiesInput as a, ResourceCompositionError as c, readResourceMaterial as i, ResourceMaterial as n, ResourceLayerContentIdentityInput as o, ResourceMaterialError as r, resolveEffectiveResourceContentIdentities as s, ReadResourceMaterialInput as t };
|
package/dist/resource-core.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
3
|
-
export { BuildResourceDependencySnapshotInput,
|
|
1
|
+
import { A as buildResourceDependencySnapshot, B as ResourceTombstone, C as BuildResourceDependencySnapshotInput, D as ResourceDependencySnapshot, E as ResourceDependencyEdge, F as EffectiveResourceEntry, H as composeLayeredResourceRegistry, I as EffectiveResourceRegistry, L as ResourceLayerDescriptor, M as sha256Digest, N as ComposeLayeredResourceRegistryInput, O as ResourceDigestContribution, P as EffectiveKindDefinition, R as ResourceLayerInput, S as validateResourceTree, T as ResourceContentIdentity, U as Sha256Digest, V as ResourceTombstoneOrigin, _ as ResourceValue, a as ResourceDescriptor, b as SourceShape, c as ResourceKindContract, d as ResourceRecord, f as ResourceRegistry, g as ResourceValidationError, h as ResourceTreeBuildResult, i as RegisteredKindDefinition, j as createResourceContentIdentity, k as SnapshotResource, l as ResourceMetadata, m as ResourceTree, n as LoadedResourceTree, o as ResourceDiagnostic, p as ResourceScalar, r as LoadedResourceTreeBuildResult, s as ResourceIdentity, t as LoadResourceTreeOptions, u as ResourceNode, v as ResourceValueList, w as CreateResourceContentIdentityInput, x as loadResourceTree, y as ResourceValueMap, z as ResourceOrigin } from "./index-CDIT65pI.js";
|
|
2
|
+
import { a as ResolveEffectiveResourceContentIdentitiesInput, c as ResourceCompositionError, i as readResourceMaterial, n as ResourceMaterial, o as ResourceLayerContentIdentityInput, r as ResourceMaterialError, s as resolveEffectiveResourceContentIdentities, t as ReadResourceMaterialInput } from "./resource-core-C8IonwKw.js";
|
|
3
|
+
export { BuildResourceDependencySnapshotInput, ComposeLayeredResourceRegistryInput, CreateResourceContentIdentityInput, EffectiveKindDefinition, EffectiveResourceEntry, EffectiveResourceRegistry, LoadResourceTreeOptions, LoadedResourceTree, LoadedResourceTreeBuildResult, ReadResourceMaterialInput, RegisteredKindDefinition, ResolveEffectiveResourceContentIdentitiesInput, ResourceCompositionError, ResourceContentIdentity, ResourceDependencyEdge, ResourceDependencySnapshot, ResourceDescriptor, ResourceDiagnostic, ResourceDigestContribution, ResourceIdentity, ResourceKindContract, ResourceLayerContentIdentityInput, ResourceLayerDescriptor, ResourceLayerInput, ResourceMaterial, ResourceMaterialError, ResourceMetadata, ResourceNode, ResourceOrigin, ResourceRecord, ResourceRegistry, ResourceScalar, ResourceTombstone, ResourceTombstoneOrigin, ResourceTree, ResourceTreeBuildResult, ResourceValidationError, ResourceValue, ResourceValueList, ResourceValueMap, type Sha256Digest, SnapshotResource, SourceShape, buildResourceDependencySnapshot, composeLayeredResourceRegistry, createResourceContentIdentity, loadResourceTree, readResourceMaterial, resolveEffectiveResourceContentIdentities, sha256Digest, validateResourceTree };
|
package/dist/resource-core.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as isLoadedResourceTreeAuthentic, c as sha256Digest, d as markEffectiveRegistryAuthentic, f as ResourceCompositionError, i as readonlyMap, l as effectiveRegistryLayerBindings, m as digestCanonical, n as loadResourceTree, o as buildResourceDependencySnapshot, p as compareCodeUnits, r as validateResourceTree, s as createResourceContentIdentity, t as ResourceValidationError, u as isEffectiveRegistryAuthentic } from "./src-D3qSzGFn.js";
|
|
2
|
+
import { lstat, readFile, realpath } from "node:fs/promises";
|
|
3
|
+
import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
2
4
|
//#region ../resource-core/src/layered-registry.ts
|
|
3
5
|
function composeLayeredResourceRegistry(input) {
|
|
4
6
|
const diagnostics = [];
|
|
@@ -400,10 +402,10 @@ function validateLoadedIdentityCoverage(tree, layerId, diagnostics) {
|
|
|
400
402
|
function validateEffectiveOrigin(entry, registry, tree, diagnostics) {
|
|
401
403
|
const origin = entry.effectiveOrigin;
|
|
402
404
|
const descriptor = registry.layers[origin.layerIndex];
|
|
403
|
-
const loadedRecord = findResource(tree, entry.resourceId);
|
|
405
|
+
const loadedRecord = findResource$1(tree, entry.resourceId);
|
|
404
406
|
if (!descriptor || descriptor.id !== origin.layerId || descriptor.packageId !== origin.packageId || tree.manifest.resourceId !== origin.packageId || !loadedRecord || loadedRecord.documentUri !== origin.documentUri || loadedRecord.logicalPath !== origin.logicalPath) diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_EFFECTIVE_ORIGIN_MISMATCH", contentLocation(entry.resourceId), `Effective resource '${entry.resourceId}' does not match its exact layer/package/origin facts.`));
|
|
405
407
|
}
|
|
406
|
-
function findResource(tree, resourceId) {
|
|
408
|
+
function findResource$1(tree, resourceId) {
|
|
407
409
|
for (const records of tree.registry.byKind.values()) {
|
|
408
410
|
const resource = records.find((record) => record.resourceId === resourceId);
|
|
409
411
|
if (resource) return resource;
|
|
@@ -429,4 +431,88 @@ function contentLocation(resourceId) {
|
|
|
429
431
|
return `content:${resourceId || "unnamed"}`;
|
|
430
432
|
}
|
|
431
433
|
//#endregion
|
|
432
|
-
|
|
434
|
+
//#region ../resource-core/src/resource-material.ts
|
|
435
|
+
var ResourceMaterialError = class extends Error {
|
|
436
|
+
diagnostics;
|
|
437
|
+
constructor(diagnostics) {
|
|
438
|
+
super(`Resource material read failed with ${diagnostics.length} diagnostic(s)`);
|
|
439
|
+
this.name = "ResourceMaterialError";
|
|
440
|
+
this.diagnostics = Object.freeze([...diagnostics].sort((left, right) => compareCodeUnits(left.location, right.location) || compareCodeUnits(left.code, right.code)));
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
async function readResourceMaterial(input) {
|
|
444
|
+
if (!isLoadedResourceTreeAuthentic(input.tree)) throw materialError("RESOURCE_MATERIAL_TREE_UNTRUSTED", input.resourceId, "Resource materials require an authentic LoadedResourceTree.");
|
|
445
|
+
const record = findResource(input.tree, input.resourceId);
|
|
446
|
+
const identity = input.tree.contentIdentities.get(input.resourceId);
|
|
447
|
+
if (!record || record.sourceShape !== "directory" || !identity) throw materialError("RESOURCE_MATERIAL_RESOURCE_INVALID", input.resourceId, `Resource '${input.resourceId}' is not an authentic directory resource.`);
|
|
448
|
+
const materialPath = materialRelativePath(input.uri);
|
|
449
|
+
if (!materialPath) throw materialError("RESOURCE_MATERIAL_URI_INVALID", input.resourceId, "Resource material URI must be a non-empty lexical-safe vfs://./ reference.");
|
|
450
|
+
const requestedRoot = resolve(input.rootDir);
|
|
451
|
+
const root = await realpath(requestedRoot).catch(() => requestedRoot);
|
|
452
|
+
const authorityCandidate = resolve(root, record.logicalPath);
|
|
453
|
+
const authorityPath = await realpath(authorityCandidate).catch(() => authorityCandidate);
|
|
454
|
+
if (!contains(root, authorityPath) || record.documentUri !== documentUri(root, authorityPath) || sha256Digest(await readFile(authorityPath).catch(() => /* @__PURE__ */ new Uint8Array())) !== identity.authorityDigest) throw materialError("RESOURCE_MATERIAL_AUTHORITY_MISMATCH", input.resourceId, "Directory resource authority does not match the loaded tree provenance.");
|
|
455
|
+
const ownerDirectory = dirname(authorityPath);
|
|
456
|
+
const candidate = resolve(ownerDirectory, materialPath);
|
|
457
|
+
if (!contains(ownerDirectory, candidate)) throw materialError("RESOURCE_MATERIAL_URI_INVALID", input.resourceId, "Resource material URI escapes its owning directory resource.");
|
|
458
|
+
const before = await lstat(candidate).catch(() => void 0);
|
|
459
|
+
if (!before) throw materialError("RESOURCE_MATERIAL_MISSING", input.resourceId, `Resource material '${input.uri}' does not exist.`);
|
|
460
|
+
if (before.isSymbolicLink()) throw materialError("RESOURCE_MATERIAL_SYMLINK_UNSUPPORTED", input.resourceId, `Resource material '${input.uri}' must not be a symbolic link.`);
|
|
461
|
+
if (!before.isFile()) throw materialError("RESOURCE_MATERIAL_NOT_FILE", input.resourceId, `Resource material '${input.uri}' must be a regular file.`);
|
|
462
|
+
const canonicalPath = await realpath(candidate).catch(() => candidate);
|
|
463
|
+
if (!contains(ownerDirectory, canonicalPath)) throw materialError("RESOURCE_MATERIAL_CONTAINMENT", input.resourceId, `Resource material '${input.uri}' resolves outside its owning directory resource.`);
|
|
464
|
+
const source = await readFile(canonicalPath).catch(() => void 0);
|
|
465
|
+
const after = await lstat(candidate).catch(() => void 0);
|
|
466
|
+
const afterCanonical = await realpath(candidate).catch(() => void 0);
|
|
467
|
+
if (!source || !after || after.isSymbolicLink() || !after.isFile() || afterCanonical !== canonicalPath) throw materialError("RESOURCE_MATERIAL_CHANGED", input.resourceId, `Resource material '${input.uri}' changed while it was being read.`);
|
|
468
|
+
const bytes = new Uint8Array(source);
|
|
469
|
+
const digest = sha256Digest(bytes);
|
|
470
|
+
const sourceUri = documentUri(root, canonicalPath);
|
|
471
|
+
const contribution = Object.freeze({
|
|
472
|
+
key: `material:${input.uri}`,
|
|
473
|
+
digest,
|
|
474
|
+
sourceUri
|
|
475
|
+
});
|
|
476
|
+
return Object.freeze({
|
|
477
|
+
resourceId: input.resourceId,
|
|
478
|
+
uri: input.uri,
|
|
479
|
+
sourceUri,
|
|
480
|
+
digest,
|
|
481
|
+
contribution,
|
|
482
|
+
bytes: () => new Uint8Array(bytes)
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
function materialRelativePath(uri) {
|
|
486
|
+
const match = /^vfs:\/\/\.\/(.+)$/u.exec(uri);
|
|
487
|
+
if (!match || /%2f|%5c/i.test(uri)) return void 0;
|
|
488
|
+
let decoded;
|
|
489
|
+
try {
|
|
490
|
+
decoded = decodeURIComponent(match[1]);
|
|
491
|
+
} catch {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const segments = decoded.split(/[\\/]+/u);
|
|
495
|
+
if (isAbsolute(decoded) || decoded.includes("\\") || segments.some((segment) => !segment || segment === "." || segment === "..")) return void 0;
|
|
496
|
+
return segments.join(sep);
|
|
497
|
+
}
|
|
498
|
+
function findResource(tree, resourceId) {
|
|
499
|
+
for (const records of tree.registry.byKind.values()) {
|
|
500
|
+
const record = records.find((item) => item.resourceId === resourceId);
|
|
501
|
+
if (record) return record;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
function contains(boundary, candidate) {
|
|
505
|
+
return candidate === boundary || candidate.startsWith(`${boundary}${sep}`);
|
|
506
|
+
}
|
|
507
|
+
function documentUri(root, filePath) {
|
|
508
|
+
return `vfs://@/${relative(root, filePath).split(sep).join("/")}`;
|
|
509
|
+
}
|
|
510
|
+
function materialError(code, resourceId, message) {
|
|
511
|
+
return new ResourceMaterialError([Object.freeze({
|
|
512
|
+
code,
|
|
513
|
+
location: `resource-material:${resourceId || "unknown"}`,
|
|
514
|
+
message
|
|
515
|
+
})]);
|
|
516
|
+
}
|
|
517
|
+
//#endregion
|
|
518
|
+
export { ResourceCompositionError, ResourceMaterialError, ResourceValidationError, buildResourceDependencySnapshot, composeLayeredResourceRegistry, createResourceContentIdentity, loadResourceTree, readResourceMaterial, resolveEffectiveResourceContentIdentities, sha256Digest, validateResourceTree };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as resourceProjectionPackage, t as ResourceRegistry } from "./index-
|
|
1
|
+
import { n as resourceProjectionPackage, t as ResourceRegistry } from "./index-CF4nEkOi.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-Cqh9pEBa.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-B515mMkO.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-CaQ25rMj.js";
|
|
2
2
|
export { SkillCapsuleDistributionError, applySkillCapsuleDistributionPlan, compileResourceSkillCapsule, compileSkillCapsule, compilerSkillPackage, planSkillCapsuleDistribution, skillCapsuleDistributionProjection };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as resourceRefToFqn, u as resolveObjectOperationCompilation } from "./src-
|
|
1
|
+
import { l as resourceRefToFqn, u as resolveObjectOperationCompilation } from "./src-3pnDAjBD.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";
|