Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
feat(control-ui): link the manifest straight to Slack app creation
Jose Ramirez520df78df44e
diff --git a/control-ui/app/communication-channels/new/page.tsx b/control-ui/app/communication-channels/new/page.tsxindex 88452e279..1ee4cce6c 100644--- a/control-ui/app/communication-channels/new/page.tsx+++ b/control-ui/app/communication-channels/new/page.tsx@@ -59,6 +59,9 @@ type DraftState = {const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iconst TEAMS_BOT_NAME_RE = /^[a-z][a-z0-9-]{1,62}[a-z0-9]$/const LOCAL_TEAMS_ENDPOINT_ORIGIN = 'https://<public-webhook-origin>'++/** Slack's "Create an app" chooser, where "From an app manifest" is one of the options. */+const SLACK_NEW_APP_URL = 'https://api.slack.com/apps?new_app=1'const STEPS = ['Channel', 'Provider'] as constconst STEP_DETAILS = [@@ -661,11 +664,23 @@ export default function CreateCommunicationChannelPage() {</pre></div><span className="cu-field__hint">- Create the Slack app from this first: in Slack, Create New App → From an- app manifest → paste. It sets the scopes, the events, and both Request- URLs, so the app is ready before you come back for the token below. The- URLs point at <code>{normalizedChannelName}</code>, so create this- channel under that name.+ Copy this, then{' '}+ <a+ className="cu-link"+ href={SLACK_NEW_APP_URL}+ target="_blank"+ rel="noreferrer"+ >+ create your Slack app+ </a>{' '}+ — choose <strong>From an app manifest</strong>, pick the workspace, and+ paste. It sets the scopes, the events, and both Request URLs, so the app+ is ready before you come back here for the token below. Opens in a new+ tab so this form keeps what you have typed.+ </span>+ <span className="cu-field__hint">+ The Request URLs point at <code>{normalizedChannelName}</code>, so this+ channel has to be created under that name.</span></div>) : null}diff --git a/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx b/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsxindex 86882c78a..531f91b6a 100644--- a/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx+++ b/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx@@ -521,6 +521,30 @@ describe('CreateCommunicationChannelPage — Slack app manifest', () => {expect(encoded.namespace).toBe('channels')})+ it('links straight to Slack app creation, in a new tab', async () => {+ // The manifest is only useful next to the page that consumes it, and that page+ // is a different site. Sending the operator to find it themselves is the step+ // this whole panel exists to remove. New tab, because the half-filled create+ // form must survive the trip.+ vi.stubEnv('NEXT_PUBLIC_WORKFLOW_APPROVAL_READER_BASE_URL', 'https://webhook.example.com')+ render(+ <ToastProvider>+ <CreateCommunicationChannelPage />+ </ToastProvider>+ )+ await goToSlackProviderStep('support-bot')+ fireEvent.change(document.getElementById('slack-bot-handle')!, {+ target: { value: 'Evenfire' },+ })+ await screen.findByText(/display_information:/)++ const link = screen.getByRole('link', { name: /create.*slack app/i })+ expect(link).toHaveAttribute('href', 'https://api.slack.com/apps?new_app=1')+ expect(link).toHaveAttribute('target', '_blank')+ // Untrusted target: never hand it a live window.opener back to this form.+ expect(link.getAttribute('rel') ?? '').toMatch(/noreferrer|noopener/)+ })+it('offers no manifest until the Slack App Name is set', async () => {// The app name is the manifest's display_information.name. Emitting one with a// placeholder would install an app under a name the operator never chose.diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex c32e3e6cd..b7e9ac144 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.407",+ "version": "0.1.408","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.407",+ "version": "0.1.408","dependencies": {"@clerum/llm-providers": "file:../packages/llm-providers","@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",diff --git a/control-ui/package.json b/control-ui/package.jsonindex d0679198c..ada0c958f 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.407",+ "version": "0.1.408","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",