relay-dsh-plugin-manager 0.2.5 → 0.3.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/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PluginSearchRuntime, c as PluginSource, i as PluginSearchRequest, l as inspectPluginSource, n as PluginSearchMatch, o as FetchOptions, r as PluginSearchProvider, s as PluginInspection, t as PluginSearchCandidate } from "./search-runtime-DsmnI673.js";
1
+ import { a as PluginSearchRuntime, c as PluginSource, i as PluginSearchRequest, l as inspectPluginSource, n as PluginSearchMatch, o as FetchOptions, r as PluginSearchProvider, s as PluginInspection, t as PluginSearchCandidate } from "./search-runtime-gzUZ5Yb3.js";
2
2
  import { spawn } from "node:child_process";
3
3
  import { Context } from "@deepseek-ai/cordis";
4
4
 
@@ -12,6 +12,52 @@ interface TelemetryConfig {
12
12
  enabled?: boolean;
13
13
  /** Registry telemetry endpoint. Only the canonical service or localhost is accepted. */
14
14
  endpoint?: string;
15
+ /** Marks an operator-controlled acceptance run so analytics can exclude it. */
16
+ test?: boolean;
17
+ }
18
+ //#endregion
19
+ //#region src/search.d.ts
20
+ interface SearchResultSource {
21
+ inspection: PluginInspection;
22
+ providers: string[];
23
+ evidence: string[];
24
+ }
25
+ interface SearchResult {
26
+ query: string;
27
+ candidates: Array<{
28
+ rank: number;
29
+ identity: string;
30
+ packageName: string;
31
+ description: string | null;
32
+ repository: string | null;
33
+ repositoryOwner: string | null;
34
+ providers: string[];
35
+ matchReasons: string[];
36
+ semanticMatches: Array<{
37
+ directoryVersion: string | null;
38
+ canonicalPathKey: string | null;
39
+ canonicalPath: string[];
40
+ matchedCapabilities: string[];
41
+ retrievalSources: string[];
42
+ }>;
43
+ sources: SearchResultSource[];
44
+ recommendedSource: string;
45
+ }>;
46
+ presentation: {
47
+ order: 'rank_ascending';
48
+ returnedCandidates: number;
49
+ requestedMaximum: number;
50
+ includeEveryDistinctRelevantSolution: true;
51
+ excludeClearlyIrrelevant: true;
52
+ deduplicateEquivalentSources: true;
53
+ padToRequestedMaximum: false;
54
+ silentTopNTruncation: false;
55
+ };
56
+ providerErrors: Array<{
57
+ provider: string;
58
+ error: string;
59
+ }>;
60
+ rejectedCandidates: number;
15
61
  }
16
62
  //#endregion
17
63
  //#region src/profile.d.ts
@@ -223,6 +269,88 @@ declare class DshRestarter {
223
269
  };
224
270
  }
225
271
  //#endregion
