@wasit-dev/core 0.7.0 → 0.8.0-beta.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/README.md +13 -2
- package/dist/baseline.d.ts +109 -0
- package/dist/baseline.js +353 -0
- package/dist/catalogue.js +10 -0
- package/dist/check.d.ts +57 -2
- package/dist/check.js +46 -6
- package/dist/ci-report.d.ts +74 -0
- package/dist/ci-report.js +399 -0
- package/dist/config-writer.d.ts +96 -0
- package/dist/config-writer.js +281 -0
- package/dist/config.d.ts +205 -0
- package/dist/config.js +1011 -0
- package/dist/denied-env.d.ts +33 -0
- package/dist/denied-env.js +86 -0
- package/dist/errors.d.ts +44 -1
- package/dist/errors.js +151 -2
- package/dist/guard/budget.d.ts +138 -0
- package/dist/guard/budget.js +206 -0
- package/dist/guard/ci-event.d.ts +56 -0
- package/dist/guard/ci-event.js +129 -0
- package/dist/guard/ci-mainnet.d.ts +59 -0
- package/dist/guard/ci-mainnet.js +149 -0
- package/dist/guard/horizon.d.ts +30 -0
- package/dist/guard/horizon.js +107 -0
- package/dist/guard/mainnet-payer.d.ts +66 -0
- package/dist/guard/mainnet-payer.js +92 -0
- package/dist/guard/mainnet-plan.d.ts +133 -0
- package/dist/guard/mainnet-plan.js +208 -0
- package/dist/guard/mainnet-run.d.ts +87 -0
- package/dist/guard/mainnet-run.js +225 -0
- package/dist/guard/networks.d.ts +51 -0
- package/dist/guard/networks.js +91 -0
- package/dist/guard/optin.d.ts +106 -0
- package/dist/guard/optin.js +202 -0
- package/dist/guard/rpc-identity.d.ts +45 -0
- package/dist/guard/rpc-identity.js +156 -0
- package/dist/guard/rpc-in-use.d.ts +48 -0
- package/dist/guard/rpc-in-use.js +84 -0
- package/dist/guard/run-ledger.d.ts +212 -0
- package/dist/guard/run-ledger.js +426 -0
- package/dist/guard/run-lock.d.ts +62 -0
- package/dist/guard/run-lock.js +172 -0
- package/dist/guard/signed-terms.d.ts +96 -0
- package/dist/guard/signed-terms.js +207 -0
- package/dist/index.d.ts +44 -4
- package/dist/index.js +42 -2
- package/dist/mpp/channel-commitment.d.ts +48 -2
- package/dist/mpp/channel-commitment.js +80 -4
- package/dist/mpp/channel-credential.d.ts +13 -1
- package/dist/mpp/channel-credential.js +21 -2
- package/dist/mpp/channel.d.ts +6 -0
- package/dist/mpp/channel.js +36 -3
- package/dist/mpp/charge.d.ts +33 -1
- package/dist/mpp/charge.js +90 -20
- package/dist/mpp/network.js +4 -1
- package/dist/mpp/plan.d.ts +77 -0
- package/dist/mpp/plan.js +188 -0
- package/dist/mpp/suite.d.ts +6 -0
- package/dist/mpp/suite.js +12 -3
- package/dist/report.d.ts +163 -0
- package/dist/report.js +282 -0
- package/dist/route-reader.d.ts +124 -0
- package/dist/route-reader.js +349 -0
- package/dist/sanitize.d.ts +52 -0
- package/dist/sanitize.js +106 -0
- package/dist/settlement.d.ts +14 -0
- package/dist/settlement.js +1 -1
- package/dist/verdict.d.ts +24 -0
- package/dist/verdict.js +46 -0
- package/dist/versions.d.ts +50 -0
- package/dist/versions.js +123 -0
- package/dist/wallet.d.ts +58 -1
- package/dist/wallet.js +128 -0
- package/dist/x402/chains/evm.js +3 -0
- package/dist/x402/chains/index.d.ts +8 -0
- package/dist/x402/chains/index.js +13 -2
- package/dist/x402/chains/stellar.d.ts +8 -1
- package/dist/x402/chains/stellar.js +259 -4
- package/dist/x402/chains/types.d.ts +104 -2
- package/dist/x402/plan.d.ts +184 -0
- package/dist/x402/plan.js +520 -0
- package/dist/x402/rejected-request.d.ts +156 -0
- package/dist/x402/rejected-request.js +287 -0
- package/dist/x402/requirements.d.ts +1 -0
- package/dist/x402/requirements.js +37 -4
- package/dist/x402/simulator.d.ts +86 -1
- package/dist/x402/simulator.js +863 -87
- package/package.json +1 -1
package/dist/check.js
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { catalogueEntry, docsUrlFor } from "./catalogue.js";
|
|
5
5
|
import { classifyCheckError } from "./errors.js";
|
|
6
|
+
import { sanitizeText } from "./sanitize.js";
|
|
7
|
+
export const SKIP_KINDS = [
|
|
8
|
+
"unsupported",
|
|
9
|
+
"resource-consumed",
|
|
10
|
+
"needs-payer",
|
|
11
|
+
"read-only",
|
|
12
|
+
"not-applicable",
|
|
13
|
+
"dependency",
|
|
14
|
+
];
|
|
6
15
|
/**
|
|
7
16
|
* Classifies one result.
|
|
8
17
|
*
|
|
@@ -84,17 +93,36 @@ export function errored(id, name, error) {
|
|
|
84
93
|
detail: `Check could not run (${classified.kind}): ${classified.message}`,
|
|
85
94
|
};
|
|
86
95
|
}
|
|
87
|
-
/**
|
|
88
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Builds the result for a check that was not run, for a non-destructive reason.
|
|
98
|
+
* `kind` says what sort of reason it is; leave it out when the code does not know.
|
|
99
|
+
*/
|
|
100
|
+
export function skipped(id, name, reason, kind) {
|
|
89
101
|
return {
|
|
90
102
|
id,
|
|
91
103
|
name,
|
|
92
104
|
pass: false,
|
|
93
105
|
skipped: true,
|
|
94
106
|
skipReason: reason,
|
|
107
|
+
...(kind === undefined ? {} : { skipKind: kind }),
|
|
95
108
|
detail: `Skipped: ${reason}`,
|
|
96
109
|
};
|
|
97
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* A value a service sent, quoted for the `actual` of a FAIL: a string in JSON
|
|
113
|
+
* quotes (control characters written out, not carried), anything else as JSON.
|
|
114
|
+
*
|
|
115
|
+
* Not cut here unless `max` is given. A cut made before the secrets of the run
|
|
116
|
+
* are removed can leave the start of a secret in the output, so the cut is made
|
|
117
|
+
* by the sinks that remove them (`redactValue`, the comment renderer).
|
|
118
|
+
*/
|
|
119
|
+
export function quoteValue(value, max) {
|
|
120
|
+
const quoted = typeof value === "string" ? JSON.stringify(value) : (JSON.stringify(value) ?? String(value));
|
|
121
|
+
if (max === undefined)
|
|
122
|
+
return quoted;
|
|
123
|
+
const characters = Array.from(quoted);
|
|
124
|
+
return characters.length <= max ? quoted : `${characters.slice(0, Math.max(1, max - 1)).join("")}…`;
|
|
125
|
+
}
|
|
98
126
|
/**
|
|
99
127
|
* The guidance a front end shows under a FAIL: the result's own hint when it
|
|
100
128
|
* has one, else the check's catalogue fix. Undefined for anything that is not
|
|
@@ -130,14 +158,26 @@ export function toStructuredRun(results) {
|
|
|
130
158
|
skipped: counts.skipped,
|
|
131
159
|
results: results.map((result) => {
|
|
132
160
|
const guidance = fixFor(result);
|
|
161
|
+
const status = checkStatus(result);
|
|
133
162
|
return {
|
|
134
163
|
id: result.id,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
164
|
+
// Text a service chose can reach these three fields; the report is a
|
|
165
|
+
// sink for the one sanitiser (spec A8 #6).
|
|
166
|
+
name: sanitizeText(result.name),
|
|
167
|
+
status,
|
|
168
|
+
detail: sanitizeText(result.detail),
|
|
138
169
|
destructive: result.destructive === true,
|
|
139
170
|
...(result.error ? { errorKind: result.error.kind } : {}),
|
|
140
|
-
...(
|
|
171
|
+
...(status === "SKIP" && result.skipKind !== undefined ? { skipKind: result.skipKind } : {}),
|
|
172
|
+
...(status === "FAIL" && result.expected !== undefined ? { expected: sanitizeText(result.expected) } : {}),
|
|
173
|
+
...(status === "FAIL" && result.actual !== undefined ? { actual: sanitizeText(result.actual) } : {}),
|
|
174
|
+
...(status === "PASS" && result.reference !== undefined ? { reference: sanitizeText(result.reference) } : {}),
|
|
175
|
+
...(guidance === undefined
|
|
176
|
+
? {}
|
|
177
|
+
: {
|
|
178
|
+
fix: sanitizeText(guidance.fix),
|
|
179
|
+
...(guidance.docs === undefined ? {} : { docs: guidance.docs }),
|
|
180
|
+
}),
|
|
141
181
|
};
|
|
142
182
|
}),
|
|
143
183
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pull request comment and the job summary (spec A4, A5), as pure
|
|
3
|
+
* functions over the run report and, when there is one, the baseline of the
|
|
4
|
+
* default branch.
|
|
5
|
+
*
|
|
6
|
+
* Every value that can carry text a service chose goes through
|
|
7
|
+
* `sanitizeForMarkdown`: one line, links and mentions removed, 300 characters at
|
|
8
|
+
* most, Markdown and HTML escaped. What is not passed through it is a constant
|
|
9
|
+
* of this file, a number, or a value checked against a fixed set (an outcome, a
|
|
10
|
+
* status, a protocol, a version, a docs link on usewasit.dev).
|
|
11
|
+
*/
|
|
12
|
+
import { type Baseline, type History } from "./baseline.js";
|
|
13
|
+
import { type RunReport } from "./report.js";
|
|
14
|
+
import { type ToolVersions } from "./versions.js";
|
|
15
|
+
/** The comment that starts with this is the one Wasit updates. */
|
|
16
|
+
export declare const COMMENT_MARKER = "<!-- wasit-report -->";
|
|
17
|
+
export interface CiReportInput {
|
|
18
|
+
readonly report: RunReport;
|
|
19
|
+
/** The baseline of the default branch, when one was found and could be read. */
|
|
20
|
+
readonly baseline?: Baseline;
|
|
21
|
+
/** Why no baseline could be used, when one was looked for: shown in place of "no baseline yet". */
|
|
22
|
+
readonly baselineNote?: string;
|
|
23
|
+
/** The id of the run on main the baseline came from: the last green one (D-022b). */
|
|
24
|
+
readonly baselineRun?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The history of every completed run on main, failed ones included (D-022b),
|
|
27
|
+
* for the recent-failures line. Absent: the baseline's own history.
|
|
28
|
+
*/
|
|
29
|
+
readonly history?: History;
|
|
30
|
+
/** Values no output may carry (a header value, a key, an RPC url). */
|
|
31
|
+
readonly secrets?: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
/** The pull request comment: the marker, then the report. */
|
|
34
|
+
export declare function renderComment(input: CiReportInput): string;
|
|
35
|
+
/** The job summary: the same text without the marker. */
|
|
36
|
+
export declare function renderSummary(input: CiReportInput): string;
|
|
37
|
+
/** The pull request comment for a run that left no report: the marker, then the fixed text. */
|
|
38
|
+
export declare function renderNoReportComment(versions: ToolVersions): string;
|
|
39
|
+
/** The job summary for a run that left no report: the same text without the marker. */
|
|
40
|
+
export declare function renderNoReportSummary(versions: ToolVersions): string;
|
|
41
|
+
/** What a GitHub check run shows: its title, its summary and how it ended. */
|
|
42
|
+
export interface CheckRunOutput {
|
|
43
|
+
/** At most 255 characters: the verdict and the counts, nothing a service chose. */
|
|
44
|
+
readonly title: string;
|
|
45
|
+
/** The job summary's text: the same sanitised report. */
|
|
46
|
+
readonly summary: string;
|
|
47
|
+
readonly conclusion: "success" | "failure" | "neutral";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The check run "Wasit conformance" at the end of a run: success for a run that
|
|
51
|
+
* exits 0, failure for 1, neutral for no verdict. The title holds only the
|
|
52
|
+
* verdict word and counts; the summary is the job summary.
|
|
53
|
+
*/
|
|
54
|
+
export declare function renderCheckRun(input: CiReportInput): CheckRunOutput;
|
|
55
|
+
/** The check run for a run that left no report: neutral, with the fixed text of the no-report comment. */
|
|
56
|
+
export declare function renderNoReportCheckRun(versions: ToolVersions): CheckRunOutput;
|
|
57
|
+
export interface RunningCommentInput {
|
|
58
|
+
/** When the run started, as an ISO time; anything else is left out. */
|
|
59
|
+
readonly startedAt: string;
|
|
60
|
+
/** The run's page; left out unless it has the shape GitHub gives it. */
|
|
61
|
+
readonly runUrl?: string;
|
|
62
|
+
/** The environment the run tests, when the workflow names one. */
|
|
63
|
+
readonly environment?: string;
|
|
64
|
+
/** Values no output may carry. */
|
|
65
|
+
readonly secrets?: readonly string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The pull request comment while Wasit runs (Najmi, 2026-11-20): the marker,
|
|
69
|
+
* then a fixed line with the start time and a link to the run. The result
|
|
70
|
+
* replaces it when the run ends. The only value from outside is the
|
|
71
|
+
* environment's name, which goes through the sanitiser; the link is used only
|
|
72
|
+
* when it has the shape of a GitHub run page.
|
|
73
|
+
*/
|
|
74
|
+
export declare function renderRunningComment(input: RunningCommentInput): string;
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pull request comment and the job summary (spec A4, A5), as pure
|
|
3
|
+
* functions over the run report and, when there is one, the baseline of the
|
|
4
|
+
* default branch.
|
|
5
|
+
*
|
|
6
|
+
* Every value that can carry text a service chose goes through
|
|
7
|
+
* `sanitizeForMarkdown`: one line, links and mentions removed, 300 characters at
|
|
8
|
+
* most, Markdown and HTML escaped. What is not passed through it is a constant
|
|
9
|
+
* of this file, a number, or a value checked against a fixed set (an outcome, a
|
|
10
|
+
* status, a protocol, a version, a docs link on usewasit.dev).
|
|
11
|
+
*/
|
|
12
|
+
import { baselineProblem, diffReports, recentFailures, } from "./baseline.js";
|
|
13
|
+
import { checkGroup, describeTotals, } from "./report.js";
|
|
14
|
+
import { sanitizeForMarkdown } from "./sanitize.js";
|
|
15
|
+
import { isShortCommit } from "./versions.js";
|
|
16
|
+
import { runExitCode } from "./verdict.js";
|
|
17
|
+
/** The comment that starts with this is the one Wasit updates. */
|
|
18
|
+
export const COMMENT_MARKER = "<!-- wasit-report -->";
|
|
19
|
+
/** GitHub refuses a comment over 65,536 characters; stay well under. */
|
|
20
|
+
const MAX_COMMENT_CHARACTERS = 60_000;
|
|
21
|
+
const MAX_FAILURES_SHOWN = 20;
|
|
22
|
+
const MAX_CHANGES_SHOWN = 30;
|
|
23
|
+
const MAX_RECENT_SHOWN = 10;
|
|
24
|
+
/** Docs links go in only if they point at the site: the file they come from is data. */
|
|
25
|
+
const DOCS_LINK = /^https:\/\/usewasit\.dev\/[A-Za-z0-9/_.-]*$/;
|
|
26
|
+
/** A check's status at a glance (Najmi, 2026-11-20): emoji are safe in a comment, which is HTML. */
|
|
27
|
+
const STATUS_MARK = { PASS: "✅", FAIL: "❌", SKIP: "⚪", ERROR: "⚠️" };
|
|
28
|
+
const OUTCOME_MARK = {
|
|
29
|
+
conformant: "✅",
|
|
30
|
+
"non-conformant": "❌",
|
|
31
|
+
"no-verdict": "⚠️",
|
|
32
|
+
unsupported: "⚪",
|
|
33
|
+
};
|
|
34
|
+
const VERDICT_MARK = {
|
|
35
|
+
conformant: "✅",
|
|
36
|
+
"non-conformant": "❌",
|
|
37
|
+
regression: "❌",
|
|
38
|
+
"nothing graded": "⚪",
|
|
39
|
+
"no verdict": "⚠️",
|
|
40
|
+
};
|
|
41
|
+
/** Endpoints shown with a table of their checks; a config with more points at the report file for the rest. */
|
|
42
|
+
const MAX_ENDPOINT_SECTIONS = 10;
|
|
43
|
+
/** A Stellar transaction hash: the only reference a payment proof links, and only on the test network. */
|
|
44
|
+
const STELLAR_TX = /^[0-9a-f]{64}$/;
|
|
45
|
+
/** A run's page, as `GITHUB_SERVER_URL/GITHUB_REPOSITORY/actions/runs/GITHUB_RUN_ID` gives it. */
|
|
46
|
+
const RUN_URL = /^https:\/\/[A-Za-z0-9.-]+(?::[0-9]{1,5})?\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/actions\/runs\/[0-9]{1,20}$/;
|
|
47
|
+
const VERSION = /^[0-9A-Za-z.+-]{1,40}$/;
|
|
48
|
+
const GROUP_LABEL = {
|
|
49
|
+
challenge: "challenge",
|
|
50
|
+
payment: "payment",
|
|
51
|
+
mppCharge: "MPP charge",
|
|
52
|
+
mppChannel: "MPP channel",
|
|
53
|
+
};
|
|
54
|
+
const GROUP_ORDER = ["challenge", "payment", "mppCharge", "mppChannel"];
|
|
55
|
+
const SKIP_KIND_TEXT = {
|
|
56
|
+
"read-only": "read-only tier",
|
|
57
|
+
"needs-payer": "no payer key",
|
|
58
|
+
unsupported: "unsupported",
|
|
59
|
+
"resource-consumed": "resource consumed",
|
|
60
|
+
"not-applicable": "not applicable",
|
|
61
|
+
dependency: "an earlier check did not pass",
|
|
62
|
+
};
|
|
63
|
+
const CHANGE_ORDER = [
|
|
64
|
+
"regression",
|
|
65
|
+
"new-failure",
|
|
66
|
+
"status-changed",
|
|
67
|
+
"fixed",
|
|
68
|
+
"graded",
|
|
69
|
+
"new-endpoint",
|
|
70
|
+
"removed-endpoint",
|
|
71
|
+
];
|
|
72
|
+
function version(value) {
|
|
73
|
+
return VERSION.test(value) ? value : "unknown";
|
|
74
|
+
}
|
|
75
|
+
/** "Wasit 0.7.0 (core 0.7.0)", and ", built from commit 0123456" when an Action build names its commit. */
|
|
76
|
+
function wasitText(wasit) {
|
|
77
|
+
const build = isShortCommit(wasit.build) ? `, built from commit ${wasit.build}` : "";
|
|
78
|
+
return `Wasit ${version(wasit.cli)} (core ${version(wasit.core)})${build}`;
|
|
79
|
+
}
|
|
80
|
+
/** The reason follows "unsupported." in the list, so it starts a sentence. */
|
|
81
|
+
function upperFirst(text) {
|
|
82
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
83
|
+
}
|
|
84
|
+
/** "challenge 5/5", or "payment not run: read-only tier" when the whole group was skipped for one reason. */
|
|
85
|
+
function groupText(endpoint, group) {
|
|
86
|
+
const results = endpoint.results.filter((result) => checkGroup(result.id, endpoint.protocol) === group);
|
|
87
|
+
if (results.length === 0)
|
|
88
|
+
return undefined;
|
|
89
|
+
const count = (status) => results.filter((result) => result.status === status).length;
|
|
90
|
+
const label = GROUP_LABEL[group];
|
|
91
|
+
const skipped = count("SKIP");
|
|
92
|
+
if (skipped === results.length) {
|
|
93
|
+
const kinds = new Set(results.map((result) => result.skipKind));
|
|
94
|
+
const [only] = [...kinds];
|
|
95
|
+
return kinds.size === 1 && only !== undefined ? `${label} not run: ${SKIP_KIND_TEXT[only]}` : `${label} not run`;
|
|
96
|
+
}
|
|
97
|
+
const parts = [`${label} ${count("PASS")}/${results.length}`];
|
|
98
|
+
if (count("FAIL") > 0)
|
|
99
|
+
parts.push(`${count("FAIL")} failed`);
|
|
100
|
+
if (count("ERROR") > 0)
|
|
101
|
+
parts.push(`${count("ERROR")} could not run`);
|
|
102
|
+
if (skipped > 0)
|
|
103
|
+
parts.push(`${skipped} skipped`);
|
|
104
|
+
return parts.join(", ");
|
|
105
|
+
}
|
|
106
|
+
function checksCell(endpoint) {
|
|
107
|
+
return GROUP_ORDER.map((group) => groupText(endpoint, group)).filter((text) => text !== undefined).join("; ");
|
|
108
|
+
}
|
|
109
|
+
/** The baseline the run is compared with (one of another environment is not), and the run's verdict. */
|
|
110
|
+
function verdictOf(input) {
|
|
111
|
+
const { report } = input;
|
|
112
|
+
// A baseline from another environment is another service: it is not compared.
|
|
113
|
+
const problem = input.baseline === undefined ? undefined : baselineProblem(report, input.baseline.report);
|
|
114
|
+
const baseline = problem === undefined ? input.baseline : undefined;
|
|
115
|
+
const note = problem ?? input.baselineNote;
|
|
116
|
+
const verdict = runExitCode(report, baseline?.report);
|
|
117
|
+
const couldNotRun = report.endpoints.some((endpoint) => endpoint.results.some((result) => result.status === "ERROR"));
|
|
118
|
+
const word = verdict.code === 0
|
|
119
|
+
? "conformant"
|
|
120
|
+
: verdict.code === 1
|
|
121
|
+
? report.totals.nonConformant > 0
|
|
122
|
+
? "non-conformant"
|
|
123
|
+
: "regression"
|
|
124
|
+
: report.totals.graded === 0 && !couldNotRun
|
|
125
|
+
? "nothing graded"
|
|
126
|
+
: "no verdict";
|
|
127
|
+
return { baseline, note, code: verdict.code, word };
|
|
128
|
+
}
|
|
129
|
+
/** The check whose settlement a protocol's payment proof links: the one that pays once and is read back from the chain. */
|
|
130
|
+
const PROOF_CHECK = {
|
|
131
|
+
x402: "X402-06",
|
|
132
|
+
"mpp-charge": "MPP-01",
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* The payment proof under an endpoint: a link to the transaction of X402-06
|
|
136
|
+
* (x402) or MPP-01 (MPP charge) on Stellar Expert, and only when every part is
|
|
137
|
+
* Wasit's own and checked: the run is on `stellar:testnet`, that check passed,
|
|
138
|
+
* and its reference (read back from the chain by the check) is a 64-character
|
|
139
|
+
* lower-case hex hash. Never a link built from a service's text.
|
|
140
|
+
*/
|
|
141
|
+
function paymentProof(endpoint, network) {
|
|
142
|
+
if (network !== "stellar:testnet")
|
|
143
|
+
return undefined;
|
|
144
|
+
const check = PROOF_CHECK[endpoint.protocol];
|
|
145
|
+
if (check === undefined)
|
|
146
|
+
return undefined;
|
|
147
|
+
const honest = endpoint.results.find((result) => result.id === check && result.status === "PASS");
|
|
148
|
+
const reference = honest?.reference;
|
|
149
|
+
if (reference === undefined || !STELLAR_TX.test(reference))
|
|
150
|
+
return undefined;
|
|
151
|
+
return (`**Payment proof**: ${check} settled on stellar:testnet, ` +
|
|
152
|
+
`[tx ${reference.slice(0, 4)}…${reference.slice(-4)} on Stellar Expert](https://stellar.expert/explorer/testnet/tx/${reference}).`);
|
|
153
|
+
}
|
|
154
|
+
/** An endpoint's heading and the table of its checks, each with its mark, then its payment proof. */
|
|
155
|
+
function endpointSection(endpoint, network, md) {
|
|
156
|
+
const out = [
|
|
157
|
+
"",
|
|
158
|
+
`### ${OUTCOME_MARK[endpoint.outcome]} ${md(endpoint.name)} · ${endpoint.protocol} · ${endpoint.outcome}`,
|
|
159
|
+
"",
|
|
160
|
+
"| | Check | Result |",
|
|
161
|
+
"| --- | --- | --- |",
|
|
162
|
+
...endpoint.results.map((result) => `| ${STATUS_MARK[result.status]} | ${md(result.id)} ${md(result.name)} | ${result.status} |`),
|
|
163
|
+
];
|
|
164
|
+
const proof = paymentProof(endpoint, network);
|
|
165
|
+
if (proof !== undefined)
|
|
166
|
+
out.push("", proof);
|
|
167
|
+
return out;
|
|
168
|
+
}
|
|
169
|
+
/** Every check's detail, folded away at the end, so a long report cuts here and not in the verdict. */
|
|
170
|
+
function detailsBlock(report, md) {
|
|
171
|
+
const out = ["", "<details><summary>Details of each check</summary>", ""];
|
|
172
|
+
for (const endpoint of report.endpoints.slice(0, MAX_ENDPOINT_SECTIONS)) {
|
|
173
|
+
out.push(`**${md(endpoint.name)}**`, "");
|
|
174
|
+
let lastSkip;
|
|
175
|
+
for (const result of endpoint.results) {
|
|
176
|
+
// A skip with the reason of the skip just above it says so instead of repeating it.
|
|
177
|
+
const repeated = result.status === "SKIP" && lastSkip === result.detail;
|
|
178
|
+
lastSkip = result.status === "SKIP" ? result.detail : undefined;
|
|
179
|
+
const detail = repeated ? "the same reason as above." : md(result.detail);
|
|
180
|
+
out.push(`- ${STATUS_MARK[result.status]} ${md(result.id)} ${md(result.name)}: ${detail}`);
|
|
181
|
+
}
|
|
182
|
+
out.push("");
|
|
183
|
+
}
|
|
184
|
+
out.push("</details>");
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
function renderBody(input) {
|
|
188
|
+
const { report } = input;
|
|
189
|
+
const md = (value) => sanitizeForMarkdown(value, { redact: input.secrets ?? [] });
|
|
190
|
+
const { baseline, note, word } = verdictOf(input);
|
|
191
|
+
const sdk = report.sdk;
|
|
192
|
+
const out = [
|
|
193
|
+
`**Wasit: ${VERDICT_MARK[word]} ${word}.** ${describeTotals(report.totals)} on ${md(report.environment)}, ${md(report.network)}. ` +
|
|
194
|
+
`${wasitText(report.wasit)}, x402 v2, ` +
|
|
195
|
+
`@x402/core ${version(sdk["@x402/core"])}, @x402/stellar ${version(sdk["@x402/stellar"])}, ` +
|
|
196
|
+
`@stellar/mpp ${version(sdk["@stellar/mpp"])}, mppx ${version(sdk.mppx)}, ` +
|
|
197
|
+
`@stellar/stellar-sdk ${version(sdk["@stellar/stellar-sdk"])}.`,
|
|
198
|
+
"",
|
|
199
|
+
"| Endpoint | Protocol | Outcome | Checks |",
|
|
200
|
+
"| --- | --- | --- | --- |",
|
|
201
|
+
...report.endpoints.map((endpoint) => `| ${md(endpoint.name)} | ${endpoint.protocol} | ${OUTCOME_MARK[endpoint.outcome]} ${endpoint.outcome} | ${checksCell(endpoint)} |`),
|
|
202
|
+
];
|
|
203
|
+
for (const endpoint of report.endpoints.slice(0, MAX_ENDPOINT_SECTIONS))
|
|
204
|
+
out.push(...endpointSection(endpoint, report.network, md));
|
|
205
|
+
if (report.endpoints.length > MAX_ENDPOINT_SECTIONS) {
|
|
206
|
+
const rest = report.endpoints.length - MAX_ENDPOINT_SECTIONS;
|
|
207
|
+
out.push("", `${rest} more endpoint${rest === 1 ? " is" : "s are"} not shown check by check here; ` +
|
|
208
|
+
"the JSON report of wasit run has every check (in the Action, the log of the step Run Wasit).");
|
|
209
|
+
}
|
|
210
|
+
const notGraded = report.endpoints.filter((endpoint) => (endpoint.outcome === "unsupported" || endpoint.outcome === "no-verdict") && endpoint.reason !== undefined);
|
|
211
|
+
if (notGraded.length > 0) {
|
|
212
|
+
out.push("", "### Not graded");
|
|
213
|
+
for (const endpoint of notGraded)
|
|
214
|
+
out.push(`- **${md(endpoint.name)}**: ${endpoint.outcome}. ${md(upperFirst(endpoint.reason ?? ""))}`);
|
|
215
|
+
}
|
|
216
|
+
out.push("", "### Changed since main");
|
|
217
|
+
if (baseline === undefined) {
|
|
218
|
+
out.push(note === undefined
|
|
219
|
+
? "No baseline on main yet, so nothing is compared. The next run on main creates it."
|
|
220
|
+
: `The baseline from main could not be used (${md(note)}), so nothing is compared and the history starts again with the next run on main.`);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
const changes = diffReports(report, baseline.report).sort((a, b) => CHANGE_ORDER.indexOf(a.kind) - CHANGE_ORDER.indexOf(b.kind));
|
|
224
|
+
out.push(comparedWith(baseline.report.startedAt, input.baselineRun));
|
|
225
|
+
if (changes.length === 0)
|
|
226
|
+
out.push("No change since main.");
|
|
227
|
+
for (const change of changes.slice(0, MAX_CHANGES_SHOWN))
|
|
228
|
+
out.push(`- ${describeChange(change, md)}`);
|
|
229
|
+
if (changes.length > MAX_CHANGES_SHOWN)
|
|
230
|
+
out.push(`- ${changes.length - MAX_CHANGES_SHOWN} more changes not shown.`);
|
|
231
|
+
}
|
|
232
|
+
const failures = report.endpoints.flatMap((endpoint) => endpoint.results.filter((result) => result.status === "FAIL").map((result) => ({ endpoint, result })));
|
|
233
|
+
if (failures.length > 0) {
|
|
234
|
+
out.push("", "### Failures");
|
|
235
|
+
for (const { endpoint, result } of failures.slice(0, MAX_FAILURES_SHOWN)) {
|
|
236
|
+
out.push("", `**${md(endpoint.name)}: ${md(result.id)} ${md(result.name)}**`, `- Found: ${md(result.detail)}`);
|
|
237
|
+
// What the check expected and what the service sent: quoted from the service, so cut and escaped like the rest.
|
|
238
|
+
if (result.expected !== undefined)
|
|
239
|
+
out.push(`- Expected: ${md(result.expected)}`);
|
|
240
|
+
if (result.actual !== undefined)
|
|
241
|
+
out.push(`- Actual: ${md(result.actual)}`);
|
|
242
|
+
if (result.fix !== undefined)
|
|
243
|
+
out.push(`- Fix: ${md(result.fix)}`);
|
|
244
|
+
if (result.docs !== undefined && DOCS_LINK.test(result.docs))
|
|
245
|
+
out.push(`- Docs: ${result.docs}`);
|
|
246
|
+
}
|
|
247
|
+
if (failures.length > MAX_FAILURES_SHOWN) {
|
|
248
|
+
const rest = failures.length - MAX_FAILURES_SHOWN;
|
|
249
|
+
out.push("", `${rest} more failure${rest === 1 ? "" : "s"} not shown.`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
const recent = baseline === undefined ? [] : recentFailures(input.history ?? baseline.history);
|
|
253
|
+
if (recent.length > 0) {
|
|
254
|
+
out.push("", "### Recent failures on main");
|
|
255
|
+
for (const item of recent.slice(0, MAX_RECENT_SHOWN)) {
|
|
256
|
+
out.push(`- ${md(item.endpoint)} ${md(item.check)}: failed in ${item.failed} of the last ${item.runs} runs on main`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (report.notes.length > 0) {
|
|
260
|
+
out.push("", "### Notes");
|
|
261
|
+
for (const item of report.notes)
|
|
262
|
+
out.push(`- ${md(item)}`);
|
|
263
|
+
}
|
|
264
|
+
out.push(...detailsBlock(report, md));
|
|
265
|
+
return out.join("\n");
|
|
266
|
+
}
|
|
267
|
+
/** "2026-11-15 10:00 UTC", from the report's own start time; nothing that is not a time. */
|
|
268
|
+
function utcMinute(iso) {
|
|
269
|
+
const time = Date.parse(iso);
|
|
270
|
+
if (!Number.isFinite(time))
|
|
271
|
+
return undefined;
|
|
272
|
+
return `${new Date(time).toISOString().slice(0, 16).replace("T", " ")} UTC`;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* The line that says what "Changed since main" compares with (D-022b): the last
|
|
276
|
+
* green run on main, so a FAIL that main has now is not read as this run's.
|
|
277
|
+
*/
|
|
278
|
+
function comparedWith(startedAt, run) {
|
|
279
|
+
const when = utcMinute(startedAt);
|
|
280
|
+
const id = run !== undefined && Number.isSafeInteger(run) && run > 0 ? run : undefined;
|
|
281
|
+
const started = when === undefined ? "" : `started ${when}`;
|
|
282
|
+
const which = id !== undefined ? `: run ${id}${started === "" ? "" : `, ${started}`}` : started === "" ? "" : `, ${started}`;
|
|
283
|
+
return `Compared with the last green run on main${which}. Runs on main that failed after it are counted under Recent failures on main, not here.`;
|
|
284
|
+
}
|
|
285
|
+
function describeChange(change, md) {
|
|
286
|
+
const endpoint = md(change.endpoint);
|
|
287
|
+
const check = md(change.check ?? "");
|
|
288
|
+
switch (change.kind) {
|
|
289
|
+
case "regression":
|
|
290
|
+
return `Regression: ${endpoint} was ${change.from} on main and is now ${change.to}.`;
|
|
291
|
+
case "new-failure":
|
|
292
|
+
return `New FAIL: ${endpoint} ${check} (was ${change.from} on main).`;
|
|
293
|
+
case "fixed":
|
|
294
|
+
return `Fixed: ${endpoint} ${check} (was FAIL on main).`;
|
|
295
|
+
case "status-changed":
|
|
296
|
+
return `${endpoint} ${check}: ${change.from} on main, now ${change.to}.`;
|
|
297
|
+
case "graded":
|
|
298
|
+
return `Now graded: ${endpoint} (was ${change.from} on main).`;
|
|
299
|
+
case "new-endpoint":
|
|
300
|
+
return `New endpoint: ${endpoint}.`;
|
|
301
|
+
case "removed-endpoint":
|
|
302
|
+
return `Removed endpoint: ${endpoint}.`;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/** A text over the limit is cut at a line break, and says so. */
|
|
306
|
+
function withinLimit(text) {
|
|
307
|
+
if (text.length <= MAX_COMMENT_CHARACTERS)
|
|
308
|
+
return text;
|
|
309
|
+
const cut = text.lastIndexOf("\n", MAX_COMMENT_CHARACTERS - 200);
|
|
310
|
+
return `${text.slice(0, cut > 0 ? cut : MAX_COMMENT_CHARACTERS - 200)}\n\n(The rest is cut: the JSON report of wasit run has all of it; in the Action, the log of the step Run Wasit.)`;
|
|
311
|
+
}
|
|
312
|
+
/** The pull request comment: the marker, then the report. */
|
|
313
|
+
export function renderComment(input) {
|
|
314
|
+
return withinLimit(`${COMMENT_MARKER}\n${renderBody(input)}\n`);
|
|
315
|
+
}
|
|
316
|
+
/** The job summary: the same text without the marker. */
|
|
317
|
+
export function renderSummary(input) {
|
|
318
|
+
return withinLimit(`${renderBody(input)}\n`);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* What the comment says when the run left no report to render: the service did
|
|
322
|
+
* not start, never answered, or the config could not be used. The comment from
|
|
323
|
+
* the push before must not stay next to a red check, so this replaces it. The
|
|
324
|
+
* text is fixed: nothing from the service, the config or the broken report is
|
|
325
|
+
* quoted, because none of it can be trusted to be there or to be safe.
|
|
326
|
+
*/
|
|
327
|
+
function renderNoReportBody(versions) {
|
|
328
|
+
const sdk = versions.sdk;
|
|
329
|
+
return [
|
|
330
|
+
"**Wasit: ⚠️ no verdict.** The run ended before it wrote a report, so nothing was graded. " +
|
|
331
|
+
`${wasitText(versions.wasit)}, x402 v2, ` +
|
|
332
|
+
`@x402/core ${version(sdk["@x402/core"])}, @x402/stellar ${version(sdk["@x402/stellar"])}, ` +
|
|
333
|
+
`@stellar/mpp ${version(sdk["@stellar/mpp"])}, mppx ${version(sdk.mppx)}, ` +
|
|
334
|
+
`@stellar/stellar-sdk ${version(sdk["@stellar/stellar-sdk"])}.`,
|
|
335
|
+
"",
|
|
336
|
+
"This is not a failure of the service and not a pass: the service did not start or never answered, " +
|
|
337
|
+
"or the config could not be used. The reason is in the job log. This comment is replaced on the next push.",
|
|
338
|
+
].join("\n");
|
|
339
|
+
}
|
|
340
|
+
/** The pull request comment for a run that left no report: the marker, then the fixed text. */
|
|
341
|
+
export function renderNoReportComment(versions) {
|
|
342
|
+
return `${COMMENT_MARKER}\n${renderNoReportBody(versions)}\n`;
|
|
343
|
+
}
|
|
344
|
+
/** The job summary for a run that left no report: the same text without the marker. */
|
|
345
|
+
export function renderNoReportSummary(versions) {
|
|
346
|
+
return `${renderNoReportBody(versions)}\n`;
|
|
347
|
+
}
|
|
348
|
+
/** The check run's limits, as GitHub sets them. */
|
|
349
|
+
const MAX_CHECK_TITLE = 255;
|
|
350
|
+
const MAX_CHECK_SUMMARY = 65_535;
|
|
351
|
+
/** "10 passed, 1 failed, 1 could not run, 1 skipped", over every endpoint. */
|
|
352
|
+
function statusCounts(report) {
|
|
353
|
+
const all = report.endpoints.flatMap((endpoint) => endpoint.results);
|
|
354
|
+
const count = (status) => all.filter((result) => result.status === status).length;
|
|
355
|
+
const parts = [`${count("PASS")} passed`];
|
|
356
|
+
if (count("FAIL") > 0)
|
|
357
|
+
parts.push(`${count("FAIL")} failed`);
|
|
358
|
+
if (count("ERROR") > 0)
|
|
359
|
+
parts.push(`${count("ERROR")} could not run`);
|
|
360
|
+
if (count("SKIP") > 0)
|
|
361
|
+
parts.push(`${count("SKIP")} skipped`);
|
|
362
|
+
return parts.join(", ");
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* The check run "Wasit conformance" at the end of a run: success for a run that
|
|
366
|
+
* exits 0, failure for 1, neutral for no verdict. The title holds only the
|
|
367
|
+
* verdict word and counts; the summary is the job summary.
|
|
368
|
+
*/
|
|
369
|
+
export function renderCheckRun(input) {
|
|
370
|
+
const { code, word } = verdictOf(input);
|
|
371
|
+
return {
|
|
372
|
+
title: `${VERDICT_MARK[word]} ${word} · ${statusCounts(input.report)}`.slice(0, MAX_CHECK_TITLE),
|
|
373
|
+
summary: renderSummary(input).slice(0, MAX_CHECK_SUMMARY),
|
|
374
|
+
conclusion: code === 0 ? "success" : code === 1 ? "failure" : "neutral",
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
/** The check run for a run that left no report: neutral, with the fixed text of the no-report comment. */
|
|
378
|
+
export function renderNoReportCheckRun(versions) {
|
|
379
|
+
return {
|
|
380
|
+
title: "⚠️ no verdict · the run ended before it wrote a report",
|
|
381
|
+
summary: renderNoReportSummary(versions).slice(0, MAX_CHECK_SUMMARY),
|
|
382
|
+
conclusion: "neutral",
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* The pull request comment while Wasit runs (Najmi, 2026-11-20): the marker,
|
|
387
|
+
* then a fixed line with the start time and a link to the run. The result
|
|
388
|
+
* replaces it when the run ends. The only value from outside is the
|
|
389
|
+
* environment's name, which goes through the sanitiser; the link is used only
|
|
390
|
+
* when it has the shape of a GitHub run page.
|
|
391
|
+
*/
|
|
392
|
+
export function renderRunningComment(input) {
|
|
393
|
+
const md = (value) => sanitizeForMarkdown(value, { redact: input.secrets ?? [] });
|
|
394
|
+
const when = utcMinute(input.startedAt);
|
|
395
|
+
const environment = input.environment !== undefined && input.environment.trim() !== "" ? ` on ${md(input.environment)}` : "";
|
|
396
|
+
const started = when === undefined ? "" : ` · started ${when}`;
|
|
397
|
+
const link = input.runUrl !== undefined && RUN_URL.test(input.runUrl) ? ` · [follow the run](${input.runUrl})` : "";
|
|
398
|
+
return `${COMMENT_MARKER}\n⏳ **Wasit is running**${environment}${started}${link}\n\nThe result replaces this comment when the run ends.\n`;
|
|
399
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The config writer of `wasit init` (spec C; init-skeleton-plan.md section 6,
|
|
3
|
+
* Najmi's rule of 2026-11-15: the writer takes only data that is certain).
|
|
4
|
+
*
|
|
5
|
+
* Data in, the text of a `wasit.config.json` out, checked by the same
|
|
6
|
+
* validator `wasit run` and the Action read it with, so init can never write
|
|
7
|
+
* a file they refuse. Every field is given: the writer has no defaults of its
|
|
8
|
+
* own and guesses nothing. It writes an environment only for a service its
|
|
9
|
+
* operator runs (`operatedByMe` true, literally) and, in this version, only on
|
|
10
|
+
* a test network. It never writes a secret (the validator refuses one), a
|
|
11
|
+
* header of the endpoint (a credential goes in `WASIT_HEADER_*`), the mainnet
|
|
12
|
+
* opt-in (not a config value at all) or anything that enables MPP-13.
|
|
13
|
+
*
|
|
14
|
+
* Adding to an existing file is the default: the file is read as it is, its
|
|
15
|
+
* own keys kept, and the new endpoints appended; an endpoint name it already
|
|
16
|
+
* has, or an environment of the same name with other values, is refused, never
|
|
17
|
+
* overwritten. One exception, so init can be run again on the same route (to
|
|
18
|
+
* set up its key, say): an endpoint the file already has with every value init
|
|
19
|
+
* writes the same, in an environment the file already has the same, is left as
|
|
20
|
+
* it is and counted as unchanged. `replace` starts from nothing.
|
|
21
|
+
*
|
|
22
|
+
* Pure: no file, no network, no key.
|
|
23
|
+
*/
|
|
24
|
+
import type { ProtocolId } from "./catalogue.js";
|
|
25
|
+
import { type JsonValue, type PinConfig, type ReadyConfig } from "./config.js";
|
|
26
|
+
import { ConfigurationError } from "./errors.js";
|
|
27
|
+
/** The writer will not write this config: nothing is written. */
|
|
28
|
+
export declare class ConfigWriteError extends ConfigurationError {
|
|
29
|
+
constructor(message: string);
|
|
30
|
+
}
|
|
31
|
+
export interface InitEnvironmentInput {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly baseUrl: string;
|
|
34
|
+
readonly network: string;
|
|
35
|
+
/** Literally true: init writes an environment only for a service its operator runs. */
|
|
36
|
+
readonly operatedByMe: true;
|
|
37
|
+
readonly pinned?: PinConfig;
|
|
38
|
+
}
|
|
39
|
+
export interface InitRejectInput {
|
|
40
|
+
readonly method?: string;
|
|
41
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
42
|
+
readonly body?: JsonValue;
|
|
43
|
+
readonly note?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface InitEndpointInput {
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly protocol: ProtocolId;
|
|
48
|
+
readonly path: string;
|
|
49
|
+
readonly method: string;
|
|
50
|
+
readonly body?: JsonValue;
|
|
51
|
+
/** The request the service must refuse (X402-11). */
|
|
52
|
+
readonly reject?: InitRejectInput;
|
|
53
|
+
/** An MPP channel endpoint: the channel contract it bills through. */
|
|
54
|
+
readonly channel?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface InitServiceInput {
|
|
57
|
+
readonly start: string;
|
|
58
|
+
readonly ready: ReadyConfig;
|
|
59
|
+
}
|
|
60
|
+
export interface ConfigWriteInput {
|
|
61
|
+
readonly environment: InitEnvironmentInput;
|
|
62
|
+
readonly endpoints: readonly InitEndpointInput[];
|
|
63
|
+
readonly service?: InitServiceInput;
|
|
64
|
+
}
|
|
65
|
+
export interface ConfigWriteOptions {
|
|
66
|
+
/** The text of the config already at the destination, when there is one. */
|
|
67
|
+
readonly existing?: string;
|
|
68
|
+
/** Start from nothing instead of adding to `existing` (`--force`). */
|
|
69
|
+
readonly replace?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface ConfigWriteResult {
|
|
72
|
+
/** The whole file, two-space JSON, ending in one line break. */
|
|
73
|
+
readonly text: string;
|
|
74
|
+
/** The endpoints this write added, by name. */
|
|
75
|
+
readonly added: readonly string[];
|
|
76
|
+
/** The endpoints the file already had exactly as given, by name: left as they are. */
|
|
77
|
+
readonly unchanged: readonly string[];
|
|
78
|
+
/** Whether the environment is new in the file. */
|
|
79
|
+
readonly environmentAdded: boolean;
|
|
80
|
+
/** Whether the service block is new in the file. */
|
|
81
|
+
readonly serviceAdded: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Whether the file needs writing: false when it already holds everything
|
|
84
|
+
* given (every endpoint unchanged, the environment and the service already
|
|
85
|
+
* there). The caller then leaves the file as it is, byte for byte.
|
|
86
|
+
*/
|
|
87
|
+
readonly changed: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The text of the config with `input` in it: a new file, or `existing` with
|
|
91
|
+
* the new endpoints appended. Checked by `validateConfig` before it is
|
|
92
|
+
* returned.
|
|
93
|
+
*
|
|
94
|
+
* @throws {ConfigWriteError} When the data, the existing file or the result is not one init writes. Nothing is to be written then.
|
|
95
|
+
*/
|
|
96
|
+
export declare function writeConfigText(input: ConfigWriteInput, options?: ConfigWriteOptions): ConfigWriteResult;
|