@brainervirus/workit-cli 8.15.1 → 8.16.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.
Files changed (2) hide show
  1. package/dist/index.js +60 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -65,7 +65,7 @@ var package_default;
65
65
  var init_package = __esm(() => {
66
66
  package_default = {
67
67
  name: "@brainervirus/workit-cli",
68
- version: "8.15.1",
68
+ version: "8.16.0",
69
69
  private: false,
70
70
  description: "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
71
71
  keywords: [
@@ -103,13 +103,13 @@ var init_package = __esm(() => {
103
103
  },
104
104
  dependencies: {
105
105
  "@babel/parser": "7.29.9",
106
- "@brainervirus/workit-cursor": "^8.15.1",
106
+ "@brainervirus/workit-cursor": "^8.16.0",
107
107
  "@inkjs/ui": "2.0.0",
108
108
  ink: "7.1.1",
109
109
  react: "19.2.8"
110
110
  },
111
111
  devDependencies: {
112
- "@brainervirus/workit-core": "^8.15.1"
112
+ "@brainervirus/workit-core": "^8.16.0"
113
113
  },
114
114
  engines: {
115
115
  node: ">=24"
@@ -16901,6 +16901,42 @@ function evaluateClosure(requestedOutcome, view) {
16901
16901
  requirementIds: evaluations.map((item) => item.requirementId)
16902
16902
  });
16903
16903
  }
16904
+ function boundTaskSummary(summary) {
16905
+ const rules = new Map((summary.policy?.requirements ?? []).map((item) => [item.id, item]));
16906
+ const unmet = summary.requirements.filter((item) => item.status === "unsatisfied" || item.status === "unavailable");
16907
+ const { progress, closure } = summary;
16908
+ const next = progress.nextAction;
16909
+ const open = unmet.slice(0, BRIEF_OPEN).map((item) => ({
16910
+ dimension: rules.get(item.requirementId)?.dimension ?? "verification",
16911
+ before: rules.get(item.requirementId)?.before ?? "close",
16912
+ status: item.status
16913
+ }));
16914
+ const brief = {
16915
+ id: summary.id,
16916
+ revision: summary.revision,
16917
+ workspaceRevision: summary.workspaceRevision,
16918
+ updatedAt: summary.updatedAt,
16919
+ objective: clip(summary.objective),
16920
+ status: summary.status,
16921
+ closure: closure && {
16922
+ outcome: closure.outcome,
16923
+ at: closure.at,
16924
+ summary: clip(closure.summary)
16925
+ },
16926
+ progress: {
16927
+ summary: clip(progress.summary),
16928
+ nextAction: next && clip(next),
16929
+ blockers: progress.blockers.slice(0, BRIEF_BLOCKERS).map((item) => ({
16930
+ reason: clip(item.reason),
16931
+ dependentAction: clip(item.dependentAction)
16932
+ }))
16933
+ },
16934
+ requirements: { total: summary.requirements.length, unmet: unmet.length, open },
16935
+ truncated: false
16936
+ };
16937
+ brief.truncated = JSON.stringify(brief).includes("…") || progress.blockers.length > BRIEF_BLOCKERS || unmet.length > BRIEF_OPEN;
16938
+ return brief;
16939
+ }
16904
16940
  var digestBytes = (value) => createHash10("sha256").update(value).digest("hex"), inside = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path17.sep}`), relative = (root, candidate) => path17.relative(root, candidate).split(path17.sep).join("/") || ".", canonicalPath = (value) => {
16905
16941
  if (typeof value !== "string" || !value)
16906
16942
  return null;
@@ -17120,7 +17156,15 @@ var digestBytes = (value) => createHash10("sha256").update(value).digest("hex"),
17120
17156
  if (dimension === "decisions")
17121
17157
  return "decision";
17122
17158
  return "worker report";
17123
- }, observedGate = (requirement) => (requirement.dimension === "testing" || requirement.dimension === "verification") && requirement.before === "close";
17159
+ }, observedGate = (requirement) => (requirement.dimension === "testing" || requirement.dimension === "verification") && requirement.before === "close", BRIEF_TEXT = 250, BRIEF_BLOCKERS = 3, BRIEF_OPEN = 8, clip = (value) => {
17160
+ const fits = (text) => Buffer.byteLength(JSON.stringify(text)) <= BRIEF_TEXT;
17161
+ if (fits(value))
17162
+ return value;
17163
+ let length = Math.min(value.length, BRIEF_TEXT);
17164
+ while (length > 0 && !fits(`${value.slice(0, length)}…`))
17165
+ length -= 1;
17166
+ return `${value.slice(0, length)}…`;
17167
+ };
17124
17168
  var init_task_evaluation = __esm(() => {
17125
17169
  init_task_contract();
17126
17170
  init_check_config();
@@ -18381,6 +18425,15 @@ class WorkitCore {
18381
18425
  if (!parsed.ok)
18382
18426
  return parsed;
18383
18427
  const input = parsed.data;
18428
+ if (this.context.readOnlyChild) {
18429
+ if (input.action !== "inspect")
18430
+ return failure2("permission_denied", "child sessions can only inspect the task summary");
18431
+ const task = this.store.readTask(input.taskId);
18432
+ if (!task.ok)
18433
+ return task;
18434
+ const summary = this.summary(task.data);
18435
+ return summary.ok ? { ...summary, data: boundTaskSummary(summary.data) } : summary;
18436
+ }
18384
18437
  if ((this.context.workerId ?? null) !== null) {
18385
18438
  if (input.action !== "inspect" && input.action !== "list")
18386
18439
  return failure2("permission_denied", "helpers cannot control task lifecycle or scope");
@@ -20803,6 +20856,8 @@ async function runTaskCommand(argv, deps = {}) {
20803
20856
  }
20804
20857
  } else
20805
20858
  result = dispatch(core, parsed.parsed.family, parsed.parsed.request);
20859
+ if (result.ok && parsed.parsed.family === "task" && parsed.parsed.action === "inspect" && (parsed.parsed.request.view ?? "summary") === "summary")
20860
+ result = { ...result, data: boundTaskSummary(result.data) };
20806
20861
  if (parsed.parsed.family === "policy" && parsed.parsed.action === "assess")
20807
20862
  result = withRequirementStatus(core, result, parsed.parsed.request.taskId);
20808
20863
  if (parsed.parsed.json)
@@ -20865,6 +20920,7 @@ var init_task = __esm(() => {
20865
20920
  init_task_store();
20866
20921
  init_core3();
20867
20922
  init_task_contract();
20923
+ init_task_evaluation();
20868
20924
  TASK_FAMILIES = OPERATION_FAMILIES;
20869
20925
  TASK_ACTIONS = {
20870
20926
  task: ["start", "list", "inspect", "revise", "progress", "pause", "resume", "close"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-cli",
3
- "version": "8.15.1",
3
+ "version": "8.16.0",
4
4
  "private": false,
5
5
  "description": "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
6
6
  "keywords": [
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@babel/parser": "7.29.9",
41
- "@brainervirus/workit-cursor": "^8.15.1",
41
+ "@brainervirus/workit-cursor": "^8.16.0",
42
42
  "@inkjs/ui": "2.0.0",
43
43
  "ink": "7.1.1",
44
44
  "react": "19.2.8"
45
45
  },
46
46
  "devDependencies": {
47
- "@brainervirus/workit-core": "^8.15.1"
47
+ "@brainervirus/workit-core": "^8.16.0"
48
48
  },
49
49
  "engines": {
50
50
  "node": ">=24"