opencode-plugin-flow 4.4.0 → 5.0.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +44 -40
  3. package/dist/application/errors.d.ts +5 -0
  4. package/dist/{runtime/api.d.ts → application/flow-service.d.ts} +89 -57
  5. package/dist/application/ports/session-repository.d.ts +11 -0
  6. package/dist/{runtime → application}/schema.d.ts +291 -371
  7. package/dist/cli.js +283 -2720
  8. package/dist/cli.js.map +7 -6
  9. package/dist/config-shared.d.ts +28 -14
  10. package/dist/config.d.ts +1 -1
  11. package/dist/distribution/legacy-cleanup.d.ts +25 -0
  12. package/dist/domain/feature-id.d.ts +3 -0
  13. package/dist/domain/limits.d.ts +1 -0
  14. package/dist/domain/orchestration-policy.d.ts +27 -0
  15. package/dist/domain/session.d.ts +181 -0
  16. package/dist/domain/transitions.d.ts +80 -0
  17. package/dist/guidance/catalog.d.ts +18 -0
  18. package/dist/guidance/ids.d.ts +4 -0
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1279 -1102
  21. package/dist/index.js.map +24 -18
  22. package/dist/infrastructure/fs/session-repository.d.ts +2 -0
  23. package/dist/infrastructure/fs/workspace-flow-service.d.ts +9 -0
  24. package/dist/{runtime → infrastructure/fs}/workspace.d.ts +10 -15
  25. package/dist/infrastructure/system/transition-environment.d.ts +2 -0
  26. package/dist/platform/opencode/config.d.ts +2 -0
  27. package/dist/{adapters → platform}/opencode/plugin.d.ts +1 -1
  28. package/dist/{adapters → platform}/opencode/sdk.d.ts +0 -1
  29. package/dist/platform/opencode/tools.d.ts +6 -0
  30. package/dist/prompt-model-evaluation.d.ts +19 -30
  31. package/dist/prompt-quality.d.ts +1 -1
  32. package/dist/version.d.ts +1 -0
  33. package/package.json +16 -11
  34. package/dist/adapters/opencode/config.d.ts +0 -3
  35. package/dist/adapters/opencode/tools.d.ts +0 -322
  36. package/dist/distribution/flow-skill-definitions.d.ts +0 -9
  37. package/dist/distribution/sync.d.ts +0 -69
  38. package/dist/runtime/time.d.ts +0 -2
  39. package/dist/runtime/transitions.d.ts +0 -230
  40. /package/dist/{runtime/json/strict-object.d.ts → infrastructure/fs/strict-json-object.d.ts} +0 -0
  41. /package/dist/{adapters → platform}/opencode/logging.d.ts +0 -0
