@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.
- package/CHANGELOG.md +14 -0
- package/package.json +7 -3
- package/src/active-agent.ts +1 -1
- package/src/bash-arity.ts +1 -0
- package/src/config-modal.ts +2 -0
- package/src/forwarded-permissions/io.ts +4 -2
- package/src/forwarded-permissions/polling.ts +8 -7
- package/src/handlers/before-agent-start.ts +7 -6
- package/src/handlers/gates/bash-external-directory.ts +4 -4
- package/src/handlers/gates/bash-path-extractor.ts +4 -6
- package/src/handlers/gates/bash-path.ts +5 -5
- package/src/handlers/gates/descriptor.ts +6 -6
- package/src/handlers/gates/external-directory.ts +2 -2
- package/src/handlers/gates/helpers.ts +2 -2
- package/src/handlers/gates/path.ts +4 -4
- package/src/handlers/gates/runner.ts +7 -4
- package/src/handlers/gates/skill-read.ts +5 -5
- package/src/handlers/gates/tool.ts +5 -5
- package/src/handlers/lifecycle.ts +9 -8
- package/src/handlers/permission-gate-handler.ts +12 -7
- package/src/logging.ts +3 -0
- package/src/node-modules-discovery.ts +1 -1
- package/src/normalize.ts +1 -0
- package/src/permission-event-rpc.ts +2 -0
- package/src/permission-manager.ts +7 -6
- package/src/permission-merge.ts +4 -2
- package/src/permission-prompter.ts +3 -0
- package/src/permission-prompts.ts +1 -1
- package/src/policy-loader.ts +5 -5
- package/src/service.ts +1 -0
- package/src/skill-prompt-sanitizer.ts +3 -3
- package/src/tool-registry.ts +1 -1
- package/src/wildcard-matcher.ts +2 -2
- package/src/yolo-mode.ts +2 -1
- package/{tests → test}/active-agent.test.ts +1 -1
- package/{tests → test}/bash-arity.test.ts +4 -4
- package/{tests → test}/bash-external-directory.test.ts +3 -3
- package/{tests → test}/common.test.ts +1 -1
- package/{tests → test}/config-loader.test.ts +1 -1
- package/{tests → test}/config-modal.test.ts +9 -11
- package/{tests → test}/config-paths.test.ts +1 -1
- package/{tests → test}/config-reporter.test.ts +4 -4
- package/{tests → test}/denial-messages.test.ts +2 -2
- package/{tests → test}/expand-home.test.ts +1 -1
- package/{tests → test}/extension-config.test.ts +1 -1
- package/{tests → test}/extension-paths.test.ts +2 -2
- package/{tests → test}/forwarded-permissions/io.test.ts +2 -2
- package/{tests → test}/forwarding-manager.test.ts +1 -1
- package/{tests → test}/handlers/before-agent-start.test.ts +5 -5
- package/{tests → test}/handlers/external-directory-integration.test.ts +8 -8
- package/{tests → test}/handlers/external-directory-session-dedup.test.ts +6 -6
- package/{tests → test}/handlers/gates/bash-external-directory.test.ts +5 -8
- package/{tests → test}/handlers/gates/bash-path.test.ts +6 -9
- package/{tests → test}/handlers/gates/external-directory-messages.test.ts +1 -1
- package/{tests → test}/handlers/gates/external-directory.test.ts +4 -7
- package/{tests → test}/handlers/gates/helpers.test.ts +1 -1
- package/{tests → test}/handlers/gates/path.test.ts +6 -6
- package/{tests → test}/handlers/gates/runner.test.ts +5 -5
- package/{tests → test}/handlers/gates/skill-read.test.ts +12 -14
- package/{tests → test}/handlers/gates/tool.test.ts +4 -4
- package/{tests → test}/handlers/input-events.test.ts +7 -7
- package/{tests → test}/handlers/input.test.ts +5 -5
- package/{tests → test}/handlers/lifecycle.test.ts +2 -2
- package/{tests → test}/handlers/tool-call-events.test.ts +7 -7
- package/{tests → test}/handlers/tool-call.test.ts +5 -5
- package/{tests → test}/input-normalizer.test.ts +2 -2
- package/{tests → test}/mcp-targets.test.ts +1 -1
- package/{tests → test}/node-modules-discovery.test.ts +1 -1
- package/{tests → test}/normalize.test.ts +1 -1
- package/{tests → test}/path-utils.test.ts +1 -1
- package/{tests → test}/pattern-suggest.test.ts +1 -1
- package/{tests → test}/permission-dialog.test.ts +1 -1
- package/{tests → test}/permission-event-rpc.test.ts +4 -3
- package/{tests → test}/permission-events.test.ts +6 -4
- package/{tests → test}/permission-forwarding.test.ts +2 -1
- package/{tests → test}/permission-gate.test.ts +2 -2
- package/{tests → test}/permission-manager-unified.test.ts +9 -7
- package/{tests → test}/permission-merge.test.ts +1 -1
- package/{tests → test}/permission-prompter.test.ts +4 -4
- package/{tests → test}/permission-prompts.test.ts +4 -4
- package/{tests → test}/permission-session.test.ts +9 -9
- package/{tests → test}/permission-system.test.ts +21 -21
- package/{tests → test}/pi-infrastructure-read.test.ts +2 -2
- package/{tests → test}/policy-loader.test.ts +1 -1
- package/{tests → test}/rule.test.ts +2 -2
- package/{tests → test}/runtime.test.ts +4 -4
- package/{tests → test}/service.test.ts +4 -4
- package/{tests → test}/session-logger.test.ts +2 -2
- package/{tests → test}/session-rules.test.ts +2 -2
- package/{tests → test}/session-start.test.ts +4 -4
- package/{tests → test}/skill-prompt-sanitizer.test.ts +3 -3
- package/{tests → test}/subagent-context.test.ts +2 -2
- package/{tests → test}/synthesize.test.ts +3 -3
- package/{tests → test}/system-prompt-sanitizer.test.ts +1 -1
- package/{tests → test}/tool-input-preview.test.ts +3 -3
- package/{tests → test}/tool-registry.test.ts +1 -1
- package/{tests → test}/wildcard-matcher.test.ts +1 -1
- 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 "
|
|
4
|
-
import { deriveApprovalPattern, SessionRules } from "
|
|
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 "
|
|
6
|
-
import { DEFAULT_EXTENSION_CONFIG } from "
|
|
7
|
-
import piPermissionSystemExtension from "
|
|
8
|
-
import type { ScopeConfig } from "
|
|
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 "
|
|
2
|
+
import type { PermissionManager } from "#src/permission-manager";
|
|
3
3
|
import {
|
|
4
4
|
findSkillPathMatch,
|
|
5
5
|
resolveSkillPromptEntries,
|
|
6
|
-
} from "
|
|
7
|
-
import type { PermissionCheckResult } from "
|
|
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 "
|
|
3
|
+
import { SUBAGENT_ENV_HINT_KEYS } from "#src/permission-forwarding";
|
|
4
4
|
import {
|
|
5
5
|
isSubagentExecutionContext,
|
|
6
6
|
normalizeFilesystemPath,
|
|
7
|
-
} from "
|
|
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 "
|
|
3
|
-
import { evaluate } from "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
28
|
-
import type { PermissionCheckResult } from "
|
|
27
|
+
} from "#src/tool-input-preview";
|
|
28
|
+
import type { PermissionCheckResult } from "#src/types";
|
|
29
29
|
|
|
30
30
|
const mockedStringify = vi.mocked(safeJsonStringify);
|
|
31
31
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { afterEach, describe, expect, test, vi } from "vitest";
|
|
2
|
-
import type { PermissionSystemExtensionConfig } from "
|
|
2
|
+
import type { PermissionSystemExtensionConfig } from "#src/extension-config";
|
|
3
3
|
import {
|
|
4
4
|
canResolveAskPermissionRequest,
|
|
5
5
|
shouldAutoApprovePermissionState,
|
|
6
|
-
} from "
|
|
6
|
+
} from "#src/yolo-mode";
|
|
7
7
|
|
|
8
8
|
afterEach(() => {
|
|
9
9
|
vi.restoreAllMocks();
|