opencode-plugin-flow 5.0.0 → 5.1.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 +33 -0
- package/README.md +21 -8
- package/dist/application/flow-service.d.ts +197 -101
- package/dist/application/ports/evidence-artifact-store.d.ts +28 -0
- package/dist/application/ports/session-repository.d.ts +8 -1
- package/dist/application/ports/source-identity.d.ts +61 -0
- package/dist/application/replay/canonical-json.d.ts +7 -0
- package/dist/application/replay/contract.d.ts +2007 -0
- package/dist/application/replay/engine.d.ts +101 -0
- package/dist/application/replay/index.d.ts +7 -0
- package/dist/application/replay/privacy.d.ts +14 -0
- package/dist/application/schema.d.ts +891 -5
- package/dist/cli.js +13 -2
- package/dist/cli.js.map +3 -3
- package/dist/domain/session.d.ts +174 -0
- package/dist/domain/transitions.d.ts +138 -55
- package/dist/domain/validation-command.d.ts +8 -0
- package/dist/index.js +3923 -1422
- package/dist/index.js.map +19 -13
- package/dist/infrastructure/fs/evidence-artifact-store.d.ts +5 -0
- package/dist/infrastructure/fs/source-identity.d.ts +26 -0
- package/dist/infrastructure/fs/workspace-flow-service.d.ts +1 -1
- package/dist/infrastructure/fs/workspace.d.ts +2 -0
- package/dist/platform/opencode/tools.d.ts +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type EvidenceArtifactRef, type EvidenceArtifactStore } from "../../application/ports/evidence-artifact-store.js";
|
|
2
|
+
export declare function evidenceArtifactDirectory(workspace: string): string;
|
|
3
|
+
export declare function evidenceArtifactPath(workspace: string, ref: EvidenceArtifactRef): string;
|
|
4
|
+
export declare function evidenceArtifactRefForBytes(bytes: Uint8Array): EvidenceArtifactRef;
|
|
5
|
+
export declare function createFileEvidenceArtifactStore(workspace: string): EvidenceArtifactStore;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SourceIdentityProvider } from "../../application/ports/source-identity.js";
|
|
2
|
+
/**
|
|
3
|
+
* Bounded budgets. Exceeding any of these fails closed with a bounded recovery
|
|
4
|
+
* response rather than reading an unbounded amount of source state.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MAX_SOURCE_ENTRIES = 20000;
|
|
7
|
+
export declare const MAX_SOURCE_TOTAL_BYTES: number;
|
|
8
|
+
export declare const MAX_SOURCE_FILE_BYTES: number;
|
|
9
|
+
/**
|
|
10
|
+
* Create the authoritative source-identity provider for a workspace root.
|
|
11
|
+
*
|
|
12
|
+
* The digest binds:
|
|
13
|
+
* - Git: the HEAD commit, the canonical index (mode/object/stage/path), and the
|
|
14
|
+
* independent working-tree state (content, exec/symlink/gitlink type,
|
|
15
|
+
* index-only sparse absence, and deletions) for tracked and untracked
|
|
16
|
+
* non-ignored paths. Representing the index separately from the worktree
|
|
17
|
+
* distinguishes staged-only changes from equivalent unstaged trees. Sparse
|
|
18
|
+
* and dense materializations are intentionally distinct source states.
|
|
19
|
+
* - Non-Git: a deterministic full-tree manifest.
|
|
20
|
+
*
|
|
21
|
+
* Git's `--exclude-standard` supplies ignore semantics with no heuristic source
|
|
22
|
+
* exclusions; `.git/**` internals are never enumerated and `.flow/**` is always
|
|
23
|
+
* excluded. Measurement fails closed on unsafe symlinks, unreadable entries,
|
|
24
|
+
* resource overflow, and any workspace change observed while measuring.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createFileSourceIdentityProvider(root: string): SourceIdentityProvider;
|
|
@@ -1,6 +1,6 @@
|
|
|
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): Promise<FlowResponse>;
|
|
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>;
|
|
@@ -26,6 +26,8 @@ export type SessionLockOptions = {
|
|
|
26
26
|
};
|
|
27
27
|
export declare function withSessionLock<T>(worktree: string, task: () => Promise<T>, lockOptions?: SessionLockOptions): Promise<T>;
|
|
28
28
|
export declare function loadSession(worktree: string): Promise<Session | null>;
|
|
29
|
+
export declare function findArchivedSessionByOperationId(worktree: string, operationId: string): Promise<Session | null>;
|
|
29
30
|
export declare function quarantineUnreadableSession(worktree: string): Promise<string | null>;
|
|
30
31
|
export declare function saveSession(worktree: string, session: Session): Promise<Session>;
|
|
31
32
|
export declare function archiveAndClearSession(worktree: string, session: Session): Promise<void>;
|
|
33
|
+
export declare function ensureFlowGitignore(worktree: string): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Hooks } from "@opencode-ai/plugin";
|
|
2
|
-
export type FlowHostInputOperation = "planSave" | "runStart" | "featureComplete" | "featureReset" | "sessionClose";
|
|
2
|
+
export type FlowHostInputOperation = "status" | "planSave" | "runStart" | "featureComplete" | "featureReset" | "sessionClose";
|
|
3
3
|
export declare function acceptsFlowHostInput(operation: FlowHostInputOperation, input: unknown): boolean;
|
|
4
4
|
type FlowTools = NonNullable<Hooks["tool"]>;
|
|
5
5
|
export declare function createTools(ctx: unknown): FlowTools;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-plugin-flow",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Stateful planning and execution workflow plugin for OpenCode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
"lint": "bunx biome check src tests scripts --files-ignore-unknown=true --vcs-use-ignore-file=true",
|
|
35
35
|
"prompt:quality": "bun run scripts/prompt-quality.ts",
|
|
36
36
|
"prompt:model-eval": "bun run scripts/prompt-model-eval.ts",
|
|
37
|
+
"replay:report": "bun run scripts/replay-report.ts",
|
|
38
|
+
"transport:report": "bun run scripts/causal-transport-report.ts",
|
|
37
39
|
"package:smoke": "bun test tests/package-smoke.test.ts",
|
|
38
40
|
"release:monitor": "node scripts/release-monitor.mjs",
|
|
39
41
|
"smoke:live": "FLOW_LIVE_SMOKE=1 bun test tests/live-opencode-smoke.test.ts",
|