@akanjs/devkit 2.3.9-rc.7 → 2.3.9-rc.9

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/workflow/types.ts CHANGED
@@ -14,10 +14,17 @@ export type WorkflowValidationStatus = "passed" | "failed" | "unknown";
14
14
  export interface WorkflowValidationSummary {
15
15
  sourceChange: WorkflowValidationStatus;
16
16
  generatedSync: WorkflowValidationStatus;
17
+ validationCommands: WorkflowValidationStatus;
18
+ baseline: WorkflowValidationStatus;
17
19
  workspaceConfig: WorkflowValidationStatus;
18
20
  environment: WorkflowValidationStatus;
19
21
  }
20
- export type WorkflowOverallStatus = "passed" | "failed" | "blocked-by-workspace-config" | "blocked-by-environment";
22
+ export type WorkflowOverallStatus =
23
+ | "passed"
24
+ | "failed"
25
+ | "passed-with-baseline-blockers"
26
+ | "blocked-by-workspace-config"
27
+ | "blocked-by-environment";
21
28
 
22
29
  export interface PrimitiveTargetInput {
23
30
  app: string | null;
@@ -102,12 +109,146 @@ export interface WorkflowDiagnostic {
102
109
  export interface WorkflowRecommendation {
103
110
  code: string;
104
111
  message: string;
105
- kind: "auto-apply" | "validation" | "manual-action" | "import" | "placement" | "ui-component";
112
+ kind: "auto-apply" | "validation" | "manual-action" | "input-guidance" | "import" | "placement" | "ui-component";
106
113
  target?: string;
107
114
  action?: string;
108
115
  confidence?: "high" | "medium" | "low";
109
116
  }
110
117
 
118
+ export interface WorkflowPlanApproval {
119
+ required: true;
120
+ meaning: string;
121
+ applyTool: "apply_workflow";
122
+ canApplyWith?: Record<string, string>;
123
+ }
124
+
125
+ export interface AkanSourceSpan {
126
+ file: string;
127
+ startLine: number;
128
+ endLine: number;
129
+ startOffset: number;
130
+ endOffset: number;
131
+ }
132
+
133
+ export type AkanIndexedFileKind =
134
+ | "abstract"
135
+ | "constant"
136
+ | "dictionary"
137
+ | "service"
138
+ | "signal"
139
+ | "store"
140
+ | "template"
141
+ | "unit"
142
+ | "util"
143
+ | "view"
144
+ | "zone"
145
+ | "other";
146
+
147
+ export interface AkanIndexedFile {
148
+ kind: AkanIndexedFileKind;
149
+ path: string;
150
+ expectedPath: string;
151
+ filename: string;
152
+ expectedFilename: string;
153
+ present: boolean;
154
+ casing: "match" | "mismatch" | "missing";
155
+ }
156
+
157
+ export type AkanFieldOutlineKind = "constant" | "dictionary" | "lightProjection";
158
+
159
+ export interface AkanFieldOutline {
160
+ name: string;
161
+ kind: AkanFieldOutlineKind;
162
+ order: number;
163
+ typeSummary?: string;
164
+ sourceSpan: AkanSourceSpan;
165
+ }
166
+
167
+ export interface AkanProjectionOutline {
168
+ className: string;
169
+ fields: AkanFieldOutline[];
170
+ sourceSpan?: AkanSourceSpan;
171
+ }
172
+
173
+ export interface AkanConstantIndex {
174
+ path: string;
175
+ inputClassName: string;
176
+ builderName: string | null;
177
+ fields: AkanFieldOutline[];
178
+ lightProjection?: AkanProjectionOutline;
179
+ sourceSpan?: AkanSourceSpan;
180
+ }
181
+
182
+ export interface AkanDictionaryIndex {
183
+ path: string;
184
+ modelClassName: string;
185
+ translatorName: string | null;
186
+ fields: AkanFieldOutline[];
187
+ sourceSpan?: AkanSourceSpan;
188
+ }
189
+
190
+ export interface AkanFieldPresence {
191
+ name: string;
192
+ requested: boolean;
193
+ constant: boolean;
194
+ dictionary: boolean;
195
+ lightProjection: boolean;
196
+ }
197
+
198
+ export interface AkanModuleContextIndex {
199
+ schemaVersion: 1;
200
+ app: string;
201
+ module: string;
202
+ moduleClassName: string;
203
+ files: AkanIndexedFile[];
204
+ fieldPresence: AkanFieldPresence[];
205
+ constant?: AkanConstantIndex;
206
+ dictionary?: AkanDictionaryIndex;
207
+ diagnostics: WorkflowDiagnostic[];
208
+ }
209
+
210
+ export type InspectAkanContextRequest =
211
+ | { type: "workspaceOverview" }
212
+ | { type: "moduleContext"; app: string; module: string }
213
+ | { type: "fieldInsertionContext"; app: string; module: string; field: string; fieldType: string }
214
+ | { type: "workflowDiagnostics"; runIdOrPlan: string }
215
+ | { type: "escape"; reason: string; nextStep?: string };
216
+
217
+ export interface InspectAkanContextProps {
218
+ question: string;
219
+ draft: {
220
+ reason: string;
221
+ type: InspectAkanContextRequest["type"];
222
+ };
223
+ review: string;
224
+ request: InspectAkanContextRequest;
225
+ }
226
+
227
+ export interface AkanContextEvidence {
228
+ kind: "workspace" | "module" | "field-insertion" | "workflow" | "escape";
229
+ summary: string;
230
+ path?: string;
231
+ target?: string;
232
+ sourceSpan?: AkanSourceSpan;
233
+ }
234
+
235
+ export interface AkanContextNext {
236
+ action: "answer" | "inspect" | "plan_workflow" | "validate" | "escape" | "clarify";
237
+ reason: string;
238
+ tool?: string;
239
+ args?: Record<string, unknown>;
240
+ }
241
+
242
+ export interface InspectAkanContextResult {
243
+ schemaVersion: 1;
244
+ type: InspectAkanContextRequest["type"];
245
+ question: string;
246
+ diagnostics: WorkflowDiagnostic[];
247
+ evidence: AkanContextEvidence[];
248
+ next: AkanContextNext;
249
+ data?: Record<string, unknown>;
250
+ }
251
+
111
252
  export interface WorkflowPlan {
112
253
  schemaVersion: 1;
113
254
  workflow: string;
@@ -120,6 +261,7 @@ export interface WorkflowPlan {
120
261
  diagnostics: WorkflowDiagnostic[];
121
262
  recommendations: WorkflowRecommendation[];
122
263
  requiresApproval: true;
264
+ approval?: WorkflowPlanApproval;
123
265
  }
124
266
 
125
267
  export interface WorkflowReport {
@@ -164,6 +306,24 @@ export interface WorkflowKnownBlocker {
164
306
  known?: boolean;
165
307
  }
166
308
 
309
+ export interface WorkflowBaselineSummaryCode {
310
+ code: string;
311
+ severity: "warning" | "error" | "mixed";
312
+ count: number;
313
+ sampleMessage: string;
314
+ }
315
+
316
+ export interface WorkflowBaselineSummary {
317
+ status: WorkflowValidationStatus;
318
+ total: number;
319
+ totalErrors: number;
320
+ totalWarnings: number;
321
+ detailsIncluded: boolean;
322
+ knownBlockerCount: number;
323
+ byCode: WorkflowBaselineSummaryCode[];
324
+ contextPaths?: string[];
325
+ }
326
+
167
327
  export interface RepairAction {
168
328
  command: string;
169
329
  reason: string;
@@ -184,6 +344,8 @@ export interface WorkflowPostApplyCheck {
184
344
  message: string;
185
345
  }
186
346
 
347
+ export type WorkflowNextActionCode = "answer" | "validate" | "manual-review" | "repair" | "blocked";
348
+
187
349
  export interface PrimitiveGeneratedFile {
188
350
  path: string;
189
351
  action: "sync";
@@ -198,6 +360,7 @@ export interface PrimitiveValidationCommand {
198
360
  export interface PrimitiveNextAction {
199
361
  command: string;
200
362
  reason: string;
363
+ action?: WorkflowNextActionCode;
201
364
  }
202
365
 
203
366
  export interface PrimitiveWriteReport {
@@ -221,6 +384,10 @@ export interface WorkflowApplyReport {
221
384
  workflow: string;
222
385
  mode: "dry-run" | "apply";
223
386
  status: "passed" | "failed";
387
+ summary: {
388
+ sourceFilesChanged: PrimitiveChangedFile[];
389
+ generatedFilesSynced: PrimitiveGeneratedFile[];
390
+ };
224
391
  changedFiles: PrimitiveChangedFile[];
225
392
  generatedFiles: PrimitiveGeneratedFile[];
226
393
  appliedCommands: WorkflowApplyCommand[];
@@ -242,11 +409,14 @@ export interface WorkflowValidationRunReport {
242
409
  status: "passed" | "failed";
243
410
  sourceStatus: WorkflowValidationStatus;
244
411
  workspaceStatus: WorkflowValidationStatus;
412
+ validationCommandsStatus: WorkflowValidationStatus;
413
+ baselineStatus: WorkflowValidationStatus;
245
414
  summary: WorkflowValidationSummary;
246
415
  overallStatus: WorkflowOverallStatus;
247
416
  knownBlockers: WorkflowKnownBlocker[];
248
417
  commands: WorkflowValidationCommandResult[];
249
418
  diagnostics: WorkflowDiagnostic[];
419
+ baselineSummary: WorkflowBaselineSummary;
250
420
  baselineDiagnostics?: WorkflowDiagnostic[];
251
421
  workflowDiagnostics?: WorkflowDiagnostic[];
252
422
  repairActions: RepairAction[];