@inkeep/agents-work-apps 0.0.0-dev-20260224165929 → 0.0.0-dev-20260224174959

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/env.d.ts CHANGED
@@ -14,11 +14,11 @@ declare const envSchema: z.ZodObject<{
14
14
  pentest: "pentest";
15
15
  }>>;
16
16
  LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
17
- error: "error";
18
17
  trace: "trace";
19
18
  debug: "debug";
20
19
  info: "info";
21
20
  warn: "warn";
21
+ error: "error";
22
22
  }>>;
23
23
  INKEEP_AGENTS_RUN_DATABASE_URL: z.ZodOptional<z.ZodString>;
24
24
  INKEEP_AGENTS_MANAGE_UI_URL: z.ZodOptional<z.ZodString>;
@@ -44,7 +44,7 @@ declare const envSchema: z.ZodObject<{
44
44
  declare const env: {
45
45
  NODE_ENV: "development" | "production" | "test";
46
46
  ENVIRONMENT: "development" | "production" | "test" | "pentest";
47
- LOG_LEVEL: "error" | "trace" | "debug" | "info" | "warn";
47
+ LOG_LEVEL: "trace" | "debug" | "info" | "warn" | "error";
48
48
  INKEEP_AGENTS_RUN_DATABASE_URL?: string | undefined;
49
49
  INKEEP_AGENTS_MANAGE_UI_URL?: string | undefined;
50
50
  GITHUB_APP_ID?: string | undefined;
@@ -1,11 +1,11 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types5 from "hono/types";
2
+ import * as hono_types1 from "hono/types";
3
3
 
4
4
  //#region src/github/mcp/index.d.ts
5
5
  declare const app: Hono<{
6
6
  Variables: {
7
7
  toolId: string;
8
8
  };
9
- }, hono_types5.BlankSchema, "/">;
9
+ }, hono_types1.BlankSchema, "/">;
10
10
  //#endregion
11
11
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import runDbClient_default from "../../db/runDbClient.js";
2
2
  import { githubMcpAuth } from "./auth.js";
3
3
  import { ReactionContentSchema } from "./schemas.js";
4
- import { commitFileChanges, commitNewFile, createIssueCommentReaction, createPullRequestReviewCommentReaction, deleteIssueCommentReaction, deletePullRequestReviewCommentReaction, fetchBranchChangedFiles, fetchComments, fetchPrFileDiffs, fetchPrFiles, fetchPrInfo, formatFileDiff, generatePrMarkdown, getGitHubClientFromRepo, listIssueCommentReactions, listPullRequestReviewCommentReactions, visualizeUpdateOperations } from "./utils.js";
4
+ import { commitFileChanges, commitNewFile, createIssueCommentReaction, createPullRequestReviewCommentReaction, deleteIssueCommentReaction, deletePullRequestReviewCommentReaction, fetchBranchChangedFiles, fetchComments, fetchPrFileDiffs, fetchPrFiles, fetchPrInfo, formatFileDiff, generatePrMarkdown, getGitHubClientFromRepo, listIssueCommentReactions, listIssueReactions, listPullRequestReviewCommentReactions, visualizeUpdateOperations } from "./utils.js";
5
5
  import { z } from "@hono/zod-openapi";
6
6
  import { getMcpToolRepositoryAccessWithDetails } from "@inkeep/agents-core";
7
7
  import { Hono } from "hono";
@@ -331,7 +331,8 @@ const getServer = async (toolId) => {
331
331
  repo: z.string().describe("Repository name"),
332
332
  from_branch: z.string().optional().describe("Branch to create from (defaults to default branch)")
333
333
  }, async ({ owner, repo, from_branch }) => {
334
- const branch_name = `docs-writer-ai-update-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`;
334
+ const suffix = Math.random().toString(36).slice(2, 8);
335
+ const branch_name = `docs-writer-ai-update-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}-${suffix}`;
335
336
  try {
336
337
  const githubClient = getGitHubClientFromRepo(owner, repo, installationIdMap);
337
338
  const repoInfo = await githubClient.rest.repos.get({
@@ -666,13 +667,17 @@ const getServer = async (toolId) => {
666
667
  };
667
668
  }
668
669
  });
669
- server.tool("add-comment-reaction", `Add a reaction to a comment on a pull request. Supports general pull request comments and inline PR review comments. ${getAvailableRepositoryString(repositoryAccess)}`, {
670
+ server.tool("add-reaction", `Add a reaction to a pull request body, a general PR comment, or an inline PR review comment. ${getAvailableRepositoryString(repositoryAccess)}`, {
670
671
  owner: z.string().describe("Repository owner name"),
671
672
  repo: z.string().describe("Repository name"),
672
- comment_id: z.number().describe("The ID of the comment to react to"),
673
- comment_type: z.enum(["issue_comment", "review_comment"]).describe("The type of comment: \"issue_comment\" for general pull request comments, \"review_comment\" for inline PR review comments"),
673
+ target_id: z.number().describe("The target to react to: a comment ID for issue_comment/review_comment, or the pull request number for pull_request"),
674
+ target_type: z.enum([
675
+ "pull_request",
676
+ "issue_comment",
677
+ "review_comment"
678
+ ]).describe("The type of target: \"pull_request\" for the PR body itself, \"issue_comment\" for general pull request comments, \"review_comment\" for inline PR review comments"),
674
679
  reaction: ReactionContentSchema.describe("The reaction emoji to add: +1, -1, laugh, hooray, confused, heart, rocket, or eyes")
675
- }, async ({ owner, repo, comment_id, comment_type, reaction }) => {
680
+ }, async ({ owner, repo, target_id, target_type, reaction }) => {
676
681
  try {
677
682
  let githubClient;
678
683
  try {
@@ -686,9 +691,23 @@ const getServer = async (toolId) => {
686
691
  isError: true
687
692
  };
688
693
  }
694
+ let result;
695
+ if (target_type === "pull_request") {
696
+ const { data } = await githubClient.rest.reactions.createForIssue({
697
+ owner,
698
+ repo,
699
+ issue_number: target_id,
700
+ content: reaction
701
+ });
702
+ result = {
703
+ id: data.id,
704
+ content: data.content
705
+ };
706
+ } else if (target_type === "issue_comment") result = await createIssueCommentReaction(githubClient, owner, repo, target_id, reaction);
707
+ else result = await createPullRequestReviewCommentReaction(githubClient, owner, repo, target_id, reaction);
689
708
  return { content: [{
690
709
  type: "text",
691
- text: `Successfully added ${reaction} reaction to ${comment_type} comment ${comment_id} in ${owner}/${repo}\n\nReaction ID: ${(comment_type === "issue_comment" ? await createIssueCommentReaction(githubClient, owner, repo, comment_id, reaction) : await createPullRequestReviewCommentReaction(githubClient, owner, repo, comment_id, reaction)).id}`
710
+ text: `Successfully added ${reaction} reaction to ${target_type === "pull_request" ? `PR #${target_id}` : `${target_type} ${target_id}`} in ${owner}/${repo}\n\nReaction ID: ${result.id}`
692
711
  }] };
693
712
  } catch (error) {
694
713
  if (error instanceof Error && "status" in error) {
@@ -696,21 +715,21 @@ const getServer = async (toolId) => {
696
715
  if (apiError.status === 404) return {
697
716
  content: [{
698
717
  type: "text",
699
- text: `Comment ${comment_id} not found in ${owner}/${repo}.`
718
+ text: `Target ${target_id} (${target_type}) not found in ${owner}/${repo}.`
700
719
  }],
701
720
  isError: true
702
721
  };
703
722
  if (apiError.status === 422) return {
704
723
  content: [{
705
724
  type: "text",
706
- text: `Invalid reaction. Ensure the reaction type is valid and the comment exists.`
725
+ text: `Invalid reaction. Ensure the reaction type is valid and the target exists.`
707
726
  }],
708
727
  isError: true
709
728
  };
710
729
  if (apiError.status === 403) return {
711
730
  content: [{
712
731
  type: "text",
713
- text: `Access denied when adding reaction to comment ${comment_id} in ${owner}/${repo}. Your GitHub App may not have sufficient permissions to create reactions.`
732
+ text: `Access denied when adding reaction to ${target_type} ${target_id} in ${owner}/${repo}. Your GitHub App may not have sufficient permissions to create reactions.`
714
733
  }],
715
734
  isError: true
716
735
  };
@@ -724,13 +743,17 @@ const getServer = async (toolId) => {
724
743
  };
725
744
  }
726
745
  });
727
- server.tool("remove-comment-reaction", `Remove a reaction from a comment on a pull request. Requires the reaction ID (returned when adding a reaction or available from comment data). ${getAvailableRepositoryString(repositoryAccess)}`, {
746
+ server.tool("remove-reaction", `Remove a reaction from a pull request body, a general PR comment, or an inline PR review comment. Requires the reaction ID (returned when adding a reaction or from list-reactions). ${getAvailableRepositoryString(repositoryAccess)}`, {
728
747
  owner: z.string().describe("Repository owner name"),
729
748
  repo: z.string().describe("Repository name"),
730
- comment_id: z.number().describe("The ID of the comment the reaction belongs to"),
731
- comment_type: z.enum(["issue_comment", "review_comment"]).describe("The type of comment: \"issue_comment\" for general pull request comments, \"review_comment\" for inline PR review comments"),
749
+ target_id: z.number().describe("The target the reaction belongs to: a comment ID for issue_comment/review_comment, or the pull request number for pull_request"),
750
+ target_type: z.enum([
751
+ "pull_request",
752
+ "issue_comment",
753
+ "review_comment"
754
+ ]).describe("The type of target: \"pull_request\" for the PR body itself, \"issue_comment\" for general pull request comments, \"review_comment\" for inline PR review comments"),
732
755
  reaction_id: z.number().describe("The ID of the reaction to remove")
733
- }, async ({ owner, repo, comment_id, comment_type, reaction_id }) => {
756
+ }, async ({ owner, repo, target_id, target_type, reaction_id }) => {
734
757
  try {
735
758
  let githubClient;
736
759
  try {
@@ -744,18 +767,24 @@ const getServer = async (toolId) => {
744
767
  isError: true
745
768
  };
746
769
  }
747
- if (comment_type === "issue_comment") await deleteIssueCommentReaction(githubClient, owner, repo, comment_id, reaction_id);
748
- else await deletePullRequestReviewCommentReaction(githubClient, owner, repo, comment_id, reaction_id);
770
+ if (target_type === "pull_request") await githubClient.rest.reactions.deleteForIssue({
771
+ owner,
772
+ repo,
773
+ issue_number: target_id,
774
+ reaction_id
775
+ });
776
+ else if (target_type === "issue_comment") await deleteIssueCommentReaction(githubClient, owner, repo, target_id, reaction_id);
777
+ else await deletePullRequestReviewCommentReaction(githubClient, owner, repo, target_id, reaction_id);
749
778
  return { content: [{
750
779
  type: "text",
751
- text: `Successfully removed reaction ${reaction_id} from ${comment_type} comment ${comment_id} in ${owner}/${repo}`
780
+ text: `Successfully removed reaction ${reaction_id} from ${target_type === "pull_request" ? `PR #${target_id}` : `${target_type} ${target_id}`} in ${owner}/${repo}`
752
781
  }] };
753
782
  } catch (error) {
754
783
  if (error instanceof Error && "status" in error) {
755
784
  if (error.status === 404) return {
756
785
  content: [{
757
786
  type: "text",
758
- text: `Comment ${comment_id} or reaction ${reaction_id} not found in ${owner}/${repo}.`
787
+ text: `Target ${target_id} (${target_type}) or reaction ${reaction_id} not found in ${owner}/${repo}.`
759
788
  }],
760
789
  isError: true
761
790
  };
@@ -769,12 +798,16 @@ const getServer = async (toolId) => {
769
798
  };
770
799
  }
771
800
  });
772
- server.tool("list-comment-reactions", `List all reactions on a comment, including each reaction's ID (needed for removal). Supports both general issue/PR comments and inline PR review comments. ${getAvailableRepositoryString(repositoryAccess)}`, {
801
+ server.tool("list-reactions", `List all reactions on a pull request body, a general PR comment, or an inline PR review comment. Returns each reaction's ID (needed for removal). ${getAvailableRepositoryString(repositoryAccess)}`, {
773
802
  owner: z.string().describe("Repository owner name"),
774
803
  repo: z.string().describe("Repository name"),
775
- comment_id: z.number().describe("The ID of the comment to list reactions for"),
776
- comment_type: z.enum(["issue_comment", "review_comment"]).describe("The type of comment: \"issue_comment\" for general pull request comments, \"review_comment\" for inline PR review comments")
777
- }, async ({ owner, repo, comment_id, comment_type }) => {
804
+ target_id: z.number().describe("The target to list reactions for: a comment ID for issue_comment/review_comment, or the pull request number for pull_request"),
805
+ target_type: z.enum([
806
+ "pull_request",
807
+ "issue_comment",
808
+ "review_comment"
809
+ ]).describe("The type of target: \"pull_request\" for the PR body itself, \"issue_comment\" for general pull request comments, \"review_comment\" for inline PR review comments")
810
+ }, async ({ owner, repo, target_id, target_type }) => {
778
811
  try {
779
812
  let githubClient;
780
813
  try {
@@ -788,22 +821,26 @@ const getServer = async (toolId) => {
788
821
  isError: true
789
822
  };
790
823
  }
791
- const reactions = comment_type === "issue_comment" ? await listIssueCommentReactions(githubClient, owner, repo, comment_id) : await listPullRequestReviewCommentReactions(githubClient, owner, repo, comment_id);
824
+ let reactions = [];
825
+ if (target_type === "pull_request") reactions = await listIssueReactions(githubClient, owner, repo, target_id);
826
+ else if (target_type === "issue_comment") reactions = await listIssueCommentReactions(githubClient, owner, repo, target_id);
827
+ else reactions = await listPullRequestReviewCommentReactions(githubClient, owner, repo, target_id);
828
+ const label = target_type === "pull_request" ? `PR #${target_id}` : `${target_type} ${target_id}`;
792
829
  if (reactions.length === 0) return { content: [{
793
830
  type: "text",
794
- text: `No reactions found on ${comment_type} comment ${comment_id} in ${owner}/${repo}.`
831
+ text: `No reactions found on ${label} in ${owner}/${repo}.`
795
832
  }] };
796
833
  const formatted = reactions.map((r) => `• ${r.content} by @${r.user} (reaction_id: ${r.id})`).join("\n");
797
834
  return { content: [{
798
835
  type: "text",
799
- text: `Found ${reactions.length} reaction(s) on ${comment_type} comment ${comment_id} in ${owner}/${repo}:\n\n${formatted}`
836
+ text: `Found ${reactions.length} reaction(s) on ${label} in ${owner}/${repo}:\n\n${formatted}`
800
837
  }] };
801
838
  } catch (error) {
802
839
  if (error instanceof Error && "status" in error) {
803
840
  if (error.status === 404) return {
804
841
  content: [{
805
842
  type: "text",
806
- text: `Comment ${comment_id} not found in ${owner}/${repo}.`
843
+ text: `Target ${target_id} (${target_type}) not found in ${owner}/${repo}.`
807
844
  }],
808
845
  isError: true
809
846
  };
@@ -254,6 +254,7 @@ interface ReactionDetail {
254
254
  }
255
255
  declare function listIssueCommentReactions(octokit: Octokit, owner: string, repo: string, commentId: number): Promise<ReactionDetail[]>;
256
256
  declare function listPullRequestReviewCommentReactions(octokit: Octokit, owner: string, repo: string, commentId: number): Promise<ReactionDetail[]>;
257
+ declare function listIssueReactions(octokit: Octokit, owner: string, repo: string, issueNumber: number): Promise<ReactionDetail[]>;
257
258
  declare function formatFileDiff(pullRequestNumber: number, files: ChangedFile[], includeContents?: boolean): Promise<string>;
258
259
  //#endregion
259
- export { CommitData, LLMUpdateOperation, PullCommit, ReactionDetail, applyOperation, applyOperations, commitFileChanges, commitNewFile, createIssueCommentReaction, createPullRequestReviewCommentReaction, deleteIssueCommentReaction, deletePullRequestReviewCommentReaction, fetchBranchChangedFiles, fetchComments, fetchCommitDetails, fetchPrCommits, fetchPrFileDiffs, fetchPrFiles, fetchPrInfo, formatFileDiff, generatePrMarkdown, getFilePathsInRepo, getGitHubClientFromInstallationId, getGitHubClientFromRepo, listIssueCommentReactions, listPullRequestReviewCommentReactions, validateLineNumbers, visualizeUpdateOperations };
260
+ export { CommitData, LLMUpdateOperation, PullCommit, ReactionDetail, applyOperation, applyOperations, commitFileChanges, commitNewFile, createIssueCommentReaction, createPullRequestReviewCommentReaction, deleteIssueCommentReaction, deletePullRequestReviewCommentReaction, fetchBranchChangedFiles, fetchComments, fetchCommitDetails, fetchPrCommits, fetchPrFileDiffs, fetchPrFiles, fetchPrInfo, formatFileDiff, generatePrMarkdown, getFilePathsInRepo, getGitHubClientFromInstallationId, getGitHubClientFromRepo, listIssueCommentReactions, listIssueReactions, listPullRequestReviewCommentReactions, validateLineNumbers, visualizeUpdateOperations };
@@ -758,6 +758,21 @@ async function listPullRequestReviewCommentReactions(octokit, owner, repo, comme
758
758
  });
759
759
  return reactions;
760
760
  }
761
+ async function listIssueReactions(octokit, owner, repo, issueNumber) {
762
+ const reactions = [];
763
+ for await (const response of octokit.paginate.iterator(octokit.rest.reactions.listForIssue, {
764
+ owner,
765
+ repo,
766
+ issue_number: issueNumber,
767
+ per_page: 100
768
+ })) for (const r of response.data) reactions.push({
769
+ id: r.id,
770
+ content: r.content,
771
+ user: r.user?.login ?? "unknown",
772
+ createdAt: r.created_at
773
+ });
774
+ return reactions;
775
+ }
761
776
  async function formatFileDiff(pullRequestNumber, files, includeContents = false) {
762
777
  let output = `## File Patches for PR #${pullRequestNumber}\n\n`;
763
778
  output += `Found ${files.length} file(s) matching the requested paths.\n\n`;
@@ -780,4 +795,4 @@ async function formatFileDiff(pullRequestNumber, files, includeContents = false)
780
795
  }
781
796
 
782
797
  //#endregion
783
- export { applyOperation, applyOperations, commitFileChanges, commitNewFile, createIssueCommentReaction, createPullRequestReviewCommentReaction, deleteIssueCommentReaction, deletePullRequestReviewCommentReaction, fetchBranchChangedFiles, fetchComments, fetchCommitDetails, fetchPrCommits, fetchPrFileDiffs, fetchPrFiles, fetchPrInfo, formatFileDiff, generatePrMarkdown, getFilePathsInRepo, getGitHubClientFromInstallationId, getGitHubClientFromRepo, listIssueCommentReactions, listPullRequestReviewCommentReactions, validateLineNumbers, visualizeUpdateOperations };
798
+ export { applyOperation, applyOperations, commitFileChanges, commitNewFile, createIssueCommentReaction, createPullRequestReviewCommentReaction, deleteIssueCommentReaction, deletePullRequestReviewCommentReaction, fetchBranchChangedFiles, fetchComments, fetchCommitDetails, fetchPrCommits, fetchPrFileDiffs, fetchPrFiles, fetchPrInfo, formatFileDiff, generatePrMarkdown, getFilePathsInRepo, getGitHubClientFromInstallationId, getGitHubClientFromRepo, listIssueCommentReactions, listIssueReactions, listPullRequestReviewCommentReactions, validateLineNumbers, visualizeUpdateOperations };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types3 from "hono/types";
2
+ import * as hono_types0 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/setup.d.ts
5
- declare const app: Hono<hono_types3.BlankEnv, hono_types3.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types1 from "hono/types";
2
+ import * as hono_types2 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/tokenExchange.d.ts
5
- declare const app: Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types2.BlankEnv, hono_types2.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types0 from "hono/types";
2
+ import * as hono_types4 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/webhooks.d.ts
5
5
  interface WebhookVerificationResult {
@@ -7,6 +7,6 @@ interface WebhookVerificationResult {
7
7
  error?: string;
8
8
  }
9
9
  declare function verifyWebhookSignature(payload: string, signature: string | undefined, secret: string): WebhookVerificationResult;
10
- declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
10
+ declare const app: Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
11
11
  //#endregion
12
12
  export { WebhookVerificationResult, app as default, verifyWebhookSignature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-work-apps",
3
- "version": "0.0.0-dev-20260224165929",
3
+ "version": "0.0.0-dev-20260224174959",
4
4
  "description": "First party integrations for Inkeep Agents",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -33,7 +33,7 @@
33
33
  "jose": "^6.1.0",
34
34
  "minimatch": "^10.1.1",
35
35
  "slack-block-builder": "^2.8.0",
36
- "@inkeep/agents-core": "0.0.0-dev-20260224165929"
36
+ "@inkeep/agents-core": "0.0.0-dev-20260224174959"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@hono/zod-openapi": "^1.1.5",