@elementumai/edk 0.9.19 → 0.10.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.
Files changed (240) hide show
  1. package/README.md +159 -7
  2. package/dist-sdk/src/catalog/factories.d.ts +33 -2
  3. package/dist-sdk/src/catalog/factories.js +40 -1
  4. package/dist-sdk/src/catalog/from-authoring.d.ts +13 -8
  5. package/dist-sdk/src/catalog/from-authoring.js +34 -9
  6. package/dist-sdk/src/catalog/index.d.ts +2 -2
  7. package/dist-sdk/src/catalog/index.js +2 -2
  8. package/dist-sdk/src/catalog/render.js +6 -6
  9. package/dist-sdk/src/catalog/token.js +11 -0
  10. package/dist-sdk/src/catalog/types.d.ts +40 -1
  11. package/dist-sdk/src/catalog/types.js +12 -0
  12. package/dist-sdk/src/core/triggers/on-demand.d.ts +40 -4
  13. package/dist-sdk/src/core/triggers/on-demand.js +17 -2
  14. package/dist-sdk/src/core/types/app.d.ts +2 -2
  15. package/dist-sdk/src/engine/build/context.d.ts +1 -1
  16. package/dist-sdk/src/engine/coverage-gaps.d.ts +86 -0
  17. package/dist-sdk/src/engine/coverage-gaps.js +156 -0
  18. package/dist-sdk/src/engine/ei/run.d.ts +169 -0
  19. package/dist-sdk/src/engine/ei/run.js +1219 -0
  20. package/dist-sdk/src/engine/logging.d.ts +17 -0
  21. package/dist-sdk/src/engine/logging.js +18 -0
  22. package/dist-sdk/src/engine/pull/catalog-ref.d.ts +16 -0
  23. package/dist-sdk/src/engine/pull/catalog-ref.js +24 -0
  24. package/dist-sdk/src/engine/pull/context.d.ts +68 -6
  25. package/dist-sdk/src/engine/pull/context.js +40 -1
  26. package/dist-sdk/src/engine/pull/procedure-refs.d.ts +8 -0
  27. package/dist-sdk/src/engine/pull/procedure-refs.js +28 -0
  28. package/dist-sdk/src/engine/pull/ref-only.d.ts +5 -0
  29. package/dist-sdk/src/engine/pull/ref-only.js +10 -7
  30. package/dist-sdk/src/engine/pull/result-output.d.ts +6 -0
  31. package/dist-sdk/src/engine/pull/result-output.js +113 -3
  32. package/dist-sdk/src/engine/tf/expr.js +1 -1
  33. package/dist-sdk/src/engine/tf/index.d.ts +2 -2
  34. package/dist-sdk/src/engine/tf/index.js +1 -1
  35. package/dist-sdk/src/engine/tf/labels.d.ts +28 -5
  36. package/dist-sdk/src/engine/tf/labels.js +54 -3
  37. package/dist-sdk/src/engine/tf/model.d.ts +22 -1
  38. package/dist-sdk/src/engine/tf/parse.js +93 -4
  39. package/dist-sdk/src/engine/tf/render.d.ts +4 -2
  40. package/dist-sdk/src/engine/tf/render.js +41 -7
  41. package/dist-sdk/src/engine/validation.d.ts +44 -0
  42. package/dist-sdk/src/engine/validation.js +95 -0
  43. package/dist-sdk/src/entities/access-policy/from-tf.js +38 -1
  44. package/dist-sdk/src/entities/access-policy/principal.d.ts +2 -0
  45. package/dist-sdk/src/entities/access-policy/to-tf.js +5 -2
  46. package/dist-sdk/src/entities/agent/build.d.ts +4 -16
  47. package/dist-sdk/src/entities/agent/build.js +40 -5
  48. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -0
  49. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +46 -21
  50. package/dist-sdk/src/entities/agent/from-tf.js +11 -3
  51. package/dist-sdk/src/entities/agent/module.js +2 -0
  52. package/dist-sdk/src/entities/agent/to-tf.js +20 -6
  53. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +10 -1
  54. package/dist-sdk/src/entities/agent-tool/from-tf.js +18 -6
  55. package/dist-sdk/src/entities/agent-tool/module.js +3 -0
  56. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -2
  57. package/dist-sdk/src/entities/agent-tool/to-tf.js +27 -5
  58. package/dist-sdk/src/entities/app/auto-share.d.ts +38 -0
  59. package/dist-sdk/src/entities/app/auto-share.js +49 -0
  60. package/dist-sdk/src/entities/app/build.d.ts +105 -22
  61. package/dist-sdk/src/entities/app/build.js +107 -10
  62. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +22 -1
  63. package/dist-sdk/src/entities/app/from-tf.d.ts +1 -0
  64. package/dist-sdk/src/entities/app/from-tf.js +11 -2
  65. package/dist-sdk/src/entities/app/index.d.ts +7 -6
  66. package/dist-sdk/src/entities/app/index.js +2 -8
  67. package/dist-sdk/src/entities/app/module.js +5 -2
  68. package/dist-sdk/src/entities/app/to-tf.d.ts +6 -0
  69. package/dist-sdk/src/entities/app/to-tf.js +40 -13
  70. package/dist-sdk/src/entities/automation/build.d.ts +56 -6
  71. package/dist-sdk/src/entities/automation/build.js +230 -26
  72. package/dist-sdk/src/entities/automation/calculation-expression.d.ts +7 -7
  73. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +41 -5
  74. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +470 -58
  75. package/dist-sdk/src/entities/automation/from-tf.d.ts +37 -8
  76. package/dist-sdk/src/entities/automation/from-tf.js +791 -131
  77. package/dist-sdk/src/entities/automation/generated/task-output-contracts.d.ts +33 -0
  78. package/dist-sdk/src/entities/automation/generated/task-output-contracts.js +183 -0
  79. package/dist-sdk/src/entities/automation/index.d.ts +2 -2
  80. package/dist-sdk/src/entities/automation/index.js +1 -1
  81. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  82. package/dist-sdk/src/entities/automation/module.js +107 -15
  83. package/dist-sdk/src/entities/automation/output-field-types.d.ts +7 -0
  84. package/dist-sdk/src/entities/automation/output-field-types.js +36 -0
  85. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +9 -0
  86. package/dist-sdk/src/entities/automation/output-key-wire-name.js +13 -0
  87. package/dist-sdk/src/entities/automation/script-code.d.ts +20 -0
  88. package/dist-sdk/src/entities/automation/script-code.js +109 -5
  89. package/dist-sdk/src/entities/automation/system-ref-name.js +4 -0
  90. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +39 -0
  91. package/dist-sdk/src/entities/automation/task-output-labels.js +85 -0
  92. package/dist-sdk/src/entities/automation/tasks.d.ts +116 -22
  93. package/dist-sdk/src/entities/automation/tasks.js +86 -24
  94. package/dist-sdk/src/entities/automation/to-tf.d.ts +24 -3
  95. package/dist-sdk/src/entities/automation/to-tf.js +1082 -132
  96. package/dist-sdk/src/entities/automation/triggers.d.ts +12 -6
  97. package/dist-sdk/src/entities/automation/triggers.js +4 -0
  98. package/dist-sdk/src/entities/automation/types.d.ts +9 -0
  99. package/dist-sdk/src/entities/automation/types.js +19 -0
  100. package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +1 -1
  101. package/dist-sdk/src/entities/automation/value-ref-tf.js +1 -1
  102. package/dist-sdk/src/entities/chart/from-tf.js +9 -1
  103. package/dist-sdk/src/entities/chart/to-tf.js +10 -3
  104. package/dist-sdk/src/entities/data-lookup/module.js +2 -0
  105. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +24 -31
  106. package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +1 -0
  107. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +7 -5
  108. package/dist-sdk/src/entities/element/build.d.ts +28 -13
  109. package/dist-sdk/src/entities/element/build.js +5 -1
  110. package/dist-sdk/src/entities/element/from-tf.d.ts +11 -0
  111. package/dist-sdk/src/entities/element/from-tf.js +62 -1
  112. package/dist-sdk/src/entities/element/index.d.ts +5 -3
  113. package/dist-sdk/src/entities/element/index.js +1 -0
  114. package/dist-sdk/src/entities/element/module.js +9 -3
  115. package/dist-sdk/src/entities/element/to-tf.d.ts +1 -1
  116. package/dist-sdk/src/entities/element/to-tf.js +16 -16
  117. package/dist-sdk/src/entities/field/build.d.ts +17 -3
  118. package/dist-sdk/src/entities/field/build.js +3 -0
  119. package/dist-sdk/src/entities/field/calc.d.ts +7 -7
  120. package/dist-sdk/src/entities/field/from-tf.d.ts +5 -4
  121. package/dist-sdk/src/entities/field/from-tf.js +244 -49
  122. package/dist-sdk/src/entities/field/media-types.d.ts +6 -0
  123. package/dist-sdk/src/entities/field/media-types.js +30 -0
  124. package/dist-sdk/src/entities/field/module.js +2 -0
  125. package/dist-sdk/src/entities/field/options.js +6 -1
  126. package/dist-sdk/src/entities/field/to-tf.d.ts +26 -5
  127. package/dist-sdk/src/entities/field/to-tf.js +137 -15
  128. package/dist-sdk/src/entities/field/types.d.ts +2 -0
  129. package/dist-sdk/src/entities/field/types.js +27 -0
  130. package/dist-sdk/src/entities/file-reader/from-tf.js +14 -5
  131. package/dist-sdk/src/entities/file-reader/module.js +1 -0
  132. package/dist-sdk/src/entities/file-reader/types.d.ts +2 -0
  133. package/dist-sdk/src/entities/file-reader/types.js +1 -1
  134. package/dist-sdk/src/entities/portal/build.d.ts +26 -0
  135. package/dist-sdk/src/entities/portal/build.js +37 -0
  136. package/dist-sdk/src/entities/portal/from-tf.d.ts +27 -0
  137. package/dist-sdk/src/entities/portal/from-tf.js +75 -0
  138. package/dist-sdk/src/entities/portal/index.d.ts +1 -0
  139. package/dist-sdk/src/entities/portal/index.js +1 -0
  140. package/dist-sdk/src/entities/portal/module.d.ts +3 -0
  141. package/dist-sdk/src/entities/portal/module.js +28 -0
  142. package/dist-sdk/src/entities/portal/to-tf.d.ts +12 -0
  143. package/dist-sdk/src/entities/portal/to-tf.js +73 -0
  144. package/dist-sdk/src/entities/portal/types.d.ts +1 -0
  145. package/dist-sdk/src/entities/portal/types.js +1 -0
  146. package/dist-sdk/src/entities/relationship/module.js +2 -0
  147. package/dist-sdk/src/entities/relationship/pair-check.d.ts +7 -0
  148. package/dist-sdk/src/entities/relationship/pair-check.js +68 -0
  149. package/dist-sdk/src/entities/relationship/to-tf.d.ts +2 -0
  150. package/dist-sdk/src/entities/relationship/to-tf.js +12 -3
  151. package/dist-sdk/src/entities/role/from-tf.js +3 -3
  152. package/dist-sdk/src/entities/role/to-tf.d.ts +2 -0
  153. package/dist-sdk/src/entities/role/to-tf.js +12 -4
  154. package/dist-sdk/src/entities/search-table/module.js +1 -0
  155. package/dist-sdk/src/entities/search-table/to-tf.d.ts +1 -0
  156. package/dist-sdk/src/entities/search-table/to-tf.js +1 -1
  157. package/dist-sdk/src/entities/service-account/build.d.ts +15 -2
  158. package/dist-sdk/src/entities/service-account/from-tf.d.ts +2 -4
  159. package/dist-sdk/src/entities/service-account/from-tf.js +20 -8
  160. package/dist-sdk/src/entities/service-account/role-fidelity.d.ts +56 -0
  161. package/dist-sdk/src/entities/service-account/role-fidelity.js +243 -0
  162. package/dist-sdk/src/entities/service-account/to-tf.d.ts +14 -0
  163. package/dist-sdk/src/entities/service-account/to-tf.js +17 -0
  164. package/dist-sdk/src/entities/service-account/workspace-owner.d.ts +16 -0
  165. package/dist-sdk/src/entities/service-account/workspace-owner.js +22 -0
  166. package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +1 -1
  167. package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +5 -2
  168. package/dist-sdk/src/entities/shared/filters/ast.d.ts +23 -1
  169. package/dist-sdk/src/entities/shared/filters/ast.js +2 -0
  170. package/dist-sdk/src/entities/shared/filters/index.d.ts +7 -0
  171. package/dist-sdk/src/entities/shared/filters/index.js +19 -4
  172. package/dist-sdk/src/entities/shared/filters/print.js +24 -3
  173. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +7 -0
  174. package/dist-sdk/src/entities/shared/filters/tf-codec.js +46 -7
  175. package/dist-sdk/src/entities/shared/filters/types.d.ts +15 -2
  176. package/dist-sdk/src/entities/shared/ref.d.ts +5 -7
  177. package/dist-sdk/src/entities/shared/ref.js +5 -7
  178. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +9 -0
  179. package/dist-sdk/src/entities/shared/tool-field-ref.js +35 -2
  180. package/dist-sdk/src/entities/shared/types/field-types.d.ts +20 -5
  181. package/dist-sdk/src/entities/shared/types/field-types.js +8 -0
  182. package/dist-sdk/src/entities/skill/access-policy.js +3 -3
  183. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -0
  184. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +14 -6
  185. package/dist-sdk/src/entities/skill/from-tf.js +70 -15
  186. package/dist-sdk/src/entities/skill/input-coverage.d.ts +7 -0
  187. package/dist-sdk/src/entities/skill/input-coverage.js +11 -0
  188. package/dist-sdk/src/entities/skill/module.js +2 -0
  189. package/dist-sdk/src/entities/skill/to-tf.js +14 -4
  190. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +2 -0
  191. package/dist-sdk/src/entities/skill-tool/from-tf.js +49 -10
  192. package/dist-sdk/src/entities/skill-tool/module.js +3 -0
  193. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +2 -8
  194. package/dist-sdk/src/entities/skill-tool/to-tf.js +49 -14
  195. package/dist-sdk/src/entities/table/catalog.d.ts +14 -0
  196. package/dist-sdk/src/entities/table/catalog.js +66 -0
  197. package/dist-sdk/src/entities/table/module.js +2 -1
  198. package/dist-sdk/src/entities/table/to-tf.js +2 -2
  199. package/dist-sdk/src/entities/task/build.d.ts +8 -0
  200. package/dist-sdk/src/entities/task/build.js +10 -1
  201. package/dist-sdk/src/entities/task/from-tf.d.ts +4 -2
  202. package/dist-sdk/src/entities/task/from-tf.js +7 -2
  203. package/dist-sdk/src/entities/task/module.js +2 -2
  204. package/dist-sdk/src/entities/task/to-tf.d.ts +8 -4
  205. package/dist-sdk/src/entities/task/to-tf.js +28 -1
  206. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +49 -9
  207. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +71 -18
  208. package/dist-sdk/src/entities/view/agent-view-layout-to-tf.d.ts +19 -4
  209. package/dist-sdk/src/entities/view/agent-view-layout-to-tf.js +82 -10
  210. package/dist-sdk/src/entities/view/agent-view-layout.d.ts +53 -23
  211. package/dist-sdk/src/entities/view/agent-view-layout.js +1 -1
  212. package/dist-sdk/src/entities/view/from-tf.d.ts +3 -2
  213. package/dist-sdk/src/entities/view/from-tf.js +133 -13
  214. package/dist-sdk/src/entities/view/module.js +30 -3
  215. package/dist-sdk/src/entities/view/to-tf.d.ts +20 -8
  216. package/dist-sdk/src/entities/view/to-tf.js +86 -18
  217. package/dist-sdk/src/entities/view/types.d.ts +4 -15
  218. package/dist-sdk/src/entities/view/types.js +15 -15
  219. package/dist-sdk/src/entities/visual-flow/build.d.ts +16 -1
  220. package/dist-sdk/src/entities/visual-flow/build.js +9 -0
  221. package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +14 -0
  222. package/dist-sdk/src/entities/visual-flow/from-tf.js +51 -3
  223. package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
  224. package/dist-sdk/src/entities/visual-flow/index.js +1 -1
  225. package/dist-sdk/src/entities/visual-flow/printer.js +19 -0
  226. package/dist-sdk/src/entities/visual-flow/to-tf.js +87 -3
  227. package/dist-sdk/src/entities/widget/build.d.ts +16 -1
  228. package/dist-sdk/src/entities/widget/build.js +11 -1
  229. package/dist-sdk/src/entities/widget/from-tf.js +3 -3
  230. package/dist-sdk/src/entities/widget/to-tf.d.ts +2 -0
  231. package/dist-sdk/src/entities/widget/to-tf.js +41 -14
  232. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +148 -13
  233. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  234. package/dist-sdk/src/graph/index.d.ts +12 -0
  235. package/dist-sdk/src/graph/index.js +21 -0
  236. package/dist-sdk/src/graph/modules.js +2 -0
  237. package/dist-sdk/src/graph/types.d.ts +83 -4
  238. package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
  239. package/dist-sdk/src/internal/sdk-package.js +1 -0
  240. package/package.json +16 -3
