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,124 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Caches security scan results
|
|
2
|
+
* Security Scan Cache
|
|
3
|
+
* Caches security scan results
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* Cache invalidation: Automatically invalidates when file content changes
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
7
6
|
*/
|
|
8
7
|
import { createHash } from 'crypto';
|
|
9
|
-
|
|
8
|
+
class SecurityScanCache {
|
|
10
9
|
cache = new Map();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.maxSize = maxSize;
|
|
15
|
-
this.ttl = ttl;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generate content hash from file path and code content
|
|
19
|
-
*/
|
|
20
|
-
getContentHash(filepath, code) {
|
|
21
|
-
const normalized = `${filepath}:${code}`;
|
|
22
|
-
return createHash('sha256').update(normalized).digest('hex');
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Generate cache key from filepath
|
|
26
|
-
*/
|
|
27
|
-
getCacheKey(filepath, contentHash) {
|
|
28
|
-
return createHash('sha256').update(`${filepath}:${contentHash}`).digest('hex');
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get cached scan results if available and not expired
|
|
32
|
-
*/
|
|
33
|
-
get(filepath, code) {
|
|
34
|
-
const contentHash = this.getContentHash(filepath, code);
|
|
35
|
-
const key = this.getCacheKey(filepath, contentHash);
|
|
10
|
+
ttl = 3600000; // 1 hour
|
|
11
|
+
get(filepath, contentHash) {
|
|
12
|
+
const key = `${filepath}:${contentHash}`;
|
|
36
13
|
const cached = this.cache.get(key);
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// Check if expired
|
|
46
|
-
const now = Date.now();
|
|
47
|
-
if (now - cached.timestamp > this.ttl) {
|
|
48
|
-
this.cache.delete(key);
|
|
49
|
-
return null;
|
|
14
|
+
if (cached) {
|
|
15
|
+
const age = Date.now() - cached.timestamp;
|
|
16
|
+
if (age < this.ttl) {
|
|
17
|
+
return cached.results;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this.cache.delete(key);
|
|
21
|
+
}
|
|
50
22
|
}
|
|
51
|
-
return
|
|
52
|
-
sast: cached.sast,
|
|
53
|
-
license: cached.license,
|
|
54
|
-
providerBias: cached.providerBias,
|
|
55
|
-
};
|
|
23
|
+
return null;
|
|
56
24
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Store scan results in cache
|
|
59
|
-
*/
|
|
60
25
|
set(filepath, code, sast, license, providerBias) {
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
if (this.cache.size >= this.maxSize) {
|
|
65
|
-
this.evictOldest();
|
|
66
|
-
}
|
|
26
|
+
// Create hash from code content
|
|
27
|
+
const contentHash = createHash('sha256').update(code).digest('hex');
|
|
28
|
+
const key = `${filepath}:${contentHash}`;
|
|
67
29
|
this.cache.set(key, {
|
|
68
30
|
filepath,
|
|
69
|
-
contentHash,
|
|
70
|
-
sast,
|
|
71
|
-
license,
|
|
72
|
-
providerBias,
|
|
31
|
+
hash: contentHash,
|
|
32
|
+
results: { sast, license, providerBias },
|
|
73
33
|
timestamp: Date.now(),
|
|
74
34
|
});
|
|
75
35
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Evict oldest entries (LRU eviction)
|
|
78
|
-
*/
|
|
79
|
-
evictOldest() {
|
|
80
|
-
// Remove 10% of oldest entries
|
|
81
|
-
const entriesToRemove = Math.ceil(this.maxSize * 0.1);
|
|
82
|
-
const entries = Array.from(this.cache.entries())
|
|
83
|
-
.sort((a, b) => a[1].timestamp - b[1].timestamp)
|
|
84
|
-
.slice(0, entriesToRemove);
|
|
85
|
-
for (const [key] of entries) {
|
|
86
|
-
this.cache.delete(key);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Clear expired entries
|
|
91
|
-
*/
|
|
92
|
-
clearExpired() {
|
|
93
|
-
const now = Date.now();
|
|
94
|
-
for (const [key, value] of this.cache.entries()) {
|
|
95
|
-
if (now - value.timestamp > this.ttl) {
|
|
96
|
-
this.cache.delete(key);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Clear all cache
|
|
102
|
-
*/
|
|
103
36
|
clear() {
|
|
104
37
|
this.cache.clear();
|
|
105
38
|
}
|
|
106
|
-
/**
|
|
107
|
-
* Get cache statistics
|
|
108
|
-
*/
|
|
109
|
-
getStats() {
|
|
110
|
-
return {
|
|
111
|
-
size: this.cache.size,
|
|
112
|
-
maxSize: this.maxSize,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
39
|
}
|
|
116
|
-
|
|
117
|
-
let securityScanCacheInstance = null;
|
|
40
|
+
let instance = null;
|
|
118
41
|
export function getSecurityScanCache() {
|
|
119
|
-
if (!
|
|
120
|
-
|
|
42
|
+
if (!instance) {
|
|
43
|
+
instance = new SecurityScanCache();
|
|
121
44
|
}
|
|
122
|
-
return
|
|
45
|
+
return instance;
|
|
123
46
|
}
|
|
124
47
|
//# sourceMappingURL=security-scan-cache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scan-cache.js","sourceRoot":"","sources":["../../../src/infrastructure/cache/security-scan-cache.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"security-scan-cache.js","sourceRoot":"","sources":["../../../src/infrastructure/cache/security-scan-cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AASpC,MAAM,iBAAiB;IACb,KAAK,GAA4B,IAAI,GAAG,EAAE,CAAC;IAClC,GAAG,GAAG,OAAO,CAAC,CAAC,SAAS;IAEzC,GAAG,CAAC,QAAgB,EAAE,WAAmB;QACvC,MAAM,GAAG,GAAG,GAAG,QAAQ,IAAI,WAAW,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEnC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;YAC1C,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBACnB,OAAO,MAAM,CAAC,OAAO,CAAC;YACxB,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG,CAAC,QAAgB,EAAE,IAAY,EAAE,IAAS,EAAE,OAAa,EAAE,YAAkB;QAC9E,gCAAgC;QAChC,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpE,MAAM,GAAG,GAAG,GAAG,QAAQ,IAAI,WAAW,EAAE,CAAC;QACzC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE;YAClB,QAAQ;YACR,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE;YACxC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF;AAED,IAAI,QAAQ,GAA6B,IAAI,CAAC;AAE9C,MAAM,UAAU,oBAAoB;IAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;IACrC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash-completion.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/completion/bash-completion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bash-completion.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/completion/bash-completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,sBAAsB,IAAI,MAAM,CAkB/C"}
|
|
@@ -1,101 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bash Completion Script Generator
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Generate bash completion script
|
|
3
|
+
*
|
|
4
|
+
* Phase 1: v0.5.0-alpha.0
|
|
7
5
|
*/
|
|
8
6
|
export function generateBashCompletion() {
|
|
9
|
-
return `#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_codehere_completion() {
|
|
13
|
-
local cur prev words cword
|
|
7
|
+
return `# Codehere bash completion
|
|
8
|
+
_complete_codehere() {
|
|
9
|
+
local cur prev opts
|
|
14
10
|
COMPREPLY=()
|
|
15
11
|
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
16
12
|
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
17
|
-
|
|
18
|
-
cword="\${COMP_CWORD}"
|
|
19
|
-
|
|
20
|
-
# Commands list
|
|
21
|
-
local commands="${getAllCommands().join(' ')}"
|
|
13
|
+
opts="ask plan orchestrate fix suggest run review status help version"
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
if [[ \${cur} == -* ]]; then
|
|
16
|
+
COMPREPLY=(\$(compgen -W "--help --version" -- \${cur}))
|
|
17
|
+
else
|
|
18
|
+
COMPREPLY=(\$(compgen -W "\${opts}" -- \${cur}))
|
|
27
19
|
fi
|
|
28
|
-
|
|
29
|
-
local command="\${words[1]}"
|
|
30
|
-
|
|
31
|
-
case "\${command}" in
|
|
32
|
-
config)
|
|
33
|
-
if [ $COMP_CWORD -eq 2 ]; then
|
|
34
|
-
COMPREPLY=( $(compgen -W "get set reset" -- "\${cur}") )
|
|
35
|
-
elif [ $COMP_CWORD -eq 3 ] && [ "\${prev}" = "get" ] || [ "\${prev}" = "set" ]; then
|
|
36
|
-
# Config keys (simplified - would need dynamic lookup)
|
|
37
|
-
local keys="autoCommit temperature maxResults model enableStreaming enableSecurityScan enableVerification"
|
|
38
|
-
COMPREPLY=( $(compgen -W "\${keys}" -- "\${cur}") )
|
|
39
|
-
fi
|
|
40
|
-
;;
|
|
41
|
-
undo)
|
|
42
|
-
if [ $COMP_CWORD -eq 2 ]; then
|
|
43
|
-
COMPREPLY=( $(compgen -W "undo list restore" -- "\${cur}") )
|
|
44
|
-
fi
|
|
45
|
-
;;
|
|
46
|
-
trace)
|
|
47
|
-
if [ $COMP_CWORD -eq 2 ]; then
|
|
48
|
-
COMPREPLY=( $(compgen -W "show reproduce list" -- "\${cur}") )
|
|
49
|
-
fi
|
|
50
|
-
;;
|
|
51
|
-
decision)
|
|
52
|
-
if [ $COMP_CWORD -eq 2 ]; then
|
|
53
|
-
COMPREPLY=( $(compgen -W "record list query explain" -- "\${cur}") )
|
|
54
|
-
fi
|
|
55
|
-
;;
|
|
56
|
-
knowledge)
|
|
57
|
-
if [ $COMP_CWORD -eq 2 ]; then
|
|
58
|
-
COMPREPLY=( $(compgen -W "query list summary extract" -- "\${cur}") )
|
|
59
|
-
fi
|
|
60
|
-
;;
|
|
61
|
-
learning)
|
|
62
|
-
if [ $COMP_CWORD -eq 2 ]; then
|
|
63
|
-
COMPREPLY=( $(compgen -W "overview patterns knowledge insights" -- "\${cur}") )
|
|
64
|
-
fi
|
|
65
|
-
;;
|
|
66
|
-
cost)
|
|
67
|
-
if [ $COMP_CWORD -eq 2 ]; then
|
|
68
|
-
COMPREPLY=( $(compgen -W "status summary run reset" -- "\${cur}") )
|
|
69
|
-
fi
|
|
70
|
-
;;
|
|
71
|
-
*)
|
|
72
|
-
# Option completion for other commands
|
|
73
|
-
if [[ "\${cur}" == -* ]]; then
|
|
74
|
-
case "\${command}" in
|
|
75
|
-
plan)
|
|
76
|
-
COMPREPLY=( $(compgen -W "--execute" -- "\${cur}") )
|
|
77
|
-
;;
|
|
78
|
-
orchestrate)
|
|
79
|
-
COMPREPLY=( $(compgen -W "--mode --plan-id" -- "\${cur}") )
|
|
80
|
-
;;
|
|
81
|
-
ask|react)
|
|
82
|
-
COMPREPLY=( $(compgen -W "--stream --no-stream" -- "\${cur}") )
|
|
83
|
-
;;
|
|
84
|
-
setup)
|
|
85
|
-
COMPREPLY=( $(compgen -W "--force -f" -- "\${cur}") )
|
|
86
|
-
;;
|
|
87
|
-
index)
|
|
88
|
-
COMPREPLY=( $(compgen -W "--repo -r" -- "\${cur}") )
|
|
89
|
-
;;
|
|
90
|
-
esac
|
|
91
|
-
fi
|
|
92
|
-
;;
|
|
93
|
-
esac
|
|
94
|
-
|
|
95
|
-
return 0
|
|
96
20
|
}
|
|
97
21
|
|
|
98
|
-
complete -F
|
|
22
|
+
complete -F _complete_codehere codehere
|
|
99
23
|
`;
|
|
100
24
|
}
|
|
101
25
|
//# sourceMappingURL=bash-completion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash-completion.js","sourceRoot":"","sources":["../../../src/infrastructure/completion/bash-completion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bash-completion.js","sourceRoot":"","sources":["../../../src/infrastructure/completion/bash-completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,UAAU,sBAAsB;IACpC,OAAO;;;;;;;;;;;;;;;;CAgBR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fish-completion.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/completion/fish-completion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fish-completion.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/completion/fish-completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,sBAAsB,IAAI,MAAM,CAe/C"}
|
|
@@ -1,65 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fish Completion Script Generator
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Generate fish completion script
|
|
3
|
+
*
|
|
4
|
+
* Phase 1: v0.5.0-alpha.0
|
|
7
5
|
*/
|
|
8
6
|
export function generateFishCompletion() {
|
|
9
|
-
return `#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
function __codehere_complete_undo_actions
|
|
25
|
-
echo undo list restore
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
function __codehere_complete_trace_actions
|
|
29
|
-
echo show reproduce list
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
function __codehere_complete_decision_actions
|
|
33
|
-
echo record list query explain
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
function __codehere_complete_knowledge_actions
|
|
37
|
-
echo query list summary extract
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
function __codehere_complete_learning_actions
|
|
41
|
-
echo overview patterns knowledge insights
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
function __codehere_complete_cost_actions
|
|
45
|
-
echo status summary run reset
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
complete -c codehere -f -a "(__codehere_complete_commands)"
|
|
49
|
-
|
|
50
|
-
complete -c codehere -f -n "__fish_seen_subcommand_from config" -a "(__codehere_complete_config_actions)"
|
|
51
|
-
complete -c codehere -f -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from get set" -a "(__codehere_complete_config_keys)"
|
|
52
|
-
|
|
53
|
-
complete -c codehere -f -n "__fish_seen_subcommand_from undo" -a "(__codehere_complete_undo_actions)"
|
|
54
|
-
complete -c codehere -f -n "__fish_seen_subcommand_from trace" -a "(__codehere_complete_trace_actions)"
|
|
55
|
-
complete -c codehere -f -n "__fish_seen_subcommand_from decision" -a "(__codehere_complete_decision_actions)"
|
|
56
|
-
complete -c codehere -f -n "__fish_seen_subcommand_from knowledge" -a "(__codehere_complete_knowledge_actions)"
|
|
57
|
-
complete -c codehere -f -n "__fish_seen_subcommand_from learning" -a "(__codehere_complete_learning_actions)"
|
|
58
|
-
complete -c codehere -f -n "__fish_seen_subcommand_from cost" -a "(__codehere_complete_cost_actions)"
|
|
59
|
-
|
|
60
|
-
complete -c codehere -s h -l help -d "Show help"
|
|
61
|
-
complete -c codehere -s v -l version -d "Show version"
|
|
62
|
-
complete -c codehere -l completion -d "Show shell completion script"
|
|
7
|
+
return `# Codehere fish completion
|
|
8
|
+
complete -c codehere -f
|
|
9
|
+
|
|
10
|
+
complete -c codehere -n __fish_use_subcommand -a ask -d "Answer questions about codebase"
|
|
11
|
+
complete -c codehere -n __fish_use_subcommand -a plan -d "Generate execution plan"
|
|
12
|
+
complete -c codehere -n __fish_use_subcommand -a orchestrate -d "Multi-agent orchestration"
|
|
13
|
+
complete -c codehere -n __fish_use_subcommand -a fix -d "Apply AI edits to file"
|
|
14
|
+
complete -c codehere -n __fish_use_subcommand -a suggest -d "Read-only assistant mode"
|
|
15
|
+
complete -c codehere -n __fish_use_subcommand -a run -d "Unified agentic execution"
|
|
16
|
+
complete -c codehere -n __fish_use_subcommand -a review -d "Task review interface"
|
|
17
|
+
complete -c codehere -n __fish_use_subcommand -a status -d "Show agent status"
|
|
18
|
+
complete -c codehere -n __fish_use_subcommand -a help -d "Show help"
|
|
19
|
+
complete -c codehere -n __fish_use_subcommand -a version -d "Show version"
|
|
63
20
|
`;
|
|
64
21
|
}
|
|
65
22
|
//# sourceMappingURL=fish-completion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fish-completion.js","sourceRoot":"","sources":["../../../src/infrastructure/completion/fish-completion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fish-completion.js","sourceRoot":"","sources":["../../../src/infrastructure/completion/fish-completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,UAAU,sBAAsB;IACpC,OAAO;;;;;;;;;;;;;CAaR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zsh-completion.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/completion/zsh-completion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"zsh-completion.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/completion/zsh-completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,qBAAqB,IAAI,MAAM,CAuB9C"}
|
|
@@ -1,85 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Zsh Completion Script Generator
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Generate zsh completion script
|
|
3
|
+
*
|
|
4
|
+
* Phase 1: v0.5.0-alpha.0
|
|
7
5
|
*/
|
|
8
6
|
export function generateZshCompletion() {
|
|
9
|
-
return `#
|
|
10
|
-
# Installation: source <(codehere --completion zsh) or add to ~/.zshrc
|
|
7
|
+
return `#compdef codehere
|
|
11
8
|
|
|
12
9
|
_codehere() {
|
|
13
|
-
local
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
local -a commands
|
|
11
|
+
commands=(
|
|
12
|
+
'ask:Answer questions about codebase'
|
|
13
|
+
'plan:Generate execution plan'
|
|
14
|
+
'orchestrate:Multi-agent orchestration'
|
|
15
|
+
'fix:Apply AI edits to file'
|
|
16
|
+
'suggest:Read-only assistant mode'
|
|
17
|
+
'run:Unified agentic execution'
|
|
18
|
+
'review:Task review interface'
|
|
19
|
+
'status:Show agent status'
|
|
20
|
+
'help:Show help'
|
|
21
|
+
'version:Show version'
|
|
22
|
+
)
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
command)
|
|
22
|
-
local commands="${getAllCommands().join(' ')}"
|
|
23
|
-
_values 'commands' $commands
|
|
24
|
-
;;
|
|
25
|
-
args)
|
|
26
|
-
case $words[1] in
|
|
27
|
-
config)
|
|
28
|
-
_arguments \\
|
|
29
|
-
"1: :->config_action" \\
|
|
30
|
-
"*::arg:->config_args"
|
|
31
|
-
;;
|
|
32
|
-
undo)
|
|
33
|
-
_arguments \\
|
|
34
|
-
"1: :->undo_action"
|
|
35
|
-
;;
|
|
36
|
-
trace)
|
|
37
|
-
_arguments \\
|
|
38
|
-
"1: :->trace_action"
|
|
39
|
-
;;
|
|
40
|
-
decision)
|
|
41
|
-
_arguments \\
|
|
42
|
-
"1: :->decision_action"
|
|
43
|
-
;;
|
|
44
|
-
knowledge)
|
|
45
|
-
_arguments \\
|
|
46
|
-
"1: :->knowledge_action"
|
|
47
|
-
;;
|
|
48
|
-
learning)
|
|
49
|
-
_arguments \\
|
|
50
|
-
"1: :->learning_action"
|
|
51
|
-
;;
|
|
52
|
-
cost)
|
|
53
|
-
_arguments \\
|
|
54
|
-
"1: :->cost_action"
|
|
55
|
-
;;
|
|
56
|
-
esac
|
|
57
|
-
;;
|
|
58
|
-
config_action)
|
|
59
|
-
_values 'config actions' get set reset
|
|
60
|
-
;;
|
|
61
|
-
undo_action)
|
|
62
|
-
_values 'undo actions' undo list restore
|
|
63
|
-
;;
|
|
64
|
-
trace_action)
|
|
65
|
-
_values 'trace actions' show reproduce list
|
|
66
|
-
;;
|
|
67
|
-
decision_action)
|
|
68
|
-
_values 'decision actions' record list query explain
|
|
69
|
-
;;
|
|
70
|
-
knowledge_action)
|
|
71
|
-
_values 'knowledge actions' query list summary extract
|
|
72
|
-
;;
|
|
73
|
-
learning_action)
|
|
74
|
-
_values 'learning actions' overview patterns knowledge insights
|
|
75
|
-
;;
|
|
76
|
-
cost_action)
|
|
77
|
-
_values 'cost actions' status summary run reset
|
|
78
|
-
;;
|
|
79
|
-
esac
|
|
24
|
+
_describe 'codehere' commands
|
|
80
25
|
}
|
|
81
26
|
|
|
82
|
-
|
|
27
|
+
_codehere "$@"
|
|
83
28
|
`;
|
|
84
29
|
}
|
|
85
30
|
//# sourceMappingURL=zsh-completion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zsh-completion.js","sourceRoot":"","sources":["../../../src/infrastructure/completion/zsh-completion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"zsh-completion.js","sourceRoot":"","sources":["../../../src/infrastructure/completion/zsh-completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,UAAU,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;;;;;;;CAqBR,CAAC;AACF,CAAC"}
|
|
@@ -12,7 +12,7 @@ const DEFAULT_CONFIG = {
|
|
|
12
12
|
autoCommit: false,
|
|
13
13
|
askBeforeDestructive: true,
|
|
14
14
|
enableCrossTeamLearning: false,
|
|
15
|
-
defaultModel: 'command-r-
|
|
15
|
+
defaultModel: 'command-r-08-2024', // command-r and command-r-plus were deprecated Sept 2025
|
|
16
16
|
maxTokens: 4096,
|
|
17
17
|
temperature: 0.3,
|
|
18
18
|
enableStreaming: true,
|
|
@@ -20,7 +20,7 @@ const DEFAULT_CONFIG = {
|
|
|
20
20
|
codebase: {},
|
|
21
21
|
api: {
|
|
22
22
|
provider: 'cohere',
|
|
23
|
-
model: 'command-r-
|
|
23
|
+
model: 'command-r-08-2024', // command-r and command-r-plus were deprecated Sept 2025
|
|
24
24
|
rateLimitHandling: 'retry',
|
|
25
25
|
},
|
|
26
26
|
ui: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-manager.js","sourceRoot":"","sources":["../../../src/infrastructure/config/config-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AA8BpD,MAAM,cAAc,GAAmB;IACrC,OAAO,EAAE,UAAU,EAAE;IACrB,WAAW,EAAE;QACX,UAAU,EAAE,KAAK;QACjB,oBAAoB,EAAE,IAAI;QAC1B,uBAAuB,EAAE,KAAK;QAC9B,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"config-manager.js","sourceRoot":"","sources":["../../../src/infrastructure/config/config-manager.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,58 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Conversation Context Manager
|
|
3
|
-
*
|
|
3
|
+
* Manages conversation history and context for session-aware interactions
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
4
6
|
*/
|
|
5
7
|
export interface ConversationTurn {
|
|
6
8
|
query: string;
|
|
7
9
|
response: string;
|
|
8
|
-
timestamp: number;
|
|
9
|
-
entities?:
|
|
10
|
-
intent?:
|
|
10
|
+
timestamp: string | number;
|
|
11
|
+
entities?: any[];
|
|
12
|
+
intent?: any;
|
|
11
13
|
}
|
|
12
|
-
|
|
14
|
+
interface ConversationSession {
|
|
13
15
|
sessionId: string;
|
|
14
16
|
turns: ConversationTurn[];
|
|
15
|
-
currentFocus?: {
|
|
16
|
-
entity?: string;
|
|
17
|
-
filepath?: string;
|
|
18
|
-
topic?: string;
|
|
19
|
-
};
|
|
20
17
|
createdAt: number;
|
|
21
18
|
lastUpdated: number;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
getContext(sessionId: string): ConversationContext;
|
|
31
|
-
/**
|
|
32
|
-
* Add a turn to conversation history
|
|
33
|
-
* EDGE CASE: Handles very long histories, concurrent sessions, and memory limits
|
|
34
|
-
*/
|
|
35
|
-
addTurn(sessionId: string, query: string, response: string, entities?: string[], intent?: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* In-memory conversation context manager
|
|
22
|
+
* Stores conversation history per session for reference resolution
|
|
23
|
+
*/
|
|
24
|
+
declare class ConversationContextManager {
|
|
25
|
+
private sessions;
|
|
26
|
+
private readonly maxHistoryPerSession;
|
|
36
27
|
/**
|
|
37
|
-
* Get conversation history for
|
|
28
|
+
* Get conversation history for a session
|
|
38
29
|
*/
|
|
39
|
-
getHistory(sessionId: string,
|
|
30
|
+
getHistory(sessionId: string, limit?: number): ConversationTurn[];
|
|
40
31
|
/**
|
|
41
32
|
* Resolve references in query (e.g., "it", "that", "the previous")
|
|
42
33
|
*/
|
|
43
34
|
resolveReferences(sessionId: string, query: string): string;
|
|
44
35
|
/**
|
|
45
|
-
* Extract entities from
|
|
36
|
+
* Extract entities from text (simple heuristic-based extraction)
|
|
37
|
+
*/
|
|
38
|
+
extractEntities(text: string, options?: any): any[];
|
|
39
|
+
/**
|
|
40
|
+
* Add a conversation turn
|
|
46
41
|
*/
|
|
47
|
-
|
|
42
|
+
addTurn(sessionId: string, query: string, response: string, entities?: any[], intent?: any): void;
|
|
48
43
|
/**
|
|
49
|
-
* Get
|
|
44
|
+
* Get full context for a session
|
|
50
45
|
*/
|
|
51
|
-
|
|
46
|
+
getContext(sessionId: string): ConversationSession | null;
|
|
52
47
|
/**
|
|
53
|
-
* Clear conversation
|
|
48
|
+
* Clear conversation history for a session
|
|
54
49
|
*/
|
|
55
|
-
|
|
50
|
+
clear(sessionId?: string): void;
|
|
56
51
|
}
|
|
57
52
|
export declare const conversationContextManager: ConversationContextManager;
|
|
53
|
+
export {};
|
|
58
54
|
//# sourceMappingURL=conversation-context.d.ts.map
|