Merge branch 'main' of https://github.com/continuedev/continue into fix-jetbrains-compiler-warnings

This commit is contained in:
Dallin Romney 2025-11-18 18:34:09 -08:00
commit 670d092ce1
52 changed files with 59424 additions and 2505 deletions

View file

@ -338,6 +338,17 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: true
- uses: actions/checkout@v5
- name: Run JetBrains tests
uses: ./.github/actions/run-jetbrains-tests

59029
binary/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -20,7 +20,7 @@ import AutocompleteLruCache from "./util/AutocompleteLruCache.js";
import { HelperVars } from "./util/HelperVars.js";
import { AutocompleteInput, AutocompleteOutcome } from "./util/types.js";
const autocompleteCache = AutocompleteLruCache.get();
const autocompleteCachePromise = AutocompleteLruCache.get();
// Errors that can be expected on occasion even during normal functioning should not be shown.
// Not worth disrupting the user to tell them that a single autocomplete request didn't go through
@ -31,7 +31,7 @@ const ERRORS_TO_IGNORE = [
];
export class CompletionProvider {
private autocompleteCache = AutocompleteLruCache.get();
private autocompleteCache?: AutocompleteLruCache;
public errorsShown: Set<string> = new Set();
private bracketMatchingService = new BracketMatchingService();
private debouncer = new AutocompleteDebouncer();
@ -48,6 +48,22 @@ export class CompletionProvider {
) {
this.completionStreamer = new CompletionStreamer(this.onError.bind(this));
this.contextRetrievalService = new ContextRetrievalService(this.ide);
void this.initCache();
}
private async initCache() {
try {
this.autocompleteCache = await autocompleteCachePromise;
} catch (e) {
console.error("Failed to initialize autocomplete cache:", e);
}
}
private async getCache(): Promise<AutocompleteLruCache> {
if (!this.autocompleteCache) {
this.autocompleteCache = await autocompleteCachePromise;
}
return this.autocompleteCache;
}
private async _prepareLlm(): Promise<ILLM | undefined> {
@ -201,14 +217,12 @@ export class CompletionProvider {
// Completion
let completion: string | undefined = "";
const cache = await autocompleteCache;
const cache = await this.getCache();
const cachedCompletion = helper.options.useCache
? await cache.get(helper.prunedPrefix)
: undefined;
let cacheHit = false;
if (cachedCompletion) {
// Cache
cacheHit = true;
completion = cachedCompletion;
} else {
@ -277,16 +291,12 @@ export class CompletionProvider {
outcome.enabledStaticContextualization = true;
}
//////////
// Save to cache
if (!outcome.cacheHit && helper.options.useCache) {
(await this.autocompleteCache)
void cache
.put(outcome.prefix, outcome.completion)
.catch((e) => console.warn(`Failed to save to cache: ${e.message}`));
}
// When using the JetBrains extension, Mark as displayed
const ideType = (await this.ide.getIdeInfo()).ideType;
if (ideType === "jetbrains") {
this.markDisplayed(input.completionId, outcome);
@ -299,4 +309,10 @@ export class CompletionProvider {
this.loggingService.deleteAbortController(input.completionId);
}
}
public async dispose() {
if (this.autocompleteCache) {
await this.autocompleteCache.close();
}
}
}

View file

@ -0,0 +1,650 @@
import AutocompleteLruCache from "./AutocompleteLruCache";
jest.mock("async-mutex", () => {
const acquire = jest.fn().mockResolvedValue(jest.fn());
return {
Mutex: jest.fn().mockImplementation(() => ({ acquire })),
};
});
jest.mock("sqlite");
jest.mock("sqlite3");
jest.useFakeTimers();
describe("AutocompleteLruCache", () => {
let mockDb: any;
let cache: AutocompleteLruCache;
let currentTime: number;
const createMockDb = () => ({
run: jest.fn().mockResolvedValue(undefined),
all: jest.fn().mockResolvedValue([]),
exec: jest.fn().mockResolvedValue(undefined),
close: jest.fn().mockResolvedValue(undefined),
});
beforeEach(() => {
jest.clearAllTimers();
jest.clearAllMocks();
currentTime = 1000000;
jest.spyOn(Date, "now").mockImplementation(() => currentTime);
mockDb = createMockDb();
cache = new (AutocompleteLruCache as any)(mockDb);
// Reset static properties
(AutocompleteLruCache as any).capacity = 1000;
(AutocompleteLruCache as any).flushInterval = 30000;
});
afterEach(async () => {
// Clean up any running timers
if ((cache as any).flushTimer) {
clearInterval((cache as any).flushTimer);
}
jest.restoreAllMocks();
});
// ═══════════════════════════════════════════════════════════════
// BASIC CACHE OPERATIONS
// ═══════════════════════════════════════════════════════════════
describe("Basic Cache Operations", () => {
describe("put() method", () => {
it("should store a new entry in the cache", async () => {
await cache.put("hello", "world");
const internalCache = (cache as any).cache;
expect(internalCache.has("hello")).toBe(true);
expect(internalCache.get("hello")).toEqual({
value: "world",
timestamp: currentTime,
});
});
it("should mark entry as dirty after put", async () => {
await cache.put("key", "value");
const dirtySet = (cache as any).dirty;
expect(dirtySet.has("key")).toBe(true);
});
it("should update existing entry with new value and timestamp", async () => {
await cache.put("key", "old");
currentTime += 5000;
await cache.put("key", "new");
const entry = (cache as any).cache.get("key");
expect(entry.value).toBe("new");
expect(entry.timestamp).toBe(currentTime);
});
it("should handle prefix storage correctly", async () => {
await cache.put("original_prefix", "completion");
const internalCache = (cache as any).cache;
expect(internalCache.size).toBe(1);
});
it("should acquire mutex lock during put operation", async () => {
const releaseSpy = jest.fn();
const mutex = (cache as any).mutex;
const acquireSpy = jest
.spyOn(mutex, "acquire")
.mockResolvedValue(releaseSpy);
await cache.put("test", "value");
expect(acquireSpy).toHaveBeenCalled();
expect(releaseSpy).toHaveBeenCalled();
});
});
describe("get() method", () => {
it("should retrieve exact match from cache", async () => {
await cache.put("prefix", "completion");
const result = await cache.get("prefix");
expect(result).toBe("completion");
});
it("should return undefined when no match exists", async () => {
const result = await cache.get("nonexistent");
expect(result).toBeUndefined();
});
it("should update timestamp when entry is accessed", async () => {
await cache.put("key", "value");
const originalTimestamp = (cache as any).cache.get("key").timestamp;
currentTime += 10000;
await cache.get("key");
const updatedTimestamp = (cache as any).cache.get("key").timestamp;
expect(updatedTimestamp).toBe(currentTime);
expect(updatedTimestamp).toBeGreaterThan(originalTimestamp);
});
it("should mark entry as dirty after updating timestamp", async () => {
await cache.put("key", "value");
(cache as any).dirty.clear();
await cache.get("key");
expect((cache as any).dirty.has("key")).toBe(true);
});
it("should find longest matching prefix", async () => {
await cache.put("hel", "lo_world");
await cache.put("hello", "_user_suffix");
const result = await cache.get("hello_user");
expect(result).toBe("_suffix");
});
it("should return completion with correct prefix stripped", async () => {
await cache.put("pre", "fix_completion");
const result = await cache.get("prefix");
expect(result).toBe("_completion");
});
it("should validate that completion starts with remaining prefix", async () => {
await cache.put("abc", "xyz");
// "abcdef" starts with "abc", remaining is "def"
// But cached value "xyz" doesn't start with "def"
const result = await cache.get("abcdef");
expect(result).toBeUndefined();
});
it("should handle prefix matching logic", async () => {
await cache.put("pre", "fix_completion");
const result = await cache.get("prefix");
// Result depends on truncateSqliteLikePattern behavior
expect(
result === "fix_completion" ||
result === "_completion" ||
result === undefined,
).toBe(true);
});
});
});
// ═══════════════════════════════════════════════════════════════
// LRU EVICTION MECHANISM
// ═══════════════════════════════════════════════════════════════
describe("LRU Eviction", () => {
beforeEach(() => {
(AutocompleteLruCache as any).capacity = 3;
});
it("should respect capacity limit", async () => {
await cache.put("a", "1");
await cache.put("b", "2");
await cache.put("c", "3");
expect((cache as any).cache.size).toBe(3);
await cache.put("d", "4");
expect((cache as any).cache.size).toBe(3);
});
it("should evict oldest entry when capacity exceeded", async () => {
await cache.put("a", "1");
currentTime += 1000;
await cache.put("b", "2");
currentTime += 1000;
await cache.put("c", "3");
currentTime += 1000;
await cache.put("d", "4"); // Should evict "a"
expect(await cache.get("a")).toBeUndefined();
expect(await cache.get("b")).toBe("2");
expect(await cache.get("c")).toBe("3");
expect(await cache.get("d")).toBe("4");
});
it("should keep recently accessed entries during eviction", async () => {
await cache.put("a", "1");
currentTime += 1000;
await cache.put("b", "2");
currentTime += 1000;
await cache.put("c", "3");
currentTime += 1000;
// Access "a" to make it recent
await cache.get("a");
currentTime += 1000;
await cache.put("d", "4"); // Should evict "b" (oldest)
expect(await cache.get("a")).toBe("1");
expect(await cache.get("b")).toBeUndefined();
expect(await cache.get("c")).toBe("3");
expect(await cache.get("d")).toBe("4");
});
it("should mark evicted entry as dirty for database deletion", async () => {
await cache.put("a", "1");
await cache.put("b", "2");
await cache.put("c", "3");
(cache as any).dirty.clear();
await cache.put("d", "4");
const dirtySet = (cache as any).dirty;
expect(dirtySet.size).toBeGreaterThan(0);
});
it("should handle capacity of 1", async () => {
(AutocompleteLruCache as any).capacity = 1;
await cache.put("a", "1");
await cache.put("b", "2");
expect((cache as any).cache.size).toBe(1);
expect(await cache.get("a")).toBeUndefined();
expect(await cache.get("b")).toBe("2");
});
it("should find oldest entry among multiple old entries", async () => {
await cache.put("a", "1");
currentTime += 100;
await cache.put("b", "2");
currentTime += 100;
await cache.put("c", "3");
// Make "b" oldest by accessing "a" and "c"
currentTime += 100;
await cache.get("c");
currentTime += 100;
await cache.get("a");
currentTime += 100;
await cache.put("d", "4"); // Should evict "b"
expect(await cache.get("b")).toBeUndefined();
});
});
// ═══════════════════════════════════════════════════════════════
// DATABASE PERSISTENCE & FLUSH
// ═══════════════════════════════════════════════════════════════
describe("Database Persistence", () => {
describe("flush() method", () => {
it("should do nothing when dirty set is empty", async () => {
await cache.flush();
expect(mockDb.run).not.toHaveBeenCalled();
});
it("should wrap operations in transaction", async () => {
await cache.put("key", "value");
await cache.flush();
const calls = mockDb.run.mock.calls;
expect(calls[0][0]).toBe("BEGIN TRANSACTION");
expect(calls[calls.length - 1][0]).toBe("COMMIT");
});
it("should perform upsert for existing cache entries", async () => {
await cache.put("foo", "bar");
await cache.flush();
expect(mockDb.run).toHaveBeenCalledWith(
expect.stringContaining("INSERT INTO cache"),
"foo",
"bar",
currentTime,
"bar",
currentTime,
);
});
it("should delete entries removed from cache", async () => {
await cache.put("temp", "value");
(cache as any).cache.delete("temp");
(cache as any).dirty.add("temp");
await cache.flush();
expect(mockDb.run).toHaveBeenCalledWith(
"DELETE FROM cache WHERE key = ?",
"temp",
);
});
it("should clear dirty set after successful flush", async () => {
await cache.put("key1", "val1");
await cache.put("key2", "val2");
expect((cache as any).dirty.size).toBe(2);
await cache.flush();
expect((cache as any).dirty.size).toBe(0);
});
it("should rollback transaction on error", async () => {
await cache.put("key", "value");
mockDb.run.mockImplementation((sql: string) => {
if (sql.includes("INSERT")) {
return Promise.reject(new Error("DB Error"));
}
return Promise.resolve();
});
await cache.flush();
expect(mockDb.run).toHaveBeenCalledWith("ROLLBACK");
});
it("should log error when flush fails", async () => {
const consoleError = jest.spyOn(console, "error").mockImplementation();
await cache.put("key", "value");
const dbError = new Error("Database failure");
mockDb.run.mockRejectedValueOnce(dbError);
await cache.flush();
expect(consoleError).toHaveBeenCalledWith(
"Error flushing cache:",
dbError,
);
consoleError.mockRestore();
});
it("should acquire mutex during flush", async () => {
const releaseSpy = jest.fn();
const mutex = (cache as any).mutex;
const acquireSpy = jest
.spyOn(mutex, "acquire")
.mockResolvedValue(releaseSpy);
await cache.put("key", "value");
await cache.flush();
expect(acquireSpy).toHaveBeenCalled();
expect(releaseSpy).toHaveBeenCalled();
});
it("should release mutex even if error occurs", async () => {
const consoleError = jest.spyOn(console, "error").mockImplementation();
const releaseSpy = jest.fn();
jest
.spyOn((cache as any).mutex, "acquire")
.mockResolvedValue(releaseSpy);
await cache.put("key", "value");
const originalRun = mockDb.run;
mockDb.run = jest.fn().mockImplementation((sql: string) => {
if (sql === "BEGIN TRANSACTION" || sql === "ROLLBACK") {
return Promise.resolve();
}
return Promise.reject(new Error("DB Error"));
});
await cache.flush();
expect(releaseSpy).toHaveBeenCalled();
expect(mockDb.run).toHaveBeenCalledWith("ROLLBACK");
// Restore
mockDb.run = originalRun;
consoleError.mockRestore();
});
it("should handle multiple dirty entries in one flush", async () => {
await cache.put("key1", "val1");
await cache.put("key2", "val2");
await cache.put("key3", "val3");
await cache.flush();
const insertCalls = mockDb.run.mock.calls.filter((call: any) =>
call[0].includes("INSERT INTO cache"),
);
expect(insertCalls.length).toBe(3);
});
});
describe("loadFromDb() method", () => {
it("should load all entries from database", async () => {
mockDb.all.mockResolvedValue([
{ key: "a", value: "alpha", timestamp: 1000 },
{ key: "b", value: "beta", timestamp: 2000 },
]);
await (cache as any).loadFromDb();
const internalCache = (cache as any).cache;
expect(internalCache.size).toBe(2);
expect(internalCache.get("a")).toEqual({
value: "alpha",
timestamp: 1000,
});
expect(internalCache.get("b")).toEqual({
value: "beta",
timestamp: 2000,
});
});
it("should handle empty database", async () => {
mockDb.all.mockResolvedValue([]);
await (cache as any).loadFromDb();
expect((cache as any).cache.size).toBe(0);
});
it("should query with correct SQL", async () => {
await (cache as any).loadFromDb();
expect(mockDb.all).toHaveBeenCalledWith(
"SELECT key, value, timestamp FROM cache",
);
});
});
});
// ═══════════════════════════════════════════════════════════════
// AUTOMATIC FLUSH TIMER
// ═══════════════════════════════════════════════════════════════
describe("Automatic Flush Timer", () => {
it("should start timer on startFlushTimer()", () => {
(cache as any).startFlushTimer();
expect((cache as any).flushTimer).toBeDefined();
});
it("should call flush at configured intervals", async () => {
(AutocompleteLruCache as any).flushInterval = 1000;
const flushSpy = jest.spyOn(cache, "flush").mockResolvedValue();
(cache as any).startFlushTimer();
jest.advanceTimersByTime(1000);
expect(flushSpy).toHaveBeenCalledTimes(1);
jest.advanceTimersByTime(1000);
expect(flushSpy).toHaveBeenCalledTimes(2);
jest.advanceTimersByTime(1000);
expect(flushSpy).toHaveBeenCalledTimes(3);
flushSpy.mockRestore();
});
it("should handle flush errors gracefully", async () => {
const consoleError = jest.spyOn(console, "error").mockImplementation();
const flushError = new Error("Flush failed");
jest.spyOn(cache, "flush").mockRejectedValue(flushError);
(AutocompleteLruCache as any).flushInterval = 1000;
(cache as any).startFlushTimer();
jest.advanceTimersByTime(1000);
await Promise.resolve(); // Let error handler run
expect(consoleError).toHaveBeenCalledWith(
"Error flushing cache:",
flushError,
);
consoleError.mockRestore();
});
});
// ═══════════════════════════════════════════════════════════════
// RESOURCE CLEANUP
// ═══════════════════════════════════════════════════════════════
describe("Resource Cleanup", () => {
it("should clear timer on close()", async () => {
(cache as any).startFlushTimer();
const timerId = (cache as any).flushTimer;
const clearSpy = jest.spyOn(global, "clearInterval");
await cache.close();
expect(clearSpy).toHaveBeenCalledWith(timerId);
});
it("should flush pending changes on close()", async () => {
await cache.put("key", "value");
await cache.close();
expect(mockDb.run).toHaveBeenCalledWith(
expect.stringContaining("INSERT INTO cache"),
"key",
"value",
currentTime,
"value",
currentTime,
);
});
it("should close database connection", async () => {
await cache.close();
expect(mockDb.close).toHaveBeenCalled();
});
it("should execute cleanup in correct order", async () => {
(cache as any).startFlushTimer();
await cache.put("key", "value");
const operations: string[] = [];
const originalClearInterval = clearInterval;
const clearIntervalSpy = jest
.spyOn(global, "clearInterval")
.mockImplementation((id) => {
operations.push("clearTimer");
return originalClearInterval(id);
});
const flushSpy = jest
.spyOn(cache, "flush")
.mockImplementation(async () => {
operations.push("flush");
});
const closeDbSpy = mockDb.close.mockImplementation(() => {
operations.push("dbClose");
return Promise.resolve();
});
await cache.close();
expect(operations).toEqual(["clearTimer", "flush", "dbClose"]);
clearIntervalSpy.mockRestore();
flushSpy.mockRestore();
});
it("should handle close() when timer not started", async () => {
// Don't start timer
await expect(cache.close()).resolves.not.toThrow();
});
});
// ═══════════════════════════════════════════════════════════════
// EDGE CASES & SPECIAL SCENARIOS
// ═══════════════════════════════════════════════════════════════
describe("Edge Cases", () => {
it("should handle empty string as prefix", async () => {
await cache.put("", "empty");
const result = await cache.get("");
expect(result).toBe("empty");
});
it("should handle very long prefixes", async () => {
const longPrefix = "a".repeat(1000);
await cache.put(longPrefix, "completion");
const result = await cache.get(longPrefix);
expect(result).toBe("completion");
});
it("should handle special characters in prefix", async () => {
const specialPrefix = "test%_\\[";
await cache.put(specialPrefix, "special");
const result = await cache.get(specialPrefix);
expect(result).toBe("special");
});
it("should handle Unicode characters", async () => {
await cache.put("🚀", "rocket");
const result = await cache.get("🚀");
expect(result).toBe("rocket");
});
it("should handle multiple puts of same key", async () => {
await cache.put("key", "first");
await cache.put("key", "second");
await cache.put("key", "third");
expect(await cache.get("key")).toBe("third");
expect((cache as any).cache.size).toBe(1);
});
it("should handle concurrent get operations", async () => {
await cache.put("shared", "value");
const results = await Promise.all([
cache.get("shared"),
cache.get("shared"),
cache.get("shared"),
]);
expect(results).toEqual(["value", "value", "value"]);
});
});
// ═══════════════════════════════════════════════════════════════
// SINGLETON PATTERN (Static get() method)
// ═══════════════════════════════════════════════════════════════
describe("Singleton Pattern", () => {
beforeEach(() => {
// Reset singleton
(AutocompleteLruCache as any).instancePromise = undefined;
});
it("should return same instance on multiple calls", async () => {
const mockOpen = jest.fn().mockResolvedValue(mockDb);
jest.doMock("sqlite", () => ({ open: mockOpen }));
const instance1 = await AutocompleteLruCache.get();
const instance2 = await AutocompleteLruCache.get();
expect(instance1).toBe(instance2);
});
});
});

View file

@ -1,121 +1,227 @@
import { Mutex } from "async-mutex";
import { open } from "sqlite";
import sqlite3 from "sqlite3";
import {
DatabaseConnection,
truncateSqliteLikePattern,
} from "../../indexing/refreshIndex.js";
import { getTabAutocompleteCacheSqlitePath } from "../../util/paths.js";
interface CacheEntry {
value: string;
timestamp: number;
}
/**
* LRU cache for autocomplete results with SQLite persistence.
*
* Implements a least-recently-used cache that:
* - Stores prefix-to-completion mappings in memory
* - Periodically flushes changes to SQLite for persistence
* - Evicts oldest entries when capacity is exceeded
* - Supports prefix matching for flexible autocomplete retrieval
*/
export class AutocompleteLruCache {
private static capacity = 1000;
private static flushInterval = 30000;
private static instancePromise?: Promise<AutocompleteLruCache>;
private mutex = new Mutex();
private cache: Map<string, CacheEntry> = new Map();
private dirty: Set<string> = new Set();
private flushTimer?: NodeJS.Timeout;
constructor(private db: DatabaseConnection) {}
/**
* Singleton accessor that initializes the cache with SQLite persistence.
* Creates the database table if it doesn't exist and loads existing entries.
*/
static async get(): Promise<AutocompleteLruCache> {
const db = await open({
filename: getTabAutocompleteCacheSqlitePath(),
driver: sqlite3.Database,
});
if (!AutocompleteLruCache.instancePromise) {
AutocompleteLruCache.instancePromise = (async () => {
const db = await open({
filename: getTabAutocompleteCacheSqlitePath(),
driver: sqlite3.Database,
});
await db.exec("PRAGMA busy_timeout = 3000;");
await db.run(`
CREATE TABLE IF NOT EXISTS cache (
key TEXT PRIMARY KEY,
value TEXT NOT NULL,
timestamp INTEGER NOT NULL
)
`);
await db.exec("PRAGMA busy_timeout = 3000;");
await db.run(`
CREATE TABLE IF NOT EXISTS cache (
key TEXT PRIMARY KEY,
value TEXT NOT NULL,
timestamp INTEGER NOT NULL
)
`);
return new AutocompleteLruCache(db);
const instance = new AutocompleteLruCache(db);
await instance.loadFromDb();
instance.startFlushTimer();
return instance;
})();
}
return AutocompleteLruCache.instancePromise;
}
async get(prefix: string): Promise<string | undefined> {
// NOTE: Right now prompts with different suffixes will be considered the same
/** Loads all cached entries from SQLite into memory on initialization. */
private async loadFromDb() {
const rows = await this.db.all("SELECT key, value, timestamp FROM cache");
for (const row of rows) {
this.cache.set(row.key, {
value: row.value,
timestamp: row.timestamp,
});
}
}
// If the query is "co" and we have "c" -> "ontinue" in the cache,
// we should return "ntinue" as the completion.
// Have to make sure we take the key with shortest length
/** Starts periodic flush timer to persist dirty entries to database. */
private startFlushTimer() {
this.flushTimer = setInterval(() => {
this.flush().catch((e) => console.error("Error flushing cache:", e));
}, AutocompleteLruCache.flushInterval);
}
/**
* Retrieves cached completion for a prefix using longest-match strategy.
*
* Algorithm:
* 1. Finds the longest cached prefix that the query starts with
* 2. Validates that cached completion starts with the remaining query text
* 3. Returns the completion with the matched portion stripped
* 4. Updates the entry's timestamp (LRU tracking)
*
* @param prefix - The prefix to search for
* @returns The completion string with prefix removed, or undefined if no match
*/
async get(prefix: string): Promise<string | undefined> {
const truncatedPrefix = truncateSqliteLikePattern(prefix);
try {
const result = await this.db.get(
"SELECT key, value FROM cache WHERE ? LIKE key || '%' ORDER BY LENGTH(key) DESC LIMIT 1",
truncatedPrefix,
);
// Validate that the cached completion is a valid completion for the prefix
if (
result &&
result.value.startsWith(truncatedPrefix.slice(result.key.length))
) {
await this.db.run(
"UPDATE cache SET timestamp = ? WHERE key = ?",
Date.now(),
truncatedPrefix,
);
// And then truncate so we aren't writing something that's already there
return result.value.slice(truncatedPrefix.length - result.key.length);
let bestMatch: { key: string; entry: CacheEntry } | null = null;
for (const [key, entry] of this.cache.entries()) {
if (truncatedPrefix.startsWith(key)) {
if (!bestMatch || key.length > bestMatch.key.length) {
bestMatch = { key, entry };
}
}
} catch (e) {
// catches e.g. old SQLITE LIKE OR GLOB PATTERN TOO COMPLEX
console.error(e);
}
if (
bestMatch &&
bestMatch.entry.value.startsWith(
truncatedPrefix.slice(bestMatch.key.length),
)
) {
bestMatch.entry.timestamp = Date.now();
this.dirty.add(bestMatch.key);
return bestMatch.entry.value.slice(
truncatedPrefix.length - bestMatch.key.length,
);
}
return undefined;
}
/**
* Stores a prefix-to-completion mapping in the cache.
*
* Thread-safe operation that:
* - Truncates the prefix for SQLite pattern safety
* - Updates or inserts the entry with current timestamp
* - Evicts oldest entry if capacity exceeded
* - Marks entry as dirty for next flush
*
* @param prefix - The prefix key
* @param completion - The completion value to cache
*/
async put(prefix: string, completion: string) {
const release = await this.mutex.acquire();
const truncatedPrefix = truncateSqliteLikePattern(prefix);
try {
await this.db.run("BEGIN TRANSACTION");
const now = Date.now();
try {
const result = await this.db.get(
"SELECT key FROM cache WHERE key = ?",
truncatedPrefix,
);
this.cache.set(truncatedPrefix, {
value: completion,
timestamp: now,
});
this.dirty.add(truncatedPrefix);
if (result) {
await this.db.run(
"UPDATE cache SET value = ?, timestamp = ? WHERE key = ?",
completion,
Date.now(),
truncatedPrefix,
);
} else {
const count = await this.db.get(
"SELECT COUNT(*) as count FROM cache",
);
if (this.cache.size > AutocompleteLruCache.capacity) {
let oldestKey: string | null = null;
let oldestTime = Infinity;
if (count.count >= AutocompleteLruCache.capacity) {
await this.db.run(
"DELETE FROM cache WHERE key = (SELECT key FROM cache ORDER BY timestamp ASC LIMIT 1)",
);
for (const [key, entry] of this.cache.entries()) {
if (entry.timestamp < oldestTime) {
oldestTime = entry.timestamp;
oldestKey = key;
}
await this.db.run(
"INSERT INTO cache (key, value, timestamp) VALUES (?, ?, ?)",
truncatedPrefix,
completion,
Date.now(),
);
}
await this.db.run("COMMIT");
} catch (error) {
await this.db.run("ROLLBACK");
throw error;
if (oldestKey) {
this.cache.delete(oldestKey);
this.dirty.add(oldestKey);
}
}
} catch (e) {
console.error("Error creating transaction: ", e);
} finally {
release();
}
}
}
/**
* Persists all dirty entries to SQLite in a single transaction.
*
* Performs upserts for existing cache entries and deletes for evicted entries.
* Skips if no changes pending. Rolls back transaction on error.
*/
async flush() {
if (this.dirty.size === 0) return;
const release = await this.mutex.acquire();
const dirtyKeys = Array.from(this.dirty);
this.dirty.clear();
try {
await this.db.run("BEGIN TRANSACTION");
for (const key of dirtyKeys) {
const entry = this.cache.get(key);
if (entry) {
// Upsert
await this.db.run(
`INSERT INTO cache (key, value, timestamp) VALUES (?, ?, ?)
ON CONFLICT(key) DO UPDATE SET value = ?, timestamp = ?`,
key,
entry.value,
entry.timestamp,
entry.value,
entry.timestamp,
);
} else {
// Delete
await this.db.run("DELETE FROM cache WHERE key = ?", key);
}
}
await this.db.run("COMMIT");
} catch (error) {
await this.db.run("ROLLBACK");
console.error("Error flushing cache:", error);
} finally {
release();
}
}
/**
* Gracefully shuts down the cache.
* Stops the flush timer, persists pending changes, and closes database connection.
*/
async close() {
if (this.flushTimer) {
clearInterval(this.flushTimer);
}
await this.flush();
await this.db.close();
AutocompleteLruCache.instancePromise = undefined;
}
}
export default AutocompleteLruCache;

View file

@ -1,6 +1,7 @@
import ReplicateClient from "replicate";
import { CompletionOptions, LLMOptions } from "../../index.js";
import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js";
import { renderChatMessage } from "../../util/messageContent.js";
import { BaseLLM } from "../index.js";
class Replicate extends BaseLLM {
@ -33,6 +34,7 @@ class Replicate extends BaseLLM {
"tomasmcm/neural-chat-7b-v3-1:acb450496b49e19a1e410b50c574a34acacd54820bc36c19cbfe05148de2ba57",
"deepseek-7b": "kcaverly/deepseek-coder-33b-instruct-gguf" as any,
"phind-codellama-34b": "kcaverly/phind-codellama-34b-v2-gguf" as any,
"claude-4-sonnet-latest": "anthropic/claude-4-sonnet" as any,
};
static providerName = "replicate";
@ -42,12 +44,55 @@ class Replicate extends BaseLLM {
options: CompletionOptions,
prompt: string,
signal: AbortSignal,
): [`${string}/${string}:${string}`, { input: any; signal: AbortSignal }] {
): [`${string}/${string}:${string}`, { input: any }] {
return [
Replicate.MODEL_IDS[options.model] || (options.model as any),
{
input: { prompt, message: prompt },
signal,
},
];
}
private _convertChatArgs(
options: CompletionOptions,
messages: ChatMessage[],
signal: AbortSignal,
): [`${string}/${string}:${string}`, { input: any }] {
let prompt = "";
let system_prompt = "";
for (const message of messages) {
const content =
typeof message.content === "string"
? message.content
: renderChatMessage(message);
if (message.role === "system") {
system_prompt += `System: ${content}\n\n`;
} else if (message.role === "user") {
prompt += `Human: ${content}\n\n`;
} else if (message.role === "assistant") {
prompt += `Assistant: ${content}\n\n`;
}
}
if (!prompt.endsWith("Assistant: ")) {
prompt += "Assistant: ";
}
// Construct the input
const input: any = {
prompt: prompt,
system_prompt: system_prompt,
max_tokens: options.maxTokens || 2048,
extended_thinking: options.reasoning,
thinking_budget_tokens: options.reasoningBudgetTokens || 1024,
};
return [
Replicate.MODEL_IDS[options.model] || (options.model as any),
{
input,
},
];
}
@ -80,6 +125,43 @@ class Replicate extends BaseLLM {
}
}
}
protected async *_streamChat(
messages: ChatMessage[],
signal: AbortSignal,
options: CompletionOptions,
): AsyncGenerator<ChatMessage> {
if (!this.apiKey || this.apiKey === "") {
throw new Error("You need to use an API key");
}
const [model, args] = this._convertChatArgs(options, messages, signal);
try {
for await (const event of this._replicate.stream(model, args)) {
if (event.event === "output") {
yield {
role: "assistant",
content: event.data,
};
}
}
} catch (error) {
if (error instanceof Error) {
if (error.message.includes("authentication")) {
throw new Error(
"Replicate API authentication failed. Please check your API key",
);
}
if (error.message.includes("model not found")) {
throw new Error(
`Model "${options.model}" not found on Replicate. Please check the model name or use another model.`,
);
}
}
throw error;
}
}
}
export default Replicate;

269
core/package-lock.json generated
View file

@ -40,7 +40,7 @@
"fastest-levenshtein": "^1.0.16",
"filtrex": "^3.1.0",
"follow-redirects": "^1.15.5",
"google-auth-library": "^9.14.2",
"google-auth-library": "^10.4.1",
"handlebars": "^4.7.8",
"http-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.3",
@ -64,7 +64,7 @@
"pg": "^8.11.3",
"plist": "^3.1.0",
"posthog-node": "^3.6.3",
"puppeteer": "^22.4.0",
"puppeteer": "^24.15.0",
"puppeteer-chromium-resolver": "^23.0.0",
"quick-lru": "^7.0.0",
"replicate": "^0.26.0",
@ -85,7 +85,7 @@
"winston": "^3.17.0",
"workerpool": "^9.1.3",
"yaml": "^2.4.2",
"zod": "^3.24.2"
"zod": "^3.25.76"
},
"devDependencies": {
"@babel/preset-env": "^7.24.7",
@ -158,8 +158,8 @@
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",
"zod": "^3.24.2"
"yaml": "^2.8.1",
"zod": "^3.25.76"
},
"bin": {
"config-yaml": "dist/cli.js"
@ -220,19 +220,19 @@
"version": "1.15.0",
"license": "Apache-2.0",
"dependencies": {
"@anthropic-ai/sdk": "^0.62.0",
"@anthropic-ai/sdk": "^0.67.0",
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
"@aws-sdk/credential-providers": "^3.840.0",
"@aws-sdk/credential-providers": "^3.913.0",
"@continuedev/config-types": "^1.0.14",
"@continuedev/config-yaml": "^1.14.0",
"@continuedev/config-yaml": "^1.29.0",
"@continuedev/fetch": "^1.5.0",
"dotenv": "^16.5.0",
"google-auth-library": "^10.1.0",
"google-auth-library": "^10.4.1",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^5.13.1",
"openai": "^5.23.2",
"uuid": "^11.1.0",
"zod": "^3.24.2"
"zod": "^3.25.76"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
@ -5143,17 +5143,17 @@
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
},
"node_modules/@puppeteer/browsers": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.0.tgz",
"integrity": "sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA==",
"version": "2.10.13",
"resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.13.tgz",
"integrity": "sha512-a9Ruw3j3qlnB5a/zHRTkruppynxqaeE4H9WNj5eYGRWqw0ZauZ23f4W2ARf3hghF5doozyD+CRtt7XSYuYRI/Q==",
"license": "Apache-2.0",
"dependencies": {
"debug": "^4.3.5",
"debug": "^4.4.3",
"extract-zip": "^2.0.1",
"progress": "^2.0.3",
"proxy-agent": "^6.4.0",
"semver": "^7.6.3",
"tar-fs": "^3.0.6",
"unbzip2-stream": "^1.4.3",
"proxy-agent": "^6.5.0",
"semver": "^7.7.3",
"tar-fs": "^3.1.1",
"yargs": "^17.7.2"
},
"bin": {
@ -5164,9 +5164,10 @@
}
},
"node_modules/@puppeteer/browsers/node_modules/semver": {
"version": "7.6.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
"version": "7.7.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
"integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
},
@ -8207,9 +8208,10 @@
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
},
"node_modules/bignumber.js": {
"version": "9.1.2",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz",
"integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==",
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
"integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
"license": "MIT",
"engines": {
"node": "*"
}
@ -8768,26 +8770,18 @@
}
},
"node_modules/chromium-bidi": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.6.3.tgz",
"integrity": "sha512-qXlsCmpCZJAnoTYI83Iu6EdYQpMYdVkCfq08KDh2pmlVqK5t5IA9mGs4/LwCwp4fqisSOMXZxP3HIh8w8aRn0A==",
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-11.0.0.tgz",
"integrity": "sha512-cM3DI+OOb89T3wO8cpPSro80Q9eKYJ7hGVXoGS3GkDPxnYSqiv+6xwpIf6XERyJ9Tdsl09hmNmY94BkgZdVekw==",
"license": "Apache-2.0",
"dependencies": {
"mitt": "3.0.1",
"urlpattern-polyfill": "10.0.0",
"zod": "3.23.8"
"mitt": "^3.0.1",
"zod": "^3.24.1"
},
"peerDependencies": {
"devtools-protocol": "*"
}
},
"node_modules/chromium-bidi/node_modules/zod": {
"version": "3.23.8",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz",
"integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
},
"node_modules/ci-info": {
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz",
@ -9314,9 +9308,10 @@
}
},
"node_modules/debug": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
},
@ -9524,9 +9519,10 @@
}
},
"node_modules/devtools-protocol": {
"version": "0.0.1312386",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz",
"integrity": "sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA=="
"version": "0.0.1521046",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1521046.tgz",
"integrity": "sha512-vhE6eymDQSKWUXwwA37NtTTVEzjtGVfDr3pRbsWEQ5onH/Snp2c+2xZHWJJawG/0hCCJLRGt4xVtEVUVILol4w==",
"license": "BSD-3-Clause"
},
"node_modules/diff": {
"version": "7.0.0",
@ -11508,68 +11504,76 @@
}
},
"node_modules/gaxios": {
"version": "6.7.1",
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz",
"integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==",
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.3.tgz",
"integrity": "sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ==",
"license": "Apache-2.0",
"dependencies": {
"extend": "^3.0.2",
"https-proxy-agent": "^7.0.1",
"is-stream": "^2.0.0",
"node-fetch": "^2.6.9",
"uuid": "^9.0.1"
"node-fetch": "^3.3.2",
"rimraf": "^5.0.1"
},
"engines": {
"node": ">=14"
"node": ">=18"
}
},
"node_modules/gaxios/node_modules/node-fetch": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
"node_modules/gaxios/node_modules/glob": {
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
"integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
"license": "ISC",
"dependencies": {
"whatwg-url": "^5.0.0"
"foreground-child": "^3.1.0",
"jackspeak": "^3.1.2",
"minimatch": "^9.0.4",
"minipass": "^7.1.2",
"package-json-from-dist": "^1.0.0",
"path-scurry": "^1.11.1"
},
"bin": {
"glob": "dist/esm/bin.mjs"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/gaxios/node_modules/minipass": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
"license": "ISC",
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/gaxios/node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
},
"node_modules/gaxios/node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
"node_modules/gaxios/node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"node_modules/gaxios/node_modules/rimraf": {
"version": "5.0.10",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz",
"integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==",
"license": "ISC",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
"glob": "^10.3.7"
},
"bin": {
"rimraf": "dist/esm/bin.mjs"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/gcp-metadata": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz",
"integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==",
"version": "8.1.2",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.2.tgz",
"integrity": "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==",
"license": "Apache-2.0",
"dependencies": {
"gaxios": "^6.0.0",
"gaxios": "^7.0.0",
"google-logging-utils": "^1.0.0",
"json-bigint": "^1.0.0"
},
"engines": {
"node": ">=14"
"node": ">=18"
}
},
"node_modules/generate-function": {
@ -11780,17 +11784,28 @@
}
},
"node_modules/google-auth-library": {
"version": "9.15.0",
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.0.tgz",
"integrity": "sha512-7ccSEJFDFO7exFbO6NRyC+xH8/mZ1GZGG2xxx9iHxZWcjUjJpjWxIMw3cofAKcueZ6DATiukmmprD7yavQHOyQ==",
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.5.0.tgz",
"integrity": "sha512-7ABviyMOlX5hIVD60YOfHw4/CxOfBhyduaYB+wbFWCWoni4N7SLcV46hrVRktuBbZjFC9ONyqamZITN7q3n32w==",
"license": "Apache-2.0",
"dependencies": {
"base64-js": "^1.3.0",
"ecdsa-sig-formatter": "^1.0.11",
"gaxios": "^6.1.1",
"gcp-metadata": "^6.1.0",
"gtoken": "^7.0.0",
"gaxios": "^7.0.0",
"gcp-metadata": "^8.0.0",
"google-logging-utils": "^1.0.0",
"gtoken": "^8.0.0",
"jws": "^4.0.0"
},
"engines": {
"node": ">=18"
}
},
"node_modules/google-logging-utils": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.3.tgz",
"integrity": "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
}
@ -11883,15 +11898,16 @@
}
},
"node_modules/gtoken": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz",
"integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==",
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz",
"integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==",
"license": "MIT",
"dependencies": {
"gaxios": "^6.0.0",
"gaxios": "^7.0.0",
"jws": "^4.0.0"
},
"engines": {
"node": ">=14.0.0"
"node": ">=18"
}
},
"node_modules/guid-typescript": {
@ -13955,6 +13971,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
"integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==",
"license": "MIT",
"dependencies": {
"bignumber.js": "^9.0.0"
}
@ -16586,18 +16603,21 @@
}
},
"node_modules/puppeteer": {
"version": "22.15.0",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.15.0.tgz",
"integrity": "sha512-XjCY1SiSEi1T7iSYuxS82ft85kwDJUS7wj1Z0eGVXKdtr5g4xnVcbjwxhq5xBnpK/E7x1VZZoJDxpjAOasHT4Q==",
"version": "24.30.0",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.30.0.tgz",
"integrity": "sha512-A5OtCi9WpiXBQgJ2vQiZHSyrAzQmO/WDsvghqlN4kgw21PhxA5knHUaUQq/N3EMt8CcvSS0RM+kmYLJmedR3TQ==",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@puppeteer/browsers": "2.3.0",
"@puppeteer/browsers": "2.10.13",
"chromium-bidi": "11.0.0",
"cosmiconfig": "^9.0.0",
"devtools-protocol": "0.0.1312386",
"puppeteer-core": "22.15.0"
"devtools-protocol": "0.0.1521046",
"puppeteer-core": "24.30.0",
"typed-query-selector": "^2.12.0"
},
"bin": {
"puppeteer": "lib/esm/puppeteer/node/cli.js"
"puppeteer": "lib/cjs/puppeteer/node/cli.js"
},
"engines": {
"node": ">=18"
@ -16690,15 +16710,18 @@
}
},
"node_modules/puppeteer-core": {
"version": "22.15.0",
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.15.0.tgz",
"integrity": "sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==",
"version": "24.30.0",
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.30.0.tgz",
"integrity": "sha512-2S3Smy0t0W4wJnNvDe7W0bE7wDmZjfZ3ljfMgJd6hn2Hq/f0jgN+x9PULZo2U3fu5UUIJ+JP8cNUGllu8P91Pg==",
"license": "Apache-2.0",
"dependencies": {
"@puppeteer/browsers": "2.3.0",
"chromium-bidi": "0.6.3",
"debug": "^4.3.6",
"devtools-protocol": "0.0.1312386",
"ws": "^8.18.0"
"@puppeteer/browsers": "2.10.13",
"chromium-bidi": "11.0.0",
"debug": "^4.4.3",
"devtools-protocol": "0.0.1521046",
"typed-query-selector": "^2.12.0",
"webdriver-bidi-protocol": "0.3.8",
"ws": "^8.18.3"
},
"engines": {
"node": ">=18"
@ -19674,6 +19697,12 @@
"resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.21.0.tgz",
"integrity": "sha512-iJ+QJ6ikN9D9cG7Kh6q3KtAstYFUQbYZ8OjuPEJYWfj2kLrmp5I3C2n6WjE1Y3jvj7nJbkcrJytJGWUEhCxn+g=="
},
"node_modules/webdriver-bidi-protocol": {
"version": "0.3.8",
"resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.3.8.tgz",
"integrity": "sha512-21Yi2GhGntMc671vNBCjiAeEVknXjVRoyu+k+9xOMShu+ZQfpGQwnBqbNz/Sv4GXZ6JmutlPAi2nIJcrymAWuQ==",
"license": "Apache-2.0"
},
"node_modules/webidl-conversions": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
@ -20080,9 +20109,10 @@
}
},
"node_modules/ws": {
"version": "8.18.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
"integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
"version": "8.18.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
@ -20206,9 +20236,10 @@
}
},
"node_modules/zod": {
"version": "3.24.2",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz",
"integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==",
"version": "3.25.76",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}

