@workit-dev/opencode 2.27.12 → 2.28.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/plugin.js +12 -6
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -8712,7 +8712,8 @@ var workspaceBranchPolicySchema = strictObject({
|
|
|
8712
8712
|
})),
|
|
8713
8713
|
allowed: optional(array(nonBlank)),
|
|
8714
8714
|
protected: optional(array(nonBlank)),
|
|
8715
|
-
integration: optional(_enum(["pr", "merge"]))
|
|
8715
|
+
integration: optional(_enum(["pr", "merge"])),
|
|
8716
|
+
releaseTagPrefix: optional(string2())
|
|
8716
8717
|
});
|
|
8717
8718
|
var workspaceCommitPolicySchema = strictObject({
|
|
8718
8719
|
preset: commitPreset,
|
|
@@ -8829,7 +8830,9 @@ var workspaceConfigSchema = looseObject({
|
|
|
8829
8830
|
defaultProfile: optional(nonBlank),
|
|
8830
8831
|
profiles: optional(record(nonBlank, workspaceProfileSchema)),
|
|
8831
8832
|
releaseTracks: optional(record(nonBlank, releaseTrackSchema)),
|
|
8832
|
-
releasePackages: optional(unknown())
|
|
8833
|
+
releasePackages: optional(unknown()),
|
|
8834
|
+
releaseTagPrefix: optional(string2()),
|
|
8835
|
+
trunkCi: optional(unknown())
|
|
8833
8836
|
}).check(superRefine((workspace, context) => {
|
|
8834
8837
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
8835
8838
|
context.addIssue({
|
|
@@ -25735,7 +25738,8 @@ var pushTargetIsStable = (cwd, remote) => {
|
|
|
25735
25738
|
if (result.status !== 0 && result.status !== 1)
|
|
25736
25739
|
return false;
|
|
25737
25740
|
const prefixes = (result.stdout ?? "").split(/\r?\n/u).map((line) => line.trim().slice(line.trim().indexOf(" ") + 1)).filter(Boolean);
|
|
25738
|
-
|
|
25741
|
+
const raw = remote.trim();
|
|
25742
|
+
return !prefixes.some((prefix) => target.startsWith(prefix) || raw.startsWith(prefix));
|
|
25739
25743
|
};
|
|
25740
25744
|
|
|
25741
25745
|
// packages/workit-core/src/core/tracker-issues.ts
|
|
@@ -32549,7 +32553,8 @@ function pushPreflight(cwd, options = {}) {
|
|
|
32549
32553
|
const branch = options.branch ?? currentBranch(cwd);
|
|
32550
32554
|
if (!branch)
|
|
32551
32555
|
return failure3("invalid_input", "HEAD is detached; push a branch");
|
|
32552
|
-
|
|
32556
|
+
const protectedBranch = isProtectedTarget(cwd, branch);
|
|
32557
|
+
if (protectedBranch && !options.initial)
|
|
32553
32558
|
return failure3("blocked", `protected_branch: ${branch} is protected by the workspace branch policy; workit git push never pushes to it`, releaseBranch(cwd, branch) ? `workit git push --release ${branch} # finishing a release or hotfix; needs the release grant` : "workit git branch <feature/name> # push a feature branch and open a PR");
|
|
32554
32559
|
const sha = resolveRef(cwd, `refs/heads/${branch}`);
|
|
32555
32560
|
if (!sha)
|
|
@@ -32562,7 +32567,7 @@ function pushPreflight(cwd, options = {}) {
|
|
|
32562
32567
|
return failure3("blocked", `remote "${remote}" has no single push URL`, `git remote get-url --push --all ${remote} # keep exactly one push URL`);
|
|
32563
32568
|
const parsed = parseRemoteUrl(raw);
|
|
32564
32569
|
const local = parsed?.protocol === "file";
|
|
32565
|
-
if (!local && !pushTargetIsStable(cwd, raw))
|
|
32570
|
+
if ((!local || protectedBranch) && !pushTargetIsStable(cwd, raw))
|
|
32566
32571
|
return failure3("blocked", `push_target_rewritten: the push URL of "${remote}" is rewritten by a url.*.insteadOf rule, so the destination is not the one checked`, "git config --get-regexp '^url\\.' # remove the rewrite for this remote");
|
|
32567
32572
|
return success2({
|
|
32568
32573
|
branch,
|
|
@@ -32570,7 +32575,8 @@ function pushPreflight(cwd, options = {}) {
|
|
|
32570
32575
|
remote,
|
|
32571
32576
|
url: redactRemote(raw),
|
|
32572
32577
|
rawUrl: raw,
|
|
32573
|
-
local
|
|
32578
|
+
local,
|
|
32579
|
+
...protectedBranch ? { initial: true } : {}
|
|
32574
32580
|
});
|
|
32575
32581
|
}
|
|
32576
32582
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@opencode/plugin": "2.3.2",
|
|
44
|
-
"@workit-dev/core": "^2.
|
|
44
|
+
"@workit-dev/core": "^2.28.0"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|