@gotgenes/pi-permission-system 7.1.3 → 7.1.4

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 (77) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +6 -2
  3. package/src/handlers/gates/bash-external-directory.ts +4 -4
  4. package/src/handlers/gates/bash-path-extractor.ts +1 -1
  5. package/src/handlers/gates/bash-path.ts +4 -4
  6. package/src/handlers/gates/descriptor.ts +6 -6
  7. package/src/handlers/gates/external-directory.ts +2 -2
  8. package/src/handlers/gates/helpers.ts +2 -2
  9. package/src/handlers/gates/path.ts +4 -4
  10. package/src/handlers/gates/runner.ts +4 -4
  11. package/src/handlers/gates/skill-read.ts +5 -5
  12. package/src/handlers/gates/tool.ts +5 -5
  13. package/src/wildcard-matcher.ts +2 -2
  14. package/{tests → test}/active-agent.test.ts +1 -1
  15. package/{tests → test}/bash-arity.test.ts +4 -4
  16. package/{tests → test}/bash-external-directory.test.ts +3 -3
  17. package/{tests → test}/common.test.ts +1 -1
  18. package/{tests → test}/config-loader.test.ts +1 -1
  19. package/{tests → test}/config-modal.test.ts +3 -3
  20. package/{tests → test}/config-paths.test.ts +1 -1
  21. package/{tests → test}/config-reporter.test.ts +4 -4
  22. package/{tests → test}/denial-messages.test.ts +2 -2
  23. package/{tests → test}/expand-home.test.ts +1 -1
  24. package/{tests → test}/extension-config.test.ts +1 -1
  25. package/{tests → test}/extension-paths.test.ts +2 -2
  26. package/{tests → test}/forwarded-permissions/io.test.ts +2 -2
  27. package/{tests → test}/forwarding-manager.test.ts +1 -1
  28. package/{tests → test}/handlers/before-agent-start.test.ts +4 -4
  29. package/{tests → test}/handlers/external-directory-integration.test.ts +7 -7
  30. package/{tests → test}/handlers/external-directory-session-dedup.test.ts +6 -6
  31. package/{tests → test}/handlers/gates/bash-external-directory.test.ts +5 -8
  32. package/{tests → test}/handlers/gates/bash-path.test.ts +6 -9
  33. package/{tests → test}/handlers/gates/external-directory-messages.test.ts +1 -1
  34. package/{tests → test}/handlers/gates/external-directory.test.ts +4 -7
  35. package/{tests → test}/handlers/gates/helpers.test.ts +1 -1
  36. package/{tests → test}/handlers/gates/path.test.ts +6 -6
  37. package/{tests → test}/handlers/gates/runner.test.ts +5 -5
  38. package/{tests → test}/handlers/gates/skill-read.test.ts +4 -4
  39. package/{tests → test}/handlers/gates/tool.test.ts +3 -3
  40. package/{tests → test}/handlers/input-events.test.ts +6 -6
  41. package/{tests → test}/handlers/input.test.ts +4 -4
  42. package/{tests → test}/handlers/lifecycle.test.ts +2 -2
  43. package/{tests → test}/handlers/tool-call-events.test.ts +6 -6
  44. package/{tests → test}/handlers/tool-call.test.ts +4 -4
  45. package/{tests → test}/input-normalizer.test.ts +2 -2
  46. package/{tests → test}/mcp-targets.test.ts +1 -1
  47. package/{tests → test}/node-modules-discovery.test.ts +1 -1
  48. package/{tests → test}/normalize.test.ts +1 -1
  49. package/{tests → test}/path-utils.test.ts +1 -1
  50. package/{tests → test}/pattern-suggest.test.ts +1 -1
  51. package/{tests → test}/permission-dialog.test.ts +1 -1
  52. package/{tests → test}/permission-event-rpc.test.ts +3 -3
  53. package/{tests → test}/permission-events.test.ts +4 -4
  54. package/{tests → test}/permission-forwarding.test.ts +1 -1
  55. package/{tests → test}/permission-gate.test.ts +2 -2
  56. package/{tests → test}/permission-manager-unified.test.ts +5 -5
  57. package/{tests → test}/permission-merge.test.ts +1 -1
  58. package/{tests → test}/permission-prompter.test.ts +4 -4
  59. package/{tests → test}/permission-prompts.test.ts +4 -4
  60. package/{tests → test}/permission-session.test.ts +7 -7
  61. package/{tests → test}/permission-system.test.ts +13 -13
  62. package/{tests → test}/pi-infrastructure-read.test.ts +2 -2
  63. package/{tests → test}/policy-loader.test.ts +1 -1
  64. package/{tests → test}/rule.test.ts +2 -2
  65. package/{tests → test}/runtime.test.ts +4 -4
  66. package/{tests → test}/service.test.ts +4 -4
  67. package/{tests → test}/session-logger.test.ts +2 -2
  68. package/{tests → test}/session-rules.test.ts +2 -2
  69. package/{tests → test}/session-start.test.ts +4 -4
  70. package/{tests → test}/skill-prompt-sanitizer.test.ts +3 -3
  71. package/{tests → test}/subagent-context.test.ts +2 -2
  72. package/{tests → test}/synthesize.test.ts +3 -3
  73. package/{tests → test}/system-prompt-sanitizer.test.ts +1 -1
  74. package/{tests → test}/tool-input-preview.test.ts +3 -3
  75. package/{tests → test}/tool-registry.test.ts +1 -1
  76. package/{tests → test}/wildcard-matcher.test.ts +1 -1
  77. package/{tests → test}/yolo-mode.test.ts +2 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [7.1.4](https://github.com/gotgenes/pi-packages/compare/pi-permission-system-v7.1.3...pi-permission-system-v7.1.4) (2026-05-23)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add package.json imports field for #src/#test path aliases ([#157](https://github.com/gotgenes/pi-packages/issues/157)) ([75b4598](https://github.com/gotgenes/pi-packages/commit/75b45980810583452f7741678359c004900c8bd0))
14
+
8
15
  ## [7.1.3](https://github.com/gotgenes/pi-packages/compare/pi-permission-system-v7.1.2...pi-permission-system-v7.1.3) (2026-05-23)
9
16
 
10
17
 
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "@gotgenes/pi-permission-system",
3
- "version": "7.1.3",
3
+ "version": "7.1.4",
4
4
  "description": "Permission enforcement extension for the Pi coding agent.",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./src/service.ts"
8
8
  },
