@react-grab/ami 0.0.85 → 0.0.87
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/cli.cjs +2 -2
- package/dist/cli.js +2 -2
- package/dist/client.cjs +61 -44
- package/dist/client.global.js +15 -15
- package/dist/client.js +61 -44
- package/dist/server.cjs +2 -2
- package/dist/server.js +2 -2
- package/package.json +3 -2
package/dist/cli.cjs
CHANGED
|
@@ -101,7 +101,7 @@ var require_picocolors = __commonJS({
|
|
|
101
101
|
|
|
102
102
|
// src/cli.ts
|
|
103
103
|
var import_picocolors = __toESM(require_picocolors());
|
|
104
|
-
var VERSION = "0.0.
|
|
104
|
+
var VERSION = "0.0.87";
|
|
105
105
|
console.log(
|
|
106
|
-
`${import_picocolors.default.magenta("\
|
|
106
|
+
`${import_picocolors.default.magenta("\u273F")} ${import_picocolors.default.bold("React Grab")} ${import_picocolors.default.gray(VERSION)} ${import_picocolors.default.dim("(Ami)")}`
|
|
107
107
|
);
|
package/dist/cli.js
CHANGED
|
@@ -99,7 +99,7 @@ var require_picocolors = __commonJS({
|
|
|
99
99
|
|
|
100
100
|
// src/cli.ts
|
|
101
101
|
var import_picocolors = __toESM(require_picocolors());
|
|
102
|
-
var VERSION = "0.0.
|
|
102
|
+
var VERSION = "0.0.87";
|
|
103
103
|
console.log(
|
|
104
|
-
`${import_picocolors.default.magenta("\
|
|
104
|
+
`${import_picocolors.default.magenta("\u273F")} ${import_picocolors.default.bold("React Grab")} ${import_picocolors.default.gray(VERSION)} ${import_picocolors.default.dim("(Ami)")}`
|
|
105
105
|
);
|
package/dist/client.cjs
CHANGED
|
@@ -17364,6 +17364,9 @@ var q = async (e) => {
|
|
|
17364
17364
|
return { success: o2.success, patches: t2.patches, error: o2.error };
|
|
17365
17365
|
};
|
|
17366
17366
|
|
|
17367
|
+
// src/constants.ts
|
|
17368
|
+
var COMPLETED_STATUS = "COMPLETED_STATUS";
|
|
17369
|
+
|
|
17367
17370
|
// src/client.ts
|
|
17368
17371
|
var STORAGE_KEY = "react-grab:agent-sessions";
|
|
17369
17372
|
var TOKEN_STORAGE_KEY = "react-grab:ami-token";
|
|
@@ -17487,7 +17490,7 @@ ${context.content}`;
|
|
|
17487
17490
|
case "aborted":
|
|
17488
17491
|
throw new Error("User aborted task");
|
|
17489
17492
|
default:
|
|
17490
|
-
return { status:
|
|
17493
|
+
return { status: COMPLETED_STATUS, messages, chatId };
|
|
17491
17494
|
}
|
|
17492
17495
|
};
|
|
17493
17496
|
var CONNECTION_CHECK_TTL_MS = 5e3;
|
|
@@ -17508,7 +17511,7 @@ var createAmiAgentProvider = (projectId) => {
|
|
|
17508
17511
|
if (!projectId) {
|
|
17509
17512
|
throw new Error("No project found");
|
|
17510
17513
|
}
|
|
17511
|
-
yield "Thinking
|
|
17514
|
+
yield "Thinking\u2026";
|
|
17512
17515
|
const statusQueue = [];
|
|
17513
17516
|
let resolveWait = null;
|
|
17514
17517
|
let aborted2 = false;
|
|
@@ -17563,37 +17566,44 @@ var createAmiAgentProvider = (projectId) => {
|
|
|
17563
17566
|
resolveWait = null;
|
|
17564
17567
|
}
|
|
17565
17568
|
});
|
|
17566
|
-
|
|
17567
|
-
if (status === "Completed successfully") {
|
|
17568
|
-
const totalSeconds = ((Date.now() - startTime) / 1e3).toFixed(1);
|
|
17569
|
-
return `Completed in ${totalSeconds}s`;
|
|
17570
|
-
}
|
|
17571
|
-
return status;
|
|
17572
|
-
};
|
|
17569
|
+
let lastStatus = null;
|
|
17573
17570
|
try {
|
|
17574
17571
|
while (!done && !aborted2) {
|
|
17575
17572
|
if (signal.aborted) {
|
|
17576
17573
|
throw new DOMException("Aborted", "AbortError");
|
|
17577
17574
|
}
|
|
17578
17575
|
if (statusQueue.length > 0) {
|
|
17579
|
-
|
|
17580
|
-
|
|
17581
|
-
|
|
17582
|
-
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
)
|
|
17588
|
-
]);
|
|
17589
|
-
if (waitResult === "timeout" && !done && !aborted2) {
|
|
17590
|
-
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17591
|
-
yield `Working\u2026 ${elapsedSeconds.toFixed(1)}s`;
|
|
17576
|
+
const status = statusQueue.shift();
|
|
17577
|
+
lastStatus = status;
|
|
17578
|
+
}
|
|
17579
|
+
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17580
|
+
if (lastStatus) {
|
|
17581
|
+
if (lastStatus === COMPLETED_STATUS) {
|
|
17582
|
+
yield `Completed in ${elapsedSeconds.toFixed(1)}s`;
|
|
17583
|
+
} else {
|
|
17584
|
+
yield `${lastStatus} ${elapsedSeconds.toFixed(1)}s`;
|
|
17592
17585
|
}
|
|
17586
|
+
} else {
|
|
17587
|
+
yield `Working\u2026 ${elapsedSeconds.toFixed(1)}s`;
|
|
17593
17588
|
}
|
|
17589
|
+
await Promise.race([
|
|
17590
|
+
new Promise((resolve3) => {
|
|
17591
|
+
resolveWait = () => resolve3("status");
|
|
17592
|
+
}),
|
|
17593
|
+
new Promise(
|
|
17594
|
+
(resolve3) => setTimeout(() => resolve3("timeout"), 100)
|
|
17595
|
+
)
|
|
17596
|
+
]);
|
|
17594
17597
|
}
|
|
17595
17598
|
while (statusQueue.length > 0 && !aborted2) {
|
|
17596
|
-
|
|
17599
|
+
const status = statusQueue.shift();
|
|
17600
|
+
lastStatus = status;
|
|
17601
|
+
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17602
|
+
if (status === COMPLETED_STATUS) {
|
|
17603
|
+
yield `Completed in ${elapsedSeconds.toFixed(1)}s`;
|
|
17604
|
+
} else {
|
|
17605
|
+
yield `${status} ${elapsedSeconds.toFixed(1)}s`;
|
|
17606
|
+
}
|
|
17597
17607
|
}
|
|
17598
17608
|
if (aborted2) {
|
|
17599
17609
|
throw new DOMException("Aborted", "AbortError");
|
|
@@ -17663,37 +17673,44 @@ var createAmiAgentProvider = (projectId) => {
|
|
|
17663
17673
|
resolveWait = null;
|
|
17664
17674
|
}
|
|
17665
17675
|
});
|
|
17666
|
-
|
|
17667
|
-
if (status === "Completed successfully") {
|
|
17668
|
-
const totalSeconds = ((Date.now() - startTime) / 1e3).toFixed(1);
|
|
17669
|
-
return `Completed in ${totalSeconds}s`;
|
|
17670
|
-
}
|
|
17671
|
-
return status;
|
|
17672
|
-
};
|
|
17676
|
+
let lastStatus = null;
|
|
17673
17677
|
try {
|
|
17674
17678
|
while (!done && !aborted2) {
|
|
17675
17679
|
if (signal.aborted) {
|
|
17676
17680
|
throw new DOMException("Aborted", "AbortError");
|
|
17677
17681
|
}
|
|
17678
17682
|
if (statusQueue.length > 0) {
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17684
|
-
|
|
17685
|
-
|
|
17686
|
-
|
|
17687
|
-
)
|
|
17688
|
-
]);
|
|
17689
|
-
if (waitResult === "timeout" && !done && !aborted2) {
|
|
17690
|
-
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17691
|
-
yield `Working\u2026 ${elapsedSeconds.toFixed(1)}s`;
|
|
17683
|
+
const status = statusQueue.shift();
|
|
17684
|
+
lastStatus = status;
|
|
17685
|
+
}
|
|
17686
|
+
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17687
|
+
if (lastStatus) {
|
|
17688
|
+
if (lastStatus === COMPLETED_STATUS) {
|
|
17689
|
+
yield `Completed in ${elapsedSeconds.toFixed(1)}s`;
|
|
17690
|
+
} else {
|
|
17691
|
+
yield `${lastStatus} ${elapsedSeconds.toFixed(1)}s`;
|
|
17692
17692
|
}
|
|
17693
|
+
} else {
|
|
17694
|
+
yield `Working\u2026 ${elapsedSeconds.toFixed(1)}s`;
|
|
17693
17695
|
}
|
|
17696
|
+
await Promise.race([
|
|
17697
|
+
new Promise((resolve3) => {
|
|
17698
|
+
resolveWait = () => resolve3("status");
|
|
17699
|
+
}),
|
|
17700
|
+
new Promise(
|
|
17701
|
+
(resolve3) => setTimeout(() => resolve3("timeout"), 100)
|
|
17702
|
+
)
|
|
17703
|
+
]);
|
|
17694
17704
|
}
|
|
17695
17705
|
while (statusQueue.length > 0 && !aborted2) {
|
|
17696
|
-
|
|
17706
|
+
const status = statusQueue.shift();
|
|
17707
|
+
lastStatus = status;
|
|
17708
|
+
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17709
|
+
if (status === COMPLETED_STATUS) {
|
|
17710
|
+
yield `Completed in ${elapsedSeconds.toFixed(1)}s`;
|
|
17711
|
+
} else {
|
|
17712
|
+
yield `${status} ${elapsedSeconds.toFixed(1)}s`;
|
|
17713
|
+
}
|
|
17697
17714
|
}
|
|
17698
17715
|
if (aborted2) {
|
|
17699
17716
|
throw new DOMException("Aborted", "AbortError");
|