@osovv/vv-opencode 0.35.23 → 0.35.24
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 +11 -0
- package/README.md +19 -2
- package/dist/commands/patch-provider.d.ts +2 -2
- package/dist/commands/patch-provider.js +2 -2
- package/dist/commands/patch-provider.js.map +1 -1
- package/dist/plugins/workflow/index.js +52 -39
- package/dist/plugins/workflow/index.js.map +1 -1
- package/dist/plugins/workflow/persistence.js +61 -3
- package/dist/plugins/workflow/persistence.js.map +1 -1
- package/dist/plugins/workflow/state.d.ts +79 -29
- package/dist/plugins/workflow/state.js +299 -121
- package/dist/plugins/workflow/state.js.map +1 -1
- package/dist/plugins/workflow/system-instruction.md +4 -1
- package/dist/plugins/workflow/tooling.d.ts +4 -2
- package/dist/plugins/workflow/tooling.js +94 -34
- package/dist/plugins/workflow/tooling.js.map +1 -1
- package/dist/plugins/workflow/transitions.d.ts +10 -5
- package/dist/plugins/workflow/transitions.js +105 -63
- package/dist/plugins/workflow/transitions.js.map +1 -1
- package/package.json +1 -1
- package/schemas/vvoc/v3.json +1 -1
- package/templates/agents/vv-controller.md +3 -3
- package/templates/skills/vv-execute/SKILL.md +1 -1
- package/templates/skills/vv-plan/SKILL.md +1 -1
- package/templates/skills/vv-review/SKILL.md +2 -2
|
@@ -1,17 +1,51 @@
|
|
|
1
|
-
import type { TrackedAgentName } from "./protocol.js";
|
|
2
|
-
export
|
|
1
|
+
import type { ParsedResultBlock, TrackedAgentName } from "./protocol.js";
|
|
2
|
+
export declare const WORK_ITEM_MODES: readonly ["implementation", "review_only"];
|
|
3
|
+
export type WorkItemMode = (typeof WORK_ITEM_MODES)[number];
|
|
4
|
+
export declare const REVIEWER_ROLES: readonly ["spec", "code"];
|
|
5
|
+
export type ReviewerRole = (typeof REVIEWER_ROLES)[number];
|
|
6
|
+
export type ReviewerAgentName = "vv-spec-reviewer" | "vv-code-reviewer";
|
|
7
|
+
export type ReviewerResultStatus = "PASS" | "FAIL" | "NEEDS_CONTEXT";
|
|
8
|
+
export type ReviewRoundResult = {
|
|
9
|
+
reviewer: ReviewerRole;
|
|
10
|
+
agent: ReviewerAgentName;
|
|
11
|
+
status: ReviewerResultStatus;
|
|
12
|
+
completedAt: string;
|
|
13
|
+
};
|
|
14
|
+
export type ReviewRound = {
|
|
15
|
+
round: number;
|
|
16
|
+
requiredReviewers: ReviewerRole[];
|
|
17
|
+
pendingReviewers: ReviewerRole[];
|
|
18
|
+
inFlightReviewers: ReviewerRole[];
|
|
19
|
+
completedReviewers: ReviewerRole[];
|
|
20
|
+
results: Partial<Record<ReviewerRole, ReviewRoundResult>>;
|
|
21
|
+
status: "active" | "completed";
|
|
22
|
+
createdAt: string;
|
|
23
|
+
completedAt?: string;
|
|
24
|
+
};
|
|
25
|
+
export type WorkItemState = "open" | "awaiting_implementer" | "awaiting_reviews" | "needs_context" | "blocked" | "ready_to_close" | "closed";
|
|
3
26
|
export type WorkItemRecord = {
|
|
4
27
|
sessionId: string;
|
|
5
28
|
workItemId: string;
|
|
6
29
|
key: string;
|
|
7
30
|
title: string;
|
|
31
|
+
mode: WorkItemMode;
|
|
32
|
+
requiredReviewers: ReviewerRole[];
|
|
8
33
|
state: WorkItemState;
|
|
34
|
+
currentRound?: ReviewRound;
|
|
35
|
+
completedReviewRoundCount: number;
|
|
9
36
|
specReviewCount: number;
|
|
10
37
|
codeReviewCount: number;
|
|
11
38
|
createdAt: string;
|
|
12
39
|
updatedAt: string;
|
|
13
40
|
closedAt?: string;
|
|
14
41
|
};
|
|
42
|
+
export type OpenWorkItemInput = {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
key: string;
|
|
45
|
+
title: string;
|
|
46
|
+
mode: WorkItemMode;
|
|
47
|
+
requiredReviewers: ReviewerRole[];
|
|
48
|
+
};
|
|
15
49
|
export type OpenWorkItemResult = {
|
|
16
50
|
ok: true;
|
|
17
51
|
reused: boolean;
|
|
@@ -19,9 +53,9 @@ export type OpenWorkItemResult = {
|
|
|
19
53
|
header: string;
|
|
20
54
|
} | {
|
|
21
55
|
ok: false;
|
|
22
|
-
errorCode: "WORK_ITEM_KEY_CONFLICT";
|
|
56
|
+
errorCode: "INVALID_INPUT" | "WORK_ITEM_KEY_CONFLICT";
|
|
23
57
|
message: string;
|
|
24
|
-
existingWorkItemId
|
|
58
|
+
existingWorkItemId?: string;
|
|
25
59
|
};
|
|
26
60
|
export type CloseWorkItemResult = {
|
|
27
61
|
ok: true;
|
|
@@ -29,15 +63,31 @@ export type CloseWorkItemResult = {
|
|
|
29
63
|
header: string;
|
|
30
64
|
} | {
|
|
31
65
|
ok: false;
|
|
32
|
-
errorCode: "WORK_ITEM_NOT_FOUND" | "WORK_ITEM_ALREADY_CLOSED";
|
|
66
|
+
errorCode: "WORK_ITEM_NOT_FOUND" | "WORK_ITEM_ALREADY_CLOSED" | "READY_TO_CLOSE_REQUIRED";
|
|
67
|
+
message: string;
|
|
68
|
+
};
|
|
69
|
+
export type LaunchWorkItemErrorCode = "WORK_ITEM_NOT_FOUND" | "WORK_ITEM_ALREADY_CLOSED" | "INVALID_NEXT_AGENT" | "REVIEW_ROUND_NOT_ACTIVE" | "REVIEWER_NOT_REQUIRED" | "REVIEWER_ALREADY_IN_FLIGHT" | "REVIEWER_ALREADY_COMPLETED" | "REVIEW_ROUND_NEEDS_CONTEXT";
|
|
70
|
+
export type BeginTrackedLaunchResult = {
|
|
71
|
+
ok: true;
|
|
72
|
+
record: WorkItemRecord;
|
|
73
|
+
reviewer?: ReviewerRole;
|
|
74
|
+
reviewRound: number;
|
|
75
|
+
} | {
|
|
76
|
+
ok: false;
|
|
77
|
+
errorCode: LaunchWorkItemErrorCode;
|
|
33
78
|
message: string;
|
|
79
|
+
allowedAgents: TrackedAgentName[];
|
|
34
80
|
};
|
|
35
|
-
export type
|
|
81
|
+
export type TrackedResultStateErrorCode = "WORK_ITEM_NOT_FOUND" | "WORK_ITEM_ALREADY_CLOSED" | "INVALID_RESULT_AGENT" | "REVIEW_ROUND_NOT_ACTIVE" | "REVIEWER_NOT_REQUIRED" | "REVIEWER_NOT_IN_FLIGHT" | "REVIEWER_ALREADY_COMPLETED";
|
|
82
|
+
export type ApplyTrackedResultResult = {
|
|
36
83
|
ok: true;
|
|
37
84
|
record: WorkItemRecord;
|
|
85
|
+
fromState: WorkItemState;
|
|
86
|
+
toState: WorkItemState;
|
|
87
|
+
aggregateComplete: boolean;
|
|
38
88
|
} | {
|
|
39
89
|
ok: false;
|
|
40
|
-
errorCode:
|
|
90
|
+
errorCode: TrackedResultStateErrorCode;
|
|
41
91
|
message: string;
|
|
42
92
|
};
|
|
43
93
|
export type WorkItemStoreData = {
|
|
@@ -46,41 +96,41 @@ export type WorkItemStoreData = {
|
|
|
46
96
|
keyIndexBySession: Map<string, Map<string, string>>;
|
|
47
97
|
};
|
|
48
98
|
export type WorkItemStore = {
|
|
49
|
-
openWorkItem: (input:
|
|
99
|
+
openWorkItem: (input: OpenWorkItemInput) => OpenWorkItemResult;
|
|
100
|
+
beginTrackedLaunch: (input: {
|
|
50
101
|
sessionId: string;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}) =>
|
|
102
|
+
workItemId: string;
|
|
103
|
+
agent: TrackedAgentName;
|
|
104
|
+
}) => BeginTrackedLaunchResult;
|
|
105
|
+
applyTrackedResult: (input: {
|
|
106
|
+
sessionId: string;
|
|
107
|
+
workItemId: string;
|
|
108
|
+
result: ParsedResultBlock;
|
|
109
|
+
}) => ApplyTrackedResultResult;
|
|
54
110
|
getWorkItem: (sessionId: string, workItemId: string) => WorkItemRecord | undefined;
|
|
55
111
|
listWorkItems: (sessionId: string, options?: {
|
|
56
112
|
includeClosed?: boolean;
|
|
57
113
|
}) => WorkItemRecord[];
|
|
58
114
|
closeWorkItem: (sessionId: string, workItemId: string) => CloseWorkItemResult;
|
|
59
|
-
|
|
60
|
-
sessionId: string;
|
|
61
|
-
workItemId: string;
|
|
62
|
-
state: WorkItemState;
|
|
63
|
-
actor?: TrackedAgentName;
|
|
64
|
-
}) => TransitionWorkItemStateResult;
|
|
65
|
-
getReviewRound: (record: Pick<WorkItemRecord, "specReviewCount" | "codeReviewCount">) => number;
|
|
115
|
+
getReviewRound: (record: Pick<WorkItemRecord, "completedReviewRoundCount" | "currentRound">) => number;
|
|
66
116
|
/** Expose internal store data for persistence snapshotting. */
|
|
67
117
|
getStoreData: () => WorkItemStoreData;
|
|
68
118
|
};
|
|
69
|
-
export declare function getReviewRound(record: Pick<WorkItemRecord, "
|
|
119
|
+
export declare function getReviewRound(record: Pick<WorkItemRecord, "completedReviewRoundCount" | "currentRound">): number;
|
|
70
120
|
export declare function createWorkItemStore(hydrateData?: WorkItemStoreData | null): WorkItemStore;
|
|
71
|
-
export declare function openWorkItem(store: WorkItemStore, input:
|
|
121
|
+
export declare function openWorkItem(store: WorkItemStore, input: OpenWorkItemInput): OpenWorkItemResult;
|
|
122
|
+
export declare function beginTrackedLaunch(store: WorkItemStore, input: {
|
|
72
123
|
sessionId: string;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}):
|
|
124
|
+
workItemId: string;
|
|
125
|
+
agent: TrackedAgentName;
|
|
126
|
+
}): BeginTrackedLaunchResult;
|
|
127
|
+
export declare function applyTrackedResult(store: WorkItemStore, input: {
|
|
128
|
+
sessionId: string;
|
|
129
|
+
workItemId: string;
|
|
130
|
+
result: ParsedResultBlock;
|
|
131
|
+
}): ApplyTrackedResultResult;
|
|
76
132
|
export declare function getWorkItem(store: WorkItemStore, sessionId: string, workItemId: string): WorkItemRecord | undefined;
|
|
77
133
|
export declare function listWorkItems(store: WorkItemStore, sessionId: string, options?: {
|
|
78
134
|
includeClosed?: boolean;
|
|
79
135
|
}): WorkItemRecord[];
|
|
80
136
|
export declare function closeWorkItem(store: WorkItemStore, sessionId: string, workItemId: string): CloseWorkItemResult;
|
|
81
|
-
export declare function transitionWorkItemState(store: WorkItemStore, input: {
|
|
82
|
-
sessionId: string;
|
|
83
|
-
workItemId: string;
|
|
84
|
-
state: WorkItemState;
|
|
85
|
-
actor?: TrackedAgentName;
|
|
86
|
-
}): TransitionWorkItemStateResult;
|