@elementumai/edk 0.10.4 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +11 -7
  2. package/dist-sdk/src/catalog/token.js +2 -1
  3. package/dist-sdk/src/core/wire/ref-serializer.js +26 -1
  4. package/dist-sdk/src/engine/build/context.d.ts +4 -0
  5. package/dist-sdk/src/engine/coverage-gaps.d.ts +2 -0
  6. package/dist-sdk/src/engine/coverage-gaps.js +3 -0
  7. package/dist-sdk/src/engine/ei/json-stream-reader.d.ts +43 -0
  8. package/dist-sdk/src/engine/ei/json-stream-reader.js +234 -0
  9. package/dist-sdk/src/engine/ei/run.d.ts +22 -0
  10. package/dist-sdk/src/engine/ei/run.js +99 -18
  11. package/dist-sdk/src/engine/ei/saved-plan.d.ts +16 -0
  12. package/dist-sdk/src/engine/ei/saved-plan.js +19 -0
  13. package/dist-sdk/src/engine/ei/state.d.ts +1 -1
  14. package/dist-sdk/src/engine/ei/state.js +17 -4
  15. package/dist-sdk/src/engine/progress.d.ts +3 -1
  16. package/dist-sdk/src/engine/progress.js +7 -3
  17. package/dist-sdk/src/engine/pull/authored-address.d.ts +15 -1
  18. package/dist-sdk/src/engine/pull/authored-address.js +180 -29
  19. package/dist-sdk/src/engine/pull/context.d.ts +37 -2
  20. package/dist-sdk/src/engine/pull/context.js +7 -4
  21. package/dist-sdk/src/engine/tf/index.d.ts +2 -2
  22. package/dist-sdk/src/engine/tf/index.js +2 -2
  23. package/dist-sdk/src/engine/tf/labels.d.ts +22 -0
  24. package/dist-sdk/src/engine/tf/labels.js +50 -0
  25. package/dist-sdk/src/engine/tf/model.d.ts +2 -0
  26. package/dist-sdk/src/engine/tf/model.js +26 -0
  27. package/dist-sdk/src/engine/validation.d.ts +2 -0
  28. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +17 -0
  29. package/dist-sdk/src/entities/access-policy/from-tf.js +52 -24
  30. package/dist-sdk/src/entities/access-policy/member-list.d.ts +32 -0
  31. package/dist-sdk/src/entities/access-policy/member-list.js +57 -0
  32. package/dist-sdk/src/entities/access-policy/module.js +5 -0
  33. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +4 -3
  34. package/dist-sdk/src/entities/access-policy/to-tf.js +21 -12
  35. package/dist-sdk/src/entities/agent/build.js +7 -5
  36. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +2 -0
  37. package/dist-sdk/src/entities/agent/from-tf.js +13 -3
  38. package/dist-sdk/src/entities/agent/to-tf.js +11 -5
  39. package/dist-sdk/src/entities/agent/tools.d.ts +8 -0
  40. package/dist-sdk/src/entities/agent/tools.js +6 -2
  41. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +2 -0
  42. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +29 -0
  43. package/dist-sdk/src/entities/agent-tool/to-tf.js +56 -3
  44. package/dist-sdk/src/entities/agent-tool/types.d.ts +12 -8
  45. package/dist-sdk/src/entities/agent-tool/types.js +13 -9
  46. package/dist-sdk/src/entities/app/build.d.ts +11 -0
  47. package/dist-sdk/src/entities/app/build.js +1 -0
  48. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +5 -7
  49. package/dist-sdk/src/entities/app/from-tf.js +16 -10
  50. package/dist-sdk/src/entities/app/to-tf.js +6 -4
  51. package/dist-sdk/src/entities/automation/build.d.ts +2 -7
  52. package/dist-sdk/src/entities/automation/build.js +43 -14
  53. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +7 -4
  54. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +7 -11
  55. package/dist-sdk/src/entities/automation/from-tf.d.ts +23 -1
  56. package/dist-sdk/src/entities/automation/from-tf.js +456 -34
  57. package/dist-sdk/src/entities/automation/index.d.ts +1 -1
  58. package/dist-sdk/src/entities/automation/module.d.ts +22 -2
  59. package/dist-sdk/src/entities/automation/module.js +244 -57
  60. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +22 -2
  61. package/dist-sdk/src/entities/automation/output-key-wire-name.js +54 -3
  62. package/dist-sdk/src/entities/automation/run-target.d.ts +59 -0
  63. package/dist-sdk/src/entities/automation/run-target.js +99 -0
  64. package/dist-sdk/src/entities/automation/script-code.d.ts +9 -0
  65. package/dist-sdk/src/entities/automation/script-code.js +24 -3
  66. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +16 -0
  67. package/dist-sdk/src/entities/automation/task-output-labels.js +49 -0
  68. package/dist-sdk/src/entities/automation/tasks.d.ts +20 -8
  69. package/dist-sdk/src/entities/automation/to-tf.d.ts +1 -3
  70. package/dist-sdk/src/entities/automation/to-tf.js +102 -40
  71. package/dist-sdk/src/entities/automation/triggers.d.ts +22 -3
  72. package/dist-sdk/src/entities/automation/triggers.js +40 -0
  73. package/dist-sdk/src/entities/automation/types.d.ts +21 -0
  74. package/dist-sdk/src/entities/automation/types.js +26 -0
  75. package/dist-sdk/src/entities/dashboard/from-tf.d.ts +11 -1
  76. package/dist-sdk/src/entities/dashboard/from-tf.js +57 -7
  77. package/dist-sdk/src/entities/dashboard/to-tf.js +13 -0
  78. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +7 -2
  79. package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +3 -0
  80. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +65 -19
  81. package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +4 -2
  82. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +341 -32
  83. package/dist-sdk/src/entities/element/build.d.ts +10 -0
  84. package/dist-sdk/src/entities/element/build.js +1 -0
  85. package/dist-sdk/src/entities/element/from-tf.js +14 -9
  86. package/dist-sdk/src/entities/element/to-tf.js +6 -4
  87. package/dist-sdk/src/entities/field/from-tf.d.ts +24 -0
  88. package/dist-sdk/src/entities/field/from-tf.js +79 -1
  89. package/dist-sdk/src/entities/field/module.js +7 -0
  90. package/dist-sdk/src/entities/field/to-tf.d.ts +30 -1
  91. package/dist-sdk/src/entities/field/to-tf.js +51 -0
  92. package/dist-sdk/src/entities/file-reader/module.js +3 -3
  93. package/dist-sdk/src/entities/file-reader/to-tf.js +3 -3
  94. package/dist-sdk/src/entities/file-reader/types.d.ts +4 -16
  95. package/dist-sdk/src/entities/file-reader/types.js +7 -0
  96. package/dist-sdk/src/entities/org/group.d.ts +1 -0
  97. package/dist-sdk/src/entities/org/group.js +2 -1
  98. package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +8 -0
  99. package/dist-sdk/src/entities/record-create-form/from-tf.js +10 -2
  100. package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +2 -1
  101. package/dist-sdk/src/entities/record-create-form/to-tf.js +14 -2
  102. package/dist-sdk/src/entities/relationship/from-tf.d.ts +8 -0
  103. package/dist-sdk/src/entities/relationship/from-tf.js +88 -10
  104. package/dist-sdk/src/entities/relationship/to-tf.d.ts +3 -2
  105. package/dist-sdk/src/entities/relationship/to-tf.js +79 -8
  106. package/dist-sdk/src/entities/role/from-tf.js +24 -7
  107. package/dist-sdk/src/entities/role/to-tf.js +25 -7
  108. package/dist-sdk/src/entities/service-account/from-tf.js +2 -1
  109. package/dist-sdk/src/entities/service-account/module.js +15 -0
  110. package/dist-sdk/src/entities/service-account/to-tf.js +12 -4
  111. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +1 -1
  112. package/dist-sdk/src/entities/shared/filters/tf-codec.js +12 -7
  113. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +5 -2
  114. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +8 -1
  115. package/dist-sdk/src/entities/skill/from-tf.js +10 -3
  116. package/dist-sdk/src/entities/skill/module.js +16 -0
  117. package/dist-sdk/src/entities/skill/to-tf.d.ts +8 -1
  118. package/dist-sdk/src/entities/skill/to-tf.js +23 -14
  119. package/dist-sdk/src/entities/skill/tools.d.ts +8 -0
  120. package/dist-sdk/src/entities/skill/tools.js +6 -2
  121. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +2 -0
  122. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +8 -0
  123. package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -2
  124. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +8 -2
  125. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +20 -10
  126. package/dist-sdk/src/entities/view/from-tf.d.ts +60 -0
  127. package/dist-sdk/src/entities/view/from-tf.js +391 -17
  128. package/dist-sdk/src/entities/view/module.js +15 -0
  129. package/dist-sdk/src/entities/view/portable.d.ts +11 -0
  130. package/dist-sdk/src/entities/view/portable.js +47 -0
  131. package/dist-sdk/src/entities/view/to-tf.d.ts +4 -1
  132. package/dist-sdk/src/entities/view/to-tf.js +25 -7
  133. package/dist-sdk/src/entities/view/types.js +1 -1
  134. package/dist-sdk/src/entities/widget/build.d.ts +4 -3
  135. package/dist-sdk/src/entities/widget/from-tf.d.ts +3 -0
  136. package/dist-sdk/src/entities/widget/from-tf.js +100 -3
  137. package/dist-sdk/src/entities/widget/to-tf.d.ts +16 -1
  138. package/dist-sdk/src/entities/widget/to-tf.js +77 -14
  139. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +27 -8
  140. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  141. package/dist-sdk/src/graph/field-resource-types.d.ts +2 -0
  142. package/dist-sdk/src/graph/field-resource-types.js +11 -0
  143. package/dist-sdk/src/graph/index.d.ts +28 -3
  144. package/dist-sdk/src/graph/index.js +12 -2
  145. package/dist-sdk/src/graph/types.d.ts +157 -5
  146. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Public graph barrel: KIND_MODULES + derived views for pull/build/canvas.
