@brainervirus/workit-cursor 8.36.0 → 8.37.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.
@@ -2,7 +2,7 @@
2
2
  "name": "workit",
3
3
  "displayName": "Workit",
4
4
  "description": "Adaptive Workit workflow with shared MCP tools and native Cursor hooks",
5
- "version": "8.36.0",
5
+ "version": "8.37.0",
6
6
  "author": {
7
7
  "name": "Cristhofer Pincetti"
8
8
  },
@@ -22689,7 +22689,8 @@ function handleHook(input, deps) {
22689
22689
  const decision = decide(input, deps);
22690
22690
  if (deps.descriptor.transport !== "hook-process" || !PRE_TOOL.has(input.event.kind) || decision.kind === "deny" || decision.kind === "ask")
22691
22691
  return decision;
22692
- const delta = standingDelta(input);
22692
+ const delta = [standingDelta(input), deps.budget?.line(input) ?? null].filter(Boolean).join(`
22693
+ `) || null;
22693
22694
  if (!delta)
22694
22695
  return decision;
22695
22696
  return decision.kind === "rewrite" || decision.kind === "update-input" ? { ...decision, text: [decision.text, delta].filter(Boolean).join(`
@@ -22799,7 +22800,11 @@ function decide(input, deps) {
22799
22800
  case "subagent.start":
22800
22801
  if (workitRole(descriptor, event.agentType) === "judge")
22801
22802
  trackJudge(input, event.agentId, true);
22802
- seedStanding({ ...input, session: { ...input.session, agentId: event.agentId } });
22803
+ seedStanding({
22804
+ ...input,
22805
+ session: { ...input.session, agentId: event.agentId }
22806
+ });
22807
+ deps.budget?.start(input, event.agentId, event.agentType);
22803
22808
  return {
22804
22809
  kind: "context",
22805
22810
  text: subagentStartText(input, descriptor, event)
@@ -22812,13 +22817,19 @@ function decide(input, deps) {
22812
22817
  case "tool.pre":
22813
22818
  if (event.skill)
22814
22819
  recordSkillLoad(input, event.skill, "tool");
22815
- if (event.agentInput && input.host === "claude_code")
22816
- return spawnDecision(descriptor, input.cwd, event.agentInput);
22820
+ if (event.agentInput && input.host === "claude_code") {
22821
+ const spawn = spawnDecision(descriptor, input.cwd, event.agentInput);
22822
+ if (spawn.kind !== "deny")
22823
+ deps.budget?.spawn(input, event.agentInput);
22824
+ return spawn;
22825
+ }
22817
22826
  return NONE6;
22818
22827
  case "stop":
22819
22828
  return usable2(descriptor.events.stop.support) ? stopDecision(input, descriptor) : NONE6;
22820
22829
  case "subagent.stop":
22821
22830
  trackJudge(input, event.agentId, false);
22831
+ if (event.agentId)
22832
+ deps.budget?.stop(input, event.agentId);
22822
22833
  return NONE6;
22823
22834
  case "prompt.submit":
22824
22835
  return NONE6;
@@ -22871,7 +22882,8 @@ ${subagentStartText({ ...input, cwd: "" }, descriptor, event)}`;
22871
22882
  try {
22872
22883
  const decision = handleHook(parsed.input, {
22873
22884
  descriptor,
22874
- addendum: adapter.addendum?.(parsed.input) ?? null
22885
+ addendum: adapter.addendum?.(parsed.input) ?? null,
22886
+ budget: adapter.budget
22875
22887
  });
22876
22888
  return { ...adapter.render(decision, parsed.native), error: null };
22877
22889
  } catch (error) {
@@ -23173,7 +23185,7 @@ var init_claude_code = __esm(() => {
23173
23185
  "shell.post": { support: "native", native: "PostToolUse" },
23174
23186
  "subagent.start": { support: "native", native: "SubagentStart" },
23175
23187
  "prompt.submit": { support: "native", native: "UserPromptSubmit" },
23176
- "subagent.stop": { support: "none", native: null },
23188
+ "subagent.stop": { support: "native", native: "SubagentStop" },
23177
23189
  "compact.pre": { support: "none", native: null },
23178
23190
  stop: { support: "native", native: "Stop" }
23179
23191
  },
@@ -22955,7 +22955,8 @@ function handleHook(input, deps) {
22955
22955
  const decision = decide(input, deps);
22956
22956
  if (deps.descriptor.transport !== "hook-process" || !PRE_TOOL.has(input.event.kind) || decision.kind === "deny" || decision.kind === "ask")
22957
22957
  return decision;
22958
- const delta = standingDelta(input);
22958
+ const delta = [standingDelta(input), deps.budget?.line(input) ?? null].filter(Boolean).join(`
22959
+ `) || null;
22959
22960
  if (!delta)
22960
22961
  return decision;
22961
22962
  return decision.kind === "rewrite" || decision.kind === "update-input" ? { ...decision, text: [decision.text, delta].filter(Boolean).join(`
@@ -23065,7 +23066,11 @@ function decide(input, deps) {
23065
23066
  case "subagent.start":
23066
23067
  if (workitRole(descriptor, event.agentType) === "judge")
23067
23068
  trackJudge(input, event.agentId, true);
23068
- seedStanding({ ...input, session: { ...input.session, agentId: event.agentId } });
23069
+ seedStanding({
23070
+ ...input,
23071
+ session: { ...input.session, agentId: event.agentId }
23072
+ });
23073
+ deps.budget?.start(input, event.agentId, event.agentType);
23069
23074
  return {
23070
23075
  kind: "context",
23071
23076
  text: subagentStartText(input, descriptor, event)
@@ -23078,13 +23083,19 @@ function decide(input, deps) {
23078
23083
  case "tool.pre":
23079
23084
  if (event.skill)
23080
23085
  recordSkillLoad(input, event.skill, "tool");
23081
- if (event.agentInput && input.host === "claude_code")
23082
- return spawnDecision(descriptor, input.cwd, event.agentInput);
23086
+ if (event.agentInput && input.host === "claude_code") {
23087
+ const spawn = spawnDecision(descriptor, input.cwd, event.agentInput);
23088
+ if (spawn.kind !== "deny")
23089
+ deps.budget?.spawn(input, event.agentInput);
23090
+ return spawn;
23091
+ }
23083
23092
  return NONE6;
23084
23093
  case "stop":
23085
23094
  return usable2(descriptor.events.stop.support) ? stopDecision(input, descriptor) : NONE6;
23086
23095
  case "subagent.stop":
23087
23096
  trackJudge(input, event.agentId, false);
23097
+ if (event.agentId)
23098
+ deps.budget?.stop(input, event.agentId);
23088
23099
  return NONE6;
23089
23100
  case "prompt.submit":
23090
23101
  return NONE6;
@@ -23108,7 +23119,8 @@ var dispatchHook = (adapter, raw, env = process.env) => {
23108
23119
  try {
23109
23120
  const decision = handleHook(parsed.input, {
23110
23121
  descriptor,
23111
- addendum: adapter.addendum?.(parsed.input) ?? null
23122
+ addendum: adapter.addendum?.(parsed.input) ?? null,
23123
+ budget: adapter.budget
23112
23124
  });
23113
23125
  return { ...adapter.render(decision, parsed.native), error: null };
23114
23126
  } catch (error) {
@@ -23241,7 +23253,7 @@ var CLAUDE_CODE_DESCRIPTOR = {
23241
23253
  "shell.post": { support: "native", native: "PostToolUse" },
23242
23254
  "subagent.start": { support: "native", native: "SubagentStart" },
23243
23255
  "prompt.submit": { support: "native", native: "UserPromptSubmit" },
23244
- "subagent.stop": { support: "none", native: null },
23256
+ "subagent.stop": { support: "native", native: "SubagentStop" },
23245
23257
  "compact.pre": { support: "none", native: null },
23246
23258
  stop: { support: "native", native: "Stop" }
23247
23259
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-cursor",
3
- "version": "8.36.0",
3
+ "version": "8.37.0",
4
4
  "private": false,
5
5
  "description": "Workit Cursor plugin — shared MCP transport, native hooks, and sixteen method skills",
6
6
  "keywords": [
@@ -46,8 +46,8 @@
46
46
  "build": "bun scripts/build.ts"
47
47
  },
48
48
  "devDependencies": {
49
- "@brainervirus/workit-core": "^8.36.0",
50
- "@brainervirus/workit-mcp": "^8.36.0"
49
+ "@brainervirus/workit-core": "^8.37.0",
50
+ "@brainervirus/workit-mcp": "^8.37.0"
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=24"