@ai-matrx/chat 0.3.24 → 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 +8 -0
- package/dist/agents/identity/agent-identity.d.ts +19 -1
- package/dist/agents/identity/agent-identity.js +22 -5
- package/dist/agents/redux/agent-definition/converters.js +1 -1
- package/dist/agents/redux/agent-definition/selectors.d.ts +604 -4573
- package/dist/agents/redux/agent-definition/selectors.js +6 -129
- package/dist/agents/redux/agent-definition/thunks.d.ts +0 -1
- package/dist/agents/redux/agent-definition/thunks.js +0 -16
- package/dist/agents/redux/agent-filter/selectors.d.ts +1 -402
- package/dist/agents/redux/agent-filter/selectors.js +1 -25
- package/dist/agents/types/agent-definition.types.d.ts +0 -8
- package/dist/host/db-types.d.ts +36 -0
- package/package.json +7 -6
- package/dist/agents/redux/agent-definition/list-mirror.d.ts +0 -139
- package/dist/agents/redux/agent-definition/list-mirror.js +0 -157
- 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
|
};
|
|
@@ -136,4 +136,3 @@ export declare const fetchAgentAccessLevel: import("@reduxjs/toolkit").AsyncThun
|
|
|
136
136
|
dispatch: ChatDispatch;
|
|
137
137
|
state: ChatRootState;
|
|
138
138
|
}>;
|
|
139
|
-
export { overlayAgentFavoritesThunk, fetchAgentsList, searchAgentsServer, fetchAgentsListFull, ensureAgentIdentity, isChatListStale, initializeChatAgents, } from "./list-mirror.js";
|
|
@@ -231,15 +231,6 @@ const fetchAgentAccessLevel = createAsyncThunk("agentDefinition/fetchAccessLevel
|
|
|
231
231
|
);
|
|
232
232
|
return row;
|
|
233
233
|
});
|
|
234
|
-
import {
|
|
235
|
-
overlayAgentFavoritesThunk,
|
|
236
|
-
fetchAgentsList,
|
|
237
|
-
searchAgentsServer,
|
|
238
|
-
fetchAgentsListFull,
|
|
239
|
-
ensureAgentIdentity,
|
|
240
|
-
isChatListStale,
|
|
241
|
-
initializeChatAgents
|
|
242
|
-
} from "./list-mirror.js";
|
|
243
234
|
export {
|
|
244
235
|
AgentToolAssignmentConflictError,
|
|
245
236
|
AgentToolAssignmentError,
|
|
@@ -247,19 +238,12 @@ export {
|
|
|
247
238
|
assertOwnedLiveAgentToolAssignment,
|
|
248
239
|
assertRegisteredActiveToolAdditions,
|
|
249
240
|
assertToolAdditionModelCapability,
|
|
250
|
-
ensureAgentIdentity,
|
|
251
241
|
fetchAgentAccessLevel,
|
|
252
242
|
fetchAgentExecutionMinimal,
|
|
253
243
|
fetchAgentRunControls,
|
|
254
244
|
fetchAgentRunTier,
|
|
255
|
-
fetchAgentsList,
|
|
256
|
-
fetchAgentsListFull,
|
|
257
|
-
initializeChatAgents,
|
|
258
245
|
isAvailableToolModel,
|
|
259
|
-
isChatListStale,
|
|
260
246
|
isToolAssignmentPhantom,
|
|
261
|
-
overlayAgentFavoritesThunk,
|
|
262
247
|
sameStringArray,
|
|
263
|
-
searchAgentsServer,
|
|
264
248
|
uniqueToolIds
|
|
265
249
|
};
|