forgedock 1.1.8 → 1.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 (84) hide show
  1. package/README.md +10 -33
  2. package/bin/cinema.mjs +23 -5
  3. package/bin/engine-cli.mjs +137 -11
  4. package/bin/env-detect.mjs +249 -0
  5. package/bin/forge-utils.mjs +364 -4
  6. package/bin/forgedock.mjs +1064 -135
  7. package/bin/hooks/session-start.mjs +68 -3
  8. package/bin/init-detect.mjs +101 -12
  9. package/bin/journey.mjs +917 -16
  10. package/bin/recall.mjs +24 -7
  11. package/bin/registry.mjs +91 -3
  12. package/bin/runner.mjs +38 -2
  13. package/bin/tui.mjs +49 -3
  14. package/commands/adopt.md +1 -1
  15. package/commands/analytics.md +8 -8
  16. package/commands/audit.md +1 -1
  17. package/commands/autopilot.md +1 -1
  18. package/commands/ci-audit.md +1 -1
  19. package/commands/cleanup.md +87 -52
  20. package/commands/compat-audit.md +1 -1
  21. package/commands/deploy-info.md +1 -1
  22. package/commands/deploy-pr.md +1 -1
  23. package/commands/diagnose.md +1 -1
  24. package/commands/explain.md +1 -1
  25. package/commands/fix-ci.md +1 -1
  26. package/commands/forgedock-init.md +1 -1
  27. package/commands/incident-response.md +3 -3
  28. package/commands/issue.md +1 -1
  29. package/commands/optimize.md +1 -1
  30. package/commands/orchestrate/config.md +13 -3
  31. package/commands/orchestrate/phase-1-resolve.md +1 -1
  32. package/commands/orchestrate/phase-2-triage.md +1 -1
  33. package/commands/orchestrate/phase-2.5-synthesis.md +1 -1
  34. package/commands/orchestrate/phase-3-dependency.md +128 -20
  35. package/commands/orchestrate/phase-4-execution.md +598 -43
  36. package/commands/orchestrate/phase-5-cleanup.md +1 -1
  37. package/commands/orchestrate/phase-6-report.md +51 -3
  38. package/commands/orchestrate/safety.md +2 -2
  39. package/commands/qa-sweep.md +1 -1
  40. package/commands/quality-gate.md +1 -1
  41. package/commands/recover-orphans.md +5 -5
  42. package/commands/replay.md +1 -1
  43. package/commands/review-pr-agents/api.md +2 -2
  44. package/commands/review-pr-agents/auth.md +2 -2
  45. package/commands/review-pr-agents/billing.md +2 -2
  46. package/commands/review-pr-agents/concurrency.md +2 -2
  47. package/commands/review-pr-agents/database.md +2 -2
  48. package/commands/review-pr-agents/frontend.md +2 -2
  49. package/commands/review-pr-agents/infra.md +2 -2
  50. package/commands/review-pr-agents/protocols.md +1 -1
  51. package/commands/review-pr-agents/scraper.md +2 -2
  52. package/commands/review-pr-agents/security.md +2 -2
  53. package/commands/review-pr-staging.md +41 -3
  54. package/commands/review-pr.md +71 -6
  55. package/commands/rollback.md +1 -1
  56. package/commands/scope.md +1 -1
  57. package/commands/security-audit.md +1 -1
  58. package/commands/test-gate.md +1 -1
  59. package/commands/validate.md +1 -1
  60. package/commands/work-on/build/architect.md +1 -1
  61. package/commands/work-on/build/context.md +9 -6
  62. package/commands/work-on/build/implement.md +1 -1
  63. package/commands/work-on/build/validate.md +1 -1
  64. package/commands/work-on/build.md +31 -6
  65. package/commands/work-on/close.md +3 -2
  66. package/commands/work-on/decompose.md +1 -1
  67. package/commands/work-on/investigate.md +14 -5
  68. package/commands/work-on/remediate.md +331 -0
  69. package/commands/work-on/review.md +1 -1
  70. package/commands/work-on-monolithic.md +1 -1
  71. package/commands/work-on.md +194 -56
  72. package/docs/CI.md +2 -2
  73. package/docs/CODEX.md +1 -1
  74. package/docs/CONFIG.md +186 -0
  75. package/docs/site/command-reference.md +31 -1
  76. package/docs/site/getting-started.md +9 -34
  77. package/docs/site/index.md +1 -1
  78. package/docs/spec/label-state-machine.md +1 -1
  79. package/package.json +2 -1
  80. package/packages/protocol/src/types.js +1 -1
  81. package/scripts/check-command-docs-drift.sh +4 -2
  82. package/scripts/danger-zones.mjs +19 -12
  83. package/scripts/transition-label.sh +101 -13
  84. package/scripts/refresh-bot-token.sh +0 -97
