aiwcli 0.12.8 → 0.13.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 (81) hide show
  1. package/dist/commands/clean.d.ts +7 -0
  2. package/dist/commands/clean.js +17 -8
  3. package/dist/commands/clear.d.ts +85 -0
  4. package/dist/commands/clear.js +455 -347
  5. package/dist/commands/init/index.d.ts +15 -0
  6. package/dist/commands/init/index.js +79 -38
  7. package/dist/lib/gitignore-manager.js +12 -13
  8. package/dist/lib/settings-hierarchy.d.ts +13 -1
  9. package/dist/lib/settings-hierarchy.js +1 -1
  10. package/dist/lib/template-linter.d.ts +4 -0
  11. package/dist/lib/template-linter.js +1 -1
  12. package/dist/lib/tty-detection.d.ts +1 -0
  13. package/dist/lib/tty-detection.js +1 -0
  14. package/dist/templates/CLAUDE.md +1 -1
  15. package/dist/templates/_shared/.claude/settings.json +7 -7
  16. package/dist/templates/_shared/.claude/skills/handoff/SKILL.md +1 -1
  17. package/dist/templates/_shared/.claude/skills/handoff-resume/SKILL.md +1 -1
  18. package/dist/templates/_shared/.claude/skills/meta-plan/SKILL.md +43 -0
  19. package/dist/templates/_shared/.codex/workflows/handoff.md +1 -1
  20. package/dist/templates/_shared/.codex/workflows/meta-plan.md +347 -0
  21. package/dist/templates/_shared/.windsurf/workflows/handoff.md +1 -1
  22. package/dist/templates/_shared/.windsurf/workflows/meta-plan.md +347 -0
  23. package/dist/templates/_shared/hooks-ts/lint_after_edit.ts +59 -0
  24. package/dist/templates/_shared/hooks-ts/session_end.ts +11 -10
  25. package/dist/templates/_shared/hooks-ts/session_start.ts +15 -12
  26. package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +12 -12
  27. package/dist/templates/_shared/lib-ts/base/hook-utils.ts +26 -7
  28. package/dist/templates/_shared/lib-ts/base/inference.ts +16 -16
  29. package/dist/templates/_shared/lib-ts/base/lint-dispatch.ts +287 -0
  30. package/dist/templates/_shared/lib-ts/base/state-io.ts +4 -3
  31. package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +3 -3
  32. package/dist/templates/_shared/lib-ts/context/context-formatter.ts +16 -15
  33. package/dist/templates/_shared/lib-ts/context/context-selector.ts +16 -16
  34. package/dist/templates/_shared/lib-ts/context/context-store.ts +15 -14
  35. package/dist/templates/_shared/lib-ts/context/plan-manager.ts +2 -2
  36. package/dist/templates/_shared/scripts/resolve-run.ts +61 -0
  37. package/dist/templates/_shared/scripts/resolve_context.ts +1 -1
  38. package/dist/templates/_shared/scripts/status_line.ts +74 -65
  39. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/CLAUDE.md +10 -10
  40. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/lib/document-generator.ts +5 -4
  41. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/lib/handoff-reader.ts +2 -1
  42. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/scripts/resume_handoff.ts +6 -6
  43. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/scripts/save_handoff.ts +16 -17
  44. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/workflows/handoff-resume.md +2 -2
  45. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/workflows/handoff.md +3 -3
  46. package/dist/templates/_shared/skills/meta-plan/CLAUDE.md +44 -0
  47. package/dist/templates/_shared/skills/meta-plan/workflows/meta-plan.md +347 -0
  48. package/dist/templates/cc-native/.claude/settings.json +84 -56
  49. package/dist/templates/cc-native/_cc-native/artifacts/lib/format.ts +8 -6
  50. package/dist/templates/cc-native/_cc-native/artifacts/lib/index.ts +11 -11
  51. package/dist/templates/cc-native/_cc-native/artifacts/lib/tracker.ts +7 -6
  52. package/dist/templates/cc-native/_cc-native/artifacts/lib/write.ts +17 -16
  53. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +9 -7
  54. package/dist/templates/cc-native/_cc-native/hooks/validate_task_prompt.ts +2 -2
  55. package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +15 -16
  56. package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +19 -19
  57. package/dist/templates/cc-native/_cc-native/lib-ts/plan-discovery.ts +3 -3
  58. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/embedding-indexer.ts +16 -12
  59. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/hyde.ts +2 -3
  60. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/index.ts +31 -31
  61. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/logger.ts +7 -6
  62. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/ollama-client.ts +9 -7
  63. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/retrieval-pipeline.ts +17 -14
  64. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-indexer.ts +41 -37
  65. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-loader.ts +43 -33
  66. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-searcher.ts +20 -20
  67. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/types.ts +9 -8
  68. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/vector-store.ts +4 -3
  69. package/dist/templates/cc-native/_cc-native/lib-ts/settings.ts +8 -9
  70. package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +20 -19
  71. package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +1 -1
  72. package/dist/templates/cc-native/_cc-native/plan-review/lib/agent-selection.ts +2 -3
  73. package/dist/templates/cc-native/_cc-native/plan-review/lib/graduation.ts +1 -1
  74. package/dist/templates/cc-native/_cc-native/plan-review/lib/orchestrator.ts +1 -1
  75. package/dist/templates/cc-native/_cc-native/plan-review/lib/output-builder.ts +12 -21
  76. package/dist/templates/cc-native/_cc-native/plan-review/lib/plan-questions.ts +3 -4
  77. package/dist/templates/cc-native/_cc-native/plan-review/lib/review-pipeline.ts +35 -39
  78. package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/agent.ts +2 -3
  79. package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/providers/codex-agent.ts +1 -1
  80. package/oclif.manifest.json +1 -1
  81. package/package.json +6 -5
