Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/clawdhub.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ function getRegistry() {
return (
process.env.CLAWHUB_REGISTRY?.trim() ||
process.env.CLAWDHUB_REGISTRY?.trim() ||
'https://clawhub.ai'
'https://www.clawhub.ai'
)
}

function getSite() {
return (
process.env.CLAWHUB_SITE?.trim() || process.env.CLAWDHUB_SITE?.trim() || 'https://clawhub.ai'
process.env.CLAWHUB_SITE?.trim() || process.env.CLAWDHUB_SITE?.trim() || 'https://www.clawhub.ai'
)
}

Expand Down
8 changes: 4 additions & 4 deletions packages/clawdhub/src/cli/commands/delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
import type { GlobalOpts } from '../types'

vi.mock('../../config.js', () => ({
readGlobalConfig: vi.fn(async () => ({ registry: 'https://clawhub.ai', token: 'tkn' })),
readGlobalConfig: vi.fn(async () => ({ registry: 'https://www.clawhub.ai', token: 'tkn' })),
}))

vi.mock('../registry.js', () => ({
getRegistry: vi.fn(async () => 'https://clawhub.ai'),
getRegistry: vi.fn(async () => 'https://www.clawhub.ai'),
}))

const mockApiRequest = vi.fn()
Expand All @@ -35,8 +35,8 @@ function makeOpts(): GlobalOpts {
return {
workdir: '/work',
dir: '/work/skills',
site: 'https://clawhub.ai',
registry: 'https://clawhub.ai',
site: 'https://www.clawhub.ai',
registry: 'https://www.clawhub.ai',
registrySource: 'default',
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/clawdhub/src/cli/commands/inspect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ vi.mock('../../http.js', () => ({
fetchText: (...args: unknown[]) => mockFetchText(...args),
}))

const mockGetRegistry = vi.fn(async () => 'https://clawhub.ai')
const mockGetRegistry = vi.fn(async () => 'https://www.clawhub.ai')
vi.mock('../registry.js', () => ({
getRegistry: () => mockGetRegistry(),
}))
Expand Down Expand Up @@ -41,8 +41,8 @@ function makeOpts(): GlobalOpts {
return {
workdir: '/work',
dir: '/work/skills',
site: 'https://clawhub.ai',
registry: 'https://clawhub.ai',
site: 'https://www.clawhub.ai',
registry: 'https://www.clawhub.ai',
registrySource: 'default',
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/clawdhub/src/cli/commands/moderation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
import type { GlobalOpts } from '../types'

vi.mock('../../config.js', () => ({
readGlobalConfig: vi.fn(async () => ({ registry: 'https://clawhub.ai', token: 'tkn' })),
readGlobalConfig: vi.fn(async () => ({ registry: 'https://www.clawhub.ai', token: 'tkn' })),
}))

vi.mock('../registry.js', () => ({
getRegistry: vi.fn(async () => 'https://clawhub.ai'),
getRegistry: vi.fn(async () => 'https://www.clawhub.ai'),
}))

const mockApiRequest = vi.fn()
Expand All @@ -33,8 +33,8 @@ function makeOpts(): GlobalOpts {
return {
workdir: '/work',
dir: '/work/skills',
site: 'https://clawhub.ai',
registry: 'https://clawhub.ai',
site: 'https://www.clawhub.ai',
registry: 'https://www.clawhub.ai',
registrySource: 'default',
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/clawdhub/src/cli/commands/publish.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
import type { GlobalOpts } from '../types'

vi.mock('../../config.js', () => ({
readGlobalConfig: vi.fn(async () => ({ registry: 'https://clawhub.ai', token: 'tkn' })),
readGlobalConfig: vi.fn(async () => ({ registry: 'https://www.clawhub.ai', token: 'tkn' })),
}))

const mockGetRegistry = vi.fn(async (_opts: unknown, _params?: unknown) => 'https://clawhub.ai')
const mockGetRegistry = vi.fn(async (_opts: unknown, _params?: unknown) => 'https://www.clawhub.ai')
vi.mock('../registry.js', () => ({
getRegistry: (opts: unknown, params?: unknown) => mockGetRegistry(opts, params),
}))
Expand Down Expand Up @@ -42,8 +42,8 @@ function makeOpts(workdir: string): GlobalOpts {
return {
workdir,
dir: join(workdir, 'skills'),
site: 'https://clawhub.ai',
registry: 'https://clawhub.ai',
site: 'https://www.clawhub.ai',
registry: 'https://www.clawhub.ai',
registrySource: 'default',
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/clawdhub/src/cli/commands/skills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ vi.mock('../../http.js', () => ({
downloadZip: (...args: unknown[]) => mockDownloadZip(...args),
}))

const mockGetRegistry = vi.fn(async () => 'https://clawhub.ai')
const mockGetRegistry = vi.fn(async () => 'https://www.clawhub.ai')
vi.mock('../registry.js', () => ({
getRegistry: () => mockGetRegistry(),
}))
Expand Down Expand Up @@ -68,8 +68,8 @@ function makeOpts(): GlobalOpts {
return {
workdir: '/work',
dir: '/work/skills',
site: 'https://clawhub.ai',
registry: 'https://clawhub.ai',
site: 'https://www.clawhub.ai',
registry: 'https://www.clawhub.ai',
registrySource: 'default',
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/clawdhub/src/cli/commands/sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ vi.mock('@clack/prompts', () => ({
}))

vi.mock('../../config.js', () => ({
readGlobalConfig: vi.fn(async () => ({ registry: 'https://clawhub.ai', token: 'tkn' })),
readGlobalConfig: vi.fn(async () => ({ registry: 'https://www.clawhub.ai', token: 'tkn' })),
}))

const mockGetRegistry = vi.fn(async () => 'https://clawhub.ai')
const mockGetRegistry = vi.fn(async () => 'https://www.clawhub.ai')
vi.mock('../registry.js', () => ({
getRegistry: () => mockGetRegistry(),
}))
Expand Down Expand Up @@ -89,8 +89,8 @@ function makeOpts(): GlobalOpts {
return {
workdir: '/work',
dir: '/work/skills',
site: 'https://clawhub.ai',
registry: 'https://clawhub.ai',
site: 'https://www.clawhub.ai',
registry: 'https://www.clawhub.ai',
registrySource: 'default',
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/clawdhub/src/cli/registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function makeOpts(overrides: Partial<GlobalOpts> = {}): GlobalOpts {
return {
workdir: '/work',
dir: '/work/skills',
site: 'https://clawhub.ai',
site: 'https://www.clawhub.ai',
registry: DEFAULT_REGISTRY,
registrySource: 'default',
...overrides,
Expand All @@ -38,7 +38,7 @@ beforeEach(() => {
describe('registry resolution', () => {
it('prefers explicit registry over discovery/cache', async () => {
readGlobalConfig.mockResolvedValue({ registry: 'https://auth.clawdhub.com' })
discoverRegistryFromSite.mockResolvedValue({ apiBase: 'https://clawhub.ai' })
discoverRegistryFromSite.mockResolvedValue({ apiBase: 'https://www.clawhub.ai' })

const registry = await resolveRegistry(
makeOpts({ registry: 'https://custom.example', registrySource: 'cli' }),
Expand All @@ -50,13 +50,13 @@ describe('registry resolution', () => {

it('ignores legacy registry and updates cache from discovery', async () => {
readGlobalConfig.mockResolvedValue({ registry: 'https://auth.clawdhub.com', token: 'tkn' })
discoverRegistryFromSite.mockResolvedValue({ apiBase: 'https://clawhub.ai' })
discoverRegistryFromSite.mockResolvedValue({ apiBase: 'https://www.clawhub.ai' })

const registry = await getRegistry(makeOpts(), { cache: true })

expect(registry).toBe('https://clawhub.ai')
expect(registry).toBe('https://www.clawhub.ai')
expect(writeGlobalConfig).toHaveBeenCalledWith({
registry: 'https://clawhub.ai',
registry: 'https://www.clawhub.ai',
token: 'tkn',
})
})
Expand Down
4 changes: 2 additions & 2 deletions packages/clawdhub/src/cli/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { readGlobalConfig, writeGlobalConfig } from '../config.js'
import { discoverRegistryFromSite } from '../discovery.js'
import type { GlobalOpts } from './types.js'

export const DEFAULT_SITE = 'https://clawhub.ai'
export const DEFAULT_REGISTRY = 'https://clawhub.ai'
export const DEFAULT_SITE = 'https://www.clawhub.ai'
export const DEFAULT_REGISTRY = 'https://www.clawhub.ai'
const LEGACY_REGISTRY_HOSTS = new Set(['auth.clawdhub.com', 'auth.clawhub.com', 'auth.clawhub.ai'])

export async function resolveRegistry(opts: GlobalOpts) {
Expand Down
6 changes: 3 additions & 3 deletions public/.well-known/clawhub.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"apiBase": "https://clawhub.ai",
"authBase": "https://clawhub.ai",
"apiBase": "https://www.clawhub.ai",
"authBase": "https://www.clawhub.ai",
"minCliVersion": "0.1.0",
"registry": "https://clawhub.ai"
"registry": "https://www.clawhub.ai"
}