@ai-matrx/chat 0.3.23 → 0.3.25
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 +19 -0
- package/dist/agents/components/chat/ChatConversationSurface.js +2 -2
- package/dist/agents/components/chat/ChatRunHeader.js +3 -5
- package/dist/agents/components/chat/PinnedAgentsSection.js +2 -2
- package/dist/agents/components/context-preview/ContextCompareView.js +5 -12
- package/dist/agents/components/inputs/smart-input/composer/useComposerAgent.js +4 -5
- package/dist/agents/components/run/AgentRunnerPage.js +3 -3
- package/dist/agents/hooks/useAgentModelLabel.js +6 -2
- package/dist/agents/hooks/useAgentRunSurfaceScope.js +3 -4
- package/dist/agents/identity/agent-catalog-lists.d.ts +45 -0
- package/dist/agents/identity/agent-catalog-lists.js +128 -0
- package/dist/agents/identity/agent-identity.d.ts +52 -0
- package/dist/agents/identity/agent-identity.js +144 -0
- package/dist/agents/identity/run-tier-store.d.ts +15 -0
- package/dist/agents/identity/run-tier-store.js +23 -0
- package/dist/agents/redux/agent-definition/converters.js +1 -1
- package/dist/agents/redux/agent-definition/selectors.d.ts +612 -4581
- package/dist/agents/redux/agent-definition/selectors.js +6 -129
- package/dist/agents/redux/agent-definition/slice.d.ts +1 -0
- package/dist/agents/redux/agent-definition/slice.js +1 -0
- package/dist/agents/redux/agent-definition/thunks.d.ts +9 -205
- package/dist/agents/redux/agent-definition/thunks.js +34 -237
- package/dist/agents/redux/agent-filter/selectors.d.ts +10 -402
- package/dist/agents/redux/agent-filter/selectors.js +23 -45
- package/dist/agents/redux/agent-filter/useAgentIdsForFilter.d.ts +6 -0
- package/dist/agents/redux/agent-filter/useAgentIdsForFilter.js +14 -0
- package/dist/agents/redux/conversation-history/selectors.js +2 -3
- package/dist/agents/redux/execution-system/thunks/launch-agent-execution.thunk.js +2 -2
- package/dist/agents/redux/execution-system/thunks/load-conversation.thunk.js +2 -2
- package/dist/agents/redux/execution-system/thunks/run-headless-agent-json.js +2 -2
- package/dist/agents/redux/execution-system/utils/output-contract-guard.js +2 -1
- package/dist/agents/types/agent-definition.types.d.ts +8 -26
- package/dist/cx-chat/components/ChatMobileAgentName.js +4 -7
- package/dist/cx-chat/components/ChatSidebarClient.js +2 -2
- package/dist/cx-chat/components/agent/AgentPickerSheet.js +10 -11
- package/dist/cx-chat/hooks/useChatCatalogueInit.js +4 -7
- package/dist/cx-chat/hooks/useInstanceBootstrap.js +4 -5
- package/dist/host/db-types.d.ts +122 -0
- package/dist/window-panels/windows/agents/AgentRunWindow.js +4 -6
- package/dist/window-panels/windows/agents/RunControlsWindow.js +2 -4
- package/package.json +9 -8
- package/dist/agents/route/AgentListHydrator.d.ts +0 -4
- package/dist/agents/route/AgentListHydrator.js +0 -49
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
import { setUserInputMessageParts } from "../instance-user-input/instance-user-input.slice.js";
|
|
24
24
|
import { launchAgentExecution } from "./launch-agent-execution.thunk.js";
|
|
25
25
|
import { resolveMandate } from "../../../../mandates/service.js";
|
|
26
|
-
import { selectAgentName } from "../../agent-definition/selectors.js";
|
|
27
26
|
import {
|
|
28
27
|
judgeDeclaredFlattening,
|
|
29
28
|
judgeHarvestedFlattening
|
|
30
29
|
} from "./structured-output-flattening.js";
|
|
31
30
|
import { executeInstance } from "./execute-instance.thunk.js";
|
|
31
|
+
import { readAgentName } from "../../../identity/agent-identity.js";
|
|
32
32
|
function livePosture(onConversationCreated) {
|
|
33
33
|
return onConversationCreated ? { displayMode: "direct", keepInstance: true, onConversationCreated } : {};
|
|
34
34
|
}
|
|
@@ -140,7 +140,7 @@ async function failWarnedOutputMissingKeys(getState, opts, result) {
|
|
|
140
140
|
const holderId = warning.holderId ?? resolved.agentId;
|
|
141
141
|
let holderName;
|
|
142
142
|
try {
|
|
143
|
-
holderName = holderId ?
|
|
143
|
+
holderName = holderId ? readAgentName(getState(), holderId) ?? void 0 : void 0;
|
|
144
144
|
} catch {
|
|
145
145
|
holderName = void 0;
|
|
146
146
|
}
|
|
@@ -4,6 +4,7 @@ import { peekMandateCatalogueEntry } from "../../../../host/ui-slots.js";
|
|
|
4
4
|
import { fetchAgentOutputSchemas } from "../../../../mandates/output-contract.js";
|
|
5
5
|
import { SURFACE_WRITE_TOOL_NAME } from "../../../../surfaces/runtime/surface-writeback.js";
|
|
6
6
|
import { isJsonObject } from "../../../../utils/json.js";
|
|
7
|
+
import { readAgentName } from "../../../identity/agent-identity.js";
|
|
7
8
|
function schemaName(schema) {
|
|
8
9
|
if (!isJsonObject(schema)) return null;
|
|
9
10
|
return typeof schema.name === "string" && schema.name ? schema.name : null;
|
|
@@ -14,7 +15,7 @@ async function resolveRunOutputContract(state, conversationId) {
|
|
|
14
15
|
const agentId = conversation.agentId ?? null;
|
|
15
16
|
const mandateKey = conversation.mandateKey ?? null;
|
|
16
17
|
const record = agentId ? selectAgentById(state, agentId) : void 0;
|
|
17
|
-
const agentName =
|
|
18
|
+
const agentName = readAgentName(state, agentId) ?? null;
|
|
18
19
|
const outputSchemaLoaded = record ? hasField(record._loadedFields, "outputSchema") : false;
|
|
19
20
|
if (record && outputSchemaLoaded && record.outputSchema) {
|
|
20
21
|
const name2 = record.outputSchema.name;
|
|
@@ -6,6 +6,7 @@ import type { FieldFlags } from "@ai-matrx/agents/field-flags";
|
|
|
6
6
|
import type { SkillConfig } from "../../ui/skills-types.js";
|
|
7
7
|
import type { UiGates } from "../redux/agent-settings/ui-gates.js";
|
|
8
8
|
import type { MatrxDirectivesConfig } from "./matrx-directives.types.js";
|
|
9
|
+
import type { AgentRunTierRow, AgentRunCounts } from "@ai-matrx/agents/runtime";
|
|
9
10
|
export type AgentType = "user" | "builtin";
|
|
10
11
|
/**
|
|
11
12
|
* All available UI input types for agent variables.
|
|
@@ -349,14 +350,6 @@ export interface AgentDefinition {
|
|
|
349
350
|
* connections, auto-tools switch) land in their own fields.
|
|
350
351
|
*/
|
|
351
352
|
runControls?: AgentRunControls;
|
|
352
|
-
/**
|
|
353
|
-
* The agent's CLASS pin as a LIST read reports it (`offering_id` on
|
|
354
|
-
* agx_get_list / agx_get_list_full / agx_search / agx_list_scoped): a uuid,
|
|
355
|
-
* null (no pin — the preferred class runs), or absent when the read did not
|
|
356
|
-
* carry the column. Once settings load, `settings.offering_id` is the truth
|
|
357
|
-
* (`selectAgentOfferingPin`).
|
|
358
|
-
*/
|
|
359
|
-
listOfferingPin?: string | null;
|
|
360
353
|
/**
|
|
361
354
|
* Default Knowledge retrieval-boost for this agent's extracted content.
|
|
362
355
|
*
|
|
@@ -493,29 +486,18 @@ export interface AgentExecutionMinimal {
|
|
|
493
486
|
* `model_id` is the agent's default model (display + override diff base only —
|
|
494
487
|
* the server owns the merge of `config_overrides`). `tool_ids` is display only.
|
|
495
488
|
*/
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
489
|
+
/**
|
|
490
|
+
* The run tier row (`agx_get_run_tier`) — the core's `AgentRunTierRow`
|
|
491
|
+
* (`@ai-matrx/agents/runtime`, read by `createRunTierStore`) with its JSON
|
|
492
|
+
* columns narrowed to chat's variable, context-policy and gate shapes.
|
|
493
|
+
*/
|
|
494
|
+
export interface AgentRunTier extends Omit<AgentRunTierRow, "variable_definitions" | "context_policies" | "ui_gates"> {
|
|
502
495
|
variable_definitions: VariableDefinition[] | null;
|
|
503
496
|
context_policies: ContextPolicy[] | null;
|
|
504
|
-
auto_context_disabled: boolean;
|
|
505
|
-
model_id: string | null;
|
|
506
497
|
ui_gates: UiGates | null;
|
|
507
|
-
tool_ids: string[] | null;
|
|
508
|
-
access_level: string;
|
|
509
|
-
custom_tool_count: number;
|
|
510
|
-
skill_count: number;
|
|
511
|
-
connection_count: number;
|
|
512
498
|
}
|
|
513
499
|
/** The run tier's plain counts, as the registry stores them (P24b). */
|
|
514
|
-
export
|
|
515
|
-
customTools: number;
|
|
516
|
-
skills: number;
|
|
517
|
-
connections: number;
|
|
518
|
-
}
|
|
500
|
+
export type { AgentRunCounts } from "@ai-matrx/agents/runtime";
|
|
519
501
|
/** The run-control pickers' extra values (`agx_get_run_controls`, P25). */
|
|
520
502
|
export interface AgentRunControls {
|
|
521
503
|
customToolNames: string[];
|
|
@@ -4,8 +4,7 @@ import { useState, useCallback } from "react";
|
|
|
4
4
|
import { ChevronDown } from "lucide-react";
|
|
5
5
|
import { usePathname, useSearchParams, useRouter } from "../../host/navigation.js";
|
|
6
6
|
import { AgentPickerSheet } from "../../next/lazy/AgentPickerSheet.js";
|
|
7
|
-
import {
|
|
8
|
-
import { selectAgentById } from "../../agents/redux/agent-definition/selectors.js";
|
|
7
|
+
import { useAgentName } from "../../agents/identity/agent-identity.js";
|
|
9
8
|
import { pushAppHref } from "../../host/ui-slots.js";
|
|
10
9
|
import { Button } from "@ai-matrx/design-system/controls";
|
|
11
10
|
function ChatMobileAgentName() {
|
|
@@ -17,10 +16,8 @@ function ChatMobileAgentName() {
|
|
|
17
16
|
const pathMatch = pathname.match(/\/demos\/chat\/a\/([^/?]+)/);
|
|
18
17
|
return pathMatch?.[1] ?? searchParams.get("agent") ?? void 0;
|
|
19
18
|
})();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
const displayName = agentRecord?.name ?? "Matrx Chat";
|
|
19
|
+
const agentName = useAgentName(agentIdFromUrl);
|
|
20
|
+
const displayName = agentName ?? "Matrx Chat";
|
|
24
21
|
const handleAgentSelect = useCallback(
|
|
25
22
|
(agent) => {
|
|
26
23
|
setIsPickerOpen(false);
|
|
@@ -34,7 +31,7 @@ function ChatMobileAgentName() {
|
|
|
34
31
|
{
|
|
35
32
|
open: isPickerOpen,
|
|
36
33
|
onOpenChange: setIsPickerOpen,
|
|
37
|
-
selectedAgent:
|
|
34
|
+
selectedAgent: agentIdFromUrl && agentName ? { promptId: agentIdFromUrl, name: agentName } : null,
|
|
38
35
|
onSelect: handleAgentSelect
|
|
39
36
|
}
|
|
40
37
|
),
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
} from "@ai-matrx/tap-target/buttons";
|
|
16
16
|
import { useAppDispatch, useAppSelector } from "../../store/hooks.js";
|
|
17
17
|
import { selectAgentById } from "../../agents/redux/agent-definition/selectors.js";
|
|
18
|
-
import { initializeChatAgents } from "../../agents/redux/agent-definition/thunks.js";
|
|
19
18
|
import { pushAppHref } from "../../host/ui-slots.js";
|
|
20
19
|
import { Button } from "@ai-matrx/design-system/controls";
|
|
20
|
+
import { ensureAgentCatalog } from "../../agents/identity/agent-identity.js";
|
|
21
21
|
function togglePanel() {
|
|
22
22
|
const cb = document.getElementById(
|
|
23
23
|
"shell-panel-toggle"
|
|
@@ -127,7 +127,7 @@ function ChatPanelContent() {
|
|
|
127
127
|
const [searchQuery, setSearchQuery] = useState("");
|
|
128
128
|
const dispatch = useAppDispatch();
|
|
129
129
|
useEffect(() => {
|
|
130
|
-
|
|
130
|
+
void ensureAgentCatalog();
|
|
131
131
|
}, [dispatch]);
|
|
132
132
|
const agentIdFromUrl = (() => {
|
|
133
133
|
const pathMatch = pathname.match(/\/demos\/chat\/a\/([^/?]+)/);
|
|
@@ -19,15 +19,8 @@ import {
|
|
|
19
19
|
} from "@ai-matrx/design-system";
|
|
20
20
|
import { AgentListInlinePicker } from "@ai-matrx/agents/catalog/react";
|
|
21
21
|
import { selectAgentById } from "../../../agents/redux/agent-definition/selectors.js";
|
|
22
|
+
import { readAgentDescription, readAgentName } from "../../../agents/identity/agent-identity.js";
|
|
22
23
|
const CX_CHAT_PICKER_CONSUMER_ID = "cx-chat-agent-picker";
|
|
23
|
-
function toAgentConfig(agent) {
|
|
24
|
-
return {
|
|
25
|
-
promptId: agent.id,
|
|
26
|
-
name: agent.name,
|
|
27
|
-
description: agent.description ?? void 0,
|
|
28
|
-
variableDefaults: agent.variableDefinitions
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
24
|
function AgentPickerSheet({
|
|
32
25
|
open,
|
|
33
26
|
onOpenChange,
|
|
@@ -37,12 +30,18 @@ function AgentPickerSheet({
|
|
|
37
30
|
const isMobile = useIsMobile();
|
|
38
31
|
const store = useAppStore();
|
|
39
32
|
const handleSelect = (agentId) => {
|
|
40
|
-
const
|
|
41
|
-
|
|
33
|
+
const record = selectAgentById(store.getState(), agentId);
|
|
34
|
+
const name = readAgentName(store.getState(), agentId);
|
|
35
|
+
if (!name) {
|
|
42
36
|
toast.error("The selected agent could not be loaded.");
|
|
43
37
|
return;
|
|
44
38
|
}
|
|
45
|
-
onSelect(
|
|
39
|
+
onSelect({
|
|
40
|
+
promptId: agentId,
|
|
41
|
+
name,
|
|
42
|
+
description: readAgentDescription(store.getState(), agentId) ?? void 0,
|
|
43
|
+
variableDefaults: record?.variableDefinitions
|
|
44
|
+
});
|
|
46
45
|
onOpenChange(false);
|
|
47
46
|
};
|
|
48
47
|
const picker = /* @__PURE__ */ jsx(
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { useAppDispatch } from "../../store/hooks.js";
|
|
4
|
-
import {
|
|
5
|
-
initializeChatAgents,
|
|
6
|
-
isChatListStale
|
|
7
|
-
} from "../../agents/redux/agent-definition/thunks.js";
|
|
4
|
+
import { ensureAgentCatalog, isAgentCatalogStale } from "../../agents/identity/agent-identity.js";
|
|
8
5
|
function useChatCatalogueInit() {
|
|
9
6
|
const dispatch = useAppDispatch();
|
|
10
7
|
useEffect(() => {
|
|
11
|
-
|
|
8
|
+
void ensureAgentCatalog();
|
|
12
9
|
}, [dispatch]);
|
|
13
10
|
useEffect(() => {
|
|
14
11
|
const handleVisibility = () => {
|
|
15
|
-
if (document.visibilityState === "visible" &&
|
|
16
|
-
|
|
12
|
+
if (document.visibilityState === "visible" && isAgentCatalogStale()) {
|
|
13
|
+
void ensureAgentCatalog({ force: true });
|
|
17
14
|
}
|
|
18
15
|
};
|
|
19
16
|
document.addEventListener("visibilitychange", handleVisibility);
|
|
@@ -3,8 +3,6 @@ import { useEffect, useRef } from "react";
|
|
|
3
3
|
import { usePathname, useSearchParams, useRouter } from "../../host/navigation.js";
|
|
4
4
|
import { useAppDispatch } from "../../store/hooks.js";
|
|
5
5
|
import {
|
|
6
|
-
initializeChatAgents,
|
|
7
|
-
isChatListStale,
|
|
8
6
|
fetchAgentExecutionMinimal
|
|
9
7
|
} from "../../agents/redux/agent-definition/thunks.js";
|
|
10
8
|
import { launchAgentExecution } from "../../agents/redux/execution-system/thunks/launch-agent-execution.thunk.js";
|
|
@@ -14,6 +12,7 @@ import { toast } from "../../host/notify.js";
|
|
|
14
12
|
import { isNotAuthenticatedError } from "../../host/identity.js";
|
|
15
13
|
import { DEFAULT_AGENT_ID } from "../components/agent/local-agents.js";
|
|
16
14
|
import { replaceAddressWithoutNavigating } from "../../ui/addressWithoutNavigating.js";
|
|
15
|
+
import { ensureAgentCatalog, isAgentCatalogStale } from "../../agents/identity/agent-identity.js";
|
|
17
16
|
function parseChatUrl(pathname, searchParams) {
|
|
18
17
|
const agentPathMatch = pathname.match(/\/demos\/chat\/a\/([^/?]+)/);
|
|
19
18
|
const convPathMatch = pathname.match(/\/demos\/chat\/c\/([^/?]+)/);
|
|
@@ -37,12 +36,12 @@ function useInstanceBootstrap() {
|
|
|
37
36
|
const instanceByAgentId = useRef(/* @__PURE__ */ new Map());
|
|
38
37
|
const lastKey = useRef(null);
|
|
39
38
|
useEffect(() => {
|
|
40
|
-
|
|
39
|
+
void ensureAgentCatalog();
|
|
41
40
|
}, [dispatch]);
|
|
42
41
|
useEffect(() => {
|
|
43
42
|
const handleVisibility = () => {
|
|
44
|
-
if (document.visibilityState === "visible" &&
|
|
45
|
-
|
|
43
|
+
if (document.visibilityState === "visible" && isAgentCatalogStale()) {
|
|
44
|
+
void ensureAgentCatalog({ force: true });
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
document.addEventListener("visibilitychange", handleVisibility);
|
package/dist/host/db-types.d.ts
CHANGED
|
@@ -9789,6 +9789,42 @@ export type ChatDatabase = {
|
|
|
9789
9789
|
};
|
|
9790
9790
|
Relationships: [];
|
|
9791
9791
|
};
|
|
9792
|
+
research_rs_content_bodies: {
|
|
9793
|
+
Row: {
|
|
9794
|
+
archived_at: string;
|
|
9795
|
+
content: string;
|
|
9796
|
+
content_hash: string | null;
|
|
9797
|
+
content_type: string | null;
|
|
9798
|
+
id: string;
|
|
9799
|
+
is_current: boolean | null;
|
|
9800
|
+
processed_document_id: string;
|
|
9801
|
+
source_id: string | null;
|
|
9802
|
+
topic_id: string | null;
|
|
9803
|
+
};
|
|
9804
|
+
Insert: {
|
|
9805
|
+
archived_at?: string;
|
|
9806
|
+
content: string;
|
|
9807
|
+
content_hash?: string | null;
|
|
9808
|
+
content_type?: string | null;
|
|
9809
|
+
id: string;
|
|
9810
|
+
is_current?: boolean | null;
|
|
9811
|
+
processed_document_id: string;
|
|
9812
|
+
source_id?: string | null;
|
|
9813
|
+
topic_id?: string | null;
|
|
9814
|
+
};
|
|
9815
|
+
Update: {
|
|
9816
|
+
archived_at?: string;
|
|
9817
|
+
content?: string;
|
|
9818
|
+
content_hash?: string | null;
|
|
9819
|
+
content_type?: string | null;
|
|
9820
|
+
id?: string;
|
|
9821
|
+
is_current?: boolean | null;
|
|
9822
|
+
processed_document_id?: string;
|
|
9823
|
+
source_id?: string | null;
|
|
9824
|
+
topic_id?: string | null;
|
|
9825
|
+
};
|
|
9826
|
+
Relationships: [];
|
|
9827
|
+
};
|
|
9792
9828
|
scope_dataset_instances: {
|
|
9793
9829
|
Row: {
|
|
9794
9830
|
context_item_id: string;
|
|
@@ -10527,6 +10563,69 @@ export type ChatDatabase = {
|
|
|
10527
10563
|
};
|
|
10528
10564
|
Relationships: [];
|
|
10529
10565
|
};
|
|
10566
|
+
working_documents: {
|
|
10567
|
+
Row: {
|
|
10568
|
+
content: string;
|
|
10569
|
+
created_at: string;
|
|
10570
|
+
created_by: string | null;
|
|
10571
|
+
custom_fields: Json;
|
|
10572
|
+
deleted_at: string | null;
|
|
10573
|
+
id: string;
|
|
10574
|
+
kind: string;
|
|
10575
|
+
metadata: Json;
|
|
10576
|
+
organization_id: string;
|
|
10577
|
+
published_to_web: boolean;
|
|
10578
|
+
published_to_web_at: string | null;
|
|
10579
|
+
published_to_web_by: string | null;
|
|
10580
|
+
shown_to: Database["platform"]["Enums"]["shown_to"] | null;
|
|
10581
|
+
title: string;
|
|
10582
|
+
updated_at: string;
|
|
10583
|
+
updated_by: string | null;
|
|
10584
|
+
version: number;
|
|
10585
|
+
visibility: Database["platform"]["Enums"]["visibility"];
|
|
10586
|
+
};
|
|
10587
|
+
Insert: {
|
|
10588
|
+
content?: string;
|
|
10589
|
+
created_at?: string;
|
|
10590
|
+
created_by?: string | null;
|
|
10591
|
+
custom_fields?: Json;
|
|
10592
|
+
deleted_at?: string | null;
|
|
10593
|
+
id?: string;
|
|
10594
|
+
kind?: string;
|
|
10595
|
+
metadata?: Json;
|
|
10596
|
+
organization_id: string;
|
|
10597
|
+
published_to_web?: boolean;
|
|
10598
|
+
published_to_web_at?: string | null;
|
|
10599
|
+
published_to_web_by?: string | null;
|
|
10600
|
+
shown_to?: Database["platform"]["Enums"]["shown_to"] | null;
|
|
10601
|
+
title?: string;
|
|
10602
|
+
updated_at?: string;
|
|
10603
|
+
updated_by?: string | null;
|
|
10604
|
+
version?: number;
|
|
10605
|
+
visibility?: Database["platform"]["Enums"]["visibility"];
|
|
10606
|
+
};
|
|
10607
|
+
Update: {
|
|
10608
|
+
content?: string;
|
|
10609
|
+
created_at?: string;
|
|
10610
|
+
created_by?: string | null;
|
|
10611
|
+
custom_fields?: Json;
|
|
10612
|
+
deleted_at?: string | null;
|
|
10613
|
+
id?: string;
|
|
10614
|
+
kind?: string;
|
|
10615
|
+
metadata?: Json;
|
|
10616
|
+
organization_id?: string;
|
|
10617
|
+
published_to_web?: boolean;
|
|
10618
|
+
published_to_web_at?: string | null;
|
|
10619
|
+
published_to_web_by?: string | null;
|
|
10620
|
+
shown_to?: Database["platform"]["Enums"]["shown_to"] | null;
|
|
10621
|
+
title?: string;
|
|
10622
|
+
updated_at?: string;
|
|
10623
|
+
updated_by?: string | null;
|
|
10624
|
+
version?: number;
|
|
10625
|
+
visibility?: Database["platform"]["Enums"]["visibility"];
|
|
10626
|
+
};
|
|
10627
|
+
Relationships: [];
|
|
10628
|
+
};
|
|
10530
10629
|
};
|
|
10531
10630
|
Views: {
|
|
10532
10631
|
[_ in never]: never;
|
|
@@ -30189,6 +30288,20 @@ export type ChatDatabase = {
|
|
|
30189
30288
|
};
|
|
30190
30289
|
Returns: Json;
|
|
30191
30290
|
};
|
|
30291
|
+
entity_usage: {
|
|
30292
|
+
Args: {
|
|
30293
|
+
p_entity: string;
|
|
30294
|
+
p_ids: string[];
|
|
30295
|
+
};
|
|
30296
|
+
Returns: {
|
|
30297
|
+
entity_id: string;
|
|
30298
|
+
failure_count: number;
|
|
30299
|
+
last_used_at: string;
|
|
30300
|
+
run_count: number;
|
|
30301
|
+
success_count: number;
|
|
30302
|
+
total_cost: number;
|
|
30303
|
+
}[];
|
|
30304
|
+
};
|
|
30192
30305
|
extensibility_knob: {
|
|
30193
30306
|
Args: {
|
|
30194
30307
|
p_definition_id?: string;
|
|
@@ -36288,20 +36401,25 @@ export type ChatDatabase = {
|
|
|
36288
36401
|
created_by: string;
|
|
36289
36402
|
custom_fields: Json;
|
|
36290
36403
|
description: string;
|
|
36404
|
+
failure_count: number;
|
|
36291
36405
|
id: string;
|
|
36292
36406
|
is_active: boolean;
|
|
36293
36407
|
is_archived: boolean;
|
|
36294
36408
|
is_favorite: boolean;
|
|
36295
36409
|
is_owner: boolean;
|
|
36410
|
+
last_used_at: string;
|
|
36296
36411
|
model_id: string;
|
|
36297
36412
|
name: string;
|
|
36298
36413
|
offering_id: string;
|
|
36299
36414
|
organization_id: string;
|
|
36300
36415
|
organization_name: string;
|
|
36301
36416
|
owner_email: string;
|
|
36417
|
+
run_count: number;
|
|
36302
36418
|
source_agent_id: string;
|
|
36419
|
+
success_count: number;
|
|
36303
36420
|
tags: string[];
|
|
36304
36421
|
task_id: string;
|
|
36422
|
+
total_cost: number;
|
|
36305
36423
|
total_count: number;
|
|
36306
36424
|
updated_at: string;
|
|
36307
36425
|
version: number;
|
|
@@ -45942,6 +46060,7 @@ export type ChatDatabase = {
|
|
|
45942
46060
|
created_by: string;
|
|
45943
46061
|
custom_fields: Json;
|
|
45944
46062
|
description: string;
|
|
46063
|
+
failure_count: number;
|
|
45945
46064
|
id: string;
|
|
45946
46065
|
is_active: boolean;
|
|
45947
46066
|
is_archived: boolean;
|
|
@@ -45956,11 +46075,14 @@ export type ChatDatabase = {
|
|
|
45956
46075
|
owner_email: string;
|
|
45957
46076
|
run_count: number;
|
|
45958
46077
|
step_count: number;
|
|
46078
|
+
success_count: number;
|
|
45959
46079
|
tags: string[];
|
|
46080
|
+
total_cost: number;
|
|
45960
46081
|
total_count: number;
|
|
45961
46082
|
updated_at: string;
|
|
45962
46083
|
version: number;
|
|
45963
46084
|
visibility: string;
|
|
46085
|
+
workflow_type: string;
|
|
45964
46086
|
}[];
|
|
45965
46087
|
};
|
|
45966
46088
|
wsp_resolve_system_task: {
|
|
@@ -11,8 +11,7 @@ import { CHAT_WINDOWS } from "../../../host/windows.js";
|
|
|
11
11
|
import { useChatManagedWindowCount } from "../../../host/windows-react.js";
|
|
12
12
|
import {
|
|
13
13
|
selectAgentById,
|
|
14
|
-
selectAgentExecutionPayload
|
|
15
|
-
selectAgentName
|
|
14
|
+
selectAgentExecutionPayload
|
|
16
15
|
} from "../../../agents/redux/agent-definition/selectors.js";
|
|
17
16
|
import { fetchAgentExecutionMinimal } from "../../../agents/redux/agent-definition/thunks.js";
|
|
18
17
|
import {
|
|
@@ -55,6 +54,7 @@ import {
|
|
|
55
54
|
import { ErrorAlchemyMenu } from "../../../host/ui-slots.js";
|
|
56
55
|
import { selectUserId } from "../../../host/identity.js";
|
|
57
56
|
import { selectOrganizationId } from "../../../host/org.js";
|
|
57
|
+
import { useAgentName } from "../../../agents/identity/agent-identity.js";
|
|
58
58
|
const SOURCE_FEATURE = "agent-runner";
|
|
59
59
|
const AGENT_RUN_SIDEBAR_DEFAULT_SIZE = Math.round(220 * 0.85);
|
|
60
60
|
const AGENT_RUN_WINDOW_POSITIONS = [
|
|
@@ -435,7 +435,7 @@ function AgentRunBodyMenu({
|
|
|
435
435
|
children
|
|
436
436
|
}) {
|
|
437
437
|
const dispatch = useAppDispatch();
|
|
438
|
-
const agentName =
|
|
438
|
+
const agentName = useAgentName(agentId) ?? null;
|
|
439
439
|
const agentSection = buildAgentMenuSection({
|
|
440
440
|
agentId,
|
|
441
441
|
agentName,
|
|
@@ -536,9 +536,7 @@ function AgentRunWindowInner({
|
|
|
536
536
|
const [selectedConversationId, setSelectedConversationId] = useState(initialSelectedConversationId);
|
|
537
537
|
const siblingWindowCount = useChatManagedWindowCount("agent-run-window:");
|
|
538
538
|
const initialPosition = AGENT_RUN_WINDOW_POSITIONS[siblingWindowCount % AGENT_RUN_WINDOW_POSITIONS.length];
|
|
539
|
-
const liveAgentName =
|
|
540
|
-
(state) => agentId ? selectAgentName(state, agentId) ?? null : null
|
|
541
|
-
);
|
|
539
|
+
const liveAgentName = useAgentName(agentId) ?? null;
|
|
542
540
|
const agentName = liveAgentName ?? (agentId && agentId === initialAgentId ? initialAgentName : null) ?? "Agent";
|
|
543
541
|
const surfaceKey = agentId ? `${SOURCE_FEATURE}:${instanceId}:${agentId}` : null;
|
|
544
542
|
const liveConversationId = useLiveConversationId(surfaceKey);
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
} from "../../../agents/components/inputs/resources/attach-resource.js";
|
|
18
18
|
import { useAppSelector } from "../../../store/hooks.js";
|
|
19
19
|
import { selectInstanceAgentId } from "../../../agents/redux/execution-system/instance-ui-state/instance-ui-state.selectors.js";
|
|
20
|
-
import { selectAgentName } from "../../../agents/redux/agent-definition/selectors.js";
|
|
21
20
|
import { NonEditableContextMenu } from "../../../host/ui-slots.js";
|
|
22
21
|
import { buildAgentMenuSection, agentEntityRef } from "../../../agents/menu/agent-actions.js";
|
|
23
22
|
import { Tile } from "@ai-matrx/design-system/controls";
|
|
23
|
+
import { useAgentName } from "../../../agents/identity/agent-identity.js";
|
|
24
24
|
const OVERLAY_ID = CHAT_WINDOWS.runControlsWindow;
|
|
25
25
|
function RunControlsWindowInner({
|
|
26
26
|
conversationId,
|
|
@@ -41,9 +41,7 @@ function RunControlsWindowInner({
|
|
|
41
41
|
const detachResource = useDetachResource(conversationId);
|
|
42
42
|
const close = () => dispatch(closeOverlay({ overlayId: OVERLAY_ID }));
|
|
43
43
|
const agentId = useAppSelector(selectInstanceAgentId(conversationId));
|
|
44
|
-
const agentName =
|
|
45
|
-
(s) => agentId ? selectAgentName(s, agentId) ?? null : null
|
|
46
|
-
);
|
|
44
|
+
const agentName = useAgentName(agentId) ?? null;
|
|
47
45
|
const agentSection = buildAgentMenuSection({ agentId: agentId ?? "", agentName });
|
|
48
46
|
const handleResourceSelected = async (resource) => {
|
|
49
47
|
return attachResource(resource);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/chat",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.25",
|
|
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",
|
|
@@ -226,15 +226,14 @@
|
|
|
226
226
|
"server-only": "^0.0.1",
|
|
227
227
|
"uuid": "^14.0.2",
|
|
228
228
|
"zod": "^4.6.5",
|
|
229
|
-
"@ai-matrx/alchemy": "latest",
|
|
230
|
-
"@ai-matrx/associations": "latest",
|
|
231
229
|
"@ai-matrx/agents": "latest",
|
|
232
|
-
"@ai-matrx/
|
|
233
|
-
"@ai-matrx/
|
|
230
|
+
"@ai-matrx/associations": "latest",
|
|
231
|
+
"@ai-matrx/alchemy": "latest",
|
|
234
232
|
"@ai-matrx/browser-audio": "latest",
|
|
233
|
+
"@ai-matrx/content-ir-react": "latest",
|
|
234
|
+
"@ai-matrx/data": "latest",
|
|
235
235
|
"@ai-matrx/design-system": "latest",
|
|
236
236
|
"@ai-matrx/diff": "latest",
|
|
237
|
-
"@ai-matrx/data": "latest",
|
|
238
237
|
"@ai-matrx/icons": "latest",
|
|
239
238
|
"@ai-matrx/kit": "latest",
|
|
240
239
|
"@ai-matrx/media": "latest",
|
|
@@ -243,7 +242,8 @@
|
|
|
243
242
|
"@ai-matrx/records": "latest",
|
|
244
243
|
"@ai-matrx/records-ui": "latest",
|
|
245
244
|
"@ai-matrx/tap-target": "latest",
|
|
246
|
-
"@ai-matrx/
|
|
245
|
+
"@ai-matrx/canvas": "latest",
|
|
246
|
+
"@ai-matrx/content-ir": "latest"
|
|
247
247
|
},
|
|
248
248
|
"devDependencies": {
|
|
249
249
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
@@ -304,8 +304,9 @@
|
|
|
304
304
|
"scripts": {
|
|
305
305
|
"build": "pnpm clean && tsup && node ./scripts/copy-css.mjs && node ./scripts/tsc-own.mjs -p tsconfig.build.json && node ./scripts/finish-build.mjs",
|
|
306
306
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
307
|
-
"check:package": "pnpm build && node ../scripts/check-exports-agreement.mjs && pnpm check:canonical-pickers && publint && pnpm verify:tarball && pnpm verify:modules-tarball && pnpm check:front-door:self-test && pnpm check:host-boundary && pnpm check:no-builder-tier",
|
|
307
|
+
"check:package": "pnpm build && node ../scripts/check-exports-agreement.mjs && pnpm check:canonical-pickers && publint && pnpm verify:tarball && pnpm verify:modules-tarball && pnpm check:front-door:self-test && pnpm check:host-boundary && pnpm check:no-builder-tier && pnpm check:one-holder",
|
|
308
308
|
"check:host-boundary": "node ./scripts/check-host-boundary.mjs && node ./scripts/check-host-boundary.mjs --self-test",
|
|
309
|
+
"check:one-holder": "node ./scripts/check-chat-one-holder.mjs && node ./scripts/check-chat-one-holder.mjs --self-test",
|
|
309
310
|
"check:no-builder-tier": "node ./scripts/check-chat-has-no-builder-tier.mjs && node ./scripts/check-chat-has-no-builder-tier.mjs --self-test",
|
|
310
311
|
"typecheck": "node ./node_modules/typescript/bin/tsc -p tsconfig.json --noEmit && node ./scripts/tsc-own.mjs -p tsconfig.modules.json",
|
|
311
312
|
"test": "vitest run && pnpm test:modules",
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
import { useAppDispatch } from "../../store/hooks.js";
|
|
4
|
-
import {
|
|
5
|
-
mergePartialAgent,
|
|
6
|
-
setAgentFetchStatus,
|
|
7
|
-
setAgentsStatus
|
|
8
|
-
} from "../redux/agent-definition/slice.js";
|
|
9
|
-
import { overlayAgentFavoritesThunk } from "../redux/agent-definition/thunks.js";
|
|
10
|
-
function AgentListHydrator({ seeds }) {
|
|
11
|
-
const dispatch = useAppDispatch();
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
for (const row of seeds) {
|
|
14
|
-
dispatch(
|
|
15
|
-
mergePartialAgent({
|
|
16
|
-
id: row.id,
|
|
17
|
-
name: row.name,
|
|
18
|
-
description: row.description,
|
|
19
|
-
category: row.category,
|
|
20
|
-
tags: row.tags ?? [],
|
|
21
|
-
agentType: row.agent_type,
|
|
22
|
-
modelId: row.model_id,
|
|
23
|
-
isActive: row.is_active,
|
|
24
|
-
isArchived: row.is_archived,
|
|
25
|
-
// No `isFavorite` from the seed: the retired column. Stars are
|
|
26
|
-
// overlaid from platform.user_entity_state just below.
|
|
27
|
-
createdBy: row.created_by,
|
|
28
|
-
organizationId: row.organization_id,
|
|
29
|
-
taskId: row.task_id ?? null,
|
|
30
|
-
sourceAgentId: row.source_agent_id,
|
|
31
|
-
createdAt: row.created_at,
|
|
32
|
-
updatedAt: row.updated_at,
|
|
33
|
-
isVersion: false,
|
|
34
|
-
isOwner: row.is_owner,
|
|
35
|
-
accessLevel: row.access_level,
|
|
36
|
-
sharedByEmail: row.shared_by_email,
|
|
37
|
-
listOfferingPin: row.offering_id
|
|
38
|
-
})
|
|
39
|
-
);
|
|
40
|
-
dispatch(setAgentFetchStatus({ id: row.id, status: "list" }));
|
|
41
|
-
}
|
|
42
|
-
dispatch(setAgentsStatus("succeeded"));
|
|
43
|
-
void dispatch(overlayAgentFavoritesThunk(seeds.map((row) => row.id)));
|
|
44
|
-
}, []);
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
export {
|
|
48
|
-
AgentListHydrator
|
|
49
|
-
};
|