dsh-capability-panel 1.2.1 → 1.4.0
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.en.md +136 -0
- package/README.i18n.yaml +6 -5
- package/README.ja.md +17 -18
- package/README.ko.md +17 -18
- package/README.md +78 -79
- package/icon.svg +19 -0
- package/lib/client.js +2396 -2000
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +151 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7234 -198
- package/lib/index.js.map +1 -1
- package/package.json +18 -11
- package/README.zh.md +0 -137
package/lib/index.d.ts
CHANGED
|
@@ -35,6 +35,13 @@ interface LoaderEntryLike {
|
|
|
35
35
|
}
|
|
36
36
|
interface LoaderLike {
|
|
37
37
|
entries(): Iterable<LoaderEntryLike>;
|
|
38
|
+
/**
|
|
39
|
+
* Resolves once the initial load of every entry has settled. Optional: it is
|
|
40
|
+
* how dsh-settings defers its own legacy import, and the temporary recovery
|
|
41
|
+
* in `legacy-import.ts` probes it the same way; hosts whose loader predates
|
|
42
|
+
* it simply run the recovery immediately.
|
|
43
|
+
*/
|
|
44
|
+
await?(): Promise<unknown>;
|
|
38
45
|
}
|
|
39
46
|
interface AgentsService {
|
|
40
47
|
get(sessionId: string): AgentLike | undefined;
|
|
@@ -43,15 +50,41 @@ interface AgentsService {
|
|
|
43
50
|
}
|
|
44
51
|
interface AgentPresetLike {
|
|
45
52
|
readonly id: string;
|
|
46
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Present on dsh ≤ 0.1.6 (`dsh-agent-preset`); the 0.1.7 registry split
|
|
55
|
+
* dropped it from `list()` rows, so consumers must treat its absence as
|
|
56
|
+
* "unknown" rather than a shape violation.
|
|
57
|
+
*/
|
|
58
|
+
readonly trust?: 'system' | 'user';
|
|
59
|
+
/** Same story as {@link trust}: the 0.1.7 roster no longer carries paths. */
|
|
47
60
|
readonly path?: string;
|
|
48
61
|
readonly name?: string;
|
|
49
62
|
readonly description?: string;
|
|
50
63
|
readonly broken?: string;
|
|
51
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* The revision lease `acquireScope` hands back: the scope key to read with,
|
|
67
|
+
* plus async disposal that releases the mount's user count. Disposal is part
|
|
68
|
+
* of the contract — skipping it pins a generation against collection forever.
|
|
69
|
+
*/
|
|
70
|
+
interface ScopeLeaseLike {
|
|
71
|
+
readonly key: unknown;
|
|
72
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
73
|
+
}
|
|
52
74
|
interface AgentPresetsService {
|
|
53
75
|
list(): Promise<AgentPresetLike[]>;
|
|
54
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Read one preset's standing scope without starting an agent (dsh ≤ 0.1.6).
|
|
78
|
+
* Removed in 0.1.7 in favour of {@link acquireScope}; declared optional so
|
|
79
|
+
* the call site probes whichever the live service offers.
|
|
80
|
+
*/
|
|
81
|
+
standingKeyFor?(id?: string): Promise<unknown>;
|
|
82
|
+
/**
|
|
83
|
+
* 0.1.7 replacement: retain the preset's current generation and hand back
|
|
84
|
+
* its scope key behind a lease. The caller MUST dispose the lease when the
|
|
85
|
+
* scoped read completes.
|
|
86
|
+
*/
|
|
87
|
+
acquireScope?(id?: string): Promise<ScopeLeaseLike>;
|
|
55
88
|
composedPreset(agentCtx: unknown): string | undefined;
|
|
56
89
|
}
|
|
57
90
|
interface SettingsScopeLike<T> {
|
|
@@ -63,11 +96,44 @@ interface SettingsScopeLike<T> {
|
|
|
63
96
|
*/
|
|
64
97
|
replace(section: object): Promise<void>;
|
|
65
98
|
}
|
|
99
|
+
/** One row of the 0.1.7 settings form inventory, as far as this plugin reads it. */
|
|
100
|
+
interface SettingsDescriptor {
|
|
101
|
+
readonly ns?: unknown;
|
|
102
|
+
readonly value?: unknown;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The settings service across BOTH host generations.
|
|
106
|
+
*
|
|
107
|
+
* `register` is the ≤0.1.6 contract and is still optional here so the type spans
|
|
108
|
+
* both: 0.1.7 deleted it, and a plugin that hard-required it would fail to
|
|
109
|
+
* compile against the new host while shipping one bundle that must serve both.
|
|
110
|
+
* The 0.1.7 trio is likewise optional, since a ≤0.1.6 host has none of it.
|
|
111
|
+
* Every member is therefore probed at runtime in `bindSection` rather than
|
|
112
|
+
* assumed, which is also why this stays a structural type with no static import
|
|
113
|
+
* from `@deepseek-ai/dsh-settings`.
|
|
114
|
+
*/
|
|
66
115
|
interface SettingsService {
|
|
67
|
-
|
|
68
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Whether the surface accepts writes. A getter on 0.1.7 (unconditionally
|
|
118
|
+
* true); read only through the lazy non-strict path, never cached.
|
|
119
|
+
*/
|
|
120
|
+
readonly writable?: boolean;
|
|
121
|
+
register?<T>(namespace: string, schema: unknown, options?: {
|
|
69
122
|
applies?: 'live' | 'restart';
|
|
70
123
|
}): SettingsScopeLike<T>;
|
|
124
|
+
/**
|
|
125
|
+
* The live form inventory. Only entries whose Config declares a volatile
|
|
126
|
+
* field appear here, which is precisely why this plugin declares one.
|
|
127
|
+
*/
|
|
128
|
+
describe?(options?: {
|
|
129
|
+
redactSecrets?: boolean;
|
|
130
|
+
}): readonly SettingsDescriptor[];
|
|
131
|
+
/** Reset every live field of the namespace, then apply `section`. */
|
|
132
|
+
replace?(namespace: string, section: object, expectedRevision?: number): Promise<void>;
|
|
133
|
+
/** Recursive merge into the current section; cannot remove a key. */
|
|
134
|
+
update?(namespace: string, section: object, expectedRevision?: number): Promise<void>;
|
|
135
|
+
/** Ordered write operations against one namespace. */
|
|
136
|
+
mutate?(namespace: string, operations: readonly object[], expectedRevision?: number): Promise<void>;
|
|
71
137
|
}
|
|
72
138
|
interface SkillsService {
|
|
73
139
|
list(lookup: {
|
|
@@ -100,7 +166,47 @@ interface AgentCreatedPayload {
|
|
|
100
166
|
};
|
|
101
167
|
};
|
|
102
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* The Host's Session controller, as far as this plugin uses it: the two
|
|
171
|
+
* members that open one path on the user's own desktop. Structural like every
|
|
172
|
+
* other service here, so nothing static is imported from
|
|
173
|
+
* `@deepseek-ai/dsh-api-session-controller` — and it spans this plugin's whole
|
|
174
|
+
* supported range, because both members exist in every generation from
|
|
175
|
+
* 0.1.2-rc.1 through 0.2.x. The richer members (`workspaceDesktop`,
|
|
176
|
+
* `workspacePathApplications`) only appear from 0.1.7-rc.2, so they stay unused
|
|
177
|
+
* rather than optional-by-extra-probing.
|
|
178
|
+
*/
|
|
179
|
+
interface SessionControllerLike {
|
|
180
|
+
/**
|
|
181
|
+
* Whether this deployment can hand one path to a native desktop. `false` is
|
|
182
|
+
* an answer rather than a failure: either the deployment turned native
|
|
183
|
+
* opening off, or the platform announces no desktop at all.
|
|
184
|
+
*/
|
|
185
|
+
canOpenWorkspacePath(): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Verify the path through the composed filesystem, then open it natively.
|
|
188
|
+
* Rejects with the Host's own error when no verified mapping exists, which is
|
|
189
|
+
* how a sandboxed deployment refuses a path outside its roots.
|
|
190
|
+
*/
|
|
191
|
+
openWorkspacePath(request: {
|
|
192
|
+
readonly path: string;
|
|
193
|
+
}, signal: AbortSignal): Promise<unknown>;
|
|
194
|
+
}
|
|
103
195
|
interface HostServices {
|
|
196
|
+
/**
|
|
197
|
+
* This plugin's own cordis fiber, read for the profile entry id that 0.1.7
|
|
198
|
+
* keys settings by. Optional because a plugin mounted without the Loader (a
|
|
199
|
+
* bare `ctx.plugin`) has no entry, and because the field is a Loader
|
|
200
|
+
* decoration rather than part of cordis's own Context type — so it is probed,
|
|
201
|
+
* never assumed.
|
|
202
|
+
*/
|
|
203
|
+
readonly fiber?: {
|
|
204
|
+
readonly entry?: {
|
|
205
|
+
readonly options?: {
|
|
206
|
+
readonly id?: unknown;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
104
210
|
readonly webServer?: {
|
|
105
211
|
register(spec: {
|
|
106
212
|
kind: 'prefix';
|
|
@@ -108,13 +214,22 @@ interface HostServices {
|
|
|
108
214
|
handler: (req: IncomingLike$1, res: ServerResponseLike) => Promise<void> | void;
|
|
109
215
|
}): () => void;
|
|
110
216
|
};
|
|
111
|
-
/** The cordis loader
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
217
|
+
/** The cordis loader service (entry inventory + hot-swap), read via get(). */
|
|
218
|
+
/**
|
|
219
|
+
* The cordis reflect channel. `strict` defaults to true, which only returns
|
|
220
|
+
* an implementation whose providing fiber is CURRENTLY active: during
|
|
221
|
+
* startup and HMR windows that reads as absent even though the service
|
|
222
|
+
* exists. Every lazy root-level read in this plugin passes strict=false so
|
|
223
|
+
* a provider mid-transition still resolves; a genuinely unmounted service
|
|
224
|
+
* stays undefined either way.
|
|
225
|
+
*/
|
|
226
|
+
get(name: 'loader', strict?: boolean): LoaderLike | undefined;
|
|
227
|
+
get(name: 'agents', strict?: boolean): AgentsService | undefined;
|
|
228
|
+
get(name: 'agentPresets', strict?: boolean): AgentPresetsService | undefined;
|
|
229
|
+
get(name: 'settings', strict?: boolean): SettingsService | undefined;
|
|
230
|
+
get(name: 'sessionController', strict?: boolean): SessionControllerLike | undefined;
|
|
231
|
+
get(name: 'skills', strict?: boolean): SkillsService | undefined;
|
|
232
|
+
get(name: 'tools', strict?: boolean): ToolsService | undefined;
|
|
118
233
|
on(event: 'agent/created',
|
|
119
234
|
/**
|
|
120
235
|
* A returned promise is allowed on purpose. Cordis vetoes agent publication
|
|
@@ -197,6 +312,12 @@ interface SkillSummary {
|
|
|
197
312
|
readonly modelInvocable?: unknown;
|
|
198
313
|
};
|
|
199
314
|
readonly resourceBase?: unknown;
|
|
315
|
+
/**
|
|
316
|
+
* The absolute instruction file path, when the provider supplies one —
|
|
317
|
+
* `SKILL.md` for a directory bundle, the file itself for a flat Markdown
|
|
318
|
+
* skill, absent for a virtual skill registered in memory.
|
|
319
|
+
*/
|
|
320
|
+
readonly path?: unknown;
|
|
200
321
|
}
|
|
201
322
|
interface SkillDefinitionLike {
|
|
202
323
|
readonly name?: unknown;
|
|
@@ -205,6 +326,8 @@ interface SkillDefinitionLike {
|
|
|
205
326
|
readonly source?: unknown;
|
|
206
327
|
readonly provider?: unknown;
|
|
207
328
|
readonly resourceBase?: unknown;
|
|
329
|
+
/** The provider's instruction-file path, inherited by the panel's shadow. */
|
|
330
|
+
readonly path?: unknown;
|
|
208
331
|
}
|
|
209
332
|
interface IncomingLike$1 extends IncomingLike {
|
|
210
333
|
on?(event: 'data', listener: (chunk: unknown) => void): void;
|
|
@@ -217,9 +340,25 @@ interface ServerResponseLike {
|
|
|
217
340
|
}
|
|
218
341
|
//#endregion
|
|
219
342
|
//#region src/index.d.ts
|
|
343
|
+
/**
|
|
344
|
+
* This plugin's persisted state, declared where dsh 0.1.7 looks for it.
|
|
345
|
+
*
|
|
346
|
+
* The settings rewrite re-keyed every configurable namespace to a profile entry
|
|
347
|
+
* id and moved the values onto the entry's OWN Config, so a plugin that declares
|
|
348
|
+
* no Config is simply absent from the settings surface — `describe()` emits no
|
|
349
|
+
* descriptor and any write fails with `No configurable plugin entry`. Exporting
|
|
350
|
+
* this is what makes the entry configurable at all; the volatile markers inside
|
|
351
|
+
* (see `settings-schema.ts`) are what make writes apply live.
|
|
352
|
+
*
|
|
353
|
+
* It MUST be a named export of the module, not a property of `apply`: the loader
|
|
354
|
+
* resolves a module-shaped plugin down to its `apply` function and then reads
|
|
355
|
+
* `Config` off the enclosing module namespace. Attaching it to the function would
|
|
356
|
+
* be silently ignored.
|
|
357
|
+
*/
|
|
358
|
+
declare const Config: Schemastery<any, any, "plain">;
|
|
220
359
|
/** Host composition root: construct stores/controllers and register the route. */
|
|
221
360
|
declare function apply(ctx: HostServices): void;
|
|
222
361
|
declare const inject: string[];
|
|
223
362
|
//#endregion
|
|
224
|
-
export { apply, inject };
|
|
363
|
+
export { Config, apply, inject };
|
|
225
364
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/loopback.ts","../src/host/types.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;AACiB,UAAA,YAAA,CAAY;;;oBAGT;ECkBH;AAQjB
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/loopback.ts","../src/host/types.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;AACiB,UAAA,YAAA,CAAY;;;oBAGT;ECkBH;AAQjB;;;EAQY,SAAA,MAAA,CAAA,EAAA;IAAO,SAAA,aAAA,CAAA,EAAA,MAAA;EAkBF,CAAA;AAMjB;;;;AAAA;AAoBA;AAKA;;;;;AAa8B,UA9Eb,eAAA,CA8Ea;EAAO,SAAA,QAAA,CAAA,EAAA,OAAA;EA8BpB;EAWA,SAAA,OAAA,CAAA,EAAA;IAgBA,SAAA,EAAA,CAAA,EAAe,OAAA;IAMkF,SAAA,IAAA,CAAA,EAAA,OAAA;IAAlB,SAAA,MAAA,CAAA,EAAA,OAAA;EAKnC,CAAA;EAEc,QAAA,EAAA,EAhJ7D,OAgJ6D,CAAA,IAAA,CAAA;EAED,OAAA,EAAA,EAjJ7D,OAiJ6D,CAAA,IAAA,CAAA;;AAEqB,UAhJ9E,UAAA,CAgJ8E;EAW9E,OAAA,EAAA,EA1JJ,QA0JiB,CA1JR,eA0JQ,CAAA;EACsC;;;;;AAIpE;EAMiB,KAAA,GAAA,EA9JL,OA8JK,CAAA,OAAmB,CAAA;AAiBpC;AAmE2B,UAhOV,aAAA,CAgOU;EAcT,GAAA,CAAA,SAAA,EAAA,MAAA,CAAA,EA7OQ,SA6OR,GAAA,SAAA;EACT;EAAO,IAAA,EAAA,EA5ON,SA4OM,EAAA;AAqBhB;AAIiB,UAlQA,eAAA,CAkQS;EAiBT,SAAA,EAAA,EAAA,MAAY;EAeZ;AAWjB;AAMA;;;;ECvVa;EAGG,SAAK,IAAA,CAAA,EAAA,MAAM;E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