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