@elementumai/edk 0.12.0 → 0.13.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 (193) hide show
  1. package/README.md +2 -0
  2. package/dist-sdk/src/catalog/factories.d.ts +7 -1
  3. package/dist-sdk/src/catalog/factories.js +2 -0
  4. package/dist-sdk/src/catalog/index.d.ts +2 -2
  5. package/dist-sdk/src/catalog/index.js +1 -1
  6. package/dist-sdk/src/catalog/org.js +79 -34
  7. package/dist-sdk/src/catalog/token.js +5 -0
  8. package/dist-sdk/src/catalog/types.d.ts +7 -1
  9. package/dist-sdk/src/catalog/types.js +3 -0
  10. package/dist-sdk/src/core/system-fields.d.ts +1 -1
  11. package/dist-sdk/src/core/system-fields.js +1 -1
  12. package/dist-sdk/src/core/types/app.d.ts +6 -0
  13. package/dist-sdk/src/engine/build/context.d.ts +3 -0
  14. package/dist-sdk/src/engine/pull/authored-address.js +42 -6
  15. package/dist-sdk/src/engine/pull/authored-root.d.ts +88 -0
  16. package/dist-sdk/src/engine/pull/authored-root.js +306 -0
  17. package/dist-sdk/src/engine/pull/context.d.ts +10 -0
  18. package/dist-sdk/src/engine/pull/field-refs-registry.d.ts +114 -0
  19. package/dist-sdk/src/engine/pull/field-refs-registry.js +501 -0
  20. package/dist-sdk/src/engine/pull/org.d.ts +1 -0
  21. package/dist-sdk/src/engine/pull/org.js +2 -0
  22. package/dist-sdk/src/engine/pull/partition.d.ts +8 -0
  23. package/dist-sdk/src/engine/pull/partition.js +43 -0
  24. package/dist-sdk/src/engine/pull/pulled-roots.d.ts +89 -0
  25. package/dist-sdk/src/engine/pull/pulled-roots.js +203 -0
  26. package/dist-sdk/src/engine/pull/ref-only.d.ts +4 -0
  27. package/dist-sdk/src/engine/pull/ref-only.js +7 -1
  28. package/dist-sdk/src/engine/pull/source-resources.d.ts +39 -0
  29. package/dist-sdk/src/engine/pull/source-resources.js +110 -0
  30. package/dist-sdk/src/engine/pull/stream-root.d.ts +148 -0
  31. package/dist-sdk/src/engine/pull/stream-root.js +563 -0
  32. package/dist-sdk/src/engine/workspace/reserved-catalog-keys.d.ts +47 -0
  33. package/dist-sdk/src/engine/workspace/reserved-catalog-keys.js +115 -0
  34. package/dist-sdk/src/entities/access-policy/build.d.ts +2 -1
  35. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +7 -0
  36. package/dist-sdk/src/entities/access-policy/from-tf.js +18 -3
  37. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +19 -0
  38. package/dist-sdk/src/entities/access-policy/to-tf.js +65 -8
  39. package/dist-sdk/src/entities/agent/build.d.ts +52 -1
  40. package/dist-sdk/src/entities/agent/build.js +34 -0
  41. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +68 -0
  42. package/dist-sdk/src/entities/agent/from-tf.d.ts +34 -1
  43. package/dist-sdk/src/entities/agent/from-tf.js +262 -2
  44. package/dist-sdk/src/entities/agent/index.d.ts +1 -1
  45. package/dist-sdk/src/entities/agent/to-tf.d.ts +8 -10
  46. package/dist-sdk/src/entities/agent/to-tf.js +158 -14
  47. package/dist-sdk/src/entities/agent-tool/from-tf.js +6 -0
  48. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -2
  49. package/dist-sdk/src/entities/agent-tool/to-tf.js +2 -2
  50. package/dist-sdk/src/entities/app/build.d.ts +33 -13
  51. package/dist-sdk/src/entities/app/build.js +14 -12
  52. package/dist-sdk/src/entities/app/from-tf.js +24 -9
  53. package/dist-sdk/src/entities/app/index.d.ts +1 -0
  54. package/dist-sdk/src/entities/app/index.js +1 -0
  55. package/dist-sdk/src/entities/app/module.js +1 -0
  56. package/dist-sdk/src/entities/app/stage-keys.d.ts +2 -2
  57. package/dist-sdk/src/entities/app/stage-keys.js +3 -3
  58. package/dist-sdk/src/entities/app/to-tf.js +1 -0
  59. package/dist-sdk/src/entities/approval-chain/build.d.ts +46 -11
  60. package/dist-sdk/src/entities/approval-chain/build.js +120 -8
  61. package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +24 -2
  62. package/dist-sdk/src/entities/approval-chain/from-tf.js +148 -6
  63. package/dist-sdk/src/entities/approval-chain/index.d.ts +4 -1
  64. package/dist-sdk/src/entities/approval-chain/index.js +4 -1
  65. package/dist-sdk/src/entities/approval-chain/module.js +23 -5
  66. package/dist-sdk/src/entities/approval-chain/printer.d.ts +1 -1
  67. package/dist-sdk/src/entities/approval-chain/printer.js +91 -5
  68. package/dist-sdk/src/entities/approval-chain/steps-tf.d.ts +77 -0
  69. package/dist-sdk/src/entities/approval-chain/steps-tf.js +255 -0
  70. package/dist-sdk/src/entities/approval-chain/steps.d.ts +71 -0
  71. package/dist-sdk/src/entities/approval-chain/steps.js +83 -0
  72. package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +16 -6
  73. package/dist-sdk/src/entities/approval-chain/to-tf.js +37 -4
  74. package/dist-sdk/src/entities/automation/build.js +70 -27
  75. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +20 -5
  76. package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -5
  77. package/dist-sdk/src/entities/automation/from-tf.js +593 -101
  78. package/dist-sdk/src/entities/automation/index.d.ts +1 -0
  79. package/dist-sdk/src/entities/automation/index.js +1 -0
  80. package/dist-sdk/src/entities/automation/module.d.ts +4 -3
  81. package/dist-sdk/src/entities/automation/module.js +33 -12
  82. package/dist-sdk/src/entities/automation/refs-read.d.ts +19 -0
  83. package/dist-sdk/src/entities/automation/refs-read.js +48 -0
  84. package/dist-sdk/src/entities/automation/slack-message-refs.d.ts +9 -0
  85. package/dist-sdk/src/entities/automation/slack-message-refs.js +75 -0
  86. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +11 -0
  87. package/dist-sdk/src/entities/automation/task-output-labels.js +23 -0
  88. package/dist-sdk/src/entities/automation/tasks.d.ts +29 -4
  89. package/dist-sdk/src/entities/automation/tasks.js +34 -11
  90. package/dist-sdk/src/entities/automation/to-tf.d.ts +3 -0
  91. package/dist-sdk/src/entities/automation/to-tf.js +337 -77
  92. package/dist-sdk/src/entities/automation/triggers.d.ts +0 -8
  93. package/dist-sdk/src/entities/automation/triggers.js +26 -11
  94. package/dist-sdk/src/entities/automation/unsafe-script-output.d.ts +50 -0
  95. package/dist-sdk/src/entities/automation/unsafe-script-output.js +92 -0
  96. package/dist-sdk/src/entities/chart/build.d.ts +9 -1
  97. package/dist-sdk/src/entities/chart/from-tf.js +3 -0
  98. package/dist-sdk/src/entities/chart/to-tf.js +19 -2
  99. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +2 -0
  100. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +44 -5
  101. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +46 -12
  102. package/dist-sdk/src/entities/element/audit-field-guard.d.ts +9 -0
  103. package/dist-sdk/src/entities/element/audit-field-guard.js +88 -0
  104. package/dist-sdk/src/entities/element/build.js +2 -1
  105. package/dist-sdk/src/entities/element/from-tf.js +15 -2
  106. package/dist-sdk/src/entities/element/module.js +3 -0
  107. package/dist-sdk/src/entities/element/system-fields.d.ts +13 -0
  108. package/dist-sdk/src/entities/element/system-fields.js +23 -0
  109. package/dist-sdk/src/entities/element/to-tf.js +1 -0
  110. package/dist-sdk/src/entities/field/build.d.ts +9 -0
  111. package/dist-sdk/src/entities/field/from-tf.d.ts +29 -1
  112. package/dist-sdk/src/entities/field/from-tf.js +99 -6
  113. package/dist-sdk/src/entities/field/module.js +4 -0
  114. package/dist-sdk/src/entities/field/to-tf.d.ts +5 -1
  115. package/dist-sdk/src/entities/field/to-tf.js +33 -12
  116. package/dist-sdk/src/entities/org/category.js +1 -0
  117. package/dist-sdk/src/entities/org/index.d.ts +1 -0
  118. package/dist-sdk/src/entities/org/index.js +1 -0
  119. package/dist-sdk/src/entities/org/voice-auth.d.ts +5 -0
  120. package/dist-sdk/src/entities/org/voice-auth.js +33 -0
  121. package/dist-sdk/src/entities/organization/build.d.ts +3 -0
  122. package/dist-sdk/src/entities/organization/build.js +2 -0
  123. package/dist-sdk/src/entities/organization/index.d.ts +1 -0
  124. package/dist-sdk/src/entities/organization/index.js +1 -0
  125. package/dist-sdk/src/entities/organization/to-tf.d.ts +2 -0
  126. package/dist-sdk/src/entities/organization/to-tf.js +59 -1
  127. package/dist-sdk/src/entities/organization/voice-auth.d.ts +60 -0
  128. package/dist-sdk/src/entities/organization/voice-auth.js +60 -0
  129. package/dist-sdk/src/entities/phone-service/build.d.ts +9 -1
  130. package/dist-sdk/src/entities/phone-service/build.js +1 -0
  131. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +3 -0
  132. package/dist-sdk/src/entities/phone-service/from-tf.d.ts +1 -0
  133. package/dist-sdk/src/entities/phone-service/from-tf.js +8 -1
  134. package/dist-sdk/src/entities/phone-service/to-tf.js +16 -0
  135. package/dist-sdk/src/entities/record-create-form/from-tf.js +2 -2
  136. package/dist-sdk/src/entities/relationship/from-tf.js +7 -2
  137. package/dist-sdk/src/entities/relationship/module.js +2 -2
  138. package/dist-sdk/src/entities/relationship/pair-check.d.ts +6 -2
  139. package/dist-sdk/src/entities/relationship/pair-check.js +105 -18
  140. package/dist-sdk/src/entities/relationship/to-tf.js +5 -2
  141. package/dist-sdk/src/entities/role/permission-levels.d.ts +7 -0
  142. package/dist-sdk/src/entities/role/permission-levels.js +78 -0
  143. package/dist-sdk/src/entities/role/to-tf.js +32 -2
  144. package/dist-sdk/src/entities/service-account/module.d.ts +2 -1
  145. package/dist-sdk/src/entities/service-account/module.js +4 -1
  146. package/dist-sdk/src/entities/service-account/resource-type.d.ts +2 -0
  147. package/dist-sdk/src/entities/service-account/resource-type.js +2 -0
  148. package/dist-sdk/src/entities/service-account/role-membership-check.d.ts +20 -0
  149. package/dist-sdk/src/entities/service-account/role-membership-check.js +80 -0
  150. package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +15 -0
  151. package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +36 -0
  152. package/dist-sdk/src/entities/shared/filters/ast.d.ts +2 -0
  153. package/dist-sdk/src/entities/shared/filters/index.d.ts +85 -14
  154. package/dist-sdk/src/entities/shared/filters/index.js +18 -6
  155. package/dist-sdk/src/entities/shared/filters/option-lookups.d.ts +57 -0
  156. package/dist-sdk/src/entities/shared/filters/option-lookups.js +108 -0
  157. package/dist-sdk/src/entities/shared/filters/print.js +9 -5
  158. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +12 -7
  159. package/dist-sdk/src/entities/shared/filters/tf-codec.js +9 -5
  160. package/dist-sdk/src/entities/shared/raw-option-id.d.ts +30 -0
  161. package/dist-sdk/src/entities/shared/raw-option-id.js +41 -0
  162. package/dist-sdk/src/entities/shared/tool-field-ref.js +6 -2
  163. package/dist-sdk/src/entities/skill/input-coverage.js +5 -2
  164. package/dist-sdk/src/entities/sla/build.d.ts +96 -0
  165. package/dist-sdk/src/entities/sla/build.js +124 -0
  166. package/dist-sdk/src/entities/sla/from-tf.d.ts +40 -0
  167. package/dist-sdk/src/entities/sla/from-tf.js +164 -0
  168. package/dist-sdk/src/entities/sla/index.d.ts +1 -0
  169. package/dist-sdk/src/entities/sla/index.js +1 -0
  170. package/dist-sdk/src/entities/sla/module.d.ts +4 -0
  171. package/dist-sdk/src/entities/sla/module.js +73 -0
  172. package/dist-sdk/src/entities/sla/printer.d.ts +2 -0
  173. package/dist-sdk/src/entities/sla/printer.js +84 -0
  174. package/dist-sdk/src/entities/sla/to-tf.d.ts +12 -0
  175. package/dist-sdk/src/entities/sla/to-tf.js +81 -0
  176. package/dist-sdk/src/entities/table/build.d.ts +7 -2
  177. package/dist-sdk/src/entities/table/build.js +22 -1
  178. package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +4 -1
  179. package/dist-sdk/src/entities/table/from-tf.js +89 -14
  180. package/dist-sdk/src/entities/table/index.d.ts +1 -1
  181. package/dist-sdk/src/entities/table/to-tf.js +41 -2
  182. package/dist-sdk/src/entities/task/from-tf.js +2 -1
  183. package/dist-sdk/src/entities/view/from-tf.js +7 -4
  184. package/dist-sdk/src/entities/widget/from-tf.js +13 -2
  185. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +49 -4
  186. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  187. package/dist-sdk/src/graph/index.d.ts +5 -0
  188. package/dist-sdk/src/graph/index.js +7 -0
  189. package/dist-sdk/src/graph/modules.js +11 -1
  190. package/dist-sdk/src/graph/resource-types.d.ts +47 -0
  191. package/dist-sdk/src/graph/resource-types.js +62 -0
  192. package/dist-sdk/src/graph/types.d.ts +78 -6
  193. package/package.json +6 -3
