@workit-dev/pi 2.18.1 → 2.19.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.
- package/dist/worker.js +6 -1
- package/dist/workit.js +69 -9
- package/package.json +1 -1
- package/skills/workit-retro/SKILL.md +1 -1
package/dist/worker.js
CHANGED
|
@@ -7406,6 +7406,7 @@ var workspaceConfigSchema = object({
|
|
|
7406
7406
|
trailers: boolean2().optional().describe("Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
7407
7407
|
deleteBranch: boolean2().optional().describe("Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
7408
7408
|
cleanup: unknown().optional().describe("What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
7409
|
+
feedback: unknown().optional().describe('`workit feedback` for this workspace: `off` hides its contract line and makes the verb refuse; `{ "account": "<login>" }` names the GitHub login it posts with; workspaces inside this one inherit it.'),
|
|
7409
7410
|
liveSessionGuard: boolean2().optional().describe("Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
7410
7411
|
fanout: object({
|
|
7411
7412
|
tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
|
|
@@ -7448,7 +7449,10 @@ var workspaceConfigSchema = object({
|
|
|
7448
7449
|
});
|
|
7449
7450
|
var workspacesFileSchema = object({
|
|
7450
7451
|
workspaces: array(workspaceConfigSchema).optional().describe("Workspace entries, each mapping a path glob to its forge, policies and grants."),
|
|
7451
|
-
models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false).")
|
|
7452
|
+
models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false)."),
|
|
7453
|
+
feedback: object({
|
|
7454
|
+
account: nonBlank.optional().describe("The GitHub login `workit feedback --post` uses when no workspace names one; never the workspace's work account by default.")
|
|
7455
|
+
}).passthrough().optional().describe("`workit feedback` defaults for every workspace.")
|
|
7452
7456
|
}).passthrough().superRefine((file, context) => {
|
|
7453
7457
|
const names = new Set;
|
|
7454
7458
|
for (const [index, workspace] of (file.workspaces ?? []).entries()) {
|
|
@@ -8891,6 +8895,7 @@ effect before a retry.
|
|
|
8891
8895
|
Mid-task: never silently drop or resume an objective (workit-continue).
|
|
8892
8896
|
Notes, drafts, logs, resume files: \`workit dir notes|handoffs\` (outside the
|
|
8893
8897
|
repo), never the repo tree.
|
|
8898
|
+
FEEDBACK_LINE
|
|
8894
8899
|
|
|
8895
8900
|
Skills: load the skill, never act from memory.
|
|
8896
8901
|
- brainstorm, plan, spec, grill, should we: workit-shape
|
package/dist/workit.js
CHANGED
|
@@ -9170,6 +9170,7 @@ var workspaceConfigSchema = object({
|
|
|
9170
9170
|
trailers: boolean2().optional().describe("Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
9171
9171
|
deleteBranch: boolean2().optional().describe("Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
9172
9172
|
cleanup: unknown().optional().describe("What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
9173
|
+
feedback: unknown().optional().describe('`workit feedback` for this workspace: `off` hides its contract line and makes the verb refuse; `{ "account": "<login>" }` names the GitHub login it posts with; workspaces inside this one inherit it.'),
|
|
9173
9174
|
liveSessionGuard: boolean2().optional().describe("Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
9174
9175
|
fanout: object({
|
|
9175
9176
|
tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
|
|
@@ -9212,7 +9213,10 @@ var workspaceConfigSchema = object({
|
|
|
9212
9213
|
});
|
|
9213
9214
|
var workspacesFileSchema = object({
|
|
9214
9215
|
workspaces: array(workspaceConfigSchema).optional().describe("Workspace entries, each mapping a path glob to its forge, policies and grants."),
|
|
9215
|
-
models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false).")
|
|
9216
|
+
models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false)."),
|
|
9217
|
+
feedback: object({
|
|
9218
|
+
account: nonBlank.optional().describe("The GitHub login `workit feedback --post` uses when no workspace names one; never the workspace's work account by default.")
|
|
9219
|
+
}).passthrough().optional().describe("`workit feedback` defaults for every workspace.")
|
|
9216
9220
|
}).passthrough().superRefine((file, context) => {
|
|
9217
9221
|
const names = new Set;
|
|
9218
9222
|
for (const [index, workspace] of (file.workspaces ?? []).entries()) {
|
|
@@ -9657,6 +9661,12 @@ var workspaceTrailers = (cwd, dir) => {
|
|
|
9657
9661
|
};
|
|
9658
9662
|
};
|
|
9659
9663
|
var workspaceLiveSessionGuard = (cwd, dir) => inheritedSetting(cwd, dir, (entry) => typeof entry.liveSessionGuard === "boolean")?.source?.liveSessionGuard !== false;
|
|
9664
|
+
var feedbackSetting = (cwd, dir) => {
|
|
9665
|
+
const found = inheritedSetting(cwd, dir, (entry) => entry.feedback !== undefined);
|
|
9666
|
+
const value = found?.source?.feedback;
|
|
9667
|
+
return { found, value, off: value === "off" };
|
|
9668
|
+
};
|
|
9669
|
+
var workspaceFeedbackOff = (cwd, dir) => feedbackSetting(cwd, dir).off;
|
|
9660
9670
|
var changelogPathOf = (value) => {
|
|
9661
9671
|
if (typeof value !== "string")
|
|
9662
9672
|
return null;
|
|
@@ -18165,6 +18175,7 @@ function selectMethods(policy, capabilities) {
|
|
|
18165
18175
|
return [{ id, reason: reasons.join("; "), assurance: capability.assurance }];
|
|
18166
18176
|
});
|
|
18167
18177
|
}
|
|
18178
|
+
var FEEDBACK_LINE = "Workit friction: offer `workit feedback` once per problem; keep working.";
|
|
18168
18179
|
var BOOTSTRAP = `
|
|
18169
18180
|
Workit is optional coordination and proof tooling: you decide what and
|
|
18170
18181
|
whether, the CLI does how and records what it observed.
|
|
@@ -18219,6 +18230,7 @@ effect before a retry.
|
|
|
18219
18230
|
Mid-task: never silently drop or resume an objective (workit-continue).
|
|
18220
18231
|
Notes, drafts, logs, resume files: \`workit dir notes|handoffs\` (outside the
|
|
18221
18232
|
repo), never the repo tree.
|
|
18233
|
+
FEEDBACK_LINE
|
|
18222
18234
|
|
|
18223
18235
|
Skills: load the skill, never act from memory.
|
|
18224
18236
|
- brainstorm, plan, spec, grill, should we: workit-shape
|
|
@@ -18236,9 +18248,13 @@ Skills: load the skill, never act from memory.
|
|
|
18236
18248
|
- architecture, deepen modules (user-invoked; offer it): workit-architecture
|
|
18237
18249
|
`.trim();
|
|
18238
18250
|
var invariantBootstrap = (session = null) => {
|
|
18251
|
+
const feedbackOff = session !== null && workspaceFeedbackOff(session.cwd);
|
|
18252
|
+
const bootstrap = BOOTSTRAP.replace(`FEEDBACK_LINE
|
|
18253
|
+
`, () => feedbackOff ? "" : `${FEEDBACK_LINE}
|
|
18254
|
+
`);
|
|
18239
18255
|
const table = session && hostFamily(session.host) === "claude_code" ? claudeSpawnTable(session.cwd) : null;
|
|
18240
|
-
return table ? `${
|
|
18241
|
-
${table}` :
|
|
18256
|
+
return table ? `${bootstrap}
|
|
18257
|
+
${table}` : bootstrap;
|
|
18242
18258
|
};
|
|
18243
18259
|
|
|
18244
18260
|
// packages/workit-core/src/core/task-context.ts
|
|
@@ -24951,7 +24967,8 @@ var WORKIT_USER_ONLY = [
|
|
|
24951
24967
|
["install"],
|
|
24952
24968
|
["workspace", "seal"]
|
|
24953
24969
|
];
|
|
24954
|
-
var
|
|
24970
|
+
var WORKIT_ASKED_VERBS = ["feedback"];
|
|
24971
|
+
var USER_ONLY_WORD = new RegExp(`\\b(?:${[...new Set([...WORKIT_USER_ONLY.map((words) => words[0]), ...WORKIT_ASKED_VERBS])].join("|")})\\b`);
|
|
24955
24972
|
var mayRunUserOnly = (text) => {
|
|
24956
24973
|
const joined = text.replace(/\\\r?\n/g, "");
|
|
24957
24974
|
const bare = joined.replace(/['"\\]/g, "");
|
|
@@ -25020,6 +25037,37 @@ var userOnlyWorkitCall = (command, dialect = "posix") => {
|
|
|
25020
25037
|
}
|
|
25021
25038
|
return null;
|
|
25022
25039
|
};
|
|
25040
|
+
var askedWorkitCall = (command, dialect = "posix") => {
|
|
25041
|
+
if (!mayRunUserOnly(command))
|
|
25042
|
+
return null;
|
|
25043
|
+
for (const segment of segmentsOf(command, dialect)) {
|
|
25044
|
+
if (segment.unanalyzable)
|
|
25045
|
+
continue;
|
|
25046
|
+
const start = segment.words.findIndex(isWorkitWord);
|
|
25047
|
+
if (start < 0)
|
|
25048
|
+
continue;
|
|
25049
|
+
const words = segment.words.slice(start + 1);
|
|
25050
|
+
let at = 0;
|
|
25051
|
+
for (;; ) {
|
|
25052
|
+
const word = words[at];
|
|
25053
|
+
if (word === "--json")
|
|
25054
|
+
at += 1;
|
|
25055
|
+
else if (word === "--cwd" || word === "--session")
|
|
25056
|
+
at += 2;
|
|
25057
|
+
else if (word?.startsWith("--cwd="))
|
|
25058
|
+
at += 1;
|
|
25059
|
+
else
|
|
25060
|
+
break;
|
|
25061
|
+
}
|
|
25062
|
+
const verb = WORKIT_ASKED_VERBS.find((name) => words[at] === name);
|
|
25063
|
+
if (verb && !helpOnly(words.slice(at), [verb]))
|
|
25064
|
+
return {
|
|
25065
|
+
verb,
|
|
25066
|
+
plain: at === 0 && start === 0 && segment.words[0] === "workit"
|
|
25067
|
+
};
|
|
25068
|
+
}
|
|
25069
|
+
return null;
|
|
25070
|
+
};
|
|
25023
25071
|
// packages/workit-core/src/core/heavy-rules.ts
|
|
25024
25072
|
import fs24 from "node:fs";
|
|
25025
25073
|
import os7 from "node:os";
|
|
@@ -31588,6 +31636,18 @@ function decide(input, deps) {
|
|
|
31588
31636
|
unblock: null
|
|
31589
31637
|
};
|
|
31590
31638
|
}
|
|
31639
|
+
const asked = askedWorkitCall(event.command, event.dialect);
|
|
31640
|
+
if (asked && input.host === "claude_code")
|
|
31641
|
+
return {
|
|
31642
|
+
kind: "ask",
|
|
31643
|
+
reason: `\`workit ${asked.verb}\` reports to the Workit tracker: the user decides this call.`
|
|
31644
|
+
};
|
|
31645
|
+
if (asked && !asked.plain && canDeny && ["codex_cli", "codex_desktop"].includes(input.host))
|
|
31646
|
+
return {
|
|
31647
|
+
kind: "deny",
|
|
31648
|
+
reason: `Run \`workit ${asked.verb} …\` with nothing before the verb (no env, wrapper or global option), so Codex asks the user.`,
|
|
31649
|
+
unblock: null
|
|
31650
|
+
};
|
|
31591
31651
|
const role = canDeny ? agentRole(input, descriptor) : null;
|
|
31592
31652
|
if (role) {
|
|
31593
31653
|
const confined = (role === "implementer" ? confineImplementerShell : confineJudgeShell)(input, event.command, event.dialect);
|
|
@@ -31843,7 +31903,7 @@ var noteModelSelect = (event, ctx) => {
|
|
|
31843
31903
|
if (next && previous && next !== previous)
|
|
31844
31904
|
switchedSessions.add(ctx.sessionManager.getSessionId());
|
|
31845
31905
|
};
|
|
31846
|
-
var modelSwitchContract = (ctx) => switchedSessions.delete(ctx.sessionManager.getSessionId()) && ctx.isProjectTrusted() ? contractBlock(null) : null;
|
|
31906
|
+
var modelSwitchContract = (ctx) => switchedSessions.delete(ctx.sessionManager.getSessionId()) && ctx.isProjectTrusted() ? contractBlock(ctx.cwd, null) : null;
|
|
31847
31907
|
var turnContext = (ctx) => taskTurnContext(ctx);
|
|
31848
31908
|
var turnInput = (ctx) => ({
|
|
31849
31909
|
host: "pi",
|
|
@@ -31871,15 +31931,15 @@ var budgetNotice = (ctx) => {
|
|
|
31871
31931
|
const session = process.env.WORKIT_PI_WORKER_SESSION && process.env.WORKIT_SESSION_ID?.trim() || ctx.sessionManager.getSessionId();
|
|
31872
31932
|
return tickBudget(ctx.cwd, session, null) ? budgetLine(ctx.cwd, session, null) : null;
|
|
31873
31933
|
};
|
|
31874
|
-
var contractBlock = (addendum) => `<workit-contract>
|
|
31875
|
-
${invariantBootstrap()}${addendum ? `
|
|
31934
|
+
var contractBlock = (cwd, addendum) => `<workit-contract>
|
|
31935
|
+
${invariantBootstrap({ cwd, host: "pi" })}${addendum ? `
|
|
31876
31936
|
${addendum}` : ""}
|
|
31877
31937
|
</workit-contract>`;
|
|
31878
31938
|
var workitContext = (ctx, taskContext = taskTurnContext(ctx)) => {
|
|
31879
31939
|
const session = ctx.sessionManager.getSessionId();
|
|
31880
31940
|
if (!ctx.isProjectTrusted())
|
|
31881
|
-
return contractBlock(`Native Pi session: ${session}. Project-local Workit state is unavailable until Pi trusts this project.`);
|
|
31882
|
-
return contractBlock(`Native Pi session: ${session}.${taskContext ? `
|
|
31941
|
+
return contractBlock(ctx.cwd, `Native Pi session: ${session}. Project-local Workit state is unavailable until Pi trusts this project.`);
|
|
31942
|
+
return contractBlock(ctx.cwd, `Native Pi session: ${session}.${taskContext ? `
|
|
31883
31943
|
${taskContext}` : ""}`);
|
|
31884
31944
|
};
|
|
31885
31945
|
var unfinishedTaskOffer2 = (ctx) => {
|
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@ proposes and stops. Nothing changes until the user approves.
|
|
|
42
42
|
agent behaviour, becomes an issue or PR on BrainerVirus/workit, not a host
|
|
43
43
|
memory (one host reads it). Never fork a local copy. Use a minimal synthetic
|
|
44
44
|
repro: no private repo name, path, code, ledger text, PR, thread or transcript.
|
|
45
|
-
Paste the
|
|
45
|
+
Paste the whole `workit feedback "<title>" --body-file -` draft; `--post` once approved.
|
|
46
46
|
6. **Bloat guards.** AGENTS.md stays within 8 KB: each addition names what it
|
|
47
47
|
removes. Create `CODING_STANDARDS.md` or `GLOSSARY.md` only in the same
|
|
48
48
|
edit as its first real entry, never as a scaffold. Edit steering text by
|