diff --git a/.github/workflows/publish-npmjs.yml b/.github/workflows/publish-npmjs.yml index 9973a5a..dd9f0fe 100644 --- a/.github/workflows/publish-npmjs.yml +++ b/.github/workflows/publish-npmjs.yml @@ -11,7 +11,7 @@ permissions: id-token: write concurrency: - group: firexcore-agent-orbs-npmjs-v0.2.0 + group: firexcore-agent-orbs-npmjs-v0.3.0 cancel-in-progress: false jobs: @@ -33,31 +33,29 @@ jobs: node --version npm --version npm config get registry - node -e "const p=require('./package.json'); if(p.name!=='@firexcore/agent-orbs'||p.version!=='0.2.0'||p.private===true)process.exit(1)" + node -e "const p=require('./package.json'); if(p.name!=='@firexcore/agent-orbs'||p.version!=='0.3.0'||p.private===true)process.exit(1)" node -e "const p=require('./package.json');if(p.repository?.url!=='https://github.com/FireXCore/agent-orbs.git')process.exit(1)" - name: Build and test run: | npm install npm run check - node --input-type=module -e "const m=await import('./dist/index.js');for(const n of ['AgentOrb','InteractiveOrb','MonoLatticeOrb','ThinkingOrb'])if(typeof m[n]!=='function')throw Error(n)" - node -e "const m=require('./dist/index.cjs');for(const n of ['AgentOrb','InteractiveOrb','MonoLatticeOrb','ThinkingOrb'])if(typeof m[n]!=='function')throw Error(n)" + node --input-type=module -e "const m=await import('./dist/index.js');for(const n of ['AgentOrb','InteractiveOrb','MonoLatticeOrb','ThinkingOrb'])if(typeof m[n]!=='function')throw Error(n);if(!m.ORB_STATES.includes('waiting')||m.WAITING_VARIANTS.join(',')!=='fold,aperture,wave')throw Error('Missing Waiting exports')" + node -e "const m=require('./dist/index.cjs');for(const n of ['AgentOrb','InteractiveOrb','MonoLatticeOrb','ThinkingOrb'])if(typeof m[n]!=='function')throw Error(n);if(!m.ORB_STATES.includes('waiting')||m.WAITING_VARIANTS.join(',')!=='fold,aperture,wave')throw Error('Missing Waiting exports')" test -f third_party/thinking-orbs/LICENSE test -f third_party/thinking-orbs/NOTICE.md npm pack --dry-run --json > /tmp/agent-orbs-npm-pack.json - node -e "const p=require('/tmp/agent-orbs-npm-pack.json')[0];for(const f of ['dist/index.js','dist/index.d.ts','third_party/thinking-orbs/LICENSE','third_party/thinking-orbs/NOTICE.md']) if(!p.files.some(x=>x.path===f)) throw Error('Missing '+f)" - - name: Publish public package v0.2.0 on npmjs.org - # Temporary workaround for Sigstore Rekor TLOG_CREATE_ENTRY_ERROR (409): - # the equivalent provenance entry already exists but package publish failed. - # Keep registry verification; re-enable provenance for a future release. + node -e "const p=require('/tmp/agent-orbs-npm-pack.json')[0];for(const f of ['dist/index.js','dist/index.d.ts','preview/waiting/fold.webp','preview/waiting/aperture.webp','preview/waiting/wave.webp','third_party/thinking-orbs/LICENSE','third_party/thinking-orbs/NOTICE.md']) if(!p.files.some(x=>x.path===f)) throw Error('Missing '+f)" + - name: Publish public package v0.3.0 on npmjs.org + # Keep the existing publish configuration while using the same registry verification. env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: 'false' run: | set -euo pipefail - if npm view '@firexcore/agent-orbs@0.2.0' version --registry=https://registry.npmjs.org/ >/dev/null 2>&1; then - actual="$(npm view '@firexcore/agent-orbs@0.2.0' repository.url --registry=https://registry.npmjs.org/)" + if npm view '@firexcore/agent-orbs@0.3.0' version --registry=https://registry.npmjs.org/ >/dev/null 2>&1; then + actual="$(npm view '@firexcore/agent-orbs@0.3.0' repository.url --registry=https://registry.npmjs.org/)" test "$actual" = 'git+https://github.com/FireXCore/agent-orbs.git' -o "$actual" = 'https://github.com/FireXCore/agent-orbs.git' - echo 'Version 0.2.0 already exists on npmjs.org with correct repository source' + echo 'Version 0.3.0 already exists on npmjs.org with correct repository source' else if test -z "$NODE_AUTH_TOKEN"; then echo 'No NPM_TOKEN secret: attempting npm trusted publishing via GitHub OIDC' @@ -68,14 +66,14 @@ jobs: - name: Confirm public registry metadata run: | set -euo pipefail - url='https://registry.npmjs.org/%40firexcore%2Fagent-orbs/0.2.0' + url='https://registry.npmjs.org/%40firexcore%2Fagent-orbs/0.3.0' # npm may return success while its public metadata is still processing. for attempt in $(seq 1 36); do http="$(curl --silent --show-error --location --max-time 12 --output /tmp/agent-orbs-public.json --write-out '%{http_code}' "$url" || true)" if [[ "$http" == '200' ]] && node - <<'NODE' const p=require('/tmp/agent-orbs-public.json'); const repo=typeof p.repository==='string'?p.repository:p.repository?.url||''; - if(p.name!=='@firexcore/agent-orbs'||p.version!=='0.2.0'||!p.dist?.tarball?.startsWith('https://registry.npmjs.org/')||!repo.includes('github.com/FireXCore/agent-orbs'))process.exit(1); + if(p.name!=='@firexcore/agent-orbs'||p.version!=='0.3.0'||!p.dist?.tarball?.startsWith('https://registry.npmjs.org/')||!repo.includes('github.com/FireXCore/agent-orbs'))process.exit(1); console.log('PUBLIC_NPMJS_VERIFIED',p.name,p.version,p.dist.tarball); NODE then diff --git a/CHANGELOG.md b/CHANGELOG.md index 44dd2e5..088346f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v0.3.0 — Waiting orb designs (2026-11-17) + +- Adds `state="waiting"` with `fold`, `aperture`, and `wave` designs for `AgentOrb` and `AgentOrbLabel`. +- Includes the three concept images in the package and displays live regular and 24 px previews in the galleries. +- Covers compact and full-size geometry, distinct variants and repeatable motion cycles. + ## v0.2.0 — Interactive contour and Mono Lattice package release (2026-11-03) - Preserves the nine independently authored FireXCore Canvas 2D motion states, APIs and appearance. diff --git a/README.md b/README.md index b859311..839d94b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # FireXCore Agent Orbs -[![Live Demo](https://img.shields.io/badge/Live_Demo-Vercel-121212?logo=vercel)](https://agent-orbs-demo.vercel.app/) [![MIT License](https://img.shields.io/badge/License-MIT-blue)](LICENSE) [![Release v0.2.0](https://img.shields.io/badge/Release-v0.2.0-0a7)](https://github.com/FireXCore/agent-orbs/releases/tag/v0.2.0) [![CI](https://github.com/FireXCore/agent-orbs/actions/workflows/ci.yml/badge.svg)](https://github.com/FireXCore/agent-orbs/actions/workflows/ci.yml) +[![Live Demo](https://img.shields.io/badge/Live_Demo-Vercel-121212?logo=vercel)](https://agent-orbs-demo.vercel.app/) [![MIT License](https://img.shields.io/badge/License-MIT-blue)](LICENSE) [![npm](https://img.shields.io/npm/v/@firexcore/agent-orbs)](https://www.npmjs.com/package/@firexcore/agent-orbs) [![CI](https://github.com/FireXCore/agent-orbs/actions/workflows/ci.yml/badge.svg)](https://github.com/FireXCore/agent-orbs/actions/workflows/ci.yml) -**[Interactive live demo](https://agent-orbs-demo.vercel.app/)** · [Release v0.2.0](https://github.com/FireXCore/agent-orbs/releases/tag/v0.2.0) · [Source repository](https://github.com/FireXCore/agent-orbs) · [Changelog](CHANGELOG.md) +**[Interactive live demo](https://agent-orbs-demo.vercel.app/)** · [npm package](https://www.npmjs.com/package/@firexcore/agent-orbs) · [Source repository](https://github.com/FireXCore/agent-orbs) · [Changelog](CHANGELOG.md) -FireXCore provides nine independently authored procedural orb states for React + TypeScript. Version 0.2 additionally includes an **optional, MIT-licensed adaptation** of the Schoolees thinking-orbs engine with a separate renderer. The original nine-state implementation remains independent and unchanged. The named `MonoLatticeOrb` component uses the heritage engine's original grayscale classic renderer. +FireXCore provides ten procedural orb states for React + TypeScript. Version 0.2 additionally includes an **optional, MIT-licensed adaptation** of the Schoolees thinking-orbs engine with a separate renderer. The original engine also includes a dedicated Waiting state in three designs. The named `MonoLatticeOrb` component uses the heritage engine's original grayscale classic renderer.

