@xplane/core 0.15.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/tracking/types.ts","../src/tracking/dependency-graph.ts","../src/tracking/proxy.ts","../src/core/resource.ts","../src/core/composition.ts","../src/ready/auto-ready.ts","../src/sequencing/resolver.ts"],"mappings":";;;;;;AAIA;cAAa,aAAA;AAAA,cACA,UAAA;;UAGI,WAAA;EAAA,SACN,EAAE;AAAA;;UAII,cAAA;EARgD;EAAA,SAUtD,IAAA,EAAM,WAAA;EAPW;EAAA,SASjB,QAAA;EARE;EAAA,SAUF,EAAA,EAAI,WAAW;EANT;EAAA,SAQN,MAAA;AAAA;;UAIM,YAAA;EAVA;EAAA,SAYN,KAAA,EAAO,WAAW;EARlB;EAAA,SAUA,IAAA;EARA;EAAA,SAUA,QAAA;AAAA;AANX;AAAA,UAUiB,mBAAA;;WAEN,UAAA;EAVA;EAAA,SAYA,IAAA;EAVA;EAAA,SAYA,IAAA;EAVQ;EAAA,SAYR,SAAA;EARM;EAAA,SAUN,MAAA;AAAA;;;;;AAzCX;;;cCGa,eAAA;EDHkD;EAAA,iBCK5C,KAAA;EDJ8C;EAAA,iBCM9C,UAAA;EDN8C;EAAA,iBCQ9C,MAAA;EDLF;ECQf,WAAA,CAAY,GAAA,EAAK,WAAA;;EAQjB,QAAA,CAAS,KAAA,EAAO,aAAA,CAAc,cAAA;EDfnB;EC+BX,qBAAA,CAAsB,SAAA,EAAW,WAAA,EAAa,UAAA,EAAY,WAAA;ED3B7B;ECqC7B,eAAA,CAAgB,UAAA,WAAqB,WAAA;ED/Bb;EAAA,ICoCpB,WAAA,CAAA,GAAe,aAAA;EDxCJ;EAAA,IC6CX,KAAA,CAAA,GAAS,aAAA,CAAc,cAAA;EDzClB;;;;ECiDT,eAAA,CAAA;AAAA;;;;;ADhEF;;cEQa,mBAAA;EA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;ANAe;iBMaD,iBAAA,CACd,SAAA,EAAW,WAAA,SAAoB,QAAA,GAC/B,KAAA,EAAO,eAAA,EACP,iBAAA,EAAmB,WAAA,SAAoB,kBAAA,IACtC,gBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/tracking/types.ts","../src/tracking/dependency-graph.ts","../src/tracking/proxy.ts","../src/core/resource.ts","../src/core/composition.ts","../src/ready/auto-ready.ts","../src/sequencing/resolver.ts"],"mappings":";;;;;;AAIA;cAAa,aAAA;AAAA,cACA,UAAA;;UAGI,WAAA;EAAA,SACN,EAAE;AAAA;;UAII,cAAA;EARgD;EAAA,SAUtD,IAAA,EAAM,WAAA;EAPW;EAAA,SASjB,QAAA;EARE;EAAA,SAUF,EAAA,EAAI,WAAW;EANT;EAAA,SAQN,MAAA;AAAA;;UAIM,YAAA;EAVA;EAAA,SAYN,KAAA,EAAO,WAAW;EARlB;EAAA,SAUA,IAAA;EARA;EAAA,SAUA,QAAA;AAAA;AANX;AAAA,UAUiB,mBAAA;;WAEN,UAAA;EAVA;EAAA,SAYA,IAAA;EAVA;EAAA,SAYA,IAAA;EAVQ;EAAA,SAYR,SAAA;EARM;EAAA,SAUN,MAAA;AAAA;;;;;AAzCX;;;cCGa,eAAA;EDHkD;EAAA,iBCK5C,KAAA;EDJ8C;EAAA,iBCM9C,UAAA;EDN8C;EAAA,iBCQ9C,MAAA;EDLF;ECQf,WAAA,CAAY,GAAA,EAAK,WAAA;;EAQjB,QAAA,CAAS,KAAA,EAAO,aAAA,CAAc,cAAA;EDfnB;EC+BX,qBAAA,CAAsB,SAAA,EAAW,WAAA,EAAa,UAAA,EAAY,WAAA;ED3B7B;ECqC7B,eAAA,CAAgB,UAAA,WAAqB,WAAA;ED/Bb;EAAA,ICoCpB,WAAA,CAAA,GAAe,aAAA;EDxCJ;EAAA,IC6CX,KAAA,CAAA,GAAS,aAAA,CAAc,cAAA;EDzClB;;;;ECiDT,eAAA,CAAA;AAAA;;;;;ADhEF;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AAAA;;;;;;;;;;ANAe;iBMaD,iBAAA,CACd,SAAA,EAAW,WAAA,SAAoB,QAAA,GAC/B,KAAA,EAAO,eAAA,EACP,iBAAA,EAAmB,WAAA,SAAoB,kBAAA,IACtC,gBAAA"}
package/dist/index.mjs CHANGED
@@ -461,7 +461,7 @@ var Resource = class Resource extends Construct$1 {
461
461
  ]);
462
462
  this._extra = {};
463
463
  for (const [k, v] of Object.entries(props)) if (!KNOWN_KEYS.has(k)) this._extra[k] = v;
