@pipod/cli 0.1.9 → 0.1.10

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 CHANGED
@@ -2349,7 +2349,7 @@ function retiredLocalKeysFound(raw) {
2349
2349
  return found;
2350
2350
  }
2351
2351
  var CLIENT_ONLY_TOP_KEYS = ["$schema", "secretResolver"];
2352
- var CLIENT_ONLY_PI_KEYS = ["chords", "sessionNaming"];
2352
+ var CLIENT_ONLY_PI_KEYS = ["chords", "sessionNaming", "podExtensions"];
2353
2353
  function nonBundleKeysFound(config) {
2354
2354
  const found = outgoingStrippedKeysFound(config);
2355
2355
  for (const key of CLIENT_ONLY_TOP_KEYS) {
@@ -2442,7 +2442,8 @@ var DEFAULT_CONFIG = {
2442
2442
  args: [],
2443
2443
  hostConfig: DEFAULT_HOST_CONFIG,
2444
2444
  chords: { enabled: true, prefix: DEFAULT_CHORD_PREFIX, bindings: DEFAULT_CHORD_BINDINGS },
2445
- sessionNaming: "auto"
2445
+ sessionNaming: "auto",
2446
+ podExtensions: "ask"
2446
2447
  },
2447
2448
  idleTimeoutMinutes: 15,
2448
2449
  archiveAfterMinutes: 60,
@@ -2746,7 +2747,8 @@ function validateConfig(raw) {
2746
2747
  "args",
2747
2748
  "hostConfig",
2748
2749
  "chords",
2749
- "sessionNaming"
2750
+ "sessionNaming",
2751
+ "podExtensions"
2750
2752
  ]);
2751
2753
  const hostConfigRaw = v.object("pi.hostConfig", piRaw["hostConfig"]);
2752
2754
  v.warnUnknownKeys("pi.hostConfig", hostConfigRaw, [
@@ -2810,6 +2812,12 @@ function validateConfig(raw) {
2810
2812
  piRaw["sessionNaming"],
2811
2813
  ["auto", "off"],
2812
2814
  d.pi.sessionNaming
2815
+ ),
2816
+ podExtensions: v.enumValue(
2817
+ "pi.podExtensions",
2818
+ piRaw["podExtensions"],
2819
+ ["ask", "run"],
2820
+ d.pi.podExtensions
2813
2821
  )
2814
2822
  },
2815
2823
  // 0 is meaningful here (auto-stop off), so the floor is 0 rather than 1.
@@ -3694,7 +3702,7 @@ function resolveLaunchTemplateRef(flags, layers) {
3694
3702
  function machineClientConfig(raw) {
3695
3703
  const pi = isPlainObjectValue(raw["pi"]) ? raw["pi"] : {};
3696
3704
  const clientPi = Object.fromEntries(
3697
- Object.entries(pi).filter(([key]) => ["chords", "sessionNaming"].includes(key))
3705
+ Object.entries(pi).filter(([key]) => CLIENT_ONLY_PI_KEYS.includes(key))
3698
3706
  );
3699
3707
  return Object.keys(clientPi).length > 0 ? { pi: clientPi } : {};
3700
3708
  }
@@ -4176,7 +4184,6 @@ function settingsBundle(settings) {
4176
4184
  return { ...settings, piFiles: settings.piFiles ?? {} };
4177
4185
  }
4178
4186
  var CLIENT_ONLY_TOP_KEYS2 = ["$schema", "template", "secretResolver"];
4179
- var CLIENT_ONLY_PI_KEYS2 = ["chords", "sessionNaming"];
4180
4187
  function isPlainObject2(value) {
4181
4188
  return value !== null && typeof value === "object" && !Array.isArray(value);
4182
4189
  }
@@ -4194,7 +4201,7 @@ function mergePulledConfig(existing, pulled) {
4194
4201
  ..."template" in top ? { template: top["template"] } : {},
4195
4202
  ..."secretResolver" in top ? { secretResolver: top["secretResolver"] } : {}
4196
4203
  };
4197
- const clientPi = isPlainObject2(existing["pi"]) ? pick(existing["pi"], CLIENT_ONLY_PI_KEYS2) : {};
4204
+ const clientPi = isPlainObject2(existing["pi"]) ? pick(existing["pi"], CLIENT_ONLY_PI_KEYS) : {};
4198
4205
  const pi = { ...isPlainObject2(pod["pi"]) ? pod["pi"] : {}, ...clientPi };
4199
4206
  if (Object.keys(pi).length > 0) next["pi"] = pi;
4200
4207
  return next;
@@ -7456,6 +7463,7 @@ function attestedPackages(piSettings) {
7456
7463
  return { specs, refused };
7457
7464
  }
7458
7465
  async function trustAttestedPackages(specs, opts) {
7466
+ if (opts.policy === "run") return { trusted: specs, declined: [] };
7459
7467
  const file = path17.join(opts.cacheRoot, "trusted-extensions.json");
7460
7468
  const key = (spec) => `${spec.name}@${spec.version}`;
7461
7469
  let known = [];
@@ -14334,6 +14342,7 @@ async function runAccountInteractive(opts) {
14334
14342
  }
14335
14343
  const { trusted, declined } = await trustAttestedPackages(attested.specs, {
14336
14344
  cacheRoot,
14345
+ policy: context.config.pi.podExtensions,
14337
14346
  ask: (question) => confirm(question, { nonInteractiveDefault: false })
14338
14347
  });
14339
14348
  if (declined.length > 0) {