@rosetears/aili-pi 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -62,18 +62,18 @@ Zentui enables its experimental fixed-bottom editor by default when the installe
62
62
  - `/ideate`, `/define`, `/build`, `/ship`: the four AILI delivery modes.
63
63
  - `/local-review`: a standalone local audit, not a fifth lifecycle mode.
64
64
  - `/aili-doctor` or `/aili-doctor --json`: human or machine-readable health evidence.
65
- - `/perm`: upstream `pi-permission-modes` control for `Default`, `Plan`, `Build`, and `YOLO`.
65
+ - `/perm`: the revision-bound `pi-permission-modes@2.2.0` adaptation controls `Default`, `Plan`, `Build`, and `YOLO`.
66
66
  - `Alt+M`: upstream mode-cycle shortcut.
67
67
  - `/aili-install-global-resources`: explicit installation/update of marker-owned global ROSE and AILI-role resources.
68
68
 
69
- `pi-permission-modes` owns mode persistence, prompts, and sandbox behavior. A Linux disposable fixture verified its stock Build profile through installed Bubblewrap, while an incompatible Git-worktree fixture visibly fell back to confirmation. This is not an isolation guarantee. `YOLO` is an upstream unrestricted mode and must be treated accordingly.
69
+ The `pi-permission-modes@2.2.0` baseline owns mode persistence, prompts, and sandbox behavior. AILI carries one hash-locked matcher adaptation so `*` and `?` also match line terminators; this prevents multiline Bash/heredoc text from falling through YOLO's `"*": "allow"` rule while retaining custom ask/deny and fail-closed fallback behavior across every pattern-map surface. A Linux disposable fixture verified the stock Build profile through installed Bubblewrap, while an incompatible Git-worktree fixture visibly fell back to confirmation. This is not an isolation guarantee. `YOLO` remains an unrestricted, unsandboxed mode and must be treated accordingly.
70
70
 
71
71
  ## Native integrations and side effects
72
72
 
73
73
  - `pi-web-access@0.13.0` provides its complete upstream web-search, content-fetch, curator, clone/PDF/video, and bundled-skill surface. Its provider fallback, network traffic, config/credential paths, clone cache, temporary curator service, downloads, and optional browser-cookie access are upstream behavior; inspect its tool requests and configuration before use.
74
74
  - `pi-quota-status@0.3.0` is enabled by default. It may maintain `~/.pi/agent/pi-quota-status/state.json`; `/quota config` creates its configuration template. Zentui displays exactly one weekly value as `codex <percent> <reset>`, preferring explicit `Wk` data and treating the dependency's current `5h`-labeled primary value only as a compatibility fallback when weekly is absent.
75
- - `pi-permission-modes@2.2.0` provides the permission UI and sandbox degradation behavior above. AILI does not retain `/aili-mode` or `Ctrl+Shift+Alt+A` as competing controls.
76
- - `@agwab/pi-subagent@0.4.8` owns the generic `subagent` tool, child spawn, cancellation, durable run/artifact lifecycle, bounded parallel fan-out, async actions, worktrees, external `cwd`, and sandbox options. The 19 `aili.<role>` profiles are optional named agents; generic or agentless runs do not use an AILI-only result schema. AILI adds a bounded requested `Agent:`/`Agents:` heading above upstream run-call rendering and injects an immutable credential-path guard; child Pi processes load the ambient AILI `pi-permission-modes` registration exactly once. The upstream runner excludes recursive `subagent` exposure inside workers.
75
+ - `pi-permission-modes@2.2.0` provides the permission UI and sandbox degradation behavior above through AILI's exact-source adaptation. The only semantic source change is line-terminator-safe shared glob matching; `upstream/pi-permission-modes.lock.json` records the baseline and adapted hashes. AILI does not retain `/aili-mode` or `Ctrl+Shift+Alt+A` as competing controls.
76
+ - `@agwab/pi-subagent@0.4.8` owns the generic `subagent` tool, child spawn, cancellation, durable run/artifact lifecycle, bounded parallel fan-out, async actions, worktrees, external `cwd`, and sandbox options. On Pi 0.81.1, AILI routes ordinary omitted/`auto` calls to `headless` because the pinned inline runner calls removed SDK factories; explicit `inline` stops before model startup with a compatibility diagnostic. Explicit `headless`/`tmux`, visible auto, sandbox auto, lifecycle actions, and caller options remain upstream paths. A mixed parallel auto call that combines visible tasks with ordinary uncontained tasks is rejected rather than silently sending one class through broken inline. The 19 `aili.<role>` profiles are optional named agents; generic or agentless runs do not use an AILI-only result schema. AILI also adds a bounded requested `Agent:`/`Agents:` heading and an immutable credential-path guard. The upstream runner excludes recursive `subagent` exposure inside workers.
77
77
  - `pi-cache-optimizer@2.6.18` provides `/cache-optimizer`, provider cache diagnostics, cache statistics, and prompt-cache optimization. It may maintain `~/.pi/agent/pi-cache-optimizer-stats.json`; `/cache-optimizer fix` is interactive and is the only command that may propose editing `models.json`.
78
78
  - `pi-markdown-preview@0.10.1` provides `/preview`, `/preview-browser`, `/preview-pdf`, `/preview-clear-cache`, and the `preview_export` tool. Terminal/browser previews require a Chromium executable; PDF export additionally requires Pandoc and a LaTeX engine.
