@ai-matrx/chat 0.4.10 → 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 +36 -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/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/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/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/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 +23 -6
- 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
|
@@ -11,7 +11,7 @@ import { cn } from "@ai-matrx/design-system";
|
|
|
11
11
|
import { useAppDispatch, useAppSelector } from "../../store/hooks.js";
|
|
12
12
|
import { smartExecute } from "../../agents/redux/execution-system/thunks/smart-execute.thunk.js";
|
|
13
13
|
import { openOverlay, CHAT_WINDOWS } from "../../host/windows.js";
|
|
14
|
-
import { ShimmerText } from "
|
|
14
|
+
import { ShimmerText } from "@ai-matrx/rich-content/utils/lifted/ShimmerText";
|
|
15
15
|
import {
|
|
16
16
|
getInlineRenderer,
|
|
17
17
|
getToolDisplayName,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { Aperture, ImageIcon } from "lucide-react";
|
|
5
|
-
import
|
|
5
|
+
import MarkdownStream from "../../../ui/markdown-stream/MarkdownStream.js";
|
|
6
6
|
import { useAppSelector } from "../../../store/hooks.js";
|
|
7
7
|
import { selectAgentCallChildStream } from "../../../agents/redux/execution-system/active-requests/active-requests.selectors.js";
|
|
8
8
|
import { GenericRenderer } from "../../registry/GenericRenderer.js";
|
|
@@ -7,7 +7,7 @@ import { useAppSelector } from "../../../store/hooks.js";
|
|
|
7
7
|
import { selectAgentCallChildStream } from "../../../agents/redux/execution-system/active-requests/active-requests.selectors.js";
|
|
8
8
|
import { useConversationTitle } from "../../../agents/hooks/useConversationTitle.js";
|
|
9
9
|
import { EntityRef } from "../../../host/ui-slots.js";
|
|
10
|
-
import
|
|
10
|
+
import MarkdownStream from "../../../ui/markdown-stream/MarkdownStream.js";
|
|
11
11
|
import { AnswerValueView } from "../../../host/ui-slots.js";
|
|
12
12
|
import { stripThinkingStreaming } from "@ai-matrx/kit/text";
|
|
13
13
|
import { cn } from "@ai-matrx/design-system";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { kindTextLabel } from "
|
|
2
|
-
import { deriveInstanceTitle } from "
|
|
3
|
-
import { humanizeKind } from "
|
|
1
|
+
import { kindTextLabel } from "@ai-matrx/content-ir/surfaces";
|
|
2
|
+
import { deriveInstanceTitle } from "@ai-matrx/content-ir/surfaces";
|
|
3
|
+
import { humanizeKind } from "@ai-matrx/content-ir/surfaces";
|
|
4
4
|
import { getCollabCallInfo } from "./collab.js";
|
|
5
5
|
const MAX = 90;
|
|
6
6
|
function valueLabel(value) {
|
|
@@ -7,7 +7,7 @@ import { GenericRenderer } from "../../registry/GenericRenderer.js";
|
|
|
7
7
|
import { ToolErrorCard } from "../../result-fields/ToolErrorCard.js";
|
|
8
8
|
import { humanizeEnumValue } from "../../result-fields/shape.js";
|
|
9
9
|
import { ToolResultCard } from "../_shared-entity/ToolResultCard.js";
|
|
10
|
-
import { catalogProseText } from "
|
|
10
|
+
import { catalogProseText } from "@ai-matrx/content-ir/surfaces";
|
|
11
11
|
const SKILL_ICON_TINT = "text-violet-600 dark:text-violet-400";
|
|
12
12
|
function humanType(raw) {
|
|
13
13
|
if (typeof raw !== "string" || !raw) return null;
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
useStructuredDocumentPresentation
|
|
16
16
|
} from "./document-presentation.js";
|
|
17
17
|
import { KindValueNode } from "./KindValueNode.js";
|
|
18
|
-
import { rootKindSlug } from "
|
|
18
|
+
import { rootKindSlug } from "@ai-matrx/content-ir/surfaces";
|
|
19
19
|
import { useReportKindAtRawRenderer } from "@ai-matrx/rich-content/utils/report-kind-at-raw-renderer";
|
|
20
20
|
import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
|
|
21
21
|
import { Button } from "@ai-matrx/design-system/controls";
|
|
@@ -16,7 +16,7 @@ import { ShortId, IdListChip } from "./ShortId.js";
|
|
|
16
16
|
import { KindValueNode } from "./KindValueNode.js";
|
|
17
17
|
import { ResultRecordRef } from "./ResultRecordRef.js";
|
|
18
18
|
import { TextWithDoors } from "../../host/ui-slots.js";
|
|
19
|
-
import { valueCarriesKind } from "
|
|
19
|
+
import { valueCarriesKind } from "@ai-matrx/content-ir/surfaces";
|
|
20
20
|
import { useReportKindAtRawRenderer } from "@ai-matrx/rich-content/utils/report-kind-at-raw-renderer";
|
|
21
21
|
import { Button } from "@ai-matrx/design-system/controls";
|
|
22
22
|
const INLINE_MAX_DEPTH = 2;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
markdownCarriesKind,
|
|
10
10
|
rootKindSlug,
|
|
11
11
|
valueCarriesKind
|
|
12
|
-
} from "
|
|
12
|
+
} from "@ai-matrx/content-ir/surfaces";
|
|
13
13
|
import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
|
|
14
14
|
const hasMarkdownTable = (value) => findTableStart(value.split("\n")) !== -1;
|
|
15
15
|
function isPlainObject(value) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { humanizeKind } from "
|
|
1
|
+
import { humanizeKind } from "@ai-matrx/content-ir/surfaces";
|
|
2
2
|
import {
|
|
3
3
|
firstKindSlug,
|
|
4
4
|
jsonKindSignal
|
|
5
|
-
} from "
|
|
5
|
+
} from "@ai-matrx/content-ir/surfaces";
|
|
6
6
|
import { displayNameFromToolEvents } from "./toolDisplayName.js";
|
|
7
7
|
function parseOutput(raw) {
|
|
8
8
|
if (!raw) return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { kindValueToMarkdown } from "
|
|
2
|
-
import { valueCarriesKind } from "
|
|
3
|
-
import { kindTextToMarkdown } from "
|
|
1
|
+
import { kindValueToMarkdown } from "@ai-matrx/content-ir/surfaces";
|
|
2
|
+
import { valueCarriesKind } from "@ai-matrx/content-ir/surfaces";
|
|
3
|
+
import { kindTextToMarkdown } from "@ai-matrx/content-ir/surfaces";
|
|
4
4
|
function prettyJson(value) {
|
|
5
5
|
try {
|
|
6
6
|
return JSON.stringify(value, null, 2);
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* HERE at ingress with runtime validation — never a cast on the row.
|
|
32
32
|
*/
|
|
33
33
|
import type { Json } from "../../host/db-types.js";
|
|
34
|
-
import { type JsonObject } from "
|
|
34
|
+
import { type JsonObject } from "@ai-matrx/rich-content/utils/json";
|
|
35
35
|
import type { ValueMapping } from "../../surfaces/types.js";
|
|
36
36
|
import type { AnyMandateKey } from "@ai-matrx/agents/mandates";
|
|
37
37
|
/** Kind slugs whose values are prompt-substitutable scalars. Anything else
|
|
@@ -14,7 +14,7 @@ function MaybeSourceEdit({ source, save, children }) {
|
|
|
14
14
|
return /* @__PURE__ */ jsx(OptionalMarkdownSourceEditProvider, { source, save, children });
|
|
15
15
|
}
|
|
16
16
|
import { RichCopySplit } from "../../agent-copy/RichCopySplit.js";
|
|
17
|
-
import { ShimmerText } from "
|
|
17
|
+
import { ShimmerText } from "@ai-matrx/rich-content/utils/lifted/ShimmerText";
|
|
18
18
|
import {
|
|
19
19
|
RunJobWorkingLine,
|
|
20
20
|
useIsRunJob
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type JsonObject, type JsonValue } from "
|
|
1
|
+
import { type JsonObject, type JsonValue } from "@ai-matrx/rich-content/utils/json";
|
|
2
2
|
import type { ResultDisplayMode } from "../agents/utils/run-ui-utils.js";
|
|
3
3
|
import type { VariablesPanelStyle } from "../agents/components/inputs/variable-input-variations/variable-input-options.js";
|
|
4
4
|
import type { WritePolicyMap } from "../surfaces/types.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
setContextEntry
|
|
29
29
|
} from "../../agents/redux/execution-system/instance-context/instance-context.slice.js";
|
|
30
30
|
import { MANDATE_KEYS } from "@ai-matrx/agents/mandates";
|
|
31
|
-
import { kindTextToMarkdown } from "
|
|
31
|
+
import { kindTextToMarkdown } from "@ai-matrx/content-ir/surfaces";
|
|
32
32
|
const VOICE_COMMUNICATOR_MANDATE_KEY = MANDATE_KEYS.voice__communicator;
|
|
33
33
|
const NARRATION_DELAY_MS = 2500;
|
|
34
34
|
registerCommunicationLedgerTool();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/chat",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "THE one AI Matrx person-to-agent chat system: the full chat (running agents, conversations, tool calls, streaming, context, surfaces, voice) as per-module subpaths @ai-matrx/chat/<domain>/<module> over a host contract (/host, /host/react) whose only required value is a db; plus the kernel compatibility entries (., /external-store, /matrx, /react, /tools, styles.css, tokens.css) until P28.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -229,23 +229,23 @@
|
|
|
229
229
|
"@ai-matrx/agents": "latest",
|
|
230
230
|
"@ai-matrx/alchemy": "latest",
|
|
231
231
|
"@ai-matrx/associations": "latest",
|
|
232
|
-
"@ai-matrx/canvas": "latest",
|
|
233
232
|
"@ai-matrx/browser-audio": "latest",
|
|
234
233
|
"@ai-matrx/content-ir": "latest",
|
|
235
|
-
"@ai-matrx/
|
|
234
|
+
"@ai-matrx/canvas": "latest",
|
|
236
235
|
"@ai-matrx/data": "latest",
|
|
236
|
+
"@ai-matrx/content-ir-react": "latest",
|
|
237
237
|
"@ai-matrx/design-system": "latest",
|
|
238
238
|
"@ai-matrx/diff": "latest",
|
|
239
239
|
"@ai-matrx/icons": "latest",
|
|
240
240
|
"@ai-matrx/kit": "latest",
|
|
241
241
|
"@ai-matrx/media": "latest",
|
|
242
|
-
"@ai-matrx/print": "latest",
|
|
243
242
|
"@ai-matrx/realtime": "latest",
|
|
244
|
-
"@ai-matrx/records": "latest",
|
|
245
243
|
"@ai-matrx/records-ui": "latest",
|
|
246
244
|
"@ai-matrx/rich-content": "latest",
|
|
245
|
+
"@ai-matrx/print": "latest",
|
|
246
|
+
"@ai-matrx/rich-editor": "latest",
|
|
247
247
|
"@ai-matrx/tap-target": "latest",
|
|
248
|
-
"@ai-matrx/
|
|
248
|
+
"@ai-matrx/records": "latest"
|
|
249
249
|
},
|
|
250
250
|
"devDependencies": {
|
|
251
251
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
@@ -303,6 +303,23 @@
|
|
|
303
303
|
"optional": true
|
|
304
304
|
}
|
|
305
305
|
},
|
|
306
|
+
"matrx": {
|
|
307
|
+
"charter": "The whole person-to-agent chat.",
|
|
308
|
+
"owns": [
|
|
309
|
+
"running agents",
|
|
310
|
+
"conversations",
|
|
311
|
+
"tool calls",
|
|
312
|
+
"streaming",
|
|
313
|
+
"context",
|
|
314
|
+
"voice"
|
|
315
|
+
],
|
|
316
|
+
"mustNotOwn": [
|
|
317
|
+
"another package's logic",
|
|
318
|
+
"a second chat (src/compat, retiring)",
|
|
319
|
+
"its own host-slot copies"
|
|
320
|
+
],
|
|
321
|
+
"layer": 9
|
|
322
|
+
},
|
|
306
323
|
"scripts": {
|
|
307
324
|
"build": "pnpm --filter @ai-matrx/rich-editor build && pnpm clean && tsup && node ./scripts/copy-css.mjs && node ./scripts/tsc-own.mjs -p tsconfig.build.json && node ./scripts/finish-build.mjs",
|
|
308
325
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface UseWarmAgentOptions {
|
|
2
|
-
/** Pass true when the id is an agx_version id rather than an agent.definition id. */
|
|
3
|
-
isVersion?: boolean;
|
|
4
|
-
/** Skip warming entirely (e.g. when the id isn't ready yet). */
|
|
5
|
-
enabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function useWarmAgent(agentId: string | null | undefined, { isVersion, enabled }?: UseWarmAgentOptions): void;
|
|
8
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
import { useAppSelector } from "../../store/hooks.js";
|
|
4
|
-
import { selectResolvedBaseUrl } from "../../host/server/api-config.js";
|
|
5
|
-
import { warmAgent } from "@ai-matrx/agents/matrx";
|
|
6
|
-
function useWarmAgent(agentId, { isVersion = false, enabled = true } = {}) {
|
|
7
|
-
const baseUrl = useAppSelector(
|
|
8
|
-
selectResolvedBaseUrl
|
|
9
|
-
);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (!enabled || !agentId || !baseUrl) return void 0;
|
|
12
|
-
const fire = () => warmAgent(agentId, { baseUrl, isVersion });
|
|
13
|
-
const ric = typeof window !== "undefined" ? window.requestIdleCallback : void 0;
|
|
14
|
-
const cancel = typeof window !== "undefined" ? window.cancelIdleCallback : void 0;
|
|
15
|
-
if (ric) {
|
|
16
|
-
const handle2 = ric(fire, { timeout: 2e3 });
|
|
17
|
-
return () => cancel?.(handle2);
|
|
18
|
-
}
|
|
19
|
-
const handle = window.setTimeout(fire, 500);
|
|
20
|
-
return () => window.clearTimeout(handle);
|
|
21
|
-
}, [agentId, baseUrl, isVersion, enabled]);
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
useWarmAgent
|
|
25
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* isMaterializedArtifactId — the R3 recognition primitive.
|
|
3
|
-
*
|
|
4
|
-
* An `<artifact>` (and every artifact renderer) carries an `id` that is EITHER:
|
|
5
|
-
* - a real `canvas_items` UUID → the artifact is MATERIALIZED (persisted). The
|
|
6
|
-
* UI renders the live row by id; data-touching types (tasks) can link/convert
|
|
7
|
-
* against the stable artifact id.
|
|
8
|
-
* - the model's own `artifact_N` (or a splitter fallback like `artifact-3`, or
|
|
9
|
-
* nothing) → NOT yet materialized → render inline; it's a materialization
|
|
10
|
-
* candidate, not a known artifact.
|
|
11
|
-
*
|
|
12
|
-
* This single UUID-shape test is what makes the whole system safe (vision R3):
|
|
13
|
-
* it does NOT matter whether the model ever learns to emit the shape — a
|
|
14
|
-
* non-UUID id is always treated as "new / unmaterialized", a UUID as "this exact
|
|
15
|
-
* persisted artifact." Used by the renderers (render-by-id vs inline) and by
|
|
16
|
-
* materialization (skip-already-materialized vs create-new).
|
|
17
|
-
*
|
|
18
|
-
* See `/Users/armanisadeghi/code/common-docs/systems/publish/artifacts/VISION.md` (R1–R3).
|
|
19
|
-
*/
|
|
20
|
-
/** True only for a canonical UUID — i.e. a real, persisted `canvas_items.id`. */
|
|
21
|
-
export declare function isMaterializedArtifactId(id?: string | null): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* readArtifactPointerId — the pointer-shape reader.
|
|
24
|
-
*
|
|
25
|
-
* A canvas item whose artifact has been MATERIALIZED stores only a POINTER in
|
|
26
|
-
* `content.data`: `{ artifactId }`. The body lives in the `canvas_items` row.
|
|
27
|
-
* Anything that consumes `content.data` (render, share, export) must recognise
|
|
28
|
-
* that shape instead of treating the pointer as the content — publishing a
|
|
29
|
-
* pointer produces a page with nothing in it.
|
|
30
|
-
*
|
|
31
|
-
* Returns the materialized artifact UUID, or undefined when `data` is real
|
|
32
|
-
* content (string, or an object that is not a pointer).
|
|
33
|
-
*/
|
|
34
|
-
export declare function readArtifactPointerId(data: unknown): string | undefined;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isUuidShape } from "@ai-matrx/kit/uuid";
|
|
2
|
-
function isMaterializedArtifactId(id) {
|
|
3
|
-
return typeof id === "string" && isUuidShape(id.trim());
|
|
4
|
-
}
|
|
5
|
-
function readArtifactPointerId(data) {
|
|
6
|
-
if (typeof data !== "object" || data === null) return void 0;
|
|
7
|
-
if (!("artifactId" in data)) return void 0;
|
|
8
|
-
const id = data.artifactId;
|
|
9
|
-
if (typeof id !== "string") return void 0;
|
|
10
|
-
return isMaterializedArtifactId(id) ? id : void 0;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
isMaterializedArtifactId,
|
|
14
|
-
readArtifactPointerId
|
|
15
|
-
};
|
package/dist/ui/ShimmerText.d.ts
DELETED
package/dist/ui/ShimmerText.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "@ai-matrx/design-system";
|
|
4
|
-
function ShimmerText({ text, className }) {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
-
"span",
|
|
7
|
-
{
|
|
8
|
-
className: cn(
|
|
9
|
-
"inline-block bg-clip-text text-transparent bg-[length:200%_100%] animate-shimmer",
|
|
10
|
-
className
|
|
11
|
-
),
|
|
12
|
-
style: {
|
|
13
|
-
backgroundImage: "linear-gradient(90deg, hsl(var(--muted-foreground) / 0.3) 0%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground) / 0.3) 100%)"
|
|
14
|
-
},
|
|
15
|
-
children: text
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
ShimmerText
|
|
21
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* addressWithoutNavigating — THE one way to change the address bar without a
|
|
3
|
-
* navigation (lane URL-STATE, 2026-09-24; born in lane PANEL-REMOUNT).
|
|
4
|
-
*
|
|
5
|
-
* Query state (`?view=`, `?panels=`, `?tab=`, a selected row, a filter) is
|
|
6
|
-
* bookkeeping about the page you are on, never a new page. `router.replace` /
|
|
7
|
-
* `router.push` are App Router NAVIGATIONS: each one fetches a fresh RSC
|
|
8
|
-
* payload for the route (a `?_rsc=` request, a server round trip) and, on
|
|
9
|
-
* commit, can remount the page — measured on /data/[tableId]: one `?_rsc=`
|
|
10
|
-
* request per layout switch, and before PANEL-REMOUNT the whole grid re-read.
|
|
11
|
-
*
|
|
12
|
-
* `history.pushState` / `history.replaceState` are patched by Next's app
|
|
13
|
-
* router: called with a state object that does NOT carry `__NA`, the patch
|
|
14
|
-
* copies Next's own tree state onto the new entry and dispatches a `restore`,
|
|
15
|
-
* so `useSearchParams` / `usePathname` hold the new URL with no server round
|
|
16
|
-
* trip and no remount. Back/forward still work (Next owns the entry).
|
|
17
|
-
*
|
|
18
|
-
* 🚨 This module always passes `null`. Passing `window.history.state` (the
|
|
19
|
-
* old habit) forwards Next's `__NA` marker, which SKIPS the patch: the address
|
|
20
|
-
* bar changes while `useSearchParams` keeps the old value.
|
|
21
|
-
*
|
|
22
|
-
* Use the router for a REAL route change (another page), or when the server
|
|
23
|
-
* component of the current route reads the changed param from `searchParams`
|
|
24
|
-
* — only a navigation re-renders server output. Everything else comes here.
|
|
25
|
-
* Guard: eslint `matrx/no-navigation-for-query-state`.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Replace the current history entry's address. No navigation, no RSC fetch.
|
|
29
|
-
*
|
|
30
|
-
* A HASH-ONLY change skips Next's patch on purpose: nothing Next exposes
|
|
31
|
-
* (`usePathname`, `useSearchParams`, `useParams`) reads the hash, yet the
|
|
32
|
-
* patch's `restore` hands every `useSearchParams` reader a new object, so each
|
|
33
|
-
* write re-rendered all of them. A canvas writing its camera to `#cam=` while
|
|
34
|
-
* panning paid that per write — over a second per pointer move on a board of
|
|
35
|
-
* fifteen heavy tiles, so the board froze while panning (2026-10-01). Forwarding
|
|
36
|
-
* the entry's own state keeps Next's `__NA` tree on it (Back still works).
|
|
37
|
-
*/
|
|
38
|
-
export declare function replaceAddressWithoutNavigating(href: string | URL): void;
|
|
39
|
-
/** Push a new history entry (Back returns to the old address). No navigation, no RSC fetch. */
|
|
40
|
-
export declare function pushAddressWithoutNavigating(href: string | URL): void;
|
|
41
|
-
/**
|
|
42
|
-
* The current path (and hash) carrying `search` as its query — the usual
|
|
43
|
-
* argument for the two writers above. An empty query drops the `?`.
|
|
44
|
-
*/
|
|
45
|
-
export declare function currentPathWithSearch(search: URLSearchParams | string): string;
|
|
46
|
-
/** Just enough of Next's router for the two helpers below (and their tests). */
|
|
47
|
-
export interface AddressRouter {
|
|
48
|
-
push: (href: string, options?: {
|
|
49
|
-
scroll?: boolean;
|
|
50
|
-
}) => void;
|
|
51
|
-
replace: (href: string, options?: {
|
|
52
|
-
scroll?: boolean;
|
|
53
|
-
}) => void;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* For a caller that names its page by a literal path (`/tasks?task=…`) but
|
|
57
|
-
* can also render somewhere else (a window panel over another page): on that
|
|
58
|
-
* page the change is query state, so no navigation; anywhere else it is a real
|
|
59
|
-
* route change, so the router carries it exactly as before (`options` are the
|
|
60
|
-
* router's, passed through unchanged).
|
|
61
|
-
*/
|
|
62
|
-
export declare function replaceAddressOrNavigate(router: AddressRouter, href: string, options?: {
|
|
63
|
-
scroll?: boolean;
|
|
64
|
-
}): void;
|
|
65
|
-
/** The push twin of {@link replaceAddressOrNavigate}. */
|
|
66
|
-
export declare function pushAddressOrNavigate(router: AddressRouter, href: string, options?: {
|
|
67
|
-
scroll?: boolean;
|
|
68
|
-
}): void;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
function currentHref() {
|
|
2
|
-
return `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
3
|
-
}
|
|
4
|
-
function resolve(href) {
|
|
5
|
-
const url = new URL(String(href), window.location.href);
|
|
6
|
-
if (url.origin !== window.location.origin) {
|
|
7
|
-
throw new Error(
|
|
8
|
-
`addressWithoutNavigating: ${url.origin} is another origin; history writes are same-origin only. Navigate instead.`
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
return `${url.pathname}${url.search}${url.hash}`;
|
|
12
|
-
}
|
|
13
|
-
function replaceAddressWithoutNavigating(href) {
|
|
14
|
-
if (typeof window === "undefined") return;
|
|
15
|
-
const next = resolve(href);
|
|
16
|
-
if (next === currentHref()) return;
|
|
17
|
-
const sameDocument = next.split("#")[0] === `${window.location.pathname}${window.location.search}`;
|
|
18
|
-
const state = window.history.state;
|
|
19
|
-
if (sameDocument && isNextEntry(state)) {
|
|
20
|
-
window.history.replaceState(state, "", next);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
window.history.replaceState(null, "", next);
|
|
24
|
-
}
|
|
25
|
-
function isNextEntry(state) {
|
|
26
|
-
return typeof state === "object" && state !== null && ("__NA" in state || "_N" in state);
|
|
27
|
-
}
|
|
28
|
-
function pushAddressWithoutNavigating(href) {
|
|
29
|
-
if (typeof window === "undefined") return;
|
|
30
|
-
const next = resolve(href);
|
|
31
|
-
if (next === currentHref()) return;
|
|
32
|
-
window.history.pushState(null, "", next);
|
|
33
|
-
}
|
|
34
|
-
function currentPathWithSearch(search) {
|
|
35
|
-
const qs = (typeof search === "string" ? search : search.toString()).replace(
|
|
36
|
-
/^\?/,
|
|
37
|
-
""
|
|
38
|
-
);
|
|
39
|
-
if (typeof window === "undefined") return qs ? `?${qs}` : "";
|
|
40
|
-
return `${window.location.pathname}${qs ? `?${qs}` : ""}${window.location.hash}`;
|
|
41
|
-
}
|
|
42
|
-
function isCurrentPath(href) {
|
|
43
|
-
const url = new URL(String(href), window.location.href);
|
|
44
|
-
return url.origin === window.location.origin && url.pathname === window.location.pathname;
|
|
45
|
-
}
|
|
46
|
-
function replaceAddressOrNavigate(router, href, options) {
|
|
47
|
-
if (typeof window !== "undefined" && isCurrentPath(href)) replaceAddressWithoutNavigating(href);
|
|
48
|
-
else router.replace(href, options);
|
|
49
|
-
}
|
|
50
|
-
function pushAddressOrNavigate(router, href, options) {
|
|
51
|
-
if (typeof window !== "undefined" && isCurrentPath(href)) pushAddressWithoutNavigating(href);
|
|
52
|
-
else router.push(href, options);
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
currentPathWithSearch,
|
|
56
|
-
pushAddressOrNavigate,
|
|
57
|
-
pushAddressWithoutNavigating,
|
|
58
|
-
replaceAddressOrNavigate,
|
|
59
|
-
replaceAddressWithoutNavigating
|
|
60
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure envelope helpers the chat package needs (chat-package-move P14): the Phase-2 shadow
|
|
3
|
-
* parity check ("does the envelope, reconstructed, deep-equal what JSON.parse sees?").
|
|
4
|
-
*
|
|
5
|
-
* A COMPARISON, NEVER A TRANSFORM — the one lawful shape of `stripKindDeep` outside the two doors.
|
|
6
|
-
* Markers are removed from BOTH sides, symmetrically, inside this predicate, so a marker the parser
|
|
7
|
-
* INJECTED (speculation / expectedRootKind) is not reported as a mismatch against a source that did
|
|
8
|
-
* not carry one. Only a boolean leaves; neither input is mutated and neither reduced value is ever
|
|
9
|
-
* returned, stored, or rendered (KINDS_EVERYWHERE_PLAN §4.2).
|
|
10
|
-
*/
|
|
11
|
-
import { type CanonicalBlockIR } from "@ai-matrx/content-ir";
|
|
12
|
-
export declare function envelopeMatchesParsedSource(envelope: CanonicalBlockIR, parsedSource: unknown): boolean;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { reconstructRegionValue, stripKindDeep } from "@ai-matrx/content-ir";
|
|
2
|
-
function isRecord(value) {
|
|
3
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4
|
-
}
|
|
5
|
-
function deepEqual(left, right) {
|
|
6
|
-
if (Object.is(left, right)) return true;
|
|
7
|
-
if (Array.isArray(left) && Array.isArray(right)) {
|
|
8
|
-
if (left.length !== right.length) return false;
|
|
9
|
-
for (let i = 0; i < left.length; i++) {
|
|
10
|
-
if (!deepEqual(left[i], right[i])) return false;
|
|
11
|
-
}
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (isRecord(left) && isRecord(right)) {
|
|
15
|
-
const leftKeys = Object.keys(left);
|
|
16
|
-
const rightKeys = Object.keys(right);
|
|
17
|
-
if (leftKeys.length !== rightKeys.length) return false;
|
|
18
|
-
for (const key of leftKeys) {
|
|
19
|
-
if (!(key in right)) return false;
|
|
20
|
-
if (!deepEqual(left[key], right[key])) return false;
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
function envelopeMatchesParsedSource(envelope, parsedSource) {
|
|
27
|
-
if (!isRecord(parsedSource)) return false;
|
|
28
|
-
return deepEqual(stripKindDeep(reconstructRegionValue(envelope)), stripKindDeep(parsedSource));
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
envelopeMatchesParsedSource
|
|
32
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Instance TITLE derivation — pure, importable from server and client code
|
|
3
|
-
* (no supabase import; `instance-service.ts` consumes it on the write path).
|
|
4
|
-
*
|
|
5
|
-
* CROSS-REPO MIRROR: aidream `kind_instance.py` (`_TITLE_KEYS` +
|
|
6
|
-
* `derive_title` + `kind_shared.kind_title_key`) implements the SAME
|
|
7
|
-
* derivation order — explicit title → the kind's `metadata.title_key` field
|
|
8
|
-
* (per-kind override, non-empty scalar) → the shared key list → null.
|
|
9
|
-
* Change BOTH sides together.
|
|
10
|
-
*/
|
|
11
|
-
/** Mirrors aidream `kind_instance._TITLE_KEYS` — keep the two in lockstep. */
|
|
12
|
-
export declare const INSTANCE_TITLE_KEYS: readonly ["title", "name", "label", "heading", "subject", "customer"];
|
|
13
|
-
/**
|
|
14
|
-
* The kind's per-kind instance-title override —
|
|
15
|
-
* `kind_definition.metadata.title_key` (a single data key naming the title
|
|
16
|
-
* field, e.g. `wine_name`). Set by the creator agent via `kind_create`;
|
|
17
|
-
* null when absent/blank/non-string. Server parity: `kind_shared.kind_title_key`.
|
|
18
|
-
*/
|
|
19
|
-
export declare function kindTitleKeyFromMetadata(metadata: unknown): string | null;
|
|
20
|
-
/**
|
|
21
|
-
* Explicit title wins; else the kind's `metadata.title_key` field when it
|
|
22
|
-
* holds a non-empty scalar; else the first non-empty string under a shared
|
|
23
|
-
* title/name-ish key. The ORDER is a cross-repo contract — mirrored verbatim
|
|
24
|
-
* by aidream `kind_instance.derive_title`.
|
|
25
|
-
*/
|
|
26
|
-
export declare function deriveInstanceTitle(data: Record<string, unknown>, explicit?: string | null, titleKey?: string | null): string | null;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const INSTANCE_TITLE_KEYS = [
|
|
2
|
-
"title",
|
|
3
|
-
"name",
|
|
4
|
-
"label",
|
|
5
|
-
"heading",
|
|
6
|
-
"subject",
|
|
7
|
-
"customer"
|
|
8
|
-
];
|
|
9
|
-
function isRecord(value) {
|
|
10
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11
|
-
}
|
|
12
|
-
function kindTitleKeyFromMetadata(metadata) {
|
|
13
|
-
if (!isRecord(metadata)) return null;
|
|
14
|
-
const value = metadata["title_key"];
|
|
15
|
-
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
16
|
-
}
|
|
17
|
-
function scalarTitle(value) {
|
|
18
|
-
if (typeof value === "string") return value.trim() || null;
|
|
19
|
-
if (typeof value === "boolean") return value ? "true" : "false";
|
|
20
|
-
if (typeof value === "number") return Number.isFinite(value) ? String(value) : null;
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
function deriveInstanceTitle(data, explicit, titleKey) {
|
|
24
|
-
if (explicit && explicit.trim()) return explicit.trim();
|
|
25
|
-
if (titleKey) {
|
|
26
|
-
const override = scalarTitle(data[titleKey]);
|
|
27
|
-
if (override) return override;
|
|
28
|
-
}
|
|
29
|
-
for (const key of INSTANCE_TITLE_KEYS) {
|
|
30
|
-
const value = data[key];
|
|
31
|
-
if (typeof value === "string" && value.trim()) return value.trim();
|
|
32
|
-
}
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
INSTANCE_TITLE_KEYS,
|
|
37
|
-
deriveInstanceTitle,
|
|
38
|
-
kindTitleKeyFromMetadata
|
|
39
|
-
};
|