@brainervirus/workit-codex 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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "8.15.1",
3
+ "version": "8.16.0",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -22409,6 +22409,58 @@ function evaluateClosure(requestedOutcome, view) {
22409
22409
  requirementIds: evaluations.map((item) => item.requirementId)
22410
22410
  });
22411
22411
  }
22412
+ var BRIEF_TEXT = 250;
22413
+ var BRIEF_BLOCKERS = 3;
22414
+ var BRIEF_OPEN = 8;
22415
+ var clip = (value) => {
22416
+ const fits = (text) => Buffer.byteLength(JSON.stringify(text)) <= BRIEF_TEXT;
22417
+ if (fits(value))
22418
+ return value;
22419
+ let length = Math.min(value.length, BRIEF_TEXT);
22420
+ while (length > 0 && !fits(`${value.slice(0, length)}…`))
22421
+ length -= 1;
22422
+ return `${value.slice(0, length)}…`;
22423
+ };
22424
+ function boundTaskSummary(summary) {
22425
+ const rules = new Map((summary.policy?.requirements ?? []).map((item) => [item.id, item]));
22426
+ const unmet = summary.requirements.filter((item) => item.status === "unsatisfied" || item.status === "unavailable");
22427
+ const { progress, closure } = summary;
22428
+ const next = progress.nextAction;
22429
+ const open = unmet.slice(0, BRIEF_OPEN).map((item) => ({
22430
+ dimension: rules.get(item.requirementId)?.dimension ?? "verification",
22431
+ before: rules.get(item.requirementId)?.before ?? "close",
22432
+ status: item.status
22433
+ }));
22434
+ const brief = {
22435
+ id: summary.id,
22436
+ revision: summary.revision,
22437
+ workspaceRevision: summary.workspaceRevision,
22438
+ updatedAt: summary.updatedAt,
22439
+ objective: clip(summary.objective),
22440
+ status: summary.status,
22441
+ closure: closure && {
22442
+ outcome: closure.outcome,
22443
+ at: closure.at,
22444
+ summary: clip(closure.summary)
22445
+ },
22446
+ progress: {
22447
+ summary: clip(progress.summary),
22448
+ nextAction: next && clip(next),
22449
+ blockers: progress.blockers.slice(0, BRIEF_BLOCKERS).map((item) => ({
22450
+ reason: clip(item.reason),
22451
+ dependentAction: clip(item.dependentAction)
22452
+ }))
22453
+ },
22454
+ requirements: { total: summary.requirements.length, unmet: unmet.length, open },
22455
+ truncated: false
22456
+ };
22457
+ brief.truncated = JSON.stringify(brief).includes("…") || progress.blockers.length > BRIEF_BLOCKERS || unmet.length > BRIEF_OPEN;
22458
+ return brief;
22459
+ }
22460
+ function briefInspectResult(request, result) {
22461
+ const { action, view } = request ?? {};
22462
+ return result.ok && action === "inspect" && (view ?? "summary") === "summary" ? { ...result, data: boundTaskSummary(result.data) } : result;
22463
+ }
22412
22464
 
22413
22465
  // packages/workit-core/src/core/methods.ts
22414
22466
  var METHODS = {
@@ -23669,6 +23721,15 @@ class WorkitCore {
23669
23721
  if (!parsed.ok)
23670
23722
  return parsed;
23671
23723
  const input = parsed.data;
23724
+ if (this.context.readOnlyChild) {
23725
+ if (input.action !== "inspect")
23726
+ return failure2("permission_denied", "child sessions can only inspect the task summary");
23727
+ const task = this.store.readTask(input.taskId);
23728
+ if (!task.ok)
23729
+ return task;
23730
+ const summary = this.summary(task.data);
23731
+ return summary.ok ? { ...summary, data: boundTaskSummary(summary.data) } : summary;
23732
+ }
23672
23733
  if ((this.context.workerId ?? null) !== null) {
23673
23734
  if (input.action !== "inspect" && input.action !== "list")
23674
23735
  return failure2("permission_denied", "helpers cannot control task lifecycle or scope");
@@ -28494,7 +28555,8 @@ function createMcpServer(host, contextProvider) {
28494
28555
  }, workspaceRoot);
28495
28556
  const core = new WorkitCore(new TaskStore(context.root), context);
28496
28557
  const run = core[family];
28497
- return resultForClient(run.call(core, parsed.data), workspaceRoot);
28558
+ const result = run.call(core, parsed.data);
28559
+ return resultForClient(family === "task" && context.callerAttested !== true ? briefInspectResult(parsed.data, result) : result, workspaceRoot);
28498
28560
  } catch (error) {
28499
28561
  return thrownResult(toolName, error, workspaceRoot);
28500
28562
  }
@@ -15370,6 +15370,54 @@ function evaluateClosure(requestedOutcome, view) {
15370
15370
  requirementIds: evaluations.map((item) => item.requirementId)
15371
15371
  });
