dsh-github-copilot 0.4.2-alpha.2 → 0.4.2-alpha.4

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.
package/lib/client.js CHANGED
@@ -444,7 +444,7 @@ window.__ModuleLoader__.load({
444
444
  [data-copilot-native-ui] summary {
445
445
  width: fit-content; max-width: 100%; padding: 2px 4px; margin-left: -4px;
446
446
  border-radius: var(--dsw-radius-sm, 8px); cursor: pointer;
447
- font-size: 12px; line-height: 18px; font-weight: 500;
447
+ font: inherit; font-weight: 500;
448
448
  color: var(--dsw-alias-label-secondary, GrayText); list-style: none;
449
449
  }
450
450
  [data-copilot-native-ui] summary::-webkit-details-marker { display: none; }
@@ -6524,10 +6524,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6524
6524
  //#region lib/types/auto-allocation-diagnostics.js
6525
6525
  const AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS = 1024;
6526
6526
  const dayMs = 864e5;
6527
- const integer$1 = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
6527
+ const integer$2 = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
6528
6528
  const version$2 = string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/);
6529
6529
  const allocationRow = object({
6530
- day: integer$1.multipleOf(dayMs),
6530
+ day: integer$2.multipleOf(dayMs),
6531
6531
  version: version$2,
6532
6532
  policyVersion: string().min(1).max(64),
6533
6533
  modelId: string().min(1).max(512),
@@ -6554,12 +6554,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6554
6554
  highCost: boolean(),
6555
6555
  previous: boolean(),
6556
6556
  weight: number().positive().max(1.5),
6557
- opportunities: integer$1.min(1),
6557
+ opportunities: integer$2.min(1),
6558
6558
  expectedSelections: number().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),
6559
- selections: integer$1
6559
+ selections: integer$2
6560
6560
  }).strict();
6561
6561
  const noFitRow = object({
6562
- day: integer$1.multipleOf(dayMs),
6562
+ day: integer$2.multipleOf(dayMs),
6563
6563
  version: version$2,
6564
6564
  policyVersion: string().min(1).max(64),
6565
6565
  targetCategory: _enum([
@@ -6580,22 +6580,111 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6580
6580
  "unknown"
6581
6581
  ]),
6582
6582
  assessmentSource: _enum(["local", "semantic"]),
6583
- decisions: integer$1.min(1)
6583
+ decisions: integer$2.min(1)
6584
6584
  }).strict();
6585
6585
  const AutoAllocationDiagnosticsSchema = object({
6586
6586
  status: _enum(["observed", "not-collected"]),
6587
6587
  rows: array(allocationRow).max(AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS),
6588
6588
  noFitRows: array(noFitRow).max(AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS),
6589
- observationStart: integer$1.nullable(),
6590
- observationEnd: integer$1.nullable(),
6589
+ observationStart: integer$2.nullable(),
6590
+ observationEnd: integer$2.nullable(),
6591
6591
  completeHistory: literal(false),
6592
6592
  rowsTruncated: boolean(),
6593
- dropped: integer$1,
6594
- expired: integer$1,
6595
- saturated: integer$1,
6596
- restarts: integer$1
6593
+ dropped: integer$2,
6594
+ expired: integer$2,
6595
+ saturated: integer$2,
6596
+ restarts: integer$2
6597
6597
  }).strict().refine((value) => JSON.stringify(value).length <= 15e5, "Auto allocation diagnostic capacity exceeded").refine((value) => value.rows.length + value.noFitRows.length <= AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS, "Auto allocation row capacity exceeded").refine(({ observationStart, observationEnd }) => observationStart === null ? observationEnd === null : observationEnd !== null && observationEnd >= observationStart, "Auto allocation observation window is inconsistent");
6598
6598
  //#endregion
