Support agent status hooks over SSH (#1865)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Brennan Benson
2026-05-14 16:06:23 -07:00
committed by GitHub
co-authored by Orca
parent dcf5bf0dce
commit 2cadcbc4e1
31 changed files with 2829 additions and 158 deletions
+12
View File
@@ -0,0 +1,12 @@
export const PLUGIN_SOURCE_MAX_BYTES = 256 * 1024
export function assertPluginSourceUnderByteCap(fieldName: string, value: unknown): void {
if (typeof value !== 'string') {
return
}
// Why: the relay receives JSON strings over the wire; cap actual UTF-8
// bytes instead of UTF-16 code units so non-ASCII source cannot bypass it.
if (Buffer.byteLength(value, 'utf8') > PLUGIN_SOURCE_MAX_BYTES) {
throw new Error(`${fieldName} exceeds ${PLUGIN_SOURCE_MAX_BYTES} byte cap`)
}
}