devwing 0.1.19 → 0.1.21
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/index.js +26 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -543,8 +543,6 @@ async function loginCommand() {
|
|
|
543
543
|
return;
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
logger.printBanner();
|
|
547
|
-
logger.newline();
|
|
548
546
|
const { method } = await inquirer5.prompt([
|
|
549
547
|
{
|
|
550
548
|
type: "list",
|
|
@@ -569,7 +567,6 @@ async function loginCommand() {
|
|
|
569
567
|
if (error.message) {
|
|
570
568
|
logger.error(error.message);
|
|
571
569
|
}
|
|
572
|
-
process.exit(1);
|
|
573
570
|
}
|
|
574
571
|
}
|
|
575
572
|
async function loginWithEmail() {
|
|
@@ -779,7 +776,6 @@ async function logoutCommand() {
|
|
|
779
776
|
} catch (error) {
|
|
780
777
|
logger.error("Logout failed");
|
|
781
778
|
logger.error(error.message || "Unknown error");
|
|
782
|
-
process.exit(1);
|
|
783
779
|
}
|
|
784
780
|
}
|
|
785
781
|
async function statusCommand() {
|
|
@@ -822,7 +818,6 @@ async function statusCommand() {
|
|
|
822
818
|
} catch (error) {
|
|
823
819
|
logger.error("Failed to check status");
|
|
824
820
|
logger.error(error.message || "Unknown error");
|
|
825
|
-
process.exit(1);
|
|
826
821
|
}
|
|
827
822
|
}
|
|
828
823
|
function showQuickStart() {
|
|
@@ -2684,6 +2679,20 @@ var TOOL_ICONS = {
|
|
|
2684
2679
|
http_request: "\u{1F310}",
|
|
2685
2680
|
cve_lookup: "\u{1F512}"
|
|
2686
2681
|
};
|
|
2682
|
+
function resetStdinState() {
|
|
2683
|
+
try {
|
|
2684
|
+
if (typeof process.stdin.setRawMode === "function") {
|
|
2685
|
+
try {
|
|
2686
|
+
process.stdin.setRawMode(false);
|
|
2687
|
+
} catch {
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
process.stdin.removeAllListeners("keypress");
|
|
2691
|
+
process.stdin.removeAllListeners("data");
|
|
2692
|
+
if (process.stdin.isPaused()) process.stdin.resume();
|
|
2693
|
+
} catch {
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2687
2696
|
async function showToolCall(tool, args) {
|
|
2688
2697
|
await sleep(PAUSE_SHORT);
|
|
2689
2698
|
console.log();
|
|
@@ -2702,6 +2711,8 @@ async function showToolCall(tool, args) {
|
|
|
2702
2711
|
default: true
|
|
2703
2712
|
}
|
|
2704
2713
|
]);
|
|
2714
|
+
resetStdinState();
|
|
2715
|
+
await sleep(60);
|
|
2705
2716
|
if (!allowed) {
|
|
2706
2717
|
console.log(chalk7.dim(" \u2717 Skipped"));
|
|
2707
2718
|
throw Object.assign(new Error("TOOL_SKIPPED"), { skipped: true });
|
|
@@ -2761,6 +2772,7 @@ function isDemoMode() {
|
|
|
2761
2772
|
}
|
|
2762
2773
|
var __sessionFile = fileURLToPath(import.meta.url);
|
|
2763
2774
|
var __sessionDir = dirname(__sessionFile);
|
|
2775
|
+
var sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
2764
2776
|
function getVersion() {
|
|
2765
2777
|
const paths = [
|
|
2766
2778
|
join(__sessionDir, "../package.json"),
|
|
@@ -2775,7 +2787,7 @@ function getVersion() {
|
|
|
2775
2787
|
continue;
|
|
2776
2788
|
}
|
|
2777
2789
|
}
|
|
2778
|
-
return "0.1.
|
|
2790
|
+
return "0.1.21";
|
|
2779
2791
|
}
|
|
2780
2792
|
var DEMO_USER2 = {
|
|
2781
2793
|
id: "usr_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
@@ -2907,17 +2919,17 @@ var InteractiveSession = class {
|
|
|
2907
2919
|
}
|
|
2908
2920
|
resetStdin() {
|
|
2909
2921
|
try {
|
|
2910
|
-
if (process.stdin.isPaused()) {
|
|
2911
|
-
process.stdin.resume();
|
|
2912
|
-
}
|
|
2913
|
-
process.stdin.removeAllListeners("keypress");
|
|
2914
|
-
process.stdin.removeAllListeners("data");
|
|
2915
2922
|
if (typeof process.stdin.setRawMode === "function") {
|
|
2916
2923
|
try {
|
|
2917
2924
|
process.stdin.setRawMode(false);
|
|
2918
2925
|
} catch {
|
|
2919
2926
|
}
|
|
2920
2927
|
}
|
|
2928
|
+
process.stdin.removeAllListeners("keypress");
|
|
2929
|
+
process.stdin.removeAllListeners("data");
|
|
2930
|
+
if (process.stdin.isPaused()) {
|
|
2931
|
+
process.stdin.resume();
|
|
2932
|
+
}
|
|
2921
2933
|
} catch {
|
|
2922
2934
|
}
|
|
2923
2935
|
}
|
|
@@ -3073,6 +3085,7 @@ var InteractiveSession = class {
|
|
|
3073
3085
|
logger.error(error.message || "Command failed");
|
|
3074
3086
|
}
|
|
3075
3087
|
this.resetStdin();
|
|
3088
|
+
await sleep2(80);
|
|
3076
3089
|
this.recreateReadline();
|
|
3077
3090
|
}
|
|
3078
3091
|
// ============================================================
|
|
@@ -3098,6 +3111,7 @@ var InteractiveSession = class {
|
|
|
3098
3111
|
logger.error(error.message || "Command failed");
|
|
3099
3112
|
}
|
|
3100
3113
|
this.resetStdin();
|
|
3114
|
+
await sleep2(80);
|
|
3101
3115
|
this.recreateReadline();
|
|
3102
3116
|
return;
|
|
3103
3117
|
}
|
|
@@ -3175,6 +3189,7 @@ ${recent[recent.length - 1].content}`;
|
|
|
3175
3189
|
// ============================================================
|
|
3176
3190
|
exitSession() {
|
|
3177
3191
|
if (this.sigintTimer) clearTimeout(this.sigintTimer);
|
|
3192
|
+
this.resetStdin();
|
|
3178
3193
|
console.log();
|
|
3179
3194
|
console.log(chalk7.dim(" Goodbye! Happy coding."));
|
|
3180
3195
|
console.log();
|