9
+ "imports": {
10
+ "#src/*": "./src/*",
11
+ "#test/*": "./test/*"
12
+ },
9
13
  "files": [
10
14
  "src",
11
- "tests",
15
+ "test",
12
16
  "config/config.example.json",
13
17
  "schemas/permissions.schema.json",
14
18
  "README.md",
@@ -1,7 +1,7 @@
1
- import { getNonEmptyString, toRecord } from "../../common";
2
- import type { Rule } from "../../rule";
3
- import { deriveApprovalPattern } from "../../session-rules";
4
- import type { PermissionCheckResult } from "../../types";
1
+ import { getNonEmptyString, toRecord } from "#src/common";
2
+ import type { Rule } from "#src/rule";
3
+ import { deriveApprovalPattern } from "#src/session-rules";
4
+ import type { PermissionCheckResult } from "#src/types";
5
5
  import { extractExternalPathsFromBashCommand } from "./bash-path-extractor";
6
6
  import type { GateResult } from "./descriptor";
7
7
  import { formatBashExternalDirectoryAskPrompt } from "./external-directory-messages";
@@ -4,7 +4,7 @@ import { basename } from "node:path";
4
4
  import {
5
5
  isPathOutsideWorkingDirectory,
6
6
  normalizePathForComparison,
7
- } from "../../path-utils";
7
+ } from "#src/path-utils";
8
8
 
9
9
  // ── tree-sitter-bash lazy parser ───────────────────────────────────────────
10
10
 
@@ -1,7 +1,7 @@
1
- import { getNonEmptyString, toRecord } from "../../common";
2
- import type { Rule } from "../../rule";
3
- import { deriveApprovalPattern } from "../../session-rules";
4
- import type { PermissionCheckResult } from "../../types";
1
+ import { getNonEmptyString, toRecord } from "#src/common";
2
+ import type { Rule } from "#src/rule";
3
+ import { deriveApprovalPattern } from "#src/session-rules";
4
+ import type { PermissionCheckResult } from "#src/types";
5
5
  import { extractTokensForPathRules } from "./bash-path-extractor";
6
6
  import type { GateResult } from "./descriptor";
7
7
  import { formatPathAskPrompt } from "./path";
