@mutmutco/pi-plugin 4.5.102 → 4.5.104

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/pi-plugin",
3
- "version": "4.5.102",
3
+ "version": "4.5.104",
4
4
  "description": "MMI workflow skills and org gates delivery.",
5
5
  "author": {
6
6
  "name": "MMI Future",
@@ -507,7 +507,11 @@ the bootstrap seed Dockerfile and compose templates). The seeded compose is file
507
507
  `labels: { mmi.runtime-env: "true" }`, no `env_file`, and a loopback-only port; the deploy injects the stage's
508
508
  vault values at runtime (`DEPLOY#<stage>.noEnvFile: true`) and the app reads plain env vars — it must **not** self-load SSM and must **not** ship a committed `.env`.
509
509
 
510
- For a `web-app` that declares `oauth` META, print the canonical OAuth surface and provision the client once:
510
+ For a `suite: mm-work` tenant-container module, bootstrap apply selects the MM-Work module seed instead: a live `/health` server and `/module.js`, the example module scaffold, secret-backed image build, and `gate` plus `screens / screens`. It sets `requiredBuildSecrets: ["NODE_AUTH_TOKEN=@github-packages-token"]` and requires only `gate`. Before the first CI/deploy, an org admin must grant the repo Read on both `@mutmutco/mmwork-ds` and `@mutmutco/mmwork-screens` under Package settings → Manage Actions access (no GitHub REST API; verify names the manual step). Add `screens / screens` to `requiredChecks` only after the screens job is green, or every PR blocks.
511
+
512
+ **Never provision a Google OAuth client for an MM-Work suite module, even if old META declares `oauth`.** Modules sign in through the MM-Work pass and reach Google via `ctx.act`; read the package's GUIDE. The suite seed omits the Google-login guide.
513
+
514
+ For a non-suite `web-app` that declares `oauth` META, print the canonical OAuth surface and provision the client once:
511
515
 
