dsh-model-switch 0.4.19 → 0.4.21
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/CHANGELOG.md +212 -194
- package/IMPLEMENTATION_PLAN.md +40 -40
- package/LICENSE +21 -21
- package/PRODUCT.md +33 -33
- package/README.md +214 -200
- package/README.zh.md +212 -198
- package/cordis.patch.yml +515 -18
- package/lib/auto-review.js +120 -0
- package/lib/client.js +467 -22
- package/lib/compaction.js +205 -0
- package/lib/index.js +17 -2
- package/lib/types/auto-review.d.ts +68 -0
- package/lib/types/client/ModelSwitchSettings.d.ts +3 -1
- package/lib/types/client/derived-settings-scope.d.ts +4 -4
- package/lib/types/client/locales.d.ts +8 -0
- package/lib/types/client/picker/PlanReviewCard.d.ts +3 -0
- package/lib/types/client/picker/locales.d.ts +2 -0
- package/lib/types/client/picker/plan-preview.d.ts +49 -0
- package/lib/types/client/remote-settings-scope.d.ts +45 -45
- package/lib/types/client-contract.d.ts +18 -0
- package/lib/types/compaction.d.ts +56 -0
- package/lib/types/host-runtime.d.ts +12 -0
- package/lib/types/host-settings.d.ts +20 -0
- package/lib/types/picker/plan-goal.d.ts +29 -3
- package/package.json +360 -347
|
@@ -7,6 +7,10 @@ declare module '@deepseek-ai/cordis' {
|
|
|
7
7
|
interface Context {
|
|
8
8
|
modelSwitch: ModelSwitchRuntime;
|
|
9
9
|
}
|
|
10
|
+
interface Events {
|
|
11
|
+
/** Model Switch settings changed; reread via `modelSwitch.currentSettings()`. */
|
|
12
|
+
'model-switch/settings-update'(): void;
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
15
|
/** Host owner for Model Switch settings and the released Main-default adapter. */
|
|
12
16
|
export declare class ModelSwitchRuntime extends Service {
|
|
@@ -21,6 +25,10 @@ export declare class ModelSwitchRuntime extends Service {
|
|
|
21
25
|
imageProvider: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
22
26
|
imageModel: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
23
27
|
compactOnSwitch: import("@deepseek-ai/schemastery").default<boolean, boolean, "volatile-defined">;
|
|
28
|
+
autoReviewProvider: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
29
|
+
autoReviewModel: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
30
|
+
compactProvider: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
31
|
+
compactModel: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
24
32
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
25
33
|
subagentMode: import("@deepseek-ai/schemastery").default<"follow-main" | "fixed", "follow-main" | "fixed", "volatile-defined">;
|
|
26
34
|
subagentProvider: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
@@ -31,6 +39,10 @@ export declare class ModelSwitchRuntime extends Service {
|
|
|
31
39
|
imageProvider: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
32
40
|
imageModel: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
33
41
|
compactOnSwitch: import("@deepseek-ai/schemastery").default<boolean, boolean, "volatile-defined">;
|
|
42
|
+
autoReviewProvider: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
43
|
+
autoReviewModel: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
44
|
+
compactProvider: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
45
|
+
compactModel: import("@deepseek-ai/schemastery").default<string, string, "volatile">;
|
|
34
46
|
}>>, "plain">;
|
|
35
47
|
get capabilities(): {
|
|
36
48
|
searchProviderAdapters: {
|
|
@@ -12,6 +12,14 @@ export interface ModelSwitchSettings {
|
|
|
12
12
|
imageProvider?: string;
|
|
13
13
|
imageModel?: string;
|
|
14
14
|
compactOnSwitch: boolean;
|
|
15
|
+
/** Reviewer provider for the Auto preset; both fields unset = follow the session model. */
|
|
16
|
+
autoReviewProvider?: string;
|
|
17
|
+
/** Reviewer model for the Auto preset; set together with `autoReviewProvider`. */
|
|
18
|
+
autoReviewModel?: string;
|
|
19
|
+
/** Summarization provider for `/compact` and automatic compaction; both fields unset = official default (the conversation target). */
|
|
20
|
+
compactProvider?: string;
|
|
21
|
+
/** Summarization model for `/compact` and automatic compaction; set together with `compactProvider`. */
|
|
22
|
+
compactModel?: string;
|
|
15
23
|
}
|
|
16
24
|
/** Loader-owned references; every field is directly editable in the profile form. */
|
|
17
25
|
export interface Config {
|
|
@@ -24,6 +32,10 @@ export interface Config {
|
|
|
24
32
|
imageProvider: Volatile<string | undefined>;
|
|
25
33
|
imageModel: Volatile<string | undefined>;
|
|
26
34
|
compactOnSwitch: Volatile<boolean>;
|
|
35
|
+
autoReviewProvider: Volatile<string | undefined>;
|
|
36
|
+
autoReviewModel: Volatile<string | undefined>;
|
|
37
|
+
compactProvider: Volatile<string | undefined>;
|
|
38
|
+
compactModel: Volatile<string | undefined>;
|
|
27
39
|
}
|
|
28
40
|
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
29
41
|
subagentMode: z<"follow-main" | "fixed", "follow-main" | "fixed", "volatile-defined">;
|
|
@@ -35,6 +47,10 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
35
47
|
imageProvider: z<string, string, "volatile">;
|
|
36
48
|
imageModel: z<string, string, "volatile">;
|
|
37
49
|
compactOnSwitch: z<boolean, boolean, "volatile-defined">;
|
|
50
|
+
autoReviewProvider: z<string, string, "volatile">;
|
|
51
|
+
autoReviewModel: z<string, string, "volatile">;
|
|
52
|
+
compactProvider: z<string, string, "volatile">;
|
|
53
|
+
compactModel: z<string, string, "volatile">;
|
|
38
54
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
39
55
|
subagentMode: z<"follow-main" | "fixed", "follow-main" | "fixed", "volatile-defined">;
|
|
40
56
|
subagentProvider: z<string, string, "volatile">;
|
|
@@ -45,5 +61,9 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
45
61
|
imageProvider: z<string, string, "volatile">;
|
|
46
62
|
imageModel: z<string, string, "volatile">;
|
|
47
63
|
compactOnSwitch: z<boolean, boolean, "volatile-defined">;
|
|
64
|
+
autoReviewProvider: z<string, string, "volatile">;
|
|
65
|
+
autoReviewModel: z<string, string, "volatile">;
|
|
66
|
+
compactProvider: z<string, string, "volatile">;
|
|
67
|
+
compactModel: z<string, string, "volatile">;
|
|
48
68
|
}>>, "plain">;
|
|
49
69
|
export declare function readConfig(config: Config): ModelSwitchSettings;
|
|
@@ -61,8 +61,33 @@ export type GoalHandoff = {
|
|
|
61
61
|
readonly code?: string;
|
|
62
62
|
readonly message: string;
|
|
63
63
|
};
|
|
64
|
+
/** Identity of the plan document under review, for its durable address. */
|
|
65
|
+
export interface PlanDocumentRef {
|
|
66
|
+
/** Logged tool invocation that owns the plan; absent while only the review is pending. */
|
|
67
|
+
readonly callId?: string;
|
|
68
|
+
/** Browser-unique pending request identity (the review card's key). */
|
|
69
|
+
readonly requestKey: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Address the plan document exactly as the official opener does.
|
|
73
|
+
*
|
|
74
|
+
* A logged plan (`callId` present) resolves from `dsh-resource://plan/...`
|
|
75
|
+
* for as long as the session log holds the call; before that the pending
|
|
76
|
+
* review's own `dsh-resource://plan-review/...` address is the one that
|
|
77
|
+
* opens its preview.
|
|
78
|
+
*
|
|
79
|
+
* @param sessionId - the session that owns the review.
|
|
80
|
+
* @param ref - logged call identity plus the pending request key.
|
|
81
|
+
* @returns The plan resource address.
|
|
82
|
+
*/
|
|
83
|
+
export declare function planDocumentAddress(sessionId: string, ref: PlanDocumentRef): string;
|
|
64
84
|
/**
|
|
65
|
-
* Make
|
|
85
|
+
* Make this plan the session's armed goal, replacing any unfinished goal.
|
|
86
|
+
*
|
|
87
|
+
* The objective is a short instruction carrying the plan document's address,
|
|
88
|
+
* not the plan's raw markdown: goal objectives are injected into every round,
|
|
89
|
+
* and a full plan would be truncated by length limits mid-sentence. The round
|
|
90
|
+
* driver reads the plan from the address instead.
|
|
66
91
|
*
|
|
67
92
|
* Ordering mirrors the card's own commit-then-answer rule: a refusal here keeps
|
|
68
93
|
* the Plan pending instead of approving work that no goal tracks. The replace
|
|
@@ -71,7 +96,8 @@ export type GoalHandoff = {
|
|
|
71
96
|
*
|
|
72
97
|
* @param remote - the released goal remote, absent when no goal package is mounted.
|
|
73
98
|
* @param sessionId - the session that owns both the review and the goal.
|
|
74
|
-
* @param plan - the plan markdown under review.
|
|
99
|
+
* @param plan - the plan markdown under review (validated non-empty).
|
|
100
|
+
* @param ref - the plan document identity used for its address.
|
|
75
101
|
* @returns Whether the goal now tracks this plan, or why it does not.
|
|
76
102
|
*/
|
|
77
|
-
export declare function setPlanAsGoal(remote: GoalRemote | undefined, sessionId: string, plan: string): Promise<GoalHandoff>;
|
|
103
|
+
export declare function setPlanAsGoal(remote: GoalRemote | undefined, sessionId: string, plan: string, ref: PlanDocumentRef): Promise<GoalHandoff>;
|