style: apply prettier formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -69,8 +69,7 @@ export interface ChatSdkBridgeConfig {
|
|||||||
|
|
||||||
export function createChatSdkBridge(config: ChatSdkBridgeConfig): ChannelAdapter {
|
export function createChatSdkBridge(config: ChatSdkBridgeConfig): ChannelAdapter {
|
||||||
const { adapter } = config;
|
const { adapter } = config;
|
||||||
const transformText = (t: string): string =>
|
const transformText = (t: string): string => (config.transformOutboundText ? config.transformOutboundText(t) : t);
|
||||||
config.transformOutboundText ? config.transformOutboundText(t) : t;
|
|
||||||
let chat: Chat;
|
let chat: Chat;
|
||||||
let state: SqliteStateAdapter;
|
let state: SqliteStateAdapter;
|
||||||
let setupConfig: ChannelSetup;
|
let setupConfig: ChannelSetup;
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ describe('sanitizeTelegramLegacyMarkdown', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('strips formatting chars on odd delimiter count (unbalanced _)', () => {
|
it('strips formatting chars on odd delimiter count (unbalanced _)', () => {
|
||||||
expect(sanitizeTelegramLegacyMarkdown('file_name has _one italic_')).toBe(
|
expect(sanitizeTelegramLegacyMarkdown('file_name has _one italic_')).toBe('filename has one italic');
|
||||||
'filename has one italic',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('strips brackets when unbalanced', () => {
|
it('strips brackets when unbalanced', () => {
|
||||||
|
|||||||
@@ -299,7 +299,10 @@ registerChannelAdapter('whatsapp', {
|
|||||||
|
|
||||||
/** Download media from an inbound message, save to /workspace/attachments/. */
|
/** Download media from an inbound message, save to /workspace/attachments/. */
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
async function downloadInboundMedia(msg: WAMessage, normalized: any): Promise<Array<{ type: string; name: string; localPath: string }>> {
|
async function downloadInboundMedia(
|
||||||
|
msg: WAMessage,
|
||||||
|
normalized: any,
|
||||||
|
): Promise<Array<{ type: string; name: string; localPath: string }>> {
|
||||||
const mediaTypes: Array<{ key: string; type: string; ext: string }> = [
|
const mediaTypes: Array<{ key: string; type: string; ext: string }> = [
|
||||||
{ key: 'imageMessage', type: 'image', ext: '.jpg' },
|
{ key: 'imageMessage', type: 'image', ext: '.jpg' },
|
||||||
{ key: 'videoMessage', type: 'video', ext: '.mp4' },
|
{ key: 'videoMessage', type: 'video', ext: '.mp4' },
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ export function createPendingQuestion(pq: PendingQuestion): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getPendingQuestion(questionId: string): PendingQuestion | undefined {
|
export function getPendingQuestion(questionId: string): PendingQuestion | undefined {
|
||||||
const row = getDb()
|
const row = getDb().prepare('SELECT * FROM pending_questions WHERE question_id = ?').get(questionId) as
|
||||||
.prepare('SELECT * FROM pending_questions WHERE question_id = ?')
|
| (Omit<PendingQuestion, 'options'> & { options_json: string })
|
||||||
.get(questionId) as (Omit<PendingQuestion, 'options'> & { options_json: string }) | undefined;
|
| undefined;
|
||||||
if (!row) return undefined;
|
if (!row) return undefined;
|
||||||
const { options_json, ...rest } = row;
|
const { options_json, ...rest } = row;
|
||||||
return { ...rest, options: JSON.parse(options_json) };
|
return { ...rest, options: JSON.parse(options_json) };
|
||||||
|
|||||||
@@ -299,11 +299,16 @@ async function handleApprovalResponse(
|
|||||||
sender: 'system',
|
sender: 'system',
|
||||||
senderId: 'system',
|
senderId: 'system',
|
||||||
}),
|
}),
|
||||||
processAfter: new Date(Date.now() + 5000).toISOString().replace('T', ' ').replace(/\.\d+Z$/, ''),
|
processAfter: new Date(Date.now() + 5000)
|
||||||
|
.toISOString()
|
||||||
|
.replace('T', ' ')
|
||||||
|
.replace(/\.\d+Z$/, ''),
|
||||||
});
|
});
|
||||||
log.info('Container rebuild completed (bundled with install)', { approvalId: approval.approval_id });
|
log.info('Container rebuild completed (bundled with install)', { approvalId: approval.approval_id });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
notify(`Packages added to config (${pkgs}) but rebuild failed: ${e instanceof Error ? e.message : String(e)}. Call request_rebuild to retry.`);
|
notify(
|
||||||
|
`Packages added to config (${pkgs}) but rebuild failed: ${e instanceof Error ? e.message : String(e)}. Call request_rebuild to retry.`,
|
||||||
|
);
|
||||||
log.error('Bundled rebuild failed after install approval', { approvalId: approval.approval_id, err: e });
|
log.error('Bundled rebuild failed after install approval', { approvalId: approval.approval_id, err: e });
|
||||||
}
|
}
|
||||||
} else if (approval.action === 'request_rebuild') {
|
} else if (approval.action === 'request_rebuild') {
|
||||||
|
|||||||
Reference in New Issue
Block a user