Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
29ffa95
feat: port generate() and ollama integration from PR #73
hawkeyexl Jan 27, 2026
6fce59d
chore: upgrade zod to v4 to support ollama-ai-provider-v2
hawkeyexl Jan 27, 2026
96cf24c
fix: remove test stubs, use real Ollama API calls in CI
hawkeyexl Jan 27, 2026
e70fd07
Add Windows Ollama support and remove test skipping
hawkeyexl Jan 27, 2026
47309c1
fix: check if Ollama already running before starting server
hawkeyexl Jan 27, 2026
6fd6ac3
fix: check Ollama availability at custom baseUrl before pulling
hawkeyexl Jan 27, 2026
697c298
fix: use dynamic import for chai in ollama.test.js
hawkeyexl Jan 27, 2026
61c8b4d
ci: add fail-fast: false to test matrix
hawkeyexl Jan 27, 2026
8a24fe4
ci: increase test timeout to 30 minutes
hawkeyexl Jan 27, 2026
63a3458
test: add comprehensive coverage tests for ai and ollama modules
hawkeyexl Jan 27, 2026
67ac3eb
ci: temporarily lower coverage thresholds for ai module
hawkeyexl Jan 27, 2026
7f165ed
ci: skip Ollama installation on macOS/Windows to prevent timeout
hawkeyexl Jan 28, 2026
9f2a96b
test: skip Ollama integration tests when Ollama unavailable
hawkeyexl Jan 28, 2026
ab4e577
test: skip Ollama default provider test when unavailable
hawkeyexl Jan 28, 2026
d9c56c7
test: auto-start Ollama server for AI tests with smart fallback strategy
hawkeyexl Jan 28, 2026
6b8bee8
test: add comprehensive unit tests for Ollama setup utilities
hawkeyexl Jan 28, 2026
92818cd
fix: Address PR review comments from coderabbit and copilot
hawkeyexl Jan 28, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Code Quality Reviewer Prompt Template
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Placeholder file with no actual content.

This file contains only a title with no actual prompt template content. If this is intentional scaffolding for future work, consider adding a TODO comment or removing until the actual content is ready. If the content was meant to be included, please add the complete prompt template.

🤖 Prompt for AI Agents
In
@.opencode/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md
at line 1, The file contains only a title "Code Quality Reviewer Prompt
Template" with no body; either populate it with the actual prompt template
content or add a clear TODO/comment indicating intentional scaffolding, or
remove the file if unused; update the file header to include the real template
text (or a TODO placeholder) so reviewers know it's intentional and not an
accidental empty file.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implementer Prompt Template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Spec Reviewer Prompt Template
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Placeholder file with no actual content.

Same as the other prompt template files. Consider deferring these additions until the actual prompt templates are developed.

🤖 Prompt for AI Agents
In
@.opencode/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md
at line 1, This file is an empty placeholder; either remove the placeholder
(delete
.opencode/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md)
from the PR or replace it with a clear TODO placeholder header and minimal
metadata (e.g., "TODO: implement spec reviewer prompt template") so it isn't
committed as an empty artifact; if you must keep it, also add a comment in the
repo README or an index referencing the pending templates so reviewers know it's
intentionally deferred.

8 changes: 8 additions & 0 deletions .opencode/todos/port-ai-js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- [ ] Implement `src/ai.ts` and `test/ai.test.ts`
- [ ] Create `test/ai.test.ts` with content from `.opencode/pr_content/test/ai.test.ts` (but corrected paths)
- [ ] Create `src/ai.ts` with basic scaffolding
- [ ] Implement `detectProvider` logic
- [ ] Implement `generate` logic
- [ ] Implement `generateWithSchemaValidation` logic
- [ ] Implement helpers (`simplifySchemaForOllama`, `fileToImagePart`, etc.)
- [ ] Verify with tests
60 changes: 60 additions & 0 deletions dist/ai.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { z } from "zod";
export declare const DEFAULT_MODEL = "ollama/qwen3:4b";
export declare const MAX_SCHEMA_VALIDATION_RETRIES = 3;
/**
* Maps our supported model enums to the model identifiers that platforms expect.
*/
export declare const modelMap: Record<string, string>;
interface DetectedProvider {
provider: "openai" | "anthropic" | "google" | "ollama" | null;
model: string | null;
apiKey?: string | null;
baseURL?: string;
}
/**
* Detects the provider, model, and API from a model string and environment variables.
*/
export declare const detectProvider: (config: any, model: string) => Promise<DetectedProvider>;
/**
* Simplifies a JSON schema for providers with limited schema support (e.g., Ollama).
* - Dereferences $ref pointers
* - Merges allOf schemas
* - Converts top-level anyOf (discriminated unions) into a single object with all options as optional properties
* - Simplifies nested anyOf by preferring object types
* - Removes unsupported keywords like pattern, components, etc.
*/
export declare const simplifySchemaForOllama: (schema: any) => any;
/**
* Extracts the API key for a provider from a Doc Detective config object.
*/
export declare const getApiKey: (config: any, provider: "openai" | "anthropic" | "google") => any;
export interface GenerateOptions {
prompt?: string;
messages?: any[];
files?: any[];
model?: string;
system?: string;
schema?: z.ZodSchema | any;
schemaName?: string;
schemaDescription?: string;
provider?: "openai" | "anthropic" | "ollama" | "google";
config?: any;
apiKey?: string;
baseURL?: string;
temperature?: number;
maxTokens?: number;
}
/**
* Generates text or structured output using an AI model.
*/
export declare const generate: ({ prompt, messages, files, model, system, schema, schemaName, schemaDescription, provider, config, apiKey, baseURL, temperature, maxTokens, }: GenerateOptions) => Promise<{
object: any;
usage: import("ai").LanguageModelUsage;
finishReason: import("ai").FinishReason;
} | {
text: string;
usage: import("ai").LanguageModelUsage;
finishReason: import("ai").FinishReason;
}>;
export {};
//# sourceMappingURL=ai.d.ts.map
1 change: 1 addition & 0 deletions dist/ai.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading