PBI-55: ask-user-question – triggerPush na claudeQuestion.create
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
18c34b63de
commit
4c476464ec
1 changed files with 8 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import { prisma } from '../prisma.js'
|
||||||
import { requireWriteAccess } from '../auth.js'
|
import { requireWriteAccess } from '../auth.js'
|
||||||
import { userCanAccessStory, userOwnsIdea } from '../access.js'
|
import { userCanAccessStory, userOwnsIdea } from '../access.js'
|
||||||
import { toolError, toolJson, withToolErrors } from '../errors.js'
|
import { toolError, toolJson, withToolErrors } from '../errors.js'
|
||||||
|
import { triggerPush } from '../lib/push-trigger.js'
|
||||||
|
|
||||||
const PENDING_TTL_HOURS = 24
|
const PENDING_TTL_HOURS = 24
|
||||||
const POLL_INTERVAL_MS = 2_000
|
const POLL_INTERVAL_MS = 2_000
|
||||||
|
|
@ -127,6 +128,13 @@ export function registerAskUserQuestionTool(server: McpServer) {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
void triggerPush(auth.userId, {
|
||||||
|
title: 'Claude heeft een vraag',
|
||||||
|
body: question.slice(0, 120),
|
||||||
|
url: '/notifications',
|
||||||
|
tag: `claude-q-${created.id}`,
|
||||||
|
})
|
||||||
|
|
||||||
// Async-mode (default): return direct.
|
// Async-mode (default): return direct.
|
||||||
if (!wait_seconds || wait_seconds === 0) {
|
if (!wait_seconds || wait_seconds === 0) {
|
||||||
return toolJson(summarize(created))
|
return toolJson(summarize(created))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue