@gotgenes/pi-permission-system 7.1.3 → 7.2.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +7 -3
  3. package/src/active-agent.ts +1 -1
  4. package/src/bash-arity.ts +1 -0
  5. package/src/config-modal.ts +2 -0
  6. package/src/forwarded-permissions/io.ts +4 -2
  7. package/src/forwarded-permissions/polling.ts +8 -7
  8. package/src/handlers/before-agent-start.ts +7 -6
  9. package/src/handlers/gates/bash-external-directory.ts +4 -4
  10. package/src/handlers/gates/bash-path-extractor.ts +4 -6
  11. package/src/handlers/gates/bash-path.ts +5 -5
  12. package/src/handlers/gates/descriptor.ts +6 -6
  13. package/src/handlers/gates/external-directory.ts +2 -2
  14. package/src/handlers/gates/helpers.ts +2 -2
  15. package/src/handlers/gates/path.ts +4 -4
  16. package/src/handlers/gates/runner.ts +7 -4
  17. package/src/handlers/gates/skill-read.ts +5 -5
  18. package/src/handlers/gates/tool.ts +5 -5
  19. package/src/handlers/lifecycle.ts +9 -8
  20. package/src/handlers/permission-gate-handler.ts +12 -7
  21. package/src/logging.ts +3 -0
  22. package/src/node-modules-discovery.ts +1 -1
  23. package/src/normalize.ts +1 -0
  24. package/src/permission-event-rpc.ts +2 -0
  25. package/src/permission-manager.ts +7 -6
  26. package/src/permission-merge.ts +4 -2
  27. package/src/permission-prompter.ts +3 -0
  28. package/src/permission-prompts.ts +1 -1
  29. package/src/policy-loader.ts +5 -5
  30. package/src/service.ts +1 -0
  31. package/src/skill-prompt-sanitizer.ts +3 -3
  32. package/src/tool-registry.ts +1 -1
  33. package/src/wildcard-matcher.ts +2 -2
  34. package/src/yolo-mode.ts +2 -1
  35. package/{tests → test}/active-agent.test.ts +1 -1
  36. package/{tests → test}/bash-arity.test.ts +4 -4
  37. package/{tests → test}/bash-external-directory.test.ts +3 -3
  38. package/{tests → test}/common.test.ts +1 -1
  39. package/{tests → test}/config-loader.test.ts +1 -1
  40. package/{tests → test}/config-modal.test.ts +9 -11
  41. package/{tests → test}/config-paths.test.ts +1 -1
  42. package/{tests → test}/config-reporter.test.ts +4 -4
  43. package/{tests → test}/denial-messages.test.ts +2 -2
  44. package/{tests → test}/expand-home.test.ts +1 -1
  45. package/{tests → test}/extension-config.test.ts +1 -1
  46. package/{tests → test}/extension-paths.test.ts +2 -2
  47. package/{tests → test}/forwarded-permissions/io.test.ts +2 -2
  48. package/{tests → test}/forwarding-manager.test.ts +1 -1
  49. package/{tests → test}/handlers/before-agent-start.test.ts +5 -5
  50. package/{tests → test}/handlers/external-directory-integration.test.ts +8 -8
  51. package/{tests → test}/handlers/external-directory-session-dedup.test.ts +6 -6
  52. package/{tests → test}/handlers/gates/bash-external-directory.test.ts +5 -8
  53. package/{tests → test}/handlers/gates/bash-path.test.ts +6 -9
  54. package/{tests → test}/handlers/gates/external-directory-messages.test.ts +1 -1
  55. package/{tests → test}/handlers/gates/external-directory.test.ts +4 -7
  56. package/{tests → test}/handlers/gates/helpers.test.ts +1 -1
  57. package/{tests → test}/handlers/gates/path.test.ts +6 -6
  58. package/{tests → test}/handlers/gates/runner.test.ts +5 -5
  59. package/{tests → test}/handlers/gates/skill-read.test.ts +12 -14
  60. package/{tests → test}/handlers/gates/tool.test.ts +4 -4
  61. package/{tests → test}/handlers/input-events.test.ts +7 -7
  62. package/{tests → test}/handlers/input.test.ts +5 -5
  63. package/{tests → test}/handlers/lifecycle.test.ts +2 -2
  64. package/{tests → test}/handlers/tool-call-events.test.ts +7 -7
  65. package/{tests → test}/handlers/tool-call.test.ts +5 -5
  66. package/{tests → test}/input-normalizer.test.ts +2 -2
  67. package/{tests → test}/mcp-targets.test.ts +1 -1
  68. package/{tests → test}/node-modules-discovery.test.ts +1 -1
  69. package/{tests → test}/normalize.test.ts +1 -1
  70. package/{tests → test}/path-utils.test.ts +1 -1
  71. package/{tests → test}/pattern-suggest.test.ts +1 -1
  72. package/{tests → test}/permission-dialog.test.ts +1 -1
  73. package/{tests → test}/permission-event-rpc.test.ts +4 -3
  74. package/{tests → test}/permission-events.test.ts +6 -4
  75. package/{tests → test}/permission-forwarding.test.ts +2 -1
  76. package/{tests → test}/permission-gate.test.ts +2 -2
  77. package/{tests → test}/permission-manager-unified.test.ts +9 -7
  78. package/{tests → test}/permission-merge.test.ts +1 -1
  79. package/{tests → test}/permission-prompter.test.ts +4 -4
  80. package/{tests → test}/permission-prompts.test.ts +4 -4
  81. package/{tests → test}/permission-session.test.ts +9 -9
  82. package/{tests → test}/permission-system.test.ts +21 -21
  83. package/{tests → test}/pi-infrastructure-read.test.ts +2 -2
  84. package/{tests → test}/policy-loader.test.ts +1 -1
  85. package/{tests → test}/rule.test.ts +2 -2
  86. package/{tests → test}/runtime.test.ts +4 -4
  87. package/{tests → test}/service.test.ts +4 -4
  88. package/{tests → test}/session-logger.test.ts +2 -2
  89. package/{tests → test}/session-rules.test.ts +2 -2
  90. package/{tests → test}/session-start.test.ts +4 -4
  91. package/{tests → test}/skill-prompt-sanitizer.test.ts +3 -3
  92. package/{tests → test}/subagent-context.test.ts +2 -2
  93. package/{tests → test}/synthesize.test.ts +3 -3
  94. package/{tests → test}/system-prompt-sanitizer.test.ts +1 -1
  95. package/{tests → test}/tool-input-preview.test.ts +3 -3
  96. package/{tests → test}/tool-registry.test.ts +1 -1
  97. package/{tests → test}/wildcard-matcher.test.ts +1 -1
  98. package/{tests → test}/yolo-mode.test.ts +2 -2
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from "vitest";
2
2
 
