logicstamp-context 0.8.2 → 0.8.4

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 (51) hide show
  1. package/LICENSE +21 -21
  2. package/LLM_CONTEXT.md +703 -703
  3. package/README.md +404 -459
  4. package/dist/cli/commands/clean.d.ts.map +1 -1
  5. package/dist/cli/commands/clean.js +1 -6
  6. package/dist/cli/commands/clean.js.map +1 -1
  7. package/dist/cli/commands/context/fileWriter.js +2 -2
  8. package/dist/cli/commands/context/fileWriter.js.map +1 -1
  9. package/dist/cli/commands/context/statsCalculator.d.ts +3 -2
  10. package/dist/cli/commands/context/statsCalculator.d.ts.map +1 -1
  11. package/dist/cli/commands/context/statsCalculator.js +45 -104
  12. package/dist/cli/commands/context/statsCalculator.js.map +1 -1
  13. package/dist/cli/commands/context/watchMode/watchMode.d.ts.map +1 -1
  14. package/dist/cli/commands/context/watchMode/watchMode.js +124 -39
  15. package/dist/cli/commands/context/watchMode/watchMode.js.map +1 -1
  16. package/dist/cli/commands/init.js +20 -20
  17. package/dist/cli/commands/security.js +3 -3
  18. package/dist/cli/commands/security.js.map +1 -1
  19. package/dist/cli/commands/validate.d.ts.map +1 -1
  20. package/dist/cli/commands/validate.js +1 -6
  21. package/dist/cli/commands/validate.js.map +1 -1
  22. package/dist/cli/handlers/initHandler.js +5 -5
  23. package/dist/cli/index.d.ts +6 -2
  24. package/dist/cli/index.d.ts.map +1 -1
  25. package/dist/cli/index.js +100 -96
  26. package/dist/cli/index.js.map +1 -1
  27. package/dist/cli/parser/helpText.js +570 -570
  28. package/dist/cli/validate-index.js +26 -26
  29. package/dist/core/astParser/detectors.d.ts.map +1 -1
  30. package/dist/core/astParser/detectors.js +3 -2
  31. package/dist/core/astParser/detectors.js.map +1 -1
  32. package/dist/core/pack/loader.js +3 -3
  33. package/dist/core/pack/loader.js.map +1 -1
  34. package/dist/utils/codeSanitizer.d.ts.map +1 -1
  35. package/dist/utils/codeSanitizer.js +3 -2
  36. package/dist/utils/codeSanitizer.js.map +1 -1
  37. package/dist/utils/fsx.d.ts +5 -0
  38. package/dist/utils/fsx.d.ts.map +1 -1
  39. package/dist/utils/fsx.js +9 -2
  40. package/dist/utils/fsx.js.map +1 -1
  41. package/dist/utils/git.d.ts.map +1 -1
  42. package/dist/utils/git.js +2 -1
  43. package/dist/utils/git.js.map +1 -1
  44. package/dist/utils/gitignore.d.ts.map +1 -1
  45. package/dist/utils/gitignore.js +2 -1
  46. package/dist/utils/gitignore.js.map +1 -1
  47. package/dist/utils/secretDetector.d.ts.map +1 -1
  48. package/dist/utils/secretDetector.js +17 -10
  49. package/dist/utils/secretDetector.js.map +1 -1
  50. package/package.json +85 -84
  51. package/schema/logicstamp.context.schema.json +1250 -1250
@@ -2,603 +2,603 @@
2
2
  * Help text for CLI commands
3
3
  */
