codehere 0.4.0 → 0.5.0-alpha.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.
- package/README.md +7 -0
- package/dist/application/agents/execution-agent.js +2 -2
- package/dist/application/agents/execution-agent.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +16 -8
- package/dist/application/agents/planning-agent.js.map +1 -1
- package/dist/application/agents/validation-agent.js +2 -2
- package/dist/application/agents/validation-agent.js.map +1 -1
- package/dist/application/services/dependency-container.d.ts +30 -6
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +75 -43
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +6 -3
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/domain/entities/task.d.ts.map +1 -1
- package/dist/domain/entities/task.js +1 -1
- package/dist/domain/entities/task.js.map +1 -1
- package/dist/domain/errors/embeddings-not-found-error.d.ts +9 -0
- package/dist/domain/errors/embeddings-not-found-error.d.ts.map +1 -0
- package/dist/domain/errors/embeddings-not-found-error.js +13 -0
- package/dist/domain/errors/embeddings-not-found-error.js.map +1 -0
- package/dist/domain/interfaces/embedding-repository.interface.d.ts +5 -0
- package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -1
- package/dist/domain/services/environment-mode-manager.d.ts +4 -10
- package/dist/domain/services/environment-mode-manager.d.ts.map +1 -1
- package/dist/domain/services/environment-mode-manager.js +7 -22
- package/dist/domain/services/environment-mode-manager.js.map +1 -1
- package/dist/domain/services/risk-tier-detector.d.ts +8 -9
- package/dist/domain/services/risk-tier-detector.d.ts.map +1 -1
- package/dist/domain/services/risk-tier-detector.js +53 -40
- package/dist/domain/services/risk-tier-detector.js.map +1 -1
- package/dist/embed.d.ts.map +1 -1
- package/dist/embed.js +18 -8
- package/dist/embed.js.map +1 -1
- package/dist/index.js +308 -48
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.js +3 -3
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.js +6 -6
- package/dist/infrastructure/ai/provider-ai-service.js.map +1 -1
- package/dist/infrastructure/cache/query-result-cache.d.ts +14 -55
- package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/query-result-cache.js +40 -112
- package/dist/infrastructure/cache/query-result-cache.js.map +1 -1
- package/dist/infrastructure/cache/response-cache.d.ts +10 -78
- package/dist/infrastructure/cache/response-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/response-cache.js +22 -198
- package/dist/infrastructure/cache/response-cache.js.map +1 -1
- package/dist/infrastructure/cache/security-scan-cache.d.ts +8 -49
- package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/security-scan-cache.js +25 -102
- package/dist/infrastructure/cache/security-scan-cache.js.map +1 -1
- package/dist/infrastructure/completion/bash-completion.d.ts +2 -3
- package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/bash-completion.js +11 -87
- package/dist/infrastructure/completion/bash-completion.js.map +1 -1
- package/dist/infrastructure/completion/fish-completion.d.ts +2 -3
- package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/fish-completion.js +15 -58
- package/dist/infrastructure/completion/fish-completion.js.map +1 -1
- package/dist/infrastructure/completion/zsh-completion.d.ts +2 -3
- package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/zsh-completion.js +18 -73
- package/dist/infrastructure/completion/zsh-completion.js.map +1 -1
- package/dist/infrastructure/config/config-manager.js +2 -2
- package/dist/infrastructure/config/config-manager.js.map +1 -1
- package/dist/infrastructure/context/conversation-context.d.ts +27 -31
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
- package/dist/infrastructure/context/conversation-context.js +94 -136
- package/dist/infrastructure/context/conversation-context.js.map +1 -1
- package/dist/infrastructure/context/session-manager.d.ts +27 -11
- package/dist/infrastructure/context/session-manager.d.ts.map +1 -1
- package/dist/infrastructure/context/session-manager.js +69 -73
- package/dist/infrastructure/context/session-manager.js.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.js +102 -17
- package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
- package/dist/infrastructure/providers/openrouter-provider.d.ts +42 -0
- package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/openrouter-provider.js +399 -0
- package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
- package/dist/infrastructure/serialization/toon-serializer.d.ts +45 -0
- package/dist/infrastructure/serialization/toon-serializer.d.ts.map +1 -0
- package/dist/infrastructure/serialization/toon-serializer.js +119 -0
- package/dist/infrastructure/serialization/toon-serializer.js.map +1 -0
- package/dist/infrastructure/storage/embeddings-path.d.ts +18 -0
- package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -0
- package/dist/infrastructure/storage/embeddings-path.js +37 -0
- package/dist/infrastructure/storage/embeddings-path.js.map +1 -0
- package/dist/infrastructure/storage/plan-repository.d.ts +2 -0
- package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/plan-repository.js +36 -73
- package/dist/infrastructure/storage/plan-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +10 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.js +37 -3
- package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
- package/dist/infrastructure/storage/task-helpers.d.ts +11 -0
- package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-helpers.js +47 -7
- package/dist/infrastructure/storage/task-helpers.js.map +1 -1
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-repository.js.map +1 -1
- package/dist/infrastructure/ux/capability-boundaries.d.ts +9 -37
- package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -1
- package/dist/infrastructure/ux/capability-boundaries.js +23 -148
- package/dist/infrastructure/ux/capability-boundaries.js.map +1 -1
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts +12 -54
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -1
- package/dist/infrastructure/ux/comprehensive-formatter.js +87 -182
- package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -1
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +5 -18
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -1
- package/dist/infrastructure/ux/contextual-feature-discovery.js +5 -139
- package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -1
- package/dist/infrastructure/ux/feature-discovery.d.ts +3 -33
- package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -1
- package/dist/infrastructure/ux/feature-discovery.js +5 -181
- package/dist/infrastructure/ux/feature-discovery.js.map +1 -1
- package/dist/infrastructure/ux/feedback-prompt.d.ts +15 -31
- package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -1
- package/dist/infrastructure/ux/feedback-prompt.js +30 -166
- package/dist/infrastructure/ux/feedback-prompt.js.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.d.ts +3 -5
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.js +34 -49
- package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
- package/dist/infrastructure/ux/review-checkpoint.d.ts +3 -1
- package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -1
- package/dist/infrastructure/ux/review-checkpoint.js +33 -80
- package/dist/infrastructure/ux/review-checkpoint.js.map +1 -1
- package/dist/infrastructure/ux/staged-feature-intro.d.ts +14 -39
- package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -1
- package/dist/infrastructure/ux/staged-feature-intro.js +12 -132
- package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -1
- package/dist/infrastructure/ux/syntax-highlighter.d.ts +1 -2
- package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -1
- package/dist/infrastructure/ux/syntax-highlighter.js +67 -148
- package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.d.ts +25 -89
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.js +32 -204
- package/dist/infrastructure/validation/agent-feedback.js.map +1 -1
- package/dist/infrastructure/validation/agent-validation-helper.d.ts +53 -53
- package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -1
- package/dist/infrastructure/validation/agent-validation-helper.js +110 -61
- package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -1
- package/dist/infrastructure/validation/review-handler.d.ts +13 -41
- package/dist/infrastructure/validation/review-handler.d.ts.map +1 -1
- package/dist/infrastructure/validation/review-handler.js +23 -189
- package/dist/infrastructure/validation/review-handler.js.map +1 -1
- package/dist/infrastructure/validation/summary-aggregator.d.ts +25 -22
- package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -1
- package/dist/infrastructure/validation/summary-aggregator.js +47 -133
- package/dist/infrastructure/validation/summary-aggregator.js.map +1 -1
- package/dist/infrastructure/validation/summary-extractor.d.ts +13 -48
- package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -1
- package/dist/infrastructure/validation/summary-extractor.js +32 -89
- package/dist/infrastructure/validation/summary-extractor.js.map +1 -1
- package/dist/infrastructure/validation/trace-summary.d.ts +30 -57
- package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -1
- package/dist/infrastructure/validation/trace-summary.js +37 -356
- package/dist/infrastructure/validation/trace-summary.js.map +1 -1
- package/dist/monitoring.d.ts +1 -1
- package/dist/monitoring.d.ts.map +1 -1
- package/dist/monitoring.js +12 -9
- package/dist/monitoring.js.map +1 -1
- package/dist/parallel-processor.d.ts.map +1 -1
- package/dist/parallel-processor.js +124 -45
- package/dist/parallel-processor.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +185 -128
- package/dist/presentation/cli/commands/ask-command.js.map +1 -1
- package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/config-command.js +8 -6
- package/dist/presentation/cli/commands/config-command.js.map +1 -1
- package/dist/presentation/cli/commands/docs-command.d.ts +3 -1
- package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/docs-command.js +13 -184
- package/dist/presentation/cli/commands/docs-command.js.map +1 -1
- package/dist/presentation/cli/commands/fix-command.d.ts +2 -0
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/fix-command.js +25 -281
- package/dist/presentation/cli/commands/fix-command.js.map +1 -1
- package/dist/presentation/cli/commands/models-command.d.ts +13 -0
- package/dist/presentation/cli/commands/models-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/models-command.js +194 -0
- package/dist/presentation/cli/commands/models-command.js.map +1 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +15 -7
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/plan-command.js +9 -6
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/product-command.d.ts +6 -4
- package/dist/presentation/cli/commands/product-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/product-command.js +12 -178
- package/dist/presentation/cli/commands/product-command.js.map +1 -1
- package/dist/presentation/cli/commands/review-command.d.ts +7 -7
- package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/review-command.js +148 -16
- package/dist/presentation/cli/commands/review-command.js.map +1 -1
- package/dist/presentation/cli/commands/run-command.d.ts +6 -8
- package/dist/presentation/cli/commands/run-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/run-command.js +182 -23
- package/dist/presentation/cli/commands/run-command.js.map +1 -1
- package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/setup-command.js +15 -0
- package/dist/presentation/cli/commands/setup-command.js.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +1 -1
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts +3 -0
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/status-command.js +147 -156
- package/dist/presentation/cli/commands/status-command.js.map +1 -1
- package/dist/presentation/cli/commands/suggest-command.d.ts +3 -5
- package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/suggest-command.js +132 -19
- package/dist/presentation/cli/commands/suggest-command.js.map +1 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +6 -1
- package/dist/search.js.map +1 -1
- package/dist/session.js +1 -1
- package/dist/session.js.map +1 -1
- package/dist/ui.d.ts +6 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +35 -1
- package/dist/ui.js.map +1 -1
- package/package.json +8 -3
|
@@ -1,190 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Feature Discovery
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
import { readFileSync, existsSync, writeFileSync, mkdirSync } from 'fs';
|
|
6
|
-
import { join } from 'path';
|
|
7
|
-
const DISCOVERY_FEATURES = [
|
|
8
|
-
{
|
|
9
|
-
id: 'basic-commands',
|
|
10
|
-
trigger: { commandCount: 3 },
|
|
11
|
-
message: 'You\'ve mastered the basics! Try these next:',
|
|
12
|
-
features: [
|
|
13
|
-
{
|
|
14
|
-
name: 'Multi-agent Orchestration',
|
|
15
|
-
description: 'Plan and execute complex multi-step tasks',
|
|
16
|
-
command: 'codehere orchestrate "your goal"',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'ReAct Reasoning',
|
|
20
|
-
description: 'Debug and solve complex problems step-by-step',
|
|
21
|
-
command: 'codehere react "your problem"',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'Planning',
|
|
25
|
-
description: 'Generate hierarchical plans for large tasks',
|
|
26
|
-
command: 'codehere plan "your goal"',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 'advanced-features',
|
|
32
|
-
trigger: { commandCount: 5 },
|
|
33
|
-
message: 'Ready for advanced features? Discover more:',
|
|
34
|
-
features: [
|
|
35
|
-
{
|
|
36
|
-
name: 'Execution Tracing',
|
|
37
|
-
description: 'View and reproduce agent execution traces',
|
|
38
|
-
command: 'codehere trace show <runId>',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'Knowledge Management',
|
|
42
|
-
description: 'Query and manage preserved knowledge',
|
|
43
|
-
command: 'codehere knowledge query "your query"',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'Learning Dashboard',
|
|
47
|
-
description: 'View patterns and insights learned',
|
|
48
|
-
command: 'codehere learning overview',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: 'config-management',
|
|
54
|
-
trigger: { commands: ['ask', 'explain', 'edit'] },
|
|
55
|
-
message: 'Customize your experience:',
|
|
56
|
-
features: [
|
|
57
|
-
{
|
|
58
|
-
name: 'Configuration',
|
|
59
|
-
description: 'Manage preferences and settings',
|
|
60
|
-
command: 'codehere config',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'Auto-completion',
|
|
64
|
-
description: 'Install shell completion for faster commands',
|
|
65
|
-
command: 'codehere completion bash',
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
/**
|
|
71
|
-
* Get onboarding state from file
|
|
72
|
-
*/
|
|
73
|
-
function getOnboardingState() {
|
|
74
|
-
try {
|
|
75
|
-
const configDir = join(process.cwd(), 'data');
|
|
76
|
-
const onboardingPath = join(configDir, 'onboarding.json');
|
|
77
|
-
if (existsSync(onboardingPath)) {
|
|
78
|
-
const state = JSON.parse(readFileSync(onboardingPath, 'utf-8'));
|
|
79
|
-
return {
|
|
80
|
-
onboardingComplete: state.onboardingComplete || false,
|
|
81
|
-
onboardingDate: state.onboardingDate,
|
|
82
|
-
commandCount: state.commandCount || 0,
|
|
83
|
-
featuresDiscovered: state.featuresDiscovered || [],
|
|
84
|
-
lastDiscoveryShown: state.lastDiscoveryShown,
|
|
85
|
-
lastDiscoveryDate: state.lastDiscoveryDate,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch {
|
|
90
|
-
// Ignore errors
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
onboardingComplete: false,
|
|
94
|
-
commandCount: 0,
|
|
95
|
-
featuresDiscovered: [],
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Save onboarding state
|
|
100
|
-
*/
|
|
101
|
-
function saveOnboardingState(state) {
|
|
102
|
-
try {
|
|
103
|
-
const configDir = join(process.cwd(), 'data');
|
|
104
|
-
if (!existsSync(configDir)) {
|
|
105
|
-
mkdirSync(configDir, { recursive: true });
|
|
106
|
-
}
|
|
107
|
-
const onboardingPath = join(configDir, 'onboarding.json');
|
|
108
|
-
writeFileSync(onboardingPath, JSON.stringify(state, null, 2));
|
|
109
|
-
}
|
|
110
|
-
catch {
|
|
111
|
-
// Ignore errors - non-critical
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Track command usage
|
|
2
|
+
* Feature Discovery (v0.5.0-alpha.0 - Stub)
|
|
3
|
+
* TODO: Implement feature discovery system
|
|
116
4
|
*/
|
|
117
5
|
export function trackCommand(command) {
|
|
118
|
-
|
|
119
|
-
state.commandCount = (state.commandCount || 0) + 1;
|
|
120
|
-
// Track feature discovery
|
|
121
|
-
if (!state.featuresDiscovered.includes(command)) {
|
|
122
|
-
state.featuresDiscovered.push(command);
|
|
123
|
-
}
|
|
124
|
-
saveOnboardingState(state);
|
|
6
|
+
// Stub implementation
|
|
125
7
|
}
|
|
126
|
-
/**
|
|
127
|
-
* Check if feature discovery should be shown
|
|
128
|
-
*/
|
|
129
8
|
export function shouldShowFeatureDiscovery(command) {
|
|
130
|
-
const state = getOnboardingState();
|
|
131
|
-
// Don't show if onboarding not complete
|
|
132
|
-
if (!state.onboardingComplete) {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
// Don't show discovery too frequently (once per day max)
|
|
136
|
-
const lastDate = state.lastDiscoveryDate;
|
|
137
|
-
if (lastDate) {
|
|
138
|
-
const lastShown = new Date(lastDate);
|
|
139
|
-
const now = new Date();
|
|
140
|
-
const daysSince = (now.getTime() - lastShown.getTime()) / (1000 * 60 * 60 * 24);
|
|
141
|
-
if (daysSince < 1) {
|
|
142
|
-
return null; // Already shown today
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// Check each discovery feature
|
|
146
|
-
for (const discovery of DISCOVERY_FEATURES) {
|
|
147
|
-
// Skip if already shown
|
|
148
|
-
if (state.lastDiscoveryShown === discovery.id) {
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
const trigger = discovery.trigger;
|
|
152
|
-
// Check command count trigger
|
|
153
|
-
if (trigger.commandCount && state.commandCount >= trigger.commandCount) {
|
|
154
|
-
return discovery;
|
|
155
|
-
}
|
|
156
|
-
// Check commands trigger
|
|
157
|
-
if (trigger.commands && trigger.commands.includes(command)) {
|
|
158
|
-
return discovery;
|
|
159
|
-
}
|
|
160
|
-
// Check custom condition
|
|
161
|
-
if (trigger.condition && trigger.condition(state)) {
|
|
162
|
-
return discovery;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
9
|
return null;
|
|
166
10
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
*/
|
|
170
|
-
export function markFeatureDiscoveryShown(discoveryId) {
|
|
171
|
-
const state = getOnboardingState();
|
|
172
|
-
state.lastDiscoveryShown = discoveryId;
|
|
173
|
-
state.lastDiscoveryDate = new Date().toISOString();
|
|
174
|
-
saveOnboardingState(state);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Check if user is first-time (onboarding not complete)
|
|
178
|
-
*/
|
|
179
|
-
export function isFirstTimeUser() {
|
|
180
|
-
const state = getOnboardingState();
|
|
181
|
-
return !state.onboardingComplete;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Get command count for analytics
|
|
185
|
-
*/
|
|
186
|
-
export function getCommandCount() {
|
|
187
|
-
const state = getOnboardingState();
|
|
188
|
-
return state.commandCount || 0;
|
|
11
|
+
export function markFeatureDiscoveryShown(id) {
|
|
12
|
+
// Stub implementation
|
|
189
13
|
}
|
|
190
14
|
//# sourceMappingURL=feature-discovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-discovery.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"feature-discovery.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,sBAAsB;AACxB,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAe;IACxD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,EAAU;IAClD,sBAAsB;AACxB,CAAC"}
|
|
@@ -1,42 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Feedback Prompt
|
|
3
|
+
* Collect and store user feedback for bidirectional learning
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Feedback prompts after operations
|
|
7
|
-
* - Thumbs up/down collection
|
|
8
|
-
* - Refinement request option
|
|
9
|
-
* - Feedback storage for learning
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
10
6
|
*/
|
|
11
|
-
|
|
12
|
-
export type FeedbackAction = 'thumbs_up' | 'thumbs_down' | 'refine' | 'skip';
|
|
13
|
-
export interface FeedbackResult {
|
|
14
|
-
action: FeedbackAction;
|
|
15
|
-
signal: FeedbackSignal;
|
|
16
|
-
message?: string;
|
|
17
|
-
timestamp: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Display feedback prompt and collect user input
|
|
21
|
-
* Task 6.1: Explicit feedback collection after operations
|
|
22
|
-
* FIXED: Now works in non-TTY mode via environment variables
|
|
23
|
-
*/
|
|
24
|
-
export declare function promptForFeedback(operation: string, context?: {
|
|
7
|
+
interface FeedbackContext {
|
|
25
8
|
query?: string;
|
|
26
9
|
response?: string;
|
|
27
10
|
sessionId?: string;
|
|
28
|
-
|
|
11
|
+
operation?: string;
|
|
12
|
+
}
|
|
29
13
|
/**
|
|
30
|
-
*
|
|
14
|
+
* Prompt user for feedback (non-blocking, returns null if user skips)
|
|
31
15
|
*/
|
|
32
|
-
export declare function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}): string;
|
|
16
|
+
export declare function promptForFeedback(operation: string, context: FeedbackContext): Promise<string | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Store feedback in the learning system
|
|
19
|
+
*/
|
|
20
|
+
export declare function storeFeedback(learningSystem: any, userId: string, feedback: string, metadata: FeedbackContext): void;
|
|
38
21
|
/**
|
|
39
|
-
* Display feedback confirmation
|
|
22
|
+
* Display feedback confirmation message
|
|
40
23
|
*/
|
|
41
|
-
export declare function displayFeedbackConfirmation(feedback:
|
|
24
|
+
export declare function displayFeedbackConfirmation(feedback: string): void;
|
|
25
|
+
export {};
|
|
42
26
|
//# sourceMappingURL=feedback-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback-prompt.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/feedback-prompt.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"feedback-prompt.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/feedback-prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,UAAU,eAAe;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,cAAc,EAAE,GAAG,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,eAAe,GACxB,IAAI,CAmBN;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAGlE"}
|
|
@@ -1,181 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Feedback Prompt
|
|
3
|
+
* Collect and store user feedback for bidirectional learning
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Feedback prompts after operations
|
|
7
|
-
* - Thumbs up/down collection
|
|
8
|
-
* - Refinement request option
|
|
9
|
-
* - Feedback storage for learning
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
10
6
|
*/
|
|
11
|
-
import { colors, createBox, separator, newline } from '../../ui.js';
|
|
12
|
-
import * as readline from 'readline';
|
|
13
7
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Task 6.1: Explicit feedback collection after operations
|
|
16
|
-
* FIXED: Now works in non-TTY mode via environment variables
|
|
8
|
+
* Prompt user for feedback (non-blocking, returns null if user skips)
|
|
17
9
|
*/
|
|
18
10
|
export async function promptForFeedback(operation, context) {
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
// Check for environment variable feedback (for non-interactive mode)
|
|
23
|
-
const envFeedback = process.env.CODEHERE_FEEDBACK;
|
|
24
|
-
if (envFeedback) {
|
|
25
|
-
const normalized = envFeedback.trim().toLowerCase();
|
|
26
|
-
let action;
|
|
27
|
-
let signal;
|
|
28
|
-
if (normalized === 'y' || normalized === 'yes' || normalized === 'positive' || normalized === 'thumbs_up') {
|
|
29
|
-
action = 'thumbs_up';
|
|
30
|
-
signal = 'positive';
|
|
31
|
-
}
|
|
32
|
-
else if (normalized === 'n' || normalized === 'no' || normalized === 'negative' || normalized === 'thumbs_down') {
|
|
33
|
-
action = 'thumbs_down';
|
|
34
|
-
signal = 'negative';
|
|
35
|
-
}
|
|
36
|
-
else if (normalized === 'r' || normalized === 'refine' || normalized === 'refinement') {
|
|
37
|
-
action = 'refine';
|
|
38
|
-
signal = 'neutral';
|
|
39
|
-
// Get refinement message from env var if available
|
|
40
|
-
const refineMsg = process.env.CODEHERE_FEEDBACK_MESSAGE;
|
|
41
|
-
return {
|
|
42
|
-
action,
|
|
43
|
-
signal,
|
|
44
|
-
message: refineMsg?.trim() || undefined,
|
|
45
|
-
timestamp: Date.now(),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Invalid or skip
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
action,
|
|
54
|
-
signal,
|
|
55
|
-
timestamp: Date.now(),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
// No TTY and no env var - skip silently (non-blocking)
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
newline();
|
|
62
|
-
console.log(separator('─', 80));
|
|
63
|
-
const feedbackBox = createBox([
|
|
64
|
-
`${colors.bold('Was this helpful?')}`,
|
|
65
|
-
'',
|
|
66
|
-
`${colors.dim('Press:')}`,
|
|
67
|
-
` ${colors.green('👍')} ${colors.cyan('y')} or ${colors.cyan('Enter')} - Yes (thumbs up)`,
|
|
68
|
-
` ${colors.red('👎')} ${colors.cyan('n')} - No (thumbs down)`,
|
|
69
|
-
` ${colors.yellow('✏️')} ${colors.cyan('r')} - Request refinement`,
|
|
70
|
-
` ${colors.dim('s')} - Skip`,
|
|
71
|
-
'',
|
|
72
|
-
`${colors.dim('Your feedback helps improve Codehere!')}`,
|
|
73
|
-
].join('\n'), { borderColor: colors.cyan });
|
|
74
|
-
console.log(feedbackBox);
|
|
75
|
-
console.log(separator('─', 80));
|
|
76
|
-
newline();
|
|
77
|
-
// Create readline interface for input
|
|
78
|
-
const rl = readline.createInterface({
|
|
79
|
-
input: process.stdin,
|
|
80
|
-
output: process.stdout,
|
|
81
|
-
});
|
|
82
|
-
return new Promise((resolve) => {
|
|
83
|
-
const timeout = setTimeout(() => {
|
|
84
|
-
rl.close();
|
|
85
|
-
resolve(null); // Timeout - skip feedback
|
|
86
|
-
}, 10000); // 10 second timeout
|
|
87
|
-
rl.question(colors.dim('Your choice: '), (answer) => {
|
|
88
|
-
clearTimeout(timeout);
|
|
89
|
-
rl.close();
|
|
90
|
-
const normalized = answer.trim().toLowerCase();
|
|
91
|
-
let action;
|
|
92
|
-
let signal;
|
|
93
|
-
if (normalized === 'y' || normalized === 'yes' || normalized === '' || normalized === '👍') {
|
|
94
|
-
action = 'thumbs_up';
|
|
95
|
-
signal = 'positive';
|
|
96
|
-
}
|
|
97
|
-
else if (normalized === 'n' || normalized === 'no' || normalized === '👎') {
|
|
98
|
-
action = 'thumbs_down';
|
|
99
|
-
signal = 'negative';
|
|
100
|
-
}
|
|
101
|
-
else if (normalized === 'r' || normalized === 'refine' || normalized === '✏️') {
|
|
102
|
-
action = 'refine';
|
|
103
|
-
signal = 'neutral';
|
|
104
|
-
}
|
|
105
|
-
else if (normalized === 's' || normalized === 'skip') {
|
|
106
|
-
resolve(null); // Skip feedback
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
// Invalid input - skip
|
|
111
|
-
resolve(null);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const result = {
|
|
115
|
-
action,
|
|
116
|
-
signal,
|
|
117
|
-
timestamp: Date.now(),
|
|
118
|
-
};
|
|
119
|
-
// If refinement requested, ask for details
|
|
120
|
-
if (action === 'refine') {
|
|
121
|
-
const refineRl = readline.createInterface({
|
|
122
|
-
input: process.stdin,
|
|
123
|
-
output: process.stdout,
|
|
124
|
-
});
|
|
125
|
-
refineRl.question(colors.cyan('What would you like to refine? '), (refinementMessage) => {
|
|
126
|
-
refineRl.close();
|
|
127
|
-
result.message = refinementMessage.trim() || undefined;
|
|
128
|
-
resolve(result);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
resolve(result);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
11
|
+
// In alpha, we skip interactive prompts to avoid blocking
|
|
12
|
+
// This can be enhanced later with readline-based prompts
|
|
13
|
+
return null;
|
|
136
14
|
}
|
|
137
15
|
/**
|
|
138
|
-
* Store feedback
|
|
16
|
+
* Store feedback in the learning system
|
|
139
17
|
*/
|
|
140
|
-
export function storeFeedback(learningSystem, userId, feedback,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
18
|
+
export function storeFeedback(learningSystem, userId, feedback, metadata) {
|
|
19
|
+
if (!learningSystem || !feedback) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
// Store feedback if learning system supports it
|
|
24
|
+
if (typeof learningSystem.storeFeedback === 'function') {
|
|
25
|
+
learningSystem.storeFeedback({
|
|
26
|
+
userId,
|
|
27
|
+
feedback,
|
|
28
|
+
metadata,
|
|
29
|
+
timestamp: new Date().toISOString(),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
// Silent failure - feedback collection should not break the workflow
|
|
35
|
+
console.error('Failed to store feedback:', error);
|
|
36
|
+
}
|
|
151
37
|
}
|
|
152
38
|
/**
|
|
153
|
-
* Display feedback confirmation
|
|
39
|
+
* Display feedback confirmation message
|
|
154
40
|
*/
|
|
155
41
|
export function displayFeedbackConfirmation(feedback) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
let color;
|
|
159
|
-
switch (feedback.action) {
|
|
160
|
-
case 'thumbs_up':
|
|
161
|
-
message = `${colors.green('👍')} Thank you for your positive feedback!`;
|
|
162
|
-
color = colors.green;
|
|
163
|
-
break;
|
|
164
|
-
case 'thumbs_down':
|
|
165
|
-
message = `${colors.red('👎')} Thank you for your feedback. We'll use this to improve.`;
|
|
166
|
-
color = colors.yellow;
|
|
167
|
-
break;
|
|
168
|
-
case 'refine':
|
|
169
|
-
message = `${colors.yellow('✏️')} Refinement request recorded. We'll work on improving this.`;
|
|
170
|
-
color = colors.cyan;
|
|
171
|
-
break;
|
|
172
|
-
default:
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
console.log(color(message));
|
|
176
|
-
if (feedback.message) {
|
|
177
|
-
console.log(colors.dim(` Note: "${feedback.message}"`));
|
|
178
|
-
}
|
|
179
|
-
newline();
|
|
42
|
+
// In alpha, skip confirmation display to keep CLI clean
|
|
43
|
+
// This can be enhanced later
|
|
180
44
|
}
|
|
181
45
|
//# sourceMappingURL=feedback-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback-prompt.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/feedback-prompt.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"feedback-prompt.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/feedback-prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAiB,EACjB,OAAwB;IAExB,0DAA0D;IAC1D,yDAAyD;IACzD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,cAAmB,EACnB,MAAc,EACd,QAAgB,EAChB,QAAyB;IAEzB,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,gDAAgD;QAChD,IAAI,OAAO,cAAc,CAAC,aAAa,KAAK,UAAU,EAAE,CAAC;YACvD,cAAc,CAAC,aAAa,CAAC;gBAC3B,MAAM;gBACN,QAAQ;gBACR,QAAQ;gBACR,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qEAAqE;QACrE,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,QAAgB;IAC1D,wDAAwD;IACxD,6BAA6B;AAC/B,CAAC"}
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
* Progress Indicator Utilities
|
|
3
3
|
* Provides progress indicators for long-running operations
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Progress bars for operations with known total
|
|
7
|
-
* - Spinners for operations with unknown duration
|
|
8
|
-
* - Context-aware progress messages
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
9
6
|
*/
|
|
10
7
|
export interface ProgressOptions {
|
|
11
8
|
total?: number;
|
|
@@ -18,6 +15,8 @@ export declare class ProgressIndicator {
|
|
|
18
15
|
private progressBar;
|
|
19
16
|
private operationStartTime;
|
|
20
17
|
private currentValue;
|
|
18
|
+
private total;
|
|
19
|
+
private message;
|
|
21
20
|
/**
|
|
22
21
|
* Start progress indicator
|
|
23
22
|
*/
|
|
@@ -32,7 +31,6 @@ export declare class ProgressIndicator {
|
|
|
32
31
|
increment(delta?: number, message?: string): void;
|
|
33
32
|
/**
|
|
34
33
|
* Stop progress indicator with smooth transition
|
|
35
|
-
* DELIGHTFUL UX: Smooth completion with visual feedback
|
|
36
34
|
*/
|
|
37
35
|
stop(success?: boolean, finalMessage?: string): void;
|
|
38
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-indicator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAAA
|
|
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"}
|