@lobehub/lobehub 2.0.0-next.165 → 2.0.0-next.167
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/.husky/pre-commit +1 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +50 -0
- package/CLAUDE.md +2 -2
- package/Dockerfile +44 -52
- package/GEMINI.md +1 -1
- package/apps/desktop/package.json +4 -4
- package/apps/desktop/tsconfig.json +4 -13
- package/changelog/v1.json +14 -0
- package/docs/development/database-schema.dbml +1 -0
- package/locales/ar/models.json +12 -0
- package/locales/ar/providers.json +3 -0
- package/locales/bg-BG/models.json +12 -0
- package/locales/bg-BG/providers.json +3 -0
- package/locales/de-DE/models.json +12 -0
- package/locales/de-DE/providers.json +3 -0
- package/locales/en-US/models.json +12 -0
- package/locales/en-US/providers.json +3 -0
- package/locales/es-ES/models.json +12 -0
- package/locales/es-ES/providers.json +3 -0
- package/locales/fa-IR/models.json +12 -0
- package/locales/fa-IR/providers.json +3 -0
- package/locales/fr-FR/models.json +12 -0
- package/locales/fr-FR/providers.json +3 -0
- package/locales/it-IT/models.json +12 -0
- package/locales/it-IT/providers.json +3 -0
- package/locales/ja-JP/models.json +12 -0
- package/locales/ja-JP/providers.json +3 -0
- package/locales/ko-KR/models.json +12 -0
- package/locales/ko-KR/providers.json +3 -0
- package/locales/nl-NL/models.json +12 -0
- package/locales/nl-NL/providers.json +3 -0
- package/locales/pl-PL/models.json +12 -0
- package/locales/pl-PL/providers.json +3 -0
- package/locales/pt-BR/models.json +12 -0
- package/locales/pt-BR/providers.json +3 -0
- package/locales/ru-RU/models.json +12 -0
- package/locales/ru-RU/providers.json +3 -0
- package/locales/tr-TR/models.json +12 -0
- package/locales/tr-TR/providers.json +3 -0
- package/locales/vi-VN/models.json +12 -0
- package/locales/vi-VN/providers.json +3 -0
- package/locales/zh-CN/models.json +12 -0
- package/locales/zh-CN/providers.json +3 -0
- package/locales/zh-TW/models.json +12 -0
- package/locales/zh-TW/providers.json +3 -0
- package/package.json +43 -43
- package/packages/database/migrations/0060_add_user_last_active_at.sql +1 -0
- package/packages/database/migrations/meta/0060_snapshot.json +8481 -0
- package/packages/database/migrations/meta/_journal.json +8 -1
- package/packages/database/src/core/migrations.json +9 -1
- package/packages/database/src/schemas/user.ts +1 -0
- package/packages/fetch-sse/src/__tests__/headers.test.ts +2 -2
- package/packages/model-bank/package.json +1 -0
- package/packages/model-bank/src/aiModels/index.ts +3 -0
- package/packages/model-bank/src/aiModels/replicate.ts +90 -0
- package/packages/model-bank/src/const/modelProvider.ts +1 -0
- package/packages/model-runtime/docs/test-coverage.md +5 -5
- package/packages/model-runtime/package.json +2 -1
- package/packages/model-runtime/src/core/ModelRuntime.ts +11 -1
- package/packages/model-runtime/src/providers/replicate/index.ts +424 -0
- package/packages/model-runtime/src/runtimeMap.ts +2 -0
- package/packages/model-runtime/src/utils/modelParse.ts +13 -0
- package/packages/ssrf-safe-fetch/index.browser.ts +22 -2
- package/packages/ssrf-safe-fetch/index.ts +30 -6
- package/packages/types/src/aiProvider.ts +2 -0
- package/src/config/modelProviders/index.ts +3 -0
- package/src/config/modelProviders/replicate.ts +23 -0
- package/src/server/routers/lambda/__tests__/user.test.ts +2 -0
- package/src/server/routers/lambda/market/index.ts +5 -2
- package/src/server/routers/lambda/user.ts +5 -0
- package/src/services/mcp.ts +1 -0
- package/src/store/test-coverage.md +19 -19
|
@@ -56,7 +56,7 @@ Key principles:
|
|
|
56
56
|
**Subagent workflow**:
|
|
57
57
|
|
|
58
58
|
1. **One subagent per action file** - Each subagent focuses on testing ONE action file completely
|
|
59
|
-
2. **Independent verification** - Each subagent runs its own
|
|
59
|
+
2. **Independent verification** - Each subagent runs its own typecheck, lint, and test verification
|
|
60
60
|
3. **No commits from subagents** - Only the parent agent creates the final commit after all subagents complete
|
|
61
61
|
4. **Parallel execution** - Launch all subagents in a single message using multiple Task tool calls
|
|
62
62
|
5. **Consolidate results** - Parent agent reviews all results, runs final verification, updates docs, and commits
|
|
@@ -129,12 +129,12 @@ For files with multiple action files to test, use the Task tool to create subage
|
|
|
129
129
|
2. **Launch one subagent per action file** using the Task tool
|
|
130
130
|
3. **Each subagent independently**:
|
|
131
131
|
- Writes tests for ONE action file only
|
|
132
|
-
- Runs
|
|
132
|
+
- Runs typecheck and lint
|
|
133
133
|
- Verifies tests pass
|
|
134
134
|
- Reports results back
|
|
135
135
|
- **DOES NOT commit** (parent agent handles commits)
|
|
136
136
|
4. **After all subagents complete**, review all results
|
|
137
|
-
5. **Run final verification** (
|
|
137
|
+
5. **Run final verification** (typecheck, lint, tests)
|
|
138
138
|
6. **Update test-coverage.md** with combined results
|
|
139
139
|
7. **Create single commit** with all new tests
|
|
140
140
|
|
|
@@ -146,7 +146,7 @@ Write comprehensive tests for src/store/discover/slices/plugin/action.ts followi
|
|
|
146
146
|
Requirements:
|
|
147
147
|
1. Write tests covering all actions in the file
|
|
148
148
|
2. Follow SWR hooks testing pattern (if applicable)
|
|
149
|
-
3. Run
|
|
149
|
+
3. Run typecheck and lint to verify
|
|
150
150
|
4. Run tests to ensure they pass
|
|
151
151
|
5. Report back with:
|
|
152
152
|
- Number of tests written
|
|
@@ -163,7 +163,7 @@ DO NOT:
|
|
|
163
163
|
|
|
164
164
|
- ✅ Parallel execution - multiple action files tested simultaneously
|
|
165
165
|
- ✅ Focused scope - each subagent handles one file completely
|
|
166
|
-
- ✅ Independent verification - each file gets
|
|
166
|
+
- ✅ Independent verification - each file gets typecheck/lint/test verification
|
|
167
167
|
- ✅ Clean commits - single commit after all work is done
|
|
168
168
|
- ✅ Better organization - clear separation of concerns
|
|
169
169
|
|
|
@@ -196,7 +196,7 @@ bunx vitest run --silent='passed-only' 'src/store/[domain]/slices/[slice]/action
|
|
|
196
196
|
|
|
197
197
|
```bash
|
|
198
198
|
# Check TypeScript types (from project root)
|
|
199
|
-
bun run
|
|
199
|
+
bun run typecheck
|
|
200
200
|
|
|
201
201
|
# Fix any linting issues
|
|
202
202
|
bunx eslint src/store/[domain]/ --fix
|
|
@@ -270,7 +270,7 @@ Based on your development summary, update the following sections:
|
|
|
270
270
|
bunx vitest run 'src/store'
|
|
271
271
|
|
|
272
272
|
# Verify type check still passes
|
|
273
|
-
bun run
|
|
273
|
+
bun run typecheck
|
|
274
274
|
```
|
|
275
275
|
|
|
276
276
|
### Complete Workflow Example (Single File)
|
|
@@ -281,7 +281,7 @@ bun run type-check
|
|
|
281
281
|
bunx vitest run --silent='passed-only' 'src/store/tool/slices/mcpStore/action.test.ts'
|
|
282
282
|
|
|
283
283
|
# 2. Type/Lint Phase (REQUIRED)
|
|
284
|
-
bun run
|
|
284
|
+
bun run typecheck # Must pass!
|
|
285
285
|
bunx eslint src/store/tool/ --fix
|
|
286
286
|
|
|
287
287
|
# 3. Coverage Phase
|
|
@@ -295,7 +295,7 @@ bunx vitest run --coverage 'src/store'
|
|
|
295
295
|
|
|
296
296
|
# 6. Final Verification
|
|
297
297
|
bunx vitest run 'src/store'
|
|
298
|
-
bun run
|
|
298
|
+
bun run typecheck
|
|
299
299
|
|
|
300
300
|
# 7. Commit
|
|
301
301
|
git add .
|
|
@@ -320,7 +320,7 @@ Task({
|
|
|
320
320
|
Requirements:
|
|
321
321
|
1. Write tests covering all actions (usePluginCategories, usePluginDetail, usePluginList, usePluginIdentifiers)
|
|
322
322
|
2. Follow SWR hooks testing pattern
|
|
323
|
-
3. Run
|
|
323
|
+
3. Run typecheck and lint to verify
|
|
324
324
|
4. Run tests to ensure they pass
|
|
325
325
|
5. Report back with number of tests written and coverage areas
|
|
326
326
|
|
|
@@ -335,7 +335,7 @@ Task({
|
|
|
335
335
|
Requirements:
|
|
336
336
|
1. Write tests covering all actions (useFetchMcpDetail, useFetchMcpList, useMcpCategories)
|
|
337
337
|
2. Follow SWR hooks testing pattern
|
|
338
|
-
3. Run
|
|
338
|
+
3. Run typecheck and lint to verify
|
|
339
339
|
4. Run tests to ensure they pass
|
|
340
340
|
5. Report back with number of tests written and coverage areas
|
|
341
341
|
|
|
@@ -350,7 +350,7 @@ DO NOT commit changes or update test-coverage.md.`,
|
|
|
350
350
|
Each subagent will:
|
|
351
351
|
|
|
352
352
|
- Write tests
|
|
353
|
-
- Run
|
|
353
|
+
- Run typecheck and lint
|
|
354
354
|
- Verify tests pass
|
|
355
355
|
- Report results
|
|
356
356
|
|
|
@@ -365,8 +365,8 @@ After all subagents complete:
|
|
|
365
365
|
**Step 4: Final Verification**
|
|
366
366
|
|
|
367
367
|
```bash
|
|
368
|
-
# Run
|
|
369
|
-
bun run
|
|
368
|
+
# Run typecheck on entire project
|
|
369
|
+
bun run typecheck
|
|
370
370
|
|
|
371
371
|
# Run lint on all new test files
|
|
372
372
|
bunx eslint src/store/discover/ --fix
|
|
@@ -396,7 +396,7 @@ git commit -m "✅ test(store): add comprehensive tests for discover store
|
|
|
396
396
|
|
|
397
397
|
- Add tests for plugin, mcp, assistant, model, provider slices
|
|
398
398
|
- Coverage: X% → Y% (+Z tests, 5 new test files)
|
|
399
|
-
- All tests pass
|
|
399
|
+
- All tests pass typecheck and lint
|
|
400
400
|
|
|
401
401
|
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
402
402
|
|
|
@@ -444,7 +444,7 @@ bunx vitest watch 'src/store/[domain]/slices/[slice]/action.test.ts'
|
|
|
444
444
|
|
|
445
445
|
```bash
|
|
446
446
|
# Type check entire project (from project root)
|
|
447
|
-
bun run
|
|
447
|
+
bun run typecheck
|
|
448
448
|
|
|
449
449
|
# Watch mode
|
|
450
450
|
bunx tsc --noEmit --watch
|
|
@@ -494,7 +494,7 @@ bunx eslint src/store/[domain]/
|
|
|
494
494
|
- Semantic search and RAG integration testing
|
|
495
495
|
- File upload with progress callbacks
|
|
496
496
|
- **Development Method**: Used parallel subagents (9 subagents running simultaneously)
|
|
497
|
-
- **Type Safety**: All tests pass
|
|
497
|
+
- **Type Safety**: All tests pass typecheck ✅
|
|
498
498
|
- **Lint**: All tests pass lint ✅
|
|
499
499
|
- **Action Files Coverage**: 31/40 → 40/40 tested (100%, +9 files)
|
|
500
500
|
- **🎉 MILESTONE**: All 40 action files now have comprehensive test coverage!
|
|
@@ -523,7 +523,7 @@ bunx eslint src/store/[domain]/
|
|
|
523
523
|
- AbortController management testing
|
|
524
524
|
- Mock return types matching actual services
|
|
525
525
|
- **Development Method**: Used parallel subagents (2 subagents, one per file)
|
|
526
|
-
- **Type Safety**: All tests pass
|
|
526
|
+
- **Type Safety**: All tests pass typecheck ✅
|
|
527
527
|
- **Lint**: All tests pass lint ✅
|
|
528
528
|
- **Action Files Coverage**: 31/40 tested (77.5%, +2 files)
|
|
529
529
|
- **Milestone**: 🏆 All high priority files (>200 LOC) now have comprehensive tests!
|
|
@@ -544,7 +544,7 @@ bunx eslint src/store/[domain]/
|
|
|
544
544
|
- Successfully adapted zustand testing patterns for SWR hooks
|
|
545
545
|
- Mock strategy: Synchronously return data from mock useSWR
|
|
546
546
|
- Type safety: Used `as any` for test mock data where needed
|
|
547
|
-
- **Type Safety**: All tests pass
|
|
547
|
+
- **Type Safety**: All tests pass typecheck
|
|
548
548
|
- **Action Files Coverage**: 29/40 tested (72.5%, +2 files)
|
|
549
549
|
|
|
550
550
|
**Session (2024-10-14)**: 📋 Store Testing Documentation Created
|