@ai-matrx/chat 0.4.9 → 0.4.12
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 +53 -0
- package/dist/agents/components/context-items/bodies/ContextInputBody.js +1 -1
- package/dist/agents/components/context-items/bodies/GenericBody.js +1 -1
- package/dist/agents/components/conversation-actions/conversation-verbs.js +1 -1
- package/dist/agents/components/inputs/smart-input/RunSkillPicker.js +1 -1
- package/dist/agents/components/live-run/LiveRunDisplay.js +1 -1
- package/dist/agents/components/live-run/LiveRunProgress.js +1 -1
- package/dist/agents/components/live-run/RunSetDisplay.js +1 -1
- package/dist/agents/components/messages-display/assistant/AgentAssistantMessage.js +2 -2
- package/dist/agents/components/messages-display/assistant/InPlaceAnswerEditor.js +1 -1
- package/dist/agents/components/messages-display/conversation-tools/find-in-conversation.js +1 -1
- package/dist/agents/components/messages-display/message-options/buildTaskSeedFromMessage.js +1 -1
- package/dist/agents/components/messages-display/user/AgentUserMessage.js +1 -1
- package/dist/agents/components/messages-display/user/FirstTurnVariables.js +1 -1
- package/dist/agents/components/run/AgentStatusIndicator.js +1 -1
- package/dist/agents/components/run/RunJobWorkingLine.js +1 -1
- package/dist/agents/components/shared/AgentNewRunButton.js +1 -1
- package/dist/agents/components/shared/AgentPlanningIndicator.js +1 -1
- package/dist/agents/conversation-export/conversation-transfer.js +1 -1
- package/dist/agents/conversation-export/document-markdown.js +1 -1
- package/dist/agents/hooks/useConversationRoutePromotion.js +1 -1
- package/dist/agents/hooks/useModelControls.js +1 -1
- package/dist/agents/redux/agent-definition/converters.js +1 -1
- package/dist/agents/redux/agent-definition/slice.js +1 -1
- package/dist/agents/redux/conversation-list/conversation-list.thunks.js +1 -1
- package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.js +1 -1
- package/dist/agents/redux/execution-system/instance-context/sync-canvas-item-context.thunk.js +1 -1
- package/dist/agents/redux/execution-system/thunks/process-stream.js +1 -1
- package/dist/agents/redux/execution-system/thunks/resolve-base-url.js +17 -0
- package/dist/agents/redux/execution-system/thunks/run-ai-stream.d.ts +7 -0
- package/dist/agents/redux/execution-system/thunks/run-ai-stream.js +13 -0
- package/dist/agents/redux/execution-system/thunks/run-headless-agent-json.js +14 -2
- package/dist/agents/redux/execution-system/utils/assemble-cx-content-blocks.js +1 -1
- package/dist/agents/redux/execution-system/utils/normalize-content-blocks.js +1 -1
- package/dist/agents/redux/execution-system/utils/output-contract-guard.js +1 -1
- package/dist/agents/redux/execution-system/utils/stream-block-accumulator.js +8 -8
- package/dist/agents/routing/confidential-routing.d.ts +52 -0
- package/dist/agents/routing/confidential-routing.js +38 -0
- package/dist/agents/utils/canvasItemContext.js +1 -1
- package/dist/canvas/workspace/ChatPanelTitleMenu.js +1 -1
- package/dist/canvas/workspace/useCanvasWorkspaceConversation.js +1 -1
- package/dist/cx-chat/components/SsrSidebarChats.js +1 -1
- package/dist/cx-chat/components/core/ChatConversationClient.js +1 -1
- package/dist/cx-chat/components/messages/AssistantMessage.js +1 -1
- package/dist/cx-chat/hooks/useInstanceBootstrap.js +1 -1
- package/dist/cx-conversation/AssistantMessage.js +1 -1
- package/dist/host/configure.js +4 -1
- package/dist/host/contract.d.ts +14 -1
- package/dist/host/index.d.ts +1 -0
- package/dist/host/index.js +1 -0
- package/dist/mandates/llm-params.d.ts +1 -1
- package/dist/mandates/output-contract.js +1 -1
- package/dist/mandates/service.d.ts +1 -1
- package/dist/mandates/service.js +1 -1
- package/dist/mandates/test-run-core.js +1 -1
- package/dist/public-chat/components/PublicMessageOptionsMenu.js +1 -1
- package/dist/surfaces/services/surface-config.service.js +1 -1
- package/dist/tool-call-visualization/components/ToolCallBatch.js +1 -1
- package/dist/tool-call-visualization/components/ToolCallVisualization.js +1 -1
- 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/agent-call/collab-subtitle.js +3 -3
- package/dist/tool-call-visualization/renderers/skill/SkillInline.js +1 -1
- package/dist/tool-call-visualization/result-fields/KeyValueGrid.js +1 -1
- package/dist/tool-call-visualization/result-fields/ResultValue.js +1 -1
- package/dist/tool-call-visualization/result-fields/shape.js +1 -1
- package/dist/tool-call-visualization/utils/cxToolCallToLifecycleEntry.js +2 -2
- package/dist/tool-call-visualization/utils/human-copy.js +3 -3
- package/dist/ui/mandates-storage/provision-shapes.d.ts +1 -1
- package/dist/ui/mandates-storage/provision-shapes.js +1 -1
- package/dist/ui/markdown-stream/EnhancedChatMarkdown.js +1 -1
- package/dist/ui/treatment-shape.d.ts +1 -1
- package/dist/ui/treatment-shape.js +1 -1
- package/dist/voice-agent/relay/useVoiceRelaySession.js +1 -1
- package/package.json +26 -9
- package/dist/agents/hooks/useWarmAgent.d.ts +0 -8
- package/dist/agents/hooks/useWarmAgent.js +0 -25
- package/dist/agents/utils/artifactId.d.ts +0 -34
- package/dist/agents/utils/artifactId.js +0 -15
- package/dist/ui/ShimmerText.d.ts +0 -5
- package/dist/ui/ShimmerText.js +0 -21
- package/dist/ui/addressWithoutNavigating.d.ts +0 -68
- package/dist/ui/addressWithoutNavigating.js +0 -60
- package/dist/utils/content-ir/decision-answers-ids.d.ts +0 -3
- package/dist/utils/content-ir/decision-answers-ids.js +0 -6
- package/dist/utils/content-ir/envelope-parity.d.ts +0 -12
- package/dist/utils/content-ir/envelope-parity.js +0 -32
- package/dist/utils/content-ir/instance-title.d.ts +0 -26
- package/dist/utils/content-ir/instance-title.js +0 -39
- package/dist/utils/content-ir/kinds/kind-markdown-utils.d.ts +0 -84
- package/dist/utils/content-ir/kinds/kind-markdown-utils.js +0 -233
- package/dist/utils/content-ir/kinds/kind-value-markdown.d.ts +0 -5
- package/dist/utils/content-ir/kinds/kind-value-markdown.js +0 -17
- package/dist/utils/content-ir/legacy-quiz-envelope.d.ts +0 -3
- package/dist/utils/content-ir/legacy-quiz-envelope.js +0 -45
- package/dist/utils/content-ir/surfaces/embedded-kind-json.d.ts +0 -140
- package/dist/utils/content-ir/surfaces/embedded-kind-json.js +0 -527
- package/dist/utils/content-ir/surfaces/json-kind-signal.d.ts +0 -307
- package/dist/utils/content-ir/surfaces/json-kind-signal.js +0 -945
- package/dist/utils/content-ir/surfaces/kind-image-alt.d.ts +0 -27
- package/dist/utils/content-ir/surfaces/kind-image-alt.js +0 -117
- package/dist/utils/content-ir/surfaces/kind-one-line.d.ts +0 -67
- package/dist/utils/content-ir/surfaces/kind-one-line.js +0 -209
- package/dist/utils/content-ir/surfaces/kind-text-label.d.ts +0 -20
- package/dist/utils/content-ir/surfaces/kind-text-label.js +0 -50
- package/dist/utils/content-ir/surfaces/kind-text-to-markdown.d.ts +0 -47
- package/dist/utils/content-ir/surfaces/kind-text-to-markdown.js +0 -399
- package/dist/utils/content-ir/surfaces/markdown-escaped-kind.d.ts +0 -54
- package/dist/utils/content-ir/surfaces/markdown-escaped-kind.js +0 -128
- package/dist/utils/content-ir/surfaces/quoted-kind-lift.d.ts +0 -61
- package/dist/utils/content-ir/surfaces/quoted-kind-lift.js +0 -215
- package/dist/utils/inline-decision/decision-options.d.ts +0 -21
- package/dist/utils/inline-decision/decision-options.js +0 -32
- package/dist/utils/json.d.ts +0 -63
- package/dist/utils/json.js +0 -22
- package/dist/utils/markdown/plain-title.d.ts +0 -25
- package/dist/utils/markdown/plain-title.js +0 -51
- package/dist/utils/rendered-find.d.ts +0 -9
- package/dist/utils/rendered-find.js +0 -68
- package/dist/utils/rich-editor/core/caret-context.d.ts +0 -24
- package/dist/utils/rich-editor/core/caret-context.js +0 -73
- package/dist/utils/rich-editor/in-place/caret-handoff.d.ts +0 -3
- package/dist/utils/rich-editor/in-place/caret-handoff.js +0 -15
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THE KIND SIGNAL of a JSON region's text — the one answer to "could this
|
|
3
|
-
* still be a kind?" (Arman, 2026-09-30):
|
|
4
|
-
*
|
|
5
|
-
* 1. The moment it COULD be a kind → display as a kind (its loader).
|
|
6
|
-
* 2. The moment we know WHICH kind → that kind (the parser's job).
|
|
7
|
-
* 3. The moment we know it is not a kind → it is JSON, and JSON is fine.
|
|
8
|
-
*
|
|
9
|
-
* "Could" is decided by the FIRST KEY. Until the first key has fully arrived
|
|
10
|
-
* the region is `undecided` and nothing raw is shown. A first key of `__kind`
|
|
11
|
-
* — or a `__kind` key anywhere in the text, at any depth, at any time — is
|
|
12
|
-
* `kind`. A complete first key that is anything else, with no `__kind` seen,
|
|
13
|
-
* is `not_kind`: the region streams live as JSON, and flips to `kind` the
|
|
14
|
-
* instant a `__kind` key shows up later.
|
|
15
|
-
*
|
|
16
|
-
* Pure and text-only on purpose: it must answer for every frame of every
|
|
17
|
-
* region, including ones whose parser never opened (an unlabelled fence, a
|
|
18
|
-
* reload, a plain markdown fence).
|
|
19
|
-
*/
|
|
20
|
-
export type JsonKindSignal = "undecided" | "kind" | "not_kind";
|
|
21
|
-
/**
|
|
22
|
-
* Options for the JSON-text readers: `json5` widens the key rule to JSON5's;
|
|
23
|
-
* `markdown` also reads the markdown-escaped key (`"\_\_kind"`, P8);
|
|
24
|
-
* `escaped` also reads the backslash-escaped key of a string-held kind
|
|
25
|
-
* (`\"__kind\"`, R3 round 6 — screen and search text only).
|
|
26
|
-
*/
|
|
27
|
-
export interface KindTextOptions {
|
|
28
|
-
json5?: boolean;
|
|
29
|
-
markdown?: boolean;
|
|
30
|
-
escaped?: boolean;
|
|
31
|
-
/** Also read a Python-repr key (`{'__kind': 'flashcard_set'}`) — text contexts only (K4). */
|
|
32
|
-
python?: boolean;
|
|
33
|
-
/** Also read a typographic-quoted key (`“__kind”`, `‘__kind’`) — text contexts only (round 8). */
|
|
34
|
-
smart?: boolean;
|
|
35
|
-
/** Also read an HTML-entity key (`"__kind"`, `"__kind"`) — text contexts only (round 8). */
|
|
36
|
-
entity?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Also read a JavaScript object-literal key (`{ __kind: 'flashcard_set' }` —
|
|
39
|
-
* what Node's console prints, a sandbox tool's output) — key position with a
|
|
40
|
-
* quoted value, text contexts only (L-2, round 9).
|
|
41
|
-
*/
|
|
42
|
-
js?: boolean;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* EVERY spelling of the key a reader still sees as `__kind` (owner ruling,
|
|
46
|
-
* round 8): literal, `\u005f`-escaped, markdown-escaped `\_\_kind`,
|
|
47
|
-
* backslash-escaped quotes `\"__kind\"`, zero-width characters anywhere in
|
|
48
|
-
* the key, Python repr `'__kind'`, typographic quotes `“__kind”` and HTML
|
|
49
|
-
* entities `"__kind"`. THE options every TEXT context (prose,
|
|
50
|
-
* titles, exports, previews, the screen scan) passes; JSON contexts keep the
|
|
51
|
-
* default, where those spellings are string VALUES (and `valueCarriesKind`
|
|
52
|
-
* reads the strings with this set).
|
|
53
|
-
*/
|
|
54
|
-
export declare const ALL_KIND_SPELLINGS: Readonly<KindTextOptions>;
|
|
55
|
-
/**
|
|
56
|
-
* THE CONVERSION BOUNDARY (owner ruling, round 10): only REAL JSON is ever
|
|
57
|
-
* converted — the literal key, its `\u005f` escapes, the markdown-escaped
|
|
58
|
-
* `"\_\_kind"` (markdown draws it as the literal key) and zero-width characters
|
|
59
|
-
* inside the key. Every other spelling in free text (backslash-escaped
|
|
60
|
-
* `\"__kind\"` in prose, Python repr, a JavaScript literal, typographic quotes,
|
|
61
|
-
* entities) is DETECTION ONLY: the leak sentinel reports it, every renderer,
|
|
62
|
-
* converter, label and export leaves it exactly as written. Real output emits
|
|
63
|
-
* JSON; guessing at free text dropped and reordered people's words (rounds 8–9).
|
|
64
|
-
* A kind held as a JSON STRING inside JSON is read by parsing (`textCarriesKind`).
|
|
65
|
-
*/
|
|
66
|
-
export declare const JSON_KIND_SPELLINGS: Readonly<KindTextOptions>;
|
|
67
|
-
/** Whether text holds the key spelled as real JSON (`JSON_KIND_SPELLINGS`). */
|
|
68
|
-
export declare function hasJsonKindKey(source: string): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Whether text holds the key ONLY in a detection-only spelling (round 10):
|
|
71
|
-
* a spelling the sentinel reports and no renderer converts.
|
|
72
|
-
*/
|
|
73
|
-
export declare function hasDetectionOnlyKindKey(source: string): boolean;
|
|
74
|
-
/** The text without zero-width characters (unchanged — same string — when it has none). */
|
|
75
|
-
export declare function withoutZeroWidth(text: string): string;
|
|
76
|
-
/** Whether a fence language is JSON5 (the one context that widens the key rule). */
|
|
77
|
-
export declare function isJson5Language(lang: string | null | undefined): boolean;
|
|
78
|
-
export declare function hasKindKey(source: string, options?: KindTextOptions): boolean;
|
|
79
|
-
/**
|
|
80
|
-
* EXOTIC spellings (owner ruling, round 9): double HTML entities
|
|
81
|
-
* (`&quot;`), `_` underscores, upper-case / padded entities, fullwidth
|
|
82
|
-
* quotes, bidi marks, invisible operators and combining joiners inside the key.
|
|
83
|
-
* DETECTION ONLY — the leak sentinel and the frame judge report them; no
|
|
84
|
-
* renderer converts them (an adversarial spelling is a defect to see, not a
|
|
85
|
-
* shape to guess at).
|
|
86
|
-
*/
|
|
87
|
-
export declare function hasExoticKindKey(text: string): boolean;
|
|
88
|
-
/** Whether TEXT holds the key in ANY spelling a reader sees as `__kind` (round 8). */
|
|
89
|
-
export declare function hasKindKeyAnySpelling(source: string): boolean;
|
|
90
|
-
/** Whether a `__kind` value is a readable slug (ruling (c): anything else is broken output). */
|
|
91
|
-
export declare function isKindSlug(value: unknown): value is string;
|
|
92
|
-
/**
|
|
93
|
-
* The first complete `__kind` slug in the text, or null. For a LOADER only —
|
|
94
|
-
* which kind's skeleton to show while the region arrives. Never an identity:
|
|
95
|
-
* the parser owns which kind a region actually is.
|
|
96
|
-
*/
|
|
97
|
-
export declare function firstKindSlug(source: string, options?: KindTextOptions): string | null;
|
|
98
|
-
export declare function endsInPartialKindKey(text: string): boolean;
|
|
99
|
-
/**
|
|
100
|
-
* The text after any LEADING JSONC comments and whitespace (`// note`,
|
|
101
|
-
* `/* … *\/`) — a ```jsonc / ```json / unlabelled fence that opens with a
|
|
102
|
-
* comment still decides on its first key (X3). An unterminated leading
|
|
103
|
-
* comment (still arriving) leaves nothing: undecided, never raw.
|
|
104
|
-
*/
|
|
105
|
-
export declare function withoutLeadingJsonComments(text: string): string;
|
|
106
|
-
export declare function jsonKindSignal(text: string | null | undefined, options?: KindTextOptions): JsonKindSignal;
|
|
107
|
-
/**
|
|
108
|
-
* A ```json5 body as plain JSON, when the difference is only what JSON5 adds
|
|
109
|
-
* that models actually write: comments, unquoted identifier keys, single-quoted
|
|
110
|
-
* keys/strings and trailing commas. Null when the result still will not parse.
|
|
111
|
-
*/
|
|
112
|
-
export declare function json5AsJson(text: string): string | null;
|
|
113
|
-
/**
|
|
114
|
-
* A Python repr of a dict/list (`{'__kind': 'flashcard_set', 'ok': True}`) as
|
|
115
|
-
* JSON text, or null when it is not one. Strings may be single- or
|
|
116
|
-
* double-quoted; `True` / `False` / `None` become JSON literals.
|
|
117
|
-
*/
|
|
118
|
-
export declare function pythonReprAsJson(text: string): string | null;
|
|
119
|
-
/** Whether text holds a Python-repr `'__kind'` key (key position, quoted value). */
|
|
120
|
-
export declare function hasPythonKindKey(text: string): boolean;
|
|
121
|
-
/** Where the Python-repr value opening at `start` (`{` or `[`) closes (exclusive), or null. */
|
|
122
|
-
export declare function pythonBalancedEnd(text: string, start: number): number | null;
|
|
123
|
-
/**
|
|
124
|
-
* THE ONE SPELLING NORMALIZER (K4 round 7, widened round 8, rebuilt round 9).
|
|
125
|
-
* Every text detector, converter and label function runs it (directly, or
|
|
126
|
-
* through `hasKindKeyAnySpelling`) so a kind spelled any REALISTIC way the
|
|
127
|
-
* screen still reads as a kind converts like any other. Each spelled region —
|
|
128
|
-
* from the `{` that owns the key to where its own grammar ends — is rewritten
|
|
129
|
-
* as canonical JSON:
|
|
130
|
-
*
|
|
131
|
-
* zero-width in the key · HTML entities · typographic quotes ·
|
|
132
|
-
* backslash-escaped quotes (any depth) · markdown-escaped `\_` · Python repr ·
|
|
133
|
-
* JavaScript object literal — and any combination of them in one key
|
|
134
|
-
*
|
|
135
|
-
* DO NO HARM (owner ruling, round 9): only characters INSIDE a matched region
|
|
136
|
-
* change (a zero-width character only inside the key itself), a region never
|
|
137
|
-
* reaches past the point where its grammar breaks (an unclosed region in prose
|
|
138
|
-
* ends there and the text after it stays), and the scan is one linear pass.
|
|
139
|
-
* Quoted source (inline code, non-JSON fences) stays as written, and a WHOLE
|
|
140
|
-
* JSON text is never rewritten (a spelling inside it is a string VALUE).
|
|
141
|
-
* Text with no non-canonical spelling comes back as the same string.
|
|
142
|
-
*/
|
|
143
|
-
export declare function normalizeKindSpellings(source: string): string;
|
|
144
|
-
/** How a kind key is spelled — which decoders turn its region into JSON. */
|
|
145
|
-
export type KindSpellingFamily = "lifted" | "escaped" | "markdown" | "python" | "smart" | "entity" | "js";
|
|
146
|
-
/**
|
|
147
|
-
* A kind region in a REALISTIC spelling (round 9). `[start, end)` is the raw
|
|
148
|
-
* region (`{` to where its grammar ended); `[rewriteStart, rewriteEnd)` is what
|
|
149
|
-
* the normalizer replaces (the key alone for a literal key holding only a
|
|
150
|
-
* zero-width character). `status`: `complete` (balanced), `prefix` (still
|
|
151
|
-
* arriving — runs to the end of the text) or `broken` (its grammar failed at
|
|
152
|
-
* `end`; the text after it is NOT part of it). `decoded` is the region's text
|
|
153
|
-
* with its spelling undone (still Python / JS for those families).
|
|
154
|
-
*/
|
|
155
|
-
export interface KindSpellingRegion {
|
|
156
|
-
start: number;
|
|
157
|
-
end: number;
|
|
158
|
-
rewriteStart: number;
|
|
159
|
-
rewriteEnd: number;
|
|
160
|
-
family: KindSpellingFamily;
|
|
161
|
-
status: "complete" | "prefix" | "broken";
|
|
162
|
-
decoded: string;
|
|
163
|
-
/** Whether the key carried the markdown `\_` (the region was markdown-decoded). */
|
|
164
|
-
markdown: boolean;
|
|
165
|
-
/** A literal key's canonical text (the normalizer's whole rewrite for that family). */
|
|
166
|
-
keyText?: string;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* A cheap pre-check every scanner runs first: no key spelling can exist
|
|
170
|
-
* without `kind` (or a zero-width character splitting it). Linear, no regex
|
|
171
|
-
* restarts — the plain text of every frame pays only this.
|
|
172
|
-
*/
|
|
173
|
-
export declare function mayHoldKindKey(text: string): boolean;
|
|
174
|
-
/**
|
|
175
|
-
* THE ONE LINEAR SCAN for kind regions in a realistic spelling (round 9):
|
|
176
|
-
* every candidate is found from a `kind` occurrence, its owning `{` from a
|
|
177
|
-
* forward-only brace cursor, quoted source once, and each region is decoded
|
|
178
|
-
* and bounded by its own grammar in work proportional to its length. Regions
|
|
179
|
-
* are returned in order and never overlap; a region's inner keys belong to it.
|
|
180
|
-
* A key whose `{` grammar fails BEFORE the key is not a region (prose braces).
|
|
181
|
-
*/
|
|
182
|
-
export declare function scanKindSpellingRegions(text: string, options?: {
|
|
183
|
-
families?: "json" | "all";
|
|
184
|
-
from?: number;
|
|
185
|
-
}): KindSpellingRegion[];
|
|
186
|
-
/**
|
|
187
|
-
* Past this many characters an open bare-JSON region is not re-read for a
|
|
188
|
-
* prose break (a hot-path budget: the check is linear in the region, run per
|
|
189
|
-
* line / fragment). A fragment that breaks into prose does so within its first
|
|
190
|
-
* lines; a long region is real JSON streaming.
|
|
191
|
-
*/
|
|
192
|
-
export declare const BARE_REGION_GRAMMAR_BUDGET = 16384;
|
|
193
|
-
/**
|
|
194
|
-
* Whether an open bare-JSON region's text has BROKEN INTO PROSE by its own JSON
|
|
195
|
-
* grammar (round 10, C1): `{"status": "ok", "items": [` then a line of words,
|
|
196
|
-
* `{\"__kind\":…} and the rest`, `{ some code`. Such a region was never JSON:
|
|
197
|
-
* it reads as text. THE one answer the live accumulator (per line, budgeted)
|
|
198
|
-
* and the reload splitter (whole region, `firstBudget` — the same first 16 KB
|
|
199
|
-
* the live check reads) share, so live ≡ reload (round 11, H1). A region still
|
|
200
|
-
* validly open (or complete) is not broken.
|
|
201
|
-
*/
|
|
202
|
-
export declare function bareRegionBreaksIntoProse(text: string, options?: {
|
|
203
|
-
firstBudget?: boolean;
|
|
204
|
-
}): boolean;
|
|
205
|
-
/**
|
|
206
|
-
* Where a LITERAL kind object (`text` opens at its `{`) breaks into prose —
|
|
207
|
-
* `{"__kind":"note","title":"Hi" and then…` — after its key: the end of the
|
|
208
|
-
* region, or null (complete, still arriving, or merely malformed). THE one
|
|
209
|
-
* answer the converters, the prose leaf and the live accumulator share, so a
|
|
210
|
-
* settled unclosed object reads the same live and reloaded (L-4, round 9).
|
|
211
|
-
*/
|
|
212
|
-
export declare function kindObjectProseBreak(text: string): number | null;
|
|
213
|
-
/** Which JSON-like grammar bounds a region: strict JSON, Python repr, or a JavaScript literal. */
|
|
214
|
-
export type GrammarDialect = "json" | "python" | "js";
|
|
215
|
-
export type KindGrammarVerdict = {
|
|
216
|
-
status: "complete";
|
|
217
|
-
end: number;
|
|
218
|
-
} | {
|
|
219
|
-
status: "prefix";
|
|
220
|
-
} | {
|
|
221
|
-
status: "broken";
|
|
222
|
-
at: number;
|
|
223
|
-
cut: number;
|
|
224
|
-
prose: boolean;
|
|
225
|
-
};
|
|
226
|
-
/**
|
|
227
|
-
* Where a JSON-like value opening at 0 ends by its OWN grammar (H-1, round 9):
|
|
228
|
-
* `complete` at its balanced close, `prefix` when the text ends while it is
|
|
229
|
-
* still valid (arriving), or `broken` at the first character that cannot
|
|
230
|
-
* continue it — `cut` is the end of the last whole token before that (after a
|
|
231
|
-
* value, a `,`, or an opener), so the text after `cut` is never part of it.
|
|
232
|
-
* A raw newline inside a string breaks it (JSON strings never hold one), so an
|
|
233
|
-
* unclosed string never runs past its line. One pass, no allocation per char.
|
|
234
|
-
*/
|
|
235
|
-
export declare function kindGrammar(s: string, dialect?: GrammarDialect, from?: number): KindGrammarVerdict;
|
|
236
|
-
/** A complete region as JSON text (Python / JS converted), or null when it will not read. */
|
|
237
|
-
export declare function regionJson(region: Pick<KindSpellingRegion, "family" | "decoded">): string | null;
|
|
238
|
-
/**
|
|
239
|
-
* A BROKEN (settled, unclosed) region closed where its grammar ended: a
|
|
240
|
-
* dangling `,` or `key:` dropped, every open container closed — the reading
|
|
241
|
-
* the label is drawn from. Null when even that will not read.
|
|
242
|
-
*/
|
|
243
|
-
export declare function closedJson(region: Pick<KindSpellingRegion, "family" | "decoded">): string | null;
|
|
244
|
-
/**
|
|
245
|
-
* The VALUE form of the same question, for renderers handed parsed data
|
|
246
|
-
* instead of text (the value grid, the JSON viewers): does this value carry a
|
|
247
|
-
* kind anywhere — an object with a string `__kind`, at any depth, or a string
|
|
248
|
-
* that holds a kind REGION (`textCarriesKind`: whole kind JSON, or prose with
|
|
249
|
-
* a kind in it — a ```json fence, inline JSON — outside quoted source)? A raw
|
|
250
|
-
* renderer that answers yes renders the value through the one value door
|
|
251
|
-
* (`AnswerValueView`) instead.
|
|
252
|
-
*/
|
|
253
|
-
export declare function valueCarriesKind(value: unknown): boolean;
|
|
254
|
-
/**
|
|
255
|
-
* A STRING value that holds a kind region (H1, round 5): text that is kind
|
|
256
|
-
* JSON, or prose with a kind region in it by THE markdown definition
|
|
257
|
-
* (`markdownCarriesKind` — outside quoted source, markdown-escaped key too).
|
|
258
|
-
* `{answer: "Here are your cards: ```json {…kind…}```"}` carries its kind.
|
|
259
|
-
*/
|
|
260
|
-
export declare function textCarriesKind(text: string): boolean;
|
|
261
|
-
/**
|
|
262
|
-
* Text that IS a JSON object/array carrying a `__kind` key (not prose
|
|
263
|
-
* mentioning one) — the gate before a `JSON.parse` of the whole text. For
|
|
264
|
-
* "does this string hold a kind anywhere", read `textCarriesKind`.
|
|
265
|
-
*/
|
|
266
|
-
export declare function isKindJsonText(text: string): boolean;
|
|
267
|
-
/** The kind slug a value claims for itself at its root, or null. */
|
|
268
|
-
export declare function rootKindSlug(value: unknown): string | null;
|
|
269
|
-
/** Whether a fence's language makes its body a JSON region (any case; none counts). */
|
|
270
|
-
export declare function isJsonFenceLanguage(lang: string | null | undefined): boolean;
|
|
271
|
-
/**
|
|
272
|
-
* Where a kind in markdown is the model QUOTING SOURCE, never data (the
|
|
273
|
-
* owner's ruling, 2026-09-30): inside an inline code span, or inside a fence
|
|
274
|
-
* whose language is not JSON (```ts, ```xml, ```markdown …). Everything else
|
|
275
|
-
* — prose, a blockquote, a list item, a table cell, a 4-space indented block,
|
|
276
|
-
* a JSON fence — is data. [start, end) spans, in order. THE one definition:
|
|
277
|
-
* the splitter, the live accumulator and the leaf gate all read it, so a leaf
|
|
278
|
-
* and the pipeline can never disagree about what is a kind region.
|
|
279
|
-
*/
|
|
280
|
-
export declare function quotedSourceRanges(text: string): Array<[number, number]>;
|
|
281
|
-
/**
|
|
282
|
-
* Whether an XML card SHOWS SOURCE (the owner's rulings, round 3): a ```xml
|
|
283
|
-
* FENCE is the model quoting source — a kind inside it stays as written (a).
|
|
284
|
-
* An XML TAG the model wraps content in (`<answer>`, `<output>`, any generic
|
|
285
|
-
* tag, closed or not) is STRUCTURE (b): the splitter and the accumulator mark
|
|
286
|
-
* every piece of it `genericXmlContainer`, and a kind inside its prose renders
|
|
287
|
-
* as the kind. THE one answer — XmlBlock's callers and the frame judge read it.
|
|
288
|
-
*/
|
|
289
|
-
export declare function isQuotedSourceXmlBlock(block: {
|
|
290
|
-
metadata?: Record<string, unknown> | null;
|
|
291
|
-
}): boolean;
|
|
292
|
-
/**
|
|
293
|
-
* Where the front matter that opens `source` ends (0 when none): an optional
|
|
294
|
-
* byte-order mark, a first line that is exactly `---` or `+++`, through the
|
|
295
|
-
* same fence (YAML also `...`). Front matter is document properties, never
|
|
296
|
-
* content — a `{"__kind":…}` VALUE inside it is never a kind block, in the
|
|
297
|
-
* static splitter or the live accumulator (RC-B3r round 3, C1).
|
|
298
|
-
*/
|
|
299
|
-
export declare function frontMatterEnd(source: string): number;
|
|
300
|
-
/**
|
|
301
|
-
* The MARKDOWN form: does this prose hold a kind REGION — a `__kind` key
|
|
302
|
-
* anywhere outside quoted source (see `quotedSourceRanges`)? A leaf that
|
|
303
|
-
* answers yes hands the text to the pipeline (`MarkdownStream`), which lifts
|
|
304
|
-
* the region by the same definition — prose, table cell, indented block,
|
|
305
|
-
* blockquote, JSON fence, or the whole text being kind JSON.
|
|
306
|
-
*/
|
|
307
|
-
export declare function markdownCarriesKind(source: string): boolean;
|