6599
+ //#region lib/types/request-diagnostics.js
6600
+ const integer$1 = number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
6601
+ const composition = discriminatedUnion("state", [object({
6602
+ state: literal("complete"),
6603
+ totalBytes: integer$1,
6604
+ conversationBytes: integer$1,
6605
+ toolSchemaBytes: integer$1,
6606
+ systemBytes: integer$1,
6607
+ otherBytes: integer$1,
6608
+ imageBlockBytes: integer$1,
6609
+ opaqueReplayBytes: integer$1,
6610
+ remainingConversationBytes: integer$1
6611
+ }).strict(), object({
6612
+ state: _enum([
6613
+ "unavailable",
6614
+ "size-limit",
6615
+ "work-limit",
6616
+ "invalid-json",
6617
+ "unsupported-shape"
6618
+ ]),
6619
+ totalBytes: integer$1.optional()
6620
+ }).strict()]);
6621
+ const upload = discriminatedUnion("state", [
6622
+ object({
6623
+ state: literal("observed"),
6624
+ bodyWrite: _enum(["observed", "not-observed"]),
6625
+ bodyWriteCompleteMs: integer$1.optional(),
6626
+ nativeResponseHeadersMs: integer$1.optional(),
6627
+ alpn: _enum([
6628
+ "h2",
6629
+ "http/1.1",
6630
+ "unavailable"
6631
+ ]),
6632
+ nodeWritableBufferBytes: integer$1.optional()
6633
+ }).strict(),
6634
+ object({ state: _enum(["unavailable", "work-limit"]) }).strict(),
6635
+ object({
6636
+ state: literal("ambiguous"),
6637
+ requestCount: integer$1
6638
+ }).strict()
6639
+ ]);
6640
+ const RequestDiagnosticsSchema = object({
6641
+ rows: array(object({
6642
+ streamId: string().uuid(),
6643
+ dispatchIndex: integer$1.min(1),
6644
+ version: string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/),
6645
+ startedAt: integer$1,
6646
+ elapsedMs: integer$1,
6647
+ model: string().max(128).regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/),
6648
+ protocol: _enum([
6649
+ "openai-responses",
6650
+ "openai-completions",
6651
+ "anthropic-messages"
6652
+ ]),
6653
+ composition,
6654
+ encoding: _enum([
6655
+ "identity",
6656
+ "gzip",
6657
+ "unknown"
6658
+ ]),
6659
+ wireBytes: integer$1.optional(),
6660
+ upload: upload.optional(),
6661
+ responseHeadersMs: integer$1.optional(),
6662
+ httpStatus: integer$1.min(100).max(599).optional(),
6663
+ outcome: _enum([
6664
+ "http-error",
6665
+ "transport-error",
6666
+ "stream-done",
6667
+ "stream-error",
6668
+ "cancelled",
6669
+ "interrupted"
6670
+ ]),
6671
+ reason: _enum([
6672
+ "none",
6673
+ "unknown",
6674
+ "request-body-timeout",
6675
+ "caller-abort",
6676
+ "credential-changed",
6677
+ "disposed",
6678
+ "byte-idle-timeout",
6679
+ "signal-abort"
6680
+ ])
6681
+ }).strict()).max(128),
6682
+ dropped: integer$1,
6683
+ evicted: integer$1,
6684
+ pending: integer$1.max(128).optional(),
6685
+ interruptedOnReopen: integer$1.optional()
6686
+ }).strict();
6687
+ //#endregion
6599
6688
  //#region lib/types/diagnostics-types.js