@@ -34,7 +34,7 @@ The GIF is rendered from the original `buildScene` implementation, not a marketi **Live controls:** Original, Contour and Mono Lattice visual families across two engines, dark/light theme, 0.5–2× speed, classic/contour treatment, pause/resume, pointer distortion and copyable integration snippets.

-View the compact original nine-state contact sheet +View the original engine contact sheet ![Original procedural animation states](assets/gallery.svg) @@ -42,7 +42,7 @@ The GIF is rendered from the original `buildScene` implementation, not a marketi ## Features -- Nine states: `working`, `searching`, `solving`, `listening`, `connecting`, `weaving`, `composing`, `breathing`, `shaping`. +- Ten original states: `working`, `searching`, `solving`, `listening`, `connecting`, `weaving`, `composing`, `breathing`, `shaping`, `waiting`. - True procedural 3D coordinate rotation and depth sorting, painted on a **Canvas 2D** surface (no WebGL, video, GIF or animation dependency). - Small (24 px) and regular (76 px) geometry presets; arbitrary custom diameter (12–256 px). - Single shared animation clock and per-instance offscreen pause. @@ -52,6 +52,27 @@ The GIF is rendered from the original `buildScene` implementation, not a marketi - Accessible `AgentOrbLabel` combines a compact animation with `role="status"` text. - React 18+ peer dependency, SSR-compatible static import, ESM/CJS/types build, strict TypeScript. +## Waiting for a response (v0.3.0) + +| Particle Fold | Particle Aperture | Inner Wave | +| --- | --- | --- | +| ![Particle Fold concept](preview/waiting/fold.webp) | ![Particle Aperture concept](preview/waiting/aperture.webp) | ![Inner Wave concept](preview/waiting/wave.webp) | +| A light travels along a folded particle surface. | A four-lobed volume gently opens and relaxes. | A moving wave lights up the inside of a stable particle volume. | + +The stills above are design references. The [live Waiting gallery](https://agent-orbs-demo.vercel.app/#waiting) shows procedural 3D point geometry drawn on Canvas 2D at 156px and 24px. Each animation loops without reporting completion or elapsed time. + +```tsx +import { AgentOrb, AgentOrbLabel } from '@firexcore/agent-orbs'; + + + + + Waiting for a response… + +``` + +`waitingVariant` defaults to `fold` and applies only to `state="waiting"`. + ## Contour and interactive family (v0.2.0) This opt-in engine adds features absent from the original FireXCore engine: `idle` and `responding` states, `classic` and `contour` modes for nine states, native `32/64/96/128px` presets, pointer/touch distortion with spring-back, an imperative DOM controller and a `` custom element. The original `AgentOrb` API and animation states are preserved. @@ -132,7 +153,7 @@ Open http://127.0.0.1:5174/preview/. The preview is generated from the exact sam ## Use in RMS (or any React application) -To install from GitHub Packages after configuring authenticated access, use `@firexcore/agent-orbs@0.2.0`. For local development, install from a sibling folder: +Install the current package with `npm install @firexcore/agent-orbs@0.3.0`. For local development, install from a sibling folder: ```bash npm install ../agent-orbs @@ -158,15 +179,16 @@ Make the selected `state` reflect an actual action: for example, only display `l ## Architecture - `src/scenes.ts` — pure, independently authored mathematical scenes, no DOM or React. +- `src/waiting.ts` — procedural particle geometry for the three Waiting designs. - `src/geometry.ts` — spatial transforms, distributions and interpolation. - `src/render.ts` — depth-sorted Canvas 2D painter. - `src/clock.ts` — shared RAF scheduler. - `src/appearance.ts` — theme and reduced-motion observability. - `src/AgentOrb.tsx` — React/Canvas bridge and offscreen lifecycle. - `src/AgentOrbLabel.tsx` — accessible status + small orb. -- `demo/` — responsive gallery with 9 large/small examples and controls. +- `demo/` — responsive gallery with large/small examples and controls. - `tests/` — geometry, finite-frame, determinism and state coverage. -- `scripts/build-gallery-svg.mjs` — reproducible vector contact sheet of all nine states. +- `scripts/build-gallery-svg.mjs` — reproducible vector contact sheet of the original engine. ## Deployment @@ -176,25 +198,25 @@ Make the selected `state` reflect an actual action: for example, only display `l ## Releases -- **Latest release:** [v0.2.0](https://github.com/FireXCore/agent-orbs/releases/tag/v0.2.0) +- **GitHub release for v0.2.0:** [v0.2.0](https://github.com/FireXCore/agent-orbs/releases/tag/v0.2.0) - **Downloadable distributable:** [firexcore-agent-orbs-0.2.0.tgz](https://github.com/FireXCore/agent-orbs/releases/download/v0.2.0/firexcore-agent-orbs-0.2.0.tgz) - **Changelog:** [CHANGELOG.md](CHANGELOG.md) - **Interactive demo:** [agent-orbs-demo.vercel.app](https://agent-orbs-demo.vercel.app/) -**Public npmjs.org:** [@firexcore/agent-orbs@0.2.0](https://www.npmjs.com/package/@firexcore/agent-orbs) — confirmed in the public npm registry. Install without any GitHub Packages authentication: +**Public npmjs.org:** Install [@firexcore/agent-orbs@0.3.0](https://www.npmjs.com/package/@firexcore/agent-orbs/v/0.3.0) without GitHub Packages authentication: ```bash -npm install @firexcore/agent-orbs@0.2.0 +npm install @firexcore/agent-orbs@0.3.0 ``` If you previously configured `@firexcore` to use GitHub Packages, remove the old registry override before installing from npmjs.org: ```bash npm config delete @firexcore:registry -npm install @firexcore/agent-orbs@0.2.0 --registry=https://registry.npmjs.org/ +npm install @firexcore/agent-orbs@0.3.0 --registry=https://registry.npmjs.org/ ``` -The GitHub release [v0.2.0](https://github.com/FireXCore/agent-orbs/releases/tag/v0.2.0) also provides the downloadable `.tgz`. The same version remains available separately through GitHub Packages for authenticated users. +The GitHub release [v0.2.0](https://github.com/FireXCore/agent-orbs/releases/tag/v0.2.0) also provides the downloadable `.tgz`. Version 0.2.0 is also available from GitHub Packages for authenticated users. **Provenance note:** The initial public npmjs release was published without Sigstore provenance because duplicate transparency-log entry `TLOG_CREATE_ENTRY_ERROR (409)` blocked earlier publish attempts. Future releases should restore provenance using npm Trusted Publishing (OIDC) after resolving the upstream signing issue. CI and package build tests passed, and independent public-registry metadata verification succeeded. diff --git a/assets/gallery.svg b/assets/gallery.svg index 10ecd4b..d8dbdd7 100644 --- a/assets/gallery.svg +++ b/assets/gallery.svg @@ -1,7 +1,7 @@ - + FireXCore / Agent Orbs -NINE PROCEDURAL STATES / ORIGINAL CANVAS ENGINE +TEN PROCEDURAL STATES / ORIGINAL CANVAS ENGINE @@ -136,7 +136,7 @@ Working -01 / 09 +01 / 12 @@ -412,7 +412,7 @@ Searching -02 / 09 +02 / 12 @@ -585,7 +585,7 @@ Solving -03 / 09 +03 / 12 @@ -835,7 +835,7 @@ Listening -04 / 09 +04 / 12 @@ -918,7 +918,7 @@ Connecting -05 / 09 +05 / 12 @@ -1152,7 +1152,7 @@ Weaving -06 / 09 +06 / 12 @@ -1507,7 +1507,7 @@ Composing -07 / 09 +07 / 12 @@ -1604,7 +1604,7 @@ Breathing -08 / 09 +08 / 12 @@ -1697,5 +1697,1820 @@ Shaping -09 / 09 +09 / 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Particle Fold +10 / 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Particle Aperture +11 / 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Inner Wave +12 / 12 \ No newline at end of file diff --git a/demo/App.tsx b/demo/App.tsx index 53a253e..bcbc568 100644 --- a/demo/App.tsx +++ b/demo/App.tsx @@ -1,7 +1,17 @@ import { useState } from 'react'; -import { AgentOrb, AgentOrbLabel, ORB_STATES, InteractiveOrb, INTERACTIVE_ORB_STATES } from '../src'; +import { AgentOrb, AgentOrbLabel, ORB_STATES, InteractiveOrb, INTERACTIVE_ORB_STATES, WAITING_VARIANTS } from '../src'; import type { InteractiveOrbSize } from '../src'; -import type { OrbState } from '../src'; +import type { OrbState, WaitingVariant } from '../src'; +import { WAITING_DESIGNS } from '../src/waiting'; + +const referenceImages: Record = { + fold: new URL('../preview/waiting/fold.webp', import.meta.url).href, + aperture: new URL('../preview/waiting/aperture.webp', import.meta.url).href, + wave: new URL('../preview/waiting/wave.webp', import.meta.url).href +}; +const galleryEntries = ORB_STATES.flatMap<{ state: OrbState; waitingVariant?: WaitingVariant }>(state => state === 'waiting' + ? WAITING_VARIANTS.map(waitingVariant => ({ state, waitingVariant })) + : [{ state, waitingVariant: undefined }]); const descriptions: Record = { working: 'Four precessing tracks with orbital wake highlights', @@ -12,12 +22,12 @@ const descriptions: Record = { weaving: 'Three intertwined spirals exchange perspective', composing: 'Layered ribbons drift through a virtual volume', breathing: 'A softly expanding toroidal halo', - shaping: 'An outline morphs across geometric primitives' + shaping: 'An outline morphs across geometric primitives', waiting: 'Waiting for a response' }; const statuses: Record = { working: 'Processing request', searching: 'Searching suppliers', solving: 'Validating results', listening: 'Listening to input', connecting: 'Connecting to API', weaving: 'Planning next steps', - composing: 'Composing draft', breathing: 'Waiting for response', shaping: 'Building preview' + composing: 'Composing draft', breathing: 'Waiting for response', shaping: 'Building preview', waiting: 'Waiting for response' }; export function App() { @@ -25,17 +35,19 @@ export function App() { const [paused, setPaused] = useState(false); const [accent, setAccent] = useState(false); const [speed, setSpeed] = useState(1); - const [selected, setSelected] = useState('searching'); + const [selection, setSelection] = useState<{ state: OrbState; waitingVariant?: WaitingVariant }>({ state: 'searching' }); + const { state: selected, waitingVariant: selectedVariant } = selection; + const waitingProp = selectedVariant ? ' waitingVariant="' + selectedVariant + '"' : ''; const [contour, setContour] = useState(true); const [interactive, setInteractive] = useState(true); const [interactiveSize, setInteractiveSize] = useState(96); return
-
✳ FireXCore / AGENT ORBSv0.2.0 · TWO MOTION ENGINES
+
✳ FireXCore / AGENT ORBSv0.3.0 · TWO MOTION ENGINES
MOTION SYSTEM / 001