512
516
  ```bash
513
517
  mmi-cli vault org oauth plan --repo "$OWNER/$REPO" # the exact JS origins + redirect URIs + canonical SSM keys
@@ -0,0 +1,32 @@
1
+ # MM-Work module tenant container: the TypeScript server plus the module bundle it serves.
2
+
3
+ # The module bundle. The GitHub Packages token (for @mutmutco/mmwork-ds) arrives as a BuildKit secret
4
+ # and is never written into a layer; compose passes it from the registry's requiredBuildSecrets.
5
+ FROM node:24-bookworm-slim AS module-build
6
+ WORKDIR /module
7
+ COPY module/package.json module/package-lock.json module/.npmrc ./
8
+ RUN --mount=type=secret,id=NODE_AUTH_TOKEN,env=NODE_AUTH_TOKEN npm ci --no-audit --no-fund
9
+ COPY module/src ./src
10
+ COPY module/vite.config.mjs ./
11
+ RUN npm run build
12
+
13
+ # The server.
14
+ FROM node:24-bookworm-slim AS server-build
15
+ WORKDIR /app
16
+ COPY package.json package-lock.json ./
17
+ RUN npm ci --no-audit --no-fund
18
+ COPY tsconfig.json ./
19
+ COPY src ./src
20
+ RUN npm run build && npm prune --omit=dev
21
+
22
+ FROM node:24-bookworm-slim AS runtime
23
+ WORKDIR /app
24
+ ENV NODE_ENV=production
25
+ COPY --from=server-build /app/package.json ./package.json
26
+ COPY --from=server-build /app/node_modules ./node_modules
27
+ COPY --from=server-build /app/dist ./dist
28
+ COPY --from=module-build /module/dist/module.js ./module/dist/module.js
29
+ USER node
30
+ EXPOSE 3000
31
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=20s CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
32
+ CMD ["node", "dist/index.js"]
@@ -0,0 +1,26 @@
1
+ services:
2
+ app:
3
+ build:
4
+ context: .
5
+ dockerfile: Dockerfile
6
+ secrets:
7
+ - NODE_AUTH_TOKEN
8
+ restart: unless-stopped
9
+ # Fileless deploy (DEPLOY#<stage>.noEnvFile: true): no .env exists. tenant-deploy.yml streams the
10
+ # stage-scoped vault values over SSH into a tmpfs (/dev/shm) runtime env, and the box injects them
11
+ # into every service labelled mmi.runtime-env. Never add env_file.
12
+ labels:
13
+ mmi.runtime-env: "true"
14
+ environment:
15
+ NODE_ENV: production
16
+ MMI_STAGE: ${MMI_STAGE:-dev}
17
+ MMI_PORT: ${MMI_PORT:-3000}
18
+ PORT: ${PORT:-3000}
19
+ MMI_EDGE_DOMAIN: ${MMI_EDGE_DOMAIN:-}
20
+ ports:
21
+ # Loopback only: the box Caddy is the one public door (TLS), never the bare port.
22
+ - "127.0.0.1:${MMI_PORT:-3000}:${PORT:-3000}"
23
+
24
+ secrets:
25
+ NODE_AUTH_TOKEN:
26
+ environment: NODE_AUTH_TOKEN
@@ -0,0 +1 @@
1
+ { "result": { "items": [{ "id": "sample", "name": "Sample brief" }] } }
@@ -0,0 +1,35 @@
1
+ name: gate
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches: {{GATE_PUSH_BRANCHES_YAML}}
6
+ tags: ['v*']
7
+ concurrency:
8
+ group: gate-${{ github.event.pull_request.number || github.ref }}
9
+ cancel-in-progress: true
10
+ permissions:
11
+ contents: read
12
+ packages: read
13
+ jobs:
14
+ gate:
15
+ runs-on: [self-hosted, linux, x64, mmi-live]
16
+ timeout-minutes: 10
17
+ steps:
18
+ - uses: mutmutco/MMI-Hub/.github/actions/runner-checkout@{{GATE_RUNNER_SHA}}
19
+ with:
20
+ lockfile-path: package-lock.json
21
+ - name: Isolate npm cache
22
+ run: echo "NPM_CONFIG_CACHE=$RUNNER_TEMP/npm-cache" >> "$GITHUB_ENV"
23
+ - uses: mutmutco/MMI-Hub/.github/actions/runner-node-toolchain@{{GATE_RUNNER_SHA}}
24
+ with:
25
+ node-version: 24
26
+ npm-version: '12'
27
+ - run: npm ci --no-audit --no-fund
28
+ - run: npm ci --prefix module --no-audit --no-fund
29
+ env:
30
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31
+ - uses: mutmutco/MMI-Hub/.github/actions/run-with-budget@{{GATE_BUDGET_SHA}}
32
+ with:
33
+ command: npm run typecheck && npm run build && npm --prefix module run check
34
+ max-seconds: {{GATE_MAX_SECONDS}}
35
+ working-directory: .
@@ -0,0 +1,11 @@
1
+ # MM-Work module
2
+
3
+ Read the matching `module/node_modules/@mutmutco/mmwork-ds/GUIDE.md` before changing this module. The starter entry and Vite setting come from MM-Work's `examples/example-module`; replace the example screens with your product's screens using only the shared design system.
4
+
5
+ Sign-in belongs to MM-Work: verify its pass before adding protected backend routes. Do not provision a Google OAuth client or implement a separate login. Google and other shared services are reached through `ctx.act`, not module-owned credentials.
6
+
7
+ Before the first CI/deploy, an org admin must grant this repo **Read** on `@mutmutco/mmwork-ds` under **Package settings → Manage Actions access**. This has no GitHub REST API. The Actions token installs the module in CI; the tenant image build uses the registry's `NODE_AUTH_TOKEN=@github-packages-token` BuildKit secret. Never commit a token.
8
+
9
+ The server exposes `/health` and `/module.js`. Register the module's bundle URL, id, name and capabilities with MM-Work following the GUIDE. The seed deliberately exposes no authenticated product API yet.
10
+
11
+ `gate` installs and checks the backend and module. `screens / screens` follows MM-PM's non-blocking PR/push/tag shape, using MM-Work's reusable runner with `run: false` (browser audits are not merge gates). Configure scheduled/on-demand screen audits separately when the product has screens to audit.