@hasna/files 0.1.6 → 0.2.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.
Files changed (56) hide show
  1. package/README.md +19 -117
  2. package/dashboard/dist/assets/{index-DBpbr5zm.css → index-CUqmYYsM.css} +1 -1
  3. package/dashboard/dist/index.html +2 -2
  4. package/dist/cli/index.js +6519 -5766
  5. package/dist/index.d.ts +45 -0
  6. package/dist/index.js +6774 -5775
  7. package/dist/mcp/index.js +40540 -23760
  8. package/dist/server/index.js +6651 -5723
  9. package/package.json +3 -3
  10. package/dist/cli/index.d.ts +0 -3
  11. package/dist/cli/index.d.ts.map +0 -1
  12. package/dist/db/collections.d.ts +0 -8
  13. package/dist/db/collections.d.ts.map +0 -1
  14. package/dist/db/database.d.ts +0 -5
  15. package/dist/db/database.d.ts.map +0 -1
  16. package/dist/db/files.d.ts +0 -12
  17. package/dist/db/files.d.ts.map +0 -1
  18. package/dist/db/machines.d.ts +0 -6
  19. package/dist/db/machines.d.ts.map +0 -1
  20. package/dist/db/peers.d.ts +0 -15
  21. package/dist/db/peers.d.ts.map +0 -1
  22. package/dist/db/pg-migrations.d.ts +0 -4
  23. package/dist/db/projects.d.ts +0 -8
  24. package/dist/db/projects.d.ts.map +0 -1
  25. package/dist/db/resolve.d.ts +0 -9
  26. package/dist/db/resolve.d.ts.map +0 -1
  27. package/dist/db/search.d.ts +0 -6
  28. package/dist/db/search.d.ts.map +0 -1
  29. package/dist/db/sources.d.ts +0 -17
  30. package/dist/db/sources.d.ts.map +0 -1
  31. package/dist/db/tags.d.ts +0 -8
  32. package/dist/db/tags.d.ts.map +0 -1
  33. package/dist/index.d.ts.map +0 -1
  34. package/dist/lib/config.d.ts +0 -13
  35. package/dist/lib/config.d.ts.map +0 -1
  36. package/dist/lib/hasher.d.ts +0 -3
  37. package/dist/lib/hasher.d.ts.map +0 -1
  38. package/dist/lib/ignore.d.ts +0 -11
  39. package/dist/lib/ignore.d.ts.map +0 -1
  40. package/dist/lib/indexer.d.ts +0 -3
  41. package/dist/lib/indexer.d.ts.map +0 -1
  42. package/dist/lib/s3.d.ts +0 -12
  43. package/dist/lib/s3.d.ts.map +0 -1
  44. package/dist/lib/sync.d.ts +0 -19
  45. package/dist/lib/sync.d.ts.map +0 -1
  46. package/dist/lib/watcher.d.ts +0 -5
  47. package/dist/lib/watcher.d.ts.map +0 -1
  48. package/dist/mcp/index.d.ts +0 -3
  49. package/dist/mcp/index.d.ts.map +0 -1
  50. package/dist/server/index.d.ts +0 -3
  51. package/dist/server/index.d.ts.map +0 -1
  52. package/dist/server/serve.d.ts +0 -2
  53. package/dist/server/serve.d.ts.map +0 -1
  54. package/dist/types/index.d.ts +0 -104
  55. package/dist/types/index.d.ts.map +0 -1
  56. /package/dashboard/dist/assets/{index-zazl9Rbx.js → index-D-sjqzQL.js} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hasna/files",
3
- "version": "0.1.6",
4
- "description": "Agent-first file management \u2014 index local folders and S3 buckets, tag, search, and retrieve files via CLI + MCP",
3
+ "version": "0.2.1",
4
+ "description": "Agent-first file management index local folders and S3 buckets, tag, search, and retrieve files via CLI + MCP",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -59,7 +59,7 @@
59
59
  "@aws-sdk/client-s3": "^3.744.0",
