holarchy-eidolon-adapter 0.2.1 → 0.2.2

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.
@@ -1,3 +1,4 @@
1
+ import { decodeCanonicalBase64 } from './canonicalBase64.js';
1
2
  import { digestCanonical, } from "halfcode-compiler.xnl/resource-core";
2
3
  import { createKindSpecRevision, createKindSubjectOwner, } from "halfcode-compiler.xnl/kind-definition";
3
4
  export const HOLON_EXECUTION_BINDING_KIND = "HolonExecutionBinding";
@@ -343,14 +344,11 @@ function canonicalBase64SpecBytes(spec, property) {
343
344
  const value = exactString(properties[property], `$.properties.${property}`);
344
345
  let bytes;
345
346
  try {
346
- bytes = Uint8Array.from(Buffer.from(value, "base64"));
347
+ bytes = decodeCanonicalBase64(value);
347
348
  }
348
349
  catch {
349
350
  return invalid(`$.properties.${property}`, "Expected canonical base64");
350
351
  }
351
- if (bytes.byteLength === 0 || Buffer.from(bytes).toString("base64") !== value) {
352
- return invalid(`$.properties.${property}`, "Expected canonical non-empty base64");
353
- }
354
352
  return bytes;
355
353
  }
356
354
  export const HOLON_EXECUTION_BINDING_KIND_READER_REGISTRATION_V1 = Object.freeze({
@@ -8,6 +8,8 @@ export interface EidolonHolonExecutionBindingProjection {
8
8
  readonly binding: HolonExecutionBinding;
9
9
  readonly snapshotResource: ResourceRecord;
10
10
  readonly snapshot: HolonEffectiveSnapshot;
11
+ readonly snapshotBytes: Uint8Array;
12
+ readonly receiptBytes: Uint8Array;
11
13
  readonly receipt: HolonEffectiveSnapshotIssuanceReceipt;
12
14
  readonly bindingBytesDigest: `sha256:${string}`;
13
15
  readonly receiptBytesDigest: `sha256:${string}`;
@@ -1,3 +1,4 @@
1
+ import { decodeCanonicalBase64 } from './canonicalBase64.js';
1
2
  import { HOLON_EXECUTION_BINDING_KIND, HOLON_EXECUTION_BINDING_KIND_DEFINITION_BYTES, HOLON_EXECUTION_BINDING_KIND_DEFINITION_FQN, parseHolonExecutionBindingBytes, validateHolonExecutionBindingGraph, } from "./HolonExecutionBinding.js";
2
3
  import { HOLON_EFFECTIVE_SNAPSHOT_KIND, HOLON_EFFECTIVE_SNAPSHOT_KIND_DEFINITION_BYTES, HOLON_EFFECTIVE_SNAPSHOT_KIND_DEFINITION_FQN, parseHolonEffectiveSnapshotBytes, parseHolonEffectiveSnapshotIssuanceReceiptBytes, } from "holarchy-core-contract";
3
4
  import { buildResourceDependencySnapshot, sha256Digest, } from "halfcode-compiler.xnl/resource-core";
@@ -56,6 +57,8 @@ export async function projectHolonExecutionBindings(input) {
56
57
  binding,
57
58
  snapshotResource,
58
59
  snapshot,
60
+ snapshotBytes,
61
+ receiptBytes,
59
62
  receipt,
60
63
  bindingBytesDigest: sha256Digest(decodedBinding.bindingBytes),
61
64
  receiptBytesDigest: sha256Digest(receiptBytes),
@@ -194,14 +197,11 @@ function canonicalBase64Property(resource, property) {
194
197
  }
195
198
  let bytes;
196
199
  try {
197
- bytes = Uint8Array.from(Buffer.from(value, "base64"));
200
+ bytes = decodeCanonicalBase64(value);
198
201
  }
199
202
  catch {
200
203
  throw new EidolonResourceRegistryError("EIDOLON_HOLON_RESOURCE_BYTES_INVALID", `Resource '${resource.resourceId}' '${property}' is not valid base64.`);
201
204
  }
202
- if (bytes.byteLength === 0 || Buffer.from(bytes).toString("base64") !== value) {
203
- throw new EidolonResourceRegistryError("EIDOLON_HOLON_RESOURCE_BYTES_INVALID", `Resource '${resource.resourceId}' '${property}' is not canonical base64.`);
204
- }
205
205
  return bytes;
206
206
  }
207
207
  function assertTargetExists(binding, snapshot) {
@@ -0,0 +1,90 @@
1
+ import type { ImmutableJsonValue, TaskProfileEnvelope } from 'task-manager-contract';
2
+ export declare const HOLON_TASK_TARGET_SCHEMA_VERSION: "ai-workflow.holon-task-target/v1";
3
+ export declare const HOLON_TASK_SNAPSHOT_RECEIPT_SCHEMA_VERSION: "eidolon.holon-task-snapshot-receipt/v2";
4
+ export declare const AI_ORGANIZATION_TASK_PROFILE_KIND: "depa.ai.organization-task";
5
+ export type HolonTaskResourceRef = `resource://${string}`;
6
+ export type HolonTaskDigest = `sha256:${string}`;
7
+ type ClosedRecord<Shape> = Readonly<Record<string, ImmutableJsonValue>> & Readonly<Shape>;
8
+ export type HolonTaskTarget = ClosedRecord<{
9
+ readonly kind: 'holon-task-target';
10
+ readonly schemaVersion: typeof HOLON_TASK_TARGET_SCHEMA_VERSION;
11
+ readonly invocation: ClosedRecord<{
12
+ readonly workflowKind: 'AICtrlWorkflow' | 'AIDataWorkflow';
13
+ readonly workflowRef: HolonTaskResourceRef;
14
+ readonly nodeId: string;
15
+ readonly invocationId: string;
16
+ }>;
17
+ readonly holon: ClosedRecord<{
18
+ readonly rootHolonRef: string;
19
+ readonly effectiveAt: string;
20
+ }>;
21
+ readonly executionBinding: ClosedRecord<{
22
+ readonly ref: HolonTaskResourceRef;
23
+ readonly digest: HolonTaskDigest;
24
+ }>;
25
+ readonly taskSpace: ClosedRecord<{
26
+ readonly profileRef: HolonTaskResourceRef;
27
+ readonly policyRef: HolonTaskResourceRef;
28
+ readonly requiredRoleRefs: readonly string[];
29
+ readonly requiredCapabilityRefs: readonly HolonTaskResourceRef[];
30
+ }>;
31
+ readonly output: ClosedRecord<{
32
+ readonly schemaRef: HolonTaskResourceRef;
33
+ readonly materialPortRefs: readonly HolonTaskResourceRef[];
34
+ }>;
35
+ }>;
36
+ export type HolonTaskSnapshotReceipt = ClosedRecord<{
37
+ readonly kind: 'holon-task-snapshot-receipt';
38
+ readonly schemaVersion: typeof HOLON_TASK_SNAPSHOT_RECEIPT_SCHEMA_VERSION;
39
+ readonly taskSpaceId: string;
40
+ readonly holonRef: string;
41
+ readonly effectiveAt: string;
42
+ readonly holonSnapshotRef: string;
43
+ readonly holonSnapshotDigest: HolonTaskDigest;
44
+ readonly snapshotArtifactDigest: HolonTaskDigest;
45
+ readonly issuerReceiptId: HolonTaskDigest;
46
+ readonly executionBindingRef: HolonTaskResourceRef;
47
+ readonly executionBindingDigest: HolonTaskDigest;
48
+ readonly eligibleMemberRefs: readonly string[];
49
+ readonly eligibleRoleRefs: readonly string[];
50
+ }>;
51
+ export type HolonTaskSnapshotAdoptionReceipt = ClosedRecord<{
52
+ readonly kind: 'holon-task-snapshot-adoption-receipt';
53
+ readonly schemaVersion: 'ai-workflow.holon-task-snapshot-adoption-receipt/v1';
54
+ readonly taskSpaceId: string;
55
+ readonly previousTaskId: string;
56
+ readonly successorTaskId: string;
57
+ readonly previousIssuerReceiptId: HolonTaskDigest;
58
+ readonly successorIssuerReceiptId: HolonTaskDigest;
59
+ readonly executionBindingDigest: HolonTaskDigest;
60
+ readonly adoptedAt: string;
61
+ }>;
62
+ export type AIOrganizationTaskProfileFacts = ClosedRecord<{
63
+ target: HolonTaskTarget;
64
+ snapshotReceipt: HolonTaskSnapshotReceipt;
65
+ assignmentReceipt: null;
66
+ memberRuntimeRef: null;
67
+ settlementReceipt: null;
68
+ snapshotAdoptions: readonly HolonTaskSnapshotAdoptionReceipt[];
69
+ }>;
70
+ export type AIOrganizationTaskProfile = TaskProfileEnvelope<typeof AI_ORGANIZATION_TASK_PROFILE_KIND, AIOrganizationTaskProfileFacts>;
71
+ export interface WorkflowHolonTaskContext {
72
+ readonly target: HolonTaskTarget;
73
+ readonly semanticFingerprint: HolonTaskDigest;
74
+ readonly snapshotRevision: HolonTaskDigest;
75
+ readonly closureResourceIds: readonly string[];
76
+ }
77
+ export declare function holonTaskTargetFromNodeConfig(configInput: unknown, expected: Readonly<{
78
+ readonly workflowKind: 'AICtrlWorkflow' | 'AIDataWorkflow';
79
+ readonly workflowRef: HolonTaskResourceRef;
80
+ readonly nodeId: string;
81
+ }>): HolonTaskTarget | undefined;
82
+ export declare class HolonTaskContractError extends Error {
83
+ readonly path: string;
84
+ constructor(path: string, message: string);
85
+ }
86
+ export declare function normalizeHolonTaskTarget(value: unknown): HolonTaskTarget;
87
+ export declare function normalizeHolonTaskSnapshotReceipt(value: unknown): HolonTaskSnapshotReceipt;
88
+ export declare function createAIOrganizationTaskProfile(targetInput: unknown, receiptInput: unknown, adoptionInputs?: readonly unknown[]): AIOrganizationTaskProfile;
89
+ export declare function normalizeHolonTaskSnapshotAdoptionReceipt(value: unknown): HolonTaskSnapshotAdoptionReceipt;
90
+ export {};
@@ -0,0 +1,211 @@
1
+ import { canonicalOwnDataClone } from 'task-manager-contract';
2
+ export const HOLON_TASK_TARGET_SCHEMA_VERSION = 'ai-workflow.holon-task-target/v1';
3
+ export const HOLON_TASK_SNAPSHOT_RECEIPT_SCHEMA_VERSION = 'eidolon.holon-task-snapshot-receipt/v2';
4
+ export const AI_ORGANIZATION_TASK_PROFILE_KIND = 'depa.ai.organization-task';
5
+ export function holonTaskTargetFromNodeConfig(configInput, expected) {
6
+ const config = record(canonicalOwnDataClone(configInput), '$config');
7
+ if (!Object.prototype.hasOwnProperty.call(config, 'holonTaskTarget'))
8
+ return undefined;
9
+ const target = normalizeHolonTaskTarget(config.holonTaskTarget);
10
+ if (target.invocation.workflowKind !== expected.workflowKind
11
+ || target.invocation.workflowRef !== expected.workflowRef
12
+ || target.invocation.nodeId !== expected.nodeId) {
13
+ invalid('$config.holonTaskTarget.invocation', 'Target invocation identity does not match the authored node');
14
+ }
15
+ return target;
16
+ }
17
+ export class HolonTaskContractError extends Error {
18
+ path;
19
+ constructor(path, message) {
20
+ super(`${path}: ${message}`);
21
+ this.path = path;
22
+ this.name = 'HolonTaskContractError';
23
+ }
24
+ }
25
+ export function normalizeHolonTaskTarget(value) {
26
+ const root = record(canonicalOwnDataClone(value), '$target');
27
+ exactKeys(root, ['kind', 'schemaVersion', 'invocation', 'holon', 'executionBinding', 'taskSpace', 'output'], '$target');
28
+ exactLiteral(root.kind, 'holon-task-target', '$target.kind');
29
+ exactLiteral(root.schemaVersion, HOLON_TASK_TARGET_SCHEMA_VERSION, '$target.schemaVersion');
30
+ const invocation = record(root.invocation, '$target.invocation');
31
+ exactKeys(invocation, ['workflowKind', 'workflowRef', 'nodeId', 'invocationId'], '$target.invocation');
32
+ const workflowKind = oneOf(invocation.workflowKind, ['AICtrlWorkflow', 'AIDataWorkflow'], '$target.invocation.workflowKind');
33
+ const holon = record(root.holon, '$target.holon');
34
+ exactKeys(holon, ['rootHolonRef', 'effectiveAt'], '$target.holon');
35
+ const executionBinding = record(root.executionBinding, '$target.executionBinding');
36
+ exactKeys(executionBinding, ['ref', 'digest'], '$target.executionBinding');
37
+ const taskSpace = record(root.taskSpace, '$target.taskSpace');
38
+ exactKeys(taskSpace, ['profileRef', 'policyRef', 'requiredRoleRefs', 'requiredCapabilityRefs'], '$target.taskSpace');
39
+ const output = record(root.output, '$target.output');
40
+ exactKeys(output, ['schemaRef', 'materialPortRefs'], '$target.output');
41
+ return Object.freeze({
42
+ kind: 'holon-task-target',
43
+ schemaVersion: HOLON_TASK_TARGET_SCHEMA_VERSION,
44
+ invocation: Object.freeze({
45
+ workflowKind,
46
+ workflowRef: resourceRef(invocation.workflowRef, '$target.invocation.workflowRef'),
47
+ nodeId: exactString(invocation.nodeId, '$target.invocation.nodeId'),
48
+ invocationId: exactString(invocation.invocationId, '$target.invocation.invocationId'),
49
+ }),
50
+ holon: Object.freeze({
51
+ rootHolonRef: exactString(holon.rootHolonRef, '$target.holon.rootHolonRef'),
52
+ effectiveAt: utcInstant(holon.effectiveAt, '$target.holon.effectiveAt'),
53
+ }),
54
+ executionBinding: Object.freeze({
55
+ ref: resourceRef(executionBinding.ref, '$target.executionBinding.ref'),
56
+ digest: digest(executionBinding.digest, '$target.executionBinding.digest'),
57
+ }),
58
+ taskSpace: Object.freeze({
59
+ profileRef: resourceRef(taskSpace.profileRef, '$target.taskSpace.profileRef'),
60
+ policyRef: resourceRef(taskSpace.policyRef, '$target.taskSpace.policyRef'),
61
+ requiredRoleRefs: stringArray(taskSpace.requiredRoleRefs, '$target.taskSpace.requiredRoleRefs'),
62
+ requiredCapabilityRefs: resourceRefArray(taskSpace.requiredCapabilityRefs, '$target.taskSpace.requiredCapabilityRefs'),
63
+ }),
64
+ output: Object.freeze({
65
+ schemaRef: resourceRef(output.schemaRef, '$target.output.schemaRef'),
66
+ materialPortRefs: resourceRefArray(output.materialPortRefs, '$target.output.materialPortRefs'),
67
+ }),
68
+ });
69
+ }
70
+ export function normalizeHolonTaskSnapshotReceipt(value) {
71
+ const root = record(canonicalOwnDataClone(value), '$snapshotReceipt');
72
+ const legacy = root.schemaVersion === 'ai-workflow.holon-task-snapshot-receipt/v1' || root.schemaVersion === 'eidolon.holon-task-snapshot-receipt/v1';
73
+ exactKeys(root, [
74
+ 'kind', 'schemaVersion', 'taskSpaceId', 'holonRef', 'effectiveAt', 'holonSnapshotRef',
75
+ 'holonSnapshotDigest', 'snapshotArtifactDigest', 'issuerReceiptId',
76
+ ...(legacy ? ['issuerReceiptArtifactDigest'] : []), 'executionBindingRef', 'executionBindingDigest',
77
+ 'eligibleMemberRefs', 'eligibleRoleRefs',
78
+ ], '$snapshotReceipt');
79
+ exactLiteral(root.kind, 'holon-task-snapshot-receipt', '$snapshotReceipt.kind');
80
+ if (!legacy)
81
+ exactLiteral(root.schemaVersion, HOLON_TASK_SNAPSHOT_RECEIPT_SCHEMA_VERSION, '$snapshotReceipt.schemaVersion');
82
+ if (legacy && root.issuerReceiptArtifactDigest !== root.issuerReceiptId)
83
+ invalid('$snapshotReceipt', 'Conflicting legacy receipt digests');
84
+ return Object.freeze({
85
+ kind: 'holon-task-snapshot-receipt',
86
+ schemaVersion: HOLON_TASK_SNAPSHOT_RECEIPT_SCHEMA_VERSION,
87
+ taskSpaceId: exactString(root.taskSpaceId, '$snapshotReceipt.taskSpaceId'),
88
+ holonRef: exactString(root.holonRef, '$snapshotReceipt.holonRef'),
89
+ effectiveAt: utcInstant(root.effectiveAt, '$snapshotReceipt.effectiveAt'),
90
+ holonSnapshotRef: exactString(root.holonSnapshotRef, '$snapshotReceipt.holonSnapshotRef'),
91
+ holonSnapshotDigest: digest(root.holonSnapshotDigest, '$snapshotReceipt.holonSnapshotDigest'),
92
+ snapshotArtifactDigest: digest(root.snapshotArtifactDigest, '$snapshotReceipt.snapshotArtifactDigest'),
93
+ issuerReceiptId: digest(root.issuerReceiptId, '$snapshotReceipt.issuerReceiptId'),
94
+ executionBindingRef: resourceRef(root.executionBindingRef, '$snapshotReceipt.executionBindingRef'),
95
+ executionBindingDigest: digest(root.executionBindingDigest, '$snapshotReceipt.executionBindingDigest'),
96
+ eligibleMemberRefs: stringArray(root.eligibleMemberRefs, '$snapshotReceipt.eligibleMemberRefs'),
97
+ eligibleRoleRefs: stringArray(root.eligibleRoleRefs, '$snapshotReceipt.eligibleRoleRefs'),
98
+ });
99
+ }
100
+ export function createAIOrganizationTaskProfile(targetInput, receiptInput, adoptionInputs = []) {
101
+ const target = normalizeHolonTaskTarget(targetInput);
102
+ const snapshotReceipt = normalizeHolonTaskSnapshotReceipt(receiptInput);
103
+ if (snapshotReceipt.taskSpaceId.length === 0
104
+ || snapshotReceipt.holonRef !== target.holon.rootHolonRef
105
+ || snapshotReceipt.effectiveAt !== target.holon.effectiveAt
106
+ || snapshotReceipt.executionBindingRef !== target.executionBinding.ref
107
+ || snapshotReceipt.executionBindingDigest !== target.executionBinding.digest) {
108
+ invalid('$profile', 'Snapshot receipt does not bind the exact target facts');
109
+ }
110
+ return Object.freeze({
111
+ kind: 'task-profile',
112
+ profileKind: AI_ORGANIZATION_TASK_PROFILE_KIND,
113
+ schemaVersion: 1,
114
+ facts: Object.freeze({
115
+ target,
116
+ snapshotReceipt,
117
+ assignmentReceipt: null,
118
+ memberRuntimeRef: null,
119
+ settlementReceipt: null,
120
+ snapshotAdoptions: Object.freeze(adoptionInputs.map(normalizeHolonTaskSnapshotAdoptionReceipt)),
121
+ }),
122
+ });
123
+ }
124
+ export function normalizeHolonTaskSnapshotAdoptionReceipt(value) {
125
+ const root = record(canonicalOwnDataClone(value), '$snapshotAdoptionReceipt');
126
+ exactKeys(root, [
127
+ 'kind', 'schemaVersion', 'taskSpaceId', 'previousTaskId', 'successorTaskId',
128
+ 'previousIssuerReceiptId', 'successorIssuerReceiptId', 'executionBindingDigest', 'adoptedAt',
129
+ ], '$snapshotAdoptionReceipt');
130
+ exactLiteral(root.kind, 'holon-task-snapshot-adoption-receipt', '$snapshotAdoptionReceipt.kind');
131
+ exactLiteral(root.schemaVersion, 'ai-workflow.holon-task-snapshot-adoption-receipt/v1', '$snapshotAdoptionReceipt.schemaVersion');
132
+ return Object.freeze({
133
+ kind: 'holon-task-snapshot-adoption-receipt',
134
+ schemaVersion: 'ai-workflow.holon-task-snapshot-adoption-receipt/v1',
135
+ taskSpaceId: exactString(root.taskSpaceId, '$snapshotAdoptionReceipt.taskSpaceId'),
136
+ previousTaskId: exactString(root.previousTaskId, '$snapshotAdoptionReceipt.previousTaskId'),
137
+ successorTaskId: exactString(root.successorTaskId, '$snapshotAdoptionReceipt.successorTaskId'),
138
+ previousIssuerReceiptId: digest(root.previousIssuerReceiptId, '$snapshotAdoptionReceipt.previousIssuerReceiptId'),
139
+ successorIssuerReceiptId: digest(root.successorIssuerReceiptId, '$snapshotAdoptionReceipt.successorIssuerReceiptId'),
140
+ executionBindingDigest: digest(root.executionBindingDigest, '$snapshotAdoptionReceipt.executionBindingDigest'),
141
+ adoptedAt: utcInstant(root.adoptedAt, '$snapshotAdoptionReceipt.adoptedAt'),
142
+ });
143
+ }
144
+ function record(value, path) {
145
+ if (value === null || typeof value !== 'object' || Array.isArray(value))
146
+ invalid(path, 'Expected an object');
147
+ return value;
148
+ }
149
+ function exactKeys(value, expected, path) {
150
+ const actual = Object.keys(value);
151
+ const expectedSet = new Set(expected);
152
+ const extra = actual.find((key) => !expectedSet.has(key));
153
+ if (extra !== undefined)
154
+ invalid(`${path}.${extra}`, 'Unsupported field');
155
+ const missing = expected.find((key) => !Object.prototype.hasOwnProperty.call(value, key));
156
+ if (missing !== undefined)
157
+ invalid(`${path}.${missing}`, 'Required field is missing');
158
+ }
159
+ function exactString(value, path) {
160
+ if (typeof value !== 'string' || value.length === 0 || value !== value.trim())
161
+ invalid(path, 'Expected an exact non-empty string');
162
+ return value;
163
+ }
164
+ function exactLiteral(value, expected, path) {
165
+ if (value !== expected)
166
+ invalid(path, `Expected '${expected}'`);
167
+ return expected;
168
+ }
169
+ function oneOf(value, expected, path) {
170
+ if (typeof value !== 'string' || !expected.includes(value))
171
+ invalid(path, `Expected one of ${expected.join('|')}`);
172
+ return value;
173
+ }
174
+ function resourceRef(value, path) {
175
+ const ref = exactString(value, path);
176
+ if (!/^resource:\/\/[^/\s][^\s]*$/.test(ref))
177
+ invalid(path, 'Expected a canonical resource:// reference');
178
+ return ref;
179
+ }
180
+ function digest(value, path) {
181
+ if (typeof value !== 'string' || !/^sha256:[0-9a-f]{64}$/.test(value))
182
+ invalid(path, 'Expected a canonical SHA-256 digest');
183
+ return value;
184
+ }
185
+ function utcInstant(value, path) {
186
+ const instant = exactString(value, path);
187
+ const parsed = Date.parse(instant);
188
+ if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(instant)
189
+ || Number.isNaN(parsed) || new Date(parsed).toISOString() !== instant)
190
+ invalid(path, 'Expected a canonical UTC instant');
191
+ return instant;
192
+ }
193
+ function stringArray(value, path) {
194
+ if (!Array.isArray(value))
195
+ invalid(path, 'Expected an array');
196
+ const result = Object.freeze(value.map((item, index) => exactString(item, `${path}[${index}]`)));
197
+ if (new Set(result).size !== result.length)
198
+ invalid(path, 'Duplicate values are not allowed');
199
+ return result;
200
+ }
201
+ function resourceRefArray(value, path) {
202
+ if (!Array.isArray(value))
203
+ invalid(path, 'Expected an array');
204
+ const result = Object.freeze(value.map((item, index) => resourceRef(item, `${path}[${index}]`)));
205
+ if (new Set(result).size !== result.length)
206
+ invalid(path, 'Duplicate values are not allowed');
207
+ return result;
208
+ }
209
+ function invalid(path, message) {
210
+ throw new HolonTaskContractError(path, message);
211
+ }
@@ -0,0 +1,2 @@
1
+ /** 纯平台标准转换;公开适配包不依赖主机Buffer或Node类型。 */
2
+ export declare function decodeCanonicalBase64(value: string): Uint8Array;
@@ -0,0 +1,7 @@
1
+ /** 纯平台标准转换;公开适配包不依赖主机Buffer或Node类型。 */
2
+ export function decodeCanonicalBase64(value) {
3
+ const binary = atob(value);
4
+ if (!binary.length || btoa(binary) !== value)
5
+ throw new TypeError('Expected canonical non-empty base64');
6
+ return Uint8Array.from(binary, character => character.charCodeAt(0));
7
+ }
package/dist/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from "./HolonExecutionBinding.js";
5
5
  export * from "./HolonExecutionBindingProjection.js";
6
6
  export { parseOrganizationWorkbenchRequest, parseOrganizationWorkbenchReply } from './WorkbenchProtocol.js';
7
7
  export type { OrganizationWorkbenchRequest, OrganizationWorkbenchReply } from './WorkbenchProtocol.js';
8
+ export * from "./WorkflowHolonTaskContract.js";
package/dist/index.js CHANGED
@@ -4,3 +4,4 @@ export * from "./HolonDeploymentRuntime.js";
4
4
  export * from "./HolonExecutionBinding.js";
5
5
  export * from "./HolonExecutionBindingProjection.js";
6
6
  export { parseOrganizationWorkbenchRequest, parseOrganizationWorkbenchReply } from './WorkbenchProtocol.js';
7
+ export * from "./WorkflowHolonTaskContract.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holarchy-eidolon-adapter",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "description": "Eidolon ResourcePackage adapter for frozen Holarchy organization snapshots and execution bindings.",
6
6
  "type": "module",
@@ -35,23 +35,16 @@
35
35
  "dist",
36
36
  "README.md"
37
37
  ],
38
- "scripts": {
39
- "typecheck": "tsc -p tsconfig.json --noEmit",
40
- "test": "bun test",
41
- "build": "tsc -p tsconfig.build.json"
42
- },
43
38
  "dependencies": {
44
- "ai-workflow-contract": "0.2.1",
39
+ "ai-workflow-contract": "0.2.3",
45
40
  "depa-actor": "0.2.2",
46
41
  "halfcode-compiler.xnl": "0.3.2",
47
- "holarchy-core-contract": "0.3.0"
48
- },
49
- "devDependencies": {
50
- "typescript": "^5.4.0",
51
- "@types/node": "^22.0.0"
42
+ "holarchy-core-contract": "0.3.1",
43
+ "task-manager-contract": "0.1.4"
52
44
  },
53
45
  "publishConfig": {
54
- "access": "public"
46
+ "access": "public",
47
+ "registry": "https://registry.npmjs.com/"
55
48
  },
56
49
  "types": "./dist/index.d.ts"
57
50
  }