3
3
  */
4
- import { type CatalogRenderArgs, type CatalogRenderResult, type EntityKindModule, type KindId, type ParentEdge, type StateScopedPlatformEntry, matchType } from "./types.js";
5
- export type { AdoptionAddressAlias, AuthoringFacet, CanvasComponentId, CanvasFacet, CanvasView, CatalogAuthoringArgs, CatalogFacet, CatalogRenderArgs, CatalogRenderResult, CatalogRoot, DataFacet, DataFacetCatalogKind, EntityKindId, EntityKindModule, KindId, LifecycleFacet, OrgIdentityBag, ParentEdge, ParentageFacet, ResourceFacet, StateScopedPlatformEntry, StreamFacet, StreamMatch, StreamPartition, StreamRootExtractResult, ToTfResult, } from "./types.js";
4
+ import { type CatalogRenderArgs, type CatalogRenderResult, type EntityKindModule, type KindId, type ParentEdge, type PortableEmptiedList, type PortableLeaveOut, type PortablePrincipals, type StateScopedPlatformEntry, type TaskOutputReference, matchType } from "./types.js";
5
+ export type { AdoptionAddressAlias, AuthoringFacet, CanvasComponentId, CanvasFacet, CanvasView, CatalogAuthoringArgs, CatalogFacet, CatalogRenderArgs, CatalogRenderResult, CatalogRoot, DataFacet, DataFacetCatalogKind, EntityKindId, EntityKindModule, KindId, LifecycleFacet, OrgIdentityBag, ParentEdge, ParentageFacet, ResourceFacet, StateScopedPlatformEntry, StreamFacet, StreamMatch, StreamPartition, StreamRootExtractResult, TaskOutputReference, ToTfResult, } from "./types.js";
6
6
  export type { ReferenceLookupStrategy } from "./types.js";
