dsh-model-think-level 2.0.0 → 2.0.3

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.
Files changed (41) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +23 -13
  3. package/assets/NOTICE.md +15 -0
  4. package/assets/unified_bank.json +32910 -0
  5. package/lib/client/EffortEditor.d.ts +53 -21
  6. package/lib/client/FingerprintPane.d.ts +36 -0
  7. package/lib/client/capacity.d.ts +46 -0
  8. package/lib/client/configured-inputs.d.ts +11 -2
  9. package/lib/client/fingerprint-client.d.ts +81 -0
  10. package/lib/client/fingerprint-runner.d.ts +73 -0
  11. package/lib/client/index.d.ts +6 -0
  12. package/lib/client/injection/create-key-seat.d.ts +4 -5
  13. package/lib/client/injection/editor-tab-bar.d.ts +2 -1
  14. package/lib/client/injection/editor-tabs.d.ts +11 -1
  15. package/lib/client/injection/key-reveal.d.ts +12 -0
  16. package/lib/client/injection/models-page-editor.d.ts +117 -2
  17. package/lib/client/injection/provider-card-slot.d.ts +3 -1
  18. package/lib/client/key-manager-client.d.ts +2 -1
  19. package/lib/client/locales.d.ts +37 -9
  20. package/lib/client/ops.d.ts +15 -2
  21. package/lib/client/refresh-scheduler.d.ts +29 -0
  22. package/lib/client/styles.d.ts +1 -1
  23. package/lib/client/types.d.ts +26 -2
  24. package/lib/client.js +701 -225
  25. package/lib/client.js.map +4 -4
  26. package/lib/constants.d.ts +24 -0
  27. package/lib/detection.d.ts +7 -0
  28. package/lib/fingerprint/bank.d.ts +24 -0
  29. package/lib/fingerprint/challenges.d.ts +14 -0
  30. package/lib/fingerprint/core.d.ts +85 -0
  31. package/lib/fingerprint/eligibility.d.ts +8 -0
  32. package/lib/fingerprint/random.d.ts +4 -0
  33. package/lib/fingerprint/run.d.ts +128 -0
  34. package/lib/fingerprint/store.d.ts +31 -0
  35. package/lib/fingerprint/verdict.d.ts +90 -0
  36. package/lib/index.js +1212 -251
  37. package/lib/index.js.map +4 -4
  38. package/lib/key-probe.d.ts +13 -98
  39. package/lib/knowledge.d.ts +21 -0
  40. package/lib/multi-key-listing.d.ts +3 -3
  41. package/package.json +13 -5
