jorgex-stack 1.9.42 → 1.9.43

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 (3) hide show
  1. package/README.md +3 -3
  2. package/dist/cli.js +38 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -114,7 +114,7 @@ Programmatic mode does **not** provide:
114
114
 
115
115
  ### Pi runtime
116
116
 
117
- El canon de Stack y el paquete Pi adoptado mantienen una snapshot de 17 skills y 89 archivos. La identidad, procedencia e integridad del paquete adoptado son autoritativas en `src/lib/pi-runtime-pin.json`.
117
+ El canon de Stack y el paquete Pi adoptado mantienen una snapshot de 17 árboles de skills con 89 archivos de skill. La identidad, procedencia e integridad del paquete adoptado son autoritativas en `src/lib/pi-runtime-pin.json`.
118
118
 
119
119
  Pi combines the frozen **snapshot v2** package with a Stack-owned shared projection. The version references that follow describe historical Stack/Pi transitions, not the current pin. The current pin, package integrity and lifecycle are maintained in [docs/references/pi-runtime.md](docs/references/pi-runtime.md) and `src/lib/pi-runtime-pin.json`; this README does not imply a future release.
120
120
 
@@ -128,7 +128,7 @@ pnpm dlx jorgex-stack@1.9.7 sync --agents pi
128
128
  pnpm dlx jorgex-stack@1.9.7 uninstall --agents pi
