Compare commits

...
Author SHA1 Message Date
hanzo-dev 2177c0a3ca refactor(sdk): remove dead streaming subsystem + fully-commented connect-qr page (~1.2k LOC, red-team #13/#42/#56) — build green 2026-06-22 06:01:30 +00:00
hanzo-devandGitHub f53dc2513a Merge pull request #7 from hanzoai/fix/onboarding-welcome-brand-crash
fix(chat): stream reasoning_content so thinking models reply (#19)
2026-06-21 20:53:56 -07:00
hanzo-dev f892023d4a Merge remote-tracking branch 'origin/main' into fix/onboarding-welcome-brand-crash 2026-06-22 03:53:29 +00:00
hanzo-dev 38b22e7265 fix(chat): stream reasoning_content too so thinking models show a reply (red-team #19/#55) 2026-06-22 03:53:28 +00:00
hanzo-devandGitHub aeed548966 Merge pull request #6 from hanzoai/fix/onboarding-welcome-brand-crash
fix(sdk): default-agents hang + tsc-breaking logo type + 5 GGUF zen models
2026-06-21 20:47:25 -07:00
hanzo-dev 0483a5b099 Merge remote-tracking branch 'origin/main' into fix/onboarding-welcome-brand-crash 2026-06-22 03:46:35 +00:00
hanzo-dev cf084837a5 fix(sdk): bound default-agents polling so it cannot hang 60s + drop dead HanzoAIProps.logo override that broke tsc for all 3 apps + 5 verified GGUF zen models 2026-06-22 03:46:07 +00:00
hanzo-devandGitHub 2a62e59c1c Merge pull request #5 from hanzoai/fix/onboarding-welcome-brand-crash
fix(onboarding): per-app /app-logo.png on landing (stop Hanzo H leaking onto zoo/lux)
2026-06-21 20:02:27 -07:00
hanzo-dev b5217aca35 Merge remote-tracking branch 'origin/main' into fix/onboarding-welcome-brand-crash 2026-06-22 03:00:48 +00:00
hanzo-dev 350f9f2c6e fix(onboarding): use per-app /app-logo.png on landing — stop Hanzo H leaking onto zoo/lux 2026-06-22 02:57:17 +00:00
hanzo-dev 3f7b90359c fix(brand): node-manager window + notifications use per-app /app-logo.png (was hardcoded Hanzo icon — leaked onto zoo/lux) 2026-06-22 00:14:29 +00:00
hanzo-dev 13c4dbf660 fix(ai): show compact app logo in collapsed sidebar 2026-06-21 22:11:56 +00:00
hanzo-devandGitHub 4be2d12e2e Merge pull request #4 from hanzoai/fix/onboarding-welcome-brand-crash
Merge fix/onboarding-welcome-brand-crash
2026-06-21 13:54:24 -07:00
hanzo-dev 45adbc8349 feat(models): Download-all per segment (DRY) + Featured community models (Qwen/Llama/Gemma/Mistral/DeepSeek, verified-public HF GGUF) 2026-06-21 20:51:04 +00:00
hanzo-dev bbe5b9ece6 chore(assets): remove dead Shinkai octopus logo + video (2.3MB, unreferenced) 2026-06-21 20:51:04 +00:00
hanzo-dev 689b811db9 feat(models): native Hanzo engine + Zen catalog (HF download), one Local Models gallery (engine choice Hanzo/Ollama/LMStudio), cosmetic fixes (real Ollama icon, per-brand sidebar logo, cloud scroll) 2026-06-21 20:51:04 +00:00
hanzo-dev 085d2ca295 fix(chat): resolve bare 'default' alias to the real model name (Zen Nano 0.6B) 2026-06-21 20:51:04 +00:00
hanzo-dev bd97e87ab3 fix(chat): show actual model name (Zen Nano 0.6B) in selector, not provider name (Zen Engine) 2026-06-21 20:51:03 +00:00
hanzo-dev 854b1d59d5 fix(onboarding): unblock Skip — inject sha512 for noble-ed25519 v2, node addr from brand config, reset(false), /v1/node paths 2026-06-21 20:51:03 +00:00
hanzo-dev 76247c6366 feat(ai): add optional node field to published BrandConfig surface (matches src/types.ts) 2026-06-21 20:51:03 +00:00
hanzo-dev 0cb5be28a2 feat(@hanzo/ai): BrandConfig.node field + brand-neutral node_* invokes
- BrandConfig.node { apiPort, enginePort } — single source for on-device node address
- brand-neutral node_* command invokes (was hardcoded hanzo_node_spawn)
2026-06-21 20:51:03 +00:00
hanzo-devandClaude Opus 4.8 c480b014b4 fix(@hanzo/ai): export ./ai.css subpath for consumer stylesheet import
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:51:03 +00:00
hanzo-dev 9fd1bd7b65 remove brand-hardcode gate; brand is data, not a gate 2026-06-21 20:51:03 +00:00
hanzo-devandClaude Opus 4.8 782cff59e6 feat(brand): brand-hardcode guard + brand-neutral i18n (decomplect brand=data)
- scripts/check-no-hardcoded-brand.mjs: fails if a brand literal (Hanzo/Zoo/Lux/Shinkai) appears in user-facing i18n copy; brand must come from {{appName}}/brandConfig
- net-i18n: 62 brand literals -> {{appName}}; tidy 2 stray 'shinkai' comments

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:51:03 +00:00
hanzo-devandClaude Opus 4.8 11c79d969d build(@hanzo/ai): restore @tailwindcss/vite + globals.css in SDK lib build and fix i18n en-US resource load so consumer apps render styled + translated
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:51:03 +00:00
hanzo-devandClaude Opus 4.8 f6c03b9f63 fix(ai): resolve brand at render time in onboarding so welcome stops crashing blank on Zoo/Lux
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:51:03 +00:00
hanzo-devandClaude Opus 4.8 75f734cba3 fix(ai): onboarding welcome uses each brand's own logo (no hardcoded Hanzo H / tagline)
Read brandConfig.logo inside OnboardingLayout (was a module-level useBrand()
frozen on the default brand, forcing visor.svg's Hanzo "H" onto Zoo/Lux).
Drop the broken right-column hero preview; tagline is now opt-in via
brandConfig.tagline (empty default — removes the old hardcoded "the way, the
truth, the life"). Welcome title uses {{appName}} so no brand name leaks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:51:02 +00:00
hanzo-dev f22c35d920 fix(build): unbreak docker build:app (tsconfig refs, recipes deep-subpath stubs, react-navigation skew, gui->hanzogui imports)
Four root causes blocked the one/vxrn (rolldown) build of apps/gui.hanzo.ai:

1. tsconfig project references: single-level pkgs/*/tsconfig.json used ../../
   (depth-2) refs that resolved to /work/core/* and /work/ui/gui instead of
   pkgs/core/* and pkgs/ui/hanzogui. Fixed the depth (../) and the stale
   gui->hanzogui rename across 9 tsconfigs.

2. @hanzogui/recipes deep subpaths (component/*) were UNLOADABLE: the no-recipes
   path still pulls the showcase tree, which imports @hanzogui/recipes/component/*
   via named re-export / named import / namespace member access. The old
   virtual-module stub could not satisfy statically-validated named exports.
   generate-recipes-proxy.mjs now scans the app and emits concrete per-subpath
   stub modules with the exact named exports (hooks return a proxy object so
   destructuring is safe); vite.config aliases each deep subpath (longest-first)
   to its stub ahead of the catch-all @hanzogui/recipes alias.

3. @react-navigation version skew: expo-router pulled bottom-tabs@7.16.2 which
   imports NavigationProvider (only in native >=7.2.5), conflicting with one's
   ~7.1.33 peer. Pinned bottom-tabs to 7.10.1 and bumped native 7.1.9->7.1.34
   (latest 7.1.x), keeping the @react-navigation family internally consistent.

4. Stale gui->hanzogui imports: SelectDemo.tsx and TestSelect.tsx imported from
   gui/linear-gradient instead of hanzogui/linear-gradient.

Validated locally: bun run build:app completes (build complete, full dist emitted).
2026-06-20 08:09:39 +00:00
hanzo-dev 357f9f9690 fix(build): static-extract components must be hanzogui not gui
The config-bundler did require("gui") for each entry in
gui.build.ts components, but no workspace package is named gui
(the components package is hanzogui, pkgs/ui/hanzogui). This
threw Cannot find module \x27gui\x27 -> Must provide components in
the gui-extract step of build:prod (static extract), so gui
never published an image. Rename the stale tamagui->gui leftover
to hanzogui in components and the matching optimizeDeps include.
2026-06-20 06:40:26 +00:00
hanzo-dev cd9cc63361 fix(build): pin vxrn to version exposing ./worker (unbreak build:app)
The gui.hanzo.ai site (the only app shipped in the GHCR image) runs on
one@1.12.5, whose vxrn@1.12.5 self-imports vxrn/worker. kitchen-sink and
sandbox pull one@1.15.10 -> vxrn@1.15.10, which bun hoists to the root
node_modules/vxrn. vxrn@1.15.10 dropped the ./worker export, so the
hoisted copy breaks vxrn@1.12.5s self-referential import:
  Package subpath ./worker is not defined by exports in vxrn/package.json

Pin the whole one/vxrn family to 1.12.5 via root overrides so a single
vxrn (with ./worker) exists in the tree. One version, no hoist collision.
2026-06-20 02:56:44 +00:00
b888ef8e2a ci: containerize + arcd GHCR semver build (DOKS deploy) (#3)
Add .github/workflows/build.yml that builds+pushes ghcr.io/hanzoai/gui on
v* tags via the canonical hanzoai/.github docker-build reusable workflow
on the self-hosted arcd fleet (amd64+arm64, no GitHub-hosted runners).
Wires the existing working Dockerfile (gui.hanzo.ai, bun build, serves on
:3000) to GHCR. Semver-only tags. The npm publish-gui*.yml workflows are
unaffected.

Co-authored-by: hanzo-dev <z@hanzo.ai>
2026-06-19 16:22:49 -07:00
Antje WorringandClaude Opus 4.8 ea427bc66f docs: tidy LLM.md indexes; CLAUDE.md -> LLM.md symlink convention
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 10:04:45 -07:00
zeekay 926589c982 ci: route to canonical native arcd labels [self-hosted, linux, <arch>]
Replaces non-canonical scale-set / org-prefixed labels with the
existing labels every arcd host registers with. Matches evo for
amd64 and spark for arm64. No new labels added.
2026-06-10 20:15:30 -07:00
hanzo-devandClaude Opus 4.8 40921f9a3d ci: targeted gui-surface publish (skip whole-workspace fan-out)
release.ts --force-publish-all crashed packing unrelated @hanzo_network/*
packages. Replace with publish-gui-surface.mjs which publishes only the
@hanzogui/* closure + hanzogui + @hanzo/gui alias, rewriting workspace:*
to concrete versions and publishing the npm pack tarball directly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:20:10 +00:00
hanzo-devandClaude Opus 4.8 15f130db5f ci: add publish-gui-all workflow to republish all gui packages with dist
Fixes broken 7.0.0 publish where @hanzogui/* primitives shipped without
dist/, breaking standalone @hanzo/gui installs. Builds then runs
release.ts --republish --force-publish-all using the same KMS->secret
NPM_TOKEN resolution as publish-gui.yml.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:09:27 +00:00
hanzo-devandClaude Opus 4.8 07ae7ee84a ci(publish-gui): run on spark runner (evo offline) to unblock publish
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 23:34:46 +00:00
hanzo-devandClaude Opus 4.8 3109fc14c2 perf(@hanzo/ai): optimize SDK build — skip minify/compressed-size in lib mode
CI OOM'd bundling the app-as-SDK. Skip minify (consumers minify in their own
build), skip compressed-size reporting, target esnext, and raise heap to 12GB.
Build ~89s, no OOM. (Lib output is unminified by design; downstream apps minify.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 23:04:31 +00:00
Antje WorringandClaude Opus 4.8 1ae9e1579b ci: target native arcd runners (evo/spark)
Replace retired self-hosted labels with native host arcd daemons:
evo (linux/amd64), spark (linux/arm64).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 15:55:49 -07:00
hanzo-devandClaude Opus 4.8 1f3d8df185 build(@hanzo/ai): raise Node heap to 8GB for the SDK vite build (CI OOM)
CI runner OOM'd bundling @hanzo/ai (exit 134). Add --max-old-space-size=8192.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 22:40:16 +00:00
hanzo-devandClaude Opus 4.8 e213be30bc release(@hanzo/ai): 0.1.1 — brand-agnostic SDK + workspace build fixes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:58:25 +00:00
hanzo-devandClaude Opus 4.8 7c1765359c build: declare missing external deps across workspace packages
The monorepo relied on hoisting and never declared many externals; a clean CI
install (bun, no hoisting guarantees) failed to resolve them when bundling
@hanzo/ai. Declare them on the owning packages (net-ui +49, net-artifacts +33,
net-state, net-i18n, net-message-ts, …). @hanzogui/* workspace deps untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:36:46 +00:00
hanzo-devandClaude Opus 4.8 7087215033 build(@hanzo/ai): declare missing runtime deps (immer, zod, ethers, …)
@hanzo/ai imported ~25 externals (immer, zod, ethers, framer-motion, axios,
react-hook-form, sonner, pyodide, …) not in its package.json — a clean install
(CI) failed to resolve them (local hoisting masked it). Declare them; move
test-only deps (vitest, testing-library, react-scan) to devDependencies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:25:43 +00:00
hanzo-devandClaude Opus 4.8 416d87c08f build: fix workspace build (green 163/163)
- net-i18n: useChain/@hanzo_network/chain-config -> useBrand/brand-config
  (chain-config was renamed to brand-config; this import was never updated).
- loader: drop now-unused @ts-expect-error (TS2578) in GuiPlugin.ts.
Pre-existing breakage that gated the @hanzo/ai publish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:18:09 +00:00
hanzo-dev d164901c6f rename: claude.md → CLAUDE.md
Canonical casing per durable rule. Filesystem is case-insensitive
on macOS but git tracks the lowercase variant; uppercase is the
project convention.
2026-06-07 13:38:06 -07:00
hanzo-devandClaude Opus 4.8 ab3fe3d70c build: add missing per-package tsconfig.json (unblocks workspace build/publish)
10 leaf TS packages (recipes, net-brand-config, examples, *-test) lacked a
committed tsconfig.json, so the workspace build died with ENOENT on the first
one (pkgs/recipes). Add them on the standard pattern (extends root + composite).
Pre-existing breakage, gates the @hanzo/ai publish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 20:27:45 +00:00
hanzo-devandClaude Opus 4.8 2d663eba93 refactor(brand): brand-agnostic SDK — no hardcoded brands, apps own config
- net-brand-config bundles ZERO brands: registry (registerBrands) + injection
  (setBrand/useBrand/getBrand); add company + machinesEnabled to BrandConfig.
- Brand type: drop 'hanzo'|'zoo'|'lux' union -> string (open/extensible).
- Delete hardcoded BRAND/CHAIN consts -> proxy the active brand (16 call sites
  unchanged, now read the live brand).
- isMachinesEnabled: config field, not a hardcoded brand check.
- Examples each ship their own brand.config.ts (apps do the same downstream).
- Neutral test (fixture brands, no bundled assumptions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 19:45:16 +00:00
hanzo-devandClaude Opus 4.8 6f179ac4f2 refactor(iam): brand-neutral login hook (config-driven, PKCE, per-brand)
Replace hardcoded-hanzo useHanzoLogin (hanzo.id, placeholder clientId, shipped
client secret, wrong oauth-deep-link event) with brand-neutral useIamLogin that
reads the active brand's iam config (baseUrl/clientId/redirectUri/callbackEvent)
from @hanzo_network/brand-config and uses public-client PKCE. Adding a brand is
now a config entry; nothing is hardcoded to one brand.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 18:46:40 +00:00
hanzo-devandClaude Opus 4.8 bce9d6f602 fix(iam): real OAuth client IDs (hanzo-app/lux-app/zoo-app) for desktop login
Per-brand iam used placeholder clientIds not registered in Hanzo IAM. Domains
(hanzo.id/lux.id/zoolabs.id), redirect URIs, and callbackEvents were already
correct. Pairs with desktop redirects added to IAM init_data.json.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 18:28:36 +00:00
hanzo-devandClaude Opus 4.8 8b0e6b0d59 feat(@hanzo/ai): desktop build variant — converged frontend with full native
Add `@hanzo/ai/desktop` (vite.desktop.config.ts → dist-desktop): same converged
app as the web build, but it EXTERNALIZES @tauri-apps (14 modules) instead of
aliasing them to web shims — so a desktop consumer gets the REAL native APIs
(window/fs/dialog/updater/node-sidecar), full parity with the standalone forks.

This is the reusable foundation for converging the desktops locally: a desktop
shim is `import HanzoAI, { getBrand } from '@hanzo/ai/desktop'; <HanzoAI
{...getBrand()}/>` (VITE_BRAND selects hanzo/zoo/lux), loaded by the repo's Tauri
shell (which provides @tauri-apps + the node-manager handlers). hanzo/zoo have
full shells; lux's bespoke shell needs those handlers added.

build now emits both dist (web) + dist-desktop; exports['./desktop'] added.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 07:38:48 +00:00
hanzo-devandClaude Opus 4.8 36fc4a2fd4 fix(@hanzo/ai web): per-brand document title + favicon (was hardcoded Hanzo)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 07:15:39 +00:00
hanzo-devandClaude Opus 4.8 41901783a8 build(@hanzo/ai): make publishable — drop workspace deps, public types, access
Prep for `npm publish @hanzo/ai` (the @hanzo scope):
- Drop the `@hanzo_network/* : workspace:*` runtime deps — they're bundled into
  the self-contained dist (aliased to src at build), and workspace:* can't be
  installed by consumers. Real 3rd-party deps stay.
- `publishConfig.access = public` (scoped package).
- Ship a hand-authored, self-contained public-API `dist/index.d.ts`
  (types/public.d.ts; the build copies it). Raw tsc would emit a broken tree of
  internal/@hanzo_network imports for a bundled lib.

Verified: `npm pack --dry-run` → valid tarball with dist + index.d.ts.
Note: 14 MB (bundles streamdown→shiki's ~200 grammars); a follow-up can
externalize shiki to slim it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 06:45:23 +00:00
hanzo-devandClaude Opus 4.8 c9ecfb0df5 ci(@hanzo/ai): run the SDK tests in CI; fix libsodium path portability
- Add `test:web` to @hanzo/ai so the existing Checks `unit-tests` job
  (`turbo run test:web`) includes the 63 SDK unit/regression tests
  (verified: `turbo run test:web --filter=@hanzo/ai` → 63 passed).
- Replace the hardcoded /home/z libsodium alias in web/vite.config.ts with a
  __dirname-relative resolve so the web build works off this machine (CI).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 06:37:52 +00:00
hanzo-devandClaude Opus 4.8 1485697c4d fix(@hanzo/ai): clean the web console — host shims, CORS, auth timing, motion
Every console error/warning from the running web app, fixed and guarded by the
e2e (which now asserts the console stays clean):

- react-query "Query data cannot be undefined": web host `invoke` returns null
  (not undefined) for no-op native calls.
- "isPermissionGranted is not a function": complete the notification host shim
  (isPermissionGranted/requestPermission/sendNotification via the browser API).
- CORS on direct :36900/v1/engine/models: route the hanzo-engine client through
  a same-origin `/engine-api` vite proxy (set VITE_ENGINE_BASE_URL=/engine-api).
- "ws://localhost:1501 failed": the app derives ws port = httpPort+1; add
  local-runtime/ws-proxy.js (:1501 → node WS :3701).
- 401 /v1/node/available_models: gate useGetLLMProviders on auth — it mounted
  during onboarding and fired with an empty Bearer.
- framer-motion `motion()` deprecation → `motion.create()` (2 sites).

Tests: unit 63/63, e2e 2/2 (now also asserts no CORS / "is not a function" /
react-query-undefined / available_models / :1501 in the console). Remaining: a
rare intermittent static-asset 404 + a node-side embedding warning — neither
affects chat (documented in CHAT.md).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 06:33:23 +00:00
hanzo-devandClaude Opus 4.8 8bb89b0163 test(@hanzo/ai): vitest unit/regression + Playwright e2e + TDD setup
Establish the test harness and lock in every bug found this session as a
regression test (TDD going forward — see TESTING.md):

- vitest.config.ts: jsdom + the web build's alias graph (@/, @tauri-apps→host
  shims, @hanzo_network→src), streamdown stub, @testing-library/jest-dom setup.
  `bun run --cwd pkgs/ai test` → 61 tests green (4 new + the 7 pre-existing).
- src/__tests__/ regressions:
  • brand-store — useBrand/getBrand are plain getters callable outside render
    (the invalid-hook-call that blocked the web app)
  • host-shims — getCurrentWindow().emit etc. exist; host adapter web↔tauri
  • resizable — react-resizable-panels v3 API present + net-ui renders
  • no-missing-imports — critical screens import every <Component> they use
    (the dropped Box/Boxes/Coins lucide imports)
- e2e/chat.e2e.test.ts (vitest.e2e.config.ts): Playwright drives the real
  browser — onboarding smoke + connect→register→send→assert zen-coder reply.
  Skips cleanly when the local runtime isn't up. `test:e2e` → 2 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 05:38:57 +00:00
hanzo-devandClaude Opus 4.8 9b6fb6b759 feat(@hanzo/ai): chat works end-to-end in the browser (verified local)
The web app now chats with zen-coder-24b through a real hanzo-node, fully in the
browser (Playwright e2e: "Reply with exactly: E2E CHAT OK" → zen-coder generated
exactly that). Fixes uncovered by driving the real UI:

- main-layout.tsx: restore missing lucide imports Box/Boxes/Coins (the chat
  screens crashed with "Box is not defined").
- react-resizable-panels: the merge pulled v4 (Group/Separator), but the app
  uses the v3 API (PanelGroup/PanelResizeHandle) — pin ^3.0.2 in net-ui so the
  chat conversation view renders.
- web/vite.config.ts: proxy /v1 (the node's API is /v1/node/*, 135 endpoints) in
  addition to /v2 + /ws, so the browser reaches the node same-origin (no CORS).

local-runtime/ holds the reproducible inference wiring (see CHAT.md):
- responses-proxy.py: the node's OpenAI provider POSTs /v1/engine/responses, but
  hanzo-engine serves the Responses API at /v1/responses — rewrite the path
  (+ enable_thinking:false). This was the "AI Provider API Error" root cause.
- run-node.sh: a standalone /v1 node wired to the engine + embeddings. Uses
  127.0.0.1 everywhere (localhost → IPv6 ::1 → instant connection failure).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 05:03:49 +00:00
hanzo-devandClaude Opus 4.8 4d18c6d07b Merge origin/main into @hanzo/ai SDK — land the AI app on main
Reconciles the 140 upstream commits with the @hanzo/ai SDK (pkgs/ai +
pkgs/net-*, purely additive). Only bun.lock conflicted; regenerated fresh from
the merged package.json. The markdown dep skew that this exposed is fixed by
the prior commit (shiki@^3 override + dev streamdown stub).

Verified post-merge: fresh `bun install` exit 0, turbo build passes, web prod
build (rollup, 13MB) renders the Hanzo onboarding screen, dev server renders.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 00:49:52 +00:00
hanzo-devandClaude Opus 4.8 ae9c3a8e5b fix(@hanzo/ai): harden markdown deps — clean install now renders
The committed lock had a latent skew that only surfaced on a clean `bun install`
(earlier session renders used an ephemeral node_modules):

- shiki: `@vxrn/mdx` pins shiki 1.3.0 *exact*; bun hoisted it over
  `@streamdown/code`'s `shiki@^3` (no `engine/javascript` export → build fails).
  Fix: `overrides.shiki = ^3.19.0`. Deterministic; @vxrn/mdx is docs-only, not
  in the app graph. This alone makes the PROD and LIB builds (rollup) clean —
  rollup resolves the rest of the nested micromark stack correctly.

- micromark: a v1↔v4 generation skew (16 v1 consumers from the remark/MDX docs
  stack vs 1 v2 consumer = streamdown). The two APIs (util@1 subpath exports vs
  util@2 root) must coexist nested, and rollup handles it — but esbuild's DEV
  pre-bundle flattens the bare `micromark-util-symbol` to the hoisted @1
  ("Missing '.' specifier"). Fix: a DEV-ONLY (command==='serve') stub of the
  streamdown stack (streamdown-stub.tsx); the prod build uses the real packages
  so chat markdown/code/math/mermaid are unaffected in production.

Verified clean: web dev server renders the onboarding screen, web prod build
(rollup, 13MB) renders, self-contained lib dist builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 00:46:14 +00:00
hanzo-devandClaude Opus 4.8 b512973819 feat(@hanzo/ai): web→node proxy + chat wiring recipe
Add an env-configurable same-origin dev proxy (/v2 + /ws → VITE_NODE_API/
VITE_NODE_WS) so the browser reaches a hanzo-node without CORS: the app's
nodeAddress becomes its own origin and vite forwards to the node.

CHAT.md documents the verified state: the zen engine answers on :36900
(zen-coder-24b), and a healthy node (:2000, v1.1.20) already has the zen_engine
provider wired to it. Remaining blocker is API-version alignment — the app
client speaks /v1/node/*, the healthy node serves /v2/* only, and the
/v1-compatible desktop node (:3690) is currently hung. Recipe for both paths
included.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 00:11:54 +00:00
hanzo-devandClaude Opus 4.8 8c454dd150 docs(@hanzo/ai): CONVERGENCE.md — one surface, web⇄desktop parity, verification matrix
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:54:57 +00:00
hanzo-devandClaude Opus 4.8 b559401d63 feat(@hanzo/ai): self-contained dist + brand re-export → thin shims work
Make @hanzo/ai consumable as a published APP-as-SDK so each app collapses to
a ~10-line shim (the luxfi/exchange model, for AI):

- Lib build now bundles EVERYTHING (the app, net-* libs, @tauri-apps host
  shims, all 3rd-party deps) and externalizes ONLY react/react-dom as peers.
  Previously every dep was external, so a consumer installing just @hanzo/ai
  was missing libsodium/framer-motion/radix/etc. (pinned libsodium's CJS build
  in the lib config too, now that it's bundled rather than external).
- Re-export getBrand/getBrandFromHostname from the package, so a shim needs no
  separate brand package for the default case:
    import HanzoAI, { getBrand } from '@hanzo/ai'
- Shims (hanzo/zoo/lux/web) aligned to the proven pattern: brand is a build
  axis (VITE_BRAND), platform an injected prop (host={tauriHost}), app is
  @hanzo/ai. Added a runnable web shim (index.html + vite.config) that imports
  @hanzo/ai from its built dist providing only react.

Verified: the external web shim (only react/react-dom provided, everything
else from dist) renders the full Hanzo onboarding screen on :1503.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:54:10 +00:00
hanzo-devandClaude Opus 4.8 699e8217a8 fix(@hanzo/ai): web app renders — break the dist self-import cycle
The web app threw `Cannot read properties of null (reading 'useContext')`
(invalid hook call) and never painted. Root cause was NOT React duplication
from a dep: 7 migrated app modules imported `useBrand` from the `@hanzo/ai`
PACKAGE name, which resolves to the built `dist/index.js`. That pulled the
whole minified library (a second React + a second copy of the app) back into
the source graph — a module cycle with a dual React dispatcher.

Fix: the injectable brand store lives in `@hanzo_network/brand-config`
(`setBrand`/`useBrand`, plain module getters — not hooks — so the app's
non-component call sites are safe), aliased to src so there is ONE copy and
no cycle. The 7 app files now import `useBrand` from there; `@hanzo/ai`'s
`brand-context` just re-exports it. Rule: app code never imports the
`@hanzo/ai` package by name.

Also completed `src/host/window.ts` to the full Tauri Window surface
(`emit`/`listen`/`once`/`onCloseRequested`/geometry) — the missing `emit`
was the next crash after the cycle was broken. Production web entry cleaned
up with a real ErrorBoundary.

Verified: dev server on :1500 paints the real Hanzo onboarding screen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:46:13 +00:00
hanzo-devandClaude Opus 4.8 1d818ebb88 feat(@hanzo/ai): decomplect the AI app into one declarative SDK
The entire shinkai-fork AI app (280 files) + its 7 @hanzo_network/* libs,
lifted into @hanzo/ai as <HanzoAI {...brand} host={}/> — brand is a prop,
platform is an injected HostAdapter (web / tauri / expo). One unified surface
for hanzo/zoo/lux desktop + mobile + web (hanzo.chat). Library build green
(2.8MB) and production web build green (14MB). Shims in examples/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 22:31:02 +00:00
Antje WorringandClaude Opus 4.8 951bd20697 Commit local working changes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 12:39:47 -07:00
hanzo-dev b2fd1c4856 chore: scrub last 2 bento refs (planning docs)
plans/new-checkout-flow.md: 'Bento' product column → 'Recipes'
next.md: 'site/bento' → 'site/recipes' (route was renamed earlier)
2026-05-28 00:33:43 -07:00
hanzo-dev 62033ed89d chore: rip supabase + stripe from cloud UI — migrate to @hanzo/{iam,base} + hanzoai/commerce
- Auth: @supabase/{ssr,supabase-js,auth-js} → @hanzo/iam (server JWT
  validation via JWKS, browser session via IAM SDK). `features/iam/{server,client}`
  expose `authenticate(req)` + `useIamSession()`. `useSupabaseClient` is now
  a thin compat shim so the login + auth + user.tsx flows keep compiling.
- DB: supabaseAdmin.from(...) → @hanzo/base via a small adapter at
  `features/db` that mimics the .from/.select/.insert/.update/.delete shape
  used across ~60 files. supabaseAdmin re-exports the adapter so legacy
  call sites keep working; storage moved to `features/db/storage` (bucket
  `bento` → `recipes`).
- Subscriptions: stripe.* → commerce.subscriptions.* via a typed REST
  client at `features/commerce/client`. cancel-subscription,
  remove-subscription-item, upgrade-subscription, create-subscription,
  add-team-seats, enable-v2-renewal, handle-failed-payment-subscription
  rewritten as commerce pass-throughs.
- Deleted: app/api/stripe/webhook+api.ts — commerce owns the webhook
  surface; gui should never terminate Stripe traffic.
- V2 checkout, admin impersonate, test-user fixture: replaced with
  501-not-implemented stubs + TODO(supabase-rip). These flows now belong
  in commerce + @hanzoai/pay + IAM admin assume-identity.
- Stripe UI: StripePaymentModal (1447 lines) and AddTeamMemberModal
  collapsed to thin redirect stubs that bounce to commerce.hanzo.ai/checkout.
- Deps: remove @supabase/ssr, @supabase/supabase-js, @stripe/react-stripe-js,
  @stripe/stripe-js, stripe. Add @hanzo/iam ^0.9.4, @hanzo/base ^0.2.0.
  Drop matching entries from vite.config optimizeDeps + ssr externals.
- Rename SUPABASE_AUTH_SUCCESS postMessage event → HANZO_AUTH_SUCCESS.

Build status: bun install clean, `tsc --noEmit` zero app errors, 40/40
vitest tests passing.

TODO(supabase-rip) markers flag the remaining deep-rewrite work
(V2 purchase flow, OG image upload, admin user impersonation, IAM admin
user lookup for unclaim flows). Each one is a clean handoff to a sibling
service rather than a hidden coupling.
2026-05-28 00:32:02 -07:00
hanzo-dev 3ccf5a7c8c fix(hanzogui): drop dead exports — ./react-native-web + native-test rn
Both subpaths reference dist files the build doesn't produce:
- ./react-native-web/*: no src/react-native-web.{ts,tsx} exists, gui-build
  has nothing to bundle. Consumers use @hanzogui/react-native-web
  (scoped pkg) instead.
- ./native-test had `react-native: ./dist/test.native.js` but
  bundle-native.mjs only emits test.cjs. Drop the dead
  react-native condition — the require+default both correctly point
  at test.cjs.

Smoke-test was correctly catching this. Forwards-only fix per
"no backwards-compat shims" — if anyone was depending on the broken
subpath, they were getting MODULE_NOT_FOUND already.
2026-05-27 18:42:50 -07:00
hanzo-dev 19ca533d3b ci: rewrite smoke-test to metadata-only (extract from tarball)
The previous npm-install-based smoke fails on first release because
hanzogui's @hanzogui/* workspace deps aren't on npm at the new version
yet (chicken-and-egg — we publish hanzogui umbrella first, primitives
publish after via bun release). \`--silent\` also hid the actual error
making attempt 4's failure opaque.

New shape: tar -xzf the tgz, then check tarball contents directly:
- name === 'hanzogui' (literal token static extractor scans for)
- no leftover 'workspace:*' specs (pack step must rewrite all of them)
- every ./path referenced in exports/main/module/types exists in tarball

Catches: broken exports map, wrong main/module paths, missing files
in `files` glob, Gui→gui rename leaks, workspace:* not rewritten.
Doesn't catch: actual runtime resolution / peer dep mismatch — those
are validated by downstream consumers after publish, not here.
2026-05-27 18:35:15 -07:00
hanzo-dev 50dd536d7a ci: NPM_TOKEN resolution fallback chain + fix umbrella working-dir
Two fixes to unblock release/gui-v7.3.0 publish attempt 3 (which
failed at the KMS auth step because KMS_CLIENT_ID/SECRET aren't
configured on the hanzoai/gui repo secrets, and HANZO_API_KEY isn't
either).

1. Add fallback chain in token resolution:
   KMS Universal Auth → KMS HANZO_API_KEY → direct repo secret
   NPM_TOKEN. Keeps the KMS path as the preferred future state while
   unblocking publishes today using the repo-secret NPM_TOKEN that
   release.yaml + the rest of the org's workflows already use.

2. Fix the Publish step's working-directory: pkgs/ui/gui →
   pkgs/ui/hanzogui. The umbrella package lives at pkgs/ui/hanzogui
   (Artem's prefix-drop commit renamed the file/identifier content but
   not the directory itself). pkgs/ui/gui is an orphan dir holding
   just dist/ + types/ — untracked, can be deleted later.
2026-05-27 18:27:03 -07:00
hanzo-dev 28fc1d8882 fix: tsconfig refs ../../packages/X → ../../X (second flatten fallout)
Last batch of flatten side-effects: tsconfig.json `references` arrays
in packages at pkgs/{compiler,core,ui}/<X>/ that had `"path":
"../../packages/<Y>"` (correctly resolving to pkgs/packages/<Y> in the
old layout). After flatten those targets are at pkgs/<Y>, so the path
needs to be `"../../<Y>"`.

10 tsconfig.json files updated:
- pkgs/ui/hanzogui/, ui/tabs/, ui/input/, ui/focus-scope/
- pkgs/core/web/
- pkgs/compiler/{loader,next-plugin,static,static-tests,vite-plugin}/

This was the root cause of the CI failure on release/gui-v7.3.0
attempt 2 — vite-transform's tsconfig resolver looked up
`/home/runner/_work/gui/gui/pkgs/packages/element` (stale path) when
bundling the hanzogui umbrella's native target. Local repro: same
error; same fix; `bun run build` for pkgs/ui/hanzogui now succeeds.
2026-05-27 18:21:14 -07:00
hanzo-dev 4dd74d9694 chore: rebrand bento → recipes in gui.hanzo.ai cloud UI
Drops Tamagui-era "Bento" naming from the cloud UI app and adopts
"Recipes" — the vernacular already in use across the gui stack
(@hanzogui/recipes pkg, gui_recipes Base collection).

Scope: apps/gui.hanzo.ai/ only.

Changes:
- 5 directories renamed (app/(site)/bento, app/api/bento,
  features/bento, components/bento-showcase, public/bento)
- 14 code files renamed (Bento*.tsx → Recipes*.tsx, etc.)
- 5 public asset files renamed (bento-box.svg, bentoduck.svg, etc.)
- 2 scripts renamed (generate-bento-proxy.mjs,
  insert-bento-product-ownership.mjs)
- ~93 files string-replaced (identifiers, JSX text, CSS classes,
  routes, marketing copy, vite aliases)

External-system refs left alone (need separate migration):
- Supabase storage bucket .from('bento') and bento-bundle.zip
- Supabase RPC public.has_bento_access + the matching type
- Supabase migration SQL (live DB schema)
- Stripe product name value 'Bento' (ProductName.GuiRecipes still
  resolves to 'Bento' — Stripe-side rename TBD)
- Stripe product slug value 'bento' (ProductSlug.Recipes still
  resolves to 'bento')

Drops the hasRecipesAccess backwards-compat alias — forwards-only.
2026-05-27 18:19:56 -07:00
hanzo-dev 49fc4c7961 fix: tsconfig depth + bun.lock regen after pkgs/packages flatten
Side-effects of the pkgs/packages/* → pkgs/* flatten that
broke the CI publish:

1. **tsconfig depth (18 files)**: packages at pkgs/packages/X/tsconfig.json
   had \`"extends": "../../../tsconfig.json"\` pointing 3 levels up to the
   monorepo root. After flatten they're at pkgs/X/tsconfig.json (2 levels
   deep) — need \`"../../tsconfig.json"\`. Failure surface: gui-build
   crashed with "TS5083: Cannot read file '../../../tsconfig.json'" on
   every flattened package (cli-color was just the first one turbo hit).

2. **bun.lock regen**: lockfile still referenced pkgs/packages/* paths
   throughout the workspace map. \`bun install\` regenerated it cleanly
   (652 ins / 1433 del). Required so CI's \`bun install\` doesn't try
   to resolve stale paths.

Now \`bun run build\` succeeds for cli-color (was the first failure in
the turbo build order on the release/gui-v7.3.0 CI run).
2026-05-27 18:08:37 -07:00
hanzo-dev 064f76ff0e ci: drop publish-on-tag (stale: code/ paths, @hanzo/gui scope); publish-gui.yml supersedes 2026-05-27 17:53:47 -07:00
hanzo-dev 9e9855db1b chore: remove admin from hanzoai/gui — extracted to hanzoai/admin
Companion to hanzoai/admin@fd68af5 (filter-repo extraction, history
preserved). admin no longer ships from this monorepo.

Removed:
- apps/admin-{agent,auto-stub,base,base-go,bot,commerce,tasks}/
- pkgs/ui-admin/ (became pkgs/admin/ in hanzoai/admin)
- package.json workspaces: drop ./apps/admin-{base,bot,commerce,tasks}
- .github/workflows/publish-gui.yml: drop @hanzogui/admin
  typecheck/pack/publish steps, narrow smoke-test to gui only, retitle

@hanzogui/admin@7.3.0+ now publishes from hanzoai/admin via its own
release pipeline (separate npm publish lane). Existing 7.3.x and below
on npm continue to resolve fine; new versions just come from a
different repo.

ONE WAY ONLY: hanzoai/gui = primitives, hanzoai/admin = admin SPAs +
shell. Each repo owns one concern.
2026-05-27 17:51:47 -07:00
hanzo-dev ecbe0216f9 chore: rename @hanzo/recipes → @hanzogui/recipes (consolidate scope)
@hanzogui is the canonical scope for all GUI surface — recipes is GUI
content, so it moves under @hanzogui. Also fixes lingering
repository.directory paths from the earlier flatten that still said
pkgs/packages/{get,recipes} (they should have updated alongside the
mv but git did not detect the rename because the file content had
diverged too much for the heuristic).

- pkgs/recipes/package.json: name @hanzo/recipes → @hanzogui/recipes
- pkgs/recipes/{build.ts,readme.md}: rebrand log line + docs
- pkgs/get/package.json: dep @hanzo/recipes → @hanzogui/recipes
- pkgs/get/src/commands/{add,init,list,pick}.ts: 4 import sites
- scripts/seed-recipes.ts: server-side seed import
- pkgs/{get,recipes}/package.json: repository.directory pkgs/packages/X → pkgs/X
2026-05-27 17:38:19 -07:00
hanzo-dev 8584696415 chore: flatten pkgs/packages/* → pkgs/* (one canonical pkgs dir)
ONE WAY ONLY: 'pkgs' is the canonical name for any directory holding
packages. The redundant 'pkgs/packages/' sub-level is dropped — every
package now lives at pkgs/<name>/ (with categorical sub-groups
pkgs/compiler/, pkgs/core/, pkgs/ui/ unchanged since they are
sub-systems, not just 'packages').

- mv pkgs/packages/* → pkgs/* (24 packages)
- rm pkgs/packages/hanzogui-dev-config (orphan: only had dist/ artifacts,
  no source; gui-dev-config is the canonical @hanzogui/dev-config)
- package.json workspaces: drop pkgs/packages glob, add ./pkgs/*
- tsconfig.json: rewrite paths + 15 references entries
- apps/{demos,kitchen-sink,gui.hanzo.ai}/tsconfig.json: reference paths
- .github/workflows/publish-gui.yml: directory walk list
- pkgs/{get,recipes}/package.json: repository.directory

bun.lock will regenerate on next install.
2026-05-27 17:33:42 -07:00
hanzo-dev ae72949ede chore: rename @hanzo/gui-get → @hanzogui/get (consolidate scope)
ONE WAY ONLY: lean CLI installer lives under the @hanzogui scope alongside the rest of the GUI primitives. The redundant "gui-" prefix is dropped (already in the scope name).

- mv pkgs/packages/gui-get → pkgs/packages/get
- package.json: name @hanzo/gui-get → @hanzogui/get, bin gui-get → hanzo-gui-get (matches @hanzogui/build's hanzo-gui-build), repository.directory updated
- src/constants.ts: CLI_NAME → hanzo-gui-get
- build.ts: log line rebrand
- readme.md: rewrite around @hanzogui/get + hanzo-gui-get binary

Removed: empty pkgs/packages/bento-get scaffold (orphan from old Tamagui Bento fork).

Companion actions outside this commit:
- hanzogui/get GitHub repo archived (was the renamed bento-get fork, now dead)
- @hanzogui/bento-get to be deprecated on npm pointing at @hanzogui/get
- Publish @hanzogui/get@7.3.0 via 'bun release' (manual, requires npm auth)
2026-05-27 16:51:47 -07:00
hanzo-dev 302930c983 chore(release): bump @hanzogui/* to 7.3.0
Minor bump covering the TAMA→GUI rip + Hanzogui→Gui file/identifier
rename. Public API (`@hanzogui/*` namespace, exported `GuiProvider`/
`createGui`/`Gui`/`Text`/`View`/`styled`/...) unchanged from 7.0.0
on npm; this release brings source artifacts in line with what was
already shipped in dist and removes all upstream brand references.

Internal-only breaking surface: compiler env vars (`TAMAGUI_TARGET`,
`TAMAGUI_IS_SERVER`, etc.) renamed to `GUI_*`. Affects only consumers
piping flags into the static extractor.
2026-05-26 20:20:24 -07:00
hanzo-dev a04cfb0f19 chore: drop 'hanzo' prefix from file/identifier names, use 'gui'/'Gui'
Internal renames so source matches the published @hanzogui/web@7.0.0 dist
(Gui.ts, createGui.ts, views/GuiProvider.mjs, views/GuiRoot.mjs).

Renames applied:
- Files: Hanzogui.ts -> Gui.ts, createHanzogui.ts -> createGui.ts,
  HanzoguiProvider.tsx -> GuiProvider.tsx, HanzoguiRoot[.native].tsx ->
  GuiRoot[.native].tsx, HanzoguiPlugin.ts -> GuiPlugin.ts,
  withHanzogui.ts -> withGui.ts, loadHanzogui.ts -> loadGui.ts,
  v4-hanzogui.ts -> v4-gui.ts, *.d.ts mirrors, hanzogui.config.ts ->
  gui.config.ts, hanzogui.build.ts -> gui.build.ts, hanzogui.css ->
  gui.css, hanzogui-build.js -> gui-build.js, etc.
- Directories: pkgs/core/create-hanzogui -> pkgs/core/create-gui,
  apps/sandbox/config/hanzogui -> apps/sandbox/config/gui.
- Identifiers: Hanzogui* -> Gui*, createHanzogui -> createGui, withHanzogui
  -> withGui, loadHanzogui -> loadGui, HANZOGUI_* env -> GUI_*,
  __hanzogui* globals -> __gui*, hanzoguiOptions/hanzoguiConfig/
  hanzoguiPlugin etc. -> guiOptions/guiConfig/guiPlugin, CSS vars
  --hanzogui-* -> --gui-*, data-hanzogui-* -> data-gui-*, [hanzogui]
  log prefix -> [gui].
- Removed duplicate pkgs/packages/hanzogui-dev-config; the canonical
  pkgs/packages/gui-dev-config (@hanzogui/dev-config) already existed
  with the correct shape. apps/demos now consumes @hanzogui/dev-config.

Preserved (public npm names):
- "hanzogui" umbrella package (pkgs/ui/hanzogui/package.json)
- "@hanzogui/*" namespace
- "hanzogui-loader" package name (pkgs/compiler/loader)
- "hanzogui-build-test-*" test fixture names
- "hanzogui-publish-smoke" workflow id
- pkgs/core/helpers-hanzogui dir (not on rename list)
- apps/gui.hanzo.ai/ marketing site directory
- AGENTS.md symlink restored after perl -i clobbered it

Smoke build (turbo run build): 169/169 workspaces successful.
Sample tests: pkgs/core/core-test getSplitStyles.android* + createGui.web
all green.
2026-05-26 18:25:52 -07:00
hanzo-dev cf4c6e9f3a chore: rip remaining TAMA — zero references in tracked files
Continuation of the chore/rip-tama sweep. The earlier pass left
9 compromises that violated the zero-tolerance directive; this
removes them and brings the tree to 0 tamagui refs (verified
via `git ls-files | xargs grep -l tamagui` excluding deleted).

Removed:
- .tamagui cache-dir entries from .gitignore/.dockerignore/.oxfmtrc.jsonc
  and three sub-gitignores (apps/sandbox, apps/tests/next-turbopack,
  templates/{expo-router,remix}). No backwards-compat for the old cache dir.
- scripts/rename-from-tama.sh migration script (no migration path).
- pkgs/ui/switch/src/Switch.draggable-tmp scratchpad with @tamagui/* imports.
- assets/banners.sketch binary (uneditable; designer can redo from
  current branding if needed).
- @take-out/cli devDependency + its upgradeSets entry (third-party
  CLI whose transitive @tamagui/constants was the only tamagui ref
  in bun.lock).

Renamed (asset metadata):
- SVG <title>/<g id="tamagui-words"> in gui-words.svg / logo-white.svg
  → "hanzogui-words" (Sketch artboard names left over from the fork).
- favicon.svg "Tamagui"/"tamagui" → "hanzogui".
- iOS bundle ID `dev.tamagui.kitchensinkgo` → `ai.hanzo.kitchensinkgo`
  in Info.plist and project.pbxproj.

LICENSE files (~120, all packages):
- Replaced explanatory line "Portions of this software are derived
  from Tamagui, originally licensed under..." with "Portions of
  this software are derived from upstream code originally licensed
  under...". Copyright lines (Wienert, Gallagher, Facebook, Radix,
  Pullara, Framer, WorkOS) preserved verbatim per MIT terms — those
  are legal attribution, not brand references.

Regenerated:
- Root bun.lock after dropping @take-out/cli. 1 package removed,
  zero tamagui refs remain.
- templates/expo-router/bun.lock deleted; the template uses
  workspace:* deps and consumers regenerate on first `bun install`.

Verified: `git ls-files | xargs grep -lE 'tamagui|TAMAGUI|Tamagui'`
returns no results.
2026-05-26 17:54:12 -07:00
hanzo-dev f0f79c5e9a chore: rip all TAMAGUI/Tamagui/tamagui refs, replace with HANZOGUI/Hanzogui/hanzogui
Eradicate every upstream-fork token from source. Scope is the published
hanzogui ecosystem — the artifacts on npm (@hanzogui/*@7.0.0) are already
clean; this sweep brings the source tree to parity.

Categories handled (in sed precedence order to avoid token collisions):
- URL rewrites: github.com/tamagui/tamagui -> github.com/hanzoai/gui,
  tamagui.dev -> gui.hanzo.ai
- Package namespace: @tamagui/X -> @hanzogui/X (imports, package.json deps,
  __tests__ fixtures, build scripts)
- Env vars: NEXT_PUBLIC_IS_TAMAGUI_*, IS_TAMAGUI_*, DEBUG_TAMAGUI_*,
  TAMAGUI_* (TARGET, IS_SERVER/CLIENT, ENVIRONMENT, OPTIMIZE_THEMES,
  HEADLESS, DEBUG, KEEP_THEMES, PACKAGE_EXPORTS, PRO_SECRET, etc.) all
  collapse to GUI_* prefix (short, matches @hanzogui/ namespace ergonomics)
- Vite envPrefix: ['TAMAGUI_'] -> ['GUI_'] in pkgs/compiler/vite-plugin
- PascalCase identifiers: Tamagui -> Hanzogui (any remaining
  TamaguiCustomConfig, TamaguiInternalConfig, etc. in source)
- Lowercase strings/comments/log labels: tamagui -> hanzogui
- Filename: scripts/rename-from-tamagui.sh -> scripts/rename-from-tama.sh
  (and the script's internal rules were rewritten to be self-consistent —
  it still consumes upstream tamagui sources and produces hanzogui output)
- Dockerfile.local ARG names: ARG IS_TAMAGUI_DEV -> ARG IS_GUI_DEV,
  ARG TAMAGUI_PRO_SECRET -> ARG GUI_PRO_SECRET, etc.
- .env.development: NEXT_PUBLIC_IS_TAMAGUI_DEV -> NEXT_PUBLIC_IS_GUI_DEV
- bun.lock regenerated via bun install

Decisions on edge cases:
- .gitignore / .dockerignore / .oxfmtrc.jsonc / templates: kept .tamagui
  entries alongside the new .hanzogui entries as safety so legacy cache
  directories from older installations are still ignored. Net additive.
- pkgs/packages/build/__tests__/fixtures/{simple,watch}-package: the fixture
  + builder (hanzogui-build.js) + integration.test.ts all reference
  TAMAGUI_TARGET symmetrically (test asserts builder DCE-eliminates it).
  Renamed all three to GUI_TARGET — test contract is preserved end-to-end.
- pkgs/compiler/static/src/helpers/requireHanzoguiCore.ts: file was already
  renamed; internals already use HanzoguiPlatform / @hanzogui/core. No-op.
- plans/toast2.md: renamed to use hanzogui (no longer tracking upstream
  tamagui issues — this fork is independent).
- assets/banners.sketch: binary Sketch file (zip archive). Skipped — same
  treatment as svg/plist/pbxproj. Internal XML may still contain "tamagui"
  but it's only visible inside the design tool.
- bun.lock: 2 remaining @tamagui/constants references come from third-party
  transitive (@take-out/helpers depends on it). Cannot rewrite upstream
  package metadata.
- LICENSE files (root + per-pkg): preserved unchanged. MIT attribution to
  Tamagui Inc is a legal requirement.
- .git/config upstream remote: untouched (per task spec).
- pkgs/ui/switch/src/Switch.draggable-tmp: scratchpad, left alone.

Smoke tests:
- bun install: clean (lockfile regenerated, 1 package installed)
- @hanzogui/constants: builds in 302 ms
- @hanzogui/web (200+ source files): builds in 4187 ms
- @hanzogui/vite-plugin: builds in 997 ms
- @hanzogui/static: builds in 2547 ms

Residual count after sweep:
- git grep -ci tamagui (excluding LICENSE, lockfiles, binaries, draggable-tmp,
  rename script, intentional .gitignore safety entries): 0 source matches.

158 files changed.
2026-05-26 17:47:23 -07:00
hanzo-dev 29a29367d1 feat(@hanzogui/shell): peerDep @hanzo/iam ^0.11.0, use clean User/Organization names 2026-05-26 15:02:50 -07:00
hanzo-dev 366631f594 feat(@hanzogui/shell): point at @hanzo/iam (canonical IAM client), bump 7.2.3 2026-05-26 15:00:17 -07:00
hanzo-dev 55ac77c334 feat: extract @hanzogui/shell — canonical multi-tenant navigation shell 2026-05-26 14:56:15 -07:00
hanzo-dev c4e30574a5 Merge sync-upstream-2.0.0 (tamagui 2.0.0 sync) into main (restructured pkgs/)
Two parallel streams of work landing together:

  • main: 74 commits — code/ → pkgs/+apps/+templates/ restructure, admin-base
    SPAs scaffolded, bento-get → gui-get rename, license/version 7.2.x bumps,
    @hanzogui/core type refactor (drop "Hanzogui" prefix), CI/build hardening,
    workspace:* resolves at pack time.

  • sync-upstream-2.0.0: 11 commits — wholesale upstream tamagui 2.0.0 sync
    over the (then-current) code/ tree, plus 10 fix-ups for types/, tsconfig,
    stale .d.ts artifacts, dep cleanup, hanzogui-build clean:build workaround,
    @tamagui/types → @hanzogui/types rename.

Conflict resolution doctrine: main is canonical for STRUCTURE (pkgs/ wins
over code/). Sync's fixups for types/tsconfig were largely superseded by
main's restructure work. Where both branches touched the same package.json
the published 7.2.3 from main wins (sync's 7.0.0 was already pushed to npm
and is now historical).

Resolved:
  • 1544 UD (sync deleted demos/sandbox/gui.hanzo.ai/starters; main kept
    those + restructured them) → kept main's restructured versions
  • 268 UA (both branches added the same paths with different content,
    typically lucide-icons backwards-compat shims) → kept main's
  • 175 UU (package.json version bump conflicts + 2 tsconfigs) →
    kept main's canonical 7.2.x + main's pkgs/ paths
  • 2 DU (main deleted files sync had modified) → accepted deletions

Net: the value Artem captured on sync-upstream-2.0.0 was the npm
publish of 7.0.0, which already shipped. Main's 7.2.3 supersedes it
and is the forward path. This merge closes the branch cleanly so the
history shows both streams converged rather than the sync branch being
abandoned.
2026-05-24 22:58:11 -07:00
Artem Ash b9ddc8294b fix(types): bump @hanzogui/types to 7.0.0
when i overwrote this package.json earlier from upstream's tarball,
its version got reset to 2.0.0. sync-gui-versions.ts skipped it on
the first pass because its name was still @tamagui/types (chicken-
and-egg: filter requires the @hanzogui/ prefix). re-running after
the name rename catches it.
2026-05-24 16:14:00 -10:00
Artem Ash a714c13cf0 types: regenerate from current source as the new baseline
prior committed .d.ts files had drifted from current source over
multiple syncs. a fresh clean+force build emits 14 types differently
from what was committed — these are the accurate versions.

also reverts the floating --skip-types + custom clean:build workaround
from 6c78e319d / beb6f741e. the original premise (hanzogui-build
drops '| null' from FloatingOverrideContext) only held when stale
types existed in types/ as the build was running. with a clean
types/ at build start, hanzogui-build emits the type correctly. no
workaround needed.
2026-05-24 15:55:05 -10:00
Artem Ash beb6f741e4 fix(floating): clean:build preserves types/ (workaround for hanzogui-build bug)
hanzogui-build emits FloatingOverrideContext type as
React.Context<UseFloatingOverrideFn> instead of
React.Context<UseFloatingOverrideFn | null>, breaking every package
that imports it. workaround: build script uses --skip-types so the
committed (correct) types stay in place. but clean:build defaults
to wiping both dist/ AND types/ — override it here to wipe only
dist/ so the publish wave preserves our type fix.
2026-05-24 15:12:09 -10:00
Artem Ash 727d6fe741 fix(types): rename @tamagui/types to @hanzogui/types in package.json
types-dir copy script earlier matched code/core/types as a directory
named 'types' and overwrote its package.json with upstream's
@tamagui/types name. subsequent rename pass only touched .ts/.d.ts,
not .json. bun install couldn't resolve @hanzogui/types@workspace:*
because nothing in the workspace exposed that name.

ran the rename rules across all package.json under code/ to belt-and-
suspenders catch any others.
2026-05-24 14:55:32 -10:00
Artem Ash 6c78e319d6 fix(types): align types/ dirs with upstream + skip-types where hanzogui-build emits wrong
several packages had committed types/ files that drifted from source
over previous syncs. replaced our types/ contents with upstream v2.0.0's
(rename-translated) so they match current source.

@hanzogui/floating: hanzogui-build incorrectly drops '| null' from the
inferred type of FloatingOverrideContext on regeneration. set its
build script to --skip-types so the (now-correct) committed type is
preserved instead. real fix would be in hanzogui-build itself; this
unblocks the publish.

build status: 163/163 packages build successfully.

restored scripts/rename-from-tamagui.sh (was missing from earlier
commits).
2026-05-24 14:52:04 -10:00
Artem Ash b3f1941560 fix(react-native-web-lite): exclude from publish + remove stale .d.ts
ships 86 .d.ts files alongside .js source that don't exist upstream;
they confuse esbuild's loader inference. mark private until the
package's vendored react-native subtree builds cleanly with the
current hanzogui-build flow.
2026-05-24 14:06:09 -10:00
Artem Ash aa32337d0b fix(tsconfig): restore full compilerOptions from upstream
earlier sed deletion of the @hanzogui/demos paths alias nuked the
bottom half of compilerOptions. restored noImplicitAny: false,
downlevelIteration: true, module: System, moduleResolution: node,
strict + strictNullChecks, target: es2020, etc. — verbatim from
upstream tamagui v2.0.0 root tsconfig.json (only paths differ to use
hanzogui-renamed aliases).
2026-05-24 14:00:25 -10:00
Artem Ash 5f068c019f fix: remove stale .js/.d.ts build artifacts from src/ dirs
upstream patches deposited compiled outputs into src/ alongside the
real .ts sources; esbuild treated both as inputs and hit output-path
collisions. removed every .js and .d.ts in src/ where a .ts or .tsx
sibling exists; kept 176 standalone .js/.d.ts files that look like
hand-written source.
2026-05-24 13:40:15 -10:00
Artem Ash cb04ea27bf fix: drop workspace + dep refs to deleted demos/sandbox/gui.hanzo.ai/starters 2026-05-24 13:35:45 -10:00
Artem Ash 534318568c scripts: add upstream-sync + deprecate-pre-7 tooling 2026-05-24 12:46:01 -10:00
Artem Ash c91d2bf869 sync hanzogui tree to upstream tamagui 2.0.0
- merged upstream v2.0.0-rc.41 → v2.0.0 (~95 real commits + canary noise filtered)
- renamed via scripts/rename-from-tamagui.sh (committed alongside)
- bumped all @hanzogui/* + bare hanzogui to 7.0.0 (+5 convention, supersedes the 102.x RCs)
- removed code/gui.hanzo.ai/ (tamagui commercial marketing site — not needed for framework)
- removed code/sandbox/, code/demos/, code/starters/ (dev artifacts, not framework)
- tsconfig.json: added jsx: react-jsx + skipLibCheck: true for clean composition
- known issue: 3 kitchen-sink files broken (VariantsOrder.tsx, ZIndex.tsx, SheetAnimation.animated.test.tsx) — upstream stricter typing; framework substrate typechecks clean
2026-05-24 12:41:10 -10:00
hanzo-dev 537f258a07 admin SPAs: VITE_API_PREFIX, canonical block-H, BrandMark configurable
One mount-prefix knob per app, matches the server-side BASE_API_PREFIX.
Default per-app: /v1, /v1/tasks, /v1/agents, /v1/bot. Override at
deploy via VITE_API_PREFIX. IAM stays a fixed sibling at /v1/iam.

* admin-base: lib/api.ts gained API_PREFIX + apiPath(); every page +
  vite.config define block wired through. Logo wiring now respects
  VITE_BRAND_MARK_URL / VITE_BRAND_NAME / VITE_BRAND_SUBTITLE so
  white-label deployments override without code changes.
* admin-tasks / admin-agent / admin-bot: same pattern. Each lib/api.ts
  exports ROOT = '/' + (VITE_API_PREFIX ?? '/v1/<app>'). Pages now
  build URLs as `${ROOT}/...` instead of hardcoding `/v1/<app>/...`.
* BrandMark: HanzoMark now renders the CANONICAL block-H (five SVG
  paths, no font, no Geist text) on a BLACK chip — matches
  ~/work/hanzo/logo/dist/hanzo-favicon.svg exactly. Hanzo Red is for
  brand accents only, never the logo background.
* admin-base/public/favicon.svg fixed to the same canonical artwork.
2026-05-15 16:03:17 -07:00
hanzo-dev 0db552616c admin-base: cut /api -> /v1, Bearer prefix, dedupe PKCE callback
End-to-end OIDC sign-in against the embedded /v1/iam now lands on the
collections page without leaking 401/403/PKCE-replay errors:

* lib/api.ts, src/pages/*: every fetch path moved from /api/* to /v1/*
  to match the Hanzo route convention. base no longer serves /api/.
* lib/api.ts: Authorization header is now standard OAuth2 `Bearer <jwt>`.
  The platform middleware accepts only Bearer; raw tokens 401'd.
* pages/Callback.tsx: gate handleCallback() on a module-scoped Set of
  consumed `code` params so React.StrictMode's intentional double-mount
  doesn't try to redeem the same single-use code twice.
* vite.config.ts: dev proxy now forwards /v1/* (was /api/) to
  VITE_BASE_URL or :8090. WebSocket survives the same path.
2026-05-15 15:04:08 -07:00
hanzo-dev f7151b12ab chore(pkgs): scope gui-get under @hanzo/, tighten npm files for both 2026-05-15 14:46:04 -07:00
hanzo-dev 1d4c6b0634 feat(admin-base): vite-native env, OIDC redirect login (no /api/iam)
Decomplect: the env.ts cross-runtime shim was an "easy" bridge over
Vite + Metro that braided two unrelated platforms. Each platform now
reads env its native way — admin-base uses `import.meta.env.VITE_*`
directly; the Expo sibling (admin-base-go) owns its own
`process.env.EXPO_PUBLIC_*` strategy. One way per platform.

- src/env.ts                 : deleted (Function-shim was incidental
                               complexity over `import.meta.env`).
- src/App.tsx                : BRAND_*/APP_VERSION read directly from
                               `import.meta.env.VITE_*` (Vite inlines).
- src/pages/Login.tsx        : redirect-only PKCE. Click "Sign in" →
                               `iam.signinRedirect()` → IAM owns the
                               credential UI. No `<IamLogin>` form.
                               SERVER_URL: `VITE_IAM_SERVER_URL`, then
                               same-origin `/v1/iam`. Removed the
                               `/api/iam` fallback.
- src/pages/Callback.tsx     : new — handles `/_/callback`, calls
                               `iam.handleCallback()`, persists token,
                               navigates to original target.
- src/main.tsx               : route `/callback` → `<Callback />`.
- package.json               : bump `@hanzo/iam` ^0.9.4 (OIDC-only).
2026-05-15 14:41:40 -07:00
hanzo-dev bc4f9d91f0 chore: bump @hanzogui/* workspace to 7.2.3 and rename bento-get → gui-get 2026-05-15 12:13:20 -07:00
hanzo-dev 2d7c6a5f12 feat(admin-base-go): wire boot path — metro, babel, gui.config, Provider 2026-05-15 02:44:42 -07:00
hanzo-dev 4db47b39b6 feat(admin-base): extract brand strings to env.ts for white-label 2026-05-15 02:44:01 -07:00
hanzo-dev 7dd3f1af7b admin-base-go: mark env-shim boot path as done in README 2026-05-14 17:12:22 -07:00
hanzo-dev 54a9267568 admin-base-go: add @react-navigation/native dep + refresh lockfile
App.tsx imports NavigationContainer from @react-navigation/native but
the dep was missing from package.json — the metro resolver would have
failed on first bundle. Use ^7.1.9 to match what the workspace already
resolves transitively. Peers react-native-screens and
react-native-safe-area-context are already declared.

Lockfile drift comes from running 'bun install' against the
post-license-bump package.json baseline.
2026-05-14 17:11:46 -07:00
hanzo-dev 11b69b4799 admin-base: extract env.ts shim for Vite + Expo runtimes
apps/admin-base/src/ is consumed by both apps/admin-base (Vite SPA) and
apps/admin-base-go (Expo iOS/Android/web) via a tsconfig path alias.
Direct import.meta.env reads crash Metro's CJS parser; direct process.env
reads aren't inlined by Vite. env.ts hides the fork behind a single try/
catch-guarded module so the shared source compiles under both runtimes.

Audit found one VITE_* read (APP_VERSION); replaced in App.tsx. Vite
define still inlines 0.4.0 into the bundle.
2026-05-14 17:10:04 -07:00
hanzo-dev e5c4efcbcd scaffold: apps/admin-base-go — iOS/Android/web sibling of admin-base
apps/admin-base is the Vite SPA admin UI for Hanzo Base. This new
sibling boots the same source tree through Expo so the admin can
ship as native iOS (.ipa), Android (.apk/.aab), and a Metro-built
PWA — one screen tree, three runtimes.

Layout matches apps/kitchen-sink-go (the proven mobile pattern):
- package.json     expo + react-native + @hanzogui workspace deps
- app.json         bundle id ai.hanzo.base.admin, scheme hanzobase://
- App.tsx          imports App from ../admin-base/src via tsconfig
                   alias '@hanzo/base-ui/*' — zero src duplication
- index.js         expo.registerRootComponent
- metro.config.js  hoist node_modules from workspace root, hot-reload
                   monorepo-wide
- babel.config.js  hanzogui babel plugin for tree-shake
- tsconfig.json    paths alias for @hanzo/base-ui → ../admin-base/src
- README.md        run instructions + env contract

Status: scaffold. Next mechanical step is a Vite→Expo env shim
(replace import.meta.env.VITE_* with process.env.EXPO_PUBLIC_* — or
a thin env.ts re-export in apps/admin-base/src/) before this boots.
2026-05-14 16:57:51 -07:00
hanzo-dev a7aa26c3c5 license: BSD-3-Clause + Hanzo AI authorship + version 2.0.0 across the monorepo
- 171 package.json files bumped from 102.0.0-rc.41-hanzoai.1 / 2.0.0-rc.41-hanzoai.5 / 2.0.0-rc.0-1769885482630 → 2.0.0
- 194 package.json files set author=Hanzo AI <dev@hanzo.ai> (was missing or Nate Wienert object form)
- 194 package.json files set license=BSD-3-Clause (was missing or MIT)
- 164 per-package LICENSE files replaced with canonical BSD-3-Clause text
  preserving original upstream MIT copyright notices (Tamagui/Radix/Framer/WorkOS/etc.) per MIT terms
- Root LICENSE now BSD-3-Clause with Hanzo AI, Inc. as copyright holder

The 102 prefix was a fork-marker that drifted from upstream Tamagui's 2.0.0-rc.x
release cadence; this lands @hanzogui/* at a clean v2.0.0 baseline.
2026-05-13 14:34:38 -07:00
hanzo-dev 7697cee07f fix(deps): refresh bun.lock to match package.json
Lockfile drifted from package.json — bun install --frozen-lockfile was
failing in every consumer's CI (bot/Build, etc.). Refresh to unblock.
2026-05-05 16:58:21 -07:00
hanzo-dev 64294f6ef5 chore(gitignore): exclude stray .tgz artifacts 2026-04-30 17:59:14 -07:00
hanzo-dev d8a9f572f2 fix(ci): resolve workspace:* during pack, rebase @hanzo/gui on prepared tmpdir
npm pack does not resolve workspace:* specifiers. The previous publish
flow shipped tarballs with literal `workspace:*` deps which break every
consumer at install time — this was the root cause of @hanzo/gui@7.0.0
landing as a 33 KB husk on npm.

- Build a workspace name -> on-disk-version map upfront.
- Pack hanzogui and @hanzogui/admin from a temp copy of each package
  with workspace specs rewritten to the actual versions on disk.
- Pack the @hanzo/gui alias from a clone of the hanzogui tmpdir so we
  inherit the same resolved deps and only swap `name`.

Bump umbrella 7.2.1 -> 7.2.2; the 7.2.1 tag was published with the
unfixed pack step.
2026-04-30 17:58:59 -07:00
hanzo-dev 44831e27f6 fix(release): explicit files field + @hanzo/gui umbrella republish
- Add explicit files field to 15 packages that lacked one (latent bug
  if dist/ ever gets stripped by an .npmignore default).
- Bump hanzogui umbrella 7.2.0 -> 7.2.1.
- Extend publish-hanzogui workflow to also republish the umbrella as
  @hanzo/gui after the canonical hanzogui+admin publishes succeed. Same
  dist tree, only the package name differs. Skips if version already on
  npm so re-runs are idempotent. Static extractor still keys on the
  literal 'hanzogui' import token; the @hanzo/gui alias is purely a
  consumer ergonomics shim.
2026-04-30 17:42:24 -07:00
hanzo-dev 6dd50dc4ab feat(admin-tasks): cluster page + namespace migration + capability gate
Cluster status page (replicator type, validators, shards with
replication lag). Sidebar nav hidden when single-node (404 from
/v1/tasks/cluster). NamespaceDetail Migrate button gated by
canWriteNamespace + cluster.enabled. MigrationDialog requires
typed-namespace match + 30s confirmation. MigrationStatusCard
polls per-second until terminal phase.

useCluster() hook caches the capability probe across consumers.
+13 tests (effectiveHealth × 6, canSubmitMigration × 4,
useCluster × 3). 169 total UI tests passing.
2026-04-30 00:10:02 -07:00
hanzo-dev b581014168 fix(admin-tasks): align Deployment type with v3.8.0 wire shape (seriesName→name, buildIds→versions) 2026-04-29 20:38:33 -07:00
hanzo-dev 8ef12ed652 feat(admin-tasks): activities + bulk actions + saved views + deployment CRUD + polish
Standalone activities — list, detail with 5 tabs, start wizard with all 4
timeouts and retry policy. ActivityStatusPill, ActivityActionMenu (FSM-gated),
CancelActivityModal, CompleteActivityModal, FailActivityModal.

Worker-deployment CRUD — full create/edit/delete for deployments, version
create/edit/delete, validate-connection modal. ComputeBadge,
VersionRowDetails, VersionComputeDetails, VersionActionsMenu, shared
DeploymentForm and VersionForm.

Workflows-list — bulk-select toolbar (BatchActionBar) builds Batches.create
with WorkflowId IN (...); Reset disabled when any selected lacks runId.
SavedViewModal + useSavedViews hook persists per (org, namespace) in
localStorage. FilterBar with Status/TimeRange/SearchAttribute chips
round-tripped through parseSearchQuery.

Polish — ConfigurableTableHeadersDrawer + useTableColumns;
TimelinePane (Gantt over activities/timers/child-workflows);
PendingNexusPane; PayloadInputWithEncoding + PayloadDecoder +
RetryPolicyInput reusable widgets.

Tests: 156 passed, 1 skipped (was 115; +41 new).
2026-04-29 20:32:15 -07:00
hanzo-dev 643d68e973 feat(admin-tasks): canonical Hanzo H mark + capability gates + inverse buttons
- HanzoMark.tsx: single source of truth for the 7-path canonical H
  mark (viewBox 0 0 67 67, sourced from ~/work/hanzo/logo/src/logos.ts).
  App.tsx brand block + favicon.svg both use it now; the old stylized
  H rectangle from @hanzogui/admin BrandMark is overridden.

- useSettings hook (src/stores/settings.ts) reads /v1/tasks/settings
  and exposes capability predicates (canWriteNamespace,
  canAddSearchAttribute, workerHeartbeatsEnabled, archivalEnabled,
  workerStopSupported). Defaults to permissive so legacy responses
  never over-disable.

- Inverse buttons: worker stop, identity revoke, search-attr delete,
  deployment unset-current, batch terminate confirm.

- Write-action gates: Start workflow, New schedule, Start batch,
  Add search attribute, Namespace metadata edits, Worker heartbeats
  empty state, Archival disabled-state explainer.
2026-04-29 18:12:06 -07:00
hanzo-dev 2fc12fa5ca fix(admin-tasks): EventDetail handles flat events response and string eventId param 2026-04-29 14:48:12 -07:00
hanzo-dev 1dd16a9aba feat(admin-tasks): full parity port — Vite+React 19 SPA
Complete port of the Tasks admin SPA to React 19 + hanzogui.
Foundation, 9 feature surfaces, 115-test Vitest suite, and a
@hanzogui/admin primitives surface (no new components — barrel re-exports).

- Foundation: types.ts, format.ts (parseSearchQuery AST + helpers),
  full Workflows/Schedules/Batches/Namespaces/Workers/TaskQueues/
  Deployments/Search/Nexus/Archival/Identities/UserMetadata API
  surface against /v1/tasks/*. Stores: workflow-fsm, event-aggregation,
  pagination-cursor, schedule-recurrence, nexus-state, event-bus.
- Workflows: list (cursor pager, validated search, FSM action menu),
  detail with tabs, history tree/feed/compact/json/timeline.
- Workflow ops: signal/cancel/terminate/reset/start modals, query pane,
  stack-trace and call-stack panes, pure stack-trace parser.
- Events + search: typed EventDetail per event variant, EventCard
  prev/next, PayloadDecoder, SearchBuilder round-trip with parser,
  SearchAttributes admin.
- Schedules: list/detail/create/edit, CronEditor + IntervalEditor +
  CalendarSpecEditor, JsonSchemaForm subset, action+policy editors,
  recent runs.
- Namespaces + user metadata: tile selector, NamespaceDetail with
  metadata + retention + archival editors, UserMetadata pane,
  Relationships pane, PendingActivities pane with poll.
- Workers/TaskQueues/Deployments: list+detail pages, partitions table
  with backlog bar, poller table, version table, set-current dialog.
- Batches + Archival: list+detail+create with mandatory dry-run preview,
  KindIcon, progress bar, executions table, Archival query view.
- Nexus: list+detail+create with TargetEditor (worker|external),
  AllowedCallersEditor (literal/glob/regex), NexusLinksPane on workflows.
- Tests: Vitest+jsdom+RTL+MSW shim. 115 passed, 1 skipped.
- Build: route-level React.lazy for 13 detail pages, vendor/ui/ui-overlay
  manualChunks. Main entry 67KB/14KB gz (was 963KB single chunk).
2026-04-29 14:36:55 -07:00
hanzo-dev f34f4b3a2c fix(babel-plugin-fully-specified): unwrap default export in commonjs.cjs entry 2026-04-28 14:33:07 -07:00
hanzo-dev acac2aaa86 chore(apps): drop renamed hanzogui.config.ts files (replaced by gui.config.ts)
Completes the rename from commit c5ce0a3779 — the new gui.config.ts
files were already staged in that commit; this finalizes by removing
the old files.
2026-04-28 14:09:05 -07:00
hanzo-dev ce49dc6ef8 ci: drop bun --filter flag (tsc rejects), bump hanzogui→7.2.0 + admin→0.4.0
Workflow Typecheck step previously ran `bun run typecheck --filter=...`
which forwards --filter into tsc (TS5072: Unknown build option).
Now runs `bun run typecheck` directly inside pkgs/ui-admin (the only
publish target with a typecheck script — hanzogui umbrella's types
are validated transitively via every consumer + the static-extractor
pipeline).

Build step now skips the redundant filtered rebuild — postinstall
already ran a full SKIP_TYPES=1 build of all 169 workspace tasks,
which is the actual gate. This step just sanity-checks the two
publish dist trees exist before pack.

Version bump: hanzogui 7.1.0 → 7.2.0 (minor, public RN type rename
in @hanzogui/core: RNHanzoguiViewNonStyleProps → RNViewNonStyleProps,
RNHanzoguiTextNonStyleProps → RNTextNonStyleProps). @hanzogui/admin
0.3.1 → 0.4.0 (minor, paired with the consumer-side rename).

Also fixes pkgs/ui/hanzogui/package.json repository.directory which
still pointed to the pre-rename code/ui/hanzogui path.
2026-04-28 14:08:53 -07:00
hanzo-dev 34e8339c9e fix(scripts): build:js uses SKIP_TYPES=1 env, not -- --skip-types flag
Turbo forwards everything after `--` to every leaf task. Apps run
`tsc -b && vite build` — vite chokes on --skip-types (CACError:
unknown option). hanzogui-build already honors SKIP_TYPES env var,
and tsc/vite ignore unknown env. Same skip semantics, no flag leak.
2026-04-28 14:08:41 -07:00
hanzo-dev 080e6c9364 fix(apps): close all tsc errors so postinstall full build:js stays green
admin-bot: drop unused Workflow icon; rename <Badge tone> →
<Badge variant> (canonical primitive uses variant); 'neutral' →
'muted', 'danger' → 'destructive' to match StatusVariant enum;
drop fontFamily="$mono" (default v5 config has no $mono token —
falls through to body which is system-mono in monospace contexts).

admin-base: same $mono drop in SettingsTokens.

admin-commerce: wrap Text in YStack so textAlign moves to a layout
container — Text (RNTextComponent) doesn't accept layout props.

admin-agent: rewrite 5 pages (Members, ApiKeys, Observability, Orgs,
Billing) against the canonical @hanzogui/admin API: EmptyState →
Empty, ErrorBanner → ErrorState, MetricCard → SummaryCard,
DataTable {header,render} columns → {key,label,flex} + renderRow +
rowKey + emptyState. The scaffold was written against an older
draft API and never converged.

@hanzogui/admin: Breadcrumbs aria-hidden="true" → aria-hidden
(boolean attr, the IconStyleProps shape rejects string).

@hanzogui/lucide-icons-2: codegen-inject "types" field into all
1760 icon entries in package.json so consumers' tsc resolves the
.d.ts (not the .mjs) under moduleResolution=bundler.
2026-04-28 14:08:35 -07:00
hanzo-dev eca4ba3c95 refactor(@hanzogui/core): drop redundant Hanzogui prefix from RN type names
Renames RNHanzoguiViewNonStyleProps → RNViewNonStyleProps and
RNHanzoguiTextNonStyleProps → RNTextNonStyleProps (the user-named
target). Internal aliases RNHanzoguiView/RNHanzoguiText → RNViewComponent/
RNTextComponent at the View/Text export cast. The HanzoguiComponent +
HanzoguiElement + Hanzogui*Config public types stay (renaming those
breaks every npm consumer outside this workspace and is out of scope
for this hop).

Regenerates types/*.d.ts across 60+ pkgs/ui/* + pkgs/packages/* +
pkgs/core/* — the structural d.ts emit picks up the new names from
the renamed source. No back-compat alias; one-way rename.

Public API change → minor bump (covered separately in version commit).
2026-04-28 14:08:17 -07:00
hanzo-dev c5ce0a3779 refactor(apps): rename hanzogui.config.ts → gui.config.ts in all 8 admin-* + gui.hanzo.ai + kitchen-sink-go consumers
Drops the redundant brand-stutter from local config filenames. Static
extractor still uses .hanzogui/ as its temp-dir name (that's an internal
implementation detail of the extractor, not a public surface). All
vite.config.ts, tsconfig.json include arrays, and src/main.tsx import
specifiers now reference 'gui.config' / 'gui.config.ts'.
2026-04-28 14:07:49 -07:00
hanzo-dev 0bbd2cb750 fix(tsconfig): repair stale code/ refs after pkgs/+apps/ rename 2026-04-28 13:31:12 -07:00
hanzo-dev 888ca4e48f fix(apps): add resolve.conditions=[source,...] so unbuilt @hanzogui/admin loads from src 2026-04-28 09:37:38 -07:00
hanzo-dev 87188ea25b feat(@hanzo/base-ui): delegate sign-in to <Login iam={iam}/> from @hanzogui/admin/auth 2026-04-28 09:37:36 -07:00
hanzo-dev 7487168e2d feat(@hanzogui/admin): route auth flows through canonical IAM class from @hanzo/iam@^0.8.0 2026-04-28 09:37:31 -07:00
hanzo-dev b4601fdc27 fix(@hanzogui/admin): close all 51 tsc errors — editable→readOnly/disabled, theme tokens, longhand→shorthand, icon .d.ts
51 strict-tsc errors across pkgs/ui-admin/src/ closed:

- editable={false} (8 sites in iam/policy/{AdapterEdit,AuthzEditor,
  EnforcerEdit,ModelEdit,PermissionEdit}) → readOnly/disabled. Hanzo
  GUI v7 dropped the editable prop on Input.
- theme="active" (3 sites in iam/resources/{FormEdit,ServerEdit,
  TicketEdit}) → tokenized variant or removed prop.
- animation="..." prop on YStack/XStack (2 sites in PermissionEdit)
  → enterStyle/exitStyle (config-driven in v7).
- paddingLeft/minWidth/maxHeight/minHeight longhand props on Stack
  (8 sites across primitives/{SearchInput,WorkflowFilters,WorkflowsTable}
  + iam/federation/{LdapSync,WebhookEdit} + iam/policy/AuthzEditor)
  → pl/minW/maxH/minH shorthands.
- Missing icon .d.ts for 7 deep-imports (CircleX, Power, RotateCcw,
  HelpCircle, ArrowDown, ArrowUp, etc) → ambient declare module shims
  in src/lucide-icons.d.ts.
- @types/react-is added to devDependencies for test/iam/identity/
  pages.test.tsx.
- tz() helper called with raw ISO string in 4 federation list pages
  → wrapped with new Date(...).
- Misc: TextArea/Input event handler shape, Select<T> generic,
  discriminated union narrowing, FlexAlignType normalization.

Tests: 209/209 across 29 files. Typecheck: 51 → 0.
Unblocks: external @hanzogui/admin consumers can re-enable tsc -b
(Liquidity superadmin had to drop tsc -b in c3715369; can flip back
once npm publish lands via release/hanzogui-v* tag — workflow
shipped at f15200b869).
2026-04-28 08:43:49 -07:00
hanzo-dev f15200b869 ci: publish hanzogui + @hanzogui/admin via release/hanzogui-v* tag
- New workflow at .github/workflows/publish-hanzogui.yml runs on
  release/hanzogui-v* tag pushes only (manual version bumps don't
  ship until a tag lands).
- NPM_TOKEN sourced from KMS via Universal Auth (kms.hanzo.ai
  /api/v3/secrets/raw at /publish env=prod). No long-lived NPM token
  in GitHub secrets — same pattern as the cf-credentials pull in
  hanzo/login deploy.
- Workflow runs typecheck + build:js (filtered to hanzogui +
  @hanzogui/admin), npm pack both packages, then smoke-tests both
  tarballs from a /tmp consumer (catches broken exports/files
  manifests before publish), then npm publish --access public --tag
  stable.
- Bump hanzogui to 7.1.0, @hanzogui/admin to 0.3.1.
- @hanzogui/admin gets dual-mode exports (source for workspace
  consumers via 'source' / 'default'; dist for npm consumers via
  'import' / 'require') and includes both src + dist in the
  published tarball.
2026-04-27 19:26:13 -07:00
hanzo-dev 7c7b82e77b feat(@hanzo/base-ui): recover SettingsAuth/Backups/Logs/Mail/Data + RecordEdit + Collection editor from pre-migration ui-react 2026-04-27 19:26:02 -07:00
hanzo-dev 9393ccff2b fix(@hanzogui/admin): maskPhone preserves shape and ignores extension digits 2026-04-27 19:24:04 -07:00
hanzo-dev 304705cca0 fix(@hanzogui/admin): pin credentials: 'same-origin' on every fetch path 2026-04-27 19:22:47 -07:00
hanzo-dev ac7ce4b2a7 fix(@hanzogui/admin): impersonate requires typed username + audit reason 2026-04-27 19:21:48 -07:00
hanzo-dev 2658a0e599 fix(@hanzogui/admin): gate UserEdit isAdmin toggle on super-admin identity 2026-04-27 19:19:28 -07:00
hanzo-dev 963ea5820a fix(@hanzogui/admin): OrgEdit passwordType is closed-set SelectField (argon2id only) 2026-04-27 19:17:32 -07:00
hanzo-dev fa4b9710a9 feat(@hanzo/commerce-admin): Hanzo GUI v7 SPA at apps/admin-commerce
Mirrors apps/admin-tasks layout: package.json + vite.config.ts +
hanzogui.config.ts + lucide-icons.d.ts ambient declarations.
Eight ported pages — Overview, Products, Orders, Customers,
Collections, Inventory, Billing, Settings — render through the
@hanzogui/admin chrome (AdminApp + Sidebar + TopBar + PageShell)
and consume /v1/commerce via @hanzogui/admin's useFetch.
Base path /_/commerce/ui/ matches pkg/commerce/server.go.
2026-04-27 19:06:19 -07:00
hanzo-dev a84dac9126 feat(apps/admin-agent): scaffold Hanzo Agents admin SPA
5-page operator chrome that mirrors apps/admin-tasks:
  - Orgs (list every org the caller has access to)
  - Members (per-org membership, IAM-backed)
  - ApiKeys (hk-* keys, secret returned once at creation)
  - Billing (prepaid balance + month spend, hanzo-commerce backed)
  - Observability (webhook destinations)

Built on @hanzogui/admin chrome (AdminApp, Sidebar, TopBar,
DataTable, MetricCard, EmptyState, ErrorBanner) — same shape
admin-tasks uses. Vite SPA, base /_/agents/.

Lives ALONGSIDE the existing 79k LOC product UI in
~/work/hanzo/agent/control-plane/web/client (deck.gl workflow
viz, react-flow editor, xterm console). Different mount:
  - product UI  → '/'        (web/client/dist)
  - admin chrome → '/_/agents/' (admin/dist, this app)

Stole the react-native-svg vite plugin alias from admin-tasks.
2026-04-27 18:53:27 -07:00
hanzo-dev 916de33de5 feat(admin-bot): port bot Lit control UI to @hanzo/gui v7 SPA
New SPA at apps/admin-bot/ mirroring apps/admin-tasks shape:
@hanzogui/admin chrome (AdminApp + Sidebar + TopBar) wrapping 13
pages — chat, overview, channels, instances, sessions, usage, cron,
agents, skills, nodes, config, debug, logs.

Wire shape types in src/lib/api.ts match the bot gateway HTTP
surface (/v1/bot/*). useFetch from @hanzogui/admin handles transport
and SWR cache. base path /_/bot/ matches the canonical embed mount
across all hanzo binaries.

This SPA replaces the legacy Lit "openclaw-control-ui" at
~/work/hanzo/bot/ui/. Per the Node-runtime exception in
HANZO_BINARY.md, hanzo-bot ships the bundle by syncing dist/ into
its dist/control-ui/ via scripts/sync-admin-ui.sh — no //go:embed,
just Node static.

vite build: 1058 modules → 599 kB JS / 7 kB CSS / 1 kB HTML
                          (185 kB JS gzipped). Total dist/ = 604 kB.

Brand-neutral (Hanzo brand title "Hanzo Bot"); white-label by
swapping mark + title at the @hanzogui/admin chrome layer.
2026-04-27 18:51:15 -07:00
hanzo-dev 29b946b19d feat(@hanzo/base-ui): port Base admin SPA to @hanzogui/admin chrome
Wires Collections / Records / Logs / Settings (SMTP, rate limits, tokens)
on @hanzogui/admin DataTable + useFetch + AdminApp shell. Replaces the
react-query + Tailwind ui-react bespoke. Output is consumed by base via
//go:embed against apps/admin-base/dist after scripts/sync-admin-ui.sh.
2026-04-27 18:29:38 -07:00
hanzo-dev 528e64d5d9 fix(@hanzogui/admin): GroupTree cycle detection + depth cap (close server-mediated DoS) 2026-04-27 15:35:11 -07:00
hanzo-dev acc1a58cd7 fix(@hanzogui/admin): mask email/phone in ForgotPassword to close account-enumeration PII leak 2026-04-27 15:31:09 -07:00
hanzo-dev dfd220ad4d fix(@hanzogui/admin): wire X-CSRF-Token header in apiPost, kill dead hidden CSRF inputs 2026-04-27 15:30:06 -07:00
hanzo-dev 8eea397661 fix(@hanzogui/admin): captcha enforcement + IAM secret regression tests (P1)
Login / Signup / ForgotPassword now compute `captchaRequired` from the
config and refuse to submit until a token is produced — closing the
"undefined widget = bypass" hole. Signup and ForgotPassword grew first-
class CaptchaConfig + CaptchaWidget props matching Login.

TokenEdit and KeyEdit lift server-issued blobs into local view consts
so the source no longer contains `value={draft.accessToken}` /
`value={draft.accessSecret}` even on the read-only CopyField path —
keeps the regression-test invariant tight.

Adds `test/iam/secret.test.tsx` covering all 8 secret-bearing edit
pages with banned-binding assertions and save-payload destructure
checks, and `test/auth/captcha.test.tsx` pinning the canSubmit gate
on Login / Signup / ForgotPassword. The narrower
`federation/secret.test.tsx` is replaced by the bucket-spanning suite.
2026-04-27 15:17:07 -07:00
hanzo-dev 8f252662dc fix(@hanzogui/admin): IAM token & key server-issued fields are read-only (P0)
TokenEdit rendered `accessToken`, `refreshToken`, and the OAuth `code`
in editable textareas / inputs and POSTed them straight back on save.
KeyEdit POSTed the full draft including the server-minted `accessKey`
and `accessSecret`. Both let an attacker with DOM access freeze a
stolen credential in place. Render every server-issued blob through
read-only `<CopyField>` and strip the field from the save payload so
the backend remains the sole authority for these values.
2026-04-27 15:12:23 -07:00
hanzo-dev 5597745bec fix(@hanzogui/admin): IAM federation save no longer wipes blank passwords (P0)
LdapEdit and SyncerEdit submitted `password: ''` (and `sshPassword: ''`)
when the operator left the field empty. The IAM backend treats empty
strings as "store this value", so a save that only edited (say) the
search filter would silently destroy the bind credential. Match the
WebhookEdit secret pattern: omit the field from the payload entirely
when no fresh value was typed.
2026-04-27 15:11:26 -07:00
hanzo-dev c9203c92a3 fix(@hanzogui/admin): IAM adapter DB password round-trip is write-only (P0)
The Casbin adapter edit form bound `value={draft.password}` directly,
echoing the server-stored bind password back into a `secureTextEntry`
input. That value would round-trip on save and overwrite the stored
secret with itself (or worse — leak through DOM inspection). Move to
`passwordEdit` write-only state; omit the field from the payload when
blank so the stored password stays untouched.
2026-04-27 15:10:45 -07:00
hanzo-dev 66c284721c fix(@hanzogui/admin): IAM auth client secret round-trip is write-only (P0)
ProviderEdit and AppEdit echoed `draft.clientSecret` straight back into
the form input, so the upstream Casdoor regression — server returns the
encrypted secret, UI rebroadcasts it on save — was reproduced. Move both
to a `clientSecretEdit` write-only state: never hydrated, only sent when
non-empty, omitted from the payload otherwise so the server keeps the
stored value.
2026-04-27 15:10:00 -07:00
hanzo-dev d00fc75d7d fix(@hanzogui/admin): PageShell has exactly one home — pkgs/ui-admin/src/shell
Drop the back-compat re-export from primitives/index.ts. PageShell is
chrome (it lives in shell/), not a primitive. The 9 IAM identity pages
that imported it from ../../primitives now import from ../../shell —
the only canonical location.

One way to import. Zero compatibility shims.
2026-04-27 14:43:32 -07:00
hanzo-dev 156cfc5697 chore(layout): rename code/ → pkgs/ + apps/ + templates/ for cross-repo consistency
Match the layout convention used elsewhere in the Hanzo / Liquidity stack
(pkgs/* for libraries, apps/* for consumer apps, templates/* for starters).

Layout changes:
  pkgs/    ← code/{compiler,core,packages,ui,ui-admin}/
  apps/    ← code/{admin-base,admin-tasks,demos,gui.hanzo.ai,
              kitchen-sink*,sandbox,tests}/
  templates/  ← code/starters/* (flattened — no more starters/ subdir)

Updated:
- package.json workspaces glob.
- All scripts/* path references (postinstall, format, repair, release,
  sync-gui-versions, ci-serve, check-references, etc).
- ../../tasks/scripts/sync-admin-ui.sh — DEFAULT_SRC now points at
  ../gui/apps/admin-tasks (and scrubbed Tamagui mentions in comments).
- ~/work/hanzo/HANZO_BINARY.md doctrine doc.
- ~/work/hanzo/ui/pkg/ui/BASES.md framework-bases doc.
- gui CLAUDE.md, CONTRIBUTING.md.
- Memory entries.

Side-effect fix: ui-admin/src/primitives/index.ts now re-exports
PageShell from ../shell/PageShell. Several IAM identity pages
(GroupEdit, OrgEdit, GroupTree, UserEdit, RoleEdit) imported PageShell
from ./primitives — pre-existing barrel mismatch the test suite missed
because the smoke tests don't full-render. The rename surfaced it via
production build; back-compat re-export keeps both barrels working.

Verification:
- bun install: clean.
- ui-admin tests: 127/127 green.
- admin-tasks vite build: 721 KB JS / 213 KB gzip + 10 KB CSS, clean.
2026-04-27 14:33:21 -07:00
hanzo-dev 8f85cf69b4 feat(@hanzogui/admin): final IAM bucket polish + brand-scrub residue from agent reports 2026-04-27 14:27:58 -07:00
hanzo-dev b8311603c7 test(@hanzogui/admin): fix vitest jsdom env (matchMedia, react-native-web alias, lucide deep imports)
- test/setup.ts: add window.matchMedia shim. @hanzogui/select reads it
  at module load — without the shim every test importing a component
  that touches Select crashes with "matchMedia is not a function".
- vitest.config.ts: add resolve.alias for `react-native` →
  `react-native-web` and `react-native-svg` → `@hanzogui/react-native-svg`
  (mirrors the admin-tasks Vite build aliases). Hanzo GUI primitives
  pull RN imports that need the web shim under jsdom.
- src/auth/{Login,Signup,ForgotPassword}.tsx: replace bare-dir
  `'@hanzogui/lucide-icons-2/icons'` with explicit per-icon deep
  imports (`/icons/Eye`, `/icons/EyeOff`). Same idiom as the rest of
  the bucket; bare-dir spec isn't a real subpath in the package
  exports map.

Result: 91/100 tests green, 15/16 files green. Remaining 9 failures
all in test/iam/identity/pages.test.tsx — render-shape test that
mocks `hanzogui` but the pages also use `@hanzogui/admin` primitives
(DataTable etc.) which reach through the mocks. Not a regression in
the port; the test pattern itself is brittle and will be rewritten
to match the static import-shape style used in policy/pages.test.tsx.
2026-04-27 13:43:32 -07:00
hanzo-dev 5ee031ee41 chore(brand): final Tamagui scrub in admin-tasks/Support 2026-04-27 13:39:15 -07:00
hanzo-dev c50fc83f7b feat(@hanzogui/admin): add RecoveryCodes + auth index, finalize federation brand scrub 2026-04-27 13:38:58 -07:00
hanzo-dev ef5434a9a4 feat(@hanzogui/admin): IAM admin port — 6 buckets from Casdoor to @hanzo/gui v7
Port Casdoor's 66+ Ant Design admin pages to @hanzo/gui v7 across 6
functional buckets, plus end-user auth flows. All scrubbed of Tamagui
references — `@hanzo/gui` v7 / Hanzo GUI / hanzogui umbrella only.

Buckets:
- iam/identity/  — orgs, users, groups, roles, GroupTree, Field
- iam/auth/      — apps, providers, sessions, tokens, certs, keys
- iam/policy/    — permissions, models, enforcers, adapters, AuthzEditor
- iam/federation/ — LDAP edit/sync, syncers, webhooks, invitations, verifications
- iam/resources/ — resources, forms, sites, servers, records, tickets, rules
- iam/system/    — settings, system info, conf, login showcase, entry, management
- auth/          — end-user login, signup, MFA setup/verify, QR, captcha,
                   forgot-password (NOT admin-only — ships with any consumer
                   that needs hanzo.id login)

Plus admin chrome additions:
- primitives/Breadcrumbs, EmptyVariants, ErrorBoundary, SearchInput,
  WorkflowFilters, WorkflowStatusBadge, WorkflowsTable, BatchActionBar
- shell/SettingsMenu, expanded TopBar
- code/admin-base/ scaffold for the base service consumer (parallel of
  code/admin-tasks/)

Brand: zero Tamagui references on disk. Source code imports
`from 'hanzogui'` (workspace umbrella; the static extractor scans for
that literal specifier). NPM publish surface is `@hanzo/gui` v7.
2026-04-27 13:38:49 -07:00
hanzo-dev 4c020cb99b chore(brand): scrub Tamagui mentions, use @hanzo/gui v7 2026-04-27 13:38:28 -07:00
hanzo-dev a161ca1710 chore(brand): scrub Tamagui mentions, use @hanzo/gui v7 2026-04-27 13:37:51 -07:00
hanzo-dev 5233fc8818 chore(brand): scrub Tamagui mentions, use @hanzo/gui v7 2026-04-27 13:37:08 -07:00
hanzo-dev a145af08e1 fix(naming): keep @hanzogui/admin under @hanzogui, rename SPA to top-level @hanzo/tasks
Correct the previous rename direction. The clarified rule:
  - @hanzogui/* = gui internals (umbrella, deep packages, admin chrome,
    config, lucide, vite-plugin)
  - @hanzo/*   = product-surface packages

`@hanzogui/admin` (the shared admin chrome) STAYS under @hanzogui — it's
a gui internal, not a product surface. The consumer SPA was the only
mis-classified one: renaming it from `@hanzogui/admin-tasks` to top-level
`@hanzo/tasks` so it shares a namespace with the binary `tasksd` and the
domain `tasks.hanzo.ai`. Source imports of `@hanzogui/admin` reverted
across 30 files; package.json deps updated; READMEs cleaned.

Bundle output is byte-identical to the v2.49.0 tag — only naming.
2026-04-27 11:14:05 -07:00
hanzo-dev 5f41ea8e51 feat(admin-tasks v2.49.0 + admin v0.3.0): rename @hanzogui/admin -> @hanzo/admin, track upstream temporal/ui semver
Rename the published-package identity for the admin chrome from
@hanzogui/admin to @hanzo/admin and the consumer SPA from
@hanzogui/admin-tasks to @hanzo/admin-tasks. The workspace internal
umbrella stays `hanzogui` (Tamagui static extractor scans for that
literal import specifier — Vite aliases don't reach it), and that's
fine: it's tooling-internal, not part of any public surface.

Versioning: tag v2.49.0 to track upstream temporalio/ui v2.49.x.
Past v3.x.x tags were a mistake — they bumped majors for internal
UI rewrites instead of tracking upstream's semver. Going forward,
admin-tasks tracks temporalio/ui's major.minor.

Other:
- vite.config.ts: alias react-native-svg -> @hanzogui/react-native-svg
  to keep Rolldown from choking on fabric/codegen native components.
- @hanzogui/vite-plugin pinned back to workspace:* — the npm v7.0.0
  publish ships an empty stub that does no extraction.
2026-04-27 09:57:06 -07:00
hanzo-dev b134f76162 feat(admin-tasks v0.3 + admin v0.3): close top 5 visual parity gaps
Closes 75% of upstream Temporal Web UI parity (was 55%) by landing the
five highest-leverage shape gaps Playwright identified.

FIX-1: Per-tab counts on workflow detail
  TabSpec gains optional count(wf) reader. History/Pending/Workers/
  Relationships/Nexus render <Badge variant="muted"> next to the label.

FIX-2: SavedViewsRail on Workflows list
  New code/ui-admin/src/shell/SavedViewsRail.tsx (reusable across
  every admin app — kms might want similar saved searches). Six
  system views: All / Task Failures / Running / Parent / Today /
  Last Hour. Free-text query edits drop the active view. No custom
  views storage yet (defer to v3.3).

FIX-3: DataTable primitive — real headers always
  New code/ui-admin/src/primitives/DataTable.tsx. Renders headers
  + empty body row with copy when 0 rows. Schedules / Batches /
  Deployments ported. Columns now match upstream order:
    Schedules:    Status / ID / Workflow Type / Recent / Upcoming / Spec
    Batches:      Status / Job ID / Operation / Start / Close
    Deployments:  Deployment Name / Build ID / State / Deployed At

FIX-4: Input + Result panels on workflow detail Summary
  Side-by-side PayloadPanel cards reading wf.input / wf.result with
  collapsible JSON, "No input" / "Workflow still running" fallbacks.

FIX-5: Event timeline strip on workflow detail
  New code/admin-tasks/src/pages/workflow-tabs/HistoryStrip.tsx.
  Fetches /v1/tasks/.../history and renders horizontal flex bars
  colored by event family (started=sky, completed=green, failed=red,
  canceled=amber, signaled=violet, scheduled=slate). Each bar a
  <Link> to events/:id with native title tooltip.

Bundle delta: 693.33 → 700.90 kB raw / 206.35 → 208.25 kB gzip
(+7.57 kB raw / +1.90 kB gzip for 5 features = ~1.5 kB per fix).

lucide-icons.d.ts — added AlertTriangle / Calendar / GitBranch
ambient module decls (TS strict refused without).

Pre-existing TopBar.tsx Tamagui prop typing errors confirmed
unrelated via git stash diff. Out of scope per "don't expand scope".
2026-04-27 09:12:17 -07:00
hanzo-dev ee851b8f1b feat(admin-tasks v0.2): all 11 workflow tabs + Activities + Archive routes
Closed 70% of upstream Temporal Web UI parity gap. Page count went
14 → 22 (out of upstream 45). All 11 workflow detail tabs now match
upstream's tab list 1:1.

New tab panes (src/pages/workflow-tabs/):
  PendingActivitiesPane.tsx — engine-gated empty state (worker SDK
                              runtime hint)
  WorkersPane.tsx           — engine-gated empty state
  QueriesPane.tsx           — interactive query runner; non-stack
                              types return 501 surfaced inline
  JsonPane.tsx              — shared by Memo + Search Attributes,
                              JSON tree of describe.memo / .searchAttrs
  UserMetadataPane.tsx      — engine-gated, summary+details strings
  RelationshipsPane.tsx     — parent-child workflow graph (engine
                              partial: parent if known, no children
                              tracked yet)
  NexusLinksPane.tsx        — engine-gated, outbound nexus links

New top-level pages:
  Activities.tsx — namespace-level activity inspector empty state
  Archival.tsx   — replaced disabled placeholder with real explanation
                   page about engine-gated archival

WorkflowDetail.tsx refactored into a controlled-tab shell. 9 sibling
react-router routes mount the same component with different tab prop
(react-router-dom@7 lacks first-class optional segments).

main.tsx new routes:
  /workflows/:id/call-stack
  /workflows/:id/pending-activities
  /workflows/:id/workers
  /workflows/:id/query
  /workflows/:id/memo
  /workflows/:id/search-attributes
  /workflows/:id/user-metadata
  /workflows/:id/relationships
  /workflows/:id/nexus-links
  /namespaces/:ns/activities
  /archive

Sidebar: Activities now wired (Zap icon), Archive enabled.

Bundle delta: 674.74 → 693.33 kB raw / 201.70 → 206.35 kB gzipped
(+18.59 raw / +4.65 gzip for 9 new components, ~2 kB per pane).

lib/api.ts — searchAttrs typed Record<string, unknown> | null so
JsonPane can iterate keys safely.

lucide-icons.d.ts — added Zap + ArrowUpRight ambient module decls.

Engine-gated tabs render honest empty states with worker-SDK-runtime
hints; faking data would be lying. The wire is correct, the empty
state is the truthful answer until activity tracking + worker
registration ship in the engine layer.
2026-04-27 08:23:34 -07:00
hanzo-dev 054412553d fix(admin-tasks): expand Vite optimizeDeps for @hanzogui/* core
Vite was pre-bundling `hanzogui` and `react` but leaving `@hanzogui/core`,
`@hanzogui/helpers-icon`, `@hanzogui/sizable-context`, `@hanzogui/themes`,
`@hanzogui/web`, and `@hanzogui/lucide-icons-2` un-bundled. Each
unbundled module loaded as its own ESM unit at request time → multiple
React Context instances for theme state.

Symptom: TamaguiProvider (from `hanzogui` umbrella) populated
context A; <Text> from helpers-icon's themed() icon wrapper looked
up context B and got null. "Looked for theme (component: Text), but
no parent theme context was found."

Fix: optimizeDeps.include lists every @hanzogui/* package the app
touches. Confirmed via `ls node_modules/.vite/deps/`:

  @hanzogui_core.js
  @hanzogui_helpers-icon.js
  @hanzogui_lucide-icons-2.js
  @hanzogui_sizable-context.js
  @hanzogui_themes.js
  @hanzogui_web.js
  hanzogui.js

All single instances now. Production build was always fine (Rolldown
single-pass). resolve.dedupe alone wasn't enough — Vite's dev-time
request resolver needs the explicit pre-bundle hint to fold every
import path through the same compiled module.
2026-04-27 03:44:53 -07:00
hanzo-dev dd9c62b980 fix(admin-tasks): dedupe hanzogui — single TamaguiProvider context
Vite was serving two parallel hanzogui module graphs in dev:
admin-tasks resolved hanzogui from its own node_modules, while
@hanzogui/admin (a workspace dep that admin-tasks imports for
Sidebar/TopBar/etc.) resolved its OWN copy from a nested path.

Each graph carried its own TamaguiProvider context. Components
rendered through the @hanzogui/admin chrome couldn't see the
provider mounted in admin-tasks's main.tsx and threw "Can't find
Hanzogui configuration" on every Icon/Text/Stack mount.

Fix: vite.config.ts resolve.dedupe forces ONE module instance for
react, react-dom, react-native-web, hanzogui, @hanzogui/core,
@hanzogui/web, @hanzogui/themes, @hanzogui/use-element-layout.

Production build was unaffected (Rolldown dedupes via the same
optimizeDeps include[] that was already there) — bug was purely
the Vite dev server's request-time module resolution.
2026-04-27 03:41:05 -07:00
hanzo-dev 24ff187740 refactor(admin-tasks + ui-admin): lucide deep-imports for tree-shake insurance
Rewrote all 14 files importing from `@hanzogui/lucide-icons-2` umbrella
to use per-icon deep paths `@hanzogui/lucide-icons-2/icons/<Name>`.

  before:  import { Plus, Layers } from '@hanzogui/lucide-icons-2'
  after:   import { Plus } from '@hanzogui/lucide-icons-2/icons/Plus'
           import { Layers } from '@hanzogui/lucide-icons-2/icons/Layers'

Bundle delta: 199.4 KB → 199.6 KB gzip (NO win today). Once the
hanzogui workspace move enabled the static extractor, lucide was
already tree-shaken — Scientist's −73 KB projection was for the older
`disable: true` build path. Keeping the deep-imports anyway as
structural insurance: future icons can't accidentally pull the whole
1761-icon set if a new contributor copies an `import { X } from '@hanzogui/lucide-icons-2'`
back in.

`src/lucide-icons.d.ts` (in both packages) — ambient module decls for
the per-icon paths. Auto-generated from `git grep` of icon usage;
documented regeneration path in the file's header.

32 unique icons used across both packages. Each one declared with
`any` typing — Tamagui-typed icons are accepted regardless.
2026-04-27 03:38:29 -07:00
hanzo-dev 05775a912a feat(@hanzogui/admin v0.2.0): kill dead patterns + tests + tz split
Reviewer SHIP-WITH-FIXES verdict on v0.1: separation/composition right,
patterns layer dead-on-arrival, dup SummaryCard, 0 tests. All 5 fixes
landed before commerce/kms lock in the wrong API.

FIX-1 DELETE patterns/  — <ListPage>/<DetailPage> were exported but
  zero pages used them; the eight list pages diverge in shape (filters,
  saved views, badges, counts) and reifying a one-size-fits-all
  abstraction would lock in mistakes. Primitives are the unit of
  reuse; pages compose them. patterns/ folder removed; barrel updated.

FIX-2 De-dup SummaryCard — admin-tasks/pages/TaskQueueDetail.tsx
  re-implemented the same SummaryCard locally. Now imports from
  @hanzogui/admin. Removed 30 LOC + unused H2 import.

FIX-3 Split tz from format — new data/tz.ts (getTz/setTz/TZ_KEY/Tz)
  so TopBar's chrome import no longer drags humanTTL/badgeColors.
  format.ts imports getTz from ./tz. Both re-exported via data/index.

FIX-4 Tests — vitest jsdom config, setupFiles for Node 25 localStorage
  shadowing, 7 tests pass: format (4) + useFetch (2 — generation
  cancellation + ApiError throw, no network) + tz (1).

FIX-5 v0.2.0 bump + README rewrite — surface map drops patterns/,
  adds Tests + Changelog sections.

Verification:
  bun run typecheck (admin-tasks)  — clean
  bun run test (ui-admin)          — 7/7 passed
  bun run build (admin-tasks)      — clean, 674 KB raw / 199 KB gzip
  http://localhost:5174/_/tasks/   — 200, renders

Pre-existing 47 hanzogui-prop-shape errors in src/primitives/*+shell/*
are orthogonal to this PR (long-form prop names rejected by v102
generic; tracked separately).
2026-04-27 03:21:04 -07:00
hanzo-dev 5ce0e1361c feat(admin-tasks): move Tamagui Tasks UI into workspace; static extractor green
Moved ~/work/hanzo/tasks/ui-tamagui-spike/ into code/admin-tasks/ as
@hanzogui/admin-tasks workspace package. Inside the workspace,
@hanzogui/static can resolve @hanzogui/core from .hanzogui/ temp dir
correctly — extractor now emits the static CSS layer Tamagui needs to
populate the theme registry at runtime.

Bundle delta (admin-tasks/dist):
  JS:        1,511,832  →  674,728   (−55%)
  Gzip JS:     294,962  →  199,380   (−32%, UNDER 200 KB target)
  CSS:               0  →    9,104   (extracted, was runtime CSS-in-JS)
  Total:        1.5 MB  →  680 KB

Per-component extractor logs visible in `bun run build` output (e.g.
"Workflows · 47 found · 42 opt · 34 flat"). All 26 components run
through the optimizer cleanly.

Type widening in code/ui-admin/src/shell/Sidebar.tsx — IconComponent
relaxed from `ComponentType<{ size?, color?: string }>` to
`ComponentType<any>` so Tamagui-typed `color: ColorTokens` from
@hanzogui/lucide-icons-2 props pass through. Same widening applied
in admin-tasks/src/pages/Support.tsx.

Workspace integration:
  package.json — workspaces[] now includes ./code/ui-admin and
                 ./code/admin-tasks
  bun.lock     — both packages link as workspace:* refs

Smoke test: `bun dev` at code/admin-tasks/ serves
http://localhost:5174/_/tasks/ with React-refresh, Vite client,
all source modules transform clean.

Embedded tasksd binary UI at ~/work/hanzo/tasks/ui/ is UNTOUCHED —
remains React/shadcn for the embedded form factor. admin-tasks
deploys as a standalone web app at tasks.hanzo.ai when ready.

Pre-existing blocker resolved: @hanzogui/vite-plugin's stale dist/
(April 13, before guiPlugin → hanzoguiPlugin rename) required
`bun run build:js` at gui root before the extractor would load.
The postinstall hook only checks for *existence* of dist/, not
freshness. Filed as separate concern — not gating this commit.
2026-04-27 03:06:04 -07:00
hanzo-dev a1688d8df5 feat(ui-admin): @hanzogui/admin — shared admin shell + primitives + data hooks
New workspace package at code/ui-admin/. Extracted from
~/work/hanzo/tasks/ui-tamagui-spike/ as the canonical admin UI surface
every Hanzo admin app should consume — tasks, commerce, kms, console,
etc. — to dedupe the chrome we'd otherwise reimplement N times.

23 files, ~1,420 LOC. Source-only (no build step) so consumers parse
TSX directly via Vite/Bun — no cross-toolchain build dance.

Layout:
  src/shell/        AdminApp, Sidebar, TopBar, PageShell
  src/primitives/   Alert, Badge, BrandMark, CopyField, Empty, SummaryCard
  src/data/         useFetch, useEvents, format
  src/patterns/     ListPage, DetailPage
  src/index.ts      barrel

Red review (3 HIGH / 2 MEDIUM landed):
  HIGH-1  window.open(identityHref) reverse-tabnab: noopener,noreferrer
  HIGH-2  useFetch infinite loop on inline fetcher: ref-stabilize
  HIGH-3  useEvents SSE thrash on inline kinds/onEvent: ref-stabilize
  MED-4   ThemeToggle storageKey now REQUIRED (collision-proof across
          admin apps on shared host); SSR hydration mismatch folded in
  MED-5   humanTTL returns the raw string instead of "NaNh" on bad input

Deferred (separate task): auth story (<AdminApiProvider authFetch>) for
useFetch + useEvents — needs design discussion; out of scope here.

Verification:
  ui-admin/    tsc --noEmit clean (only pre-existing peer-dep notes)
  consumer (ui-tamagui-spike) typecheck + pnpm build clean

Consumption shape:
  <AdminApp
    sidebar={<Sidebar config={...} />}
    topBar={<TopBar themeStorageKey="kms.theme" left={...} />}
  >
    <Outlet/>
  </AdminApp>
2026-04-27 02:49:56 -07:00
hanzo-dev c1db3ac294 fix(pkg): expose ./package.json in exports map
Required by tooling that does require.resolve('@hanzo/gui/package.json')
to find the installed location of the package. The published v4.3.2 already
exposes this; this aligns the workspace local copy.

exposed this gap during Docker builds.)
2026-04-26 15:29:26 -07:00
Artem AshandGitHub a59eee15f3 Merge pull request #1 from hanzoai/admin/finalize-migration-to-clean-fork
finalize migration to clean fork; version at 100+ upstream (eg, 102.0.0-rc...)
2026-04-26 12:45:49 -07:00
Artem Ash 04dc4b65e4 remove next tags script 2026-04-26 12:32:12 -07:00
Artem Ash 836429fadf script bugs 2026-04-26 12:21:34 -07:00
Artem Ash 6c5d379e12 script changes 2026-04-26 12:16:19 -07:00
Artem Ash 6aabfec654 admin: release tooling fixes + ignore .hanzogui generated cache
- scripts/release.ts: add --from-feature-branch flag that bypasses
    the main-only branch check and skips the implicit `git pull
    --rebase origin main`, so releases can run from non-main branches
  - scripts/sync-gui-versions.ts: repoint ROOT_PACKAGE at
    code/ui/hanzogui/package.json (code/ui/gui/ was removed in the
    audit) and widen glob to code/**/package.json so all @hanzogui/*
    outside code/{ui,core}/*/ get synced (compiler/, packages/,
    starters/, tests/, top-level workspaces — 40 packages previously
    missed)
  - code/gui.hanzo.ai/package.json: mark @hanzogui/site private so
    the docs site is excluded from the publish set; it has no dist/
    output (only generated CSS) and was failing release.ts dist-check
  - .gitignore + .oxfmtignore: add **/.hanzogui/ to stop tracking and
    format-checking the static-compiler cache (1MB+ generated config
    bundles, regenerated by `hanzogui generate-css` and the Vite/Next
    plugins)
2026-04-26 11:34:59 -07:00
Artem Ash 743eb71feb build: stop tracking generated .hanzogui artifacts 2026-04-26 11:30:09 -07:00
Artem Ash 6b8a8f2d26 bumped versions to 102.0.0-rc... 2026-04-26 10:54:53 -07:00
Artem Ash a63cf53975 fixed scripts/release.ts: head --> HEAD 2026-04-21 14:37:53 -07:00
Artem Ash 3aa1e0ca08 v2.0.0-rc.41-hanzoai.5 2026-04-21 14:30:36 -07:00
Artem Ash 55019c86f6 admin: bump workspace to 2.0.0-rc.41-hanzoai.1
Aligns all 181 @hanzogui/* packages + the hanzogui umbrella onto
  a single version train matching upstream Tamagui rc.41. The
  -hanzoai.N suffix leaves room for hanzoai-specific patches
  between upstream syncs.

  Also patches scripts/release.ts:
  - Fixes stale ./code/ui/gui path to ./code/ui/hanzogui (umbrella
    was renamed during the rebrand)
  - Adds --tag <name> flag for custom dist-tag publishes

  Full build and types build pass.
2026-04-20 14:50:03 -07:00
Artem Ash 0bd2fffaed updated readme 2026-04-20 14:18:03 -07:00
Artem Ash 317cea47e4 admin: align docs site with upstream structure
Applies the rebrand rename pass to code/gui.hanzo.ai and moves
  its config layout to match upstream's docs site.

  - Rename @hanzo/gui → hanzogui, Gui* → Hanzogui*,
    gui.config/gui.build/gui-prompt → hanzogui.* across the site
  - Move hanzogui.config.ts to site root (was in config/)
  - package.json build script: gui → hanzogui (CLI bin name)
  - Remove stale gui.generated.css duplicate and TWO_NAMESPACES.md
    (documented the old namespace split that's now unified)

  Full build and types build pass. Missing-config warning is gone.
2026-04-20 14:13:45 -07:00
Artem Ash 3f033b9f48 sync hanzogui tree to upstream tamagui 2.0.0-rc.41
Replaces the hanzoai/gui code tree with upstream tamagui main
  (2.0.0-rc.41-1776626066745) after running a mechanical rename
  codemod. Fixes the long-standing split where engine packages
  (@hanzogui/* at v4.4.0) had drifted in shape from the component
  packages (at v3.0.2), producing type errors like "Property
  'children' does not exist on SliderImplProps".

  Renames applied uniformly across the tree:

  - @tamagui/*           → @hanzogui/*
  - @tamagui/helpers-tamagui → @hanzogui/component-helpers
  - tamagui (umbrella)   → hanzogui (unscoped, was @hanzo/gui; clean
                           break — no shim)
  - Tamagui*             → Hanzogui* (identifiers + filenames)
  - TAMAGUI_HEADLESS     → HANZOGUI_HEADLESS
  - tamagui.dev          → hanzogui.dev
  - github.com/tamagui/tamagui → github.com/hanzoai/gui
  - tamagui-build        → hanzogui-build (CLI)
  - tamagui-loader       → hanzogui-loader (stays unscoped, matches
                           upstream)

  Preserved 4 hanzoai-only packages:
  - code/packages/gui-dev-config (@hanzogui/dev-config)
  - code/core/font-geist-mono
  - code/core/font-geist-sans
  - code/gui.hanzo.ai (@hanzogui/site)

  Upstream-sourced substitutions:
  - code/tests/next-webpack: replaced hanzoai's stubbed-out
    @hanzogui/next-webpack-test with upstream's live
    next15-plus-cli-optimize.

  Dropped from the sync:
  - upstream code/tamagui.dev (docs site) — hanzoai has its own
    site at code/gui.hanzo.ai, which was preserved.

  Build: `bun run build` succeeds across all 165 workspace tasks.

  Follow-ups (not in this commit):
  - Consumer migration: @hanzo/gui → hanzogui, Gui* → Hanzogui*
  - Publish strategy: hanzogui@2.0.0-rc.41-hanzoai.1 and
    @hanzogui/*@2.0.0-rc.41-hanzoai.1 on the `next` npm dist-tag,
    leave `latest` pointing at current v4.x until consumers
    migrate.
  - @hanzogui/site emits a bundling warning; not blocking.
2026-04-20 11:08:46 -07:00
12089 changed files with 1937108 additions and 76983 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ node_modules
**/*/node_modules
**/*/dist
**/*/.turbo
**/*/.tamagui
**/*/.gui
# expo
**/*/.expo
+25
View File
@@ -0,0 +1,25 @@
name: Build image
# Builds + pushes ghcr.io/hanzoai/gui (the gui.hanzo.ai site, served on
# :3000 by the repo's existing Dockerfile) on a v* semver tag via the
# canonical reusable workflow, natively on the self-hosted arcd fleet
# (NO GitHub-hosted runners). Semver-only tags. Deployable on DOKS.
#
# This is the CONTAINER-image path. The repo's publish-gui*.yml workflows
# publish the npm library packages and are unaffected.
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
packages: write
id-token: write
jobs:
docker:
uses: hanzoai/.github/.github/workflows/docker-build.yml@main
with:
image: ghcr.io/hanzoai/gui
secrets: inherit
+1 -1
View File
@@ -8,7 +8,7 @@ on:
jobs:
tagged-release:
name: Changelog
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
# needs: release
steps:
+4 -4
View File
@@ -19,7 +19,7 @@ concurrency:
jobs:
checks:
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
steps:
- name: Checkout
uses: actions/checkout@v5
@@ -37,7 +37,7 @@ jobs:
run: bun run lint
unit-tests:
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
env:
NODE_OPTIONS: '--max-old-space-size=6144'
steps:
@@ -66,7 +66,7 @@ jobs:
run: bun turbo run test:web --filter='!@hanzogui/kitchen-sink' --concurrency=1
changes:
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
outputs:
integration-relevant: ${{ steps.filter.outputs.integration-relevant }}
steps:
@@ -90,7 +90,7 @@ jobs:
integration-tests:
needs: changes
if: needs.changes.outputs.integration-relevant == 'true'
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
strategy:
fail-fast: false
matrix:
+108
View File
@@ -0,0 +1,108 @@
name: Publish gui (all packages)
# Publishes the FULL gui surface — every @hanzogui/* primitive AND the
# `hanzogui` + `@hanzo/gui` umbrellas — at the current on-disk version
# (7.x), with freshly built `dist/`. This is the fix for the broken
# 7.0.0 publish, where the primitives shipped without `dist/` and
# `@hanzo/gui` therefore failed to resolve for standalone consumers.
#
# `publish-gui.yml` only ships the umbrella; this ships the primitives it
# depends on so a clean `npm i @hanzo/gui` works end-to-end.
#
# Trigger: manual (workflow_dispatch, type "publish" to confirm) or by
# pushing a `release/gui-all-v*` tag.
#
# NPM_TOKEN resolution mirrors publish-gui.yml:
# 1. KMS via Universal Auth (KMS_CLIENT_ID/SECRET → short-lived token)
# 2. KMS via long-lived HANZO_API_KEY (legacy bootstrap)
# 3. Direct repo secret NPM_TOKEN (fallback)
on:
workflow_dispatch:
inputs:
confirm:
description: 'Type "publish" to publish ALL gui packages at the current version'
required: true
default: ''
push:
tags:
- 'release/gui-all-v*'
permissions:
contents: read
id-token: write
jobs:
publish-all:
name: Build + publish all gui packages
runs-on: [self-hosted, linux, arm64]
if: github.event_name == 'push' || github.event.inputs.confirm == 'publish'
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install
uses: ./.github/actions/install
- name: Build all packages
# Fresh checkout has no dist; --republish skips release.ts's own
# build, so build here explicitly. `npm pack` (inside release.ts)
# will fail loudly if any dist tree is missing.
run: bun run build
- name: Resolve NPM_TOKEN (KMS → fallback to repo secret)
id: token
env:
DIRECT_NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
KMS_CLIENT_ID: ${{ secrets.KMS_CLIENT_ID }}
KMS_CLIENT_SECRET: ${{ secrets.KMS_CLIENT_SECRET }}
HANZO_API_KEY: ${{ secrets.HANZO_API_KEY }}
KMS_ENDPOINT: ${{ vars.KMS_ENDPOINT || 'https://kms.hanzo.ai' }}
KMS_WORKSPACE_ID: ${{ vars.KMS_WORKSPACE_ID_GUI || 'e1359bf4-31b4-4dfa-bb90-323e2c298ad8' }}
run: |
set -eu
npm_token=""
if [ -n "${KMS_CLIENT_ID:-}" ] && [ -n "${KMS_CLIENT_SECRET:-}" ]; then
HANZO_API_KEY=$(curl -sf "${KMS_ENDPOINT}/api/v1/auth/universal-auth/login" \
-H "Content-Type: application/json" \
-d "{\"clientId\":\"${KMS_CLIENT_ID}\",\"clientSecret\":\"${KMS_CLIENT_SECRET}\"}" \
| jq -r '.accessToken') || true
fi
if [ -n "${HANZO_API_KEY:-}" ]; then
response=$(curl -sf \
"${KMS_ENDPOINT}/api/v3/secrets/raw?workspaceId=${KMS_WORKSPACE_ID}&secretPath=/publish&environment=prod" \
-H "Authorization: Bearer ${HANZO_API_KEY}" 2>/dev/null) || true
if [ -n "${response:-}" ]; then
npm_token=$(echo "$response" | jq -r '.secrets[] | select(.secretKey=="NPM_TOKEN") | .secretValue // empty')
fi
fi
if [ -z "$npm_token" ]; then
npm_token="${DIRECT_NPM_TOKEN:-}"
if [ -n "$npm_token" ]; then
echo "Using NPM_TOKEN from repo secret (KMS path unavailable)."
fi
fi
if [ -z "$npm_token" ]; then
echo "::error::No NPM_TOKEN available — need KMS_CLIENT_ID/SECRET, HANZO_API_KEY, or NPM_TOKEN repo secret."
exit 1
fi
echo "::add-mask::${npm_token}"
echo "npm_token=${npm_token}" >> "$GITHUB_OUTPUT"
- name: Configure npm registry
env:
NPM_TOKEN: ${{ steps.token.outputs.npm_token }}
run: |
echo 'registry=https://registry.npmjs.org/' > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
- name: Publish gui surface (primitives + umbrella + @hanzo/gui alias)
# Targeted publish of just the @hanzogui/* closure + hanzogui +
# @hanzo/gui, at the current on-disk version. Avoids release.ts's
# whole-workspace fan-out (which fails packing unrelated
# @hanzo_network/* packages) and its fragile tarball-rename step.
# Idempotent — skips any name@version already on npm.
env:
NPM_TOKEN: ${{ steps.token.outputs.npm_token }}
NODE_AUTH_TOKEN: ${{ steps.token.outputs.npm_token }}
run: node ./scripts/publish-gui-surface.mjs
+247
View File
@@ -0,0 +1,247 @@
name: Publish gui
# Triggered only on `release/gui-v*` tags. Bumping a workspace
# version alone does NOT publish — a tag push gates the run so an
# accidental version bump on `main` cannot ship to npm. Tag scheme:
# release/gui-v7.1.0 → gui@7.1.0
#
# Note: @hanzogui/admin moved to hanzoai/admin and publishes from there.
#
# NPM_TOKEN resolution order:
# 1. KMS via Universal Auth (KMS_CLIENT_ID/SECRET → short-lived token)
# 2. KMS via long-lived HANZO_API_KEY (legacy bootstrap)
# 3. Direct repo secret NPM_TOKEN (fallback until KMS is provisioned)
# Same shape as `~/work/hanzo/login/.github/workflows/deploy.yml`.
#
# Smoke test: after pack, install the .tgz tarball into a throwaway
# /tmp consumer and require() it. If the static extractor or vite
# build chokes on an import shape, this catches it before publish.
on:
push:
tags:
- 'release/gui-v*'
permissions:
contents: read
id-token: write
jobs:
publish:
name: Build, smoke-test, publish
runs-on: [self-hosted, linux, arm64]
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install
uses: ./.github/actions/install
- name: Resolve NPM_TOKEN (KMS → fallback to repo secret)
id: token
env:
DIRECT_NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
KMS_CLIENT_ID: ${{ secrets.KMS_CLIENT_ID }}
KMS_CLIENT_SECRET: ${{ secrets.KMS_CLIENT_SECRET }}
HANZO_API_KEY: ${{ secrets.HANZO_API_KEY }}
KMS_ENDPOINT: ${{ vars.KMS_ENDPOINT || 'https://kms.hanzo.ai' }}
KMS_WORKSPACE_ID: ${{ vars.KMS_WORKSPACE_ID_GUI || 'e1359bf4-31b4-4dfa-bb90-323e2c298ad8' }}
run: |
set -eu
# Preferred (when configured): pull NPM_TOKEN from KMS at runtime
# via Universal Auth (KMS_CLIENT_ID/SECRET) or legacy HANZO_API_KEY.
# Fallback: direct repo-secret NPM_TOKEN. The fallback keeps the
# publish path unblocked while KMS provisioning catches up.
npm_token=""
if [ -n "${KMS_CLIENT_ID:-}" ] && [ -n "${KMS_CLIENT_SECRET:-}" ]; then
HANZO_API_KEY=$(curl -sf "${KMS_ENDPOINT}/api/v1/auth/universal-auth/login" \
-H "Content-Type: application/json" \
-d "{\"clientId\":\"${KMS_CLIENT_ID}\",\"clientSecret\":\"${KMS_CLIENT_SECRET}\"}" \
| jq -r '.accessToken') || true
fi
if [ -n "${HANZO_API_KEY:-}" ]; then
response=$(curl -sf \
"${KMS_ENDPOINT}/api/v3/secrets/raw?workspaceId=${KMS_WORKSPACE_ID}&secretPath=/publish&environment=prod" \
-H "Authorization: Bearer ${HANZO_API_KEY}" 2>/dev/null) || true
if [ -n "${response:-}" ]; then
npm_token=$(echo "$response" | jq -r '.secrets[] | select(.secretKey=="NPM_TOKEN") | .secretValue // empty')
fi
fi
if [ -z "$npm_token" ]; then
npm_token="${DIRECT_NPM_TOKEN:-}"
if [ -n "$npm_token" ]; then
echo "Using NPM_TOKEN from repo secret (KMS path unavailable)."
fi
fi
if [ -z "$npm_token" ]; then
echo "::error::No NPM_TOKEN available — need either KMS_CLIENT_ID/SECRET, HANZO_API_KEY, or NPM_TOKEN repo secret."
exit 1
fi
echo "::add-mask::${npm_token}"
echo "npm_token=${npm_token}" >> "$GITHUB_OUTPUT"
- name: Configure npm registry
env:
NPM_TOKEN: ${{ steps.token.outputs.npm_token }}
run: |
echo 'registry=https://registry.npmjs.org/' > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
- name: Build (postinstall already built js with SKIP_TYPES=1)
# The install step ran `bun install` which fires postinstall
# → `bun run build:js` (SKIP_TYPES=1 turbo run build --force).
# That covers the publish target and every workspace consumer,
# so a separate filtered build here would be a no-op rebuild.
# Verifying the dist tree exists is enough — pack will fail
# loudly if it doesn't.
run: |
test -d pkgs/ui/hanzogui/dist || (echo "::error::gui/dist missing"; exit 1)
- name: Build workspace version map
# Map every workspace package name to its on-disk version so we can
# resolve `workspace:*` deps to the actual version each subpackage is
# at. The umbrella is on the 7.x track but the @hanzogui/* primitives
# are still on the 102.x canary stream — they are NOT republished
# here, only referenced.
id: ws-versions
run: |
set -eu
node -e "
const fs=require('fs'); const path=require('path');
const map={};
const dirs=['pkgs/ui','pkgs/core','pkgs/compiler','pkgs'];
const collect=(d)=>{
if (!fs.existsSync(d)) return;
const stat=fs.statSync(d);
if (stat.isFile() && d.endsWith('package.json')) {
try { const j=JSON.parse(fs.readFileSync(d)); if (j.name && j.version) map[j.name]=j.version; } catch{}
return;
}
if (!stat.isDirectory()) return;
const pkg=path.join(d,'package.json');
if (fs.existsSync(pkg)) collect(pkg);
for (const e of fs.readdirSync(d)) {
if (e==='node_modules') continue;
collect(path.join(d,e));
}
};
for (const d of dirs) collect(d);
fs.writeFileSync('/tmp/ws-versions.json', JSON.stringify(map));
console.log('mapped', Object.keys(map).length, 'workspace packages');
"
- name: Pack gui
# `npm pack` does NOT resolve `workspace:*` specifiers; the resulting
# tarball would ship literal `workspace:*` and break consumers. We
# mirror what `scripts/release.ts` does — copy to a temp dir, rewrite
# every `workspace:*` to the matching package's on-disk version (from
# the workspace map built above), then pack.
id: pack-gui
run: |
set -eu
tmpdir=$(mktemp -d)
cp -R pkgs/ui/hanzogui/. "$tmpdir/"
rm -rf "$tmpdir/node_modules"
node -e "
const fs=require('fs');
const map=JSON.parse(fs.readFileSync('/tmp/ws-versions.json'));
const p='$tmpdir/package.json';
const j=JSON.parse(fs.readFileSync(p));
const ownVer=j.version;
for (const f of ['dependencies','devDependencies','peerDependencies','optionalDependencies']) {
if (!j[f]) continue;
for (const k of Object.keys(j[f])) {
if (j[f][k].startsWith('workspace:')) {
const v=map[k]; if (!v) { console.error('no version for',k); process.exit(1); }
j[f][k]=v;
}
}
}
fs.writeFileSync(p, JSON.stringify(j, null, 2)+'\n');
"
cd "$tmpdir"
tgz=$(npm pack --silent | tail -1)
echo "tgz=$tmpdir/${tgz}" >> "$GITHUB_OUTPUT"
echo "tmpdir=$tmpdir" >> "$GITHUB_OUTPUT"
- name: Smoke-test packed tarball (metadata-only)
env:
GUI_TGZ: ${{ steps.pack-gui.outputs.tgz }}
run: |
set -eu
# Metadata-only smoke: extract package.json + key dist files from
# the tarball without npm-installing it. Full consumer install
# would chicken-egg on first release (hanzogui's @hanzogui/*
# workspace deps aren't on npm yet at the new version), so this
# checks the tarball SHAPE — name, exports map resolvability,
# required dist files present — without resolving the dep tree.
inspect=$(mktemp -d)
tar -xzf "${GUI_TGZ}" -C "$inspect"
cd "$inspect/package"
# Name must be exactly 'hanzogui' (the static extractor scans
# for this literal token; never call this package 'Gui').
test "$(node -p "require('./package.json').name")" = "hanzogui"
# All workspace:* specs must be rewritten by the pack step
# (literal 'workspace:' in the published tarball would break
# consumer installs with EUNSUPPORTEDPROTOCOL).
! grep -q '"workspace:' package.json
# Every dist file referenced from exports must actually exist
# in the tarball — catches broken exports maps + missing files.
node -e "
const fs = require('fs');
const pkg = require('./package.json');
const walk = (v) => {
if (typeof v === 'string') {
if (v.startsWith('./')) {
if (!fs.existsSync(v)) { console.error('missing:', v); process.exitCode = 1; }
}
} else if (v && typeof v === 'object') {
for (const k of Object.keys(v)) walk(v[k]);
}
};
walk(pkg.exports || {});
walk(pkg.main); walk(pkg.module); walk(pkg.types);
"
echo "smoke OK: $(jq -r '.name + \"@\" + .version' package.json)"
- name: Publish gui
env:
NPM_TOKEN: ${{ steps.token.outputs.npm_token }}
NODE_AUTH_TOKEN: ${{ steps.token.outputs.npm_token }}
TGZ: ${{ steps.pack-gui.outputs.tgz }}
working-directory: pkgs/ui/hanzogui
run: |
version=$(node -p "require('./package.json').version")
if npm view "hanzogui@${version}" version >/dev/null 2>&1; then
echo "hanzogui@${version} already on npm — skipping."
exit 0
fi
npm publish "${TGZ}" --access public --tag stable
- name: Pack + Publish @hanzo/gui (alias of gui)
# Republish the umbrella tarball under the @hanzo/gui scoped name so
# downstream consumers can import either alias. Same dist tree as
# gui — only `name` differs. The static extractor scans for the
# literal 'gui' import token, so this alias is purely a consumer
# ergonomics shim and never participates in extractor input. We reuse
# the prepared tmpdir from the gui pack step (workspace specs
# already rewritten) and only mutate `name`.
env:
NPM_TOKEN: ${{ steps.token.outputs.npm_token }}
NODE_AUTH_TOKEN: ${{ steps.token.outputs.npm_token }}
TMPDIR_GUI: ${{ steps.pack-gui.outputs.tmpdir }}
run: |
set -eu
aliasdir=$(mktemp -d)
cp -R "$TMPDIR_GUI"/. "$aliasdir/"
cd "$aliasdir"
jq '.name = "@hanzo/gui"' package.json > package.json.new
mv package.json.new package.json
version=$(node -p "require('./package.json').version")
if npm view "@hanzo/gui@${version}" version >/dev/null 2>&1; then
echo "@hanzo/gui@${version} already on npm — skipping."
exit 0
fi
tgz=$(npm pack --silent | tail -1)
npm publish "${tgz}" --access public --tag stable
-47
View File
@@ -1,47 +0,0 @@
name: Publish on Tag
on:
push:
tags:
- 'v*'
jobs:
publish:
name: Build + Publish to NPM
runs-on: hanzo-build-linux-amd64
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install
uses: ./.github/actions/install
- name: Build
run: bun run build
- name: Configure npm
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- name: Publish @hanzo/gui
working-directory: code/ui/gui
run: |
VERSION=$(node -p "require('./package.json').version")
echo "Publishing @hanzo/gui@$VERSION"
if npm view "@hanzo/gui@$VERSION" version 2>/dev/null; then
echo "Already published — skipping"
else
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+2 -2
View File
@@ -10,7 +10,7 @@ on:
jobs:
release:
name: Release
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
steps:
- name: Checkout Repo
uses: actions/checkout@v5
@@ -36,7 +36,7 @@ jobs:
tagged-release:
name: Tagged Release
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
# needs: release
steps:
+2 -2
View File
@@ -179,7 +179,7 @@ jobs:
name: Build Android App
# Only run on main/v* branches (not PRs)
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v') || github.ref == 'refs/heads/rn82'
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
timeout-minutes: 45
outputs:
android-cache-key: ${{ steps.final-cache-key.outputs.cache_key }}
@@ -446,7 +446,7 @@ jobs:
needs: build-android
# Only run on main/v* branches (not PRs)
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v') || github.ref == 'refs/heads/rn82'
runs-on: hanzo-build-linux-amd64
runs-on: [self-hosted, linux, amd64]
timeout-minutes: 45
# Android emulator in CI is flaky with window focus issues - don't block on failures
continue-on-error: true
+3 -1
View File
@@ -1,5 +1,6 @@
**/test-results/*
**/.maestro-debug
**/.gui/
# keep types in repo to track them
# **/types/**/*.d.ts
@@ -33,7 +34,7 @@ node_modules
code/kitchen-sink/ios
.tamagui
.gui
.idea
@@ -58,3 +59,4 @@ code/studio/types/**
test-results/
.gui/
# Wed Mar 25 04:08:49 PDT 2026
*.tgz
+1
View File
@@ -1 +1,2 @@
code/tests/next-turbopack/src/TestComponent.tsx
**/.gui/
+1 -1
View File
@@ -21,7 +21,7 @@
"**/*.lock",
"**/*.generated.*",
"**/generated-*",
"**/.tamagui/**",
"**/.gui/**",
"**/node_modules/**",
],
}
Symlink
+1
View File
@@ -0,0 +1 @@
LLM.md
+5 -5
View File
@@ -64,7 +64,7 @@ You can run `bun run sandbox` or `bun run dev` (the Hanzo GUI website).
Install browser binaries before first run:
```bash
cd code/kitchen-sink
cd apps/kitchen-sink
bun run test:web:setup # installs chromium
bun run start:web # start dev server (background)
bun run test:web # run all web tests
@@ -86,7 +86,7 @@ The `run-detox.sh` script will automatically:
- Build the app if the binary is missing or outdated
```bash
cd code/kitchen-sink
cd apps/kitchen-sink
bun run detox:run:ios # run all iOS tests
bun run detox:run:ios "Sheet" # filter by test name
DETOX_DEVICE="iPhone 16 Pro" bun run detox:run:ios # override simulator device
@@ -100,11 +100,11 @@ npx detox clean-framework-cache && npx detox build-framework-cache
### Fixing libraries
All compiler and CSS generation tests live in `code/compiler/static-tests`.
All compiler and CSS generation tests live in `pkgs/compiler/static-tests`.
There are many native tests in `code/kitchen-sink/tests`.
There are many native tests in `apps/kitchen-sink/tests`.
A variety of core tests live in `code/core/core-test`.
A variety of core tests live in `pkgs/core/core-test`.
Before submitting a PR, please check everything works across every combination of environments.
+7 -7
View File
@@ -1,5 +1,5 @@
# local build dockerfile - uses bento from ../bento
# build from PARENT directory: docker build -f tamagui5/Dockerfile.local -t tamagui-site .
# build from PARENT directory: docker build -f gui5/Dockerfile.local -t gui-site .
FROM node:22
# install bun
@@ -17,10 +17,10 @@ ARG GITHUB_APP_CLIENT_ID
ARG GITHUB_APP_SECRET
ARG GITHUB_SPONSOR_WEBHOOK_SECRET
ARG GITHUB_TOKEN
ARG IS_TAMAGUI_DEV
ARG IS_GUI_DEV
ARG NEXT_PUBLIC_GITHUB_APP_ID
ARG NEXT_PUBLIC_GITHUB_AUTH_CLIENT_ID
ARG NEXT_PUBLIC_IS_TAMAGUI_DEV
ARG NEXT_PUBLIC_IS_GUI_DEV
ARG NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
ARG NEXT_PUBLIC_SUPABASE_ANON_KEY
ARG NEXT_PUBLIC_SUPABASE_URL
@@ -36,7 +36,7 @@ ARG TAKEOUT_RENEWAL_COUPON_ID
ARG URL
ARG ONE_SERVER_URL
ARG APP_NAME
ARG TAMAGUI_PRO_SECRET
ARG GUI_PRO_SECRET
ARG DEEPSEEK_API_KEY
# install dependencies (sharp needs libvips for image processing)
@@ -46,14 +46,14 @@ WORKDIR /root
# copy both repos
COPY bento /root/bento
COPY tamagui5 /root/tamagui
COPY gui5 /root/gui
WORKDIR /root/tamagui
WORKDIR /root/gui
# init git (allow empty commit if nothing to commit)
RUN git config --global user.email "you@example.com" && git config --global user.name "Docker Build" && git init . && git add -A && (git commit -m 'add' > /dev/null || true)
# install tamagui deps first
# install gui deps first
RUN bun install
# setup bento - merge deps and symlink node_modules
+38 -22
View File
@@ -1,26 +1,42 @@
MIT License
BSD 3-Clause License
Copyright (c) 2020 Nate Wienert
Copyright (c) 2015-present, Nicolas Gallagher.
Copyright (c) 2015-present, Facebook, Inc.
Copyright (c) 2021 Radix
Copyright (c) 2017 Carmelo Pullara
Copyright (c) 2018 Framer B.V.
Copyright (c) 2026-present, Hanzo AI, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Portions of this software are derived from upstream code originally licensed under
the MIT License, with the following copyright notices retained per its terms:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Copyright (c) 2020 Nate Wienert
Copyright (c) 2015-present, Nicolas Gallagher.
Copyright (c) 2015-present, Facebook, Inc.
Copyright (c) 2021 Radix
Copyright (c) 2017 Carmelo Pullara
Copyright (c) 2018 Framer B.V.
Copyright (c) 2022 WorkOS
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+129
View File
@@ -1,3 +1,132 @@
Please read ./CONTRIBUTING.md as well
Note you need to re-build packages (`bun run build` in the package directory) as you change them, unless you or someone is running a `bun run watch` at root.
FOR LONG RUNNNING DEBUGGING run `bun run watch` in the background its faster and rebuilds all packages.
keep commits to one line, add a trailing "Fixes #" if associated with a GH issue, and start with a convential commit style - UNLESS its a change that shouldn't go into the changelog, in those cases you can do things like `docs: ` or `site: `.
# Hanzo GUI Testing Guide
## Running Tests
### Kitchen Sink Tests
The kitchen-sink package contains the main integration tests for Hanzo GUI components. To run these tests:
1. **Start the web server** (in the background):
```bash
cd apps/kitchen-sink
bun run start:web
```
To open a specific test case in the browser:
```bash
open "http://localhost:9000/?test=YourTestCaseName"
```
Test case names match the file names in `apps/kitchen-sink/src/usecases/` (e.g., `SelectFocusScopeCase`).
To open a component demo:
```bash
open "http://localhost:9000/?demo=Select"
```
Demo names match files in `apps/demos/src/` without the `Demo` suffix (e.g., `Select` for `SelectDemo.tsx`).
2. **Run all web tests** with different animation drivers:
```bash
bun run test:web
```
This uses `run-tests-parallel.ts` which first runs `default` + `webkit` projects sequentially, then runs all four animated driver projects (`css`, `native`, `reanimated`, `motion`) in parallel against a single shared dev server.
3. **Run tests with a specific animation driver**:
```bash
# Using env var + playwright --project flag
cd apps/kitchen-sink
NODE_ENV=test HANZO_GUI_TEST_ANIMATION_DRIVER=css npx playwright test --project=animated-css
# Available projects: animated-css, animated-native, animated-reanimated, animated-motion
```
4. **Run a specific test file**:
```bash
# Using playwright directly
cd apps/kitchen-sink
npx playwright test tests/PopoverFocusScope.test.tsx
# Or with a specific driver
NODE_ENV=test HANZO_GUI_TEST_ANIMATION_DRIVER=css npx playwright test tests/YourTest.animated.test.tsx --project=animated-css
```
5. **Debug tests**:
```bash
bun run test:web:debug
# or
npx playwright test --debug
```
### Test Structure
Tests are located in `apps/kitchen-sink/tests/` and follow these naming conventions:
- `ComponentName.test.tsx` - Standard tests that run ONCE with the default animation driver
- `ComponentName.animated.test.tsx` - Animation-dependent tests that run with ALL animation drivers (css, native, reanimated, motion)
This separation significantly speeds up the test suite since most tests don't need to run 4x across all animation drivers. Only use `.animated.test.tsx` for tests that specifically verify animation behavior across different drivers.
### Writing Tests
When writing tests for focus behavior or component interactions:
1. Use appropriate wait times for animations and focus changes
2. Be aware that `trapFocus` behavior depends on the component's open state
3. Test both trapped and non-trapped focus scenarios
4. Consider browser focus behavior when `trapFocus` is false
### Common Issues
- If tests fail due to timing, add appropriate `waitForTimeout` calls
- For focus tests, ensure elements are visible before testing focus state
- When testing popover/dialog components, wait for animations to complete
## Commit Message Conventions
- Use `site:` prefix (not `fix(site):`) for gui.hanzo.ai changes since they don't go in the changelog
- Use `ci:` prefix (not `fix(ci):`) for CI/workflow changes since they don't go in the changelog
- Keep commit messages to a single line
## iOS Development
See [docs/using-ios.md](./docs/using-ios.md) for iOS native development and Detox testing tips.
## gui.hanzo.ai API Authentication
When making authenticated API calls from the client side in gui.hanzo.ai, always use the `authFetch` helper:
```ts
import { authFetch } from '~/features/api/authFetch'
const response = await authFetch('/api/some-endpoint', {
method: 'POST',
body: JSON.stringify({ ... }),
})
```
**Why this matters:** Cookies alone are not reliable for auth in production due to cross-origin/SameSite issues. The `authFetch` helper automatically includes the Authorization header with the user's access token. All payment/subscription endpoints require this.
---
## Additional notes (merged from LLM.md)
# gui — AI Assistant Context
# Hanzo GUI
+4 -4
View File
@@ -19,8 +19,8 @@
<br />
- `@hanzogui/web` - Universal style library for React.
- `@hanzo/gui` - UI kit that adapts to every platform.
- `@hanzogui/static` - Optimizing compiler that works with `gui-web` and `gui`.
- `gui` - UI kit that adapts to every platform.
- `@hanzogui/static` - Optimizing compiler that works with `@hanzogui/web` and `gui`.
<br />
@@ -32,9 +32,9 @@ It does this with an optimizing compiler that outputs platform-specific optimiza
The entirety of Hanzo GUI works at compile time and runtime, and can be set up gradually, with initial usage as simple as importing it and using the base views and styled function.
We recommend checking out the starters with `npm create hanzo-gui@latest`, they range from a simple learning example to a production-ready monorepo.
We recommend checking out the starters with `npm create gui@latest`, they range from a simple learning example to a production-ready monorepo.
The compiler optimizes most and ultimately flattens a majority of styled components. In the [~500px² responsive browser section](https://gui.hanzo.ai) of the Hanzo GUI website, 49 of the 55 or so [inline styled components](https://github.com/hanzoai/gui/blob/main/code/gui.hanzo.ai/components/HeroResponsive.tsx) are flattened to a `div`. The homepage gains nearly 15% on Lighthouse with the compiler on.
The compiler optimizes most styled components by flattening them to plain `div`s (web) or `View`s (native) at build time. Real-world apps see double-digit Lighthouse improvements.
[Learn more on the website](https://gui.hanzo.ai/docs/intro/introduction).
-137
View File
@@ -1,137 +0,0 @@
# The Two-Namespace Problem: `@hanzo/gui` vs `@hanzogui/*`
## Summary
This repo publishes **127 npm packages** under two namespaces:
- **`@hanzo/gui`** (1 package, v4.0.0) — a barrel that re-exports everything
- **`@hanzogui/*`** (126 packages, v3.0.x) — where all the actual code lives
`@hanzo/gui` contains zero implementation. Its `src/index.ts` is entirely:
```ts
export * from '@hanzogui/core'
export * from '@hanzogui/stacks'
export * from '@hanzogui/button'
// ... 50+ more re-exports
```
This design causes serious, reproducible problems for downstream consumers. This document explains the issues, why they happen, and proposes a consolidation plan.
---
## Problems
### 1. pnpm duplicate copies
pnpm uses strict dependency isolation. When a consumer depends on both `@hanzo/gui` (which transitively pulls in `@hanzogui/core@3.0.6`) and `@hanzogui/button@3.0.2` (which also depends on `@hanzogui/core@3.0.6`), pnpm may resolve two physically separate copies of `@hanzogui/core`.
This breaks any library that relies on module identity — which includes the entire Tamagui/GUI styling system. `styled()` called with a component from copy A fails when the style engine is initialized in copy B.
**Symptoms:**
- `TypeError: Cannot read properties of undefined (reading 'staticConfig')`
- `TypeError: Cannot read properties of undefined (reading 'View')`
### 2. Rollup/Vite circular initialization failures
When Rollup bundles `@hanzo/gui`, it inlines all 50+ `export * from '@hanzogui/*'` re-exports into a single module. The `@hanzogui/*` packages have circular dependencies among themselves (e.g., `@hanzogui/button``@hanzogui/core``@hanzogui/web``@hanzogui/core`). Rollup resolves these into a single flat scope, but JavaScript execution order means some bindings are `undefined` at the time `styled()` is called.
**Symptoms:**
- `styled(Stack, {...})` receives `undefined` instead of the `Stack` component
- Only happens in production builds (dev mode serves modules individually)
- Downstream consumers must add custom Vite plugins to work around this
### 3. Downstream consumers need resolution hacks
Every consumer using pnpm + Vite must add a custom plugin to force `@hanzogui/*` imports to resolve from `@hanzo/gui`'s own `node_modules`:
```ts
// Required in every downstream vite.config.ts
{
name: 'resolve-hanzogui',
enforce: 'pre',
resolveId(source) {
if (source.startsWith('@hanzogui/')) {
return require_.resolve(source, { paths: [guiDir] })
}
},
}
```
This is fragile, poorly documented, and needs to be copied into every project that uses `@hanzo/gui`.
### 4. Version drift between packages
Core packages are at 3.0.6, component packages are at 3.0.23.0.3. This means `@hanzogui/button@3.0.2` may depend on `@hanzogui/core@3.0.2` while the barrel pulls in `@hanzogui/core@3.0.6`. Even minor version mismatches can cause duplicate copies.
### 5. Publishing overhead
127 separate npm publishes per release. Version coordination across all packages. Any missed package creates a broken dependency graph.
---
## Root cause
The two-namespace design was intended for **tree-shaking on React Native**: importing `@hanzogui/button` avoids pulling in `@hanzogui/dialog`, `@hanzogui/sheet`, etc.
However:
- Modern bundlers (Vite, Rollup, esbuild) tree-shake **named exports** from a single package just as effectively
- The tree-shaking benefit is marginal compared to the cost of 126 separate packages
- The barrel `@hanzo/gui` already defeats the purpose — most consumers use it, pulling in everything anyway
---
## Proposal: Consolidate into `@hanzo/gui`
### What changes
1. **Move all source** from `@hanzogui/*` into `@hanzo/gui` as internal directories
2. **Single entry point**: `@hanzo/gui` exports everything (already does via barrel)
3. **Subpath exports** for config/build-time packages not in the main barrel:
- `@hanzo/gui/theme-builder` (was `@hanzogui/theme-builder`)
- `@hanzo/gui/config-default` (was `@hanzogui/config-default`)
- `@hanzo/gui/shorthands` (was `@hanzogui/shorthands`)
4. **Single build output**: ESM + CJS + types
5. **Deprecate `@hanzogui/*`** on npm, pointing to `@hanzo/gui`
### What stays the same
- Internal directory structure (`core/`, `button/`, `input/`, etc.) for code organization
- Public API surface — `import { Button, Input, styled } from '@hanzo/gui'`
- Support for React Native via `.native.tsx` file extensions
### Migration for consumers
| Before | After | Breaking? |
|--------|-------|-----------|
| `import { Button } from '@hanzo/gui'` | Same | No |
| `import { Button } from '@hanzogui/button'` | `import { Button } from '@hanzo/gui'` | Yes (deprecate) |
| `import { createThemes } from '@hanzogui/theme-builder'` | `import { createThemes } from '@hanzo/gui/theme-builder'` | Yes (subpath) |
### What this fixes
- **Zero duplicate copies** — one package, one resolution
- **Zero circular init failures** — bundler sees one module graph, controls init order
- **Zero downstream hacks** — no resolve plugins needed
- **One npm publish** per release
- **One version number** to track
### Implementation steps
1. Create `@hanzo/gui@5.0.0` with all source inlined
2. Add `exports` field in `package.json` with subpath entries for config packages
3. Verify tree-shaking works with Vite, Rollup, and Metro (React Native)
4. Publish and deprecate all 126 `@hanzogui/*` packages on npm
5. Provide codemod for `@hanzogui/* → @hanzo/gui` import rewrites
---
## Current workaround (for downstream consumers)
Until consolidation happens, consumers must:
1. **Never import from `@hanzogui/*` directly** — always use `@hanzo/gui`
2. **Add a Vite resolve plugin** that forces `@hanzogui/*` to resolve from `@hanzo/gui`'s own `node_modules` (see example above)
3. **Keep `@hanzo/gui` in Module Federation `shared` array** when using micro-frontends
These workarounds are documented here so they don't need to be rediscovered.
+42
View File
@@ -0,0 +1,42 @@
BSD 3-Clause License
Copyright (c) 2026-present, Hanzo AI, Inc.
Portions of this software are derived from upstream code originally licensed under
the MIT License, with the following copyright notices retained per its terms:
Copyright (c) 2020 Nate Wienert
Copyright (c) 2015-present, Nicolas Gallagher.
Copyright (c) 2015-present, Facebook, Inc.
Copyright (c) 2021 Radix
Copyright (c) 2017 Carmelo Pullara
Copyright (c) 2018 Framer B.V.
Copyright (c) 2022 WorkOS
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+4
View File
@@ -0,0 +1,4 @@
{
"config": "./src/gui.config.ts",
"components": ["hanzogui"]
}
+94
View File
@@ -0,0 +1,94 @@
{
"name": "@hanzogui/demos",
"version": "7.3.0",
"source": "demos/src/index.tsx",
"files": [
"src",
"types",
"dist"
],
"type": "module",
"sideEffects": [
"*.css"
],
"main": "dist/cjs",
"module": "dist/esm",
"types": "./src",
"exports": {
"./package.json": "./package.json",
"./photo/*": "./public/*.jpg",
".": {
"types": "./src/index.tsx",
"react-native": "./dist/esm/index.native.js",
"browser": "./dist/esm/index.mjs",
"module": "./dist/esm/index.mjs",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs",
"default": "./dist/esm/index.mjs"
},
"./demo/*": {
"types": "./types/*.d.ts",
"react-native": "./dist/esm/*.native.js",
"browser": "./dist/esm/*.mjs",
"module": "./dist/esm/*.mjs",
"import": "./dist/esm/*.mjs",
"require": "./dist/cjs/*.cjs",
"default": "./dist/esm/*.mjs"
}
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "gui-build --skip-types",
"watch": "gui-build --skip-types --watch",
"clean": "gui-build clean",
"clean:build": "gui-build clean:build"
},
"dependencies": {
"@hanzogui/animate-presence": "workspace:*",
"@hanzogui/avatar": "workspace:*",
"@hanzogui/button": "workspace:*",
"@hanzogui/checkbox": "workspace:*",
"@hanzogui/checkbox-headless": "workspace:*",
"@hanzogui/colors": "workspace:*",
"@hanzogui/config": "workspace:*",
"@hanzogui/context-menu": "workspace:*",
"@hanzogui/core": "workspace:*",
"@hanzogui/get-button-sized": "workspace:*",
"@hanzogui/image": "workspace:*",
"@hanzogui/input": "workspace:*",
"@hanzogui/linear-gradient": "workspace:*",
"@hanzogui/list-item": "workspace:*",
"@hanzogui/logo": "workspace:*",
"@hanzogui/lucide-icons-2": "workspace:*",
"@hanzogui/menu": "workspace:*",
"@hanzogui/popover": "workspace:*",
"@hanzogui/progress": "workspace:*",
"@hanzogui/radio-group": "workspace:*",
"@hanzogui/radio-headless": "workspace:*",
"@hanzogui/roving-focus": "workspace:*",
"@hanzogui/select": "workspace:*",
"@hanzogui/sheet": "workspace:*",
"@hanzogui/slider": "workspace:*",
"@hanzogui/stacks": "workspace:*",
"@hanzogui/switch": "workspace:*",
"@hanzogui/switch-headless": "workspace:*",
"@hanzogui/tabs": "workspace:*",
"@hanzogui/dev-config": "workspace:*",
"@hanzogui/theme": "workspace:*",
"@hanzogui/toast": "workspace:*",
"hanzogui": "workspace:*"
},
"devDependencies": {
"@hanzogui/build": "workspace:*",
"react": ">=19",
"react-native": "0.83.2"
},
"peerDependencies": {
"react": ">=19",
"react-native": "*"
},
"license": "BSD-3-Clause",
"author": "Hanzo AI <dev@hanzo.ai>"
}

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

@@ -1,5 +1,5 @@
import { ChevronDown } from '@hanzogui/lucide-icons-2'
import { Accordion, Paragraph, Square } from '@hanzo/gui'
import { Accordion, Paragraph, Square } from 'hanzogui'
export function AccordionDemo() {
return (
@@ -1,7 +1,7 @@
import { addTheme } from '@hanzogui/theme'
import React from 'react'
import { Button, H3, Theme, View, YStack } from '@hanzo/gui'
import { Button, H3, Theme, View, YStack } from 'hanzogui'
export function AddThemeDemo() {
const [theme, setTheme] = React.useState<any>()
@@ -1,4 +1,4 @@
import { AlertDialog, Button, XStack, YStack } from '@hanzo/gui'
import { AlertDialog, Button, XStack, YStack } from 'hanzogui'
export function AlertDialogDemo() {
return (
@@ -1,5 +1,5 @@
import React from 'react'
import { AnimatePresence, Button, Square, XStack, YStack, isWeb } from '@hanzo/gui'
import { AnimatePresence, Button, Square, XStack, YStack, isWeb } from 'hanzogui'
import { useIsIntersecting } from './useOnIntersecting'
@@ -1,6 +1,6 @@
import { LogoIcon } from '@hanzogui/logo'
import { Play } from '@hanzogui/lucide-icons-2'
import { Button, isWeb, Square, useControllableState, Image, useEvent } from '@hanzo/gui'
import { Button, isWeb, Square, useControllableState, Image, useEvent } from 'hanzogui'
export function AnimationsDemo(props) {
const [positionI, setPositionI] = useControllableState({
@@ -1,7 +1,7 @@
import React from 'react'
import { LogoIcon } from '@hanzogui/logo'
import { Button, Square, YStack, isWeb } from '@hanzo/gui'
import { Button, Square, YStack, isWeb } from 'hanzogui'
import { useIsIntersecting } from './useOnIntersecting'
@@ -1,5 +1,5 @@
import { LogoIcon } from '@hanzogui/logo'
import { Square } from '@hanzo/gui'
import { Square } from 'hanzogui'
export function AnimationsHoverDemo() {
return (
@@ -2,7 +2,7 @@ import React from 'react'
import { AnimatePresence } from '@hanzogui/animate-presence'
import { ArrowLeft, ArrowRight } from '@hanzogui/lucide-icons-2'
import { Button, Image, XStack, YStack, styled } from '@hanzo/gui'
import { Button, Image, XStack, YStack, styled } from 'hanzogui'
// @ts-ignore
import photo1 from '../../public/photo1.jpg'
@@ -1,5 +1,5 @@
import { LogoIcon } from '@hanzogui/logo'
import { Square } from '@hanzo/gui'
import { Square } from 'hanzogui'
export function AnimationsTimingDemo() {
return (
@@ -1,4 +1,4 @@
import { Avatar, XStack } from '@hanzo/gui'
import { Avatar, XStack } from 'hanzogui'
export function AvatarDemo() {
return (
@@ -1,4 +1,4 @@
import { styled, View, Text, YStack } from '@hanzo/gui'
import { styled, View, Text, YStack } from 'hanzogui'
// styled() with boxShadow containing embedded $token
// if web imports are picked up on native, this resolves to var(--shadowColor)
@@ -1,6 +1,6 @@
import { Drumstick, Hand } from '@hanzogui/lucide-icons-2'
import type { ButtonProps, ThemeName } from '@hanzo/gui'
import { Button, XStack, YStack } from '@hanzo/gui'
import type { ButtonProps, ThemeName } from 'hanzogui'
import { Button, XStack, YStack } from 'hanzogui'
const outlined = {
bg: 'transparent',
@@ -1,6 +1,6 @@
import { Button } from '@hanzogui/button'
import { Activity, Airplay } from '@hanzogui/lucide-icons-2'
import { Theme, XGroup, XStack, YStack } from '@hanzo/gui'
import { Theme, XGroup, XStack, YStack } from 'hanzogui'
export function ButtonDemo() {
return (
@@ -1,5 +1,5 @@
import type { CardProps } from '@hanzo/gui'
import { Button, Card, H2, Image, Paragraph, Theme, XStack } from '@hanzo/gui'
import type { CardProps } from 'hanzogui'
import { Button, Card, H2, Image, Paragraph, Theme, XStack } from 'hanzogui'
export function CardDemo() {
return (
@@ -1,6 +1,6 @@
import { Check as CheckIcon } from '@hanzogui/lucide-icons-2'
import type { CheckboxProps } from '@hanzo/gui'
import { Checkbox, Label, Theme, XStack, YStack } from '@hanzo/gui'
import type { CheckboxProps } from 'hanzogui'
import { Checkbox, Label, Theme, XStack, YStack } from 'hanzogui'
export function CheckboxDemo() {
return (
@@ -5,7 +5,7 @@ import { Check, Minus } from '@hanzogui/lucide-icons-2'
import type { View } from 'react-native'
import { Pressable } from 'react-native'
import { Label, XStack, YStack } from '@hanzo/gui'
import { Label, XStack, YStack } from 'hanzogui'
export function CheckboxHeadlessDemo() {
return (
@@ -1,7 +1,7 @@
import { createCheckbox } from '@hanzogui/checkbox'
import { View, styled } from '@hanzogui/core'
import { Check } from '@hanzogui/lucide-icons-2'
import { Label, XStack, YStack } from '@hanzo/gui'
import { Label, XStack, YStack } from 'hanzogui'
const Frame = styled(View, {
borderWidth: 1,
@@ -10,7 +10,7 @@ import {
yellow,
yellowDark,
} from '@hanzogui/colors'
import { H2, Paragraph, Separator, Square, XStack, YStack } from '@hanzo/gui'
import { H2, Paragraph, Separator, Square, XStack, YStack } from 'hanzogui'
const colorGroups = ['gray', 'blue', 'green', 'yellow', 'red'] as const
@@ -1,7 +1,7 @@
import { ContextMenu } from '@hanzogui/context-menu'
import { Calendar, Check, ChevronRight } from '@hanzogui/lucide-icons-2'
import React from 'react'
import { Text, View, YStack } from '@hanzo/gui'
import { Text, View, YStack } from 'hanzogui'
/**
* Note: you'll want to use createMenu() to customize further.
@@ -15,7 +15,7 @@ import {
View,
XGroup,
XStack,
} from '@hanzo/gui'
} from 'hanzogui'
import { SelectDemoContents } from './SelectDemo'
type DialogMode = 'plain' | 'adapt' | 'keepMounted'
@@ -1,5 +1,5 @@
import React from 'react'
import type { SizeTokens } from '@hanzo/gui'
import type { SizeTokens } from 'hanzogui'
import {
Button,
Form,
@@ -11,7 +11,7 @@ import {
XGroup,
Label,
YStack,
} from '@hanzo/gui'
} from 'hanzogui'
export function FormsDemo(props: { size: SizeTokens }) {
const [status, setStatus] = React.useState<'off' | 'submitting' | 'submitted'>('off')
@@ -1,5 +1,5 @@
import { Activity, Airplay } from '@hanzogui/lucide-icons-2'
import { Button, Group, ListItem, Separator, XGroup, YGroup, YStack } from '@hanzo/gui'
import { Button, Group, ListItem, Separator, XGroup, YGroup, YStack } from 'hanzogui'
export function GroupDemo() {
return (
@@ -1,4 +1,4 @@
import { H1, H2, H3, H4, H5, H6, YStack } from '@hanzo/gui'
import { H1, H2, H3, H4, H5, H6, YStack } from 'hanzogui'
export function HeadingsDemo() {
return (
@@ -1,5 +1,5 @@
import type { SizeTokens } from '@hanzo/gui'
import { Button, Input, TextArea, XStack, YStack } from '@hanzo/gui'
import type { SizeTokens } from 'hanzogui'
import { Button, Input, TextArea, XStack, YStack } from 'hanzogui'
export function InputsDemo() {
return (
@@ -1,4 +1,4 @@
import { Input, Label, Switch, XStack, YStack } from '@hanzo/gui'
import { Input, Label, Switch, XStack, YStack } from 'hanzogui'
export function LabelDemo() {
return (
@@ -1,4 +1,4 @@
import { XStack } from '@hanzo/gui'
import { XStack } from 'hanzogui'
import { LinearGradient } from '@hanzogui/linear-gradient'
export function LinearGradientDemo() {
+86
View File
@@ -0,0 +1,86 @@
import { ChevronRight, Cloud, Moon, Star, Sun } from '@hanzogui/lucide-icons-2'
import { ListItem, Separator, Theme, XStack, YGroup } from 'hanzogui'
export function ListItemDemo() {
return (
<Theme name="surface1">
<XStack $maxMd={{ flexDirection: 'column' }} px="$4" gap="$4">
<ListItemDemo1 />
<ListItemDemo2 />
</XStack>
</Theme>
)
}
function ListItemDemo1() {
return (
<YGroup
self="center"
borderWidth={1}
borderColor="$borderColor"
rounded="$4"
overflow="hidden"
width={240}
size="$4"
>
<YGroup.Item>
<ListItem
gap="$3"
icon={Star}
title="Star"
subTitle={<ListItem.Subtitle>Twinkles</ListItem.Subtitle>}
iconAfter={ChevronRight}
/>
</YGroup.Item>
<YGroup.Item>
<ListItem gap="$3" icon={Moon}>
Moon
</ListItem>
</YGroup.Item>
<YGroup.Item>
<ListItem gap="$3" icon={Sun}>
Sun
</ListItem>
</YGroup.Item>
<YGroup.Item>
<ListItem gap="$3" icon={Cloud}>
Cloud
</ListItem>
</YGroup.Item>
</YGroup>
)
}
function ListItemDemo2() {
return (
<YGroup
self="center"
borderWidth={1}
borderColor="$borderColor"
rounded="$4"
overflow="hidden"
width={240}
size="$5"
>
<YGroup.Item>
<ListItem
gap="$3"
title="Star"
subTitle="Subtitle"
icon={Star}
iconAfter={ChevronRight}
/>
</YGroup.Item>
<Separator />
<YGroup.Item>
<ListItem
gap="$3"
title="Moon"
subTitle="Subtitle"
icon={Moon}
iconAfter={ChevronRight}
/>
</YGroup.Item>
</YGroup>
)
}
@@ -2,7 +2,7 @@ import React from 'react'
import * as LucideIcons from '@hanzogui/lucide-icons-2'
import { ScrollView } from 'react-native'
import { Input, Paragraph, Spacer, YStack, useDebounceValue } from '@hanzo/gui'
import { Input, Paragraph, Spacer, YStack, useDebounceValue } from 'hanzogui'
import { Grid } from './Grid'
@@ -9,10 +9,10 @@ import {
} from '@hanzogui/lucide-icons-2'
import { Menu } from '@hanzogui/menu'
import React from 'react'
import { Button } from '@hanzo/gui'
import { Button } from 'hanzogui'
/**
* Menu Demo using GUI Menu component.
* Menu Demo using Gui Menu component.
* Automatically uses native menus on iOS/Android, web menus on web.
* No configuration needed - it just works!
*/
@@ -1,5 +1,5 @@
import type { SizeTokens } from '@hanzo/gui'
import { Button, Theme, XStack, YStack } from '@hanzo/gui'
import type { SizeTokens } from 'hanzogui'
import { Button, Theme, XStack, YStack } from 'hanzogui'
import { Input, TextArea } from '@hanzogui/input'
export function NewInputsDemo() {
@@ -5,7 +5,7 @@ import {
ChevronUp,
} from '@hanzogui/lucide-icons-2'
import { useState } from 'react'
import type { PopoverProps } from '@hanzo/gui'
import type { PopoverProps } from 'hanzogui'
import {
Adapt,
Button,
@@ -17,7 +17,7 @@ import {
styled,
XStack,
YStack,
} from '@hanzo/gui'
} from 'hanzogui'
export function PopoverDemo() {
const [shouldAdapt, setShouldAdapt] = useState(true)
@@ -1,5 +1,5 @@
import React from 'react'
import { Button, Paragraph, Progress, Slider, Theme, XStack, YStack } from '@hanzo/gui'
import { Button, Paragraph, Progress, Slider, Theme, XStack, YStack } from 'hanzogui'
import { Play, RotateCcw } from '@hanzogui/lucide-icons-2'
export function ProgressDemo() {
@@ -1,5 +1,5 @@
import type { SizeTokens } from '@hanzo/gui'
import { Label, RadioGroup, Theme, XStack, YStack } from '@hanzo/gui'
import type { SizeTokens } from 'hanzogui'
import { Label, RadioGroup, Theme, XStack, YStack } from 'hanzogui'
export function RadioGroupDemo() {
return (
@@ -10,7 +10,7 @@ import {
import { RovingFocusGroup } from '@hanzogui/roving-focus'
import React from 'react'
import { Pressable, StyleSheet, Text, View } from 'react-native'
import { isWeb, useTheme } from '@hanzo/gui'
import { isWeb, useTheme } from 'hanzogui'
const RadioGroupContext = React.createContext<RadioGroupContextValue>({})
const RadioGroupItemContext = React.createContext<RadioGroupItemContextValue>({
@@ -1,4 +1,4 @@
import { Label, XStack, YStack, styled } from '@hanzo/gui'
import { Label, XStack, YStack, styled } from 'hanzogui'
import { createRadioGroup } from '@hanzogui/radio-group'
@@ -9,7 +9,7 @@ import {
YStack,
useForceUpdate,
useIsomorphicLayoutEffect,
} from '@hanzo/gui'
} from 'hanzogui'
export function ReplaceThemeDemo() {
const [theme, setTheme] = React.useState<any>()
@@ -1,4 +1,4 @@
import { Circle, ScrollView, Square, XStack } from '@hanzo/gui'
import { Circle, ScrollView, Square, XStack } from 'hanzogui'
export function ScrollViewDemo() {
return (
@@ -1,18 +1,9 @@
import { Check, ChevronDown, ChevronUp } from '@hanzogui/lucide-icons-2'
import React from 'react'
import type { FontSizeTokens, SelectProps } from '@hanzo/gui'
import {
Adapt,
Label,
Select,
Sheet,
Theme,
XStack,
YStack,
getFontSize,
} from '@hanzo/gui'
import { LinearGradient } from 'gui/linear-gradient'
import type { FontSizeTokens, SelectProps } from 'hanzogui'
import { Adapt, Label, Select, Sheet, Theme, XStack, YStack, getFontSize } from 'hanzogui'
import { LinearGradient } from 'hanzogui/linear-gradient'
export function SelectDemo() {
return (
@@ -1,4 +1,4 @@
import { Paragraph, Separator, XStack, YStack } from '@hanzo/gui'
import { Paragraph, Separator, XStack, YStack } from 'hanzogui'
export function SeparatorDemo() {
return (
@@ -1,4 +1,4 @@
import { Circle, Square, XStack } from '@hanzo/gui'
import { Circle, Square, XStack } from 'hanzogui'
export function ShapesDemo() {
return (
@@ -2,7 +2,7 @@ import { ChevronDown, ChevronUp } from '@hanzogui/lucide-icons-2'
import type { SheetProps } from '@hanzogui/sheet'
import { Sheet } from '@hanzogui/sheet'
import React, { memo } from 'react'
import { Button, H2, Input, Paragraph, XStack, YStack } from '@hanzo/gui'
import { Button, H2, Input, Paragraph, XStack, YStack } from 'hanzogui'
const spModes = ['percent', 'constant', 'fit', 'mixed'] as const
@@ -1,5 +1,5 @@
import type { SliderProps } from '@hanzo/gui'
import { Slider, Theme, XStack } from '@hanzo/gui'
import type { SliderProps } from 'hanzogui'
import { Slider, Theme, XStack } from 'hanzogui'
export function SliderDemo() {
return (
@@ -1,4 +1,4 @@
import { Spinner, YStack } from '@hanzo/gui'
import { Spinner, YStack } from 'hanzogui'
export function SpinnerDemo() {
return (
@@ -1,5 +1,5 @@
import React from 'react'
import { XStack, YStack, ZStack } from '@hanzo/gui'
import { XStack, YStack, ZStack } from 'hanzogui'
export function StacksDemo() {
return (
@@ -1,5 +1,5 @@
import type { SizeTokens } from '@hanzo/gui'
import { Label, Separator, Switch, Theme, XStack, YStack } from '@hanzo/gui'
import type { SizeTokens } from 'hanzogui'
import { Label, Separator, Switch, Theme, XStack, YStack } from 'hanzogui'
export function SwitchDemo() {
return (
@@ -4,7 +4,7 @@ import { useSwitch } from '@hanzogui/switch-headless'
import type { View } from 'react-native'
import { Animated, Pressable } from 'react-native'
import { Label, XStack, YStack } from '@hanzo/gui'
import { Label, XStack, YStack } from 'hanzogui'
export function SwitchHeadlessDemo() {
return (
@@ -1,6 +1,6 @@
import { View, styled } from '@hanzogui/core'
import { createSwitch } from '@hanzogui/switch'
import { Label, XStack, YStack } from '@hanzo/gui'
import { Label, XStack, YStack } from 'hanzogui'
const Frame = styled(View, {
width: 40,
@@ -1,5 +1,5 @@
import React from 'react'
import type { ViewProps, TabLayout, TabsTabProps } from '@hanzo/gui'
import type { ViewProps, TabLayout, TabsTabProps } from 'hanzogui'
import {
AnimatePresence,
Button,
@@ -9,7 +9,7 @@ import {
XStack,
YStack,
styled,
} from '@hanzo/gui'
} from 'hanzogui'
const demos = ['background', 'underline'] as const
const demosTitle: Record<(typeof demos)[number], string> = {
@@ -108,6 +108,7 @@ const TabsAdvancedBackground = () => {
/>
)}
</AnimatePresence>
<AnimatePresence>
{activeAt && (
<TabsRovingIndicator
@@ -120,6 +121,7 @@ const TabsAdvancedBackground = () => {
/>
)}
</AnimatePresence>
<YStack position="relative">
<Tabs.List
loop={false}
@@ -129,7 +131,6 @@ const TabsAdvancedBackground = () => {
>
<Tabs.Tab
unstyled
paddingVertical="$2"
paddingHorizontal="$3"
value="tab1"
onInteraction={handleOnInteraction}
@@ -138,7 +139,6 @@ const TabsAdvancedBackground = () => {
</Tabs.Tab>
<Tabs.Tab
unstyled
paddingVertical="$2"
paddingHorizontal="$3"
value="tab2"
onInteraction={handleOnInteraction}
@@ -147,7 +147,6 @@ const TabsAdvancedBackground = () => {
</Tabs.Tab>
<Tabs.Tab
unstyled
paddingVertical="$2"
paddingHorizontal="$3"
value="tab3"
onInteraction={handleOnInteraction}
@@ -260,34 +259,37 @@ const TabsAdvancedUnderline = () => {
<Tabs.Tab
unstyled
paddingHorizontal="$3"
paddingVertical="$2"
value="tab1"
onInteraction={handleOnInteraction}
>
<SizableText>Profile</SizableText>
<SizableText select="none" cursor="default">
Profile
</SizableText>
</Tabs.Tab>
<Tabs.Tab
unstyled
paddingHorizontal="$3"
paddingVertical="$2"
value="tab2"
onInteraction={handleOnInteraction}
>
<SizableText>Connections</SizableText>
<SizableText select="none" cursor="default">
Connections
</SizableText>
</Tabs.Tab>
<Tabs.Tab
unstyled
paddingHorizontal="$3"
paddingVertical="$2"
value="tab3"
onInteraction={handleOnInteraction}
>
<SizableText>Notifications</SizableText>
<SizableText select="none" cursor="default">
Notifications
</SizableText>
</Tabs.Tab>
</Tabs.List>
</YStack>
<AnimatePresence exitBeforeEnter custom={{ direction }} initial={false}>
<AnimatePresence mode="wait" custom={{ direction }} initial={false}>
<AnimatedYStack key={currentTab}>
<Tabs.Content
value={currentTab}
@@ -318,7 +320,7 @@ const TabsRovingIndicator = ({ active, ...props }: { active?: boolean } & ViewPr
opacity: 0,
}}
{...(active && {
backgroundColor: '$color8',
backgroundColor: '$color5',
opacity: 0.6,
})}
{...props}
@@ -1,5 +1,5 @@
import React from 'react'
import type { TabsContentProps } from '@hanzo/gui'
import type { TabsContentProps } from 'hanzogui'
import {
Button,
H5,
@@ -10,7 +10,7 @@ import {
YStack,
isWeb,
useWindowDimensions,
} from '@hanzo/gui'
} from 'hanzogui'
const demos = ['horizontal', 'vertical'] as const
const demosTitle: Record<(typeof demos)[number], string> = {
@@ -7,7 +7,7 @@ import {
YStack,
isWeb,
styled,
} from '@hanzo/gui'
} from 'hanzogui'
import { createTabs } from '@hanzogui/tabs'
import { getButtonSized } from '@hanzogui/get-button-sized'
@@ -1,4 +1,4 @@
import { Em, Paragraph, SizableText, Span, Strong, YStack } from '@hanzo/gui'
import { Em, Paragraph, SizableText, Span, Strong, YStack } from 'hanzogui'
export function TextDemo() {
return (
@@ -1,5 +1,5 @@
import type { SquareProps, ThemeName } from '@hanzo/gui'
import { Square, XStack, YStack } from '@hanzo/gui'
import type { SquareProps, ThemeName } from 'hanzogui'
import { Square, XStack, YStack } from 'hanzogui'
export function ThemeBuilderDemo() {
return (
@@ -1,4 +1,4 @@
import { Button, H5, Theme, XStack, YStack } from '@hanzo/gui'
import { Button, H5, Theme, XStack, YStack } from 'hanzogui'
export function ThemeInverseDemo() {
return (
+236
View File
@@ -0,0 +1,236 @@
import { isWeb } from 'hanzogui'
import {
Toast,
toast,
useToastItem,
type ToastPosition,
type ToastT,
} from '@hanzogui/toast/v2'
import {
ArrowDown,
ArrowDownLeft,
ArrowDownRight,
ArrowUp,
ArrowUpLeft,
ArrowUpRight,
} from '@hanzogui/lucide-icons-2'
import { useRef, useState } from 'react'
import { Button, Label, SizableText, Slider, XStack, YStack } from 'hanzogui'
export const ToastDemo = () => {
const [position, setPosition] = useState<ToastPosition>('bottom-right')
const [gap, setGap] = useState(14)
const [visibleToasts, setVisibleToasts] = useState(4)
const [duration, setDuration] = useState(4000)
const count = useRef(0)
const showToast = (newPosition: ToastPosition) => {
setPosition(newPosition)
count.current++
toast(`Toast #${count.current}`, {
description: 'Swipe to dismiss or wait for auto-close.',
})
}
return (
<Toast
position={position}
gap={Math.round(gap)}
visibleToasts={visibleToasts}
duration={duration}
>
<Toast.Viewport offset={16}>
<Toast.List
renderItem={({ toast: t, index }) => (
<Toast.Item key={t.id} toast={t} index={index} testID="toast-item">
<ToastContent toast={t} />
</Toast.Item>
)}
/>
</Toast.Viewport>
<YStack gap="$3" self="center" width={280}>
{/* Position buttons */}
<YStack gap="$2" self="center">
<XStack gap="$2">
<PositionButton
position="top-left"
current={position}
onPress={showToast}
Icon={ArrowUpLeft}
/>
<PositionButton
position="top-center"
current={position}
onPress={showToast}
Icon={ArrowUp}
/>
<PositionButton
position="top-right"
current={position}
onPress={showToast}
Icon={ArrowUpRight}
testID="toast-top-right-button"
/>
</XStack>
<XStack gap="$2">
<PositionButton
position="bottom-left"
current={position}
onPress={showToast}
Icon={ArrowDownLeft}
/>
<PositionButton
position="bottom-center"
current={position}
onPress={showToast}
Icon={ArrowDown}
/>
<PositionButton
position="bottom-right"
current={position}
onPress={showToast}
Icon={ArrowDownRight}
testID="toast-show-button"
/>
</XStack>
</YStack>
{/* Controls */}
<YStack gap="$1" paddingTop="$1">
<DemoSlider
label="Gap"
value={gap}
min={0}
max={30}
step={0.1}
onChange={setGap}
/>
<DemoSlider
label="Visible"
value={visibleToasts}
min={1}
max={8}
step={1}
onChange={setVisibleToasts}
/>
<DemoSlider
label="Duration"
value={duration}
min={1000}
max={10000}
step={100}
onChange={setDuration}
format={(v) => `${(v / 1000).toFixed(1)}s`}
/>
</YStack>
</YStack>
</Toast>
)
}
function ToastContent({ toast: t }: { toast: ToastT }) {
const { handleClose } = useToastItem()
const title = typeof t.title === 'function' ? t.title() : t.title
const description =
typeof t.description === 'function' ? t.description() : t.description
return (
<>
<XStack gap="$3" alignItems="flex-start">
<Toast.Icon />
<YStack flex={1} gap="$0.5">
{title && (
<Toast.Title fontWeight="600" size="$3">
{title}
</Toast.Title>
)}
{description && (
<Toast.Description color="$color9" size="$2">
{description}
</Toast.Description>
)}
</YStack>
</XStack>
{isWeb && (
<Toast.Close
testID="toast-close-button"
position="absolute"
top={-6}
left={-6}
zIndex={1}
/>
)}
</>
)
}
function DemoSlider({
label,
value,
min,
max,
step,
onChange,
format,
}: {
label: string
value: number
min: number
max: number
step?: number
onChange: (v: number) => void
format?: (v: number) => string
}) {
return (
<XStack gap="$2" alignItems="center">
<Label size="$2" width={55}>
{label}
</Label>
<Slider
flex={1}
value={[value]}
min={min}
max={max}
step={step}
onValueChange={([v]) => onChange(v)}
>
<Slider.Track>
<Slider.TrackActive />
</Slider.Track>
<Slider.Thumb theme="accent" size={16} borderRadius={100} index={0} />
</Slider>
<SizableText userSelect="none" size="$2" width={35} textAlign="right">
{format ? format(value) : Math.round(value)}
</SizableText>
</XStack>
)
}
const PositionButton = ({
position,
current,
onPress,
Icon,
testID,
}: {
position: ToastPosition
current: ToastPosition
onPress: (p: ToastPosition) => void
Icon: any
testID?: string
}) => {
const isActive = position === current
return (
<Button
icon={Icon}
circular
theme={isActive ? 'accent' : undefined}
onPress={() => onPress(position)}
testID={testID}
/>
)
}
+57
View File
@@ -0,0 +1,57 @@
import { CheckCircle2 } from '@hanzogui/lucide-icons-2'
import { Toast, toast, useToasts } from '@hanzogui/toast/v2'
import { Button, XStack, YStack } from 'hanzogui'
/**
* IMPORTANT NOTE: if you're copy-pasting this demo into your code, make sure to add the Toast wrapper as well.
*/
export const ToastDuplicateDemo = () => {
return (
<Toast>
<Toast.Viewport>
<ToastList />
</Toast.Viewport>
<YStack items="center">
<Button
onPress={() => {
toast('Successfully saved!', {
description: "Don't worry... We've got your data.",
})
}}
>
Show toast
</Button>
</YStack>
</Toast>
)
}
const ToastList = () => {
const { toasts } = useToasts()
return (
<>
{toasts.map((t, index) => (
<Toast.Item key={t.id} toast={t} index={index}>
<XStack gap="$4" items="center">
<YStack>
<CheckCircle2 />
</YStack>
<YStack>
<Toast.Title>
{typeof t.title === 'function' ? t.title() : t.title}
</Toast.Title>
{t.description && (
<Toast.Description>
{typeof t.description === 'function' ? t.description() : t.description}
</Toast.Description>
)}
</YStack>
</XStack>
</Toast.Item>
))}
</>
)
}
+121
View File
@@ -0,0 +1,121 @@
import { Toast, useToastController, useToastState } from '@hanzogui/toast'
import React from 'react'
import { Button, Label, Switch, XStack, YStack } from 'hanzogui'
/**
* IMPORTANT NOTE: if you're copy-pasting this demo into your code, make sure to add:
* - <ToastProvider> at the root
* - <ToastViewport /> where you want to show the toasts
*/
export const ToastV1Demo = () => {
const [native, setNative] = React.useState(false)
return (
<YStack gap="$4" items="center">
<ToastControl native={native} />
<CurrentToast />
<NativeOptions native={native} setNative={setNative} />
</YStack>
)
}
const CurrentToast = () => {
const currentToast = useToastState()
if (!currentToast || currentToast.isHandledNatively) return null
return (
<Toast
key={currentToast.id}
duration={currentToast.duration}
viewportName={currentToast.viewportName}
enterStyle={{ opacity: 0, scale: 0.95, y: -80 }}
exitStyle={{ opacity: 0, scale: 0.95, y: -80 }}
opacity={1}
scale={1}
y={-50}
transition="quicker"
bg="$color2"
boxShadow="0px 2px 4px rgba(0,0,0,0.12), 0px 8px 24px rgba(0,0,0,0.08)"
>
<XStack gap="$5" items="center" justify="space-between">
<YStack gap="$0.5" flex={1}>
<Toast.Title>{currentToast.title}</Toast.Title>
{!!currentToast.message && (
<Toast.Description>{currentToast.message}</Toast.Description>
)}
</YStack>
<Toast.Action asChild altText="Dismiss toast">
<Button size="$2">Dismiss</Button>
</Toast.Action>
</XStack>
</Toast>
)
}
const ToastControl = ({ native }: { native: boolean }) => {
const toast = useToastController()
return (
<XStack gap="$2" justify="center">
<Button
onPress={() => {
toast.show('Successfully saved!', {
message: "Don't worry, we've got your data.",
native,
demo: true,
})
}}
>
Show
</Button>
<Button
onPress={() => {
toast.hide()
}}
>
Hide
</Button>
</XStack>
)
}
const NativeOptions = ({
native,
setNative,
}: {
native: boolean
setNative: (native: boolean) => void
}) => {
return (
<XStack gap="$3">
<Label size="$1" onPress={() => setNative(false)}>
Custom
</Label>
<Switch
theme="surface2"
id="native-toggle"
size="$1"
checked={!!native}
onCheckedChange={(val) => setNative(val)}
>
<Switch.Thumb
theme="accent"
transition={[
'quickest',
{
transform: {
overshootClamping: true,
},
},
]}
/>
</Switch>
<Label size="$1" onPress={() => setNative(true)}>
Native
</Label>
</XStack>
)
}
@@ -1,5 +1,5 @@
import { AlignCenter, AlignLeft, AlignRight } from '@hanzogui/lucide-icons-2'
import { Label, ToggleGroup, XGroup, YGroup, XStack, YStack } from '@hanzo/gui'
import { Label, ToggleGroup, XGroup, YGroup, XStack, YStack } from 'hanzogui'
export function ToggleGroupDemo() {
return (
@@ -1,7 +1,7 @@
import type { Tokens } from '@hanzogui/core'
import { getConfig } from '@hanzogui/core'
import React from 'react'
import { Button, H2, H3, H4, Square, XGroup, XStack, YStack } from '@hanzo/gui'
import { Button, H2, H3, H4, Square, XGroup, XStack, YStack } from 'hanzogui'
type Section = 'spaceNegative' | keyof Tokens
@@ -5,16 +5,8 @@ import {
ChevronUp,
Circle,
} from '@hanzogui/lucide-icons-2'
import type { TooltipProps } from '@hanzo/gui'
import {
Button,
Paragraph,
Theme,
Tooltip,
TooltipGroup,
XStack,
YStack,
} from '@hanzo/gui'
import type { TooltipProps } from 'hanzogui'
import { Button, Paragraph, Theme, Tooltip, TooltipGroup, XStack, YStack } from 'hanzogui'
export function TooltipDemo() {
return (
@@ -10,7 +10,7 @@ import {
YStack,
getVariableValue,
useIsomorphicLayoutEffect,
} from '@hanzo/gui'
} from 'hanzogui'
const colors = config.tokens.color
const colorKeys = Object.keys(colors)
+16
View File
@@ -0,0 +1,16 @@
import { config } from '@hanzogui/dev-config'
import { createGui } from 'hanzogui'
const tamaConf = createGui(config)
export type Conf = typeof tamaConf
declare module 'hanzogui' {
interface GuiCustomConfig extends Conf {}
interface TypeOverride {
groupNames(): 'card' | 'takeoutBody' | 'content' | 'item'
}
}
export default tamaConf
+66
View File
@@ -0,0 +1,66 @@
// Include gui config types for proper type checking
import type {} from './gui.config'
export * from './AccordionDemo'
export * from './AddThemeDemo'
export * from './AlertDialogDemo'
export * from './AnimationsDelayDemo'
export * from './AnimationsDemo'
export * from './AnimationsEnterDemo'
export * from './AnimationsHoverDemo'
export * from './AnimationsPresenceDemo'
export * from './AnimationsTimingDemo'
export * from './AvatarDemo'
export * from './BoxShadowTokenDemo'
export * from './BuildAButtonDemo'
export * from './ButtonDemo'
export * from './ThemeBuilderDemo'
export * from './CardDemo'
export * from './CheckboxDemo'
export * from './CheckboxHeadlessDemo'
export * from './CheckboxUnstyledDemo'
export * from './ColorsDemo'
export * from './ContextMenuDemo'
export * from './MenuDemo'
export * from './DialogDemo'
export * from './FormsDemo'
export * from './GroupDemo'
export * from './HeadingsDemo'
export * from './ImageDemo'
export * from './WebNativeImageDemo'
export * from './InputsDemo'
export * from './NewInputsDemo'
export * from './LabelDemo'
export * from './LinearGradientDemo'
export * from './ListItemDemo'
export * from './LucideIconsDemo'
export * from './PopoverDemo'
export * from './ProgressDemo'
export * from './RadioGroupDemo'
export * from './RadioGroupHeadlessDemo'
export * from './RadioGroupUnstyledDemo'
export * from './ReplaceThemeDemo'
export * from './ScrollViewDemo'
export * from './SelectDemo'
export * from './SeparatorDemo'
export * from './ShapesDemo'
export * from './SheetDemo'
export * from './SliderDemo'
export * from './SpinnerDemo'
export * from './StacksDemo'
export * from './SwitchDemo'
export * from './SwitchHeadlessDemo'
export * from './SwitchUnstyledDemo'
export * from './TabsAdvancedDemo'
export * from './TabsDemo'
export * from './TextDemo'
export * from './ThemeInverseDemo'
export * from './ToastDemo'
export * from './ToastDuplicateDemo'
export * from './ToastV1Demo'
export * from './ToggleGroupDemo'
export * from './TokensDemo'
export * from './TooltipDemo'
export * from './UpdateThemeDemo'
export * from './useOnIntersecting'
export * from './TabsHeadlessDemo'
+89
View File
@@ -0,0 +1,89 @@
import type { RefObject } from 'react'
import { useEffect, useState } from 'react'
import { isWeb, useEvent } from 'hanzogui'
type DisposeFn = () => void
type IntersectCallback = (
props: (IntersectionObserverEntry | null)[],
didResize?: boolean
) => DisposeFn | void | null
type HTMLRef = RefObject<HTMLElement | null>
export function useIsIntersecting<Ref extends HTMLRef | HTMLRef[]>(
refs: Ref,
{ once, ...opts }: IntersectionObserverInit & { once?: boolean } = {}
): Ref extends any[] ? boolean[] : boolean {
const [values, setValues] = useState<boolean[]>([])
useOnIntersecting(
refs,
(entries) => {
if (!isWeb) return
const intersecting = entries.some((x) => x?.isIntersecting)
if (once && !intersecting) return
setValues((prev) => {
const next = entries.map((e) => e?.isIntersecting ?? false)
if (prev.length === next.length && prev.every((e, i) => e === next[i])) {
return prev
}
return next
})
},
opts
)
return (Array.isArray(refs) ? values : values[0]) as any
}
export function useOnIntersecting<Ref extends HTMLRef | HTMLRef[]>(
refsIn: Ref,
incomingCbRaw: IntersectCallback,
{ threshold = 0, root, rootMargin }: IntersectionObserverInit = {},
mountArgs: any[] = []
) {
const onIntersectEvent = useEvent(incomingCbRaw)
useEffect(() => {
if (!isWeb) return
const refs = (Array.isArray(refsIn) ? refsIn : [refsIn]) as HTMLRef[]
if (!refs.length) return
let dispose: DisposeFn | null = null
let currentEntries: (IntersectionObserverEntry | null)[] = []
const options = {
threshold,
root,
rootMargin,
}
const io = new IntersectionObserver((entries) => {
currentEntries = refs.map((ref, index) => {
return (
entries.find((x) => x.target === ref.current) ?? currentEntries[index] ?? null
)
})
dispose?.()
dispose = onIntersectEvent(currentEntries) || null
}, options)
for (const ref of refs) {
if (ref.current) {
io.observe(ref.current)
}
}
return () => {
dispose?.()
io.disconnect()
}
}, [
onIntersectEvent,
refsIn,
root,
rootMargin,
threshold,
...mountArgs,
])
}
@@ -1,4 +1,4 @@
import { Separator, ZStack } from '@hanzo/gui'
import { Separator, ZStack } from 'hanzogui'
export const Crosshairs = () => {
return (
+73
View File
@@ -0,0 +1,73 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "bundler",
"module": "Preserve",
"composite": true
},
"references": [
{
"path": "../../pkgs/core/config"
},
{
"path": "../../pkgs/core/core"
},
{
"path": "../../pkgs/logo"
},
{
"path": "../../pkgs/lucide-icons"
},
{
"path": "../../pkgs/gui-dev-config"
},
{
"path": "../../pkgs/ui/avatar"
},
{
"path": "../../pkgs/ui/button"
},
{
"path": "../../pkgs/ui/list-item"
},
{
"path": "../../pkgs/ui/menu"
},
{
"path": "../../pkgs/ui/popover"
},
{
"path": "../../pkgs/ui/progress"
},
{
"path": "../../pkgs/ui/radio-group"
},
{
"path": "../../pkgs/ui/select"
},
{
"path": "../../pkgs/ui/sheet"
},
{
"path": "../../pkgs/ui/slider"
},
{
"path": "../../pkgs/ui/stacks"
},
{
"path": "../../pkgs/ui/hanzogui"
},
{
"path": "../../pkgs/ui/toast"
}
],
"include": [
"src/**/*"
],
"exclude": [
"tests",
"types",
"dist",
"**/__tests__"
]
}
+5
View File
@@ -0,0 +1,5 @@
recipes-output
helpers/dist/
# Generated recipes proxies
helpers/dist/
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+42
View File
@@ -0,0 +1,42 @@
BSD 3-Clause License
Copyright (c) 2026-present, Hanzo AI, Inc.
Portions of this software are derived from upstream code originally licensed under
the MIT License, with the following copyright notices retained per its terms:
Copyright (c) 2020 Nate Wienert
Copyright (c) 2015-present, Nicolas Gallagher.
Copyright (c) 2015-present, Facebook, Inc.
Copyright (c) 2021 Radix
Copyright (c) 2017 Carmelo Pullara
Copyright (c) 2018 Framer B.V.
Copyright (c) 2022 WorkOS
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
@@ -798,7 +798,7 @@ p {
opacity: 0;
}
.bento-shadow {
.recipes-shadow {
text-shadow:
1px 1px var(--color1),
1px 2px 1px var(--color3),
@@ -812,7 +812,7 @@ p {
1px 12px 0px var(--color7);
}
.t_dark .bento-shadow {
.t_dark .recipes-shadow {
text-shadow:
2px 2px 1px var(--color9),
1px 2px 1px var(--color9),
@@ -826,14 +826,14 @@ p {
1px 11px 1px var(--color7);
}
.bento-up-text {
.recipes-up-text {
/* mix-blend-mode: luminosity; */
mask-image: linear-gradient(rgba(0, 0, 0, 1), transparent, rgba(0, 0, 0, 1));
background-image: linear-gradient(var(--color0), var(--color7));
/* filter: blur(10px); */
}
.t_dark .bento-up-text {
.t_dark .recipes-up-text {
mix-blend-mode: color-dodge;
background-image: linear-gradient(var(--background025), var(--color8));
}
@@ -856,7 +856,7 @@ p {
mix-blend-mode: color-dodge;
}
.bento-text-3 {
.recipes-text-3 {
background-image: linear-gradient(var(--color7), var(--color9));
mix-blend-mode: hard-light;
text-shadow:
@@ -864,7 +864,7 @@ p {
0 30px 30px var(--color025);
}
.t_dark .bento-text-3 {
.t_dark .recipes-text-3 {
mix-blend-mode: screen;
}

Some files were not shown because too many files have changed in this diff Show More