@useatlas/types
Advanced tools
+1
-1
@@ -64,3 +64,3 @@ import type { AuthMode } from "./auth"; | ||
| */ | ||
| export declare const CHAT_CONTEXT_WARNING_CODES: readonly ["semantic_layer_unavailable", "learned_patterns_unavailable", "plan_limit_warning"]; | ||
| export declare const CHAT_CONTEXT_WARNING_CODES: readonly ["semantic_layer_unavailable", "learned_patterns_unavailable", "plan_limit_warning", "bound_dashboard_unavailable"]; | ||
| export type ChatContextWarningCode = (typeof CHAT_CONTEXT_WARNING_CODES)[number]; | ||
@@ -67,0 +67,0 @@ /** Type guard — checks whether a string is a known `ChatContextWarningCode`. */ |
+2
-1
@@ -74,3 +74,4 @@ // src/errors.ts | ||
| "learned_patterns_unavailable", | ||
| "plan_limit_warning" | ||
| "plan_limit_warning", | ||
| "bound_dashboard_unavailable" | ||
| ]; | ||
@@ -77,0 +78,0 @@ function isChatContextWarningCode(value) { |
+2
-1
@@ -194,3 +194,4 @@ // src/auth.ts | ||
| "learned_patterns_unavailable", | ||
| "plan_limit_warning" | ||
| "plan_limit_warning", | ||
| "bound_dashboard_unavailable" | ||
| ]; | ||
@@ -197,0 +198,0 @@ function isChatContextWarningCode(value) { |
+48
-3
@@ -34,6 +34,46 @@ /** | ||
| * - `ProactiveMeterEvent` (eventType-conditional field shape) | ||
| * - Branded `WorkspaceId` / `ChannelId` / `UserId` / `Confidence` / | ||
| * `MicroUSD` / `Millis` / `EpochMs` (primitive obsession) | ||
| * - Branded `ChannelId` / `MessageId` / `Confidence` / `MicroUSD` / | ||
| * `Millis` / `EpochMs` (primitive obsession — see #2641 for the | ||
| * identity-bearing brand types that have landed) | ||
| * | ||
| * Brand types added in #2641 (type-only — runtime promotion chokepoints | ||
| * live in `@useatlas/chat` because adding value exports here would | ||
| * break the scaffold-CI gotcha until the package is republished): | ||
| * - `WorkspaceId` — Atlas org id (`organization.id` / `slack_installations.org_id`) | ||
| * - `AtlasUserId` — Atlas user id (`user.id`) | ||
| * - `ExternalUserId` — Slack/Teams/etc platform user id (Slack `U…`) | ||
| */ | ||
| /** | ||
| * Atlas workspace id (`organization.id`). | ||
| * | ||
| * Distinct nominal type from `AtlasUserId` and `ExternalUserId` even | ||
| * though all three are strings at runtime, so a transposed-arg call | ||
| * (`verifyWorkspace(asker.externalUserId)`) is a compile error. The | ||
| * single runtime chokepoint that promotes a bare string into a | ||
| * `WorkspaceId` is `assertWorkspaceId` from `@useatlas/chat` — every | ||
| * boundary (host adapter, SaaS config, default verifier) flows through | ||
| * it so an empty/malformed id fails fast instead of silently routing | ||
| * the asker to a "global" tenant. | ||
| */ | ||
| export type WorkspaceId = string & { | ||
| readonly __brand: "WorkspaceId"; | ||
| }; | ||
| /** | ||
| * Atlas user id (`user.id`). Carried by the linked branch of | ||
| * `ResolvedAsker`. Promoted via `assertAtlasUserId` from `@useatlas/chat`. | ||
| */ | ||
| export type AtlasUserId = string & { | ||
| readonly __brand: "AtlasUserId"; | ||
| }; | ||
| /** | ||
| * Platform-side user id from the chat adapter (Slack `U…`, Teams aad | ||
| * object id, etc.). Always paired with `platform` to disambiguate | ||
| * "U999 in Slack tenant A" vs "U999 in Slack tenant B"; tenant scoping | ||
| * itself is the `WorkspaceId` brand on the per-event resolver context. | ||
| * Promoted via `assertExternalUserId` from `@useatlas/chat`. | ||
| */ | ||
| export type ExternalUserId = string & { | ||
| readonly __brand: "ExternalUserId"; | ||
| }; | ||
| /** | ||
| * Channel-scoped pause layers (`channel_id IS NOT NULL`). | ||
@@ -97,5 +137,10 @@ * | ||
| * the payload. Deferred to a follow-up; see module header. | ||
| * | ||
| * `workspaceId` is branded {@link WorkspaceId} (#2641) — the plugin | ||
| * always emits a branded value (the listener promotes via | ||
| * `assertWorkspaceId` at the boundary), so consumers on the API side | ||
| * statically know the id came through the chokepoint. | ||
| */ | ||
| export interface ProactiveMeterEvent { | ||
| workspaceId: string; | ||
| workspaceId: WorkspaceId; | ||
| channelId: string; | ||
@@ -102,0 +147,0 @@ messageId?: string | null; |
+1
-1
| { | ||
| "name": "@useatlas/types", | ||
| "version": "0.1.3", | ||
| "version": "0.1.4", | ||
| "description": "Shared types for the Atlas text-to-SQL agent", | ||
@@ -5,0 +5,0 @@ "type": "module", |
204602
1.07%5183
0.92%