@toon-protocol/rig 4.3.0 → 4.5.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.
@@ -40,6 +40,7 @@ import {
40
40
  serializeEventReceipt,
41
41
  serializePushPlan,
42
42
  serializePushResult,
43
+ serializeSecretUpdate,
43
44
  setGitAuthor,
44
45
  setHeadSymref,
45
46
  sha256Hex,
@@ -47,7 +48,7 @@ import {
47
48
  updateRef,
48
49
  writeGitObjects,
49
50
  writeToonConfig
50
- } from "./chunk-3RWM7PBM.js";
51
+ } from "./chunk-S2BMLXAD.js";
51
52
  import {
52
53
  ARWEAVE_GATEWAYS,
53
54
  COMMENT_KIND,
@@ -70,7 +71,7 @@ import {
70
71
  readClientConfigFile,
71
72
  resolveAccountIndex,
72
73
  resolveIdentity
73
- } from "./chunk-GWA3CSUR.js";
74
+ } from "./chunk-HMED76GU.js";
74
75
  import {
75
76
  ChannelMapStore,
76
77
  channelStatus,
@@ -299,7 +300,7 @@ function loadPaidSession(deps, relayUrl) {
299
300
  });
300
301
  }
301
302
  var defaultLoadStandalone = async (options) => {
302
- const mod = await import("./standalone-mode-JIEECDTI.js");
303
+ const mod = await import("./standalone-mode-W3ZEKC6M.js");
303
304
  return mod.createStandaloneContext(options);
304
305
  };
305
306
  function identityReport(ctx) {
@@ -2184,10 +2185,10 @@ async function gitShowBytes(repoRoot, commit, path) {
2184
2185
  );
2185
2186
  });
2186
2187
  }
2187
- function assertSecretName(name) {
2188
+ function assertSecretName(name, position) {
2188
2189
  if (!SECRET_NAME_RE.test(name)) {
2189
2190
  throw new Error(
2190
- `invalid secret name ${JSON.stringify(name)} \u2014 must match [A-Z_][A-Z0-9_]*`
2191
+ `invalid secret name in argument ${position} \u2014 NAME must match [A-Z_][A-Z0-9_]* (the argument is not shown)`
2191
2192
  );
2192
2193
  }
2193
2194
  if (RESERVED_SECRET_NAMES.includes(name)) {
@@ -2237,17 +2238,18 @@ async function runCiSecret(args, deps) {
2237
2238
  );
2238
2239
  }
2239
2240
  const seen = /* @__PURE__ */ new Set();
2240
- for (const entry of entries) {
2241
+ for (const [index, entry] of entries.entries()) {
2242
+ const position = index + 1;
2241
2243
  const eq = entry.indexOf("=");
2242
2244
  const name = eq === -1 ? entry : entry.slice(0, eq);
2243
- assertSecretName(name);
2245
+ assertSecretName(name, position);
2244
2246
  if (seen.has(name))
2245
2247
  throw new Error(`secret name ${name} given more than once`);
2246
2248
  seen.add(name);
2247
2249
  if (sub === "remove") {
2248
2250
  if (eq !== -1)
2249
2251
  throw new Error(
2250
- `rig ci secret remove takes bare names (got ${JSON.stringify(entry)})`
2252
+ `rig ci secret remove takes bare names \u2014 argument ${position} is NAME=value`
2251
2253
  );
2252
2254
  remove.push(name);
2253
2255
  } else if (eq === -1) {
@@ -2258,27 +2260,30 @@ async function runCiSecret(args, deps) {
2258
2260
  }
2259
2261
  stdinName = name;
2260
2262
  } else {
2261
- const value = entry.slice(eq + 1);
2262
- if (value === "") throw new Error(`secret ${name} has an empty value`);
2263
- set[name] = value;
2263
+ set[name] = entry.slice(eq + 1);
2264
2264
  }
2265
2265
  }
2266
+ if (stdinName !== void 0) {
2267
+ const value = io.isInteractive ? "" : await (deps.readStdin ?? defaultReadStdin)();
2268
+ const trimmed = value.replace(/\r?\n$/, "");
2269
+ if (trimmed === "") {
2270
+ throw new Error(
2271
+ `secret ${stdinName}: no value on stdin (pipe the value, or pass ${stdinName}=<value>)`
2272
+ );
2273
+ }
2274
+ set[stdinName] = trimmed;
2275
+ }
2276
+ serializeSecretUpdate({
2277
+ author: "0".repeat(64),
2278
+ created_at: 9999999999,
2279
+ set,
2280
+ remove
2281
+ });
2266
2282
  } catch (err) {
2267
2283
  io.err(err instanceof Error ? err.message : String(err));
2268
2284
  io.err(CI_SECRET_USAGE);
2269
2285
  return 2;
2270
2286
  }
2271
- if (stdinName !== void 0) {
2272
- const value = io.isInteractive ? "" : await (deps.readStdin ?? defaultReadStdin)();
2273
- const trimmed = value.replace(/\r?\n$/, "");
2274
- if (trimmed === "") {
2275
- io.err(
2276
- `secret ${stdinName}: no value on stdin (pipe the value, or pass ${stdinName}=<value>)`
2277
- );
2278
- return 2;
2279
- }
2280
- set[stdinName] = trimmed;
2281
- }
2282
2287
  const names = [...Object.keys(set), ...remove];
2283
2288
  return runCiEvent({
2284
2289
  command: sub === "set" ? "ci secret set" : "ci secret remove",
@@ -2373,7 +2378,7 @@ async function runCi(args, deps) {
2373
2378
  case "status":
2374
2379
  return runCiStatus(rest, deps);
2375
2380
  case "serve":
2376
- return (await import("./ci-serve-ZVJBZ3W3.js")).runCiServe(rest, deps);
2381
+ return (await import("./ci-serve-PYEHIBN7.js")).runCiServe(rest, deps);
2377
2382
  case "--help":
2378
2383
  case "-h":
2379
2384
  case "help":
@@ -7665,4 +7670,4 @@ export {
7665
7670
  rigVersion,
7666
7671
  dispatch
7667
7672
  };
7668
- //# sourceMappingURL=chunk-5HFOPKAB.js.map
7673
+ //# sourceMappingURL=chunk-UZZ2JKEC.js.map