Merge branch 'main' into fix/sqlite-corruption-wal-pragmas
This commit is contained in:
28
packages/core/src/__tests__/use-llama-cpp-settings.test.ts
Normal file
28
packages/core/src/__tests__/use-llama-cpp-settings.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { GlobalSettings } from "../types.js";
|
||||
import {
|
||||
DEFAULT_GLOBAL_SETTINGS,
|
||||
GLOBAL_SETTINGS_KEYS,
|
||||
isGlobalSettingsKey,
|
||||
} from "../settings-schema.js";
|
||||
|
||||
describe("useLlamaCpp global setting", () => {
|
||||
it("is included in GLOBAL_SETTINGS_KEYS", () => {
|
||||
expect(GLOBAL_SETTINGS_KEYS).toContain("useLlamaCpp");
|
||||
});
|
||||
|
||||
it("defaults to undefined", () => {
|
||||
expect(DEFAULT_GLOBAL_SETTINGS.useLlamaCpp).toBeUndefined();
|
||||
});
|
||||
|
||||
it("is recognized by isGlobalSettingsKey", () => {
|
||||
expect(isGlobalSettingsKey("useLlamaCpp")).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts boolean values in GlobalSettings", () => {
|
||||
const enabled: GlobalSettings = { useLlamaCpp: true };
|
||||
const disabled: GlobalSettings = { useLlamaCpp: false };
|
||||
expect(enabled.useLlamaCpp).toBe(true);
|
||||
expect(disabled.useLlamaCpp).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -3261,57 +3261,49 @@ export class MissionStore extends EventEmitter<MissionStoreEvents> {
|
||||
|
||||
// ── ID Generators ───────────────────────────────────────────────────
|
||||
|
||||
private generateMissionId(): string {
|
||||
const timestamp = Date.now();
|
||||
private idSequence = 0;
|
||||
|
||||
private generateId(prefix: string): string {
|
||||
const timestamp = Date.now().toString(36).toUpperCase();
|
||||
this.idSequence += 1;
|
||||
const sequence = this.idSequence.toString(36).toUpperCase().padStart(4, "0");
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `M-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return `${prefix}-${timestamp}-${sequence}-${random}`;
|
||||
}
|
||||
|
||||
private generateMissionId(): string {
|
||||
return this.generateId("M");
|
||||
}
|
||||
|
||||
private generateMilestoneId(): string {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `MS-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return this.generateId("MS");
|
||||
}
|
||||
|
||||
private generateSliceId(): string {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `SL-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return this.generateId("SL");
|
||||
}
|
||||
|
||||
private generateFeatureId(): string {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `F-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return this.generateId("F");
|
||||
}
|
||||
|
||||
private generateMissionEventId(): string {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `ME-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return this.generateId("ME");
|
||||
}
|
||||
|
||||
private generateAssertionId(): string {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `CA-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return this.generateId("CA");
|
||||
}
|
||||
|
||||
private generateValidatorRunId(): string {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `VR-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return this.generateId("VR");
|
||||
}
|
||||
|
||||
private generateFailureId(): string {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `VF-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return this.generateId("VF");
|
||||
}
|
||||
|
||||
private generateLineageId(): string {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
|
||||
return `FL-${timestamp.toString(36).toUpperCase()}-${random}`;
|
||||
return this.generateId("FL");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ export const DEFAULT_GLOBAL_SETTINGS = {
|
||||
modelOnboardingComplete: undefined,
|
||||
useClaudeCli: undefined,
|
||||
useDroidCli: undefined,
|
||||
useLlamaCpp: undefined,
|
||||
// Global baseline lanes for per-role model selection
|
||||
executionGlobalProvider: undefined,
|
||||
executionGlobalModelId: undefined,
|
||||
|
||||
@@ -1403,6 +1403,13 @@ export interface GlobalSettings {
|
||||
* by the dashboard auth toggle. Setting this field explicitly (true/false)
|
||||
* always wins. */
|
||||
useDroidCli?: boolean;
|
||||
/** When true, enable llama.cpp model-provider support (provider ID: `llama-server`)
|
||||
* via Fusion's bundled `@fusion/pi-llama-cpp` extension.
|
||||
*
|
||||
* When left undefined, llama.cpp routing stays disabled unless explicitly enabled
|
||||
* by the dashboard auth toggle. Setting this field explicitly (true/false)
|
||||
* always wins. */
|
||||
useLlamaCpp?: boolean;
|
||||
/** Global baseline AI model provider for task execution (executor agent).
|
||||
* This is the global lane that project-level `executionProvider` can override.
|
||||
* Must be set together with `executionGlobalModelId`. Falls back to
|
||||
|
||||
Reference in New Issue
Block a user