@flanksource/clicky-ui 0.3.81 → 0.3.82

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/dist/components/json-schema-form-connection.cjs +31 -2
  2. package/dist/components/json-schema-form-connection.cjs.map +1 -1
  3. package/dist/components/json-schema-form-connection.d.ts.map +1 -1
  4. package/dist/components/json-schema-form-connection.js +32 -3
  5. package/dist/components/json-schema-form-connection.js.map +1 -1
  6. package/dist/components/json-schema-form-date-math.cjs +48 -0
  7. package/dist/components/json-schema-form-date-math.cjs.map +1 -0
  8. package/dist/components/json-schema-form-date-math.d.ts +9 -0
  9. package/dist/components/json-schema-form-date-math.d.ts.map +1 -0
  10. package/dist/components/json-schema-form-date-math.js +48 -0
  11. package/dist/components/json-schema-form-date-math.js.map +1 -0
  12. package/dist/components/json-schema-form-fields.cjs +11 -2
  13. package/dist/components/json-schema-form-fields.cjs.map +1 -1
  14. package/dist/components/json-schema-form-fields.d.ts.map +1 -1
  15. package/dist/components/json-schema-form-fields.js +11 -2
  16. package/dist/components/json-schema-form-fields.js.map +1 -1
  17. package/dist/components/json-schema-form-render.cjs +1 -1
  18. package/dist/components/json-schema-form-render.cjs.map +1 -1
  19. package/dist/components/json-schema-form-render.d.ts.map +1 -1
  20. package/dist/components/json-schema-form-render.js +1 -1
  21. package/dist/components/json-schema-form-render.js.map +1 -1
  22. package/dist/components/json-schema-form-resolve.cjs +1 -1
  23. package/dist/components/json-schema-form-resolve.cjs.map +1 -1
  24. package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
  25. package/dist/components/json-schema-form-resolve.js +1 -1
  26. package/dist/components/json-schema-form-resolve.js.map +1 -1
  27. package/dist/components/json-schema-form-types.d.ts +1 -1
  28. package/dist/components/json-schema-form-types.d.ts.map +1 -1
  29. package/dist/data/data-table-filter-values.cjs +28 -7
  30. package/dist/data/data-table-filter-values.cjs.map +1 -1
  31. package/dist/data/data-table-filter-values.d.ts.map +1 -1
  32. package/dist/data/data-table-filter-values.js +29 -8
  33. package/dist/data/data-table-filter-values.js.map +1 -1
  34. package/dist/data/traces/otel/OtelTraceDetail.cjs +1 -6
  35. package/dist/data/traces/otel/OtelTraceDetail.cjs.map +1 -1
  36. package/dist/data/traces/otel/OtelTraceDetail.js +1 -6
  37. package/dist/data/traces/otel/OtelTraceDetail.js.map +1 -1
  38. package/dist/data/traces/otel/OtelTraceTable.cjs +5 -2
  39. package/dist/data/traces/otel/OtelTraceTable.cjs.map +1 -1
  40. package/dist/data/traces/otel/OtelTraceTable.d.ts.map +1 -1
  41. package/dist/data/traces/otel/OtelTraceTable.js +5 -2
  42. package/dist/data/traces/otel/OtelTraceTable.js.map +1 -1
  43. package/dist/data/version-info.cjs +3 -3
  44. package/dist/data/version-info.js +3 -3
  45. package/dist/devtools/ExecutionDetail.cjs +5 -2
  46. package/dist/devtools/ExecutionDetail.cjs.map +1 -1
  47. package/dist/devtools/ExecutionDetail.js +5 -2
  48. package/dist/devtools/ExecutionDetail.js.map +1 -1
  49. package/dist/profiles/editor/profileEditor.cjs +1 -2
  50. package/dist/profiles/editor/profileEditor.cjs.map +1 -1
  51. package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
  52. package/dist/profiles/editor/profileEditor.js +2 -3
  53. package/dist/profiles/editor/profileEditor.js.map +1 -1
  54. package/dist/profiles/editor/profileMappingPreview.cjs +21 -5
  55. package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
  56. package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
  57. package/dist/profiles/editor/profileMappingPreview.js +22 -6
  58. package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
  59. package/dist/profiles/editor/spanColumns.cjs +0 -8
  60. package/dist/profiles/editor/spanColumns.cjs.map +1 -1
  61. package/dist/profiles/editor/spanColumns.d.ts +0 -1
  62. package/dist/profiles/editor/spanColumns.d.ts.map +1 -1
  63. package/dist/profiles/editor/spanColumns.js +1 -8
  64. package/dist/profiles/editor/spanColumns.js.map +1 -1
  65. package/dist/rpc/ExplorerNav.cjs +13 -0
  66. package/dist/rpc/ExplorerNav.cjs.map +1 -1
  67. package/dist/rpc/ExplorerNav.d.ts.map +1 -1
  68. package/dist/rpc/ExplorerNav.js +14 -1
  69. package/dist/rpc/ExplorerNav.js.map +1 -1
  70. package/dist/runtime/barrels.json +1567 -1567
  71. package/dist/runtime/importmap.json +2170 -2169
  72. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ExecutionDetail.js","names":[],"sources":["../../src/devtools/ExecutionDetail.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { CodeBlock } from \"../data/CodeBlock\";\nimport { JsonView } from \"../data/JsonView\";\nimport type { QueryBrowserDiagnostics } from \"../data/query-browser/QueryBrowser.types\";\nimport { DebugClient, DetailEvictedError } from \"./debugClient\";\nimport type { ExecutionDetail as ExecutionDetailPayload, ExecutionSummary } from \"./types\";\n\n/**\n * The pane behind one row: what the execution actually sent, what came back,\n * and the lines it wrote on the way.\n *\n * Everything here is fetched by record id — it is the run that already\n * happened, not a re-run of it. That is the whole point of the console: the old\n * \"Debug\" dialog answered \"what does this URL run\" by running it a second time,\n * so what you inspected was never the execution that misbehaved.\n */\n\nexport type ExecutionDetailProps = {\n record: ExecutionSummary;\n client?: DebugClient | undefined;\n /** Pre-loaded detail, for a story or a test that has no server. */\n detail?: ExecutionDetailPayload | undefined;\n};\n\nexport function ExecutionDetail({ record, client, detail: provided }: ExecutionDetailProps) {\n const { detail, error, loading } = useExecutionDetail(record.id, client, provided);\n\n if (provided === undefined && loading) {\n return <div className=\"p-density-4 text-muted-foreground text-sm\">Loading capture…</div>;\n }\n if (error) {\n return (\n <div className=\"p-density-4 text-sm\">\n <p className=\"text-destructive\">{error}</p>\n <RerunHint record={record} />\n </div>\n );\n }\n if (!detail) return null;\n\n const operations = detail.operations ?? [];\n return (\n <div className=\"flex flex-col gap-density-4 p-density-4\">\n {record.error ? (\n <section>\n <SectionLabel>Error</SectionLabel>\n <p className=\"whitespace-pre-wrap font-mono text-destructive text-xs\">{record.error}</p>\n </section>\n ) : null}\n\n {operations.length === 0 ? (\n <p className=\"text-muted-foreground text-sm\">\n This request reached no provider — nothing ran that could be explained.\n </p>\n ) : (\n operations.map((diagnostics, index) => (\n <OperationDetail\n key={`${diagnostics.provider}-${index}`}\n index={index + 1}\n total={operations.length}\n diagnostics={diagnostics}\n />\n ))\n )}\n\n {detail.logs && detail.logs.length > 0 ? (\n <section>\n <SectionLabel>Log lines ({detail.logs.length})</SectionLabel>\n <div className=\"max-h-64 overflow-auto rounded border border-border bg-muted/30 p-density-2 font-mono text-xs\">\n {detail.logs.map((line) => (\n <div key={`${line.source}-${line.sequence}`} className=\"whitespace-pre-wrap\">\n <span className=\"text-muted-foreground\">{line.level}</span> {line.message}\n </div>\n ))}\n </div>\n </section>\n ) : null}\n\n <RerunHint record={record} />\n </div>\n );\n}\n\nfunction OperationDetail({\n index,\n total,\n diagnostics,\n}: {\n index: number;\n total: number;\n diagnostics: QueryBrowserDiagnostics;\n}) {\n const request = diagnostics.request ?? {};\n const response = diagnostics.response ?? {};\n return (\n <section className=\"flex flex-col gap-density-3\">\n <SectionLabel>\n {total > 1 ? `Operation ${index} of ${total} — ` : \"\"}\n {diagnostics.provider}\n {request.connection ? ` · ${request.connection}` : \"\"}\n </SectionLabel>\n\n {request.query ? <CodeBlock source={request.query} language=\"sql\" /> : null}\n {/* Shown only when it differs: for most providers the two are equal, and a\n second identical block reads as a second query. */}\n {request.rendered && request.rendered !== request.query ? (\n <div>\n <SectionLabel>Rendered from the profile</SectionLabel>\n <CodeBlock source={request.rendered} language=\"sql\" />\n </div>\n ) : null}\n\n {request.arguments && request.arguments.length > 0 ? (\n <div>\n <SectionLabel>Bound arguments</SectionLabel>\n <JsonView data={request.arguments} />\n </div>\n ) : null}\n\n {request.method || request.url ? (\n <p className=\"font-mono text-xs\">\n {request.method} {request.url}\n {typeof response.status === \"number\" ? ` → ${response.status}` : \"\"}\n </p>\n ) : null}\n\n {request.options && Object.keys(request.options).length > 0 ? (\n <div>\n <SectionLabel>Options</SectionLabel>\n <JsonView data={request.options} />\n </div>\n ) : null}\n\n {response.preview ? (\n <div>\n <SectionLabel>\n Response preview\n {response.truncated ? \" (truncated)\" : \"\"}\n </SectionLabel>\n <CodeBlock source={response.preview} language=\"json\" />\n </div>\n ) : null}\n\n {diagnostics.error ? (\n <p className=\"whitespace-pre-wrap font-mono text-destructive text-xs\">{diagnostics.error}</p>\n ) : null}\n </section>\n );\n}\n\n/**\n * A run captured below the level needed for what you are looking for cannot be\n * enriched retroactively — the bodies were never buffered. Saying so, and\n * naming the level that would have them, is the honest answer.\n */\nfunction RerunHint({ record }: { record: ExecutionSummary }) {\n if (record.level === \"trace2\" || record.level === \"trace3\" || record.level === \"trace4\") return null;\n return (\n <p className=\"text-muted-foreground text-xs\">\n Captured at <span className=\"font-mono\">{record.level}</span>. Response bodies are only\n buffered at <span className=\"font-mono\">trace2</span> — raise the level and run it again to\n see them.\n </p>\n );\n}\n\nfunction SectionLabel({ children }: { children: React.ReactNode }) {\n return (\n <p className=\"mb-density-1 font-medium text-muted-foreground text-xs uppercase tracking-wide\">\n {children}\n </p>\n );\n}\n\nfunction useExecutionDetail(\n id: string,\n client: DebugClient | undefined,\n provided: ExecutionDetailPayload | undefined,\n) {\n const [detail, setDetail] = useState<ExecutionDetailPayload | undefined>(provided);\n const [error, setError] = useState<string | undefined>();\n const [loading, setLoading] = useState(provided === undefined);\n\n useEffect(() => {\n if (provided !== undefined) {\n setDetail(provided);\n setLoading(false);\n return;\n }\n let cancelled = false;\n setLoading(true);\n setError(undefined);\n (client ?? new DebugClient())\n .detail(id)\n .then((payload) => {\n if (!cancelled) setDetail(payload);\n })\n .catch((failure: unknown) => {\n if (cancelled) return;\n setError(\n failure instanceof DetailEvictedError\n ? `${failure.message}. The summary above is all that survives.`\n : failure instanceof Error\n ? failure.message\n : String(failure),\n );\n })\n .finally(() => {\n if (!cancel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O,EAAE,CAAC,CACV,MAAM,YAAY;GACjB,IAAI,CAAC,WAAW,UAAU,OAAO;EACnC,CAAC,CAAC,CACD,OAAO,YAAqB;GAC3B,IAAI,WAAW;GACf,SACE,mBAAmB,qBACf,GAAG,QAAQ,QAAQ,6CACnB,mBAAmB,QACjB,QAAQ,UACR,OAAO,OAAO,CACtB;EACF,CAAC,CAAC,CACD,cAAc;GACb,IAAI,CAAC,WAAW,WAAW,KAAK;EAClC,CAAC;EACH,aAAa;GACX,YAAY;EACd;CACF,GAAG;EAAC;EAAI;EAAQ;CAAQ,CAAC;CAEzB,OAAO;EAAE;EAAQ;EAAO;CAAQ;AAClC"}
