@compilr-dev/sdk 0.7.11 → 0.7.12
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/platform/repositories.d.ts +1 -1
- package/dist/platform/sqlite/document-repository.d.ts +1 -1
- package/dist/platform/sqlite/document-repository.js +1 -13
- package/dist/platform/tools/document-tools.js +15 -12
- package/dist/platform/types.d.ts +1 -1
- package/dist/system-prompt/modules.js +8 -4
- package/dist/team/tool-config.js +3 -3
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@ export interface IDocumentRepository {
|
|
|
44
44
|
update(id: number, input: UpdateDocumentInput): Promise<ProjectDocument | null>;
|
|
45
45
|
delete(id: number): Promise<boolean>;
|
|
46
46
|
deleteByType(projectId: number, docType: DocumentType): Promise<boolean>;
|
|
47
|
-
getTypeCounts(projectId: number): Promise<Record<
|
|
47
|
+
getTypeCounts(projectId: number): Promise<Record<string, number>>;
|
|
48
48
|
}
|
|
49
49
|
export interface IPlanRepository {
|
|
50
50
|
create(input: CreatePlanInput): Promise<Plan>;
|
|
@@ -15,5 +15,5 @@ export declare class SQLiteDocumentRepository implements IDocumentRepository {
|
|
|
15
15
|
update(id: number, input: UpdateDocumentInput): Promise<ProjectDocument | null>;
|
|
16
16
|
delete(id: number): Promise<boolean>;
|
|
17
17
|
deleteByType(projectId: number, docType: DocumentType): Promise<boolean>;
|
|
18
|
-
getTypeCounts(projectId: number): Promise<Record<
|
|
18
|
+
getTypeCounts(projectId: number): Promise<Record<string, number>>;
|
|
19
19
|
}
|
|
@@ -110,19 +110,7 @@ export class SQLiteDocumentRepository {
|
|
|
110
110
|
const results = this.db
|
|
111
111
|
.prepare('SELECT doc_type, COUNT(*) as count FROM project_documents WHERE project_id = ? GROUP BY doc_type')
|
|
112
112
|
.all(projectId);
|
|
113
|
-
const counts = {
|
|
114
|
-
prd: 0,
|
|
115
|
-
architecture: 0,
|
|
116
|
-
design: 0,
|
|
117
|
-
notes: 0,
|
|
118
|
-
plan: 0,
|
|
119
|
-
'app-model': 0,
|
|
120
|
-
'research-model': 0,
|
|
121
|
-
'business-model': 0,
|
|
122
|
-
'brand-model': 0,
|
|
123
|
-
'curriculum-model': 0,
|
|
124
|
-
'book-model': 0,
|
|
125
|
-
};
|
|
113
|
+
const counts = {};
|
|
126
114
|
for (const row of results) {
|
|
127
115
|
counts[row.doc_type] = row.count;
|
|
128
116
|
}
|
|
@@ -7,19 +7,22 @@
|
|
|
7
7
|
* Ported from CLI's src/tools/document-db.ts.
|
|
8
8
|
*/
|
|
9
9
|
import { defineTool, createSuccessResult, createErrorResult } from '@compilr-dev/agents';
|
|
10
|
-
/** All valid document types — keep in sync with DocumentType. */
|
|
10
|
+
/** All valid document types — keep in sync with DocumentType in types.ts. */
|
|
11
11
|
const DOC_TYPE_ENUM = [
|
|
12
|
-
|
|
13
|
-
'architecture',
|
|
14
|
-
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
'
|
|
18
|
-
|
|
19
|
-
'
|
|
20
|
-
|
|
21
|
-
'
|
|
22
|
-
|
|
12
|
+
// Software
|
|
13
|
+
'prd', 'architecture', 'design', 'notes', 'plan',
|
|
14
|
+
// Structured models
|
|
15
|
+
'app-model', 'research-model', 'business-model', 'brand-model', 'curriculum-model', 'book-model',
|
|
16
|
+
// Research
|
|
17
|
+
'outline', 'literature-review', 'abstract', 'methodology', 'bibliography',
|
|
18
|
+
// Business
|
|
19
|
+
'executive-summary', 'market-analysis', 'financial-model', 'pitch',
|
|
20
|
+
// Content & Marketing
|
|
21
|
+
'editorial-calendar', 'article',
|
|
22
|
+
// Tech Docs
|
|
23
|
+
'getting-started', 'api-reference', 'tutorial',
|
|
24
|
+
// General
|
|
25
|
+
'draft', 'review', 'session-notes', 'chapter',
|
|
23
26
|
];
|
|
24
27
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
25
28
|
export function createDocumentTools(config) {
|
package/dist/platform/types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type WorkItemType = 'feature' | 'bug' | 'tech-debt' | 'chore';
|
|
|
19
19
|
export type WorkItemStatus = 'backlog' | 'in_progress' | 'completed' | 'skipped';
|
|
20
20
|
export type WorkItemPriority = 'critical' | 'high' | 'medium' | 'low';
|
|
21
21
|
export type GuidedStep = 'plan' | 'implement' | 'test' | 'commit' | 'review';
|
|
22
|
-
export type DocumentType = 'prd' | 'architecture' | 'design' | 'notes' | 'plan' | 'app-model' | 'research-model' | 'business-model' | 'brand-model' | 'curriculum-model' | 'book-model';
|
|
22
|
+
export type DocumentType = 'prd' | 'architecture' | 'design' | 'notes' | 'plan' | 'app-model' | 'research-model' | 'business-model' | 'brand-model' | 'curriculum-model' | 'book-model' | 'outline' | 'literature-review' | 'abstract' | 'methodology' | 'bibliography' | 'executive-summary' | 'market-analysis' | 'financial-model' | 'pitch' | 'editorial-calendar' | 'article' | 'getting-started' | 'api-reference' | 'tutorial' | 'draft' | 'review' | 'session-notes' | 'chapter';
|
|
23
23
|
export type PlanStatus = 'draft' | 'approved' | 'in_progress' | 'completed' | 'abandoned';
|
|
24
24
|
export interface Project {
|
|
25
25
|
id: number;
|
|
@@ -223,11 +223,15 @@ Key categories:
|
|
|
223
223
|
|
|
224
224
|
### Document Storage (CRITICAL)
|
|
225
225
|
|
|
226
|
-
Project documents (
|
|
227
|
-
- **Read**: \`project_document_get({ doc_type: "
|
|
228
|
-
- **Write**: \`project_document_add({ doc_type: "
|
|
226
|
+
Project documents (drafts, outlines, analyses, plans) are stored in the **database**, not the filesystem.
|
|
227
|
+
- **Read**: \`project_document_get({ doc_type: "outline" })\` or \`project_document_list()\`
|
|
228
|
+
- **Write**: \`project_document_add({ doc_type: "outline", title: "...", content: "..." })\`
|
|
229
229
|
- Do NOT use write_file or edit for project documents — always use these database tools
|
|
230
|
-
-
|
|
230
|
+
- **Software doc_types**: prd, architecture, design, notes, plan
|
|
231
|
+
- **Research doc_types**: outline, literature-review, abstract, methodology, bibliography
|
|
232
|
+
- **Business doc_types**: executive-summary, market-analysis, financial-model, pitch
|
|
233
|
+
- **Content doc_types**: editorial-calendar, article
|
|
234
|
+
- **General doc_types**: draft, review, session-notes, chapter, notes`,
|
|
231
235
|
};
|
|
232
236
|
/**
|
|
233
237
|
* Token delegation module - always included
|
package/dist/team/tool-config.js
CHANGED
|
@@ -389,8 +389,8 @@ export const TOOL_PROFILES = {
|
|
|
389
389
|
'search',
|
|
390
390
|
'dependencies',
|
|
391
391
|
],
|
|
392
|
-
// Docs - documentation
|
|
393
|
-
docs: ['file_read', 'file_write', 'interaction', 'handoff', 'guide', 'meta', 'project', 'search', 'factory_models'],
|
|
392
|
+
// Docs - documentation + project documents
|
|
393
|
+
docs: ['file_read', 'file_write', 'interaction', 'handoff', 'guide', 'meta', 'project', 'search', 'documents', 'factory_models'],
|
|
394
394
|
// DevOps - CI/CD tasks
|
|
395
395
|
devops: [
|
|
396
396
|
'file_read',
|
|
@@ -461,7 +461,7 @@ export const TOOL_PROFILES = {
|
|
|
461
461
|
'anchors',
|
|
462
462
|
'factory_models',
|
|
463
463
|
],
|
|
464
|
-
// Analyst (BA) - requirements gathering
|
|
464
|
+
// Analyst (BA) - requirements gathering + document access
|
|
465
465
|
analyst: [
|
|
466
466
|
'file_read',
|
|
467
467
|
'tasks',
|