@@ -2,9 +2,11 @@
2
2
  * KIND_MODULES assembly — the only place that imports concrete entity
3
3
  * modules. Engine code imports derived views from {@link ./index.js}.
4
4
  */
5
+ import { renderVoiceAuthAdoptionResource } from "../entities/organization/to-tf.js";
5
6
  import { accessPolicyModule } from "../entities/access-policy/module.js";
6
7
  import { agentModule } from "../entities/agent/module.js";
7
8
  import { agentEvaluationModule } from "../entities/agent-evaluation/module.js";
9
+ import { slaModule } from "../entities/sla/module.js";
8
10
  import { agentA2ASkillModule } from "../entities/agent-a2a-skill/module.js";
9
11
  import { agentToolModule } from "../entities/agent-tool/module.js";
10
12
  import { appModule } from "../entities/app/module.js";
@@ -20,7 +22,7 @@ import { dataLookupModules } from "../entities/data-lookup/module.js";
20
22
  import { fieldModule, managedFieldOrderModule } from "../entities/field/module.js";
21
23
  import { fileReaderModule } from "../entities/file-reader/module.js";
22
24
  import { visualFlowModule } from "../entities/visual-flow/module.js";
23
- import { aiProviderModules, categoryModule, cloudLinkModule, connectorModule, emailAliasModule, groupModule, phoneProviderModule, roleModule, userModule, } from "../entities/org/index.js";
25
+ import { aiProviderModules, categoryModule, cloudLinkModule, connectorModule, emailAliasModule, groupModule, phoneProviderModule, voiceAuthModule, roleModule, userModule, } from "../entities/org/index.js";
24
26
  import { searchTableModule } from "../entities/search-table/module.js";
