aipanel-cli 0.1.3 → 0.2.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 +61 -41
- package/dist/src/app/AipanelApp.d.ts +6 -3
- package/dist/src/app/AipanelApp.js +22 -14
- package/dist/src/app/AipanelApp.js.map +1 -1
- package/dist/src/app/CommandRouter.js +19 -7
- package/dist/src/app/CommandRouter.js.map +1 -1
- package/dist/src/app/ProfileLoader.d.ts +3 -3
- package/dist/src/app/ProfileLoader.js +3 -6
- package/dist/src/app/ProfileLoader.js.map +1 -1
- package/dist/src/artifact/ArtifactRepository.d.ts +4 -9
- package/dist/src/artifact/ArtifactRepository.js +24 -60
- package/dist/src/artifact/ArtifactRepository.js.map +1 -1
- package/dist/src/cli/aipanel.js +2 -1
- package/dist/src/cli/aipanel.js.map +1 -1
- package/dist/src/compare/ComparisonEngine.d.ts +10 -1
- package/dist/src/compare/ComparisonEngine.js.map +1 -1
- package/dist/src/compare/ResponseNormalizer.d.ts +3 -2
- package/dist/src/compare/ResponseNormalizer.js +4 -2
- package/dist/src/compare/ResponseNormalizer.js.map +1 -1
- package/dist/src/context/ContextCollector.d.ts +5 -4
- package/dist/src/context/ContextCollector.js +4 -2
- package/dist/src/context/ContextCollector.js.map +1 -1
- package/dist/src/domain/artifact.d.ts +3 -2
- package/dist/src/domain/artifact.js +7 -7
- package/dist/src/domain/base.d.ts +0 -1
- package/dist/src/domain/base.js +1 -7
- package/dist/src/domain/base.js.map +1 -1
- package/dist/src/domain/run.d.ts +9 -23
- package/dist/src/domain/run.js +55 -51
- package/dist/src/domain/run.js.map +1 -1
- package/dist/src/domain/session.d.ts +6 -5
- package/dist/src/domain/session.js +9 -7
- package/dist/src/domain/session.js.map +1 -1
- package/dist/src/domain/value-objects.js +3 -1
- package/dist/src/domain/value-objects.js.map +1 -1
- package/dist/src/output/ResultRenderer.d.ts +3 -2
- package/dist/src/output/ResultRenderer.js.map +1 -1
- package/dist/src/providers/ClaudeCodeAdapter.d.ts +1 -0
- package/dist/src/providers/ClaudeCodeAdapter.js +1 -0
- package/dist/src/providers/ClaudeCodeAdapter.js.map +1 -1
- package/dist/src/providers/CodexExecAdapter.d.ts +5 -0
- package/dist/src/providers/CodexExecAdapter.js +128 -0
- package/dist/src/providers/CodexExecAdapter.js.map +1 -0
- package/dist/src/providers/ProviderAdapter.d.ts +1 -0
- package/dist/src/providers/ProviderRegistry.d.ts +3 -2
- package/dist/src/providers/ProviderRegistry.js +3 -3
- package/dist/src/providers/ProviderRegistry.js.map +1 -1
- package/dist/src/run/RunCoordinator.d.ts +10 -16
- package/dist/src/run/RunCoordinator.js +5 -20
- package/dist/src/run/RunCoordinator.js.map +1 -1
- package/dist/src/run/RunRepository.d.ts +3 -7
- package/dist/src/run/RunRepository.js +9 -45
- package/dist/src/run/RunRepository.js.map +1 -1
- package/dist/src/session/SessionManager.d.ts +5 -3
- package/dist/src/session/SessionManager.js +5 -6
- package/dist/src/session/SessionManager.js.map +1 -1
- package/dist/src/session/SessionRepository.d.ts +3 -5
- package/dist/src/session/SessionRepository.js +14 -28
- package/dist/src/session/SessionRepository.js.map +1 -1
- package/dist/src/shared/clock.d.ts +0 -1
- package/dist/src/shared/clock.js +0 -3
- package/dist/src/shared/clock.js.map +1 -1
- package/dist/src/shared/file-system.d.ts +0 -6
- package/dist/src/shared/file-system.js +1 -23
- package/dist/src/shared/file-system.js.map +1 -1
- package/dist/src/usecases/ConsultUseCase.d.ts +2 -1
- package/dist/src/usecases/ConsultUseCase.js +8 -8
- package/dist/src/usecases/ConsultUseCase.js.map +1 -1
- package/dist/src/usecases/DebugUseCase.js +20 -8
- package/dist/src/usecases/DebugUseCase.js.map +1 -1
- package/dist/src/usecases/FollowupUseCase.js.map +1 -1
- package/package.json +19 -63
- package/dist/src/app/WorkflowSelector.d.ts +0 -4
- package/dist/src/app/WorkflowSelector.js +0 -6
- package/dist/src/app/WorkflowSelector.js.map +0 -1
- package/dist/src/app/index.d.ts +0 -4
- package/dist/src/app/index.js +0 -5
- package/dist/src/app/index.js.map +0 -1
- package/dist/src/app/types.d.ts +0 -36
- package/dist/src/app/types.js +0 -2
- package/dist/src/app/types.js.map +0 -1
- package/dist/src/artifact/index.d.ts +0 -1
- package/dist/src/artifact/index.js +0 -2
- package/dist/src/artifact/index.js.map +0 -1
- package/dist/src/compare/index.d.ts +0 -3
- package/dist/src/compare/index.js +0 -3
- package/dist/src/compare/index.js.map +0 -1
- package/dist/src/context/index.d.ts +0 -2
- package/dist/src/context/index.js +0 -2
- package/dist/src/context/index.js.map +0 -1
- package/dist/src/domain/index.d.ts +0 -5
- package/dist/src/domain/index.js +0 -6
- package/dist/src/domain/index.js.map +0 -1
- package/dist/src/index.d.ts +0 -16
- package/dist/src/index.js +0 -16
- package/dist/src/index.js.map +0 -1
- package/dist/src/orchestrator/PlanBuilder.d.ts +0 -6
- package/dist/src/orchestrator/PlanBuilder.js +0 -59
- package/dist/src/orchestrator/PlanBuilder.js.map +0 -1
- package/dist/src/orchestrator/ResultMerger.d.ts +0 -10
- package/dist/src/orchestrator/ResultMerger.js +0 -19
- package/dist/src/orchestrator/ResultMerger.js.map +0 -1
- package/dist/src/orchestrator/TaskExecutor.d.ts +0 -20
- package/dist/src/orchestrator/TaskExecutor.js +0 -81
- package/dist/src/orchestrator/TaskExecutor.js.map +0 -1
- package/dist/src/orchestrator/TaskScheduler.d.ts +0 -4
- package/dist/src/orchestrator/TaskScheduler.js +0 -19
- package/dist/src/orchestrator/TaskScheduler.js.map +0 -1
- package/dist/src/orchestrator/ValidationRunner.d.ts +0 -4
- package/dist/src/orchestrator/ValidationRunner.js +0 -22
- package/dist/src/orchestrator/ValidationRunner.js.map +0 -1
- package/dist/src/orchestrator/index.d.ts +0 -5
- package/dist/src/orchestrator/index.js +0 -6
- package/dist/src/orchestrator/index.js.map +0 -1
- package/dist/src/output/index.d.ts +0 -1
- package/dist/src/output/index.js +0 -2
- package/dist/src/output/index.js.map +0 -1
- package/dist/src/providers/index.d.ts +0 -3
- package/dist/src/providers/index.js +0 -4
- package/dist/src/providers/index.js.map +0 -1
- package/dist/src/run/index.d.ts +0 -2
- package/dist/src/run/index.js +0 -3
- package/dist/src/run/index.js.map +0 -1
- package/dist/src/session/index.d.ts +0 -2
- package/dist/src/session/index.js +0 -3
- package/dist/src/session/index.js.map +0 -1
- package/dist/src/shared/contracts.d.ts +0 -256
- package/dist/src/shared/contracts.js +0 -2
- package/dist/src/shared/contracts.js.map +0 -1
- package/dist/src/shared/errors.d.ts +0 -9
- package/dist/src/shared/errors.js +0 -11
- package/dist/src/shared/errors.js.map +0 -1
- package/dist/src/shared/index.d.ts +0 -4
- package/dist/src/shared/index.js +0 -5
- package/dist/src/shared/index.js.map +0 -1
- package/dist/src/usecases/CompareUseCase.d.ts +0 -6
- package/dist/src/usecases/CompareUseCase.js +0 -9
- package/dist/src/usecases/CompareUseCase.js.map +0 -1
- package/dist/src/usecases/helpers.d.ts +0 -9
- package/dist/src/usecases/helpers.js +0 -31
- package/dist/src/usecases/helpers.js.map +0 -1
- package/dist/src/usecases/index.d.ts +0 -5
- package/dist/src/usecases/index.js +0 -6
- package/dist/src/usecases/index.js.map +0 -1
package/dist/src/run/index.d.ts
DELETED
package/dist/src/run/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/run/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/session/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
export type Role = "system" | "user" | "assistant";
|
|
2
|
-
export type RunMode = "direct" | "orchestrated";
|
|
3
|
-
export type RunStatus = "created" | "planned" | "running" | "merged" | "validated" | "completed" | "failed" | "partial";
|
|
4
|
-
export interface ProviderRef {
|
|
5
|
-
provider: string;
|
|
6
|
-
providerSessionId: string;
|
|
7
|
-
workingDirectory: string;
|
|
8
|
-
lastUsedAt: string;
|
|
9
|
-
}
|
|
10
|
-
export interface SessionTurnData {
|
|
11
|
-
turnId: string;
|
|
12
|
-
sessionId: string;
|
|
13
|
-
role: Role;
|
|
14
|
-
content: string;
|
|
15
|
-
artifactIds: string[];
|
|
16
|
-
createdAt: string;
|
|
17
|
-
}
|
|
18
|
-
export interface SessionData {
|
|
19
|
-
sessionId: string;
|
|
20
|
-
title: string;
|
|
21
|
-
status?: string;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
updatedAt: string;
|
|
24
|
-
providerRefs: ProviderRef[];
|
|
25
|
-
turns: SessionTurnData[];
|
|
26
|
-
}
|
|
27
|
-
export interface FileRef {
|
|
28
|
-
path: string;
|
|
29
|
-
absolutePath?: string;
|
|
30
|
-
purpose: string;
|
|
31
|
-
checksum?: string;
|
|
32
|
-
content?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface DiffRef {
|
|
35
|
-
path: string;
|
|
36
|
-
summary?: string;
|
|
37
|
-
content?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface LogRef {
|
|
40
|
-
path: string;
|
|
41
|
-
source: string;
|
|
42
|
-
capturedAt: string;
|
|
43
|
-
content?: string;
|
|
44
|
-
}
|
|
45
|
-
export interface ContextBundleData {
|
|
46
|
-
contextId: string;
|
|
47
|
-
runId: string | null;
|
|
48
|
-
summary: string;
|
|
49
|
-
files: FileRef[];
|
|
50
|
-
diffs: DiffRef[];
|
|
51
|
-
logs: LogRef[];
|
|
52
|
-
metadata: Record<string, unknown>;
|
|
53
|
-
}
|
|
54
|
-
export interface ProviderCallPlan {
|
|
55
|
-
provider: string;
|
|
56
|
-
prompt: string;
|
|
57
|
-
model?: string;
|
|
58
|
-
sessionHint?: ProviderRef | null;
|
|
59
|
-
timeoutMs?: number;
|
|
60
|
-
mode: RunMode;
|
|
61
|
-
}
|
|
62
|
-
export interface UsageData {
|
|
63
|
-
inputTokens?: number | null;
|
|
64
|
-
outputTokens?: number | null;
|
|
65
|
-
costUsd?: number | null;
|
|
66
|
-
latencyMs?: number | null;
|
|
67
|
-
}
|
|
68
|
-
export interface ExternalRef {
|
|
69
|
-
system: string;
|
|
70
|
-
id: string;
|
|
71
|
-
scope?: string;
|
|
72
|
-
}
|
|
73
|
-
export interface ProviderResponseData {
|
|
74
|
-
responseId: string;
|
|
75
|
-
taskId: string;
|
|
76
|
-
provider: string;
|
|
77
|
-
model: string;
|
|
78
|
-
rawText?: string;
|
|
79
|
-
rawJson?: unknown;
|
|
80
|
-
rawTextRef?: string | null;
|
|
81
|
-
rawJsonRef?: string | null;
|
|
82
|
-
usage?: UsageData | null;
|
|
83
|
-
latencyMs?: number;
|
|
84
|
-
externalRefs: ExternalRef[];
|
|
85
|
-
citations?: CitationData[];
|
|
86
|
-
isError?: boolean;
|
|
87
|
-
subtype?: string | null;
|
|
88
|
-
}
|
|
89
|
-
export interface ConfidenceScoreData {
|
|
90
|
-
level: "low" | "medium" | "high";
|
|
91
|
-
reason?: string | null;
|
|
92
|
-
}
|
|
93
|
-
export interface CitationData {
|
|
94
|
-
kind: string;
|
|
95
|
-
label?: string | null;
|
|
96
|
-
pathOrUrl?: string | null;
|
|
97
|
-
line?: number | null;
|
|
98
|
-
}
|
|
99
|
-
export interface NormalizedResponseData {
|
|
100
|
-
normalizedResponseId: string;
|
|
101
|
-
taskId: string;
|
|
102
|
-
provider: string;
|
|
103
|
-
summary: string;
|
|
104
|
-
findings: string[];
|
|
105
|
-
suggestions: string[];
|
|
106
|
-
citations: CitationData[];
|
|
107
|
-
confidence: ConfidenceScoreData;
|
|
108
|
-
}
|
|
109
|
-
export interface RunTaskData {
|
|
110
|
-
taskId: string;
|
|
111
|
-
runId: string;
|
|
112
|
-
taskKind: string;
|
|
113
|
-
role: string;
|
|
114
|
-
provider?: string | null;
|
|
115
|
-
dependsOn: string[];
|
|
116
|
-
status: RunStatus | "queued";
|
|
117
|
-
prompt?: string;
|
|
118
|
-
summary?: string;
|
|
119
|
-
}
|
|
120
|
-
export interface TaskResultData {
|
|
121
|
-
resultId: string;
|
|
122
|
-
taskId: string;
|
|
123
|
-
summary: string;
|
|
124
|
-
findings: string[];
|
|
125
|
-
citations: CitationData[];
|
|
126
|
-
confidence: ConfidenceScoreData;
|
|
127
|
-
sourceArtifactIds: string[];
|
|
128
|
-
}
|
|
129
|
-
export interface ComparisonReportData {
|
|
130
|
-
reportId: string | null;
|
|
131
|
-
runId: string | null;
|
|
132
|
-
topic: string;
|
|
133
|
-
responseIds: string[];
|
|
134
|
-
agreements: string[];
|
|
135
|
-
differences: string[];
|
|
136
|
-
recommendation: string | null;
|
|
137
|
-
}
|
|
138
|
-
export interface RunData {
|
|
139
|
-
runId: string;
|
|
140
|
-
sessionId: string;
|
|
141
|
-
command: string;
|
|
142
|
-
mode: RunMode;
|
|
143
|
-
status: RunStatus;
|
|
144
|
-
planVersion?: string;
|
|
145
|
-
finalSummary?: string;
|
|
146
|
-
validationStatus?: string;
|
|
147
|
-
tasks: RunTaskData[];
|
|
148
|
-
taskResults: TaskResultData[];
|
|
149
|
-
contextBundles?: ContextBundleData[];
|
|
150
|
-
providerResponses?: ProviderResponseData[];
|
|
151
|
-
normalizedResponses?: NormalizedResponseData[];
|
|
152
|
-
comparisonReport?: ComparisonReportData | null;
|
|
153
|
-
createdAt: string;
|
|
154
|
-
updatedAt: string;
|
|
155
|
-
}
|
|
156
|
-
export interface ArtifactData {
|
|
157
|
-
artifactId: string;
|
|
158
|
-
kind: string;
|
|
159
|
-
path: string;
|
|
160
|
-
sessionId?: string | null;
|
|
161
|
-
runId?: string | null;
|
|
162
|
-
turnId?: string | null;
|
|
163
|
-
taskId?: string | null;
|
|
164
|
-
createdAt: string;
|
|
165
|
-
}
|
|
166
|
-
export interface SessionManagerPort {
|
|
167
|
-
startSession(input: {
|
|
168
|
-
title?: string;
|
|
169
|
-
}): Promise<SessionData>;
|
|
170
|
-
loadSession(sessionId: string): Promise<SessionData | null>;
|
|
171
|
-
appendTurn(input: {
|
|
172
|
-
sessionId: string;
|
|
173
|
-
role: Role;
|
|
174
|
-
content: string;
|
|
175
|
-
artifactIds?: string[];
|
|
176
|
-
}): Promise<SessionData>;
|
|
177
|
-
updateProviderRef(input: {
|
|
178
|
-
sessionId: string;
|
|
179
|
-
providerRef: ProviderRef;
|
|
180
|
-
}): Promise<SessionData>;
|
|
181
|
-
}
|
|
182
|
-
export interface RunCoordinatorPort {
|
|
183
|
-
startRun(input: {
|
|
184
|
-
sessionId: string;
|
|
185
|
-
command: string;
|
|
186
|
-
mode: RunMode;
|
|
187
|
-
}): Promise<RunData>;
|
|
188
|
-
attachContextBundle(input: {
|
|
189
|
-
runId: string;
|
|
190
|
-
contextBundle: ContextBundleData;
|
|
191
|
-
}): Promise<RunData>;
|
|
192
|
-
appendTask(input: {
|
|
193
|
-
runId: string;
|
|
194
|
-
taskKind: string;
|
|
195
|
-
role: string;
|
|
196
|
-
provider?: string | null;
|
|
197
|
-
dependsOn?: string[];
|
|
198
|
-
prompt?: string;
|
|
199
|
-
}): Promise<RunTaskData>;
|
|
200
|
-
appendTaskResult(input: {
|
|
201
|
-
runId: string;
|
|
202
|
-
taskId: string;
|
|
203
|
-
summary: string;
|
|
204
|
-
findings: string[];
|
|
205
|
-
citations?: CitationData[];
|
|
206
|
-
confidence: ConfidenceScoreData;
|
|
207
|
-
sourceArtifactIds?: string[];
|
|
208
|
-
providerResponse?: ProviderResponseData;
|
|
209
|
-
normalizedResponse?: NormalizedResponseData;
|
|
210
|
-
}): Promise<RunData>;
|
|
211
|
-
finalizeRun(input: {
|
|
212
|
-
runId: string;
|
|
213
|
-
finalSummary: string;
|
|
214
|
-
validationStatus: string;
|
|
215
|
-
comparisonReport?: ComparisonReportData | null;
|
|
216
|
-
}): Promise<RunData>;
|
|
217
|
-
markRunFailed(input: {
|
|
218
|
-
runId: string;
|
|
219
|
-
errorMessage: string;
|
|
220
|
-
}): Promise<RunData>;
|
|
221
|
-
loadRun(runId: string): Promise<RunData | null>;
|
|
222
|
-
}
|
|
223
|
-
export interface ArtifactRepositoryPort {
|
|
224
|
-
saveArtifact(input: {
|
|
225
|
-
kind: string;
|
|
226
|
-
runId?: string | null;
|
|
227
|
-
sessionId?: string | null;
|
|
228
|
-
turnId?: string | null;
|
|
229
|
-
taskId?: string | null;
|
|
230
|
-
extension?: string;
|
|
231
|
-
content: string;
|
|
232
|
-
}): Promise<ArtifactData>;
|
|
233
|
-
}
|
|
234
|
-
export interface ProviderAdapterPort {
|
|
235
|
-
readonly name: string;
|
|
236
|
-
call(plan: ProviderCallPlan): Promise<ProviderResponseData>;
|
|
237
|
-
}
|
|
238
|
-
export interface ProviderRegistryPort {
|
|
239
|
-
list(): string[];
|
|
240
|
-
get(name?: string): ProviderAdapterPort;
|
|
241
|
-
}
|
|
242
|
-
export interface PlanTaskSpec {
|
|
243
|
-
taskKind: string;
|
|
244
|
-
role: string;
|
|
245
|
-
provider?: string | null;
|
|
246
|
-
prompt: string;
|
|
247
|
-
dependsOn?: string[];
|
|
248
|
-
}
|
|
249
|
-
export interface ValidationResult {
|
|
250
|
-
status: string;
|
|
251
|
-
notes: string[];
|
|
252
|
-
}
|
|
253
|
-
export interface RenderResult {
|
|
254
|
-
text: string;
|
|
255
|
-
json: Record<string, unknown>;
|
|
256
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/shared/contracts.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export class AipanelError extends Error {
|
|
2
|
-
code;
|
|
3
|
-
details;
|
|
4
|
-
constructor(message, { code = "AIPANEL_ERROR", details = null, cause = null } = {}) {
|
|
5
|
-
super(message, cause ? { cause } : undefined);
|
|
6
|
-
this.name = "AipanelError";
|
|
7
|
-
this.code = code;
|
|
8
|
-
this.details = details;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/shared/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,IAAI,CAAS;IAEb,OAAO,CAAU;IAEjB,YACE,OAAe,EACf,EAAE,IAAI,GAAG,eAAe,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI,KAA4D,EAAE;QAEpH,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
|
package/dist/src/shared/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CompareUseCase.js","sourceRoot":"","sources":["../../../src/usecases/CompareUseCase.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,cAAc;IACzB,KAAK,CAAC,OAAO;QACX,OAAO;YACL,IAAI,EAAE,SAAkB;YACxB,OAAO,EAAE,kCAAkC;SAC5C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ContextBundleData, SessionData } from "../shared/contracts.js";
|
|
2
|
-
export declare function buildSessionTitle(question: string): string;
|
|
3
|
-
export declare function buildConversationTranscript(session: SessionData): string;
|
|
4
|
-
export declare function buildPromptWithTranscript(input: {
|
|
5
|
-
session: SessionData;
|
|
6
|
-
question: string;
|
|
7
|
-
contextBundle: ContextBundleData;
|
|
8
|
-
modeLabel: string;
|
|
9
|
-
}): string;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
function compact(text) {
|
|
2
|
-
return text.replace(/\s+/g, " ").trim();
|
|
3
|
-
}
|
|
4
|
-
export function buildSessionTitle(question) {
|
|
5
|
-
const normalized = compact(question);
|
|
6
|
-
return normalized.slice(0, 60) || "Untitled session";
|
|
7
|
-
}
|
|
8
|
-
export function buildConversationTranscript(session) {
|
|
9
|
-
return session.turns
|
|
10
|
-
.map((turn) => `${turn.role.toUpperCase()}: ${turn.content}`)
|
|
11
|
-
.join("\n\n");
|
|
12
|
-
}
|
|
13
|
-
export function buildPromptWithTranscript(input) {
|
|
14
|
-
const transcript = buildConversationTranscript(input.session);
|
|
15
|
-
const contextSections = [
|
|
16
|
-
input.contextBundle.summary,
|
|
17
|
-
...(input.contextBundle.files ?? []).map((file) => `File: ${file.path}\n${file.content ?? ""}`),
|
|
18
|
-
...(input.contextBundle.diffs ?? []).map((diff) => `Diff: ${diff.path}\n${diff.content ?? ""}`),
|
|
19
|
-
...(input.contextBundle.logs ?? []).map((log) => `Log: ${log.path}\n${log.content ?? ""}`),
|
|
20
|
-
].filter(Boolean);
|
|
21
|
-
return [
|
|
22
|
-
`Mode: ${input.modeLabel}`,
|
|
23
|
-
transcript ? `Conversation so far:\n${transcript}` : "",
|
|
24
|
-
`New user question:\n${input.question.trim()}`,
|
|
25
|
-
contextSections.length > 0 ? `Context:\n${contextSections.join("\n\n")}` : "",
|
|
26
|
-
"Answer in a concise but useful way. Prefer concrete next steps.",
|
|
27
|
-
]
|
|
28
|
-
.filter(Boolean)
|
|
29
|
-
.join("\n\n");
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/usecases/helpers.ts"],"names":[],"mappings":"AAEA,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,OAAoB;IAC9D,OAAO,OAAO,CAAC,KAAK;SACjB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;SAC5D,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAKzC;IACC,MAAM,UAAU,GAAG,2BAA2B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG;QACtB,KAAK,CAAC,aAAa,CAAC,OAAO;QAC3B,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;QAC/F,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;QAC/F,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;KAC3F,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,OAAO;QACL,SAAS,KAAK,CAAC,SAAS,EAAE;QAC1B,UAAU,CAAC,CAAC,CAAC,yBAAyB,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;QACvD,uBAAuB,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE;QAC9C,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QAC7E,iEAAiE;KAClE;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { CompareUseCase } from "./CompareUseCase.js";
|
|
2
|
-
export { ConsultUseCase } from "./ConsultUseCase.js";
|
|
3
|
-
export { DebugUseCase } from "./DebugUseCase.js";
|
|
4
|
-
export { FollowupUseCase } from "./FollowupUseCase.js";
|
|
5
|
-
export { ListProvidersUseCase } from "./ListProvidersUseCase.js";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { CompareUseCase } from "./CompareUseCase.js";
|
|
2
|
-
export { ConsultUseCase } from "./ConsultUseCase.js";
|
|
3
|
-
export { DebugUseCase } from "./DebugUseCase.js";
|
|
4
|
-
export { FollowupUseCase } from "./FollowupUseCase.js";
|
|
5
|
-
export { ListProvidersUseCase } from "./ListProvidersUseCase.js";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/usecases/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
|