129
129
  ```
130
130
 
131
- Stack downloads the frozen registry tarball, verifies its exact size plus SHA-256/SHA-512, backs up Pi's `settings.json`, and only then asks Pi to install that local file. The exact artifact and integrity values are authoritative in `src/lib/pi-runtime-pin.json`, while the lifecycle remains authoritative in `src/lib/pi-runtime.ts`. Pi's own package-manager invocation is the narrow runtime exception to the repository's pnpm-only rule; the Stack lifecycle never launches npm directly. After the package is healthy, Stack projects the shared resources into Pi: marked `jorgex:system-prompt` and `jorgex:engram-protocol` sections in `~/.pi/agent/AGENTS.md`, canonical skills under `~/.agents/skills`, and `~/.pi/agent/prompts/lean-audit.md`. Pi 0.8.20 registers Context7 through an isolated in-memory HTTP bridge during bootstrap; `available` means configuration permits registration and does not imply an HTTP handshake. A conflict preserves the existing MCP file and blocks managed activation. No MCP configuration or credentials are written. For the file runtimes, Context7, Playwright and DevTools use independent managed sections. The global Playwright package and Chromium cache are shared by the machine; `--playwright-runtimes` controls which runtime receives the guide. The adopted Pi package implements and tests `playwright-handoff-v1` through `PI_CODING_AGENT_DIR/jorgex-pi/playwright.v1.json`. Historical package entries do not describe the current pin. Filters are applied only after this projection exists, so the package does not duplicate shared resources. Package ownership is recorded separately in `~/.jorgex-stack/pi-receipt.json`; projection ownership is recorded in `~/.jorgex-stack/pi-projection-receipt.json`. Package receipts reject manual, duplicate, divergent, partial, corrupt, copied-to-another-scope, or unknown-history state. Projection cleanup requires an exact scope-bound ownership receipt; DevTools conflicts preserve the handoff for review.
131
+ Stack downloads the frozen registry tarball, verifies its exact size plus SHA-256/SHA-512, backs up Pi's `settings.json`, and only then asks Pi to install that local file. The exact artifact and integrity values are authoritative in `src/lib/pi-runtime-pin.json`, while the lifecycle remains authoritative in `src/lib/pi-runtime.ts`. Pi's own package-manager invocation is the narrow runtime exception to the repository's pnpm-only rule; the Stack lifecycle never launches npm directly. After the package is healthy, Stack projects the shared resources into Pi: marked `jorgex:system-prompt` and `jorgex:engram-protocol` sections in `~/.pi/agent/AGENTS.md`, canonical skills under `~/.agents/skills`, and `~/.pi/agent/prompts/lean-audit.md`. Pi 0.8.21 registers Context7 through an isolated in-memory HTTP bridge during bootstrap; `available` means configuration permits registration and does not imply an HTTP handshake. A conflict preserves the existing MCP file and blocks managed activation. No MCP configuration or credentials are written. For the file runtimes, Context7, Playwright and DevTools use independent managed sections. The global Playwright package and Chromium cache are shared by the machine; `--playwright-runtimes` controls which runtime receives the guide. The adopted Pi package implements and tests `playwright-handoff-v1` through `PI_CODING_AGENT_DIR/jorgex-pi/playwright.v1.json`. Historical package entries do not describe the current pin. Filters are applied only after this projection exists, so the package does not duplicate shared resources. Package ownership is recorded separately in `~/.jorgex-stack/pi-receipt.json`; projection ownership is recorded in `~/.jorgex-stack/pi-projection-receipt.json`. Package receipts reject manual, duplicate, divergent, partial, corrupt, copied-to-another-scope, or unknown-history state. Projection cleanup requires an exact scope-bound ownership receipt; DevTools conflicts preserve the handoff for review.
132
132
 
133
133
  The static `AGENTS.md` projected by Stack does not include Context7; Pi's native bootstrap adds that section after registering the isolated bridge. Pi never writes, owns or removes MCP files. In Claude Code, Codex and OpenCode, a compatible existing Context7 entry is preserved and removed only with explicit canonical Stack ownership.
134
134
 
@@ -192,7 +192,7 @@ Daily operation:
192
192
  - `doctor` reports the Playwright CLI state (`disabled`, `healthy`, `missing:package`, `missing:browser`, `unreadable`, `broken`, `outdated`) and, when the opt-in package and browser cache are present, verifies one local headless Chromium launch against `about:blank`; it does not open external sites or repair state. An `unreadable` browser cache includes its exact path and filesystem error code so permissions or another local cause can be investigated. If either preference file is corrupt, doctor prints the exact path and the remedy (`Corrige o borra ese archivo antes de reintentar`) before any other browser check; in that case `install`/`uninstall`/`update`/`update --check` will abort with exit 1 until the file is fixed, so the corruption cannot be reconciled destructively.
193
193
  - `update --check` only inspects Playwright CLI when its preference is `enabled` (a binary appearing in `PATH` is not consent). It compares the installed version against the approved pin `0.1.18` — it does not consult npm latest, and a Playwright CLI binary-only update does not require `sync` afterwards.
194
194
  - `uninstall` preserves the global `@playwright/cli` package and all browser data by default; `--remove-playwright` removes the package only (never the browser cache, profiles, cookies, storage state, traces, screenshots or videos). If `pnpm remove --global @playwright/cli` exits non-zero, `uninstall` reports the failure instead of a success outro. For DevTools MCP, ownership is released only after the corresponding unmerge is applied; if no unmerge action is written, the ownership marker is preserved for a later retry.
195
- - `install`/`sync` also inject (and `disable`/`uninstall` remove) managed capability sections in `AGENTS.md` (OpenCode, Codex) or `CLAUDE.md` (Claude Code). File runtimes keep `jorgex:playwright`, `jorgex:chrome-devtools` and `jorgex:context7` independent; Pi 0.8.20 projects the Context7 section after registering its isolated HTTP bridge and keeps the legacy `jorgex:browser` format for migration. User content outside managed markers is preserved. `--target-dir` never reads the real preferences, so by default no section is emitted in target-dir runs — but explicit flags like `--devtools` simulate the MCP entry (and its DevTools block) inside the temp target without touching the real global state, and `install --dry-run --playwright` projects the Playwright section into the plan preview without installing anything. If reconciliation detects a partial or ambiguous system-prompt state, the CLI exits non-zero and recommends repairing it with `sync` or a repeated install; no write is attempted before marker validation. See [docs/references/browser-automation.md](docs/references/browser-automation.md) §2.7 for the full lifecycle.
195
+ - `install`/`sync` also inject (and `disable`/`uninstall` remove) managed capability sections in `AGENTS.md` (OpenCode, Codex) or `CLAUDE.md` (Claude Code). File runtimes keep `jorgex:playwright`, `jorgex:chrome-devtools` and `jorgex:context7` independent; Pi 0.8.21 projects the Context7 section after registering its isolated HTTP bridge and keeps the legacy `jorgex:browser` format for migration. User content outside managed markers is preserved. `--target-dir` never reads the real preferences, so by default no section is emitted in target-dir runs — but explicit flags like `--devtools` simulate the MCP entry (and its DevTools block) inside the temp target without touching the real global state, and `install --dry-run --playwright` projects the Playwright section into the plan preview without installing anything. If reconciliation detects a partial or ambiguous system-prompt state, the CLI exits non-zero and recommends repairing it with `sync` or a repeated install; no write is attempted before marker validation. See [docs/references/browser-automation.md](docs/references/browser-automation.md) §2.7 for the full lifecycle.
196
196
 
197
197
  ### Update: Interactive Flow
198
198
 
package/dist/cli.js CHANGED
@@ -3476,22 +3476,30 @@ var ALLOWED_EXTERNAL_WRITES = /* @__PURE__ */ new Set([
3476
3476
  "models.json",
3477
3477
  "jorgex-pi/sol-lifecycle.v1.json"
3478
3478
  ]);
3479
+ var PERMISSIONS_EXTERNAL_WRITES = /* @__PURE__ */ new Set([
3480
+ ...ALLOWED_EXTERNAL_WRITES,
3481
+ "extensions/pi-permission-system/config.json",
3482
+ "jorgex-pi/permissions-lifecycle.v1.json",
3483
+ "jorgex-pi/permissions-backups"
3484
+ ]);
3479
3485
  function sameRecord(left, right) {
3480
3486
  return JSON.stringify(left) === JSON.stringify(right);
3481
3487
  }
3482
- function managedExternalWritesAreSafe(writes) {
3483
- if (writes.length !== ALLOWED_EXTERNAL_WRITES.size) return false;
3488
+ function managedExternalWritesAreSafe(writes, capabilities) {
3489
+ if (!Array.isArray(capabilities)) return false;
3490
+ const allowed = capabilities.includes("permissions-policy-v1") ? PERMISSIONS_EXTERNAL_WRITES : ALLOWED_EXTERNAL_WRITES;
3491
+ if (writes.length !== allowed.size) return false;
3484
3492
  const seen = /* @__PURE__ */ new Set();
3485
3493
  for (const write of writes) {
3486
3494
  if (write === null || typeof write !== "object" || Array.isArray(write)) return false;
3487
3495
  if (Object.keys(write).sort().join(",") !== "owner,relativePath,root,semantics") return false;
3488
3496
  if (write.owner !== "jorgex-pi" || write.root !== "PI_CODING_AGENT_DIR") return false;
3489
- if (typeof write.relativePath !== "string" || !ALLOWED_EXTERNAL_WRITES.has(write.relativePath)) return false;
3497
+ if (typeof write.relativePath !== "string" || !allowed.has(write.relativePath)) return false;
3490
3498
  if (/^(?:[A-Za-z]:|[\\/])/.test(write.relativePath) || write.relativePath.split(/[\\/]/).includes("..")) return false;
3491
3499
  if (typeof write.semantics !== "string" || write.semantics.trim() === "" || seen.has(write.relativePath)) return false;
3492
3500
  seen.add(write.relativePath);
3493
3501
  }
3494
- return seen.size === ALLOWED_EXTERNAL_WRITES.size;
3502
+ return seen.size === allowed.size;
3495
3503
  }
3496
3504
  function ownership(receipt) {
3497
3505
  return { receipt, adapters: false, manifest: false, modelMap: false };
@@ -3612,7 +3620,7 @@ function parseReceipt(receiptJson, candidate, scope, engramBin) {
3612
3620
  return sameRecord(parsed, expected) ? expected : null;
3613
3621
  }
3614
3622
  function candidateIsValid(candidate, observed) {
3615
- return candidate.package.name === "jorgex-pi" && candidate.package.source === `npm:${candidate.package.name}@${candidate.package.version}` && candidate.contract.schemaVersion === 1 && candidate.contract.runner.schemaVersion === 1 && candidate.contract.runner.bin === "jorgex-pi" && candidate.contract.runner.maxStdoutBytes === 65536 && managedExternalWritesAreSafe(candidate.contract.managedExternalWrites) && [...REQUIRED_CAPABILITIES].every((capability) => candidate.contract.capabilities.includes(capability)) && sameRecord(candidate.tarball, observed);
3623
+ return candidate.package.name === "jorgex-pi" && candidate.package.source === `npm:${candidate.package.name}@${candidate.package.version}` && candidate.contract.schemaVersion === 1 && candidate.contract.runner.schemaVersion === 1 && candidate.contract.runner.bin === "jorgex-pi" && candidate.contract.runner.maxStdoutBytes === 65536 && managedExternalWritesAreSafe(candidate.contract.managedExternalWrites, candidate.contract.capabilities) && [...REQUIRED_CAPABILITIES].every((capability) => candidate.contract.capabilities.includes(capability)) && sameRecord(candidate.tarball, observed);
3616
3624
  }
3617
3625
  function planPiPackageLifecycle(input) {
3618
3626
  if (!candidateIsValid(input.candidate, input.observedTarball)) {
@@ -6131,16 +6139,16 @@ import { createHash as createHash2 } from "crypto";
6131
6139
  var pi_runtime_pin_default = {
6132
6140
  package: {
6133
6141
  name: "jorgex-pi",
6134
- version: "0.8.20",
6135
- source: "npm:jorgex-pi@0.8.20"
6142
+ version: "0.8.21",
6143
+ source: "npm:jorgex-pi@0.8.21"
6136
6144
  },
6137
6145
  provenance: {
6138
- commit: "c4d021382cd3b752eaa396044753ac7533b6645d"
6146
+ commit: "425356a083708aa873a14a094d06bd7abe302bc0"
6139
6147
  },
6140
6148
  tarball: {
6141
- bytes: 89127646,
6142
- sha256: "c7bbb0dc587b10e8e04174589cc519ad7576d2cbbceb5d2d20614d313e1ee884",
6143
- sha512: "189480a4d812048b65466156479d1d89f7fa7044471ff6a076b710c0014b0e50eaa0261d7a2a8381a5e71a598be61fe2ed714b6b1dacd5a5f955b59a412009c0"
6149
+ bytes: 89139189,
6150
+ sha256: "bf8846caf25eddebe31edc396ed9acc0b5636f7a2a4edd5df4f166beadec40e7",
6151
+ sha512: "74184929ee136671dd3160f76f96a57a4d9299a2dcae2608ca476220a3ea8a7e9cf32fc6a9bbd09334d16c21b7e52dc46c1b5dd76107ad936e4b4c651f1fa684"
6144
6152
  }
6145
6153
  };
6146
6154
 
@@ -6164,6 +6172,7 @@ var PI_RUNTIME_CANDIDATE = {
6164
6172
  "mcp-adapter-v1",
6165
6173
  "engram-runtime-tools-v1",
6166
6174
  "context7-http-v1",
6175
+ "permissions-policy-v1",
6167
6176
  "chrome-devtools-handoff-v1",
6168
6177
  "playwright-handoff-v1",
6169
6178
  "runner-json-v1",
@@ -6196,6 +6205,24 @@ var PI_RUNTIME_CANDIDATE = {
6196
6205
  root: "PI_CODING_AGENT_DIR",
6197
6206
  relativePath: "jorgex-pi/sol-lifecycle.v1.json",
6198
6207
  semantics: "record field, container, and file ownership; remove the receipt when empty"
6208
+ },
6209
+ {
6210
+ owner: "jorgex-pi",
6211
+ root: "PI_CODING_AGENT_DIR",
6212
+ relativePath: "extensions/pi-permission-system/config.json",
6213
+ semantics: "seed the generated permission policy only when absent; publish exclusively, preserve preexisting or invalid user state, and remove only an exact owned copy during cleanup"
6214
+ },
6215
+ {
6216
+ owner: "jorgex-pi",
6217
+ root: "PI_CODING_AGENT_DIR",
6218
+ relativePath: "jorgex-pi/permissions-lifecycle.v1.json",
6219
+ semantics: "record initialization and exact permission-config ownership without storing user configuration or credentials"
6220
+ },
6221
+ {
6222
+ owner: "jorgex-pi",
6223
+ root: "PI_CODING_AGENT_DIR",
6224
+ relativePath: "jorgex-pi/permissions-backups",
6225
+ semantics: "retain cleanup backups of exact owned permission policy bytes"
6199
6226
  }
6200
6227
  ]
6201
6228
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jorgex-stack",
3
- "version": "1.9.42",
3
+ "version": "1.9.43",
4
4
  "description": "Harness multi-agente portable: instala la config JorgeX (agentes, skills, hooks, Engram, MCPs) en Claude Code, Codex CLI, OpenCode y Pi",
5
5
  "type": "module",
6
6
  "license": "MIT",