A language for
systems in motion.

-

Nine original procedural states plus an optional nine-state interactive contour family for assistants, agents and operational interfaces. Built with React, TypeScript and Canvas 2D — no WebGL, GIFs or external animation engines.

+

Ten original procedural states, including three Waiting designs, plus an optional nine-state interactive contour family for assistants, agents and operational interfaces. Built with React, TypeScript and Canvas 2D — no WebGL, GIFs or external animation engines.

@@ -44,16 +56,22 @@ export function App() {
76 PX / 24 PX
-
{ORB_STATES.map((state, index) => )}
+
{galleryEntries.map((entry, index) => { + const { state, waitingVariant } = entry; + const active = selected === state && selectedVariant === waitingVariant; + const design = waitingVariant ? WAITING_DESIGNS[waitingVariant] : undefined; + const orb = { state, waitingVariant, theme: 'auto' as const, paused, speed, accent: accent ? '#6fbcff' : undefined }; + return ; + })}

02 / Integration

READY FOR RMS
-
ACTIVE STATE
{statuses[selected]}
Live status preview — select a card above
-
REACT / TYPESCRIPT
{`import { AgentOrb, AgentOrbLabel } from '@firexcore/agent-orbs';\n\n\n\n\n  ${statuses[selected]}\n`}

One shared animation clock. Offscreen pause. Reduced motion. High-DPI canvas. Accessible labels. Auto light/dark.

+
ACTIVE STATE
{statuses[selected]}
Live status preview — select a card above
+
REACT / TYPESCRIPT
{`import { AgentOrb, AgentOrbLabel } from '@firexcore/agent-orbs';\n\n\n\n\n  ${statuses[selected]}\n`}

One shared animation clock. Offscreen pause. Reduced motion. High-DPI canvas. Accessible labels. Auto light/dark.

9 STATES / 2 VARIANTS / POINTER REACTIVE
diff --git a/demo/styles.css b/demo/styles.css index e5ea091..3aed755 100644 --- a/demo/styles.css +++ b/demo/styles.css @@ -7,3 +7,5 @@ @media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}} .heritage-section{padding-top:90px}.heritage-intro{color:var(--muted);font-size:13px;line-height:1.7;max-width:680px;margin:0 0 18px}.heritage-toolbar{margin:14px 0 23px}.heritage-card{cursor:default}.heritage-card:hover{transform:none}.heritage-halo{width:140px;height:140px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:radial-gradient(circle,rgba(128,161,194,.07),transparent 68%)}.heritage-credit{font-size:11px;color:var(--muted);line-height:1.8;margin:25px 0 0}.heritage-credit a{color:var(--accent)} + +.waiting-reference{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:cover;border-top:1px solid var(--line)} diff --git a/docs/PUBLIC_NPMJS.md b/docs/PUBLIC_NPMJS.md index b080955..679cc79 100644 --- a/docs/PUBLIC_NPMJS.md +++ b/docs/PUBLIC_NPMJS.md @@ -1,6 +1,6 @@ # Publishing to the public npmjs.org registry -GitHub Packages (`npm.pkg.github.com`) and the public npm registry (`registry.npmjs.org`) are separate. The repository's source version is `@firexcore/agent-orbs@0.2.0`; publishing there requires control of the `@firexcore` npmjs scope. +GitHub Packages (`npm.pkg.github.com`) and the public npm registry (`registry.npmjs.org`) are separate. The repository's source version is `@firexcore/agent-orbs@0.3.0`; publishing there requires control of the `@firexcore` npmjs scope. The publish workflow is `.github/workflows/publish-npmjs.yml`. It checks the package/version and source repository, builds, runs tests, confirms required ESM/CJS exports and upstream license notices, runs `npm pack --dry-run`, and publishes with `--access public`. For the initial 0.2.0 release, provenance is temporarily disabled in the workflow because a duplicate Sigstore transparency-log entry returned 409. It verifies public registry metadata with delayed polling before reporting success. It does not modify the GitHub Packages release. @@ -27,8 +27,8 @@ Once authenticated, a push changing the workflow on `main` runs the publish auto Independently verify at https://www.npmjs.com/package/@firexcore/agent-orbs and by using: ```bash -npm view @firexcore/agent-orbs@0.2.0 version --registry=https://registry.npmjs.org/ -npm install @firexcore/agent-orbs@0.2.0 --registry=https://registry.npmjs.org/ +npm view @firexcore/agent-orbs@0.3.0 version --registry=https://registry.npmjs.org/ +npm install @firexcore/agent-orbs@0.3.0 --registry=https://registry.npmjs.org/ ``` Do not claim npmjs publication solely because GitHub CI, GitHub Packages or Vercel succeeded. diff --git a/package.json b/package.json index c8d0723..61ab004 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firexcore/agent-orbs", - "version": "0.2.0", + "version": "0.3.0", "private": false, "description": "Procedural agent orbs with original states plus opt-in interactive contour variants", "type": "module", @@ -12,6 +12,7 @@ "dist", "LICENSE", "README.md", + "preview/waiting/*.webp", "third_party/thinking-orbs/LICENSE", "third_party/thinking-orbs/NOTICE.md" ], diff --git a/preview/core/core-types.js b/preview/core/core-types.js index 95158ae..9c212c2 100644 --- a/preview/core/core-types.js +++ b/preview/core/core-types.js @@ -1 +1,2 @@ -export const ORB_STATES = ['working', 'searching', 'solving', 'listening', 'connecting', 'weaving', 'composing', 'breathing', 'shaping']; +export const ORB_STATES = ['working', 'searching', 'solving', 'listening', 'connecting', 'weaving', 'composing', 'breathing', 'shaping', 'waiting']; +export const WAITING_VARIANTS = ['fold', 'aperture', 'wave']; diff --git a/preview/core/scenes.js b/preview/core/scenes.js index 1de0b76..64849b4 100644 --- a/preview/core/scenes.js +++ b/preview/core/scenes.js @@ -1,4 +1,5 @@ import { TAU, clamp, distAngle, fibonacciPoint, hash, mix, rotate, smooth, sphere, vec } from './geometry.js'; +import { buildWaitingScene } from './waiting.js'; const make = () => ({ dots: [], lines: [] }); const dot = (scene, x, y, z, r = 1, a = 1, hot = 0) => { const result = { x, y, z, r, a: clamp(a), hot: clamp(hot) }; @@ -7,8 +8,10 @@ const dot = (scene, x, y, z, r = 1, a = 1, hot = 0) => { }; const from3 = (scene, p, r = 1, a = 1, hot = 0) => dot(scene, p.x, p.y, p.z, r, a, hot); /** Build a full animation frame in normalized -1..1 coordinates; no Canvas or React imports. */ -export function buildScene(state, seconds, compact = false) { +export function buildScene(state, seconds, compact = false, waitingVariant = 'fold') { const t = Number.isFinite(seconds) ? seconds : 0; + if (state === 'waiting') + return buildWaitingScene(waitingVariant, t, compact); const s = make(); const density = compact ? 0.55 : 1; switch (state) { diff --git a/preview/core/waiting.js b/preview/core/waiting.js new file mode 100644 index 0000000..15e6fc3 --- /dev/null +++ b/preview/core/waiting.js @@ -0,0 +1,74 @@ +import { TAU, distAngle, hash, mix, rotate, sphere, vec } from './geometry.js'; +export const WAITING_DESIGNS = { + fold: { label: 'Particle Fold', description: 'A light travels along a folded particle surface.' }, + aperture: { label: 'Particle Aperture', description: 'A four-lobed volume gently opens and relaxes.' }, + wave: { label: 'Inner Wave', description: 'A moving wave lights up the inside of a stable particle volume.' } +}; +const PERIOD = 5.6; +function intensity(angle, phase) { + return Math.exp(-((distAngle(angle, phase) / 0.58) ** 2)); +} +/** All variants share a continuous cycle and the original depth-sorted particle renderer. */ +export function buildWaitingScene(variant, seconds, compact) { + const phase = (seconds % PERIOD) / PERIOD * TAU; + const dots = []; + const columns = compact ? 14 : 30; + const rows = compact ? 6 : 14; + const yaw = 0.15 + 0.08 * Math.sin(phase); + const add = (x, y, z, roll, hot, opacity = 0.60) => { + const point = rotate(vec(x, y, z), yaw, -0.20, roll); + const variation = hash(dots.length); + dots.push({ ...point, r: (compact ? 0.73 : 0.61) + 0.18 * variation + 0.23 * hot, a: opacity + 0.30 * hot, hot }); + }; + switch (variant) { + case 'aperture': + // The four bulges taper into the center opening of a tilted particle torus. + for (let i = 0; i < columns; i++) { + const around = i / columns * TAU; + const lobe = 0.5 + 0.5 * Math.cos(4 * around + 0.45); + const centerRadius = 0.55 + 0.075 * lobe; + const thickness = 0.12 + 0.15 * lobe + 0.025 * Math.sin(phase); + for (let j = 0; j < rows; j++) { + const cross = (j + (i % 2) / 2) / rows * TAU; + const radius = centerRadius + Math.cos(cross) * thickness; + const hot = intensity(around, phase) * (0.3 + 0.7 * (1 - Math.cos(cross)) / 2); + add(radius * Math.cos(around), radius * Math.sin(around), Math.sin(cross) * thickness * 1.18, 0.20, hot); + } + } + break; + case 'wave': + // Three nested layers keep the travelling wave inside the lenticular volume. + for (const layer of compact ? [0.95, 0.62] : [1, 0.77, 0.54]) { + const count = Math.round(columns * layer); + for (let i = 0; i < count; i++) { + const longitude = (i + layer * 0.23) / count * TAU; + const wave = 0.31 * Math.sin(2 * longitude - phase); + for (let j = 0; j < rows; j++) { + const latitude = mix(-1.35, 1.35, (j + 0.5 * (i % 2)) / (rows - 0.5)); + const point = sphere(latitude, longitude); + const band = Math.exp(-((latitude - wave) ** 2) / 0.075); + const hot = band * intensity(longitude, phase) * (layer < 0.9 ? 1 : 0.35); + add(0.97 * point.x * layer, 0.51 * point.y * layer, 0.77 * point.z * layer, -0.26, hot, layer < 0.9 ? 0.42 : 0.62); + } + } + } + break; + default: + // A rolled particle membrane creates an S-shaped crease with no solid surface. + for (let i = 0; i < columns; i++) { + const along = mix(-1, 1, i / (columns - 1)); + const twist = 1.40 * along + 0.14 * Math.sin(phase + 2 * along); + const width = 0.60 * (0.69 + 0.31 * Math.sin((along + 1) / 2 * Math.PI)); + for (let j = 0; j < rows; j++) { + const across = mix(-1, 1, (j + 0.5 * (i % 2)) / (rows - 0.5)); + const bend = 0.20 * Math.sin(Math.PI * across); + const y = across * width * Math.cos(twist) - bend * Math.sin(twist); + const z = across * width * Math.sin(twist) + bend * Math.cos(twist); + const crease = Math.exp(-((across + 0.17 * Math.sin(3 * along)) ** 2) / 0.14); + const hot = crease * intensity(along * Math.PI, phase); + add(0.82 * along, y, z, 0.35, hot); + } + } + } + return { dots, lines: [] }; +} diff --git a/preview/index.html b/preview/index.html index d5c750d..fa291c8 100644 --- a/preview/index.html +++ b/preview/index.html @@ -6,7 +6,7 @@ - + @@ -35,7 +35,7 @@
-
PROCEDURAL MOTION SYSTEM V0.2
+
PROCEDURAL MOTION SYSTEM V0.3

