@context-forge/core 0.1.0
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/node.d.ts +6 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +10 -0
- package/dist/node.js.map +1 -0
- package/dist/services/ContextGenerator.d.ts +19 -0
- package/dist/services/ContextGenerator.d.ts.map +1 -0
- package/dist/services/ContextGenerator.js +66 -0
- package/dist/services/ContextGenerator.js.map +1 -0
- package/dist/services/ContextIntegrator.d.ts +84 -0
- package/dist/services/ContextIntegrator.d.ts.map +1 -0
- package/dist/services/ContextIntegrator.js +211 -0
- package/dist/services/ContextIntegrator.js.map +1 -0
- package/dist/services/ContextTemplateEngine.d.ts +65 -0
- package/dist/services/ContextTemplateEngine.d.ts.map +1 -0
- package/dist/services/ContextTemplateEngine.js +239 -0
- package/dist/services/ContextTemplateEngine.js.map +1 -0
- package/dist/services/CoreServiceFactory.d.ts +14 -0
- package/dist/services/CoreServiceFactory.d.ts.map +1 -0
- package/dist/services/CoreServiceFactory.js +23 -0
- package/dist/services/CoreServiceFactory.js.map +1 -0
- package/dist/services/ProjectPathService.d.ts +14 -0
- package/dist/services/ProjectPathService.d.ts.map +1 -0
- package/dist/services/ProjectPathService.js +142 -0
- package/dist/services/ProjectPathService.js.map +1 -0
- package/dist/services/SectionBuilder.d.ts +70 -0
- package/dist/services/SectionBuilder.d.ts.map +1 -0
- package/dist/services/SectionBuilder.js +303 -0
- package/dist/services/SectionBuilder.js.map +1 -0
- package/dist/services/StatementManager.d.ts +44 -0
- package/dist/services/StatementManager.d.ts.map +1 -0
- package/dist/services/StatementManager.js +216 -0
- package/dist/services/StatementManager.js.map +1 -0
- package/dist/services/SystemPromptParser.d.ts +72 -0
- package/dist/services/SystemPromptParser.d.ts.map +1 -0
- package/dist/services/SystemPromptParser.js +271 -0
- package/dist/services/SystemPromptParser.js.map +1 -0
- package/dist/services/TemplateProcessor.d.ts +35 -0
- package/dist/services/TemplateProcessor.d.ts.map +1 -0
- package/dist/services/TemplateProcessor.js +150 -0
- package/dist/services/TemplateProcessor.js.map +1 -0
- package/dist/services/constants.d.ts +8 -0
- package/dist/services/constants.d.ts.map +1 -0
- package/dist/services/constants.js +62 -0
- package/dist/services/constants.js.map +1 -0
- package/dist/services/index.d.ts +8 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +12 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/interfaces.d.ts +21 -0
- package/dist/services/interfaces.d.ts.map +1 -0
- package/dist/services/interfaces.js +2 -0
- package/dist/services/interfaces.js.map +1 -0
- package/dist/storage/FileProjectStore.d.ts +24 -0
- package/dist/storage/FileProjectStore.d.ts.map +1 -0
- package/dist/storage/FileProjectStore.js +141 -0
- package/dist/storage/FileProjectStore.js.map +1 -0
- package/dist/storage/FileStorageService.d.ts +14 -0
- package/dist/storage/FileStorageService.d.ts.map +1 -0
- package/dist/storage/FileStorageService.js +114 -0
- package/dist/storage/FileStorageService.js.map +1 -0
- package/dist/storage/backupService.d.ts +28 -0
- package/dist/storage/backupService.d.ts.map +1 -0
- package/dist/storage/backupService.js +84 -0
- package/dist/storage/backupService.js.map +1 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +7 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/interfaces.d.ts +23 -0
- package/dist/storage/interfaces.d.ts.map +1 -0
- package/dist/storage/interfaces.js +2 -0
- package/dist/storage/interfaces.js.map +1 -0
- package/dist/storage/storagePaths.d.ts +9 -0
- package/dist/storage/storagePaths.d.ts.map +1 -0
- package/dist/storage/storagePaths.js +20 -0
- package/dist/storage/storagePaths.js.map +1 -0
- package/dist/types/context.d.ts +36 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/context.js +2 -0
- package/dist/types/context.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/paths.d.ts +18 -0
- package/dist/types/paths.d.ts.map +1 -0
- package/dist/types/paths.js +2 -0
- package/dist/types/paths.js.map +1 -0
- package/dist/types/project.d.ts +48 -0
- package/dist/types/project.d.ts.map +1 -0
- package/dist/types/project.js +2 -0
- package/dist/types/project.js.map +1 -0
- package/dist/types/prompts.d.ts +49 -0
- package/dist/types/prompts.d.ts.map +1 -0
- package/dist/types/prompts.js +10 -0
- package/dist/types/prompts.js.map +1 -0
- package/dist/types/sections.d.ts +64 -0
- package/dist/types/sections.d.ts.map +1 -0
- package/dist/types/sections.js +13 -0
- package/dist/types/sections.js.map +1 -0
- package/dist/types/statements.d.ts +40 -0
- package/dist/types/statements.d.ts.map +1 -0
- package/dist/types/statements.js +2 -0
- package/dist/types/statements.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Result of validating a project path against expected directory structure. */
|
|
2
|
+
export interface PathValidationResult {
|
|
3
|
+
valid: boolean;
|
|
4
|
+
projectPath: string;
|
|
5
|
+
errors: string[];
|
|
6
|
+
structure: {
|
|
7
|
+
hasProjectDocuments: boolean;
|
|
8
|
+
hasUserDir: boolean;
|
|
9
|
+
/** Which of slices/tasks/features/architecture exist under project-documents/user/ */
|
|
10
|
+
subdirectories: string[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** Result of listing files in a project subdirectory. */
|
|
14
|
+
export interface DirectoryListResult {
|
|
15
|
+
files: string[];
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/types/paths.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE;QACT,mBAAmB,EAAE,OAAO,CAAC;QAC7B,UAAU,EAAE,OAAO,CAAC;QACpB,sFAAsF;QACtF,cAAc,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;CACH;AAED,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/types/paths.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core data structure for project information
|
|
3
|
+
*/
|
|
4
|
+
export interface ProjectData {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
template: string;
|
|
8
|
+
slice: string;
|
|
9
|
+
taskFile: string;
|
|
10
|
+
instruction: string;
|
|
11
|
+
developmentPhase?: string;
|
|
12
|
+
workType?: 'start' | 'continue';
|
|
13
|
+
projectDate?: string;
|
|
14
|
+
isMonorepo: boolean;
|
|
15
|
+
isMonorepoEnabled?: boolean;
|
|
16
|
+
/** Absolute path to project root (contains project-documents/) */
|
|
17
|
+
projectPath?: string;
|
|
18
|
+
customData?: {
|
|
19
|
+
recentEvents?: string;
|
|
20
|
+
additionalNotes?: string;
|
|
21
|
+
monorepoNote?: string;
|
|
22
|
+
availableTools?: string;
|
|
23
|
+
};
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Type for creating a new project (without auto-generated fields).
|
|
29
|
+
* instruction, workType and customData are optional during creation and will get defaults.
|
|
30
|
+
*/
|
|
31
|
+
export type CreateProjectData = Omit<ProjectData, 'id' | 'createdAt' | 'updatedAt' | 'instruction' | 'developmentPhase' | 'workType' | 'taskFile' | 'projectDate' | 'customData'> & {
|
|
32
|
+
instruction?: string;
|
|
33
|
+
developmentPhase?: string;
|
|
34
|
+
workType?: 'start' | 'continue';
|
|
35
|
+
taskFile?: string;
|
|
36
|
+
projectDate?: string;
|
|
37
|
+
customData?: {
|
|
38
|
+
recentEvents?: string;
|
|
39
|
+
additionalNotes?: string;
|
|
40
|
+
monorepoNote?: string;
|
|
41
|
+
availableTools?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Type for updating an existing project (partial updates allowed)
|
|
46
|
+
*/
|
|
47
|
+
export type UpdateProjectData = Partial<Pick<ProjectData, 'name' | 'template' | 'slice' | 'taskFile' | 'instruction' | 'developmentPhase' | 'workType' | 'projectDate' | 'isMonorepo' | 'isMonorepoEnabled' | 'projectPath' | 'customData'>>;
|
|
48
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/types/project.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE;QACX,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,WAAW,EACX,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,kBAAkB,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,CAC/H,GAAG;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE;QACX,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACrC,IAAI,CACF,WAAW,EACT,MAAM,GACN,UAAU,GACV,OAAO,GACP,UAAU,GACV,aAAa,GACb,kBAAkB,GAClB,UAAU,GACV,aAAa,GACb,YAAY,GACZ,mBAAmB,GACnB,aAAa,GACb,YAAY,CACf,CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/types/project.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a system prompt extracted from the prompt file
|
|
3
|
+
*/
|
|
4
|
+
export interface SystemPrompt {
|
|
5
|
+
/** Display name of the prompt (from section header) */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Unique key identifier for the prompt */
|
|
8
|
+
key: string;
|
|
9
|
+
/** The actual prompt content/text */
|
|
10
|
+
content: string;
|
|
11
|
+
/** Parameters or variables referenced in the prompt */
|
|
12
|
+
parameters: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Result of parsing the system prompt file
|
|
16
|
+
*/
|
|
17
|
+
export interface ParsedPromptFile {
|
|
18
|
+
/** All prompts found in the file */
|
|
19
|
+
prompts: SystemPrompt[];
|
|
20
|
+
/** File metadata (version, last updated, etc) */
|
|
21
|
+
metadata?: {
|
|
22
|
+
version?: string;
|
|
23
|
+
lastUpdated?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Any parsing errors encountered */
|
|
26
|
+
errors: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Cache entry for parsed system prompts
|
|
30
|
+
*/
|
|
31
|
+
export interface PromptCacheEntry {
|
|
32
|
+
/** Parsed prompts */
|
|
33
|
+
prompts: SystemPrompt[];
|
|
34
|
+
/** File modification time when cached */
|
|
35
|
+
mtime: number;
|
|
36
|
+
/** Cache timestamp */
|
|
37
|
+
cachedAt: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Special prompt keys for commonly used prompts
|
|
41
|
+
*/
|
|
42
|
+
export declare const SpecialPromptKeys: {
|
|
43
|
+
readonly CONTEXT_INITIALIZATION: "context-initialization";
|
|
44
|
+
readonly TOOL_USE: "use-3rd-party-tool";
|
|
45
|
+
readonly PROJECT_KICKOFF: "project-kickoff";
|
|
46
|
+
readonly FEATURE_DESIGN: "feature-design";
|
|
47
|
+
};
|
|
48
|
+
export type SpecialPromptKeys = (typeof SpecialPromptKeys)[keyof typeof SpecialPromptKeys];
|
|
49
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/types/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IAEb,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IAEZ,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAEhB,uDAAuD;IACvD,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,OAAO,EAAE,YAAY,EAAE,CAAC;IAExB,iDAAiD;IACjD,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF,qCAAqC;IACrC,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qBAAqB;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IAExB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IAEd,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Special prompt keys for commonly used prompts
|
|
3
|
+
*/
|
|
4
|
+
export const SpecialPromptKeys = {
|
|
5
|
+
CONTEXT_INITIALIZATION: 'context-initialization',
|
|
6
|
+
TOOL_USE: 'use-3rd-party-tool',
|
|
7
|
+
PROJECT_KICKOFF: 'project-kickoff',
|
|
8
|
+
FEATURE_DESIGN: 'feature-design',
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/types/prompts.ts"],"names":[],"mappings":"AAgDA;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,sBAAsB,EAAE,wBAAwB;IAChD,QAAQ,EAAE,oBAAoB;IAC9B,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;CACxB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ContextData } from './context.js';
|
|
2
|
+
import type { TemplateStatement } from './statements.js';
|
|
3
|
+
import type { SystemPrompt } from './prompts.js';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a section in the context template
|
|
6
|
+
*/
|
|
7
|
+
export interface ContextSection {
|
|
8
|
+
/** Unique identifier for the section */
|
|
9
|
+
key: string;
|
|
10
|
+
/** Optional title to display for the section (e.g., "### Current Events") */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** The content of the section (can include template variables) */
|
|
13
|
+
content: string;
|
|
14
|
+
/** Whether this section should be conditionally included */
|
|
15
|
+
conditional?: boolean;
|
|
16
|
+
/** Function to determine if section should be included */
|
|
17
|
+
condition?: (data: ContextData) => boolean;
|
|
18
|
+
/** Sort order for the section (lower numbers appear first) */
|
|
19
|
+
order: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Complete context template structure
|
|
23
|
+
*/
|
|
24
|
+
export interface ContextTemplate {
|
|
25
|
+
/** All sections that make up the template */
|
|
26
|
+
sections: ContextSection[];
|
|
27
|
+
/** Available statements for the template */
|
|
28
|
+
statements: Record<string, TemplateStatement>;
|
|
29
|
+
/** Available system prompts */
|
|
30
|
+
prompts: Record<string, SystemPrompt>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Section builder configuration
|
|
34
|
+
*/
|
|
35
|
+
export interface SectionBuilderConfig {
|
|
36
|
+
/** Whether to include empty sections */
|
|
37
|
+
includeEmptySections?: boolean;
|
|
38
|
+
/** Whether to include section titles */
|
|
39
|
+
includeTitles?: boolean;
|
|
40
|
+
/** Custom section separator (default: double newline) */
|
|
41
|
+
sectionSeparator?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Predefined section keys
|
|
45
|
+
*/
|
|
46
|
+
export declare const SectionKeys: {
|
|
47
|
+
readonly PROJECT_INTRO: "project-intro";
|
|
48
|
+
readonly CONTEXT_INIT: "context-init";
|
|
49
|
+
readonly TOOLS_SECTION: "tools-section";
|
|
50
|
+
readonly MONOREPO_SECTION: "monorepo-section";
|
|
51
|
+
readonly CURRENT_EVENTS: "current-events";
|
|
52
|
+
readonly INSTRUCTION_PROMPT: "instruction-prompt";
|
|
53
|
+
readonly ADDITIONAL_NOTES: "additional-notes";
|
|
54
|
+
};
|
|
55
|
+
export type SectionKeys = (typeof SectionKeys)[keyof typeof SectionKeys];
|
|
56
|
+
/**
|
|
57
|
+
* Section validation result
|
|
58
|
+
*/
|
|
59
|
+
export interface SectionValidation {
|
|
60
|
+
isValid: boolean;
|
|
61
|
+
errors: string[];
|
|
62
|
+
warnings: string[];
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../src/types/sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IAEZ,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAEhB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC;IAE3C,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,QAAQ,EAAE,cAAc,EAAE,CAAC;IAE3B,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAE9C,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,wCAAwC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Predefined section keys
|
|
3
|
+
*/
|
|
4
|
+
export const SectionKeys = {
|
|
5
|
+
PROJECT_INTRO: 'project-intro',
|
|
6
|
+
CONTEXT_INIT: 'context-init',
|
|
7
|
+
TOOLS_SECTION: 'tools-section',
|
|
8
|
+
MONOREPO_SECTION: 'monorepo-section',
|
|
9
|
+
CURRENT_EVENTS: 'current-events',
|
|
10
|
+
INSTRUCTION_PROMPT: 'instruction-prompt',
|
|
11
|
+
ADDITIONAL_NOTES: 'additional-notes',
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../src/types/sections.ts"],"names":[],"mappings":"AAuDA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,kBAAkB,EAAE,oBAAoB;IACxC,gBAAgB,EAAE,kBAAkB;CAC5B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template statement configuration for context generation
|
|
3
|
+
*/
|
|
4
|
+
export interface TemplateStatement {
|
|
5
|
+
/** Unique key identifier for the statement */
|
|
6
|
+
key: string;
|
|
7
|
+
/** The actual statement content/text */
|
|
8
|
+
content: string;
|
|
9
|
+
/** Human-readable description of what this statement is for */
|
|
10
|
+
description: string;
|
|
11
|
+
/** Whether users can edit this statement */
|
|
12
|
+
editable: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configuration for storing and managing statements
|
|
16
|
+
*/
|
|
17
|
+
export interface StatementConfig {
|
|
18
|
+
/** Map of statement keys to statement objects */
|
|
19
|
+
statements: Record<string, TemplateStatement>;
|
|
20
|
+
/** ISO date string of last update */
|
|
21
|
+
lastUpdated: string;
|
|
22
|
+
/** Version string for compatibility tracking */
|
|
23
|
+
version: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Metadata extracted from markdown file frontmatter
|
|
27
|
+
*/
|
|
28
|
+
export interface StatementFileMetadata {
|
|
29
|
+
version: string;
|
|
30
|
+
lastUpdated: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Result of parsing a statement from markdown
|
|
34
|
+
*/
|
|
35
|
+
export interface ParsedStatement {
|
|
36
|
+
key: string;
|
|
37
|
+
content: string;
|
|
38
|
+
editable: boolean;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=statements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statements.d.ts","sourceRoot":"","sources":["../../src/types/statements.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IAEZ,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAEhB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IAEpB,4CAA4C;IAC5C,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAE9C,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IAEpB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statements.js","sourceRoot":"","sources":["../../src/types/statements.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@context-forge/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core context generation engine for Context Forge — template processing, project state, prompt assembly",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./node": {
|
|
14
|
+
"types": "./dist/node.d.ts",
|
|
15
|
+
"default": "./dist/node.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"context-forge",
|
|
24
|
+
"context",
|
|
25
|
+
"ai",
|
|
26
|
+
"template",
|
|
27
|
+
"prompt"
|
|
28
|
+
],
|
|
29
|
+
"author": "Manta Templates",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/ecorkran/context-forge.git",
|
|
34
|
+
"directory": "packages/core"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/ecorkran/context-forge/tree/main/packages/core#readme",
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18.0.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^24.3.1",
|
|
42
|
+
"typescript": "~5.8.3",
|
|
43
|
+
"vitest": "^3.2.1"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"env-paths": "^4.0.0"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsc",
|
|
50
|
+
"dev": "tsc --watch",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"typecheck": "tsc --noEmit"
|
|
53
|
+
}
|
|
54
|
+
}
|