7
7
  export { NO_CANVAS, NO_CATALOG, NO_DATA, NO_LIFECYCLE, defaultMatchResourceType, implementedResourceTypes, isResourceAdoptable, isTfLive, knownResourceTypes, matchType, singleResourceType, } from "./types.js";
8
8
  export { KIND_MODULES } from "./modules.js";
@@ -100,7 +100,26 @@ export declare const BUILD_VS_EXPORT_PICKLIST_LABEL_ASSIGNMENTS: {
100
100
  readonly fieldAttribute: string;
101
101
  readonly valueAttribute: string;
102
102
  }[];
103
- export declare const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCE_NAMES: ReadonlyMap<string, ReadonlyMap<string, string>>;
103
+ export declare const BUILD_VS_EXPORT_STATE_EVALUATED_MAPS: {
104
+ readonly resourceType: string;
105
+ readonly attribute: string;
106
+ readonly computedFrom: readonly string[];
107
+ readonly keyedBy: {
108
+ readonly listAttribute: string;
109
+ readonly nameAttribute: string;
110
+ };
111
+ }[];
112
+ export declare const BUILD_VS_EXPORT_RENDERED_JSONENCODE_ATTRIBUTES: {
113
+ readonly resourceType: string;
114
+ readonly attribute: string;
115
+ }[];
116
+ export declare const BUILD_VS_EXPORT_STATE_BOUND_REFERENCES: {
117
+ readonly resourceType: string;
118
+ readonly attribute: string;
119
+ readonly referenceTypes: readonly string[];
120
+ }[];
121
+ export declare const BUILD_VS_EXPORT_STATE_RESOLVED_DATA_LOOKUPS: ReadonlySet<string>;
122
+ export declare const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCES: ReadonlyMap<string, ReadonlyMap<string, TaskOutputReference>>;
104
123
  /** Kind id → module. */
