@drewpayment/mink 0.10.0 → 0.11.0-beta.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 (60) hide show
  1. package/README.md +62 -1
  2. package/dashboard/out/404.html +1 -1
  3. package/dashboard/out/action-log.html +1 -1
  4. package/dashboard/out/action-log.txt +1 -1
  5. package/dashboard/out/activity.html +1 -1
  6. package/dashboard/out/activity.txt +1 -1
  7. package/dashboard/out/bugs.html +1 -1
  8. package/dashboard/out/bugs.txt +1 -1
  9. package/dashboard/out/capture.html +1 -1
  10. package/dashboard/out/capture.txt +1 -1
  11. package/dashboard/out/config.html +1 -1
  12. package/dashboard/out/config.txt +1 -1
  13. package/dashboard/out/daemon.html +1 -1
  14. package/dashboard/out/daemon.txt +1 -1
  15. package/dashboard/out/design.html +1 -1
  16. package/dashboard/out/design.txt +1 -1
  17. package/dashboard/out/discord.html +1 -1
  18. package/dashboard/out/discord.txt +1 -1
  19. package/dashboard/out/file-index.html +1 -1
  20. package/dashboard/out/file-index.txt +1 -1
  21. package/dashboard/out/index.html +1 -1
  22. package/dashboard/out/index.txt +1 -1
  23. package/dashboard/out/insights.html +1 -1
  24. package/dashboard/out/insights.txt +1 -1
  25. package/dashboard/out/learning.html +1 -1
  26. package/dashboard/out/learning.txt +1 -1
  27. package/dashboard/out/overview.html +1 -1
  28. package/dashboard/out/overview.txt +1 -1
  29. package/dashboard/out/scheduler.html +1 -1
  30. package/dashboard/out/scheduler.txt +1 -1
  31. package/dashboard/out/sync.html +1 -1
  32. package/dashboard/out/sync.txt +1 -1
  33. package/dashboard/out/tokens.html +1 -1
  34. package/dashboard/out/tokens.txt +1 -1
  35. package/dashboard/out/waste.html +1 -1
  36. package/dashboard/out/waste.txt +1 -1
  37. package/dashboard/out/wiki.html +1 -1
  38. package/dashboard/out/wiki.txt +1 -1
  39. package/dist/cli.js +1505 -896
  40. package/package.json +1 -1
  41. package/src/cli.ts +1 -1
  42. package/src/commands/init.ts +29 -4
  43. package/src/commands/note.ts +2 -2
  44. package/src/commands/scan.ts +29 -6
  45. package/src/commands/session-start.ts +8 -2
  46. package/src/commands/sync-migrate.ts +404 -7
  47. package/src/commands/sync.ts +5 -2
  48. package/src/commands/wiki.ts +19 -3
  49. package/src/core/dashboard-server.ts +13 -5
  50. package/src/core/git-identity.ts +120 -0
  51. package/src/core/note-index.ts +50 -1
  52. package/src/core/paths.ts +19 -3
  53. package/src/core/project-id.ts +142 -5
  54. package/src/core/project-registry.ts +122 -13
  55. package/src/core/scanner.ts +19 -3
  56. package/src/core/sync.ts +7 -1
  57. package/src/types/config.ts +9 -0
  58. package/src/types/note.ts +1 -0
  59. /package/dashboard/out/_next/static/{frTrvF6NV-Xl2bLk21NkY → WDjkNLHEd_wI-oOzLyblH}/_buildManifest.js +0 -0
  60. /package/dashboard/out/_next/static/{frTrvF6NV-Xl2bLk21NkY → WDjkNLHEd_wI-oOzLyblH}/_ssgManifest.js +0 -0
@@ -87,13 +87,29 @@ export function getExcludes(config: ProjectConfig): string[] {
87
87
  return [...DEFAULT_EXCLUDES, ...(config.excludePatterns ?? [])];
88
88
  }
89
89
 
90
- export function scanProject(
90
+ export interface ScanStats {
91
+ files: ScannedFile[];
92
+ totalScanned: number;
93
+ truncated: number;
94
+ }
95
+
96
+ export function scanProjectWithStats(
91
97
  projectRoot: string,
92
98
  excludes: string[],
93
99
  maxFiles: number = DEFAULT_MAX_FILES
94
- ): ScannedFile[] {
100
+ ): ScanStats {
95
101
  const results: ScannedFile[] = [];
96
102
  walkDirectory(projectRoot, projectRoot, excludes, results);
97
103
  results.sort((a, b) => b.mtimeMs - a.mtimeMs);
98
- return results.slice(0, maxFiles);
104
+ const totalScanned = results.length;
105
+ const files = results.slice(0, maxFiles);
106
+ return { files, totalScanned, truncated: totalScanned - files.length };
107
+ }
108
+
109
+ export function scanProject(
110
+ projectRoot: string,
111
+ excludes: string[],
112
+ maxFiles: number = DEFAULT_MAX_FILES
113
+ ): ScannedFile[] {
114
+ return scanProjectWithStats(projectRoot, excludes, maxFiles).files;
99
115
  }
package/src/core/sync.ts CHANGED
@@ -15,7 +15,13 @@ const FETCH_TIMEOUT = 15_000;
15
15
  // Sync layout version. Bumped when the on-disk shape of `~/.mink/` changes in
16
16
  // a way that older devices cannot read. Migration runs on first session-start
17
17
  // after upgrade when readSyncVersion() < MINK_SYNC_VERSION.
18
- export const MINK_SYNC_VERSION = 2;
18
+ //
19
+ // v1 → v2: per-device shards under projects/<id>/state/<deviceId>/
20
+ // v2 → v3: stable identity — adds aliases[] and pathsByDevice{} on project-meta;
21
+ // when projects.identity=git-remote, renames per-project directories
22
+ // from path-derived IDs to git-derived IDs and records prior ID as
23
+ // alias. Migration is a no-op when the flag is off.
24
+ export const MINK_SYNC_VERSION = 3;
19
25
 
20
26
  export function readSyncVersion(): number {
21
27
  try {
@@ -17,6 +17,7 @@ export interface GlobalConfig {
17
17
  "cli.auto-update"?: string;
18
18
  "cli.auto-update-schedule"?: string;
19
19
  "cli.auto-update-package-manager"?: string;
20
+ "projects.identity"?: string;
20
21
  }
21
22
 
22
23
  export type ConfigKey = keyof GlobalConfig & string;
@@ -170,6 +171,14 @@ export const CONFIG_KEYS: ConfigKeyMeta[] = [
170
171
  description: "Force a package manager (auto|npm|bun) for self-upgrade installs",
171
172
  scope: "local",
172
173
  },
174
+ {
175
+ key: "projects.identity",
176
+ default: "path-derived",
177
+ envVar: "MINK_PROJECTS_IDENTITY",
178
+ description:
179
+ "Project identity strategy: path-derived (legacy) or git-remote (stable across machines)",
180
+ scope: "shared",
181
+ },
173
182
  ];
174
183
 
175
184
  const VALID_KEYS = new Set<string>(CONFIG_KEYS.map((k) => k.key));
package/src/types/note.ts CHANGED
@@ -62,6 +62,7 @@ export interface VaultIndexEntry {
62
62
 
63
63
  export interface VaultIndex {
64
64
  lastScanTimestamp: string;
65
+ lastFullScanTimestamp?: string;
65
66
  totalNotes: number;
66
67
  entries: Record<string, VaultIndexEntry>;
67
68
  }