@sudoji/cli 0.1.7 → 0.1.9

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -223,12 +223,12 @@ function loadSettings(opts = {}) {
223
223
  function doctorCommand() {
224
224
  return new Command3("doctor").description("Verify auth, connectivity, settings, and redaction").option("--profile <name>", "Credentials profile to check", "default").option("--server <url>", "Override API base URL for this check").action(async (opts) => {
225
225
  const checks = [];
226
- const key = await load(opts.profile);
227
- const keyOk = key !== null && isSudojiKey2(key);
226
+ const creds = await load(opts.profile);
227
+ const keyOk = creds !== null && isSudojiKey2(creds.token);
228
228
  checks.push({
229
229
  label: "API key stored",
230
230
  ok: keyOk,
231
- detail: keyOk ? `${key.slice(0, 18)}\u2026` : `no key for profile "${opts.profile}" \u2014 run: sudoji login`
231
+ detail: keyOk ? `${creds.token.slice(0, 18)}\u2026` : `no key for profile "${opts.profile}" \u2014 run: sudoji login`
232
232
  });
233
233
  let settings = null;
234
234
  try {
@@ -253,7 +253,7 @@ function doctorCommand() {
253
253
  });
254
254
  }
255
255
  const testInput = "password=super$ecret TOKEN=abc123 STRIPE_KEY=sk_live_xxx";
256
- const testRedacted = redact(testInput);
256
+ const { text: testRedacted } = redact(testInput);
257
257
  const redactionWorking = !testRedacted.includes("super$ecret") && !testRedacted.includes("abc123");
258
258
  checks.push({
259
259
  label: "Redaction active",
@@ -410,7 +410,7 @@ function askCommand() {
410
410
  context,
411
411
  maxSteps: Math.min(parseInt(opts.maxSteps, 10), 50)
412
412
  },
413
- key
413
+ key.token
414
414
  );
415
415
  if (!opts.json) process.stdout.write("\n");
416
416
  for await (const event of stream) {
@@ -462,7 +462,7 @@ function logsCommand() {
462
462
  console.error(`Failed to fetch logs: ${err instanceof Error ? err.message : err}`);
463
463
  process.exit(1);
464
464
  }
465
- const redacted = redact3(raw);
465
+ const { text: redacted } = redact3(raw);
466
466
  const message = `${opts.ask}
467
467
 
468
468
  <logs source="${opts.source}">
@@ -477,7 +477,7 @@ ${redacted}
477
477
  const baseUrl = opts.server ?? settings.apiBaseUrl;
478
478
  const context = gatherContext();
479
479
  context.logs = redacted;
480
- const stream = streamAgent(baseUrl, { message, mode: "diagnose", context, maxSteps: 10 }, key);
480
+ const stream = streamAgent(baseUrl, { message, mode: "diagnose", context, maxSteps: 10 }, key.token);
481
481
  process.stdout.write("\n");
482
482
  for await (const event of stream) {
483
483
  if (event.type === "text-delta") process.stdout.write(event.text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudoji/cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Sudoji installable IT agent CLI — diagnose, approve, fix on your Linux server.",
5
5
  "type": "module",
6
6
  "bin": {