opencode-plugin-flow 4.4.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 +90 -0
- package/README.md +60 -43
- package/dist/application/errors.d.ts +5 -0
- package/dist/application/flow-service.d.ts +339 -0
- package/dist/application/ports/evidence-artifact-store.d.ts +28 -0
- package/dist/application/ports/session-repository.d.ts +18 -0
- 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/{runtime → application}/schema.d.ts +1176 -370
- package/dist/cli.js +295 -2721
- package/dist/cli.js.map +7 -6
- package/dist/config-shared.d.ts +28 -14
- package/dist/config.d.ts +1 -1
- package/dist/distribution/legacy-cleanup.d.ts +25 -0
- package/dist/domain/feature-id.d.ts +3 -0
- package/dist/domain/limits.d.ts +1 -0
- package/dist/domain/orchestration-policy.d.ts +27 -0
- package/dist/domain/session.d.ts +355 -0
- package/dist/domain/transitions.d.ts +163 -0
- package/dist/domain/validation-command.d.ts +8 -0
- package/dist/guidance/catalog.d.ts +18 -0
- package/dist/guidance/ids.d.ts +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4495 -1817
- package/dist/index.js.map +30 -18
- package/dist/infrastructure/fs/evidence-artifact-store.d.ts +5 -0
- package/dist/infrastructure/fs/session-repository.d.ts +2 -0
- package/dist/infrastructure/fs/source-identity.d.ts +26 -0
- package/dist/infrastructure/fs/workspace-flow-service.d.ts +9 -0
- package/dist/{runtime → infrastructure/fs}/workspace.d.ts +12 -15
- package/dist/infrastructure/system/transition-environment.d.ts +2 -0
- package/dist/platform/opencode/config.d.ts +2 -0
- package/dist/{adapters → platform}/opencode/plugin.d.ts +1 -1
- package/dist/{adapters → platform}/opencode/sdk.d.ts +0 -1
- package/dist/platform/opencode/tools.d.ts +6 -0
- package/dist/prompt-model-evaluation.d.ts +19 -30
- package/dist/prompt-quality.d.ts +1 -1
- package/dist/version.d.ts +1 -0
- package/package.json +18 -11
- package/dist/adapters/opencode/config.d.ts +0 -3
- package/dist/adapters/opencode/tools.d.ts +0 -322
- package/dist/distribution/flow-skill-definitions.d.ts +0 -9
- package/dist/distribution/sync.d.ts +0 -69
- package/dist/runtime/api.d.ts +0 -211
- package/dist/runtime/time.d.ts +0 -2
- package/dist/runtime/transitions.d.ts +0 -230
- /package/dist/{runtime/json/strict-object.d.ts → infrastructure/fs/strict-json-object.d.ts} +0 -0
- /package/dist/{adapters → platform}/opencode/logging.d.ts +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Session } from "../../domain/session.js";
|
|
2
|
+
import type { EvidenceArtifactStore } from "./evidence-artifact-store.js";
|
|
3
|
+
import type { SourceIdentityProvider } from "./source-identity.js";
|
|
4
|
+
export declare class ArchivedSessionLookupError extends Error {
|
|
5
|
+
readonly code = "FLOW_ARCHIVE_LOOKUP_FAILED";
|
|
6
|
+
constructor(message: string, options?: ErrorOptions);
|
|
7
|
+
}
|
|
8
|
+
export type SessionTransaction = EvidenceArtifactStore & SourceIdentityProvider & {
|
|
9
|
+
load(): Promise<Session | null>;
|
|
10
|
+
findArchivedByOperationId(operationId: string): Promise<Session | null>;
|
|
11
|
+
save(session: Session): Promise<Session>;
|
|
12
|
+
archiveAndClear(session: Session): Promise<void>;
|
|
13
|
+
quarantineUnreadable(): Promise<string | null>;
|
|
14
|
+
};
|
|
15
|
+
export interface SessionRepository {
|
|
16
|
+
read(): Promise<Session | null>;
|
|
17
|
+
transact<T>(task: (transaction: SessionTransaction) => Promise<T>): Promise<T>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application port for the authoritative source/worktree identity boundary.
|
|
3
|
+
*
|
|
4
|
+
* The provider derives a canonical, deterministic digest of the workspace
|
|
5
|
+
* source state (the "A1 canonical source digest"). It is the single trusted
|
|
6
|
+
* producer of source identity used by the transactional completion boundary.
|
|
7
|
+
* Callers never assert source identity; Flow recomputes it and binds evidence
|
|
8
|
+
* to it. The source-v2 manifest is materialization-sensitive:
|
|
9
|
+
* an indexed sparse-checkout path absent from disk is distinct from the same
|
|
10
|
+
* path materialized in a dense worktree.
|
|
11
|
+
*/
|
|
12
|
+
export type SourceDigest = `sha256:${string}`;
|
|
13
|
+
export type SourceIdentity = {
|
|
14
|
+
/** Canonical lowercase SHA-256 digest of the source state. */
|
|
15
|
+
readonly digest: SourceDigest;
|
|
16
|
+
/** Whether the digest was derived from a Git manifest or a full-tree walk. */
|
|
17
|
+
readonly mode: "git" | "non-git";
|
|
18
|
+
/** Number of source entries that contributed to the digest. */
|
|
19
|
+
readonly entryCount: number;
|
|
20
|
+
};
|
|
21
|
+
export interface SourceIdentityProvider {
|
|
22
|
+
/**
|
|
23
|
+
* Compute the canonical source digest for the workspace. Implementations
|
|
24
|
+
* must fail closed on unsafe symlinks, unreadable entries, resource limits,
|
|
25
|
+
* or a workspace mutation observed while the source is being measured.
|
|
26
|
+
*/
|
|
27
|
+
computeSourceIdentity(): Promise<SourceIdentity>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Base class for source-identity failures. The message never carries absolute
|
|
31
|
+
* paths, file contents, or command output; only a bounded, safe reason.
|
|
32
|
+
*/
|
|
33
|
+
export declare class SourceIdentityError extends Error {
|
|
34
|
+
readonly code: string;
|
|
35
|
+
constructor(message: string, options?: ErrorOptions);
|
|
36
|
+
}
|
|
37
|
+
/** A symlink whose target escapes the workspace root or is absolute. */
|
|
38
|
+
export declare class SourceIdentityUnsafeSymlinkError extends SourceIdentityError {
|
|
39
|
+
readonly code = "FLOW_SOURCE_IDENTITY_UNSAFE_SYMLINK";
|
|
40
|
+
constructor(message: string, options?: ErrorOptions);
|
|
41
|
+
}
|
|
42
|
+
/** An entry that could not be read; measurement never silently skips state. */
|
|
43
|
+
export declare class SourceIdentityUnreadableError extends SourceIdentityError {
|
|
44
|
+
readonly code = "FLOW_SOURCE_IDENTITY_UNREADABLE";
|
|
45
|
+
constructor(message: string, options?: ErrorOptions);
|
|
46
|
+
}
|
|
47
|
+
/** The source exceeded the bounded file-count or byte budget. */
|
|
48
|
+
export declare class SourceIdentityOverflowError extends SourceIdentityError {
|
|
49
|
+
readonly code = "FLOW_SOURCE_IDENTITY_OVERFLOW";
|
|
50
|
+
constructor(message: string, options?: ErrorOptions);
|
|
51
|
+
}
|
|
52
|
+
/** The workspace changed while it was being measured. */
|
|
53
|
+
export declare class SourceIdentityRaceError extends SourceIdentityError {
|
|
54
|
+
readonly code = "FLOW_SOURCE_IDENTITY_RACE";
|
|
55
|
+
constructor(message: string, options?: ErrorOptions);
|
|
56
|
+
}
|
|
57
|
+
/** Git enumeration failed for a Git workspace. */
|
|
58
|
+
export declare class SourceIdentityGitError extends SourceIdentityError {
|
|
59
|
+
readonly code = "FLOW_SOURCE_IDENTITY_GIT";
|
|
60
|
+
constructor(message: string, options?: ErrorOptions);
|
|
61
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type CanonicalJsonValue = null | boolean | number | string | readonly CanonicalJsonValue[] | {
|
|
2
|
+
readonly [key: string]: CanonicalJsonValue;
|
|
3
|
+
};
|
|
4
|
+
/** Stable, whitespace-free JSON with recursively sorted object keys. */
|
|
5
|
+
export declare function canonicalizeReplayJson(value: CanonicalJsonValue): string;
|
|
6
|
+
export declare const canonicalizeJson: typeof canonicalizeReplayJson;
|
|
7
|
+
export declare const canonicalReplayJson: typeof canonicalizeReplayJson;
|