Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ updates:
update-types:
- minor
- patch
ignore:
- dependency-name: '@types/node'
update-types:
- version-update:semver-major
- dependency-name: typescript
update-types:
- version-update:semver-major

- package-ecosystem: npm
directory: /cli
Expand All @@ -30,6 +37,13 @@ updates:
update-types:
- minor
- patch
ignore:
- dependency-name: '@types/node'
update-types:
- version-update:semver-major
- dependency-name: typescript
update-types:
- version-update:semver-major

- package-ecosystem: github-actions
directory: /
Expand Down
7 changes: 1 addition & 6 deletions app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,7 @@ async function readChatRequestBody(
}

type FallbackKind =
| 'none'
| 'forced_photo'
| 'parse_fallback'
| 'render_fallback'
| 'recovered_text'
| 'error';
'none' | 'forced_photo' | 'parse_fallback' | 'render_fallback' | 'recovered_text' | 'error';

interface ChatAutoresearchDiagnostics {
raw_model_output_present: boolean;
Expand Down
15 changes: 9 additions & 6 deletions app/api/chat/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ export function buildUntrustedConversationRequest(messages: ChatMessage[]): stri
}

export function sanitizeInput(text: string): string {
return text
.replace(/\0/g, '')
.replace(/[\x01-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '')
.replace(/\n{4,}/g, '\n\n\n')
.replace(/ {4,}/g, ' ')
.trim();
return (
text
.replace(/\0/g, '')
// eslint-disable-next-line no-control-regex -- Strip unsafe C0 control bytes while preserving newlines and tabs.
.replace(/[\x01-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '')
.replace(/\n{4,}/g, '\n\n\n')
.replace(/ {4,}/g, ' ')
.trim()
);
}

export function detectInjection(text: string): boolean {
Expand Down
7 changes: 1 addition & 6 deletions autoresearch/score_quality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ type ChatDiagnostics = {
code?: string;
}>;
fallback_kind?:
| 'none'
| 'forced_photo'
| 'parse_fallback'
| 'render_fallback'
| 'recovered_text'
| 'error';
'none' | 'forced_photo' | 'parse_fallback' | 'render_fallback' | 'recovered_text' | 'error';
final_component?: string | null;
final_mode?: string | null;
};
Expand Down
Loading
Loading