dsh-reference-anything 0.4.3 → 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 +16 -8
- package/lib/client.js +463 -180
- package/lib/contract.d.ts +15 -1
- package/lib/contract.js +10 -0
- package/lib/host.d.ts +49 -0
- package/lib/host.js +5 -0
- package/lib/local-plugins.d.ts +6 -0
- package/lib/local-plugins.js +119 -0
- package/lib/store/spec.d.ts +64 -0
- package/lib/typert.js +1 -0
- package/lib/web.js +3 -1
- package/lib/wire.d.ts +141 -0
- package/lib/wire.js +27 -11
- package/package.json +3 -1
package/lib/contract.d.ts
CHANGED
|
@@ -44,6 +44,20 @@ export declare const driveCandidateSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
44
44
|
searchIncomplete: z.ZodOptional<z.ZodBoolean>;
|
|
45
45
|
isDirectory: z.ZodOptional<z.ZodBoolean>;
|
|
46
46
|
}, z.core.$strict>>;
|
|
47
|
+
export declare const localPluginCandidateSchema: z.ZodReadonly<z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
label: z.ZodString;
|
|
51
|
+
version: z.ZodOptional<z.ZodString>;
|
|
52
|
+
status: z.ZodEnum<{
|
|
53
|
+
live: "live";
|
|
54
|
+
disabled: "disabled";
|
|
55
|
+
inert: "inert";
|
|
56
|
+
}>;
|
|
57
|
+
type: z.ZodOptional<z.ZodString>;
|
|
58
|
+
directory: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, z.core.$strict>>;
|
|
60
|
+
export type LocalPluginCandidate = z.infer<typeof localPluginCandidateSchema>;
|
|
47
61
|
export declare const searchInputSchema: z.ZodReadonly<z.ZodObject<{
|
|
48
62
|
query: z.ZodString;
|
|
49
63
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -412,8 +426,8 @@ export declare const openListMountSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
412
426
|
enabled: z.ZodBoolean;
|
|
413
427
|
status: z.ZodOptional<z.ZodEnum<{
|
|
414
428
|
error: "error";
|
|
415
|
-
ready: "ready";
|
|
416
429
|
disabled: "disabled";
|
|
430
|
+
ready: "ready";
|
|
417
431
|
}>>;
|
|
418
432
|
error: z.ZodOptional<z.ZodString>;
|
|
419
433
|
capacityUsed: z.ZodOptional<z.ZodNumber>;
|
package/lib/contract.js
CHANGED
|
@@ -19,6 +19,15 @@ export const driveCandidateSchema = z.object({
|
|
|
19
19
|
origin: z.string().optional(), updatedAt: z.number().optional(),
|
|
20
20
|
searchIncomplete: z.boolean().optional(), isDirectory: z.boolean().optional(),
|
|
21
21
|
}).strict().readonly();
|
|
22
|
+
export const localPluginCandidateSchema = z.object({
|
|
23
|
+
id: z.string(),
|
|
24
|
+
name: z.string(),
|
|
25
|
+
label: z.string(),
|
|
26
|
+
version: z.string().optional(),
|
|
27
|
+
status: z.enum(['live', 'disabled', 'inert']),
|
|
28
|
+
type: z.string().optional(),
|
|
29
|
+
directory: z.string().optional(),
|
|
30
|
+
}).strict().readonly();
|
|
22
31
|
/**
|
|
23
32
|
* Binds the calling session to the invocation, so the Host can scope a search
|
|
24
33
|
* to the session's cwd. Reintroduced here after 0.3.0 handed file and session
|
|
@@ -158,6 +167,7 @@ export const REFERENCE_ANYTHING_INVOCATIONS = [
|
|
|
158
167
|
descriptor('openListDisableMount', [{ name: 'input', wire: 'input', source: 'json', codec: strict('OpenListDisableMountInput', openListDisableMountSchema) }], strict('Boolean', z.boolean()), true),
|
|
159
168
|
descriptor('openListRemoveMount', [{ name: 'input', wire: 'input', source: 'json', codec: strict('OpenListMountInput', openListMountInputSchema) }], strict('Boolean', z.boolean()), true),
|
|
160
169
|
descriptor('openListReindex', [{ name: 'input', wire: 'input', source: 'json', codec: strict('OpenListMountInput', openListMountInputSchema) }], strict('OpenListReindex', z.object({ supported: z.boolean(), reason: z.string().optional() }).readonly()), true),
|
|
170
|
+
descriptor('localPlugins', [], strict('LocalPluginCandidate[]', z.array(localPluginCandidateSchema)), true),
|
|
161
171
|
];
|
|
162
172
|
function strict(type, schema) {
|
|
163
173
|
return { mode: 'strict', typeSymbol: `dsh-reference-anything#${type}`, schema, create: () => schema };
|
package/lib/host.d.ts
CHANGED
|
@@ -98,42 +98,82 @@ export declare class ReferenceAnythingRemote extends TypertRemoteService {
|
|
|
98
98
|
order: number;
|
|
99
99
|
limit: number;
|
|
100
100
|
maxCandidates: number;
|
|
101
|
+
sort: "name" | "updated";
|
|
102
|
+
shortcut: string;
|
|
103
|
+
aliases?: string[] | undefined;
|
|
104
|
+
sourceAliases?: Record<string, string[]> | undefined;
|
|
101
105
|
};
|
|
102
106
|
skills: {
|
|
103
107
|
enabled: boolean;
|
|
104
108
|
order: number;
|
|
105
109
|
limit: number;
|
|
106
110
|
maxCandidates: number;
|
|
111
|
+
sort: "name" | "updated";
|
|
112
|
+
shortcut: string;
|
|
113
|
+
aliases?: string[] | undefined;
|
|
114
|
+
sourceAliases?: Record<string, string[]> | undefined;
|
|
107
115
|
};
|
|
108
116
|
files: {
|
|
109
117
|
enabled: boolean;
|
|
110
118
|
order: number;
|
|
111
119
|
limit: number;
|
|
112
120
|
maxCandidates: number;
|
|
121
|
+
sort: "name" | "updated";
|
|
122
|
+
shortcut: string;
|
|
123
|
+
aliases?: string[] | undefined;
|
|
124
|
+
sourceAliases?: Record<string, string[]> | undefined;
|
|
113
125
|
};
|
|
114
126
|
sessions: {
|
|
115
127
|
enabled: boolean;
|
|
116
128
|
order: number;
|
|
117
129
|
limit: number;
|
|
118
130
|
maxCandidates: number;
|
|
131
|
+
sort: "name" | "updated";
|
|
132
|
+
shortcut: string;
|
|
133
|
+
aliases?: string[] | undefined;
|
|
134
|
+
sourceAliases?: Record<string, string[]> | undefined;
|
|
119
135
|
};
|
|
120
136
|
agents: {
|
|
121
137
|
enabled: boolean;
|
|
122
138
|
order: number;
|
|
123
139
|
limit: number;
|
|
124
140
|
maxCandidates: number;
|
|
141
|
+
sort: "name" | "updated";
|
|
142
|
+
shortcut: string;
|
|
143
|
+
aliases?: string[] | undefined;
|
|
144
|
+
sourceAliases?: Record<string, string[]> | undefined;
|
|
125
145
|
};
|
|
126
146
|
conversations: {
|
|
127
147
|
enabled: boolean;
|
|
128
148
|
order: number;
|
|
129
149
|
limit: number;
|
|
130
150
|
maxCandidates: number;
|
|
151
|
+
sort: "name" | "updated";
|
|
152
|
+
shortcut: string;
|
|
153
|
+
aliases?: string[] | undefined;
|
|
154
|
+
sourceAliases?: Record<string, string[]> | undefined;
|
|
131
155
|
};
|
|
132
156
|
drives: {
|
|
133
157
|
enabled: boolean;
|
|
134
158
|
order: number;
|
|
135
159
|
limit: number;
|
|
136
160
|
maxCandidates: number;
|
|
161
|
+
sort: "name" | "updated";
|
|
162
|
+
shortcut: string;
|
|
163
|
+
aliases?: string[] | undefined;
|
|
164
|
+
sourceAliases?: Record<string, string[]> | undefined;
|
|
165
|
+
};
|
|
166
|
+
plugins: {
|
|
167
|
+
enabled: boolean;
|
|
168
|
+
order: number;
|
|
169
|
+
limit: number;
|
|
170
|
+
maxCandidates: number;
|
|
171
|
+
sort: "name" | "updated";
|
|
172
|
+
shortcut: string;
|
|
173
|
+
onlyLive: boolean;
|
|
174
|
+
showDeepSeek: boolean;
|
|
175
|
+
aliases?: string[] | undefined;
|
|
176
|
+
sourceAliases?: Record<string, string[]> | undefined;
|
|
137
177
|
};
|
|
138
178
|
} | undefined;
|
|
139
179
|
}>;
|
|
@@ -197,4 +237,13 @@ export declare class ReferenceAnythingRemote extends TypertRemoteService {
|
|
|
197
237
|
}, signal: AbortSignal): Promise<{
|
|
198
238
|
supported: true;
|
|
199
239
|
}>;
|
|
240
|
+
localPlugins(signal: AbortSignal): Promise<readonly Readonly<{
|
|
241
|
+
id: string;
|
|
242
|
+
name: string;
|
|
243
|
+
label: string;
|
|
244
|
+
status: "live" | "disabled" | "inert";
|
|
245
|
+
version?: string | undefined;
|
|
246
|
+
type?: string | undefined;
|
|
247
|
+
directory?: string | undefined;
|
|
248
|
+
}>[]>;
|
|
200
249
|
}
|
package/lib/host.js
CHANGED
|
@@ -2,6 +2,7 @@ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
3
|
import { spawn } from 'node:child_process';
|
|
4
4
|
import { validateDownloadDirectory } from "./download-directory.js";
|
|
5
|
+
import { resolveLocalPlugins } from "./local-plugins.js";
|
|
5
6
|
export class ReferenceAnythingRemote extends TypertRemoteService {
|
|
6
7
|
constructor(ctx) { super(ctx, 'referenceAnything'); }
|
|
7
8
|
/**
|
|
@@ -133,4 +134,8 @@ export class ReferenceAnythingRemote extends TypertRemoteService {
|
|
|
133
134
|
async openListDisableMount(input, signal) { await this.ctx.openListManager.disableMount(input.id, input.disabled ?? true, signal); return true; }
|
|
134
135
|
async openListRemoveMount(input, signal) { await this.ctx.openListManager.removeMount(input.id, signal); return true; }
|
|
135
136
|
openListReindex(input, signal) { return this.ctx.openListManager.reindexMount(input.id, signal); }
|
|
137
|
+
localPlugins(signal) {
|
|
138
|
+
signal.throwIfAborted();
|
|
139
|
+
return resolveLocalPlugins(this.ctx);
|
|
140
|
+
}
|
|
136
141
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { LocalPluginCandidate } from './contract.ts';
|
|
3
|
+
import type { ReferenceSource } from './types.ts';
|
|
4
|
+
export declare function createPluginReferenceSource(ctx: Context): ReferenceSource;
|
|
5
|
+
/** Read the active loader's composed entries, including bundle patches and effective disables. */
|
|
6
|
+
export declare function resolveLocalPlugins(ctx: Context): Promise<readonly LocalPluginCandidate[]>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { readFile, realpath, stat } from 'node:fs/promises';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { dirname, isAbsolute, join } from 'node:path';
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { sliceTurns } from "./window.js";
|
|
7
|
+
export function createPluginReferenceSource(ctx) {
|
|
8
|
+
return {
|
|
9
|
+
id: 'local-plugin', requiresGrant: true,
|
|
10
|
+
available: async () => Boolean(ctx.get('loader')),
|
|
11
|
+
async list(query, limit, signal) {
|
|
12
|
+
signal?.throwIfAborted();
|
|
13
|
+
return (await resolveLocalPlugins(ctx)).filter(row => row.name.toLowerCase().includes(query.toLowerCase())).slice(0, limit)
|
|
14
|
+
.map(row => ({ ref: { source: 'local-plugin', id: row.name }, label: row.name }));
|
|
15
|
+
},
|
|
16
|
+
async read(ref, window, signal) {
|
|
17
|
+
signal?.throwIfAborted();
|
|
18
|
+
const plugin = (await resolveLocalPlugins(ctx)).find(row => row.name === ref.id);
|
|
19
|
+
if (!plugin?.directory)
|
|
20
|
+
throw new Error(`Plugin directory unavailable: ${ref.id}`);
|
|
21
|
+
return {
|
|
22
|
+
ref, label: plugin.name, partial: false, capturedAt: Date.now(),
|
|
23
|
+
body: sliceTurns([{ role: 'document', text: JSON.stringify({ name: plugin.name, version: plugin.version, directory: plugin.directory, note: 'Use file tools to inspect this plugin directory. Source contents have not been read.' }) }], window),
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const manifestSchema = z.object({
|
|
29
|
+
name: z.string().optional(), version: z.string().optional(),
|
|
30
|
+
dependencies: z.record(z.string(), z.string()).optional(),
|
|
31
|
+
dsh: z.object({
|
|
32
|
+
bundle: z.object({ patch: z.string() }).optional(),
|
|
33
|
+
client: z.unknown().optional(),
|
|
34
|
+
profile: z.object({ bundles: z.array(z.string()).optional() }).optional(),
|
|
35
|
+
}).optional(),
|
|
36
|
+
});
|
|
37
|
+
async function readManifest(directory) {
|
|
38
|
+
try {
|
|
39
|
+
return manifestSchema.parse(JSON.parse(await readFile(join(directory, 'package.json'), 'utf8')));
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return undefined; /* Missing or invalid optional metadata must not hide a configured entry. */
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function pluginPackage(name, baseUrl) {
|
|
46
|
+
if (!baseUrl?.startsWith('file:'))
|
|
47
|
+
return undefined;
|
|
48
|
+
const require = createRequire(new URL('./package.json', baseUrl));
|
|
49
|
+
if (!name.startsWith('.') && !name.startsWith('/') && !name.includes(':')) {
|
|
50
|
+
const packageName = name.split('/').slice(0, name.startsWith('@') ? 2 : 1).join('/');
|
|
51
|
+
for (const searchPath of require.resolve.paths(packageName) ?? []) {
|
|
52
|
+
const directory = join(searchPath, packageName);
|
|
53
|
+
const manifest = await readManifest(directory);
|
|
54
|
+
if (manifest)
|
|
55
|
+
return { directory: await realpath(directory), manifest };
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const url = isAbsolute(name) ? pathToFileURL(name) : new URL(name.replace(/\\/gu, '/'), baseUrl);
|
|
61
|
+
const path = await realpath(fileURLToPath(url));
|
|
62
|
+
const directory = (await stat(path)).isDirectory() ? path : dirname(path);
|
|
63
|
+
let parent = directory;
|
|
64
|
+
while (true) {
|
|
65
|
+
const manifest = await readManifest(parent);
|
|
66
|
+
if (manifest)
|
|
67
|
+
return manifest.dsh?.profile ? { directory, manifest: {} } : { directory: parent, manifest };
|
|
68
|
+
if (dirname(parent) === parent)
|
|
69
|
+
return { directory, manifest: {} };
|
|
70
|
+
parent = dirname(parent);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return undefined; /* A disabled or failed local entry may no longer exist on disk. */
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const STATUS_ORDER = { live: 0, inert: 1, disabled: 2 };
|
|
78
|
+
// Cordis publishes FiberState as an ambient const enum, unavailable with verbatimModuleSyntax.
|
|
79
|
+
const ACTIVE = 2; // FiberState.ACTIVE
|
|
80
|
+
/** Read the active loader's composed entries, including bundle patches and effective disables. */
|
|
81
|
+
export async function resolveLocalPlugins(ctx) {
|
|
82
|
+
const loader = ctx.get('loader');
|
|
83
|
+
if (!loader)
|
|
84
|
+
return [];
|
|
85
|
+
const plugins = new Map();
|
|
86
|
+
for (const entry of loader.entries()) {
|
|
87
|
+
if (entry.options.name.startsWith('cordis:') || entry.options.group)
|
|
88
|
+
continue;
|
|
89
|
+
const info = await pluginPackage(entry.options.name, entry.parent.tree.ctx.baseUrl);
|
|
90
|
+
const name = info?.manifest.name ?? entry.options.name;
|
|
91
|
+
const status = entry.disabled ? 'disabled' : entry.fiber?.state === ACTIVE ? 'live' : 'inert';
|
|
92
|
+
const previous = plugins.get(name);
|
|
93
|
+
if (previous && STATUS_ORDER[previous.status] <= STATUS_ORDER[status])
|
|
94
|
+
continue;
|
|
95
|
+
plugins.set(name, {
|
|
96
|
+
id: entry.id, name, label: name, status,
|
|
97
|
+
...(info ? { directory: info.directory, version: info.manifest.version } : {}),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
// Installed bundles/client plugins can exist without a host entry. Ordinary dependencies are omitted.
|
|
101
|
+
const baseUrl = loader.root.ctx.baseUrl;
|
|
102
|
+
if (baseUrl?.startsWith('file:')) {
|
|
103
|
+
const profile = await readManifest(fileURLToPath(new URL('.', baseUrl)));
|
|
104
|
+
const bundles = new Set(profile?.dsh?.profile?.bundles ?? []);
|
|
105
|
+
for (const packageName of new Set([...Object.keys(profile?.dependencies ?? {}), ...bundles])) {
|
|
106
|
+
const info = await pluginPackage(packageName, baseUrl);
|
|
107
|
+
if (!bundles.has(packageName) && !info?.manifest.dsh?.bundle && !info?.manifest.dsh?.client)
|
|
108
|
+
continue;
|
|
109
|
+
const name = info?.manifest.name ?? packageName;
|
|
110
|
+
if (plugins.has(name))
|
|
111
|
+
continue;
|
|
112
|
+
plugins.set(name, {
|
|
113
|
+
id: packageName, name, label: name, status: 'inert',
|
|
114
|
+
...(info ? { directory: info.directory, version: info.manifest.version } : {}),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return [...plugins.values()].sort((a, b) => STATUS_ORDER[a.status] - STATUS_ORDER[b.status] || a.name.localeCompare(b.name));
|
|
119
|
+
}
|
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/web.js
CHANGED
|
@@ -1,12 +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
|
// ReferenceAnythingRemote looks up optional sources through ctx.get(). Making
|
|
5
6
|
// cloud drives a required injection blocks all conversation endpoints when
|
|
6
7
|
// that source is disabled or unavailable in the active profile.
|
|
7
|
-
export const inject = ['typert', 'referenceChatHistory', 'openListManager'];
|
|
8
|
+
export const inject = ['typert', 'referenceChatHistory', 'openListManager', 'references'];
|
|
8
9
|
export function apply(ctx) {
|
|
9
10
|
new ReferenceAnythingRemote(ctx);
|
|
11
|
+
ctx.effect(() => ctx.references.registerSource(createPluginReferenceSource(ctx)), 'reference-anything-web.plugin-source');
|
|
10
12
|
ctx.effect(() => {
|
|
11
13
|
const dispose = ctx.typert.register(TYPERT_MANIFEST);
|
|
12
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>;
|