25
27
  import { recordCreateFormModule } from "../entities/record-create-form/module.js";
26
28
  import { relationshipModule } from "../entities/relationship/module.js";
@@ -43,6 +45,7 @@ export const KIND_MODULES = [
43
45
  accessPolicyModule,
44
46
  agentModule,
45
47
  agentEvaluationModule,
48
+ slaModule,
46
49
  agentToolModule,
47
50
  agentA2ASkillModule,
48
51
  automationModule,
@@ -75,6 +78,13 @@ export const KIND_MODULES = [
75
78
  ...aiProviderModules,
76
79
  groupModule,
77
80
  phoneProviderModule,
81
+ {
82
+ ...voiceAuthModule,
83
+ managedOrganization: {
84
+ listArgs: ["voice-auth", "list", "--all"],
85
+ renderResource: renderVoiceAuthAdoptionResource,
86
+ },
87
+ },
78
88
  phoneServiceModule,
79
89
  roleModule,
80
90
  userModule,
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Concrete resource types the engine's entity-agnostic passes need by name
3
+ * (scoped plans, the automation revision guard). Engine must not import
4
+ * entities/ or spell `elementum_*` itself, so they are wired here.
5
+ */
6
+ /** Definition resource of each scope-owner kind. */
7
+ export declare const SCOPE_OWNER_RESOURCE_TYPES: {
8
+ readonly app: "elementum_app";
9
+ readonly element: "elementum_element";
10
+ };
11
+ /**
12
+ * App, element and field resources: a scoped plan reads other owners'
13
+ * definitions through these, so they are not reported as dependencies
14
+ * outside the scope.
15
+ */
16
+ export declare const SCOPE_DEFINITION_RESOURCE_TYPES: ReadonlySet<string>;
17
+ /** Resource types an element labels `<ns>_<name>` instead of its doubled child prefix. */
18
+ export declare const SCOPE_ELEMENT_SHORT_LABEL_TYPES: ReadonlySet<string>;
19
+ /**
20
+ * Canonical suffixes for short element labels whose child name is fixed by
21
+ * the resource type. Matching the suffix keeps an owner's namespace from
22
+ * being mistaken for a longer element namespace.
23
+ */
24
+ export declare const SCOPE_ELEMENT_CANONICAL_CHILD_SUFFIXES: ReadonlyMap<string, RegExp>;
25
+ /** State addresses of element owners never targeted as removed-from-source orphans. */
26
+ export declare const SCOPE_ORPHANS_LEFT_IN_PLACE: ReadonlySet<string>;
27
+ /** Resource types whose existing state is never reconciled by a scoped plan. */
28
+ export declare const SCOPE_NOT_RECONCILED: ReadonlySet<string>;
29
+ /**
30
+ * Resource types whose destroy deletes the platform object by id (the
31
+ * provider's `deleteManagedField`), so two state addresses must never share
32
+ * one of their ids (#1851).
33
+ */
34
+ export declare const EXCLUSIVE_PLATFORM_ID_RESOURCE_TYPES: ReadonlySet<string>;
35
+ /** Data source an automation file uses to look up a sibling automation. */
36
+ export declare const AUTOMATION_LOOKUP_DATA_TYPE = "elementum_automation";
37
+ /**
38
+ * Trigger types whose `refs` are null by design, not by the platform's
39
+ * eventual-consistency gap: the schedule row of `TRIGGER_SUB_TYPES`. A
40
+ * schedule trigger publishes no trigger references (`ScheduleTriggerOutput`
41
+ * is `Record<string, never>` in `entities/automation/triggers.ts`), so the
42
+ * provider's `populateTriggerRefs` gets an empty list back and stores
43
+ * `refs = null` (`trigger_common.go`). Nothing in generated HCL can index
44
+ * those refs, so the null-refs trigger check skips them (edk#1864). Every other
45
+ * trigger kind has outputs that tasks index, so its null refs are still reported.
46
+ */
47
+ export declare const TRIGGER_TYPES_WITHOUT_REFS: ReadonlySet<string>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Concrete resource types the engine's entity-agnostic passes need by name
3
+ * (scoped plans, the automation revision guard). Engine must not import
4
+ * entities/ or spell `elementum_*` itself, so they are wired here.
5
+ */
6
+ import { APP_RESOURCE_TYPE } from "../entities/app/module.js";
7
+ import { AUTOMATION_RESOURCE_TYPE, TRIGGER_SUB_TYPES } from "../entities/automation/types.js";
8
+ import { DYNAMIC_LAYOUT_RESOURCE_TYPE } from "../entities/dynamic-layout/module.js";
9
+ import { ELEMENT_RESOURCE_TYPE } from "../entities/element/module.js";
10
+ import { FIELD_RESOURCE_TYPES } from "../entities/field/types.js";
11
+ import { ACCESS_POLICY_RESOURCE_TYPE } from "../entities/access-policy/types.js";
12
+ import { RELATIONSHIP_RESOURCE_TYPE } from "../entities/relationship/module.js";
13
+ import { MANAGED_FIELD_ORDER_RESOURCE_TYPE } from "../entities/field/types.js";
14
+ import { MANAGED_VIEW_ORDER_RESOURCE_TYPE } from "../entities/view/types.js";
15
+ /** Definition resource of each scope-owner kind. */
16
+ export const SCOPE_OWNER_RESOURCE_TYPES = { app: APP_RESOURCE_TYPE, element: ELEMENT_RESOURCE_TYPE };
17
+ /**
18
+ * App, element and field resources: a scoped plan reads other owners'
19
+ * definitions through these, so they are not reported as dependencies
20
+ * outside the scope.
21
+ */
22
+ export const SCOPE_DEFINITION_RESOURCE_TYPES = new Set([
23
+ APP_RESOURCE_TYPE,
24
+ ELEMENT_RESOURCE_TYPE,
25
+ ...FIELD_RESOURCE_TYPES,
26
+ ]);
27
+ /** Resource types an element labels `<ns>_<name>` instead of its doubled child prefix. */
28
+ export const SCOPE_ELEMENT_SHORT_LABEL_TYPES = new Set([
29
+ ACCESS_POLICY_RESOURCE_TYPE,
30
+ RELATIONSHIP_RESOURCE_TYPE,
31
+ ]);
32
+ /**
33
+ * Canonical suffixes for short element labels whose child name is fixed by
34
+ * the resource type. Matching the suffix keeps an owner's namespace from
35
+ * being mistaken for a longer element namespace.
36
+ */
37
+ export const SCOPE_ELEMENT_CANONICAL_CHILD_SUFFIXES = new Map([
38
+ [ACCESS_POLICY_RESOURCE_TYPE, /^access_policy(?:_\d+)?$/],
39
+ ]);
40
+ /** State addresses of element owners never targeted as removed-from-source orphans. */
41
+ export const SCOPE_ORPHANS_LEFT_IN_PLACE = new Set([DYNAMIC_LAYOUT_RESOURCE_TYPE]);
42
+ /** Resource types whose existing state is never reconciled by a scoped plan. */
43
+ export const SCOPE_NOT_RECONCILED = new Set([MANAGED_VIEW_ORDER_RESOURCE_TYPE, MANAGED_FIELD_ORDER_RESOURCE_TYPE]);
44
+ /**
45
+ * Resource types whose destroy deletes the platform object by id (the
46
+ * provider's `deleteManagedField`), so two state addresses must never share
47
+ * one of their ids (#1851).
48
+ */
49
+ export const EXCLUSIVE_PLATFORM_ID_RESOURCE_TYPES = new Set(FIELD_RESOURCE_TYPES);
50
+ /** Data source an automation file uses to look up a sibling automation. */
51
+ export const AUTOMATION_LOOKUP_DATA_TYPE = AUTOMATION_RESOURCE_TYPE;
52
+ /**
53
+ * Trigger types whose `refs` are null by design, not by the platform's
54
+ * eventual-consistency gap: the schedule row of `TRIGGER_SUB_TYPES`. A
55
+ * schedule trigger publishes no trigger references (`ScheduleTriggerOutput`
56
+ * is `Record<string, never>` in `entities/automation/triggers.ts`), so the
57
+ * provider's `populateTriggerRefs` gets an empty list back and stores
58
+ * `refs = null` (`trigger_common.go`). Nothing in generated HCL can index
59
+ * those refs, so the null-refs trigger check skips them (edk#1864). Every other
60
+ * trigger kind has outputs that tasks index, so its null refs are still reported.
61
+ */
62
+ export const TRIGGER_TYPES_WITHOUT_REFS = new Set(TRIGGER_SUB_TYPES.filter((t) => t.typeKey === "schedule").map((t) => t.resourceType));
@@ -8,9 +8,11 @@
8
8
  */
9
9
  import type { DeployableEntity } from "../engine/entity.js";
10
10
  import type { FromTfContext } from "../engine/pull/context.js";
11
+ import type { OptionIdIndex } from "../engine/pull/field-refs-registry.js";
12
+ import type { PulledRootStatus } from "../engine/pull/pulled-roots.js";
11
13
  import type { ChildResourceScope, TfBlock, TfValue } from "../engine/tf/index.js";
12
14
  import type { ValidationFailure } from "../engine/validation.js";
13
- export type KindId = "org" | "app" | "element" | "field" | "access-policy" | "agent" | "agent-evaluation" | "chart" | "agent-tool" | "agent-a2a-skill" | "automation" | "approval-chain" | "file-reader" | "visual-flow" | "skill" | "skill-tool" | "view" | "managed-view-order" | "managed-field-order" | "record-create-form" | "dynamic-layout" | "dashboard" | "dashboard-widget" | "datamine" | "automation-value-references" | "organization" | "permission-template" | "service-account" | "stored-function" | "vault-entry" | "task" | "portal" | "widget" | "relationship" | "search-table" | "table" | "cloud-link" | "email-alias" | "category" | "connector" | "ai-provider-anthropic" | "ai-provider-bedrock" | "ai-provider-custom" | "ai-provider-deepgram" | "ai-provider-elevenlab" | "ai-provider-gemini" | "ai-provider-openai" | "ai-provider-snowflake" | "ai-provider-xai" | "ai-provider-managed" | "group" | "phone-provider" | "phone-service" | "role" | "user";
15
+ export type KindId = "org" | "app" | "element" | "field" | "access-policy" | "agent" | "agent-evaluation" | "sla" | "chart" | "agent-tool" | "agent-a2a-skill" | "automation" | "approval-chain" | "file-reader" | "visual-flow" | "skill" | "skill-tool" | "view" | "managed-view-order" | "managed-field-order" | "record-create-form" | "dynamic-layout" | "dashboard" | "dashboard-widget" | "datamine" | "automation-value-references" | "organization" | "permission-template" | "service-account" | "stored-function" | "vault-entry" | "task" | "portal" | "widget" | "relationship" | "search-table" | "table" | "cloud-link" | "email-alias" | "category" | "connector" | "ai-provider-anthropic" | "ai-provider-bedrock" | "ai-provider-custom" | "ai-provider-deepgram" | "ai-provider-elevenlab" | "ai-provider-gemini" | "ai-provider-openai" | "ai-provider-snowflake" | "ai-provider-xai" | "ai-provider-managed" | "group" | "phone-provider" | "phone-service" | "voice-auth" | "role" | "user";
14
16
  /** @deprecated Use {@link KindId}. */
15
17
  export type EntityKindId = KindId;
16
18
  export type StreamFacet = {
@@ -71,6 +73,13 @@ export interface SubTypeRow {
71
73
  * `alignExportWithState`); a first pull has nothing to fill.
72
74
  */
73
75
  readonly unreadableAttributes?: readonly string[];
76
+ /**
77
+ * Option-list attributes (objects keyed by `label`) where the provider keeps
78
+ * an inactive (`active = false`) option only when state already holds it.
79
+ * The export prints every inactive option, and adoption re-imports the field
80
+ * so state holds them too (see `inactiveOptionsStateLacks`, #2186).
81
+ */
82
+ readonly stateScopedInactiveOptions?: readonly string[];
74
83
  }
75
84
  /**
76
85
  * The value state holds for an export reference, or undefined when it cannot
@@ -142,8 +151,8 @@ export type ResourceFacet = {
142
151
  /** How a resource type belonging to this kind participates in stream partition. */
143
152
  export type StreamMatch = "extract" | "family" | "reported";
144
153
  /** Catalog kinds used by org identity data facets. */
145
- export type DataFacetCatalogKind = "cloudLink" | "category" | "connector" | "group" | "phoneProvider" | "aiProvider";
146
- export type OrgIdentityBag = "cloudLinks" | "categories" | "connectors" | "groups" | "phoneProviders" | "aiProviders";
154
+ export type DataFacetCatalogKind = "cloudLink" | "category" | "connector" | "group" | "phoneProvider" | "aiProvider" | "voiceAuth";
155
+ export type OrgIdentityBag = "cloudLinks" | "categories" | "connectors" | "groups" | "phoneProviders" | "aiProviders" | "voiceAuths";
147
156
  /** Portable identity strategy for a direct reference. The build/pull engines
148
157
  * consume these facets generically; entity modules own the product-specific
149
158
  * declaration of how their identities are found. */
@@ -192,6 +201,12 @@ export type DataFacet = {
192
201
  * "aiProviders"`), so the referenced type isn't known until read.
193
202
  */
194
203
  readonly providerRefAttr?: string;
204
+ /**
205
+ * Authored in `organization.ts` as a managed resource that dependents
206
+ * can reference in the same apply. Build resolves that bag through the
207
+ * managed overlay instead of an org.ts data source.
208
+ */
209
+ readonly managedInOrganization?: boolean;
195
210
  };
196
211
  /** Null-object data facet — kind is not a data lookup. */
197
212
  export declare const NO_DATA: DataFacet;
@@ -308,7 +323,8 @@ export interface StreamExtractContext extends FromTfContext {
308
323
  readonly columnRefNamesByName?: ReadonlyMap<string, string>;
309
324
  readonly columnRefNamesById?: ReadonlyMap<string, string>;
310
325
  }>;
311
- readonly picklistOptionLabelById?: ReadonlyMap<string, string>;
326
+ /** See `PicklistOptionsByField` (#2568). */
327
+ readonly picklistOptionsByField?: ReadonlyMap<string, ReadonlyMap<string, string>>;
312
328
  readonly fieldNamesByOwnerRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
313
329
  }
314
330
  export interface OwnFileExtractResult {
@@ -388,6 +404,10 @@ export interface UnresolvedReferenceDiagnostic {
388
404
  readonly uuid: string;
389
405
  readonly reason: string;
390
406
  readonly portability: "source-org-only";
407
+ /** A datamine in an app's connection with no owning app (bridge `Ownerless`). */
408
+ readonly ownerless?: boolean;
409
+ /** The table holding an ownerless datamine. */
410
+ readonly table?: string;
391
411
  }
392
412
  /** Workspace facts a re-pull merge may consult (#1590). */
393
413
  export interface MergePulledSourceContext {
@@ -535,6 +555,8 @@ export interface BuildChildContext {
535
555
  readonly authoredAspectKeys?: ReadonlySet<string>;
536
556
  /** Pulled roots may retain picklist labels removed from the live field. */
537
557
  readonly allowUnknownPicklistOptions?: boolean;
558
+ /** Option ids known offline, for the raw-option-id warnings (#1733). */
559
+ readonly optionIds?: OptionIdIndex;
538
560
  /** Every app/element/table stream root in this build, by refName (see `ToTfContext.workspaceAspects`). */
539
561
  readonly workspaceAspects?: ReadonlyMap<string, {
540
562
  readonly kind: ChildResourceScope | "table" | "task";
@@ -760,6 +782,37 @@ export interface TaskOutputReference {
760
782
  readonly fieldType: string;
761
783
  readonly multiple: boolean;
762
784
  }
785
+ /** A stream root as build rendered it, for {@link EntityKindModule.buildChecks}. */
786
+ export interface BuiltRoot {
787
+ readonly kind: string;
788
+ readonly refName: string;
789
+ /** The root's TF label (namespace). */
790
+ readonly tfLabel: string;
791
+ readonly payload: unknown;
792
+ /** Keys of the fields the root authors (system fields excluded). */
793
+ readonly fieldKeys: ReadonlySet<string>;
794
+ }
795
+ /** A stream root's blocks and source file, for {@link EntityKindModule.buildChecks}' cross-root checks. */
796
+ export interface BuiltRootSource {
797
+ readonly kind: string;
798
+ readonly refName: string;
799
+ /** The root's TF label (namespace). */
800
+ readonly tfLabel: string;
801
+ /** Source file, relative to the org root. */
802
+ readonly file: string;
803
+ readonly blocks: readonly TfBlock[];
804
+ /** The root's compared groups (see `buildChecks.comparedGroup`) against its last pull on this machine. */
805
+ readonly pull: PulledRootStatus;
806
+ }
807
+ /** A failing cross-root check. Build records it as a fatal validation and keeps building (edk#2430). */
808
+ export interface BuildCheckFailure {
809
+ /** Terraform resource address, `type.label`. */
810
+ readonly address: string;
811
+ readonly name: string;
812
+ readonly message: string;
813
+ /** The kind named in the log prefix, when the failure belongs to another kind than the module that checks it. */
814
+ readonly ownerKind?: KindId;
815
+ }
763
816
  export interface EntityKindModule {
764
817
  readonly kind: KindId;
765
818
  /** Export participation. */
@@ -778,9 +831,18 @@ export interface EntityKindModule {
778
831
  readonly canvas: CanvasFacet;
779
832
  /** Generated catalog participation — or {@link NO_CATALOG}. */
780
833
  readonly catalog: CatalogFacet;
781
- /** Build: checks across every built root block; each returned string fails the build. */
834
+ /** Build checks; each returned failure or string fails the build. */
782
835
  readonly buildChecks?: {
783
- readonly validateBuiltBlocks: (blocks: readonly TfBlock[]) => readonly string[];
836
+ /** Across every built root, with each root's blocks and source file. */
837
+ readonly validateBuiltRoots?: (roots: readonly BuiltRootSource[]) => readonly BuildCheckFailure[];
838
+ /**
839
+ * The group (e.g. a relationship pair) of a block `validateBuiltRoots` compares, or `undefined`. Build
840
+ * hashes each root's groups against its last pull, so `BuiltRootSource.pull` says whether one group
841
+ * changed, not just whether the file did (edk#2430).
842
+ */
843
+ readonly comparedGroup?: (block: TfBlock) => string | undefined;
844
+ /** Across every rendered `.tf` file (name → text), with the stream roots built into them. */
845
+ readonly validateRenderedFiles?: (files: ReadonlyMap<string, string>, roots: readonly BuiltRoot[]) => readonly string[];
784
846
  };
785
847
  /**
786
848
  * Plan/apply: resources build emits that may already exist live without
@@ -788,6 +850,16 @@ export interface EntityKindModule {
788
850
  * import is written to `.tf/out` so the plan imports instead of creating.
789
851
  */
790
852
  readonly stateAdoption?: StateAdoptionFacet;
853
+ /**
854
+ * organization.ts owns a managed body of this kind. App adoption imports a
855
+ * referenced one (the export only has a name lookup) using a read-only ei
856
+ * list for the live id and {@link renderResource} for the config the import
857
+ * gate plans.
858
+ */
859
+ readonly managedOrganization?: {
860
+ readonly listArgs: readonly string[];
861
+ readonly renderResource: (label: string, value: unknown) => string | undefined;
862
+ };
791
863
  /** `--portable` pulls and `clone app`: what is left out, mapped or dropped. */
792
864
  readonly portable?: PortableFacet;
793
865
  /** Entity-specific equivalences used only by live build-vs-export comparison. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementumai/edk",
3
- "version": "0.12.0",
3
+ "version": "0.13.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",
@@ -159,6 +159,7 @@
159
159
  "clean:skills": "tsx src/scripts/sync-skill-assets.ts --clean",
160
160
  "sync:compatibility": "tsx src/scripts/sync-compatibility.ts",
161
161
  "check:release-context": "tsx src/scripts/release-context.ts v0.0.0 HEAD >/dev/null",
162
+ "check:config-writes": "go -C cmd/elementum run ./tools/check-config-writes -root ../..",
162
163
  "fetch:schema": "make -C provider fetch-schema",
163
164
  "generate:schema": "make -C provider generate-schema",
164
165
  "generate:graphql": "make -C provider generate-graphql",
@@ -191,6 +192,8 @@
191
192
  "pack:consumer": "npm run build:sdk && tsx src/scripts/test-package-consumer.ts",
192
193
  "release:local-sdk": "bash release/verify-local-sdk-prepare.sh",
193
194
  "release:notes": "tsx src/scripts/release-notes.ts",
195
+ "changelog:combine": "tsx src/scripts/changelog-fragments.ts",
196
+ "check:changelog": "tsx src/scripts/changelog-fragments.ts --check",
194
197
  "check:parity": "tsx src/scripts/check-provider-parity.ts",
195
198
  "test:distribution": "npm --prefix distribution test",
196
199
  "test:binary": "npm run build:sdk && npm run build:binary:bun && npm run smoke:binary:bun",
@@ -210,10 +213,10 @@
210
213
  "typecheck:examples": "tsc --noEmit -p tsconfig.examples-check.json",
211
214
  "pretypecheck:consumer": "npm run generate:ragnarok",
212
215
  "typecheck:consumer": "tsc --noEmit -p tsconfig.package-consumer-check.json",
213
- "lint": "eslint src/cli src/internal/sdk-package.ts src/scripts/prepare-release-promotion.ts src/scripts/test-package-consumer.ts examples/package-consumer",
216
+ "lint": "eslint src/cli src/internal/sdk-package.ts src/scripts/prepare-release-promotion.ts src/scripts/changelog-fragments.ts src/scripts/test-package-consumer.ts examples/package-consumer",
214
217
  "lint:all": "eslint .",
215
218
  "lint:generated": "eslint generated/",
216
- "check": "npm run typecheck && npm run lint && npm run check:release-context",
219
+ "check": "npm run typecheck && npm run lint && npm run check:release-context && npm run check:changelog",
217
220
  "check:distribution": "npm --prefix distribution run check",
218
221
  "verify:distribution": "npm run check:distribution && npm run test:distribution && npm run build:distribution && git diff --exit-code -- distribution/generated distribution/public/schemas",
219
222
  "edk:canvas": "tsx --tsconfig tsconfig.examples-check.json src/scripts/edk-canvas.ts"