toga-ai 1.0.124 → 1.0.126

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.
@@ -4,4 +4,4 @@
4
4
  |-----|---------|-------|
5
5
  | [TOGa Supply (toga2-supply) Architecture](architecture.md) | `toga2-supply` is the **React + Vite frontend** for TOGa Supply — warehouse fulfillment tooling (shipment selection, fulfill & ship against carrier APIs, NetSui | toga2-supply/src/api/toga.ts, toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx |
6
6
  | [Fulfill & Ship](features/fulfill-and-ship.md) | Fulfill & Ship lets a warehouse user select sales-order line items, enter serials, pick a carrier/method, and in one action: create the Item Fulfillment records | toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/view/components/forms/EditShipmentForm.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx, toga2-supply/src/pages/Shipments/api/ShipmentsApi.ts, _underscore/Model/Client/ItemFulfillment.php, _underscore/Trait/Netsuite/ItemFulfillment.php, _underscore/Component/Library/Carriers/Ups/Ups.php |
7
- | [AWS Amplify Build & Deploy (non-prod environments)](workflows/amplify-build-and-deploy.md) | How `toga2-supply` (React + Vite) builds and deploys to **AWS Amplify** for non-prod environments (Stage, QC Security, QC Performance, …). | toga2-supply/amplify.yml, toga2-supply/.github/workflows/sync-stage-environments.yml, toga2-supply/.env.qc-security |
7
+ | [AWS Amplify Build & Deploy (non-prod environments)](workflows/amplify-build-and-deploy.md) | How `toga2-supply` (React + Vite) builds and deploys on **AWS Amplify**. | toga2-supply/amplify.yml, toga2-supply/.github/workflows/sync-stage-environments.yml, toga2-supply/.env.qc-security |
@@ -6,7 +6,7 @@ project: TOGa Supply
6
6
  client: shared
7
7
  type: workflow
8
8
  status: active
9
- updated: 2026-06-17
9
+ updated: 2026-06-18
10
10
  owners: ["jcardinal"]
11
11
  files:
12
12
  - toga2-supply/amplify.yml
@@ -18,87 +18,90 @@ related:
18
18
 
19
19
  ## Summary
20
20
 
21
- How `toga2-supply` (React + Vite) builds and deploys to **AWS Amplify** for non-prod
22
- environments (Stage, QC Security, QC Performance, …). The **alpha/beta/gamma/production**
23
- environments historically deploy via **GitHub Actions** (`.github/workflows/*.yml`) into the
24
- `agilantsolutions/toga2-supply-build` repo — Amplify is the path used for the newer non-prod
25
- environments. The first Amplify build failed with a JavaScript heap OOM; this doc records the
26
- fix and the chosen **branch-per-environment** deployment model.
27
-
28
- ## Deployment model — branch per environment, mirrored from `_stage`
29
-
30
- The unit of an environment in Amplify is a **branch** (idiomatic Amplify: branch = environment).
31
- A single branch cannot fan out to multiple environments, and a branch can only be connected once
32
- per Amplify app. So:
33
-
34
- - **`_stage` is the integration branch** — where work lands and is reviewed. It is **not deployed
35
- directly**.
36
- - Each environment is its **own deployment branch** that mirrors `_stage` exactly:
37
- `stage`, `qc-security`, `qc-performance`, …
38
- - **Branch name == Vite mode == `.env.<branch>` filename.** `amplify.yml` builds with
39
- `--mode "$AWS_BRANCH"` (Amplify injects `$AWS_BRANCH`), so branch `qc-security` builds
40
- `--mode qc-security` and loads `.env.qc-security`. No per-branch env var needed.
41
- - A GitHub Action (`sync-stage-environments.yml`) **fast-forwards every environment branch to
42
- `_stage` on each push**, triggering each branch's Amplify build with its own mode.
21
+ How `toga2-supply` (React + Vite) builds and deploys on **AWS Amplify**. Each Amplify
22
+ **branch is one environment** (`_production`, `_beta`, `_gamma`, `_stage`, `_qc-security`,
23
+ `_qc-performance`, …). The first Amplify build failed with a JavaScript heap OOM, and a later
24
+ attempt **broke production** by silently pointing it at beta — this doc records both the heap
25
+ fix and the branch→mode mapping that prevents the mis-pointing.
26
+
27
+ ## Deployment model — one branch per environment
28
+
29
+ - Branch names are **underscore-prefixed** (`_production`, `_qc-security`); the Vite **mode**
30
+ and `.env` file are the **same name WITHOUT the underscore** (`production`, `qc-security`).
31
+ - The repo-root **`amplify.yml` drives the build for every branch** (it overrides the Amplify
32
+ console build spec for the whole app — including `_production`). It:
33
+ - Sets `NODE_OPTIONS=--max-old-space-size=8192` (the OOM fix; matches production), runs
34
+ `npm ci --legacy-peer-deps`, caches `.npm`.
35
+ - Derives the mode by **stripping the leading underscore** from `$AWS_BRANCH`
36
+ (`MODE="${AWS_BRANCH#_}"`), then runs `npx tsc && npx vite build --mode "$MODE"`.
37
+ - **Fails the build loudly** (`exit 1`) if `.env.$MODE` does not exist — see the gotcha below.
38
+ - `_stage` is **both** the Stage environment (builds `--mode stage`) **and** the integration
39
+ source for the QC environments. The `sync-stage-environments.yml` GitHub Action fans `_stage`
40
+ out to `_qc-security` and `_qc-performance` on every push (fast-forward `--force-with-lease`),
41
+ triggering each QC branch's own Amplify build.
43
42
 
44
43
  ```
45
- _stage (integration, not deployed)
46
- │ push → sync-stage-environments.yml fast-forwards ↓
47
- ├──▶ stage ──▶ Amplify ──▶ build --mode stage
48
- ├──▶ qc-security ──▶ Amplify ──▶ build --mode qc-security
49
- └──▶ qc-performance ──▶ Amplify ──▶ build --mode qc-performance
44
+ _production ──▶ Amplify ──▶ build --mode production (.env.production)
45
+ _beta ──▶ Amplify ──▶ build --mode beta
46
+ _gamma ──▶ Amplify ──▶ build --mode gamma
47
+ _stage ──▶ Amplify ──▶ build --mode stage
48
+ │ push → sync-stage-environments.yml fast-forwards ↓
49
+ ├──▶ _qc-security ──▶ Amplify ──▶ build --mode qc-security
50
+ └──▶ _qc-performance ──▶ Amplify ──▶ build --mode qc-performance
50
51
  ```
51
52
 
52
53
  ## Steps
53
54
 
54
- 1. **`amplify.yml` (repo root) drives the build.** When present it **overrides the Amplify
55
- console build settings entirely** — you cannot split "memory in the file, build command in the
56
- console." It sets `NODE_OPTIONS=--max-old-space-size=4096` (the OOM fix) and runs
57
- `npx tsc && npx vite build --mode "$AWS_BRANCH"`, publishing `dist/`.
58
- 2. **In the Amplify app, connect one branch per environment** (`stage`, `qc-security`,
59
- `qc-performance`, …). Each branch is its own environment with its own hosting domain.
60
- 3. **Each environment needs a committed `.env.<branch>` file** (Vite loads `.env.<mode>`).
61
- e.g. `.env.qc-security` provides `VITE_API`.
62
- 4. **Add the branch to the sync matrix.** Edit `sync-stage-environments.yml` → `matrix.branch`.
63
- 5. Push to `_stage`; the Action mirrors the env branches; Amplify rebuilds each.
55
+ 1. **Connect one Amplify branch per environment** (underscore-prefixed). Within a single
56
+ Amplify app a branch connects only once — you cannot point multiple environments at the same
57
+ branch connection, which is why each environment is its own branch.
58
+ 2. **Commit a matching `.env.<mode>` file** (no underscore): `.env.production`, `.env.beta`,
59
+ `.env.gamma`, `.env.alpha`, `.env.stage`, `.env.qc-security`. A new environment needs its
60
+ file before it can deploy (otherwise the build fails loudly by design).
61
+ 3. **For a fanned-out QC environment, add its underscore branch to the sync matrix** in
62
+ `sync-stage-environments.yml`.
63
+ 4. Push; Amplify builds each branch with its own mode. **Roll out `amplify.yml` changes on a
64
+ non-prod branch first** (it overrides production's build spec too).
64
65
 
65
66
  ## Systems involved
66
67
 
67
- - AWS Amplify (build + hosting) — one branch per environment, branch name selects the mode.
68
- - GitHub Actions — `sync-stage-environments.yml` mirrors `_stage` → env branches on push.
69
- - Vite 4 build (`vite build --mode <branch>`), TypeScript `tsc` precompile.
70
- - Sentry source-map upload via `@sentry/vite-plugin` (source maps are **on** —
71
- `build.sourcemap: true` in `vite.config.ts`).
68
+ - AWS Amplify (build + hosting) — one branch per environment; branch name (minus `_`) selects
69
+ the Vite mode and `.env` file.
70
+ - GitHub Actions — `sync-stage-environments.yml` mirrors `_stage` → `_qc-security`,
71
+ `_qc-performance`. (Separately, `alpha/beta/gamma/production.yml` are the older GitHub-Actions
72
+ build path into `agilantsolutions/toga2-supply-build`.)
73
+ - Vite 4 (`vite build --mode <mode>`), TypeScript `tsc` precompile. Source maps are **on**
74
+ (`build.sourcemap: true` in `vite.config.ts`).
72
75
 
73
76
  ## Edge cases & escalation
74
77
 
75
- - **OOM root cause:** Amplify gives Node the default ~2 GB old-space heap. This app
76
- (1793 modules + source maps on) exceeds it during Rollup's `rendering chunks` phase →
77
- `FATAL ERROR: Ineffective mark-compacts near heap limit`. Fix = raise `NODE_OPTIONS`.
78
- - **Heap vs. instance RAM:** `--max-old-space-size=4096` only helps if the build container
79
- has ≥4 GB. Amplify **Standard** compute is 4 GB (tight with source maps on). If it OOMs
80
- again, switch to the **Large build instance** (Amplify → App settings → Build settings)
81
- and raise to `6144`/`7168`. Setting the heap above physical RAM makes it worse, not better.
82
- - **"Can't pick `_stage` again" in the UI:** within one Amplify app a branch connects only once.
83
- This is why environments are separate *branches*, not multiple connections to `_stage`. (An
84
- alternative — multiple Amplify *apps* all pointed at `_stage` — works but is a non-idiomatic
85
- workaround: N apps to manage, no single dashboard. Branch-per-env is preferred.)
86
- - **Env branches are disposable deployment pointers — never commit to them directly.** The sync
87
- Action force-updates them (`--force-with-lease`) to match `_stage`; any direct commit is lost.
88
- - **Branch name must match the mode/`.env` filename.** `--mode qc-security` loads
89
- `.env.qc-security` exactly — a mismatch (e.g. a stray `.env.qc-security.beta`) is silently
90
- ignored: the build succeeds but ships with no `VITE_API`.
78
+ - **Silent wrong-endpoint trap (caused a production outage):** When Vite is given a `--mode`
79
+ with no matching `.env.<mode>`, it **silently falls back to the base `.env`** (which points at
80
+ beta) instead of erroring. An `amplify.yml` that built `--mode "$AWS_BRANCH"` therefore ran
81
+ `--mode _production` (no `.env._production`) and shipped beta endpoints to production. **Fix:**
82
+ strip the underscore to get the real mode, AND guard with `[ -f ".env.$MODE" ] || exit 1` so a
83
+ missing env file fails the build instead of mis-pointing.
84
+ - **`amplify.yml` overrides production.** A repo-root `amplify.yml` replaces the console build
85
+ spec for **all** branches including `_production`. Validate any change on a non-prod branch
86
+ before it can reach production.
87
+ - **OOM root cause:** Amplify gives Node the default ~2 GB old-space heap; this app
88
+ (1793 modules + source maps) exceeds it during Rollup's `rendering chunks` phase →
89
+ `FATAL ERROR: Ineffective mark-compacts near heap limit`. Fix = raise `NODE_OPTIONS`
90
+ (`8192` in production). Raising it only helps if the build instance has that much RAM; if it
91
+ still OOMs, use the **Large build instance**.
92
+ - **Env branches are disposable deployment pointers** — the sync Action force-updates
93
+ `_qc-security`/`_qc-performance` to match `_stage`. Never commit to them directly.
91
94
  - **Secret hygiene:** `.env.<mode>` files have historically carried a live `SENTRY_AUTH_TOKEN`.
92
95
  Prefer rotating it and moving it to an Amplify env var rather than committing it.
93
96
 
94
97
  ## Change history
95
98
 
96
- - 2026-06-17 — Switched to branch-per-environment: `amplify.yml` now builds `--mode "$AWS_BRANCH"`
97
- and added `sync-stage-environments.yml` to mirror `_stage` → env branches. (Superseded the
98
- earlier `VITE_BUILD_MODE` per-branch-env-var idea — unworkable because multiple environments
99
- must deploy from the single `_stage` branch.) (jcardinal)
100
- - 2026-06-17 — Created on first Amplify setup of a new QC environment: added root `amplify.yml`
101
- with raised Node heap (OOM fix); renamed `.env.qc-security.beta` → `.env.qc-security`. (jcardinal)
99
+ - 2026-06-18 — Fixed production-breaking deploy: `amplify.yml` now strips the leading `_` from
100
+ `$AWS_BRANCH` to get the Vite mode and **fails loudly** if `.env.$MODE` is missing (was
101
+ silently falling back to beta); heap set to 8192; sync workflow targets underscore-prefixed
102
+ `_qc-security`/`_qc-performance`. (jcardinal)
103
+ - 2026-06-17 — Initial Amplify setup for a new QC environment: added root `amplify.yml` with
104
+ raised Node heap (OOM fix); renamed `.env.qc-security.beta` → `.env.qc-security`. (jcardinal)
102
105
 
103
106
  ## Related docs
104
107
 
@@ -30,7 +30,7 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
30
30
  ## standalone framework
31
31
 
32
32
  - **togatech** (TOGA Technology Website) — 1 doc(s) → [standalone/apps/togatech/INDEX.md](standalone/apps/togatech/INDEX.md)
33
- - **forward** (Forwarder) — 2 doc(s) → [standalone/apps/forward/INDEX.md](standalone/apps/forward/INDEX.md)
33
+ - **forward** (Forwarder) — 3 doc(s) → [standalone/apps/forward/INDEX.md](standalone/apps/forward/INDEX.md)
34
34
 
35
35
  ## Clients
36
36
 
@@ -4,3 +4,4 @@
4
4
  |-----|---------|-------|
5
5
  | [Forwarder Architecture](architecture.md) | Forwarder is a tiny **standalone PHP application** that powers TOGA's short, branded redirect domains. | forward/forward.ini, forward/index.php, forward/.htaccess, forward/.platform/httpd/conf.d/rewritemap.conf, forward/.ebextensions/rewritemap.config, forward/composer.json |
6
6
  | [Encrypted-Link Handler](features/encrypted-link-handler.md) | A `index.php` feature in [Forwarder](../architecture.md) for redirect domains whose URL path carries an **encrypted token** that must be decoded before redirect | forward/index.php |
7
+ | [Static Demo Hosting](features/static-demo-hosting.md) | A lightweight way to host self-contained static HTML pages (demos, exported designs, download landing pages) on the Forwarder app under a clean URL — e.g. | forward/.htaccess, forward/togadesk/index.html |
@@ -0,0 +1,115 @@
1
+ ---
2
+ title: Static Demo Hosting
3
+ framework: "standalone"
4
+ repo: forward
5
+ project: Forwarder
6
+ client: shared
7
+ type: feature
8
+ status: active
9
+ updated: 2026-06-18
10
+ owners: ["jcardinal"]
11
+ files:
12
+ - forward/.htaccess
13
+ - forward/togadesk/index.html
14
+ related:
15
+ - standalone/apps/forward/architecture.md
16
+ ---
17
+
18
+ ## Summary
19
+
20
+ A lightweight way to host self-contained static HTML pages (demos, exported designs,
21
+ download landing pages) on the Forwarder app under a clean URL — e.g.
22
+ `https://demo.togatech.com/togadesk`. The hostname stays in the browser and the page is
23
+ served straight off disk with no redirect and no PHP compute. This is how we publish
24
+ exported **Claude Design** mockups for stakeholders to view without the Claude editor /
25
+ chat sidebar. First real use: the TOGa Desk design demo at `togadesk/`.
26
+
27
+ ## Key files / entry points
28
+
29
+ - `forward/.htaccess` — a guarded static-serving rule placed **before** the `forward.ini`
30
+ RewriteMap rules.
31
+ - `forward/<name>/index.html` — one directory per demo at the repo root (e.g.
32
+ `forward/togadesk/index.html`). Apache serves it directly.
33
+ - A `demo.togatech.com` CNAME pointed at the Forwarder Elastic Beanstalk environment.
34
+
35
+ ## How it works
36
+
37
+ The rule in `.htaccess`:
38
+
39
+ ```apache
40
+ # Static demo hosting (e.g. demo.togatech.com/togadesk)
41
+ RewriteCond %{DOCUMENT_ROOT}/$1/index.html -f
42
+ RewriteRule ^([^/]+)/?$ /$1/index.html [L]
43
+ ```
44
+
45
+ - Matches a single path segment (`/togadesk` or `/togadesk/`) and internally serves
46
+ `<docroot>/<segment>/index.html` — **no external redirect**, so the URL the user typed
47
+ stays in the address bar.
48
+ - The `RewriteCond … -f` guard means the rule only fires when that `index.html` actually
49
+ exists, so it never interferes with the existing `forward.ini` redirect map; unmatched
50
+ paths fall through to the map and then `index.php` exactly as before.
51
+ - It sits before the RewriteMap block on purpose, so a real demo file always wins over a
52
+ map lookup.
53
+
54
+ **Adding a new demo** is therefore drop-in: create `forward/<name>/index.html`, commit,
55
+ deploy the EB app → `demo.togatech.com/<name>` works immediately. No code or `.htaccess`
56
+ change is needed for each new demo.
57
+
58
+ This is distinct from the older subdomain-based **local directory handler** in `index.php`
59
+ (`sos.*` → `/sos/`), which runs only on a map miss and issues a redirect. The static-demo
60
+ rule is path-based, redirect-free, and runs in Apache before PHP. See the
61
+ [architecture](../architecture.md) doc.
62
+
63
+ ## Exporting a Claude Design page for hosting
64
+
65
+ Demos are typically Claude Design artifacts exported as a **single self-contained HTML
66
+ file**. A generic prompt to give inside the Claude Design conversation (no design-specific
67
+ names) that yields a downloadable file:
68
+
69
+ > Package this design as a single, fully self-contained HTML file I can host anywhere, and
70
+ > give it to me as a downloadable file (not a copy/paste code block). Requirements: one
71
+ > file with no build step or local assets; inline all CSS and JS; embed images/fonts as
72
+ > `data:` URIs or absolute `https://` URLs (no root-relative `/...` or relative `./...`
73
+ > paths, and no `<base>` tag); remove anything tied to the editing environment (no
74
+ > sidebar/chat refs, no live data calls back to the session — replace dynamic data with
75
+ > static placeholder content); it must render when opened directly in a browser; set a
76
+ > sensible `<title>` and viewport meta. Then save it as a downloadable `.html` file and
77
+ > give me the download link.
78
+
79
+ Before hosting, verify the export has: no `<base>` tag, no root-relative/relative asset
80
+ paths, no `fetch`/XHR/API calls back to a live backend (a detached demo must be static),
81
+ and that it renders when opened directly by double-clicking. Public `https://` CDN
82
+ dependencies (Font Awesome, Lucide, Tailwind CDN, Google Fonts) are fine — but the page
83
+ then needs internet to render fully.
84
+
85
+ ## Data model
86
+
87
+ None — pure static file serving.
88
+
89
+ ## Client variations
90
+
91
+ None — uniform, shared/internal.
92
+
93
+ ## Gotchas / known issues
94
+
95
+ - **Bare domain root 404s.** `demo.togatech.com/` (no demo name) has no `forward.ini`
96
+ entry, so it falls through to `index.php` → 404. Add a `forward.ini` line if the root
97
+ should redirect somewhere.
98
+ - **The rule matches any host, not just `demo.togatech.com`.** It is guarded by the file
99
+ existence check, so `anyhost/togadesk` would also serve the demo. Acceptable today since
100
+ only the `demo` CNAME is meant to be used; keep demo directory names from colliding with
101
+ real first-path-segment redirect targets.
102
+ - **CDN dependencies need internet.** Exported pages that link CDN CSS/JS won't render
103
+ fully offline. Fine for hosted demos.
104
+ - **Large files are fine but bloat the repo.** Exports with base64-inlined assets can be
105
+ multi-MB (the TOGa Desk demo is ~4 MB). They deploy with the EB app like any other file.
106
+
107
+ ## Change history
108
+
109
+ - 2026-06-18 — Added static demo hosting: `.htaccess` rule + `togadesk/` demo; documented
110
+ the Claude Design export prompt (jcardinal).
111
+
112
+ ## Related docs
113
+
114
+ - [Forwarder Architecture](../architecture.md)
115
+ - [Encrypted-Link Handler](encrypted-link-handler.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.124",
3
+ "version": "1.0.126",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",