@elementumai/edk 0.11.0 → 0.12.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 (72) hide show
  1. package/README.md +38 -6
  2. package/dist-sdk/src/core/triggers/on-demand.d.ts +2 -0
  3. package/dist-sdk/src/core/triggers/on-demand.js +3 -0
  4. package/dist-sdk/src/engine/coverage-gaps.d.ts +5 -0
  5. package/dist-sdk/src/engine/coverage-gaps.js +9 -0
  6. package/dist-sdk/src/engine/ei/run.d.ts +20 -1
  7. package/dist-sdk/src/engine/ei/run.js +102 -14
  8. package/dist-sdk/src/engine/pull/ref-only.d.ts +18 -0
  9. package/dist-sdk/src/engine/pull/ref-only.js +52 -0
  10. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +2 -1
  11. package/dist-sdk/src/entities/access-policy/from-tf.js +7 -1
  12. package/dist-sdk/src/entities/access-policy/module.js +5 -0
  13. package/dist-sdk/src/entities/app/build.d.ts +1 -1
  14. package/dist-sdk/src/entities/app/build.js +79 -4
  15. package/dist-sdk/src/entities/app/from-tf.js +1 -2
  16. package/dist-sdk/src/entities/app/stage-keys.d.ts +18 -3
  17. package/dist-sdk/src/entities/app/stage-keys.js +40 -6
  18. package/dist-sdk/src/entities/app/to-tf.js +1 -0
  19. package/dist-sdk/src/entities/automation/build.d.ts +50 -24
  20. package/dist-sdk/src/entities/automation/build.js +16 -6
  21. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +32 -3
  22. package/dist-sdk/src/entities/automation/from-tf.d.ts +13 -2
  23. package/dist-sdk/src/entities/automation/from-tf.js +269 -63
  24. package/dist-sdk/src/entities/automation/index.d.ts +1 -1
  25. package/dist-sdk/src/entities/automation/module.js +1 -1
  26. package/dist-sdk/src/entities/automation/run-target.d.ts +2 -0
  27. package/dist-sdk/src/entities/automation/run-target.js +5 -0
  28. package/dist-sdk/src/entities/automation/script-code.d.ts +2 -1
  29. package/dist-sdk/src/entities/automation/script-code.js +82 -1
  30. package/dist-sdk/src/entities/automation/script-lint.d.ts +13 -0
  31. package/dist-sdk/src/entities/automation/script-lint.js +418 -0
  32. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +1 -1
  33. package/dist-sdk/src/entities/automation/task-output-labels.js +9 -1
  34. package/dist-sdk/src/entities/automation/tasks.d.ts +47 -14
  35. package/dist-sdk/src/entities/automation/tasks.js +18 -4
  36. package/dist-sdk/src/entities/automation/to-tf.js +256 -28
  37. package/dist-sdk/src/entities/automation/triggers.d.ts +48 -15
  38. package/dist-sdk/src/entities/automation/triggers.js +9 -9
  39. package/dist-sdk/src/entities/chart/build.d.ts +9 -1
  40. package/dist-sdk/src/entities/chart/from-tf.d.ts +2 -2
  41. package/dist-sdk/src/entities/chart/from-tf.js +25 -1
  42. package/dist-sdk/src/entities/chart/index.d.ts +1 -1
  43. package/dist-sdk/src/entities/chart/printer.js +5 -2
  44. package/dist-sdk/src/entities/chart/to-tf.js +19 -1
  45. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +1 -0
  46. package/dist-sdk/src/entities/dynamic-layout/condition-keys.d.ts +48 -0
  47. package/dist-sdk/src/entities/dynamic-layout/condition-keys.js +261 -0
  48. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +1 -1
  49. package/dist-sdk/src/entities/dynamic-layout/module.js +2 -1
  50. package/dist-sdk/src/entities/element/to-tf.js +1 -0
  51. package/dist-sdk/src/entities/field/module.js +8 -2
  52. package/dist-sdk/src/entities/field/to-tf.d.ts +8 -2
  53. package/dist-sdk/src/entities/field/to-tf.js +57 -34
  54. package/dist-sdk/src/entities/org/role.js +5 -0
  55. package/dist-sdk/src/entities/service-account/module.js +5 -0
  56. package/dist-sdk/src/entities/service-account/role-fidelity.d.ts +5 -5
  57. package/dist-sdk/src/entities/service-account/role-fidelity.js +21 -13
  58. package/dist-sdk/src/entities/shared/filters/ast.d.ts +2 -0
  59. package/dist-sdk/src/entities/shared/types/field-types.d.ts +6 -3
  60. package/dist-sdk/src/entities/shared/types/field-types.js +3 -1
  61. package/dist-sdk/src/entities/skill/module.js +2 -0
  62. package/dist-sdk/src/entities/task/to-tf.js +1 -0
  63. package/dist-sdk/src/entities/view/from-tf.d.ts +8 -4
  64. package/dist-sdk/src/entities/view/from-tf.js +3 -5
  65. package/dist-sdk/src/entities/view/module.js +5 -0
  66. package/dist-sdk/src/entities/widget/from-tf.js +2 -2
  67. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +5 -3
  68. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  69. package/dist-sdk/src/graph/index.d.ts +15 -2
  70. package/dist-sdk/src/graph/index.js +12 -0
  71. package/dist-sdk/src/graph/types.d.ts +38 -0
  72. package/package.json +1 -1
