trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
65 lines (63 loc) • 1.26 kB
JavaScript
import {
liveEntities,
liveEntity,
liveQuery
} from "../chunk-J3WYZO3Q.js";
import "../chunk-JUEMDWLU.js";
import {
FetchError,
TrellisDb
} from "../chunk-K224QLJL.js";
import {
BatchSignal,
Signal
} from "../chunk-UBGUDMUV.js";
import "../chunk-2ESYSVXG.js";
// src/client/index.browser.ts
var CONFIG_FILE = ".trellis-db.json";
function hasConfig(_dir = ".") {
return false;
}
function readConfig(_dir = ".") {
return null;
}
function configPath(dir = ".") {
const base = dir.endsWith("/") ? dir.slice(0, -1) : dir;
return `${base}/${CONFIG_FILE}`;
}
function writeConfig() {
throw browserConfigError("writeConfig()");
}
function updateConfig() {
throw browserConfigError("updateConfig()");
}
function defaultLocalConfig(dbPath, opts = {}) {
return {
mode: "local",
dbPath,
port: 3e3,
multiTenant: false,
...opts
};
}
function browserConfigError(feature) {
return new Error(
`${feature} is only available in Node. Browser apps should construct \`new TrellisDb({ url })\` directly.`
);
}
export {
BatchSignal,
CONFIG_FILE,
FetchError,
Signal,
TrellisDb,
configPath,
defaultLocalConfig,
hasConfig,
liveEntities,
liveEntity,
liveQuery,
readConfig,
updateConfig,
writeConfig
};