@elgora/cli 9.0.0 → 9.1.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/cli.js +40 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -495,16 +495,33 @@ var bountyPublicationResponseSchema = z3.object({
|
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
497
|
});
|
|
498
|
-
var priorIssueSchema = z3.object({
|
|
498
|
+
var priorIssueSchema = z3.object({
|
|
499
|
+
issue_index: z3.number().int().nonnegative(),
|
|
500
|
+
message: z3.string().trim().min(1).max(1500)
|
|
501
|
+
}).strict();
|
|
502
|
+
var priorIssueStatusSchema = priorIssueSchema.extend({
|
|
503
|
+
status: z3.enum(["resolved", "open"])
|
|
504
|
+
}).strict();
|
|
505
|
+
var readinessFindingSchema = z3.object({
|
|
506
|
+
path: z3.string().trim().min(1).max(120),
|
|
507
|
+
message: z3.string().trim().min(1).max(1500),
|
|
508
|
+
code: z3.string().min(1).optional(),
|
|
509
|
+
anchor: z3.string().trim().min(1).max(120).optional(),
|
|
510
|
+
hazard: z3.boolean().optional()
|
|
511
|
+
});
|
|
512
|
+
var MAX_READINESS_FINDINGS = 20;
|
|
499
513
|
var bountyReviewResponseSchema = z3.object({
|
|
500
514
|
content_record: bountyChallengeContentRecordSchema,
|
|
501
515
|
readiness: z3.object({
|
|
502
516
|
decision: z3.literal("ready"),
|
|
503
517
|
signoff: readinessSignoffSchema,
|
|
518
|
+
// The dissenting pass's findings on a ready check; never blocking.
|
|
519
|
+
// Optional because servers before three-pass review do not send it.
|
|
520
|
+
warnings: z3.array(readinessFindingSchema).max(MAX_READINESS_FINDINGS).optional(),
|
|
504
521
|
prior_issues_resolved: z3.array(priorIssueSchema),
|
|
505
522
|
prior_issues_open: z3.array(priorIssueSchema)
|
|
506
|
-
})
|
|
507
|
-
}).
|
|
523
|
+
})
|
|
524
|
+
}).superRefine((response, context) => {
|
|
508
525
|
if (response.readiness.signoff.spec_commitment.toLowerCase() !== response.content_record.spec_commitment.toLowerCase()) {
|
|
509
526
|
context.addIssue({
|
|
510
527
|
code: "custom",
|
|
@@ -515,6 +532,8 @@ var bountyReviewResponseSchema = z3.object({
|
|
|
515
532
|
});
|
|
516
533
|
var readinessSignerResponseSchema = z3.object({
|
|
517
534
|
signer_address: addressSchema,
|
|
535
|
+
reviewer_hash: bytes32Schema2,
|
|
536
|
+
configured_model: z3.string().min(1),
|
|
518
537
|
audience: z3.string().min(1)
|
|
519
538
|
}).strict();
|
|
520
539
|
|
|
@@ -5176,6 +5195,8 @@ function defaultApiBaseUrl(env) {
|
|
|
5176
5195
|
// ../../packages/core/src/api-client.ts
|
|
5177
5196
|
var ApiRequestError = class extends Error {
|
|
5178
5197
|
issues;
|
|
5198
|
+
priorIssuesResolved;
|
|
5199
|
+
priorIssuesOpen;
|
|
5179
5200
|
status;
|
|
5180
5201
|
code;
|
|
5181
5202
|
retryAfterMs;
|
|
@@ -5185,6 +5206,10 @@ var ApiRequestError = class extends Error {
|
|
|
5185
5206
|
);
|
|
5186
5207
|
this.name = "ApiRequestError";
|
|
5187
5208
|
this.issues = readApiErrorIssues(input.body);
|
|
5209
|
+
const error = input.body && typeof input.body === "object" && "error" in input.body ? input.body.error : void 0;
|
|
5210
|
+
const fields = error && typeof error === "object" ? error : {};
|
|
5211
|
+
this.priorIssuesResolved = priorIssueSchema.array().safeParse(fields.prior_issues_resolved).data ?? [];
|
|
5212
|
+
this.priorIssuesOpen = priorIssueSchema.array().safeParse(fields.prior_issues_open).data ?? [];
|
|
5188
5213
|
this.status = input.status;
|
|
5189
5214
|
this.code = readApiErrorCode(input.body);
|
|
5190
5215
|
this.retryAfterMs = input.retryAfterMs;
|
|
@@ -7148,7 +7173,7 @@ function resolveChainId(selector) {
|
|
|
7148
7173
|
}
|
|
7149
7174
|
|
|
7150
7175
|
// src/version.ts
|
|
7151
|
-
var CLI_VERSION = true ? "9.
|
|
7176
|
+
var CLI_VERSION = true ? "9.1.0" : "0.0.0-dev";
|
|
7152
7177
|
var CLI_NODE_ENGINES = true ? ">=24 <25" : ">=24 <25";
|
|
7153
7178
|
|
|
7154
7179
|
// src/node-engines.ts
|
|
@@ -7658,7 +7683,10 @@ async function main10(env = process.env, argv = process.argv.slice(2)) {
|
|
|
7658
7683
|
);
|
|
7659
7684
|
requestUrl.searchParams.set("poster_address", account.address);
|
|
7660
7685
|
if (previous)
|
|
7661
|
-
requestUrl.searchParams.set(
|
|
7686
|
+
requestUrl.searchParams.set(
|
|
7687
|
+
"previous_spec_commitment",
|
|
7688
|
+
previous.toLowerCase()
|
|
7689
|
+
);
|
|
7662
7690
|
const authorization = await signPosterRequest({
|
|
7663
7691
|
requestUrl,
|
|
7664
7692
|
markdown,
|
|
@@ -7674,7 +7702,12 @@ async function main10(env = process.env, argv = process.argv.slice(2)) {
|
|
|
7674
7702
|
} catch (error) {
|
|
7675
7703
|
if (error instanceof ApiRequestError && error.code === "bounty_challenge_not_ready") {
|
|
7676
7704
|
console.log(
|
|
7677
|
-
JSON.stringify({
|
|
7705
|
+
JSON.stringify({
|
|
7706
|
+
event: "review.not_ready",
|
|
7707
|
+
issues: error.issues,
|
|
7708
|
+
prior_issues_resolved: error.priorIssuesResolved,
|
|
7709
|
+
prior_issues_open: error.priorIssuesOpen
|
|
7710
|
+
})
|
|
7678
7711
|
);
|
|
7679
7712
|
process.exitCode = 2;
|
|
7680
7713
|
return;
|
|
@@ -7697,6 +7730,7 @@ async function main10(env = process.env, argv = process.argv.slice(2)) {
|
|
|
7697
7730
|
event: "review.ready",
|
|
7698
7731
|
spec_commitment: commitment,
|
|
7699
7732
|
signoff: response.readiness.signoff,
|
|
7733
|
+
warnings: response.readiness.warnings ?? [],
|
|
7700
7734
|
prior_issues_resolved: response.readiness.prior_issues_resolved,
|
|
7701
7735
|
prior_issues_open: response.readiness.prior_issues_open
|
|
7702
7736
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elgora/cli",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "Command-line client for Elgora, a decentralized bounty marketplace for science. Lets Posters, Solvers, and Guardians interact with Elgora's public API and on-chain contracts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|