@compilr-dev/sdk 0.1.16 → 0.1.17
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/platform/tools/anchor-tools.js +3 -8
- package/dist/platform/tools/artifact-tools.js +4 -5
- package/dist/platform/tools/backlog-tools.js +4 -7
- package/dist/platform/tools/document-tools.js +5 -5
- package/dist/platform/tools/episode-tools.js +3 -5
- package/dist/platform/tools/plan-tools.js +13 -10
- package/dist/platform/tools/project-tools.js +11 -9
- package/dist/platform/tools/workitem-tools.js +26 -31
- package/dist/system-prompt/index.d.ts +1 -1
- package/dist/system-prompt/index.js +1 -1
- package/dist/system-prompt/modules.d.ts +5 -0
- package/dist/system-prompt/modules.js +19 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export { type ModelTier, type TierInfo, type ProviderModelMap, MODEL_TIERS, TIER
|
|
|
45
45
|
export { assembleTools, deduplicateTools } from './tools.js';
|
|
46
46
|
export { MetaToolsRegistry, createMetaTools, META_TOOLS_SYSTEM_PROMPT_PREFIX, } from './meta-tools/index.js';
|
|
47
47
|
export type { MetaToolStats, MetaTools } from './meta-tools/index.js';
|
|
48
|
-
export { SystemPromptBuilder, buildSystemPrompt, detectGitRepository, getModuleStats, ALL_MODULES, IDENTITY_MODULE, STYLE_MODULE, TASK_EXECUTION_MODULE, TODO_MANAGEMENT_MODULE, TOOL_USAGE_DIRECT_MODULE, TOOL_USAGE_HINTS_MODULE, TOOL_USAGE_META_MODULE, DELEGATION_MODULE, GIT_SAFETY_MODULE, SUGGEST_MODULE, IMPORTANT_RULES_MODULE, ENVIRONMENT_MODULE, shouldIncludeModule, getEstimatedTokensForConditions, getTotalEstimatedTokens, } from './system-prompt/index.js';
|
|
48
|
+
export { SystemPromptBuilder, buildSystemPrompt, detectGitRepository, getModuleStats, ALL_MODULES, IDENTITY_MODULE, STYLE_MODULE, TASK_EXECUTION_MODULE, TODO_MANAGEMENT_MODULE, TOOL_USAGE_DIRECT_MODULE, TOOL_USAGE_HINTS_MODULE, PLATFORM_TOOL_HINTS_MODULE, TOOL_USAGE_META_MODULE, DELEGATION_MODULE, GIT_SAFETY_MODULE, SUGGEST_MODULE, IMPORTANT_RULES_MODULE, ENVIRONMENT_MODULE, shouldIncludeModule, getEstimatedTokensForConditions, getTotalEstimatedTokens, } from './system-prompt/index.js';
|
|
49
49
|
export type { SystemPromptContext, BuildResult, SystemPromptModule, ModuleConditions, } from './system-prompt/index.js';
|
|
50
50
|
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, IProjectRepository, IWorkItemRepository, IDocumentRepository, IPlanRepository, IAnchorService, IArtifactService, IEpisodeService, AnchorData, ArtifactType, ArtifactData, ArtifactSummaryData, WorkEpisode, ProjectWorkSummary, PlatformContext, PlatformToolsConfig, PlatformHooks, StepCriteria, } from './platform/index.js';
|
|
51
51
|
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, } from './platform/index.js';
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ export {
|
|
|
71
71
|
// Builder
|
|
72
72
|
SystemPromptBuilder, buildSystemPrompt, detectGitRepository, getModuleStats,
|
|
73
73
|
// Module constants
|
|
74
|
-
ALL_MODULES, IDENTITY_MODULE, STYLE_MODULE, TASK_EXECUTION_MODULE, TODO_MANAGEMENT_MODULE, TOOL_USAGE_DIRECT_MODULE, TOOL_USAGE_HINTS_MODULE, TOOL_USAGE_META_MODULE, DELEGATION_MODULE, GIT_SAFETY_MODULE, SUGGEST_MODULE, IMPORTANT_RULES_MODULE, ENVIRONMENT_MODULE,
|
|
74
|
+
ALL_MODULES, IDENTITY_MODULE, STYLE_MODULE, TASK_EXECUTION_MODULE, TODO_MANAGEMENT_MODULE, TOOL_USAGE_DIRECT_MODULE, TOOL_USAGE_HINTS_MODULE, PLATFORM_TOOL_HINTS_MODULE, TOOL_USAGE_META_MODULE, DELEGATION_MODULE, GIT_SAFETY_MODULE, SUGGEST_MODULE, IMPORTANT_RULES_MODULE, ENVIRONMENT_MODULE,
|
|
75
75
|
// Module utilities
|
|
76
76
|
shouldIncludeModule, getEstimatedTokensForConditions, getTotalEstimatedTokens, } from './system-prompt/index.js';
|
|
77
77
|
// =============================================================================
|
|
@@ -18,10 +18,7 @@ export function createAnchorTools(config) {
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
const anchorAddTool = defineTool({
|
|
20
20
|
name: 'anchor_add',
|
|
21
|
-
description: 'Add critical
|
|
22
|
-
'Use this for: project context, important decisions, user preferences, ' +
|
|
23
|
-
'architectural constraints, or any information that should persist across the entire conversation. ' +
|
|
24
|
-
'Anchors are always included at the top of the context window.',
|
|
21
|
+
description: 'Add critical info that survives context compaction. Always included at top of context.',
|
|
25
22
|
inputSchema: {
|
|
26
23
|
type: 'object',
|
|
27
24
|
properties: {
|
|
@@ -32,14 +29,12 @@ export function createAnchorTools(config) {
|
|
|
32
29
|
priority: {
|
|
33
30
|
type: 'string',
|
|
34
31
|
enum: ['critical', 'safety', 'info'],
|
|
35
|
-
description: 'Priority
|
|
36
|
-
'"safety" for safety-related context, "info" for general helpful context.',
|
|
32
|
+
description: 'Priority: critical (must-never-forget), safety, or info',
|
|
37
33
|
},
|
|
38
34
|
scope: {
|
|
39
35
|
type: 'string',
|
|
40
36
|
enum: ['global', 'project'],
|
|
41
|
-
description: 'Scope
|
|
42
|
-
'"project" is specific to the current project (requires active project).',
|
|
37
|
+
description: 'Scope: global (all projects) or project (current only)',
|
|
43
38
|
},
|
|
44
39
|
tags: {
|
|
45
40
|
type: 'array',
|
|
@@ -18,23 +18,22 @@ export function createArtifactTools(config) {
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
const artifactSaveTool = defineTool({
|
|
20
20
|
name: 'artifact_save',
|
|
21
|
-
description: 'Save
|
|
22
|
-
'Types: design (architecture/API specs), plan (task breakdowns), review (code reviews), decision (architectural decisions), note (general notes).',
|
|
21
|
+
description: 'Save or update a named artifact that can be referenced by other agents.',
|
|
23
22
|
inputSchema: {
|
|
24
23
|
type: 'object',
|
|
25
24
|
properties: {
|
|
26
25
|
name: {
|
|
27
26
|
type: 'string',
|
|
28
|
-
description: 'Artifact name (
|
|
27
|
+
description: 'Artifact name (unique within team)',
|
|
29
28
|
},
|
|
30
29
|
type: {
|
|
31
30
|
type: 'string',
|
|
32
31
|
enum: ['design', 'plan', 'review', 'decision', 'note'],
|
|
33
|
-
description: 'Artifact type
|
|
32
|
+
description: 'Artifact type',
|
|
34
33
|
},
|
|
35
34
|
content: {
|
|
36
35
|
type: 'string',
|
|
37
|
-
description: '
|
|
36
|
+
description: 'Content (markdown)',
|
|
38
37
|
},
|
|
39
38
|
summary: {
|
|
40
39
|
type: 'string',
|
|
@@ -52,9 +52,7 @@ export function createBacklogTools(config) {
|
|
|
52
52
|
// ---------------------------------------------------------------------------
|
|
53
53
|
const backlogReadTool = defineTool({
|
|
54
54
|
name: 'backlog_read',
|
|
55
|
-
description: 'Read backlog items
|
|
56
|
-
'Use filters to narrow results. Use id parameter to get a specific item. ' +
|
|
57
|
-
'Returns items sorted by priority (critical first) then by creation date.',
|
|
55
|
+
description: 'Read backlog items sorted by priority. Use id for a specific item.',
|
|
58
56
|
inputSchema: {
|
|
59
57
|
type: 'object',
|
|
60
58
|
properties: {
|
|
@@ -83,7 +81,8 @@ export function createBacklogTools(config) {
|
|
|
83
81
|
},
|
|
84
82
|
limit: {
|
|
85
83
|
type: 'number',
|
|
86
|
-
description: '
|
|
84
|
+
description: 'Max items to return',
|
|
85
|
+
default: 20,
|
|
87
86
|
},
|
|
88
87
|
},
|
|
89
88
|
required: [],
|
|
@@ -157,9 +156,7 @@ export function createBacklogTools(config) {
|
|
|
157
156
|
// ---------------------------------------------------------------------------
|
|
158
157
|
const backlogWriteTool = defineTool({
|
|
159
158
|
name: 'backlog_write',
|
|
160
|
-
description: 'Create, update, or
|
|
161
|
-
'Actions: add (new item), update (modify existing), delete (remove), replace (full list). ' +
|
|
162
|
-
'IDs are auto-generated for new items based on type (e.g., FEAT-001, BUG-002).',
|
|
159
|
+
description: 'Create, update, delete, or replace backlog items. IDs auto-generated.',
|
|
163
160
|
inputSchema: {
|
|
164
161
|
type: 'object',
|
|
165
162
|
properties: {
|
|
@@ -15,7 +15,7 @@ export function createDocumentTools(config) {
|
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
16
16
|
const projectDocumentAddTool = defineTool({
|
|
17
17
|
name: 'project_document_add',
|
|
18
|
-
description: 'Add or update a project document
|
|
18
|
+
description: 'Add or update a project document. Upserts if same type exists.',
|
|
19
19
|
inputSchema: {
|
|
20
20
|
type: 'object',
|
|
21
21
|
properties: {
|
|
@@ -34,7 +34,7 @@ export function createDocumentTools(config) {
|
|
|
34
34
|
},
|
|
35
35
|
project_id: {
|
|
36
36
|
type: 'number',
|
|
37
|
-
description: '
|
|
37
|
+
description: 'Override active project.',
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
required: ['doc_type', 'title', 'content'],
|
|
@@ -85,7 +85,7 @@ export function createDocumentTools(config) {
|
|
|
85
85
|
},
|
|
86
86
|
project_id: {
|
|
87
87
|
type: 'number',
|
|
88
|
-
description: '
|
|
88
|
+
description: 'Override active project.',
|
|
89
89
|
},
|
|
90
90
|
},
|
|
91
91
|
required: ['doc_type'],
|
|
@@ -132,7 +132,7 @@ export function createDocumentTools(config) {
|
|
|
132
132
|
properties: {
|
|
133
133
|
project_id: {
|
|
134
134
|
type: 'number',
|
|
135
|
-
description: '
|
|
135
|
+
description: 'Override active project.',
|
|
136
136
|
},
|
|
137
137
|
},
|
|
138
138
|
required: [],
|
|
@@ -179,7 +179,7 @@ export function createDocumentTools(config) {
|
|
|
179
179
|
},
|
|
180
180
|
project_id: {
|
|
181
181
|
type: 'number',
|
|
182
|
-
description: '
|
|
182
|
+
description: 'Override active project.',
|
|
183
183
|
},
|
|
184
184
|
},
|
|
185
185
|
required: ['doc_type'],
|
|
@@ -18,10 +18,7 @@ export function createEpisodeTools(config) {
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
const recallWorkTool = defineTool({
|
|
20
20
|
name: 'recall_work',
|
|
21
|
-
description: 'Query work history
|
|
22
|
-
'Returns episodes with agent attribution, effort level, and affected files. ' +
|
|
23
|
-
'Use before destructive operations to check what work would be affected. ' +
|
|
24
|
-
'Use to understand what has been done in this session or by other agents.',
|
|
21
|
+
description: 'Query work history episodes with agent attribution and affected files.',
|
|
25
22
|
inputSchema: {
|
|
26
23
|
type: 'object',
|
|
27
24
|
properties: {
|
|
@@ -40,7 +37,8 @@ export function createEpisodeTools(config) {
|
|
|
40
37
|
},
|
|
41
38
|
recent: {
|
|
42
39
|
type: 'number',
|
|
43
|
-
description: '
|
|
40
|
+
description: 'Most recent episodes to return',
|
|
41
|
+
default: 20,
|
|
44
42
|
},
|
|
45
43
|
},
|
|
46
44
|
},
|
|
@@ -14,17 +14,17 @@ export function createPlanTools(config) {
|
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
15
15
|
const planCreateTool = defineTool({
|
|
16
16
|
name: 'plan_create',
|
|
17
|
-
description: 'Create a new plan for the
|
|
17
|
+
description: 'Create a new plan for the project. Created with "draft" status.',
|
|
18
18
|
inputSchema: {
|
|
19
19
|
type: 'object',
|
|
20
20
|
properties: {
|
|
21
21
|
name: {
|
|
22
22
|
type: 'string',
|
|
23
|
-
description: 'Plan name (kebab-case
|
|
23
|
+
description: 'Plan name (kebab-case)',
|
|
24
24
|
},
|
|
25
25
|
content: {
|
|
26
26
|
type: 'string',
|
|
27
|
-
description: 'Plan content
|
|
27
|
+
description: 'Plan content (markdown)',
|
|
28
28
|
},
|
|
29
29
|
work_item_id: {
|
|
30
30
|
type: 'number',
|
|
@@ -32,7 +32,7 @@ export function createPlanTools(config) {
|
|
|
32
32
|
},
|
|
33
33
|
project_id: {
|
|
34
34
|
type: 'number',
|
|
35
|
-
description: '
|
|
35
|
+
description: 'Override active project.',
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
required: ['name', 'content'],
|
|
@@ -78,7 +78,7 @@ export function createPlanTools(config) {
|
|
|
78
78
|
// ---------------------------------------------------------------------------
|
|
79
79
|
const planUpdateTool = defineTool({
|
|
80
80
|
name: 'plan_update',
|
|
81
|
-
description: 'Update
|
|
81
|
+
description: 'Update plan content, status, or work item link.',
|
|
82
82
|
inputSchema: {
|
|
83
83
|
type: 'object',
|
|
84
84
|
properties: {
|
|
@@ -154,7 +154,7 @@ export function createPlanTools(config) {
|
|
|
154
154
|
},
|
|
155
155
|
project_id: {
|
|
156
156
|
type: 'number',
|
|
157
|
-
description: '
|
|
157
|
+
description: 'Override active project (required for name lookup).',
|
|
158
158
|
},
|
|
159
159
|
},
|
|
160
160
|
required: [],
|
|
@@ -223,7 +223,8 @@ export function createPlanTools(config) {
|
|
|
223
223
|
status: {
|
|
224
224
|
type: 'string',
|
|
225
225
|
enum: ['draft', 'approved', 'in_progress', 'completed', 'abandoned', 'all'],
|
|
226
|
-
description: 'Filter by status
|
|
226
|
+
description: 'Filter by status',
|
|
227
|
+
default: 'all',
|
|
227
228
|
},
|
|
228
229
|
work_item_id: {
|
|
229
230
|
type: 'number',
|
|
@@ -231,16 +232,18 @@ export function createPlanTools(config) {
|
|
|
231
232
|
},
|
|
232
233
|
limit: {
|
|
233
234
|
type: 'number',
|
|
234
|
-
description: '
|
|
235
|
+
description: 'Max plans to return',
|
|
236
|
+
default: 20,
|
|
235
237
|
},
|
|
236
238
|
order_by: {
|
|
237
239
|
type: 'string',
|
|
238
240
|
enum: ['updated_desc', 'updated_asc', 'created_desc', 'name_asc'],
|
|
239
|
-
description: 'Sort order
|
|
241
|
+
description: 'Sort order',
|
|
242
|
+
default: 'updated_desc',
|
|
240
243
|
},
|
|
241
244
|
project_id: {
|
|
242
245
|
type: 'number',
|
|
243
|
-
description: '
|
|
246
|
+
description: 'Override active project.',
|
|
244
247
|
},
|
|
245
248
|
},
|
|
246
249
|
required: [],
|
|
@@ -19,14 +19,13 @@ export function createProjectTools(config) {
|
|
|
19
19
|
// ---------------------------------------------------------------------------
|
|
20
20
|
const projectGetTool = defineTool({
|
|
21
21
|
name: 'project_get',
|
|
22
|
-
description: 'Get
|
|
23
|
-
'Returns project details including metadata, workflow state, and last context.',
|
|
22
|
+
description: 'Get active project or look up by ID/name/path.',
|
|
24
23
|
inputSchema: {
|
|
25
24
|
type: 'object',
|
|
26
25
|
properties: {
|
|
27
26
|
project_id: {
|
|
28
27
|
type: 'number',
|
|
29
|
-
description: 'Project ID to look up
|
|
28
|
+
description: 'Project ID to look up',
|
|
30
29
|
},
|
|
31
30
|
name: {
|
|
32
31
|
type: 'string',
|
|
@@ -113,7 +112,7 @@ export function createProjectTools(config) {
|
|
|
113
112
|
// ---------------------------------------------------------------------------
|
|
114
113
|
const projectCreateTool = defineTool({
|
|
115
114
|
name: 'project_create',
|
|
116
|
-
description: 'Create a new tracked project
|
|
115
|
+
description: 'Create a new tracked project with workflow support.',
|
|
117
116
|
inputSchema: {
|
|
118
117
|
type: 'object',
|
|
119
118
|
properties: {
|
|
@@ -141,7 +140,8 @@ export function createProjectTools(config) {
|
|
|
141
140
|
workflow_mode: {
|
|
142
141
|
type: 'string',
|
|
143
142
|
enum: ['flexible', 'guided'],
|
|
144
|
-
description: 'Workflow mode
|
|
143
|
+
description: 'Workflow mode',
|
|
144
|
+
default: 'flexible',
|
|
145
145
|
},
|
|
146
146
|
language: {
|
|
147
147
|
type: 'string',
|
|
@@ -219,13 +219,13 @@ export function createProjectTools(config) {
|
|
|
219
219
|
// ---------------------------------------------------------------------------
|
|
220
220
|
const projectUpdateTool = defineTool({
|
|
221
221
|
name: 'project_update',
|
|
222
|
-
description: 'Update an existing project.
|
|
222
|
+
description: 'Update an existing project.',
|
|
223
223
|
inputSchema: {
|
|
224
224
|
type: 'object',
|
|
225
225
|
properties: {
|
|
226
226
|
project_id: {
|
|
227
227
|
type: 'number',
|
|
228
|
-
description: '
|
|
228
|
+
description: 'Override active project.',
|
|
229
229
|
},
|
|
230
230
|
status: {
|
|
231
231
|
type: 'string',
|
|
@@ -325,11 +325,13 @@ export function createProjectTools(config) {
|
|
|
325
325
|
status: {
|
|
326
326
|
type: 'string',
|
|
327
327
|
enum: ['active', 'paused', 'completed', 'archived', 'all'],
|
|
328
|
-
description: 'Filter by status
|
|
328
|
+
description: 'Filter by status',
|
|
329
|
+
default: 'all',
|
|
329
330
|
},
|
|
330
331
|
limit: {
|
|
331
332
|
type: 'number',
|
|
332
|
-
description: '
|
|
333
|
+
description: 'Max results',
|
|
334
|
+
default: 20,
|
|
333
335
|
},
|
|
334
336
|
},
|
|
335
337
|
required: [],
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - workitem_advance_step imports from ../workflow.js (SDK's module)
|
|
13
13
|
*/
|
|
14
14
|
import { defineTool, createSuccessResult, createErrorResult } from '@compilr-dev/agents';
|
|
15
|
-
import { getNextStep, isValidTransition, getStepCriteria, formatStepDisplay
|
|
15
|
+
import { getNextStep, isValidTransition, getStepCriteria, formatStepDisplay } from '../workflow.js';
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
17
17
|
export function createWorkItemTools(config) {
|
|
18
18
|
const { context: ctx, hooks } = config;
|
|
@@ -21,16 +21,15 @@ export function createWorkItemTools(config) {
|
|
|
21
21
|
// ---------------------------------------------------------------------------
|
|
22
22
|
const workitemQueryTool = defineTool({
|
|
23
23
|
name: 'workitem_query',
|
|
24
|
-
description: 'Query
|
|
25
|
-
'For session todos shown in footer, use todo_read. ' +
|
|
26
|
-
'Supports filtering by status, type, priority, owner, and search.',
|
|
24
|
+
description: 'Query work items from the project backlog. Supports filtering by status, type, priority, owner, and search.',
|
|
27
25
|
inputSchema: {
|
|
28
26
|
type: 'object',
|
|
29
27
|
properties: {
|
|
30
28
|
status: {
|
|
31
29
|
type: 'string',
|
|
32
30
|
enum: ['backlog', 'in_progress', 'completed', 'skipped', 'all'],
|
|
33
|
-
description: 'Filter by status
|
|
31
|
+
description: 'Filter by status',
|
|
32
|
+
default: 'all',
|
|
34
33
|
},
|
|
35
34
|
type: {
|
|
36
35
|
type: 'string',
|
|
@@ -52,15 +51,17 @@ export function createWorkItemTools(config) {
|
|
|
52
51
|
},
|
|
53
52
|
limit: {
|
|
54
53
|
type: 'number',
|
|
55
|
-
description: '
|
|
54
|
+
description: 'Max items to return',
|
|
55
|
+
default: 50,
|
|
56
56
|
},
|
|
57
57
|
offset: {
|
|
58
58
|
type: 'number',
|
|
59
|
-
description: '
|
|
59
|
+
description: 'Pagination offset',
|
|
60
|
+
default: 0,
|
|
60
61
|
},
|
|
61
62
|
project_id: {
|
|
62
63
|
type: 'number',
|
|
63
|
-
description: '
|
|
64
|
+
description: 'Override active project.',
|
|
64
65
|
},
|
|
65
66
|
},
|
|
66
67
|
required: [],
|
|
@@ -120,8 +121,7 @@ export function createWorkItemTools(config) {
|
|
|
120
121
|
// ---------------------------------------------------------------------------
|
|
121
122
|
const workitemAddTool = defineTool({
|
|
122
123
|
name: 'workitem_add',
|
|
123
|
-
description: 'Add a
|
|
124
|
-
'For session-level tasks shown in footer, use todo_write.',
|
|
124
|
+
description: 'Add a work item to the project backlog.',
|
|
125
125
|
inputSchema: {
|
|
126
126
|
type: 'object',
|
|
127
127
|
properties: {
|
|
@@ -141,7 +141,8 @@ export function createWorkItemTools(config) {
|
|
|
141
141
|
priority: {
|
|
142
142
|
type: 'string',
|
|
143
143
|
enum: ['critical', 'high', 'medium', 'low'],
|
|
144
|
-
description: 'Priority
|
|
144
|
+
description: 'Priority',
|
|
145
|
+
default: 'medium',
|
|
145
146
|
},
|
|
146
147
|
estimated_effort: {
|
|
147
148
|
type: 'string',
|
|
@@ -154,7 +155,7 @@ export function createWorkItemTools(config) {
|
|
|
154
155
|
},
|
|
155
156
|
project_id: {
|
|
156
157
|
type: 'number',
|
|
157
|
-
description: '
|
|
158
|
+
description: 'Override active project.',
|
|
158
159
|
},
|
|
159
160
|
},
|
|
160
161
|
required: ['type', 'title'],
|
|
@@ -199,8 +200,7 @@ export function createWorkItemTools(config) {
|
|
|
199
200
|
// ---------------------------------------------------------------------------
|
|
200
201
|
const workitemUpdateTool = defineTool({
|
|
201
202
|
name: 'workitem_update',
|
|
202
|
-
description: 'Update a
|
|
203
|
-
'Can update status, priority, owner, title, description, and more.',
|
|
203
|
+
description: 'Update a work item in the project backlog.',
|
|
204
204
|
inputSchema: {
|
|
205
205
|
type: 'object',
|
|
206
206
|
properties: {
|
|
@@ -210,7 +210,7 @@ export function createWorkItemTools(config) {
|
|
|
210
210
|
},
|
|
211
211
|
project_id: {
|
|
212
212
|
type: 'number',
|
|
213
|
-
description: '
|
|
213
|
+
description: 'Override active project.',
|
|
214
214
|
},
|
|
215
215
|
status: {
|
|
216
216
|
type: 'string',
|
|
@@ -311,7 +311,7 @@ export function createWorkItemTools(config) {
|
|
|
311
311
|
// ---------------------------------------------------------------------------
|
|
312
312
|
const workitemNextTool = defineTool({
|
|
313
313
|
name: 'workitem_next',
|
|
314
|
-
description: 'Get the next
|
|
314
|
+
description: 'Get the next highest-priority backlog item to work on.',
|
|
315
315
|
inputSchema: {
|
|
316
316
|
type: 'object',
|
|
317
317
|
properties: {
|
|
@@ -322,7 +322,7 @@ export function createWorkItemTools(config) {
|
|
|
322
322
|
},
|
|
323
323
|
project_id: {
|
|
324
324
|
type: 'number',
|
|
325
|
-
description: '
|
|
325
|
+
description: 'Override active project.',
|
|
326
326
|
},
|
|
327
327
|
},
|
|
328
328
|
required: [],
|
|
@@ -376,7 +376,7 @@ export function createWorkItemTools(config) {
|
|
|
376
376
|
},
|
|
377
377
|
project_id: {
|
|
378
378
|
type: 'number',
|
|
379
|
-
description: '
|
|
379
|
+
description: 'Override active project.',
|
|
380
380
|
},
|
|
381
381
|
},
|
|
382
382
|
required: ['item_id'],
|
|
@@ -410,13 +410,13 @@ export function createWorkItemTools(config) {
|
|
|
410
410
|
// ---------------------------------------------------------------------------
|
|
411
411
|
const workitemStatusCountsTool = defineTool({
|
|
412
412
|
name: 'workitem_status_counts',
|
|
413
|
-
description: 'Get
|
|
413
|
+
description: 'Get work item counts by status for progress tracking.',
|
|
414
414
|
inputSchema: {
|
|
415
415
|
type: 'object',
|
|
416
416
|
properties: {
|
|
417
417
|
project_id: {
|
|
418
418
|
type: 'number',
|
|
419
|
-
description: '
|
|
419
|
+
description: 'Override active project.',
|
|
420
420
|
},
|
|
421
421
|
},
|
|
422
422
|
required: [],
|
|
@@ -448,10 +448,7 @@ export function createWorkItemTools(config) {
|
|
|
448
448
|
// ---------------------------------------------------------------------------
|
|
449
449
|
const workitemAdvanceStepTool = defineTool({
|
|
450
450
|
name: 'workitem_advance_step',
|
|
451
|
-
description:
|
|
452
|
-
`Steps progress in order: ${STEP_ORDER.join(' → ')} → complete.\n` +
|
|
453
|
-
`Use this tool when the criteria for the current step are met.\n` +
|
|
454
|
-
`The agent should explicitly call this to advance - it provides visibility and audit trail.`,
|
|
451
|
+
description: 'Advance a work item to the next guided workflow step. Call when step criteria are met.',
|
|
455
452
|
inputSchema: {
|
|
456
453
|
type: 'object',
|
|
457
454
|
properties: {
|
|
@@ -469,7 +466,7 @@ export function createWorkItemTools(config) {
|
|
|
469
466
|
},
|
|
470
467
|
project_id: {
|
|
471
468
|
type: 'number',
|
|
472
|
-
description: '
|
|
469
|
+
description: 'Override active project.',
|
|
473
470
|
},
|
|
474
471
|
},
|
|
475
472
|
required: ['item_id', 'reason'],
|
|
@@ -576,8 +573,7 @@ export function createWorkItemTools(config) {
|
|
|
576
573
|
// ---------------------------------------------------------------------------
|
|
577
574
|
const workitemClaimTool = defineTool({
|
|
578
575
|
name: 'workitem_claim',
|
|
579
|
-
description: 'Claim an unassigned
|
|
580
|
-
'For session todos in footer, use todo_claim.',
|
|
576
|
+
description: 'Claim an unassigned work item from the project backlog.',
|
|
581
577
|
inputSchema: {
|
|
582
578
|
type: 'object',
|
|
583
579
|
properties: {
|
|
@@ -591,7 +587,7 @@ export function createWorkItemTools(config) {
|
|
|
591
587
|
},
|
|
592
588
|
project_id: {
|
|
593
589
|
type: 'number',
|
|
594
|
-
description: '
|
|
590
|
+
description: 'Override active project.',
|
|
595
591
|
},
|
|
596
592
|
},
|
|
597
593
|
required: ['item_id', 'agent_id'],
|
|
@@ -639,8 +635,7 @@ export function createWorkItemTools(config) {
|
|
|
639
635
|
// ---------------------------------------------------------------------------
|
|
640
636
|
const workitemHandoffTool = defineTool({
|
|
641
637
|
name: 'workitem_handoff',
|
|
642
|
-
description: 'Hand off a
|
|
643
|
-
'For session todos in footer, use todo_handoff.',
|
|
638
|
+
description: 'Hand off a work item to another agent.',
|
|
644
639
|
inputSchema: {
|
|
645
640
|
type: 'object',
|
|
646
641
|
properties: {
|
|
@@ -658,7 +653,7 @@ export function createWorkItemTools(config) {
|
|
|
658
653
|
},
|
|
659
654
|
project_id: {
|
|
660
655
|
type: 'number',
|
|
661
|
-
description: '
|
|
656
|
+
description: 'Override active project.',
|
|
662
657
|
},
|
|
663
658
|
},
|
|
664
659
|
required: ['item_id', 'to_agent_id'],
|
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export { SystemPromptBuilder, buildSystemPrompt, detectGitRepository, getModuleStats, type SystemPromptContext, type BuildResult, } from './builder.js';
|
|
34
|
-
export { ALL_MODULES, IDENTITY_MODULE, STYLE_MODULE, TASK_EXECUTION_MODULE, TODO_MANAGEMENT_MODULE, TOOL_USAGE_DIRECT_MODULE, TOOL_USAGE_HINTS_MODULE, TOOL_USAGE_META_MODULE, DELEGATION_MODULE, GIT_SAFETY_MODULE, SUGGEST_MODULE, IMPORTANT_RULES_MODULE, ENVIRONMENT_MODULE, shouldIncludeModule, getEstimatedTokensForConditions, getTotalEstimatedTokens, type SystemPromptModule, type ModuleConditions, } from './modules.js';
|
|
34
|
+
export { ALL_MODULES, IDENTITY_MODULE, STYLE_MODULE, TASK_EXECUTION_MODULE, TODO_MANAGEMENT_MODULE, TOOL_USAGE_DIRECT_MODULE, TOOL_USAGE_HINTS_MODULE, PLATFORM_TOOL_HINTS_MODULE, TOOL_USAGE_META_MODULE, DELEGATION_MODULE, GIT_SAFETY_MODULE, SUGGEST_MODULE, IMPORTANT_RULES_MODULE, ENVIRONMENT_MODULE, shouldIncludeModule, getEstimatedTokensForConditions, getTotalEstimatedTokens, type SystemPromptModule, type ModuleConditions, } from './modules.js';
|
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export { SystemPromptBuilder, buildSystemPrompt, detectGitRepository, getModuleStats, } from './builder.js';
|
|
34
|
-
export { ALL_MODULES, IDENTITY_MODULE, STYLE_MODULE, TASK_EXECUTION_MODULE, TODO_MANAGEMENT_MODULE, TOOL_USAGE_DIRECT_MODULE, TOOL_USAGE_HINTS_MODULE, TOOL_USAGE_META_MODULE, DELEGATION_MODULE, GIT_SAFETY_MODULE, SUGGEST_MODULE, IMPORTANT_RULES_MODULE, ENVIRONMENT_MODULE, shouldIncludeModule, getEstimatedTokensForConditions, getTotalEstimatedTokens, } from './modules.js';
|
|
34
|
+
export { ALL_MODULES, IDENTITY_MODULE, STYLE_MODULE, TASK_EXECUTION_MODULE, TODO_MANAGEMENT_MODULE, TOOL_USAGE_DIRECT_MODULE, TOOL_USAGE_HINTS_MODULE, PLATFORM_TOOL_HINTS_MODULE, TOOL_USAGE_META_MODULE, DELEGATION_MODULE, GIT_SAFETY_MODULE, SUGGEST_MODULE, IMPORTANT_RULES_MODULE, ENVIRONMENT_MODULE, shouldIncludeModule, getEstimatedTokensForConditions, getTotalEstimatedTokens, } from './modules.js';
|
|
@@ -69,6 +69,11 @@ export declare const TOOL_USAGE_DIRECT_MODULE: SystemPromptModule;
|
|
|
69
69
|
* disambiguation, file pagination, edit matching, suggest quality.
|
|
70
70
|
*/
|
|
71
71
|
export declare const TOOL_USAGE_HINTS_MODULE: SystemPromptModule;
|
|
72
|
+
/**
|
|
73
|
+
* Platform tool hints module - behavioral guidance extracted from tool descriptions
|
|
74
|
+
* Only included when meta-tools are enabled
|
|
75
|
+
*/
|
|
76
|
+
export declare const PLATFORM_TOOL_HINTS_MODULE: SystemPromptModule;
|
|
72
77
|
/**
|
|
73
78
|
* Tool usage module (meta-tools) - only if enableMetaTools=true
|
|
74
79
|
* Explains how to use specialized tools via meta-tools
|
|
@@ -161,6 +161,24 @@ export const TOOL_USAGE_HINTS_MODULE = {
|
|
|
161
161
|
- **edit matching:** \`edit\` uses exact string matching. Provide enough surrounding context to make the match unique. If the match fails, read the file first to get the exact text.
|
|
162
162
|
- **suggest quality:** Suggestions should be specific and actionable (e.g., "run npm test" not "continue working").`,
|
|
163
163
|
};
|
|
164
|
+
/**
|
|
165
|
+
* Platform tool hints module - behavioral guidance extracted from tool descriptions
|
|
166
|
+
* Only included when meta-tools are enabled
|
|
167
|
+
*/
|
|
168
|
+
export const PLATFORM_TOOL_HINTS_MODULE = {
|
|
169
|
+
id: 'platform-tool-hints',
|
|
170
|
+
name: 'Platform Tool Hints',
|
|
171
|
+
estimatedTokens: 120,
|
|
172
|
+
conditions: { enableMetaTools: true },
|
|
173
|
+
content: `## Platform Tool Hints
|
|
174
|
+
|
|
175
|
+
- **workitem_* vs todo_***: workitem_* tools manage PERSISTENT backlog items (database). todo_* tools manage ephemeral session tasks (footer display). Use workitem_claim/workitem_handoff for persistent ownership, todo_claim/todo_handoff for session tasks.
|
|
176
|
+
- **project_id**: All project/workitem/document/plan tools default to the active project. Only pass project_id to target a different project.
|
|
177
|
+
- **Plan status flow**: draft → approved → in_progress → completed. Any → abandoned. abandoned → draft.
|
|
178
|
+
- **Anchors**: Use "critical" priority sparingly (user prefs, safety constraints). Most anchors should be "info" priority with "project" scope.
|
|
179
|
+
- **Artifacts**: Types: design, plan, review, decision, note. Names must be unique within team.
|
|
180
|
+
- **recall_work**: Check before destructive ops to see what work would be affected.`,
|
|
181
|
+
};
|
|
164
182
|
/**
|
|
165
183
|
* Tool usage module (meta-tools) - only if enableMetaTools=true
|
|
166
184
|
* Explains how to use specialized tools via meta-tools
|
|
@@ -313,6 +331,7 @@ export const ALL_MODULES = [
|
|
|
313
331
|
TODO_MANAGEMENT_MODULE,
|
|
314
332
|
TOOL_USAGE_DIRECT_MODULE,
|
|
315
333
|
TOOL_USAGE_HINTS_MODULE,
|
|
334
|
+
PLATFORM_TOOL_HINTS_MODULE, // Conditional: enableMetaTools
|
|
316
335
|
TOOL_USAGE_META_MODULE, // Conditional: enableMetaTools
|
|
317
336
|
DELEGATION_MODULE,
|
|
318
337
|
GIT_SAFETY_MODULE, // Conditional: hasGit
|