@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
|
@@ -10,14 +10,6 @@ const selectActiveAgentId = createSelector(
|
|
|
10
10
|
[selectAgentDefinitionSlice],
|
|
11
11
|
(slice) => slice.activeAgentId
|
|
12
12
|
);
|
|
13
|
-
const selectAgentsSliceStatus = createSelector(
|
|
14
|
-
[selectAgentDefinitionSlice],
|
|
15
|
-
(slice) => slice.status
|
|
16
|
-
);
|
|
17
|
-
const selectAgentsSliceError = createSelector(
|
|
18
|
-
[selectAgentDefinitionSlice],
|
|
19
|
-
(slice) => slice.error
|
|
20
|
-
);
|
|
21
13
|
const selectAgentById = createSelector(
|
|
22
14
|
[selectAllAgents, (_state, id) => id],
|
|
23
15
|
(agents, id) => agents[id]
|
|
@@ -55,10 +47,6 @@ const selectAgentDefinition = createSelector(
|
|
|
55
47
|
return definition;
|
|
56
48
|
}
|
|
57
49
|
);
|
|
58
|
-
const selectAgentReadyForDisplay = createSelector(
|
|
59
|
-
[selectAgentFetchStatus],
|
|
60
|
-
(status) => status === "list" || status === "full" || status === "versionSnapshot"
|
|
61
|
-
);
|
|
62
50
|
const selectAgentReadyForExecution = createSelector(
|
|
63
51
|
[selectAgentFetchStatus],
|
|
64
52
|
(status) => status === "execution" || status === "customExecution" || status === "full" || status === "versionSnapshot"
|
|
@@ -172,14 +160,6 @@ const selectAgentCustomExecutionPayload = createSelector(
|
|
|
172
160
|
};
|
|
173
161
|
}
|
|
174
162
|
);
|
|
175
|
-
const selectAgentName = createSelector(
|
|
176
|
-
[selectAgentById],
|
|
177
|
-
(record) => record?.name
|
|
178
|
-
);
|
|
179
|
-
const selectAgentDescription = createSelector(
|
|
180
|
-
[selectAgentById],
|
|
181
|
-
(record) => record?.description ?? null
|
|
182
|
-
);
|
|
183
163
|
const selectAgentType = createSelector(
|
|
184
164
|
[selectAgentById],
|
|
185
165
|
(record) => record?.agentType ?? null
|
|
@@ -192,7 +172,7 @@ const selectAgentOfferingPin = createSelector(
|
|
|
192
172
|
[selectAgentById, selectAgentReadyForCustomExecution],
|
|
193
173
|
(record, settingsLoaded) => {
|
|
194
174
|
if (!record) return void 0;
|
|
195
|
-
if (!settingsLoaded) return
|
|
175
|
+
if (!settingsLoaded) return void 0;
|
|
196
176
|
const pin = record.settings?.offering_id;
|
|
197
177
|
return typeof pin === "string" && pin !== "" ? pin : null;
|
|
198
178
|
}
|
|
@@ -428,110 +408,25 @@ const selectAgentIsAccessible = createSelector(
|
|
|
428
408
|
[selectAgentById],
|
|
429
409
|
(record) => record?.accessLevel != null
|
|
430
410
|
);
|
|
431
|
-
const
|
|
432
|
-
[selectAllAgents],
|
|
433
|
-
(agents) => Object.keys(agents)
|
|
434
|
-
);
|
|
435
|
-
const selectAllAgentsArray = createSelector(
|
|
411
|
+
const selectAgentRecordsArray = createSelector(
|
|
436
412
|
[selectAllAgents],
|
|
437
413
|
(agents) => Object.values(agents)
|
|
438
414
|
);
|
|
439
|
-
const selectLiveAgents = createSelector(
|
|
440
|
-
[selectAllAgentsArray],
|
|
441
|
-
(agents) => agents.filter((a) => !a.isVersion)
|
|
442
|
-
);
|
|
443
415
|
const selectAllVersionRecords = createSelector(
|
|
444
|
-
[
|
|
416
|
+
[selectAgentRecordsArray],
|
|
445
417
|
(agents) => agents.filter((a) => a.isVersion)
|
|
446
418
|
);
|
|
447
419
|
const selectVersionsByParentAgentId = createSelector(
|
|
448
420
|
[
|
|
449
|
-
|
|
421
|
+
selectAgentRecordsArray,
|
|
450
422
|
(_state, parentAgentId) => parentAgentId
|
|
451
423
|
],
|
|
452
424
|
(agents, parentAgentId) => agents.filter((a) => a.isVersion && a.parentAgentId === parentAgentId).sort((a, b) => (a.version ?? 0) - (b.version ?? 0))
|
|
453
425
|
);
|
|
454
|
-
const selectUserAgents = createSelector(
|
|
455
|
-
[selectLiveAgents],
|
|
456
|
-
(agents) => agents.filter((a) => a.agentType === "user")
|
|
457
|
-
);
|
|
458
|
-
const selectBuiltinAgents = createSelector(
|
|
459
|
-
[selectLiveAgents],
|
|
460
|
-
(agents) => agents.filter((a) => a.agentType === "builtin")
|
|
461
|
-
);
|
|
462
|
-
const selectSystemAgents = selectBuiltinAgents;
|
|
463
|
-
const EMPTY_LINEAGE = {
|
|
464
|
-
parent: null,
|
|
465
|
-
children: [],
|
|
466
|
-
systemTwin: null
|
|
467
|
-
};
|
|
468
|
-
function toLineageRef(a) {
|
|
469
|
-
return {
|
|
470
|
-
id: a.id,
|
|
471
|
-
name: a.name ?? a.id,
|
|
472
|
-
agentType: a.agentType ?? null,
|
|
473
|
-
isSystem: a.agentType === "builtin"
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
const selectAgentLineageIndex = createSelector(
|
|
477
|
-
[selectLiveAgents],
|
|
478
|
-
(agents) => {
|
|
479
|
-
const byId = new Map(agents.map((a) => [a.id, a]));
|
|
480
|
-
const childrenByParent = /* @__PURE__ */ new Map();
|
|
481
|
-
for (const a of agents) {
|
|
482
|
-
if (!a.sourceAgentId) continue;
|
|
483
|
-
const bucket = childrenByParent.get(a.sourceAgentId);
|
|
484
|
-
if (bucket) bucket.push(a);
|
|
485
|
-
else childrenByParent.set(a.sourceAgentId, [a]);
|
|
486
|
-
}
|
|
487
|
-
const index = {};
|
|
488
|
-
for (const a of agents) {
|
|
489
|
-
const parentRecord = a.sourceAgentId ? byId.get(a.sourceAgentId) ?? null : null;
|
|
490
|
-
const parent = parentRecord ? toLineageRef(parentRecord) : null;
|
|
491
|
-
const children = (childrenByParent.get(a.id) ?? []).map(toLineageRef);
|
|
492
|
-
index[a.id] = {
|
|
493
|
-
parent,
|
|
494
|
-
children,
|
|
495
|
-
systemTwin: parent?.isSystem === true ? parent : children.find((c) => c.isSystem) ?? null
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
return index;
|
|
499
|
-
}
|
|
500
|
-
);
|
|
501
|
-
const selectAgentLineage = createSelector(
|
|
502
|
-
[selectAgentLineageIndex, (_state, id) => id],
|
|
503
|
-
(index, id) => index[id] ?? EMPTY_LINEAGE
|
|
504
|
-
);
|
|
505
|
-
const selectActiveAgents = createSelector(
|
|
506
|
-
[selectLiveAgents],
|
|
507
|
-
(agents) => agents.filter((a) => a.isActive && !a.isArchived)
|
|
508
|
-
);
|
|
509
|
-
const selectFavoriteAgents = createSelector(
|
|
510
|
-
[selectLiveAgents],
|
|
511
|
-
(agents) => agents.filter((a) => a.isFavorite)
|
|
512
|
-
);
|
|
513
426
|
const selectDirtyAgents = createSelector(
|
|
514
|
-
[
|
|
427
|
+
[selectAgentRecordsArray],
|
|
515
428
|
(agents) => agents.filter((a) => a._dirty)
|
|
516
429
|
);
|
|
517
|
-
const selectOwnedAgents = createSelector(
|
|
518
|
-
[selectLiveAgents],
|
|
519
|
-
(agents) => agents.filter((a) => a.isOwner === true)
|
|
520
|
-
);
|
|
521
|
-
const selectSharedWithMeAgents = createSelector(
|
|
522
|
-
[selectLiveAgents],
|
|
523
|
-
(agents) => agents.filter((a) => a.isOwner === false && a.accessLevel != null)
|
|
524
|
-
);
|
|
525
|
-
const selectEditableAgents = createSelector(
|
|
526
|
-
[selectLiveAgents],
|
|
527
|
-
(agents) => agents.filter(
|
|
528
|
-
(a) => a.accessLevel === "owner" || a.accessLevel === "admin" || a.accessLevel === "editor"
|
|
529
|
-
)
|
|
530
|
-
);
|
|
531
|
-
const selectAgentsByCategory = createSelector(
|
|
532
|
-
[selectAllAgentsArray, (_state, category) => category],
|
|
533
|
-
(agents, category) => agents.filter((a) => a.category === category)
|
|
534
|
-
);
|
|
535
430
|
const selectActiveAgent = createSelector(
|
|
536
431
|
[selectAllAgents, selectActiveAgentId],
|
|
537
432
|
(agents, id) => id != null ? agents[id] : void 0
|
|
@@ -580,7 +475,6 @@ export {
|
|
|
580
475
|
selectActiveAgentId,
|
|
581
476
|
selectActiveAgentIsDirty,
|
|
582
477
|
selectActiveAgentIsLoading,
|
|
583
|
-
selectActiveAgents,
|
|
584
478
|
selectAgentAccessLevel,
|
|
585
479
|
selectAgentAccessResolved,
|
|
586
480
|
selectAgentAutoContextDisabled,
|
|
@@ -597,7 +491,6 @@ export {
|
|
|
597
491
|
selectAgentCustomToolNames,
|
|
598
492
|
selectAgentCustomTools,
|
|
599
493
|
selectAgentDefinition,
|
|
600
|
-
selectAgentDescription,
|
|
601
494
|
selectAgentDirtyFields,
|
|
602
495
|
selectAgentError,
|
|
603
496
|
selectAgentExecutionPayload,
|
|
@@ -618,8 +511,6 @@ export {
|
|
|
618
511
|
selectAgentIsOwner,
|
|
619
512
|
selectAgentIsReadOnly,
|
|
620
513
|
selectAgentIsVersion,
|
|
621
|
-
selectAgentLineage,
|
|
622
|
-
selectAgentLineageIndex,
|
|
623
514
|
selectAgentLoadedFields,
|
|
624
515
|
selectAgentMatrxDirectives,
|
|
625
516
|
selectAgentMcpServers,
|
|
@@ -628,15 +519,14 @@ export {
|
|
|
628
519
|
selectAgentModelId,
|
|
629
520
|
selectAgentModelMissing,
|
|
630
521
|
selectAgentModelTiers,
|
|
631
|
-
selectAgentName,
|
|
632
522
|
selectAgentOfferingPin,
|
|
633
523
|
selectAgentOutputSchema,
|
|
634
524
|
selectAgentParentAgentId,
|
|
635
525
|
selectAgentReadyForBuilder,
|
|
636
526
|
selectAgentReadyForCustomExecution,
|
|
637
|
-
selectAgentReadyForDisplay,
|
|
638
527
|
selectAgentReadyForExecution,
|
|
639
528
|
selectAgentReadyForVersionDisplay,
|
|
529
|
+
selectAgentRecordsArray,
|
|
640
530
|
selectAgentRedoDepth,
|
|
641
531
|
selectAgentRunControlsReady,
|
|
642
532
|
selectAgentRunTier,
|
|
@@ -652,21 +542,8 @@ export {
|
|
|
652
542
|
selectAgentUndoDepth,
|
|
653
543
|
selectAgentVariableDefinitions,
|
|
654
544
|
selectAgentVersion,
|
|
655
|
-
selectAgentsByCategory,
|
|
656
|
-
selectAgentsSliceError,
|
|
657
|
-
selectAgentsSliceStatus,
|
|
658
|
-
selectAllAgentIds,
|
|
659
545
|
selectAllAgents,
|
|
660
|
-
selectAllAgentsArray,
|
|
661
546
|
selectAllVersionRecords,
|
|
662
|
-
selectBuiltinAgents,
|
|
663
547
|
selectDirtyAgents,
|
|
664
|
-
selectEditableAgents,
|
|
665
|
-
selectFavoriteAgents,
|
|
666
|
-
selectLiveAgents,
|
|
667
|
-
selectOwnedAgents,
|
|
668
|
-
selectSharedWithMeAgents,
|
|
669
|
-
selectSystemAgents,
|
|
670
|
-
selectUserAgents,
|
|
671
548
|
selectVersionsByParentAgentId
|
|
672
549
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PayloadAction } from "@reduxjs/toolkit";
|
|
2
2
|
import type { AgentDefinition, AgentDefinitionRecord, AgentDefinitionSliceState, AgentFetchStatus, LoadedFields } from "../../types/agent-definition.types.js";
|
|
3
|
+
export declare function makeEmptyRecord(id: string): AgentDefinitionRecord;
|
|
3
4
|
/**
|
|
4
5
|
* Marks a record as clean. Clears dirty state, field history, and undo stacks.
|
|
5
6
|
* _loadedFields is NOT cleared — fetched state is cumulative.
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Definition — Redux Thunks
|
|
3
3
|
*
|
|
4
|
-
* 🚨 THE LIST IS THE
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* non-picker surfaces that read names / the builtin catalogue / gallery rows
|
|
10
|
-
* from `agentDefinition` keep working unchanged. No RPC is issued here, and
|
|
11
|
-
* adding one back is a defect (guard: `pnpm check:agent-list-reads`).
|
|
4
|
+
* 🚨 THE LIST IS THE CORE'S, AND ONLY THE CORE'S (agent core B2, 2026-10-07).
|
|
5
|
+
* Chat keeps NO agent-list mirror: every list, name and description reads the
|
|
6
|
+
* `@ai-matrx/agents/catalog` store (`agents/identity/agent-identity.ts`). The
|
|
7
|
+
* run tier, run controls, access level and shared lists are read through the
|
|
8
|
+
* core `createRunTierStore` (`agents/identity/run-tier-store.ts`).
|
|
12
9
|
*
|
|
13
10
|
* Read thunks:
|
|
14
|
-
* fetchAgentsList — hydrate the registry from the catalog
|
|
15
|
-
* fetchAgentsListFull — same; kept as the picker-era name
|
|
16
|
-
* fetchSharedAgents — agents shared with me (for "shared" tab)
|
|
17
|
-
* fetchSharedAgentsForChat — minimal shared list for chat agent picker
|
|
18
11
|
* fetchAgentAccessLevel — current user's permission level on an agent
|
|
19
12
|
* fetchAgentRunTier — TIER 2: what a run needs, never the definition (skips if ready)
|
|
20
13
|
* fetchAgentExecutionMinimal — the run tier under its pre-P24 name (app callers)
|
|
@@ -39,6 +32,7 @@
|
|
|
39
32
|
* old agx_check_drift / agx_check_references / agx_accept_version RPCs were
|
|
40
33
|
* replaced by agx_usage_scan / agx_usage_report / agx_usage_update_to_active.
|
|
41
34
|
*/
|
|
35
|
+
import { type AgentAccessLevelRow } from "@ai-matrx/agents/runtime";
|
|
42
36
|
import type { ChatDispatch, ChatRootState } from "../../../store/root-state.js";
|
|
43
37
|
import type { Database } from "../../../host/db-types.js";
|
|
44
38
|
import { type AIModelRecord } from "../../model-registry/modelRegistrySlice.js";
|
|
@@ -59,110 +53,6 @@ export declare function isAvailableToolModel(model: AIModelRecord | undefined):
|
|
|
59
53
|
export declare function applyAgentToolDelta(currentTools: readonly string[], addToolIds: readonly string[], removeToolIds: readonly string[]): string[];
|
|
60
54
|
export declare function sameStringArray(a: readonly string[], b: readonly string[]): boolean;
|
|
61
55
|
export declare function isToolAssignmentPhantom(current: AgentToolAssignmentRow, base: AgentToolAssignmentRow): boolean;
|
|
62
|
-
/** Thunk form of `overlayAgentFavorites`, for surfaces that seed rows themselves. */
|
|
63
|
-
export declare const overlayAgentFavoritesThunk: import("@reduxjs/toolkit").AsyncThunk<void, readonly string[], {
|
|
64
|
-
extra?: unknown;
|
|
65
|
-
rejectValue?: unknown;
|
|
66
|
-
serializedErrorType?: unknown;
|
|
67
|
-
pendingMeta?: unknown;
|
|
68
|
-
fulfilledMeta?: unknown;
|
|
69
|
-
rejectedMeta?: unknown;
|
|
70
|
-
dispatch: ChatDispatch;
|
|
71
|
-
state: ChatRootState;
|
|
72
|
-
}>;
|
|
73
|
-
/**
|
|
74
|
-
* Hydrates this registry from the ONE agent catalog. The gallery, the agent
|
|
75
|
-
* pages, and every name-resolving surface read `agentDefinition`; the catalog
|
|
76
|
-
* reads the database. This is the seam between them.
|
|
77
|
-
*
|
|
78
|
-
* The catalog's own freshness window and in-flight dedupe make this safe to
|
|
79
|
-
* dispatch on every mount — no thunk-level TTL guard is needed or wanted.
|
|
80
|
-
*/
|
|
81
|
-
export declare const fetchAgentsList: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
82
|
-
extra?: unknown;
|
|
83
|
-
rejectValue?: unknown;
|
|
84
|
-
serializedErrorType?: unknown;
|
|
85
|
-
pendingMeta?: unknown;
|
|
86
|
-
fulfilledMeta?: unknown;
|
|
87
|
-
rejectedMeta?: unknown;
|
|
88
|
-
dispatch: ChatDispatch;
|
|
89
|
-
state: ChatRootState;
|
|
90
|
-
}>;
|
|
91
|
-
/**
|
|
92
|
-
* Server-side agent search — the canonical path for finding an agent.
|
|
93
|
-
*
|
|
94
|
-
* WHY THIS EXISTS: the list is paginated. Filtering only what the client has
|
|
95
|
-
* already loaded silently reports "no results" for agents that were simply
|
|
96
|
-
* never fetched. Any paginated collection therefore needs a server search.
|
|
97
|
-
*
|
|
98
|
-
* ADDITIVE BY CONTRACT: results go through `mergeAgentListRows`, the same
|
|
99
|
-
* merge the list fetch uses. Rows are ADDED to the store and existing records
|
|
100
|
-
* are enriched, never replaced or evicted. Local matches keep rendering
|
|
101
|
-
* instantly while this resolves, then server-only matches fold in beneath
|
|
102
|
-
* them — nothing the user is already looking at disappears.
|
|
103
|
-
*
|
|
104
|
-
* Two tiers:
|
|
105
|
-
* deep = false (default) — name, description, category, tags, model, id
|
|
106
|
-
* deep = true — the above PLUS the agent's own prompt content
|
|
107
|
-
*
|
|
108
|
-
* Tier 2 is a strict superset and prompt hits always score below every tier-1
|
|
109
|
-
* field, so enabling it can only append below the obvious matches.
|
|
110
|
-
*
|
|
111
|
-
* Returns the matched ids in server rank order so a caller can preserve
|
|
112
|
-
* server relevance ordering if it wants to.
|
|
113
|
-
*/
|
|
114
|
-
export declare const searchAgentsServer: import("@reduxjs/toolkit").AsyncThunk<{
|
|
115
|
-
ids: string[];
|
|
116
|
-
deep: boolean;
|
|
117
|
-
query: string;
|
|
118
|
-
}, {
|
|
119
|
-
query: string;
|
|
120
|
-
deep?: boolean;
|
|
121
|
-
limit?: number;
|
|
122
|
-
}, {
|
|
123
|
-
extra?: unknown;
|
|
124
|
-
rejectValue?: unknown;
|
|
125
|
-
serializedErrorType?: unknown;
|
|
126
|
-
pendingMeta?: unknown;
|
|
127
|
-
fulfilledMeta?: unknown;
|
|
128
|
-
rejectedMeta?: unknown;
|
|
129
|
-
dispatch: ChatDispatch;
|
|
130
|
-
state: ChatRootState;
|
|
131
|
-
}>;
|
|
132
|
-
/**
|
|
133
|
-
* The picker-era name for the same hydration. Kept because ~20 surfaces
|
|
134
|
-
* dispatch it by name; it is `fetchAgentsList` with no status writes, because
|
|
135
|
-
* a picker's own loading state comes from the package now.
|
|
136
|
-
*/
|
|
137
|
-
export declare const fetchAgentsListFull: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
138
|
-
extra?: unknown;
|
|
139
|
-
rejectValue?: unknown;
|
|
140
|
-
serializedErrorType?: unknown;
|
|
141
|
-
pendingMeta?: unknown;
|
|
142
|
-
fulfilledMeta?: unknown;
|
|
143
|
-
rejectedMeta?: unknown;
|
|
144
|
-
dispatch: ChatDispatch;
|
|
145
|
-
state: ChatRootState;
|
|
146
|
-
}>;
|
|
147
|
-
/**
|
|
148
|
-
* Makes sure ONE agent's identity (name, description, …) is in this registry.
|
|
149
|
-
*
|
|
150
|
-
* Neither execution fetch (`agx_get_execution_minimal` / `_full`) carries the
|
|
151
|
-
* name, so an agent that no list fetch had loaded launched with a nameless
|
|
152
|
-
* record: every window titled it "Agent" and the empty hero lost its name.
|
|
153
|
-
* The name comes from the same place every name comes from — the ONE catalog —
|
|
154
|
-
* projected through `mergeAgentSummaries`. No-op when the name is present.
|
|
155
|
-
*/
|
|
156
|
-
export declare const ensureAgentIdentity: import("@reduxjs/toolkit").AsyncThunk<void, string, {
|
|
157
|
-
extra?: unknown;
|
|
158
|
-
rejectValue?: unknown;
|
|
159
|
-
serializedErrorType?: unknown;
|
|
160
|
-
pendingMeta?: unknown;
|
|
161
|
-
fulfilledMeta?: unknown;
|
|
162
|
-
rejectedMeta?: unknown;
|
|
163
|
-
dispatch: ChatDispatch;
|
|
164
|
-
state: ChatRootState;
|
|
165
|
-
}>;
|
|
166
56
|
/**
|
|
167
57
|
* TIER 2 — THE RUN TIER (PACKAGE-INDEPENDENCE §3, P24). Everything a run needs
|
|
168
58
|
* and nothing it does not: variables, context rules, the kill switch, the
|
|
@@ -227,66 +117,8 @@ export declare const fetchAgentRunControls: import("@reduxjs/toolkit").AsyncThun
|
|
|
227
117
|
dispatch: ChatDispatch;
|
|
228
118
|
state: ChatRootState;
|
|
229
119
|
}>;
|
|
230
|
-
export
|
|
231
|
-
|
|
232
|
-
name: string;
|
|
233
|
-
description: string | null;
|
|
234
|
-
agent_type: "user" | "builtin";
|
|
235
|
-
category: string | null;
|
|
236
|
-
tags: string[];
|
|
237
|
-
owner_id: string | null;
|
|
238
|
-
owner_email: string | null;
|
|
239
|
-
permission_level: string;
|
|
240
|
-
created_at: string;
|
|
241
|
-
updated_at: string;
|
|
242
|
-
}
|
|
243
|
-
export interface SharedAgentForChat {
|
|
244
|
-
id: string;
|
|
245
|
-
name: string;
|
|
246
|
-
permission_level: string;
|
|
247
|
-
owner_email: string | null;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Fetches all agents shared with the current user (not owned by them).
|
|
251
|
-
*
|
|
252
|
-
* @deprecated agx_get_list() now returns both owned and shared agents in one
|
|
253
|
-
* call with full access metadata. Prefer fetchAgentsList() instead.
|
|
254
|
-
* This thunk is kept for cases where only the shared subset is needed
|
|
255
|
-
* (e.g. a targeted refresh of the "Shared with me" tab without re-fetching owned agents).
|
|
256
|
-
*/
|
|
257
|
-
export declare const fetchSharedAgents: import("@reduxjs/toolkit").AsyncThunk<SharedAgentItem[], void, {
|
|
258
|
-
extra?: unknown;
|
|
259
|
-
rejectValue?: unknown;
|
|
260
|
-
serializedErrorType?: unknown;
|
|
261
|
-
pendingMeta?: unknown;
|
|
262
|
-
fulfilledMeta?: unknown;
|
|
263
|
-
rejectedMeta?: unknown;
|
|
264
|
-
dispatch: ChatDispatch;
|
|
265
|
-
state: ChatRootState;
|
|
266
|
-
}>;
|
|
267
|
-
/**
|
|
268
|
-
* Fetches the minimal shared agent list for the chat agent picker.
|
|
269
|
-
* Returns the raw list — lightweight, not stored in slice
|
|
270
|
-
* (the picker only needs name + id, no need to hydrate execution fields).
|
|
271
|
-
*/
|
|
272
|
-
export declare const fetchSharedAgentsForChat: import("@reduxjs/toolkit").AsyncThunk<SharedAgentForChat[], void, {
|
|
273
|
-
extra?: unknown;
|
|
274
|
-
rejectValue?: unknown;
|
|
275
|
-
serializedErrorType?: unknown;
|
|
276
|
-
pendingMeta?: unknown;
|
|
277
|
-
fulfilledMeta?: unknown;
|
|
278
|
-
rejectedMeta?: unknown;
|
|
279
|
-
dispatch: ChatDispatch;
|
|
280
|
-
state: ChatRootState;
|
|
281
|
-
}>;
|
|
282
|
-
export interface AgentAccessLevel {
|
|
283
|
-
agent_id: string;
|
|
284
|
-
agent_name: string;
|
|
285
|
-
owner_id: string;
|
|
286
|
-
owner_email: string;
|
|
287
|
-
access_level: "owner" | "admin" | "editor" | "viewer" | "public" | "none";
|
|
288
|
-
is_owner: boolean;
|
|
289
|
-
}
|
|
120
|
+
export type { SharedAgentItem, SharedAgentForChat } from "@ai-matrx/agents/runtime";
|
|
121
|
+
export type AgentAccessLevel = AgentAccessLevelRow;
|
|
290
122
|
/**
|
|
291
123
|
* Returns the current user's permission level on a specific agent.
|
|
292
124
|
* Also merges the result into the slice so selectors stay consistent.
|
|
@@ -294,35 +126,7 @@ export interface AgentAccessLevel {
|
|
|
294
126
|
* Use when opening the agent builder, or when the record arrived via a
|
|
295
127
|
* shortcut/execution RPC (which don't include access metadata).
|
|
296
128
|
*/
|
|
297
|
-
export declare const fetchAgentAccessLevel: import("@reduxjs/toolkit").AsyncThunk<
|
|
298
|
-
extra?: unknown;
|
|
299
|
-
rejectValue?: unknown;
|
|
300
|
-
serializedErrorType?: unknown;
|
|
301
|
-
pendingMeta?: unknown;
|
|
302
|
-
fulfilledMeta?: unknown;
|
|
303
|
-
rejectedMeta?: unknown;
|
|
304
|
-
dispatch: ChatDispatch;
|
|
305
|
-
state: ChatRootState;
|
|
306
|
-
}>;
|
|
307
|
-
/**
|
|
308
|
-
* THE FRESHNESS IS THE PACKAGE'S. `isChatListFresh` and its module-level
|
|
309
|
-
* timestamp are gone: the catalog owns the 15-minute TTL and the 4-hour
|
|
310
|
-
* tab-restore threshold, so there is exactly one answer to "is the list
|
|
311
|
-
* stale" on this platform.
|
|
312
|
-
*/
|
|
313
|
-
export declare function isChatListStale(): boolean;
|
|
314
|
-
/**
|
|
315
|
-
* Initializes the agent catalogue for the chat sidebar and hydrates this
|
|
316
|
-
* registry from it. Safe to call on every mount — the catalog's own TTL and
|
|
317
|
-
* shared in-flight promise collapse concurrent mounts to one read.
|
|
318
|
-
*
|
|
319
|
-
* Usage:
|
|
320
|
-
* dispatch(initializeChatAgents()) // skip if fresh
|
|
321
|
-
* dispatch(initializeChatAgents({ force: true })) // always re-read
|
|
322
|
-
*/
|
|
323
|
-
export declare const initializeChatAgents: import("@reduxjs/toolkit").AsyncThunk<void, void | {
|
|
324
|
-
force?: boolean;
|
|
325
|
-
}, {
|
|
129
|
+
export declare const fetchAgentAccessLevel: import("@reduxjs/toolkit").AsyncThunk<AgentAccessLevelRow, string, {
|
|
326
130
|
extra?: unknown;
|
|
327
131
|
rejectValue?: unknown;
|
|
328
132
|
serializedErrorType?: unknown;
|