79
79
  - `@narumitw/pi-lsp@0.25.0` provides language-agnostic `lsp_diagnostics`, `lsp_fix`, and `/lsp`. It supports routes for C/C++, Python, CSS/SCSS, JavaScript/TypeScript, Go, Rust, Java, Kotlin, Bash, YAML, Terraform, and other languages. It does not download language servers; install the required commands separately and configure project routes in `.pi/pi-lsp.json` or user routes in `~/.pi/agent/pi-lsp.json`.
@@ -93,7 +93,7 @@ When unavailable, runtime and doctor output use explicit `SKIP`/`WARN` results a
93
93
 
94
94
  ## Security boundary
95
95
 
96
- AILI injects a non-removable guard that denies standard Pi file-tool and parsed-bash access to credential, authentication, and private-key paths, including from an external `cwd`, a YOLO permission mode, or a caller-supplied child extension list. Child Pi processes load the ambient AILI `pi-permission-modes` registration exactly once, so vendor permission prompts and sandbox behavior remain active; headless confirmation requests fail closed. The guard does not make arbitrary third-party extension code safe: extensions remain trusted code and may have direct process authority. Neither AILI nor Pi provides a universal OS sandbox or containment: trusted extensions, user-authority processes, ambient network access, and filesystem races remain in the user trust domain. Inspect exact approval targets and do not put credentials in task text.
96
+ AILI injects a non-removable guard that denies standard Pi file-tool and parsed-bash access to credential, authentication, and private-key paths, including from an external `cwd`, a YOLO permission mode, or a caller-supplied child extension list. Child Pi processes load the ambient AILI permission-mode registration exactly once, so adapted permission prompts and sandbox behavior remain active; headless confirmation requests fail closed. The guard does not make arbitrary third-party extension code safe: extensions remain trusted code and may have direct process authority. Neither AILI nor Pi provides a universal OS sandbox or containment: trusted extensions, user-authority processes, ambient network access, and filesystem races remain in the user trust domain. Inspect exact approval targets and do not put credentials in task text.
97
97
 
98
98
  Use `subagent` lifecycle actions (`status`, `logs`, `wait`, `interrupt`, `mark-background`, and `reconcile`) to inspect durable async work. Upstream fan-out is version-bounded rather than capped by AILI at two; background completion is not evidence until inspected. Subagents are a benefit-based way to improve execution efficiency and preserve the main agent's context: the main agent owns decisions, scope, integration, and final verification, while bounded discovery, implementation, testing, or other execution may be delegated when specialist, parallelism, or context-isolation benefits outweigh orchestration cost. Direct parent work remains valid when delegation has no clear net benefit; no subagent call is required to unlock file mutation. Provider/model behavior still depends on the configured Pi environment.
99
99
 