6600
6689
  const DIAGNOSTICS_OPERATIONS = [
6601
6690
  "account-global-switch",
@@ -6703,6 +6792,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6703
6792
  updatedAt: integer,
6704
6793
  rows: array(DiagnosticsRowSchema).max(DIAGNOSTICS_MAX_ROWS),
6705
6794
  autoAllocation: AutoAllocationDiagnosticsSchema.optional(),
6795
+ requests: RequestDiagnosticsSchema.optional(),
6706
6796
  pending: array(DiagnosticsPendingSchema).max(128),
6707
6797
  dropped: integer,
6708
6798
  clientDropped: integer,
@@ -6714,6 +6804,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6714
6804
  const DiagnosticsViewSchema = object({
6715
6805
  enabled: boolean(),
6716
6806
  autoAllocationEnabled: boolean(),
6807
+ requestEnabled: boolean().optional(),
6717
6808
  state: _enum([
6718
6809
  "loading",
6719
6810
  "ready",
@@ -6814,6 +6905,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6814
6905
  codec: strictRemoteCodec("dsh-github-copilot#AutoAllocationDiagnosticsEnabled", boolean())
6815
6906
  }]
6816
6907
  },
6908
+ {
6909
+ method: "setRequestEnabled",
6910
+ parameters: [{
6911
+ name: "enabled",
6912
+ wire: "enabled",
6913
+ source: "json",
6914
+ codec: strictRemoteCodec("dsh-github-copilot#RequestDiagnosticsEnabled", boolean())
6915
+ }]
6916
+ },
6817
6917
  {
6818
6918
  method: "recordClient",
6819
6919
  parameters: [{
@@ -7074,7 +7174,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7074
7174
  };
7075
7175
  //#endregion
7076
7176
  //#region package.json
7077
- var version = "0.4.2-alpha.2";
7177
+ var version = "0.4.2-alpha.4";
7078
7178
  //#endregion
7079
7179
  //#region lib/types/diagnostics-client.js
7080
7180
  let owner;
@@ -7303,12 +7403,55 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7303
7403
  };
7304
7404
  }, [remote]);
7305
7405
  const rows = view?.snapshot.rows ?? [];
7406
+ const requests = view?.snapshot.requests;
7306
7407
  const auto = view?.snapshot.autoAllocation;
7307
7408
  const autoOpportunities = auto?.rows.reduce((sum, row) => sum + row.opportunities, 0) ?? 0;
7308
7409
  const autoExpected = auto?.rows.reduce((sum, row) => sum + row.expectedSelections, 0) ?? 0;
7309
7410
  const autoSelections = auto?.rows.reduce((sum, row) => sum + row.selections, 0) ?? 0;
7310
7411
  const autoNoFit = auto?.noFitRows.reduce((sum, row) => sum + row.decisions, 0) ?? 0;
7311
7412
  const autoWindow = auto === void 0 || auto.observationStart === null || auto.observationEnd === null ? "No retained observation window" : `${new Date(auto.observationStart).toISOString().slice(0, 10)} – ${new Date(auto.observationEnd).toISOString().slice(0, 10)} UTC`;
7413
+ const autoRows = auto ? [...auto.rows.map((row) => ({
7414
+ key: JSON.stringify([
7415
+ row.day,
7416
+ row.version,
7417
+ row.policyVersion,
7418
+ row.modelId,
7419
+ row.targetCategory,
7420
+ row.category,
7421
+ row.demand,
7422
+ row.assessmentSource,
7423
+ row.method,
7424
+ row.fallback,
7425
+ row.highCost,
7426
+ row.previous
7427
+ ]),
7428
+ day: row.day,
7429
+ policy: row.policyVersion,
7430
+ model: row.modelId,
7431
+ cohort: `${row.targetCategory} → ${row.category} · ${row.demand} · ${row.assessmentSource} · ${row.method}` + (row.fallback ? " · fallback" : "") + (row.highCost ? " · high-cost" : "") + (row.previous ? " · continuity" : ""),
7432
+ opportunities: row.opportunities,
7433
+ expected: row.expectedSelections,
7434
+ selected: row.selections,
7435
+ noFit: null
7436
+ })), ...auto.noFitRows.map((row) => ({
7437
+ key: JSON.stringify([
7438
+ row.day,
7439
+ row.version,
7440
+ row.policyVersion,
7441
+ row.targetCategory,
7442
+ row.category,
7443
+ row.demand,
7444
+ row.assessmentSource
7445
+ ]),
7446
+ day: row.day,
7447
+ policy: row.policyVersion,
7448
+ model: "—",
7449
+ cohort: `${row.targetCategory} → ${row.category} · ${row.demand} · ${row.assessmentSource} · no fit`,
7450
+ opportunities: null,
7451
+ expected: null,
7452
+ selected: null,
7453
+ noFit: row.decisions
7454
+ }))].sort((left, right) => right.day - left.day || left.policy.localeCompare(right.policy) || left.model.localeCompare(right.model)) : [];
7312
7455
  const populations = [...new Set(rows.filter((row) => row.operation !== "collection").map((row) => `${row.layer}/${row.operation}`))];
7313
7456
  const count = (metrics, population) => rows.filter((row) => metrics.includes(row.metric) && `${row.layer}/${row.operation}` === population).reduce((sum, row) => sum + row.count, 0);
7314
7457
  const control = (label, action, disabled = false) => (0, react.createElement)("button", {
@@ -7321,53 +7464,122 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7321
7464
  "aria-label": "Local diagnostics",
7322
7465
  "data-copilot-native-ui": true,
7323
7466
  style: section
7324
- }, (0, react.createElement)("style", null, nativeSettingsCss), (0, react.createElement)("h3", { style: nativeHeadingStyle }, "Local diagnostics"), (0, react.createElement)("p", { style: {
7325
- margin: 0,
7326
- lineHeight: 1.5,
7327
- maxWidth: "70ch"
7328
- } }, "Account, Checking and compaction counts stay in this profile. No identities, conversation content or raw errors. No upload, scheduled analysis or automatic repair."), (0, react.createElement)("p", {
7329
- role: "status",
7330
- style: { margin: 0 }
7331
- }, !remote ? "Diagnostics controls are unavailable in this connection." : !view ? busy ? "Reading local collection status…" : "Collection status is unknown." : `${view.enabled ? view.state === "ready" ? "Collection enabled" : "Collection configured on; not collecting" : "Collection paused"} · Storage ${view.state}` + (view.diagnostic === "none" ? "" : ` · ${view.diagnostic}`) + (view.dirty ? " · Not all observations are persisted yet" : "")), view ? (0, react.createElement)("p", {
7467
+ }, (0, react.createElement)("style", null, nativeSettingsCss), (0, react.createElement)("h3", { style: nativeHeadingStyle }, "Local diagnostics"), (0, react.createElement)("div", { style: {
7468
+ display: "grid",
7469
+ gap: 8,
7470
+ minWidth: 0
7471
+ } }, (0, react.createElement)("h4", { style: nativeHeadingStyle }, "Auto allocation observations"), (0, react.createElement)("p", {
7332
7472
  role: "status",
7333
7473
  style: { margin: 0 }
7334
- }, `Auto allocation observation ${view.autoAllocationEnabled ? view.state === "ready" ? "enabled" : "configured on; not collecting" : "paused"}.`) : null, (0, react.createElement)("p", { style: {
7335
- margin: 0,
7336
- lineHeight: 1.5,
7337
- maxWidth: "70ch"
7338
- } }, "Auto allocation observation has its own opt-in switch below. It stores daily aggregate candidate opportunities, conditional expected selections, actual selected counts and no-fit decisions. It does not retain individual turns or infer execution, quality, billing or task success."), failed ? (0, react.createElement)("p", {
7339
- role: "alert",
7340
- style: { margin: 0 }
7341
- }, "Could not confirm the operation. Read status before retrying; no write is automatically replayed.") : null, clientDiagnosticsReportingFailed() ? (0, react.createElement)("p", {
7342
- role: "alert",
7343
- style: { margin: 0 }
7344
- }, "Some Client observations could not be confirmed. Client counts are incomplete; Host counts are separate.") : null, (0, react.createElement)("div", { style: {
7345
- display: "flex",
7346
- flexWrap: "wrap",
7347
- gap: 8
7348
- } }, control("Read status", () => {
7349
- run((value) => value.get());
7350
- }, !remote), control(view?.enabled ? "Pause collection" : "Enable local collection", () => {
7351
- run((value) => value.setEnabled(!view?.enabled));
7352
- }, !remote || !view || !view.enabled && view.state !== "ready"), control(view?.autoAllocationEnabled ? "Pause Auto allocation observation" : "Enable Auto allocation observation", () => {
7353
- run((value) => value.setAutoAllocationEnabled(!view?.autoAllocationEnabled));
7354
- }, !remote || !view || !view.autoAllocationEnabled && view.state !== "ready"), control("Clear local aggregates", () => setConfirmClear(true), !remote || !view || view.state !== "ready")), confirmClear ? (0, react.createElement)("div", {
7355
- role: "group",
7356
- "aria-label": "Confirm clearing local diagnostics"
7357
- }, (0, react.createElement)("p", null, "Delete collected aggregates only? Both collection controls keep their current enabled/paused settings. This does not clear account settings or conversation history."), control("Confirm clear", () => {
7358
- setConfirmClear(false);
7359
- run((value) => value.clear());
7360
- }), control("Cancel", () => setConfirmClear(false))) : null, view && populations.length ? (0, react.createElement)("div", { style: {
7474
+ }, !view ? busy ? "Reading observation status…" : "Observation status is unknown." : `${view.autoAllocationEnabled ? view.state === "ready" ? "Enabled" : "Enabled · storage unavailable" : "Paused"} · ${auto === void 0 ? "Auto observations unavailable in this snapshot" : auto.status === "observed" ? "Data observed" : view.state === "ready" ? "No observations collected" : "Observation status unavailable"}` + (view.dirty ? " · Latest changes not fully persisted" : "")), auto ? (0, react.createElement)("p", { style: { margin: 0 } }, `${autoWindow} · ${auto.rows.length + auto.noFitRows.length} retained strata · ${auto.rowsTruncated ? "row limit reached" : "row limit not reached"}` + (auto.dropped ? ` · ${auto.dropped} dropped` : "") + (auto.expired ? ` · ${auto.expired} expired` : "") + (auto.restarts ? ` · ${auto.restarts} restarts observed` : "") + (auto.saturated ? ` · ${auto.saturated} counters saturated` : "")) : null, autoRows.length ? (0, react.createElement)("div", { style: {
7475
+ overflowX: "auto",
7476
+ minWidth: 0
7477
+ } }, (0, react.createElement)("table", { style: {
7478
+ width: "100%",
7479
+ borderCollapse: "collapse",
7480
+ textAlign: "left",
7481
+ font: "inherit"
7482
+ } }, (0, react.createElement)("caption", { style: {
7483
+ ...nativeCaptionStyle,
7484
+ textAlign: "left",
7485
+ marginBottom: 8
7486
+ } }, "Daily aggregates by matching policy, model and decision cohort"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
7487
+ "Date (UTC)",
7488
+ "Policy",
7489
+ "Model",
7490
+ "Cohort",
7491
+ "Opportunities",
7492
+ "Expected",
7493
+ "Selected",
7494
+ "No-fit"
7495
+ ].map((label) => (0, react.createElement)("th", {
7496
+ key: label,
7497
+ scope: "col",
7498
+ style: {
7499
+ padding: 6,
7500
+ font: "inherit",
7501
+ fontWeight: 500,
7502
+ textAlign: label === "Cohort" || label === "Model" ? "left" : "right"
7503
+ }
7504
+ }, label)))), (0, react.createElement)("tbody", null, ...autoRows.map((row) => (0, react.createElement)("tr", { key: row.key }, (0, react.createElement)("td", { style: {
7505
+ padding: 6,
7506
+ whiteSpace: "nowrap"
7507
+ } }, new Date(row.day).toISOString().slice(0, 10)), (0, react.createElement)("td", { style: {
7508
+ padding: 6,
7509
+ overflowWrap: "anywhere"
7510
+ } }, row.policy), (0, react.createElement)("td", { style: {
7511
+ padding: 6,
7512
+ overflowWrap: "anywhere"
7513
+ } }, row.model), (0, react.createElement)("td", { style: {
7514
+ padding: 6,
7515
+ minWidth: 220
7516
+ } }, row.cohort), (0, react.createElement)("td", { style: {
7517
+ padding: 6,
7518
+ textAlign: "right"
7519
+ } }, row.opportunities ?? "—"), (0, react.createElement)("td", { style: {
7520
+ padding: 6,
7521
+ textAlign: "right"
7522
+ } }, row.expected === null ? "—" : row.expected.toFixed(3)), (0, react.createElement)("td", { style: {
7523
+ padding: 6,
7524
+ textAlign: "right"
7525
+ } }, row.selected ?? "—"), (0, react.createElement)("td", { style: {
7526
+ padding: 6,
7527
+ textAlign: "right"
7528
+ } }, row.noFit ?? "—")))))) : null, auto?.status === "observed" && autoRows.length === 0 ? (0, react.createElement)("p", { style: { margin: 0 } }, "No retained strata in this snapshot; this does not mean there were no decisions.") : !auto ? (0, react.createElement)("p", { style: { margin: 0 } }, "Auto allocation aggregates are unavailable in this snapshot.") : view && auto.status !== "observed" && view.state !== "ready" ? (0, react.createElement)("p", { style: { margin: 0 } }, "Storage is not ready; retained Auto observation status is unknown.") : view && auto.status !== "observed" ? (0, react.createElement)("p", { style: { margin: 0 } }, "No retained observations yet.") : null, autoRows.length ? (0, react.createElement)("p", { style: {
7529
+ ...nativeCaptionStyle,
7530
+ margin: 0
7531
+ } }, `${autoOpportunities} candidate opportunities · ${autoExpected.toFixed(3)} expected selections · ${autoSelections} actual selections · ${autoNoFit} no-fit decisions. Compare expected and selected counts only within matching cohorts; these are not execution, quality or billing evidence.`) : null), view ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Physical request observations"), (0, react.createElement)("p", { style: { margin: 0 } }, requests ? `${requests.rows.length} retained requests · ${requests.pending ?? 0} sampled pending · ${requests.dropped} dropped · ${requests.evicted} expired/evicted · ${requests.interruptedOnReopen ?? 0} interrupted on reopen` : "No retained request observations. This does not establish zero failures or enabled collection."), (0, react.createElement)("p", { style: {
7532
+ ...nativeCaptionStyle,
7533
+ margin: 0
7534
+ } }, "Managed native adapter dispatches only. Local body-write completion is not supplier receipt. Stream-done is a native terminal observation, not tool execution or billing success. No Core retry count or Session/turn attribution is inferred."), requests?.rows.length ? (0, react.createElement)("div", { style: {
7535
+ overflowX: "auto",
7536
+ minWidth: 0
7537
+ } }, (0, react.createElement)("table", { style: {
7538
+ width: "100%",
7539
+ borderCollapse: "collapse",
7540
+ textAlign: "left",
7541
+ font: "inherit"
7542
+ } }, (0, react.createElement)("caption", { style: {
7543
+ ...nativeCaptionStyle,
7544
+ textAlign: "left",
7545
+ marginBottom: 8
7546
+ } }, "Latest retained physical requests"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
7547
+ "Time (UTC)",
7548
+ "Model",
7549
+ "Outcome / reason",
7550
+ "HTTP",
7551
+ "JSON / wire bytes",
7552
+ "Headers / body-write ms"
7553
+ ].map((label) => (0, react.createElement)("th", {
7554
+ key: label,
7555
+ scope: "col",
7556
+ style: {
7557
+ padding: 6,
7558
+ font: "inherit",
7559
+ fontWeight: 500
7560
+ }
7561
+ }, label)))), (0, react.createElement)("tbody", null, ...requests.rows.slice().sort((left, right) => right.startedAt - left.startedAt).map((row, index) => (0, react.createElement)("tr", { key: `${row.streamId}/${row.dispatchIndex}/${index}` }, (0, react.createElement)("td", { style: {
7562
+ padding: 6,
7563
+ whiteSpace: "nowrap"
7564
+ } }, new Date(row.startedAt).toISOString()), (0, react.createElement)("td", { style: {
7565
+ padding: 6,
7566
+ overflowWrap: "anywhere"
7567
+ } }, row.model), (0, react.createElement)("td", { style: {
7568
+ padding: 6,
7569
+ overflowWrap: "anywhere"
7570
+ } }, `${row.outcome} / ${row.reason}`), (0, react.createElement)("td", { style: { padding: 6 } }, row.httpStatus ?? "—"), (0, react.createElement)("td", { style: { padding: 6 } }, `${row.composition.totalBytes ?? "unknown"} / ${row.wireBytes ?? "unknown"} (${row.encoding}; composition ${row.composition.state})`), (0, react.createElement)("td", { style: { padding: 6 } }, `${row.responseHeadersMs ?? "unknown"} / ${row.upload?.state === "observed" ? row.upload.bodyWriteCompleteMs ?? "unknown" : "unknown"}`)))))) : null) : null, view && populations.length ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Account and compaction observations"), (0, react.createElement)("div", { style: {
7361
7571
  overflowX: "auto",
