trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
56 lines • 2.02 kB
TypeScript
/**
* Trellis Client — Configuration
*
* Manages `.trellis-db.json` — the local project config file that records
* whether this instance is running locally or deployed to Sprites.
*
* @module trellis/client
*/
export type DbMode = 'local' | 'remote';
export interface TrellisDbConfig {
/** Whether the DB is local (SQLite) or remote (Sprites/custom URL). */
mode: DbMode;
/** Absolute path to the SQLite database directory (local mode). */
dbPath?: string;
/** Remote API base URL (remote mode). */
url?: string;
/** API key for remote mode authentication. */
apiKey?: string;
/** Sprites sprite name (used for deploy). */
spriteName?: string;
/** ISO timestamp of last deploy. */
deployedAt?: string;
/** Port for local server mode (default: 3000). */
port?: number;
/** Enable multi-tenancy (separate SQLite per tenant). */
multiTenant?: boolean;
/** Secret used to sign/verify JWTs. */
jwtSecret?: string;
}
export declare const CONFIG_FILE = ".trellis-db.json";
/**
* Resolve the config file path relative to a directory.
*/
export declare function configPath(dir?: string): string;
/**
* Check if a `.trellis-db.json` exists in the given directory.
*/
export declare function hasConfig(dir?: string): boolean;
/**
* Read and parse the `.trellis-db.json` config file.
* Returns null if the file doesn't exist.
*/
export declare function readConfig(dir?: string): TrellisDbConfig | null;
/**
* Write a config to `.trellis-db.json`.
*/
export declare function writeConfig(config: TrellisDbConfig, dir?: string): void;
/**
* Merge partial updates into an existing config file (creates if missing).
*/
export declare function updateConfig(updates: Partial<TrellisDbConfig>, dir?: string): TrellisDbConfig;
/**
* Build a local config with sensible defaults for a given directory.
*/
export declare function defaultLocalConfig(dbPath: string, opts?: Partial<TrellisDbConfig>): TrellisDbConfig;
//# sourceMappingURL=config.d.ts.map