@athenaintel/react 0.10.41 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,8 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { Toolkit } from '@assistant-ui/react';
3
3
  import { type AthenaEnvironment } from '../lib/athena-urls';
4
+ import { type AthenaDiagnosticEvent, type AthenaDiagnosticLevel, type AthenaDiagnosticsConfig } from '../diagnostics/athena-diagnostics';
5
+ import type { AthenaSdkError } from '../diagnostics/errors';
4
6
  import { type AthenaTransport } from '../runtime/transport';
5
7
  import type { AthenaProviderConfig } from './config';
6
8
  import type { AthenaCitationLinkOptions, AthenaLinkClickOptions } from './citation-links';
@@ -15,8 +17,24 @@ export interface AthenaProviderProps {
15
17
  /** @deprecated Prefer `config.token`. PropelAuth token. If provided, takes priority over apiKey. If omitted, the SDK
16
18
  * will automatically listen for a token from the parent window via PostMessage. */
17
19
  token?: string | null;
18
- /** Agent name to use. Defaults to 'athena_assist_agent'. */
20
+ /** Agent selector.
21
+ *
22
+ * - `legacy` transport: any agent name (defaults to 'athena_assist_agent'),
23
+ * including `collab_agent:<asset_id>` refs.
24
+ * - `statewire` transport: only `collab_agent:<asset_id>` refs apply — the
25
+ * thread then runs AS that published collab agent (its prompt, tools, and
26
+ * model default), and the caller must have view access to the agent
27
+ * asset. Any other value is ignored with a `sdk.config.warning`
28
+ * diagnostic, because the statewire host always runs the Athena deep
29
+ * agent. */
19
30
  agent?: string;
31
+ /** Collab-agent channel id — a built-in channel (`email`, `sms`, …) or a
32
+ * user-defined custom channel id from the agent's Channels tab. Selects
33
+ * that channel's configuration overrides and stamps the session's origin.
34
+ * Only meaningful with a `collab_agent:<asset_id>` `agent` on the
35
+ * `statewire` transport; sent as `collab_channel_id`. An unknown or
36
+ * disabled channel rejects the run with a structured, teaching error. */
37
+ channel?: string;
20
38
  /** LLM model identifier. Defaults to 'claude-opus-4-6-thinking-max-fast'. */
21
39
  model?: string;
22
40
  /** Backend toolkit IDs to enable (e.g. 'document_toolkit', 'web_search_browse_toolkit'). */
@@ -105,5 +123,23 @@ export interface AthenaProviderProps {
105
123
  /** PostHog analytics configuration. When omitted or keys are missing, PostHog is silently disabled.
106
124
  * Prefer `config.posthog` for structured configuration. */
107
125
  posthog?: PostHogConfig;
126
+ /** SDK diagnostics.
127
+ *
128
+ * - `true` / a level: echo structured `[AthenaSDK]` events to the console
129
+ * at that level (`true` = 'debug').
130
+ * - An object: full diagnostics config (console level, PostHog timing
131
+ * forwarding, buffer size).
132
+ *
133
+ * Independent of the prop, `localStorage.setItem('athena:debug','debug')`
134
+ * (or `window.__ATHENA_SDK__.diagnostics.enableConsole()`) turns console
135
+ * echo on at runtime without a rebuild. Errors log once even when off. */
136
+ debug?: boolean | AthenaDiagnosticLevel | Partial<AthenaDiagnosticsConfig>;
137
+ /** Receives every diagnostics event (timings, warnings, errors) — the hook
138
+ * for shipping SDK telemetry to the host app's own pipeline. */
139
+ onDiagnostic?: (event: AthenaDiagnosticEvent) => void;
140
+ /** Receives every SDK error as a typed `AthenaSdkError` (stable `code`,
141
+ * `hint`, structured server `detail`). Fires in addition to the UI's own
142
+ * error handling, so integrations never fail silently. */
143
+ onError?: (error: AthenaSdkError, event: AthenaDiagnosticEvent) => void;
108
144
  }
109
- export declare function AthenaProvider({ children, config, apiKey, token: tokenProp, agent, model, tools, frontendTools, disableAutoOpen, apiUrl, backendUrl, appUrl, environment, transport, statewireSyncUrl, getToken, extraRunConfig, workbench, knowledgeBase, systemPrompt, customToolConfigs, appId, threadId: threadIdProp, enableThreadList, theme, linkClicks, citationLinks, posthog: posthogProp, }: AthenaProviderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
145
+ export declare function AthenaProvider({ children, config, apiKey, token: tokenProp, agent, channel, model, tools, frontendTools, disableAutoOpen, apiUrl, backendUrl, appUrl, environment, transport, statewireSyncUrl, getToken, extraRunConfig, workbench, knowledgeBase, systemPrompt, customToolConfigs, appId, threadId: threadIdProp, enableThreadList, theme, linkClicks, citationLinks, posthog: posthogProp, debug, onDiagnostic, onError, }: AthenaProviderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
@@ -1,9 +1,24 @@
1
1
  /** Deep-agent default model — matches the Olympus and mobile statewire hosts.
2
2
  * The legacy transport keeps its own default model. */
3
3
  export declare const DEFAULT_STATEWIRE_MODEL = "claude-sonnet-5";
4
+ /** Agent-id namespace for collab agents (`collab_agent:<asset_id>`). */
5
+ export declare const COLLAB_AGENT_REF_PREFIX = "collab_agent:";
6
+ /** The asset id when `agent` is a `collab_agent:<asset_id>` ref, else null. */
7
+ export declare function parseCollabAgentRef(agent: string | undefined | null): string | null;
4
8
  export interface StatewireRunConfigOptions {
5
- /** LLM model identifier. Defaults to the deep-agent default model. */
9
+ /** LLM model identifier. Defaults to the deep-agent default model — unless a
10
+ * collab agent is selected and its author set one (the backend overlay
11
+ * applies the agent's model when the run sends none), in which case no
12
+ * model is sent so the agent's choice wins. */
6
13
  model?: string;
14
+ /** Agent selector. On statewire only the `collab_agent:<asset_id>` namespace
15
+ * is meaningful: the run executes AS that published collab agent (prompt,
16
+ * tools, model default). Any other value is ignored by the host. */
17
+ agent?: string;
18
+ /** Collab-agent channel id (built-in like `email`/`sms`, or a user-defined
19
+ * custom channel id) selecting that channel's configuration overrides.
20
+ * Sent as `collab_channel_id`; only meaningful with a collab `agent`. */
21
+ channel?: string;
7
22
  /** Backend toolkit IDs to enable. */
8
23
  tools?: string[];
9
24
  /** Frontend tool IDs to include in enabled_tools. */
@@ -19,6 +19,11 @@ export interface AthenaStatewireRuntimeConfig {
19
19
  getToken?: () => string | null | Promise<string | null>;
20
20
  /** LLM model identifier. Defaults to the deep-agent default model. */
21
21
  model?: string;
22
+ /** Agent selector: only `collab_agent:<asset_id>` refs are meaningful here
23
+ * (the run executes AS that published collab agent). Other values warn. */
24
+ agent?: string;
25
+ /** Collab-agent channel id selecting that channel's overrides. */
26
+ channel?: string;
22
27
  /** Backend toolkit IDs to enable. */
23
28
  tools?: string[];
24
29
  /** Frontend tool IDs to include in enabled_tools. */
@@ -24,7 +24,24 @@ export declare function ExpandableSection({ label, children, defaultOpen, }: {
24
24
  }): import("react/jsx-runtime").JSX.Element;
25
25
  export declare const WebSearchToolUI: ToolCallMessagePartComponent;
26
26
  export declare const BrowseToolUI: ToolCallMessagePartComponent;
27
+ /** Short human date for an email row: "Aug 24" this year, "Aug 24, 2025"
28
+ * otherwise, time-of-day for today. Unparseable input passes through. */
29
+ export declare function formatEmailDate(raw: string | undefined): string | undefined;
30
+ /** Turn a raw search query ("received:2026-08-24..2026-08-26 from:kim budget")
31
+ * into a readable phrase ("Aug 24 – Aug 26 · from kim · “budget”"). */
32
+ export declare function humanizeEmailQuery(query: string): string;
27
33
  export declare const EmailSearchToolUI: ToolCallMessagePartComponent;
34
+ interface EmailAccount {
35
+ address?: string;
36
+ provider?: string;
37
+ name?: string;
38
+ isDefault?: boolean;
39
+ }
40
+ /** Lenient decode of the unified `list accounts` payload
41
+ * (`{accounts: [{email_address, provider, account_name, is_default}]}`,
42
+ * with older field spellings tolerated). */
43
+ export declare function parseEmailAccounts(data: Record<string, unknown>): EmailAccount[];
44
+ export declare const EmailAccountsToolUI: ToolCallMessagePartComponent;
28
45
  export declare function resetAssetAutoOpen(): void;
29
46
  export declare const CreateDocumentToolUI: ToolCallMessagePartComponent;
30
47
  export declare const CreateSheetToolUI: ToolCallMessagePartComponent;
@@ -68,3 +85,4 @@ export declare const CaptureMomentToolUI: ToolCallMessagePartComponent;
68
85
  export declare const CaptureSlideScreenshotToolUI: ToolCallMessagePartComponent;
69
86
  export declare const OpenBrowserToolUI: ToolCallMessagePartComponent;
70
87
  export declare const TOOL_UI_REGISTRY: Record<string, ToolCallMessagePartComponent>;
88
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The SDK's own version, inlined at build time. Surfaced in diagnostics, on
3
+ * `window.__ATHENA_SDK__.version`, and available to consumers so a host app
4
+ * can show "what SDK am I running" without reading node_modules.
5
+ */
6
+ export declare const ATHENA_REACT_SDK_VERSION: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenaintel/react",
3
- "version": "0.10.41",
3
+ "version": "0.11.1",
4
4
  "description": "Athena React SDK — Build AI-powered chat applications with the Athena platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -49,7 +49,7 @@
49
49
  "@assistant-ui/core": "0.3.15",
50
50
  "@assistant-ui/react": "0.15.16",
51
51
  "@assistant-ui/react-langgraph": "0.14.24",
52
- "@assistant-ui/react-statewire": "^0.18.0",
52
+ "@assistant-ui/react-statewire": "^0.22.0",
53
53
  "@assistant-ui/tap": "0.9.14",
54
54
  "@floating-ui/react": "^0.27.7",
55
55
  "@tanstack/react-query": "5.99.2",
@@ -70,7 +70,7 @@
70
70
  "cnfast": "0.0.8",
71
71
  "lucide-react": "^0.575.0",
72
72
  "radix-ui": "^1.4.3",
73
- "statewire": "^0.10.0",
73
+ "statewire": "^0.13.0",
74
74
  "tiptap-markdown": "^0.9.0",
75
75
  "zod": "^3.24.0",
76
76
  "zustand": "^5.0.11"