@preplabsai/rovara-code 0.5.17 → 0.5.18
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/bin/agentx-cli.mjs +338 -1488
- package/package.json +1 -1
package/bin/agentx-cli.mjs
CHANGED
|
@@ -149,8 +149,8 @@ function getEnumValues(entries) {
|
|
|
149
149
|
const values = Object.entries(entries).filter(([k5, _]) => numericValues.indexOf(+k5) === -1).map(([_, v]) => v);
|
|
150
150
|
return values;
|
|
151
151
|
}
|
|
152
|
-
function joinValues(
|
|
153
|
-
return
|
|
152
|
+
function joinValues(array3, separator = "|") {
|
|
153
|
+
return array3.map((val) => stringifyPrimitive(val)).join(separator);
|
|
154
154
|
}
|
|
155
155
|
function jsonStringifyReplacer(_, value) {
|
|
156
156
|
if (typeof value === "bigint")
|
|
@@ -25723,6 +25723,8 @@ var init_routes = __esm({
|
|
|
25723
25723
|
// DEC 254zzz73: GET /v1/dev/me/sign-in-factors (the step-up confirmation email and passkeys) is removed with the step-up.
|
|
25724
25724
|
// Spec 065b: a project from a repository the GitHub App can reach.
|
|
25725
25725
|
{ method: "POST", path: "/v1/dev/client/projects", requires: "projects:create" },
|
|
25726
|
+
// #1649: `rovara project add` registers the project it built, as the signed-in company owner or admin, in their company.
|
|
25727
|
+
{ method: "POST", path: "/v1/dev/projects", requires: "projects:create" },
|
|
25726
25728
|
{ method: "GET", path: "/v1/dev/client/repositories", requires: "projects:create" },
|
|
25727
25729
|
// Guided onboarding PR 6: one project per repository, and the repository picker (the company's connected repositories, marked with its projects).
|
|
25728
25730
|
{ method: "POST", path: "/v1/dev/client/projects/bulk", requires: "projects:create" },
|
|
@@ -41953,10 +41955,10 @@ var init_test_env_multi_repo = __esm({
|
|
|
41953
41955
|
// packages/contracts/dist/test-env-baseline.js
|
|
41954
41956
|
function baselineLine(input2) {
|
|
41955
41957
|
const branch = inertEvidenceText(input2.branch, 60);
|
|
41956
|
-
const
|
|
41958
|
+
const sha5 = /^[a-f0-9]{7,40}$/u.test(input2.shortSha) ? input2.shortSha.slice(0, 7) : void 0;
|
|
41957
41959
|
const age = input2.ageHours < 1 ? "under 1 h old" : `${number4(input2.ageHours)} h old`;
|
|
41958
41960
|
const back = input2.partial ? `, ${number4(input2.commitsBack)} ${input2.commitsBack === 1 ? "commit" : "commits"} back; partial` : "";
|
|
41959
|
-
const at = input2.repositories === void 0 ?
|
|
41961
|
+
const at = input2.repositories === void 0 ? sha5 ?? "an unknown commit" : input2.repositories.map((part) => `${inertEvidenceText(part.repositoryId, 60) || "a repository"} ${/^[a-f0-9]{7,40}$/u.test(part.shortSha) ? part.shortSha.slice(0, 7) : "an unknown commit"}`).join(", ");
|
|
41960
41962
|
return `Compared with ${branch === "" ? "the base branch" : branch} at ${at} (${WRITER_WORDS[input2.writer]}, ${age}${back}): ${number4(input2.knownFailing)} known failing, ${number4(input2.flaky)} flaky`;
|
|
41961
41963
|
}
|
|
41962
41964
|
var BASELINE_ANCESTOR_MAX, BASELINE_CANDIDATES_MAX, BASELINE_WRITERS, BaselineWriterSchema, Sha402, Count4, BaselineRowSchema, BaselineCandidateSchema, RawBaselineSchema, BASELINE_REPOSITORIES_MAX, RawRepositoryBaselineSchema, RawRepositoryBaselinesSchema, EvidenceBaselineSchema, WRITER_WORDS, number4, baselineWords;
|
|
@@ -53614,7 +53616,6 @@ var init_plan_critique_block = __esm({
|
|
|
53614
53616
|
});
|
|
53615
53617
|
|
|
53616
53618
|
// packages/contracts/dist/e2e-source.js
|
|
53617
|
-
import { createHash as createHash8 } from "node:crypto";
|
|
53618
53619
|
function isSafeE2ESourcePath(path6) {
|
|
53619
53620
|
if (path6.length === 0 || path6.length > 1024 || path6.startsWith("/") || path6.includes("\\") || path6.includes("\0"))
|
|
53620
53621
|
return false;
|
|
@@ -53627,58 +53628,26 @@ function isSafeE2ESourcePath(path6) {
|
|
|
53627
53628
|
return false;
|
|
53628
53629
|
}
|
|
53629
53630
|
}
|
|
53630
|
-
function verifyE2ESourceSnapshot(snapshotInput, expectedCandidateInput) {
|
|
53631
|
-
if (snapshotInput.treeComplete !== true || !Array.isArray(snapshotInput.treePaths) || snapshotInput.treePaths.length > 1e5 || snapshotInput.sources.length > 512)
|
|
53632
|
-
throw new Error("immutable source tree is incomplete or outside its bounds");
|
|
53633
|
-
const candidate = CandidateManifestSchema.parse(snapshotInput.candidate);
|
|
53634
|
-
const expectedCandidate = CandidateManifestSchema.parse(expectedCandidateInput);
|
|
53635
|
-
if (canonicalJson(candidate) !== canonicalJson(expectedCandidate))
|
|
53636
|
-
throw new Error("source snapshot does not match the expected immutable candidate");
|
|
53637
|
-
if (candidate.repositories.length !== 1 || candidate.repositories[0]?.commitSha !== snapshotInput.commitSha || candidate.repositories[0]?.treeSha !== snapshotInput.treeSha)
|
|
53638
|
-
throw new Error("source snapshot commit and tree do not match its candidate manifest");
|
|
53639
|
-
if (snapshotInput.treePaths.some((path6) => typeof path6 !== "string" || path6.length === 0 || path6.length > 1024 || path6.startsWith("/") || path6.includes("\\") || path6.includes("\0")))
|
|
53640
|
-
throw new Error("immutable tree path inventory contains an invalid path");
|
|
53641
|
-
const treePaths = new Set(snapshotInput.treePaths);
|
|
53642
|
-
if (treePaths.size !== snapshotInput.treePaths.length)
|
|
53643
|
-
throw new Error("immutable tree path inventory contains duplicate paths");
|
|
53644
|
-
const sourceMap = /* @__PURE__ */ new Map();
|
|
53645
|
-
let totalBytes = 0;
|
|
53646
|
-
for (const source3 of snapshotInput.sources) {
|
|
53647
|
-
if (source3.kind !== "blob" || !isSafeE2ESourcePath(source3.path) || !treePaths.has(source3.path) || sourceMap.has(source3.path))
|
|
53648
|
-
throw new Error("source path is unsafe, duplicated, symlinked, or outside the immutable candidate tree");
|
|
53649
|
-
if (!(source3.bytes instanceof Uint8Array) || source3.bytes.byteLength > 512 * 1024)
|
|
53650
|
-
throw new Error("source file exceeds the immutable snapshot size limit");
|
|
53651
|
-
totalBytes += source3.bytes.byteLength;
|
|
53652
|
-
if (totalBytes > 4 * 1024 * 1024)
|
|
53653
|
-
throw new Error("source snapshot exceeds the aggregate byte limit");
|
|
53654
|
-
if (createHash8("sha256").update(source3.bytes).digest("hex") !== source3.sha256)
|
|
53655
|
-
throw new Error("source bytes do not match their SHA-256 reference");
|
|
53656
|
-
sourceMap.set(source3.path, source3);
|
|
53657
|
-
}
|
|
53658
|
-
return sourceMap;
|
|
53659
|
-
}
|
|
53660
53631
|
var blockedPathSegment;
|
|
53661
53632
|
var init_e2e_source = __esm({
|
|
53662
53633
|
"packages/contracts/dist/e2e-source.js"() {
|
|
53663
53634
|
"use strict";
|
|
53664
|
-
init_canonical_json();
|
|
53665
|
-
init_task_workflow();
|
|
53666
53635
|
blockedPathSegment = /^(?:\.git|\.github|\.aws|\.ssh|\.env(?:\..*)?|secrets?|credentials?|.*(?:token|password|private[-_]?key).*)$/i;
|
|
53667
53636
|
}
|
|
53668
53637
|
});
|
|
53669
53638
|
|
|
53670
53639
|
// packages/contracts/dist/e2e-application.js
|
|
53671
|
-
import { createHash as
|
|
53640
|
+
import { createHash as createHash8 } from "node:crypto";
|
|
53672
53641
|
function uniqueSourceRefs(refs) {
|
|
53673
53642
|
return new Set(refs.map((ref) => ref.path)).size === refs.length;
|
|
53674
53643
|
}
|
|
53675
53644
|
function e2eAppBuildManifestDigest(manifest) {
|
|
53676
53645
|
const body = Object.fromEntries(Object.entries(manifest).filter(([key2]) => key2 !== "manifestDigest"));
|
|
53677
|
-
return
|
|
53646
|
+
return createHash8("sha256").update(canonicalJson(body)).digest("hex");
|
|
53678
53647
|
}
|
|
53679
53648
|
function e2eApplicationApprovalBindingDigest(binding) {
|
|
53680
53649
|
const body = Object.fromEntries(Object.entries(binding).filter(([key2]) => key2 !== "bindingDigest"));
|
|
53681
|
-
return
|
|
53650
|
+
return createHash8("sha256").update(canonicalJson(body)).digest("hex");
|
|
53682
53651
|
}
|
|
53683
53652
|
var digest4, gitSha, boundedId, utcTimestamp, normalizedSourcePath, SourceRefSchema, PlanApprovalRefSchema, E2EApplicationRuntimeRefSchema, E2EUnavailableTargetRefSchema, E2ERuntimeAccountRefSchema, v1IntentShape, E2EApplicationPlanIntentSchema, E2EFeaturePlanIntentAnySchema, E2EAppArtifactOutputSchema, E2EAppArtifactRefSchema, E2EAppBuildManifestSchema, E2EApplicationApprovalBindingSchema;
|
|
53684
53653
|
var init_e2e_application = __esm({
|
|
@@ -60392,7 +60361,7 @@ var init_session = __esm({
|
|
|
60392
60361
|
});
|
|
60393
60362
|
|
|
60394
60363
|
// packages/contracts/dist/runtime-installation.js
|
|
60395
|
-
import { createHash as
|
|
60364
|
+
import { createHash as createHash9 } from "node:crypto";
|
|
60396
60365
|
import { isIP } from "node:net";
|
|
60397
60366
|
function parseCanonicalJsonCapture(base643) {
|
|
60398
60367
|
try {
|
|
@@ -60410,7 +60379,7 @@ function isRecord3(value) {
|
|
|
60410
60379
|
}
|
|
60411
60380
|
function runtimeInstallChallengeDigest(challengeInput) {
|
|
60412
60381
|
const challenge = RuntimeInstallChallengeSchema.parse(challengeInput);
|
|
60413
|
-
return
|
|
60382
|
+
return createHash9("sha256").update(canonicalJson(challenge)).digest("hex");
|
|
60414
60383
|
}
|
|
60415
60384
|
var digest5, RUNTIME_IMAGE, FIXED_PROBE_RECEIPTS, FIXED_PACKET_IDENTITIES, catalogId, profile, privateIpv4Url, RuntimeInstallChallengeSchema, RuntimeInstallProbeIdSchema, RuntimeInstallByteCaptureSchema, RuntimeInstallCaptureSchema, RuntimeInstallProbeSchema, RuntimeInstallManifestEntrySchema, RuntimeInstallManifestSchema, RuntimeInstallExecutionSchema, RuntimeInstallationProposalSchema;
|
|
60416
60385
|
var init_runtime_installation = __esm({
|
|
@@ -60482,7 +60451,7 @@ var init_runtime_installation = __esm({
|
|
|
60482
60451
|
sha256: digest5
|
|
60483
60452
|
}).strict().superRefine((capture, context) => {
|
|
60484
60453
|
const bytes5 = Buffer.from(capture.bytesBase64, "base64");
|
|
60485
|
-
if (bytes5.toString("base64") !== capture.bytesBase64 ||
|
|
60454
|
+
if (bytes5.toString("base64") !== capture.bytesBase64 || createHash9("sha256").update(bytes5).digest("hex") !== capture.sha256) {
|
|
60486
60455
|
context.addIssue({ code: "custom", path: ["sha256"], message: "execution evidence digest must identify its original canonical bytes" });
|
|
60487
60456
|
}
|
|
60488
60457
|
});
|
|
@@ -60494,7 +60463,7 @@ var init_runtime_installation = __esm({
|
|
|
60494
60463
|
const bytes5 = Buffer.from(capture.bytesBase64, "base64");
|
|
60495
60464
|
if (bytes5.byteLength === 0 && !capture.name.endsWith("-stderr.bin") || bytes5.toString("base64") !== capture.bytesBase64)
|
|
60496
60465
|
context.addIssue({ code: "custom", path: ["bytesBase64"], message: "capture must be canonical base64 and required protocol frames must be non-empty" });
|
|
60497
|
-
else if (
|
|
60466
|
+
else if (createHash9("sha256").update(bytes5).digest("hex") !== capture.sha256)
|
|
60498
60467
|
context.addIssue({ code: "custom", path: ["sha256"], message: "capture digest does not identify the original bounded bytes" });
|
|
60499
60468
|
});
|
|
60500
60469
|
RuntimeInstallProbeSchema = external_exports.object({
|
|
@@ -60545,7 +60514,7 @@ var init_runtime_installation = __esm({
|
|
|
60545
60514
|
const requestBytes = Buffer.from(probe.captures[0]?.bytesBase64 ?? "", "base64");
|
|
60546
60515
|
const responseBytes = Buffer.from(probe.captures[1]?.bytesBase64 ?? "", "base64");
|
|
60547
60516
|
const stderrBytes = Buffer.from(probe.captures[2]?.bytesBase64 ?? "", "base64");
|
|
60548
|
-
if (Object.keys(evidence).sort().join(",") !== "capture,profileId,receipt" || evidence.profileId !== "darwin-arm64-colima-v1" && evidence.profileId !== "linux-arm64-docker-v1" || receipt4.scope !== "contained-candidate-process-response/v1" || receipt4.adapterVersion !== 1 || typeof receipt4.plannedName !== "string" || !/^agentx-contained-[a-f0-9]{20}$/.test(receipt4.plannedName) || typeof receipt4.recordRef !== "string" || !/^[a-f0-9]{32}$/.test(receipt4.recordRef) || typeof receipt4.containerId !== "string" || !/^[a-f0-9]{64}$/.test(receipt4.containerId) || receipt4.image !== RUNTIME_IMAGE || receipt4.sourceDigest !== FIXED_PACKET_IDENTITIES[probeIndex]?.sourceDigest || receipt4.sourceBytes !== FIXED_PACKET_IDENTITIES[probeIndex]?.sourceBytes || receipt4.entry !== "__agentx_adapter__/entry.mjs" || receipt4.exportName !== "default" || typeof receipt4.endpoint !== "string" || (evidence.profileId === "linux-arm64-docker-v1" ? receipt4.endpoint !== "unix:///var/run/docker.sock" : !/^unix:\/\/\/Users\/[^/]+\/\.colima\/default\/docker\.sock$/.test(receipt4.endpoint)) || Object.keys(labels).sort().join(",") !== "agentx.nonce,agentx.owner,agentx.source" || owner.nonce !== labels["agentx.nonce"] || typeof owner.nonce !== "string" || !/^[a-f0-9]{48}$/.test(owner.nonce) || labels["agentx.owner"] !== "contained-candidate-v1" || labels["agentx.source"] !== receipt4.sourceDigest || receipt4.exitCode !== 0 || receipt4.requestWritten !== true || receipt4.overflow !== false || receipt4.aborted !== false || receipt4.timedOut !== false || receipt4.cleanup !== "confirmed" || !Number.isSafeInteger(receipt4.stdoutBytes) || !Number.isSafeInteger(receipt4.stderrBytes) || receipt4.aggregateBytes !== receipt4.stdoutBytes + receipt4.stderrBytes || receipt4.stdoutBytes !== capture.stdoutBytes || receipt4.stderrBytes !== capture.stderrBytes || typeof capture.requestSha256 !== "string" || !/^[a-f0-9]{64}$/.test(capture.requestSha256) || typeof capture.stdoutSha256 !== "string" || !/^[a-f0-9]{64}$/.test(capture.stdoutSha256) || typeof capture.stderrSha256 !== "string" || !/^[a-f0-9]{64}$/.test(capture.stderrSha256) || capture.requestBytes !== requestBytes.byteLength || capture.requestSha256 !==
|
|
60517
|
+
if (Object.keys(evidence).sort().join(",") !== "capture,profileId,receipt" || evidence.profileId !== "darwin-arm64-colima-v1" && evidence.profileId !== "linux-arm64-docker-v1" || receipt4.scope !== "contained-candidate-process-response/v1" || receipt4.adapterVersion !== 1 || typeof receipt4.plannedName !== "string" || !/^agentx-contained-[a-f0-9]{20}$/.test(receipt4.plannedName) || typeof receipt4.recordRef !== "string" || !/^[a-f0-9]{32}$/.test(receipt4.recordRef) || typeof receipt4.containerId !== "string" || !/^[a-f0-9]{64}$/.test(receipt4.containerId) || receipt4.image !== RUNTIME_IMAGE || receipt4.sourceDigest !== FIXED_PACKET_IDENTITIES[probeIndex]?.sourceDigest || receipt4.sourceBytes !== FIXED_PACKET_IDENTITIES[probeIndex]?.sourceBytes || receipt4.entry !== "__agentx_adapter__/entry.mjs" || receipt4.exportName !== "default" || typeof receipt4.endpoint !== "string" || (evidence.profileId === "linux-arm64-docker-v1" ? receipt4.endpoint !== "unix:///var/run/docker.sock" : !/^unix:\/\/\/Users\/[^/]+\/\.colima\/default\/docker\.sock$/.test(receipt4.endpoint)) || Object.keys(labels).sort().join(",") !== "agentx.nonce,agentx.owner,agentx.source" || owner.nonce !== labels["agentx.nonce"] || typeof owner.nonce !== "string" || !/^[a-f0-9]{48}$/.test(owner.nonce) || labels["agentx.owner"] !== "contained-candidate-v1" || labels["agentx.source"] !== receipt4.sourceDigest || receipt4.exitCode !== 0 || receipt4.requestWritten !== true || receipt4.overflow !== false || receipt4.aborted !== false || receipt4.timedOut !== false || receipt4.cleanup !== "confirmed" || !Number.isSafeInteger(receipt4.stdoutBytes) || !Number.isSafeInteger(receipt4.stderrBytes) || receipt4.aggregateBytes !== receipt4.stdoutBytes + receipt4.stderrBytes || receipt4.stdoutBytes !== capture.stdoutBytes || receipt4.stderrBytes !== capture.stderrBytes || typeof capture.requestSha256 !== "string" || !/^[a-f0-9]{64}$/.test(capture.requestSha256) || typeof capture.stdoutSha256 !== "string" || !/^[a-f0-9]{64}$/.test(capture.stdoutSha256) || typeof capture.stderrSha256 !== "string" || !/^[a-f0-9]{64}$/.test(capture.stderrSha256) || capture.requestBytes !== requestBytes.byteLength || capture.requestSha256 !== createHash9("sha256").update(requestBytes).digest("hex") || capture.stdoutBytes !== responseBytes.byteLength || capture.stdoutSha256 !== createHash9("sha256").update(responseBytes).digest("hex") || capture.stderrBytes !== stderrBytes.byteLength || capture.stderrSha256 !== createHash9("sha256").update(stderrBytes).digest("hex")) {
|
|
60549
60518
|
context.addIssue({ code: "custom", path: ["containmentReceipt"], message: "original owned-container receipt lacks confirmed cleanup and immutable container/source identity" });
|
|
60550
60519
|
}
|
|
60551
60520
|
} catch {
|
|
@@ -60566,7 +60535,7 @@ var init_runtime_installation = __esm({
|
|
|
60566
60535
|
if (canonicalJson(entries) !== canonicalJson(manifest.entries))
|
|
60567
60536
|
context.addIssue({ code: "custom", path: ["entries"], message: "installed manifest entries must be sorted by path" });
|
|
60568
60537
|
const body = { schemaVersion: manifest.schemaVersion, entries: manifest.entries };
|
|
60569
|
-
if (
|
|
60538
|
+
if (createHash9("sha256").update(canonicalJson(body)).digest("hex") !== manifest.sha256)
|
|
60570
60539
|
context.addIssue({ code: "custom", path: ["sha256"], message: "installed manifest digest does not identify its entries" });
|
|
60571
60540
|
if (!paths2.some((path6) => path6.startsWith("packages/verifier/dist/")) || !paths2.some((path6) => path6.startsWith("packages/verifier/assets/")))
|
|
60572
60541
|
context.addIssue({ code: "custom", path: ["entries"], message: "manifest must include installed verifier code and immutable qualification assets" });
|
|
@@ -60616,7 +60585,7 @@ var init_runtime_installation = __esm({
|
|
|
60616
60585
|
const expectedTarget = { id: "contract-web-1", index: 0, platform: "contract-web-1", environment: "test", engine: { name: "none", version: "unversioned", spiVersion: 1 }, capabilities: [], artifactCapabilities: [], stateCapability: false };
|
|
60617
60586
|
const expectedLimits = { maxAgentContextBytes: 16384, maxLedgerBytes: 8192, maxObservationBytes: 262144, maxEventsPerStep: 1e3, maxModelTokensPerCall: 64e3 };
|
|
60618
60587
|
const expectedUsage = { discoveredResults: 3, maxAgentContextBytes: 0, maxLedgerBytes: 0, maxObservationBytes: 0, artifactBytes: 0, downloads: 0, events: 0, modelTokens: 0, maxModelCallsInStep: 0, maxActionStepsInStep: 0 };
|
|
60619
|
-
if (rows.length !== 3 || summary2.discovered !== 3 || summary2.selected !== 3 || summary2.executed !== 3 || summary2.passed !== 2 || summary2.failed !== 1 || summary2.interrupted !== 0 || summary2.flaky !== 0 || summary2.skipped !== 0 || !Array.isArray(report2.run.serialGroups) || report2.run.serialGroups.length !== 0 || canonicalJson(report2.run.targets) !== canonicalJson([expectedTarget]) || canonicalJson(report2.run.limits) !== canonicalJson(expectedLimits) || canonicalJson(report2.run.usage) !== canonicalJson(expectedUsage) || rows.some((row2, index) => !isRecord3(row2) || row2.status !== expectedStatuses[index] || row2.kind !== "test" || row2.selected !== true || row2.repeat !== 0 || row2.declarationIndex !== index || row2.file !== ".agentx/e2e/generated-contract.test.ts" || row2.platform !== "contract-web-1" || row2.skip !== void 0 || !Array.isArray(row2.tags) || row2.tags.length !== 0 || !isRecord3(row2.source) || row2.source.file !== ".agentx/e2e/generated-contract.test.ts" || row2.source.line !== index + 3 || row2.source.column !== 1 || !Array.isArray(row2.attempts) || row2.attempts.length !== 1 || !isRecord3(row2.attempts[0]) || row2.attempts[0].index !== 0 || row2.attempts[0].status !== expectedStatuses[index] || row2.attempts[0].cleanup !== "complete" || !Array.isArray(row2.attempts[0].artifacts) || row2.attempts[0].artifacts.length !== 0 || typeof row2.attempts[0].startedAt !== "string" || !Number.isFinite(Date.parse(row2.attempts[0].startedAt)) || !Number.isSafeInteger(row2.attempts[0].durationMs) || row2.attempts[0].durationMs < 0 || row2.attempts[0].durationMs > 1e4 || !Array.isArray(row2.attempts[0].steps) || row2.attempts[0].steps.length !== 0 || !Array.isArray(row2.attempts[0].secondaryErrors) || row2.attempts[0].secondaryErrors.length !== 0 || (index === 2 ? !isRecord3(row2.attempts[0].error) || row2.attempts[0].error.category !== "test" || row2.attempts[0].error.code !== "ASSERTION_FAILED" || row2.attempts[0].error.retryable !== false || row2.attempts[0].error.phase !== "body" || typeof row2.attempts[0].error.message !== "string" || !isRecord3(row2.attempts[0].error.source) || row2.attempts[0].error.source.file !== "worker-bridge.mjs" || row2.attempts[0].error.source.line !== 60 || row2.attempts[0].error.source.column !== 35 : row2.attempts[0].error !== void 0) || !Array.isArray(row2.titlePath) || row2.titlePath.length !== 1 || row2.titlePath[0] !== expectedCaseIds[index] || typeof row2.testId !== "string" || row2.testId !== `.agentx/e2e/generated-contract.test.ts::${expectedCaseIds[index]}` || row2.agent !== "default" || row2.targetId !== "contract-web-1" || typeof row2.id !== "string" ||
|
|
60588
|
+
if (rows.length !== 3 || summary2.discovered !== 3 || summary2.selected !== 3 || summary2.executed !== 3 || summary2.passed !== 2 || summary2.failed !== 1 || summary2.interrupted !== 0 || summary2.flaky !== 0 || summary2.skipped !== 0 || !Array.isArray(report2.run.serialGroups) || report2.run.serialGroups.length !== 0 || canonicalJson(report2.run.targets) !== canonicalJson([expectedTarget]) || canonicalJson(report2.run.limits) !== canonicalJson(expectedLimits) || canonicalJson(report2.run.usage) !== canonicalJson(expectedUsage) || rows.some((row2, index) => !isRecord3(row2) || row2.status !== expectedStatuses[index] || row2.kind !== "test" || row2.selected !== true || row2.repeat !== 0 || row2.declarationIndex !== index || row2.file !== ".agentx/e2e/generated-contract.test.ts" || row2.platform !== "contract-web-1" || row2.skip !== void 0 || !Array.isArray(row2.tags) || row2.tags.length !== 0 || !isRecord3(row2.source) || row2.source.file !== ".agentx/e2e/generated-contract.test.ts" || row2.source.line !== index + 3 || row2.source.column !== 1 || !Array.isArray(row2.attempts) || row2.attempts.length !== 1 || !isRecord3(row2.attempts[0]) || row2.attempts[0].index !== 0 || row2.attempts[0].status !== expectedStatuses[index] || row2.attempts[0].cleanup !== "complete" || !Array.isArray(row2.attempts[0].artifacts) || row2.attempts[0].artifacts.length !== 0 || typeof row2.attempts[0].startedAt !== "string" || !Number.isFinite(Date.parse(row2.attempts[0].startedAt)) || !Number.isSafeInteger(row2.attempts[0].durationMs) || row2.attempts[0].durationMs < 0 || row2.attempts[0].durationMs > 1e4 || !Array.isArray(row2.attempts[0].steps) || row2.attempts[0].steps.length !== 0 || !Array.isArray(row2.attempts[0].secondaryErrors) || row2.attempts[0].secondaryErrors.length !== 0 || (index === 2 ? !isRecord3(row2.attempts[0].error) || row2.attempts[0].error.category !== "test" || row2.attempts[0].error.code !== "ASSERTION_FAILED" || row2.attempts[0].error.retryable !== false || row2.attempts[0].error.phase !== "body" || typeof row2.attempts[0].error.message !== "string" || !isRecord3(row2.attempts[0].error.source) || row2.attempts[0].error.source.file !== "worker-bridge.mjs" || row2.attempts[0].error.source.line !== 60 || row2.attempts[0].error.source.column !== 35 : row2.attempts[0].error !== void 0) || !Array.isArray(row2.titlePath) || row2.titlePath.length !== 1 || row2.titlePath[0] !== expectedCaseIds[index] || typeof row2.testId !== "string" || row2.testId !== `.agentx/e2e/generated-contract.test.ts::${expectedCaseIds[index]}` || row2.agent !== "default" || row2.targetId !== "contract-web-1" || typeof row2.id !== "string" || createHash9("sha256").update(canonicalJson({ testId: row2.testId, targetId: row2.targetId, agent: row2.agent })).digest("hex") !== row2.id)) {
|
|
60620
60589
|
context.addIssue({ code: "custom", path: ["run", "stdout"], message: "report must contain exactly two clean positive cases and the one fixed expected negative case" });
|
|
60621
60590
|
}
|
|
60622
60591
|
const listPairs = isRecord3(list4) && Array.isArray(list4.pairs) ? list4.pairs : [];
|
|
@@ -60721,7 +60690,7 @@ var init_runtime_installation = __esm({
|
|
|
60721
60690
|
});
|
|
60722
60691
|
|
|
60723
60692
|
// packages/contracts/dist/e2e-web-api-qualification.js
|
|
60724
|
-
import { createHash as
|
|
60693
|
+
import { createHash as createHash10 } from "node:crypto";
|
|
60725
60694
|
function isWebApiPrivateIpv4(value) {
|
|
60726
60695
|
const parts2 = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/u.exec(value)?.slice(1).map(Number);
|
|
60727
60696
|
if (parts2 === void 0 || parts2.some((part) => part > 255))
|
|
@@ -60731,7 +60700,7 @@ function isWebApiPrivateIpv4(value) {
|
|
|
60731
60700
|
}
|
|
60732
60701
|
function webApiQualificationAppTreeDigest(files) {
|
|
60733
60702
|
const sorted2 = files.map((file2) => ({ path: file2.path, sha256: file2.sha256 })).sort((left, right) => left.path < right.path ? -1 : left.path > right.path ? 1 : 0);
|
|
60734
|
-
return
|
|
60703
|
+
return createHash10("sha256").update(canonicalJson({ schemaVersion: "web-api-qualification-app-tree/v1", files: sorted2 })).digest("hex");
|
|
60735
60704
|
}
|
|
60736
60705
|
function positiveProbeVerdict(probe, observation, facts2) {
|
|
60737
60706
|
const failed2 = { ok: false, reason: `positive-probe-failed:${probe.probeId}` };
|
|
@@ -60787,7 +60756,7 @@ function evaluateWebApiProbeObservation(probeId, observationInput) {
|
|
|
60787
60756
|
return observation.runUnavailableReason === "build-failed" && observation.collectorStatus === null && observation.buildExitCode === WEB_API_IMDS_DENIAL_EXIT_CODE ? { ok: true } : wrongCause;
|
|
60788
60757
|
}
|
|
60789
60758
|
function webApiRuntimeInstallProposalSha256(value) {
|
|
60790
|
-
return
|
|
60759
|
+
return createHash10("sha256").update(canonicalJson(WebApiRuntimeInstallProposalSchema.parse(value))).digest("hex");
|
|
60791
60760
|
}
|
|
60792
60761
|
var WEB_API_CHALLENGE_LIFETIME_MS, WEB_API_RUNTIME_PROFILE_ID, WEB_API_RUNTIME_SCOPE, WEB_API_IMDS_DENIAL_EXIT_CODE, WEB_API_AGENT_PROBE_ROUTE, WEB_API_AGENT_PROBE_LIMITS, webApiProbeAssetManifestPath, requiredProbes, WEB_API_REQUIRED_PROBES, WEB_API_REQUIRED_PROBE_IDS, WEB_API_BASE_PROBE_COUNT, WEB_API_BEFORE_PRIVATE_NETWORK_PROBE_COUNT, WEB_API_AGENT_PROBE_IDS, probeIdSchema, WEB_API_PROBE_LIVE_TARGET_ENV, privateIpv4, WebApiProbeLiveTargetsSchema, SANDBOX_EGRESS_PROBE_IDS, digest6, WEB_API_QUALIFICATION_APP_MANIFEST_PREFIX, WEB_API_QUALIFICATION_APP_TREE_DIGEST, WebApiProbeObservationSchema, WEB_API_PROBE_PROPOSAL_MAX_BYTES, jsonObject2, runIdSchema, WebApiProbeEvidenceSchema, sameList, ProbeRecordSchema, WebApiRuntimeInstallProposalSchema, WEB_API_NETWORK_POLICY, WEB_API_NETWORK_POLICY_DIGEST;
|
|
60793
60762
|
var init_e2e_web_api_qualification = __esm({
|
|
@@ -61024,7 +60993,7 @@ var init_e2e_web_api_qualification = __esm({
|
|
|
61024
60993
|
hostAccess: "denied",
|
|
61025
60994
|
privateRanges: "denied"
|
|
61026
60995
|
});
|
|
61027
|
-
WEB_API_NETWORK_POLICY_DIGEST =
|
|
60996
|
+
WEB_API_NETWORK_POLICY_DIGEST = createHash10("sha256").update(canonicalJson(WEB_API_NETWORK_POLICY)).digest("hex");
|
|
61028
60997
|
}
|
|
61029
60998
|
});
|
|
61030
60999
|
|
|
@@ -61932,9 +61901,9 @@ var init_project_setup_status = __esm({
|
|
|
61932
61901
|
});
|
|
61933
61902
|
|
|
61934
61903
|
// packages/contracts/dist/company-invites.js
|
|
61935
|
-
import { createHash as
|
|
61904
|
+
import { createHash as createHash11, randomBytes as randomBytes2 } from "node:crypto";
|
|
61936
61905
|
function companyInviteCodeHash(code2) {
|
|
61937
|
-
return
|
|
61906
|
+
return createHash11("sha256").update(code2, "utf8").digest("hex");
|
|
61938
61907
|
}
|
|
61939
61908
|
function newCompanyInviteCode() {
|
|
61940
61909
|
const code2 = `${COMPANY_INVITE_CODE_PREFIX}${randomBytes2(CODE_BYTES).toString("base64url")}`;
|
|
@@ -61942,7 +61911,7 @@ function newCompanyInviteCode() {
|
|
|
61942
61911
|
return { code: code2, codeHash, codeId: companyInviteCodeId(codeHash) };
|
|
61943
61912
|
}
|
|
61944
61913
|
function companyInviteEmailHash(email4) {
|
|
61945
|
-
return
|
|
61914
|
+
return createHash11("sha256").update(email4.trim().toLowerCase(), "utf8").digest("hex");
|
|
61946
61915
|
}
|
|
61947
61916
|
var COMPANY_INVITE_CODE_PREFIX, CODE_BYTES, CompanyInviteCodeHashSchema, CompanyInviteCodeIdSchema, CompanyInviteExpiryHoursSchema, companyInviteCodeId, CompanyInviteViewSchema, CompanyInviteListSchema, CompanySelfServeNameSchema, CompanySelfCreateBodySchema, CompanySelfCreateResponseSchema, COMPANY_INVITE_LINK_PREFIX, COMPANY_INVITE_LINK_MAX, CompanyPreapprovalCreatedSchema, COMPANY_PREAPPROVALS_PATH, CompanyInviteEmailHashSchema, CompanyPreapprovalViewSchema, CompanyPreapprovalListSchema;
|
|
61948
61917
|
var init_company_invites = __esm({
|
|
@@ -62082,9 +62051,9 @@ var init_slack_confirmation = __esm({
|
|
|
62082
62051
|
});
|
|
62083
62052
|
|
|
62084
62053
|
// packages/contracts/dist/system-owner.js
|
|
62085
|
-
import { createHash as
|
|
62054
|
+
import { createHash as createHash12 } from "node:crypto";
|
|
62086
62055
|
function systemOwnerIdOf(orgId, project3) {
|
|
62087
|
-
return `${SYSTEM_OWNER_ID_PREFIX}${
|
|
62056
|
+
return `${SYSTEM_OWNER_ID_PREFIX}${createHash12("sha256").update("rovara-system-owner\0").update(orgId).update("\0").update(project3).digest("hex")}`;
|
|
62088
62057
|
}
|
|
62089
62058
|
var SYSTEM_OWNER_ID_PREFIX, SystemOwnerIdSchema, isSystemOwnerId, AUTOMATIC_JOBS, AutomaticJobSchema, AUTOMATIC_RUN_PURPOSES, AutomaticRunPurposeSchema, AutomaticRunMarkSchema, DEFAULT_AUTOMATIC_RUNS_PER_MONTH, MAX_AUTOMATIC_RUNS_PER_MONTH, AUTOMATIC_RUN_MAX_MS;
|
|
62090
62059
|
var init_system_owner = __esm({
|
|
@@ -63454,7 +63423,7 @@ var init_e2e_runtime_capabilities = __esm({
|
|
|
63454
63423
|
});
|
|
63455
63424
|
|
|
63456
63425
|
// packages/contracts/dist/e2e-runtime-registration.js
|
|
63457
|
-
import { createHash as
|
|
63426
|
+
import { createHash as createHash13 } from "node:crypto";
|
|
63458
63427
|
function parseStrictUtcIsoTimestamp(value) {
|
|
63459
63428
|
const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?Z$/.exec(value);
|
|
63460
63429
|
if (match === null)
|
|
@@ -63496,7 +63465,7 @@ var init_e2e_runtime_registration = __esm({
|
|
|
63496
63465
|
digest8 = external_exports.string().regex(/^[a-f0-9]{64}$/);
|
|
63497
63466
|
identifier2 = (max = 120) => external_exports.string().trim().min(1).max(max);
|
|
63498
63467
|
uniqueIds = (max = 64) => external_exports.array(identifier2()).min(1).max(max).refine((items) => new Set(items).size === items.length, "probe identifiers must be unique");
|
|
63499
|
-
sha2562 = (value) =>
|
|
63468
|
+
sha2562 = (value) => createHash13("sha256").update(canonicalJson(value)).digest("hex");
|
|
63500
63469
|
fixturePath = external_exports.string().min(1).max(1024).superRefine((path6, context) => {
|
|
63501
63470
|
if (path6 !== path6.trim() || path6.startsWith("/") || path6.includes("\\") || path6.includes("\0") || [...path6].some((char) => char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127) || path6.split("/").some((part) => part === "" || part === "." || part === "..") || /^[a-z][a-z0-9+.-]*:/i.test(path6) || path6.startsWith("//")) {
|
|
63502
63471
|
context.addIssue({ code: "custom", message: "fixture path must be normalized relative POSIX syntax" });
|
|
@@ -63656,7 +63625,7 @@ var init_e2e_replay = __esm({
|
|
|
63656
63625
|
});
|
|
63657
63626
|
|
|
63658
63627
|
// packages/contracts/dist/e2e-application-execution.js
|
|
63659
|
-
import { createHash as
|
|
63628
|
+
import { createHash as createHash14 } from "node:crypto";
|
|
63660
63629
|
function gitTreeSha(entries) {
|
|
63661
63630
|
const root5 = { files: [], dirs: /* @__PURE__ */ new Map() };
|
|
63662
63631
|
for (const entry of entries) {
|
|
@@ -63678,13 +63647,13 @@ function gitTreeSha(entries) {
|
|
|
63678
63647
|
const write2 = (node2) => {
|
|
63679
63648
|
const records = [
|
|
63680
63649
|
...node2.files.map((file2) => ({ name: file2.name, directory: false, bytes: Buffer.concat([Buffer.from(`${file2.mode} ${file2.name}\0`), Buffer.from(file2.objectId, "hex")]) })),
|
|
63681
|
-
...[...node2.dirs].map(([name3, child]) => ({ name: name3, directory: true, bytes: Buffer.concat([Buffer.from(`40000 ${name3}\0`), Buffer.from(
|
|
63650
|
+
...[...node2.dirs].map(([name3, child]) => ({ name: name3, directory: true, bytes: Buffer.concat([Buffer.from(`40000 ${name3}\0`), Buffer.from(createHash14("sha1").update(write2(child)).digest("hex"), "hex")]) }))
|
|
63682
63651
|
];
|
|
63683
63652
|
records.sort((a5, b5) => Buffer.compare(Buffer.from(a5.name + (a5.directory ? "/" : "")), Buffer.from(b5.name + (b5.directory ? "/" : ""))));
|
|
63684
63653
|
const body = Buffer.concat(records.map((record4) => record4.bytes));
|
|
63685
63654
|
return Buffer.concat([Buffer.from(`tree ${body.byteLength}\0`), body]);
|
|
63686
63655
|
};
|
|
63687
|
-
return
|
|
63656
|
+
return createHash14("sha1").update(write2(root5)).digest("hex");
|
|
63688
63657
|
}
|
|
63689
63658
|
function e2eRuntimeBindingKey(runtimeProfileId, kind) {
|
|
63690
63659
|
return `${runtimeProfileId}#${kind}`;
|
|
@@ -63758,7 +63727,7 @@ var init_e2e_application_execution = __esm({
|
|
|
63758
63727
|
context.addIssue({ code: "custom", path: ["treeEntries"], message: "complete tree inventory cannot be encoded as a Git tree" });
|
|
63759
63728
|
}
|
|
63760
63729
|
const { manifestDigest, ...body } = manifest;
|
|
63761
|
-
if (
|
|
63730
|
+
if (createHash14("sha256").update(canonicalJson(body)).digest("hex") !== manifestDigest)
|
|
63762
63731
|
context.addIssue({ code: "custom", path: ["manifestDigest"], message: "source manifest digest does not match its canonical content" });
|
|
63763
63732
|
});
|
|
63764
63733
|
E2EApplicationEvidenceRefSchema = external_exports.object({ artifactId: id7(200), sha256: sha2563, byteLength: external_exports.number().int().nonnegative().max(26214400), mediaType: id7(120) }).strict();
|
|
@@ -64013,17 +63982,17 @@ var init_e2e_application_execution = __esm({
|
|
|
64013
63982
|
context.addIssue({ code: "custom", path: [], message: "admission launch targets and group bindings must be sorted by their unique identities" });
|
|
64014
63983
|
}
|
|
64015
63984
|
const { admissionDigest, ...body } = admission;
|
|
64016
|
-
if (
|
|
63985
|
+
if (createHash14("sha256").update(canonicalJson(body)).digest("hex") !== admissionDigest)
|
|
64017
63986
|
context.addIssue({ code: "custom", path: ["admissionDigest"], message: "admission digest does not match its canonical content" });
|
|
64018
63987
|
});
|
|
64019
63988
|
}
|
|
64020
63989
|
});
|
|
64021
63990
|
|
|
64022
63991
|
// packages/contracts/dist/e2e-application-services.js
|
|
64023
|
-
import { createHash as
|
|
63992
|
+
import { createHash as createHash15 } from "node:crypto";
|
|
64024
63993
|
function e2eApplicationPreparedEnvironmentDigest(value) {
|
|
64025
63994
|
const body = Object.fromEntries(Object.entries(value).filter(([key2]) => key2 !== "preparedDigest"));
|
|
64026
|
-
return
|
|
63995
|
+
return createHash15("sha256").update(canonicalJson(body)).digest("hex");
|
|
64027
63996
|
}
|
|
64028
63997
|
var digest10, id8, revision, utc, uuid3, envName, E2EApplicationExternalConnectionRefSchema, contractPath, E2EApplicationServiceContractSchema, E2EApplicationHostPreparationBindingSchema, E2EApplicationProcessIdentitySchema, canonicalOrigin, uniqueBy, E2EApplicationPreparedServiceSchema, E2EApplicationPreparedOriginSchema, E2EApplicationPreparedEnvironmentSchema, absoluteInstalledPath, installedDigest, installedId, E2ELinuxApplicationProfileSchema;
|
|
64029
63998
|
var init_e2e_application_services = __esm({
|
|
@@ -64180,147 +64149,15 @@ var init_e2e_application_services = __esm({
|
|
|
64180
64149
|
}
|
|
64181
64150
|
});
|
|
64182
64151
|
|
|
64183
|
-
// packages/contracts/dist/e2e-package-manifests.js
|
|
64184
|
-
function e2ePackageManifests(sources) {
|
|
64185
|
-
return [...sources].filter((source3) => source3.kind === "blob" && /(^|\/)package\.json$/.test(source3.path) && !e2eRunnerUnsafePath.test(source3.path)).sort((a5, b5) => a5.path.localeCompare(b5.path));
|
|
64186
|
-
}
|
|
64187
|
-
function parseE2EPackageManifest(source3) {
|
|
64188
|
-
return JSON.parse(Buffer.from(source3.bytes).toString("utf8"));
|
|
64189
|
-
}
|
|
64190
|
-
var e2eRunnerUnsafePath;
|
|
64191
|
-
var init_e2e_package_manifests = __esm({
|
|
64192
|
-
"packages/contracts/dist/e2e-package-manifests.js"() {
|
|
64193
|
-
"use strict";
|
|
64194
|
-
e2eRunnerUnsafePath = /(^|\/)(?:\.env(?:\..*)?|secrets?|credentials?|.*(?:token|password|private[-_]?key).*)$/i;
|
|
64195
|
-
}
|
|
64196
|
-
});
|
|
64197
|
-
|
|
64198
64152
|
// packages/contracts/dist/e2e-application-accounts.js
|
|
64199
|
-
|
|
64200
|
-
function nativeApplicationRoot(path6) {
|
|
64201
|
-
const android = /^(.*?)(?:\/src\/main)\/AndroidManifest\.xml$/i.exec(path6);
|
|
64202
|
-
if (android)
|
|
64203
|
-
return android[1] || ".";
|
|
64204
|
-
const apple = /^(.*?)(?:\/[^/]+\.xcodeproj)\/project\.pbxproj$/i.exec(path6);
|
|
64205
|
-
return apple ? apple[1] || "." : void 0;
|
|
64206
|
-
}
|
|
64207
|
-
function nativeProjectContract(snapshot, path6) {
|
|
64208
|
-
const source3 = snapshot.sources.find((item2) => item2.path === path6 && item2.kind === "blob");
|
|
64209
|
-
if (!source3 || source3.bytes.byteLength > 262144)
|
|
64210
|
-
throw new Error("native application sidecar is missing or exceeds its source byte limit");
|
|
64211
|
-
let raw2;
|
|
64212
|
-
try {
|
|
64213
|
-
raw2 = copyBoundedE2EJsonData(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(source3.bytes)), { maxBytes: 262144, maxDepth: 32 });
|
|
64214
|
-
} catch {
|
|
64215
|
-
throw new Error("native application sidecar is not bounded valid UTF-8 JSON");
|
|
64216
|
-
}
|
|
64217
|
-
const contract = E2EApplicationProjectContractSchema.parse(raw2);
|
|
64218
|
-
const { recipeDigest: recipeDigest2, ...body } = contract.recipe;
|
|
64219
|
-
if (sha(body) !== recipeDigest2)
|
|
64220
|
-
throw new Error("native application source recipe digest does not match its canonical fields");
|
|
64221
|
-
return contract;
|
|
64222
|
-
}
|
|
64223
|
-
function readE2EApplicationProjectContract(snapshot, applicationId) {
|
|
64224
|
-
verifyE2ESourceSnapshot(snapshot, snapshot.candidate);
|
|
64225
|
-
const packages = e2ePackageManifests(snapshot.sources);
|
|
64226
|
-
const declaredNames = /* @__PURE__ */ new Map();
|
|
64227
|
-
for (const source4 of packages) {
|
|
64228
|
-
try {
|
|
64229
|
-
const value = parseE2EPackageManifest(source4);
|
|
64230
|
-
if (typeof value?.name === "string" && /^[a-zA-Z0-9_.@/-]{1,120}$/.test(value.name))
|
|
64231
|
-
declaredNames.set(value.name, (declaredNames.get(value.name) ?? 0) + 1);
|
|
64232
|
-
} catch {
|
|
64233
|
-
}
|
|
64234
|
-
}
|
|
64235
|
-
const matched = packages.filter((source4) => {
|
|
64236
|
-
try {
|
|
64237
|
-
const parsed = parseE2EPackageManifest(source4);
|
|
64238
|
-
if (typeof parsed?.name !== "string")
|
|
64239
|
-
return false;
|
|
64240
|
-
const directory = source4.path.includes("/") ? source4.path.slice(0, source4.path.lastIndexOf("/")) : ".";
|
|
64241
|
-
const resolvedId = (declaredNames.get(parsed.name) ?? 0) > 1 ? `${parsed.name.slice(0, 106)}-${createHash17("sha256").update(directory).digest("hex").slice(0, 12)}` : parsed.name;
|
|
64242
|
-
return resolvedId === applicationId;
|
|
64243
|
-
} catch {
|
|
64244
|
-
return false;
|
|
64245
|
-
}
|
|
64246
|
-
});
|
|
64247
|
-
if (matched.length === 0) {
|
|
64248
|
-
const roots = new Set(snapshot.sources.map((source4) => nativeApplicationRoot(source4.path)).filter((root5) => root5 !== void 0));
|
|
64249
|
-
const owned3 = [...roots].filter((root5) => applicationId === `native-${createHash17("sha256").update(root5).digest("hex").slice(0, 12)}`);
|
|
64250
|
-
if (owned3.length > 1)
|
|
64251
|
-
throw new Error("native application identity is ambiguous across owning project roots");
|
|
64252
|
-
if (owned3.length === 1) {
|
|
64253
|
-
const root5 = owned3[0];
|
|
64254
|
-
const sidecarPath = root5 === "." ? ".agentx/e2e-application.json" : `${root5}/.agentx/e2e-application.json`;
|
|
64255
|
-
const sidecars = snapshot.sources.filter((source4) => source4.path === sidecarPath);
|
|
64256
|
-
if (sidecars.length === 0)
|
|
64257
|
-
return null;
|
|
64258
|
-
if (sidecars.length !== 1)
|
|
64259
|
-
throw new Error("native application sidecar is ambiguous within its owning project root");
|
|
64260
|
-
return nativeProjectContract(snapshot, sidecarPath);
|
|
64261
|
-
}
|
|
64262
|
-
if (packages.length > 0)
|
|
64263
|
-
throw new Error("application identity does not match any owning source package manifest");
|
|
64264
|
-
return null;
|
|
64265
|
-
}
|
|
64266
|
-
if (matched.length !== 1)
|
|
64267
|
-
throw new Error("application project metadata is ambiguous across source package manifests");
|
|
64268
|
-
const source3 = matched[0];
|
|
64269
|
-
const packageRoot = source3.path.includes("/") ? source3.path.slice(0, source3.path.lastIndexOf("/")) : ".";
|
|
64270
|
-
const nativeSidecar = packageRoot === "." ? ".agentx/e2e-application.json" : `${packageRoot}/.agentx/e2e-application.json`;
|
|
64271
|
-
if (snapshot.sources.some((item2) => item2.path === nativeSidecar))
|
|
64272
|
-
throw new Error("same application cannot have both package and native project contract authorities");
|
|
64273
|
-
if (source3.bytes.byteLength > 262144)
|
|
64274
|
-
throw new Error("application package metadata exceeds its source byte limit");
|
|
64275
|
-
const raw2 = copyBoundedE2EJsonData(parseE2EPackageManifest(source3), { maxBytes: 262144, maxDepth: 32 });
|
|
64276
|
-
const e2eRoot = raw2.agentx && typeof raw2.agentx === "object" && !Array.isArray(raw2.agentx) ? raw2.agentx : void 0;
|
|
64277
|
-
if (!e2eRoot || !Object.hasOwn(e2eRoot, "e2e"))
|
|
64278
|
-
return null;
|
|
64279
|
-
const contract = E2EApplicationProjectContractSchema.parse(e2eRoot.e2e);
|
|
64280
|
-
const { recipeDigest: recipeDigest2, ...body } = contract.recipe;
|
|
64281
|
-
if (sha(body) !== recipeDigest2)
|
|
64282
|
-
throw new Error("application source recipe digest does not match its canonical fields");
|
|
64283
|
-
return contract;
|
|
64284
|
-
}
|
|
64285
|
-
function e2eApplicationAccountTargetId(baseTargetId, profileId) {
|
|
64286
|
-
return `account-target-${sha([baseTargetId, profileId])}`;
|
|
64287
|
-
}
|
|
64288
|
-
function createE2EApplicationAccountTarget(baseTarget, profile2) {
|
|
64289
|
-
if (profile2.profileId === baseTarget.accountProfileId)
|
|
64290
|
-
return baseTarget;
|
|
64291
|
-
const target3 = E2ETargetSchema.parse({ ...baseTarget, targetId: e2eApplicationAccountTargetId(baseTarget.targetId, profile2.profileId), accountProfileId: profile2.profileId });
|
|
64292
|
-
return target3;
|
|
64293
|
-
}
|
|
64294
|
-
function bindE2EApplicationAccountTargets(input2) {
|
|
64295
|
-
const contract = E2EApplicationProjectContractSchema.parse(input2.contract);
|
|
64296
|
-
const bases = new Map(input2.baseTargets.map((target3) => [target3.targetId, target3]));
|
|
64297
|
-
const result4 = [...input2.baseTargets];
|
|
64298
|
-
for (const variant of contract.targetAccounts) {
|
|
64299
|
-
const base3 = bases.get(variant.baseTargetId);
|
|
64300
|
-
const profile2 = contract.accountProfiles.find((item2) => item2.profileId === variant.profileId);
|
|
64301
|
-
if (!base3 || !profile2 || base3.applicationId !== input2.applicationId || base3.kind === "contract")
|
|
64302
|
-
throw new Error("application account variant references a foreign or unsupported base target");
|
|
64303
|
-
if (base3.accountProfileId === variant.profileId)
|
|
64304
|
-
continue;
|
|
64305
|
-
result4.push(createE2EApplicationAccountTarget(base3, profile2));
|
|
64306
|
-
}
|
|
64307
|
-
if (result4.length > 12)
|
|
64308
|
-
throw new Error("application account variants exceed the target inventory limit");
|
|
64309
|
-
return result4;
|
|
64310
|
-
}
|
|
64311
|
-
var sha, E2E_ANONYMOUS_ACCOUNT_PROFILE_ID, digest11, boundedId2, profileSchema, E2EApplicationProjectContractSchema, E2EApplicationAccountDefinitionSchema, E2E_SYNTHETIC_ACCOUNT_TTL_DAYS, SYNTHETIC_ACCOUNT_TTL_MS, E2EApplicationAccountLatestSchema;
|
|
64153
|
+
var E2E_ANONYMOUS_ACCOUNT_PROFILE_ID, digest11, boundedId2, profileSchema, E2EApplicationProjectContractSchema, E2EApplicationAccountDefinitionSchema, E2E_SYNTHETIC_ACCOUNT_TTL_DAYS, SYNTHETIC_ACCOUNT_TTL_MS, E2EApplicationAccountLatestSchema;
|
|
64312
64154
|
var init_e2e_application_accounts = __esm({
|
|
64313
64155
|
"packages/contracts/dist/e2e-application-accounts.js"() {
|
|
64314
64156
|
"use strict";
|
|
64315
64157
|
init_zod();
|
|
64316
|
-
init_canonical_json();
|
|
64317
|
-
init_e2e_safe_data();
|
|
64318
64158
|
init_e2e_node();
|
|
64319
64159
|
init_e2e_application_services();
|
|
64320
64160
|
init_e2e_application_services();
|
|
64321
|
-
init_e2e_source();
|
|
64322
|
-
init_e2e_package_manifests();
|
|
64323
|
-
sha = (value) => createHash17("sha256").update(canonicalJson(value)).digest("hex");
|
|
64324
64161
|
E2E_ANONYMOUS_ACCOUNT_PROFILE_ID = "rovara-anonymous";
|
|
64325
64162
|
digest11 = external_exports.string().regex(/^[a-f0-9]{64}$/);
|
|
64326
64163
|
boundedId2 = (max = 120) => external_exports.string().trim().min(1).max(max);
|
|
@@ -64444,906 +64281,11 @@ var init_e2e_application_cli_launch = __esm({
|
|
|
64444
64281
|
});
|
|
64445
64282
|
|
|
64446
64283
|
// packages/contracts/dist/e2e-catalog.js
|
|
64447
|
-
|
|
64448
|
-
function normalizedPath(path6) {
|
|
64449
|
-
return path6.length > 0 && path6.length <= 1024 && !path6.startsWith("/") && !path6.includes("\\") && !path6.split("/").some((part) => part === "" || part === "." || part === ".." || unsafePathPart.test(part));
|
|
64450
|
-
}
|
|
64451
|
-
function nativeProjectRoot(path6, platform2) {
|
|
64452
|
-
const parts2 = path6.split("/");
|
|
64453
|
-
if (platform2 === "android") {
|
|
64454
|
-
const marker2 = parts2.findIndex((part, i5) => part === "src" && parts2[i5 + 1] === "main");
|
|
64455
|
-
if (marker2 >= 0 && parts2[marker2 + 2] === "AndroidManifest.xml")
|
|
64456
|
-
return parts2.slice(0, marker2).join("/") || ".";
|
|
64457
|
-
if (/build\.gradle(?:\.kts)?$/i.test(path6))
|
|
64458
|
-
return parts2.slice(0, -1).join("/") || ".";
|
|
64459
|
-
if (/AndroidManifest\.xml$/i.test(path6))
|
|
64460
|
-
return parts2.slice(0, -1).join("/") || ".";
|
|
64461
|
-
return void 0;
|
|
64462
|
-
}
|
|
64463
|
-
const index = parts2.indexOf(platform2);
|
|
64464
|
-
if (index < 0)
|
|
64465
|
-
return void 0;
|
|
64466
|
-
const prefix2 = parts2.slice(0, index);
|
|
64467
|
-
const rest = parts2.slice(index + 1);
|
|
64468
|
-
return [...prefix2, platform2, ...rest.slice(0, -1)].join("/") || platform2;
|
|
64469
|
-
}
|
|
64470
|
-
function componentDepth(path6) {
|
|
64471
|
-
return path6 === "." ? 0 : path6.split("/").filter(Boolean).length;
|
|
64472
|
-
}
|
|
64473
|
-
function nativeDesktopRoot(path6) {
|
|
64474
|
-
if (/\.csproj$|\.sln$/i.test(path6))
|
|
64475
|
-
return { root: path6.includes("/") ? path6.slice(0, path6.lastIndexOf("/")) : ".", os: "windows" };
|
|
64476
|
-
if (/(?:^|\/)linux\/(?:CMakeLists\.txt|meson\.build)$/i.test(path6))
|
|
64477
|
-
return { root: path6.slice(0, path6.lastIndexOf("/")), os: "linux" };
|
|
64478
|
-
return void 0;
|
|
64479
|
-
}
|
|
64480
|
-
function iosBundleIdentifier(path6, text16) {
|
|
64481
|
-
const raw2 = /Info\.plist$/i.test(path6) ? /<key>\s*CFBundleIdentifier\s*<\/key>\s*<string>\s*([^<\s][^<]*?)\s*<\/string>/i.exec(text16)?.[1] : /(?:^|\n)\s*PRODUCT_BUNDLE_IDENTIFIER\s*=\s*([^;\r\n]+)\s*;/m.exec(text16)?.[1]?.trim().replace(/^['"]|['"]$/g, "");
|
|
64482
|
-
return raw2 && !/[()$]/.test(raw2) && /^[A-Za-z0-9][A-Za-z0-9.-]{0,199}$/.test(raw2) ? raw2 : void 0;
|
|
64483
|
-
}
|
|
64484
|
-
function parseOpenStep(text16) {
|
|
64485
|
-
if (Buffer.byteLength(text16, "utf8") > MAX_SOURCE_FILE_BYTES)
|
|
64486
|
-
throw new Error("PBX source exceeds parser size limit");
|
|
64487
|
-
const tokens = [];
|
|
64488
|
-
for (let i5 = 0; i5 < text16.length; ) {
|
|
64489
|
-
const char = text16[i5];
|
|
64490
|
-
if (/\s/.test(char)) {
|
|
64491
|
-
i5 += 1;
|
|
64492
|
-
continue;
|
|
64493
|
-
}
|
|
64494
|
-
if (text16.startsWith("//", i5)) {
|
|
64495
|
-
const end2 = text16.indexOf("\n", i5 + 2);
|
|
64496
|
-
i5 = end2 < 0 ? text16.length : end2 + 1;
|
|
64497
|
-
continue;
|
|
64498
|
-
}
|
|
64499
|
-
if (text16.startsWith("/*", i5)) {
|
|
64500
|
-
const end2 = text16.indexOf("*/", i5 + 2);
|
|
64501
|
-
if (end2 < 0)
|
|
64502
|
-
throw new Error("unterminated PBX comment");
|
|
64503
|
-
i5 = end2 + 2;
|
|
64504
|
-
continue;
|
|
64505
|
-
}
|
|
64506
|
-
if ("{}()=;,".includes(char)) {
|
|
64507
|
-
tokens.push(char);
|
|
64508
|
-
i5 += 1;
|
|
64509
|
-
continue;
|
|
64510
|
-
}
|
|
64511
|
-
if (char === '"') {
|
|
64512
|
-
let value2 = "";
|
|
64513
|
-
i5 += 1;
|
|
64514
|
-
let closed = false;
|
|
64515
|
-
while (i5 < text16.length) {
|
|
64516
|
-
const next = text16[i5++];
|
|
64517
|
-
if (next === '"') {
|
|
64518
|
-
closed = true;
|
|
64519
|
-
break;
|
|
64520
|
-
}
|
|
64521
|
-
if (next === "\\") {
|
|
64522
|
-
if (i5 >= text16.length)
|
|
64523
|
-
break;
|
|
64524
|
-
value2 += text16[i5++];
|
|
64525
|
-
} else
|
|
64526
|
-
value2 += next;
|
|
64527
|
-
}
|
|
64528
|
-
if (!closed)
|
|
64529
|
-
throw new Error("unterminated PBX string");
|
|
64530
|
-
tokens.push(JSON.stringify(value2));
|
|
64531
|
-
continue;
|
|
64532
|
-
}
|
|
64533
|
-
const start = i5;
|
|
64534
|
-
while (i5 < text16.length && !/[\s{}()=;," ]/.test(text16[i5]))
|
|
64535
|
-
i5 += 1;
|
|
64536
|
-
if (start === i5)
|
|
64537
|
-
throw new Error("invalid PBX token");
|
|
64538
|
-
tokens.push(text16.slice(start, i5));
|
|
64539
|
-
if (tokens.length > 1e5)
|
|
64540
|
-
throw new Error("PBX token budget exceeded");
|
|
64541
|
-
}
|
|
64542
|
-
let cursor2 = 0;
|
|
64543
|
-
let nodes5 = 0;
|
|
64544
|
-
const parse10 = (depth) => {
|
|
64545
|
-
if (++nodes5 > 5e4 || depth > 48)
|
|
64546
|
-
throw new Error("PBX structure budget exceeded");
|
|
64547
|
-
const token = tokens[cursor2++];
|
|
64548
|
-
if (token === "{") {
|
|
64549
|
-
const result4 = /* @__PURE__ */ Object.create(null);
|
|
64550
|
-
while (tokens[cursor2] !== "}") {
|
|
64551
|
-
const keyToken = tokens[cursor2++];
|
|
64552
|
-
if (keyToken === void 0 || keyToken === "=" || keyToken === ";")
|
|
64553
|
-
throw new Error("invalid PBX dictionary key");
|
|
64554
|
-
const key2 = keyToken.startsWith('"') ? JSON.parse(keyToken) : keyToken;
|
|
64555
|
-
if (tokens[cursor2++] !== "=")
|
|
64556
|
-
throw new Error("invalid PBX dictionary assignment");
|
|
64557
|
-
if (Object.hasOwn(result4, key2))
|
|
64558
|
-
throw new Error("duplicate PBX dictionary key");
|
|
64559
|
-
result4[key2] = parse10(depth + 1);
|
|
64560
|
-
if (tokens[cursor2++] !== ";")
|
|
64561
|
-
throw new Error("invalid PBX dictionary terminator");
|
|
64562
|
-
}
|
|
64563
|
-
cursor2 += 1;
|
|
64564
|
-
return result4;
|
|
64565
|
-
}
|
|
64566
|
-
if (token === "(") {
|
|
64567
|
-
const result4 = [];
|
|
64568
|
-
while (tokens[cursor2] !== ")") {
|
|
64569
|
-
result4.push(parse10(depth + 1));
|
|
64570
|
-
if (tokens[cursor2] === ",")
|
|
64571
|
-
cursor2 += 1;
|
|
64572
|
-
else if (tokens[cursor2] !== ")")
|
|
64573
|
-
throw new Error("invalid PBX array separator");
|
|
64574
|
-
}
|
|
64575
|
-
cursor2 += 1;
|
|
64576
|
-
return result4;
|
|
64577
|
-
}
|
|
64578
|
-
if (token === void 0 || ["}", ")", "=", ";", ","].includes(token))
|
|
64579
|
-
throw new Error("invalid PBX value");
|
|
64580
|
-
return token.startsWith('"') ? JSON.parse(token) : token;
|
|
64581
|
-
};
|
|
64582
|
-
const value = parse10(0);
|
|
64583
|
-
if (cursor2 !== tokens.length || value === null || Array.isArray(value) || typeof value !== "object")
|
|
64584
|
-
throw new Error("invalid PBX root object");
|
|
64585
|
-
return value;
|
|
64586
|
-
}
|
|
64587
|
-
function dict(value) {
|
|
64588
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
64589
|
-
}
|
|
64590
|
-
function array2(value) {
|
|
64591
|
-
return Array.isArray(value) ? value : void 0;
|
|
64592
|
-
}
|
|
64593
|
-
function stringValue(value) {
|
|
64594
|
-
return typeof value === "string" ? value : void 0;
|
|
64595
|
-
}
|
|
64596
|
-
function parseAppleProject(path6, text16) {
|
|
64597
|
-
try {
|
|
64598
|
-
const root5 = dict(parseOpenStep(text16));
|
|
64599
|
-
const objects = dict(root5?.objects);
|
|
64600
|
-
const projectRef = stringValue(root5?.rootObject);
|
|
64601
|
-
if (!objects || !projectRef)
|
|
64602
|
-
throw new Error("PBX project root or objects are missing");
|
|
64603
|
-
const project3 = dict(objects[projectRef]);
|
|
64604
|
-
if (!project3 || stringValue(project3.isa) !== "PBXProject")
|
|
64605
|
-
throw new Error("PBX rootObject does not reference PBXProject");
|
|
64606
|
-
const targetRefs = array2(project3?.targets);
|
|
64607
|
-
if (!targetRefs || targetRefs.length > 128 || targetRefs.some((ref) => typeof ref !== "string"))
|
|
64608
|
-
throw new Error("PBX application target list is invalid or exceeds limits");
|
|
64609
|
-
if (new Set(targetRefs).size !== targetRefs.length)
|
|
64610
|
-
throw new Error("PBX application target list contains duplicate source-target references");
|
|
64611
|
-
const projectConfigurations = /* @__PURE__ */ new Map();
|
|
64612
|
-
const ambiguousProjectConfigurationNames = /* @__PURE__ */ new Set();
|
|
64613
|
-
const projectConfigurationsWithExternalBase = /* @__PURE__ */ new Set();
|
|
64614
|
-
const projectConfigListRef = stringValue(project3.buildConfigurationList);
|
|
64615
|
-
const projectConfigList = dict(projectConfigListRef ? objects[projectConfigListRef] : void 0);
|
|
64616
|
-
if (stringValue(projectConfigList?.isa) === "XCConfigurationList") {
|
|
64617
|
-
const projectConfigRefs = array2(projectConfigList?.buildConfigurations);
|
|
64618
|
-
if (projectConfigRefs && projectConfigRefs.length <= 32)
|
|
64619
|
-
for (const configRefValue of projectConfigRefs) {
|
|
64620
|
-
const configRef = stringValue(configRefValue);
|
|
64621
|
-
const config5 = dict(configRef ? objects[configRef] : void 0);
|
|
64622
|
-
const name3 = stringValue(config5?.name);
|
|
64623
|
-
const settings = dict(config5?.buildSettings);
|
|
64624
|
-
if (config5 && stringValue(config5.isa) === "XCBuildConfiguration" && name3 && settings && !projectConfigurations.has(name3) && !ambiguousProjectConfigurationNames.has(name3)) {
|
|
64625
|
-
projectConfigurations.set(name3, settings);
|
|
64626
|
-
if (stringValue(config5.baseConfigurationReference) !== void 0)
|
|
64627
|
-
projectConfigurationsWithExternalBase.add(name3);
|
|
64628
|
-
} else if (name3) {
|
|
64629
|
-
projectConfigurations.delete(name3);
|
|
64630
|
-
ambiguousProjectConfigurationNames.add(name3);
|
|
64631
|
-
}
|
|
64632
|
-
}
|
|
64633
|
-
}
|
|
64634
|
-
const projectDir = /^(.*?\.xcodeproj)\/project\.pbxproj$/i.exec(path6)?.[1];
|
|
64635
|
-
const plistPathFor = (rawValue) => {
|
|
64636
|
-
if (!rawValue || /\\/.test(rawValue))
|
|
64637
|
-
return void 0;
|
|
64638
|
-
const raw2 = rawValue.replace(/^\$\((?:SRCROOT|PROJECT_DIR)\)\/?|^\$\{(?:SRCROOT|PROJECT_DIR)\}\/?/, "");
|
|
64639
|
-
if (/\$\(|\$\{/.test(raw2))
|
|
64640
|
-
return void 0;
|
|
64641
|
-
if (!projectDir || !normalizedPath(raw2))
|
|
64642
|
-
return void 0;
|
|
64643
|
-
const joined3 = projectDir.includes("/") ? `${projectDir.slice(0, projectDir.lastIndexOf("/"))}/${raw2}` : raw2;
|
|
64644
|
-
return normalizedPath(joined3) ? joined3 : void 0;
|
|
64645
|
-
};
|
|
64646
|
-
const output2 = [];
|
|
64647
|
-
for (const targetRefValue of targetRefs) {
|
|
64648
|
-
const ref = stringValue(targetRefValue);
|
|
64649
|
-
const target3 = dict(objects[ref]);
|
|
64650
|
-
if (!target3 || stringValue(target3.isa) !== "PBXNativeTarget")
|
|
64651
|
-
throw new Error("PBX target reference is missing or has the wrong type");
|
|
64652
|
-
if (stringValue(target3.productType) !== "com.apple.product-type.application")
|
|
64653
|
-
continue;
|
|
64654
|
-
const configListRef = stringValue(target3.buildConfigurationList);
|
|
64655
|
-
const configList = dict(configListRef ? objects[configListRef] : void 0);
|
|
64656
|
-
if (!configList || stringValue(configList.isa) !== "XCConfigurationList")
|
|
64657
|
-
throw new Error("PBX target configuration list is missing or has the wrong type");
|
|
64658
|
-
const configRefs = array2(configList.buildConfigurations);
|
|
64659
|
-
if (!configRefs || configRefs.length === 0 || configRefs.length > 32)
|
|
64660
|
-
throw new Error("PBX build configurations are invalid or exceed limits");
|
|
64661
|
-
const configs = configRefs.map((configRefValue) => {
|
|
64662
|
-
const configRef = stringValue(configRefValue);
|
|
64663
|
-
const config5 = dict(configRef ? objects[configRef] : void 0);
|
|
64664
|
-
if (!config5 || stringValue(config5.isa) !== "XCBuildConfiguration")
|
|
64665
|
-
throw new Error("PBX build configuration is missing or has the wrong type");
|
|
64666
|
-
const settings = dict(config5.buildSettings) ?? {};
|
|
64667
|
-
const name3 = stringValue(config5.name);
|
|
64668
|
-
const inherited = name3 ? projectConfigurations.get(name3) : void 0;
|
|
64669
|
-
const hasExternalBaseConfig = stringValue(config5.baseConfigurationReference) !== void 0;
|
|
64670
|
-
const fact = (key2) => {
|
|
64671
|
-
const own3 = stringValue(settings[key2]);
|
|
64672
|
-
const value = own3 ?? (!hasExternalBaseConfig && name3 && !projectConfigurationsWithExternalBase.has(name3) && inherited ? stringValue(inherited[key2]) : void 0);
|
|
64673
|
-
return value?.trim() || void 0;
|
|
64674
|
-
};
|
|
64675
|
-
const sdk = fact("SDKROOT");
|
|
64676
|
-
const supported = fact("SUPPORTED_PLATFORMS")?.split(/\s+/).filter(Boolean) ?? [];
|
|
64677
|
-
const platformNames = [...sdk ? [sdk] : [], ...supported];
|
|
64678
|
-
const ios = platformNames.some((value) => value === "iphoneos" || value === "iphonesimulator");
|
|
64679
|
-
const mac3 = platformNames.some((value) => value === "macosx");
|
|
64680
|
-
const recognized = platformNames.length > 0 && platformNames.every((value) => ["iphoneos", "iphonesimulator", "macosx"].includes(value));
|
|
64681
|
-
const platform3 = recognized && ios !== mac3 ? ios ? "ios" : "macos" : void 0;
|
|
64682
|
-
const bundleId2 = fact("PRODUCT_BUNDLE_IDENTIFIER");
|
|
64683
|
-
const normalizedBundle = bundleId2 && /^[A-Za-z0-9][A-Za-z0-9.-]{0,199}$/.test(bundleId2) ? bundleId2 : void 0;
|
|
64684
|
-
return { platform: platform3, bundleId: normalizedBundle, plistPath: plistPathFor(fact("INFOPLIST_FILE")) };
|
|
64685
|
-
});
|
|
64686
|
-
const complete = configs.every((config5) => config5.platform && config5.bundleId && config5.plistPath);
|
|
64687
|
-
const oneValue = (values) => values.length > 0 && values.every((value) => value !== void 0 && value === values[0]) ? values[0] : void 0;
|
|
64688
|
-
const platform2 = complete ? oneValue(configs.map((config5) => config5.platform)) : void 0;
|
|
64689
|
-
const bundleId = complete ? oneValue(configs.map((config5) => config5.bundleId)) : void 0;
|
|
64690
|
-
const resolvedPlist = complete ? oneValue(configs.map((config5) => config5.plistPath)) : void 0;
|
|
64691
|
-
output2.push({ ref, ...platform2 ? { platform: platform2 } : {}, ...bundleId ? { bundleId } : {}, ...resolvedPlist ? { plistPath: resolvedPlist } : {} });
|
|
64692
|
-
}
|
|
64693
|
-
return { targets: output2 };
|
|
64694
|
-
} catch (error64) {
|
|
64695
|
-
return { targets: [], error: error64 instanceof Error ? error64.message.slice(0, 240) : "PBX metadata is unsupported" };
|
|
64696
|
-
}
|
|
64697
|
-
}
|
|
64698
|
-
function plistMetadata(text16) {
|
|
64699
|
-
const value = (key2) => new RegExp(`<key>\\s*${key2}\\s*<\\/key>\\s*<string>\\s*([^<]*?)\\s*<\\/string>`, "i").exec(text16)?.[1]?.trim();
|
|
64700
|
-
const platformArray = /<key>\s*CFBundleSupportedPlatforms\s*<\/key>\s*<array>([\s\S]*?)<\/array>/i.exec(text16)?.[1] ?? "";
|
|
64701
|
-
const bundleId = value("CFBundleIdentifier");
|
|
64702
|
-
const packageType = value("CFBundlePackageType");
|
|
64703
|
-
return { ...bundleId ? { bundleId } : {}, ...packageType ? { packageType } : {}, platforms: [...platformArray.matchAll(/<string>\s*([^<]+?)\s*<\/string>/gi)].map((match) => match[1].trim()) };
|
|
64704
|
-
}
|
|
64705
|
-
function portableOperationId(exportName, applicationId) {
|
|
64706
|
-
if (exportName !== "." && (!exportName.startsWith("./") || exportName.slice(2).split("/").some((part) => part === "" || part === "." || part === ".." || part.includes("*"))))
|
|
64707
|
-
throw new Error("only exact normalized package export names are supported");
|
|
64708
|
-
return "op-" + createHash18("sha256").update(canonicalJson([applicationId ?? "", exportName])).digest("hex");
|
|
64709
|
-
}
|
|
64710
|
-
function verifySnapshot(snapshot, expectedCandidate) {
|
|
64711
|
-
const sources = verifyE2ESourceSnapshot(snapshot, expectedCandidate);
|
|
64712
|
-
if (sources.size > MAX_SOURCE_FILES || [...sources.values()].some((source3) => source3.bytes.byteLength > MAX_SOURCE_FILE_BYTES))
|
|
64713
|
-
throw new Error("source snapshot exceeds the supported byte or file count limit");
|
|
64714
|
-
return sources;
|
|
64715
|
-
}
|
|
64716
|
-
function readyProfileId(readyProfiles, kind) {
|
|
64717
|
-
return readyProfiles.filter((item2) => item2.kind === kind).map((item2) => item2.profileId).sort()[0];
|
|
64718
|
-
}
|
|
64719
|
-
function proposeE2ESetup(input2) {
|
|
64720
|
-
const parsed = E2ERepositoryInspectionSchema.parse(input2.inspection);
|
|
64721
|
-
const sourceBytes = verifySnapshot(input2.snapshot, input2.expectedCandidate);
|
|
64722
|
-
if (parsed.candidateDigest !== input2.snapshot.candidate.digest)
|
|
64723
|
-
throw new Error("inspection candidate does not match the immutable source snapshot");
|
|
64724
|
-
const derived2 = inspectE2ERepository(input2.snapshot, input2.expectedCandidate).inspection;
|
|
64725
|
-
if (canonicalJson(parsed) !== canonicalJson(derived2) && canonicalJson(parsed) !== canonicalJson(inspectE2ERepositoryBeforeContractApiTargets(input2.snapshot, input2.expectedCandidate).inspection)) {
|
|
64726
|
-
throw new Error("inspection does not match source-derived applications, targets, recipes, graph and input catalog");
|
|
64727
|
-
}
|
|
64728
|
-
if (parsed.proposedScenarios.length !== 0)
|
|
64729
|
-
throw new Error("feature scenarios require a separate approved feature plan");
|
|
64730
|
-
const snapshotRefs = new Map([...sourceBytes].map(([path6, source3]) => [path6, source3.sha256]));
|
|
64731
|
-
for (const ref of parsed.sources)
|
|
64732
|
-
if (snapshotRefs.get(ref.path) !== ref.sha256)
|
|
64733
|
-
throw new Error("inspection source hash does not match the immutable snapshot");
|
|
64734
|
-
const requireSource = (path6) => {
|
|
64735
|
-
if (!snapshotRefs.has(path6))
|
|
64736
|
-
throw new Error("inspection references source path outside the snapshot: " + path6);
|
|
64737
|
-
};
|
|
64738
|
-
for (const application of parsed.applications)
|
|
64739
|
-
for (const path6 of application.sourcePaths)
|
|
64740
|
-
requireSource(path6);
|
|
64741
|
-
for (const edge of parsed.dependencyEdges)
|
|
64742
|
-
for (const path6 of edge.sourcePaths)
|
|
64743
|
-
requireSource(path6);
|
|
64744
|
-
for (const missing of parsed.missingInputs)
|
|
64745
|
-
for (const path6 of missing.sourcePaths)
|
|
64746
|
-
requireSource(path6);
|
|
64747
|
-
const appIds = new Set(parsed.applications.map((application) => application.applicationId));
|
|
64748
|
-
const targetsById = new Map(parsed.proposedTargets.map((target3) => [target3.targetId, target3]));
|
|
64749
|
-
for (const target3 of parsed.proposedTargets)
|
|
64750
|
-
if (!appIds.has(target3.applicationId))
|
|
64751
|
-
throw new Error("target references an unknown discovered application");
|
|
64752
|
-
for (const edge of parsed.dependencyEdges)
|
|
64753
|
-
if (!appIds.has(edge.fromApplicationId))
|
|
64754
|
-
throw new Error("dependency edge references an unknown application");
|
|
64755
|
-
const applicationIds = new Set(parsed.applications.map((application) => application.applicationId));
|
|
64756
|
-
for (const scenario of parsed.proposedScenarios) {
|
|
64757
|
-
if (scenario.requestedTargetIds.some((targetId) => !targetsById.has(targetId)))
|
|
64758
|
-
throw new Error("scenario assignment references an unknown requested target");
|
|
64759
|
-
if (!scenario.requestedTargetIds.some((targetId) => applicationIds.has(targetsById.get(targetId).applicationId)))
|
|
64760
|
-
throw new Error("scenario assignment does not reference a discovered application target");
|
|
64761
|
-
}
|
|
64762
|
-
for (const missing of parsed.missingInputs)
|
|
64763
|
-
if (missing.targetIds.some((targetId) => !targetsById.has(targetId)))
|
|
64764
|
-
throw new Error("missing input references an unknown target");
|
|
64765
|
-
const readyProfiles = input2.readyProfiles ?? [];
|
|
64766
|
-
const targets = parsed.proposedTargets.map((target3) => {
|
|
64767
|
-
if (target3.kind !== "web" && target3.kind !== "api")
|
|
64768
|
-
return target3;
|
|
64769
|
-
const profileId = readyProfileId(readyProfiles, target3.kind);
|
|
64770
|
-
return profileId === void 0 || target3.runtimeProfileId !== unavailableRuntimeProfile[target3.kind] ? target3 : { ...target3, runtimeProfileId: profileId };
|
|
64771
|
-
});
|
|
64772
|
-
const proposal = {
|
|
64773
|
-
candidateDigest: parsed.candidateDigest,
|
|
64774
|
-
applications: parsed.applications,
|
|
64775
|
-
targets,
|
|
64776
|
-
dependencyEdges: parsed.dependencyEdges,
|
|
64777
|
-
scenarios: parsed.proposedScenarios,
|
|
64778
|
-
sources: parsed.sources,
|
|
64779
|
-
missingInputs: parsed.missingInputs,
|
|
64780
|
-
state: parsed.missingInputs.some((item2) => item2.disposition === "blocking") ? "needs-input" : "proposed"
|
|
64781
|
-
};
|
|
64782
|
-
return E2ESetupProposalSchema.parse(proposal);
|
|
64783
|
-
}
|
|
64784
|
-
function verifyE2ESetupProposal(proposal, snapshot, expectedCandidate) {
|
|
64785
|
-
const readyProfiles = [];
|
|
64786
|
-
const proposedTargets = proposal.targets.map((target3) => {
|
|
64787
|
-
if (target3.kind !== "web" && target3.kind !== "api" || target3.runtimeProfileId.endsWith("-phase-unavailable"))
|
|
64788
|
-
return target3;
|
|
64789
|
-
if (!QUALIFIED_RUNTIME_PROFILE_IDS.includes(target3.runtimeProfileId))
|
|
64790
|
-
throw new Error("setup proposal names a runtime profile that is not a qualified web/API profile");
|
|
64791
|
-
readyProfiles.push({ kind: target3.kind, profileId: target3.runtimeProfileId });
|
|
64792
|
-
return { ...target3, runtimeProfileId: unavailableRuntimeProfile[target3.kind] };
|
|
64793
|
-
});
|
|
64794
|
-
const inspection = {
|
|
64795
|
-
candidateDigest: proposal.candidateDigest,
|
|
64796
|
-
sources: proposal.sources,
|
|
64797
|
-
applications: proposal.applications,
|
|
64798
|
-
proposedTargets,
|
|
64799
|
-
dependencyEdges: proposal.dependencyEdges,
|
|
64800
|
-
proposedScenarios: proposal.scenarios,
|
|
64801
|
-
missingInputs: proposal.missingInputs
|
|
64802
|
-
};
|
|
64803
|
-
const verified = proposeE2ESetup({ inspection, snapshot, expectedCandidate, readyProfiles });
|
|
64804
|
-
if (canonicalJson(E2ESetupProposalSchema.parse(proposal)) !== canonicalJson(verified))
|
|
64805
|
-
throw new Error("setup proposal differs from independently source-derived proposal");
|
|
64806
|
-
return verified;
|
|
64807
|
-
}
|
|
64808
|
-
function nodeServiceRecipe(manifest, treePaths) {
|
|
64809
|
-
if (manifest === null || typeof manifest !== "object" || Array.isArray(manifest))
|
|
64810
|
-
return null;
|
|
64811
|
-
const scripts = manifest.scripts;
|
|
64812
|
-
const script = (name3) => scripts !== null && typeof scripts === "object" && !Array.isArray(scripts) && typeof scripts[name3] === "string" && scripts[name3].trim() !== "";
|
|
64813
|
-
if (!script("start") || !NODE_LOCKFILES.some((path6) => treePaths.has(path6)))
|
|
64814
|
-
return null;
|
|
64815
|
-
const command5 = (args, timeoutMs) => ({ program: "npm", args, cwd: ".", timeoutMs, env: {} });
|
|
64816
|
-
const body = {
|
|
64817
|
-
schemaVersion: 1,
|
|
64818
|
-
build: [command5(["ci"], 3e5), ...script("build") ? [command5(["run", "build"], 3e5)] : []],
|
|
64819
|
-
launch: { kind: "service", start: { ...command5(["start"], 6e4), env: { PORT: NODE_WEB_PORT } }, health: { path: "/", expectedStatus: 200 } },
|
|
64820
|
-
serviceProfileIds: [],
|
|
64821
|
-
seedProfileId: "synthetic-seed-v1",
|
|
64822
|
-
accountProfileIds: ["synthetic"],
|
|
64823
|
-
allowedOrigins: ["app-origin"]
|
|
64824
|
-
};
|
|
64825
|
-
return E2EAppRecipeSchema.parse({ ...body, recipeDigest: createHash18("sha256").update(canonicalJson(body)).digest("hex") });
|
|
64826
|
-
}
|
|
64827
|
-
function inspectE2ERepositoryBeforeContractApiTargets(snapshot, expectedCandidate) {
|
|
64828
|
-
const { inspection, portableOperations } = discoverE2ERepository(snapshot, expectedCandidate, { contractApiTargets: false });
|
|
64829
|
-
return { inspection, portableOperations };
|
|
64830
|
-
}
|
|
64831
|
-
function inspectE2ERepository(snapshot, expectedCandidate) {
|
|
64832
|
-
const { inspection, portableOperations } = discoverE2ERepository(snapshot, expectedCandidate);
|
|
64833
|
-
return { inspection, portableOperations };
|
|
64834
|
-
}
|
|
64835
|
-
function discoverE2ERepository(snapshot, expectedCandidate, options = {}) {
|
|
64836
|
-
const recipeOrigins = /* @__PURE__ */ new Map();
|
|
64837
|
-
const anonymousBaseTargetIds = [];
|
|
64838
|
-
const sources = verifySnapshot(snapshot, expectedCandidate);
|
|
64839
|
-
const refs = [...sources.values()].filter((source3) => !runnerUnsafe.test(source3.path)).map(({ path: path6, sha256: sha2566 }) => ({ path: path6, sha256: sha2566 })).sort((a5, b5) => a5.path.localeCompare(b5.path));
|
|
64840
|
-
const applications = [];
|
|
64841
|
-
const proposedTargets = [];
|
|
64842
|
-
const dependencyEdges = [];
|
|
64843
|
-
const missingInputs = [];
|
|
64844
|
-
const portableOperations = [];
|
|
64845
|
-
const addApplication = (applicationId, kind, sourcePaths, targets, recipe = null) => {
|
|
64846
|
-
applications.push({ applicationId, kind, sourcePaths, recipe });
|
|
64847
|
-
proposedTargets.push(...targets);
|
|
64848
|
-
};
|
|
64849
|
-
const manifests = e2ePackageManifests(sources.values());
|
|
64850
|
-
const manifestDirs = manifests.map((manifest) => manifest.path.includes("/") ? manifest.path.slice(0, manifest.path.lastIndexOf("/")) : ".");
|
|
64851
|
-
const deepestPackageDir = (path6) => manifestDirs.filter((dir) => dir === "." || path6.startsWith(dir + "/")).sort((a5, b5) => componentDepth(b5) - componentDepth(a5) || a5.localeCompare(b5))[0];
|
|
64852
|
-
const declaredNames = /* @__PURE__ */ new Map();
|
|
64853
|
-
const manifestsByName = /* @__PURE__ */ new Map();
|
|
64854
|
-
for (const manifest of manifests) {
|
|
64855
|
-
try {
|
|
64856
|
-
const value = parseE2EPackageManifest(manifest);
|
|
64857
|
-
if (typeof value?.name === "string" && /^[a-zA-Z0-9_.@/-]{1,120}$/.test(value.name)) {
|
|
64858
|
-
declaredNames.set(value.name, (declaredNames.get(value.name) ?? 0) + 1);
|
|
64859
|
-
manifestsByName.set(value.name, [...manifestsByName.get(value.name) ?? [], manifest]);
|
|
64860
|
-
}
|
|
64861
|
-
} catch {
|
|
64862
|
-
}
|
|
64863
|
-
}
|
|
64864
|
-
const orderedManifests = [...manifests].sort((a5, b5) => {
|
|
64865
|
-
const aDir = a5.path.includes("/") ? a5.path.slice(0, a5.path.lastIndexOf("/")) : ".";
|
|
64866
|
-
const bDir = b5.path.includes("/") ? b5.path.slice(0, b5.path.lastIndexOf("/")) : ".";
|
|
64867
|
-
return componentDepth(aDir) - componentDepth(bDir) || aDir.localeCompare(bDir) || a5.path.localeCompare(b5.path);
|
|
64868
|
-
});
|
|
64869
|
-
for (const manifest of orderedManifests.slice(0, 32)) {
|
|
64870
|
-
let data;
|
|
64871
|
-
try {
|
|
64872
|
-
data = parseE2EPackageManifest(manifest);
|
|
64873
|
-
} catch {
|
|
64874
|
-
continue;
|
|
64875
|
-
}
|
|
64876
|
-
if (data === null || typeof data !== "object" || Array.isArray(data))
|
|
64877
|
-
continue;
|
|
64878
|
-
const pkg = data;
|
|
64879
|
-
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
64880
|
-
const relDir = manifest.path.includes("/") ? manifest.path.slice(0, manifest.path.lastIndexOf("/")) : ".";
|
|
64881
|
-
const validName = typeof pkg.name === "string" && /^[a-zA-Z0-9_.@/-]{1,120}$/.test(pkg.name) ? pkg.name : void 0;
|
|
64882
|
-
const appId = validName === void 0 ? "app-" + createHash18("sha256").update(relDir).digest("hex").slice(0, 12) : (declaredNames.get(validName) ?? 0) > 1 ? `${validName.slice(0, 106)}-${createHash18("sha256").update(relDir).digest("hex").slice(0, 12)}` : validName;
|
|
64883
|
-
const mobile = ["react-native", "expo"].some((name3) => name3 in deps);
|
|
64884
|
-
const electron = "electron" in deps;
|
|
64885
|
-
const api = ["express", "fastify", "@hono/node-server", "koa"].some((name3) => name3 in deps) || /(^|\/)(api|server)(\/|$)/i.test(relDir);
|
|
64886
|
-
const kind = api ? "api" : mobile ? "mobile" : electron ? "desktop" : "web";
|
|
64887
|
-
let projectContract = null;
|
|
64888
|
-
let projectContractMalformed = false;
|
|
64889
|
-
if (validName !== void 0 && (kind === "web" || kind === "api"))
|
|
64890
|
-
try {
|
|
64891
|
-
projectContract = readE2EApplicationProjectContract(snapshot, appId);
|
|
64892
|
-
} catch {
|
|
64893
|
-
projectContractMalformed = true;
|
|
64894
|
-
missingInputs.push({
|
|
64895
|
-
inputId: "application-project-contract-" + createHash18("sha256").update(manifest.path).digest("hex").slice(0, 12),
|
|
64896
|
-
targetIds: [],
|
|
64897
|
-
kind: "runtime",
|
|
64898
|
-
disposition: "blocking",
|
|
64899
|
-
reason: "Source-owned application project contract is malformed, ambiguous, or outside its approved owning package",
|
|
64900
|
-
sourcePaths: [manifest.path]
|
|
64901
|
-
});
|
|
64902
|
-
}
|
|
64903
|
-
const packageNativeFiles = [...sources.keys()].filter((path6) => (relDir === "." || path6.startsWith(relDir + "/")) && deepestPackageDir(path6) === relDir).sort();
|
|
64904
|
-
const nativeProjectCounts = /* @__PURE__ */ new Map();
|
|
64905
|
-
for (const platform2 of ["android", "ios"]) {
|
|
64906
|
-
const identities = packageNativeFiles.filter((path6) => platform2 === "android" ? /AndroidManifest\.xml$/.test(path6) : /Info\.plist$/.test(path6));
|
|
64907
|
-
nativeProjectCounts.set(platform2, new Set(identities.map((path6) => nativeProjectRoot(path6, platform2))).size);
|
|
64908
|
-
}
|
|
64909
|
-
const appFiles = packageNativeFiles.filter((path6) => {
|
|
64910
|
-
if (kind === "mobile")
|
|
64911
|
-
return !/(^|\/)(?:android|ios)\//i.test(path6) || (/(^|\/)android\//i.test(path6) ? nativeProjectCounts.get("android") === 1 : nativeProjectCounts.get("ios") === 1);
|
|
64912
|
-
if (/(^|\/)(?:android|ios)\//i.test(path6))
|
|
64913
|
-
return false;
|
|
64914
|
-
if (kind === "web" || kind === "api")
|
|
64915
|
-
return !/(?:\.csproj$|\.sln$|\.xcodeproj\/project\.pbxproj$|\.xcworkspace\/contents\.xcworkspacedata$|(?:^|\/)linux\/(?:CMakeLists\.txt|meson\.build)$|(?:^|\/)AndroidManifest\.xml$|(?:^|\/)Info\.plist$|(?:^|\/)build\.gradle(?:\.kts)?$)/i.test(path6);
|
|
64916
|
-
return true;
|
|
64917
|
-
});
|
|
64918
|
-
const sourcePaths = [manifest.path, ...appFiles.filter((path6) => /(?:openapi|swagger|schema|routes?|controllers?|AndroidManifest\.xml|Info\.plist|project\.pbxproj)/i.test(path6))].slice(0, 128);
|
|
64919
|
-
const packageDependencies = Object.keys(deps ?? {});
|
|
64920
|
-
const ops = [];
|
|
64921
|
-
if (pkg.exports !== null && typeof pkg.exports === "object" && !Array.isArray(pkg.exports)) {
|
|
64922
|
-
for (const [name3, targetPath] of Object.entries(pkg.exports)) {
|
|
64923
|
-
if (typeof targetPath !== "string" || !targetPath.startsWith("./"))
|
|
64924
|
-
continue;
|
|
64925
|
-
const resolved2 = relDir === "." ? targetPath.slice(2) : relDir + "/" + targetPath.slice(2);
|
|
64926
|
-
const file2 = sources.get(resolved2);
|
|
64927
|
-
if (file2 && normalizedPath(resolved2) && !runnerUnsafe.test(resolved2)) {
|
|
64928
|
-
sourcePaths.push(resolved2);
|
|
64929
|
-
try {
|
|
64930
|
-
ops.push({ applicationId: appId, targetIds: [], manifestPath: manifest.path, exportName: name3, operationId: portableOperationId(name3, appId), sourceRefs: [{ path: resolved2, sha256: file2.sha256 }] });
|
|
64931
|
-
} catch {
|
|
64932
|
-
}
|
|
64933
|
-
}
|
|
64934
|
-
}
|
|
64935
|
-
}
|
|
64936
|
-
let target3;
|
|
64937
|
-
const additionalTargets = [];
|
|
64938
|
-
if (kind === "web")
|
|
64939
|
-
target3 = { targetId: "web-" + (applications.length + 1), applicationId: appId, runtimeProfileId: "web-phase-unavailable", accountProfileId: "synthetic", kind: "web", browser: "chromium", viewport: { width: 1280, height: 720 } };
|
|
64940
|
-
else if (kind === "api")
|
|
64941
|
-
target3 = { targetId: "api-" + (applications.length + 1), applicationId: appId, runtimeProfileId: "api-phase-unavailable", accountProfileId: "synthetic", kind: "api", protocol: "http", originRef: "app-origin" };
|
|
64942
|
-
else if (kind === "mobile") {
|
|
64943
|
-
const androidManifests = appFiles.filter((path6) => /(?:^|\/)AndroidManifest\.xml$/i.test(path6));
|
|
64944
|
-
const iosMetadata = appFiles.filter((path6) => /(^|\/)ios\/.*Info\.plist$/.test(path6));
|
|
64945
|
-
const mobileTargets = [];
|
|
64946
|
-
for (const androidManifest of androidManifests) {
|
|
64947
|
-
const androidText = Buffer.from(sources.get(androidManifest).bytes).toString("utf8");
|
|
64948
|
-
const androidId = /\bpackage\s*=\s*["']([^"']+)["']/.exec(androidText)?.[1];
|
|
64949
|
-
if (androidId)
|
|
64950
|
-
mobileTargets.push({ targetId: "android-" + createHash18("sha256").update(`${relDir}\0${nativeProjectRoot(androidManifest, "android")}\0${androidId}`).digest("hex").slice(0, 10), applicationId: appId, runtimeProfileId: "android-phase-unavailable", accountProfileId: "synthetic", kind: "mobile", os: "android", appId: androidId, deviceProfileId: "no-device-selected" });
|
|
64951
|
-
else
|
|
64952
|
-
missingInputs.push({ inputId: "android-identity-" + createHash18("sha256").update(androidManifest).digest("hex").slice(0, 10), targetIds: [], kind: "target-selection", disposition: "blocking", reason: "Android manifest does not declare a resolvable package identity", sourcePaths: [androidManifest] });
|
|
64953
|
-
}
|
|
64954
|
-
for (const iosPath of iosMetadata) {
|
|
64955
|
-
const iosText = Buffer.from(sources.get(iosPath).bytes).toString("utf8");
|
|
64956
|
-
const iosId = iosBundleIdentifier(iosPath, iosText);
|
|
64957
|
-
const metadata = plistMetadata(iosText);
|
|
64958
|
-
const platformProven = metadata.packageType === "APPL" && metadata.platforms.length > 0 && metadata.platforms.every((value) => value === "iPhoneOS" || value === "iPhoneSimulator");
|
|
64959
|
-
if (iosId && platformProven)
|
|
64960
|
-
mobileTargets.push({ targetId: "ios-" + createHash18("sha256").update(`${relDir}\0${nativeProjectRoot(iosPath, "ios")}\0${iosId}`).digest("hex").slice(0, 10), applicationId: appId, runtimeProfileId: "ios-phase-unavailable", accountProfileId: "synthetic", kind: "mobile", os: "ios", appId: iosId, deviceProfileId: "no-device-selected" });
|
|
64961
|
-
}
|
|
64962
|
-
const mobileTargetsByPlatform = /* @__PURE__ */ new Map();
|
|
64963
|
-
for (const item2 of mobileTargets)
|
|
64964
|
-
if (item2.kind === "mobile")
|
|
64965
|
-
mobileTargetsByPlatform.set(item2.os, [...mobileTargetsByPlatform.get(item2.os) ?? [], item2]);
|
|
64966
|
-
for (const [platform2, items] of mobileTargetsByPlatform)
|
|
64967
|
-
if (items.length > 1)
|
|
64968
|
-
missingInputs.push({ inputId: `${platform2}-project-selection-${createHash18("sha256").update(relDir).digest("hex").slice(0, 10)}`, targetIds: items.map((item2) => item2.targetId), kind: "target-selection", disposition: "blocking", reason: `Multiple ${platform2} project identities are owned by this framework package; select the intended app`, sourcePaths: appFiles.filter((path6) => new RegExp(`(^|/)${platform2}/`).test(path6)).slice(0, 32) });
|
|
64969
|
-
target3 = mobileTargets.shift();
|
|
64970
|
-
if (target3)
|
|
64971
|
-
additionalTargets.push(...mobileTargets);
|
|
64972
|
-
if (!target3 && androidManifests.length === 0 && iosMetadata.length === 0)
|
|
64973
|
-
missingInputs.push({ inputId: "mobile-target-" + createHash18("sha256").update(manifest.path).digest("hex").slice(0, 10), targetIds: [], kind: "target-selection", disposition: "blocking", reason: "React Native package has no native platform manifest with an application identity", sourcePaths: [manifest.path] });
|
|
64974
|
-
} else
|
|
64975
|
-
target3 = { targetId: "desktop-" + (applications.length + 1), applicationId: appId, runtimeProfileId: "electron-phase-unavailable", accountProfileId: "synthetic", kind: "desktop", os: "linux", driver: "electron", appId };
|
|
64976
|
-
let recipe = null;
|
|
64977
|
-
let recipeFromInference = false;
|
|
64978
|
-
const hasStart = typeof pkg.scripts?.start === "string" && pkg.scripts.start.trim() !== "";
|
|
64979
|
-
const hasDev = typeof pkg.scripts?.dev === "string" && pkg.scripts.dev.trim() !== "";
|
|
64980
|
-
if (projectContract !== null)
|
|
64981
|
-
recipe = projectContract.recipe;
|
|
64982
|
-
if (kind === "web" || kind === "api") {
|
|
64983
|
-
if (hasStart !== hasDev) {
|
|
64984
|
-
if (projectContract === null && !projectContractMalformed) {
|
|
64985
|
-
const script = hasStart ? "start" : "dev";
|
|
64986
|
-
const inferred = hasStart && relDir === "." ? nodeServiceRecipe(pkg, new Set(snapshot.treePaths)) : null;
|
|
64987
|
-
const recipeBody = {
|
|
64988
|
-
schemaVersion: 1,
|
|
64989
|
-
build: [],
|
|
64990
|
-
launch: { kind: "service", start: { program: "npm", args: ["run", script], cwd: relDir, timeoutMs: 6e4, env: {} }, health: { path: "/", expectedStatus: 200 } },
|
|
64991
|
-
serviceProfileIds: [],
|
|
64992
|
-
seedProfileId: "synthetic-seed-v1",
|
|
64993
|
-
accountProfileIds: ["synthetic"],
|
|
64994
|
-
allowedOrigins: ["app-origin"]
|
|
64995
|
-
};
|
|
64996
|
-
recipeFromInference = inferred !== null;
|
|
64997
|
-
recipe = inferred ?? E2EAppRecipeSchema.parse({ ...recipeBody, recipeDigest: createHash18("sha256").update(canonicalJson(recipeBody)).digest("hex") });
|
|
64998
|
-
}
|
|
64999
|
-
} else if (hasStart && hasDev) {
|
|
65000
|
-
if (projectContract === null && !projectContractMalformed)
|
|
65001
|
-
missingInputs.push({ inputId: "recipe-choice-" + (applications.length + 1), targetIds: target3 ? [target3.targetId] : [], kind: "runtime", disposition: "blocking", reason: "The repository declares both start and dev recipes; choose the intended application launch contract", sourcePaths: [manifest.path] });
|
|
65002
|
-
}
|
|
65003
|
-
}
|
|
65004
|
-
let appTargets = target3 ? [target3, ...additionalTargets] : [];
|
|
65005
|
-
if (options.contractApiTargets !== false && kind === "web" && target3 !== void 0 && projectContract !== null) {
|
|
65006
|
-
const apiTargetId = "api-" + (applications.length + 1);
|
|
65007
|
-
if (projectContract.targetAccounts.some((item2) => item2.baseTargetId === apiTargetId)) {
|
|
65008
|
-
appTargets.push({ targetId: apiTargetId, applicationId: appId, runtimeProfileId: "api-phase-unavailable", accountProfileId: "synthetic", kind: "api", protocol: "http", originRef: "app-origin" });
|
|
65009
|
-
}
|
|
65010
|
-
}
|
|
65011
|
-
const baseTargetIds = appTargets.map((item2) => item2.targetId);
|
|
65012
|
-
if (projectContract !== null) {
|
|
65013
|
-
try {
|
|
65014
|
-
appTargets = bindE2EApplicationAccountTargets({ contract: projectContract, applicationId: appId, baseTargets: appTargets });
|
|
65015
|
-
} catch {
|
|
65016
|
-
missingInputs.push({
|
|
65017
|
-
inputId: "application-account-targets-" + createHash18("sha256").update(manifest.path).digest("hex").slice(0, 12),
|
|
65018
|
-
targetIds: appTargets.map((item2) => item2.targetId),
|
|
65019
|
-
kind: "target-selection",
|
|
65020
|
-
disposition: "blocking",
|
|
65021
|
-
reason: "Source account variants do not bind exact compatible base targets within the target inventory limit",
|
|
65022
|
-
sourcePaths: [manifest.path]
|
|
65023
|
-
});
|
|
65024
|
-
recipe = null;
|
|
65025
|
-
}
|
|
65026
|
-
}
|
|
65027
|
-
if (kind === "mobile" || kind === "desktop") {
|
|
65028
|
-
const runtimeSources = sourcePaths.filter((path6) => /AndroidManifest\.xml$|Info\.plist$|project\.pbxproj$|\.csproj$|\.sln$|CMakeLists\.txt$|meson\.build$/.test(path6));
|
|
65029
|
-
if (appTargets.length)
|
|
65030
|
-
missingInputs.push({ inputId: "native-runtime-" + (applications.length + 1), targetIds: appTargets.map((item2) => item2.targetId), kind: "runtime", disposition: "mock-substitutable", reason: `The ${kind} build and launch runtime profile is unavailable in this phase`, sourcePaths: runtimeSources.length ? runtimeSources : [manifest.path] });
|
|
65031
|
-
}
|
|
65032
|
-
if (recipe !== null)
|
|
65033
|
-
recipeOrigins.set(appId, projectContract !== null ? "project-contract" : recipeFromInference ? "inferred-node" : "start-script");
|
|
65034
|
-
addApplication(appId, kind, sourcePaths, appTargets, recipe);
|
|
65035
|
-
if ((kind === "web" || kind === "api") && recipe !== null && recipeOrigins.get(appId) !== "start-script")
|
|
65036
|
-
anonymousBaseTargetIds.push(...baseTargetIds);
|
|
65037
|
-
for (const dependency of packageDependencies) {
|
|
65038
|
-
const candidates = manifestsByName.get(dependency) ?? [];
|
|
65039
|
-
const spec = deps[dependency];
|
|
65040
|
-
const rel = manifest.path.includes("/") ? manifest.path.slice(0, manifest.path.lastIndexOf("/")) : ".";
|
|
65041
|
-
let explicitDir;
|
|
65042
|
-
if (typeof spec === "string" && /^(?:file|link):\.\.?\//.test(spec)) {
|
|
65043
|
-
const raw2 = spec.replace(/^(?:file|link):/, "");
|
|
65044
|
-
const parts2 = rel === "." ? [] : rel.split("/");
|
|
65045
|
-
let safe = true;
|
|
65046
|
-
for (const part of raw2.split("/")) {
|
|
65047
|
-
if (!part || part === ".")
|
|
65048
|
-
continue;
|
|
65049
|
-
if (part === "..") {
|
|
65050
|
-
if (!parts2.length) {
|
|
65051
|
-
safe = false;
|
|
65052
|
-
break;
|
|
65053
|
-
}
|
|
65054
|
-
parts2.pop();
|
|
65055
|
-
} else
|
|
65056
|
-
parts2.push(part);
|
|
65057
|
-
}
|
|
65058
|
-
if (safe)
|
|
65059
|
-
explicitDir = parts2.join("/") || ".";
|
|
65060
|
-
}
|
|
65061
|
-
const supplier = explicitDir === void 0 ? candidates.length === 1 ? candidates[0] : void 0 : candidates.find((candidate) => (candidate.path.includes("/") ? candidate.path.slice(0, candidate.path.lastIndexOf("/")) : ".") === explicitDir);
|
|
65062
|
-
if (supplier) {
|
|
65063
|
-
dependencyEdges.push({ fromApplicationId: appId, toComponentId: "package-" + createHash18("sha256").update(supplier.path).digest("hex").slice(0, 12), contractRef: `${manifest.path}#dependencies.${dependency}`, sourcePaths: [manifest.path, supplier.path].sort() });
|
|
65064
|
-
} else if (candidates.length > 1) {
|
|
65065
|
-
missingInputs.push({ inputId: "dependency-source-" + createHash18("sha256").update(`${manifest.path}\0${dependency}`).digest("hex").slice(0, 12), targetIds: [], kind: "runtime", disposition: "blocking", reason: `Dependency ${dependency} has multiple source suppliers; establish a workspace source relation`, sourcePaths: [manifest.path, ...candidates.map((candidate) => candidate.path)].sort() });
|
|
65066
|
-
}
|
|
65067
|
-
}
|
|
65068
|
-
for (const path6 of sourcePaths.filter((item2) => /(^|\/)(?:openapi|swagger)\.(?:json|ya?ml)$/i.test(item2))) {
|
|
65069
|
-
dependencyEdges.push({ fromApplicationId: appId, toComponentId: "api-schema-" + createHash18("sha256").update(path6).digest("hex").slice(0, 12), contractRef: path6, sourcePaths: [manifest.path, path6] });
|
|
65070
|
-
}
|
|
65071
|
-
for (const operation2 of ops) {
|
|
65072
|
-
operation2.targetIds.push(...appTargets.map((item2) => item2.targetId));
|
|
65073
|
-
portableOperations.push(operation2);
|
|
65074
|
-
}
|
|
65075
|
-
}
|
|
65076
|
-
for (const source3 of [...sources.values()].sort((a5, b5) => a5.path.localeCompare(b5.path))) {
|
|
65077
|
-
if (!/(^|\/)(?:openapi|swagger)\.(?:json|ya?ml)$/i.test(source3.path) || runnerUnsafe.test(source3.path) || sources.has(source3.path) && applications.some((application) => application.sourcePaths.includes(source3.path)))
|
|
65078
|
-
continue;
|
|
65079
|
-
if (applications.some((application) => application.sourcePaths.includes(source3.path)))
|
|
65080
|
-
continue;
|
|
65081
|
-
const appId = "api-contract-" + createHash18("sha256").update(source3.path).digest("hex").slice(0, 12);
|
|
65082
|
-
const stableId = createHash18("sha256").update(source3.path).digest("hex").slice(0, 12);
|
|
65083
|
-
const targetId = "api-schema-" + stableId;
|
|
65084
|
-
addApplication(appId, "api", [source3.path], [{ targetId, applicationId: appId, runtimeProfileId: "api-phase-unavailable", accountProfileId: "synthetic", kind: "api", protocol: "http", originRef: "app-origin" }]);
|
|
65085
|
-
missingInputs.push({ inputId: "service-recipe-" + stableId, targetIds: [targetId], kind: "runtime", disposition: "mock-substitutable", reason: "An API schema was found without a source-backed service launch recipe", sourcePaths: [source3.path] });
|
|
65086
|
-
}
|
|
65087
|
-
const appleOwnedPaths = /* @__PURE__ */ new Set();
|
|
65088
|
-
const pbxCreatedApplications = /* @__PURE__ */ new Set();
|
|
65089
|
-
const consumedFrameworkTargets = /* @__PURE__ */ new Set();
|
|
65090
|
-
const appleTargetProjectSources = /* @__PURE__ */ new Map();
|
|
65091
|
-
const xcodeProjects = [...sources.values()].filter((source3) => /\.xcodeproj\/project\.pbxproj$/i.test(source3.path)).sort((a5, b5) => a5.path.localeCompare(b5.path));
|
|
65092
|
-
const preexistingFrameworkTargets = new Set(proposedTargets.filter((target3) => !pbxCreatedApplications.has(target3.applicationId)).map((target3) => `${target3.applicationId}\0${target3.targetId}`));
|
|
65093
|
-
const appleProjectsByPath = new Map(xcodeProjects.map((source3) => [source3.path, parseAppleProject(source3.path, Buffer.from(source3.bytes).toString("utf8"))]));
|
|
65094
|
-
for (const projectSource of xcodeProjects) {
|
|
65095
|
-
appleOwnedPaths.add(projectSource.path);
|
|
65096
|
-
const project3 = appleProjectsByPath.get(projectSource.path);
|
|
65097
|
-
const projectRecords = [...project3.targets].sort((a5, b5) => a5.ref.localeCompare(b5.ref));
|
|
65098
|
-
if (project3.error || projectRecords.length === 0) {
|
|
65099
|
-
const id12 = createHash18("sha256").update(projectSource.path).digest("hex").slice(0, 12);
|
|
65100
|
-
missingInputs.push({ inputId: "apple-project-metadata-" + id12, targetIds: [], kind: "target-selection", disposition: "blocking", reason: project3.error ? `Apple project metadata is unresolved: ${project3.error}` : "Apple project has no source-confirmed application target", sourcePaths: [projectSource.path] });
|
|
65101
|
-
continue;
|
|
65102
|
-
}
|
|
65103
|
-
for (const record4 of projectRecords) {
|
|
65104
|
-
if (record4.plistPath)
|
|
65105
|
-
appleOwnedPaths.add(record4.plistPath);
|
|
65106
|
-
const ownerPaths = [projectSource.path, ...record4.plistPath && sources.has(record4.plistPath) ? [record4.plistPath] : []].sort();
|
|
65107
|
-
const stable2 = createHash18("sha256").update(`${projectSource.path}\0${record4.ref}`).digest("hex").slice(0, 12);
|
|
65108
|
-
if (!record4.platform || !record4.bundleId || !record4.plistPath || !sources.has(record4.plistPath)) {
|
|
65109
|
-
const kind = record4.platform === "ios" ? "mobile" : record4.platform === "macos" ? "desktop" : void 0;
|
|
65110
|
-
const appId = "apple-project-" + stable2;
|
|
65111
|
-
if (kind)
|
|
65112
|
-
addApplication(appId, kind, ownerPaths, []);
|
|
65113
|
-
missingInputs.push({ inputId: "apple-target-metadata-" + stable2, targetIds: [], kind: "target-selection", disposition: "blocking", reason: "Apple target platform, bundle identity, or associated in-snapshot INFOPLIST_FILE is unresolved", sourcePaths: ownerPaths });
|
|
65114
|
-
continue;
|
|
65115
|
-
}
|
|
65116
|
-
const plistText = Buffer.from(sources.get(record4.plistPath).bytes).toString("utf8");
|
|
65117
|
-
const plist = plistMetadata(plistText);
|
|
65118
|
-
const supported = plist.platforms.length === 0 || (record4.platform === "ios" ? plist.platforms.every((value) => value === "iPhoneOS" || value === "iPhoneSimulator") : plist.platforms.every((value) => value === "MacOSX"));
|
|
65119
|
-
if (plist.packageType !== void 0 && plist.packageType !== "APPL" || plist.bundleId !== void 0 && plist.bundleId !== record4.bundleId || !supported) {
|
|
65120
|
-
const appId = "apple-project-" + stable2;
|
|
65121
|
-
addApplication(appId, record4.platform === "ios" ? "mobile" : "desktop", ownerPaths, []);
|
|
65122
|
-
missingInputs.push({ inputId: "apple-target-metadata-" + stable2, targetIds: [], kind: "target-selection", disposition: "blocking", reason: "Apple target and associated plist application/platform/bundle metadata do not agree", sourcePaths: ownerPaths });
|
|
65123
|
-
continue;
|
|
65124
|
-
}
|
|
65125
|
-
const matches3 = applications.flatMap((application) => {
|
|
65126
|
-
if (!application.sourcePaths.includes(record4.plistPath))
|
|
65127
|
-
return [];
|
|
65128
|
-
return proposedTargets.filter((target4) => target4.applicationId === application.applicationId && (record4.platform === "ios" && target4.kind === "mobile" && target4.os === "ios" && target4.appId === record4.bundleId || record4.platform === "macos" && target4.kind === "desktop" && target4.os === "macos" && target4.appId === record4.bundleId) && preexistingFrameworkTargets.has(`${target4.applicationId}\0${target4.targetId}`)).map((target4) => ({ application, target: target4 }));
|
|
65129
|
-
});
|
|
65130
|
-
const frameworkMatch = matches3.length === 1 ? matches3[0] : void 0;
|
|
65131
|
-
const inverseMatches = frameworkMatch ? [...appleProjectsByPath.values()].flatMap((candidateProject) => candidateProject.targets).filter((candidate) => candidate.platform === record4.platform && candidate.bundleId === record4.bundleId && candidate.plistPath === record4.plistPath).length : 0;
|
|
65132
|
-
const uniquelyCorroboratedFrameworkMatch = frameworkMatch && inverseMatches === 1 ? frameworkMatch : void 0;
|
|
65133
|
-
if (uniquelyCorroboratedFrameworkMatch) {
|
|
65134
|
-
const key2 = `${uniquelyCorroboratedFrameworkMatch.application.applicationId}\0${uniquelyCorroboratedFrameworkMatch.target.targetId}`;
|
|
65135
|
-
uniquelyCorroboratedFrameworkMatch.application.sourcePaths = [.../* @__PURE__ */ new Set([...uniquelyCorroboratedFrameworkMatch.application.sourcePaths, projectSource.path])].sort();
|
|
65136
|
-
appleTargetProjectSources.set(uniquelyCorroboratedFrameworkMatch.target.targetId, projectSource.path);
|
|
65137
|
-
if (!consumedFrameworkTargets.has(key2)) {
|
|
65138
|
-
consumedFrameworkTargets.add(key2);
|
|
65139
|
-
continue;
|
|
65140
|
-
}
|
|
65141
|
-
}
|
|
65142
|
-
const existingOwners = frameworkMatch ? [frameworkMatch.application] : applications.filter((application) => application.sourcePaths.includes(record4.plistPath));
|
|
65143
|
-
if (existingOwners.length > 1) {
|
|
65144
|
-
missingInputs.push({ inputId: "apple-target-ownership-" + stable2, targetIds: [], kind: "target-selection", disposition: "blocking", reason: "Multiple existing applications own this Apple plist; target ownership is ambiguous", sourcePaths: ownerPaths });
|
|
65145
|
-
continue;
|
|
65146
|
-
}
|
|
65147
|
-
const existingOwner = existingOwners[0];
|
|
65148
|
-
const applicationId = existingOwner?.applicationId ?? "apple-" + createHash18("sha256").update(`${projectSource.path}\0${record4.plistPath}`).digest("hex").slice(0, 12);
|
|
65149
|
-
const targetId = "apple-target-" + stable2;
|
|
65150
|
-
const target3 = record4.platform === "ios" ? { targetId, applicationId, runtimeProfileId: "ios-phase-unavailable", accountProfileId: "synthetic", kind: "mobile", os: "ios", appId: record4.bundleId, deviceProfileId: "no-device-selected" } : { targetId, applicationId, runtimeProfileId: "native-macos-phase-unavailable", accountProfileId: "synthetic", kind: "desktop", os: "macos", driver: "native", appId: record4.bundleId };
|
|
65151
|
-
if (existingOwner) {
|
|
65152
|
-
existingOwner.sourcePaths = [.../* @__PURE__ */ new Set([...existingOwner.sourcePaths, ...ownerPaths])].sort();
|
|
65153
|
-
proposedTargets.push(target3);
|
|
65154
|
-
} else {
|
|
65155
|
-
addApplication(applicationId, record4.platform === "ios" ? "mobile" : "desktop", ownerPaths, [target3]);
|
|
65156
|
-
pbxCreatedApplications.add(applicationId);
|
|
65157
|
-
}
|
|
65158
|
-
appleTargetProjectSources.set(targetId, projectSource.path);
|
|
65159
|
-
missingInputs.push({ inputId: "native-runtime-" + stable2, targetIds: [targetId], kind: "runtime", disposition: "mock-substitutable", reason: `The ${record4.platform} native build and launch profile is unavailable in this phase`, sourcePaths: ownerPaths });
|
|
65160
|
-
if (matches3.length > 0 && !uniquelyCorroboratedFrameworkMatch) {
|
|
65161
|
-
missingInputs.push({ inputId: "native-association-" + stable2, targetIds: [targetId], kind: "runtime", disposition: "mock-substitutable", reason: "The source-backed native build association is ambiguous; the portable framework target is retained without claiming this PBX reference", sourcePaths: ownerPaths });
|
|
65162
|
-
}
|
|
65163
|
-
}
|
|
65164
|
-
}
|
|
65165
|
-
for (const source3 of [...sources.values()].filter((item2) => /Info\.plist$/i.test(item2.path)).sort((a5, b5) => a5.path.localeCompare(b5.path))) {
|
|
65166
|
-
if (appleOwnedPaths.has(source3.path))
|
|
65167
|
-
continue;
|
|
65168
|
-
const alreadyOwnedByTarget = applications.some((application) => application.sourcePaths.includes(source3.path) && proposedTargets.some((target4) => target4.applicationId === application.applicationId && (target4.kind === "mobile" && target4.os === "ios" || target4.kind === "desktop" && target4.os === "macos")));
|
|
65169
|
-
if (alreadyOwnedByTarget)
|
|
65170
|
-
continue;
|
|
65171
|
-
appleOwnedPaths.add(source3.path);
|
|
65172
|
-
const metadata = plistMetadata(Buffer.from(source3.bytes).toString("utf8"));
|
|
65173
|
-
const ios = metadata.platforms.length > 0 && metadata.platforms.every((value) => value === "iPhoneOS" || value === "iPhoneSimulator");
|
|
65174
|
-
const mac3 = metadata.platforms.length > 0 && metadata.platforms.every((value) => value === "MacOSX");
|
|
65175
|
-
const stable2 = createHash18("sha256").update(source3.path).digest("hex").slice(0, 12);
|
|
65176
|
-
if (metadata.packageType !== "APPL" || !metadata.bundleId || ios === mac3) {
|
|
65177
|
-
missingInputs.push({ inputId: "apple-plist-platform-" + stable2, targetIds: [], kind: "target-selection", disposition: "blocking", reason: "Standalone Apple plist does not establish an application bundle and one supported platform", sourcePaths: [source3.path] });
|
|
65178
|
-
continue;
|
|
65179
|
-
}
|
|
65180
|
-
const applicationId = "apple-plist-" + stable2;
|
|
65181
|
-
const targetId = "apple-target-" + stable2;
|
|
65182
|
-
const target3 = ios ? { targetId, applicationId, runtimeProfileId: "ios-phase-unavailable", accountProfileId: "synthetic", kind: "mobile", os: "ios", appId: metadata.bundleId, deviceProfileId: "no-device-selected" } : { targetId, applicationId, runtimeProfileId: "native-macos-phase-unavailable", accountProfileId: "synthetic", kind: "desktop", os: "macos", driver: "native", appId: metadata.bundleId };
|
|
65183
|
-
addApplication(applicationId, ios ? "mobile" : "desktop", [source3.path], [target3]);
|
|
65184
|
-
if (ios)
|
|
65185
|
-
appleTargetProjectSources.set(targetId, source3.path);
|
|
65186
|
-
missingInputs.push({ inputId: "native-runtime-" + stable2, targetIds: [targetId], kind: "runtime", disposition: "mock-substitutable", reason: `The ${ios ? "ios" : "macos"} native build and launch profile is unavailable in this phase`, sourcePaths: [source3.path] });
|
|
65187
|
-
}
|
|
65188
|
-
const packageIosProjectTargets = /* @__PURE__ */ new Map();
|
|
65189
|
-
for (const target3 of proposedTargets.filter((item2) => item2.kind === "mobile" && item2.os === "ios")) {
|
|
65190
|
-
const application = applications.find((item2) => item2.applicationId === target3.applicationId);
|
|
65191
|
-
const sourcePath2 = appleTargetProjectSources.get(target3.targetId) ?? application?.sourcePaths.find((item2) => /Info\.plist$/i.test(item2));
|
|
65192
|
-
if (!sourcePath2)
|
|
65193
|
-
continue;
|
|
65194
|
-
const owner = deepestPackageDir(sourcePath2);
|
|
65195
|
-
if (owner === void 0)
|
|
65196
|
-
continue;
|
|
65197
|
-
const projectIdentity = appleTargetProjectSources.get(target3.targetId) ?? nativeProjectRoot(sourcePath2, "ios");
|
|
65198
|
-
if (!projectIdentity)
|
|
65199
|
-
continue;
|
|
65200
|
-
const projects = packageIosProjectTargets.get(owner) ?? /* @__PURE__ */ new Map();
|
|
65201
|
-
const entry = projects.get(projectIdentity) ?? { targetIds: [], sourcePaths: /* @__PURE__ */ new Set() };
|
|
65202
|
-
entry.targetIds.push(target3.targetId);
|
|
65203
|
-
entry.sourcePaths.add(sourcePath2);
|
|
65204
|
-
projects.set(projectIdentity, entry);
|
|
65205
|
-
packageIosProjectTargets.set(owner, projects);
|
|
65206
|
-
}
|
|
65207
|
-
for (const [owner, projects] of packageIosProjectTargets) {
|
|
65208
|
-
if (projects.size < 2)
|
|
65209
|
-
continue;
|
|
65210
|
-
const targetIds = [...projects.values()].flatMap((entry) => entry.targetIds).sort();
|
|
65211
|
-
const sourcePaths = [...new Set([...projects.values()].flatMap((entry) => [...entry.sourcePaths]))].sort();
|
|
65212
|
-
missingInputs.push({ inputId: "ios-project-selection-" + createHash18("sha256").update(owner).digest("hex").slice(0, 10), targetIds, kind: "target-selection", disposition: "blocking", reason: "Multiple ios project identities are owned by this framework package; select the intended app", sourcePaths });
|
|
65213
|
-
}
|
|
65214
|
-
for (const source3 of [...sources.values()].filter((item2) => /(^|\/)Package\.swift$|\.xcworkspace\/contents\.xcworkspacedata$|(^|\/)ios\/.*project\.pbxproj$/i.test(item2.path)).sort((a5, b5) => a5.path.localeCompare(b5.path))) {
|
|
65215
|
-
if (appleOwnedPaths.has(source3.path))
|
|
65216
|
-
continue;
|
|
65217
|
-
appleOwnedPaths.add(source3.path);
|
|
65218
|
-
const stable2 = createHash18("sha256").update(source3.path).digest("hex").slice(0, 12);
|
|
65219
|
-
missingInputs.push({ inputId: "apple-source-metadata-" + stable2, targetIds: [], kind: "target-selection", disposition: "blocking", reason: "Apple source metadata does not prove a supported application platform and target", sourcePaths: [source3.path] });
|
|
65220
|
-
}
|
|
65221
|
-
const nativeMobile = [...sources.values()].filter((source3) => /(?:^|\/)AndroidManifest\.xml$|(?:^|\/)build\.gradle(?:\.kts)?$/.test(source3.path)).sort((a5, b5) => a5.path.localeCompare(b5.path));
|
|
65222
|
-
const nativeGroups = /* @__PURE__ */ new Map();
|
|
65223
|
-
for (const source3 of nativeMobile) {
|
|
65224
|
-
const platform2 = /AndroidManifest\.xml$|build\.gradle(?:\.kts)?$/.test(source3.path) ? "android" : "ios";
|
|
65225
|
-
const root5 = nativeProjectRoot(source3.path, platform2);
|
|
65226
|
-
if (!root5)
|
|
65227
|
-
continue;
|
|
65228
|
-
const key2 = `${platform2}\0${root5}`;
|
|
65229
|
-
const group4 = nativeGroups.get(key2) ?? { platform: platform2, root: root5, identitySource: source3.path, sourcePaths: [] };
|
|
65230
|
-
group4.sourcePaths.push(source3.path);
|
|
65231
|
-
if (platform2 === "android" && /AndroidManifest\.xml$/.test(source3.path) || platform2 === "ios" && /Info\.plist$/.test(source3.path))
|
|
65232
|
-
group4.identitySource = source3.path;
|
|
65233
|
-
nativeGroups.set(key2, group4);
|
|
65234
|
-
}
|
|
65235
|
-
for (const group4 of nativeGroups.values())
|
|
65236
|
-
group4.sourcePaths.sort();
|
|
65237
|
-
for (const group4 of nativeGroups.values()) {
|
|
65238
|
-
const { platform: platform2, root: root5, identitySource } = group4;
|
|
65239
|
-
if (applications.some((application) => application.sourcePaths.includes(identitySource)))
|
|
65240
|
-
continue;
|
|
65241
|
-
const identityText = Buffer.from(sources.get(identitySource).bytes).toString("utf8");
|
|
65242
|
-
const androidBuild = group4.sourcePaths.filter((path6) => /build\.gradle(?:\.kts)?$/.test(path6)).map((path6) => Buffer.from(sources.get(path6).bytes).toString("utf8"));
|
|
65243
|
-
const hasAndroidApplication = platform2 === "android" && (androidBuild.some((text16) => /com\.android\.application/.test(text16)) || /<application\b/i.test(identityText));
|
|
65244
|
-
if (platform2 === "android" && !hasAndroidApplication)
|
|
65245
|
-
continue;
|
|
65246
|
-
const nativeAppId = platform2 === "android" ? /\bpackage\s*=\s*["']([^"']+)["']/.exec(identityText)?.[1] : iosBundleIdentifier(identitySource, identityText);
|
|
65247
|
-
const appId = "native-mobile-" + createHash18("sha256").update(`${platform2}\0${root5}`).digest("hex").slice(0, 12);
|
|
65248
|
-
const appSources = [...sources.keys()].filter((path6) => path6 === root5 || path6.startsWith(root5 + "/")).sort().slice(0, 128);
|
|
65249
|
-
const platformName = platform2 === "android" ? "Android" : "iOS";
|
|
65250
|
-
if (!nativeAppId) {
|
|
65251
|
-
addApplication(appId, "mobile", appSources.length ? appSources : [identitySource], []);
|
|
65252
|
-
missingInputs.push({ inputId: `native-mobile-identity-${appId}`, targetIds: [], kind: "target-selection", disposition: "blocking", reason: `${platformName} source metadata has no resolvable application identifier`, sourcePaths: [identitySource] });
|
|
65253
|
-
continue;
|
|
65254
|
-
}
|
|
65255
|
-
const targetId = `${platform2}-` + createHash18("sha256").update(`${platform2}\0${root5}\0${nativeAppId}`).digest("hex").slice(0, 10);
|
|
65256
|
-
addApplication(appId, "mobile", appSources, [{ targetId, applicationId: appId, runtimeProfileId: `${platform2}-phase-unavailable`, accountProfileId: "synthetic", kind: "mobile", os: platform2, appId: nativeAppId, deviceProfileId: "no-device-selected" }]);
|
|
65257
|
-
missingInputs.push({ inputId: `native-mobile-runtime-${appId}`, targetIds: [targetId], kind: "runtime", disposition: "mock-substitutable", reason: `The ${platformName} build and launch profile is unavailable in this phase`, sourcePaths: [identitySource] });
|
|
65258
|
-
}
|
|
65259
|
-
const packageNativeTargets = /* @__PURE__ */ new Map();
|
|
65260
|
-
for (const group4 of nativeGroups.values()) {
|
|
65261
|
-
const owner = deepestPackageDir(group4.identitySource);
|
|
65262
|
-
if (owner === void 0)
|
|
65263
|
-
continue;
|
|
65264
|
-
const key2 = `${owner}\0${group4.platform}`;
|
|
65265
|
-
packageNativeTargets.set(key2, [...packageNativeTargets.get(key2) ?? [], { platform: group4.platform, targetId: `${group4.platform}-` + createHash18("sha256").update(`${group4.platform}\0${group4.root}\0${group4.identitySource}`).digest("hex").slice(0, 10), sourcePath: group4.identitySource }]);
|
|
65266
|
-
}
|
|
65267
|
-
for (const [key2, entries] of packageNativeTargets) {
|
|
65268
|
-
if (entries.length < 2)
|
|
65269
|
-
continue;
|
|
65270
|
-
const [owner, platform2] = key2.split("\0");
|
|
65271
|
-
const actualTargets = proposedTargets.filter((target3) => target3.kind === "mobile" && target3.os === platform2 && entries.some((entry) => applications.find((application) => application.applicationId === target3.applicationId)?.sourcePaths.includes(entry.sourcePath)));
|
|
65272
|
-
missingInputs.push({ inputId: `${platform2}-project-selection-${createHash18("sha256").update(owner).digest("hex").slice(0, 10)}`, targetIds: actualTargets.map((target3) => target3.targetId), kind: "target-selection", disposition: "blocking", reason: `Multiple ${platform2} project identities are owned by this package; select the intended app`, sourcePaths: entries.map((entry) => entry.sourcePath).sort() });
|
|
65273
|
-
}
|
|
65274
|
-
const unownedNativeRoots = /* @__PURE__ */ new Map();
|
|
65275
|
-
for (const group4 of nativeGroups.values()) {
|
|
65276
|
-
if (deepestPackageDir(group4.identitySource) !== void 0 || applications.some((application) => application.sourcePaths.includes(group4.identitySource) && application.sourcePaths.some((path6) => /\.xcodeproj\/project\.pbxproj$/.test(path6))))
|
|
65277
|
-
continue;
|
|
65278
|
-
const parent = group4.root.includes("/") ? group4.root.slice(0, group4.root.lastIndexOf("/")) : ".";
|
|
65279
|
-
if (parent !== group4.platform)
|
|
65280
|
-
continue;
|
|
65281
|
-
const key2 = `${group4.platform}\0${parent}`;
|
|
65282
|
-
unownedNativeRoots.set(key2, [...unownedNativeRoots.get(key2) ?? [], group4]);
|
|
65283
|
-
}
|
|
65284
|
-
for (const [key2, entries] of unownedNativeRoots) {
|
|
65285
|
-
if (entries.length < 2)
|
|
65286
|
-
continue;
|
|
65287
|
-
const [platform2, parent] = key2.split("\0");
|
|
65288
|
-
const targetIds = proposedTargets.filter((target3) => target3.kind === "mobile" && target3.os === platform2 && entries.some((group4) => applications.find((application) => application.applicationId === target3.applicationId)?.sourcePaths.includes(group4.identitySource))).map((target3) => target3.targetId);
|
|
65289
|
-
missingInputs.push({ inputId: `${platform2}-project-selection-${createHash18("sha256").update(parent).digest("hex").slice(0, 10)}`, targetIds, kind: "target-selection", disposition: "blocking", reason: `Multiple ${platform2} project identities share this source root; select the intended app`, sourcePaths: entries.map((group4) => group4.identitySource).sort() });
|
|
65290
|
-
}
|
|
65291
|
-
const nativeDesktop = [...sources.values()].filter((source3) => /(?:\.csproj$|\.sln$|\.xcworkspace\/contents\.xcworkspacedata$|(?:^|\/)linux\/(?:CMakeLists\.txt|meson\.build)$)/i.test(source3.path)).sort((a5, b5) => a5.path.localeCompare(b5.path));
|
|
65292
|
-
const seenNativeApps = /* @__PURE__ */ new Set();
|
|
65293
|
-
for (const source3 of nativeDesktop) {
|
|
65294
|
-
const project3 = nativeDesktopRoot(source3.path);
|
|
65295
|
-
if (!project3)
|
|
65296
|
-
continue;
|
|
65297
|
-
const { root: root5, os: os2 } = project3;
|
|
65298
|
-
const key2 = `${os2}\0${root5}`;
|
|
65299
|
-
if (seenNativeApps.has(key2))
|
|
65300
|
-
continue;
|
|
65301
|
-
const packageOwner = deepestPackageDir(source3.path);
|
|
65302
|
-
const packageManifest = packageOwner === void 0 ? void 0 : packageOwner === "." ? "package.json" : `${packageOwner}/package.json`;
|
|
65303
|
-
const mobileOwner = applications.some((application) => application.kind === "mobile" && packageManifest !== void 0 && application.sourcePaths.includes(packageManifest) && application.sourcePaths.includes(source3.path) && /(^|\/)ios\//i.test(source3.path));
|
|
65304
|
-
if (mobileOwner)
|
|
65305
|
-
continue;
|
|
65306
|
-
seenNativeApps.add(key2);
|
|
65307
|
-
const appId = "native-desktop-" + createHash18("sha256").update(key2).digest("hex").slice(0, 12);
|
|
65308
|
-
const targetId = "desktop-native-" + createHash18("sha256").update(key2).digest("hex").slice(0, 10);
|
|
65309
|
-
const appSources = [...sources.keys()].filter((path6) => path6 === root5 || path6.startsWith(root5 + "/")).sort();
|
|
65310
|
-
addApplication(appId, "desktop", appSources.slice(0, 128), [{ targetId, applicationId: appId, runtimeProfileId: `native-${os2}-phase-unavailable`, accountProfileId: "synthetic", kind: "desktop", os: os2, driver: "native", appId }]);
|
|
65311
|
-
missingInputs.push({ inputId: "native-runtime-" + appId, targetIds: [targetId], kind: "runtime", disposition: "mock-substitutable", reason: `The ${os2} native build and launch profile is unavailable in this phase`, sourcePaths: [source3.path] });
|
|
65312
|
-
}
|
|
65313
|
-
if (new Set(applications.map((application) => application.applicationId)).size !== applications.length)
|
|
65314
|
-
throw new Error("discovery produced duplicate application identities");
|
|
65315
|
-
if (new Set(proposedTargets.map((target3) => target3.targetId)).size !== proposedTargets.length)
|
|
65316
|
-
throw new Error("discovery produced duplicate target identities");
|
|
65317
|
-
const edgeKeys = dependencyEdges.map((edge) => canonicalJson([edge.fromApplicationId, edge.toComponentId, edge.contractRef]));
|
|
65318
|
-
if (new Set(edgeKeys).size !== edgeKeys.length)
|
|
65319
|
-
throw new Error("discovery produced duplicate dependency graph edges");
|
|
65320
|
-
applications.sort((a5, b5) => a5.applicationId.localeCompare(b5.applicationId));
|
|
65321
|
-
const kindOrder = { web: 0, api: 1, mobile: 2, desktop: 3 };
|
|
65322
|
-
proposedTargets.sort((a5, b5) => kindOrder[a5.kind] - kindOrder[b5.kind] || a5.targetId.localeCompare(b5.targetId));
|
|
65323
|
-
dependencyEdges.sort((a5, b5) => canonicalJson([a5.fromApplicationId, a5.toComponentId, a5.contractRef]).localeCompare(canonicalJson([b5.fromApplicationId, b5.toComponentId, b5.contractRef])));
|
|
65324
|
-
missingInputs.sort((a5, b5) => a5.inputId.localeCompare(b5.inputId));
|
|
65325
|
-
portableOperations.sort((a5, b5) => a5.applicationId.localeCompare(b5.applicationId) || a5.exportName.localeCompare(b5.exportName));
|
|
65326
|
-
const inspection = E2ERepositoryInspectionSchema.parse({ candidateDigest: snapshot.candidate.digest, sources: refs, applications, proposedTargets, dependencyEdges, proposedScenarios: [], missingInputs });
|
|
65327
|
-
return { inspection, portableOperations, recipeOrigins, anonymousBaseTargetIds: anonymousBaseTargetIds.sort() };
|
|
65328
|
-
}
|
|
65329
|
-
var MAX_SOURCE_FILES, MAX_SOURCE_FILE_BYTES, unsafePathPart, runnerUnsafe, QUALIFIED_RUNTIME_PROFILE_IDS, unavailableRuntimeProfile, NODE_WEB_PORT, NODE_LOCKFILES;
|
|
64284
|
+
var MAX_SOURCE_FILE_BYTES;
|
|
65330
64285
|
var init_e2e_catalog = __esm({
|
|
65331
64286
|
"packages/contracts/dist/e2e-catalog.js"() {
|
|
65332
64287
|
"use strict";
|
|
65333
|
-
init_e2e_node();
|
|
65334
|
-
init_canonical_json();
|
|
65335
|
-
init_e2e_application_accounts();
|
|
65336
|
-
init_e2e_source();
|
|
65337
|
-
init_e2e_web_api_qualification();
|
|
65338
|
-
init_e2e_package_manifests();
|
|
65339
|
-
MAX_SOURCE_FILES = 512;
|
|
65340
64288
|
MAX_SOURCE_FILE_BYTES = 512 * 1024;
|
|
65341
|
-
unsafePathPart = /^(?:\.git|\.github|\.aws|\.ssh|\.env(?:\..*)?|secrets?|credentials?|.*(?:token|password|private[-_]?key).*)$/i;
|
|
65342
|
-
runnerUnsafe = e2eRunnerUnsafePath;
|
|
65343
|
-
QUALIFIED_RUNTIME_PROFILE_IDS = [WEB_API_RUNTIME_PROFILE_ID];
|
|
65344
|
-
unavailableRuntimeProfile = { web: "web-phase-unavailable", api: "api-phase-unavailable" };
|
|
65345
|
-
NODE_WEB_PORT = "4317";
|
|
65346
|
-
NODE_LOCKFILES = ["package-lock.json", "npm-shrinkwrap.json"];
|
|
65347
64289
|
}
|
|
65348
64290
|
});
|
|
65349
64291
|
|
|
@@ -65860,11 +64802,11 @@ var init_e2e_openapi_fixture = __esm({
|
|
|
65860
64802
|
});
|
|
65861
64803
|
|
|
65862
64804
|
// packages/contracts/dist/e2e-executor.js
|
|
65863
|
-
import { createHash as
|
|
64805
|
+
import { createHash as createHash16 } from "node:crypto";
|
|
65864
64806
|
function e2eExecutorAdmissionDigest(admission) {
|
|
65865
64807
|
const { admissionDigest: _digest, ...body } = admission;
|
|
65866
64808
|
void _digest;
|
|
65867
|
-
return
|
|
64809
|
+
return createHash16("sha256").update(canonicalJson(body)).digest("hex");
|
|
65868
64810
|
}
|
|
65869
64811
|
var E2E_EXECUTOR_APP_ORIGIN, E2E_EXECUTOR_HEALTH_TIMEOUT_MAX_MS, E2E_EXECUTOR_MAX_ACCOUNTS, E2EExecutorAccountSchema, E2EExecutorPlanSchema;
|
|
65870
64812
|
var init_e2e_executor = __esm({
|
|
@@ -66455,9 +65397,9 @@ var init_connections = __esm({
|
|
|
66455
65397
|
});
|
|
66456
65398
|
|
|
66457
65399
|
// packages/contracts/dist/agent-recipe-node.js
|
|
66458
|
-
import { createHash as
|
|
65400
|
+
import { createHash as createHash17 } from "node:crypto";
|
|
66459
65401
|
function recipeDigest(recipe) {
|
|
66460
|
-
return
|
|
65402
|
+
return createHash17("sha256").update(canonicalJson(recipe), "utf8").digest("hex");
|
|
66461
65403
|
}
|
|
66462
65404
|
var init_agent_recipe_node = __esm({
|
|
66463
65405
|
"packages/contracts/dist/agent-recipe-node.js"() {
|
|
@@ -67242,12 +66184,12 @@ var init_refusal_words = __esm({
|
|
|
67242
66184
|
});
|
|
67243
66185
|
|
|
67244
66186
|
// packages/contracts/dist/agent-sessions-node.js
|
|
67245
|
-
import { createHash as
|
|
66187
|
+
import { createHash as createHash18 } from "node:crypto";
|
|
67246
66188
|
function cleanSessionName(name3) {
|
|
67247
66189
|
return emailSafeName(name3.replace(new RegExp("\\p{Cc}+", "gu"), " ").replace(new RegExp("(?![\\u200C\\u200D])\\p{Cf}", "gu"), ""));
|
|
67248
66190
|
}
|
|
67249
66191
|
function sessionEventId(kind, occurrence) {
|
|
67250
|
-
return `evt_${
|
|
66192
|
+
return `evt_${createHash18("sha256").update(`${kind}
|
|
67251
66193
|
${occurrence}`, "utf8").digest("hex").slice(0, 24)}`;
|
|
67252
66194
|
}
|
|
67253
66195
|
function sessionLink(origin2, sessionId) {
|
|
@@ -76956,11 +75898,11 @@ var init_work_event = __esm({
|
|
|
76956
75898
|
});
|
|
76957
75899
|
|
|
76958
75900
|
// packages/contracts/dist/work-event-node.js
|
|
76959
|
-
import { createHash as
|
|
75901
|
+
import { createHash as createHash19 } from "node:crypto";
|
|
76960
75902
|
function workEventId(parts2) {
|
|
76961
75903
|
if (parts2.source === "" || /(?:^|[.#:])(?:undefined|null|NaN)(?:$|[.#:])/u.test(parts2.source))
|
|
76962
75904
|
throw new Error("a work event names the change it records");
|
|
76963
|
-
return `wev_${
|
|
75905
|
+
return `wev_${createHash19("sha256").update(`work-event/v1\0${parts2.kind}\0${parts2.taskId}\0${parts2.source}`).digest("hex").slice(0, 32)}`;
|
|
76964
75906
|
}
|
|
76965
75907
|
var init_work_event_node = __esm({
|
|
76966
75908
|
"packages/contracts/dist/work-event-node.js"() {
|
|
@@ -80313,14 +79255,14 @@ var init_getProfileName = __esm({
|
|
|
80313
79255
|
});
|
|
80314
79256
|
|
|
80315
79257
|
// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFilepath.js
|
|
80316
|
-
import { createHash as
|
|
79258
|
+
import { createHash as createHash20 } from "node:crypto";
|
|
80317
79259
|
import { join } from "node:path";
|
|
80318
79260
|
var getSSOTokenFilepath;
|
|
80319
79261
|
var init_getSSOTokenFilepath = __esm({
|
|
80320
79262
|
"node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFilepath.js"() {
|
|
80321
79263
|
init_getHomeDir();
|
|
80322
79264
|
getSSOTokenFilepath = (id12) => {
|
|
80323
|
-
const hasher =
|
|
79265
|
+
const hasher = createHash20("sha1");
|
|
80324
79266
|
const cacheName = hasher.update(id12).digest("hex");
|
|
80325
79267
|
return join(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
|
|
80326
79268
|
};
|
|
@@ -84743,7 +83685,7 @@ var init_serdePlugin = __esm({
|
|
|
84743
83685
|
});
|
|
84744
83686
|
|
|
84745
83687
|
// node_modules/@smithy/core/dist-es/submodules/serde/hash-node/hash-node.js
|
|
84746
|
-
import { createHash as
|
|
83688
|
+
import { createHash as createHash21, createHmac as createHmac2 } from "node:crypto";
|
|
84747
83689
|
function castSourceData(toCast, encoding) {
|
|
84748
83690
|
if (Buffer.isBuffer(toCast)) {
|
|
84749
83691
|
return toCast;
|
|
@@ -84777,7 +83719,7 @@ var init_hash_node = __esm({
|
|
|
84777
83719
|
return Promise.resolve(this.hash.digest());
|
|
84778
83720
|
}
|
|
84779
83721
|
reset() {
|
|
84780
|
-
this.hash = this.secret ? createHmac2(this.algorithmIdentifier, castSourceData(this.secret)) :
|
|
83722
|
+
this.hash = this.secret ? createHmac2(this.algorithmIdentifier, castSourceData(this.secret)) : createHash21(this.algorithmIdentifier);
|
|
84781
83723
|
}
|
|
84782
83724
|
};
|
|
84783
83725
|
}
|
|
@@ -86203,11 +85145,11 @@ var init_Md5Js = __esm({
|
|
|
86203
85145
|
});
|
|
86204
85146
|
|
|
86205
85147
|
// node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Node.js
|
|
86206
|
-
import { createHash as
|
|
85148
|
+
import { createHash as createHash22 } from "node:crypto";
|
|
86207
85149
|
function buildNativeClass() {
|
|
86208
85150
|
return class Md5Node {
|
|
86209
85151
|
digestLength = 16;
|
|
86210
|
-
hash =
|
|
85152
|
+
hash = createHash22("md5");
|
|
86211
85153
|
update(data) {
|
|
86212
85154
|
this.hash.update(toUint8Array(data));
|
|
86213
85155
|
}
|
|
@@ -86216,7 +85158,7 @@ function buildNativeClass() {
|
|
|
86216
85158
|
return new Uint8Array(buf2.buffer, buf2.byteOffset, buf2.byteLength);
|
|
86217
85159
|
}
|
|
86218
85160
|
reset() {
|
|
86219
|
-
this.hash =
|
|
85161
|
+
this.hash = createHash22("md5");
|
|
86220
85162
|
}
|
|
86221
85163
|
};
|
|
86222
85164
|
}
|
|
@@ -86227,7 +85169,7 @@ var init_Md5Node = __esm({
|
|
|
86227
85169
|
init_Md5Js();
|
|
86228
85170
|
hasNativeCrypto = (() => {
|
|
86229
85171
|
try {
|
|
86230
|
-
|
|
85172
|
+
createHash22("md5");
|
|
86231
85173
|
return true;
|
|
86232
85174
|
} catch {
|
|
86233
85175
|
return false;
|
|
@@ -86544,7 +85486,7 @@ var init_Sha256Js = __esm({
|
|
|
86544
85486
|
});
|
|
86545
85487
|
|
|
86546
85488
|
// node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Node.js
|
|
86547
|
-
import { createHash as
|
|
85489
|
+
import { createHash as createHash23, createHmac as createHmac3 } from "node:crypto";
|
|
86548
85490
|
function buildNativeClass3() {
|
|
86549
85491
|
return class Sha256Node {
|
|
86550
85492
|
digestLength = 32;
|
|
@@ -86578,7 +85520,7 @@ function buildNativeClass3() {
|
|
|
86578
85520
|
this.finished = false;
|
|
86579
85521
|
}
|
|
86580
85522
|
createHash() {
|
|
86581
|
-
return this.secret ? createHmac3("sha256", toBuffer(this.secret)) :
|
|
85523
|
+
return this.secret ? createHmac3("sha256", toBuffer(this.secret)) : createHash23("sha256");
|
|
86582
85524
|
}
|
|
86583
85525
|
};
|
|
86584
85526
|
}
|
|
@@ -86597,7 +85539,7 @@ var init_Sha256Node = __esm({
|
|
|
86597
85539
|
init_Sha256Js();
|
|
86598
85540
|
hasNativeCrypto2 = (() => {
|
|
86599
85541
|
try {
|
|
86600
|
-
|
|
85542
|
+
createHash23("sha256");
|
|
86601
85543
|
return true;
|
|
86602
85544
|
} catch {
|
|
86603
85545
|
return false;
|
|
@@ -94976,8 +93918,8 @@ ${toHex2(hashedRequest)}`;
|
|
|
94976
93918
|
normalizedPathSegments.push(pathSegment);
|
|
94977
93919
|
}
|
|
94978
93920
|
}
|
|
94979
|
-
const
|
|
94980
|
-
const doubleEncoded = escapeUri2(
|
|
93921
|
+
const normalizedPath = `${path6?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path6?.endsWith("/") ? "/" : ""}`;
|
|
93922
|
+
const doubleEncoded = escapeUri2(normalizedPath);
|
|
94981
93923
|
return doubleEncoded.replace(/%2F/g, "/");
|
|
94982
93924
|
}
|
|
94983
93925
|
return path6;
|
|
@@ -100938,7 +99880,7 @@ var init_XmlShapeSerializer = __esm({
|
|
|
100938
99880
|
}
|
|
100939
99881
|
return structXmlNode;
|
|
100940
99882
|
}
|
|
100941
|
-
writeList(listMember,
|
|
99883
|
+
writeList(listMember, array3, container, parentXmlns) {
|
|
100942
99884
|
if (!listMember.isMemberSchema()) {
|
|
100943
99885
|
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`);
|
|
100944
99886
|
}
|
|
@@ -100963,7 +99905,7 @@ var init_XmlShapeSerializer = __esm({
|
|
|
100963
99905
|
}
|
|
100964
99906
|
};
|
|
100965
99907
|
if (flat3) {
|
|
100966
|
-
for (const value of
|
|
99908
|
+
for (const value of array3) {
|
|
100967
99909
|
if (sparse || value != null) {
|
|
100968
99910
|
writeItem(container, value);
|
|
100969
99911
|
}
|
|
@@ -100973,7 +99915,7 @@ var init_XmlShapeSerializer = __esm({
|
|
|
100973
99915
|
if (xmlns) {
|
|
100974
99916
|
listNode.addAttribute(xmlnsAttr, xmlns);
|
|
100975
99917
|
}
|
|
100976
|
-
for (const value of
|
|
99918
|
+
for (const value of array3) {
|
|
100977
99919
|
if (sparse || value != null) {
|
|
100978
99920
|
writeItem(listNode, value);
|
|
100979
99921
|
}
|
|
@@ -103535,8 +102477,8 @@ ${toHex2(hashedRequest)}`;
|
|
|
103535
102477
|
normalizedPathSegments.push(pathSegment);
|
|
103536
102478
|
}
|
|
103537
102479
|
}
|
|
103538
|
-
const
|
|
103539
|
-
const doubleEncoded = escapeUri2(
|
|
102480
|
+
const normalizedPath = `${path6?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path6?.endsWith("/") ? "/" : ""}`;
|
|
102481
|
+
const doubleEncoded = escapeUri2(normalizedPath);
|
|
103540
102482
|
return doubleEncoded.replace(/%2F/g, "/");
|
|
103541
102483
|
}
|
|
103542
102484
|
return path6;
|
|
@@ -106121,9 +105063,9 @@ var require_dist_cjs16 = __commonJS({
|
|
|
106121
105063
|
var { setCredentialFeature: setCredentialFeature2 } = (init_client3(), __toCommonJS(client_exports2));
|
|
106122
105064
|
var { CredentialsProviderError: CredentialsProviderError2, parseKnownFiles: parseKnownFiles2, getProfileName: getProfileName2 } = (init_config2(), __toCommonJS(config_exports));
|
|
106123
105065
|
var { HttpRequest: HttpRequest2 } = (init_protocols(), __toCommonJS(protocols_exports));
|
|
106124
|
-
var { createHash:
|
|
105066
|
+
var { createHash: createHash59, createPrivateKey, createPublicKey: createPublicKey2, sign: sign3 } = __require("node:crypto");
|
|
106125
105067
|
var { promises } = __require("node:fs");
|
|
106126
|
-
var { homedir:
|
|
105068
|
+
var { homedir: homedir6 } = __require("node:os");
|
|
106127
105069
|
var { dirname: dirname13, join: join34 } = __require("node:path");
|
|
106128
105070
|
var LoginCredentialsFetcher = class _LoginCredentialsFetcher {
|
|
106129
105071
|
profileData;
|
|
@@ -106290,9 +105232,9 @@ var require_dist_cjs16 = __commonJS({
|
|
|
106290
105232
|
await promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
|
|
106291
105233
|
}
|
|
106292
105234
|
getTokenFilePath() {
|
|
106293
|
-
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join34(
|
|
105235
|
+
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join34(homedir6(), ".aws", "login", "cache");
|
|
106294
105236
|
const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
|
|
106295
|
-
const loginSessionSha256 =
|
|
105237
|
+
const loginSessionSha256 = createHash59("sha256").update(loginSessionBytes).digest("hex");
|
|
106296
105238
|
return join34(directory, `${loginSessionSha256}.json`);
|
|
106297
105239
|
}
|
|
106298
105240
|
derToRawSignature(derSignature) {
|
|
@@ -110857,11 +109799,11 @@ var init_utils4 = __esm({
|
|
|
110857
109799
|
init_values();
|
|
110858
109800
|
has = (obj2, key2) => (has = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has(obj2, key2));
|
|
110859
109801
|
hex_table = /* @__PURE__ */ (() => {
|
|
110860
|
-
const
|
|
109802
|
+
const array3 = [];
|
|
110861
109803
|
for (let i5 = 0; i5 < 256; ++i5) {
|
|
110862
|
-
|
|
109804
|
+
array3.push("%" + ((i5 < 16 ? "0" : "") + i5.toString(16)).toUpperCase());
|
|
110863
109805
|
}
|
|
110864
|
-
return
|
|
109806
|
+
return array3;
|
|
110865
109807
|
})();
|
|
110866
109808
|
limit = 1024;
|
|
110867
109809
|
encode3 = (str2, _defaultEncoder, charset, _kind, format2) => {
|
|
@@ -116727,9 +115669,9 @@ var init_file_store = __esm({
|
|
|
116727
115669
|
const walkStartNs = _internals.nowNs();
|
|
116728
115670
|
const out = /* @__PURE__ */ Object.create(null);
|
|
116729
115671
|
for (const [rel, full] of await filenamesInDir(this.rootPath, under, base3)) {
|
|
116730
|
-
const
|
|
116731
|
-
if (
|
|
116732
|
-
out[rel] =
|
|
115672
|
+
const sha5 = await this.hashViaCache(rel, full, walkStartNs);
|
|
115673
|
+
if (sha5 !== null)
|
|
115674
|
+
out[rel] = sha5;
|
|
116733
115675
|
}
|
|
116734
115676
|
return out;
|
|
116735
115677
|
}
|
|
@@ -116819,12 +115761,12 @@ var init_file_store = __esm({
|
|
|
116819
115761
|
if (!st.isFile())
|
|
116820
115762
|
return null;
|
|
116821
115763
|
const cached2 = this.hashes.get(rel);
|
|
116822
|
-
let
|
|
115764
|
+
let sha5;
|
|
116823
115765
|
if (cached2 !== void 0 && unchangedSinceHashed(cached2, st)) {
|
|
116824
|
-
|
|
115766
|
+
sha5 = cached2.sha;
|
|
116825
115767
|
} else {
|
|
116826
115768
|
try {
|
|
116827
|
-
|
|
115769
|
+
sha5 = await _internals.hashFile(full);
|
|
116828
115770
|
} catch (e5) {
|
|
116829
115771
|
const code2 = e5.code;
|
|
116830
115772
|
if (code2 === "ENOENT" || e5 instanceof FileStoreError)
|
|
@@ -116835,9 +115777,9 @@ var init_file_store = __esm({
|
|
|
116835
115777
|
}
|
|
116836
115778
|
}
|
|
116837
115779
|
if (oldEnoughToCache(st, walkStartNs)) {
|
|
116838
|
-
this.hashes.set(rel, { mtimeNs: st.mtimeNs, ctimeNs: st.ctimeNs, size: st.size, sha:
|
|
115780
|
+
this.hashes.set(rel, { mtimeNs: st.mtimeNs, ctimeNs: st.ctimeNs, size: st.size, sha: sha5 });
|
|
116839
115781
|
}
|
|
116840
|
-
return
|
|
115782
|
+
return sha5;
|
|
116841
115783
|
}
|
|
116842
115784
|
}
|
|
116843
115785
|
FileStore2.isPathLegal = isPathLegal;
|
|
@@ -117148,14 +116090,14 @@ var init_memories = __esm({
|
|
|
117148
116090
|
const remoteItem = remote.get(rel);
|
|
117149
116091
|
const localSha = local[rel];
|
|
117150
116092
|
const baseSha = store.baseline.get(rel);
|
|
117151
|
-
let
|
|
116093
|
+
let sha5;
|
|
117152
116094
|
if (localSha === void 0 && baseSha !== void 0 && remoteItem !== void 0 && remoteItem.content_sha256 === baseSha && !store.readOnly) {
|
|
117153
|
-
|
|
116095
|
+
sha5 = await __classPrivateFieldGet2(this, _SessionMemoryStores_instances, "m", _SessionMemoryStores_corroboratedDelete).call(this, store, rel, remoteItem, baseSha, deletes);
|
|
117154
116096
|
} else {
|
|
117155
|
-
|
|
116097
|
+
sha5 = await __classPrivateFieldGet2(this, _SessionMemoryStores_instances, "m", _SessionMemoryStores_syncPath).call(this, store, rel, remoteItem, localSha, pulls);
|
|
117156
116098
|
}
|
|
117157
|
-
if (
|
|
117158
|
-
baseline.set(rel,
|
|
116099
|
+
if (sha5 !== void 0)
|
|
116100
|
+
baseline.set(rel, sha5);
|
|
117159
116101
|
}
|
|
117160
116102
|
store.baseline = baseline;
|
|
117161
116103
|
await __classPrivateFieldGet2(this, _SessionMemoryStores_instances, "m", _SessionMemoryStores_pullAll).call(this, store, pulls);
|
|
@@ -117185,9 +116127,9 @@ var init_memories = __esm({
|
|
|
117185
116127
|
});
|
|
117186
116128
|
return;
|
|
117187
116129
|
}
|
|
117188
|
-
for (const [rel,
|
|
117189
|
-
if (
|
|
117190
|
-
dirty.set(rel,
|
|
116130
|
+
for (const [rel, sha5] of Object.entries(scan2.files)) {
|
|
116131
|
+
if (sha5 !== store.baseline.get(rel) && store.refusedShas.get(rel) !== sha5) {
|
|
116132
|
+
dirty.set(rel, sha5);
|
|
117191
116133
|
unsent.add(rel);
|
|
117192
116134
|
}
|
|
117193
116135
|
}
|
|
@@ -117431,10 +116373,10 @@ ${store.memoryStoreId}`);
|
|
|
117431
116373
|
for (const [rel, localSha, existing] of queue) {
|
|
117432
116374
|
if (signal?.aborted)
|
|
117433
116375
|
return;
|
|
117434
|
-
const
|
|
116376
|
+
const sha5 = await __classPrivateFieldGet2(this, _SessionMemoryStores_instances, "m", _SessionMemoryStores_upload).call(this, store, rel, localSha, existing);
|
|
117435
116377
|
unsent.delete(rel);
|
|
117436
|
-
if (
|
|
117437
|
-
store.baseline.set(rel,
|
|
116378
|
+
if (sha5 !== void 0)
|
|
116379
|
+
store.baseline.set(rel, sha5);
|
|
117438
116380
|
}
|
|
117439
116381
|
};
|
|
117440
116382
|
await Promise.all(Array.from({ length: Math.min(UPLOAD_CONCURRENCY, uploads.length) }, worker));
|
|
@@ -117542,11 +116484,11 @@ ${store.memoryStoreId}`);
|
|
|
117542
116484
|
});
|
|
117543
116485
|
return baseSha;
|
|
117544
116486
|
}
|
|
117545
|
-
const
|
|
117546
|
-
if (
|
|
116487
|
+
const sha5 = await __classPrivateFieldGet2(this, _SessionMemoryStores_instances, "m", _SessionMemoryStores_deleteRemote).call(this, store, rel, remote, baseSha);
|
|
116488
|
+
if (sha5 === void 0) {
|
|
117547
116489
|
store.pendingDeletes.delete(rel);
|
|
117548
116490
|
}
|
|
117549
|
-
return
|
|
116491
|
+
return sha5;
|
|
117550
116492
|
}, _SessionMemoryStores_deleteRemote = async function _SessionMemoryStores_deleteRemote2(store, rel, remote, baseSha) {
|
|
117551
116493
|
try {
|
|
117552
116494
|
await __classPrivateFieldGet2(this, _SessionMemoryStores_client, "f").beta.memoryStores.memories.delete(remote.id, {
|
|
@@ -132247,11 +131189,11 @@ var init_utils6 = __esm({
|
|
|
132247
131189
|
return resolvedHas(obj2, key2);
|
|
132248
131190
|
};
|
|
132249
131191
|
hex_table2 = /* @__PURE__ */ (() => {
|
|
132250
|
-
const
|
|
131192
|
+
const array3 = [];
|
|
132251
131193
|
for (let i5 = 0; i5 < 256; ++i5) {
|
|
132252
|
-
|
|
131194
|
+
array3.push("%" + ((i5 < 16 ? "0" : "") + i5.toString(16)).toUpperCase());
|
|
132253
131195
|
}
|
|
132254
|
-
return
|
|
131196
|
+
return array3;
|
|
132255
131197
|
})();
|
|
132256
131198
|
limit2 = 1024;
|
|
132257
131199
|
encode4 = (str2, _defaultEncoder, charset, _kind, format2) => {
|
|
@@ -137192,8 +136134,8 @@ function captureSnapshotArray(snapshot, property, maximum, kind) {
|
|
|
137192
136134
|
}
|
|
137193
136135
|
return descriptor2.value;
|
|
137194
136136
|
}
|
|
137195
|
-
function captureSnapshotArrayItem(
|
|
137196
|
-
const descriptor2 = Object.getOwnPropertyDescriptor(
|
|
136137
|
+
function captureSnapshotArrayItem(array3, index) {
|
|
136138
|
+
const descriptor2 = Object.getOwnPropertyDescriptor(array3, index);
|
|
137197
136139
|
if (!descriptor2) {
|
|
137198
136140
|
return void 0;
|
|
137199
136141
|
}
|
|
@@ -137202,8 +136144,8 @@ function captureSnapshotArrayItem(array4, index) {
|
|
|
137202
136144
|
}
|
|
137203
136145
|
return descriptor2.value;
|
|
137204
136146
|
}
|
|
137205
|
-
function mapCapturedSnapshotArray(
|
|
137206
|
-
const descriptor2 = Object.getOwnPropertyDescriptor(
|
|
136147
|
+
function mapCapturedSnapshotArray(array3, maximum, kind, map4) {
|
|
136148
|
+
const descriptor2 = Object.getOwnPropertyDescriptor(array3, "length");
|
|
137207
136149
|
const length = descriptor2 && "value" in descriptor2 ? descriptor2.value : void 0;
|
|
137208
136150
|
if (typeof length !== "number" || !Number.isSafeInteger(length) || length < 0 || length > maximum) {
|
|
137209
136151
|
throw new OpenAIError(`Chat completion stream exceeded its snapshot ${kind} limit`);
|
|
@@ -137211,7 +136153,7 @@ function mapCapturedSnapshotArray(array4, maximum, kind, map4) {
|
|
|
137211
136153
|
const mapped = [];
|
|
137212
136154
|
mapped.length = length;
|
|
137213
136155
|
for (let index = 0; index < length; index += 1) {
|
|
137214
|
-
const item2 = Object.getOwnPropertyDescriptor(
|
|
136156
|
+
const item2 = Object.getOwnPropertyDescriptor(array3, index);
|
|
137215
136157
|
if (!item2) {
|
|
137216
136158
|
continue;
|
|
137217
136159
|
}
|
|
@@ -137355,9 +136297,9 @@ function canonicalSerializedParserSchema(value, budget) {
|
|
|
137355
136297
|
if (typeof current !== "object" || ancestors.has(current)) {
|
|
137356
136298
|
return UNSAFE_SERIALIZED_PARSER_VALUE;
|
|
137357
136299
|
}
|
|
137358
|
-
const
|
|
136300
|
+
const array3 = Array.isArray(current);
|
|
137359
136301
|
const prototype = Object.getPrototypeOf(current);
|
|
137360
|
-
if (
|
|
136302
|
+
if (array3 && prototype !== Array.prototype || !array3 && prototype !== null && prototype !== Object.prototype) {
|
|
137361
136303
|
return UNSAFE_SERIALIZED_PARSER_VALUE;
|
|
137362
136304
|
}
|
|
137363
136305
|
for (let owner = current; owner !== null; owner = Object.getPrototypeOf(owner)) {
|
|
@@ -137375,7 +136317,7 @@ function canonicalSerializedParserSchema(value, budget) {
|
|
|
137375
136317
|
if (!charge(2)) {
|
|
137376
136318
|
return UNSAFE_SERIALIZED_PARSER_VALUE;
|
|
137377
136319
|
}
|
|
137378
|
-
if (
|
|
136320
|
+
if (array3) {
|
|
137379
136321
|
const lengthDescriptor = Object.getOwnPropertyDescriptor(current, "length");
|
|
137380
136322
|
const length = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0;
|
|
137381
136323
|
if (typeof length !== "number" || !Number.isSafeInteger(length) || length < 0 || length > MAX_SERIALIZED_PARSER_SCHEMA_NODES - budget.nodes) {
|
|
@@ -143818,14 +142760,14 @@ function createAssistantStreamDeltaProjection(cacheArrays) {
|
|
|
143818
142760
|
return { arrays: /* @__PURE__ */ new Map(), cacheArrays, records: /* @__PURE__ */ new WeakMap() };
|
|
143819
142761
|
}
|
|
143820
142762
|
function commitAssistantStreamArrayProjection(projection) {
|
|
143821
|
-
for (const [
|
|
143822
|
-
if (projected.cacheable && !externallyMutableAssistantStreamValues.has(
|
|
143823
|
-
assistantStreamArrayStates.set(
|
|
142763
|
+
for (const [array3, projected] of projection.arrays) {
|
|
142764
|
+
if (projected.cacheable && !externallyMutableAssistantStreamValues.has(array3)) {
|
|
142765
|
+
assistantStreamArrayStates.set(array3, {
|
|
143824
142766
|
length: projected.length,
|
|
143825
142767
|
ownEntryCount: projected.ownEntryCount
|
|
143826
142768
|
});
|
|
143827
142769
|
} else {
|
|
143828
|
-
assistantStreamArrayStates.delete(
|
|
142770
|
+
assistantStreamArrayStates.delete(array3);
|
|
143829
142771
|
}
|
|
143830
142772
|
}
|
|
143831
142773
|
}
|
|
@@ -199795,7 +198737,7 @@ var init_Sha1Js = __esm({
|
|
|
199795
198737
|
});
|
|
199796
198738
|
|
|
199797
198739
|
// node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha1/Sha1Node.js
|
|
199798
|
-
import { createHash as
|
|
198740
|
+
import { createHash as createHash29, createHmac as createHmac4 } from "node:crypto";
|
|
199799
198741
|
function buildNativeClass4() {
|
|
199800
198742
|
return class Sha1Node {
|
|
199801
198743
|
digestLength = 20;
|
|
@@ -199829,7 +198771,7 @@ function buildNativeClass4() {
|
|
|
199829
198771
|
this.finished = false;
|
|
199830
198772
|
}
|
|
199831
198773
|
createHash() {
|
|
199832
|
-
return this.secret ? createHmac4("sha1", toBuffer2(this.secret)) :
|
|
198774
|
+
return this.secret ? createHmac4("sha1", toBuffer2(this.secret)) : createHash29("sha1");
|
|
199833
198775
|
}
|
|
199834
198776
|
};
|
|
199835
198777
|
}
|
|
@@ -199848,7 +198790,7 @@ var init_Sha1Node = __esm({
|
|
|
199848
198790
|
init_Sha1Js();
|
|
199849
198791
|
hasNativeCrypto3 = (() => {
|
|
199850
198792
|
try {
|
|
199851
|
-
|
|
198793
|
+
createHash29("sha1");
|
|
199852
198794
|
return true;
|
|
199853
198795
|
} catch {
|
|
199854
198796
|
return false;
|
|
@@ -210727,8 +209669,8 @@ ${toHex2(hashedRequest)}`;
|
|
|
210727
209669
|
normalizedPathSegments.push(pathSegment);
|
|
210728
209670
|
}
|
|
210729
209671
|
}
|
|
210730
|
-
const
|
|
210731
|
-
const doubleEncoded = escapeUri2(
|
|
209672
|
+
const normalizedPath = `${path6?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path6?.endsWith("/") ? "/" : ""}`;
|
|
209673
|
+
const doubleEncoded = escapeUri2(normalizedPath);
|
|
210732
209674
|
return doubleEncoded.replace(/%2F/g, "/");
|
|
210733
209675
|
}
|
|
210734
209676
|
return path6;
|
|
@@ -293380,10 +292322,10 @@ var require_typed_arrays = __commonJS({
|
|
|
293380
292322
|
Float32Array: 7,
|
|
293381
292323
|
Float64Array: 8
|
|
293382
292324
|
};
|
|
293383
|
-
exports.getMinimalRepresentation = function(
|
|
292325
|
+
exports.getMinimalRepresentation = function(array3, getter) {
|
|
293384
292326
|
var maxType = null, maxPriority = 0, p3, t, v, i5, l3;
|
|
293385
|
-
for (i5 = 0, l3 =
|
|
293386
|
-
v = getter ? getter(
|
|
292327
|
+
for (i5 = 0, l3 = array3.length; i5 < l3; i5++) {
|
|
292328
|
+
v = getter ? getter(array3[i5]) : array3[i5];
|
|
293387
292329
|
t = exports.getNumberType(v);
|
|
293388
292330
|
p3 = TYPE_PRIORITY[t.name];
|
|
293389
292331
|
if (p3 > maxPriority) {
|
|
@@ -293400,19 +292342,19 @@ var require_typed_arrays = __commonJS({
|
|
|
293400
292342
|
var length = 0, i5, o3, l3;
|
|
293401
292343
|
for (i5 = 0, l3 = arguments.length; i5 < l3; i5++)
|
|
293402
292344
|
length += arguments[i5].length;
|
|
293403
|
-
var
|
|
292345
|
+
var array3 = new arguments[0].constructor(length);
|
|
293404
292346
|
for (i5 = 0, o3 = 0; i5 < l3; i5++) {
|
|
293405
|
-
|
|
292347
|
+
array3.set(arguments[i5], o3);
|
|
293406
292348
|
o3 += arguments[i5].length;
|
|
293407
292349
|
}
|
|
293408
|
-
return
|
|
292350
|
+
return array3;
|
|
293409
292351
|
};
|
|
293410
292352
|
exports.indices = function(length) {
|
|
293411
292353
|
var PointerArray = exports.getPointerArray(length);
|
|
293412
|
-
var
|
|
292354
|
+
var array3 = new PointerArray(length);
|
|
293413
292355
|
for (var i5 = 0; i5 < length; i5++)
|
|
293414
|
-
|
|
293415
|
-
return
|
|
292356
|
+
array3[i5] = i5;
|
|
292357
|
+
return array3;
|
|
293416
292358
|
};
|
|
293417
292359
|
}
|
|
293418
292360
|
});
|
|
@@ -293434,24 +292376,24 @@ var require_iterables = __commonJS({
|
|
|
293434
292376
|
}
|
|
293435
292377
|
function toArray(target3) {
|
|
293436
292378
|
var l3 = guessLength(target3);
|
|
293437
|
-
var
|
|
292379
|
+
var array3 = typeof l3 === "number" ? new Array(l3) : [];
|
|
293438
292380
|
var i5 = 0;
|
|
293439
292381
|
forEach(target3, function(value) {
|
|
293440
|
-
|
|
292382
|
+
array3[i5++] = value;
|
|
293441
292383
|
});
|
|
293442
|
-
return
|
|
292384
|
+
return array3;
|
|
293443
292385
|
}
|
|
293444
292386
|
function toArrayWithIndices(target3) {
|
|
293445
292387
|
var l3 = guessLength(target3);
|
|
293446
292388
|
var IndexArray = typeof l3 === "number" ? typed.getPointerArray(l3) : Array;
|
|
293447
|
-
var
|
|
292389
|
+
var array3 = typeof l3 === "number" ? new Array(l3) : [];
|
|
293448
292390
|
var indices = typeof l3 === "number" ? new IndexArray(l3) : [];
|
|
293449
292391
|
var i5 = 0;
|
|
293450
292392
|
forEach(target3, function(value) {
|
|
293451
|
-
|
|
292393
|
+
array3[i5] = value;
|
|
293452
292394
|
indices[i5] = i5++;
|
|
293453
292395
|
});
|
|
293454
|
-
return [
|
|
292396
|
+
return [array3, indices];
|
|
293455
292397
|
}
|
|
293456
292398
|
exports.isArrayLike = isArrayLike;
|
|
293457
292399
|
exports.guessLength = guessLength;
|
|
@@ -300498,8 +299440,8 @@ var require_dist_cjs41 = __commonJS({
|
|
|
300498
299440
|
};
|
|
300499
299441
|
}
|
|
300500
299442
|
toBigInt() {
|
|
300501
|
-
const
|
|
300502
|
-
return BigInt(
|
|
299443
|
+
const stringValue = this.toString();
|
|
299444
|
+
return BigInt(stringValue);
|
|
300503
299445
|
}
|
|
300504
299446
|
toString() {
|
|
300505
299447
|
return String(this.value);
|
|
@@ -300703,7 +299645,7 @@ var require_dist_cjs41 = __commonJS({
|
|
|
300703
299645
|
}
|
|
300704
299646
|
return num4;
|
|
300705
299647
|
};
|
|
300706
|
-
var convertString = (
|
|
299648
|
+
var convertString = (stringValue) => stringValue;
|
|
300707
299649
|
var convertBinary = (binaryValue) => binaryValue;
|
|
300708
299650
|
var convertList = (list4, options) => list4.map((item2) => convertToNative(item2, options));
|
|
300709
299651
|
var convertMap2 = (map4, options) => Object.entries(map4).reduce((acc, [key2, value]) => (acc[key2] = convertToNative(value, options), acc), {});
|
|
@@ -305801,7 +304743,7 @@ var init_model_call_view = __esm({
|
|
|
305801
304743
|
});
|
|
305802
304744
|
|
|
305803
304745
|
// packages/broker/dist/developer/task-records.js
|
|
305804
|
-
import { createHash as
|
|
304746
|
+
import { createHash as createHash33 } from "node:crypto";
|
|
305805
304747
|
function githubWorkflowPullRequestKey(repositoryFullName3, number9) {
|
|
305806
304748
|
const match = /^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)$/.exec(repositoryFullName3);
|
|
305807
304749
|
if (!match || !Number.isSafeInteger(number9) || number9 < 1)
|
|
@@ -305809,7 +304751,7 @@ function githubWorkflowPullRequestKey(repositoryFullName3, number9) {
|
|
|
305809
304751
|
return { pk: `GITHUB_PR#${repositoryFullName3.toLowerCase()}`, sk: `PR#${String(number9).padStart(10, "0")}` };
|
|
305810
304752
|
}
|
|
305811
304753
|
function taskOwnerKey(developerId, taskId) {
|
|
305812
|
-
return
|
|
304754
|
+
return createHash33("sha256").update(DEVELOPER_TASK_OWNER_ISSUER).update("\0").update(taskOwnerSubject(developerId, taskId)).digest("hex");
|
|
305813
304755
|
}
|
|
305814
304756
|
function currentOperation(operations) {
|
|
305815
304757
|
return operations.filter((operation2) => operation2.kind === "task" || operation2.kind === "publish").sort(byCreated).at(-1);
|
|
@@ -306280,9 +305222,9 @@ ${fenced(previous.slice(0, PLAN_CONTEXT_MAX_BYTES))}`],
|
|
|
306280
305222
|
});
|
|
306281
305223
|
|
|
306282
305224
|
// packages/broker/dist/core/task-flow/support.js
|
|
306283
|
-
import { createHash as
|
|
305225
|
+
import { createHash as createHash34, randomUUID as randomUUID12 } from "node:crypto";
|
|
306284
305226
|
function hashJson(value) {
|
|
306285
|
-
return
|
|
305227
|
+
return createHash34("sha256").update(canonicalJson(value)).digest("hex");
|
|
306286
305228
|
}
|
|
306287
305229
|
var iso4, newId, log, dispatchQueueName, limitsOf;
|
|
306288
305230
|
var init_support = __esm({
|
|
@@ -306460,11 +305402,11 @@ var init_transaction_checks = __esm({
|
|
|
306460
305402
|
});
|
|
306461
305403
|
|
|
306462
305404
|
// packages/broker/dist/developer/plan-document-reader.js
|
|
306463
|
-
import { createHash as
|
|
305405
|
+
import { createHash as createHash35 } from "node:crypto";
|
|
306464
305406
|
async function loadWorkflowDocument(read, artifact2, input2) {
|
|
306465
305407
|
const structured = artifact2.format === "structured";
|
|
306466
305408
|
const text16 = await read(artifact2.objectKey, structured ? WORKFLOW_PLAN_MAX_BYTES : MARKDOWN_MAX_BYTES);
|
|
306467
|
-
if (text16 === void 0 ||
|
|
305409
|
+
if (text16 === void 0 || createHash35("sha256").update(text16, "utf8").digest("hex") !== artifact2.sha256)
|
|
306468
305410
|
return void 0;
|
|
306469
305411
|
if (!structured)
|
|
306470
305412
|
return { format: "markdown", artifact: artifact2, markdown: text16 };
|
|
@@ -307919,9 +306861,9 @@ var init_prompt_text = __esm({
|
|
|
307919
306861
|
});
|
|
307920
306862
|
|
|
307921
306863
|
// packages/broker/dist/core/sessions/notes.js
|
|
307922
|
-
import { createHash as
|
|
306864
|
+
import { createHash as createHash36 } from "node:crypto";
|
|
307923
306865
|
function promptTagId(task, requestId) {
|
|
307924
|
-
return
|
|
306866
|
+
return createHash36("sha256").update(`agentx-prompt-tag\0${task.conversationId}\0${requestId}`, "utf8").digest("hex").slice(0, 16);
|
|
307925
306867
|
}
|
|
307926
306868
|
async function readTaskNotes(store, taskId, sinceIso, options = {}) {
|
|
307927
306869
|
const notes = [];
|
|
@@ -308006,7 +306948,7 @@ var init_notes = __esm({
|
|
|
308006
306948
|
THREAD_NOTE_SECTION_HEADER = "Replies posted in the task's chat thread since the last step (untrusted; the owner's own decision text takes precedence):";
|
|
308007
306949
|
LIVE_DELIVERED_ATTRIBUTE = ' live_delivered="already given to the running step when it was sent; not a new message"';
|
|
308008
306950
|
NOTE_SECTION_MAX_BYTES = 8e3;
|
|
308009
|
-
personLabel = (developerId) => `person p_${
|
|
306951
|
+
personLabel = (developerId) => `person p_${createHash36("sha256").update(`person\0${developerId}`, "utf8").digest("hex").slice(0, 6)}`;
|
|
308010
306952
|
isAppNote = (note) => "source" in note && (note.source === "app" || note.source === "linear");
|
|
308011
306953
|
}
|
|
308012
306954
|
});
|
|
@@ -308711,7 +307653,7 @@ var init_answer = __esm({
|
|
|
308711
307653
|
});
|
|
308712
307654
|
|
|
308713
307655
|
// packages/broker/dist/core/plan/comments.js
|
|
308714
|
-
import { createHash as
|
|
307656
|
+
import { createHash as createHash37 } from "node:crypto";
|
|
308715
307657
|
async function currentComments(deps, task) {
|
|
308716
307658
|
const document = planDocumentKindOf(task.workflow);
|
|
308717
307659
|
const version3 = task.workflow.artifacts.filter((artifact2) => artifact2.type === document).reduce((latest, artifact2) => Math.max(latest, artifact2.version), 0);
|
|
@@ -308743,7 +307685,7 @@ async function commentsForPlanningStep(deps, input2) {
|
|
|
308743
307685
|
const key2 = { pk: `DEVTASK#${task.taskId}`, sk: "COMMENTS" };
|
|
308744
307686
|
const counter = await deps.store.get(key2);
|
|
308745
307687
|
const comments = await currentComments(deps, task);
|
|
308746
|
-
const nonce =
|
|
307688
|
+
const nonce = createHash37("sha256").update(`agentx-prompt-tag\0${task.conversationId}\0${input2.requestId}`, "utf8").digest("hex").slice(0, 16);
|
|
308747
307689
|
const section = pageCommentsPrompt(promptComments(comments), nonce, CURRENT_COMMENTS_HEADER).text;
|
|
308748
307690
|
const suffix = `
|
|
308749
307691
|
|
|
@@ -310436,7 +309378,7 @@ var init_proposal_verify = __esm({
|
|
|
310436
309378
|
});
|
|
310437
309379
|
|
|
310438
309380
|
// packages/broker/dist/core/sessions/create.js
|
|
310439
|
-
import { createHash as
|
|
309381
|
+
import { createHash as createHash38 } from "node:crypto";
|
|
310440
309382
|
function developerIdOf(principal) {
|
|
310441
309383
|
return sha2565(`developer\0${principal.provider}\0${principal.personId}`);
|
|
310442
309384
|
}
|
|
@@ -310445,7 +309387,7 @@ var init_create = __esm({
|
|
|
310445
309387
|
"packages/broker/dist/core/sessions/create.js"() {
|
|
310446
309388
|
"use strict";
|
|
310447
309389
|
init_store();
|
|
310448
|
-
sha2565 = (text16) =>
|
|
309390
|
+
sha2565 = (text16) => createHash38("sha256").update(text16, "utf8").digest("hex");
|
|
310449
309391
|
}
|
|
310450
309392
|
});
|
|
310451
309393
|
|
|
@@ -310774,9 +309716,9 @@ var init_callbacks = __esm({
|
|
|
310774
309716
|
});
|
|
310775
309717
|
|
|
310776
309718
|
// packages/broker/dist/core/task-flow/money-stop.js
|
|
310777
|
-
import { createHash as
|
|
309719
|
+
import { createHash as createHash39 } from "node:crypto";
|
|
310778
309720
|
function cancelIdOf(operation2, at) {
|
|
310779
|
-
const hex3 =
|
|
309721
|
+
const hex3 = createHash39("sha256").update(`cancel
|
|
310780
309722
|
${operation2.id}
|
|
310781
309723
|
${at}`).digest("hex");
|
|
310782
309724
|
return `${hex3.slice(0, 8)}-${hex3.slice(8, 12)}-4${hex3.slice(13, 16)}-8${hex3.slice(17, 20)}-${hex3.slice(20, 32)}`;
|
|
@@ -310930,7 +309872,7 @@ var init_close_acceptance_record = __esm({
|
|
|
310930
309872
|
});
|
|
310931
309873
|
|
|
310932
309874
|
// packages/broker/dist/developer/task-close-preview.js
|
|
310933
|
-
import { createHash as
|
|
309875
|
+
import { createHash as createHash40 } from "node:crypto";
|
|
310934
309876
|
function canonical2(facts2) {
|
|
310935
309877
|
const parsed = TaskClosePreviewSchema.parse({
|
|
310936
309878
|
action: facts2.action,
|
|
@@ -310956,7 +309898,7 @@ function taskClosePreviewDigest(facts2) {
|
|
|
310956
309898
|
for (const scope2 of [facts2.companyId, facts2.workspaceId, facts2.actorId])
|
|
310957
309899
|
if (typeof scope2 !== "string" || scope2.length === 0)
|
|
310958
309900
|
throw new Error("close preview scope is required");
|
|
310959
|
-
return
|
|
309901
|
+
return createHash40("sha256").update(JSON.stringify({ companyId: facts2.companyId, workspaceId: facts2.workspaceId, actorId: facts2.actorId, ...canonical2(facts2) })).digest("hex");
|
|
310960
309902
|
}
|
|
310961
309903
|
function buildTaskClosePreview(facts2) {
|
|
310962
309904
|
return { ...canonical2(facts2), digest: taskClosePreviewDigest(facts2) };
|
|
@@ -312006,7 +310948,7 @@ var init_end2 = __esm({
|
|
|
312006
310948
|
});
|
|
312007
310949
|
|
|
312008
310950
|
// packages/broker/dist/core/task-flow/stage-machine.js
|
|
312009
|
-
import { createHash as
|
|
310951
|
+
import { createHash as createHash41 } from "node:crypto";
|
|
312010
310952
|
async function readWorkspace(deps, workspaceId) {
|
|
312011
310953
|
return fromDocument((await locateWorkspace(deps, workspaceId))?.workspace);
|
|
312012
310954
|
}
|
|
@@ -312287,7 +311229,7 @@ async function prepareReplanDispatch(deps, task, workflow, row2) {
|
|
|
312287
311229
|
}),
|
|
312288
311230
|
dispatched: structuredPlanDispatch(structured, workflow),
|
|
312289
311231
|
mode: "PLAN",
|
|
312290
|
-
requestId: workflowRequestId("agentx-auto-plan-revision", task.taskId, workflow.revision,
|
|
311232
|
+
requestId: workflowRequestId("agentx-auto-plan-revision", task.taskId, workflow.revision, createHash41("sha256").update(planPrompt, "utf8").digest("hex"))
|
|
312291
311233
|
};
|
|
312292
311234
|
}
|
|
312293
311235
|
async function buildPlanDispatchPrompt(deps, task, workflow, understood) {
|
|
@@ -312852,7 +311794,7 @@ var init_application_build_source = __esm({
|
|
|
312852
311794
|
});
|
|
312853
311795
|
|
|
312854
311796
|
// packages/verifier/dist/rovara-http-engine-descriptor.js
|
|
312855
|
-
import { createHash as
|
|
311797
|
+
import { createHash as createHash42 } from "node:crypto";
|
|
312856
311798
|
var ROVARA_HTTP_ENGINE_ASSERTION_FIXTURE, ROVARA_HTTP_ENGINE_DESCRIPTOR, ROVARA_HTTP_ENGINE_DIGEST;
|
|
312857
311799
|
var init_rovara_http_engine_descriptor = __esm({
|
|
312858
311800
|
"packages/verifier/dist/rovara-http-engine-descriptor.js"() {
|
|
@@ -312866,7 +311808,7 @@ var init_rovara_http_engine_descriptor = __esm({
|
|
|
312866
311808
|
platform: "api",
|
|
312867
311809
|
capabilities: Object.freeze([ROVARA_HTTP_ENGINE_ASSERTION_FIXTURE])
|
|
312868
311810
|
});
|
|
312869
|
-
ROVARA_HTTP_ENGINE_DIGEST =
|
|
311811
|
+
ROVARA_HTTP_ENGINE_DIGEST = createHash42("sha256").update(canonicalJson(ROVARA_HTTP_ENGINE_DESCRIPTOR)).digest("hex");
|
|
312870
311812
|
}
|
|
312871
311813
|
});
|
|
312872
311814
|
|
|
@@ -313435,7 +312377,7 @@ var init_engine = __esm({
|
|
|
313435
312377
|
});
|
|
313436
312378
|
|
|
313437
312379
|
// packages/verifier/dist/application-report-schema.js
|
|
313438
|
-
var count8, text10,
|
|
312380
|
+
var count8, text10, sha, usage, source2, error63, event, metrics, cache5, model, step2, artifact, failure3, skip, appLogLine, attempt2, result3, target2, E2EApplicationReportSchema, E2E_APPLICATION_REPORT_MAX_BYTES;
|
|
313439
312381
|
var init_application_report_schema = __esm({
|
|
313440
312382
|
"packages/verifier/dist/application-report-schema.js"() {
|
|
313441
312383
|
"use strict";
|
|
@@ -313443,7 +312385,7 @@ var init_application_report_schema = __esm({
|
|
|
313443
312385
|
init_report_schema();
|
|
313444
312386
|
count8 = external_exports.number().int().nonnegative();
|
|
313445
312387
|
text10 = external_exports.string().max(16384);
|
|
313446
|
-
|
|
312388
|
+
sha = /^[a-f0-9]{64}$/;
|
|
313447
312389
|
usage = external_exports.object({
|
|
313448
312390
|
discoveredResults: count8,
|
|
313449
312391
|
maxAgentContextBytes: count8,
|
|
@@ -313536,7 +312478,7 @@ var init_application_report_schema = __esm({
|
|
|
313536
312478
|
path: text10.optional(),
|
|
313537
312479
|
url: external_exports.string().url().max(8192).optional(),
|
|
313538
312480
|
size: count8.optional(),
|
|
313539
|
-
sha256: external_exports.string().regex(
|
|
312481
|
+
sha256: external_exports.string().regex(sha).optional(),
|
|
313540
312482
|
ref: text10.optional(),
|
|
313541
312483
|
startedAt: text10.optional(),
|
|
313542
312484
|
redaction: external_exports.enum(["complete", "incomplete"]),
|
|
@@ -313658,7 +312600,7 @@ var init_evidence_paths = __esm({
|
|
|
313658
312600
|
});
|
|
313659
312601
|
|
|
313660
312602
|
// packages/verifier/dist/application-result-adapter.js
|
|
313661
|
-
import { createHash as
|
|
312603
|
+
import { createHash as createHash43 } from "node:crypto";
|
|
313662
312604
|
function e2eApplicationSupervisorEvidenceEntryMax(caseCount) {
|
|
313663
312605
|
if (!Number.isSafeInteger(caseCount) || caseCount < 1 || caseCount > 64)
|
|
313664
312606
|
throw new TypeError("supervisor proof case count is outside the admitted bound");
|
|
@@ -313669,7 +312611,7 @@ function e2eApplicationPrivateTransferMaxBytes(caseCount, shardCount) {
|
|
|
313669
312611
|
throw new TypeError("application private transfer inventory exceeds admitted bounds");
|
|
313670
312612
|
return e2ePrivateTransferMaxBytes(caseCount, 1) + (shardCount - 1) * Math.ceil((E2E_REPORT_MAX_BYTES + E2E_APP_RPC_FRAME_MAX_BYTES) * 4 / 3);
|
|
313671
312613
|
}
|
|
313672
|
-
var
|
|
312614
|
+
var sha2, id11, utc2, boundedData, E2EApplicationProducerSchema, E2EApplicationProofBytesSchema, E2EApplicationSupervisorReadbackSchema, supervisorContext, supervisorRef, supervisorReceiptFrame, mockConsumptionFrame, unmockedCall, unmockedCallsFrame, unmockedCallsRow, cleanupFrame, origin, E2EApplicationOwnedSubjectSchema, accountIdDigest, E2EApplicationObservationBindingSchema, identityProjectionCommon, E2EApplicationAccountIdentityProjectionSchema, anonymousAccountSourceSchema, E2EApplicationSubjectIdentityProjectionSchema, E2EApplicationAssertionAssetBindingSchema, E2EApplicationGovernedModelReceiptRowSchema, governedModelReceiptProjectionSchema, observationHeader, observationRef, E2EApplicationAssertionObservationSchema, agentOperationKind, E2EApplicationAgentOperationObservationSchema, terminalSchema, captureStep, captureAssertion, E2EApplicationCaseCaptureSchema, selectionPacket, processRecord, encodedBytes, encodedProof, E2EApplicationSupervisorReadbackWireSchema, runStartSchema, shardCollection, applicationCapture, E2EApplicationCollectionSchema, E2EApplicationCollectionOracleSchema, hostedRequestFrame, hostedResponseFrame, E2EApplicationGroupResultEnvelopeSchema;
|
|
313673
312615
|
var init_application_result_adapter = __esm({
|
|
313674
312616
|
"packages/verifier/dist/application-result-adapter.js"() {
|
|
313675
312617
|
"use strict";
|
|
@@ -313685,7 +312627,7 @@ var init_application_result_adapter = __esm({
|
|
|
313685
312627
|
init_application_agent_result();
|
|
313686
312628
|
init_evidence_paths();
|
|
313687
312629
|
init_application_templates();
|
|
313688
|
-
|
|
312630
|
+
sha2 = external_exports.string().regex(/^[a-f0-9]{64}$/);
|
|
313689
312631
|
id11 = (max = 256) => external_exports.string().min(1).max(max);
|
|
313690
312632
|
utc2 = external_exports.string().datetime({ offset: true });
|
|
313691
312633
|
boundedData = external_exports.unknown().refine((value) => {
|
|
@@ -313702,7 +312644,7 @@ var init_application_result_adapter = __esm({
|
|
|
313702
312644
|
lifecycleId: id11(120),
|
|
313703
312645
|
operationId: external_exports.string().uuid(),
|
|
313704
312646
|
operationFence: external_exports.number().int().positive(),
|
|
313705
|
-
runtimeManifestDigest:
|
|
312647
|
+
runtimeManifestDigest: sha2,
|
|
313706
312648
|
transportCorrelationId: external_exports.string().uuid()
|
|
313707
312649
|
}).strict();
|
|
313708
312650
|
E2EApplicationProofBytesSchema = external_exports.object({
|
|
@@ -313715,10 +312657,10 @@ var init_application_result_adapter = __esm({
|
|
|
313715
312657
|
evidence: external_exports.array(E2EApplicationProofBytesSchema).max(e2eApplicationSupervisorEvidenceEntryMax(64))
|
|
313716
312658
|
}).strict();
|
|
313717
312659
|
supervisorContext = external_exports.object({
|
|
313718
|
-
bindingDigest:
|
|
313719
|
-
compiledInventoryDigest:
|
|
313720
|
-
preparedEnvironmentDigest:
|
|
313721
|
-
candidateDigest:
|
|
312660
|
+
bindingDigest: sha2,
|
|
312661
|
+
compiledInventoryDigest: sha2,
|
|
312662
|
+
preparedEnvironmentDigest: sha2,
|
|
312663
|
+
candidateDigest: sha2,
|
|
313722
312664
|
roundId: external_exports.string().uuid(),
|
|
313723
312665
|
runId: external_exports.string().uuid(),
|
|
313724
312666
|
groupId: id11(80),
|
|
@@ -313748,13 +312690,13 @@ var init_application_result_adapter = __esm({
|
|
|
313748
312690
|
caseId: id11(160),
|
|
313749
312691
|
componentId: id11(120),
|
|
313750
312692
|
runId: external_exports.string().uuid(),
|
|
313751
|
-
mockManifestDigest:
|
|
312693
|
+
mockManifestDigest: sha2,
|
|
313752
312694
|
lifecycleId: id11(120),
|
|
313753
312695
|
producer: E2EApplicationProducerSchema,
|
|
313754
312696
|
requestId: id11(256),
|
|
313755
312697
|
responseId: id11(256),
|
|
313756
|
-
requestSha256:
|
|
313757
|
-
responseSha256:
|
|
312698
|
+
requestSha256: sha2,
|
|
312699
|
+
responseSha256: sha2,
|
|
313758
312700
|
observedAt: utc2,
|
|
313759
312701
|
requestRef: supervisorRef,
|
|
313760
312702
|
responseRef: supervisorRef
|
|
@@ -313777,7 +312719,7 @@ var init_application_result_adapter = __esm({
|
|
|
313777
312719
|
cleanup: external_exports.enum(["confirmed", "pending", "failed"]),
|
|
313778
312720
|
confirmed: external_exports.boolean(),
|
|
313779
312721
|
serverListening: external_exports.boolean().nullable(),
|
|
313780
|
-
ownedResourceInventoryDigest:
|
|
312722
|
+
ownedResourceInventoryDigest: sha2,
|
|
313781
312723
|
ownedCleanupReceiptRefs: external_exports.array(supervisorRef).max(32)
|
|
313782
312724
|
}).strict();
|
|
313783
312725
|
origin = external_exports.string().min(1).max(512).refine((value) => {
|
|
@@ -313791,13 +312733,13 @@ var init_application_result_adapter = __esm({
|
|
|
313791
312733
|
E2EApplicationOwnedSubjectSchema = external_exports.discriminatedUnion("kind", [
|
|
313792
312734
|
external_exports.object({ kind: external_exports.literal("service"), processId: id11(), origin }).strict(),
|
|
313793
312735
|
external_exports.object({ kind: external_exports.literal("browser"), processId: id11(), contextId: id11(), pageId: id11() }).strict(),
|
|
313794
|
-
external_exports.object({ kind: external_exports.literal("mobile"), leaseId: id11(), deviceProfileId: id11(120), appId: id11(), installedArtifactSha256:
|
|
312736
|
+
external_exports.object({ kind: external_exports.literal("mobile"), leaseId: id11(), deviceProfileId: id11(120), appId: id11(), installedArtifactSha256: sha2 }).strict(),
|
|
313795
312737
|
external_exports.object({ kind: external_exports.literal("desktop"), sessionId: id11(), processId: id11(), windowIds: external_exports.array(id11()).max(32) }).strict().superRefine((subject, context) => {
|
|
313796
312738
|
if (new Set(subject.windowIds).size !== subject.windowIds.length)
|
|
313797
312739
|
context.addIssue({ code: "custom", path: ["windowIds"], message: "window IDs must be unique" });
|
|
313798
312740
|
})
|
|
313799
312741
|
]);
|
|
313800
|
-
accountIdDigest =
|
|
312742
|
+
accountIdDigest = sha2;
|
|
313801
312743
|
E2EApplicationObservationBindingSchema = external_exports.object({
|
|
313802
312744
|
caseId: id11(160),
|
|
313803
312745
|
subject: E2EApplicationOwnedSubjectSchema,
|
|
@@ -313813,7 +312755,7 @@ var init_application_result_adapter = __esm({
|
|
|
313813
312755
|
connectionId: id11(120),
|
|
313814
312756
|
revision: external_exports.number().int().positive(),
|
|
313815
312757
|
originRef: id11(256),
|
|
313816
|
-
grantDigest:
|
|
312758
|
+
grantDigest: sha2
|
|
313817
312759
|
}).strict(), origin }).strict().nullable()
|
|
313818
312760
|
}).strict().superRefine((row2, context) => {
|
|
313819
312761
|
const indexes = row2.assertionProducers.map((item2) => item2.assertionIndex);
|
|
@@ -313822,7 +312764,7 @@ var init_application_result_adapter = __esm({
|
|
|
313822
312764
|
});
|
|
313823
312765
|
identityProjectionCommon = {
|
|
313824
312766
|
caseId: id11(160),
|
|
313825
|
-
bindingDigest:
|
|
312767
|
+
bindingDigest: sha2,
|
|
313826
312768
|
upstreamRunId: external_exports.string().uuid(),
|
|
313827
312769
|
lifecycleId: id11(120),
|
|
313828
312770
|
producer: E2EApplicationProducerSchema,
|
|
@@ -313834,14 +312776,14 @@ var init_application_result_adapter = __esm({
|
|
|
313834
312776
|
schemaVersion: external_exports.literal("e2e-application-account-identity/v1"),
|
|
313835
312777
|
accountRef: E2ERuntimeAccountRefSchema,
|
|
313836
312778
|
sessionRef: id11(256),
|
|
313837
|
-
accountIdDigest:
|
|
312779
|
+
accountIdDigest: sha2
|
|
313838
312780
|
}).strict();
|
|
313839
312781
|
anonymousAccountSourceSchema = external_exports.object({
|
|
313840
312782
|
schemaVersion: external_exports.literal("e2e-executor-account-observation/v1"),
|
|
313841
312783
|
caseId: id11(160),
|
|
313842
312784
|
accountRef: E2ERuntimeAccountRefSchema,
|
|
313843
312785
|
sessionRef: id11(256),
|
|
313844
|
-
accountIdDigest:
|
|
312786
|
+
accountIdDigest: sha2,
|
|
313845
312787
|
observedAt: utc2,
|
|
313846
312788
|
login: external_exports.null(),
|
|
313847
312789
|
identity: external_exports.null()
|
|
@@ -313856,7 +312798,7 @@ var init_application_result_adapter = __esm({
|
|
|
313856
312798
|
assertionIndex: external_exports.number().int().min(0).max(19),
|
|
313857
312799
|
kind: external_exports.enum(["json-schema", "state-probe", "fixture-root"]),
|
|
313858
312800
|
id: id11(256),
|
|
313859
|
-
manifestDigest:
|
|
312801
|
+
manifestDigest: sha2,
|
|
313860
312802
|
ref: E2EApplicationEvidenceRefSchema
|
|
313861
312803
|
}).strict();
|
|
313862
312804
|
E2EApplicationGovernedModelReceiptRowSchema = external_exports.object({
|
|
@@ -313872,12 +312814,12 @@ var init_application_result_adapter = __esm({
|
|
|
313872
312814
|
declaredStepIndex: external_exports.number().int().min(0).max(29),
|
|
313873
312815
|
requestId: id11(256),
|
|
313874
312816
|
receiptId: id11(256),
|
|
313875
|
-
bindingDigest:
|
|
312817
|
+
bindingDigest: sha2,
|
|
313876
312818
|
routeId: id11(120),
|
|
313877
312819
|
routeRevision: id11(120),
|
|
313878
|
-
requestDigest:
|
|
313879
|
-
generationDigest:
|
|
313880
|
-
authoritySnapshotDigest:
|
|
312820
|
+
requestDigest: sha2,
|
|
312821
|
+
generationDigest: sha2,
|
|
312822
|
+
authoritySnapshotDigest: sha2,
|
|
313881
312823
|
sourceReceiptRef: E2EApplicationEvidenceRefSchema,
|
|
313882
312824
|
recordedAt: utc2
|
|
313883
312825
|
}).strict();
|
|
@@ -313885,16 +312827,16 @@ var init_application_result_adapter = __esm({
|
|
|
313885
312827
|
schemaVersion: external_exports.literal("e2e-application-assertion-observation/v1"),
|
|
313886
312828
|
caseId: id11(160),
|
|
313887
312829
|
assertionIndex: external_exports.number().int().min(0).max(19),
|
|
313888
|
-
assertionDigest:
|
|
312830
|
+
assertionDigest: sha2,
|
|
313889
312831
|
observationId: id11(256),
|
|
313890
312832
|
lifecycleId: id11(120),
|
|
313891
312833
|
observedAt: utc2,
|
|
313892
312834
|
producer: E2EApplicationProducerSchema,
|
|
313893
312835
|
subject: E2EApplicationOwnedSubjectSchema,
|
|
313894
312836
|
accountContextId: id11(120),
|
|
313895
|
-
accountContextDigest:
|
|
312837
|
+
accountContextDigest: sha2,
|
|
313896
312838
|
sessionRef: id11(256),
|
|
313897
|
-
accountIdDigest:
|
|
312839
|
+
accountIdDigest: sha2
|
|
313898
312840
|
};
|
|
313899
312841
|
observationRef = E2EApplicationEvidenceRefSchema;
|
|
313900
312842
|
E2EApplicationAssertionObservationSchema = external_exports.discriminatedUnion("kind", [
|
|
@@ -313910,7 +312852,7 @@ var init_application_result_adapter = __esm({
|
|
|
313910
312852
|
origin,
|
|
313911
312853
|
status: external_exports.number().int().min(100).max(599),
|
|
313912
312854
|
bodyRef: observationRef,
|
|
313913
|
-
connectionRef: external_exports.object({ connectionId: id11(120), revision: external_exports.number().int().positive(), originRef: id11(256), grantDigest:
|
|
312855
|
+
connectionRef: external_exports.object({ connectionId: id11(120), revision: external_exports.number().int().positive(), originRef: id11(256), grantDigest: sha2 }).strict().nullable()
|
|
313914
312856
|
}).strict(),
|
|
313915
312857
|
external_exports.object({ ...observationHeader, kind: external_exports.literal("csv"), downloadId: id11(256), downloadName: id11(512), contentRef: observationRef }).strict(),
|
|
313916
312858
|
external_exports.object({ ...observationHeader, kind: external_exports.literal("json"), responseId: id11(256), schemaRef: id11(256), schemaAssetRef: observationRef, bodyRef: observationRef }).strict(),
|
|
@@ -313961,15 +312903,15 @@ var init_application_result_adapter = __esm({
|
|
|
313961
312903
|
caseId: id11(160),
|
|
313962
312904
|
declaredStepIndex: external_exports.number().int().min(0).max(29),
|
|
313963
312905
|
operationIndex: external_exports.number().int().min(0).max(99),
|
|
313964
|
-
declaredActionDigest:
|
|
312906
|
+
declaredActionDigest: sha2,
|
|
313965
312907
|
observationId: id11(256),
|
|
313966
312908
|
lifecycleId: id11(120),
|
|
313967
312909
|
producer: E2EApplicationProducerSchema,
|
|
313968
312910
|
subject: E2EApplicationOwnedSubjectSchema,
|
|
313969
312911
|
accountContextId: id11(120),
|
|
313970
|
-
accountContextDigest:
|
|
312912
|
+
accountContextDigest: sha2,
|
|
313971
312913
|
sessionRef: id11(256),
|
|
313972
|
-
accountIdDigest:
|
|
312914
|
+
accountIdDigest: sha2,
|
|
313973
312915
|
upstreamRunId: external_exports.string().uuid(),
|
|
313974
312916
|
attemptId: id11(256),
|
|
313975
312917
|
sdkStepIndex: external_exports.number().int().min(0).max(255),
|
|
@@ -313977,7 +312919,7 @@ var init_application_result_adapter = __esm({
|
|
|
313977
312919
|
startedAt: utc2,
|
|
313978
312920
|
finishedAt: utc2,
|
|
313979
312921
|
operationKind: agentOperationKind,
|
|
313980
|
-
inputDigest:
|
|
312922
|
+
inputDigest: sha2,
|
|
313981
312923
|
outcome: external_exports.enum(["completed", "failed", "unavailable", "uncertain"]),
|
|
313982
312924
|
sourceReceiptRef: E2EApplicationEvidenceRefSchema
|
|
313983
312925
|
}).strict();
|
|
@@ -313992,7 +312934,7 @@ var init_application_result_adapter = __esm({
|
|
|
313992
312934
|
index: external_exports.number().int().min(0).max(99),
|
|
313993
312935
|
declaredStepIndex: external_exports.number().int().min(0).max(29),
|
|
313994
312936
|
kind: external_exports.enum(["navigate", "fill", "click", "agent", "request", "invoke-contract", "inspect-contract", "launch-app", "tap", "swipe", "deep-link", "restart-app", "set-permission", "choose-file"]),
|
|
313995
|
-
actionDigest:
|
|
312937
|
+
actionDigest: sha2,
|
|
313996
312938
|
observationId: id11(256).nullable(),
|
|
313997
312939
|
at: utc2,
|
|
313998
312940
|
outcome: external_exports.enum(["completed", "failed", "unavailable", "uncertain"]),
|
|
@@ -314001,7 +312943,7 @@ var init_application_result_adapter = __esm({
|
|
|
314001
312943
|
}).strict();
|
|
314002
312944
|
captureAssertion = external_exports.object({
|
|
314003
312945
|
index: external_exports.number().int().min(0).max(19),
|
|
314004
|
-
digest:
|
|
312946
|
+
digest: sha2,
|
|
314005
312947
|
observedAt: utc2,
|
|
314006
312948
|
observationId: id11(256).nullable(),
|
|
314007
312949
|
value: boundedData.nullable(),
|
|
@@ -314018,13 +312960,13 @@ var init_application_result_adapter = __esm({
|
|
|
314018
312960
|
roundId: external_exports.string().uuid(),
|
|
314019
312961
|
runId: external_exports.string().uuid(),
|
|
314020
312962
|
groupId: id11(80),
|
|
314021
|
-
candidateDigest:
|
|
312963
|
+
candidateDigest: sha2,
|
|
314022
312964
|
applicationId: id11(120),
|
|
314023
|
-
buildManifestDigest:
|
|
314024
|
-
runtimeManifestDigest:
|
|
314025
|
-
executionDescriptorDigest:
|
|
312965
|
+
buildManifestDigest: sha2,
|
|
312966
|
+
runtimeManifestDigest: sha2,
|
|
312967
|
+
executionDescriptorDigest: sha2,
|
|
314026
312968
|
accountContextId: id11(120),
|
|
314027
|
-
accountContextDigest:
|
|
312969
|
+
accountContextDigest: sha2,
|
|
314028
312970
|
observedAt: utc2,
|
|
314029
312971
|
lifecycleId: id11(120),
|
|
314030
312972
|
subject: E2EApplicationOwnedSubjectSchema,
|
|
@@ -314067,12 +313009,12 @@ var init_application_result_adapter = __esm({
|
|
|
314067
313009
|
finishedAt: utc2,
|
|
314068
313010
|
timedOut: external_exports.boolean(),
|
|
314069
313011
|
aborted: external_exports.boolean(),
|
|
314070
|
-
stdoutSha256:
|
|
314071
|
-
stderrSha256:
|
|
313012
|
+
stdoutSha256: sha2,
|
|
313013
|
+
stderrSha256: sha2,
|
|
314072
313014
|
stdoutBytes: external_exports.number().int().nonnegative().max(E2E_REPORT_MAX_BYTES),
|
|
314073
313015
|
stderrBytes: external_exports.number().int().nonnegative().max(E2E_REPORT_MAX_BYTES)
|
|
314074
313016
|
}).strict();
|
|
314075
|
-
encodedBytes = external_exports.object({ bytesBase64: external_exports.string().max(6 * 1024 * 1024), byteLength: external_exports.number().int().nonnegative().max(E2E_REPORT_MAX_BYTES), sha256:
|
|
313017
|
+
encodedBytes = external_exports.object({ bytesBase64: external_exports.string().max(6 * 1024 * 1024), byteLength: external_exports.number().int().nonnegative().max(E2E_REPORT_MAX_BYTES), sha256: sha2 }).strict();
|
|
314076
313018
|
encodedProof = external_exports.object({ ref: E2EApplicationEvidenceRefSchema, bytesBase64: external_exports.string().max(35e6) }).strict();
|
|
314077
313019
|
E2EApplicationSupervisorReadbackWireSchema = external_exports.object({
|
|
314078
313020
|
schemaVersion: external_exports.literal("e2e-application-supervisor-readback/v1"),
|
|
@@ -314089,8 +313031,8 @@ var init_application_result_adapter = __esm({
|
|
|
314089
313031
|
shardCollection = external_exports.object({
|
|
314090
313032
|
shardId: id11(120),
|
|
314091
313033
|
launchId: id11(128),
|
|
314092
|
-
launchConfigDigest:
|
|
314093
|
-
fixedAssetDigests: external_exports.record(id11(256),
|
|
313034
|
+
launchConfigDigest: sha2,
|
|
313035
|
+
fixedAssetDigests: external_exports.record(id11(256), sha2),
|
|
314094
313036
|
publicList: boundedData,
|
|
314095
313037
|
publicListBytes: encodedBytes,
|
|
314096
313038
|
listStderr: encodedBytes,
|
|
@@ -314111,13 +313053,13 @@ var init_application_result_adapter = __esm({
|
|
|
314111
313053
|
caseId: id11(160),
|
|
314112
313054
|
componentId: id11(120),
|
|
314113
313055
|
runId: external_exports.string().uuid(),
|
|
314114
|
-
mockManifestDigest:
|
|
313056
|
+
mockManifestDigest: sha2,
|
|
314115
313057
|
lifecycleId: id11(120),
|
|
314116
313058
|
producer: E2EApplicationProducerSchema,
|
|
314117
313059
|
requestId: id11(256),
|
|
314118
313060
|
responseId: id11(256),
|
|
314119
|
-
requestSha256:
|
|
314120
|
-
responseSha256:
|
|
313061
|
+
requestSha256: sha2,
|
|
313062
|
+
responseSha256: sha2,
|
|
314121
313063
|
observedAt: utc2,
|
|
314122
313064
|
requestRef: E2EApplicationEvidenceRefSchema,
|
|
314123
313065
|
responseRef: E2EApplicationEvidenceRefSchema
|
|
@@ -314151,7 +313093,7 @@ var init_application_result_adapter = __esm({
|
|
|
314151
313093
|
if (field4.byteLength > E2E_REPORT_MAX_BYTES || field4.bytesBase64.length !== Math.ceil(field4.byteLength / 3) * 4)
|
|
314152
313094
|
throw new Error();
|
|
314153
313095
|
const decoded = Buffer.from(field4.bytesBase64, "base64");
|
|
314154
|
-
if (decoded.toString("base64") !== field4.bytesBase64 || decoded.byteLength !== field4.byteLength ||
|
|
313096
|
+
if (decoded.toString("base64") !== field4.bytesBase64 || decoded.byteLength !== field4.byteLength || createHash43("sha256").update(decoded).digest("hex") !== field4.sha256)
|
|
314155
313097
|
throw new Error();
|
|
314156
313098
|
} catch {
|
|
314157
313099
|
context.addIssue({ code: "custom", path: ["shards"], message: "private shard bytes are not canonical base64 with the declared size and digest" });
|
|
@@ -314175,7 +313117,7 @@ var init_application_result_adapter = __esm({
|
|
|
314175
313117
|
if (proof.ref.byteLength > 26214400 || proof.bytesBase64.length !== expectedLength || proof.bytesBase64.length > 35e6)
|
|
314176
313118
|
throw new Error();
|
|
314177
313119
|
const bytes5 = Buffer.from(proof.bytesBase64, "base64");
|
|
314178
|
-
if (bytes5.toString("base64") !== proof.bytesBase64 || bytes5.byteLength !== proof.ref.byteLength ||
|
|
313120
|
+
if (bytes5.toString("base64") !== proof.bytesBase64 || bytes5.byteLength !== proof.ref.byteLength || createHash43("sha256").update(bytes5).digest("hex") !== proof.ref.sha256 || proofIds.has(proof.ref.artifactId))
|
|
314179
313121
|
throw new Error();
|
|
314180
313122
|
proofIds.add(proof.ref.artifactId);
|
|
314181
313123
|
proofBytes += bytes5.byteLength;
|
|
@@ -314195,13 +313137,13 @@ var init_application_result_adapter = __esm({
|
|
|
314195
313137
|
binding: E2ERunBindingSchema,
|
|
314196
313138
|
round: E2ERoundSchema,
|
|
314197
313139
|
groupId: id11(80),
|
|
314198
|
-
compiledInventoryDigest:
|
|
313140
|
+
compiledInventoryDigest: sha2,
|
|
314199
313141
|
expectedShardIds: external_exports.array(id11(120)).min(1).max(3),
|
|
314200
313142
|
expectedCases: external_exports.array(E2EExpectedCaseSchema).max(64),
|
|
314201
313143
|
expectedSupervisorReceiptRefs: external_exports.array(E2EApplicationEvidenceRefSchema).min(1).max(32),
|
|
314202
|
-
ownedResourceInventoryDigest:
|
|
313144
|
+
ownedResourceInventoryDigest: sha2,
|
|
314203
313145
|
selectionPackets: external_exports.array(selectionPacket).min(1).max(3),
|
|
314204
|
-
compiledShardConfigDigests: external_exports.array(external_exports.object({ shardId: id11(120), configDigest:
|
|
313146
|
+
compiledShardConfigDigests: external_exports.array(external_exports.object({ shardId: id11(120), configDigest: sha2 }).strict()).min(1).max(3),
|
|
314205
313147
|
expectedMockComponentIdsByTarget: external_exports.array(external_exports.object({ targetId: id11(80), componentIds: external_exports.array(id11(120)).max(32) }).strict()).max(3),
|
|
314206
313148
|
expectedMocksByCase: external_exports.array(external_exports.object({ caseId: id11(160), specs: external_exports.array(E2EMockSpecSchema).max(32) }).strict()).max(64),
|
|
314207
313149
|
/** The mock components the host serves to the application as in-network mocks of its declared origins, and the origin each stands for. Absent means none: rows for any component then follow the executor-request witness rules. */
|
|
@@ -314213,10 +313155,10 @@ var init_application_result_adapter = __esm({
|
|
|
314213
313155
|
applicationIdsByCase: external_exports.array(external_exports.object({
|
|
314214
313156
|
caseId: id11(160),
|
|
314215
313157
|
applicationId: id11(120),
|
|
314216
|
-
buildManifestDigest:
|
|
314217
|
-
buildSourceManifestDigest:
|
|
314218
|
-
buildSourceArchiveSha256:
|
|
314219
|
-
runtimeManifestDigest:
|
|
313158
|
+
buildManifestDigest: sha2,
|
|
313159
|
+
buildSourceManifestDigest: sha2,
|
|
313160
|
+
buildSourceArchiveSha256: sha2,
|
|
313161
|
+
runtimeManifestDigest: sha2,
|
|
314220
313162
|
accountRef: E2ERuntimeAccountRefSchema,
|
|
314221
313163
|
origin: origin.nullable(),
|
|
314222
313164
|
targetId: id11(80),
|
|
@@ -314225,13 +313167,13 @@ var init_application_result_adapter = __esm({
|
|
|
314225
313167
|
stateCapability: external_exports.boolean(),
|
|
314226
313168
|
engine: external_exports.object({ name: id11(120), version: id11(120), spiVersion: external_exports.literal(1), platform: id11(256), capabilities: external_exports.array(id11(120)).max(64) }).strict().nullable(),
|
|
314227
313169
|
accountContextId: id11(120),
|
|
314228
|
-
accountContextDigest:
|
|
314229
|
-
assertionDigests: external_exports.array(
|
|
313170
|
+
accountContextDigest: sha2,
|
|
313171
|
+
assertionDigests: external_exports.array(sha2).min(1).max(20),
|
|
314230
313172
|
scenario: E2EScenarioSchema
|
|
314231
313173
|
}).strict()).max(64),
|
|
314232
|
-
preparedEnvironmentDigest:
|
|
313174
|
+
preparedEnvironmentDigest: sha2,
|
|
314233
313175
|
originByApplicationId: external_exports.array(external_exports.object({ applicationId: id11(120), origin }).strict()).max(12),
|
|
314234
|
-
fixedAssetDigestsByShard: external_exports.array(external_exports.object({ shardId: id11(120), digests: external_exports.record(id11(256),
|
|
313176
|
+
fixedAssetDigestsByShard: external_exports.array(external_exports.object({ shardId: id11(120), digests: external_exports.record(id11(256), sha2) }).strict()).max(3),
|
|
314235
313177
|
modelRoute: external_exports.object({ routeId: id11(120), routeRevision: id11(120) }).strict().nullable(),
|
|
314236
313178
|
/**
|
|
314237
313179
|
* What the worker handed over about its AI navigation steps (Task 4.4a): the receipts of its model calls, the action ledgers, the run's value key. Absent or null for a group
|
|
@@ -314248,8 +313190,8 @@ var init_application_result_adapter = __esm({
|
|
|
314248
313190
|
* Present only for the oracle of an audit replay (Task 4.6b): the group runs with no model route, so its AI navigation steps are judged from the runner's account of them (a step is
|
|
314249
313191
|
* whole only when it is replayed in full from the recording it is bound to) and no model evidence may come with it. The bindings are the admission's.
|
|
314250
313192
|
*/
|
|
314251
|
-
replay: external_exports.object({ bindings: external_exports.array(external_exports.object({ caseId: id11(160), stepIndex: external_exports.number().int().min(0).max(255), keyHash:
|
|
314252
|
-
sourceDigest:
|
|
313193
|
+
replay: external_exports.object({ bindings: external_exports.array(external_exports.object({ caseId: id11(160), stepIndex: external_exports.number().int().min(0).max(255), keyHash: sha2, traceSha256: sha2, actionCount: external_exports.number().int().min(0).max(8) }).strict()).max(12) }).strict().optional(),
|
|
313194
|
+
sourceDigest: sha2,
|
|
314253
313195
|
environment: external_exports.record(id11(256), boundedData),
|
|
314254
313196
|
usage: external_exports.record(id11(256), external_exports.number().nonnegative()),
|
|
314255
313197
|
limits: external_exports.record(id11(256), external_exports.number().nonnegative()),
|
|
@@ -314274,7 +313216,7 @@ var init_application_result_adapter = __esm({
|
|
|
314274
313216
|
if (new Set(originRows.map((item2) => item2.componentId)).size !== originRows.length || originRows.some((item2) => !sourceDerivedMocks.some((spec) => spec.componentId === item2.componentId))) {
|
|
314275
313217
|
context.addIssue({ code: "custom", path: ["mockOrigins"], message: "mock origins must name each approved mock component at most once" });
|
|
314276
313218
|
}
|
|
314277
|
-
if (
|
|
313219
|
+
if (createHash43("sha256").update(canonicalJson(sourceDerivedMocks)).digest("hex") !== oracle.binding.mockManifestDigest) {
|
|
314278
313220
|
context.addIssue({ code: "custom", path: ["expectedMocksByCase"], message: "case mock expectations do not reproduce the admitted mock manifest digest" });
|
|
314279
313221
|
}
|
|
314280
313222
|
const componentsByTarget = /* @__PURE__ */ new Map();
|
|
@@ -314319,15 +313261,15 @@ var init_application_result_adapter = __esm({
|
|
|
314319
313261
|
hostedResponseFrame = external_exports.object({ responseId: id11(256), requestId: id11(256), status: external_exports.number().int().min(100).max(599), body: boundedData }).strict();
|
|
314320
313262
|
E2EApplicationGroupResultEnvelopeSchema = external_exports.object({
|
|
314321
313263
|
schemaVersion: external_exports.literal("e2e-application-group-result/v1"),
|
|
314322
|
-
admissionDigest:
|
|
313264
|
+
admissionDigest: sha2,
|
|
314323
313265
|
groupId: id11(80),
|
|
314324
313266
|
protocol: external_exports.enum(["trusted-e2e-application/v1", "trusted-e2e/v1"]),
|
|
314325
313267
|
outerBinding: E2ERunBindingSchema,
|
|
314326
313268
|
executionBinding: E2ERunBindingSchema,
|
|
314327
313269
|
rawEvidenceRef: E2EApplicationEvidenceRefSchema,
|
|
314328
|
-
rawEvidenceSha256:
|
|
313270
|
+
rawEvidenceSha256: sha2,
|
|
314329
313271
|
result: E2EQualifiedResultSchema,
|
|
314330
|
-
mappingDigest:
|
|
313272
|
+
mappingDigest: sha2
|
|
314331
313273
|
}).strict();
|
|
314332
313274
|
}
|
|
314333
313275
|
});
|
|
@@ -314590,7 +313532,7 @@ var init_install_qualification = __esm({
|
|
|
314590
313532
|
});
|
|
314591
313533
|
|
|
314592
313534
|
// packages/verifier/dist/executor/host-registry.js
|
|
314593
|
-
import { createHash as
|
|
313535
|
+
import { createHash as createHash44 } from "node:crypto";
|
|
314594
313536
|
var E2E_EXECUTOR_HOST_ENTRY_POINT_ID, E2E_EXECUTOR_HOST_ENTRY_SOURCE, E2E_EXECUTOR_HOST_DESCRIPTOR, registrySchema;
|
|
314595
313537
|
var init_host_registry = __esm({
|
|
314596
313538
|
"packages/verifier/dist/executor/host-registry.js"() {
|
|
@@ -314601,7 +313543,7 @@ var init_host_registry = __esm({
|
|
|
314601
313543
|
`;
|
|
314602
313544
|
E2E_EXECUTOR_HOST_DESCRIPTOR = Object.freeze({
|
|
314603
313545
|
entryPointId: E2E_EXECUTOR_HOST_ENTRY_POINT_ID,
|
|
314604
|
-
entryPointManifestDigest:
|
|
313546
|
+
entryPointManifestDigest: createHash44("sha256").update(E2E_EXECUTOR_HOST_ENTRY_SOURCE).digest("hex")
|
|
314605
313547
|
});
|
|
314606
313548
|
registrySchema = external_exports.object({
|
|
314607
313549
|
schemaVersion: external_exports.literal("application-cli-host-registry/v1"),
|
|
@@ -314752,7 +313694,7 @@ var init_fake_core = __esm({
|
|
|
314752
313694
|
});
|
|
314753
313695
|
|
|
314754
313696
|
// packages/verifier/dist/executor/mock-server.js
|
|
314755
|
-
import { createHash as
|
|
313697
|
+
import { createHash as createHash45 } from "node:crypto";
|
|
314756
313698
|
function sortKeys2(value) {
|
|
314757
313699
|
if (Array.isArray(value))
|
|
314758
313700
|
return value.map(sortKeys2);
|
|
@@ -314765,27 +313707,27 @@ function sortKeys2(value) {
|
|
|
314765
313707
|
function canonicalJson2(value) {
|
|
314766
313708
|
return JSON.stringify(sortKeys2(value));
|
|
314767
313709
|
}
|
|
314768
|
-
var MOCK_UNMOCKED_STATUS,
|
|
313710
|
+
var MOCK_UNMOCKED_STATUS, sha3, mockResponseDigest, MOCK_UNMOCKED_RESPONSE_DIGEST;
|
|
314769
313711
|
var init_mock_server = __esm({
|
|
314770
313712
|
"packages/verifier/dist/executor/mock-server.js"() {
|
|
314771
313713
|
"use strict";
|
|
314772
313714
|
init_fake_core();
|
|
314773
313715
|
MOCK_UNMOCKED_STATUS = 599;
|
|
314774
|
-
|
|
314775
|
-
mockResponseDigest = (response) =>
|
|
313716
|
+
sha3 = (value) => createHash45("sha256").update(value, "utf8").digest("hex");
|
|
313717
|
+
mockResponseDigest = (response) => sha3(canonicalJson2({ status: response.status, body: response.body }));
|
|
314776
313718
|
MOCK_UNMOCKED_RESPONSE_DIGEST = mockResponseDigest({ status: MOCK_UNMOCKED_STATUS, body: { error: "rovara-unmocked" } });
|
|
314777
313719
|
}
|
|
314778
313720
|
});
|
|
314779
313721
|
|
|
314780
313722
|
// packages/verifier/dist/host/mock-ledger.js
|
|
314781
|
-
var
|
|
313723
|
+
var sha4, lineSchema;
|
|
314782
313724
|
var init_mock_ledger = __esm({
|
|
314783
313725
|
"packages/verifier/dist/host/mock-ledger.js"() {
|
|
314784
313726
|
"use strict";
|
|
314785
313727
|
init_zod();
|
|
314786
313728
|
init_application_mocks();
|
|
314787
313729
|
init_mock_server();
|
|
314788
|
-
|
|
313730
|
+
sha4 = external_exports.string().regex(/^[a-f0-9]{64}$/);
|
|
314789
313731
|
lineSchema = external_exports.object({
|
|
314790
313732
|
requestId: external_exports.string().min(1).max(200),
|
|
314791
313733
|
method: external_exports.string().min(1).max(16),
|
|
@@ -314793,8 +313735,8 @@ var init_mock_ledger = __esm({
|
|
|
314793
313735
|
inputValue: external_exports.string().max(128).nullable(),
|
|
314794
313736
|
variantId: external_exports.enum(["success", "refusal", "invalid-data"]).nullable(),
|
|
314795
313737
|
status: external_exports.number().int().min(100).max(599),
|
|
314796
|
-
requestSha256:
|
|
314797
|
-
responseSha256:
|
|
313738
|
+
requestSha256: sha4,
|
|
313739
|
+
responseSha256: sha4,
|
|
314798
313740
|
remoteAddress: external_exports.string().min(1).max(64),
|
|
314799
313741
|
observedAt: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/).refine((value) => new Date(value).toISOString() === value)
|
|
314800
313742
|
}).strict();
|
|
@@ -315458,7 +314400,7 @@ var init_verification = __esm({
|
|
|
315458
314400
|
});
|
|
315459
314401
|
|
|
315460
314402
|
// packages/broker/dist/core/e2e/publication-fence.js
|
|
315461
|
-
import { createHash as
|
|
314403
|
+
import { createHash as createHash46 } from "node:crypto";
|
|
315462
314404
|
function approvedPlan(task) {
|
|
315463
314405
|
const artifact2 = task.workflow.artifacts.filter((entry) => entry.type === "plan").at(-1);
|
|
315464
314406
|
const approval = artifact2 === void 0 ? void 0 : task.workflow.decisions.filter((entry) => entry.decision === "APPROVE" && entry.artifactDigest === artifact2.sha256 && (entry.actorRole === "TASK_OWNER" || entry.actorRole === "PROJECT_ADMIN") && (entry.source ?? "GATE") === "GATE").at(-1);
|
|
@@ -315475,7 +314417,7 @@ async function currentPublicationFence(deps, task) {
|
|
|
315475
314417
|
function authorityDigest(task) {
|
|
315476
314418
|
const workflow = task.workflow;
|
|
315477
314419
|
const e2e = workflow.e2e;
|
|
315478
|
-
return
|
|
314420
|
+
return createHash46("sha256").update(canonicalJson({
|
|
315479
314421
|
domain: "core-e2e-publication/v1",
|
|
315480
314422
|
companyId: task.companyId,
|
|
315481
314423
|
developerId: task.developerId,
|
|
@@ -317444,7 +316386,7 @@ function testedCommitLine(workflow, report2) {
|
|
|
317444
316386
|
const candidate = workflow.candidate;
|
|
317445
316387
|
if (candidate === void 0 || report2.passed.length + report2.failed.length === 0)
|
|
317446
316388
|
return void 0;
|
|
317447
|
-
const short = (
|
|
316389
|
+
const short = (sha5) => sha5.slice(0, SHORT_SHA);
|
|
317448
316390
|
const entries = [...candidate.repositories].sort((left, right) => left.repositoryId.localeCompare(right.repositoryId)).map((repository) => {
|
|
317449
316391
|
const pushed = (workflow.pullRequests ?? []).find((pullRequest) => pullRequest.repositoryId === repository.repositoryId && pullRequest.candidateDigest === candidate.digest)?.headSha;
|
|
317450
316392
|
return { repositoryId: repository.repositoryId, text: `${short(repository.commitSha)}${pushed === void 0 || pushed === repository.commitSha ? "" : ` (pushed as ${short(pushed)})`}` };
|
|
@@ -318289,7 +317231,7 @@ __export(artifacts_exports2, {
|
|
|
318289
317231
|
saveFeedbackBundle: () => saveFeedbackBundle,
|
|
318290
317232
|
writeFeedbackBytes: () => writeFeedbackBytes
|
|
318291
317233
|
});
|
|
318292
|
-
import { createHash as
|
|
317234
|
+
import { createHash as createHash47 } from "node:crypto";
|
|
318293
317235
|
function prepareFeedbackBundle(task, input2) {
|
|
318294
317236
|
const bundle = WorkflowFeedbackBundleSchema.parse(input2);
|
|
318295
317237
|
const text16 = JSON.stringify(bundle);
|
|
@@ -318358,7 +317300,7 @@ var init_artifacts3 = __esm({
|
|
|
318358
317300
|
"packages/broker/dist/core/pr-feedback/artifacts.js"() {
|
|
318359
317301
|
"use strict";
|
|
318360
317302
|
init_dist2();
|
|
318361
|
-
feedbackDigest = (text16) =>
|
|
317303
|
+
feedbackDigest = (text16) => createHash47("sha256").update(text16).digest("hex");
|
|
318362
317304
|
FEEDBACK_ARTIFACT_MAX_BYTES = 1e6;
|
|
318363
317305
|
FEEDBACK_INPUTS_MAX_BYTES = 8e6;
|
|
318364
317306
|
feedbackPrefix = (task) => `private/${task.ownerKey}/${task.workspaceId}/feedback-bundles/${task.taskId}/`;
|
|
@@ -319111,10 +318053,10 @@ var init_browser_testing_state = __esm({
|
|
|
319111
318053
|
async function headOf2(host, repository, scope2) {
|
|
319112
318054
|
const tryBranch = async (branch) => {
|
|
319113
318055
|
try {
|
|
319114
|
-
const
|
|
319115
|
-
if (!HEAD_SHA.test(
|
|
318056
|
+
const sha5 = await host.baseBranchHead({ url: repository.url }, branch, scope2);
|
|
318057
|
+
if (!HEAD_SHA.test(sha5))
|
|
319116
318058
|
throw agentXError("RUNTIME_UNAVAILABLE", "the code host did not say what the default branch is at");
|
|
319117
|
-
return
|
|
318059
|
+
return sha5;
|
|
319118
318060
|
} catch (error64) {
|
|
319119
318061
|
if (error64 instanceof AgentXError && (error64.code === "NOT_FOUND" || error64.code === "CONFIG_INVALID"))
|
|
319120
318062
|
return void 0;
|
|
@@ -319939,7 +318881,7 @@ async function readRounds(actions, task, operations, digest17) {
|
|
|
319939
318881
|
try {
|
|
319940
318882
|
const result4 = await withinTime(PROOF_READ_MAX_MS, async () => {
|
|
319941
318883
|
const input2 = operations ?? await actions.operations(task.workspaceId);
|
|
319942
|
-
if (!active || !
|
|
318884
|
+
if (!active || !array2(input2) || input2.length > OPERATIONS_INPUT_MAX)
|
|
319943
318885
|
return void 0;
|
|
319944
318886
|
if (input2.some((op2) => typeof op2 !== "object" || op2 === null || !component(op2.id) || typeof op2.kind !== "string" || op2.kind.length > 32 || typeof op2.createdAt !== "string" || op2.createdAt.length > 64 || !Number.isFinite(Date.parse(op2.createdAt)) || op2.fence !== void 0 && (!Number.isSafeInteger(op2.fence) || op2.fence < 0)))
|
|
319945
318887
|
return void 0;
|
|
@@ -319952,7 +318894,7 @@ async function readRounds(actions, task, operations, digest17) {
|
|
|
319952
318894
|
if (!active)
|
|
319953
318895
|
return void 0;
|
|
319954
318896
|
const listing = await actions.artifacts(task.workspaceId, operation2.id);
|
|
319955
|
-
if (!active || !
|
|
318897
|
+
if (!active || !array2(listing) || listing.length > itemsLeft)
|
|
319956
318898
|
return void 0;
|
|
319957
318899
|
itemsLeft -= listing.length;
|
|
319958
318900
|
if (listing.some((item2) => typeof item2 !== "object" || item2 === null || typeof item2.name !== "string" || typeof item2.objectKey !== "string" || item2.name.length > 256 || item2.objectKey.length > 2e3))
|
|
@@ -320078,7 +319020,7 @@ async function evalRequestForChecks(deps, task, workflow) {
|
|
|
320078
319020
|
};
|
|
320079
319021
|
return evalRequestFor(workflow, await evalRoundsSoFar(actions, task));
|
|
320080
319022
|
}
|
|
320081
|
-
var OPERATIONS_INPUT_MAX, LISTINGS_TOTAL_MAX, component,
|
|
319023
|
+
var OPERATIONS_INPUT_MAX, LISTINGS_TOTAL_MAX, component, array2;
|
|
320082
319024
|
var init_eval_round_reader = __esm({
|
|
320083
319025
|
"packages/broker/dist/core/proof/eval-round-reader.js"() {
|
|
320084
319026
|
"use strict";
|
|
@@ -320090,7 +319032,7 @@ var init_eval_round_reader = __esm({
|
|
|
320090
319032
|
OPERATIONS_INPUT_MAX = 1e4;
|
|
320091
319033
|
LISTINGS_TOTAL_MAX = 1e3;
|
|
320092
319034
|
component = (value) => typeof value === "string" && /^[A-Za-z0-9_-]{1,200}$/u.test(value);
|
|
320093
|
-
|
|
319035
|
+
array2 = (value) => Array.isArray(value);
|
|
320094
319036
|
}
|
|
320095
319037
|
});
|
|
320096
319038
|
|
|
@@ -320232,7 +319174,7 @@ var init_kit = __esm({
|
|
|
320232
319174
|
});
|
|
320233
319175
|
|
|
320234
319176
|
// packages/broker/dist/core/automatic-runs/cap.js
|
|
320235
|
-
import { createHash as
|
|
319177
|
+
import { createHash as createHash48 } from "node:crypto";
|
|
320236
319178
|
async function readAutomaticRunsCap(deps, orgId, project3) {
|
|
320237
319179
|
const stored = await deps.store.get(key(orgId, project3, SETTINGS_SK));
|
|
320238
319180
|
return wholeCap(stored?.["monthlyCap"]) ? { cap: stored["monthlyCap"], isDefault: false } : { cap: DEFAULT_AUTOMATIC_RUNS_PER_MONTH, isDefault: true };
|
|
@@ -320316,7 +319258,7 @@ var init_cap = __esm({
|
|
|
320316
319258
|
key = (orgId, project3, sk) => ({ pk: projectPk(orgId, project3), sk });
|
|
320317
319259
|
monthOf = (ms) => new Date(ms).toISOString().slice(0, 7);
|
|
320318
319260
|
wholeCap = (value) => Number.isInteger(value) && value >= 0 && value <= MAX_AUTOMATIC_RUNS_PER_MONTH;
|
|
320319
|
-
eventIdOf = (...parts2) => `evt_${
|
|
319261
|
+
eventIdOf = (...parts2) => `evt_${createHash48("sha256").update(parts2.join("\0")).digest("hex").slice(0, 40)}`;
|
|
320320
319262
|
}
|
|
320321
319263
|
});
|
|
320322
319264
|
|
|
@@ -320332,7 +319274,7 @@ var init_keys5 = __esm({
|
|
|
320332
319274
|
});
|
|
320333
319275
|
|
|
320334
319276
|
// packages/broker/dist/core/system-runs/usage.js
|
|
320335
|
-
import { createHash as
|
|
319277
|
+
import { createHash as createHash49 } from "node:crypto";
|
|
320336
319278
|
function systemRunUsagePartition(orgId, month) {
|
|
320337
319279
|
if (!OrgIdSchema.safeParse(orgId).success || !MONTH.test(month))
|
|
320338
319280
|
throw new Error("not a usage partition");
|
|
@@ -320341,7 +319283,7 @@ function systemRunUsagePartition(orgId, month) {
|
|
|
320341
319283
|
function systemRunUsageKey(orgId, month, project3, requestId) {
|
|
320342
319284
|
if (!AGENTX_NAME_PATTERN.test(project3))
|
|
320343
319285
|
throw new Error("not a project name");
|
|
320344
|
-
return { pk: systemRunUsagePartition(orgId, month), sk: `${project3}#${
|
|
319286
|
+
return { pk: systemRunUsagePartition(orgId, month), sk: `${project3}#${createHash49("sha256").update(requestId).digest("hex").slice(0, 32)}` };
|
|
320345
319287
|
}
|
|
320346
319288
|
async function recordSystemRunUsage(deps, input2) {
|
|
320347
319289
|
const kind = SystemRunKindSchema.parse(input2.kind);
|
|
@@ -320377,7 +319319,7 @@ var init_usage4 = __esm({
|
|
|
320377
319319
|
});
|
|
320378
319320
|
|
|
320379
319321
|
// packages/broker/dist/core/setup-agent/recheck.js
|
|
320380
|
-
import { createHash as
|
|
319322
|
+
import { createHash as createHash50 } from "node:crypto";
|
|
320381
319323
|
function classifySetupRecheck(state3) {
|
|
320382
319324
|
const step3 = state3.failedStep;
|
|
320383
319325
|
if (typeof step3 !== "string" || step3 === "" || state3.failedStage === void 0)
|
|
@@ -320614,7 +319556,7 @@ var init_recheck = __esm({
|
|
|
320614
319556
|
RECHECK_WAIT_MAX_MS = 55 * 6e4;
|
|
320615
319557
|
STEP_KEPT = 300;
|
|
320616
319558
|
uuidOf = (text16) => {
|
|
320617
|
-
const hex3 =
|
|
319559
|
+
const hex3 = createHash50("sha256").update(`rovara-setup-recheck\0${text16}`).digest("hex");
|
|
320618
319560
|
return `${hex3.slice(0, 8)}-${hex3.slice(8, 12)}-5${hex3.slice(13, 16)}-${(parseInt(hex3[16] ?? "0", 16) & 3 | 8).toString(16)}${hex3.slice(17, 20)}-${hex3.slice(20, 32)}`;
|
|
320619
319561
|
};
|
|
320620
319562
|
claimIdOf = (key2, attempt3) => `setup-recheck-${key2}-${String(attempt3)}`;
|
|
@@ -320816,9 +319758,9 @@ var init_invocation = __esm({
|
|
|
320816
319758
|
});
|
|
320817
319759
|
|
|
320818
319760
|
// packages/broker/dist/core/build-step/prompts.js
|
|
320819
|
-
import { createHash as
|
|
319761
|
+
import { createHash as createHash51 } from "node:crypto";
|
|
320820
319762
|
function promptTagId2(task, requestId) {
|
|
320821
|
-
return
|
|
319763
|
+
return createHash51("sha256").update(`agentx-prompt-tag\0${task.conversationId}\0${requestId}`, "utf8").digest("hex").slice(0, 16);
|
|
320822
319764
|
}
|
|
320823
319765
|
function sendBackProblemsPromptSection(problems, nonce) {
|
|
320824
319766
|
if (problems.length === 0)
|
|
@@ -320894,13 +319836,13 @@ var init_prompts2 = __esm({
|
|
|
320894
319836
|
});
|
|
320895
319837
|
|
|
320896
319838
|
// packages/broker/dist/core/build-step/start.js
|
|
320897
|
-
import { createHash as
|
|
319839
|
+
import { createHash as createHash52 } from "node:crypto";
|
|
320898
319840
|
async function setupWarningWritten(deps, taskId) {
|
|
320899
319841
|
const page = await deps.store.query({ pk: `DEVTASK#${taskId}`, sk: { op: "beginsWith", prefix: "CODE_MILESTONE#setup_paused#" }, limit: 1 });
|
|
320900
319842
|
return page.items.length > 0;
|
|
320901
319843
|
}
|
|
320902
319844
|
function uuidFrom(text16) {
|
|
320903
|
-
const hex3 =
|
|
319845
|
+
const hex3 = createHash52("sha256").update(`agentx-retry\0${text16}`).digest("hex");
|
|
320904
319846
|
return `${hex3.slice(0, 8)}-${hex3.slice(8, 12)}-5${hex3.slice(13, 16)}-${(parseInt(hex3[16] ?? "0", 16) & 3 | 8).toString(16)}${hex3.slice(17, 20)}-${hex3.slice(20, 32)}`;
|
|
320905
319847
|
}
|
|
320906
319848
|
async function locate(deps, row2, where) {
|
|
@@ -361336,7 +360278,7 @@ var require_dist_cjs51 = __commonJS({
|
|
|
361336
360278
|
init_dist2();
|
|
361337
360279
|
import { realpathSync as realpathSync3 } from "node:fs";
|
|
361338
360280
|
import { open as open9, rename as rename9, rm as rm18, writeFile as writeFile14 } from "node:fs/promises";
|
|
361339
|
-
import { homedir as
|
|
360281
|
+
import { homedir as homedir5 } from "node:os";
|
|
361340
360282
|
import { basename as basename6, dirname as dirname12, extname, join as join33, resolve as resolve16 } from "node:path";
|
|
361341
360283
|
import { createInterface as createInterface6 } from "node:readline";
|
|
361342
360284
|
import { Writable as NodeWritable } from "node:stream";
|
|
@@ -364833,7 +363775,7 @@ import { createServer as createServer2 } from "node:http";
|
|
|
364833
363775
|
|
|
364834
363776
|
// packages/cli/src/auth.ts
|
|
364835
363777
|
init_dist2();
|
|
364836
|
-
import { createHash as
|
|
363778
|
+
import { createHash as createHash24, randomBytes as randomBytes3 } from "node:crypto";
|
|
364837
363779
|
import { createServer } from "node:http";
|
|
364838
363780
|
import { execFile } from "node:child_process";
|
|
364839
363781
|
import { promisify } from "node:util";
|
|
@@ -364842,7 +363784,7 @@ function createPkceParameters() {
|
|
|
364842
363784
|
const verifier = randomBytes3(48).toString("base64url");
|
|
364843
363785
|
return {
|
|
364844
363786
|
verifier,
|
|
364845
|
-
challenge:
|
|
363787
|
+
challenge: createHash24("sha256").update(verifier).digest("base64url"),
|
|
364846
363788
|
state: randomBytes3(24).toString("base64url")
|
|
364847
363789
|
};
|
|
364848
363790
|
}
|
|
@@ -364892,7 +363834,7 @@ async function loginWithPkce(options) {
|
|
|
364892
363834
|
}
|
|
364893
363835
|
}
|
|
364894
363836
|
function tokenStoreKey(input2) {
|
|
364895
|
-
return
|
|
363837
|
+
return createHash24("sha256").update(input2.issuer).update("\0").update(input2.clientId).update("\0").update(input2.audience).digest("hex");
|
|
364896
363838
|
}
|
|
364897
363839
|
function sanitizeServerText(text16) {
|
|
364898
363840
|
const printable2 = [...text16].filter((character) => {
|
|
@@ -365288,8 +364230,8 @@ var util2;
|
|
|
365288
364230
|
return void 0;
|
|
365289
364231
|
};
|
|
365290
364232
|
util3.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
365291
|
-
function joinValues2(
|
|
365292
|
-
return
|
|
364233
|
+
function joinValues2(array3, separator = " | ") {
|
|
364234
|
+
return array3.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
365293
364235
|
}
|
|
365294
364236
|
util3.joinValues = joinValues2;
|
|
365295
364237
|
util3.jsonStringifyReplacer = (_, value) => {
|
|
@@ -376120,7 +375062,7 @@ function errorName(error64) {
|
|
|
376120
375062
|
// packages/cli/src/admin/runtime-installation.ts
|
|
376121
375063
|
init_dist2();
|
|
376122
375064
|
init_zod();
|
|
376123
|
-
import { createHash as
|
|
375065
|
+
import { createHash as createHash25 } from "node:crypto";
|
|
376124
375066
|
import { readFile as readFile4, writeFile } from "node:fs/promises";
|
|
376125
375067
|
import { resolve as resolve2 } from "node:path";
|
|
376126
375068
|
var RuntimeInstallChallengeResponseEnvelopeSchema = external_exports.object({ requestId: external_exports.string().min(1).max(256) }).passthrough();
|
|
@@ -376161,7 +375103,7 @@ async function submitRuntimeInstallProposal(input2, fetchImplementation = fetch)
|
|
|
376161
375103
|
return post(input2, "/v1/admin/runtime-installation/registrations", { proposal: webApi, proposalSha256: webApiRuntimeInstallProposalSha256(webApi) }, fetchImplementation);
|
|
376162
375104
|
}
|
|
376163
375105
|
const parsed = RuntimeInstallationProposalSchema.parse(proposal);
|
|
376164
|
-
const proposalSha256 =
|
|
375106
|
+
const proposalSha256 = createHash25("sha256").update(canonicalJson(parsed)).digest("hex");
|
|
376165
375107
|
return post(input2, "/v1/admin/runtime-installation/registrations", { proposal: parsed, proposalSha256 }, fetchImplementation);
|
|
376166
375108
|
}
|
|
376167
375109
|
|
|
@@ -376204,7 +375146,7 @@ async function registerProject(options, fetchImplementation = fetch) {
|
|
|
376204
375146
|
const definition = ProjectDefinitionSchema.parse(options.definition);
|
|
376205
375147
|
WorkspaceDeploymentModeSchema.parse(options.runtimeBinding.deploymentMode);
|
|
376206
375148
|
Ec2RuntimeBindingSchema.parse(options.runtimeBinding);
|
|
376207
|
-
const response = await fetchImplementation(`${options.controlPlaneUrl.replace(/\/$/, "")}/v1/admin/projects`, {
|
|
375149
|
+
const response = await fetchImplementation(`${options.controlPlaneUrl.replace(/\/$/, "")}${options.path ?? "/v1/admin/projects"}`, {
|
|
376208
375150
|
method: "POST",
|
|
376209
375151
|
headers: {
|
|
376210
375152
|
authorization: `Bearer ${options.accessToken}`,
|
|
@@ -376489,7 +375431,7 @@ function inviteExpiryHours(value) {
|
|
|
376489
375431
|
|
|
376490
375432
|
// packages/cli/src/admin/sign-in-clients.ts
|
|
376491
375433
|
init_dist2();
|
|
376492
|
-
import { createHash as
|
|
375434
|
+
import { createHash as createHash26, randomBytes as randomBytes4 } from "node:crypto";
|
|
376493
375435
|
function signInClientId(value) {
|
|
376494
375436
|
const parsed = SignInClientIdSchema.safeParse(value);
|
|
376495
375437
|
if (!parsed.success) throw agentXError("CONFIG_INVALID", "the client ID must be 2\u201332 lower-case letters, digits or hyphens, starting with a letter, and not agentx-cli");
|
|
@@ -376497,7 +375439,7 @@ function signInClientId(value) {
|
|
|
376497
375439
|
}
|
|
376498
375440
|
function newClientSecret() {
|
|
376499
375441
|
const secret = randomBytes4(32).toString("base64url");
|
|
376500
|
-
return { secret, secretHash:
|
|
375442
|
+
return { secret, secretHash: createHash26("sha256").update(secret).digest("hex") };
|
|
376501
375443
|
}
|
|
376502
375444
|
function signInClientRegistration(clientId, options, secretHash) {
|
|
376503
375445
|
const parsed = SignInClientRegistrationSchema.safeParse({
|
|
@@ -378154,7 +377096,7 @@ function presidioScanner(options) {
|
|
|
378154
377096
|
// packages/cli/src/record/sagemaker.ts
|
|
378155
377097
|
init_zod();
|
|
378156
377098
|
init_dist2();
|
|
378157
|
-
import { createHash as
|
|
377099
|
+
import { createHash as createHash27 } from "node:crypto";
|
|
378158
377100
|
import { access as access2, open as open4, rename as rename2, rm as rm4 } from "node:fs/promises";
|
|
378159
377101
|
import { basename as basename2, dirname as dirname2, join as join9 } from "node:path";
|
|
378160
377102
|
var RECORD_MAX_INPUTS = SAGEMAKER_RECORDING_MAX_PAIRS;
|
|
@@ -378220,7 +377162,7 @@ function textOf(bytes5) {
|
|
|
378220
377162
|
}
|
|
378221
377163
|
}
|
|
378222
377164
|
var bodyScanItems = (field4, bytes5, text16) => text16 === void 0 ? binaryScanTexts(bytes5).map((variant) => ({ field: field4, text: variant })) : [{ field: field4, text: text16 }];
|
|
378223
|
-
var sha2564 = (bytes5) =>
|
|
377165
|
+
var sha2564 = (bytes5) => createHash27("sha256").update(bytes5).digest("hex");
|
|
378224
377166
|
var mediaType = (contentType2) => (contentType2.split(";")[0] ?? "").trim().toLowerCase();
|
|
378225
377167
|
async function scanAll(scanner, items) {
|
|
378226
377168
|
const findings = [];
|
|
@@ -378384,7 +377326,7 @@ async function exists(path6) {
|
|
|
378384
377326
|
}
|
|
378385
377327
|
}
|
|
378386
377328
|
async function writeAtomically(out, text16, force) {
|
|
378387
|
-
const temporary = join9(dirname2(out), `.${basename2(out)}.${
|
|
377329
|
+
const temporary = join9(dirname2(out), `.${basename2(out)}.${createHash27("sha256").update(`${out}${String(Date.now())}${String(Math.random())}`).digest("hex").slice(0, 12)}.tmp`);
|
|
378388
377330
|
try {
|
|
378389
377331
|
const handle = await open4(temporary, "wx", 384);
|
|
378390
377332
|
try {
|
|
@@ -383732,7 +382674,7 @@ function guardTransport(inner, refusal5, answer2, beforeFirstList) {
|
|
|
383732
382674
|
}
|
|
383733
382675
|
|
|
383734
382676
|
// packages/mcp/dist/request-ids.js
|
|
383735
|
-
import { createHash as
|
|
382677
|
+
import { createHash as createHash28 } from "node:crypto";
|
|
383736
382678
|
var REQUEST_ID_WINDOW_MS = 15 * 6e4;
|
|
383737
382679
|
var MOST_ENTRIES = 1e3;
|
|
383738
382680
|
var RequestIdMemory = class {
|
|
@@ -383774,7 +382716,7 @@ var RequestIdMemory = class {
|
|
|
383774
382716
|
}
|
|
383775
382717
|
};
|
|
383776
382718
|
function keyOf(content) {
|
|
383777
|
-
return
|
|
382719
|
+
return createHash28("sha256").update(JSON.stringify(content)).digest("hex");
|
|
383778
382720
|
}
|
|
383779
382721
|
|
|
383780
382722
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
@@ -385399,7 +384341,7 @@ init_dist2();
|
|
|
385399
384341
|
import { realpathSync } from "node:fs";
|
|
385400
384342
|
|
|
385401
384343
|
// packages/cli/src/version.ts
|
|
385402
|
-
var RELEASE_VERSION = true ? "0.5.
|
|
384344
|
+
var RELEASE_VERSION = true ? "0.5.18" : void 0;
|
|
385403
384345
|
var CLI_VERSION = RELEASE_VERSION ?? "0.1.0";
|
|
385404
384346
|
function isPrereleaseVersion(version3) {
|
|
385405
384347
|
return /^\d+\.\d+\.\d+-/.test(version3);
|
|
@@ -386635,9 +385577,9 @@ import { chmod as chmod4, mkdir as mkdir6, mkdtemp as mkdtemp3, readdir as readd
|
|
|
386635
385577
|
import { basename as basename4, dirname as dirname5, join as join15, resolve as resolve8 } from "node:path";
|
|
386636
385578
|
|
|
386637
385579
|
// packages/cli/src/deploy/hash.ts
|
|
386638
|
-
import { createHash as
|
|
385580
|
+
import { createHash as createHash30 } from "node:crypto";
|
|
386639
385581
|
function sha256Hex2(data) {
|
|
386640
|
-
return
|
|
385582
|
+
return createHash30("sha256").update(data).digest("hex");
|
|
386641
385583
|
}
|
|
386642
385584
|
|
|
386643
385585
|
// packages/cli/src/deploy/export-bundle.ts
|
|
@@ -391616,11 +390558,11 @@ function recordInCompany(record4, companyId) {
|
|
|
391616
390558
|
|
|
391617
390559
|
// packages/broker/dist/aws/lambda.js
|
|
391618
390560
|
init_dist2();
|
|
391619
|
-
import { createHash as
|
|
390561
|
+
import { createHash as createHash31 } from "node:crypto";
|
|
391620
390562
|
function ownerKeyForSubject(issuer, subject) {
|
|
391621
390563
|
if (!subject || subject.length > 512)
|
|
391622
390564
|
throw agentXError("CONFIG_INVALID", "owner subject is invalid");
|
|
391623
|
-
return
|
|
390565
|
+
return createHash31("sha256").update(issuer).update("\0").update(subject).digest("hex");
|
|
391624
390566
|
}
|
|
391625
390567
|
|
|
391626
390568
|
// packages/broker/dist/developer/store.js
|
|
@@ -391628,9 +390570,9 @@ var import_lib_dynamodb2 = __toESM(require_dist_cjs42(), 1);
|
|
|
391628
390570
|
init_dist2();
|
|
391629
390571
|
|
|
391630
390572
|
// packages/broker/dist/developer/tokens.js
|
|
391631
|
-
import { createHash as
|
|
390573
|
+
import { createHash as createHash32, createPublicKey, randomBytes as randomBytes10, randomUUID as randomUUID10, timingSafeEqual as timingSafeEqual3 } from "node:crypto";
|
|
391632
390574
|
function sha256Hex3(value) {
|
|
391633
|
-
return
|
|
390575
|
+
return createHash32("sha256").update(value).digest("hex");
|
|
391634
390576
|
}
|
|
391635
390577
|
|
|
391636
390578
|
// packages/broker/dist/developer/store.js
|
|
@@ -392487,7 +391429,7 @@ var import_lib_dynamodb12 = __toESM(require_dist_cjs42(), 1);
|
|
|
392487
391429
|
init_zod();
|
|
392488
391430
|
init_dist2();
|
|
392489
391431
|
init_project_incarnation();
|
|
392490
|
-
import { createHash as
|
|
391432
|
+
import { createHash as createHash53, randomUUID as randomUUID13 } from "node:crypto";
|
|
392491
391433
|
|
|
392492
391434
|
// packages/broker/dist/aws/github-credentials.js
|
|
392493
391435
|
init_dist2();
|
|
@@ -396737,7 +395679,7 @@ async function planCanonicalProjectIdentity(deps, companyId, project3, hasConten
|
|
|
396737
395679
|
}
|
|
396738
395680
|
return { revision: next["incarnationRevision"], writes: [equal(previous ?? null, next) ? { ConditionCheck: { TableName: deps.tableName, Key: key2, ...coreProjectSnapshotFence(previous) } } : { Put: { TableName: deps.tableName, Item: next, ...coreProjectSnapshotFence(previous) } }] };
|
|
396739
395681
|
}
|
|
396740
|
-
var snapshotDigest = (row2) =>
|
|
395682
|
+
var snapshotDigest = (row2) => createHash53("sha256").update(canonicalJson(row2 ?? null)).digest("hex");
|
|
396741
395683
|
async function migrateIncarnation(deps, companyId, inventory, dryRun) {
|
|
396742
395684
|
const project3 = inventory.project, metaKey = projectMetaKey(companyId, project3), catalogKey = orgProjectCatalogKey(companyId, project3), revisionKey = projectRevisionKey(companyId, project3, inventory.revision);
|
|
396743
395685
|
const [meta3, catalog, row2] = await Promise.all([get2(deps, metaKey), get2(deps, catalogKey), get2(deps, revisionKey)]);
|
|
@@ -396805,7 +395747,7 @@ function parseRequest(value, deps) {
|
|
|
396805
395747
|
const { dryRun, limit: limit3, continuation, runId, mode, inventory, ...rawMapping } = request;
|
|
396806
395748
|
validateIncarnationMigration(request);
|
|
396807
395749
|
const mapping = mappingSchema.parse(rawMapping);
|
|
396808
|
-
const digest17 =
|
|
395750
|
+
const digest17 = createHash53("sha256").update(canonicalJson({ mapping, ...mode === void 0 ? {} : { mode, inventory }, dryRun, ...runId === void 0 ? {} : { runId }, tableName: deps.tableName, signInTableName: deps.signInTableName })).digest("hex");
|
|
396809
395751
|
let cursor2 = { version: 1, digest: digest17, phase: 0, index: 0 };
|
|
396810
395752
|
if (continuation !== void 0) {
|
|
396811
395753
|
if (!/^[A-Za-z0-9_-]+$/.test(continuation))
|
|
@@ -397873,7 +396815,7 @@ function vendorApi(fetchImplementation) {
|
|
|
397873
396815
|
|
|
397874
396816
|
// packages/cli/src/setup/project-files.ts
|
|
397875
396817
|
init_dist2();
|
|
397876
|
-
import { createHash as
|
|
396818
|
+
import { createHash as createHash54 } from "node:crypto";
|
|
397877
396819
|
var API2 = "https://api.github.com";
|
|
397878
396820
|
var SETUP_TIMEOUT2 = 900;
|
|
397879
396821
|
var TEST_TIMEOUT = 1800;
|
|
@@ -397988,11 +396930,11 @@ function githubRepositoryApi(fetchImplementation) {
|
|
|
397988
396930
|
if (normalizedBase64.length > encodedLimit || !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(normalizedBase64)) throw agentXError("RUNTIME_UNAVAILABLE", `GitHub returned incomplete or mismatched immutable source bytes for ${path6}`);
|
|
397989
396931
|
const bytes5 = Buffer.from(normalizedBase64, "base64");
|
|
397990
396932
|
if (bytes5.byteLength !== entry.size) throw agentXError("RUNTIME_UNAVAILABLE", `GitHub source byte count did not match the immutable tree for ${path6}`);
|
|
397991
|
-
const gitObjectSha =
|
|
396933
|
+
const gitObjectSha = createHash54("sha1").update(Buffer.from(`blob ${bytes5.byteLength}\0`)).update(bytes5).digest("hex");
|
|
397992
396934
|
if (gitObjectSha !== entry.sha) throw agentXError("RUNTIME_UNAVAILABLE", `GitHub source bytes did not match the immutable Git blob identity for ${path6}`);
|
|
397993
396935
|
totalBytes += bytes5.byteLength;
|
|
397994
396936
|
if (totalBytes > MAX_SNAPSHOT_TOTAL_BYTES) throw agentXError("RUNTIME_UNAVAILABLE", "requested source snapshot exceeds the total byte limit");
|
|
397995
|
-
sources.push({ path: path6, sha256:
|
|
396937
|
+
sources.push({ path: path6, sha256: createHash54("sha256").update(bytes5).digest("hex"), bytes: bytes5, kind: "blob" });
|
|
397996
396938
|
}
|
|
397997
396939
|
const candidate = createCandidateManifest([{ repositoryId: fullName, commitSha, treeSha }]);
|
|
397998
396940
|
return { candidate, commitSha, treeSha, treeComplete: true, treePaths: [...treePaths], sources };
|
|
@@ -398119,12 +397061,6 @@ function onlyInstallation(installations2) {
|
|
|
398119
397061
|
}
|
|
398120
397062
|
return installations2[0];
|
|
398121
397063
|
}
|
|
398122
|
-
async function installationToken(input2) {
|
|
398123
|
-
const name3 = githubAppSecretName(input2.env);
|
|
398124
|
-
const jwt2 = appJwtFromSecret(await input2.secrets.get(name3), name3, input2.nowSeconds);
|
|
398125
|
-
const installationId = input2.installationId ?? String(onlyInstallation(await input2.github.listInstallations(jwt2)).id);
|
|
398126
|
-
return (await input2.github.installationToken(jwt2, installationId)).token;
|
|
398127
|
-
}
|
|
398128
397064
|
async function installationAccess(input2) {
|
|
398129
397065
|
const name3 = githubAppSecretName(input2.env);
|
|
398130
397066
|
const jwt2 = appJwtFromSecret(await input2.secrets.get(name3), name3, input2.nowSeconds);
|
|
@@ -398564,20 +397500,15 @@ import { stat as stat6 } from "node:fs/promises";
|
|
|
398564
397500
|
|
|
398565
397501
|
// packages/cli/src/setup/project-add.ts
|
|
398566
397502
|
var import_yaml9 = __toESM(require_dist4(), 1);
|
|
397503
|
+
init_dist2();
|
|
398567
397504
|
import { access as access4, mkdir as mkdir8, readdir as readdir4, readFile as readFile20, writeFile as writeFile6 } from "node:fs/promises";
|
|
398568
|
-
import { createHash as
|
|
397505
|
+
import { createHash as createHash57 } from "node:crypto";
|
|
398569
397506
|
import { join as join20 } from "node:path";
|
|
398570
397507
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
398571
397508
|
|
|
398572
|
-
// packages/broker/dist/e2e/discovery.js
|
|
398573
|
-
init_dist2();
|
|
398574
|
-
|
|
398575
|
-
// packages/cli/src/setup/project-add.ts
|
|
398576
|
-
init_dist2();
|
|
398577
|
-
|
|
398578
397509
|
// packages/cli/src/loop/enrollment-cli.ts
|
|
398579
397510
|
init_dist2();
|
|
398580
|
-
import { createHash as
|
|
397511
|
+
import { createHash as createHash56 } from "node:crypto";
|
|
398581
397512
|
import { realpath as realpath5 } from "node:fs/promises";
|
|
398582
397513
|
import { arch, hostname as hostname3 } from "node:os";
|
|
398583
397514
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
@@ -398831,7 +397762,7 @@ ${body}` }) });
|
|
|
398831
397762
|
init_zod();
|
|
398832
397763
|
init_dist2();
|
|
398833
397764
|
import { randomUUID as randomUUID15 } from "node:crypto";
|
|
398834
|
-
import { createHash as
|
|
397765
|
+
import { createHash as createHash55 } from "node:crypto";
|
|
398835
397766
|
var ShaSchema = external_exports.string().regex(/^[a-f0-9]{40}$/u);
|
|
398836
397767
|
var DigestSchema5 = external_exports.string().regex(/^[a-f0-9]{64}$/u);
|
|
398837
397768
|
var RepoSlugSchema = external_exports.string().regex(/^[A-Za-z0-9_.-]{1,100}\/[A-Za-z0-9_.-]{1,100}$/u, "owner/name");
|
|
@@ -398894,7 +397825,7 @@ var NativeTaskEvidenceReceiptSchema = external_exports.object({
|
|
|
398894
397825
|
const proofDigest = receipt4.proofDigest;
|
|
398895
397826
|
delete semantic.importedAt;
|
|
398896
397827
|
delete semantic.proofDigest;
|
|
398897
|
-
const expected =
|
|
397828
|
+
const expected = createHash55("sha256").update(canonicalJson(semantic)).digest("hex");
|
|
398898
397829
|
if (expected !== proofDigest) context.addIssue({ code: "custom", path: ["proofDigest"], message: "native evidence receipt digest does not match its bound fields" });
|
|
398899
397830
|
});
|
|
398900
397831
|
var RegisteredPendingSourceSchema = external_exports.object({
|
|
@@ -399075,7 +398006,7 @@ function importNativeTaskEvidence(input2) {
|
|
|
399075
398006
|
const progress = workflow.e2e;
|
|
399076
398007
|
const qualified = progress?.qualifiedRound;
|
|
399077
398008
|
if (progress?.required !== true || qualified === void 0 || workflow.verification?.candidateDigest !== manifest.digest || workflow.e2e?.currentRoundId !== qualified.roundId || workflow.e2e.currentGroupRunIds.length !== qualified.groupRunIds.length || workflow.e2e.currentGroupRunIds.some((id12, index) => id12 !== qualified.groupRunIds[index]) || qualified.candidateDigest !== input2.join.candidateDigest || progress.contractDigest !== input2.join.contractDigest || progress.policyDigest !== input2.join.policyDigest || progress.executionPlanDigest !== input2.join.planDigest || qualified.contractDigest !== input2.join.contractDigest || qualified.policyDigest !== input2.join.policyDigest || qualified.executionPlanDigest !== input2.join.planDigest || qualified.roundId !== input2.join.roundId) return hold("e2e_round_binding_mismatch");
|
|
399078
|
-
const expectedEvidenceSetDigest =
|
|
398009
|
+
const expectedEvidenceSetDigest = createHash55("sha256").update(canonicalJson({
|
|
399079
398010
|
domain: "agentx-e2e-publication-context/v1",
|
|
399080
398011
|
taskId: task.taskId,
|
|
399081
398012
|
candidateDigest: input2.join.candidateDigest,
|
|
@@ -399114,7 +398045,7 @@ function importNativeTaskEvidence(input2) {
|
|
|
399114
398045
|
return hold("approved_graph_missing_or_changed");
|
|
399115
398046
|
}
|
|
399116
398047
|
if (graph !== void 0 && (graph.artifactDigest !== plan.sha256 || graph.workflowRevision !== approval.workflowRevision || graph.actorId !== approval.actorId || graph.graphDigest !== approval.workBreakdownDigest)) return hold("approved_graph_mismatch");
|
|
399117
|
-
const approvalDigest =
|
|
398048
|
+
const approvalDigest = createHash55("sha256").update(canonicalJson({
|
|
399118
398049
|
artifactDigest: plan.sha256,
|
|
399119
398050
|
workflowRevision: approval.workflowRevision,
|
|
399120
398051
|
actorId: approval.actorId,
|
|
@@ -399153,7 +398084,7 @@ function importNativeTaskEvidence(input2) {
|
|
|
399153
398084
|
approvalDigest,
|
|
399154
398085
|
...graph === void 0 ? {} : { graphDigest: graph.graphDigest }
|
|
399155
398086
|
};
|
|
399156
|
-
const proofDigest =
|
|
398087
|
+
const proofDigest = createHash55("sha256").update(canonicalJson(semantic)).digest("hex");
|
|
399157
398088
|
return NativeTaskEvidenceReceiptSchema.parse({ ...semantic, importedAt: input2.now.toISOString(), proofDigest });
|
|
399158
398089
|
}
|
|
399159
398090
|
function sameNativeTaskEvidenceReceipt(left, right) {
|
|
@@ -399796,7 +398727,7 @@ async function recordRegisteredLoopEnrollment(input2) {
|
|
|
399796
398727
|
return { recorded: false, reasonCode: "source_identity_unavailable" };
|
|
399797
398728
|
}
|
|
399798
398729
|
const checkoutPath = cwd;
|
|
399799
|
-
const sourceBindingRef = `cli-source:v1:${
|
|
398730
|
+
const sourceBindingRef = `cli-source:v1:${createHash56("sha256").update(JSON.stringify([
|
|
399800
398731
|
parsed.registeredBy,
|
|
399801
398732
|
namespace,
|
|
399802
398733
|
projectDefinition.name,
|
|
@@ -400042,12 +398973,6 @@ function ec2Binding(outputs, stackName) {
|
|
|
400042
398973
|
}
|
|
400043
398974
|
return cliRuntimeBinding("ec2-ebs", { launchTemplateId, subnets, volumeSizeGib: VOLUME_SIZE_GIB, volumeType: VOLUME_TYPE });
|
|
400044
398975
|
}
|
|
400045
|
-
async function builtInGitHubRef(session, fetchImplementation) {
|
|
400046
|
-
const listed4 = await listCredentials(session, fetchImplementation);
|
|
400047
|
-
const ref = listed4.credentials?.find((entry) => entry.builtIn === true && entry.type === "github-app")?.ref;
|
|
400048
|
-
if (typeof ref !== "string") throw agentXError("RUNTIME_UNAVAILABLE", "the control plane lists no GitHub App credential; check the control-plane stack's GitHubAppId parameter");
|
|
400049
|
-
return ref;
|
|
400050
|
-
}
|
|
400051
398976
|
function projectFilePath(configDir, name3) {
|
|
400052
398977
|
return join20(configDir, `${name3}.yaml`);
|
|
400053
398978
|
}
|
|
@@ -400125,7 +399050,15 @@ async function registerRevision(request) {
|
|
|
400125
399050
|
const input2 = { ...request, definition: modelChecked.definition };
|
|
400126
399051
|
const foundation = environmentStackName(input2.env, "foundation");
|
|
400127
399052
|
const runtimeBinding = ec2Binding(await input2.services.stackOutputs(foundation), foundation);
|
|
400128
|
-
const result4 = await registerProject({
|
|
399053
|
+
const result4 = await registerProject({
|
|
399054
|
+
controlPlaneUrl: input2.session.controlPlaneUrl,
|
|
399055
|
+
accessToken: input2.session.accessToken,
|
|
399056
|
+
definition: input2.definition,
|
|
399057
|
+
runtimeBinding,
|
|
399058
|
+
...input2.setupApproval === void 0 ? {} : { setupApproval: input2.setupApproval },
|
|
399059
|
+
...input2.registerPath === void 0 ? {} : { path: input2.registerPath }
|
|
399060
|
+
}, input2.services.fetch);
|
|
399061
|
+
const registeredDefinition = input2.registerPath === void 0 ? input2.definition : withSavedCredentialRefs(input2.definition, result4);
|
|
400129
399062
|
const preflight = RegistrationPreflightSchema.safeParse(result4.preflight);
|
|
400130
399063
|
const warnings = [...modelChecked.warnings, ...Array.isArray(result4.warnings) ? result4.warnings.filter((entry) => typeof entry === "string") : []];
|
|
400131
399064
|
if (input2.setupApproval?.decision === "approve" && input2.definition.e2e !== void 0) {
|
|
@@ -400135,7 +399068,7 @@ async function registerRevision(request) {
|
|
|
400135
399068
|
}
|
|
400136
399069
|
if (input2.services.loopHome !== void 0) {
|
|
400137
399070
|
try {
|
|
400138
|
-
const enrollment = await recordRegisteredLoopEnrollment({ home: input2.services.loopHome, env: input2.env, controlPlaneUrl: input2.session.controlPlaneUrl, definition:
|
|
399071
|
+
const enrollment = await recordRegisteredLoopEnrollment({ home: input2.services.loopHome, env: input2.env, controlPlaneUrl: input2.session.controlPlaneUrl, definition: registeredDefinition, response: result4 });
|
|
400139
399072
|
if (!enrollment.recorded) warnings.push(`local Rovara enrollment is on hold (${enrollment.reasonCode}); publication stays held until registration is confirmed from its source checkout`);
|
|
400140
399073
|
} catch (error64) {
|
|
400141
399074
|
warnings.push(`local Rovara enrollment could not be saved (${error64.message}); publication stays held`);
|
|
@@ -400143,7 +399076,7 @@ async function registerRevision(request) {
|
|
|
400143
399076
|
}
|
|
400144
399077
|
let file2;
|
|
400145
399078
|
try {
|
|
400146
|
-
file2 = await writeProjectFile(input2.services.configDir,
|
|
399079
|
+
file2 = await writeProjectFile(input2.services.configDir, registeredDefinition, { env: input2.env, binding: runtimeBinding });
|
|
400147
399080
|
if (input2.setupApproval !== void 0) {
|
|
400148
399081
|
const policy = input2.setupPolicy ?? input2.definition.e2e;
|
|
400149
399082
|
if (policy === void 0) throw agentXError("CONFIG_INVALID", "a stored setup decision cannot be saved without its source-backed E2E policy");
|
|
@@ -400156,6 +399089,12 @@ async function registerRevision(request) {
|
|
|
400156
399089
|
}
|
|
400157
399090
|
return { revision: input2.definition.revision, preflight: preflight.success ? preflight.data.connectors : [], warnings, file: file2 };
|
|
400158
399091
|
}
|
|
399092
|
+
var SERVER_GITHUB_CREDENTIAL_REF = "install-github-app";
|
|
399093
|
+
function withSavedCredentialRefs(definition, result4) {
|
|
399094
|
+
const saved = ProjectDefinitionSchema.safeParse(result4.project?.definition);
|
|
399095
|
+
if (!saved.success) return definition;
|
|
399096
|
+
return { ...definition, repositories: definition.repositories.map((repository, index) => ({ ...repository, credentialRef: saved.data.repositories[index]?.credentialRef ?? repository.credentialRef })) };
|
|
399097
|
+
}
|
|
400159
399098
|
var REPOSITORY_EXAMPLES = 5;
|
|
400160
399099
|
var REPOSITORY_ACCESS_WAIT_MS = 10 * 60 * 1e3;
|
|
400161
399100
|
var REPOSITORY_ACCESS_POLL_MS = 5e3;
|
|
@@ -400238,7 +399177,7 @@ function normalizedControlPlaneUrl(value) {
|
|
|
400238
399177
|
}
|
|
400239
399178
|
}
|
|
400240
399179
|
function policyDigest(value) {
|
|
400241
|
-
return
|
|
399180
|
+
return createHash57("sha256").update(canonicalJson(E2EPolicySchema.parse(value)), "utf8").digest("hex");
|
|
400242
399181
|
}
|
|
400243
399182
|
function setupDecisionRecord(input2) {
|
|
400244
399183
|
const repositoryUrl = input2.definition.repositories[0]?.url;
|
|
@@ -400354,12 +399293,6 @@ async function confirmSetupPlan(input2) {
|
|
|
400354
399293
|
const commandSummary = "setup: " + input2.setup.map(commandLine2).join("; ") + "; readiness: " + input2.readiness.map(commandLine2).join("; ");
|
|
400355
399294
|
return input2.prompter.confirm("Use this project setup plan? (" + commandSummary + "; targets: " + targetSummary + "; mock substitutions: " + mockSummary + "; unresolved inputs: " + blockerSummary + "; " + aiNavigationSummary + ")", { defaultValue: true });
|
|
400356
399295
|
}
|
|
400357
|
-
function declinedPlanNotice(name3, setup, readiness) {
|
|
400358
|
-
const setupText = setup.map(commandLine2).join("; ");
|
|
400359
|
-
const testText = readiness.map(commandLine2).join("; ");
|
|
400360
|
-
const kept = setup.length > 0 && readiness.length > 0 ? `its setup command (${setupText}) and test command (${testText}) are kept` : setup.length > 0 ? `its setup command (${setupText}) is kept; it has no test command` : readiness.length > 0 ? `its test command (${testText}) is kept; it has no setup command` : "it has no setup or test command";
|
|
400361
|
-
return `Browser and API checks are off for ${name3}; ${kept}.`;
|
|
400362
|
-
}
|
|
400363
399296
|
async function recordSetupDecision(input2) {
|
|
400364
399297
|
const { trusted, decision } = input2;
|
|
400365
399298
|
const approval = await setupRequest(input2.session, input2.fetch, "/v1/admin/projects/setup-approvals", {
|
|
@@ -400470,89 +399403,29 @@ async function addProject(input2) {
|
|
|
400470
399403
|
const repoName2 = agentxRepositoryName(repository.name);
|
|
400471
399404
|
const cwd = `repo/${repoName2}`;
|
|
400472
399405
|
const source3 = repository;
|
|
400473
|
-
|
|
400474
|
-
let setupProposalResponse;
|
|
400475
|
-
let setupDiscoveryNotice;
|
|
400476
|
-
try {
|
|
400477
|
-
setupProposalResponse = await setupRequest(input2.session, input2.services.fetch, "/v1/admin/projects/setup-proposals", {
|
|
400478
|
-
repositoryUrl: source3.cloneUrl,
|
|
400479
|
-
ref: source3.defaultBranch
|
|
400480
|
-
}, 65e3);
|
|
400481
|
-
} catch (error64) {
|
|
400482
|
-
if (error64 instanceof AgentXError && (error64.code === "AUTH_REQUIRED" || error64.code === "FORBIDDEN")) throw error64;
|
|
400483
|
-
if (!(error64 instanceof AgentXError) && !(error64 instanceof TypeError) && !(error64 instanceof DOMException && (error64.name === "AbortError" || error64.name === "TimeoutError"))) throw error64;
|
|
400484
|
-
setupDiscoveryNotice = error64 instanceof AgentXError && error64.code === "CONFIG_INVALID" ? "Testing exploration not done: source-backed proposal was malformed or unbound; E2E evidence remains unknown." : "Testing exploration not done: source capture exceeded its time or size bound, or the discovery service was unavailable; E2E evidence remains unknown.";
|
|
400485
|
-
}
|
|
400486
|
-
if (setupProposalResponse !== void 0) {
|
|
400487
|
-
try {
|
|
400488
|
-
trustedSetup = validateSetupProposalResponse(setupProposalResponse);
|
|
400489
|
-
} catch {
|
|
400490
|
-
setupDiscoveryNotice = "Testing exploration not done: source-backed proposal was malformed or unbound; E2E evidence remains unknown.";
|
|
400491
|
-
}
|
|
400492
|
-
}
|
|
400493
|
-
let setupProposal = trustedSetup?.proposal;
|
|
400494
|
-
const e2ePolicy = trustedSetup?.policy;
|
|
400495
|
-
let setupApproval;
|
|
400496
|
-
if (input2.e2eSetup !== void 0) {
|
|
400497
|
-
if (trustedSetup === void 0) throw agentXError("RUNTIME_UNAVAILABLE", "locally supplied E2E setup evidence requires a fresh trusted server proposal");
|
|
400498
|
-
const candidateProposal = E2ESetupProposalSchema.parse(input2.e2eSetup.proposal);
|
|
400499
|
-
const policy = E2EPolicySchema.parse(input2.e2eSetup.policy);
|
|
400500
|
-
const snapshot = input2.e2eSetup.snapshot;
|
|
400501
|
-
if (snapshot.candidate.digest !== candidateProposal.candidateDigest || snapshot.candidate.repositories.length !== 1 || snapshot.candidate.repositories[0]?.repositoryId !== source3.fullName) {
|
|
400502
|
-
throw agentXError("CONFIG_INVALID", "E2E setup proposal must match this repository's immutable candidate snapshot");
|
|
400503
|
-
}
|
|
400504
|
-
let verifiedProposal;
|
|
400505
|
-
try {
|
|
400506
|
-
verifiedProposal = verifyE2ESetupProposal(candidateProposal, snapshot, snapshot.candidate);
|
|
400507
|
-
} catch (error64) {
|
|
400508
|
-
throw agentXError("CONFIG_INVALID", `E2E setup proposal failed source verification: ${error64 instanceof Error ? error64.message : "invalid source evidence"}`);
|
|
400509
|
-
}
|
|
400510
|
-
if (candidateProposal.targets.length !== policy.targets.length || candidateProposal.targets.some((target3) => !policy.targets.some((configured) => JSON.stringify(configured) === JSON.stringify(target3)))) {
|
|
400511
|
-
throw agentXError("CONFIG_INVALID", "E2E setup policy targets must match the source-backed proposal");
|
|
400512
|
-
}
|
|
400513
|
-
setupProposal = verifiedProposal;
|
|
400514
|
-
if (verifiedProposal.candidateDigest !== trustedSetup.proposal.candidateDigest || !isDeepStrictEqual3(policy, trustedSetup.policy)) {
|
|
400515
|
-
throw agentXError("CONFIG_INVALID", "locally supplied setup evidence differs from the trusted server proposal");
|
|
400516
|
-
}
|
|
400517
|
-
}
|
|
400518
|
-
const files = input2.e2eSetup === void 0 ? Object.fromEntries(await Promise.all(BUILD_FILES.map(async (file2) => [file2, await input2.services.repositories.file(input2.githubToken, source3.fullName, file2)]))) : Object.fromEntries(BUILD_FILES.map((file2) => [file2, input2.e2eSetup.snapshot.sources.find((item2) => item2.path === file2)?.bytes ? Buffer.from(input2.e2eSetup.snapshot.sources.find((item2) => item2.path === file2).bytes).toString("utf8") : void 0]));
|
|
399406
|
+
const files = Object.fromEntries(await Promise.all(BUILD_FILES.map(async (file2) => [file2, await input2.services.repositories.file(input2.githubToken, source3.fullName, file2)])));
|
|
400519
399407
|
const proposed = proposeCommands(files, cwd);
|
|
400520
399408
|
let setup = proposed.setup;
|
|
400521
399409
|
let readiness = proposed.readiness;
|
|
400522
|
-
let e2eAccepted = false;
|
|
400523
399410
|
const typed = (line23, timeout) => line23.trim() === "" ? [] : [parseCommandLine2(line23, cwd, timeout)];
|
|
400524
399411
|
if (flags.setupCommand !== void 0) setup = typed(flags.setupCommand, SETUP_TIMEOUT2);
|
|
400525
399412
|
if (flags.testCommand !== void 0) readiness = typed(flags.testCommand, TEST_TIMEOUT);
|
|
400526
|
-
|
|
400527
|
-
|
|
400528
|
-
|
|
400529
|
-
|
|
400530
|
-
|
|
400531
|
-
input2.write(proposed.basis.length === 0 ? `No build file AgentX knows in ${repository.fullName}. AgentX will propose checks for each task; you can add project checks later.` : proposed.basis.map((line23) => `Proposed from ${line23}`).join("\n"));
|
|
400532
|
-
const summary2 = `setup: ${setup.map(commandLine2).join("; ") || "none"}; test: ${readiness.map(commandLine2).join("; ") || "none"}`;
|
|
400533
|
-
if (proposed.basis.length === 0 || !await prompter.confirm(`Use these commands? (${summary2})`, { defaultValue: true })) {
|
|
400534
|
-
setup = typed(await prompter.ask("Setup command (empty for none)", { flag: "--setup-command", defaultValue: setup.map(commandLine2)[0] ?? "" }), SETUP_TIMEOUT2);
|
|
400535
|
-
readiness = typed(await prompter.ask("Test command (empty to let AgentX propose checks per task)", { flag: "--test-command", defaultValue: readiness.map(commandLine2)[0] ?? "" }), TEST_TIMEOUT);
|
|
400536
|
-
}
|
|
399413
|
+
input2.write(proposed.basis.length === 0 ? `No build file AgentX knows in ${repository.fullName}. AgentX will propose checks for each task; you can add project checks later.` : proposed.basis.map((line23) => `Proposed from ${line23}`).join("\n"));
|
|
399414
|
+
const summary2 = `setup: ${setup.map(commandLine2).join("; ") || "none"}; test: ${readiness.map(commandLine2).join("; ") || "none"}`;
|
|
399415
|
+
if (proposed.basis.length === 0 || !await prompter.confirm(`Use these commands? (${summary2})`, { defaultValue: true })) {
|
|
399416
|
+
setup = typed(await prompter.ask("Setup command (empty for none)", { flag: "--setup-command", defaultValue: setup.map(commandLine2)[0] ?? "" }), SETUP_TIMEOUT2);
|
|
399417
|
+
readiness = typed(await prompter.ask("Test command (empty to let AgentX propose checks per task)", { flag: "--test-command", defaultValue: readiness.map(commandLine2)[0] ?? "" }), TEST_TIMEOUT);
|
|
400537
399418
|
}
|
|
400538
399419
|
const definition = ProjectDefinitionSchema.parse({
|
|
400539
399420
|
name: name3,
|
|
400540
399421
|
revision: 1,
|
|
400541
|
-
repositories: [{ name: repoName2, url: repository.cloneUrl, path: cwd, defaultBranch: repository.defaultBranch, credentialRef:
|
|
399422
|
+
repositories: [{ name: repoName2, url: repository.cloneUrl, path: cwd, defaultBranch: repository.defaultBranch, credentialRef: SERVER_GITHUB_CREDENTIAL_REF }],
|
|
400542
399423
|
setup,
|
|
400543
399424
|
readiness,
|
|
400544
|
-
orchestratorInstructions: DEFAULT_INSTRUCTIONS
|
|
400545
|
-
...e2eAccepted && e2ePolicy !== void 0 ? { e2e: e2ePolicy } : {}
|
|
400546
|
-
});
|
|
400547
|
-
const registered = await registerRevision({
|
|
400548
|
-
env: input2.env,
|
|
400549
|
-
session: input2.session,
|
|
400550
|
-
definition,
|
|
400551
|
-
services: input2.services,
|
|
400552
|
-
...setupApproval === void 0 || e2ePolicy === void 0 ? {} : { setupApproval, setupPolicy: e2ePolicy }
|
|
399425
|
+
orchestratorInstructions: DEFAULT_INSTRUCTIONS
|
|
400553
399426
|
});
|
|
399427
|
+
const registered = await registerRevision({ env: input2.env, session: input2.session, definition, services: input2.services, registerPath: "/v1/dev/projects" });
|
|
400554
399428
|
input2.write(`Registered project ${name3}, revision 1, on EC2 workers. Its file is ${registered.file}.`);
|
|
400555
|
-
if (setupDiscoveryNotice !== void 0) input2.write(setupDiscoveryNotice);
|
|
400556
399429
|
for (const warning2 of registered.warnings) input2.write(`Warning: ${warning2}`);
|
|
400557
399430
|
return { name: name3, revision: 1, file: registered.file };
|
|
400558
399431
|
}
|
|
@@ -402782,42 +401655,16 @@ function adminUserStep() {
|
|
|
402782
401655
|
}
|
|
402783
401656
|
};
|
|
402784
401657
|
}
|
|
401658
|
+
var NO_FIRST_PROJECT_NOTE = "no project yet: a project is added by a company owner or admin signed in with rovara login, with rovara project add";
|
|
402785
401659
|
function firstProjectStep() {
|
|
402786
401660
|
return {
|
|
402787
401661
|
id: "first-project",
|
|
402788
401662
|
title: STEP_PLAN["first-project"].title,
|
|
402789
401663
|
async run(context, progress) {
|
|
402790
|
-
const session = await context.adminSession();
|
|
402791
401664
|
let project3 = progress.current().project;
|
|
402792
|
-
|
|
402793
|
-
|
|
402794
|
-
|
|
402795
|
-
const githubToken = await installationToken({
|
|
402796
|
-
env: context.env,
|
|
402797
|
-
secrets: context.secrets,
|
|
402798
|
-
github: context.setup.github,
|
|
402799
|
-
...installationId === void 0 ? {} : { installationId },
|
|
402800
|
-
nowSeconds: Math.floor(context.now() / 1e3)
|
|
402801
|
-
});
|
|
402802
|
-
let repository;
|
|
402803
|
-
const added = await addProject({
|
|
402804
|
-
env: context.env,
|
|
402805
|
-
session,
|
|
402806
|
-
githubToken,
|
|
402807
|
-
prompter: context.prompter,
|
|
402808
|
-
write: context.write,
|
|
402809
|
-
services: context.setup,
|
|
402810
|
-
flags: context.flags,
|
|
402811
|
-
onRepository: (fullName) => {
|
|
402812
|
-
repository = fullName;
|
|
402813
|
-
}
|
|
402814
|
-
});
|
|
402815
|
-
project3 = { name: added.name, revision: added.revision };
|
|
402816
|
-
await progress.update({ project: project3 });
|
|
402817
|
-
context.surface?.card(projectCard({ name: added.name, revision: added.revision, ...repository === void 0 ? {} : { repository } }));
|
|
402818
|
-
shown4 = true;
|
|
402819
|
-
}
|
|
402820
|
-
if (!shown4) context.surface?.card(projectCard({ name: project3.name, revision: project3.revision }));
|
|
401665
|
+
if (project3 === void 0) return { status: "done", note: NO_FIRST_PROJECT_NOTE };
|
|
401666
|
+
const session = await context.adminSession();
|
|
401667
|
+
context.surface?.card(projectCard({ name: project3.name, revision: project3.revision }));
|
|
402821
401668
|
if (project3.channelId === void 0) {
|
|
402822
401669
|
const slack = progress.current().slack;
|
|
402823
401670
|
if (slack === void 0) throw agentXError("CONFIG_INVALID", "install progress has no Slack app facts; the Slack app step must finish first, so run agentx init again");
|
|
@@ -402872,7 +401719,7 @@ function connectorsStep() {
|
|
|
402872
401719
|
async run(context, progress) {
|
|
402873
401720
|
const wanted = context.flags.connectors === void 0 ? void 0 : parseConnectorsFlag(context.flags.connectors);
|
|
402874
401721
|
const project3 = progress.current().project;
|
|
402875
|
-
if (project3 === void 0)
|
|
401722
|
+
if (project3 === void 0) return { status: "done", note: NO_FIRST_PROJECT_NOTE };
|
|
402876
401723
|
const done = new Set((progress.current().connectors ?? []).map((entry) => entry.type));
|
|
402877
401724
|
for (const type of CONNECTOR_TYPES) {
|
|
402878
401725
|
if (done.has(type)) continue;
|
|
@@ -402976,7 +401823,8 @@ function e2eStep() {
|
|
|
402976
401823
|
title: STEP_PLAN.e2e.title,
|
|
402977
401824
|
async run(context, progress) {
|
|
402978
401825
|
const { project: project3, slack } = progress.current();
|
|
402979
|
-
if (project3
|
|
401826
|
+
if (project3 === void 0) return { status: "done", note: NO_FIRST_PROJECT_NOTE };
|
|
401827
|
+
if (project3.channelId === void 0 || project3.channelName === void 0 || slack === void 0) {
|
|
402980
401828
|
throw agentXError("CONFIG_INVALID", "install progress has no bound channel; the first-project step must finish first, so run agentx init again");
|
|
402981
401829
|
}
|
|
402982
401830
|
const where = { channelName: project3.channelName, channelId: project3.channelId, teamId: slack.teamId };
|
|
@@ -405379,8 +404227,7 @@ async function init(options, deps, services, session) {
|
|
|
405379
404227
|
}
|
|
405380
404228
|
if (options.yes && !options.resume && stored === void 0) {
|
|
405381
404229
|
const missing = [
|
|
405382
|
-
...options.flags.identity !== "oidc" && options.finishFlags.adminEmail === void 0 ? [["--admin-email <email>", "the email of your AgentX admin user"]] : []
|
|
405383
|
-
...options.finishFlags.channel === void 0 ? [["--channel <name>", "the Slack channel for the first project"]] : []
|
|
404230
|
+
...options.flags.identity !== "oidc" && options.finishFlags.adminEmail === void 0 ? [["--admin-email <email>", "the email of your AgentX admin user"]] : []
|
|
405384
404231
|
];
|
|
405385
404232
|
const [first2] = missing;
|
|
405386
404233
|
if (first2 !== void 0) throw agentXError("CONFIG_INVALID", `agentx init --yes needs ${first2[0]} (${first2[1]}); pass it, or run agentx init without --yes to be asked`);
|
|
@@ -405790,6 +404637,7 @@ async function runEnvAdopt(input2) {
|
|
|
405790
404637
|
// packages/cli/src/setup/command-context.ts
|
|
405791
404638
|
init_dist2();
|
|
405792
404639
|
var import_client_secrets_manager7 = __toESM(require_dist_cjs22(), 1);
|
|
404640
|
+
import { homedir as homedir3 } from "node:os";
|
|
405793
404641
|
function noTerminalPrompter() {
|
|
405794
404642
|
const unattended = unattendedPrompter();
|
|
405795
404643
|
return {
|
|
@@ -405854,6 +404702,11 @@ function realSetupContext(input2) {
|
|
|
405854
404702
|
};
|
|
405855
404703
|
return {
|
|
405856
404704
|
openAws,
|
|
404705
|
+
async openPerson(command5) {
|
|
404706
|
+
const run2 = await openAws(command5);
|
|
404707
|
+
const signedIn = await developerAccessToken({ home: input2.home ?? homedir3(), tokenStore: input2.tokenStore, fetch: input2.fetch }, run2.env);
|
|
404708
|
+
return { ...run2, session: { controlPlaneUrl: signedIn.entry.url, accessToken: signedIn.accessToken } };
|
|
404709
|
+
},
|
|
405857
404710
|
async open(command5) {
|
|
405858
404711
|
const run2 = await openAws(command5);
|
|
405859
404712
|
const session = await openAdminSession({
|
|
@@ -406693,7 +405546,7 @@ function projectOption(command5, what) {
|
|
|
406693
405546
|
function registerSetupCommands(program2, context) {
|
|
406694
405547
|
const project3 = program2.command("project").description("AgentX projects");
|
|
406695
405548
|
withRegion(project3.command("add").description("register a new project from a repository the GitHub App sees, on EC2 workers")).option("--repository <owner/name>", "the repository").option("--project-name <name>", "the project's name (default: the repository's)").option("--setup-command <command>", 'the setup command, or "" for none').option("--test-command <command>", 'the test command, or "" for none').option("--no-browser", "when the GitHub App cannot see the repository yet, print the page where it is added instead of opening it").action(async (options, command5) => {
|
|
406696
|
-
const run2 = await context.
|
|
405549
|
+
const run2 = await context.openPerson(command5);
|
|
406697
405550
|
const access10 = await installationAccess({ env: run2.env, secrets: run2.secrets, github: run2.services.github, nowSeconds: Math.floor(Date.now() / 1e3) });
|
|
406698
405551
|
const flags = definedEntries({ repository: options.repository, projectName: options.projectName, setupCommand: options.setupCommand, testCommand: options.testCommand });
|
|
406699
405552
|
const wait2 = run2.interactive === true ? { sleep: run2.sleep, now: run2.now, ...options.browser === false || run2.openBrowser === void 0 ? {} : { openBrowser: run2.openBrowser } } : void 0;
|
|
@@ -410343,7 +409196,7 @@ function parseComment(body) {
|
|
|
410343
409196
|
}
|
|
410344
409197
|
|
|
410345
409198
|
// packages/cli/src/loop/exit-checks.ts
|
|
410346
|
-
import { createHash as
|
|
409199
|
+
import { createHash as createHash58 } from "node:crypto";
|
|
410347
409200
|
import { readFile as readFile25 } from "node:fs/promises";
|
|
410348
409201
|
import { join as join27 } from "node:path";
|
|
410349
409202
|
|
|
@@ -410837,7 +409690,7 @@ async function readArtifact(worktree, issue2, artifact2) {
|
|
|
410837
409690
|
return readFile25(join27(worktree, artifactPath(issue2, artifact2)), "utf8").catch(() => void 0);
|
|
410838
409691
|
}
|
|
410839
409692
|
function artifactDigest(text16) {
|
|
410840
|
-
return
|
|
409693
|
+
return createHash58("sha256").update(text16).digest("hex");
|
|
410841
409694
|
}
|
|
410842
409695
|
function missingSections(text16, required4) {
|
|
410843
409696
|
const sections2 = /* @__PURE__ */ new Map();
|
|
@@ -412173,7 +411026,7 @@ ${givenPrompt}`}`;
|
|
|
412173
411026
|
|
|
412174
411027
|
// packages/cli/src/loop/harness.ts
|
|
412175
411028
|
import { readdir as readdir7, access as access8 } from "node:fs/promises";
|
|
412176
|
-
import { homedir as
|
|
411029
|
+
import { homedir as homedir4 } from "node:os";
|
|
412177
411030
|
import { join as join30 } from "node:path";
|
|
412178
411031
|
var toml = (value) => JSON.stringify(value);
|
|
412179
411032
|
function agentCommand(session) {
|
|
@@ -412222,7 +411075,7 @@ var AgentHarness = class {
|
|
|
412222
411075
|
* folder-trust dialog, or exited at once) has none, and `claude --resume` on it fails at once.
|
|
412223
411076
|
*/
|
|
412224
411077
|
async hasConversation(id12) {
|
|
412225
|
-
const projects = join30(this.options.claudeHome ?? process.env.CLAUDE_CONFIG_DIR ?? join30(
|
|
411078
|
+
const projects = join30(this.options.claudeHome ?? process.env.CLAUDE_CONFIG_DIR ?? join30(homedir4(), ".claude"), "projects");
|
|
412226
411079
|
let dirs;
|
|
412227
411080
|
try {
|
|
412228
411081
|
dirs = await readdir7(projects);
|
|
@@ -412794,7 +411647,7 @@ function createCliProgram(dependencies = {}) {
|
|
|
412794
411647
|
};
|
|
412795
411648
|
const cliInvocation = dependencies.cliInvocation ?? currentCliInvocation();
|
|
412796
411649
|
const commandFor = (args) => cliCommandLine(cliInvocation, args);
|
|
412797
|
-
const home = dependencies.environments?.home ??
|
|
411650
|
+
const home = dependencies.environments?.home ?? homedir5();
|
|
412798
411651
|
const parameterStore = (region) => {
|
|
412799
411652
|
const client = (dependencies.environments?.ssmClient ?? environmentSsmClient)(region);
|
|
412800
411653
|
return dependencies.environments?.store ?? ssmParameterStore(client);
|
|
@@ -412829,7 +411682,7 @@ function createCliProgram(dependencies = {}) {
|
|
|
412829
411682
|
return stored !== void 0 && stored.expiresAt > Date.now() ? stored : void 0;
|
|
412830
411683
|
}
|
|
412831
411684
|
const developerSession = () => ({ home, tokenStore: services.tokenStore, fetch: services.fetchImplementation });
|
|
412832
|
-
const program2 = new Command2().name(CLI_COMMAND_NAME).description("Rovara Code: sign in, deploy and administer your coding-agent workspace; hand off tasks from your coding tool or Slack").version(CLI_VERSION).option("--project <project-name>", "select a locally configured AgentX project").option("--config-dir <directory>", "project configuration directory", join33(
|
|
411685
|
+
const program2 = new Command2().name(CLI_COMMAND_NAME).description("Rovara Code: sign in, deploy and administer your coding-agent workspace; hand off tasks from your coding tool or Slack").version(CLI_VERSION).option("--project <project-name>", "select a locally configured AgentX project").option("--config-dir <directory>", "project configuration directory", join33(homedir5(), ".agentx/projects")).option("--deployment-file <path>", "AgentX deployment settings; defaults to this environment's local cache, or, for production, ~/.agentx/deployment.yaml").option("--env <name>", "AgentX environment", DEFAULT_ENVIRONMENT).option("--allow-loopback", "allow loopback HTTP endpoints for local testing only", false).option("--accept-unchecked-model <reason>", "register a project whose default model failed its check anyway (project add, setup-approve, connector add, admin project register); the reason is recorded with the revision").option("--json", "emit stable machine-readable output", false).addHelpText("after", `
|
|
412833
411686
|
${ROOT_HELP_DOCS_LINES.join("\n")}`);
|
|
412834
411687
|
program2.hook("preAction", (_program, actionCommand) => {
|
|
412835
411688
|
const { env: env3 } = actionCommand.optsWithGlobals();
|
|
@@ -413544,7 +412397,7 @@ ${url2}
|
|
|
413544
412397
|
`);
|
|
413545
412398
|
});
|
|
413546
412399
|
addSignInOptions(
|
|
413547
|
-
program2.command("init").description("install AgentX in this AWS account, step by step, resuming where it stopped; --export writes a bundle for a platform team instead").option("--export <dir>", "write a self-contained bundle a platform team deploys to create the access stack").option("--region <region>", "AWS region to deploy into").option("--account <account>", "AWS account id; defaults to the caller's own account (sts GetCallerIdentity, read-only)").option("--release <dir>", "release directory (agentx release build output); default: download the release matching this agentx. An agentx built from source needs none with --engine cdk --source").addOption(new Option2("--engine <engine>", "deploy engine: published CloudFormation templates, or cdk from a source checkout").choices(["templates", "cdk"])).option("--source <dir>", "clean git checkout of a release tag; required for --engine cdk. An agentx built from source takes the version from its tag").option("--resume", "only continue an install already under way; never start a new one", false).option("--from-bundle <dir>", "with --resume: continue an install whose access stack a platform team deployed from this export bundle").option("--yes", 'answer every question with its default or its flag, without asking; the plan is still printed. Confirmations such as the Slack bot and workspace check and "Request URL Verified?" are answered yes, so check the printed summary afterwards', false).option("--no-browser", "print every address to open instead of opening a browser, and ask in the terminal unless --ui is given").option("--ui", "ask every question on a page on 127.0.0.1 (the default in an interactive terminal that can open a browser)").option("--no-ui", "ask every question in the terminal").option("--setup-table <name>", "the installer job in the cloud: ask every question on the setup page, through this DynamoDB table (needs --setup-url)").option("--setup-url <url>", "the setup page's address, printed for the job's log (with --setup-table)").addOption(new Option2("--identity <mode>", "identity provider").choices(["cognito", "oidc"]).default("cognito")).option("--oidc-issuer <url>", "your OIDC provider's issuer URL (required with --identity oidc)").option("--oidc-audience <audience>", "your OIDC provider's audience (required with --identity oidc)").option("--oidc-client-id <id>", "your OIDC provider's client id, needed for agentx login").option("--admin-claim <claim>", "the OIDC claim that marks AgentX administrators").option("--admin-values <values>", "comma-separated values of --admin-claim that mark an administrator").option("--permission-boundary <arn>", "IAM permissions boundary ARN applied to every role AgentX creates").option("--operator-principal <arn>", "ARN of ONE IAM role or user allowed to assume the AgentX operator role (never a whole account; empty: this account's own principals)").option("--operator-external-id <id>", "the sts:ExternalId the operator principal must present; required when that principal belongs to another AWS account").addOption(new Option2("--model-provider <provider>", "model provider for the orchestrator, classifier and worker; a per-component provider flag wins over it").choices([...MODEL_PROVIDERS])).option("--orchestrator-provider <provider>", "amazon-bedrock (default), openrouter, anthropic or openai").option("--classifier-provider <provider>", "amazon-bedrock (default), openrouter, anthropic or openai").option("--worker-provider <provider>", "amazon-bedrock (default), openrouter, anthropic or openai").option("--openrouter-key-file <path>", "file holding the OpenRouter API key; init stores it in agentx/<env>/openrouter").option("--openrouter-key-env <NAME>", "environment variable holding the OpenRouter API key; init stores it in agentx/<env>/openrouter").option("--openrouter-secret-arn <arn>", "a Secrets Manager secret you made yourself holding the raw OpenRouter key; init then asks for no key").option("--openrouter-providers <slugs>", "comma-separated OpenRouter provider allowlist").option("--anthropic-key-file <path>", "file holding your Anthropic API key; init stores it in agentx/<env>/anthropic").option("--anthropic-key-env <NAME>", "environment variable holding your Anthropic API key; init stores it in agentx/<env>/anthropic").option("--anthropic-secret-arn <arn>", "a Secrets Manager secret you made yourself holding the raw Anthropic API key; init then asks for no key").option("--openai-key-file <path>", "file holding your OpenAI API key; init stores it in agentx/<env>/openai").option("--openai-key-env <NAME>", "environment variable holding your OpenAI API key; init stores it in agentx/<env>/openai").option("--openai-secret-arn <arn>", "a Secrets Manager secret you made yourself holding the raw OpenAI API key; init then asks for no key").option("--orchestrator-model <id>", "Provider model id for the Slack orchestrator", DEFAULT_ORCHESTRATOR_MODEL).option("--classifier-model <id>", "Provider model id for the gate classifier", DEFAULT_CLASSIFIER_MODEL).option("--model-gateway-url <origin>", "Optional external signed-price model gateway HTTPS origin (default: deploy built-in self-hosted gateway)").option("--agent-model <id>", "Core agent model offered by the gateway (defaults to the chosen provider's recommended model)").option("--gateway-certificate-arn <arn>", "Optional ACM certificate ARN for the self-hosted gateway ALB").option("--gateway-host <hostname>", "Optional custom hostname for the self-hosted gateway").option("--gateway-image <digest-ref>", "Model Gateway image by digest; an agentx built from source needs it with --engine cdk when the tag has no published release.json").option("--worker-model <id>", "Provider model id for the runtime worker", DEFAULT_WORKER_MODEL).option("--alert-email <address>", "email address AgentX sends alerts to").option("--alert-webhook-file <path>", "file holding a PagerDuty or Opsgenie integration address (kept secret)").option("--alert-webhook-env <NAME>", "environment variable holding a PagerDuty or Opsgenie integration address (kept secret)").option("--no-alerts", "send alerts nowhere for now").option("--budget <usd>", "monthly AWS budget in whole US dollars; 0 for none (default 100)").addOption(new Option2("--budget-scope <scope>", "tag: costs tagged agentx:env; account: the whole account").choices(["tag", "account"])).option("--github-account <login>", "GitHub organization or user that will own the AgentX GitHub App").addOption(new Option2("--github-account-type <type>", "whether --github-account is an organization or a personal account").choices(["organization", "user"])).option("--github-app-name <name>", "GitHub App name (unique on GitHub)").option("--github-app-id <id>", "a GitHub App made beforehand: its app id").option("--github-installation-id <id>", "a GitHub App made beforehand: its installation id").option("--github-private-key-file <path>", "a GitHub App made beforehand: its private key .pem file").option("--github-private-key-env <NAME>", "a GitHub App made beforehand: environment variable holding its private key").option("--slack-app-name <name>", "Slack app name").addOption(new Option2("--slack-app-posted-messages <mode>", "answer mentions people post through other apps with their own Slack token").choices(["accept", "ignore"])).addOption(new Option2("--slack-install <state>", "whether the Slack app is installed, or waits for an admin's approval (default with --yes: installed)").choices(["installed", "approval"])).option("--slack-bot-token-file <path>", "file holding the Slack Bot User OAuth Token").option("--slack-bot-token-env <NAME>", "environment variable holding the Slack Bot User OAuth Token").option("--slack-signing-secret-file <path>", "file holding the Slack signing secret").option("--slack-signing-secret-env <NAME>", "environment variable holding the Slack signing secret").option("--worker-image <digest-ref>", "worker image by digest; an agentx built from source needs it with --engine cdk when the tag has no published release.json").option("--slack-image <digest-ref>", "Slack service image by digest; an agentx built from source needs it with --engine cdk when the tag has no published release.json").option("--admin-email <email>", "Cognito: your email, for the AgentX admin user").option("--
|
|
412400
|
+
program2.command("init").description("install AgentX in this AWS account, step by step, resuming where it stopped; --export writes a bundle for a platform team instead").option("--export <dir>", "write a self-contained bundle a platform team deploys to create the access stack").option("--region <region>", "AWS region to deploy into").option("--account <account>", "AWS account id; defaults to the caller's own account (sts GetCallerIdentity, read-only)").option("--release <dir>", "release directory (agentx release build output); default: download the release matching this agentx. An agentx built from source needs none with --engine cdk --source").addOption(new Option2("--engine <engine>", "deploy engine: published CloudFormation templates, or cdk from a source checkout").choices(["templates", "cdk"])).option("--source <dir>", "clean git checkout of a release tag; required for --engine cdk. An agentx built from source takes the version from its tag").option("--resume", "only continue an install already under way; never start a new one", false).option("--from-bundle <dir>", "with --resume: continue an install whose access stack a platform team deployed from this export bundle").option("--yes", 'answer every question with its default or its flag, without asking; the plan is still printed. Confirmations such as the Slack bot and workspace check and "Request URL Verified?" are answered yes, so check the printed summary afterwards', false).option("--no-browser", "print every address to open instead of opening a browser, and ask in the terminal unless --ui is given").option("--ui", "ask every question on a page on 127.0.0.1 (the default in an interactive terminal that can open a browser)").option("--no-ui", "ask every question in the terminal").option("--setup-table <name>", "the installer job in the cloud: ask every question on the setup page, through this DynamoDB table (needs --setup-url)").option("--setup-url <url>", "the setup page's address, printed for the job's log (with --setup-table)").addOption(new Option2("--identity <mode>", "identity provider").choices(["cognito", "oidc"]).default("cognito")).option("--oidc-issuer <url>", "your OIDC provider's issuer URL (required with --identity oidc)").option("--oidc-audience <audience>", "your OIDC provider's audience (required with --identity oidc)").option("--oidc-client-id <id>", "your OIDC provider's client id, needed for agentx login").option("--admin-claim <claim>", "the OIDC claim that marks AgentX administrators").option("--admin-values <values>", "comma-separated values of --admin-claim that mark an administrator").option("--permission-boundary <arn>", "IAM permissions boundary ARN applied to every role AgentX creates").option("--operator-principal <arn>", "ARN of ONE IAM role or user allowed to assume the AgentX operator role (never a whole account; empty: this account's own principals)").option("--operator-external-id <id>", "the sts:ExternalId the operator principal must present; required when that principal belongs to another AWS account").addOption(new Option2("--model-provider <provider>", "model provider for the orchestrator, classifier and worker; a per-component provider flag wins over it").choices([...MODEL_PROVIDERS])).option("--orchestrator-provider <provider>", "amazon-bedrock (default), openrouter, anthropic or openai").option("--classifier-provider <provider>", "amazon-bedrock (default), openrouter, anthropic or openai").option("--worker-provider <provider>", "amazon-bedrock (default), openrouter, anthropic or openai").option("--openrouter-key-file <path>", "file holding the OpenRouter API key; init stores it in agentx/<env>/openrouter").option("--openrouter-key-env <NAME>", "environment variable holding the OpenRouter API key; init stores it in agentx/<env>/openrouter").option("--openrouter-secret-arn <arn>", "a Secrets Manager secret you made yourself holding the raw OpenRouter key; init then asks for no key").option("--openrouter-providers <slugs>", "comma-separated OpenRouter provider allowlist").option("--anthropic-key-file <path>", "file holding your Anthropic API key; init stores it in agentx/<env>/anthropic").option("--anthropic-key-env <NAME>", "environment variable holding your Anthropic API key; init stores it in agentx/<env>/anthropic").option("--anthropic-secret-arn <arn>", "a Secrets Manager secret you made yourself holding the raw Anthropic API key; init then asks for no key").option("--openai-key-file <path>", "file holding your OpenAI API key; init stores it in agentx/<env>/openai").option("--openai-key-env <NAME>", "environment variable holding your OpenAI API key; init stores it in agentx/<env>/openai").option("--openai-secret-arn <arn>", "a Secrets Manager secret you made yourself holding the raw OpenAI API key; init then asks for no key").option("--orchestrator-model <id>", "Provider model id for the Slack orchestrator", DEFAULT_ORCHESTRATOR_MODEL).option("--classifier-model <id>", "Provider model id for the gate classifier", DEFAULT_CLASSIFIER_MODEL).option("--model-gateway-url <origin>", "Optional external signed-price model gateway HTTPS origin (default: deploy built-in self-hosted gateway)").option("--agent-model <id>", "Core agent model offered by the gateway (defaults to the chosen provider's recommended model)").option("--gateway-certificate-arn <arn>", "Optional ACM certificate ARN for the self-hosted gateway ALB").option("--gateway-host <hostname>", "Optional custom hostname for the self-hosted gateway").option("--gateway-image <digest-ref>", "Model Gateway image by digest; an agentx built from source needs it with --engine cdk when the tag has no published release.json").option("--worker-model <id>", "Provider model id for the runtime worker", DEFAULT_WORKER_MODEL).option("--alert-email <address>", "email address AgentX sends alerts to").option("--alert-webhook-file <path>", "file holding a PagerDuty or Opsgenie integration address (kept secret)").option("--alert-webhook-env <NAME>", "environment variable holding a PagerDuty or Opsgenie integration address (kept secret)").option("--no-alerts", "send alerts nowhere for now").option("--budget <usd>", "monthly AWS budget in whole US dollars; 0 for none (default 100)").addOption(new Option2("--budget-scope <scope>", "tag: costs tagged agentx:env; account: the whole account").choices(["tag", "account"])).option("--github-account <login>", "GitHub organization or user that will own the AgentX GitHub App").addOption(new Option2("--github-account-type <type>", "whether --github-account is an organization or a personal account").choices(["organization", "user"])).option("--github-app-name <name>", "GitHub App name (unique on GitHub)").option("--github-app-id <id>", "a GitHub App made beforehand: its app id").option("--github-installation-id <id>", "a GitHub App made beforehand: its installation id").option("--github-private-key-file <path>", "a GitHub App made beforehand: its private key .pem file").option("--github-private-key-env <NAME>", "a GitHub App made beforehand: environment variable holding its private key").option("--slack-app-name <name>", "Slack app name").addOption(new Option2("--slack-app-posted-messages <mode>", "answer mentions people post through other apps with their own Slack token").choices(["accept", "ignore"])).addOption(new Option2("--slack-install <state>", "whether the Slack app is installed, or waits for an admin's approval (default with --yes: installed)").choices(["installed", "approval"])).option("--slack-bot-token-file <path>", "file holding the Slack Bot User OAuth Token").option("--slack-bot-token-env <NAME>", "environment variable holding the Slack Bot User OAuth Token").option("--slack-signing-secret-file <path>", "file holding the Slack signing secret").option("--slack-signing-secret-env <NAME>", "environment variable holding the Slack signing secret").option("--worker-image <digest-ref>", "worker image by digest; an agentx built from source needs it with --engine cdk when the tag has no published release.json").option("--slack-image <digest-ref>", "Slack service image by digest; an agentx built from source needs it with --engine cdk when the tag has no published release.json").option("--admin-email <email>", "Cognito: your email, for the AgentX admin user").option("--channel <name>", "the Slack channel of a first project an earlier run of init added").option("--connectors <list>", "connectors to add now: comma-separated linear, jira, asana, or none").option("--linear-key-file <path>", "file holding the Linear API key").option("--linear-key-env <NAME>", "environment variable holding the Linear API key").option("--linear-team <id or key>", "the Linear team the first project may use").option("--jira-site <site>", "the <site> in <site>.atlassian.net").option("--jira-project <key>", "the Jira project key").option("--jira-token-file <path>", "file holding the Jira service account's API token").option("--jira-token-env <NAME>", "environment variable holding the Jira service account's API token").option("--asana-client-id <id>", "the Asana MCP app's Client ID").option("--asana-client-secret-file <path>", "file holding the Asana app's Client secret").option("--asana-client-secret-env <NAME>", "environment variable holding the Asana app's Client secret").option("--asana-bot-email <email>", "the Asana bot user's email; a sign-in by any other account is refused").option("--asana-project <gid>", "the Asana project's GID")
|
|
413548
412401
|
).addOption(new Option2(`${SIGNIN_FLAG_NAMES.methods} <method>`, "how developers sign in: Slack (default), your company's sign-in (oidc), or both").choices(["slack", "oidc", "both"])).option("--stop-after <step>", "run the steps up to and including this one, then stop; agentx init again finishes (for automated tests)").action(async (options, command5) => {
|
|
413549
412402
|
const globals = globalOptions2(command5);
|
|
413550
412403
|
if (options.export !== void 0 && options.stopAfter !== void 0) throw agentXError("CONFIG_INVALID", "--stop-after cannot be used with --export, which runs no init step; drop one of them");
|
|
@@ -413759,11 +412612,8 @@ function initOptions(globals, options, command5) {
|
|
|
413759
412612
|
}
|
|
413760
412613
|
if (options.connectors !== void 0) parseConnectorsFlag(options.connectors);
|
|
413761
412614
|
const finishFlags = definedEntries({
|
|
412615
|
+
// #1649: init adds no project, so it takes no project flags; --channel binds one an earlier run added.
|
|
413762
412616
|
adminEmail: options.adminEmail,
|
|
413763
|
-
repository: options.repository,
|
|
413764
|
-
projectName: options.projectName,
|
|
413765
|
-
setupCommand: options.setupCommand,
|
|
413766
|
-
testCommand: options.testCommand,
|
|
413767
412617
|
channel: options.channel,
|
|
413768
412618
|
// Under --yes, no --connectors means none: an unattended run never starts a connector's questions.
|
|
413769
412619
|
connectors: options.connectors ?? (options.yes ? "none" : void 0),
|