ctx-sync 1.0.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.
Files changed (145) hide show
  1. package/dist/commands/audit.d.ts +76 -0
  2. package/dist/commands/audit.d.ts.map +1 -0
  3. package/dist/commands/audit.js +367 -0
  4. package/dist/commands/audit.js.map +1 -0
  5. package/dist/commands/config.d.ts +58 -0
  6. package/dist/commands/config.d.ts.map +1 -0
  7. package/dist/commands/config.js +114 -0
  8. package/dist/commands/config.js.map +1 -0
  9. package/dist/commands/dir.d.ts +56 -0
  10. package/dist/commands/dir.d.ts.map +1 -0
  11. package/dist/commands/dir.js +172 -0
  12. package/dist/commands/dir.js.map +1 -0
  13. package/dist/commands/docker.d.ts +140 -0
  14. package/dist/commands/docker.d.ts.map +1 -0
  15. package/dist/commands/docker.js +380 -0
  16. package/dist/commands/docker.js.map +1 -0
  17. package/dist/commands/env.d.ts +96 -0
  18. package/dist/commands/env.d.ts.map +1 -0
  19. package/dist/commands/env.js +352 -0
  20. package/dist/commands/env.js.map +1 -0
  21. package/dist/commands/init.d.ts +89 -0
  22. package/dist/commands/init.d.ts.map +1 -0
  23. package/dist/commands/init.js +272 -0
  24. package/dist/commands/init.js.map +1 -0
  25. package/dist/commands/key.d.ts +92 -0
  26. package/dist/commands/key.d.ts.map +1 -0
  27. package/dist/commands/key.js +274 -0
  28. package/dist/commands/key.js.map +1 -0
  29. package/dist/commands/list.d.ts +38 -0
  30. package/dist/commands/list.d.ts.map +1 -0
  31. package/dist/commands/list.js +84 -0
  32. package/dist/commands/list.js.map +1 -0
  33. package/dist/commands/note.d.ts +151 -0
  34. package/dist/commands/note.d.ts.map +1 -0
  35. package/dist/commands/note.js +411 -0
  36. package/dist/commands/note.js.map +1 -0
  37. package/dist/commands/pull.d.ts +47 -0
  38. package/dist/commands/pull.d.ts.map +1 -0
  39. package/dist/commands/pull.js +94 -0
  40. package/dist/commands/pull.js.map +1 -0
  41. package/dist/commands/push.d.ts +40 -0
  42. package/dist/commands/push.d.ts.map +1 -0
  43. package/dist/commands/push.js +94 -0
  44. package/dist/commands/push.js.map +1 -0
  45. package/dist/commands/restore.d.ts +116 -0
  46. package/dist/commands/restore.d.ts.map +1 -0
  47. package/dist/commands/restore.js +336 -0
  48. package/dist/commands/restore.js.map +1 -0
  49. package/dist/commands/service.d.ts +83 -0
  50. package/dist/commands/service.d.ts.map +1 -0
  51. package/dist/commands/service.js +259 -0
  52. package/dist/commands/service.js.map +1 -0
  53. package/dist/commands/show.d.ts +63 -0
  54. package/dist/commands/show.d.ts.map +1 -0
  55. package/dist/commands/show.js +243 -0
  56. package/dist/commands/show.js.map +1 -0
  57. package/dist/commands/status.d.ts +53 -0
  58. package/dist/commands/status.d.ts.map +1 -0
  59. package/dist/commands/status.js +150 -0
  60. package/dist/commands/status.js.map +1 -0
  61. package/dist/commands/sync.d.ts +105 -0
  62. package/dist/commands/sync.d.ts.map +1 -0
  63. package/dist/commands/sync.js +243 -0
  64. package/dist/commands/sync.js.map +1 -0
  65. package/dist/commands/team.d.ts +79 -0
  66. package/dist/commands/team.d.ts.map +1 -0
  67. package/dist/commands/team.js +233 -0
  68. package/dist/commands/team.js.map +1 -0
  69. package/dist/commands/track.d.ts +109 -0
  70. package/dist/commands/track.d.ts.map +1 -0
  71. package/dist/commands/track.js +406 -0
  72. package/dist/commands/track.js.map +1 -0
  73. package/dist/core/command-validator.d.ts +100 -0
  74. package/dist/core/command-validator.d.ts.map +1 -0
  75. package/dist/core/command-validator.js +299 -0
  76. package/dist/core/command-validator.js.map +1 -0
  77. package/dist/core/config-store.d.ts +76 -0
  78. package/dist/core/config-store.d.ts.map +1 -0
  79. package/dist/core/config-store.js +148 -0
  80. package/dist/core/config-store.js.map +1 -0
  81. package/dist/core/directories-handler.d.ts +116 -0
  82. package/dist/core/directories-handler.d.ts.map +1 -0
  83. package/dist/core/directories-handler.js +199 -0
  84. package/dist/core/directories-handler.js.map +1 -0
  85. package/dist/core/docker-handler.d.ts +183 -0
  86. package/dist/core/docker-handler.d.ts.map +1 -0
  87. package/dist/core/docker-handler.js +515 -0
  88. package/dist/core/docker-handler.js.map +1 -0
  89. package/dist/core/encryption.d.ts +79 -0
  90. package/dist/core/encryption.d.ts.map +1 -0
  91. package/dist/core/encryption.js +111 -0
  92. package/dist/core/encryption.js.map +1 -0
  93. package/dist/core/env-handler.d.ts +128 -0
  94. package/dist/core/env-handler.d.ts.map +1 -0
  95. package/dist/core/env-handler.js +272 -0
  96. package/dist/core/env-handler.js.map +1 -0
  97. package/dist/core/git-sync.d.ts +88 -0
  98. package/dist/core/git-sync.d.ts.map +1 -0
  99. package/dist/core/git-sync.js +143 -0
  100. package/dist/core/git-sync.js.map +1 -0
  101. package/dist/core/key-store.d.ts +51 -0
  102. package/dist/core/key-store.d.ts.map +1 -0
  103. package/dist/core/key-store.js +108 -0
  104. package/dist/core/key-store.js.map +1 -0
  105. package/dist/core/log-sanitizer.d.ts +72 -0
  106. package/dist/core/log-sanitizer.d.ts.map +1 -0
  107. package/dist/core/log-sanitizer.js +202 -0
  108. package/dist/core/log-sanitizer.js.map +1 -0
  109. package/dist/core/path-validator.d.ts +37 -0
  110. package/dist/core/path-validator.d.ts.map +1 -0
  111. package/dist/core/path-validator.js +127 -0
  112. package/dist/core/path-validator.js.map +1 -0
  113. package/dist/core/recipients.d.ts +99 -0
  114. package/dist/core/recipients.d.ts.map +1 -0
  115. package/dist/core/recipients.js +206 -0
  116. package/dist/core/recipients.js.map +1 -0
  117. package/dist/core/services-handler.d.ts +113 -0
  118. package/dist/core/services-handler.d.ts.map +1 -0
  119. package/dist/core/services-handler.js +176 -0
  120. package/dist/core/services-handler.js.map +1 -0
  121. package/dist/core/state-manager.d.ts +96 -0
  122. package/dist/core/state-manager.d.ts.map +1 -0
  123. package/dist/core/state-manager.js +165 -0
  124. package/dist/core/state-manager.js.map +1 -0
  125. package/dist/core/transport.d.ts +28 -0
  126. package/dist/core/transport.d.ts.map +1 -0
  127. package/dist/core/transport.js +79 -0
  128. package/dist/core/transport.js.map +1 -0
  129. package/dist/index.d.ts +20 -0
  130. package/dist/index.d.ts.map +1 -0
  131. package/dist/index.js +80 -0
  132. package/dist/index.js.map +1 -0
  133. package/dist/types/index.d.ts +5 -0
  134. package/dist/types/index.d.ts.map +1 -0
  135. package/dist/types/index.js +2 -0
  136. package/dist/types/index.js.map +1 -0
  137. package/dist/utils/errors.d.ts +81 -0
  138. package/dist/utils/errors.d.ts.map +1 -0
  139. package/dist/utils/errors.js +191 -0
  140. package/dist/utils/errors.js.map +1 -0
  141. package/dist/utils/secure-memory.d.ts +65 -0
  142. package/dist/utils/secure-memory.d.ts.map +1 -0
  143. package/dist/utils/secure-memory.js +86 -0
  144. package/dist/utils/secure-memory.js.map +1 -0
  145. package/package.json +58 -0
