halfcode-compiler.xnl 0.2.9 → 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/README.md +5 -3
- package/dist/application-assembly.d.ts +3 -2
- package/dist/application-assembly.js +2 -2
- package/dist/authoring-runtime.d.ts +30 -9
- package/dist/authoring-runtime.js +2 -2
- package/dist/code-execution-closure-CXORuheJ.d.ts +59 -0
- package/dist/{effective-content-identities-DV5fTr5Q.js → effective-content-identities-CV6XFBZy.js} +8 -8
- package/dist/{effective-content-identities-CSVFi-N5.d.ts → effective-content-identities-Cf0ygCXk.d.ts} +2 -2
- package/dist/{index-B515mMkO.d.ts → index-B9Pp3Zgj.d.ts} +10 -6
- package/dist/index-By8x4reS.d.ts +443 -0
- package/dist/{index-CF4nEkOi.d.ts → index-Csi_AIoU.d.ts} +1 -1
- package/dist/{index-Cqh9pEBa.d.ts → index-DEikbOFh.d.ts} +2 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.js +6 -5
- package/dist/kind-definition.d.ts +118 -10
- package/dist/kind-definition.js +826 -15
- package/dist/resource-core-CoTu6FNS.d.ts +48 -0
- package/dist/resource-core.d.ts +5 -4
- package/dist/resource-core.js +25 -11
- 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 +2 -2
- package/dist/skill-capsule.js +1 -1
- package/dist/{src-3pnDAjBD.js → src-BX7wrSq1.js} +330 -8
- package/dist/{src-3MZLm339.js → src-MPJZB76z.js} +122 -20
- package/dist/{src-CaQ25rMj.js → src-QI7NRyC8.js} +11 -7
- package/dist/{src-D3qSzGFn.js → src-jggOQtq3.js} +511 -113
- package/dist/system-skills/resource-dsl/KindDefinitions/SkillCapsule/manifest.xnl +15 -3
- package/dist/system-skills/resource-dsl/KindDefinitions/WikiPage/manifest.xnl +15 -3
- package/dist/system-skills/resource-dsl/SkillCapsules/System/SKILL.metadata.yaml +1 -0
- package/dist/system-skills/resource-dsl/SkillCapsules/System/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/SkillCapsules/System/resource-mappings.xnl +1 -1
- package/dist/system-skills/resource-dsl/WikiPages/documents/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/WikiPages/files/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/WikiPages/index/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/WikiPages/language/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/WikiPages/migration/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/WikiPages/projections/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/WikiPages/skill-capsules/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/documents.md +33 -17
- package/dist/system-skills/resource-dsl/examples/function.xnl +1 -1
- package/dist/system-skills/resource-dsl/examples/kind-definition.xnl +15 -3
- package/dist/system-skills/resource-dsl/examples/resource-mappings.xnl +1 -1
- package/dist/system-skills/resource-dsl/examples/resource-package.xnl +1 -1
- package/dist/system-skills/resource-dsl/examples/skill-capsule-authoring.xnl +1 -1
- package/dist/system-skills/resource-dsl/examples/skill-capsule-devops.xnl +1 -1
- package/dist/system-skills/resource-dsl/examples/skill-capsule-kind-definition.xnl +14 -3
- package/dist/system-skills/resource-dsl/examples/skill-capsule-resource-dsl.xnl +1 -1
- package/dist/system-skills/resource-dsl/examples/skill-capsule-run.xnl +1 -1
- package/dist/system-skills/resource-dsl/index.md +5 -5
- package/dist/system-skills/resource-dsl/language.md +10 -8
- package/dist/system-skills/resource-dsl/manifest.xnl +1 -1
- package/dist/system-skills/resource-dsl/migration.md +6 -3
- package/dist/system-skills/resource-dsl/projections.md +7 -6
- package/dist/system-skills/resource-dsl/skill-capsules.md +8 -7
- package/dist/system-skills/sys-halfcode-resource-dsl.plan.js +84 -59
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/index-CDIT65pI.d.ts +0 -192
- package/dist/resource-core-C0Fj-VJA.d.ts +0 -29
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ const plan: SkillCapsuleDistributionPlan = await planSkillCapsuleDistribution({
|
|
|
34
34
|
await applySkillCapsuleDistributionPlan(plan, { outputRoot })
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Each capsule identity includes the
|
|
37
|
+
Each capsule source identity includes the resource `envelopeVersion` and exact writer `specVersion`. Skill SemVer remains a separate Skill-owned business field. The planner generates exactly one `references/.halfcode/provenance.json` per capsule with those source facts, the Skill version, the `halfcode.skill-distribution/v1` generator and every payload file digest. The applier reconstructs and validates this manifest before any target mutation.
|
|
38
38
|
|
|
39
39
|
The legacy `compileSkillCapsule` and `compileResourceSkillCapsule` APIs remain available from both the package root and `halfcode-compiler.xnl/skill-capsule`. The subpath also exports the new plan/apply APIs and `SkillCapsuleDependency` type.
|
|
40
40
|
|
|
@@ -65,8 +65,10 @@ import {
|
|
|
65
65
|
} from "halfcode-compiler.xnl/resource-core"
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
`loadResourceTree()` returns an
|
|
68
|
+
`loadResourceTree()` returns an `AuthoredResourceTree`; its content identities come from the same raw-byte read used for fatal UTF-8 decoding and XNL/Markdown parsing. Markdown records preserve every body code unit after the closing frontmatter delimiter and exactly one separator newline as `node.text`/`authoredSpec.text`. `resolveResourceTree()` admits the authored tree against an exact reader profile and publishes a distinct `ResolvedResourceTree` with ordinary receipts for the package manifest, KindDefinition authorities and business resources.
|
|
69
69
|
|
|
70
|
-
Layer order, tombstones, dependency edges, and digest contributions are explicit caller-owned facts. Resource core does not assign semantics to layer names, infer dependencies from arbitrary strings, or own host installation paths.
|
|
70
|
+
Layer order, tombstones, dependency edges, and digest contributions are explicit caller-owned facts. Resource core does not assign semantics to layer names, infer dependencies from arbitrary strings, or own host installation paths. Content-sensitive projection requires authentic `AuthoredResourceTree` inputs from the canonical loader.
|
|
71
|
+
|
|
72
|
+
The immutable `RESOURCE_ENVELOPE_CONTRACT` and derived `RESOURCE_ENVELOPE_FINGERPRINT` are the sole public authority for envelope v1 decoding, authority formats, identity projection, Catalog traversal and authored-spec projection. `CORE_KIND_SUBJECT_OWNERS`, `CORE_KIND_SPEC_REVISIONS` and `CORE_KIND_READER_REGISTRATIONS` provide the compiler-owned exact ResourcePackage and KindDefinition bootstrap registrations; hosts admit them verbatim rather than recreating their fingerprints or readers.
|
|
71
73
|
|
|
72
74
|
`EffectiveResourceRegistry.compositionRevision` binds ordered identity/presence/layer/shadow/tombstone, selected KindDefinition authority identity/contract, and canonical logical-origin facts, but deliberately excludes descriptor/node/metadata bytes; its `revision` field remains an exact compatibility alias. Snapshot construction accepts only the immutable registry returned by the canonical composer, copies/freeze its own origin facts, and rejects inconsistent structural projections. `ResourceDependencySnapshot.registryRevision` additionally binds the revalidated content digests of every effective resource, while `snapshotRevision` binds the selected roots, reachable closure, and participating typed edges. Duplicate contribution keys fail closed, and all canonical ordering uses fixed UTF-16 code-unit order rather than locale-dependent sorting.
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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";
|
|
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";
|
|
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 {
|
|
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";
|
|
@@ -22,7 +24,8 @@ interface ResourceAuthoringProposal {
|
|
|
22
24
|
readonly catalogId: string;
|
|
23
25
|
readonly resourceId: string;
|
|
24
26
|
readonly kind: string;
|
|
25
|
-
readonly
|
|
27
|
+
readonly envelopeVersion: typeof RESOURCE_ENVELOPE_VERSION;
|
|
28
|
+
readonly writerSpecVersion: SpecVersion;
|
|
26
29
|
readonly sourceShape: ResourceAuthoringSourceShape;
|
|
27
30
|
readonly documentUri: ResourceAuthoringDocumentUri;
|
|
28
31
|
readonly authorityText: string;
|
|
@@ -30,7 +33,7 @@ interface ResourceAuthoringProposal {
|
|
|
30
33
|
}
|
|
31
34
|
interface ResourceAuthoringKindDefinition {
|
|
32
35
|
readonly kind: string;
|
|
33
|
-
readonly
|
|
36
|
+
readonly specRevisions: readonly KindSpecRevisionDescriptor[];
|
|
34
37
|
readonly sourceShapes: readonly ResourceAuthoringSourceShape[];
|
|
35
38
|
readonly documentCardinality: "one" | "many";
|
|
36
39
|
}
|
|
@@ -50,7 +53,8 @@ type ResourceAuthoringPlanningConfig = Readonly<Record<never, never>>;
|
|
|
50
53
|
interface ResourceAuthoringInspectedRoot {
|
|
51
54
|
readonly resourceId: string;
|
|
52
55
|
readonly kind: string;
|
|
53
|
-
readonly
|
|
56
|
+
readonly envelopeVersion: string;
|
|
57
|
+
readonly writerSpecVersion: SpecVersion;
|
|
54
58
|
}
|
|
55
59
|
interface ResourceAuthoringAuthorityInspection {
|
|
56
60
|
readonly documentUri: ResourceAuthoringDocumentUri;
|
|
@@ -71,6 +75,7 @@ interface ResourceAuthoringPlan {
|
|
|
71
75
|
readonly schemaVersion: typeof RESOURCE_AUTHORING_SCHEMA_VERSION;
|
|
72
76
|
readonly proposal: ResourceAuthoringProposal;
|
|
73
77
|
readonly kindDefinition: ResourceAuthoringKindDefinition;
|
|
78
|
+
readonly writerSpecRevision: KindSpecRevisionDescriptor;
|
|
74
79
|
readonly catalog: ResourceAuthoringCatalogBinding;
|
|
75
80
|
readonly resources: readonly ResourceAuthoringInspectedRoot[];
|
|
76
81
|
readonly authorityDigest: string;
|
|
@@ -86,7 +91,7 @@ interface ResourceAuthoringRefreshCandidate {
|
|
|
86
91
|
readonly transactionId: string;
|
|
87
92
|
readonly candidateId: string;
|
|
88
93
|
readonly targetLayerId: string;
|
|
89
|
-
readonly tree:
|
|
94
|
+
readonly tree: AuthoredResourceTree;
|
|
90
95
|
readonly registry: EffectiveResourceRegistry;
|
|
91
96
|
readonly layers: readonly ResourceLayerContentIdentityInput[];
|
|
92
97
|
}
|
|
@@ -105,7 +110,8 @@ interface ResourceAuthoringReceipt {
|
|
|
105
110
|
readonly catalogId: string;
|
|
106
111
|
readonly resourceId: string;
|
|
107
112
|
readonly kind: string;
|
|
108
|
-
readonly
|
|
113
|
+
readonly envelopeVersion: typeof RESOURCE_ENVELOPE_VERSION;
|
|
114
|
+
readonly writerSpecVersion: SpecVersion;
|
|
109
115
|
readonly sourceShape: ResourceAuthoringSourceShape;
|
|
110
116
|
readonly documentUri: ResourceAuthoringDocumentUri;
|
|
111
117
|
readonly authorityDigestBefore: string | null;
|
|
@@ -150,7 +156,7 @@ interface ResourceAuthoringRegistryRevisionInput {
|
|
|
150
156
|
readonly registry: EffectiveResourceRegistry;
|
|
151
157
|
readonly layers: readonly ResourceLayerContentIdentityInput[];
|
|
152
158
|
}
|
|
153
|
-
type ResourceAuthoringErrorCode = "RESOURCE_AUTHORING_INPUT_INVALID" | "RESOURCE_AUTHORING_KIND_UNKNOWN" | "
|
|
159
|
+
type ResourceAuthoringErrorCode = "RESOURCE_AUTHORING_INPUT_INVALID" | "RESOURCE_AUTHORING_KIND_UNKNOWN" | "RESOURCE_AUTHORING_WRITER_SPEC_VERSION_UNREGISTERED" | "RESOURCE_AUTHORING_SOURCE_SHAPE_UNSUPPORTED" | "RESOURCE_AUTHORING_CATALOG_UNKNOWN" | "RESOURCE_AUTHORING_CATALOG_MISMATCH" | "RESOURCE_AUTHORING_TARGET_UNSAFE" | "RESOURCE_AUTHORING_EXPECTED_STATE_INVALID" | "RESOURCE_AUTHORING_AUTHORITY_INVALID" | "RESOURCE_AUTHORING_PLAN_FORGED" | "RESOURCE_AUTHORING_CAS_CONFLICT" | "RESOURCE_AUTHORING_PREPARE_INVALID" | "RESOURCE_AUTHORING_REFRESH_INVALID" | "RESOURCE_AUTHORING_COMMIT_INVALID" | "RESOURCE_AUTHORING_ROLLBACK_FAILED";
|
|
154
160
|
declare class ResourceAuthoringError extends Error {
|
|
155
161
|
readonly code: ResourceAuthoringErrorCode;
|
|
156
162
|
readonly cause?: unknown | undefined;
|
|
@@ -161,4 +167,19 @@ declare function deriveResourceAuthoringRegistryRevision(input: ResourceAuthorin
|
|
|
161
167
|
declare function planResourceAuthoring(runtime: ResourceAuthoringPlanningRuntime, input: ResourceAuthoringProposal, _config: ResourceAuthoringPlanningConfig): ResourceAuthoringPlan;
|
|
162
168
|
declare function applyResourceAuthoring(runtime: ResourceAuthoringRuntime, input: ResourceAuthoringPlan, config: ApplyResourceAuthoringConfig): Promise<ResourceAuthoringReceipt>;
|
|
163
169
|
//#endregion
|
|
164
|
-
|
|
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 };
|
package/dist/{effective-content-identities-DV5fTr5Q.js → effective-content-identities-CV6XFBZy.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as compareCodeUnits, _ as effectiveRegistryLayerBindings, b as ResourceCompositionError, f as readonlyMap, h as createResourceContentIdentity, p as isAuthoredResourceTreeAuthentic, v as isEffectiveRegistryAuthentic } from "./src-jggOQtq3.js";
|
|
2
2
|
//#region ../resource-core/src/effective-content-identities.ts
|
|
3
3
|
function resolveEffectiveResourceContentIdentities(input) {
|
|
4
4
|
const diagnostics = [];
|
|
@@ -11,8 +11,8 @@ function resolveEffectiveResourceContentIdentities(input) {
|
|
|
11
11
|
const layer = input.layers[index];
|
|
12
12
|
const binding = bindings[index];
|
|
13
13
|
if (!layer) continue;
|
|
14
|
-
if (!
|
|
15
|
-
diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_LAYER_UNTRUSTED", layerLocation(index, layer.id), `Layer '${layer.id}' must use an authentic
|
|
14
|
+
if (!isAuthoredResourceTreeAuthentic(layer.tree)) {
|
|
15
|
+
diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_LAYER_UNTRUSTED", layerLocation(index, layer.id), `Layer '${layer.id}' must use an authentic AuthoredResourceTree returned by loadResourceTree().`));
|
|
16
16
|
continue;
|
|
17
17
|
}
|
|
18
18
|
if (layer.id !== descriptor.id || binding?.id !== descriptor.id) {
|
|
@@ -31,7 +31,7 @@ function resolveEffectiveResourceContentIdentities(input) {
|
|
|
31
31
|
diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_LAYER_BINDING_MISMATCH", layerLocation(index, layer.id), `Layer '${layer.id}' must use the exact loaded tree composed into the registry.`));
|
|
32
32
|
continue;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
validateAuthoredIdentityCoverage(layer.tree, layer.id, diagnostics);
|
|
35
35
|
loadedById.set(layer.id, layer.tree);
|
|
36
36
|
}
|
|
37
37
|
const effectiveEntries = [...input.registry.byId.values()].filter((entry) => entry.resource !== void 0).sort((left, right) => compareCodeUnits(left.resourceId, right.resourceId));
|
|
@@ -65,13 +65,13 @@ function resolveEffectiveResourceContentIdentities(input) {
|
|
|
65
65
|
if (diagnostics.length > 0) throw new ResourceCompositionError(stableDiagnostics(diagnostics));
|
|
66
66
|
return readonlyMap(output.sort(([left], [right]) => compareCodeUnits(left, right)));
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function validateAuthoredIdentityCoverage(tree, layerId, diagnostics) {
|
|
69
69
|
const resources = [...tree.registry.byKind.values()].flatMap((records) => [...records]).sort((left, right) => compareCodeUnits(left.resourceId, right.resourceId));
|
|
70
70
|
const resourcesById = new Map(resources.map((resource) => [resource.resourceId, resource]));
|
|
71
71
|
for (const resource of resources) {
|
|
72
72
|
const identity = tree.contentIdentities.get(resource.resourceId);
|
|
73
73
|
if (!identity) {
|
|
74
|
-
diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_MISSING", layerLocation(void 0, layerId, resource.resourceId), `
|
|
74
|
+
diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_MISSING", layerLocation(void 0, layerId, resource.resourceId), `Authored resource '${resource.resourceId}' has no authority identity.`));
|
|
75
75
|
continue;
|
|
76
76
|
}
|
|
77
77
|
const normalized = createResourceContentIdentity({
|
|
@@ -79,9 +79,9 @@ function validateLoadedIdentityCoverage(tree, layerId, diagnostics) {
|
|
|
79
79
|
authorityDigest: identity.authorityDigest,
|
|
80
80
|
contributions: identity.contributions
|
|
81
81
|
});
|
|
82
|
-
if (identity.resourceId !== resource.resourceId || identity.contentDigest !== normalized.contentDigest) diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_INVALID", layerLocation(void 0, layerId, resource.resourceId), `
|
|
82
|
+
if (identity.resourceId !== resource.resourceId || identity.contentDigest !== normalized.contentDigest) diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_INVALID", layerLocation(void 0, layerId, resource.resourceId), `Authored resource '${resource.resourceId}' has an inconsistent authority identity.`));
|
|
83
83
|
}
|
|
84
|
-
for (const resourceId of tree.contentIdentities.keys()) if (!resourcesById.has(resourceId)) diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_EXTRA", layerLocation(void 0, layerId, resourceId), `
|
|
84
|
+
for (const resourceId of tree.contentIdentities.keys()) if (!resourcesById.has(resourceId)) diagnostics.push(diagnostic("RESOURCE_CONTENT_IDENTITY_EXTRA", layerLocation(void 0, layerId, resourceId), `Authored tree contains an extra authority identity '${resourceId}'.`));
|
|
85
85
|
}
|
|
86
86
|
function validateEffectiveOrigin(entry, registry, tree, diagnostics) {
|
|
87
87
|
const origin = entry.effectiveOrigin;
|
|
@@ -1,8 +1,8 @@
|
|
|
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;
|
|
5
|
-
readonly tree:
|
|
5
|
+
readonly tree: AuthoredResourceTree;
|
|
6
6
|
}
|
|
7
7
|
interface ResolveEffectiveResourceContentIdentitiesInput {
|
|
8
8
|
readonly registry: EffectiveResourceRegistry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ApplicationAssembly } from "./index-
|
|
2
|
-
import { t as ResourceRegistry } from "./index-
|
|
1
|
+
import { t as ApplicationAssembly } from "./index-DEikbOFh.js";
|
|
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;
|
|
@@ -30,7 +30,8 @@ interface CompileResourceSkillCapsuleInput {
|
|
|
30
30
|
interface SkillCapsuleIdentity {
|
|
31
31
|
readonly fqn: string;
|
|
32
32
|
readonly name: string;
|
|
33
|
-
readonly
|
|
33
|
+
readonly envelopeVersion: string;
|
|
34
|
+
readonly specVersion: number;
|
|
34
35
|
readonly version: string;
|
|
35
36
|
}
|
|
36
37
|
type SkillCapsuleContentDigest = `sha256:${string}`;
|
|
@@ -39,7 +40,8 @@ interface SkillCapsuleProvenanceManifest {
|
|
|
39
40
|
readonly generatedBy: "halfcode.skill-distribution/v1";
|
|
40
41
|
readonly source: {
|
|
41
42
|
readonly fqn: string;
|
|
42
|
-
readonly
|
|
43
|
+
readonly envelopeVersion: string;
|
|
44
|
+
readonly specVersion: number;
|
|
43
45
|
readonly version: string;
|
|
44
46
|
};
|
|
45
47
|
readonly payloadFiles: readonly {
|
|
@@ -49,7 +51,8 @@ interface SkillCapsuleProvenanceManifest {
|
|
|
49
51
|
}
|
|
50
52
|
interface PlannedSkillFile {
|
|
51
53
|
readonly skillFqn: string;
|
|
52
|
-
readonly
|
|
54
|
+
readonly skillEnvelopeVersion: string;
|
|
55
|
+
readonly skillSpecVersion: number;
|
|
53
56
|
readonly skillVersion: string;
|
|
54
57
|
readonly capsuleRelativePath: string;
|
|
55
58
|
readonly targetRelativePath: string;
|
|
@@ -106,7 +109,8 @@ declare function skillCapsuleDistributionProjection(plan: SkillCapsuleDistributi
|
|
|
106
109
|
files: {
|
|
107
110
|
contentBase64: string;
|
|
108
111
|
skillFqn: string;
|
|
109
|
-
|
|
112
|
+
skillEnvelopeVersion: string;
|
|
113
|
+
skillSpecVersion: number;
|
|
110
114
|
skillVersion: string;
|
|
111
115
|
capsuleRelativePath: string;
|
|
112
116
|
targetRelativePath: string;
|