@empiricalrun/test-gen 0.80.0 → 0.80.2
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/CHANGELOG.md +15 -0
- package/dist/agent/chat/exports.d.ts +1 -1
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +3 -4
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +13 -9
- package/dist/agent/chat/prompt/skills.d.ts +3 -0
- package/dist/agent/chat/prompt/skills.d.ts.map +1 -0
- package/dist/agent/chat/prompt/skills.js +36 -0
- package/dist/agent/triage/index.d.ts.map +1 -1
- package/dist/agent/triage/index.js +2 -1
- package/dist/file-info/adapters/github/reader.d.ts +1 -9
- package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
- package/dist/file-info/adapters/github/reader.js +8 -130
- package/dist/file-info/index.d.ts +0 -1
- package/dist/file-info/index.d.ts.map +1 -1
- package/dist/file-info/index.js +1 -3
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +2 -0
- package/dist/tools/api-client/index.d.ts.map +1 -1
- package/dist/tools/api-client/index.js +88 -3
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +12 -0
- package/dist/tools/fetch-file/index.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.js +3 -11
- package/dist/tools/index.d.ts +1 -3
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -23
- package/dist/tools/safe-bash/index.d.ts.map +1 -1
- package/dist/tools/safe-bash/index.js +55 -4
- package/dist/tools/slack-message/index.d.ts +3 -0
- package/dist/tools/slack-message/index.d.ts.map +1 -0
- package/dist/tools/slack-message/index.js +69 -0
- package/dist/tools/test-run-fetcher/types.d.ts +0 -36
- package/dist/tools/test-run-fetcher/types.d.ts.map +1 -1
- package/dist/tools/utils/apply-line-limit.d.ts +4 -0
- package/dist/tools/utils/apply-line-limit.d.ts.map +1 -0
- package/dist/tools/utils/apply-line-limit.js +18 -0
- package/package.json +6 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/file-info/adapters/github/index.d.ts +0 -12
- package/dist/file-info/adapters/github/index.d.ts.map +0 -1
- package/dist/file-info/adapters/github/index.js +0 -29
- package/dist/tools/utils/queue.d.ts +0 -5
- package/dist/tools/utils/queue.d.ts.map +0 -1
- package/dist/tools/utils/queue.js +0 -41
- package/dist/utils/SQSClient.d.ts +0 -14
- package/dist/utils/SQSClient.d.ts.map +0 -1
- package/dist/utils/SQSClient.js +0 -116
package/dist/utils/SQSClient.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SQSClient = void 0;
|
|
4
|
-
class SQSClient {
|
|
5
|
-
region;
|
|
6
|
-
accessKeyId;
|
|
7
|
-
secretAccessKey;
|
|
8
|
-
sessionToken;
|
|
9
|
-
constructor(region, accessKeyId, secretAccessKey, sessionToken) {
|
|
10
|
-
this.region = region;
|
|
11
|
-
this.accessKeyId = accessKeyId;
|
|
12
|
-
this.secretAccessKey = secretAccessKey;
|
|
13
|
-
this.sessionToken = sessionToken;
|
|
14
|
-
}
|
|
15
|
-
async sha256(message) {
|
|
16
|
-
const msgBuffer = new TextEncoder().encode(message);
|
|
17
|
-
const hashBuffer = await crypto.subtle.digest("SHA-256", msgBuffer);
|
|
18
|
-
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
19
|
-
return hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
20
|
-
}
|
|
21
|
-
async hmacSha256(key, message) {
|
|
22
|
-
const cryptoKey = await crypto.subtle.importKey("raw", key, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
23
|
-
return await crypto.subtle.sign("HMAC", cryptoKey, new TextEncoder().encode(message));
|
|
24
|
-
}
|
|
25
|
-
async getSignatureKey(key, dateStamp, regionName, serviceName) {
|
|
26
|
-
const kDate = await this.hmacSha256(new TextEncoder().encode("AWS4" + key), dateStamp);
|
|
27
|
-
const kRegion = await this.hmacSha256(kDate, regionName);
|
|
28
|
-
const kService = await this.hmacSha256(kRegion, serviceName);
|
|
29
|
-
const kSigning = await this.hmacSha256(kService, "aws4_request");
|
|
30
|
-
return kSigning;
|
|
31
|
-
}
|
|
32
|
-
async sign(stringToSign, signingKey) {
|
|
33
|
-
const signature = await this.hmacSha256(signingKey, stringToSign);
|
|
34
|
-
const signatureArray = Array.from(new Uint8Array(signature));
|
|
35
|
-
return signatureArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
36
|
-
}
|
|
37
|
-
async sendMessage(queueUrl, payload) {
|
|
38
|
-
try {
|
|
39
|
-
const url = new URL(queueUrl);
|
|
40
|
-
const host = url.hostname;
|
|
41
|
-
const canonicalUri = url.pathname;
|
|
42
|
-
const now = new Date();
|
|
43
|
-
// The following two operations generate AWS-compliant timestamps:
|
|
44
|
-
// - amzDate: The full ISO8601 timestamp (without milliseconds and with no separators), used for the x-amz-date header.
|
|
45
|
-
// - dateStamp: The date portion (YYYYMMDD), used in the credential scope for AWS Signature V4.
|
|
46
|
-
const amzDate = now
|
|
47
|
-
.toISOString()
|
|
48
|
-
.replace(/\.\d{3}Z$/, "Z")
|
|
49
|
-
.replace(/[:-]/g, "");
|
|
50
|
-
const dateStamp = amzDate.slice(0, 8);
|
|
51
|
-
const method = "POST";
|
|
52
|
-
const service = "sqs";
|
|
53
|
-
const algorithm = "AWS4-HMAC-SHA256";
|
|
54
|
-
const credentialScope = `${dateStamp}/${this.region}/${service}/aws4_request`;
|
|
55
|
-
const messageBody = {
|
|
56
|
-
Action: "SendMessage",
|
|
57
|
-
Version: "2012-11-05",
|
|
58
|
-
QueueUrl: queueUrl,
|
|
59
|
-
MessageBody: JSON.stringify(payload),
|
|
60
|
-
MessageGroupId: payload.requestId,
|
|
61
|
-
MessageDeduplicationId: payload.requestId,
|
|
62
|
-
};
|
|
63
|
-
const body = Object.entries(messageBody)
|
|
64
|
-
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
65
|
-
.join("&");
|
|
66
|
-
const payloadHash = await this.sha256(body);
|
|
67
|
-
const canonicalHeaders = [
|
|
68
|
-
`host:${host}`,
|
|
69
|
-
`x-amz-date:${amzDate}`,
|
|
70
|
-
"",
|
|
71
|
-
].join("\n");
|
|
72
|
-
const signedHeaders = "host;x-amz-date";
|
|
73
|
-
const canonicalRequest = [
|
|
74
|
-
method,
|
|
75
|
-
canonicalUri,
|
|
76
|
-
"",
|
|
77
|
-
canonicalHeaders,
|
|
78
|
-
signedHeaders,
|
|
79
|
-
payloadHash,
|
|
80
|
-
].join("\n");
|
|
81
|
-
const stringToSign = [
|
|
82
|
-
algorithm,
|
|
83
|
-
amzDate,
|
|
84
|
-
credentialScope,
|
|
85
|
-
await this.sha256(canonicalRequest),
|
|
86
|
-
].join("\n");
|
|
87
|
-
const signingKey = await this.getSignatureKey(this.secretAccessKey, dateStamp, this.region, service);
|
|
88
|
-
const signature = await this.sign(stringToSign, signingKey);
|
|
89
|
-
const authorizationHeader = `${algorithm} Credential=${this.accessKeyId}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signature}`;
|
|
90
|
-
const headers = {
|
|
91
|
-
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
|
|
92
|
-
Host: host,
|
|
93
|
-
"X-Amz-Date": amzDate,
|
|
94
|
-
Authorization: authorizationHeader,
|
|
95
|
-
};
|
|
96
|
-
if (this.sessionToken) {
|
|
97
|
-
headers["X-Amz-Security-Token"] = this.sessionToken;
|
|
98
|
-
}
|
|
99
|
-
const response = await fetch(queueUrl, {
|
|
100
|
-
method: "POST",
|
|
101
|
-
headers,
|
|
102
|
-
body: body,
|
|
103
|
-
});
|
|
104
|
-
if (!response.ok) {
|
|
105
|
-
const errorText = await response.text();
|
|
106
|
-
console.error(`[SQSClient.sendMessage] SQS request failed: ${response.status} ${response.statusText} - ${errorText}`);
|
|
107
|
-
throw new Error(`SQS request failed: ${response.status} ${response.statusText} - ${errorText}`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
catch (err) {
|
|
111
|
-
console.error("[SQSClient.sendMessage] Error:", err instanceof Error ? err.stack || err.message : err);
|
|
112
|
-
throw err;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.SQSClient = SQSClient;
|