@@ -1,97 +0,0 @@
1
- #!/usr/bin/env bash
2
- # SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios
3
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
- #
5
- # scripts/refresh-bot-token.sh — refresh the rapiercraft-forgedock[bot] installation token.
6
- #
7
- # Generates a JWT from the app's private key, exchanges it for a 1-hour
8
- # installation token, and re-auths the gh CLI. Idempotent — safe to run
9
- # on every session start or from cron.
10
- #
11
- # Supports two installations:
12
- # RapierCraftStudios (org) — installation 144998831 (default)
13
- # RapierCraft (personal) — installation 140233364
14
- #
15
- # Usage: scripts/refresh-bot-token.sh [--pem /path/to/key.pem] [--personal]
16
- #
17
- # Env: FORGEDOCK_APP_PEM — path to private key (default: secrets/rapiercraft-forgedock.pem)
18
-
19
- set -euo pipefail
20
-
21
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
22
- FORGE_HOME="$(cd "$SCRIPT_DIR/.." && pwd)"
23
-
24
- APP_ID="4051319"
25
- ORG_INSTALLATION_ID="144998831"
26
- PERSONAL_INSTALLATION_ID="140233364"
27
- DEFAULT_PEM="$FORGE_HOME/secrets/rapiercraft-forgedock.pem"
28
-
29
- # --- Parse args ---
30
- PEM_PATH="${FORGEDOCK_APP_PEM:-$DEFAULT_PEM}"
31
- INSTALLATION_ID="$ORG_INSTALLATION_ID"
32
- while [[ $# -gt 0 ]]; do
33
- case "$1" in
34
- --pem) PEM_PATH="$2"; shift 2 ;;
35
- --personal) INSTALLATION_ID="$PERSONAL_INSTALLATION_ID"; shift ;;
36
- *) echo "Unknown arg: $1" >&2; exit 1 ;;
37
- esac
38
- done
39
-
40
- if [[ ! -f "$PEM_PATH" ]]; then
41
- echo "ERROR: Private key not found at $PEM_PATH" >&2
42
- echo " Set FORGEDOCK_APP_PEM or pass --pem /path/to/key.pem" >&2
43
- exit 1
44
- fi
45
-
46
- # --- Generate JWT and exchange for installation token ---
47
- INSTALL_TOKEN=$(node -e "
48
- var crypto = require('crypto');
49
- var fs = require('fs');
50
- var https = require('https');
51
- var pem = fs.readFileSync(process.argv[1], 'utf8');
52
- var now = Math.floor(Date.now() / 1000);
53
- var h = Buffer.from(JSON.stringify({alg:'RS256',typ:'JWT'})).toString('base64url');
54
- var p = Buffer.from(JSON.stringify({iat:now-60,exp:now+(9*60),iss:process.argv[2]})).toString('base64url');
55
- var s = crypto.createSign('RSA-SHA256');
56
- s.update(h+'.'+p);
57
- var jwt = h+'.'+p+'.'+s.sign(pem,'base64url');
58
- var opts = {
59
- hostname: 'api.github.com',
60
- path: '/app/installations/'+process.argv[3]+'/access_tokens',
61
- method: 'POST',
62
- headers: {
63
- 'Authorization': 'Bearer '+jwt,
64
- 'Accept': 'application/vnd.github+json',
65
- 'User-Agent': 'forgedock-refresh'
66
- }
67
- };
68
- var req = https.request(opts, function(res) {
69
- var body = '';
70
- res.on('data', function(c) { body += c; });
71
- res.on('end', function() {
72
- var t = JSON.parse(body).token;
73
- if (!t) { process.stderr.write('API error: '+body); process.exit(1); }
74
- process.stdout.write(t);
75
- });
76
- });
77
- req.end();
78
- " "$PEM_PATH" "$APP_ID" "$INSTALLATION_ID")
79
-
80
- if [[ -z "$INSTALL_TOKEN" ]]; then
81
- echo "ERROR: Failed to obtain installation token" >&2
82
- exit 1
83
- fi
84
-
85
- # --- Auth gh CLI ---
86
- echo "$INSTALL_TOKEN" | gh auth login --with-token 2>/dev/null
87
-
88
- # --- Clean up stale old bot if present ---
89
- if gh auth status 2>&1 | grep -q "rapiercraft-forge\[bot\]"; then
90
- gh auth logout -h github.com -u "rapiercraft-forge[bot]" 2>/dev/null || true
91
- fi
92
-
93
- if [[ "$INSTALLATION_ID" == "$ORG_INSTALLATION_ID" ]]; then
94
- echo "rapiercraft-forgedock[bot] token refreshed — org (RapierCraftStudios) ~1h"
95
- else
96
- echo "rapiercraft-forgedock[bot] token refreshed — personal (RapierCraft) ~1h"
97
- fi