@aviaratech/ai-delivery 0.3.5 → 0.3.7
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/README.md +65 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/agent.js.map +1 -1
- package/dist/cli.js +35 -1
- package/dist/cli.js.map +1 -1
- package/dist/dispatch.js +21 -1
- package/dist/dispatch.js.map +1 -1
- package/dist/github/commandIdentityPolicy.js +1 -0
- package/dist/github/commandIdentityPolicy.js.map +1 -1
- package/dist/issue.d.ts +1 -0
- package/dist/issue.js +22 -10
- package/dist/issue.js.map +1 -1
- package/dist/lifecycle.test.js +470 -4
- package/dist/lifecycle.test.js.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/tools.d.ts +31 -0
- package/dist/mcp/tools.js +27 -0
- package/dist/mcp/tools.js.map +1 -1
- package/dist/pr.d.ts +1 -1
- package/dist/services/worktreeRegistry.d.ts +12 -0
- package/dist/services/worktreeRegistry.js +146 -4
- package/dist/services/worktreeRegistry.js.map +1 -1
- package/dist/verification.d.ts +34 -0
- package/dist/verification.js +488 -64
- package/dist/verification.js.map +1 -1
- package/dist/worktree.d.ts +3 -0
- package/dist/worktree.js +38 -8
- package/dist/worktree.js.map +1 -1
- package/dist/worktreeTransition.d.ts +173 -0
- package/dist/worktreeTransition.js +1012 -0
- package/dist/worktreeTransition.js.map +1 -0
- package/dist/worktreeTransition.test.d.ts +1 -0
- package/dist/worktreeTransition.test.js +1179 -0
- package/dist/worktreeTransition.test.js.map +1 -0
- package/package.json +1 -1
- package/plugins/ai-delivery/.claude-plugin/plugin.json +1 -1
- package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +6 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { DeliveryContext } from './issue.js';
|
|
3
|
+
import type { WorktreeEntry } from './services/worktreeRegistry.js';
|
|
4
|
+
export interface TransitionEvidenceFile {
|
|
5
|
+
path: string;
|
|
6
|
+
source: string;
|
|
7
|
+
digest: string;
|
|
8
|
+
size: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const WorktreeTransitionPlanSchema: z.ZodObject<{
|
|
11
|
+
schemaVersion: z.ZodLiteral<"ai-delivery.worktree-transition-plan@1">;
|
|
12
|
+
planId: z.ZodString;
|
|
13
|
+
repository: z.ZodString;
|
|
14
|
+
repoRoot: z.ZodString;
|
|
15
|
+
row: z.ZodObject<{
|
|
16
|
+
branch: z.ZodString;
|
|
17
|
+
createdAt: z.ZodString;
|
|
18
|
+
identity: z.ZodString;
|
|
19
|
+
issueNumber: z.ZodNumber;
|
|
20
|
+
path: z.ZodString;
|
|
21
|
+
prNumber: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
status: z.ZodEnum<{
|
|
23
|
+
error: "error";
|
|
24
|
+
active: "active";
|
|
25
|
+
stale: "stale";
|
|
26
|
+
merged: "merged";
|
|
27
|
+
"pr-published": "pr-published";
|
|
28
|
+
}>;
|
|
29
|
+
type: z.ZodLiteral<"issue">;
|
|
30
|
+
updatedAt: z.ZodString;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
purpose: z.ZodEnum<{
|
|
33
|
+
"active-resume": "active-resume";
|
|
34
|
+
"merged-cleanup": "merged-cleanup";
|
|
35
|
+
}>;
|
|
36
|
+
disposition: z.ZodEnum<{
|
|
37
|
+
remove: "remove";
|
|
38
|
+
retain: "retain";
|
|
39
|
+
}>;
|
|
40
|
+
head: z.ZodObject<{
|
|
41
|
+
sha: z.ZodString;
|
|
42
|
+
tree: z.ZodString;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
terminalPrNumber: z.ZodNullable<z.ZodNumber>;
|
|
45
|
+
lineage: z.ZodArray<z.ZodObject<{
|
|
46
|
+
prNumber: z.ZodNumber;
|
|
47
|
+
headSha: z.ZodString;
|
|
48
|
+
headBranch: z.ZodString;
|
|
49
|
+
baseSha: z.ZodString;
|
|
50
|
+
baseBranch: z.ZodString;
|
|
51
|
+
mergeSha: z.ZodNullable<z.ZodString>;
|
|
52
|
+
merged: z.ZodBoolean;
|
|
53
|
+
authorLogin: z.ZodString;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
retainedHoldCommentIds: z.ZodArray<z.ZodNumber>;
|
|
56
|
+
remoteRefs: z.ZodNullable<z.ZodObject<{
|
|
57
|
+
headSha: z.ZodNullable<z.ZodString>;
|
|
58
|
+
baseSha: z.ZodString;
|
|
59
|
+
}, z.core.$strict>>;
|
|
60
|
+
holdEvidence: z.ZodArray<z.ZodObject<{
|
|
61
|
+
commentId: z.ZodNumber;
|
|
62
|
+
digest: z.ZodString;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
inventory: z.ZodArray<z.ZodObject<{
|
|
65
|
+
path: z.ZodString;
|
|
66
|
+
source: z.ZodString;
|
|
67
|
+
digest: z.ZodString;
|
|
68
|
+
size: z.ZodNumber;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
inventoryId: z.ZodString;
|
|
71
|
+
historicalProducer: z.ZodLiteral<"UNKNOWN">;
|
|
72
|
+
closure: z.ZodObject<{
|
|
73
|
+
family: z.ZodLiteral<"public-ai-delivery-0.3.5-posix@1">;
|
|
74
|
+
admissionPath: z.ZodString;
|
|
75
|
+
archivePath: z.ZodString;
|
|
76
|
+
admission: z.ZodObject<{
|
|
77
|
+
admissionId: z.ZodString;
|
|
78
|
+
capability: z.ZodObject<{
|
|
79
|
+
cli: z.ZodNumber;
|
|
80
|
+
mcp: z.ZodNumber;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
cliPath: z.ZodString;
|
|
83
|
+
cliSha256: z.ZodString;
|
|
84
|
+
configDigest: z.ZodString;
|
|
85
|
+
mcpLauncherPath: z.ZodString;
|
|
86
|
+
mcpLauncherSha256: z.ZodString;
|
|
87
|
+
packageDistSha256: z.ZodString;
|
|
88
|
+
packageManifestSha256: z.ZodString;
|
|
89
|
+
packageVersion: z.ZodString;
|
|
90
|
+
pluginManifestPath: z.ZodString;
|
|
91
|
+
pluginManifestSha256: z.ZodString;
|
|
92
|
+
repository: z.ZodString;
|
|
93
|
+
schemaVersion: z.ZodLiteral<"ai-delivery.runtime-admission@2">;
|
|
94
|
+
sourceArchiveSha256: z.ZodString;
|
|
95
|
+
sourceCommit: z.ZodString;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
admissionBytesDigest: z.ZodString;
|
|
98
|
+
producerDigest: z.ZodString;
|
|
99
|
+
runManifestIds: z.ZodArray<z.ZodString>;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
currentRuntime: z.ZodObject<{
|
|
102
|
+
admissionId: z.ZodString;
|
|
103
|
+
capability: z.ZodObject<{
|
|
104
|
+
cli: z.ZodNumber;
|
|
105
|
+
mcp: z.ZodNumber;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
cliPath: z.ZodString;
|
|
108
|
+
cliSha256: z.ZodString;
|
|
109
|
+
configDigest: z.ZodString;
|
|
110
|
+
mcpLauncherPath: z.ZodString;
|
|
111
|
+
mcpLauncherSha256: z.ZodString;
|
|
112
|
+
packageDistSha256: z.ZodString;
|
|
113
|
+
packageManifestSha256: z.ZodString;
|
|
114
|
+
packageVersion: z.ZodString;
|
|
115
|
+
pluginManifestPath: z.ZodString;
|
|
116
|
+
pluginManifestSha256: z.ZodString;
|
|
117
|
+
repository: z.ZodString;
|
|
118
|
+
schemaVersion: z.ZodLiteral<"ai-delivery.runtime-admission@2">;
|
|
119
|
+
sourceArchiveSha256: z.ZodString;
|
|
120
|
+
sourceCommit: z.ZodString;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
policyDigest: z.ZodString;
|
|
123
|
+
operator: z.ZodObject<{
|
|
124
|
+
actorLogin: z.ZodString;
|
|
125
|
+
credentialIdentity: z.ZodString;
|
|
126
|
+
}, z.core.$strict>;
|
|
127
|
+
reviewerActor: z.ZodString;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
export type WorktreeTransitionPlan = z.infer<typeof WorktreeTransitionPlanSchema>;
|
|
130
|
+
export interface InspectWorktreeTransitionInput {
|
|
131
|
+
issueNumber: number;
|
|
132
|
+
purpose: 'active-resume' | 'merged-cleanup';
|
|
133
|
+
disposition?: 'retain' | 'remove';
|
|
134
|
+
terminalPrNumber?: number;
|
|
135
|
+
retainedHoldCommentIds?: number[];
|
|
136
|
+
retainedAdmissionPath?: string;
|
|
137
|
+
retainedArchivePath?: string;
|
|
138
|
+
runtimeEntryPath?: string;
|
|
139
|
+
}
|
|
140
|
+
/** Read-only, deterministic inventory. Unknown historical schemas remain opaque bytes. */
|
|
141
|
+
export declare function inventoryTransitionEvidence(root: string, row: WorktreeEntry, removed?: boolean): TransitionEvidenceFile[];
|
|
142
|
+
export declare function applyWorktreeTransition(context: DeliveryContext, input: {
|
|
143
|
+
authority: 'worktree:transition';
|
|
144
|
+
planPath: string;
|
|
145
|
+
expectedPlanId: string;
|
|
146
|
+
relinquishmentCommentId: number;
|
|
147
|
+
acceptanceCommentId: number;
|
|
148
|
+
runtimeEntryPath?: string;
|
|
149
|
+
}): Promise<{
|
|
150
|
+
planId: string;
|
|
151
|
+
result: 'active-resumed' | 'retained' | 'removed';
|
|
152
|
+
replayed: boolean;
|
|
153
|
+
receiptPath: string;
|
|
154
|
+
}>;
|
|
155
|
+
export declare function worktreeRelinquishmentBody(plan: WorktreeTransitionPlan): string;
|
|
156
|
+
export declare function worktreeAcceptanceBody(plan: WorktreeTransitionPlan, relinquishmentCommentId: number): string;
|
|
157
|
+
/** Whole native bodies and the configured live actors are authority; local digests alone are not. */
|
|
158
|
+
export declare function assertWorktreeTransitionNativeAuthority(context: DeliveryContext, plan: WorktreeTransitionPlan, ids: {
|
|
159
|
+
relinquishmentCommentId: number;
|
|
160
|
+
acceptanceCommentId: number;
|
|
161
|
+
}): Promise<{
|
|
162
|
+
relinquishment: unknown;
|
|
163
|
+
acceptance: unknown;
|
|
164
|
+
}>;
|
|
165
|
+
export declare function inspectWorktreeTransition(context: DeliveryContext, input: InspectWorktreeTransitionInput): Promise<{
|
|
166
|
+
ready: boolean;
|
|
167
|
+
blockers: string[];
|
|
168
|
+
plan: WorktreeTransitionPlan | null;
|
|
169
|
+
inventory: TransitionEvidenceFile[];
|
|
170
|
+
relinquishmentBody?: string;
|
|
171
|
+
}>;
|
|
172
|
+
/** Original copies are immutable and content addressed; every source is checked again before capture. */
|
|
173
|
+
export declare function preserveTransitionEvidence(directory: string, inventory: readonly TransitionEvidenceFile[]): void;
|