@react-grab/ami 0.0.85 → 0.0.86
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/client.js
CHANGED
|
@@ -17362,6 +17362,9 @@ var q = async (e) => {
|
|
|
17362
17362
|
return { success: o2.success, patches: t2.patches, error: o2.error };
|
|
17363
17363
|
};
|
|
17364
17364
|
|
|
17365
|
+
// src/constants.ts
|
|
17366
|
+
var COMPLETED_STATUS = "COMPLETED_STATUS";
|
|
17367
|
+
|
|
17365
17368
|
// src/client.ts
|
|
17366
17369
|
var STORAGE_KEY = "react-grab:agent-sessions";
|
|
17367
17370
|
var TOKEN_STORAGE_KEY = "react-grab:ami-token";
|
|
@@ -17485,7 +17488,7 @@ ${context.content}`;
|
|
|
17485
17488
|
case "aborted":
|
|
17486
17489
|
throw new Error("User aborted task");
|
|
17487
17490
|
default:
|
|
17488
|
-
return { status:
|
|
17491
|
+
return { status: COMPLETED_STATUS, messages, chatId };
|
|
17489
17492
|
}
|
|
17490
17493
|
};
|
|
17491
17494
|
var CONNECTION_CHECK_TTL_MS = 5e3;
|
|
@@ -17506,7 +17509,7 @@ var createAmiAgentProvider = (projectId) => {
|
|
|
17506
17509
|
if (!projectId) {
|
|
17507
17510
|
throw new Error("No project found");
|
|
17508
17511
|
}
|
|
17509
|
-
yield "Thinking
|
|
17512
|
+
yield "Thinking\u2026";
|
|
17510
17513
|
const statusQueue = [];
|
|
17511
17514
|
let resolveWait = null;
|
|
17512
17515
|
let aborted2 = false;
|
|
@@ -17561,37 +17564,44 @@ var createAmiAgentProvider = (projectId) => {
|
|
|
17561
17564
|
resolveWait = null;
|
|
17562
17565
|
}
|
|
17563
17566
|
});
|
|
17564
|
-
|
|
17565
|
-
if (status === "Completed successfully") {
|
|
17566
|
-
const totalSeconds = ((Date.now() - startTime) / 1e3).toFixed(1);
|
|
17567
|
-
return `Completed in ${totalSeconds}s`;
|
|
17568
|
-
}
|
|
17569
|
-
return status;
|
|
17570
|
-
};
|
|
17567
|
+
let lastStatus = null;
|
|
17571
17568
|
try {
|
|
17572
17569
|
while (!done && !aborted2) {
|
|
17573
17570
|
if (signal.aborted) {
|
|
17574
17571
|
throw new DOMException("Aborted", "AbortError");
|
|
17575
17572
|
}
|
|
17576
17573
|
if (statusQueue.length > 0) {
|
|
17577
|
-
|
|
17578
|
-
|
|
17579
|
-
|
|
17580
|
-
|
|
17581
|
-
|
|
17582
|
-
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
)
|
|
17586
|
-
]);
|
|
17587
|
-
if (waitResult === "timeout" && !done && !aborted2) {
|
|
17588
|
-
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17589
|
-
yield `Working\u2026 ${elapsedSeconds.toFixed(1)}s`;
|
|
17574
|
+
const status = statusQueue.shift();
|
|
17575
|
+
lastStatus = status;
|
|
17576
|
+
}
|
|
17577
|
+
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17578
|
+
if (lastStatus) {
|
|
17579
|
+
if (lastStatus === COMPLETED_STATUS) {
|
|
17580
|
+
yield `Completed in ${elapsedSeconds.toFixed(1)}s`;
|
|
17581
|
+
} else {
|
|
17582
|
+
yield `${lastStatus} ${elapsedSeconds.toFixed(1)}s`;
|
|
17590
17583
|
}
|
|
17584
|
+
} else {
|
|
17585
|
+
yield `Working\u2026 ${elapsedSeconds.toFixed(1)}s`;
|
|
17591
17586
|
}
|
|
17587
|
+
await Promise.race([
|
|
17588
|
+
new Promise((resolve3) => {
|
|
17589
|
+
resolveWait = () => resolve3("status");
|
|
17590
|
+
}),
|
|
17591
|
+
new Promise(
|
|
17592
|
+
(resolve3) => setTimeout(() => resolve3("timeout"), 100)
|
|
17593
|
+
)
|
|
17594
|
+
]);
|
|
17592
17595
|
}
|
|
17593
17596
|
while (statusQueue.length > 0 && !aborted2) {
|
|
17594
|
-
|
|
17597
|
+
const status = statusQueue.shift();
|
|
17598
|
+
lastStatus = status;
|
|
17599
|
+
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17600
|
+
if (status === COMPLETED_STATUS) {
|
|
17601
|
+
yield `Completed in ${elapsedSeconds.toFixed(1)}s`;
|
|
17602
|
+
} else {
|
|
17603
|
+
yield `${status} ${elapsedSeconds.toFixed(1)}s`;
|
|
17604
|
+
}
|
|
17595
17605
|
}
|
|
17596
17606
|
if (aborted2) {
|
|
17597
17607
|
throw new DOMException("Aborted", "AbortError");
|
|
@@ -17661,37 +17671,44 @@ var createAmiAgentProvider = (projectId) => {
|
|
|
17661
17671
|
resolveWait = null;
|
|
17662
17672
|
}
|
|
17663
17673
|
});
|
|
17664
|
-
|
|
17665
|
-
if (status === "Completed successfully") {
|
|
17666
|
-
const totalSeconds = ((Date.now() - startTime) / 1e3).toFixed(1);
|
|
17667
|
-
return `Completed in ${totalSeconds}s`;
|
|
17668
|
-
}
|
|
17669
|
-
return status;
|
|
17670
|
-
};
|
|
17674
|
+
let lastStatus = null;
|
|
17671
17675
|
try {
|
|
17672
17676
|
while (!done && !aborted2) {
|
|
17673
17677
|
if (signal.aborted) {
|
|
17674
17678
|
throw new DOMException("Aborted", "AbortError");
|
|
17675
17679
|
}
|
|
17676
17680
|
if (statusQueue.length > 0) {
|
|
17677
|
-
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17684
|
-
|
|
17685
|
-
)
|
|
17686
|
-
]);
|
|
17687
|
-
if (waitResult === "timeout" && !done && !aborted2) {
|
|
17688
|
-
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17689
|
-
yield `Working\u2026 ${elapsedSeconds.toFixed(1)}s`;
|
|
17681
|
+
const status = statusQueue.shift();
|
|
17682
|
+
lastStatus = status;
|
|
17683
|
+
}
|
|
17684
|
+
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17685
|
+
if (lastStatus) {
|
|
17686
|
+
if (lastStatus === COMPLETED_STATUS) {
|
|
17687
|
+
yield `Completed in ${elapsedSeconds.toFixed(1)}s`;
|
|
17688
|
+
} else {
|
|
17689
|
+
yield `${lastStatus} ${elapsedSeconds.toFixed(1)}s`;
|
|
17690
17690
|
}
|
|
17691
|
+
} else {
|
|
17692
|
+
yield `Working\u2026 ${elapsedSeconds.toFixed(1)}s`;
|
|
17691
17693
|
}
|
|
17694
|
+
await Promise.race([
|
|
17695
|
+
new Promise((resolve3) => {
|
|
17696
|
+
resolveWait = () => resolve3("status");
|
|
17697
|
+
}),
|
|
17698
|
+
new Promise(
|
|
17699
|
+
(resolve3) => setTimeout(() => resolve3("timeout"), 100)
|
|
17700
|
+
)
|
|
17701
|
+
]);
|
|
17692
17702
|
}
|
|
17693
17703
|
while (statusQueue.length > 0 && !aborted2) {
|
|
17694
|
-
|
|
17704
|
+
const status = statusQueue.shift();
|
|
17705
|
+
lastStatus = status;
|
|
17706
|
+
const elapsedSeconds = (Date.now() - startTime) / 1e3;
|
|
17707
|
+
if (status === COMPLETED_STATUS) {
|
|
17708
|
+
yield `Completed in ${elapsedSeconds.toFixed(1)}s`;
|
|
17709
|
+
} else {
|
|
17710
|
+
yield `${status} ${elapsedSeconds.toFixed(1)}s`;
|
|
17711
|
+
}
|
|
17695
17712
|
}
|
|
17696
17713
|
if (aborted2) {
|
|
17697
17714
|
throw new DOMException("Aborted", "AbortError");
|
package/dist/server.cjs
CHANGED
|
@@ -7,7 +7,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
7
7
|
var pc__default = /*#__PURE__*/_interopDefault(pc);
|
|
8
8
|
|
|
9
9
|
// src/server.ts
|
|
10
|
-
var VERSION = "0.0.
|
|
10
|
+
var VERSION = "0.0.86";
|
|
11
11
|
try {
|
|
12
12
|
fetch(`https://www.react-grab.com/api/version?source=ami&t=${Date.now()}`).catch(() => {
|
|
13
13
|
});
|
|
@@ -15,7 +15,7 @@ try {
|
|
|
15
15
|
}
|
|
16
16
|
var startServer = async (_port) => {
|
|
17
17
|
console.log(
|
|
18
|
-
`${pc__default.default.magenta("\
|
|
18
|
+
`${pc__default.default.magenta("\u273F")} ${pc__default.default.bold("React Grab")} ${pc__default.default.gray(VERSION)} ${pc__default.default.dim("(Ami)")}`
|
|
19
19
|
);
|
|
20
20
|
console.log(`${pc__default.default.yellow("\u26A0")} Ami provider server is not yet implemented`);
|
|
21
21
|
};
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pc from 'picocolors';
|
|
2
2
|
|
|
3
3
|
// src/server.ts
|
|
4
|
-
var VERSION = "0.0.
|
|
4
|
+
var VERSION = "0.0.86";
|
|
5
5
|
try {
|
|
6
6
|
fetch(`https://www.react-grab.com/api/version?source=ami&t=${Date.now()}`).catch(() => {
|
|
7
7
|
});
|
|
@@ -9,7 +9,7 @@ try {
|
|
|
9
9
|
}
|
|
10
10
|
var startServer = async (_port) => {
|
|
11
11
|
console.log(
|
|
12
|
-
`${pc.magenta("\
|
|
12
|
+
`${pc.magenta("\u273F")} ${pc.bold("React Grab")} ${pc.gray(VERSION)} ${pc.dim("(Ami)")}`
|
|
13
13
|
);
|
|
14
14
|
console.log(`${pc.yellow("\u26A0")} Ami provider server is not yet implemented`);
|
|
15
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-grab/ami",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.86",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"react-grab-ami": "./dist/cli.cjs"
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"devDependencies": {
|
|
24
|
+
"@types/node": "^22.10.7",
|
|
24
25
|
"tsup": "^8.4.0"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"ami-sdk": "^0.0.6",
|
|
28
29
|
"picocolors": "^1.1.1",
|
|
29
|
-
"react-grab": "0.0.
|
|
30
|
+
"react-grab": "0.0.86"
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
32
33
|
"dev": "tsup --watch",
|