react-semaphor 0.1.416 → 0.1.418

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 (59) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +49 -50
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/chunks/analyze-result-contract-Akysi2ML.js +2003 -0
  6. package/dist/chunks/analyze-result-contract-COjyJzYm.js +1 -0
  7. package/dist/chunks/{calendar-preferences-dialog-B8FmFRHX.js → calendar-preferences-dialog-BbuLgela.js} +3 -3
  8. package/dist/chunks/{calendar-preferences-dialog-ck4AU-to.js → calendar-preferences-dialog-CInkkhl_.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-Br_1IK1z.js → dashboard-briefing-launcher-B4OWNsVD.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-Tr2SqDMK.js → dashboard-briefing-launcher-D7FNuDuc.js} +4 -4
  11. package/dist/chunks/{dashboard-controls-B7OObDNl.js → dashboard-controls-DTC1eCz0.js} +1 -1
  12. package/dist/chunks/{dashboard-controls-B2bEv8uG.js → dashboard-controls-DcX7Mid4.js} +5 -5
  13. package/dist/chunks/{dashboard-json-DAB8WVyb.js → dashboard-json-BHWbQS6I.js} +3 -3
  14. package/dist/chunks/{dashboard-json-DNixjalS.js → dashboard-json-vu38P5pV.js} +1 -1
  15. package/dist/chunks/{edit-dashboard-visual-DWygSAp3.js → edit-dashboard-visual-CkBhJBhp.js} +1 -1
  16. package/dist/chunks/{edit-dashboard-visual-Dh8Ge3-B.js → edit-dashboard-visual-DsCr90_3.js} +4 -4
  17. package/dist/chunks/{index-BkTLAfKy.js → index-C56DuHI8.js} +163 -164
  18. package/dist/chunks/{index-CQIMj-FF.js → index-C8thRvkW.js} +4 -4
  19. package/dist/chunks/{switch-DMlqgIx_.js → switch-BXuyni6l.js} +1 -1
  20. package/dist/chunks/{switch-DgiogS4X.js → switch-Dsx-IwBE.js} +1 -1
  21. package/dist/chunks/{update-policy-BnEbPhHW.js → update-policy-B5S_LfEu.js} +347 -314
  22. package/dist/chunks/update-policy-BqBKUk3Q.js +3 -0
  23. package/dist/chunks/{use-create-flow-overlay-state-CZA-dSns.js → use-create-flow-overlay-state-BDv_VpL6.js} +1 -1
  24. package/dist/chunks/{use-create-flow-overlay-state-uujasvbD.js → use-create-flow-overlay-state-CzftV84t.js} +3 -3
  25. package/dist/chunks/{validators-UqQI3Cg_.js → validators-CLzrE2N_.js} +1 -1
  26. package/dist/chunks/validators-CPFcUMrV.js +1 -0
  27. package/dist/dashboard/index.cjs +1 -1
  28. package/dist/dashboard/index.js +1 -1
  29. package/dist/dashboard-authoring/index.cjs +3 -3
  30. package/dist/dashboard-authoring/index.js +28 -29
  31. package/dist/data-app-builder/index.cjs +1 -1
  32. package/dist/data-app-builder/index.js +2 -2
  33. package/dist/data-app-codegen/index.cjs +1 -1
  34. package/dist/data-app-codegen/index.js +2 -2
  35. package/dist/data-app-codegen-node/index.cjs +154 -125
  36. package/dist/data-app-codegen-node/index.js +691 -609
  37. package/dist/data-app-sdk/index.cjs +2 -2
  38. package/dist/data-app-sdk/index.js +171 -157
  39. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  40. package/dist/data-app-sdk-adapters/index.js +26 -27
  41. package/dist/data-app-sdk-validation/index.cjs +1 -1
  42. package/dist/data-app-sdk-validation/index.js +17 -18
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.js +7 -7
  45. package/dist/surfboard/index.cjs +1 -1
  46. package/dist/surfboard/index.js +2 -2
  47. package/dist/types/analytics-protocol.d.ts +6 -1
  48. package/dist/types/dashboard-assistant.d.ts +1 -0
  49. package/dist/types/data-app-codegen-node.d.ts +5 -3
  50. package/dist/types/data-app-codegen.d.ts +5 -3
  51. package/dist/types/data-app-sdk-validation.d.ts +1 -0
  52. package/dist/types/data-app-sdk.d.ts +6 -0
  53. package/package.json +1 -1
  54. package/dist/chunks/analyze-result-contract-8nxUOWp8.js +0 -1
  55. package/dist/chunks/analyze-result-contract-DPjm6btg.js +0 -1869
  56. package/dist/chunks/source-identity-BM2FvJDP.js +0 -1
  57. package/dist/chunks/source-identity-Cv4Nm3TM.js +0 -75
  58. package/dist/chunks/update-policy-CWg9c08k.js +0 -3
  59. package/dist/chunks/validators-JzI7olk4.js +0 -1