15372
15372
  }
15373
+ var BRIEF_TEXT = 250;
15374
+ var BRIEF_BLOCKERS = 3;
15375
+ var BRIEF_OPEN = 8;
15376
+ var clip = (value) => {
15377
+ const fits = (text) => Buffer.byteLength(JSON.stringify(text)) <= BRIEF_TEXT;
15378
+ if (fits(value))
15379
+ return value;
15380
+ let length = Math.min(value.length, BRIEF_TEXT);
15381
+ while (length > 0 && !fits(`${value.slice(0, length)}…`))
15382
+ length -= 1;
15383
+ return `${value.slice(0, length)}…`;
15384
+ };
15385
+ function boundTaskSummary(summary) {
15386
+ const rules = new Map((summary.policy?.requirements ?? []).map((item) => [item.id, item]));
15387
+ const unmet = summary.requirements.filter((item) => item.status === "unsatisfied" || item.status === "unavailable");
15388
+ const { progress, closure } = summary;
15389
+ const next = progress.nextAction;
15390
+ const open = unmet.slice(0, BRIEF_OPEN).map((item) => ({
15391
+ dimension: rules.get(item.requirementId)?.dimension ?? "verification",
15392
+ before: rules.get(item.requirementId)?.before ?? "close",
15393
+ status: item.status
15394
+ }));
15395
+ const brief = {
15396
+ id: summary.id,
15397
+ revision: summary.revision,
15398
+ workspaceRevision: summary.workspaceRevision,
15399
+ updatedAt: summary.updatedAt,
15400
+ objective: clip(summary.objective),
15401
+ status: summary.status,
15402
+ closure: closure && {
15403
+ outcome: closure.outcome,
15404
+ at: closure.at,
15405
+ summary: clip(closure.summary)
15406
+ },
15407
+ progress: {
15408
+ summary: clip(progress.summary),
15409
+ nextAction: next && clip(next),
15410
+ blockers: progress.blockers.slice(0, BRIEF_BLOCKERS).map((item) => ({
15411
+ reason: clip(item.reason),
15412
+ dependentAction: clip(item.dependentAction)
15413
+ }))
15414
+ },
15415
+ requirements: { total: summary.requirements.length, unmet: unmet.length, open },
15416
+ truncated: false
15417
+ };
15418
+ brief.truncated = JSON.stringify(brief).includes("…") || progress.blockers.length > BRIEF_BLOCKERS || unmet.length > BRIEF_OPEN;
15419
+ return brief;
15420
+ }
15373
15421
 
15374
15422
  // packages/workit-core/src/core/task-engine.ts
15375
15423
  import { realpathSync as realpathSync4 } from "node:fs";
@@ -16756,6 +16804,15 @@ class WorkitCore {
16756
16804
  if (!parsed.ok)
16757
16805
  return parsed;
16758
16806
  const input = parsed.data;
16807
+ if (this.context.readOnlyChild) {
16808
+ if (input.action !== "inspect")
16809
+ return failure2("permission_denied", "child sessions can only inspect the task summary");
16810
+ const task = this.store.readTask(input.taskId);
16811
+ if (!task.ok)
16812
+ return task;
16813
+ const summary = this.summary(task.data);
16814
+ return summary.ok ? { ...summary, data: boundTaskSummary(summary.data) } : summary;
16815
+ }
16759
16816
  if ((this.context.workerId ?? null) !== null) {
16760
16817
  if (input.action !== "inspect" && input.action !== "list")
16761
16818
  return failure2("permission_denied", "helpers cannot control task lifecycle or scope");
@@ -37,6 +37,6 @@ if (quiet)
37
37
  process.stdout.write(`${JSON.stringify({ hookSpecificOutput: { hookEventName: quiet } })}
38
38
  `);
39
39
  else {
40
- const { runCodexHook } = await import("./workit-hook-v4a1y79w.js");
40
+ const { runCodexHook } = await import("./workit-hook-71xrmyzh.js");
41
41
  await runCodexHook([payload]);
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-codex",
3
- "version": "8.15.1",
3
+ "version": "8.16.0",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -39,8 +39,8 @@
39
39
  "build": "bun scripts/build.ts"
40
40
  },
41
41
  "devDependencies": {
42
- "@brainervirus/workit-core": "^8.15.1",
43
- "@brainervirus/workit-mcp": "^8.15.1"
42
+ "@brainervirus/workit-core": "^8.16.0",
43
+ "@brainervirus/workit-mcp": "^8.16.0"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=24"