@@ -1,9 +1,9 @@
1
- import type { DenialContext } from "../../denial-messages";
2
- import type { PermissionPromptDecision } from "../../permission-dialog";
3
- import type { PermissionDecisionEvent } from "../../permission-events";
4
- import type { PromptPermissionDetails } from "../../permission-prompter";
5
- import type { Rule } from "../../rule";
6
- import type { PermissionCheckResult, PermissionState } from "../../types";
1
+ import type { DenialContext } from "#src/denial-messages";
2
+ import type { PermissionPromptDecision } from "#src/permission-dialog";
3
+ import type { PermissionDecisionEvent } from "#src/permission-events";
4
+ import type { PromptPermissionDetails } from "#src/permission-prompter";
5
+ import type { Rule } from "#src/rule";
6
+ import type { PermissionCheckResult, PermissionState } from "#src/types";
7
7
 
8
8
  // ── Descriptor types ───────────────────────────────────────────────────────
9
9
 
@@ -3,8 +3,8 @@ import {
3
3
  isPathOutsideWorkingDirectory,
4
4
  isPiInfrastructureRead,
5
5
  normalizePathForComparison,
6
- } from "../../path-utils";
7
- import { deriveApprovalPattern } from "../../session-rules";
6
+ } from "#src/path-utils";
7
+ import { deriveApprovalPattern } from "#src/session-rules";
8
8
  import type { GateResult } from "./descriptor";
9
9
  import { formatExternalDirectoryAskPrompt } from "./external-directory-messages";
10
10
  import type { ToolCallContext } from "./types";
@@ -1,5 +1,5 @@
1
- import type { PermissionDecisionResolution } from "../../permission-events";
2
- import type { PermissionCheckResult } from "../../types";
1
+ import type { PermissionDecisionResolution } from "#src/permission-events";
2
+ import type { PermissionCheckResult } from "#src/types";
3
3
 
