dsh-github-copilot 0.4.2-alpha.3 → 0.4.2-alpha.5

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
@@ -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,113 @@ 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
+ "cancelled",
6619
+ "time-limit"
6620
+ ]),
6621
+ totalBytes: integer$1.optional()
6622
+ }).strict()]);
6623
+ const upload = discriminatedUnion("state", [
6624
+ object({
6625
+ state: literal("observed"),
6626
+ bodyWrite: _enum(["observed", "not-observed"]),
6627
+ bodyWriteCompleteMs: integer$1.optional(),
6628
+ nativeResponseHeadersMs: integer$1.optional(),
6629
+ alpn: _enum([
6630
+ "h2",
6631
+ "http/1.1",
6632
+ "unavailable"
6633
+ ]),
6634
+ nodeWritableBufferBytes: integer$1.optional()
6635
+ }).strict(),
6636
+ object({ state: _enum(["unavailable", "work-limit"]) }).strict(),
6637
+ object({
6638
+ state: literal("ambiguous"),
6639
+ requestCount: integer$1
6640
+ }).strict()
6641
+ ]);
6642
+ const RequestDiagnosticsSchema = object({
6643
+ rows: array(object({
6644
+ streamId: string().uuid(),
6645
+ dispatchIndex: integer$1.min(1),
6646
+ version: string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/),
6647
+ startedAt: integer$1,
6648
+ elapsedMs: integer$1,
6649
+ model: string().max(128).regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/),
6650
+ protocol: _enum([
6651
+ "openai-responses",
6652
+ "openai-completions",
6653
+ "anthropic-messages"
6654
+ ]),
6655
+ composition,
6656
+ encoding: _enum([
6657
+ "identity",
6658
+ "gzip",
6659
+ "unknown"
6660
+ ]),
6661
+ wireBytes: integer$1.optional(),
6662
+ upload: upload.optional(),
6663
+ responseHeadersMs: integer$1.optional(),
6664
+ httpStatus: integer$1.min(100).max(599).optional(),
6665
+ outcome: _enum([
6666
+ "http-error",
6667
+ "transport-error",
6668
+ "stream-done",
6669
+ "stream-error",
6670
+ "cancelled",
6671
+ "interrupted"
6672
+ ]),
6673
+ reason: _enum([
6674
+ "none",
6675
+ "unknown",
6676
+ "request-body-timeout",
6677
+ "caller-abort",
6678
+ "credential-changed",
6679
+ "disposed",
6680
+ "byte-idle-timeout",
6681
+ "signal-abort"
6682
+ ])
6683
+ }).strict()).max(128),
6684
+ dropped: integer$1,
6685
+ evicted: integer$1,
6686
+ pending: integer$1.max(128).optional(),
6687
+ interruptedOnReopen: integer$1.optional()
6688
+ }).strict();
6689
+ //#endregion
6599
6690
  //#region lib/types/diagnostics-types.js