@@ -101,6 +101,7 @@ Use `subagent` lifecycle actions (`status`, `logs`, `wait`, `interrupt`, `mark-b
101
101
 
102
102
  - `upstream/aili-workflows.lock.json` pins the exact canonical 64-skill/471-file snapshot.
103
103
  - `upstream/opencode-global-agents.lock.json` pins the global AGENTS source revision/hash and documents its Pi-native derivation.
104
+ - `upstream/pi-permission-modes.lock.json` pins the exact upstream and adapted permission runtime files and semantic diff.
104
105
  - `manifests/skill-compatibility.json` records one compatibility state per skill.
105
106
  - `manifests/roles.json` records the 19 generated Pi role profiles.
106
107
  - `manifests/provenance.json`, `manifests/sbom.json`, and `THIRD_PARTY_NOTICES.md` record adapted/reference sources and the exact npm lock inventory.
@@ -119,6 +120,9 @@ npm run validate:release
119
120
  - **Package install failure:** keep the reported Pi/AILI states distinct. Retry the printed `pi install` command after fixing the cause; do not automatically remove a pre-existing package.
120
121
  - **Doctor is non-pass:** inspect the exact `ERROR`, `WARN`, `SKIP`, or `UNVERIFIED` component. Missing optional packs are not core execution success.
121
122
  - **Permission shortcut does nothing:** use `/perm`; terminal multiplexers may consume `Alt+M`.
123
+ - **YOLO still asks for multiline Bash:** confirm the loaded Package contains the adapted permission runtime with `npm run verify:permission-modes`; do not work around it by granting every distinct script for the session.
124
+ - **Subagent reports the inline SDK `reading 'create'` failure:** omit `backend` or use `backend: "headless"`; explicit inline is unsupported for the pinned Pi 0.81.1 / subagent 0.4.8 pair.
125
+ - **Sandboxed subagent cannot authenticate or reach its model:** `sandbox:true` is deny-all network, and model-backed sandbox calls must allow the exact provider endpoint while preserving credential protections. This is separate from default-backend compatibility.
122
126
  - **Global resources are non-pass:** run `/aili-install-global-resources` only after reviewing the exact `~/.pi/agent/` targets. A malformed marker or an unowned role collision intentionally leaves files unchanged.
123
127
  - **Offline use:** the installed Package embeds the pinned skills and does not fetch `aili-workflows` at runtime. Its Pi-managed npm lifecycle synchronizes only pre-existing same-name global skills from that embedded fixed snapshot. First-time Pi/package installation still requires the relevant package sources.
124
128
 
@@ -22,18 +22,18 @@ This distribution is MIT-licensed. The following adapted sources and locked deve
22
22
  - License: MIT
23
23
  - Source files: src/index.ts, src/api.ts, src/runners/headless-model.ts, src/artifacts/result.ts
24
24
  - Reused symbols/patterns: subagent tool renderCall, runSubagent API, headless lifecycle, artifact envelope
25
- - Local changes: AILI registers the full pinned upstream subagent tool schema, prepends a sanitized bounded requested-Agent heading to upstream run-call rendering, injects a non-removable credential guard, and relies on the ambient AILI pi-permission-modes registration exactly once in each child; no upstream source is copied
25
+ - Local changes: AILI registers the full pinned upstream subagent tool schema, prepends a sanitized bounded requested-Agent heading, injects a non-removable credential guard, normalizes ordinary omitted/auto runs to headless for the Pi 0.81.1 compatibility window, and rejects explicit inline before model startup; no upstream source is copied
26
26
 
27
27
  ## pi-permission-modes
28
28
 
29
- - Status: dependency
29
+ - Status: adapted
30
30
  - Source: https://github.com/wynainfo/pi-permission-modes.git
31
31
  - Revision: 23d65d10a53b67043cae42322acf9044d6edb196
32
32
  - Version: 2.2.0
33
33
  - License: MIT
34
- - Source files: src/index.ts, permission-mode.defaults.json
35
- - Reused symbols/patterns: Default/Plan/Build/YOLO, /perm, Alt+M, sandbox degradation
36
- - Local changes: AILI initializes the pinned upstream extension and does not retain a competing AILI mode command or shortcut
34
+ - Source files: src/vendor/pi-permission-modes/index.ts, src/vendor/pi-permission-modes/resolve.ts, upstream/pi-permission-modes.lock.json, licenses/pi-permission-modes-MIT.txt
35
+ - Reused symbols/patterns: Default/Plan/Build/YOLO, /perm, Alt+M, shared permission pattern matcher, sandbox degradation
36
+ - Local changes: AILI's generated adapted entry redirects unchanged sibling modules to the exact 2.2.0 dependency; the owned resolve.ts compiles permission globs with RegExp dotAll so * and ? include ECMAScript line terminators; the exact upstream and adapted files are hash-locked and drift-checked
37
37
 
38
38
  ## pi-quota-status
39
39
 
@@ -105,4 +105,4 @@ This distribution is MIT-licensed. The following adapted sources and locked deve
105
105
 
106
106
  The exact 424-entry package-lock inventory, versions, integrity values, dependency scope, and declared licenses is recorded in `manifests/sbom.json`.
107
107
 
108
- Runtime dependencies are initialized through the single AILI Extension entry; no third-party source tree is copied into this package.
108
+ Runtime dependencies are initialized through the single AILI Extension entry. Package-owned third-party adaptations are copied only where their provenance sourceFiles explicitly name repository paths.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nico Merz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -11,7 +11,7 @@
11
11
  "vitest run tests/unit/runtime.test.ts"
12
12
  ],
13
13
  "artifacts": [
14
- { "path": "package-lock.json", "sha256": "b1356fd5c37f5e69387fb7d4acaeb3777c8d117f3906e51def4d5f8918b7391e" },
14
+ { "path": "package-lock.json", "sha256": "a9e5a3e4d1076b3179dd8cca5ef89f9fddc838e0acf9abcc1f42daf2a90ddafb" },
15
15
  { "path": "tests/integration/extension-load.test.ts", "sha256": "f2fdceb965f55bc481acc6457eee5cac9499dac08e8c3d17ca60efd07f13e96c" },
16
16
  { "path": "tests/unit/runtime.test.ts", "sha256": "9e99920e7e16529f109771d659f611c9fa580941a5dbf924b2d9d117dd3adeee" }
17
17
  ]
@@ -24,21 +24,22 @@
24
24
  "verification": [
25
25
  "npm run verify:roles",
26
26
  "vitest run tests/unit/roles.test.ts tests/unit/subagents.test.ts",
27
- "vitest run tests/integration/generic-permission.test.ts",
28
- "AILI_LIVE_SUBAGENT_PROBE=static npx vitest run tests/integration/live-subagent.test.ts",
29
- "AILI_LIVE_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
27
+ "vitest run tests/integration/generic-subagent.test.ts tests/integration/generic-permission.test.ts",
28
+ "AILI_LIVE_GENERIC_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts",
29
+ "AILI_LIVE_CREDENTIAL_GUARD_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
30
30
  ],
31
31
  "artifacts": [
32
- { "path": "src/runtime/subagents.ts", "sha256": "4fa3ca548e2d2038410f0c9a3a2e41c5137ebf2dff7987d3e0be6e62bb9f6412" },
32
+ { "path": "src/runtime/subagents.ts", "sha256": "9f09e0e8a380d026d82b0842f2c687da2f3529b43a7ef6d1a6aad47d71190d48" },
33
33
  { "path": "src/runtime/child-guard.ts", "sha256": "9da3c1d80805fd76bbf7a7fd253dff44f0756439fdee039bd7d7fd30766329e1" },
34
34
  { "path": "src/runtime/credential-guard.ts", "sha256": "01d76ff0a9a2a0a08a2d2e52b6ed050d925df5e5bea1e6194130e00bfe22cde3" },
35
- { "path": "tests/unit/subagents.test.ts", "sha256": "93602a401e058d1870922b213f8f0a00dc35e869a704b0c551442d3d8454054a" },
35
+ { "path": "tests/unit/subagents.test.ts", "sha256": "16fc1fbd1759befeed03a2428294c28d662022622c61a6444e23b365dc7447aa" },
36
36
  { "path": "tests/unit/child-guard.test.ts", "sha256": "b187d6d84cd0829ae5474e133b4df911a80b75b9e89622b8543a1c5894be4974" },
37
- { "path": "tests/integration/generic-permission.test.ts", "sha256": "1e113af5b5cce59f365bc12a1735e1aa269c0a739fe6fc7aa4c9131818869ce5" },
37
+ { "path": "tests/integration/generic-permission.test.ts", "sha256": "90cc4ee67098f671dddac495d5e2cd5dc2c50131297fd04f0d72a1ca44217f24" },
38
+ { "path": "tests/integration/generic-subagent.test.ts", "sha256": "a13f8564bdd1bd735f9313d2ad71511a47c939dd6351f2f460771cb48a7fc80b" },
38
39
  { "path": "tests/unit/roles.test.ts", "sha256": "72b61af16ff66506aaaceac28c92d8b3756741e3c4df0544686b3d4940215b57" },
39
40
  { "path": "scripts/sync-roles.ts", "sha256": "a4fd66c95d91ebd92f0b1c6164a84809c4b5a1bf1e185dbdd61af23688dd2d9c" },
40
- { "path": "tests/integration/live-subagent.test.ts", "sha256": "46a907526890c4cd4a4e1d768fca51173c9a0c3db37ac83ba57db23d54d7f339" },
41
- { "path": "manifests/live-verification.json", "sha256": "4080de48114ef5aea3a5cc201e3b704acf65833c5dee64c38cd9b41f44740c04" }
41
+ { "path": "tests/integration/live-subagent.test.ts", "sha256": "b88750f74b203cdbdb9d0e453e16f720ff4d8e4591ca140e0a3c7e1d8428868c" },
42
+ { "path": "manifests/live-verification.json", "sha256": "f5c80dfb2fb989b43af3b7460510b0a546cc05f8ff9e671c3e9284384c33d95b" }
42
43
  ]
43
44
  }
44
45
  ]
@@ -1,32 +1,40 @@
1
1
  {
2
- "schemaVersion": 1,
2
+ "schemaVersion": 2,
3
3
  "platform": "linux",
4
4
  "piVersion": "0.81.1",
5
+ "subagentVersion": "0.4.8",
5
6
  "status": "passed",
6
- "approvedScope": "generic agentless headless children; one read-only repository package.json probe and one disposable external .env denial probe; no business-file mutation, bash, worktree, sandbox, or global-home access; only approved temporary run artifacts were created and removed",
7
+ "approvedScope": "On 2026-07-24, the user authorized two bounded live probes after repository-local compatibility verification: an omitted-backend, agentless child restricted to reading package.json, and an explicit-headless credential guard child restricted to a disposable .env sentinel. Both probes used only their declared temporary artifact roots and completed without business-file changes.",
7
8
  "probes": [
8
9
  {
9
10
  "id": "generic-subagent-fixtures",
10
11
  "command": "npx vitest run tests/unit/subagents.test.ts tests/integration/generic-subagent.test.ts",
11
- "status": "passed"
12
+ "status": "passed",
13
+ "changedFiles": 0,
14
+ "backendRequest": "matrix",
15
+ "resolvedBackend": "headless"
12
16
  },
13
17
  {
14
- "id": "generic-agentless-read-package",
18
+ "id": "generic-agentless-default-path",
15
19
  "command": "AILI_LIVE_GENERIC_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts",
16
20
  "status": "passed",
17
- "changedFiles": 0
21
+ "changedFiles": 0,
22
+ "backendRequest": "omitted",
23
+ "resolvedBackend": "headless"
18
24
  },
19
25
  {
20
- "id": "generic-credential-guard",
26
+ "id": "generic-credential-guard-explicit-headless",
21
27
  "command": "AILI_LIVE_CREDENTIAL_GUARD_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts",
22
28
  "status": "passed",
23
- "changedFiles": 0
29
+ "changedFiles": 0,
30
+ "backendRequest": "explicit-headless",
31
+ "resolvedBackend": "headless"
24
32
  }
25
33
  ],
26
34
  "implementation": {
27
- "src/runtime/subagents.ts": "4fa3ca548e2d2038410f0c9a3a2e41c5137ebf2dff7987d3e0be6e62bb9f6412",
28
- "tests/unit/subagents.test.ts": "93602a401e058d1870922b213f8f0a00dc35e869a704b0c551442d3d8454054a",
29
- "tests/integration/live-subagent.test.ts": "46a907526890c4cd4a4e1d768fca51173c9a0c3db37ac83ba57db23d54d7f339"
35
+ "src/runtime/subagents.ts": "9f09e0e8a380d026d82b0842f2c687da2f3529b43a7ef6d1a6aad47d71190d48",
36
+ "tests/unit/subagents.test.ts": "16fc1fbd1759befeed03a2428294c28d662022622c61a6444e23b365dc7447aa",
37
+ "tests/integration/live-subagent.test.ts": "b88750f74b203cdbdb9d0e453e16f720ff4d8e4591ca140e0a3c7e1d8428868c"
30
38
  },
31
- "credentialHandling": "Existing Pi authentication was used by Pi; AILI did not copy, print, or modify authentication files."
39
+ "credentialHandling": "The explicit-headless credential guard probe used only a disposable .env sentinel. It completed with changedFiles=0; the sentinel was absent from the model-visible result and every temporary artifact before cleanup."
32
40
  }
@@ -30,8 +30,8 @@
30
30
  "status": "dependency",
31
31
  "sourceFiles": ["src/index.ts", "src/api.ts", "src/runners/headless-model.ts", "src/artifacts/result.ts"],
32
32
  "symbols": ["subagent tool renderCall", "runSubagent API", "headless lifecycle", "artifact envelope"],
33
- "localChanges": ["AILI registers the full pinned upstream subagent tool schema, prepends a sanitized bounded requested-Agent heading to upstream run-call rendering, injects a non-removable credential guard, and relies on the ambient AILI pi-permission-modes registration exactly once in each child; no upstream source is copied"],
34
- "verification": ["tests/unit/subagents.test.ts", "tests/integration/package-runtime.test.ts"]
33
+ "localChanges": ["AILI registers the full pinned upstream subagent tool schema, prepends a sanitized bounded requested-Agent heading, injects a non-removable credential guard, normalizes ordinary omitted/auto runs to headless for the Pi 0.81.1 compatibility window, and rejects explicit inline before model startup; no upstream source is copied"],
34
+ "verification": ["tests/unit/subagents.test.ts", "tests/integration/generic-subagent.test.ts", "tests/integration/live-subagent.test.ts", "tests/integration/package-runtime.test.ts"]
35
35
  },
36
36
  {
37
37
  "name": "pi-permission-modes",
@@ -39,11 +39,11 @@
39
39
  "revision": "23d65d10a53b67043cae42322acf9044d6edb196",
40
40
  "version": "2.2.0",
41
41
  "license": "MIT",
42
- "status": "dependency",
43
- "sourceFiles": ["src/index.ts", "permission-mode.defaults.json"],
44
- "symbols": ["Default/Plan/Build/YOLO", "/perm", "Alt+M", "sandbox degradation"],
45
- "localChanges": ["AILI initializes the pinned upstream extension and does not retain a competing AILI mode command or shortcut"],
46
- "verification": ["tests/unit/runtime.test.ts", "tests/integration/extension-load.test.ts"]
42
+ "status": "adapted",
43
+ "sourceFiles": ["src/vendor/pi-permission-modes/index.ts", "src/vendor/pi-permission-modes/resolve.ts", "upstream/pi-permission-modes.lock.json", "licenses/pi-permission-modes-MIT.txt"],
44
+ "symbols": ["Default/Plan/Build/YOLO", "/perm", "Alt+M", "shared permission pattern matcher", "sandbox degradation"],
45
+ "localChanges": ["AILI's generated adapted entry redirects unchanged sibling modules to the exact 2.2.0 dependency", "the owned resolve.ts compiles permission globs with RegExp dotAll so * and ? include ECMAScript line terminators", "the exact upstream and adapted files are hash-locked and drift-checked"],
46
+ "verification": ["npm run verify:permission-modes", "tests/unit/permission-patterns.test.ts", "tests/integration/permission-modes.test.ts", "tests/integration/extension-load.test.ts"]
47
47
  },
48
48
  {
49
49
  "name": "pi-quota-status",
@@ -3,7 +3,7 @@
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
5
  "name": "@rosetears/aili-pi-0.0.0-development",
6
- "documentNamespace": "https://github.com/Rosetears520/aili-pi/sbom/b1356fd5c37f5e69387fb7d4acaeb377",
6
+ "documentNamespace": "https://github.com/Rosetears520/aili-pi/sbom/a9e5a3e4d1076b3179dd8cca5ef89f9f",
7
7
  "creationInfo": {
8
8
  "creators": [
9
9
  "Tool: @rosetears/aili-pi scripts/generate-provenance.ts"
@@ -43,7 +43,7 @@
43
43
  "licenseDeclared": "MIT",
44
44
  "checksums": [],
45
45
  "primaryPackagePurpose": "SOURCE",
46
- "comment": "revision=daa7b83819116a62008ad17aa65fcd50fefbafd0; files=src/index.ts, src/api.ts, src/runners/headless-model.ts, src/artifacts/result.ts; symbols=subagent tool renderCall, runSubagent API, headless lifecycle, artifact envelope; local changes=AILI registers the full pinned upstream subagent tool schema, prepends a sanitized bounded requested-Agent heading to upstream run-call rendering, injects a non-removable credential guard, and relies on the ambient AILI pi-permission-modes registration exactly once in each child; no upstream source is copied"
46
+ "comment": "revision=daa7b83819116a62008ad17aa65fcd50fefbafd0; files=src/index.ts, src/api.ts, src/runners/headless-model.ts, src/artifacts/result.ts; symbols=subagent tool renderCall, runSubagent API, headless lifecycle, artifact envelope; local changes=AILI registers the full pinned upstream subagent tool schema, prepends a sanitized bounded requested-Agent heading, injects a non-removable credential guard, normalizes ordinary omitted/auto runs to headless for the Pi 0.81.1 compatibility window, and rejects explicit inline before model startup; no upstream source is copied"
47
47
  },
48
48
  {
49
49
  "SPDXID": "SPDXRef-source-pi-permission-modes-9b38b384cd",
@@ -55,7 +55,7 @@
55
55
  "licenseDeclared": "MIT",
56
56
  "checksums": [],
57
57
  "primaryPackagePurpose": "SOURCE",
58
- "comment": "revision=23d65d10a53b67043cae42322acf9044d6edb196; files=src/index.ts, permission-mode.defaults.json; symbols=Default/Plan/Build/YOLO, /perm, Alt+M, sandbox degradation; local changes=AILI initializes the pinned upstream extension and does not retain a competing AILI mode command or shortcut"
58
+ "comment": "revision=23d65d10a53b67043cae42322acf9044d6edb196; files=src/vendor/pi-permission-modes/index.ts, src/vendor/pi-permission-modes/resolve.ts, upstream/pi-permission-modes.lock.json, licenses/pi-permission-modes-MIT.txt; symbols=Default/Plan/Build/YOLO, /perm, Alt+M, shared permission pattern matcher, sandbox degradation; local changes=AILI's generated adapted entry redirects unchanged sibling modules to the exact 2.2.0 dependency | the owned resolve.ts compiles permission globs with RegExp dotAll so * and ? include ECMAScript line terminators | the exact upstream and adapted files are hash-locked and drift-checked"
59
59
  },
60
60
  {
61
61
  "SPDXID": "SPDXRef-source-pi-quota-status-63ccce8956",
@@ -801,9 +801,9 @@
801
801
  "snapshot-hash:verified",
802
802
  "npm run verify:roles",
803
803
  "vitest run tests/unit/roles.test.ts tests/unit/subagents.test.ts",
804
- "vitest run tests/integration/generic-permission.test.ts",
805
- "AILI_LIVE_SUBAGENT_PROBE=static npx vitest run tests/integration/live-subagent.test.ts",
806
- "AILI_LIVE_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
804
+ "vitest run tests/integration/generic-subagent.test.ts tests/integration/generic-permission.test.ts",
805
+ "AILI_LIVE_GENERIC_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts",
806
+ "AILI_LIVE_CREDENTIAL_GUARD_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
807
807
  ],
808
808
  "status": "adapted",
809
809
  "reason": "Required capabilities are covered by verified Pi adapter evidence: subagent.dispatch.",
@@ -4311,9 +4311,9 @@
4311
4311
  "snapshot-hash:verified",
4312
4312
  "npm run verify:roles",
4313
4313
  "vitest run tests/unit/roles.test.ts tests/unit/subagents.test.ts",
4314
- "vitest run tests/integration/generic-permission.test.ts",
4315
- "AILI_LIVE_SUBAGENT_PROBE=static npx vitest run tests/integration/live-subagent.test.ts",
4316
- "AILI_LIVE_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
4314
+ "vitest run tests/integration/generic-subagent.test.ts tests/integration/generic-permission.test.ts",
4315
+ "AILI_LIVE_GENERIC_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts",
4316
+ "AILI_LIVE_CREDENTIAL_GUARD_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
4317
4317
  ],
4318
4318
  "status": "adapted",
4319
4319
  "reason": "Required capabilities are covered by verified Pi adapter evidence: subagent.dispatch.",
@@ -5596,9 +5596,9 @@
5596
5596
  "snapshot-hash:verified",
5597
5597
  "npm run verify:roles",
5598
5598
  "vitest run tests/unit/roles.test.ts tests/unit/subagents.test.ts",
5599
- "vitest run tests/integration/generic-permission.test.ts",
5600
- "AILI_LIVE_SUBAGENT_PROBE=static npx vitest run tests/integration/live-subagent.test.ts",
5601
- "AILI_LIVE_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
5599
+ "vitest run tests/integration/generic-subagent.test.ts tests/integration/generic-permission.test.ts",
5600
+ "AILI_LIVE_GENERIC_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts",
5601
+ "AILI_LIVE_CREDENTIAL_GUARD_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
5602
5602
  ],
5603
5603
  "status": "adapted",
5604
5604
  "reason": "Required capabilities are covered by verified Pi adapter evidence: subagent.dispatch.",
@@ -6416,9 +6416,9 @@
6416
6416
  "snapshot-hash:verified",
6417
6417
  "npm run verify:roles",
6418
6418
  "vitest run tests/unit/roles.test.ts tests/unit/subagents.test.ts",
6419
- "vitest run tests/integration/generic-permission.test.ts",
6420
- "AILI_LIVE_SUBAGENT_PROBE=static npx vitest run tests/integration/live-subagent.test.ts",
6421
- "AILI_LIVE_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
6419
+ "vitest run tests/integration/generic-subagent.test.ts tests/integration/generic-permission.test.ts",
6420
+ "AILI_LIVE_GENERIC_SUBAGENT_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts",
6421
+ "AILI_LIVE_CREDENTIAL_GUARD_PROBE=1 npx vitest run tests/integration/live-subagent.test.ts"
6422
6422
  ],
6423
6423
  "status": "adapted",
6424
6424
  "reason": "Required capabilities are covered by verified Pi adapter evidence: subagent.dispatch.",
@@ -27,11 +27,21 @@
27
27
  },
28
28
  {
29
29
  "name": "@agwab/pi-subagent",
30
+ "version": "0.4.8",
30
31
  "revision": "daa7b83819116a62008ad17aa65fcd50fefbafd0",
31
32
  "license": "MIT",
32
- "status": "reference-only",
33
- "reusedPatterns": [],
34
- "reason": "No community source code is copied or depended on in P5; accepted design evidence is retained for the P8 notice/SBOM audit."
33
+ "status": "dependency",
34
+ "reusedPatterns": [
35
+ "generic subagent tool schema and rendering",
36
+ "headless/tmux/inline backend and lifecycle envelopes",
37
+ "bounded parallel fan-out, worktree, sandbox, async, interrupt, and reconcile behavior"
38
+ ],
39
+ "localAdaptation": [
40
+ "ordinary omitted/auto runs use headless for the Pi 0.81.1 compatibility window",
41
+ "explicit incompatible inline requests fail before model startup",
42
+ "AILI injects the immutable credential guard and a bounded requested-Agent heading"
43
+ ],
44
+ "reason": "AILI depends on the exact package and applies a wrapper-only compatibility adaptation; no upstream source is copied."
35
45
  }
36
46
  ]
37
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rosetears/aili-pi",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "AILI and ROSE distribution for official Pi",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -68,8 +68,10 @@
68
68
  "validate:roles": "npm run verify:roles",
69
69
  "sync:adapters": "node --experimental-strip-types scripts/apply-adapter-evidence.ts",
70
70
  "validate:compatibility": "node --experimental-strip-types scripts/apply-adapter-evidence.ts --verify",
71
- "generate:provenance": "node --experimental-strip-types scripts/generate-provenance.ts",
72
- "validate:provenance": "node --experimental-strip-types scripts/generate-provenance.ts --verify",
71
+ "sync:permission-modes": "node --experimental-strip-types scripts/sync-permission-modes.ts",
72
+ "verify:permission-modes": "node --experimental-strip-types scripts/sync-permission-modes.ts --verify",
73
+ "generate:provenance": "node --experimental-strip-types scripts/sync-permission-modes.ts --verify && node --experimental-strip-types scripts/generate-provenance.ts",
74
+ "validate:provenance": "node --experimental-strip-types scripts/sync-permission-modes.ts --verify && node --experimental-strip-types scripts/generate-provenance.ts --verify",
73
75
  "validate:capabilities": "node --experimental-strip-types scripts/validate-runtime.ts",
74
76
  "validate:release": "node --experimental-strip-types scripts/validate-runtime.ts --release",
75
77
  "test:doctor": "vitest run tests/unit/doctor.test.ts",
@@ -115,7 +115,7 @@ async function generate(): Promise<{ notices: string; sbom: object }> {
115
115
  "",
116
116
  `The exact ${packages.length}-entry package-lock inventory, versions, integrity values, dependency scope, and declared licenses is recorded in \`manifests/sbom.json\`.`,
117
117
  "",
118
- "Runtime dependencies are initialized through the single AILI Extension entry; no third-party source tree is copied into this package.",
118
+ "Runtime dependencies are initialized through the single AILI Extension entry. Package-owned third-party adaptations are copied only where their provenance sourceFiles explicitly name repository paths.",
119
119
  "",
120
120
  ].join("\n");
