@brainervirus/workit-cursor 8.15.1 → 8.17.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.
@@ -21251,6 +21251,7 @@ import fs9 from "node:fs";
21251
21251
  import path9 from "node:path";
21252
21252
  var SCRIPT_CHECKS = ["test", "lint", "typecheck", "check"];
21253
21253
  var CHECKS_FILE = "workit.checks.json";
21254
+ var checksConfigFile = (root) => path9.join(root, CHECKS_FILE);
21254
21255
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
21255
21256
  var SHELL_META = /[|&;<>()$`\\*?[\]{}~!#]/u;
21256
21257
  function splitCommand(command) {
@@ -21363,7 +21364,7 @@ function detectedChecks(root) {
21363
21364
  var GATES = ["testing", "verification"];
21364
21365
  function loadCheckConfig(cwd) {
21365
21366
  const root = checkRoot(cwd);
21366
- const file = path9.join(root, CHECKS_FILE);
21367
+ const file = checksConfigFile(root);
21367
21368
  const none = (error = null) => ({
21368
21369
  source: error ? CHECKS_FILE : "none",
21369
21370
  root,
@@ -22000,6 +22001,7 @@ var workspaceConfigSchema = object2({
22000
22001
  autoApprove: union([boolean2(), array(nonBlank)]).optional(),
22001
22002
  defaultEndpoint: unknown().optional(),
22002
22003
  verification: _enum(["self", "independent"]).optional(),
22004
+ delegation: unknown().optional(),
22003
22005
  trailers: boolean2().optional(),
22004
22006
  liveSessionGuard: boolean2().optional(),
22005
22007
  fanout: object2({ tierModels: unknown().optional() }).passthrough().optional(),
@@ -24790,6 +24792,58 @@ function evaluateClosure(requestedOutcome, view) {
24790
24792
  requirementIds: evaluations.map((item) => item.requirementId)
24791
24793
  });
24792
24794
  }
24795
+ var BRIEF_TEXT = 250;
24796
+ var BRIEF_BLOCKERS = 3;
24797
+ var BRIEF_OPEN = 8;
24798
+ var clip = (value) => {
24799
+ const fits = (text) => Buffer.byteLength(JSON.stringify(text)) <= BRIEF_TEXT;
24800
+ if (fits(value))
24801
+ return value;
24802
+ let length = Math.min(value.length, BRIEF_TEXT);
24803
+ while (length > 0 && !fits(`${value.slice(0, length)}…`))
24804
+ length -= 1;
24805
+ return `${value.slice(0, length)}…`;
24806
+ };
24807
+ function boundTaskSummary(summary) {
24808
+ const rules = new Map((summary.policy?.requirements ?? []).map((item) => [item.id, item]));
24809
+ const unmet = summary.requirements.filter((item) => item.status === "unsatisfied" || item.status === "unavailable");
24810
+ const { progress, closure } = summary;
24811
+ const next = progress.nextAction;
24812
+ const open = unmet.slice(0, BRIEF_OPEN).map((item) => ({
24813
+ dimension: rules.get(item.requirementId)?.dimension ?? "verification",
24814
+ before: rules.get(item.requirementId)?.before ?? "close",
24815
+ status: item.status
24816
+ }));
24817
+ const brief = {
24818
+ id: summary.id,
24819
+ revision: summary.revision,
24820
+ workspaceRevision: summary.workspaceRevision,
24821
+ updatedAt: summary.updatedAt,
24822
+ objective: clip(summary.objective),
24823
+ status: summary.status,
24824
+ closure: closure && {
24825
+ outcome: closure.outcome,
24826
+ at: closure.at,
24827
+ summary: clip(closure.summary)
24828
+ },
24829
+ progress: {
24830
+ summary: clip(progress.summary),
24831
+ nextAction: next && clip(next),
24832
+ blockers: progress.blockers.slice(0, BRIEF_BLOCKERS).map((item) => ({
24833
+ reason: clip(item.reason),
24834
+ dependentAction: clip(item.dependentAction)
24835
+ }))
24836
+ },
24837
+ requirements: { total: summary.requirements.length, unmet: unmet.length, open },
24838
+ truncated: false
24839
+ };
24840
+ brief.truncated = JSON.stringify(brief).includes("…") || progress.blockers.length > BRIEF_BLOCKERS || unmet.length > BRIEF_OPEN;
24841
+ return brief;
24842
+ }
24843
+ function briefInspectResult(request, result) {
24844
+ const { action, view } = request ?? {};
24845
+ return result.ok && action === "inspect" && (view ?? "summary") === "summary" ? { ...result, data: boundTaskSummary(result.data) } : result;
24846
+ }
24793
24847
 
24794
24848
  // packages/workit-core/src/core/methods.ts
24795
24849
  var METHODS = {
@@ -25092,6 +25146,7 @@ var LAUNCHERS = new Set([
25092
25146
  "sudo",
25093
25147
  "command"
25094
25148
  ]);
25149
+ var PACKAGE_RUNNERS = new Set(["npx", "bunx", "pnpx"]);
25095
25150
  var PUSH_VALUE_OPTIONS = new Set(["-o", "--push-option", "--receive-pack", "--exec", "--repo"]);
25096
25151
  var VALUE_OPTIONS = {
25097
25152
  git: new Set([
@@ -26050,6 +26105,15 @@ class WorkitCore {
26050
26105
  if (!parsed.ok)
26051
26106
  return parsed;
26052
26107
  const input = parsed.data;
26108
+ if (this.context.readOnlyChild) {
26109
+ if (input.action !== "inspect")
26110
+ return failure2("permission_denied", "child sessions can only inspect the task summary");
26111
+ const task = this.store.readTask(input.taskId);
26112
+ if (!task.ok)
26113
+ return task;
26114
+ const summary = this.summary(task.data);
26115
+ return summary.ok ? { ...summary, data: boundTaskSummary(summary.data) } : summary;
26116
+ }
26053
26117
  if ((this.context.workerId ?? null) !== null) {
26054
26118
  if (input.action !== "inspect" && input.action !== "list")
26055
26119
  return failure2("permission_denied", "helpers cannot control task lifecycle or scope");
@@ -28487,7 +28551,8 @@ function createMcpServer(host, contextProvider) {
28487
28551
  }, workspaceRoot);
28488
28552
  const core = new WorkitCore(new TaskStore(context.root), context);
28489
28553
  const run = core[family];
28490
- return resultForClient(run.call(core, parsed.data), workspaceRoot);
28554
+ const result = run.call(core, parsed.data);
28555
+ return resultForClient(family === "task" && context.callerAttested !== true ? briefInspectResult(parsed.data, result) : result, workspaceRoot);
28491
28556
  } catch (error) {
28492
28557
  return thrownResult(toolName, error, workspaceRoot);
28493
28558
  }
@@ -28560,6 +28625,129 @@ var capabilitiesFor = (descriptor, observed = {}) => descriptor.capabilities.map
28560
28625
  var signals = new Map;
28561
28626
  var cache = new Map;
28562
28627
  var TURN_TTL_MS = 7 * 24 * 60 * 60 * 1000;
28628
+ // packages/workit-core/src/core/heavy.ts
28629
+ var INFO_FLAGS = new Set(["--version", "-v", "-V", "--help", "-h", "help", "version"]);
28630
+ var sub = (...names) => new Set(names);
28631
+ var TOOLS = {
28632
+ jest: "any",
28633
+ vitest: "any",
28634
+ mocha: "any",
28635
+ ava: "any",
28636
+ tap: "any",
28637
+ karma: "any",
28638
+ jasmine: "any",
28639
+ nyc: "any",
28640
+ c8: "any",
28641
+ tsc: "any",
28642
+ "vue-tsc": "any",
28643
+ "svelte-check": "any",
28644
+ eslint: "any",
28645
+ stylelint: "any",
28646
+ tslint: "any",
28647
+ webpack: "any",
28648
+ "webpack-cli": "any",
28649
+ rollup: "any",
28650
+ parcel: "any",
28651
+ tsup: "any",
28652
+ vite: sub("build", "optimize"),
28653
+ next: sub("build", "lint"),
28654
+ nuxt: sub("build", "generate"),
28655
+ nuxi: sub("build", "generate"),
28656
+ astro: sub("build", "check"),
28657
+ ng: sub("build", "b", "test", "t", "e2e", "lint"),
28658
+ "react-scripts": sub("build", "test"),
28659
+ playwright: sub("test", "install"),
28660
+ cypress: sub("run"),
28661
+ wdio: "any",
28662
+ testcafe: "any",
28663
+ turbo: "any",
28664
+ lerna: sub("run", "exec", "bootstrap"),
28665
+ "sonar-scanner": "any",
28666
+ sonarless: sub("scan"),
28667
+ "sonarless-mcp": sub("scan"),
28668
+ go: sub("test", "build", "vet", "install", "generate"),
28669
+ "golangci-lint": sub("run"),
28670
+ gotestsum: "any",
28671
+ staticcheck: "any",
28672
+ cargo: sub("build", "b", "test", "t", "check", "c", "clippy", "bench", "nextest", "doc", "install", "tarpaulin", "llvm-cov"),
28673
+ mvn: "any",
28674
+ mvnw: "any",
28675
+ gradle: "any",
28676
+ gradlew: "any",
28677
+ ant: "any",
28678
+ sbt: "any",
28679
+ bazel: sub("build", "test", "run", "coverage"),
28680
+ bazelisk: sub("build", "test", "run", "coverage"),
28681
+ buck2: sub("build", "test", "run"),
28682
+ dotnet: sub("build", "test", "publish", "restore", "pack", "msbuild"),
28683
+ msbuild: "any",
28684
+ pytest: "any",
28685
+ "py.test": "any",
28686
+ tox: "any",
28687
+ nox: "any",
28688
+ mypy: "any",
28689
+ pyright: "any",
28690
+ pylint: "any",
28691
+ coverage: sub("run"),
28692
+ maturin: sub("build", "develop"),
28693
+ pip: sub("install", "wheel"),
28694
+ pip3: sub("install", "wheel"),
28695
+ rspec: "any",
28696
+ rails: sub("test", "assets:precompile"),
28697
+ phpunit: "any",
28698
+ pest: "any",
28699
+ phpstan: "any",
28700
+ psalm: "any",
28701
+ composer: sub("install", "update", "require", "test"),
28702
+ mix: sub("test", "compile", "deps.get", "dialyzer", "credo"),
28703
+ swift: sub("build", "test"),
28704
+ xcodebuild: "any",
28705
+ flutter: sub("build", "test"),
28706
+ dart: sub("test", "compile"),
28707
+ pod: sub("install"),
28708
+ cmake: sub("--build"),
28709
+ ninja: "any",
28710
+ meson: sub("compile", "test"),
28711
+ ctest: "any",
28712
+ scons: "any",
28713
+ "docker-compose": sub("build"),
28714
+ buildah: sub("bud", "build"),
28715
+ earthly: "any"
28716
+ };
28717
+ var PM_VALUES = new Set([
28718
+ "--prefix",
28719
+ "-w",
28720
+ "--workspace",
28721
+ "-C",
28722
+ "--dir",
28723
+ "--filter",
28724
+ "-F",
28725
+ "--cwd",
28726
+ "-p",
28727
+ "--package",
28728
+ "--cache",
28729
+ "--registry"
28730
+ ]);
28731
+ var NPM_INSTALL = new Set([
28732
+ "ci",
28733
+ "clean-install",
28734
+ "cit",
28735
+ "install-test",
28736
+ "it",
28737
+ "install",
28738
+ "i",
28739
+ "in",
28740
+ "add",
28741
+ "rebuild",
28742
+ "update",
28743
+ "up"
28744
+ ]);
28745
+ var NPM_RUN = new Set(["run", "run-script", "rum", "urn"]);
28746
+ var NPM_TEST = new Set(["test", "t", "tst"]);
28747
+ var EXEC = new Set(["exec", "x", "dlx"]);
28748
+
28749
+ // packages/workit-core/src/core/heavy-words.ts
28750
+ var HEAVY_WORDS = new Set(("npm npx pnpm pnpx yarn bun bunx deno corepack make gmake docker podman nerdctl " + "python python3 py uv poetry pdm pipenv hatch rye bundle rake nx " + "jest vitest mocha ava tap karma jasmine nyc c8 tsc vue-tsc svelte-check eslint stylelint " + "tslint webpack webpack-cli rollup parcel tsup vite next nuxt nuxi astro ng react-scripts " + "playwright cypress wdio testcafe turbo lerna sonar-scanner sonarless sonarless-mcp go " + "golangci-lint gotestsum staticcheck cargo mvn mvnw gradle gradlew ant sbt bazel bazelisk " + "buck2 dotnet msbuild pytest py.test tox nox mypy pyright pylint coverage maturin pip pip3 " + "rspec rails phpunit pest phpstan psalm composer mix swift xcodebuild flutter dart pod cmake " + "ninja meson ctest scons docker-compose buildah earthly").split(" "));
28563
28751
  // packages/workit-core/src/core/live-session.ts
28564
28752
  import { spawnSync as spawnSync15 } from "node:child_process";
28565
28753
  var LIVE_SESSION_TTL_MS = 15 * 60000;
@@ -28573,6 +28761,7 @@ var PIDS = new Map;
28573
28761
  // packages/workit-core/src/hooks/write-gate.ts
28574
28762
  var CASE_INSENSITIVE = process.platform === "darwin" || process.platform === "win32";
28575
28763
  var PREFIXES2 = new Set(["sudo", "command", "env", "nohup", "time", "exec", "xargs"]);
28764
+ var SCRIPT_SHELLS = new Set(["sh", "bash", "zsh", "dash", "ksh"]);
28576
28765
  var cache2 = new Map;
28577
28766
  var MUTATING_GIT = new Set([
28578
28767
  "add",
@@ -28676,7 +28865,7 @@ var CURSOR_DESCRIPTOR = {
28676
28865
  "compact.pre": { support: "partial", native: "preCompact" },
28677
28866
  stop: { support: "native", native: "stop" }
28678
28867
  },
28679
- shellPolicy: { deny: "native", channel: "exit2+json", failClosed: false },
28868
+ shellPolicy: { deny: "native", channel: "exit2+json", failClosed: false, rewrite: "none" },
28680
28869
  context: {
28681
28870
  sessionStart: "native",
28682
28871
  perTurn: "none",