4
4
  export function getMainHelp() {
5
- return `
6
- ╭─────────────────────────────────────────────────╮
7
- │ Stamp - The Context Compiler for TypeScript │
8
- │ Compile code into deterministic contracts │
9
- ╰─────────────────────────────────────────────────╯
10
-
11
- USAGE:
12
- stamp init [path] Initialize LogicStamp in a project
13
- stamp context [path] [options] Compile context
14
- stamp context style [path] [options] Compile context with style metadata
15
- stamp context validate [file] Validate context file
16
- stamp context compare [options] Detect drift (auto-compiles fresh context)
17
- stamp context clean [path] [options] Remove all compiled context artifacts
18
- stamp ignore <path> [path2] ... Add files/folders to .stampignore
19
- stamp security scan [path] [options] Scan for secrets and compile report
20
- stamp security --hard-reset [options] Delete security report
21
-
22
- OPTIONS:
23
- -v, --version Show version number
24
- -h, --help Show this help
25
-
26
- EXAMPLES:
27
- stamp init
28
- Set up LogicStamp in current directory (creates/updates .gitignore)
29
-
30
- stamp context
31
- Compile context.json for current directory
32
-
33
- stamp context style
34
- Compile context with style metadata (Tailwind, SCSS, animations, layout)
35
-
36
- stamp context --include-style
37
- Same as 'stamp context style' (alternative syntax)
38
-
39
- stamp context validate
40
- Validate context.json in current directory
41
-
42
- stamp context compare
43
- Auto-detect drift by comparing with fresh context
44
-
45
- stamp context clean
46
- Show what would be removed (dry run)
47
-
48
- stamp context clean --all --yes
49
- Actually delete all context artifacts
50
-
51
- stamp ignore src/secrets.ts
52
- Add a file to .stampignore
53
-
54
- For detailed help on a specific command, run:
55
- stamp init --help
56
- stamp context --help
57
- stamp context style --help
58
- stamp context validate --help
59
- stamp context compare --help
60
- stamp context clean --help
61
- stamp ignore --help
62
- stamp security scan --help
63
- stamp security --help
5
+ return `
6
+ ╭─────────────────────────────────────────────────╮
7
+ │ Stamp - The Context Compiler for TypeScript │
8
+ │ Compile code into deterministic contracts │
9
+ ╰─────────────────────────────────────────────────╯
10
+
11
+ USAGE:
12
+ stamp init [path] Initialize LogicStamp in a project
13
+ stamp context [path] [options] Compile context
14
+ stamp context style [path] [options] Compile context with style metadata
15
+ stamp context validate [file] Validate context file
16
+ stamp context compare [options] Detect drift (auto-compiles fresh context)
17
+ stamp context clean [path] [options] Remove all compiled context artifacts
18
+ stamp ignore <path> [path2] ... Add files/folders to .stampignore
19
+ stamp security scan [path] [options] Scan for secrets and compile report
20
+ stamp security --hard-reset [options] Delete security report
21
+
22
+ OPTIONS:
23
+ -v, --version Show version number
24
+ -h, --help Show this help
25
+
26
+ EXAMPLES:
27
+ stamp init
28
+ Set up LogicStamp in current directory (creates/updates .gitignore)
29
+
30
+ stamp context
31
+ Compile context.json for current directory
32
+
33
+ stamp context style
34
+ Compile context with style metadata (Tailwind, SCSS, animations, layout)
35
+
36
+ stamp context --include-style
37
+ Same as 'stamp context style' (alternative syntax)
38
+
39
+ stamp context validate
40
+ Validate context.json in current directory
41
+
42
+ stamp context compare
43
+ Auto-detect drift by comparing with fresh context
44
+
45
+ stamp context clean
46
+ Show what would be removed (dry run)
47
+
48
+ stamp context clean --all --yes
49
+ Actually delete all context artifacts
50
+
51
+ stamp ignore src/secrets.ts
52
+ Add a file to .stampignore
53
+
54
+ For detailed help on a specific command, run:
55
+ stamp init --help
56
+ stamp context --help
57
+ stamp context style --help
58
+ stamp context validate --help
59
+ stamp context compare --help
60
+ stamp context clean --help
61
+ stamp ignore --help
62
+ stamp security scan --help
63
+ stamp security --help
64
64
  `;
65
65
  }
66
66
  export function getSecurityHelp() {
67
- return `
68
- ╭─────────────────────────────────────────────────╮
69
- │ Stamp Security - Security Management │
70
- │ Manage security scans and configuration │
71
- ╰─────────────────────────────────────────────────╯
72
-
73
- USAGE:
74
- stamp security scan [path] [options] Scan for secrets and compile report
75
- stamp security --hard-reset [path] [options] Delete security report
76
-
77
- COMMANDS:
78
- scan Scan codebase for exposed secrets
79
- --hard-reset Delete security report file
80
- --hard-reset --force Delete report file without prompting
81
-
82
- OPTIONS:
83
- --out, -o <file> Output file for scan (default: stamp_security_report.json)
84
- --force Skip confirmation prompt (use with --hard-reset)
85
- --quiet, -q Suppress verbose output
86
- -h, --help Show this help
87
-
88
- EXAMPLES:
89
- stamp security scan
90
- Scan current directory for secrets
91
-
92
- stamp security scan ./src
93
- Scan specific directory
94
-
95
- stamp security --hard-reset
96
- Delete security report (with confirmation)
97
-
98
- stamp security --hard-reset --force
99
- Delete security report (no confirmation)
100
-
101
- stamp security --hard-reset --out custom-report.json
102
- Delete custom report file
103
-
104
- For detailed help on scan command:
105
- stamp security scan --help
67
+ return `
68
+ ╭─────────────────────────────────────────────────╮
69
+ │ Stamp Security - Security Management │
70
+ │ Manage security scans and configuration │
71
+ ╰─────────────────────────────────────────────────╯
72
+
73
+ USAGE:
74
+ stamp security scan [path] [options] Scan for secrets and compile report
75
+ stamp security --hard-reset [path] [options] Delete security report
76
+
77
+ COMMANDS:
78
+ scan Scan codebase for exposed secrets
79
+ --hard-reset Delete security report file
80
+ --hard-reset --force Delete report file without prompting
81
+
82
+ OPTIONS:
83
+ --out, -o <file> Output file for scan (default: stamp_security_report.json)
84
+ --force Skip confirmation prompt (use with --hard-reset)
85
+ --quiet, -q Suppress verbose output
86
+ -h, --help Show this help
87
+
88
+ EXAMPLES:
89
+ stamp security scan
90
+ Scan current directory for secrets
91
+
92
+ stamp security scan ./src
93
+ Scan specific directory
94
+
95
+ stamp security --hard-reset
96
+ Delete security report (with confirmation)
97
+
98
+ stamp security --hard-reset --force
99
+ Delete security report (no confirmation)
100
+
101
+ stamp security --hard-reset --out custom-report.json
102
+ Delete custom report file
103
+
104
+ For detailed help on scan command:
105
+ stamp security scan --help
106
106
  `;
107
107
  }