121
121
  return { notices, sbom };
@@ -0,0 +1,135 @@
1
+ import { createHash } from "node:crypto";
2
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
+ import { dirname, resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { resolvePermissionModesPackageRoot } from "../src/runtime/package-resolution.ts";
6
+
7
+ const ROOT = resolve(import.meta.dirname, "..");
8
+ const SOURCE_ROOT = fileURLToPath(resolvePermissionModesPackageRoot());
9
+ const VERIFY = process.argv.includes("--verify");
10
+ const VERSION = "2.2.0";
11
+ const REVISION = "23d65d10a53b67043cae42322acf9044d6edb196";
12
+
13
+ const EXPECTED_UPSTREAM_HASHES: Record<string, string> = {
14
+ "src/index.ts": "fd4462a3b7ba986af734c2e17ba8ea7178df56c933e87ed444ba90ba24c2fd5b",
15
+ "src/resolve.ts": "13f52a4a9c08d7a55f5f9d03f97302d864768838fb3e9fca2051cb7d94a0ae82",
16
+ LICENSE: "d87cb99b43f6bf8771e57be83485db11b977b9dfa21b6bd201b8d3d370bdce43",
17
+ };
18
+
19
+ const ADAPTATION_HEADER = [
20
+ "/**",
21
+ " * Generated AILI adaptation of pi-permission-modes@2.2.0.",
22
+ " * Source revision: 23d65d10a53b67043cae42322acf9044d6edb196.",
23
+ " * Regenerate with scripts/sync-permission-modes.ts; do not edit manually.",
24
+ " */",
25
+ "",
26
+ ].join("\n");
27
+
28
+ const sha256 = (value: string): string => createHash("sha256").update(value).digest("hex");
29
+
30
+ function replaceExactlyOnce(source: string, before: string, after: string, label: string): string {
31
+ const first = source.indexOf(before);
32
+ if (first < 0 || source.indexOf(before, first + before.length) >= 0) {
33
+ throw new Error(`expected exactly one ${label} in pi-permission-modes@${VERSION}`);
34
+ }
35
+ return source.slice(0, first) + after + source.slice(first + before.length);
36
+ }
37
+
38
+ function adaptIndex(source: string): string {
39
+ let redirected = 0;
40
+ const body = source.replace(/from "\.\/([^"]+)";/g, (full, specifier: string) => {
41
+ if (specifier === "resolve.ts") return full;
42
+ redirected += 1;
43
+ return `from "pi-permission-modes/src/${specifier}";`;
44
+ });
45
+ if (redirected !== 12) {
46
+ throw new Error(`expected 12 redirected sibling imports in pi-permission-modes@${VERSION}, found ${redirected}`);
47
+ }
48
+ const documented = replaceExactlyOnce(
49
+ body,
50
+ "The logic lives in sibling\n * modules:",
51
+ "The adapted matcher lives locally; unchanged logic stays in pinned dependency\n * modules:",
52
+ "entry module ownership comment",
53
+ );
54
+ return ADAPTATION_HEADER + documented;
55
+ }
56
+
57
+ function adaptResolve(source: string): string {
58
+ const withSchemaRedirect = replaceExactlyOnce(
59
+ source,
60
+ 'from "./schema.ts";',
61
+ 'from "pi-permission-modes/src/schema.ts";',
62
+ "schema import",
63
+ );
64
+ const withDotAll = replaceExactlyOnce(
65
+ withSchemaRedirect,
66
+ "return new RegExp(re).test(t);",
67
+ 'return new RegExp(re, "s").test(t);',
68
+ "glob RegExp compilation",
69
+ );
70
+ return ADAPTATION_HEADER + withDotAll;
71
+ }
72
+
73
+ async function expectedOutputs(): Promise<Record<string, string>> {
74
+ const packageJsonText = await readFile(resolve(SOURCE_ROOT, "package.json"), "utf8");
75
+ const packageJson = JSON.parse(packageJsonText) as { name?: string; version?: string; license?: string };
76
+ if (packageJson.name !== "pi-permission-modes" || packageJson.version !== VERSION || packageJson.license !== "MIT") {
77
+ throw new Error(`expected pi-permission-modes@${VERSION} MIT baseline`);
78
+ }
79
+
80
+ const upstream = Object.fromEntries(await Promise.all(
81
+ Object.keys(EXPECTED_UPSTREAM_HASHES).map(async (path) => [path, await readFile(resolve(SOURCE_ROOT, path), "utf8")]),
82
+ )) as Record<string, string>;
83
+ for (const [path, expected] of Object.entries(EXPECTED_UPSTREAM_HASHES)) {
84
+ const actual = sha256(upstream[path]!);
85
+ if (actual !== expected) throw new Error(`unexpected upstream drift for ${path}: ${actual}`);
86
+ }
87
+
88
+ const index = adaptIndex(upstream["src/index.ts"]!);
89
+ const matcher = adaptResolve(upstream["src/resolve.ts"]!);
90
+ const license = upstream.LICENSE!;
91
+ const adaptedFiles = {
92
+ "src/vendor/pi-permission-modes/index.ts": index,
93
+ "src/vendor/pi-permission-modes/resolve.ts": matcher,
94
+ "licenses/pi-permission-modes-MIT.txt": license,
95
+ };
96
+ const lock = {
97
+ schemaVersion: 1,
98
+ package: {
99
+ name: "pi-permission-modes",
100
+ version: VERSION,
101
+ revision: REVISION,
102
+ license: "MIT",
103
+ },
104
+ upstreamFiles: Object.entries(EXPECTED_UPSTREAM_HASHES).map(([path, hash]) => ({ path, sha256: hash })),
105
+ adaptedFiles: Object.entries(adaptedFiles).map(([path, content]) => ({ path, sha256: sha256(content) })),
106
+ localChanges: [
107
+ "Package-owned adapted entry redirects all unchanged sibling modules to the exact pi-permission-modes dependency while owning resolve.ts locally.",
108
+ "matchPattern compiles its anchored glob RegExp with dotAll so * and ? include ECMAScript line terminators.",
109
+ ],
110
+ generatedBy: "scripts/sync-permission-modes.ts",
111
+ verification: ["npm run verify:permission-modes", "tests/unit/permission-patterns.test.ts", "tests/integration/permission-modes.test.ts"],
112
+ };
113
+
114
+ return {
115
+ ...adaptedFiles,
116
+ "upstream/pi-permission-modes.lock.json": `${JSON.stringify(lock, null, 2)}\n`,
117
+ };
118
+ }
119
+
120
+ async function main(): Promise<void> {
121
+ const outputs = await expectedOutputs();
122
+ for (const [path, expected] of Object.entries(outputs)) {
123
+ const absolute = resolve(ROOT, path);
124
+ if (VERIFY) {
125
+ const actual = await readFile(absolute, "utf8").catch(() => "");
126
+ if (actual !== expected) throw new Error(`permission-mode adaptation drifted: ${path}`);
127
+ } else {
128
+ await mkdir(dirname(absolute), { recursive: true });
129
+ await writeFile(absolute, expected, "utf8");
130
+ }
131
+ }
132
+ console.log(`${VERIFY ? "PASS" : "SYNCED"}: pi-permission-modes@${VERSION} adapted matcher (${Object.keys(outputs).length} artifacts)`);
133
+ }
134
+
135
+ await main();
@@ -3,7 +3,7 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
3
  type NativeExtension = (pi: ExtensionAPI) => void | Promise<void>;
