@bevel-software/platform-shared 0.25.2 → 0.27.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.
Files changed (38) hide show
  1. package/dist/git/pr.types.d.ts +101 -0
  2. package/dist/git/pr.types.d.ts.map +1 -1
  3. package/dist/git/types.d.ts +76 -2
  4. package/dist/git/types.d.ts.map +1 -1
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/workflow/events.d.ts +24 -1
  10. package/dist/workflow/events.d.ts.map +1 -1
  11. package/dist/workflow/events.js +1 -0
  12. package/dist/workflow/events.js.map +1 -1
  13. package/dist/workflow/interface.d.ts +42 -1
  14. package/dist/workflow/interface.d.ts.map +1 -1
  15. package/dist/workflow/types.d.ts +57 -3
  16. package/dist/workflow/types.d.ts.map +1 -1
  17. package/dist/workspace/kb-layout.d.ts +40 -101
  18. package/dist/workspace/kb-layout.d.ts.map +1 -1
  19. package/dist/workspace/kb-layout.js +40 -159
  20. package/dist/workspace/kb-layout.js.map +1 -1
  21. package/dist/workspace/md-links.d.ts +138 -0
  22. package/dist/workspace/md-links.d.ts.map +1 -0
  23. package/dist/workspace/md-links.js +703 -0
  24. package/dist/workspace/md-links.js.map +1 -0
  25. package/dist/workspace/platform-files.d.ts +25 -24
  26. package/dist/workspace/platform-files.d.ts.map +1 -1
  27. package/dist/workspace/platform-files.js +41 -25
  28. package/dist/workspace/platform-files.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/git/pr.types.ts +99 -0
  31. package/src/git/types.ts +80 -2
  32. package/src/index.ts +1 -0
  33. package/src/workflow/events.ts +26 -0
  34. package/src/workflow/interface.ts +42 -0
  35. package/src/workflow/types.ts +48 -4
  36. package/src/workspace/kb-layout.ts +39 -172
  37. package/src/workspace/md-links.ts +757 -0
  38. package/src/workspace/platform-files.ts +44 -26