108
108
  export function getStyleHelp() {
109
- return `
110
- ╭─────────────────────────────────────────────────╮
111
- │ Stamp Context Style - Compile with Style │
112
- │ Compile context with style metadata │
113
- │ (Tailwind, SCSS, animations, layout) │
114
- ╰─────────────────────────────────────────────────╯
115
-
116
- USAGE:
117
- stamp context style [path] [options]
118
-
119
- ARGUMENTS:
120
- [path] Directory to scan (default: current)
121
-
122
- OPTIONS:
123
- --style-mode <mode> Style output: lean|full (default: lean)
124
- lean: counts + flags (compact)
125
- full: arrays + details (verbose)
126
- --depth, -d <n> Dependency depth (default: 2)
127
- --include-code, -c <mode> Code inclusion: none|header|full (default: header)
128
- --format, -f <format> Output format: json|pretty|ndjson|toon (default: json)
129
- --out, -o <file> Output file (default: context.json)
130
- --max-nodes, -m <n> Max nodes per bundle (default: 100)
131
- --profile <profile> Preset profile: llm-safe|llm-chat|ci-strict|watch-fast
132
- watch-fast: Fast watch mode (lighter style extraction)
133
- --strict, -s Fail on missing dependencies
134
- --strict-missing Exit with error if any missing dependencies
135
- --predict-behavior Include behavior predictions
136
- --dry-run Skip writing output
137
- --stats Emit JSON stats
138
- --compare-modes Show detailed mode comparison table
139
- --skip-gitignore Skip .gitignore setup (never prompt or modify)
140
- --quiet, -q Suppress verbose output (show only errors)
141
- --verbose Show detailed bundle output (checkmarks for each file)
142
- --watch, -w Watch for file changes and recompile automatically
143
- Tip: Pass a subdirectory path to watch only that folder
144
- --strict-watch Enable strict watch mode - automatically enables watch
145
- mode and tracks breaking changes and violations.
146
- Exits with code 1 if errors detected. Reports saved
147
- to .logicstamp/
148
- --debug Show detailed hash information in watch mode
149
- -h, --help Show this help
150
-
151
- STYLE METADATA EXTRACTED:
152
- • Styling Sources: Tailwind, SCSS modules, CSS modules, inline styles, styled-components
153
- • Layout: Flex/grid patterns, hero sections, feature cards
154
- • Visual: Colors, spacing, typography, border radius
155
- • Animation: Framer Motion, CSS animations, scroll triggers
156
-
157
- EXAMPLES:
158
- stamp context style
159
- Compile context with style metadata for current directory
160
-
161
- stamp context style ./src
162
- Compile with style metadata for src directory
163
-
164
- stamp context style --profile llm-safe
165
- Use conservative profile with style metadata
166
-
167
- stamp context style --watch
168
- Watch for file changes and recompile with style metadata
169
-
170
- stamp context style --watch --debug
171
- Watch mode with detailed hash information
172
-
173
- stamp context style ./src/components/MyFeature --watch
174
- Watch only files in a specific subdirectory (incremental rebuilds are fast!)
175
-
176
- stamp context style --strict-watch
177
- Watch mode with violation tracking for breaking changes
178
- (Equivalent to: stamp context style --watch --strict-watch)
179
-
180
- NOTES:
181
- • This is equivalent to: stamp context --include-style
182
- • Style extraction is optional and won't fail the build if errors occur
183
- • Style metadata is added to the 'style' field in UIFContract
109
+ return `
110
+ ╭─────────────────────────────────────────────────╮
111
+ │ Stamp Context Style - Compile with Style │
112
+ │ Compile context with style metadata │
113
+ │ (Tailwind, SCSS, animations, layout) │
114
+ ╰─────────────────────────────────────────────────╯
115
+
116
+ USAGE:
117
+ stamp context style [path] [options]
118
+
119
+ ARGUMENTS:
120
+ [path] Directory to scan (default: current)
121
+
122
+ OPTIONS:
123
+ --style-mode <mode> Style output: lean|full (default: lean)
124
+ lean: counts + flags (compact)
125
+ full: arrays + details (verbose)
126
+ --depth, -d <n> Dependency depth (default: 2)
127
+ --include-code, -c <mode> Code inclusion: none|header|full (default: header)
128
+ --format, -f <format> Output format: json|pretty|ndjson|toon (default: json)
129
+ --out, -o <file> Output file (default: context.json)
130
+ --max-nodes, -m <n> Max nodes per bundle (default: 100)
131
+ --profile <profile> Preset profile: llm-safe|llm-chat|ci-strict|watch-fast
132
+ watch-fast: Fast watch mode (lighter style extraction)
133
+ --strict, -s Fail on missing dependencies
134
+ --strict-missing Exit with error if any missing dependencies
135
+ --predict-behavior Include behavior predictions
136
+ --dry-run Skip writing output
137
+ --stats Emit JSON stats
138
+ --compare-modes Show detailed mode comparison table
139
+ --skip-gitignore Skip .gitignore setup (never prompt or modify)
140
+ --quiet, -q Suppress verbose output (show only errors)
141
+ --verbose Show detailed bundle output (checkmarks for each file)
142
+ --watch, -w Watch for file changes and recompile automatically
143
+ Tip: Pass a subdirectory path to watch only that folder
144
+ --strict-watch Enable strict watch mode - automatically enables watch
145
+ mode and tracks breaking changes and violations.
146
+ Exits with code 1 if errors detected. Reports saved
147
+ to .logicstamp/
148
+ --debug Show detailed hash information in watch mode
149
+ -h, --help Show this help
150
+
151
+ STYLE METADATA EXTRACTED:
152
+ • Styling Sources: Tailwind, SCSS modules, CSS modules, inline styles, styled-components
153
+ • Layout: Flex/grid patterns, hero sections, feature cards
154
+ • Visual: Colors, spacing, typography, border radius
155
+ • Animation: Framer Motion, CSS animations, scroll triggers
156
+
157
+ EXAMPLES:
158
+ stamp context style
159
+ Compile context with style metadata for current directory
160
+
161
+ stamp context style ./src
162
+ Compile with style metadata for src directory
163
+
164
+ stamp context style --profile llm-safe
165
+ Use conservative profile with style metadata
166
+
167
+ stamp context style --watch
168
+ Watch for file changes and recompile with style metadata
169
+
170
+ stamp context style --watch --debug
171
+ Watch mode with detailed hash information
172
+
173
+ stamp context style ./src/components/MyFeature --watch
174
+ Watch only files in a specific subdirectory (incremental rebuilds are fast!)
175
+
176
+ stamp context style --strict-watch
177
+ Watch mode with violation tracking for breaking changes
178
+ (Equivalent to: stamp context style --watch --strict-watch)
179
+
180
+ NOTES:
181
+ • This is equivalent to: stamp context --include-style
182
+ • Style extraction is optional and won't fail the build if errors occur
183
+ • Style metadata is added to the 'style' field in UIFContract
184
184
  `;
185
185
  }
186
186
  export function getGenerateHelp() {
187
- return `
188
- ╭─────────────────────────────────────────────────╮
189
- │ Stamp Context - Compile Architectural Context │
190
- │ Deterministic contracts from TypeScript │
191
- ╰─────────────────────────────────────────────────╯
192
-
193
- USAGE:
194
- stamp context [path] [options]
195
-
196
- ARGUMENTS:
197
- [path] Directory to scan (default: current)
198
-
199
- OPTIONS:
200
- --depth, -d <n> Dependency depth (default: 2)
201
- --include-code, -c <mode> Code inclusion: none|header|full (default: header)
202
- --include-style Extract style metadata (Tailwind, SCSS, animations, layout)
203
- --style-mode <mode> Style output: lean|full (default: lean)
204
- lean: counts + flags (compact)
205
- full: arrays + details (verbose)
206
- --format, -f <format> Output format: json|pretty|ndjson|toon (default: json)
207
- --out, -o <file> Output file (default: context.json)
208
- --max-nodes, -m <n> Max nodes per bundle (default: 100)
209
- --profile <profile> Preset profile: llm-safe|llm-chat|ci-strict|watch-fast
210
- watch-fast: Fast watch mode (lighter style extraction)
211
- --strict, -s Fail on missing dependencies
212
- --strict-missing Exit with error if any missing dependencies
213
- --predict-behavior Include behavior predictions
214
- --dry-run Skip writing output
215
- --stats Emit JSON stats
216
- --compare-modes Show detailed mode comparison table
217
- --skip-gitignore Skip .gitignore setup (never prompt or modify)
218
- --quiet, -q Suppress verbose output (show only errors)
219
- --verbose Show detailed bundle output (checkmarks for each file)
220
- --watch, -w Watch for file changes and recompile automatically
221
- --strict-watch Enable strict watch mode - automatically enables watch
222
- mode and tracks breaking changes and violations.
223
- Exits with code 1 if errors detected. Reports saved
224
- to .logicstamp/
225
- --debug Show detailed hash information in watch mode
226
- -h, --help Show this help
227
-
228
- EXAMPLES:
229
- stamp context
230
- Compile context for current directory
231
-
232
- stamp context style
233
- Compile context with style metadata (Tailwind, SCSS, animations, layout)
234
-
235
- stamp context --include-style
236
- Alternative syntax for including style metadata
237
-
238
- stamp context ./src --depth 2
239
- Compile src directory with depth 2
240
-
241
- stamp context --include-code none --out api.json
242
- Compile contracts only (no code)
243
-
244
- stamp context --compare-modes
245
- Show token cost comparison across modes
246
-
247
- stamp context --watch
248
- Watch for file changes and recompile automatically
249
-
250
- stamp context --watch --debug
251
- Watch mode with detailed hash information
252
-
253
- stamp context ./src/components/MyFeature --watch
254
- Watch only files in a specific subdirectory (incremental recompilation)
255
-
256
- stamp context --strict-watch
257
- Watch mode with violation tracking - reports breaking changes
258
- (removed props, events, functions) and missing dependencies.
259
- Exits with code 1 if errors detected during session.
260
- (Equivalent to: stamp context --watch --strict-watch)
261
-
262
- stamp context --quiet
263
- Suppress verbose output (show only errors)
187
+ return `
188
+ ╭─────────────────────────────────────────────────╮
189
+ │ Stamp Context - Compile Architectural Context │
190
+ │ Deterministic contracts from TypeScript │
191
+ ╰─────────────────────────────────────────────────╯
192
+
193
+ USAGE:
194
+ stamp context [path] [options]
195
+
196
+ ARGUMENTS:
197
+ [path] Directory to scan (default: current)
198
+
199
+ OPTIONS:
200
+ --depth, -d <n> Dependency depth (default: 2)
201
+ --include-code, -c <mode> Code inclusion: none|header|full (default: header)
202
+ --include-style Extract style metadata (Tailwind, SCSS, animations, layout)
203
+ --style-mode <mode> Style output: lean|full (default: lean)
204
+ lean: counts + flags (compact)
205
+ full: arrays + details (verbose)
206
+ --format, -f <format> Output format: json|pretty|ndjson|toon (default: json)
207
+ --out, -o <file> Output file (default: context.json)
208
+ --max-nodes, -m <n> Max nodes per bundle (default: 100)
209
+ --profile <profile> Preset profile: llm-safe|llm-chat|ci-strict|watch-fast
210
+ watch-fast: Fast watch mode (lighter style extraction)
211
+ --strict, -s Fail on missing dependencies
212
+ --strict-missing Exit with error if any missing dependencies
213
+ --predict-behavior Include behavior predictions
214
+ --dry-run Skip writing output
215
+ --stats Emit JSON stats
216
+ --compare-modes Show detailed mode comparison table
217
+ --skip-gitignore Skip .gitignore setup (never prompt or modify)
218
+ --quiet, -q Suppress verbose output (show only errors)
219
+ --verbose Show detailed bundle output (checkmarks for each file)
220
+ --watch, -w Watch for file changes and recompile automatically
221
+ --strict-watch Enable strict watch mode - automatically enables watch
222
+ mode and tracks breaking changes and violations.
223
+ Exits with code 1 if errors detected. Reports saved
224
+ to .logicstamp/
225
+ --debug Show detailed hash information in watch mode
226
+ -h, --help Show this help
227
+
228
+ EXAMPLES:
229
+ stamp context
230
+ Compile context for current directory
231
+
232
+ stamp context style
233
+ Compile context with style metadata (Tailwind, SCSS, animations, layout)
234
+
235
+ stamp context --include-style
236
+ Alternative syntax for including style metadata
237
+
238
+ stamp context ./src --depth 2
239
+ Compile src directory with depth 2
240
+
241
+ stamp context --include-code none --out api.json
242
+ Compile contracts only (no code)
243
+
244
+ stamp context --compare-modes
245
+ Show token cost comparison across modes
246
+
247
+ stamp context --watch
248
+ Watch for file changes and recompile automatically
249
+
250
+ stamp context --watch --debug
251
+ Watch mode with detailed hash information
252
+
253
+ stamp context ./src/components/MyFeature --watch
254
+ Watch only files in a specific subdirectory (incremental recompilation)
255
+
256
+ stamp context --strict-watch
257
+ Watch mode with violation tracking - reports breaking changes
258
+ (removed props, events, functions) and missing dependencies.
259
+ Exits with code 1 if errors detected during session.
260
+ (Equivalent to: stamp context --watch --strict-watch)
261
+
262
+ stamp context --quiet
263
+ Suppress verbose output (show only errors)
264
264
  `;
265
265
  }