@@ -67,6 +67,23 @@ export interface BridgeLogEvent {
67
67
  readonly message: string;
68
68
  readonly text_effects?: readonly TextEffect[];
69
69
  }
70
+ /**
71
+ * A GraphQL error the bridge read alongside query data: the field at `path` was
72
+ * not read (docs/design/graphql-error-standard.md).
73
+ */
74
+ export interface PartialReadEvent {
75
+ readonly protocol_version: number;
76
+ readonly sequence: number;
77
+ readonly timestamp: string;
78
+ readonly event: "partial_read";
79
+ readonly operation: string;
80
+ readonly path: readonly (string | number)[];
81
+ readonly code?: string;
82
+ readonly message: string;
83
+ readonly category: "source" | "platform";
84
+ readonly guidance: string;
85
+ }
86
+ export declare function parsePartialReadEvent(line: string): PartialReadEvent | undefined;
70
87
  export declare function parseProgressEvent(line: string): ProgressEvent | undefined;
71
88
  export declare function parseBridgeLogEvent(line: string): BridgeLogEvent | undefined;
72
89
  /** Convert common JS camelCase keys to the contract's flat snake_case keys. */
@@ -7,6 +7,24 @@ export const LOG_LEVELS = ["DEBUG", "INFO", "WARN", "ERROR"];
7
7
  export const LOG_COMPONENTS = ["edk", "ei", "provider", "tofu"];