7362
7572
  minWidth: 0
7363
7573
  } }, (0, react.createElement)("table", { style: {
7364
7574
  width: "100%",
7365
7575
  borderCollapse: "collapse",
7366
- textAlign: "left"
7576
+ textAlign: "left",
7577
+ font: "inherit"
7367
7578
  } }, (0, react.createElement)("caption", { style: {
7579
+ ...nativeCaptionStyle,
7368
7580
  textAlign: "left",
7369
7581
  marginBottom: 8
7370
- } }, "Retained observations · independent Client and Host populations"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
7582
+ } }, "Independent Client and Host populations"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
7371
7583
  "Population",
7372
7584
  "Started",
7373
7585
  "Success",
@@ -7378,10 +7590,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7378
7590
  ].map((label) => (0, react.createElement)("th", {
7379
7591
  key: label,
7380
7592
  scope: "col",
7381
- style: { padding: 6 }
7593
+ style: {
7594
+ padding: 6,
7595
+ font: "inherit",
7596
+ fontWeight: 500
7597
+ }
7382
7598
  }, label)))), (0, react.createElement)("tbody", null, ...populations.map((population) => (0, react.createElement)("tr", { key: population }, (0, react.createElement)("th", {
7383
7599
  scope: "row",
7384
- style: { padding: 6 }
7600
+ style: {
7601
+ padding: 6,
7602
+ font: "inherit",
7603
+ fontWeight: 500
7604
+ }
7385
7605
  }, population), ...[
7386
7606
  "started",
7387
7607
  "success",
@@ -7397,12 +7617,38 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7397
7617
  "revoked",
7398
7618
  "environment-fault",
7399
7619
  "unknown"
7400
- ], population))))))) : null, view && !populations.length ? (0, react.createElement)("p", null, "No retained operation observations. This is not evidence of zero failures.") : null, auto ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Auto allocation aggregates"), (0, react.createElement)("p", { style: { margin: 0 } }, `${view?.autoAllocationEnabled ? "Collection enabled" : "Collection paused"} · ${auto.status === "observed" ? "Observed" : "Not collected"} · ${autoWindow} · ${auto.rows.length} retained strata · ${autoNoFit} no-fit decisions · ${auto.dropped} dropped candidate rows · ${auto.expired} expired strata · ${auto.restarts} observed restarts · ${auto.saturated} counter saturations · ${auto.rowsTruncated ? "row limit reached" : "row limit not reached"}. Complete history: no.`), auto.rows.length ? (0, react.createElement)("p", { style: { margin: 0 } }, `Across these retained strata: ${autoOpportunities} candidate opportunities, ${autoExpected.toFixed(3)} expected selections and ${autoSelections} actual selections. Cohorts differ; use the JSON rows to compare matching policy/model/category/continuity strata.`) : null, (0, react.createElement)("p", { style: { margin: 0 } }, "Retention: 14 days. Rows contain model IDs and aggregate counts only; no Session/turn IDs, conversation content, upload or automatic tuning. Expired counts are strata, not removed decisions.")) : null, view ? (0, react.createElement)("p", { style: {
7401
- margin: 0,
7402
- fontSize: 12,
7403
- lineHeight: "18px"
7404
- } }, `Host pending: ${view.snapshot.pending.reduce((sum, row) => sum + row.count, 0)}. Host dropped: ${view.snapshot.dropped}; Client dropped: ${view.snapshot.clientDropped}; Client unconfirmed: ${view.snapshot.clientUnconfirmed}; evicted/expired: ${view.snapshot.evicted}; saturated: ${view.snapshot.saturated}. Retention: 14 days, at most 4,096 aggregate rows and 2 MiB. Client pending samples are periodic observations, not a live outstanding count. Other settled includes policy rejection, revocation, environment faults and unknown/no-checkpoint results; JSON preserves each category. Stock/custom-engine physical summaries, native recovery opt-out, OAuth, quota and unwrapped RPCs are not covered.`) : null, view ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Review aggregate-only JSON"), (0, react.createElement)("p", null, "Review before sharing. This includes build versions, hour windows and fixed diagnostic counts, never account or Session identifiers."), control("Prepare current JSON", () => setExported(true)), exported ? (0, react.createElement)("textarea", {
7405
- "aria-label": "Local diagnostics aggregate JSON",
7620
+ ], population)))))))) : null, view && !populations.length ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Account and compaction observations"), (0, react.createElement)("p", null, "No retained operation observations. This is not evidence of zero failures.")) : null, (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Collection controls"), (0, react.createElement)("p", { style: { margin: 0 } }, view?.requestEnabled === void 0 ? "Request observations unavailable in this snapshot." : `Request observations ${view.requestEnabled ? "enabled" : "paused"}. ${requests?.rows.length ?? 0} retained physical requests; ${requests?.dropped ?? 0} dropped; ${requests?.evicted ?? 0} expired/evicted.`), (0, react.createElement)("p", { style: {
7621
+ ...nativeCaptionStyle,
7622
+ margin: 0
7623
+ } }, "Separate opt-in: retain at most 128 content-free physical requests for 24 hours. Includes model, payload byte counts, transport timing, HTTP status and terminal categories, not bodies, credentials, URLs, headers or Session/turn IDs. Random stream IDs correlate native SDK dispatches only; dispatch index is not a Core retry count."), (0, react.createElement)("p", {
7624
+ role: "status",
7625
+ style: { margin: 0 }
7626
+ }, !remote ? "Diagnostics controls are unavailable in this connection." : !view ? busy ? "Reading local collection status…" : "Collection status is unknown." : `${view.enabled ? view.state === "ready" ? "Local collection enabled" : "Local collection configured on; storage not ready" : "Local collection paused"} · Storage ${view.state}` + (view.diagnostic === "none" ? "" : ` · ${view.diagnostic}`) + (view.dirty ? " · Not all observations are persisted yet" : "")), failed ? (0, react.createElement)("p", {
7627
+ role: "alert",
7628
+ style: { margin: 0 }
7629
+ }, "Could not confirm the operation. Read status before retrying; no write is automatically replayed.") : null, clientDiagnosticsReportingFailed() ? (0, react.createElement)("p", {
7630
+ role: "alert",
7631
+ style: { margin: 0 }
7632
+ }, "Some Client observations could not be confirmed. Client counts are incomplete; Host counts are separate.") : null, (0, react.createElement)("div", { style: {
7633
+ display: "flex",
7634
+ flexWrap: "wrap",
7635
+ gap: 8
7636
+ } }, control("Read status", () => {
7637
+ run((value) => value.get());
7638
+ }, !remote), control(view?.enabled ? "Pause collection" : "Enable local collection", () => {
7639
+ run((value) => value.setEnabled(!view?.enabled));
7640
+ }, !remote || !view || !view.enabled && view.state !== "ready"), control(view?.autoAllocationEnabled ? "Pause Auto allocation observation" : "Enable Auto allocation observation", () => {
7641
+ run((value) => value.setAutoAllocationEnabled(!view?.autoAllocationEnabled));
7642
+ }, !remote || !view || !view.autoAllocationEnabled && view.state !== "ready"), control(view?.requestEnabled ? "Pause request observations" : "Enable request observations", () => {
7643
+ run((value) => value.setRequestEnabled(!view?.requestEnabled));
7644
+ }, !remote || !view || view.requestEnabled === void 0 || !view.requestEnabled && view.state !== "ready"), control("Clear local diagnostics", () => setConfirmClear(true), !remote || !view || view.state !== "ready")), confirmClear ? (0, react.createElement)("div", {
7645
+ role: "group",
7646
+ "aria-label": "Confirm clearing local diagnostics"
7647
+ }, (0, react.createElement)("p", null, "Delete collected aggregates and request observations? Collection controls keep their current enabled/paused settings. This does not clear account settings or conversation history."), control("Confirm clear", () => {
7648
+ setConfirmClear(false);
7649
+ run((value) => value.clear());
7650
+ }), control("Cancel", () => setConfirmClear(false))) : null), view ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Data scope, limits and JSON"), (0, react.createElement)("p", { style: { margin: 0 } }, "Aggregates stay in this profile for 14 days; request observations for 24 hours. Auto rows contain policy/model/cohort dimensions and aggregate counts only; no Session or turn IDs, conversation content, upload or automatic tuning. Expired counts are strata, not removed decisions."), (0, react.createElement)("p", { style: { margin: 0 } }, `Host pending: ${view.snapshot.pending.reduce((sum, row) => sum + row.count, 0)}. Host dropped: ${view.snapshot.dropped}; Client dropped: ${view.snapshot.clientDropped}; Client unconfirmed: ${view.snapshot.clientUnconfirmed}; evicted/expired: ${view.snapshot.evicted}; saturated: ${view.snapshot.saturated}. At most 4,096 aggregate rows and 2 MiB. Client pending samples are periodic observations, not a live outstanding count. Other settled includes policy rejection, revocation, environment faults and unknown/no-checkpoint results. Stock/custom-engine physical summaries, native recovery opt-out, OAuth, quota and unwrapped RPCs are not covered.`), (0, react.createElement)("details", null, (0, react.createElement)("summary", null, requests ? "Review local diagnostics JSON" : "Review aggregate-only JSON"), (0, react.createElement)("p", { style: { margin: 0 } }, "Review before sharing. This includes build versions and diagnostic counts; when request observations were enabled it also includes request times, model IDs, byte counts and random stream IDs, never account or Session identifiers. Client timing does not prove supplier receipt or fault ownership."), control("Prepare current JSON", () => setExported(true)), exported ? (0, react.createElement)("textarea", {
7651
+ "aria-label": requests ? "Local diagnostics JSON" : "Local diagnostics aggregate JSON",
7406
7652
  readOnly: true,
7407
7653
  value: JSON.stringify(view, null, 2),
7408
7654
  rows: 12,
@@ -7411,7 +7657,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7411
7657
  boxSizing: "border-box",
7412
7658
  font: "inherit"
7413
7659
  }
7414
- }) : null) : null);
7660
+ }) : null)) : null);
7415
7661
  }
7416
7662
  //#endregion
7417
7663
  //#region lib/types/reasoning-presentation.js