@ashulab/agent-forge 0.5.0 → 0.6.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.
Files changed (2) hide show
  1. package/dist/launcher.cjs +11 -5
  2. package/package.json +1 -1
package/dist/launcher.cjs CHANGED
@@ -5348,10 +5348,17 @@ async function githubApi(path, { jwtToken, body } = {}) {
5348
5348
  });
5349
5349
  const data = await response.json();
5350
5350
  if (!response.ok) {
5351
- throw new Error(`GitHub API ${path}: ${response.status} ${data?.message || "Unknown error"}`);
5351
+ throw new Error(githubApiError(path, response.status, data?.message, Boolean(jwtToken)));
5352
5352
  }
5353
5353
  return data;
5354
5354
  }
5355
+ function githubApiError(path, status, message, signedWithJwt) {
5356
+ let text2 = `GitHub API ${path}: ${status} ${message || "Unknown error"}`;
5357
+ if (status === 401 && signedWithJwt) {
5358
+ text2 += " \u2014 the App JWT was rejected. Check that appId matches privateKeyPath (this key must belong to that App), and that the system clock is accurate.";
5359
+ }
5360
+ return text2;
5361
+ }
5355
5362
  async function resolveBotId(agent) {
5356
5363
  if (agent.botId) return String(agent.botId);
5357
5364
  const handle = `${agent.botName || agent.name}[bot]`;
@@ -5498,11 +5505,10 @@ function isManagedByAgentForge(text2) {
5498
5505
  }
5499
5506
  var AGENTS_HOME = (0, import_node_path3.join)((0, import_node_os3.homedir)(), ".gemini", "config", "agents");
5500
5507
  var VALID_NAME2 = /^[a-z0-9][a-z0-9-]*$/;
5501
- function renderAgentFile(name, description, prompt) {
5508
+ function renderAgentFile(name, prompt) {
5502
5509
  return [
5503
5510
  "---",
5504
5511
  `name: ${name}`,
5505
- `description: ${JSON.stringify(description)}`,
5506
5512
  "mainAgent: true",
5507
5513
  MARKER,
5508
5514
  "---",
@@ -5522,7 +5528,7 @@ function syncAntigravityAgent(agent, prompt, agentsHome = AGENTS_HOME) {
5522
5528
  }
5523
5529
  const dir = (0, import_node_path3.join)(agentsHome, name);
5524
5530
  const file = (0, import_node_path3.join)(dir, "agent.md");
5525
- const next = renderAgentFile(name, agent.label || "GitHub App identity managed by agent-forge", prompt);
5531
+ const next = renderAgentFile(name, prompt);
5526
5532
  if ((0, import_node_fs3.existsSync)(file)) {
5527
5533
  const current = (0, import_node_fs3.readFileSync)(file, "utf8");
5528
5534
  if (!isManagedByAgentForge(current)) {
@@ -5576,7 +5582,7 @@ var import_node_util3 = require("node:util");
5576
5582
  // package.json
5577
5583
  var package_default = {
5578
5584
  name: "@ashulab/agent-forge",
5579
- version: "0.5.0",
5585
+ version: "0.6.0",
5580
5586
  description: "Give claude/codex/antigravity their own GitHub identity: a bot account, a scoped token minted per run, git attribution to match",
5581
5587
  license: "MIT",
5582
5588
  author: "Diego Ghersi <ghersidl@gmail.com>",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ashulab/agent-forge",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Give claude/codex/antigravity their own GitHub identity: a bot account, a scoped token minted per run, git attribution to match",
5
5
  "license": "MIT",
6
6
  "author": "Diego Ghersi <ghersidl@gmail.com>",