1
+ {"version":3,"file":"ExecutionDetail.js","names":[],"sources":["../../src/devtools/ExecutionDetail.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { CodeBlock } from \"../data/CodeBlock\";\nimport { JsonView } from \"../data/JsonView\";\nimport type { QueryBrowserDiagnostics } from \"../data/query-browser/QueryBrowser.types\";\nimport { DebugClient, DetailEvictedError } from \"./debugClient\";\nimport type { ExecutionDetail as ExecutionDetailPayload, ExecutionSummary } from \"./types\";\n\n/**\n * The pane behind one row: what the execution actually sent, what came back,\n * and the lines it wrote on the way.\n *\n * Everything here is fetched by record id — it is the run that already\n * happened, not a re-run of it. That is the whole point of the console: the old\n * \"Debug\" dialog answered \"what does this URL run\" by running it a second time,\n * so what you inspected was never the execution that misbehaved.\n */\n\nexport type ExecutionDetailProps = {\n record: ExecutionSummary;\n client?: DebugClient | undefined;\n /** Pre-loaded detail, for a story or a test that has no server. */\n detail?: ExecutionDetailPayload | undefined;\n};\n\nexport function ExecutionDetail({ record, client, detail: provided }: ExecutionDetailProps) {\n const { detail, error, loading } = useExecutionDetail(record.id, client, provided);\n\n if (provided === undefined && loading) {\n return <div className=\"p-density-4 text-muted-foreground text-sm\">Loading capture…</div>;\n }\n if (error) {\n return (\n <div className=\"p-density-4 text-sm\">\n <p className=\"text-destructive\">{error}</p>\n <RerunHint record={record} />\n </div>\n );\n }\n if (!detail) return null;\n\n const operations = detail.operations ?? [];\n return (\n <div className=\"flex flex-col gap-density-4 p-density-4\">\n {record.error ? (\n <section>\n <SectionLabel>Error</SectionLabel>\n <p className=\"whitespace-pre-wrap font-mono text-destructive text-xs\">{record.error}</p>\n </section>\n ) : null}\n\n {operations.length === 0 ? (\n <p className=\"text-muted-foreground text-sm\">\n This request reached no provider — nothing ran that could be explained.\n </p>\n ) : (\n operations.map((diagnostics, index) => (\n <OperationDetail\n key={`${diagnostics.provider}-${index}`}\n index={index + 1}\n total={operations.length}\n diagnostics={diagnostics}\n />\n ))\n )}\n\n {detail.logs && detail.logs.length > 0 ? (\n <section>\n <SectionLabel>Log lines ({detail.logs.length})</SectionLabel>\n <div className=\"max-h-64 overflow-auto rounded border border-border bg-muted/30 p-density-2 font-mono text-xs\">\n {detail.logs.map((line) => (\n <div key={`${line.source}-${line.sequence}`} className=\"whitespace-pre-wrap\">\n <span className=\"text-muted-foreground\">{line.level}</span> {line.message}\n </div>\n ))}\n </div>\n </section>\n ) : null}\n\n <RerunHint record={record} />\n </div>\n );\n}\n\nfunction OperationDetail({\n index,\n total,\n diagnostics,\n}: {\n index: number;\n total: number;\n diagnostics: QueryBrowserDiagnostics;\n}) {\n const request = diagnostics.request ?? {};\n const response = diagnostics.response ?? {};\n return (\n <section className=\"flex flex-col gap-density-3\">\n <SectionLabel>\n {total > 1 ? `Operation ${index} of ${total} — ` : \"\"}\n {diagnostics.provider}\n {request.connection ? ` · ${request.connection}` : \"\"}\n </SectionLabel>\n\n {request.query ? <CodeBlock source={request.query} language={queryLanguage(request.query)} /> : null}\n {/* Shown only when it differs: for most providers the two are equal, and a\n second identical block reads as a second query. */}\n {request.rendered && request.rendered !== request.query ? (\n <div>\n <SectionLabel>Rendered from the profile</SectionLabel>\n <CodeBlock source={request.rendered} language={queryLanguage(request.rendered)} />\n </div>\n ) : null}\n\n {request.arguments && request.arguments.length > 0 ? (\n <div>\n <SectionLabel>Bound arguments</SectionLabel>\n <JsonView data={request.arguments} />\n </div>\n ) : null}\n\n {request.method || request.url ? (\n <p className=\"font-mono text-xs\">\n {request.method} {request.url}\n {typeof response.status === \"number\" ? ` → ${response.status}` : \"\"}\n </p>\n ) : null}\n\n {request.options && Object.keys(request.options).length > 0 ? (\n <div>\n <SectionLabel>Options</SectionLabel>\n <JsonView data={request.options} />\n </div>\n ) : null}\n\n {response.preview ? (\n <div>\n <SectionLabel>\n Response preview\n {response.truncated ? \" (truncated)\" : \"\"}\n </SectionLabel>\n <CodeBlock source={response.preview} language=\"json\" />\n </div>\n ) : null}\n\n {diagnostics.error ? (\n <p className=\"whitespace-pre-wrap font-mono text-destructive text-xs\">{diagnostics.error}</p>\n ) : null}\n </section>\n );\n}\n\n// Providers issue either SQL or a JSON request body (a search DSL); the\n// diagnostics carry no language, and a JSON body reads best as a tree.\nfunction queryLanguage(query: string): \"json\" | \"sql\" {\n return /^\\s*[[{]/.test(query) ? \"json\" : \"sql\";\n}\n\n/**\n * A run captured below the level needed for what you are looking for cannot be\n * enriched retroactively — the bodies were never buffered. Saying so, and\n * naming the level that would have them, is the honest answer.\n */\nfunction RerunHint({ record }: { record: ExecutionSummary }) {\n if (record.level === \"trace2\" || record.level === \"trace3\" || record.level === \"trace4\") return null;\n return (\n <p className=\"text-muted-foreground text-xs\">\n Captured at <span className=\"font-mono\">{record.level}</span>. Response bodies are only\n buffered at <span className=\"font-mono\">trace2</span> — raise the level and run it again to\n see them.\n </p>\n );\n}\n\nfunction SectionLabel({ children }: { children: React.ReactNode }) {\n return (\n <p className=\"mb-density-1 font-medium text-muted-foreground text-xs uppercase tracking-wide\">\n {children}\n </p>\n );\n}\n\nfunction useExecutionDetail(\n id: string,\n client: DebugClient | undefined,\n provided: ExecutionDetailPayload | undefined,\n) {\n const [detail, setDetail] = useState<ExecutionDetailPayload | undefined>(provided);\n const [error, setError] = useState<string | undefined>();\n const [loading, setLoading] = useState(provided === undefined);\n\n useEffect(() => {\n if (provided !== undefined) {\n setDetail(provided);\n setLoading(false);\n return;\n }\n let cancelled = false;\n setLoading(true);\n setError(undefined);\n (client ?? new DebugClient())\n .detail(id)\n .then((payload) => {\n if (!cancelled) setDetail(payload);\n })\n .catch((failure: unknown) => {\n if (cancelled) return;\n setError(\n failure instanceof DetailEvictedError\n ? `${failure.message}. The summary above is all that survives.`\n : failure instanceof Error\n ? failure.message\n : String(failure),\n );\n })\n .finally(() => {\n if (!cancelled) setLoading(false);\n });\n return () => {\n cancelled = true;\n };\n }, [id, client, provided]);\n\n return { detail, error, loading };\n}\n"],"mappings":";;;;;;AAwBA,SAAgB,gBAAgB,EAAE,QAAQ,QAAQ,QAAQ,YAAkC;CAC1F,MAAM,EAAE,QAAQ,OAAO,YAAY,mBAAmB,OAAO,IAAI,QAAQ,QAAQ;CAEjF,IAAI,aAAa,KAAA,KAAa,SAC5B,OAAO,oBAAC,OAAD;EAAK,WAAU;EAA4C,UAAA;CAAqB,CAAA;CAEzF,IAAI,OACF,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,KAAD;GAAG,WAAU;GAAoB,UAAA;EAAS,CAAA,GAC1C,oBAAC,WAAD,EAAmB,OAAS,CAAA,CACzB;;CAGT,IAAI,CAAC,QAAQ,OAAO;CAEpB,MAAM,aAAa,OAAO,cAAc,CAAC;CACzC,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG,OAAO,QACN,qBAAC,WAAD,EAAA,UAAA,CACE,oBAAC,cAAD,EAAA,UAAc,QAAmB,CAAA,GACjC,oBAAC,KAAD;IAAG,WAAU;IAA0D,UAAA,OAAO;GAAS,CAAA,CAChF,EAAA,CAAA,IACP;GAEH,WAAW,WAAW,IACrB,oBAAC,KAAD;IAAG,WAAU;IAAgC,UAAA;GAE1C,CAAA,IAEH,WAAW,KAAK,aAAa,UAC3B,oBAAC,iBAAD;IAEE,OAAO,QAAQ;IACf,OAAO,WAAW;IACL;GACd,GAJM,GAAG,YAAY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AG,WAAU;EACV;CACA,CAAA;AAEP;AAEA,SAAS,mBACP,IACA,QACA,UACA;CACA,MAAM,CAAC,QAAQ,aAAa,SAA6C,QAAQ;CACjF,MAAM,CAAC,OAAO,YAAY,SAA6B;CACvD,MAAM,CAAC,SAAS,cAAc,SAAS,aAAa,KAAA,CAAS;CAE7D,gBAAgB;EACd,IAAI,aAAa,KAAA,GAAW;GAC1B,UAAU,QAAQ;GAClB,WAAW,KAAK;GAChB;EACF;EACA,IAAI,YAAY;EAChB,WAAW,IAAI;EACf,SAAS,KAAA,CAAS;EAClB,CAAC,UAAU,IAAI,YAAY,EAAA,CACxB,OAAO,EAAE,CAAC,CACV,MAAM,YAAY;GACjB,IAAI,CAAC,WAAW,UAAU,OAAO;EACnC,CAAC,CAAC,CACD,OAAO,YAAqB;GAC3B,IAAI,WAAW;GACf,SACE,mBAAmB,qBACf,GAAG,QAAQ,QAAQ,6CACnB,mBAAmB,QACjB,QAAQ,UACR,OAAO,OAAO,CACtB;EACF,CAAC,CAAC,CACD,cAAc;GACb,IAAI,CAAC,WAAW,WAAW,KAAK;EAClC,CAAC;EACH,aAAa;GACX,YAAY;EACd;CACF,GAAG;EAAC;EAAI;EAAQ;CAAQ,CAAC;CAEzB,OAAO;EAAE;EAAQ;EAAO;CAAQ;AAClC"}
@@ -87,8 +87,7 @@ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue,
87
87
  const dirty = JSON.stringify(draft) !== initialSerialized;