105
124
  export declare const KIND_BY_ID: ReadonlyMap<KindId, EntityKindModule>;
106
125
  /** @deprecated Use {@link KIND_BY_ID}. */
@@ -141,6 +160,12 @@ export declare const UNREADABLE_ATTRIBUTES_BY_RESOURCE_TYPE: ReadonlyMap<string,
141
160
  */
142
161
  export declare const STATE_SCOPED_MAP_ATTRIBUTES_BY_RESOURCE_TYPE: ReadonlyMap<string, readonly string[]>;
143
162
  export declare const STATE_SCOPED_PLATFORM_ENTRIES_BY_RESOURCE_TYPE: ReadonlyMap<string, readonly StateScopedPlatformEntry[]>;
163
+ /** Every kind's `--portable` leave-out rules (edk#1894). */
164
+ export declare const PORTABLE_LEAVE_OUT: readonly PortableLeaveOut[];
165
+ /** Every kind's `--portable` emptied-list rules (edk#1894). */
166
+ export declare const PORTABLE_EMPTIED_LISTS: readonly PortableEmptiedList[];
167
+ /** Every kind's `--portable` principal rules (edk#1894). */
168
+ export declare const PORTABLE_PRINCIPALS: readonly PortablePrincipals[];
144
169
  /** Entity-declared value equivalences used to compare builder and exporter HCL. */
