@struktoai/mirage-node 0.0.1-alpha.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.
- package/README.md +230 -0
- package/dist/box-4P7DCJH7.js +8 -0
- package/dist/box-4P7DCJH7.js.map +1 -0
- package/dist/chunk-35PVZRWU.js +24 -0
- package/dist/chunk-35PVZRWU.js.map +1 -0
- package/dist/chunk-3PBSL7BS.js +93 -0
- package/dist/chunk-3PBSL7BS.js.map +1 -0
- package/dist/chunk-3Y625AUP.js +24 -0
- package/dist/chunk-3Y625AUP.js.map +1 -0
- package/dist/chunk-5E6BULAK.js +92 -0
- package/dist/chunk-5E6BULAK.js.map +1 -0
- package/dist/chunk-5ITBZN55.js +24 -0
- package/dist/chunk-5ITBZN55.js.map +1 -0
- package/dist/chunk-6M2NL363.js +94 -0
- package/dist/chunk-6M2NL363.js.map +1 -0
- package/dist/chunk-6M3QVVOH.js +32 -0
- package/dist/chunk-6M3QVVOH.js.map +1 -0
- package/dist/chunk-6VKNSO6U.js +56 -0
- package/dist/chunk-6VKNSO6U.js.map +1 -0
- package/dist/chunk-6Y6GWMFF.js +24 -0
- package/dist/chunk-6Y6GWMFF.js.map +1 -0
- package/dist/chunk-7QXJ4KWQ.js +132 -0
- package/dist/chunk-7QXJ4KWQ.js.map +1 -0
- package/dist/chunk-ALAMUIGJ.js +57 -0
- package/dist/chunk-ALAMUIGJ.js.map +1 -0
- package/dist/chunk-DCJQ2PIX.js +100 -0
- package/dist/chunk-DCJQ2PIX.js.map +1 -0
- package/dist/chunk-EKPH4MMD.js +27 -0
- package/dist/chunk-EKPH4MMD.js.map +1 -0
- package/dist/chunk-FZ2GJ4BJ.js +29 -0
- package/dist/chunk-FZ2GJ4BJ.js.map +1 -0
- package/dist/chunk-G7O6DAWU.js +178 -0
- package/dist/chunk-G7O6DAWU.js.map +1 -0
- package/dist/chunk-GCB4JUF7.js +94 -0
- package/dist/chunk-GCB4JUF7.js.map +1 -0
- package/dist/chunk-GKQNMLQU.js +7757 -0
- package/dist/chunk-GKQNMLQU.js.map +1 -0
- package/dist/chunk-GO67AOYK.js +24 -0
- package/dist/chunk-GO67AOYK.js.map +1 -0
- package/dist/chunk-GPF66TH2.js +24 -0
- package/dist/chunk-GPF66TH2.js.map +1 -0
- package/dist/chunk-H3JR7MN3.js +45 -0
- package/dist/chunk-H3JR7MN3.js.map +1 -0
- package/dist/chunk-H74QYTN7.js +50 -0
- package/dist/chunk-H74QYTN7.js.map +1 -0
- package/dist/chunk-HEQL3LPK.js +66 -0
- package/dist/chunk-HEQL3LPK.js.map +1 -0
- package/dist/chunk-HXWGG4K7.js +66 -0
- package/dist/chunk-HXWGG4K7.js.map +1 -0
- package/dist/chunk-I4RRGZGB.js +24 -0
- package/dist/chunk-I4RRGZGB.js.map +1 -0
- package/dist/chunk-ICSS5ETT.js +67 -0
- package/dist/chunk-ICSS5ETT.js.map +1 -0
- package/dist/chunk-KINMBZHC.js +18 -0
- package/dist/chunk-KINMBZHC.js.map +1 -0
- package/dist/chunk-LBBM3LKK.js +99 -0
- package/dist/chunk-LBBM3LKK.js.map +1 -0
- package/dist/chunk-LPMPTQYP.js +36 -0
- package/dist/chunk-LPMPTQYP.js.map +1 -0
- package/dist/chunk-M42JTWPR.js +2794 -0
- package/dist/chunk-M42JTWPR.js.map +1 -0
- package/dist/chunk-MVE5VVMQ.js +91 -0
- package/dist/chunk-MVE5VVMQ.js.map +1 -0
- package/dist/chunk-MY3NUJJD.js +67 -0
- package/dist/chunk-MY3NUJJD.js.map +1 -0
- package/dist/chunk-NOZZFJEB.js +93 -0
- package/dist/chunk-NOZZFJEB.js.map +1 -0
- package/dist/chunk-OYJXYJTE.js +2358 -0
- package/dist/chunk-OYJXYJTE.js.map +1 -0
- package/dist/chunk-PEZYBKZH.js +124 -0
- package/dist/chunk-PEZYBKZH.js.map +1 -0
- package/dist/chunk-QWWOBAYU.js +26 -0
- package/dist/chunk-QWWOBAYU.js.map +1 -0
- package/dist/chunk-RQYYYBQG.js +24 -0
- package/dist/chunk-RQYYYBQG.js.map +1 -0
- package/dist/chunk-T2WWAEKH.js +7591 -0
- package/dist/chunk-T2WWAEKH.js.map +1 -0
- package/dist/chunk-U6QSXTUS.js +7 -0
- package/dist/chunk-U6QSXTUS.js.map +1 -0
- package/dist/chunk-UWMOTOXA.js +93 -0
- package/dist/chunk-UWMOTOXA.js.map +1 -0
- package/dist/chunk-UZZD4MRJ.js +95 -0
- package/dist/chunk-UZZD4MRJ.js.map +1 -0
- package/dist/chunk-V5OLWE7F.js +88 -0
- package/dist/chunk-V5OLWE7F.js.map +1 -0
- package/dist/chunk-VCLMTMSO.js +23 -0
- package/dist/chunk-VCLMTMSO.js.map +1 -0
- package/dist/chunk-WSDQ2MRG.js +102 -0
- package/dist/chunk-WSDQ2MRG.js.map +1 -0
- package/dist/chunk-XDEEOTVK.js +93 -0
- package/dist/chunk-XDEEOTVK.js.map +1 -0
- package/dist/chunk-XQUQSNCA.js +117 -0
- package/dist/chunk-XQUQSNCA.js.map +1 -0
- package/dist/chunk-XVYZO2FG.js +14 -0
- package/dist/chunk-XVYZO2FG.js.map +1 -0
- package/dist/chunk-ZC4KNEOQ.js +50 -0
- package/dist/chunk-ZC4KNEOQ.js.map +1 -0
- package/dist/config-5ZPGISS6.js +13 -0
- package/dist/config-5ZPGISS6.js.map +1 -0
- package/dist/config-6HWSKHEU.js +9 -0
- package/dist/config-6HWSKHEU.js.map +1 -0
- package/dist/config-6TNFPYZF.js +9 -0
- package/dist/config-6TNFPYZF.js.map +1 -0
- package/dist/config-BHLXQ3OL.js +9 -0
- package/dist/config-BHLXQ3OL.js.map +1 -0
- package/dist/config-E7UOEWEP.js +9 -0
- package/dist/config-E7UOEWEP.js.map +1 -0
- package/dist/config-FNR6LJ5H.js +11 -0
- package/dist/config-FNR6LJ5H.js.map +1 -0
- package/dist/config-HIZHA5VD.js +13 -0
- package/dist/config-HIZHA5VD.js.map +1 -0
- package/dist/config-HNSDNQZH.js +9 -0
- package/dist/config-HNSDNQZH.js.map +1 -0
- package/dist/config-IXLFUSMQ.js +9 -0
- package/dist/config-IXLFUSMQ.js.map +1 -0
- package/dist/config-J3TM7NIS.js +9 -0
- package/dist/config-J3TM7NIS.js.map +1 -0
- package/dist/config-JXLZ4XEW.js +9 -0
- package/dist/config-JXLZ4XEW.js.map +1 -0
- package/dist/config-KQCEMLNZ.js +9 -0
- package/dist/config-KQCEMLNZ.js.map +1 -0
- package/dist/config-MOLWOSRG.js +9 -0
- package/dist/config-MOLWOSRG.js.map +1 -0
- package/dist/config-R3XJ5OW4.js +9 -0
- package/dist/config-R3XJ5OW4.js.map +1 -0
- package/dist/config-S47UDVRZ.js +13 -0
- package/dist/config-S47UDVRZ.js.map +1 -0
- package/dist/config-UKZ72IDO.js +13 -0
- package/dist/config-UKZ72IDO.js.map +1 -0
- package/dist/config-V7XI5UTG.js +9 -0
- package/dist/config-V7XI5UTG.js.map +1 -0
- package/dist/config-YLIX3ZBT.js +9 -0
- package/dist/config-YLIX3ZBT.js.map +1 -0
- package/dist/config-Z5JGDOKE.js +9 -0
- package/dist/config-Z5JGDOKE.js.map +1 -0
- package/dist/config-ZCZZAH5W.js +9 -0
- package/dist/config-ZCZZAH5W.js.map +1 -0
- package/dist/config-ZZGIWDUC.js +9 -0
- package/dist/config-ZZGIWDUC.js.map +1 -0
- package/dist/discord-2PWP2MGX.js +8 -0
- package/dist/discord-2PWP2MGX.js.map +1 -0
- package/dist/disk-C7TJNU2B.js +8 -0
- package/dist/disk-C7TJNU2B.js.map +1 -0
- package/dist/dropbox-L5DPYGKR.js +8 -0
- package/dist/dropbox-L5DPYGKR.js.map +1 -0
- package/dist/email-HASRFBKC.js +8 -0
- package/dist/email-HASRFBKC.js.map +1 -0
- package/dist/gcs-P5QMKTPR.js +10 -0
- package/dist/gcs-P5QMKTPR.js.map +1 -0
- package/dist/gdocs-IF2I35HZ.js +8 -0
- package/dist/gdocs-IF2I35HZ.js.map +1 -0
- package/dist/gdrive-TAETVCKP.js +8 -0
- package/dist/gdrive-TAETVCKP.js.map +1 -0
- package/dist/github-5E6GSCNZ.js +8 -0
- package/dist/github-5E6GSCNZ.js.map +1 -0
- package/dist/github_ci-2DSZI3Y7.js +8 -0
- package/dist/github_ci-2DSZI3Y7.js.map +1 -0
- package/dist/gmail-F5VYGKOT.js +8 -0
- package/dist/gmail-F5VYGKOT.js.map +1 -0
- package/dist/gsheets-BAO54CQ7.js +8 -0
- package/dist/gsheets-BAO54CQ7.js.map +1 -0
- package/dist/gslides-A62CEEMR.js +8 -0
- package/dist/gslides-A62CEEMR.js.map +1 -0
- package/dist/index.d.ts +1671 -0
- package/dist/index.js +3564 -0
- package/dist/index.js.map +1 -0
- package/dist/langfuse-YKBYRQLU.js +8 -0
- package/dist/langfuse-YKBYRQLU.js.map +1 -0
- package/dist/linear-WJDQ6JDE.js +8 -0
- package/dist/linear-WJDQ6JDE.js.map +1 -0
- package/dist/mongodb-MK4DVSIK.js +7 -0
- package/dist/mongodb-MK4DVSIK.js.map +1 -0
- package/dist/oci-KZ7XFZ2X.js +10 -0
- package/dist/oci-KZ7XFZ2X.js.map +1 -0
- package/dist/postgres-M2N2APFZ.js +7 -0
- package/dist/postgres-M2N2APFZ.js.map +1 -0
- package/dist/r2-X4DDNSAZ.js +10 -0
- package/dist/r2-X4DDNSAZ.js.map +1 -0
- package/dist/redis-NVCXUUIO.js +7 -0
- package/dist/redis-NVCXUUIO.js.map +1 -0
- package/dist/s3-HVAL7ZX3.js +8 -0
- package/dist/s3-HVAL7ZX3.js.map +1 -0
- package/dist/slack-GUQMDGLP.js +8 -0
- package/dist/slack-GUQMDGLP.js.map +1 -0
- package/dist/ssh-LY6WYVVD.js +9 -0
- package/dist/ssh-LY6WYVVD.js.map +1 -0
- package/dist/supabase-H3ZP4Y3W.js +10 -0
- package/dist/supabase-H3ZP4Y3W.js.map +1 -0
- package/dist/trello-WR6TEDYD.js +8 -0
- package/dist/trello-WR6TEDYD.js.map +1 -0
- package/package.json +118 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1671 @@
|
|
|
1
|
+
import { Workspace as Workspace$1, Resource, WorkspaceOptions, ExecuteOptions, ExecuteResult, ProvisionResult, Accessor, IndexCacheStore, RegisteredOp, RegisteredCommand, PathSpec, FileStat, FindOptions, CommandOpts, FileCache, IndexConfig, LookupResult, IndexEntry, ListResult, OpRecord, S3Config as S3Config$1, S3ConfigRedacted as S3ConfigRedacted$1, S3Accessor, PgDriver, PostgresConfigResolved, PgQueryResult, PostgresAccessor, PostgresConfig, MongoDriver, MongoFindOptions, MongoDBConfigResolved, MongoDBAccessor, MongoDBConfig, SSCholarConfigResolved, SSCholarDriver, SSCholarAccessor, SSCholarConfig, VercelConfigResolved, VercelDriver, VercelAccessor, VercelConfig, PostHogConfigResolved, PostHogDriver, PostHogAccessor, PostHogConfig, SlackAccessor, DiscordAccessor, TrelloAccessor, LinearAccessor, LangfuseAccessor, GitHubAccessor, GitHubCIAccessor, GDocsAccessor, GSheetsAccessor, GSlidesAccessor, GDriveAccessor, DropboxAccessor, BoxAccessor, GmailAccessor } from '@struktoai/mirage-core';
|
|
2
|
+
export * from '@struktoai/mirage-core';
|
|
3
|
+
import { RedisClientType } from 'redis';
|
|
4
|
+
import { ChildProcess } from 'node:child_process';
|
|
5
|
+
import { Readable } from 'node:stream';
|
|
6
|
+
import { SFTPWrapper } from 'ssh2';
|
|
7
|
+
import { ImapFlow } from 'imapflow';
|
|
8
|
+
|
|
9
|
+
interface NodeWorkspaceOptions extends WorkspaceOptions {
|
|
10
|
+
fuse?: boolean;
|
|
11
|
+
native?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare class Workspace extends Workspace$1 {
|
|
14
|
+
private readonly defaultNative;
|
|
15
|
+
private readonly autoFuseManager;
|
|
16
|
+
private fuseSetupPromise;
|
|
17
|
+
constructor(resources: Record<string, Resource>, options?: NodeWorkspaceOptions);
|
|
18
|
+
private ensureFuseReady;
|
|
19
|
+
execute(command: string, options?: ExecuteOptions & {
|
|
20
|
+
provision?: false | undefined;
|
|
21
|
+
}): Promise<ExecuteResult>;
|
|
22
|
+
execute(command: string, options: ExecuteOptions & {
|
|
23
|
+
provision: true;
|
|
24
|
+
}): Promise<ProvisionResult>;
|
|
25
|
+
execute(command: string, options: ExecuteOptions): Promise<ExecuteResult | ProvisionResult>;
|
|
26
|
+
close(): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare class DiskAccessor extends Accessor {
|
|
30
|
+
readonly root: string;
|
|
31
|
+
constructor(root: string);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface DiskResourceOptions {
|
|
35
|
+
root: string;
|
|
36
|
+
}
|
|
37
|
+
interface DiskResourceState {
|
|
38
|
+
type: string;
|
|
39
|
+
needsOverride: boolean;
|
|
40
|
+
redactedFields: string[];
|
|
41
|
+
files: Record<string, Uint8Array>;
|
|
42
|
+
}
|
|
43
|
+
declare class DiskResource implements Resource {
|
|
44
|
+
readonly kind: "disk";
|
|
45
|
+
readonly isRemote: boolean;
|
|
46
|
+
readonly indexTtl: number;
|
|
47
|
+
readonly prompt = "{prefix}\n Local disk filesystem. Mirrors the configured root directory.\n Standard commands: ls, cat, head, tail, grep, wc, find, tree, mkdir, touch, cp, mv, rm, tee.";
|
|
48
|
+
readonly root: string;
|
|
49
|
+
readonly accessor: DiskAccessor;
|
|
50
|
+
readonly index: IndexCacheStore;
|
|
51
|
+
readonly opsMap: Record<string, unknown>;
|
|
52
|
+
constructor(options: DiskResourceOptions);
|
|
53
|
+
open(): Promise<void>;
|
|
54
|
+
close(): Promise<void>;
|
|
55
|
+
ops(): readonly RegisteredOp[];
|
|
56
|
+
commands(): readonly RegisteredCommand[];
|
|
57
|
+
streamPath(p: PathSpec): AsyncIterable<Uint8Array>;
|
|
58
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
59
|
+
writeFile(p: PathSpec, data: Uint8Array): Promise<void>;
|
|
60
|
+
appendFile(p: PathSpec, data: Uint8Array): Promise<void>;
|
|
61
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
62
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
63
|
+
exists(p: PathSpec): Promise<boolean>;
|
|
64
|
+
mkdir(p: PathSpec, options?: {
|
|
65
|
+
recursive?: boolean;
|
|
66
|
+
}): Promise<void>;
|
|
67
|
+
rmdir(p: PathSpec): Promise<void>;
|
|
68
|
+
unlink(p: PathSpec): Promise<void>;
|
|
69
|
+
rename(src: PathSpec, dst: PathSpec): Promise<void>;
|
|
70
|
+
truncate(p: PathSpec, length: number): Promise<void>;
|
|
71
|
+
copy(src: PathSpec, dst: PathSpec): Promise<void>;
|
|
72
|
+
rmR(p: PathSpec): Promise<void>;
|
|
73
|
+
du(p: PathSpec): Promise<number>;
|
|
74
|
+
find(p: PathSpec, options?: FindOptions): Promise<string[]>;
|
|
75
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
76
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
77
|
+
getState(): Promise<DiskResourceState>;
|
|
78
|
+
loadState(state: DiskResourceState): Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare const DISK_PROMPT = "{prefix}\n Local disk filesystem. Mirrors the configured root directory.\n Standard commands: ls, cat, head, tail, grep, wc, find, tree, mkdir, touch, cp, mv, rm, tee.";
|
|
82
|
+
|
|
83
|
+
declare const DISK_OPS: readonly RegisteredOp[];
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Monkey-patch Node's `fs` module so that paths under any mirage mount
|
|
87
|
+
* route through the workspace. Paths NOT under a mount fall through to
|
|
88
|
+
* the real native fs. CJS-friendly; for ESM code you still need to use
|
|
89
|
+
* `ws.fs.*` directly since ESM bindings are frozen.
|
|
90
|
+
*
|
|
91
|
+
* Returns a `restore()` function that undoes the patch.
|
|
92
|
+
*/
|
|
93
|
+
declare function patchNodeFs(ws: Workspace$1): () => void;
|
|
94
|
+
|
|
95
|
+
interface RedisStoreOptions {
|
|
96
|
+
url?: string;
|
|
97
|
+
client?: RedisClientType;
|
|
98
|
+
keyPrefix?: string;
|
|
99
|
+
}
|
|
100
|
+
declare class RedisStore {
|
|
101
|
+
readonly url: string;
|
|
102
|
+
readonly keyPrefix: string;
|
|
103
|
+
private readonly providedClient;
|
|
104
|
+
private clientPromise;
|
|
105
|
+
constructor(options?: RedisStoreOptions);
|
|
106
|
+
fk(path: string): string;
|
|
107
|
+
dk(): string;
|
|
108
|
+
mk(path: string): string;
|
|
109
|
+
client(): Promise<RedisClientType>;
|
|
110
|
+
getFile(path: string): Promise<Uint8Array | null>;
|
|
111
|
+
setFile(path: string, data: Uint8Array): Promise<void>;
|
|
112
|
+
delFile(path: string): Promise<void>;
|
|
113
|
+
hasFile(path: string): Promise<boolean>;
|
|
114
|
+
listFiles(prefix?: string): Promise<string[]>;
|
|
115
|
+
fileLen(path: string): Promise<number>;
|
|
116
|
+
getRange(path: string, start: number, end: number): Promise<Uint8Array>;
|
|
117
|
+
hasDir(path: string): Promise<boolean>;
|
|
118
|
+
addDir(path: string): Promise<void>;
|
|
119
|
+
removeDir(path: string): Promise<void>;
|
|
120
|
+
listDirs(): Promise<Set<string>>;
|
|
121
|
+
getModified(path: string): Promise<string | null>;
|
|
122
|
+
setModified(path: string, ts: string): Promise<void>;
|
|
123
|
+
delModified(path: string): Promise<void>;
|
|
124
|
+
clear(): Promise<void>;
|
|
125
|
+
close(): Promise<void>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare class RedisAccessor extends Accessor {
|
|
129
|
+
readonly store: RedisStore;
|
|
130
|
+
constructor(store: RedisStore);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface RedisResourceOptions {
|
|
134
|
+
url?: string;
|
|
135
|
+
keyPrefix?: string;
|
|
136
|
+
}
|
|
137
|
+
interface RedisModule {
|
|
138
|
+
createClient: (options: {
|
|
139
|
+
url: string;
|
|
140
|
+
}) => RedisClientType;
|
|
141
|
+
RESP_TYPES: {
|
|
142
|
+
readonly BLOB_STRING: number;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
interface RedisResourceState {
|
|
146
|
+
type: string;
|
|
147
|
+
needsOverride: boolean;
|
|
148
|
+
redactedFields: string[];
|
|
149
|
+
keyPrefix: string;
|
|
150
|
+
files: Record<string, Uint8Array>;
|
|
151
|
+
dirs: string[];
|
|
152
|
+
}
|
|
153
|
+
declare class RedisResource implements Resource {
|
|
154
|
+
readonly kind: string;
|
|
155
|
+
readonly isRemote: boolean;
|
|
156
|
+
readonly indexTtl: number;
|
|
157
|
+
readonly prompt: string;
|
|
158
|
+
readonly url: string;
|
|
159
|
+
readonly keyPrefix: string;
|
|
160
|
+
readonly store: RedisStore;
|
|
161
|
+
readonly accessor: RedisAccessor;
|
|
162
|
+
readonly index: IndexCacheStore;
|
|
163
|
+
readonly opsMap: Record<string, unknown>;
|
|
164
|
+
constructor(options?: RedisResourceOptions);
|
|
165
|
+
open(): Promise<void>;
|
|
166
|
+
close(): Promise<void>;
|
|
167
|
+
client(): Promise<RedisClientType>;
|
|
168
|
+
protected module(): Promise<RedisModule>;
|
|
169
|
+
ops(): readonly RegisteredOp[];
|
|
170
|
+
commands(): readonly RegisteredCommand[];
|
|
171
|
+
streamPath(p: PathSpec): AsyncIterable<Uint8Array>;
|
|
172
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
173
|
+
writeFile(p: PathSpec, data: Uint8Array): Promise<void>;
|
|
174
|
+
appendFile(p: PathSpec, data: Uint8Array): Promise<void>;
|
|
175
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
176
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
177
|
+
exists(p: PathSpec): Promise<boolean>;
|
|
178
|
+
mkdir(p: PathSpec, options?: {
|
|
179
|
+
recursive?: boolean;
|
|
180
|
+
}): Promise<void>;
|
|
181
|
+
rmdir(p: PathSpec): Promise<void>;
|
|
182
|
+
unlink(p: PathSpec): Promise<void>;
|
|
183
|
+
rename(src: PathSpec, dst: PathSpec): Promise<void>;
|
|
184
|
+
truncate(p: PathSpec, length: number): Promise<void>;
|
|
185
|
+
copy(src: PathSpec, dst: PathSpec): Promise<void>;
|
|
186
|
+
rmR(p: PathSpec): Promise<void>;
|
|
187
|
+
du(p: PathSpec): Promise<number>;
|
|
188
|
+
find(p: PathSpec, options?: FindOptions): Promise<string[]>;
|
|
189
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
190
|
+
getState(): Promise<RedisResourceState>;
|
|
191
|
+
loadState(state: RedisResourceState): Promise<void>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare const REDIS_PROMPT = "Redis-backed persistent filesystem. Behaves like a standard filesystem.\nStandard commands: ls, cat, head, tail, grep, wc, find, tree, mkdir, touch, cp, mv, rm, tee.";
|
|
195
|
+
|
|
196
|
+
declare const REDIS_OPS: readonly RegisteredOp[];
|
|
197
|
+
|
|
198
|
+
interface RedisResourceLike extends Resource {
|
|
199
|
+
readonly accessor: RedisAccessor;
|
|
200
|
+
}
|
|
201
|
+
declare function fileReadProvision(accessor: Accessor, paths: PathSpec[], _texts: string[], _opts: CommandOpts): Promise<ProvisionResult>;
|
|
202
|
+
declare function headTailProvision(accessor: Accessor, paths: PathSpec[], _texts: string[], _opts: CommandOpts): Promise<ProvisionResult>;
|
|
203
|
+
declare function metadataProvision(_accessor: Accessor, paths: PathSpec[], _texts: string[], _opts: CommandOpts): ProvisionResult;
|
|
204
|
+
|
|
205
|
+
interface RedisFileCacheOptions extends RedisResourceOptions {
|
|
206
|
+
cacheLimit?: string | number;
|
|
207
|
+
maxDrainBytes?: number | null;
|
|
208
|
+
}
|
|
209
|
+
declare class RedisFileCacheStore extends RedisResource implements FileCache {
|
|
210
|
+
private readonly limit;
|
|
211
|
+
private readonly dataPrefix;
|
|
212
|
+
private readonly metaPrefix;
|
|
213
|
+
maxDrainBytes: number | null;
|
|
214
|
+
constructor(options?: RedisFileCacheOptions);
|
|
215
|
+
readonly cacheSize = 0;
|
|
216
|
+
get cacheLimit(): number;
|
|
217
|
+
cacheClient(): Promise<RedisClientType>;
|
|
218
|
+
get(key: string): Promise<Uint8Array | null>;
|
|
219
|
+
set(key: string, data: Uint8Array, options?: {
|
|
220
|
+
fingerprint?: string | null;
|
|
221
|
+
ttl?: number | null;
|
|
222
|
+
}): Promise<void>;
|
|
223
|
+
add(key: string, data: Uint8Array, options?: {
|
|
224
|
+
fingerprint?: string | null;
|
|
225
|
+
ttl?: number | null;
|
|
226
|
+
}): Promise<boolean>;
|
|
227
|
+
remove(key: string): Promise<void>;
|
|
228
|
+
exists(key: string | PathSpec): Promise<boolean>;
|
|
229
|
+
isFresh(key: string, remoteFingerprint: string): Promise<boolean>;
|
|
230
|
+
clear(): Promise<void>;
|
|
231
|
+
allCached(keys: readonly string[]): Promise<boolean>;
|
|
232
|
+
multiGet(keys: readonly string[]): Promise<(Uint8Array | null)[]>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
interface RedisIndexCacheOptions {
|
|
236
|
+
ttl?: number;
|
|
237
|
+
url?: string;
|
|
238
|
+
client?: RedisClientType;
|
|
239
|
+
keyPrefix?: string;
|
|
240
|
+
}
|
|
241
|
+
declare class RedisIndexCacheStore extends IndexCacheStore {
|
|
242
|
+
private readonly ttl;
|
|
243
|
+
private readonly url;
|
|
244
|
+
private readonly providedClient;
|
|
245
|
+
private readonly entryPrefix;
|
|
246
|
+
private readonly childrenPrefix;
|
|
247
|
+
private clientPromise;
|
|
248
|
+
constructor(options?: RedisIndexCacheOptions);
|
|
249
|
+
static fromConfig(config: IndexConfig, extra?: Omit<RedisIndexCacheOptions, 'ttl'>): RedisIndexCacheStore;
|
|
250
|
+
private entryKey;
|
|
251
|
+
private childrenKey;
|
|
252
|
+
private client;
|
|
253
|
+
get(resourcePath: string): Promise<LookupResult>;
|
|
254
|
+
put(resourcePath: string, entry: IndexEntry): Promise<void>;
|
|
255
|
+
listDir(resourcePath: string): Promise<ListResult>;
|
|
256
|
+
setDir(resourcePath: string, entries: readonly [string, IndexEntry][], expiredAt?: Date | null): Promise<void>;
|
|
257
|
+
invalidateDir(resourcePath: string): Promise<void>;
|
|
258
|
+
clear(): Promise<void>;
|
|
259
|
+
close(): Promise<void>;
|
|
260
|
+
private serialize;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
interface FuseHandle {
|
|
264
|
+
mountpoint: string;
|
|
265
|
+
unmount: () => Promise<void>;
|
|
266
|
+
}
|
|
267
|
+
interface MountOptions {
|
|
268
|
+
mountpoint?: string;
|
|
269
|
+
agentId?: string;
|
|
270
|
+
/**
|
|
271
|
+
* When true, `@zkochan/fuse-native`'s `autoUnmount` flag is set so the
|
|
272
|
+
* kernel releases the mount if the process exits abnormally. Defaults to
|
|
273
|
+
* `true` on Linux, `false` on darwin — macFUSE rejects the option with
|
|
274
|
+
* "unknown option `auto_unmount'". On darwin the SIGINT cleanup in
|
|
275
|
+
* FuseManager runs `diskutil unmount force` instead.
|
|
276
|
+
*/
|
|
277
|
+
autoUnmount?: boolean;
|
|
278
|
+
/** Extra options forwarded verbatim to `@zkochan/fuse-native`. */
|
|
279
|
+
fuseOptions?: Record<string, unknown>;
|
|
280
|
+
}
|
|
281
|
+
declare function mount(ws: Workspace$1, options?: MountOptions): Promise<FuseHandle>;
|
|
282
|
+
declare function mountBackground(ws: Workspace$1, options?: MountOptions): Promise<FuseHandle>;
|
|
283
|
+
|
|
284
|
+
declare class FuseManager {
|
|
285
|
+
private handle;
|
|
286
|
+
private externalMountpoint;
|
|
287
|
+
private auto;
|
|
288
|
+
private cleanupEntry;
|
|
289
|
+
get mountpoint(): string | null;
|
|
290
|
+
set mountpoint(path: string | null);
|
|
291
|
+
setup(ws: Workspace$1, options?: MountOptions): Promise<string>;
|
|
292
|
+
unmount(ws?: Workspace$1): Promise<void>;
|
|
293
|
+
close(ws?: Workspace$1): Promise<void>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
interface FuseAttr {
|
|
297
|
+
mtime: Date;
|
|
298
|
+
atime: Date;
|
|
299
|
+
ctime: Date;
|
|
300
|
+
nlink: number;
|
|
301
|
+
size: number;
|
|
302
|
+
mode: number;
|
|
303
|
+
uid: number;
|
|
304
|
+
gid: number;
|
|
305
|
+
}
|
|
306
|
+
interface MirageFSOptions {
|
|
307
|
+
agentId?: string;
|
|
308
|
+
}
|
|
309
|
+
declare class MirageFS {
|
|
310
|
+
private readonly ws;
|
|
311
|
+
readonly agentId: string;
|
|
312
|
+
private readonly now;
|
|
313
|
+
private readonly prefixes;
|
|
314
|
+
private readonly handles;
|
|
315
|
+
private readonly prefetchCache;
|
|
316
|
+
private readonly prefetchInflight;
|
|
317
|
+
private nextFh;
|
|
318
|
+
private readonly uid;
|
|
319
|
+
private readonly gid;
|
|
320
|
+
constructor(ws: Workspace$1, options?: MirageFSOptions);
|
|
321
|
+
private whoamiContent;
|
|
322
|
+
private dirStat;
|
|
323
|
+
private fileStat;
|
|
324
|
+
private isVirtualDir;
|
|
325
|
+
private virtualChildren;
|
|
326
|
+
private cachedSize;
|
|
327
|
+
private cachedData;
|
|
328
|
+
/**
|
|
329
|
+
* Fetch bytes for a size-unknown file and cache them so the immediate
|
|
330
|
+
* getattr → open → read burst (and subsequent stats within the TTL) reuse
|
|
331
|
+
* the same fetch. Required because @zkochan/fuse-native doesn't expose
|
|
332
|
+
* libfuse's `direct_io` flag — without a real size from getattr, the kernel
|
|
333
|
+
* decides the file is empty and never issues read().
|
|
334
|
+
*/
|
|
335
|
+
private prefetch;
|
|
336
|
+
/** Drain and return accumulated op records (mirrors Python's drain_ops). */
|
|
337
|
+
drainOps(): OpRecord[];
|
|
338
|
+
ops(): Record<string, unknown>;
|
|
339
|
+
private getattr;
|
|
340
|
+
private readdir;
|
|
341
|
+
private read;
|
|
342
|
+
private write;
|
|
343
|
+
private create;
|
|
344
|
+
private mkdir;
|
|
345
|
+
private unlink;
|
|
346
|
+
private rename;
|
|
347
|
+
private rmdir;
|
|
348
|
+
private truncate;
|
|
349
|
+
private statfs;
|
|
350
|
+
private chmod;
|
|
351
|
+
private chown;
|
|
352
|
+
private utimens;
|
|
353
|
+
private access;
|
|
354
|
+
private getattrValidate;
|
|
355
|
+
private open;
|
|
356
|
+
private release;
|
|
357
|
+
private flush;
|
|
358
|
+
private fsync;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
interface NativeExecOptions {
|
|
362
|
+
cwd: string;
|
|
363
|
+
env?: Record<string, string>;
|
|
364
|
+
timeoutMs?: number | null;
|
|
365
|
+
signal?: AbortSignal;
|
|
366
|
+
}
|
|
367
|
+
type NativeExecResult = ExecuteResult;
|
|
368
|
+
declare function nativeExec(command: string, options: NativeExecOptions): Promise<NativeExecResult>;
|
|
369
|
+
interface NativeProcess {
|
|
370
|
+
raw: ChildProcess;
|
|
371
|
+
stdoutStream(): Readable;
|
|
372
|
+
stderrStream(): Readable | null;
|
|
373
|
+
wait(): Promise<number>;
|
|
374
|
+
}
|
|
375
|
+
declare function nativeExecStream(command: string, options: NativeExecOptions): NativeProcess;
|
|
376
|
+
|
|
377
|
+
declare function isMacosMetadata(name: string): boolean;
|
|
378
|
+
|
|
379
|
+
interface S3Config extends S3Config$1 {
|
|
380
|
+
profile?: string;
|
|
381
|
+
}
|
|
382
|
+
interface S3ConfigRedacted extends S3ConfigRedacted$1 {
|
|
383
|
+
profile?: string;
|
|
384
|
+
}
|
|
385
|
+
declare function redactConfig(config: S3Config): S3ConfigRedacted;
|
|
386
|
+
|
|
387
|
+
interface S3ResourceState {
|
|
388
|
+
type: string;
|
|
389
|
+
needsOverride: boolean;
|
|
390
|
+
redactedFields: readonly string[];
|
|
391
|
+
config: S3ConfigRedacted;
|
|
392
|
+
}
|
|
393
|
+
declare class S3Resource implements Resource {
|
|
394
|
+
readonly kind: string;
|
|
395
|
+
readonly isRemote: boolean;
|
|
396
|
+
readonly indexTtl: number;
|
|
397
|
+
readonly prompt: string;
|
|
398
|
+
readonly config: S3Config;
|
|
399
|
+
readonly accessor: S3Accessor;
|
|
400
|
+
readonly index: IndexCacheStore;
|
|
401
|
+
readonly opsMap: Record<string, unknown>;
|
|
402
|
+
constructor(config: S3Config);
|
|
403
|
+
open(): Promise<void>;
|
|
404
|
+
close(): Promise<void>;
|
|
405
|
+
commands(): readonly RegisteredCommand[];
|
|
406
|
+
ops(): readonly RegisteredOp[];
|
|
407
|
+
streamPath(p: PathSpec): AsyncIterable<Uint8Array>;
|
|
408
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
409
|
+
writeFile(p: PathSpec, data: Uint8Array): Promise<void>;
|
|
410
|
+
appendFile(p: PathSpec, data: Uint8Array): Promise<void>;
|
|
411
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
412
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
413
|
+
exists(p: PathSpec): Promise<boolean>;
|
|
414
|
+
mkdir(p: PathSpec): Promise<void>;
|
|
415
|
+
rmdir(p: PathSpec): Promise<void>;
|
|
416
|
+
unlink(p: PathSpec): Promise<void>;
|
|
417
|
+
rename(src: PathSpec, dst: PathSpec): Promise<void>;
|
|
418
|
+
truncate(p: PathSpec, length: number): Promise<void>;
|
|
419
|
+
copy(src: PathSpec, dst: PathSpec): Promise<void>;
|
|
420
|
+
rmR(p: PathSpec): Promise<void>;
|
|
421
|
+
du(p: PathSpec): Promise<number>;
|
|
422
|
+
find(p: PathSpec, options?: FindOptions): Promise<string[]>;
|
|
423
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
424
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
425
|
+
getState(): Promise<S3ResourceState>;
|
|
426
|
+
loadState(_state: S3ResourceState): Promise<void>;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
declare const GCS_ENDPOINT = "https://storage.googleapis.com";
|
|
430
|
+
interface GCSConfig {
|
|
431
|
+
bucket: string;
|
|
432
|
+
accessKeyId: string;
|
|
433
|
+
secretAccessKey: string;
|
|
434
|
+
endpoint?: string;
|
|
435
|
+
region?: string;
|
|
436
|
+
timeoutMs?: number;
|
|
437
|
+
}
|
|
438
|
+
interface GCSConfigRedacted {
|
|
439
|
+
bucket: string;
|
|
440
|
+
accessKeyId: string;
|
|
441
|
+
secretAccessKey: string;
|
|
442
|
+
endpoint: string;
|
|
443
|
+
region: string;
|
|
444
|
+
timeoutMs?: number;
|
|
445
|
+
}
|
|
446
|
+
declare function redactGcsConfig(config: GCSConfig): GCSConfigRedacted;
|
|
447
|
+
|
|
448
|
+
interface GCSResourceState {
|
|
449
|
+
type: string;
|
|
450
|
+
needsOverride: boolean;
|
|
451
|
+
redactedFields: readonly string[];
|
|
452
|
+
config: GCSConfigRedacted;
|
|
453
|
+
}
|
|
454
|
+
declare class GCSResource extends S3Resource {
|
|
455
|
+
readonly kind: string;
|
|
456
|
+
readonly prompt: string;
|
|
457
|
+
readonly gcsConfig: GCSConfig;
|
|
458
|
+
private readonly gcsOps;
|
|
459
|
+
private readonly gcsCommands;
|
|
460
|
+
constructor(config: GCSConfig);
|
|
461
|
+
ops(): readonly RegisteredOp[];
|
|
462
|
+
commands(): readonly RegisteredCommand[];
|
|
463
|
+
getState(): Promise<GCSResourceState>;
|
|
464
|
+
loadState(_state: GCSResourceState): Promise<void>;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare const GCS_PROMPT = "{prefix}\n Remote Google Cloud Storage bucket.\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat.\n cat on .parquet/.orc/.feather returns a formatted table.";
|
|
468
|
+
|
|
469
|
+
interface OCIConfig {
|
|
470
|
+
bucket: string;
|
|
471
|
+
namespace: string;
|
|
472
|
+
region: string;
|
|
473
|
+
accessKeyId: string;
|
|
474
|
+
secretAccessKey: string;
|
|
475
|
+
endpoint?: string;
|
|
476
|
+
timeoutMs?: number;
|
|
477
|
+
}
|
|
478
|
+
interface OCIConfigRedacted {
|
|
479
|
+
bucket: string;
|
|
480
|
+
namespace: string;
|
|
481
|
+
region: string;
|
|
482
|
+
accessKeyId: string;
|
|
483
|
+
secretAccessKey: string;
|
|
484
|
+
endpoint: string;
|
|
485
|
+
timeoutMs?: number;
|
|
486
|
+
}
|
|
487
|
+
declare function redactOciConfig(config: OCIConfig): OCIConfigRedacted;
|
|
488
|
+
|
|
489
|
+
interface OCIResourceState {
|
|
490
|
+
type: string;
|
|
491
|
+
needsOverride: boolean;
|
|
492
|
+
redactedFields: readonly string[];
|
|
493
|
+
config: OCIConfigRedacted;
|
|
494
|
+
}
|
|
495
|
+
declare class OCIResource extends S3Resource {
|
|
496
|
+
readonly kind: string;
|
|
497
|
+
readonly prompt: string;
|
|
498
|
+
readonly ociConfig: OCIConfig;
|
|
499
|
+
private readonly ociOps;
|
|
500
|
+
private readonly ociCommands;
|
|
501
|
+
constructor(config: OCIConfig);
|
|
502
|
+
ops(): readonly RegisteredOp[];
|
|
503
|
+
commands(): readonly RegisteredCommand[];
|
|
504
|
+
getState(): Promise<OCIResourceState>;
|
|
505
|
+
loadState(_state: OCIResourceState): Promise<void>;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
declare const OCI_PROMPT = "{prefix}\n Remote Oracle Cloud Object Storage.\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat.";
|
|
509
|
+
|
|
510
|
+
interface R2Config {
|
|
511
|
+
bucket: string;
|
|
512
|
+
accessKeyId: string;
|
|
513
|
+
secretAccessKey: string;
|
|
514
|
+
accountId?: string;
|
|
515
|
+
endpoint?: string;
|
|
516
|
+
region?: string;
|
|
517
|
+
profile?: string;
|
|
518
|
+
timeoutMs?: number;
|
|
519
|
+
}
|
|
520
|
+
interface R2ConfigRedacted {
|
|
521
|
+
bucket: string;
|
|
522
|
+
accessKeyId: string;
|
|
523
|
+
secretAccessKey: string;
|
|
524
|
+
accountId?: string;
|
|
525
|
+
endpoint: string;
|
|
526
|
+
region: string;
|
|
527
|
+
profile?: string;
|
|
528
|
+
timeoutMs?: number;
|
|
529
|
+
}
|
|
530
|
+
declare function redactR2Config(config: R2Config): R2ConfigRedacted;
|
|
531
|
+
|
|
532
|
+
interface R2ResourceState {
|
|
533
|
+
type: string;
|
|
534
|
+
needsOverride: boolean;
|
|
535
|
+
redactedFields: readonly string[];
|
|
536
|
+
config: R2ConfigRedacted;
|
|
537
|
+
}
|
|
538
|
+
declare class R2Resource extends S3Resource {
|
|
539
|
+
readonly kind: string;
|
|
540
|
+
readonly prompt: string;
|
|
541
|
+
readonly r2Config: R2Config;
|
|
542
|
+
private readonly r2Ops;
|
|
543
|
+
private readonly r2Commands;
|
|
544
|
+
constructor(config: R2Config);
|
|
545
|
+
ops(): readonly RegisteredOp[];
|
|
546
|
+
commands(): readonly RegisteredCommand[];
|
|
547
|
+
getState(): Promise<R2ResourceState>;
|
|
548
|
+
loadState(_state: R2ResourceState): Promise<void>;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
declare const R2_PROMPT = "{prefix}\n Remote Cloudflare R2 bucket.\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat.\n cat on .parquet/.orc/.feather returns a formatted table.";
|
|
552
|
+
|
|
553
|
+
interface SupabaseConfig {
|
|
554
|
+
bucket: string;
|
|
555
|
+
region: string;
|
|
556
|
+
accessKeyId: string;
|
|
557
|
+
secretAccessKey: string;
|
|
558
|
+
projectRef?: string;
|
|
559
|
+
endpoint?: string;
|
|
560
|
+
sessionToken?: string;
|
|
561
|
+
timeoutMs?: number;
|
|
562
|
+
}
|
|
563
|
+
interface SupabaseConfigRedacted {
|
|
564
|
+
bucket: string;
|
|
565
|
+
region: string;
|
|
566
|
+
projectRef?: string;
|
|
567
|
+
endpoint: string;
|
|
568
|
+
accessKeyId: string;
|
|
569
|
+
secretAccessKey: string;
|
|
570
|
+
sessionToken?: string;
|
|
571
|
+
timeoutMs?: number;
|
|
572
|
+
}
|
|
573
|
+
declare function resolvedSupabaseEndpoint(config: SupabaseConfig): string;
|
|
574
|
+
declare function redactSupabaseConfig(config: SupabaseConfig): SupabaseConfigRedacted;
|
|
575
|
+
|
|
576
|
+
interface SupabaseResourceState {
|
|
577
|
+
type: string;
|
|
578
|
+
needsOverride: boolean;
|
|
579
|
+
redactedFields: readonly string[];
|
|
580
|
+
config: SupabaseConfigRedacted;
|
|
581
|
+
}
|
|
582
|
+
declare class SupabaseResource extends S3Resource {
|
|
583
|
+
readonly kind: string;
|
|
584
|
+
readonly prompt: string;
|
|
585
|
+
readonly supabaseConfig: SupabaseConfig;
|
|
586
|
+
private readonly supabaseOps;
|
|
587
|
+
private readonly supabaseCommands;
|
|
588
|
+
constructor(config: SupabaseConfig);
|
|
589
|
+
ops(): readonly RegisteredOp[];
|
|
590
|
+
commands(): readonly RegisteredCommand[];
|
|
591
|
+
getState(): Promise<SupabaseResourceState>;
|
|
592
|
+
loadState(_state: SupabaseResourceState): Promise<void>;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
declare const SUPABASE_PROMPT = "{prefix}\n Remote Supabase Storage bucket.\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, wc, find, stat.";
|
|
596
|
+
|
|
597
|
+
interface PgPoolLike {
|
|
598
|
+
query: (sql: string, params?: readonly unknown[]) => Promise<{
|
|
599
|
+
rows: unknown[];
|
|
600
|
+
rowCount: number | null;
|
|
601
|
+
}>;
|
|
602
|
+
end: () => Promise<void>;
|
|
603
|
+
}
|
|
604
|
+
declare class PostgresStore implements PgDriver {
|
|
605
|
+
readonly config: PostgresConfigResolved;
|
|
606
|
+
private poolPromise;
|
|
607
|
+
constructor(config: PostgresConfigResolved);
|
|
608
|
+
query<R = Record<string, unknown>>(sql: string, params?: readonly unknown[]): Promise<PgQueryResult<R>>;
|
|
609
|
+
databaseName(): Promise<string>;
|
|
610
|
+
close(): Promise<void>;
|
|
611
|
+
private _pool;
|
|
612
|
+
protected _connect(): Promise<PgPoolLike>;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
interface PostgresResourceOptions {
|
|
616
|
+
config: PostgresConfig;
|
|
617
|
+
prefix?: string;
|
|
618
|
+
}
|
|
619
|
+
declare class PostgresResource implements Resource {
|
|
620
|
+
readonly kind: string;
|
|
621
|
+
readonly isRemote: boolean;
|
|
622
|
+
readonly indexTtl: number;
|
|
623
|
+
readonly prompt: string;
|
|
624
|
+
readonly config: PostgresConfigResolved;
|
|
625
|
+
readonly store: PostgresStore;
|
|
626
|
+
readonly accessor: PostgresAccessor;
|
|
627
|
+
readonly index: IndexCacheStore;
|
|
628
|
+
constructor(options: PostgresResourceOptions | PostgresConfig);
|
|
629
|
+
open(): Promise<void>;
|
|
630
|
+
close(): Promise<void>;
|
|
631
|
+
ops(): readonly RegisteredOp[];
|
|
632
|
+
commands(): readonly RegisteredCommand[];
|
|
633
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
634
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
635
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
636
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
interface MongoCollectionLike {
|
|
640
|
+
find: (filter: Record<string, unknown>, options?: {
|
|
641
|
+
projection?: Record<string, unknown>;
|
|
642
|
+
}) => {
|
|
643
|
+
sort: (sort: Record<string, 1 | -1>) => MongoCursorLike;
|
|
644
|
+
skip: (n: number) => MongoCursorLike;
|
|
645
|
+
limit: (n: number) => MongoCursorLike;
|
|
646
|
+
toArray: () => Promise<Record<string, unknown>[]>;
|
|
647
|
+
};
|
|
648
|
+
countDocuments: (filter?: Record<string, unknown>) => Promise<number>;
|
|
649
|
+
listIndexes: () => {
|
|
650
|
+
toArray: () => Promise<Record<string, unknown>[]>;
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
interface MongoCursorLike {
|
|
654
|
+
sort: (sort: Record<string, 1 | -1>) => MongoCursorLike;
|
|
655
|
+
skip: (n: number) => MongoCursorLike;
|
|
656
|
+
limit: (n: number) => MongoCursorLike;
|
|
657
|
+
toArray: () => Promise<Record<string, unknown>[]>;
|
|
658
|
+
}
|
|
659
|
+
interface MongoDbLike {
|
|
660
|
+
listCollections: () => {
|
|
661
|
+
toArray: () => Promise<{
|
|
662
|
+
name: string;
|
|
663
|
+
}[]>;
|
|
664
|
+
};
|
|
665
|
+
collection: (name: string) => MongoCollectionLike;
|
|
666
|
+
admin: () => {
|
|
667
|
+
listDatabases: () => Promise<{
|
|
668
|
+
databases: {
|
|
669
|
+
name: string;
|
|
670
|
+
}[];
|
|
671
|
+
}>;
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
interface MongoClientLike {
|
|
675
|
+
connect: () => Promise<MongoClientLike>;
|
|
676
|
+
db: (name?: string) => MongoDbLike;
|
|
677
|
+
close: () => Promise<void>;
|
|
678
|
+
}
|
|
679
|
+
declare class MongoDBStore implements MongoDriver {
|
|
680
|
+
readonly uri: string;
|
|
681
|
+
private clientPromise;
|
|
682
|
+
constructor(uri: string);
|
|
683
|
+
listDatabases(): Promise<string[]>;
|
|
684
|
+
listCollections(database: string): Promise<string[]>;
|
|
685
|
+
findDocuments<T = Record<string, unknown>>(database: string, collection: string, filter?: Record<string, unknown>, options?: MongoFindOptions): Promise<T[]>;
|
|
686
|
+
countDocuments(database: string, collection: string, filter?: Record<string, unknown>): Promise<number>;
|
|
687
|
+
listIndexes(database: string, collection: string): Promise<Record<string, unknown>[]>;
|
|
688
|
+
close(): Promise<void>;
|
|
689
|
+
private _client;
|
|
690
|
+
protected _connect(): Promise<MongoClientLike>;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
interface MongoDBResourceOptions {
|
|
694
|
+
config: MongoDBConfig;
|
|
695
|
+
prefix?: string;
|
|
696
|
+
}
|
|
697
|
+
declare class MongoDBResource implements Resource {
|
|
698
|
+
readonly kind: string;
|
|
699
|
+
readonly isRemote: boolean;
|
|
700
|
+
readonly indexTtl: number;
|
|
701
|
+
readonly prompt: string;
|
|
702
|
+
readonly config: MongoDBConfigResolved;
|
|
703
|
+
readonly store: MongoDBStore;
|
|
704
|
+
readonly accessor: MongoDBAccessor;
|
|
705
|
+
readonly index: IndexCacheStore;
|
|
706
|
+
constructor(options: MongoDBResourceOptions | MongoDBConfig);
|
|
707
|
+
open(): Promise<void>;
|
|
708
|
+
close(): Promise<void>;
|
|
709
|
+
ops(): readonly RegisteredOp[];
|
|
710
|
+
commands(): readonly RegisteredCommand[];
|
|
711
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
712
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
713
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
714
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
interface SSCholarPaperResourceOptions {
|
|
718
|
+
config?: SSCholarConfig;
|
|
719
|
+
prefix?: string;
|
|
720
|
+
driver?: SSCholarDriver;
|
|
721
|
+
}
|
|
722
|
+
declare class SSCholarPaperResource implements Resource {
|
|
723
|
+
readonly kind: string;
|
|
724
|
+
readonly isRemote: boolean;
|
|
725
|
+
readonly indexTtl: number;
|
|
726
|
+
readonly prompt: string;
|
|
727
|
+
readonly config: SSCholarConfigResolved;
|
|
728
|
+
readonly driver: SSCholarDriver;
|
|
729
|
+
readonly accessor: SSCholarAccessor;
|
|
730
|
+
readonly index: IndexCacheStore;
|
|
731
|
+
constructor(options?: SSCholarPaperResourceOptions | SSCholarConfig);
|
|
732
|
+
open(): Promise<void>;
|
|
733
|
+
close(): Promise<void>;
|
|
734
|
+
ops(): readonly RegisteredOp[];
|
|
735
|
+
commands(): readonly RegisteredCommand[];
|
|
736
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
737
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
738
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
739
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
interface SSCholarAuthorResourceOptions {
|
|
743
|
+
config?: SSCholarConfig;
|
|
744
|
+
prefix?: string;
|
|
745
|
+
driver?: SSCholarDriver;
|
|
746
|
+
}
|
|
747
|
+
declare class SSCholarAuthorResource implements Resource {
|
|
748
|
+
readonly kind: string;
|
|
749
|
+
readonly isRemote: boolean;
|
|
750
|
+
readonly indexTtl: number;
|
|
751
|
+
readonly prompt: string;
|
|
752
|
+
readonly config: SSCholarConfigResolved;
|
|
753
|
+
readonly driver: SSCholarDriver;
|
|
754
|
+
readonly accessor: SSCholarAccessor;
|
|
755
|
+
readonly index: IndexCacheStore;
|
|
756
|
+
constructor(options?: SSCholarAuthorResourceOptions | SSCholarConfig);
|
|
757
|
+
open(): Promise<void>;
|
|
758
|
+
close(): Promise<void>;
|
|
759
|
+
ops(): readonly RegisteredOp[];
|
|
760
|
+
commands(): readonly RegisteredCommand[];
|
|
761
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
762
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
763
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
764
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
interface VercelResourceOptions {
|
|
768
|
+
config?: VercelConfig;
|
|
769
|
+
prefix?: string;
|
|
770
|
+
driver?: VercelDriver;
|
|
771
|
+
}
|
|
772
|
+
declare class VercelResource implements Resource {
|
|
773
|
+
readonly kind: string;
|
|
774
|
+
readonly isRemote: boolean;
|
|
775
|
+
readonly indexTtl: number;
|
|
776
|
+
readonly prompt: string;
|
|
777
|
+
readonly config: VercelConfigResolved;
|
|
778
|
+
readonly driver: VercelDriver;
|
|
779
|
+
readonly accessor: VercelAccessor;
|
|
780
|
+
readonly index: IndexCacheStore;
|
|
781
|
+
constructor(options?: VercelResourceOptions | VercelConfig);
|
|
782
|
+
open(): Promise<void>;
|
|
783
|
+
close(): Promise<void>;
|
|
784
|
+
ops(): readonly RegisteredOp[];
|
|
785
|
+
commands(): readonly RegisteredCommand[];
|
|
786
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
787
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
788
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
789
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
interface PostHogResourceOptions {
|
|
793
|
+
config?: PostHogConfig;
|
|
794
|
+
prefix?: string;
|
|
795
|
+
driver?: PostHogDriver;
|
|
796
|
+
}
|
|
797
|
+
declare class PostHogResource implements Resource {
|
|
798
|
+
readonly kind: string;
|
|
799
|
+
readonly isRemote: boolean;
|
|
800
|
+
readonly indexTtl: number;
|
|
801
|
+
readonly prompt: string;
|
|
802
|
+
readonly config: PostHogConfigResolved;
|
|
803
|
+
readonly driver: PostHogDriver;
|
|
804
|
+
readonly accessor: PostHogAccessor;
|
|
805
|
+
readonly index: IndexCacheStore;
|
|
806
|
+
constructor(options?: PostHogResourceOptions | PostHogConfig);
|
|
807
|
+
open(): Promise<void>;
|
|
808
|
+
close(): Promise<void>;
|
|
809
|
+
ops(): readonly RegisteredOp[];
|
|
810
|
+
commands(): readonly RegisteredCommand[];
|
|
811
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
812
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
813
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
814
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
interface SlackConfig {
|
|
818
|
+
token: string;
|
|
819
|
+
searchToken?: string;
|
|
820
|
+
}
|
|
821
|
+
interface SlackConfigRedacted {
|
|
822
|
+
token: '<REDACTED>';
|
|
823
|
+
searchToken?: '<REDACTED>';
|
|
824
|
+
}
|
|
825
|
+
declare function redactSlackConfig(config: SlackConfig): SlackConfigRedacted;
|
|
826
|
+
declare function normalizeSlackConfig(input: Record<string, unknown>): SlackConfig;
|
|
827
|
+
|
|
828
|
+
interface SlackResourceState {
|
|
829
|
+
type: string;
|
|
830
|
+
needsOverride: boolean;
|
|
831
|
+
redactedFields: readonly string[];
|
|
832
|
+
config: SlackConfigRedacted;
|
|
833
|
+
}
|
|
834
|
+
declare class SlackResource implements Resource {
|
|
835
|
+
readonly kind: string;
|
|
836
|
+
readonly isRemote: boolean;
|
|
837
|
+
readonly indexTtl: number;
|
|
838
|
+
readonly prompt: string;
|
|
839
|
+
readonly writePrompt: string;
|
|
840
|
+
readonly config: SlackConfig;
|
|
841
|
+
readonly accessor: SlackAccessor;
|
|
842
|
+
readonly index: IndexCacheStore;
|
|
843
|
+
constructor(config: SlackConfig);
|
|
844
|
+
open(): Promise<void>;
|
|
845
|
+
close(): Promise<void>;
|
|
846
|
+
commands(): readonly RegisteredCommand[];
|
|
847
|
+
ops(): readonly RegisteredOp[];
|
|
848
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
849
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
850
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
851
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
852
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
853
|
+
getState(): Promise<SlackResourceState>;
|
|
854
|
+
loadState(_state: SlackResourceState): Promise<void>;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
interface SSHConfig {
|
|
858
|
+
host: string;
|
|
859
|
+
hostname?: string;
|
|
860
|
+
port?: number;
|
|
861
|
+
username?: string;
|
|
862
|
+
password?: string;
|
|
863
|
+
identityFile?: string;
|
|
864
|
+
passphrase?: string;
|
|
865
|
+
root?: string;
|
|
866
|
+
timeout?: number;
|
|
867
|
+
knownHosts?: string;
|
|
868
|
+
}
|
|
869
|
+
interface SSHConfigRedacted {
|
|
870
|
+
host: string;
|
|
871
|
+
hostname?: string;
|
|
872
|
+
port?: number;
|
|
873
|
+
username?: string;
|
|
874
|
+
password?: '<REDACTED>';
|
|
875
|
+
identityFile?: string;
|
|
876
|
+
passphrase?: '<REDACTED>';
|
|
877
|
+
root?: string;
|
|
878
|
+
timeout?: number;
|
|
879
|
+
knownHosts?: string;
|
|
880
|
+
}
|
|
881
|
+
declare function redactSshConfig(config: SSHConfig): SSHConfigRedacted;
|
|
882
|
+
declare function normalizeSshConfig(input: Record<string, unknown>): SSHConfig;
|
|
883
|
+
|
|
884
|
+
declare class SSHAccessor extends Accessor {
|
|
885
|
+
readonly config: SSHConfig;
|
|
886
|
+
private client;
|
|
887
|
+
private sftpClient;
|
|
888
|
+
private connectPromise;
|
|
889
|
+
constructor(config: SSHConfig);
|
|
890
|
+
sftp(): Promise<SFTPWrapper>;
|
|
891
|
+
private connect;
|
|
892
|
+
close(): Promise<void>;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
interface SSHResourceState {
|
|
896
|
+
type: string;
|
|
897
|
+
needsOverride: boolean;
|
|
898
|
+
redactedFields: readonly string[];
|
|
899
|
+
config: SSHConfigRedacted;
|
|
900
|
+
}
|
|
901
|
+
declare class SSHResource implements Resource {
|
|
902
|
+
readonly kind: "ssh";
|
|
903
|
+
readonly isRemote: boolean;
|
|
904
|
+
readonly indexTtl: number;
|
|
905
|
+
readonly prompt = "{prefix}\n Remote filesystem via SSH/SFTP.\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, rg, wc, find, tree, stat, mkdir, touch, cp, mv, rm, tee.";
|
|
906
|
+
readonly config: SSHConfig;
|
|
907
|
+
readonly accessor: SSHAccessor;
|
|
908
|
+
readonly index: IndexCacheStore;
|
|
909
|
+
readonly opsMap: Record<string, unknown>;
|
|
910
|
+
constructor(config: SSHConfig);
|
|
911
|
+
open(): Promise<void>;
|
|
912
|
+
close(): Promise<void>;
|
|
913
|
+
ops(): readonly RegisteredOp[];
|
|
914
|
+
commands(): readonly RegisteredCommand[];
|
|
915
|
+
streamPath(p: PathSpec): AsyncIterable<Uint8Array>;
|
|
916
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
917
|
+
writeFile(p: PathSpec, data: Uint8Array): Promise<void>;
|
|
918
|
+
appendFile(p: PathSpec, data: Uint8Array): Promise<void>;
|
|
919
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
920
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
921
|
+
exists(p: PathSpec): Promise<boolean>;
|
|
922
|
+
mkdir(p: PathSpec, options?: {
|
|
923
|
+
recursive?: boolean;
|
|
924
|
+
}): Promise<void>;
|
|
925
|
+
rmdir(p: PathSpec): Promise<void>;
|
|
926
|
+
unlink(p: PathSpec): Promise<void>;
|
|
927
|
+
rename(src: PathSpec, dst: PathSpec): Promise<void>;
|
|
928
|
+
truncate(p: PathSpec, length: number): Promise<void>;
|
|
929
|
+
copy(src: PathSpec, dst: PathSpec): Promise<void>;
|
|
930
|
+
rmR(p: PathSpec): Promise<void>;
|
|
931
|
+
du(p: PathSpec): Promise<number>;
|
|
932
|
+
find(p: PathSpec, options?: FindOptions): Promise<string[]>;
|
|
933
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
934
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
935
|
+
getState(): Promise<SSHResourceState>;
|
|
936
|
+
loadState(_state: SSHResourceState): Promise<void>;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
declare const SSH_PROMPT = "{prefix}\n Remote filesystem via SSH/SFTP.\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, rg, wc, find, tree, stat, mkdir, touch, cp, mv, rm, tee.";
|
|
940
|
+
|
|
941
|
+
declare const SSH_COMMANDS: readonly RegisteredCommand[];
|
|
942
|
+
|
|
943
|
+
declare const SSH_OPS: readonly RegisteredOp[];
|
|
944
|
+
|
|
945
|
+
interface DiscordConfig {
|
|
946
|
+
token: string;
|
|
947
|
+
}
|
|
948
|
+
interface DiscordConfigRedacted {
|
|
949
|
+
token: '<REDACTED>';
|
|
950
|
+
}
|
|
951
|
+
declare function redactDiscordConfig(_config: DiscordConfig): DiscordConfigRedacted;
|
|
952
|
+
declare function normalizeDiscordConfig(input: Record<string, unknown>): DiscordConfig;
|
|
953
|
+
|
|
954
|
+
interface DiscordResourceState {
|
|
955
|
+
type: string;
|
|
956
|
+
needsOverride: boolean;
|
|
957
|
+
redactedFields: readonly string[];
|
|
958
|
+
config: DiscordConfigRedacted;
|
|
959
|
+
}
|
|
960
|
+
declare class DiscordResource implements Resource {
|
|
961
|
+
readonly kind: string;
|
|
962
|
+
readonly isRemote: boolean;
|
|
963
|
+
readonly indexTtl: number;
|
|
964
|
+
readonly prompt: string;
|
|
965
|
+
readonly writePrompt: string;
|
|
966
|
+
readonly config: DiscordConfig;
|
|
967
|
+
readonly accessor: DiscordAccessor;
|
|
968
|
+
readonly index: IndexCacheStore;
|
|
969
|
+
constructor(config: DiscordConfig);
|
|
970
|
+
open(): Promise<void>;
|
|
971
|
+
close(): Promise<void>;
|
|
972
|
+
commands(): readonly RegisteredCommand[];
|
|
973
|
+
ops(): readonly RegisteredOp[];
|
|
974
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
975
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
976
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
977
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
978
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
979
|
+
getState(): Promise<DiscordResourceState>;
|
|
980
|
+
loadState(_state: DiscordResourceState): Promise<void>;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
interface TrelloConfig {
|
|
984
|
+
apiKey: string;
|
|
985
|
+
apiToken: string;
|
|
986
|
+
workspaceId?: string;
|
|
987
|
+
boardIds?: readonly string[];
|
|
988
|
+
baseUrl?: string;
|
|
989
|
+
}
|
|
990
|
+
interface TrelloConfigRedacted {
|
|
991
|
+
apiKey: '<REDACTED>';
|
|
992
|
+
apiToken: '<REDACTED>';
|
|
993
|
+
workspaceId?: string;
|
|
994
|
+
boardIds?: readonly string[];
|
|
995
|
+
baseUrl?: string;
|
|
996
|
+
}
|
|
997
|
+
declare function redactTrelloConfig(config: TrelloConfig): TrelloConfigRedacted;
|
|
998
|
+
declare function normalizeTrelloConfig(input: Record<string, unknown>): TrelloConfig;
|
|
999
|
+
|
|
1000
|
+
interface TrelloResourceState {
|
|
1001
|
+
type: string;
|
|
1002
|
+
needsOverride: boolean;
|
|
1003
|
+
redactedFields: readonly string[];
|
|
1004
|
+
config: TrelloConfigRedacted;
|
|
1005
|
+
}
|
|
1006
|
+
declare class TrelloResource implements Resource {
|
|
1007
|
+
readonly kind: string;
|
|
1008
|
+
readonly isRemote: boolean;
|
|
1009
|
+
readonly indexTtl: number;
|
|
1010
|
+
readonly prompt: string;
|
|
1011
|
+
readonly writePrompt: string;
|
|
1012
|
+
readonly config: TrelloConfig;
|
|
1013
|
+
readonly accessor: TrelloAccessor;
|
|
1014
|
+
readonly index: IndexCacheStore;
|
|
1015
|
+
constructor(config: TrelloConfig);
|
|
1016
|
+
open(): Promise<void>;
|
|
1017
|
+
close(): Promise<void>;
|
|
1018
|
+
commands(): readonly RegisteredCommand[];
|
|
1019
|
+
ops(): readonly RegisteredOp[];
|
|
1020
|
+
private filter;
|
|
1021
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1022
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1023
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1024
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1025
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1026
|
+
getState(): Promise<TrelloResourceState>;
|
|
1027
|
+
loadState(_state: TrelloResourceState): Promise<void>;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
interface LinearConfig {
|
|
1031
|
+
apiKey: string;
|
|
1032
|
+
workspace?: string;
|
|
1033
|
+
teamIds?: readonly string[];
|
|
1034
|
+
baseUrl?: string;
|
|
1035
|
+
}
|
|
1036
|
+
interface LinearConfigRedacted {
|
|
1037
|
+
apiKey: '<REDACTED>';
|
|
1038
|
+
workspace?: string;
|
|
1039
|
+
teamIds?: readonly string[];
|
|
1040
|
+
baseUrl?: string;
|
|
1041
|
+
}
|
|
1042
|
+
declare function redactLinearConfig(config: LinearConfig): LinearConfigRedacted;
|
|
1043
|
+
declare function normalizeLinearConfig(input: Record<string, unknown>): LinearConfig;
|
|
1044
|
+
|
|
1045
|
+
interface LinearResourceState {
|
|
1046
|
+
type: string;
|
|
1047
|
+
needsOverride: boolean;
|
|
1048
|
+
redactedFields: readonly string[];
|
|
1049
|
+
config: LinearConfigRedacted;
|
|
1050
|
+
}
|
|
1051
|
+
declare class LinearResource implements Resource {
|
|
1052
|
+
readonly kind: string;
|
|
1053
|
+
readonly isRemote: boolean;
|
|
1054
|
+
readonly indexTtl: number;
|
|
1055
|
+
readonly prompt: string;
|
|
1056
|
+
readonly writePrompt: string;
|
|
1057
|
+
readonly config: LinearConfig;
|
|
1058
|
+
readonly accessor: LinearAccessor;
|
|
1059
|
+
readonly index: IndexCacheStore;
|
|
1060
|
+
constructor(config: LinearConfig);
|
|
1061
|
+
open(): Promise<void>;
|
|
1062
|
+
close(): Promise<void>;
|
|
1063
|
+
commands(): readonly RegisteredCommand[];
|
|
1064
|
+
ops(): readonly RegisteredOp[];
|
|
1065
|
+
private filter;
|
|
1066
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1067
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1068
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1069
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1070
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1071
|
+
getState(): Promise<LinearResourceState>;
|
|
1072
|
+
loadState(_state: LinearResourceState): Promise<void>;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
interface LangfuseConfig {
|
|
1076
|
+
publicKey: string;
|
|
1077
|
+
secretKey: string;
|
|
1078
|
+
host?: string;
|
|
1079
|
+
defaultTraceLimit?: number;
|
|
1080
|
+
defaultSearchLimit?: number;
|
|
1081
|
+
defaultFromTimestamp?: string;
|
|
1082
|
+
}
|
|
1083
|
+
interface LangfuseConfigRedacted {
|
|
1084
|
+
publicKey: string;
|
|
1085
|
+
secretKey: '<REDACTED>';
|
|
1086
|
+
host?: string;
|
|
1087
|
+
defaultTraceLimit?: number;
|
|
1088
|
+
defaultSearchLimit?: number;
|
|
1089
|
+
defaultFromTimestamp?: string;
|
|
1090
|
+
}
|
|
1091
|
+
declare function redactLangfuseConfig(config: LangfuseConfig): LangfuseConfigRedacted;
|
|
1092
|
+
declare function normalizeLangfuseConfig(input: Record<string, unknown>): LangfuseConfig;
|
|
1093
|
+
|
|
1094
|
+
interface LangfuseResourceState {
|
|
1095
|
+
type: string;
|
|
1096
|
+
needsOverride: boolean;
|
|
1097
|
+
redactedFields: readonly string[];
|
|
1098
|
+
config: LangfuseConfigRedacted;
|
|
1099
|
+
}
|
|
1100
|
+
declare class LangfuseResource implements Resource {
|
|
1101
|
+
readonly kind: string;
|
|
1102
|
+
readonly isRemote: boolean;
|
|
1103
|
+
readonly indexTtl: number;
|
|
1104
|
+
readonly prompt: string;
|
|
1105
|
+
readonly config: LangfuseConfig;
|
|
1106
|
+
readonly accessor: LangfuseAccessor;
|
|
1107
|
+
readonly index: IndexCacheStore;
|
|
1108
|
+
constructor(config: LangfuseConfig);
|
|
1109
|
+
open(): Promise<void>;
|
|
1110
|
+
close(): Promise<void>;
|
|
1111
|
+
commands(): readonly RegisteredCommand[];
|
|
1112
|
+
ops(): readonly RegisteredOp[];
|
|
1113
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1114
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1115
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1116
|
+
fingerprint(_p: PathSpec): Promise<string | null>;
|
|
1117
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1118
|
+
getState(): Promise<LangfuseResourceState>;
|
|
1119
|
+
loadState(_state: LangfuseResourceState): Promise<void>;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
interface GitHubConfig {
|
|
1123
|
+
token: string;
|
|
1124
|
+
owner: string;
|
|
1125
|
+
repo: string;
|
|
1126
|
+
ref?: string;
|
|
1127
|
+
baseUrl?: string;
|
|
1128
|
+
}
|
|
1129
|
+
interface GitHubConfigRedacted {
|
|
1130
|
+
token: '<REDACTED>';
|
|
1131
|
+
owner: string;
|
|
1132
|
+
repo: string;
|
|
1133
|
+
ref?: string;
|
|
1134
|
+
baseUrl?: string;
|
|
1135
|
+
}
|
|
1136
|
+
declare function redactGitHubConfig(config: GitHubConfig): GitHubConfigRedacted;
|
|
1137
|
+
declare function normalizeGitHubConfig(input: Record<string, unknown>): GitHubConfig;
|
|
1138
|
+
|
|
1139
|
+
interface GitHubResourceState {
|
|
1140
|
+
type: string;
|
|
1141
|
+
needsOverride: boolean;
|
|
1142
|
+
redactedFields: readonly string[];
|
|
1143
|
+
config: GitHubConfigRedacted;
|
|
1144
|
+
defaultBranch: string;
|
|
1145
|
+
truncated: boolean;
|
|
1146
|
+
}
|
|
1147
|
+
declare class GitHubResource implements Resource {
|
|
1148
|
+
readonly kind: string;
|
|
1149
|
+
readonly isRemote: boolean;
|
|
1150
|
+
readonly indexTtl: number;
|
|
1151
|
+
readonly config: GitHubConfig;
|
|
1152
|
+
readonly accessor: GitHubAccessor;
|
|
1153
|
+
readonly index: IndexCacheStore;
|
|
1154
|
+
private constructor();
|
|
1155
|
+
static create(config: GitHubConfig): Promise<GitHubResource>;
|
|
1156
|
+
open(): Promise<void>;
|
|
1157
|
+
close(): Promise<void>;
|
|
1158
|
+
commands(): readonly RegisteredCommand[];
|
|
1159
|
+
ops(): readonly RegisteredOp[];
|
|
1160
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1161
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1162
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1163
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1164
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1165
|
+
getState(): Promise<GitHubResourceState>;
|
|
1166
|
+
loadState(_state: GitHubResourceState): Promise<void>;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
interface GitHubCIConfig {
|
|
1170
|
+
token: string;
|
|
1171
|
+
owner: string;
|
|
1172
|
+
repo: string;
|
|
1173
|
+
days?: number;
|
|
1174
|
+
maxRuns?: number;
|
|
1175
|
+
baseUrl?: string;
|
|
1176
|
+
}
|
|
1177
|
+
interface GitHubCIConfigRedacted {
|
|
1178
|
+
token: '<REDACTED>';
|
|
1179
|
+
owner: string;
|
|
1180
|
+
repo: string;
|
|
1181
|
+
days?: number;
|
|
1182
|
+
maxRuns?: number;
|
|
1183
|
+
baseUrl?: string;
|
|
1184
|
+
}
|
|
1185
|
+
declare function redactGitHubCIConfig(config: GitHubCIConfig): GitHubCIConfigRedacted;
|
|
1186
|
+
declare function normalizeGitHubCIConfig(input: Record<string, unknown>): GitHubCIConfig;
|
|
1187
|
+
|
|
1188
|
+
interface GitHubCIResourceState {
|
|
1189
|
+
type: string;
|
|
1190
|
+
needsOverride: boolean;
|
|
1191
|
+
redactedFields: readonly string[];
|
|
1192
|
+
config: GitHubCIConfigRedacted;
|
|
1193
|
+
}
|
|
1194
|
+
declare class GitHubCIResource implements Resource {
|
|
1195
|
+
readonly kind: string;
|
|
1196
|
+
readonly isRemote: boolean;
|
|
1197
|
+
readonly indexTtl: number;
|
|
1198
|
+
readonly prompt: string;
|
|
1199
|
+
readonly config: GitHubCIConfig;
|
|
1200
|
+
readonly accessor: GitHubCIAccessor;
|
|
1201
|
+
readonly index: IndexCacheStore;
|
|
1202
|
+
constructor(config: GitHubCIConfig);
|
|
1203
|
+
open(): Promise<void>;
|
|
1204
|
+
close(): Promise<void>;
|
|
1205
|
+
commands(): readonly RegisteredCommand[];
|
|
1206
|
+
ops(): readonly RegisteredOp[];
|
|
1207
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1208
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1209
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1210
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1211
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1212
|
+
getState(): Promise<GitHubCIResourceState>;
|
|
1213
|
+
loadState(_state: GitHubCIResourceState): Promise<void>;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
interface GDocsConfig {
|
|
1217
|
+
clientId: string;
|
|
1218
|
+
clientSecret: string;
|
|
1219
|
+
refreshToken: string;
|
|
1220
|
+
refreshFn?: (refreshToken: string) => Promise<{
|
|
1221
|
+
accessToken: string;
|
|
1222
|
+
expiresIn: number;
|
|
1223
|
+
}>;
|
|
1224
|
+
}
|
|
1225
|
+
interface GDocsConfigRedacted {
|
|
1226
|
+
clientId: string;
|
|
1227
|
+
clientSecret: '<REDACTED>';
|
|
1228
|
+
refreshToken: '<REDACTED>';
|
|
1229
|
+
}
|
|
1230
|
+
declare function redactGDocsConfig(config: GDocsConfig): GDocsConfigRedacted;
|
|
1231
|
+
declare function normalizeGDocsConfig(input: Record<string, unknown>): GDocsConfig;
|
|
1232
|
+
|
|
1233
|
+
interface GDocsResourceState {
|
|
1234
|
+
type: string;
|
|
1235
|
+
needsOverride: boolean;
|
|
1236
|
+
redactedFields: readonly string[];
|
|
1237
|
+
config: GDocsConfigRedacted;
|
|
1238
|
+
}
|
|
1239
|
+
declare class GDocsResource implements Resource {
|
|
1240
|
+
readonly kind: string;
|
|
1241
|
+
readonly isRemote: boolean;
|
|
1242
|
+
readonly indexTtl: number;
|
|
1243
|
+
readonly prompt: string;
|
|
1244
|
+
readonly writePrompt: string;
|
|
1245
|
+
readonly config: GDocsConfig;
|
|
1246
|
+
readonly accessor: GDocsAccessor;
|
|
1247
|
+
readonly index: IndexCacheStore;
|
|
1248
|
+
constructor(config: GDocsConfig);
|
|
1249
|
+
open(): Promise<void>;
|
|
1250
|
+
close(): Promise<void>;
|
|
1251
|
+
commands(): readonly RegisteredCommand[];
|
|
1252
|
+
ops(): readonly RegisteredOp[];
|
|
1253
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1254
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1255
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1256
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1257
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1258
|
+
getState(): Promise<GDocsResourceState>;
|
|
1259
|
+
loadState(_state: GDocsResourceState): Promise<void>;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
interface GSheetsConfig {
|
|
1263
|
+
clientId: string;
|
|
1264
|
+
clientSecret: string;
|
|
1265
|
+
refreshToken: string;
|
|
1266
|
+
refreshFn?: (refreshToken: string) => Promise<{
|
|
1267
|
+
accessToken: string;
|
|
1268
|
+
expiresIn: number;
|
|
1269
|
+
}>;
|
|
1270
|
+
}
|
|
1271
|
+
interface GSheetsConfigRedacted {
|
|
1272
|
+
clientId: string;
|
|
1273
|
+
clientSecret: '<REDACTED>';
|
|
1274
|
+
refreshToken: '<REDACTED>';
|
|
1275
|
+
}
|
|
1276
|
+
declare function redactGSheetsConfig(config: GSheetsConfig): GSheetsConfigRedacted;
|
|
1277
|
+
declare function normalizeGSheetsConfig(input: Record<string, unknown>): GSheetsConfig;
|
|
1278
|
+
|
|
1279
|
+
interface GSheetsResourceState {
|
|
1280
|
+
type: string;
|
|
1281
|
+
needsOverride: boolean;
|
|
1282
|
+
redactedFields: readonly string[];
|
|
1283
|
+
config: GSheetsConfigRedacted;
|
|
1284
|
+
}
|
|
1285
|
+
declare class GSheetsResource implements Resource {
|
|
1286
|
+
readonly kind: string;
|
|
1287
|
+
readonly isRemote: boolean;
|
|
1288
|
+
readonly indexTtl: number;
|
|
1289
|
+
readonly prompt: string;
|
|
1290
|
+
readonly writePrompt: string;
|
|
1291
|
+
readonly config: GSheetsConfig;
|
|
1292
|
+
readonly accessor: GSheetsAccessor;
|
|
1293
|
+
readonly index: IndexCacheStore;
|
|
1294
|
+
constructor(config: GSheetsConfig);
|
|
1295
|
+
open(): Promise<void>;
|
|
1296
|
+
close(): Promise<void>;
|
|
1297
|
+
commands(): readonly RegisteredCommand[];
|
|
1298
|
+
ops(): readonly RegisteredOp[];
|
|
1299
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1300
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1301
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1302
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1303
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1304
|
+
getState(): Promise<GSheetsResourceState>;
|
|
1305
|
+
loadState(_state: GSheetsResourceState): Promise<void>;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
interface GSlidesConfig {
|
|
1309
|
+
clientId: string;
|
|
1310
|
+
clientSecret: string;
|
|
1311
|
+
refreshToken: string;
|
|
1312
|
+
refreshFn?: (refreshToken: string) => Promise<{
|
|
1313
|
+
accessToken: string;
|
|
1314
|
+
expiresIn: number;
|
|
1315
|
+
}>;
|
|
1316
|
+
}
|
|
1317
|
+
interface GSlidesConfigRedacted {
|
|
1318
|
+
clientId: string;
|
|
1319
|
+
clientSecret: '<REDACTED>';
|
|
1320
|
+
refreshToken: '<REDACTED>';
|
|
1321
|
+
}
|
|
1322
|
+
declare function redactGSlidesConfig(config: GSlidesConfig): GSlidesConfigRedacted;
|
|
1323
|
+
declare function normalizeGSlidesConfig(input: Record<string, unknown>): GSlidesConfig;
|
|
1324
|
+
|
|
1325
|
+
interface GSlidesResourceState {
|
|
1326
|
+
type: string;
|
|
1327
|
+
needsOverride: boolean;
|
|
1328
|
+
redactedFields: readonly string[];
|
|
1329
|
+
config: GSlidesConfigRedacted;
|
|
1330
|
+
}
|
|
1331
|
+
declare class GSlidesResource implements Resource {
|
|
1332
|
+
readonly kind: string;
|
|
1333
|
+
readonly isRemote: boolean;
|
|
1334
|
+
readonly indexTtl: number;
|
|
1335
|
+
readonly prompt: string;
|
|
1336
|
+
readonly writePrompt: string;
|
|
1337
|
+
readonly config: GSlidesConfig;
|
|
1338
|
+
readonly accessor: GSlidesAccessor;
|
|
1339
|
+
readonly index: IndexCacheStore;
|
|
1340
|
+
constructor(config: GSlidesConfig);
|
|
1341
|
+
open(): Promise<void>;
|
|
1342
|
+
close(): Promise<void>;
|
|
1343
|
+
commands(): readonly RegisteredCommand[];
|
|
1344
|
+
ops(): readonly RegisteredOp[];
|
|
1345
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1346
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1347
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1348
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1349
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1350
|
+
getState(): Promise<GSlidesResourceState>;
|
|
1351
|
+
loadState(_state: GSlidesResourceState): Promise<void>;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
interface GDriveConfig {
|
|
1355
|
+
clientId: string;
|
|
1356
|
+
clientSecret: string;
|
|
1357
|
+
refreshToken: string;
|
|
1358
|
+
refreshFn?: (refreshToken: string) => Promise<{
|
|
1359
|
+
accessToken: string;
|
|
1360
|
+
expiresIn: number;
|
|
1361
|
+
}>;
|
|
1362
|
+
}
|
|
1363
|
+
interface GDriveConfigRedacted {
|
|
1364
|
+
clientId: string;
|
|
1365
|
+
clientSecret: '<REDACTED>';
|
|
1366
|
+
refreshToken: '<REDACTED>';
|
|
1367
|
+
}
|
|
1368
|
+
declare function redactGDriveConfig(config: GDriveConfig): GDriveConfigRedacted;
|
|
1369
|
+
declare function normalizeGDriveConfig(input: Record<string, unknown>): GDriveConfig;
|
|
1370
|
+
|
|
1371
|
+
interface GDriveResourceState {
|
|
1372
|
+
type: string;
|
|
1373
|
+
needsOverride: boolean;
|
|
1374
|
+
redactedFields: readonly string[];
|
|
1375
|
+
config: GDriveConfigRedacted;
|
|
1376
|
+
}
|
|
1377
|
+
declare class GDriveResource implements Resource {
|
|
1378
|
+
readonly kind: string;
|
|
1379
|
+
readonly isRemote: boolean;
|
|
1380
|
+
readonly indexTtl: number;
|
|
1381
|
+
readonly prompt: string;
|
|
1382
|
+
readonly config: GDriveConfig;
|
|
1383
|
+
readonly accessor: GDriveAccessor;
|
|
1384
|
+
readonly index: IndexCacheStore;
|
|
1385
|
+
constructor(config: GDriveConfig);
|
|
1386
|
+
open(): Promise<void>;
|
|
1387
|
+
close(): Promise<void>;
|
|
1388
|
+
commands(): readonly RegisteredCommand[];
|
|
1389
|
+
ops(): readonly RegisteredOp[];
|
|
1390
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1391
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1392
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1393
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1394
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1395
|
+
getState(): Promise<GDriveResourceState>;
|
|
1396
|
+
loadState(_state: GDriveResourceState): Promise<void>;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
interface DropboxConfig {
|
|
1400
|
+
clientId: string;
|
|
1401
|
+
clientSecret: string;
|
|
1402
|
+
refreshToken: string;
|
|
1403
|
+
refreshFn?: (refreshToken: string) => Promise<{
|
|
1404
|
+
accessToken: string;
|
|
1405
|
+
expiresIn: number;
|
|
1406
|
+
}>;
|
|
1407
|
+
}
|
|
1408
|
+
interface DropboxConfigRedacted {
|
|
1409
|
+
clientId: string;
|
|
1410
|
+
clientSecret: '<REDACTED>';
|
|
1411
|
+
refreshToken: '<REDACTED>';
|
|
1412
|
+
}
|
|
1413
|
+
declare function redactDropboxConfig(config: DropboxConfig): DropboxConfigRedacted;
|
|
1414
|
+
declare function normalizeDropboxConfig(input: Record<string, unknown>): DropboxConfig;
|
|
1415
|
+
|
|
1416
|
+
interface DropboxResourceState {
|
|
1417
|
+
type: string;
|
|
1418
|
+
needsOverride: boolean;
|
|
1419
|
+
redactedFields: readonly string[];
|
|
1420
|
+
config: DropboxConfigRedacted;
|
|
1421
|
+
}
|
|
1422
|
+
declare class DropboxResource implements Resource {
|
|
1423
|
+
readonly kind: string;
|
|
1424
|
+
readonly isRemote: boolean;
|
|
1425
|
+
readonly indexTtl: number;
|
|
1426
|
+
readonly prompt: string;
|
|
1427
|
+
readonly config: DropboxConfig;
|
|
1428
|
+
readonly accessor: DropboxAccessor;
|
|
1429
|
+
readonly index: IndexCacheStore;
|
|
1430
|
+
constructor(config: DropboxConfig);
|
|
1431
|
+
open(): Promise<void>;
|
|
1432
|
+
close(): Promise<void>;
|
|
1433
|
+
commands(): readonly RegisteredCommand[];
|
|
1434
|
+
ops(): readonly RegisteredOp[];
|
|
1435
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1436
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1437
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1438
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1439
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1440
|
+
getState(): Promise<DropboxResourceState>;
|
|
1441
|
+
loadState(_state: DropboxResourceState): Promise<void>;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
interface BoxConfig {
|
|
1445
|
+
clientId?: string;
|
|
1446
|
+
clientSecret?: string;
|
|
1447
|
+
refreshToken?: string;
|
|
1448
|
+
accessToken?: string;
|
|
1449
|
+
refreshFn?: (refreshToken: string) => Promise<{
|
|
1450
|
+
accessToken: string;
|
|
1451
|
+
refreshToken: string;
|
|
1452
|
+
expiresIn: number;
|
|
1453
|
+
}>;
|
|
1454
|
+
onRefreshTokenRotated?: (newRefreshToken: string) => void | Promise<void>;
|
|
1455
|
+
}
|
|
1456
|
+
interface BoxConfigRedacted {
|
|
1457
|
+
clientId?: string;
|
|
1458
|
+
clientSecret?: '<REDACTED>';
|
|
1459
|
+
refreshToken?: '<REDACTED>';
|
|
1460
|
+
accessToken?: '<REDACTED>';
|
|
1461
|
+
}
|
|
1462
|
+
declare function redactBoxConfig(config: BoxConfig): BoxConfigRedacted;
|
|
1463
|
+
declare function normalizeBoxConfig(input: Record<string, unknown>): BoxConfig;
|
|
1464
|
+
|
|
1465
|
+
interface BoxResourceState {
|
|
1466
|
+
type: string;
|
|
1467
|
+
needsOverride: boolean;
|
|
1468
|
+
redactedFields: readonly string[];
|
|
1469
|
+
config: BoxConfigRedacted;
|
|
1470
|
+
}
|
|
1471
|
+
declare class BoxResource implements Resource {
|
|
1472
|
+
readonly kind: string;
|
|
1473
|
+
readonly isRemote: boolean;
|
|
1474
|
+
readonly indexTtl: number;
|
|
1475
|
+
readonly prompt: string;
|
|
1476
|
+
readonly config: BoxConfig;
|
|
1477
|
+
readonly accessor: BoxAccessor;
|
|
1478
|
+
readonly index: IndexCacheStore;
|
|
1479
|
+
constructor(config: BoxConfig);
|
|
1480
|
+
open(): Promise<void>;
|
|
1481
|
+
close(): Promise<void>;
|
|
1482
|
+
commands(): readonly RegisteredCommand[];
|
|
1483
|
+
ops(): readonly RegisteredOp[];
|
|
1484
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1485
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1486
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1487
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1488
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1489
|
+
getState(): Promise<BoxResourceState>;
|
|
1490
|
+
loadState(_state: BoxResourceState): Promise<void>;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
interface GmailConfig {
|
|
1494
|
+
clientId: string;
|
|
1495
|
+
clientSecret: string;
|
|
1496
|
+
refreshToken: string;
|
|
1497
|
+
refreshFn?: (refreshToken: string) => Promise<{
|
|
1498
|
+
accessToken: string;
|
|
1499
|
+
expiresIn: number;
|
|
1500
|
+
}>;
|
|
1501
|
+
}
|
|
1502
|
+
interface GmailConfigRedacted {
|
|
1503
|
+
clientId: string;
|
|
1504
|
+
clientSecret: '<REDACTED>';
|
|
1505
|
+
refreshToken: '<REDACTED>';
|
|
1506
|
+
}
|
|
1507
|
+
declare function redactGmailConfig(config: GmailConfig): GmailConfigRedacted;
|
|
1508
|
+
declare function normalizeGmailConfig(input: Record<string, unknown>): GmailConfig;
|
|
1509
|
+
|
|
1510
|
+
interface GmailResourceState {
|
|
1511
|
+
type: string;
|
|
1512
|
+
needsOverride: boolean;
|
|
1513
|
+
redactedFields: readonly string[];
|
|
1514
|
+
config: GmailConfigRedacted;
|
|
1515
|
+
}
|
|
1516
|
+
declare class GmailResource implements Resource {
|
|
1517
|
+
readonly kind: string;
|
|
1518
|
+
readonly isRemote: boolean;
|
|
1519
|
+
readonly indexTtl: number;
|
|
1520
|
+
readonly prompt: string;
|
|
1521
|
+
readonly writePrompt: string;
|
|
1522
|
+
readonly config: GmailConfig;
|
|
1523
|
+
readonly accessor: GmailAccessor;
|
|
1524
|
+
readonly index: IndexCacheStore;
|
|
1525
|
+
constructor(config: GmailConfig);
|
|
1526
|
+
open(): Promise<void>;
|
|
1527
|
+
close(): Promise<void>;
|
|
1528
|
+
commands(): readonly RegisteredCommand[];
|
|
1529
|
+
ops(): readonly RegisteredOp[];
|
|
1530
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1531
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1532
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1533
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1534
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1535
|
+
getState(): Promise<GmailResourceState>;
|
|
1536
|
+
loadState(_state: GmailResourceState): Promise<void>;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
interface EmailConfig {
|
|
1540
|
+
imapHost: string;
|
|
1541
|
+
imapPort: number;
|
|
1542
|
+
smtpHost: string;
|
|
1543
|
+
smtpPort: number;
|
|
1544
|
+
username: string;
|
|
1545
|
+
password: string;
|
|
1546
|
+
useSsl: boolean;
|
|
1547
|
+
maxMessages: number;
|
|
1548
|
+
}
|
|
1549
|
+
interface EmailConfigRedacted extends Omit<EmailConfig, 'password'> {
|
|
1550
|
+
password: '<REDACTED>';
|
|
1551
|
+
}
|
|
1552
|
+
declare function redactEmailConfig(config: EmailConfig): EmailConfigRedacted;
|
|
1553
|
+
interface EmailConfigInput {
|
|
1554
|
+
imapHost: string;
|
|
1555
|
+
imapPort?: number;
|
|
1556
|
+
smtpHost: string;
|
|
1557
|
+
smtpPort?: number;
|
|
1558
|
+
username: string;
|
|
1559
|
+
password: string;
|
|
1560
|
+
useSsl?: boolean;
|
|
1561
|
+
maxMessages?: number;
|
|
1562
|
+
}
|
|
1563
|
+
declare function buildEmailConfig(input: EmailConfigInput): EmailConfig;
|
|
1564
|
+
declare function normalizeEmailConfig(input: Record<string, unknown>): EmailConfig;
|
|
1565
|
+
|
|
1566
|
+
declare class EmailAccessor extends Accessor {
|
|
1567
|
+
readonly config: EmailConfig;
|
|
1568
|
+
private clientPromise;
|
|
1569
|
+
constructor(config: EmailConfig);
|
|
1570
|
+
getImap(): Promise<ImapFlow>;
|
|
1571
|
+
close(): Promise<void>;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
interface EmailResourceState {
|
|
1575
|
+
type: string;
|
|
1576
|
+
needsOverride: boolean;
|
|
1577
|
+
redactedFields: readonly string[];
|
|
1578
|
+
config: EmailConfigRedacted;
|
|
1579
|
+
}
|
|
1580
|
+
declare class EmailResource implements Resource {
|
|
1581
|
+
readonly kind: string;
|
|
1582
|
+
readonly isRemote: boolean;
|
|
1583
|
+
readonly indexTtl: number;
|
|
1584
|
+
readonly prompt: string;
|
|
1585
|
+
readonly config: EmailConfig;
|
|
1586
|
+
readonly accessor: EmailAccessor;
|
|
1587
|
+
readonly index: IndexCacheStore;
|
|
1588
|
+
constructor(config: EmailConfig);
|
|
1589
|
+
open(): Promise<void>;
|
|
1590
|
+
close(): Promise<void>;
|
|
1591
|
+
commands(): readonly RegisteredCommand[];
|
|
1592
|
+
ops(): readonly RegisteredOp[];
|
|
1593
|
+
readFile(p: PathSpec): Promise<Uint8Array>;
|
|
1594
|
+
readdir(p: PathSpec): Promise<string[]>;
|
|
1595
|
+
stat(p: PathSpec): Promise<FileStat>;
|
|
1596
|
+
fingerprint(p: PathSpec): Promise<string | null>;
|
|
1597
|
+
glob(paths: readonly PathSpec[], prefix?: string): Promise<PathSpec[]>;
|
|
1598
|
+
getState(): Promise<EmailResourceState>;
|
|
1599
|
+
loadState(_state: EmailResourceState): Promise<void>;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
declare const EMAIL_PROMPT = "{prefix}\n <folder>/\n <yyyy-mm-dd>/\n <subject>__<uid>.email.json\n <subject>__<uid>/ # if attachments exist\n <attachment-filename>\n Folders include: INBOX, Sent, Drafts, etc. cat shows email as JSON.";
|
|
1603
|
+
declare const EMAIL_WRITE_PROMPT = " Write commands:\n email-send \"to@email.com\" \"subject\" \"body\"\n email-reply <email-path> \"reply body\"\n email-forward <email-path> \"to@email.com\"";
|
|
1604
|
+
|
|
1605
|
+
declare const EMAIL_COMMANDS: readonly RegisteredCommand[];
|
|
1606
|
+
|
|
1607
|
+
declare const EMAIL_OPS: readonly RegisteredOp[];
|
|
1608
|
+
|
|
1609
|
+
/**
|
|
1610
|
+
* Construct a resource by registry name. Mirrors Python's
|
|
1611
|
+
* `mirage.resource.registry.build_resource`.
|
|
1612
|
+
*
|
|
1613
|
+
* Each entry is an async factory that lazy-imports its module so that
|
|
1614
|
+
* importing this file doesn't pull in every backend's dependencies.
|
|
1615
|
+
* Only the resource you actually request gets loaded — important for
|
|
1616
|
+
* S3/Redis whose peer deps (`@aws-sdk/client-s3`, `redis`) are optional.
|
|
1617
|
+
*
|
|
1618
|
+
* Configs are normalized from Python-style snake_case (used in YAML and
|
|
1619
|
+
* by the Python `mirage.config` loader) to TS-idiomatic camelCase. So
|
|
1620
|
+
* the same YAML file works in both Python and TS.
|
|
1621
|
+
*/
|
|
1622
|
+
type ResourceFactory = (config: Record<string, unknown>) => Promise<Resource>;
|
|
1623
|
+
/**
|
|
1624
|
+
* Look up the registered names. Lazily-mutated by `register()` so users
|
|
1625
|
+
* can extend the registry with custom resources.
|
|
1626
|
+
*/
|
|
1627
|
+
declare function knownResources(): string[];
|
|
1628
|
+
/**
|
|
1629
|
+
* Register a custom resource factory under `name`. Existing entries
|
|
1630
|
+
* are overwritten, mirroring Python's mutable REGISTRY dict.
|
|
1631
|
+
*/
|
|
1632
|
+
declare function register(name: string, factory: ResourceFactory): void;
|
|
1633
|
+
/**
|
|
1634
|
+
* Build a resource instance by registry name. Throws if the name is
|
|
1635
|
+
* unknown.
|
|
1636
|
+
*/
|
|
1637
|
+
declare function buildResource(name: string, config?: Record<string, unknown>): Promise<Resource>;
|
|
1638
|
+
|
|
1639
|
+
declare const DISK_COMMANDS: readonly RegisteredCommand[];
|
|
1640
|
+
|
|
1641
|
+
declare const REDIS_COMMANDS: readonly RegisteredCommand[];
|
|
1642
|
+
|
|
1643
|
+
interface LocalAudioMetadata {
|
|
1644
|
+
duration: number | null;
|
|
1645
|
+
sampleRate: number | null;
|
|
1646
|
+
channels: number | null;
|
|
1647
|
+
bitrate: number | null;
|
|
1648
|
+
}
|
|
1649
|
+
type LocalAudioTranscriber = (raw: Uint8Array, startSec?: number, endSec?: number) => AsyncIterable<Uint8Array | string>;
|
|
1650
|
+
interface LocalAudioConfig {
|
|
1651
|
+
modelDir?: string;
|
|
1652
|
+
recognizer?: LocalAudioTranscriber;
|
|
1653
|
+
}
|
|
1654
|
+
declare function configure(opts: LocalAudioConfig): void;
|
|
1655
|
+
declare function getConfig(): Readonly<LocalAudioConfig>;
|
|
1656
|
+
declare function transcribe(raw: Uint8Array, startSec?: number, endSec?: number): AsyncIterable<Uint8Array>;
|
|
1657
|
+
declare function metadata(raw: Uint8Array): Promise<LocalAudioMetadata>;
|
|
1658
|
+
declare function estimateByteRange(meta: LocalAudioMetadata, fileSize: number, startSec?: number, endSec?: number): [number, number];
|
|
1659
|
+
declare function formatDuration(duration: number): string;
|
|
1660
|
+
declare function formatMetadata(meta: LocalAudioMetadata, path: string, fileSize?: number | null): string;
|
|
1661
|
+
|
|
1662
|
+
declare const DISK_LOCAL_AUDIO_COMMANDS: readonly RegisteredCommand[];
|
|
1663
|
+
|
|
1664
|
+
declare const RAM_LOCAL_AUDIO_COMMANDS: readonly RegisteredCommand[];
|
|
1665
|
+
|
|
1666
|
+
declare const LOCAL_AUDIO_COMMANDS: {
|
|
1667
|
+
ram: readonly RegisteredCommand[];
|
|
1668
|
+
disk: readonly RegisteredCommand[];
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1671
|
+
export { type BoxConfig, type BoxConfigRedacted, BoxResource, type BoxResourceState, DISK_COMMANDS, DISK_LOCAL_AUDIO_COMMANDS, DISK_OPS, DISK_PROMPT, type DiscordConfig, type DiscordConfigRedacted, DiscordResource, type DiscordResourceState, DiskResource, type DiskResourceOptions, type DiskResourceState, type DropboxConfig, type DropboxConfigRedacted, DropboxResource, type DropboxResourceState, EMAIL_COMMANDS, EMAIL_OPS, EMAIL_PROMPT, EMAIL_WRITE_PROMPT, EmailAccessor, type EmailConfig, type EmailConfigInput, type EmailConfigRedacted, EmailResource, type EmailResourceState, type FuseAttr, type FuseHandle, FuseManager, type MountOptions as FuseMountOptions, type GCSConfig, type GCSConfigRedacted, GCSResource, type GCSResourceState, GCS_ENDPOINT, GCS_PROMPT, type GDocsConfig, type GDocsConfigRedacted, GDocsResource, type GDocsResourceState, type GDriveConfig, type GDriveConfigRedacted, GDriveResource, type GDriveResourceState, type GSheetsConfig, type GSheetsConfigRedacted, GSheetsResource, type GSheetsResourceState, type GSlidesConfig, type GSlidesConfigRedacted, GSlidesResource, type GSlidesResourceState, type GitHubCIConfig, type GitHubCIConfigRedacted, GitHubCIResource, type GitHubCIResourceState, type GitHubConfig, type GitHubConfigRedacted, GitHubResource, type GitHubResourceState, type GmailConfig, type GmailConfigRedacted, GmailResource, type GmailResourceState, LOCAL_AUDIO_COMMANDS, type LangfuseConfig, type LangfuseConfigRedacted, LangfuseResource, type LangfuseResourceState, type LinearConfig, type LinearConfigRedacted, LinearResource, type LinearResourceState, type LocalAudioConfig, type LocalAudioMetadata, type LocalAudioTranscriber, MirageFS, type MirageFSOptions, MongoDBResource, type MongoDBResourceOptions, MongoDBStore, type NativeExecOptions, type NativeExecResult, type NativeProcess, type OCIConfig, type OCIConfigRedacted, OCIResource, type OCIResourceState, OCI_PROMPT, PostHogResource, type PostHogResourceOptions, PostgresResource, type PostgresResourceOptions, PostgresStore, type R2Config, type R2ConfigRedacted, R2Resource, type R2ResourceState, R2_PROMPT, RAM_LOCAL_AUDIO_COMMANDS, REDIS_COMMANDS, REDIS_OPS, REDIS_PROMPT, RedisAccessor, type RedisFileCacheOptions, RedisFileCacheStore, type RedisIndexCacheOptions, RedisIndexCacheStore, RedisResource, type RedisResourceLike, type RedisResourceOptions, type RedisResourceState, RedisStore, type RedisStoreOptions, type ResourceFactory, type S3Config, type S3ConfigRedacted, S3Resource, type S3ResourceState, SSCholarAuthorResource, type SSCholarAuthorResourceOptions, SSCholarPaperResource, type SSCholarPaperResourceOptions, SSHAccessor, type SSHConfig, type SSHConfigRedacted, SSHResource, type SSHResourceState, SSH_COMMANDS, SSH_OPS, SSH_PROMPT, SUPABASE_PROMPT, type SlackConfig, type SlackConfigRedacted, SlackResource, type SlackResourceState, type SupabaseConfig, type SupabaseConfigRedacted, SupabaseResource, type SupabaseResourceState, type TrelloConfig, type TrelloConfigRedacted, TrelloResource, type TrelloResourceState, VercelResource, type VercelResourceOptions, Workspace, buildEmailConfig, buildResource, configure as configureLocalAudio, fileReadProvision, mount as fuseMount, mountBackground as fuseMountBackground, getConfig as getLocalAudioConfig, headTailProvision, isMacosMetadata, knownResources, estimateByteRange as localAudioEstimateByteRange, formatDuration as localAudioFormatDuration, formatMetadata as localAudioFormatMetadata, metadata as localAudioMetadata, transcribe as localAudioTranscribe, metadataProvision, nativeExec, nativeExecStream, normalizeBoxConfig, normalizeDiscordConfig, normalizeDropboxConfig, normalizeEmailConfig, normalizeGDocsConfig, normalizeGDriveConfig, normalizeGSheetsConfig, normalizeGSlidesConfig, normalizeGitHubCIConfig, normalizeGitHubConfig, normalizeGmailConfig, normalizeLangfuseConfig, normalizeLinearConfig, normalizeSlackConfig, normalizeSshConfig, normalizeTrelloConfig, patchNodeFs, redactBoxConfig, redactDiscordConfig, redactDropboxConfig, redactEmailConfig, redactGDocsConfig, redactGDriveConfig, redactGSheetsConfig, redactGSlidesConfig, redactGcsConfig, redactGitHubCIConfig, redactGitHubConfig, redactGmailConfig, redactLangfuseConfig, redactLinearConfig, redactOciConfig, redactR2Config, redactConfig as redactS3Config, redactSlackConfig, redactSshConfig, redactSupabaseConfig, redactTrelloConfig, register as registerResourceFactory, resolvedSupabaseEndpoint };
|