@inkeep/agents-work-apps 0.59.2 → 0.59.4

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>;
@@ -45,7 +45,7 @@ declare const envSchema: z.ZodObject<{
45
45
  declare const env: {
46
46
  NODE_ENV: "development" | "production" | "test";
47
47
  ENVIRONMENT: "development" | "production" | "test" | "pentest";
48
- LOG_LEVEL: "error" | "trace" | "debug" | "info" | "warn";
48
+ LOG_LEVEL: "trace" | "debug" | "info" | "warn" | "error";
49
49
  INKEEP_AGENTS_RUN_DATABASE_URL?: string | undefined;
50
50
  INKEEP_AGENTS_MANAGE_UI_URL?: string | undefined;
51
51
  GITHUB_APP_ID?: string | undefined;
@@ -4,10 +4,10 @@ import "./routes/setup.js";
4
4
  import "./routes/tokenExchange.js";
5
5
  import { WebhookVerificationResult, verifyWebhookSignature } from "./routes/webhooks.js";
6
6
  import { Hono } from "hono";
7
- import * as hono_types7 from "hono/types";
7
+ import * as hono_types2 from "hono/types";
8
8
 
9
9
  //#region src/github/index.d.ts
10
- declare function createGithubRoutes(): Hono<hono_types7.BlankEnv, hono_types7.BlankSchema, "/">;
11
- declare const githubRoutes: Hono<hono_types7.BlankEnv, hono_types7.BlankSchema, "/">;
10
+ declare function createGithubRoutes(): Hono<hono_types2.BlankEnv, hono_types2.BlankSchema, "/">;
11
+ declare const githubRoutes: Hono<hono_types2.BlankEnv, hono_types2.BlankSchema, "/">;
12
12
  //#endregion
13
13
  export { GenerateInstallationAccessTokenResult, GenerateTokenError, GenerateTokenResult, GitHubAppConfig, InstallationAccessToken, InstallationInfo, LookupInstallationError, LookupInstallationForRepoResult, LookupInstallationResult, WebhookVerificationResult, clearConfigCache, createAppJwt, createGithubRoutes, determineStatus, fetchInstallationDetails, fetchInstallationRepositories, generateInstallationAccessToken, getGitHubAppConfig, getGitHubAppName, getStateSigningSecret, getWebhookSecret, githubRoutes, isGitHubAppConfigured, isGitHubAppNameConfigured, isStateSigningConfigured, isWebhookConfigured, lookupInstallationForRepo, validateGitHubAppConfigOnStartup, validateGitHubInstallFlowConfigOnStartup, validateGitHubWebhookConfigOnStartup, verifyWebhookSignature };
@@ -1,7 +1,7 @@
1
- import * as hono2 from "hono";
1
+ import * as hono1 from "hono";
2
2
 
3
3
  //#region src/github/mcp/auth.d.ts
4
- declare const githubMcpAuth: () => hono2.MiddlewareHandler<{
4
+ declare const githubMcpAuth: () => hono1.MiddlewareHandler<{
5
5
  Variables: {
6
6
  toolId: string;
7
7
  tenantId: string;
@@ -379,14 +379,15 @@ const getServer = async (scope) => {
379
379
  };
380
380
  }
381
381
  });
382
- server.tool("commit-file-changes", `Commit changes to a files in a repository. ${getAvailableRepositoryString(repositoryAccess)}`, {
382
+ server.tool("commit-file-changes", `Commit changes to a file in a repository. ${getAvailableRepositoryString(repositoryAccess)}`, {
383
383
  owner: z.string().describe("Repository owner name"),
384
384
  repo: z.string().describe("Repository name"),
385
385
  branch_name: z.string().describe("Branch to commit to"),
386
386
  file_path: z.string().describe("Path to the file to commit"),
387
387
  update_operations: updateOperationsSchema,
388
- commit_message: z.string().describe("Commit message")
389
- }, async ({ owner, repo, branch_name, file_path, update_operations, commit_message }) => {
388
+ commit_message: z.string().describe("Commit message"),
389
+ format: z.boolean().optional().default(false).describe("When true, format the file content with oxfmt before committing. Falls back to unformatted content if formatting fails. Leave as false unless prompted otherwise.")
390
+ }, async ({ owner, repo, branch_name, file_path, update_operations, commit_message, format }) => {
390
391
  try {
391
392
  let githubClient;
392
393
  try {
@@ -423,7 +424,8 @@ const getServer = async (scope) => {
423
424
  filePath: file_path,
424
425
  branchName: branch_name,
425
426
  operations: updateOperations,
426
- commitMessage: commit_message
427
+ commitMessage: commit_message,
428
+ format
427
429
  });
428
430
  return { content: [{
429
431
  type: "text",
@@ -462,8 +464,9 @@ const getServer = async (scope) => {
462
464
  branch_name: z.string().describe("Branch to commit to"),
463
465
  file_path: z.string().describe("Path for the new file (relative to repository root)"),
464
466
  content: z.string().describe("Content for the new file"),
465
- commit_message: z.string().describe("Commit message")
466
- }, async ({ owner, repo, branch_name, file_path, content, commit_message }) => {
467
+ commit_message: z.string().describe("Commit message"),
468
+ format: z.boolean().optional().default(false).describe("When true, format the file content with oxfmt before committing. Falls back to unformatted content if formatting fails. Leave as false unless prompted otherwise.")
469
+ }, async ({ owner, repo, branch_name, file_path, content, commit_message, format }) => {
467
470
  try {
468
471
  let githubClient;
469
472
  try {
@@ -486,7 +489,8 @@ const getServer = async (scope) => {
486
489
  filePath: file_path,
487
490
  branchName: branch_name,
488
491
  content,
489
- commitMessage: commit_message
492
+ commitMessage: commit_message,
493
+ format
490
494
  })}`
491
495
  }] };
492
496
  } catch (error) {
@@ -208,7 +208,8 @@ declare function commitFileChanges({
208
208
  filePath,
209
209
  branchName,
210
210
  operations,
211
- commitMessage
211
+ commitMessage,
212
+ format
212
213
  }: {
213
214
  githubClient: Octokit;
214
215
  owner: string;
@@ -218,6 +219,7 @@ declare function commitFileChanges({
218
219
  branchName: string;
219
220
  operations: LLMUpdateOperation[];
220
221
  commitMessage: string;
222
+ format?: boolean;
221
223
  }): Promise<string>;
222
224
  declare function commitNewFile({
223
225
  githubClient,
@@ -226,7 +228,8 @@ declare function commitNewFile({
226
228
  filePath,
227
229
  branchName,
228
230
  content,
229
- commitMessage
231
+ commitMessage,
232
+ format
230
233
  }: {
231
234
  githubClient: Octokit;
232
235
  owner: string;
@@ -235,6 +238,7 @@ declare function commitNewFile({
235
238
  branchName: string;
236
239
  content: string;
237
240
  commitMessage: string;
241
+ format?: boolean;
238
242
  }): Promise<string>;
239
243
  declare function moveFile({
240
244
  githubClient,
@@ -3,6 +3,7 @@ import { getLogger } from "../../logger.js";
3
3
  import { createAppAuth } from "@octokit/auth-app";
4
4
  import { Octokit } from "@octokit/rest";
5
5
  import { minimatch } from "minimatch";
6
+ import { format } from "oxfmt";
6
7
 
7
8
  //#region src/github/mcp/utils.ts
8
9
  const logger = getLogger("github-mcp-utils");
@@ -647,6 +648,18 @@ async function commitTreeEntries({ githubClient, owner, repo, branchName, treeEn
647
648
  });
648
649
  return newCommit.data.sha;
649
650
  }
651
+ async function formatContent(filePath, content) {
652
+ try {
653
+ const { code } = await format(filePath, content);
654
+ return code;
655
+ } catch (error) {
656
+ logger.warn({
657
+ filePath,
658
+ error
659
+ }, "oxfmt formatting failed, using unformatted content");
660
+ return content;
661
+ }
662
+ }
650
663
  async function commitContent({ githubClient, owner, repo, filePath, branchName, content, commitMessage }) {
651
664
  return commitTreeEntries({
652
665
  githubClient,
@@ -667,22 +680,24 @@ async function commitContent({ githubClient, owner, repo, filePath, branchName,
667
680
  commitMessage
668
681
  });
669
682
  }
670
- async function commitFileChanges({ githubClient, owner, repo, fileContent, filePath, branchName, operations, commitMessage }) {
683
+ async function commitFileChanges({ githubClient, owner, repo, fileContent, filePath, branchName, operations, commitMessage, format: format$1 = false }) {
671
684
  try {
685
+ let updatedContent = applyOperations(fileContent, operations);
686
+ if (format$1) updatedContent = await formatContent(filePath, updatedContent);
672
687
  return await commitContent({
673
688
  githubClient,
674
689
  owner,
675
690
  repo,
676
691
  filePath,
677
692
  branchName,
678
- content: applyOperations(fileContent, operations),
693
+ content: updatedContent,
679
694
  commitMessage
680
695
  });
681
696
  } catch (error) {
682
697
  throw new Error(`Error committing file changes: ${error instanceof Error ? error.message : "Unknown error"}`);
683
698
  }
684
699
  }
685
- async function commitNewFile({ githubClient, owner, repo, filePath, branchName, content, commitMessage }) {
700
+ async function commitNewFile({ githubClient, owner, repo, filePath, branchName, content, commitMessage, format: format$1 = false }) {
686
701
  try {
687
702
  return await commitContent({
688
703
  githubClient,
@@ -690,7 +705,7 @@ async function commitNewFile({ githubClient, owner, repo, filePath, branchName,
690
705
  repo,
691
706
  filePath,
692
707
  branchName,
693
- content,
708
+ content: format$1 ? await formatContent(filePath, content) : content,
694
709
  commitMessage
695
710
  });
696
711
  } catch (error) {
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types0 from "hono/types";
2
+ import * as hono_types9 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/setup.d.ts
5
- declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types9.BlankEnv, hono_types9.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_types7 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_types7.BlankEnv, hono_types7.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,5 +1,5 @@
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/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_types3.BlankEnv, hono_types3.BlankSchema, "/">;
10
+ declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
11
11
  //#endregion
12
12
  export { WebhookVerificationResult, app as default, verifyWebhookSignature };
@@ -1,7 +1,7 @@
1
- import * as hono0 from "hono";
1
+ import * as hono2 from "hono";
2
2
 
3
3
  //#region src/slack/mcp/auth.d.ts
4
- declare const slackMcpAuth: () => hono0.MiddlewareHandler<{
4
+ declare const slackMcpAuth: () => hono2.MiddlewareHandler<{
5
5
  Variables: {
6
6
  toolId: string;
7
7
  tenantId: string;
@@ -1,5 +1,5 @@
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/slack/mcp/index.d.ts
5
5
  interface ChannelInfo {
@@ -18,6 +18,6 @@ declare const app: Hono<{
18
18
  tenantId: string;
19
19
  projectId: string;
20
20
  };
21
- }, hono_types5.BlankSchema, "/">;
21
+ }, hono_types1.BlankSchema, "/">;
22
22
  //#endregion
23
23
  export { ChannelInfo, app as default, pruneStaleChannelIds };
@@ -1,5 +1,5 @@
1
1
  import { SlackLinkIntent } from "@inkeep/agents-core";
2
- import * as slack_block_builder0 from "slack-block-builder";
2
+ import * as slack_block_builder7 from "slack-block-builder";
3
3
 
4
4
  //#region src/slack/services/link-prompt.d.ts
5
5
  type LinkPromptResult = {
@@ -22,6 +22,6 @@ interface ResolveLinkActionParams {
22
22
  intent?: SlackLinkIntent;
23
23
  }
24
24
  declare function resolveUnlinkedUserAction(params: ResolveLinkActionParams): Promise<LinkPromptResult>;
25
- declare function buildLinkPromptMessage(result: LinkPromptResult): Readonly<slack_block_builder0.SlackMessageDto>;
25
+ declare function buildLinkPromptMessage(result: LinkPromptResult): Readonly<slack_block_builder7.SlackMessageDto>;
26
26
  //#endregion
27
27
  export { LinkPromptResult, ResolveLinkActionParams, buildLinkPromptMessage, resolveUnlinkedUserAction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-work-apps",
3
- "version": "0.59.2",
3
+ "version": "0.59.4",
4
4
  "description": "First party integrations for Inkeep Agents",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -32,8 +32,9 @@
32
32
  "hono": "^4.12.7",
33
33
  "jose": "^6.1.0",
34
34
  "minimatch": "^10.2.1",
35
+ "oxfmt": "^0.42.0",
35
36
  "slack-block-builder": "^2.8.0",
36
- "@inkeep/agents-core": "0.59.2"
37
+ "@inkeep/agents-core": "0.59.4"
37
38
  },
38
39
  "peerDependencies": {
39
40
  "@hono/zod-openapi": "^1.1.5",
@@ -42,7 +43,7 @@
42
43
  "devDependencies": {
43
44
  "@slack/socket-mode": "^2.0.5",
44
45
  "@types/node": "^20.11.24",
45
- "typescript": "^5.9.2",
46
+ "typescript": "^6.0.2",
46
47
  "vitest": "^3.2.4"
47
48
  },
48
49
  "engines": {