464
- const specTarget = props.spec ?? {};
464
+ const specTarget = deepCloneWithTracked(props.spec ?? {});
465
465
  resolveTrackedRefs(specTarget, this.resourceRef, "spec", collector);
466
466
  this.spec = createTrackedProxy(specTarget, {
467
467
  owner: this.resourceRef,
@@ -672,6 +672,19 @@ function stripUnresolved(obj) {
672
672
  return obj;
673
673
  }
674
674
  /**
675
+ * Deep-clone an object while preserving tracked proxy references.
676
+ * Plain objects and arrays are cloned; tracked proxies and primitives are kept as-is.
677
+ */
678
+ function deepCloneWithTracked(obj) {
679
+ if (obj === null || obj === void 0) return obj;
680
+ if (isTracked(obj)) return obj;
681
+ if (typeof obj !== "object") return obj;
682
+ if (Array.isArray(obj)) return obj.map(deepCloneWithTracked);
683
+ const clone = {};
684
+ for (const [key, value] of Object.entries(obj)) clone[key] = deepCloneWithTracked(value);
685
+ return clone;
686
+ }
687
+ /**
675
688
  * Recursively scan an object for tracked proxy values from other resources.
676
689
  * For each one found, record a dependency edge and replace the value with
677
690
  * the UNRESOLVED sentinel. This handles values passed via object literals
@@ -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 const specTarget = (props.spec ?? {}) 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 * 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,IAAyB;;CAE3D,SAA4C,CAAC;;CAG7C,YAAY,KAAwB;EAClC,KAAK,WAAW,IAAI,IAAI,IAAI,GAAG;EAC/B,IAAI,CAAC,KAAK,MAAM,IAAI,IAAI,EAAE,GACxB,KAAK,MAAM,IAAI,IAAI,oBAAI,IAAI,IAAI,CAAC;CAEpC;;CAGA,SAAS,OAA4C;EACnD,KAAK,MAAM,QAAQ,OAAO;GACxB,KAAK,YAAY,KAAK,IAAI;GAC1B,KAAK,YAAY,KAAK,EAAE;GAGxB,MAAM,OAAO,KAAK,MAAM,IAAI,KAAK,GAAG,EAAE;GACtC,IAAI,MACF,KAAK,IAAI,KAAK,KAAK,EAAE;GAGvB,KAAK,OAAO,KAAK,IAAI;EACvB;CACF;;CAGA,sBAAsB,WAAwB,YAA+B;EAC3E,KAAK,YAAY,SAAS;EAC1B,KAAK,YAAY,UAAU;EAC3B,MAAM,OAAO,KAAK,MAAM,IAAI,UAAU,EAAE;EACxC,IAAI,MACF,KAAK,IAAI,WAAW,EAAE;CAE1B;;CAGA,gBAAgB,YAAyC;EACvD,OAAO,KAAK,MAAM,IAAI,UAAU,qBAAK,IAAI,IAAI;CAC/C;;CAGA,IAAI,cAAqC;EACvC,OAAO,CAAC,GAAG,KAAK,WAAW,KAAK,CAAC;CACnC;;CAGA,IAAI,QAAuC;EACzC,OAAO,KAAK;CACd;;;;;CAMA,kBAA4B;EAC1B,MAAM,0BAAU,IAAI,IAAY;EAChC,MAAM,2BAAW,IAAI,IAAY;EACjC,MAAM,SAAmB,CAAC;EAE1B,MAAM,SAAS,OAAqB;GAClC,IAAI,QA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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","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,IAAyB;;CAE3D,SAA4C,CAAC;;CAG7C,YAAY,KAAwB;EAClC,KAAK,WAAW,IAAI,IAAI,IAAI,GAAG;EAC/B,IAAI,CAAC,KAAK,MAAM,IAAI,IAAI,EAAE,GACxB,KAAK,MAAM,IAAI,IAAI,oBAAI,IAAI,IAAI,CAAC;CAEpC;;CAGA,SAAS,OAA4C;EACnD,KAAK,MAAM,QAAQ,OAAO;GACxB,KAAK,YAAY,KAAK,IAAI;GAC1B,KAAK,YAAY,KAAK,EAAE;GAGxB,MAAM,OAAO,KAAK,MAAM,IAAI,KAAK,GAAG,EAAE;GACtC,IAAI,MACF,KAAK,IAAI,KAAK,KAAK,EAAE;GAGvB,KAAK,OAAO,KAAK,IAAI;EACvB;CACF;;CAGA,sBAAsB,WAAwB,YAA+B;EAC3E,KAAK,YAAY,SAAS;EAC1B,KAAK,YAAY,UAAU;EAC3B,MAAM,OAAO,KAAK,MAAM,IAAI,UAAU,EAAE;EACxC,IAAI,MACF,KAAK,IAAI,WAAW,EAAE;CAE1B;;CAGA,gBAAgB,YAAyC;EACvD,OAAO,KAAK,MAAM,IAAI,UAAU,qBAAK,IAAI,IAAI;CAC/C;;CAGA,IAAI,cAAqC;EACvC,OAAO,CAAC,GAAG,KAAK,WAAW,KAAK,CAAC;CACnC;;CAGA,IAAI,QAAuC;EACzC,OAAO,KAAK;CACd;;;;;CAMA,kBAA4B;EAC1B,MAAM,0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Core CDK-style composition library for Crossplane functions",
6
6
  "license": "Apache-2.0",