266
266
  export function getValidateHelp() {
267
- return `
268
- ╭─────────────────────────────────────────────────╮
269
- │ Stamp Context Validate - Bundle Validator │
270
- │ Validate context.json structure and schema │
271
- ╰─────────────────────────────────────────────────╯
272
-
273
- USAGE:
274
- stamp context validate [file]
275
-
276
- ARGUMENTS:
277
- [file] Path to context.json (default: context.json)
278
-
279
- OPTIONS:
280
- --quiet Show only errors (suppress summaries and valid folders)
281
- -h, --help Show this help
282
-
283
- EXAMPLES:
284
- stamp context validate
285
- Validate context.json in current directory
286
-
287
- stamp context validate docs/api-context.json
288
- Validate a specific context file
289
-
290
- stamp context validate --quiet
291
- Show only validation errors
292
-
293
- NOTES:
294
- • Validates bundle structure and schema compliance
295
- • Checks for required fields and hash formats
296
- • Exits with code 0 on success, 1 on failure
267
+ return `
268
+ ╭─────────────────────────────────────────────────╮
269
+ │ Stamp Context Validate - Bundle Validator │
270
+ │ Validate context.json structure and schema │
271
+ ╰─────────────────────────────────────────────────╯
272
+
273
+ USAGE:
274
+ stamp context validate [file]
275
+
276
+ ARGUMENTS:
277
+ [file] Path to context.json (default: context.json)
278
+
279
+ OPTIONS:
280
+ --quiet Show only errors (suppress summaries and valid folders)
281
+ -h, --help Show this help
282
+
283
+ EXAMPLES:
284
+ stamp context validate
285
+ Validate context.json in current directory
286
+
287
+ stamp context validate docs/api-context.json
288
+ Validate a specific context file
289
+
290
+ stamp context validate --quiet
291
+ Show only validation errors
292
+
293
+ NOTES:
294
+ • Validates bundle structure and schema compliance
295
+ • Checks for required fields and hash formats
296
+ • Exits with code 0 on success, 1 on failure
297
297
  `;
298
298
  }
299
299
  export function getCompareHelp() {
300
- return `
301
- ╭─────────────────────────────────────────────────╮
302
- │ Stamp Context Compare - Drift Detection │
303
- │ Compare context files for changes │
304
- ╰─────────────────────────────────────────────────╯
305
-
306
- USAGE:
307
- stamp context compare [options] Auto-compare all context files
308
- stamp context compare <old.json> <new.json> Compare two specific files
309
- stamp context compare <old_main.json> <new_main.json> Compare multi-file indices
310
-
311
- ARGUMENTS:
312
- <old.json> Path to old context file or context_main.json
313
- <new.json> Path to new context file or context_main.json
314
-
315
- OPTIONS:
316
- --baseline <ref> Compare against a git ref (e.g., git:main, git:HEAD, git:v1.0.0)
317
- --approve Auto-approve updates (non-interactive, CI-safe)
318
- --clean-orphaned Auto-delete orphaned files with --approve
319
- --stats Show token count statistics per folder
320
- --strict Detect breaking changes (removed props, events, functions)
321
- and exit with code 1 if errors found
322
- --skip-gitignore Skip .gitignore setup when compiling fresh context (auto-mode only)
323
- --quiet Show only diffs (suppress summaries, PASS folders, and token analysis)
324
- -h, --help Show this help
325
-
326
- COMPARISON MODES:
327
- Auto-Mode (Multi-File):
328
- Compares ALL context files using context_main.json as index
329
- → Detects ADDED, ORPHANED, DRIFT, and PASS status per folder
330
- → Shows three-tier output: folder summary, component summary, details
331
-
332
- Git Baseline Mode:
333
- Compare current working tree against a git ref (branch, tag, commit)
334
- → Uses git worktree to checkout ref in isolation
335
- → Generates context for both versions and compares
336
- → Useful for PR reviews, CI validation, and release checks
337
-
338
- Single-File Mode:
339
- Compares two individual context.json files
340
- → Detects added/removed/changed components
341
-
342
- Multi-File Manual Mode:
343
- Auto-detects when comparing context_main.json files
344
- → Compares all referenced context files
345
-
346
- EXAMPLES:
347
- stamp context compare
348
- Auto-mode: compile fresh context, compare ALL files
349
- → Shows folder-level and component-level changes
350
- → Interactive: prompts Y/N to update if drift detected
351
- → CI: exits with code 1 if drift detected (no prompt)
352
-
353
- stamp context compare --approve
354
- Auto-approve and update ALL context files if drift (like jest -u)
355
-
356
- stamp context compare --approve --clean-orphaned
357
- Auto-approve updates and delete orphaned context files
358
-
359
- stamp context compare --stats
360
- Show per-folder token count deltas
361
-
362
- stamp context compare --quiet
363
- Show only diffs (suppress summaries, PASS folders, and status headers)
364
-
365
- stamp context compare old.json new.json
366
- Compare two specific context files
367
-
368
- stamp context compare old/context_main.json new/context_main.json
369
- Compare all context files between two directories
370
-
371
- stamp context compare || exit 1
372
- CI validation: fail build if drift detected
373
-
374
- stamp context compare --baseline git:main
375
- Compare current working tree against main branch
376
- → "What changed in this branch vs main?"
377
-
378
- stamp context compare --baseline git:HEAD
379
- Compare uncommitted changes against last commit
380
-
381
- stamp context compare --baseline git:v1.0.0
382
- Compare against a release tag
383
- → "What changed since last release?"
384
-
385
- stamp context compare --strict
386
- Detect breaking changes and fail if errors found
387
- → Exit code 1 if removed props, events, or functions detected
388
-
389
- stamp context compare --baseline git:main --strict
390
- Compare against main with breaking change detection
391
-
392
- EXIT CODES:
393
- 0 PASS - No drift OR drift approved and updated
394
- 1 DRIFT - Changes detected but not approved
395
-
396
- BEHAVIOR:
397
- • --approve: Non-interactive, deterministic, updates immediately if drift
398
- • Interactive (TTY): Prompts "Update all context files? (y/N)" if drift
399
- • CI (non-TTY): Never prompts, exits 1 if drift detected
400
- • --clean-orphaned: Requires --approve, deletes orphaned files automatically
401
- • --quiet: Shows only diffs - suppresses status headers (PASS), summaries, PASS folders, and token analysis
402
-
403
- DRIFT INDICATORS:
404
- ➕ ADDED FILE New folder with context file
405
- 🗑️ ORPHANED FILE Folder removed (context file still exists)
406
- ⚠️ DRIFT Folder has component changes
407
- ✅ PASS Folder unchanged
408
-
409
- NOTES:
410
- This matches Jest snapshot workflow:
411
- jest → prompts to update snapshots locally
412
- jest -u → updates snapshots without prompt
413
- CI → fails if snapshots don't match
300
+ return `
301
+ ╭─────────────────────────────────────────────────╮
302
+ │ Stamp Context Compare - Drift Detection │
303
+ │ Compare context files for changes │
304
+ ╰─────────────────────────────────────────────────╯
305
+
306
+ USAGE:
307
+ stamp context compare [options] Auto-compare all context files
308
+ stamp context compare <old.json> <new.json> Compare two specific files
309
+ stamp context compare <old_main.json> <new_main.json> Compare multi-file indices
310
+
311
+ ARGUMENTS:
312
+ <old.json> Path to old context file or context_main.json
313
+ <new.json> Path to new context file or context_main.json
314
+
315
+ OPTIONS:
316
+ --baseline <ref> Compare against a git ref (e.g., git:main, git:HEAD, git:v1.0.0)
317
+ --approve Auto-approve updates (non-interactive, CI-safe)
318
+ --clean-orphaned Auto-delete orphaned files with --approve
319
+ --stats Show token count statistics per folder
320
+ --strict Detect breaking changes (removed props, events, functions)
321
+ and exit with code 1 if errors found
322
+ --skip-gitignore Skip .gitignore setup when compiling fresh context (auto-mode only)
323
+ --quiet Show only diffs (suppress summaries, PASS folders, and token analysis)
324
+ -h, --help Show this help
325
+
326
+ COMPARISON MODES:
327
+ Auto-Mode (Multi-File):
328
+ Compares ALL context files using context_main.json as index
329
+ → Detects ADDED, ORPHANED, DRIFT, and PASS status per folder
330
+ → Shows three-tier output: folder summary, component summary, details
331
+
332
+ Git Baseline Mode:
333
+ Compare current working tree against a git ref (branch, tag, commit)
334
+ → Uses git worktree to checkout ref in isolation
335
+ → Generates context for both versions and compares
336
+ → Useful for PR reviews, CI validation, and release checks
337
+
338
+ Single-File Mode:
339
+ Compares two individual context.json files
340
+ → Detects added/removed/changed components
341
+
342
+ Multi-File Manual Mode:
343
+ Auto-detects when comparing context_main.json files
344
+ → Compares all referenced context files
345
+
346
+ EXAMPLES:
347
+ stamp context compare
348
+ Auto-mode: compile fresh context, compare ALL files
349
+ → Shows folder-level and component-level changes
350
+ → Interactive: prompts Y/N to update if drift detected
351
+ → CI: exits with code 1 if drift detected (no prompt)
352
+
353
+ stamp context compare --approve
354
+ Auto-approve and update ALL context files if drift (like jest -u)
355
+
356
+ stamp context compare --approve --clean-orphaned
357
+ Auto-approve updates and delete orphaned context files
358
+
359
+ stamp context compare --stats
360
+ Show per-folder token count deltas
361
+
362
+ stamp context compare --quiet
363
+ Show only diffs (suppress summaries, PASS folders, and status headers)
364
+
365
+ stamp context compare old.json new.json
366
+ Compare two specific context files
367
+
368
+ stamp context compare old/context_main.json new/context_main.json
369
+ Compare all context files between two directories
370
+
371
+ stamp context compare || exit 1
372
+ CI validation: fail build if drift detected
373
+
374
+ stamp context compare --baseline git:main
375
+ Compare current working tree against main branch
376
+ → "What changed in this branch vs main?"
377
+
378
+ stamp context compare --baseline git:HEAD
379
+ Compare uncommitted changes against last commit
380
+
381
+ stamp context compare --baseline git:v1.0.0
382
+ Compare against a release tag
383
+ → "What changed since last release?"
384
+
385
+ stamp context compare --strict
386
+ Detect breaking changes and fail if errors found
387
+ → Exit code 1 if removed props, events, or functions detected
388
+
389
+ stamp context compare --baseline git:main --strict
390
+ Compare against main with breaking change detection
391
+
392
+ EXIT CODES:
393
+ 0 PASS - No drift OR drift approved and updated
394
+ 1 DRIFT - Changes detected but not approved
395
+
396
+ BEHAVIOR:
397
+ • --approve: Non-interactive, deterministic, updates immediately if drift
398
+ • Interactive (TTY): Prompts "Update all context files? (y/N)" if drift
399
+ • CI (non-TTY): Never prompts, exits 1 if drift detected
400
+ • --clean-orphaned: Requires --approve, deletes orphaned files automatically
401
+ • --quiet: Shows only diffs - suppresses status headers (PASS), summaries, PASS folders, and token analysis
402
+
403
+ DRIFT INDICATORS:
404
+ ➕ ADDED FILE New folder with context file
405
+ 🗑️ ORPHANED FILE Folder removed (context file still exists)
406
+ ⚠️ DRIFT Folder has component changes
407
+ ✅ PASS Folder unchanged
408
+
409
+ NOTES:
410
+ This matches Jest snapshot workflow:
411
+ jest → prompts to update snapshots locally
412
+ jest -u → updates snapshots without prompt
413
+ CI → fails if snapshots don't match
414
414
  `;
415
415
  }
