@sjawhar/pi-legion-envoy 6.1.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/envoy.js
CHANGED
|
@@ -30394,7 +30394,7 @@ var dispatchToolSpecs = [
|
|
|
30394
30394
|
{
|
|
30395
30395
|
name: "dispatch_read",
|
|
30396
30396
|
example: { issue: "DSP-1" },
|
|
30397
|
-
description: "Read an issue or project-document summary, targeted ask, or targeted comment reply chain, or the conversation " + "a message belongs to. Do not use it for document contents; use dispatch_doc_read instead. Supply ref, issue, " + "or project plus artifact; or message alone, which reads a human's direct message to this session and every " + "reply to it (they belong to no issue). " + "An anchored comment or ask also says where its quote sits, as `Position:`: the block's path from the top, " + "and in a table the row (0 is the header), the cells before the anchored one, and the column's header; " + "`Position: unavailable (<code>)` when Dispatch could not read the document: `DOC_SERVICE_UNAVAILABLE` " + "(try again shortly), `DOC_SCHEMA` (the document needs repair) or `INTERNAL`. " + "Every read ends with `Referenced by:` (what cites or hangs off this node, each with its dispatch:// address, " + "an excerpt, and when) and `Links:` (what it cites), so tracing provenance is one call. " + OWNER_REFERENCE,
|
|
30397
|
+
description: "Read an issue or project-document summary, targeted ask, or targeted comment reply chain, or the conversation " + "a message belongs to. Do not use it for document contents; use dispatch_doc_read instead. Supply ref, issue, " + "or project plus artifact; or message alone, which reads a human's direct message to this session and every " + "reply to it (they belong to no issue). " + "An anchored comment or ask also says where its quote sits, as `Position:`: the block's path from the top, " + "and in a table the row (0 is the header), the cells before the anchored one, and the column's header; " + "`Position: unavailable (<code>)` when Dispatch could not read the document: `DOC_SERVICE_UNAVAILABLE` " + "(try again shortly), `DOC_SCHEMA` (the document needs repair), `DOCUMENT_UNLOADABLE` (the document " + "needs a rebuild) or `INTERNAL`. " + "Every read ends with `Referenced by:` (what cites or hangs off this node, each with its dispatch:// address, " + "an excerpt, and when) and `Links:` (what it cites), so tracing provenance is one call. " + OWNER_REFERENCE,
|
|
30398
30398
|
arguments: (z2) => ({
|
|
30399
30399
|
issue: z2.string().describe(ISSUE_REFERENCE).optional(),
|
|
30400
30400
|
project: z2.string().describe("Project key owning the document.").optional(),
|
|
@@ -30521,167 +30521,7 @@ function dedupeKeyNamesItsEvent(envelope) {
|
|
|
30521
30521
|
}
|
|
30522
30522
|
}
|
|
30523
30523
|
// ../contracts/src/handoff-schema.ts
|
|
30524
|
-
var HANDOFF_SCHEMA_VERSION = 1;
|
|
30525
30524
|
var HANDOFF_PHASES = ["architect", "plan", "implement", "test", "review"];
|
|
30526
|
-
var PLAN_REVIEW_MAX_ROUNDS = 3;
|
|
30527
|
-
var PLAN_REVIEW_VERDICTS = ["approved", "rejected", "failed"];
|
|
30528
|
-
var isoTimestamp = exports_external.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/);
|
|
30529
|
-
var handoffPhase = exports_external.enum(HANDOFF_PHASES);
|
|
30530
|
-
var nonEmpty = exports_external.string().trim().min(1);
|
|
30531
|
-
var proofSchema = exports_external.object({
|
|
30532
|
-
criterion: nonEmpty,
|
|
30533
|
-
surface: nonEmpty,
|
|
30534
|
-
command: nonEmpty,
|
|
30535
|
-
observed: nonEmpty,
|
|
30536
|
-
headSha: nonEmpty,
|
|
30537
|
-
negativeControl: nonEmpty
|
|
30538
|
-
}).passthrough();
|
|
30539
|
-
var routingHintsSchema = exports_external.object({
|
|
30540
|
-
skipArchitect: exports_external.boolean().optional(),
|
|
30541
|
-
complexity: exports_external.enum(["trivial", "small", "medium", "large"]).optional(),
|
|
30542
|
-
estimatedImplementers: exports_external.number().optional()
|
|
30543
|
-
}).passthrough().optional();
|
|
30544
|
-
var baseHandoffSchema = exports_external.object({
|
|
30545
|
-
schemaVersion: exports_external.literal(HANDOFF_SCHEMA_VERSION),
|
|
30546
|
-
phase: handoffPhase,
|
|
30547
|
-
completed: isoTimestamp,
|
|
30548
|
-
learningsInjected: exports_external.array(exports_external.string()).optional(),
|
|
30549
|
-
learningsHelpful: exports_external.array(exports_external.string()).optional()
|
|
30550
|
-
}).passthrough();
|
|
30551
|
-
var architectSchema = baseHandoffSchema.extend({
|
|
30552
|
-
phase: exports_external.literal("architect"),
|
|
30553
|
-
scope: exports_external.enum(["trivial", "small", "medium", "large"]).optional(),
|
|
30554
|
-
components: exports_external.array(exports_external.string()).optional(),
|
|
30555
|
-
subIssues: exports_external.array(exports_external.string()).optional(),
|
|
30556
|
-
routingHints: routingHintsSchema,
|
|
30557
|
-
concerns: exports_external.array(exports_external.string()).optional()
|
|
30558
|
-
});
|
|
30559
|
-
var requiredSkillsSchema = exports_external.object({
|
|
30560
|
-
implement: exports_external.array(exports_external.string()).optional(),
|
|
30561
|
-
test: exports_external.array(exports_external.string()).optional(),
|
|
30562
|
-
review: exports_external.array(exports_external.string()).optional()
|
|
30563
|
-
}).passthrough().optional();
|
|
30564
|
-
var gapAnalysisSchema = exports_external.object({
|
|
30565
|
-
findings: exports_external.array(exports_external.object({ finding: exports_external.string(), answer: exports_external.string() }).passthrough()).optional(),
|
|
30566
|
-
error: exports_external.string().optional()
|
|
30567
|
-
}).passthrough().optional();
|
|
30568
|
-
var planReviewSchema = exports_external.object({
|
|
30569
|
-
verdict: exports_external.enum(PLAN_REVIEW_VERDICTS),
|
|
30570
|
-
rounds: exports_external.number(),
|
|
30571
|
-
remainingIssues: exports_external.array(exports_external.object({ issue: exports_external.string(), evidence: exports_external.string() }).passthrough()).optional(),
|
|
30572
|
-
error: exports_external.string().optional()
|
|
30573
|
-
}).passthrough().optional();
|
|
30574
|
-
var planSchema = baseHandoffSchema.extend({
|
|
30575
|
-
phase: exports_external.literal("plan"),
|
|
30576
|
-
taskCount: exports_external.number().optional(),
|
|
30577
|
-
independentTasks: exports_external.number().optional(),
|
|
30578
|
-
routingHints: routingHintsSchema,
|
|
30579
|
-
concerns: exports_external.array(exports_external.string()).optional(),
|
|
30580
|
-
workflowRecommendation: exports_external.string().optional(),
|
|
30581
|
-
requiredSkills: requiredSkillsSchema,
|
|
30582
|
-
gapAnalysis: gapAnalysisSchema,
|
|
30583
|
-
planReview: planReviewSchema
|
|
30584
|
-
});
|
|
30585
|
-
var implementSchema = baseHandoffSchema.extend({
|
|
30586
|
-
phase: exports_external.literal("implement"),
|
|
30587
|
-
filesChanged: exports_external.array(exports_external.string()).optional(),
|
|
30588
|
-
proof: exports_external.array(proofSchema).min(1),
|
|
30589
|
-
trickyParts: exports_external.array(exports_external.string()).optional(),
|
|
30590
|
-
deviations: exports_external.array(exports_external.string()).optional(),
|
|
30591
|
-
openQuestions: exports_external.array(exports_external.string()).optional(),
|
|
30592
|
-
subPlanningNeeded: exports_external.boolean().optional(),
|
|
30593
|
-
discoveredComplexity: exports_external.array(exports_external.string()).optional(),
|
|
30594
|
-
suggestedSubWorkers: exports_external.number().optional()
|
|
30595
|
-
});
|
|
30596
|
-
var testSchema = baseHandoffSchema.extend({
|
|
30597
|
-
phase: exports_external.literal("test"),
|
|
30598
|
-
passed: exports_external.number().optional(),
|
|
30599
|
-
failed: exports_external.number().optional(),
|
|
30600
|
-
failures: exports_external.array(exports_external.object({ criterion: exports_external.string(), evidence: exports_external.string() }).passthrough()).optional(),
|
|
30601
|
-
implementerProof: exports_external.object({ verdict: exports_external.enum(["verified", "rejected"]), how: nonEmpty }).passthrough(),
|
|
30602
|
-
proof: exports_external.array(proofSchema).min(1).optional(),
|
|
30603
|
-
documentationFeedback: exports_external.string().optional(),
|
|
30604
|
-
observations: exports_external.array(exports_external.string()).optional()
|
|
30605
|
-
}).refine((handoff) => (handoff.failures?.length ?? 0) > 0 || (handoff.failed ?? 0) > 0 || (handoff.proof?.length ?? 0) > 0, {
|
|
30606
|
-
path: ["proof"],
|
|
30607
|
-
message: "a passing test handoff needs the tester's own production-like proof"
|
|
30608
|
-
}).refine((handoff) => (handoff.failed ?? 0) === 0 || (handoff.failures?.length ?? 0) > 0, {
|
|
30609
|
-
path: ["failures"],
|
|
30610
|
-
message: "a test handoff that reports failed > 0 records at least one failure"
|
|
30611
|
-
}).refine((handoff) => handoff.implementerProof.verdict !== "rejected" || (handoff.failures?.length ?? 0) > 0, {
|
|
30612
|
-
path: ["failures"],
|
|
30613
|
-
message: "a rejected implementer proof is a recorded failure"
|
|
30614
|
-
});
|
|
30615
|
-
var reviewSchema = baseHandoffSchema.extend({
|
|
30616
|
-
phase: exports_external.literal("review"),
|
|
30617
|
-
critical: exports_external.number().optional(),
|
|
30618
|
-
important: exports_external.number().optional(),
|
|
30619
|
-
minor: exports_external.number().optional(),
|
|
30620
|
-
verdict: exports_external.enum(["approved", "changes_requested"]).optional(),
|
|
30621
|
-
keyFindings: exports_external.array(exports_external.object({ severity: exports_external.string(), file: exports_external.string(), description: exports_external.string() }).passthrough()).optional()
|
|
30622
|
-
});
|
|
30623
|
-
var nonEmptySkillList = exports_external.array(nonEmpty).min(1);
|
|
30624
|
-
var recorded = (shape, whatToRecord) => exports_external.object(shape, {
|
|
30625
|
-
error: (issue2) => issue2.input === undefined ? `missing \u2014 record ${whatToRecord}` : undefined
|
|
30626
|
-
}).passthrough();
|
|
30627
|
-
var gapAnalysisWriteSchema = recorded({
|
|
30628
|
-
findings: exports_external.array(exports_external.object({ finding: nonEmpty, answer: nonEmpty }).passthrough()).optional(),
|
|
30629
|
-
error: nonEmpty.optional()
|
|
30630
|
-
}, "the gap analyst's `findings`, each with how the plan answers it (`[]` when it found none), or its failed call's `error`").refine((analysis) => analysis.findings === undefined !== (analysis.error === undefined), {
|
|
30631
|
-
message: "record exactly one of `findings` or the failed call's `error`"
|
|
30632
|
-
});
|
|
30633
|
-
var planReviewWriteSchema = recorded({
|
|
30634
|
-
verdict: exports_external.enum(PLAN_REVIEW_VERDICTS),
|
|
30635
|
-
rounds: exports_external.number().int().min(1).max(PLAN_REVIEW_MAX_ROUNDS),
|
|
30636
|
-
remainingIssues: exports_external.array(exports_external.object({ issue: nonEmpty, evidence: nonEmpty }).passthrough()).optional(),
|
|
30637
|
-
error: nonEmpty.optional()
|
|
30638
|
-
}, "the plan review's `verdict` and `rounds`, with `remainingIssues` when it was rejected or `error` when a review's call failed").superRefine((review, ctx) => {
|
|
30639
|
-
const remaining = review.remainingIssues?.length ?? 0;
|
|
30640
|
-
if (review.verdict === "rejected" && remaining === 0) {
|
|
30641
|
-
ctx.addIssue({
|
|
30642
|
-
code: "custom",
|
|
30643
|
-
path: ["remainingIssues"],
|
|
30644
|
-
message: "a rejected review records the blocking issues its last round named"
|
|
30645
|
-
});
|
|
30646
|
-
}
|
|
30647
|
-
if (review.verdict === "rejected" && review.rounds < PLAN_REVIEW_MAX_ROUNDS) {
|
|
30648
|
-
ctx.addIssue({
|
|
30649
|
-
code: "custom",
|
|
30650
|
-
path: ["rounds"],
|
|
30651
|
-
message: `a review still rejecting after ${review.rounds} of ${PLAN_REVIEW_MAX_ROUNDS} rounds is revised and reviewed again, not recorded`
|
|
30652
|
-
});
|
|
30653
|
-
}
|
|
30654
|
-
if (review.verdict === "approved" && remaining > 0) {
|
|
30655
|
-
ctx.addIssue({
|
|
30656
|
-
code: "custom",
|
|
30657
|
-
path: ["remainingIssues"],
|
|
30658
|
-
message: "an approved review leaves no blocking issue standing"
|
|
30659
|
-
});
|
|
30660
|
-
}
|
|
30661
|
-
if (review.verdict === "failed" !== (review.error !== undefined)) {
|
|
30662
|
-
ctx.addIssue({
|
|
30663
|
-
code: "custom",
|
|
30664
|
-
path: ["error"],
|
|
30665
|
-
message: "a failed review records its call's error, and only a failed review does"
|
|
30666
|
-
});
|
|
30667
|
-
}
|
|
30668
|
-
});
|
|
30669
|
-
var planWriteSchema = planSchema.extend({
|
|
30670
|
-
requiredSkills: exports_external.object({
|
|
30671
|
-
implement: nonEmptySkillList,
|
|
30672
|
-
test: nonEmptySkillList,
|
|
30673
|
-
review: nonEmptySkillList
|
|
30674
|
-
}).passthrough(),
|
|
30675
|
-
gapAnalysis: gapAnalysisWriteSchema,
|
|
30676
|
-
planReview: planReviewWriteSchema
|
|
30677
|
-
});
|
|
30678
|
-
var phaseHandoffSchema = exports_external.discriminatedUnion("phase", [
|
|
30679
|
-
architectSchema,
|
|
30680
|
-
planSchema,
|
|
30681
|
-
implementSchema,
|
|
30682
|
-
testSchema,
|
|
30683
|
-
reviewSchema
|
|
30684
|
-
]);
|
|
30685
30525
|
// ../contracts/src/subject.ts
|
|
30686
30526
|
var AGENT_TOPIC_PREFIX = "notifications.agent.";
|
|
30687
30527
|
var ROLE_TOPIC_PREFIX = "notifications.role.";
|
|
@@ -30733,273 +30573,6 @@ function controllerToken(project) {
|
|
|
30733
30573
|
assertLegionProjectToken(project);
|
|
30734
30574
|
return `legion-${project}-controller`;
|
|
30735
30575
|
}
|
|
30736
|
-
|
|
30737
|
-
// ../contracts/src/legion-daemon-api.ts
|
|
30738
|
-
var nonEmptyString = exports_external.string().min(1);
|
|
30739
|
-
var appLogin = exports_external.string().regex(/^[^[\]]+\[bot\]$/);
|
|
30740
|
-
var legionRole = exports_external.enum(LEGION_ROLES);
|
|
30741
|
-
var requiredUnknown = exports_external.unknown().refine((value) => value !== undefined, {
|
|
30742
|
-
message: "Required"
|
|
30743
|
-
});
|
|
30744
|
-
var architectCapability = exports_external.strictObject({
|
|
30745
|
-
tree: nonEmptyString,
|
|
30746
|
-
sessionId: nonEmptyString,
|
|
30747
|
-
secret: nonEmptyString
|
|
30748
|
-
});
|
|
30749
|
-
var controllerIssue = exports_external.strictObject({
|
|
30750
|
-
secret: nonEmptyString,
|
|
30751
|
-
issue: nonEmptyString
|
|
30752
|
-
});
|
|
30753
|
-
var TREE_STATUSES = ["queued", "active", "lingering", "dead", "launch-failed", "closed"];
|
|
30754
|
-
var stateTmuxLocator = exports_external.strictObject({
|
|
30755
|
-
runtime: exports_external.literal("tmux"),
|
|
30756
|
-
tmuxSession: nonEmptyString,
|
|
30757
|
-
tmuxWindowId: nonEmptyString,
|
|
30758
|
-
tmuxPaneId: nonEmptyString.optional()
|
|
30759
|
-
});
|
|
30760
|
-
var stateK8sLocator = exports_external.strictObject({
|
|
30761
|
-
runtime: exports_external.literal("kubernetes"),
|
|
30762
|
-
namespace: nonEmptyString,
|
|
30763
|
-
podName: nonEmptyString,
|
|
30764
|
-
podUid: nonEmptyString,
|
|
30765
|
-
pvcName: nonEmptyString
|
|
30766
|
-
});
|
|
30767
|
-
var stateLocator = exports_external.discriminatedUnion("runtime", [stateTmuxLocator, stateK8sLocator]);
|
|
30768
|
-
var stateTreeLocator = exports_external.discriminatedUnion("runtime", [
|
|
30769
|
-
stateTmuxLocator.extend({ ompSessionFile: nonEmptyString.optional() }),
|
|
30770
|
-
stateK8sLocator.extend({ ompSessionFile: nonEmptyString.optional() })
|
|
30771
|
-
]);
|
|
30772
|
-
var stateExternalControllerLocator = exports_external.strictObject({
|
|
30773
|
-
runtime: exports_external.literal("kubernetes"),
|
|
30774
|
-
external: exports_external.literal(true),
|
|
30775
|
-
sessionId: nonEmptyString,
|
|
30776
|
-
registeredAt: exports_external.number().int().nonnegative()
|
|
30777
|
-
});
|
|
30778
|
-
var stateIssue = exports_external.strictObject({
|
|
30779
|
-
key: nonEmptyString,
|
|
30780
|
-
title: exports_external.string(),
|
|
30781
|
-
status: exports_external.enum(ISSUE_STATUSES).optional(),
|
|
30782
|
-
children: exports_external.array(nonEmptyString),
|
|
30783
|
-
parent: nonEmptyString.optional(),
|
|
30784
|
-
lastAppliedSeq: exports_external.number().int().nonnegative().optional()
|
|
30785
|
-
});
|
|
30786
|
-
var stateWorkspaceLost = exports_external.strictObject({
|
|
30787
|
-
at: nonEmptyString,
|
|
30788
|
-
generation: exports_external.number().int().nonnegative(),
|
|
30789
|
-
fromRef: nonEmptyString,
|
|
30790
|
-
previousSessionId: nonEmptyString.optional()
|
|
30791
|
-
});
|
|
30792
|
-
var stateTree = exports_external.strictObject({
|
|
30793
|
-
status: exports_external.enum(TREE_STATUSES),
|
|
30794
|
-
generation: exports_external.number().int().nonnegative(),
|
|
30795
|
-
launchFailures: exports_external.number().int().nonnegative(),
|
|
30796
|
-
readyConfirmedAt: exports_external.number().optional(),
|
|
30797
|
-
locator: stateTreeLocator.optional(),
|
|
30798
|
-
workspaceLost: stateWorkspaceLost.optional()
|
|
30799
|
-
});
|
|
30800
|
-
var stateGate = exports_external.strictObject({
|
|
30801
|
-
artifactId: nonEmptyString,
|
|
30802
|
-
latestVersion: exports_external.number().int().positive(),
|
|
30803
|
-
approvedVersion: exports_external.number().int().positive().optional()
|
|
30804
|
-
});
|
|
30805
|
-
var stateRole = exports_external.strictObject({
|
|
30806
|
-
role: nonEmptyString,
|
|
30807
|
-
issue: nonEmptyString.optional(),
|
|
30808
|
-
generation: exports_external.number().int().nonnegative().optional(),
|
|
30809
|
-
sessionId: nonEmptyString.optional(),
|
|
30810
|
-
readyConfirmedAt: exports_external.number().optional(),
|
|
30811
|
-
launchFailures: exports_external.number().int().nonnegative().optional(),
|
|
30812
|
-
locator: stateLocator.optional(),
|
|
30813
|
-
workspaceLost: stateWorkspaceLost.optional()
|
|
30814
|
-
});
|
|
30815
|
-
var stateQueuedWorkerIdentity = {
|
|
30816
|
-
roleToken: nonEmptyString,
|
|
30817
|
-
issue: nonEmptyString,
|
|
30818
|
-
role: nonEmptyString
|
|
30819
|
-
};
|
|
30820
|
-
var stateQueuedWorker = exports_external.union([
|
|
30821
|
-
exports_external.strictObject(stateQueuedWorkerIdentity),
|
|
30822
|
-
exports_external.strictObject({
|
|
30823
|
-
...stateQueuedWorkerIdentity,
|
|
30824
|
-
kind: exports_external.enum(["assignment", "catchup"]),
|
|
30825
|
-
queuedAt: nonEmptyString
|
|
30826
|
-
})
|
|
30827
|
-
]);
|
|
30828
|
-
var LegionDaemonApi = {
|
|
30829
|
-
State: {
|
|
30830
|
-
response: exports_external.strictObject({
|
|
30831
|
-
project: nonEmptyString,
|
|
30832
|
-
version: exports_external.number().int(),
|
|
30833
|
-
issues: exports_external.record(exports_external.string(), stateIssue),
|
|
30834
|
-
trees: exports_external.record(exports_external.string(), stateTree),
|
|
30835
|
-
admission: exports_external.strictObject({
|
|
30836
|
-
cap: exports_external.number().int().nonnegative(),
|
|
30837
|
-
active: exports_external.array(nonEmptyString),
|
|
30838
|
-
queue: exports_external.array(nonEmptyString)
|
|
30839
|
-
}),
|
|
30840
|
-
gates: exports_external.record(exports_external.string(), stateGate),
|
|
30841
|
-
controllerLocator: exports_external.union([stateTreeLocator, stateExternalControllerLocator]).optional(),
|
|
30842
|
-
roles: exports_external.record(exports_external.string(), stateRole),
|
|
30843
|
-
controllerPendingNotices: exports_external.number().int().nonnegative(),
|
|
30844
|
-
pendingStatusWrites: exports_external.array(nonEmptyString),
|
|
30845
|
-
workerAdmission: exports_external.strictObject({ queue: exports_external.array(stateQueuedWorker) })
|
|
30846
|
-
})
|
|
30847
|
-
},
|
|
30848
|
-
ControllerReady: {
|
|
30849
|
-
request: exports_external.strictObject({
|
|
30850
|
-
secret: nonEmptyString,
|
|
30851
|
-
sessionId: nonEmptyString,
|
|
30852
|
-
ompSessionFile: nonEmptyString.optional(),
|
|
30853
|
-
pluginVersion: nonEmptyString
|
|
30854
|
-
}),
|
|
30855
|
-
response: exports_external.object({})
|
|
30856
|
-
},
|
|
30857
|
-
ControllerSecret: {
|
|
30858
|
-
request: exports_external.strictObject({}),
|
|
30859
|
-
response: exports_external.object({ secret: nonEmptyString })
|
|
30860
|
-
},
|
|
30861
|
-
ProcessStarted: {
|
|
30862
|
-
request: exports_external.strictObject({
|
|
30863
|
-
tree: nonEmptyString,
|
|
30864
|
-
generation: exports_external.number().int(),
|
|
30865
|
-
rootSessionId: nonEmptyString,
|
|
30866
|
-
agentId: nonEmptyString,
|
|
30867
|
-
bootToken: nonEmptyString,
|
|
30868
|
-
ompSessionFile: nonEmptyString,
|
|
30869
|
-
pluginVersion: nonEmptyString
|
|
30870
|
-
}),
|
|
30871
|
-
response: exports_external.object({
|
|
30872
|
-
roleTokens: exports_external.record(exports_external.string(), exports_external.string()),
|
|
30873
|
-
controlSubject: nonEmptyString,
|
|
30874
|
-
gates: exports_external.object({
|
|
30875
|
-
design: exports_external.enum(["root-issues", "off"])
|
|
30876
|
-
}).optional(),
|
|
30877
|
-
secret: nonEmptyString
|
|
30878
|
-
})
|
|
30879
|
-
},
|
|
30880
|
-
ProcessReady: {
|
|
30881
|
-
request: architectCapability.extend({ generation: exports_external.number().int() }),
|
|
30882
|
-
response: exports_external.object({})
|
|
30883
|
-
},
|
|
30884
|
-
ProcessExit: {
|
|
30885
|
-
request: architectCapability.extend({ generation: exports_external.number().int() }),
|
|
30886
|
-
response: exports_external.object({})
|
|
30887
|
-
},
|
|
30888
|
-
WaveRelease: {
|
|
30889
|
-
request: architectCapability.extend({ issues: exports_external.array(nonEmptyString).optional() }),
|
|
30890
|
-
response: exports_external.object({ released: exports_external.array(nonEmptyString) })
|
|
30891
|
-
},
|
|
30892
|
-
Escalate: {
|
|
30893
|
-
request: architectCapability.extend({
|
|
30894
|
-
kind: exports_external.enum(["re-file", "capacity", "cross-tree"]),
|
|
30895
|
-
context: requiredUnknown
|
|
30896
|
-
}),
|
|
30897
|
-
response: exports_external.object({})
|
|
30898
|
-
},
|
|
30899
|
-
ProvisioningCredential: {
|
|
30900
|
-
request: architectCapability.extend({ issue: nonEmptyString }),
|
|
30901
|
-
response: exports_external.object({ token: nonEmptyString })
|
|
30902
|
-
},
|
|
30903
|
-
WorkerStarted: {
|
|
30904
|
-
request: exports_external.strictObject({
|
|
30905
|
-
tree: nonEmptyString,
|
|
30906
|
-
issue: nonEmptyString,
|
|
30907
|
-
role: legionRole,
|
|
30908
|
-
bootToken: nonEmptyString,
|
|
30909
|
-
sessionId: nonEmptyString,
|
|
30910
|
-
agentId: nonEmptyString,
|
|
30911
|
-
ompSessionFile: nonEmptyString,
|
|
30912
|
-
pluginVersion: nonEmptyString
|
|
30913
|
-
}),
|
|
30914
|
-
response: exports_external.object({
|
|
30915
|
-
roleToken: nonEmptyString,
|
|
30916
|
-
secret: nonEmptyString,
|
|
30917
|
-
gitName: nonEmptyString,
|
|
30918
|
-
gitEmail: nonEmptyString
|
|
30919
|
-
})
|
|
30920
|
-
},
|
|
30921
|
-
WorkerReady: {
|
|
30922
|
-
request: exports_external.strictObject({
|
|
30923
|
-
tree: nonEmptyString,
|
|
30924
|
-
issue: nonEmptyString,
|
|
30925
|
-
role: legionRole,
|
|
30926
|
-
sessionId: nonEmptyString,
|
|
30927
|
-
generation: exports_external.number().int().nonnegative(),
|
|
30928
|
-
secret: nonEmptyString
|
|
30929
|
-
}),
|
|
30930
|
-
response: exports_external.object({})
|
|
30931
|
-
},
|
|
30932
|
-
PhaseComplete: {
|
|
30933
|
-
request: exports_external.strictObject({
|
|
30934
|
-
grantId: nonEmptyString,
|
|
30935
|
-
summary: nonEmptyString
|
|
30936
|
-
}),
|
|
30937
|
-
response: exports_external.object({})
|
|
30938
|
-
},
|
|
30939
|
-
SpawnWorker: {
|
|
30940
|
-
request: architectCapability.extend({
|
|
30941
|
-
issue: nonEmptyString,
|
|
30942
|
-
role: legionRole,
|
|
30943
|
-
task: nonEmptyString,
|
|
30944
|
-
requestId: exports_external.uuid()
|
|
30945
|
-
}),
|
|
30946
|
-
response: exports_external.object({
|
|
30947
|
-
status: exports_external.enum(["spawned", "resumed", "queued"]),
|
|
30948
|
-
roleToken: nonEmptyString
|
|
30949
|
-
})
|
|
30950
|
-
},
|
|
30951
|
-
WorkerSession: {
|
|
30952
|
-
request: exports_external.strictObject({
|
|
30953
|
-
sessionId: nonEmptyString,
|
|
30954
|
-
recoveryToken: nonEmptyString
|
|
30955
|
-
}),
|
|
30956
|
-
response: exports_external.object({
|
|
30957
|
-
tree: nonEmptyString,
|
|
30958
|
-
issue: nonEmptyString,
|
|
30959
|
-
role: legionRole,
|
|
30960
|
-
secret: nonEmptyString
|
|
30961
|
-
})
|
|
30962
|
-
},
|
|
30963
|
-
IssueStatus: {
|
|
30964
|
-
request: controllerIssue.extend({
|
|
30965
|
-
status: exports_external.enum(ISSUE_STATUSES),
|
|
30966
|
-
tree: nonEmptyString.optional(),
|
|
30967
|
-
sessionId: nonEmptyString.optional()
|
|
30968
|
-
}),
|
|
30969
|
-
response: exports_external.object({})
|
|
30970
|
-
},
|
|
30971
|
-
GatesRegister: {
|
|
30972
|
-
request: architectCapability.extend({
|
|
30973
|
-
issue: nonEmptyString,
|
|
30974
|
-
artifactId: exports_external.uuid(),
|
|
30975
|
-
version: exports_external.number().int().positive()
|
|
30976
|
-
}),
|
|
30977
|
-
response: exports_external.object({})
|
|
30978
|
-
},
|
|
30979
|
-
Grant: {
|
|
30980
|
-
request: exports_external.union([
|
|
30981
|
-
exports_external.strictObject({
|
|
30982
|
-
sessionId: nonEmptyString,
|
|
30983
|
-
secret: nonEmptyString,
|
|
30984
|
-
tree: nonEmptyString,
|
|
30985
|
-
issue: nonEmptyString
|
|
30986
|
-
}),
|
|
30987
|
-
exports_external.strictObject({ sessionId: nonEmptyString, secret: nonEmptyString })
|
|
30988
|
-
]),
|
|
30989
|
-
response: exports_external.object({ grantId: nonEmptyString, expiresAt: nonEmptyString })
|
|
30990
|
-
},
|
|
30991
|
-
GitHubToken: {
|
|
30992
|
-
request: exports_external.strictObject({ grantId: nonEmptyString }),
|
|
30993
|
-
response: exports_external.object({
|
|
30994
|
-
token: nonEmptyString,
|
|
30995
|
-
appLogin: exports_external.string().endsWith("[bot]"),
|
|
30996
|
-
legionAppLogins: exports_external.object({ implement: appLogin, review: appLogin }).optional()
|
|
30997
|
-
})
|
|
30998
|
-
},
|
|
30999
|
-
GitCredential: {
|
|
31000
|
-
request: exports_external.strictObject({ grantId: nonEmptyString })
|
|
31001
|
-
}
|
|
31002
|
-
};
|
|
31003
30576
|
// ../contracts/src/repo.ts
|
|
31004
30577
|
function canonicalRepo(owner, repo) {
|
|
31005
30578
|
return `${owner.trim().toLowerCase()}/${repo.trim().toLowerCase().replace(/\.git$/, "")}`;
|
|
@@ -35812,9 +35385,9 @@ function resolveEnvoySession(sessionFile) {
|
|
|
35812
35385
|
const parent = `${directory}.jsonl`;
|
|
35813
35386
|
if (parent === candidate)
|
|
35814
35387
|
break;
|
|
35815
|
-
const
|
|
35816
|
-
if (
|
|
35817
|
-
return
|
|
35388
|
+
const recorded = sessions.get(parent);
|
|
35389
|
+
if (recorded !== undefined)
|
|
35390
|
+
return recorded;
|
|
35818
35391
|
if (path2.dirname(directory) === directory)
|
|
35819
35392
|
break;
|
|
35820
35393
|
candidate = parent;
|