@inkeep/agents-work-apps 0.0.0-dev-20260204182014 → 0.0.0-dev-20260204185956
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/db/index.d.ts +1 -2
- package/dist/db/index.js +1 -2
- package/dist/db/runDbClient.d.ts +2 -2
- package/dist/env.d.ts +0 -22
- package/dist/env.js +1 -12
- package/dist/github/index.d.ts +3 -3
- package/dist/github/mcp/index.d.ts +2 -2
- package/dist/github/mcp/schemas.d.ts +1 -1
- package/dist/github/routes/setup.d.ts +2 -2
- package/dist/github/routes/tokenExchange.d.ts +2 -2
- package/dist/github/routes/webhooks.d.ts +2 -2
- package/package.json +2 -10
- package/dist/db/manageDbClient.d.ts +0 -7
- package/dist/db/manageDbClient.js +0 -16
- package/dist/slack/index.d.ts +0 -19
- package/dist/slack/index.js +0 -29
- package/dist/slack/middleware/permissions.d.ts +0 -16
- package/dist/slack/middleware/permissions.js +0 -49
- package/dist/slack/routes/events.d.ts +0 -10
- package/dist/slack/routes/events.js +0 -319
- package/dist/slack/routes/index.d.ts +0 -11
- package/dist/slack/routes/index.js +0 -64
- package/dist/slack/routes/internal.d.ts +0 -10
- package/dist/slack/routes/internal.js +0 -107
- package/dist/slack/routes/oauth.d.ts +0 -12
- package/dist/slack/routes/oauth.js +0 -218
- package/dist/slack/routes/resources.d.ts +0 -10
- package/dist/slack/routes/resources.js +0 -163
- package/dist/slack/routes/users.d.ts +0 -15
- package/dist/slack/routes/users.js +0 -430
- package/dist/slack/routes/workspaces.d.ts +0 -10
- package/dist/slack/routes/workspaces.js +0 -828
- package/dist/slack/routes.d.ts +0 -7
- package/dist/slack/routes.js +0 -12
- package/dist/slack/services/agent-resolution.d.ts +0 -49
- package/dist/slack/services/agent-resolution.js +0 -135
- package/dist/slack/services/api-client.d.ts +0 -161
- package/dist/slack/services/api-client.js +0 -248
- package/dist/slack/services/auth/index.d.ts +0 -61
- package/dist/slack/services/auth/index.js +0 -164
- package/dist/slack/services/blocks/index.d.ts +0 -60
- package/dist/slack/services/blocks/index.js +0 -143
- package/dist/slack/services/client.d.ts +0 -78
- package/dist/slack/services/client.js +0 -152
- package/dist/slack/services/commands/index.d.ts +0 -15
- package/dist/slack/services/commands/index.js +0 -556
- package/dist/slack/services/events/app-mention.d.ts +0 -41
- package/dist/slack/services/events/app-mention.js +0 -212
- package/dist/slack/services/events/block-actions.d.ts +0 -47
- package/dist/slack/services/events/block-actions.js +0 -287
- package/dist/slack/services/events/index.d.ts +0 -6
- package/dist/slack/services/events/index.js +0 -7
- package/dist/slack/services/events/modal-submission.d.ts +0 -12
- package/dist/slack/services/events/modal-submission.js +0 -279
- package/dist/slack/services/events/streaming.d.ts +0 -27
- package/dist/slack/services/events/streaming.js +0 -285
- package/dist/slack/services/events/utils.d.ts +0 -129
- package/dist/slack/services/events/utils.js +0 -315
- package/dist/slack/services/index.d.ts +0 -18
- package/dist/slack/services/index.js +0 -18
- package/dist/slack/services/modals.d.ts +0 -67
- package/dist/slack/services/modals.js +0 -203
- package/dist/slack/services/nango.d.ts +0 -82
- package/dist/slack/services/nango.js +0 -326
- package/dist/slack/services/security.d.ts +0 -35
- package/dist/slack/services/security.js +0 -65
- package/dist/slack/services/types.d.ts +0 -26
- package/dist/slack/services/types.js +0 -1
- package/dist/slack/services/workspace-tokens.d.ts +0 -37
- package/dist/slack/services/workspace-tokens.js +0 -39
- package/dist/slack/types.d.ts +0 -10
- package/dist/slack/types.js +0 -1
package/dist/db/index.d.ts
CHANGED
package/dist/db/index.js
CHANGED
package/dist/db/runDbClient.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _inkeep_agents_core0 from "@inkeep/agents-core";
|
|
2
2
|
|
|
3
3
|
//#region src/db/runDbClient.d.ts
|
|
4
|
-
declare const runDbClient:
|
|
4
|
+
declare const runDbClient: _inkeep_agents_core0.AgentsRunDatabaseClient;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { runDbClient as default };
|
package/dist/env.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ declare const envSchema: z.ZodObject<{
|
|
|
21
21
|
warn: "warn";
|
|
22
22
|
}>>;
|
|
23
23
|
INKEEP_AGENTS_RUN_DATABASE_URL: z.ZodString;
|
|
24
|
-
INKEEP_AGENTS_MANAGE_DATABASE_URL: z.ZodOptional<z.ZodString>;
|
|
25
24
|
INKEEP_AGENTS_MANAGE_UI_URL: z.ZodOptional<z.ZodString>;
|
|
26
25
|
GITHUB_APP_ID: z.ZodOptional<z.ZodString>;
|
|
27
26
|
GITHUB_APP_PRIVATE_KEY: z.ZodOptional<z.ZodString>;
|
|
@@ -29,23 +28,12 @@ declare const envSchema: z.ZodObject<{
|
|
|
29
28
|
GITHUB_STATE_SIGNING_SECRET: z.ZodOptional<z.ZodString>;
|
|
30
29
|
GITHUB_APP_NAME: z.ZodOptional<z.ZodString>;
|
|
31
30
|
GITHUB_MCP_API_KEY: z.ZodOptional<z.ZodString>;
|
|
32
|
-
SLACK_CLIENT_ID: z.ZodOptional<z.ZodString>;
|
|
33
|
-
SLACK_CLIENT_SECRET: z.ZodOptional<z.ZodString>;
|
|
34
|
-
SLACK_SIGNING_SECRET: z.ZodOptional<z.ZodString>;
|
|
35
|
-
SLACK_BOT_TOKEN: z.ZodOptional<z.ZodString>;
|
|
36
|
-
SLACK_APP_URL: z.ZodOptional<z.ZodString>;
|
|
37
|
-
NANGO_SECRET_KEY: z.ZodOptional<z.ZodString>;
|
|
38
|
-
NANGO_SLACK_SECRET_KEY: z.ZodOptional<z.ZodString>;
|
|
39
|
-
NANGO_SLACK_INTEGRATION_ID: z.ZodOptional<z.ZodString>;
|
|
40
|
-
NANGO_SERVER_URL: z.ZodOptional<z.ZodString>;
|
|
41
|
-
INKEEP_AGENTS_API_URL: z.ZodOptional<z.ZodString>;
|
|
42
31
|
}, z.core.$strip>;
|
|
43
32
|
declare const env: {
|
|
44
33
|
NODE_ENV: "development" | "production" | "test";
|
|
45
34
|
ENVIRONMENT: "development" | "production" | "test" | "pentest";
|
|
46
35
|
LOG_LEVEL: "error" | "trace" | "debug" | "info" | "warn";
|
|
47
36
|
INKEEP_AGENTS_RUN_DATABASE_URL: string;
|
|
48
|
-
INKEEP_AGENTS_MANAGE_DATABASE_URL?: string | undefined;
|
|
49
37
|
INKEEP_AGENTS_MANAGE_UI_URL?: string | undefined;
|
|
50
38
|
GITHUB_APP_ID?: string | undefined;
|
|
51
39
|
GITHUB_APP_PRIVATE_KEY?: string | undefined;
|
|
@@ -53,16 +41,6 @@ declare const env: {
|
|
|
53
41
|
GITHUB_STATE_SIGNING_SECRET?: string | undefined;
|
|
54
42
|
GITHUB_APP_NAME?: string | undefined;
|
|
55
43
|
GITHUB_MCP_API_KEY?: string | undefined;
|
|
56
|
-
SLACK_CLIENT_ID?: string | undefined;
|
|
57
|
-
SLACK_CLIENT_SECRET?: string | undefined;
|
|
58
|
-
SLACK_SIGNING_SECRET?: string | undefined;
|
|
59
|
-
SLACK_BOT_TOKEN?: string | undefined;
|
|
60
|
-
SLACK_APP_URL?: string | undefined;
|
|
61
|
-
NANGO_SECRET_KEY?: string | undefined;
|
|
62
|
-
NANGO_SLACK_SECRET_KEY?: string | undefined;
|
|
63
|
-
NANGO_SLACK_INTEGRATION_ID?: string | undefined;
|
|
64
|
-
NANGO_SERVER_URL?: string | undefined;
|
|
65
|
-
INKEEP_AGENTS_API_URL?: string | undefined;
|
|
66
44
|
};
|
|
67
45
|
type Env = z.infer<typeof envSchema>;
|
|
68
46
|
//#endregion
|
package/dist/env.js
CHANGED
|
@@ -23,24 +23,13 @@ const envSchema = z.object({
|
|
|
23
23
|
"error"
|
|
24
24
|
]).default("info").describe("Logging verbosity level"),
|
|
25
25
|
INKEEP_AGENTS_RUN_DATABASE_URL: z.string().describe("PostgreSQL connection URL for the runtime database (Doltgres with Git version control)"),
|
|
26
|
-
INKEEP_AGENTS_MANAGE_DATABASE_URL: z.string().optional().describe("PostgreSQL connection URL for the management database"),
|
|
27
26
|
INKEEP_AGENTS_MANAGE_UI_URL: z.string().optional().describe("URL where the management UI is hosted"),
|
|
28
27
|
GITHUB_APP_ID: z.string().optional().describe("GitHub App ID for GitHub integration"),
|
|
29
28
|
GITHUB_APP_PRIVATE_KEY: z.string().optional().describe("GitHub App private key for authentication"),
|
|
30
29
|
GITHUB_WEBHOOK_SECRET: z.string().optional().describe("Secret for validating GitHub webhook payloads"),
|
|
31
30
|
GITHUB_STATE_SIGNING_SECRET: z.string().min(32, "GITHUB_STATE_SIGNING_SECRET must be at least 32 characters").optional().describe("Secret for signing GitHub OAuth state (minimum 32 characters)"),
|
|
32
31
|
GITHUB_APP_NAME: z.string().optional().describe("Name of the GitHub App"),
|
|
33
|
-
GITHUB_MCP_API_KEY: z.string().optional().describe("API key for the GitHub MCP")
|
|
34
|
-
SLACK_CLIENT_ID: z.string().optional().describe("Slack App Client ID"),
|
|
35
|
-
SLACK_CLIENT_SECRET: z.string().optional().describe("Slack App Client Secret"),
|
|
36
|
-
SLACK_SIGNING_SECRET: z.string().optional().describe("Slack App Signing Secret"),
|
|
37
|
-
SLACK_BOT_TOKEN: z.string().optional().describe("Slack Bot Token (for testing)"),
|
|
38
|
-
SLACK_APP_URL: z.string().optional().describe("Slack App Install URL"),
|
|
39
|
-
NANGO_SECRET_KEY: z.string().optional().describe("Nango Secret Key"),
|
|
40
|
-
NANGO_SLACK_SECRET_KEY: z.string().optional().describe("Nango Slack-specific Secret Key"),
|
|
41
|
-
NANGO_SLACK_INTEGRATION_ID: z.string().optional().describe("Nango Slack Integration ID"),
|
|
42
|
-
NANGO_SERVER_URL: z.string().optional().describe("Nango Server URL"),
|
|
43
|
-
INKEEP_AGENTS_API_URL: z.string().optional().describe("Inkeep Agents API URL")
|
|
32
|
+
GITHUB_MCP_API_KEY: z.string().optional().describe("API key for the GitHub MCP")
|
|
44
33
|
});
|
|
45
34
|
const parseEnv = () => {
|
|
46
35
|
try {
|
package/dist/github/index.d.ts
CHANGED
|
@@ -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
|
|
7
|
+
import * as hono_types1 from "hono/types";
|
|
8
8
|
|
|
9
9
|
//#region src/github/index.d.ts
|
|
10
|
-
declare function createGithubRoutes(): Hono<
|
|
11
|
-
declare const githubRoutes: Hono<
|
|
10
|
+
declare function createGithubRoutes(): Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
|
|
11
|
+
declare const githubRoutes: Hono<hono_types1.BlankEnv, hono_types1.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,11 +1,11 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types5 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
|
-
},
|
|
9
|
+
}, hono_types5.BlankSchema, "/">;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types8 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/github/routes/setup.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types8.BlankEnv, hono_types8.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types0 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/github/routes/tokenExchange.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types6 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<
|
|
10
|
+
declare const app: Hono<hono_types6.BlankEnv, hono_types6.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-
|
|
3
|
+
"version": "0.0.0-dev-20260204185956",
|
|
4
4
|
"description": "First party integrations for Inkeep Agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -13,26 +13,18 @@
|
|
|
13
13
|
"./github": {
|
|
14
14
|
"types": "./dist/github/index.d.ts",
|
|
15
15
|
"import": "./dist/github/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./slack": {
|
|
18
|
-
"types": "./dist/slack/index.d.ts",
|
|
19
|
-
"import": "./dist/slack/index.js"
|
|
20
16
|
}
|
|
21
17
|
},
|
|
22
18
|
"dependencies": {
|
|
23
19
|
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
24
|
-
"@nangohq/node": "^0.48.1",
|
|
25
20
|
"@octokit/auth-app": "^8.1.2",
|
|
26
21
|
"@octokit/rest": "^22.0.1",
|
|
27
|
-
"@slack/types": "^2.18.0",
|
|
28
|
-
"@slack/web-api": "^7.9.1",
|
|
29
|
-
"slack-block-builder": "^2.8.0",
|
|
30
22
|
"drizzle-orm": "^0.44.7",
|
|
31
23
|
"fetch-to-node": "^2.1.0",
|
|
32
24
|
"hono": "^4.10.4",
|
|
33
25
|
"jose": "^6.1.0",
|
|
34
26
|
"minimatch": "^10.1.1",
|
|
35
|
-
"@inkeep/agents-core": "0.0.0-dev-
|
|
27
|
+
"@inkeep/agents-core": "0.0.0-dev-20260204185956"
|
|
36
28
|
},
|
|
37
29
|
"peerDependencies": {
|
|
38
30
|
"@hono/zod-openapi": "^1.1.5",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as _inkeep_agents_core0 from "@inkeep/agents-core";
|
|
2
|
-
|
|
3
|
-
//#region src/db/manageDbClient.d.ts
|
|
4
|
-
declare function getManageDbClient(): _inkeep_agents_core0.AgentsManageDatabaseClient;
|
|
5
|
-
declare const _default: _inkeep_agents_core0.AgentsManageDatabaseClient;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { _default as default, getManageDbClient };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createAgentsManageDatabaseClient } from "@inkeep/agents-core";
|
|
2
|
-
|
|
3
|
-
//#region src/db/manageDbClient.ts
|
|
4
|
-
let manageDbClient = null;
|
|
5
|
-
function getManageDbClient() {
|
|
6
|
-
if (!manageDbClient) {
|
|
7
|
-
const connectionString = process.env.INKEEP_AGENTS_MANAGE_DATABASE_URL;
|
|
8
|
-
if (!connectionString) throw new Error("INKEEP_AGENTS_MANAGE_DATABASE_URL environment variable is required");
|
|
9
|
-
manageDbClient = createAgentsManageDatabaseClient({ connectionString });
|
|
10
|
-
}
|
|
11
|
-
return manageDbClient;
|
|
12
|
-
}
|
|
13
|
-
var manageDbClient_default = getManageDbClient();
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { manageDbClient_default as default, getManageDbClient };
|
package/dist/slack/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ManageAppVariables, WorkAppsVariables } from "./types.js";
|
|
2
|
-
import { DefaultAgentConfig, SlackWorkspaceConnection, WorkspaceInstallData, computeWorkspaceConnectionId, createConnectSession, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, setWorkspaceDefaultAgent, storeWorkspaceInstallation, updateConnectionMetadata } from "./services/nango.js";
|
|
3
|
-
import { getChannelAgentConfig, getWorkspaceDefaultAgent } from "./services/events/utils.js";
|
|
4
|
-
import "./services/events/index.js";
|
|
5
|
-
import { getBotTokenForTeam, setBotTokenForTeam } from "./services/workspace-tokens.js";
|
|
6
|
-
import "./routes/oauth.js";
|
|
7
|
-
import { pendingSessionTokens } from "./routes/users.js";
|
|
8
|
-
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
9
|
-
|
|
10
|
-
//#region src/slack/index.d.ts
|
|
11
|
-
|
|
12
|
-
declare function createSlackRoutes(): OpenAPIHono<{
|
|
13
|
-
Variables: WorkAppsVariables;
|
|
14
|
-
}, {}, "/">;
|
|
15
|
-
declare const slackRoutes: OpenAPIHono<{
|
|
16
|
-
Variables: WorkAppsVariables;
|
|
17
|
-
}, {}, "/">;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { DefaultAgentConfig, ManageAppVariables, SlackWorkspaceConnection, WorkAppsVariables, WorkspaceInstallData, computeWorkspaceConnectionId, createConnectSession, createSlackRoutes, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, pendingSessionTokens, setBotTokenForTeam, setWorkspaceDefaultAgent, slackRoutes, storeWorkspaceInstallation, updateConnectionMetadata };
|
package/dist/slack/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { computeWorkspaceConnectionId, createConnectSession, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, setWorkspaceDefaultAgent, storeWorkspaceInstallation, updateConnectionMetadata } from "./services/nango.js";
|
|
2
|
-
import { getBotTokenForTeam, setBotTokenForTeam } from "./services/workspace-tokens.js";
|
|
3
|
-
import { getChannelAgentConfig, getWorkspaceDefaultAgent } from "./services/events/utils.js";
|
|
4
|
-
import "./services/events/index.js";
|
|
5
|
-
import "./routes/oauth.js";
|
|
6
|
-
import { pendingSessionTokens } from "./routes/users.js";
|
|
7
|
-
import routes_default from "./routes.js";
|
|
8
|
-
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
9
|
-
|
|
10
|
-
//#region src/slack/index.ts
|
|
11
|
-
/**
|
|
12
|
-
* Slack Work App
|
|
13
|
-
*
|
|
14
|
-
* Provides Slack integration for Inkeep Agents including:
|
|
15
|
-
* - OAuth-based workspace installation
|
|
16
|
-
* - User account linking via JWT tokens
|
|
17
|
-
* - Slash commands for agent interaction
|
|
18
|
-
* - @mention support for workspace-wide agent access
|
|
19
|
-
* - Channel-specific agent configuration
|
|
20
|
-
*/
|
|
21
|
-
function createSlackRoutes() {
|
|
22
|
-
const app = new OpenAPIHono();
|
|
23
|
-
app.route("/", routes_default);
|
|
24
|
-
return app;
|
|
25
|
-
}
|
|
26
|
-
const slackRoutes = createSlackRoutes();
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
export { computeWorkspaceConnectionId, createConnectSession, createSlackRoutes, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, pendingSessionTokens, setBotTokenForTeam, setWorkspaceDefaultAgent, slackRoutes, storeWorkspaceInstallation, updateConnectionMetadata };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ManageAppVariables } from "../types.js";
|
|
2
|
-
import * as hono0 from "hono";
|
|
3
|
-
|
|
4
|
-
//#region src/slack/middleware/permissions.d.ts
|
|
5
|
-
declare const requireWorkspaceAdmin: <Env extends {
|
|
6
|
-
Variables: ManageAppVariables;
|
|
7
|
-
} = {
|
|
8
|
-
Variables: ManageAppVariables;
|
|
9
|
-
}>() => hono0.MiddlewareHandler<Env, string, {}, Response>;
|
|
10
|
-
declare const requireAuthenticatedUser: <Env extends {
|
|
11
|
-
Variables: ManageAppVariables;
|
|
12
|
-
} = {
|
|
13
|
-
Variables: ManageAppVariables;
|
|
14
|
-
}>() => hono0.MiddlewareHandler<Env, string, {}, Response>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { requireAuthenticatedUser, requireWorkspaceAdmin };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { OrgRoles, createApiError } from "@inkeep/agents-core";
|
|
2
|
-
import { createMiddleware } from "hono/factory";
|
|
3
|
-
|
|
4
|
-
//#region src/slack/middleware/permissions.ts
|
|
5
|
-
const requireWorkspaceAdmin = () => createMiddleware(async (c, next) => {
|
|
6
|
-
if (process.env.ENVIRONMENT === "test") {
|
|
7
|
-
await next();
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const userId = c.get("userId");
|
|
11
|
-
const tenantId = c.get("tenantId");
|
|
12
|
-
const tenantRole = c.get("tenantRole");
|
|
13
|
-
if (!userId || !tenantId) throw createApiError({
|
|
14
|
-
code: "unauthorized",
|
|
15
|
-
message: "User or organization context not found",
|
|
16
|
-
instance: c.req.path
|
|
17
|
-
});
|
|
18
|
-
if (userId === "system" || userId.startsWith("apikey:")) {
|
|
19
|
-
await next();
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (!(tenantRole === OrgRoles.OWNER || tenantRole === OrgRoles.ADMIN)) throw createApiError({
|
|
23
|
-
code: "forbidden",
|
|
24
|
-
message: "Only workspace administrators can modify workspace and channel configurations",
|
|
25
|
-
instance: c.req.path,
|
|
26
|
-
extensions: {
|
|
27
|
-
requiredRole: "admin or owner",
|
|
28
|
-
currentRole: tenantRole
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
await next();
|
|
32
|
-
});
|
|
33
|
-
const requireAuthenticatedUser = () => createMiddleware(async (c, next) => {
|
|
34
|
-
if (process.env.ENVIRONMENT === "test") {
|
|
35
|
-
await next();
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const userId = c.get("userId");
|
|
39
|
-
const tenantId = c.get("tenantId");
|
|
40
|
-
if (!userId || !tenantId) throw createApiError({
|
|
41
|
-
code: "unauthorized",
|
|
42
|
-
message: "Authentication required",
|
|
43
|
-
instance: c.req.path
|
|
44
|
-
});
|
|
45
|
-
await next();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
export { requireAuthenticatedUser, requireWorkspaceAdmin };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { WorkAppsVariables } from "../types.js";
|
|
2
|
-
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
3
|
-
|
|
4
|
-
//#region src/slack/routes/events.d.ts
|
|
5
|
-
|
|
6
|
-
declare const app: OpenAPIHono<{
|
|
7
|
-
Variables: WorkAppsVariables;
|
|
8
|
-
}, {}, "/">;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { app as default };
|