dsh-github-copilot 0.4.0 → 0.4.2-alpha.10
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 +34 -3
- package/CHANGELOG.md +120 -0
- package/README.md +63 -21
- package/README.zh.md +48 -17
- package/deployment-baseline.json +25 -2
- package/docs/auto-high-cost.md +20 -8
- package/docs/auto-iteration-review.json +12 -12
- package/docs/auto-task-routing.md +85 -10
- package/docs/copilot-accounts.md +39 -0
- package/docs/copilot-compaction.md +1 -1
- package/docs/npm-distribution.md +9 -1
- package/docs/plugin-diagnostics.md +159 -6
- package/lib/client.js +774 -52
- package/lib/client.js.map +1 -1
- package/lib/diagnostics-analysis.js +4 -2
- package/lib/diagnostics-types-C1BD6ayS.js +655 -0
- package/lib/index.js +1894 -1046
- package/lib/manual-compaction-recovery.js +1 -1
- package/lib/remote.js +253 -1
- package/lib/routed-web.js +1 -1
- package/lib/types/auto-allocation-diagnostics.d.ts +126 -0
- package/lib/types/auto-assessment-evidence.d.ts +32 -0
- package/lib/types/auto-model-host.d.ts +1 -0
- package/lib/types/auto-task-assessment.d.ts +1 -0
- 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 +7 -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 +9 -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.d.ts +18 -1
- package/package.json +12 -11
- package/lib/diagnostics-types-FVf6zjob.js +0 -182
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as diagnosticsReason, u as diagnosticsOutcome } from "./diagnostics-types-FVf6zjob.js";
|
|
2
1
|
import "./copilot-identity-DRZY_d2X.js";
|
|
2
|
+
import { d as diagnosticsReason, u as diagnosticsOutcome } from "./diagnostics-types-C1BD6ayS.js";
|
|
3
3
|
import { i as resolveRequestBudgetPolicy, r as calculateRequestBudget } from "./request-budget-DLY_aRq0.js";
|
|
4
4
|
import z from "@deepseek-ai/schemastery";
|
|
5
5
|
import { LlmError, createUserMessage } from "@deepseek-ai/dsh-llm";
|
package/lib/remote.js
CHANGED
|
@@ -231,6 +231,20 @@ const contribution$7 = {
|
|
|
231
231
|
//#endregion
|
|
232
232
|
//#region lib/types/auto-assessment-evidence.js
|
|
233
233
|
const milliseconds = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
234
|
+
const candidateCount = z.number().int().min(0).max(512);
|
|
235
|
+
const ClassifierRejectionSchema = z.enum([
|
|
236
|
+
"excluded",
|
|
237
|
+
"configured-id",
|
|
238
|
+
"category",
|
|
239
|
+
"input",
|
|
240
|
+
"reasoning-disable-unproven",
|
|
241
|
+
"budget"
|
|
242
|
+
]);
|
|
243
|
+
const candidateScan = z.object({
|
|
244
|
+
candidates: candidateCount,
|
|
245
|
+
eligible: candidateCount,
|
|
246
|
+
rejected: z.partialRecord(ClassifierRejectionSchema, candidateCount)
|
|
247
|
+
}).strict().refine((value) => value.eligible + Object.values(value.rejected).reduce((sum, count) => sum + count, 0) === value.candidates, "Inconsistent candidate counts");
|
|
234
248
|
const SemanticAssessmentEvidenceSchema = z.object({
|
|
235
249
|
modelId: z.string().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u).optional(),
|
|
236
250
|
budgetMs: milliseconds.refine((value) => value > 0),
|
|
@@ -251,7 +265,9 @@ const SemanticAssessmentEvidenceSchema = z.object({
|
|
|
251
265
|
"valid",
|
|
252
266
|
"invalid",
|
|
253
267
|
"context-omitted"
|
|
254
|
-
])
|
|
268
|
+
]),
|
|
269
|
+
candidateScan: candidateScan.optional(),
|
|
270
|
+
preparationFailure: z.enum(["native-off-unavailable"]).optional()
|
|
255
271
|
}).strict().superRefine((value, ctx) => {
|
|
256
272
|
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({
|
|
257
273
|
code: "custom",
|
|
@@ -761,6 +777,220 @@ const contribution$2 = {
|
|
|
761
777
|
}))
|
|
762
778
|
};
|
|
763
779
|
//#endregion
|
|
780
|
+
//#region lib/types/auto-allocation-diagnostics.js
|
|
781
|
+
const AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS = 1024;
|
|
782
|
+
const dayMs = 864e5;
|
|
783
|
+
const integer$2 = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
784
|
+
const version$1 = z.string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/);
|
|
785
|
+
const assessmentOutcome = z.enum([
|
|
786
|
+
"local-known",
|
|
787
|
+
"local-unknown",
|
|
788
|
+
"semantic-known",
|
|
789
|
+
"semantic-unknown",
|
|
790
|
+
"disabled",
|
|
791
|
+
"unavailable",
|
|
792
|
+
"invalid-result",
|
|
793
|
+
"timeout",
|
|
794
|
+
"failed",
|
|
795
|
+
"context-omitted"
|
|
796
|
+
]);
|
|
797
|
+
const allocationRow = z.object({
|
|
798
|
+
day: integer$2.multipleOf(dayMs),
|
|
799
|
+
version: version$1,
|
|
800
|
+
policyVersion: z.string().min(1).max(64),
|
|
801
|
+
modelId: z.string().min(1).max(512),
|
|
802
|
+
targetCategory: z.enum([
|
|
803
|
+
"powerful",
|
|
804
|
+
"versatile",
|
|
805
|
+
"lightweight"
|
|
806
|
+
]),
|
|
807
|
+
category: z.enum([
|
|
808
|
+
"powerful",
|
|
809
|
+
"versatile",
|
|
810
|
+
"lightweight",
|
|
811
|
+
"unknown"
|
|
812
|
+
]),
|
|
813
|
+
demand: z.enum([
|
|
814
|
+
"simple",
|
|
815
|
+
"routine",
|
|
816
|
+
"complex",
|
|
817
|
+
"unknown"
|
|
818
|
+
]),
|
|
819
|
+
assessmentSource: z.enum(["local", "semantic"]),
|
|
820
|
+
assessmentOutcome: assessmentOutcome.optional(),
|
|
821
|
+
method: z.enum(["weighted-distribution", "only-candidate"]),
|
|
822
|
+
fallback: z.boolean(),
|
|
823
|
+
highCost: z.boolean(),
|
|
824
|
+
previous: z.boolean(),
|
|
825
|
+
weight: z.number().positive().max(1.5),
|
|
826
|
+
opportunities: integer$2.min(1),
|
|
827
|
+
expectedSelections: z.number().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
828
|
+
selections: integer$2
|
|
829
|
+
}).strict();
|
|
830
|
+
const noFitRow = z.object({
|
|
831
|
+
day: integer$2.multipleOf(dayMs),
|
|
832
|
+
version: version$1,
|
|
833
|
+
policyVersion: z.string().min(1).max(64),
|
|
834
|
+
targetCategory: z.enum([
|
|
835
|
+
"powerful",
|
|
836
|
+
"versatile",
|
|
837
|
+
"lightweight"
|
|
838
|
+
]),
|
|
839
|
+
category: z.enum([
|
|
840
|
+
"powerful",
|
|
841
|
+
"versatile",
|
|
842
|
+
"lightweight",
|
|
843
|
+
"unknown"
|
|
844
|
+
]),
|
|
845
|
+
demand: z.enum([
|
|
846
|
+
"simple",
|
|
847
|
+
"routine",
|
|
848
|
+
"complex",
|
|
849
|
+
"unknown"
|
|
850
|
+
]),
|
|
851
|
+
assessmentSource: z.enum(["local", "semantic"]),
|
|
852
|
+
assessmentOutcome: assessmentOutcome.optional(),
|
|
853
|
+
decisions: integer$2.min(1)
|
|
854
|
+
}).strict();
|
|
855
|
+
const AutoAllocationDiagnosticsSchema = z.object({
|
|
856
|
+
status: z.enum(["observed", "not-collected"]),
|
|
857
|
+
rows: z.array(allocationRow).max(AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS),
|
|
858
|
+
noFitRows: z.array(noFitRow).max(AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS),
|
|
859
|
+
observationStart: integer$2.nullable(),
|
|
860
|
+
observationEnd: integer$2.nullable(),
|
|
861
|
+
completeHistory: z.literal(false),
|
|
862
|
+
rowsTruncated: z.boolean(),
|
|
863
|
+
dropped: integer$2,
|
|
864
|
+
expired: integer$2,
|
|
865
|
+
saturated: integer$2,
|
|
866
|
+
restarts: integer$2
|
|
867
|
+
}).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");
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region lib/types/request-diagnostics.js
|
|
870
|
+
const integer$1 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
871
|
+
const composition = z.discriminatedUnion("state", [z.object({
|
|
872
|
+
state: z.literal("complete"),
|
|
873
|
+
totalBytes: integer$1,
|
|
874
|
+
conversationBytes: integer$1,
|
|
875
|
+
toolSchemaBytes: integer$1,
|
|
876
|
+
systemBytes: integer$1,
|
|
877
|
+
otherBytes: integer$1,
|
|
878
|
+
imageBlockBytes: integer$1,
|
|
879
|
+
opaqueReplayBytes: integer$1,
|
|
880
|
+
remainingConversationBytes: integer$1
|
|
881
|
+
}).strict(), z.object({
|
|
882
|
+
state: z.enum([
|
|
883
|
+
"unavailable",
|
|
884
|
+
"size-limit",
|
|
885
|
+
"work-limit",
|
|
886
|
+
"invalid-json",
|
|
887
|
+
"unsupported-shape",
|
|
888
|
+
"cancelled",
|
|
889
|
+
"time-limit"
|
|
890
|
+
]),
|
|
891
|
+
totalBytes: integer$1.optional()
|
|
892
|
+
}).strict()]);
|
|
893
|
+
const upload = z.discriminatedUnion("state", [
|
|
894
|
+
z.object({
|
|
895
|
+
state: z.literal("observed"),
|
|
896
|
+
bodyWrite: z.enum(["observed", "not-observed"]),
|
|
897
|
+
bodyWriteCompleteMs: integer$1.optional(),
|
|
898
|
+
nativeResponseHeadersMs: integer$1.optional(),
|
|
899
|
+
alpn: z.enum([
|
|
900
|
+
"h2",
|
|
901
|
+
"http/1.1",
|
|
902
|
+
"unavailable"
|
|
903
|
+
]),
|
|
904
|
+
nodeWritableBufferBytes: integer$1.optional()
|
|
905
|
+
}).strict(),
|
|
906
|
+
z.object({ state: z.enum(["unavailable", "work-limit"]) }).strict(),
|
|
907
|
+
z.object({
|
|
908
|
+
state: z.literal("ambiguous"),
|
|
909
|
+
requestCount: integer$1
|
|
910
|
+
}).strict()
|
|
911
|
+
]);
|
|
912
|
+
const CredentialChangeReasonSchema = z.enum([
|
|
913
|
+
"qualified",
|
|
914
|
+
"unknown-source",
|
|
915
|
+
"account-changed",
|
|
916
|
+
"endpoint-changed",
|
|
917
|
+
"entitlements-changed",
|
|
918
|
+
"expired",
|
|
919
|
+
"auth-mismatch",
|
|
920
|
+
"duplicate-notification",
|
|
921
|
+
"missing-notification",
|
|
922
|
+
"commit-mismatch",
|
|
923
|
+
"write-failed",
|
|
924
|
+
"write-conflict"
|
|
925
|
+
]);
|
|
926
|
+
const CredentialChangeSchema = z.object({
|
|
927
|
+
changeId: z.string().uuid(),
|
|
928
|
+
observedAt: integer$1,
|
|
929
|
+
version: z.string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/),
|
|
930
|
+
phase: z.enum(["notification", "commit"]),
|
|
931
|
+
reason: CredentialChangeReasonSchema,
|
|
932
|
+
preparing: integer$1,
|
|
933
|
+
dispatched: integer$1,
|
|
934
|
+
alreadyAborted: integer$1,
|
|
935
|
+
preserved: integer$1,
|
|
936
|
+
revoked: integer$1
|
|
937
|
+
}).strict();
|
|
938
|
+
const RequestDiagnosticSchema = z.object({
|
|
939
|
+
streamId: z.string().uuid(),
|
|
940
|
+
dispatchIndex: integer$1.min(1),
|
|
941
|
+
version: z.string().max(64).regex(/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/),
|
|
942
|
+
startedAt: integer$1,
|
|
943
|
+
elapsedMs: integer$1,
|
|
944
|
+
model: z.string().max(128).regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/),
|
|
945
|
+
protocol: z.enum([
|
|
946
|
+
"openai-responses",
|
|
947
|
+
"openai-completions",
|
|
948
|
+
"anthropic-messages"
|
|
949
|
+
]),
|
|
950
|
+
composition,
|
|
951
|
+
encoding: z.enum([
|
|
952
|
+
"identity",
|
|
953
|
+
"gzip",
|
|
954
|
+
"unknown"
|
|
955
|
+
]),
|
|
956
|
+
wireBytes: integer$1.optional(),
|
|
957
|
+
upload: upload.optional(),
|
|
958
|
+
responseHeadersMs: integer$1.optional(),
|
|
959
|
+
httpStatus: integer$1.min(100).max(599).optional(),
|
|
960
|
+
outcome: z.enum([
|
|
961
|
+
"http-error",
|
|
962
|
+
"transport-error",
|
|
963
|
+
"stream-done",
|
|
964
|
+
"stream-error",
|
|
965
|
+
"cancelled",
|
|
966
|
+
"interrupted"
|
|
967
|
+
]),
|
|
968
|
+
reason: z.enum([
|
|
969
|
+
"none",
|
|
970
|
+
"unknown",
|
|
971
|
+
"request-body-timeout",
|
|
972
|
+
"caller-abort",
|
|
973
|
+
"credential-changed",
|
|
974
|
+
"disposed",
|
|
975
|
+
"byte-idle-timeout",
|
|
976
|
+
"signal-abort"
|
|
977
|
+
])
|
|
978
|
+
}).strict();
|
|
979
|
+
const RequestDiagnosticsSchema = z.object({
|
|
980
|
+
rows: z.array(RequestDiagnosticSchema).max(128),
|
|
981
|
+
dropped: integer$1,
|
|
982
|
+
evicted: integer$1,
|
|
983
|
+
pending: integer$1.max(128).optional(),
|
|
984
|
+
interruptedOnReopen: integer$1.optional(),
|
|
985
|
+
credentialChanges: z.object({
|
|
986
|
+
rows: z.array(CredentialChangeSchema).max(128),
|
|
987
|
+
dropped: integer$1,
|
|
988
|
+
evicted: integer$1,
|
|
989
|
+
pending: integer$1.max(128).optional(),
|
|
990
|
+
interruptedOnReopen: integer$1.optional()
|
|
991
|
+
}).strict().optional()
|
|
992
|
+
}).strict();
|
|
993
|
+
//#endregion
|
|
764
994
|
//#region lib/types/diagnostics-types.js
|
|
765
995
|
const DIAGNOSTICS_OPERATIONS = [
|
|
766
996
|
"account-global-switch",
|
|
@@ -867,6 +1097,8 @@ const DiagnosticsSnapshotSchema = z.object({
|
|
|
867
1097
|
epoch: integer,
|
|
868
1098
|
updatedAt: integer,
|
|
869
1099
|
rows: z.array(DiagnosticsRowSchema).max(DIAGNOSTICS_MAX_ROWS),
|
|
1100
|
+
autoAllocation: AutoAllocationDiagnosticsSchema.optional(),
|
|
1101
|
+
requests: RequestDiagnosticsSchema.optional(),
|
|
870
1102
|
pending: z.array(DiagnosticsPendingSchema).max(128),
|
|
871
1103
|
dropped: integer,
|
|
872
1104
|
clientDropped: integer,
|
|
@@ -877,6 +1109,8 @@ const DiagnosticsSnapshotSchema = z.object({
|
|
|
877
1109
|
}).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");
|
|
878
1110
|
const DiagnosticsViewSchema = z.object({
|
|
879
1111
|
enabled: z.boolean(),
|
|
1112
|
+
autoAllocationEnabled: z.boolean(),
|
|
1113
|
+
requestEnabled: z.boolean().optional(),
|
|
880
1114
|
state: z.enum([
|
|
881
1115
|
"loading",
|
|
882
1116
|
"ready",
|
|
@@ -928,6 +1162,24 @@ const contribution$1 = {
|
|
|
928
1162
|
codec: strictRemoteCodec("dsh-github-copilot#DiagnosticsEnabled", z.boolean())
|
|
929
1163
|
}]
|
|
930
1164
|
},
|
|
1165
|
+
{
|
|
1166
|
+
method: "setAutoAllocationEnabled",
|
|
1167
|
+
parameters: [{
|
|
1168
|
+
name: "enabled",
|
|
1169
|
+
wire: "enabled",
|
|
1170
|
+
source: "json",
|
|
1171
|
+
codec: strictRemoteCodec("dsh-github-copilot#AutoAllocationDiagnosticsEnabled", z.boolean())
|
|
1172
|
+
}]
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
method: "setRequestEnabled",
|
|
1176
|
+
parameters: [{
|
|
1177
|
+
name: "enabled",
|
|
1178
|
+
wire: "enabled",
|
|
1179
|
+
source: "json",
|
|
1180
|
+
codec: strictRemoteCodec("dsh-github-copilot#RequestDiagnosticsEnabled", z.boolean())
|
|
1181
|
+
}]
|
|
1182
|
+
},
|
|
931
1183
|
{
|
|
932
1184
|
method: "recordClient",
|
|
933
1185
|
parameters: [{
|
package/lib/routed-web.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as isPluginPreviewProvider, b as currentSearchSelection, t as isCopilotSearchSelection, y as currentSearchInitiator } from "./search-routing-CV2hs8as.js";
|
|
2
1
|
import "./copilot-identity-DRZY_d2X.js";
|
|
2
|
+
import { T as isPluginPreviewProvider, b as currentSearchSelection, t as isCopilotSearchSelection, y as currentSearchInitiator } from "./search-routing-CV2hs8as.js";
|
|
3
3
|
import { WebError, WebRuntime } from "@deepseek-ai/dsh-web";
|
|
4
4
|
//#region lib/types/routed-web.js
|
|
5
5
|
/**
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AutoSelectionExplanation } from './auto-model-routing.ts';
|
|
3
|
+
export declare const AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS = 1024;
|
|
4
|
+
export declare const AUTO_ALLOCATION_DIAGNOSTIC_RETENTION_MS: number;
|
|
5
|
+
export declare const AutoAllocationDiagnosticsSchema: z.ZodObject<{
|
|
6
|
+
status: z.ZodEnum<{
|
|
7
|
+
observed: "observed";
|
|
8
|
+
"not-collected": "not-collected";
|
|
9
|
+
}>;
|
|
10
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
11
|
+
day: z.ZodNumber;
|
|
12
|
+
version: z.ZodString;
|
|
13
|
+
policyVersion: z.ZodString;
|
|
14
|
+
modelId: z.ZodString;
|
|
15
|
+
targetCategory: z.ZodEnum<{
|
|
16
|
+
powerful: "powerful";
|
|
17
|
+
versatile: "versatile";
|
|
18
|
+
lightweight: "lightweight";
|
|
19
|
+
}>;
|
|
20
|
+
category: z.ZodEnum<{
|
|
21
|
+
unknown: "unknown";
|
|
22
|
+
powerful: "powerful";
|
|
23
|
+
versatile: "versatile";
|
|
24
|
+
lightweight: "lightweight";
|
|
25
|
+
}>;
|
|
26
|
+
demand: z.ZodEnum<{
|
|
27
|
+
unknown: "unknown";
|
|
28
|
+
simple: "simple";
|
|
29
|
+
routine: "routine";
|
|
30
|
+
complex: "complex";
|
|
31
|
+
}>;
|
|
32
|
+
assessmentSource: z.ZodEnum<{
|
|
33
|
+
local: "local";
|
|
34
|
+
semantic: "semantic";
|
|
35
|
+
}>;
|
|
36
|
+
assessmentOutcome: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
disabled: "disabled";
|
|
38
|
+
unavailable: "unavailable";
|
|
39
|
+
"context-omitted": "context-omitted";
|
|
40
|
+
"invalid-result": "invalid-result";
|
|
41
|
+
timeout: "timeout";
|
|
42
|
+
failed: "failed";
|
|
43
|
+
"local-known": "local-known";
|
|
44
|
+
"local-unknown": "local-unknown";
|
|
45
|
+
"semantic-known": "semantic-known";
|
|
46
|
+
"semantic-unknown": "semantic-unknown";
|
|
47
|
+
}>>;
|
|
48
|
+
method: z.ZodEnum<{
|
|
49
|
+
"weighted-distribution": "weighted-distribution";
|
|
50
|
+
"only-candidate": "only-candidate";
|
|
51
|
+
}>;
|
|
52
|
+
fallback: z.ZodBoolean;
|
|
53
|
+
highCost: z.ZodBoolean;
|
|
54
|
+
previous: z.ZodBoolean;
|
|
55
|
+
weight: z.ZodNumber;
|
|
56
|
+
opportunities: z.ZodNumber;
|
|
57
|
+
expectedSelections: z.ZodNumber;
|
|
58
|
+
selections: z.ZodNumber;
|
|
59
|
+
}, z.core.$strict>>;
|
|
60
|
+
noFitRows: z.ZodArray<z.ZodObject<{
|
|
61
|
+
day: z.ZodNumber;
|
|
62
|
+
version: z.ZodString;
|
|
63
|
+
policyVersion: z.ZodString;
|
|
64
|
+
targetCategory: z.ZodEnum<{
|
|
65
|
+
powerful: "powerful";
|
|
66
|
+
versatile: "versatile";
|
|
67
|
+
lightweight: "lightweight";
|
|
68
|
+
}>;
|
|
69
|
+
category: z.ZodEnum<{
|
|
70
|
+
unknown: "unknown";
|
|
71
|
+
powerful: "powerful";
|
|
72
|
+
versatile: "versatile";
|
|
73
|
+
lightweight: "lightweight";
|
|
74
|
+
}>;
|
|
75
|
+
demand: z.ZodEnum<{
|
|
76
|
+
unknown: "unknown";
|
|
77
|
+
simple: "simple";
|
|
78
|
+
routine: "routine";
|
|
79
|
+
complex: "complex";
|
|
80
|
+
}>;
|
|
81
|
+
assessmentSource: z.ZodEnum<{
|
|
82
|
+
local: "local";
|
|
83
|
+
semantic: "semantic";
|
|
84
|
+
}>;
|
|
85
|
+
assessmentOutcome: z.ZodOptional<z.ZodEnum<{
|
|
86
|
+
disabled: "disabled";
|
|
87
|
+
unavailable: "unavailable";
|
|
88
|
+
"context-omitted": "context-omitted";
|
|
89
|
+
"invalid-result": "invalid-result";
|
|
90
|
+
timeout: "timeout";
|
|
91
|
+
failed: "failed";
|
|
92
|
+
"local-known": "local-known";
|
|
93
|
+
"local-unknown": "local-unknown";
|
|
94
|
+
"semantic-known": "semantic-known";
|
|
95
|
+
"semantic-unknown": "semantic-unknown";
|
|
96
|
+
}>>;
|
|
97
|
+
decisions: z.ZodNumber;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
observationStart: z.ZodNullable<z.ZodNumber>;
|
|
100
|
+
observationEnd: z.ZodNullable<z.ZodNumber>;
|
|
101
|
+
completeHistory: z.ZodLiteral<false>;
|
|
102
|
+
rowsTruncated: z.ZodBoolean;
|
|
103
|
+
dropped: z.ZodNumber;
|
|
104
|
+
expired: z.ZodNumber;
|
|
105
|
+
saturated: z.ZodNumber;
|
|
106
|
+
restarts: z.ZodNumber;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
export type AutoAllocationDiagnostics = z.infer<typeof AutoAllocationDiagnosticsSchema>;
|
|
109
|
+
export declare function emptyAutoAllocationDiagnostics(): AutoAllocationDiagnostics;
|
|
110
|
+
/** Profile-local rolling aggregates; no per-turn, Session, prompt, or execution-outcome records. */
|
|
111
|
+
export declare class AutoAllocationDiagnosticsCollector {
|
|
112
|
+
private readonly version;
|
|
113
|
+
private readonly changed;
|
|
114
|
+
private readonly wall;
|
|
115
|
+
private data;
|
|
116
|
+
private enabled;
|
|
117
|
+
constructor(version: string, changed?: () => void, wall?: () => number);
|
|
118
|
+
restore(value: unknown, countRestart?: boolean): void;
|
|
119
|
+
setEnabled(enabled: boolean): void;
|
|
120
|
+
clear(): void;
|
|
121
|
+
record(explanation: AutoSelectionExplanation): void;
|
|
122
|
+
snapshot(): AutoAllocationDiagnostics;
|
|
123
|
+
private expire;
|
|
124
|
+
private add;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=auto-allocation-diagnostics.d.ts.map
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const ClassifierRejectionSchema: z.ZodEnum<{
|
|
3
|
+
input: "input";
|
|
4
|
+
category: "category";
|
|
5
|
+
excluded: "excluded";
|
|
6
|
+
"configured-id": "configured-id";
|
|
7
|
+
"reasoning-disable-unproven": "reasoning-disable-unproven";
|
|
8
|
+
budget: "budget";
|
|
9
|
+
}>;
|
|
10
|
+
export type ClassifierRejection = z.infer<typeof ClassifierRejectionSchema>;
|
|
2
11
|
export declare const SemanticAssessmentEvidenceSchema: z.ZodObject<{
|
|
3
12
|
modelId: z.ZodOptional<z.ZodString>;
|
|
4
13
|
budgetMs: z.ZodNumber;
|
|
@@ -23,9 +32,32 @@ export declare const SemanticAssessmentEvidenceSchema: z.ZodObject<{
|
|
|
23
32
|
valid: "valid";
|
|
24
33
|
"context-omitted": "context-omitted";
|
|
25
34
|
}>;
|
|
35
|
+
candidateScan: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
candidates: z.ZodNumber;
|
|
37
|
+
eligible: z.ZodNumber;
|
|
38
|
+
rejected: z.ZodRecord<z.ZodEnum<{
|
|
39
|
+
input: "input";
|
|
40
|
+
category: "category";
|
|
41
|
+
excluded: "excluded";
|
|
42
|
+
"configured-id": "configured-id";
|
|
43
|
+
"reasoning-disable-unproven": "reasoning-disable-unproven";
|
|
44
|
+
budget: "budget";
|
|
45
|
+
}> & z.core.$partial, z.ZodNumber>;
|
|
46
|
+
}, z.core.$strict>>;
|
|
47
|
+
preparationFailure: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
"native-off-unavailable": "native-off-unavailable";
|
|
49
|
+
}>>;
|
|
26
50
|
}, z.core.$strict>;
|
|
27
51
|
export type SemanticAssessmentEvidence = Readonly<z.infer<typeof SemanticAssessmentEvidenceSchema>>;
|
|
28
52
|
export type TaskClassifierObservation = {
|
|
53
|
+
readonly stage: 'candidate-scan';
|
|
54
|
+
readonly candidates: number;
|
|
55
|
+
readonly eligible: number;
|
|
56
|
+
readonly rejected: Partial<Record<ClassifierRejection, number>>;
|
|
57
|
+
} | {
|
|
58
|
+
readonly stage: 'preparation-failed';
|
|
59
|
+
readonly reason: 'native-off-unavailable';
|
|
60
|
+
} | {
|
|
29
61
|
readonly stage: 'model-selected';
|
|
30
62
|
readonly modelId: string;
|
|
31
63
|
} | {
|
|
@@ -19,6 +19,7 @@ export interface AutoModelHostDependencies {
|
|
|
19
19
|
followParentModel?: () => boolean;
|
|
20
20
|
admitModel?: (agent: Agent, turn: number, model: string, signal: AbortSignal) => void;
|
|
21
21
|
semanticAssessment?: () => boolean;
|
|
22
|
+
assessmentTimeoutMs?: () => number | undefined;
|
|
22
23
|
highCostModelIds?: () => readonly string[];
|
|
23
24
|
allocationEvidence?: () => boolean;
|
|
24
25
|
classifyTask?: TaskAssessmentDependencies['classify'];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { SemanticAssessmentEvidence, TaskClassifierObserver } from './auto-assessment-evidence.ts';
|
|
3
|
+
export declare const DEFAULT_AUTO_ASSESSMENT_TIMEOUT_MS = 30000;
|
|
3
4
|
export declare const TaskAssessmentSchema: z.ZodObject<{
|
|
4
5
|
demand: z.ZodEnum<{
|
|
5
6
|
unknown: "unknown";
|
|
@@ -3,7 +3,8 @@ import type { AccountModelDescriptor } from './account-model-catalog.ts';
|
|
|
3
3
|
import type { AssessmentInput } from './auto-task-assessment.ts';
|
|
4
4
|
import type { TaskClassifierObserver } from './auto-assessment-evidence.ts';
|
|
5
5
|
export declare const TASK_CLASSIFIER_MAX_TOKENS = 128;
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function classifierReasoningOffSupported(model: AccountModelDescriptor): boolean;
|
|
7
|
+
export declare function taskClassifierModel(models: readonly AccountModelDescriptor[], highCostModelIds?: readonly string[], modelId?: string, observe?: TaskClassifierObserver, excluded?: ReadonlySet<string>): AccountModelDescriptor | undefined;
|
|
7
8
|
/** One auxiliary concrete-model call; no Auto recursion, tools, history writes or retry loop. */
|
|
8
9
|
export declare function classifyTaskWithAdapter(model: AccountModelDescriptor, input: AssessmentInput, signal: AbortSignal, stream: (request: GenerateOptions) => AsyncIterable<StreamChunk>, observe?: TaskClassifierObserver, reasoningOffSupported?: boolean, checkpoint?: () => void): Promise<string>;
|
|
9
10
|
//# sourceMappingURL=auto-task-classifier.d.ts.map
|
|
@@ -40,7 +40,7 @@ export declare const compactionContinuationDefinition: {
|
|
|
40
40
|
export declare function installCompactionContinuation(ctx: Context, enabled: (agent: Agent) => boolean): {
|
|
41
41
|
status(agent: Agent): {
|
|
42
42
|
id: string;
|
|
43
|
-
state: "running" | "
|
|
43
|
+
state: "running" | "failed" | "cancelled" | "completed" | "blocked";
|
|
44
44
|
} | undefined;
|
|
45
45
|
prepare(request: GenerateOptions): ((payload: unknown) => Promise<unknown>) | undefined;
|
|
46
46
|
dispose(): void;
|
package/lib/types/config.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ import type { SessionContinuationPreference } from './session-continuation-types
|
|
|
14
14
|
export interface InlineConfig {
|
|
15
15
|
/** Opt-in local aggregate diagnostics; no uploads or scheduled analysis. */
|
|
16
16
|
diagnosticsEnabled?: boolean;
|
|
17
|
+
/** Independent opt-in persistence of Auto allocation aggregates. */
|
|
18
|
+
autoAllocationDiagnosticsEnabled?: boolean;
|
|
19
|
+
/** Separate opt-in content-free physical request observations. */
|
|
20
|
+
requestDiagnosticsEnabled?: boolean;
|
|
17
21
|
/** Hosted-search switch; managed chat requests remain enabled. */
|
|
18
22
|
enabled: boolean;
|
|
19
23
|
/**
|
|
@@ -65,6 +69,10 @@ export interface InlineConfig {
|
|
|
65
69
|
followParentModel?: boolean;
|
|
66
70
|
/** Default-on bounded task assessment; explicit false opts out of auxiliary inference. */
|
|
67
71
|
autoSemanticAssessment?: boolean;
|
|
72
|
+
/** Total preparation/response budget; finite wait, independent of native Chat deadlines. */
|
|
73
|
+
autoSemanticAssessmentTimeoutMs?: number;
|
|
74
|
+
/** Exact account classifier ID; empty keeps metadata-driven automatic selection. */
|
|
75
|
+
autoSemanticAssessmentModel?: string;
|
|
68
76
|
/** Capture bounded local candidate opportunities for future policy review. */
|
|
69
77
|
autoAllocationEvidence?: boolean;
|
|
70
78
|
/** Estimated managed-route input headroom, separate from truthful catalog capacities. */
|
|
@@ -84,7 +92,9 @@ export interface InlineConfig {
|
|
|
84
92
|
/** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
|
|
85
93
|
temporaryRouteBackup?: string;
|
|
86
94
|
}
|
|
87
|
-
export type LiveInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory'> & {
|
|
95
|
+
export type LiveInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'autoAllocationDiagnosticsEnabled' | 'requestDiagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory' | 'autoSemanticAssessmentTimeoutMs' | 'autoSemanticAssessmentModel'> & {
|
|
96
|
+
autoSemanticAssessmentTimeoutMs?: number | LiveSetting<number>;
|
|
97
|
+
autoSemanticAssessmentModel?: string | LiveSetting<string>;
|
|
88
98
|
continuationDefaultHistory?: InlineConfig['continuationDefaultHistory'] | LiveSetting<ArrayLike<{
|
|
89
99
|
enabled: boolean;
|
|
90
100
|
changedAt: number;
|
|
@@ -92,6 +102,8 @@ export type LiveInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'search
|
|
|
92
102
|
sessionContinuation?: SessionContinuationPreference[] | LiveSetting<ArrayLike<SessionContinuationPreference>>;
|
|
93
103
|
sessionAccounts?: SessionAccountPreference[] | LiveSetting<ArrayLike<SessionAccountPreference>>;
|
|
94
104
|
diagnosticsEnabled?: boolean | LiveSetting<boolean>;
|
|
105
|
+
autoAllocationDiagnosticsEnabled?: boolean | LiveSetting<boolean>;
|
|
106
|
+
requestDiagnosticsEnabled?: boolean | LiveSetting<boolean>;
|
|
95
107
|
activeAccountId?: string | LiveSetting<string | undefined>;
|
|
96
108
|
followParentModel?: boolean | LiveSetting<boolean>;
|
|
97
109
|
parentModelFollow?: ParentModelBinding[] | LiveSetting<ArrayLike<ParentModelBinding>>;
|
|
@@ -101,8 +113,12 @@ export type LiveInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'search
|
|
|
101
113
|
searchRouting?: WebSearchRoutingConfig | LiveSetting<WebSearchRoutingConfig | undefined>;
|
|
102
114
|
temporaryRouteBackup?: string | LiveSetting<string | undefined>;
|
|
103
115
|
};
|
|
104
|
-
export type ResolvedInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory'> & {
|
|
116
|
+
export type ResolvedInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'autoAllocationDiagnosticsEnabled' | 'requestDiagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory' | 'autoSemanticAssessmentTimeoutMs' | 'autoSemanticAssessmentModel'> & {
|
|
117
|
+
autoSemanticAssessmentTimeoutMs: LiveSetting<number>;
|
|
118
|
+
autoSemanticAssessmentModel: LiveSetting<string>;
|
|
105
119
|
diagnosticsEnabled: LiveSetting<boolean>;
|
|
120
|
+
autoAllocationDiagnosticsEnabled: LiveSetting<boolean>;
|
|
121
|
+
requestDiagnosticsEnabled: LiveSetting<boolean>;
|
|
106
122
|
continuationDefaultHistory: LiveSetting<ArrayLike<{
|
|
107
123
|
enabled: boolean;
|
|
108
124
|
changedAt: number;
|
|
@@ -52,8 +52,8 @@ export declare const ContextEvidenceSchema: z.ZodObject<{
|
|
|
52
52
|
}, z.core.$strict>>;
|
|
53
53
|
request: z.ZodEnum<{
|
|
54
54
|
unknown: "unknown";
|
|
55
|
-
cancelled: "cancelled";
|
|
56
55
|
failed: "failed";
|
|
56
|
+
cancelled: "cancelled";
|
|
57
57
|
pending: "pending";
|
|
58
58
|
idle: "idle";
|
|
59
59
|
succeeded: "succeeded";
|
|
@@ -131,8 +131,8 @@ export declare const contextEvidenceDefinition: {
|
|
|
131
131
|
}, z.core.$strict>>;
|
|
132
132
|
request: z.ZodEnum<{
|
|
133
133
|
unknown: "unknown";
|
|
134
|
-
cancelled: "cancelled";
|
|
135
134
|
failed: "failed";
|
|
135
|
+
cancelled: "cancelled";
|
|
136
136
|
pending: "pending";
|
|
137
137
|
idle: "idle";
|
|
138
138
|
succeeded: "succeeded";
|
|
@@ -197,8 +197,8 @@ export declare const contextEvidenceDefinition: {
|
|
|
197
197
|
}, z.core.$strict>>;
|
|
198
198
|
request: z.ZodEnum<{
|
|
199
199
|
unknown: "unknown";
|
|
200
|
-
cancelled: "cancelled";
|
|
201
200
|
failed: "failed";
|
|
201
|
+
cancelled: "cancelled";
|
|
202
202
|
pending: "pending";
|
|
203
203
|
idle: "idle";
|
|
204
204
|
succeeded: "succeeded";
|
|
@@ -243,7 +243,7 @@ export declare const contextEvidenceDefinition: {
|
|
|
243
243
|
turn: number;
|
|
244
244
|
step: number;
|
|
245
245
|
} | null;
|
|
246
|
-
request: "unknown" | "
|
|
246
|
+
request: "unknown" | "failed" | "cancelled" | "pending" | "idle" | "succeeded";
|
|
247
247
|
} | null | undefined;
|
|
248
248
|
activeStep?: {
|
|
249
249
|
turn: number;
|
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
* that DSH's built-in llm-pi-ai adapter owns.
|
|
4
4
|
*/
|
|
5
5
|
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
import { type CredentialStore } from '@earendil-works/pi-ai';
|
|
6
|
+
import { type CredentialStore, type OAuthAuth } from '@earendil-works/pi-ai';
|
|
7
7
|
import { GITHUB_COPILOT_PROVIDER_ID, GITHUB_COPILOT_PREVIEW_PROVIDER_ID } from './copilot-identity.ts';
|
|
8
|
+
import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
8
9
|
import type { CopilotAccountBinding } from './copilot-accounts-types.ts';
|
|
10
|
+
import type { CredentialChangeReason } from './request-diagnostics.ts';
|
|
9
11
|
export { normalizeGitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
12
|
+
/** Only a validated native OAuth refresh may certify its exact returned object. */
|
|
13
|
+
export declare function certifyCopilotNativeRefresh(previous: GitHubCopilotOAuthCredential, result: GitHubCopilotOAuthCredential, derive: OAuthAuth['toAuth'], signal?: AbortSignal): Promise<void>;
|
|
14
|
+
/** Consume exactly one notification from the serialized, certified write. */
|
|
15
|
+
export declare function observeCopilotNativeRefresh(ctx: Context, key: string, diagnostic?: (phase: 'notification' | 'commit', reason: CredentialChangeReason) => void): Promise<boolean> | undefined;
|
|
10
16
|
export declare function captureActiveGitHubCopilotBinding(ctx: Context): CopilotAccountBinding | undefined;
|
|
11
17
|
/** Bind exactly one logical route to the canonical Host-owned credential record. */
|
|
12
18
|
export declare function createGitHubCopilotCredentialStore(ctx: Context, logicalProviderId?: typeof GITHUB_COPILOT_PROVIDER_ID | typeof GITHUB_COPILOT_PREVIEW_PROVIDER_ID, binding?: CopilotAccountBinding): CredentialStore;
|