272
+ //#region src/task-solutions.d.ts
273
+ interface TaskRoleInput {
274
+ id: string;
275
+ label: string;
276
+ query: string;
277
+ required?: boolean;
278
+ }
279
+ interface TaskRole {
280
+ id: string;
281
+ label: string;
282
+ query: string;
283
+ required: boolean;
284
+ }
285
+ interface TaskAmbiguityInput {
286
+ id: string;
287
+ question: string;
288
+ options: string[];
289
+ }
290
+ type TaskSolutionCandidate = Omit<SearchResult['candidates'][number], 'sources'>;
291
+ interface TaskRoleSearchGroup extends TaskRole {
292
+ candidates: TaskSolutionCandidate[];
293
+ providerErrors: SearchResult['providerErrors'];
294
+ rejectedCandidates: number;
295
+ }
296
+ interface TaskSolutionDraft {
297
+ schemaVersion: '1.0.0';
298
+ solutionId: string;
299
+ task: string;
300
+ status: 'needs_review' | 'incomplete' | 'ambiguous';
301
+ createdAt: number;
302
+ expiresAt: number;
303
+ roles: TaskRoleSearchGroup[];
304
+ ambiguities: TaskAmbiguityInput[];
305
+ }
306
+ interface TaskRoleSelection {
307
+ roleId: string;
308
+ candidateIdentities: string[];
309
+ }
310
+ interface AssessedTaskRole extends TaskRole {
311
+ status: 'covered' | 'missing_required' | 'missing_optional';
312
+ primaryCandidateIdentity: string | null;
313
+ alternativeCandidateIdentities: string[];
314
+ }
315
+ interface TaskSolutionAssessment {
316
+ schemaVersion: '1.0.0';
317
+ solutionId: string;
318
+ task: string;
319
+ status: 'complete' | 'incomplete' | 'ambiguous';
320
+ roles: AssessedTaskRole[];
321
+ ambiguities: TaskAmbiguityInput[];
322
+ solutions: Array<TaskSolutionCandidate & {
323
+ roleIds: string[];
324
+ }>;
325
+ coverage: {
326
+ requiredRoles: number;
327
+ coveredRequiredRoles: number;
328
+ optionalRoles: number;
329
+ coveredOptionalRoles: number;
330
+ missingRequiredRoleIds: string[];
331
+ complete: boolean;
332
+ };
333
+ }
334
+ interface TaskSolutionStoreOptions {
335
+ now?: () => number;
336
+ id?: () => string;
337
+ ttlMs?: number;
338
+ }
339
+ declare class TaskSolutionStore {
340
+ private readonly now;
341
+ private readonly id;
342
+ private readonly ttlMs;
343
+ private readonly drafts;
344
+ constructor(options?: TaskSolutionStoreOptions);
345
+ create(input: {
346
+ task: string;
347
+ roles: TaskRoleInput[];
348
+ ambiguities?: TaskAmbiguityInput[];
349
+ searches: Record<string, SearchResult>;
350
+ }): TaskSolutionDraft;
351
+ assess(solutionIdValue: string, selectionValues: TaskRoleSelection[]): TaskSolutionAssessment;
352
+ }
353
+ //#endregion
226
354
  //#region src/manager.d.ts
227
355
  interface LoaderEntryLike {
228
356
  id?: string;
@@ -251,13 +379,19 @@ interface PluginManagerDependencies {
251
379
  fetchOptions?: Omit<FetchOptions, 'signal'>;
252
380
  hmrTimeoutMs?: number;
253
381
  telemetry?: Telemetry;
382
+ taskSolutions?: TaskSolutionStore;
254
383
  }
255
384
  interface DiscoverRequest {
256
- action: 'list' | 'search' | 'inspect' | 'status';
385
+ action: 'list' | 'search' | 'search_roles' | 'assess_solution' | 'inspect' | 'status';
257
386
  query?: string;
258
387
  target?: string;
259
388
  operationId?: string;
260
389
  maxResults?: number;
390
+ maxResultsPerRole?: number;
391
+ roles?: TaskRoleInput[];
392
+ ambiguities?: TaskAmbiguityInput[];
393
+ solutionId?: string;
394
+ selections?: TaskRoleSelection[];
261
395
  }
262
396
  interface PlanRequest {
263
397
  operation: PlanAction;
@@ -315,6 +449,7 @@ declare class PluginManager {
315
449
  private readonly fetchOptions;
316
450
  private readonly hmrTimeoutMs;
317
451
  private readonly telemetry;
452
+ private readonly taskSolutions;
318
453
  constructor(dependencies: PluginManagerDependencies);
319
454
  private capture;
320
455
  private loaderEntries;
@@ -350,5 +485,5 @@ interface Config {
350
485
  }
351
486
  declare function apply(ctx: Context, config?: Config): void;
352
487
  //#endregion
353
- export { Config, DEFAULT_REGISTRY_ORIGIN, type DiscoverRequest, type InstallManyItemResult, type InstallManyItemStatus, type InstallManyResult, type MutationResult, type PlanRequest, type PluginInspection, PluginManager, type PluginSearchCandidate, type PluginSearchMatch, type PluginSearchProvider, type PluginSearchRequest, type PluginSource, type TelemetryConfig, apply, inject, name };
488
+ export { Config, DEFAULT_REGISTRY_ORIGIN, type DiscoverRequest, type InstallManyItemResult, type InstallManyItemStatus, type InstallManyResult, type MutationResult, type PlanRequest, type PluginInspection, PluginManager, type PluginSearchCandidate, type PluginSearchMatch, type PluginSearchProvider, type PluginSearchRequest, type PluginSource, type TaskAmbiguityInput, type TaskRoleInput, type TaskRoleSelection, type TaskSolutionAssessment, type TaskSolutionDraft, type TelemetryConfig, apply, inject, name };
354
489
  //# sourceMappingURL=index.d.ts.map