opencode-plugin-flow 5.1.0 → 5.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/CHANGELOG.md +60 -0
- package/README.md +83 -30
- package/dist/application/errors.d.ts +5 -0
- package/dist/application/flow-service.d.ts +219 -247
- package/dist/application/ports/session-repository.d.ts +1 -0
- package/dist/application/replay/contract.d.ts +123 -0
- package/dist/application/schema.d.ts +376 -706
- package/dist/domain/limits.d.ts +3 -0
- package/dist/domain/session-invariants.d.ts +8 -0
- package/dist/domain/session.d.ts +88 -87
- package/dist/domain/transitions.d.ts +133 -21
- package/dist/index.js +3273 -1462
- package/dist/index.js.map +19 -18
- package/dist/infrastructure/fs/workspace-flow-service.d.ts +2 -1
- package/dist/infrastructure/fs/workspace.d.ts +31 -2
- package/dist/platform/opencode/tools.d.ts +0 -2
- package/dist/prompt-baseline-fixtures.d.ts +4 -3
- package/dist/prompt-quality.d.ts +7 -0
- package/package.json +5 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type FlowResponse, type FlowService } from "../../application/flow-service.js";
|
|
2
2
|
export declare function createWorkspaceFlowService(workspace: string): FlowService;
|
|
3
|
-
export declare function flowStatus(workspace: string, input
|
|
3
|
+
export declare function flowStatus(workspace: string, input: unknown): Promise<FlowResponse>;
|
|
4
4
|
export declare function flowPlanSave(workspace: string, input: unknown): Promise<FlowResponse>;
|
|
5
5
|
export declare function flowPlanApprove(workspace: string): Promise<FlowResponse>;
|
|
6
6
|
export declare function flowRunStart(workspace: string, input: unknown): Promise<FlowResponse>;
|
|
7
7
|
export declare function flowFeatureComplete(workspace: string, input: unknown): Promise<FlowResponse>;
|
|
8
|
+
export declare function flowReviewStart(workspace: string, input: unknown): Promise<FlowResponse>;
|
|
8
9
|
export declare function flowFeatureReset(workspace: string, input: unknown): Promise<FlowResponse>;
|
|
9
10
|
export declare function flowSessionClose(workspace: string, input: unknown): Promise<FlowResponse>;
|
|
@@ -11,6 +11,10 @@ export declare class ArchiveCollisionError extends Error {
|
|
|
11
11
|
readonly code = "FLOW_ARCHIVE_COLLISION";
|
|
12
12
|
constructor(message: string, options?: ErrorOptions);
|
|
13
13
|
}
|
|
14
|
+
export declare class UnclosedSessionArchiveError extends Error {
|
|
15
|
+
readonly code = "FLOW_ARCHIVE_REQUIRES_CLOSURE";
|
|
16
|
+
constructor(message: string);
|
|
17
|
+
}
|
|
14
18
|
export declare function normalizeWorkspaceRoot(rawPath: string | undefined): string | null;
|
|
15
19
|
export declare function assertMutableWorkspaceRoot(rawPath: string): string;
|
|
16
20
|
export declare function resolveWorkspaceRoot(context: {
|
|
@@ -20,14 +24,39 @@ export declare function resolveWorkspaceRoot(context: {
|
|
|
20
24
|
export declare function flowDir(worktree: string): string;
|
|
21
25
|
export declare function sessionPath(worktree: string): string;
|
|
22
26
|
export declare function historyDir(worktree: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Map the exact, case-sensitive session identity into a portable lowercase
|
|
29
|
+
* archive component. The fixed digest avoids both case-fold collisions and
|
|
30
|
+
* filesystem component growth while lookup still verifies the parsed id.
|
|
31
|
+
*/
|
|
32
|
+
export declare function archivedSessionFilename(sessionId: string): string;
|
|
23
33
|
export declare function archivedSessionPath(worktree: string, sessionId: string): string;
|
|
34
|
+
type ArchiveAndClearTestHooks = {
|
|
35
|
+
afterHistoryPinned?: (() => Promise<void>) | undefined;
|
|
36
|
+
afterFlowPinnedBeforeDelete?: (() => Promise<void>) | undefined;
|
|
37
|
+
pinnedHelperTestExecutable?: string | undefined;
|
|
38
|
+
pinnedHelperReadyTimeoutMs?: number | undefined;
|
|
39
|
+
pinnedHelperCompletionTimeoutMs?: number | undefined;
|
|
40
|
+
};
|
|
24
41
|
export type SessionLockOptions = {
|
|
25
42
|
timeoutMs?: number;
|
|
26
43
|
};
|
|
27
44
|
export declare function withSessionLock<T>(worktree: string, task: () => Promise<T>, lockOptions?: SessionLockOptions): Promise<T>;
|
|
28
45
|
export declare function loadSession(worktree: string): Promise<Session | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Find any canonical archive containing an operation id. Close-start preflight
|
|
48
|
+
* uses this wider lookup because a retry handle must not collide with any
|
|
49
|
+
* historical mutation identity.
|
|
50
|
+
*/
|
|
29
51
|
export declare function findArchivedSessionByOperationId(worktree: string, operationId: string): Promise<Session | null>;
|
|
30
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Recover only the archive whose accepted closure owns this retry handle.
|
|
54
|
+
* A later session may reuse the same text for a non-close mutation without
|
|
55
|
+
* making the original accepted close ambiguous.
|
|
56
|
+
*/
|
|
57
|
+
export declare function findArchivedSessionByCloseRetryOperationId(worktree: string, operationId: string): Promise<Session | null>;
|
|
58
|
+
export declare function quarantineUnreadableSession(worktree: string, hooks?: ArchiveAndClearTestHooks): Promise<string | null>;
|
|
31
59
|
export declare function saveSession(worktree: string, session: Session): Promise<Session>;
|
|
32
|
-
export declare function archiveAndClearSession(worktree: string, session: Session): Promise<void>;
|
|
60
|
+
export declare function archiveAndClearSession(worktree: string, session: Session, hooks?: ArchiveAndClearTestHooks): Promise<void>;
|
|
33
61
|
export declare function ensureFlowGitignore(worktree: string): Promise<void>;
|
|
62
|
+
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { type Hooks } from "@opencode-ai/plugin";
|
|
2
|
-
export type FlowHostInputOperation = "status" | "planSave" | "runStart" | "featureComplete" | "featureReset" | "sessionClose";
|
|
3
|
-
export declare function acceptsFlowHostInput(operation: FlowHostInputOperation, input: unknown): boolean;
|
|
4
2
|
type FlowTools = NonNullable<Hooks["tool"]>;
|
|
5
3
|
export declare function createTools(ctx: unknown): FlowTools;
|
|
6
4
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Frozen
|
|
2
|
+
* Frozen comparison prompt assembly used only for compiler-shape evaluation.
|
|
3
3
|
*
|
|
4
4
|
* These strings capture the pre-compiler public startup and hidden-worker
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* topology while retaining the current Session v4 lifecycle and nested wire
|
|
6
|
+
* contract. They are not production prompt sources and must never be selected
|
|
7
|
+
* by the default compiled Flow surfaces. Keep the exception explicit so manual
|
|
7
8
|
* baseline text cannot be mistaken for a maintained projection of skill rules.
|
|
8
9
|
*/
|
|
9
10
|
export declare const LEGACY_PROMPT_BASELINE: Readonly<{
|
package/dist/prompt-quality.d.ts
CHANGED
|
@@ -44,6 +44,13 @@ export type PromptRepetitionClassification = {
|
|
|
44
44
|
occurrences: string[];
|
|
45
45
|
rationale: string;
|
|
46
46
|
};
|
|
47
|
+
export type LifecycleFlatRequestExample = {
|
|
48
|
+
tool: "flow_status" | "flow_review_start" | "flow_feature_complete" | "flow_session_close";
|
|
49
|
+
line: number;
|
|
50
|
+
topLevelField: string | null;
|
|
51
|
+
};
|
|
52
|
+
/** Finds lifecycle-tool examples that bypass the required `request` envelope. */
|
|
53
|
+
export declare function auditLifecycleFlatRequestExamples(text: string): LifecycleFlatRequestExample[];
|
|
47
54
|
export declare function measurePromptText(options: {
|
|
48
55
|
surface: string;
|
|
49
56
|
variant: FlowPromptVariant | "runtime";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-plugin-flow",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Stateful planning and execution workflow plugin for OpenCode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"package:smoke": "bun test tests/package-smoke.test.ts",
|
|
40
40
|
"release:monitor": "node scripts/release-monitor.mjs",
|
|
41
41
|
"smoke:live": "FLOW_LIVE_SMOKE=1 bun test tests/live-opencode-smoke.test.ts",
|
|
42
|
+
"test:lifecycle:invariants": "bun test tests/review-lifecycle-coverage-map.test.ts tests/lifecycle-invariant-sequences.test.ts tests/lifecycle-invariant-v4-only.test.ts",
|
|
43
|
+
"test:lifecycle:recovery": "bun test tests/lifecycle-invariant-recovery.test.ts",
|
|
44
|
+
"test:contracts": "bun test tests/lifecycle-invariant-contracts.test.ts tests/opencode-schema-contract.test.ts",
|
|
45
|
+
"verify:lifecycle": "bun run test:lifecycle:invariants && bun run test:lifecycle:recovery && bun run test:contracts",
|
|
42
46
|
"test": "bun test tests",
|
|
43
47
|
"typecheck": "tsc --noEmit",
|
|
44
48
|
"check": "bun run typecheck && bun run lint && bun run prompt:quality && bun run build && bun run test"
|