145
170
  export declare const BUILD_VS_EXPORT_NORMALIZATIONS: {
146
171
  readonly omittedAttributeDefaults: {
@@ -65,8 +65,12 @@ export const BUILD_VS_EXPORT_COMPUTED_REFERENCE_MAPS = KIND_MODULES.flatMap((mod
65
65
  export const BUILD_VS_EXPORT_RECORD_FIELD_OUTPUT_KEYS = KIND_MODULES.flatMap((module) => module.roundtrip?.recordFieldOutputKeys ?? []);
66
66
  export const BUILD_VS_EXPORT_ATTRIBUTE_LOCALS = KIND_MODULES.flatMap((module) => module.roundtrip?.exportedAttributeLocals ?? []);
67
67
  export const BUILD_VS_EXPORT_PICKLIST_LABEL_ASSIGNMENTS = KIND_MODULES.flatMap((module) => module.roundtrip?.picklistLabelAssignments ?? []);
68
- export const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCE_NAMES = new Map(KIND_MODULES.flatMap((module) => Object.entries(module.roundtrip?.taskOutputReferenceNames ?? {}))
69
- .map(([taskType, names]) => [taskType, new Map(Object.entries(names))]));
68
+ export const BUILD_VS_EXPORT_STATE_EVALUATED_MAPS = KIND_MODULES.flatMap((module) => module.roundtrip?.stateEvaluatedMaps ?? []);
69
+ export const BUILD_VS_EXPORT_RENDERED_JSONENCODE_ATTRIBUTES = KIND_MODULES.flatMap((module) => module.roundtrip?.renderedJsonencodeAttributes ?? []);
70
+ export const BUILD_VS_EXPORT_STATE_BOUND_REFERENCES = KIND_MODULES.flatMap((module) => module.roundtrip?.stateBoundReferences ?? []);
71
+ export const BUILD_VS_EXPORT_STATE_RESOLVED_DATA_LOOKUPS = new Set(KIND_MODULES.flatMap((module) => (module.roundtrip?.stateResolvedDataLookups ?? []).map((lookup) => lookup.dataType)));
72
+ export const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCES = new Map(KIND_MODULES.flatMap((module) => Object.entries(module.roundtrip?.taskOutputReferences ?? {}))
73
+ .map(([taskType, references]) => [taskType, new Map(Object.entries(references))]));
70
74
  /** Kind id → module. */
71
75
  export const KIND_BY_ID = new Map(KIND_MODULES.map((m) => [m.kind, m]));
72
76
  /** @deprecated Use {@link KIND_BY_ID}. */
@@ -131,6 +135,12 @@ export const STATE_SCOPED_MAP_ATTRIBUTES_BY_RESOURCE_TYPE = new Map(KIND_MODULES
131
135
  export const STATE_SCOPED_PLATFORM_ENTRIES_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatMap((m) => m.resource.shape === "single" && m.resource.stateScopedPlatformEntries !== undefined
132
136
  ? [[m.resource.resourceType, m.resource.stateScopedPlatformEntries]]
133
137
  : []));
138
+ /** Every kind's `--portable` leave-out rules (edk#1894). */
139
+ export const PORTABLE_LEAVE_OUT = KIND_MODULES.flatMap((m) => m.portable?.leaveOut ?? []);
140
+ /** Every kind's `--portable` emptied-list rules (edk#1894). */
141
+ export const PORTABLE_EMPTIED_LISTS = KIND_MODULES.flatMap((m) => m.portable?.leaveOutWhenEmptied ?? []);
142
+ /** Every kind's `--portable` principal rules (edk#1894). */
143
+ export const PORTABLE_PRINCIPALS = KIND_MODULES.flatMap((m) => m.portable?.principals ?? []);
134
144
  /** Entity-declared value equivalences used to compare builder and exporter HCL. */
135
145
  export const BUILD_VS_EXPORT_NORMALIZATIONS = {
136
146
  omittedAttributeDefaults: KIND_MODULES.flatMap((module) => (module.roundtrip?.omittedAttributeDefaults ?? []).flatMap((equivalence) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...equivalence })))),
@@ -313,11 +313,37 @@ export interface OwnFileExtractResult {
313
313
  /**
314
314
  * Own-file ref names released from state on this pull. Their authored files
315
315
  * are archived so the next plan does not recreate the live resource (#1858).
316
+ * `afterRelease` entries (#2054) list the export addresses adoption is
317
+ * asked to release; `archiveReleasedOwnFiles` archives the file only once
318
+ * none of them is bound in state any more, since a file archived while
319
+ * state still manages the automation makes the next plan destroy it.
316
320
  */
317
- readonly quarantineOwnFiles?: readonly {
318
- readonly kind: string;
321
+ readonly quarantineOwnFiles?: readonly QuarantinedOwnFile[];
322
+ /**
323
+ * Skipped entities of this kind and the addresses each one owns (#1877), so
324
+ * pull knows which authored file those resources would build from. A
325
+ * skipped entity this omits is matched to its file by its label.
326
+ */
327
+ readonly skippedOwnFiles?: readonly {
319
328
  readonly refName: string;
329
+ readonly addresses: readonly string[];
320
330
  }[];
331
+ /**
332
+ * Decisions that depend on what the whole stream keeps in source (#1877).
333
+ * Stream root calls it once, after every own-file child is extracted and
334
+ * #1731's unbuildable dependents are dropped, with whether each stream
335
+ * resource stays in source this pull (`resourcesInSource`).
336
+ */
337
+ readonly settleAfterExtract?: (inSource: (address: string) => boolean) => {
338
+ readonly quarantineOwnFiles: readonly QuarantinedOwnFile[];
339
+ readonly diagnostics: readonly string[];
340
+ };
341
+ }
342
+ /** An own-file whose authored file pull archives because its state is released (see `quarantineOwnFiles`). */
343
+ export interface QuarantinedOwnFile {
344
+ readonly kind: string;
345
+ readonly refName: string;
346
+ readonly afterRelease?: readonly string[];
321
347
  }
322
348
  export interface AdoptionAddressAlias {
323
349
  readonly from: string;
@@ -384,6 +410,13 @@ export interface PrintOwnFileOptions {
384
410
  * instead of degrading to a TODO.
385
411
  */
386
412
  readonly destinationConnectorKeys?: ReadonlySet<string>;
413
+ /**
414
+ * The destination org's group name → `org.groups` key (cross-org only). A
415
+ * group whose name is here is a real destination group (kept through
416
+ * `--map`, edk#1894) and prints as `org.groups.<key>`; any other degrades to
417
+ * a TODO.
418
+ */
419
+ readonly destinationGroups?: ReadonlyMap<string, string>;
387
420
  /**
388
421
  * A destination-org connector compound key (`"<provider>.<model>"`) the
389
422
  * caller already confirmed — `edk clone app --target-root` prompts the
@@ -641,6 +674,72 @@ export interface StateAdoptionFacet {
641
674
  /** The user-facing warning for this kind's imports (printed once per distinct set). */
642
675
  readonly warning: (imports: readonly StateAdoptionImport[]) => string;
643
676
  }
677
+ /**
678
+ * Blocks `--portable` always leaves out: the platform makes them together with
679
+ * their owner, so a source that creates the owner again must not ask for them
680
+ * (edk#1894).
681
+ */
682
+ export interface PortableLeaveOut {
683
+ readonly resourceType: string;
684
+ /**
685
+ * Which blocks of the type go. Omitted: all of them. Otherwise it reads what
686
+ * it needs from the export directory (`blocks` are the export's blocks of
687
+ * this type) and answers by each block's import id.
688
+ */
689
+ readonly select?: (exportDir: string, blocks: readonly TfBlock[]) => Promise<PortableSelection>;
690
+ /** Report text, e.g. "the platform creates it with the app". */
691
+ readonly reason: string;
692
+ }
693
+ /** A leave-out rule's answer for one export. */
694
+ export interface PortableSelection {
695
+ readonly matches: (importId: string | undefined) => boolean;
696
+ /** What it could not settle, reported to the user. */
697
+ readonly unresolved: readonly string[];
698
+ }
699
+ /**
700
+ * Principals on a block that belong to one org. Groups are map-or-drop: kept
701
+ * only when every group is mapped; users are always dropped. Whatever uses an
702
+ * unmapped principal is dropped with it (edk#1894).
703
+ */
704
+ export interface PortablePrincipals {
705
+ readonly resourceType: string;
706
+ /** List attribute holding group references. */
707
+ readonly groupAttribute: string;
708
+ /** The data source type those group references point at; its `name` is the group's name. */
709
+ readonly groupDataType: string;
710
+ /** List attributes holding users (any entry makes the principals unportable). */
711
+ readonly userAttributes: readonly string[];
712
+ /**
713
+ * `block`: the principals are the whole block (an access policy resource), so drop the block.
714
+ * `attributes`: the principals are part of a kept block, so drop only these attributes.
715
+ */
716
+ readonly whenDropped: "block" | "attributes";
717
+ /** Report noun, e.g. "service account access policy". */
718
+ readonly noun: string;
719
+ /** What dropping the principals means, added to the report, e.g. that a skill becomes open. */
720
+ readonly whenDroppedNote?: string;
721
+ }
722
+ /**
723
+ * A block that only lists other blocks: when leaving blocks out empties the
724
+ * list, the block goes too (a view order over no views).
725
+ */
726
+ export interface PortableEmptiedList {
727
+ readonly resourceType: string;
728
+ readonly attribute: string;
729
+ readonly reason: string;
730
+ }
731
+ /** How a kind takes part in `--portable` pulls and `clone app` (edk#1894). */
732
+ export interface PortableFacet {
733
+ readonly leaveOut?: readonly PortableLeaveOut[];
734
+ readonly principals?: readonly PortablePrincipals[];
735
+ readonly leaveOutWhenEmptied?: readonly PortableEmptiedList[];
736
+ }
737
+ /** A task output's reference: its name and the type of the envelope that carries it. */
738
+ export interface TaskOutputReference {
739
+ readonly name: string;
740
+ readonly fieldType: string;
741
+ readonly multiple: boolean;
742
+ }
644
743
  export interface EntityKindModule {
645
744
  readonly kind: KindId;
646
745
  /** Export participation. */
@@ -669,6 +768,8 @@ export interface EntityKindModule {
669
768
  * import is written to `.tf/out` so the plan imports instead of creating.
670
769
  */
671
770
  readonly stateAdoption?: StateAdoptionFacet;
771
+ /** `--portable` pulls and `clone app`: what is left out, mapped or dropped. */
772
+ readonly portable?: PortableFacet;
672
773
  /** Entity-specific equivalences used only by live build-vs-export comparison. */
673
774
  readonly roundtrip?: {
674
775
  readonly referenceAliases: readonly {
@@ -716,10 +817,12 @@ export interface EntityKindModule {
716
817
  }[];
717
818
  /**
718
819
  * Per task resource type, refs-map keys whose task reference name (what
719
- * an exported value envelope carries) differs from the key. Every other
720
- * task output's reference name is its refs-map key.
820
+ * an exported value envelope carries) differs from the key, with the
821
+ * `fieldType` and `multiple` of the envelope the key holds. An envelope
822
+ * is that key's read only when all three match. Every other task output's
823
+ * reference name is its refs-map key.
721
824
  */
722
- readonly taskOutputReferenceNames?: Readonly<Record<string, Readonly<Record<string, string>>>>;
825
+ readonly taskOutputReferences?: Readonly<Record<string, Readonly<Record<string, TaskOutputReference>>>>;
723
826
  /**
724
827
  * A found record's `record.<field id>` output is listed in the task's
725
828
  * refs under the field's `<nameAttribute>`, unique per `<ownerAttribute>`.
@@ -781,6 +884,55 @@ export interface EntityKindModule {
781
884
  readonly fieldAttribute: string;
782
885
  readonly valueAttribute: string;
783
886
  }[];
887
+ /**
888
+ * Computed string maps state holds on `<resourceType>`: a read of
889
+ * `<resource>.<attribute>["key"]` is the string state holds under that key,
890
+ * but only while state's row is current for the export (each attribute in
891
+ * `computedFrom` must hold the export block's value), and only for a key
892
+ * that names an entry of `keyedBy.listAttribute` (by its
893
+ * `keyedBy.nameAttribute`): the entries that attribute declares, whose
894
+ * values the platform computes from them. `keyedBy.listAttribute` must be
895
+ * one of `computedFrom`, so state's list is the export's. Any other key
896
+ * the platform adds to the map is never read.
897
+ */
898
+ readonly stateEvaluatedMaps?: readonly {
899
+ readonly resourceType: string;
900
+ readonly attribute: string;
901
+ readonly computedFrom: readonly string[];
902
+ readonly keyedBy: {
903
+ readonly listAttribute: string;
904
+ readonly nameAttribute: string;
905
+ };
906
+ }[];
907
+ /**
908
+ * Attributes of `<resourceType>` where one side may write
909
+ * `jsonencode(<literal>)` and the other the string it renders to, either
910
+ * literally or as a read of a {@link stateEvaluatedMaps} entry. They
911
+ * match only when the string is exactly OpenTofu's rendering.
912
+ */
913
+ readonly renderedJsonencodeAttributes?: readonly {
914
+ readonly resourceType: string;
915
+ readonly attribute: string;
916
+ }[];
917
+ /**
918
+ * Data lookups of this kind whose id state holds. Inside a template, the
919
+ * build's `data.<dataType>.<x>.id` is the id state holds for the export's
920
+ * lookup with the same meaning.
921
+ */
922
+ readonly stateResolvedDataLookups?: readonly {
923
+ readonly dataType: string;
924
+ }[];
925
+ /**
926
+ * Top-level `<attribute>` of `<resourceType>` where the export writes the
927
+ * bare platform id of a resource in another stream and the build its
928
+ * `<referenceType>.<label>.id`. They match only when state binds that id
929
+ * to exactly that address.
930
+ */
931
+ readonly stateBoundReferences?: readonly {
932
+ readonly resourceType: string;
933
+ readonly attribute: string;
934
+ readonly referenceTypes: readonly string[];
935
+ }[];
784
936
  };
785
937
  }
786
938
  export declare function implementedResourceTypes(resource: ResourceFacet): readonly string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementumai/edk",
3
- "version": "0.10.4",
3
+ "version": "0.11.0",
4
4
  "description": "Elementum Development Kit — statically typed SDK for building Elementum apps, automations, and agents",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",