@h-rig/cli 0.0.6-alpha.2 → 0.0.6-alpha.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/dist/bin/rig.js CHANGED
@@ -7276,7 +7276,24 @@ import {
7276
7276
  commitRunChanges,
7277
7277
  runPrAutomation
7278
7278
  } from "@rig/runtime/control-plane/native/pr-automation";
7279
+ function looksLikeGitHubToken(value) {
7280
+ const token = value?.trim();
7281
+ if (!token)
7282
+ return false;
7283
+ return /^(gh[opusr]_|github_pat_)/.test(token);
7284
+ }
7285
+ function githubBridgeEnv(token) {
7286
+ const clean = token?.trim();
7287
+ if (!clean)
7288
+ return {};
7289
+ return {
7290
+ RIG_GITHUB_TOKEN: clean,
7291
+ GITHUB_TOKEN: clean,
7292
+ GH_TOKEN: clean
7293
+ };
7294
+ }
7279
7295
  function buildPiRigBridgeEnv(input) {
7296
+ const githubToken = input.githubToken?.trim() || (looksLikeGitHubToken(input.authToken) ? input.authToken.trim() : "");
7280
7297
  return {
7281
7298
  RIG_PROJECT_ROOT: input.projectRoot,
7282
7299
  PROJECT_RIG_ROOT: input.projectRoot,
@@ -7286,7 +7303,7 @@ function buildPiRigBridgeEnv(input) {
7286
7303
  RIG_RUNTIME_ADAPTER: "pi",
7287
7304
  ...input.serverUrl ? { RIG_SERVER_URL: input.serverUrl } : {},
7288
7305
  ...input.authToken ? { RIG_AUTH_TOKEN: input.authToken } : {},
7289
- ...input.githubToken ? { RIG_GITHUB_TOKEN: input.githubToken } : {}
7306
+ ...githubBridgeEnv(githubToken)
7290
7307
  };
7291
7308
  }
7292
7309
  function runGitSync(cwd, args, input) {
@@ -405,7 +405,24 @@ var PI_CANONICAL_RUN_STAGES = [
405
405
  function canonicalPiRunStages() {
406
406
  return [...PI_CANONICAL_RUN_STAGES];
407
407
  }
408
+ function looksLikeGitHubToken(value) {
409
+ const token = value?.trim();
410
+ if (!token)
411
+ return false;
412
+ return /^(gh[opusr]_|github_pat_)/.test(token);
413
+ }
414
+ function githubBridgeEnv(token) {
415
+ const clean = token?.trim();
416
+ if (!clean)
417
+ return {};
418
+ return {
419
+ RIG_GITHUB_TOKEN: clean,
420
+ GITHUB_TOKEN: clean,
421
+ GH_TOKEN: clean
422
+ };
423
+ }
408
424
  function buildPiRigBridgeEnv(input) {
425
+ const githubToken = input.githubToken?.trim() || (looksLikeGitHubToken(input.authToken) ? input.authToken.trim() : "");
409
426
  return {
410
427
  RIG_PROJECT_ROOT: input.projectRoot,
411
428
  PROJECT_RIG_ROOT: input.projectRoot,
@@ -415,7 +432,7 @@ function buildPiRigBridgeEnv(input) {
415
432
  RIG_RUNTIME_ADAPTER: "pi",
416
433
  ...input.serverUrl ? { RIG_SERVER_URL: input.serverUrl } : {},
417
434
  ...input.authToken ? { RIG_AUTH_TOKEN: input.authToken } : {},
418
- ...input.githubToken ? { RIG_GITHUB_TOKEN: input.githubToken } : {}
435
+ ...githubBridgeEnv(githubToken)
419
436
  };
420
437
  }
421
438
  function runGitSync(cwd, args, input) {
@@ -7070,7 +7070,24 @@ import {
7070
7070
  commitRunChanges,
7071
7071
  runPrAutomation
7072
7072
  } from "@rig/runtime/control-plane/native/pr-automation";
7073
+ function looksLikeGitHubToken(value) {
7074
+ const token = value?.trim();
7075
+ if (!token)
7076
+ return false;
7077
+ return /^(gh[opusr]_|github_pat_)/.test(token);
7078
+ }
7079
+ function githubBridgeEnv(token) {
7080
+ const clean = token?.trim();
7081
+ if (!clean)
7082
+ return {};
7083
+ return {
7084
+ RIG_GITHUB_TOKEN: clean,
7085
+ GITHUB_TOKEN: clean,
7086
+ GH_TOKEN: clean
7087
+ };
7088
+ }
7073
7089
  function buildPiRigBridgeEnv(input) {
7090
+ const githubToken = input.githubToken?.trim() || (looksLikeGitHubToken(input.authToken) ? input.authToken.trim() : "");
7074
7091
  return {
7075
7092
  RIG_PROJECT_ROOT: input.projectRoot,
7076
7093
  PROJECT_RIG_ROOT: input.projectRoot,
@@ -7080,7 +7097,7 @@ function buildPiRigBridgeEnv(input) {
7080
7097
  RIG_RUNTIME_ADAPTER: "pi",
7081
7098
  ...input.serverUrl ? { RIG_SERVER_URL: input.serverUrl } : {},
7082
7099
  ...input.authToken ? { RIG_AUTH_TOKEN: input.authToken } : {},
7083
- ...input.githubToken ? { RIG_GITHUB_TOKEN: input.githubToken } : {}
7100
+ ...githubBridgeEnv(githubToken)
7084
7101
  };
7085
7102
  }
7086
7103
  function runGitSync(cwd, args, input) {
package/dist/src/index.js CHANGED
@@ -7272,7 +7272,24 @@ import {
7272
7272
  commitRunChanges,
7273
7273
  runPrAutomation
7274
7274
  } from "@rig/runtime/control-plane/native/pr-automation";
7275
+ function looksLikeGitHubToken(value) {
7276
+ const token = value?.trim();
7277
+ if (!token)
7278
+ return false;
7279
+ return /^(gh[opusr]_|github_pat_)/.test(token);
7280
+ }
7281
+ function githubBridgeEnv(token) {
7282
+ const clean = token?.trim();
7283
+ if (!clean)
7284
+ return {};
7285
+ return {
7286
+ RIG_GITHUB_TOKEN: clean,
7287
+ GITHUB_TOKEN: clean,
7288
+ GH_TOKEN: clean
7289
+ };
7290
+ }
7275
7291
  function buildPiRigBridgeEnv(input) {
7292
+ const githubToken = input.githubToken?.trim() || (looksLikeGitHubToken(input.authToken) ? input.authToken.trim() : "");
7276
7293
  return {
7277
7294
  RIG_PROJECT_ROOT: input.projectRoot,
7278
7295
  PROJECT_RIG_ROOT: input.projectRoot,
@@ -7282,7 +7299,7 @@ function buildPiRigBridgeEnv(input) {
7282
7299
  RIG_RUNTIME_ADAPTER: "pi",
7283
7300
  ...input.serverUrl ? { RIG_SERVER_URL: input.serverUrl } : {},
7284
7301
  ...input.authToken ? { RIG_AUTH_TOKEN: input.authToken } : {},
7285
- ...input.githubToken ? { RIG_GITHUB_TOKEN: input.githubToken } : {}
7302
+ ...githubBridgeEnv(githubToken)
7286
7303
  };
7287
7304
  }
7288
7305
  function runGitSync(cwd, args, input) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/cli",
3
- "version": "0.0.6-alpha.2",
3
+ "version": "0.0.6-alpha.3",
4
4
  "type": "module",
5
5
  "description": "Rig package",
6
6
  "license": "UNLICENSED",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@clack/prompts": "^1.2.0",
26
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.2",
27
- "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.2",
28
- "@rig/client": "npm:@h-rig/client@0.0.6-alpha.2",
26
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.3",
27
+ "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.3",
28
+ "@rig/client": "npm:@h-rig/client@0.0.6-alpha.3",
29
29
  "picocolors": "^1.1.1"
30
30
  }
31
31
  }