mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-16 14:57:15 +00:00
feat(runner): unify plugin execution across agents and event processors
This commit is contained in:
@@ -17,8 +17,8 @@ const kbFormSource = readSource(
|
||||
const selectSource = readSource(
|
||||
'src/app/home/knowledge/components/kb-form/KnowledgeEngineSelect.tsx',
|
||||
);
|
||||
const agentRunnerSelectSource = readSource(
|
||||
'src/app/home/agents/components/AgentRunnerSelect.tsx',
|
||||
const runnerSelectSource = readSource(
|
||||
'src/app/home/agents/components/RunnerSelect.tsx',
|
||||
);
|
||||
const agentFormSource = readSource(
|
||||
'src/app/home/agents/components/AgentFormComponent.tsx',
|
||||
@@ -26,8 +26,8 @@ const agentFormSource = readSource(
|
||||
const pipelineFormSource = readSource(
|
||||
'src/app/home/pipelines/components/pipeline-form/PipelineFormComponent.tsx',
|
||||
);
|
||||
const agentRunnerMarketplaceSource = readSource(
|
||||
'src/app/home/agents/agent-runner-marketplace.ts',
|
||||
const runnerMarketplaceSource = readSource(
|
||||
'src/app/home/agents/runner-marketplace.ts',
|
||||
);
|
||||
const marketplaceInstallButtonSource = readSource(
|
||||
'src/app/home/components/MarketplaceInstallButton.tsx',
|
||||
@@ -89,7 +89,7 @@ test('tracks plugin upgrades as recoverable multistep async tasks', () => {
|
||||
});
|
||||
|
||||
test('keeps marketplace install actions on one fixed vertical column', () => {
|
||||
for (const source of [selectSource, agentRunnerSelectSource]) {
|
||||
for (const source of [selectSource, runnerSelectSource]) {
|
||||
assert.match(source, /grid-cols-\[1\.75rem_minmax\(0,1fr\)_4rem\]/);
|
||||
assert.match(source, /<MarketplaceInstallButton/);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ test('uses a compact selected engine layout and clears stale required errors', (
|
||||
});
|
||||
|
||||
test('installs marketplace components from inline progress buttons without selecting them', () => {
|
||||
for (const source of [selectSource, agentRunnerSelectSource]) {
|
||||
for (const source of [selectSource, runnerSelectSource]) {
|
||||
assert.match(source, /const handleInstall = useCallback/);
|
||||
assert.match(source, /installing=\{activePluginId === pluginId\}/);
|
||||
assert.match(source, /progress=\{installProgress\}/);
|
||||
@@ -134,18 +134,12 @@ test('installs marketplace components from inline progress buttons without selec
|
||||
}
|
||||
});
|
||||
|
||||
test('shows plugin descriptions for installed AgentRunner entries', () => {
|
||||
assert.match(agentRunnerMarketplaceSource, /installedPluginDescriptions/);
|
||||
assert.match(agentRunnerMarketplaceSource, /metadata\.description/);
|
||||
assert.match(agentRunnerSelectSource, /installedRunnerDescription\(/);
|
||||
assert.match(
|
||||
agentRunnerSelectSource,
|
||||
/function InstalledRunnerOptionContent/,
|
||||
);
|
||||
assert.match(agentRunnerSelectSource, /marketplacePlugin\?\.description/);
|
||||
assert.match(
|
||||
agentRunnerSelectSource,
|
||||
/grid-cols-\[1\.75rem_minmax\(0,1fr\)\]/,
|
||||
);
|
||||
assert.doesNotMatch(agentRunnerSelectSource, /description=\{option\.name\}/);
|
||||
test('shows plugin descriptions for installed Runner entries', () => {
|
||||
assert.match(runnerMarketplaceSource, /installedPluginDescriptions/);
|
||||
assert.match(runnerMarketplaceSource, /metadata\.description/);
|
||||
assert.match(runnerSelectSource, /installedRunnerDescription\(/);
|
||||
assert.match(runnerSelectSource, /function InstalledRunnerOptionContent/);
|
||||
assert.match(runnerSelectSource, /marketplacePlugin\?\.description/);
|
||||
assert.match(runnerSelectSource, /grid-cols-\[1\.75rem_minmax\(0,1fr\)\]/);
|
||||
assert.doesNotMatch(runnerSelectSource, /description=\{option\.name\}/);
|
||||
});
|
||||
|
||||
@@ -40,10 +40,10 @@ test('hides the entire workspace switcher slot for a singleton local workspace',
|
||||
);
|
||||
});
|
||||
|
||||
test('keeps bot cards at the same vertical spacing as knowledge-base cards', () => {
|
||||
test('keeps compact bot forms vertically spaced while detail forms support columns', () => {
|
||||
assert.match(
|
||||
botFormSource,
|
||||
/<fieldset\s+className="[^"]*\bspace-y-6\b[^"]*"\s+disabled=\{isLoading\}/,
|
||||
/<fieldset[\s\S]*?'space-y-6'[\s\S]*?disabled=\{isLoading\}/,
|
||||
);
|
||||
assert.match(kbFormSource, /<form[\s\S]*?className="space-y-6"/);
|
||||
});
|
||||
|
||||
@@ -31,7 +31,8 @@ test('agent and pipeline details share the split processor workbench', () => {
|
||||
/lg:grid-cols-\[minmax\(20rem,0\.72fr\)_minmax\(0,1\.28fr\)\]/,
|
||||
);
|
||||
assert.ok(
|
||||
workbench.indexOf('{debugContent}') < workbench.indexOf('{configContent}'),
|
||||
workbench.indexOf('{debugContent}') <
|
||||
workbench.lastIndexOf('{configPanel}'),
|
||||
);
|
||||
assert.match(agentDetail, /<ProcessorDetailWorkbench/);
|
||||
assert.match(agentDetail, /debugContent=/);
|
||||
|
||||
@@ -12,7 +12,7 @@ const wizardSource = fs.readFileSync(
|
||||
const runnerMarketplaceSource = fs.readFileSync(
|
||||
path.resolve(
|
||||
currentDirectory,
|
||||
'../../src/app/home/agents/agent-runner-marketplace.ts',
|
||||
'../../src/app/home/agents/runner-marketplace.ts',
|
||||
),
|
||||
'utf8',
|
||||
);
|
||||
@@ -66,25 +66,25 @@ test('binds every message-reply bot to its provisional pipeline before verificat
|
||||
);
|
||||
});
|
||||
|
||||
test('keeps the 4.11 AgentRunner marketplace installation flow', () => {
|
||||
assert.match(wizardSource, /loadAgentRunnerCatalog\(\)/);
|
||||
test('keeps the 4.11 Runner marketplace installation flow', () => {
|
||||
assert.match(wizardSource, /loadRunnerCatalog\(\)/);
|
||||
assert.match(
|
||||
wizardSource,
|
||||
/installMarketplaceAgentRunner\(plugin, \{[\s\S]*?scope: WIZARD_RUNNER_INSTALL_SCOPE/,
|
||||
/installMarketplaceRunner\(plugin, \{[\s\S]*?scope: WIZARD_RUNNER_INSTALL_SCOPE/,
|
||||
);
|
||||
assert.match(wizardSource, /resumePendingAgentRunnerInstall\(/);
|
||||
assert.match(wizardSource, /resumePendingRunnerInstall\(/);
|
||||
assert.match(runnerMarketplaceSource, /RUNNER_COMPONENT_FILTER = 'Runner'/);
|
||||
assert.match(runnerMarketplaceSource, /installPluginFromMarketplace\(/);
|
||||
assert.match(
|
||||
runnerMarketplaceSource,
|
||||
/RUNNER_COMPONENT_FILTER = 'AgentRunner'/,
|
||||
/const prefix = runnerPluginPrefix\(\{/,
|
||||
);
|
||||
assert.match(runnerMarketplaceSource, /installPluginFromMarketplace\(/);
|
||||
assert.match(runnerMarketplaceSource, /const prefix = runnerPluginPrefix\(\{/);
|
||||
assert.match(runnerMarketplaceSource, /option\.name\.startsWith\(prefix\)/);
|
||||
assert.match(runnerMarketplaceSource, /registrationDeadline/);
|
||||
assert.match(runnerMarketplaceSource, /sessionStorage\.setItem\(/);
|
||||
});
|
||||
|
||||
test('requires the selected AgentRunner mandatory configuration before finishing', () => {
|
||||
test('requires the selected Runner mandatory configuration before finishing', () => {
|
||||
assert.match(
|
||||
wizardSource,
|
||||
/isRequiredRunnerConfigComplete\(selectedRunnerConfigItems, runnerConfig\)/,
|
||||
|
||||
Reference in New Issue
Block a user