fix: require user to specify the provider

This commit is contained in:
Joe Fleming
2026-03-13 20:45:33 -06:00
parent b6df31fcbf
commit 74a5e70322
9 changed files with 74 additions and 77 deletions

View File

@@ -19,13 +19,14 @@ Docs directory created with 4 files (PRD.md, Architecture.md, API.md, Discoverie
- **lint**: all `${err}` in template literals → `${String(err)}`; `String(args['key'] ?? '')``strArg(args, 'key')` helper; unused `onProgress` param → `_onProgress`; WebSocket `onerror` `err` type is `Event` → use `err.type`
## Work Queue (next steps)
1. [x] Create workspace helper module (src/workspace.ts) with ensureWorkspace() and syncTemplates()
1. [x] Create workspace helper module (src/cli/utils.ts) with ensureWorkspace() and syncTemplates()
2. [x] Create onboard command (src/cli/onboard.ts) with path argument and directory-not-empty guard
3. [x] Update src/cli/commands.ts to use ensureWorkspace() instead of inline mkdirSync
4. [x] Typecheck and lint pass (0 errors)
5. [x] Runtime smoke test: `bun run nanobot --help`
6. [x] Test onboard command: `bun run nanobot onboard [path]`
7. [ ] Test with a real Mattermost config (optional — user can do this)
3. [x] Agent/gateway commands check workspace exists (throw if not found)
4. [x] Added required `provider` field to agent config (values: anthropic, openai, google, openrouter, ollama)
5. [x] Provider resolution uses explicit provider from config (no model prefix parsing)
6. [x] Typecheck and lint pass (0 errors)
7. [x] Test onboard and agent commands work correctly
8. [ ] Test with a real Mattermost config (optional — user can do this)
## Key Decisions Made
- Mattermost channel uses raw WebSocket + fetch (no mattermostdriver, no SSL hack)
@@ -34,3 +35,5 @@ Docs directory created with 4 files (PRD.md, Architecture.md, API.md, Discoverie
- Config is fresh Zod schema (no migration from Python config needed)
- `ollama-ai-provider` package (not `@ai-sdk/ollama` which 404s on npm)
- `strArg(args, key, fallback?)` helper exported from `agent/tools/base.ts` for safe unknown→string extraction
- Agent config requires explicit `provider` field (no more model prefix like "anthropic/claude-...")
- Model names are now just the raw model ID (e.g., "claude-sonnet-4-5" not "anthropic/claude-sonnet-4-5")

View File

@@ -8,49 +8,20 @@
- All dependencies installed
- `src/` directory structure scaffolded
- Memory bank initialized
- All source files written (first pass):
- `src/config/types.ts` + `src/config/loader.ts`
- `src/bus/types.ts` + `src/bus/queue.ts`
- `src/provider/types.ts` + `src/provider/index.ts`
- `src/session/types.ts` + `src/session/manager.ts`
- `src/agent/tools/base.ts` (+ `strArg` helper)
- `src/agent/tools/filesystem.ts`
- `src/agent/tools/shell.ts`
- `src/agent/tools/web.ts`
- `src/agent/tools/message.ts`
- `src/agent/tools/spawn.ts` + `src/agent/subagent.ts`
- `src/agent/tools/cron.ts`
- `src/cron/types.ts` + `src/cron/service.ts`
- `src/heartbeat/service.ts`
- `src/agent/memory.ts`
- `src/agent/skills.ts`
- `src/agent/context.ts`
- `src/agent/loop.ts`
- `src/channels/base.ts` + `src/channels/mattermost.ts`
- `src/channels/manager.ts`
- `src/cli/commands.ts`
- `index.ts`
- All source files written (first pass)
- Templates and skills copied from Python repo
- **Full typecheck pass**: `tsc --noEmit` → 0 errors
- **Full lint pass**: `oxlint` → 0 errors, 0 warnings
- `package.json` scripts added: `start`, `dev`, `typecheck`
- **Docs created**: `/docs/PRD.md`, `Architecture.md`, `API.md`, `Discoveries.md`
- **Onboard command**: Created `src/cli/onboard.ts` with workspace initialization
- **Provider config**: Added required `provider` field to agent config
- **Workspace validation**: Agent/gateway commands throw if workspace doesn't exist
### 🔄 In Progress
- Nothing
### ✅ Done
- Created src/workspace.ts with ensureWorkspace(), syncTemplates(), checkWorkspaceEmpty()
- Created src/cli/onboard.ts command with path argument
- Updated src/cli/commands.ts to use ensureWorkspace() helper
- Typecheck: 0 errors
- Lint: 0 warnings
### 🔄 In Progress
- Testing onboard command
### ⏳ Pending
- Runtime smoke test: `bun run nanobot --help`
- Integration test with a real Mattermost server
## Known Issues / Risks