@geenius/ai 0.1.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +15 -2
- package/packages/convex/dist/index.d.ts +1 -0
- package/packages/convex/dist/index.js +42 -0
- package/packages/convex/dist/index.js.map +1 -0
- package/packages/react/README.md +1 -1
- package/packages/react-css/README.md +1 -1
- package/packages/react-css/dist/index.cjs +1544 -0
- package/packages/react-css/dist/index.cjs.map +1 -0
- package/packages/react-css/dist/index.d.cts +454 -0
- package/packages/react-css/dist/index.d.ts +454 -0
- package/packages/react-css/dist/index.js +1495 -0
- package/packages/react-css/dist/index.js.map +1 -0
- package/packages/shared/README.md +1 -1
- package/packages/solidjs/README.md +1 -1
- package/packages/solidjs-css/README.md +1 -1
- package/packages/solidjs-css/dist/index.cjs +674 -0
- package/packages/solidjs-css/dist/index.cjs.map +1 -0
- package/packages/solidjs-css/dist/index.d.cts +254 -0
- package/packages/solidjs-css/dist/index.d.ts +254 -0
- package/packages/solidjs-css/dist/index.js +634 -0
- package/packages/solidjs-css/dist/index.js.map +1 -0
- package/.changeset/config.json +0 -11
- package/.env.example +0 -2
- package/.github/CODEOWNERS +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -11
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -10
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/ci.yml +0 -23
- package/.github/workflows/release.yml +0 -29
- package/.node-version +0 -1
- package/.nvmrc +0 -1
- package/.prettierrc +0 -7
- package/.project/ACCOUNT.yaml +0 -4
- package/.project/IDEAS.yaml +0 -7
- package/.project/PROJECT.yaml +0 -11
- package/.project/ROADMAP.yaml +0 -15
- package/CODE_OF_CONDUCT.md +0 -26
- package/CONTRIBUTING.md +0 -61
- package/SECURITY.md +0 -18
- package/SUPPORT.md +0 -14
- package/packages/convex/package.json +0 -42
- package/packages/convex/src/index.ts +0 -8
- package/packages/convex/src/mutations/messages.ts +0 -29
- package/packages/convex/src/queries/messages.ts +0 -24
- package/packages/convex/src/schema.ts +0 -20
- package/packages/convex/tsconfig.json +0 -11
- package/packages/convex/tsup.config.ts +0 -17
- package/packages/react/package.json +0 -60
- package/packages/react/src/components/AILogTable.tsx +0 -90
- package/packages/react/src/components/ChatWindow.tsx +0 -118
- package/packages/react/src/components/GenerationCard.tsx +0 -73
- package/packages/react/src/components/ImageGenerator.tsx +0 -103
- package/packages/react/src/components/ModelSelector.tsx +0 -44
- package/packages/react/src/components/ModelTestRunner.tsx +0 -148
- package/packages/react/src/components/VoiceSelector.tsx +0 -51
- package/packages/react/src/components/index.ts +0 -9
- package/packages/react/src/hooks/index.ts +0 -12
- package/packages/react/src/hooks/useAI.ts +0 -158
- package/packages/react/src/hooks/useAILogs.ts +0 -40
- package/packages/react/src/hooks/useAIModels.ts +0 -53
- package/packages/react/src/hooks/useChat.ts +0 -141
- package/packages/react/src/hooks/useContentManager.ts +0 -108
- package/packages/react/src/hooks/useImageGeneration.ts +0 -82
- package/packages/react/src/hooks/useMemory.ts +0 -161
- package/packages/react/src/hooks/useModelTest.ts +0 -126
- package/packages/react/src/hooks/useRealtimeAudio.ts +0 -203
- package/packages/react/src/hooks/useSkills.ts +0 -114
- package/packages/react/src/hooks/useTextToSpeech.ts +0 -99
- package/packages/react/src/hooks/useTranscription.ts +0 -119
- package/packages/react/src/hooks/useVideoGeneration.ts +0 -79
- package/packages/react/src/index.ts +0 -42
- package/packages/react/src/pages/AILogsPage.tsx +0 -98
- package/packages/react/src/pages/ChatPage.tsx +0 -42
- package/packages/react/src/pages/ModelTestPage.tsx +0 -33
- package/packages/react/src/pages/index.ts +0 -5
- package/packages/react/tsconfig.json +0 -26
- package/packages/react/tsup.config.ts +0 -22
- package/packages/react-css/package.json +0 -45
- package/packages/react-css/src/ai.css +0 -857
- package/packages/react-css/src/components/AILogTable.tsx +0 -90
- package/packages/react-css/src/components/ChatWindow.tsx +0 -118
- package/packages/react-css/src/components/GenerationCard.tsx +0 -73
- package/packages/react-css/src/components/ImageGenerator.tsx +0 -103
- package/packages/react-css/src/components/ModelSelector.tsx +0 -44
- package/packages/react-css/src/components/ModelTestRunner.tsx +0 -148
- package/packages/react-css/src/components/VoiceSelector.tsx +0 -51
- package/packages/react-css/src/components/index.ts +0 -9
- package/packages/react-css/src/hooks/index.ts +0 -12
- package/packages/react-css/src/hooks/useAI.ts +0 -153
- package/packages/react-css/src/hooks/useAILogs.ts +0 -40
- package/packages/react-css/src/hooks/useAIModels.ts +0 -51
- package/packages/react-css/src/hooks/useChat.ts +0 -145
- package/packages/react-css/src/hooks/useContentManager.ts +0 -108
- package/packages/react-css/src/hooks/useImageGeneration.ts +0 -82
- package/packages/react-css/src/hooks/useMemory.ts +0 -161
- package/packages/react-css/src/hooks/useModelTest.ts +0 -122
- package/packages/react-css/src/hooks/useRealtimeAudio.ts +0 -203
- package/packages/react-css/src/hooks/useSkills.ts +0 -114
- package/packages/react-css/src/hooks/useTextToSpeech.ts +0 -99
- package/packages/react-css/src/hooks/useTranscription.ts +0 -119
- package/packages/react-css/src/hooks/useVideoGeneration.ts +0 -79
- package/packages/react-css/src/index.ts +0 -35
- package/packages/react-css/src/pages/AILogsPage.tsx +0 -98
- package/packages/react-css/src/pages/ChatPage.tsx +0 -42
- package/packages/react-css/src/pages/ModelTestPage.tsx +0 -33
- package/packages/react-css/src/pages/index.ts +0 -5
- package/packages/react-css/src/styles.css +0 -127
- package/packages/react-css/tsconfig.json +0 -26
- package/packages/react-css/tsup.config.ts +0 -2
- package/packages/shared/package.json +0 -71
- package/packages/shared/src/__tests__/ai.test.ts +0 -67
- package/packages/shared/src/ai-client.ts +0 -243
- package/packages/shared/src/config.ts +0 -235
- package/packages/shared/src/content.ts +0 -249
- package/packages/shared/src/convex/helpers.ts +0 -163
- package/packages/shared/src/convex/index.ts +0 -16
- package/packages/shared/src/convex/schemas.ts +0 -146
- package/packages/shared/src/convex/validators.ts +0 -136
- package/packages/shared/src/index.ts +0 -107
- package/packages/shared/src/memory.ts +0 -197
- package/packages/shared/src/providers/base.ts +0 -103
- package/packages/shared/src/providers/elevenlabs.ts +0 -155
- package/packages/shared/src/providers/index.ts +0 -28
- package/packages/shared/src/providers/openai-compatible.ts +0 -286
- package/packages/shared/src/providers/registry.ts +0 -113
- package/packages/shared/src/providers/replicate-fal.ts +0 -230
- package/packages/shared/src/skills.ts +0 -273
- package/packages/shared/src/types.ts +0 -501
- package/packages/shared/tsconfig.json +0 -25
- package/packages/shared/tsup.config.ts +0 -22
- package/packages/shared/vitest.config.ts +0 -4
- package/packages/solidjs/package.json +0 -59
- package/packages/solidjs/src/components/ChatWindow.tsx +0 -78
- package/packages/solidjs/src/components/GenerationCard.tsx +0 -62
- package/packages/solidjs/src/components/ModelTestRunner.tsx +0 -119
- package/packages/solidjs/src/components/index.ts +0 -5
- package/packages/solidjs/src/index.ts +0 -32
- package/packages/solidjs/src/pages/ChatPage.tsx +0 -22
- package/packages/solidjs/src/pages/ModelTestPage.tsx +0 -22
- package/packages/solidjs/src/pages/index.ts +0 -4
- package/packages/solidjs/src/primitives/createAI.ts +0 -79
- package/packages/solidjs/src/primitives/createChat.ts +0 -100
- package/packages/solidjs/src/primitives/createContentManager.ts +0 -61
- package/packages/solidjs/src/primitives/createImageGeneration.ts +0 -46
- package/packages/solidjs/src/primitives/createMemory.ts +0 -127
- package/packages/solidjs/src/primitives/createModelTest.ts +0 -89
- package/packages/solidjs/src/primitives/createSkills.ts +0 -83
- package/packages/solidjs/src/primitives/createTextToSpeech.ts +0 -56
- package/packages/solidjs/src/primitives/createVideoGeneration.ts +0 -46
- package/packages/solidjs/src/primitives/index.ts +0 -8
- package/packages/solidjs/tsconfig.json +0 -27
- package/packages/solidjs/tsup.config.ts +0 -21
- package/packages/solidjs-css/package.json +0 -44
- package/packages/solidjs-css/src/ai.css +0 -857
- package/packages/solidjs-css/src/components/ChatWindow.tsx +0 -78
- package/packages/solidjs-css/src/components/GenerationCard.tsx +0 -62
- package/packages/solidjs-css/src/components/ModelTestRunner.tsx +0 -119
- package/packages/solidjs-css/src/components/index.ts +0 -5
- package/packages/solidjs-css/src/index.ts +0 -26
- package/packages/solidjs-css/src/pages/ChatPage.tsx +0 -22
- package/packages/solidjs-css/src/pages/ModelTestPage.tsx +0 -22
- package/packages/solidjs-css/src/pages/index.ts +0 -4
- package/packages/solidjs-css/src/primitives/createAI.ts +0 -79
- package/packages/solidjs-css/src/primitives/createChat.ts +0 -100
- package/packages/solidjs-css/src/primitives/createContentManager.ts +0 -61
- package/packages/solidjs-css/src/primitives/createImageGeneration.ts +0 -46
- package/packages/solidjs-css/src/primitives/createMemory.ts +0 -127
- package/packages/solidjs-css/src/primitives/createModelTest.ts +0 -89
- package/packages/solidjs-css/src/primitives/createSkills.ts +0 -83
- package/packages/solidjs-css/src/primitives/createTextToSpeech.ts +0 -56
- package/packages/solidjs-css/src/primitives/createVideoGeneration.ts +0 -46
- package/packages/solidjs-css/src/primitives/index.ts +0 -1
- package/packages/solidjs-css/src/styles.css +0 -127
- package/packages/solidjs-css/tsconfig.json +0 -27
- package/packages/solidjs-css/tsup.config.ts +0 -2
- package/pnpm-workspace.yaml +0 -2
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// @geenius-ai/solidjs — src/primitives/createMemory.ts
|
|
2
|
-
|
|
3
|
-
import { createSignal } from 'solid-js'
|
|
4
|
-
import type {
|
|
5
|
-
MemoryEntry,
|
|
6
|
-
MemoryQuery,
|
|
7
|
-
MemoryNamespace,
|
|
8
|
-
MemoryImportance,
|
|
9
|
-
MemoryType,
|
|
10
|
-
} from '@geenius-ai/shared'
|
|
11
|
-
|
|
12
|
-
export interface CreateMemoryOptions {
|
|
13
|
-
storeFn: (entry: Omit<MemoryEntry, 'id' | 'accessCount' | 'lastAccessedAt' | 'createdAt' | 'updatedAt'>) => Promise<MemoryEntry>
|
|
14
|
-
searchFn: (query: MemoryQuery) => Promise<MemoryEntry[]>
|
|
15
|
-
deleteFn: (id: string) => Promise<void>
|
|
16
|
-
clearFn: (namespace: MemoryNamespace, scopeId: string) => Promise<void>
|
|
17
|
-
defaultNamespace?: MemoryNamespace
|
|
18
|
-
defaultScopeId?: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function createMemory(options: CreateMemoryOptions) {
|
|
22
|
-
const {
|
|
23
|
-
storeFn, searchFn, deleteFn, clearFn,
|
|
24
|
-
defaultNamespace = 'user',
|
|
25
|
-
defaultScopeId = '',
|
|
26
|
-
} = options
|
|
27
|
-
|
|
28
|
-
const [memories, setMemories] = createSignal<MemoryEntry[]>([])
|
|
29
|
-
const [isLoading, setIsLoading] = createSignal(false)
|
|
30
|
-
const [error, setError] = createSignal<Error | null>(null)
|
|
31
|
-
|
|
32
|
-
const store = async (
|
|
33
|
-
key: string,
|
|
34
|
-
value: string,
|
|
35
|
-
opts?: {
|
|
36
|
-
namespace?: MemoryNamespace
|
|
37
|
-
type?: MemoryType
|
|
38
|
-
importance?: MemoryImportance
|
|
39
|
-
metadata?: Record<string, unknown>
|
|
40
|
-
scopeId?: string
|
|
41
|
-
},
|
|
42
|
-
) => {
|
|
43
|
-
setIsLoading(true)
|
|
44
|
-
setError(null)
|
|
45
|
-
try {
|
|
46
|
-
const entry = await storeFn({
|
|
47
|
-
namespace: opts?.namespace ?? defaultNamespace,
|
|
48
|
-
type: opts?.type ?? 'fact',
|
|
49
|
-
importance: opts?.importance ?? 'medium',
|
|
50
|
-
key,
|
|
51
|
-
value,
|
|
52
|
-
metadata: opts?.metadata,
|
|
53
|
-
scopeId: opts?.scopeId ?? defaultScopeId,
|
|
54
|
-
})
|
|
55
|
-
setMemories(prev => [...prev, entry])
|
|
56
|
-
return entry
|
|
57
|
-
} catch (err) {
|
|
58
|
-
const e = err instanceof Error ? err : new Error(String(err))
|
|
59
|
-
setError(e)
|
|
60
|
-
throw e
|
|
61
|
-
} finally {
|
|
62
|
-
setIsLoading(false)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const recall = async (key: string, namespace?: MemoryNamespace) => {
|
|
67
|
-
setIsLoading(true)
|
|
68
|
-
setError(null)
|
|
69
|
-
try {
|
|
70
|
-
const results = await searchFn({
|
|
71
|
-
namespace: namespace ?? defaultNamespace,
|
|
72
|
-
key,
|
|
73
|
-
scopeId: defaultScopeId,
|
|
74
|
-
limit: 1,
|
|
75
|
-
})
|
|
76
|
-
return results.length > 0 ? results[0] : null
|
|
77
|
-
} catch (err) {
|
|
78
|
-
const e = err instanceof Error ? err : new Error(String(err))
|
|
79
|
-
setError(e)
|
|
80
|
-
throw e
|
|
81
|
-
} finally {
|
|
82
|
-
setIsLoading(false)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const search = async (query: MemoryQuery) => {
|
|
87
|
-
setIsLoading(true)
|
|
88
|
-
setError(null)
|
|
89
|
-
try {
|
|
90
|
-
const results = await searchFn({ scopeId: defaultScopeId, ...query })
|
|
91
|
-
setMemories(results)
|
|
92
|
-
return results
|
|
93
|
-
} catch (err) {
|
|
94
|
-
const e = err instanceof Error ? err : new Error(String(err))
|
|
95
|
-
setError(e)
|
|
96
|
-
throw e
|
|
97
|
-
} finally {
|
|
98
|
-
setIsLoading(false)
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const remove = async (id: string) => {
|
|
103
|
-
setError(null)
|
|
104
|
-
try {
|
|
105
|
-
await deleteFn(id)
|
|
106
|
-
setMemories(prev => prev.filter(m => m.id !== id))
|
|
107
|
-
} catch (err) {
|
|
108
|
-
const e = err instanceof Error ? err : new Error(String(err))
|
|
109
|
-
setError(e)
|
|
110
|
-
throw e
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const clear = async (namespace?: MemoryNamespace) => {
|
|
115
|
-
setError(null)
|
|
116
|
-
try {
|
|
117
|
-
await clearFn(namespace ?? defaultNamespace, defaultScopeId)
|
|
118
|
-
setMemories([])
|
|
119
|
-
} catch (err) {
|
|
120
|
-
const e = err instanceof Error ? err : new Error(String(err))
|
|
121
|
-
setError(e)
|
|
122
|
-
throw e
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return { store, recall, search, remove, clear, memories, isLoading, error }
|
|
127
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// @geenius-ai/solidjs — src/primitives/createModelTest.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Model test primitive — run tests on individual or batch models.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { createSignal } from 'solid-js'
|
|
8
|
-
import type { AIGenerationType } from '@geenius-ai/shared'
|
|
9
|
-
|
|
10
|
-
export interface ModelTestResult {
|
|
11
|
-
model: string
|
|
12
|
-
type: AIGenerationType
|
|
13
|
-
result: string
|
|
14
|
-
durationMs: number
|
|
15
|
-
timestamp: number
|
|
16
|
-
error?: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface CreateModelTestOptions {
|
|
20
|
-
callGenerateText?: (args: any) => Promise<string>
|
|
21
|
-
callGenerateImage?: (args: any) => Promise<string>
|
|
22
|
-
callGenerateAudio?: (args: any) => Promise<string>
|
|
23
|
-
callGenerateVideo?: (args: any) => Promise<string>
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface CreateModelTestReturn {
|
|
27
|
-
runTest: (model: string, prompt: string, type?: AIGenerationType) => Promise<ModelTestResult>
|
|
28
|
-
runBatchTest: (models: string[], prompt: string) => Promise<ModelTestResult[]>
|
|
29
|
-
results: () => ModelTestResult[]
|
|
30
|
-
isRunning: () => boolean
|
|
31
|
-
clearResults: () => void
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function createModelTest(options: CreateModelTestOptions = {}): CreateModelTestReturn {
|
|
35
|
-
const [results, setResults] = createSignal<ModelTestResult[]>([])
|
|
36
|
-
const [isRunning, setIsRunning] = createSignal(false)
|
|
37
|
-
|
|
38
|
-
async function runTest(model: string, prompt: string, type: AIGenerationType = 'text'): Promise<ModelTestResult> {
|
|
39
|
-
setIsRunning(true)
|
|
40
|
-
const start = Date.now()
|
|
41
|
-
|
|
42
|
-
try {
|
|
43
|
-
let result = ''
|
|
44
|
-
switch (type) {
|
|
45
|
-
case 'text':
|
|
46
|
-
if (!options.callGenerateText) throw new Error('callGenerateText not provided')
|
|
47
|
-
result = await options.callGenerateText({ model, messages: [{ role: 'user', content: prompt }], caller: 'model-test' })
|
|
48
|
-
break
|
|
49
|
-
case 'image':
|
|
50
|
-
if (!options.callGenerateImage) throw new Error('callGenerateImage not provided')
|
|
51
|
-
result = await options.callGenerateImage({ prompt, model })
|
|
52
|
-
break
|
|
53
|
-
case 'audio':
|
|
54
|
-
if (!options.callGenerateAudio) throw new Error('callGenerateAudio not provided')
|
|
55
|
-
result = await options.callGenerateAudio({ prompt })
|
|
56
|
-
break
|
|
57
|
-
case 'video':
|
|
58
|
-
if (!options.callGenerateVideo) throw new Error('callGenerateVideo not provided')
|
|
59
|
-
result = await options.callGenerateVideo({ prompt })
|
|
60
|
-
break
|
|
61
|
-
default:
|
|
62
|
-
throw new Error(`Unsupported test type: ${type}`)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const testResult: ModelTestResult = { model, type, result, durationMs: Date.now() - start, timestamp: Date.now() }
|
|
66
|
-
setResults(prev => [...prev, testResult])
|
|
67
|
-
return testResult
|
|
68
|
-
} catch (err) {
|
|
69
|
-
const testResult: ModelTestResult = { model, type, result: '', durationMs: Date.now() - start, timestamp: Date.now(), error: err instanceof Error ? err.message : 'Test failed' }
|
|
70
|
-
setResults(prev => [...prev, testResult])
|
|
71
|
-
return testResult
|
|
72
|
-
} finally {
|
|
73
|
-
setIsRunning(false)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async function runBatchTest(models: string[], prompt: string): Promise<ModelTestResult[]> {
|
|
78
|
-
setIsRunning(true)
|
|
79
|
-
const batch: ModelTestResult[] = []
|
|
80
|
-
for (const model of models) {
|
|
81
|
-
const r = await runTest(model, prompt)
|
|
82
|
-
batch.push(r)
|
|
83
|
-
}
|
|
84
|
-
setIsRunning(false)
|
|
85
|
-
return batch
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return { runTest, runBatchTest, results, isRunning, clearResults: () => setResults([]) }
|
|
89
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// @geenius-ai/solidjs — src/primitives/createSkills.ts
|
|
2
|
-
|
|
3
|
-
import { createSignal, createMemo } from 'solid-js'
|
|
4
|
-
import type {
|
|
5
|
-
SkillDefinition,
|
|
6
|
-
SkillContext,
|
|
7
|
-
SkillResult,
|
|
8
|
-
SkillCategory,
|
|
9
|
-
} from '@geenius-ai/shared'
|
|
10
|
-
import { BUILT_IN_SKILLS } from '@geenius-ai/shared'
|
|
11
|
-
|
|
12
|
-
export interface CreateSkillsOptions {
|
|
13
|
-
executeFn: (context: SkillContext) => Promise<SkillResult>
|
|
14
|
-
customSkills?: SkillDefinition[]
|
|
15
|
-
defaultModel?: string
|
|
16
|
-
userId?: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function createSkills(options: CreateSkillsOptions) {
|
|
20
|
-
const { executeFn, customSkills = [], defaultModel, userId } = options
|
|
21
|
-
const [result, setResult] = createSignal<SkillResult | null>(null)
|
|
22
|
-
const [isExecuting, setIsExecuting] = createSignal(false)
|
|
23
|
-
const [error, setError] = createSignal<Error | null>(null)
|
|
24
|
-
|
|
25
|
-
const allSkills = createMemo(() => {
|
|
26
|
-
const map = new Map<string, SkillDefinition>()
|
|
27
|
-
for (const skill of Object.values(BUILT_IN_SKILLS)) map.set(skill.id, skill)
|
|
28
|
-
for (const skill of customSkills) map.set(skill.id, skill)
|
|
29
|
-
return Array.from(map.values())
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const byCategory = (category: SkillCategory) =>
|
|
33
|
-
allSkills().filter(s => s.category === category)
|
|
34
|
-
|
|
35
|
-
const search = (query: string) => {
|
|
36
|
-
const q = query.toLowerCase()
|
|
37
|
-
return allSkills().filter(s =>
|
|
38
|
-
s.name.toLowerCase().includes(q) ||
|
|
39
|
-
s.description.toLowerCase().includes(q) ||
|
|
40
|
-
s.tags?.some(t => t.toLowerCase().includes(q))
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const getSkill = (id: string) => allSkills().find(s => s.id === id)
|
|
45
|
-
|
|
46
|
-
const execute = async (
|
|
47
|
-
skillId: string,
|
|
48
|
-
params: Record<string, unknown>,
|
|
49
|
-
context?: Record<string, unknown>,
|
|
50
|
-
) => {
|
|
51
|
-
setIsExecuting(true)
|
|
52
|
-
setError(null)
|
|
53
|
-
try {
|
|
54
|
-
const res = await executeFn({
|
|
55
|
-
skillId,
|
|
56
|
-
params,
|
|
57
|
-
userId,
|
|
58
|
-
context,
|
|
59
|
-
model: defaultModel,
|
|
60
|
-
})
|
|
61
|
-
setResult(res)
|
|
62
|
-
return res
|
|
63
|
-
} catch (err) {
|
|
64
|
-
const e = err instanceof Error ? err : new Error(String(err))
|
|
65
|
-
setError(e)
|
|
66
|
-
throw e
|
|
67
|
-
} finally {
|
|
68
|
-
setIsExecuting(false)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
skills: allSkills,
|
|
74
|
-
byCategory,
|
|
75
|
-
search,
|
|
76
|
-
getSkill,
|
|
77
|
-
execute,
|
|
78
|
-
result,
|
|
79
|
-
isExecuting,
|
|
80
|
-
error,
|
|
81
|
-
reset: () => { setResult(null); setError(null) },
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// @geenius-ai/solidjs — src/primitives/createTextToSpeech.ts
|
|
2
|
-
|
|
3
|
-
import { createSignal } from 'solid-js'
|
|
4
|
-
|
|
5
|
-
export interface CreateTextToSpeechOptions {
|
|
6
|
-
callGenerateAudio: (args: any) => Promise<string>
|
|
7
|
-
defaultVoice?: string
|
|
8
|
-
defaultModel?: string
|
|
9
|
-
autoPlay?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function createTextToSpeech(options: CreateTextToSpeechOptions) {
|
|
13
|
-
const [isGenerating, setIsGenerating] = createSignal(false)
|
|
14
|
-
const [isSpeaking, setIsSpeaking] = createSignal(false)
|
|
15
|
-
const [error, setError] = createSignal<string | null>(null)
|
|
16
|
-
const [audioUrl, setAudioUrl] = createSignal<string | null>(null)
|
|
17
|
-
let currentAudio: HTMLAudioElement | null = null
|
|
18
|
-
|
|
19
|
-
async function speak(text: string, opts?: { voice?: string; model?: string; speed?: number }) {
|
|
20
|
-
setIsGenerating(true)
|
|
21
|
-
setError(null)
|
|
22
|
-
try {
|
|
23
|
-
const base64 = await options.callGenerateAudio({
|
|
24
|
-
prompt: text,
|
|
25
|
-
voice: opts?.voice ?? options.defaultVoice ?? 'alloy',
|
|
26
|
-
model: opts?.model ?? options.defaultModel,
|
|
27
|
-
speed: opts?.speed,
|
|
28
|
-
})
|
|
29
|
-
const url = base64.startsWith('http') ? base64 : `data:audio/mp3;base64,${base64}`
|
|
30
|
-
setAudioUrl(url)
|
|
31
|
-
|
|
32
|
-
if (options.autoPlay !== false) {
|
|
33
|
-
stop()
|
|
34
|
-
const audio = new Audio(url)
|
|
35
|
-
currentAudio = audio
|
|
36
|
-
setIsSpeaking(true)
|
|
37
|
-
audio.onended = () => setIsSpeaking(false)
|
|
38
|
-
await audio.play()
|
|
39
|
-
}
|
|
40
|
-
return url
|
|
41
|
-
} catch (err) {
|
|
42
|
-
setError(err instanceof Error ? err.message : 'TTS failed')
|
|
43
|
-
throw err
|
|
44
|
-
} finally {
|
|
45
|
-
setIsGenerating(false)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function stop() {
|
|
50
|
-
currentAudio?.pause()
|
|
51
|
-
currentAudio = null
|
|
52
|
-
setIsSpeaking(false)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return { speak, stop, isGenerating, isSpeaking, error, audioUrl, clearError: () => setError(null) }
|
|
56
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// @geenius-ai/solidjs — src/primitives/createVideoGeneration.ts
|
|
2
|
-
|
|
3
|
-
import { createSignal } from 'solid-js'
|
|
4
|
-
|
|
5
|
-
export interface GeneratedVideo {
|
|
6
|
-
url: string
|
|
7
|
-
prompt: string
|
|
8
|
-
model: string
|
|
9
|
-
timestamp: number
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface CreateVideoGenerationOptions {
|
|
13
|
-
callGenerateVideo: (args: any) => Promise<string>
|
|
14
|
-
defaultModel?: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function createVideoGeneration(options: CreateVideoGenerationOptions) {
|
|
18
|
-
const [videos, setVideos] = createSignal<GeneratedVideo[]>([])
|
|
19
|
-
const [isGenerating, setIsGenerating] = createSignal(false)
|
|
20
|
-
const [error, setError] = createSignal<string | null>(null)
|
|
21
|
-
|
|
22
|
-
async function generate(prompt: string, opts?: {
|
|
23
|
-
model?: string; duration?: number; aspectRatio?: '16:9' | '9:16' | '1:1'
|
|
24
|
-
startImage?: string; endImage?: string
|
|
25
|
-
}) {
|
|
26
|
-
setIsGenerating(true)
|
|
27
|
-
setError(null)
|
|
28
|
-
try {
|
|
29
|
-
const model = opts?.model ?? options.defaultModel ?? 'minimax/video-01'
|
|
30
|
-
const result = await options.callGenerateVideo({ prompt, model, ...opts })
|
|
31
|
-
setVideos(prev => [{ url: result, prompt, model, timestamp: Date.now() }, ...prev])
|
|
32
|
-
return result
|
|
33
|
-
} catch (err) {
|
|
34
|
-
setError(err instanceof Error ? err.message : 'Video generation failed')
|
|
35
|
-
throw err
|
|
36
|
-
} finally {
|
|
37
|
-
setIsGenerating(false)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
generate, videos, isGenerating, error,
|
|
43
|
-
clearVideos: () => setVideos([]),
|
|
44
|
-
clearError: () => setError(null),
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @geenius-ai/solidjs — src/primitives/index.ts
|
|
2
|
-
|
|
3
|
-
export { createAI, type CreateAIOptions, type CreateAIReturn } from './createAI'
|
|
4
|
-
export { createChat, type CreateChatOptions, type CreateChatReturn } from './createChat'
|
|
5
|
-
export { createModelTest, type CreateModelTestOptions, type CreateModelTestReturn, type ModelTestResult } from './createModelTest'
|
|
6
|
-
export { createImageGeneration, type CreateImageGenerationOptions, type GeneratedImage } from './createImageGeneration'
|
|
7
|
-
export { createTextToSpeech, type CreateTextToSpeechOptions } from './createTextToSpeech'
|
|
8
|
-
export { createVideoGeneration, type CreateVideoGenerationOptions, type GeneratedVideo } from './createVideoGeneration'
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"outDir": "./dist",
|
|
10
|
-
"rootDir": "./src",
|
|
11
|
-
"strict": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"isolatedModules": true,
|
|
17
|
-
"jsx": "preserve",
|
|
18
|
-
"jsxImportSource": "solid-js"
|
|
19
|
-
},
|
|
20
|
-
"include": [
|
|
21
|
-
"src"
|
|
22
|
-
],
|
|
23
|
-
"exclude": [
|
|
24
|
-
"node_modules",
|
|
25
|
-
"dist"
|
|
26
|
-
]
|
|
27
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: {
|
|
5
|
-
index: 'src/index.ts',
|
|
6
|
-
'primitives/index': 'src/primitives/index.ts',
|
|
7
|
-
'components/index': 'src/components/index.ts',
|
|
8
|
-
'pages/index': 'src/pages/index.ts',
|
|
9
|
-
},
|
|
10
|
-
format: ['esm'],
|
|
11
|
-
dts: true,
|
|
12
|
-
clean: true,
|
|
13
|
-
sourcemap: true,
|
|
14
|
-
jsx: 'preserve',
|
|
15
|
-
external: [
|
|
16
|
-
'solid-js',
|
|
17
|
-
'convex',
|
|
18
|
-
'convex/react',
|
|
19
|
-
'@geenius-ai/shared',
|
|
20
|
-
],
|
|
21
|
-
})
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@geenius-ai/solidjs-css",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "Geenius AI — SolidJS primitives and components (vanilla CSS variant)",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.mjs",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/index.mjs",
|
|
12
|
-
"require": "./dist/index.js",
|
|
13
|
-
"types": "./dist/index.d.ts"
|
|
14
|
-
},
|
|
15
|
-
"./styles.css": "./dist/styles.css"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsup",
|
|
19
|
-
"lint": "tsc --noEmit",
|
|
20
|
-
"clean": "rm -rf dist"
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"dist"
|
|
24
|
-
],
|
|
25
|
-
"publishConfig": {
|
|
26
|
-
"access": "public"
|
|
27
|
-
},
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"solid-js": ">=1.6.0"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@geenius-ai/shared": "workspace:*"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"solid-js": "^1.9.5",
|
|
36
|
-
"tsup": "^8.5.1",
|
|
37
|
-
"typescript": "~6.0.2"
|
|
38
|
-
},
|
|
39
|
-
"author": "Antigravity HQ",
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"engines": {
|
|
42
|
-
"node": ">=20.0.0"
|
|
43
|
-
}
|
|
44
|
-
}
|