wip: snapshot das alterações não commitadas (2026-10-20)
Origem: D:/Documents/Github/PiAgentUI/PiAgentUi Arquivos omitidos (segredos, bancos de dados, logs, >50 MB): 4
This commit is contained in:
1 parent
b3489e1ede
commit
98b5db029f
70 files changed
+9466
-9191
No files matched your search
@@ -1,6 +1,23 @@
|
||||
import * as path from 'node:path'
|
||||
import * as os from 'node:os'
|
||||
|
||||
export interface RuntimeCapabilityStatus {
|
||||
available: boolean
|
||||
reason?: string
|
||||
source?: string
|
||||
}
|
||||
|
||||
export interface RuntimeCapabilities {
|
||||
runtime: 'pi'
|
||||
sessionSwitching: RuntimeCapabilityStatus
|
||||
extensionLoading: RuntimeCapabilityStatus
|
||||
mcp: RuntimeCapabilityStatus
|
||||
slashCommands: RuntimeCapabilityStatus
|
||||
}
|
||||
|
||||
interface RuntimeCapabilityContext {
|
||||
switchSession?: unknown
|
||||
}
|
||||
/**
|
||||
* Checks if a host string matches a loopback host (localhost or 127.0.0.1 or ::1)
|
||||
*/
|
||||
@@ -170,3 +187,16 @@ export function isRequestBodySizeAllowed(
|
||||
if (isNaN(size)) return false
|
||||
return size <= maxBytes
|
||||
}
|
||||
|
||||
export function buildRuntimeCapabilities(ctx: RuntimeCapabilityContext | undefined): RuntimeCapabilities {
|
||||
return {
|
||||
runtime: 'pi',
|
||||
sessionSwitching:
|
||||
typeof ctx?.switchSession === 'function'
|
||||
? { available: true }
|
||||
: { available: false, reason: 'session_switching_unavailable' },
|
||||
extensionLoading: { available: true, source: 'pi.extensions' },
|
||||
mcp: { available: true, source: 'pi.mcp' },
|
||||
slashCommands: { available: true, source: 'pi.commands' },
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user