项目文件夹

文件
wehub-resource-sync e30e75b5d4
Changesets / Create Version PR (push) Has been cancelled
Deploy Shadcn Registry / Deploy Production (push) Has been cancelled
Template Metrics / LOC + Bundle Size (push) Has been cancelled
Code Quality / Oxlint + Oxfmt (push) Has been cancelled
Code Quality / Template Sync (push) Has been cancelled
Code Quality / Build Changed Packages (push) Has been cancelled
Code Quality / Test Changed Packages (push) Has been cancelled
Deploy Expo Example / Deploy Production (push) Has been cancelled
Deploy Ink Example / Deploy Production (push) Has been cancelled
Python Tests / pytest (assistant-stream, 3.10) (push) Has been cancelled
Python Tests / pytest (assistant-stream, 3.12) (push) Has been cancelled
Python Tests / pytest (assistant-ui-sync-server-api, 3.10) (push) Has been cancelled
Python Tests / pytest (assistant-ui-sync-server-api, 3.12) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:40:13 +08:00

17 KiB

@assistant-ui/store

0.2.19

Patch Changes

0.2.18

Patch Changes

  • #4392 4cc7eaa - chore: update peer and dependency ranges for @assistant-ui/tap 0.9 (@Yonom)

  • #4392 4cc7eaa - fix: preserve tap context across nested tap root rerenders and mark tap context as supported (@Yonom)

0.2.17

Patch Changes

  • #4385 ae59baf - feat: precompile packages with React Compiler (@Yonom)
    • aui-build runs React Compiler over packages that depend on tap and remaps react/compiler-runtime to the tap shim subpath, so compiled hooks and components work both in React components and inside tap resource renders
    • @assistant-ui/tap/react-shim exports useMemoCache (tap inside a resource render, React.__COMPILER_RUNTIME.c otherwise, with a React 18 polyfill); new @assistant-ui/tap/react-shim/compiler-runtime subpath mirrors react/compiler-runtime's c export
    • tap implements useSyncExternalStore and a no-op useDebugValue; useSubscribable now builds on useSyncExternalStore so its store reads stay visible to the compiler
    • AssistantProviderBase opts out via "use no memo" because the runtime receives options through an effect inside a re-rendered child element

0.2.16

Patch Changes

  • #4366 3e58253 - feat: host the assistant client with useTapHost so the tap commit runs in the passive phase (no paint blocking); AuiProvider mounts the host's commit effects ahead of its children's effects (@Yonom)

  • #4325 5a4f20e - chore: update @assistant-ui/tap dependency ranges to ^0.7.0 (@Yonom)

0.2.15

