dsh-github-copilot 0.4.1 → 0.4.2-alpha.11
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/AGENTS.md +42 -6
- package/CHANGELOG.md +126 -0
- package/README.md +75 -25
- package/README.zh.md +55 -20
- package/deployment-baseline.json +30 -3
- package/docs/auto-high-cost.md +51 -20
- package/docs/auto-iteration-review.json +13 -13
- package/docs/auto-task-routing.md +118 -19
- package/docs/automatic-model-routing.md +2 -1
- package/docs/copilot-accounts.md +6 -0
- package/docs/copilot-compaction.md +1 -1
- package/docs/plugin-diagnostics.md +159 -6
- package/lib/client.js +814 -59
- package/lib/client.js.map +1 -1
- package/lib/diagnostics-analysis.js +4 -2
- package/lib/diagnostics-types-qvtuvM5E.js +661 -0
- package/lib/index.js +8775 -7934
- package/lib/manual-compaction-recovery.js +1 -1
- package/lib/remote.js +278 -6
- package/lib/routed-web.js +1 -1
- package/lib/types/auto-allocation-diagnostics.d.ts +126 -0
- package/lib/types/auto-allocation-evidence.d.ts +5 -1
- package/lib/types/auto-allocation.d.ts +7 -2
- package/lib/types/auto-assessment-evidence.d.ts +65 -0
- package/lib/types/auto-model-host.d.ts +1 -0
- package/lib/types/auto-model-routing.d.ts +1 -1
- package/lib/types/auto-task-assessment.d.ts +4 -2
- package/lib/types/auto-task-classifier.d.ts +2 -1
- package/lib/types/compaction-continuation.d.ts +1 -1
- package/lib/types/config.d.ts +18 -2
- package/lib/types/context-evidence.d.ts +4 -4
- package/lib/types/copilot-auth.d.ts +2 -1
- package/lib/types/copilot-usage-remote.d.ts +1 -1
- package/lib/types/diagnostics-analysis.d.ts +3 -2
- package/lib/types/diagnostics-card.d.ts +1 -0
- package/lib/types/diagnostics-collector.d.ts +14 -0
- package/lib/types/diagnostics-host.d.ts +114 -3
- package/lib/types/diagnostics-remote.d.ts +11 -9
- package/lib/types/diagnostics-types.d.ts +486 -30
- package/lib/types/native-settings-style.d.ts +1 -1
- package/lib/types/preview-provider.d.ts +8 -2
- package/lib/types/preview-route.d.ts +1 -1
- package/lib/types/remote.d.ts +1 -1
- package/lib/types/request-body-composition.d.ts +17 -0
- package/lib/types/request-body-evidence.d.ts +2 -1
- package/lib/types/request-diagnostics.d.ts +278 -0
- package/lib/types/session-continuation-types.d.ts +2 -2
- package/lib/types/turn-selection-host.d.ts +2 -1
- package/lib/types/turn-selection.d.ts +39 -2
- package/package.json +2 -2
- package/lib/diagnostics-types-FVf6zjob.js +0 -182
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
|
|
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; }
|
|
@@ -1475,6 +1475,7 @@ window.__ModuleLoader__.load({
|
|
|
1475
1475
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
1476
1476
|
}
|
|
1477
1477
|
const anyString = /^[\s\S]{0,}$/;
|
|
1478
|
+
const integer$3 = /^-?\d+$/;
|
|
1478
1479
|
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
1479
1480
|
const boolean$1 = /^(?:true|false)$/i;
|
|
1480
1481
|
const lowercase = /^[^A-Z]*$/;
|
|
@@ -1811,7 +1812,7 @@ window.__ModuleLoader__.load({
|
|
|
1811
1812
|
};
|
|
1812
1813
|
//#endregion
|
|
1813
1814
|
//#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
|
|
1814
|
-
const version$
|
|
1815
|
+
const version$3 = {
|
|
1815
1816
|
major: 4,
|
|
1816
1817
|
minor: 6,
|
|
1817
1818
|
patch: 5
|
|
@@ -1823,7 +1824,7 @@ window.__ModuleLoader__.load({
|
|
|
1823
1824
|
inst ?? (inst = {});
|
|
1824
1825
|
inst._zod.def = def;
|
|
1825
1826
|
inst._zod.bag = inst._zod.bag || {};
|
|
1826
|
-
inst._zod.version = version$
|
|
1827
|
+
inst._zod.version = version$3;
|
|
1827
1828
|
const defChecks = inst._zod.def.checks;
|
|
1828
1829
|
const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
|
|
1829
1830
|
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
@@ -2856,6 +2857,138 @@ window.__ModuleLoader__.load({
|
|
|
2856
2857
|
result.value = merged.data;
|
|
2857
2858
|
return result;
|
|
2858
2859
|
}
|
|
2860
|
+
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
2861
|
+
$ZodType.init(inst, def);
|
|
2862
|
+
const memo = globalConfig.memoizer;
|
|
2863
|
+
memo?.attach(inst);
|
|
2864
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2865
|
+
const input = payload.value;
|
|
2866
|
+
if (!isPlainObject(input)) {
|
|
2867
|
+
payload.issues.push({
|
|
2868
|
+
expected: "record",
|
|
2869
|
+
code: "invalid_type",
|
|
2870
|
+
input,
|
|
2871
|
+
inst
|
|
2872
|
+
});
|
|
2873
|
+
return payload;
|
|
2874
|
+
}
|
|
2875
|
+
const proms = [];
|
|
2876
|
+
const values = def.keyType._zod.values;
|
|
2877
|
+
if (values && !def.partial) {
|
|
2878
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2879
|
+
const recordKeys = /* @__PURE__ */ new Set();
|
|
2880
|
+
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
2881
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
2882
|
+
if (key === "__proto__") continue;
|
|
2883
|
+
const keyResult = def.keyType._zod.run({
|
|
2884
|
+
value: key,
|
|
2885
|
+
issues: []
|
|
2886
|
+
}, ctx);
|
|
2887
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2888
|
+
if (keyResult.issues.length) {
|
|
2889
|
+
payload.issues.push({
|
|
2890
|
+
code: "invalid_key",
|
|
2891
|
+
origin: "record",
|
|
2892
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
2893
|
+
input: key,
|
|
2894
|
+
path: [key],
|
|
2895
|
+
inst
|
|
2896
|
+
});
|
|
2897
|
+
continue;
|
|
2898
|
+
}
|
|
2899
|
+
const outKey = keyResult.value;
|
|
2900
|
+
if (outKey === "__proto__") continue;
|
|
2901
|
+
const result = def.valueType._zod.run({
|
|
2902
|
+
value: input[key],
|
|
2903
|
+
issues: []
|
|
2904
|
+
}, ctx);
|
|
2905
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2906
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2907
|
+
payload.value[outKey] = result.value;
|
|
2908
|
+
}));
|
|
2909
|
+
else {
|
|
2910
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2911
|
+
payload.value[outKey] = result.value;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
let unrecognized;
|
|
2915
|
+
for (const key in input) if (!recordKeys.has(key)) {
|
|
2916
|
+
if (def.mode === "loose") {
|
|
2917
|
+
if (key === "__proto__") continue;
|
|
2918
|
+
payload.value[key] = input[key];
|
|
2919
|
+
} else {
|
|
2920
|
+
unrecognized = unrecognized ?? [];
|
|
2921
|
+
unrecognized.push(key);
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
2925
|
+
code: "unrecognized_keys",
|
|
2926
|
+
input,
|
|
2927
|
+
inst,
|
|
2928
|
+
keys: unrecognized,
|
|
2929
|
+
continue: true
|
|
2930
|
+
});
|
|
2931
|
+
} else {
|
|
2932
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2933
|
+
let unrecognized;
|
|
2934
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
2935
|
+
if (key === "__proto__") continue;
|
|
2936
|
+
if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue;
|
|
2937
|
+
let keyResult = def.keyType._zod.run({
|
|
2938
|
+
value: key,
|
|
2939
|
+
issues: []
|
|
2940
|
+
}, ctx);
|
|
2941
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2942
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
|
|
2943
|
+
const retryResult = def.keyType._zod.run({
|
|
2944
|
+
value: Number(key),
|
|
2945
|
+
issues: []
|
|
2946
|
+
}, ctx);
|
|
2947
|
+
if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2948
|
+
if (retryResult.issues.length === 0) keyResult = retryResult;
|
|
2949
|
+
}
|
|
2950
|
+
if (keyResult.issues.length) {
|
|
2951
|
+
if (def.mode === "loose") payload.value[key] = input[key];
|
|
2952
|
+
else if (values) {
|
|
2953
|
+
unrecognized = unrecognized ?? [];
|
|
2954
|
+
unrecognized.push(key);
|
|
2955
|
+
} else payload.issues.push({
|
|
2956
|
+
code: "invalid_key",
|
|
2957
|
+
origin: "record",
|
|
2958
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
2959
|
+
input: key,
|
|
2960
|
+
path: [key],
|
|
2961
|
+
inst
|
|
2962
|
+
});
|
|
2963
|
+
continue;
|
|
2964
|
+
}
|
|
2965
|
+
const outKey = keyResult.value;
|
|
2966
|
+
if (outKey === "__proto__") continue;
|
|
2967
|
+
const result = def.valueType._zod.run({
|
|
2968
|
+
value: input[key],
|
|
2969
|
+
issues: []
|
|
2970
|
+
}, ctx);
|
|
2971
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2972
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2973
|
+
payload.value[outKey] = result.value;
|
|
2974
|
+
}));
|
|
2975
|
+
else {
|
|
2976
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2977
|
+
payload.value[outKey] = result.value;
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
2981
|
+
code: "unrecognized_keys",
|
|
2982
|
+
input,
|
|
2983
|
+
inst,
|
|
2984
|
+
keys: unrecognized,
|
|
2985
|
+
continue: true
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2989
|
+
return payload;
|
|
2990
|
+
};
|
|
2991
|
+
});
|
|
2859
2992
|
const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
2860
2993
|
$ZodType.init(inst, def);
|
|
2861
2994
|
const values = getEnumValues(def.entries);
|
|
@@ -4744,6 +4877,107 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4744
4877
|
json.allOf = allOf;
|
|
4745
4878
|
ctx.intersections.push(allOf);
|
|
4746
4879
|
};
|
|
4880
|
+
/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the
|
|
4881
|
+
* numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key
|
|
4882
|
+
* behind a wrapper only carries its own `type` before then, and a union key only has its branches.
|
|
4883
|
+
*
|
|
4884
|
+
* A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather
|
|
4885
|
+
* than carried over: keeping them beside `type: "string"` reproduces the match-nothing schema this
|
|
4886
|
+
* exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`
|
|
4887
|
+
* accepts `"3"` — which is the deliberate trade, since throwing on it would reject an ordinary schema
|
|
4888
|
+
* outright. */
|
|
4889
|
+
function stringifyKeyNames(bySchema, json, visited) {
|
|
4890
|
+
if (json.$ref) {
|
|
4891
|
+
if (visited.has(json)) return json;
|
|
4892
|
+
visited.add(json);
|
|
4893
|
+
const def = bySchema.get(json)?.def;
|
|
4894
|
+
if (!def) return json;
|
|
4895
|
+
const inlined = stringifyKeyNames(bySchema, def, visited);
|
|
4896
|
+
return inlined === def ? json : inlined;
|
|
4897
|
+
}
|
|
4898
|
+
for (const keyword of ["anyOf", "oneOf"]) {
|
|
4899
|
+
const branches = json[keyword];
|
|
4900
|
+
if (!Array.isArray(branches)) continue;
|
|
4901
|
+
const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
|
|
4902
|
+
if (mapped.some((branch, i) => branch !== branches[i])) json = {
|
|
4903
|
+
...json,
|
|
4904
|
+
[keyword]: mapped
|
|
4905
|
+
};
|
|
4906
|
+
}
|
|
4907
|
+
const types = Array.isArray(json.type) ? json.type : [json.type];
|
|
4908
|
+
const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
|
|
4909
|
+
const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
|
|
4910
|
+
if (!numericType && !values?.some((v) => typeof v === "number")) return json;
|
|
4911
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
|
|
4912
|
+
if (rest.enum) rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
4913
|
+
else if (typeof rest.const === "number") rest.const = String(rest.const);
|
|
4914
|
+
if (!numericType) return rest;
|
|
4915
|
+
rest.type = "string";
|
|
4916
|
+
if (!values) rest.pattern = (types.includes("number") ? number$1 : integer$3).source;
|
|
4917
|
+
return rest;
|
|
4918
|
+
}
|
|
4919
|
+
/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */
|
|
4920
|
+
const pendingRecords = /* @__PURE__ */ new WeakMap();
|
|
4921
|
+
function rewriteKeyNames(ctx) {
|
|
4922
|
+
const bySchema = /* @__PURE__ */ new Map();
|
|
4923
|
+
for (const entry of ctx.seen.values()) if (entry.def && !bySchema.has(entry.schema)) bySchema.set(entry.schema, entry);
|
|
4924
|
+
const rewrites = /* @__PURE__ */ new Map();
|
|
4925
|
+
for (const record of pendingRecords.get(ctx) ?? []) {
|
|
4926
|
+
const seen = ctx.seen.get(record);
|
|
4927
|
+
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
4928
|
+
if (!names || names === true || rewrites.has(names)) continue;
|
|
4929
|
+
const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
|
|
4930
|
+
if (rewritten !== names) rewrites.set(names, rewritten);
|
|
4931
|
+
}
|
|
4932
|
+
if (!rewrites.size) return;
|
|
4933
|
+
for (const entry of ctx.seen.values()) for (const carrier of [entry.schema, entry.def]) {
|
|
4934
|
+
const rewritten = carrier && rewrites.get(carrier.propertyNames);
|
|
4935
|
+
if (rewritten) carrier.propertyNames = rewritten;
|
|
4936
|
+
}
|
|
4937
|
+
}
|
|
4938
|
+
const recordProcessor = (schema, ctx, _json, params) => {
|
|
4939
|
+
const json = _json;
|
|
4940
|
+
const def = schema._zod.def;
|
|
4941
|
+
json.type = "object";
|
|
4942
|
+
const keyType = def.keyType;
|
|
4943
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
4944
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
4945
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
4946
|
+
...params,
|
|
4947
|
+
path: [
|
|
4948
|
+
...params.path,
|
|
4949
|
+
"patternProperties",
|
|
4950
|
+
"*"
|
|
4951
|
+
]
|
|
4952
|
+
});
|
|
4953
|
+
json.patternProperties = {};
|
|
4954
|
+
for (const pattern of patterns) assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
4955
|
+
} else {
|
|
4956
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
4957
|
+
json.propertyNames = processSchema(def.keyType, ctx, {
|
|
4958
|
+
...params,
|
|
4959
|
+
path: [...params.path, "propertyNames"]
|
|
4960
|
+
});
|
|
4961
|
+
let pending = pendingRecords.get(ctx);
|
|
4962
|
+
if (!pending) {
|
|
4963
|
+
pending = [];
|
|
4964
|
+
pendingRecords.set(ctx, pending);
|
|
4965
|
+
ctx.deferred.push(() => rewriteKeyNames(ctx));
|
|
4966
|
+
}
|
|
4967
|
+
pending.push(schema);
|
|
4968
|
+
}
|
|
4969
|
+
json.additionalProperties = processSchema(def.valueType, ctx, {
|
|
4970
|
+
...params,
|
|
4971
|
+
path: [...params.path, "additionalProperties"]
|
|
4972
|
+
});
|
|
4973
|
+
}
|
|
4974
|
+
const keyValues = keyType._zod.values;
|
|
4975
|
+
const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
|
|
4976
|
+
if (keyValues && !def.partial && !omittableOnInput) {
|
|
4977
|
+
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
4978
|
+
if (validKeyValues.length > 0) json.required = validKeyValues.map(String);
|
|
4979
|
+
}
|
|
4980
|
+
};
|
|
4747
4981
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
4748
4982
|
const def = schema._zod.def;
|
|
4749
4983
|
const inner = processSchema(def.innerType, ctx, params);
|
|
@@ -5531,6 +5765,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5531
5765
|
right
|
|
5532
5766
|
});
|
|
5533
5767
|
}
|
|
5768
|
+
const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
|
|
5769
|
+
_ensureDefaultMemoizer();
|
|
5770
|
+
$ZodRecord.init(inst, def);
|
|
5771
|
+
ZodType.init(inst, def);
|
|
5772
|
+
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
5773
|
+
inst.keyType = def.keyType;
|
|
5774
|
+
inst.valueType = def.valueType;
|
|
5775
|
+
});
|
|
5776
|
+
function partialRecord(keyType, valueType, params) {
|
|
5777
|
+
return new ZodRecord({
|
|
5778
|
+
type: "record",
|
|
5779
|
+
keyType,
|
|
5780
|
+
valueType,
|
|
5781
|
+
...normalizeParams(params),
|
|
5782
|
+
partial: true
|
|
5783
|
+
});
|
|
5784
|
+
}
|
|
5534
5785
|
const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
5535
5786
|
$ZodEnum.init(inst, def);
|
|
5536
5787
|
ZodType.init(inst, def);
|
|
@@ -5986,6 +6237,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5986
6237
|
//#endregion
|
|
5987
6238
|
//#region lib/types/auto-assessment-evidence.js
|
|
5988
6239
|
const milliseconds = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
6240
|
+
const candidateCount = number().int().min(0).max(512);
|
|
6241
|
+
const AssessmentProjectionSchema = object({
|
|
6242
|
+
retainedMessages: number().int().min(0).max(12),
|
|
6243
|
+
historyOmitted: boolean(),
|
|
6244
|
+
taskTextLimited: boolean(),
|
|
6245
|
+
continuationAnchor: _enum([
|
|
6246
|
+
"not-needed",
|
|
6247
|
+
"retained",
|
|
6248
|
+
"missing"
|
|
6249
|
+
])
|
|
6250
|
+
}).strict().refine((value) => value.taskTextLimited || value.retainedMessages > 0 && value.continuationAnchor !== "missing", "Inconsistent task text evidence");
|
|
6251
|
+
const candidateScan = object({
|
|
6252
|
+
candidates: candidateCount,
|
|
6253
|
+
eligible: candidateCount,
|
|
6254
|
+
rejected: partialRecord(_enum([
|
|
6255
|
+
"excluded",
|
|
6256
|
+
"configured-id",
|
|
6257
|
+
"category",
|
|
6258
|
+
"input",
|
|
6259
|
+
"reasoning-disable-unproven",
|
|
6260
|
+
"budget"
|
|
6261
|
+
]), candidateCount)
|
|
6262
|
+
}).strict().refine((value) => value.eligible + Object.values(value.rejected).reduce((sum, count) => sum + count, 0) === value.candidates, "Inconsistent candidate counts");
|
|
5989
6263
|
const SemanticAssessmentEvidenceSchema = object({
|
|
5990
6264
|
modelId: string().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u).optional(),
|
|
5991
6265
|
budgetMs: milliseconds.refine((value) => value > 0),
|
|
@@ -6006,7 +6280,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6006
6280
|
"valid",
|
|
6007
6281
|
"invalid",
|
|
6008
6282
|
"context-omitted"
|
|
6009
|
-
])
|
|
6283
|
+
]),
|
|
6284
|
+
candidateScan: candidateScan.optional(),
|
|
6285
|
+
preparationFailure: _enum(["native-off-unavailable"]).optional(),
|
|
6286
|
+
projection: AssessmentProjectionSchema.optional(),
|
|
6287
|
+
classifierDemand: _enum([
|
|
6288
|
+
"simple",
|
|
6289
|
+
"routine",
|
|
6290
|
+
"complex",
|
|
6291
|
+
"unknown"
|
|
6292
|
+
]).optional()
|
|
6010
6293
|
}).strict().superRefine((value, ctx) => {
|
|
6011
6294
|
if (value.adapterStartedMs !== void 0 && value.adapterStartedMs > value.elapsedMs || value.firstTextMs !== void 0 && (value.adapterStartedMs === void 0 || value.firstTextMs < value.adapterStartedMs || value.firstTextMs > value.elapsedMs)) ctx.addIssue({
|
|
6012
6295
|
code: "custom",
|
|
@@ -6016,7 +6299,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6016
6299
|
"adapter-started",
|
|
6017
6300
|
"text-received",
|
|
6018
6301
|
"finished"
|
|
6019
|
-
].includes(value.stage) && value.adapterStartedMs === void 0 || value.stage === "text-received" && value.firstTextMs === void 0 || value.stage === "finished" && value.nativeFinish === void 0 || value.nativeFinish !== void 0 && value.stage !== "finished" || value.outputCharacters > 0 && value.firstTextMs === void 0 || value.firstTextMs !== void 0 && value.outputCharacters === 0) ctx.addIssue({
|
|
6302
|
+
].includes(value.stage) && value.adapterStartedMs === void 0 || value.stage === "text-received" && value.firstTextMs === void 0 || value.stage === "finished" && value.nativeFinish === void 0 || value.nativeFinish !== void 0 && value.stage !== "finished" || value.outputCharacters > 0 && value.firstTextMs === void 0 || value.firstTextMs !== void 0 && value.outputCharacters === 0 || value.classifierDemand !== void 0 && !["valid", "context-omitted"].includes(value.validation)) ctx.addIssue({
|
|
6020
6303
|
code: "custom",
|
|
6021
6304
|
message: "Inconsistent assessment phase"
|
|
6022
6305
|
});
|
|
@@ -6048,9 +6331,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6048
6331
|
}
|
|
6049
6332
|
//#endregion
|
|
6050
6333
|
//#region lib/types/auto-allocation.js
|
|
6051
|
-
const
|
|
6334
|
+
const AUTO_ALLOCATION_POLICIES = ["high-cost-v1", "high-cost-v2"];
|
|
6052
6335
|
const AutoAllocationSchema = object({
|
|
6053
|
-
policyVersion:
|
|
6336
|
+
policyVersion: _enum(AUTO_ALLOCATION_POLICIES),
|
|
6337
|
+
deferredHighCostCount: number().int().min(0).max(511).optional(),
|
|
6054
6338
|
selectedModelId: string().min(1).max(512),
|
|
6055
6339
|
candidates: array(object({
|
|
6056
6340
|
modelId: string().min(1).max(512),
|
|
@@ -6061,16 +6345,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6061
6345
|
}).strict()).min(1).max(512)
|
|
6062
6346
|
}).strict().refine((value) => {
|
|
6063
6347
|
const total = value.candidates.reduce((sum, row) => sum + row.weight, 0);
|
|
6064
|
-
|
|
6348
|
+
const legacy = value.policyVersion === "high-cost-v1";
|
|
6349
|
+
return (legacy ? value.deferredHighCostCount === void 0 : value.deferredHighCostCount !== void 0 && value.candidates.length + value.deferredHighCostCount <= 512 && value.candidates.every((row) => row.highCost === value.candidates[0].highCost) && (!value.candidates[0].highCost || value.deferredHighCostCount === 0)) && new Set(value.candidates.map((row) => row.modelId)).size === value.candidates.length && value.candidates.some((row) => row.modelId === value.selectedModelId) && value.candidates.filter((row) => row.previous).length <= 1 && value.candidates.every((row) => row.weight === (row.highCost ? 2 : 10) * (row.previous && (legacy || !row.highCost) ? 1.5 : 1) / 10 && Math.abs(row.expectedShare - row.weight / total) <= 1e-12);
|
|
6065
6350
|
}, { message: "Invalid allocation policy evidence" });
|
|
6066
6351
|
//#endregion
|
|
6067
6352
|
//#region lib/types/auto-allocation-evidence.js
|
|
6068
6353
|
const AutoAllocationSummarySchema = object({
|
|
6069
|
-
policyVersion:
|
|
6354
|
+
policyVersion: _enum(AUTO_ALLOCATION_POLICIES),
|
|
6070
6355
|
scope: literal("viewed-session-host-lifetime"),
|
|
6071
6356
|
status: _enum(["observed", "not-collected"]),
|
|
6072
6357
|
retainedDecisions: number().int().nonnegative().max(128),
|
|
6073
6358
|
noFitDecisions: number().int().nonnegative().max(128),
|
|
6359
|
+
omittedPolicyDecisions: number().int().nonnegative().max(128).optional(),
|
|
6074
6360
|
rowsTruncated: boolean(),
|
|
6075
6361
|
completeHistory: literal(false),
|
|
6076
6362
|
observationStart: number().int().nonnegative().nullable(),
|
|
@@ -6521,6 +6807,219 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6521
6807
|
}))
|
|
6522
6808
|
};
|
|
6523
6809
|
//#endregion
|
|
6810
|
+
//#region lib/types/auto-allocation-diagnostics.js
|
|
6811
|
+
const AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS = 1024;
|
|
6812
|
+
const dayMs = 864e5;
|
|
6813
|
+
const integer$2 = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
6814
|
+
const version$2 = string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/);
|
|
6815
|
+
const assessmentOutcome = _enum([
|
|
6816
|
+
"local-known",
|
|
6817
|
+
"local-unknown",
|
|
6818
|
+
"semantic-known",
|
|
6819
|
+
"semantic-unknown",
|
|
6820
|
+
"disabled",
|
|
6821
|
+
"unavailable",
|
|
6822
|
+
"invalid-result",
|
|
6823
|
+
"timeout",
|
|
6824
|
+
"failed",
|
|
6825
|
+
"context-omitted"
|
|
6826
|
+
]);
|
|
6827
|
+
const allocationRow = object({
|
|
6828
|
+
day: integer$2.multipleOf(dayMs),
|
|
6829
|
+
version: version$2,
|
|
6830
|
+
policyVersion: string().min(1).max(64),
|
|
6831
|
+
modelId: string().min(1).max(512),
|
|
6832
|
+
targetCategory: _enum([
|
|
6833
|
+
"powerful",
|
|
6834
|
+
"versatile",
|
|
6835
|
+
"lightweight"
|
|
6836
|
+
]),
|
|
6837
|
+
category: _enum([
|
|
6838
|
+
"powerful",
|
|
6839
|
+
"versatile",
|
|
6840
|
+
"lightweight",
|
|
6841
|
+
"unknown"
|
|
6842
|
+
]),
|
|
6843
|
+
demand: _enum([
|
|
6844
|
+
"simple",
|
|
6845
|
+
"routine",
|
|
6846
|
+
"complex",
|
|
6847
|
+
"unknown"
|
|
6848
|
+
]),
|
|
6849
|
+
assessmentSource: _enum(["local", "semantic"]),
|
|
6850
|
+
assessmentOutcome: assessmentOutcome.optional(),
|
|
6851
|
+
method: _enum(["weighted-distribution", "only-candidate"]),
|
|
6852
|
+
fallback: boolean(),
|
|
6853
|
+
highCost: boolean(),
|
|
6854
|
+
previous: boolean(),
|
|
6855
|
+
weight: number().positive().max(1.5),
|
|
6856
|
+
opportunities: integer$2.min(1),
|
|
6857
|
+
expectedSelections: number().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
6858
|
+
selections: integer$2
|
|
6859
|
+
}).strict();
|
|
6860
|
+
const noFitRow = object({
|
|
6861
|
+
day: integer$2.multipleOf(dayMs),
|
|
6862
|
+
version: version$2,
|
|
6863
|
+
policyVersion: string().min(1).max(64),
|
|
6864
|
+
targetCategory: _enum([
|
|
6865
|
+
"powerful",
|
|
6866
|
+
"versatile",
|
|
6867
|
+
"lightweight"
|
|
6868
|
+
]),
|
|
6869
|
+
category: _enum([
|
|
6870
|
+
"powerful",
|
|
6871
|
+
"versatile",
|
|
6872
|
+
"lightweight",
|
|
6873
|
+
"unknown"
|
|
6874
|
+
]),
|
|
6875
|
+
demand: _enum([
|
|
6876
|
+
"simple",
|
|
6877
|
+
"routine",
|
|
6878
|
+
"complex",
|
|
6879
|
+
"unknown"
|
|
6880
|
+
]),
|
|
6881
|
+
assessmentSource: _enum(["local", "semantic"]),
|
|
6882
|
+
assessmentOutcome: assessmentOutcome.optional(),
|
|
6883
|
+
decisions: integer$2.min(1)
|
|
6884
|
+
}).strict();
|
|
6885
|
+
const AutoAllocationDiagnosticsSchema = object({
|
|
6886
|
+
status: _enum(["observed", "not-collected"]),
|
|
6887
|
+
rows: array(allocationRow).max(AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS),
|
|
6888
|
+
noFitRows: array(noFitRow).max(AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS),
|
|
6889
|
+
observationStart: integer$2.nullable(),
|
|
6890
|
+
observationEnd: integer$2.nullable(),
|
|
6891
|
+
completeHistory: literal(false),
|
|
6892
|
+
rowsTruncated: boolean(),
|
|
6893
|
+
dropped: integer$2,
|
|
6894
|
+
expired: integer$2,
|
|
6895
|
+
saturated: integer$2,
|
|
6896
|
+
restarts: integer$2
|
|
6897
|
+
}).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");
|
|
6898
|
+
//#endregion
|
|
6899
|
+
//#region lib/types/request-diagnostics.js
|
|
6900
|
+
const integer$1 = number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
6901
|
+
const composition = discriminatedUnion("state", [object({
|
|
6902
|
+
state: literal("complete"),
|
|
6903
|
+
totalBytes: integer$1,
|
|
6904
|
+
conversationBytes: integer$1,
|
|
6905
|
+
toolSchemaBytes: integer$1,
|
|
6906
|
+
systemBytes: integer$1,
|
|
6907
|
+
otherBytes: integer$1,
|
|
6908
|
+
imageBlockBytes: integer$1,
|
|
6909
|
+
opaqueReplayBytes: integer$1,
|
|
6910
|
+
remainingConversationBytes: integer$1
|
|
6911
|
+
}).strict(), object({
|
|
6912
|
+
state: _enum([
|
|
6913
|
+
"unavailable",
|
|
6914
|
+
"size-limit",
|
|
6915
|
+
"work-limit",
|
|
6916
|
+
"invalid-json",
|
|
6917
|
+
"unsupported-shape",
|
|
6918
|
+
"cancelled",
|
|
6919
|
+
"time-limit"
|
|
6920
|
+
]),
|
|
6921
|
+
totalBytes: integer$1.optional()
|
|
6922
|
+
}).strict()]);
|
|
6923
|
+
const upload = discriminatedUnion("state", [
|
|
6924
|
+
object({
|
|
6925
|
+
state: literal("observed"),
|
|
6926
|
+
bodyWrite: _enum(["observed", "not-observed"]),
|
|
6927
|
+
bodyWriteCompleteMs: integer$1.optional(),
|
|
6928
|
+
nativeResponseHeadersMs: integer$1.optional(),
|
|
6929
|
+
alpn: _enum([
|
|
6930
|
+
"h2",
|
|
6931
|
+
"http/1.1",
|
|
6932
|
+
"unavailable"
|
|
6933
|
+
]),
|
|
6934
|
+
nodeWritableBufferBytes: integer$1.optional()
|
|
6935
|
+
}).strict(),
|
|
6936
|
+
object({ state: _enum(["unavailable", "work-limit"]) }).strict(),
|
|
6937
|
+
object({
|
|
6938
|
+
state: literal("ambiguous"),
|
|
6939
|
+
requestCount: integer$1
|
|
6940
|
+
}).strict()
|
|
6941
|
+
]);
|
|
6942
|
+
const CredentialChangeReasonSchema = _enum([
|
|
6943
|
+
"qualified",
|
|
6944
|
+
"unknown-source",
|
|
6945
|
+
"account-changed",
|
|
6946
|
+
"endpoint-changed",
|
|
6947
|
+
"entitlements-changed",
|
|
6948
|
+
"expired",
|
|
6949
|
+
"auth-mismatch",
|
|
6950
|
+
"duplicate-notification",
|
|
6951
|
+
"missing-notification",
|
|
6952
|
+
"commit-mismatch",
|
|
6953
|
+
"write-failed",
|
|
6954
|
+
"write-conflict"
|
|
6955
|
+
]);
|
|
6956
|
+
const CredentialChangeSchema = object({
|
|
6957
|
+
changeId: string().uuid(),
|
|
6958
|
+
observedAt: integer$1,
|
|
6959
|
+
version: string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/),
|
|
6960
|
+
phase: _enum(["notification", "commit"]),
|
|
6961
|
+
reason: CredentialChangeReasonSchema,
|
|
6962
|
+
preparing: integer$1,
|
|
6963
|
+
dispatched: integer$1,
|
|
6964
|
+
alreadyAborted: integer$1,
|
|
6965
|
+
preserved: integer$1,
|
|
6966
|
+
revoked: integer$1
|
|
6967
|
+
}).strict();
|
|
6968
|
+
const RequestDiagnosticsSchema = object({
|
|
6969
|
+
rows: array(object({
|
|
6970
|
+
streamId: string().uuid(),
|
|
6971
|
+
dispatchIndex: integer$1.min(1),
|
|
6972
|
+
version: string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/),
|
|
6973
|
+
startedAt: integer$1,
|
|
6974
|
+
elapsedMs: integer$1,
|
|
6975
|
+
model: string().max(128).regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/),
|
|
6976
|
+
protocol: _enum([
|
|
6977
|
+
"openai-responses",
|
|
6978
|
+
"openai-completions",
|
|
6979
|
+
"anthropic-messages"
|
|
6980
|
+
]),
|
|
6981
|
+
composition,
|
|
6982
|
+
encoding: _enum([
|
|
6983
|
+
"identity",
|
|
6984
|
+
"gzip",
|
|
6985
|
+
"unknown"
|
|
6986
|
+
]),
|
|
6987
|
+
wireBytes: integer$1.optional(),
|
|
6988
|
+
upload: upload.optional(),
|
|
6989
|
+
responseHeadersMs: integer$1.optional(),
|
|
6990
|
+
httpStatus: integer$1.min(100).max(599).optional(),
|
|
6991
|
+
outcome: _enum([
|
|
6992
|
+
"http-error",
|
|
6993
|
+
"transport-error",
|
|
6994
|
+
"stream-done",
|
|
6995
|
+
"stream-error",
|
|
6996
|
+
"cancelled",
|
|
6997
|
+
"interrupted"
|
|
6998
|
+
]),
|
|
6999
|
+
reason: _enum([
|
|
7000
|
+
"none",
|
|
7001
|
+
"unknown",
|
|
7002
|
+
"request-body-timeout",
|
|
7003
|
+
"caller-abort",
|
|
7004
|
+
"credential-changed",
|
|
7005
|
+
"disposed",
|
|
7006
|
+
"byte-idle-timeout",
|
|
7007
|
+
"signal-abort"
|
|
7008
|
+
])
|
|
7009
|
+
}).strict()).max(128),
|
|
7010
|
+
dropped: integer$1,
|
|
7011
|
+
evicted: integer$1,
|
|
7012
|
+
pending: integer$1.max(128).optional(),
|
|
7013
|
+
interruptedOnReopen: integer$1.optional(),
|
|
7014
|
+
credentialChanges: object({
|
|
7015
|
+
rows: array(CredentialChangeSchema).max(128),
|
|
7016
|
+
dropped: integer$1,
|
|
7017
|
+
evicted: integer$1,
|
|
7018
|
+
pending: integer$1.max(128).optional(),
|
|
7019
|
+
interruptedOnReopen: integer$1.optional()
|
|
7020
|
+
}).strict().optional()
|
|
7021
|
+
}).strict();
|
|
7022
|
+
//#endregion
|
|
6524
7023
|
//#region lib/types/diagnostics-types.js
|
|
6525
7024
|
const DIAGNOSTICS_OPERATIONS = [
|
|
6526
7025
|
"account-global-switch",
|
|
@@ -6627,6 +7126,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6627
7126
|
epoch: integer,
|
|
6628
7127
|
updatedAt: integer,
|
|
6629
7128
|
rows: array(DiagnosticsRowSchema).max(DIAGNOSTICS_MAX_ROWS),
|
|
7129
|
+
autoAllocation: AutoAllocationDiagnosticsSchema.optional(),
|
|
7130
|
+
requests: RequestDiagnosticsSchema.optional(),
|
|
6630
7131
|
pending: array(DiagnosticsPendingSchema).max(128),
|
|
6631
7132
|
dropped: integer,
|
|
6632
7133
|
clientDropped: integer,
|
|
@@ -6637,6 +7138,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6637
7138
|
}).strict().refine((value) => value.pending.reduce((sum, row) => sum + row.count, 0) <= 128, "Diagnostics pending capacity exceeded").refine((value) => JSON.stringify(value).length <= DIAGNOSTICS_MAX_BYTES, "Diagnostics capacity exceeded");
|
|
6638
7139
|
const DiagnosticsViewSchema = object({
|
|
6639
7140
|
enabled: boolean(),
|
|
7141
|
+
autoAllocationEnabled: boolean(),
|
|
7142
|
+
requestEnabled: boolean().optional(),
|
|
6640
7143
|
state: _enum([
|
|
6641
7144
|
"loading",
|
|
6642
7145
|
"ready",
|
|
@@ -6728,6 +7231,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6728
7231
|
codec: strictRemoteCodec("dsh-github-copilot#DiagnosticsEnabled", boolean())
|
|
6729
7232
|
}]
|
|
6730
7233
|
},
|
|
7234
|
+
{
|
|
7235
|
+
method: "setAutoAllocationEnabled",
|
|
7236
|
+
parameters: [{
|
|
7237
|
+
name: "enabled",
|
|
7238
|
+
wire: "enabled",
|
|
7239
|
+
source: "json",
|
|
7240
|
+
codec: strictRemoteCodec("dsh-github-copilot#AutoAllocationDiagnosticsEnabled", boolean())
|
|
7241
|
+
}]
|
|
7242
|
+
},
|
|
7243
|
+
{
|
|
7244
|
+
method: "setRequestEnabled",
|
|
7245
|
+
parameters: [{
|
|
7246
|
+
name: "enabled",
|
|
7247
|
+
wire: "enabled",
|
|
7248
|
+
source: "json",
|
|
7249
|
+
codec: strictRemoteCodec("dsh-github-copilot#RequestDiagnosticsEnabled", boolean())
|
|
7250
|
+
}]
|
|
7251
|
+
},
|
|
6731
7252
|
{
|
|
6732
7253
|
method: "recordClient",
|
|
6733
7254
|
parameters: [{
|
|
@@ -6988,7 +7509,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6988
7509
|
};
|
|
6989
7510
|
//#endregion
|
|
6990
7511
|
//#region package.json
|
|
6991
|
-
var version = "0.4.
|
|
7512
|
+
var version = "0.4.2-alpha.11";
|
|
6992
7513
|
//#endregion
|
|
6993
7514
|
//#region lib/types/diagnostics-client.js
|
|
6994
7515
|
let owner;
|
|
@@ -7217,6 +7738,58 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7217
7738
|
};
|
|
7218
7739
|
}, [remote]);
|
|
7219
7740
|
const rows = view?.snapshot.rows ?? [];
|
|
7741
|
+
const requests = view?.snapshot.requests;
|
|
7742
|
+
const credentials = requests?.credentialChanges;
|
|
7743
|
+
const auto = view?.snapshot.autoAllocation;
|
|
7744
|
+
const autoOpportunities = auto?.rows.reduce((sum, row) => sum + row.opportunities, 0) ?? 0;
|
|
7745
|
+
const autoExpected = auto?.rows.reduce((sum, row) => sum + row.expectedSelections, 0) ?? 0;
|
|
7746
|
+
const autoSelections = auto?.rows.reduce((sum, row) => sum + row.selections, 0) ?? 0;
|
|
7747
|
+
const autoNoFit = auto?.noFitRows.reduce((sum, row) => sum + row.decisions, 0) ?? 0;
|
|
7748
|
+
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`;
|
|
7749
|
+
const autoRows = auto ? [...auto.rows.map((row) => ({
|
|
7750
|
+
key: JSON.stringify([
|
|
7751
|
+
row.day,
|
|
7752
|
+
row.version,
|
|
7753
|
+
row.policyVersion,
|
|
7754
|
+
row.modelId,
|
|
7755
|
+
row.targetCategory,
|
|
7756
|
+
row.category,
|
|
7757
|
+
row.demand,
|
|
7758
|
+
row.assessmentSource,
|
|
7759
|
+
row.assessmentOutcome,
|
|
7760
|
+
row.method,
|
|
7761
|
+
row.fallback,
|
|
7762
|
+
row.highCost,
|
|
7763
|
+
row.previous
|
|
7764
|
+
]),
|
|
7765
|
+
day: row.day,
|
|
7766
|
+
policy: row.policyVersion,
|
|
7767
|
+
model: row.modelId,
|
|
7768
|
+
cohort: `${row.targetCategory} → ${row.category} · ${row.demand} · ${row.assessmentSource} · assessment: ${row.assessmentOutcome ?? "not recorded"} · ${row.method}` + (row.fallback ? " · fallback" : "") + (row.highCost ? " · high-cost" : "") + (row.previous ? " · continuity" : ""),
|
|
7769
|
+
opportunities: row.opportunities,
|
|
7770
|
+
expected: row.expectedSelections,
|
|
7771
|
+
selected: row.selections,
|
|
7772
|
+
noFit: null
|
|
7773
|
+
})), ...auto.noFitRows.map((row) => ({
|
|
7774
|
+
key: JSON.stringify([
|
|
7775
|
+
row.day,
|
|
7776
|
+
row.version,
|
|
7777
|
+
row.policyVersion,
|
|
7778
|
+
row.targetCategory,
|
|
7779
|
+
row.category,
|
|
7780
|
+
row.demand,
|
|
7781
|
+
row.assessmentSource,
|
|
7782
|
+
row.assessmentOutcome
|
|
7783
|
+
]),
|
|
7784
|
+
day: row.day,
|
|
7785
|
+
policy: row.policyVersion,
|
|
7786
|
+
model: "—",
|
|
7787
|
+
cohort: `${row.targetCategory} → ${row.category} · ${row.demand} · ${row.assessmentSource} · assessment: ${row.assessmentOutcome ?? "not recorded"} · no fit`,
|
|
7788
|
+
opportunities: null,
|
|
7789
|
+
expected: null,
|
|
7790
|
+
selected: null,
|
|
7791
|
+
noFit: row.decisions
|
|
7792
|
+
}))].sort((left, right) => right.day - left.day || left.policy.localeCompare(right.policy) || left.model.localeCompare(right.model)) : [];
|
|
7220
7793
|
const populations = [...new Set(rows.filter((row) => row.operation !== "collection").map((row) => `${row.layer}/${row.operation}`))];
|
|
7221
7794
|
const count = (metrics, population) => rows.filter((row) => metrics.includes(row.metric) && `${row.layer}/${row.operation}` === population).reduce((sum, row) => sum + row.count, 0);
|
|
7222
7795
|
const control = (label, action, disabled = false) => (0, react.createElement)("button", {
|
|
@@ -7228,45 +7801,171 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7228
7801
|
return (0, react.createElement)("section", {
|
|
7229
7802
|
"aria-label": "Local diagnostics",
|
|
7230
7803
|
"data-copilot-native-ui": true,
|
|
7804
|
+
"data-copilot-diagnostics": true,
|
|
7231
7805
|
style: section
|
|
7232
|
-
}, (0, react.createElement)("style", null, nativeSettingsCss), (0, react.createElement)("h3", { style: nativeHeadingStyle }, "Local diagnostics"), (0, react.createElement)("p", { style: {
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
} }, "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", {
|
|
7237
|
-
role: "status",
|
|
7238
|
-
style: { margin: 0 }
|
|
7239
|
-
}, !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" : "")), failed ? (0, react.createElement)("p", {
|
|
7806
|
+
}, (0, react.createElement)("style", null, nativeSettingsCss + "\n[data-copilot-diagnostics] details { min-width: 0; }"), (0, react.createElement)("h3", { style: nativeHeadingStyle }, "Local diagnostics"), (0, react.createElement)("p", { style: {
|
|
7807
|
+
...nativeCaptionStyle,
|
|
7808
|
+
margin: 0
|
|
7809
|
+
} }, "Expand a diagnostic group to inspect its evidence. Collection controls are independent; opening a group does not enable collection."), failed ? (0, react.createElement)("p", {
|
|
7240
7810
|
role: "alert",
|
|
7241
7811
|
style: { margin: 0 }
|
|
7242
|
-
}, "Could not confirm the operation. Read status before retrying; no write is automatically replayed.") : null,
|
|
7243
|
-
|
|
7812
|
+
}, "Could not confirm the operation. Read status before retrying; no write is automatically replayed.") : null, (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Auto allocation observations", (0, react.createElement)("span", { style: {
|
|
7813
|
+
...nativeCaptionStyle,
|
|
7814
|
+
marginInlineStart: 8
|
|
7815
|
+
} }, !view ? "Status unknown" : `${view.autoAllocationEnabled ? "Enabled" : "Paused"} · ${auto ? `${autoRows.length} retained strata` : "Evidence unavailable"}`)), (0, react.createElement)("p", {
|
|
7816
|
+
role: "status",
|
|
7244
7817
|
style: { margin: 0 }
|
|
7245
|
-
}, "
|
|
7246
|
-
display: "flex",
|
|
7247
|
-
flexWrap: "wrap",
|
|
7248
|
-
gap: 8
|
|
7249
|
-
} }, control("Read status", () => {
|
|
7250
|
-
run((value) => value.get());
|
|
7251
|
-
}, !remote), control(view?.enabled ? "Pause collection" : "Enable local collection", () => {
|
|
7252
|
-
run((value) => value.setEnabled(!view?.enabled));
|
|
7253
|
-
}, !remote || !view || !view.enabled && view.state !== "ready"), control("Clear local aggregates", () => setConfirmClear(true), !remote || !view || view.state !== "ready")), confirmClear ? (0, react.createElement)("div", {
|
|
7254
|
-
role: "group",
|
|
7255
|
-
"aria-label": "Confirm clearing local diagnostics"
|
|
7256
|
-
}, (0, react.createElement)("p", null, "Delete collected aggregates only? Collection keeps its current enabled/paused setting. This does not clear account settings or conversation history."), control("Confirm clear", () => {
|
|
7257
|
-
setConfirmClear(false);
|
|
7258
|
-
run((value) => value.clear());
|
|
7259
|
-
}), control("Cancel", () => setConfirmClear(false))) : null, view && populations.length ? (0, react.createElement)("div", { style: {
|
|
7818
|
+
}, !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: {
|
|
7260
7819
|
overflowX: "auto",
|
|
7261
7820
|
minWidth: 0
|
|
7262
7821
|
} }, (0, react.createElement)("table", { style: {
|
|
7263
7822
|
width: "100%",
|
|
7264
7823
|
borderCollapse: "collapse",
|
|
7265
|
-
textAlign: "left"
|
|
7824
|
+
textAlign: "left",
|
|
7825
|
+
font: "inherit"
|
|
7266
7826
|
} }, (0, react.createElement)("caption", { style: {
|
|
7827
|
+
...nativeCaptionStyle,
|
|
7267
7828
|
textAlign: "left",
|
|
7268
7829
|
marginBottom: 8
|
|
7269
|
-
} }, "
|
|
7830
|
+
} }, "Daily aggregates by matching policy, model and decision cohort"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
|
|
7831
|
+
"Date (UTC)",
|
|
7832
|
+
"Policy",
|
|
7833
|
+
"Model",
|
|
7834
|
+
"Cohort",
|
|
7835
|
+
"Opportunities",
|
|
7836
|
+
"Expected",
|
|
7837
|
+
"Selected",
|
|
7838
|
+
"No-fit"
|
|
7839
|
+
].map((label) => (0, react.createElement)("th", {
|
|
7840
|
+
key: label,
|
|
7841
|
+
scope: "col",
|
|
7842
|
+
style: {
|
|
7843
|
+
padding: 6,
|
|
7844
|
+
font: "inherit",
|
|
7845
|
+
fontWeight: 500,
|
|
7846
|
+
textAlign: label === "Cohort" || label === "Model" ? "left" : "right"
|
|
7847
|
+
}
|
|
7848
|
+
}, label)))), (0, react.createElement)("tbody", null, ...autoRows.map((row) => (0, react.createElement)("tr", { key: row.key }, (0, react.createElement)("td", { style: {
|
|
7849
|
+
padding: 6,
|
|
7850
|
+
whiteSpace: "nowrap"
|
|
7851
|
+
} }, new Date(row.day).toISOString().slice(0, 10)), (0, react.createElement)("td", { style: {
|
|
7852
|
+
padding: 6,
|
|
7853
|
+
overflowWrap: "anywhere"
|
|
7854
|
+
} }, row.policy), (0, react.createElement)("td", { style: {
|
|
7855
|
+
padding: 6,
|
|
7856
|
+
overflowWrap: "anywhere"
|
|
7857
|
+
} }, row.model), (0, react.createElement)("td", { style: {
|
|
7858
|
+
padding: 6,
|
|
7859
|
+
minWidth: 220
|
|
7860
|
+
} }, row.cohort), (0, react.createElement)("td", { style: {
|
|
7861
|
+
padding: 6,
|
|
7862
|
+
textAlign: "right"
|
|
7863
|
+
} }, row.opportunities ?? "—"), (0, react.createElement)("td", { style: {
|
|
7864
|
+
padding: 6,
|
|
7865
|
+
textAlign: "right"
|
|
7866
|
+
} }, row.expected === null ? "—" : row.expected.toFixed(3)), (0, react.createElement)("td", { style: {
|
|
7867
|
+
padding: 6,
|
|
7868
|
+
textAlign: "right"
|
|
7869
|
+
} }, row.selected ?? "—"), (0, react.createElement)("td", { style: {
|
|
7870
|
+
padding: 6,
|
|
7871
|
+
textAlign: "right"
|
|
7872
|
+
} }, 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: {
|
|
7873
|
+
...nativeCaptionStyle,
|
|
7874
|
+
margin: 0
|
|
7875
|
+
} }, `${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. Assessment outcomes explain classification only, not the supplier root cause. Legacy reasons are not recorded; sum Selected or No-fit, not candidate opportunities, when counting decisions by outcome.`) : null), view ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Physical request observations", (0, react.createElement)("span", { style: {
|
|
7876
|
+
...nativeCaptionStyle,
|
|
7877
|
+
marginInlineStart: 8
|
|
7878
|
+
} }, `${view.requestEnabled === void 0 ? "Status unknown" : view.requestEnabled ? "Enabled" : "Paused"} · ${requests?.rows.length ?? 0} retained`)), (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: {
|
|
7879
|
+
...nativeCaptionStyle,
|
|
7880
|
+
margin: 0
|
|
7881
|
+
} }, "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: {
|
|
7882
|
+
overflowX: "auto",
|
|
7883
|
+
minWidth: 0
|
|
7884
|
+
} }, (0, react.createElement)("table", { style: {
|
|
7885
|
+
width: "100%",
|
|
7886
|
+
borderCollapse: "collapse",
|
|
7887
|
+
textAlign: "left",
|
|
7888
|
+
font: "inherit"
|
|
7889
|
+
} }, (0, react.createElement)("caption", { style: {
|
|
7890
|
+
...nativeCaptionStyle,
|
|
7891
|
+
textAlign: "left",
|
|
7892
|
+
marginBottom: 8
|
|
7893
|
+
} }, "Latest retained physical requests"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
|
|
7894
|
+
"Time (UTC)",
|
|
7895
|
+
"Model",
|
|
7896
|
+
"Outcome / reason",
|
|
7897
|
+
"HTTP",
|
|
7898
|
+
"JSON / wire bytes",
|
|
7899
|
+
"Headers / body-write ms"
|
|
7900
|
+
].map((label) => (0, react.createElement)("th", {
|
|
7901
|
+
key: label,
|
|
7902
|
+
scope: "col",
|
|
7903
|
+
style: {
|
|
7904
|
+
padding: 6,
|
|
7905
|
+
font: "inherit",
|
|
7906
|
+
fontWeight: 500
|
|
7907
|
+
}
|
|
7908
|
+
}, 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: {
|
|
7909
|
+
padding: 6,
|
|
7910
|
+
whiteSpace: "nowrap"
|
|
7911
|
+
} }, new Date(row.startedAt).toISOString()), (0, react.createElement)("td", { style: {
|
|
7912
|
+
padding: 6,
|
|
7913
|
+
overflowWrap: "anywhere"
|
|
7914
|
+
} }, row.model), (0, react.createElement)("td", { style: {
|
|
7915
|
+
padding: 6,
|
|
7916
|
+
overflowWrap: "anywhere"
|
|
7917
|
+
} }, `${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 ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Credential change observations", (0, react.createElement)("span", { style: {
|
|
7918
|
+
...nativeCaptionStyle,
|
|
7919
|
+
marginInlineStart: 8
|
|
7920
|
+
} }, credentials ? `${credentials.rows.length} retained` : "Not recorded")), (0, react.createElement)("p", { style: {
|
|
7921
|
+
...nativeCaptionStyle,
|
|
7922
|
+
margin: 0
|
|
7923
|
+
} }, "Uses the independent request-observation consent. Fixed qualification and commit reasons only; no credentials, account or Session identifiers. Unknown source does not identify an external writer. Counts describe live managed wires at each observation, not native retries or successful completion."), credentials ? (0, react.createElement)("p", { style: { margin: 0 } }, `${credentials.dropped} dropped · ${credentials.evicted} expired/evicted · ${credentials.pending ?? 0} sampled pending · ${credentials.interruptedOnReopen ?? 0} interrupted on reopen. Matching random change IDs join notification and commit observations only; no historical incident is reconstructed.`) : (0, react.createElement)("p", { style: { margin: 0 } }, "Credential-change evidence was not recorded in this snapshot. This does not establish zero changes or failures."), credentials?.rows.length ? (0, react.createElement)("div", { style: {
|
|
7924
|
+
overflowX: "auto",
|
|
7925
|
+
minWidth: 0
|
|
7926
|
+
} }, (0, react.createElement)("table", { style: {
|
|
7927
|
+
width: "100%",
|
|
7928
|
+
borderCollapse: "collapse",
|
|
7929
|
+
textAlign: "left",
|
|
7930
|
+
font: "inherit"
|
|
7931
|
+
} }, (0, react.createElement)("caption", { style: {
|
|
7932
|
+
...nativeCaptionStyle,
|
|
7933
|
+
textAlign: "left",
|
|
7934
|
+
marginBottom: 8
|
|
7935
|
+
} }, "Latest retained credential-change decisions"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
|
|
7936
|
+
"Time (UTC)",
|
|
7937
|
+
"Change ID",
|
|
7938
|
+
"Phase / reason",
|
|
7939
|
+
"Preparing / dispatched",
|
|
7940
|
+
"Preserved / revoked",
|
|
7941
|
+
"Already aborted"
|
|
7942
|
+
].map((label) => (0, react.createElement)("th", {
|
|
7943
|
+
key: label,
|
|
7944
|
+
scope: "col",
|
|
7945
|
+
style: {
|
|
7946
|
+
padding: 6,
|
|
7947
|
+
font: "inherit",
|
|
7948
|
+
fontWeight: 500
|
|
7949
|
+
}
|
|
7950
|
+
}, label)))), (0, react.createElement)("tbody", null, ...credentials.rows.slice().sort((left, right) => right.observedAt - left.observedAt).map((row, index) => (0, react.createElement)("tr", { key: `${row.changeId}/${row.phase}/${index}` }, (0, react.createElement)("td", { style: {
|
|
7951
|
+
padding: 6,
|
|
7952
|
+
whiteSpace: "nowrap"
|
|
7953
|
+
} }, new Date(row.observedAt).toISOString()), (0, react.createElement)("td", { style: {
|
|
7954
|
+
padding: 6,
|
|
7955
|
+
overflowWrap: "anywhere"
|
|
7956
|
+
} }, row.changeId), (0, react.createElement)("td", { style: { padding: 6 } }, `${row.phase} / ${row.reason}`), (0, react.createElement)("td", { style: { padding: 6 } }, `${row.preparing} / ${row.dispatched}`), (0, react.createElement)("td", { style: { padding: 6 } }, `${row.preserved} / ${row.revoked}`), (0, react.createElement)("td", { style: { padding: 6 } }, row.alreadyAborted)))))) : null) : null, view && populations.length ? (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Account and compaction observations"), (0, react.createElement)("div", { style: {
|
|
7957
|
+
overflowX: "auto",
|
|
7958
|
+
minWidth: 0
|
|
7959
|
+
} }, (0, react.createElement)("table", { style: {
|
|
7960
|
+
width: "100%",
|
|
7961
|
+
borderCollapse: "collapse",
|
|
7962
|
+
textAlign: "left",
|
|
7963
|
+
font: "inherit"
|
|
7964
|
+
} }, (0, react.createElement)("caption", { style: {
|
|
7965
|
+
...nativeCaptionStyle,
|
|
7966
|
+
textAlign: "left",
|
|
7967
|
+
marginBottom: 8
|
|
7968
|
+
} }, "Independent Client and Host populations"), (0, react.createElement)("thead", null, (0, react.createElement)("tr", null, ...[
|
|
7270
7969
|
"Population",
|
|
7271
7970
|
"Started",
|
|
7272
7971
|
"Success",
|
|
@@ -7277,10 +7976,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7277
7976
|
].map((label) => (0, react.createElement)("th", {
|
|
7278
7977
|
key: label,
|
|
7279
7978
|
scope: "col",
|
|
7280
|
-
style: {
|
|
7979
|
+
style: {
|
|
7980
|
+
padding: 6,
|
|
7981
|
+
font: "inherit",
|
|
7982
|
+
fontWeight: 500
|
|
7983
|
+
}
|
|
7281
7984
|
}, label)))), (0, react.createElement)("tbody", null, ...populations.map((population) => (0, react.createElement)("tr", { key: population }, (0, react.createElement)("th", {
|
|
7282
7985
|
scope: "row",
|
|
7283
|
-
style: {
|
|
7986
|
+
style: {
|
|
7987
|
+
padding: 6,
|
|
7988
|
+
font: "inherit",
|
|
7989
|
+
fontWeight: 500
|
|
7990
|
+
}
|
|
7284
7991
|
}, population), ...[
|
|
7285
7992
|
"started",
|
|
7286
7993
|
"success",
|
|
@@ -7296,12 +8003,35 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7296
8003
|
"revoked",
|
|
7297
8004
|
"environment-fault",
|
|
7298
8005
|
"unknown"
|
|
7299
|
-
], population))))))) : null, view && !populations.length ? (0, react.createElement)("p", null, "No retained operation observations. This is not evidence of zero failures.") : null, view ? (0, react.createElement)("p", { style: {
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
8006
|
+
], 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: {
|
|
8007
|
+
...nativeCaptionStyle,
|
|
8008
|
+
margin: 0
|
|
8009
|
+
} }, "Separate opt-in: retain at most 128 content-free physical requests and 128 credential-change observations for 24 hours within the shared storage cap. Includes model, payload byte counts, transport timing, HTTP status, terminal categories and fixed credential qualification reasons, 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", {
|
|
8010
|
+
role: "status",
|
|
8011
|
+
style: { margin: 0 }
|
|
8012
|
+
}, !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" : "")), clientDiagnosticsReportingFailed() ? (0, react.createElement)("p", {
|
|
8013
|
+
role: "alert",
|
|
8014
|
+
style: { margin: 0 }
|
|
8015
|
+
}, "Some Client observations could not be confirmed. Client counts are incomplete; Host counts are separate.") : null, (0, react.createElement)("div", { style: {
|
|
8016
|
+
display: "flex",
|
|
8017
|
+
flexWrap: "wrap",
|
|
8018
|
+
gap: 8
|
|
8019
|
+
} }, control("Read status", () => {
|
|
8020
|
+
run((value) => value.get());
|
|
8021
|
+
}, !remote), control(view?.enabled ? "Pause collection" : "Enable local collection", () => {
|
|
8022
|
+
run((value) => value.setEnabled(!view?.enabled));
|
|
8023
|
+
}, !remote || !view || !view.enabled && view.state !== "ready"), control(view?.autoAllocationEnabled ? "Pause Auto allocation observation" : "Enable Auto allocation observation", () => {
|
|
8024
|
+
run((value) => value.setAutoAllocationEnabled(!view?.autoAllocationEnabled));
|
|
8025
|
+
}, !remote || !view || !view.autoAllocationEnabled && view.state !== "ready"), control(view?.requestEnabled ? "Pause request observations" : "Enable request observations", () => {
|
|
8026
|
+
run((value) => value.setRequestEnabled(!view?.requestEnabled));
|
|
8027
|
+
}, !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", {
|
|
8028
|
+
role: "group",
|
|
8029
|
+
"aria-label": "Confirm clearing local diagnostics"
|
|
8030
|
+
}, (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", () => {
|
|
8031
|
+
setConfirmClear(false);
|
|
8032
|
+
run((value) => value.clear());
|
|
8033
|
+
}), 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", {
|
|
8034
|
+
"aria-label": requests ? "Local diagnostics JSON" : "Local diagnostics aggregate JSON",
|
|
7305
8035
|
readOnly: true,
|
|
7306
8036
|
value: JSON.stringify(view, null, 2),
|
|
7307
8037
|
rows: 12,
|
|
@@ -7310,7 +8040,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7310
8040
|
boxSizing: "border-box",
|
|
7311
8041
|
font: "inherit"
|
|
7312
8042
|
}
|
|
7313
|
-
}) : null) : null);
|
|
8043
|
+
}) : null)) : null);
|
|
7314
8044
|
}
|
|
7315
8045
|
//#endregion
|
|
7316
8046
|
//#region lib/types/reasoning-presentation.js
|
|
@@ -7686,7 +8416,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7686
8416
|
const conclusion = explanation.method === "no-fit" ? zh ? "没有候选能直接容纳估算输入;选中输入预算最大的模型,保留原生压缩或失败处理。" : "No candidate fits the estimated input. Selected the largest input budget for native recovery or failure." : explanation.fallback ? zh ? `目标分类 ${category[explanation.targetCategory]} 没有合格的可容纳候选,回退到 ${category[explanation.selectedCategory]}。` : `No eligible fitting ${category[explanation.targetCategory]} candidate; fell back to ${category[explanation.selectedCategory]}.` : explanation.assessment.diagnostic === "timeout" && explanation.assessment.demand === "unknown" ? zh ? `任务难度判断超时,需求仍不确定;按当前偏好兜底选择 ${category[explanation.selectedCategory]}。` : `Task assessment timed out; demand remains uncertain. The preference policy selected ${category[explanation.selectedCategory]} as a fallback.` : zh ? `本轮判断为${demand[explanation.assessment.demand]};按当前偏好选择 ${category[explanation.selectedCategory]} 类模型。` : `This task was assessed as ${demand[explanation.assessment.demand]}; the preference policy selected ${category[explanation.selectedCategory]}.`;
|
|
7687
8417
|
const allocation = explanation.allocation;
|
|
7688
8418
|
const selected = allocation?.candidates.find((row) => row.modelId === allocation.selectedModelId);
|
|
7689
|
-
const
|
|
8419
|
+
const tier = allocation?.policyVersion !== "high-cost-v2" ? "" : (allocation.deferredHighCostCount ?? 0) > 0 ? zh ? `本轮成本层有未标记候选,暂缓 ${allocation.deferredHighCostCount} 个同类高成本候选。` : `The unmarked cost tier deferred ${allocation.deferredHighCostCount} fitting high-cost category candidates.` : selected?.highCost ? zh ? "该分类无可容纳的未标记候选,使用高成本兜底层;高成本模型不享受连续性加权。" : "No fitting unmarked candidate exists in this category; the high-cost fallback tier has no continuity bonus." : "";
|
|
8420
|
+
const weightedChoice = explanation.method === "weighted-distribution" ? selected === void 0 ? zh ? "按同类正权重政策分配;本轮候选观察未保留,不从当前设置推断。连续性仅为有限加权。" : "Allocated by positive within-category weights. Candidate observations were not retained; current settings cannot reconstruct them. Continuity is a finite bonus." : zh ? `在 ${explanation.categoryCandidateCount} 个同类可容纳候选中按正权重分配;选中模型${selected.highCost ? "已标记高成本" : "未标记高成本"},有效权重 ${selected.weight},本轮条件份额 ${(selected.expectedShare * 100).toFixed(1)}%。连续性仅为有限加权,不保证保留;这不是质量排名或实际费用。` : `Positive weighted allocation among ${explanation.categoryCandidateCount} fitting category candidates. Selected model is ${selected.highCost ? "marked high cost" : "unmarked"}, effective weight ${selected.weight}, conditional share ${(selected.expectedShare * 100).toFixed(1)}%. Continuity is a finite bonus, not a lock; this is not quality ranking or actual cost.` : explanation.method === "continuity" ? zh ? `该分类有 ${explanation.categoryCandidateCount} 个可容纳候选;上一轮模型仍合格,因此按连续性策略保留。这不是语义排名,也不证明它最适合任务。` : `This category has ${explanation.categoryCandidateCount} fitting candidates. Kept the previous model because it remains eligible, prioritizing continuity; this is not a semantic ranking or proof it is best for the task.` : explanation.method === "only-candidate" ? zh ? "该分类只有一个可容纳的合格候选。" : "Only one eligible fitting candidate remains in this category." : explanation.method === "equal-distribution" ? zh ? `该分类有 ${explanation.categoryCandidateCount} 个可容纳候选;按本轮稳定等权规则选中,不代表质量排名。` : `Selected among ${explanation.categoryCandidateCount} fitting category candidates by stable equal-weight allocation, not a quality ranking.` : zh ? "所有候选均不适配;这不是成功的偏好匹配。" : "All candidates are oversized; this is not a successful preference match.";
|
|
8421
|
+
const choice = tier === "" ? weightedChoice : `${tier} ${weightedChoice}`;
|
|
7690
8422
|
const diagnostic = explanation.assessment.diagnostic === void 0 ? void 0 : explanation.assessment.diagnostic === "disabled" ? zh ? "语义判断实验未开启;这是本地规则的判断边界,不代表会话没有上下文。" : "Semantic assessment is disabled; this is a limit of local rules, not proof that the conversation lacks context." : explanation.assessment.diagnostic === "timeout" ? zh ? "辅助判断未在等待预算内完成,不代表正式回答超时或任务简单;本轮保留需求不确定,再按偏好策略选模。" : "The auxiliary assessment did not complete within its waiting budget. This is not a timeout of the main answer or evidence of simplicity; selection used the unknown-demand preference policy." : zh ? `语义判断未提供完整可用依据(${{
|
|
7691
8423
|
unavailable: "没有可用分类模型",
|
|
7692
8424
|
"invalid-result": "结果无效",
|
|
@@ -7701,21 +8433,44 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7701
8433
|
"context-omitted": "incomplete context"
|
|
7702
8434
|
}[explanation.assessment.diagnostic]}); failure was not treated as simplicity.`;
|
|
7703
8435
|
const evidence = explanation.assessment.semantic;
|
|
8436
|
+
const scan = evidence?.candidateScan;
|
|
8437
|
+
const rejectionLabels = {
|
|
8438
|
+
excluded: zh ? "已排除" : "excluded",
|
|
8439
|
+
"configured-id": zh ? "非指定模型" : "configured ID mismatch",
|
|
8440
|
+
category: zh ? "非轻量分类" : "not lightweight",
|
|
8441
|
+
input: zh ? "不支持文本" : "text unsupported",
|
|
8442
|
+
"reasoning-disable-unproven": zh ? "关闭 reasoning 未获证明" : "reasoning disable unproven",
|
|
8443
|
+
budget: zh ? "输入预算不足" : "insufficient input budget"
|
|
8444
|
+
};
|
|
8445
|
+
const candidateDetail = scan === void 0 ? "" : zh ? ` 候选检查:${scan.candidates} 个模型,${scan.eligible} 个合格。首个排除原因:${Object.entries(scan.rejected).filter(([, count]) => count > 0).map(([reason, count]) => `${rejectionLabels[reason]} ${count}`).join(";") || "无"}。` : ` Candidate scan: ${scan.candidates} models, ${scan.eligible} eligible. First rejection reasons: ${Object.entries(scan.rejected).filter(([, count]) => count > 0).map(([reason, count]) => `${rejectionLabels[reason]} ${count}`).join("; ") || "none"}.`;
|
|
8446
|
+
const preparationDetail = evidence?.preparationFailure === void 0 ? "" : zh ? " 原生模型准备未提供 off 控制;未发起分类调用。" : "Native model preparation did not expose off; classifier call was not started.";
|
|
8447
|
+
const projection = evidence?.projection;
|
|
8448
|
+
const projectionDetail = projection === void 0 ? "" : zh ? ` 判断文本:保留 ${projection.retainedMessages} 条;历史省略${projection.historyOmitted ? "有" : "无"};任务文本${projection.taskTextLimited ? "受限" : "已保留"};续接目标${{
|
|
8449
|
+
"not-needed": "不适用",
|
|
8450
|
+
retained: "已保留",
|
|
8451
|
+
missing: "未找到"
|
|
8452
|
+
}[projection.continuationAnchor]}。文本保留不保证语义信息充分。` : ` Assessment text: ${projection.retainedMessages} rows retained; historical omissions ${projection.historyOmitted ? "present" : "absent"}; task text ${projection.taskTextLimited ? "limited" : "retained"}; continuation anchor ${{
|
|
8453
|
+
"not-needed": "not applicable",
|
|
8454
|
+
retained: "retained",
|
|
8455
|
+
missing: "missing"
|
|
8456
|
+
}[projection.continuationAnchor]}. Retained text does not guarantee sufficient task evidence.`;
|
|
8457
|
+
const classifierDetail = evidence?.classifierDemand === void 0 ? "" : zh ? ` 分类器返回:${demand[evidence.classifierDemand]}。` : ` Classifier returned: ${evidence.classifierDemand}.`;
|
|
8458
|
+
const semantic = evidence === void 0 ? void 0 : zh ? `辅助分类模型:${evidence.modelId ?? "未选定"}。判断总耗时 ${evidence.elapsedMs} ms,等待预算 ${evidence.budgetMs} ms。${evidence.adapterStartedMs === void 0 ? "尚未开始适配器调用。" : `适配器调用始于 ${evidence.adapterStartedMs} ms。`}${evidence.firstTextMs === void 0 ? "未观察到文本输出。" : `首次文本输出于 ${evidence.firstTextMs} ms。`}${evidence.nativeFinish === void 0 ? "未观察到原生结束。" : evidence.nativeFinish === "stop" ? "观察到原生正常结束。" : "观察到原生非正常结束。"}结果校验:${{
|
|
8459
|
+
"not-validated": "未完成",
|
|
8460
|
+
valid: "通过",
|
|
8461
|
+
invalid: "无效",
|
|
8462
|
+
"context-omitted": "通过格式校验,但上下文省略阻止降级"
|
|
8463
|
+
}[evidence.validation]}。这些是辅助判断阶段,不证明网络或模型慢的具体原因,也不是正式回答的 Usage。` : `Auxiliary classifier: ${evidence.modelId ?? "not selected"}. Assessment total ${evidence.elapsedMs} ms; budget ${evidence.budgetMs} ms. ${evidence.adapterStartedMs === void 0 ? "Adapter call not started." : `Adapter call started at ${evidence.adapterStartedMs} ms.`} ${evidence.firstTextMs === void 0 ? "No text output observed." : `First text at ${evidence.firstTextMs} ms.`} ${evidence.nativeFinish === void 0 ? "No native finish observed." : evidence.nativeFinish === "stop" ? "Native stop observed." : "Native non-stop finish observed."} Result validation: ${{
|
|
8464
|
+
"not-validated": "not completed",
|
|
8465
|
+
valid: "passed",
|
|
8466
|
+
invalid: "invalid",
|
|
8467
|
+
"context-omitted": "format passed; omitted context prevented downshift"
|
|
8468
|
+
}[evidence.validation]}. These auxiliary milestones do not prove a network/model latency cause and are not main-answer Usage.`;
|
|
7704
8469
|
return {
|
|
7705
8470
|
conclusion,
|
|
7706
8471
|
choice,
|
|
7707
8472
|
diagnostic,
|
|
7708
|
-
semantic:
|
|
7709
|
-
"not-validated": "未完成",
|
|
7710
|
-
valid: "通过",
|
|
7711
|
-
invalid: "无效",
|
|
7712
|
-
"context-omitted": "通过格式校验,但上下文省略阻止降级"
|
|
7713
|
-
}[evidence.validation]}。这些是辅助判断阶段,不证明网络或模型慢的具体原因,也不是正式回答的 Usage。` : `Auxiliary classifier: ${evidence.modelId ?? "not selected"}. Assessment total ${evidence.elapsedMs} ms; budget ${evidence.budgetMs} ms. ${evidence.adapterStartedMs === void 0 ? "Adapter call not started." : `Adapter call started at ${evidence.adapterStartedMs} ms.`} ${evidence.firstTextMs === void 0 ? "No text output observed." : `First text at ${evidence.firstTextMs} ms.`} ${evidence.nativeFinish === void 0 ? "No native finish observed." : evidence.nativeFinish === "stop" ? "Native stop observed." : "Native non-stop finish observed."} Result validation: ${{
|
|
7714
|
-
"not-validated": "not completed",
|
|
7715
|
-
valid: "passed",
|
|
7716
|
-
invalid: "invalid",
|
|
7717
|
-
"context-omitted": "format passed; omitted context prevented downshift"
|
|
7718
|
-
}[evidence.validation]}. These auxiliary milestones do not prove a network/model latency cause and are not main-answer Usage.`,
|
|
8473
|
+
semantic: semantic === void 0 ? void 0 : `${semantic}${candidateDetail}${preparationDetail}${projectionDetail}${classifierDetail}`,
|
|
7719
8474
|
assessment: `${zh ? "判断来源:" : "Assessment: "}${explanation.assessment.source === "semantic" ? zh ? "语义分类" : "semantic classification" : zh ? "本地规则" : "local rules"}${explanation.assessment.signals.length ? ` — ${explanation.assessment.signals.map((signal) => signals[signal]).join(zh ? "、" : ", ")}` : ""}`
|
|
7720
8475
|
};
|
|
7721
8476
|
}
|
|
@@ -8221,7 +8976,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8221
8976
|
return (0, react.createElement)("details", null, (0, react.createElement)("summary", null, zh ? "Auto 分配观察(当前 Session)" : "Auto allocation observations (this Session)"), (0, react.createElement)("p", null, zh ? "仅保留 Host 生命周期内最近最多 128 轮;重启、淘汰和缺失记录不代表零使用。这是选择观察,不是执行、质量或费用证明。" : "Up to 128 recent retained turns in this Host lifetime. Restart, eviction and missing records are not zero usage. These are selection observations, not execution, quality or billing."), failed ? (0, react.createElement)("div", { role: "alert" }, zh ? "读取分配观察失败。" : "Could not read allocation observations.", (0, react.createElement)("button", {
|
|
8222
8977
|
type: "button",
|
|
8223
8978
|
onClick: () => setAttempt((value) => value + 1)
|
|
8224
|
-
}, zh ? "重试" : "Retry")) : summary === void 0 ? (0, react.createElement)("p", { role: "status" }, zh ? "正在读取…" : "Reading…") : (0, react.createElement)("div", null, (0, react.createElement)("p", null, `${summary.policyVersion} · ${summary.retainedDecisions} ${zh ? "次保留分配" : "retained allocations"} · ${summary.noFitDecisions} ${zh ? "次无适配候选" : "no-fit decisions"}`), summary.observationStart === null || summary.observationEnd === null ? null : (0, react.createElement)("p", null, `${new Date(summary.observationStart).toLocaleString()} — ${new Date(summary.observationEnd).toLocaleString()}`), summary.status === "not-collected" ? (0, react.createElement)("p", null, zh ? "尚无保留样本。" : "No retained samples.") : null, summary.rowsTruncated ? (0, react.createElement)("p", { role: "status" }, zh ? "候选明细达到上限;导出不完整。" : "Candidate detail limit reached; export is incomplete.") : null, (0, react.createElement)("p", null, zh ? "导出包含模型 ID 与分配计数,不包含对话内容;不会自动上传。跨 Session 汇总和效果判断需另行审阅。" : "Export contains model IDs and allocation counts, not conversation content. Nothing is uploaded automatically. Cross-Session aggregation and effectiveness require a separate review."), (0, react.createElement)("label", { style: {
|
|
8979
|
+
}, zh ? "重试" : "Retry")) : summary === void 0 ? (0, react.createElement)("p", { role: "status" }, zh ? "正在读取…" : "Reading…") : (0, react.createElement)("div", null, (0, react.createElement)("p", null, `${summary.policyVersion} · ${summary.retainedDecisions} ${zh ? "次保留分配" : "retained allocations"} · ${summary.noFitDecisions} ${zh ? "次无适配候选" : "no-fit decisions"}`), summary.observationStart === null || summary.observationEnd === null ? null : (0, react.createElement)("p", null, `${new Date(summary.observationStart).toLocaleString()} — ${new Date(summary.observationEnd).toLocaleString()}`), summary.status === "not-collected" ? (0, react.createElement)("p", null, zh ? "尚无保留样本。" : "No retained samples.") : null, summary.rowsTruncated ? (0, react.createElement)("p", { role: "status" }, zh ? "候选明细达到上限;导出不完整。" : "Candidate detail limit reached; export is incomplete.") : null, (summary.omittedPolicyDecisions ?? 0) > 0 ? (0, react.createElement)("p", { role: "status" }, zh ? `另有 ${summary.omittedPolicyDecisions} 次不同策略版本的分配,未混入本汇总。` : `${summary.omittedPolicyDecisions} allocations from another policy version are excluded from this summary.`) : null, (0, react.createElement)("p", null, zh ? "导出包含模型 ID 与分配计数,不包含对话内容;不会自动上传。跨 Session 汇总和效果判断需另行审阅。" : "Export contains model IDs and allocation counts, not conversation content. Nothing is uploaded automatically. Cross-Session aggregation and effectiveness require a separate review."), (0, react.createElement)("label", { style: {
|
|
8225
8980
|
display: "grid",
|
|
8226
8981
|
gap: 6
|
|
8227
8982
|
} }, zh ? "只读本地观察 JSON" : "Read-only local observation JSON", (0, react.createElement)("textarea", {
|