@compilr-dev/sdk 0.9.22 → 0.9.24
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/CHANGELOG.md +24 -0
- package/dist/compressors/index.js +6 -4
- package/dist/entitlements/cache.js +6 -1
- package/dist/entitlements/index.d.ts +3 -3
- package/dist/entitlements/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/platform/tools/plan-tools.js +1 -2
- package/dist/team/tool-config.js +6 -1
- package/dist/tools/propose-alternatives-tool.js +1 -1
- package/package.json +7 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this package are documented here.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
> **Beta notice:** versions in the `0.x` range may contain breaking changes
|
|
9
|
+
> between minors. Read each release entry before upgrading.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## [Unreleased]
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
For full git history see the repository commit log. Older `0.x` entries will be
|
|
24
|
+
backfilled here over time.
|
|
@@ -41,10 +41,12 @@ export function createCompressorHook(config) {
|
|
|
41
41
|
const command = ctx.input.command ?? '';
|
|
42
42
|
const compressed = compressBashOutput(command, stdout);
|
|
43
43
|
if (compressed !== null && compressed.length < stdout.length) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
if (process.env.DEBUG_COMPRESSORS) {
|
|
45
|
+
const saved = stdout.length - compressed.length;
|
|
46
|
+
const pct = Math.round((saved / stdout.length) * 100);
|
|
47
|
+
// eslint-disable-next-line no-console -- DEBUG_COMPRESSORS env-gated diagnostic
|
|
48
|
+
console.log(`[compressor] bash "${command.slice(0, 40)}" ${String(stdout.length)} → ${String(compressed.length)} chars (${String(pct)}% saved)`);
|
|
49
|
+
}
|
|
48
50
|
return {
|
|
49
51
|
result: {
|
|
50
52
|
...ctx.result,
|
|
@@ -99,7 +99,12 @@ export class EntitlementCache {
|
|
|
99
99
|
if (fallbackLimit === UNLIMITED)
|
|
100
100
|
return { allowed: true };
|
|
101
101
|
if (currentCount >= fallbackLimit) {
|
|
102
|
-
return {
|
|
102
|
+
return {
|
|
103
|
+
allowed: false,
|
|
104
|
+
reason: 'Entitlements not loaded',
|
|
105
|
+
current: currentCount,
|
|
106
|
+
limit: fallbackLimit,
|
|
107
|
+
};
|
|
103
108
|
}
|
|
104
109
|
return { allowed: true, current: currentCount, limit: fallbackLimit };
|
|
105
110
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Entitlements — Server-driven tier management for pricing.
|
|
3
3
|
*/
|
|
4
|
-
export type { TierLimits, EntitlementResponse, LimitCheckResult
|
|
5
|
-
export { UNLIMITED, OFFLINE_FALLBACK_LIMITS
|
|
6
|
-
export type { IEntitlementStore, EntitlementCacheConfig
|
|
4
|
+
export type { TierLimits, EntitlementResponse, LimitCheckResult } from './types.js';
|
|
5
|
+
export { UNLIMITED, OFFLINE_FALLBACK_LIMITS } from './types.js';
|
|
6
|
+
export type { IEntitlementStore, EntitlementCacheConfig } from './cache.js';
|
|
7
7
|
export { EntitlementCache } from './cache.js';
|
|
8
8
|
export { DailyCounter, formatLimitMessage, formatTimeUntilReset, formatUpgradeHint, } from './gating.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Entitlements — Server-driven tier management for pricing.
|
|
3
3
|
*/
|
|
4
|
-
export { UNLIMITED, OFFLINE_FALLBACK_LIMITS
|
|
4
|
+
export { UNLIMITED, OFFLINE_FALLBACK_LIMITS } from './types.js';
|
|
5
5
|
export { EntitlementCache } from './cache.js';
|
|
6
6
|
export { DailyCounter, formatLimitMessage, formatTimeUntilReset, formatUpgradeHint, } from './gating.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export type { SystemPromptContext, BuildResult, SystemPromptModule, ModuleCondit
|
|
|
56
56
|
export type { ProjectType, ProjectStatus, RepoPattern, WorkflowMode, LifecycleState, WorkItemType, WorkItemStatus, WorkItemPriority, GuidedStep, DocumentType, PlanStatus, Project, WorkItem, ProjectDocument, Plan, PlanSummary, PlanWithWorkItem, HistoryEntry, CreateProjectInput, UpdateProjectInput, ProjectListOptions, CreateWorkItemInput, UpdateWorkItemInput, QueryWorkItemsInput, CreateDocumentInput, UpdateDocumentInput, CreatePlanInput, UpdatePlanInput, ListPlansOptions, WorkItemQueryResult, ProjectListResult, BulkCreateItem, WorkItemComment, CreateCommentInput, UpdateCommentInput, IProjectRepository, IWorkItemRepository, IDocumentRepository, IPlanRepository, ICommentRepository, IAnchorService, IArtifactService, IEpisodeService, AnchorData, ArtifactType, ArtifactData, ArtifactSummaryData, WorkEpisode, ProjectWorkSummary, PlatformContext, PlatformToolsConfig, PlatformHooks, StepCriteria, } from './platform/index.js';
|
|
57
57
|
export { createSQLiteRepositories, SQLiteProjectRepository, SQLiteWorkItemRepository, SQLiteDocumentRepository, SQLitePlanRepository, SQLiteCommentRepository, getDatabase, closeDatabase, closeAllDatabases, databaseExists, SCHEMA_VERSION, SCHEMA_SQL, } from './platform/index.js';
|
|
58
58
|
export type { SQLiteRepositories, CreateSQLiteRepositoriesOptions, ProjectDeleteHooks, ProjectRecord, WorkItemRecord, ProjectDocumentRecord, WorkItemCommentRecord, } from './platform/index.js';
|
|
59
|
-
export { createAskUserTool, createAskUserSimpleTool, createProposeAlternativesTool } from './tools/index.js';
|
|
59
|
+
export { createAskUserTool, createAskUserSimpleTool, createProposeAlternativesTool, } from './tools/index.js';
|
|
60
60
|
export type { AskUserQuestion, AskUserInput, AskUserResult, AskUserHandler, AskUserSimpleInput, AskUserSimpleResult, AskUserSimpleHandler, Alternative, ProposeAlternativesInput, ProposeAlternativesResult, ProposeAlternativesHandler, } from './tools/index.js';
|
|
61
61
|
export { EntitlementCache, UNLIMITED, OFFLINE_FALLBACK_LIMITS, DailyCounter, formatLimitMessage, formatTimeUntilReset, formatUpgradeHint, } from './entitlements/index.js';
|
|
62
62
|
export type { TierLimits, EntitlementResponse, LimitCheckResult, IEntitlementStore, EntitlementCacheConfig, } from './entitlements/index.js';
|
|
@@ -74,7 +74,7 @@ export { PROJECT_TYPES, getProjectTypeConfig, getEnrichedProjectTypeConfig, getP
|
|
|
74
74
|
export type { ActionMeta, SkillMeta } from './project-types/index.js';
|
|
75
75
|
export type { ProjectTypeConfig, ProjectPhase, SuggestedAgent, DocumentTemplate, } from './project-types/index.js';
|
|
76
76
|
export { defineTool, createSuccessResult, createErrorResult, mergeHooks, createLoggingHooks, createClaudeProvider, createOpenAIProvider, createGeminiNativeProvider, createOllamaProvider, createTogetherProvider, createGroqProvider, createFireworksProvider, createPerplexityProvider, createOpenRouterProvider, createMockProvider, MockProvider, Agent, ContextManager, DEFAULT_CONTEXT_CONFIG, createTaskTool, createSuggestTool, defaultAgentTypes, TOOL_SETS, BUILTIN_GUARDRAILS, TOOL_NAMES, getDefaultShellManager, builtinSkills, AnchorManager, MCPManager, AgentError, ProviderError, ToolError, ToolTimeoutError, MaxIterationsError, AbortError, } from '@compilr-dev/agents';
|
|
77
|
-
export type { Tool, HooksConfig, AgentEvent, Message, LLMProvider, AnchorInput, ToolExecutionResult, AgentRunResult, PermissionHandler, 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';
|
|
77
|
+
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';
|
|
78
78
|
export { DEFAULT_PERMISSION_RULES, findMatchingRule, permissionModeLabel, permissionLevelLabel, } from './permissions.js';
|
|
79
79
|
export type { PermissionRule, PermissionMode, PermissionLevel } from './permissions.js';
|
|
80
80
|
export { readMCPConfigFile, writeMCPConfigFile, resolveServerEntry, loadMCPServers, saveMCPServerEntry, deleteMCPServerEntry, getServerNames, } from './mcp-config.js';
|
package/dist/index.js
CHANGED
|
@@ -131,7 +131,7 @@ export { createSQLiteRepositories, SQLiteProjectRepository, SQLiteWorkItemReposi
|
|
|
131
131
|
// =============================================================================
|
|
132
132
|
// User Interaction Tools (ask_user, ask_user_simple)
|
|
133
133
|
// =============================================================================
|
|
134
|
-
export { createAskUserTool, createAskUserSimpleTool, createProposeAlternativesTool } from './tools/index.js';
|
|
134
|
+
export { createAskUserTool, createAskUserSimpleTool, createProposeAlternativesTool, } from './tools/index.js';
|
|
135
135
|
// =============================================================================
|
|
136
136
|
// Entitlements (server-driven tier management)
|
|
137
137
|
// =============================================================================
|
|
@@ -106,8 +106,7 @@ export function createPlanTools(config, planModeCallbacks) {
|
|
|
106
106
|
execute: async (input) => {
|
|
107
107
|
try {
|
|
108
108
|
// Guard: prevent agent from self-approving plans during plan mode
|
|
109
|
-
if (input.status === 'approved' &&
|
|
110
|
-
planModeCallbacks?.isPlanModeActive?.()) {
|
|
109
|
+
if (input.status === 'approved' && planModeCallbacks?.isPlanModeActive?.()) {
|
|
111
110
|
return createErrorResult('Cannot set status to "approved" directly during plan mode. ' +
|
|
112
111
|
'Use plan_submit to submit your plan for user approval instead.');
|
|
113
112
|
}
|
package/dist/team/tool-config.js
CHANGED
|
@@ -148,7 +148,12 @@ export const TOOL_GROUPS = {
|
|
|
148
148
|
},
|
|
149
149
|
interaction: {
|
|
150
150
|
label: 'User Interaction',
|
|
151
|
-
tools: [
|
|
151
|
+
tools: [
|
|
152
|
+
TOOL_NAMES.ASK_USER,
|
|
153
|
+
TOOL_NAMES.ASK_USER_SIMPLE,
|
|
154
|
+
TOOL_NAMES.PROPOSE_ALTERNATIVES,
|
|
155
|
+
TOOL_NAMES.SUGGEST,
|
|
156
|
+
],
|
|
152
157
|
readOnly: true,
|
|
153
158
|
tier: 'direct',
|
|
154
159
|
},
|
|
@@ -26,7 +26,7 @@ export function createProposeAlternativesTool(handler) {
|
|
|
26
26
|
return defineTool({
|
|
27
27
|
name: 'propose_alternatives',
|
|
28
28
|
description: 'Present 2-3 alternatives for the user to compare and choose from. ' +
|
|
29
|
-
|
|
29
|
+
"Use when there are multiple valid approaches and the user's preference matters. " +
|
|
30
30
|
'Each alternative can include rich content (code, markdown, mermaid diagrams) for visual comparison. ' +
|
|
31
31
|
'Include pros and cons to help the user decide. The user picks one or provides feedback.',
|
|
32
32
|
inputSchema: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compilr-dev/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.24",
|
|
4
4
|
"description": "Universal agent runtime for building AI-powered applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,8 +12,11 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
15
|
+
"dist",
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"CHANGELOG.md"
|
|
16
18
|
],
|
|
19
|
+
"sideEffects": false,
|
|
17
20
|
"scripts": {
|
|
18
21
|
"build": "tsc",
|
|
19
22
|
"clean": "rm -rf dist",
|
|
@@ -50,10 +53,10 @@
|
|
|
50
53
|
},
|
|
51
54
|
"homepage": "https://github.com/compilr-dev/sdk#readme",
|
|
52
55
|
"engines": {
|
|
53
|
-
"node": ">=
|
|
56
|
+
"node": ">=20.0.0"
|
|
54
57
|
},
|
|
55
58
|
"dependencies": {
|
|
56
|
-
"@compilr-dev/agents": "^0.5.
|
|
59
|
+
"@compilr-dev/agents": "^0.5.7",
|
|
57
60
|
"@compilr-dev/logger": "^0.1.0",
|
|
58
61
|
"ajv": "^6.14.0"
|
|
59
62
|
},
|