@useatlas/types
Advanced tools
| /** | ||
| * Plugin catalog vocabulary — shared by `@atlas/api` (canonical owner of the | ||
| * `plugin_catalog` schema + Zod validation) and `@useatlas/chat` (consumes | ||
| * the catalog at boot to decide which chat adapters to instantiate). | ||
| * | ||
| * Pre-#2665 the literal unions were inline-duplicated in `plugins/chat/src/` | ||
| * because the chat plugin can't import `@atlas/api` (CLAUDE.md | ||
| * "Frontend is a pure HTTP client" — same package boundary). The same | ||
| * concern applies to plugin packages, so the shared seam is `@useatlas/types`. | ||
| * | ||
| * A rename or addition to either tuple is now a single edit propagating | ||
| * through both packages via TypeScript's literal-union exhaustiveness checks. | ||
| */ | ||
| /** | ||
| * Install handlers a catalog entry can dispatch to. Determines which UI | ||
| * flow the customer admin sees on `/admin/integrations`: | ||
| * | ||
| * - `oauth` — Customer admin clicks Connect → operator-owned App Registration | ||
| * OAuth dance → bot token persists to per-Workspace encrypted credential | ||
| * store. Chat: Slack. Integration: Salesforce, Jira, GitHub Apps (1.5.3), | ||
| * Linear OAuth (1.5.3). | ||
| * - `form` — Customer admin fills a form (API key, SMTP creds, webhook | ||
| * URL); validates against the catalog entry's `config_schema`; persists | ||
| * to `workspace_plugins.config` + encrypted credential storage. | ||
| * Integrations: Email (SMTP), Webhook, Obsidian, GitHub PAT (self-host), | ||
| * Linear API-key (1.5.3). | ||
| * - `static-bot` — Operator-shared bot serves every Workspace; customer | ||
| * admin provides only a per-Workspace routing identifier (Discord | ||
| * `guild_id`, Telegram `chat_id`, Teams `tenant_id`, WhatsApp phone | ||
| * number) via form. No per-Workspace bot token. Chat: Teams, Discord, | ||
| * Google Chat, Telegram, WhatsApp. | ||
| */ | ||
| export declare const CATALOG_INSTALL_MODELS: readonly ["oauth", "form", "static-bot"]; | ||
| export type CatalogInstallModel = (typeof CATALOG_INSTALL_MODELS)[number]; | ||
| /** | ||
| * `type` groups catalog entries for admin-UI display. Backend dispatches | ||
| * by `install_model` (orthogonal), not by `type`. Future milestones may | ||
| * add `datasource` once datasource plugins migrate to the catalog | ||
| * (Architecture Backlog). | ||
| */ | ||
| export declare const CATALOG_ENTRY_TYPES: readonly ["chat", "integration"]; | ||
| export type CatalogEntryType = (typeof CATALOG_ENTRY_TYPES)[number]; | ||
| /** | ||
| * Canonical chat platform names supported by `@useatlas/chat`. The chat | ||
| * SDK's `Adapter` interface types `name` as a bare `string` because | ||
| * adapters are pluggable, but Atlas only loads the platforms enumerated | ||
| * here — narrowing to the literal union lets host `executeQuery` | ||
| * callbacks type-narrow via `if (adapter.name !== "slack")` and forces | ||
| * every `switch (adapter.name)` to be exhaustive at compile time. | ||
| * | ||
| * The runtime tuple `CHAT_ADAPTER_NAMES` is the source of truth — the | ||
| * `ChatAdapterName` literal union is derived from it via | ||
| * `(typeof CHAT_ADAPTER_NAMES)[number]`, and `plugins/chat`'s Zod | ||
| * schema (`z.enum(CHAT_ADAPTER_NAMES)`) validates catalog input against | ||
| * the same set. Extend the tuple and both the type and runtime | ||
| * validation update together. | ||
| */ | ||
| export declare const CHAT_ADAPTER_NAMES: readonly ["slack", "teams", "discord", "gchat", "telegram", "github", "linear", "whatsapp"]; | ||
| export type ChatAdapterName = (typeof CHAT_ADAPTER_NAMES)[number]; |
| // src/catalog.ts | ||
| var CATALOG_INSTALL_MODELS = ["oauth", "form", "static-bot"]; | ||
| var CATALOG_ENTRY_TYPES = ["chat", "integration"]; | ||
| var CHAT_ADAPTER_NAMES = [ | ||
| "slack", | ||
| "teams", | ||
| "discord", | ||
| "gchat", | ||
| "telegram", | ||
| "github", | ||
| "linear", | ||
| "whatsapp" | ||
| ]; | ||
| export { | ||
| CHAT_ADAPTER_NAMES, | ||
| CATALOG_INSTALL_MODELS, | ||
| CATALOG_ENTRY_TYPES | ||
| }; |
+1
-0
@@ -40,1 +40,2 @@ export * from "./auth"; | ||
| export * from "./proactive"; | ||
| export * from "./catalog"; |
+16
-0
@@ -531,2 +531,15 @@ // src/auth.ts | ||
| } | ||
| // src/catalog.ts | ||
| var CATALOG_INSTALL_MODELS = ["oauth", "form", "static-bot"]; | ||
| var CATALOG_ENTRY_TYPES = ["chat", "integration"]; | ||
| var CHAT_ADAPTER_NAMES = [ | ||
| "slack", | ||
| "teams", | ||
| "discord", | ||
| "gchat", | ||
| "telegram", | ||
| "github", | ||
| "linear", | ||
| "whatsapp" | ||
| ]; | ||
| // src/compliance.ts | ||
@@ -833,4 +846,7 @@ var PII_CATEGORIES = [ | ||
| CHAT_CONTEXT_WARNING_CODES, | ||
| CHAT_ADAPTER_NAMES, | ||
| CHART_TYPES, | ||
| CERTIFICATE_STATUSES, | ||
| CATALOG_INSTALL_MODELS, | ||
| CATALOG_ENTRY_TYPES, | ||
| BYOT_REQUIRED_PROVIDERS, | ||
@@ -837,0 +853,0 @@ BYOT_CATALOG_REFRESH_SKIP_REASONS, |
+7
-2
| { | ||
| "name": "@useatlas/types", | ||
| "version": "0.1.5", | ||
| "version": "0.1.6", | ||
| "description": "Shared types for the Atlas text-to-SQL agent", | ||
| "type": "module", | ||
| "scripts": { | ||
| "build": "rm -rf dist && bun build src/index.ts src/auth.ts src/conversation.ts src/connection.ts src/action.ts src/scheduled-task.ts src/errors.ts src/semantic.ts src/share.ts src/billing.ts src/dashboard.ts src/mode.ts src/starter-prompt.ts src/integrations.ts src/email-provider.ts src/mcp.ts src/preferences.ts src/execute-sql.ts src/proactive.ts --outdir dist --root src --target node --packages external && bun x tsc -p tsconfig.build.json", | ||
| "build": "rm -rf dist && bun build src/index.ts src/auth.ts src/conversation.ts src/connection.ts src/action.ts src/scheduled-task.ts src/errors.ts src/semantic.ts src/share.ts src/billing.ts src/dashboard.ts src/mode.ts src/starter-prompt.ts src/integrations.ts src/email-provider.ts src/mcp.ts src/preferences.ts src/execute-sql.ts src/proactive.ts src/catalog.ts --outdir dist --root src --target node --packages external && bun x tsc -p tsconfig.build.json", | ||
| "prepare": "bun run build" | ||
@@ -105,2 +105,7 @@ }, | ||
| "default": "./dist/proactive.js" | ||
| }, | ||
| "./catalog": { | ||
| "types": "./dist/catalog.d.ts", | ||
| "import": "./dist/catalog.js", | ||
| "default": "./dist/catalog.js" | ||
| } | ||
@@ -107,0 +112,0 @@ }, |
211096
2%64
3.23%5330
1.8%