View file

@ -85,7 +85,7 @@
"fastest-levenshtein": "^1.0.16",
"filtrex": "^3.1.0",
"follow-redirects": "^1.15.5",
"google-auth-library": "^9.14.2",
"google-auth-library": "^10.4.1",
"handlebars": "^4.7.8",
"http-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.3",
@ -109,7 +109,7 @@
"pg": "^8.11.3",
"plist": "^3.1.0",
"posthog-node": "^3.6.3",
"puppeteer": "^22.4.0",
"puppeteer": "^24.15.0",
"puppeteer-chromium-resolver": "^23.0.0",
"quick-lru": "^7.0.0",
"replicate": "^0.26.0",
@ -130,7 +130,7 @@
"winston": "^3.17.0",
"workerpool": "^9.1.3",
"yaml": "^2.4.2",
"zod": "^3.24.2"
"zod": "^3.25.76"
},
"engine-strict": true,
"engines": {

232
docs/package-lock.json generated
View file

@ -9,7 +9,9 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@c15t/react": "^1.7.0"
"@c15t/react": "^1.7.1",
"axios": "^1.13.2",
"tar-fs": "^3.1.1"
},
"devDependencies": {
"mintlify": "^4.2.3"
@ -93,13 +95,13 @@
}
},
"node_modules/@c15t/backend": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@c15t/backend/-/backend-1.7.0.tgz",
"integrity": "sha512-rEhyWAq2xeAljL1ctSD9YGu/wG7GRwsUNTm6pEAS7q5nQ4ApRppUmQcLqJDb/B4gyY0Z/HCx56iIPkXYnymDYg==",
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/@c15t/backend/-/backend-1.8.0.tgz",
"integrity": "sha512-vM/jXQfWrI2XqN8h3Wq0IRWFBLz5o98vPUVAPu8Mdw9WblnBRwVRIEtmN6maMVM3yyai4yZA8fbXAi0e3PSM/Q==",
"license": "GPL-3.0-only",
"dependencies": {
"@c15t/logger": "1.0.0",
"@c15t/translations": "1.7.0",
"@c15t/logger": "1.0.1",
"@c15t/translations": "1.8.0",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/resources": "^2.0.1",
"@opentelemetry/sdk-node": "^0.203.0",
@ -111,7 +113,7 @@
"@orpc/zod": "1.8.1",
"base-x": "^5.0.1",
"defu": "^6.1.4",
"drizzle-orm": "^0.41.0",
"drizzle-orm": "^0.44.6",
"fumadb": "^0.1.1",
"kysely": "^0.27.6",
"neverthrow": "^8.2.0",
@ -119,127 +121,6 @@
"zod": "^4.0.17"
}
},
"node_modules/@c15t/backend/node_modules/drizzle-orm": {
"version": "0.41.0",
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.41.0.tgz",
"integrity": "sha512-7A4ZxhHk9gdlXmTdPj/lREtP+3u8KvZ4yEN6MYVxBzZGex5Wtdc+CWSbu7btgF6TB0N+MNPrvW7RKBbxJchs/Q==",
"license": "Apache-2.0",
"peerDependencies": {
"@aws-sdk/client-rds-data": ">=3",
"@cloudflare/workers-types": ">=4",
"@electric-sql/pglite": ">=0.2.0",
"@libsql/client": ">=0.10.0",
"@libsql/client-wasm": ">=0.10.0",
"@neondatabase/serverless": ">=0.10.0",
"@op-engineering/op-sqlite": ">=2",
"@opentelemetry/api": "^1.4.1",
"@planetscale/database": ">=1",
"@prisma/client": "*",
"@tidbcloud/serverless": "*",
"@types/better-sqlite3": "*",
"@types/pg": "*",
"@types/sql.js": "*",
"@vercel/postgres": ">=0.8.0",
"@xata.io/client": "*",
"better-sqlite3": ">=7",
"bun-types": "*",
"expo-sqlite": ">=14.0.0",
"gel": ">=2",
"knex": "*",
"kysely": "*",
"mysql2": ">=2",
"pg": ">=8",
"postgres": ">=3",
"sql.js": ">=1",
"sqlite3": ">=5"
},
"peerDependenciesMeta": {
"@aws-sdk/client-rds-data": {
"optional": true
},
"@cloudflare/workers-types": {
"optional": true
},
"@electric-sql/pglite": {
"optional": true
},
"@libsql/client": {
"optional": true
},
"@libsql/client-wasm": {
"optional": true
},
"@neondatabase/serverless": {
"optional": true
},
"@op-engineering/op-sqlite": {
"optional": true
},
"@opentelemetry/api": {
"optional": true
},
"@planetscale/database": {
"optional": true
},
"@prisma/client": {
"optional": true
},
"@tidbcloud/serverless": {
"optional": true
},
"@types/better-sqlite3": {
"optional": true
},
"@types/pg": {
"optional": true
},
"@types/sql.js": {
"optional": true
},
"@vercel/postgres": {
"optional": true
},
"@xata.io/client": {
"optional": true
},
"better-sqlite3": {
"optional": true
},
"bun-types": {
"optional": true
},
"expo-sqlite": {
"optional": true
},
"gel": {
"optional": true
},
"knex": {
"optional": true
},
"kysely": {
"optional": true
},
"mysql2": {
"optional": true
},
"pg": {
"optional": true
},
"postgres": {
"optional": true
},
"prisma": {
"optional": true
},
"sql.js": {
"optional": true
},
"sqlite3": {
"optional": true
}
}
},
"node_modules/@c15t/backend/node_modules/zod": {
"version": "4.1.12",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.1.12.tgz",
@ -250,9 +131,9 @@
}
},
"node_modules/@c15t/logger": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@c15t/logger/-/logger-1.0.0.tgz",
"integrity": "sha512-z2RrUnvO5bbEg/qd9iD/TqdBi04vfvALf2uovDVLJiQTNfOVUb7FM/GkPH5mugiDwErlrtVhAW8hW/2VmBXbUA==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@c15t/logger/-/logger-1.0.1.tgz",
"integrity": "sha512-Yz+HkHjsGWPkJ7nWGqlSgF3LG9WtV72Om5NoWrW6YJHLMNasC5Z6opi9GM8B1Nm8ivZBzJpADEc4gVIBCkqamw==",
"license": "GPL-3.0-only",
"dependencies": {
"chalk": "^5.4.1",
@ -261,15 +142,15 @@
}
},
"node_modules/@c15t/react": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@c15t/react/-/react-1.7.0.tgz",
"integrity": "sha512-0hduy9wlLMcKgj7Pf5f3B4JjbLPVKDlurwuC0d9NyyTABFaegn9ehbP6kiyDt7qVCoiaN2jyOhMQyKON5Tb49g==",
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/@c15t/react/-/react-1.8.1.tgz",
"integrity": "sha512-Slh98Rxo4gYhrcOU+rR7M8HiAB084EE8VyW6JMXC8ItXWSCqu+1O89hpikn+2i3PdgyCIbwUv+VKEVm4KcAmBg==",
"license": "GPL-3.0-only",
"dependencies": {
"@radix-ui/react-accordion": "1.2.4",
"@radix-ui/react-slot": "1.2.0",
"@radix-ui/react-switch": "1.1.4",
"c15t": "1.7.0",
"c15t": "1.8.1",
"clsx": "2.1.1",
"zustand": "^5.0.3"
},
@ -279,9 +160,9 @@
}
},
"node_modules/@c15t/translations": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@c15t/translations/-/translations-1.7.0.tgz",
"integrity": "sha512-irrJAni2Cei56wHLmGoIoPHoXk/ygXllWs4dBF9LL0D/Ns7bvcBi/CAPCnCD1hw4FnoJ9amPqYtVKQ3sT++JaQ==",
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/@c15t/translations/-/translations-1.8.0.tgz",
"integrity": "sha512-iCw8iOc9lgXpIJaN/WzN+T3FMzFUgjN+UZ7tp6hKSV4RktXwr7C/z3HAOdeGYZE01BdmunrlOZGQB/N3hZoZZQ==",
"license": "GPL-3.0-only"
},
"node_modules/@clack/core": {
@ -3303,12 +3184,12 @@
}
},
"node_modules/@orpc/otel": {
"version": "1.10.4",
"resolved": "https://registry.npmjs.org/@orpc/otel/-/otel-1.10.4.tgz",
"integrity": "sha512-iXl0HBVK2i5PoCxhK1MRxKuZWsdD/v1+Oz4LSOqtVulIt5H9/Idb790Eu/R46rwyu/sZ5eJ0PFn2V9xpaFH6vw==",
"version": "1.11.3",
"resolved": "https://registry.npmjs.org/@orpc/otel/-/otel-1.11.3.tgz",
"integrity": "sha512-Xm6zeI4HMwlBWr5tzvt1eOPh+5bDmb3R6h4ZR1xO9MOnbUOvazc2z/YiSbooiwTK9IIJmyP6DAEMucGUA3xvwQ==",
"license": "MIT",
"dependencies": {
"@orpc/shared": "1.10.4"
"@orpc/shared": "1.11.3"
},
"peerDependencies": {
"@opentelemetry/api": ">=1.9.0",
@ -3316,9 +3197,9 @@
}
},
"node_modules/@orpc/otel/node_modules/@orpc/shared": {
"version": "1.10.4",
"resolved": "https://registry.npmjs.org/@orpc/shared/-/shared-1.10.4.tgz",
"integrity": "sha512-NNQFfVVI2GFpJsaHdT6Zs/89NGod15DhGPSPFmtk9lNdQ4QzuqjAvTvEdNyeDEmcnUdNEJqhk5S2bpK1QTjWvQ==",
"version": "1.11.3",
"resolved": "https://registry.npmjs.org/@orpc/shared/-/shared-1.11.3.tgz",
"integrity": "sha512-hOPZhNI0oIhw91NNu4ndrmpWLdZyXTGx7tzq/bG5LwtuHuUsl4FalRsUfSIuap/V1ESOnPqSzmmSOdRv+ITcRA==",
"license": "MIT",
"dependencies": {
"radash": "^12.1.1",
@ -4026,9 +3907,9 @@
}
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.53.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.1.tgz",
"integrity": "sha512-E/n8x2MSjAQgjj9IixO4UeEUeqXLtiA7pyoXCFYLuXpBA/t2hnbIdxHfA7kK9BFsYAoNU4st1rHYdldl8dTqGA==",
"version": "4.53.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.2.tgz",
"integrity": "sha512-yo8d6tdfdeBArzC7T/PnHd7OypfI9cbuZzPnzLJIyKYFhAQ8SvlkKtKBMbXDxe1h03Rcr7u++nFS7tqXz87Gtw==",
"cpu": [
"x64"
],
@ -5091,7 +4972,6 @@
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true,
"license": "MIT"
},
"node_modules/auto-bind": {
@ -5133,10 +5013,9 @@
}
},
"node_modules/axios": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz",
"integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==",
"dev": true,
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz",
"integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
@ -5148,7 +5027,6 @@
"version": "1.6.7",
"resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz",
"integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==",
"dev": true,
"license": "Apache-2.0"
},
"node_modules/bail": {
@ -5172,7 +5050,6 @@
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz",
"integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==",
"dev": true,
"license": "Apache-2.0",
"optional": true
},
@ -5180,7 +5057,6 @@
"version": "4.1.6",
"resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.1.6.tgz",
"integrity": "sha512-25RsLF33BqooOEFNdMcEhMpJy8EoR88zSMrnOQOaM3USnOK2VmaJ1uaQEwPA6AQjrv1lXChScosN6CzbwbO9OQ==",
"dev": true,
"license": "Apache-2.0",
"optional": true,
"dependencies": {
@ -5204,7 +5080,6 @@
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.1.tgz",
"integrity": "sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g==",
"dev": true,
"license": "Apache-2.0",
"optional": true,
"engines": {
@ -5215,7 +5090,6 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",
"integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==",
"dev": true,
"license": "Apache-2.0",
"optional": true,
"dependencies": {
@ -5226,7 +5100,6 @@
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz",
"integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==",
"dev": true,
"license": "Apache-2.0",
"optional": true,
"dependencies": {
@ -5429,13 +5302,13 @@
}
},
"node_modules/c15t": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/c15t/-/c15t-1.7.0.tgz",
"integrity": "sha512-YmVrOEEQruyLY0iqdlY9/NsAlfaIrCy3bgc8snAFLNNdZtKJpcRbf3Q1cR51sA+foN0Sw0N0aS0sbQWzLLZTuw==",
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/c15t/-/c15t-1.8.1.tgz",
"integrity": "sha512-D4We2FxVN7tGf/LQsMCWQj+GrSVKX6HSC9Leyw/Ble74E0ocmVKI61+YcP6rdEpmIv6e9T9lO7NECtX0RTEEWA==",
"license": "GPL-3.0-only",
"dependencies": {
"@c15t/backend": "1.7.0",
"@c15t/translations": "1.7.0",
"@c15t/backend": "1.8.0",
"@c15t/translations": "1.8.0",
"@orpc/client": "1.8.1",
"@orpc/server": "1.8.1",
"zustand": "^5.0.3"
@ -5945,7 +5818,6 @@
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"license": "MIT",
"dependencies": {
"delayed-stream": "~1.0.0"
@ -6337,7 +6209,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.4.0"
@ -6477,8 +6348,6 @@
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.44.7.tgz",
"integrity": "sha512-quIpnYznjU9lHshEOAYLoZ9s3jweleHlZIAWR/jX9gAWNg/JhQ1wj0KGRf7/Zm+obRrYd9GjPVJg790QY9N5AQ==",
"license": "Apache-2.0",
"optional": true,
"peer": true,
"peerDependencies": {
"@aws-sdk/client-rds-data": ">=3",
"@cloudflare/workers-types": ">=4",
@ -6648,7 +6517,6 @@
"version": "1.4.5",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
"integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
"dev": true,
"license": "MIT",
"dependencies": {
"once": "^1.4.0"
@ -6907,7 +6775,6 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
"dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
@ -7327,7 +7194,6 @@
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
"integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",
"dev": true,
"license": "MIT"
},
"node_modules/fast-memoize": {
@ -7446,7 +7312,6 @@
"version": "1.15.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
"dev": true,
"funding": [
{
"type": "individual",
@ -7512,7 +7377,6 @@
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
"integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
"dev": true,
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
@ -7839,9 +7703,9 @@
}
},
"node_modules/glob": {
"version": "10.4.5",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz",
"integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==",
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
"integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
"license": "ISC",
"peer": true,
"dependencies": {
@ -10917,7 +10781,6 @@
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.6"
@ -10927,7 +10790,6 @@
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dev": true,
"license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
@ -11258,7 +11120,6 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"license": "ISC",
"dependencies": {
"wrappy": "1"
@ -11768,7 +11629,6 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"dev": true,
"license": "MIT"
},
"node_modules/public-ip": {
@ -11819,7 +11679,6 @@
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
"integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",
"dev": true,
"license": "MIT",
"dependencies": {
"end-of-stream": "^1.1.0",
@ -13358,7 +13217,6 @@
"version": "2.22.1",
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.1.tgz",
"integrity": "sha512-znKXEBxfatz2GBNK02kRnCXjV+AA4kjZIUxeWSr3UGirZMJfTE9uiwKHobnbgxWyL/JWro8tTq+vOqAK1/qbSA==",
"dev": true,
"license": "MIT",
"dependencies": {
"fast-fifo": "^1.3.2",
@ -13640,10 +13498,9 @@
}
},
"node_modules/tar-fs": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.0.tgz",
"integrity": "sha512-5Mty5y/sOF1YWj1J6GiBodjlDc05CUR8PKXrsnFAiSG0xA+GHeWLovaZPYUDXkH/1iKRf2+M5+OrRgzC7O9b7w==",
"dev": true,
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz",
"integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==",
"license": "MIT",
"dependencies": {
"pump": "^3.0.0",
@ -13658,7 +13515,6 @@
"version": "3.1.7",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz",
"integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"b4a": "^1.6.4",
@ -13670,7 +13526,6 @@
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz",
"integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"b4a": "^1.6.4"
@ -14657,7 +14512,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true,
"license": "ISC"
},
"node_modules/ws": {

View file

@ -16,6 +16,8 @@
"mintlify": "^4.2.3"
},
"dependencies": {
"@c15t/react": "^1.7.0"
"@c15t/react": "^1.7.1",
"axios": "^1.13.2",
"tar-fs": "^3.1.1"
}
}

View file

@ -11,7 +11,8 @@
"dependencies": {
"@sentry/profiling-node": "^9.43.0",
"fdir": "^6.4.2",
"fzf": "^0.5.2"
"fzf": "^0.5.2",
"js-yaml": "^4.1.1"
},
"bin": {
"cn": "dist/cn.js"
@ -148,7 +149,7 @@
"fastest-levenshtein": "^1.0.16",
"filtrex": "^3.1.0",
"follow-redirects": "^1.15.5",
"google-auth-library": "^9.14.2",
"google-auth-library": "^10.4.1",
"handlebars": "^4.7.8",
"http-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.3",
@ -172,7 +173,7 @@
"pg": "^8.11.3",
"plist": "^3.1.0",
"posthog-node": "^3.6.3",
"puppeteer": "^22.4.0",
"puppeteer": "^24.15.0",
"puppeteer-chromium-resolver": "^23.0.0",
"quick-lru": "^7.0.0",
"replicate": "^0.26.0",
@ -193,7 +194,7 @@
"winston": "^3.17.0",
"workerpool": "^9.1.3",
"yaml": "^2.4.2",
"zod": "^3.24.2"
"zod": "^3.25.76"
},
"devDependencies": {
"@babel/preset-env": "^7.24.7",
@ -243,8 +244,8 @@
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",
"zod": "^3.24.2"
"yaml": "^2.8.1",
"zod": "^3.25.76"
},
"bin": {
"config-yaml": "dist/cli.js"
@ -270,19 +271,19 @@
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@anthropic-ai/sdk": "^0.62.0",
"@anthropic-ai/sdk": "^0.67.0",
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
"@aws-sdk/credential-providers": "^3.840.0",
"@aws-sdk/credential-providers": "^3.913.0",
"@continuedev/config-types": "^1.0.14",
"@continuedev/config-yaml": "^1.14.0",
"@continuedev/config-yaml": "^1.29.0",
"@continuedev/fetch": "^1.5.0",
"dotenv": "^16.5.0",
"google-auth-library": "^10.1.0",
"google-auth-library": "^10.4.1",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^5.13.1",
"openai": "^5.23.2",
"uuid": "^11.1.0",
"zod": "^3.24.2"
"zod": "^3.25.76"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
@ -6385,7 +6386,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true,
"license": "Python-2.0"
},
"node_modules/argv-formatter": {
@ -11545,10 +11545,9 @@
"license": "MIT"
},
"node_modules/js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"license": "MIT",
"dependencies": {
"argparse": "^2.0.1"

View file

@ -46,7 +46,8 @@
"dependencies": {
"@sentry/profiling-node": "^9.43.0",
"fdir": "^6.4.2",
"fzf": "^0.5.2"
"fzf": "^0.5.2",
"js-yaml": "^4.1.1"
},
"devDependencies": {
"@continuedev/config-yaml": "file:../../packages/config-yaml",

View file

@ -1,7 +1,6 @@
import { vi } from "vitest";
import type { AuthConfig } from "../../auth/workos.js";
export const isAuthenticated = vi.fn(() => false);
export const isAuthenticated = vi.fn(() => Promise.resolve(false));
export const isAuthenticatedConfig = vi.fn(() => false);
export const isEnvironmentAuthConfig = vi.fn(() => false);
export const loadAuthConfig = vi.fn(() => null);

View file

@ -9,7 +9,7 @@ import { isAuthenticated, login } from "./workos.js";
export async function ensureAuthenticated(
requireAuth: boolean = true,
): Promise<boolean> {
if (isAuthenticated()) {
if (await isAuthenticated()) {
return true;
}

View file

@ -6,7 +6,7 @@ import {
autoSelectOrganizationAndConfig,
createUpdatedAuthConfig,
} from "./orgSelection.js";
import type { AuthenticatedConfig } from "./workos.js";
import { AuthenticatedConfig } from "./workos-types.js";
// Mock dependencies
vi.mock("fs");

View file

@ -3,11 +3,13 @@ import * as path from "path";
import chalk from "chalk";
import type { AuthConfig, AuthenticatedConfig } from "../auth/workos.js";
import type { AuthConfig } from "../auth/workos.js";
import { saveAuthConfig } from "../auth/workos.js";
import { getApiClient } from "../config.js";
import { env } from "../env.js";
import { AuthenticatedConfig } from "./workos-types.js";
/**
* Creates an updated AuthenticatedConfig with a new organization ID and optional config URI
*/

View file

@ -1,10 +1,10 @@
import chalk from "chalk";
import { describe, expect, test, beforeEach, vi } from "vitest";
import { beforeEach, describe, expect, test, vi } from "vitest";
import { getApiClient } from "../config.js";
import { AuthenticatedConfig, EnvironmentAuthConfig } from "./workos-types.js";
import { ensureOrganization } from "./workos.js";
import type { AuthenticatedConfig, EnvironmentAuthConfig } from "./workos.js";
// Mock dependencies
vi.mock("../config.js", () => ({

View file

@ -0,0 +1,38 @@
/**
* Device authorization response from WorkOS
*/
export interface DeviceAuthorizationResponse {
device_code: string;
user_code: string;
verification_uri: string;
verification_uri_complete: string;
expires_in: number;
interval: number;
}
// Represents an authenticated user's configuration
export interface AuthenticatedConfig {
userId: string;
userEmail: string;
accessToken: string;
refreshToken: string;
expiresAt: number;
organizationId: string | null | undefined; // null means personal organization, undefined triggers auto-selection
configUri?: string; // Optional config URI (file:// or slug://owner/slug)
modelName?: string; // Name of the selected model
}
// Represents configuration when using environment variable auth
export interface EnvironmentAuthConfig {
/**
* This userId?: undefined; field a trick to help TypeScript differentiate between
* AuthenticatedConfig and EnvironmentAuthConfig. Otherwise AuthenticatedConfig is
* a possible subtype of EnvironmentAuthConfig and TypeScript gets confused where
* type guards are involved.
*/
userId?: undefined;
accessToken: string;
organizationId: string | null; // Can be set via --org flag in headless mode
configUri?: string; // Optional config URI (file:// or slug://owner/slug)
modelName?: string; // Name of the selected model
}

View file

@ -4,11 +4,8 @@ import { getApiClient } from "../config.js";
import { safeStderr } from "../init.js";
import { gracefulExit } from "../util/exit.js";
import type {
AuthConfig,
AuthenticatedConfig,
EnvironmentAuthConfig,
} from "./workos.js";
import { AuthenticatedConfig, EnvironmentAuthConfig } from "./workos-types.js";
import type { AuthConfig } from "./workos.js";
import { saveAuthConfig } from "./workos.js";
/**

View file

@ -1,7 +1,6 @@
import { slugToUri } from "./uriUtils.js";
import { AuthenticatedConfig, EnvironmentAuthConfig } from "./workos-types.js";
import {
AuthenticatedConfig,
EnvironmentAuthConfig,
getAccessToken,
getAssistantSlug,
getOrganizationId,

View file

@ -3,13 +3,15 @@ import * as os from "os";
import * as path from "path";
import chalk from "chalk";
// Polyfill fetch for Node < 18
import nodeFetch from "node-fetch";
import open from "open";
import { logger } from "src/util/logger.js";
import { getApiClient } from "../config.js";
// eslint-disable-next-line import/order
import { env } from "../env.js";
if (!globalThis.fetch) {
globalThis.fetch = nodeFetch as unknown as typeof globalThis.fetch;
}
@ -21,33 +23,6 @@ function getAuthConfigPath() {
return path.join(continueHome, "auth.json");
}
// Represents an authenticated user's configuration
export interface AuthenticatedConfig {
userId: string;
userEmail: string;
accessToken: string;
refreshToken: string;
expiresAt: number;
organizationId: string | null | undefined; // null means personal organization, undefined triggers auto-selection
configUri?: string; // Optional config URI (file:// or slug://owner/slug)
modelName?: string; // Name of the selected model
}
// Represents configuration when using environment variable auth
export interface EnvironmentAuthConfig {
/**
* This userId?: undefined; field a trick to help TypeScript differentiate between
* AuthenticatedConfig and EnvironmentAuthConfig. Otherwise AuthenticatedConfig is
* a possible subtype of EnvironmentAuthConfig and TypeScript gets confused where
* type guards are involved.
*/
userId?: undefined;
accessToken: string;
organizationId: string | null; // Can be set via --org flag in headless mode
configUri?: string; // Optional config URI (file:// or slug://owner/slug)
modelName?: string; // Name of the selected model
}
// Union type representing the possible authentication states
export type AuthConfig = AuthenticatedConfig | EnvironmentAuthConfig | null;
@ -117,6 +92,11 @@ import {
import { autoSelectOrganizationAndConfig } from "./orgSelection.js";
import { pathToUri, slugToUri, uriToPath, uriToSlug } from "./uriUtils.js";
import {
AuthenticatedConfig,
DeviceAuthorizationResponse,
EnvironmentAuthConfig,
} from "./workos-types.js";
import {
handleCliOrgForAuthenticatedConfig,
handleCliOrgForEnvironmentAuth,
@ -266,46 +246,30 @@ export function updateLocalConfigPath(localConfigPath: string | null): void {
/**
* Checks if the user is authenticated and the token is valid
*/
export function isAuthenticated(): boolean {
export async function isAuthenticated(): Promise<boolean> {
const config = loadAuthConfig();
if (config === null) {
return false;
}
// Environment auth is always valid
if (isEnvironmentAuthConfig(config)) {
return true;
}
/**
* THIS CODE DOESN'T WORK.
* .catch() will never return in a non-async function.
* It's a hallucination.
**/
if (Date.now() > config.expiresAt) {
// Try refreshing the token
refreshToken(config.refreshToken).catch(() => {
// If refresh fails, we're not authenticated
try {
const refreshed = await refreshToken(config.refreshToken);
return isAuthenticatedConfig(refreshed);
} catch (e) {
logger.error("Failed to refresh auto token", e);
return false;
});
}
}
return true;
}
/**
* Device authorization response from WorkOS
*/
interface DeviceAuthorizationResponse {
device_code: string;
user_code: string;
verification_uri: string;
verification_uri_complete: string;
expires_in: number;
interval: number;
}
/**
* Request device authorization from WorkOS
*/

View file

@ -26,7 +26,7 @@ export async function handleInfoSlashCommand() {
);
// Auth info
if (isAuthenticated()) {
if (await isAuthenticated()) {
const config = loadAuthConfig();
if (config && isAuthenticatedConfig(config)) {
const email = config.userEmail || config.userId;

View file

@ -5,8 +5,9 @@ import * as path from "path";
import { AssistantUnrolled, ModelConfig } from "@continuedev/config-yaml";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { AuthenticatedConfig } from "src/auth/workos-types.js";
import {
AuthenticatedConfig,
getModelName,
loadAuthConfig,
saveAuthConfig,

View file

@ -5,10 +5,10 @@ import * as path from "path";
import { AssistantUnrolled, ModelConfig } from "@continuedev/config-yaml";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { AuthenticatedConfig } from "src/auth/workos-types.js";
import { AuthService } from "src/services/AuthService.js";
import {
AuthenticatedConfig,
getModelName,
loadAuthConfig,
saveAuthConfig,

View file

@ -4,8 +4,9 @@ import * as path from "path";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { AuthenticatedConfig } from "src/auth/workos-types.js";
import {
AuthenticatedConfig,
getModelName,
loadAuthConfig,
saveAuthConfig,

View file

@ -1,17 +1,17 @@
import { describe, expect, test, beforeEach, vi } from "vitest";
import { beforeEach, describe, expect, test, vi } from "vitest";
// Mock the workos module
vi.mock("../auth/workos.js");
// Import the workos functions we need to mock
import {
loadAuthConfig,
ensureOrganization,
isAuthenticated,
listUserOrganizations,
loadAuthConfig,
login,
logout,
ensureOrganization,
saveAuthConfig,
listUserOrganizations,
} from "../auth/workos.js";
import { AuthService } from "./AuthService.js";
@ -35,7 +35,7 @@ describe("AuthService", () => {
describe("State Management", () => {
test("should initialize with unauthenticated state", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(null);
vi.mocked(isAuthenticated).mockReturnValue(false);
vi.mocked(isAuthenticated).mockResolvedValue(false);
const state = await service.initialize();
@ -48,7 +48,7 @@ describe("AuthService", () => {
test("should initialize with authenticated state", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
const state = await service.initialize();
@ -64,7 +64,7 @@ describe("AuthService", () => {
test("should update state after successful login", async () => {
// Initialize first
vi.mocked(loadAuthConfig).mockReturnValue(null);
vi.mocked(isAuthenticated).mockReturnValue(false);
vi.mocked(isAuthenticated).mockResolvedValue(false);
await service.initialize();
// Mock successful login
@ -93,7 +93,7 @@ describe("AuthService", () => {
test("should clear state after logout", async () => {
// Initialize with authenticated state
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
const state = await service.logout();
@ -112,7 +112,7 @@ describe("AuthService", () => {
// Initialize with auth but no org
const authWithoutOrg = { ...mockAuthConfig, organizationId: null };
vi.mocked(loadAuthConfig).mockReturnValue(authWithoutOrg);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
// Mock ensure organization
@ -129,7 +129,7 @@ describe("AuthService", () => {
test("should throw error if not authenticated", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(null);
vi.mocked(isAuthenticated).mockReturnValue(false);
vi.mocked(isAuthenticated).mockResolvedValue(false);
await service.initialize();
await expect(service.ensureOrganization()).rejects.toThrow(
@ -139,7 +139,7 @@ describe("AuthService", () => {
test("should pass organization slug to ensureOrganization in headless mode", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
const updatedConfig = { ...mockAuthConfig, organizationId: "org-456" };
@ -161,7 +161,7 @@ describe("AuthService", () => {
test("should handle personal organization slug", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
const personalConfig = { ...mockAuthConfig, organizationId: null };
@ -183,7 +183,7 @@ describe("AuthService", () => {
test("should work without organization slug parameter", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
vi.mocked(ensureOrganization).mockResolvedValue(mockAuthConfig);
@ -206,7 +206,7 @@ describe("AuthService", () => {
describe("switchOrganization()", () => {
test("should update state with new organization", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
const state = await service.switchOrganization("org-456");
@ -227,7 +227,7 @@ describe("AuthService", () => {
test("should handle null organization", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
const state = await service.switchOrganization(null);
@ -238,7 +238,7 @@ describe("AuthService", () => {
test("should throw error if not file-based auth", async () => {
const tokenOnlyAuth = { accessToken: "token" } as any;
vi.mocked(loadAuthConfig).mockReturnValue(tokenOnlyAuth);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
await expect(service.switchOrganization("org-456")).rejects.toThrow(
@ -250,7 +250,7 @@ describe("AuthService", () => {
describe("getAvailableOrganizations()", () => {
test("should return organizations when authenticated", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
const mockOrgs = [
@ -265,7 +265,7 @@ describe("AuthService", () => {
test("should return null when not authenticated", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(null);
vi.mocked(isAuthenticated).mockReturnValue(false);
vi.mocked(isAuthenticated).mockResolvedValue(false);
await service.initialize();
const orgs = await service.getAvailableOrganizations();
@ -274,7 +274,7 @@ describe("AuthService", () => {
test("should handle errors gracefully", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
vi.mocked(listUserOrganizations).mockRejectedValue(
@ -297,7 +297,7 @@ describe("AuthService", () => {
describe("hasMultipleOrganizations()", () => {
test("should return true when multiple orgs available", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
vi.mocked(listUserOrganizations).mockResolvedValue([
@ -311,7 +311,7 @@ describe("AuthService", () => {
test("should return false when no orgs available", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
await service.initialize();
vi.mocked(listUserOrganizations).mockResolvedValue([]);
@ -324,12 +324,12 @@ describe("AuthService", () => {
describe("refresh()", () => {
test("should reload auth state from disk", async () => {
vi.mocked(loadAuthConfig).mockReturnValue(null);
vi.mocked(isAuthenticated).mockReturnValue(false);
vi.mocked(isAuthenticated).mockResolvedValue(false);
await service.initialize();
// Update mock to return authenticated state
vi.mocked(loadAuthConfig).mockReturnValue(mockAuthConfig);
vi.mocked(isAuthenticated).mockReturnValue(true);
vi.mocked(isAuthenticated).mockResolvedValue(true);
const state = await service.refresh();
@ -345,7 +345,7 @@ describe("AuthService", () => {
test("should emit stateChanged on login", async () => {
// Initialize with no auth config to simulate logged out state
vi.mocked(loadAuthConfig).mockReturnValue(null);
vi.mocked(isAuthenticated).mockReturnValue(false);
vi.mocked(isAuthenticated).mockResolvedValue(false);
await service.initialize();
const listener = vi.fn();

View file

@ -1,5 +1,6 @@
import { AuthenticatedConfig } from "src/auth/workos-types.js";
import {
AuthenticatedConfig,
login as doLogin,
logout as doLogout,
ensureOrganization,
@ -30,7 +31,7 @@ export class AuthService extends BaseService<AuthServiceState> {
*/
async doInitialize(): Promise<AuthServiceState> {
const authConfig = loadAuthConfig();
const authenticated = isAuthenticated();
const authenticated = await isAuthenticated();
const state: AuthServiceState = {
authConfig,

View file

@ -1,9 +1,6 @@
import { type AssistantConfig } from "@continuedev/sdk";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import {
SSEClientTransport,
SseError,
} from "@modelcontextprotocol/sdk/client/sse.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import {
@ -12,10 +9,14 @@ import {
StdioMcpServer,
} from "node_modules/@continuedev/config-yaml/dist/schemas/mcp/index.js";
import { isAuthenticated, loadAuthConfig } from "src/auth/workos.js";
import { get } from "../util/apiClient.js";
import { getErrorString } from "../util/error.js";
import { logger } from "../util/logger.js";
import { BaseService, ServiceWithDependencies } from "./BaseService.js";
import { isAuthError } from "./mcpUtils.js";
import { serviceContainer } from "./ServiceContainer.js";
import {
MCPConnectionInfo,
@ -24,14 +25,6 @@ import {
SERVICE_NAMES,
} from "./types.js";
function is401Error(error: unknown) {
return (
(error instanceof SseError && error.code === 401) ||
(error instanceof Error && error.message.includes("401")) ||
(error instanceof Error && error.message.includes("Unauthorized"))
);
}
interface ServerConnection extends MCPConnectionInfo {
client: Client | null;
}
@ -50,9 +43,11 @@ export class MCPService
private connections: Map<string, ServerConnection> = new Map();
private assistant: AssistantConfig | null = null;
private isShuttingDown = false;
private isHeadless: boolean | undefined;
private apiKeyCache: Map<string, string> = new Map();
getDependencies(): string[] {
return [SERVICE_NAMES.CONFIG];
return [SERVICE_NAMES.CONFIG, SERVICE_NAMES.AUTH];
}
constructor() {
super("MCPService", {
@ -73,34 +68,20 @@ export class MCPService
hasAgentFile: boolean,
isHeadless: boolean | undefined,
): Promise<MCPServiceState> {
logger.debug("Initializing MCPService", {
configName: assistant.name,
serverCount: assistant.mcpServers?.length || 0,
});
this.isHeadless = isHeadless;
await this.shutdownConnections();
this.assistant = assistant;
this.connections.clear();
if (assistant.mcpServers?.length) {
logger.debug("Starting MCP server connections", {
serverCount: assistant.mcpServers.length,
});
}
const connectionPromises = assistant.mcpServers?.map(async (config) => {
if (config) {
return await this.connectServer(config);
}
});
const connectionInit = Promise.all(connectionPromises ?? []).then(
(connections) => {
logger.debug("MCP connections established", {
connectionCount: connections.length,
});
},
);
const connectionInit = Promise.all(connectionPromises ?? []);
if (isHeadless || hasAgentFile) {
await connectionInit;
@ -178,6 +159,86 @@ export class MCPService
return { status: "idle", hasWarnings };
}
/**
* Generic wrapper for client operations that handles 401 errors with token refresh
* Only applies to SSE/HTTP connections, not stdio
*/
private async withTokenRefresh<T>(
serverName: string,
operation: () => Promise<T>,
): Promise<T> {
const connection = this.connections.get(serverName);
if (!connection) {
throw new Error(`Connection ${serverName} not found`);
}
const serverConfig = connection.config;
if (!serverConfig || "command" in serverConfig) {
// For stdio connections, just execute normally (no token refresh possible)
return await operation();
}
try {
// Try the operation first
return await operation();
} catch (error: unknown) {
// If not a 401 error, rethrow
if (!isAuthError(error)) {
throw error;
}
// Check if user is signed in
const isAuthed = await isAuthenticated();
if (!isAuthed) {
throw error;
}
const authConfig = loadAuthConfig();
// Clear cached token since it's invalid
this.apiKeyCache.delete(serverName);
// Fetch OAuth token from backend
const organizationSlug = authConfig?.organizationId;
let token: string | null = null;
try {
const params = new URLSearchParams({
url: serverConfig.url,
});
if (organizationSlug) {
params.set("organizationSlug", organizationSlug);
}
if (serverConfig.sourceSlug) {
params.set("slug", serverConfig.sourceSlug);
}
const response = await get<{
configured: boolean;
hasCredentials: boolean;
accessToken?: string;
expiresAt?: string;
expired?: boolean;
}>(`/ide/mcp-auth?${params.toString()}`);
if (response.data.hasCredentials && response.data.accessToken) {
token = response.data.accessToken;
this.apiKeyCache.set(serverName, token);
}
} catch {
logger.debug("Failed to fetch mcp oauth credentials");
}
if (!token) {
throw error;
}
this.apiKeyCache.set(serverConfig.name, token);
return await operation();
}
}
/**
* Run a tool by name
*/
@ -186,9 +247,16 @@ export class MCPService
if (connection.status === "connected" && connection.client) {
const tool = connection.tools.find((t) => t.name === name);
if (tool) {
return await connection.client.callTool({
name,
arguments: args,
const serverName = connection.config!.name;
return await this.withTokenRefresh(serverName, async () => {
const conn = this.connections.get(serverName);
if (!conn?.client) {
throw new Error(`Client for ${serverName} not available`);
}
return await conn.client.callTool({
name,
arguments: args,
});
});
}
}
@ -202,7 +270,6 @@ export class MCPService
public async restartAllServers(): Promise<void> {
if (!this.assistant) return;
logger.debug("Restarting all MCP servers");
await this.shutdownConnections();
await this.initialize(this.assistant);
}
@ -221,8 +288,6 @@ export class MCPService
throw new Error(`Server ${serverName} not found in configuration`);
}
logger.debug("Restarting MCP server", { name: serverName });
const existingConnection = this.connections.get(serverName);
if (existingConnection) {
if (existingConnection.status === "connected") {
@ -254,19 +319,19 @@ export class MCPService
this.updateState();
const capabilities = client.getServerCapabilities();
logger.debug("MCP server capabilities", {
name: serverName,
hasPrompts: !!capabilities?.prompts,
hasTools: !!capabilities?.tools,
});
if (capabilities?.prompts) {
try {
connection.prompts = (await client.listPrompts()).prompts;
logger.debug("Loaded MCP prompts", {
name: serverName,
count: connection.prompts.length,
});
connection.prompts = await this.withTokenRefresh(
serverName,
async () => {
const conn = this.connections.get(serverName);
if (!conn?.client) {
throw new Error(`Client for ${serverName} not available`);
}
return (await conn.client.listPrompts()).prompts;
},
);
} catch (error) {
const errorMessage = getErrorString(error);
connection.warnings.push(`Failed to load prompts: ${errorMessage}`);
@ -279,11 +344,16 @@ export class MCPService
if (capabilities?.tools) {
try {
connection.tools = (await client.listTools()).tools;
logger.debug("Loaded MCP tools", {
name: serverName,
count: connection.tools.length,
});
connection.tools = await this.withTokenRefresh(
serverName,
async () => {
const conn = this.connections.get(serverName);
if (!conn?.client) {
throw new Error(`Client for ${serverName} not available`);
}
return (await conn.client.listTools()).tools;
},
);
} catch (error) {
const errorMessage = getErrorString(error);
connection.warnings.push(`Failed to load tools: ${errorMessage}`);
@ -293,8 +363,6 @@ export class MCPService
});
}
}
logger.debug("MCP server connected successfully", { name: serverName });
} catch (error) {
const errorMessage = getErrorString(error);
connection.status = "error";
@ -321,8 +389,6 @@ export class MCPService
* Stop a specific server
*/
public async stopServer(serverName: string): Promise<void> {
logger.debug("Stopping MCP server", { name: serverName });
const connection = this.connections.get(serverName);
if (connection) {
await this.shutdownConnection(connection);
@ -371,7 +437,6 @@ export class MCPService
this.isShuttingDown = true;
this.removeAllListeners();
logger.debug("Shutting down MCPService");
await this.shutdownConnections();
}
@ -389,30 +454,37 @@ export class MCPService
if ("command" in serverConfig) {
// STDIO: no need to check type, just if command is present
logger.debug("Connecting to MCP server", {
name: serverConfig.name,
command: serverConfig.command,
});
const transport = this.constructStdioTransport(serverConfig, connection);
await client.connect(transport, {});
} else {
// SSE/HTTP: if type isn't explicit: try http and fall back to sse
logger.debug("Connecting to MCP server", {
name: serverConfig.name,
url: serverConfig.url,
});
try {
if (serverConfig.type === "sse") {
const transport = this.constructSseTransport(serverConfig);
await client.connect(transport, {});
} else if (serverConfig.type === "streamable-http") {
const transport = this.constructHttpTransport(serverConfig);
await client.connect(transport, {});
}
await this.withTokenRefresh(serverConfig.name, async () => {
if (serverConfig.apiKey && !this.apiKeyCache.get(serverConfig.name)) {
this.apiKeyCache.set(serverConfig.name, serverConfig.apiKey);
}
if (serverConfig.type === "sse") {
const transport = this.constructSseTransport(serverConfig);
await client.connect(transport, {});
} else if (serverConfig.type === "streamable-http") {
const transport = this.constructHttpTransport(serverConfig);
await client.connect(transport, {});
} else {
try {
const transport = this.constructHttpTransport(serverConfig);
await client.connect(transport, {});
} catch (e) {
if (isAuthError(e)) {
throw e;
}
const transport = this.constructSseTransport(serverConfig);
await client.connect(transport, {});
}
}
});
} catch (error: unknown) {
// on authorization error, use "mcp-remote" with stdio transport to connect
if (is401Error(error)) {
// If token refresh didn't work and it's a 401, fall back to mcp-remote
if (isAuthError(error) && !this.isHeadless) {
const transport = this.constructStdioTransport(
{
name: serverConfig.name,
@ -426,32 +498,6 @@ export class MCPService
throw error;
}
}
if (typeof serverConfig.type === "undefined") {
try {
const transport = this.constructHttpTransport(serverConfig);
await client.connect(transport, {});
} catch {
logger.debug(
"MCP Connection: http connection failed, falling back to sse connection",
{
name: serverConfig.name,
},
);
try {
const transport = this.constructSseTransport(serverConfig);
await client.connect(transport, {});
} catch (e) {
throw new Error(
`MCP config with URL and no type specified failed both SSE and HTTP connection: ${e instanceof Error ? e.message : String(e)}`,
);
}
}
} else if (
!["streamable-http", "sse", "stdio"].includes(serverConfig.type)
) {
throw new Error(`Unsupported transport type: ${serverConfig.type}`);
}
}
return client;
@ -460,11 +506,12 @@ export class MCPService
private constructSseTransport(
serverConfig: SseMcpServer,
): SSEClientTransport {
const apiKey = this.apiKeyCache.get(serverConfig.name);
// Merge apiKey into headers if provided
const headers = {
...serverConfig.requestOptions?.headers,
...(serverConfig.apiKey && {
Authorization: `Bearer ${serverConfig.apiKey}`,
...(apiKey && {
Authorization: `Bearer ${apiKey}`,
}),
};
@ -486,10 +533,12 @@ export class MCPService
serverConfig: HttpMcpServer,
): StreamableHTTPClientTransport {
// Merge apiKey into headers if provided
const apiKey = this.apiKeyCache.get(serverConfig.name);
const headers = {
...serverConfig.requestOptions?.headers,
...(serverConfig.apiKey && {
Authorization: `Bearer ${serverConfig.apiKey}`,
...(apiKey && {
Authorization: `Bearer ${apiKey}`,
}),
};

View file

@ -0,0 +1,19 @@
import { SseError } from "@modelcontextprotocol/sdk/client/sse.js";
import { StreamableHTTPError } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
/**
* Check if an error is an authentication error that should trigger token refresh
* 405 is technically "not allowed" but some servers like Sanity don't return the correct error
* Since we're using mcp library there's a good chance 405 means auth issue and doesn't hurt to retry with auth
*/
export function isAuthError(error: unknown): boolean {
return (
(error instanceof SseError && error.code === 401) ||
(error instanceof SseError && error.code === 405) ||
(error instanceof StreamableHTTPError && error.code === 401) ||
(error instanceof StreamableHTTPError && error.code === 405) ||
(error instanceof Error && error.message.includes("401")) ||
(error instanceof Error && error.message.includes("405")) ||
(error instanceof Error && error.message.includes("Unauthorized"))
);
}

View file

@ -1,4 +1,4 @@
import { describe, it, expect, vi, beforeEach } from "vitest";
import { beforeEach, describe, expect, it, vi } from "vitest";
import * as workosModule from "./auth/workos.js";
import { services } from "./services/index.js";
@ -57,7 +57,7 @@ describe("handleSlashCommands - /info", () => {
it("should include version and working directory in output", async () => {
// Mock auth as not authenticated
vi.mocked(workosModule.isAuthenticated).mockReturnValue(false);
vi.mocked(workosModule.isAuthenticated).mockResolvedValue(false);
// Mock config service
const mockConfigState = {
@ -85,7 +85,7 @@ describe("handleSlashCommands - /info", () => {
it("should handle authenticated user info", async () => {
// Mock auth as authenticated
vi.mocked(workosModule.isAuthenticated).mockReturnValue(true);
vi.mocked(workosModule.isAuthenticated).mockResolvedValue(true);
vi.mocked(workosModule.loadAuthConfig).mockReturnValue({
userEmail: "test@example.com",
userId: "test-user",
@ -112,7 +112,7 @@ describe("handleSlashCommands - /info", () => {
it("should handle missing model info gracefully", async () => {
// Mock auth as not authenticated
vi.mocked(workosModule.isAuthenticated).mockReturnValue(false);
vi.mocked(workosModule.isAuthenticated).mockResolvedValue(false);
// Mock config service with no model info
const mockConfigState = {
@ -129,7 +129,7 @@ describe("handleSlashCommands - /info", () => {
it("should handle config service error", async () => {
// Mock auth as not authenticated
vi.mocked(workosModule.isAuthenticated).mockReturnValue(false);
vi.mocked(workosModule.isAuthenticated).mockResolvedValue(false);
// Mock config service throwing error
vi.mocked(services.config.getState).mockImplementation(() => {

View file

@ -1,14 +1,15 @@
import type { AssistantUnrolled } from "@continuedev/config-yaml";
import {
describe,
it,
expect,
vi,
beforeEach,
describe,
expect,
it,
vi,
type MockedFunction,
} from "vitest";
import type { AuthConfig, AuthenticatedConfig } from "./auth/workos.js";
import { AuthenticatedConfig } from "./auth/workos-types.js";
import type { AuthConfig } from "./auth/workos.js";
import type { ConfigServiceState } from "./services/types.js";
import { handleSlashCommands } from "./slashCommands.js";
@ -128,7 +129,7 @@ describe("slashCommands", () => {
(
isAuthenticated as MockedFunction<typeof isAuthenticated>
).mockReturnValue(false);
).mockResolvedValue(false);
(
services.config.getState as MockedFunction<
typeof services.config.getState
@ -157,7 +158,7 @@ describe("slashCommands", () => {
(
isAuthenticated as MockedFunction<typeof isAuthenticated>
).mockReturnValue(true);
).mockResolvedValue(true);
(loadAuthConfig as MockedFunction<typeof loadAuthConfig>).mockReturnValue(
{} as AuthConfig,
);
@ -199,7 +200,7 @@ describe("slashCommands", () => {
(
isAuthenticated as MockedFunction<typeof isAuthenticated>
).mockReturnValue(true);
).mockResolvedValue(true);
(loadAuthConfig as MockedFunction<typeof loadAuthConfig>).mockReturnValue(
mockAuthConfig,
);
@ -230,7 +231,7 @@ describe("slashCommands", () => {
(
isAuthenticated as MockedFunction<typeof isAuthenticated>
).mockReturnValue(false);
).mockResolvedValue(false);
(
services.config.getState as MockedFunction<
typeof services.config.getState
@ -263,7 +264,7 @@ describe("slashCommands", () => {
(
isAuthenticated as MockedFunction<typeof isAuthenticated>
).mockReturnValue(false);
).mockResolvedValue(false);
(
services.config.getState as MockedFunction<
typeof services.config.getState

View file

@ -93,9 +93,10 @@ async function handleLogout() {
}
}
function handleWhoami() {
if (isAuthenticated()) {
const config = loadAuthConfig();
async function handleWhoami() {
const authed = await isAuthenticated();
if (authed) {
const config = loadAuthConfig(); // TODO duplicate auth config loading
if (config && isAuthenticatedConfig(config)) {
return {
exit: false,

View file

@ -47,7 +47,6 @@ describe("getRequestTools - Tool Filtering", () => {
// Read-only tools should still be available
expect(toolNames).toContain("Read");
expect(toolNames).toContain("List");
expect(toolNames).toContain("Search");
expect(toolNames).toContain("Fetch");
expect(toolNames).toContain("Checklist");
@ -130,7 +129,6 @@ describe("getRequestTools - Tool Filtering", () => {
expect(toolNames).toContain("Bash");
expect(toolNames).toContain("Write");
expect(toolNames).toContain("List");
expect(toolNames).toContain("Search");
});
test("plan mode should override allow flags (regression test for GitHub Actions issue)", async () => {
@ -158,6 +156,5 @@ describe("getRequestTools - Tool Filtering", () => {
// Read-only tools should be available
expect(toolNames).toContain("Read");
expect(toolNames).toContain("List");
expect(toolNames).toContain("Search");
});
});

View file

@ -27,7 +27,7 @@ import { multiEditTool } from "./multiEdit.js";
import { readFileTool } from "./readFile.js";
import { reportFailureTool } from "./reportFailure.js";
import { runTerminalCommandTool } from "./runTerminalCommand.js";
import { searchCodeTool } from "./searchCode.js";
import { checkIfRipgrepIsInstalled, searchCodeTool } from "./searchCode.js";
import {
type Tool,
type ToolCall,
@ -57,32 +57,29 @@ const BASE_BUILTIN_TOOLS: Tool[] = [
readFileTool,
writeFileTool,
listFilesTool,
searchCodeTool,
runTerminalCommandTool,
fetchTool,
writeChecklistTool,
reportFailureTool,
];
const BUILTIN_SEARCH_TOOLS: Tool[] = [searchCodeTool];
// Get all builtin tools including dynamic ones, with capability-based filtering
export async function getAllAvailableTools(
isHeadless: boolean,
): Promise<Tool[]> {
const tools = [...BASE_BUILTIN_TOOLS];
// Filter out ReportFailure tool if no agent ID is present
const isRipgrepInstalled = await checkIfRipgrepIsInstalled();
if (isRipgrepInstalled) {
tools.push(...BUILTIN_SEARCH_TOOLS);
}
// Add ReportFailure tool if no agent ID is present
// (it requires --id to function and will confuse the agent if unavailable)
const agentId = getAgentIdFromArgs();
if (!agentId) {
const reportFailureIndex = tools.findIndex(
(t) => t.name === reportFailureTool.name,
);
if (reportFailureIndex !== -1) {
tools.splice(reportFailureIndex, 1);
logger.debug(
`Filtered out ${reportFailureTool.name} tool - no agent ID present (--id flag not provided)`,
);
}
if (agentId) {
tools.push(reportFailureTool);
}
// If model is capable, exclude editTool in favor of multiEditTool

View file

@ -12,6 +12,15 @@ const execPromise = util.promisify(child_process.exec);
const DEFAULT_MAX_RESULTS = 100;
const MAX_LINE_LENGTH = 1000;
export async function checkIfRipgrepIsInstalled(): Promise<boolean> {
try {
await execPromise("rg --version");
return true;
} catch {
return false;
}
}
export const searchCodeTool: Tool = {
name: "Search",
displayName: "Search",

View file

@ -0,0 +1,73 @@
import { usePostHog } from "posthog-js/react";
import { Button, Input, SecondaryButton } from "..";
import { useAppDispatch } from "../../redux/hooks";
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
export default function FeedbackDialog() {
const posthog = usePostHog();
const dispatch = useAppDispatch();
return (
<div className="mx-auto flex max-w-md flex-col p-6 pt-8">
<div className="flex items-center gap-2 text-lg font-medium">
<span>👋</span>
<span>Help us improve Continue</span>
</div>
<p className="text-foreground text-sm leading-relaxed">
We're always working to make Continue better and would love to hear from
you. If you're interested in sharing your experience, please enter your
details below.
</p>
<form
onSubmit={(e: any) => {
e.preventDefault();
posthog?.capture("user_interest_form", {
name: e.target.elements[0].value,
email: e.target.elements[1].value,
});
dispatch(
setDialogMessage(
<div className="p-6 text-center">
<div className="mb-2 text-lg">✓ Thank you!</div>
<p className="text-foreground text-sm">
We'll be in touch soon.
</p>
</div>,
),
);
// Auto-close after 2 seconds
setTimeout(() => {
dispatch(setShowDialog(false));
dispatch(setDialogMessage(undefined));
}, 2000);
}}
className="flex flex-col gap-3"
>
<Input type="text" name="name" placeholder="Name" required />
<Input type="email" name="email" placeholder="Email" required />
<div className="mt-2 flex justify-between gap-2">
<SecondaryButton
className="flex-1"
type="button"
onClick={() => {
dispatch(setShowDialog(false));
dispatch(setDialogMessage(undefined));
}}
>
Not now
</SecondaryButton>
<Button className="flex-1" type="submit">
Submit
</Button>
</div>
</form>
<p className="text-description-muted text-xs">
We'll only use this information to reach out for feedback.
</p>
</div>
);
}

View file

@ -42,7 +42,7 @@ export async function getRenderedV1Prompt(
const getUriFromPath = (path: string) => {
return resolveRelativePathInDir(path, ideMessenger.ide, workspaceDirs);
};
const handlebars = await import("handlebars");
const handlebars = (await import("handlebars")).default;
let rendered = await renderTemplatedString(
handlebars,
command.prompt,

View file

@ -1155,7 +1155,7 @@ export const models: { [key: string]: ModelPackage } = {
title: "Claude 4 Sonnet",
apiKey: "",
},
providerOptions: ["anthropic"],
providerOptions: ["anthropic", "replicate"],
icon: "anthropic.png",
isOpenSource: false,
},

View file

@ -726,6 +726,7 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n
models.codeLlamaInstruct,
models.wizardCoder,
models.mistralOs,
models.claude4Sonnet,
],
apiKeyUrl: "https://replicate.com/account/api-tokens",
},

View file

@ -47,12 +47,15 @@ import { ToolCallDiv } from "./ToolCallDiv";
import { useStore } from "react-redux";
import { BackgroundModeView } from "../../components/BackgroundMode/BackgroundModeView";
import { CliInstallBanner } from "../../components/CliInstallBanner";
import FeedbackDialog from "../../components/dialogs/FeedbackDialog";
import { FatalErrorIndicator } from "../../components/config/FatalErrorNotice";
import InlineErrorMessage from "../../components/mainInput/InlineErrorMessage";
import { resolveEditorContent } from "../../components/mainInput/TipTapEditor/utils/resolveEditorContent";
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
import { RootState } from "../../redux/store";
import { cancelStream } from "../../redux/thunks/cancelStream";
import { getLocalStorage, setLocalStorage } from "../../util/localStorage";
import { EmptyChatBody } from "./EmptyChatBody";
import { ExploreDialogWatcher } from "./ExploreDialogWatcher";
import { useAutoScroll } from "./useAutoScroll";
@ -269,6 +272,18 @@ export function Chat() {
editorToClearOnSend.commands.clearContent();
}
}
// Increment localstorage counter for popup
const currentCount = getLocalStorage("mainTextEntryCounter");
if (currentCount) {
setLocalStorage("mainTextEntryCounter", currentCount + 1);
if (currentCount === 300) {
dispatch(setDialogMessage(<FeedbackDialog />));
dispatch(setShowDialog(true));
}
} else {
setLocalStorage("mainTextEntryCounter", 1);
}
},
[dispatch, ideMessenger, reduxStore, setIsCreatingAgent],
);

View file

@ -19,7 +19,6 @@ export type ToolGroupPolicies = { [toolGroupName: string]: ToolGroupPolicy };
type UIState = {
showDialog: boolean;
dialogMessage: JSX.Element | undefined;
dialogEntryOn: boolean;
onboardingCard: OnboardingCardState;
isExploreDialogOpen: boolean;
hasDismissedExploreDialog: boolean;
@ -35,7 +34,6 @@ export const DEFAULT_RULE_SETTING: RulePolicy = "on";
export const DEFAULT_UI_SLICE: UIState = {
showDialog: false,
dialogMessage: undefined,
dialogEntryOn: false,
onboardingCard: defaultOnboardingCardState,
isExploreDialogOpen:
getLocalStorage(LocalStorageKey.IsExploreDialogOpen) ?? false,

View file

@ -6,6 +6,7 @@ type LocalStorageTypes = {
hasDismissedExploreDialog: boolean;
onboardingStatus?: OnboardingStatus;
hasDismissedOnboardingCard: boolean;
mainTextEntryCounter: number;
ide: "vscode" | "jetbrains";
vsCodeUriScheme: string;
fontSize: number;

View file

@ -10,8 +10,8 @@
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",
"zod": "^3.24.2"
"yaml": "^2.8.1",
"zod": "^3.25.76"
},
"bin": {
"config-yaml": "dist/cli.js"
@ -36,7 +36,7 @@
"version": "1.0.14",
"license": "Apache-2.0",
"dependencies": {
"zod": "^3.24.2"
"zod": "^3.25.76"
},
"devDependencies": {
"@types/node": "^20.11.19",
@ -10447,14 +10447,15 @@
"dev": true
},
"node_modules/yaml": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz",
"integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==",
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
"integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
"license": "ISC",
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14"
"node": ">= 14.6"
}
},
"node_modules/yargs": {
@ -10506,9 +10507,10 @@
}
},
"node_modules/zod": {
"version": "3.24.2",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz",
"integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==",
"version": "3.25.76",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}

View file

@ -24,8 +24,8 @@
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",
"zod": "^3.24.2"
"yaml": "^2.8.1",
"zod": "^3.25.76"
},
"devDependencies": {
"@types/jest": "^29.5.14",

View file

@ -486,6 +486,258 @@ describe("parseAgentFileTools", () => {
});
});
describe("URL-based MCP references", () => {
it("should parse HTTPS URL without tool name", () => {
const result = parseAgentFileTools("https://mcp.example.com");
expect(result).toEqual({
tools: [{ mcpServer: "https://mcp.example.com" }],
mcpServers: ["https://mcp.example.com"],
allBuiltIn: false,
});
});
it("should parse HTTP URL without tool name", () => {
const result = parseAgentFileTools("http://mcp.example.com");
expect(result).toEqual({
tools: [{ mcpServer: "http://mcp.example.com" }],
mcpServers: ["http://mcp.example.com"],
allBuiltIn: false,
});
});
it("should parse HTTPS URL with port", () => {
const result = parseAgentFileTools("https://mcp.example.com:8080");
expect(result).toEqual({
tools: [{ mcpServer: "https://mcp.example.com:8080" }],
mcpServers: ["https://mcp.example.com:8080"],
allBuiltIn: false,
});
});
it("should parse HTTPS URL with tool name", () => {
const result = parseAgentFileTools("https://mcp.example.com:tool_name");
expect(result).toEqual({
tools: [
{ mcpServer: "https://mcp.example.com", toolName: "tool_name" },
],
mcpServers: ["https://mcp.example.com"],
allBuiltIn: false,
});
});
it("should parse HTTP URL with tool name", () => {
const result = parseAgentFileTools("http://mcp.example.com:my_tool");
expect(result).toEqual({
tools: [{ mcpServer: "http://mcp.example.com", toolName: "my_tool" }],
mcpServers: ["http://mcp.example.com"],
allBuiltIn: false,
});
});
it("should parse HTTPS URL with port and tool name", () => {
const result = parseAgentFileTools(
"https://mcp.example.com:8080:tool_name",
);
expect(result).toEqual({
tools: [
{ mcpServer: "https://mcp.example.com:8080", toolName: "tool_name" },
],
mcpServers: ["https://mcp.example.com:8080"],
allBuiltIn: false,
});
});
it("should parse URL with path", () => {
const result = parseAgentFileTools("https://api.example.com/mcp");
expect(result).toEqual({
tools: [{ mcpServer: "https://api.example.com/mcp" }],
mcpServers: ["https://api.example.com/mcp"],
allBuiltIn: false,
});
});
it("should parse URL with path and tool name", () => {
const result = parseAgentFileTools(
"https://api.example.com/mcp:tool_name",
);
expect(result).toEqual({
tools: [
{ mcpServer: "https://api.example.com/mcp", toolName: "tool_name" },
],
mcpServers: ["https://api.example.com/mcp"],
allBuiltIn: false,
});
});
it("should parse URL with query parameters", () => {
const result = parseAgentFileTools(
"https://api.example.com/mcp?key=value",
);
expect(result).toEqual({
tools: [{ mcpServer: "https://api.example.com/mcp?key=value" }],
mcpServers: ["https://api.example.com/mcp?key=value"],
allBuiltIn: false,
});
});
it("should parse URL with query parameters and tool name", () => {
const result = parseAgentFileTools(
"https://api.example.com/mcp?key=value:tool_name",
);
expect(result).toEqual({
tools: [
{
mcpServer: "https://api.example.com/mcp?key=value",
toolName: "tool_name",
},
],
mcpServers: ["https://api.example.com/mcp?key=value"],
allBuiltIn: false,
});
});
it("should parse tool names with hyphens", () => {
const result = parseAgentFileTools("https://mcp.example.com:read-alerts");
expect(result).toEqual({
tools: [
{ mcpServer: "https://mcp.example.com", toolName: "read-alerts" },
],
mcpServers: ["https://mcp.example.com"],
allBuiltIn: false,
});
});
it("should parse tool names with mixed alphanumeric and special chars", () => {
const result = parseAgentFileTools(
"https://mcp.example.com:tool_name-123",
);
expect(result).toEqual({
tools: [
{ mcpServer: "https://mcp.example.com", toolName: "tool_name-123" },
],
mcpServers: ["https://mcp.example.com"],
allBuiltIn: false,
});
});
it("should parse multiple URL-based MCP references", () => {
const result = parseAgentFileTools(
"https://mcp1.example.com:tool1, https://mcp2.example.com:tool2",
);
expect(result).toEqual({
tools: [
{ mcpServer: "https://mcp1.example.com", toolName: "tool1" },
{ mcpServer: "https://mcp2.example.com", toolName: "tool2" },
],
mcpServers: ["https://mcp1.example.com", "https://mcp2.example.com"],
allBuiltIn: false,
});
});
it("should parse mixed URL and slug-based MCP references", () => {
const result = parseAgentFileTools(
"https://mcp.example.com:tool1, owner/package:tool2, bash",
);
expect(result).toEqual({
tools: [
{ mcpServer: "https://mcp.example.com", toolName: "tool1" },
{ mcpServer: "owner/package", toolName: "tool2" },
{ toolName: "bash" },
],
mcpServers: ["https://mcp.example.com", "owner/package"],
allBuiltIn: false,
});
});
it("should deduplicate URL-based MCP servers", () => {
const result = parseAgentFileTools(
"https://mcp.example.com:tool1, https://mcp.example.com:tool2, https://mcp.example.com",
);
expect(result).toEqual({
tools: [
{ mcpServer: "https://mcp.example.com", toolName: "tool1" },
{ mcpServer: "https://mcp.example.com", toolName: "tool2" },
{ mcpServer: "https://mcp.example.com" },
],
mcpServers: ["https://mcp.example.com"],
allBuiltIn: false,
});
});
it("should reject URL with whitespace in tool name", () => {
expect(() =>
parseAgentFileTools("https://mcp.example.com:tool name"),
).toThrow(
'Invalid URL-based MCP tool reference "https://mcp.example.com:tool name": the part after the last colon must be either a port number or a valid tool name',
);
});
it("should reject URL with invalid characters after colon", () => {
expect(() =>
parseAgentFileTools("https://mcp.example.com:invalid@tool"),
).toThrow(
'Invalid URL-based MCP tool reference "https://mcp.example.com:invalid@tool": the part after the last colon must be either a port number or a valid tool name',
);
});
it("should reject URL with whitespace before colon", () => {
expect(() =>
parseAgentFileTools("https://mcp.example.com :tool"),
).toThrow(
'Invalid MCP tool reference "https://mcp.example.com :tool": colon-separated tool references cannot contain whitespace',
);
});
it("should handle URL-based MCP with built_in keyword", () => {
const result = parseAgentFileTools(
"built_in, https://mcp.example.com:tool1",
);
expect(result).toEqual({
tools: [{ mcpServer: "https://mcp.example.com", toolName: "tool1" }],
mcpServers: ["https://mcp.example.com"],
allBuiltIn: true,
});
});
it("should parse localhost URLs", () => {
const result = parseAgentFileTools("http://localhost:3000");
expect(result).toEqual({
tools: [{ mcpServer: "http://localhost:3000" }],
mcpServers: ["http://localhost:3000"],
allBuiltIn: false,
});
});
it("should parse localhost URLs with tool name", () => {
const result = parseAgentFileTools("http://localhost:3000:my_tool");
expect(result).toEqual({
tools: [{ mcpServer: "http://localhost:3000", toolName: "my_tool" }],
mcpServers: ["http://localhost:3000"],
allBuiltIn: false,
});
});
it("should parse IP address URLs", () => {
const result = parseAgentFileTools("https://192.168.1.1:8080");
expect(result).toEqual({
tools: [{ mcpServer: "https://192.168.1.1:8080" }],
mcpServers: ["https://192.168.1.1:8080"],
allBuiltIn: false,
});
});
it("should parse IP address URLs with tool name", () => {
const result = parseAgentFileTools("https://192.168.1.1:8080:tool_name");
expect(result).toEqual({
tools: [
{ mcpServer: "https://192.168.1.1:8080", toolName: "tool_name" },
],
mcpServers: ["https://192.168.1.1:8080"],
allBuiltIn: false,
});
});
});
describe("whitespace validation in colon-separated MCP tool references", () => {
it("should reject MCP tool reference with space after colon", () => {
expect(() => parseAgentFileTools("owner/slug: tool")).toThrow(
@ -601,4 +853,53 @@ describe("parseAgentFileTools", () => {
expect(() => parseAgentFileTools("my tool")).not.toThrow();
});
});
describe("edge cases", () => {
it("should handle empty tool names correctly", () => {
const result = parseAgentFileTools("owner/package:,https://example.com:");
expect(result.tools).toEqual([
{ mcpServer: "owner/package", toolName: "" },
{ mcpServer: "https://example.com", toolName: "" },
]);
});
it("should handle trailing commas", () => {
const result = parseAgentFileTools("bash, owner/package,");
expect(result.tools).toEqual([
{ toolName: "bash" },
{ mcpServer: "owner/package" },
]);
});
it("should handle multiple consecutive commas", () => {
const result = parseAgentFileTools("bash,,owner/package");
expect(result.tools).toEqual([
{ toolName: "bash" },
{ mcpServer: "owner/package" },
]);
});
it("should parse complex real-world example", () => {
const result = parseAgentFileTools(
"built_in, linear/mcp, sentry/mcp:read-alerts, https://custom-mcp.internal.com:8443:custom_tool, bash",
);
expect(result).toEqual({
tools: [
{ mcpServer: "linear/mcp" },
{ mcpServer: "sentry/mcp", toolName: "read-alerts" },
{
mcpServer: "https://custom-mcp.internal.com:8443",
toolName: "custom_tool",
},
{ toolName: "bash" },
],
mcpServers: [
"linear/mcp",
"sentry/mcp",
"https://custom-mcp.internal.com:8443",
],
allBuiltIn: true,
});
});
});
});

View file

@ -23,7 +23,7 @@ export type AgentFile = z.infer<typeof agentFileSchema>;
* Parsed agent tool reference
*/
export interface AgentToolReference {
/** MCP server slug (owner/package) if this is an MCP tool */
/** MCP server slug (owner/package) or URL (https://...) if this is an MCP tool */
mcpServer?: string;
/** Specific tool name - either MCP tool name or built-in tool name */
toolName?: string;
@ -91,6 +91,8 @@ export function serializeAgentFile(agentFile: AgentFile): string {
* Supports formats:
* - owner/package - all tools from MCP server
* - owner/package:tool_name - specific tool from MCP server
* - https://mcp.url.com or http://mcp.url.com - all tools from URL-based MCP server
* - https://mcp.url.com:tool_name - specific tool from URL-based MCP server
* - ToolName or tool_name - built-in tool
* - built_in - all built-in tools
*
@ -115,6 +117,53 @@ export function parseAgentFileTools(toolsString?: string): ParsedAgentTools {
if (toolRef === "built_in") {
// Special keyword for all built-in tools
allBuiltIn = true;
} else if (
toolRef.startsWith("http://") ||
toolRef.startsWith("https://")
) {
// URL-based MCP tool reference: "https://mcp.url.com" or "https://mcp.url.com:tool_name"
const protocolEndIndex = toolRef.indexOf("://") + 3;
const lastColonIndex = toolRef.lastIndexOf(":");
// Check if there's a colon after the protocol
if (lastColonIndex > protocolEndIndex) {
const afterLastColon = toolRef.substring(lastColonIndex + 1);
// Check if it's a port number (only digits), empty string, or a tool name
if (/^\d+(?:$|[/?#])/.test(afterLastColon)) {
// It's a port number, treat the whole thing as the server
const mcpServer = toolRef;
tools.push({ mcpServer });
mcpServerSet.add(mcpServer);
} else if (
afterLastColon === "" ||
/^[a-zA-Z0-9_-]+$/.test(afterLastColon)
) {
// It's a tool name (or empty string)
// Reject references with whitespace to prevent silent misconfigurations
if (/\s/.test(toolRef)) {
throw new Error(
`Invalid MCP tool reference "${toolRef}": colon-separated tool references cannot contain whitespace. ` +
`Use format "https://server:tool_name" without spaces.`,
);
}
const mcpServer = toolRef.substring(0, lastColonIndex);
const toolName = afterLastColon;
tools.push({ mcpServer, toolName });
mcpServerSet.add(mcpServer);
} else {
throw new Error(
`Invalid URL-based MCP tool reference "${toolRef}": the part after the last colon must be either a port number or a valid tool name (alphanumeric, underscores, hyphens).`,
);
}
} else {
// No colon after the protocol, treat the whole thing as the server
const mcpServer = toolRef;
tools.push({ mcpServer });
mcpServerSet.add(mcpServer);
}
} else if (toolRef.includes("/")) {
// MCP tool reference: "owner/package" or "owner/package:tool_name"
const colonIndex = toolRef.indexOf(":");

View file

@ -9,8 +9,8 @@
"version": "0.0.1",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-yaml": "file:../config-yaml",
"@openapitools/openapi-generator-cli": "^2.24.0",
"@continuedev/config-yaml": "^1.33.0",
"@openapitools/openapi-generator-cli": "^2.25.1",
"express": "^4.18.2",
"swagger-ui-express": "^5.0.0"
},
@ -18,33 +18,6 @@
"typescript": "^5.0.0"
}
},
"../config-yaml": {
"name": "@continuedev/config-yaml",
"version": "1.23.0",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",
"zod": "^3.24.2"
},
"bin": {
"config-yaml": "dist/cli.js"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.6",
"@semantic-release/npm": "^10.0.6",
"@types/jest": "^29.5.14",
"@types/node": "^20.0.0",
"cross-env": "^7.0.3",
"jest": "^29.7.0",
"semantic-release": "^21.1.2",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
"zod-to-json-schema": "^3.24.5"
}
},
"node_modules/@borewit/text-codec": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz",
@ -55,9 +28,28 @@
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/@continuedev/config-types": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz",
"integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==",
"license": "Apache-2.0",
"dependencies": {
"zod": "^3.23.8"
}
},
"node_modules/@continuedev/config-yaml": {
"resolved": "../config-yaml",
"link": true
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.33.0.tgz",
"integrity": "sha512-riMSmuQ3HhLMKXeQ6L55pXzo/CZUVbEMallg09Pq3GNl8nddV6+7eHhzr1bThLO1COvKNLmo+3kQg52ROv+syA==",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",
"zod": "^3.24.2"
},
"bin": {
"config-yaml": "dist/cli.js"
}
},
"node_modules/@inquirer/external-editor": {
"version": "1.0.2",
@ -234,14 +226,14 @@
}
},
"node_modules/@nestjs/common": {
"version": "11.1.6",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.6.tgz",
"integrity": "sha512-krKwLLcFmeuKDqngG2N/RuZHCs2ycsKcxWIDgcm7i1lf3sQ0iG03ci+DsP/r3FcT/eJDFsIHnKtNta2LIi7PzQ==",
"version": "11.1.9",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz",
"integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==",
"license": "MIT",
"dependencies": {
"file-type": "21.0.0",
"file-type": "21.1.0",
"iterare": "1.2.1",
"load-esm": "1.0.2",
"load-esm": "1.0.3",
"tslib": "2.8.1",
"uid": "2.0.2"
},
@ -265,16 +257,16 @@
}
},
"node_modules/@nestjs/core": {
"version": "11.1.6",
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.6.tgz",
"integrity": "sha512-siWX7UDgErisW18VTeJA+x+/tpNZrJewjTBsRPF3JVxuWRuAB1kRoiJcxHgln8Lb5UY9NdvklITR84DUEXD0Cg==",
"version": "11.1.9",
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.9.tgz",
"integrity": "sha512-a00B0BM4X+9z+t3UxJqIZlemIwCQdYoPKrMcM+ky4z3pkqqG1eTWexjs+YXpGObnLnjtMPVKWlcZHp3adDYvUw==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@nuxt/opencollective": "0.4.1",
"fast-safe-stringify": "2.1.1",
"iterare": "1.2.1",
"path-to-regexp": "8.2.0",
"path-to-regexp": "8.3.0",
"tslib": "2.8.1",
"uid": "2.0.2"
},
@ -344,24 +336,24 @@
"integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw=="
},
"node_modules/@openapitools/openapi-generator-cli": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.24.0.tgz",
"integrity": "sha512-VS0sfW46oe/hQq7g1YZU1cJJebAQIwKhKqjsDY1/QFmcJMXYfe339yjMDTv02kMbsx621cSH46HIdvmW+i+7mg==",
"version": "2.25.1",
"resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.25.1.tgz",
"integrity": "sha512-IY0Vgnv//v2X7+gqAj+jE+CoygdeIx15ZaF2SK+/kQR/sHBJTgxOOc0V+ti2tfxv4pkOILcTcPhmuZIobxPQhg==",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@nestjs/axios": "4.0.1",
"@nestjs/common": "11.1.6",
"@nestjs/core": "11.1.6",
"@nestjs/common": "11.1.9",
"@nestjs/core": "11.1.9",
"@nuxtjs/opencollective": "0.3.2",
"axios": "1.12.2",
"axios": "1.13.2",
"chalk": "4.1.2",
"commander": "8.3.0",
"compare-versions": "6.1.1",
"concurrently": "9.2.1",
"console.table": "0.10.0",
"fs-extra": "11.3.2",
"glob": "11.0.3",
"glob": "12.0.0",
"inquirer": "8.2.7",
"proxy-agent": "6.5.0",
"reflect-metadata": "0.2.2",
@ -386,12 +378,12 @@
"hasInstallScript": true
},
"node_modules/@tokenizer/inflate": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz",
"integrity": "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg==",
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.3.1.tgz",
"integrity": "sha512-4oeoZEBQdLdt5WmP/hx1KZ6D3/Oid/0cUb2nk4F0pTDAWy+KCH3/EnAkZF/bvckWo8I33EqBm01lIPgmgc8rCA==",
"license": "MIT",
"dependencies": {
"debug": "^4.4.0",
"debug": "^4.4.1",
"fflate": "^0.8.2",
"token-types": "^6.0.0"
},
@ -495,9 +487,9 @@
"license": "MIT"
},
"node_modules/axios": {
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz",
"integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==",
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz",
"integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
@ -888,9 +880,10 @@
}
},
"node_modules/debug": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
},
@ -1211,13 +1204,13 @@
}
},
"node_modules/file-type": {
"version": "21.0.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-21.0.0.tgz",
"integrity": "sha512-ek5xNX2YBYlXhiUXui3D/BXa3LdqPmoLJ7rqEx2bKJ7EAUEfmXgW0Das7Dc6Nr9MvqaOnIqiPV0mZk/r/UpNAg==",
"version": "21.1.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-21.1.0.tgz",
"integrity": "sha512-boU4EHmP3JXkwDo4uhyBhTt5pPstxB6eEXKJBu2yu2l7aAMMm7QQYQEzssJmKReZYrFdFOJS8koVo6bXIBGDqA==",
"license": "MIT",
"dependencies": {
"@tokenizer/inflate": "^0.2.7",
"strtok3": "^10.2.2",
"@tokenizer/inflate": "^0.3.1",
"strtok3": "^10.3.1",
"token-types": "^6.0.0",
"uint8array-extras": "^1.4.0"
},
@ -1406,14 +1399,14 @@
}
},
"node_modules/glob": {
"version": "11.0.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
"integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==",
"license": "ISC",
"version": "12.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-12.0.0.tgz",
"integrity": "sha512-5Qcll1z7IKgHr5g485ePDdHcNQY0k2dtv/bjYy0iuyGxQw2qSOiiXUXJ+AYQpg3HNoUMHqAruX478Jeev7UULw==",
"license": "BlueOak-1.0.0",
"dependencies": {
"foreground-child": "^3.3.1",
"jackspeak": "^4.1.1",
"minimatch": "^10.0.3",
"minimatch": "^10.1.1",
"minipass": "^7.1.2",
"package-json-from-dist": "^1.0.0",
"path-scurry": "^2.0.0"
@ -1689,9 +1682,9 @@
}
},
"node_modules/load-esm": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/load-esm/-/load-esm-1.0.2.tgz",
"integrity": "sha512-nVAvWk/jeyrWyXEAs84mpQCYccxRqgKY4OznLuJhJCa0XsPSfdOIr2zvBZEj3IHEHbX97jjscKRRV539bW0Gpw==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/load-esm/-/load-esm-1.0.3.tgz",
"integrity": "sha512-v5xlu8eHD1+6r8EHTg6hfmO97LN8ugKtiXcy5e6oN72iD2r6u0RPfLl6fxM+7Wnh2ZRq15o0russMst44WauPA==",
"funding": [
{
"type": "github",
@ -1810,10 +1803,10 @@
}
},
"node_modules/minimatch": {
"version": "10.0.3",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz",
"integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==",
"license": "ISC",
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
"integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
"license": "BlueOak-1.0.0",
"dependencies": {
"@isaacs/brace-expansion": "^5.0.0"
},
@ -1993,9 +1986,9 @@
}
},
"node_modules/path-scurry": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
"integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz",
"integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==",
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^11.0.0",
@ -2009,12 +2002,13 @@
}
},
"node_modules/path-to-regexp": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz",
"integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
"integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
"license": "MIT",
"engines": {
"node": ">=16"
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/proxy-addr": {
@ -2761,6 +2755,18 @@
"node": ">=10"
}
},
"node_modules/yaml": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
"integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
"license": "ISC",
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14.6"
}
},
"node_modules/yargs": {
"version": "17.7.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
@ -2787,6 +2793,15 @@
"engines": {
"node": ">=12"
}
},
"node_modules/zod": {
"version": "3.25.76",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
}
}
}

View file

@ -14,8 +14,8 @@
"author": "Continue Dev, Inc.",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-yaml": "file:../config-yaml",
"@openapitools/openapi-generator-cli": "^2.24.0",
"@continuedev/config-yaml": "^1.33.0",
"@openapitools/openapi-generator-cli": "^2.25.1",
"express": "^4.18.2",
"swagger-ui-express": "^5.0.0"
},

View file

@ -9,7 +9,8 @@
"version": "0.0.7",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-yaml": "^1.29.0"
"@continuedev/config-yaml": "^1.33.0",
"js-yaml": "^4.1.1"
},
"devDependencies": {
"@types/jest": "^29.5.14",
@ -544,9 +545,9 @@
}
},
"node_modules/@continuedev/config-yaml": {
"version": "1.29.0",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.29.0.tgz",
"integrity": "sha512-vNHS5RGiPInqfNJItK5PRJX7Q8RzzGAUER3qHj45nQxQKySidqknQr80NTWre3AtHYJCR8IejYPM6PQ1IDYSgA==",
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.33.0.tgz",
"integrity": "sha512-riMSmuQ3HhLMKXeQ6L55pXzo/CZUVbEMallg09Pq3GNl8nddV6+7eHhzr1bThLO1COvKNLmo+3kQg52ROv+syA==",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
@ -595,6 +596,30 @@
"node": ">=8"
}
},
"node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"license": "MIT",
"dependencies": {
"sprintf-js": "~1.0.2"
}
},
"node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": {
"version": "3.14.2",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz",
"integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==",
"dev": true,
"license": "MIT",
"dependencies": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/@istanbuljs/schema": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
@ -1175,13 +1200,10 @@
"dev": true
},
"node_modules/argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"dependencies": {
"sprintf-js": "~1.0.2"
}
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"license": "Python-2.0"
},
"node_modules/async": {
"version": "3.2.5",
@ -1730,6 +1752,7 @@
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true,
"license": "BSD-2-Clause",
"bin": {
"esparse": "bin/esparse.js",
"esvalidate": "bin/esvalidate.js"
@ -2777,13 +2800,12 @@
"dev": true
},
"node_modules/js-yaml": {
"version": "3.14.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
"dev": true,
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"license": "MIT",
"dependencies": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
@ -3347,7 +3369,8 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
"dev": true
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/stack-utils": {
"version": "2.0.6",

View file

@ -12,7 +12,8 @@
"author": "Continue Dev, Inc.",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-yaml": "^1.29.0"
"@continuedev/config-yaml": "^1.33.0",
"js-yaml": "^4.1.1"
},
"devDependencies": {
"@types/jest": "^29.5.14",

View file

@ -13,15 +13,15 @@
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
"@aws-sdk/credential-providers": "^3.913.0",
"@continuedev/config-types": "^1.0.14",
"@continuedev/config-yaml": "^1.29.0",
"@continuedev/config-yaml": "^1.33.0",
"@continuedev/fetch": "^1.5.0",
"dotenv": "^16.5.0",
"google-auth-library": "^10.1.0",
"google-auth-library": "^10.4.1",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^5.13.1",
"openai": "^5.23.2",
"uuid": "^11.1.0",
"zod": "^3.24.2"
"zod": "^3.25.76"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
@ -2362,9 +2362,9 @@
}
},
"node_modules/@continuedev/config-yaml": {
"version": "1.29.0",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.29.0.tgz",
"integrity": "sha512-vNHS5RGiPInqfNJItK5PRJX7Q8RzzGAUER3qHj45nQxQKySidqknQr80NTWre3AtHYJCR8IejYPM6PQ1IDYSgA==",
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.33.0.tgz",
"integrity": "sha512-riMSmuQ3HhLMKXeQ6L55pXzo/CZUVbEMallg09Pq3GNl8nddV6+7eHhzr1bThLO1COvKNLmo+3kQg52ROv+syA==",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
@ -8274,9 +8274,9 @@
}
},
"node_modules/gcp-metadata": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.1.tgz",
"integrity": "sha512-UcO3kefx6dCcZkgcTGgVOTFb7b1LlQ02hY1omMjjrrBzkajRMCFgYOjs7J71WqnuG1k2b+9ppGL7FsOfhZMQKQ==",
"version": "8.1.2",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.2.tgz",
"integrity": "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==",
"license": "Apache-2.0",
"dependencies": {
"gaxios": "^7.0.0",
@ -8370,15 +8370,15 @@
}
},
"node_modules/google-auth-library": {
"version": "10.3.0",
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.3.0.tgz",
"integrity": "sha512-ylSE3RlCRZfZB56PFJSfUCuiuPq83Fx8hqu1KPWGK8FVdSaxlp/qkeMMX/DT/18xkwXIHvXEXkZsljRwfrdEfQ==",
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.5.0.tgz",
"integrity": "sha512-7ABviyMOlX5hIVD60YOfHw4/CxOfBhyduaYB+wbFWCWoni4N7SLcV46hrVRktuBbZjFC9ONyqamZITN7q3n32w==",
"license": "Apache-2.0",
"dependencies": {
"base64-js": "^1.3.0",
"ecdsa-sig-formatter": "^1.0.11",
"gaxios": "^7.0.0",
"gcp-metadata": "^7.0.0",
"gcp-metadata": "^8.0.0",
"google-logging-utils": "^1.0.0",
"gtoken": "^8.0.0",
"jws": "^4.0.0"
@ -8388,9 +8388,9 @@
}
},
"node_modules/google-logging-utils": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.1.tgz",
"integrity": "sha512-rcX58I7nqpu4mbKztFeOAObbomBbHU2oIb/d3tJfF3dizGSApqtSwYJigGCooHdnMyQBIw8BrWyK96w3YXgr6A==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.3.tgz",
"integrity": "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
@ -13900,9 +13900,9 @@
}
},
"node_modules/openai": {
"version": "5.20.3",
"resolved": "https://registry.npmjs.org/openai/-/openai-5.20.3.tgz",
"integrity": "sha512-8V0KgAcPFppDIP8uMBOkhRrhDBuxNQYQxb9IovP4NN4VyaYGISAzYexyYYuAwVul2HB75Wpib0xDboYJqRMNow==",
"version": "5.23.2",
"resolved": "https://registry.npmjs.org/openai/-/openai-5.23.2.tgz",
"integrity": "sha512-MQBzmTulj+MM5O8SKEk/gL8a7s5mktS9zUtAkU257WjvobGc9nKcBuVwjyEEcb9SI8a8Y2G/mzn3vm9n1Jlleg==",
"license": "Apache-2.0",
"bin": {
"openai": "bin/cli"

View file

@ -16,15 +16,15 @@
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
"@aws-sdk/credential-providers": "^3.913.0",
"@continuedev/config-types": "^1.0.14",
"@continuedev/config-yaml": "^1.29.0",
"@continuedev/config-yaml": "^1.33.0",
"@continuedev/fetch": "^1.5.0",
"dotenv": "^16.5.0",
"google-auth-library": "^10.1.0",
"google-auth-library": "^10.4.1",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^5.13.1",
"openai": "^5.23.2",
"uuid": "^11.1.0",
"zod": "^3.24.2"
"zod": "^3.25.76"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",