4
4
  /**
5
5
  * Derive the human-readable value for a decision event from a check result.
@@ -1,7 +1,7 @@
1
- import { getPathBearingToolPath } from "../../path-utils";
2
- import type { Rule } from "../../rule";
3
- import { deriveApprovalPattern } from "../../session-rules";
4
- import type { PermissionCheckResult } from "../../types";
1
+ import { getPathBearingToolPath } from "#src/path-utils";
2
+ import type { Rule } from "#src/rule";
3
+ import { deriveApprovalPattern } from "#src/session-rules";
4
+ import type { PermissionCheckResult } from "#src/types";
5
5
  import type { GateDescriptor, GateResult } from "./descriptor";
6
6
  import type { ToolCallContext } from "./types";
7
7
 
@@ -2,10 +2,10 @@ import {
2
2
  formatDenyReason,
3
3
  formatUnavailableReason,
4
4
  formatUserDeniedReason,
5
- } from "../../denial-messages";
6
- import type { PermissionPromptDecision } from "../../permission-dialog";
7
- import { applyPermissionGate } from "../../permission-gate";
8
- import type { PermissionCheckResult } from "../../types";
5
+ } from "#src/denial-messages";
6
+ import type { PermissionPromptDecision } from "#src/permission-dialog";
7
+ import { applyPermissionGate } from "#src/permission-gate";
8
+ import type { PermissionCheckResult } from "#src/types";
9
9
  import type { GateDescriptor, GateRunnerDeps } from "./descriptor";
10
10
  import { deriveResolution } from "./helpers";
11
11
  import type { GateOutcome } from "./types";
@@ -1,8 +1,8 @@
1
- import { toRecord } from "../../common";
2
- import { normalizePathForComparison } from "../../path-utils";
3
- import { formatSkillPathAskPrompt } from "../../permission-prompts";
4
- import type { SkillPromptEntry } from "../../skill-prompt-sanitizer";
5
- import { findSkillPathMatch } from "../../skill-prompt-sanitizer";
1
+ import { toRecord } from "#src/common";
2
+ import { normalizePathForComparison } from "#src/path-utils";
3
+ import { formatSkillPathAskPrompt } from "#src/permission-prompts";
4
+ import type { SkillPromptEntry } from "#src/skill-prompt-sanitizer";
5
+ import { findSkillPathMatch } from "#src/skill-prompt-sanitizer";
6
6
  import type { GateDescriptor } from "./descriptor";
7
7
  import type { ToolCallContext } from "./types";
8
8
 
@@ -1,8 +1,8 @@
1
- import { getPathBearingToolPath, PATH_BEARING_TOOLS } from "../../path-utils";
2
- import { suggestSessionPattern } from "../../pattern-suggest";
3
- import { formatAskPrompt } from "../../permission-prompts";
4
- import { getPermissionLogContext } from "../../tool-input-preview";
5
- import type { PermissionCheckResult } from "../../types";
1
+ import { getPathBearingToolPath, PATH_BEARING_TOOLS } from "#src/path-utils";
2
+ import { suggestSessionPattern } from "#src/pattern-suggest";
3
+ import { formatAskPrompt } from "#src/permission-prompts";
4
+ import { getPermissionLogContext } from "#src/tool-input-preview";
5
+ import type { PermissionCheckResult } from "#src/types";
6
6
  import type { GateDescriptor } from "./descriptor";
7
7
  import { deriveDecisionValue } from "./helpers";
8
8
  import type { ToolCallContext } from "./types";
@@ -30,7 +30,7 @@ export function compileWildcardPattern<TState>(
30
30
  // space-and-arguments portion optional so that e.g. "git *" matches both
31
31
  // "git status" and bare "git". Mirrors OpenCode wildcard semantics.
32
32
  if (escaped.endsWith(" .*")) {
33
- escaped = escaped.slice(0, -3) + "( .*)?";
33
+ escaped = `${escaped.slice(0, -3)}( .*)?`;
34
34
  }
35
35
 
36
36
  return {
@@ -48,7 +48,7 @@ export function compileWildcardPatternEntries<TState>(
48
48
  );
49
49
  }
50
50
 
51
- function compileWildcardPatterns<TState>(
51
+ function _compileWildcardPatterns<TState>(
52
52
  patterns: Record<string, TState>,
53
53
  ): CompiledWildcardPattern<TState>[] {
54
54
  return compileWildcardPatternEntries(Object.entries(patterns));
@@ -5,7 +5,7 @@ import {
5
5
  getActiveAgentName,
6
6
  getActiveAgentNameFromSystemPrompt,
7
7
  normalizeAgentName,
8
- } from "../src/active-agent";
8
+ } from "#src/active-agent";
9
9
 
10
10
  afterEach(() => {
11
11
  vi.restoreAllMocks();
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import { ARITY, prefix } from "../src/bash-arity";
2
+ import { ARITY, prefix } from "#src/bash-arity";
3
3
 
4
4
  describe("ARITY dictionary", () => {
5
5
  it("is exported as a plain object", () => {
@@ -7,7 +7,7 @@ describe("ARITY dictionary", () => {
7
7
  });
8
8
 
9
9
  it("maps 'git' to arity 2", () => {
10
- expect(ARITY["git"]).toBe(2);
10
+ expect(ARITY.git).toBe(2);
11
11
  });
12
12
 
13
13
  it("maps 'npm run' to arity 3", () => {
@@ -15,7 +15,7 @@ describe("ARITY dictionary", () => {
15
15
  });
16
16
 
17
17
  it("maps 'npm' to arity 2 (fallback when 'npm run' does not match)", () => {
18
- expect(ARITY["npm"]).toBe(2);
18
+ expect(ARITY.npm).toBe(2);
19
19
  });
20
20
 
21
21
  it("maps 'docker compose' to arity 3", () => {
@@ -23,7 +23,7 @@ describe("ARITY dictionary", () => {
23
23
  });
24
24
 
25
25
  it("maps 'docker' to arity 2 (fallback)", () => {
26
- expect(ARITY["docker"]).toBe(2);
26
+ expect(ARITY.docker).toBe(2);
27
27
  });
28
28
  });
29
29
 
@@ -9,12 +9,12 @@ vi.mock("node:os", () => {
9
9
  };
10
10
  });
11
11
 
12
- import { formatDenyReason } from "../src/denial-messages";
12
+ import { formatDenyReason } from "#src/denial-messages";
13
13
  import {
14
14
  extractExternalPathsFromBashCommand,
15
15
  extractTokensForPathRules,
16
- } from "../src/handlers/gates/bash-path-extractor";
17
- import { formatBashExternalDirectoryAskPrompt } from "../src/handlers/gates/external-directory-messages";
16
+ } from "#src/handlers/gates/bash-path-extractor";
17
+ import { formatBashExternalDirectoryAskPrompt } from "#src/handlers/gates/external-directory-messages";
18
18
 
19
19
  afterEach(() => {
20
20
  vi.restoreAllMocks();
@@ -6,7 +6,7 @@ import {
6
6
  isPermissionState,
7
7
  parseSimpleYamlMap,
8
8
  toRecord,
9
- } from "../src/common";
9
+ } from "#src/common";
10
10
 
11
11
  afterEach(() => {
12
12
  vi.restoreAllMocks();
@@ -7,7 +7,7 @@ import {
7
7
  loadAndMergeConfigs,
8
8
  loadUnifiedConfig,
9
9
  mergeUnifiedConfigs,
10
- } from "../src/config-loader";
10
+ } from "#src/config-loader";
11
11
 
12
12
  describe("loadUnifiedConfig", () => {
13
13
  let tempDir: string;
@@ -2,13 +2,13 @@ import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { join } from "node:path";
4
4
  import { expect, test, vi } from "vitest";
5
- import { registerPermissionSystemCommand } from "../src/config-modal";
5
+ import { registerPermissionSystemCommand } from "#src/config-modal";
6
6
  import {
7
7
  DEFAULT_EXTENSION_CONFIG,
8
8
  normalizePermissionSystemConfig,
9
9
  type PermissionSystemExtensionConfig,
10
- } from "../src/extension-config";
11
- import type { Rule } from "../src/rule";
10
+ } from "#src/extension-config";
11
+ import type { Rule } from "#src/rule";
12
12
 
13
13
  vi.mock("@earendil-works/pi-coding-agent", () => ({
14
14
  getSettingsListTheme: () => ({}),
@@ -11,7 +11,7 @@ import {
11
11
  getLegacyProjectPolicyPath,
12
12
  getProjectConfigPath,
13
13
  REVIEW_LOG_FILENAME,
14
- } from "../src/config-paths";
14
+ } from "#src/config-paths";
15
15
 
16
16
  describe("config-paths", () => {
17
17
  const agentDir = "/home/user/.pi/agent";
@@ -8,10 +8,10 @@ import {
8
8
  import { tmpdir } from "node:os";
9
9
  import { join } from "node:path";
10
10
  import { expect, test } from "vitest";
11
- import { buildResolvedConfigLogEntry } from "../src/config-reporter";
12
- import { createPermissionSystemLogger } from "../src/logging";
13
- import type { ResolvedPolicyPaths } from "../src/permission-manager";
14
- import { PermissionManager } from "../src/permission-manager";
11
+ import { buildResolvedConfigLogEntry } from "#src/config-reporter";
12
+ import { createPermissionSystemLogger } from "#src/logging";
13
+ import type { ResolvedPolicyPaths } from "#src/permission-manager";
14
+ import { PermissionManager } from "#src/permission-manager";
15
15
 
16
16
  test("buildResolvedConfigLogEntry includes policy paths and legacy detection flags", () => {
17
17
  const policyPaths: ResolvedPolicyPaths = {
@@ -6,8 +6,8 @@ import {
6
6
  formatDenyReason,
7
7
  formatUnavailableReason,
8
8
  formatUserDeniedReason,
9
- } from "../src/denial-messages";
10
- import type { PermissionCheckResult } from "../src/types";
9
+ } from "#src/denial-messages";
10
+ import type { PermissionCheckResult } from "#src/types";
11
11
 
12
12
  // ── Helpers ────────────────────────────────────────────────────────────────
13
13
 
@@ -8,7 +8,7 @@ vi.mock("node:os", () => ({
8
8
  default: { homedir: mockHomedir },
9
9
  }));
10
10
 
11
- import { expandHomePath } from "../src/expand-home";
11
+ import { expandHomePath } from "#src/expand-home";
12
12
 
13
13
  const FAKE_HOME = "/home/testuser";
14
14
 
@@ -3,7 +3,7 @@ import { describe, expect, it } from "vitest";
3
3
  import {
4
4
  detectMisplacedPermissionKeys,
5
5
  normalizePermissionSystemConfig,
6
- } from "../src/extension-config";
6
+ } from "#src/extension-config";
7
7
 
8
8
  describe("detectMisplacedPermissionKeys", () => {
9
9
  it("returns an empty array for a record with only valid extension keys", () => {
@@ -9,8 +9,8 @@ vi.mock("../src/node-modules-discovery", () => ({
9
9
  discoverGlobalNodeModulesRoot: mockDiscoverGlobalNodeModulesRoot,
10
10
  }));
11
11
 
12
- import { getGlobalLogsDir } from "../src/config-paths";
13
- import { computeExtensionPaths } from "../src/extension-paths";
12
+ import { getGlobalLogsDir } from "#src/config-paths";
13
+ import { computeExtensionPaths } from "#src/extension-paths";
14
14
 
15
15
  describe("computeExtensionPaths", () => {
16
16
  beforeEach(() => {
@@ -1,12 +1,12 @@
1
1
  import { describe, expect, it, vi } from "vitest";
2
2
 
3
- import type { ForwardedPermissionLogger } from "../../src/forwarded-permissions/io";
3
+ import type { ForwardedPermissionLogger } from "#src/forwarded-permissions/io";
4
4
  import {
5
5
  formatUnknownErrorMessage,
6
6
  isErrnoCode,
7
7
  logPermissionForwardingError,
8
8
  logPermissionForwardingWarning,
9
- } from "../../src/forwarded-permissions/io";
9
+ } from "#src/forwarded-permissions/io";
10
10
 
11
11
  // ── helpers ────────────────────────────────────────────────────────────────
12
12
 
@@ -1,6 +1,6 @@
1
1
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2
2
 
3
- import { ForwardingManager } from "../src/forwarding-manager";
3
+ import { ForwardingManager } from "#src/forwarding-manager";
4
4
 
5
5
  // ── Mocks ─────────────────────────────────────────────────────────────────
6
6
 
@@ -4,10 +4,10 @@ import { describe, expect, it, vi } from "vitest";
4
4
  import {
5
5
  AgentPrepHandler,
6
6
  shouldExposeTool,
7
- } from "../../src/handlers/before-agent-start";
8
- import type { PermissionSession } from "../../src/permission-session";
9
- import type { ToolRegistry } from "../../src/tool-registry";
10
- import type { PermissionState } from "../../src/types";
7
+ } from "#src/handlers/before-agent-start";
8
+ import type { PermissionSession } from "#src/permission-session";
9
+ import type { ToolRegistry } from "#src/tool-registry";
10
+ import type { PermissionState } from "#src/types";
11
11
 
12
12
  // ── SDK stubs ──────────────────────────────────────────────────────────────
13
13
  vi.mock("@earendil-works/pi-coding-agent", async (importOriginal) => {
@@ -11,16 +11,16 @@
11
11
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
12
12
  import { describe, expect, it, vi } from "vitest";
13
13
 
14
- import { EXTENSION_TAG } from "../../src/denial-messages";
15
- import { formatExternalDirectoryAskPrompt } from "../../src/handlers/gates/external-directory-messages";
16
- import { PermissionGateHandler } from "../../src/handlers/permission-gate-handler";
14
+ import { EXTENSION_TAG } from "#src/denial-messages";
15
+ import { formatExternalDirectoryAskPrompt } from "#src/handlers/gates/external-directory-messages";
16
+ import { PermissionGateHandler } from "#src/handlers/permission-gate-handler";
17
17
  import {
18
18
  PERMISSIONS_DECISION_CHANNEL,
19
19
  type PermissionDecisionEvent,
20
- } from "../../src/permission-events";
21
- import type { PermissionSession } from "../../src/permission-session";
22
- import type { ToolRegistry } from "../../src/tool-registry";
23
- import type { PermissionCheckResult, PermissionState } from "../../src/types";
20
+ } from "#src/permission-events";
21
+ import type { PermissionSession } from "#src/permission-session";
22
+ import type { ToolRegistry } from "#src/tool-registry";
23
+ import type { PermissionCheckResult, PermissionState } from "#src/types";
24
24
 
25
25
  // ── SDK stubs ──────────────────────────────────────────────────────────────
26
26
  vi.mock("@earendil-works/pi-coding-agent", async (importOriginal) => {
@@ -11,12 +11,12 @@
11
11
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
12
12
  import { describe, expect, it, vi } from "vitest";
13
13
 
14
- import { PermissionGateHandler } from "../../src/handlers/permission-gate-handler";
15
- import type { PermissionSession } from "../../src/permission-session";
16
- import type { Rule } from "../../src/rule";
17
- import type { ToolRegistry } from "../../src/tool-registry";
18
- import type { PermissionCheckResult } from "../../src/types";
19
- import { wildcardMatch } from "../../src/wildcard-matcher";
14
+ import { PermissionGateHandler } from "#src/handlers/permission-gate-handler";
15
+ import type { PermissionSession } from "#src/permission-session";
16
+ import type { Rule } from "#src/rule";
17
+ import type { ToolRegistry } from "#src/tool-registry";
18
+ import type { PermissionCheckResult } from "#src/types";
19
+ import { wildcardMatch } from "#src/wildcard-matcher";
20
20
 
21
21
  // ── SDK stub ───────────────────────────────────────────────────────────────
22
22
  vi.mock("@earendil-works/pi-coding-agent", async (importOriginal) => {
@@ -1,15 +1,12 @@
1
1
  import { describe, expect, it, vi } from "vitest";
2
- import { describeBashExternalDirectoryGate } from "../../../src/handlers/gates/bash-external-directory";
2
+ import { describeBashExternalDirectoryGate } from "#src/handlers/gates/bash-external-directory";
3
3
  import type {
4
4
  GateBypass,
5
5
  GateDescriptor,
6
- } from "../../../src/handlers/gates/descriptor";
7
- import {
8
- isGateBypass,
9
- isGateDescriptor,
10
- } from "../../../src/handlers/gates/descriptor";
11
- import type { ToolCallContext } from "../../../src/handlers/gates/types";
12
- import type { PermissionCheckResult } from "../../../src/types";
6
+ } from "#src/handlers/gates/descriptor";
7
+ import { isGateBypass, isGateDescriptor } from "#src/handlers/gates/descriptor";
8
+ import type { ToolCallContext } from "#src/handlers/gates/types";
9
+ import type { PermissionCheckResult } from "#src/types";
13
10
 
14
11
  // ── helpers ────────────────────────────────────────────────────────────────
15
12
 
@@ -9,18 +9,15 @@ vi.mock("node:os", () => {
9
9
  };
10
10
  });
11
11
 
12
- import { describeBashPathGate } from "../../../src/handlers/gates/bash-path";
12
+ import { describeBashPathGate } from "#src/handlers/gates/bash-path";
13
13
  import type {
14
14
  GateBypass,
15
15
  GateDescriptor,
16
- } from "../../../src/handlers/gates/descriptor";
17
- import {
18
- isGateBypass,
19
- isGateDescriptor,
20
- } from "../../../src/handlers/gates/descriptor";
21
- import type { ToolCallContext } from "../../../src/handlers/gates/types";
22
- import type { Rule } from "../../../src/rule";
23
- import type { PermissionCheckResult } from "../../../src/types";
16
+ } from "#src/handlers/gates/descriptor";
17
+ import { isGateBypass, isGateDescriptor } from "#src/handlers/gates/descriptor";
18
+ import type { ToolCallContext } from "#src/handlers/gates/types";
19
+ import type { Rule } from "#src/rule";
20
+ import type { PermissionCheckResult } from "#src/types";
24
21
 
25
22
  afterEach(() => {
26
23
  vi.restoreAllMocks();
@@ -3,7 +3,7 @@ import { describe, expect, test } from "vitest";
3
3
  import {
4
4
  formatBashExternalDirectoryAskPrompt,
5
5
  formatExternalDirectoryAskPrompt,
6
- } from "../../../src/handlers/gates/external-directory-messages";
6
+ } from "#src/handlers/gates/external-directory-messages";
7
7
 
8
8
  // Denial message functions (formatExternalDirectoryDenyReason,
9
9
  // formatExternalDirectoryUserDeniedReason, formatExternalDirectoryHardStopHint,
@@ -3,13 +3,10 @@ import { describe, expect, it } from "vitest";
3
3
  import type {
4
4
  GateBypass,
5
5
  GateDescriptor,
6
- } from "../../../src/handlers/gates/descriptor";
7
- import {
8
- isGateBypass,
9
- isGateDescriptor,
10
- } from "../../../src/handlers/gates/descriptor";
11
- import { describeExternalDirectoryGate } from "../../../src/handlers/gates/external-directory";
12
- import type { ToolCallContext } from "../../../src/handlers/gates/types";
6
+ } from "#src/handlers/gates/descriptor";
7
+ import { isGateBypass, isGateDescriptor } from "#src/handlers/gates/descriptor";
8
+ import { describeExternalDirectoryGate } from "#src/handlers/gates/external-directory";
9
+ import type { ToolCallContext } from "#src/handlers/gates/types";
13
10
 
14
11
  // ── helpers ───────────────────────────��────────────────────────────��───────
15
12
 
@@ -3,7 +3,7 @@ import { describe, expect, it } from "vitest";
3
3
  import {
4
4
  deriveDecisionValue,
5
5
  deriveResolution,
6
- } from "../../../src/handlers/gates/helpers";
6
+ } from "#src/handlers/gates/helpers";
7
7
 
8
8
  describe("deriveDecisionValue", () => {
9
9
  it("returns command for bash", () => {
@@ -1,11 +1,11 @@
1
1
  import { describe, expect, it, vi } from "vitest";
2
2
 
3
- import type { GateDescriptor } from "../../../src/handlers/gates/descriptor";
4
- import { isGateDescriptor } from "../../../src/handlers/gates/descriptor";
5
- import { describePathGate } from "../../../src/handlers/gates/path";
6
- import type { ToolCallContext } from "../../../src/handlers/gates/types";
7
- import type { Rule } from "../../../src/rule";
8
- import type { PermissionCheckResult } from "../../../src/types";
3
+ import type { GateDescriptor } from "#src/handlers/gates/descriptor";
4
+ import { isGateDescriptor } from "#src/handlers/gates/descriptor";
5
+ import { describePathGate } from "#src/handlers/gates/path";
6
+ import type { ToolCallContext } from "#src/handlers/gates/types";
7
+ import type { Rule } from "#src/rule";
8
+ import type { PermissionCheckResult } from "#src/types";
9
9
 
10
10
  // ── helpers ────────────────────────────────────────────────────────────────
11
11
 
@@ -1,13 +1,13 @@
1
1
  import { describe, expect, it, vi } from "vitest";
2
2
 
3
- import type { DenialContext } from "../../../src/denial-messages";
4
- import { EXTENSION_TAG } from "../../../src/denial-messages";
3
+ import type { DenialContext } from "#src/denial-messages";
4
+ import { EXTENSION_TAG } from "#src/denial-messages";
5
5
  import type {
6
6
  GateDescriptor,
7
7
  GateRunnerDeps,
8
- } from "../../../src/handlers/gates/descriptor";
9
- import { runGateCheck } from "../../../src/handlers/gates/runner";
10
- import type { PermissionCheckResult } from "../../../src/types";
8
+ } from "#src/handlers/gates/descriptor";
9
+ import { runGateCheck } from "#src/handlers/gates/runner";
10
+ import type { PermissionCheckResult } from "#src/types";
11
11
 
12
12
  // ── helpers ────────────────────────────────────────────────────────────────
13
13
 
@@ -1,9 +1,9 @@
1
1
  import { describe, expect, it, vi } from "vitest";
2
2
 
3
- import type { GateDescriptor } from "../../../src/handlers/gates/descriptor";
4
- import { describeSkillReadGate } from "../../../src/handlers/gates/skill-read";
5
- import type { ToolCallContext } from "../../../src/handlers/gates/types";
6
- import type { SkillPromptEntry } from "../../../src/skill-prompt-sanitizer";
3
+ import type { GateDescriptor } from "#src/handlers/gates/descriptor";
4
+ import { describeSkillReadGate } from "#src/handlers/gates/skill-read";
5
+ import type { ToolCallContext } from "#src/handlers/gates/types";
6
+ import type { SkillPromptEntry } from "#src/skill-prompt-sanitizer";
7
7
 
8
8
  // ── SDK stubs ──────────────────────────────────────────────────────────────
9
9
  vi.mock("@earendil-works/pi-coding-agent", async (importOriginal) => {
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, it } from "vitest";
2
2
 
3
- import { describeToolGate } from "../../../src/handlers/gates/tool";
4
- import type { ToolCallContext } from "../../../src/handlers/gates/types";
5
- import type { PermissionCheckResult } from "../../../src/types";
3
+ import { describeToolGate } from "#src/handlers/gates/tool";
4
+ import type { ToolCallContext } from "#src/handlers/gates/types";
5
+ import type { PermissionCheckResult } from "#src/types";
6
6
 
7
7
  // ── helpers ────────────────────────────────────────────────────────────────
8
8