@@ -0,0 +1 @@
1
+ {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;AAC3E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAY,EACZ,IAA2B;AAC3B,6GAA6G;AAC7G,UAA4B,mBAAmB,CAAC,IAAI,CAAC;IAErD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,OAAO,EAAE,CAAC;QAC7C,iEAAiE;QACjE,sEAAsE;QACtE,wEAAwE;QACxE,4EAA4E;QAC5E,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QACxG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC;YAAE,SAAS;QAC7F,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC;QACxD,MAAM,KAAK,GAAG,aAAa,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QACvG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;YAAE,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -2,31 +2,28 @@ import { type KbLayout } from './kb-layout.js';
2
2
  /**
3
3
  * The files the platform reads as configuration, not content. `access.md`
4
4
  * governs the folder it sits in and `.bevelignore` layers like `.gitignore`,
5
- * so both count at any depth; `roles.yaml` and the agent guide are read from
6
- * the repository root only, so a nested file of either name is ordinary
7
- * content. Moving one changes what the platform enforces, so moves refuse them.
5
+ * so both count at any depth; `roles.yaml` is read from the repository root
6
+ * only, so a nested file of that name is ordinary content. Moving one changes
7
+ * what the platform enforces, so moves refuse them.
8
8
  *
9
- * A FUNCTION OF THE LAYOUT, not a constant, and that is the whole of the
10
- * configurable-guide change on this side: the guide's name is a deployment
11
- * setting, so the fourth platform file is `HEXIS.md` on one deployment and
12
- * `AGENTS.md` on the next — and on the first, a root `AGENTS.md` is the
13
- * CUSTOMER'S own conventions file, which has to move and delete like any page.
14
- * Every gate asks this with the layout it serves rather than reading a list
15
- * captured at module load.
16
- */
17
- export declare function platformFileNames(layout: KbLayout): readonly string[];
18
- /**
19
- * The platform file names under the DEFAULT layout — what they were before the
20
- * guide could be renamed. Kept for callers that want the default answer rather
21
- * than this deployment's; anything judging a real path asks
22
- * {@link platformFileNames}, which knows what this deployment called its guide.
9
+ * The agent guide is NOT among them. It was, while the platform wrote it to
10
+ * the repository root; the backend serves it from code now (core-backend's
11
+ * `modules/agent-guide`), and a root `AGENTS.md` — or a file under whatever
12
+ * name a deployment once gave the guide — is the organisation's own
13
+ * conventions page, which moves and deletes like any other.
14
+ *
15
+ * Still a FUNCTION OF THE LAYOUT, so every gate asks the question the same
16
+ * way it asks the others, and a file the layout makes a platform file again
17
+ * one day needs no caller to change.
23
18
  */
19
+ export declare function platformFileNames(_layout: KbLayout): readonly string[];
20
+ /** The platform file names under the DEFAULT layout — the same three on every deployment. */
24
21
  export declare const PLATFORM_FILE_NAMES: readonly string[];
25
22
  /**
26
23
  * The platform files split by the DEPTH they count at, which is the half of
27
24
  * {@link isPlatformFile} that a name alone does not tell you: `access.md` and
28
- * `.bevelignore` are platform files in any folder, `roles.yaml` and the agent
29
- * guide only in the repository root.
25
+ * `.bevelignore` are platform files in any folder, `roles.yaml` only in the
26
+ * repository root.
30
27
  *
31
28
  * Exported because the agent-facing rules state that split in prose, and a
32
29
  * prose list written by hand drifts from the predicate that actually refuses
@@ -57,7 +54,7 @@ export declare function platformFileCreationRefusal(pathOrName: string): string;
57
54
  /**
58
55
  * The sentence an UPLOAD is refused with when one of its paths would land a
59
56
  * platform file — a zip carrying an `access.md`, a `.bevelignore`, a
60
- * `roles.yaml` or the agent guide, or a single file sent under one of those
57
+ * `roles.yaml`, or a single file sent under one of those
61
58
  * names.
62
59
  *
63
60
  * Its own sentence rather than the move's, because the thing being kept out is
@@ -80,18 +77,22 @@ export declare function isPlatformFolder(repoRelativeDir: string, layout: KbLayo
80
77
  export declare function platformFolderRefusal(repoRelativeDir: string): string;
81
78
  /**
82
79
  * Whether the platform file at `repoRelativePath` sits directly in the
83
- * repository root — the copy every one of the four is read from there, and so
80
+ * repository root — the copy every one of the three is read from there, and so
84
81
  * never the misplaced one: it is the copy a restore puts back. A nested
85
82
  * `access.md` or `.bevelignore` is a platform file too, but it layers on top
86
83
  * of the root's rather than standing in for it, which is why moving the
87
84
  * ROOT's copy into a folder is a move out and not a restore.
88
85
  */
89
86
  export declare function isRootPlatformFile(repoRelativePath: string, layout: KbLayout): boolean;
87
+ /** Whether `repoRelativePath` is one of the files no surface deletes (see above). Exact spelling. */
88
+ export declare function isRepositoryOwnFile(repoRelativePath: string, layout: KbLayout): boolean;
89
+ /** The one sentence every surface refuses a delete of the repository's own file with. */
90
+ export declare function repositoryOwnFileDeleteRefusal(pathOrName: string): string;
90
91
  /**
91
92
  * The place a misplaced platform file is allowed to be put back, when
92
93
  * `repoRelativeDestination` names one, and null when it does not.
93
94
  *
94
- * `roles.yaml` and the agent guide are read from the repository root and
95
+ * `roles.yaml` is read from the repository root and
95
96
  * nowhere else, so their one required location is the root. A nested `.bevelignore` is
96
97
  * read too (it layers, see `BevelIgnoreStack`), yet a restore of one lands at
97
98
  * the root only — a deliberate narrowing of the exception, not a claim about
@@ -120,8 +121,8 @@ export declare function platformRestoreDestination(repoRelativeDestination: stri
120
121
  * Three things make the shape, and all three are about the move rather than
121
122
  * about the source's current standing:
122
123
  *
123
- * - the source is NAMED like a platform file. A nested `roles.yaml`, or a
124
- * nested copy of the agent guide, is ordinary content where it sits
124
+ * - the source is NAMED like a platform file. A nested `roles.yaml` is
125
+ * ordinary content where it sits
125
126
  * (`isPlatformFile` says so, and moving it needs no exception), but it is
126
127
  * still the copy a restore carries back to the root — judging the shape on
127
128
  * `isPlatformFile` would skip the exception for exactly the two files the
@@ -1 +1 @@
1
- {"version":3,"file":"platform-files.d.ts","sourceRoot":"","sources":["../../src/workspace/platform-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,MAAM,EAAE,CAErE;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAEhD,CAAC;AAKF;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG;IAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAMnH;AAwBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAKlF;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAInF;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,MAAM,GAAG,MAA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,36 +1,34 @@
1
- import { DEFAULT_KB_LAYOUT, FIXED_PLATFORM_FILE_NAMES, agentsFileOf, reservedRootDirNames, } from './kb-layout.js';
1
+ import { DEFAULT_KB_LAYOUT, FIXED_PLATFORM_FILE_NAMES, reservedRootDirNames, } from './kb-layout.js';
2
2
  /**
3
3
  * The files the platform reads as configuration, not content. `access.md`
4
4
  * governs the folder it sits in and `.bevelignore` layers like `.gitignore`,
5
- * so both count at any depth; `roles.yaml` and the agent guide are read from
6
- * the repository root only, so a nested file of either name is ordinary
7
- * content. Moving one changes what the platform enforces, so moves refuse them.
5
+ * so both count at any depth; `roles.yaml` is read from the repository root
6
+ * only, so a nested file of that name is ordinary content. Moving one changes
7
+ * what the platform enforces, so moves refuse them.
8
8
  *
9
- * A FUNCTION OF THE LAYOUT, not a constant, and that is the whole of the
10
- * configurable-guide change on this side: the guide's name is a deployment
11
- * setting, so the fourth platform file is `HEXIS.md` on one deployment and
12
- * `AGENTS.md` on the next — and on the first, a root `AGENTS.md` is the
13
- * CUSTOMER'S own conventions file, which has to move and delete like any page.
14
- * Every gate asks this with the layout it serves rather than reading a list
15
- * captured at module load.
9
+ * The agent guide is NOT among them. It was, while the platform wrote it to
10
+ * the repository root; the backend serves it from code now (core-backend's
11
+ * `modules/agent-guide`), and a root `AGENTS.md` — or a file under whatever
12
+ * name a deployment once gave the guide — is the organisation's own
13
+ * conventions page, which moves and deletes like any other.
14
+ *
15
+ * Still a FUNCTION OF THE LAYOUT, so every gate asks the question the same
16
+ * way it asks the others, and a file the layout makes a platform file again
17
+ * one day needs no caller to change.
16
18
  */
17
- export function platformFileNames(layout) {
18
- return [...FIXED_PLATFORM_FILE_NAMES, agentsFileOf(layout)];
19
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- the layout is the question's shape, kept for every caller (see above)
20
+ export function platformFileNames(_layout) {
21
+ return [...FIXED_PLATFORM_FILE_NAMES];
19
22
  }
20
- /**
21
- * The platform file names under the DEFAULT layout — what they were before the
22
- * guide could be renamed. Kept for callers that want the default answer rather
23
- * than this deployment's; anything judging a real path asks
24
- * {@link platformFileNames}, which knows what this deployment called its guide.
25
- */
23
+ /** The platform file names under the DEFAULT layout — the same three on every deployment. */
26
24
  export const PLATFORM_FILE_NAMES = Object.freeze(platformFileNames(DEFAULT_KB_LAYOUT));
27
25
  /** The platform files that are read wherever they sit, not only at the root. */
28
26
  const PLATFORM_FILES_AT_ANY_DEPTH = new Set(['access.md', '.bevelignore']);
29
27
  /**
30
28
  * The platform files split by the DEPTH they count at, which is the half of
31
29
  * {@link isPlatformFile} that a name alone does not tell you: `access.md` and
32
- * `.bevelignore` are platform files in any folder, `roles.yaml` and the agent
33
- * guide only in the repository root.
30
+ * `.bevelignore` are platform files in any folder, `roles.yaml` only in the
31
+ * repository root.
34
32
  *
35
33
  * Exported because the agent-facing rules state that split in prose, and a
36
34
  * prose list written by hand drifts from the predicate that actually refuses
@@ -91,7 +89,7 @@ export function platformFileCreationRefusal(pathOrName) {
91
89
  /**
92
90
  * The sentence an UPLOAD is refused with when one of its paths would land a
93
91
  * platform file — a zip carrying an `access.md`, a `.bevelignore`, a
94
- * `roles.yaml` or the agent guide, or a single file sent under one of those
92
+ * `roles.yaml`, or a single file sent under one of those
95
93
  * names.
96
94
  *
97
95
  * Its own sentence rather than the move's, because the thing being kept out is
@@ -127,7 +125,7 @@ export function platformFolderRefusal(repoRelativeDir) {
127
125
  }
128
126
  /**
129
127
  * Whether the platform file at `repoRelativePath` sits directly in the
130
- * repository root — the copy every one of the four is read from there, and so
128
+ * repository root — the copy every one of the three is read from there, and so
131
129
  * never the misplaced one: it is the copy a restore puts back. A nested
132
130
  * `access.md` or `.bevelignore` is a platform file too, but it layers on top
133
131
  * of the root's rather than standing in for it, which is why moving the
@@ -136,6 +134,24 @@ export function platformFolderRefusal(repoRelativeDir) {
136
134
  export function isRootPlatformFile(repoRelativePath, layout) {
137
135
  return platformFiles(layout).has(normalize(repoRelativePath));
138
136
  }
137
+ /**
138
+ * The platform files that govern the WHOLE repository: the root's `access.md`,
139
+ * which every folder without its own falls back to, and `roles.yaml`, which
140
+ * says what the roles are. Deleting either leaves the repository ungoverned,
141
+ * so no surface deletes them — not the agent tools, not the app. A nested
142
+ * `access.md` is not among them: it narrows its own folder, and whoever may
143
+ * write it may delete it, which hands the folder back to its parent's rules.
144
+ * `.bevelignore` is not among them either; its delete rules are untouched.
145
+ */
146
+ const REPOSITORY_OWN_FILES = new Set(['access.md', 'roles.yaml']);
147
+ /** Whether `repoRelativePath` is one of the files no surface deletes (see above). Exact spelling. */
148
+ export function isRepositoryOwnFile(repoRelativePath, layout) {
149
+ return isRootPlatformFile(repoRelativePath, layout) && REPOSITORY_OWN_FILES.has(normalize(repoRelativePath));
150
+ }
151
+ /** The one sentence every surface refuses a delete of the repository's own file with. */
152
+ export function repositoryOwnFileDeleteRefusal(pathOrName) {
153
+ return `${baseName(pathOrName)} is the repository's own file and cannot be deleted.`;
154
+ }
139
155
  export function platformRestoreDestination(repoRelativeDestination, layout) {
140
156
  const norm = normalize(repoRelativeDestination);
141
157
  if (hasTraversal(norm))
@@ -158,8 +174,8 @@ export function platformRestoreDestination(repoRelativeDestination, layout) {
158
174
  * Three things make the shape, and all three are about the move rather than
159
175
  * about the source's current standing:
160
176
  *
161
- * - the source is NAMED like a platform file. A nested `roles.yaml`, or a
162
- * nested copy of the agent guide, is ordinary content where it sits
177
+ * - the source is NAMED like a platform file. A nested `roles.yaml` is
178
+ * ordinary content where it sits
163
179
  * (`isPlatformFile` says so, and moving it needs no exception), but it is
164
180
  * still the copy a restore carries back to the root — judging the shape on
165
181
  * `isPlatformFile` would skip the exception for exactly the two files the
@@ -1 +1 @@
1
- {"version":3,"file":"platform-files.js","sourceRoot":"","sources":["../../src/workspace/platform-files.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,YAAY,EACZ,oBAAoB,GAErB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AAC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AC;AACvD,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,sBAAsB,CACpC,kBAA0B,EAC1B,uBAA+B,EAC/B,MAAgB;IAEhB,IAAI,YAAY,CAAC,kBAAkB,CAAC;QAAE,OAAO,KAAK,CAAC;IACnD,MAAM,IAAI,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAC1C,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACnD,IAAI,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACjE,MAAM,MAAM,GAAG,0BAA0B,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;IAC3E,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AACjD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bevel-software/platform-shared",
3
- "version": "0.25.2",
3
+ "version": "0.27.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",
@@ -41,8 +41,33 @@ export interface PullRequestSummary {
41
41
  base: string;
42
42
  state: PullRequestState;
43
43
  createdAt: string;
44
+ /**
45
+ * The latest moment the change-request ROW records: the latest of its
46
+ * creation time, its `updated_at` stamp (written when the row itself
47
+ * changes — a merge, a close, a recorded apply failure) and its close time.
48
+ * GitHub's `updated_at` on a pull request means "when anything about it
49
+ * last changed"; comments and approvals carry their own times here and do
50
+ * not move this one, so this is as close as the row can honestly answer —
51
+ * never a time guessed from elsewhere. Absent only on a summary built by
52
+ * something other than a change-request row (test doubles).
53
+ */
54
+ updatedAt?: string;
44
55
  /** Relative paths within `knowledge-base/`. Empty if not yet computed. */
45
56
  touchedNodePaths: string[];
57
+ /**
58
+ * The same changed files as {@link touchedNodePaths}, paired with the path
59
+ * each was renamed from — what a READ gate has to decide over, since
60
+ * `touchedNodePaths` reports a rename under its new name alone and so cannot
61
+ * say that a readable-looking file came out of a folder its reader cannot
62
+ * open.
63
+ *
64
+ * Absent when no summary builder filled it (a test double, a caller that
65
+ * constructs a summary by hand). A read gate must treat absence as "nothing
66
+ * proven" rather than falling back to `touchedNodePaths` — that fallback is
67
+ * precisely the disagreement between a list and a detail this field exists to
68
+ * remove, and it would come back silently.
69
+ */
70
+ touchedNodeFiles?: ChangedPathPair[];
46
71
  review: PullRequestReviewStatus;
47
72
  /**
48
73
  * Link to the change request: absolute (`<public frontend address>/change-requests/<number>`)
@@ -79,6 +104,69 @@ export interface ChangeRequestApplyFailure {
79
104
  byName: string;
80
105
  }
81
106
 
107
+ /**
108
+ * One changed file of a change request, named on both sides: where it is now
109
+ * and, for a rename, where it came from.
110
+ *
111
+ * The minimum a READ gate needs. A plain path list says a rename's new name and
112
+ * (with `forAccessCheck`) its old one, but not that the two are the same file —
113
+ * and the diff of a rename shows the old side's content, so a file moved out of
114
+ * a folder its reader cannot open must not be offered under its new name
115
+ * either. Both the list of change requests and the detail of one decide
116
+ * readability over these, so the two cannot disagree about whether a request is
117
+ * visible.
118
+ */
119
+ export interface ChangedPathPair {
120
+ path: string;
121
+ previousPath?: string;
122
+ }
123
+
124
+ /**
125
+ * An APPLIED change request, named by BOTH the commit its row records and the
126
+ * number that row carries — because reading the commit's own change is only
127
+ * sound if the commit really is that request's merge commit, and the number is
128
+ * what proves it (the merge commit's subject ends with `(#<number>)`).
129
+ *
130
+ * The pair travels together so no read can ask for a commit without saying which
131
+ * request it must belong to. `merged_sha` is not reliably a commit the request
132
+ * created: a merge with nothing to merge used to record the TARGET TIP, which in
133
+ * a deployment that lands everything through change requests is usually ANOTHER
134
+ * request's merge commit.
135
+ */
136
+ export interface AppliedChangeRef {
137
+ /** The change request's number, as its merge commit's subject names it. */
138
+ number: number;
139
+ /** The `merged_sha` the row records. */
140
+ mergeSha: string;
141
+ /**
142
+ * The request's stored title, which lets a merge commit written by an
143
+ * earlier release — the title not yet flattened, so a blank line in it put
144
+ * the number after git's subject — be recognised as the request's own.
145
+ */
146
+ title?: string;
147
+ }
148
+
149
+ /**
150
+ * What applying a change request did.
151
+ *
152
+ * Two different commits, which is why they are two fields:
153
+ *
154
+ * `sha` is the state the target is left at — the tip at which the request
155
+ * counts as merged. When there was nothing to merge it is whatever landed on
156
+ * the target last, usually ANOTHER request's merge commit, so it must never be
157
+ * recorded as this request's own: a reader would answer with that other
158
+ * request's files under this number.
159
+ *
160
+ * `mergeCommit` is the commit this request OWNS, and the only sha a row may
161
+ * record as its `merged_sha` — the commit this merge wrote, or the one an
162
+ * earlier attempt wrote and left on the target when it failed to finalize the
163
+ * row. Null when the request has none, which is the genuinely empty case: its
164
+ * file list is empty anyway, so nothing readable is lost.
165
+ */
166
+ export type AppliedMergeResult =
167
+ | { kind: 'merged'; sha: string; mergeCommit: string | null }
168
+ | { kind: 'conflicts'; paths: string[] };
169
+
82
170
  export type PrFileStatus =
83
171
  | 'added'
84
172
  | 'modified'
@@ -368,6 +456,17 @@ export interface IPullRequestService {
368
456
  * via `gh pr create`) and the user expects to see the update immediately.
369
457
  */
370
458
  listOpenPrs(opts?: { fresh?: boolean }): Promise<PullRequestSummary[]>;
459
+ /**
460
+ * PRs in ANY of `states`, newest first — what `listOpenPrs` answers for the
461
+ * open ones, widened to the closed and merged rows it filters out. Only the
462
+ * `['open']` case goes through that method's 30s list cache; a read that
463
+ * asks for closed rows is rare (a reader catching up on what happened) and
464
+ * is served straight from the table.
465
+ */
466
+ listPrsByState(
467
+ states: PullRequestState[],
468
+ opts?: { fresh?: boolean; workspaceId?: string },
469
+ ): Promise<PullRequestSummary[]>;
371
470
  listPrsAuthoredBy(githubLoginOrEmail: string): Promise<PullRequestSummary[]>;
372
471
  /**
373
472
  * PRs whose touched paths have an owner with the given email.
package/src/git/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AuthUser } from '../auth/types.js';
2
- import type { PullRequestFile } from './pr.types.js';
2
+ import type { AppliedChangeRef, ChangedPathPair, PullRequestFile } from './pr.types.js';
3
3
 
4
4
  export interface BranchInfo {
5
5
  name: string;
@@ -107,13 +107,16 @@ export interface IGitService {
107
107
  * has the ref (the safety property the flag has always provided).
108
108
  * Protected branches and the currently-checked-out branch are always
109
109
  * rejected.
110
+ *
111
+ * Answers the tip the branch had (origin's when it had one), or null when
112
+ * there was none — what a restore of the branch would start from.
110
113
  */
111
114
  deleteBranch(
112
115
  workspaceId: string,
113
116
  name: string,
114
117
  user: AuthUser,
115
118
  opts?: { onlyIfNoRemote?: boolean },
116
- ): Promise<void>;
119
+ ): Promise<{ lastCommit: string | null }>;
117
120
  // `forkCurrentToDraft` removed: under the per-branch workspace model each
118
121
  // branch is its own workspace by construction, so the "carry uncommitted
119
122
  // edits onto a new draft" escape hatch can't fire. Use `createBranch` +
@@ -278,6 +281,81 @@ export interface IGitService {
278
281
  opts?: { fetch?: boolean },
279
282
  ): Promise<string[]>;
280
283
 
284
+ /**
285
+ * `changedPathsForPr`'s answer AND the same diff left as rename-aware pairs,
286
+ * from ONE `git diff`.
287
+ *
288
+ * The flat list cannot pair a rename's two paths: git reports a rename under
289
+ * its new name, and `forAccessCheck` adds the old name to the same
290
+ * undifferentiated set. That union is enough to authorize a WRITE ("may they
291
+ * touch everything this lands?"), but not to decide a READ — a file renamed
292
+ * out of a folder the caller cannot open is readable under neither of its
293
+ * names, since the diff of a rename shows the old side's content, and
294
+ * deciding that needs to know which old path belongs to which new file. The
295
+ * change-request read tools gate their file lists on exactly this, and the
296
+ * list of requests must reach the same verdict as the detail of one.
297
+ */
298
+ changedPathsAndPairsForPr(
299
+ workspaceId: string,
300
+ baseBranch: string,
301
+ headBranch: string,
302
+ opts?: { fetch?: boolean },
303
+ ): Promise<{ paths: string[]; pairs: ChangedPathPair[] }>;
304
+
305
+ /**
306
+ * The changed-file list an APPLIED change request landed, read from its merge
307
+ * commit against that commit's first parent.
308
+ *
309
+ * Its source branch is retired, so the branch pair the other two methods want
310
+ * no longer exists; what is left is the merge commit the row records. Its
311
+ * first parent is the target as it stood before the merge, so the two-dot diff
312
+ * between them is precisely what the request applied — and immutable, which
313
+ * the branch pair never was.
314
+ *
315
+ * The commit is VERIFIED to be that request's own, which is why the ref
316
+ * carries the number as well as the sha: a merge with nothing to merge used to
317
+ * record the target tip, and reading that commit's change would answer with
318
+ * another request's files. It must be in the clone, have a second parent, and
319
+ * carry a subject naming this request; anything else rejects with
320
+ * `WorkflowValidationError`, which every caller reads as "the file set could
321
+ * not be resolved" and answers fail-closed (no files, so author-only) rather
322
+ * than reaching for a fetch per request.
323
+ *
324
+ * No network, either way.
325
+ */
326
+ changedFilesOfAppliedChange(
327
+ workspaceId: string,
328
+ applied: AppliedChangeRef,
329
+ opts?: { patchCap?: number },
330
+ ): Promise<PullRequestFile[]>;
331
+
332
+ /**
333
+ * The same applied change as the two path views a change-request SUMMARY
334
+ * needs, out of one `git diff` — `changedPathsAndPairsForPr` for an applied
335
+ * request instead of a branch pair, with the same verification and the same
336
+ * no-network contract as {@link changedFilesOfAppliedChange}.
337
+ */
338
+ changedPathsAndPairsOfAppliedChange(
339
+ workspaceId: string,
340
+ applied: AppliedChangeRef,
341
+ ): Promise<{ paths: string[]; pairs: ChangedPathPair[] }>;
342
+
343
+ /**
344
+ * The two commits an APPLIED change request spanned, recovered from its merge
345
+ * commit: the target before the merge (`^1`) and the source tip that was
346
+ * merged (`^2`).
347
+ *
348
+ * The head matters beyond being informative: an approval is called stale when
349
+ * the head it was given against is not the detail's `headSha`, so answering
350
+ * the merge commit there would report every approval a merged request ever
351
+ * collected as stale. Same verification, same no-network contract and the same
352
+ * `WorkflowValidationError` as {@link changedFilesOfAppliedChange}.
353
+ */
354
+ appliedChangeShas(
355
+ workspaceId: string,
356
+ applied: AppliedChangeRef,
357
+ ): Promise<{ baseSha: string; headSha: string }>;
358
+
281
359
  /**
282
360
  * A change request's fork point (merge base of the two resolved commits)
283
361
  * and whether the target has commits the proposal does not contain. No
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ export * from './workspace/entry-exists.js';
12
12
  export * from './workspace/kb-layout.js';
13
13
  export * from './workspace/join-request.js';
14
14
  export * from './workspace/frontmatter.js';
15
+ export * from './workspace/md-links.js';
15
16
  export * from './workspace/placeholder.js';
16
17
  export * from './workspace/frontmatter-carriers.js';
17
18
  export * from './workspace/platform-files.js';
@@ -310,6 +310,30 @@ export interface ResyncEvent {
310
310
  reason: string;
311
311
  }
312
312
 
313
+ /**
314
+ * One of `forUserId`'s agents has reached the platform: the FIRST
315
+ * authenticated request on one of their agent connections or connection keys
316
+ * — the `initialize` or `tools/list` every client sends on connecting, before
317
+ * it has called any tool. Emitted once per connection or key, when its use
318
+ * stamp goes from never to now; later uses stamp quietly. It is what the
319
+ * onboarding waits for (the connect-your-agent page, the Get set up list),
320
+ * so those pages listen rather than ask on a timer. User-scoped: nobody
321
+ * else's session cares.
322
+ */
323
+ export interface AgentConnectedEvent {
324
+ kind: 'agent-connected';
325
+ forUserId: string;
326
+ /** The agent's registered client name, or the connection key's label. */
327
+ client: string;
328
+ /**
329
+ * Which of the two `client` is: `agent` for an OAuth connection's
330
+ * registered name, `key` for a connection key's free-text label.
331
+ */
332
+ agentKind: 'agent' | 'key';
333
+ /** When the first request landed, ISO 8601. */
334
+ at: string;
335
+ }
336
+
313
337
  // ── Union + helpers ──────────────────────────────────────────────────────────
314
338
 
315
339
  export type WorkflowEventPayload =
@@ -321,6 +345,7 @@ export type WorkflowEventPayload =
321
345
  | GitSyncRecoveredEvent
322
346
  | BranchSwitchedEvent
323
347
  | AgentToolCallEvent
348
+ | AgentConnectedEvent
324
349
  | ChangeRequestOpenedEvent
325
350
  | ChangeRequestMergedEvent
326
351
  | ChangeRequestRejectedEvent
@@ -352,6 +377,7 @@ export function isUserScoped(
352
377
  ): e is WorkflowEventPayload & { forUserId: string } {
353
378
  return (
354
379
  e.kind === 'agent-tool-call' ||
380
+ e.kind === 'agent-connected' ||
355
381
  e.kind === 'branch-switched' ||
356
382
  e.kind === 'change-request-merge-failed'
357
383
  );