@xplane/core 0.15.2 → 1.0.0
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/index.d.mts +504 -328
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1103 -655
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["Construct","Construct"],"sources":["../src/tracking/dependency-graph.ts","../src/tracking/types.ts","../src/tracking/proxy.ts","../src/core/construct.ts","../src/core/composition.ts","../src/core/resource.ts","../src/ready/auto-ready.ts","../src/sequencing/resolver.ts"],"sourcesContent":["import type { DependencyEdge, ResourceRef } from './types.js';\n\n/**\n * Directed acyclic graph of resource dependencies.\n * Supports topological sorting to determine resource creation order\n * and cycle detection to surface configuration errors.\n */\nexport class DependencyGraph {\n /** adjacency list: resource id → set of resource ids it depends on */\n private readonly _deps = new Map<string, Set<string>>();\n /** all registered resource refs by id */\n private readonly _resources = new Map<string, ResourceRef>();\n /** raw edges for introspection */\n private readonly _edges: DependencyEdge[] = [];\n\n /** Register a resource node in the graph. */\n addResource(ref: ResourceRef): void {\n this._resources.set(ref.id, ref);\n if (!this._deps.has(ref.id)) {\n this._deps.set(ref.id, new Set());\n }\n }\n\n /** Add dependency edges from the collector. */\n addEdges(edges: ReadonlyArray<DependencyEdge>): void {\n for (const edge of edges) {\n this.addResource(edge.from);\n this.addResource(edge.to);\n\n // edge.to depends on edge.from\n const deps = this._deps.get(edge.to.id);\n if (deps) {\n deps.add(edge.from.id);\n }\n\n this._edges.push(edge);\n }\n }\n\n /** Add an explicit dependency: `dependent` depends on `dependency`. */\n addExplicitDependency(dependent: ResourceRef, dependency: ResourceRef): void {\n this.addResource(dependent);\n this.addResource(dependency);\n const deps = this._deps.get(dependent.id);\n if (deps) {\n deps.add(dependency.id);\n }\n }\n\n /** Get all resource IDs that `resourceId` directly depends on. */\n getDependencies(resourceId: string): ReadonlySet<string> {\n return this._deps.get(resourceId) ?? new Set();\n }\n\n /** Get all registered resource IDs. */\n get resourceIds(): ReadonlyArray<string> {\n return [...this._resources.keys()];\n }\n\n /** Get all raw edges. */\n get edges(): ReadonlyArray<DependencyEdge> {\n return this._edges;\n }\n\n /**\n * Returns resource IDs in topological order (dependencies first).\n * Throws if the graph contains cycles.\n */\n topologicalSort(): string[] {\n const visited = new Set<string>();\n const visiting = new Set<string>();\n const sorted: string[] = [];\n\n const visit = (id: string): void => {\n if (visited.has(id)) return;\n if (visiting.has(id)) {\n const cycle = [...visiting, id].join(' → ');\n throw new Error(`Dependency cycle detected: ${cycle}`);\n }\n\n visiting.add(id);\n\n const deps = this._deps.get(id);\n if (deps) {\n for (const depId of deps) {\n visit(depId);\n }\n }\n\n visiting.delete(id);\n visited.add(id);\n sorted.push(id);\n };\n\n for (const id of this._resources.keys()) {\n visit(id);\n }\n\n return sorted;\n }\n}\n","/**\n * Symbols used to access tracking metadata on proxy-wrapped values.\n * These are not enumerable and won't leak into serialized output.\n */\nexport const TRACKING_META = Symbol.for('xplane.tracking.meta');\nexport const IS_TRACKED = Symbol.for('xplane.tracking.isTracked');\n\n/** Identifies which resource a tracked value belongs to. */\nexport interface ResourceRef {\n readonly id: string;\n}\n\n/** A single dependency edge between two resource fields. */\nexport interface DependencyEdge {\n /** Resource whose field is being read (the dependency). */\n readonly from: ResourceRef;\n /** Dot-separated path on the source resource. */\n readonly fromPath: string;\n /** Resource whose field is being set (the dependent). */\n readonly to: ResourceRef;\n /** Dot-separated path on the target resource. */\n readonly toPath: string;\n}\n\n/** Metadata attached to every tracked proxy. */\nexport interface TrackingMeta {\n /** The resource this value belongs to. */\n readonly owner: ResourceRef;\n /** The dot-separated path from root of the resource object. */\n readonly path: string;\n /** Whether this value originates from observed state (read-only). */\n readonly observed: boolean;\n}\n\n/** Reference to an existing cluster resource requested via Crossplane's required resources mechanism. */\nexport interface ExistingResourceRef {\n /** API version of the resource (e.g. \"example.io/v1\"). */\n readonly apiVersion: string;\n /** Kind of the resource (e.g. \"Project\"). */\n readonly kind: string;\n /** Name of the resource. May be a raw string or a tracked proxy value (resolved later). */\n readonly name: unknown;\n /** Optional namespace of the resource. */\n readonly namespace?: string;\n /** Deterministic key for this reference (apiVersion/kind/[namespace/]name). */\n readonly refKey: string;\n}\n","import {\n type DependencyEdge,\n IS_TRACKED,\n type ResourceRef,\n TRACKING_META,\n type TrackingMeta,\n} from './types.js';\n\n/**\n * Registry that collects dependency edges discovered during proxy access.\n * Shared across all tracked values within a single composition run.\n */\nexport class DependencyCollector {\n private readonly _edges: DependencyEdge[] = [];\n\n addEdge(edge: DependencyEdge): void {\n const exists = this._edges.some(\n (e) =>\n e.from.id === edge.from.id &&\n e.fromPath === edge.fromPath &&\n e.to.id === edge.to.id &&\n e.toPath === edge.toPath,\n );\n if (!exists) {\n this._edges.push(edge);\n }\n }\n\n get edges(): ReadonlyArray<DependencyEdge> {\n return this._edges;\n }\n\n clear(): void {\n this._edges.length = 0;\n }\n}\n\n/** Options for creating a tracked proxy. */\nexport interface TrackedProxyOptions {\n /** Which resource this value belongs to. */\n owner: ResourceRef;\n /** Dot-path from the resource root (e.g. \"spec.forProvider.region\"). */\n path: string;\n /** Whether this originates from observed state. */\n observed: boolean;\n /** Shared collector for discovered dependencies. */\n collector: DependencyCollector;\n /**\n * When true, missing keys on observed proxies return `undefined` instead of\n * placeholder proxies. This allows optional chaining (`?.`) to short-circuit\n * correctly. Used for XR proxies whose data is fully available at composition time.\n */\n strict?: boolean;\n}\n\n/**\n * Returns true if `value` is a tracked proxy created by `createTrackedProxy`.\n */\nexport function isTracked(value: unknown): value is object & { [TRACKING_META]: TrackingMeta } {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as Record<symbol, unknown>)[IS_TRACKED] === true\n );\n}\n\n/**\n * Retrieves the tracking metadata from a tracked proxy.\n * Returns undefined if the value is not tracked.\n */\nexport function getTrackingMeta(value: unknown): TrackingMeta | undefined {\n if (isTracked(value)) {\n return (value as Record<symbol, TrackingMeta>)[TRACKING_META];\n }\n return undefined;\n}\n\n/**\n * Creates a proxy around `target` that:\n * 1. Returns nested proxies for property access (building up dot-paths).\n * 2. On set: if the assigned value is itself a tracked proxy from a *different*\n * resource, records a DependencyEdge in the collector.\n * 3. Stores concrete values normally so the underlying object is populated.\n *\n * For \"observed\" proxies, property reads on missing keys return a nested\n * tracked proxy (representing an \"unknown\" value) rather than undefined.\n * This lets `vpc.status.atProvider.vpcId` work even before the VPC exists.\n */\nexport function createTrackedProxy<T extends object>(target: T, opts: TrackedProxyOptions): T {\n const meta: TrackingMeta = {\n owner: opts.owner,\n path: opts.path,\n observed: opts.observed,\n };\n\n return new Proxy(target, {\n get(obj, prop, receiver) {\n // Metadata access — non-enumerable\n if (prop === TRACKING_META) return meta;\n if (prop === IS_TRACKED) return true;\n\n // When an observed placeholder proxy is used in string/number context\n // (e.g. template literals), throw a clear error instead of \"[object Object]\"\n if (prop === Symbol.toPrimitive) {\n if (opts.observed && Object.keys(obj).length === 0) {\n return () => {\n throw new Error(\n `Cannot coerce XR path '${opts.path}' to a primitive — the field does not exist in the composite resource`,\n );\n };\n }\n return Reflect.get(obj, prop, receiver);\n }\n\n // Allow standard iteration / serialization protocols\n if (typeof prop === 'symbol') {\n return Reflect.get(obj, prop, receiver);\n }\n\n // Standard object methods\n if (prop === 'toJSON') {\n return () => obj;\n }\n\n const existing = Reflect.get(obj, prop, receiver);\n\n // If the value is already a tracked proxy, return as-is\n if (isTracked(existing)) {\n return existing;\n }\n\n // If it's a plain object or array, wrap it in a tracked proxy\n if (typeof existing === 'object' && existing !== null) {\n const wrapped = createTrackedProxy(existing as object, {\n owner: opts.owner,\n path: opts.path ? `${opts.path}.${prop}` : String(prop),\n observed: opts.observed,\n collector: opts.collector,\n strict: opts.strict,\n });\n // Cache the wrapped version\n Reflect.set(obj, prop, wrapped);\n return wrapped;\n }\n\n // Primitive that exists — return it\n if (existing !== undefined || prop in obj) {\n return existing;\n }\n\n // For observed proxies, missing keys return a nested proxy\n // representing an \"unknown\" future value\n if (opts.observed) {\n // In strict mode (e.g. XR proxies), return undefined for missing keys\n // so that optional chaining (?.) can short-circuit correctly.\n if (opts.strict) {\n return undefined;\n }\n const placeholder: Record<string, unknown> = {};\n const wrapped = createTrackedProxy(placeholder, {\n owner: opts.owner,\n path: opts.path ? `${opts.path}.${prop}` : String(prop),\n observed: true,\n collector: opts.collector,\n });\n // Do NOT cache on observed — it's a virtual path\n return wrapped;\n }\n\n // For desired proxies, auto-create nested objects so that\n // chained assignments like `spec.forProvider.vpcId = ...` work\n const autoCreated: Record<string, unknown> = {};\n const wrapped = createTrackedProxy(autoCreated, {\n owner: opts.owner,\n path: opts.path ? `${opts.path}.${prop}` : String(prop),\n observed: false,\n collector: opts.collector,\n });\n Reflect.set(obj, prop, wrapped);\n return wrapped;\n },\n\n set(obj, prop, value) {\n if (typeof prop === 'symbol') {\n return Reflect.set(obj, prop, value);\n }\n\n const targetPath = opts.path ? `${opts.path}.${prop}` : String(prop);\n\n // If the value being assigned is a tracked proxy from another resource,\n // record a dependency edge\n if (isTracked(value)) {\n const sourceMeta = getTrackingMeta(value);\n\n // XR values (owner \"__xr__\") are always fully available at\n // construction time — resolve them immediately without creating\n // dependency edges or UNRESOLVED sentinels.\n if (sourceMeta && sourceMeta.owner.id === '__xr__') {\n const concrete = resolveTrackedValue(value);\n // If the XR path doesn't exist, store undefined (not UNRESOLVED)\n return Reflect.set(obj, prop, concrete === UNRESOLVED ? undefined : concrete);\n }\n\n if (sourceMeta && sourceMeta.owner.id !== opts.owner.id) {\n opts.collector.addEdge({\n from: sourceMeta.owner,\n fromPath: sourceMeta.path,\n to: opts.owner,\n toPath: targetPath,\n });\n }\n\n // Resolve the concrete value if available, otherwise store a\n // sentinel so serialization knows it's unresolved\n const concrete = resolveTrackedValue(value);\n return Reflect.set(obj, prop, concrete);\n }\n\n // Plain value — just set it\n if (typeof value === 'object' && value !== null && !isTracked(value)) {\n const wrapped = createTrackedProxy(value as object, {\n owner: opts.owner,\n path: targetPath,\n observed: opts.observed,\n collector: opts.collector,\n });\n return Reflect.set(obj, prop, wrapped);\n }\n\n return Reflect.set(obj, prop, value);\n },\n\n ownKeys(obj) {\n return Reflect.ownKeys(obj).filter((k) => typeof k === 'string');\n },\n\n getOwnPropertyDescriptor(obj, prop) {\n const desc = Reflect.getOwnPropertyDescriptor(obj, prop);\n if (desc) return { ...desc, configurable: true, enumerable: true };\n // For observed proxies, pretend properties exist so spread/destructuring works\n if (opts.observed && typeof prop === 'string') {\n return { configurable: true, enumerable: true, writable: true, value: undefined };\n }\n return undefined;\n },\n\n has(obj, prop) {\n if (prop === IS_TRACKED || prop === TRACKING_META) return true;\n return Reflect.has(obj, prop);\n },\n });\n}\n\n/**\n * Sentinel value used when a tracked reference cannot be resolved yet\n * (the source resource hasn't been observed).\n */\nexport const UNRESOLVED = Symbol.for('xplane.unresolved');\n\n/**\n * Attempts to extract a concrete (non-proxy) value from a tracked value.\n * Returns UNRESOLVED if the tracked value points to an empty observed path.\n */\nfunction resolveTrackedValue(tracked: unknown): unknown {\n if (!isTracked(tracked)) return tracked;\n\n // If the underlying object has no own string keys and is observed,\n // it's an unresolved placeholder\n const obj = unwrapProxy(tracked);\n const keys = Object.keys(obj as object);\n const meta = getTrackingMeta(tracked);\n\n if (keys.length === 0 && meta?.observed) {\n return UNRESOLVED;\n }\n\n // If it's a primitive wrapper (shouldn't happen often), return the object\n return obj;\n}\n\n/**\n * Strips the proxy layer and returns the raw underlying object.\n */\nfunction unwrapProxy(tracked: object): object {\n // Proxies delegate to the target — we can get at raw data via JSON round-trip\n // But that's expensive. Instead, we use ownKeys + get to rebuild.\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(tracked)) {\n result[key] = (tracked as Record<string, unknown>)[key];\n }\n return result;\n}\n","/**\n * Context keys used to propagate tracking infrastructure through the construct tree.\n * Set by Composition (root), read by Resource and other constructs.\n * @internal\n */\nexport const CONTEXT_COLLECTOR = 'xplane:collector';\nexport const CONTEXT_GRAPH = 'xplane:graph';\n/** Raw XR name and namespace stored at composition root for use by uniqueName. */\nexport const CONTEXT_XR_META = 'xplane:xr-meta';\n/** Registry of existing resource references on the composition root. */\nexport const CONTEXT_EXISTING = 'xplane:existing';\n","import { Construct } from 'constructs';\nimport { createTrackedProxy, DependencyCollector, DependencyGraph } from '../tracking/index.js';\nimport {\n CONTEXT_COLLECTOR,\n CONTEXT_EXISTING,\n CONTEXT_GRAPH,\n CONTEXT_XR_META,\n} from './construct.js';\nimport type { AnyFields, Resource } from './resource.js';\n\n/**\n * A Composition is the root Construct for a Crossplane composition function.\n * Like CDK's `App` or cdk8s's `Chart`, it is the root of the construct tree.\n * Resources and constructs are created in the constructor.\n *\n * Usage:\n * ```ts\n * class MyComposition extends Composition {\n * constructor() {\n * super();\n * const vpc = new aws.ec2.VPC(this, 'vpc', { ... });\n * const subnet = new aws.ec2.Subnet(this, 'subnet', {\n * spec: { forProvider: { vpcId: vpc.status.atProvider.vpcId } }\n * });\n * }\n * }\n * ```\n */\nexport class Composition extends Construct {\n /**\n * Pending XR data, set by the framework before instantiation.\n * @internal\n */\n static _pendingXR: Record<string, unknown> | undefined;\n\n /**\n * Pending environment data, set by the framework before instantiation.\n * Populated from the Crossplane context key `apiextensions.crossplane.io/environment`.\n * @internal\n */\n static _pendingEnvironment: Record<string, unknown> | undefined;\n\n /** The composite resource (XR) — proxy-wrapped for tracking. */\n readonly xr: AnyFields;\n\n /** Environment data from function-environment-configs or other pipeline steps. */\n readonly environment: AnyFields;\n\n /** Raw name from the XR metadata (not proxy-tracked). */\n readonly xrName: string | undefined;\n\n /** Raw namespace from the XR metadata (not proxy-tracked). */\n readonly xrNamespace: string | undefined;\n\n /** Dependency collector shared across all resources. */\n readonly collector: DependencyCollector;\n\n /** Dependency graph built during compose(). */\n readonly graph: DependencyGraph;\n\n /** Registry of existing (read-only) resource references keyed by refKey. */\n private readonly _existingResources: Map<string, Resource> = new Map();\n\n /** Registered status output function. @internal */\n private _statusFn?: () => Record<string, unknown>;\n\n constructor() {\n super(undefined as unknown as Construct, '');\n\n this.collector = new DependencyCollector();\n this.graph = new DependencyGraph();\n\n // Set context before children are added (subclass constructor body runs after this)\n this.node.setContext(CONTEXT_COLLECTOR, this.collector);\n this.node.setContext(CONTEXT_GRAPH, this.graph);\n this.node.setContext(CONTEXT_EXISTING, this._existingResources);\n\n // Consume pending XR data (set by handler before construction)\n const xrData = Composition._pendingXR ?? {};\n Composition._pendingXR = undefined;\n\n // Consume pending environment data (set by handler before construction)\n const envData = Composition._pendingEnvironment ?? {};\n Composition._pendingEnvironment = undefined;\n\n // Store raw XR name/namespace for use by Resource.uniqueName (untracked)\n const xrMeta = (xrData.metadata ?? {}) as Record<string, unknown>;\n this.xrName = typeof xrMeta.name === 'string' ? xrMeta.name : undefined;\n this.xrNamespace = typeof xrMeta.namespace === 'string' ? xrMeta.namespace : undefined;\n this.node.setContext(CONTEXT_XR_META, { name: this.xrName, namespace: this.xrNamespace });\n\n // XR is observed state — reads track dependencies\n this.xr = createTrackedProxy(xrData as AnyFields, {\n owner: { id: '__xr__' },\n path: '',\n observed: true,\n collector: this.collector,\n strict: true,\n });\n\n // Environment is read-only observed state (no dependency tracking needed)\n this.environment = envData as AnyFields;\n }\n\n /**\n * Register a function that computes the desired XR status output.\n *\n * The function is called by the framework **after** observed state has been\n * fed into all resources, so `resource.observed` contains real data.\n *\n * @example\n * ```ts\n * this.setStatusOutput(() => ({\n * config: {\n * projectHostedZoneId: hostedZone.observed?.status?.atProvider?.id,\n * },\n * }));\n * ```\n */\n setStatusOutput(fn: () => Record<string, unknown>): void {\n this._statusFn = fn;\n }\n\n /**\n * Compute and return the desired status output.\n * Returns an empty object if no status function was registered.\n * @internal\n */\n computeStatusOutput(): Record<string, unknown> {\n return this._statusFn?.() ?? {};\n }\n\n /**\n * Walk up the construct tree and return the root Composition.\n * Throws if the scope is not within a Composition.\n */\n static of(scope: Construct): Composition {\n let current: Construct | undefined = scope;\n while (current !== undefined) {\n if (current instanceof Composition) return current;\n current = current.node.scope;\n }\n throw new Error(\n 'No Composition found in the scope chain. Ensure constructs are created within a Composition.',\n );\n }\n\n /** Get all composed (non-existing) resources keyed by construct path. */\n get resources(): ReadonlyMap<string, Resource> {\n // Lazy import to avoid circular dependency\n const map = new Map<string, Resource>();\n for (const construct of this.node.findAll()) {\n if (isResource(construct) && !construct.isExisting) {\n map.set(construct.node.path, construct);\n }\n }\n return map;\n }\n\n /** Get all existing (read-only) resource references keyed by refKey. */\n get existingResources(): ReadonlyMap<string, Resource> {\n return this._existingResources;\n }\n}\n\n/**\n * Type guard for Resource — avoids circular import by checking for\n * characteristic properties rather than instanceof.\n */\nfunction isResource(construct: unknown): construct is Resource {\n return (\n construct !== null &&\n typeof construct === 'object' &&\n 'apiVersion' in construct &&\n 'kind' in construct &&\n 'resourceRef' in construct &&\n 'isExisting' in construct\n );\n}\n","import { Construct } from 'constructs';\nimport {\n createTrackedProxy,\n type DependencyCollector,\n type DependencyGraph,\n type ExistingResourceRef,\n type ResourceRef,\n} from '../tracking/index.js';\nimport { getTrackingMeta, isTracked, UNRESOLVED } from '../tracking/proxy.js';\nimport {\n CONTEXT_COLLECTOR,\n CONTEXT_EXISTING,\n CONTEXT_GRAPH,\n CONTEXT_XR_META,\n} from './construct.js';\n\n/**\n * Recursive type that allows arbitrary deep property access without undefined.\n * Uses a known-key mapped type to bypass noUncheckedIndexedAccess.\n * Used as the default for untyped Resource spec/status so that\n * `resource.spec.forProvider.vpcId` compiles without casts.\n */\n// biome-ignore lint/suspicious/noExplicitAny: intentional for ergonomic deep access\nexport type AnyFields = Record<string, any>;\n\n/** Minimal Kubernetes resource shape. */\nexport interface KubernetesResource {\n apiVersion: string;\n kind: string;\n metadata?: {\n name?: string;\n namespace?: string;\n labels?: Record<string, string>;\n annotations?: Record<string, string>;\n [key: string]: unknown;\n };\n spec?: Record<string, unknown>;\n status?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\n/** Props for constructing a Resource. */\nexport interface ResourceProps {\n apiVersion: string;\n kind: string;\n metadata?: {\n name?: string;\n namespace?: string;\n labels?: Record<string, string>;\n annotations?: Record<string, string>;\n [key: string]: unknown;\n };\n spec?: Record<string, unknown>;\n /** Top-level extra fields for resources that don't use spec (e.g. Secret's data/stringData/type). */\n [key: string]: unknown;\n}\n\n/** Configuration options for a resource. */\nexport interface ResourceOptions {\n /** Whether auto-ready detection is enabled for this resource. Default: true. */\n autoReady?: boolean;\n}\n\n/**\n * A Construct that represents a single Crossplane managed/composed resource.\n *\n * The `spec` and `status` properties are proxy-wrapped for automatic\n * dependency tracking. Assigning a value from another resource's status\n * to this resource's spec automatically records a dependency edge.\n */\nexport class Resource<\n TSpec extends object = AnyFields,\n TStatus extends object = AnyFields,\n> extends Construct {\n readonly apiVersion: string;\n readonly kind: string;\n readonly resourceRef: ResourceRef;\n\n /** Proxy-wrapped desired spec — writes are tracked. */\n readonly spec: TSpec;\n /** Proxy-wrapped observed status — reads create dependency tracking. */\n readonly status: TStatus;\n /** Proxy-wrapped desired metadata. */\n readonly metadata: NonNullable<KubernetesResource['metadata']>;\n\n /**\n * Observed-mode tracked proxy over the entire resource document.\n * Use this to access arbitrary top-level fields on existing resources\n * (e.g., `secret.root.data.myKey` for a Secret, `configMap.root.data.key` for a ConfigMap).\n */\n readonly root: AnyFields;\n\n /** Whether auto-ready is enabled for this resource. */\n autoReady: boolean;\n\n /** Whether this is a read-only reference to an existing cluster resource. */\n readonly isExisting: boolean;\n\n /** If this is an existing resource, holds the reference metadata for the handler. */\n readonly existingRef: ExistingResourceRef | undefined;\n\n /** Extra top-level fields (e.g. data/stringData for Secret). Not proxy-tracked. */\n private readonly _extra: Record<string, unknown>;\n\n /** Observed state populated by the bridge before construction. */\n private _observed: KubernetesResource | undefined;\n\n /** Backing object for the status proxy — populated by setObserved(). */\n private readonly _statusTarget: Record<string, unknown>;\n\n /** Backing object for the spec proxy (existing resources only) — populated by setObservedFull(). */\n private readonly _specTarget: Record<string, unknown> | undefined;\n\n /** Backing object for the root proxy — populated by setObservedFull(). */\n private readonly _rootTarget: Record<string, unknown>;\n\n /** Backing object for the metadata proxy — populated by setObserved(). */\n private readonly _metaTarget: Record<string, unknown>;\n\n /** Keys the user explicitly declared in constructor metadata props. */\n private readonly _desiredMetaKeys: Set<string>;\n\n /** Explicit dependency refs. */\n private readonly _explicitDeps: ResourceRef[] = [];\n\n /** @internal */\n private readonly _graph: DependencyGraph;\n\n constructor(scope: Construct, id: string, props: ResourceProps, options?: ResourceOptions) {\n super(scope, id);\n\n this.apiVersion = props.apiVersion;\n this.kind = props.kind;\n this.autoReady = options?.autoReady ?? true;\n this.isExisting = false;\n this.existingRef = undefined;\n\n const collector = this.node.tryGetContext(CONTEXT_COLLECTOR) as DependencyCollector | undefined;\n const graph = this.node.tryGetContext(CONTEXT_GRAPH) as DependencyGraph | undefined;\n\n if (!collector || !graph) {\n throw new Error('Resource must be created within a Composition tree');\n }\n\n this.resourceRef = { id: this.node.path };\n graph.addResource(this.resourceRef);\n\n // Collect extra top-level fields (anything beyond the known keys)\n const KNOWN_KEYS = new Set(['apiVersion', 'kind', 'metadata', 'spec']);\n this._extra = {};\n for (const [k, v] of Object.entries(props)) {\n if (!KNOWN_KEYS.has(k)) this._extra[k] = v;\n }\n\n // Desired spec — tracks writes\n // Deep-clone the spec so that shared object references (e.g. a providerConfigRef\n // passed to multiple resources) aren't corrupted when resolveTrackedRefs\n // replaces tracked values with UNRESOLVED sentinels.\n const specTarget = deepCloneWithTracked((props.spec ?? {}) as Record<string, unknown>) as TSpec;\n // Deep-scan initial props for tracked proxy values from other resources.\n // Object literals in constructor args bypass the proxy set trap, so we\n // must find and process them before wrapping.\n resolveTrackedRefs(specTarget as Record<string, unknown>, this.resourceRef, 'spec', collector);\n this.spec = createTrackedProxy(specTarget, {\n owner: this.resourceRef,\n path: 'spec',\n observed: false,\n collector,\n });\n\n // Desired metadata — observed mode so that reading unset fields\n // (e.g. resource.metadata.name on a resource whose name is assigned\n // by Crossplane) creates a dependency edge that resolves from observed state.\n this._metaTarget = props.metadata ?? {};\n this._desiredMetaKeys = new Set(Object.keys(this._metaTarget));\n this.metadata = createTrackedProxy(this._metaTarget, {\n owner: this.resourceRef,\n path: 'metadata',\n observed: true,\n collector,\n }) as NonNullable<KubernetesResource['metadata']>;\n\n // Observed status — reads return tracked proxies for dependency detection.\n // We keep a reference to the backing object so setObserved() can populate\n // it, making resource.status work correctly after observed state arrives.\n this._statusTarget = {} as Record<string, unknown>;\n this.status = createTrackedProxy(this._statusTarget, {\n owner: this.resourceRef,\n path: 'status',\n observed: true,\n collector,\n }) as TStatus;\n\n // Root proxy — observed-mode proxy over the entire resource document.\n // Useful for non-standard top-level fields (Secret.data, ConfigMap.data, etc.)\n this._rootTarget = {} as Record<string, unknown>;\n this.root = createTrackedProxy(this._rootTarget, {\n owner: this.resourceRef,\n path: '',\n observed: true,\n collector,\n });\n\n this._specTarget = undefined;\n this._graph = graph;\n }\n\n /** Fully qualified path in the construct tree. */\n get path(): string {\n return this.node.path;\n }\n\n /** Add an explicit dependency on another resource. */\n addDependency(other: Resource): void {\n this._explicitDeps.push(other.resourceRef);\n this._graph.addExplicitDependency(this.resourceRef, other.resourceRef);\n }\n\n /** Get explicit dependency refs. */\n get explicitDependencies(): ReadonlyArray<ResourceRef> {\n return this._explicitDeps;\n }\n\n /** Set observed state (called by the bridge before compose). */\n setObserved(observed: KubernetesResource): void {\n this._observed = observed;\n\n // Snapshot any metadata keys written between construction and now\n // (e.g. via proxy writes like resource.metadata.annotations = {...}).\n for (const key of Object.keys(this._metaTarget)) {\n this._desiredMetaKeys.add(key);\n }\n\n // Populate backing objects so proxy reads (resource.metadata.name,\n // resource.status.vpcId) return real values for dependency resolution.\n // These observed keys are NOT tracked in _desiredMetaKeys, so they\n // won't appear in toDesired() output.\n if (observed.metadata && typeof observed.metadata === 'object') {\n Object.assign(this._metaTarget, observed.metadata);\n }\n if (observed.status && typeof observed.status === 'object') {\n Object.assign(this._statusTarget, observed.status);\n }\n }\n\n /** Get observed state. */\n get observed(): KubernetesResource | undefined {\n return this._observed;\n }\n\n /**\n * Compute a unique name for a resource based on its construct node path,\n * similar to `cdk.Names.uniqueResourceName`.\n *\n * The name is structured as:\n * `[namespace-]claimName-PathSegments[-extra]-hash8`\n *\n * - XR namespace (if present) and XR name are always prepended.\n * - Path segments (construct tree, root skipped) are appended next.\n * - An optional `extra` string is appended after the path.\n * - An 8-char hash of the full untruncated string is always appended for uniqueness.\n * - Whitespace in each segment is stripped (CDK convention).\n * - Disallowed characters are replaced by the separator; consecutive separators are collapsed.\n * - The result is truncated to `maxLength` while keeping the hash suffix.\n *\n * @param scope - The construct whose node path is used.\n * @param options - Optional tuning.\n */\n static uniqueName(\n scope: Construct,\n options: {\n /** Maximum length of the resulting name. Default: 63. */\n maxLength?: number;\n /** Separator inserted between path segments (also replaces disallowed chars). Default: \"-\". */\n separator?: string;\n /** Regex of characters to keep. Anything else is replaced by the separator. Default: /[^a-zA-Z0-9]/g */\n allowedPattern?: RegExp;\n /** Extra string appended after the path segments and before the hash. */\n extra?: string;\n } = {},\n ): string {\n const maxLength = options.maxLength ?? 63;\n const separator = options.separator ?? '-';\n const allowedPattern = options.allowedPattern ?? /[^a-zA-Z0-9]/g;\n const escapedSep = separator.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const collapseRe = new RegExp(`${escapedSep}+`, 'g');\n\n const clean = (s: string) =>\n s\n .replace(/\\s+/g, '') // strip whitespace (CDK convention)\n .replace(allowedPattern, separator)\n .replace(collapseRe, separator)\n .replace(new RegExp(`^${escapedSep}|${escapedSep}$`, 'g'), ''); // trim leading/trailing sep\n\n // Retrieve XR name/namespace stored by Composition in context\n const xrMeta = scope.node.tryGetContext(CONTEXT_XR_META) as\n | { name?: string; namespace?: string }\n | undefined;\n const xrName = xrMeta?.name;\n const xrNamespace = xrMeta?.namespace;\n\n // Build ordered parts: [namespace, claimName, ...pathSegments, extra]\n const parts: string[] = [];\n if (xrNamespace) parts.push(clean(xrNamespace));\n if (xrName) parts.push(clean(xrName));\n\n // node.scopes[0] is the root Composition — skip it\n for (const s of scope.node.scopes.slice(1)) {\n const c = clean(s.node.id);\n if (c) parts.push(c);\n }\n\n if (options.extra) {\n const c = clean(options.extra);\n if (c) parts.push(c);\n }\n\n const full = parts.join(separator);\n const hash = shortHash(full);\n\n // Always append hash\n const withHash = `${full}${separator}${hash}`;\n\n if (withHash.length <= maxLength) return withHash;\n\n // Truncate prefix, keep separator + hash (8 chars)\n const prefix = full.slice(0, maxLength - hash.length - separator.length);\n return `${prefix}${separator}${hash}`;\n }\n\n /**\n * Serialize to a plain Kubernetes resource object for the desired state.\n * Strips proxy wrappers, UNRESOLVED sentinels, and server-managed metadata\n * fields (uid, resourceVersion, etc.) that must not appear in desired state.\n */\n toDesired(): KubernetesResource {\n // Only emit metadata keys the user explicitly declared or wrote via proxy.\n // Observed state (uid, resourceVersion, server-set labels, etc.) is used\n // for dependency resolution reads but must NOT flow back as desired state —\n // a function should only return its intent.\n const fullMeta = JSON.parse(JSON.stringify(this.metadata)) as Record<string, unknown>;\n const desiredMeta: Record<string, unknown> = {};\n for (const key of this._desiredMetaKeys) {\n if (key in fullMeta) {\n desiredMeta[key] = fullMeta[key];\n }\n }\n const cleanMeta = stripUnresolved(desiredMeta) as KubernetesResource['metadata'];\n\n const desired: KubernetesResource = {\n // Spread extra top-level fields first so spec/metadata take precedence\n ...this._extra,\n apiVersion: this.apiVersion,\n kind: this.kind,\n metadata: cleanMeta,\n spec: stripUnresolved(JSON.parse(JSON.stringify(this.spec))) as Record<string, unknown>,\n };\n // Drop spec entirely if it's empty and there were no spec props in the schema\n if (\n desired.spec &&\n typeof desired.spec === 'object' &&\n Object.keys(desired.spec).length === 0\n ) {\n delete desired.spec;\n }\n return desired;\n }\n\n /**\n * Populate the full observed state for an existing resource.\n * Feeds data into `root`, `status`, `spec`, and `metadata` backing targets\n * so that proxy reads resolve to real values.\n */\n setObservedFull(resource: KubernetesResource): void {\n this._observed = resource;\n // Populate root target with all top-level fields\n for (const [key, value] of Object.entries(resource)) {\n if (value !== null && value !== undefined) {\n this._rootTarget[key] = value;\n }\n }\n // Populate status target\n if (resource.status && typeof resource.status === 'object') {\n Object.assign(this._statusTarget, resource.status);\n }\n // Populate spec target (for existing resources the spec proxy is observed-mode)\n if (this._specTarget && resource.spec && typeof resource.spec === 'object') {\n Object.assign(this._specTarget, resource.spec);\n }\n // Populate metadata target\n if (resource.metadata && typeof resource.metadata === 'object') {\n Object.assign(this._metaTarget, resource.metadata);\n }\n }\n\n /**\n * Create a read-only reference to an existing cluster resource.\n * The resource will be fetched by Crossplane via the Required Resources mechanism.\n * Its `status`, `spec`, and `root` proxies can be read to create dependency edges.\n *\n * @param scope - Parent construct (typically `this` inside a Composition constructor)\n * @param apiVersion - API version of the resource (e.g. \"example.io/v1\")\n * @param kind - Kind of the resource (e.g. \"Project\")\n * @param name - Name of the resource (can be a literal string or a tracked proxy value)\n * @param namespace - Optional namespace of the resource\n */\n static fromExistingByName(\n scope: Construct,\n apiVersion: string,\n kind: string,\n name: unknown,\n namespace?: string,\n ): Resource {\n // Compute a deterministic refKey\n const resolvedName = typeof name === 'string' ? name : undefined;\n const refKey = computeRefKey(apiVersion, kind, resolvedName, namespace);\n\n // Use refKey as construct id (unique within scope), sanitized for construct tree paths\n const id = `__existing__${refKey.replace(/\\//g, '_')}`;\n const resource = new Resource(scope, id, {\n apiVersion,\n kind,\n spec: {},\n });\n\n // Override fields to mark as existing\n (resource as { isExisting: boolean }).isExisting = true;\n (resource as { existingRef: ExistingResourceRef }).existingRef = {\n apiVersion,\n kind,\n name,\n namespace,\n refKey,\n };\n\n // For existing resources, replace the spec proxy with an observed-mode one\n const collector = resource.node.tryGetContext(CONTEXT_COLLECTOR) as DependencyCollector;\n const specTarget = {} as Record<string, unknown>;\n (resource as unknown as { _specTarget: Record<string, unknown> | undefined })._specTarget =\n specTarget;\n (resource as { spec: AnyFields }).spec = createTrackedProxy(specTarget, {\n owner: resource.resourceRef,\n path: 'spec',\n observed: true,\n collector,\n });\n\n // Register on the composition's existing resources registry\n const existingMap = resource.node.tryGetContext(CONTEXT_EXISTING) as\n | Map<string, Resource>\n | undefined;\n if (existingMap) {\n existingMap.set(refKey, resource);\n }\n\n return resource;\n }\n}\n\n/**\n * Compute a deterministic reference key for an existing resource.\n * Format: \"apiVersion/kind/[namespace/]name\" or \"apiVersion/kind/__unresolved__\" if name is not yet known.\n */\nexport function computeRefKey(\n apiVersion: string,\n kind: string,\n name: string | undefined,\n namespace?: string,\n): string {\n const namePart = name ?? '__unresolved__';\n if (namespace) {\n return `${apiVersion}/${kind}/${namespace}/${namePart}`;\n }\n return `${apiVersion}/${kind}/${namePart}`;\n}\n\n/**\n * Produce an 8-character hex hash of a string using a simple djb2-style\n * algorithm — no crypto dependency required.\n */\nfunction shortHash(s: string): string {\n let h = 5381;\n for (let i = 0; i < s.length; i++) {\n h = ((h << 5) + h) ^ s.charCodeAt(i);\n h = h >>> 0; // keep unsigned 32-bit\n }\n return h.toString(16).padStart(8, '0');\n}\n\n/** Recursively remove UNRESOLVED sentinel values from an object. */\nfunction stripUnresolved(obj: unknown): unknown {\n if (obj === null || obj === undefined) return obj;\n if (typeof obj === 'symbol' && obj === UNRESOLVED) return undefined;\n\n if (Array.isArray(obj)) {\n return obj.map(stripUnresolved);\n }\n\n if (typeof obj === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n const cleaned = stripUnresolved(value);\n if (cleaned !== undefined) {\n result[key] = cleaned;\n }\n }\n return result;\n }\n\n return obj;\n}\n\n/**\n * Deep-clone an object while preserving tracked proxy references.\n * Plain objects and arrays are cloned; tracked proxies and primitives are kept as-is.\n */\nfunction deepCloneWithTracked(obj: unknown): unknown {\n if (obj === null || obj === undefined) return obj;\n if (isTracked(obj)) return obj;\n if (typeof obj !== 'object') return obj;\n\n if (Array.isArray(obj)) {\n return obj.map(deepCloneWithTracked);\n }\n\n const clone: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n clone[key] = deepCloneWithTracked(value);\n }\n return clone;\n}\n\n/**\n * Recursively scan an object for tracked proxy values from other resources.\n * For each one found, record a dependency edge and replace the value with\n * the UNRESOLVED sentinel. This handles values passed via object literals\n * in constructor props, which bypass the proxy's set trap.\n */\nfunction resolveTrackedRefs(\n obj: Record<string, unknown>,\n owner: ResourceRef,\n basePath: string,\n collector: DependencyCollector,\n): void {\n for (const [key, value] of Object.entries(obj)) {\n const path = basePath ? `${basePath}.${key}` : key;\n\n if (isTracked(value)) {\n const sourceMeta = getTrackingMeta(value);\n if (sourceMeta && sourceMeta.owner.id !== owner.id) {\n collector.addEdge({\n from: sourceMeta.owner,\n fromPath: sourceMeta.path,\n to: owner,\n toPath: path,\n });\n obj[key] = UNRESOLVED;\n }\n continue;\n }\n\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n if (isTracked(item)) {\n const sourceMeta = getTrackingMeta(item);\n if (sourceMeta && sourceMeta.owner.id !== owner.id) {\n collector.addEdge({\n from: sourceMeta.owner,\n fromPath: sourceMeta.path,\n to: owner,\n toPath: `${path}[${i}]`,\n });\n value[i] = UNRESOLVED;\n }\n } else if (typeof item === 'object' && item !== null) {\n resolveTrackedRefs(item as Record<string, unknown>, owner, `${path}[${i}]`, collector);\n }\n }\n continue;\n }\n\n if (typeof value === 'object' && value !== null) {\n resolveTrackedRefs(value as Record<string, unknown>, owner, path, collector);\n }\n }\n}\n","import type { KubernetesResource } from '../core/resource.js';\n\n/** Condition from a Kubernetes resource's status.conditions array. */\ninterface StatusCondition {\n type: string;\n status: string;\n reason?: string;\n message?: string;\n}\n\n/**\n * Determines if a Crossplane managed resource is ready based on its\n * observed status conditions.\n *\n * - If the resource has a `Ready: True` condition → ready.\n * - If the resource has a `Ready: False` condition → not ready.\n * - If the resource exists but has no `Ready` condition at all (e.g. Namespace,\n * ProviderConfig) → considered ready (the resource exists and is functional).\n * - If not yet observed → not ready.\n */\nexport function isResourceReady(observed: KubernetesResource | undefined): boolean {\n if (!observed) return false;\n\n const conditions = observed.status?.conditions as StatusCondition[] | undefined;\n\n // No conditions at all — resource exists, treat as ready\n if (!Array.isArray(conditions) || conditions.length === 0) return true;\n\n const readyCondition = conditions.find((c) => c.type === 'Ready');\n\n // No Ready condition but other conditions exist — treat as ready\n if (!readyCondition) return true;\n\n return readyCondition.status === 'True';\n}\n\n/**\n * Gets the Ready condition from a resource, if present.\n */\nexport function getReadyCondition(\n observed: KubernetesResource | undefined,\n): StatusCondition | undefined {\n if (!observed?.status) return undefined;\n\n const conditions = observed.status.conditions as StatusCondition[] | undefined;\n if (!Array.isArray(conditions)) return undefined;\n\n return conditions.find((c) => c.type === 'Ready');\n}\n","import type { KubernetesResource, Resource } from '../core/resource.js';\nimport type { DependencyGraph } from '../tracking/index.js';\nimport { UNRESOLVED } from '../tracking/proxy.js';\n\n/** Result of dependency resolution for a single resource. */\nexport interface ResolutionResult {\n /** The resource. */\n resource: Resource;\n /** Whether all dependencies are satisfied and the resource can be emitted. */\n ready: boolean;\n /** Paths that are still unresolved (waiting on upstream). */\n unresolvedPaths: string[];\n}\n\n/** Result of resolving all resources in a composition. */\nexport interface SequencingResult {\n /** Resources in dependency order that are ready to emit. */\n emit: Resource[];\n /** Resources blocked on unresolved dependencies. */\n blocked: Resource[];\n /** Topologically sorted resource IDs. */\n order: string[];\n}\n\n/**\n * Resolves resource dependencies and determines which resources can be\n * emitted in the current pass.\n *\n * Algorithm:\n * 1. Topologically sort resources using the dependency graph.\n * 2. For each resource (in order), check if upstream dependencies have\n * resolved values in observed state.\n * 3. If all deps resolved → emit. If any dep unresolved → block.\n */\nexport function resolveSequencing(\n resources: ReadonlyMap<string, Resource>,\n graph: DependencyGraph,\n observedResources: ReadonlyMap<string, KubernetesResource>,\n): SequencingResult {\n const order = graph.topologicalSort();\n const emit: Resource[] = [];\n const blocked: Resource[] = [];\n\n for (const resourceId of order) {\n const resource = findResourceByRef(resources, resourceId);\n if (!resource) continue;\n\n const deps = graph.getDependencies(resourceId);\n let allDepsReady = true;\n\n for (const depId of deps) {\n // Check if the dependency resource has been observed\n const depResource = findResourceByRef(resources, depId);\n if (!depResource) {\n // Dependency might be an existing (external) resource — check observedResources directly\n const observedByPath = observedResources.get(depId);\n if (!observedByPath) {\n allDepsReady = false;\n }\n continue;\n }\n\n const observed = observedResources.get(depResource.path);\n if (!observed) {\n allDepsReady = false;\n }\n }\n\n // Even if all deps are observed, check that this resource's\n // desired state has no UNRESOLVED sentinels\n if (allDepsReady && hasUnresolvedFields(resource)) {\n allDepsReady = false;\n }\n\n if (allDepsReady) {\n emit.push(resource);\n } else {\n blocked.push(resource);\n }\n }\n\n return { emit, blocked, order };\n}\n\n/**\n * Check if a resource's desired state contains any UNRESOLVED sentinels.\n * Uses the raw spec/metadata before stripping, so UNRESOLVED symbols are visible.\n */\nfunction hasUnresolvedFields(resource: Resource): boolean {\n // Serialize via JSON — UNRESOLVED symbols become undefined/disappear,\n // but we need to check the raw proxy values. Use the toDesired output\n // which preserves UNRESOLVED before stripUnresolved runs.\n // Actually, walk the spec proxy directly.\n return containsUnresolved(resource.spec) || containsUnresolved(resource.metadata);\n}\n\n/** Recursively check if an object contains UNRESOLVED sentinels. */\nfunction containsUnresolved(obj: unknown): boolean {\n if (obj === UNRESOLVED) return true;\n if (obj === null || obj === undefined) return false;\n\n if (Array.isArray(obj)) {\n return obj.some(containsUnresolved);\n }\n\n if (typeof obj === 'object') {\n return Object.values(obj as Record<string, unknown>).some(containsUnresolved);\n }\n\n return false;\n}\n\n/** Find a resource by its ref ID (which is the path). */\nfunction findResourceByRef(\n resources: ReadonlyMap<string, Resource>,\n refId: string,\n): Resource | undefined {\n return resources.get(refId);\n}\n"],"mappings":";;;;;;;AAOA,IAAa,kBAAb,MAA6B;;CAE3B,wBAAyB,IAAI,IAAyB;;CAEtD,6BAA8B,IAAI,IA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D,IAAI,CAAC,aAAa;IAGhB,IAAI,CADmB,kBAAkB,IAAI,KAC3B,GAChB,eAAe;IAEjB;GACF;GAGA,IAAI,CADa,kBAAkB,IAAI,YAAY,IACvC,GACV,eAAe;EAEnB;EAIA,IAAI,gBAAgB,oBAAoB,QAAQ,GAC9C,eAAe;EAGjB,IAAI,cACF,KAAK,KAAK,QAAQ;OAElB,QAAQ,KAAK,QAAQ;CAEzB;CAEA,OAAO;EAAE;EAAM;EAAS;CAAM;AAChC;;;;;AAMA,SAAS,oBAAoB,UAA6B;CAKxD,OAAO,mBAAmB,SAAS,IAAI,KAAK,mBAAmB,SAAS,QAAQ;AAClF;;AAGA,SAAS,mBAAmB,KAAuB;CACjD,IAAI,QAAQ,YAAY,OAAO;CAC/B,IAAI,QAAQ,QAAQ,QAAQ,KAAA,GAAW,OAAO;CAE9C,IAAI,MAAM,QAAQ,GAAG,GACnB,OAAO,IAAI,KAAK,kBAAkB;CAGpC,IAAI,OAAO,QAAQ,UACjB,OAAO,OAAO,OAAO,GAA8B,EAAE,KAAK,kBAAkB;CAG9E,OAAO;AACT;;AAGA,SAAS,kBACP,WACA,OACsB;CACtB,OAAO,UAAU,IAAI,KAAK;AAC5B"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Construct","tryExtractPrimitive","Construct","tryExtractPrimitive","getNestedValue"],"sources":["../src/core/context.ts","../src/core/composition.ts","../src/tracking/dependency-graph.ts","../src/tracking/read-proxy.ts","../src/tracking/types.ts","../src/tracking/write-proxy.ts","../src/core/resource.ts","../src/logging/context.ts","../src/pipeline/diagnose.ts","../src/pipeline/emit.ts","../src/pipeline/hydrate.ts","../src/pipeline/resolve.ts","../src/pipeline/sequence.ts","../src/pipeline/index.ts","../src/readiness/defaults.ts","../src/readiness/evaluate.ts","../src/run.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { DependencyGraph, EdgeCollector } from '../tracking/index.js';\n\n/**\n * Runtime context passed into a Composition during construction\n * via AsyncLocalStorage. Holds everything the Composition needs\n * without relying on static state or globalThis.\n */\nexport interface CompositionContext {\n /** Observed XR data. */\n xr: Record<string, unknown>;\n /** Full Crossplane function pipeline context (all keys). */\n pipelineContext: ReadonlyMap<string, unknown>;\n /** Pre-populated data for existing resources (from prior iterations). */\n requiredResources: ReadonlyMap<string, Record<string, unknown>>;\n /** The dependency graph for this composition run. */\n graph: DependencyGraph;\n /** The edge collector for this composition run. */\n collector: EdgeCollector;\n}\n\n/**\n * AsyncLocalStorage instance that carries the CompositionContext.\n * The handler sets it before constructing the user's Composition,\n * and the Composition constructor reads from it.\n */\nexport const compositionStorage = new AsyncLocalStorage<CompositionContext>();\n\n/**\n * Get the current composition context from AsyncLocalStorage.\n * Throws if called outside of a composition construction scope.\n */\nexport function getCompositionContext(): CompositionContext {\n const ctx = compositionStorage.getStore();\n if (ctx) return ctx;\n\n throw new Error(\n 'No composition context found. Ensure the Composition is constructed within compositionStorage.run().',\n );\n}\n","import { Construct } from 'constructs';\n\nimport type { DependencyGraph, EdgeCollector } from '../tracking/index.js';\nimport { getCompositionContext } from './context.js';\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\n/**\n * Base generics for a Composition.\n * - TSpec: shape of the XR's spec\n * - TStatus: shape of the XR's status (writable)\n * - TContext: shape of the pipeline context map keys→values\n */\nexport type CompositionProps<\n TSpec = Record<string, unknown>,\n TStatus = Record<string, unknown>,\n TContext extends object = Record<string, unknown>,\n> = {\n spec?: TSpec;\n status?: TStatus;\n context?: TContext;\n};\n\n/** The shape of the XR proxy exposed via `this.xr`. */\nexport interface XrProxy<TSpec = Record<string, unknown>, TStatus = Record<string, unknown>> {\n spec: TSpec;\n status: TStatus;\n metadata: {\n name: string;\n namespace?: string;\n labels?: Record<string, string>;\n annotations?: Record<string, string>;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n// ─── Composition class ────────────────────────────────────────────────────────\n\n/**\n * Base class for user-authored Crossplane compositions.\n *\n * Users extend this class and define resources in the constructor:\n *\n * ```ts\n * class MyComposition extends Composition<MySpec, MyStatus> {\n * constructor() {\n * super();\n * const vpc = new Vpc(this, 'vpc', { spec: { ... } });\n * this.xr.status.vpcId = vpc.status.atProvider.vpcId;\n * }\n * }\n * ```\n *\n * `this.xr` is a \"desired-first, fallback-to-observed\" proxy over the XR.\n * `this.pipelineContext` provides typed read-only access to Crossplane function context.\n */\nexport class Composition<\n TSpec = Record<string, unknown>,\n TStatus = Record<string, unknown>,\n TContext extends object = Record<string, unknown>,\n> extends Construct {\n /**\n * The XR proxy — reads from desired first (status writes), falls through to observed.\n * Writing to `this.xr.status.*` sets the composite status output.\n */\n readonly xr: XrProxy<TSpec, TStatus>;\n\n /** The dependency graph tracking resource relationships. */\n readonly graph: DependencyGraph;\n\n /** The edge collector accumulating dependency edges. */\n readonly collector: EdgeCollector;\n\n constructor() {\n // Use 'Composition' as the root construct ID\n super(undefined as unknown as Construct, 'Composition');\n\n const ctx = getCompositionContext();\n\n this.graph = ctx.graph;\n this.collector = ctx.collector;\n\n // Set context values on the construct tree so Resources can find them\n this.node.setContext('xplane:graph', ctx.graph);\n this.node.setContext('xplane:collector', ctx.collector);\n\n // Set XR metadata on tree for Resource.uniqueName()\n const xrMeta = ctx.xr.metadata as { name?: string; namespace?: string } | undefined;\n if (xrMeta) {\n this.node.setContext('xplane:xr-meta', xrMeta);\n }\n\n // Build the XR proxy\n this.xr = createXrProxy<TSpec, TStatus>(ctx);\n }\n\n /**\n * Read-only accessor for Crossplane function pipeline context.\n * Keys are the context keys set by Crossplane or prior functions in the pipeline.\n */\n get pipelineContext(): PipelineContextAccessor<TContext> {\n const ctx = getCompositionContext();\n return {\n get<K extends keyof TContext>(key: K): TContext[K] | undefined {\n return ctx.pipelineContext.get(key as string) as TContext[K] | undefined;\n },\n has(key: keyof TContext): boolean {\n return ctx.pipelineContext.has(key as string);\n },\n keys(): IterableIterator<keyof TContext> {\n return ctx.pipelineContext.keys() as IterableIterator<keyof TContext>;\n },\n };\n }\n}\n\n/** Typed read-only interface for pipeline context. */\nexport interface PipelineContextAccessor<TContext extends object = Record<string, unknown>> {\n get<K extends keyof TContext>(key: K): TContext[K] | undefined;\n has(key: keyof TContext): boolean;\n keys(): IterableIterator<keyof TContext>;\n}\n\n// ─── XR Proxy ─────────────────────────────────────────────────────────────────\n\n/**\n * Creates the \"desired-first, fallback-to-observed\" proxy for the XR.\n *\n * - Reading `xr.spec.*` reads from observed XR spec (creates ReadProxy for tracking)\n * - Writing `xr.status.*` writes to a desired-status store (emitted as composite status)\n * - Other reads fall through to observed\n */\nfunction createXrProxy<TSpec, TStatus>(ctx: {\n xr: Record<string, unknown>;\n graph: DependencyGraph;\n collector: EdgeCollector;\n}): XrProxy<TSpec, TStatus> {\n const xrObserved = ctx.xr;\n const xrDesiredStatus: Record<string, unknown> = {};\n\n // The XR ref for dependency tracking\n const xrRef = { id: '__xr__' };\n ctx.graph.addResource(xrRef);\n\n const statusProxy = new Proxy(xrDesiredStatus, {\n get(_target, prop) {\n if (typeof prop === 'symbol') return undefined;\n const key = String(prop);\n // Desired-first\n if (key in xrDesiredStatus) return xrDesiredStatus[key];\n // Fallback to observed status\n const observedStatus = xrObserved.status as Record<string, unknown> | undefined;\n if (observedStatus && key in observedStatus) {\n return observedStatus[key];\n }\n return undefined;\n },\n set(_target, prop, value) {\n if (typeof prop === 'symbol') return false;\n xrDesiredStatus[String(prop)] = value;\n return true;\n },\n has(_target, prop) {\n if (typeof prop === 'symbol') return false;\n const key = String(prop);\n if (key in xrDesiredStatus) return true;\n const observedStatus = xrObserved.status as Record<string, unknown> | undefined;\n return observedStatus ? key in observedStatus : false;\n },\n });\n\n const proxy = new Proxy({} as XrProxy<TSpec, TStatus>, {\n get(_target, prop) {\n if (typeof prop === 'symbol') return undefined;\n const key = String(prop);\n if (key === 'status') return statusProxy;\n // Everything else reads from observed XR\n if (key in xrObserved) return xrObserved[key];\n return undefined;\n },\n set(_target, prop, value) {\n if (typeof prop === 'symbol') return false;\n const key = String(prop);\n if (key === 'status') {\n // Allow replacing entire status\n Object.assign(xrDesiredStatus, value as object);\n return true;\n }\n // Writes to other top-level XR fields are unusual but allowed\n (xrObserved as Record<string, unknown>)[key] = value;\n return true;\n },\n has(_target, prop) {\n if (typeof prop === 'symbol') return false;\n return String(prop) in xrObserved || String(prop) === 'status';\n },\n });\n\n return proxy;\n}\n\n/**\n * Extract the desired XR status from a Composition instance.\n * Used by the emit pipeline phase to produce composite status output.\n */\nexport function getXrDesiredStatus(composition: Composition): Record<string, unknown> {\n // Access the internal status proxy target\n const statusProxy = composition.xr.status;\n // Collect all keys from the status proxy.\n // We intentionally return raw values (including ReadProxy references) so\n // that the emit phase can resolve them from observed resource data.\n const result: Record<string, unknown> = {};\n if (statusProxy && typeof statusProxy === 'object') {\n for (const key of Object.keys(statusProxy)) {\n const value = (statusProxy as Record<string, unknown>)[key];\n if (value != null) {\n result[key] = value;\n }\n }\n }\n return result;\n}\n","import type { DependencyEdge, ResourceRef } from './types.js';\n\n/**\n * Tracks dependency relationships between resources as a directed acyclic graph.\n * Edges are added as resources reference each other's observed state.\n */\nexport class DependencyGraph {\n private readonly _adjacency = new Map<string, Set<string>>();\n private readonly _resources = new Map<string, ResourceRef>();\n private readonly _edges: DependencyEdge[] = [];\n\n addResource(ref: ResourceRef): void {\n this._resources.set(ref.id, ref);\n if (!this._adjacency.has(ref.id)) {\n this._adjacency.set(ref.id, new Set());\n }\n }\n\n addEdge(edge: DependencyEdge): void {\n this.addResource(edge.from);\n this.addResource(edge.to);\n this._adjacency.get(edge.to.id)!.add(edge.from.id);\n this._edges.push(edge);\n }\n\n addEdges(edges: ReadonlyArray<DependencyEdge>): void {\n for (const edge of edges) this.addEdge(edge);\n }\n\n addExplicitDependency(dependent: ResourceRef, dependency: ResourceRef): void {\n this.addResource(dependent);\n this.addResource(dependency);\n this._adjacency.get(dependent.id)!.add(dependency.id);\n }\n\n /** Get the set of resource IDs that `resourceId` depends on. */\n getDependencies(resourceId: string): ReadonlySet<string> {\n return this._adjacency.get(resourceId) ?? new Set();\n }\n\n get resourceIds(): ReadonlyArray<string> {\n return [...this._resources.keys()];\n }\n\n get edges(): ReadonlyArray<DependencyEdge> {\n return this._edges;\n }\n\n /**\n * Returns a topological ordering of resources.\n * If a cycle is detected, returns { order: null, cycle: string[] }.\n */\n topologicalSort(): { order: string[] } | { order: null; cycle: string[] } {\n const visited = new Set<string>();\n const visiting = new Set<string>();\n const sorted: string[] = [];\n\n const visit = (id: string): string[] | null => {\n if (visited.has(id)) return null;\n if (visiting.has(id)) {\n // Build cycle path\n return [...visiting, id];\n }\n visiting.add(id);\n const deps = this._adjacency.get(id);\n if (deps) {\n for (const depId of deps) {\n const cycle = visit(depId);\n if (cycle) return cycle;\n }\n }\n visiting.delete(id);\n visited.add(id);\n sorted.push(id);\n return null;\n };\n\n for (const id of this._resources.keys()) {\n const cycle = visit(id);\n if (cycle) {\n // Trim cycle to start from the repeated node\n const start = cycle[cycle.length - 1]!;\n const startIdx = cycle.indexOf(start);\n return { order: null, cycle: cycle.slice(startIdx) };\n }\n }\n return { order: sorted };\n }\n}\n","import type { ReadProxyMeta, ResourceRef } from './types.js';\n\n/**\n * WeakMap storing metadata for ReadProxy instances.\n * This avoids polluting proxy objects with symbols.\n */\nconst proxyMeta = new WeakMap<object, ReadProxyMeta>();\n\n/** Sentinel symbol to identify ReadProxy instances. */\nconst READ_PROXY_TAG = Symbol.for('xplane.readProxy');\n\n/**\n * Check if a value is a ReadProxy.\n */\nexport function isReadProxy(value: unknown): value is object {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as Record<symbol, unknown>)[READ_PROXY_TAG] === true\n );\n}\n\n/**\n * Get the metadata for a ReadProxy value.\n */\nexport function getReadProxyMeta(value: unknown): ReadProxyMeta | undefined {\n if (!isReadProxy(value)) return undefined;\n return proxyMeta.get(value as object);\n}\n\n/**\n * Creates a ReadProxy that wraps observed data.\n *\n * - Property access navigates into the data, building up the path.\n * - Missing paths return `undefined` (no placeholder proxies).\n * - The proxy carries owner + path metadata so that when it's assigned\n * to a WriteProxy, the dependency edge can be recorded.\n */\nexport function createReadProxy<T extends object>(\n target: T,\n owner: ResourceRef,\n basePath: string,\n): T {\n const proxy = new Proxy(target, {\n get(obj, prop, receiver) {\n // Identity checks\n if (prop === READ_PROXY_TAG) return true;\n if (typeof prop === 'symbol') return Reflect.get(obj, prop, receiver);\n if (prop === 'toJSON') return () => obj;\n\n const childPath = basePath ? `${basePath}.${String(prop)}` : String(prop);\n const value = Reflect.get(obj, prop, receiver);\n\n if (value === undefined || value === null) {\n // Return a \"leaf\" proxy with undefined target — carries metadata\n // for dependency edge creation but resolves to undefined\n return createLeafReadProxy(owner, childPath);\n }\n\n if (typeof value === 'object') {\n // Wrap nested objects so path accumulates\n return createReadProxy(value as object, owner, childPath);\n }\n\n // Primitive — wrap in a tagged object so it can carry metadata\n // when assigned to a WriteProxy\n return createPrimitiveReadProxy(value as string | number | boolean, owner, childPath);\n },\n\n has(obj, prop) {\n if (prop === READ_PROXY_TAG) return true;\n return Reflect.has(obj, prop);\n },\n });\n\n proxyMeta.set(proxy, { owner, path: basePath });\n return proxy as T;\n}\n\n/**\n * A \"leaf\" ReadProxy for paths that don't exist in observed data yet.\n * Carries metadata for edge creation. Resolves to `undefined` when\n * coerced to a primitive.\n */\nfunction createLeafReadProxy(owner: ResourceRef, path: string): object {\n const target = Object.create(null) as Record<string | symbol, unknown>;\n const proxy = new Proxy(target, {\n get(_obj, prop) {\n if (prop === READ_PROXY_TAG) return true;\n if (prop === Symbol.toPrimitive) return () => `__pending__${owner.id}__${path}`;\n if (typeof prop === 'symbol') return undefined;\n if (prop === 'toJSON') return () => undefined;\n if (prop === 'toString') return () => `__pending__${owner.id}__${path}`;\n if (prop === 'valueOf') return () => proxy;\n // Nested access on a leaf — still a leaf with extended path\n return createLeafReadProxy(owner, `${path}.${String(prop)}`);\n },\n has(_obj, prop) {\n if (prop === READ_PROXY_TAG) return true;\n return false;\n },\n });\n proxyMeta.set(proxy, { owner, path });\n return proxy;\n}\n\n/**\n * Wraps a concrete primitive value so it carries ReadProxy metadata.\n * This allows the WriteProxy to detect it during assignment and\n * record the dependency edge, while the value itself resolves correctly.\n */\nexport function createPrimitiveReadProxy(\n value: string | number | boolean,\n owner: ResourceRef,\n path: string,\n): object {\n const target = Object.create(null) as Record<string | symbol, unknown>;\n const proxy = new Proxy(target, {\n get(_obj, prop) {\n if (prop === READ_PROXY_TAG) return true;\n if (prop === Symbol.toPrimitive) return () => value;\n if (prop === 'valueOf') return () => value;\n if (prop === 'toString') return () => String(value);\n if (prop === 'toJSON') return () => value;\n if (typeof prop === 'symbol') return undefined;\n // Navigating into a primitive — leaf\n return createLeafReadProxy(owner, `${path}.${String(prop)}`);\n },\n has(_obj, prop) {\n if (prop === READ_PROXY_TAG) return true;\n return false;\n },\n });\n proxyMeta.set(proxy, { owner, path });\n return proxy;\n}\n","/** Identifies a resource in the dependency graph. */\nexport interface ResourceRef {\n readonly id: string;\n}\n\n/** A dependency edge between two resources at specific field paths. */\nexport interface DependencyEdge {\n /** Resource being read from (observed state). */\n readonly from: ResourceRef;\n /** Path in the source resource's observed data. */\n readonly fromPath: string;\n /** Resource being written to (desired state). */\n readonly to: ResourceRef;\n /** Path in the target resource's desired data. */\n readonly toPath: string;\n}\n\n/**\n * A Pending marker stored in a desired document when a ReadProxy value\n * is assigned. Carries full source info so the resolve phase knows\n * where to look for the concrete value.\n */\nconst PENDING_TAG: unique symbol = Symbol.for('xplane.pending') as unknown as typeof PENDING_TAG;\n\nexport class Pending {\n static readonly TAG = PENDING_TAG;\n readonly [PENDING_TAG] = true;\n\n constructor(\n /** The resource that owns the observed data. */\n readonly source: ResourceRef,\n /** The path within that resource's observed data. */\n readonly path: string,\n ) {}\n\n static is(value: unknown): value is Pending {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as Record<symbol, unknown>)[PENDING_TAG] === true\n );\n }\n}\n\n/** Metadata associated with a ReadProxy instance. */\nexport interface ReadProxyMeta {\n readonly owner: ResourceRef;\n readonly path: string;\n}\n","import { getReadProxyMeta, isReadProxy } from './read-proxy.js';\nimport { type DependencyEdge, Pending, type ResourceRef } from './types.js';\n\n/**\n * Collector that accumulates dependency edges discovered during\n * WriteProxy assignments.\n */\nexport class EdgeCollector {\n private readonly _edges: DependencyEdge[] = [];\n\n add(edge: DependencyEdge): void {\n // Deduplicate\n const exists = this._edges.some(\n (e) =>\n e.from.id === edge.from.id &&\n e.fromPath === edge.fromPath &&\n e.to.id === edge.to.id &&\n e.toPath === edge.toPath,\n );\n if (!exists) this._edges.push(edge);\n }\n\n get edges(): ReadonlyArray<DependencyEdge> {\n return this._edges;\n }\n}\n\nexport interface WriteProxyOptions {\n /** The resource that owns this desired document. */\n owner: ResourceRef;\n /** The collector to record edges into. */\n collector: EdgeCollector;\n /** Base path prefix (e.g., \"spec\" when wrapping the spec subtree). */\n basePath?: string;\n}\n\n/**\n * Creates a WriteProxy that wraps a desired document.\n *\n * - Writes store values in the target.\n * - When a ReadProxy value is assigned, it records a dependency edge\n * and stores a Pending marker if the value is not yet concrete.\n * - Reads return the stored value (desired-first).\n */\nexport function createWriteProxy<T extends object>(target: T, opts: WriteProxyOptions): T {\n const { owner, collector, basePath = '' } = opts;\n\n return new Proxy(target, {\n get(obj, prop, receiver) {\n if (typeof prop === 'symbol') return Reflect.get(obj, prop, receiver);\n if (prop === 'toJSON') return () => obj;\n\n const value = Reflect.get(obj, prop, receiver);\n\n // If the value is a nested object (not a Pending), wrap it recursively\n if (typeof value === 'object' && value !== null && !Pending.is(value)) {\n const childPath = basePath ? `${basePath}.${String(prop)}` : String(prop);\n return createWriteProxy(value as object, { owner, collector, basePath: childPath });\n }\n\n return value;\n },\n\n set(obj, prop, value) {\n if (typeof prop === 'symbol') return Reflect.set(obj, prop, value);\n\n const targetPath = basePath ? `${basePath}.${String(prop)}` : String(prop);\n\n // Check if the value being assigned is a ReadProxy\n if (isReadProxy(value)) {\n const meta = getReadProxyMeta(value);\n if (meta && meta.owner.id !== owner.id) {\n // Record dependency edge\n collector.add({\n from: meta.owner,\n fromPath: meta.path,\n to: owner,\n toPath: targetPath,\n });\n\n // Try to extract a concrete value via Symbol.toPrimitive\n const primitive = tryExtractPrimitive(value);\n if (primitive !== undefined) {\n // The value is already concrete (primitive from observed data)\n return Reflect.set(obj, prop, primitive);\n }\n\n // Not concrete — store a Pending marker\n return Reflect.set(obj, prop, new Pending(meta.owner, meta.path));\n }\n\n // Self-reference or XR — try to extract value\n const primitive = tryExtractPrimitive(value);\n if (primitive !== undefined) {\n return Reflect.set(obj, prop, primitive);\n }\n\n // XR leaf with no value — store Pending\n if (meta) {\n collector.add({\n from: meta.owner,\n fromPath: meta.path,\n to: owner,\n toPath: targetPath,\n });\n return Reflect.set(obj, prop, new Pending(meta.owner, meta.path));\n }\n }\n\n // Plain object — deep-process to catch nested ReadProxy values\n if (typeof value === 'object' && value !== null && !Pending.is(value)) {\n const processed = deepProcessValue(value, owner, targetPath, collector);\n return Reflect.set(obj, prop, processed);\n }\n\n return Reflect.set(obj, prop, value);\n },\n\n deleteProperty(obj, prop) {\n return Reflect.deleteProperty(obj, prop);\n },\n }) as T;\n}\n\n/**\n * Try to extract a primitive value from a ReadProxy via Symbol.toPrimitive.\n * Returns `undefined` if the proxy represents a non-existent (leaf) value.\n */\nfunction tryExtractPrimitive(proxy: object): string | number | boolean | undefined {\n const toPrim = (proxy as Record<symbol, unknown>)[Symbol.toPrimitive];\n if (typeof toPrim === 'function') {\n const result = (toPrim as () => unknown)();\n if (result !== undefined && result !== null && typeof result !== 'object') {\n // Leaf proxy placeholders are not real values\n if (typeof result === 'string' && result.startsWith('__pending__')) return undefined;\n return result as string | number | boolean;\n }\n }\n return undefined;\n}\n\n/**\n * Deep-process a plain object/array being assigned to a WriteProxy.\n * Replaces any nested ReadProxy values with Pending markers or concrete values.\n */\nfunction deepProcessValue(\n value: unknown,\n owner: ResourceRef,\n basePath: string,\n collector: EdgeCollector,\n): unknown {\n if (value === null || value === undefined) return value;\n if (typeof value !== 'object') return value;\n\n if (isReadProxy(value)) {\n const meta = getReadProxyMeta(value)!;\n collector.add({\n from: meta.owner,\n fromPath: meta.path,\n to: owner,\n toPath: basePath,\n });\n const primitive = tryExtractPrimitive(value as object);\n if (primitive !== undefined) return primitive;\n return new Pending(meta.owner, meta.path);\n }\n\n if (Array.isArray(value as object)) {\n return (value as unknown[]).map((item, i) =>\n deepProcessValue(item, owner, `${basePath}[${i}]`, collector),\n );\n }\n\n // Plain object — recurse\n const result: Record<string, unknown> = {};\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n result[key] = deepProcessValue(val, owner, `${basePath}.${key}`, collector);\n }\n return result;\n}\n","import { Construct } from 'constructs';\n\nimport type { ReadyCheck, ReadyCheckFn } from '../readiness/index.js';\nimport {\n createPrimitiveReadProxy,\n createReadProxy,\n createWriteProxy,\n type DependencyGraph,\n type EdgeCollector,\n getReadProxyMeta,\n isReadProxy,\n Pending,\n type ResourceRef,\n} from '../tracking/index.js';\nimport { compositionStorage } from './context.js';\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\n/** Minimal shape for a Kubernetes resource — only apiVersion + kind required. */\nexport interface KubernetesResource {\n apiVersion: string;\n kind: string;\n metadata?: {\n name?: string;\n namespace?: string;\n labels?: Record<string, string>;\n annotations?: Record<string, string>;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/** Props passed to the Resource constructor — becomes the desired document. */\nexport interface ResourceProps {\n apiVersion: string;\n kind: string;\n [key: string]: unknown;\n}\n\n/** Framework configuration accessible via `resource.resource`. */\nexport interface ResourceConfig {\n autoReady: boolean;\n addReadyCheck(fn: ReadyCheckFn, priority?: number): void;\n}\n\n/** Internal metadata stored per Resource (not exposed on the proxy). */\ninterface ResourceInternals {\n /** Unique reference for the dependency graph. */\n ref: ResourceRef;\n /** The desired document (what the user wrote). */\n desired: Record<string, unknown>;\n /** The observed document (populated by the hydrate phase). */\n observed: Record<string, unknown>;\n /** Whether this is an external (existing) resource. */\n external: boolean;\n /** For external resources: the lookup key. */\n externalRef?: ExternalResourceRef;\n /** Framework config. */\n config: ResourceConfig;\n /** Custom readiness checks registered by the composition author. */\n readyChecks: ReadyCheck[];\n /** The dependency graph. */\n graph: DependencyGraph;\n /** The edge collector. */\n collector: EdgeCollector;\n}\n\nexport interface ExternalResourceRef {\n apiVersion: string;\n kind: string;\n name: unknown;\n namespace?: string;\n refKey: string;\n}\n\n// ─── WeakMap stores for internal data ─────────────────────────────────────────\n\nconst internals = new WeakMap<Resource, ResourceInternals>();\n\n// ─── Resource class ───────────────────────────────────────────────────────────\n\n/**\n * A Kubernetes resource within a Composition.\n *\n * The Resource instance acts as a \"desired-first, fallback-to-observed\" proxy:\n * - Reading a path that exists in the desired document returns the desired value.\n * - Reading a path that does NOT exist in desired falls through to a tracked\n * ReadProxy over observed state (creates dependency edges).\n * - Writing always goes to the desired document.\n *\n * The only reserved properties are `node` (from Construct) and `resource`\n * (framework config namespace).\n */\nexport class Resource extends Construct {\n readonly resource: ResourceConfig;\n declare metadata: {\n name?: string;\n namespace?: string;\n labels?: Record<string, string>;\n annotations?: Record<string, string>;\n [key: string]: unknown;\n };\n\n constructor(scope: Construct, id: string, props: ResourceProps) {\n super(scope, id);\n\n const graph = scope.node.tryGetContext('xplane:graph') as DependencyGraph;\n const collector = scope.node.tryGetContext('xplane:collector') as EdgeCollector;\n\n if (!graph || !collector) {\n throw new Error('Resource must be created within a Composition tree.');\n }\n\n const ref: ResourceRef = { id: this.node.path };\n graph.addResource(ref);\n\n const readyChecks: ReadyCheck[] = [];\n const config: ResourceConfig = {\n autoReady: true,\n addReadyCheck(fn: ReadyCheckFn, priority = 50) {\n readyChecks.push({ fn, priority });\n },\n };\n this.resource = config;\n\n // Process props — deep scan for ReadProxy values in the desired doc\n const desired = processDesiredProps(props, ref, collector);\n\n const internal: ResourceInternals = {\n ref,\n desired,\n observed: {},\n external: false,\n config,\n readyChecks,\n graph,\n collector,\n };\n internals.set(this, internal);\n\n // Return a proxy over `this` that implements the desired-first/observed-fallback\n // biome-ignore lint/correctness/noConstructorReturn: Proxy wrapping is intentional\n return createResourceProxy(this, internal);\n }\n\n /**\n * Look up an existing cluster resource by name.\n * Returns a Resource that only has observed state (no desired output).\n *\n * The `name` parameter accepts either a plain string or a PrimitiveReadProxy\n * (returned when reading a tracked property like `ns.metadata.labels['x']`).\n * Proxies are coerced to their underlying string via `Symbol.toPrimitive`.\n */\n static fromExistingByName(\n scope: Construct,\n apiVersion: string,\n kind: string,\n name: unknown,\n namespace?: string,\n ): Resource {\n const resolvedName = coerceToString(name);\n const refKey = computeRefKey(apiVersion, kind, resolvedName, namespace);\n const id = `__existing__${refKey.replace(/\\//g, '_')}`;\n\n const instance = new Resource(scope, id, { apiVersion, kind });\n const internal = internals.get(instance)!;\n internal.external = true;\n internal.externalRef = { apiVersion, kind, name: resolvedName ?? name, namespace, refKey };\n\n // Pre-hydrate from context if observed data is already available (from a prior iteration)\n const ctx = compositionStorage.getStore();\n if (ctx) {\n const observed = ctx.requiredResources.get(refKey);\n if (observed) {\n Object.assign(internal.observed, observed);\n }\n }\n\n return instance;\n }\n\n /**\n * Generate a deterministic unique name based on the XR identity and construct path.\n * Useful for resource fields that need unique names (e.g., AWS resource names).\n */\n static uniqueName(\n scope: Construct,\n options: {\n maxLength?: number;\n separator?: string;\n allowedPattern?: RegExp;\n extra?: string;\n } = {},\n ): string {\n const maxLength = options.maxLength ?? 63;\n const separator = options.separator ?? '-';\n const allowedPattern = options.allowedPattern ?? /[^a-zA-Z0-9]/g;\n const escapedSep = separator.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const collapseRe = new RegExp(`${escapedSep}+`, 'g');\n\n const clean = (s: string) =>\n s\n .replace(/\\s+/g, '')\n .replace(allowedPattern, separator)\n .replace(collapseRe, separator)\n .replace(new RegExp(`^${escapedSep}|${escapedSep}$`, 'g'), '');\n\n const xrMeta = scope.node.tryGetContext('xplane:xr-meta') as\n | { name?: string; namespace?: string }\n | undefined;\n\n const parts: string[] = [];\n if (xrMeta?.namespace) parts.push(clean(xrMeta.namespace));\n if (xrMeta?.name) parts.push(clean(xrMeta.name));\n for (const s of scope.node.scopes.slice(1)) {\n const c = clean(s.node.id);\n if (c) parts.push(c);\n }\n if (options.extra) {\n const c = clean(options.extra);\n if (c) parts.push(c);\n }\n\n const full = parts.join(separator);\n const hash = shortHash(full);\n const withHash = `${full}${separator}${hash}`;\n\n if (withHash.length <= maxLength) return withHash;\n const prefix = full.slice(0, maxLength - hash.length - separator.length);\n return `${prefix}${separator}${hash}`;\n }\n}\n\n// ─── Internal accessors (used by pipeline phases) ─────────────────────────────\n\nexport function getResourceInternals(resource: Resource): ResourceInternals {\n const internal = internals.get(resource);\n if (!internal) throw new Error('Resource internals not found');\n return internal;\n}\n\nexport function getResourceRef(resource: Resource): ResourceRef {\n return getResourceInternals(resource).ref;\n}\n\nexport function getDesiredDocument(resource: Resource): Record<string, unknown> {\n return getResourceInternals(resource).desired;\n}\n\nexport function getObservedDocument(resource: Resource): Record<string, unknown> {\n return getResourceInternals(resource).observed;\n}\n\nexport function hydrateObserved(resource: Resource, data: Record<string, unknown>): void {\n const internal = getResourceInternals(resource);\n Object.assign(internal.observed, data);\n}\n\nexport function isExternal(resource: Resource): boolean {\n return getResourceInternals(resource).external;\n}\n\nexport function getExternalRef(resource: Resource): ExternalResourceRef | undefined {\n return getResourceInternals(resource).externalRef;\n}\n\nexport function getReadyChecks(resource: Resource): ReadyCheck[] {\n return getResourceInternals(resource).readyChecks;\n}\n\n// ─── Helpers ──────────────────────────────────────────────────────────────────\n\n/**\n * Coerce a value to a string, handling PrimitiveReadProxy objects that wrap\n * primitive values behind a `Symbol.toPrimitive` method.\n * Returns `undefined` if the value cannot be resolved to a string.\n */\nfunction coerceToString(value: unknown): string | undefined {\n if (typeof value === 'string') return value;\n if (\n value != null &&\n typeof (value as { [Symbol.toPrimitive]?: unknown })[Symbol.toPrimitive] === 'function'\n ) {\n return String(value);\n }\n return undefined;\n}\n\nexport function computeRefKey(\n apiVersion: string,\n kind: string,\n name: string | undefined,\n namespace?: string,\n): string {\n const namePart = name ?? '__unresolved__';\n if (namespace) return `${apiVersion}/${kind}/${namespace}/${namePart}`;\n return `${apiVersion}/${kind}/${namePart}`;\n}\n\nfunction shortHash(s: string): string {\n let h = 5381;\n for (let i = 0; i < s.length; i++) {\n h = ((h << 5) + h) ^ s.charCodeAt(i);\n h = h >>> 0;\n }\n return h.toString(16).padStart(8, '0');\n}\n\n/**\n * Process the desired props — deep-scan for ReadProxy values and replace them\n * with Pending markers (recording edges in the collector).\n */\nfunction processDesiredProps(\n props: ResourceProps,\n owner: ResourceRef,\n collector: EdgeCollector,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) {\n result[key] = processValue(value, owner, key, collector);\n }\n return result;\n}\n\nfunction processValue(\n value: unknown,\n owner: ResourceRef,\n path: string,\n collector: EdgeCollector,\n): unknown {\n if (value === null || value === undefined) return value;\n if (typeof value !== 'object') return value;\n\n if (isReadProxy(value)) {\n const meta = getReadProxyMeta(value)!;\n collector.add({\n from: meta.owner,\n fromPath: meta.path,\n to: owner,\n toPath: path,\n });\n // Try to get concrete value\n const prim = tryExtractPrimitive(value);\n if (prim !== undefined) return prim;\n return new Pending(meta.owner, meta.path);\n }\n\n if (Array.isArray(value as object)) {\n return (value as unknown[]).map((item, i) =>\n processValue(item, owner, `${path}[${i}]`, collector),\n );\n }\n\n const result: Record<string, unknown> = {};\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n result[key] = processValue(val, owner, `${path}.${key}`, collector);\n }\n return result;\n}\n\nfunction tryExtractPrimitive(proxy: object): string | number | boolean | undefined {\n const toPrim = (proxy as Record<symbol, unknown>)[Symbol.toPrimitive];\n if (typeof toPrim === 'function') {\n const result = (toPrim as () => unknown)();\n if (result !== undefined && result !== null && typeof result !== 'object') {\n // Leaf proxy placeholders are not real values\n if (typeof result === 'string' && result.startsWith('__pending__')) return undefined;\n return result as string | number | boolean;\n }\n }\n return undefined;\n}\n\n/**\n * Creates the \"desired-first, fallback-to-observed\" proxy around a Resource.\n */\nfunction createResourceProxy(resource: Resource, internal: ResourceInternals): Resource {\n const { ref, desired, collector } = internal;\n\n const proxy = new Proxy(resource, {\n get(target, prop, receiver) {\n // Framework reserved properties\n if (prop === 'node') return Reflect.get(target, prop, receiver);\n if (prop === 'resource') return Reflect.get(target, prop, receiver);\n if (typeof prop === 'symbol') return Reflect.get(target, prop, receiver);\n\n // Prototype methods (constructor, etc.)\n if (prop === 'constructor') return Reflect.get(target, prop, receiver);\n\n // Check desired first\n if (prop in desired) {\n const value = desired[String(prop)];\n if (typeof value === 'object' && value !== null && !Pending.is(value)) {\n // Return a WriteProxy so nested writes go to desired\n return createWriteProxy(value as object, {\n owner: ref,\n collector,\n basePath: String(prop),\n });\n }\n return value;\n }\n\n // Fallback to observed via ReadProxy\n const observed = internal.observed;\n if (String(prop) in observed) {\n const value = observed[String(prop)];\n if (typeof value === 'object' && value !== null) {\n return createReadProxy(value as object, ref, String(prop));\n }\n // Primitive observed value — wrap in ReadProxy for tracking\n return createPrimitiveReadProxyFromResource(value, ref, String(prop));\n }\n\n // Path exists in neither — return a ReadProxy leaf (for chaining like .status.foo.bar)\n return createReadProxy({} as object, ref, String(prop));\n },\n\n set(target, prop, value) {\n if (typeof prop === 'symbol') return Reflect.set(target, prop, value);\n if (prop === 'resource') return Reflect.set(target, prop, value);\n\n // All writes go to desired, processing ReadProxy values\n const path = String(prop);\n desired[path] = processValue(value, ref, path, collector);\n return true;\n },\n\n has(target, prop) {\n if (typeof prop === 'symbol') return Reflect.has(target, prop);\n if (prop === 'node' || prop === 'resource') return true;\n return prop in desired || prop in internal.observed;\n },\n }) as Resource;\n\n // Store internal mapping for the proxy too, so internals.get(proxy) works\n internals.set(proxy, internal);\n return proxy;\n}\n\n/**\n * Wrap a primitive observed value so it carries ReadProxy metadata\n * for dependency tracking when assigned elsewhere.\n */\nfunction createPrimitiveReadProxyFromResource(\n value: unknown,\n owner: ResourceRef,\n path: string,\n): unknown {\n if (value === null || value === undefined) return value;\n return createPrimitiveReadProxy(value as string | number | boolean, owner, path);\n}\n","import { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { XplaneLogger } from './types.js';\n\nconst noopLogger: XplaneLogger = {\n debug() {},\n info() {},\n warn() {},\n};\n\nconst loggerStorage = new AsyncLocalStorage<XplaneLogger>();\n\n/**\n * Get the current logger from async context.\n * Returns a no-op logger if none has been set (silent by default).\n */\nexport function getLogger(): XplaneLogger {\n return loggerStorage.getStore() ?? noopLogger;\n}\n\n/**\n * Run a function with a logger available in async context.\n * All code within `fn` (and any nested async calls) can access\n * the logger via `getLogger()`.\n */\nexport function withLogger<T>(logger: XplaneLogger, fn: () => T): T {\n return loggerStorage.run(logger, fn);\n}\n","import {\n getDesiredDocument,\n getExternalRef,\n getObservedDocument,\n getResourceRef,\n isExternal,\n} from '../core/resource.js';\nimport { Pending } from '../tracking/index.js';\n\nimport type { DiagnosticReport, PipelineState } from './types.js';\n\n/**\n * DIAGNOSE phase: produce structured diagnostics for blocked resources.\n *\n * For each resource classified as 'blocked':\n * - Find all Pending markers in the desired document\n * - Report what they're waiting on (source resource + path)\n *\n * For circular dependencies (detected in sequence phase):\n * - Produce a 'cycle' diagnostic with the full cycle path\n */\nexport function diagnose(state: PipelineState): PipelineState {\n const diagnostics: DiagnosticReport[] = [];\n\n // Check for cycles from the graph\n const sortResult = state.graph.topologicalSort();\n if (sortResult.order === null && sortResult.cycle) {\n const firstCycleMember = sortResult.cycle[0];\n if (firstCycleMember) {\n diagnostics.push({\n resource: firstCycleMember,\n reason: 'cycle',\n cycle: sortResult.cycle,\n });\n }\n }\n\n // Report external resources that were required but not found\n for (const resource of state.resources) {\n if (!isExternal(resource)) continue;\n const ref = getExternalRef(resource);\n if (!ref) continue;\n const observed = getObservedDocument(resource);\n if (Object.keys(observed).length > 0) continue; // hydrated, no problem\n const nameDisplay =\n typeof ref.name === 'string' ? ref.name : ref.name == null ? '(unresolved)' : '(unresolved)';\n const nsDisplay = ref.namespace ? ` in namespace '${ref.namespace}'` : '';\n diagnostics.push({\n resource: getResourceRef(resource).id,\n reason: 'not-found',\n detail: `External resource ${ref.apiVersion}/${ref.kind} '${nameDisplay}'${nsDisplay} was required but not found by Crossplane`,\n });\n }\n\n // For each blocked resource, find pending paths\n const pendingDiagnostics: DiagnosticReport[] = [];\n for (const resource of state.resources) {\n if (isExternal(resource)) continue;\n\n const ref = getResourceRef(resource);\n const classification = state.classification.get(ref.id);\n if (classification !== 'blocked') continue;\n\n // Skip if already reported as cycle member\n if (sortResult.order === null && sortResult.cycle?.includes(ref.id)) continue;\n\n const desired = getDesiredDocument(resource);\n const pendingPaths = findPendingPaths(desired, '');\n\n if (pendingPaths.length > 0) {\n pendingDiagnostics.push({\n resource: ref.id,\n reason: 'pending',\n pendingPaths,\n });\n }\n }\n\n // Filter out cascading diagnostics: only keep pending diagnostics that have\n // at least one dependency that is NOT itself blocked or not-found.\n // This surfaces only root causes rather than the full dependency cascade.\n const notFoundIds = new Set(\n diagnostics.filter((d) => d.reason === 'not-found').map((d) => d.resource),\n );\n const blockedIds = new Set(pendingDiagnostics.map((d) => d.resource));\n\n for (const diag of pendingDiagnostics) {\n const isRootCause = diag.pendingPaths?.some((p) => {\n const dep = p.waitingOn.resource;\n // If waiting on something that isn't blocked or not-found, this IS a root cause\n return !blockedIds.has(dep) && !notFoundIds.has(dep);\n });\n if (isRootCause) {\n diagnostics.push(diag);\n }\n }\n\n return { ...state, diagnostics };\n}\n\n/**\n * Recursively find all Pending markers in a document and report their source.\n */\nfunction findPendingPaths(\n obj: unknown,\n basePath: string,\n): Array<{ path: string; waitingOn: { resource: string; path: string } }> {\n const results: Array<{ path: string; waitingOn: { resource: string; path: string } }> = [];\n\n if (obj === null || obj === undefined) return results;\n if (Pending.is(obj)) {\n results.push({\n path: basePath,\n waitingOn: { resource: obj.source.id, path: obj.path },\n });\n return results;\n }\n if (typeof obj !== 'object') return results;\n\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n const childPath = basePath ? `${basePath}[${i}]` : `[${i}]`;\n results.push(...findPendingPaths(obj[i], childPath));\n }\n return results;\n }\n\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n const childPath = basePath ? `${basePath}.${key}` : key;\n results.push(...findPendingPaths(value, childPath));\n }\n return results;\n}\n","import { getXrDesiredStatus } from '../core/composition.js';\nimport {\n getDesiredDocument,\n getObservedDocument,\n getReadyChecks,\n getResourceInternals,\n getResourceRef,\n isExternal,\n} from '../core/resource.js';\nimport { getReadProxyMeta, isReadProxy } from '../tracking/index.js';\n\nimport type { EmittedResource, PipelineState } from './types.js';\n\n/**\n * EMIT phase: serialize each resource classified as 'emit' into a plain\n * Kubernetes resource document ready for Crossplane.\n *\n * Also extracts the XR desired status from this.xr.status assignments.\n */\nexport function emit(state: PipelineState): PipelineState {\n const emitted: EmittedResource[] = [];\n\n for (const resource of state.resources) {\n if (isExternal(resource)) continue;\n\n const ref = getResourceRef(resource);\n const classification = state.classification.get(ref.id);\n if (classification !== 'emit') continue;\n\n const internal = getResourceInternals(resource);\n const desired = getDesiredDocument(resource);\n\n // Strip the construct path prefix to get the resource name\n // The name is the full construct path minus the root \"Composition/\" prefix\n const name = ref.id.startsWith('Composition/') ? ref.id.slice('Composition/'.length) : ref.id;\n\n emitted.push({\n name,\n document: deepClean(desired),\n autoReady: internal.config.autoReady,\n readyChecks: getReadyChecks(resource),\n });\n }\n\n // Extract XR status and resolve any ReadProxy values using observed data\n const resourceById = new Map(state.resources.map((r) => [getResourceRef(r).id, r]));\n const rawStatus = getXrDesiredStatus(state.composition);\n const xrStatusPatches = resolveXrStatus(rawStatus, resourceById);\n\n return { ...state, emitted, xrStatusPatches };\n}\n\n/**\n * Deep-clone an object, stripping any remaining framework internals.\n * This produces a clean JSON-serializable Kubernetes document.\n */\nfunction deepClean(obj: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n result[key] = cleanValue(value);\n }\n\n return result;\n}\n\nfunction cleanValue(value: unknown): unknown {\n if (value === null || value === undefined) return value;\n if (typeof value !== 'object') return value;\n\n if (Array.isArray(value)) {\n return value.map(cleanValue);\n }\n\n // Plain objects — recurse\n const result: Record<string, unknown> = {};\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n result[key] = cleanValue(val);\n }\n return result;\n}\n\n/**\n * Resolve ReadProxy values in XR status using observed resource data.\n * This is needed because XR status is written at construction time (before hydration),\n * so read proxy references need to be resolved post-hydration.\n */\nfunction resolveXrStatus(\n status: Record<string, unknown>,\n resourceById: ReadonlyMap<string, import('../core/resource.js').Resource>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(status)) {\n const resolved = resolveStatusValue(value, resourceById);\n if (resolved !== undefined) {\n result[key] = resolved;\n }\n }\n return result;\n}\n\nfunction resolveStatusValue(\n value: unknown,\n resourceById: ReadonlyMap<string, import('../core/resource.js').Resource>,\n): unknown {\n if (value === null || value === undefined) return undefined;\n\n if (isReadProxy(value)) {\n const meta = getReadProxyMeta(value);\n if (!meta) return undefined;\n\n // Try to extract a concrete primitive (already resolved read proxy)\n const prim = tryExtractPrimitive(value as object);\n if (prim !== undefined) return prim;\n\n // Leaf proxy — try to resolve from observed data\n const resource = resourceById.get(meta.owner.id);\n if (!resource) return undefined;\n const observed = getObservedDocument(resource);\n return getNestedValue(observed, meta.path);\n }\n\n if (Array.isArray(value)) {\n return value.map((v) => resolveStatusValue(v, resourceById)).filter((v) => v != null);\n }\n\n if (typeof value === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value as Record<string, unknown>)) {\n const resolved = resolveStatusValue(v, resourceById);\n if (resolved !== undefined) {\n out[k] = resolved;\n }\n }\n return Object.keys(out).length > 0 ? out : undefined;\n }\n\n return value;\n}\n\nfunction tryExtractPrimitive(proxy: object): string | number | boolean | undefined {\n const toPrim = (proxy as Record<symbol, unknown>)[Symbol.toPrimitive];\n if (typeof toPrim === 'function') {\n const result = (toPrim as () => unknown)();\n if (result !== undefined && result !== null && typeof result !== 'object') {\n // Leaf proxy placeholders are not real values — skip them\n if (typeof result === 'string' && result.startsWith('__pending__')) return undefined;\n return result as string | number | boolean;\n }\n }\n return undefined;\n}\n\nfunction getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n}\n","import { getExternalRef, hydrateObserved, isExternal } from '../core/resource.js';\n\nimport type { PipelineState } from './types.js';\n\n/**\n * HYDRATE phase: feed observed state from Crossplane into each resource.\n *\n * - Composed resources are matched by their construct path (resource name).\n * - External resources are matched by their refKey.\n */\nexport function hydrate(state: PipelineState): PipelineState {\n for (const resource of state.resources) {\n if (isExternal(resource)) {\n const ref = getExternalRef(resource);\n if (ref) {\n const observed = state.observedRequired.get(ref.refKey);\n if (observed) {\n hydrateObserved(resource, observed);\n }\n }\n } else {\n // Match by construct path\n const name = resource.node.path;\n const observed = state.observedComposed.get(name);\n if (observed) {\n hydrateObserved(resource, observed);\n }\n }\n }\n\n return state;\n}\n","import { getDesiredDocument, getObservedDocument, getResourceRef } from '../core/resource.js';\nimport { Pending } from '../tracking/index.js';\n\nimport type { PipelineState } from './types.js';\n\n/**\n * RESOLVE phase: walk dependency edges and replace Pending markers\n * with concrete values from observed state where available.\n *\n * For each resource's desired document, recursively find Pending values.\n * Look up the source resource's observed state at the source path.\n * If concrete → replace. If not available → leave Pending in place.\n */\nexport function resolve(state: PipelineState): PipelineState {\n // Build a lookup: resource id → Resource instance\n const resourceById = new Map(state.resources.map((r) => [getResourceRef(r).id, r]));\n\n for (const resource of state.resources) {\n const desired = getDesiredDocument(resource);\n resolvePending(desired, resourceById);\n }\n\n return state;\n}\n\n/**\n * Recursively walk an object and resolve any Pending markers.\n */\nfunction resolvePending(\n obj: Record<string, unknown>,\n resourceById: ReadonlyMap<string, import('../core/resource.js').Resource>,\n): void {\n for (const [key, value] of Object.entries(obj)) {\n if (Pending.is(value)) {\n const sourceResource = resourceById.get(value.source.id);\n if (sourceResource) {\n const observed = getObservedDocument(sourceResource);\n const resolved = getNestedValue(observed, value.path);\n if (resolved !== undefined) {\n obj[key] = resolved;\n }\n // else: leave Pending in place — still unresolved\n }\n } else if (Array.isArray(value)) {\n resolveArray(value, resourceById);\n } else if (value !== null && typeof value === 'object') {\n resolvePending(value as Record<string, unknown>, resourceById);\n }\n }\n}\n\nfunction resolveArray(\n arr: unknown[],\n resourceById: ReadonlyMap<string, import('../core/resource.js').Resource>,\n): void {\n for (let i = 0; i < arr.length; i++) {\n const value = arr[i];\n if (Pending.is(value)) {\n const sourceResource = resourceById.get(value.source.id);\n if (sourceResource) {\n const observed = getObservedDocument(sourceResource);\n const resolved = getNestedValue(observed, value.path);\n if (resolved !== undefined) {\n arr[i] = resolved;\n }\n }\n } else if (Array.isArray(value)) {\n resolveArray(value, resourceById);\n } else if (value !== null && typeof value === 'object') {\n resolvePending(value as Record<string, unknown>, resourceById);\n }\n }\n}\n\n/**\n * Get a nested value from an object by dot-separated path.\n */\nfunction getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const segments = path.split('.');\n let current: unknown = obj;\n\n for (const segment of segments) {\n if (current === null || current === undefined) return undefined;\n if (typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[segment];\n }\n\n return current;\n}\n","import { getDesiredDocument, getResourceRef, isExternal } from '../core/resource.js';\nimport { Pending } from '../tracking/index.js';\n\nimport type { PipelineState, ResourceClassification } from './types.js';\n\n/**\n * SEQUENCE phase: topological sort and classification.\n *\n * - Runs topological sort on the dependency graph.\n * - Classifies each resource as 'emit', 'blocked', or 'external'.\n * - A resource is 'blocked' if it still has Pending markers in its desired document.\n * - External resources are classified as 'external' (never emitted).\n * - Circular dependencies are detected via the graph's topological sort.\n */\nexport function sequence(state: PipelineState): PipelineState {\n const classification = new Map<string, ResourceClassification>();\n\n // Run topological sort for cycle detection\n const sortResult = state.graph.topologicalSort();\n\n // Classify each resource\n for (const resource of state.resources) {\n const ref = getResourceRef(resource);\n\n if (isExternal(resource)) {\n classification.set(ref.id, 'external');\n continue;\n }\n\n // Check if this resource has any remaining Pending markers\n const desired = getDesiredDocument(resource);\n const hasPending = containsPending(desired);\n\n if (hasPending) {\n classification.set(ref.id, 'blocked');\n } else {\n classification.set(ref.id, 'emit');\n }\n }\n\n // If there's a cycle, mark all cycle members as blocked\n if (sortResult.order === null && sortResult.cycle) {\n for (const id of sortResult.cycle) {\n if (classification.get(id) !== 'external') {\n classification.set(id, 'blocked');\n }\n }\n }\n\n return { ...state, classification };\n}\n\n/**\n * Recursively check if an object contains any Pending markers.\n */\nfunction containsPending(obj: unknown): boolean {\n if (obj === null || obj === undefined) return false;\n if (Pending.is(obj)) return true;\n if (typeof obj !== 'object') return false;\n\n if (Array.isArray(obj)) {\n return obj.some(containsPending);\n }\n\n for (const value of Object.values(obj as Record<string, unknown>)) {\n if (containsPending(value)) return true;\n }\n return false;\n}\n","import type { Composition } from '../core/composition.js';\nimport type { Resource } from '../core/resource.js';\n\nimport { diagnose } from './diagnose.js';\nimport { emit } from './emit.js';\nimport { hydrate } from './hydrate.js';\nimport { resolve } from './resolve.js';\nimport { sequence } from './sequence.js';\nimport type { PipelineState } from './types.js';\n\nexport { diagnose } from './diagnose.js';\nexport { emit } from './emit.js';\nexport { hydrate } from './hydrate.js';\nexport { resolve } from './resolve.js';\nexport { sequence } from './sequence.js';\nexport type {\n DiagnosticReport,\n EmittedResource,\n PipelineState,\n ResourceClassification,\n} from './types.js';\n\n/**\n * Input to the pipeline — provided by the handler or simulator.\n */\nexport interface PipelineInput {\n /** The constructed Composition instance. */\n composition: Composition;\n /** Observed composed resources from Crossplane (keyed by resource name). */\n observedComposed: ReadonlyMap<string, Record<string, unknown>>;\n /** Observed existing/required resources (keyed by refKey). */\n observedRequired: ReadonlyMap<string, Record<string, unknown>>;\n}\n\n/**\n * Run the full rendering pipeline.\n *\n * Phases: hydrate → resolve → sequence → diagnose → emit\n */\nexport function runPipeline(input: PipelineInput): PipelineState {\n const resources = collectResources(input.composition);\n\n const initialState: PipelineState = {\n composition: input.composition,\n resources,\n graph: input.composition.graph,\n observedComposed: input.observedComposed,\n observedRequired: input.observedRequired,\n classification: new Map(),\n diagnostics: [],\n emitted: [],\n xrStatusPatches: {},\n };\n\n // Run phases sequentially — each transforms the state\n let state = initialState;\n state = hydrate(state);\n state = resolve(state);\n state = sequence(state);\n state = diagnose(state);\n state = emit(state);\n\n return state;\n}\n\n/**\n * Collect all Resource instances from the composition's construct tree.\n */\nfunction collectResources(composition: Composition): Resource[] {\n const resources: Resource[] = [];\n collectFromNode(composition, resources);\n return resources;\n}\n\nfunction collectFromNode(construct: import('constructs').Construct, resources: Resource[]): void {\n for (const child of construct.node.children) {\n // Check if it's a Resource (has our internals)\n if (isResourceInstance(child)) {\n resources.push(child as Resource);\n }\n // Recurse into children\n collectFromNode(child, resources);\n }\n}\n\nfunction isResourceInstance(obj: unknown): obj is Resource {\n if (obj === null || typeof obj !== 'object') return false;\n const r = obj as Record<string, unknown>;\n if (!('resource' in r) || r.resource === null || typeof r.resource !== 'object') return false;\n return 'autoReady' in (r.resource as object);\n}\n","import type { ReadyCheck } from './types.js';\n\n/**\n * Checks if the resource has a `Ready` condition with status `True`.\n */\nexport function conditionReady(observed: Record<string, unknown>): boolean | undefined {\n const status = observed.status as Record<string, unknown> | undefined;\n const conditions = status?.conditions as Array<Record<string, unknown>> | undefined;\n if (!conditions || !Array.isArray(conditions)) return undefined;\n\n const ready = conditions.find((c) => c.type === 'Ready');\n if (!ready) return undefined;\n\n return ready.status === 'True';\n}\n\n/**\n * Checks if the resource has `status.ready === true`.\n */\nexport function statusReady(observed: Record<string, unknown>): boolean | undefined {\n const status = observed.status as Record<string, unknown> | undefined;\n if (status === undefined) return undefined;\n if (!('ready' in status)) return undefined;\n\n return status.ready === true;\n}\n\n/**\n * Fallback: resource exists in observed state → ready.\n * Always returns `true` (only called when observed is defined).\n */\nexport function exists(_observed: Record<string, unknown>): boolean {\n return true;\n}\n\n/**\n * Built-in default readiness checks, appended at low priority.\n */\nexport const DEFAULT_CHECKS: ReadyCheck[] = [\n { fn: conditionReady, priority: 100, name: 'conditionReady' },\n { fn: statusReady, priority: 200, name: 'statusReady' },\n { fn: exists, priority: 1000, name: 'exists' },\n];\n","import { getLogger } from '../logging/index.js';\n\nimport type { ReadyCheck } from './types.js';\n\n/**\n * Evaluate readiness for a resource by running checks grouped by priority.\n *\n * - If `observed` is undefined, the resource doesn't exist yet → not ready.\n * - Checks are grouped by priority (ascending). Within a group, all checks\n * are AND-ed: if any returns `false`, the resource is not ready. If at least\n * one returns `true` and none return `false`, the resource is ready.\n * If all return `undefined`, cascade to the next priority group.\n * - Final fallback (no group had a definitive answer): not ready.\n */\nexport function evaluateReadiness(\n checks: ReadyCheck[],\n observed: Record<string, unknown> | undefined,\n): boolean {\n const log = getLogger();\n\n if (!observed) {\n log.debug('readiness: resource not observed, not ready');\n return false;\n }\n\n // Group checks by priority\n const groups = new Map<number, ReadyCheck[]>();\n for (const check of checks) {\n const group = groups.get(check.priority);\n if (group) {\n group.push(check);\n } else {\n groups.set(check.priority, [check]);\n }\n }\n\n // Process groups in ascending priority order\n const priorities = [...groups.keys()].sort((a, b) => a - b);\n\n for (const priority of priorities) {\n const group = groups.get(priority)!;\n let hasTrue = false;\n let hasFalse = false;\n const results: Array<{ name: string; result: boolean | undefined }> = [];\n\n for (const check of group) {\n const result = check.fn(observed);\n results.push({ name: check.name ?? 'anonymous', result });\n\n if (result === false) {\n hasFalse = true;\n break; // Short-circuit: one false in the group → not ready\n }\n if (result === true) {\n hasTrue = true;\n }\n }\n\n log.debug('readiness: evaluated group', { priority, results });\n\n if (hasFalse) {\n log.debug('readiness: group returned false, not ready', { priority });\n return false;\n }\n if (hasTrue) {\n log.debug('readiness: group returned true, ready', { priority });\n return true;\n }\n // All undefined → cascade to next group\n }\n\n log.debug('readiness: no group had definitive answer, not ready');\n return false;\n}\n","import type {\n CompositionInput,\n CompositionResult,\n DesiredResource,\n ExternalResourceRequest,\n} from './contract.js';\nimport type { Composition } from './core/composition.js';\nimport type { CompositionContext } from './core/context.js';\nimport { compositionStorage } from './core/context.js';\nimport { getExternalRef, isExternal } from './core/resource.js';\nimport { runPipeline } from './pipeline/index.js';\nimport { DEFAULT_CHECKS, evaluateReadiness } from './readiness/index.js';\nimport { DependencyGraph, EdgeCollector } from './tracking/index.js';\n\n/**\n * Run a composition class with the given input and return a plain-data result.\n *\n * This is the single entry point that bridges the composition author's class\n * with the runtime. It handles:\n * 1. Setting up internal context (DependencyGraph, EdgeCollector, ALS)\n * 2. Instantiating the Composition class\n * 3. Running the full pipeline (hydrate → resolve → sequence → diagnose → emit)\n * 4. Evaluating readiness per resource\n * 5. Returning a fully serializable CompositionResult\n *\n * The runtime never needs to access framework internals — everything it needs\n * is in the returned plain-data structure.\n */\nexport function runComposition<TSpec, TStatus, TContext extends object>(\n CompositionClass: new () => Composition<TSpec, TStatus, TContext>,\n input: CompositionInput,\n): CompositionResult {\n // Convert plain Records to Maps for the internal pipeline\n const observedComposed = new Map(Object.entries(input.observedComposed));\n const observedRequired = new Map(Object.entries(input.observedRequired));\n\n // Set up internal context\n const graph = new DependencyGraph();\n const collector = new EdgeCollector();\n const pipelineContext = new Map(Object.entries(input.pipelineContext));\n\n const ctx: CompositionContext = {\n xr: input.xr,\n pipelineContext,\n requiredResources: observedRequired,\n graph,\n collector,\n };\n\n // Instantiate composition within ALS context\n const composition = compositionStorage.run(ctx, () => new CompositionClass()) as Composition;\n\n // Run the pipeline\n const state = runPipeline({ composition, observedComposed, observedRequired });\n\n // Build the result — plain data only\n const resources: DesiredResource[] = state.emitted.map((emitted) => {\n const allChecks = [...emitted.readyChecks, ...DEFAULT_CHECKS];\n // Look up observed using the full construct path (Composition/{name})\n const observed = observedComposed.get(`Composition/${emitted.name}`);\n const ready = emitted.autoReady ? evaluateReadiness(allChecks, observed) : true;\n\n return {\n name: emitted.name,\n document: emitted.document,\n ready,\n };\n });\n\n const externalResources: ExternalResourceRequest[] = [];\n for (const resource of state.resources) {\n if (!isExternal(resource)) continue;\n const ref = getExternalRef(resource);\n if (!ref || typeof ref.name !== 'string') continue;\n if (ref.name.startsWith('__pending__')) continue;\n\n externalResources.push({\n refKey: ref.refKey,\n apiVersion: ref.apiVersion,\n kind: ref.kind,\n name: ref.name,\n ...(ref.namespace ? { namespace: ref.namespace } : {}),\n });\n }\n\n return {\n resources,\n externalResources,\n xrStatus: state.xrStatusPatches,\n diagnostics: state.diagnostics,\n };\n}\n"],"mappings":";;;;;;;;AA2BA,MAAa,qBAAqB,IAAI,kBAAsC;;;;;AAM5E,SAAgB,wBAA4C;CAC1D,MAAM,MAAM,mBAAmB,SAAS;CACxC,IAAI,KAAK,OAAO;CAEhB,MAAM,IAAI,MACR,sGACF;AACF;;;;;;;;;;;;;;;;;;;;;ACiBA,IAAa,cAAb,cAIUA,YAAU;;;;;CAKlB;;CAGA;;CAGA;CAEA,cAAc;EAEZ,MAAM,KAAA,GAAmC,aAAa;EAEtD,MAAM,MAAM,sBAAsB;EAElC,KAAK,QAAQ,IAAI;EACjB,KAAK,YAAY,IAAI;EAGrB,KAAK,KAAK,WAAW,gBAAgB,IAAI,KAAK;EAC9C,KAAK,KAAK,WAAW,oBAAoB,IAAI,SAAS;EAGtD,MAAM,SAAS,IAAI,GAAG;EACtB,IAAI,QACF,KAAK,KAAK,WAAW,kBAAkB,MAAM;EAI/C,KAAK,KAAK,cAA8B,GAAG;CAC7C;;;;;CAMA,IAAI,kBAAqD;EACvD,MAAM,MAAM,sBAAsB;EAClC,OAAO;GACL,IAA8B,KAAiC;IAC7D,OAAO,IAAI,gBAAgB,IAAI,GAAa;GAC9C;GACA,IAAI,KAA8B;IAChC,OAAO,IAAI,gBAAgB,IA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B,IAAI,MAAM;EACV;EACA,mBAAmB;EACnB;EACA;CACF;CAMA,MAAM,QAAQ,YAAY;EAAE,aAHR,mBAAmB,IAAI,WAAW,IAAI,iBAAiB,CAGrC;EAAG;EAAkB;CAAiB,CAAC;CAG7E,MAAM,YAA+B,MAAM,QAAQ,KAAK,YAAY;EAClE,MAAM,YAAY,CAAC,GAAG,QAAQ,aAAa,GAAG,cAAc;EAE5D,MAAM,WAAW,iBAAiB,IAAI,eAAe,QAAQ,MAAM;EACnE,MAAM,QAAQ,QAAQ,YAAY,kBAAkB,WAAW,QAAQ,IAAI;EAE3E,OAAO;GACL,MAAM,QAAQ;GACd,UAAU,QAAQ;GAClB;EACF;CACF,CAAC;CAED,MAAM,oBAA+C,CAAC;CACtD,KAAK,MAAM,YAAY,MAAM,WAAW;EACtC,IAAI,CAAC,WAAW,QAAQ,GAAG;EAC3B,MAAM,MAAM,eAAe,QAAQ;EACnC,IAAI,CAAC,OAAO,OAAO,IAAI,SAAS,UAAU;EAC1C,IAAI,IAAI,KAAK,WAAW,aAAa,GAAG;EAExC,kBAAkB,KAAK;GACrB,QAAQ,IAAI;GACZ,YAAY,IAAI;GAChB,MAAM,IAAI;GACV,MAAM,IAAI;GACV,GAAI,IAAI,YAAY,EAAE,WAAW,IAAI,UAAU,IAAI,CAAC;EACtD,CAAC;CACH;CAEA,OAAO;EACL;EACA;EACA,UAAU,MAAM;EAChB,aAAa,MAAM;CACrB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xplane/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core CDK-style composition library for Crossplane functions",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
|
+
"@types/node": "^24.0.0",
|
|
26
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
25
27
|
"constructs": "^10.6.0",
|
|
26
28
|
"tsdown": "^0.22.0",
|
|
27
29
|
"typescript": "6.0.3",
|