@bensandee/tooling 0.72.2 → 0.72.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.
Files changed (2) hide show
  1. package/dist/bin.mjs +14 -23
  2. package/package.json +1 -1
package/dist/bin.mjs CHANGED
@@ -4961,7 +4961,7 @@ function buildManagedDevDeps(ctx) {
4961
4961
  const devDeps = { ...rootDevDeps(ctx.config) };
4962
4962
  if (!isMonorepo) Object.assign(devDeps, perPackageDevDeps(ctx.config));
4963
4963
  if (ctx.config.stack !== "none" || ctx.config.ci === "forgejo") devDeps["@bensandee/config"] = isWorkspacePackage(ctx, "@bensandee/config") ? "workspace:*" : "0.14.0";
4964
- if (!isWorkspacePackage(ctx, "@bensandee/tooling")) devDeps["@bensandee/tooling"] = "0.72.2";
4964
+ if (!isWorkspacePackage(ctx, "@bensandee/tooling")) devDeps["@bensandee/tooling"] = "0.72.3";
4965
4965
  if (ctx.config.useEslintPlugin && ctx.config.stack !== "none") devDeps["@bensandee/eslint-plugin"] = isWorkspacePackage(ctx, "@bensandee/eslint-plugin") ? "workspace:*" : "0.13.2";
4966
4966
  if (ctx.config.formatter === "oxfmt") devDeps["oxfmt"] = {
4967
4967
  "@changesets/cli": "3.0.1",
@@ -8663,7 +8663,7 @@ function reportFailures(failed, command) {
8663
8663
  function generateMigratePrompt(results, config, detected) {
8664
8664
  const sections = [];
8665
8665
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
8666
- sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.72.2 repo:sync\` on ${timestamp}_\n`);
8666
+ sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.72.3 repo:sync\` on ${timestamp}_\n`);
8667
8667
  const changed = results.filter((r) => r.action === "created" || r.action === "updated" || r.action === "archived");
8668
8668
  if (changed.length > 0) {
8669
8669
  const items = changed.map((r) => {
@@ -12725,7 +12725,7 @@ async function runPrUpsert(executor, options) {
12725
12725
  timeoutMs: 6e4,
12726
12726
  signal
12727
12727
  })).stdout.trim() !== "") log$1.warn("Working tree has uncommitted changes -- they will not be part of this PR.");
12728
- const resolved = resolveConnection(cwd);
12728
+ const resolved = options.connection;
12729
12729
  const derived = derivePrContent({
12730
12730
  branch,
12731
12731
  subjects,
@@ -12736,7 +12736,7 @@ async function runPrUpsert(executor, options) {
12736
12736
  wipPrefix: resolved.type === "forgejo"
12737
12737
  });
12738
12738
  debug(options, `pr:${mode} ${branch} (diff base ${localBase}, ${resolved.type})`);
12739
- const conn = resolved.type === "forgejo" ? withInjectedToken(resolved.conn, options.token) : null;
12739
+ const conn = resolved.type === "forgejo" ? resolved.conn : null;
12740
12740
  const open = conn !== null ? await findOpenPrEntry(executor, conn, branch, signal) : await findOpenGitHubPr(executor, cwd, branch, signal);
12741
12741
  const existing = open?.number ?? null;
12742
12742
  assertModeAllows(mode, existing, branch);
@@ -13012,18 +13012,6 @@ async function readGitHubPrContent(executor, cwd, prNumber, signal = null) {
13012
13012
  body: parsed.data.body ?? ""
13013
13013
  };
13014
13014
  }
13015
- /**
13016
- * Apply an injected forge token to a resolved connection. `resolveConnection` reads only the
13017
- * ambient RELEASE_TOKEN/FORGEJO_TOKEN, so a caller acting under a different identity (the agent's
13018
- * bot) passes its token here to author the PR object as that identity -- matching the branch push,
13019
- * which `buildGitAuthEnv` already authenticates with the same token. No token = ambient, unchanged.
13020
- */
13021
- function withInjectedToken(conn, token) {
13022
- return token === void 0 ? conn : {
13023
- ...conn,
13024
- token
13025
- };
13026
- }
13027
13015
  async function pushBranch(executor, cwd, branch, env, forceWithLease = false) {
13028
13016
  const pushArgs = forceWithLease ? [
13029
13017
  "push",
@@ -13289,6 +13277,7 @@ const prCreateCommand = defineCommand({
13289
13277
  const body = readBodySource(args.body ?? void 0, args["body-file"] ?? void 0);
13290
13278
  const result = await runPrUpsert(createRealExecutor$1(), {
13291
13279
  cwd: process.cwd(),
13280
+ connection: resolveConnection(process.cwd()),
13292
13281
  mode: args.upsert === true ? "upsert" : "create",
13293
13282
  title: args.title ?? void 0,
13294
13283
  body,
@@ -13367,6 +13356,7 @@ const prUpdateCommand = defineCommand({
13367
13356
  const rewrites = args.title !== void 0 || body !== void 0;
13368
13357
  const result = await runPrUpsert(createRealExecutor$1(), {
13369
13358
  cwd: process.cwd(),
13359
+ connection: resolveConnection(process.cwd()),
13370
13360
  mode: "update",
13371
13361
  title: args.title ?? void 0,
13372
13362
  body,
@@ -14255,12 +14245,13 @@ function requireForgejoTransport(executor, cwd, target, refusal) {
14255
14245
  * uses this to detect a `github.com` target and fail before any request.
14256
14246
  *
14257
14247
  * `injectedToken` overrides the ambient `RELEASE_TOKEN`/`FORGEJO_TOKEN` for the Forgejo
14258
- * transport, mirroring `resolveGitCoordinates`'s `injectedToken ?? resolveForgeToken(...)`
14259
- * precedence so a run's forge writes and its git pushes resolve the same identity. The agent
14260
- * passes its bot token here so a run's comments post as the bot even though the operator's
14261
- * personal token is in the shared shell -- without it, git pushed as the bot while comments
14262
- * posted as the operator (the split seen on PR #368). Forgejo-only: the GitHub branch uses
14263
- * `gh`'s own auth and ignores it, which is fine because the agent is Forgejo-only.
14248
+ * transport. The env fallback exists for the CLI commands alone -- they are entrypoints, where
14249
+ * resolving from the environment is the contract -- and the agent must never reach it: its
14250
+ * container deliberately carries no ambient forge token, and in a dev shell the fallback would
14251
+ * silently post comments as the operator while git pushed as the bot (the split seen on
14252
+ * PR #368). The agent's call sites all pass `AgentRunOptions.token`, which is required, so
14253
+ * that guarantee is compile-checked rather than remembered. Forgejo-only: the GitHub branch
14254
+ * uses `gh`'s own auth and ignores it, which is fine because the agent is Forgejo-only.
14264
14255
  */
14265
14256
  function resolveIssueTransport(executor, cwd, target, injectedToken, signal = null) {
14266
14257
  if (target !== void 0) {
@@ -24907,7 +24898,7 @@ setForgejoLogger(log$1);
24907
24898
  * `local <sha>[-dirty]` otherwise -- so an artifact built from the working tree
24908
24899
  * can't pass itself off as the published release whose version it carries.
24909
24900
  */
24910
- const displayVersion = "0.72.2";
24901
+ const displayVersion = "0.72.3";
24911
24902
  /**
24912
24903
  * Wait until a stream's internally-buffered data has been flushed to the OS.
24913
24904
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bensandee/tooling",
3
- "version": "0.72.2",
3
+ "version": "0.72.3",
4
4
  "description": "CLI tool to bootstrap and maintain standardized TypeScript project tooling",
5
5
  "license": "MIT",
6
6
  "repository": {