@@ -16,6 +16,13 @@ export default class CleanCommand extends BaseCommand {
16
16
  quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
17
  };
18
18
  run(): Promise<void>;
19
+ /**
20
+ * Display contents of folders that will be deleted.
21
+ *
22
+ * @param allContents - Folders with their contents
23
+ * @param targetDir - Base directory for relative path display
24
+ */
25
+ private displayContents;
19
26
  /**
20
27
  * Find all output folders in the target directory.
21
28
  * Matches folders with pattern _*-output (e.g., _bmad-output, _gsd-output).
@@ -1,6 +1,6 @@
1
1
  import { promises as fs } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- import { confirm } from '@inquirer/prompts';
3
+ import confirm from '@inquirer/confirm';
4
4
  import { Flags } from '@oclif/core';
5
5
  import BaseCommand from '../lib/base-command.js';
6
6
  import { EXIT_CODES } from '../types/exit-codes.js';
@@ -91,13 +91,7 @@ export default class CleanCommand extends BaseCommand {
91
91
  this.log('');
92
92
  this.logInfo(`Found ${totalItems} item(s) in ${allContents.length} output folder(s):`);
93
93
  this.log('');
94
- for (const { items } of allContents) {
95
- for (const item of items) {
96
- const relativePath = item.path.replace(targetDir + '\\', '').replace(targetDir + '/', '');
97
- const suffix = item.isDirectory ? '/' : '';
98
- this.log(` ${relativePath}${suffix}`);
99
- }
100
- }
94
+ this.displayContents(allContents, targetDir);
101
95
  this.log('');
102
96
  // Dry run - just show files without deleting
103
97
  if (flags['dry-run']) {
@@ -148,6 +142,21 @@ export default class CleanCommand extends BaseCommand {
148
142
  });
149
143
  }
150
144
  }
145
+ /**
146
+ * Display contents of folders that will be deleted.
147
+ *
148
+ * @param allContents - Folders with their contents
149
+ * @param targetDir - Base directory for relative path display
150
+ */
151
+ displayContents(allContents, targetDir) {
152
+ for (const { items } of allContents) {
153
+ for (const item of items) {
154
+ const relativePath = item.path.replace(targetDir + '\\', '').replace(targetDir + '/', '');
155
+ const suffix = item.isDirectory ? '/' : '';
156
+ this.log(` ${relativePath}${suffix}`);
157
+ }
158
+ }
159
+ }
151
160
  /**
152
161
  * Find all output folders in the target directory.
153
162
  * Matches folders with pattern _*-output (e.g., _bmad-output, _gsd-output).
@@ -21,8 +21,50 @@ export default class ClearCommand extends BaseCommand {
21
21
  *
22
22
  * @param targetDir - Project root directory
23
23
  * @param flags - Command flags (dry-run, force)
24
+ * @param flags.force - Skip confirmation prompt
24
25
  */
25
26
  private cleanRuntimeOutput;
