@ai-matrx/chat 0.4.2 → 0.4.7
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/CHANGELOG.md +54 -0
- package/dist/agent-copy/RichCopySplit.d.ts +17 -0
- package/dist/agent-copy/RichCopySplit.js +34 -0
- package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.js +1 -1
- package/dist/agents/components/chat/ConversationRecordsChip.js +1 -1
- package/dist/agents/components/context-items/bodies/WorkingDocumentBody.d.ts +5 -2
- package/dist/agents/components/context-items/bodies/WorkingDocumentBody.js +6 -1
- package/dist/agents/components/context-policies-display/ContextValueBody.js +1 -1
- package/dist/agents/components/context-preview/ContextCompareView.js +1 -1
- package/dist/agents/components/custom-agent/CustomAgentWindow.js +1 -1
- package/dist/agents/components/inputs/smart-input/AgentTextarea.d.ts +6 -1
- package/dist/agents/components/inputs/smart-input/AgentTextarea.js +2 -2
- package/dist/agents/components/inputs/smart-input/ComposerToolsNotice.d.ts +1 -0
- package/dist/agents/components/inputs/smart-input/ComposerToolsNotice.js +5 -0
- package/dist/agents/components/inputs/smart-input/ConversationContextRail.d.ts +5 -1
- package/dist/agents/components/inputs/smart-input/ConversationContextRail.js +6 -1
- package/dist/agents/components/inputs/smart-input/InboxQueueStrip.d.ts +6 -1
- package/dist/agents/components/inputs/smart-input/InboxQueueStrip.js +6 -1
- package/dist/agents/components/inputs/smart-input/InputActionButtons.js +8 -6
- package/dist/agents/components/inputs/smart-input/SmartInputFileDropTarget.d.ts +5 -1
- package/dist/agents/components/inputs/smart-input/SmartInputFileDropTarget.js +8 -1
- package/dist/agents/components/inputs/smart-input/composer/ComposerAgentPill.js +2 -2
- package/dist/agents/components/inputs/smart-input/composer/ComposerChipsRow.d.ts +5 -2
- package/dist/agents/components/inputs/smart-input/composer/ComposerChipsRow.js +6 -1
- package/dist/agents/components/inputs/smart-input/composer/ComposerMetaRow.d.ts +6 -8
- package/dist/agents/components/inputs/smart-input/composer/ComposerMetaRow.js +13 -1
- package/dist/agents/components/inputs/smart-input/composer/useOutputShapeCatalog.d.ts +1 -1
- package/dist/agents/components/inputs/smart-input/composer/useOutputShapeCatalog.js +1 -1
- package/dist/agents/components/live-run/LiveRunDisplay.js +1 -1
- package/dist/agents/components/live-run/RunSetDisplay.js +1 -1
- package/dist/agents/components/memory/components/AgentMemoryAllView.js +1 -1
- package/dist/agents/components/messages-display/assistant/AgentAssistantMessage.d.ts +1 -0
- package/dist/agents/components/messages-display/assistant/AgentAssistantMessage.js +4 -3
- package/dist/agents/components/messages-display/assistant/AgentEmptyMessageDisplay.js +1 -1
- package/dist/agents/components/messages-display/assistant/AssistantMessageFooter.d.ts +2 -2
- package/dist/agents/components/messages-display/assistant/AssistantMessageFooter.js +4 -7
- package/dist/agents/components/messages-display/assistant/InPlaceAnswerEditor.js +2 -2
- package/dist/agents/components/messages-display/citations/MessageSourcesRow.js +1 -1
- package/dist/agents/components/messages-display/rich-document/chat-message-source.d.ts +2 -0
- package/dist/agents/components/messages-display/rich-document/chat-message-source.js +41 -0
- package/dist/agents/components/messages-display/rich-document/chatMessageActions.d.ts +31 -0
- package/dist/agents/components/messages-display/rich-document/chatMessageActions.js +39 -0
- package/dist/agents/components/messages-display/user/AgentUserMessage.d.ts +1 -0
- package/dist/agents/components/messages-display/user/AgentUserMessage.js +7 -4
- package/dist/agents/components/messages-display/user/CollabNoteMessage.js +1 -1
- package/dist/agents/components/messages-display/user/UserActionBar.js +49 -39
- package/dist/agents/components/working-document/WorkingDocumentEditor.d.ts +1 -1
- package/dist/agents/components/working-document/WorkingDocumentPanel.js +2 -1
- package/dist/agents/identity/run-tier-store.js +3 -0
- package/dist/agents/redux/agent-definition/cache-bust-middleware.js +2 -0
- package/dist/agents/redux/agent-settings/agentSettingsSlice.d.ts +0 -4
- package/dist/agents/redux/agent-settings/agentSettingsSlice.js +12 -5
- package/dist/agents/redux/execution-system/host-conversations/host-conversation.thunks.d.ts +4 -1
- package/dist/agents/redux/execution-system/host-conversations/host-conversation.thunks.js +45 -0
- package/dist/agents/redux/execution-system/inbox/inbox-turn-end.middleware.js +2 -1
- package/dist/agents/redux/execution-system/instance-ui-state/run-configuration-persist.js +2 -0
- package/dist/agents/redux/execution-system/messages/messages.selectors.js +1 -1
- package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +6 -0
- package/dist/agents/redux/execution-system/thunks/process-stream.js +1 -1
- package/dist/agents/redux/execution-system/utils/assemble-cx-content-blocks.js +2 -1
- package/dist/agents/redux/execution-system/utils/inbound-render-block.d.ts +8 -0
- package/dist/agents/redux/execution-system/utils/inbound-render-block.js +17 -2
- package/dist/agents/redux/execution-system/utils/normalize-content-blocks.js +1 -1
- package/dist/agents/redux/execution-system/utils/progress-data-block.d.ts +11 -0
- package/dist/agents/redux/execution-system/utils/progress-data-block.js +37 -0
- package/dist/agents/redux/execution-system/utils/stream-block-accumulator.js +10 -8
- package/dist/agents/redux/mcp/mcp.slice.js +15 -7
- package/dist/agents/redux/tools/tools.thunks.js +3 -0
- package/dist/agents/runtime-reconnect/ServerOperationBanner.d.ts +6 -1
- package/dist/agents/runtime-reconnect/ServerOperationBanner.js +6 -1
- package/dist/agents/ui-first-tools/ui/ApprovalCard.js +1 -1
- package/dist/agents/ui-first-tools/ui/AskCard.js +1 -1
- package/dist/agents/ui-first-tools/ui/lists/TaskPanel.js +1 -1
- package/dist/conversation/hooks/useDomCapturePrint.js +1 -1
- package/dist/conversation/utils/markdown-print.js +1 -1
- package/dist/cx-chat/components/messages/AssistantMessage.js +3 -5
- package/dist/cx-conversation/AssistantMessage.js +3 -5
- package/dist/host/app-data-slots.d.ts +85 -0
- package/dist/host/app-data-slots.js +42 -0
- package/dist/host/bare-host-chrome.js +1 -0
- package/dist/host/defaults/prefs.d.ts +11 -0
- package/dist/host/defaults/prefs.js +43 -0
- package/dist/host/defaults/workspace-gate.js +2 -1
- package/dist/host/index.d.ts +1 -1
- package/dist/host/index.js +2 -1
- package/dist/host/react.js +16 -1
- package/dist/host/source.d.ts +21 -0
- package/dist/host/ui-slots.d.ts +1 -23
- package/dist/host/ui-slots.js +0 -34
- package/dist/public-chat/components/PublicMessageOptionsMenu.js +2 -1
- package/dist/surfaces/redux/surfaceConfigSlice.js +2 -0
- package/dist/surfaces/redux/userStateSlice.js +3 -1
- package/dist/surfaces/runtime/agent-offer.js +1 -1
- package/dist/surfaces/runtime/surface-writeback.js +1 -1
- package/dist/tool-call-visualization/db-renderer/fetchToolRendererRow.js +2 -0
- package/dist/tool-call-visualization/renderers/agent-call/AgentCallInline.js +1 -1
- package/dist/tool-call-visualization/renderers/agent-call/CollabCallCard.js +1 -1
- package/dist/tool-call-visualization/renderers/fs/FsInline.js +1 -1
- package/dist/tool-call-visualization/renderers/random-wheel/RandomWheelInline.js +1 -1
- package/dist/tool-call-visualization/renderers/research/ResearchOverlay.js +4 -4
- package/dist/tool-call-visualization/renderers/research/SubagentReportBlock.js +2 -2
- package/dist/tool-call-visualization/renderers/scrape/ScrapeOverlay.js +1 -1
- package/dist/tool-call-visualization/renderers/search/SearchInline.js +1 -1
- package/dist/tool-call-visualization/renderers/search/SearchOverlay.js +1 -1
- package/dist/tool-call-visualization/renderers/sql/SqlInline.js +1 -1
- package/dist/tool-call-visualization/result-fields/KeyValueGrid.js +1 -1
- package/dist/tool-call-visualization/result-fields/ResultMarkdown.js +1 -1
- package/dist/tool-call-visualization/result-fields/ResultValue.js +1 -1
- package/dist/tool-call-visualization/surface-write/SurfaceWriteDiff.js +1 -1
- package/dist/ui/AudioOutputBlockSkeleton.d.ts +17 -0
- package/dist/ui/AudioOutputBlockSkeleton.js +78 -0
- package/dist/ui/chat-protocol-from-stream.d.ts +60 -0
- package/dist/ui/chat-protocol-from-stream.js +135 -0
- package/dist/ui/markdown-stream/EnhancedChatMarkdown.d.ts +59 -0
- package/dist/ui/markdown-stream/EnhancedChatMarkdown.js +1108 -0
- package/dist/ui/markdown-stream/MarkdownStream.d.ts +88 -0
- package/dist/ui/markdown-stream/MarkdownStream.js +14 -0
- package/dist/ui/markdown-stream/MarkdownStreamImpl.d.ts +4 -0
- package/dist/ui/markdown-stream/MarkdownStreamImpl.js +86 -0
- package/dist/ui/markdown-stream/StreamAwareChatMarkdown.d.ts +58 -0
- package/dist/ui/markdown-stream/StreamAwareChatMarkdown.js +294 -0
- package/dist/ui/markdown-stream/internal-handlers/AgentCallChildTrace.d.ts +22 -0
- package/dist/ui/markdown-stream/internal-handlers/AgentCallChildTrace.js +128 -0
- package/dist/ui/markdown-stream/internal-handlers/InlineAssistantError.d.ts +3 -0
- package/dist/ui/markdown-stream/internal-handlers/InlineAssistantError.js +26 -0
- package/dist/ui/markdown-stream/internal-handlers/InlineThinkingSlot.d.ts +14 -0
- package/dist/ui/markdown-stream/internal-handlers/InlineThinkingSlot.js +23 -0
- package/dist/ui/markdown-stream/internal-handlers/ToolHandlers.d.ts +42 -0
- package/dist/ui/markdown-stream/internal-handlers/ToolHandlers.js +109 -0
- package/dist/ui/markdown-stream/useBoundAgentOutputSchema.d.ts +2 -0
- package/dist/ui/markdown-stream/useBoundAgentOutputSchema.js +33 -0
- package/dist/window-panels/windows/agents/AgentAssistantMarkdownDebugWindow.js +1 -1
- package/package.json +7 -5
- package/dist/host/content-ir-slots.d.ts +0 -235
- package/dist/host/content-ir-slots.js +0 -135
- package/dist/host/markdown-slots.d.ts +0 -53
- package/dist/host/markdown-slots.js +0 -32
- package/dist/host/rich-document-slots.d.ts +0 -123
- package/dist/host/rich-document-slots.js +0 -36
- package/dist/utils/content-ir/report-kind-at-raw-renderer.d.ts +0 -19
- package/dist/utils/content-ir/report-kind-at-raw-renderer.js +0 -32
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* host/content-ir-slots — the app's kind / component registries, region-envelope memo, kind
|
|
3
|
-
* correctors, splitter primitives and shape browser, registered into the package
|
|
4
|
-
* (chat-package-move P14).
|
|
5
|
-
*
|
|
6
|
-
* The stream accumulator and the message selectors need these at call time; the registries are
|
|
7
|
-
* the app's (database-backed kinds, org overrides, `crm` correctors), so the package reaches
|
|
8
|
-
* them through typed function slots and never imports them. The app registers them in
|
|
9
|
-
* `providers/chatContentIrRegistration.ts`. A bare host gets an honest default: no envelope is
|
|
10
|
-
* attached (the block renders as the text it is), no kind schemas are known, nothing is
|
|
11
|
-
* validated — each reported once (Law 4). The splitter primitives have no honest stand-in (they
|
|
12
|
-
* ARE the block classifier), so a host without them fails loudly by name.
|
|
13
|
-
*
|
|
14
|
-
* The slot names extend `ChatUiSlots` by augmentation, so `registerChatUi` accepts them.
|
|
15
|
-
*/
|
|
16
|
-
import type { CanonicalBlockIR, KindSchema } from "@ai-matrx/content-ir";
|
|
17
|
-
import type { KindValidator } from "@ai-matrx/content-ir/registry";
|
|
18
|
-
import type { RenderBlockPayload } from "@ai-matrx/agents/generated/stream-events";
|
|
19
|
-
import type { EntityListPage, EntityListQuery, EntityListSort } from "@ai-matrx/records/list";
|
|
20
|
-
import { type ComponentType } from "react";
|
|
21
|
-
/** The registry a streaming parse resolves kind schemas through (the host's `kindRegistry`). */
|
|
22
|
-
export interface ContentIrKindRegistryPort {
|
|
23
|
-
/** The parser-facing resolver: a sync fast path plus a cold request. */
|
|
24
|
-
resolver(): {
|
|
25
|
-
get(kind: string): KindSchema | undefined;
|
|
26
|
-
request?(kind: string): void;
|
|
27
|
-
};
|
|
28
|
-
onSchemaArrived(listener: (kind: string, schema: KindSchema | null) => void): () => void;
|
|
29
|
-
ensureWarm(): Promise<void>;
|
|
30
|
-
requestSchema(kind: string): void;
|
|
31
|
-
}
|
|
32
|
-
/** The registry of rendering components per kind (the host's `componentRegistry`). */
|
|
33
|
-
export interface ContentIrComponentRegistryPort {
|
|
34
|
-
ensureWarm(): Promise<void>;
|
|
35
|
-
requestComponent(kind: string, platform: string, role: string): void;
|
|
36
|
-
}
|
|
37
|
-
/** The block classifier's text primitives (the host's content splitter). */
|
|
38
|
-
export interface ContentSplitterPrimitives {
|
|
39
|
-
/** The code languages that open a registered special block rather than plain code. */
|
|
40
|
-
SPECIAL_CODE_LANGUAGES: readonly string[];
|
|
41
|
-
detectJsonBlockType(content: string): string | null;
|
|
42
|
-
parseXmlAttributes(openingTag: string): Record<string, string>;
|
|
43
|
-
extractAudioLink(line: string): {
|
|
44
|
-
src: string;
|
|
45
|
-
alt: string;
|
|
46
|
-
} | null;
|
|
47
|
-
detectImageMarkdown(line: string): {
|
|
48
|
-
isImage: boolean;
|
|
49
|
-
src?: string;
|
|
50
|
-
alt?: string;
|
|
51
|
-
};
|
|
52
|
-
countInlineImages(line: string): number;
|
|
53
|
-
detectVideoMarkdown(line: string): {
|
|
54
|
-
isVideo: boolean;
|
|
55
|
-
src?: string;
|
|
56
|
-
alt?: string;
|
|
57
|
-
};
|
|
58
|
-
detectMatrxFileMarkdown(line: string): {
|
|
59
|
-
isMatrxFile: boolean;
|
|
60
|
-
url?: string;
|
|
61
|
-
label?: string;
|
|
62
|
-
pre?: string;
|
|
63
|
-
post?: string;
|
|
64
|
-
};
|
|
65
|
-
isCompleteUnrecognizedXmlContainer(source: string): boolean;
|
|
66
|
-
isUnclosedGenericXmlOpening(source: string): boolean;
|
|
67
|
-
startUnrecognizedXmlContainer(line: string): {
|
|
68
|
-
tracker: UnrecognizedXmlContainerTracker;
|
|
69
|
-
rootStart: number;
|
|
70
|
-
} | null;
|
|
71
|
-
normalizeCodeLanguage(language: string | undefined): string | undefined;
|
|
72
|
-
}
|
|
73
|
-
export interface UnrecognizedXmlContainerTracker {
|
|
74
|
-
readonly rootTag: string;
|
|
75
|
-
consumeLine(line: string, startOffset?: number): number | null;
|
|
76
|
-
}
|
|
77
|
-
declare module "./ui-slots" {
|
|
78
|
-
interface ChatUiSlots {
|
|
79
|
-
/** Seeds the region-envelope memo with one already-validated envelope. */
|
|
80
|
-
seedEnvelope: (envelope: CanonicalBlockIR) => void;
|
|
81
|
-
/** Seeds the memo from a message part's persisted `metadata.__ir` cache; returns the count seeded. */
|
|
82
|
-
seedPersistedEnvelopeCache: (metadata: Record<string, unknown> | null | undefined) => number;
|
|
83
|
-
/** Merges the canonical envelope for a region's source into a block's metadata. */
|
|
84
|
-
withIrEnvelope: (source: string, metadata: Record<string, unknown> | undefined, options?: {
|
|
85
|
-
allowTerminalError?: boolean;
|
|
86
|
-
}) => Record<string, unknown> | undefined;
|
|
87
|
-
/** A finished parse session's envelope, with the host's kind correctors applied. */
|
|
88
|
-
sessionEnvelope: (session: {
|
|
89
|
-
buildEnvelope(): CanonicalBlockIR;
|
|
90
|
-
} | null | undefined) => CanonicalBlockIR | null;
|
|
91
|
-
/** The envelope for a completed xml region whose tag a surface claims, else null. */
|
|
92
|
-
envelopeForCompletedXmlRegion: (tag: string, regionText: string) => CanonicalBlockIR | null;
|
|
93
|
-
/** The envelope for a completed fence region whose language a surface claims, else null. */
|
|
94
|
-
envelopeForCompletedFenceRegion: (language: string, regionText: string) => CanonicalBlockIR | null;
|
|
95
|
-
/** The host's kind registry. */
|
|
96
|
-
contentIrKindRegistry: () => ContentIrKindRegistryPort;
|
|
97
|
-
/** The host's kind component registry. */
|
|
98
|
-
contentIrComponentRegistry: () => ContentIrComponentRegistryPort;
|
|
99
|
-
/** The host's kind validator (the live kind catalog's contracts). */
|
|
100
|
-
contentIrKindValidator: () => KindValidator;
|
|
101
|
-
/** A server progress event's `content_ir` as a render block, or null. */
|
|
102
|
-
progressDataRenderBlock: (data: unknown, eventIndex: number, blockIndex: number) => RenderBlockPayload | null;
|
|
103
|
-
/** The block classifier's text primitives. */
|
|
104
|
-
contentSplitterPrimitives: () => ContentSplitterPrimitives;
|
|
105
|
-
/** Draws a kind instance through the host's one value door (`KindInstanceRender`), same props. */
|
|
106
|
-
KindInstanceRender: ComponentType<any>;
|
|
107
|
-
/** The list of records anchored to one thing (the host's `AnchorRecordsList`), same props. */
|
|
108
|
-
AnchorRecordsList: ComponentType<any>;
|
|
109
|
-
/** Reads the records anchored to one thing; `enabled` false reads nothing (zero-prefetch). */
|
|
110
|
-
useAnchorRecords: (anchor: {
|
|
111
|
-
type: string;
|
|
112
|
-
id: string;
|
|
113
|
-
} | null, enabled?: boolean) => AnchorRecordsState;
|
|
114
|
-
/** One page of the host's shape (kind) catalog. */
|
|
115
|
-
fetchShapePage: (query: EntityListQuery, sort: EntityListSort) => Promise<EntityListPage<ShapeBrowseRow>>;
|
|
116
|
-
/** One shape row by kind slug, or null. */
|
|
117
|
-
fetchShapeByKind: (kind: string) => Promise<ShapeBrowseRow | null>;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/** What an anchor's record read reports (the host's `AnchorRecordsState`). */
|
|
121
|
-
export interface AnchorRecordsState {
|
|
122
|
-
status: "loading" | "ready" | "error";
|
|
123
|
-
records: readonly unknown[];
|
|
124
|
-
active: readonly unknown[];
|
|
125
|
-
archived: readonly unknown[];
|
|
126
|
-
message: string | null;
|
|
127
|
-
reload: () => void;
|
|
128
|
-
}
|
|
129
|
-
/** The anchor type of a conversation's own records. */
|
|
130
|
-
export declare const CONVERSATION_ANCHOR_TYPE = "conversation";
|
|
131
|
-
/** A host with no record store shows nothing for the records of a chat (reported once). */
|
|
132
|
-
export declare const KindInstanceRender: ComponentType<any>;
|
|
133
|
-
export declare const AnchorRecordsList: ComponentType<any>;
|
|
134
|
-
/** A host with no record store reads no records: the list stays empty and says nothing is stored here. */
|
|
135
|
-
export declare const useAnchorRecords: (anchor: {
|
|
136
|
-
type: string;
|
|
137
|
-
id: string;
|
|
138
|
-
} | null, enabled?: boolean) => AnchorRecordsState;
|
|
139
|
-
/** One row, exactly as the host's shape list returns it. */
|
|
140
|
-
export interface ShapeBrowseRow {
|
|
141
|
-
access_level: string;
|
|
142
|
-
authoring_owner: string;
|
|
143
|
-
created_at: string;
|
|
144
|
-
created_by: string;
|
|
145
|
-
description: string;
|
|
146
|
-
family: string;
|
|
147
|
-
has_component: boolean;
|
|
148
|
-
id: string;
|
|
149
|
-
is_active: boolean;
|
|
150
|
-
is_owner: boolean;
|
|
151
|
-
kind: string;
|
|
152
|
-
label: string;
|
|
153
|
-
organization_id: string;
|
|
154
|
-
organization_name: string;
|
|
155
|
-
origin: string;
|
|
156
|
-
owner_email: string;
|
|
157
|
-
total_count: number;
|
|
158
|
-
updated_at: string;
|
|
159
|
-
version: number;
|
|
160
|
-
visibility: string;
|
|
161
|
-
}
|
|
162
|
-
/** A host with no memo seeds nothing: its blocks are parsed fresh each time. */
|
|
163
|
-
export declare const seedEnvelope: (envelope: CanonicalBlockIR) => void;
|
|
164
|
-
export declare const seedPersistedEnvelopeCache: (metadata: Record<string, unknown> | null | undefined) => number;
|
|
165
|
-
/** A host with no region memo attaches no envelope: the block renders as the text it is. */
|
|
166
|
-
export declare const withIrEnvelope: (source: string, metadata: Record<string, unknown> | undefined, options?: {
|
|
167
|
-
allowTerminalError?: boolean;
|
|
168
|
-
}) => Record<string, unknown> | undefined;
|
|
169
|
-
/** A host with no correctors takes the parse session's own envelope, uncorrected. */
|
|
170
|
-
export declare const sessionEnvelope: (session: {
|
|
171
|
-
buildEnvelope(): CanonicalBlockIR;
|
|
172
|
-
} | null | undefined) => CanonicalBlockIR | null;
|
|
173
|
-
/** A host with no surface table claims no xml/fence region: the legacy rendering stands. */
|
|
174
|
-
export declare const envelopeForCompletedXmlRegion: (tag: string, regionText: string) => CanonicalBlockIR | null;
|
|
175
|
-
export declare const envelopeForCompletedFenceRegion: (language: string, regionText: string) => CanonicalBlockIR | null;
|
|
176
|
-
/** A host with no kind catalog knows no kind: every kind stays as the text it arrived as. */
|
|
177
|
-
export declare const contentIrKindRegistry: () => ContentIrKindRegistryPort;
|
|
178
|
-
export declare const contentIrComponentRegistry: () => ContentIrComponentRegistryPort;
|
|
179
|
-
/** The accumulator's `kindRegistry` / `componentRegistry`: each call resolves the host's registry at that moment. */
|
|
180
|
-
export declare const kindRegistry: ContentIrKindRegistryPort;
|
|
181
|
-
export declare const componentRegistry: ContentIrComponentRegistryPort;
|
|
182
|
-
/** A host with no kind catalog checks nothing and says so: a skip is never a pass. */
|
|
183
|
-
export declare const contentIrKindValidator: () => KindValidator;
|
|
184
|
-
/** A host with no progress adapter promotes nothing: the event keeps only its ordinary typed data. */
|
|
185
|
-
export declare const progressDataRenderBlock: (data: unknown, eventIndex: number, blockIndex: number) => RenderBlockPayload | null;
|
|
186
|
-
/**
|
|
187
|
-
* The classifier primitives ARE the block classifier, so a bare host gets the real ones from
|
|
188
|
-
* `@ai-matrx/rich-content` (the same module matrx-frontend registers); the stream accumulator
|
|
189
|
-
* threw on the first streamed token without them (P29a canary).
|
|
190
|
-
*/
|
|
191
|
-
export declare const contentSplitterPrimitives: () => ContentSplitterPrimitives;
|
|
192
|
-
/** A host with no shape catalog has no shapes to browse: the read says so, the picker shows it. */
|
|
193
|
-
export declare const fetchShapePage: (query: EntityListQuery, sort: EntityListSort) => Promise<EntityListPage<ShapeBrowseRow>>;
|
|
194
|
-
export declare const fetchShapeByKind: (kind: string) => Promise<ShapeBrowseRow | null>;
|
|
195
|
-
/**
|
|
196
|
-
* Ingest guard for SERVER-BUILT envelopes riding `metadata.__ir` on a `render_block` event:
|
|
197
|
-
* valid -> same reference back + seeded into the host's region-envelope memo; malformed ->
|
|
198
|
-
* stripped copy + a loud diagnostic. Semantics live on the pure function in `@ai-matrx/content-ir`.
|
|
199
|
-
*/
|
|
200
|
-
export declare function sanitizeInboundEnvelopeMetadata(metadata: Record<string, unknown> | null | undefined, context: {
|
|
201
|
-
blockId: string;
|
|
202
|
-
}): Record<string, unknown> | undefined;
|
|
203
|
-
export declare const detectJsonBlockType: (content: string) => string | null;
|
|
204
|
-
export declare const parseXmlAttributes: (openingTag: string) => Record<string, string>;
|
|
205
|
-
export declare const extractAudioLink: (line: string) => {
|
|
206
|
-
src: string;
|
|
207
|
-
alt: string;
|
|
208
|
-
} | null;
|
|
209
|
-
export declare const detectImageMarkdown: (line: string) => {
|
|
210
|
-
isImage: boolean;
|
|
211
|
-
src?: string;
|
|
212
|
-
alt?: string;
|
|
213
|
-
};
|
|
214
|
-
export declare const countInlineImages: (line: string) => number;
|
|
215
|
-
export declare const detectVideoMarkdown: (line: string) => {
|
|
216
|
-
isVideo: boolean;
|
|
217
|
-
src?: string;
|
|
218
|
-
alt?: string;
|
|
219
|
-
};
|
|
220
|
-
export declare const detectMatrxFileMarkdown: (line: string) => {
|
|
221
|
-
isMatrxFile: boolean;
|
|
222
|
-
url?: string;
|
|
223
|
-
label?: string;
|
|
224
|
-
pre?: string;
|
|
225
|
-
post?: string;
|
|
226
|
-
};
|
|
227
|
-
export declare const isCompleteUnrecognizedXmlContainer: (source: string) => boolean;
|
|
228
|
-
export declare const isUnclosedGenericXmlOpening: (source: string) => boolean;
|
|
229
|
-
export declare const startUnrecognizedXmlContainer: (line: string) => {
|
|
230
|
-
tracker: UnrecognizedXmlContainerTracker;
|
|
231
|
-
rootStart: number;
|
|
232
|
-
} | null;
|
|
233
|
-
export declare const normalizeCodeLanguage: (language: string | undefined) => string | undefined;
|
|
234
|
-
/** True when `language` opens a registered special block rather than plain code. */
|
|
235
|
-
export declare const isSpecialCodeLanguage: (language: string) => boolean;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { sanitizeInboundEnvelopeMetadata as sanitizeInboundEnvelopeMetadataPure } from "@ai-matrx/content-ir";
|
|
2
|
-
import { captureError } from "./diagnostics.js";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { hostFn, hostSlot } from "./ui-slots.js";
|
|
5
|
-
import * as splitterCore from "@ai-matrx/rich-content/display/markdown-classification/processors/utils/content-splitter-core";
|
|
6
|
-
const CONVERSATION_ANCHOR_TYPE = "conversation";
|
|
7
|
-
const KindInstanceRender = hostSlot(
|
|
8
|
-
"KindInstanceRender",
|
|
9
|
-
({ value }) => createElement(
|
|
10
|
-
"pre",
|
|
11
|
-
{ className: "whitespace-pre-wrap break-words text-xs", "data-chat-slot-fallback": "KindInstanceRender" },
|
|
12
|
-
typeof value === "string" ? value : JSON.stringify(value ?? null, null, 2)
|
|
13
|
-
)
|
|
14
|
-
);
|
|
15
|
-
const AnchorRecordsList = hostSlot("AnchorRecordsList");
|
|
16
|
-
const useAnchorRecords = hostFn("useAnchorRecords", () => ({
|
|
17
|
-
status: "ready",
|
|
18
|
-
records: [],
|
|
19
|
-
active: [],
|
|
20
|
-
archived: [],
|
|
21
|
-
message: null,
|
|
22
|
-
reload: () => void 0
|
|
23
|
-
}));
|
|
24
|
-
const seedEnvelope = hostFn("seedEnvelope", () => void 0);
|
|
25
|
-
const seedPersistedEnvelopeCache = hostFn("seedPersistedEnvelopeCache", () => 0);
|
|
26
|
-
const withIrEnvelope = hostFn("withIrEnvelope", (_source, metadata) => metadata);
|
|
27
|
-
const sessionEnvelope = hostFn(
|
|
28
|
-
"sessionEnvelope",
|
|
29
|
-
(session) => session ? session.buildEnvelope() : null
|
|
30
|
-
);
|
|
31
|
-
const envelopeForCompletedXmlRegion = hostFn("envelopeForCompletedXmlRegion", () => null);
|
|
32
|
-
const envelopeForCompletedFenceRegion = hostFn("envelopeForCompletedFenceRegion", () => null);
|
|
33
|
-
const BARE_KIND_REGISTRY = {
|
|
34
|
-
resolver: () => ({ get: () => void 0, request: () => void 0 }),
|
|
35
|
-
onSchemaArrived: () => () => void 0,
|
|
36
|
-
ensureWarm: async () => void 0,
|
|
37
|
-
requestSchema: () => void 0
|
|
38
|
-
};
|
|
39
|
-
const BARE_COMPONENT_REGISTRY = {
|
|
40
|
-
ensureWarm: async () => void 0,
|
|
41
|
-
requestComponent: () => void 0
|
|
42
|
-
};
|
|
43
|
-
const contentIrKindRegistry = hostFn("contentIrKindRegistry", () => BARE_KIND_REGISTRY);
|
|
44
|
-
const contentIrComponentRegistry = hostFn("contentIrComponentRegistry", () => BARE_COMPONENT_REGISTRY);
|
|
45
|
-
const kindRegistry = {
|
|
46
|
-
resolver: () => contentIrKindRegistry().resolver(),
|
|
47
|
-
onSchemaArrived: (listener) => contentIrKindRegistry().onSchemaArrived(listener),
|
|
48
|
-
ensureWarm: () => contentIrKindRegistry().ensureWarm(),
|
|
49
|
-
requestSchema: (kind) => contentIrKindRegistry().requestSchema(kind)
|
|
50
|
-
};
|
|
51
|
-
const componentRegistry = {
|
|
52
|
-
ensureWarm: () => contentIrComponentRegistry().ensureWarm(),
|
|
53
|
-
requestComponent: (kind, platform, role) => contentIrComponentRegistry().requestComponent(kind, platform, role)
|
|
54
|
-
};
|
|
55
|
-
const contentIrKindValidator = hostFn("contentIrKindValidator", () => ({
|
|
56
|
-
validate: async (_value, kind) => ({
|
|
57
|
-
kind,
|
|
58
|
-
checked: false,
|
|
59
|
-
ok: false,
|
|
60
|
-
errors: ["This host has no kind catalog to check against (registerChatUi contentIrKindValidator)."],
|
|
61
|
-
degradedReason: "catalog_unreachable"
|
|
62
|
-
}),
|
|
63
|
-
cachedSchema: async () => null,
|
|
64
|
-
invalidate: () => void 0
|
|
65
|
-
}));
|
|
66
|
-
const progressDataRenderBlock = hostFn("progressDataRenderBlock", () => null);
|
|
67
|
-
const contentSplitterPrimitives = hostFn(
|
|
68
|
-
"contentSplitterPrimitives",
|
|
69
|
-
() => splitterCore
|
|
70
|
-
);
|
|
71
|
-
const fetchShapePage = hostFn("fetchShapePage", async () => {
|
|
72
|
-
throw new Error("This host has no shape catalog (registerChatUi fetchShapePage)");
|
|
73
|
-
});
|
|
74
|
-
const fetchShapeByKind = hostFn("fetchShapeByKind", async () => {
|
|
75
|
-
throw new Error("This host has no shape catalog (registerChatUi fetchShapeByKind)");
|
|
76
|
-
});
|
|
77
|
-
function sanitizeInboundEnvelopeMetadata(metadata, context) {
|
|
78
|
-
return sanitizeInboundEnvelopeMetadataPure(metadata, context, {
|
|
79
|
-
seedEnvelope: (envelope) => seedEnvelope(envelope),
|
|
80
|
-
reportMalformed: ({ blockId, engine, raw }) => {
|
|
81
|
-
captureError({
|
|
82
|
-
source: "content-ir",
|
|
83
|
-
message: `render_block "${blockId}" carried a malformed metadata.__ir envelope (engine "${engine}") \u2014 dropped before Redux so it can't poison the pipeline`,
|
|
84
|
-
relation: engine,
|
|
85
|
-
raw
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
const detectJsonBlockType = (content) => contentSplitterPrimitives().detectJsonBlockType(content);
|
|
91
|
-
const parseXmlAttributes = (openingTag) => contentSplitterPrimitives().parseXmlAttributes(openingTag);
|
|
92
|
-
const extractAudioLink = (line) => contentSplitterPrimitives().extractAudioLink(line);
|
|
93
|
-
const detectImageMarkdown = (line) => contentSplitterPrimitives().detectImageMarkdown(line);
|
|
94
|
-
const countInlineImages = (line) => contentSplitterPrimitives().countInlineImages(line);
|
|
95
|
-
const detectVideoMarkdown = (line) => contentSplitterPrimitives().detectVideoMarkdown(line);
|
|
96
|
-
const detectMatrxFileMarkdown = (line) => contentSplitterPrimitives().detectMatrxFileMarkdown(line);
|
|
97
|
-
const isCompleteUnrecognizedXmlContainer = (source) => contentSplitterPrimitives().isCompleteUnrecognizedXmlContainer(source);
|
|
98
|
-
const isUnclosedGenericXmlOpening = (source) => contentSplitterPrimitives().isUnclosedGenericXmlOpening(source);
|
|
99
|
-
const startUnrecognizedXmlContainer = (line) => contentSplitterPrimitives().startUnrecognizedXmlContainer(line);
|
|
100
|
-
const normalizeCodeLanguage = (language) => contentSplitterPrimitives().normalizeCodeLanguage(language);
|
|
101
|
-
const isSpecialCodeLanguage = (language) => contentSplitterPrimitives().SPECIAL_CODE_LANGUAGES.includes(language);
|
|
102
|
-
export {
|
|
103
|
-
AnchorRecordsList,
|
|
104
|
-
CONVERSATION_ANCHOR_TYPE,
|
|
105
|
-
KindInstanceRender,
|
|
106
|
-
componentRegistry,
|
|
107
|
-
contentIrComponentRegistry,
|
|
108
|
-
contentIrKindRegistry,
|
|
109
|
-
contentIrKindValidator,
|
|
110
|
-
contentSplitterPrimitives,
|
|
111
|
-
countInlineImages,
|
|
112
|
-
detectImageMarkdown,
|
|
113
|
-
detectJsonBlockType,
|
|
114
|
-
detectMatrxFileMarkdown,
|
|
115
|
-
detectVideoMarkdown,
|
|
116
|
-
envelopeForCompletedFenceRegion,
|
|
117
|
-
envelopeForCompletedXmlRegion,
|
|
118
|
-
extractAudioLink,
|
|
119
|
-
fetchShapeByKind,
|
|
120
|
-
fetchShapePage,
|
|
121
|
-
isCompleteUnrecognizedXmlContainer,
|
|
122
|
-
isSpecialCodeLanguage,
|
|
123
|
-
isUnclosedGenericXmlOpening,
|
|
124
|
-
kindRegistry,
|
|
125
|
-
normalizeCodeLanguage,
|
|
126
|
-
parseXmlAttributes,
|
|
127
|
-
progressDataRenderBlock,
|
|
128
|
-
sanitizeInboundEnvelopeMetadata,
|
|
129
|
-
seedEnvelope,
|
|
130
|
-
seedPersistedEnvelopeCache,
|
|
131
|
-
sessionEnvelope,
|
|
132
|
-
startUnrecognizedXmlContainer,
|
|
133
|
-
useAnchorRecords,
|
|
134
|
-
withIrEnvelope
|
|
135
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* host/markdown-slots — the app's rich-document rendering engine, registered into the package
|
|
3
|
-
* (chat-package-move P14).
|
|
4
|
-
*
|
|
5
|
-
* `MarkdownStream` and `BasicMarkdownContent` are the host's ONE rendering pipeline (block
|
|
6
|
-
* registry, kind routing, code highlighting, app-owned blocks that read app data). The package
|
|
7
|
-
* draws through these slots and never imports that engine. The app registers them in
|
|
8
|
-
* `providers/chatMarkdownRegistration.ts`; a bare host shows the text exactly as written,
|
|
9
|
-
* marked `data-chat-slot-fallback`, and the missing renderer is reported once (Law 4).
|
|
10
|
-
*
|
|
11
|
-
* The slot names extend `ChatUiSlots` by augmentation, so `registerChatUi` accepts them.
|
|
12
|
-
*/
|
|
13
|
-
import { type ComponentType } from "react";
|
|
14
|
-
import type { MessageCitationSource } from "../agents/redux/execution-system/messages/message-citations.js";
|
|
15
|
-
/** The engine's props the package's call sites rely on being typed; the rest pass through as written. */
|
|
16
|
-
export interface MarkdownStreamSlotProps {
|
|
17
|
-
content?: string;
|
|
18
|
-
className?: string;
|
|
19
|
-
/** `previousContent` is the text the edit applied to; `remark` names an answer edit. */
|
|
20
|
-
onContentChange?: (newContent: string, previousContent: string, remark?: any) => void;
|
|
21
|
-
[prop: string]: any;
|
|
22
|
-
}
|
|
23
|
-
declare module "./ui-slots" {
|
|
24
|
-
interface ChatUiSlots {
|
|
25
|
-
/** The streaming rich-document engine (the host's `MarkdownStream`), same props. */
|
|
26
|
-
MarkdownStream: ComponentType<MarkdownStreamSlotProps>;
|
|
27
|
-
/** The host's plain markdown leaf (`BasicMarkdownContent`), same props. */
|
|
28
|
-
BasicMarkdownContent: ComponentType<any>;
|
|
29
|
-
/** The placeholder while a spoken answer's audio is being made. */
|
|
30
|
-
AudioOutputBlockSkeleton: ComponentType<any>;
|
|
31
|
-
/** Opens one numbered message source (the host's Source Inspector): returns `(source) => void`. */
|
|
32
|
-
useOpenCitationSource: () => (source: MessageCitationSource) => void;
|
|
33
|
-
/** Draws every mermaid diagram under a root (print / DOM capture); resolves when done. */
|
|
34
|
-
renderAllDiagrams: (...args: any[]) => Promise<{
|
|
35
|
-
release: () => void;
|
|
36
|
-
}>;
|
|
37
|
-
/** One mermaid source drawn for print (SVG markup), the host's lazy diagram engine. */
|
|
38
|
-
drawMermaidForPrint: (...args: any[]) => Promise<any>;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
export declare const MarkdownStream: ComponentType<MarkdownStreamSlotProps>;
|
|
42
|
-
export declare const BasicMarkdownContent: ComponentType<any>;
|
|
43
|
-
/** A host with no audio placeholder shows nothing while the audio is made (reported once). */
|
|
44
|
-
export declare const AudioOutputBlockSkeleton: ComponentType<any>;
|
|
45
|
-
/** A host with no Source Inspector opens a web source in a new tab; a file source has no target here. */
|
|
46
|
-
export declare const useOpenCitationSource: () => (source: MessageCitationSource) => void;
|
|
47
|
-
/** A host with no diagram engine draws nothing extra: diagrams stay as drawn (or as source). */
|
|
48
|
-
export declare const renderAllDiagrams: (...args: any[]) => Promise<{
|
|
49
|
-
release: () => void;
|
|
50
|
-
}>;
|
|
51
|
-
/** A host with no diagram engine cannot draw for print; the print path prints the source and says so. */
|
|
52
|
-
export declare const drawMermaidForPrint: (...args: any[]) => Promise<any>;
|
|
53
|
-
export default MarkdownStream;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { createElement } from "react";
|
|
3
|
-
import { hostFn, hostSlot } from "./ui-slots.js";
|
|
4
|
-
function plainText(name) {
|
|
5
|
-
const PlainText = ({ content, className }) => createElement(
|
|
6
|
-
"div",
|
|
7
|
-
{ className: `whitespace-pre-wrap break-words text-sm ${className ?? ""}`, "data-chat-slot-fallback": name },
|
|
8
|
-
typeof content === "string" ? content : ""
|
|
9
|
-
);
|
|
10
|
-
PlainText.displayName = `PlainText(${name})`;
|
|
11
|
-
return PlainText;
|
|
12
|
-
}
|
|
13
|
-
const MarkdownStream = hostSlot("MarkdownStream", plainText("MarkdownStream"));
|
|
14
|
-
const BasicMarkdownContent = hostSlot("BasicMarkdownContent", plainText("BasicMarkdownContent"));
|
|
15
|
-
const AudioOutputBlockSkeleton = hostSlot("AudioOutputBlockSkeleton");
|
|
16
|
-
const useOpenCitationSource = hostFn("useOpenCitationSource", () => (source) => {
|
|
17
|
-
if (source.url && typeof window !== "undefined") window.open(source.url, "_blank", "noopener,noreferrer");
|
|
18
|
-
});
|
|
19
|
-
const renderAllDiagrams = hostFn("renderAllDiagrams", async () => ({ release: () => void 0 }));
|
|
20
|
-
const drawMermaidForPrint = hostFn("drawMermaidForPrint", async () => {
|
|
21
|
-
throw new Error("This host has no diagram engine (registerChatUi drawMermaidForPrint)");
|
|
22
|
-
});
|
|
23
|
-
var markdown_slots_default = MarkdownStream;
|
|
24
|
-
export {
|
|
25
|
-
AudioOutputBlockSkeleton,
|
|
26
|
-
BasicMarkdownContent,
|
|
27
|
-
MarkdownStream,
|
|
28
|
-
markdown_slots_default as default,
|
|
29
|
-
drawMermaidForPrint,
|
|
30
|
-
renderAllDiagrams,
|
|
31
|
-
useOpenCitationSource
|
|
32
|
-
};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* host/rich-document-slots — the app's rich-document action registry, dialogs host and record
|
|
3
|
-
* annotations, registered into the package (chat-package-move P14).
|
|
4
|
-
*
|
|
5
|
-
* Every action under a chat message (thumbs, read aloud, edit, regenerate, print, convert, the
|
|
6
|
-
* Alchemy copy menu, the right-click menu) comes from the host's ONE rich-document registry
|
|
7
|
-
* (`features/rich-document`), and so do its dialogs and the highlight/comment sidecar. The package
|
|
8
|
-
* draws them through these slots and never imports them; the app registers them in
|
|
9
|
-
* `providers/chatRichDocumentRegistration.ts`. A bare host draws no action bar, menu or
|
|
10
|
-
* annotation layer — the message and its text stay exactly as they are — and the missing
|
|
11
|
-
* capability is reported once (Law 4).
|
|
12
|
-
*
|
|
13
|
-
* The slot names extend `ChatUiSlots` by augmentation, so `registerChatUi` accepts them.
|
|
14
|
-
*/
|
|
15
|
-
import { type ComponentType, type ReactNode } from "react";
|
|
16
|
-
/** What a rich document is the text of (the host's `ContentSource`); `type` names the kind of thing. */
|
|
17
|
-
export interface RichDocumentSource {
|
|
18
|
-
type: string;
|
|
19
|
-
readOnly?: boolean;
|
|
20
|
-
[prop: string]: unknown;
|
|
21
|
-
}
|
|
22
|
-
/** The facts the host's registry needs to offer one chat message's actions. */
|
|
23
|
-
export interface ChatMessageActionFacts {
|
|
24
|
-
conversationId: string;
|
|
25
|
-
messageId: string;
|
|
26
|
-
role: "assistant" | "user";
|
|
27
|
-
messageContent: string;
|
|
28
|
-
contentIsStructuredRaw?: boolean;
|
|
29
|
-
turnContent?: string | null;
|
|
30
|
-
editTarget?: {
|
|
31
|
-
messageId: string;
|
|
32
|
-
content: string;
|
|
33
|
-
isStructuredRaw: boolean;
|
|
34
|
-
} | null;
|
|
35
|
-
metadata?: Record<string, unknown> | null;
|
|
36
|
-
streamRequestId?: string | null;
|
|
37
|
-
contentHistoryCount?: number;
|
|
38
|
-
groupMessageIds?: string[];
|
|
39
|
-
isCreator?: boolean;
|
|
40
|
-
surfaceKey?: string | null;
|
|
41
|
-
showFullPrint?: boolean;
|
|
42
|
-
isCapturing?: boolean;
|
|
43
|
-
callbacks?: Record<string, unknown>;
|
|
44
|
-
}
|
|
45
|
-
/** What the host's registry hands back for one message: the text, its source and the action set. */
|
|
46
|
-
export interface ChatMessageActionConfig {
|
|
47
|
-
content: string;
|
|
48
|
-
source: RichDocumentSource;
|
|
49
|
-
actions: any;
|
|
50
|
-
}
|
|
51
|
-
/** The host's dialogs for the actions it offers: merge `callbacks` into the actions, render `dialogs` once. */
|
|
52
|
-
export interface DocumentDialogsHost {
|
|
53
|
-
callbacks: Record<string, any>;
|
|
54
|
-
dialogs: ReactNode;
|
|
55
|
-
}
|
|
56
|
-
/** What a saved answer / note / document is, to the annotation layer (the host's `AnnotationSource`). */
|
|
57
|
-
export interface AnnotationRecord {
|
|
58
|
-
token: string;
|
|
59
|
-
id: string;
|
|
60
|
-
title?: string;
|
|
61
|
-
href?: string;
|
|
62
|
-
conversationId?: string;
|
|
63
|
-
}
|
|
64
|
-
declare module "./ui-slots" {
|
|
65
|
-
interface ChatUiSlots {
|
|
66
|
-
/** The action bar for a document (the host's `RichDocumentActions`), same props. */
|
|
67
|
-
RichDocumentActions: ComponentType<any>;
|
|
68
|
-
/** Right-click menu around a document's content (the host's `RegistryContextMenu`), same props. */
|
|
69
|
-
RegistryContextMenu: ComponentType<any>;
|
|
70
|
-
/** The ⋯ menu for a document (the host's `RegistryActionMenu`), same props. */
|
|
71
|
-
RegistryActionMenu: ComponentType<any>;
|
|
72
|
-
/** Headless: registers a document's actions for a surface id (the host's `RichDocumentActionProvider`). */
|
|
73
|
-
RichDocumentActionProvider: ComponentType<any>;
|
|
74
|
-
/** Draws a registered surface's actions as a bar or a menu (the host's `RichDocumentActionSurface`). */
|
|
75
|
-
RichDocumentActionSurface: ComponentType<any>;
|
|
76
|
-
/** The highlight / comment / suggest layer around a saved record (the host's `RecordAnnotations`). */
|
|
77
|
-
RecordAnnotations: ComponentType<any>;
|
|
78
|
-
/** The ONE builder from a chat message to its rich-document action configuration. */
|
|
79
|
-
buildChatMessageActions: (facts: any) => ChatMessageActionConfig;
|
|
80
|
-
/** The lineage origin a converted message points back at, or null when it has none. */
|
|
81
|
-
convertOriginForSource: (source: any, title: string) => unknown;
|
|
82
|
-
/** The host's dialogs for a document's actions (hook). */
|
|
83
|
-
useDocumentDialogsHost: (args: {
|
|
84
|
-
convertOrigin: any;
|
|
85
|
-
text: string;
|
|
86
|
-
writable?: boolean;
|
|
87
|
-
chatMessage?: {
|
|
88
|
-
conversationId: string;
|
|
89
|
-
messageId: string;
|
|
90
|
-
surfaceKey: string | null;
|
|
91
|
-
} | null;
|
|
92
|
-
}) => DocumentDialogsHost;
|
|
93
|
-
/** The annotation identity of a source (a saved chat answer, a note), or null when it has none. */
|
|
94
|
-
annotationRecordOf: (source: any) => AnnotationRecord | null;
|
|
95
|
-
/** Binds a conversation to the apply target a review-and-apply session will write back into. */
|
|
96
|
-
bindConversationToApplyTarget: (conversationId: string, applyTargetId: string) => void;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/** A host with no action registry offers no actions under a message: nothing is drawn (reported once). */
|
|
100
|
-
export declare const RichDocumentActions: ComponentType<any>;
|
|
101
|
-
export declare const RegistryActionMenu: ComponentType<any>;
|
|
102
|
-
export declare const RichDocumentActionProvider: ComponentType<any>;
|
|
103
|
-
/** A host with no registry draws a surface's own `fallback`, as the surface already allows. */
|
|
104
|
-
export declare const RichDocumentActionSurface: ComponentType<any>;
|
|
105
|
-
/** A host with no menu registry leaves the content as it is: no right-click actions, the children draw. */
|
|
106
|
-
export declare const RegistryContextMenu: ComponentType<any>;
|
|
107
|
-
/** A host with no annotation layer leaves the record's content as it is. */
|
|
108
|
-
export declare const RecordAnnotations: ComponentType<any>;
|
|
109
|
-
/** A host with no registry derives no actions: the message text and its source, an empty action set. */
|
|
110
|
-
export declare const buildChatMessageActions: (facts: any) => ChatMessageActionConfig;
|
|
111
|
-
export declare const convertOriginForSource: (source: any, title: string) => unknown;
|
|
112
|
-
export declare const useDocumentDialogsHost: (args: {
|
|
113
|
-
convertOrigin: any;
|
|
114
|
-
text: string;
|
|
115
|
-
writable?: boolean;
|
|
116
|
-
chatMessage?: {
|
|
117
|
-
conversationId: string;
|
|
118
|
-
messageId: string;
|
|
119
|
-
surfaceKey: string | null;
|
|
120
|
-
} | null;
|
|
121
|
-
}) => DocumentDialogsHost;
|
|
122
|
-
export declare const annotationRecordOf: (source: any) => AnnotationRecord | null;
|
|
123
|
-
export declare const bindConversationToApplyTarget: (conversationId: string, applyTargetId: string) => void;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
import { hostFn, hostSlot } from "./ui-slots.js";
|
|
3
|
-
const RichDocumentActions = hostSlot("RichDocumentActions");
|
|
4
|
-
const RegistryActionMenu = hostSlot("RegistryActionMenu");
|
|
5
|
-
const RichDocumentActionProvider = hostSlot("RichDocumentActionProvider");
|
|
6
|
-
const RichDocumentActionSurface = hostSlot("RichDocumentActionSurface", ({ fallback }) => fallback ?? null);
|
|
7
|
-
const RegistryContextMenu = hostSlot(
|
|
8
|
-
"RegistryContextMenu",
|
|
9
|
-
({ children }) => createElement("div", { className: "contents", "data-chat-slot-fallback": "RegistryContextMenu" }, children)
|
|
10
|
-
);
|
|
11
|
-
const RecordAnnotations = hostSlot(
|
|
12
|
-
"RecordAnnotations",
|
|
13
|
-
({ children }) => createElement("div", { className: "contents", "data-chat-slot-fallback": "RecordAnnotations" }, children)
|
|
14
|
-
);
|
|
15
|
-
const buildChatMessageActions = hostFn("buildChatMessageActions", (facts) => ({
|
|
16
|
-
content: facts.turnContent ?? facts.messageContent,
|
|
17
|
-
source: { type: "chat-message", conversationId: facts.conversationId, messageId: facts.messageId },
|
|
18
|
-
actions: { callbacks: facts.callbacks ?? {} }
|
|
19
|
-
}));
|
|
20
|
-
const convertOriginForSource = hostFn("convertOriginForSource", () => null);
|
|
21
|
-
const useDocumentDialogsHost = hostFn("useDocumentDialogsHost", () => ({ callbacks: {}, dialogs: null }));
|
|
22
|
-
const annotationRecordOf = hostFn("annotationRecordOf", () => null);
|
|
23
|
-
const bindConversationToApplyTarget = hostFn("bindConversationToApplyTarget", () => void 0);
|
|
24
|
-
export {
|
|
25
|
-
RecordAnnotations,
|
|
26
|
-
RegistryActionMenu,
|
|
27
|
-
RegistryContextMenu,
|
|
28
|
-
RichDocumentActionProvider,
|
|
29
|
-
RichDocumentActionSurface,
|
|
30
|
-
RichDocumentActions,
|
|
31
|
-
annotationRecordOf,
|
|
32
|
-
bindConversationToApplyTarget,
|
|
33
|
-
buildChatMessageActions,
|
|
34
|
-
convertOriginForSource,
|
|
35
|
-
useDocumentDialogsHost
|
|
36
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THE BOTTOM-LAYER REPORT — a low-level raw renderer (a markdown leaf, the
|
|
3
|
-
* value grid, a JSON viewer, the JSON code card) was handed kind data. It has
|
|
4
|
-
* already rendered the data as its kind; this files the CALLER in the Error
|
|
5
|
-
* Inspector so the screen that skipped the value door is found and fixed
|
|
6
|
-
* (Arman, 2026-09-30: a `__kind` is never drawn as raw JSON). Checklist C4:
|
|
7
|
-
* `features/content-ir/docs/KIND_NEVER_RAW_CHECKLIST.md`.
|
|
8
|
-
*
|
|
9
|
-
* Once per component + slug per session: a render loop must not flood the
|
|
10
|
-
* inspector. The owner stack (development builds) names the caller.
|
|
11
|
-
*/
|
|
12
|
-
export declare function reportKindAtRawRenderer(component: string, slug: string | null, ownerStack?: string | null): void;
|
|
13
|
-
/** Test seam: forget what was reported. */
|
|
14
|
-
export declare function resetKindAtRawRendererReports(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Report from a component's render. The owner stack is read during render
|
|
17
|
-
* (the only time React has it) and filed after commit.
|
|
18
|
-
*/
|
|
19
|
-
export declare function useReportKindAtRawRenderer(component: string, slug: string | null, active: boolean): void;
|