codehere 0.5.0-alpha.0 → 0.5.1-alpha

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 (186) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +106 -30
  3. package/dist/application/agents/execution-agent.js +2 -2
  4. package/dist/application/agents/multi-agent-orchestrator.d.ts +1 -0
  5. package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
  6. package/dist/application/agents/multi-agent-orchestrator.js +10 -3
  7. package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
  8. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  9. package/dist/application/agents/planning-agent.js +15 -11
  10. package/dist/application/agents/planning-agent.js.map +1 -1
  11. package/dist/application/reasoning/multi-model-planning-strategy.d.ts +21 -0
  12. package/dist/application/reasoning/multi-model-planning-strategy.d.ts.map +1 -0
  13. package/dist/application/reasoning/multi-model-planning-strategy.js +158 -0
  14. package/dist/application/reasoning/multi-model-planning-strategy.js.map +1 -0
  15. package/dist/application/reasoning/reasoning-config.d.ts +15 -0
  16. package/dist/application/reasoning/reasoning-config.d.ts.map +1 -0
  17. package/dist/application/reasoning/reasoning-config.js +50 -0
  18. package/dist/application/reasoning/reasoning-config.js.map +1 -0
  19. package/dist/application/reasoning/reasoning-orchestrator.d.ts +18 -0
  20. package/dist/application/reasoning/reasoning-orchestrator.d.ts.map +1 -0
  21. package/dist/application/reasoning/reasoning-orchestrator.js +170 -0
  22. package/dist/application/reasoning/reasoning-orchestrator.js.map +1 -0
  23. package/dist/application/reasoning/reasoning-strategy.interface.d.ts +24 -0
  24. package/dist/application/reasoning/reasoning-strategy.interface.d.ts.map +1 -0
  25. package/dist/application/reasoning/reasoning-strategy.interface.js +6 -0
  26. package/dist/application/reasoning/reasoning-strategy.interface.js.map +1 -0
  27. package/dist/application/reasoning/role-provider-resolver.d.ts +36 -0
  28. package/dist/application/reasoning/role-provider-resolver.d.ts.map +1 -0
  29. package/dist/application/reasoning/role-provider-resolver.js +74 -0
  30. package/dist/application/reasoning/role-provider-resolver.js.map +1 -0
  31. package/dist/application/reasoning/simple-planning-strategy.d.ts +22 -0
  32. package/dist/application/reasoning/simple-planning-strategy.d.ts.map +1 -0
  33. package/dist/application/reasoning/simple-planning-strategy.js +217 -0
  34. package/dist/application/reasoning/simple-planning-strategy.js.map +1 -0
  35. package/dist/application/reasoning/types.d.ts +65 -0
  36. package/dist/application/reasoning/types.d.ts.map +1 -0
  37. package/dist/application/reasoning/types.js +6 -0
  38. package/dist/application/reasoning/types.js.map +1 -0
  39. package/dist/application/reasoning/validator-strategy.d.ts +56 -0
  40. package/dist/application/reasoning/validator-strategy.d.ts.map +1 -0
  41. package/dist/application/reasoning/validator-strategy.js +103 -0
  42. package/dist/application/reasoning/validator-strategy.js.map +1 -0
  43. package/dist/application/services/dependency-container.d.ts.map +1 -1
  44. package/dist/application/services/dependency-container.js +5 -7
  45. package/dist/application/services/dependency-container.js.map +1 -1
  46. package/dist/application/services/intelligent-router.d.ts +5 -5
  47. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  48. package/dist/application/services/intelligent-router.js +81 -62
  49. package/dist/application/services/intelligent-router.js.map +1 -1
  50. package/dist/application/use-cases/planning-use-case.d.ts +14 -1
  51. package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
  52. package/dist/application/use-cases/planning-use-case.js +109 -2
  53. package/dist/application/use-cases/planning-use-case.js.map +1 -1
  54. package/dist/chat.d.ts.map +1 -1
  55. package/dist/chat.js +18 -7
  56. package/dist/chat.js.map +1 -1
  57. package/dist/domain/entities/memory.d.ts.map +1 -1
  58. package/dist/domain/entities/task.d.ts +1 -1
  59. package/dist/domain/entities/task.js +1 -1
  60. package/dist/domain/services/query-intent-classifier.d.ts.map +1 -1
  61. package/dist/domain/services/query-intent-classifier.js +20 -1
  62. package/dist/domain/services/query-intent-classifier.js.map +1 -1
  63. package/dist/index.js +111 -14
  64. package/dist/index.js.map +1 -1
  65. package/dist/infrastructure/config/config-manager.d.ts +10 -0
  66. package/dist/infrastructure/config/config-manager.d.ts.map +1 -1
  67. package/dist/infrastructure/config/config-manager.js +11 -0
  68. package/dist/infrastructure/config/config-manager.js.map +1 -1
  69. package/dist/infrastructure/context/conversation-context.d.ts +11 -10
  70. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
  71. package/dist/infrastructure/context/conversation-context.js +3 -5
  72. package/dist/infrastructure/context/conversation-context.js.map +1 -1
  73. package/dist/infrastructure/index.d.ts +0 -1
  74. package/dist/infrastructure/index.d.ts.map +1 -1
  75. package/dist/infrastructure/index.js +2 -1
  76. package/dist/infrastructure/index.js.map +1 -1
  77. package/dist/infrastructure/protocols/a2a-metadata.js +1 -1
  78. package/dist/infrastructure/protocols/mcp-oauth.js +1 -1
  79. package/dist/infrastructure/providers/cohere-provider.d.ts +2 -1
  80. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
  81. package/dist/infrastructure/providers/cohere-provider.js +37 -13
  82. package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
  83. package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -1
  84. package/dist/infrastructure/providers/openrouter-provider.js +4 -2
  85. package/dist/infrastructure/providers/openrouter-provider.js.map +1 -1
  86. package/dist/infrastructure/security/input-validator.d.ts.map +1 -1
  87. package/dist/infrastructure/security/input-validator.js +19 -6
  88. package/dist/infrastructure/security/input-validator.js.map +1 -1
  89. package/dist/infrastructure/security/network-guard.d.ts +8 -0
  90. package/dist/infrastructure/security/network-guard.d.ts.map +1 -0
  91. package/dist/infrastructure/security/network-guard.js +70 -0
  92. package/dist/infrastructure/security/network-guard.js.map +1 -0
  93. package/dist/infrastructure/security/offline.d.ts +16 -0
  94. package/dist/infrastructure/security/offline.d.ts.map +1 -0
  95. package/dist/infrastructure/security/offline.js +24 -0
  96. package/dist/infrastructure/security/offline.js.map +1 -0
  97. package/dist/infrastructure/storage/memory-stream-service.d.ts.map +1 -1
  98. package/dist/infrastructure/storage/memory-stream-service.js +88 -58
  99. package/dist/infrastructure/storage/memory-stream-service.js.map +1 -1
  100. package/dist/infrastructure/storage/sqljs-init.d.ts +8 -0
  101. package/dist/infrastructure/storage/sqljs-init.d.ts.map +1 -0
  102. package/dist/infrastructure/storage/sqljs-init.js +23 -0
  103. package/dist/infrastructure/storage/sqljs-init.js.map +1 -0
  104. package/dist/infrastructure/storage/task-helpers.d.ts +1 -1
  105. package/dist/infrastructure/storage/task-helpers.js +1 -1
  106. package/dist/infrastructure/storage/task-repository.d.ts +2 -1
  107. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
  108. package/dist/infrastructure/storage/task-repository.js +14 -3
  109. package/dist/infrastructure/storage/task-repository.js.map +1 -1
  110. package/dist/infrastructure/telemetry/telemetry-service.d.ts +74 -0
  111. package/dist/infrastructure/telemetry/telemetry-service.d.ts.map +1 -0
  112. package/dist/infrastructure/telemetry/telemetry-service.js +167 -0
  113. package/dist/infrastructure/telemetry/telemetry-service.js.map +1 -0
  114. package/dist/infrastructure/ux/meta-query.d.ts +9 -0
  115. package/dist/infrastructure/ux/meta-query.d.ts.map +1 -0
  116. package/dist/infrastructure/ux/meta-query.js +63 -0
  117. package/dist/infrastructure/ux/meta-query.js.map +1 -0
  118. package/dist/infrastructure/ux/progress-indicator.d.ts +10 -49
  119. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
  120. package/dist/infrastructure/ux/progress-indicator.js +9 -112
  121. package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
  122. package/dist/infrastructure/ux/repo-fingerprint.d.ts +10 -0
  123. package/dist/infrastructure/ux/repo-fingerprint.d.ts.map +1 -0
  124. package/dist/infrastructure/ux/repo-fingerprint.js +55 -0
  125. package/dist/infrastructure/ux/repo-fingerprint.js.map +1 -0
  126. package/dist/presentation/cli/commands/ask-command.d.ts +2 -0
  127. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  128. package/dist/presentation/cli/commands/ask-command.js +140 -31
  129. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  130. package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
  131. package/dist/presentation/cli/commands/config-command.js +14 -2
  132. package/dist/presentation/cli/commands/config-command.js.map +1 -1
  133. package/dist/presentation/cli/commands/decision-command.js +23 -6
  134. package/dist/presentation/cli/commands/decision-command.js.map +1 -1
  135. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
  136. package/dist/presentation/cli/commands/fix-command.js +23 -4
  137. package/dist/presentation/cli/commands/fix-command.js.map +1 -1
  138. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
  139. package/dist/presentation/cli/commands/help-command.js +21 -1
  140. package/dist/presentation/cli/commands/help-command.js.map +1 -1
  141. package/dist/presentation/cli/commands/memory-command.d.ts +17 -0
  142. package/dist/presentation/cli/commands/memory-command.d.ts.map +1 -0
  143. package/dist/presentation/cli/commands/memory-command.js +252 -0
  144. package/dist/presentation/cli/commands/memory-command.js.map +1 -0
  145. package/dist/presentation/cli/commands/orchestrate-command.d.ts +1 -0
  146. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  147. package/dist/presentation/cli/commands/orchestrate-command.js +126 -19
  148. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  149. package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
  150. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  151. package/dist/presentation/cli/commands/plan-command.js +133 -27
  152. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  153. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
  154. package/dist/presentation/cli/commands/react-command.js +5 -1
  155. package/dist/presentation/cli/commands/react-command.js.map +1 -1
  156. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
  157. package/dist/presentation/cli/commands/review-command.js +21 -2
  158. package/dist/presentation/cli/commands/review-command.js.map +1 -1
  159. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
  160. package/dist/presentation/cli/commands/smart-command.js +72 -5
  161. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  162. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
  163. package/dist/presentation/cli/commands/status-command.js +5 -1
  164. package/dist/presentation/cli/commands/status-command.js.map +1 -1
  165. package/dist/presentation/cli/error-display.d.ts.map +1 -1
  166. package/dist/presentation/cli/error-display.js +75 -17
  167. package/dist/presentation/cli/error-display.js.map +1 -1
  168. package/dist/search.d.ts.map +1 -1
  169. package/dist/search.js +18 -5
  170. package/dist/search.js.map +1 -1
  171. package/dist/session.js +44 -2
  172. package/dist/session.js.map +1 -1
  173. package/dist/tools/bash.d 2.ts +53 -0
  174. package/dist/tools/bash.d.ts.map +1 -1
  175. package/dist/tools/bash.js +3 -0
  176. package/dist/tools/bash.js 2.map +1 -0
  177. package/dist/tools/bash.js.map +1 -1
  178. package/dist/tools/edit 2.js +235 -0
  179. package/dist/tools/edit.d.ts 2.map +1 -0
  180. package/dist/tools/git-tool.js +7 -7
  181. package/dist/tools/git-tool.js.map +1 -1
  182. package/dist/ui.d.ts +5 -0
  183. package/dist/ui.d.ts.map +1 -1
  184. package/dist/ui.js +19 -0
  185. package/dist/ui.js.map +1 -1
  186. package/package.json +11 -5
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Infrastructure: Telemetry Service
3
+ * Privacy-first, opt-in telemetry for understanding usage patterns
4
+ *
5
+ * Principles:
6
+ * - Opt-in only (CODEHERE_TELEMETRY_ENABLED=true)
7
+ * - No code/content transmitted
8
+ * - Anonymized data only
9
+ * - Local-first (stores locally, syncs if enabled)
10
+ *
11
+ * Clean Architecture: Infrastructure Layer
12
+ */
13
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync } from 'fs';
14
+ import { join, dirname } from 'path';
15
+ import { fileURLToPath } from 'url';
16
+ import { randomUUID } from 'crypto';
17
+ const __filename = fileURLToPath(import.meta.url);
18
+ const __dirname = dirname(__filename);
19
+ export class TelemetryService {
20
+ telemetryDir;
21
+ eventsFile;
22
+ configFile;
23
+ enabled = false;
24
+ anonymousId = '';
25
+ sessionId = '';
26
+ constructor() {
27
+ // Find codebase root
28
+ const codebaseRoot = this.findCodebaseRoot();
29
+ this.telemetryDir = join(codebaseRoot, '.codehere', 'telemetry');
30
+ this.eventsFile = join(this.telemetryDir, 'events.jsonl');
31
+ this.configFile = join(this.telemetryDir, 'config.json');
32
+ this.sessionId = randomUUID();
33
+ this.loadConfig();
34
+ }
35
+ findCodebaseRoot() {
36
+ let current = process.cwd();
37
+ while (current !== '/') {
38
+ if (existsSync(join(current, '.codehere'))) {
39
+ return current;
40
+ }
41
+ current = join(current, '..');
42
+ }
43
+ return process.cwd();
44
+ }
45
+ loadConfig() {
46
+ // Check environment variable first
47
+ const envEnabled = process.env.CODEHERE_TELEMETRY_ENABLED === 'true';
48
+ if (existsSync(this.configFile)) {
49
+ try {
50
+ const config = JSON.parse(readFileSync(this.configFile, 'utf-8'));
51
+ this.enabled = config.enabled || envEnabled;
52
+ this.anonymousId = config.anonymousId || this.generateAnonymousId();
53
+ }
54
+ catch {
55
+ this.enabled = envEnabled;
56
+ this.anonymousId = this.generateAnonymousId();
57
+ }
58
+ }
59
+ else {
60
+ this.enabled = envEnabled;
61
+ this.anonymousId = this.generateAnonymousId();
62
+ }
63
+ // Save config
64
+ this.saveConfig();
65
+ }
66
+ generateAnonymousId() {
67
+ // Generate a persistent anonymous ID (not tied to user identity)
68
+ return randomUUID();
69
+ }
70
+ saveConfig() {
71
+ if (!existsSync(this.telemetryDir)) {
72
+ mkdirSync(this.telemetryDir, { recursive: true });
73
+ }
74
+ writeFileSync(this.configFile, JSON.stringify({
75
+ enabled: this.enabled,
76
+ anonymousId: this.anonymousId,
77
+ enabledAt: this.enabled ? Date.now() : null,
78
+ }, null, 2));
79
+ }
80
+ /**
81
+ * Check if telemetry is enabled
82
+ */
83
+ isEnabled() {
84
+ return this.enabled;
85
+ }
86
+ /**
87
+ * Enable telemetry (opt-in)
88
+ */
89
+ enable() {
90
+ this.enabled = true;
91
+ this.saveConfig();
92
+ this.track('install', {
93
+ version: process.env.npm_package_version || 'unknown',
94
+ os: process.platform,
95
+ nodeVersion: process.version,
96
+ });
97
+ }
98
+ /**
99
+ * Disable telemetry
100
+ */
101
+ disable() {
102
+ this.enabled = false;
103
+ this.saveConfig();
104
+ }
105
+ /**
106
+ * Track an event
107
+ */
108
+ track(eventType, data = {}) {
109
+ if (!this.enabled) {
110
+ return;
111
+ }
112
+ const event = {
113
+ id: randomUUID(),
114
+ timestamp: Date.now(),
115
+ eventType,
116
+ data: {
117
+ ...data,
118
+ version: data.version || process.env.npm_package_version || 'unknown',
119
+ os: data.os || process.platform,
120
+ nodeVersion: data.nodeVersion || process.version,
121
+ },
122
+ sessionId: this.sessionId,
123
+ anonymousId: this.anonymousId,
124
+ };
125
+ // Write to local file
126
+ if (!existsSync(this.telemetryDir)) {
127
+ mkdirSync(this.telemetryDir, { recursive: true });
128
+ }
129
+ appendFileSync(this.eventsFile, JSON.stringify(event) + '\n');
130
+ }
131
+ /**
132
+ * Track command usage
133
+ */
134
+ trackCommand(command) {
135
+ this.track('command', { command });
136
+ }
137
+ /**
138
+ * Track error
139
+ */
140
+ trackError(errorType) {
141
+ this.track('error', { errorType });
142
+ }
143
+ /**
144
+ * Track feature usage
145
+ */
146
+ trackFeature(feature) {
147
+ this.track('feature_use', { feature });
148
+ }
149
+ /**
150
+ * Get telemetry status message
151
+ */
152
+ getStatusMessage() {
153
+ if (this.enabled) {
154
+ return 'Telemetry: Enabled (opt-in)';
155
+ }
156
+ return 'Telemetry: Disabled (set CODEHERE_TELEMETRY_ENABLED=true to enable)';
157
+ }
158
+ }
159
+ // Singleton instance
160
+ let telemetryService = null;
161
+ export function getTelemetryService() {
162
+ if (!telemetryService) {
163
+ telemetryService = new TelemetryService();
164
+ }
165
+ return telemetryService;
166
+ }
167
+ //# sourceMappingURL=telemetry-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-service.js","sourceRoot":"","sources":["../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'project' | 'goto';
6
+ message: string;
7
+ };
8
+ export declare function handleMetaQuery(query: string, cwd: string): MetaQueryResult;
9
+ //# sourceMappingURL=meta-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-query.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/meta-query.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,eAAe,GACvB;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,GAClB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,CAyD3E"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * UX: Meta-query handler (deterministic, no LLM)
3
+ * Used to keep UX professional for "what can I do" / "what project is this" / "go to <path>".
4
+ */
5
+ import { fingerprintRepo } from './repo-fingerprint.js';
6
+ import { isOfflineModeEnabled } from '../security/offline.js';
7
+ export function handleMetaQuery(query, cwd) {
8
+ const trimmed = query.trim();
9
+ const lower = trimmed.toLowerCase();
10
+ const normalized = lower.replace(/[?!.\u2026]+$/g, '').trim();
11
+ if (normalized === 'what can i do' || normalized === 'what i can do' || normalized === 'capabilities') {
12
+ const offlineNote = isOfflineModeEnabled()
13
+ ? 'Offline: ON (no outbound network).'
14
+ : 'Offline: use `--offline` or CODEHERE_OFFLINE=1 to block outbound network (localhost allowed).';
15
+ return {
16
+ handled: true,
17
+ kind: 'capabilities',
18
+ message: [
19
+ 'Commands you can run:',
20
+ '- codehere ask "..." --json',
21
+ '- codehere explain <file>',
22
+ '- codehere plan "..." --json',
23
+ '- codehere fix <file> "..." --review',
24
+ '- codehere orchestrate "..." --json',
25
+ '- codehere memory --list --json',
26
+ '- codehere trace export <runId> --json',
27
+ '',
28
+ 'Tips:',
29
+ `- Current directory: ${cwd}`,
30
+ '- To work on another repo: `cd /path/to/repo` in your shell, then re-run.',
31
+ `- ${offlineNote}`,
32
+ ].join('\n'),
33
+ };
34
+ }
35
+ if (normalized === 'what project is this' || normalized === 'what is this project' || normalized === 'project') {
36
+ const fp = fingerprintRepo(cwd);
37
+ const lines = [
38
+ 'Project fingerprint:',
39
+ `- directory: ${fp.cwd}`,
40
+ `- type: ${fp.kind}`,
41
+ ];
42
+ if (fp.name)
43
+ lines.push(`- name: ${fp.name}`);
44
+ if (fp.description)
45
+ lines.push(`- description: ${fp.description}`);
46
+ if (fp.packageManager)
47
+ lines.push(`- package manager: ${fp.packageManager}`);
48
+ if (fp.scripts && fp.scripts.length > 0)
49
+ lines.push(`- scripts: ${fp.scripts.slice(0, 12).join(', ')}${fp.scripts.length > 12 ? ', ...' : ''}`);
50
+ return { handled: true, kind: 'project', message: lines.join('\n') };
51
+ }
52
+ const goToMatch = trimmed.match(/\b(go to|switch to|cd to)\s+(\S+)/i);
53
+ if (goToMatch) {
54
+ const target = goToMatch[2];
55
+ return {
56
+ handled: true,
57
+ kind: 'goto',
58
+ message: `I can’t change your shell’s working directory. Run this in your terminal:\n\ncd ${target}\n\nThen run:\ncodehere ask \"what project is this\" --json`,
59
+ };
60
+ }
61
+ return { handled: false };
62
+ }
63
+ //# sourceMappingURL=meta-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-query.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/meta-query.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAM9D,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,GAAW;IACxD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,KAAK,CAAC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,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChJ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACvE,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACtE,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QAC5B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,mFAAmF,MAAM,6DAA6D;SAChK,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC"}
@@ -1,53 +1,14 @@
1
- /**
2
- * Progress Indicator Utilities
3
- * Provides progress indicators for long-running operations
4
- *
5
- * Phase 1: v0.5.0-alpha.0
6
- */
7
- export interface ProgressOptions {
8
- total?: number;
9
- message?: string;
10
- showPercentage?: boolean;
11
- showCount?: boolean;
12
- }
13
- export declare class ProgressIndicator {
14
- private spinner;
15
- private progressBar;
16
- private operationStartTime;
17
- private currentValue;
18
- private total;
19
- private message;
20
- /**
21
- * Start progress indicator
22
- */
23
- start(options?: ProgressOptions): void;
24
- /**
25
- * Update progress
26
- */
27
- update(value: number, message?: string): void;
28
- /**
29
- * Increment progress
30
- */
31
- increment(delta?: number, message?: string): void;
32
- /**
33
- * Stop progress indicator with smooth transition
34
- */
35
- stop(success?: boolean, finalMessage?: string): void;
36
- /**
37
- * Get elapsed time
38
- */
39
- getElapsedTime(): number;
1
+ export interface ProgressHandle {
2
+ start: (opts?: {
3
+ message?: string;
4
+ }) => void;
5
+ stop: (success?: boolean, finalMessage?: string) => void;
40
6
  }
41
7
  /**
42
- * Create progress indicator for embedding search
43
- */
44
- export declare function createEmbeddingSearchProgress(total: number): ProgressIndicator;
45
- /**
46
- * Create progress indicator for plan generation
47
- */
48
- export declare function createPlanGenerationProgress(): ProgressIndicator;
49
- /**
50
- * Create progress indicator for memory synthesis
8
+ * Lightweight progress indicator for embedding search.
9
+ *
10
+ * This is intentionally a **no-op** implementation to avoid adding dependencies
11
+ * or noisy console output in non-interactive/test environments.
51
12
  */
52
- export declare function createMemorySynthesisProgress(): ProgressIndicator;
13
+ export declare function createEmbeddingSearchProgress(_estimatedTotalChunks: number): ProgressHandle;
53
14
  //# sourceMappingURL=progress-indicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-indicator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAiD;IAChE,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,OAAO,CAAc;IAE7B;;OAEG;IACH,KAAK,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI;IAgB1C;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAoB7C;;OAEG;IACH,SAAS,CAAC,KAAK,GAAE,MAAU,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAIpD;;OAEG;IACH,IAAI,CAAC,OAAO,GAAE,OAAc,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;IAc1D;;OAEG;IACH,cAAc,IAAI,MAAM;CAGzB;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAS9E;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,iBAAiB,CAMhE;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,iBAAiB,CAMjE"}
1
+ {"version":3,"file":"progress-indicator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,qBAAqB,EAAE,MAAM,GAAG,cAAc,CAK3F"}
@@ -1,116 +1,13 @@
1
1
  /**
2
- * Progress Indicator Utilities
3
- * Provides progress indicators for long-running operations
2
+ * Lightweight progress indicator for embedding search.
4
3
  *
5
- * Phase 1: v0.5.0-alpha.0
6
- */
7
- import { createSpinner } from '../../ui.js';
8
- export class ProgressIndicator {
9
- spinner = null;
10
- progressBar = '';
11
- operationStartTime = 0;
12
- currentValue = 0;
13
- total = 0;
14
- message = '';
15
- /**
16
- * Start progress indicator
17
- */
18
- start(options = {}) {
19
- this.operationStartTime = Date.now();
20
- this.currentValue = 0;
21
- this.total = options.total || 0;
22
- this.message = options.message || 'Processing...';
23
- if (this.total > 0) {
24
- // Progress bar mode
25
- this.update(0, this.message);
26
- }
27
- else {
28
- // Spinner mode
29
- this.spinner = createSpinner(this.message);
30
- this.spinner.start();
31
- }
32
- }
33
- /**
34
- * Update progress
35
- */
36
- update(value, message) {
37
- this.currentValue = value;
38
- if (message) {
39
- this.message = message;
40
- }
41
- if (this.total > 0) {
42
- // Progress bar
43
- const percentage = Math.min(100, Math.floor((value / this.total) * 100));
44
- const barLength = 20;
45
- const filled = Math.floor((percentage / 100) * barLength);
46
- const bar = '█'.repeat(filled) + '░'.repeat(barLength - filled);
47
- process.stdout.write(`\r${this.message} [${bar}] ${percentage}% (${value}/${this.total})`);
48
- }
49
- else if (this.spinner) {
50
- // Spinner
51
- this.spinner.text = this.message;
52
- }
53
- }
54
- /**
55
- * Increment progress
56
- */
57
- increment(delta = 1, message) {
58
- this.update(this.currentValue + delta, message);
59
- }
60
- /**
61
- * Stop progress indicator with smooth transition
62
- */
63
- stop(success = true, finalMessage) {
64
- if (this.spinner) {
65
- this.spinner.stop();
66
- this.spinner = null;
67
- }
68
- else if (this.total > 0) {
69
- // Clear progress bar
70
- process.stdout.write('\r' + ' '.repeat(80) + '\r');
71
- }
72
- if (finalMessage) {
73
- console.log(finalMessage);
74
- }
75
- }
76
- /**
77
- * Get elapsed time
78
- */
79
- getElapsedTime() {
80
- return Date.now() - this.operationStartTime;
81
- }
82
- }
83
- /**
84
- * Create progress indicator for embedding search
85
- */
86
- export function createEmbeddingSearchProgress(total) {
87
- const indicator = new ProgressIndicator();
88
- indicator.start({
89
- total,
90
- message: 'Searching embeddings',
91
- showPercentage: true,
92
- showCount: true,
93
- });
94
- return indicator;
95
- }
96
- /**
97
- * Create progress indicator for plan generation
98
- */
99
- export function createPlanGenerationProgress() {
100
- const indicator = new ProgressIndicator();
101
- indicator.start({
102
- message: 'Generating plan',
103
- });
104
- return indicator;
105
- }
106
- /**
107
- * Create progress indicator for memory synthesis
108
- */
109
- export function createMemorySynthesisProgress() {
110
- const indicator = new ProgressIndicator();
111
- indicator.start({
112
- message: 'Synthesizing memories',
113
- });
114
- return indicator;
4
+ * This is intentionally a **no-op** implementation to avoid adding dependencies
5
+ * or noisy console output in non-interactive/test environments.
6
+ */
7
+ export function createEmbeddingSearchProgress(_estimatedTotalChunks) {
8
+ return {
9
+ start: () => { },
10
+ stop: () => { },
11
+ };
115
12
  }
116
13
  //# sourceMappingURL=progress-indicator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-indicator.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,OAAO,iBAAiB;IACpB,OAAO,GAA4C,IAAI,CAAC;IACxD,WAAW,GAAW,EAAE,CAAC;IACzB,kBAAkB,GAAW,CAAC,CAAC;IAC/B,YAAY,GAAW,CAAC,CAAC;IACzB,KAAK,GAAW,CAAC,CAAC;IAClB,OAAO,GAAW,EAAE,CAAC;IAE7B;;OAEG;IACH,KAAK,CAAC,UAA2B,EAAE;QACjC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,eAAe,CAAC;QAElD,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YACnB,oBAAoB;YACpB,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,eAAe;YACf,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;IAED;;OAEG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EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;aAAM,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YAC1B,qBAAqB;YACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC;IAC9C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAAC,KAAa;IACzD,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC;QACd,KAAK;QACL,OAAO,EAAE,sBAAsB;QAC/B,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B;IAC1C,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC;QACd,OAAO,EAAE,iBAAiB;KAC3B,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B;IAC3C,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC;QACd,OAAO,EAAE,uBAAuB;KACjC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"progress-indicator.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAAC,qBAA6B;IACzE,OAAO;QACL,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;QACf,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;KACf,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export type RepoFingerprint = {
2
+ cwd: string;
3
+ kind: 'node' | 'python' | 'go' | 'rust' | 'unknown';
4
+ name?: string;
5
+ description?: string;
6
+ packageManager?: 'npm' | 'pnpm' | 'yarn';
7
+ scripts?: string[];
8
+ };
9
+ export declare function fingerprintRepo(cwd: string): RepoFingerprint;
10
+ //# sourceMappingURL=repo-fingerprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-fingerprint.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/repo-fingerprint.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAUF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CA0C5D"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * UX: Repo Fingerprint (deterministic, no LLM)
3
+ * Produces a quick, reliable summary of the current directory/repo.
4
+ */
5
+ import { existsSync, readFileSync, readdirSync } from 'fs';
6
+ import { join } from 'path';
7
+ function safeReadJson(path) {
8
+ try {
9
+ return JSON.parse(readFileSync(path, 'utf-8'));
10
+ }
11
+ catch {
12
+ return null;
13
+ }
14
+ }
15
+ export function fingerprintRepo(cwd) {
16
+ const pkgPath = join(cwd, 'package.json');
17
+ const pnpmLock = join(cwd, 'pnpm-lock.yaml');
18
+ const yarnLock = join(cwd, 'yarn.lock');
19
+ const npmLock = join(cwd, 'package-lock.json');
20
+ if (existsSync(pkgPath)) {
21
+ const pkg = safeReadJson(pkgPath) || {};
22
+ const scripts = pkg.scripts && typeof pkg.scripts === 'object'
23
+ ? Object.keys(pkg.scripts).sort()
24
+ : [];
25
+ const packageManager = existsSync(pnpmLock) ? 'pnpm' : existsSync(yarnLock) ? 'yarn' : existsSync(npmLock) ? 'npm' : 'npm';
26
+ return {
27
+ cwd,
28
+ kind: 'node',
29
+ name: typeof pkg.name === 'string' ? pkg.name : undefined,
30
+ description: typeof pkg.description === 'string' ? pkg.description : undefined,
31
+ packageManager,
32
+ scripts,
33
+ };
34
+ }
35
+ if (existsSync(join(cwd, 'pyproject.toml')) || existsSync(join(cwd, 'requirements.txt'))) {
36
+ return { cwd, kind: 'python' };
37
+ }
38
+ if (existsSync(join(cwd, 'go.mod'))) {
39
+ return { cwd, kind: 'go' };
40
+ }
41
+ if (existsSync(join(cwd, 'Cargo.toml'))) {
42
+ return { cwd, kind: 'rust' };
43
+ }
44
+ // Lightweight heuristic: if directory is empty-ish, call it unknown
45
+ try {
46
+ const entries = readdirSync(cwd);
47
+ if (entries.length === 0)
48
+ return { cwd, kind: 'unknown' };
49
+ }
50
+ catch {
51
+ // ignore
52
+ }
53
+ return { cwd, kind: 'unknown' };
54
+ }
55
+ //# sourceMappingURL=repo-fingerprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-fingerprint.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/repo-fingerprint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAW5B,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,OAA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,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;YAC9E,cAAc;YACd,OAAO;SACR,CAAC;IACJ,CAAC;IAED,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC;QACzF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC;QACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,oEAAoE;IACpE,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAClC,CAAC"}
@@ -4,5 +4,7 @@
4
4
  */
5
5
  export declare function executeAskCommand(question: string, options?: {
6
6
  stream?: boolean;
7
+ explain?: boolean;
8
+ json?: boolean;
7
9
  }): Promise<void>;
8
10
  //# sourceMappingURL=ask-command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ask-command.d.ts","sourceRoot":"","sources":["../../../../src/presentation/cli/commands/ask-command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwBH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8VvG"}
1
+ {"version":3,"file":"ask-command.d.ts","sourceRoot":"","sources":["../../../../src/presentation/cli/commands/ask-command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8c1I"}