Patch Changes

  • #4318 1b6a0d6 - feat(tap): resources carry all hook arguments; elements are { hook, args } (@Yonom)

    A ResourceElement is now { hook, args } (was { type, props }): the underlying hook plus the full tuple of arguments to call it with. This lets a resource take multiple positional arguments, exactly like a hook, and makes hosting just hook(...args):

    const usePair = (a: number, b: string) => ({ a, b });
    const Pair = resource(usePair);
    const element = Pair(1, "hi"); // { hook: usePair, args: [1, "hi"] }
    

    The single-object case is unchanged ergonomically (Counter({ initialValue: 0 }) still works; its args is just [{ initialValue: 0 }]), so existing resources and call sites are unaffected. resource()'s overloads collapse into one variadic signature, and the fnSymbol / callResourceFn indirection is gone (the element holds the hook directly; renderResourceFiber calls fiber.hook(...args)).

    Breaking (internal/advanced):

    • The second type parameter of Resource / ResourceElement / ContravariantResource now means the argument tuple A extends readonly unknown[] rather than a single payload P. Explicit two-arg annotations must wrap the payload in a tuple (e.g. ResourceElement<R, [Props]>).
    • A resource's identity is now its hook. Reading element.props becomes element.args[0]; reading element.type becomes element.hook. attachTransformScopes is now keyed by (and called with) the hook rather than the factory.
    • useResource(element, deps)'s second arg is unchanged in behavior (renamed argsDeps).
  • #4318 1b6a0d6 - refactor: adopt the extracted-hook convention for resources (@Yonom)

    A resource body is a hook, so resources are now authored as a use-prefixed hook wrapped with resource():

    const useCounter = () => { ... };
    const Counter = resource(useCounter);
    

    resource() turns a hook into a Resource; useResource(Counter(props)) turns it back into a hook call. Extracting the body to a use-prefixed hook lets React's stock rules-of-hooks and exhaustive-deps lint resource bodies directly. No public API or runtime behavior changes.

  • #4318 1b6a0d6 - refactor: rename the root APIs to useTapRoot / createTapRoot and make them callback-based (@Yonom)

    useResourceRoot(element) is now useTapRoot(fn) and createResourceRoot().render(element) is now createTapRoot(fn). Both take a render callback instead of a pre-built resource element, so you no longer have to wrap a hook in resource() just to host it as a root. The callback must be a named function expression (so React's rules-of-hooks lints the body):

    // before
    const root = createResourceRoot();
    const handle = root.render(Counter());
    handle.getValue();
    
    // after
    const root = createTapRoot(function CounterRoot() {
      return useResource(Counter());
    });
    root.getValue();
    

    createTapRoot returns { getValue, subscribe, unmount } directly (no separate .render step).

    flushResourcesSync is also renamed to flushTapSync, to match the tap naming of the root APIs (and to stay distinct from react-dom's flushSync).

0.2.14

Patch Changes

  • #4306 15878d8 - chore: update dependencies (@Yonom)

  • #4282 01cf957 - refactor: rename the client composition and event hooks to the use* convention to match the tap resource API: tapClientResource -> useClientResource, tapClientLookup -> useClientLookup, tapClientList -> useClientList, tapAssistantClientRef -> useAssistantClientRef, tapAssistantEmit -> useAssistantEmit. (@Yonom)

0.2.13

Patch Changes

  • #4151 299d448 - chore: drop stale biome-ignore pragmas now that the repo lints with oxlint (@okisdev)

  • Updated dependencies [299d448]:

    • @assistant-ui/tap@0.5.14

0.2.12

Patch Changes

  • #4085 01244a5 - chore: update dependencies (@Yonom)

  • #4097 1e21076 - build(x-buildutils): migrate aui-build from ts.createProgram to tsdown with unbundle: true (@Yonom)

    Tsdown drives both JS and .d.ts emission. Reference-directive restoration is preserved (tsdown/oxc drop /// <reference> lines, so we re-inject them in a build:done hook). deps.skipNodeModulesBundle: true keeps the old "never bundle anything from node_modules" behavior — devDependencies stay external instead of getting inlined into dist.

    Side fixes the new strict dts pipeline surfaced:

    • @assistant-ui/tap: dropped the fnSymbol brand from the public ResourceElement type. It referenced an @internal symbol that stripInternal removed from emit, leaving the published .d.ts with a dangling reference.
    • @assistant-ui/store: un-marked ClientSchema as @internal. It was already re-exported from the public package index; treating the re-export as authoritative.
  • Updated dependencies [01244a5, 1e21076]:

    • @assistant-ui/tap@0.5.12

0.2.11

Patch Changes

  • #4069 db721df - fix(store): key Derived scopes by {source, query} so a meta change produces a new client function in the same render pass. Previously a Derived whose query changed (e.g. MessageByIndexProvider whose index prop changed across renders) kept its underlying resource fiber, and the get closure was updated via tapEffectEvent — which lags one commit. During the in-flight render after a meta change, child consumers reading through the derived scope could resolve through the previous closure and read an index the underlying store no longer had. Hashing the meta into the tapResources key forces the fiber to be replaced when meta changes, so the new clientFunction (and the new get) propagates through React context immediately. Also drops the unused dynamic-meta variant (Derived({ getMeta })); use static source/query. (@Yonom)

  • #4023 94548fa - docs: add JSDoc for useAui, useAuiState, useAuiEvent, AuiIf, and AuiProvider (@AVGVSTVS96)

  • Updated dependencies []:

    • @assistant-ui/tap@0.5.11

0.2.10

Patch Changes

  • #3962 b090acb - chore: update dependencies (@Yonom)

  • #3937 5fdf17e - fix: RenderChildrenWithAccessor no longer misses re-renders when state updates after access (@Yonom)

    The accessor previously reused a single ref as both an "accessed" sentinel and the cached snapshot. A useSyncExternalStore post-commit consistency call could repopulate that cache with the current state, causing later real updates (e.g. message.composer.isEditing flipping) to be masked. Access is now tracked with a dedicated flag so children that read item state via the render prop re-render correctly when the underlying state changes.

  • Updated dependencies [b090acb]:

    • @assistant-ui/tap@0.5.11

0.2.9

Patch Changes

0.2.8

Patch Changes

0.2.7

Patch Changes

  • c988db8: chore: update dependencies
  • Updated dependencies [c988db8]
    • @assistant-ui/tap@0.5.8

0.2.6

Patch Changes

  • bdce66f: chore: update dependencies
  • 209ae81: chore: remove aui-source export condition from package.json exports
  • 2dd0c9f: feat: add forwardTransformScopes utility
  • Updated dependencies [bdce66f]
  • Updated dependencies [209ae81]
    • @assistant-ui/tap@0.5.6

0.2.5

Patch Changes

  • 52403c3: chore: update dependencies
  • Updated dependencies [52403c3]
    • @assistant-ui/tap@0.5.5

0.2.4

Patch Changes

  • 28a987a: feat: SingleThreadList resource refactor: attachTransformScopes should mutate the scopes instead of cloning it
  • 736344c: chore: update dependencies
  • c71cb58: chore: update dependencies
  • Updated dependencies [736344c]
  • Updated dependencies [c71cb58]
    • @assistant-ui/tap@0.5.4

0.2.3

Patch Changes

  • 349f3c7: chore: update deps
  • Updated dependencies [349f3c7]
    • @assistant-ui/tap@0.5.3

0.2.2

Patch Changes

  • a845911: chore: update dependencies
  • Updated dependencies [a845911]
    • @assistant-ui/tap@0.5.2

0.2.1

Patch Changes

  • 36ef3a2: chore: update dependencies
  • fc98475: feat(store): move @assistant-ui/core and @assistant-ui/tap to peerDependencies to fix npm deduplication
  • a638f05: refactor(store): make store independent of core, add ScopeRegistry module augmentation support
  • Updated dependencies [36ef3a2]
    • @assistant-ui/tap@0.5.1

0.2.0

Minor Changes

  • b65428e: refactor: only allow functions in scope methods

Patch Changes

  • b65428e: refactor: replace peerScopes with transformScopes API
  • 6e97999: feat(core): move store tap infrastructure to @assistant-ui/core/store
  • 93910bd: Rename .tsx files to .ts where no JSX syntax is used
  • b65428e: refactor: rename ClientRegistry to ScopeRegistry
  • Updated dependencies [b65428e]
  • Updated dependencies [546c053]
  • Updated dependencies [a7039e3]
  • Updated dependencies [16c10fd]
  • Updated dependencies [40a67b6]
  • Updated dependencies [b65428e]
  • Updated dependencies [b181803]
  • Updated dependencies [b65428e]
  • Updated dependencies [6bd6419]
  • Updated dependencies [b65428e]
  • Updated dependencies [4d7f712]
  • Updated dependencies [ecc29ec]
  • Updated dependencies [6e97999]
  • Updated dependencies [b65428e]
  • Updated dependencies [60bbe53]
  • Updated dependencies [b65428e]
    • @assistant-ui/tap@0.5.0
    • @assistant-ui/core@0.1.0

0.1.6

Patch Changes

  • a088518: chore: update dependencies
  • Updated dependencies [a088518]
    • @assistant-ui/tap@0.4.5

0.1.5

Patch Changes

  • 9ef966a: fix(store): memoize the aui client instance
  • Updated dependencies [77af8c3]
    • @assistant-ui/tap@0.4.4

0.1.4

Patch Changes

  • d45b893: chore: update dependencies
  • fe71bfc: feat: use enhanced tapSubscribableResource hook
  • Updated dependencies [d45b893]
  • Updated dependencies [fe71bfc]
    • @assistant-ui/tap@0.4.3

0.1.3

Patch Changes

  • 3bbe318: fix: allow destructuring proxy methods (e.g. addToolResult, resumeToolCall)

0.1.2

Patch Changes

  • 07d1c65: fix: nesting assistant providers
  • 0371d72: feat: AssistantRuntimeProvider aui prop
  • Updated dependencies [5ab3690]
    • @assistant-ui/tap@0.4.2

0.1.1

Patch Changes

  • 2e088eb: fix: restore React 18 compatibility by using use-effect-event polyfill
  • a8be364: feat: log individual errors when throwing AggregateError
  • 605d825: chore: update dependencies
  • Updated dependencies [8cbf686]
  • Updated dependencies [a8be364]
  • Updated dependencies [605d825]
  • Updated dependencies [fe15232]
    • @assistant-ui/tap@0.4.1

0.1.0

Minor Changes

  • 11625b5: feat: store v0.1

0.0.6

Patch Changes

  • 3719567: chore: update deps
  • Updated dependencies [3719567]
    • @assistant-ui/tap@0.3.6

0.0.5

Patch Changes

  • 57bd207: chore: update dependencies
  • cce009d: chore: use tsc for building packages
  • Updated dependencies [57bd207]
  • Updated dependencies [cce009d]
    • @assistant-ui/tap@0.3.5

0.0.4

Patch Changes

  • Updated dependencies
    • @assistant-ui/tap@0.3.4

0.0.3

Patch Changes

  • bae3aa2: feat: overhaul store implementation
  • e8ea57b: chore: update deps
  • Updated dependencies [bae3aa2]
  • Updated dependencies [bae3aa2]
  • Updated dependencies [bae3aa2]
  • Updated dependencies [bae3aa2]
  • Updated dependencies [bae3aa2]
  • Updated dependencies [bae3aa2]
  • Updated dependencies [e8ea57b]
  • Updated dependencies [bae3aa2]
    • @assistant-ui/tap@0.3.3

0.0.2

Patch Changes

  • 01c31fe: chore: update dependencies
  • Updated dependencies [01c31fe]
    • @assistant-ui/tap@0.3.2

0.0.1

Patch Changes

  • ec662cd: chore: update dependencies
  • Updated dependencies [ec662cd]
    • @assistant-ui/tap@0.3.1