27
+ /**
28
+ * Clean up backup files created during settings reconstruction.
29
+ *
30
+ * @param targetDir - Project root directory
31
+ */
32
+ private cleanupBackupFiles;
33
+ /**
34
+ * Clean up gitignore entries and prune stale entries.
35
+ *
36
+ * @param targetDir - Project root directory
37
+ * @returns True if gitignore was updated
38
+ */
39
+ private cleanupGitignore;
40
+ /**
41
+ * Display a list of folders to remove.
42
+ *
43
+ * @param targetDir - Base directory for relative path display
44
+ * @param folders - Array of folder paths
45
+ * @param label - Label for the folder type
46
+ */
47
+ private displayFolderList;
48
+ /**
49
+ * Display all pending changes before confirmation.
50
+ *
51
+ * @param targetDir - Project root directory
52
+ * @param folders - Discovered folders and methods to remove
53
+ * @param folders.workflowFolders - Workflow folders to remove
54
+ * @param folders.outputMethodFolders - Output method folders to remove
55
+ * @param folders.ideMethodFolders - IDE method folders to remove
56
+ * @param folders.methodsToRemove - Method names being removed
57
+ */
58
+ private displayPendingChanges;
59
+ /**
60
+ * Delete all discovered folders in parallel.
61
+ *
62
+ * @param workflowFolders - Workflow folders to delete
63
+ * @param outputMethodFolders - Output method folders to delete
64
+ * @param ideMethodFolders - IDE method folders to delete
65
+ * @returns Count of successfully deleted folders by type
66
+ */
67
+ private executeFolderDeletion;
26
68
  /**
27
69
  * Extract method names from workflow folder names (e.g., _gsd -> gsd).
28
70
  *
@@ -60,6 +102,22 @@ export default class ClearCommand extends BaseCommand {
60
102
  * @returns Array of workflow folder paths
61
103
  */
62
104
  private findWorkflowFolders;
105
+ /**
106
+ * Perform all post-deletion cleanup: empty dir removal, gitignore, settings, IDE folders.
107
+ *
108
+ * @param targetDir - Project root directory
109
+ * @param methodsToRemove - Method names being removed
110
+ * @returns Cleanup result state
111
+ */
112
+ private performPostDeleteCleanup;
113
+ /**
114
+ * Reconstruct IDE settings after method removal.
115
+ *
116
+ * @param targetDir - Project root directory
117
+ * @param methodsToRemove - Methods being removed
118
+ * @returns Which IDE settings were updated
119
+ */
120
+ private reconstructSettingsAfterRemoval;
63
121
  /**
64
122
  * Remove method entries from IDE settings files (methods tracking only).
65
123
  * Settings reconstruction handles hooks/permissions; this only strips the methods object.
@@ -73,4 +131,31 @@ export default class ClearCommand extends BaseCommand {
73
131
  * and deletes matching files from the target, then prunes empty directories.
74
132
  */
75
133
  private removeSharedIdeContent;
134
+ /**
135
+ * Report the results of a clear operation.
136
+ *
137
+ * @param deleteCounts - Counts of deleted folders by type
138
+ * @param deleteCounts.deletedWorkflow - Number of workflow folders deleted
139
+ * @param deleteCounts.deletedOutput - Number of output folders deleted
140
+ * @param deleteCounts.deletedIde - Number of IDE method folders deleted
141
+ * @param cleanup - Cleanup operation results
142
+ * @param cleanup.gitignoreUpdated - Whether gitignore was updated
143
+ * @param cleanup.removedOutputDir - Whether _output dir was removed
144
+ * @param cleanup.removedAiwcliContainer - Whether .aiwcli dir was removed
145
+ * @param cleanup.removedClaudeDir - Whether .claude dir was removed
146
+ * @param cleanup.removedWindsurfDir - Whether .windsurf dir was removed
147
+ * @param cleanup.updatedClaudeSettings - Whether Claude settings were updated
148
+ * @param cleanup.updatedWindsurfSettings - Whether Windsurf settings were updated
149
+ */
150
+ private reportClearResults;
151
+ /**
152
+ * Try to remove an IDE folder if it should be deleted (empty settings + empty subfolders).
153
+ *
154
+ * @param targetDir - Project root directory
155
+ * @param ideFolder - IDE folder configuration
156
+ * @param ideFolder.root - Root folder name (e.g., '.claude')
157
+ * @param ideFolder.settingsFile - Settings file name (e.g., 'settings.json')
158
+ * @returns True if the folder was removed
159
+ */
160
+ private tryRemoveIdeFolder;
76
161
  }