# Installing `@stravica-ai/digital-operator-pa`

`@stravica-ai/digital-operator-pa` is published to the **public npm registry**
(`registry.npmjs.org`). It is a public package, so **no registry authentication is
required to install it**: a plain `pnpm add` works on any host.

## Prerequisites

- **Node.js 24+** (current active LTS).
- **pnpm 10+** (the wrapper is tested with pnpm but `npm`/`yarn` also work).

No PAT, `~/.npmrc`, or org-membership step is needed for install. (The `@stravica-ai`
scope resolves to npmjs.org by default; you only need an `~/.npmrc` entry if you have
previously pointed that scope somewhere else.)

## Step 1: install in a project

In your operator-repo (or a fresh directory):

```sh
pnpm add @stravica-ai/digital-operator-pa
```

Smoke-test:

```sh
pnpm exec pa launch --help     # exit 0
pnpm exec pa --help            # exit 0
pnpm exec desk --help          # exit 0
```

## What the wrapper ships

`@stravica-ai/digital-operator-pa` is a **single-bundled** package. One install gives
you:

- All operator-facing bins: `pa`, `desk`, `launch`, `estate-sync`, `sync`, `secrets`,
  `scheduler`, `smoke`, `distill`, `memory-sync`, `migrate-inspect`, `pa-init`,
  `slice`, `research`, `pa-coordinator-hook`.
- All internal platform code (core spine, runbook validator, workspace server,
  scaffold templates, role packs, optional core-extensions), bundled inside
  the tarball at `dist/<package-name>/`. The internal packages stay
  `private: true` in the monorepo and are never individually published.

## Troubleshooting

- **`404 Not Found`**: usually the `@stravica-ai` scope is routed to the wrong
  registry. Confirm you do **not** have a stale
  `@stravica-ai:registry=https://npm.pkg.github.com` line in your `~/.npmrc`; the
  scope should resolve to `https://registry.npmjs.org` (the default). Older setups
  pointed this scope at GitHub Packages. Remove that line.
- **`Could not resolve dependency` for `@stravica-ai/engineering-pa-core`**
  (or any other `engineering-pa-*` internal). The wrapper bundles those
  internally and does not declare them as runtime deps; you should never
  see this in normal use. If it appears, the wrapper's `dist/` was likely
  stripped during install. Re-run `pnpm add @stravica-ai/digital-operator-pa`
  with `--force`.

> **Historical note.** The predecessor package `@stravica/engineering-pa` lived on
> **GitHub Packages** and needed a `read:packages` PAT. The current
> `@stravica-ai/digital-operator-pa` bundle is public on npmjs.org, so that auth step
> no longer applies.

## Release pipeline (for maintainers)

Publishing is **manual**, from `packages/engineering-pa`, and targets npmjs.org via the
package's `publishConfig` (`registry.npmjs.org`, `access: public`):

```sh
cd packages/engineering-pa
pnpm publish            # runs the prepack build.mjs, then publishes the bundled tarball
```

`ci.yml`'s `dry-publish` job runs `pnpm dry-publish` (`build.mjs` + `pnpm publish
--dry-run`) on every push to prove the pack/publish mechanics, and a follow-up job
re-installs the packed tarball into a clean consumer directory and exercises the bins.
The actual publish is run by a maintainer with npmjs publish rights once CI is green
on `main`.
