dsh-desktop-enhance 0.3.0 → 0.3.2
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/README.md +17 -7
- package/lib/client.js +2532 -589
- package/lib/index.d.ts +56 -3
- package/lib/index.js +1315 -110
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -95,7 +95,14 @@ declare function handleSessionInfo(ctx: HostContext, request: Request): Promise<
|
|
|
95
95
|
declare function registerSessionInfoRoute(ctx: HostContext): () => void;
|
|
96
96
|
//#endregion
|
|
97
97
|
//#region src/shared/tools-manager.d.ts
|
|
98
|
-
|
|
98
|
+
type ToolScope = 'builtin' | 'plugin';
|
|
99
|
+
interface ToolOriginMeta {
|
|
100
|
+
readonly scope: ToolScope;
|
|
101
|
+
readonly pluginName: string;
|
|
102
|
+
readonly sourceBadge: string;
|
|
103
|
+
readonly groupKey: string;
|
|
104
|
+
}
|
|
105
|
+
interface ToolSummary extends Partial<ToolOriginMeta> {
|
|
99
106
|
readonly name: string;
|
|
100
107
|
readonly description: string;
|
|
101
108
|
}
|
|
@@ -114,12 +121,41 @@ interface HostPromptAssembly {
|
|
|
114
121
|
interface ToolsHostContext extends HostContext {
|
|
115
122
|
on?(event: string, listener: (assembly: HostPromptAssembly, context: unknown, next: () => Promise<HostPromptAssembly>) => Promise<HostPromptAssembly>): () => void;
|
|
116
123
|
}
|
|
117
|
-
declare function
|
|
124
|
+
declare function resolveSessionIdFromScope(candidate: unknown, ctx?: HostContext): string | undefined;
|
|
125
|
+
declare function readToolsConfig(config: unknown, sessionId?: string): ToolsPolicyState;
|
|
126
|
+
declare function resolveFiberModuleName(fiber: unknown): string | undefined;
|
|
127
|
+
declare function scanCordisFiberToolOwners(ctx: HostContext, targetOwners?: Map<string, string>): Map<string, string>;
|
|
118
128
|
declare function collectAllToolSchemas(ctx: HostContext): Promise<readonly ToolSummary[]>;
|
|
119
|
-
declare function installToolsPolicy(ctx: ToolsHostContext, readState: () => ToolsPolicyState): () => void;
|
|
129
|
+
declare function installToolsPolicy(ctx: ToolsHostContext, readState: (sessionId?: string) => ToolsPolicyState): () => void;
|
|
120
130
|
declare function handleToolsCatalog(ctx: HostContext): Promise<Response>;
|
|
121
131
|
declare function registerToolsRoute(ctx: HostContext): () => void;
|
|
122
132
|
//#endregion
|
|
133
|
+
//#region src/shared/skills-manager.d.ts
|
|
134
|
+
type SkillScope = 'project' | 'global' | 'plugin';
|
|
135
|
+
interface SkillCatalogItem {
|
|
136
|
+
readonly name: string;
|
|
137
|
+
readonly description: string;
|
|
138
|
+
readonly source: string;
|
|
139
|
+
readonly provider: string;
|
|
140
|
+
readonly scope: SkillScope;
|
|
141
|
+
readonly sourceBadge: string;
|
|
142
|
+
readonly path?: string;
|
|
143
|
+
readonly whenToUse?: string;
|
|
144
|
+
readonly modelInvocable: boolean;
|
|
145
|
+
readonly userInvocable: boolean;
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/skills-manager/host.d.ts
|
|
149
|
+
interface SkillsPolicyState {
|
|
150
|
+
readonly enabled: boolean;
|
|
151
|
+
readonly disabled: ReadonlySet<string>;
|
|
152
|
+
}
|
|
153
|
+
declare function readSkillsConfig(config: unknown, sessionId?: string): SkillsPolicyState;
|
|
154
|
+
declare function collectSkillCatalog(ctx: HostContext, sessionId?: string): Promise<readonly SkillCatalogItem[]>;
|
|
155
|
+
declare function installSkillsPolicy(ctx: ToolsHostContext, readState: (sessionId?: string) => SkillsPolicyState): () => void;
|
|
156
|
+
declare function handleSkillsCatalog(ctx: HostContext, request?: Request): Promise<Response>;
|
|
157
|
+
declare function registerSkillsRoute(ctx: HostContext): () => void;
|
|
158
|
+
//#endregion
|
|
123
159
|
//#region src/index.d.ts
|
|
124
160
|
export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
125
161
|
findBar: Schema<boolean, boolean, "volatile-defined">;
|
|
@@ -129,10 +165,14 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
129
165
|
stepDuration: Schema<boolean, boolean, "volatile-defined">;
|
|
130
166
|
sessionInfo: Schema<boolean, boolean, "volatile-defined">;
|
|
131
167
|
toolsManager: Schema<boolean, boolean, "volatile-defined">;
|
|
168
|
+
skillsManager: Schema<boolean, boolean, "volatile-defined">;
|
|
132
169
|
suggestModel: Schema<string, string, "volatile-defined">;
|
|
133
170
|
suggestReasoning: Schema<string, string, "volatile-defined">;
|
|
134
171
|
suggestPrompt: Schema<string, string, "volatile-defined">;
|
|
135
172
|
disabledTools: Schema<string, string, "volatile-defined">;
|
|
173
|
+
sessionToolOverrides: Schema<string, string, "volatile-defined">;
|
|
174
|
+
disabledSkills: Schema<string, string, "volatile-defined">;
|
|
175
|
+
sessionSkillOverrides: Schema<string, string, "volatile-defined">;
|
|
136
176
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
137
177
|
findBar: Schema<boolean, boolean, "volatile-defined">;
|
|
138
178
|
turnPrefix: Schema<boolean, boolean, "volatile-defined">;
|
|
@@ -141,10 +181,14 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
141
181
|
stepDuration: Schema<boolean, boolean, "volatile-defined">;
|
|
142
182
|
sessionInfo: Schema<boolean, boolean, "volatile-defined">;
|
|
143
183
|
toolsManager: Schema<boolean, boolean, "volatile-defined">;
|
|
184
|
+
skillsManager: Schema<boolean, boolean, "volatile-defined">;
|
|
144
185
|
suggestModel: Schema<string, string, "volatile-defined">;
|
|
145
186
|
suggestReasoning: Schema<string, string, "volatile-defined">;
|
|
146
187
|
suggestPrompt: Schema<string, string, "volatile-defined">;
|
|
147
188
|
disabledTools: Schema<string, string, "volatile-defined">;
|
|
189
|
+
sessionToolOverrides: Schema<string, string, "volatile-defined">;
|
|
190
|
+
disabledSkills: Schema<string, string, "volatile-defined">;
|
|
191
|
+
sessionSkillOverrides: Schema<string, string, "volatile-defined">;
|
|
148
192
|
}>>, "plain">;
|
|
149
193
|
export declare function apply(ctx: ToolsHostContext, config?: unknown): void;
|
|
150
194
|
export declare const __test: {
|
|
@@ -153,6 +197,7 @@ export declare const __test: {
|
|
|
153
197
|
SUGGEST_EFFORTS_PATH: string;
|
|
154
198
|
SESSION_INFO_PATH: string;
|
|
155
199
|
TOOLS_PATH: string;
|
|
200
|
+
SKILLS_PATH: string;
|
|
156
201
|
MODEL_TIMEOUT_MS: number;
|
|
157
202
|
MAX_OUTPUT_TOKENS: number;
|
|
158
203
|
buildPrompt: typeof buildPrompt;
|
|
@@ -162,12 +207,20 @@ export declare const __test: {
|
|
|
162
207
|
handleSuggest: typeof handleSuggest;
|
|
163
208
|
handleSessionInfo: typeof handleSessionInfo;
|
|
164
209
|
handleToolsCatalog: typeof handleToolsCatalog;
|
|
210
|
+
handleSkillsCatalog: typeof handleSkillsCatalog;
|
|
165
211
|
collectAllToolSchemas: typeof collectAllToolSchemas;
|
|
212
|
+
collectSkillCatalog: typeof collectSkillCatalog;
|
|
166
213
|
installToolsPolicy: typeof installToolsPolicy;
|
|
214
|
+
installSkillsPolicy: typeof installSkillsPolicy;
|
|
167
215
|
readToolsConfig: typeof readToolsConfig;
|
|
216
|
+
readSkillsConfig: typeof readSkillsConfig;
|
|
217
|
+
resolveFiberModuleName: typeof resolveFiberModuleName;
|
|
218
|
+
resolveSessionIdFromScope: typeof resolveSessionIdFromScope;
|
|
219
|
+
scanCordisFiberToolOwners: typeof scanCordisFiberToolOwners;
|
|
168
220
|
registerSuggestRoute: typeof registerSuggestRoute;
|
|
169
221
|
registerSessionInfoRoute: typeof registerSessionInfoRoute;
|
|
170
222
|
registerToolsRoute: typeof registerToolsRoute;
|
|
223
|
+
registerSkillsRoute: typeof registerSkillsRoute;
|
|
171
224
|
routeOf: typeof routeOf;
|
|
172
225
|
quietEffortFor: typeof quietEffortFor;
|
|
173
226
|
listModels: typeof listModels;
|