Skip to content

chore(rebrand): phase 4a — rename AI hooks and fetch identifiers#143

Merged
qnbs merged 6 commits into
mainfrom
rebrand/phase-4a-hooks-ai
Jun 16, 2026
Merged

chore(rebrand): phase 4a — rename AI hooks and fetch identifiers#143
qnbs merged 6 commits into
mainfrom
rebrand/phase-4a-hooks-ai

Conversation

@qnbs

@qnbs qnbs commented Jun 15, 2026

Copy link
Copy Markdown
Owner

User description

Summary

Part of the StoryCraft → WorldScript rebrand split. This PR renames AI-related hooks and fetch utilities to use the WorldScript identifier.

Changes

  • hooks/useStoryCraftAI.tshooks/useWorldScriptAI.ts
  • services/ai/storyCraftCompletionFetch.tsservices/ai/worldScriptCompletionFetch.ts
  • Updates all import paths and test file references.
  • Renames related test files and test descriptions.

Scope

  • Pure identifier rename; no functional changes.

Related


CodeAnt-AI Description

Rename the AI streaming flow to WorldScript across the app

What Changed

  • The writer and copilot AI flow now use WorldScript names in place of StoryCraft names
  • AI requests, error messages, and internal routing labels now show WorldScript branding
  • The remaining reference to the old hook path was updated so the renamed AI flow is used everywhere
  • Related tests were updated to match the new names, with a deterministic fetch used in provider tests

Impact

✅ Clearer WorldScript branding
✅ Fewer outdated AI error messages
✅ Smooth rebrand rollout without changing AI behavior

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
storycraft-studio Ready Ready Preview, Comment Jun 16, 2026 6:34am

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Jun 15, 2026
Comment thread services/ai/providerFactory.ts
Comment thread services/ai/providerFactory.ts
Comment thread services/ai/index.ts
Comment thread services/ai/providerFactory.ts
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

@qnbs

qnbs commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

CodeAnt AI is running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 15, 2026
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Sequence Diagram

This PR rebrands the client-side AI streaming pipeline from StoryCraft to WorldScript, updating the hook, completion adapter, and model factory identifiers while keeping the underlying behavior the same.

sequenceDiagram
    participant UI
    participant WorldScriptAIHook as WorldScript AI hook
    participant CompletionAdapter as WorldScript completion fetch
    participant ModelFactory
    participant AIProvider as External AI provider

    UI->>WorldScriptAIHook: Request AI completion
    WorldScriptAIHook->>CompletionAdapter: Start WorldScript completion request
    CompletionAdapter->>ModelFactory: Resolve model for provider
    ModelFactory->>AIProvider: Invoke language model with prompt
    AIProvider-->>CompletionAdapter: Stream completion tokens
    CompletionAdapter-->>WorldScriptAIHook: Return streamed text
    WorldScriptAIHook-->>UI: Emit incremental updates to writer and copilot
Loading

Generated by CodeAnt AI

Comment thread tests/unit/providerFactory.test.ts Outdated
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

CodeAnt AI finished running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qnbs

qnbs commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 15, 2026
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Sequence Diagram

This PR rebrands the StoryCraft AI streaming pipeline to WorldScript naming while keeping the core flow the same: UI hooks call a WorldScript-specific hook, which uses an internal completion fetch to build a language model and stream text from the configured AI provider.

sequenceDiagram
    participant UI as Writer or Copilot UI
    participant Hook as WorldScript AI hook
    participant Fetch as WorldScript completion fetch
    participant Factory as Model factory
    participant Provider as AI provider

    UI->>Hook: Request AI completion
    Hook->>Fetch: Send completion request to internal endpoint
    Fetch->>Factory: Resolve model config from provider and settings
    Factory-->>Fetch: Return language model instance
    Fetch->>Provider: Stream completion with prompt and options
    Provider-->>Fetch: Return text stream
    Fetch-->>Hook: Stream completion chunks
    Hook-->>UI: Update UI with streaming AI output
Loading

Generated by CodeAnt AI

Comment thread hooks/useWorldScriptAI.ts
Comment thread services/ai/worldScriptCompletionFetch.ts
qnbs added a commit that referenced this pull request Jun 15, 2026
…atalog (#143)

featureCatalog.ts referenced the renamed hook by its old path
'hooks/useStoryCraftAI.ts'. Update to 'hooks/useWorldScriptAI.ts'. This was the
only remaining reference to the old StoryCraft AI identifiers — the hook/fetch
rename is otherwise complete (zero code importers of the legacy names).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qnbs

qnbs commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 15, 2026
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Sequence Diagram

This PR rebrands the client-side AI streaming path from StoryCraft to WorldScript by renaming the AI hook, completion fetch, and provider factory identifiers while keeping the streaming flow and behavior the same.

sequenceDiagram
    participant WriterUI as Writer or Copilot UI
    participant WSAIHook as WorldScript AI hook
    participant Completion as WorldScript completion fetch
    participant Factory as Provider factory
    participant AISDK as AI SDK

    WriterUI->>WSAIHook: Start completion with prompt
    WSAIHook->>Completion: Request completion via internal WorldScript URL
    Completion->>Factory: Resolve model config from provider and settings
    Factory->>AISDK: Create language model with WorldScript fetch
    Completion->>AISDK: Stream text for prompt
    AISDK-->>WSAIHook: Streamed tokens
    WSAIHook-->>WriterUI: Update UI with incremental text
Loading

Generated by CodeAnt AI

qnbs and others added 2 commits June 16, 2026 07:18
- Add WorldScript aliases in fetchAdapter.ts so providerFactory and the
  barrel can import createWorldScriptFetch / WorldScriptFetchOptions.
- Update providerFactory.test.ts to use createLanguageModelForWorldScript
  and mock createWorldScriptFetch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
qnbs and others added 2 commits June 16, 2026 07:18
CodeAnt (test-determinism rule): the createWorldScriptFetch mock returned the
real globalThis.fetch, coupling the suite to runtime network behaviour. Return
a deterministic vi.fn fake instead. No assertion depends on the returned value
(the factory only passes it through to the SDK; it is never invoked in-test).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…atalog (#143)

featureCatalog.ts referenced the renamed hook by its old path
'hooks/useStoryCraftAI.ts'. Update to 'hooks/useWorldScriptAI.ts'. This was the
only remaining reference to the old StoryCraft AI identifiers — the hook/fetch
rename is otherwise complete (zero code importers of the legacy names).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@qnbs
qnbs force-pushed the rebrand/phase-4a-hooks-ai branch from 7c68a75 to f181a2b Compare June 16, 2026 05:18
@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 16, 2026
qnbs and others added 2 commits June 16, 2026 08:26
…s-ai

# Conflicts:
#	services/ai/providerFactory.ts
#	tests/unit/ai/worldScriptCompletionFetch.test.ts
#	tests/unit/providerFactory.test.ts
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qnbs
qnbs merged commit 11867e7 into main Jun 16, 2026
17 of 18 checks passed
@qnbs
qnbs deleted the rebrand/phase-4a-hooks-ai branch June 16, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant