@workit-dev/opencode 1.5.0 → 1.5.1

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/plugin.js +32 -45
  2. package/package.json +2 -2
package/dist/plugin.js CHANGED
@@ -16677,12 +16677,11 @@ function checkVerdictsOnce(cwd, branch, ledgerRows) {
16677
16677
  }
16678
16678
  return reasons;
16679
16679
  };
16680
- const retired = new Set;
16680
+ const voided = verdictVoids(rows, { chained: true });
16681
+ const retired = new Set(voided.keys());
16681
16682
  for (const row of rows)
16682
- if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && trustReasons(cwd, row).length === 0)
16683
+ if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && !voided.has(row.id) && trustReasons(cwd, row).length === 0)
16683
16684
  retired.add(row.supersedes);
16684
- for (const id of verdictVoids(rows, { chained: true }).keys())
16685
- retired.add(id);
16686
16685
  const byKind = new Map;
16687
16686
  for (const row of rows.toSorted(byRank))
16688
16687
  if (isLiveVerdict(row, retired) && scope(row)) {
@@ -26959,40 +26958,37 @@ var SKILL_HOST = {
26959
26958
  };
26960
26959
  var PROMPT_INTENTS = [
26961
26960
  [
26962
- "workit-debug",
26963
- /\b(flaky|regressed|(?:is|introduced) a regression|regression (?:in|after|since|from)|(?:is|are|got|looks) broken|debug (?:this|it|the|why)|fix (?:the|this|a) bug)\b/i
26961
+ "debug",
26962
+ /\b(flaky|regressed|(is|introduced) a regression|regression (in|after|since|from)|(is|are|got|looks) broken|debug (this|it|the|why)|fix (the|this|a) bug)\b/i
26964
26963
  ],
26965
26964
  [
26966
- "workit-continue",
26967
- /\b(pick up where|where (?:were|did) we|resume (?:the|this|my|our|work|where)|hand ?off)\b/i
26965
+ "continue",
26966
+ /\b(pick up where|where (were|did) we|resume (the|this|my|our|work|where)|hand ?off)\b/i
26968
26967
  ],
26969
26968
  [
26970
- "workit-review",
26971
- /\b(blast radius|code review|review (?:the|this|my|PR|pr|#\d+|branch|diff|changes))\b/i
26969
+ "review",
26970
+ /\b(blast radius|code review|review (the|this|my|PR|pr|#\d+|branch|diff|changes))\b/i
26972
26971
  ],
26973
26972
  [
26974
- "workit-ship",
26975
- /\b(ship (?:it|this|the)|babysit|open (?:a|the) (?:PR|pr|MR|mr)(?=\s*$|\s+(?:for|to|on|with|and|against|into|from|after|once)\b|[.!,;])|merge (?:the|this|my) (?:PR|pr|MR|mr|branch)|(?:get|until|make) CI (?:is )?green)\b/i
26973
+ "ship",
26974
+ /\b(ship (it|this|the)|babysit|open (a|the) (PR|pr|MR|mr)(?=\s*$|\s+(for|to|on|with|and|against|into|from|after|once)\b|[.!,;])|merge (the|this|my) (PR|pr|MR|mr|branch)|(get|until|make) CI (is )?green)\b/i
26976
26975
  ],
26977
- ["workit-bdd", /\b(BDD|TDD|acceptance criteria|Given\/When\/Then)(?![\w/])/],
26978
- ["workit-test-audit", /\b(test audit|audit the tests|tautolog\w*|weak tests)\b/i],
26979
- ["workit-deslop", /\b(deslop|slop|dead code)\b/i],
26976
+ ["bdd", /\b(BDD|TDD|acceptance criteria|Given\/When\/Then)(?![\w/])/],
26977
+ ["test-audit", /\b(test audit|audit the tests|tautolog\w*|weak tests)\b/i],
26978
+ ["deslop", /\b(deslop|slop|dead code)\b/i],
26979
+ ["fanout", /\b(fan( |-)?out|parallelize|parallel agents|agent swarm|swarm of agents)\b/i],
26980
+ ["verify-app", /\b(verify the app|smoke test|prove it works)\b/i],
26981
+ ["retro", /\b((a|the) retro(?![-\w]|\.\w)|retrospective)/i],
26982
+ ["architecture", /\b(deepen (the )?modules|architecture (review|pass|audit))\b/i],
26980
26983
  [
26981
- "workit-fanout",
26982
- /\b(fan(?: |-)?out|parallelize|parallel agents|agent swarm|swarm of agents)\b/i
26984
+ "shape",
26985
+ /\b(brainstorm\w*|grill me|should we|let'?s plan|plan (out|how|the|a|for)|(write|draft) (a|the) spec)\b/i
26983
26986
  ],
26984
- ["workit-verify-app", /\b(verify the app|smoke test|prove it works)\b/i],
26985
- ["workit-retro", /\b((?:a|the) retro(?![-\w]|\.\w)|retrospective)/i],
26986
- ["workit-architecture", /\b(deepen (?:the )?modules|architecture (?:review|pass|audit))\b/i],
26987
26987
  [
26988
- "workit-shape",
26989
- /\b(brainstorm\w*|grill me|should we|let'?s plan|plan (?:out|how|the|a|for)|(?:write|draft) (?:a|the) spec)\b/i
26990
- ],
26991
- [
26992
- "workit-implement",
26993
- /\b(implement (?:the|this|a|it)|add (?:a|the) feature|build (?:a|an|the) (?:new )?(?:feature|command|verb|page|endpoint|component|cli|tool))\b/i
26988
+ "implement",
26989
+ /\b(implement (the|this|a|it)|add (a|the) feature|build (a|an|the) (new )?(feature|command|verb|page|endpoint|component|cli|tool))\b/i
26994
26990
  ]
26995
- ];
26991
+ ].map(([name, pattern]) => [`workit-${name}`, pattern]);
26996
26992
  var workitSkillOf = (name) => {
26997
26993
  const bare = name.trim().replace(/^\//, "").toLowerCase();
26998
26994
  const alias = WORKIT_SKILL_ALIASES[bare];
@@ -27001,10 +26997,13 @@ var workitSkillOf = (name) => {
27001
26997
  const skill = bare.replace(/^workit:/, "workit-");
27002
26998
  return WORKIT_METHOD_SKILLS.includes(skill) ? skill : null;
27003
26999
  };
27000
+ var QUOTED = /```[\s\S]*?```|["`“][^"`”\n]*["`”]|\B'[^'\n]*'\B/g;
27001
+ var COMPLAINT = /\b(why \w+ you|you keep|stop \w+ing)\b.*?(?=\b(and|but)\b|[?.,;\n]|$)/gi;
27004
27002
  var promptTrigger = (prompt) => {
27005
- const text = prompt.replace(/```[\s\S]*?```/g, " ").slice(0, 4000);
27003
+ let asking = false;
27004
+ const text = prompt.slice(0, 4000).replace(QUOTED, " ").replace(COMPLAINT, (clause) => (asking ||= /ask|quest/i.test(clause), " "));
27006
27005
  for (const [skill, pattern] of PROMPT_INTENTS) {
27007
- const match = pattern.exec(text);
27006
+ const match = !(asking && skill === "workit-shape") && pattern.exec(text);
27008
27007
  if (match)
27009
27008
  return { skill, trigger: match[1] ?? match[0] };
27010
27009
  }
@@ -27020,19 +27019,7 @@ var loadedSkills = (cwd, session) => {
27020
27019
  loaded.add(row.skill);
27021
27020
  return loaded;
27022
27021
  };
27023
- var READERS = new Set([
27024
- "cat",
27025
- "sed",
27026
- "head",
27027
- "tail",
27028
- "less",
27029
- "more",
27030
- "bat",
27031
- "nl",
27032
- "get-content",
27033
- "gc",
27034
- "type"
27035
- ]);
27022
+ var READERS = new Set("cat sed head tail less more bat nl get-content gc type".split(" "));
27036
27023
  function recordSkillLoad(input, name, via) {
27037
27024
  try {
27038
27025
  const skill = workitSkillOf(name);
@@ -27070,9 +27057,9 @@ var nudgeOnce = (input, session, skill, line) => {
27070
27057
  writeSessionMarker(file, { ...marker, nudged: [...marker.nudged, skill] });
27071
27058
  return line;
27072
27059
  };
27073
- var nudgeText = (input, skill, why) => USER_INVOKED.has(skill) ? `Workit: ${why} looks like ${skill} work, which the user starts; offer it (/${skill.replace(/^workit-/, "wk-")}) rather than loading it.` : `Workit: ${why} looks like ${skill} work; if it is, ${skillLoadWording(SKILL_HOST[input.host], skill)} first.`;
27060
+ var nudgeText = (input, skill, why) => `Workit: ${why} looks like ${skill} work${USER_INVOKED.has(skill) ? `, which the user starts; offer it (/${skill.replace(/^workit-/, "wk-")}) rather than loading it.` : `; if it is, ${skillLoadWording(SKILL_HOST[input.host], skill)} first.`}`;
27074
27061
  var promptLoads = (prompt) => /^\s*\/(?:skill:)?([\w:-]+)/.exec(prompt)?.[1] ?? /^\s*<skill name="([\w:-]+)"/.exec(prompt)?.[1] ?? /^\s*Load the (workit-[a-z-]+) skill with the skill tool\b/.exec(prompt)?.[1] ?? null;
27075
- var relayedMessage = (prompt) => /^\s*(?:Another Claude session sent a message\b|<agent-message\s+from=|\[SYSTEM NOTIFICATION\b|<task-notification>)/.test(prompt);
27062
+ var relayedMessage = (prompt) => /^\s*(Another Claude session sent a message\b|<agent-message\s+from=|\[SYSTEM NOTIFICATION\b|<task-notification>)/.test(prompt);
27076
27063
  function promptNudge(input, prompt) {
27077
27064
  try {
27078
27065
  const session = input.session.id;
@@ -27091,7 +27078,7 @@ function promptNudge(input, prompt) {
27091
27078
  return null;
27092
27079
  }
27093
27080
  }
27094
- var WORKIT_DELIVERY = /^(?:pr (?:create|merge)|ci wait|git push)\b/;
27081
+ var WORKIT_DELIVERY = /^(pr (create|merge)|ci wait|git push)\b/;
27095
27082
  var runsWorkitDelivery = (command, dialect) => workitInvocations(command, dialect).some((args) => !args.some((arg) => arg === "--help" || arg === "-h" || arg === "--dry-run") && WORKIT_DELIVERY.test(args.join(" ")));
27096
27083
  var isDeliveryCommand = (cwd, command, dialect = "posix") => rawDelivery(cwd, command, dialect) || runsWorkitDelivery(command, dialect) && inWorkitWorkspace(cwd);
27097
27084
  function shipNudge(input, command) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/opencode",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
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": "^1.5.0"
44
+ "@workit-dev/core": "^1.5.1"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=24"