@brainervirus/workit-pi 1.1.0 → 1.2.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/workit.js +15 -4
- package/package.json +1 -1
package/dist/workit.js
CHANGED
|
@@ -12476,6 +12476,12 @@ var externalActionDescriptor = (operation, payload) => canonicalJson({
|
|
|
12476
12476
|
payload,
|
|
12477
12477
|
...payload && typeof payload === "object" && !Array.isArray(payload) && "resolved" in payload && payload.resolved && typeof payload.resolved === "object" && Array.isArray(payload.resolved.steps) ? { steps: payload.resolved.steps } : {}
|
|
12478
12478
|
});
|
|
12479
|
+
var planReservationLength = (operation, descriptorPayload) => {
|
|
12480
|
+
if (operation !== "git.commit")
|
|
12481
|
+
return null;
|
|
12482
|
+
const payload = descriptorPayload ?? {};
|
|
12483
|
+
return Array.isArray(payload.plan_steps) ? payload.plan_steps.length : null;
|
|
12484
|
+
};
|
|
12479
12485
|
var externalActionHelp = "Fixed actions: git.branch_setup {action?,sdd_dir?,target_branch(required unless reapply_stash; the working branch to create or switch to),stash?}; git.commit {message}; git.push {branch?}; hosting.pull_request {title,body?,draft?,target_branch?,babysit?}; hosting.merge {target_branch?,source_branch?}; youtrack.update {issueId,markdown,minutes?}; youtrack.time {issueId,minutes,text?,dateMs?}; youtrack.meeting {issueId,minutes,text}; changelog.apply {entries?,path?,normalize_only?}; context.read {kind,range?,issueId?,issueUrl?,issueRef?,mode?,specPath?,planPath?}. context.read is read-only and needs no approval; all other operations require native approval (CLI uses a TTY; caller-unattested MCP cannot mutate).";
|
|
12480
12486
|
var externalActionRef = (host, actor, descriptor) => ({
|
|
12481
12487
|
kind: "host",
|
|
@@ -15636,7 +15642,6 @@ function mergePr(cwd, opts) {
|
|
|
15636
15642
|
cmd.push(squash ? "--squash" : "--merge");
|
|
15637
15643
|
if (removeBranch)
|
|
15638
15644
|
cmd.push("--delete-branch");
|
|
15639
|
-
cmd.push("--yes");
|
|
15640
15645
|
cmdEnv = { ...process.env, PATH: process.env.PATH ?? "", GH_TOKEN: token };
|
|
15641
15646
|
}
|
|
15642
15647
|
const result = spawnSync4(cmd[0], cmd.slice(1), { cwd: root, encoding: "utf8", env: cmdEnv });
|
|
@@ -18681,6 +18686,12 @@ var registerWorkitTools = (pi, options = {}) => {
|
|
|
18681
18686
|
return output(result);
|
|
18682
18687
|
}
|
|
18683
18688
|
if (standingAutoApplies(store, "pi", actor, descriptor)) {
|
|
18689
|
+
const planCount = planReservationLength(resolved.data.request.operation, resolved.data.descriptorPayload);
|
|
18690
|
+
if (planCount !== null) {
|
|
18691
|
+
const bound = standingAutoBinding(core, store, "pi", actor, descriptor);
|
|
18692
|
+
if (bound)
|
|
18693
|
+
return output(success(null, null, { plan_commits: planCount }));
|
|
18694
|
+
}
|
|
18684
18695
|
const result = await nativeExternalActionRunner(ctx.cwd, actor, core)(descriptor, (step) => executeResolvedExternalAction(resolved.data, ctx.cwd, step, { host: "pi", actor }));
|
|
18685
18696
|
return output(result);
|
|
18686
18697
|
}
|
|
@@ -18723,9 +18734,9 @@ var registerWorkitTools = (pi, options = {}) => {
|
|
|
18723
18734
|
if (!decision.ok)
|
|
18724
18735
|
return output(decision);
|
|
18725
18736
|
}
|
|
18726
|
-
const
|
|
18727
|
-
if (
|
|
18728
|
-
return output(success(null, null, { plan_commits:
|
|
18737
|
+
const planCount = planReservationLength(resolved.data.request.operation, resolved.data.descriptorPayload);
|
|
18738
|
+
if (planCount !== null)
|
|
18739
|
+
return output(success(null, null, { plan_commits: planCount }));
|
|
18729
18740
|
const result = await nativeExternalActionRunner(ctx.cwd, actor, core)(descriptor, (step) => executeResolvedExternalAction(resolved.data, ctx.cwd, step, { host: "pi", actor }));
|
|
18730
18741
|
return output(result);
|
|
18731
18742
|
}
|