@you-agent-factory/factory-visualizers 0.0.2 → 0.0.6
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/README.md +13 -15
- package/dist/factory-emulator-controls.d.ts +2 -2
- package/dist/factory-emulator-error-boundary.d.ts +1 -1
- package/dist/factory-emulator-view.d.ts +1 -1
- package/dist/factory-recording-topology-replay.d.ts +2 -4
- package/dist/factory-timeline-scrubber.d.ts +1 -1
- package/dist/factory-topology-replay.d.ts +13 -17
- package/dist/factory-topology-state.d.ts +4 -5
- package/dist/index.d.ts +2 -3
- package/dist/index.js +29 -705
- package/dist/styles.css +25 -320
- package/dist/visualizer-error.d.ts +1 -8
- package/dist/work-progress-visualizer.d.ts +1 -1
- package/package.json +12 -10
- package/dist/factory-topology-active-work.d.ts +0 -11
- package/dist/factory-topology-chrome.d.ts +0 -14
- package/dist/factory-topology-flow-projection.d.ts +0 -12
- package/dist/factory-topology-replay-nodes.d.ts +0 -32
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# `@you-agent-factory/factory-visualizers`
|
|
2
2
|
|
|
3
|
-
Controlled React components for rendering caller-prepared
|
|
4
|
-
|
|
3
|
+
Controlled React components for rendering a caller-prepared `FactoryGraphSource`
|
|
4
|
+
through the original Factory semantic graph. The package exports `FactoryTopologyReplay`,
|
|
5
5
|
`FactoryRecordingTopologyReplay`, `FactoryTimelineScrubber`, and
|
|
6
6
|
`WorkProgressVisualizer`, and `FactoryEmulatorControls` together with their
|
|
7
7
|
message, formatting, status, callback, and structured error contracts.
|
|
@@ -10,11 +10,9 @@ See the [public package family guide](https://github.com/portpowered/you-agent-f
|
|
|
10
10
|
for clean-install commands, static and interactive package examples, dependency
|
|
11
11
|
direction, and the precise hosted-runtime versus emulator support boundary.
|
|
12
12
|
|
|
13
|
-
`FactoryTopologyReplay`
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
resolver starts from the selected preset and applies supplied overrides without
|
|
17
|
-
changing the caller-provided topology, activity, or Work-progress projection.
|
|
13
|
+
`FactoryTopologyReplay` has one ready input: a `FactoryGraphSource` containing
|
|
14
|
+
the complete Factory, its authored layout, and one selected-tick runtime
|
|
15
|
+
projection. It deliberately has no topology-only rendering fallback.
|
|
18
16
|
|
|
19
17
|
`FactoryEmulatorControls` composes the lower-level controlled playback toolbar
|
|
20
18
|
with `FactoryTimelineScrubber`. Hosts provide the current/history selection and
|
|
@@ -40,11 +38,11 @@ local failure message. A failure may include `recoveryAction` with a host-owned
|
|
|
40
38
|
callback; the visualizers render that action but never assume a retry,
|
|
41
39
|
transport, timer, or global error-state implementation.
|
|
42
40
|
|
|
43
|
-
The host always owns transport, persistence, and canonical Factory data. It
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
The host always owns transport, persistence, and canonical Factory data. It
|
|
42
|
+
prepares selected-tick runtime data with `@you-agent-factory/factory-replay`
|
|
43
|
+
and passes it with the complete Factory through `@you-agent-factory/factory-graph`.
|
|
44
|
+
`FactoryRecordingTopologyReplay` validates an unknown recording and renders it
|
|
45
|
+
only when the recording includes that complete Factory. Import the package styles once:
|
|
48
46
|
|
|
49
47
|
```tsx
|
|
50
48
|
import {
|
|
@@ -93,9 +91,9 @@ keeps fixed history stable as later evidence arrives, and can return to current
|
|
|
93
91
|
mode with its follow-latest action. Current mode also incorporates newly
|
|
94
92
|
accepted same-tick events in canonical sequence order.
|
|
95
93
|
|
|
96
|
-
The installed-consumer verification uses the public client parser
|
|
97
|
-
|
|
98
|
-
`FactoryTopologyReplay`. It imports the client recording fixture and both
|
|
94
|
+
The installed-consumer verification uses the public client parser, replay
|
|
95
|
+
projection functions, and Factory graph source before passing the canonical
|
|
96
|
+
graph to `FactoryTopologyReplay`. It imports the client recording fixture and both
|
|
99
97
|
package style entry points only through public package exports.
|
|
100
98
|
|
|
101
99
|
Run `make storybook` in this directory for package-local development. Use
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FactoryEmulatorControlsProps as PlaybackControlsProps } from "@you-agent-factory/components";
|
|
1
|
+
import { type FactoryEmulatorControlsProps as PlaybackControlsProps } from "@you-agent-factory/components/factory-emulator";
|
|
2
2
|
import type { HTMLAttributes } from "react";
|
|
3
3
|
import { type FactoryEmulatorFailure } from "./factory-emulator-error-boundary";
|
|
4
4
|
import { type FactoryTimelineScrubberMessages, type FactoryTimelineScrubberState } from "./factory-timeline-scrubber";
|
|
@@ -23,4 +23,4 @@ export interface FactoryEmulatorControlsTimeline {
|
|
|
23
23
|
state: FactoryTimelineScrubberState;
|
|
24
24
|
}
|
|
25
25
|
/** Controlled controls that make the distinction between current and historical replay explicit. */
|
|
26
|
-
export declare function FactoryEmulatorControls({ className, failure, formatTick, onFollowLatest, onError, onPause, onPlay, onRestart, onSelectTick, onStep, showPlaybackControls, showTimelineScrubber, timeline, ...playbackProps }: FactoryEmulatorControlsProps): import("react").JSX.Element;
|
|
26
|
+
export declare function FactoryEmulatorControls({ className, failure, formatTick, onFollowLatest, onError, onPause, onPlay, onRestart, onSelectTick, onStep, showPlaybackControls, showTimelineScrubber, timeline, ...playbackProps }: FactoryEmulatorControlsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,6 +21,6 @@ export declare class FactoryEmulatorErrorBoundary extends Component<FactoryEmula
|
|
|
21
21
|
state: FactoryEmulatorErrorBoundaryState;
|
|
22
22
|
static getDerivedStateFromError(): FactoryEmulatorErrorBoundaryState;
|
|
23
23
|
componentDidCatch(error: unknown, _errorInfo: ErrorInfo): void;
|
|
24
|
-
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
24
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
25
25
|
}
|
|
26
26
|
export {};
|
|
@@ -24,4 +24,4 @@ export interface FactoryEmulatorViewProps extends Omit<HTMLAttributes<HTMLElemen
|
|
|
24
24
|
workProgress: WorkProgressVisualizerProps;
|
|
25
25
|
}
|
|
26
26
|
/** A controlled Factory emulator layout. Presets select regions; hosts retain all state and behavior. */
|
|
27
|
-
export declare function FactoryEmulatorView({ className, controls, failure, onError, preset, submission, topology, visibility, workProgress, ...sectionProps }: FactoryEmulatorViewProps): import("react").JSX.Element;
|
|
27
|
+
export declare function FactoryEmulatorView({ className, controls, failure, onError, preset, submission, topology, visibility, workProgress, ...sectionProps }: FactoryEmulatorViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,7 +15,7 @@ export interface FactoryRecordingValidationDiagnostic {
|
|
|
15
15
|
message: string;
|
|
16
16
|
recoverable: false;
|
|
17
17
|
}
|
|
18
|
-
export type FactoryRecordingTopologyReplayError = FactoryRecordingValidationDiagnostic | FactoryVisualizerError
|
|
18
|
+
export type FactoryRecordingTopologyReplayError = FactoryRecordingValidationDiagnostic | FactoryVisualizerError;
|
|
19
19
|
export interface FactoryRecordingTopologyReplayMessages {
|
|
20
20
|
progress: WorkProgressVisualizerMessages;
|
|
21
21
|
regionLabel: string;
|
|
@@ -27,8 +27,6 @@ export interface FactoryRecordingTopologyReplayMessages {
|
|
|
27
27
|
export interface FactoryRecordingTopologyReplayProps {
|
|
28
28
|
defaultSelectedTick?: number;
|
|
29
29
|
formatNumber: (value: number) => string;
|
|
30
|
-
/** Presentation-only content validated by the controlled topology renderer. */
|
|
31
|
-
layout?: unknown;
|
|
32
30
|
messages: FactoryRecordingTopologyReplayMessages;
|
|
33
31
|
onError?: (error: FactoryRecordingTopologyReplayError) => void;
|
|
34
32
|
onSelectNode?: (node: FactoryTopologyNode) => void;
|
|
@@ -58,6 +56,6 @@ export interface RecordingProjectionCache {
|
|
|
58
56
|
export declare const MAX_CACHED_RECORDING_PROJECTIONS = 32;
|
|
59
57
|
export declare function createRecordingProjectionCache(): RecordingProjectionCache;
|
|
60
58
|
/** Validate and replay one caller-owned recording through the controlled visualizers. */
|
|
61
|
-
export declare function FactoryRecordingTopologyReplay({ defaultSelectedTick, formatNumber,
|
|
59
|
+
export declare function FactoryRecordingTopologyReplay({ defaultSelectedTick, formatNumber, messages, onError, onSelectNode, recording, selectedNodeId, state, }: FactoryRecordingTopologyReplayProps): import("react/jsx-runtime").JSX.Element;
|
|
62
60
|
export declare function projectRecordingAtTick(events: FactoryRecording["events"], tick: number, cache: RecordingProjectionCache): RecordingProjection;
|
|
63
61
|
export {};
|
|
@@ -29,4 +29,4 @@ export interface FactoryTimelineScrubberProps extends Omit<HTMLAttributes<HTMLEl
|
|
|
29
29
|
onSelectTick: (tick: number) => void;
|
|
30
30
|
state: FactoryTimelineScrubberState;
|
|
31
31
|
}
|
|
32
|
-
export declare function FactoryTimelineScrubber({ className, disabled, formatTick, messages, onFollowLatest, onSelectTick, state, ...sectionProps }: FactoryTimelineScrubberProps): import("react").JSX.Element;
|
|
32
|
+
export declare function FactoryTimelineScrubber({ className, disabled, formatTick, messages, onFollowLatest, onSelectTick, state, ...sectionProps }: FactoryTimelineScrubberProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
export type { FactoryTopologyFlowProjection } from "./factory-topology-flow-projection";
|
|
4
|
-
export { projectFactoryTopologyFlow } from "./factory-topology-flow-projection";
|
|
1
|
+
import { type FactoryGraphSource } from "@you-agent-factory/factory-graph";
|
|
2
|
+
import type { FactoryTopologyNode } from "@you-agent-factory/factory-replay";
|
|
5
3
|
import type { FactoryTopologyReplayError } from "./visualizer-error";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
4
|
+
/**
|
|
5
|
+
* Controlled state for the canonical Factory graph. A ready graph always has
|
|
6
|
+
* the complete Factory definition and the selected-tick runtime projection.
|
|
7
|
+
*/
|
|
11
8
|
export type FactoryTopologyReplayState = {
|
|
12
9
|
status: "empty";
|
|
13
10
|
} | {
|
|
@@ -15,12 +12,11 @@ export type FactoryTopologyReplayState = {
|
|
|
15
12
|
} | {
|
|
16
13
|
status: "loading";
|
|
17
14
|
} | {
|
|
18
|
-
|
|
15
|
+
source: FactoryGraphSource;
|
|
19
16
|
status: "ready";
|
|
20
17
|
};
|
|
21
18
|
export interface FactoryTopologyReplayMessages {
|
|
22
19
|
activeDispatches: (count: number) => string;
|
|
23
|
-
/** Optional fields retain compatibility for existing controlled consumers. */
|
|
24
20
|
activeWorkDuration?: (durationTicks: number) => string;
|
|
25
21
|
activeWorkOverflow?: (count: number) => string;
|
|
26
22
|
activeWorkRegionLabel?: string;
|
|
@@ -31,7 +27,6 @@ export interface FactoryTopologyReplayMessages {
|
|
|
31
27
|
inactiveDispatches: string;
|
|
32
28
|
imageFailed: string;
|
|
33
29
|
imageLoading: string;
|
|
34
|
-
/** Optional labels retain compatibility for existing controlled consumers. */
|
|
35
30
|
legendActiveRoute?: string;
|
|
36
31
|
legendInactiveRoute?: string;
|
|
37
32
|
legendLabel?: string;
|
|
@@ -47,10 +42,6 @@ export interface FactoryTopologyReplayMessages {
|
|
|
47
42
|
workStateCountUnavailable: string;
|
|
48
43
|
}
|
|
49
44
|
export interface FactoryTopologyReplayProps {
|
|
50
|
-
/** Presentation-only optional chrome; it never changes the prepared projection. */
|
|
51
|
-
chrome?: FactoryTopologyChromeConfiguration;
|
|
52
|
-
/** Presentation-only input validated against the prepared canonical topology. */
|
|
53
|
-
layout?: unknown;
|
|
54
45
|
messages: FactoryTopologyReplayMessages;
|
|
55
46
|
onError?: (error: FactoryTopologyReplayError) => void;
|
|
56
47
|
onRetry?: () => void;
|
|
@@ -58,4 +49,9 @@ export interface FactoryTopologyReplayProps {
|
|
|
58
49
|
selectedNodeId?: string;
|
|
59
50
|
state: FactoryTopologyReplayState;
|
|
60
51
|
}
|
|
61
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Public read-only Factory graph. Rendering is delegated to the same semantic
|
|
54
|
+
* renderer registry used by the embedded Factory graph; there is no
|
|
55
|
+
* topology-only renderer or visual fallback.
|
|
56
|
+
*/
|
|
57
|
+
export declare function FactoryTopologyReplay(props: FactoryTopologyReplayProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Component, type ErrorInfo, type ReactNode } from "react";
|
|
2
|
-
import type { FactoryTopologyReplayMessages
|
|
3
|
-
import { type
|
|
2
|
+
import type { FactoryTopologyReplayMessages } from "./factory-topology-replay";
|
|
3
|
+
import { type FactoryVisualizerError, type FactoryVisualizerErrorKind } from "./visualizer-error";
|
|
4
4
|
export declare function FactoryTopologyStateRegion({ messages, onRetry, state, }: {
|
|
5
5
|
messages: FactoryTopologyReplayMessages;
|
|
6
6
|
onRetry?: () => void;
|
|
7
7
|
state: "empty" | "failed" | "loading";
|
|
8
|
-
}): import("react").JSX.Element;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
interface FactoryTopologyErrorBoundaryProps {
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
errorKind: Extract<FactoryVisualizerErrorKind, "react-flow" | "render">;
|
|
@@ -24,8 +24,7 @@ export declare class FactoryTopologyErrorBoundary extends Component<FactoryTopol
|
|
|
24
24
|
static getDerivedStateFromError(): FactoryTopologyErrorBoundaryState;
|
|
25
25
|
componentDidCatch(error: unknown, _errorInfo: ErrorInfo): void;
|
|
26
26
|
componentDidUpdate(previousProps: FactoryTopologyErrorBoundaryProps): void;
|
|
27
|
-
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
27
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
28
28
|
private report;
|
|
29
29
|
}
|
|
30
|
-
export declare function useDistinctTopologyErrorReport(error: FactoryTopologyReplayError | undefined, onError: FactoryTopologyReplayProps["onError"]): void;
|
|
31
30
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export type { FactoryEmulatorFailure } from "./factory-emulator-error-boundary.j
|
|
|
3
3
|
export { FactoryEmulatorView, type FactoryEmulatorViewPreset, type FactoryEmulatorViewProps, type FactoryEmulatorViewVisibility, } from "./factory-emulator-view.js";
|
|
4
4
|
export { FactoryRecordingTopologyReplay, type FactoryRecordingTopologyReplayError, type FactoryRecordingTopologyReplayMessages, type FactoryRecordingTopologyReplayProps, type FactoryRecordingTopologyReplayState, type FactoryRecordingValidationDiagnostic, type FactoryRecordingValidationDiagnosticIssue, } from "./factory-recording-topology-replay.js";
|
|
5
5
|
export { type FactoryTimelineMode, FactoryTimelineScrubber, type FactoryTimelineScrubberMessages, type FactoryTimelineScrubberProps, type FactoryTimelineScrubberState, } from "./factory-timeline-scrubber.js";
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
8
|
-
export type { FactoryTopologyReplayError, FactoryVisualizationLayoutDiagnostic, FactoryVisualizerError, FactoryVisualizerErrorCause, FactoryVisualizerErrorKind, } from "./visualizer-error.js";
|
|
6
|
+
export { FactoryTopologyReplay, type FactoryTopologyReplayMessages, type FactoryTopologyReplayProps, type FactoryTopologyReplayState, } from "./factory-topology-replay.js";
|
|
7
|
+
export type { FactoryTopologyReplayError, FactoryVisualizerError, FactoryVisualizerErrorCause, FactoryVisualizerErrorKind, } from "./visualizer-error.js";
|
|
9
8
|
export { type WorkProgressCategoryMessage, WorkProgressVisualizer, type WorkProgressVisualizerMessages, type WorkProgressVisualizerProps, } from "./work-progress-visualizer.js";
|