opencode-plugin-flow 4.3.9 → 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 (43) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +59 -48
  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 -2773
  8. package/dist/cli.js.map +7 -6
  9. package/dist/config-shared.d.ts +30 -16
  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 +2676 -1929
  21. package/dist/index.js.map +24 -16
  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 -14
  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-baseline-fixtures.d.ts +19 -0
  31. package/dist/prompt-model-evaluation.d.ts +88 -0
  32. package/dist/prompt-quality.d.ts +73 -0
  33. package/dist/prompt-surfaces.d.ts +28 -0
  34. package/dist/version.d.ts +1 -0
  35. package/package.json +19 -12
  36. package/dist/adapters/opencode/config.d.ts +0 -3
  37. package/dist/adapters/opencode/tools.d.ts +0 -322
  38. package/dist/distribution/flow-skill-definitions.d.ts +0 -9
  39. package/dist/distribution/sync.d.ts +0 -69
  40. package/dist/runtime/time.d.ts +0 -2
  41. package/dist/runtime/transitions.d.ts +0 -230
  42. /package/dist/{runtime/json/strict-object.d.ts → infrastructure/fs/strict-json-object.d.ts} +0 -0
  43. /package/dist/{adapters → platform}/opencode/logging.d.ts +0 -0
@@ -0,0 +1,80 @@
1
+ import type { ExecutionHistoryEntry, Feature, FeatureId, PlanInput, Session, SessionId, WorkerResult } from "./session.js";
2
+ export type TransitionEnvironment = {
3
+ now(): string;
4
+ newSessionId(): SessionId;
5
+ };
6
+ export type TransitionResult<T> = {
7
+ ok: true;
8
+ value: T;
9
+ } | {
10
+ ok: false;
11
+ message: string;
12
+ recovery?: string;
13
+ session?: Session;
14
+ };
15
+ export declare function createSession(goal: string, environment: TransitionEnvironment): Session;
16
+ export declare function applyPlan(session: Session, planInput: PlanInput, environment: TransitionEnvironment): TransitionResult<Session>;
17
+ export declare function approvePlan(session: Session, environment: TransitionEnvironment): TransitionResult<Session>;
18
+ export declare function startRun(session: Session, environment: TransitionEnvironment, featureId?: FeatureId): TransitionResult<{
19
+ session: Session;
20
+ feature: Feature;
21
+ }>;
22
+ export declare function completeFeature(session: Session, worker: WorkerResult, environment: TransitionEnvironment): TransitionResult<Session>;
23
+ export declare function resetFeature(session: Session, featureId: FeatureId, environment: TransitionEnvironment): TransitionResult<Session>;
24
+ export declare function closeSession(session: Session, kind: "completed" | "deferred" | "abandoned", environment: TransitionEnvironment, summary?: string): TransitionResult<Session>;
25
+ export declare function summarizeSession(session: Session | null): {
26
+ status: "missing_session";
27
+ summary: string;
28
+ nextAction: string;
29
+ statusSummary?: never;
30
+ dataNote?: never;
31
+ workflowData?: never;
32
+ } | {
33
+ status: "ok";
34
+ summary: string;
35
+ statusSummary: string;
36
+ nextAction: string;
37
+ dataNote: string;
38
+ workflowData: {
39
+ session: {
40
+ sourceSummary: string;
41
+ id: SessionId;
42
+ goal: string;
43
+ status: import("./session.js").SessionStatus;
44
+ approval: "approved" | "pending";
45
+ activeFeature: Feature | null;
46
+ nextFeature: Feature | null;
47
+ pendingFeatures: Feature[];
48
+ progress: {
49
+ completed: number;
50
+ total: number;
51
+ remaining: number;
52
+ };
53
+ features: Feature[];
54
+ budget: {
55
+ reviewCount: number;
56
+ failedReviewCount: number;
57
+ failedReviewAttemptsByFeature: Record<string, number>;
58
+ orchestration: import("./session.js").OrchestrationTelemetry;
59
+ };
60
+ closure: {
61
+ kind: "completed" | "deferred" | "abandoned";
62
+ summary: string;
63
+ recordedAt: string;
64
+ } | null;
65
+ lastError: {
66
+ tool: string;
67
+ summary: string;
68
+ recovery?: string | undefined;
69
+ recordedAt: string;
70
+ } | null;
71
+ latestHistoryEntry: ExecutionHistoryEntry | null;
72
+ historyCount: number;
73
+ timestamps: {
74
+ createdAt: string;
75
+ updatedAt: string;
76
+ completedAt: string | null;
77
+ };
78
+ };
79
+ };
80
+ };
@@ -0,0 +1,18 @@
1
+ import { type FlowGuidanceId, type FlowGuidanceTopic } from "./ids.js";
2
+ export { FLOW_GUIDANCE_IDS, FLOW_GUIDANCE_TOPICS, type FlowGuidanceId, type FlowGuidanceTopic, } from "./ids.js";
3
+ export type FlowGuidanceFile = {
4
+ relativePath: string;
5
+ content: string;
6
+ };
7
+ export type FlowGuidanceDefinition = {
8
+ name: FlowGuidanceTopic;
9
+ files: FlowGuidanceFile[];
10
+ };
11
+ export declare const FLOW_GUIDANCE_DEFINITIONS: readonly FlowGuidanceDefinition[];
12
+ export type FlowGuidanceDocument = FlowGuidanceFile & {
13
+ id: FlowGuidanceId;
14
+ topic: FlowGuidanceTopic;
15
+ };
16
+ export declare const FLOW_GUIDANCE_DOCUMENTS: readonly FlowGuidanceDocument[];
17
+ export declare function getFlowGuidance(id: FlowGuidanceId): FlowGuidanceDocument;
18
+ export declare function findFlowGuidance(topic: string, relativePath: string): FlowGuidanceDocument | undefined;
@@ -0,0 +1,4 @@
1
+ export declare const FLOW_GUIDANCE_TOPICS: readonly ["flow", "flow-plan", "flow-run", "flow-test", "flow-review", "flow-deslop", "flow-ui-quality", "flow-commit"];
2
+ export type FlowGuidanceTopic = (typeof FLOW_GUIDANCE_TOPICS)[number];
3
+ export declare const FLOW_GUIDANCE_IDS: readonly ["flow", "flow/references/recovery-playbook.md", "flow/references/parallel-orchestration.md", "flow/references/parallel-decision.md", "flow/references/parallel-manifest.md", "flow/references/parallel-execution.md", "flow/references/parallel-synthesis.md", "flow/references/parallel-pass-example.md", "flow/references/handoff-format.md", "flow-plan", "flow-plan/references/planning-examples.md", "flow-plan/references/plan-quality-checklist.md", "flow-plan/references/parallel-discovery.md", "flow-run", "flow-run/references/validation-rubric.md", "flow-run/references/audit-rubric.md", "flow-test", "flow-review", "flow-review/references/hidden-reviewer-contract.md", "flow-review/references/review-rubric.md", "flow-deslop", "flow-deslop/references/smell-rubric.md", "flow-deslop/references/refactor-workflow.md", "flow-ui-quality", "flow-ui-quality/references/ui-rubric.md", "flow-ui-quality/references/visual-verification.md", "flow-commit"];
4
+ export type FlowGuidanceId = (typeof FLOW_GUIDANCE_IDS)[number];
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default } from "./adapters/opencode/plugin";
1
+ export { default } from "./platform/opencode/plugin.js";