@workit-dev/pi 1.6.1 → 1.7.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/worker.js CHANGED
@@ -7373,7 +7373,8 @@ var workspaceConfigSchema = object({
7373
7373
  ]))).passthrough().optional().describe("Autonomy grants (D15): only ever set here, by the user, with `workit grant set`."),
7374
7374
  youtrack: object({
7375
7375
  baseUrl: nonBlank.optional().describe("This workspace's YouTrack URL."),
7376
- link_issues: boolean2().optional().describe("Legacy alias of `issues: { provider: youtrack, link: true }`.")
7376
+ link_issues: boolean2().optional().describe("Legacy alias of `issues: { provider: youtrack, link: true }`."),
7377
+ writes: _enum(["ask", "auto"]).optional().describe("ask (default): each workit youtrack write waits for the user's yes. auto: posts without asking, behind WORKIT_YT_WRITE=1.")
7377
7378
  }).passthrough().optional().describe("YouTrack settings for this workspace."),
7378
7379
  issues: object({
7379
7380
  provider: _enum(["github", "gitlab", "youtrack"]).optional().describe("The issue tracker PRs link to."),
package/dist/workit.js CHANGED
@@ -9732,7 +9732,8 @@ var workspaceConfigSchema = object({
9732
9732
  ]))).passthrough().optional().describe("Autonomy grants (D15): only ever set here, by the user, with `workit grant set`."),
9733
9733
  youtrack: object({
9734
9734
  baseUrl: nonBlank.optional().describe("This workspace's YouTrack URL."),
9735
- link_issues: boolean2().optional().describe("Legacy alias of `issues: { provider: youtrack, link: true }`.")
9735
+ link_issues: boolean2().optional().describe("Legacy alias of `issues: { provider: youtrack, link: true }`."),
9736
+ writes: _enum(["ask", "auto"]).optional().describe("ask (default): each workit youtrack write waits for the user's yes. auto: posts without asking, behind WORKIT_YT_WRITE=1.")
9736
9737
  }).passthrough().optional().describe("YouTrack settings for this workspace."),
9737
9738
  issues: object({
9738
9739
  provider: _enum(["github", "gitlab", "youtrack"]).optional().describe("The issue tracker PRs link to."),
@@ -20658,9 +20659,15 @@ var messageOf = (segment, index) => {
20658
20659
  return null;
20659
20660
  return match[3].replace(/\n+$/u, "");
20660
20661
  };
20662
+ var sameGitDir = (a, b, platform = process.platform) => {
20663
+ if (platform !== "win32")
20664
+ return path27.posix.resolve(a) === path27.posix.resolve(b);
20665
+ const fold = (value) => path27.win32.resolve(value).toLowerCase();
20666
+ return fold(a) === fold(b);
20667
+ };
20661
20668
  var cdCommitCall = (input, command, target, repo) => {
20662
20669
  const { top, git, dir: store } = repo.location;
20663
- if (!top || !git || git.gitDir === path27.dirname(store) || repoAt(input.cwd)?.location.top === top)
20670
+ if (!top || !git || sameGitDir(git.gitDir, path27.dirname(store)) || repoAt(input.cwd)?.location.top === top)
20664
20671
  return null;
20665
20672
  const bare = command.replaceAll(/'[^']*'|"(?:[^"\\]|\\.)*"/gu, "").replaceAll("&&", "");
20666
20673
  if (/[;|&<>`$()\n\\]/u.test(bare))
@@ -28317,10 +28324,12 @@ var substitutingHeredoc = (command) => {
28317
28324
  }
28318
28325
  return false;
28319
28326
  };
28320
- var judgeDeny = (input, what) => {
28327
+ var judgeDeny = (input, what, target) => {
28321
28328
  const role = input.session.agentType?.endsWith("reviewer") ? "reviewer" : "verifier";
28322
28329
  const root = checkoutOf2(input.cwd)?.root;
28323
- const scratch = root ? path42.join(root, SCRATCH) : `${SCRATCH}/ at the root of the checkout you judge`;
28330
+ const candidate = target ? checkoutOf2(target)?.root : undefined;
28331
+ const also = root && candidate && candidate !== root && commonDir(candidate) === commonDir(root) ? ` or ${path42.join(candidate, SCRATCH)}` : "";
28332
+ const scratch = root ? `${path42.join(root, SCRATCH)}${also}` : `${SCRATCH}/ at the root of the checkout you judge`;
28324
28333
  const unblock = `Write only under ${scratch} (mkdir -p it): put a generated case in a file there with a quoted heredoc (<<'EOF') and never run it in the shell. Reads, \`workit check\` and \`workit ledger verdict|finding\` stay allowed; a change the candidate needs is a finding, not an edit.`;
28325
28334
  return {
28326
28335
  kind: "deny",
@@ -28341,7 +28350,7 @@ function confineJudge(input, targets) {
28341
28350
  if (inScratch(canonical4(target), repo))
28342
28351
  continue;
28343
28352
  const runner = runnerAt(target);
28344
- return judgeDeny(input, runner === null ? `${shown(target)} is outside it` : `\`${runner}\` runs in ${shown(target)}, outside it`);
28353
+ return judgeDeny(input, runner === null ? `${shown(target)} is outside it` : `\`${runner}\` runs in ${shown(target)}, outside it`, target);
28345
28354
  }
28346
28355
  return NONE5;
28347
28356
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/pi",
3
- "version": "1.6.1",
3
+ "version": "1.7.1",
4
4
  "description": "Workit native extension for Pi — tools, method skills, and session continuity",
5
5
  "keywords": [
6
6
  "agentic-coding",