60 lines
1.6 KiB
Markdown
60 lines
1.6 KiB
Markdown
|
|
# Task ID: 81
|
||
|
|
|
||
|
|
**Title:** Define Built-in ProxyModels (default, subindex)
|
||
|
|
|
||
|
|
**Status:** done
|
||
|
|
|
||
|
|
**Dependencies:** 78 ✓
|
||
|
|
|
||
|
|
**Priority:** high
|
||
|
|
|
||
|
|
**Description:** Create the built-in proxymodel definitions for 'default' (current behavior) and 'subindex' (hierarchical navigation).
|
||
|
|
|
||
|
|
**Details:**
|
||
|
|
|
||
|
|
Create `src/mcplocal/src/proxymodel/built-in-models.ts`:
|
||
|
|
|
||
|
|
```typescript
|
||
|
|
import type { ProxyModelDefinition } from './schema';
|
||
|
|
|
||
|
|
export function getBuiltInProxyModels(): Map<string, ProxyModelDefinition> {
|
||
|
|
const models = new Map<string, ProxyModelDefinition>();
|
||
|
|
|
||
|
|
models.set('default', {
|
||
|
|
kind: 'ProxyModel',
|
||
|
|
metadata: { name: 'default' },
|
||
|
|
spec: {
|
||
|
|
controller: 'gate',
|
||
|
|
controllerConfig: { byteBudget: 8192 },
|
||
|
|
stages: [
|
||
|
|
{ type: 'passthrough' },
|
||
|
|
{ type: 'paginate', config: { pageSize: 8000 } },
|
||
|
|
],
|
||
|
|
appliesTo: ['prompts', 'toolResults'],
|
||
|
|
cacheable: false,
|
||
|
|
},
|
||
|
|
});
|
||
|
|
|
||
|
|
models.set('subindex', {
|
||
|
|
kind: 'ProxyModel',
|
||
|
|
metadata: { name: 'subindex' },
|
||
|
|
spec: {
|
||
|
|
controller: 'gate',
|
||
|
|
controllerConfig: { byteBudget: 8192 },
|
||
|
|
stages: [
|
||
|
|
{ type: 'section-split', config: { minSectionSize: 2000, maxSectionSize: 15000 } },
|
||
|
|
{ type: 'summarize-tree', config: { maxSummaryTokens: 200, maxGroupSize: 5, maxDepth: 3 } },
|
||
|
|
],
|
||
|
|
appliesTo: ['prompts', 'toolResults'],
|
||
|
|
cacheable: true,
|
||
|
|
},
|
||
|
|
});
|
||
|
|
|
||
|
|
return models;
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
**Test Strategy:**
|
||
|
|
|
||
|
|
Unit tests: both models are returned by getBuiltInProxyModels(), 'default' has passthrough+paginate stages, 'subindex' has section-split+summarize-tree stages, both schemas validate correctly.
|