@pugi/sdk 0.1.0-alpha.10
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/LICENSE +21 -0
- package/README.md +29 -0
- package/dist/agent-contracts.d.ts +311 -0
- package/dist/agent-contracts.js +67 -0
- package/dist/audit-trace.d.ts +1161 -0
- package/dist/audit-trace.js +185 -0
- package/dist/device-flow.d.ts +98 -0
- package/dist/device-flow.js +55 -0
- package/dist/engine-adapter.d.ts +376 -0
- package/dist/engine-adapter.js +47 -0
- package/dist/engine-loop.d.ts +457 -0
- package/dist/engine-loop.js +342 -0
- package/dist/handoff.d.ts +605 -0
- package/dist/handoff.js +76 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/mcp-schemas.d.ts +27 -0
- package/dist/mcp-schemas.js +11 -0
- package/dist/permission-rules.d.ts +65 -0
- package/dist/permission-rules.js +35 -0
- package/dist/subagent-contracts.d.ts +549 -0
- package/dist/subagent-contracts.js +230 -0
- package/dist/transport.d.ts +559 -0
- package/dist/transport.js +482 -0
- package/package.json +47 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type PugiSyncRequest, type PugiSyncResponse } from './handoff.js';
|
|
3
|
+
import { type PugiDevicePollResponse, type PugiDeviceStartResponse } from './device-flow.js';
|
|
4
|
+
export declare const anvilCapabilitySchema: z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
enabled: z.ZodBoolean;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
name: string;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
version: string;
|
|
12
|
+
}, {
|
|
13
|
+
name: string;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
version: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type AnvilCapability = z.infer<typeof anvilCapabilitySchema>;
|
|
18
|
+
export declare const anvilCapabilitiesResponseSchema: z.ZodObject<{
|
|
19
|
+
endpoint: z.ZodString;
|
|
20
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
version: z.ZodString;
|
|
23
|
+
enabled: z.ZodBoolean;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
name: string;
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
version: string;
|
|
28
|
+
}, {
|
|
29
|
+
name: string;
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
version: string;
|
|
32
|
+
}>, "many">;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
endpoint: string;
|
|
35
|
+
capabilities: {
|
|
36
|
+
name: string;
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
version: string;
|
|
39
|
+
}[];
|
|
40
|
+
}, {
|
|
41
|
+
endpoint: string;
|
|
42
|
+
capabilities: {
|
|
43
|
+
name: string;
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
version: string;
|
|
46
|
+
}[];
|
|
47
|
+
}>;
|
|
48
|
+
export type AnvilCapabilitiesResponse = z.infer<typeof anvilCapabilitiesResponseSchema>;
|
|
49
|
+
/**
|
|
50
|
+
* Pugi runtime client config.
|
|
51
|
+
*
|
|
52
|
+
* Defaults: PUGI_API_URL=https://api.pugi.io, PUGI_API_KEY required for remote.
|
|
53
|
+
* Self-hosted override: PUGI_API_URL=https://anvil.acme.corp.
|
|
54
|
+
*/
|
|
55
|
+
export declare const pugiRuntimeConfigSchema: z.ZodObject<{
|
|
56
|
+
apiUrl: z.ZodString;
|
|
57
|
+
apiKey: z.ZodString;
|
|
58
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
apiUrl: string;
|
|
61
|
+
apiKey: string;
|
|
62
|
+
timeoutMs: number;
|
|
63
|
+
}, {
|
|
64
|
+
apiUrl: string;
|
|
65
|
+
apiKey: string;
|
|
66
|
+
timeoutMs?: number | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
export type PugiRuntimeConfig = z.infer<typeof pugiRuntimeConfigSchema>;
|
|
69
|
+
/**
|
|
70
|
+
* Build a `PugiRuntimeConfig` from a known apiKey + apiUrl (e.g. resolved
|
|
71
|
+
* from a credentials store) plus the env for timeout override. Pure —
|
|
72
|
+
* does not touch the filesystem. The CLI's credential store layer is
|
|
73
|
+
* what reads disk / env first; this function exists so callers can
|
|
74
|
+
* provide credentials from any source (env, keychain, OAuth refresh)
|
|
75
|
+
* and still receive a validated config.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildRuntimeConfig(input: {
|
|
78
|
+
apiUrl: string;
|
|
79
|
+
apiKey: string;
|
|
80
|
+
env?: NodeJS.ProcessEnv;
|
|
81
|
+
}): PugiRuntimeConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Convenience: env-only resolution. Returns `null` when `PUGI_API_KEY`
|
|
84
|
+
* is unset. Used by CI flows that authenticate purely via environment
|
|
85
|
+
* variables.
|
|
86
|
+
*/
|
|
87
|
+
export declare function loadRuntimeConfig(env?: NodeJS.ProcessEnv): PugiRuntimeConfig | null;
|
|
88
|
+
/**
|
|
89
|
+
* Triple-review rubric (verbatim from /triple-review skill + OES MCP triple_review tool):
|
|
90
|
+
* any P0 -> BLOCK
|
|
91
|
+
* P1 from >= 2 reviewers -> BLOCK
|
|
92
|
+
* P1 from 1 reviewer -> WARN
|
|
93
|
+
* no P0/P1 -> PASS
|
|
94
|
+
* all reviewers errored -> BLOCK
|
|
95
|
+
*/
|
|
96
|
+
export declare const tripleReviewSeveritySchema: z.ZodEnum<["P0", "P1", "P2", "P3"]>;
|
|
97
|
+
export type TripleReviewSeverity = z.infer<typeof tripleReviewSeveritySchema>;
|
|
98
|
+
export declare const tripleReviewVerdictSchema: z.ZodEnum<["PASS", "WARN", "BLOCK"]>;
|
|
99
|
+
export type TripleReviewVerdict = z.infer<typeof tripleReviewVerdictSchema>;
|
|
100
|
+
export declare const pugiTripleReviewFindingSchema: z.ZodObject<{
|
|
101
|
+
reviewer: z.ZodString;
|
|
102
|
+
severity: z.ZodEnum<["P0", "P1", "P2", "P3"]>;
|
|
103
|
+
line: z.ZodNullable<z.ZodNumber>;
|
|
104
|
+
path: z.ZodOptional<z.ZodString>;
|
|
105
|
+
issue: z.ZodString;
|
|
106
|
+
fix: z.ZodString;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
fix: string;
|
|
109
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
110
|
+
line: number | null;
|
|
111
|
+
reviewer: string;
|
|
112
|
+
issue: string;
|
|
113
|
+
path?: string | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
fix: string;
|
|
116
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
117
|
+
line: number | null;
|
|
118
|
+
reviewer: string;
|
|
119
|
+
issue: string;
|
|
120
|
+
path?: string | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export type PugiTripleReviewFinding = z.infer<typeof pugiTripleReviewFindingSchema>;
|
|
123
|
+
export declare const pugiTripleReviewReviewerSchema: z.ZodObject<{
|
|
124
|
+
model: z.ZodString;
|
|
125
|
+
latencyMs: z.ZodNumber;
|
|
126
|
+
tokensUsed: z.ZodNullable<z.ZodNumber>;
|
|
127
|
+
rawContent: z.ZodString;
|
|
128
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
129
|
+
severity: z.ZodEnum<["P0", "P1", "P2", "P3"]>;
|
|
130
|
+
line: z.ZodNullable<z.ZodNumber>;
|
|
131
|
+
issue: z.ZodString;
|
|
132
|
+
fix: z.ZodString;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
fix: string;
|
|
135
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
136
|
+
line: number | null;
|
|
137
|
+
issue: string;
|
|
138
|
+
}, {
|
|
139
|
+
fix: string;
|
|
140
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
141
|
+
line: number | null;
|
|
142
|
+
issue: string;
|
|
143
|
+
}>, "many">;
|
|
144
|
+
declaredVerdict: z.ZodNullable<z.ZodEnum<["PASS", "WARN", "BLOCK"]>>;
|
|
145
|
+
error: z.ZodNullable<z.ZodString>;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
model: string;
|
|
148
|
+
tokensUsed: number | null;
|
|
149
|
+
error: string | null;
|
|
150
|
+
findings: {
|
|
151
|
+
fix: string;
|
|
152
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
153
|
+
line: number | null;
|
|
154
|
+
issue: string;
|
|
155
|
+
}[];
|
|
156
|
+
latencyMs: number;
|
|
157
|
+
rawContent: string;
|
|
158
|
+
declaredVerdict: "PASS" | "WARN" | "BLOCK" | null;
|
|
159
|
+
}, {
|
|
160
|
+
model: string;
|
|
161
|
+
tokensUsed: number | null;
|
|
162
|
+
error: string | null;
|
|
163
|
+
findings: {
|
|
164
|
+
fix: string;
|
|
165
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
166
|
+
line: number | null;
|
|
167
|
+
issue: string;
|
|
168
|
+
}[];
|
|
169
|
+
latencyMs: number;
|
|
170
|
+
rawContent: string;
|
|
171
|
+
declaredVerdict: "PASS" | "WARN" | "BLOCK" | null;
|
|
172
|
+
}>;
|
|
173
|
+
export type PugiTripleReviewReviewer = z.infer<typeof pugiTripleReviewReviewerSchema>;
|
|
174
|
+
export declare const pugiTripleReviewRequestSchema: z.ZodObject<{
|
|
175
|
+
schema: z.ZodLiteral<1>;
|
|
176
|
+
workspace: z.ZodObject<{
|
|
177
|
+
rootName: z.ZodString;
|
|
178
|
+
gitBranch: z.ZodNullable<z.ZodString>;
|
|
179
|
+
gitHead: z.ZodNullable<z.ZodString>;
|
|
180
|
+
baseRef: z.ZodNullable<z.ZodString>;
|
|
181
|
+
dirty: z.ZodBoolean;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
dirty: boolean;
|
|
184
|
+
rootName: string;
|
|
185
|
+
gitBranch: string | null;
|
|
186
|
+
gitHead: string | null;
|
|
187
|
+
baseRef: string | null;
|
|
188
|
+
}, {
|
|
189
|
+
dirty: boolean;
|
|
190
|
+
rootName: string;
|
|
191
|
+
gitBranch: string | null;
|
|
192
|
+
gitHead: string | null;
|
|
193
|
+
baseRef: string | null;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Branch diff vs baseRef (e.g. `origin/main`). Truncated to a server-side
|
|
197
|
+
* cap on the receiver. We do NOT send raw file contents outside of
|
|
198
|
+
* `--privacy selected-files` or `--privacy full-sync` modes; the diff
|
|
199
|
+
* itself is the evidence the reviewers inspect.
|
|
200
|
+
*/
|
|
201
|
+
diffPatch: z.ZodString;
|
|
202
|
+
diffStats: z.ZodObject<{
|
|
203
|
+
filesChanged: z.ZodNumber;
|
|
204
|
+
insertions: z.ZodNumber;
|
|
205
|
+
deletions: z.ZodNumber;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
filesChanged: number;
|
|
208
|
+
insertions: number;
|
|
209
|
+
deletions: number;
|
|
210
|
+
}, {
|
|
211
|
+
filesChanged: number;
|
|
212
|
+
insertions: number;
|
|
213
|
+
deletions: number;
|
|
214
|
+
}>;
|
|
215
|
+
/**
|
|
216
|
+
* Optional prompt (`pugi review --triple "<prompt>"`). When absent the
|
|
217
|
+
* reviewers infer scope from the diff alone.
|
|
218
|
+
*/
|
|
219
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
220
|
+
locale: z.ZodDefault<z.ZodString>;
|
|
221
|
+
/**
|
|
222
|
+
* Reviewer persona slug on the server side. Default 'oes-dev' (Sigma)
|
|
223
|
+
* is the tier-2 reviewer today and bumps to tier-3 transparently when
|
|
224
|
+
* the operator configures ANVIL_TIER1_MODELS with 3+ models.
|
|
225
|
+
*/
|
|
226
|
+
reviewerPersona: z.ZodDefault<z.ZodString>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
schema: 1;
|
|
229
|
+
workspace: {
|
|
230
|
+
dirty: boolean;
|
|
231
|
+
rootName: string;
|
|
232
|
+
gitBranch: string | null;
|
|
233
|
+
gitHead: string | null;
|
|
234
|
+
baseRef: string | null;
|
|
235
|
+
};
|
|
236
|
+
diffPatch: string;
|
|
237
|
+
diffStats: {
|
|
238
|
+
filesChanged: number;
|
|
239
|
+
insertions: number;
|
|
240
|
+
deletions: number;
|
|
241
|
+
};
|
|
242
|
+
locale: string;
|
|
243
|
+
reviewerPersona: string;
|
|
244
|
+
prompt?: string | undefined;
|
|
245
|
+
}, {
|
|
246
|
+
schema: 1;
|
|
247
|
+
workspace: {
|
|
248
|
+
dirty: boolean;
|
|
249
|
+
rootName: string;
|
|
250
|
+
gitBranch: string | null;
|
|
251
|
+
gitHead: string | null;
|
|
252
|
+
baseRef: string | null;
|
|
253
|
+
};
|
|
254
|
+
diffPatch: string;
|
|
255
|
+
diffStats: {
|
|
256
|
+
filesChanged: number;
|
|
257
|
+
insertions: number;
|
|
258
|
+
deletions: number;
|
|
259
|
+
};
|
|
260
|
+
prompt?: string | undefined;
|
|
261
|
+
locale?: string | undefined;
|
|
262
|
+
reviewerPersona?: string | undefined;
|
|
263
|
+
}>;
|
|
264
|
+
export type PugiTripleReviewRequest = z.infer<typeof pugiTripleReviewRequestSchema>;
|
|
265
|
+
export declare const pugiTripleReviewResponseSchema: z.ZodObject<{
|
|
266
|
+
schema: z.ZodLiteral<1>;
|
|
267
|
+
verdict: z.ZodEnum<["PASS", "WARN", "BLOCK"]>;
|
|
268
|
+
reason: z.ZodString;
|
|
269
|
+
reviewerCount: z.ZodNumber;
|
|
270
|
+
effectiveTier: z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
271
|
+
draft: z.ZodBoolean;
|
|
272
|
+
reviewers: z.ZodArray<z.ZodObject<{
|
|
273
|
+
model: z.ZodString;
|
|
274
|
+
latencyMs: z.ZodNumber;
|
|
275
|
+
tokensUsed: z.ZodNullable<z.ZodNumber>;
|
|
276
|
+
rawContent: z.ZodString;
|
|
277
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
278
|
+
severity: z.ZodEnum<["P0", "P1", "P2", "P3"]>;
|
|
279
|
+
line: z.ZodNullable<z.ZodNumber>;
|
|
280
|
+
issue: z.ZodString;
|
|
281
|
+
fix: z.ZodString;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
fix: string;
|
|
284
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
285
|
+
line: number | null;
|
|
286
|
+
issue: string;
|
|
287
|
+
}, {
|
|
288
|
+
fix: string;
|
|
289
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
290
|
+
line: number | null;
|
|
291
|
+
issue: string;
|
|
292
|
+
}>, "many">;
|
|
293
|
+
declaredVerdict: z.ZodNullable<z.ZodEnum<["PASS", "WARN", "BLOCK"]>>;
|
|
294
|
+
error: z.ZodNullable<z.ZodString>;
|
|
295
|
+
}, "strip", z.ZodTypeAny, {
|
|
296
|
+
model: string;
|
|
297
|
+
tokensUsed: number | null;
|
|
298
|
+
error: string | null;
|
|
299
|
+
findings: {
|
|
300
|
+
fix: string;
|
|
301
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
302
|
+
line: number | null;
|
|
303
|
+
issue: string;
|
|
304
|
+
}[];
|
|
305
|
+
latencyMs: number;
|
|
306
|
+
rawContent: string;
|
|
307
|
+
declaredVerdict: "PASS" | "WARN" | "BLOCK" | null;
|
|
308
|
+
}, {
|
|
309
|
+
model: string;
|
|
310
|
+
tokensUsed: number | null;
|
|
311
|
+
error: string | null;
|
|
312
|
+
findings: {
|
|
313
|
+
fix: string;
|
|
314
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
315
|
+
line: number | null;
|
|
316
|
+
issue: string;
|
|
317
|
+
}[];
|
|
318
|
+
latencyMs: number;
|
|
319
|
+
rawContent: string;
|
|
320
|
+
declaredVerdict: "PASS" | "WARN" | "BLOCK" | null;
|
|
321
|
+
}>, "many">;
|
|
322
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
323
|
+
reviewer: z.ZodString;
|
|
324
|
+
severity: z.ZodEnum<["P0", "P1", "P2", "P3"]>;
|
|
325
|
+
line: z.ZodNullable<z.ZodNumber>;
|
|
326
|
+
path: z.ZodOptional<z.ZodString>;
|
|
327
|
+
issue: z.ZodString;
|
|
328
|
+
fix: z.ZodString;
|
|
329
|
+
}, "strip", z.ZodTypeAny, {
|
|
330
|
+
fix: string;
|
|
331
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
332
|
+
line: number | null;
|
|
333
|
+
reviewer: string;
|
|
334
|
+
issue: string;
|
|
335
|
+
path?: string | undefined;
|
|
336
|
+
}, {
|
|
337
|
+
fix: string;
|
|
338
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
339
|
+
line: number | null;
|
|
340
|
+
reviewer: string;
|
|
341
|
+
issue: string;
|
|
342
|
+
path?: string | undefined;
|
|
343
|
+
}>, "many">;
|
|
344
|
+
counts: z.ZodObject<{
|
|
345
|
+
P0: z.ZodNumber;
|
|
346
|
+
P1: z.ZodNumber;
|
|
347
|
+
P2: z.ZodNumber;
|
|
348
|
+
P3: z.ZodNumber;
|
|
349
|
+
}, "strip", z.ZodTypeAny, {
|
|
350
|
+
P0: number;
|
|
351
|
+
P1: number;
|
|
352
|
+
P2: number;
|
|
353
|
+
P3: number;
|
|
354
|
+
}, {
|
|
355
|
+
P0: number;
|
|
356
|
+
P1: number;
|
|
357
|
+
P2: number;
|
|
358
|
+
P3: number;
|
|
359
|
+
}>;
|
|
360
|
+
/**
|
|
361
|
+
* ISO-8601 timestamp when the server completed the review. Pugi
|
|
362
|
+
* persists this in the local artifact so audit replay knows when
|
|
363
|
+
* the runtime gate fired.
|
|
364
|
+
*/
|
|
365
|
+
completedAt: z.ZodString;
|
|
366
|
+
}, "strip", z.ZodTypeAny, {
|
|
367
|
+
reason: string;
|
|
368
|
+
findings: {
|
|
369
|
+
fix: string;
|
|
370
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
371
|
+
line: number | null;
|
|
372
|
+
reviewer: string;
|
|
373
|
+
issue: string;
|
|
374
|
+
path?: string | undefined;
|
|
375
|
+
}[];
|
|
376
|
+
schema: 1;
|
|
377
|
+
verdict: "PASS" | "WARN" | "BLOCK";
|
|
378
|
+
reviewerCount: number;
|
|
379
|
+
effectiveTier: 1 | 2 | 3;
|
|
380
|
+
draft: boolean;
|
|
381
|
+
reviewers: {
|
|
382
|
+
model: string;
|
|
383
|
+
tokensUsed: number | null;
|
|
384
|
+
error: string | null;
|
|
385
|
+
findings: {
|
|
386
|
+
fix: string;
|
|
387
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
388
|
+
line: number | null;
|
|
389
|
+
issue: string;
|
|
390
|
+
}[];
|
|
391
|
+
latencyMs: number;
|
|
392
|
+
rawContent: string;
|
|
393
|
+
declaredVerdict: "PASS" | "WARN" | "BLOCK" | null;
|
|
394
|
+
}[];
|
|
395
|
+
counts: {
|
|
396
|
+
P0: number;
|
|
397
|
+
P1: number;
|
|
398
|
+
P2: number;
|
|
399
|
+
P3: number;
|
|
400
|
+
};
|
|
401
|
+
completedAt: string;
|
|
402
|
+
}, {
|
|
403
|
+
reason: string;
|
|
404
|
+
findings: {
|
|
405
|
+
fix: string;
|
|
406
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
407
|
+
line: number | null;
|
|
408
|
+
reviewer: string;
|
|
409
|
+
issue: string;
|
|
410
|
+
path?: string | undefined;
|
|
411
|
+
}[];
|
|
412
|
+
schema: 1;
|
|
413
|
+
verdict: "PASS" | "WARN" | "BLOCK";
|
|
414
|
+
reviewerCount: number;
|
|
415
|
+
effectiveTier: 1 | 2 | 3;
|
|
416
|
+
draft: boolean;
|
|
417
|
+
reviewers: {
|
|
418
|
+
model: string;
|
|
419
|
+
tokensUsed: number | null;
|
|
420
|
+
error: string | null;
|
|
421
|
+
findings: {
|
|
422
|
+
fix: string;
|
|
423
|
+
severity: "P0" | "P1" | "P2" | "P3";
|
|
424
|
+
line: number | null;
|
|
425
|
+
issue: string;
|
|
426
|
+
}[];
|
|
427
|
+
latencyMs: number;
|
|
428
|
+
rawContent: string;
|
|
429
|
+
declaredVerdict: "PASS" | "WARN" | "BLOCK" | null;
|
|
430
|
+
}[];
|
|
431
|
+
counts: {
|
|
432
|
+
P0: number;
|
|
433
|
+
P1: number;
|
|
434
|
+
P2: number;
|
|
435
|
+
P3: number;
|
|
436
|
+
};
|
|
437
|
+
completedAt: string;
|
|
438
|
+
}>;
|
|
439
|
+
export type PugiTripleReviewResponse = z.infer<typeof pugiTripleReviewResponseSchema>;
|
|
440
|
+
export type SubmitTripleReviewResult = {
|
|
441
|
+
status: 'ok';
|
|
442
|
+
response: PugiTripleReviewResponse;
|
|
443
|
+
} | {
|
|
444
|
+
status: 'endpoint_missing';
|
|
445
|
+
code: number;
|
|
446
|
+
message: string;
|
|
447
|
+
} | {
|
|
448
|
+
status: 'unauthenticated';
|
|
449
|
+
code: number;
|
|
450
|
+
message: string;
|
|
451
|
+
} | {
|
|
452
|
+
status: 'rate_limited';
|
|
453
|
+
code: number;
|
|
454
|
+
retryAfterMs: number;
|
|
455
|
+
message: string;
|
|
456
|
+
} | {
|
|
457
|
+
status: 'failed';
|
|
458
|
+
code: number;
|
|
459
|
+
message: string;
|
|
460
|
+
};
|
|
461
|
+
/**
|
|
462
|
+
* Submit a triple-review request to the Pugi runtime endpoint.
|
|
463
|
+
*
|
|
464
|
+
* Endpoint contract (admin-api side, ships in a separate PR):
|
|
465
|
+
* POST {apiUrl}/api/pugi/triple-review
|
|
466
|
+
* Authorization: Bearer {apiKey}
|
|
467
|
+
* Content-Type: application/json
|
|
468
|
+
* Body: PugiTripleReviewRequest
|
|
469
|
+
* 200: PugiTripleReviewResponse
|
|
470
|
+
* 401/403: unauthenticated
|
|
471
|
+
* 404: endpoint not yet deployed (graceful local-only fallback)
|
|
472
|
+
* 429: rate limited (per-tenant)
|
|
473
|
+
* 5xx: failed
|
|
474
|
+
*
|
|
475
|
+
* Local-first contract: this function never reads the local file system,
|
|
476
|
+
* never logs the diff payload, and never retries on transient errors —
|
|
477
|
+
* the caller decides whether a retry makes sense.
|
|
478
|
+
*/
|
|
479
|
+
export declare function submitTripleReview(config: PugiRuntimeConfig, request: PugiTripleReviewRequest): Promise<SubmitTripleReviewResult>;
|
|
480
|
+
export type SubmitSyncResult = {
|
|
481
|
+
status: 'ok';
|
|
482
|
+
response: PugiSyncResponse;
|
|
483
|
+
} | {
|
|
484
|
+
status: 'endpoint_missing';
|
|
485
|
+
code: number;
|
|
486
|
+
message: string;
|
|
487
|
+
} | {
|
|
488
|
+
status: 'unauthenticated';
|
|
489
|
+
code: number;
|
|
490
|
+
message: string;
|
|
491
|
+
} | {
|
|
492
|
+
status: 'rate_limited';
|
|
493
|
+
code: number;
|
|
494
|
+
retryAfterMs: number;
|
|
495
|
+
message: string;
|
|
496
|
+
} | {
|
|
497
|
+
status: 'failed';
|
|
498
|
+
code: number;
|
|
499
|
+
message: string;
|
|
500
|
+
};
|
|
501
|
+
/**
|
|
502
|
+
* Submit an explicit-continuation sync to the Pugi runtime endpoint.
|
|
503
|
+
*
|
|
504
|
+
* Endpoint contract (admin-api side, ships in this PR):
|
|
505
|
+
* POST {apiUrl}/api/pugi/sync
|
|
506
|
+
* Authorization: Bearer {apiKey}
|
|
507
|
+
* Content-Type: application/json
|
|
508
|
+
* Body: PugiSyncRequest (handoff bundle + upload-enabled plan)
|
|
509
|
+
* 200: PugiSyncResponse
|
|
510
|
+
* 401/403: unauthenticated
|
|
511
|
+
* 404: endpoint not yet deployed (graceful local-only fallback)
|
|
512
|
+
* 429: rate limited (per-tenant)
|
|
513
|
+
* 5xx: failed
|
|
514
|
+
*
|
|
515
|
+
* Local-first contract (ADR-0037): this function never reads files,
|
|
516
|
+
* never logs the bundle payload, and never retries on transient
|
|
517
|
+
* errors. The caller has already surfaced the dry-run plan to the
|
|
518
|
+
* operator; this is the explicit upload step.
|
|
519
|
+
*/
|
|
520
|
+
export declare function submitSync(config: PugiRuntimeConfig, request: PugiSyncRequest): Promise<SubmitSyncResult>;
|
|
521
|
+
export type DeviceStartResult = {
|
|
522
|
+
status: 'ok';
|
|
523
|
+
response: PugiDeviceStartResponse;
|
|
524
|
+
} | {
|
|
525
|
+
status: 'endpoint_missing';
|
|
526
|
+
code: number;
|
|
527
|
+
message: string;
|
|
528
|
+
} | {
|
|
529
|
+
status: 'failed';
|
|
530
|
+
code: number;
|
|
531
|
+
message: string;
|
|
532
|
+
};
|
|
533
|
+
/**
|
|
534
|
+
* RFC 8628 §3.1 — CLI initiates the device flow. Anonymous request
|
|
535
|
+
* (no Authorization header). The runtime returns a `device_code` the
|
|
536
|
+
* CLI must keep secret and a `user_code` the user types into the
|
|
537
|
+
* cabinet Approve page.
|
|
538
|
+
*/
|
|
539
|
+
export declare function startDeviceFlow(apiUrl: string, timeoutMs?: number): Promise<DeviceStartResult>;
|
|
540
|
+
export type DevicePollResult = {
|
|
541
|
+
status: 'ok';
|
|
542
|
+
response: PugiDevicePollResponse;
|
|
543
|
+
} | {
|
|
544
|
+
status: 'endpoint_missing';
|
|
545
|
+
code: number;
|
|
546
|
+
message: string;
|
|
547
|
+
} | {
|
|
548
|
+
status: 'failed';
|
|
549
|
+
code: number;
|
|
550
|
+
message: string;
|
|
551
|
+
};
|
|
552
|
+
/**
|
|
553
|
+
* RFC 8628 §3.4 — CLI polls until the user authorizes. The runtime
|
|
554
|
+
* returns the outcome class in the response body (always HTTP 200)
|
|
555
|
+
* so older HTTP clients with weak 4xx handling can still poll
|
|
556
|
+
* reliably. See AuthDeviceController for the rationale.
|
|
557
|
+
*/
|
|
558
|
+
export declare function pollDeviceFlow(apiUrl: string, deviceCode: string, timeoutMs?: number): Promise<DevicePollResult>;
|
|
559
|
+
//# sourceMappingURL=transport.d.ts.map
|