@@ -69,6 +69,13 @@ export const BUILD_VS_EXPORT_STATE_EVALUATED_MAPS = KIND_MODULES.flatMap((module
69
69
  export const BUILD_VS_EXPORT_RENDERED_JSONENCODE_ATTRIBUTES = KIND_MODULES.flatMap((module) => module.roundtrip?.renderedJsonencodeAttributes ?? []);
70
70
  export const BUILD_VS_EXPORT_STATE_BOUND_REFERENCES = KIND_MODULES.flatMap((module) => module.roundtrip?.stateBoundReferences ?? []);
71
71
  export const BUILD_VS_EXPORT_STATE_RESOLVED_DATA_LOOKUPS = new Set(KIND_MODULES.flatMap((module) => (module.roundtrip?.stateResolvedDataLookups ?? []).map((lookup) => lookup.dataType)));
72
+ /** Data type → how its lookup's id is read off a managed resource when state holds no `data:` row for it. */
73
+ export const BUILD_VS_EXPORT_STATE_RESOLVED_DATA_LOOKUP_FALLBACKS = new Map(KIND_MODULES.flatMap((module) => module.roundtrip?.stateResolvedDataLookups ?? [])
74
+ .flatMap(({ dataType, managedFallback }) => managedFallback === undefined ? [] : [[dataType, {
75
+ resourceTypes: new Set(managedFallback.resourceTypes),
76
+ matchAttributes: managedFallback.matchAttributes,
77
+ ownerAttribute: managedFallback.ownerAttribute,
78
+ }]]));
72
79
  export const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCES = new Map(KIND_MODULES.flatMap((module) => Object.entries(module.roundtrip?.taskOutputReferences ?? {}))
73
80
  .map(([taskType, references]) => [taskType, new Map(Object.entries(references))]));
74
81
  /** Kind id → module. */
@@ -135,6 +142,10 @@ export const STATE_SCOPED_MAP_ATTRIBUTES_BY_RESOURCE_TYPE = new Map(KIND_MODULES
135
142
  export const STATE_SCOPED_PLATFORM_ENTRIES_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatMap((m) => m.resource.shape === "single" && m.resource.stateScopedPlatformEntries !== undefined
136
143
  ? [[m.resource.resourceType, m.resource.stateScopedPlatformEntries]]
137
144
  : []));
145
+ /** Resource type → the kind's own re-pull alignment, as each single-resource kind declares it. */
146
+ export const STATE_ALIGNMENTS_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatMap((m) => m.resource.shape === "single" && m.resource.alignWithState !== undefined
147
+ ? [[m.resource.resourceType, m.resource.alignWithState]]
148
+ : []));
138
149
  /** Every kind's `--portable` leave-out rules (edk#1894). */
139
150
  export const PORTABLE_LEAVE_OUT = KIND_MODULES.flatMap((m) => m.portable?.leaveOut ?? []);
140
151
  /** Every kind's `--portable` emptied-list rules (edk#1894). */
@@ -145,6 +156,7 @@ export const PORTABLE_PRINCIPALS = KIND_MODULES.flatMap((m) => m.portable?.princ
145
156
  export const BUILD_VS_EXPORT_NORMALIZATIONS = {
146
157
  omittedAttributeDefaults: KIND_MODULES.flatMap((module) => (module.roundtrip?.omittedAttributeDefaults ?? []).flatMap((equivalence) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...equivalence })))),
