@workit-dev/opencode 2.11.1 → 2.13.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 +74 -47
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -183,7 +183,7 @@ function define(plugin) {
|
|
|
183
183
|
|
|
184
184
|
// packages/workit-core/src/core.ts
|
|
185
185
|
import { spawnSync as spawnSync22 } from "node:child_process";
|
|
186
|
-
import { existsSync as
|
|
186
|
+
import { existsSync as existsSync14, realpathSync as realpathSync9 } from "node:fs";
|
|
187
187
|
import path35 from "node:path";
|
|
188
188
|
|
|
189
189
|
// packages/workit-core/src/core/task-contract.ts
|
|
@@ -9495,6 +9495,7 @@ var workspaceConfigSchema = object({
|
|
|
9495
9495
|
releaseNotes: unknown().optional().describe("The release notes `workit release finish` publishes on the forge release: `auto` (default: the draft when there is one, else the notes built from the version's changelog section), `off` (no forge release) or `review` (finish refuses until `workit release notes approve`). A release track overrides it."),
|
|
9496
9496
|
trailers: boolean2().optional().describe("Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
9497
9497
|
deleteBranch: boolean2().optional().describe("Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
9498
|
+
cleanup: unknown().optional().describe("What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
9498
9499
|
liveSessionGuard: boolean2().optional().describe("Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
9499
9500
|
fanout: object({
|
|
9500
9501
|
tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
|
|
@@ -18576,7 +18577,7 @@ var exportDigest = (bundle) => sha256({
|
|
|
18576
18577
|
});
|
|
18577
18578
|
// packages/workit-core/src/core/route-intent.ts
|
|
18578
18579
|
import { spawnSync as spawnSync17 } from "node:child_process";
|
|
18579
|
-
import { existsSync as
|
|
18580
|
+
import { existsSync as existsSync12 } from "node:fs";
|
|
18580
18581
|
import path30 from "node:path";
|
|
18581
18582
|
|
|
18582
18583
|
// packages/workit-core/src/hooks/raw-git.ts
|
|
@@ -18587,6 +18588,7 @@ import os6 from "node:os";
|
|
|
18587
18588
|
import path29 from "node:path";
|
|
18588
18589
|
|
|
18589
18590
|
// packages/workit-core/src/autonomy.ts
|
|
18591
|
+
import { closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync11, openSync as openSync2 } from "node:fs";
|
|
18590
18592
|
import path27 from "node:path";
|
|
18591
18593
|
|
|
18592
18594
|
// packages/workit-core/src/core/eval-world.ts
|
|
@@ -18683,12 +18685,36 @@ function checkSeal(dir) {
|
|
|
18683
18685
|
}
|
|
18684
18686
|
|
|
18685
18687
|
// packages/workit-core/src/autonomy.ts
|
|
18686
|
-
var
|
|
18688
|
+
var accountHomeDir = () => {
|
|
18687
18689
|
const home = grantsHome.resolve();
|
|
18688
18690
|
return home === null ? null : configDir({ HOME: home });
|
|
18689
18691
|
};
|
|
18690
|
-
var
|
|
18692
|
+
var deniedFile = (dir) => {
|
|
18693
|
+
for (const name of ["workspaces.json", SEAL_FILE]) {
|
|
18694
|
+
const file = path27.join(dir, name);
|
|
18695
|
+
try {
|
|
18696
|
+
closeSync2(openSync2(file, "r"));
|
|
18697
|
+
} catch (error) {
|
|
18698
|
+
const code = error.code;
|
|
18699
|
+
if (code === "EACCES" || code === "EPERM")
|
|
18700
|
+
return file;
|
|
18701
|
+
}
|
|
18702
|
+
}
|
|
18703
|
+
return null;
|
|
18704
|
+
};
|
|
18705
|
+
var accountDir = () => {
|
|
18706
|
+
const dir = accountHomeDir();
|
|
18707
|
+
return dir === null || deniedFile(dir) !== null ? null : dir;
|
|
18708
|
+
};
|
|
18709
|
+
var grantsDir = () => accountHomeDir() ?? resolveConfigDir();
|
|
18691
18710
|
var NO_ACCOUNT = "no OS account record answered (core/account-home.ts), so no grants are read: the D4 defaults apply";
|
|
18711
|
+
var accountUnread = () => {
|
|
18712
|
+
const dir = accountHomeDir();
|
|
18713
|
+
if (dir === null)
|
|
18714
|
+
return NO_ACCOUNT;
|
|
18715
|
+
const file = deniedFile(dir);
|
|
18716
|
+
return file === null ? null : `the account's ${path27.basename(file)} cannot be read (permission denied), so it reads as no workspace entries: no grants, no models, the D4 defaults apply`;
|
|
18717
|
+
};
|
|
18692
18718
|
var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
|
|
18693
18719
|
var fileSource = (dir = accountDir()) => ({
|
|
18694
18720
|
resolve: (cwd, name) => dir === null ? null : resolveWorkspaceFrom(cwd, dir, name),
|
|
@@ -18748,7 +18774,7 @@ var benchWorld = (cwd) => {
|
|
|
18748
18774
|
var grantsOverride = () => {
|
|
18749
18775
|
const shown = shownGrantsDir();
|
|
18750
18776
|
if (shown === null)
|
|
18751
|
-
return NO_ACCOUNT;
|
|
18777
|
+
return accountUnread() ?? NO_ACCOUNT;
|
|
18752
18778
|
const configured = path27.resolve(resolveConfigDir());
|
|
18753
18779
|
return configured === path27.resolve(shown) ? null : `the config directory is redirected to ${configured} (WORKIT_CONFIG, WORKIT_CONFIG_DIR or XDG_CONFIG_HOME), but that override does not apply to grants: grants are read only from ${path27.join(grantsDir(), "workspaces.json")}, and under a redirect they never exceed the D4 defaults`;
|
|
18754
18780
|
};
|
|
@@ -18917,9 +18943,10 @@ function capAt(source, named, where, by, why, main = false) {
|
|
|
18917
18943
|
}
|
|
18918
18944
|
function resolveAutonomy(cwd, target) {
|
|
18919
18945
|
const world = benchWorld(cwd);
|
|
18946
|
+
const unread = world ? null : accountUnread();
|
|
18947
|
+
if (unread !== null)
|
|
18948
|
+
return { ...autonomyOf(null), note: unread };
|
|
18920
18949
|
const override = world ? null : grantsOverride();
|
|
18921
|
-
if (override === NO_ACCOUNT)
|
|
18922
|
-
return { ...autonomyOf(null), note: override };
|
|
18923
18950
|
let resolved;
|
|
18924
18951
|
const once = typeof target === "function" ? () => resolved ??= target() : target;
|
|
18925
18952
|
const account = accountAuthority(cwd, world, once);
|
|
@@ -19018,9 +19045,9 @@ function capAtRemotes(source, autonomy, cwd, target) {
|
|
|
19018
19045
|
return capped;
|
|
19019
19046
|
}
|
|
19020
19047
|
var grantsMatter = (kind) => {
|
|
19021
|
-
|
|
19022
|
-
if (override === NO_ACCOUNT)
|
|
19048
|
+
if (accountUnread() !== null)
|
|
19023
19049
|
return false;
|
|
19050
|
+
const override = grantsOverride();
|
|
19024
19051
|
const entries = entriesIn(accountDir());
|
|
19025
19052
|
const matters = entries.some((entry) => {
|
|
19026
19053
|
const autonomy = autonomyOf(entry);
|
|
@@ -21598,7 +21625,7 @@ var judgedDir = (root, dir) => {
|
|
|
21598
21625
|
if (dir === null)
|
|
21599
21626
|
return root;
|
|
21600
21627
|
const resolved = path30.resolve(root, dir);
|
|
21601
|
-
return
|
|
21628
|
+
return existsSync12(resolved) && inWorkitWorkspace(resolved) ? resolved : null;
|
|
21602
21629
|
};
|
|
21603
21630
|
var shellBranchPolicyViolation = (root, command, dialect = "posix") => {
|
|
21604
21631
|
let judged = false;
|
|
@@ -23594,7 +23621,7 @@ class WorkitCore {
|
|
|
23594
23621
|
}
|
|
23595
23622
|
// packages/workit-core/src/core/repo-context.ts
|
|
23596
23623
|
import { spawnSync as spawnSync18 } from "node:child_process";
|
|
23597
|
-
import { existsSync as
|
|
23624
|
+
import { existsSync as existsSync13, readFileSync as readFileSync11, readdirSync as readdirSync4 } from "node:fs";
|
|
23598
23625
|
import path31 from "node:path";
|
|
23599
23626
|
var isSafeContextRange = (value) => value.length <= 4096 && (() => {
|
|
23600
23627
|
try {
|
|
@@ -23776,7 +23803,7 @@ var diffStatForRange = (cwd, range) => {
|
|
|
23776
23803
|
};
|
|
23777
23804
|
var packageScripts = (cwd, keys) => {
|
|
23778
23805
|
const pkgPath = path31.join(cwd, "package.json");
|
|
23779
|
-
if (!
|
|
23806
|
+
if (!existsSync13(pkgPath))
|
|
23780
23807
|
return [];
|
|
23781
23808
|
try {
|
|
23782
23809
|
const pkg = JSON.parse(readFileSync11(pkgPath, "utf8"));
|
|
@@ -23811,7 +23838,7 @@ var documentationFiles = (cwd) => {
|
|
|
23811
23838
|
return matches.toSorted().slice(0, 200);
|
|
23812
23839
|
};
|
|
23813
23840
|
var readTrimmed2 = (file, maxLines) => {
|
|
23814
|
-
if (!
|
|
23841
|
+
if (!existsSync13(file))
|
|
23815
23842
|
return "";
|
|
23816
23843
|
const lines = readFileSync11(file, "utf8").split(`
|
|
23817
23844
|
`);
|
|
@@ -23887,7 +23914,7 @@ ${status.stderr}` : "");
|
|
|
23887
23914
|
stdout += `
|
|
23888
23915
|
`;
|
|
23889
23916
|
stdout += printSection("Recent Validation Signals");
|
|
23890
|
-
if (
|
|
23917
|
+
if (existsSync13(path31.join(cwd, "package.json"))) {
|
|
23891
23918
|
stdout += `package.json detected. Common scripts:
|
|
23892
23919
|
`;
|
|
23893
23920
|
const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
|
|
@@ -23896,7 +23923,7 @@ ${status.stderr}` : "");
|
|
|
23896
23923
|
`) + `
|
|
23897
23924
|
`;
|
|
23898
23925
|
}
|
|
23899
|
-
if (
|
|
23926
|
+
if (existsSync13(path31.join(cwd, "Cargo.toml")) || existsSync13(path31.join(cwd, "src-tauri/Cargo.toml"))) {
|
|
23900
23927
|
stdout += `Rust project detected.
|
|
23901
23928
|
`;
|
|
23902
23929
|
}
|
|
@@ -23948,7 +23975,7 @@ function changelogContext(root, range) {
|
|
|
23948
23975
|
`;
|
|
23949
23976
|
stdout += printSection("Existing CHANGELOG.md");
|
|
23950
23977
|
const changelogPath = path31.join(cwd, "CHANGELOG.md");
|
|
23951
|
-
if (
|
|
23978
|
+
if (existsSync13(changelogPath)) {
|
|
23952
23979
|
stdout += readTrimmed2(changelogPath, 260) + `
|
|
23953
23980
|
`;
|
|
23954
23981
|
} else {
|
|
@@ -23990,7 +24017,7 @@ function docsRefreshContext(root, range) {
|
|
|
23990
24017
|
`;
|
|
23991
24018
|
stdout += printSection("README Preview");
|
|
23992
24019
|
const readme = path31.join(cwd, "README.md");
|
|
23993
|
-
if (
|
|
24020
|
+
if (existsSync13(readme)) {
|
|
23994
24021
|
stdout += readTrimmed2(readme, 220) + `
|
|
23995
24022
|
`;
|
|
23996
24023
|
} else {
|
|
@@ -23999,7 +24026,7 @@ function docsRefreshContext(root, range) {
|
|
|
23999
24026
|
}
|
|
24000
24027
|
stdout += printSection("Package Scripts");
|
|
24001
24028
|
const pkgPath = path31.join(cwd, "package.json");
|
|
24002
|
-
if (
|
|
24029
|
+
if (existsSync13(pkgPath)) {
|
|
24003
24030
|
try {
|
|
24004
24031
|
const pkg = JSON.parse(readFileSync11(pkgPath, "utf8"));
|
|
24005
24032
|
stdout += JSON.stringify({ name: pkg.name, version: pkg.version, scripts: pkg.scripts }, null, 2) + `
|
|
@@ -24055,7 +24082,7 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
24055
24082
|
`;
|
|
24056
24083
|
stdout += printSection("Existing Release Files");
|
|
24057
24084
|
for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
|
|
24058
|
-
if (
|
|
24085
|
+
if (existsSync13(path31.join(cwd, rel)))
|
|
24059
24086
|
stdout += rel + `
|
|
24060
24087
|
`;
|
|
24061
24088
|
}
|
|
@@ -24792,7 +24819,7 @@ function resolveInside(root, candidate) {
|
|
|
24792
24819
|
throw new Error("path must stay inside repository root");
|
|
24793
24820
|
}
|
|
24794
24821
|
let ancestor = target;
|
|
24795
|
-
while (!
|
|
24822
|
+
while (!existsSync14(ancestor))
|
|
24796
24823
|
ancestor = path35.dirname(ancestor);
|
|
24797
24824
|
const canonicalAncestor = realpathSync9(ancestor);
|
|
24798
24825
|
if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base + path35.sep)) {
|
|
@@ -26000,7 +26027,7 @@ function heavyGate(cwd, command, options) {
|
|
|
26000
26027
|
}
|
|
26001
26028
|
// packages/workit-core/src/hooks/write-gate.ts
|
|
26002
26029
|
import {
|
|
26003
|
-
existsSync as
|
|
26030
|
+
existsSync as existsSync15,
|
|
26004
26031
|
readdirSync as readdirSync5,
|
|
26005
26032
|
readFileSync as readFileSync12,
|
|
26006
26033
|
readlinkSync as readlinkSync3,
|
|
@@ -26712,7 +26739,7 @@ var linkSources = (args, at) => {
|
|
|
26712
26739
|
const sources = names.filter((name, index) => into >= 0 ? name !== dest : index < names.length - 1 || names.length === 1);
|
|
26713
26740
|
const target = dest === undefined ? null : at(dest);
|
|
26714
26741
|
const symbolic = args.some((arg) => /^-[a-zA-Z]*s|^--symbolic$/.test(arg));
|
|
26715
|
-
const base = target === null ? null : into >= 0 || sources.length > 1 ||
|
|
26742
|
+
const base = target === null ? null : into >= 0 || sources.length > 1 || existsSync15(target) || /[\\/]$/.test(dest ?? "") ? target : path41.dirname(target);
|
|
26716
26743
|
return sources.flatMap((source) => {
|
|
26717
26744
|
if (symbolic && base !== null && !path41.isAbsolute(homeExpanded(source)))
|
|
26718
26745
|
return [path41.resolve(base, source)];
|
|
@@ -29575,7 +29602,7 @@ if (false) {}
|
|
|
29575
29602
|
import path49 from "node:path";
|
|
29576
29603
|
|
|
29577
29604
|
// packages/workit-core/src/core/gitignore.ts
|
|
29578
|
-
import { existsSync as
|
|
29605
|
+
import { existsSync as existsSync16, readFileSync as readFileSync13, writeFileSync as writeFileSync5 } from "node:fs";
|
|
29579
29606
|
import path45 from "node:path";
|
|
29580
29607
|
var GITIGNORE_ENTRIES = [
|
|
29581
29608
|
"# workit: SDD working state (never commit)",
|
|
@@ -29597,7 +29624,7 @@ var ensureProjectGitignore = (workspaceRoot, confirmed) => {
|
|
|
29597
29624
|
if (!confirmed)
|
|
29598
29625
|
return { ok: false, error: "confirmed: true required" };
|
|
29599
29626
|
const file = path45.join(workspaceRoot, ".gitignore");
|
|
29600
|
-
const existing =
|
|
29627
|
+
const existing = existsSync16(file) ? readFileSync13(file, "utf8") : "";
|
|
29601
29628
|
const existingLines = new Set(existing.split(`
|
|
29602
29629
|
`).map((l) => l.trim()).filter(Boolean));
|
|
29603
29630
|
const added = [];
|
|
@@ -29616,19 +29643,19 @@ var ensureProjectGitignore = (workspaceRoot, confirmed) => {
|
|
|
29616
29643
|
` : "") + append.join(`
|
|
29617
29644
|
`) + `
|
|
29618
29645
|
`, "utf8");
|
|
29619
|
-
} else if (!
|
|
29646
|
+
} else if (!existsSync16(file)) {
|
|
29620
29647
|
writeFileSync5(file, "", "utf8");
|
|
29621
29648
|
}
|
|
29622
29649
|
return { ok: true, path: file, added };
|
|
29623
29650
|
};
|
|
29624
29651
|
|
|
29625
29652
|
// packages/workit-core/src/core/hygiene.ts
|
|
29626
|
-
import { existsSync as
|
|
29653
|
+
import { existsSync as existsSync17, readFileSync as readFileSync14, readdirSync as readdirSync6, writeFileSync as writeFileSync6 } from "node:fs";
|
|
29627
29654
|
import path46 from "node:path";
|
|
29628
29655
|
var repoRoot3 = assetRoot();
|
|
29629
29656
|
var templatesDir = () => path46.join(repoRoot3, "templates", "hygiene");
|
|
29630
29657
|
var packageJson = (root) => {
|
|
29631
|
-
if (!
|
|
29658
|
+
if (!existsSync17(path46.join(root, "package.json")))
|
|
29632
29659
|
return null;
|
|
29633
29660
|
try {
|
|
29634
29661
|
return JSON.parse(readFileSync14(path46.join(root, "package.json"), "utf8"));
|
|
@@ -29637,7 +29664,7 @@ var packageJson = (root) => {
|
|
|
29637
29664
|
}
|
|
29638
29665
|
};
|
|
29639
29666
|
var isOpenSource = (root) => {
|
|
29640
|
-
if (
|
|
29667
|
+
if (existsSync17(path46.join(root, "LICENSE")))
|
|
29641
29668
|
return true;
|
|
29642
29669
|
const pkg = packageJson(root);
|
|
29643
29670
|
if (pkg && !pkg.private)
|
|
@@ -29665,10 +29692,10 @@ var planHygieneFiles = (root, opts = {}) => {
|
|
|
29665
29692
|
files.push("LICENSE", "CONTRIBUTING.md");
|
|
29666
29693
|
const planned = [];
|
|
29667
29694
|
for (const file of files) {
|
|
29668
|
-
if (
|
|
29695
|
+
if (existsSync17(path46.join(root, file)))
|
|
29669
29696
|
continue;
|
|
29670
29697
|
const tpl = path46.join(templatesDir(), file);
|
|
29671
|
-
if (!
|
|
29698
|
+
if (!existsSync17(tpl))
|
|
29672
29699
|
continue;
|
|
29673
29700
|
const content = readFileSync14(tpl, "utf8").replace(/<PROJECT>/g, path46.basename(root)).replace(/<YEAR>/g, String(new Date().getFullYear())).replace(/<HOLDER>\s*/g, licenseHolder(root));
|
|
29674
29701
|
planned.push({ path: path46.join(root, file), content });
|
|
@@ -30417,7 +30444,7 @@ import path53 from "node:path";
|
|
|
30417
30444
|
|
|
30418
30445
|
// packages/workit-core/src/git/ops.ts
|
|
30419
30446
|
import { spawnSync as spawnSync27 } from "node:child_process";
|
|
30420
|
-
import { copyFileSync as
|
|
30447
|
+
import { copyFileSync as copyFileSync3, existsSync as existsSync18, readdirSync as readdirSync7, readFileSync as readFileSync16, rmSync as rmSync4 } from "node:fs";
|
|
30421
30448
|
import path52 from "node:path";
|
|
30422
30449
|
var COMMIT_TIMEOUT_MS = 10 * 60000;
|
|
30423
30450
|
var git5 = (cwd, args, options = {}) => {
|
|
@@ -30455,11 +30482,11 @@ function operationInProgress(cwd) {
|
|
|
30455
30482
|
const conflicted = () => git5(cwd, ["ls-files", "-u"]).stdout.trim() !== "";
|
|
30456
30483
|
for (const [index, [, operation]] of markers.entries()) {
|
|
30457
30484
|
const marker = found[index];
|
|
30458
|
-
if (!marker || !
|
|
30485
|
+
if (!marker || !existsSync18(marker))
|
|
30459
30486
|
continue;
|
|
30460
|
-
if (index === 1 &&
|
|
30487
|
+
if (index === 1 && existsSync18(path52.join(marker, "applying")))
|
|
30461
30488
|
return { operation: "am", commitAllowed: false, branch: null };
|
|
30462
|
-
if (index === 0 &&
|
|
30489
|
+
if (index === 0 && existsSync18(path52.join(marker, "amend")) && !conflicted()) {
|
|
30463
30490
|
let headName = "";
|
|
30464
30491
|
try {
|
|
30465
30492
|
headName = readFileSync16(path52.join(marker, "head-name"), "utf8").trim();
|
|
@@ -32106,11 +32133,11 @@ var createStopControl = (root, port) => {
|
|
|
32106
32133
|
};
|
|
32107
32134
|
|
|
32108
32135
|
// packages/workit-opencode/src/v2/registry.ts
|
|
32109
|
-
import { existsSync as
|
|
32136
|
+
import { existsSync as existsSync20, readFileSync as readFileSync17 } from "node:fs";
|
|
32110
32137
|
import path57 from "node:path";
|
|
32111
32138
|
|
|
32112
32139
|
// packages/workit-opencode/src/shared/assets.ts
|
|
32113
|
-
import { existsSync as
|
|
32140
|
+
import { existsSync as existsSync19, realpathSync as realpathSync13 } from "node:fs";
|
|
32114
32141
|
import path56 from "node:path";
|
|
32115
32142
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
32116
32143
|
var moduleDir = () => {
|
|
@@ -32127,7 +32154,7 @@ var packageRoot2 = () => {
|
|
|
32127
32154
|
path56.resolve(dir, "..", ".."),
|
|
32128
32155
|
path56.resolve(dir, "..", "..", "..")
|
|
32129
32156
|
]) {
|
|
32130
|
-
if (
|
|
32157
|
+
if (existsSync19(path56.join(candidate, "package.json")))
|
|
32131
32158
|
return candidate;
|
|
32132
32159
|
}
|
|
32133
32160
|
return path56.resolve(dir, "..");
|
|
@@ -32135,7 +32162,7 @@ var packageRoot2 = () => {
|
|
|
32135
32162
|
var skillsRoot = () => {
|
|
32136
32163
|
const root = packageRoot2();
|
|
32137
32164
|
const canonical = path56.resolve(root, "..", "workit-core", "skills");
|
|
32138
|
-
if (
|
|
32165
|
+
if (existsSync19(path56.join(root, "src")) && existsSync19(canonical))
|
|
32139
32166
|
return canonical;
|
|
32140
32167
|
return path56.join(root, "assets", "skills");
|
|
32141
32168
|
};
|
|
@@ -32161,7 +32188,7 @@ var parseFrontmatter = (markdown) => {
|
|
|
32161
32188
|
};
|
|
32162
32189
|
var registerSkills = async (ctx) => {
|
|
32163
32190
|
const skillsDir = skillsRoot();
|
|
32164
|
-
if (!
|
|
32191
|
+
if (!existsSync20(skillsDir))
|
|
32165
32192
|
return new Set;
|
|
32166
32193
|
const listed = await ctx.skill.list().catch(() => ({ data: [] }));
|
|
32167
32194
|
const own = (skill) => typeof skill.path === "string" && path57.resolve(skill.path).startsWith(skillsDir + path57.sep);
|
|
@@ -32169,7 +32196,7 @@ var registerSkills = async (ctx) => {
|
|
|
32169
32196
|
const packaged = new Map;
|
|
32170
32197
|
for (const id of WORKIT_METHOD_SKILLS) {
|
|
32171
32198
|
const file = path57.join(skillsDir, id, "SKILL.md");
|
|
32172
|
-
if (!userSkills.has(id) &&
|
|
32199
|
+
if (!userSkills.has(id) && existsSync20(file))
|
|
32173
32200
|
packaged.set(id, file);
|
|
32174
32201
|
}
|
|
32175
32202
|
await ctx.skill.transform((editor) => {
|
|
@@ -32215,11 +32242,11 @@ var registerCommands = async (ctx, registeredSkills) => {
|
|
|
32215
32242
|
};
|
|
32216
32243
|
|
|
32217
32244
|
// packages/workit-opencode/src/stale-sources.ts
|
|
32218
|
-
import { existsSync as
|
|
32245
|
+
import { existsSync as existsSync21, readdirSync as readdirSync8 } from "node:fs";
|
|
32219
32246
|
import path58 from "node:path";
|
|
32220
32247
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
32221
32248
|
var typescriptFiles = (directory) => {
|
|
32222
|
-
if (!
|
|
32249
|
+
if (!existsSync21(directory))
|
|
32223
32250
|
return [];
|
|
32224
32251
|
return readdirSync8(directory, { withFileTypes: true }).flatMap((entry) => {
|
|
32225
32252
|
const file = path58.join(directory, entry.name);
|
|
@@ -32233,10 +32260,10 @@ var pluginSourceFiles = [
|
|
|
32233
32260
|
path58.join(packageRoot2(), "..", "workit-core", "src", "core.ts"),
|
|
32234
32261
|
...typescriptFiles(path58.join(packageRoot2(), "..", "workit-core", "src", "core"))
|
|
32235
32262
|
])
|
|
32236
|
-
].filter((file) =>
|
|
32263
|
+
].filter((file) => existsSync21(file)).toSorted();
|
|
32237
32264
|
|
|
32238
32265
|
// packages/workit-core/src/core/cli-locate.ts
|
|
32239
|
-
import { closeSync as
|
|
32266
|
+
import { closeSync as closeSync3, existsSync as existsSync22, openSync as openSync3, readSync } from "node:fs";
|
|
32240
32267
|
import path59 from "node:path";
|
|
32241
32268
|
var LAUNCHER_MARKER = "workit-owned-launcher";
|
|
32242
32269
|
var CLI_PACKAGE_PATH = ["node_modules", "@workit-dev", "cli"];
|
|
@@ -32251,7 +32278,7 @@ var ownedCurrentEntry = (env, platform = process.platform) => path59.join(instal
|
|
|
32251
32278
|
var head = (file) => {
|
|
32252
32279
|
let fd;
|
|
32253
32280
|
try {
|
|
32254
|
-
fd =
|
|
32281
|
+
fd = openSync3(file, "r");
|
|
32255
32282
|
const buffer = Buffer.alloc(256);
|
|
32256
32283
|
const read = readSync(fd, buffer, 0, buffer.length, 0);
|
|
32257
32284
|
return buffer.subarray(0, read).toString("utf8");
|
|
@@ -32259,13 +32286,13 @@ var head = (file) => {
|
|
|
32259
32286
|
return "";
|
|
32260
32287
|
} finally {
|
|
32261
32288
|
if (fd !== undefined)
|
|
32262
|
-
|
|
32289
|
+
closeSync3(fd);
|
|
32263
32290
|
}
|
|
32264
32291
|
};
|
|
32265
32292
|
var locateWorkitCli = (options = {}) => {
|
|
32266
32293
|
const env = options.env ?? process.env;
|
|
32267
32294
|
const platform = options.platform ?? process.platform;
|
|
32268
|
-
const exists = options.exists ??
|
|
32295
|
+
const exists = options.exists ?? existsSync22;
|
|
32269
32296
|
const read = options.read ?? head;
|
|
32270
32297
|
const node = options.node ?? process.execPath;
|
|
32271
32298
|
const launcher = ownedLauncherPath(env, platform);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.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.0.18",
|
|
44
|
-
"@workit-dev/core": "^2.
|
|
44
|
+
"@workit-dev/core": "^2.13.0"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|