@akagilnc/pi-workflow-roles 0.1.4759 → 0.1.4772
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/acp-host/production-host.js +227 -428
- package/dist/headless-host/production-host.js +233 -434
- package/dist/migrate-book-topology.js +1255 -1087
- package/dist/notary-source-run.js +12 -2
- package/dist/public-cli/invocation.js +11 -8
- package/dist/public-cli/main.js +198 -399
- package/dist/public-cli/post-admission.js +27 -1
- package/dist/public-cli/run-lifecycle.js +25 -4
- package/dist/role-run-relocation.js +19 -18
- package/package.json +1 -1
- package/src/book-topology-migration-placement.ts +9 -1
- package/src/book-topology-runs-migrator.ts +156 -4
- package/src/notary-source-run.ts +18 -2
- package/src/public-cli/invocation.ts +13 -9
- package/src/public-cli/post-admission.ts +36 -0
- package/src/public-cli/run-lifecycle.ts +42 -4
- package/src/role-run-relocation.ts +27 -30
|
@@ -196,6 +196,29 @@ function rewriteSummonsMaterials(
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
/** Project one admitted page in memory after its containing run moved. */
|
|
200
|
+
export function rewriteAdmittedRoleRunPage(
|
|
201
|
+
page: Record<string, unknown>,
|
|
202
|
+
rewrites: readonly RunDirectoryPathRewrite[],
|
|
203
|
+
): void {
|
|
204
|
+
rewriteRunDirectoryPathFieldsAgainstRewrites(page, ADMITTED_PAGE_FIELDS, rewrites);
|
|
205
|
+
rewriteSourceRunLocator(page.sourceRun, rewrites);
|
|
206
|
+
if (Array.isArray(page.attachments)) {
|
|
207
|
+
for (const attachment of page.attachments) {
|
|
208
|
+
if (isPlainObject(attachment)) {
|
|
209
|
+
rewriteRunDirectoryPathFieldsAgainstRewrites(attachment, ["frozenPath"], rewrites);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (isPlainObject(page.principal)) {
|
|
214
|
+
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
215
|
+
page.principal,
|
|
216
|
+
["sessionDirectory", "sessionFile"],
|
|
217
|
+
rewrites,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
199
222
|
async function rewriteJsonObjectFile(
|
|
200
223
|
path: string,
|
|
201
224
|
fields: readonly string[],
|
|
@@ -394,9 +417,9 @@ async function rewriteNestedMachinePathPages(
|
|
|
394
417
|
/**
|
|
395
418
|
* Rewrite admitted-request / invocation / run-state path fields (attachment
|
|
396
419
|
* frozenPath / summons.attachmentPaths pointers only), then nested package-owned
|
|
397
|
-
* session seams
|
|
398
|
-
* `pagesDirectory` is where the pages
|
|
399
|
-
*
|
|
420
|
+
* session seams. Callers may rewrite before or after the filesystem move/copy:
|
|
421
|
+
* `pagesDirectory` is where the pages currently live on disk; path strings that
|
|
422
|
+
* still name `oldRunDirectory` become `newRunDirectory`. `crossRunRewrites`
|
|
400
423
|
* covers officer/parent pointers that landed under a different final placement.
|
|
401
424
|
*/
|
|
402
425
|
export async function rewriteRoleRunDurablePages(input: {
|
|
@@ -414,33 +437,7 @@ export async function rewriteRoleRunDurablePages(input: {
|
|
|
414
437
|
string,
|
|
415
438
|
unknown
|
|
416
439
|
>;
|
|
417
|
-
|
|
418
|
-
page,
|
|
419
|
-
ADMITTED_PAGE_FIELDS,
|
|
420
|
-
rewrites,
|
|
421
|
-
);
|
|
422
|
-
// Nested notary typed locator — same value family as top-level sourceRunPath.
|
|
423
|
-
rewriteSourceRunLocator(page.sourceRun, rewrites);
|
|
424
|
-
if (Array.isArray(page.attachments)) {
|
|
425
|
-
for (const attachment of page.attachments) {
|
|
426
|
-
if (isPlainObject(attachment)) {
|
|
427
|
-
// Pointer only — never open or mutate frozen attachment bytes.
|
|
428
|
-
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
429
|
-
attachment,
|
|
430
|
-
["frozenPath"],
|
|
431
|
-
rewrites,
|
|
432
|
-
);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
// Nested principal wire (sessionDirectory/sessionFile) when present.
|
|
437
|
-
if (isPlainObject(page.principal)) {
|
|
438
|
-
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
439
|
-
page.principal,
|
|
440
|
-
["sessionDirectory", "sessionFile"],
|
|
441
|
-
rewrites,
|
|
442
|
-
);
|
|
443
|
-
}
|
|
440
|
+
rewriteAdmittedRoleRunPage(page, rewrites);
|
|
444
441
|
await writeFile(admittedPath, `${JSON.stringify(page, null, 2)}\n`, "utf8");
|
|
445
442
|
}
|
|
446
443
|
|