@compilr-dev/sdk 0.10.30 → 0.10.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/delegation.d.ts +21 -0
- package/dist/delegation.js +49 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared delegation defaults for tool result auto-summarization.
|
|
3
|
+
*
|
|
4
|
+
* `DelegationConfig` controls when large tool results get summarized
|
|
5
|
+
* by a delegate agent (instead of being inlined into the conversation
|
|
6
|
+
* context) — a per-turn token economy win that the agents library wires
|
|
7
|
+
* via the AfterToolHook.
|
|
8
|
+
*
|
|
9
|
+
* Each host (CLI, Desktop) used to keep its own copy of this config.
|
|
10
|
+
* The two had drifted: identical baselines (8000 default threshold etc.)
|
|
11
|
+
* but diverged tool overrides — Desktop had 6 extra tools tuned
|
|
12
|
+
* (run_tests, run_lint, run_build, web_fetch, artifact_get,
|
|
13
|
+
* find_references, propose_alternatives) plus a tighter `git_diff`
|
|
14
|
+
* threshold (4000 vs CLI's 6000). The baseline below converges to
|
|
15
|
+
* Desktop's set since it's the more recently tuned version, and hosts
|
|
16
|
+
* spread + override per-tool as needed.
|
|
17
|
+
*
|
|
18
|
+
* Audit ref: TODO-13.
|
|
19
|
+
*/
|
|
20
|
+
import type { DelegationConfig } from '@compilr-dev/agents';
|
|
21
|
+
export declare const DEFAULT_DELEGATION_CONFIG: DelegationConfig;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared delegation defaults for tool result auto-summarization.
|
|
3
|
+
*
|
|
4
|
+
* `DelegationConfig` controls when large tool results get summarized
|
|
5
|
+
* by a delegate agent (instead of being inlined into the conversation
|
|
6
|
+
* context) — a per-turn token economy win that the agents library wires
|
|
7
|
+
* via the AfterToolHook.
|
|
8
|
+
*
|
|
9
|
+
* Each host (CLI, Desktop) used to keep its own copy of this config.
|
|
10
|
+
* The two had drifted: identical baselines (8000 default threshold etc.)
|
|
11
|
+
* but diverged tool overrides — Desktop had 6 extra tools tuned
|
|
12
|
+
* (run_tests, run_lint, run_build, web_fetch, artifact_get,
|
|
13
|
+
* find_references, propose_alternatives) plus a tighter `git_diff`
|
|
14
|
+
* threshold (4000 vs CLI's 6000). The baseline below converges to
|
|
15
|
+
* Desktop's set since it's the more recently tuned version, and hosts
|
|
16
|
+
* spread + override per-tool as needed.
|
|
17
|
+
*
|
|
18
|
+
* Audit ref: TODO-13.
|
|
19
|
+
*/
|
|
20
|
+
export const DEFAULT_DELEGATION_CONFIG = {
|
|
21
|
+
enabled: true,
|
|
22
|
+
delegationThreshold: 8000,
|
|
23
|
+
summaryMaxTokens: 800,
|
|
24
|
+
resultTTL: 600_000,
|
|
25
|
+
maxStoredResults: 50,
|
|
26
|
+
strategy: 'auto',
|
|
27
|
+
toolOverrides: {
|
|
28
|
+
// Bash often produces large output; allow a higher inline budget
|
|
29
|
+
// before summarising.
|
|
30
|
+
bash: { threshold: 12000 },
|
|
31
|
+
grep: { threshold: 4000 },
|
|
32
|
+
// Large-output tools — tighter thresholds for earlier summarisation
|
|
33
|
+
git_diff: { threshold: 4000 },
|
|
34
|
+
run_tests: { threshold: 6000 },
|
|
35
|
+
run_lint: { threshold: 4000 },
|
|
36
|
+
run_build: { threshold: 6000 },
|
|
37
|
+
web_fetch: { threshold: 6000 },
|
|
38
|
+
artifact_get: { threshold: 6000 },
|
|
39
|
+
find_references: { threshold: 4000 },
|
|
40
|
+
// Disable delegation on small / interactive / read-only tools where
|
|
41
|
+
// the round-trip cost would exceed the saving.
|
|
42
|
+
get_tool_info: { enabled: false },
|
|
43
|
+
list_tools: { enabled: false },
|
|
44
|
+
ask_user: { enabled: false },
|
|
45
|
+
ask_user_simple: { enabled: false },
|
|
46
|
+
propose_alternatives: { enabled: false },
|
|
47
|
+
todo_read: { enabled: false },
|
|
48
|
+
},
|
|
49
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ export { defineTool, createSuccessResult, createErrorResult, mergeHooks, createL
|
|
|
81
81
|
export type { Tool, HooksConfig, AgentEvent, Message, LLMProvider, AnchorInput, ToolExecutionResult, AgentRunResult, PermissionHandler, PermissionHandlerResponse, ToolPermission, AgentTypeConfig, GuardrailTriggeredHandler, BeforeLLMHookResult, BeforeToolHook, BeforeToolHookResult, AfterToolHook, AgentState, AgentConfig, SessionInfo, Anchor, AnchorScope, AnchorClearOptions, AnchorPriority, AnchorQueryOptions, FileAccessType, FileAccess, GuardrailResult, GuardrailContext, MCPClient, MCPToolDefinition, } from '@compilr-dev/agents';
|
|
82
82
|
export { DEFAULT_PERMISSION_RULES, findMatchingRule, permissionModeLabel, permissionLevelLabel, } from './permissions.js';
|
|
83
83
|
export type { PermissionRule, PermissionMode, PermissionLevel } from './permissions.js';
|
|
84
|
+
export { DEFAULT_DELEGATION_CONFIG } from './delegation.js';
|
|
84
85
|
export { readMCPConfigFile, writeMCPConfigFile, resolveServerEntry, loadMCPServers, saveMCPServerEntry, deleteMCPServerEntry, getServerNames, } from './mcp-config.js';
|
|
85
86
|
export type { MCPServerEntry, MCPConfigFile, ResolvedMCPServer } from './mcp-config.js';
|
|
86
87
|
export { generateProject, isGitConfigured, generateCompilrMd, generateConfigJson, generateReadmeMd, generateCodingStandardsMd, generatePackageJson, generateTsconfig, generateGitignore, generateCompilrMdForImport, detectProjectInfo, detectGitInfo, prettifyName, getLanguageLabel, getFrameworkLabel, validateImportPath, isValidProjectName, projectExists, TECH_STACK_LABELS, CODING_STANDARDS_LABELS, REPO_PATTERN_LABELS, WORKFLOW_VERSION, } from './project-generator/index.js';
|
package/dist/index.js
CHANGED
|
@@ -198,6 +198,10 @@ AgentError, ProviderError, ToolError, ToolTimeoutError, MaxIterationsError, Abor
|
|
|
198
198
|
// =============================================================================
|
|
199
199
|
export { DEFAULT_PERMISSION_RULES, findMatchingRule, permissionModeLabel, permissionLevelLabel, } from './permissions.js';
|
|
200
200
|
// =============================================================================
|
|
201
|
+
// Shared Delegation Config Defaults
|
|
202
|
+
// =============================================================================
|
|
203
|
+
export { DEFAULT_DELEGATION_CONFIG } from './delegation.js';
|
|
204
|
+
// =============================================================================
|
|
201
205
|
// Shared MCP Configuration
|
|
202
206
|
// =============================================================================
|
|
203
207
|
export { readMCPConfigFile, writeMCPConfigFile, resolveServerEntry, loadMCPServers, saveMCPServerEntry, deleteMCPServerEntry, getServerNames, } from './mcp-config.js';
|