@collective-intelligence/ai 0.0.0-stage → 0.7.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.
- package/AGENTS.md +52 -0
- package/README.md +462 -2
- package/dist/api/access-check.d.ts +18 -0
- package/dist/api/answer-sources.d.ts +48 -0
- package/dist/api/attachments-api.d.ts +187 -0
- package/dist/api/catalog-api.d.ts +408 -0
- package/dist/api/chat-api.d.ts +2401 -0
- package/dist/api/chat-surface-api.d.ts +4186 -0
- package/dist/api/compaction.d.ts +52 -0
- package/dist/api/conversations.d.ts +107 -0
- package/dist/api/errors.d.ts +117 -0
- package/dist/api/feedback-api.d.ts +185 -0
- package/dist/api/files.d.ts +22 -0
- package/dist/api/ids.d.ts +33 -0
- package/dist/api/index.d.ts +21 -0
- package/dist/api/intents-api.d.ts +65 -0
- package/dist/api/place-context.d.ts +34 -0
- package/dist/api/projects-api.d.ts +718 -0
- package/dist/api/speech-api.d.ts +345 -0
- package/dist/api/transcript.d.ts +260 -0
- package/dist/api/turns.d.ts +196 -0
- package/dist/api.d.ts +21 -0
- package/dist/api.js +1 -0
- package/dist/domain/access.d.ts +29 -0
- package/dist/domain/context-trail.d.ts +65 -0
- package/dist/domain/data-parts.d.ts +247 -0
- package/dist/domain/errors.d.ts +28 -0
- package/dist/domain/index.d.ts +14 -0
- package/dist/domain/intents.d.ts +101 -0
- package/dist/domain/message.d.ts +173 -0
- package/dist/domain/place.d.ts +17 -0
- package/dist/domain/runtime-value.d.ts +16 -0
- package/dist/domain-50vzrrp9.js +2 -0
- package/dist/domain-5fpd4fte.js +1 -0
- package/dist/domain-9wzbv87n.js +2 -0
- package/dist/domain-g97xs965.js +2 -0
- package/dist/domain-hk3yw2m7.js +1 -0
- package/dist/domain-qyts6dgz.js +0 -0
- package/dist/domain-s07s1ry1.js +2 -0
- package/dist/domain.d.ts +14 -0
- package/dist/domain.js +1 -0
- package/dist/headless/access/access-store.d.ts +28 -0
- package/dist/headless/access/visibility.d.ts +24 -0
- package/dist/headless/blocked-state.d.ts +21 -0
- package/dist/headless/chat-registry.d.ts +63 -0
- package/dist/headless/chat-session-provider.d.ts +109 -0
- package/dist/headless/chat-surface.d.ts +4210 -0
- package/dist/headless/host-ports.d.ts +146 -0
- package/dist/headless/index.d.ts +33 -0
- package/dist/headless/intents/card-ends.d.ts +22 -0
- package/dist/headless/intents/intent-call.d.ts +28 -0
- package/dist/headless/intents/intents-provider.d.ts +108 -0
- package/dist/headless/intents/page-registry.d.ts +129 -0
- package/dist/headless/intents/use-intent-dispatch.d.ts +60 -0
- package/dist/headless/intents/use-intents.d.ts +11 -0
- package/dist/headless/intents/use-returned-intent-handle.d.ts +11 -0
- package/dist/headless/launch/chat-launch.d.ts +42 -0
- package/dist/headless/launch/launch-target.d.ts +25 -0
- package/dist/headless/launch/submit.d.ts +29 -0
- package/dist/headless/run-state.d.ts +16 -0
- package/dist/headless/sent-files.d.ts +20 -0
- package/dist/headless/server-started-turn-follow.proof.d.ts +26 -0
- package/dist/headless/session-machine.d.ts +745 -0
- package/dist/headless/trail/buffer.d.ts +48 -0
- package/dist/headless/trail/json-ld.d.ts +10 -0
- package/dist/headless/trail/switches.d.ts +10 -0
- package/dist/headless/trail/trail-provider.d.ts +53 -0
- package/dist/headless/transcript-messages.d.ts +26 -0
- package/dist/headless.d.ts +33 -0
- package/dist/headless.js +2 -0
- package/dist/transport/chat-client.d.ts +25 -0
- package/dist/transport/chat-transport.d.ts +57 -0
- package/dist/transport/index.d.ts +6 -0
- package/dist/transport/simulated-chat-transport.d.ts +39 -0
- package/dist/transport.d.ts +6 -0
- package/dist/transport.js +1 -0
- package/dist/views/assistant-sidebar/assistant-sidebar.d.ts +15 -0
- package/dist/views/assistant-sidebar/layout.d.ts +47 -0
- package/dist/views/assistant-sidebar/toggle.d.ts +14 -0
- package/dist/views/assistant-sidebar/use-shortcut.d.ts +11 -0
- package/dist/views/blocked/chat-blocked-state.d.ts +15 -0
- package/dist/views/chat-operations.d.ts +46 -0
- package/dist/views/chat-root.d.ts +14 -0
- package/dist/views/chat.d.ts +51 -0
- package/dist/views/composer/capability-picker.d.ts +77 -0
- package/dist/views/composer/capability-pickers.d.ts +24 -0
- package/dist/views/composer/chat-composer.d.ts +15 -0
- package/dist/views/composer/composer-picks.d.ts +31 -0
- package/dist/views/composer/composer-trail.d.ts +21 -0
- package/dist/views/composer/draft-attachments.d.ts +36 -0
- package/dist/views/composer/queued-messages.d.ts +9 -0
- package/dist/views/composer/send-menu.d.ts +11 -0
- package/dist/views/composer/slash-suggestions.d.ts +37 -0
- package/dist/views/composer/trail-chips.d.ts +15 -0
- package/dist/views/composer/voice-input/microphone.d.ts +14 -0
- package/dist/views/composer/voice-input/remote-transcription.d.ts +12 -0
- package/dist/views/composer/voice-input/use-voice-input.d.ts +30 -0
- package/dist/views/composer/voice-input/voice-input.d.ts +15 -0
- package/dist/views/dock/chat-dock.d.ts +57 -0
- package/dist/views/dock/dock-session.d.ts +22 -0
- package/dist/views/header/chat-header.d.ts +10 -0
- package/dist/views/header/compaction-controls.d.ts +17 -0
- package/dist/views/header/memory-switch.d.ts +16 -0
- package/dist/views/index.d.ts +58 -0
- package/dist/views/intents/form-fields.d.ts +38 -0
- package/dist/views/intents/intent-card.d.ts +61 -0
- package/dist/views/intents/intent-form.d.ts +23 -0
- package/dist/views/intents/intent-notices.d.ts +39 -0
- package/dist/views/intents/intent-trigger.d.ts +46 -0
- package/dist/views/intents/labels.d.ts +23 -0
- package/dist/views/labels/en.d.ts +3 -0
- package/dist/views/labels/index.d.ts +13 -0
- package/dist/views/labels/it.d.ts +3 -0
- package/dist/views/labels/types.d.ts +7 -0
- package/dist/views/launch/chat-launch-button.d.ts +21 -0
- package/dist/views/parts/answer-feedback.d.ts +26 -0
- package/dist/views/parts/evidence-part.d.ts +8 -0
- package/dist/views/parts/file-part.d.ts +8 -0
- package/dist/views/parts/image-generation-part.d.ts +9 -0
- package/dist/views/parts/image-generation.d.ts +84 -0
- package/dist/views/parts/intent-card-part.d.ts +8 -0
- package/dist/views/parts/memory-evidence-part.d.ts +7 -0
- package/dist/views/parts/message-parts.d.ts +21 -0
- package/dist/views/parts/question-part.d.ts +8 -0
- package/dist/views/parts/read-aloud.d.ts +23 -0
- package/dist/views/parts/reasoning-part.d.ts +8 -0
- package/dist/views/parts/steering-message-part.d.ts +7 -0
- package/dist/views/parts/text-part.d.ts +4 -0
- package/dist/views/parts/tool-part.d.ts +11 -0
- package/dist/views/parts/types.d.ts +103 -0
- package/dist/views/parts/use-read-aloud.d.ts +13 -0
- package/dist/views/run-trace/message-run.d.ts +17 -0
- package/dist/views/run-trace/run-stream.d.ts +128 -0
- package/dist/views/run-trace/run-trace-parts.d.ts +26 -0
- package/dist/views/run-trace/run-trace.d.ts +31 -0
- package/dist/views/sidebar/conversation-dialogs.d.ts +38 -0
- package/dist/views/sidebar/conversation-row.d.ts +23 -0
- package/dist/views/sidebar/conversation-sidebar.d.ts +10 -0
- package/dist/views/sidebar/date-groups.d.ts +12 -0
- package/dist/views/sidebar/history-filter.d.ts +57 -0
- package/dist/views/sidebar/projects/project-dialogs.d.ts +40 -0
- package/dist/views/sidebar/projects/project-files.d.ts +16 -0
- package/dist/views/sidebar/projects/project-groups.d.ts +19 -0
- package/dist/views/sidebar/projects/project-view.d.ts +21 -0
- package/dist/views/sidebar/projects/projects-section.d.ts +21 -0
- package/dist/views/sidebar/projects/use-chat-projects.d.ts +32 -0
- package/dist/views/slots.d.ts +148 -0
- package/dist/views/transcript/chat-transcript.d.ts +13 -0
- package/dist/views/transcript/sent-trail.d.ts +13 -0
- package/dist/views/transcript/use-image-reload.d.ts +16 -0
- package/dist/views.d.ts +58 -0
- package/dist/views.js +3 -0
- package/docs/guide/ai/index.md +377 -0
- package/docs/guide/ai/studio.md +245 -0
- package/docs/guide/data/connectors.md +267 -0
- package/docs/guide/data/datasets.md +145 -0
- package/docs/guide/data/documents.md +235 -0
- package/docs/guide/data/index.md +62 -0
- package/docs/guide/data/knowledge.md +214 -0
- package/docs/guide/develop/extensions.md +299 -0
- package/docs/guide/develop/external-apps.md +279 -0
- package/docs/guide/develop/infrastructure.md +135 -0
- package/docs/guide/develop/sdks.md +233 -0
- package/docs/guide/index.md +83 -0
- package/docs/guide/platform/access.md +311 -0
- package/docs/guide/platform/architecture.md +166 -0
- package/docs/guide/platform/built-ins.md +225 -0
- package/docs/guide/platform/entrypoints.md +318 -0
- package/docs/guide/scenarios/index.md +130 -0
- package/docs/guide/template/index.md +295 -0
- package/docs/guide/template/state-machines.md +294 -0
- package/package.json +123 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AccessCheckPort } from "../../api/index.js";
|
|
2
|
+
import type { AccessCheckAnswer, AccessTarget } from "../../domain/index.js";
|
|
3
|
+
/** What the Visibility Gate knows of a target: its answer, or `loading` until the first answer. */
|
|
4
|
+
export type Visibility = AccessCheckAnswer | "loading";
|
|
5
|
+
/** The answers of one `access` port for one caller, and the gates that watch them. */
|
|
6
|
+
export interface AccessStore {
|
|
7
|
+
/** Asks again for every watched target; each answer stays until the new one arrives. */
|
|
8
|
+
readonly recheck: () => void;
|
|
9
|
+
readonly visibility: (target: AccessTarget) => Visibility;
|
|
10
|
+
/** Watches `target` until the returned stop; a target with no answer, or a stale one, goes in the next batch. */
|
|
11
|
+
readonly watch: (target: AccessTarget, onChange: () => void) => () => void;
|
|
12
|
+
}
|
|
13
|
+
/** The same key for the same target, whatever the order or the extra fields of the object. */
|
|
14
|
+
export declare const accessKey: (target: AccessTarget) => string;
|
|
15
|
+
/**
|
|
16
|
+
* The store of `port` for the caller of `cacheScope`, made once: another
|
|
17
|
+
* caller never reads the answers of the caller before, and a new port starts
|
|
18
|
+
* with no answers.
|
|
19
|
+
*/
|
|
20
|
+
export declare const accessStoreFor: (port: AccessCheckPort, cacheScope: string) => AccessStore;
|
|
21
|
+
/**
|
|
22
|
+
* Makes every Visibility Gate that watches a target through `port` ask
|
|
23
|
+
* again, for each caller, without a new port: each gate keeps its answer
|
|
24
|
+
* until the new answer arrives, and a target whose check runs goes again
|
|
25
|
+
* once its answer lands. Call it when the host learns that access changed,
|
|
26
|
+
* such as on a new Studio Access Snapshot ETag.
|
|
27
|
+
*/
|
|
28
|
+
export declare const recheckAccess: (port: AccessCheckPort) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { AccessTarget } from "../../domain/index.js";
|
|
3
|
+
import type { Visibility } from "./access-store.js";
|
|
4
|
+
/**
|
|
5
|
+
* Tells whether the current user may use `target`: `loading` until the first
|
|
6
|
+
* answer, then `allowed` or `denied`. The targets of one render go to the
|
|
7
|
+
* `access` port of `IntentsProvider` in one Access Check; an answer stays until a newer
|
|
8
|
+
* Access Version shows in an answer or the tab gets focus again. Without an
|
|
9
|
+
* `access` port, or when the check fails, the answer is `denied`. It is a
|
|
10
|
+
* display hint only: the backend checks every call.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useVisibility: (target: AccessTarget) => Visibility;
|
|
13
|
+
export interface VisibilityGateProps {
|
|
14
|
+
readonly children?: ReactNode;
|
|
15
|
+
/** What renders when the answer is `denied`; nothing without it. */
|
|
16
|
+
readonly fallback?: ReactNode;
|
|
17
|
+
readonly target: AccessTarget;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders `children` only when the current user may use `target` (see
|
|
21
|
+
* {@link useVisibility}): nothing while the answer loads, and `fallback`
|
|
22
|
+
* when it is `denied`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const VisibilityGate: ({ children, fallback, target }: VisibilityGateProps) => ReactNode;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AiError } from "../domain/index.js";
|
|
2
|
+
/** The four reasons why the chat cannot run for this user here (AC-207, Q37). */
|
|
3
|
+
export declare const chatBlockedKinds: readonly ["sign_in_to_chat", "chat_not_available", "app_not_available", "service_not_available"];
|
|
4
|
+
export type ChatBlockedKind = (typeof chatBlockedKinds)[number];
|
|
5
|
+
/** A blocked chat, with the failure that blocked it. */
|
|
6
|
+
export type ChatBlockedState = Readonly<{
|
|
7
|
+
error: AiError;
|
|
8
|
+
kind: ChatBlockedKind;
|
|
9
|
+
}>;
|
|
10
|
+
/** Which chat read failed: one of the first reads when the chat starts, or a later one. */
|
|
11
|
+
export type ChatRead = "first" | "later";
|
|
12
|
+
/**
|
|
13
|
+
* The blocked state that a chat failure means, or `null` when the failure
|
|
14
|
+
* does not block the chat (D16):
|
|
15
|
+
* - `unauthenticated` blocks with `sign_in_to_chat`;
|
|
16
|
+
* - `forbidden` with reason `capability_missing` blocks with `chat_not_available`;
|
|
17
|
+
* - `forbidden` with reason `app_disabled` blocks with `app_not_available`;
|
|
18
|
+
* - `unavailable` or `internal` on a first read, after its retries, blocks
|
|
19
|
+
* with `service_not_available`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const chatBlockedState: (error: AiError, read: ChatRead) => ChatBlockedState | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Chat } from "@ai-sdk/react";
|
|
2
|
+
import type { ConversationId } from "../api/index.js";
|
|
3
|
+
import type { AiError, CiUIMessage, RunStatus } from "../domain/index.js";
|
|
4
|
+
import type { CiChatTransport } from "../transport/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* How the stream of one chat request ended:
|
|
7
|
+
* - `ended`: the server ended the answer with `finish`: the turn reached its
|
|
8
|
+
* terminal state, or it waits for the user's approval or answer;
|
|
9
|
+
* - `cut`: the stream closed before the turn ended, with no `finish` or with
|
|
10
|
+
* `finishReason: "interrupted"`, as for a turn that is `paused`,
|
|
11
|
+
* `reconciliation_required` or `waiting_for_input`;
|
|
12
|
+
* - `disconnected`: the network dropped the stream;
|
|
13
|
+
* - `stopped`: the chat stopped it;
|
|
14
|
+
* - `failed`: the request or the stream failed.
|
|
15
|
+
*/
|
|
16
|
+
export type TurnStreamEnd = "cut" | "disconnected" | "ended" | "failed" | "stopped";
|
|
17
|
+
/** What a chat of the registry tells the session machine. */
|
|
18
|
+
export type ChatRegistryEvent = Readonly<{
|
|
19
|
+
conversationId: ConversationId;
|
|
20
|
+
/** The turn that the stream's `start` names in its message metadata. */
|
|
21
|
+
invocationId: string;
|
|
22
|
+
type: "chat.turn_named";
|
|
23
|
+
}> | Readonly<{
|
|
24
|
+
conversationId: ConversationId;
|
|
25
|
+
runStatus: RunStatus;
|
|
26
|
+
type: "chat.run_status";
|
|
27
|
+
}> | Readonly<{
|
|
28
|
+
conversationId: ConversationId;
|
|
29
|
+
end: TurnStreamEnd;
|
|
30
|
+
type: "chat.finished";
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
conversationId: ConversationId;
|
|
33
|
+
/**
|
|
34
|
+
* The network dropped the request or its stream (a fetch `TypeError`,
|
|
35
|
+
* no HTTP status), so the server may have taken it: the stream ends
|
|
36
|
+
* `disconnected` and the chat resumes the turn.
|
|
37
|
+
*/
|
|
38
|
+
dropped: boolean;
|
|
39
|
+
error: AiError;
|
|
40
|
+
type: "chat.failed";
|
|
41
|
+
}>;
|
|
42
|
+
/** The AI SDK chats of one Chat Session, one per Conversation (AC-378). */
|
|
43
|
+
export interface ChatRegistry {
|
|
44
|
+
/**
|
|
45
|
+
* The chat of a Conversation, made on first use; `null` gives the chat of
|
|
46
|
+
* a new chat, which shows no message and never sends: its first message
|
|
47
|
+
* creates the Conversation and goes through that Conversation's chat.
|
|
48
|
+
*/
|
|
49
|
+
readonly chat: (conversationId: ConversationId | null) => Chat<CiUIMessage>;
|
|
50
|
+
/** Stops every chat and drops it; a later `chat` makes a new one. */
|
|
51
|
+
readonly dispose: () => void;
|
|
52
|
+
/** Calls `listener` on each event of every chat; returns the function that stops it. */
|
|
53
|
+
readonly subscribe: (listener: (event: ChatRegistryEvent) => void) => () => void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The chat registry (ARC-032): one AI SDK `Chat` per Conversation id, with
|
|
57
|
+
* the CI schemas and `sendAutomaticallyWhen:
|
|
58
|
+
* lastAssistantMessageIsCompleteWithApprovalResponses` (AC-373), and no
|
|
59
|
+
* experimental client queue (AC-380). Each chat tells its listeners the
|
|
60
|
+
* turn that each stream names, the `data-run-status` parts, how each
|
|
61
|
+
* stream ended and each failure.
|
|
62
|
+
*/
|
|
63
|
+
export declare const makeChatRegistry: (transport: CiChatTransport) => ChatRegistry;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { UseChatHelpers } from "@ai-sdk/react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import type { ChatSurfaceClient, Conversation, ConversationId, ConversationSubject, PlaceContext, QueuedMessage, QueuedMessageId } from "../api/index.js";
|
|
5
|
+
import type { AiError, AiResult, CiUIMessage, Place } from "../domain/index.js";
|
|
6
|
+
import type { CiChatTransport } from "../transport/index.js";
|
|
7
|
+
import type { ChatBlockedState } from "./blocked-state.js";
|
|
8
|
+
import type { ChatSurfaceOptions } from "./chat-surface.js";
|
|
9
|
+
import type { AiHostPorts, ChatControls } from "./host-ports.js";
|
|
10
|
+
import type { ChatCapability, ChatSubmit, NewChat } from "./session-machine.js";
|
|
11
|
+
export type ChatSessionProviderProps = Readonly<{
|
|
12
|
+
/** The mount that the typed `ChatSurfaceApi` client calls: the base URL of `transport`, and its fetch or client transform. */
|
|
13
|
+
api: ChatSurfaceOptions;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/** Narrows the History Scope of the Conversation list to these Places. */
|
|
16
|
+
historyScope?: readonly Place[];
|
|
17
|
+
/** The host ports; a missing port hides its control. */
|
|
18
|
+
host?: AiHostPorts;
|
|
19
|
+
/** The Place where the chat runs. */
|
|
20
|
+
place: Place;
|
|
21
|
+
/**
|
|
22
|
+
* The draft that the session works on: the list holds only its
|
|
23
|
+
* Conversations, and the session opens the latest one when the host
|
|
24
|
+
* stores no open Conversation.
|
|
25
|
+
*/
|
|
26
|
+
subject?: ConversationSubject;
|
|
27
|
+
/** The chat transport, for example `createChatTransport` of the same mount. */
|
|
28
|
+
transport: CiChatTransport;
|
|
29
|
+
}>;
|
|
30
|
+
/** Where the Chat Session is: its first reads, blocked, open, or opening a Conversation. */
|
|
31
|
+
export type ChatSessionStatus = "blocked" | "ready" | "starting" | "switching";
|
|
32
|
+
/**
|
|
33
|
+
* What Send does in the open Conversation (AC-380): `idle` sends a message
|
|
34
|
+
* that starts a turn; `running` sends a Steering Message to the running
|
|
35
|
+
* answer, and `queue` makes a Queued Message that runs after it.
|
|
36
|
+
*/
|
|
37
|
+
export type ChatSendMode = "idle" | "running";
|
|
38
|
+
/** The Chat Session of the provider, and what the user can do in it. */
|
|
39
|
+
export type ChatSession = Readonly<{
|
|
40
|
+
/** Set when the chat cannot run for this user here (AC-207); show it instead of the chat. */
|
|
41
|
+
blocked: ChatBlockedState | null;
|
|
42
|
+
/**
|
|
43
|
+
* `true` while a send, a Stop or a queue change is on its way: Send and
|
|
44
|
+
* `queue` take no message until it has gone, and the draft stays open to
|
|
45
|
+
* typing.
|
|
46
|
+
*/
|
|
47
|
+
busy: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Runs one operation of the typed `ChatSurfaceApi` client (AC-290), such
|
|
50
|
+
* as a rename, a Project or a speech operation; every failure is an
|
|
51
|
+
* `AiError`.
|
|
52
|
+
*/
|
|
53
|
+
call: <A, E>(operation: (client: ChatSurfaceClient) => Effect.Effect<A, E>) => Promise<AiResult<A>>;
|
|
54
|
+
/** The skills and tools chosen for the turns of the open Conversation. */
|
|
55
|
+
capabilities: readonly ChatCapability[];
|
|
56
|
+
controls: ChatControls;
|
|
57
|
+
/** The open Conversation; `null` for a new chat. */
|
|
58
|
+
conversationId: ConversationId | null;
|
|
59
|
+
conversations: readonly Conversation[];
|
|
60
|
+
draft: string;
|
|
61
|
+
/** The last failure that does not block the chat. */
|
|
62
|
+
failure: AiError | null;
|
|
63
|
+
/** Opens a new chat, with its Agent or its Project. */
|
|
64
|
+
newChat: (options?: NewChat) => void;
|
|
65
|
+
place: Place;
|
|
66
|
+
/** The place context, read once when the chat starts (AC-277). */
|
|
67
|
+
placeContext: PlaceContext | null;
|
|
68
|
+
/** "Send after this answer": a Queued Message, or a turn when no answer runs. */
|
|
69
|
+
queue: (text: string) => void;
|
|
70
|
+
/** The Queued Messages of the open Conversation, as the server lists them (AC-301). */
|
|
71
|
+
queuedMessages: readonly QueuedMessage[];
|
|
72
|
+
/**
|
|
73
|
+
* Reads the messages of the open Conversation again from its transcript,
|
|
74
|
+
* for example while an answer waits for a generated image; the messages
|
|
75
|
+
* of a streaming answer stay as they are.
|
|
76
|
+
*/
|
|
77
|
+
readMessages: () => void;
|
|
78
|
+
/** Reads the Conversation list again, for example after a rename. */
|
|
79
|
+
reloadConversations: () => void;
|
|
80
|
+
removeQueuedMessage: (queuedMessageId: QueuedMessageId, revision: number) => void;
|
|
81
|
+
/** Starts the chat again after it was blocked, or reads its lists again. */
|
|
82
|
+
retry: () => void;
|
|
83
|
+
selectConversation: (conversationId: ConversationId) => void;
|
|
84
|
+
sendMode: ChatSendMode;
|
|
85
|
+
setCapabilities: (capabilities: readonly ChatCapability[]) => void;
|
|
86
|
+
setDraft: (text: string) => void;
|
|
87
|
+
status: ChatSessionStatus;
|
|
88
|
+
/** Stops the running answer. */
|
|
89
|
+
stop: () => void;
|
|
90
|
+
/** Send: starts a turn, or steers the running answer (`sendMode`). */
|
|
91
|
+
submit: (submit: ChatSubmit) => void;
|
|
92
|
+
updateQueuedMessage: (queuedMessageId: QueuedMessageId, content: string, revision: number) => void;
|
|
93
|
+
}>;
|
|
94
|
+
/** The Chat Session of the nearest `ChatSessionProvider` (AC-198). */
|
|
95
|
+
export declare const useChatSession: () => ChatSession;
|
|
96
|
+
/**
|
|
97
|
+
* The AI SDK chat of the open Conversation (AC-379): `useChat({ chat })`
|
|
98
|
+
* over the session's chat registry. It owns the messages, the streaming
|
|
99
|
+
* status and the tool approvals; send through `useChatSession().submit`,
|
|
100
|
+
* which applies the steer-or-queue policy.
|
|
101
|
+
*/
|
|
102
|
+
export declare const useCiChat: () => UseChatHelpers<CiUIMessage>;
|
|
103
|
+
/**
|
|
104
|
+
* Runs one Chat Session for its tree (AC-379): the session machine over
|
|
105
|
+
* `transport` and the host ports, with one typed `ChatSurfaceApi` client
|
|
106
|
+
* on `api`. The session reads its props once: give the provider a `key`
|
|
107
|
+
* that changes with the Place to start a new session there.
|
|
108
|
+
*/
|
|
109
|
+
export declare const ChatSessionProvider: ({ api, children, historyScope, host, place, subject, transport }: ChatSessionProviderProps) => import("react").JSX.Element;
|