@@ -1,69 +0,0 @@
1
- type FlowLog = (level: "info" | "warn" | "error", message: string) => void;
2
- export type FlowSkillSyncAction = "installed" | "updated" | "updated_with_backup" | "marker_updated" | "unchanged" | "skipped_foreign";
3
- export type FlowSkillSyncResult = {
4
- name: string;
5
- action: FlowSkillSyncAction;
6
- backupPaths?: string[];
7
- };
8
- export declare const CHANGED_SYNC_ACTIONS: readonly FlowSkillSyncAction[];
9
- export declare function isChangedSyncAction(action: FlowSkillSyncAction): boolean;
10
- export type FlowSkillSyncHealth = {
11
- status: "ok" | "restart_required" | "action_required" | "error";
12
- version: string;
13
- root: string;
14
- checkedAt: string;
15
- expectedSkills: string[];
16
- results: FlowSkillSyncResult[];
17
- changedSkills: string[];
18
- actionRequiredSkills: string[];
19
- restartRequired: boolean;
20
- summary: string;
21
- error?: string;
22
- };
23
- export type FlowSkillSetupStatus = {
24
- status: "restart_required" | "action_required" | "sync_failed";
25
- summary: string;
26
- version: string;
27
- root: string;
28
- changed?: string[];
29
- actionRequired?: string[];
30
- error?: string;
31
- };
32
- export type FlowSkillDoctorSkill = {
33
- name: string;
34
- path: string;
35
- status: "ok" | "missing" | "foreign" | "incomplete" | "edited" | "outdated";
36
- markerVersion: string | null;
37
- missingFiles: string[];
38
- editedFiles: string[];
39
- outdatedFiles: string[];
40
- backupFiles: string[];
41
- };
42
- export type FlowSkillDoctorReport = {
43
- status: "ok" | "sync_required" | "action_required";
44
- version: string;
45
- root: string;
46
- expectedSkills: string[];
47
- skills: FlowSkillDoctorSkill[];
48
- syncRequiredSkills: string[];
49
- actionRequiredSkills: string[];
50
- unmanagedFlowSkills: string[];
51
- };
52
- export declare function resolveFlowSkillsRoot(home?: string): string;
53
- export declare function getLatestFlowSkillSyncHealth(): FlowSkillSyncHealth | null;
54
- export declare function formatFlowDoctorCommand(version: string): string;
55
- export declare function getFlowSkillSetupStatus(health?: FlowSkillSyncHealth | null): FlowSkillSetupStatus | null;
56
- export declare function formatFlowSkillSetupWarning(health?: FlowSkillSyncHealth | null): string | null;
57
- export declare function resolveFlowPluginVersion(): string;
58
- export declare function syncFlowSkills(version: string, home?: string): Promise<FlowSkillSyncResult[]>;
59
- export declare function runFlowSkillSync(version: string, log: FlowLog, home?: string): Promise<void>;
60
- export declare function inspectFlowSkillInstall(version?: string, home?: string): Promise<FlowSkillDoctorReport>;
61
- export declare function formatFlowSkillDoctor(report: FlowSkillDoctorReport): string;
62
- export declare function uninstallFlowSkills(home?: string, options?: {
63
- dryRun?: boolean;
64
- }): Promise<{
65
- removed: string[];
66
- kept: string[];
67
- removedBackups: string[];
68
- }>;
69
- export {};
@@ -1,2 +0,0 @@
1
- export declare function setNowForTests(next: (() => string) | null): void;
2
- export declare function nowIso(): string;
@@ -1,230 +0,0 @@
1
- import { type Feature, type PlanInput, type Session } from "./schema";
2
- export type TransitionResult<T> = {
3
- ok: true;
4
- value: T;
5
- } | {
6
- ok: false;
7
- message: string;
8
- recovery?: string;
9
- session?: Session;
10
- };
11
- export declare function createSession(goal: string): Session;
12
- export declare function applyPlan(session: Session, planInput: PlanInput): TransitionResult<Session>;
13
- export declare function approvePlan(session: Session): TransitionResult<Session>;
14
- export declare function startRun(session: Session, featureId?: string, options?: {
15
- phaseBoundaryAck?: boolean;
16
- }): TransitionResult<{
17
- session: Session;
18
- feature: Feature;
19
- }>;
20
- export declare function completeFeature(session: Session, input: unknown): TransitionResult<Session>;
21
- export declare function resetFeature(session: Session, featureId: string): TransitionResult<Session>;
22
- export declare function closeSession(session: Session, kind: "completed" | "deferred" | "abandoned", summary?: string): TransitionResult<Session>;
23
- export declare function summarizeSession(session: Session | null): {
24
- status: string;
25
- summary: string;
26
- nextAction: string;
27
- statusSummary?: never;
28
- dataNote?: never;
29
- session?: never;
30
- } | {
31
- status: "completed" | "blocked" | "planning" | "ready" | "running";
32
- summary: string;
33
- statusSummary: string;
34
- nextAction: string;
35
- dataNote: string;
36
- session: {
37
- id: string;
38
- goal: string;
39
- status: "completed" | "blocked" | "planning" | "ready" | "running";
40
- approval: "pending" | "approved";
41
- activeFeature: {
42
- id: string;
43
- title: string;
44
- summary: string;
45
- status: "pending" | "in_progress" | "completed" | "blocked";
46
- reviewDepth: "quick" | "standard" | "detailed";
47
- targets: string[];
48
- validation: string[];
49
- dependsOn: string[];
50
- } | null;
51
- nextFeature: {
52
- id: string;
53
- title: string;
54
- summary: string;
55
- status: "pending" | "in_progress" | "completed" | "blocked";
56
- reviewDepth: "quick" | "standard" | "detailed";
57
- targets: string[];
58
- validation: string[];
59
- dependsOn: string[];
60
- } | null;
61
- pendingFeatures: {
62
- id: string;
63
- title: string;
64
- summary: string;
65
- status: "pending" | "in_progress" | "completed" | "blocked";
66
- reviewDepth: "quick" | "standard" | "detailed";
67
- targets: string[];
68
- validation: string[];
69
- dependsOn: string[];
70
- }[];
71
- progress: {
72
- completed: number;
73
- total: number;
74
- remaining: number;
75
- };
76
- features: {
77
- id: string;
78
- title: string;
79
- summary: string;
80
- status: "pending" | "in_progress" | "completed" | "blocked";
81
- reviewDepth: "quick" | "standard" | "detailed";
82
- targets: string[];
83
- validation: string[];
84
- dependsOn: string[];
85
- }[];
86
- budget: {
87
- phaseStartedAt: string;
88
- completedFeaturesSinceBoundary: number;
89
- reviewCount: number;
90
- failedReviewCount: number;
91
- failedReviewAttemptsByFeature: Record<string, number>;
92
- orchestration: {
93
- passCount: number;
94
- workerCount: number;
95
- candidatePassCount: number;
96
- verifierPassCount: number;
97
- candidateEligibleCount: number;
98
- candidateUsedDecisionCount: number;
99
- candidateSerialRequiredDecisionCount: number;
100
- skippedCandidateDecisionCount: number;
101
- recordedPassIds: string[];
102
- latestPasses: {
103
- id: string;
104
- kind: "validation" | "audit" | "candidate" | "discovery" | "review" | "verification" | "implementation-decision";
105
- candidateEligibility: "eligible" | "not_eligible" | "unknown";
106
- decisionFactors: ("shared_state" | "overlapping_files" | "small_slice" | "needs_manager_judgment" | "independent_surface" | "validation_available")[];
107
- modes: ("evidence" | "validation" | "audit" | "verifier" | "review" | "candidate-implementation")[];
108
- workerCount: number;
109
- candidateWorkerCount: number;
110
- verifierWorkerCount: number;
111
- sliceIds: string[];
112
- dependsOn: string[];
113
- writeScope: "none" | "manager-serial" | "exact-path" | "isolated-worktree" | "mixed";
114
- handoffRefs: string[];
115
- verificationStatus: "pending" | "passed" | "failed" | "mixed" | "not-needed" | "downgraded";
116
- outcome: "accepted" | "modified" | "rejected" | "partial" | "not-covered" | "superseded";
117
- decision?: "parallel" | "serial" | "candidate-exact-path" | "candidate-worktree" | "tournament" | "skipped" | undefined;
118
- decisionReason?: string | undefined;
119
- candidateDecision?: "skipped" | "used" | "serial_required" | undefined;
120
- synthesisRef?: string | undefined;
121
- }[];
122
- };
123
- tokenTelemetry: {
124
- note: string | undefined;
125
- source: "host_unavailable" | "reported";
126
- visibleTokens: number | null;
127
- cacheReadTokens: number | null;
128
- nonCacheTokens: number | null;
129
- };
130
- phaseBoundary: {
131
- reason: "feature_limit" | "token_limit" | "review_failure_limit";
132
- summary: string;
133
- resumeInstructions: string;
134
- recordedAt: string;
135
- } | null;
136
- };
137
- resumePacket: {
138
- sessionId: string;
139
- goal: string;
140
- status: "completed" | "blocked" | "planning" | "ready" | "running";
141
- activeFeatureId: string | null;
142
- progress: {
143
- completed: number;
144
- total: number;
145
- };
146
- phaseBoundary: {
147
- reason: "feature_limit" | "token_limit" | "review_failure_limit";
148
- summary: string;
149
- resumeInstructions: string;
150
- recordedAt: string;
151
- };
152
- nextAction: string;
153
- } | null;
154
- closure: {
155
- kind: "completed" | "deferred" | "abandoned";
156
- summary: string;
157
- recordedAt: string;
158
- } | null;
159
- lastError: {
160
- tool: string;
161
- summary: string;
162
- recordedAt: string;
163
- recovery?: string | undefined;
164
- } | null;
165
- latestHistoryEntry: {
166
- featureId: string;
167
- status: "completed" | "blocked" | "needs_input";
168
- summary: string;
169
- recordedAt: string;
170
- artifactsChanged: {
171
- path: string;
172
- }[];
173
- validationRun: {
174
- command: string;
175
- status: "passed" | "failed";
176
- summary: string;
177
- }[];
178
- orchestrationPasses: {
179
- id: string;
180
- kind: "validation" | "audit" | "candidate" | "discovery" | "review" | "verification" | "implementation-decision";
181
- candidateEligibility: "eligible" | "not_eligible" | "unknown";
182
- decisionFactors: ("shared_state" | "overlapping_files" | "small_slice" | "needs_manager_judgment" | "independent_surface" | "validation_available")[];
183
- modes: ("evidence" | "validation" | "audit" | "verifier" | "review" | "candidate-implementation")[];
184
- workerCount: number;
185
- candidateWorkerCount: number;
186
- verifierWorkerCount: number;
187
- sliceIds: string[];
188
- dependsOn: string[];
189
- writeScope: "none" | "manager-serial" | "exact-path" | "isolated-worktree" | "mixed";
190
- handoffRefs: string[];
191
- verificationStatus: "pending" | "passed" | "failed" | "mixed" | "not-needed" | "downgraded";
192
- outcome: "accepted" | "modified" | "rejected" | "partial" | "not-covered" | "superseded";
193
- decision?: "parallel" | "serial" | "candidate-exact-path" | "candidate-worktree" | "tournament" | "skipped" | undefined;
194
- decisionReason?: string | undefined;
195
- candidateDecision?: "skipped" | "used" | "serial_required" | undefined;
196
- synthesisRef?: string | undefined;
197
- }[];
198
- validationScope?: "targeted" | "broad" | undefined;
199
- featureReviewDepth?: "quick" | "standard" | "detailed" | undefined;
200
- featureReview?: {
201
- status: "passed" | "failed";
202
- summary: string;
203
- blockingFindings: {
204
- summary: string;
205
- severity: "blocking" | "advisory";
206
- }[];
207
- } | undefined;
208
- finalReview?: {
209
- status: "passed" | "failed";
210
- summary: string;
211
- blockingFindings: {
212
- summary: string;
213
- severity: "blocking" | "advisory";
214
- }[];
215
- reviewDepth: "broad" | "detailed";
216
- } | undefined;
217
- outcome?: {
218
- kind: "completed" | "blocked" | "needs_input" | "replan_required";
219
- summary?: string | undefined;
220
- resolutionHint?: string | undefined;
221
- } | undefined;
222
- } | null;
223
- historyCount: number;
224
- timestamps: {
225
- createdAt: string;
226
- updatedAt: string;
227
- completedAt: string | null;
228
- };
229
- };
230
- };