dsh-input-assistant 0.1.3 → 0.1.4
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/CHANGELOG.md +83 -0
- package/LICENSE +21 -21
- package/README.en.md +100 -0
- package/README.md +215 -184
- package/cordis.patch.yml +3 -3
- package/docs/CHANGELOG-0.1.2.md +102 -102
- package/docs/evaluation.md +111 -111
- package/docs/images/dark.png +0 -0
- package/docs/images/light.png +0 -0
- package/docs/images/optimize.png +0 -0
- package/docs/references.md +39 -39
- package/docs/smoke-comparison.md +37 -37
- package/docs/validation.md +180 -100
- package/lib/browser/components.d.ts +1 -1
- package/lib/browser/controller.d.ts +47 -4
- package/lib/browser/dom.d.ts +1 -1
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/public.d.ts +2 -2
- package/lib/browser/runtime.d.ts +4 -2
- package/lib/browser/settings.d.ts +1 -1
- package/lib/browser/styles.d.ts +1 -1
- package/lib/client.js +1164 -222
- package/lib/client.meta.json +40 -40
- package/lib/core/config.d.ts +1 -1
- package/lib/core/context.d.ts +1 -1
- package/lib/core/generation.d.ts +2 -2
- package/lib/core/index.d.ts +9 -8
- package/lib/core/models.d.ts +15 -0
- package/lib/core/protection.d.ts +3 -4
- package/lib/core/scheduler.d.ts +1 -1
- package/lib/core/snapshot.d.ts +1 -1
- package/lib/core/types.d.ts +11 -0
- package/lib/core.js +280 -53
- package/lib/core.js.map +2 -2
- package/lib/host/rpc.d.ts +2 -0
- package/lib/host/runtime.d.ts +5 -3
- package/lib/host/storage.d.ts +11 -3
- package/lib/host/transcript.d.ts +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +451 -156
- package/lib/index.js.map +4 -4
- package/package.json +10 -3
package/lib/client.meta.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"inputs": {
|
|
3
3
|
"src/core/diff.ts": {
|
|
4
|
-
"bytes":
|
|
4
|
+
"bytes": 3821,
|
|
5
5
|
"imports": [],
|
|
6
6
|
"format": "esm"
|
|
7
7
|
},
|
|
8
8
|
"src/browser/dom.ts": {
|
|
9
|
-
"bytes":
|
|
9
|
+
"bytes": 6650,
|
|
10
10
|
"imports": [],
|
|
11
11
|
"format": "esm"
|
|
12
12
|
},
|
|
13
13
|
"src/browser/floating.ts": {
|
|
14
|
-
"bytes":
|
|
14
|
+
"bytes": 1635,
|
|
15
15
|
"imports": [],
|
|
16
16
|
"format": "esm"
|
|
17
17
|
},
|
|
18
18
|
"src/browser/components.tsx": {
|
|
19
|
-
"bytes":
|
|
19
|
+
"bytes": 27915,
|
|
20
20
|
"imports": [
|
|
21
21
|
{
|
|
22
22
|
"path": "react",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
{
|
|
32
32
|
"path": "src/core/diff.ts",
|
|
33
33
|
"kind": "import-statement",
|
|
34
|
-
"original": "../core/diff"
|
|
34
|
+
"original": "../core/diff.js"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"path": "src/browser/dom.ts",
|
|
38
38
|
"kind": "import-statement",
|
|
39
|
-
"original": "./dom"
|
|
39
|
+
"original": "./dom.js"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"path": "src/browser/floating.ts",
|
|
43
43
|
"kind": "import-statement",
|
|
44
|
-
"original": "./floating"
|
|
44
|
+
"original": "./floating.js"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": "react/jsx-runtime",
|
|
@@ -52,75 +52,75 @@
|
|
|
52
52
|
"format": "esm"
|
|
53
53
|
},
|
|
54
54
|
"src/core/types.ts": {
|
|
55
|
-
"bytes":
|
|
55
|
+
"bytes": 2990,
|
|
56
56
|
"imports": [],
|
|
57
57
|
"format": "esm"
|
|
58
58
|
},
|
|
59
59
|
"src/core/snapshot.ts": {
|
|
60
|
-
"bytes":
|
|
60
|
+
"bytes": 590,
|
|
61
61
|
"imports": [],
|
|
62
62
|
"format": "esm"
|
|
63
63
|
},
|
|
64
64
|
"src/core/context.ts": {
|
|
65
|
-
"bytes":
|
|
65
|
+
"bytes": 1880,
|
|
66
66
|
"imports": [],
|
|
67
67
|
"format": "esm"
|
|
68
68
|
},
|
|
69
69
|
"src/browser/controller.ts": {
|
|
70
|
-
"bytes":
|
|
70
|
+
"bytes": 46928,
|
|
71
71
|
"imports": [
|
|
72
72
|
{
|
|
73
73
|
"path": "src/core/types.ts",
|
|
74
74
|
"kind": "import-statement",
|
|
75
|
-
"original": "../core/types"
|
|
75
|
+
"original": "../core/types.js"
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"path": "src/browser/dom.ts",
|
|
79
79
|
"kind": "import-statement",
|
|
80
|
-
"original": "./dom"
|
|
80
|
+
"original": "./dom.js"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"path": "src/core/snapshot.ts",
|
|
84
84
|
"kind": "import-statement",
|
|
85
|
-
"original": "../core/snapshot"
|
|
85
|
+
"original": "../core/snapshot.js"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"path": "src/core/context.ts",
|
|
89
89
|
"kind": "import-statement",
|
|
90
|
-
"original": "../core/context"
|
|
90
|
+
"original": "../core/context.js"
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
93
|
"format": "esm"
|
|
94
94
|
},
|
|
95
95
|
"src/browser/runtime.ts": {
|
|
96
|
-
"bytes":
|
|
96
|
+
"bytes": 6245,
|
|
97
97
|
"imports": [
|
|
98
98
|
{
|
|
99
99
|
"path": "src/browser/controller.ts",
|
|
100
100
|
"kind": "import-statement",
|
|
101
|
-
"original": "./controller"
|
|
101
|
+
"original": "./controller.js"
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
104
|
"format": "esm"
|
|
105
105
|
},
|
|
106
106
|
"src/browser/styles.ts": {
|
|
107
|
-
"bytes":
|
|
107
|
+
"bytes": 10969,
|
|
108
108
|
"imports": [],
|
|
109
109
|
"format": "esm"
|
|
110
110
|
},
|
|
111
111
|
"src/core/config.ts": {
|
|
112
|
-
"bytes":
|
|
112
|
+
"bytes": 4132,
|
|
113
113
|
"imports": [
|
|
114
114
|
{
|
|
115
115
|
"path": "src/core/types.ts",
|
|
116
116
|
"kind": "import-statement",
|
|
117
|
-
"original": "./types"
|
|
117
|
+
"original": "./types.js"
|
|
118
118
|
}
|
|
119
119
|
],
|
|
120
120
|
"format": "esm"
|
|
121
121
|
},
|
|
122
122
|
"src/browser/settings.tsx": {
|
|
123
|
-
"bytes":
|
|
123
|
+
"bytes": 14673,
|
|
124
124
|
"imports": [
|
|
125
125
|
{
|
|
126
126
|
"path": "react",
|
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
{
|
|
131
131
|
"path": "src/core/config.ts",
|
|
132
132
|
"kind": "import-statement",
|
|
133
|
-
"original": "../core/config"
|
|
133
|
+
"original": "../core/config.js"
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
"path": "src/core/types.ts",
|
|
137
137
|
"kind": "import-statement",
|
|
138
|
-
"original": "../core/types"
|
|
138
|
+
"original": "../core/types.js"
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
141
|
"path": "react/jsx-runtime",
|
|
@@ -146,48 +146,48 @@
|
|
|
146
146
|
"format": "esm"
|
|
147
147
|
},
|
|
148
148
|
"src/browser/public.ts": {
|
|
149
|
-
"bytes":
|
|
149
|
+
"bytes": 107,
|
|
150
150
|
"imports": [
|
|
151
151
|
{
|
|
152
152
|
"path": "src/browser/runtime.ts",
|
|
153
153
|
"kind": "import-statement",
|
|
154
|
-
"original": "./runtime"
|
|
154
|
+
"original": "./runtime.js"
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"path": "src/browser/controller.ts",
|
|
158
158
|
"kind": "import-statement",
|
|
159
|
-
"original": "./controller"
|
|
159
|
+
"original": "./controller.js"
|
|
160
160
|
}
|
|
161
161
|
],
|
|
162
162
|
"format": "esm"
|
|
163
163
|
},
|
|
164
164
|
"src/browser/index.ts": {
|
|
165
|
-
"bytes":
|
|
165
|
+
"bytes": 2104,
|
|
166
166
|
"imports": [
|
|
167
167
|
{
|
|
168
168
|
"path": "src/browser/components.tsx",
|
|
169
169
|
"kind": "import-statement",
|
|
170
|
-
"original": "./components"
|
|
170
|
+
"original": "./components.js"
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
173
|
"path": "src/browser/runtime.ts",
|
|
174
174
|
"kind": "import-statement",
|
|
175
|
-
"original": "./runtime"
|
|
175
|
+
"original": "./runtime.js"
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
"path": "src/browser/styles.ts",
|
|
179
179
|
"kind": "import-statement",
|
|
180
|
-
"original": "./styles"
|
|
180
|
+
"original": "./styles.js"
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
"path": "src/browser/settings.tsx",
|
|
184
184
|
"kind": "import-statement",
|
|
185
|
-
"original": "./settings"
|
|
185
|
+
"original": "./settings.js"
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
188
|
"path": "src/browser/public.ts",
|
|
189
189
|
"kind": "import-statement",
|
|
190
|
-
"original": "./public"
|
|
190
|
+
"original": "./public.js"
|
|
191
191
|
}
|
|
192
192
|
],
|
|
193
193
|
"format": "esm"
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"bytesInOutput": 1490
|
|
230
230
|
},
|
|
231
231
|
"src/browser/components.tsx": {
|
|
232
|
-
"bytesInOutput":
|
|
232
|
+
"bytesInOutput": 37601
|
|
233
233
|
},
|
|
234
234
|
"src/core/diff.ts": {
|
|
235
235
|
"bytesInOutput": 2610
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
"bytesInOutput": 1060
|
|
242
242
|
},
|
|
243
243
|
"src/core/types.ts": {
|
|
244
|
-
"bytesInOutput":
|
|
244
|
+
"bytesInOutput": 603
|
|
245
245
|
},
|
|
246
246
|
"src/core/snapshot.ts": {
|
|
247
247
|
"bytesInOutput": 459
|
|
@@ -250,25 +250,25 @@
|
|
|
250
250
|
"bytesInOutput": 51
|
|
251
251
|
},
|
|
252
252
|
"src/browser/controller.ts": {
|
|
253
|
-
"bytesInOutput":
|
|
253
|
+
"bytesInOutput": 43757
|
|
254
254
|
},
|
|
255
255
|
"src/browser/runtime.ts": {
|
|
256
|
-
"bytesInOutput":
|
|
256
|
+
"bytesInOutput": 5060
|
|
257
257
|
},
|
|
258
258
|
"src/browser/styles.ts": {
|
|
259
|
-
"bytesInOutput":
|
|
259
|
+
"bytesInOutput": 10614
|
|
260
260
|
},
|
|
261
261
|
"src/browser/settings.tsx": {
|
|
262
|
-
"bytesInOutput":
|
|
262
|
+
"bytesInOutput": 22816
|
|
263
263
|
},
|
|
264
264
|
"src/core/config.ts": {
|
|
265
|
-
"bytesInOutput":
|
|
265
|
+
"bytesInOutput": 2160
|
|
266
266
|
},
|
|
267
267
|
"src/browser/public.ts": {
|
|
268
268
|
"bytesInOutput": 0
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
|
-
"bytes":
|
|
271
|
+
"bytes": 134870
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
package/lib/core/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AssistantConfig } from './types';
|
|
1
|
+
import { type AssistantConfig } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Strict resolution for author-supplied input: the plugin's own Cordis config and
|
|
4
4
|
* every `settings/set` patch. Unknown keys are a caller mistake and must fail loudly
|
package/lib/core/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HistoryMessage } from './types';
|
|
1
|
+
import type { HistoryMessage } from './types.js';
|
|
2
2
|
export declare const charCount: (text: string) => number;
|
|
3
3
|
/** Preserve the initial task, latest correction, and latest answer before filling the remaining tail. */
|
|
4
4
|
export declare function buildContext(history: readonly HistoryMessage[], budget?: number): HistoryMessage[];
|
package/lib/core/generation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type AssistantConfig, type GenerationRequest, type HistoryMessage, type Operation } from './types';
|
|
2
|
-
import { type ProtectedText } from './protection';
|
|
1
|
+
import { type AssistantConfig, type GenerationRequest, type HistoryMessage, type Operation } from './types.js';
|
|
2
|
+
import { type ProtectedText } from './protection.js';
|
|
3
3
|
export declare const NO_SUGGESTION = "[[NO_SUGGESTION]]";
|
|
4
4
|
export interface PreparedGeneration {
|
|
5
5
|
operation: Operation;
|
package/lib/core/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './config';
|
|
3
|
-
export * from './context';
|
|
4
|
-
export * from './protection';
|
|
5
|
-
export * from './generation';
|
|
6
|
-
export * from './scheduler';
|
|
7
|
-
export * from './snapshot';
|
|
8
|
-
export * from './diff';
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './config.js';
|
|
3
|
+
export * from './context.js';
|
|
4
|
+
export * from './protection.js';
|
|
5
|
+
export * from './generation.js';
|
|
6
|
+
export * from './scheduler.js';
|
|
7
|
+
export * from './snapshot.js';
|
|
8
|
+
export * from './diff.js';
|
|
9
|
+
export * from './models.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Read-only model choices for the plugin's auxiliary route, independent of the main composer. */
|
|
2
|
+
export interface AssistantModelCatalog {
|
|
3
|
+
groups: {
|
|
4
|
+
provider: string;
|
|
5
|
+
name: string;
|
|
6
|
+
models: {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}[];
|
|
10
|
+
}[];
|
|
11
|
+
failures: {
|
|
12
|
+
provider: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
package/lib/core/protection.d.ts
CHANGED
|
@@ -10,10 +10,9 @@ export interface ProtectedText {
|
|
|
10
10
|
/**
|
|
11
11
|
* Protect syntax and user-locked literals, without trying to prove semantic equivalence.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* inside inline code or inside a URL is protected exactly once.
|
|
13
|
+
* Broad literals own their complete span, so nested paths are protected once.
|
|
14
|
+
* Plain candidates are consumed once and classified at their boundary; long
|
|
15
|
+
* prose without separators must not cause quadratic failed regex searches.
|
|
17
16
|
*/
|
|
18
17
|
export declare function protectText(text: string, locked?: readonly string[]): ProtectedText;
|
|
19
18
|
export declare function restoreProtected(output: string, protectedText: ProtectedText): string;
|
package/lib/core/scheduler.d.ts
CHANGED
package/lib/core/snapshot.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InputSnapshot } from './types';
|
|
1
|
+
import type { InputSnapshot } from './types.js';
|
|
2
2
|
export declare function snapshotMatches(expected: InputSnapshot, current: Omit<InputSnapshot, 'requestId'>, checkCaret?: boolean): boolean;
|
package/lib/core/types.d.ts
CHANGED
|
@@ -10,12 +10,14 @@ export interface ModelRoute {
|
|
|
10
10
|
model: string;
|
|
11
11
|
}
|
|
12
12
|
export type OptimizationStrength = 'light' | 'standard' | 'deep';
|
|
13
|
+
export type PredictionDetail = 'concise' | 'standard' | 'detailed';
|
|
13
14
|
export interface AssistantConfig {
|
|
14
15
|
optimizeEnabled: boolean;
|
|
15
16
|
stashEnabled: boolean;
|
|
16
17
|
optimizationStrength: OptimizationStrength;
|
|
17
18
|
nextEnabled: boolean;
|
|
18
19
|
completionEnabled: boolean;
|
|
20
|
+
predictionDetail: PredictionDetail;
|
|
19
21
|
displayMode: 'ghost' | 'panel';
|
|
20
22
|
debounceMs: number;
|
|
21
23
|
minIntervalMs: number;
|
|
@@ -41,6 +43,8 @@ export interface InputSnapshot {
|
|
|
41
43
|
}
|
|
42
44
|
export interface GenerationRequest extends InputSnapshot {
|
|
43
45
|
operation: Operation;
|
|
46
|
+
/** Explicit user action; automatic feature toggles do not block a single manual suggestion. */
|
|
47
|
+
manual?: boolean;
|
|
44
48
|
targetText?: string;
|
|
45
49
|
lockedFragments?: readonly string[];
|
|
46
50
|
provider?: string;
|
|
@@ -48,6 +52,9 @@ export interface GenerationRequest extends InputSnapshot {
|
|
|
48
52
|
}
|
|
49
53
|
export interface GenerationResult {
|
|
50
54
|
text: string | null;
|
|
55
|
+
/** Temporary throttling is not a model abstention and must never be cached as one. */
|
|
56
|
+
outcome?: 'suggestion' | 'abstained' | 'throttled';
|
|
57
|
+
retryAfterMs?: number;
|
|
51
58
|
requestId: string;
|
|
52
59
|
sessionId: string;
|
|
53
60
|
sourceTurnId: string | null;
|
|
@@ -73,6 +80,10 @@ export interface StoredDraft {
|
|
|
73
80
|
text: string;
|
|
74
81
|
createdAt: number;
|
|
75
82
|
}
|
|
83
|
+
export interface DraftMutationResult {
|
|
84
|
+
drafts: StoredDraft[];
|
|
85
|
+
removed: StoredDraft[];
|
|
86
|
+
}
|
|
76
87
|
export declare const RPC_CHANNEL = "/api";
|
|
77
88
|
export declare const RPC_PREFIX = "input-assistant/";
|
|
78
89
|
export declare class AssistantError extends Error {
|