416
416
  export function getCleanHelp() {
417
- return `
418
- ╭─────────────────────────────────────────────────╮
419
- │ Stamp Context Clean - Remove Artifacts │
420
- │ Delete all compiled context files │
421
- ╰─────────────────────────────────────────────────╯
422
-
423
- USAGE:
424
- stamp context clean [path] [options]
425
-
426
- ARGUMENTS:
427
- [path] Directory to clean (default: current)
428
-
429
- OPTIONS:
430
- --all Include all context files
431
- --yes Confirm deletion (required with --all)
432
- --quiet, -q Suppress verbose output (show only errors)
433
- -h, --help Show this help
434
-
435
- BEHAVIOR:
436
- • Default (dry run): Shows what would be removed
437
- • --all --yes: Actually deletes the files
438
- • Automatically includes .logicstamp/ directory if it exists
439
- • --quiet: Shows only ✓ on success, errors otherwise
440
-
441
- FILES REMOVED:
442
- • context_main.json Main index file
443
- • **/context.json All folder context files
444
- • **/context.toon All folder TOON format bundles
445
- • **/context_*.toon TOON format variants
446
- • .logicstamp/ Cache directory (if present)
447
-
448
- EXAMPLES:
449
- stamp context clean
450
- Show what would be removed (dry run)
451
-
452
- stamp context clean --all --yes
453
- Actually delete all context artifacts (includes .logicstamp/ if present)
454
-
455
- stamp context clean --all --yes --quiet
456
- Delete files silently (show only ✓)
457
-
458
- stamp context clean ./src --all --yes
459
- Clean context files in specific directory
460
-
461
- NOTES:
462
- • Safe by default - requires --all --yes to actually delete
463
- • Ignores node_modules, dist, build, .next directories
464
- • Exits with code 0 on success
417
+ return `
418
+ ╭─────────────────────────────────────────────────╮
419
+ │ Stamp Context Clean - Remove Artifacts │
420
+ │ Delete all compiled context files │
421
+ ╰─────────────────────────────────────────────────╯
422
+
423
+ USAGE:
424
+ stamp context clean [path] [options]
425
+
426
+ ARGUMENTS:
427
+ [path] Directory to clean (default: current)
428
+
429
+ OPTIONS:
430
+ --all Include all context files
431
+ --yes Confirm deletion (required with --all)
432
+ --quiet, -q Suppress verbose output (show only errors)
433
+ -h, --help Show this help
434
+
435
+ BEHAVIOR:
436
+ • Default (dry run): Shows what would be removed
437
+ • --all --yes: Actually deletes the files
438
+ • Automatically includes .logicstamp/ directory if it exists
439
+ • --quiet: Shows only ✓ on success, errors otherwise
440
+
441
+ FILES REMOVED:
442
+ • context_main.json Main index file
443
+ • **/context.json All folder context files
444
+ • **/context.toon All folder TOON format bundles
445
+ • **/context_*.toon TOON format variants
446
+ • .logicstamp/ Cache directory (if present)
447
+
448
+ EXAMPLES:
449
+ stamp context clean
450
+ Show what would be removed (dry run)
451
+
452
+ stamp context clean --all --yes
453
+ Actually delete all context artifacts (includes .logicstamp/ if present)
454
+
455
+ stamp context clean --all --yes --quiet
456
+ Delete files silently (show only ✓)
457
+
458
+ stamp context clean ./src --all --yes
459
+ Clean context files in specific directory
460
+
461
+ NOTES:
462
+ • Safe by default - requires --all --yes to actually delete
463
+ • Ignores node_modules, dist, build, .next directories
464
+ • Exits with code 0 on success
465
465
  `;
466
466
  }
467
467
  export function getInitHelp() {
468
- return `
469
- ╭─────────────────────────────────────────────────╮
470
- │ Stamp Init - Initialize LogicStamp │
471
- │ Set up LogicStamp in your project │
472
- ╰─────────────────────────────────────────────────╯
473
-
474
- USAGE:
475
- stamp init [path] [options]
476
-
477
- ARGUMENTS:
478
- [path] Target directory (default: current)
479
-
480
- OPTIONS:
481
- --skip-gitignore Skip .gitignore setup
482
- --yes, -y Explicitly skip prompts (non-interactive; default behavior)
483
- --no-secure Skip security scan (enables interactive prompts in TTY)
484
- -h, --help Show this help
485
-
486
- EXAMPLES:
487
- stamp init
488
- Set up LogicStamp in current directory (non-interactive, runs security scan by default)
489
-
490
- stamp init ./my-project
491
- Set up LogicStamp in a specific directory (non-interactive, runs security scan by default)
492
-
493
- stamp init --skip-gitignore
494
- Initialize without modifying .gitignore (security scan still runs)
495
-
496
- stamp init --yes
497
- Explicitly skip prompts (redundant - already non-interactive by default)
498
-
499
- stamp init --no-secure
500
- Initialize without security scan (enables interactive prompts in TTY mode)
501
-
502
- WHAT IT DOES:
503
- • Creates or updates .gitignore with LogicStamp patterns:
504
- - context.json
505
- - context_*.json
506
- - context.toon
507
- - context_*.toon
508
- - *.uif.json
509
- - logicstamp.manifest.json
510
- - .logicstamp/
511
- - stamp_security_report.json
512
-
513
- NOTES:
514
- • Safe to run multiple times (idempotent)
515
- • Won't duplicate patterns if they already exist
516
- • Creates .gitignore if it doesn't exist
468
+ return `
469
+ ╭─────────────────────────────────────────────────╮
470
+ │ Stamp Init - Initialize LogicStamp │
471
+ │ Set up LogicStamp in your project │
472
+ ╰─────────────────────────────────────────────────╯
473
+
474
+ USAGE:
475
+ stamp init [path] [options]
476
+
477
+ ARGUMENTS:
478
+ [path] Target directory (default: current)
479
+
480
+ OPTIONS:
481
+ --skip-gitignore Skip .gitignore setup
482
+ --yes, -y Explicitly skip prompts (non-interactive; default behavior)
483
+ --no-secure Skip security scan (enables interactive prompts in TTY)
484
+ -h, --help Show this help
485
+
486
+ EXAMPLES:
487
+ stamp init
488
+ Set up LogicStamp in current directory (non-interactive, runs security scan by default)
489
+
490
+ stamp init ./my-project
491
+ Set up LogicStamp in a specific directory (non-interactive, runs security scan by default)
492
+
493
+ stamp init --skip-gitignore
494
+ Initialize without modifying .gitignore (security scan still runs)
495
+
496
+ stamp init --yes
497
+ Explicitly skip prompts (redundant - already non-interactive by default)
498
+
499
+ stamp init --no-secure
500
+ Initialize without security scan (enables interactive prompts in TTY mode)
501
+
502
+ WHAT IT DOES:
503
+ • Creates or updates .gitignore with LogicStamp patterns:
504
+ - context.json
505
+ - context_*.json
506
+ - context.toon
507
+ - context_*.toon
508
+ - *.uif.json
509
+ - logicstamp.manifest.json
510
+ - .logicstamp/
511
+ - stamp_security_report.json
512
+
513
+ NOTES:
514
+ • Safe to run multiple times (idempotent)
515
+ • Won't duplicate patterns if they already exist
516
+ • Creates .gitignore if it doesn't exist
517
517
  `;
518
518
  }
