@bevel-software/platform-shared 0.32.0 → 0.33.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/dist/git/legacy-change-request-body.d.ts +37 -0
- package/dist/git/legacy-change-request-body.d.ts.map +1 -0
- package/dist/git/legacy-change-request-body.js +85 -0
- package/dist/git/legacy-change-request-body.js.map +1 -0
- package/dist/git/pr.types.d.ts +81 -37
- package/dist/git/pr.types.d.ts.map +1 -1
- package/dist/git/pr.types.js +11 -1
- package/dist/git/pr.types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/workflow/events.d.ts +40 -2
- package/dist/workflow/events.d.ts.map +1 -1
- package/dist/workflow/events.js +1 -0
- package/dist/workflow/events.js.map +1 -1
- package/dist/workflow/interface.d.ts +9 -6
- package/dist/workflow/interface.d.ts.map +1 -1
- package/dist/workflow/types.d.ts +15 -7
- package/dist/workflow/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/git/legacy-change-request-body.ts +107 -0
- package/src/git/pr.types.ts +74 -36
- package/src/index.ts +1 -0
- package/src/workflow/events.ts +44 -1
- package/src/workflow/interface.ts +13 -14
- package/src/workflow/types.ts +12 -8
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The grammar change-request bodies carried BEFORE a request's description
|
|
3
|
+
* became the whole of its body — read once, at the first start on the release
|
|
4
|
+
* that makes it so, to move what the body held in hidden markers onto the
|
|
5
|
+
* request's own columns and leave the prose.
|
|
6
|
+
*
|
|
7
|
+
* Three things lived in a body besides what its author wrote:
|
|
8
|
+
*
|
|
9
|
+
* - an `## Affected owners` block `openChangeRequest` appended — the eligible
|
|
10
|
+
* approvers per changed path at the moment of opening. A snapshot nothing
|
|
11
|
+
* read back (approvers are resolved live, per file, from the access rules at
|
|
12
|
+
* the target branch) and that named every changed path to every reader;
|
|
13
|
+
* - an access request's level, as `<!--hexis:access-request-level:owner-->`,
|
|
14
|
+
* and its note, fenced between `<!--hexis:access-request-note-->` and
|
|
15
|
+
* `<!--/hexis:access-request-note-->` as quoted lines — both parsed back out
|
|
16
|
+
* of the prose by the access-request flow;
|
|
17
|
+
* - identity markers (`<!--hexis:…-->`, `<!--bevel:…-->`) from the time a
|
|
18
|
+
* shared service account opened requests on people's behalf.
|
|
19
|
+
*
|
|
20
|
+
* None is written any more. This module is the one place that still knows the
|
|
21
|
+
* old shape, so the cleanup and its test read the same thing.
|
|
22
|
+
*/
|
|
23
|
+
import type { AccessRequestLevel } from './pr.types.js';
|
|
24
|
+
/** What an old body held, taken apart. */
|
|
25
|
+
export interface LegacyChangeRequestBody {
|
|
26
|
+
/** The prose, with every marker and the generated block gone. */
|
|
27
|
+
description: string;
|
|
28
|
+
/** The level an access request recorded in its body, when it did. */
|
|
29
|
+
accessRequestLevel?: AccessRequestLevel;
|
|
30
|
+
/** The requester's note, unescaped, when the body fenced one. */
|
|
31
|
+
accessRequestNote?: string;
|
|
32
|
+
/** Whether the body held anything the new shape stores elsewhere or not at all. */
|
|
33
|
+
changed: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Take an old body apart. A body of the new shape comes back unchanged, `changed: false`. */
|
|
36
|
+
export declare function parseLegacyChangeRequestBody(body: string): LegacyChangeRequestBody;
|
|
37
|
+
//# sourceMappingURL=legacy-change-request-body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-change-request-body.d.ts","sourceRoot":"","sources":["../../src/git/legacy-change-request-body.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,0CAA0C;AAC1C,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mFAAmF;IACnF,OAAO,EAAE,OAAO,CAAC;CAClB;AA+BD,8FAA8F;AAC9F,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,CAuClF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The grammar change-request bodies carried BEFORE a request's description
|
|
3
|
+
* became the whole of its body — read once, at the first start on the release
|
|
4
|
+
* that makes it so, to move what the body held in hidden markers onto the
|
|
5
|
+
* request's own columns and leave the prose.
|
|
6
|
+
*
|
|
7
|
+
* Three things lived in a body besides what its author wrote:
|
|
8
|
+
*
|
|
9
|
+
* - an `## Affected owners` block `openChangeRequest` appended — the eligible
|
|
10
|
+
* approvers per changed path at the moment of opening. A snapshot nothing
|
|
11
|
+
* read back (approvers are resolved live, per file, from the access rules at
|
|
12
|
+
* the target branch) and that named every changed path to every reader;
|
|
13
|
+
* - an access request's level, as `<!--hexis:access-request-level:owner-->`,
|
|
14
|
+
* and its note, fenced between `<!--hexis:access-request-note-->` and
|
|
15
|
+
* `<!--/hexis:access-request-note-->` as quoted lines — both parsed back out
|
|
16
|
+
* of the prose by the access-request flow;
|
|
17
|
+
* - identity markers (`<!--hexis:…-->`, `<!--bevel:…-->`) from the time a
|
|
18
|
+
* shared service account opened requests on people's behalf.
|
|
19
|
+
*
|
|
20
|
+
* None is written any more. This module is the one place that still knows the
|
|
21
|
+
* old shape, so the cleanup and its test read the same thing.
|
|
22
|
+
*/
|
|
23
|
+
const AFFECTED_OWNERS_HEADING = '## Affected owners';
|
|
24
|
+
/** One line of the generated block: a changed path in backticks, an em dash, its approvers. */
|
|
25
|
+
const GENERATED_PATH_LINE = /^- `[^`]+` — .+$/;
|
|
26
|
+
/** The block's closing summary, written when more paths changed than it listed. */
|
|
27
|
+
const GENERATED_SUMMARY_LINE = /^…and \d+ more changed path\(s\)\. All eligible approvers across this change: /;
|
|
28
|
+
/**
|
|
29
|
+
* Whether what follows the heading is the block `openChangeRequest` wrote and
|
|
30
|
+
* nothing else: at least one path line, and every non-blank line a path line
|
|
31
|
+
* or the summary. An author who wrote the heading themselves, with prose
|
|
32
|
+
* under it, keeps both — the cut would otherwise take their text and the
|
|
33
|
+
* ledger would record the move as done.
|
|
34
|
+
*/
|
|
35
|
+
function isGeneratedBlock(lines) {
|
|
36
|
+
const written = lines.filter((line) => line.trim() !== '');
|
|
37
|
+
return written.length > 0 && written.every((line) => GENERATED_PATH_LINE.test(line) || GENERATED_SUMMARY_LINE.test(line));
|
|
38
|
+
}
|
|
39
|
+
const LEVEL_MARK = /<!--hexis:access-request-level:(write|owner)-->/;
|
|
40
|
+
const NOTE_OPEN = '<!--hexis:access-request-note-->';
|
|
41
|
+
const NOTE_CLOSE = '<!--/hexis:access-request-note-->';
|
|
42
|
+
/** Hexis's own hidden markers, opener or closer, and no other HTML comment: an author's own comment is prose. */
|
|
43
|
+
const HEXIS_MARKER = /[ \t]*<!--\s*\/?(?:hexis|bevel)[:/][\s\S]*?-->[ \t]*/g;
|
|
44
|
+
/** The exact inverse of the escaping the access-request flow applied to a note's lines. */
|
|
45
|
+
function unescapeMarkdown(text) {
|
|
46
|
+
return text.replace(/\\([\\`*_{}[\]()#+\-.!|<>~])/g, '$1');
|
|
47
|
+
}
|
|
48
|
+
/** Take an old body apart. A body of the new shape comes back unchanged, `changed: false`. */
|
|
49
|
+
export function parseLegacyChangeRequestBody(body) {
|
|
50
|
+
let text = body;
|
|
51
|
+
// The generated block starts at the LAST line reading exactly the heading
|
|
52
|
+
// and runs to the end — it was appended after everything the author wrote.
|
|
53
|
+
const lines = text.split('\n');
|
|
54
|
+
// Cut only when what follows IS that block: the heading alone proves nothing.
|
|
55
|
+
const generatedAt = lines.lastIndexOf(AFFECTED_OWNERS_HEADING);
|
|
56
|
+
if (generatedAt !== -1 && isGeneratedBlock(lines.slice(generatedAt + 1)))
|
|
57
|
+
text = lines.slice(0, generatedAt).join('\n');
|
|
58
|
+
const level = LEVEL_MARK.exec(text);
|
|
59
|
+
const accessRequestLevel = level ? level[1] : undefined;
|
|
60
|
+
let accessRequestNote;
|
|
61
|
+
const noteStart = text.indexOf(NOTE_OPEN);
|
|
62
|
+
const noteEnd = noteStart < 0 ? -1 : text.indexOf(NOTE_CLOSE, noteStart);
|
|
63
|
+
if (noteStart >= 0 && noteEnd >= 0) {
|
|
64
|
+
const note = text
|
|
65
|
+
.slice(noteStart + NOTE_OPEN.length, noteEnd)
|
|
66
|
+
.split(/\r?\n/)
|
|
67
|
+
.filter((line) => line.startsWith('>'))
|
|
68
|
+
.map((line) => unescapeMarkdown(line.replace(/^>\s?/, '')))
|
|
69
|
+
.join('\n')
|
|
70
|
+
.trim();
|
|
71
|
+
accessRequestNote = note || undefined;
|
|
72
|
+
}
|
|
73
|
+
// The markers go; the quoted note lines stay, as the prose they were shown as.
|
|
74
|
+
const description = text
|
|
75
|
+
.replace(HEXIS_MARKER, '')
|
|
76
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
77
|
+
.trim();
|
|
78
|
+
return {
|
|
79
|
+
description,
|
|
80
|
+
...(accessRequestLevel ? { accessRequestLevel } : {}),
|
|
81
|
+
...(accessRequestNote ? { accessRequestNote } : {}),
|
|
82
|
+
changed: description !== body || accessRequestLevel !== undefined || accessRequestNote !== undefined,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=legacy-change-request-body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-change-request-body.js","sourceRoot":"","sources":["../../src/git/legacy-change-request-body.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAgBH,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AACrD,+FAA+F;AAC/F,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAC/C,mFAAmF;AACnF,MAAM,sBAAsB,GAAG,gFAAgF,C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,CAAC;QACnD,OAAO,EAAE,WAAW,KAAK,IAAI,IAAI,kBAAkB,KAAK,SAAS,IAAI,iBAAiB,KAAK,SAAS;KACrG,CAAC;AACJ,CAAC"}
|
package/dist/git/pr.types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type PullRequestState = 'open' | 'merged' | 'closed';
|
|
2
|
+
/** The level an access request asks for: Can edit, or Owner. */
|
|
3
|
+
export type AccessRequestLevel = 'write' | 'owner';
|
|
2
4
|
export interface PullRequestAuthor {
|
|
3
5
|
login: string;
|
|
4
6
|
name?: string;
|
|
@@ -43,9 +45,10 @@ export interface PullRequestSummary {
|
|
|
43
45
|
/**
|
|
44
46
|
* The latest moment the change-request ROW records: the latest of its
|
|
45
47
|
* creation time, its `updated_at` stamp (written when the row itself
|
|
46
|
-
* changes — a merge, a close, a recorded apply failure
|
|
48
|
+
* changes — a merge, a close, a recorded apply failure, an edit of its title
|
|
49
|
+
* or description) and its close time.
|
|
47
50
|
* GitHub's `updated_at` on a pull request means "when anything about it
|
|
48
|
-
* last changed";
|
|
51
|
+
* last changed"; approvals carry their own times here and do
|
|
49
52
|
* not move this one, so this is as close as the row can honestly answer —
|
|
50
53
|
* never a time guessed from elsewhere. Absent only on a summary built by
|
|
51
54
|
* something other than a change-request row (test doubles).
|
|
@@ -184,39 +187,6 @@ export interface PullRequestFile {
|
|
|
184
187
|
/** Authenticated `raw.githubusercontent.com`-style URL for the blob at head. */
|
|
185
188
|
rawUrl: string;
|
|
186
189
|
}
|
|
187
|
-
/**
|
|
188
|
-
* One comment in the Bevel-owned PR discussion. GitHub never sees these —
|
|
189
|
-
* they live only in our DB, attributed to the authenticated user. Shape
|
|
190
|
-
* encodes three comment kinds:
|
|
191
|
-
*
|
|
192
|
-
* General → path undefined, line undefined
|
|
193
|
-
* File-level → path set, line undefined
|
|
194
|
-
* Inline (line) → path set, line set
|
|
195
|
-
*
|
|
196
|
-
* Threading: `parentId` points at the root of the thread; top-level comments
|
|
197
|
-
* have it undefined.
|
|
198
|
-
*/
|
|
199
|
-
export interface PrReviewComment {
|
|
200
|
-
id: string;
|
|
201
|
-
author: {
|
|
202
|
-
email: string;
|
|
203
|
-
name: string;
|
|
204
|
-
};
|
|
205
|
-
body: string;
|
|
206
|
-
path?: string;
|
|
207
|
-
line?: number;
|
|
208
|
-
/** The head SHA the comment was authored against — lets the UI grey out stale inline pins. */
|
|
209
|
-
headSha: string;
|
|
210
|
-
parentId?: string;
|
|
211
|
-
createdAt: string;
|
|
212
|
-
updatedAt?: string;
|
|
213
|
-
}
|
|
214
|
-
export interface PostPrCommentInput {
|
|
215
|
-
body: string;
|
|
216
|
-
path?: string;
|
|
217
|
-
line?: number;
|
|
218
|
-
parentId?: string;
|
|
219
|
-
}
|
|
220
190
|
/**
|
|
221
191
|
* One owner's approval on one file. Stored straight from the
|
|
222
192
|
* `pr_file_approvals` row, with derived flags the UI needs.
|
|
@@ -295,15 +265,29 @@ export interface FileApprovalState {
|
|
|
295
265
|
}
|
|
296
266
|
/**
|
|
297
267
|
* Full read-only PR detail for the in-app viewer. Extends the summary with
|
|
298
|
-
* body, SHAs
|
|
268
|
+
* body, SHAs and file list. Later phases add
|
|
299
269
|
* `approvals` and merge-gate fields — this shape grows incrementally.
|
|
300
270
|
*/
|
|
301
271
|
export interface PullRequestDetail extends PullRequestSummary {
|
|
272
|
+
/**
|
|
273
|
+
* The request's description — the whole body, exactly as its author (or a
|
|
274
|
+
* later edit) left it. Hexis writes nothing of its own into it: who must
|
|
275
|
+
* approve each file is resolved live and answered per file in `approvals`,
|
|
276
|
+
* and an access request's level and note are `accessRequest`'s.
|
|
277
|
+
*/
|
|
302
278
|
body: string;
|
|
279
|
+
/**
|
|
280
|
+
* Set on a request the access-request flow opened: the level the person
|
|
281
|
+
* asked for, and their note when they wrote one. Absent on every other
|
|
282
|
+
* request.
|
|
283
|
+
*/
|
|
284
|
+
accessRequest?: {
|
|
285
|
+
level: AccessRequestLevel;
|
|
286
|
+
note?: string;
|
|
287
|
+
};
|
|
303
288
|
headSha: string;
|
|
304
289
|
baseSha: string;
|
|
305
290
|
files: PullRequestFile[];
|
|
306
|
-
comments: PrReviewComment[];
|
|
307
291
|
/**
|
|
308
292
|
* One entry per file in `files`, same order. Empty when the caller had no
|
|
309
293
|
* resolvable workspace to do the owner lookup against.
|
|
@@ -417,7 +401,67 @@ export interface PullRequestDetail extends PullRequestSummary {
|
|
|
417
401
|
* `DELETE /api/workflow/change-requests/:number` re-checks server-side.
|
|
418
402
|
*/
|
|
419
403
|
viewerCanDelete: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* True iff the viewer may change the request's title and description: the
|
|
406
|
+
* request is open AND the viewer is its author or someone who may merge it
|
|
407
|
+
* (an admin, or the holder of write on every changed file) — exactly
|
|
408
|
+
* `viewerCanCancel`'s grants, since what is asked belongs to the same people
|
|
409
|
+
* who may close it. A UX hint — `PATCH /api/workflow/change-requests/:number`
|
|
410
|
+
* re-checks server-side.
|
|
411
|
+
*/
|
|
412
|
+
viewerCanEdit: boolean;
|
|
420
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* Body of `PATCH /api/workflow/change-requests/:number`. At least one field;
|
|
416
|
+
* an absent field keeps its current text. `description` replaces the
|
|
417
|
+
* request's description whole — the body is nothing but the description.
|
|
418
|
+
* `appendDescription` instead adds a paragraph after the description as the
|
|
419
|
+
* server holds it at the moment of the write, so two appends racing each
|
|
420
|
+
* other both land (never together with `description`). A title is at most
|
|
421
|
+
* {@link CHANGE_REQUEST_TITLE_MAX} characters and a description, after an
|
|
422
|
+
* append as much as after a replacement, at most
|
|
423
|
+
* {@link CHANGE_REQUEST_DESCRIPTION_MAX}.
|
|
424
|
+
*
|
|
425
|
+
* A union of the allowed shapes, so a client cannot build `{}` or a
|
|
426
|
+
* `description` together with `appendDescription`. The server reads the
|
|
427
|
+
* body as untrusted JSON all the same — as {@link UpdateChangeRequestFields}
|
|
428
|
+
* — and answers any other shape with a worded 400.
|
|
429
|
+
*/
|
|
430
|
+
export type UpdateChangeRequestInput = {
|
|
431
|
+
title: string;
|
|
432
|
+
description?: string;
|
|
433
|
+
appendDescription?: never;
|
|
434
|
+
} | {
|
|
435
|
+
title?: string;
|
|
436
|
+
description: string;
|
|
437
|
+
appendDescription?: never;
|
|
438
|
+
} | {
|
|
439
|
+
title?: string;
|
|
440
|
+
description?: never;
|
|
441
|
+
appendDescription: string;
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* The fields of a `PATCH /api/workflow/change-requests/:number` body as the
|
|
445
|
+
* server receives them — any combination, since the body is untrusted JSON.
|
|
446
|
+
* `WorkflowService.updateChangeRequest` checks the shape and refuses what
|
|
447
|
+
* {@link UpdateChangeRequestInput} rules out with a worded 400.
|
|
448
|
+
*/
|
|
449
|
+
export interface UpdateChangeRequestFields {
|
|
450
|
+
title?: string;
|
|
451
|
+
description?: string;
|
|
452
|
+
appendDescription?: string;
|
|
453
|
+
}
|
|
454
|
+
/** Longest title a change request may carry — the route and the agent tool alike. */
|
|
455
|
+
export declare const CHANGE_REQUEST_TITLE_MAX = 256;
|
|
456
|
+
/**
|
|
457
|
+
* Longest description a change request may carry, in characters — on
|
|
458
|
+
* opening, on a replacement and on what an append leaves, for the routes and
|
|
459
|
+
* the agent tools alike. The body is decrypted by every listing and every
|
|
460
|
+
* detail read, and the propose flow appends a note on each later round, so
|
|
461
|
+
* without a ceiling a request's body grows for as long as it is open. The
|
|
462
|
+
* same ceiling comments had.
|
|
463
|
+
*/
|
|
464
|
+
export declare const CHANGE_REQUEST_DESCRIPTION_MAX = 64000;
|
|
421
465
|
/**
|
|
422
466
|
* Result of a successful merge via the in-app gate. `sha` is the merge commit
|
|
423
467
|
* GitHub produced; the UI uses it to link to the resulting commit and to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.types.d.ts","sourceRoot":"","sources":["../../src/git/pr.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,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O,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAC/C,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACjC,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAC7E;;;OAGG;IACH,oBAAoB,CAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GACzB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACjC,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC5D;;;;OAIG;IACH,WAAW,CACT,QAAQ,EAAE,MAAM;IAChB;;;;;OAKG;IACH,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GACxF,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACtC"}
|
package/dist/git/pr.types.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/** Longest title a change request may carry — the route and the agent tool alike. */
|
|
2
|
+
export const CHANGE_REQUEST_TITLE_MAX = 256;
|
|
3
|
+
/**
|
|
4
|
+
* Longest description a change request may carry, in characters — on
|
|
5
|
+
* opening, on a replacement and on what an append leaves, for the routes and
|
|
6
|
+
* the agent tools alike. The body is decrypted by every listing and every
|
|
7
|
+
* detail read, and the propose flow appends a note on each later round, so
|
|
8
|
+
* without a ceiling a request's body grows for as long as it is open. The
|
|
9
|
+
* same ceiling comments had.
|
|
10
|
+
*/
|
|
11
|
+
export const CHANGE_REQUEST_DESCRIPTION_MAX = 64_000;
|
|
2
12
|
//# sourceMappingURL=pr.types.js.map
|
package/dist/git/pr.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.types.js","sourceRoot":"","sources":["../../src/git/pr.types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"pr.types.js","sourceRoot":"","sources":["../../src/git/pr.types.ts"],"names":[],"mappings":"AAucA,qFAAqF;AACrF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './git/pr.types.js';
|
|
|
18
18
|
export * from './git/protected.js';
|
|
19
19
|
export * from './git/branchAuthor.js';
|
|
20
20
|
export * from './git/review.types.js';
|
|
21
|
+
export * from './git/legacy-change-request-body.js';
|
|
21
22
|
export * from './workflow/types.js';
|
|
22
23
|
export * from './workflow/interface.js';
|
|
23
24
|
export * from './workflow/events.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,iBAAiB,CAAC;AAGhC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAG5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,iBAAiB,CAAC;AAGhC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAG5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC;AAGpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export * from './git/pr.types.js';
|
|
|
22
22
|
export * from './git/protected.js';
|
|
23
23
|
export * from './git/branchAuthor.js';
|
|
24
24
|
export * from './git/review.types.js';
|
|
25
|
+
export * from './git/legacy-change-request-body.js';
|
|
25
26
|
// Workflow — abstraction layer over git/PR/review-workflow. See PLAN.md.
|
|
26
27
|
export * from './workflow/types.js';
|
|
27
28
|
export * from './workflow/interface.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO;AACP,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA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zE,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
|
@@ -93,6 +93,23 @@ export interface FsTreeChangedEvent {
|
|
|
93
93
|
workspaceId: string;
|
|
94
94
|
branch: string;
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* A document's text could not be extracted, just now: the parser refused it,
|
|
98
|
+
* or the extraction outlived its budget. Emitted once per FRESH failure —
|
|
99
|
+
* never for one answered from memory — so a person looking at the file's row
|
|
100
|
+
* in the explorer is told in place, and nothing is kept for later.
|
|
101
|
+
*
|
|
102
|
+
* `reason` follows "Could not be read:" in the explorer's notice. It names the
|
|
103
|
+
* file and quotes the parser; like every kind that names a path on a
|
|
104
|
+
* workspace, it is delivered only to sessions whose person may read `path`
|
|
105
|
+
* (the events route's delivery rule, judged by the access rules).
|
|
106
|
+
*/
|
|
107
|
+
export interface DocumentUnreadableEvent {
|
|
108
|
+
kind: 'document-unreadable';
|
|
109
|
+
workspaceId: string;
|
|
110
|
+
path: string;
|
|
111
|
+
reason: string;
|
|
112
|
+
}
|
|
96
113
|
/**
|
|
97
114
|
* A commit landed locally but could not be pushed to the remote.
|
|
98
115
|
*
|
|
@@ -185,6 +202,12 @@ export interface AgentToolCallEvent {
|
|
|
185
202
|
*/
|
|
186
203
|
summary?: string;
|
|
187
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* A change request was opened. Reaches EVERY session, so it says only that a
|
|
207
|
+
* request exists: its number, its branches and who opened it — no title and
|
|
208
|
+
* no paths, which a person may not be allowed to read. A reader fetches the
|
|
209
|
+
* request, and sees of it what the request routes show them.
|
|
210
|
+
*/
|
|
188
211
|
export interface ChangeRequestOpenedEvent {
|
|
189
212
|
kind: 'change-request-opened';
|
|
190
213
|
number: number;
|
|
@@ -192,7 +215,6 @@ export interface ChangeRequestOpenedEvent {
|
|
|
192
215
|
target: string;
|
|
193
216
|
/** Hash of the author's email (matches the marker in the CR body); null when unattributable. */
|
|
194
217
|
authorIdHash: string | null;
|
|
195
|
-
title: string;
|
|
196
218
|
}
|
|
197
219
|
export interface ChangeRequestMergedEvent {
|
|
198
220
|
kind: 'change-request-merged';
|
|
@@ -202,6 +224,15 @@ export interface ChangeRequestRejectedEvent {
|
|
|
202
224
|
kind: 'change-request-rejected';
|
|
203
225
|
number: number;
|
|
204
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* A request's title or description was edited. Carries no text: every
|
|
229
|
+
* viewer re-reads the request through the list and detail endpoints it
|
|
230
|
+
* already uses, which apply its own read rules.
|
|
231
|
+
*/
|
|
232
|
+
export interface ChangeRequestEditedEvent {
|
|
233
|
+
kind: 'change-request-edited';
|
|
234
|
+
number: number;
|
|
235
|
+
}
|
|
205
236
|
/**
|
|
206
237
|
* An apply did NOT land, announced to EVERY session — the counterpart of the
|
|
207
238
|
* user-scoped `change-request-merge-failed` below, which only the clicker gets.
|
|
@@ -261,7 +292,14 @@ export interface ChangeRequestMergeFailedEvent {
|
|
|
261
292
|
export interface ApprovalChangedEvent {
|
|
262
293
|
kind: 'approval-changed';
|
|
263
294
|
number: number;
|
|
295
|
+
/** The approved file, KB-repo-relative. */
|
|
264
296
|
path: string;
|
|
297
|
+
/**
|
|
298
|
+
* The request's target branch: the event names a path, and whether a
|
|
299
|
+
* session's person may hear of it is judged by their read access to that
|
|
300
|
+
* path at the target — the same rule the request's own detail is scoped by.
|
|
301
|
+
*/
|
|
302
|
+
targetBranch: string;
|
|
265
303
|
approverUserId: string;
|
|
266
304
|
change: 'added' | 'removed';
|
|
267
305
|
}
|
|
@@ -307,7 +345,7 @@ export interface AgentConnectedEvent {
|
|
|
307
345
|
/** When the first request landed, ISO 8601. */
|
|
308
346
|
at: string;
|
|
309
347
|
}
|
|
310
|
-
export type WorkflowEventPayload = FileChangedEvent | LockAcquiredEvent | LockReleasedEvent | FsTreeChangedEvent | GitSyncFailedEvent | GitSyncRecoveredEvent | BranchSwitchedEvent | AgentToolCallEvent | AgentConnectedEvent | ChangeRequestOpenedEvent | ChangeRequestMergedEvent | ChangeRequestRejectedEvent | ChangeRequestMergeFailedEvent | ChangeRequestApplyFailedEvent | ApprovalChangedEvent | HeartbeatEvent | ResyncEvent;
|
|
348
|
+
export type WorkflowEventPayload = FileChangedEvent | LockAcquiredEvent | LockReleasedEvent | FsTreeChangedEvent | DocumentUnreadableEvent | GitSyncFailedEvent | GitSyncRecoveredEvent | BranchSwitchedEvent | AgentToolCallEvent | AgentConnectedEvent | ChangeRequestOpenedEvent | ChangeRequestMergedEvent | ChangeRequestRejectedEvent | ChangeRequestEditedEvent | ChangeRequestMergeFailedEvent | ChangeRequestApplyFailedEvent | ApprovalChangedEvent | HeartbeatEvent | ResyncEvent;
|
|
311
349
|
export type WorkflowEvent = WorkflowEventEnvelope & WorkflowEventPayload;
|
|
312
350
|
/** True for events scoped to a workspace — the focus filter applies. */
|
|
313
351
|
export declare function isWorkspaceScoped(e: WorkflowEventPayload): e is WorkflowEventPayload & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;CACZ;AAID;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;I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;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,EAAE,OAAO,GAAG,KAAK,CAAC;IAC3B,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;CACZ;AAID,MAAM,MAAM,oBAAoB,GAC5B,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,uBAAuB,GACvB,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,wBAAwB,GACxB,wBAAwB,GACxB,0BAA0B,GAC1B,wBAAwB,GACxB,6BAA6B,GAC7B,6BAA6B,GAC7B,oBAAoB,GACpB,cAAc,GACd,WAAW,CAAC;AAEhB,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,oBAAoB,CAAC;AAEzE,wEAAwE;AACxE,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,oBAAoB,GACtB,CAAC,IAAI,oBAAoB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAUrD;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAC1B,CAAC,EAAE,oBAAoB,GACtB,CAAC,IAAI,oBAAoB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAOnD"}
|
package/dist/workflow/events.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAgXH,wEAAwE;AACxE,MAAM,UAAU,iBAAiB,CAC/B,CAAuB;IAEvB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,cAAc;QACzB,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,qBAAqB;QAChC,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,oBAAoB,CAChC,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,YAAY,CAC1B,CAAuB;IAEvB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,6BAA6B,CACzC,CAAC;AACJ,CAAC"}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* the final surface area.
|
|
18
18
|
*/
|
|
19
19
|
import type { AuthUser } from '../auth/types.js';
|
|
20
|
-
import type { ChangeRequestApplyFailureKind } from '../git/pr.types.js';
|
|
21
|
-
import type { AcquireLockResult, Branch, BranchSyncOutcome, BranchWorkspaceStatus, CancelChangeRequestResult, Change, ChangeInput, ChangeRequest,
|
|
20
|
+
import type { ChangeRequestApplyFailureKind, UpdateChangeRequestFields } from '../git/pr.types.js';
|
|
21
|
+
import type { AcquireLockResult, Branch, BranchSyncOutcome, BranchWorkspaceStatus, CancelChangeRequestResult, Change, ChangeInput, ChangeRequest, ChangeRequestDetail, ChangeRequestUpdateResult, ChangeRequestState, ChangedFile, DeleteBranchPreview, DeleteBranchResult, FileApproval, FileLock, FolderChangeRequest, FolderChangeRequestRemoval, MergeBranchOutcome, MergeChangeRequestOutcome, OpenChangeRequestInput, UpdateBranchOutcome } from './types.js';
|
|
22
22
|
import type { MergeResolution } from '../git/types.js';
|
|
23
23
|
export interface IWorkflowService {
|
|
24
24
|
/**
|
|
@@ -448,10 +448,6 @@ export interface IWorkflowService {
|
|
|
448
448
|
* replace exactly those.
|
|
449
449
|
*/
|
|
450
450
|
updateFromTarget(workspaceId: string, user: AuthUser, number: number): Promise<ChangeRequestUpdateResult>;
|
|
451
|
-
listComments(number: number): Promise<ChangeRequestComment[]>;
|
|
452
|
-
postComment(number: number, user: AuthUser, input: PostChangeRequestCommentInput, headSha: string): Promise<ChangeRequestComment>;
|
|
453
|
-
editComment(commentId: string, number: number, user: AuthUser, body: string): Promise<ChangeRequestComment>;
|
|
454
|
-
deleteComment(commentId: string, number: number, user: AuthUser): Promise<void>;
|
|
455
451
|
approveFile(number: number, path: string, user: AuthUser, files: ChangedFile[], headSha: string, baseBranch: string, authorIdHash: string | null, workspaceId: string): Promise<FileApproval[]>;
|
|
456
452
|
unapproveFile(number: number, path: string, user: AuthUser, files: ChangedFile[], headSha: string, baseBranch: string, authorIdHash: string | null, workspaceId: string): Promise<FileApproval[]>;
|
|
457
453
|
/**
|
|
@@ -503,6 +499,13 @@ export interface IWorkflowService {
|
|
|
503
499
|
* request.
|
|
504
500
|
*/
|
|
505
501
|
deleteChangeRequest(number: number, user: AuthUser): Promise<void>;
|
|
502
|
+
/**
|
|
503
|
+
* Change an OPEN request's title and/or description. Its author, an admin,
|
|
504
|
+
* or the holder of write on every changed file — the people who may close
|
|
505
|
+
* it; anyone else gets a worded 403, and a merged or closed request a
|
|
506
|
+
* worded 409.
|
|
507
|
+
*/
|
|
508
|
+
updateChangeRequest(number: number, user: AuthUser, input: UpdateChangeRequestFields): Promise<ChangeRequest>;
|
|
506
509
|
/**
|
|
507
510
|
* Reject a change request without merging. Authorized for the author or
|
|
508
511
|
* for users with write permission to every changed file on the target
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/workflow/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/workflow/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACnG,OAAO,KAAK,EACV,iBAAiB,EACjB,MAAM,EACN,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,MAAM,EACN,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAG/B;;;;OAIG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7G;;;;;;OAMG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpF;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C9C,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACjE;;;;;;;OAOG;IACH,2BAA2B,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACnG"}
|
package/dist/workflow/types.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* inputs, conflict-resolution payloads) live here directly.
|
|
15
15
|
*/
|
|
16
16
|
import type { BranchInfo, CommitAttribution, MergeIntoBranchOutcome, ShareChangesRequest, WorkingTreeStatus } from '../git/types.js';
|
|
17
|
-
import type { CancelPrResult, FileApprovalState, MergePrResult, PullRequestDetail, PullRequestState, PullRequestSummary,
|
|
17
|
+
import type { AccessRequestLevel, CancelPrResult, FileApprovalState, MergePrResult, PullRequestDetail, PullRequestState, PullRequestSummary, PullRequestFile } from '../git/pr.types.js';
|
|
18
18
|
/** A variation of the ontology. Protected or not. */
|
|
19
19
|
export type Branch = BranchInfo;
|
|
20
20
|
/**
|
|
@@ -120,8 +120,6 @@ export type ChangedFile = PullRequestFile;
|
|
|
120
120
|
export type FileApproval = FileApprovalState;
|
|
121
121
|
export type MergeChangeRequestResult = MergePrResult;
|
|
122
122
|
export type CancelChangeRequestResult = CancelPrResult;
|
|
123
|
-
export type ChangeRequestComment = PrReviewComment;
|
|
124
|
-
export type PostChangeRequestCommentInput = PostPrCommentInput;
|
|
125
123
|
/**
|
|
126
124
|
* One open change request proposing files under a folder, as a folder delete
|
|
127
125
|
* lists it. `mayRemove`: the caller may take those files out of it (their own,
|
|
@@ -164,16 +162,26 @@ export interface FolderChangeRequestRemoval {
|
|
|
164
162
|
* `targetBranch` into `sourceBranch` as part of opening, so callers don't
|
|
165
163
|
* pass a head SHA — the workflow resolves the head itself.
|
|
166
164
|
*
|
|
167
|
-
* `title` + `description` are the change request's metadata
|
|
168
|
-
* is
|
|
169
|
-
*
|
|
170
|
-
* underlying GitHub PR is created.
|
|
165
|
+
* `title` + `description` are the change request's metadata. The description
|
|
166
|
+
* is stored exactly as given and IS the request's body: Hexis appends nothing
|
|
167
|
+
* of its own to it.
|
|
171
168
|
*/
|
|
172
169
|
export interface OpenChangeRequestInput {
|
|
173
170
|
sourceBranch: string;
|
|
174
171
|
targetBranch: string;
|
|
175
172
|
title: string;
|
|
176
173
|
description?: string;
|
|
174
|
+
/**
|
|
175
|
+
* The access-request flow's own facts about the request it opens: the level
|
|
176
|
+
* asked for and the person's note, kept on the request's row rather than in
|
|
177
|
+
* its prose. Only that flow sets it — the open route and the agent's
|
|
178
|
+
* `open_change_request` build their input field by field and never forward
|
|
179
|
+
* it.
|
|
180
|
+
*/
|
|
181
|
+
accessRequest?: {
|
|
182
|
+
level: AccessRequestLevel;
|
|
183
|
+
note?: string;
|
|
184
|
+
};
|
|
177
185
|
}
|
|
178
186
|
/**
|
|
179
187
|
* Result of asking the workflow to merge a change request. Mirrors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,i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AU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,sHAAsH;AACtH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACvE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,GACzC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,GAC1C;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC;IAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bevel-software/platform-shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Shared types and pure domain utilities of the Bevel core platform (auth, workspace, git/workflow contracts, branch registry).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The grammar change-request bodies carried BEFORE a request's description
|
|
3
|
+
* became the whole of its body — read once, at the first start on the release
|
|
4
|
+
* that makes it so, to move what the body held in hidden markers onto the
|
|
5
|
+
* request's own columns and leave the prose.
|
|
6
|
+
*
|
|
7
|
+
* Three things lived in a body besides what its author wrote:
|
|
8
|
+
*
|
|
9
|
+
* - an `## Affected owners` block `openChangeRequest` appended — the eligible
|
|
10
|
+
* approvers per changed path at the moment of opening. A snapshot nothing
|
|
11
|
+
* read back (approvers are resolved live, per file, from the access rules at
|
|
12
|
+
* the target branch) and that named every changed path to every reader;
|
|
13
|
+
* - an access request's level, as `<!--hexis:access-request-level:owner-->`,
|
|
14
|
+
* and its note, fenced between `<!--hexis:access-request-note-->` and
|
|
15
|
+
* `<!--/hexis:access-request-note-->` as quoted lines — both parsed back out
|
|
16
|
+
* of the prose by the access-request flow;
|
|
17
|
+
* - identity markers (`<!--hexis:…-->`, `<!--bevel:…-->`) from the time a
|
|
18
|
+
* shared service account opened requests on people's behalf.
|
|
19
|
+
*
|
|
20
|
+
* None is written any more. This module is the one place that still knows the
|
|
21
|
+
* old shape, so the cleanup and its test read the same thing.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import type { AccessRequestLevel } from './pr.types.js';
|
|
25
|
+
|
|
26
|
+
/** What an old body held, taken apart. */
|
|
27
|
+
export interface LegacyChangeRequestBody {
|
|
28
|
+
/** The prose, with every marker and the generated block gone. */
|
|
29
|
+
description: string;
|
|
30
|
+
/** The level an access request recorded in its body, when it did. */
|
|
31
|
+
accessRequestLevel?: AccessRequestLevel;
|
|
32
|
+
/** The requester's note, unescaped, when the body fenced one. */
|
|
33
|
+
accessRequestNote?: string;
|
|
34
|
+
/** Whether the body held anything the new shape stores elsewhere or not at all. */
|
|
35
|
+
changed: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const AFFECTED_OWNERS_HEADING = '## Affected owners';
|
|
39
|
+
/** One line of the generated block: a changed path in backticks, an em dash, its approvers. */
|
|
40
|
+
const GENERATED_PATH_LINE = /^- `[^`]+` — .+$/;
|
|
41
|
+
/** The block's closing summary, written when more paths changed than it listed. */
|
|
42
|
+
const GENERATED_SUMMARY_LINE = /^…and \d+ more changed path\(s\)\. All eligible approvers across this change: /;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Whether what follows the heading is the block `openChangeRequest` wrote and
|
|
46
|
+
* nothing else: at least one path line, and every non-blank line a path line
|
|
47
|
+
* or the summary. An author who wrote the heading themselves, with prose
|
|
48
|
+
* under it, keeps both — the cut would otherwise take their text and the
|
|
49
|
+
* ledger would record the move as done.
|
|
50
|
+
*/
|
|
51
|
+
function isGeneratedBlock(lines: string[]): boolean {
|
|
52
|
+
const written = lines.filter((line) => line.trim() !== '');
|
|
53
|
+
return written.length > 0 && written.every((line) => GENERATED_PATH_LINE.test(line) || GENERATED_SUMMARY_LINE.test(line));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const LEVEL_MARK = /<!--hexis:access-request-level:(write|owner)-->/;
|
|
57
|
+
const NOTE_OPEN = '<!--hexis:access-request-note-->';
|
|
58
|
+
const NOTE_CLOSE = '<!--/hexis:access-request-note-->';
|
|
59
|
+
/** Hexis's own hidden markers, opener or closer, and no other HTML comment: an author's own comment is prose. */
|
|
60
|
+
const HEXIS_MARKER = /[ \t]*<!--\s*\/?(?:hexis|bevel)[:/][\s\S]*?-->[ \t]*/g;
|
|
61
|
+
|
|
62
|
+
/** The exact inverse of the escaping the access-request flow applied to a note's lines. */
|
|
63
|
+
function unescapeMarkdown(text: string): string {
|
|
64
|
+
return text.replace(/\\([\\`*_{}[\]()#+\-.!|<>~])/g, '$1');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Take an old body apart. A body of the new shape comes back unchanged, `changed: false`. */
|
|
68
|
+
export function parseLegacyChangeRequestBody(body: string): LegacyChangeRequestBody {
|
|
69
|
+
let text = body;
|
|
70
|
+
|
|
71
|
+
// The generated block starts at the LAST line reading exactly the heading
|
|
72
|
+
// and runs to the end — it was appended after everything the author wrote.
|
|
73
|
+
const lines = text.split('\n');
|
|
74
|
+
// Cut only when what follows IS that block: the heading alone proves nothing.
|
|
75
|
+
const generatedAt = lines.lastIndexOf(AFFECTED_OWNERS_HEADING);
|
|
76
|
+
if (generatedAt !== -1 && isGeneratedBlock(lines.slice(generatedAt + 1))) text = lines.slice(0, generatedAt).join('\n');
|
|
77
|
+
|
|
78
|
+
const level = LEVEL_MARK.exec(text);
|
|
79
|
+
const accessRequestLevel = level ? (level[1] as AccessRequestLevel) : undefined;
|
|
80
|
+
|
|
81
|
+
let accessRequestNote: string | undefined;
|
|
82
|
+
const noteStart = text.indexOf(NOTE_OPEN);
|
|
83
|
+
const noteEnd = noteStart < 0 ? -1 : text.indexOf(NOTE_CLOSE, noteStart);
|
|
84
|
+
if (noteStart >= 0 && noteEnd >= 0) {
|
|
85
|
+
const note = text
|
|
86
|
+
.slice(noteStart + NOTE_OPEN.length, noteEnd)
|
|
87
|
+
.split(/\r?\n/)
|
|
88
|
+
.filter((line) => line.startsWith('>'))
|
|
89
|
+
.map((line) => unescapeMarkdown(line.replace(/^>\s?/, '')))
|
|
90
|
+
.join('\n')
|
|
91
|
+
.trim();
|
|
92
|
+
accessRequestNote = note || undefined;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// The markers go; the quoted note lines stay, as the prose they were shown as.
|
|
96
|
+
const description = text
|
|
97
|
+
.replace(HEXIS_MARKER, '')
|
|
98
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
99
|
+
.trim();
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
description,
|
|
103
|
+
...(accessRequestLevel ? { accessRequestLevel } : {}),
|
|
104
|
+
...(accessRequestNote ? { accessRequestNote } : {}),
|
|
105
|
+
changed: description !== body || accessRequestLevel !== undefined || accessRequestNote !== undefined,
|
|
106
|
+
};
|
|
107
|
+
}
|
package/src/git/pr.types.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export type PullRequestState = 'open' | 'merged' | 'closed';
|
|
2
2
|
|
|
3
|
+
/** The level an access request asks for: Can edit, or Owner. */
|
|
4
|
+
export type AccessRequestLevel = 'write' | 'owner';
|
|
5
|
+
|
|
3
6
|
export interface PullRequestAuthor {
|
|
4
7
|
login: string;
|
|
5
8
|
name?: string;
|
|
@@ -44,9 +47,10 @@ export interface PullRequestSummary {
|
|
|
44
47
|
/**
|
|
45
48
|
* The latest moment the change-request ROW records: the latest of its
|
|
46
49
|
* creation time, its `updated_at` stamp (written when the row itself
|
|
47
|
-
* changes — a merge, a close, a recorded apply failure
|
|
50
|
+
* changes — a merge, a close, a recorded apply failure, an edit of its title
|
|
51
|
+
* or description) and its close time.
|
|
48
52
|
* GitHub's `updated_at` on a pull request means "when anything about it
|
|
49
|
-
* last changed";
|
|
53
|
+
* last changed"; approvals carry their own times here and do
|
|
50
54
|
* not move this one, so this is as close as the row can honestly answer —
|
|
51
55
|
* never a time guessed from elsewhere. Absent only on a summary built by
|
|
52
56
|
* something other than a change-request row (test doubles).
|
|
@@ -195,38 +199,6 @@ export interface PullRequestFile {
|
|
|
195
199
|
rawUrl: string;
|
|
196
200
|
}
|
|
197
201
|
|
|
198
|
-
/**
|
|
199
|
-
* One comment in the Bevel-owned PR discussion. GitHub never sees these —
|
|
200
|
-
* they live only in our DB, attributed to the authenticated user. Shape
|
|
201
|
-
* encodes three comment kinds:
|
|
202
|
-
*
|
|
203
|
-
* General → path undefined, line undefined
|
|
204
|
-
* File-level → path set, line undefined
|
|
205
|
-
* Inline (line) → path set, line set
|
|
206
|
-
*
|
|
207
|
-
* Threading: `parentId` points at the root of the thread; top-level comments
|
|
208
|
-
* have it undefined.
|
|
209
|
-
*/
|
|
210
|
-
export interface PrReviewComment {
|
|
211
|
-
id: string;
|
|
212
|
-
author: { email: string; name: string };
|
|
213
|
-
body: string;
|
|
214
|
-
path?: string;
|
|
215
|
-
line?: number;
|
|
216
|
-
/** The head SHA the comment was authored against — lets the UI grey out stale inline pins. */
|
|
217
|
-
headSha: string;
|
|
218
|
-
parentId?: string;
|
|
219
|
-
createdAt: string;
|
|
220
|
-
updatedAt?: string;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export interface PostPrCommentInput {
|
|
224
|
-
body: string;
|
|
225
|
-
path?: string;
|
|
226
|
-
line?: number;
|
|
227
|
-
parentId?: string;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
202
|
/**
|
|
231
203
|
* One owner's approval on one file. Stored straight from the
|
|
232
204
|
* `pr_file_approvals` row, with derived flags the UI needs.
|
|
@@ -304,15 +276,26 @@ export interface FileApprovalState {
|
|
|
304
276
|
|
|
305
277
|
/**
|
|
306
278
|
* Full read-only PR detail for the in-app viewer. Extends the summary with
|
|
307
|
-
* body, SHAs
|
|
279
|
+
* body, SHAs and file list. Later phases add
|
|
308
280
|
* `approvals` and merge-gate fields — this shape grows incrementally.
|
|
309
281
|
*/
|
|
310
282
|
export interface PullRequestDetail extends PullRequestSummary {
|
|
283
|
+
/**
|
|
284
|
+
* The request's description — the whole body, exactly as its author (or a
|
|
285
|
+
* later edit) left it. Hexis writes nothing of its own into it: who must
|
|
286
|
+
* approve each file is resolved live and answered per file in `approvals`,
|
|
287
|
+
* and an access request's level and note are `accessRequest`'s.
|
|
288
|
+
*/
|
|
311
289
|
body: string;
|
|
290
|
+
/**
|
|
291
|
+
* Set on a request the access-request flow opened: the level the person
|
|
292
|
+
* asked for, and their note when they wrote one. Absent on every other
|
|
293
|
+
* request.
|
|
294
|
+
*/
|
|
295
|
+
accessRequest?: { level: AccessRequestLevel; note?: string };
|
|
312
296
|
headSha: string;
|
|
313
297
|
baseSha: string;
|
|
314
298
|
files: PullRequestFile[];
|
|
315
|
-
comments: PrReviewComment[];
|
|
316
299
|
/**
|
|
317
300
|
* One entry per file in `files`, same order. Empty when the caller had no
|
|
318
301
|
* resolvable workspace to do the owner lookup against.
|
|
@@ -426,8 +409,63 @@ export interface PullRequestDetail extends PullRequestSummary {
|
|
|
426
409
|
* `DELETE /api/workflow/change-requests/:number` re-checks server-side.
|
|
427
410
|
*/
|
|
428
411
|
viewerCanDelete: boolean;
|
|
412
|
+
/**
|
|
413
|
+
* True iff the viewer may change the request's title and description: the
|
|
414
|
+
* request is open AND the viewer is its author or someone who may merge it
|
|
415
|
+
* (an admin, or the holder of write on every changed file) — exactly
|
|
416
|
+
* `viewerCanCancel`'s grants, since what is asked belongs to the same people
|
|
417
|
+
* who may close it. A UX hint — `PATCH /api/workflow/change-requests/:number`
|
|
418
|
+
* re-checks server-side.
|
|
419
|
+
*/
|
|
420
|
+
viewerCanEdit: boolean;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Body of `PATCH /api/workflow/change-requests/:number`. At least one field;
|
|
425
|
+
* an absent field keeps its current text. `description` replaces the
|
|
426
|
+
* request's description whole — the body is nothing but the description.
|
|
427
|
+
* `appendDescription` instead adds a paragraph after the description as the
|
|
428
|
+
* server holds it at the moment of the write, so two appends racing each
|
|
429
|
+
* other both land (never together with `description`). A title is at most
|
|
430
|
+
* {@link CHANGE_REQUEST_TITLE_MAX} characters and a description, after an
|
|
431
|
+
* append as much as after a replacement, at most
|
|
432
|
+
* {@link CHANGE_REQUEST_DESCRIPTION_MAX}.
|
|
433
|
+
*
|
|
434
|
+
* A union of the allowed shapes, so a client cannot build `{}` or a
|
|
435
|
+
* `description` together with `appendDescription`. The server reads the
|
|
436
|
+
* body as untrusted JSON all the same — as {@link UpdateChangeRequestFields}
|
|
437
|
+
* — and answers any other shape with a worded 400.
|
|
438
|
+
*/
|
|
439
|
+
export type UpdateChangeRequestInput =
|
|
440
|
+
| { title: string; description?: string; appendDescription?: never }
|
|
441
|
+
| { title?: string; description: string; appendDescription?: never }
|
|
442
|
+
| { title?: string; description?: never; appendDescription: string };
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* The fields of a `PATCH /api/workflow/change-requests/:number` body as the
|
|
446
|
+
* server receives them — any combination, since the body is untrusted JSON.
|
|
447
|
+
* `WorkflowService.updateChangeRequest` checks the shape and refuses what
|
|
448
|
+
* {@link UpdateChangeRequestInput} rules out with a worded 400.
|
|
449
|
+
*/
|
|
450
|
+
export interface UpdateChangeRequestFields {
|
|
451
|
+
title?: string;
|
|
452
|
+
description?: string;
|
|
453
|
+
appendDescription?: string;
|
|
429
454
|
}
|
|
430
455
|
|
|
456
|
+
/** Longest title a change request may carry — the route and the agent tool alike. */
|
|
457
|
+
export const CHANGE_REQUEST_TITLE_MAX = 256;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Longest description a change request may carry, in characters — on
|
|
461
|
+
* opening, on a replacement and on what an append leaves, for the routes and
|
|
462
|
+
* the agent tools alike. The body is decrypted by every listing and every
|
|
463
|
+
* detail read, and the propose flow appends a note on each later round, so
|
|
464
|
+
* without a ceiling a request's body grows for as long as it is open. The
|
|
465
|
+
* same ceiling comments had.
|
|
466
|
+
*/
|
|
467
|
+
export const CHANGE_REQUEST_DESCRIPTION_MAX = 64_000;
|
|
468
|
+
|
|
431
469
|
/**
|
|
432
470
|
* Result of a successful merge via the in-app gate. `sha` is the merge commit
|
|
433
471
|
* GitHub produced; the UI uses it to link to the resulting commit and to
|
package/src/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './git/pr.types.js';
|
|
|
25
25
|
export * from './git/protected.js';
|
|
26
26
|
export * from './git/branchAuthor.js';
|
|
27
27
|
export * from './git/review.types.js';
|
|
28
|
+
export * from './git/legacy-change-request-body.js';
|
|
28
29
|
|
|
29
30
|
// Workflow — abstraction layer over git/PR/review-workflow. See PLAN.md.
|
|
30
31
|
export * from './workflow/types.js';
|
package/src/workflow/events.ts
CHANGED
|
@@ -101,6 +101,24 @@ export interface FsTreeChangedEvent {
|
|
|
101
101
|
branch: string;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* A document's text could not be extracted, just now: the parser refused it,
|
|
106
|
+
* or the extraction outlived its budget. Emitted once per FRESH failure —
|
|
107
|
+
* never for one answered from memory — so a person looking at the file's row
|
|
108
|
+
* in the explorer is told in place, and nothing is kept for later.
|
|
109
|
+
*
|
|
110
|
+
* `reason` follows "Could not be read:" in the explorer's notice. It names the
|
|
111
|
+
* file and quotes the parser; like every kind that names a path on a
|
|
112
|
+
* workspace, it is delivered only to sessions whose person may read `path`
|
|
113
|
+
* (the events route's delivery rule, judged by the access rules).
|
|
114
|
+
*/
|
|
115
|
+
export interface DocumentUnreadableEvent {
|
|
116
|
+
kind: 'document-unreadable';
|
|
117
|
+
workspaceId: string;
|
|
118
|
+
path: string;
|
|
119
|
+
reason: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
104
122
|
/**
|
|
105
123
|
* A commit landed locally but could not be pushed to the remote.
|
|
106
124
|
*
|
|
@@ -201,6 +219,12 @@ export interface AgentToolCallEvent {
|
|
|
201
219
|
|
|
202
220
|
// ── Global ───────────────────────────────────────────────────────────────────
|
|
203
221
|
|
|
222
|
+
/**
|
|
223
|
+
* A change request was opened. Reaches EVERY session, so it says only that a
|
|
224
|
+
* request exists: its number, its branches and who opened it — no title and
|
|
225
|
+
* no paths, which a person may not be allowed to read. A reader fetches the
|
|
226
|
+
* request, and sees of it what the request routes show them.
|
|
227
|
+
*/
|
|
204
228
|
export interface ChangeRequestOpenedEvent {
|
|
205
229
|
kind: 'change-request-opened';
|
|
206
230
|
number: number;
|
|
@@ -208,7 +232,6 @@ export interface ChangeRequestOpenedEvent {
|
|
|
208
232
|
target: string;
|
|
209
233
|
/** Hash of the author's email (matches the marker in the CR body); null when unattributable. */
|
|
210
234
|
authorIdHash: string | null;
|
|
211
|
-
title: string;
|
|
212
235
|
}
|
|
213
236
|
|
|
214
237
|
export interface ChangeRequestMergedEvent {
|
|
@@ -221,6 +244,16 @@ export interface ChangeRequestRejectedEvent {
|
|
|
221
244
|
number: number;
|
|
222
245
|
}
|
|
223
246
|
|
|
247
|
+
/**
|
|
248
|
+
* A request's title or description was edited. Carries no text: every
|
|
249
|
+
* viewer re-reads the request through the list and detail endpoints it
|
|
250
|
+
* already uses, which apply its own read rules.
|
|
251
|
+
*/
|
|
252
|
+
export interface ChangeRequestEditedEvent {
|
|
253
|
+
kind: 'change-request-edited';
|
|
254
|
+
number: number;
|
|
255
|
+
}
|
|
256
|
+
|
|
224
257
|
/**
|
|
225
258
|
* An apply did NOT land, announced to EVERY session — the counterpart of the
|
|
226
259
|
* user-scoped `change-request-merge-failed` below, which only the clicker gets.
|
|
@@ -282,7 +315,14 @@ export interface ChangeRequestMergeFailedEvent {
|
|
|
282
315
|
export interface ApprovalChangedEvent {
|
|
283
316
|
kind: 'approval-changed';
|
|
284
317
|
number: number;
|
|
318
|
+
/** The approved file, KB-repo-relative. */
|
|
285
319
|
path: string;
|
|
320
|
+
/**
|
|
321
|
+
* The request's target branch: the event names a path, and whether a
|
|
322
|
+
* session's person may hear of it is judged by their read access to that
|
|
323
|
+
* path at the target — the same rule the request's own detail is scoped by.
|
|
324
|
+
*/
|
|
325
|
+
targetBranch: string;
|
|
286
326
|
approverUserId: string;
|
|
287
327
|
change: 'added' | 'removed';
|
|
288
328
|
}
|
|
@@ -341,6 +381,7 @@ export type WorkflowEventPayload =
|
|
|
341
381
|
| LockAcquiredEvent
|
|
342
382
|
| LockReleasedEvent
|
|
343
383
|
| FsTreeChangedEvent
|
|
384
|
+
| DocumentUnreadableEvent
|
|
344
385
|
| GitSyncFailedEvent
|
|
345
386
|
| GitSyncRecoveredEvent
|
|
346
387
|
| BranchSwitchedEvent
|
|
@@ -349,6 +390,7 @@ export type WorkflowEventPayload =
|
|
|
349
390
|
| ChangeRequestOpenedEvent
|
|
350
391
|
| ChangeRequestMergedEvent
|
|
351
392
|
| ChangeRequestRejectedEvent
|
|
393
|
+
| ChangeRequestEditedEvent
|
|
352
394
|
| ChangeRequestMergeFailedEvent
|
|
353
395
|
| ChangeRequestApplyFailedEvent
|
|
354
396
|
| ApprovalChangedEvent
|
|
@@ -366,6 +408,7 @@ export function isWorkspaceScoped(
|
|
|
366
408
|
e.kind === 'lock-acquired' ||
|
|
367
409
|
e.kind === 'lock-released' ||
|
|
368
410
|
e.kind === 'fs-tree-changed' ||
|
|
411
|
+
e.kind === 'document-unreadable' ||
|
|
369
412
|
e.kind === 'git-sync-failed' ||
|
|
370
413
|
e.kind === 'git-sync-recovered'
|
|
371
414
|
);
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import type { AuthUser } from '../auth/types.js';
|
|
21
|
-
import type { ChangeRequestApplyFailureKind } from '../git/pr.types.js';
|
|
21
|
+
import type { ChangeRequestApplyFailureKind, UpdateChangeRequestFields } from '../git/pr.types.js';
|
|
22
22
|
import type {
|
|
23
23
|
AcquireLockResult,
|
|
24
24
|
Branch,
|
|
@@ -28,7 +28,6 @@ import type {
|
|
|
28
28
|
Change,
|
|
29
29
|
ChangeInput,
|
|
30
30
|
ChangeRequest,
|
|
31
|
-
ChangeRequestComment,
|
|
32
31
|
ChangeRequestDetail,
|
|
33
32
|
ChangeRequestUpdateResult,
|
|
34
33
|
ChangeRequestState,
|
|
@@ -42,7 +41,6 @@ import type {
|
|
|
42
41
|
MergeBranchOutcome,
|
|
43
42
|
MergeChangeRequestOutcome,
|
|
44
43
|
OpenChangeRequestInput,
|
|
45
|
-
PostChangeRequestCommentInput,
|
|
46
44
|
UpdateBranchOutcome,
|
|
47
45
|
} from './types.js';
|
|
48
46
|
import type { MergeResolution } from '../git/types.js';
|
|
@@ -554,17 +552,6 @@ export interface IWorkflowService {
|
|
|
554
552
|
number: number,
|
|
555
553
|
): Promise<ChangeRequestUpdateResult>;
|
|
556
554
|
|
|
557
|
-
// Comments
|
|
558
|
-
listComments(number: number): Promise<ChangeRequestComment[]>;
|
|
559
|
-
postComment(
|
|
560
|
-
number: number,
|
|
561
|
-
user: AuthUser,
|
|
562
|
-
input: PostChangeRequestCommentInput,
|
|
563
|
-
headSha: string,
|
|
564
|
-
): Promise<ChangeRequestComment>;
|
|
565
|
-
editComment(commentId: string, number: number, user: AuthUser, body: string): Promise<ChangeRequestComment>;
|
|
566
|
-
deleteComment(commentId: string, number: number, user: AuthUser): Promise<void>;
|
|
567
|
-
|
|
568
555
|
// Approvals — per-file, tied to the file's current change. New changes
|
|
569
556
|
// invalidate approvals on the affected file.
|
|
570
557
|
approveFile(
|
|
@@ -644,6 +631,18 @@ export interface IWorkflowService {
|
|
|
644
631
|
*/
|
|
645
632
|
deleteChangeRequest(number: number, user: AuthUser): Promise<void>;
|
|
646
633
|
|
|
634
|
+
/**
|
|
635
|
+
* Change an OPEN request's title and/or description. Its author, an admin,
|
|
636
|
+
* or the holder of write on every changed file — the people who may close
|
|
637
|
+
* it; anyone else gets a worded 403, and a merged or closed request a
|
|
638
|
+
* worded 409.
|
|
639
|
+
*/
|
|
640
|
+
updateChangeRequest(
|
|
641
|
+
number: number,
|
|
642
|
+
user: AuthUser,
|
|
643
|
+
input: UpdateChangeRequestFields,
|
|
644
|
+
): Promise<ChangeRequest>;
|
|
645
|
+
|
|
647
646
|
/**
|
|
648
647
|
* Reject a change request without merging. Authorized for the author or
|
|
649
648
|
* for users with write permission to every changed file on the target
|
package/src/workflow/types.ts
CHANGED
|
@@ -22,14 +22,13 @@ import type {
|
|
|
22
22
|
WorkingTreeStatus,
|
|
23
23
|
} from '../git/types.js';
|
|
24
24
|
import type {
|
|
25
|
+
AccessRequestLevel,
|
|
25
26
|
CancelPrResult,
|
|
26
27
|
FileApprovalState,
|
|
27
28
|
MergePrResult,
|
|
28
29
|
PullRequestDetail,
|
|
29
30
|
PullRequestState,
|
|
30
31
|
PullRequestSummary,
|
|
31
|
-
PostPrCommentInput,
|
|
32
|
-
PrReviewComment,
|
|
33
32
|
PullRequestFile,
|
|
34
33
|
} from '../git/pr.types.js';
|
|
35
34
|
|
|
@@ -147,8 +146,6 @@ export type ChangedFile = PullRequestFile;
|
|
|
147
146
|
export type FileApproval = FileApprovalState;
|
|
148
147
|
export type MergeChangeRequestResult = MergePrResult;
|
|
149
148
|
export type CancelChangeRequestResult = CancelPrResult;
|
|
150
|
-
export type ChangeRequestComment = PrReviewComment;
|
|
151
|
-
export type PostChangeRequestCommentInput = PostPrCommentInput;
|
|
152
149
|
|
|
153
150
|
/**
|
|
154
151
|
* One open change request proposing files under a folder, as a folder delete
|
|
@@ -189,16 +186,23 @@ export interface FolderChangeRequestRemoval {
|
|
|
189
186
|
* `targetBranch` into `sourceBranch` as part of opening, so callers don't
|
|
190
187
|
* pass a head SHA — the workflow resolves the head itself.
|
|
191
188
|
*
|
|
192
|
-
* `title` + `description` are the change request's metadata
|
|
193
|
-
* is
|
|
194
|
-
*
|
|
195
|
-
* underlying GitHub PR is created.
|
|
189
|
+
* `title` + `description` are the change request's metadata. The description
|
|
190
|
+
* is stored exactly as given and IS the request's body: Hexis appends nothing
|
|
191
|
+
* of its own to it.
|
|
196
192
|
*/
|
|
197
193
|
export interface OpenChangeRequestInput {
|
|
198
194
|
sourceBranch: string;
|
|
199
195
|
targetBranch: string;
|
|
200
196
|
title: string;
|
|
201
197
|
description?: string;
|
|
198
|
+
/**
|
|
199
|
+
* The access-request flow's own facts about the request it opens: the level
|
|
200
|
+
* asked for and the person's note, kept on the request's row rather than in
|
|
201
|
+
* its prose. Only that flow sets it — the open route and the agent's
|
|
202
|
+
* `open_change_request` build their input field by field and never forward
|
|
203
|
+
* it.
|
|
204
|
+
*/
|
|
205
|
+
accessRequest?: { level: AccessRequestLevel; note?: string };
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
/**
|