60
60
  "@aws-sdk/lib-storage": "^3.744.0",
61
61
  "@aws-sdk/s3-request-presigner": "^3.1009.0",
62
- "@hasna/cloud": "^0.1.0",
62
+ "@hasna/cloud": "^0.1.24",
63
63
  "@modelcontextprotocol/sdk": "^1.10.1",
64
64
  "@noble/hashes": "^1.7.2",
65
65
  "chalk": "^5.4.1",
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env bun
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.tsx"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import type { Collection } from "../types/index.js";
2
- export declare function createCollection(name: string, description?: string): Collection;
3
- export declare function listCollections(): Collection[];
4
- export declare function getCollection(id: string): Collection | null;
5
- export declare function deleteCollection(id: string): boolean;
6
- export declare function addToCollection(collection_id: string, file_id: string): void;
7
- export declare function removeFromCollection(collection_id: string, file_id: string): boolean;
8
- //# sourceMappingURL=collections.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/db/collections.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,SAAK,GAAG,UAAU,CAK3E;AAED,wBAAgB,eAAe,IAAI,UAAU,EAAE,CAE9C;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAE3D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAE5E;AAED,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpF"}
@@ -1,5 +0,0 @@
1
- import { Database } from "bun:sqlite";
2
- export declare const DB_PATH: string;
3
- export declare function getDb(): Database;
4
- export declare function closeDb(): void;
5
- //# sourceMappingURL=database.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC,eAAO,MAAM,OAAO,QAA0D,CAAC;AAI/E,wBAAgB,KAAK,IAAI,QAAQ,CAQhC;AA4JD,wBAAgB,OAAO,IAAI,IAAI,CAG9B"}
@@ -1,12 +0,0 @@
1
- import type { FileRecord, FileWithTags, ListFilesOptions } from "../types/index.js";
2
- export declare function upsertFile(input: Omit<FileRecord, "id" | "indexed_at" | "created_at"> & {
3
- id?: string;
4
- }): FileRecord;
5
- export declare function getFile(id: string): FileWithTags | null;
6
- export declare function listFiles(opts?: ListFilesOptions): FileWithTags[];
7
- export declare function searchFiles(query: string, opts?: Omit<ListFilesOptions, "query">): FileWithTags[];
8
- export declare function markFileDeleted(source_id: string, path: string): boolean;
9
- export declare function deleteFile(id: string): boolean;
10
- export declare function getFileByPath(source_id: string, path: string): FileRecord | null;
11
- export declare function refreshAllFts(): void;
12
- //# sourceMappingURL=files.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/db/files.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAc,MAAM,mBAAmB,CAAC;AA2BhG,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,YAAY,GAAG,YAAY,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAwBpH;AAgBD,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAQvD;AAED,wBAAgB,SAAS,CAAC,IAAI,GAAE,gBAAqB,GAAG,YAAY,EAAE,CA6CrE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAM,GAAG,YAAY,EAAE,CAYrG;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAG9C;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAKhF;AAED,wBAAgB,aAAa,IAAI,IAAI,CAKpC"}
@@ -1,6 +0,0 @@
1
- import type { Machine } from "../types/index.js";
2
- export declare function getCurrentMachine(): Machine;
3
- export declare function listMachines(): Machine[];
4
- export declare function getMachine(id: string): Machine | null;
5
- export declare function upsertMachine(m: Omit<Machine, "created_at">): Machine;
6
- //# sourceMappingURL=machines.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"machines.d.ts","sourceRoot":"","sources":["../../src/db/machines.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAiBjD,wBAAgB,iBAAiB,IAAI,OAAO,CAqB3C;AAED,wBAAgB,YAAY,IAAI,OAAO,EAAE,CAExC;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAGrD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,OAAO,CAcrE"}
@@ -1,15 +0,0 @@
1
- export interface Peer {
2
- id: string;
3
- url: string;
4
- name: string;
5
- last_synced_at?: string;
6
- auto_sync: boolean;
7
- sync_interval_minutes: number;
8
- created_at: string;
9
- }
10
- export declare function listPeers(): Peer[];
11
- export declare function addPeer(url: string, name?: string, auto_sync?: boolean, sync_interval_minutes?: number): Peer;
12
- export declare function removePeer(id: string): boolean;
13
- export declare function markPeerSynced(id: string): void;
14
- export declare function getAutosyncPeers(): Peer[];
15
- //# sourceMappingURL=peers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"peers.d.ts","sourceRoot":"","sources":["../../src/db/peers.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACpB;AAWD,wBAAgB,SAAS,IAAI,IAAI,EAAE,CAElC;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,SAAK,EAAE,SAAS,UAAQ,EAAE,qBAAqB,SAAK,GAAG,IAAI,CAUnG;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,gBAAgB,IAAI,IAAI,EAAE,CAEzC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * PostgreSQL migrations for open-files cloud sync.
3
- */
4
- export declare const PG_MIGRATIONS: string[];
@@ -1,8 +0,0 @@
1
- import type { Project } from "../types/index.js";
2
- export declare function createProject(name: string, description?: string): Project;
3
- export declare function listProjects(): Project[];
4
- export declare function getProject(id: string): Project | null;
5
- export declare function deleteProject(id: string): boolean;
6
- export declare function addToProject(project_id: string, file_id: string): void;
7
- export declare function removeFromProject(project_id: string, file_id: string): boolean;
8
- //# sourceMappingURL=projects.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/db/projects.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,SAAK,GAAG,OAAO,CAKrE;AAED,wBAAgB,YAAY,IAAI,OAAO,EAAE,CAExC;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAErD;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAEtE;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9E"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Resolve a partial ID to a full ID for files, sources, collections, projects, tags, machines.
3
- * Matches from the start of the ID string.
4
- */
5
- type EntityType = "files" | "sources" | "collections" | "projects" | "tags" | "machines";
6
- export declare function resolveId(partial: string, table: EntityType): string | null;
7
- export declare function requireId(partial: string, table: EntityType): string;
8
- export {};
9
- //# sourceMappingURL=resolve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/db/resolve.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,KAAK,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;AAEzF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAU3E;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAIpE"}
@@ -1,6 +0,0 @@
1
- import type { SearchResult, ListFilesOptions } from "../types/index.js";
2
- /**
3
- * Full-text search using FTS5. Falls back to LIKE if query contains no FTS operators.
4
- */
5
- export declare function searchFiles(query: string, opts?: Omit<ListFilesOptions, "query">): SearchResult[];
6
- //# sourceMappingURL=search.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/db/search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAExE;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAM,GAAG,YAAY,EAAE,CA4CrG"}
@@ -1,17 +0,0 @@
1
- import type { Source, SourceType, S3Config } from "../types/index.js";
2
- export declare function createSource(input: {
3
- name: string;
4
- type: SourceType;
5
- path?: string;
6
- bucket?: string;
7
- prefix?: string;
8
- region?: string;
9
- config?: S3Config;
10
- machine_id: string;
11
- }): Source;
12
- export declare function getSource(id: string): Source | null;
13
- export declare function listSources(machine_id?: string): Source[];
14
- export declare function updateSource(id: string, updates: Partial<Pick<Source, "name" | "enabled" | "config" | "prefix" | "region">>): Source | null;
15
- export declare function deleteSource(id: string): boolean;
16
- export declare function markSourceIndexed(id: string, file_count: number): void;
17
- //# sourceMappingURL=sources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/db/sources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAiCtE,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAmBT;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGnD;AAED,wBAAgB,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAMzD;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,CAY3I;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAKtE"}
package/dist/db/tags.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import type { Tag } from "../types/index.js";
2
- export declare function listTags(): Tag[];
3
- export declare function getOrCreateTag(name: string, color?: string): Tag;
4
- export declare function deleteTag(id: string): boolean;
5
- export declare function tagFile(file_id: string, tag_name: string): void;
6
- export declare function untagFile(file_id: string, tag_name: string): boolean;
7
- export declare function getFileTags(file_id: string): Tag[];
8
- //# sourceMappingURL=tags.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/db/tags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,wBAAgB,QAAQ,IAAI,GAAG,EAAE,CAEhC;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,GAAG,CAOhE;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAmB/D;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKpE;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,EAAE,CAIlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kB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,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,GAC7E,MAAM,kBAAkB,CAAC"}
@@ -1,13 +0,0 @@
1
- export interface FilesConfig {
2
- auto_watch: boolean;
3
- hash_skip_bytes: number;
4
- default_limit: number;
5
- ignore_patterns: string[];
6
- [key: string]: unknown;
7
- }
8
- export declare function loadConfig(): FilesConfig;
9
- export declare function saveConfig(cfg: FilesConfig): void;
10
- export declare function getConfigValue(key: keyof FilesConfig): unknown;
11
- export declare function setConfigValue(key: string, value: string): void;
12
- export declare const CONFIG_PATH_EXPORT: string;
13
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AASD,wBAAgB,UAAU,IAAI,WAAW,CAOxC;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAGjD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,WAAW,GAAG,OAAO,CAE9D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAe/D;AAED,eAAO,MAAM,kBAAkB,QAAc,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare function hashFile(filePath: string): string;
2
- export declare function hashBuffer(data: Uint8Array): string;
3
- //# sourceMappingURL=hasher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../../src/lib/hasher.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAEnD"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Reads .filesignore from the root of a local source and returns a matcher function.
3
- * Supports glob-style patterns (fnmatch-like):
4
- * - Lines starting with # are comments
5
- * - Blank lines are skipped
6
- * - Patterns ending with / match directories only
7
- * - * matches anything except /
8
- * - ** matches anything including /
9
- */
10
- export declare function loadIgnorePatterns(rootPath: string): (relPath: string, isDir: boolean) => boolean;
11
- //# sourceMappingURL=ignore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/lib/ignore.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAsBjG"}
@@ -1,3 +0,0 @@
1
- import type { Source, IndexStats } from "../types/index.js";
2
- export declare function indexLocalSource(source: Source, machine_id: string): Promise<IndexStats>;
3
- //# sourceMappingURL=indexer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../src/lib/indexer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO5D,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAwB9F"}
package/dist/lib/s3.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { Source, IndexStats } from "../types/index.js";
2
- export declare function indexS3Source(source: Source, machine_id: string): Promise<IndexStats>;
3
- export declare function downloadFromS3(source: Source, filePath: string, destPath: string): Promise<void>;
4
- export declare function uploadToS3(source: Source, localPath: string, s3Key?: string): Promise<string>;
5
- export declare function deleteFromS3(source: Source, filePath: string): Promise<void>;
6
- export declare function getPresignedUrl(source: Source, filePath: string, expiresIn?: number): Promise<string>;
7
- export declare function headS3Object(source: Source, filePath: string): Promise<{
8
- size: number;
9
- mime: string;
10
- modified_at: string;
11
- } | null>;
12
- //# sourceMappingURL=s3.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../src/lib/s3.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAmB5D,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA0B3F;AAqCD,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAStG;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBnG;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlF;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,SAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAQzG;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAaxI"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Peer-to-peer sync between machines.
3
- *
4
- * Each machine runs its own SQLite DB. Sync works by:
5
- * 1. Fetching the remote machine's /machines/current and /files endpoint
6
- * 2. Upserting remote file records into local DB (tagged with remote machine_id)
7
- * 3. Upserting remote machine record so it appears in list_machines
8
- *
9
- * This gives you a merged view across all machines without a central DB.
10
- */
11
- export interface SyncResult {
12
- peer: string;
13
- machines_synced: number;
14
- files_synced: number;
15
- errors: string[];
16
- }
17
- export declare function syncWithPeer(peerUrl: string): Promise<SyncResult>;
18
- export declare function syncWithPeers(peerUrls: string[]): Promise<SyncResult[]>;
19
- //# sourceMappingURL=sync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/lib/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA8DvE;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAE7E"}
@@ -1,5 +0,0 @@
1
- import type { Source } from "../types/index.js";
2
- export declare function watchSource(source: Source, machine_id: string): void;
3
- export declare function unwatchSource(source_id: string): void;
4
- export declare function stopAllWatchers(): void;
5
- //# sourceMappingURL=watcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/lib/watcher.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAahD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAmBpE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAMrD;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env bun
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env bun
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare function startServer(port: number): void;
2
- //# sourceMappingURL=serve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/server/serve.ts"],"names":[],"mappings":"AA6BA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CA8J9C"}
@@ -1,104 +0,0 @@
1
- export type SourceType = "local" | "s3";
2
- export type FileStatus = "active" | "deleted" | "moved";
3
- export interface Machine {
4
- id: string;
5
- name: string;
6
- hostname: string;
7
- platform: string;
8
- arch: string;
9
- is_current: boolean;
10
- last_seen: string;
11
- created_at: string;
12
- }
13
- export interface S3Config {
14
- accessKeyId?: string;
15
- secretAccessKey?: string;
16
- sessionToken?: string;
17
- endpoint?: string;
18
- }
19
- export interface Source {
20
- id: string;
21
- name: string;
22
- type: SourceType;
23
- path?: string;
24
- bucket?: string;
25
- prefix?: string;
26
- region?: string;
27
- config: S3Config;
28
- machine_id: string;
29
- enabled: boolean;
30
- last_indexed_at?: string;
31
- file_count: number;
32
- created_at: string;
33
- updated_at: string;
34
- }
35
- export interface FileRecord {
36
- id: string;
37
- source_id: string;
38
- machine_id: string;
39
- path: string;
40
- name: string;
41
- ext: string;
42
- size: number;
43
- mime: string;
44
- hash?: string;
45
- status: FileStatus;
46
- indexed_at: string;
47
- modified_at?: string;
48
- created_at: string;
49
- }
50
- export interface FileWithTags extends FileRecord {
51
- tags: string[];
52
- }
53
- export interface Tag {
54
- id: string;
55
- name: string;
56
- color: string;
57
- created_at: string;
58
- }
59
- export interface Collection {
60
- id: string;
61
- name: string;
62
- description: string;
63
- created_at: string;
64
- updated_at: string;
65
- }
66
- export interface Project {
67
- id: string;
68
- name: string;
69
- description: string;
70
- created_at: string;
71
- updated_at: string;
72
- }
73
- export interface SearchResult extends FileWithTags {
74
- source_name?: string;
75
- machine_name?: string;
76
- rank?: number;
77
- }
78
- export interface ListFilesOptions {
79
- source_id?: string;
80
- machine_id?: string;
81
- tag?: string;
82
- collection_id?: string;
83
- project_id?: string;
84
- ext?: string;
85
- status?: FileStatus;
86
- limit?: number;
87
- offset?: number;
88
- query?: string;
89
- after?: string;
90
- before?: string;
91
- min_size?: number;
92
- max_size?: number;
93
- sort?: "name" | "size" | "date";
94
- sort_dir?: "asc" | "desc";
95
- }
96
- export interface IndexStats {
97
- source_id: string;
98
- added: number;
99
- updated: number;
100
- deleted: number;
101
- errors: number;
102
- duration_ms: number;
103
- }
104
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC;AACxC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAExD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,C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