@@ -1,44 +1,44 @@
1
- import { S as W, a as Q, v as X } from "./analyze-result-contract-DPjm6btg.js";
2
- import { toSemaphorInputOptionsIntent as Z, toSemaphorAnalysisQueryOptions as ee, toSemaphorAnalysisIntent as te, toSemaphorMetricIntent as re, toSemaphorRecordsIntent as ne, toSemaphorMatrixIntent as ae, toSemaphorSqlIntent as se } from "../data-app-sdk-adapters/index.js";
3
- const Le = W, j = Q, x = "semaphor-generated-data-app-contract/v1", M = "semaphor-generated-data-app-contract-manifest/v1";
4
- function P(e) {
5
- return _(e) ? [
6
- ...X(e).issues,
7
- ...ie(e)
1
+ import { S as Q, a as X, v as Z } from "./analyze-result-contract-Akysi2ML.js";
2
+ import { toSemaphorInputOptionsIntent as ee, toSemaphorAnalysisQueryOptions as te, toSemaphorAnalysisIntent as re, toSemaphorMetricIntent as ne, toSemaphorRecordsIntent as ae, toSemaphorMatrixIntent as se, toSemaphorSqlIntent as ie } from "../data-app-sdk-adapters/index.js";
3
+ const Ue = Q, j = X, x = "semaphor-generated-data-app-contract/v1", M = "semaphor-generated-data-app-contract-manifest/v1";
4
+ function L(e) {
5
+ return w(e) ? [
6
+ ...Z(e).issues,
7
+ ...oe(e)
8
8
  ] : ["Plan artifact must be a Semaphor codegenSummary object."];
9
9
  }
10
10
  function ze(e) {
11
- const t = P(e);
11
+ const t = L(e);
12
12
  if (t.length > 0)
13
13
  throw new Error(`Invalid Semaphor codegenSummary:
14
14
  - ${t.join(`
15
15
  - `)}`);
16
16
  }
17
- function ie(e) {
17
+ function oe(e) {
18
18
  var r;
19
- const t = _(e);
19
+ const t = w(e);
20
20
  if (!t)
21
21
  return [];
22
22
  const n = [];
23
- return ((r = _(t.validation)) == null ? void 0 : r.status) === "blocked" && n.push(
23
+ return ((r = w(t.validation)) == null ? void 0 : r.status) === "blocked" && n.push(
24
24
  "validation.status blocked cannot be generated. Resolve blocked semantic model gaps and replan before generating contract files."
25
- ), Array.isArray(t.unsupportedInsights) && t.unsupportedInsights.forEach((a, i) => {
26
- var s;
27
- ((s = _(a)) == null ? void 0 : s.reason) === "missing_relationship" && n.push(
28
- `unsupportedInsights.${i}.reason missing_relationship blocks contract generation. Call semaphor_propose_semantic_model_change, apply an approved semantic model patch, and replan before generating contract files.`
25
+ ), Array.isArray(t.unsupportedInsights) && t.unsupportedInsights.forEach((s, o) => {
26
+ var a;
27
+ ((a = w(s)) == null ? void 0 : a.reason) === "missing_relationship" && n.push(
28
+ `unsupportedInsights.${o}.reason missing_relationship blocks contract generation. Call semaphor_propose_semantic_model_change, apply an approved semantic model patch, and replan before generating contract files.`
29
29
  );
30
- }), Array.isArray(t.views) && t.views.forEach((a, i) => {
31
- var o;
32
- const s = _((o = _(a)) == null ? void 0 : o.computation);
33
- (s == null ? void 0 : s.kind) === "unsupported" && s.reason === "missing_relationship" && n.push(
34
- `views.${i}.computation.reason missing_relationship blocks contract generation. Call semaphor_propose_semantic_model_change, apply an approved semantic model patch, and replan before generating contract files.`
30
+ }), Array.isArray(t.views) && t.views.forEach((s, o) => {
31
+ var i;
32
+ const a = w((i = w(s)) == null ? void 0 : i.computation);
33
+ (a == null ? void 0 : a.kind) === "unsupported" && a.reason === "missing_relationship" && n.push(
34
+ `views.${o}.computation.reason missing_relationship blocks contract generation. Call semaphor_propose_semantic_model_change, apply an approved semantic model patch, and replan before generating contract files.`
35
35
  );
36
36
  }), n;
37
37
  }
38
- function _(e) {
38
+ function w(e) {
39
39
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
40
40
  }
41
- const oe = [
41
+ const ce = [
42
42
  "sources.ts",
43
43
  "fields.ts",
44
44
  "inputs.ts",
@@ -47,15 +47,15 @@ const oe = [
47
47
  "accessors.ts",
48
48
  "metadata.ts",
49
49
  "index.ts"
50
- ], ce = [
51
- ...oe,
50
+ ], de = [
51
+ ...ce,
52
52
  "contract.manifest.json"
53
53
  ];
54
54
  async function Je({
55
55
  manifest: e,
56
56
  generatedFiles: t
57
57
  }) {
58
- const n = [], r = y(e);
58
+ const n = [], r = h(e);
59
59
  if (!r)
60
60
  return {
61
61
  issues: [
@@ -74,20 +74,20 @@ async function Je({
74
74
  message: `generatedContractSchemaVersion must be ${x}. Regenerate the contract with semaphor_generate_data_app_contract.`,
75
75
  repairHint: "Regenerate the contract with semaphor_generate_data_app_contract."
76
76
  });
77
- const a = y(r.generator);
78
- S(a == null ? void 0 : a.name) || n.push({
77
+ const s = h(r.generator);
78
+ S(s == null ? void 0 : s.name) || n.push({
79
79
  path: "generator.name",
80
80
  message: "generator.name is required.",
81
81
  repairHint: "Regenerate the generated contract so manifest generator metadata is written deterministically."
82
- }), S(a == null ? void 0 : a.version) || n.push({
82
+ }), S(s == null ? void 0 : s.version) || n.push({
83
83
  path: "generator.version",
84
84
  message: "generator.version is required.",
85
85
  repairHint: "Regenerate the generated contract so manifest generator metadata is written deterministically."
86
86
  });
87
- for (const s of P(r.codegenSummary))
87
+ for (const a of L(r.codegenSummary))
88
88
  n.push({
89
- path: `codegenSummary.${s}`,
90
- message: `codegenSummary.${s}`,
89
+ path: `codegenSummary.${a}`,
90
+ message: `codegenSummary.${a}`,
91
91
  repairHint: "Regenerate the generated contract from a valid Data App codegenSummary."
92
92
  });
93
93
  if (r.codegenSummaryValidatorVersion !== j && n.push({
@@ -100,27 +100,27 @@ async function Je({
100
100
  message: "codegenSummaryHash is required.",
101
101
  repairHint: "Regenerate the generated contract so manifest hashes are written deterministically."
102
102
  });
103
- else if (y(r.codegenSummary)) {
104
- const s = await pe(
103
+ else if (h(r.codegenSummary)) {
104
+ const a = await pe(
105
105
  r.codegenSummary
106
106
  );
107
- r.codegenSummaryHash !== s && n.push({
107
+ r.codegenSummaryHash !== a && n.push({
108
108
  path: "codegenSummaryHash",
109
109
  message: "codegenSummaryHash does not match codegenSummary. Regenerate the contract instead of editing the manifest.",
110
110
  repairHint: "Regenerate the generated contract instead of editing the manifest."
111
111
  });
112
112
  }
113
- n.push(...ue(r.codegenSummary));
114
- const i = t ? de(t) : [];
115
- if (n.push(...i), typeof r.generatedContentHash != "string")
113
+ n.push(...fe(r.codegenSummary));
114
+ const o = t ? ue(t) : [];
115
+ if (n.push(...o), typeof r.generatedContentHash != "string")
116
116
  n.push({
117
117
  path: "generatedContentHash",
118
118
  message: "generatedContentHash is required.",
119
119
  repairHint: "Regenerate the generated contract so manifest hashes are written deterministically."
120
120
  });
121
- else if (t && i.length === 0) {
122
- const s = await fe(t);
123
- r.generatedContentHash !== s && n.push({
121
+ else if (t && o.length === 0) {
122
+ const a = await ge(t);
123
+ r.generatedContentHash !== a && n.push({
124
124
  path: "generatedContentHash",
125
125
  message: "generatedContentHash does not match generated TypeScript files. Regenerate the contract instead of hand-editing generated files.",
126
126
  repairHint: "Regenerate the contract instead of hand-editing generated files."
@@ -128,90 +128,90 @@ async function Je({
128
128
  }
129
129
  return { issues: n };
130
130
  }
131
- function de(e) {
131
+ function ue(e) {
132
132
  var r;
133
- const t = [], n = new Set(ce);
134
- for (const a of Object.keys(e)) {
135
- if (a.includes("/") || a.includes("\\")) {
136
- const i = ((r = a.split("/").pop()) == null ? void 0 : r.split("\\").pop()) || a;
133
+ const t = [], n = new Set(de);
134
+ for (const s of Object.keys(e)) {
135
+ if (s.includes("/") || s.includes("\\")) {
136
+ const o = ((r = s.split("/").pop()) == null ? void 0 : r.split("\\").pop()) || s;
137
137
  t.push({
138
- path: `generatedFiles.${a}`,
139
- message: `generatedFiles keys must be generated filenames such as "${i}", not path-qualified keys such as "${a}".`,
138
+ path: `generatedFiles.${s}`,
139
+ message: `generatedFiles keys must be generated filenames such as "${o}", not path-qualified keys such as "${s}".`,
140
140
  repairHint: 'Pass generatedFiles keyed by filename, for example "queries.ts", not "src/semaphor/generated/queries.ts".'
141
141
  });
142
142
  continue;
143
143
  }
144
- n.has(a) || t.push({
145
- path: `generatedFiles.${a}`,
146
- message: `generatedFiles contains unknown generated contract file "${a}".`,
144
+ n.has(s) || t.push({
145
+ path: `generatedFiles.${s}`,
146
+ message: `generatedFiles contains unknown generated contract file "${s}".`,
147
147
  repairHint: "Pass only the generated files returned by semaphor_generate_data_app_contract, keyed by filename."
148
148
  });
149
149
  }
150
150
  return t;
151
151
  }
152
- function ue(e) {
153
- const t = y(e);
152
+ function fe(e) {
153
+ const t = h(e);
154
154
  if (!t)
155
155
  return [];
156
156
  const n = [], r = new Set(
157
- V(t.inputs).map((i) => {
158
- var s;
159
- return (s = y(i)) == null ? void 0 : s.id;
157
+ V(t.inputs).map((o) => {
158
+ var a;
159
+ return (a = h(o)) == null ? void 0 : a.id;
160
160
  }).filter(S)
161
- ), a = new Set(
162
- V(t.views).map((i) => {
163
- var s;
164
- return (s = y(i)) == null ? void 0 : s.id;
161
+ ), s = new Set(
162
+ V(t.views).map((o) => {
163
+ var a;
164
+ return (a = h(o)) == null ? void 0 : a.id;
165
165
  }).filter(S)
166
166
  );
167
- return V(t.filterContracts).forEach((i, s) => {
168
- const o = y(i), c = o == null ? void 0 : o.inputId;
167
+ return V(t.filterContracts).forEach((o, a) => {
168
+ const i = h(o), c = i == null ? void 0 : i.inputId;
169
169
  (!S(c) || !r.has(c)) && n.push({
170
- path: `codegenSummary.filterContracts.${s}.inputId`,
171
- message: `codegenSummary.filterContracts.${s}.inputId must reference a generated input.`,
170
+ path: `codegenSummary.filterContracts.${a}.inputId`,
171
+ message: `codegenSummary.filterContracts.${a}.inputId must reference a generated input.`,
172
172
  repairHint: "Regenerate the generated contract from a valid planner output."
173
- }), Array.isArray(o == null ? void 0 : o.bindings) && o.bindings.forEach((u, f) => {
174
- const p = y(u), m = p == null ? void 0 : p.viewId;
175
- (!S(m) || !a.has(m)) && n.push({
176
- path: `codegenSummary.filterContracts.${s}.bindings.${f}.viewId`,
177
- message: `codegenSummary.filterContracts.${s}.bindings.${f}.viewId must reference a generated view.`,
173
+ }), Array.isArray(i == null ? void 0 : i.bindings) && i.bindings.forEach((u, f) => {
174
+ const g = h(u), m = g == null ? void 0 : g.viewId;
175
+ (!S(m) || !s.has(m)) && n.push({
176
+ path: `codegenSummary.filterContracts.${a}.bindings.${f}.viewId`,
177
+ message: `codegenSummary.filterContracts.${a}.bindings.${f}.viewId must reference a generated view.`,
178
178
  repairHint: "Regenerate the generated contract from a valid planner output."
179
179
  });
180
- const h = y(p == null ? void 0 : p.fieldRef);
181
- S(h == null ? void 0 : h.name) || n.push({
182
- path: `codegenSummary.filterContracts.${s}.bindings.${f}.fieldRef`,
183
- message: `codegenSummary.filterContracts.${s}.bindings.${f}.fieldRef is required.`,
180
+ const y = h(g == null ? void 0 : g.fieldRef);
181
+ S(y == null ? void 0 : y.name) || n.push({
182
+ path: `codegenSummary.filterContracts.${a}.bindings.${f}.fieldRef`,
183
+ message: `codegenSummary.filterContracts.${a}.bindings.${f}.fieldRef is required.`,
184
184
  repairHint: "Regenerate the generated contract from a valid planner output."
185
185
  });
186
186
  });
187
187
  }), n;
188
188
  }
189
- async function fe(e) {
189
+ async function ge(e) {
190
190
  const t = Object.keys(e).filter((r) => r.endsWith(".ts")).sort();
191
191
  let n = "";
192
192
  for (const r of t)
193
193
  n += `${r}\0${e[r]}\0`;
194
- return `sha256:${await L(n)}`;
194
+ return `sha256:${await U(n)}`;
195
195
  }
196
196
  async function pe(e) {
197
- return `sha256:${await L(N(e))}`;
197
+ return `sha256:${await U(k(e))}`;
198
198
  }
199
- function N(e) {
199
+ function k(e) {
200
200
  if (e === null || typeof e != "object")
201
201
  return JSON.stringify(e);
202
202
  if (Array.isArray(e))
203
- return `[${e.map((r) => N(r)).join(",")}]`;
203
+ return `[${e.map((r) => k(r)).join(",")}]`;
204
204
  const t = e;
205
- return `{${Object.keys(t).sort().filter((r) => t[r] !== void 0).map((r) => `${JSON.stringify(r)}:${N(t[r])}`).join(",")}}`;
205
+ return `{${Object.keys(t).sort().filter((r) => t[r] !== void 0).map((r) => `${JSON.stringify(r)}:${k(t[r])}`).join(",")}}`;
206
206
  }
207
- async function L(e) {
207
+ async function U(e) {
208
208
  var r;
209
209
  if (!((r = globalThis.crypto) != null && r.subtle))
210
210
  throw new Error("SHA-256 digest support is required for generated contract validation.");
211
211
  const t = new TextEncoder().encode(e), n = await globalThis.crypto.subtle.digest("SHA-256", t);
212
- return Array.from(new Uint8Array(n)).map((a) => a.toString(16).padStart(2, "0")).join("");
212
+ return Array.from(new Uint8Array(n)).map((s) => s.toString(16).padStart(2, "0")).join("");
213
213
  }
214
- function y(e) {
214
+ function h(e) {
215
215
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
216
216
  }
217
217
  function V(e) {
@@ -220,71 +220,71 @@ function V(e) {
220
220
  function S(e) {
221
221
  return typeof e == "string" && e.length > 0;
222
222
  }
223
- function Ue(e) {
224
- const t = d(e), n = b(t), r = [], a = [];
225
- return R(t == null ? void 0 : t.views).filter((i) => {
226
- var o;
227
- const s = d((o = d(i)) == null ? void 0 : o.sdkSpec);
228
- return !!(s != null && s.builder && (s != null && s.spec));
229
- }).forEach((i, s) => {
223
+ function Ye(e) {
224
+ const t = d(e), n = E(t), r = [], s = [];
225
+ return $(t == null ? void 0 : t.views).filter((o) => {
226
+ var i;
227
+ const a = d((i = d(o)) == null ? void 0 : i.sdkSpec);
228
+ return !!(a != null && a.builder && (a != null && a.spec));
229
+ }).forEach((o, a) => {
230
230
  var u;
231
- const o = String(((u = d(i)) == null ? void 0 : u.id) || `view_${s}`), c = ge(
232
- i,
231
+ const i = String(((u = d(o)) == null ? void 0 : u.id) || `view_${a}`), c = le(
232
+ o,
233
233
  n
234
234
  );
235
235
  if (c) {
236
- r.push({ viewId: o, ...c });
236
+ r.push({ viewId: i, ...c });
237
237
  return;
238
238
  }
239
- a.push({
240
- viewId: o,
241
- path: `views.${o}.sdkSpec`,
242
- message: `Generated view execution validation could not build intent for "${o}".`
239
+ s.push({
240
+ viewId: i,
241
+ path: `views.${i}.sdkSpec`,
242
+ message: `Generated view execution validation could not build intent for "${i}".`
243
243
  });
244
- }), { requests: r, issues: a };
244
+ }), { requests: r, issues: s };
245
245
  }
246
- function ge(e, t) {
247
- const n = d(e), r = d(n == null ? void 0 : n.sdkSpec), a = d(r == null ? void 0 : r.spec);
248
- if (!n || !(r != null && r.builder) || !a)
246
+ function le(e, t) {
247
+ const n = d(e), r = d(n == null ? void 0 : n.sdkSpec), s = d(r == null ? void 0 : r.spec);
248
+ if (!n || !(r != null && r.builder) || !s)
249
249
  return null;
250
- const i = le(t) ? t : b(d(t)), s = Oe(r.builder), o = d(A(a, i)) || {}, c = he({
250
+ const o = me(t) ? t : E(d(t)), a = Ne(r.builder), i = d(A(s, o)) || {}, c = he({
251
251
  view: n,
252
- builder: s,
253
- rawSpec: a,
252
+ builder: a,
253
+ rawSpec: s,
254
254
  spec: {
255
- ...o,
255
+ ...i,
256
256
  id: n.id,
257
- label: Ee(n, a)
257
+ label: Ve(n, s)
258
258
  },
259
- context: i
259
+ context: o
260
260
  });
261
261
  try {
262
- if (s === "analysis") {
262
+ if (a === "analysis") {
263
263
  const u = c;
264
264
  return {
265
- intent: te(u),
265
+ intent: re(u),
266
266
  resultShape: "analysis",
267
- analysisOptions: ee(u)
267
+ analysisOptions: te(u)
268
268
  };
269
269
  }
270
- if (s === "metric")
270
+ if (a === "metric")
271
271
  return {
272
- intent: re(c),
272
+ intent: ne(c),
273
273
  resultShape: "metric"
274
274
  };
275
- if (s === "records")
275
+ if (a === "records")
276
276
  return {
277
- intent: ne(c),
277
+ intent: ae(c),
278
278
  resultShape: "records"
279
279
  };
280
- if (s === "matrix")
280
+ if (a === "matrix")
281
281
  return {
282
- intent: ae(c),
282
+ intent: se(c),
283
283
  resultShape: "matrix"
284
284
  };
285
- if (s === "sql")
285
+ if (a === "sql")
286
286
  return {
287
- intent: se(c),
287
+ intent: ie(c),
288
288
  resultShape: "sql"
289
289
  };
290
290
  } catch {
@@ -292,73 +292,73 @@ function ge(e, t) {
292
292
  }
293
293
  return null;
294
294
  }
295
- function Ye({
295
+ function We({
296
296
  input: e,
297
297
  filterContract: t,
298
298
  codegenSummary: n
299
299
  }) {
300
- const r = d(e), a = d(t), i = d(r == null ? void 0 : r.optionQuery) || d(a == null ? void 0 : a.optionQuery);
301
- if (!r || !i)
300
+ const r = d(e), s = d(t), o = d(r == null ? void 0 : r.optionQuery) || d(s == null ? void 0 : s.optionQuery);
301
+ if (!r || !o)
302
302
  return null;
303
- const s = b(d(n)), o = d(i.spec), c = me(i, o, s), u = i.valueFieldRef || i.valueField || (o == null ? void 0 : o.valueField), f = i.labelFieldRef || i.labelField || (o == null ? void 0 : o.labelField);
303
+ const a = E(d(n)), i = d(o.spec), c = ye(o, i, a), u = o.valueFieldRef || o.valueField || (i == null ? void 0 : i.valueField), f = o.labelFieldRef || o.labelField || (i == null ? void 0 : i.labelField);
304
304
  if (!c || !u || !f)
305
305
  return null;
306
306
  const m = {
307
307
  ...d(
308
- A(o || {}, s)
308
+ A(i || {}, a)
309
309
  ) || {},
310
- id: i.id || (o == null ? void 0 : o.id) || `${r.id}-options`,
310
+ id: o.id || (i == null ? void 0 : i.id) || `${r.id}-options`,
311
311
  inputId: r.id,
312
312
  source: c,
313
313
  valueField: u,
314
314
  labelField: f,
315
- population: i.population || (o == null ? void 0 : o.population),
316
- dependencies: i.dependencies || (o == null ? void 0 : o.dependencies),
317
- limit: i.limit || (o == null ? void 0 : o.limit) || 100
315
+ population: o.population || (i == null ? void 0 : i.population),
316
+ dependencies: o.dependencies || (i == null ? void 0 : i.dependencies),
317
+ limit: o.limit || (i == null ? void 0 : i.limit) || 100
318
318
  };
319
319
  try {
320
- return Z(
321
- A(m, s)
320
+ return ee(
321
+ A(m, a)
322
322
  );
323
323
  } catch {
324
324
  return null;
325
325
  }
326
326
  }
327
- function We({
327
+ function Qe({
328
328
  input: e,
329
329
  filterContract: t,
330
330
  binding: n,
331
331
  option: r,
332
- codegenSummary: a
332
+ codegenSummary: s
333
333
  }) {
334
- const i = b(d(a)), s = d(e), o = d(t), c = d(n), u = A(
335
- (c == null ? void 0 : c.fieldRef) || (o == null ? void 0 : o.fieldRef) || (s == null ? void 0 : s.fieldRef),
336
- i
334
+ const o = E(d(s)), a = d(e), i = d(t), c = d(n), u = A(
335
+ (c == null ? void 0 : c.fieldRef) || (i == null ? void 0 : i.fieldRef) || (a == null ? void 0 : a.fieldRef),
336
+ o
337
337
  ), f = String(
338
- (o == null ? void 0 : o.operator) || (s == null ? void 0 : s.operator) || "in"
339
- ), p = Ne(c);
338
+ (i == null ? void 0 : i.operator) || (a == null ? void 0 : a.operator) || "in"
339
+ ), g = He(c);
340
340
  return {
341
- inputId: String((o == null ? void 0 : o.inputId) || (s == null ? void 0 : s.id) || ""),
341
+ inputId: String((i == null ? void 0 : i.inputId) || (a == null ? void 0 : a.id) || ""),
342
342
  kind: "filter",
343
343
  operator: f,
344
- value: He(f, r.value),
344
+ value: ke(f, r.value),
345
345
  isActive: !0,
346
346
  ...u ? { field: u } : {},
347
- ...p ? { relationshipHint: p } : {}
347
+ ...g ? { relationshipHint: g } : {}
348
348
  };
349
349
  }
350
- function b(e) {
350
+ function E(e) {
351
351
  return {
352
352
  sourcesByKey: new Map(
353
- R(e == null ? void 0 : e.sources).map(d).filter(je).filter((t) => typeof t.sourceKey == "string").map((t) => [String(t.sourceKey), J(t)])
353
+ $(e == null ? void 0 : e.sources).map(d).filter(xe).filter((t) => typeof t.sourceKey == "string").map((t) => [String(t.sourceKey), J(t)])
354
354
  )
355
355
  };
356
356
  }
357
- function le(e) {
357
+ function me(e) {
358
358
  var t;
359
359
  return e instanceof Object && ((t = d(e)) == null ? void 0 : t.sourcesByKey) instanceof Map;
360
360
  }
361
- function me(e, t, n) {
361
+ function ye(e, t, n) {
362
362
  if (typeof e.sourceKey == "string")
363
363
  return n.sourcesByKey.get(e.sourceKey) || { sourceKey: e.sourceKey };
364
364
  if (e.source)
@@ -373,104 +373,104 @@ function he({
373
373
  builder: t,
374
374
  rawSpec: n,
375
375
  spec: r,
376
- context: a
376
+ context: s
377
377
  }) {
378
- var o;
378
+ var i;
379
379
  if (t !== "records" && t !== "sql")
380
380
  return r;
381
- const i = d((o = d(e.visualSpec)) == null ? void 0 : o.tableBehavior);
382
- if (!i)
381
+ const o = d((i = d(e.visualSpec)) == null ? void 0 : i.tableBehavior);
382
+ if (!o)
383
383
  return r;
384
- const s = { ...r };
385
- if (Ce(i) === "server" && (s.pagination = {
384
+ const a = { ...r };
385
+ if (Ee(o) === "server" && (a.pagination = {
386
386
  page: 1,
387
- pageSize: ye({ tableBehavior: i, spec: r })
388
- }), t === "records" && Ve(i) === "server") {
389
- const c = Se({
387
+ pageSize: Se({ tableBehavior: o, spec: r })
388
+ }), t === "records" && Ce(o) === "server") {
389
+ const c = _e({
390
390
  view: e,
391
391
  rawSpec: n,
392
- tableBehavior: i,
393
- context: a
392
+ tableBehavior: o,
393
+ context: s
394
394
  });
395
- c && (s.orderBy = c);
395
+ c && (a.orderBy = c);
396
396
  }
397
- return s;
397
+ return a;
398
398
  }
399
- function ye({
399
+ function Se({
400
400
  tableBehavior: e,
401
401
  spec: t
402
402
  }) {
403
403
  const n = d(e.pagination), r = d(t.pagination);
404
- return E(n == null ? void 0 : n.pageSize) || E(r == null ? void 0 : r.pageSize) || E(t.limit) || 100;
404
+ return N(n == null ? void 0 : n.pageSize) || N(r == null ? void 0 : r.pageSize) || N(t.limit) || 100;
405
405
  }
406
- function Se({
406
+ function _e({
407
407
  view: e,
408
408
  rawSpec: t,
409
409
  tableBehavior: n,
410
410
  context: r
411
411
  }) {
412
- const a = d(n.sorting), i = g(a == null ? void 0 : a.defaultField);
413
- if (!i)
412
+ const s = d(n.sorting), o = p(s == null ? void 0 : s.defaultField);
413
+ if (!o)
414
414
  return;
415
- const o = we({
415
+ const i = Ae({
416
416
  view: e,
417
417
  rawSpec: t,
418
418
  context: r
419
419
  }).filter(
420
- (c) => Ae(c.lookup).includes(i)
420
+ (c) => we(c.lookup).includes(o)
421
421
  );
422
- if (o.length === 1)
422
+ if (i.length === 1)
423
423
  return {
424
- field: o[0].field,
425
- direction: (a == null ? void 0 : a.defaultDirection) === "desc" ? "desc" : "asc"
424
+ field: i[0].field,
425
+ direction: (s == null ? void 0 : s.defaultDirection) === "desc" ? "desc" : "asc"
426
426
  };
427
427
  }
428
- function we({
428
+ function Ae({
429
429
  view: e,
430
430
  rawSpec: t,
431
431
  context: n
432
432
  }) {
433
- var a;
433
+ var s;
434
434
  const r = [];
435
- for (const i of R(t.fields)) I(r, i, n);
436
- I(r, t.dateField, n), I(r, (a = d(t.orderBy)) == null ? void 0 : a.field, n);
437
- for (const i of R(e.fields))
438
- I(r, i, n);
439
- return ke(
435
+ for (const o of $(t.fields)) R(r, o, n);
436
+ R(r, t.dateField, n), R(r, (s = d(t.orderBy)) == null ? void 0 : s.field, n);
437
+ for (const o of $(e.fields))
438
+ R(r, o, n);
439
+ return Fe(
440
440
  r,
441
- (i) => _e(i.lookup)
441
+ (o) => ve(o.lookup)
442
442
  );
443
443
  }
444
- function I(e, t, n) {
444
+ function R(e, t, n) {
445
445
  const r = d(t);
446
446
  if (typeof (r == null ? void 0 : r.name) != "string" || r.name.length === 0)
447
447
  return;
448
- const a = d(A(r, n)) || r;
448
+ const s = d(A(r, n)) || r;
449
449
  e.push({
450
450
  lookup: r,
451
- field: a
451
+ field: s
452
452
  });
453
453
  }
454
- function Ae(e) {
455
- return Fe([
456
- g(e.name),
454
+ function we(e) {
455
+ return Ke([
456
+ p(e.name),
457
457
  z(e),
458
- Re(e)
458
+ Ie(e)
459
459
  ]);
460
460
  }
461
- function _e(e) {
461
+ function ve(e) {
462
462
  return [
463
463
  z(e),
464
- g(e.name),
465
- g(e.role),
466
- g(e.aggregate)
464
+ p(e.name),
465
+ p(e.role),
466
+ p(e.aggregate)
467
467
  ].join("|");
468
468
  }
469
469
  function z(e) {
470
470
  return [
471
- g(e.sourceKey) || $e(e.source),
472
- g(e.name),
473
- g(e.aggregate)
471
+ p(e.sourceKey) || $e(e.source),
472
+ p(e.name),
473
+ p(e.aggregate)
474
474
  ].filter(Boolean).join(":");
475
475
  }
476
476
  function $e(e) {
@@ -485,46 +485,46 @@ function $e(e) {
485
485
  }
486
486
  return JSON.stringify(t);
487
487
  }
488
- function Re(e) {
489
- return Ke([
490
- Ie(e),
491
- g(e.aggregate).toLowerCase(),
492
- g(e.label) || g(e.name)
488
+ function Ie(e) {
489
+ return je([
490
+ Re(e),
491
+ p(e.aggregate).toLowerCase(),
492
+ p(e.label) || p(e.name)
493
493
  ].filter(Boolean));
494
494
  }
495
- function Ie(e) {
496
- return typeof e.sourceKey == "string" ? be(e.sourceKey) : ve(e.source);
495
+ function Re(e) {
496
+ return typeof e.sourceKey == "string" ? Oe(e.sourceKey) : be(e.source);
497
497
  }
498
- function ve(e) {
498
+ function be(e) {
499
499
  const t = d(e);
500
- return t ? g(t.datasetName) || g(t.datasetId) || g(t.name) || g(t.kind) : "";
500
+ return t ? p(t.datasetName) || p(t.datasetId) || p(t.name) || p(t.kind) : "";
501
501
  }
502
- function be(e) {
502
+ function Oe(e) {
503
503
  const t = String(e).split(":");
504
504
  return t[t.length - 1] || String(e);
505
505
  }
506
- function Ce(e) {
506
+ function Ee(e) {
507
507
  var t;
508
- return g((t = d(e.pagination)) == null ? void 0 : t.mode);
508
+ return p((t = d(e.pagination)) == null ? void 0 : t.mode);
509
509
  }
510
- function Ve(e) {
510
+ function Ce(e) {
511
511
  var t;
512
- return g((t = d(e.sorting)) == null ? void 0 : t.mode);
512
+ return p((t = d(e.sorting)) == null ? void 0 : t.mode);
513
513
  }
514
514
  function A(e, t) {
515
515
  if (!e || typeof e != "object")
516
516
  return e;
517
517
  if (Array.isArray(e))
518
- return e.map((a) => A(a, t));
518
+ return e.map((s) => A(s, t));
519
519
  const n = e;
520
520
  if (typeof n.sourceKey == "string" && typeof n.kind == "string" && (typeof n.datasetName == "string" || typeof n.datasetId == "string"))
521
521
  return J(n);
522
522
  const r = {};
523
- for (const [a, i] of Object.entries(n))
524
- a !== "sourceKey" && (r[a] = A(i, t));
523
+ for (const [s, o] of Object.entries(n))
524
+ s !== "sourceKey" && (r[s] = A(o, t));
525
525
  if (typeof n.sourceKey == "string") {
526
- const a = t.sourcesByKey.get(n.sourceKey);
527
- a && !r.source && (r.source = a);
526
+ const s = t.sourcesByKey.get(n.sourceKey);
527
+ s && !r.source && (r.source = s);
528
528
  }
529
529
  return r;
530
530
  }
@@ -532,188 +532,221 @@ function J(e) {
532
532
  const { sourceKey: t, ...n } = e;
533
533
  return n;
534
534
  }
535
- function Ee(e, t) {
535
+ function Ve(e, t) {
536
536
  const n = d(e.visualSpec);
537
537
  return (n == null ? void 0 : n.title) || e.title || t.label;
538
538
  }
539
- function Oe(e) {
539
+ function Ne(e) {
540
540
  const t = String(e || "").replace(/^semaphor\./, "");
541
541
  return ["metric", "records", "analysis", "matrix", "sql"].includes(t) ? t : "";
542
542
  }
543
- function Ne(e) {
543
+ function He(e) {
544
544
  if (e != null && e.relationshipHint)
545
545
  return e.relationshipHint;
546
- const t = R(e == null ? void 0 : e.relationshipsUsed).map((n) => {
546
+ const t = $(e == null ? void 0 : e.relationshipsUsed).map((n) => {
547
547
  var r;
548
548
  return (r = d(n)) == null ? void 0 : r.id;
549
549
  }).filter((n) => typeof n == "string" && n.length > 0);
550
550
  return t.length > 0 ? { relationshipIds: t } : void 0;
551
551
  }
552
- function He(e, t) {
552
+ function ke(e, t) {
553
553
  return e === "in" || e === "not_in" ? [t] : e === "between" ? Array.isArray(t) ? t : [t, t] : t;
554
554
  }
555
- function E(e) {
555
+ function N(e) {
556
556
  return typeof e == "number" && Number.isFinite(e) ? e : void 0;
557
557
  }
558
- function g(e) {
558
+ function p(e) {
559
559
  return typeof e == "string" ? e : "";
560
560
  }
561
- function ke(e, t) {
561
+ function Fe(e, t) {
562
562
  const n = /* @__PURE__ */ new Set(), r = [];
563
- for (const a of e) {
564
- const i = t(a);
565
- !i || n.has(i) || (n.add(i), r.push(a));
563
+ for (const s of e) {
564
+ const o = t(s);
565
+ !o || n.has(o) || (n.add(o), r.push(s));
566
566
  }
567
567
  return r;
568
568
  }
569
- function Fe(e) {
569
+ function Ke(e) {
570
570
  return Array.from(new Set(e.filter(Boolean)));
571
571
  }
572
- function Ke(e) {
572
+ function je(e) {
573
573
  return (Array.isArray(e) ? e.join(" ") : e).replace(/[^a-zA-Z0-9]+/g, " ").trim().split(/\s+/).filter(Boolean).map((n, r) => {
574
- const a = n.toLowerCase();
575
- return r === 0 ? a : a.charAt(0).toUpperCase() + a.slice(1);
574
+ const s = n.toLowerCase();
575
+ return r === 0 ? s : s.charAt(0).toUpperCase() + s.slice(1);
576
576
  }).join("");
577
577
  }
578
578
  function d(e) {
579
579
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
580
580
  }
581
- function R(e) {
581
+ function $(e) {
582
582
  return Array.isArray(e) ? e : [];
583
583
  }
584
- function je(e) {
584
+ function xe(e) {
585
585
  return e !== void 0;
586
586
  }
587
- const xe = /* @__PURE__ */ new Set([
587
+ const Me = /* @__PURE__ */ new Set([
588
588
  "diagnostic_fix",
589
589
  "fix_diagnostics",
590
590
  "fix_inspector_warnings",
591
591
  "fix_runtime_warnings",
592
592
  "fix_warnings"
593
- ]), T = /* @__PURE__ */ new Set([
593
+ ]), De = /* @__PURE__ */ new Set([
594
+ "add",
595
+ "edit",
596
+ "mixed",
597
+ "remove"
598
+ ]), D = /* @__PURE__ */ new Set([
594
599
  "fields",
600
+ "metricBindingKeys",
595
601
  "sdkSpec"
596
602
  ]);
597
- function Qe({
603
+ function Xe({
598
604
  beforeSummary: e,
599
605
  afterSummary: t,
600
606
  migrationReport: n,
601
607
  operationIntent: r,
602
- preferences: a
608
+ constraints: s,
609
+ preferences: o
603
610
  }) {
604
- const i = l(r), s = typeof (i == null ? void 0 : i.kind) == "string" ? i.kind.trim() : "add";
605
- return Me(a) ? {
611
+ const a = l(r), i = typeof (a == null ? void 0 : a.kind) == "string" ? a.kind.trim() : "";
612
+ return De.has(i) ? {
613
+ ok: !1,
614
+ policy: {
615
+ kind: i,
616
+ mode: "invalid_operation_kind",
617
+ reason: "Retired Data App operation aliases are not accepted. Use the hard-migrated analytics/layout/style operationIntent kinds."
618
+ },
619
+ violations: [
620
+ {
621
+ path: "operationIntent.kind",
622
+ reason: "Use analytics_add, analytics_edit, analytics_remove, input_add, input_edit, layout_only, style_only, runtime_debug, semantic_model_repair, save_or_publish, or greenfield_create."
623
+ }
624
+ ]
625
+ } : T(o) ? {
606
626
  ok: !1,
607
627
  policy: {
608
- kind: s,
609
- mode: "invalid_update_preferences",
628
+ kind: i,
629
+ mode: "invalid_update_constraints",
610
630
  reason: "Metric aggregate override updates must use operationIntent.measureAggregateOverrides so deterministic update policy can guard the targeted edit."
611
631
  },
612
632
  violations: [
613
633
  {
614
634
  path: "preferences.measureAggregateOverrides",
635
+ reason: "preferences is retired. Move measureAggregateOverrides to operationIntent.measureAggregateOverrides for update calls."
636
+ }
637
+ ]
638
+ } : T(s) ? {
639
+ ok: !1,
640
+ policy: {
641
+ kind: i,
642
+ mode: "invalid_update_constraints",
643
+ reason: "Metric aggregate override updates must use operationIntent.measureAggregateOverrides so deterministic update policy can guard the targeted edit."
644
+ },
645
+ violations: [
646
+ {
647
+ path: "constraints.measureAggregateOverrides",
615
648
  reason: "Move measureAggregateOverrides to operationIntent.measureAggregateOverrides for update calls."
616
649
  }
617
650
  ]
618
- } : xe.has(s) ? D({
651
+ } : Me.has(i) ? B({
619
652
  beforeSummary: e,
620
653
  afterSummary: t,
621
654
  migrationReport: n,
622
- operationIntent: i,
655
+ operationIntent: a,
623
656
  mode: "diagnostic_warning_fix",
624
- allowedViewChangeReasons: T,
657
+ allowedViewChangeReasons: D,
625
658
  label: "Diagnostic warning fixes",
626
659
  reason: "Diagnostic warning fixes are preserve-by-default and may not add/remove views, inputs, or filter contracts."
627
- }) : s === "edit" && Array.isArray(i == null ? void 0 : i.measureAggregateOverrides) && i.measureAggregateOverrides.length > 0 ? D({
660
+ }) : i === "analytics_edit" && Array.isArray(a == null ? void 0 : a.measureAggregateOverrides) && a.measureAggregateOverrides.length > 0 ? B({
628
661
  beforeSummary: e,
629
662
  afterSummary: t,
630
663
  migrationReport: n,
631
- operationIntent: i,
664
+ operationIntent: a,
632
665
  mode: "metric_aggregate_override_edit",
633
- allowedViewChangeReasons: T,
666
+ allowedViewChangeReasons: D,
634
667
  label: "Metric aggregate override edits",
635
668
  reason: "Metric aggregate override edits are preserve-by-default and may only adjust fields/sdkSpec on targeted views."
636
669
  }) : {
637
670
  ok: !0,
638
671
  policy: {
639
- kind: s,
672
+ kind: i,
640
673
  mode: "general_iterative_update",
641
674
  reason: "General generated-contract edits are allowed to change the requested contract shape. Review the migration report for expected UI work."
642
675
  },
643
676
  violations: []
644
677
  };
645
678
  }
646
- function Me(e) {
679
+ function T(e) {
647
680
  var t;
648
681
  return Array.isArray((t = l(e)) == null ? void 0 : t.measureAggregateOverrides);
649
682
  }
650
- function D({
683
+ function B({
651
684
  beforeSummary: e,
652
685
  afterSummary: t,
653
686
  migrationReport: n,
654
687
  operationIntent: r,
655
- mode: a,
656
- allowedViewChangeReasons: i,
657
- label: s,
658
- reason: o
688
+ mode: s,
689
+ allowedViewChangeReasons: o,
690
+ label: a,
691
+ reason: i
659
692
  }) {
660
- const c = [], u = De(r == null ? void 0 : r.targetViewIds), f = l(n) || {};
693
+ const c = [], u = Be(r == null ? void 0 : r.targetViewIds), f = l(n) || {};
661
694
  u.size === 0 && c.push({
662
695
  path: "operationIntent.targetViewIds",
663
- reason: `${s} must declare targetViewIds so the update cannot broaden to unrelated views.`
664
- }), O({
696
+ reason: `${a} must declare targetViewIds so the update cannot broaden to unrelated views.`
697
+ }), H({
665
698
  bucket: l(f.views),
666
699
  label: "views",
667
- operationLabel: s,
700
+ operationLabel: a,
668
701
  violations: c
669
- }), O({
702
+ }), H({
670
703
  bucket: l(f.inputs),
671
704
  label: "inputs",
672
- operationLabel: s,
705
+ operationLabel: a,
673
706
  violations: c
674
707
  }), q({
675
708
  bucket: l(f.inputs),
676
709
  label: "inputs",
677
- operationLabel: s,
710
+ operationLabel: a,
678
711
  violations: c
679
- }), O({
712
+ }), H({
680
713
  bucket: l(f.filterContracts),
681
714
  label: "filterContracts",
682
- operationLabel: s,
715
+ operationLabel: a,
683
716
  violations: c
684
717
  }), q({
685
718
  bucket: l(f.filterContracts),
686
719
  label: "filterContracts",
687
- operationLabel: s,
720
+ operationLabel: a,
688
721
  violations: c
689
722
  });
690
- for (const m of U(l(f.views))) {
691
- u.size > 0 && !u.has(w(m.id)) && c.push({
692
- path: `views.${w(m.id) || "<unknown>"}`,
693
- reason: `${s} may only change explicitly targeted views.`
723
+ for (const m of Y(l(f.views))) {
724
+ u.size > 0 && !u.has(_(m.id)) && c.push({
725
+ path: `views.${_(m.id) || "<unknown>"}`,
726
+ reason: `${a} may only change explicitly targeted views.`
694
727
  });
695
- const h = Array.isArray(m.reasons) ? m.reasons.filter(
696
- ($) => typeof $ != "string" || !i.has($)
728
+ const y = Array.isArray(m.reasons) ? m.reasons.filter(
729
+ (v) => typeof v != "string" || !o.has(v)
697
730
  ) : [];
698
- h.length > 0 && c.push({
699
- path: `views.${w(m.id) || "<unknown>"}`,
700
- reason: `${s} may only adjust fields/sdkSpec; changed ${h.join(", ")}.`
731
+ y.length > 0 && c.push({
732
+ path: `views.${_(m.id) || "<unknown>"}`,
733
+ reason: `${a} may only adjust fields/sdkSpec/metricBindingKeys; changed ${y.join(", ")}.`
701
734
  });
702
735
  }
703
- const p = Te({
736
+ const g = Te({
704
737
  beforeSummary: e,
705
738
  afterSummary: t,
706
739
  targetViewIds: u,
707
- label: s
740
+ label: a
708
741
  });
709
- return p && c.push(p), {
742
+ return g && c.push(g), {
710
743
  ok: c.length === 0,
711
744
  policy: {
712
- kind: w(r == null ? void 0 : r.kind) || "diagnostic_fix",
713
- mode: a,
714
- allowedViewChangeReasons: Array.from(i).sort(),
745
+ kind: _(r == null ? void 0 : r.kind) || "diagnostic_fix",
746
+ mode: s,
747
+ allowedViewChangeReasons: Array.from(o).sort(),
715
748
  targetViewIds: Array.from(u).sort(),
716
- reason: o
749
+ reason: i
717
750
  },
718
751
  violations: c
719
752
  };
@@ -724,36 +757,36 @@ function Te({
724
757
  targetViewIds: n,
725
758
  label: r
726
759
  }) {
727
- const a = l(e), i = l(t);
728
- if (!a || !i)
760
+ const s = l(e), o = l(t);
761
+ if (!s || !o)
729
762
  return {
730
763
  path: "codegenSummary",
731
764
  reason: `${r} require before/after codegen summaries for full-scope verification.`
732
765
  };
733
- const s = G(a), o = G(i), c = B(a.views), u = B(i.views), f = Array.isArray(s.views) ? s.views : [];
734
- s.views = f;
735
- for (const p of n) {
736
- const m = c.get(p), h = u.get(p);
737
- if (!m || !h)
766
+ const a = G(s), i = G(o), c = P(s.views), u = P(o.views), f = Array.isArray(a.views) ? a.views : [];
767
+ a.views = f;
768
+ for (const g of n) {
769
+ const m = c.get(g), y = u.get(g);
770
+ if (!m || !y)
738
771
  continue;
739
- const $ = f.find(
740
- (Y) => {
772
+ const v = f.find(
773
+ (W) => {
741
774
  var K;
742
- return ((K = l(Y)) == null ? void 0 : K.id) === p;
775
+ return ((K = l(W)) == null ? void 0 : K.id) === g;
743
776
  }
744
- ), C = l(h);
745
- if (!$ || !C)
777
+ ), I = l(y);
778
+ if (!v || !I)
746
779
  continue;
747
- const F = $;
748
- F.fields = k(C.fields), F.sdkSpec = k(C.sdkSpec);
780
+ const C = v;
781
+ C.fields = b(I.fields), C.metricBindingKeys = b(I.metricBindingKeys), C.sdkSpec = b(I.sdkSpec);
749
782
  }
750
- return v(s) === v(o) ? null : {
783
+ return O(a) === O(i) ? null : {
751
784
  path: "codegenSummary",
752
- reason: `${r} may only change fields/sdkSpec on targetViewIds; another generated contract section changed.`
785
+ reason: `${r} may only change fields/sdkSpec/metricBindingKeys on targetViewIds; another generated contract section changed.`
753
786
  };
754
787
  }
755
788
  function G(e) {
756
- const t = k(e);
789
+ const t = b(e);
757
790
  for (const n of [
758
791
  "implementationChecklist",
759
792
  "assumptions",
@@ -764,20 +797,20 @@ function G(e) {
764
797
  delete t[n];
765
798
  return qe(t.unsupportedInsights) && delete t.unsupportedInsights, t;
766
799
  }
767
- function O({
800
+ function H({
768
801
  bucket: e,
769
802
  label: t,
770
803
  operationLabel: n,
771
804
  violations: r
772
805
  }) {
773
- for (const a of H(e == null ? void 0 : e.added))
806
+ for (const s of F(e == null ? void 0 : e.added))
774
807
  r.push({
775
- path: `${t}.${w(a.id) || "<unknown>"}`,
808
+ path: `${t}.${_(s.id) || "<unknown>"}`,
776
809
  reason: `${n} may not add ${t}.`
777
810
  });
778
- for (const a of H(e == null ? void 0 : e.removed))
811
+ for (const s of F(e == null ? void 0 : e.removed))
779
812
  r.push({
780
- path: `${t}.${w(a.id) || "<unknown>"}`,
813
+ path: `${t}.${_(s.id) || "<unknown>"}`,
781
814
  reason: `${n} may not remove ${t}.`
782
815
  });
783
816
  }
@@ -787,42 +820,42 @@ function q({
787
820
  operationLabel: n,
788
821
  violations: r
789
822
  }) {
790
- for (const a of U(e))
823
+ for (const s of Y(e))
791
824
  r.push({
792
- path: `${t}.${w(a.id) || "<unknown>"}`,
825
+ path: `${t}.${_(s.id) || "<unknown>"}`,
793
826
  reason: `${n} may not change ${t}.`
794
827
  });
795
828
  }
796
- function U(e) {
797
- return H(e == null ? void 0 : e.changed);
829
+ function Y(e) {
830
+ return F(e == null ? void 0 : e.changed);
798
831
  }
799
- function H(e) {
832
+ function F(e) {
800
833
  return Array.isArray(e) ? e.map(l).filter(Ge) : [];
801
834
  }
802
- function De(e) {
835
+ function Be(e) {
803
836
  return Array.isArray(e) ? new Set(
804
837
  e.filter((t) => typeof t == "string" && t.trim().length > 0).map((t) => t.trim())
805
838
  ) : /* @__PURE__ */ new Set();
806
839
  }
807
- function B(e) {
840
+ function P(e) {
808
841
  var n;
809
842
  const t = /* @__PURE__ */ new Map();
810
843
  for (const r of Array.isArray(e) ? e : []) {
811
- const a = (n = l(r)) == null ? void 0 : n.id;
812
- typeof a == "string" && a.trim() && t.set(a, r);
844
+ const s = (n = l(r)) == null ? void 0 : n.id;
845
+ typeof s == "string" && s.trim() && t.set(s, r);
813
846
  }
814
847
  return t;
815
848
  }
816
- function k(e) {
849
+ function b(e) {
817
850
  return e === void 0 ? e : JSON.parse(JSON.stringify(e));
818
851
  }
819
- function v(e) {
852
+ function O(e) {
820
853
  if (e === null || typeof e != "object")
821
854
  return JSON.stringify(e);
822
855
  if (Array.isArray(e))
823
- return `[${e.map((n) => v(n)).join(",")}]`;
856
+ return `[${e.map((n) => O(n)).join(",")}]`;
824
857
  const t = e;
825
- return `{${Object.keys(t).sort().filter((n) => t[n] !== void 0).map((n) => `${JSON.stringify(n)}:${v(t[n])}`).join(",")}}`;
858
+ return `{${Object.keys(t).sort().filter((n) => t[n] !== void 0).map((n) => `${JSON.stringify(n)}:${O(t[n])}`).join(",")}}`;
826
859
  }
827
860
  function l(e) {
828
861
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
@@ -833,22 +866,22 @@ function Ge(e) {
833
866
  function qe(e) {
834
867
  return Array.isArray(e) && e.length === 0;
835
868
  }
836
- function w(e) {
869
+ function _(e) {
837
870
  return typeof e == "string" ? e : "";
838
871
  }
839
872
  export {
840
- Le as C,
873
+ Ue as C,
841
874
  x as G,
842
- ce as R,
875
+ de as R,
843
876
  j as a,
844
877
  M as b,
845
878
  ze as c,
846
879
  Je as d,
847
- oe as e,
848
- We as f,
849
- Ye as g,
850
- ge as h,
851
- Ue as i,
852
- Qe as j,
853
- P as v
880
+ ce as e,
881
+ Qe as f,
882
+ We as g,
883
+ le as h,
884
+ Ye as i,
885
+ Xe as j,
886
+ L as v
854
887
  };