4
4
 
5
5
  export const NATIVE_INTEGRATIONS = [
6
- "pi-permission-modes@2.2.0",
6
+ "pi-permission-modes@2.2.0 (AILI multiline-glob adaptation)",
7
7
  "pi-quota-status@0.3.0",
8
8
  "pi-web-access@0.13.0",
9
9
  "pi-cache-optimizer@2.6.18",
@@ -12,7 +12,7 @@ export const NATIVE_INTEGRATIONS = [
12
12
  ] as const;
13
13
 
14
14
  const INTEGRATION_MODULES = [
15
- "pi-permission-modes/src/index.ts",
15
+ "../vendor/pi-permission-modes/index.ts",
16
16
  "pi-quota-status",
17
17
  "pi-web-access",
18
18
  "pi-cache-optimizer/index.ts",
@@ -21,9 +21,9 @@ const INTEGRATION_MODULES = [
21
21
  ] as const;
22
22
 
23
23
  /**
24
- * Initialise the pinned upstream extensions through AILI's single package entry.
25
- * They remain upstream-owned implementations; this module adds no substitute
26
- * command, tool, permission, or provider behavior.
24
+ * Initialise pinned native integrations through AILI's single package entry.
25
+ * Permission modes uses the revision-bound adapted entry that changes only
26
+ * shared multiline glob matching; the remaining integrations stay upstream-owned.
27
27
  */
28
28
  export async function registerNativeIntegrations(pi: ExtensionAPI): Promise<void> {
29
29
  for (const moduleName of INTEGRATION_MODULES) {
@@ -0,0 +1,8 @@
1
+ import { createRequire } from "node:module";
2
+ import { pathToFileURL } from "node:url";
3
+
4
+ /** Resolve the installed dependency from either a development tree or npm's hoisted scoped-package layout. */
5
+ export function resolvePermissionModesPackageRoot(from: string | URL = import.meta.url): URL {
6
+ const packageJson = createRequire(from).resolve("pi-permission-modes/package.json");
7
+ return new URL("./", pathToFileURL(packageJson));
8
+ }