8
8
  /** Diagnostic rendering defaults to structured plaintext; JSON is explicit. */
9
9
  export const LOG_FORMATS = ["text", "json"];
10
+ export function parsePartialReadEvent(line) {
11
+ try {
12
+ const value = JSON.parse(line);
13
+ if (typeof value !== "object" || value === null)
14
+ return undefined;
15
+ const event = value;
16
+ if (event.protocol_version !== 1 || event.event !== "partial_read" || typeof event.sequence !== "number" ||
17
+ typeof event.timestamp !== "string" || typeof event.operation !== "string" || typeof event.message !== "string" ||
18
+ typeof event.guidance !== "string" || (event.category !== "source" && event.category !== "platform") ||
19
+ !Array.isArray(event.path) || !event.path.every((segment) => typeof segment === "string" || typeof segment === "number") ||
20
+ (event.code !== undefined && typeof event.code !== "string"))
21
+ return undefined;
22
+ return value;
23
+ }
24
+ catch {
25
+ return undefined;
26
+ }
27
+ }
10
28
  export function parseProgressEvent(line) {
11
29
  try {
12
30
  const value = JSON.parse(line);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Catalog-ref lookups that printers can import without loading the kind graph.
3
+ *
4
+ * Skill and agent modules import their printers, and the kind graph imports
5
+ * those modules. The printers must not import `system-field-state`, which
6
+ * imports the graph: that cycle leaves a kind module undefined while
7
+ * `DATA_FACET_MODULES` is built.
8
+ */
9
+ /** Prefer the authored catalog ref when state only knows the terraform label. */
10
+ export declare function catalogRefForStateName(stateRefName: string, authoredByNamespace: ReadonlyMap<string, string>): string;
11
+ /**
12
+ * Printers emit `catalog.<ref>`. Field-ref identities stay on the terraform
13
+ * label so system-field recovery still matches the export. Map that label
14
+ * through the namespace index only at the emit site (#1427).
15
+ */
16
+ export declare function catalogRefForFieldOwner(ownerRefName: string, appNamespaces: ReadonlyMap<string, string> | undefined, elementNamespaces: ReadonlyMap<string, string> | undefined): string;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Catalog-ref lookups that printers can import without loading the kind graph.
3
+ *
4
+ * Skill and agent modules import their printers, and the kind graph imports
5
+ * those modules. The printers must not import `system-field-state`, which
6
+ * imports the graph: that cycle leaves a kind module undefined while
7
+ * `DATA_FACET_MODULES` is built.
8
+ */
9
+ /** Prefer the authored catalog ref when state only knows the terraform label. */
10
+ export function catalogRefForStateName(stateRefName, authoredByNamespace) {
11
+ return authoredByNamespace.get(stateRefName) ?? stateRefName;
12
+ }
13
+ /**
14
+ * Printers emit `catalog.<ref>`. Field-ref identities stay on the terraform
15
+ * label so system-field recovery still matches the export. Map that label
16
+ * through the namespace index only at the emit site (#1427).
17
+ */
18
+ export function catalogRefForFieldOwner(ownerRefName, appNamespaces, elementNamespaces) {
19
+ if (appNamespaces?.has(ownerRefName))
20
+ return catalogRefForStateName(ownerRefName, appNamespaces);
21
+ if (elementNamespaces?.has(ownerRefName))
22
+ return catalogRefForStateName(ownerRefName, elementNamespaces);
23
+ return ownerRefName;
24
+ }
@@ -1,9 +1,3 @@
1
- /**
2
- * The shared EXTRACTION toolkit every entity's `from-tf` module uses: the
3
- * context the pull orchestrators thread through, plus generic TfValue
4
- * inspectors. Entity-agnostic by definition — nothing in here may name a
5
- * resource type. (The emission-side twin is src/engine/build/context.ts.)
6
- */
7
1
  import { type TfValue } from "../tf/index.js";
8
2
  /** A `data-attr` reference recorded on a data block in the same stream. */
9
3
  export interface DataRef {
@@ -61,6 +55,20 @@ export interface FromTfContext {
61
55
  readonly foreignAppRefNamespaces?: ReadonlyMap<string, string>;
62
56
  readonly foreignElementRefNamespaces?: ReadonlyMap<string, string>;
63
57
  readonly foreignTaskRefNamespaces?: ReadonlyMap<string, string>;
58
+ /**
59
+ * The identity a reference to the stream root itself is authored as, for a
60
+ * stream without import ids (clone's `--no-imports` export, edk#1437): a
61
+ * dynamic Dropdown sourced from its own app resolves to this root and its
62
+ * fields instead of a raw platform id. Clone passes the clone's identity so
63
+ * the reference is re-pointed at the clone. Undefined: self references
64
+ * resolve only through import ids, as before.
65
+ */
66
+ readonly selfAspectRef?: {
67
+ readonly __kind: "app" | "element" | "task";
68
+ readonly refName: string;
69
+ readonly name: string;
70
+ readonly namespace?: string;
71
+ };
64
72
  /** `data.<field-type>.<label>` → generated ref-only catalog member. */
65
73
  readonly foreignFieldRefsByDataAddress?: ReadonlyMap<string, {
66
74
  readonly ownerRefName: string;
@@ -82,6 +90,13 @@ export interface FromTfContext {
82
90
  * only the FIRST same-name procedure under a CloudLink actually owns.
83
91
  */
84
92
  readonly procedureKeysByDiscriminator?: ReadonlyMap<string, string>;
93
+ /**
94
+ * Group display name → the `org.groups` key the already-pulled org.ts
95
+ * assigned it. Two groups whose names sanitize to the same key get
96
+ * suffixed keys there (`ops`, `ops_1`); the export label alone can't tell
97
+ * which one a reference means (edk#1412).
98
+ */
99
+ readonly groupKeysByName?: ReadonlyMap<string, string>;
85
100
  /**
86
101
  * Foreign app/element display names this stream saw referenced (currently:
87
102
  * a RELATION field's `related_object_id` as a `data.elementum_app`/
@@ -125,8 +140,55 @@ export interface FromTfContext {
125
140
  * `field/from-tf.ts`'s `implemented` check for the motivating case.
126
141
  */
127
142
  readonly skipped: string[];
143
+ /**
144
+ * Authoring blockers: live configuration that authored source cannot
145
+ * reproduce, where printing what pull CAN reconstruct would make the next
146
+ * apply change or replace it (e.g. a replace-forcing part of a dynamic
147
+ * Dropdown that pull cannot rebuild). Extraction records them and carries
148
+ * on; a caller that writes the affected source refuses
149
+ * (`assertAuthorable` in stream-root.ts), while a caller that does not
150
+ * author it may proceed. Report through {@link reportAuthoringBlocker}.
151
+ */
152
+ readonly authoringBlockers?: AuthoringBlocker[];
128
153
  }
154
+ /**
155
+ * Live configuration authored source cannot reproduce unchanged. Only its
156
+ * identity and what to do about it, never a live value.
157
+ */
158
+ export interface AuthoringBlocker {
159
+ /** Address (`type.label`) of the resource that holds the configuration. */
160
+ readonly address: string;
161
+ /** One line naming the resource and what pull cannot reproduce. */
162
+ readonly description: string;
163
+ /** What the user does about it. Blockers that share a remedy list it once. */
164
+ readonly remedy: string;
165
+ /**
166
+ * The own-file child kind (e.g. `"automation"`) whose file authors the
167
+ * resource; absent when the stream root's own file authors it. Lets a
168
+ * caller that writes only some files refuse only for those.
169
+ */
170
+ readonly ownFileKind?: string;
171
+ }
172
+ /** The pull-abort message for one or more authoring blockers. */
173
+ export declare function authoringBlockedMessage(blockers: readonly AuthoringBlocker[]): string;
174
+ /**
175
+ * Record an authoring blocker. Without a sink (a caller outside the stream
176
+ * pipeline) it throws, so a blocker is never silently dropped.
177
+ */
178
+ export declare function reportAuthoringBlocker(ctx: Pick<FromTfContext, "authoringBlockers">, blocker: AuthoringBlocker): void;
179
+ /**
180
+ * An own-file child whose owner reference does not name the stream root being
181
+ * pulled. Export never produces one, and skipping it would drop a live,
182
+ * possibly adopted resource from source (edk#1484).
183
+ */
184
+ export declare function ownerMismatchBlocker(address: string, reason: string, ownFileKind: string): AuthoringBlocker;
129
185
  /** `data.<type>.<label>.id` → the label; undefined for any other shape. */
186
+ /**
187
+ * The `org.groups` key for a group a pulled reference names: the key org.ts
188
+ * assigned that group by name when known, else the export label's key
189
+ * (correct whenever no two group names sanitize to the same key).
190
+ */
191
+ export declare function groupCatalogKey(ctx: Pick<FromTfContext, "groupKeysByName">, label: string, name: string): string;
130
192
  export declare function dataRefLabel(v: TfValue | undefined, type: string): string | undefined;
131
193
  /** `<type>.<label>.id` → the label; undefined for any other shape. */
132
194
  export declare function resourceRefLabel(v: TfValue | undefined, type: string): string | undefined;
@@ -4,8 +4,47 @@
4
4
  * inspectors. Entity-agnostic by definition — nothing in here may name a
5
5
  * resource type. (The emission-side twin is src/engine/build/context.ts.)
6
6
  */
7
- import { isTfExpr } from "../tf/index.js";
7
+ import { EntityTfError } from "../entity.js";
8
+ import { isTfExpr, tfLabelToTsLabel } from "../tf/index.js";
9
+ /** The pull-abort message for one or more authoring blockers. */
10
+ export function authoringBlockedMessage(blockers) {
11
+ const remedies = [...new Set(blockers.map((blocker) => blocker.remedy))];
12
+ return ("Pull aborted: authored source cannot reproduce this live configuration, " +
13
+ "and printing the rest would change it on the next apply:\n" +
14
+ blockers.map((blocker) => ` - ${blocker.description}`).join("\n") +
15
+ remedies.map((remedy) => `\n${remedy}`).join(""));
16
+ }
17
+ /**
18
+ * Record an authoring blocker. Without a sink (a caller outside the stream
19
+ * pipeline) it throws, so a blocker is never silently dropped.
20
+ */
21
+ export function reportAuthoringBlocker(ctx, blocker) {
22
+ if (ctx.authoringBlockers === undefined)
23
+ throw new EntityTfError(authoringBlockedMessage([blocker]));
24
+ ctx.authoringBlockers.push(blocker);
25
+ }
26
+ /**
27
+ * An own-file child whose owner reference does not name the stream root being
28
+ * pulled. Export never produces one, and skipping it would drop a live,
29
+ * possibly adopted resource from source (edk#1484).
30
+ */
31
+ export function ownerMismatchBlocker(address, reason, ownFileKind) {
32
+ return {
33
+ address,
34
+ description: `${reason}, so pull cannot write it and leaving it out would let the next plan destroy it.`,
35
+ remedy: "The export carries resources that do not belong to the app being pulled. Pull again; if it persists, report it to the EDK maintainers.",
36
+ ownFileKind,
37
+ };
38
+ }
8
39
  /** `data.<type>.<label>.id` → the label; undefined for any other shape. */
40
+ /**
41
+ * The `org.groups` key for a group a pulled reference names: the key org.ts
42
+ * assigned that group by name when known, else the export label's key
43
+ * (correct whenever no two group names sanitize to the same key).
44
+ */
45
+ export function groupCatalogKey(ctx, label, name) {
46
+ return ctx.groupKeysByName?.get(name) ?? tfLabelToTsLabel(label);
47
+ }
9
48
  export function dataRefLabel(v, type) {
10
49
  if (v === undefined || !isTfExpr(v) || v.$expr !== "data-attr" || v.type !== type)
11
50
  return undefined;
@@ -14,3 +14,11 @@ export declare function procedureDiscriminator(cloudLinkName: string, name: stri
14
14
  * same-name overload to disambiguate.
15
15
  */
16
16
  export declare function loadProcedureCatalogKeys(orgRoot: string): Promise<ReadonlyMap<string, string>>;
17
+ /**
18
+ * Group display name → the `org.groups` key the already-pulled
19
+ * `<orgRoot>/org.ts` assigned it. org.ts suffixes groups whose names sanitize
20
+ * to the same key (`ops`, `ops_1`), which a pulled reference's export label
21
+ * cannot reproduce (edk#1412). Empty when org.ts is missing or unloadable;
22
+ * callers then fall back to the label's key.
23
+ */
24
+ export declare function loadGroupCatalogKeys(orgRoot: string): Promise<ReadonlyMap<string, string>>;
@@ -67,3 +67,31 @@ export async function loadProcedureCatalogKeys(orgRoot) {
67
67
  }
68
68
  return map;
69
69
  }
70
+ /**
71
+ * Group display name → the `org.groups` key the already-pulled
72
+ * `<orgRoot>/org.ts` assigned it. org.ts suffixes groups whose names sanitize
73
+ * to the same key (`ops`, `ops_1`), which a pulled reference's export label
74
+ * cannot reproduce (edk#1412). Empty when org.ts is missing or unloadable;
75
+ * callers then fall back to the label's key.
76
+ */
77
+ export async function loadGroupCatalogKeys(orgRoot) {
78
+ const map = new Map();
79
+ const orgPath = join(orgRoot, "org.ts");
80
+ if (!existsSync(orgPath))
81
+ return map;
82
+ let mod;
83
+ try {
84
+ mod = (await createWorkspaceLoader(orgRoot).import(orgPath));
85
+ }
86
+ catch {
87
+ return map;
88
+ }
89
+ for (const [key, group] of Object.entries(mod.org?.groups ?? {})) {
90
+ // Two groups with the exact same name: the first key wins. A by-name
91
+ // `data.elementum_group` lookup can't tell them apart either, so both
92
+ // references would bind to the same platform group regardless.
93
+ if (typeof group?.name === "string" && !map.has(group.name))
94
+ map.set(group.name, key);
95
+ }
96
+ return map;
97
+ }
@@ -33,6 +33,11 @@ export interface DirectReferenceRoot {
33
33
  readonly refName: string;
34
34
  readonly name: string;
35
35
  }[];
36
+ /** The owner's AI search tables, keyed as the owner's own export keys them. */
37
+ readonly searchTables?: readonly {
38
+ readonly refName: string;
39
+ readonly name: string;
40
+ }[];
36
41
  }
37
42
  export type UnresolvedReference = UnresolvedReferenceDiagnostic;
38
43
  /** Format the diagnostic suffix printed beside an existing `unsafePlatformId(...)` call. */
@@ -143,16 +143,18 @@ function parseRoot(payload) {
143
143
  outputs,
144
144
  }];
145
145
  });
146
- const skills = (Array.isArray(obj.skills) ? obj.skills : []).flatMap((rawSkill) => {
147
- const skill = record(rawSkill);
148
- if (skill === undefined)
146
+ const namedItems = (raw) => (Array.isArray(raw) ? raw : []).flatMap((rawItem) => {
147
+ const item = record(rawItem);
148
+ if (item === undefined)
149
149
  return [];
150
- const skillName = stringAt(skill, "name");
151
- const skillRefName = stringAt(skill, "refName");
152
- return skillName === undefined || skillRefName === undefined
150
+ const itemName = stringAt(item, "name");
151
+ const itemRefName = stringAt(item, "refName");
152
+ return itemName === undefined || itemRefName === undefined
153
153
  ? []
154
- : [{ refName: tfLabelToTsLabel(skillRefName), name: skillName }];
154
+ : [{ refName: tfLabelToTsLabel(itemRefName), name: itemName }];
155
155
  });
156
+ const skills = namedItems(obj.skills);
157
+ const searchTables = namedItems(obj.searchTables);
156
158
  return {
157
159
  root: {
158
160
  kind,
@@ -164,6 +166,7 @@ function parseRoot(payload) {
164
166
  datamines,
165
167
  automations,
166
168
  skills,
169
+ ...(searchTables.length > 0 ? { searchTables } : {}),
167
170
  },
168
171
  diagnostics,
169
172
  };
@@ -23,4 +23,10 @@ export declare function managedResultStatus(operation: string, verdict: ManagedR
23
23
  * redirect gets the complete machine-readable result object.
24
24
  */
25
25
  export declare function writePullResult(result: unknown, humanLines: readonly PullResultLine[], status?: ManagedResultStatus): void;
26
+ /**
27
+ * Reports partial reads no pull summary took: exports outside `pull` (clone,
28
+ * the refresh after apply) and a pull that failed before its summary. Called
29
+ * once when a CLI command ends.
30
+ */
31
+ export declare function reportPendingPartialReads(): void;
26
32
  export declare function countSummary(entries: readonly (readonly [singular: string, count: number, plural?: string])[]): string;
@@ -1,4 +1,6 @@
1
- import { flushRepeatedTechnicalLogs, machineReadableLogsEnabled, renderTextEffects, writeUserOutput } from "../progress.js";
1
+ import { coverageGapEvents, coverageGapMessages, coverageGapResultFields, describeGapKinds, strictCoverageExitCode, strictCoverageFailureMessage } from "../coverage-gaps.js";
2
+ import { takePartialReads } from "../ei/run.js";
3
+ import { flushRepeatedTechnicalLogs, machineReadableLogsEnabled, renderTextEffects, writeTechnicalLog, writeUserOutput } from "../progress.js";
2
4
  export function managedResultStatus(operation, verdict) {
3
5
  const outcome = verdict.failed === true
4
6
  ? "failure"
@@ -16,11 +18,46 @@ export function writePullResult(result, humanLines, status) {
16
18
  // Put duplicate-warning summaries before the final success/warning/failure
17
19
  // marker, so the marker remains the last diagnostic signal of the command.
18
20
  flushRepeatedTechnicalLogs();
19
- const resultWithStatus = status !== undefined && result !== null && typeof result === "object"
20
- ? { ...result, status: status.outcome }
21
+ const reads = takeReads();
22
+ const partialReads = groupPartialReads(reads);
23
+ const detail = partialReadDetail();
24
+ // A partial read means some fields were never read: the pull is incomplete
25
+ // even when everything that was read was written (docs/design/graphql-error-standard.md).
26
+ // Same gap definition as build/plan: distinct, non-advisory diagnostics.
27
+ const gapEvents = coverageGapEvents(coverageGapMessages(resultDiagnostics(result) ?? []));
28
+ const gapCount = gapEvents.length;
29
+ const effectiveStatus = status !== undefined && status.outcome === "success" && (reads.length > 0 || gapCount > 0)
30
+ ? { ...status, outcome: "warning" }
31
+ : status;
32
+ // edk#1473: count the pull's coverage gaps (extract + build diagnostics) in
33
+ // the result and the closing summary instead of leaving them as loose WARNs.
34
+ const gapMessages = resultDiagnostics(result);
35
+ const resultWithStatus = result !== null && typeof result === "object"
36
+ ? {
37
+ ...result,
38
+ ...(gapMessages === undefined ? {} : coverageGapResultFields(gapMessages)),
39
+ partialReads,
40
+ ...(detail === "verbose" ? { partialReadDetails: reads } : {}),
41
+ ...(reads.length > 0 && "exportComplete" in result ? { exportComplete: false } : {}),
42
+ ...(effectiveStatus === undefined ? {} : { status: effectiveStatus.outcome }),
43
+ }
21
44
  : result;
45
+ status = effectiveStatus;
46
+ // edk#1477: with --strict-coverage, a pull that finished with coverage gaps
47
+ // exits non-zero. A failure keeps its own exit code.
48
+ if (status?.outcome !== "failure") {
49
+ const strictCode = strictCoverageExitCode(0, gapCount);
50
+ if (strictCode !== 0) {
51
+ process.exitCode = strictCode;
52
+ writeTechnicalLog("ERROR", "edk", strictCoverageFailureMessage(`${status?.operation ?? "Pull"}`.toLowerCase(), gapCount));
53
+ }
54
+ }
22
55
  if (process.stdout.isTTY === true && !machineReadableLogsEnabled()) {
23
56
  const renderedLines = humanLines.flatMap((line) => Array.isArray(line) && line.length === 0 ? [] : [renderPullResultLine(line)]);
57
+ if (gapCount > 0) {
58
+ renderedLines.push(` Coverage gaps: ${gapCount} setting${gapCount === 1 ? " was" : "s were"} ${describeGapKinds(gapEvents)} while pulling (see the warnings above)`);
59
+ }
60
+ renderedLines.push(...partialReadLines(reads, detail));
24
61
  if (status !== undefined) {
25
62
  const message = status.outcome === "success"
26
63
  ? `${status.operation} completed successfully`
@@ -47,6 +84,79 @@ export function writePullResult(result, humanLines, status) {
47
84
  }
48
85
  process.stdout.write(`${JSON.stringify(resultWithStatus, null, 2)}\n`);
49
86
  }
87
+ function resultDiagnostics(result) {
88
+ if (result === null || typeof result !== "object")
89
+ return undefined;
90
+ const diagnostics = result.diagnostics;
91
+ return Array.isArray(diagnostics) ? diagnostics.filter((d) => typeof d === "string") : undefined;
92
+ }
93
+ /**
94
+ * Reports partial reads no pull summary took: exports outside `pull` (clone,
95
+ * the refresh after apply) and a pull that failed before its summary. Called
96
+ * once when a CLI command ends.
97
+ */
98
+ export function reportPendingPartialReads() {
99
+ const reads = takeReads();
100
+ partialReadLines(reads, partialReadDetail()).forEach((line, index) => {
101
+ if (machineReadableLogsEnabled())
102
+ writeTechnicalLog("WARN", "edk", line);
103
+ else
104
+ console.error(index === 0 ? `Warning: ${line}` : line);
105
+ });
106
+ }
107
+ function takeReads() {
108
+ return takePartialReads().map(({ operation, path, code, message, category, guidance }) => ({ operation, path, ...(code === undefined ? {} : { code }), message, category, guidance }));
109
+ }
110
+ /** The human lines for partial reads at a detail level; off hides the listing, not the fact. */
111
+ function partialReadLines(reads, detail) {
112
+ if (reads.length === 0)
113
+ return [];
114
+ if (detail === "verbose") {
115
+ return reads.flatMap((read) => [
116
+ `Incomplete read of ${pathText(read.path)} in ${read.operation}: ${read.message}`,
117
+ ` [${read.category}] ${read.guidance}`,
118
+ ]);
119
+ }
120
+ if (detail === "summary") {
121
+ const groups = groupPartialReads(reads);
122
+ const allPlatform = groups.every((group) => group.category === "platform");
123
+ return [
124
+ `${reads.length} field(s) were not read (${groups.length} kind(s)${allPlatform ? ", platform-side" : ""}); rerun with --partial-reads=verbose for every path:`,
125
+ ...groups.map((group) => ` - ${group.field} in ${group.operation} (${group.count}) [${group.category}] ${group.guidance}`),
126
+ ];
127
+ }
128
+ return [`${reads.length} field(s) were not read; rerun with --partial-reads=summary to see which`];
129
+ }
130
+ function partialReadDetail() {
131
+ const value = process.env["ELEMENTUM_PARTIAL_READS"]?.toLowerCase();
132
+ return value === "off" || value === "verbose" ? value : "summary";
133
+ }
134
+ /** One entry per operation and field (list indexes ignored), in first-seen order. */
135
+ function groupPartialReads(reads) {
136
+ const groups = new Map();
137
+ for (const read of reads) {
138
+ const field = read.path.map((segment) => typeof segment === "number" ? "[]" : segment).join(".").replace(/\.\[\]/g, "[]");
139
+ const key = `${read.operation}\u0000${field}`;
140
+ const group = groups.get(key);
141
+ if (group !== undefined) {
142
+ group.count += 1;
143
+ continue;
144
+ }
145
+ groups.set(key, {
146
+ operation: read.operation,
147
+ field,
148
+ count: 1,
149
+ ...(read.code === undefined ? {} : { code: read.code }),
150
+ message: read.message,
151
+ category: read.category,
152
+ guidance: read.guidance,
153
+ });
154
+ }
155
+ return [...groups.values()];
156
+ }
157
+ function pathText(path) {
158
+ return path.map((segment, index) => typeof segment === "number" ? `[${segment}]` : `${index === 0 ? "" : "."}${segment}`).join("");
159
+ }
50
160
  function renderPullResultLine(line) {
51
161
  if (typeof line === "string")
52
162
  return line;
@@ -190,7 +190,7 @@ class Parser {
190
190
  }
191
191
  if (first === "var") {
192
192
  if (this.options.allowVariables !== true) {
193
- throw new TfExprError("Terraform variables are only supported in modeled credential attributes", this.src);
193
+ throw new TfExprError("Terraform variables are only supported in modeled credential attributes and write-only API secrets", this.src);
194
194
  }
195
195
  this.expect(".");
196
196
  const name = this.takeIdent();
@@ -3,10 +3,10 @@
3
3
  * A second dialect must not exist: extractors consume TfBlock from parseHcl;
4
4
  * toHcl emitters produce TfBlock rendered by renderDocument.
5
5
  */
6
- export type { PathSeg, TfBlock, TfBlockKind, TfDocument, TfExpr, TfValue } from "./model.js";
6
+ export type { PathSeg, TfBlock, TfBlockKind, TfDocument, TfExpr, TfLifecycle, TfValue, TfVariableValidation } from "./model.js";
7
7
  export { expr, isTfExpr } from "./model.js";
8
8
  export { decodeTemplateEscapes, encodeTemplateEscapes, quoteHclString } from "./escape.js";
9
9
  export { parseExpression, parseStringValue, TfExprError } from "./expr.js";
10
10
  export { assertNoUnsafeIntegers, inspectBackendHcl, parseHcl, parseHclDocuments, TfParseError, type BackendHclInspection, } from "./parse.js";
11
11
  export { renderBlock, renderDocument } from "./render.js";
12
- export { appResourceLabelPrefix, appScopedResourceLabel, bareChildResourceLabel, childPartFromScopedLabel, elementResourceLabelPrefix, elementScopedResourceLabel, isCanonicalTsLabel, isTfLabel, isUuid, sanitizeName, scopedLabelToBagKey, scopedResourceLabel, snakeSlug, splitCamelCase, tfLabelToTsLabel, tsLabelToTfLabel, type ChildResourceScope, } from "./labels.js";
12
+ export { appResourceLabelPrefix, appScopedResourceLabel, bareChildResourceLabel, childPartFromScopedLabel, elementResourceLabelPrefix, elementScopedResourceLabel, isCanonicalTsLabel, isTfLabel, isUuid, ownerFromScopedChildLabel, sanitizeName, scopedLabelToBagKey, scopedResourceLabel, snakeSlug, splitCamelCase, stableIdSuffix, tfLabelToTsLabel, tsLabelToTfLabel, taskResourceLabelPrefix, type ChildResourceScope, type FieldOwnerScope, } from "./labels.js";
@@ -8,4 +8,4 @@ export { decodeTemplateEscapes, encodeTemplateEscapes, quoteHclString } from "./
8
8
  export { parseExpression, parseStringValue, TfExprError } from "./expr.js";
9
9
  export { assertNoUnsafeIntegers, inspectBackendHcl, parseHcl, parseHclDocuments, TfParseError, } from "./parse.js";
10
10
  export { renderBlock, renderDocument } from "./render.js";
11
- export { appResourceLabelPrefix, appScopedResourceLabel, bareChildResourceLabel, childPartFromScopedLabel, elementResourceLabelPrefix, elementScopedResourceLabel, isCanonicalTsLabel, isTfLabel, isUuid, sanitizeName, scopedLabelToBagKey, scopedResourceLabel, snakeSlug, splitCamelCase, tfLabelToTsLabel, tsLabelToTfLabel, } from "./labels.js";
11
+ export { appResourceLabelPrefix, appScopedResourceLabel, bareChildResourceLabel, childPartFromScopedLabel, elementResourceLabelPrefix, elementScopedResourceLabel, isCanonicalTsLabel, isTfLabel, isUuid, ownerFromScopedChildLabel, sanitizeName, scopedLabelToBagKey, scopedResourceLabel, snakeSlug, splitCamelCase, stableIdSuffix, tfLabelToTsLabel, tsLabelToTfLabel, taskResourceLabelPrefix, } from "./labels.js";
@@ -35,11 +35,17 @@ export declare function sanitizeName(name: string): string;
35
35
  export declare function isUuid(value: string): boolean;
36
36
  /** Scope for child resource labels under a stream root. */
37
37
  export type ChildResourceScope = "app" | "element";
38
+ /** Owner scopes for child labels, including standalone tasks (custom fields only, edk#1464). */
39
+ export type FieldOwnerScope = ChildResourceScope | "task";
38
40
  /**
39
41
  * Prefix for app-owned child resource labels in a shared `.tf/out/` workspace.
40
42
  * Uses the platform namespace (`appTfLabel`), matching ei's `AppResourceName`.
41
43
  */
42
44
  export declare function appResourceLabelPrefix(appTfLabel: string): string;
45
+ /** Prefix for standalone-task-owned children (custom fields, edk#1464). */
46
+ export declare function taskResourceLabelPrefix(taskTfLabel: string): string;
47
+ /** Prefix for a child label in the given owner scope. */
48
+ export declare function scopedResourceLabelPrefix(ownerTfLabel: string, scope: FieldOwnerScope): string;
43
49
  /** Prefix for element-owned children in a shared `.tf/out/` workspace. */
44
50
  export declare function elementResourceLabelPrefix(elementTfLabel: string): string;
45
51
  /**
@@ -67,13 +73,13 @@ export declare function appScopedResourceLabel(appTfLabel: string, childPart: st
67
73
  * address ei already uses — see `__tests__/tf/labels.test.ts`'s "element-prefixed child labels
68
74
  * round-trip" block. Re-pull an existing element (`elementum pull element <ns>`) before your
69
75
  * next build/plan if it predates this fix; adoption's rename guard (board item 225,
70
- * `docs/design/rename-label-identity.md`) safely `state mv`s any address that does shift.
76
+ * `docs/design/rename-label-identity.md`) moves any address that does shift with a `moved` block.
71
77
  */
72
78
  export declare function elementScopedResourceLabel(elementTfLabel: string, childPart: string): string;
73
79
  /** Emit a scoped child label for the owning stream root kind. */
74
- export declare function scopedResourceLabel(ownerTfLabel: string, childPart: string, scope: ChildResourceScope): string;
80
+ export declare function scopedResourceLabel(ownerTfLabel: string, childPart: string, scope: FieldOwnerScope): string;
75
81
  /** Strip a scoped child label back to its bare form (no-op when unprefixed). */
76
- export declare function bareChildResourceLabel(ownerTfLabel: string, scopedLabel: string, scope?: ChildResourceScope): string;
82
+ export declare function bareChildResourceLabel(ownerTfLabel: string, scopedLabel: string, scope?: FieldOwnerScope): string;
77
83
  /**
78
84
  * Child part after the owner namespace — bag keys omit the namespace prefix
79
85
  * for both apps and elements. Strips `apps_<ns>_`/`elements_<ns>_` then
@@ -82,6 +88,23 @@ export declare function bareChildResourceLabel(ownerTfLabel: string, scopedLabel
82
88
  * `startsWith` check is therefore always true for a well-formed label; it is
83
89
  * kept only to no-op on unprefixed input.
84
90
  */
85
- export declare function childPartFromScopedLabel(ownerTfLabel: string, scopedLabel: string, scope: ChildResourceScope): string;
91
+ export declare function childPartFromScopedLabel(ownerTfLabel: string, scopedLabel: string, scope: FieldOwnerScope): string;
92
+ /**
93
+ * Owner encoded in `apps_<ns>_<ns>_<child>` / `elements_<ns>_<ns>_<child>` /
94
+ * `tasks_<ns>_<ns>_<child>`. The namespace may itself contain underscores, so
95
+ * the owner is the longest prefix that is immediately repeated. The shortest
96
+ * match treats a repeated token inside the namespace as the owner
97
+ * (`apps_foo_foo_foo_foo_status`).
98
+ */
99
+ export declare function ownerFromScopedChildLabel(scopedLabel: string): {
100
+ readonly scope: FieldOwnerScope;
101
+ readonly ownerTfLabel: string;
102
+ } | undefined;
103
+ /**
104
+ * First 8 alphanumeric characters of `id`, lowercased. ei export's
105
+ * `stableIDSuffix` (cmd/elementum/export/search_table_refs.go) must stay
106
+ * identical so an id-keyed data source address matches on both sides.
107
+ */
108
+ export declare function stableIdSuffix(id: string): string;
86
109
  /** Scoped terraform label → authoring bag key / ref key. */
87
- export declare function scopedLabelToBagKey(ownerTfLabel: string, scopedLabel: string, scope?: ChildResourceScope): string;
110
+ export declare function scopedLabelToBagKey(ownerTfLabel: string, scopedLabel: string, scope?: FieldOwnerScope): string;