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:
Evandro committed 2026-10-20 00:48:28 -03:00
1 parent b3489e1ede
commit 98b5db029f
70 files changed
+9466 -9191

No files matched your search

+23
View File
@@ -8,6 +8,7 @@ import {
isRequestBodySizeAllowed,
getLocalNetworkUrls,
validateSttBaseUrl,
buildRuntimeCapabilities,
} from './piagentui-server-core.js'
describe('PiAgentUi Server Core Security Helpers', () => {
@@ -158,6 +159,28 @@ describe('PiAgentUi Server Core Security Helpers', () => {
})
})
describe('buildRuntimeCapabilities', () => {
it('should report session switching when runtime exposes switchSession', () => {
expect(buildRuntimeCapabilities({ switchSession: () => {} })).toEqual({
runtime: 'pi',
sessionSwitching: { available: true },
extensionLoading: { available: true, source: 'pi.extensions' },
mcp: { available: true, source: 'pi.mcp' },
slashCommands: { available: true, source: 'pi.commands' },
})
})
it('should report unavailable session switching without leaking context details', () => {
expect(buildRuntimeCapabilities({})).toEqual({
runtime: 'pi',
sessionSwitching: { available: false, reason: 'session_switching_unavailable' },
extensionLoading: { available: true, source: 'pi.extensions' },
mcp: { available: true, source: 'pi.mcp' },
slashCommands: { available: true, source: 'pi.commands' },
})
})
})
describe('isRequestBodySizeAllowed', () => {
it('should allow small request content sizes', () => {
expect(isRequestBodySizeAllowed('100')).toBe(true)