@hank-warren/pi-auto-permissions 0.8.0 → 0.9.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 +25 -0
- package/guardian-transport.ts +19 -7
- package/index.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @hank-warren/pi-auto-permissions
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7d96995: Stop `pi-herdr-auto-title` depending on `pi-auto-permissions`.
|
|
8
|
+
|
|
9
|
+
The pane-title extension deep-imported `guardian-transport.ts` — roughly forty lines resolving `completeSimple` through the host `ModelRuntime` so provider extensions (Anthropic OAuth shaping) apply to background model calls. Reusing it cost an entire dependency on the permissions engine: 125 kB unpacked in `node_modules`, a transitive `pi-permission-selector`, and a no-op release of the title extension every time the guardian shipped.
|
|
10
|
+
|
|
11
|
+
The file is now duplicated byte-for-byte into both packages, and `scripts/validate.py` fails if the copies drift. `pi-herdr-auto-title` declares no dependencies at all and its tarball is unchanged apart from the added source file.
|
|
12
|
+
|
|
13
|
+
To keep the copies identical, `resolveGuardianCompleteSimple` takes the calling package's name as a second argument and uses it in the compat-fallback warning, replacing the hardcoded `[pi-auto-permissions]` prefix. That is a breaking change only for an external deep import of `@hank-warren/pi-auto-permissions/guardian-transport.ts`; the extension's own behavior is unchanged.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 7d96995: Make every declared dependency accurate.
|
|
18
|
+
|
|
19
|
+
`pi-permission-selector` no longer declares a `@earendil-works/pi-coding-agent` peer dependency. It imports nothing from it — the claim was left over from 1.0.0, which removed the extension and the selector monkey patch and turned the package into a pure library.
|
|
20
|
+
|
|
21
|
+
`pi-auto-permissions` floors `@hank-warren/pi-permission-selector` at `^1.1.0` and `pi-plan-mode` floors `@narumitw/pi-tui-kit` at `^0.49.3`, in both cases the lowest version the package is actually tested against. Neither uses a feature the old floor lacked, so nothing changes at install time under caret resolution; the ranges simply no longer claim support that nothing verifies.
|
|
22
|
+
|
|
23
|
+
`scripts/validate.py` now enforces that a package's Pi `peerDependencies` are exactly the Pi packages its shipped sources import, in both directions.
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [7d96995]
|
|
26
|
+
- @hank-warren/pi-permission-selector@1.1.1
|
|
27
|
+
|
|
3
28
|
## 0.8.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
package/guardian-transport.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { completeSimple } from "@earendil-works/pi-ai/compat";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Model dispatch seam for extension-issued background model calls.
|
|
5
5
|
*
|
|
6
6
|
* pi-ai's `compat.completeSimple` dispatches through pi-ai's own api registry,
|
|
7
7
|
* which extension-registered provider transports never reach: pi routes
|
|
8
8
|
* `pi.registerProvider()` configs only through the coding agent's
|
|
9
9
|
* `ModelRuntime` -> `provider-composer.streamWith`. Auth-shaping extensions
|
|
10
10
|
* such as `@gotgenes/pi-anthropic-auth` install their transport wrapper there,
|
|
11
|
-
* so a
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* so a request issued via `compat.completeSimple` reaches Anthropic unshaped,
|
|
12
|
+
* and Claude Pro/Max OAuth requests fail with the misleading "extra usage"
|
|
13
|
+
* HTTP 400 (see gotgenes/pi-anthropic-auth docs/architecture.md, "The
|
|
14
|
+
* remaining gap: pi-ai compat dispatch").
|
|
15
15
|
*
|
|
16
16
|
* `ExtensionContext.modelRegistry` is a deliberately narrowed facade over
|
|
17
17
|
* `ModelRuntime` that re-exports `complete()` but not `completeSimple()` —
|
|
@@ -21,12 +21,24 @@ import { completeSimple } from "@earendil-works/pi-ai/compat";
|
|
|
21
21
|
* marked `private` in the .d.ts), and fall back to compat dispatch when a
|
|
22
22
|
* future pi release renames the seam — degrading to the historical behavior
|
|
23
23
|
* instead of crashing.
|
|
24
|
+
*
|
|
25
|
+
* THIS FILE IS DUPLICATED VERBATIM across packages/pi-auto-permissions and
|
|
26
|
+
* packages/pi-herdr-auto-title, and `scripts/validate.py` fails if the copies
|
|
27
|
+
* differ by a single byte. The duplication is deliberate: sharing it made a
|
|
28
|
+
* pane-titling extension depend on an entire permissions engine to reuse a
|
|
29
|
+
* dozen lines. Edit one copy, then copy it over the other. Every
|
|
30
|
+
* package-specific detail must stay behind a parameter — hence `packageLabel`.
|
|
31
|
+
* The "guardian" in the names is historical: pi-auto-permissions' guardian
|
|
32
|
+
* reviewer was the first caller.
|
|
24
33
|
*/
|
|
25
34
|
export type GuardianCompleteSimple = typeof completeSimple;
|
|
26
35
|
|
|
27
36
|
let warnedCompatFallback = false;
|
|
28
37
|
|
|
29
|
-
export function resolveGuardianCompleteSimple(
|
|
38
|
+
export function resolveGuardianCompleteSimple(
|
|
39
|
+
modelRegistry: unknown,
|
|
40
|
+
packageLabel: string,
|
|
41
|
+
): GuardianCompleteSimple {
|
|
30
42
|
const runtime = (modelRegistry as { runtime?: unknown } | null | undefined)?.runtime;
|
|
31
43
|
const candidate = (runtime as { completeSimple?: unknown } | null | undefined)?.completeSimple;
|
|
32
44
|
if (typeof candidate === "function") {
|
|
@@ -35,7 +47,7 @@ export function resolveGuardianCompleteSimple(modelRegistry: unknown): GuardianC
|
|
|
35
47
|
if (!warnedCompatFallback) {
|
|
36
48
|
warnedCompatFallback = true;
|
|
37
49
|
console.warn(
|
|
38
|
-
|
|
50
|
+
`[${packageLabel}] host ModelRuntime completeSimple is unavailable; falling back to pi-ai compat dispatch. Extension-registered provider transports (e.g. Anthropic OAuth shaping) will not apply to this extension's model calls.`,
|
|
39
51
|
);
|
|
40
52
|
}
|
|
41
53
|
return completeSimple;
|
package/index.ts
CHANGED
|
@@ -383,7 +383,7 @@ export default function autoPermissionsExtension(pi: ExtensionAPI) {
|
|
|
383
383
|
}
|
|
384
384
|
// Dispatch through the host ModelRuntime so extension-registered provider
|
|
385
385
|
// transports (e.g. pi-anthropic-auth OAuth shaping) apply; see guardian-transport.ts.
|
|
386
|
-
const response = await resolveGuardianCompleteSimple(ctx.modelRegistry)(
|
|
386
|
+
const response = await resolveGuardianCompleteSimple(ctx.modelRegistry, "pi-auto-permissions")(
|
|
387
387
|
model,
|
|
388
388
|
{ systemPrompt, messages },
|
|
389
389
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hank-warren/pi-auto-permissions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Fork of @ogulcancelik/pi-auto-permissions with dialog-answer user evidence: context-aware Bash permissions for Pi with automated guardian review.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"CHANGELOG.md"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@hank-warren/pi-permission-selector": "^1.
|
|
58
|
+
"@hank-warren/pi-permission-selector": "^1.1.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@earendil-works/pi-ai": "*",
|