@workit-dev/pi 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.
- package/dist/workit.js +39 -50
- package/package.json +1 -1
package/dist/workit.js
CHANGED
|
@@ -16474,12 +16474,11 @@ function checkVerdictsOnce(cwd, branch, ledgerRows) {
|
|
|
16474
16474
|
}
|
|
16475
16475
|
return reasons;
|
|
16476
16476
|
};
|
|
16477
|
-
const
|
|
16477
|
+
const voided = verdictVoids(rows, { chained: true });
|
|
16478
|
+
const retired = new Set(voided.keys());
|
|
16478
16479
|
for (const row of rows)
|
|
16479
|
-
if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && trustReasons(cwd, row).length === 0)
|
|
16480
|
+
if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && !voided.has(row.id) && trustReasons(cwd, row).length === 0)
|
|
16480
16481
|
retired.add(row.supersedes);
|
|
16481
|
-
for (const id of verdictVoids(rows, { chained: true }).keys())
|
|
16482
|
-
retired.add(id);
|
|
16483
16482
|
const byKind = new Map;
|
|
16484
16483
|
for (const row of rows.toSorted(byRank))
|
|
16485
16484
|
if (isLiveVerdict(row, retired) && scope(row)) {
|
|
@@ -26821,40 +26820,37 @@ var SKILL_HOST = {
|
|
|
26821
26820
|
};
|
|
26822
26821
|
var PROMPT_INTENTS = [
|
|
26823
26822
|
[
|
|
26824
|
-
"
|
|
26825
|
-
/\b(flaky|regressed|(
|
|
26823
|
+
"debug",
|
|
26824
|
+
/\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
|
|
26826
26825
|
],
|
|
26827
26826
|
[
|
|
26828
|
-
"
|
|
26829
|
-
/\b(pick up where|where (
|
|
26827
|
+
"continue",
|
|
26828
|
+
/\b(pick up where|where (were|did) we|resume (the|this|my|our|work|where)|hand ?off)\b/i
|
|
26830
26829
|
],
|
|
26831
26830
|
[
|
|
26832
|
-
"
|
|
26833
|
-
/\b(blast radius|code review|review (
|
|
26831
|
+
"review",
|
|
26832
|
+
/\b(blast radius|code review|review (the|this|my|PR|pr|#\d+|branch|diff|changes))\b/i
|
|
26834
26833
|
],
|
|
26835
26834
|
[
|
|
26836
|
-
"
|
|
26837
|
-
/\b(ship (
|
|
26835
|
+
"ship",
|
|
26836
|
+
/\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
|
|
26838
26837
|
],
|
|
26839
|
-
["
|
|
26840
|
-
["
|
|
26841
|
-
["
|
|
26838
|
+
["bdd", /\b(BDD|TDD|acceptance criteria|Given\/When\/Then)(?![\w/])/],
|
|
26839
|
+
["test-audit", /\b(test audit|audit the tests|tautolog\w*|weak tests)\b/i],
|
|
26840
|
+
["deslop", /\b(deslop|slop|dead code)\b/i],
|
|
26841
|
+
["fanout", /\b(fan( |-)?out|parallelize|parallel agents|agent swarm|swarm of agents)\b/i],
|
|
26842
|
+
["verify-app", /\b(verify the app|smoke test|prove it works)\b/i],
|
|
26843
|
+
["retro", /\b((a|the) retro(?![-\w]|\.\w)|retrospective)/i],
|
|
26844
|
+
["architecture", /\b(deepen (the )?modules|architecture (review|pass|audit))\b/i],
|
|
26842
26845
|
[
|
|
26843
|
-
"
|
|
26844
|
-
/\b(
|
|
26846
|
+
"shape",
|
|
26847
|
+
/\b(brainstorm\w*|grill me|should we|let'?s plan|plan (out|how|the|a|for)|(write|draft) (a|the) spec)\b/i
|
|
26845
26848
|
],
|
|
26846
|
-
["workit-verify-app", /\b(verify the app|smoke test|prove it works)\b/i],
|
|
26847
|
-
["workit-retro", /\b((?:a|the) retro(?![-\w]|\.\w)|retrospective)/i],
|
|
26848
|
-
["workit-architecture", /\b(deepen (?:the )?modules|architecture (?:review|pass|audit))\b/i],
|
|
26849
26849
|
[
|
|
26850
|
-
"
|
|
26851
|
-
/\b(
|
|
26852
|
-
],
|
|
26853
|
-
[
|
|
26854
|
-
"workit-implement",
|
|
26855
|
-
/\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
|
|
26850
|
+
"implement",
|
|
26851
|
+
/\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
|
|
26856
26852
|
]
|
|
26857
|
-
];
|
|
26853
|
+
].map(([name, pattern]) => [`workit-${name}`, pattern]);
|
|
26858
26854
|
var workitSkillOf = (name) => {
|
|
26859
26855
|
const bare = name.trim().replace(/^\//, "").toLowerCase();
|
|
26860
26856
|
const alias = WORKIT_SKILL_ALIASES[bare];
|
|
@@ -26863,10 +26859,13 @@ var workitSkillOf = (name) => {
|
|
|
26863
26859
|
const skill = bare.replace(/^workit:/, "workit-");
|
|
26864
26860
|
return WORKIT_METHOD_SKILLS.includes(skill) ? skill : null;
|
|
26865
26861
|
};
|
|
26862
|
+
var QUOTED = /```[\s\S]*?```|["`“][^"`”\n]*["`”]|\B'[^'\n]*'\B/g;
|
|
26863
|
+
var COMPLAINT = /\b(why \w+ you|you keep|stop \w+ing)\b.*?(?=\b(and|but)\b|[?.,;\n]|$)/gi;
|
|
26866
26864
|
var promptTrigger = (prompt) => {
|
|
26867
|
-
|
|
26865
|
+
let asking = false;
|
|
26866
|
+
const text = prompt.slice(0, 4000).replace(QUOTED, " ").replace(COMPLAINT, (clause) => (asking ||= /ask|quest/i.test(clause), " "));
|
|
26868
26867
|
for (const [skill, pattern] of PROMPT_INTENTS) {
|
|
26869
|
-
const match = pattern.exec(text);
|
|
26868
|
+
const match = !(asking && skill === "workit-shape") && pattern.exec(text);
|
|
26870
26869
|
if (match)
|
|
26871
26870
|
return { skill, trigger: match[1] ?? match[0] };
|
|
26872
26871
|
}
|
|
@@ -26884,24 +26883,12 @@ var loadedSkills = (cwd, session) => {
|
|
|
26884
26883
|
};
|
|
26885
26884
|
var SKILL_FILE = /(?:^|[\\/])(workit-[a-z-]+)[\\/]SKILL\.md$/;
|
|
26886
26885
|
var skillFileIn = (file) => SKILL_FILE.exec(file)?.[1] ?? null;
|
|
26887
|
-
var READERS = new Set(
|
|
26888
|
-
"cat",
|
|
26889
|
-
"sed",
|
|
26890
|
-
"head",
|
|
26891
|
-
"tail",
|
|
26892
|
-
"less",
|
|
26893
|
-
"more",
|
|
26894
|
-
"bat",
|
|
26895
|
-
"nl",
|
|
26896
|
-
"get-content",
|
|
26897
|
-
"gc",
|
|
26898
|
-
"type"
|
|
26899
|
-
]);
|
|
26886
|
+
var READERS = new Set("cat sed head tail less more bat nl get-content gc type".split(" "));
|
|
26900
26887
|
var skillReadIn = (command, dialect = "posix") => {
|
|
26901
26888
|
for (const { words } of segmentsOf(command, dialect)) {
|
|
26902
26889
|
if (!READERS.has((words[0]?.split(/[\\/]/).at(-1) ?? "").toLowerCase()))
|
|
26903
26890
|
continue;
|
|
26904
|
-
if (words.some((word) => /^(
|
|
26891
|
+
if (words.some((word) => /^(-i(\.\w+)?|--in-place(=.*)?)$/.test(word)))
|
|
26905
26892
|
continue;
|
|
26906
26893
|
for (const word of words.slice(1)) {
|
|
26907
26894
|
const skill = skillFileIn(word);
|
|
@@ -26948,9 +26935,9 @@ var nudgeOnce = (input, session, skill, line) => {
|
|
|
26948
26935
|
writeSessionMarker(file, { ...marker, nudged: [...marker.nudged, skill] });
|
|
26949
26936
|
return line;
|
|
26950
26937
|
};
|
|
26951
|
-
var nudgeText = (input, skill, why) =>
|
|
26938
|
+
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.`}`;
|
|
26952
26939
|
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;
|
|
26953
|
-
var relayedMessage = (prompt) => /^\s*(
|
|
26940
|
+
var relayedMessage = (prompt) => /^\s*(Another Claude session sent a message\b|<agent-message\s+from=|\[SYSTEM NOTIFICATION\b|<task-notification>)/.test(prompt);
|
|
26954
26941
|
function promptNudge(input, prompt) {
|
|
26955
26942
|
try {
|
|
26956
26943
|
const session = input.session.id;
|
|
@@ -26969,7 +26956,7 @@ function promptNudge(input, prompt) {
|
|
|
26969
26956
|
return null;
|
|
26970
26957
|
}
|
|
26971
26958
|
}
|
|
26972
|
-
var WORKIT_DELIVERY = /^(
|
|
26959
|
+
var WORKIT_DELIVERY = /^(pr (create|merge)|ci wait|git push)\b/;
|
|
26973
26960
|
var runsWorkitDelivery = (command, dialect) => workitInvocations(command, dialect).some((args) => !args.some((arg) => arg === "--help" || arg === "-h" || arg === "--dry-run") && WORKIT_DELIVERY.test(args.join(" ")));
|
|
26974
26961
|
var isDeliveryCommand = (cwd, command, dialect = "posix") => rawDelivery(cwd, command, dialect) || runsWorkitDelivery(command, dialect) && inWorkitWorkspace(cwd);
|
|
26975
26962
|
function shipNudge(input, command) {
|
|
@@ -28194,7 +28181,7 @@ var cwdRewrite = (command) => {
|
|
|
28194
28181
|
const rest = match?.[2];
|
|
28195
28182
|
if (!dir || !rest || dir.startsWith("-"))
|
|
28196
28183
|
return null;
|
|
28197
|
-
if (/[&;<>`\n]/u.test(rest.replaceAll("2>&1", "").replaceAll(/'[^']*'|"(
|
|
28184
|
+
if (/[&;<>`\n]/u.test(rest.replaceAll("2>&1", "").replaceAll(/'[^']*'|"([^"\\]|\\.)*"/gu, "")))
|
|
28198
28185
|
return null;
|
|
28199
28186
|
const segments = segmentsOf(rest);
|
|
28200
28187
|
const [head, ...filters] = segments;
|
|
@@ -28207,8 +28194,10 @@ var cwdRewrite = (command) => {
|
|
|
28207
28194
|
if (!filters.every((s) => FILTERS.has(s.words[0] ?? "") && stdinOnly(s.words)))
|
|
28208
28195
|
return null;
|
|
28209
28196
|
const at = head.words.indexOf("--cwd");
|
|
28210
|
-
if (at >= 0)
|
|
28211
|
-
|
|
28197
|
+
if (at >= 0) {
|
|
28198
|
+
const bare = dir.replace(/^(['"])(.*)\1$/u, "$2");
|
|
28199
|
+
return bare[0] === "/" && head.words[at + 1] === bare ? rest : null;
|
|
28200
|
+
}
|
|
28212
28201
|
if (head.words.some((w) => w.startsWith("--cwd=")))
|
|
28213
28202
|
return null;
|
|
28214
28203
|
const args = rest.slice("workit".length).trimStart();
|
|
@@ -28228,7 +28217,7 @@ var verbFirst = (command) => {
|
|
|
28228
28217
|
return null;
|
|
28229
28218
|
return `${lead} ${verb}${globals}${command.slice(whole.length)}`;
|
|
28230
28219
|
};
|
|
28231
|
-
var MUTATING_GIT2 = /^git(
|
|
28220
|
+
var MUTATING_GIT2 = /^git( -\S+| -[Cc] \S+)* (commit|push|add|switch|checkout|merge|rebase|reset|cherry-pick|revert|branch .*(-[dDmM]|--delete|--move)\b|tag (?!-l\b|--list)|stash(?! (list|show)\b))/u;
|
|
28232
28221
|
var cdWorkitSplit = (command) => {
|
|
28233
28222
|
const match = COMPOUND2.exec(command);
|
|
28234
28223
|
const dir = match?.[1];
|