@midscene/visualizer 0.20.0 → 0.20.1-beta-20250624021341.0
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/dist/es/component/playground/playground-utils.js +10 -0
- package/dist/es/index.js +2 -0
- package/dist/index.js +1 -1
- package/dist/lib/component/playground/playground-utils.js +11 -0
- package/dist/lib/index.js +2 -0
- package/dist/types/component/playground/playground-utils.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -68,6 +68,15 @@ const overrideServerConfig = (aiConfig) => __async(void 0, null, function* () {
|
|
|
68
68
|
body: JSON.stringify({ aiConfig })
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
|
+
const cancelTask = (requestId) => __async(void 0, null, function* () {
|
|
72
|
+
try {
|
|
73
|
+
const res = yield fetch(`${serverBase}/cancel/${requestId}`);
|
|
74
|
+
return res.json();
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error("Failed to cancel task:", error);
|
|
77
|
+
return { error: "Failed to cancel task" };
|
|
78
|
+
}
|
|
79
|
+
});
|
|
71
80
|
const getTaskProgress = (requestId) => __async(void 0, null, function* () {
|
|
72
81
|
try {
|
|
73
82
|
const response = yield fetch(`${serverBase}/task-progress/${requestId}`);
|
|
@@ -120,6 +129,7 @@ const blankResult = {
|
|
|
120
129
|
export {
|
|
121
130
|
actionNameForType,
|
|
122
131
|
blankResult,
|
|
132
|
+
cancelTask,
|
|
123
133
|
checkServerStatus,
|
|
124
134
|
formatErrorMessage,
|
|
125
135
|
getPlaceholderForType,
|
package/dist/es/index.js
CHANGED
|
@@ -30,6 +30,7 @@ import { GithubStar } from "./component/github-star";
|
|
|
30
30
|
import { Describer } from "./component/describer";
|
|
31
31
|
import {
|
|
32
32
|
requestPlaygroundServer,
|
|
33
|
+
cancelTask,
|
|
33
34
|
overrideServerConfig,
|
|
34
35
|
getTaskProgress,
|
|
35
36
|
checkServerStatus,
|
|
@@ -56,6 +57,7 @@ export {
|
|
|
56
57
|
actionNameForType,
|
|
57
58
|
allScriptsFromDump,
|
|
58
59
|
blankResult,
|
|
60
|
+
cancelTask,
|
|
59
61
|
checkServerStatus,
|
|
60
62
|
colorForName,
|
|
61
63
|
filterBase64Value,
|