@@ -39,6 +39,8 @@ interface ProviderCardOccurrence {
39
39
  export type ProviderCardSlotProps = ProviderCardOccurrence & {
40
40
  api: RemoteApi;
41
41
  t: Translate;
42
+ /** The client root, so the fingerprint pane can subscribe to document edits. */
43
+ ctx?: ClientContext;
42
44
  };
43
45
  /**
44
46
  * The occurrence component: resolve this card's route, render the editor with
@@ -46,7 +48,7 @@ export type ProviderCardSlotProps = ProviderCardOccurrence & {
46
48
  * itself with the official editor. Exported for its own tests (the registration
47
49
  * below is the production path).
48
50
  */
49
- export declare function ProviderCardSlot({ provider, api, t }: ProviderCardSlotProps): ReactNode;
51
+ export declare function ProviderCardSlot({ provider, api, t, ctx }: ProviderCardSlotProps): ReactNode;
50
52
  /**
51
53
  * Take the provider-card seat.
52
54
  * @param ctx - client root context (its `slots` service registers the seat).
@@ -64,7 +64,8 @@ export interface KeyRow {
64
64
  * The key's cooldown, when it is resting after a failure: how long until it
65
65
  * is a normal candidate again, and how many consecutive failures produced
66
66
  * the period. Absent means the key is a normal candidate right now — the
67
- * state the row's status dot paints as healthy.
67
+ * state the routing pool sees as healthy. (No row paints it any more; the
68
+ * field carries what the pool sees.)
68
69
  */
69
70
  readonly rest?: {
70
71
  /** Milliseconds until the key is a normal candidate again (>= 0). */
@@ -23,25 +23,21 @@ export declare const en: {
23
23
  autoAdaptBlockedHint: string;
24
24
  apply: string;
25
25
  reset: string;
26
- pendingSave: string;
27
- pendingHint: string;
28
- appliedHint: string;
29
- inputHintEndpoint: string;
30
- inputHintKnowledge: string;
31
- inputHintHeuristic: string;
32
26
  referenceTitle: string;
33
27
  contextWindowLabel: string;
34
28
  maxTokensLabel: string;
35
29
  capacityBlank: string;
30
+ capacityUnitsHint: string;
36
31
  capacityRule: string;
37
32
  tokensUnit: string;
38
33
  inputModality: string;
39
34
  modalityImage: string;
35
+ modalityImageGen: string;
36
+ modalityImageGenHint: string;
40
37
  modalityInherit: string;
38
+ modalityDeclared: string;
39
+ capacityInherit: string;
41
40
  clearDeclaration: string;
42
- confidence_high: string;
43
- confidence_medium: string;
44
- confidence_low: string;
45
41
  noSuggestion: string;
46
42
  writeError: string;
47
43
  renderFailed: string;
@@ -49,6 +45,7 @@ export declare const en: {
49
45
  wireValue: string;
50
46
  wireShow: string;
51
47
  wireHide: string;
48
+ wireHint: string;
52
49
  reasoningDisabled: string;
53
50
  bareHint: string;
54
51
  defaultRiskDisabled: string;
@@ -74,6 +71,7 @@ export declare const en: {
74
71
  tagVision: string;
75
72
  tagThinking: string;
76
73
  sliderNoCurrent: string;
74
+ sliderCommitSlow: string;
77
75
  defaultEffortLabel: string;
78
76
  defaultEffortUnset: string;
79
77
  defaultEffortHint: string;
@@ -87,6 +85,35 @@ export declare const en: {
87
85
  editorTabProvider: string;
88
86
  editorTabModels: string;
89
87
  editorTabAdvanced: string;
88
+ editorTabFingerprint: string;
89
+ fpTitle: string;
90
+ fpIntro: string;
91
+ fpCount: string;
92
+ fpSummary: string;
93
+ fpSummaryNone: string;
94
+ fpRunning: string;
95
+ fpDetectAll: string;
96
+ fpDetect: string;
97
+ fpRetest: string;
98
+ fpRetry: string;
99
+ fpCost: string;
100
+ fpForget: string;
101
+ fpStateUnchecked: string;
102
+ fpStateRunning: string;
103
+ fpStateIdentified: string;
104
+ fpStateDoubtful: string;
105
+ fpStateFailed: string;
106
+ fpQueued: string;
107
+ fpEvidence: string;
108
+ fpDetailShow: string;
109
+ fpDetailHide: string;
110
+ fpFamily: string;
111
+ fpCandidates: string;
112
+ fpClosedSet: string;
113
+ fpCheckedAt: string;
114
+ fpTiming: string;
115
+ fpLoadFailed: string;
116
+ fpRunFailed: string;
90
117
  keyRevealShow: string;
91
118
  keyRevealHide: string;
92
119
  keyRevealFailed: string;
@@ -160,6 +187,7 @@ export declare const en: {
160
187
  headersSave: string;
161
188
  headersCancel: string;
162
189
  headersClear: string;
190
+ headersRemove: string;
163
191
  headersSaved: string;
164
192
  headersCleared: string;
165
193
  headersReadOnly: string;
@@ -6,7 +6,7 @@
6
6
  * @module dsh-model-think-level/client/ops
7
7
  */
8
8
  import { type CompatSuggestion, type InputModalities, type ReasoningEfforts } from '../knowledge.js';
9
- import type { DefaultEffortIntent, EffortEditorApi, EffortWriteIntent, HeldWrite, InputIntent, RemoteApi, SettingsJoin, SettingsNamespaceView } from './types.js';
9
+ import type { DefaultEffortIntent, EffortEditorApi, EffortWriteIntent, HeldWrite, ImageGenIntent, InputIntent, RemoteApi, SettingsJoin, SettingsNamespaceView } from './types.js';
10
10
  /** The user-layer providers dict of the pi-ai namespace, as records. */
11
11
  export declare function providersOf(namespace: SettingsNamespaceView | undefined): Record<string, Record<string, unknown>>;
12
12
  /**
@@ -43,6 +43,13 @@ export declare function effortsOf(models: Record<string, unknown>[], modelId: st
43
43
  export declare function inputOf(models: Record<string, unknown>[], modelId: string): InputModalities | undefined;
44
44
  /** The stored compat block of one model in a route's models (unvalidated passthrough). */
45
45
  export declare function compatOf(models: Record<string, unknown>[], modelId: string): CompatSuggestion | undefined;
46
+ /**
47
+ * Whether one model in a route's models is declared an IMAGE GENERATOR (生图).
48
+ * The marker is plugin-owned and truthy-only: any value other than `true`
49
+ * reads as "not an image generator", so a hostile or stale document can never
50
+ * half-apply the state.
51
+ */
52
+ export declare function imageGenOf(models: Record<string, unknown>[], modelId: string): boolean;
46
53
  /** The display name of one model in a route's models. */
47
54
  export declare function nameOf(models: Record<string, unknown>[], modelId: string): string | undefined;
48
55
  /**
@@ -52,6 +59,10 @@ export declare function nameOf(models: Record<string, unknown>[], modelId: strin
52
59
  * must degrade to "no default", never poison the memory chain.
53
60
  */
54
61
  export declare function defaultEffortOf(models: Record<string, unknown>[], modelId: string): string | undefined;
62
+ /**
63
+ * Forget the cached listings (a settings change can move a route's endpoint).
64
+ */
65
+ export declare function invalidateProbeCache(): void;
55
66
  /**
56
67
  * Build the write seam over a settings Remote face.
57
68
  * @param api - the settings Remote methods.
@@ -59,7 +70,7 @@ export declare function defaultEffortOf(models: Record<string, unknown>[], model
59
70
  * @param stage - sink for declarations staged against a route that is not
60
71
  * saved yet; the injector owns the store and flushes it once the route exists.
61
72
  */
62
- export declare function createEditorApi(api: RemoteApi, describe?: () => Promise<SettingsJoin>, stage?: (route: string, modelId: string, efforts: EffortWriteIntent, compat?: CompatSuggestion, input?: InputModalities | null, defaultEffort?: string | null) => void,
73
+ export declare function createEditorApi(api: RemoteApi, describe?: () => Promise<SettingsJoin>, stage?: (route: string, modelId: string, efforts: EffortWriteIntent, compat?: CompatSuggestion, input?: InputModalities | null, defaultEffort?: string | null, imageGen?: ImageGenIntent) => void,
63
74
  /**
64
75
  * Present only on a seam an ON-SCREEN editor drives: while the official card
65
76
  * is open its own frozen revision baseline makes any write here break the
@@ -92,6 +103,8 @@ export interface RowIntent {
92
103
  efforts: EffortWriteIntent;
93
104
  compat?: CompatSuggestion;
94
105
  input?: InputIntent;
106
+ /** The image-generation part; undefined leaves the marker untouched. */
107
+ imageGen?: ImageGenIntent;
95
108
  defaultEffort?: DefaultEffortIntent;
96
109
  }
97
110
  /** The outcome of one batch write, as the caller's ledgers need it. */
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Bounded reaction to pushed invalidations.
3
+ *
4
+ * The settings host does not send one "the document changed" per change: it
5
+ * emits `settings/document-updated` per entry, and it emits again whenever a
6
+ * `describe()` observes the serialized document move. Anything a refresh does
7
+ * -- a scan's describe, an idle fill's write -- can therefore come back as
8
+ * another notification. A client that runs one refresh per notification has an
9
+ * unbounded feedback loop, and the renderer starves: opening the Models page
10
+ * froze the entire DSH exactly this way.
11
+ *
12
+ * This turns a burst into ONE refresh and caps the rate however chatty the host
13
+ * becomes. The cost is that a change is noticed at most a beat later; the gain
14
+ * is that the page always settles.
15
+ */
16
+ /** The face the push handlers drive. */
17
+ export interface RefreshScheduler {
18
+ /** Ask for a refresh. Cheap, idempotent, and safe from inside a refresh. */
19
+ schedule: () => void;
20
+ /** Cancel any pending refresh and stop accepting new ones. */
21
+ dispose: () => void;
22
+ }
23
+ /**
24
+ * Build a coalescing, rate-limited scheduler around one `refresh` unit of work.
25
+ * @param refresh - the work to run; called at most once per interval.
26
+ * @param minIntervalMs - floor between two runs.
27
+ * @returns the {@link RefreshScheduler} face.
28
+ */
29
+ export declare function createRefreshScheduler(refresh: () => void, minIntervalMs: number): RefreshScheduler;