88
88
  const [normalizedRows, setNormalizedRows] = (0, react.useState)([]);
89
89
  const traces = draft.render === "traces";
90
- const obsolete = traces ? require_spanColumns.obsoleteSpanColumns(draft.columns ?? [], discovered) : [];
91
- const validationError = require_profileEditorModel.validateProfileEditorDraft(draft) ?? (obsolete.length ? `Columns require normalized sources: ${obsolete.join(", ")}. Reset to default or remove them.` : null);
90
+ const validationError = require_profileEditorModel.validateProfileEditorDraft(draft);
92
91
  const saveBlocked = saving || Boolean(validationError) || section === "raw" && !rawValid;
93
92
  const sampleStale = require_profileEditorModel.profileSampleSignature(draft) !== lastSampleSignature;
94
93
  const sourceInspection = require_useProfileInspection.useProfileInspection({
@@ -1 +1 @@
1
- {"version":3,"file":"profileEditor.cjs","names":["lazy","sampleRequestProfile","profileApiPath","useOperationLookupFetcher","useMemo","cloneProfileDraft","useState","defaultSpanColumns","profileSampleSignature","obsoleteSpanColumns","validateProfileEditorDraft","useProfileInspection","profileConnectionID","profileColumnResetState","useProfileFieldState","processorCatalog","profileSchema","useCallback","resolveProfileUpdatePath","profileUpdateConflictTarget","mergeSampledProfileColumns","useQuery","resetProfileColumns","Button","ProfileGeneralSection","ProfileSourceCard","ProfileSchemaSection","profileGeneralOptionKeys","ProfileQuerySection","_Fragment","ProfileSpansSection","ProfileFieldEditorForm","profileFieldEditorEmptyMessage","ProfileParameterDetail","ProcessorPipeline","Suspense","UiListTree","ProfileEditorRail","profileEditorSectionStatus","ProfileFieldSidebarList","ProfileParameterSidebar","UiTable","ProfileEditorPreview","JsonPathSampleRowsContext","Icon","UiPlay","Workspace","Modal","ProfileSaveAsDialog","profileEditorSections"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiListTree, UiPlay, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileQuerySection,\n ProfileSourceCard,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport { useProfileInspection } from \"../wizard/useProfileInspection\";\nimport {\n profileConnectionID,\n type ProfileColumn,\n type ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport {\n processorCatalog,\n type ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns, obsoleteSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */\nfunction sampleErrorMessage(body: string): string {\n try {\n const parsed: unknown = JSON.parse(body);\n if (typeof parsed === \"object\" && parsed !== null && \"error\" in parsed && typeof parsed.error === \"string\") return parsed.error;\n } catch {\n // Not JSON: the body is the message.\n }\n return body;\n}\n\n/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */\nasync function fetchEditorSample(draft: ProfileWizardDraft): Promise<Omit<ProfileSample, \"sourceDraft\">> {\n const profile = sampleRequestProfile(draft);\n if (!profile) throw new Error(\"Cannot sample a profile without a provider\");\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ profile, params: {}, previewProcessors: true }),\n });\n if (!response.ok) throw new Error(sampleErrorMessage(await response.text()));\n return (await response.json()) as Omit<ProfileSample, \"sourceDraft\">;\n}\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n // The Source section's query workspace portals its Run button here, so Run\n // sits beside Save profile and keeps the workspace's own pending/selection state.\n const [runSlot, setRunSlot] = useState<HTMLElement | null>(null);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const obsolete = traces ? obsoleteSpanColumns(draft.columns ?? [], discovered) : [];\n const validationError = validateProfileEditorDraft(draft) ?? (obsolete.length ? `Columns require normalized sources: ${obsolete.join(\", \")}. Reset to default or remove them.` : null);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n // The same inspection the Query workspace reads, so the source field pickers\n // and the workspace share one fetch of the index's mapped fields.\n const sourceInspection = useProfileInspection({\n connectionID: profileConnectionID(draft.provider?.connection ?? \"\"),\n providerOptions: draft.provider?.options ?? {},\n });\n const indexFields =\n sourceInspection.inspection.completion?.kind === \"json-fields\"\n ? sourceInspection.inspection.completion.fields\n : [];\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const pipelineCatalog = useMemo(\n () => processorCatalog(profileSchema().properties?.processors),\n [],\n );\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n setMappingRows(mappingInputRows);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:() => fetchEditorSample(initialDraft),\n });\n // Run on Columns and Spans: the same request the traces source sample makes,\n // for the draft as it stands, accepted the same way.\n const [sampling, setSampling] = useState(false);\n const runSample = async () => {\n setSampling(true);\n setError(\"\");\n try {\n acceptSample({ ...(await fetchEditorSample(draft)), sourceDraft: draft });\n } catch (sampleError) {\n setError(sampleError instanceof Error ? sampleError.message : \"Sample failed\");\n } finally {\n setSampling(false);\n }\n };\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSourceCard\n draft={draft}\n // The provider's documents as read, ahead of any processor, are what\n // a source field name or an unwrap rule refers to.\n indexFields={indexFields}\n sampleRows={mappingRows.length ? mappingRows : sampleRows}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileQuerySection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n runSlot={runSlot}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n providerType={draft.provider?.type}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes = useMemo<WorkspacePaneSpec[]>(() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeightFraction: 0.2,\n maxHeightFraction: 0.8,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleRows.length\n ? `${sampleRows.length} sampled rows · updates as you edit`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={mappingRows}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n />\n ),\n });\n }\n return result;\n }, [\n activeParameter,\n activeProcessor,\n draft,\n fields,\n resetState,\n sampleRows,\n mappingRows,\n sampleStale,\n section,\n sectionContent,\n pipelineCatalog,\n processors,\n setProcessors,\n traces,\n acceptNormalized,\n ]);\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"min-w-0 truncate text-sm text-destructive\" title={error}>{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <span ref={setRunSlot} className=\"contents\" />\n {section === \"columns\" || section === \"spans\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={!draft.provider?.type}\n title={draft.provider?.type ? undefined : \"Choose a provider before running a sample\"}\n loading={sampling}\n loadingLabel=\"Running\"\n onClick={() => void runSample()}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={async (name) => {\n await onSuccess(name);\n setSavingAs(false);\n }}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n return profileEditorSections.find((entry) => entry.id === section)!.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAM,oBAAA,GAAmBA,MAAAA,KAAAA,OAAAA,QAAAA,QAAAA,CAAAA,CAAAA,WAAAA,QACvB,wBAAA,CAAA,CAAA,CAA6B,MAAM,YAAY,EAC7C,SAAS,OAAO,iBAClB,EAAE,CACJ;;AAGA,SAAS,mBAAmB,MAAsB;CAChD,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,IAAI;EACvC,IAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,WAAW,UAAU,OAAO,OAAO,UAAU,UAAU,OAAO,OAAO;CAC5H,QAAQ,CAER;CACA,OAAO;AACT;;AAGA,eAAe,kBAAkB,OAAwE;CACvG,MAAM,UAAUC,uBAAAA,qBAAqB,KAAK;CAC1C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,4CAA4C;CAC1E,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IrG;;GACE,CAAA,IACL;GAEH,YAAY,eACX,iBAAA,GAAA,kBAAA,IAAA,CAACyB,4BAAAA,qBAAD;IACU;IACR,QAAQ;IACD;IACP,gBAAgB,YAAY,KAAK;IACjC,SAAS,OAAO,SAAS;KACvB,MAAM,UAAU,IAAI;KACpB,YAAY,KAAK;IACnB;GACD,CAAA,IACC;GAEH,gBACC,iBAAA,GAAA,kBAAA,IAAA,CAACD,cAAAA,OAAD;IACE,MAAA;IACA,eAAe,iBAAiB,EAAE;IAClC,OAAO,WAAW,cAAc;IAChC,MAAK;IACL,QACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACxB,eAAAA,QAAD;MACE,MAAK;MACL,SAAQ;MACR,eAAe,iBAAiB,EAAE;MACnC,UAAA;KAEO,CAAA,GACR,iBAAA,GAAA,kBAAA,IAAA,CAACA,eAAAA,QAAD;MACE,MAAK;MACL,SAAQ;MACR,UAAU;MACV,eAAe;OACb,iBAAiB,EAAE;OACnB,KAAU,IAAI;MAChB;MACD,UAAA;KAEO,CAAA,CACL;;IAGP,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MAC1B;MAAc;KAG9B;;GACE,CAAA,IACL;EAC8B;;AAExC;AAEA,SAAS,aAAa,SAAuC;CAC3D,OAAO0B,2BAAAA,sBAAsB,MAAM,UAAU,MAAM,OAAO,OAAO,CAAC,CAAE;AACtE"}
1
+ {"version":3,"file":"profileEditor.cjs","names":["lazy","sampleRequestProfile","profileApiPath","useOperationLookupFetcher","useMemo","cloneProfileDraft","useState","defaultSpanColumns","profileSampleSignature","validateProfileEditorDraft","useProfileInspection","profileConnectionID","profileColumnResetState","useProfileFieldState","processorCatalog","profileSchema","useCallback","resolveProfileUpdatePath","profileUpdateConflictTarget","mergeSampledProfileColumns","useQuery","resetProfileColumns","Button","ProfileGeneralSection","ProfileSourceCard","ProfileSchemaSection","profileGeneralOptionKeys","ProfileQuerySection","_Fragment","ProfileSpansSection","ProfileFieldEditorForm","profileFieldEditorEmptyMessage","ProfileParameterDetail","ProcessorPipeline","Suspense","UiListTree","ProfileEditorRail","profileEditorSectionStatus","ProfileFieldSidebarList","ProfileParameterSidebar","UiTable","ProfileEditorPreview","JsonPathSampleRowsContext","Icon","UiPlay","Workspace","Modal","ProfileSaveAsDialog","profileEditorSections"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiListTree, UiPlay, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileQuerySection,\n ProfileSourceCard,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport { useProfileInspection } from \"../wizard/useProfileInspection\";\nimport {\n profileConnectionID,\n type ProfileColumn,\n type ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport {\n processorCatalog,\n type ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */\nfunction sampleErrorMessage(body: string): string {\n try {\n const parsed: unknown = JSON.parse(body);\n if (typeof parsed === \"object\" && parsed !== null && \"error\" in parsed && typeof parsed.error === \"string\") return parsed.error;\n } catch {\n // Not JSON: the body is the message.\n }\n return body;\n}\n\n/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */\nasync function fetchEditorSample(draft: ProfileWizardDraft): Promise<Omit<ProfileSample, \"sourceDraft\">> {\n const profile = sampleRequestProfile(draft);\n if (!profile) throw new Error(\"Cannot sample a profile without a provider\");\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ profile, params: {}, previewProcessors: true }),\n });\n if (!response.ok) throw new Error(sampleErrorMessage(await response.text()));\n return (await response.json()) as Omit<ProfileSample, \"sourceDraft\">;\n}\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n // The Source section's query workspace portals its Run button here, so Run\n // sits beside Save profile and keeps the workspace's own pending/selection state.\n const [runSlot, setRunSlot] = useState<HTMLElement | null>(null);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const validationError = validateProfileEditorDraft(draft);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n // The same inspection the Query workspace reads, so the source field pickers\n // and the workspace share one fetch of the index's mapped fields.\n const sourceInspection = useProfileInspection({\n connectionID: profileConnectionID(draft.provider?.connection ?? \"\"),\n providerOptions: draft.provider?.options ?? {},\n });\n const indexFields =\n sourceInspection.inspection.completion?.kind === \"json-fields\"\n ? sourceInspection.inspection.completion.fields\n : [];\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const pipelineCatalog = useMemo(\n () => processorCatalog(profileSchema().properties?.processors),\n [],\n );\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n setMappingRows(mappingInputRows);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:() => fetchEditorSample(initialDraft),\n });\n // Run on Columns and Spans: the same request the traces source sample makes,\n // for the draft as it stands, accepted the same way.\n const [sampling, setSampling] = useState(false);\n const runSample = async () => {\n setSampling(true);\n setError(\"\");\n try {\n acceptSample({ ...(await fetchEditorSample(draft)), sourceDraft: draft });\n } catch (sampleError) {\n setError(sampleError instanceof Error ? sampleError.message : \"Sample failed\");\n } finally {\n setSampling(false);\n }\n };\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSourceCard\n draft={draft}\n // The provider's documents as read, ahead of any processor, are what\n // a source field name or an unwrap rule refers to.\n indexFields={indexFields}\n sampleRows={mappingRows.length ? mappingRows : sampleRows}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileQuerySection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n runSlot={runSlot}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n providerType={draft.provider?.type}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes = useMemo<WorkspacePaneSpec[]>(() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeightFraction: 0.2,\n maxHeightFraction: 0.8,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleRows.length\n ? `${sampleRows.length} sampled rows · updates as you edit`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={mappingRows}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n />\n ),\n });\n }\n return result;\n }, [\n activeParameter,\n activeProcessor,\n draft,\n fields,\n resetState,\n sampleRows,\n mappingRows,\n sampleStale,\n section,\n sectionContent,\n pipelineCatalog,\n processors,\n setProcessors,\n traces,\n acceptNormalized,\n ]);\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"min-w-0 truncate text-sm text-destructive\" title={error}>{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <span ref={setRunSlot} className=\"contents\" />\n {section === \"columns\" || section === \"spans\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={!draft.provider?.type}\n title={draft.provider?.type ? undefined : \"Choose a provider before running a sample\"}\n loading={sampling}\n loadingLabel=\"Running\"\n onClick={() => void runSample()}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={async (name) => {\n await onSuccess(name);\n setSavingAs(false);\n }}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n return profileEditorSections.find((entry) => entry.id === section)!.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAM,oBAAA,GAAmBA,MAAAA,KAAAA,OAAAA,QAAAA,QAAAA,CAAAA,CAAAA,WAAAA,QACvB,wBAAA,CAAA,CAAA,CAA6B,MAAM,YAAY,EAC7C,SAAS,OAAO,iBAClB,EAAE,CACJ;;AAGA,SAAS,mBAAmB,MAAsB;CAChD,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,IAAI;EACvC,IAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,WAAW,UAAU,OAAO,OAAO,UAAU,UAAU,OAAO,OAAO;CAC5H,QAAQ,CAER;CACA,OAAO;AACT;;AAGA,eAAe,kBAAkB,OAAwE;CACvG,MAAM,UAAUC,uBAAAA,qBAAqB,KAAK;CAC1C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,4CAA4C;CAC1E,MAAM,WAAW,MAAM,MAAMC,mBAAAA,eAAe,gBAAgB,GAAG;EAC7D,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU;GAAE;GAAS,QAAQ,CAAC;GAAG,mBAAmB;EAAK,CAAC;CACvE,CAAC;CACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,mBAAmB,MAAM,SAAS,KAAK,CAAC,CAAC;CAC3E,OAAQ,MAAM,SAAS,KAAK;AAC9B;;;;;;;;;;AAWA,SAAgB,cAAc,EAC5B,QACA,QACA,cACA,YACA,cACA,SACA,aAYC;CACD,MAAM,gBAAgBC,+BAAAA,0BAA0B,MAAM;CACtD,MAAM,gBAAA,GAAeC,MAAAA,QAAAA,OACbC,2BAAAA,kBAAkB,YAAY,GACpC,CAAC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AiB,EAAE;OACnB,KAAU,IAAI;MAChB;MACD,UAAA;KAEO,CAAA,CACL;;IAGP,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MAC1B;MAAc;KAG9B;;GACE,CAAA,IACL;EAC8B;;AAExC;AAEA,SAAS,aAAa,SAAuC;CAC3D,OAAO0B,2BAAAA,sBAAsB,MAAM,UAAU,MAAM,OAAO,OAAO,CAAC,CAAE;AACtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"profileEditor.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileEditor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA6FnE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,MAAM,EACN,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,OAAO,EACP,SAAS,GACV,EAAE;IACD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;mCAE+B;IAC/B,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD,+BA4lBA"}
1
+ {"version":3,"file":"profileEditor.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileEditor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA6FnE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,MAAM,EACN,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,OAAO,EACP,SAAS,GACV,EAAE;IACD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;mCAE+B;IAC/B,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD,+BA2lBA"}
@@ -22,7 +22,7 @@ import { ProcessorPipeline } from "../processor/processorPipeline.js";
22
22
  import { processorCatalog } from "../processor/processorConfig.js";
23
23
  import { profileApiPath, profileSchema } from "../profileApi.js";
24
24
  import { JsonPathSampleRowsContext, sampleRequestProfile } from "../query/jsonPathSample.js";
25
- import { defaultSpanColumns, obsoleteSpanColumns } from "./spanColumns.js";
25
+ import { defaultSpanColumns } from "./spanColumns.js";
26
26
  import { ProfileSpansSection } from "./profileSpansSection.js";
27
27
  import { Suspense, lazy, useCallback, useEffect, useMemo, useState } from "react";
28
28
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -87,8 +87,7 @@ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue,
87
87
  const dirty = JSON.stringify(draft) !== initialSerialized;
88
88
  const [normalizedRows, setNormalizedRows] = useState([]);
89
89
  const traces = draft.render === "traces";
90
- const obsolete = traces ? obsoleteSpanColumns(draft.columns ?? [], discovered) : [];
91
- const validationError = validateProfileEditorDraft(draft) ?? (obsolete.length ? `Columns require normalized sources: ${obsolete.join(", ")}. Reset to default or remove them.` : null);
90
+ const validationError = validateProfileEditorDraft(draft);
92
91
  const saveBlocked = saving || Boolean(validationError) || section === "raw" && !rawValid;
93
92
  const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;
94
93
  const sourceInspection = useProfileInspection({
@@ -1 +1 @@
1
- {"version":3,"file":"profileEditor.js","names":["_Fragment"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiListTree, UiPlay, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileQuerySection,\n ProfileSourceCard,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport { useProfileInspection } from \"../wizard/useProfileInspection\";\nimport {\n profileConnectionID,\n type ProfileColumn,\n type ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport {\n processorCatalog,\n type ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns, obsoleteSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */\nfunction sampleErrorMessage(body: string): string {\n try {\n const parsed: unknown = JSON.parse(body);\n if (typeof parsed === \"object\" && parsed !== null && \"error\" in parsed && typeof parsed.error === \"string\") return parsed.error;\n } catch {\n // Not JSON: the body is the message.\n }\n return body;\n}\n\n/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */\nasync function fetchEditorSample(draft: ProfileWizardDraft): Promise<Omit<ProfileSample, \"sourceDraft\">> {\n const profile = sampleRequestProfile(draft);\n if (!profile) throw new Error(\"Cannot sample a profile without a provider\");\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ profile, params: {}, previewProcessors: true }),\n });\n if (!response.ok) throw new Error(sampleErrorMessage(await response.text()));\n return (await response.json()) as Omit<ProfileSample, \"sourceDraft\">;\n}\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n // The Source section's query workspace portals its Run button here, so Run\n // sits beside Save profile and keeps the workspace's own pending/selection state.\n const [runSlot, setRunSlot] = useState<HTMLElement | null>(null);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const obsolete = traces ? obsoleteSpanColumns(draft.columns ?? [], discovered) : [];\n const validationError = validateProfileEditorDraft(draft) ?? (obsolete.length ? `Columns require normalized sources: ${obsolete.join(\", \")}. Reset to default or remove them.` : null);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n // The same inspection the Query workspace reads, so the source field pickers\n // and the workspace share one fetch of the index's mapped fields.\n const sourceInspection = useProfileInspection({\n connectionID: profileConnectionID(draft.provider?.connection ?? \"\"),\n providerOptions: draft.provider?.options ?? {},\n });\n const indexFields =\n sourceInspection.inspection.completion?.kind === \"json-fields\"\n ? sourceInspection.inspection.completion.fields\n : [];\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const pipelineCatalog = useMemo(\n () => processorCatalog(profileSchema().properties?.processors),\n [],\n );\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n setMappingRows(mappingInputRows);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:() => fetchEditorSample(initialDraft),\n });\n // Run on Columns and Spans: the same request the traces source sample makes,\n // for the draft as it stands, accepted the same way.\n const [sampling, setSampling] = useState(false);\n const runSample = async () => {\n setSampling(true);\n setError(\"\");\n try {\n acceptSample({ ...(await fetchEditorSample(draft)), sourceDraft: draft });\n } catch (sampleError) {\n setError(sampleError instanceof Error ? sampleError.message : \"Sample failed\");\n } finally {\n setSampling(false);\n }\n };\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSourceCard\n draft={draft}\n // The provider's documents as read, ahead of any processor, are what\n // a source field name or an unwrap rule refers to.\n indexFields={indexFields}\n sampleRows={mappingRows.length ? mappingRows : sampleRows}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileQuerySection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n runSlot={runSlot}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n providerType={draft.provider?.type}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes = useMemo<WorkspacePaneSpec[]>(() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeightFraction: 0.2,\n maxHeightFraction: 0.8,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleRows.length\n ? `${sampleRows.length} sampled rows · updates as you edit`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={mappingRows}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n />\n ),\n });\n }\n return result;\n }, [\n activeParameter,\n activeProcessor,\n draft,\n fields,\n resetState,\n sampleRows,\n mappingRows,\n sampleStale,\n section,\n sectionContent,\n pipelineCatalog,\n processors,\n setProcessors,\n traces,\n acceptNormalized,\n ]);\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"min-w-0 truncate text-sm text-destructive\" title={error}>{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <span ref={setRunSlot} className=\"contents\" />\n {section === \"columns\" || section === \"spans\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={!draft.provider?.type}\n title={draft.provider?.type ? undefined : \"Choose a provider before running a sample\"}\n loading={sampling}\n loadingLabel=\"Running\"\n onClick={() => void runSample()}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={async (name) => {\n await onSuccess(name);\n setSavingAs(false);\n }}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n return profileEditorSections.find((entry) => entry.id === section)!.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAM,mBAAmB,WACvB,OAAO,wBAAqB,CAAC,MAAM,YAAY,EAC7C,SAAS,OAAO,iBAClB,EAAE,CACJ;;AAGA,SAAS,mBAAmB,MAAsB;CAChD,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,IAAI;EACvC,IAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,WAAW,UAAU,OAAO,OAAO,UAAU,UAAU,OAAO,OAAO;CAC5H,QAAQ,CAER;CACA,OAAO;AACT;;AAGA,eAAe,kBAAkB,OAAwE;CACvG,MAAM,UAAU,qBAAqB,KAAK;CAC1C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,4CAA4C;CAC1E,MAAM,WAAW,MAAM,MAAM,eAAe,gBAAgB,GAAG;EAC7D,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU;GAAE;GAAS,QAAQ,CAAC;GAAG,mBAAmB;EAAK,CAAC;CACvE,CAAC;CACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,mBAAmB,MAAM,SAAS,KAAK,CAAC,CAAC;CAC3E,OAAQ,MAAM,SAAS,KAAK;AAC9B;;;;;;;;;;AAWA,SAAgB,cAAc,EAC5B,QACA,QACA,cACA,YACA,cACA,SACA,aAYC;CACD,MAAM,gBAAgB,0BAA0B,MAAM;CACtD,MAAM,eAAe,cACb,kBAAkB,YAAY,GACpC,CAAC,YAAY,CACf;CACA,MAAM,oBAAoB,cAClB,KAAK,UAAU,YAAY,GACjC,CAAC,YAAY,CACf;CACA,MAAM,CAAC,OAAO,YAAY,SAA6B,YAAY;C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Fragment"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiListTree, UiPlay, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileQuerySection,\n ProfileSourceCard,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport { useProfileInspection } from \"../wizard/useProfileInspection\";\nimport {\n profileConnectionID,\n type ProfileColumn,\n type ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport {\n processorCatalog,\n type ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */\nfunction sampleErrorMessage(body: string): string {\n try {\n const parsed: unknown = JSON.parse(body);\n if (typeof parsed === \"object\" && parsed !== null && \"error\" in parsed && typeof parsed.error === \"string\") return parsed.error;\n } catch {\n // Not JSON: the body is the message.\n }\n return body;\n}\n\n/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */\nasync function fetchEditorSample(draft: ProfileWizardDraft): Promise<Omit<ProfileSample, \"sourceDraft\">> {\n const profile = sampleRequestProfile(draft);\n if (!profile) throw new Error(\"Cannot sample a profile without a provider\");\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ profile, params: {}, previewProcessors: true }),\n });\n if (!response.ok) throw new Error(sampleErrorMessage(await response.text()));\n return (await response.json()) as Omit<ProfileSample, \"sourceDraft\">;\n}\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n // The Source section's query workspace portals its Run button here, so Run\n // sits beside Save profile and keeps the workspace's own pending/selection state.\n const [runSlot, setRunSlot] = useState<HTMLElement | null>(null);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const validationError = validateProfileEditorDraft(draft);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n // The same inspection the Query workspace reads, so the source field pickers\n // and the workspace share one fetch of the index's mapped fields.\n const sourceInspection = useProfileInspection({\n connectionID: profileConnectionID(draft.provider?.connection ?? \"\"),\n providerOptions: draft.provider?.options ?? {},\n });\n const indexFields =\n sourceInspection.inspection.completion?.kind === \"json-fields\"\n ? sourceInspection.inspection.completion.fields\n : [];\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const pipelineCatalog = useMemo(\n () => processorCatalog(profileSchema().properties?.processors),\n [],\n );\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n setMappingRows(mappingInputRows);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:() => fetchEditorSample(initialDraft),\n });\n // Run on Columns and Spans: the same request the traces source sample makes,\n // for the draft as it stands, accepted the same way.\n const [sampling, setSampling] = useState(false);\n const runSample = async () => {\n setSampling(true);\n setError(\"\");\n try {\n acceptSample({ ...(await fetchEditorSample(draft)), sourceDraft: draft });\n } catch (sampleError) {\n setError(sampleError instanceof Error ? sampleError.message : \"Sample failed\");\n } finally {\n setSampling(false);\n }\n };\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSourceCard\n draft={draft}\n // The provider's documents as read, ahead of any processor, are what\n // a source field name or an unwrap rule refers to.\n indexFields={indexFields}\n sampleRows={mappingRows.length ? mappingRows : sampleRows}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileQuerySection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n runSlot={runSlot}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n providerType={draft.provider?.type}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes = useMemo<WorkspacePaneSpec[]>(() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeightFraction: 0.2,\n maxHeightFraction: 0.8,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleRows.length\n ? `${sampleRows.length} sampled rows · updates as you edit`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={mappingRows}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n />\n ),\n });\n }\n return result;\n }, [\n activeParameter,\n activeProcessor,\n draft,\n fields,\n resetState,\n sampleRows,\n mappingRows,\n sampleStale,\n section,\n sectionContent,\n pipelineCatalog,\n processors,\n setProcessors,\n traces,\n acceptNormalized,\n ]);\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"min-w-0 truncate text-sm text-destructive\" title={error}>{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <span ref={setRunSlot} className=\"contents\" />\n {section === \"columns\" || section === \"spans\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={!draft.provider?.type}\n title={draft.provider?.type ? undefined : \"Choose a provider before running a sample\"}\n loading={sampling}\n loadingLabel=\"Running\"\n onClick={() => void runSample()}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={async (name) => {\n await onSuccess(name);\n setSavingAs(false);\n }}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n return profileEditorSections.find((entry) => entry.id === section)!.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAM,mBAAmB,WACvB,OAAO,wBAAqB,CAAC,MAAM,YAAY,EAC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AO;MAAiC;KAIrG;;GACE,CAAA,IACL;GAEH,YAAY,eACX,oBAAC,qBAAD;IACU;IACR,QAAQ;IACD;IACP,gBAAgB,YAAY,KAAK;IACjC,SAAS,OAAO,SAAS;KACvB,MAAM,UAAU,IAAI;KACpB,YAAY,KAAK;IACnB;GACD,CAAA,IACC;GAEH,gBACC,oBAAC,OAAD;IACE,MAAA;IACA,eAAe,iBAAiB,EAAE;IAClC,OAAO,WAAW,cAAc;IAChC,MAAK;IACL,QACE,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,oBAAC,QAAD;MACE,MAAK;MACL,SAAQ;MACR,eAAe,iBAAiB,EAAE;MACnC,UAAA;KAEO,CAAA,GACR,oBAAC,QAAD;MACE,MAAK;MACL,SAAQ;MACR,UAAU;MACV,eAAe;OACb,iBAAiB,EAAE;OACnB,KAAU,IAAI;MAChB;MACD,UAAA;KAEO,CAAA,CACL;;IAGP,UAAA,qBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MAC1B;MAAc;KAG9B;;GACE,CAAA,IACL;EAC8B;;AAExC;AAEA,SAAS,aAAa,SAAuC;CAC3D,OAAO,sBAAsB,MAAM,UAAU,MAAM,OAAO,OAAO,CAAC,CAAE;AACtE"}
@@ -3,6 +3,7 @@ const require_OtelTraceTable = require("../../data/traces/otel/OtelTraceTable.cj
3
3
  const require_profile_spans = require("../../data/traces/otel/profile-spans.cjs");
4
4
  const require_profile_listing = require("../../data/traces/otel/profile-listing.cjs");
5
5
  const require_Clicky = require("../../data/Clicky.cjs");
6
+ const require_Callout = require("../../data/Callout.cjs");
6
7
  const require_profileApi = require("../profileApi.cjs");
7
8
  let react = require("react");
8
9
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -76,18 +77,33 @@ function ProfileMappingPreview({ profile, rows, onNormalized, filters }) {
76
77
  role: "status",
77
78
  children: "Updating mapping preview…"
78
79
  });
79
- if (profile.render !== "traces") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
80
+ const unresolved = result.unresolvedColumns?.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
81
+ role: "status",
82
+ "aria-label": "Unresolved columns",
83
+ className: "shrink-0",
84
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Callout.Callout, {
85
+ variant: "warning",
86
+ label: "No sampled values",
87
+ className: "my-0 mb-2",
88
+ children: [
89
+ "No sampled row has a value for ",
90
+ result.unresolvedColumns.join(", "),
91
+ ". They fill in once the data carries their source; otherwise check where they read from."
92
+ ]
93
+ })
94
+ }) : null;
95
+ if (profile.render !== "traces") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
80
96
  "aria-busy": pending,
81
97
  className: "flex h-full min-h-0 flex-col",
82
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Clicky.Clicky, {
98
+ children: [unresolved, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Clicky.Clicky, {
83
99
  data: result.document.node,
84
100
  className: "flex min-h-0 flex-1 flex-col",
85
101
  ...filterConfig?.filters.length ? { externalFilters: filterConfig.filters } : {},
86
102
  ...filterConfig?.timeRange ? { timeRange: filterConfig.timeRange } : {}
87
- })
103
+ })]
88
104
  });
89
105
  try {
90
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OtelTraceTable.OtelTraceTable, {
106
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [unresolved, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OtelTraceTable.OtelTraceTable, {
91
107
  spans: require_profile_spans.profileSpans(result.rows),
92
108
  listing: {
93
109
  ...require_profile_listing.profileTraceListing(result.rows, result.document.node),
@@ -101,7 +117,7 @@ function ProfileMappingPreview({ profile, rows, onNormalized, filters }) {
101
117
  traceHref: (id) => `#trace=${encodeURIComponent(id)}`,
102
118
  ...trace ? { selectedTraceId: trace } : {},
103
119
  ...span ? { selectedSpanId: span } : {}
104
- });
120
+ })] });
105
121
  } catch (error) {
106
122
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
107
123
  role: "alert",