mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat(assistant): self-configuring assistant mode (#244)
* test(backend): replace better-sqlite3 test mock with node:sqlite Reimplement the bun:sqlite test mock on top of node:sqlite with an explicit BEGIN/COMMIT/ROLLBACK transaction wrapper. * feat(assistant): self-configuring assistant mode Add a self-editable assistant workspace and the APIs that support it: - POST /assistant/reload disposes and re-bootstraps the assistant instance (directory-scoped, rate-limited) so agent.md edits apply. - Internal settings API accepts non-secret TTS/STT patches via dedicated partial schemas. - Strip the generated agent persona from opencode.json on repair so user-customized agents are preserved across config recovery. - Cache the last assistant session id to avoid redundant session listing on launch. * style(repo): align worktree and workspace tabs with primary/orange theme
This commit is contained in:
1 parent
eedbbfb94e
commit
dbd6866682
22 files changed
+733
-156
No files matched your search
@@ -5,6 +5,7 @@ import { createInternalRoutes } from '../../src/routes/internal'
|
||||
import type { ScheduleService } from '../../src/services/schedules'
|
||||
import type { NotificationService } from '../../src/services/notification'
|
||||
import type { SettingsService } from '../../src/services/settings'
|
||||
import type { OpenCodeClient } from '../../src/services/opencode/client'
|
||||
import type { Repo } from '../../src/types/repo'
|
||||
|
||||
const mockDb = {
|
||||
@@ -73,8 +74,18 @@ describe('internal-opencode-workspaces routes', () => {
|
||||
const scheduleService = {} as ScheduleService
|
||||
const notificationService = {} as NotificationService
|
||||
const settingsService = {} as SettingsService
|
||||
const openCodeClient = {
|
||||
forward: vi.fn(),
|
||||
forwardRaw: vi.fn(),
|
||||
getJson: vi.fn(),
|
||||
postJson: vi.fn(),
|
||||
setProviderAuth: vi.fn(),
|
||||
deleteProviderAuth: vi.fn(),
|
||||
startMcpAuth: vi.fn(),
|
||||
authenticateMcp: vi.fn(),
|
||||
} as unknown as OpenCodeClient
|
||||
app = new Hono()
|
||||
app.route('/api/internal', createInternalRoutes(mockDb, scheduleService, notificationService, settingsService))
|
||||
app.route('/api/internal', createInternalRoutes(mockDb, scheduleService, notificationService, settingsService, openCodeClient))
|
||||
token = 'test-internal-token'
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user