@@ -0,0 +1,38 @@
1
+ /**
2
+ * `ctx-sync list` command.
3
+ *
4
+ * Reads the encrypted state file, decrypts it, and lists all
5
+ * tracked projects with key metadata (name, path, branch, last accessed).
6
+ *
7
+ * @module commands/list
8
+ */
9
+ import type { Command } from 'commander';
10
+ import type { Project } from '@ctx-sync/shared';
11
+ /** Result returned by executeList */
12
+ export interface ListResult {
13
+ /** All tracked projects */
14
+ projects: Project[];
15
+ }
16
+ /**
17
+ * Execute the list command logic.
18
+ *
19
+ * 1. Load the private key.
20
+ * 2. Read and decrypt state.age.
21
+ * 3. Return the list of tracked projects.
22
+ *
23
+ * @returns List result with all tracked projects.
24
+ */
25
+ export declare function executeList(): Promise<ListResult>;
26
+ /**
27
+ * Format a project entry for display.
28
+ *
29
+ * @param project - The project to format.
30
+ * @param index - The index in the list (1-based for display).
31
+ * @returns Formatted string for console output.
32
+ */
33
+ export declare function formatProject(project: Project, index: number): string;
34
+ /**
35
+ * Register the `list` command on the given Commander program.
36
+ */
37
+ export declare function registerListCommand(program: Command): void;
38
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3D,qCAAqC;AACrC,MAAM,WAAW,UAAU;IACzB,2BAA2B;IAC3B,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC,CAYvD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAkBrE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+B1D"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * `ctx-sync list` command.
3
+ *
4
+ * Reads the encrypted state file, decrypts it, and lists all
5
+ * tracked projects with key metadata (name, path, branch, last accessed).
6
+ *
7
+ * @module commands/list
8
+ */
9
+ import { withErrorHandler } from '../utils/errors.js';
10
+ import { loadKey } from '../core/key-store.js';
11
+ import { readState } from '../core/state-manager.js';
12
+ import { getConfigDir, getSyncDir } from './init.js';
13
+ /**
14
+ * Execute the list command logic.
15
+ *
16
+ * 1. Load the private key.
17
+ * 2. Read and decrypt state.age.
18
+ * 3. Return the list of tracked projects.
19
+ *
20
+ * @returns List result with all tracked projects.
21
+ */
22
+ export async function executeList() {
23
+ const configDir = getConfigDir();
24
+ const syncDir = getSyncDir();
25
+ const privateKey = loadKey(configDir);
26
+ const state = await readState(syncDir, privateKey, 'state');
27
+ if (!state || !state.projects || state.projects.length === 0) {
28
+ return { projects: [] };
29
+ }
30
+ return { projects: state.projects };
31
+ }
32
+ /**
33
+ * Format a project entry for display.
34
+ *
35
+ * @param project - The project to format.
36
+ * @param index - The index in the list (1-based for display).
37
+ * @returns Formatted string for console output.
38
+ */
39
+ export function formatProject(project, index) {
40
+ const lines = [];
41
+ lines.push(` ${index}. ${project.name}`);
42
+ lines.push(` Path: ${project.path}`);
43
+ lines.push(` Branch: ${project.git.branch}`);
44
+ if (project.git.hasUncommitted) {
45
+ lines.push(' Status: uncommitted changes');
46
+ }
47
+ if (project.git.stashCount > 0) {
48
+ lines.push(` Stashes: ${project.git.stashCount}`);
49
+ }
50
+ const accessed = new Date(project.lastAccessed);
51
+ lines.push(` Tracked: ${accessed.toLocaleDateString()} ${accessed.toLocaleTimeString()}`);
52
+ return lines.join('\n');
53
+ }
54
+ /**
55
+ * Register the `list` command on the given Commander program.
56
+ */
57
+ export function registerListCommand(program) {
58
+ program
59
+ .command('list')
60
+ .alias('ls')
61
+ .description('List all tracked projects')
62
+ .action(withErrorHandler(async () => {
63
+ const result = await executeList();
64
+ if (result.projects.length === 0) {
65
+ console.log('No projects tracked.');
66
+ console.log('\nTrack your first project:');
67
+ console.log(' $ cd ~/projects/my-app');
68
+ console.log(' $ ctx-sync track');
69
+ return;
70
+ }
71
+ const chalk = (await import('chalk')).default;
72
+ console.log(chalk.bold(`Tracked projects (${result.projects.length}):\n`));
73
+ for (let i = 0; i < result.projects.length; i++) {
74
+ const project = result.projects[i];
75
+ if (project) {
76
+ console.log(formatProject(project, i + 1));
77
+ }
78
+ if (i < result.projects.length - 1) {
79
+ console.log('');
80
+ }
81
+ }
82
+ }));
83
+ }
84
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAQrD;;;;;;;;GAQG;A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C7C,CAAC;YACD,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * `ctx-sync note <project>` command.
3
+ *
4
+ * Records and updates mental context for a project — the "23-minute
5
+ * problem" solution. Prompts the user for current task, blockers,
6
+ * next steps, related links, and breadcrumbs, then encrypts and
7
+ * stores them in `mental-context.age`.
8
+ *
9
+ * Supports both interactive (prompt-based) and non-interactive
10
+ * (flag-based) input modes. When updating, existing context is
11
+ * merged — not overwritten — so incremental notes accumulate.
12
+ *
13
+ * @module commands/note
14
+ */
15
+ import type { Command } from 'commander';
16
+ import type { ProjectMentalContext, RelatedLink } from '@ctx-sync/shared';
17
+ /** Options for the note command */
18
+ export interface NoteOptions {
19
+ /** The current task description */
20
+ task?: string;
21
+ /** Blockers (comma-separated or repeated flag) */
22
+ blockers?: string[];
23
+ /** Next steps (comma-separated or repeated flag) */
24
+ nextSteps?: string[];
25
+ /** Related links (comma-separated) */
26
+ links?: string[];
27
+ /** Breadcrumb note */
28
+ breadcrumb?: string;
29
+ /** File being worked on (format: file:line or file:line:col) */
30
+ file?: string;
31
+ /** Description of what's being done at the file location */
32
+ fileDescription?: string;
33
+ /** Non-interactive mode: skip prompts, use flags only */
34
+ noInteractive?: boolean;
35
+ /** Skip committing/pushing to sync repo */
36
+ noSync?: boolean;
37
+ /** Override prompt function (for testing) */
38
+ promptFn?: (existing: ProjectMentalContext | null) => Promise<NoteInput>;
39
+ }
40
+ /** Raw input collected from prompts or flags */
41
+ export interface NoteInput {
42
+ currentTask?: string;
43
+ blockers?: string[];
44
+ nextSteps?: string[];
45
+ relatedLinks?: Array<{
46
+ title: string;
47
+ url: string;
48
+ }>;
49
+ breadcrumb?: string;
50
+ lastWorkingOn?: {
51
+ file: string;
52
+ line: number;
53
+ column?: number;
54
+ description: string;
55
+ };
56
+ }
57
+ /** Result of the note command */
58
+ export interface NoteResult {
59
+ /** Name of the project */
60
+ projectName: string;
61
+ /** Whether a new mental context was created (vs. update) */
62
+ isNew: boolean;
63
+ /** The final merged mental context */
64
+ context: ProjectMentalContext;
65
+ }
66
+ /**
67
+ * Parse a file reference string into structured location data.
68
+ *
69
+ * Accepts formats:
70
+ * - `file.ts` → { file: 'file.ts', line: 0 }
71
+ * - `file.ts:45` → { file: 'file.ts', line: 45 }
72
+ * - `file.ts:45:12` → { file: 'file.ts', line: 45, column: 12 }
73
+ *
74
+ * @param fileRef - The file reference string.
75
+ * @returns Parsed location, or null if the string is empty.
76
+ */
77
+ export declare function parseFileReference(fileRef: string): {
78
+ file: string;
79
+ line: number;
80
+ column?: number;
81
+ } | null;
82
+ /**
83
+ * Parse a link string into title and URL.
84
+ *
85
+ * Accepts formats:
86
+ * - `https://example.com` → { title: 'https://example.com', url: 'https://example.com' }
87
+ * - `Title: https://example.com` → { title: 'Title', url: 'https://example.com' }
88
+ * - `Title - https://example.com` → { title: 'Title', url: 'https://example.com' }
89
+ *
90
+ * @param linkStr - The link string.
91
+ * @returns Parsed link with title and URL.
92
+ */
93
+ export declare function parseLink(linkStr: string): RelatedLink;
94
+ /**
95
+ * Create a default empty mental context structure.
96
+ *
97
+ * @returns A blank ProjectMentalContext.
98
+ */
99
+ export declare function createEmptyContext(): ProjectMentalContext;
100
+ /**
101
+ * Merge new input into an existing mental context.
102
+ *
103
+ * Follows merge-not-overwrite semantics:
104
+ * - `currentTask` is replaced if new input provides one.
105
+ * - `lastWorkingOn` is replaced if new input provides one.
106
+ * - Blockers, next steps, links, and breadcrumbs are appended.
107
+ * - Duplicate blockers (by description) are skipped.
108
+ * - Duplicate links (by URL) are skipped.
109
+ *
110
+ * @param existing - The existing mental context (or null for new).
111
+ * @param input - The new input to merge.
112
+ * @returns The merged context.
113
+ */
114
+ export declare function mergeContext(existing: ProjectMentalContext | null, input: NoteInput): ProjectMentalContext;
115
+ /**
116
+ * Collect note input from interactive prompts.
117
+ *
118
+ * Shows the user their existing mental context (if any) and prompts
119
+ * for updates. Empty responses keep the existing values.
120
+ *
121
+ * @param existing - The existing mental context (or null).
122
+ * @returns The collected input.
123
+ */
124
+ export declare function collectNoteInput(existing: ProjectMentalContext | null): Promise<NoteInput>;
125
+ /**
126
+ * Build NoteInput from CLI flags (non-interactive mode).
127
+ *
128
+ * @param options - The command-line options.
129
+ * @returns The constructed note input.
130
+ */
131
+ export declare function buildInputFromFlags(options: NoteOptions): NoteInput;
132
+ /**
133
+ * Execute the note command logic.
134
+ *
135
+ * 1. Load key and decrypt existing state to find the project.
136
+ * 2. Load existing mental context (if any).
137
+ * 3. Collect new input (interactive prompts or flags).
138
+ * 4. Merge new input into existing context.
139
+ * 5. Encrypt and write `mental-context.age`.
140
+ * 6. Optionally commit to the sync repo.
141
+ *
142
+ * @param projectName - The name of the project.
143
+ * @param options - Note command options.
144
+ * @returns The note result.
145
+ */
146
+ export declare function executeNote(projectName: string, options?: NoteOptions): Promise<NoteResult>;
147
+ /**
148
+ * Register the `note` command on the given Commander program.
149
+ */
150
+ export declare function registerNoteCommand(program: Command): void;
151
+ //# sourceMappingURL=note.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../src/commands/note.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAGV,oBAAoB,EACpB,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAQ1B,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,EA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