@brainervirus/workit-opencode 8.12.0 → 8.12.2
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 +55 -13
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -9597,6 +9597,48 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
9597
9597
|
}
|
|
9598
9598
|
}
|
|
9599
9599
|
}
|
|
9600
|
+
// packages/workit-core/src/core/logger.ts
|
|
9601
|
+
import os from "node:os";
|
|
9602
|
+
var SENSITIVE_WORDS = new Set([
|
|
9603
|
+
"token",
|
|
9604
|
+
"secret",
|
|
9605
|
+
"password",
|
|
9606
|
+
"passwd",
|
|
9607
|
+
"authorization",
|
|
9608
|
+
"credential",
|
|
9609
|
+
"credentials",
|
|
9610
|
+
"cookie",
|
|
9611
|
+
"api",
|
|
9612
|
+
"apikey",
|
|
9613
|
+
"apitoken",
|
|
9614
|
+
"accesstoken",
|
|
9615
|
+
"clientsecret",
|
|
9616
|
+
"refreshtoken",
|
|
9617
|
+
"key",
|
|
9618
|
+
"bearer",
|
|
9619
|
+
"prompt",
|
|
9620
|
+
"message",
|
|
9621
|
+
"messages",
|
|
9622
|
+
"content",
|
|
9623
|
+
"body",
|
|
9624
|
+
"args",
|
|
9625
|
+
"argument",
|
|
9626
|
+
"result",
|
|
9627
|
+
"results",
|
|
9628
|
+
"output",
|
|
9629
|
+
"issue",
|
|
9630
|
+
"description",
|
|
9631
|
+
"summary",
|
|
9632
|
+
"payload",
|
|
9633
|
+
"script",
|
|
9634
|
+
"command",
|
|
9635
|
+
"text",
|
|
9636
|
+
"query"
|
|
9637
|
+
]);
|
|
9638
|
+
var STACK_WORDS = new Set(["stack", "stacktrace", "trace"]);
|
|
9639
|
+
var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
9640
|
+
var homePattern = new RegExp(`${escapeRegExp(os.homedir())}(?=[/\\\\]|$)|\\$HOME(?=[/\\\\]|$)`, "g");
|
|
9641
|
+
|
|
9600
9642
|
// packages/workit-core/src/store/paths.ts
|
|
9601
9643
|
import { spawnSync } from "node:child_process";
|
|
9602
9644
|
import { createHash as createHash2 } from "node:crypto";
|
|
@@ -12433,7 +12475,7 @@ function checkCommand(args, version, onPath = workitAvailable()) {
|
|
|
12433
12475
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
12434
12476
|
import { createHash as createHash5 } from "node:crypto";
|
|
12435
12477
|
import fs9 from "node:fs";
|
|
12436
|
-
import
|
|
12478
|
+
import os2 from "node:os";
|
|
12437
12479
|
import path8 from "node:path";
|
|
12438
12480
|
var MAX_BUFFER = 256 * 1024 * 1024;
|
|
12439
12481
|
var GIT_TIMEOUTS = { local: 20000, worktree: 120000, network: 15000 };
|
|
@@ -12481,7 +12523,7 @@ function worktreeTree(cwd, options = {}) {
|
|
|
12481
12523
|
return null;
|
|
12482
12524
|
const cap = options.maxUntrackedBytes ?? MAX_UNTRACKED_BYTES;
|
|
12483
12525
|
const timeoutMs = options.timeoutMs ?? GIT_TIMEOUTS.worktree;
|
|
12484
|
-
const scratch = fs9.mkdtempSync(path8.join(
|
|
12526
|
+
const scratch = fs9.mkdtempSync(path8.join(os2.tmpdir(), "workit-tree-"));
|
|
12485
12527
|
try {
|
|
12486
12528
|
const tempIndex = path8.join(scratch, "index");
|
|
12487
12529
|
if (fs9.existsSync(indexPath))
|
|
@@ -12635,7 +12677,7 @@ import {
|
|
|
12635
12677
|
readdirSync as readdirSync2,
|
|
12636
12678
|
writeFileSync as writeFileSync2
|
|
12637
12679
|
} from "node:fs";
|
|
12638
|
-
import
|
|
12680
|
+
import os3 from "node:os";
|
|
12639
12681
|
import path9 from "node:path";
|
|
12640
12682
|
|
|
12641
12683
|
// packages/workit-core/src/core/boundary.ts
|
|
@@ -12695,7 +12737,7 @@ var mergePreset = (preset, input = {}, current = {
|
|
|
12695
12737
|
protected: preset === "custom" ? input.protectedNames ?? current.branchPolicy.protected : [...defs.protected]
|
|
12696
12738
|
};
|
|
12697
12739
|
};
|
|
12698
|
-
var resolveConfigDir = () => process.env.WORKFLOW_TOOLKIT_CONFIG ?? process.env.WORKFLOW_TOOLKIT_CONFIG_DIR ?? path9.join(process.env.XDG_CONFIG_HOME || path9.join(
|
|
12740
|
+
var resolveConfigDir = () => process.env.WORKFLOW_TOOLKIT_CONFIG ?? process.env.WORKFLOW_TOOLKIT_CONFIG_DIR ?? path9.join(process.env.XDG_CONFIG_HOME || path9.join(os3.homedir(), ".config"), "workit");
|
|
12699
12741
|
var migratedDir = null;
|
|
12700
12742
|
var migrationFailed = false;
|
|
12701
12743
|
var ensureConfigDir = (dir = resolveConfigDir()) => {
|
|
@@ -12705,7 +12747,7 @@ var ensureConfigDir = (dir = resolveConfigDir()) => {
|
|
|
12705
12747
|
migratedDir = dir;
|
|
12706
12748
|
return dir;
|
|
12707
12749
|
}
|
|
12708
|
-
const legacy = path9.join(process.env.XDG_CONFIG_HOME || path9.join(
|
|
12750
|
+
const legacy = path9.join(process.env.XDG_CONFIG_HOME || path9.join(os3.homedir(), ".config"), "workflow-toolkit");
|
|
12709
12751
|
if (!existsSync3(legacy)) {
|
|
12710
12752
|
migratedDir = dir;
|
|
12711
12753
|
return dir;
|
|
@@ -13656,7 +13698,7 @@ var git3 = (cwd, args) => {
|
|
|
13656
13698
|
return run.status === 0 ? (run.stdout ?? "").trim() : null;
|
|
13657
13699
|
};
|
|
13658
13700
|
var recordedBaseKey = (branch) => `branch.${branch}.workitBase`;
|
|
13659
|
-
var
|
|
13701
|
+
var escapeRegExp2 = (text) => text.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
13660
13702
|
var reflog = (cwd, ref) => (git3(cwd, ["log", "-g", "--date=unix", "--format=%H%x09%gd%x09%gs", ref, "--"]) ?? "").split(`
|
|
13661
13703
|
`).map((line) => {
|
|
13662
13704
|
const [sha = "", selector = "", ...subject] = line.split("\t");
|
|
@@ -13688,7 +13730,7 @@ function gitTrackProbe(cwd) {
|
|
|
13688
13730
|
const created = own.at(-1);
|
|
13689
13731
|
if (!created || created.subject !== "branch: Created from HEAD")
|
|
13690
13732
|
return null;
|
|
13691
|
-
const pattern = new RegExp(`^checkout: moving from (\\S+) to ${
|
|
13733
|
+
const pattern = new RegExp(`^checkout: moving from (\\S+) to ${escapeRegExp2(branch)}$`, "u");
|
|
13692
13734
|
const entry = reflog(cwd, "HEAD").findLast((item) => item.time >= created.time && item.sha === created.sha && pattern.test(item.subject));
|
|
13693
13735
|
return entry ? pattern.exec(entry.subject)?.[1] ?? null : null;
|
|
13694
13736
|
},
|
|
@@ -15870,7 +15912,7 @@ import path17 from "node:path";
|
|
|
15870
15912
|
import { spawnSync as spawnSync11 } from "node:child_process";
|
|
15871
15913
|
import { createHash as createHash12 } from "node:crypto";
|
|
15872
15914
|
import fs14 from "node:fs";
|
|
15873
|
-
import
|
|
15915
|
+
import os4 from "node:os";
|
|
15874
15916
|
import path16 from "node:path";
|
|
15875
15917
|
|
|
15876
15918
|
// packages/workit-core/src/core/branch.ts
|
|
@@ -16296,7 +16338,7 @@ var isAbsolute = (value) => path16.isAbsolute(value) || /^[A-Za-z]:[\\/]/.test(v
|
|
|
16296
16338
|
var joinDir = (base, next) => {
|
|
16297
16339
|
if (base === undefined || /[$`*?]/.test(next) || next === "-")
|
|
16298
16340
|
return;
|
|
16299
|
-
const expanded = next === "~" || next.startsWith("~/") ? path16.join(
|
|
16341
|
+
const expanded = next === "~" || next.startsWith("~/") ? path16.join(os4.homedir(), next.slice(1)) : next;
|
|
16300
16342
|
return base === null || isAbsolute(expanded) ? expanded : path16.join(base, expanded);
|
|
16301
16343
|
};
|
|
16302
16344
|
var cdTarget = (words) => {
|
|
@@ -16348,7 +16390,7 @@ function rawInvocations(command, dialect = "posix", depth = 0) {
|
|
|
16348
16390
|
const name = commandName(words[0]);
|
|
16349
16391
|
if (CD.has(name)) {
|
|
16350
16392
|
const target = cdTarget(words);
|
|
16351
|
-
dir = target === null ?
|
|
16393
|
+
dir = target === null ? os4.homedir() : joinDir(dir, target);
|
|
16352
16394
|
continue;
|
|
16353
16395
|
}
|
|
16354
16396
|
if (PUSHD.has(name)) {
|
|
@@ -17182,7 +17224,7 @@ var judgeInputSummary = (raw) => {
|
|
|
17182
17224
|
};
|
|
17183
17225
|
|
|
17184
17226
|
// packages/workit-core/src/autonomy.ts
|
|
17185
|
-
import
|
|
17227
|
+
import os5 from "node:os";
|
|
17186
17228
|
import path18 from "node:path";
|
|
17187
17229
|
|
|
17188
17230
|
// packages/workit-core/src/core/safe-write.ts
|
|
@@ -17211,9 +17253,9 @@ function writeFileExclusive(file, content, mode) {
|
|
|
17211
17253
|
// packages/workit-core/src/autonomy.ts
|
|
17212
17254
|
var accountHome = () => {
|
|
17213
17255
|
try {
|
|
17214
|
-
return
|
|
17256
|
+
return os5.userInfo().homedir;
|
|
17215
17257
|
} catch {
|
|
17216
|
-
return
|
|
17258
|
+
return os5.homedir();
|
|
17217
17259
|
}
|
|
17218
17260
|
};
|
|
17219
17261
|
var grantsHome = { resolve: accountHome };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-opencode",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typecheck": "tsc --noEmit"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@brainervirus/workit-core": "^8.12.
|
|
42
|
+
"@brainervirus/workit-core": "^8.12.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@opencode/plugin": "2.0.18"
|