3
- import { evaluate } from "../src/rule";
4
- import { deriveApprovalPattern, SessionRules } from "../src/session-rules";
3
+ import { evaluate } from "#src/rule";
4
+ import { deriveApprovalPattern, SessionRules } from "#src/session-rules";
5
5
 
6
6
  // ── SessionRules ───────────────────────────────────────────────────────────
7
7
 
@@ -2,10 +2,10 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { dirname, join } from "node:path";
4
4
  import { afterEach, beforeEach, describe, expect, test } from "vitest";
5
- import { getGlobalConfigPath } from "../src/config-paths";
6
- import { DEFAULT_EXTENSION_CONFIG } from "../src/extension-config";
7
- import piPermissionSystemExtension from "../src/index";
8
- import type { ScopeConfig } from "../src/types";
5
+ import { getGlobalConfigPath } from "#src/config-paths";
6
+ import { DEFAULT_EXTENSION_CONFIG } from "#src/extension-config";
7
+ import piPermissionSystemExtension from "#src/index";
8
+ import type { ScopeConfig } from "#src/types";
9
9
 
10
10
  type MockHandler = (
11
11
  event: Record<string, unknown>,
@@ -1,10 +1,10 @@
1
1
  import { afterEach, describe, expect, test, vi } from "vitest";
2
- import type { PermissionManager } from "../src/permission-manager";
2
+ import type { PermissionManager } from "#src/permission-manager";
3
3
  import {
4
4
  findSkillPathMatch,
5
5
  resolveSkillPromptEntries,
6
- } from "../src/skill-prompt-sanitizer";
7
- import type { PermissionCheckResult } from "../src/types";
6
+ } from "#src/skill-prompt-sanitizer";
7
+ import type { PermissionCheckResult } from "#src/types";
8
8
 
