diff --git a/packages/server/build.ts b/packages/server/build.ts index 51939ecf..f54a3f28 100644 --- a/packages/server/build.ts +++ b/packages/server/build.ts @@ -34,4 +34,5 @@ await build({ }); copyFileSync(join(here, 'src/review-prompt.md'), join(distDir, 'review-prompt.md')); +copyFileSync(join(here, 'src/routine-prompt.md'), join(distDir, 'routine-prompt.md')); cpSync(uiSource, join(distDir, 'ui'), { recursive: true }); diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 128c592b..8be1ef63 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -16,9 +16,9 @@ import type { DevLoginProvider, IapLogin } from './login.js'; import { GitHubConnectError, type GitHubAppAccess } from './github-app.js'; import { createMcpServer } from './mcp.js'; import { MAX_WAIT_SECONDS, type Live } from './live.js'; -import type { Routine } from './routine.js'; +import { routinePrompt, type Routine } from './routine.js'; import { uiApiRouter } from './ui-api.js'; -import { SECTIONS_SCRIPT, SESSIONS_SCRIPT, escapeHtml, page, sessionsStatus } from './html.js'; +import { SECTIONS_SCRIPT, SESSIONS_SCRIPT, SETTINGS_SCRIPT, escapeHtml, page, sessionsStatus } from './html.js'; import { randomToken } from './crypto.js'; import { SESSION_COOKIE, @@ -151,6 +151,10 @@ export function createApp(deps: AppDeps): express.Express { res.type('text/javascript').set('Cache-Control', 'no-cache').send(SECTIONS_SCRIPT); }); + app.get('/settings.js', (_req, res) => { + res.type('text/javascript').set('Cache-Control', 'no-cache').send(SETTINGS_SCRIPT); + }); + app.get('/sessions.js', (_req, res) => { res.type('text/javascript').set('Cache-Control', 'no-cache').send(SESSIONS_SCRIPT); }); @@ -474,6 +478,24 @@ export function createApp(deps: AppDeps): express.Express {
When you ask for a review from this page, or ask a question while no agent is listening, diffity fires this Claude routine with the session and a token that works on that session only.
+${escapeHtml(publicUrl.host)}; no diffity secret is needed, the token arrives in the payload.
+ Prompt: the one below. Save, then copy the fire URL and the API key the trigger shows.The routine’s prompt must be the one below. It changes with diffity, so copy it again after an update that changes it.
+${escapeHtml(routinePrompt(publicUrl))}
+