@mukulaggarwal/pacman 0.1.0
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 +39 -0
- package/dist/chunk-3QNXXON5.js +330 -0
- package/dist/chunk-3QNXXON5.js.map +1 -0
- package/dist/chunk-43PUZDIZ.js +148 -0
- package/dist/chunk-43PUZDIZ.js.map +1 -0
- package/dist/chunk-7D4SUZUM.js +38 -0
- package/dist/chunk-7D4SUZUM.js.map +1 -0
- package/dist/chunk-AYFIQNZ5.js +807 -0
- package/dist/chunk-AYFIQNZ5.js.map +1 -0
- package/dist/chunk-FH6ZHWGR.js +37 -0
- package/dist/chunk-FH6ZHWGR.js.map +1 -0
- package/dist/chunk-O6T35A4O.js +137 -0
- package/dist/chunk-O6T35A4O.js.map +1 -0
- package/dist/chunk-TRQIZP6Z.js +451 -0
- package/dist/chunk-TRQIZP6Z.js.map +1 -0
- package/dist/chunk-UWT6AFJB.js +471 -0
- package/dist/chunk-UWT6AFJB.js.map +1 -0
- package/dist/chunk-ZKKMIDRK.js +3923 -0
- package/dist/chunk-ZKKMIDRK.js.map +1 -0
- package/dist/daemon.d.ts +3 -0
- package/dist/daemon.js +141 -0
- package/dist/daemon.js.map +1 -0
- package/dist/dist-3PIJOFZ4.js +91 -0
- package/dist/dist-3PIJOFZ4.js.map +1 -0
- package/dist/dist-L76NGFFH.js +102 -0
- package/dist/dist-L76NGFFH.js.map +1 -0
- package/dist/dist-NV2YVVHI.js +178 -0
- package/dist/dist-NV2YVVHI.js.map +1 -0
- package/dist/dist-RMYCRZIU.js +41 -0
- package/dist/dist-RMYCRZIU.js.map +1 -0
- package/dist/dist-THLCZNOZ.js +14 -0
- package/dist/dist-THLCZNOZ.js.map +1 -0
- package/dist/dist-TWNHTXYH.js +95 -0
- package/dist/dist-TWNHTXYH.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +452 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-compat.d.ts +1 -0
- package/dist/mcp-compat.js +78 -0
- package/dist/mcp-compat.js.map +1 -0
- package/dist/onboarding-server.d.ts +3 -0
- package/dist/onboarding-server.js +1172 -0
- package/dist/onboarding-server.js.map +1 -0
- package/dist/provider-runtime.d.ts +11 -0
- package/dist/provider-runtime.js +10 -0
- package/dist/provider-runtime.js.map +1 -0
- package/dist/slack-listener.d.ts +49 -0
- package/dist/slack-listener.js +888 -0
- package/dist/slack-listener.js.map +1 -0
- package/dist/storage.d.ts +8 -0
- package/dist/storage.js +9 -0
- package/dist/storage.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
// ../storage-local/dist/index.js
|
|
2
|
+
import * as fs from "fs/promises";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
var LocalStorageBackend = class {
|
|
5
|
+
constructor(basePath) {
|
|
6
|
+
this.basePath = basePath;
|
|
7
|
+
}
|
|
8
|
+
resolve(filePath) {
|
|
9
|
+
return path.join(this.basePath, filePath);
|
|
10
|
+
}
|
|
11
|
+
async read(filePath) {
|
|
12
|
+
return fs.readFile(this.resolve(filePath), "utf-8");
|
|
13
|
+
}
|
|
14
|
+
async write(filePath, content) {
|
|
15
|
+
const fullPath = this.resolve(filePath);
|
|
16
|
+
await fs.mkdir(path.dirname(fullPath), { recursive: true });
|
|
17
|
+
await fs.writeFile(fullPath, content, "utf-8");
|
|
18
|
+
}
|
|
19
|
+
async append(filePath, content) {
|
|
20
|
+
const fullPath = this.resolve(filePath);
|
|
21
|
+
await fs.mkdir(path.dirname(fullPath), { recursive: true });
|
|
22
|
+
await fs.appendFile(fullPath, content, "utf-8");
|
|
23
|
+
}
|
|
24
|
+
async list(dir) {
|
|
25
|
+
const fullPath = this.resolve(dir);
|
|
26
|
+
try {
|
|
27
|
+
const entries = await fs.readdir(fullPath);
|
|
28
|
+
return entries;
|
|
29
|
+
} catch {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async delete(filePath) {
|
|
34
|
+
try {
|
|
35
|
+
await fs.unlink(this.resolve(filePath));
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async exists(filePath) {
|
|
40
|
+
try {
|
|
41
|
+
await fs.access(this.resolve(filePath));
|
|
42
|
+
return true;
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async mkdir(dirPath) {
|
|
48
|
+
await fs.mkdir(this.resolve(dirPath), { recursive: true });
|
|
49
|
+
}
|
|
50
|
+
getBasePath() {
|
|
51
|
+
return this.basePath;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
function createLocalStorage(basePath) {
|
|
55
|
+
return new LocalStorageBackend(basePath);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ../storage-gdrive/dist/index.js
|
|
59
|
+
import * as fs2 from "fs/promises";
|
|
60
|
+
import * as path2 from "path";
|
|
61
|
+
var GDriveStorageBackend = class {
|
|
62
|
+
constructor(config, driveClient) {
|
|
63
|
+
this.config = config;
|
|
64
|
+
this.driveClient = driveClient;
|
|
65
|
+
}
|
|
66
|
+
fileIdCache = /* @__PURE__ */ new Map();
|
|
67
|
+
async initialize() {
|
|
68
|
+
if (!this.driveClient) {
|
|
69
|
+
this.driveClient = await createDriveClient(this.config.credentials);
|
|
70
|
+
}
|
|
71
|
+
await this.driveClient.listFiles(this.config.folderId);
|
|
72
|
+
}
|
|
73
|
+
async read(filePath) {
|
|
74
|
+
const cached = await this.readCache(filePath);
|
|
75
|
+
if (cached !== null) {
|
|
76
|
+
return cached;
|
|
77
|
+
}
|
|
78
|
+
const fileId = await this.resolveFileId(filePath);
|
|
79
|
+
if (!fileId) {
|
|
80
|
+
throw new Error(`File not found: ${filePath}`);
|
|
81
|
+
}
|
|
82
|
+
const content = await this.driveClient.downloadFile(fileId);
|
|
83
|
+
await this.writeCache(filePath, content);
|
|
84
|
+
return content;
|
|
85
|
+
}
|
|
86
|
+
async write(filePath, content) {
|
|
87
|
+
const fileId = await this.resolveFileId(filePath);
|
|
88
|
+
if (fileId) {
|
|
89
|
+
await this.driveClient.updateFile(fileId, content);
|
|
90
|
+
} else {
|
|
91
|
+
const parentPath = path2.dirname(filePath);
|
|
92
|
+
const parentId = await this.ensureFolder(parentPath);
|
|
93
|
+
const fileName = path2.basename(filePath);
|
|
94
|
+
const newFileId = await this.driveClient.createFile(fileName, content, parentId);
|
|
95
|
+
this.fileIdCache.set(filePath, newFileId);
|
|
96
|
+
}
|
|
97
|
+
await this.writeCache(filePath, content);
|
|
98
|
+
}
|
|
99
|
+
async append(filePath, content) {
|
|
100
|
+
let existing = "";
|
|
101
|
+
try {
|
|
102
|
+
existing = await this.read(filePath);
|
|
103
|
+
} catch {
|
|
104
|
+
}
|
|
105
|
+
await this.write(filePath, existing + content);
|
|
106
|
+
}
|
|
107
|
+
async list(dir) {
|
|
108
|
+
const names = /* @__PURE__ */ new Set();
|
|
109
|
+
const folderId = await this.resolveFolderId(dir);
|
|
110
|
+
if (folderId) {
|
|
111
|
+
for (const name of await this.driveClient.listFiles(folderId)) {
|
|
112
|
+
names.add(name);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
for (const name of await this.listCacheDir(dir)) {
|
|
116
|
+
names.add(name);
|
|
117
|
+
}
|
|
118
|
+
return [...names];
|
|
119
|
+
}
|
|
120
|
+
async delete(filePath) {
|
|
121
|
+
const fileId = await this.resolveFileId(filePath);
|
|
122
|
+
if (fileId) {
|
|
123
|
+
await this.driveClient.deleteFile(fileId);
|
|
124
|
+
this.fileIdCache.delete(filePath);
|
|
125
|
+
}
|
|
126
|
+
await this.deleteCache(filePath);
|
|
127
|
+
}
|
|
128
|
+
async exists(filePath) {
|
|
129
|
+
const fileId = await this.resolveFileId(filePath);
|
|
130
|
+
return fileId !== null;
|
|
131
|
+
}
|
|
132
|
+
async mkdir(dirPath) {
|
|
133
|
+
await this.ensureFolder(dirPath);
|
|
134
|
+
}
|
|
135
|
+
async ensureFolder(folderPath) {
|
|
136
|
+
if (folderPath === "" || folderPath === ".") {
|
|
137
|
+
return this.config.folderId;
|
|
138
|
+
}
|
|
139
|
+
const cached = this.fileIdCache.get(folderPath);
|
|
140
|
+
if (cached) return cached;
|
|
141
|
+
const parts = folderPath.split("/").filter(Boolean);
|
|
142
|
+
let parentId = this.config.folderId;
|
|
143
|
+
for (let i = 0; i < parts.length; i++) {
|
|
144
|
+
const partPath = parts.slice(0, i + 1).join("/");
|
|
145
|
+
const cachedPart = this.fileIdCache.get(partPath);
|
|
146
|
+
if (cachedPart) {
|
|
147
|
+
parentId = cachedPart;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const existing = await this.driveClient.findFolder(parts[i], parentId);
|
|
151
|
+
if (existing) {
|
|
152
|
+
this.fileIdCache.set(partPath, existing);
|
|
153
|
+
parentId = existing;
|
|
154
|
+
} else {
|
|
155
|
+
const newId = await this.driveClient.createFolder(parts[i], parentId);
|
|
156
|
+
this.fileIdCache.set(partPath, newId);
|
|
157
|
+
parentId = newId;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return parentId;
|
|
161
|
+
}
|
|
162
|
+
async resolveFolderId(folderPath) {
|
|
163
|
+
if (folderPath === "" || folderPath === ".") {
|
|
164
|
+
return this.config.folderId;
|
|
165
|
+
}
|
|
166
|
+
const cached = this.fileIdCache.get(folderPath);
|
|
167
|
+
if (cached) return cached;
|
|
168
|
+
const parts = folderPath.split("/").filter(Boolean);
|
|
169
|
+
let parentId = this.config.folderId;
|
|
170
|
+
for (let i = 0; i < parts.length; i++) {
|
|
171
|
+
const partPath = parts.slice(0, i + 1).join("/");
|
|
172
|
+
const cachedPart = this.fileIdCache.get(partPath);
|
|
173
|
+
if (cachedPart) {
|
|
174
|
+
parentId = cachedPart;
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
const existing = await this.driveClient.findFolder(parts[i], parentId);
|
|
178
|
+
if (!existing) {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
this.fileIdCache.set(partPath, existing);
|
|
182
|
+
parentId = existing;
|
|
183
|
+
}
|
|
184
|
+
return parentId;
|
|
185
|
+
}
|
|
186
|
+
async resolveFileId(filePath) {
|
|
187
|
+
const cached = this.fileIdCache.get(filePath);
|
|
188
|
+
if (cached) return cached;
|
|
189
|
+
const parentPath = path2.dirname(filePath);
|
|
190
|
+
const fileName = path2.basename(filePath);
|
|
191
|
+
const parentId = await this.ensureFolder(parentPath);
|
|
192
|
+
const fileId = await this.driveClient.findFile(fileName, parentId);
|
|
193
|
+
if (fileId) {
|
|
194
|
+
this.fileIdCache.set(filePath, fileId);
|
|
195
|
+
}
|
|
196
|
+
return fileId;
|
|
197
|
+
}
|
|
198
|
+
// --- Local cache layer ---
|
|
199
|
+
cachePath(filePath) {
|
|
200
|
+
return path2.join(this.config.cachePath, filePath);
|
|
201
|
+
}
|
|
202
|
+
async readCache(filePath) {
|
|
203
|
+
try {
|
|
204
|
+
return await fs2.readFile(this.cachePath(filePath), "utf-8");
|
|
205
|
+
} catch {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
async writeCache(filePath, content) {
|
|
210
|
+
const fullPath = this.cachePath(filePath);
|
|
211
|
+
await fs2.mkdir(path2.dirname(fullPath), { recursive: true });
|
|
212
|
+
await fs2.writeFile(fullPath, content, "utf-8");
|
|
213
|
+
}
|
|
214
|
+
async deleteCache(filePath) {
|
|
215
|
+
try {
|
|
216
|
+
await fs2.unlink(this.cachePath(filePath));
|
|
217
|
+
} catch {
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
async listCacheDir(dirPath) {
|
|
221
|
+
try {
|
|
222
|
+
return await fs2.readdir(this.cachePath(dirPath));
|
|
223
|
+
} catch {
|
|
224
|
+
return [];
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
async function createDriveClient(credentials) {
|
|
229
|
+
const { google } = await import("googleapis");
|
|
230
|
+
const oauth2Client = new google.auth.OAuth2(credentials.clientId, credentials.clientSecret);
|
|
231
|
+
oauth2Client.setCredentials({
|
|
232
|
+
refresh_token: credentials.refreshToken,
|
|
233
|
+
access_token: credentials.accessToken,
|
|
234
|
+
expiry_date: credentials.expiresAt
|
|
235
|
+
});
|
|
236
|
+
const drive = google.drive({ version: "v3", auth: oauth2Client });
|
|
237
|
+
return {
|
|
238
|
+
async createFile(name, content, parentId) {
|
|
239
|
+
const res = await drive.files.create({
|
|
240
|
+
requestBody: {
|
|
241
|
+
name,
|
|
242
|
+
parents: [parentId]
|
|
243
|
+
},
|
|
244
|
+
media: {
|
|
245
|
+
mimeType: "text/plain",
|
|
246
|
+
body: content
|
|
247
|
+
},
|
|
248
|
+
fields: "id"
|
|
249
|
+
});
|
|
250
|
+
return res.data.id;
|
|
251
|
+
},
|
|
252
|
+
async createFolder(name, parentId) {
|
|
253
|
+
const res = await drive.files.create({
|
|
254
|
+
requestBody: {
|
|
255
|
+
name,
|
|
256
|
+
mimeType: "application/vnd.google-apps.folder",
|
|
257
|
+
parents: [parentId]
|
|
258
|
+
},
|
|
259
|
+
fields: "id"
|
|
260
|
+
});
|
|
261
|
+
return res.data.id;
|
|
262
|
+
},
|
|
263
|
+
async updateFile(fileId, content) {
|
|
264
|
+
await drive.files.update({
|
|
265
|
+
fileId,
|
|
266
|
+
media: {
|
|
267
|
+
mimeType: "text/plain",
|
|
268
|
+
body: content
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
},
|
|
272
|
+
async downloadFile(fileId) {
|
|
273
|
+
const res = await drive.files.get(
|
|
274
|
+
{ fileId, alt: "media" },
|
|
275
|
+
{ responseType: "text" }
|
|
276
|
+
);
|
|
277
|
+
return res.data;
|
|
278
|
+
},
|
|
279
|
+
async deleteFile(fileId) {
|
|
280
|
+
await drive.files.delete({ fileId });
|
|
281
|
+
},
|
|
282
|
+
async listFiles(folderId) {
|
|
283
|
+
const res = await drive.files.list({
|
|
284
|
+
q: `'${folderId}' in parents and trashed = false`,
|
|
285
|
+
fields: "files(name)"
|
|
286
|
+
});
|
|
287
|
+
return (res.data.files ?? []).map((f) => f.name);
|
|
288
|
+
},
|
|
289
|
+
async findFile(name, parentId) {
|
|
290
|
+
const res = await drive.files.list({
|
|
291
|
+
q: `name = '${name}' and '${parentId}' in parents and trashed = false and mimeType != 'application/vnd.google-apps.folder'`,
|
|
292
|
+
fields: "files(id)"
|
|
293
|
+
});
|
|
294
|
+
return res.data.files?.[0]?.id ?? null;
|
|
295
|
+
},
|
|
296
|
+
async findFolder(name, parentId) {
|
|
297
|
+
const res = await drive.files.list({
|
|
298
|
+
q: `name = '${name}' and '${parentId}' in parents and trashed = false and mimeType = 'application/vnd.google-apps.folder'`,
|
|
299
|
+
fields: "files(id)"
|
|
300
|
+
});
|
|
301
|
+
return res.data.files?.[0]?.id ?? null;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function createGDriveStorage(config) {
|
|
306
|
+
return new GDriveStorageBackend(config);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// ../core-types/dist/index.js
|
|
310
|
+
var WORKSPACE_PATHS = {
|
|
311
|
+
profile: {
|
|
312
|
+
user: "profile/user.json",
|
|
313
|
+
assistant: "profile/assistant.json",
|
|
314
|
+
storage: "profile/storage.json",
|
|
315
|
+
integrations: "profile/integrations.json",
|
|
316
|
+
sync: "profile/sync.json"
|
|
317
|
+
},
|
|
318
|
+
templates: {
|
|
319
|
+
active: "templates/active-template.yaml"
|
|
320
|
+
},
|
|
321
|
+
context: {
|
|
322
|
+
canonical: {
|
|
323
|
+
overview: "context/canonical/overview.md",
|
|
324
|
+
responsibilities: "context/canonical/responsibilities.md",
|
|
325
|
+
stakeholders: "context/canonical/stakeholders.md",
|
|
326
|
+
docs: "context/canonical/docs.md",
|
|
327
|
+
projects: "context/canonical/projects"
|
|
328
|
+
},
|
|
329
|
+
raw: {
|
|
330
|
+
slack: "context/raw/slack",
|
|
331
|
+
gmail: "context/raw/gmail",
|
|
332
|
+
github: "context/raw/github",
|
|
333
|
+
gitlab: "context/raw/gitlab",
|
|
334
|
+
gdrive: "context/raw/gdrive",
|
|
335
|
+
gchat: "context/raw/gchat"
|
|
336
|
+
},
|
|
337
|
+
derived: {
|
|
338
|
+
daily: "context/derived/daily",
|
|
339
|
+
slack: {
|
|
340
|
+
replyInputs: "context/derived/slack/reply-inputs",
|
|
341
|
+
drafts: "context/derived/slack/drafts",
|
|
342
|
+
deliveries: "context/derived/slack/deliveries"
|
|
343
|
+
},
|
|
344
|
+
indexes: {
|
|
345
|
+
manifest: "context/derived/indexes/manifest.json",
|
|
346
|
+
chunks: "context/derived/indexes/chunks.jsonl",
|
|
347
|
+
entities: "context/derived/indexes/entities.json",
|
|
348
|
+
recent: "context/derived/indexes/recent.json"
|
|
349
|
+
},
|
|
350
|
+
suggestions: {
|
|
351
|
+
inferredProjects: "context/derived/suggestions/inferred-projects.json"
|
|
352
|
+
},
|
|
353
|
+
updateProposals: "context/derived/update-proposals"
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
logs: {
|
|
357
|
+
audit: "logs/audit.log",
|
|
358
|
+
sync: "logs/sync.log",
|
|
359
|
+
mcp: "logs/mcp.log"
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
// ../config-manager/dist/index.js
|
|
364
|
+
var ConfigManager = class {
|
|
365
|
+
constructor(storage) {
|
|
366
|
+
this.storage = storage;
|
|
367
|
+
}
|
|
368
|
+
async loadConfig() {
|
|
369
|
+
const [user, storage, integrations, sync, assistant] = await Promise.all([
|
|
370
|
+
this.loadJson(WORKSPACE_PATHS.profile.user),
|
|
371
|
+
this.loadJson(WORKSPACE_PATHS.profile.storage),
|
|
372
|
+
this.loadJson(WORKSPACE_PATHS.profile.integrations),
|
|
373
|
+
this.loadJson(WORKSPACE_PATHS.profile.sync),
|
|
374
|
+
this.loadJson(WORKSPACE_PATHS.profile.assistant)
|
|
375
|
+
]);
|
|
376
|
+
return {
|
|
377
|
+
user: user ?? { name: "", assistantName: "Jarvis", profileType: "software-engineer", responsibilities: [] },
|
|
378
|
+
storage: storage ?? { mode: "local", workspacePath: "." },
|
|
379
|
+
integrations: integrations ?? [],
|
|
380
|
+
sync: sync ?? { dailySyncTime: "09:00", timezone: "UTC" },
|
|
381
|
+
activeProject: assistant?.activeProject,
|
|
382
|
+
activeTemplate: assistant?.activeTemplate,
|
|
383
|
+
slackRuntime: assistant?.slackRuntime,
|
|
384
|
+
providers: assistant?.providers
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
async saveConfig(config) {
|
|
388
|
+
await this.storage.mkdir("profile");
|
|
389
|
+
await Promise.all([
|
|
390
|
+
this.saveJson(WORKSPACE_PATHS.profile.user, config.user),
|
|
391
|
+
this.saveJson(WORKSPACE_PATHS.profile.storage, config.storage),
|
|
392
|
+
this.saveJson(WORKSPACE_PATHS.profile.integrations, config.integrations),
|
|
393
|
+
this.saveJson(WORKSPACE_PATHS.profile.sync, config.sync),
|
|
394
|
+
this.saveJson(WORKSPACE_PATHS.profile.assistant, {
|
|
395
|
+
activeProject: config.activeProject,
|
|
396
|
+
activeTemplate: config.activeTemplate,
|
|
397
|
+
slackRuntime: config.slackRuntime,
|
|
398
|
+
providers: config.providers
|
|
399
|
+
})
|
|
400
|
+
]);
|
|
401
|
+
}
|
|
402
|
+
async getStorageMode() {
|
|
403
|
+
const storage = await this.loadJson(WORKSPACE_PATHS.profile.storage);
|
|
404
|
+
return storage?.mode ?? "local";
|
|
405
|
+
}
|
|
406
|
+
async getActiveProject() {
|
|
407
|
+
const assistant = await this.loadJson(WORKSPACE_PATHS.profile.assistant);
|
|
408
|
+
return assistant?.activeProject ?? null;
|
|
409
|
+
}
|
|
410
|
+
async setActiveProject(projectName) {
|
|
411
|
+
const assistant = await this.loadJson(WORKSPACE_PATHS.profile.assistant).catch(
|
|
412
|
+
() => ({})
|
|
413
|
+
);
|
|
414
|
+
await this.saveJson(WORKSPACE_PATHS.profile.assistant, {
|
|
415
|
+
...assistant,
|
|
416
|
+
activeProject: projectName
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
async getUserProfile() {
|
|
420
|
+
return this.loadJson(WORKSPACE_PATHS.profile.user);
|
|
421
|
+
}
|
|
422
|
+
async getIntegrations() {
|
|
423
|
+
const integrations = await this.loadJson(WORKSPACE_PATHS.profile.integrations);
|
|
424
|
+
return integrations ?? [];
|
|
425
|
+
}
|
|
426
|
+
async getSyncConfig() {
|
|
427
|
+
return this.loadJson(WORKSPACE_PATHS.profile.sync);
|
|
428
|
+
}
|
|
429
|
+
async loadJson(path3) {
|
|
430
|
+
try {
|
|
431
|
+
const content = await this.storage.read(path3);
|
|
432
|
+
return JSON.parse(content);
|
|
433
|
+
} catch {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
async saveJson(path3, data) {
|
|
438
|
+
await this.storage.write(path3, JSON.stringify(data, null, 2));
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
function createConfigManager(storage) {
|
|
442
|
+
return new ConfigManager(storage);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export {
|
|
446
|
+
createLocalStorage,
|
|
447
|
+
createGDriveStorage,
|
|
448
|
+
WORKSPACE_PATHS,
|
|
449
|
+
createConfigManager
|
|
450
|
+
};
|
|
451
|
+
//# sourceMappingURL=chunk-TRQIZP6Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../storage-local/dist/index.js","../../storage-gdrive/dist/index.js","../../core-types/dist/index.js","../../config-manager/dist/index.js"],"sourcesContent":["// src/index.ts\nimport * as fs from \"fs/promises\";\nimport * as path from \"path\";\nvar LocalStorageBackend = class {\n constructor(basePath) {\n this.basePath = basePath;\n }\n resolve(filePath) {\n return path.join(this.basePath, filePath);\n }\n async read(filePath) {\n return fs.readFile(this.resolve(filePath), \"utf-8\");\n }\n async write(filePath, content) {\n const fullPath = this.resolve(filePath);\n await fs.mkdir(path.dirname(fullPath), { recursive: true });\n await fs.writeFile(fullPath, content, \"utf-8\");\n }\n async append(filePath, content) {\n const fullPath = this.resolve(filePath);\n await fs.mkdir(path.dirname(fullPath), { recursive: true });\n await fs.appendFile(fullPath, content, \"utf-8\");\n }\n async list(dir) {\n const fullPath = this.resolve(dir);\n try {\n const entries = await fs.readdir(fullPath);\n return entries;\n } catch {\n return [];\n }\n }\n async delete(filePath) {\n try {\n await fs.unlink(this.resolve(filePath));\n } catch {\n }\n }\n async exists(filePath) {\n try {\n await fs.access(this.resolve(filePath));\n return true;\n } catch {\n return false;\n }\n }\n async mkdir(dirPath) {\n await fs.mkdir(this.resolve(dirPath), { recursive: true });\n }\n getBasePath() {\n return this.basePath;\n }\n};\nfunction createLocalStorage(basePath) {\n return new LocalStorageBackend(basePath);\n}\nexport {\n LocalStorageBackend,\n createLocalStorage\n};\n","// src/index.ts\nimport * as fs from \"fs/promises\";\nimport * as path from \"path\";\nvar GDriveStorageBackend = class {\n constructor(config, driveClient) {\n this.config = config;\n this.driveClient = driveClient;\n }\n fileIdCache = /* @__PURE__ */ new Map();\n async initialize() {\n if (!this.driveClient) {\n this.driveClient = await createDriveClient(this.config.credentials);\n }\n await this.driveClient.listFiles(this.config.folderId);\n }\n async read(filePath) {\n const cached = await this.readCache(filePath);\n if (cached !== null) {\n return cached;\n }\n const fileId = await this.resolveFileId(filePath);\n if (!fileId) {\n throw new Error(`File not found: ${filePath}`);\n }\n const content = await this.driveClient.downloadFile(fileId);\n await this.writeCache(filePath, content);\n return content;\n }\n async write(filePath, content) {\n const fileId = await this.resolveFileId(filePath);\n if (fileId) {\n await this.driveClient.updateFile(fileId, content);\n } else {\n const parentPath = path.dirname(filePath);\n const parentId = await this.ensureFolder(parentPath);\n const fileName = path.basename(filePath);\n const newFileId = await this.driveClient.createFile(fileName, content, parentId);\n this.fileIdCache.set(filePath, newFileId);\n }\n await this.writeCache(filePath, content);\n }\n async append(filePath, content) {\n let existing = \"\";\n try {\n existing = await this.read(filePath);\n } catch {\n }\n await this.write(filePath, existing + content);\n }\n async list(dir) {\n const names = /* @__PURE__ */ new Set();\n const folderId = await this.resolveFolderId(dir);\n if (folderId) {\n for (const name of await this.driveClient.listFiles(folderId)) {\n names.add(name);\n }\n }\n for (const name of await this.listCacheDir(dir)) {\n names.add(name);\n }\n return [...names];\n }\n async delete(filePath) {\n const fileId = await this.resolveFileId(filePath);\n if (fileId) {\n await this.driveClient.deleteFile(fileId);\n this.fileIdCache.delete(filePath);\n }\n await this.deleteCache(filePath);\n }\n async exists(filePath) {\n const fileId = await this.resolveFileId(filePath);\n return fileId !== null;\n }\n async mkdir(dirPath) {\n await this.ensureFolder(dirPath);\n }\n async ensureFolder(folderPath) {\n if (folderPath === \"\" || folderPath === \".\") {\n return this.config.folderId;\n }\n const cached = this.fileIdCache.get(folderPath);\n if (cached) return cached;\n const parts = folderPath.split(\"/\").filter(Boolean);\n let parentId = this.config.folderId;\n for (let i = 0; i < parts.length; i++) {\n const partPath = parts.slice(0, i + 1).join(\"/\");\n const cachedPart = this.fileIdCache.get(partPath);\n if (cachedPart) {\n parentId = cachedPart;\n continue;\n }\n const existing = await this.driveClient.findFolder(parts[i], parentId);\n if (existing) {\n this.fileIdCache.set(partPath, existing);\n parentId = existing;\n } else {\n const newId = await this.driveClient.createFolder(parts[i], parentId);\n this.fileIdCache.set(partPath, newId);\n parentId = newId;\n }\n }\n return parentId;\n }\n async resolveFolderId(folderPath) {\n if (folderPath === \"\" || folderPath === \".\") {\n return this.config.folderId;\n }\n const cached = this.fileIdCache.get(folderPath);\n if (cached) return cached;\n const parts = folderPath.split(\"/\").filter(Boolean);\n let parentId = this.config.folderId;\n for (let i = 0; i < parts.length; i++) {\n const partPath = parts.slice(0, i + 1).join(\"/\");\n const cachedPart = this.fileIdCache.get(partPath);\n if (cachedPart) {\n parentId = cachedPart;\n continue;\n }\n const existing = await this.driveClient.findFolder(parts[i], parentId);\n if (!existing) {\n return null;\n }\n this.fileIdCache.set(partPath, existing);\n parentId = existing;\n }\n return parentId;\n }\n async resolveFileId(filePath) {\n const cached = this.fileIdCache.get(filePath);\n if (cached) return cached;\n const parentPath = path.dirname(filePath);\n const fileName = path.basename(filePath);\n const parentId = await this.ensureFolder(parentPath);\n const fileId = await this.driveClient.findFile(fileName, parentId);\n if (fileId) {\n this.fileIdCache.set(filePath, fileId);\n }\n return fileId;\n }\n // --- Local cache layer ---\n cachePath(filePath) {\n return path.join(this.config.cachePath, filePath);\n }\n async readCache(filePath) {\n try {\n return await fs.readFile(this.cachePath(filePath), \"utf-8\");\n } catch {\n return null;\n }\n }\n async writeCache(filePath, content) {\n const fullPath = this.cachePath(filePath);\n await fs.mkdir(path.dirname(fullPath), { recursive: true });\n await fs.writeFile(fullPath, content, \"utf-8\");\n }\n async deleteCache(filePath) {\n try {\n await fs.unlink(this.cachePath(filePath));\n } catch {\n }\n }\n async listCacheDir(dirPath) {\n try {\n return await fs.readdir(this.cachePath(dirPath));\n } catch {\n return [];\n }\n }\n};\nasync function createDriveClient(credentials) {\n const { google } = await import(\"googleapis\");\n const oauth2Client = new google.auth.OAuth2(credentials.clientId, credentials.clientSecret);\n oauth2Client.setCredentials({\n refresh_token: credentials.refreshToken,\n access_token: credentials.accessToken,\n expiry_date: credentials.expiresAt\n });\n const drive = google.drive({ version: \"v3\", auth: oauth2Client });\n return {\n async createFile(name, content, parentId) {\n const res = await drive.files.create({\n requestBody: {\n name,\n parents: [parentId]\n },\n media: {\n mimeType: \"text/plain\",\n body: content\n },\n fields: \"id\"\n });\n return res.data.id;\n },\n async createFolder(name, parentId) {\n const res = await drive.files.create({\n requestBody: {\n name,\n mimeType: \"application/vnd.google-apps.folder\",\n parents: [parentId]\n },\n fields: \"id\"\n });\n return res.data.id;\n },\n async updateFile(fileId, content) {\n await drive.files.update({\n fileId,\n media: {\n mimeType: \"text/plain\",\n body: content\n }\n });\n },\n async downloadFile(fileId) {\n const res = await drive.files.get(\n { fileId, alt: \"media\" },\n { responseType: \"text\" }\n );\n return res.data;\n },\n async deleteFile(fileId) {\n await drive.files.delete({ fileId });\n },\n async listFiles(folderId) {\n const res = await drive.files.list({\n q: `'${folderId}' in parents and trashed = false`,\n fields: \"files(name)\"\n });\n return (res.data.files ?? []).map((f) => f.name);\n },\n async findFile(name, parentId) {\n const res = await drive.files.list({\n q: `name = '${name}' and '${parentId}' in parents and trashed = false and mimeType != 'application/vnd.google-apps.folder'`,\n fields: \"files(id)\"\n });\n return res.data.files?.[0]?.id ?? null;\n },\n async findFolder(name, parentId) {\n const res = await drive.files.list({\n q: `name = '${name}' and '${parentId}' in parents and trashed = false and mimeType = 'application/vnd.google-apps.folder'`,\n fields: \"files(id)\"\n });\n return res.data.files?.[0]?.id ?? null;\n }\n };\n}\nfunction createGDriveStorage(config) {\n return new GDriveStorageBackend(config);\n}\nexport {\n GDriveStorageBackend,\n createDriveClient,\n createGDriveStorage\n};\n","// src/index.ts\nvar WORKSPACE_PATHS = {\n profile: {\n user: \"profile/user.json\",\n assistant: \"profile/assistant.json\",\n storage: \"profile/storage.json\",\n integrations: \"profile/integrations.json\",\n sync: \"profile/sync.json\"\n },\n templates: {\n active: \"templates/active-template.yaml\"\n },\n context: {\n canonical: {\n overview: \"context/canonical/overview.md\",\n responsibilities: \"context/canonical/responsibilities.md\",\n stakeholders: \"context/canonical/stakeholders.md\",\n docs: \"context/canonical/docs.md\",\n projects: \"context/canonical/projects\"\n },\n raw: {\n slack: \"context/raw/slack\",\n gmail: \"context/raw/gmail\",\n github: \"context/raw/github\",\n gitlab: \"context/raw/gitlab\",\n gdrive: \"context/raw/gdrive\",\n gchat: \"context/raw/gchat\"\n },\n derived: {\n daily: \"context/derived/daily\",\n slack: {\n replyInputs: \"context/derived/slack/reply-inputs\",\n drafts: \"context/derived/slack/drafts\",\n deliveries: \"context/derived/slack/deliveries\"\n },\n indexes: {\n manifest: \"context/derived/indexes/manifest.json\",\n chunks: \"context/derived/indexes/chunks.jsonl\",\n entities: \"context/derived/indexes/entities.json\",\n recent: \"context/derived/indexes/recent.json\"\n },\n suggestions: {\n inferredProjects: \"context/derived/suggestions/inferred-projects.json\"\n },\n updateProposals: \"context/derived/update-proposals\"\n }\n },\n logs: {\n audit: \"logs/audit.log\",\n sync: \"logs/sync.log\",\n mcp: \"logs/mcp.log\"\n }\n};\nexport {\n WORKSPACE_PATHS\n};\n","// src/index.ts\nimport { WORKSPACE_PATHS as PATHS } from \"@personal-assistant/core-types\";\nvar ConfigManager = class {\n constructor(storage) {\n this.storage = storage;\n }\n async loadConfig() {\n const [user, storage, integrations, sync, assistant] = await Promise.all([\n this.loadJson(PATHS.profile.user),\n this.loadJson(PATHS.profile.storage),\n this.loadJson(PATHS.profile.integrations),\n this.loadJson(PATHS.profile.sync),\n this.loadJson(PATHS.profile.assistant)\n ]);\n return {\n user: user ?? { name: \"\", assistantName: \"Jarvis\", profileType: \"software-engineer\", responsibilities: [] },\n storage: storage ?? { mode: \"local\", workspacePath: \".\" },\n integrations: integrations ?? [],\n sync: sync ?? { dailySyncTime: \"09:00\", timezone: \"UTC\" },\n activeProject: assistant?.activeProject,\n activeTemplate: assistant?.activeTemplate,\n slackRuntime: assistant?.slackRuntime,\n providers: assistant?.providers\n };\n }\n async saveConfig(config) {\n await this.storage.mkdir(\"profile\");\n await Promise.all([\n this.saveJson(PATHS.profile.user, config.user),\n this.saveJson(PATHS.profile.storage, config.storage),\n this.saveJson(PATHS.profile.integrations, config.integrations),\n this.saveJson(PATHS.profile.sync, config.sync),\n this.saveJson(PATHS.profile.assistant, {\n activeProject: config.activeProject,\n activeTemplate: config.activeTemplate,\n slackRuntime: config.slackRuntime,\n providers: config.providers\n })\n ]);\n }\n async getStorageMode() {\n const storage = await this.loadJson(PATHS.profile.storage);\n return storage?.mode ?? \"local\";\n }\n async getActiveProject() {\n const assistant = await this.loadJson(PATHS.profile.assistant);\n return assistant?.activeProject ?? null;\n }\n async setActiveProject(projectName) {\n const assistant = await this.loadJson(PATHS.profile.assistant).catch(\n () => ({})\n );\n await this.saveJson(PATHS.profile.assistant, {\n ...assistant,\n activeProject: projectName\n });\n }\n async getUserProfile() {\n return this.loadJson(PATHS.profile.user);\n }\n async getIntegrations() {\n const integrations = await this.loadJson(PATHS.profile.integrations);\n return integrations ?? [];\n }\n async getSyncConfig() {\n return this.loadJson(PATHS.profile.sync);\n }\n async loadJson(path) {\n try {\n const content = await this.storage.read(path);\n return JSON.parse(content);\n } catch {\n return null;\n }\n }\n async saveJson(path, data) {\n await this.storage.write(path, JSON.stringify(data, null, 2));\n }\n};\nfunction createConfigManager(storage) {\n return new ConfigManager(storage);\n}\nexport {\n ConfigManager,\n createConfigManager\n};\n"],"mappings":";AACA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,IAAI,sBAAsB,MAAM;AAAA,EAC9B,YAAY,UAAU;AACpB,SAAK,WAAW;AAAA,EAClB;AAAA,EACA,QAAQ,UAAU;AAChB,WAAY,UAAK,KAAK,UAAU,QAAQ;AAAA,EAC1C;AAAA,EACA,MAAM,KAAK,UAAU;AACnB,WAAU,YAAS,KAAK,QAAQ,QAAQ,GAAG,OAAO;AAAA,EACpD;AAAA,EACA,MAAM,MAAM,UAAU,SAAS;AAC7B,UAAM,WAAW,KAAK,QAAQ,QAAQ;AACtC,UAAS,SAAW,aAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AAC1D,UAAS,aAAU,UAAU,SAAS,OAAO;AAAA,EAC/C;AAAA,EACA,MAAM,OAAO,UAAU,SAAS;AAC9B,UAAM,WAAW,KAAK,QAAQ,QAAQ;AACtC,UAAS,SAAW,aAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AAC1D,UAAS,cAAW,UAAU,SAAS,OAAO;AAAA,EAChD;AAAA,EACA,MAAM,KAAK,KAAK;AACd,UAAM,WAAW,KAAK,QAAQ,GAAG;AACjC,QAAI;AACF,YAAM,UAAU,MAAS,WAAQ,QAAQ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