@nice-code/action 0.2.15 → 0.2.17

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.
Files changed (29) hide show
  1. package/build/devtools/browser/index.js +4086 -1494
  2. package/build/devtools/server/index.js +35 -7
  3. package/build/index.js +112 -22
  4. package/build/react-query/index.js +22 -4
  5. package/build/types/ActionDefinition/Action/Payload/ActionPayload.types.d.ts +3 -1
  6. package/build/types/ActionDefinition/Action/Payload/ActionPayload_Request.d.ts +1 -0
  7. package/build/types/ActionDefinition/Action/Payload/ActionPayload_Result.d.ts +1 -0
  8. package/build/types/ActionDefinition/Action/RunningAction.d.ts +1 -0
  9. package/build/types/ActionDefinition/Domain/ActionDomain.d.ts +2 -1
  10. package/build/types/ActionDefinition/Domain/ActionRootDomain.d.ts +1 -1
  11. package/build/types/ActionDefinition/Schema/ActionSchema.d.ts +0 -18
  12. package/build/types/devtools/browser/components/ActionErrorDisplay.d.ts +4 -0
  13. package/build/types/devtools/browser/components/ChildDispatchChips.d.ts +5 -3
  14. package/build/types/devtools/browser/components/Chip.d.ts +17 -5
  15. package/build/types/devtools/browser/components/DomainChip.d.ts +3 -11
  16. package/build/types/devtools/browser/components/HandlerChips.d.ts +2 -1
  17. package/build/types/devtools/browser/components/Icon.d.ts +15 -0
  18. package/build/types/devtools/browser/components/NiceErrorDisplay.d.ts +19 -0
  19. package/build/types/devtools/browser/components/StackTraceSection.d.ts +3 -1
  20. package/build/types/devtools/browser/components/Tooltip.d.ts +14 -0
  21. package/build/types/devtools/browser/components/{ActionDetailPanel.d.ts → action_detail/ActionDetailPanel.d.ts} +1 -1
  22. package/build/types/devtools/browser/components/action_list/ActionEntryRow.d.ts +13 -0
  23. package/build/types/devtools/browser/components/utils.d.ts +4 -0
  24. package/build/types/devtools/browser/ui_util/size.d.ts +6 -0
  25. package/build/types/devtools/core/ActionDevtools.types.d.ts +4 -1
  26. package/build/types/devtools/core/devtools_colors.d.ts +57 -0
  27. package/build/types/utils/hashPayloadData.d.ts +5 -0
  28. package/package.json +4 -3
  29. package/build/types/devtools/browser/components/ActionEntryRow.d.ts +0 -11
