@lmzhen/dsh-evolution-skill-discovery 0.31.1 → 0.32.1

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.
@@ -1,62 +0,0 @@
1
- import type { DomainMapSnapshot } from './domain-map.ts';
2
- import type { SkillKey } from './identity.ts';
3
- /** Maintenance defaults from PLAN/MAP-009. */
4
- export declare const MAINTENANCE_DEFAULTS: Readonly<{
5
- splitSkillThreshold: 25;
6
- coarsenDomainCount: 12;
7
- maxVisibleDepth: 3;
8
- minChildren: 2;
9
- minMembersPerChild: 3;
10
- coarsenMinDomains: 3;
11
- coarsenMaxDomains: 8;
12
- }>;
13
- /** Read-only per-domain audit; no coverage claim is fabricated. */
14
- export interface DomainAudit {
15
- readonly domainId: string;
16
- readonly definitionComplete: boolean;
17
- readonly childCount: number;
18
- readonly directSkillCount: number;
19
- readonly indirectSkillCount: number;
20
- readonly empty: boolean;
21
- readonly orphan: boolean;
22
- readonly lastUpdated: number;
23
- }
24
- /** Map-level audit. */
25
- export interface DomainMapAudit {
26
- readonly domains: readonly DomainAudit[];
27
- readonly domainCount: number;
28
- readonly unclassifiedCount: number;
29
- }
30
- /** One split candidate; no domains/edges are created. */
31
- export interface SplitCandidate {
32
- readonly domainId: string;
33
- readonly directSkillCount: number;
34
- readonly children: number;
35
- readonly blockers: readonly string[];
36
- }
37
- /** One coarsen group; no edges are changed. */
38
- export interface CoarsenGroup {
39
- readonly domainIds: readonly string[];
40
- }
41
- /**
42
- * Audit domain definitions/structure without mutating the map.
43
- * @param snapshot - domain facts.
44
- * @param visibleSkillKeys - optional view skills for unclassified count.
45
- * @returns per-domain audit plus map-level counts.
46
- */
47
- export declare function auditDomainMap(snapshot: DomainMapSnapshot, visibleSkillKeys?: ReadonlySet<SkillKey>): DomainMapAudit;
48
- /**
49
- * Find split candidates; no child domains are created and no skills are reassigned.
50
- * @param snapshot - domain facts.
51
- * @param threshold - minimum direct members to consider.
52
- * @returns candidates with blockers.
53
- */
54
- export declare function splitCandidates(snapshot: DomainMapSnapshot, threshold?: 25): readonly SplitCandidate[];
55
- /**
56
- * Find coarsen groups; only structure candidates, never edge rewrites.
57
- * @param snapshot - domain facts.
58
- * @param maxDomains - above this count coarsening is considered.
59
- * @returns groups of 3–8 domains, at least 2 groups.
60
- */
61
- export declare function coarsenCandidates(snapshot: DomainMapSnapshot, maxDomains?: 12): readonly CoarsenGroup[];
62
- //# sourceMappingURL=maintenance.d.ts.map
@@ -1,31 +0,0 @@
1
- import type { Context } from '@deepseek-ai/cordis';
2
- import type { DomainGenerationProposal, GenerationSkillFact } from './domain-generation.ts';
3
- import { type DomainGenerationPort } from './domain-generation-service.ts';
4
- /** Plugin config; paths are supplied by the composition, never guessed. */
5
- export interface Config {
6
- readonly domainMapPath?: string | undefined;
7
- readonly sessionPath?: string | undefined;
8
- readonly featureEpoch: string;
9
- readonly mode?: 'off' | 'shadow' | 'on' | 'auto';
10
- readonly pinDomains?: readonly string[];
11
- readonly disableDomains?: readonly string[];
12
- readonly tokenBudget?: number;
13
- readonly staleAfterHours?: number;
14
- readonly mapStale?: boolean;
15
- readonly searchAvailable?: boolean;
16
- readonly domainMinDomains?: number;
17
- readonly domainMaxDomains?: number;
18
- readonly provisionalThreshold?: number;
19
- readonly maxCards?: number;
20
- readonly createClassificationEnabled?: boolean;
21
- readonly bootstrapDomains?: DomainGenerationProposal;
22
- readonly bootstrapSkillKeys?: Readonly<Record<string, string>>;
23
- readonly domainGeneration?: DomainGenerationPort;
24
- readonly domainGenerationSkills?: readonly GenerationSkillFact[];
25
- readonly domainGenerationSkillKeys?: Readonly<Record<string, string>>;
26
- }
27
- export declare const name = "evolution-skill-discovery";
28
- export declare const inject: string[];
29
- /** Compose discovery services from platform ports; no catalog/provider replacement. */
30
- export declare function apply(ctx: Context, config: Config): void;
31
- //# sourceMappingURL=plugin.d.ts.map
@@ -1,42 +0,0 @@
1
- import type { Agent } from '@deepseek-ai/dsh-agent';
2
- import type { DomainMapStore } from './domain-map.ts';
3
- import type { EffectiveDomainPolicy } from './domain-policy.ts';
4
- import { type SkillIndexSource } from './index.ts';
5
- import type { CatalogEntry, ProjectionResult } from './projection.ts';
6
- import type { DiscoverySessionStore } from './session-store.ts';
7
- /** Injectable composition ports; the platform adapter supplies concrete I/O. */
8
- export interface DiscoveryRuntimePorts {
9
- readonly skillIndexSource: SkillIndexSource;
10
- readonly map: DomainMapStore;
11
- readonly policy: EffectiveDomainPolicy;
12
- readonly sessionStore: DiscoverySessionStore;
13
- readonly featureEpoch: string;
14
- readonly mapVersion: string;
15
- readonly policyDigest: string;
16
- readonly adapterVersion: string;
17
- readonly projectionSchemaVersion: string;
18
- readonly discoveryMode: string;
19
- readonly maxCards?: number | undefined;
20
- readonly tokenBudget?: number | undefined;
21
- readonly autoMode?: boolean | undefined;
22
- readonly promoted?: boolean | (() => boolean) | undefined;
23
- readonly onProjection?: ((result: ProjectionResult) => void) | undefined;
24
- readonly staleAfterHours?: number | undefined;
25
- readonly maxVisibleDepth?: number | undefined;
26
- readonly mode?: 'off' | 'shadow' | 'on' | undefined;
27
- readonly mapStale?: boolean | undefined;
28
- readonly searchAvailable?: boolean | undefined;
29
- }
30
- /** G2 adapter provider wired from ports; no global platform dependency. */
31
- export declare class DiscoveryRuntime {
32
- private readonly ports;
33
- constructor(ports: DiscoveryRuntimePorts);
34
- /** @returns true only when persisted session metadata allows projection. */
35
- shouldProject(agent: Agent): Promise<boolean>;
36
- /** @returns a complete projection for this agent's catalog entries. */
37
- project(input: {
38
- readonly agent: Agent;
39
- readonly catalogEntries: readonly CatalogEntry[];
40
- }): Promise<ProjectionResult>;
41
- }
42
- //# sourceMappingURL=runtime.d.ts.map
@@ -1,19 +0,0 @@
1
- import type { Context } from '@deepseek-ai/cordis';
2
- /** Search-only composition config. Domain/projection config is intentionally absent. */
3
- export interface Config {
4
- /** Stable feature epoch used by later projection phases; required for config compatibility. */
5
- readonly featureEpoch: string;
6
- /** Register the model-visible skill_search tool. Defaults to true. */
7
- readonly searchEnabled?: boolean | undefined;
8
- /** Legacy discovery mode; search-only accepts only off and warns otherwise. */
9
- readonly mode?: 'off' | 'shadow' | 'on' | 'auto' | undefined;
10
- }
11
- export declare const name = "evolution-skill-discovery";
12
- export declare const inject: string[];
13
- /**
14
- * Compose the search-only discovery surface.
15
- * @param ctx - plugin context with skills, workingDirectory, and tools.
16
- * @param config - search-only configuration.
17
- */
18
- export declare function apply(ctx: Context, config: Config): void;
19
- //# sourceMappingURL=search-entry.d.ts.map
@@ -1,26 +0,0 @@
1
- /** One independent judge's EVAL-010 labels. */
2
- export interface JudgeObservation {
3
- readonly queryId: string;
4
- readonly relevant: boolean;
5
- readonly note?: string | undefined;
6
- }
7
- export interface JudgeRecord {
8
- readonly schemaVersion: 1;
9
- readonly querySet: 'eval-010';
10
- readonly judgeKind: 'model' | 'human';
11
- readonly judgeId: string;
12
- readonly observations: readonly JudgeObservation[];
13
- }
14
- /** Validate a judge packet without accepting partial query coverage. */
15
- export declare function validateJudgeRecord(record: JudgeRecord, expectedQueryIds: readonly string[]): readonly string[];
16
- /** Aggregate two independent judges; no label is rewritten. */
17
- export interface JudgeAggregate {
18
- readonly queryCount: number;
19
- readonly relevantRate: number | null;
20
- readonly agreementRate: number | null;
21
- readonly hasModel: boolean;
22
- readonly hasHuman: boolean;
23
- }
24
- /** @returns aggregate over model/human records; agreement only for shared queries. */
25
- export declare function aggregateJudge(records: readonly JudgeRecord[], expectedQueryIds: readonly string[]): JudgeAggregate;
26
- //# sourceMappingURL=search-judge.d.ts.map
@@ -1,19 +0,0 @@
1
- /** Persisted discovery metadata used to keep old sessions full-catalog. */
2
- export interface DiscoverySessionMeta {
3
- readonly discoveryMode?: 'off' | 'shadow' | 'on' | undefined;
4
- readonly featureEpoch?: string | undefined;
5
- }
6
- /** @returns true only for a new, fully-enabled session in the current epoch. */
7
- export declare function shouldHideCatalog(meta: DiscoverySessionMeta | undefined, currentFeatureEpoch: string): boolean;
8
- /** @returns true when awareness may be emitted (shadow or on). */
9
- export declare function shouldEmitAwareness(meta: DiscoverySessionMeta | undefined, currentFeatureEpoch: string): boolean;
10
- /** @returns false when the same digest was already emitted in this session. */
11
- export declare function shouldEmitDigest(previousDigest: string | undefined, nextDigest: string): boolean;
12
- /** @returns off at <=2200 tokens, on at >=3000, shadow between. */
13
- export declare function projectionBudgetMode(catalogTokens: number, promoted?: boolean): 'off' | 'shadow' | 'on';
14
- /** @returns true when a resumed session already enabled discovery. */
15
- export declare function shouldInstallAwarenessOnResume(record: {
16
- readonly discoveryMode: 'off' | 'shadow' | 'on';
17
- readonly featureEpoch: string;
18
- } | undefined, featureEpoch: string): boolean;
19
- //# sourceMappingURL=session-projection.d.ts.map
@@ -1,22 +0,0 @@
1
- import type { EvolutionIoLike } from '@lmzhen/dsh-evolution-core';
2
- /** One persisted session's discovery mode. */
3
- export interface DiscoverySessionRecord {
4
- readonly sessionId: string;
5
- readonly discoveryMode: 'off' | 'shadow' | 'on';
6
- readonly featureEpoch: string;
7
- readonly projectionDigest?: string | undefined;
8
- }
9
- /** Plugin-side session metadata; platform SessionHeader has no discovery fields. */
10
- export declare class DiscoverySessionStore {
11
- private readonly io;
12
- private readonly path;
13
- constructor(io: EvolutionIoLike, path: string);
14
- private read;
15
- /** @returns persisted metadata for one session. */
16
- get(sessionId: string): Promise<DiscoverySessionRecord | undefined>;
17
- /** Persist one session's mode/epoch; later writes win. */
18
- put(record: DiscoverySessionRecord): Promise<void>;
19
- }
20
- /** @returns true only for a persisted enabled session in the current feature epoch. */
21
- export declare function shouldProjectPersistedSession(store: DiscoverySessionStore, sessionId: string, currentFeatureEpoch: string): Promise<boolean>;
22
- //# sourceMappingURL=session-store.d.ts.map
@@ -1,6 +0,0 @@
1
- /** Ordered implementation stages from PLAN-DISC-001. */
2
- export declare const DISCOVERY_STAGES: readonly ["G0-projection", "G1-domain", "G2-projection", "G3-search", "G4-assignment", "G5-maintenance", "G6-ui", "G7-migration", "G8-release"];
3
- export type DiscoveryStage = (typeof DISCOVERY_STAGES)[number];
4
- export declare function stageIndex(stage: DiscoveryStage): number;
5
- export declare function mayAdvance(current: DiscoveryStage, next: DiscoveryStage): boolean;
6
- //# sourceMappingURL=stages.d.ts.map
package/lib/types/ui.d.ts DELETED
@@ -1,69 +0,0 @@
1
- /** Read-only card projection for UI; counts are intentionally separate. */
2
- export interface DiscoveryCardView {
3
- readonly id: string;
4
- readonly title: string;
5
- readonly purpose: string;
6
- readonly descriptionStatus: 'fresh' | 'stale' | 'failed';
7
- readonly triggers: readonly string[];
8
- readonly managedModelInvocableCount: number;
9
- readonly externalCatalogCount: number;
10
- readonly pendingCount: number;
11
- readonly mapStale: boolean;
12
- readonly asOf: string;
13
- }
14
- /** Read-only product state; no L1/L2 tree or task view. */
15
- export interface DiscoveryUiState {
16
- readonly cards: readonly DiscoveryCardView[];
17
- readonly unclassifiedCount: number;
18
- readonly mapStale: boolean;
19
- readonly completeness: 'complete' | 'partial' | 'unavailable';
20
- readonly asOf: string;
21
- readonly searchEnabled: boolean;
22
- }
23
- /** Allowed user policy fields; anything else is rejected. */
24
- export interface DiscoveryUserPolicy {
25
- readonly mode?: 'auto' | 'off' | 'on' | undefined;
26
- readonly maxCards?: number | undefined;
27
- readonly tokenBudget?: number | undefined;
28
- readonly staleAfterHours?: number | undefined;
29
- readonly pinDomains?: readonly string[] | undefined;
30
- readonly disableDomains?: readonly string[] | undefined;
31
- }
32
- /** @returns true when the policy only edits supported fields. */
33
- export declare function isDiscoveryUserPolicy(value: unknown): value is DiscoveryUserPolicy;
34
- /** Static skill_manage description; no dynamic domain list/count/tree. */
35
- export declare const SKILL_MANAGE_DESCRIPTION = "Manage skill content. create may include an optional domain proposal when create-side domain cards are available; no proposal means unclassified. Domain assignment never blocks skill creation and is stored as a sidecar.";
36
- /** Future skill_domains contract; NOT a search parameter and not implemented in v0. */
37
- export interface SkillDomainsContract {
38
- readonly action: 'list' | 'expand';
39
- readonly domainId?: string | undefined;
40
- readonly depth?: 1 | 2 | undefined;
41
- }
42
- /** Replayable behavior metrics; no prompt sentence lock. */
43
- export interface DiscoveryBehaviorObservation {
44
- readonly awarenessShown: boolean;
45
- readonly awarenessRecalled: boolean;
46
- readonly silentMiss: boolean;
47
- readonly searched: boolean;
48
- readonly overSearch: boolean;
49
- readonly underSearch: boolean;
50
- readonly wrongLoad: boolean;
51
- readonly taskSuccess: boolean;
52
- readonly tokens: number;
53
- readonly fallback: boolean;
54
- }
55
- /** Behavior metrics for one fixture/replay batch. */
56
- export interface DiscoveryBehaviorMetrics {
57
- readonly awarenessRecall: number | null;
58
- readonly silentMissRate: number | null;
59
- readonly overSearchRate: number | null;
60
- readonly underSearchRate: number | null;
61
- readonly wrongLoadRate: number | null;
62
- readonly taskSuccess: number | null;
63
- readonly tokens: number;
64
- readonly fallbackRate: number | null;
65
- readonly total: number;
66
- }
67
- /** @returns recomputable behavior metrics; null means no denominator. */
68
- export declare function computeBehaviorMetrics(observations: readonly DiscoveryBehaviorObservation[]): DiscoveryBehaviorMetrics;
69
- //# sourceMappingURL=ui.d.ts.map