@athenox/talos
Version:
Talos: a backend you describe instead of write. Declare a schema, write the rules in plain language, map URLs to sentences; a small built-in model turns them into query plans.
37 lines (36 loc) • 2.14 kB
JavaScript
/**
* Talos — a web application whose backend is a small language model.
*
* You declare a schema, write the rules as ordinary prose, and say who may do
* what. The model reads all three together with the request and *generates* the
* query plan. There are no route files, no controllers and no `auth.ts`.
*
* const paper = defineApp({ schema, prompt, store, roles })
* const { plan, status, result, callId } = await paper.run('les articles de sport', ctx)
* paper.instanceId // this instance, for support
* await paper.feedback(callId, { rating: 4, text: 'right rows, wrong order' })
*
* Three things are deliberately not the model's:
*
* - **Credentials.** `verifyPassword` is scrypt with a constant-time compare.
* - **Permission.** `authorise` is ordinary code reading the declared roles.
* Over six training runs the model's refusal of out-of-scope requests reached
* 1.000 while its denial of *unauthorised* ones stalled at 0.607.
* - **Scope.** Owner-scoped rows are pinned to the session by the runtime,
* whatever plan came back.
*/
export { defineApp, authorise, modelRole, checkVocabulary, addSurfaceForms, modelInfo, planText, windowFor, slugify, embed, } from './runtime.js';
export { getDb, all, one, run, store, ident, lookupIn, beginTrace, endTrace, createTable, createUserTable, addUser, findUser, userById, hashPassword, verifyPassword, } from './db.js';
export { useSession } from './session.js';
export { sentenceRoute, defineRoutes, serveFiles, rateLimit, feed, camelRow } from './http.js';
export { sqliteStore, mysqlStore } from './stores.js';
export { localStore } from './local.js';
export { fromDrizzle } from './drizzle.js';
export { rank, similar } from './recommend.js';
export { embedText, classify, cosine, hasEmbedder } from './embed.js';
export { find } from './search.js';
export { syncSchema } from './schema.js';
export { parseCsv, toCsv, importCsv, connector } from './io.js';
export { useImages, processImage } from './images.js';
export { accounts } from './accounts.js';
export { Telemetry, ENDPOINT } from './telemetry.js';