6600
6691
  const DIAGNOSTICS_OPERATIONS = [
6601
6692
  "account-global-switch",
@@ -6703,6 +6794,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6703
6794
  updatedAt: integer,
6704
6795
  rows: array(DiagnosticsRowSchema).max(DIAGNOSTICS_MAX_ROWS),
6705
6796
  autoAllocation: AutoAllocationDiagnosticsSchema.optional(),
6797
+ requests: RequestDiagnosticsSchema.optional(),
6706
6798
  pending: array(DiagnosticsPendingSchema).max(128),
6707
6799
  dropped: integer,
6708
6800
  clientDropped: integer,
@@ -6714,6 +6806,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6714
6806
  const DiagnosticsViewSchema = object({
6715
6807
  enabled: boolean(),
6716
6808
  autoAllocationEnabled: boolean(),
6809
+ requestEnabled: boolean().optional(),
6717
6810
  state: _enum([
6718
6811
  "loading",
6719
6812
  "ready",
@@ -6814,6 +6907,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6814
6907
  codec: strictRemoteCodec("dsh-github-copilot#AutoAllocationDiagnosticsEnabled", boolean())
6815
6908
  }]
6816
6909
  },
6910
+ {
6911
+ method: "setRequestEnabled",
6912
+ parameters: [{
6913
+ name: "enabled",
6914
+ wire: "enabled",
6915
+ source: "json",
6916
+ codec: strictRemoteCodec("dsh-github-copilot#RequestDiagnosticsEnabled", boolean())
6917
+ }]
6918
+ },
6817
6919
  {
6818
6920
  method: "recordClient",
6819
6921
  parameters: [{
@@ -7074,7 +7176,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7074
7176
  };
7075
7177
  //#endregion
7076
7178
  //#region package.json
7077
- var version = "0.4.2-alpha.3";
7179
+ var version = "0.4.2-alpha.5";
7078
7180
  //#endregion
7079
7181
  //#region lib/types/diagnostics-client.js
7080
7182
  let owner;
@@ -7303,6 +7405,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7303
7405
  };
7304
7406
  }, [remote]);
7305
7407
  const rows = view?.snapshot.rows ?? [];
7408
+ const requests = view?.snapshot.requests;
7306
7409
  const auto = view?.snapshot.autoAllocation;
7307
7410
  const autoOpportunities = auto?.rows.reduce((sum, row) => sum + row.opportunities, 0) ?? 0;
7308
7411
  const autoExpected = auto?.rows.reduce((sum, row) => sum + row.expectedSelections, 0) ?? 0;
@@ -7427,7 +7530,46 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7427
7530
  } }, 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: {
7428
7531
  ...nativeCaptionStyle,
7429
7532
  margin: 0
7430
- } }, `${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 && populations.length ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Account and compaction observations"), (0, react.createElement)("div", { style: {
7533
+ } }, `${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: {
7534
+ ...nativeCaptionStyle,
7535
+ margin: 0
7536
+ } }, "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: {
7537
+ overflowX: "auto",
7538
+ minWidth: 0
7539
+ } }, (0, react.createElement)("table", { style: {
7540
+ width: "100%",
7541
+ borderCollapse: "collapse",
7542
+ textAlign: "left",
7543
+ font: "inherit"
7544
+ } }, (0, react.createElement)("caption", { style: {
7545
+ ...nativeCaptionStyle,
7546
+ textAlign: "left",
7547
+ marginBottom: 8
7548
+ } }, "Latest retained physical requests"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
7549
+ "Time (UTC)",
7550
+ "Model",
7551
+ "Outcome / reason",
7552
+ "HTTP",
7553
+ "JSON / wire bytes",
7554
+ "Headers / body-write ms"
7555
+ ].map((label) => (0, react.createElement)("th", {
7556
+ key: label,
7557
+ scope: "col",
7558
+ style: {
7559
+ padding: 6,
7560
+ font: "inherit",
7561
+ fontWeight: 500
7562
+ }
7563
+ }, 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: {
7564
+ padding: 6,
7565
+ whiteSpace: "nowrap"
7566
+ } }, new Date(row.startedAt).toISOString()), (0, react.createElement)("td", { style: {
7567
+ padding: 6,
7568
+ overflowWrap: "anywhere"
7569
+ } }, row.model), (0, react.createElement)("td", { style: {
7570
+ padding: 6,
7571
+ overflowWrap: "anywhere"
7572
+ } }, `${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: {
7431
7573
  overflowX: "auto",
7432
7574
  minWidth: 0
7433
7575
  } }, (0, react.createElement)("table", { style: {
@@ -7477,7 +7619,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7477
7619
  "revoked",
7478
7620
  "environment-fault",
7479
7621
  "unknown"
7480
- ], 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", {
7622
+ ], 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: {
7623
+ ...nativeCaptionStyle,
7624
+ margin: 0
7625
+ } }, "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", {
7481
7626
  role: "status",
7482
7627
  style: { margin: 0 }
7483
7628
  }, !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", {
@@ -7496,14 +7641,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7496
7641
  run((value) => value.setEnabled(!view?.enabled));
7497
7642
  }, !remote || !view || !view.enabled && view.state !== "ready"), control(view?.autoAllocationEnabled ? "Pause Auto allocation observation" : "Enable Auto allocation observation", () => {
7498
7643
  run((value) => value.setAutoAllocationEnabled(!view?.autoAllocationEnabled));
7499
- }, !remote || !view || !view.autoAllocationEnabled && view.state !== "ready"), control("Clear local aggregates", () => setConfirmClear(true), !remote || !view || view.state !== "ready")), confirmClear ? (0, react.createElement)("div", {
7644
+ }, !remote || !view || !view.autoAllocationEnabled && view.state !== "ready"), control(view?.requestEnabled ? "Pause request observations" : "Enable request observations", () => {
7645
+ run((value) => value.setRequestEnabled(!view?.requestEnabled));
7646
+ }, !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", {
7500
7647
  role: "group",
7501
7648
  "aria-label": "Confirm clearing local diagnostics"
7502
- }, (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", () => {
7649
+ }, (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", () => {
7503
7650
  setConfirmClear(false);
7504
7651
  run((value) => value.clear());
7505
- }), 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 } }, "Observations stay in this profile for 14 days. 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, "Review aggregate-only JSON"), (0, react.createElement)("p", { style: { margin: 0 } }, "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", {
7506
- "aria-label": "Local diagnostics aggregate JSON",
7652
+ }), 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", {
7653
+ "aria-label": requests ? "Local diagnostics JSON" : "Local diagnostics aggregate JSON",
7507
7654
  readOnly: true,
7508
7655
  value: JSON.stringify(view, null, 2),
7509
7656
  rows: 12,