@app-vitals/agent-runtime 1.69.0 → 1.69.1

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/boot.ts CHANGED
@@ -97,6 +97,7 @@ import {
97
97
  threadKey,
98
98
  } from "./sessions.ts";
99
99
  import { ensureAgentHome, installPlugins, runMiseStartup } from "./setup.ts";
100
+ import { SCRIPTS_BIN } from "./scripts-bin.ts";
100
101
  import { setupGitHubAuth } from "./setup-github-auth.ts";
101
102
  import { HttpShipwrightRuntimeClient } from "./shipwright-runtime-client.ts";
102
103
  import { createSlackApp, hasSlackCredentials } from "./slack.ts";
@@ -445,20 +446,13 @@ export async function startAgent(
445
446
  // already runs setupGitHubAuth() once at boot in its own (separate)
446
447
  // process, and this process's first syncConfig() tick (awaited below,
447
448
  // before Step 5) is this process's own "boot" for GitHub App auth.
448
- const GITHUB_AUTH_SCRIPTS_BIN = join(
449
- import.meta.dir,
450
- "..",
451
- "..",
452
- "scripts",
453
- "bin",
454
- );
455
449
  const githubAuthStartDeps = {
456
450
  env: process.env as Record<string, string | undefined>,
457
451
  isActive: githubAuthActiveRef.isActive,
458
452
  markActive: () => githubAuthActiveRef.setActive(true),
459
453
  setupGitHubAuth: () =>
460
454
  setupGitHubAuth(
461
- buildGitHubAuthDeps(agentHome, GITHUB_AUTH_SCRIPTS_BIN, {
455
+ buildGitHubAuthDeps(agentHome, SCRIPTS_BIN, {
462
456
  withInstallations: true,
463
457
  installationsReporter: githubInstallationsReporter,
464
458
  }),
@@ -22,6 +22,7 @@ import {
22
22
  installPlugins,
23
23
  runMiseStartup,
24
24
  } from "@app-vitals/agent-runtime/setup";
25
+ import { SCRIPTS_BIN } from "@app-vitals/agent-runtime/scripts-bin";
25
26
  import { setupGitHubAuth } from "@app-vitals/agent-runtime/setup-github-auth";
26
27
  import { HttpShipwrightRuntimeClient } from "@app-vitals/agent-runtime/shipwright-runtime-client";
27
28
 
@@ -42,8 +43,6 @@ const configClient = {
42
43
  getConfig: (id: string) => runtimeClient.getAgentConfigBundle(id),
43
44
  };
44
45
 
45
- const SCRIPTS_BIN = join(import.meta.dir, "..", "scripts", "bin");
46
-
47
46
  await runEntrypoint({
48
47
  agentId,
49
48
  apiUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-runtime",
3
- "version": "1.69.0",
3
+ "version": "1.69.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",
@@ -33,6 +33,7 @@
33
33
  "./markers": "./markers.ts",
34
34
  "./process-tree-kill": "./process-tree-kill.ts",
35
35
  "./run-telemetry": "./run-telemetry.ts",
36
+ "./scripts-bin": "./scripts-bin.ts",
36
37
  "./setup": "./setup.ts",
37
38
  "./setup-github-auth": "./setup-github-auth.ts",
38
39
  "./shipwright-runtime-client": "./shipwright-runtime-client.ts",
@@ -40,8 +41,8 @@
40
41
  "./workspace-paths": "./workspace-paths.ts"
41
42
  },
42
43
  "dependencies": {
43
- "@app-vitals/agent-admin": "1.69.0",
44
- "@app-vitals/agent-lib": "1.69.0",
44
+ "@app-vitals/agent-admin": "1.69.1",
45
+ "@app-vitals/agent-lib": "1.69.1",
45
46
  "@octokit/auth-app": "^8.2.0",
46
47
  "@sentry/bun": "^10.63.0",
47
48
  "@slack/bolt": "^5.0.0",
package/scripts-bin.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { join } from "node:path";
2
+
3
+ /**
4
+ * Absolute path to the repo's `scripts/bin` directory (holds the git
5
+ * credential helper). Lives in runtime/, so the root is one level up.
6
+ * Shared by boot.ts and entrypoint-main.ts so the two can't drift.
7
+ */
8
+ export const SCRIPTS_BIN = join(import.meta.dir, "..", "scripts", "bin");
@@ -0,0 +1,22 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { existsSync } from "node:fs";
3
+ import { join, resolve } from "node:path";
4
+ import { buildGitHubAuthDeps } from "./github-auth-deps.ts";
5
+ import { SCRIPTS_BIN } from "./scripts-bin.ts";
6
+
7
+ describe("SCRIPTS_BIN", () => {
8
+ test("resolves to <repoRoot>/scripts/bin", () => {
9
+ expect(SCRIPTS_BIN).toBe(resolve(import.meta.dir, "..", "scripts", "bin"));
10
+ });
11
+
12
+ test("contains the git credential helper", () => {
13
+ expect(existsSync(join(SCRIPTS_BIN, "git-credential-shipwright.sh"))).toBe(
14
+ true,
15
+ );
16
+ });
17
+
18
+ test("buildGitHubAuthDeps credentialHelperPath exists on disk", () => {
19
+ const deps = buildGitHubAuthDeps("/tmp/agent-home", SCRIPTS_BIN);
20
+ expect(existsSync(deps.credentialHelperPath)).toBe(true);
21
+ });
22
+ });