519
519
  export function getSecurityScanHelp() {
520
- return `
521
- ╭─────────────────────────────────────────────────╮
522
- │ Stamp Security Scan - Detect Secrets │
523
- │ Scan codebase for exposed secrets │
524
- ╰─────────────────────────────────────────────────╯
525
-
526
- USAGE:
527
- stamp security scan [path] [options]
528
-
529
- ARGUMENTS:
530
- [path] Directory to scan (default: current)
531
-
532
- OPTIONS:
533
- --out, -o <file> Output file (default: stamp_security_report.json)
534
- --quiet, -q Suppress verbose output (show only JSON stats)
535
- -h, --help Show this help
536
-
537
- EXAMPLES:
538
- stamp security scan
539
- Scan current directory for secrets
540
-
541
- stamp security scan ./src
542
- Scan specific directory
543
-
544
- stamp security scan --out report.json
545
- Write report to custom file
546
-
547
- WHAT IT DOES:
548
- • Scans TypeScript/JavaScript/JSON files for common secret patterns:
549
- - API keys, tokens, passwords
550
- - AWS access keys, private keys
551
- - OAuth secrets, JWT secrets
552
- - Database URLs with credentials
553
- • Generates stamp_security_report.json with findings
554
-
555
- OUTPUT:
556
- • stamp_security_report.json Detailed report with all findings
557
- • Exits with code 1 if secrets found, 0 if clean
558
-
559
- NOTES:
560
- • Report includes file paths, line numbers, and severity levels
561
- • Report file is automatically added to .gitignore to prevent accidental commits
520
+ return `
521
+ ╭─────────────────────────────────────────────────╮
522
+ │ Stamp Security Scan - Detect Secrets │
523
+ │ Scan codebase for exposed secrets │
524
+ ╰─────────────────────────────────────────────────╯
525
+
526
+ USAGE:
527
+ stamp security scan [path] [options]
528
+
529
+ ARGUMENTS:
530
+ [path] Directory to scan (default: current)
531
+
532
+ OPTIONS:
533
+ --out, -o <file> Output file (default: stamp_security_report.json)
534
+ --quiet, -q Suppress verbose output (show only JSON stats)
535
+ -h, --help Show this help
536
+
537
+ EXAMPLES:
538
+ stamp security scan
539
+ Scan current directory for secrets
540
+
541
+ stamp security scan ./src
542
+ Scan specific directory
543
+
544
+ stamp security scan --out report.json
545
+ Write report to custom file
546
+
547
+ WHAT IT DOES:
548
+ • Scans TypeScript/JavaScript/JSON files for common secret patterns:
549
+ - API keys, tokens, passwords
550
+ - AWS access keys, private keys
551
+ - OAuth secrets, JWT secrets
552
+ - Database URLs with credentials
553
+ • Generates stamp_security_report.json with findings
554
+
555
+ OUTPUT:
556
+ • stamp_security_report.json Detailed report with all findings
557
+ • Exits with code 1 if secrets found, 0 if clean
558
+
559
+ NOTES:
560
+ • Report includes file paths, line numbers, and severity levels
561
+ • Report file is automatically added to .gitignore to prevent accidental commits
562
562
  `;
563
563
  }
564
564
  export function getIgnoreHelp() {
565
- return `
566
- ╭─────────────────────────────────────────────────╮
567
- │ Stamp Ignore - Add Files to .stampignore │
568
- │ Exclude files from context compilation │
569
- ╰─────────────────────────────────────────────────╯
570
-
571
- USAGE:
572
- stamp ignore <path1> [path2] ... [options]
573
-
574
- ARGUMENTS:
575
- <path1> [path2] ... File or folder paths to ignore (relative to project root)
576
-
577
- OPTIONS:
578
- --quiet, -q Suppress verbose output (show only errors)
579
- -h, --help Show this help
580
-
581
- EXAMPLES:
582
- stamp ignore src/secrets.ts
583
- Add a single file to .stampignore
584
-
585
- stamp ignore src/config/credentials.ts src/secrets/
586
- Add multiple files/folders to .stampignore
587
-
588
- stamp ignore "**/secrets.ts" "**/*.key"
589
- Add glob patterns to .stampignore
590
-
591
- WHAT IT DOES:
592
- • Adds file or folder paths to .stampignore
593
- • Creates .stampignore if it doesn't exist
594
- • Prevents duplicate entries
595
- • Normalizes paths automatically
596
-
597
- NOTES:
598
- • Paths are relative to project root
599
- • Supports glob patterns (e.g., **/*.key, src/**/secrets.ts)
600
- • Files in .stampignore are excluded from context compilation
601
- • Use "stamp context" to verify files are excluded
565
+ return `
566
+ ╭─────────────────────────────────────────────────╮
567
+ │ Stamp Ignore - Add Files to .stampignore │
568
+ │ Exclude files from context compilation │
569
+ ╰─────────────────────────────────────────────────╯
570
+
571
+ USAGE:
572
+ stamp ignore <path1> [path2] ... [options]
573
+
574
+ ARGUMENTS:
575
+ <path1> [path2] ... File or folder paths to ignore (relative to project root)
576
+
577
+ OPTIONS:
578
+ --quiet, -q Suppress verbose output (show only errors)
579
+ -h, --help Show this help
580
+
581
+ EXAMPLES:
582
+ stamp ignore src/secrets.ts
583
+ Add a single file to .stampignore
584
+
585
+ stamp ignore src/config/credentials.ts src/secrets/
586
+ Add multiple files/folders to .stampignore
587
+
588
+ stamp ignore "**/secrets.ts" "**/*.key"
589
+ Add glob patterns to .stampignore
590
+
591
+ WHAT IT DOES:
592
+ • Adds file or folder paths to .stampignore
593
+ • Creates .stampignore if it doesn't exist
594
+ • Prevents duplicate entries
595
+ • Normalizes paths automatically
596
+
597
+ NOTES:
598
+ • Paths are relative to project root
599
+ • Supports glob patterns (e.g., **/*.key, src/**/secrets.ts)
600
+ • Files in .stampignore are excluded from context compilation
601
+ • Use "stamp context" to verify files are excluded
602
602
  `;
603
603
  }
604
604
  //# sourceMappingURL=helpText.js.map