@bevel-software/platform-shared 0.26.0 → 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.
- package/dist/git/types.d.ts +6 -1
- package/dist/git/types.d.ts.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 +24 -1
- 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 +30 -1
- package/dist/workflow/interface.d.ts.map +1 -1
- package/dist/workflow/types.d.ts +57 -3
- package/dist/workflow/types.d.ts.map +1 -1
- package/dist/workspace/md-links.d.ts +138 -0
- package/dist/workspace/md-links.d.ts.map +1 -0
- package/dist/workspace/md-links.js +703 -0
- package/dist/workspace/md-links.js.map +1 -0
- package/dist/workspace/platform-files.d.ts +4 -0
- package/dist/workspace/platform-files.d.ts.map +1 -1
- package/dist/workspace/platform-files.js +18 -0
- package/dist/workspace/platform-files.js.map +1 -1
- package/package.json +1 -1
- package/src/git/types.ts +4 -1
- package/src/index.ts +1 -0
- package/src/workflow/events.ts +26 -0
- package/src/workflow/interface.ts +31 -0
- package/src/workflow/types.ts +48 -4
- package/src/workspace/md-links.ts +757 -0
- package/src/workspace/platform-files.ts +21 -0
|
@@ -158,6 +158,27 @@ export function isRootPlatformFile(repoRelativePath: string, layout: KbLayout):
|
|
|
158
158
|
return platformFiles(layout).has(normalize(repoRelativePath));
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* The platform files that govern the WHOLE repository: the root's `access.md`,
|
|
163
|
+
* which every folder without its own falls back to, and `roles.yaml`, which
|
|
164
|
+
* says what the roles are. Deleting either leaves the repository ungoverned,
|
|
165
|
+
* so no surface deletes them — not the agent tools, not the app. A nested
|
|
166
|
+
* `access.md` is not among them: it narrows its own folder, and whoever may
|
|
167
|
+
* write it may delete it, which hands the folder back to its parent's rules.
|
|
168
|
+
* `.bevelignore` is not among them either; its delete rules are untouched.
|
|
169
|
+
*/
|
|
170
|
+
const REPOSITORY_OWN_FILES: ReadonlySet<string> = new Set(['access.md', 'roles.yaml']);
|
|
171
|
+
|
|
172
|
+
/** Whether `repoRelativePath` is one of the files no surface deletes (see above). Exact spelling. */
|
|
173
|
+
export function isRepositoryOwnFile(repoRelativePath: string, layout: KbLayout): boolean {
|
|
174
|
+
return isRootPlatformFile(repoRelativePath, layout) && REPOSITORY_OWN_FILES.has(normalize(repoRelativePath));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** The one sentence every surface refuses a delete of the repository's own file with. */
|
|
178
|
+
export function repositoryOwnFileDeleteRefusal(pathOrName: string): string {
|
|
179
|
+
return `${baseName(pathOrName)} is the repository's own file and cannot be deleted.`;
|
|
180
|
+
}
|
|
181
|
+
|
|
161
182
|
/**
|
|
162
183
|
* The place a misplaced platform file is allowed to be put back, when
|
|
163
184
|
* `repoRelativeDestination` names one, and null when it does not.
|