← Public packages
@kentcdodds/quiet-hours
Quiet hours for Kent's bots: 10 PM to 8 AM MT (DST-aware) clock, shared overnight queue, override, and the 8 AM digest of finished work and open decisions.
Files
import { kody } from 'kody:runtime'
/**
* Cross-package calls run through `kody.execute` with a literal static
* import inside the executed module, NOT a top-level `kody:@` import here.
* Reason: @kentcdodds/discord and @kentcdodds/grok-bot statically import
* `quiet-hours/status` (hot path), and waiting-on-me depends on grok-bot.
* Static imports of discord or waiting-on-me from this package would form a
* `kody.dependencies` cycle, which publish rejects. Same pattern as
* discord's handle-decision-reaction → grok-bot wake.
*/
export const WAITING_ON_ME_CREATE_CODE = [
"import create from 'kody:@kentcdodds/waiting-on-me/create'",
'',
'export default async function main(params = {}) {',
' return await create(params)',
'}',
].join('\n')
export const DISCORD_POST_MESSAGE_CODE = [
"import postMessage from 'kody:@kentcdodds/discord/post-message'",
'',
'export default async function main(params = {}) {',
' return await postMessage(params)',
'}',
].join('\n')
export async function executeExport(code: string, params: Record<string, unknown>) {
const executed = (await kody.execute({ code, params, writable: true })) as unknown
const row = executed && typeof executed === 'object' ? (executed as Record<string, unknown>) : null
if (row?.ok === false) {
throw new Error(typeof row.error === 'string' ? row.error : 'execute failed')
}
return row && 'result' in row ? row.result : executed
}