147
158
  stringSuffixAliases: KIND_MODULES.flatMap((module) => (module.roundtrip?.stringSuffixAliases ?? []).flatMap((equivalence) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...equivalence })))),
159
+ unorderedListAttributes: KIND_MODULES.flatMap((module) => (module.roundtrip?.unorderedListAttributes ?? []).flatMap((attribute) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, attribute })))),
148
160
  };
149
161
  /** Own-file children of a parent kind (build discovery + pull print paths). */
150
162
  export function ownFileChildrenOf(parent) {
@@ -72,6 +72,20 @@ export interface SubTypeRow {
72
72
  */
73
73
  readonly unreadableAttributes?: readonly string[];
74
74
  }
75
+ /**
76
+ * The value state holds for an export reference, or undefined when it cannot
77
+ * be resolved (see `engine/pull/state-reference-resolver.ts`).
78
+ */
79
+ export type StateReferenceResolver = (value: TfValue) => unknown;
80
+ /**
81
+ * A kind's re-pull alignment: the exported resource's attributes, rewritten
82
+ * from that resource's state attributes. Returns `exported` itself when
83
+ * nothing changes.
84
+ */
85
+ export type StateAlignment = (exported: Record<string, TfValue>, state: Readonly<Record<string, unknown>>, context: {
86
+ readonly address: string;
87
+ readonly resolve: StateReferenceResolver;
88
+ }) => Record<string, TfValue>;
75
89
  export interface CompositeMember {
76
90
  readonly role: string;
77
91
  readonly resourceType: string;
@@ -100,6 +114,12 @@ export type ResourceFacet = {
100
114
  * it unless state holds its id (see `alignExportWithState`).
101
115
  */
102
116
  readonly stateScopedPlatformEntries?: readonly StateScopedPlatformEntry[];
117
+ /**
118
+ * Anything else a re-pull has to restore from state that the export
119
+ * cannot carry (a dynamic layout's condition keys). Runs before the
120
+ * declarative alignments above (see `alignExportWithState`).
121
+ */
122
+ readonly alignWithState?: StateAlignment;
103
123
  } | {
104
124
  readonly shape: "subTypes";
105
125
  readonly rows: readonly SubTypeRow[];
@@ -793,6 +813,11 @@ export interface EntityKindModule {
793
813
  readonly attribute: string;
794
814
  readonly suffix: string;
795
815
  }[];
816
+ /**
817
+ * List attributes the provider schema declares as sets, so their order
818
+ * carries no meaning and build vs export compares them unordered (edk#2437).
819
+ */
820
+ readonly unorderedListAttributes?: readonly string[];
796
821
  /**
797
822
  * Two `<label><suffix>` locals that read the same list on this kind's
798
823
  * resource, one indexed by each entry's name and one by its key.
@@ -921,6 +946,19 @@ export interface EntityKindModule {
921
946
  */
922
947
  readonly stateResolvedDataLookups?: readonly {
923
948
  readonly dataType: string;
949
+ /**
950
+ * When state holds no `data:` row for the export's lookup (the export
951
+ * declares it but only uses its id raw inside a template), its id is the
952
+ * one managed `<resourceTypes>` resource in state whose `<matchAttributes>`
953
+ * equal the lookup's string literals and whose `<ownerAttribute>` equals
954
+ * the state-confirmed id of the lookup's `<ownerAttribute> =
955
+ * data.<owner>.id`. The lookup must set exactly those attributes.
956
+ */
957
+ readonly managedFallback?: {
958
+ readonly resourceTypes: readonly string[];
959
+ readonly matchAttributes: readonly string[];
960
+ readonly ownerAttribute: string;
961
+ };
924
962
  }[];
925
963
  /**
926
964
  * Top-level `<attribute>` of `<resourceType>` where the export writes the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementumai/edk",
3
- "version": "0.11.0",
3
+ "version": "0.12.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",