@@ -0,0 +1,13 @@
1
+ import type { IDevtoolsActionEntry, IDevtoolsRouteItem } from "../../../core/ActionDevtools.types";
2
+ export declare function ActionEntryRow({ entry, isSelected, onClick, isLatest, latestTime, childExternalRouteEntries, breakReasons, groupEntries, selectedGroupCuid, onSelectGroupEntry, }: {
3
+ entry: IDevtoolsActionEntry;
4
+ isSelected: boolean;
5
+ onClick: () => void;
6
+ isLatest?: boolean;
7
+ latestTime?: number;
8
+ childExternalRouteEntries?: IDevtoolsRouteItem[];
9
+ breakReasons?: string[];
10
+ groupEntries?: IDevtoolsActionEntry[];
11
+ selectedGroupCuid?: string | null;
12
+ onSelectGroupEntry?: (cuid: string) => void;
13
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,10 @@
1
+ import { type LucideIcon } from "lucide-react";
1
2
  import type { IDevtoolsActionEntry, TDevtoolsActionStatus } from "../../core/ActionDevtools.types";
3
+ import { ESemanticThing } from "../../core/devtools_colors";
2
4
  export declare const STATUS_COLOR: Record<TDevtoolsActionStatus, string>;
5
+ export declare const STATUS_THING: Record<TDevtoolsActionStatus, ESemanticThing>;
3
6
  export declare const STATUS_SYMBOL: Record<TDevtoolsActionStatus, string>;
7
+ export declare const STATUS_ICON: Record<TDevtoolsActionStatus, LucideIcon>;
4
8
  export declare function safeStringify(value: unknown, indent?: number): string;
5
9
  export declare function formatRelativeAge(ms: number): string;
6
10
  export declare function formatDuration(entry: IDevtoolsActionEntry): string | null;
@@ -0,0 +1,6 @@
1
+ export declare enum ESize {
2
+ sm = "sm",
3
+ md = "md",
4
+ lg = "lg"
5
+ }
6
+ export declare function getSizeValue(size: ESize): number;
@@ -1,5 +1,5 @@
1
1
  import type { TActionProgress } from "../../ActionDefinition/Action/Payload/ActionPayload.types";
2
- export type TDevtoolsActionStatus = "running" | "success" | "failed" | "aborted";
2
+ export type TDevtoolsActionStatus = "running" | "success" | "action-error" | "failed" | "aborted";
3
3
  export type TDevtoolsPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left" | "dock-bottom" | "dock-top" | "dock-left" | "dock-right";
4
4
  export interface IDevtoolsRouteItem {
5
5
  runtime: {
@@ -15,6 +15,7 @@ export interface IDevtoolsRouteItem {
15
15
  };
16
16
  transport?: string;
17
17
  time: number;
18
+ label?: string;
18
19
  }
19
20
  export interface IDevtoolsActionMeta {
20
21
  timeCreated: number;
@@ -34,7 +35,9 @@ export interface IDevtoolsActionEntry {
34
35
  startTime: number;
35
36
  endTime?: number;
36
37
  input: unknown;
38
+ inputHash?: string;
37
39
  output?: unknown;
40
+ outputHash?: string;
38
41
  error?: unknown;
39
42
  abortReason?: unknown;
40
43
  progressUpdates: TActionProgress[];
@@ -1,4 +1,61 @@
1
+ import type { IChipColorEntry } from "../browser/components/Chip";
2
+ export declare const DEVTOOL_COLOR_SEMANTIC_ERROR = "#FF5C5C";
3
+ export declare const DEVTOOL_COLOR_SEMANTIC_SUCCESS = "#A3E635";
4
+ export declare const DEVTOOL_COLOR_SEMANTIC_SYSTEM = "#38BDF8";
5
+ export declare const DEVTOOL_COLOR_SEMANTIC_WARNING = "#FB923C";
6
+ export declare const DEVTOOL_COLOR_SEMANTIC_METADATA = "#A1A1AA";
1
7
  export declare const DEVTOOL_COLOR_HANDLER_LOCAL_TEXT = "#34bb89";
2
8
  export declare const DEVTOOL_COLOR_HANDLER_LOCAL_BORDER = "#144427";
3
9
  export declare const DEVTOOL_COLOR_HANDLER_EXTERNAL_TEXT = "#cfa12a";
4
10
  export declare const DEVTOOL_COLOR_HANDLER_EXTERNAL_BORDER = "#723917";
11
+ export declare const DEVTOOL_COLOR_TEXT_EMPHASIS = "#f1f5f9";
12
+ export declare const DEVTOOL_COLOR_TEXT_SECONDARY = "#cbd5e1";
13
+ export declare const DEVTOOL_COLOR_TEXT_MUTED = "#64748b";
14
+ export declare const DEVTOOL_COLOR_TEXT_FAINT = "#334155";
15
+ export declare const DEVTOOL_LIST_BASE_BACKGROUND = "#0f172a";
16
+ export declare const DEVTOOL_LIST_GROUP_DIVIDER = "#101109";
17
+ export declare const DEVTOOL_DETAIL_BASE_BACKGROUND = "#0d1729";
18
+ export declare const DEVTOOL_DETAIL_HEADER_BACKGROUND = "#131f35";
19
+ export declare const DEVTOOL_SECTION_BACKGROUND = "#1e293b";
20
+ export declare const DEVTOOL_SECTION_STRING_BACKGROUND = "#0d131f";
21
+ export declare const DEVTOOL_STACK_TRACE_BACKGROUND = "#040a13";
22
+ export declare const DEVTOOL_PANEL_BORDER = "#1e293b";
23
+ export declare const DEVTOOL_PANEL_DIVIDER_BORDER = "#1d3352";
24
+ export declare const DEVTOOL_ERROR_BACKGROUND = "#1e0a0a";
25
+ export declare const DEVTOOL_ERROR_BADGE_BACKGROUND = "#2d0f0f";
26
+ export declare const DEVTOOL_TOOLTIP_BACKGROUND = "#0c1526";
27
+ export declare const DEVTOOL_TOOLTIP_TITLE_BACKGROUND = "#101b2e";
28
+ export declare const DEVTOOL_TOOLTIP_TITLE_BOTTOM_BORDER = "#211f5f";
29
+ export declare const DEVTOOL_TOOLTIP_BORDER = "#312e81";
30
+ export declare const DEVTOOL_COLOR_CALL_STACK_DIVIDER = "#0a1120";
31
+ export declare const DEVTOOL_JSON_KEY = "#a5b4fc";
32
+ export declare const DEVTOOL_JSON_STRING = "#fbbf24";
33
+ export declare const DEVTOOL_JSON_NUMBER = "#34d399";
34
+ export declare const DEVTOOL_JSON_KEYWORD = "#a78bfa";
35
+ export declare const DEVTOOL_JSON_PUNCTUATION = "#475569";
36
+ export declare const DEVTOOL_STACK_FRAME_USER_NUMBER = "#64748b";
37
+ export declare const DEVTOOL_STACK_FRAME_USER_FUNCTION = "#e2e8f0";
38
+ export declare const DEVTOOL_STACK_FRAME_USER_FOLDER = "#596b83";
39
+ export declare const DEVTOOL_STACK_FRAME_USER_FILE = "#8a9ebb";
40
+ export declare const DEVTOOL_STACK_FRAME_USER_LINE = "#4a7fa8";
41
+ export declare const DEVTOOL_STACK_FRAME_INTERNAL_NUMBER = "#2d3f53";
42
+ export declare const DEVTOOL_STACK_FRAME_INTERNAL_FUNCTION = "#50698b";
43
+ export declare const DEVTOOL_STACK_FRAME_INTERNAL_FOLDER = "#2d3f53";
44
+ export declare const DEVTOOL_STACK_FRAME_INTERNAL_FILE = "#425979";
45
+ export declare const DEVTOOL_STACK_FRAME_INTERNAL_LINE = "#2d4a63";
46
+ export declare enum ESemanticThing {
47
+ running_action = "running_action",
48
+ success = "success",
49
+ action_error = "action_error",
50
+ failed = "failed",
51
+ aborted = "aborted",
52
+ error = "error",// error chip in list / tooltip
53
+ domain = "domain",
54
+ handler_local = "handler_local",
55
+ handler_external = "handler_external",
56
+ age = "age",// non-latest relative-age chip
57
+ io_input = "io_input",
58
+ io_output = "io_output",
59
+ default = "default"
60
+ }
61
+ export declare const SEMANTIC_COLORS: Record<ESemanticThing, IChipColorEntry>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Produces a deterministic 8-char hex hash of any JSON-serializable value.
3
+ * Useful for grouping/comparing action inputs, outputs, and progress payloads.
4
+ */
5
+ export declare function hashPayloadData(data: unknown): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-code/action",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -44,11 +44,12 @@
44
44
  "build-types": "tsc --project tsconfig.build.json"
45
45
  },
46
46
  "dependencies": {
47
- "@nice-code/common-errors": "0.2.15",
48
- "@nice-code/error": "0.2.15",
47
+ "@nice-code/common-errors": "0.2.17",
48
+ "@nice-code/error": "0.2.17",
49
49
  "@standard-schema/spec": "^1.1.0",
50
50
  "@tanstack/react-virtual": "^3.13.26",
51
51
  "http-status-codes": "^2.3.0",
52
+ "lucide-react": "1.17.0",
52
53
  "nanoid": "^5.1.9",
53
54
  "source-map-js": "^1.2.1",
54
55
  "std-env": "^4.1.0"
@@ -1,11 +0,0 @@
1
- import type { IDevtoolsActionEntry } from "../../core/ActionDevtools.types";
2
- export declare function ActionEntryRow({ entry, isSelected, onClick, groupCount, isSubEntry, isLatest, latestTime, childExternalLabels, }: {
3
- entry: IDevtoolsActionEntry;
4
- isSelected: boolean;
5
- onClick: () => void;
6
- groupCount?: number;
7
- isSubEntry?: boolean;
8
- isLatest?: boolean;
9
- latestTime?: number;
10
- childExternalLabels?: string[];
11
- }): import("react/jsx-runtime").JSX.Element;