opencode-plugin-flow 4.1.11 → 4.1.14
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/CHANGELOG.md +12 -0
- package/README.md +32 -7
- package/dist/adapters/opencode/config.d.ts +3 -0
- package/dist/adapters/opencode/logging.d.ts +3 -0
- package/dist/adapters/opencode/plugin.d.ts +3 -0
- package/dist/adapters/opencode/sdk.d.ts +3 -0
- package/dist/adapters/opencode/tools.d.ts +211 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +221 -58
- package/dist/config-shared.d.ts +265 -0
- package/dist/config.d.ts +1 -0
- package/dist/distribution/flow-skill-definitions.d.ts +9 -0
- package/dist/distribution/sync.d.ts +63 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +222 -66
- package/dist/index.js.map +9 -9
- package/dist/runtime/api.d.ts +123 -0
- package/dist/runtime/json/strict-object.d.ts +9 -0
- package/dist/runtime/schema.d.ts +490 -0
- package/dist/runtime/time.d.ts +2 -0
- package/dist/runtime/transitions.d.ts +112 -0
- package/dist/runtime/workspace.d.ts +22 -0
- package/package.json +14 -3
|
@@ -0,0 +1,112 @@
|
|
|
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): TransitionResult<{
|
|
15
|
+
session: Session;
|
|
16
|
+
feature: Feature;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function completeFeature(session: Session, input: unknown): TransitionResult<Session>;
|
|
19
|
+
export declare function resetFeature(session: Session, featureId: string): TransitionResult<Session>;
|
|
20
|
+
export declare function closeSession(session: Session, kind: "completed" | "deferred" | "abandoned", summary?: string): TransitionResult<Session>;
|
|
21
|
+
export declare function summarizeSession(session: Session | null): {
|
|
22
|
+
status: string;
|
|
23
|
+
summary: string;
|
|
24
|
+
nextAction: string;
|
|
25
|
+
session?: never;
|
|
26
|
+
} | {
|
|
27
|
+
status: "completed" | "blocked" | "planning" | "ready" | "running";
|
|
28
|
+
summary: string;
|
|
29
|
+
nextAction: string;
|
|
30
|
+
session: {
|
|
31
|
+
id: string;
|
|
32
|
+
goal: string;
|
|
33
|
+
status: "completed" | "blocked" | "planning" | "ready" | "running";
|
|
34
|
+
approval: "pending" | "approved";
|
|
35
|
+
activeFeature: {
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
summary: string;
|
|
39
|
+
status: "pending" | "in_progress" | "completed" | "blocked";
|
|
40
|
+
targets: string[];
|
|
41
|
+
validation: string[];
|
|
42
|
+
dependsOn: string[];
|
|
43
|
+
} | null;
|
|
44
|
+
progress: {
|
|
45
|
+
completed: number;
|
|
46
|
+
total: number;
|
|
47
|
+
};
|
|
48
|
+
features: {
|
|
49
|
+
id: string;
|
|
50
|
+
title: string;
|
|
51
|
+
summary: string;
|
|
52
|
+
status: "pending" | "in_progress" | "completed" | "blocked";
|
|
53
|
+
targets: string[];
|
|
54
|
+
validation: string[];
|
|
55
|
+
dependsOn: string[];
|
|
56
|
+
}[];
|
|
57
|
+
closure: {
|
|
58
|
+
kind: "completed" | "deferred" | "abandoned";
|
|
59
|
+
summary: string;
|
|
60
|
+
recordedAt: string;
|
|
61
|
+
} | null;
|
|
62
|
+
lastError: {
|
|
63
|
+
tool: string;
|
|
64
|
+
summary: string;
|
|
65
|
+
recordedAt: string;
|
|
66
|
+
recovery?: string | undefined;
|
|
67
|
+
} | null;
|
|
68
|
+
latestHistoryEntry: {
|
|
69
|
+
featureId: string;
|
|
70
|
+
status: "completed" | "blocked" | "needs_input";
|
|
71
|
+
summary: string;
|
|
72
|
+
recordedAt: string;
|
|
73
|
+
artifactsChanged: {
|
|
74
|
+
path: string;
|
|
75
|
+
}[];
|
|
76
|
+
validationRun: {
|
|
77
|
+
command: string;
|
|
78
|
+
status: "passed" | "failed";
|
|
79
|
+
summary: string;
|
|
80
|
+
}[];
|
|
81
|
+
validationScope?: "targeted" | "broad" | undefined;
|
|
82
|
+
featureReview?: {
|
|
83
|
+
status: "passed" | "failed";
|
|
84
|
+
summary: string;
|
|
85
|
+
blockingFindings: {
|
|
86
|
+
summary: string;
|
|
87
|
+
severity: "blocking" | "advisory";
|
|
88
|
+
}[];
|
|
89
|
+
} | undefined;
|
|
90
|
+
finalReview?: {
|
|
91
|
+
status: "passed" | "failed";
|
|
92
|
+
summary: string;
|
|
93
|
+
blockingFindings: {
|
|
94
|
+
summary: string;
|
|
95
|
+
severity: "blocking" | "advisory";
|
|
96
|
+
}[];
|
|
97
|
+
reviewDepth: "broad" | "detailed";
|
|
98
|
+
} | undefined;
|
|
99
|
+
outcome?: {
|
|
100
|
+
kind: "completed" | "blocked" | "needs_input" | "replan_required";
|
|
101
|
+
summary?: string | undefined;
|
|
102
|
+
resolutionHint?: string | undefined;
|
|
103
|
+
} | undefined;
|
|
104
|
+
} | null;
|
|
105
|
+
historyCount: number;
|
|
106
|
+
timestamps: {
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
completedAt: string | null;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Session } from "./schema";
|
|
2
|
+
export declare class InvalidFlowWorkspaceRootError extends Error {
|
|
3
|
+
readonly code = "INVALID_FLOW_WORKSPACE_ROOT";
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
export declare function normalizeWorkspaceRoot(rawPath: string | undefined): string | null;
|
|
7
|
+
export declare function assertMutableWorkspaceRoot(rawPath: string): string;
|
|
8
|
+
export declare function resolveWorkspaceRoot(context: {
|
|
9
|
+
worktree?: string;
|
|
10
|
+
directory?: string;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function flowDir(worktree: string): string;
|
|
13
|
+
export declare function sessionPath(worktree: string): string;
|
|
14
|
+
export declare function flowInstructionPath(worktree: string): string;
|
|
15
|
+
export declare function historyDir(worktree: string): string;
|
|
16
|
+
export declare function archivedSessionPath(worktree: string, sessionId: string): string;
|
|
17
|
+
export declare function withSessionLock<T>(worktree: string, task: () => Promise<T>): Promise<T>;
|
|
18
|
+
export declare function loadSession(worktree: string): Promise<Session | null>;
|
|
19
|
+
export declare function refreshFlowInstructionFile(worktree: string): Promise<void>;
|
|
20
|
+
export declare function saveSession(worktree: string, session: Session): Promise<Session>;
|
|
21
|
+
export declare function archiveAndClearSession(worktree: string, session: Session): Promise<void>;
|
|
22
|
+
export declare function isAbsoluteOrTraversal(value: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-plugin-flow",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.14",
|
|
4
4
|
"description": "Stateful planning and execution workflow plugin for OpenCode",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ddv1982/flow-opencode.git"
|
|
9
|
+
},
|
|
6
10
|
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
7
12
|
"exports": {
|
|
8
|
-
".":
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
9
18
|
},
|
|
10
19
|
"bin": {
|
|
11
20
|
"opencode-plugin-flow": "./dist/cli.js"
|
|
@@ -17,10 +26,12 @@
|
|
|
17
26
|
"CHANGELOG.md"
|
|
18
27
|
],
|
|
19
28
|
"scripts": {
|
|
20
|
-
"build": "bun run build:plugin && bun run build:cli",
|
|
29
|
+
"build": "bun run build:plugin && bun run build:cli && bun run build:types",
|
|
21
30
|
"build:plugin": "bun build --target=node --outdir=./dist --entry-naming=index.js --external=@opencode-ai/plugin --external=zod --minify --drop=console --sourcemap=external ./src/index.ts",
|
|
22
31
|
"build:cli": "bun build --target=node --outdir=./dist --entry-naming=cli.js --banner='#!/usr/bin/env node' --minify ./src/cli.ts",
|
|
32
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
23
33
|
"lint": "bunx biome check src tests --files-ignore-unknown=true --vcs-use-ignore-file=true",
|
|
34
|
+
"package:smoke": "bun test tests/package-smoke.test.ts",
|
|
24
35
|
"test": "bun test tests",
|
|
25
36
|
"typecheck": "tsc --noEmit",
|
|
26
37
|
"uninstall:opencode": "bun run ./src/cli.ts uninstall",
|