@nice-code/action 0.2.17 → 0.2.19
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/build/devtools/browser/index.js +788 -335
- package/build/index.js +22 -1
- package/build/types/ActionRuntime/ActionRuntime.d.ts +1 -0
- package/build/types/ActionRuntime/Handler/ExternalClient/ActionExternalClientHandler.d.ts +1 -0
- package/build/types/devtools/browser/components/ActionErrorDisplay.d.ts +2 -1
- package/build/types/devtools/browser/components/DomainChip.d.ts +2 -1
- package/build/types/devtools/browser/components/HandlerChips.d.ts +2 -1
- package/build/types/devtools/browser/components/StackTraceSection.d.ts +4 -2
- package/build/types/devtools/browser/components/action_list/ActionEntryRow.d.ts +3 -3
- package/build/types/devtools/browser/devtools_storage.d.ts +6 -0
- package/build/types/devtools/core/ActionDevtools.types.d.ts +2 -5
- package/build/types/devtools/core/devtools_colors.d.ts +1 -0
- package/build/types/errors/err_nice_action.d.ts +2 -0
- package/package.json +4 -3
package/build/index.js
CHANGED
|
@@ -603,6 +603,7 @@ var EErrId_NiceAction;
|
|
|
603
603
|
EErrId_NiceAction2["wire_not_action_data"] = "wire_not_action_data";
|
|
604
604
|
EErrId_NiceAction2["client_runtime_already_registered"] = "client_runtime_already_registered";
|
|
605
605
|
EErrId_NiceAction2["client_runtime_not_registered"] = "client_runtime_not_registered";
|
|
606
|
+
EErrId_NiceAction2["runtime_reset"] = "runtime_reset";
|
|
606
607
|
EErrId_NiceAction2["no_client_runtimes_registered"] = "no_client_runtimes_registered";
|
|
607
608
|
EErrId_NiceAction2["action_input_validation_failed"] = "action_input_validation_failed";
|
|
608
609
|
EErrId_NiceAction2["action_input_validation_promise"] = "action_input_validation_promise";
|
|
@@ -643,6 +644,9 @@ var err_nice_action = err_nice.createChildDomain({
|
|
|
643
644
|
["wire_not_action_data" /* wire_not_action_data */]: err({
|
|
644
645
|
message: () => `Cannot handle wire for action: expected an object with a "domain" property of type string, a "form" property of "${"data" /* data */}" and a "type" property of "${"request" /* request */}", "${"progress" /* progress */}" or "${"result" /* result */}".`
|
|
645
646
|
}),
|
|
647
|
+
["runtime_reset" /* runtime_reset */]: err({
|
|
648
|
+
message: () => `Runtime has been reset.`
|
|
649
|
+
}),
|
|
646
650
|
["client_runtime_already_registered" /* client_runtime_already_registered */]: err({
|
|
647
651
|
message: ({ context, client }) => `Environment is already registered${context?.domain ? ` on domain "${context.domain}"` : ""} for client [${client.stringId}]. Each client specifier (exact match on all properties) may only be registered once.`
|
|
648
652
|
}),
|
|
@@ -1079,6 +1083,14 @@ class ActionRuntime {
|
|
|
1079
1083
|
}
|
|
1080
1084
|
return bestScore > 0 ? bestHandler : undefined;
|
|
1081
1085
|
}
|
|
1086
|
+
resetRuntime() {
|
|
1087
|
+
for (const ra of this._pendingRunningActions.values()) {
|
|
1088
|
+
ra._abort(err_nice_action.fromId("runtime_reset" /* runtime_reset */));
|
|
1089
|
+
}
|
|
1090
|
+
for (const handler of this._registeredExternalHandlers) {
|
|
1091
|
+
handler.clearTransportCache();
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1082
1094
|
_trySetupReturnDispatch(runningAction) {
|
|
1083
1095
|
const originClient = runningAction.context.originClient;
|
|
1084
1096
|
if (originClient.envId === UNSET_RUNTIME_ENV_ID || originClient.isSameFor(this._coordinate).id) {
|
|
@@ -1193,6 +1205,7 @@ class ActionLocalHandler extends ActionHandler {
|
|
|
1193
1205
|
if (state.result != null) {
|
|
1194
1206
|
return;
|
|
1195
1207
|
}
|
|
1208
|
+
await Promise.resolve();
|
|
1196
1209
|
pushHandlerCuid(runningAction.cuid);
|
|
1197
1210
|
try {
|
|
1198
1211
|
const rawResult = await handler(state.request);
|
|
@@ -2311,7 +2324,12 @@ class ActionExternalClientHandler extends ActionHandler {
|
|
|
2311
2324
|
handler: this.toHandlerRouteItem(transport),
|
|
2312
2325
|
time: Date.now()
|
|
2313
2326
|
});
|
|
2314
|
-
const runningAction = new RunningAction({
|
|
2327
|
+
const runningAction = new RunningAction({
|
|
2328
|
+
context: action.context,
|
|
2329
|
+
request: action,
|
|
2330
|
+
parentCuid,
|
|
2331
|
+
callSite
|
|
2332
|
+
});
|
|
2315
2333
|
localRuntime.registerRunningAction(runningAction);
|
|
2316
2334
|
const routeActionParams = {
|
|
2317
2335
|
action,
|
|
@@ -2361,6 +2379,9 @@ class ActionExternalClientHandler extends ActionHandler {
|
|
|
2361
2379
|
transType: transport.type
|
|
2362
2380
|
};
|
|
2363
2381
|
}
|
|
2382
|
+
clearTransportCache() {
|
|
2383
|
+
this._transportCache.clear();
|
|
2384
|
+
}
|
|
2364
2385
|
}
|
|
2365
2386
|
var createExternalClientHandler = (config) => {
|
|
2366
2387
|
return new ActionExternalClientHandler(config);
|
|
@@ -51,5 +51,6 @@ export declare class ActionRuntime {
|
|
|
51
51
|
* Returns `undefined` if no handler matches (score > 0 required, i.e. at least id must match).
|
|
52
52
|
*/
|
|
53
53
|
getReturnHandlerForOrigin(originClient: RuntimeCoordinate): ActionExternalClientHandler | undefined;
|
|
54
|
+
resetRuntime(): void;
|
|
54
55
|
private _trySetupReturnDispatch;
|
|
55
56
|
}
|
|
@@ -38,5 +38,6 @@ export declare class ActionExternalClientHandler extends ActionHandler<EActionHa
|
|
|
38
38
|
}): Promise<boolean>;
|
|
39
39
|
toJsonObject(): IActionHandler_ExternalClient_Json;
|
|
40
40
|
toHandlerRouteItem(transport: Transport): IActionRouteItemHandler;
|
|
41
|
+
clearTransportCache(): void;
|
|
41
42
|
}
|
|
42
43
|
export declare const createExternalClientHandler: (config: IActionExternalClientRequestHandlerConfig) => ActionExternalClientHandler;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IDevtoolsActionEntry } from "../../core/ActionDevtools.types";
|
|
2
|
-
export declare function ActionErrorDisplay({ entry }: {
|
|
2
|
+
export declare function ActionErrorDisplay({ entry, compact, }: {
|
|
3
3
|
entry: IDevtoolsActionEntry;
|
|
4
|
+
compact?: boolean;
|
|
4
5
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ESize } from "../ui_util/size";
|
|
2
|
-
export declare function DomainChip({ subtle, domain, allDomains, size, }: {
|
|
2
|
+
export declare function DomainChip({ compact, subtle, domain, allDomains, size, }: {
|
|
3
|
+
compact?: boolean;
|
|
3
4
|
subtle?: boolean;
|
|
4
5
|
domain: string;
|
|
5
6
|
allDomains: string[];
|
|
@@ -4,6 +4,7 @@ export declare function getExternalLabel(hop: IDevtoolsRouteItem): string | null
|
|
|
4
4
|
interface IHandlerChipsProps {
|
|
5
5
|
entry: IDevtoolsActionEntry;
|
|
6
6
|
size: ESize;
|
|
7
|
+
subtle?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function HandlerChips({ entry, size }: IHandlerChipsProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function HandlerChips({ entry, size, subtle }: IHandlerChipsProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
1
|
+
import type { IRuntimeCoordinate } from "../../../ActionRuntime/RuntimeCoordinate";
|
|
2
|
+
export declare function countUserFrames(_runtime: IRuntimeCoordinate, stack: string | undefined): number;
|
|
3
|
+
export declare function StackTraceSection({ label, stack, color, runtime, minFrameCount, }: {
|
|
3
4
|
label: string;
|
|
4
5
|
stack: string | undefined;
|
|
6
|
+
runtime: IRuntimeCoordinate;
|
|
5
7
|
color?: string;
|
|
6
8
|
minFrameCount?: number;
|
|
7
9
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IDevtoolsActionEntry
|
|
2
|
-
export declare function ActionEntryRow({ entry, isSelected, onClick, isLatest, latestTime,
|
|
1
|
+
import type { IDevtoolsActionEntry } from "../../../core/ActionDevtools.types";
|
|
2
|
+
export declare function ActionEntryRow({ entry, isSelected, onClick, isLatest, latestTime, childEntries, breakReasons, groupEntries, selectedGroupCuid, onSelectGroupEntry, }: {
|
|
3
3
|
entry: IDevtoolsActionEntry;
|
|
4
4
|
isSelected: boolean;
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
isLatest?: boolean;
|
|
7
7
|
latestTime?: number;
|
|
8
|
-
|
|
8
|
+
childEntries?: IDevtoolsActionEntry[];
|
|
9
9
|
breakReasons?: string[];
|
|
10
10
|
groupEntries?: IDevtoolsActionEntry[];
|
|
11
11
|
selectedGroupCuid?: string | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TRuntimeCoordinateEnvId } from "../../ActionRuntime/RuntimeCoordinate";
|
|
2
|
+
interface TBrowserDevtoolsTypedStorage {
|
|
3
|
+
runtimeToProjectFilePath: Record<TRuntimeCoordinateEnvId, string>;
|
|
4
|
+
}
|
|
5
|
+
export declare const devtools_storage: import("@nice-code/util").ITypedStorage<TBrowserDevtoolsTypedStorage>;
|
|
6
|
+
export {};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { TActionProgress } from "../../ActionDefinition/Action/Payload/ActionPayload.types";
|
|
2
|
+
import type { IRuntimeCoordinate } from "../../ActionRuntime/RuntimeCoordinate";
|
|
2
3
|
export type TDevtoolsActionStatus = "running" | "success" | "action-error" | "failed" | "aborted";
|
|
3
4
|
export type TDevtoolsPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left" | "dock-bottom" | "dock-top" | "dock-left" | "dock-right";
|
|
4
5
|
export interface IDevtoolsRouteItem {
|
|
5
|
-
runtime:
|
|
6
|
-
envId: string;
|
|
7
|
-
perId?: string;
|
|
8
|
-
insId?: string;
|
|
9
|
-
};
|
|
6
|
+
runtime: IRuntimeCoordinate;
|
|
10
7
|
handlerType: "local" | "external";
|
|
11
8
|
handlerClient?: {
|
|
12
9
|
envId: string;
|
|
@@ -13,6 +13,7 @@ export declare const DEVTOOL_COLOR_TEXT_SECONDARY = "#cbd5e1";
|
|
|
13
13
|
export declare const DEVTOOL_COLOR_TEXT_MUTED = "#64748b";
|
|
14
14
|
export declare const DEVTOOL_COLOR_TEXT_FAINT = "#334155";
|
|
15
15
|
export declare const DEVTOOL_LIST_BASE_BACKGROUND = "#0f172a";
|
|
16
|
+
export declare const DEVTOOL_LIST_HEADER_SELECTED_BACKGROUND = "#1d2942";
|
|
16
17
|
export declare const DEVTOOL_LIST_GROUP_DIVIDER = "#101109";
|
|
17
18
|
export declare const DEVTOOL_DETAIL_BASE_BACKGROUND = "#0d1729";
|
|
18
19
|
export declare const DEVTOOL_DETAIL_HEADER_BACKGROUND = "#131f35";
|
|
@@ -13,6 +13,7 @@ export declare enum EErrId_NiceAction {
|
|
|
13
13
|
wire_not_action_data = "wire_not_action_data",
|
|
14
14
|
client_runtime_already_registered = "client_runtime_already_registered",
|
|
15
15
|
client_runtime_not_registered = "client_runtime_not_registered",
|
|
16
|
+
runtime_reset = "runtime_reset",
|
|
16
17
|
no_client_runtimes_registered = "no_client_runtimes_registered",
|
|
17
18
|
action_input_validation_failed = "action_input_validation_failed",
|
|
18
19
|
action_input_validation_promise = "action_input_validation_promise",
|
|
@@ -61,6 +62,7 @@ export declare const err_nice_action: import("@nice-code/error").NiceErrorDomain
|
|
|
61
62
|
actionState: string | undefined;
|
|
62
63
|
}, import("@nice-code/error").JSONSerializableValue>;
|
|
63
64
|
wire_not_action_data: import("@nice-code/error").INiceErrorIdMetadata<any, import("@nice-code/error").JSONSerializableValue>;
|
|
65
|
+
runtime_reset: import("@nice-code/error").INiceErrorIdMetadata<any, import("@nice-code/error").JSONSerializableValue>;
|
|
64
66
|
client_runtime_already_registered: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
65
67
|
context?: IActionRuntimeManagerContext;
|
|
66
68
|
client: RuntimeCoordinate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-code/action",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -44,8 +44,9 @@
|
|
|
44
44
|
"build-types": "tsc --project tsconfig.build.json"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@nice-code/common-errors": "0.2.
|
|
48
|
-
"@nice-code/error": "0.2.
|
|
47
|
+
"@nice-code/common-errors": "0.2.19",
|
|
48
|
+
"@nice-code/error": "0.2.19",
|
|
49
|
+
"@nice-code/util": "0.2.19",
|
|
49
50
|
"@standard-schema/spec": "^1.1.0",
|
|
50
51
|
"@tanstack/react-virtual": "^3.13.26",
|
|
51
52
|
"http-status-codes": "^2.3.0",
|