A language for
systems in motion.

Meaningful, real-time visual feedback for AI agents and operational interfaces. Original procedural geometry, contour animations, and a faithful monochrome lattice family with purpose-tuned 32–128px variants.

@@ -43,7 +43,7 @@

A language for
systems in mot View source

-
09ORIGINAL STATES
+
10ORIGINAL STATES
09CONTOUR STATES
@@ -92,8 +92,12 @@

A language for
systems in mot

- + +
+

Waiting for a response

+ +
diff --git a/preview/preview.js b/preview/preview.js index b3a23f9..6953907 100644 --- a/preview/preview.js +++ b/preview/preview.js @@ -1,6 +1,7 @@ import { buildScene } from './core/scenes.js'; import { paint } from './core/render.js'; -import { ORB_STATES } from './core/core-types.js'; +import { ORB_STATES, WAITING_VARIANTS } from './core/core-types.js'; +import { WAITING_DESIGNS } from './core/waiting.js'; import { ThinkingOrb, ORB_STATES as CONTOUR_STATES } from './heritage/index.js'; const $ = id => document.getElementById(id); @@ -20,13 +21,14 @@ const descriptions = { const messages = { working:'PROCESSING',searching:'SEARCHING',solving:'ANALYZING', listening:'LISTENING',connecting:'CONNECTING',weaving:'PLANNING', - composing:'COMPOSING',breathing:'WAITING',shaping:'SHAPING', + composing:'COMPOSING',breathing:'WAITING',shaping:'SHAPING',waiting:'WAITING', idle:'READY',responding:'RESPONDING' }; const reducedQuery = window.matchMedia('(prefers-reduced-motion: reduce)'); let reduced = reducedQuery.matches; let mode = 'original', light = false, paused = false, speed = 1; let selectedOriginal = 'working', selectedContour = 'responding', selectedMono = 'listening', variant = 'contour'; +let selectedWaitingVariant; let featureState = 'responding', pointerEnabled = true; let clock = 0, previous = 0; const originalInstances = []; @@ -41,7 +43,7 @@ function originalInstance(canvas, state, size, options={}) { const dpr = Math.min(2, Math.max(1, window.devicePixelRatio || 1)); canvas.width = Math.round(size*dpr); canvas.height = Math.round(size*dpr); canvas.style.width = size+'px'; canvas.style.height = size+'px'; - const instance = {canvas, state, size, dpr, fixedDark: !!options.fixedDark, visible:true, ctx:canvas.getContext('2d')}; + const instance = {canvas, state, waitingVariant: options.waitingVariant, size, dpr, fixedDark: !!options.fixedDark, visible:true, ctx:canvas.getContext('2d')}; originalInstances.push(instance); return instance; } @@ -54,22 +56,41 @@ const intersection = typeof IntersectionObserver === 'undefined' ? null : }),{rootMargin:'50px'}); function watch(instance){intersection?.observe(instance.canvas);} -function makeOriginalCard(state,index) { +function makeOriginalCard(state,index,waitingVariant) { + const design = waitingVariant ? WAITING_DESIGNS[waitingVariant] : null; + const label = design ? design.label : state; const card = document.createElement('button'); card.type='button';card.className='orb-card'; card.dataset.state=state; - card.setAttribute('aria-pressed',String(state===selectedOriginal)); - card.innerHTML = '
'+String(index+1).padStart(2,'0')+' / 09'+ - 'ORIGINAL
'+ - '

'+state+'

'+descriptions[state]+'

'; - const orb = originalInstance(card.querySelector('canvas'),state,156); + if (waitingVariant) card.dataset.waitingVariant=waitingVariant; + card.setAttribute('aria-pressed',String(state===selectedOriginal && waitingVariant===selectedWaitingVariant)); + card.innerHTML = '
'+String(index+1).padStart(2,'0')+(design?' / 03':' / 09')+''+ + ''+(design?'WAITING':'ORIGINAL')+'
'+ + '

'+label+'

'+(design?.description ?? descriptions[state])+'

'; + const orb = originalInstance(card.querySelector('canvas'),state,156,{waitingVariant}); watch(orb); + if (design) { + const compact = document.createElement('canvas'); + compact.className='waiting-compact'; + compact.setAttribute('role','img'); + compact.setAttribute('aria-label',label+' at 24 pixels'); + card.querySelector('.orb-art').appendChild(compact); + watch(originalInstance(compact,state,24,{waitingVariant})); + const reference = document.createElement('img'); + reference.className='waiting-reference'; + reference.src='./waiting/'+waitingVariant+'.webp'; + reference.alt=label+' concept reference'; + reference.loading='lazy'; + reference.width=reference.height=768; + card.appendChild(reference); + } card.addEventListener('click',()=>{ - selectedOriginal=state;hero.state=state; + selectedOriginal=state;selectedWaitingVariant=waitingVariant; + hero.state=state;hero.waitingVariant=waitingVariant; $('hero-status').textContent=messages[state]; - hero.canvas.setAttribute('aria-label','Live animated '+state+' orb'); - document.querySelectorAll('#original-grid .orb-card').forEach(el=>{ - const active=el.dataset.state===state; + hero.canvas.setAttribute('aria-label','Live animated '+label+' orb'); + document.querySelectorAll('#original-grid .orb-card, #waiting-grid .orb-card').forEach(el=>{ + const active=el.dataset.state===state && el.dataset.waitingVariant===waitingVariant; el.classList.toggle('active',active);el.setAttribute('aria-pressed',String(active)); }); if(mode==='original')syncIntegration(); @@ -77,7 +98,8 @@ function makeOriginalCard(state,index) { if(state===selectedOriginal)card.classList.add('active'); return card; } -ORB_STATES.forEach((state,i)=>$('original-grid').appendChild(makeOriginalCard(state,i))); +ORB_STATES.filter(state=>state!=='waiting').forEach((state,i)=>$('original-grid').appendChild(makeOriginalCard(state,i))); +WAITING_VARIANTS.forEach((design,i)=>$('waiting-grid').appendChild(makeOriginalCard('waiting',i,design))); watch(hero);watch(integration); function makeContourCard(state,index) { @@ -172,10 +194,10 @@ function drawOriginal(instance,time){ if(!instance.visible||!instance.ctx)return; if(instance===integration && mode!=='original')return; const palette=palettes[instance.fixedDark?'dark':light?'light':'dark']; - const {ctx,dpr,size,state}=instance; + const {ctx,dpr,size,state,waitingVariant}=instance; ctx.setTransform(dpr,0,0,dpr,0,0); ctx.shadowBlur=0; - paint(ctx,buildScene(state,time,size<40),{diameter:size,ink:palette.ink,accent:palette.accent}); + paint(ctx,buildScene(state,time,size<40,waitingVariant),{diameter:size,ink:palette.ink,accent:palette.accent}); } function frame(now) { const delta=previous?Math.min(.06,(now-previous)/1000):0; @@ -191,6 +213,7 @@ function switchMode(next){ if(next==='mono')ensureMonoGallery(); mode=next; $('original-grid').hidden=next!=='original'; + $('waiting').hidden=next!=='original'; $('contour-grid').hidden=next!=='contour'; $('mono-grid').hidden=next!=='mono'; $('mono-intro').hidden=next!=='mono'; @@ -201,10 +224,10 @@ function switchMode(next){ } const names={original:'ORIGINAL CANVAS ENGINE',contour:'INTERACTIVE CONTOUR FAMILY',mono:'MONO LATTICE · ORIGINAL HALFTONE DOTS'}; $('gallery-heading').textContent=names[next]; - $('gallery-count').textContent=next==='mono'?'09 STATES · 04 NATIVE SIZES':'09 STATES · '+(next==='original'?'ORIGINAL':'CONTOUR + CLASSIC'); + $('gallery-count').textContent=next==='mono'?'09 STATES · 04 NATIVE SIZES':next==='original'?'10 STATES · 3 WAITING DESIGNS':'09 STATES · CONTOUR + CLASSIC'; $('variant-control').hidden=next!=='contour'; const notes={ - original:'Original FireXCore engine: nine independently authored mathematical scenes, implemented with Canvas 2D. No WebGL or prerecorded animation.', + original:'Original FireXCore engine: ten procedural states, including three Waiting designs, implemented with Canvas 2D. No WebGL or prerecorded animation.', contour:'Optional interactive contour family, adapted under MIT from Schoolees/thinking-orbs and Jakub Antalik.', mono:'Mono Lattice uses the upstream classic monochrome dot renderer and native state/size-specific presets (128, 96, 64, 32px). No FireXCore color palette, glow, resizing, or contour substitution. MIT attribution preserved.' }; @@ -227,6 +250,7 @@ function syncIntegration(){ canvas.style.width='152px'; canvas.style.height='152px'; integration.state=selectedOriginal; + integration.waitingVariant=selectedWaitingVariant; $('integration-label').textContent=messages[selectedOriginal]; } else { const state=mode==='mono'?selectedMono:selectedContour; @@ -243,7 +267,7 @@ function syncIntegration(){ function writeCode(){ let value; if(mode==='original') { - value="import { AgentOrb } from '@firexcore/agent-orbs';\n\n"; + value="import { AgentOrb } from '@firexcore/agent-orbs';\n\n"; } else if(mode==='mono') { value="import { MonoLatticeOrb } from '@firexcore/agent-orbs';\n\n"; } else { diff --git a/preview/styles.css b/preview/styles.css index 9ebe11c..2a6e9b7 100644 --- a/preview/styles.css +++ b/preview/styles.css @@ -123,3 +123,6 @@ body[data-theme=light] .integration-preview[data-orb-family=mono] .selected-labe @media(max-width:1000px){.mono-grid{grid-template-columns:repeat(2,minmax(0,1fr))}} @media(max-width:660px){.mono-grid{grid-template-columns:1fr}.mono-intro{align-items:start;flex-direction:column;gap:10px}} @media(max-width:360px){.mono-card{padding:18px 15px}.mono-sizes{gap:12px 7px}} + +.waiting-section{margin-top:32px;scroll-margin-top:24px}.waiting-section[hidden]{display:none}.waiting-section>h3{margin:0 0 14px}.waiting-reference{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:cover}.orb-art .waiting-compact{position:absolute;right:14px;bottom:14px} +@media(max-width:480px){.nav-inner{flex-wrap:wrap;gap:8px 12px;padding-block:10px}.brand{gap:8px}.nav-cta{flex:none;gap:8px}} diff --git a/preview/waiting/aperture.webp b/preview/waiting/aperture.webp new file mode 100644 index 0000000..55f2b25 Binary files /dev/null and b/preview/waiting/aperture.webp differ diff --git a/preview/waiting/fold.webp b/preview/waiting/fold.webp new file mode 100644 index 0000000..62ac12f Binary files /dev/null and b/preview/waiting/fold.webp differ diff --git a/preview/waiting/wave.webp b/preview/waiting/wave.webp new file mode 100644 index 0000000..acb76cf Binary files /dev/null and b/preview/waiting/wave.webp differ diff --git a/scripts/build-gallery-svg.mjs b/scripts/build-gallery-svg.mjs index cff7955..3fd4310 100644 --- a/scripts/build-gallery-svg.mjs +++ b/scripts/build-gallery-svg.mjs @@ -1,14 +1,16 @@ import { writeFileSync } from 'node:fs'; import { buildScene } from '../preview/core/scenes.js'; -import { ORB_STATES } from '../preview/core/core-types.js'; -const W = 1000, H = 660; +import { ORB_STATES, WAITING_VARIANTS } from '../preview/core/core-types.js'; +import { WAITING_DESIGNS } from '../preview/core/waiting.js'; +const entries = ORB_STATES.flatMap(state => state === 'waiting' ? WAITING_VARIANTS.map(variant => ({ state, variant })) : [{ state }]); +const W = 1000, H = 80 + Math.ceil(entries.length / 3) * 204 - 16; const tileW = 308, tileH = 188, left = 18, top = 80, space = 16; -let markup = [``,``,`FireXCore / Agent Orbs`,`NINE PROCEDURAL STATES / ORIGINAL CANVAS ENGINE`]; -for (let i = 0; i < ORB_STATES.length; i++) { - const state = ORB_STATES[i], col = i % 3, row = Math.floor(i / 3); +let markup = [``,``,`FireXCore / Agent Orbs`,`TEN PROCEDURAL STATES / ORIGINAL CANVAS ENGINE`]; +for (let i = 0; i < entries.length; i++) { + const { state, variant } = entries[i], col = i % 3, row = Math.floor(i / 3); const x = left+col*(tileW+space), y=top+row*(tileH+space); markup.push(``); - const frame = buildScene(state, 1.9, false); + const frame = buildScene(state, 1.9, false, variant); const centerX=x+tileW/2, centerY=y+80, radius=57; const project=d=>({x:centerX+d.x*radius*(2.9/(2.9-d.z*.45)), y:centerY+d.y*radius*(2.9/(2.9-d.z*.45))}); for(const seg of frame.lines){ const a=project(seg.a), b=project(seg.b); markup.push(``); } @@ -17,7 +19,7 @@ for (let i = 0; i < ORB_STATES.length; i++) { const r=Math.max(.55, (1.05*d.r*(.68+depth*.55)*2.9/(2.9-d.z*.45))); markup.push(``); } - markup.push(`${state[0].toUpperCase()+state.slice(1)}`,`${String(i+1).padStart(2,'0')} / 09`); + markup.push(`${variant ? WAITING_DESIGNS[variant].label : state[0].toUpperCase()+state.slice(1)}`,`${String(i+1).padStart(2,'0')} / ${entries.length}`); } markup.push(``); writeFileSync(new URL('../assets/gallery.svg',import.meta.url),markup.join('\n')); diff --git a/scripts/test-core.mjs b/scripts/test-core.mjs index 45d8a80..2ecd7db 100644 --- a/scripts/test-core.mjs +++ b/scripts/test-core.mjs @@ -25,4 +25,4 @@ for (let i = 0; i < 60; i++) { assert(Math.abs(Math.hypot(x, y, z) - 1) < 1e-9); } assert.notDeepEqual(buildScene('shaping', 0), buildScene('shaping', 2.7)); -console.log(`PASS: ${checked} independent geometry frame checks, all 9 states, 2 sizes`); +console.log(`PASS: ${checked} independent geometry frame checks, all ${ORB_STATES.length} states, 2 sizes`); diff --git a/scripts/verify-showcase.mjs b/scripts/verify-showcase.mjs index 4b8de6b..c179955 100644 --- a/scripts/verify-showcase.mjs +++ b/scripts/verify-showcase.mjs @@ -1,15 +1,19 @@ import assert from 'node:assert/strict'; import { readFileSync, existsSync } from 'node:fs'; import { execFileSync } from 'node:child_process'; -import { ORB_STATES } from '../preview/core/core-types.js'; +import { ORB_STATES, WAITING_VARIANTS } from '../preview/core/core-types.js'; const html=readFileSync(new URL('../preview/index.html',import.meta.url),'utf8'); const js=readFileSync(new URL('../preview/preview.js',import.meta.url),'utf8'); const css=readFileSync(new URL('../preview/styles.css',import.meta.url),'utf8'); const readme=readFileSync(new URL('../README.md',import.meta.url),'utf8'); -for(const id of ['hero-orb','original-grid','contour-grid','mono-grid','mono-intro','tab-mono','feature-orb','integration-orb','theme','speed','pause','variant','copy-code','feature-state','pointer']){ +for(const id of ['hero-orb','original-grid','waiting-grid','contour-grid','mono-grid','mono-intro','tab-mono','feature-orb','integration-orb','theme','speed','pause','variant','copy-code','feature-state','pointer']){ assert(html.includes('id="'+id+'"'), 'Missing live control: '+id); } -assert.equal(ORB_STATES.length,9); +assert.equal(ORB_STATES.length,10); +assert(ORB_STATES.includes('waiting')); +for (const variant of WAITING_VARIANTS) { + assert(existsSync(new URL('../preview/waiting/'+variant+'.webp', import.meta.url)), 'Missing Waiting design: '+variant); +} assert(js.includes("from './core/scenes.js'"),'Demo must use canonical original engine'); assert(js.includes("from './heritage/index.js'"),'Demo must use licensed contour engine'); assert(js.includes("function makeMonoCard"),'Mono Lattice gallery must be live'); diff --git a/src/AgentOrb.tsx b/src/AgentOrb.tsx index 7159373..0a55333 100644 --- a/src/AgentOrb.tsx +++ b/src/AgentOrb.tsx @@ -8,12 +8,12 @@ import type { AgentOrbProps, OrbState } from './types'; const LABEL: Record = { working: 'Processing', searching: 'Searching', solving: 'Analyzing', listening: 'Listening', connecting: 'Connecting', weaving: 'Planning', - composing: 'Composing', breathing: 'Waiting', shaping: 'Generating design' + composing: 'Composing', breathing: 'Waiting', shaping: 'Generating design', waiting: 'Waiting for response' }; /** Accessible, independent 3D-inspired canvas status ornament. */ export function AgentOrb({ - state = 'working', size = 'regular', theme = 'auto', + state = 'working', waitingVariant = 'fold', size = 'regular', theme = 'auto', speed = 1, paused = false, color, accent, style, 'aria-label': ariaLabel, ...canvasProps }: AgentOrbProps) { @@ -31,10 +31,10 @@ export function AgentOrb({ const ctx = canvas.getContext('2d'); if (!ctx) return; const ink = color ?? (mode === 'dark' ? '#f4f7ff' : '#172332'); - const activeInk = accent ?? ink; + const activeInk = accent ?? (state === 'waiting' && color === undefined ? (mode === 'dark' ? '#91d3ff' : '#236abc') : ink); const render = (seconds: number) => { ctx.setTransform(ratio, 0, 0, ratio, 0, 0); - paint(ctx, buildScene(state, seconds, diameter < 40), { ink, accent: activeInk, diameter }); + paint(ctx, buildScene(state, seconds, diameter < 40, waitingVariant), { ink, accent: activeInk, diameter }); }; const now = () => typeof performance === 'undefined' ? 0 : performance.now() / 1000; // Initial deterministic paint: screenshots and reduced-motion are never blank. @@ -51,7 +51,7 @@ export function AgentOrb({ start(); } return () => { stop(); observer?.disconnect(); }; - }, [state, diameter, mode, speed, paused, reduced, color, accent]); + }, [state, waitingVariant, diameter, mode, speed, paused, reduced, color, accent]); return ({ dots: [], lines: [] }); const dot = (scene: Scene, x: number, y: number, z: number, r = 1, a = 1, hot = 0): Dot => { @@ -10,8 +11,9 @@ const dot = (scene: Scene, x: number, y: number, z: number, r = 1, a = 1, hot = const from3 = (scene: Scene, p: {x: number; y: number; z: number}, r = 1, a = 1, hot = 0) => dot(scene, p.x, p.y, p.z, r, a, hot); /** Build a full animation frame in normalized -1..1 coordinates; no Canvas or React imports. */ -export function buildScene(state: OrbState, seconds: number, compact = false): Scene { +export function buildScene(state: OrbState, seconds: number, compact = false, waitingVariant: WaitingVariant = 'fold'): Scene { const t = Number.isFinite(seconds) ? seconds : 0; + if (state === 'waiting') return buildWaitingScene(waitingVariant, t, compact); const s = make(); const density = compact ? 0.55 : 1; switch (state) { diff --git a/src/types.ts b/src/types.ts index 2cd5da2..5c5fc0a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,6 @@ -import type { OrbState } from './core-types'; -export { ORB_STATES } from './core-types'; -export type { OrbState } from './core-types'; +import type { OrbState, WaitingVariant } from './core-types'; +export { ORB_STATES, WAITING_VARIANTS } from './core-types'; +export type { OrbState, WaitingVariant } from './core-types'; import type { CanvasHTMLAttributes } from 'react'; export type OrbTheme = 'auto' | 'dark' | 'light'; @@ -8,6 +8,8 @@ export type OrbSize = 'small' | 'regular' | number; export interface AgentOrbProps extends Omit, 'color'> { state?: OrbState; + /** Design used when state is waiting. Defaults to fold. */ + waitingVariant?: WaitingVariant; size?: OrbSize; /** Auto detects theme from the closest theme container or OS. */ theme?: OrbTheme; diff --git a/src/waiting.ts b/src/waiting.ts new file mode 100644 index 0000000..2ee3650 --- /dev/null +++ b/src/waiting.ts @@ -0,0 +1,80 @@ +import type { Dot, Scene, WaitingVariant } from './core-types'; +import { TAU, distAngle, hash, mix, rotate, sphere, vec } from './geometry'; + +export const WAITING_DESIGNS = { + fold: { label: 'Particle Fold', description: 'A light travels along a folded particle surface.' }, + aperture: { label: 'Particle Aperture', description: 'A four-lobed volume gently opens and relaxes.' }, + wave: { label: 'Inner Wave', description: 'A moving wave lights up the inside of a stable particle volume.' } +} as const satisfies Record; + +const PERIOD = 5.6; + +function intensity(angle: number, phase: number): number { + return Math.exp(-((distAngle(angle, phase) / 0.58) ** 2)); +} + +/** All variants share a continuous cycle and the original depth-sorted particle renderer. */ +export function buildWaitingScene(variant: WaitingVariant, seconds: number, compact: boolean): Scene { + const phase = (seconds % PERIOD) / PERIOD * TAU; + const dots: Dot[] = []; + const columns = compact ? 14 : 30; + const rows = compact ? 6 : 14; + const yaw = 0.15 + 0.08 * Math.sin(phase); + const add = (x: number, y: number, z: number, roll: number, hot: number, opacity = 0.60) => { + const point = rotate(vec(x, y, z), yaw, -0.20, roll); + const variation = hash(dots.length); + dots.push({ ...point, r: (compact ? 0.73 : 0.61) + 0.18 * variation + 0.23 * hot, a: opacity + 0.30 * hot, hot }); + }; + + switch (variant) { + case 'aperture': + // The four bulges taper into the center opening of a tilted particle torus. + for (let i = 0; i < columns; i++) { + const around = i / columns * TAU; + const lobe = 0.5 + 0.5 * Math.cos(4 * around + 0.45); + const centerRadius = 0.55 + 0.075 * lobe; + const thickness = 0.12 + 0.15 * lobe + 0.025 * Math.sin(phase); + for (let j = 0; j < rows; j++) { + const cross = (j + (i % 2) / 2) / rows * TAU; + const radius = centerRadius + Math.cos(cross) * thickness; + const hot = intensity(around, phase) * (0.3 + 0.7 * (1 - Math.cos(cross)) / 2); + add(radius * Math.cos(around), radius * Math.sin(around), Math.sin(cross) * thickness * 1.18, 0.20, hot); + } + } + break; + case 'wave': + // Three nested layers keep the travelling wave inside the lenticular volume. + for (const layer of compact ? [0.95, 0.62] : [1, 0.77, 0.54]) { + const count = Math.round(columns * layer); + for (let i = 0; i < count; i++) { + const longitude = (i + layer * 0.23) / count * TAU; + const wave = 0.31 * Math.sin(2 * longitude - phase); + for (let j = 0; j < rows; j++) { + const latitude = mix(-1.35, 1.35, (j + 0.5 * (i % 2)) / (rows - 0.5)); + const point = sphere(latitude, longitude); + const band = Math.exp(-((latitude - wave) ** 2) / 0.075); + const hot = band * intensity(longitude, phase) * (layer < 0.9 ? 1 : 0.35); + add(0.97 * point.x * layer, 0.51 * point.y * layer, 0.77 * point.z * layer, -0.26, hot, layer < 0.9 ? 0.42 : 0.62); + } + } + } + break; + default: + // A rolled particle membrane creates an S-shaped crease with no solid surface. + for (let i = 0; i < columns; i++) { + const along = mix(-1, 1, i / (columns - 1)); + const twist = 1.40 * along + 0.14 * Math.sin(phase + 2 * along); + const width = 0.60 * (0.69 + 0.31 * Math.sin((along + 1) / 2 * Math.PI)); + for (let j = 0; j < rows; j++) { + const across = mix(-1, 1, (j + 0.5 * (i % 2)) / (rows - 0.5)); + const bend = 0.20 * Math.sin(Math.PI * across); + const y = across * width * Math.cos(twist) - bend * Math.sin(twist); + const z = across * width * Math.sin(twist) + bend * Math.cos(twist); + const crease = Math.exp(-((across + 0.17 * Math.sin(3 * along)) ** 2) / 0.14); + const hot = crease * intensity(along * Math.PI, phase); + add(0.82 * along, y, z, 0.35, hot); + } + } + } + return { dots, lines: [] }; +} diff --git a/tests/scenes.test.ts b/tests/scenes.test.ts index e1c5430..1e0b9af 100644 --- a/tests/scenes.test.ts +++ b/tests/scenes.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; import { buildScene } from '../src/scenes'; -import { ORB_STATES } from '../src/types'; +import { ORB_STATES, WAITING_VARIANTS } from '../src/types'; import { fibonacciPoint, rotate, smooth } from '../src/geometry'; describe('agent orb frame geometry', () => { @@ -22,6 +22,25 @@ describe('agent orb frame geometry', () => { } }); } + it('renders distinct Waiting designs with scalable, continuous motion', () => { + const regular = WAITING_VARIANTS.map(variant => buildScene('waiting', 0, false, variant)); + expect(regular[0]).toEqual(buildScene('waiting', 0)); + for (const [index, variant] of WAITING_VARIANTS.entries()) { + for (const compact of [false, true]) { + const frame = buildScene('waiting', 0, compact, variant); + expect(frame).toEqual(buildScene('waiting', 5.6, compact, variant)); + expect(frame).not.toEqual(buildScene('waiting', 2.1, compact, variant)); + for (const { x, y, z, r, a, hot } of frame.dots) { + expect([x, y, z, r, a, hot].every(Number.isFinite)).toBe(true); + expect(Math.max(Math.abs(x), Math.abs(y), Math.abs(z))).toBeLessThan(1.2); + expect(a).toBeGreaterThan(0); + expect(a).toBeLessThanOrEqual(1); + } + } + expect(buildScene('waiting', 0, true, variant).dots.length).toBeLessThan(regular[index].dots.length); + for (const other of regular.slice(index + 1)) expect(regular[index]).not.toEqual(other); + } + }); it('small preset reduces geometry count', () => { for (const state of ORB_STATES) expect(buildScene(state, 1, true).dots.length).toBeLessThan(buildScene(state, 1, false).dots.length); });