Files
openmotion/package.json
open-design-crew[bot] 88bf8804b6 Complete OpenDesign sign-in: failure handling, recovery, account panel and install-time connector (#423)
* Classify OpenDesign sign-in failures and handle billing refusals

Request the connector's jsonl-v1 sign-in stages under a per-attempt ID and
accept persisted credentials only when the control key, its ID, the runtime
key and the account ID are all present. Failed attempts report
setup_failed, authorization_expired or credentials_rejected from the
furthest stage reached, with the matching copy, and the service logs the
attempt progress without URLs, codes, identities or credentials.

Read an empty subscription tier as the Free plan. A failed billing read
clears plan and balance, keeps the session, keeps the HTTP status and
service code, and offers a refresh. A 401 from the billing read marks the
account reauth-required: account models become unavailable with an
explicit reason and Settings offers "Sign in again".

* Complete account image tasks and list connector speech models

Simulating the account flows with the pinned vela-cli 0.1.10 binary showed
two contract mismatches with the real connector:

- `image get --json` prints the downloaded asset instead of the task once
  the task has succeeded, so every account image job failed with an
  unexpected-task error. A ready asset without a task ID now completes the
  image job.
- `media models` reports speech models as `audio_speech` (and music as
  `audio_music`), so no account speech model was ever listed. Speech models
  now map to text-to-speech; music models stay excluded.

The fixture now mirrors both outputs, and the account reference documents
the connector's image parameter constraints.

* Classify OpenDesign sign-in failures and handle billing refusals

Request the connector's jsonl-v1 sign-in stages under a per-attempt ID and
accept persisted credentials only when the control key, its ID, the runtime
key and the account ID are all present. Failed attempts report
setup_failed, authorization_expired or credentials_rejected from the
furthest stage reached, with the matching copy, and the service logs the
attempt progress without URLs, codes, identities or credentials.

Read an empty subscription tier as the Free plan. A failed billing read
clears plan and balance, keeps the session, keeps the HTTP status and
service code, and offers a refresh. A 401 from the billing read marks the
account reauth-required: account models become unavailable with an
explicit reason and Settings offers "Sign in again".

* Complete account image tasks and list connector speech models

Simulating the account flows with the pinned vela-cli 0.1.10 binary showed
two contract mismatches with the real connector:

- `image get --json` prints the downloaded asset instead of the task once
  the task has succeeded, so every account image job failed with an
  unexpected-task error. A ready asset without a task ID now completes the
  image job.
- `media models` reports speech models as `audio_speech` (and music as
  `audio_music`), so no account speech model was ever listed. Speech models
  now map to text-to-speech; music models stay excluded.

The fixture now mirrors both outputs, and the account reference documents
the connector's image parameter constraints.

* Resume interrupted OpenDesign sign-ins and keep undelivered revocations

A sign-in whose credentials were saved but not yet confirmed by the service
now lets the connector confirm them on the next attempt. That resumed attempt
has no activation link; if the service refuses it, the connector rolls it back
and the same sign-in continues with a new authorization and link.

When the connector keeps credentials unconfirmed because the service could not
be reached (5xx, 408, 429, network), the attempt reports setup_failed instead
of credentials_rejected, since the next sign-in completes it.

Sign-out reads the connector's revocation result. If the service could not be
reached, the connector has already cleared the keys locally and keeps a
revocation record, so the credentials file stays. Revocations are retried on
the first account status read after startup and on each refresh, never
alongside a sign-in or sign-out, and the file is removed once nothing is left
to revoke.

* Explain how to install Vela when the sign-in connector is unavailable

* Prepare the account connector at startup and clarify the sign-in panel

Install the connector in the background after the service starts so the
first sign-in does not wait for npm; sign-in shares a preparation still
running and retries one that failed.

The account summary now reports whether the connector opened the
activation page and when the browser approved the sign-in while the
session and models are being set up. The panel keeps the activation link
as a fallback, leading with it only when the browser did not open, shows
a syncing step with no action, offers Retry after connection failures and
a feedback link after rejected credentials, shows the email once, and
says account models stay usable when billing cannot be read.

Each finished sign-in attempt reports one account_sign_in_result event
with its outcome, last stage, error kind and timings, and no account data.

* Report unreachable token exchange and credential writes as retryable setup failures

A failed token exchange or credential write accepted and stored nothing, so
it no longer reads as rejected credentials: a network failure during the
exchange or a local credentials write failure now reports setup_failed, and
the panel offers Retry instead of the contact-us feedback link. Exchange and
persist failures the connector actually rejects still report
credentials_rejected.

The fixture connector emits both scenarios, and the failure-classification
test asserts the retryable codes next to the unchanged rejection cases.

Generated-By: looper 0.16.2 (runner=fixer, agent=pi)

* Install the account connector with the source checkout's locked dependencies

Source installations now get @powerformer/vela-cli@0.1.10 from npm ci as a
locked devDependency, so sign-in no longer downloads the connector at
runtime. Application artifacts are built with --omit=dev and still exclude
it. The account service prefers the locked package, then an exact vela on
PATH, then the private install under the data directory, which stays as the
fallback for installations without the locked package.

* Give the install command when the account connector is unavailable

The connector_unavailable message now tells the user to run
npm install -g @powerformer/vela-cli@0.1.10 in a terminal and sign in
again. The next sign-in finds the exact vela on PATH, so no restart is
needed.

* Explain declined billing requests and refresh metrics after sign-in

* Read production billing through the authenticated summary API

* Rediscover the Vela connector when retrying sign-in

---------

Co-authored-by: heggria <bshengtao@gmail.com>
Co-authored-by: stevenguotj <stevenguotj@stevenguotjdeMacBook-Pro.local>
Co-authored-by: 罗高 <luogao@users.noreply.github.com>
2026-11-16 17:19:54 +08:00

101 lines
4.5 KiB
JSON

{
"name": "openmotion",
"version": "0.0.1",
"private": true,
"type": "module",
"engines": {
"node": ">=22.18.0"
},
"scripts": {
"dev": "npm run build:studio && node --env-file=.env.development --experimental-strip-types server.ts",
"mcp": "node --experimental-strip-types mcp.ts",
"start": "node --experimental-strip-types preview.ts",
"test": "node --experimental-strip-types --test tests/*.test.ts",
"check": "node --experimental-strip-types scripts/check.ts",
"package:plugin": "node --experimental-strip-types scripts/package.ts",
"package:phase1": "npm run build:studio && node --experimental-strip-types scripts/package.ts --mcp-profile=phase1",
"package:test": "node scripts/test-package.mjs",
"package:npm": "npm run build:studio && node scripts/package-npm.mjs",
"build:studio": "npm run build:inline && npm run build:template-cards && vite build --config studio/vite.config.ts",
"build:tracking": "tsc -p tracking/tsconfig.json",
"typecheck:studio": "tsc -p studio/tsconfig.json",
"design:tokens": "node --experimental-strip-types scripts/design-tokens.ts",
"design:check": "node --experimental-strip-types scripts/design-check.ts",
"pretest": "npm run build:studio",
"prepackage:plugin": "npm run build:studio",
"test:studio": "vitest run --config studio/vitest.config.ts",
"verify:export": "node --experimental-strip-types scripts/verify-export.ts",
"catalog:import": "node --experimental-strip-types scripts/import-hyperframes.ts",
"catalog:covers": "node --experimental-strip-types scripts/cache-template-covers.ts",
"catalog:metadata": "node --experimental-strip-types scripts/sync-template-metadata.ts",
"export:adapters": "node --experimental-strip-types scripts/export-adapters.ts",
"storage:check": "node --experimental-strip-types scripts/check-repository-storage.ts",
"templates:check": "node --experimental-strip-types scripts/check-template-library.ts",
"templates:export": "node --experimental-strip-types scripts/template-library.ts export",
"templates:manifest": "node --experimental-strip-types scripts/template-library.ts manifest",
"media:prepare": "node --experimental-strip-types scripts/prepare-pr-media.ts",
"media:pull": "node --experimental-strip-types scripts/repository-media.ts",
"design:dev": "node packages/design-system/workbench/server.js",
"design:test": "node --test packages/design-system/workbench/*.test.js",
"build:inline": "node scripts/build-inline-ui.mjs",
"typecheck:backend": "tsc --noEmit --target es2024 --module nodenext --moduleResolution nodenext --allowImportingTsExtensions --skipLibCheck --esModuleInterop mcp.ts phase1.ts inline-video.ts shared/phase1-tools.ts",
"typecheck:template-cards": "tsc -p mcp-ui/tsconfig.json",
"build:template-cards": "npm run typecheck:template-cards && node --experimental-strip-types scripts/build-template-cards.mjs"
},
"dependencies": {
"@hyperframes/core": "0.9.7",
"@hyperframes/parsers": "0.9.7",
"@hyperframes/player": "0.9.7",
"@hyperframes/sdk": "0.9.7",
"@hyperframes/shader-transitions": "0.9.7",
"@hyperframes/studio-server": "0.9.7",
"acorn": "8.19.0",
"fontkit": "2.0.4",
"gsap": "3.15.0",
"hyperframes": "0.9.7",
"puppeteer-core": "25.16.0"
},
"overrides": {
"undici": "7.30.1",
"@modelcontextprotocol/server": "2.4.0"
},
"devDependencies": {
"@base-ui/react": "1.7.0",
"@codemirror/autocomplete": "6.20.4",
"@codemirror/commands": "6.11.1",
"@codemirror/lang-css": "6.3.1",
"@codemirror/lang-html": "6.4.12",
"@codemirror/lang-javascript": "6.2.5",
"@codemirror/lang-markdown": "6.5.2",
"@codemirror/language": "6.13.1",
"@codemirror/search": "6.7.2",
"@codemirror/state": "6.7.6",
"@codemirror/view": "6.40.0",
"@lezer/highlight": "1.2.5",
"@mcp-b/global": "5.0.1",
"@modelcontextprotocol/ext-apps": "2.0.4",
"@phosphor-icons/react": "2.1.10",
"@powerformer/vela-cli": "0.1.10",
"@tailwindcss/vite": "4.3.3",
"@tanstack/react-virtual": "3.14.25",
"@types/node": "22.19.1",
"@types/react": "19.2.7",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "4.7.0",
"cn": "0.2.4",
"dockview-react": "8.3.1",
"esbuild": "0.28.2",
"fake-indexeddb": "6.2.5",
"happy-dom": "21.0.4",
"jsdom": "30.1.3",
"mediabunny": "1.45.3",
"react": "19.2.9",
"react-dom": "19.2.9",
"tailwindcss": "4.3.3",
"typescript": "5.9.3",
"vite": "6.4.5",
"vitest": "4.1.12",
"zustand": "5.0.11"
}
}