@assemblyline-agents/github 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OpenEve contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @assemblyline-agents/github
2
+
3
+ Official Assembly Line GitHub connection plugin.
4
+
5
+ `defineGitHubConnection` and `defineGitHubMcpConnection` give agents authenticated GitHub access, and the bundled skill under `skills/` covers repository, issue, pull-request, and workflow tasks. GitHub is intentionally a tool connection rather than an inbound Assembly Line communication channel.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install @assemblyline-agents/github
11
+ ```
12
+
13
+ ## Part of Assembly Line
14
+
15
+ This package is part of [Assembly Line](https://github.com/jasonbadeaux/openeve), a vendor-neutral, filesystem-first framework for durable AI agents. See the developer documentation in [docs/developers/](https://github.com/jasonbadeaux/openeve/tree/main/docs/developers) for setup, agent authoring, and deployment guides.
16
+
17
+ ## License
18
+
19
+ MIT
@@ -0,0 +1,30 @@
1
+ import { type ConnectionDefinition, type McpPluginConnectionOptions } from "@assemblyline-agents/core";
2
+ export declare const GITHUB_APP_REQUIRED_ENV: readonly ["GITHUB_APP_ID", "GITHUB_PRIVATE_KEY"];
3
+ export interface GitHubConnectionOptions {
4
+ name?: string;
5
+ description?: string;
6
+ scopes?: string[];
7
+ capabilities?: string[];
8
+ required?: boolean;
9
+ }
10
+ export interface GitHubAppEnvironment {
11
+ GITHUB_APP_ID?: string;
12
+ GITHUB_PRIVATE_KEY?: string;
13
+ GITHUB_API_URL?: string;
14
+ GITHUB_TOKEN?: string;
15
+ }
16
+ /** GitHub App installation connection for authenticated repository tooling. */
17
+ export declare function defineGitHubConnection(options?: GitHubConnectionOptions): ConnectionDefinition;
18
+ export type GitHubMcpConnectionOptions = McpPluginConnectionOptions;
19
+ export declare function defineGitHubMcpConnection(options: GitHubMcpConnectionOptions): import("@assemblyline-agents/core").McpHttpClientConnectionDefinition;
20
+ export declare const openevePlugin: import("@assemblyline-agents/core").PluginModule;
21
+ export declare function createGitHubInstallationToken(options: {
22
+ env: GitHubAppEnvironment;
23
+ installationId: number;
24
+ fetch?: typeof fetch;
25
+ }): Promise<{
26
+ token: string;
27
+ expiresAt?: string;
28
+ }>;
29
+ export declare function createGitHubAppJwt(env: GitHubAppEnvironment, nowSeconds?: number): string;
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,oBAAoB,EAEzB,KAAK,0BAA0B,EAChC,MAAM,2BAA2B,CAAC;AAGnC,eAAO,MAAM,uBAAuB,kDAAmD,CAAC;AAExF,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,+EAA+E;AAC/E,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,oBAAoB,CAclG;AAID,MAAM,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;AAEpE,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,yEAE5E;AAED,eAAO,MAAM,aAAa,kDAAqD,CAAC;AAEhF,wBAAsB,6BAA6B,CAAC,OAAO,EAAE;IAC3D,GAAG,EAAE,oBAAoB,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgBjD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,oBAAoB,EAAE,UAAU,SAAgC,GAAG,MAAM,CAahH"}
package/dist/index.js ADDED
@@ -0,0 +1,92 @@
1
+ import { createSign } from "node:crypto";
2
+ import { adapter, connectionPluginMetadata, defineConnection, defineMcpPluginConnection, definePlugin } from "@assemblyline-agents/core";
3
+ import { fetchWithPolicy } from "@assemblyline-agents/runtime";
4
+ export const GITHUB_APP_REQUIRED_ENV = ["GITHUB_APP_ID", "GITHUB_PRIVATE_KEY"];
5
+ /** GitHub App installation connection for authenticated repository tooling. */
6
+ export function defineGitHubConnection(options = {}) {
7
+ return defineConnection({
8
+ description: options.description ?? "GitHub App installation connection for repository, issue, pull request, and workflow capabilities.",
9
+ provider: "github",
10
+ binding: adapter("github-app"),
11
+ scopes: options.scopes ?? ["issues:write", "pull_requests:write", "contents:read"],
12
+ capabilities: options.capabilities ?? ["issues", "pull_requests", "repository"],
13
+ subject: "installation",
14
+ required: options.required ?? false,
15
+ metadata: {
16
+ appAuth: "installation-token",
17
+ ...(options.name ? { name: options.name } : {})
18
+ }
19
+ });
20
+ }
21
+ const GITHUB_MCP_PLUGIN = connectionPluginMetadata("github");
22
+ export function defineGitHubMcpConnection(options) {
23
+ return defineMcpPluginConnection(GITHUB_MCP_PLUGIN, options);
24
+ }
25
+ export const openevePlugin = definePlugin({ connections: [GITHUB_MCP_PLUGIN] });
26
+ export async function createGitHubInstallationToken(options) {
27
+ const apiUrl = options.env.GITHUB_API_URL ?? "https://api.github.com";
28
+ const jwt = createGitHubAppJwt(options.env);
29
+ const response = await fetchWithPolicy(options.fetch ?? fetch, `${apiUrl}/app/installations/${options.installationId}/access_tokens`, {
30
+ method: "POST",
31
+ headers: githubHeaders(jwt)
32
+ });
33
+ const parsed = await parseJson(response);
34
+ if (!response.ok)
35
+ throw new Error(`GitHub installation token request failed: ${response.status} ${JSON.stringify(parsed)}`);
36
+ const record = recordValue(parsed);
37
+ const token = stringValue(record?.token);
38
+ if (!token)
39
+ throw new Error("GitHub installation token response did not include a token.");
40
+ const out = { token };
41
+ const expiresAt = stringValue(record?.expires_at);
42
+ if (expiresAt)
43
+ out.expiresAt = expiresAt;
44
+ return out;
45
+ }
46
+ export function createGitHubAppJwt(env, nowSeconds = Math.floor(Date.now() / 1000)) {
47
+ const appId = env.GITHUB_APP_ID;
48
+ const privateKey = env.GITHUB_PRIVATE_KEY?.replace(/\\n/g, "\n");
49
+ if (!appId || !privateKey)
50
+ throw new Error("GitHub App auth requires GITHUB_APP_ID and GITHUB_PRIVATE_KEY.");
51
+ const header = base64Url(JSON.stringify({ alg: "RS256", typ: "JWT" }));
52
+ const payload = base64Url(JSON.stringify({
53
+ iat: nowSeconds - 60,
54
+ exp: nowSeconds + 9 * 60,
55
+ iss: appId
56
+ }));
57
+ const signingInput = `${header}.${payload}`;
58
+ const signature = createSign("RSA-SHA256").update(signingInput).sign(privateKey);
59
+ return `${signingInput}.${base64Url(signature)}`;
60
+ }
61
+ function githubHeaders(token) {
62
+ return {
63
+ accept: "application/vnd.github+json",
64
+ authorization: `Bearer ${token}`,
65
+ "content-type": "application/json",
66
+ "user-agent": "openeve-github-adapter",
67
+ "x-github-api-version": "2022-11-28"
68
+ };
69
+ }
70
+ function base64Url(value) {
71
+ return Buffer.from(value).toString("base64url");
72
+ }
73
+ function stringValue(value) {
74
+ return typeof value === "string" && value.length > 0 ? value : undefined;
75
+ }
76
+ function recordValue(value) {
77
+ return Boolean(value && typeof value === "object" && !Array.isArray(value))
78
+ ? value
79
+ : undefined;
80
+ }
81
+ async function parseJson(response) {
82
+ const text = await response.text();
83
+ if (!text)
84
+ return {};
85
+ try {
86
+ return JSON.parse(text);
87
+ }
88
+ catch {
89
+ return { text };
90
+ }
91
+ }
92
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,OAAO,EACP,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,EAIb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,eAAe,EAAE,oBAAoB,CAAU,CAAC;AAiBxF,+EAA+E;AAC/E,MAAM,UAAU,sBAAsB,CAAC,UAAmC,EAAE;IAC1E,OAAO,gBAAgB,CAAC;QACtB,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,oGAAoG;QACxI,QAAQ,EAAE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IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@assemblyline-agents/github",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "default": "./dist/index.js"
9
+ }
10
+ },
11
+ "dependencies": {
12
+ "@assemblyline-agents/runtime": "0.1.0",
13
+ "@assemblyline-agents/core": "0.1.0"
14
+ },
15
+ "description": "Official OpenEve GitHub connection plugin.",
16
+ "files": [
17
+ "dist",
18
+ "skills"
19
+ ],
20
+ "engines": {
21
+ "node": ">=22.19.0"
22
+ },
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/jasonbadeaux/openeve.git",
27
+ "directory": "packages/github"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/jasonbadeaux/openeve/issues"
31
+ },
32
+ "homepage": "https://github.com/jasonbadeaux/openeve#readme",
33
+ "author": "OpenEve contributors",
34
+ "keywords": [
35
+ "openeve",
36
+ "ai",
37
+ "agents",
38
+ "github",
39
+ "connection",
40
+ "plugin"
41
+ ],
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "scripts": {
46
+ "build": "tsc -p tsconfig.json",
47
+ "check": "tsc -p tsconfig.json --noEmit"
48
+ }
49
+ }
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: github
3
+ description: Use configured GitHub MCP tools for repositories, issues, pull requests, and Actions.
4
+ ---
5
+ # GitHub
6
+ Resolve the owner and repository before searching. Read the current issue, pull request, review, or workflow state before proposing a change.
7
+
8
+ The deployment owner configures the GitHub OAuth application or token. The scaffold is read-only; issue, pull request, repository, and workflow mutations require writes to be enabled with the configured approval gate.