9
9
  afterEach(() => {
10
10
  vi.restoreAllMocks();
@@ -1,10 +1,10 @@
1
1
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
2
  import { afterEach, describe, expect, test, vi } from "vitest";
3
- import { SUBAGENT_ENV_HINT_KEYS } from "../src/permission-forwarding";
3
+ import { SUBAGENT_ENV_HINT_KEYS } from "#src/permission-forwarding";
4
4
  import {
5
5
  isSubagentExecutionContext,
6
6
  normalizeFilesystemPath,
7
- } from "../src/subagent-context";
7
+ } from "#src/subagent-context";
8
8
 
9
9
  afterEach(() => {
10
10
  vi.unstubAllEnvs();
@@ -1,11 +1,11 @@
1
1
  import { describe, expect, test } from "vitest";
2
- import type { RuleOrigin } from "../src/rule";
3
- import { evaluate } from "../src/rule";
2
+ import type { RuleOrigin } from "#src/rule";
3
+ import { evaluate } from "#src/rule";
4
4
  import {
5
5
  composeRuleset,
6
6
  synthesizeBaseline,
7
7
  synthesizeDefaults,
8
- } from "../src/synthesize";
8
+ } from "#src/synthesize";
9
9
 
10
10
  // ── synthesizeDefaults ─────────────────────────────────────────────────────
11
11
 
@@ -1,6 +1,6 @@
1
1
  import { afterEach, describe, expect, test, vi } from "vitest";
2
2
 
3
- import { sanitizeAvailableToolsSection } from "../src/system-prompt-sanitizer";
3
+ import { sanitizeAvailableToolsSection } from "#src/system-prompt-sanitizer";
4
4
 
5
5
  afterEach(() => {
6
6
  vi.restoreAllMocks();
@@ -5,7 +5,7 @@ vi.mock("../src/logging.js", () => ({
5
5
  safeJsonStringify: vi.fn((value: unknown) => JSON.stringify(value)),
6
6
  }));
7
7
 
8
- import { safeJsonStringify } from "../src/logging";
8
+ import { safeJsonStringify } from "#src/logging";
9
9
  import {
10
10
  countTextLines,
11
11
  formatCount,
@@ -24,8 +24,8 @@ import {
24
24
  TOOL_INPUT_PREVIEW_MAX_LENGTH,
25
25
  TOOL_TEXT_SUMMARY_MAX_LENGTH,
26
26
  truncateInlineText,
27
- } from "../src/tool-input-preview";
28
- import type { PermissionCheckResult } from "../src/types";
27
+ } from "#src/tool-input-preview";
28
+ import type { PermissionCheckResult } from "#src/types";
29
29
 
30
30
  const mockedStringify = vi.mocked(safeJsonStringify);
31
31
 
@@ -3,7 +3,7 @@ import { afterEach, describe, expect, test, vi } from "vitest";
3
3
  import {
4
4
  checkRequestedToolRegistration,
5
5
  getToolNameFromValue,
6
- } from "../src/tool-registry";
6
+ } from "#src/tool-registry";
7
7
 
8
8
  afterEach(() => {
9
9
  vi.restoreAllMocks();
@@ -16,7 +16,7 @@ import {
16
16
  findCompiledWildcardMatch,
17
17
  findCompiledWildcardMatchForNames,
18
18
  wildcardMatch,
19
- } from "../src/wildcard-matcher";
19
+ } from "#src/wildcard-matcher";
20
20
 
21
21
  afterEach(() => {
22
22
  mockHomedir.mockClear();
@@ -1,9 +1,9 @@
1
1
  import { afterEach, describe, expect, test, vi } from "vitest";
2
- import type { PermissionSystemExtensionConfig } from "../src/extension-config";
2
+ import type { PermissionSystemExtensionConfig } from "#src/extension-config";
3
3
  import {
4
4
  canResolveAskPermissionRequest,
5
5
  shouldAutoApprovePermissionState,
6
- } from "../src/yolo-mode";
6
+ } from "#src/yolo-mode";
7
7
 
8
8
  afterEach(() => {
9
9
  vi.restoreAllMocks();