@ai-matrx/agents 0.59.176 → 0.59.177

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.
@@ -0,0 +1,137 @@
1
+ import * as react from 'react';
2
+ import { ComponentType, ReactNode } from 'react';
3
+ import * as _ai_matrx_diff_react from '@ai-matrx/diff/react';
4
+ import { EnrichmentContext } from '@ai-matrx/diff/react';
5
+ import { DiffTemporalMetadata, ViewMode, DiffResult } from '@ai-matrx/diff/structural';
6
+ import { VersionTimelineEntry, MatrxTableIconAction } from '@ai-matrx/design-system/data-table';
7
+
8
+ /**
9
+ * Any agent record the diff can compare: the web's Redux `AgentDefinition`, a version snapshot
10
+ * mapped by `snapshotToComparable`, or a fixture. Only top-level keys matter to the comparison.
11
+ */
12
+ type ComparableAgent = object;
13
+
14
+ interface AgentModelRefProps {
15
+ modelId: string;
16
+ /** The name the diff's enrichment resolved, when it did. */
17
+ name?: string | null | undefined;
18
+ /** Show the raw id under the name (the diff's label column does). */
19
+ showId?: boolean | undefined;
20
+ className?: string | undefined;
21
+ }
22
+ interface AgentToolRefProps {
23
+ toolId: string;
24
+ name?: string | null | undefined;
25
+ showId?: boolean | undefined;
26
+ className?: string | undefined;
27
+ }
28
+ interface AgentDiffRefPorts {
29
+ ModelRef?: ComponentType<AgentModelRefProps> | undefined;
30
+ ToolRef?: ComponentType<AgentToolRefProps> | undefined;
31
+ }
32
+ interface ResolvedRefs {
33
+ ModelRef: ComponentType<AgentModelRefProps>;
34
+ ToolRef: ComponentType<AgentToolRefProps>;
35
+ }
36
+ declare function AgentDiffRefsProvider({ refs, children }: {
37
+ refs?: AgentDiffRefPorts | undefined;
38
+ children: ReactNode;
39
+ }): react.JSX.Element;
40
+ declare function useAgentDiffRefs(): ResolvedRefs;
41
+
42
+ interface AgentDiffViewerProps {
43
+ oldAgent: ComparableAgent;
44
+ newAgent: ComparableAgent;
45
+ oldLabel: string;
46
+ newLabel: string;
47
+ temporalMetadata?: DiffTemporalMetadata;
48
+ defaultMode?: ViewMode;
49
+ className?: string;
50
+ /** Names for model/tool/MCP ids. Absent: ids show as they are. */
51
+ enrichment?: EnrichmentContext | undefined;
52
+ /** How a model or tool id is drawn. Absent: its resolved name and the id, as text. */
53
+ refs?: AgentDiffRefPorts | undefined;
54
+ }
55
+ /**
56
+ * The canonical agent field-adapter registry. Exported so a diff PAGE can name and describe changed
57
+ * fields exactly as this viewer renders them (Copy-for-AI) — one registry, never a parallel label table.
58
+ */
59
+ declare function buildAgentAdapterRegistry(): _ai_matrx_diff_react.AdapterRegistry;
60
+ declare function AgentDiffViewer({ oldAgent, newAgent, oldLabel, newLabel, temporalMetadata, defaultMode, className, enrichment, refs, }: AgentDiffViewerProps): react.JSX.Element;
61
+
62
+ /** One row of `agx_get_version_history`: a saved version of an agent (newest first). */
63
+ interface AgentVersionHistoryEntry {
64
+ version_id: string;
65
+ version_number: number;
66
+ name: string;
67
+ changed_at: string;
68
+ change_note: string | null;
69
+ contract_change: string | null;
70
+ contract_break_declared: string | null;
71
+ input_contract_hash: string | null;
72
+ output_contract_hash: string | null;
73
+ }
74
+ /** A contract break a person declares on a version (null clears the declaration). */
75
+ type ContractBreakKind = "input" | "output" | "both";
76
+ /** A history entry with what changed since the version before it, once both snapshots were read. */
77
+ interface EnrichedVersion extends AgentVersionHistoryEntry {
78
+ diffSummary?: DiffResult;
79
+ snapshotLoaded: boolean;
80
+ }
81
+ /** The load state the version timeline renders (the host owns where snapshots are kept). */
82
+ interface VersionHistoryLoad {
83
+ enrichedVersions: EnrichedVersion[];
84
+ loading: boolean;
85
+ progress: {
86
+ fetched: number;
87
+ total: number;
88
+ };
89
+ /** Versions whose snapshot read failed — never invisible. */
90
+ failedVersions: number[];
91
+ failureReason: string | null;
92
+ fetchEnrichedHistory: () => void | Promise<void>;
93
+ /** Read the named versions' snapshots (the timeline's Load on a gap). */
94
+ fetchGap: (versionNumbers: number[]) => void | Promise<void>;
95
+ }
96
+
97
+ /** Where the timeline says a result: the host's toasts (sonner on the web). */
98
+ interface VersionTimelineNotify {
99
+ success: (message: string) => void;
100
+ error: (message: string) => void;
101
+ }
102
+ interface VersionHistoryTimelineProps {
103
+ agentId: string;
104
+ versions: readonly AgentVersionHistoryEntry[];
105
+ currentVersion: number | null;
106
+ onCompare: (version: number, compareToVersion: number | "current") => void;
107
+ /** The snapshot-load state: the host keeps snapshots (Redux on the web) and enriches with `enrichVersions`. */
108
+ history: VersionHistoryLoad;
109
+ /** Records a declared contract break (`declareContractBreak`); a rejection rolls the badge back. Absent: no declare menu. */
110
+ onDeclareContractBreak?: ((versionNumber: number, kind: ContractBreakKind | null) => Promise<void>) | undefined;
111
+ notify?: VersionTimelineNotify | undefined;
112
+ /** The host's own row actions (duplicate as a new agent, …) after the timeline's. */
113
+ rowActions?: ((entry: VersionTimelineEntry) => readonly MatrxTableIconAction[]) | undefined;
114
+ /** Rendered once below the timeline (the host's dialogs). */
115
+ footer?: ReactNode;
116
+ /** The host's "explain this error" slot beside a failed read. */
117
+ ErrorMenu?: ComponentType<{
118
+ error?: string;
119
+ }> | undefined;
120
+ }
121
+ /**
122
+ * The agent's versions on THE shared version timeline (`MatrxVersionTimeline`): compare with the
123
+ * previous / current version, duplicate any version as a new agent, Load for snapshots not read
124
+ * yet, and — per version — the contract-break badge, the declare-a-break menu and the changed
125
+ * fields as chips.
126
+ */
127
+ declare function VersionHistoryTimeline({ agentId, versions, currentVersion, onCompare, history, onDeclareContractBreak, notify, rowActions, footer, ErrorMenu, }: VersionHistoryTimelineProps): react.JSX.Element;
128
+
129
+ interface ModelTierIdentity {
130
+ key: string;
131
+ role: string;
132
+ modelId: string;
133
+ }
134
+ /** The named model identities inside an agent's nested `modelTiers` object (default first). */
135
+ declare function readModelTierIdentities(value: unknown): ModelTierIdentity[];
136
+
137
+ export { type AgentDiffRefPorts, AgentDiffRefsProvider, AgentDiffViewer, type AgentDiffViewerProps, type AgentModelRefProps, type AgentToolRefProps, VersionHistoryTimeline, type VersionHistoryTimelineProps, type VersionTimelineNotify, buildAgentAdapterRegistry, readModelTierIdentities, useAgentDiffRefs };
@@ -0,0 +1,137 @@
1
+ import * as react from 'react';
2
+ import { ComponentType, ReactNode } from 'react';
3
+ import * as _ai_matrx_diff_react from '@ai-matrx/diff/react';
4
+ import { EnrichmentContext } from '@ai-matrx/diff/react';
5
+ import { DiffTemporalMetadata, ViewMode, DiffResult } from '@ai-matrx/diff/structural';
6
+ import { VersionTimelineEntry, MatrxTableIconAction } from '@ai-matrx/design-system/data-table';
7
+
8
+ /**
9
+ * Any agent record the diff can compare: the web's Redux `AgentDefinition`, a version snapshot
10
+ * mapped by `snapshotToComparable`, or a fixture. Only top-level keys matter to the comparison.
11
+ */
12
+ type ComparableAgent = object;
13
+
14
+ interface AgentModelRefProps {
15
+ modelId: string;
16
+ /** The name the diff's enrichment resolved, when it did. */
17
+ name?: string | null | undefined;
18
+ /** Show the raw id under the name (the diff's label column does). */
19
+ showId?: boolean | undefined;
20
+ className?: string | undefined;
21
+ }
22
+ interface AgentToolRefProps {
23
+ toolId: string;
24
+ name?: string | null | undefined;
25
+ showId?: boolean | undefined;
26
+ className?: string | undefined;
27
+ }
28
+ interface AgentDiffRefPorts {
29
+ ModelRef?: ComponentType<AgentModelRefProps> | undefined;
30
+ ToolRef?: ComponentType<AgentToolRefProps> | undefined;
31
+ }
32
+ interface ResolvedRefs {
33
+ ModelRef: ComponentType<AgentModelRefProps>;
34
+ ToolRef: ComponentType<AgentToolRefProps>;
35
+ }
36
+ declare function AgentDiffRefsProvider({ refs, children }: {
37
+ refs?: AgentDiffRefPorts | undefined;
38
+ children: ReactNode;
39
+ }): react.JSX.Element;
40
+ declare function useAgentDiffRefs(): ResolvedRefs;
41
+
42
+ interface AgentDiffViewerProps {
43
+ oldAgent: ComparableAgent;
44
+ newAgent: ComparableAgent;
45
+ oldLabel: string;
46
+ newLabel: string;
47
+ temporalMetadata?: DiffTemporalMetadata;
48
+ defaultMode?: ViewMode;
49
+ className?: string;
50
+ /** Names for model/tool/MCP ids. Absent: ids show as they are. */
51
+ enrichment?: EnrichmentContext | undefined;
52
+ /** How a model or tool id is drawn. Absent: its resolved name and the id, as text. */
53
+ refs?: AgentDiffRefPorts | undefined;
54
+ }
55
+ /**
56
+ * The canonical agent field-adapter registry. Exported so a diff PAGE can name and describe changed
57
+ * fields exactly as this viewer renders them (Copy-for-AI) — one registry, never a parallel label table.
58
+ */
59
+ declare function buildAgentAdapterRegistry(): _ai_matrx_diff_react.AdapterRegistry;
60
+ declare function AgentDiffViewer({ oldAgent, newAgent, oldLabel, newLabel, temporalMetadata, defaultMode, className, enrichment, refs, }: AgentDiffViewerProps): react.JSX.Element;
61
+
62
+ /** One row of `agx_get_version_history`: a saved version of an agent (newest first). */
63
+ interface AgentVersionHistoryEntry {
64
+ version_id: string;
65
+ version_number: number;
66
+ name: string;
67
+ changed_at: string;
68
+ change_note: string | null;
69
+ contract_change: string | null;
70
+ contract_break_declared: string | null;
71
+ input_contract_hash: string | null;
72
+ output_contract_hash: string | null;
73
+ }
74
+ /** A contract break a person declares on a version (null clears the declaration). */
75
+ type ContractBreakKind = "input" | "output" | "both";
76
+ /** A history entry with what changed since the version before it, once both snapshots were read. */
77
+ interface EnrichedVersion extends AgentVersionHistoryEntry {
78
+ diffSummary?: DiffResult;
79
+ snapshotLoaded: boolean;
80
+ }
81
+ /** The load state the version timeline renders (the host owns where snapshots are kept). */
82
+ interface VersionHistoryLoad {
83
+ enrichedVersions: EnrichedVersion[];
84
+ loading: boolean;
85
+ progress: {
86
+ fetched: number;
87
+ total: number;
88
+ };
89
+ /** Versions whose snapshot read failed — never invisible. */
90
+ failedVersions: number[];
91
+ failureReason: string | null;
92
+ fetchEnrichedHistory: () => void | Promise<void>;
93
+ /** Read the named versions' snapshots (the timeline's Load on a gap). */
94
+ fetchGap: (versionNumbers: number[]) => void | Promise<void>;
95
+ }
96
+
97
+ /** Where the timeline says a result: the host's toasts (sonner on the web). */
98
+ interface VersionTimelineNotify {
99
+ success: (message: string) => void;
100
+ error: (message: string) => void;
101
+ }
102
+ interface VersionHistoryTimelineProps {
103
+ agentId: string;
104
+ versions: readonly AgentVersionHistoryEntry[];
105
+ currentVersion: number | null;
106
+ onCompare: (version: number, compareToVersion: number | "current") => void;
107
+ /** The snapshot-load state: the host keeps snapshots (Redux on the web) and enriches with `enrichVersions`. */
108
+ history: VersionHistoryLoad;
109
+ /** Records a declared contract break (`declareContractBreak`); a rejection rolls the badge back. Absent: no declare menu. */
110
+ onDeclareContractBreak?: ((versionNumber: number, kind: ContractBreakKind | null) => Promise<void>) | undefined;
111
+ notify?: VersionTimelineNotify | undefined;
112
+ /** The host's own row actions (duplicate as a new agent, …) after the timeline's. */
113
+ rowActions?: ((entry: VersionTimelineEntry) => readonly MatrxTableIconAction[]) | undefined;
114
+ /** Rendered once below the timeline (the host's dialogs). */
115
+ footer?: ReactNode;
116
+ /** The host's "explain this error" slot beside a failed read. */
117
+ ErrorMenu?: ComponentType<{
118
+ error?: string;
119
+ }> | undefined;
120
+ }
121
+ /**
122
+ * The agent's versions on THE shared version timeline (`MatrxVersionTimeline`): compare with the
123
+ * previous / current version, duplicate any version as a new agent, Load for snapshots not read
124
+ * yet, and — per version — the contract-break badge, the declare-a-break menu and the changed
125
+ * fields as chips.
126
+ */
127
+ declare function VersionHistoryTimeline({ agentId, versions, currentVersion, onCompare, history, onDeclareContractBreak, notify, rowActions, footer, ErrorMenu, }: VersionHistoryTimelineProps): react.JSX.Element;
128
+
129
+ interface ModelTierIdentity {
130
+ key: string;
131
+ role: string;
132
+ modelId: string;
133
+ }
134
+ /** The named model identities inside an agent's nested `modelTiers` object (default first). */
135
+ declare function readModelTierIdentities(value: unknown): ModelTierIdentity[];
136
+
137
+ export { type AgentDiffRefPorts, AgentDiffRefsProvider, AgentDiffViewer, type AgentDiffViewerProps, type AgentModelRefProps, type AgentToolRefProps, VersionHistoryTimeline, type VersionHistoryTimelineProps, type VersionTimelineNotify, buildAgentAdapterRegistry, readModelTierIdentities, useAgentDiffRefs };