@akagilnc/pi-workflow-roles 0.1.5577 → 0.1.5593
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/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/dist/acp-host/production-host.js +338 -617
- package/dist/collector-config.js +0 -44
- package/dist/headless-host/production-host.js +241 -520
- package/dist/migrate-book-topology.js +16 -32
- package/dist/package-resources/engine-material.js +22 -25
- package/dist/public-cli/instruction-seat-run.js +11 -21
- package/dist/public-cli/invocation.js +83 -193
- package/dist/public-cli/main.js +225 -528
- package/dist/public-cli/option-definitions.js +5 -5
- package/dist/public-cli/post-admission.js +12 -48
- package/dist/public-cli/run-lifecycle.js +13 -21
- package/dist/public-role-summons.js +1 -1
- package/dist/role-run-relocation.js +12 -20
- package/package.json +1 -1
- package/src/collector-config.ts +0 -42
- package/src/collector-role.ts +10 -20
- package/src/package-resources/engine-material.ts +42 -35
- package/src/public-cli/instruction-seat-run.ts +10 -27
- package/src/public-cli/invocation.ts +97 -292
- package/src/public-cli/option-definitions.ts +5 -5
- package/src/public-cli/post-admission.ts +13 -64
- package/src/public-cli/run-lifecycle.ts +13 -34
- package/src/public-role-summons.ts +1 -1
- package/src/role-run-placement.ts +0 -1
- package/src/role-run-relocation.ts +12 -22
- package/src/role-runtime.ts +18 -16
package/dist/collector-config.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { sha256Hex } from "./sha256.js";
|
|
3
|
-
import { isRecord } from "./unknown-value.js";
|
|
4
1
|
import { isTicketNumberString, parseTicketNumber } from "./run-ticket-number.js";
|
|
5
2
|
export const COLLECTOR_OWNER_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/;
|
|
6
3
|
export const COLLECTOR_REPO_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,98}[A-Za-z0-9])?$/;
|
|
@@ -40,44 +37,3 @@ export function parseCollectorPrNumber(raw) {
|
|
|
40
37
|
: "Collector pull request number must be a positive safe integer");
|
|
41
38
|
return value;
|
|
42
39
|
}
|
|
43
|
-
function canonicalManifest(requests) {
|
|
44
|
-
return `${JSON.stringify({ requests: requests.map((request) => ({ id: request.id, body: request.requestBody })) })}\n`;
|
|
45
|
-
}
|
|
46
|
-
export function emptyCollectorManifest() {
|
|
47
|
-
const canonicalJson = canonicalManifest([]);
|
|
48
|
-
return { requests: [], canonicalJson, digest: sha256Hex(canonicalJson) };
|
|
49
|
-
}
|
|
50
|
-
/** Optional request configuration. It names requests, never expected observers. */
|
|
51
|
-
export async function loadCollectorManifest(path) {
|
|
52
|
-
let bytes;
|
|
53
|
-
try {
|
|
54
|
-
bytes = await readFile(path);
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
fail(`Collector request manifest is unreadable at ${path}`, error);
|
|
58
|
-
}
|
|
59
|
-
let parsed;
|
|
60
|
-
try {
|
|
61
|
-
parsed = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
fail("Collector request manifest must be UTF-8 JSON", error);
|
|
65
|
-
}
|
|
66
|
-
if (!isRecord(parsed))
|
|
67
|
-
fail("Collector request manifest must be an object");
|
|
68
|
-
const rawRequests = parsed.requests ?? [];
|
|
69
|
-
if (!Array.isArray(rawRequests))
|
|
70
|
-
fail("Collector request manifest requests must be an array");
|
|
71
|
-
const requests = [];
|
|
72
|
-
const ids = new Set();
|
|
73
|
-
for (const [index, item] of rawRequests.entries()) {
|
|
74
|
-
if (!isRecord(item) || typeof item.id !== "string" || item.id.length === 0 || typeof item.body !== "string" || item.body.trim() === "")
|
|
75
|
-
fail(`Collector request manifest requests[${index}] is invalid`);
|
|
76
|
-
if (ids.has(item.id))
|
|
77
|
-
fail(`Collector request manifest has duplicate request id "${item.id}"`);
|
|
78
|
-
ids.add(item.id);
|
|
79
|
-
requests.push({ id: item.id, requestBody: item.body });
|
|
80
|
-
}
|
|
81
|
-
const canonicalJson = canonicalManifest(requests);
|
|
82
|
-
return { requests, canonicalJson, digest: sha256Hex(canonicalJson), sourcePath: path };
|
|
83
|
-
}
|