Skip to content

feat: self-hosted socket mode entrypoint for Deno workflow apps#85

Draft
vegeris wants to merge 3 commits intomainfrom
evegeris-self-hosted-rosi-socket-mode
Draft

feat: self-hosted socket mode entrypoint for Deno workflow apps#85
vegeris wants to merge 3 commits intomainfrom
evegeris-self-hosted-rosi-socket-mode

Conversation

@vegeris
Copy link
Copy Markdown
Contributor

@vegeris vegeris commented Feb 20, 2026

Summary

This PR adds an entrypoint for running Deno apps via an SDK-managed socket connection

Testing

Running an app via the CLI:

  • Check out this branch locally; we will point your app to the local file
  • Create a new Deno app via any template (slack-public create --template https://github.com/slack-samples/deno-starter-template)
  • Update the app's .slack/hooks.json file with the following:
{
  "hooks": {
    "get-hooks": "deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.5.0/mod.ts",
    "start": "deno run -q --config=deno.jsonc --allow-read --allow-net --allow-run --allow-env --allow-sys=osRelease file:///Users/your-username/dev/deno-slack-runtime/src/self-hosted-socket-mode.ts"
  },
  "config": {
    "sdk-managed-connection-enabled": true
  }
}
  • Run the app via lack run as we do for CLI-managed local apps
  • The app runs normally

Running the app without the CLI:

  • set the app token environment variable (export SLACK_APP_TOKEN=... and optionally, export SLACK_BOT_TOKEN=..., export SLACK_API_URL=https://dev.slack.com/api) and run the Deno command directly; deno run -q --config=deno.jsonc --allow-read --allow-net --allow-env --allow-run --allow-sys file:///Users/evegeris//dev/deno-slack-runtime/src/self-hosted-socket-mode.ts

Requirements

@vegeris vegeris changed the title Evegeris self hosted rosi socket mode feat: self-hosted socket mode entrypoint for Deno workflow apps Feb 20, 2026
@vegeris vegeris force-pushed the evegeris-self-hosted-rosi-socket-mode branch 2 times, most recently from 0112e9e to b5030bb Compare February 20, 2026 01:35
"--config=deno.jsonc",
"--allow-read",
"--allow-env",
"--allow-sys=osRelease",
Copy link
Copy Markdown
Contributor Author

@vegeris vegeris Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why CLI-managed socket mode does not already require this permission to be set :not-sure:

The 'self hosted' script executes functions the same way as the 'local run' script; we run local-run-function.ts as a subprocess, which dispatches function execution to run-function.ts, which should ultimately call functions.completeSuccess or functions.completeFailure using BaseSlackAPIClient. As per Cursor: BaseSlackAPIClient uses Node’s os.release(), which in Deno is implemented with Deno.osRelease() and requires --allow-sys=osRelease

The local run start hook does run it with that permission, but the flags for the parent process don't get passed into the subprocess :confused_math_lady:
deno run -q --config=deno.jsonc --allow-read --allow-net --allow-run --allow-env --allow-sys=osRelease https://deno.land/x/deno_slack_runtime@1.1.3/local-run.ts

const client = new SocketModeClient({
appToken,
logLevel,
logger,
Copy link
Copy Markdown
Contributor Author

@vegeris vegeris Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local run script uses the 'hook CLI protocol' for logging, but since it's not applicable here we just use the Logger that the socket mode client accepts

@vegeris vegeris force-pushed the evegeris-self-hosted-rosi-socket-mode branch from b5030bb to 3b63327 Compare February 20, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant