dsh-reference-anything 0.4.2 → 0.4.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/README.md +21 -11
- package/images/logo-icon.png +0 -0
- package/images/logo-mono.png +0 -0
- package/lib/client.js +4185 -1244
- package/lib/contract.d.ts +18 -1
- package/lib/contract.js +12 -1
- package/lib/host.d.ts +57 -2
- package/lib/host.js +8 -2
- package/lib/index.js +0 -2
- package/lib/local-plugins.d.ts +6 -0
- package/lib/local-plugins.js +119 -0
- package/lib/opencli.d.ts +3 -0
- package/lib/opencli.js +61 -8
- package/lib/reference.js +1 -2
- package/lib/sources/web-chat/index.d.ts +1 -0
- package/lib/sources/web-chat/index.js +21 -1
- package/lib/store/spec.d.ts +64 -0
- package/lib/typert.js +1 -0
- package/lib/types.d.ts +5 -1
- package/lib/web.js +6 -5
- package/lib/wire.d.ts +141 -0
- package/lib/wire.js +27 -11
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/opencli-plugin/common.js +22 -6
- package/package.json +71 -51
package/lib/store/spec.d.ts
CHANGED
|
@@ -237,42 +237,106 @@ export declare const referenceAnythingDomainSpec: {
|
|
|
237
237
|
order: z.ZodNumber;
|
|
238
238
|
limit: z.ZodNumber;
|
|
239
239
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
240
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
241
|
+
name: "name";
|
|
242
|
+
updated: "updated";
|
|
243
|
+
}>>;
|
|
244
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
245
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
246
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
240
247
|
}, z.core.$strip>;
|
|
241
248
|
skills: z.ZodObject<{
|
|
242
249
|
enabled: z.ZodBoolean;
|
|
243
250
|
order: z.ZodNumber;
|
|
244
251
|
limit: z.ZodNumber;
|
|
245
252
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
253
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
254
|
+
name: "name";
|
|
255
|
+
updated: "updated";
|
|
256
|
+
}>>;
|
|
257
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
258
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
259
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
246
260
|
}, z.core.$strip>;
|
|
247
261
|
files: z.ZodObject<{
|
|
248
262
|
enabled: z.ZodBoolean;
|
|
249
263
|
order: z.ZodNumber;
|
|
250
264
|
limit: z.ZodNumber;
|
|
251
265
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
266
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
267
|
+
name: "name";
|
|
268
|
+
updated: "updated";
|
|
269
|
+
}>>;
|
|
270
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
271
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
272
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
252
273
|
}, z.core.$strip>;
|
|
253
274
|
sessions: z.ZodObject<{
|
|
254
275
|
enabled: z.ZodBoolean;
|
|
255
276
|
order: z.ZodNumber;
|
|
256
277
|
limit: z.ZodNumber;
|
|
257
278
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
279
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
280
|
+
name: "name";
|
|
281
|
+
updated: "updated";
|
|
282
|
+
}>>;
|
|
283
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
284
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
285
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
258
286
|
}, z.core.$strip>;
|
|
259
287
|
agents: z.ZodDefault<z.ZodObject<{
|
|
260
288
|
enabled: z.ZodBoolean;
|
|
261
289
|
order: z.ZodNumber;
|
|
262
290
|
limit: z.ZodNumber;
|
|
263
291
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
292
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
293
|
+
name: "name";
|
|
294
|
+
updated: "updated";
|
|
295
|
+
}>>;
|
|
296
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
297
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
298
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
264
299
|
}, z.core.$strip>>;
|
|
265
300
|
conversations: z.ZodObject<{
|
|
266
301
|
enabled: z.ZodBoolean;
|
|
267
302
|
order: z.ZodNumber;
|
|
268
303
|
limit: z.ZodNumber;
|
|
269
304
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
305
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
306
|
+
name: "name";
|
|
307
|
+
updated: "updated";
|
|
308
|
+
}>>;
|
|
309
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
310
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
311
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
270
312
|
}, z.core.$strip>;
|
|
271
313
|
drives: z.ZodDefault<z.ZodObject<{
|
|
272
314
|
enabled: z.ZodBoolean;
|
|
273
315
|
order: z.ZodNumber;
|
|
274
316
|
limit: z.ZodNumber;
|
|
275
317
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
318
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
319
|
+
name: "name";
|
|
320
|
+
updated: "updated";
|
|
321
|
+
}>>;
|
|
322
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
323
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
324
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
325
|
+
}, z.core.$strip>>;
|
|
326
|
+
plugins: z.ZodDefault<z.ZodObject<{
|
|
327
|
+
enabled: z.ZodBoolean;
|
|
328
|
+
order: z.ZodNumber;
|
|
329
|
+
limit: z.ZodNumber;
|
|
330
|
+
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
331
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
332
|
+
name: "name";
|
|
333
|
+
updated: "updated";
|
|
334
|
+
}>>;
|
|
335
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
336
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
337
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
338
|
+
onlyLive: z.ZodDefault<z.ZodBoolean>;
|
|
339
|
+
showDeepSeek: z.ZodDefault<z.ZodBoolean>;
|
|
276
340
|
}, z.core.$strip>>;
|
|
277
341
|
}, z.core.$strip>>;
|
|
278
342
|
}, z.core.$strip>;
|
package/lib/typert.js
CHANGED
|
@@ -42,6 +42,7 @@ export const TYPERT_MANIFEST = {
|
|
|
42
42
|
{ kind: 'method', name: 'openListDisableMount', signature: 'openListDisableMount(input: OpenListDisableMountInput, signal: AbortSignal): Promise<boolean>' },
|
|
43
43
|
{ kind: 'method', name: 'openListRemoveMount', signature: 'openListRemoveMount(input: OpenListMountInput, signal: AbortSignal): Promise<boolean>' },
|
|
44
44
|
{ kind: 'method', name: 'openListReindex', signature: 'openListReindex(input: OpenListMountInput, signal: AbortSignal): Promise<OpenListReindex>' },
|
|
45
|
+
{ kind: 'method', name: 'localPlugins', signature: 'localPlugins(signal: AbortSignal): Promise<LocalPluginCandidate[]>' },
|
|
45
46
|
], types: [],
|
|
46
47
|
}], events: [], objects: [] },
|
|
47
48
|
invocations: REFERENCE_ANYTHING_INVOCATIONS,
|
package/lib/types.d.ts
CHANGED
|
@@ -236,6 +236,10 @@ export interface ReferenceInput {
|
|
|
236
236
|
}
|
|
237
237
|
declare module '@deepseek-ai/dsh-llm' {
|
|
238
238
|
interface MessageSourceMap {
|
|
239
|
-
'reference-anything': ReferenceContextSource
|
|
239
|
+
'reference-anything': ReferenceContextSource | {
|
|
240
|
+
readonly kind: 'reference-anything';
|
|
241
|
+
readonly form: 'notice';
|
|
242
|
+
readonly summary: string;
|
|
243
|
+
};
|
|
240
244
|
}
|
|
241
245
|
}
|
package/lib/web.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ReferenceAnythingRemote } from "./host.js";
|
|
2
2
|
import { TYPERT_MANIFEST } from "./typert.js";
|
|
3
|
+
import { createPluginReferenceSource } from "./local-plugins.js";
|
|
3
4
|
export const name = 'reference-anything-web';
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
export const inject = ['typert', 'referenceChatHistory', 'openListManager', 'referenceCloudDrive'];
|
|
5
|
+
// ReferenceAnythingRemote looks up optional sources through ctx.get(). Making
|
|
6
|
+
// cloud drives a required injection blocks all conversation endpoints when
|
|
7
|
+
// that source is disabled or unavailable in the active profile.
|
|
8
|
+
export const inject = ['typert', 'referenceChatHistory', 'openListManager', 'references'];
|
|
9
9
|
export function apply(ctx) {
|
|
10
10
|
new ReferenceAnythingRemote(ctx);
|
|
11
|
+
ctx.effect(() => ctx.references.registerSource(createPluginReferenceSource(ctx)), 'reference-anything-web.plugin-source');
|
|
11
12
|
ctx.effect(() => {
|
|
12
13
|
const dispose = ctx.typert.register(TYPERT_MANIFEST);
|
|
13
14
|
return () => { void dispose(); };
|
package/lib/wire.d.ts
CHANGED
|
@@ -37,13 +37,26 @@ export declare const pickerSourceSchema: z.ZodEnum<{
|
|
|
37
37
|
agents: "agents";
|
|
38
38
|
conversations: "conversations";
|
|
39
39
|
drives: "drives";
|
|
40
|
+
plugins: "plugins";
|
|
40
41
|
}>;
|
|
41
42
|
export type PickerSource = z.infer<typeof pickerSourceSchema>;
|
|
43
|
+
export declare const pickerSortSchema: z.ZodEnum<{
|
|
44
|
+
name: "name";
|
|
45
|
+
updated: "updated";
|
|
46
|
+
}>;
|
|
47
|
+
export type PickerSort = z.infer<typeof pickerSortSchema>;
|
|
42
48
|
declare const pickerSourceSettingsSchema: z.ZodObject<{
|
|
43
49
|
enabled: z.ZodBoolean;
|
|
44
50
|
order: z.ZodNumber;
|
|
45
51
|
limit: z.ZodNumber;
|
|
46
52
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
53
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
54
|
+
name: "name";
|
|
55
|
+
updated: "updated";
|
|
56
|
+
}>>;
|
|
57
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
58
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
47
60
|
}, z.core.$strip>;
|
|
48
61
|
export type PickerSourceSettings = z.infer<typeof pickerSourceSettingsSchema>;
|
|
49
62
|
export declare const pickerSettingsSchema: z.ZodObject<{
|
|
@@ -56,42 +69,106 @@ export declare const pickerSettingsSchema: z.ZodObject<{
|
|
|
56
69
|
order: z.ZodNumber;
|
|
57
70
|
limit: z.ZodNumber;
|
|
58
71
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
72
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
73
|
+
name: "name";
|
|
74
|
+
updated: "updated";
|
|
75
|
+
}>>;
|
|
76
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
77
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
59
79
|
}, z.core.$strip>;
|
|
60
80
|
skills: z.ZodObject<{
|
|
61
81
|
enabled: z.ZodBoolean;
|
|
62
82
|
order: z.ZodNumber;
|
|
63
83
|
limit: z.ZodNumber;
|
|
64
84
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
85
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
86
|
+
name: "name";
|
|
87
|
+
updated: "updated";
|
|
88
|
+
}>>;
|
|
89
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
90
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
91
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
65
92
|
}, z.core.$strip>;
|
|
66
93
|
files: z.ZodObject<{
|
|
67
94
|
enabled: z.ZodBoolean;
|
|
68
95
|
order: z.ZodNumber;
|
|
69
96
|
limit: z.ZodNumber;
|
|
70
97
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
98
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
99
|
+
name: "name";
|
|
100
|
+
updated: "updated";
|
|
101
|
+
}>>;
|
|
102
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
103
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
71
105
|
}, z.core.$strip>;
|
|
72
106
|
sessions: z.ZodObject<{
|
|
73
107
|
enabled: z.ZodBoolean;
|
|
74
108
|
order: z.ZodNumber;
|
|
75
109
|
limit: z.ZodNumber;
|
|
76
110
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
111
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
112
|
+
name: "name";
|
|
113
|
+
updated: "updated";
|
|
114
|
+
}>>;
|
|
115
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
116
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
77
118
|
}, z.core.$strip>;
|
|
78
119
|
agents: z.ZodDefault<z.ZodObject<{
|
|
79
120
|
enabled: z.ZodBoolean;
|
|
80
121
|
order: z.ZodNumber;
|
|
81
122
|
limit: z.ZodNumber;
|
|
82
123
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
124
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
125
|
+
name: "name";
|
|
126
|
+
updated: "updated";
|
|
127
|
+
}>>;
|
|
128
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
129
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
130
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
83
131
|
}, z.core.$strip>>;
|
|
84
132
|
conversations: z.ZodObject<{
|
|
85
133
|
enabled: z.ZodBoolean;
|
|
86
134
|
order: z.ZodNumber;
|
|
87
135
|
limit: z.ZodNumber;
|
|
88
136
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
137
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
138
|
+
name: "name";
|
|
139
|
+
updated: "updated";
|
|
140
|
+
}>>;
|
|
141
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
142
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
143
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
89
144
|
}, z.core.$strip>;
|
|
90
145
|
drives: z.ZodDefault<z.ZodObject<{
|
|
91
146
|
enabled: z.ZodBoolean;
|
|
92
147
|
order: z.ZodNumber;
|
|
93
148
|
limit: z.ZodNumber;
|
|
94
149
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
150
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
151
|
+
name: "name";
|
|
152
|
+
updated: "updated";
|
|
153
|
+
}>>;
|
|
154
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
155
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
156
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
plugins: z.ZodDefault<z.ZodObject<{
|
|
159
|
+
enabled: z.ZodBoolean;
|
|
160
|
+
order: z.ZodNumber;
|
|
161
|
+
limit: z.ZodNumber;
|
|
162
|
+
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
163
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
164
|
+
name: "name";
|
|
165
|
+
updated: "updated";
|
|
166
|
+
}>>;
|
|
167
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
168
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
169
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
170
|
+
onlyLive: z.ZodDefault<z.ZodBoolean>;
|
|
171
|
+
showDeepSeek: z.ZodDefault<z.ZodBoolean>;
|
|
95
172
|
}, z.core.$strip>>;
|
|
96
173
|
}, z.core.$strip>;
|
|
97
174
|
export type PickerSettings = z.infer<typeof pickerSettingsSchema>;
|
|
@@ -174,42 +251,106 @@ export declare const settingsRecordSchema: z.ZodObject<{
|
|
|
174
251
|
order: z.ZodNumber;
|
|
175
252
|
limit: z.ZodNumber;
|
|
176
253
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
254
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
255
|
+
name: "name";
|
|
256
|
+
updated: "updated";
|
|
257
|
+
}>>;
|
|
258
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
259
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
177
261
|
}, z.core.$strip>;
|
|
178
262
|
skills: z.ZodObject<{
|
|
179
263
|
enabled: z.ZodBoolean;
|
|
180
264
|
order: z.ZodNumber;
|
|
181
265
|
limit: z.ZodNumber;
|
|
182
266
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
267
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
268
|
+
name: "name";
|
|
269
|
+
updated: "updated";
|
|
270
|
+
}>>;
|
|
271
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
272
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
273
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
183
274
|
}, z.core.$strip>;
|
|
184
275
|
files: z.ZodObject<{
|
|
185
276
|
enabled: z.ZodBoolean;
|
|
186
277
|
order: z.ZodNumber;
|
|
187
278
|
limit: z.ZodNumber;
|
|
188
279
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
280
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
281
|
+
name: "name";
|
|
282
|
+
updated: "updated";
|
|
283
|
+
}>>;
|
|
284
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
285
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
286
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
189
287
|
}, z.core.$strip>;
|
|
190
288
|
sessions: z.ZodObject<{
|
|
191
289
|
enabled: z.ZodBoolean;
|
|
192
290
|
order: z.ZodNumber;
|
|
193
291
|
limit: z.ZodNumber;
|
|
194
292
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
293
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
294
|
+
name: "name";
|
|
295
|
+
updated: "updated";
|
|
296
|
+
}>>;
|
|
297
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
298
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
299
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
195
300
|
}, z.core.$strip>;
|
|
196
301
|
agents: z.ZodDefault<z.ZodObject<{
|
|
197
302
|
enabled: z.ZodBoolean;
|
|
198
303
|
order: z.ZodNumber;
|
|
199
304
|
limit: z.ZodNumber;
|
|
200
305
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
306
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
307
|
+
name: "name";
|
|
308
|
+
updated: "updated";
|
|
309
|
+
}>>;
|
|
310
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
311
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
312
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
201
313
|
}, z.core.$strip>>;
|
|
202
314
|
conversations: z.ZodObject<{
|
|
203
315
|
enabled: z.ZodBoolean;
|
|
204
316
|
order: z.ZodNumber;
|
|
205
317
|
limit: z.ZodNumber;
|
|
206
318
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
319
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
320
|
+
name: "name";
|
|
321
|
+
updated: "updated";
|
|
322
|
+
}>>;
|
|
323
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
324
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
325
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
207
326
|
}, z.core.$strip>;
|
|
208
327
|
drives: z.ZodDefault<z.ZodObject<{
|
|
209
328
|
enabled: z.ZodBoolean;
|
|
210
329
|
order: z.ZodNumber;
|
|
211
330
|
limit: z.ZodNumber;
|
|
212
331
|
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
332
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
333
|
+
name: "name";
|
|
334
|
+
updated: "updated";
|
|
335
|
+
}>>;
|
|
336
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
337
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
338
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
339
|
+
}, z.core.$strip>>;
|
|
340
|
+
plugins: z.ZodDefault<z.ZodObject<{
|
|
341
|
+
enabled: z.ZodBoolean;
|
|
342
|
+
order: z.ZodNumber;
|
|
343
|
+
limit: z.ZodNumber;
|
|
344
|
+
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
345
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
346
|
+
name: "name";
|
|
347
|
+
updated: "updated";
|
|
348
|
+
}>>;
|
|
349
|
+
shortcut: z.ZodDefault<z.ZodString>;
|
|
350
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
351
|
+
sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
352
|
+
onlyLive: z.ZodDefault<z.ZodBoolean>;
|
|
353
|
+
showDeepSeek: z.ZodDefault<z.ZodBoolean>;
|
|
213
354
|
}, z.core.$strip>>;
|
|
214
355
|
}, z.core.$strip>>;
|
|
215
356
|
}, z.core.$strip>;
|
package/lib/wire.js
CHANGED
|
@@ -9,12 +9,18 @@ export const LOCAL_AGENT_LABEL = {
|
|
|
9
9
|
openclaw: 'OpenClaw', kimi: 'Kimi', grokbuild: 'Grok Build', hermes: 'Hermes', 'gemini-cli': 'Gemini CLI',
|
|
10
10
|
pi: 'Pi', opencode: 'opencode', mimocode: 'mimocode', zcode: 'zcode',
|
|
11
11
|
};
|
|
12
|
-
export const pickerSourceSchema = z.enum(['commands', 'skills', 'files', 'sessions', 'agents', 'conversations', 'drives']);
|
|
12
|
+
export const pickerSourceSchema = z.enum(['commands', 'skills', 'files', 'sessions', 'agents', 'conversations', 'drives', 'plugins']);
|
|
13
|
+
export const pickerSortSchema = z.enum(['name', 'updated']);
|
|
13
14
|
const pickerSourceSettingsSchema = z.object({
|
|
14
15
|
enabled: z.boolean(),
|
|
15
16
|
order: z.number().int().min(0).max(100),
|
|
16
17
|
limit: z.number().int().min(1).max(50),
|
|
17
18
|
maxCandidates: z.number().int().min(1).max(50).default(50),
|
|
19
|
+
sort: pickerSortSchema.default('updated'),
|
|
20
|
+
/** Optional extra token for `@token:` scoped searches. */
|
|
21
|
+
shortcut: z.string().regex(/^[^@:\s/]*(,[^@:\s/]+)*$/u).max(32).default(''),
|
|
22
|
+
aliases: z.array(z.string().regex(/^[^@:\s/]+$/u).max(32)).optional(),
|
|
23
|
+
sourceAliases: z.record(z.string(), z.array(z.string().regex(/^[^@:\s/]+$/u).max(32))).optional(),
|
|
18
24
|
});
|
|
19
25
|
export const pickerSettingsSchema = z.object({
|
|
20
26
|
displayMode: z.enum(['collapse', 'native-scroll']).default('collapse'),
|
|
@@ -27,23 +33,28 @@ export const pickerSettingsSchema = z.object({
|
|
|
27
33
|
// a saved record that has `picker` but predates this key would fail the whole
|
|
28
34
|
// parse without it, and the medium — every setting in it — would be rejected.
|
|
29
35
|
// Any key added here from now on needs the same treatment.
|
|
30
|
-
agents: pickerSourceSettingsSchema.default({ enabled: true, order: 25, limit: 6, maxCandidates: 50 }),
|
|
36
|
+
agents: pickerSourceSettingsSchema.default({ enabled: true, order: 25, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['agent', 'cc', 'claude-code', 'codex', 'cursor', 'gemini-cli', 'qoder', 'reasonix', 'openclaw', 'hermes', 'pi', 'grokbuild', 'grok-build', 'kimi-cli', 'kimi-code', 'opencode', 'mimocode', 'mimo', 'zcode'] }),
|
|
31
37
|
conversations: pickerSourceSettingsSchema,
|
|
32
38
|
// Defaulted for the same reason as `agents` above: it arrived later still.
|
|
33
|
-
drives: pickerSourceSettingsSchema.default({ enabled: true, order: 35, limit: 6, maxCandidates: 50 }),
|
|
39
|
+
drives: pickerSourceSettingsSchema.default({ enabled: true, order: 35, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['drive'] }),
|
|
40
|
+
plugins: pickerSourceSettingsSchema.extend({
|
|
41
|
+
onlyLive: z.boolean().default(false),
|
|
42
|
+
showDeepSeek: z.boolean().default(true),
|
|
43
|
+
}).default({ enabled: true, order: 40, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['plugin'], onlyLive: false, showDeepSeek: true }),
|
|
34
44
|
});
|
|
35
45
|
export const inputRenderModeSchema = z.enum(['pill', 'raw-text']);
|
|
36
46
|
/** Defaults used before the user saves the General section. */
|
|
37
47
|
export function defaultPickerSettings() {
|
|
38
48
|
return {
|
|
39
49
|
displayMode: 'collapse',
|
|
40
|
-
commands: { enabled: true, order: 0, limit: 6, maxCandidates: 50 },
|
|
41
|
-
skills: { enabled: true, order: 5, limit: 6, maxCandidates: 50 },
|
|
42
|
-
files: { enabled: true, order: 10, limit: 6, maxCandidates: 50 },
|
|
43
|
-
sessions: { enabled: true, order: 20, limit: 6, maxCandidates: 50 },
|
|
44
|
-
agents: { enabled: true, order: 25, limit: 6, maxCandidates: 50 },
|
|
45
|
-
conversations: { enabled: true, order: 30, limit: 6, maxCandidates: 50 },
|
|
46
|
-
drives: { enabled: true, order: 35, limit: 6, maxCandidates: 50 },
|
|
50
|
+
commands: { enabled: true, order: 0, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['command'] },
|
|
51
|
+
skills: { enabled: true, order: 5, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['skill'] },
|
|
52
|
+
files: { enabled: true, order: 10, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['file'] },
|
|
53
|
+
sessions: { enabled: true, order: 20, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['session'] },
|
|
54
|
+
agents: { enabled: true, order: 25, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['agent', 'cc', 'claude-code', 'codex', 'cursor', 'gemini-cli', 'qoder', 'reasonix', 'openclaw', 'hermes', 'pi', 'grokbuild', 'grok-build', 'kimi-cli', 'kimi-code', 'opencode', 'mimocode', 'mimo', 'zcode'] },
|
|
55
|
+
conversations: { enabled: true, order: 30, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['chat'] },
|
|
56
|
+
drives: { enabled: true, order: 35, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['drive'] },
|
|
57
|
+
plugins: { enabled: true, order: 40, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['plugin'], onlyLive: false, showDeepSeek: true },
|
|
47
58
|
};
|
|
48
59
|
}
|
|
49
60
|
/** Picker settings have a fixed schema, so explicit comparison is cheap and stable. */
|
|
@@ -53,7 +64,12 @@ export function samePickerSettings(left, right) {
|
|
|
53
64
|
return pickerSourceSchema.options.every(key => left[key].enabled === right[key].enabled &&
|
|
54
65
|
left[key].order === right[key].order &&
|
|
55
66
|
left[key].limit === right[key].limit &&
|
|
56
|
-
left[key].maxCandidates === right[key].maxCandidates
|
|
67
|
+
left[key].maxCandidates === right[key].maxCandidates &&
|
|
68
|
+
left[key].sort === right[key].sort &&
|
|
69
|
+
left[key].shortcut === right[key].shortcut &&
|
|
70
|
+
JSON.stringify(left[key].aliases) === JSON.stringify(right[key].aliases) &&
|
|
71
|
+
JSON.stringify(left[key].sourceAliases) === JSON.stringify(right[key].sourceAliases) &&
|
|
72
|
+
(key !== 'plugins' || (left.plugins.onlyLive === right.plugins.onlyLive && left.plugins.showDeepSeek === right.plugins.showDeepSeek)));
|
|
57
73
|
}
|
|
58
74
|
export const settingsRecordSchema = z.object({
|
|
59
75
|
opencliPath: z.string(),
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/opencli-plugin/common.js
CHANGED
|
@@ -138,6 +138,22 @@ async function inTemporaryTab(page, task) {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
async function navigate(page, url, options) {
|
|
142
|
+
let last
|
|
143
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
144
|
+
try { await page.goto(url, options); return } catch (error) {
|
|
145
|
+
last = error
|
|
146
|
+
if (!/Navigation rejected/i.test(String(error?.message || error)) || attempt === 2) throw error
|
|
147
|
+
if (attempt > 0 && typeof page.newTab === 'function' && typeof page.setActivePage === 'function') {
|
|
148
|
+
const pageId = await page.newTab(url).catch(() => undefined)
|
|
149
|
+
if (pageId) { await page.setActivePage(pageId); return }
|
|
150
|
+
}
|
|
151
|
+
await new Promise(resolve => setTimeout(resolve, 250 * (attempt + 1)))
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
throw last
|
|
155
|
+
}
|
|
156
|
+
|
|
141
157
|
export function registerProvider(config) {
|
|
142
158
|
const browserSession = SYNC_BROWSER_SESSION
|
|
143
159
|
|
|
@@ -154,7 +170,7 @@ export function registerProvider(config) {
|
|
|
154
170
|
args: [],
|
|
155
171
|
columns: ['identity'],
|
|
156
172
|
func: async (page) => inTemporaryTab(page, async () => {
|
|
157
|
-
await page
|
|
173
|
+
await navigate(page, config.home, { waitUntil: 'none' })
|
|
158
174
|
const result = await evaluateWhenProviderReady(
|
|
159
175
|
page, config.whoamiScript, {}, `${config.site} whoami`, { accepts: terminalIdentityResult },
|
|
160
176
|
)
|
|
@@ -180,7 +196,7 @@ export function registerProvider(config) {
|
|
|
180
196
|
func: async (page, kwargs) => inTemporaryTab(page, async () => {
|
|
181
197
|
const since = String(kwargs.since || '').trim()
|
|
182
198
|
if (since && Number.isNaN(Date.parse(since))) throw new ArgumentError('since must be an ISO 8601 instant')
|
|
183
|
-
await page
|
|
199
|
+
await navigate(page, config.home, { waitUntil: 'none' })
|
|
184
200
|
const identity = await evaluateWhenProviderReady(
|
|
185
201
|
page, config.whoamiScript, {}, `${config.site} sync-index identity`, { accepts: terminalIdentityResult },
|
|
186
202
|
)
|
|
@@ -217,7 +233,7 @@ export function registerProvider(config) {
|
|
|
217
233
|
func: async (page, kwargs) => inTemporaryTab(page, async () => {
|
|
218
234
|
const since = String(kwargs.since || '').trim()
|
|
219
235
|
if (since && Number.isNaN(Date.parse(since))) throw new ArgumentError('since must be an ISO 8601 instant')
|
|
220
|
-
await page
|
|
236
|
+
await navigate(page, config.home, { waitUntil: 'none' })
|
|
221
237
|
const rows = assertResult(
|
|
222
238
|
await evaluateWhenProviderReady(page, config.historyScript, { since }, `${config.site} history-all`),
|
|
223
239
|
config.domain,
|
|
@@ -245,7 +261,7 @@ export function registerProvider(config) {
|
|
|
245
261
|
func: async (page, kwargs) => inTemporaryTab(page, async () => {
|
|
246
262
|
const id = String(kwargs.id || '').trim()
|
|
247
263
|
if (!id) throw new ArgumentError('id must be a non-empty conversation id')
|
|
248
|
-
await page
|
|
264
|
+
await navigate(page, config.home, { settleMs: 600 })
|
|
249
265
|
const expectedScope = parseExpectedAccountScope(kwargs.accountScope)
|
|
250
266
|
if (expectedScope) {
|
|
251
267
|
const identity = await evaluate(page, config.whoamiScript, {}, `${config.site} detail identity`)
|
|
@@ -257,7 +273,7 @@ export function registerProvider(config) {
|
|
|
257
273
|
}
|
|
258
274
|
let result = await evaluate(page, config.detailScript, { id }, `${config.site} detail`)
|
|
259
275
|
if (result?.ok !== true && result?.code !== 'AUTH' && result?.code !== 'RATE_LIMIT' && config.fallbackScript) {
|
|
260
|
-
await page
|
|
276
|
+
await navigate(page, config.conversationUrl(id), { settleMs: 1800 })
|
|
261
277
|
result = await evaluate(page, config.fallbackScript, { id }, `${config.site} detail fallback`)
|
|
262
278
|
}
|
|
263
279
|
const rows = assertResult(result, config.domain, `${config.site} detail`)
|
|
@@ -291,7 +307,7 @@ export function registerProvider(config) {
|
|
|
291
307
|
if (!Number.isInteger(maxBytes) || maxBytes < 1 || maxBytes > 26_214_400) {
|
|
292
308
|
throw new ArgumentError('maxBytes must be between 1 and 26214400')
|
|
293
309
|
}
|
|
294
|
-
await page
|
|
310
|
+
await navigate(page, config.home, { settleMs: 500 })
|
|
295
311
|
const expectedScope = parseExpectedAccountScope(kwargs.accountScope)
|
|
296
312
|
if (expectedScope) {
|
|
297
313
|
const identity = await evaluateWhenProviderReady(
|