run402 2.15.2 → 2.15.3
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/lib/agent.mjs +15 -1
- package/lib/doctor.mjs +14 -2
- package/package.json +1 -1
package/lib/agent.mjs
CHANGED
|
@@ -122,7 +122,21 @@ async function status(args = []) {
|
|
|
122
122
|
allowanceAuthHeaders("/agent/v1/contact/status");
|
|
123
123
|
|
|
124
124
|
try {
|
|
125
|
-
const
|
|
125
|
+
const sdk = getSdk();
|
|
126
|
+
const data = await sdk.admin.getAgentContactStatus();
|
|
127
|
+
// v1.56: augment the response with email_verification.last_challenge from
|
|
128
|
+
// /agent/v1/operator/status so the operator sees per-attempt status
|
|
129
|
+
// (trust_rejected with which verdicts, attempts remaining, hint) without
|
|
130
|
+
// a second command. Best-effort — older gateways without the v1.55+ route
|
|
131
|
+
// skip the augment silently.
|
|
132
|
+
try {
|
|
133
|
+
const opStatus = await sdk.admin.getOperatorStatus();
|
|
134
|
+
if (opStatus && opStatus.email_verification) {
|
|
135
|
+
data.email_verification = opStatus.email_verification;
|
|
136
|
+
}
|
|
137
|
+
} catch {
|
|
138
|
+
// Older gateway — keep the original response shape.
|
|
139
|
+
}
|
|
126
140
|
console.log(JSON.stringify(data, null, 2));
|
|
127
141
|
} catch (err) {
|
|
128
142
|
reportSdkError(err);
|
package/lib/doctor.mjs
CHANGED
|
@@ -169,13 +169,25 @@ export async function run(sub, args = []) {
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
// 6. Operator health snapshot (v1.55).
|
|
172
|
+
// 6. Operator health snapshot (v1.55 + v1.56 verification attempt detail).
|
|
173
173
|
try {
|
|
174
174
|
const sdk = getSdk();
|
|
175
175
|
const status = await sdk.admin.getOperatorStatus();
|
|
176
176
|
const gaps = [];
|
|
177
177
|
if (status.operator_contact.email_status !== "verified") {
|
|
178
|
-
|
|
178
|
+
// v1.56: prefer the structured email_verification.last_challenge.hint
|
|
179
|
+
// over the generic "email not verified" message. The gateway computes
|
|
180
|
+
// a per-reason remediation hint that's actionable for the operator.
|
|
181
|
+
const ev = status.email_verification;
|
|
182
|
+
const ch = ev?.last_challenge;
|
|
183
|
+
if (ch && ch.hint) {
|
|
184
|
+
const attemptsLine = ch.attempt_count > 0
|
|
185
|
+
? ` (${ch.attempt_count}/${ch.attempt_count + ch.remaining_attempts} attempts used, ${ch.remaining_attempts} remaining)`
|
|
186
|
+
: "";
|
|
187
|
+
gaps.push(`operator email not verified${attemptsLine}: ${ch.hint}`);
|
|
188
|
+
} else {
|
|
189
|
+
gaps.push(`operator email not verified (${status.operator_contact.email_status}) — run 'run402 agent contact --email ...' then reply to the challenge`);
|
|
190
|
+
}
|
|
179
191
|
}
|
|
180
192
|
if (status.operator_contact.passkey_status !== "verified") {
|
|
181
193
|
gaps.push("operator passkey not bound — run 'run402 agent passkey enroll' after email verification");
|
package/package.json
CHANGED