prjct-cli 0.63.0 → 0.64.1
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 +99 -0
- package/core/__tests__/agentic/smart-context.test.ts +372 -0
- package/core/__tests__/ai-tools/formatters.test.ts +358 -0
- package/core/ai-tools/formatters.ts +76 -57
- package/core/ai-tools/registry.ts +2 -2
- package/core/services/sync-service.ts +6 -1
- package/core/types/agentic.ts +68 -5
- package/core/types/index.ts +7 -0
- package/core/types/memory.ts +12 -2
- package/dist/bin/prjct.mjs +80 -58
- package/package.json +1 -1
package/core/types/index.ts
CHANGED
|
@@ -50,6 +50,8 @@ export type {
|
|
|
50
50
|
GroundTruthContext,
|
|
51
51
|
HallucinationPattern,
|
|
52
52
|
HallucinationResult,
|
|
53
|
+
// Input Source types (PRJ-102)
|
|
54
|
+
InputSource,
|
|
53
55
|
LearnedPatterns,
|
|
54
56
|
LearnedPatternsRecord,
|
|
55
57
|
LoadedAgent,
|
|
@@ -81,6 +83,9 @@ export type {
|
|
|
81
83
|
SimpleExecutionResult,
|
|
82
84
|
SkillContext,
|
|
83
85
|
SmartContextProjectState,
|
|
86
|
+
// Source tracking types (PRJ-102)
|
|
87
|
+
SourcedItem,
|
|
88
|
+
SourceMetadata,
|
|
84
89
|
StackInfo,
|
|
85
90
|
Template,
|
|
86
91
|
ThinkBlock,
|
|
@@ -92,6 +97,7 @@ export type {
|
|
|
92
97
|
VerificationResult,
|
|
93
98
|
Verifier,
|
|
94
99
|
} from './agentic'
|
|
100
|
+
export { createSourceMetadata } from './agentic'
|
|
95
101
|
// =============================================================================
|
|
96
102
|
// Agent Types
|
|
97
103
|
// =============================================================================
|
|
@@ -248,6 +254,7 @@ export type {
|
|
|
248
254
|
Decision,
|
|
249
255
|
HistoryEntry,
|
|
250
256
|
HistoryEventType,
|
|
257
|
+
LegacyMemorySource,
|
|
251
258
|
Memory,
|
|
252
259
|
MemoryContext,
|
|
253
260
|
MemoryContextParams,
|
package/core/types/memory.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Types for the memory system that tracks user preferences and patterns.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type { InputSource } from './agentic'
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* Semantic tags for memory categorization.
|
|
8
10
|
* Use these constants instead of raw strings.
|
|
@@ -49,6 +51,12 @@ export interface Memory {
|
|
|
49
51
|
observationCount?: number
|
|
50
52
|
}
|
|
51
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Legacy source type - use InputSource for new code.
|
|
56
|
+
* @deprecated Use InputSource from agentic.ts instead
|
|
57
|
+
*/
|
|
58
|
+
export type LegacyMemorySource = 'user' | 'system' | 'learned'
|
|
59
|
+
|
|
52
60
|
/**
|
|
53
61
|
* Metadata associated with a memory entry.
|
|
54
62
|
*/
|
|
@@ -61,8 +69,10 @@ export interface MemoryMetadata {
|
|
|
61
69
|
taskId?: string
|
|
62
70
|
/** Related feature name */
|
|
63
71
|
feature?: string
|
|
64
|
-
/** Source of the memory */
|
|
65
|
-
source?:
|
|
72
|
+
/** Source of the memory (legacy - use inputSource for new code) */
|
|
73
|
+
source?: LegacyMemorySource
|
|
74
|
+
/** Input source category for traceability (PRJ-102) */
|
|
75
|
+
inputSource?: InputSource
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
/**
|
package/dist/bin/prjct.mjs
CHANGED
|
@@ -12419,6 +12419,13 @@ var init_plan_mode = __esm({
|
|
|
12419
12419
|
}
|
|
12420
12420
|
});
|
|
12421
12421
|
|
|
12422
|
+
// core/types/agentic.ts
|
|
12423
|
+
var init_agentic = __esm({
|
|
12424
|
+
"core/types/agentic.ts"() {
|
|
12425
|
+
"use strict";
|
|
12426
|
+
}
|
|
12427
|
+
});
|
|
12428
|
+
|
|
12422
12429
|
// core/types/bus.ts
|
|
12423
12430
|
var init_bus = __esm({
|
|
12424
12431
|
"core/types/bus.ts"() {
|
|
@@ -12445,6 +12452,7 @@ var init_integrations = __esm({
|
|
|
12445
12452
|
var init_types3 = __esm({
|
|
12446
12453
|
"core/types/index.ts"() {
|
|
12447
12454
|
"use strict";
|
|
12455
|
+
init_agentic();
|
|
12448
12456
|
init_bus();
|
|
12449
12457
|
init_fs();
|
|
12450
12458
|
init_integrations();
|
|
@@ -19693,35 +19701,41 @@ Load from \`~/.prjct-cli/projects/${ctx.projectId}/agents/\`:
|
|
|
19693
19701
|
`;
|
|
19694
19702
|
}
|
|
19695
19703
|
function formatForCursor(ctx, _config) {
|
|
19696
|
-
const
|
|
19697
|
-
|
|
19698
|
-
|
|
19699
|
-
|
|
19704
|
+
const lines = [];
|
|
19705
|
+
lines.push("---");
|
|
19706
|
+
lines.push(`description: prjct context for ${ctx.name}`);
|
|
19707
|
+
lines.push("globs:");
|
|
19708
|
+
lines.push("alwaysApply: true");
|
|
19709
|
+
lines.push("---");
|
|
19710
|
+
lines.push("");
|
|
19711
|
+
lines.push(`You are working on ${ctx.name}, a ${ctx.projectType} ${ctx.ecosystem} project.`);
|
|
19712
|
+
lines.push("");
|
|
19713
|
+
lines.push("## Tech Stack");
|
|
19700
19714
|
if (ctx.languages.length > 0) {
|
|
19701
|
-
|
|
19715
|
+
lines.push(`- Languages: ${ctx.languages.join(", ")}`);
|
|
19702
19716
|
}
|
|
19703
19717
|
if (ctx.frameworks.length > 0) {
|
|
19704
|
-
|
|
19705
|
-
}
|
|
19706
|
-
|
|
19707
|
-
|
|
19708
|
-
|
|
19709
|
-
|
|
19710
|
-
|
|
19711
|
-
|
|
19712
|
-
|
|
19713
|
-
|
|
19714
|
-
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
|
|
19718
|
-
|
|
19719
|
-
|
|
19720
|
-
|
|
19721
|
-
|
|
19722
|
-
|
|
19723
|
-
|
|
19724
|
-
return
|
|
19718
|
+
lines.push(`- Frameworks: ${ctx.frameworks.join(", ")}`);
|
|
19719
|
+
}
|
|
19720
|
+
lines.push("");
|
|
19721
|
+
lines.push("## Commands");
|
|
19722
|
+
lines.push(`- Install: \`${ctx.commands.install}\``);
|
|
19723
|
+
lines.push(`- Dev: \`${ctx.commands.dev}\``);
|
|
19724
|
+
lines.push(`- Test: \`${ctx.commands.test}\``);
|
|
19725
|
+
lines.push(`- Build: \`${ctx.commands.build}\``);
|
|
19726
|
+
lines.push("");
|
|
19727
|
+
lines.push("## Code Style");
|
|
19728
|
+
lines.push(`- Follow ${ctx.ecosystem} conventions`);
|
|
19729
|
+
lines.push("- Match existing code patterns in this project");
|
|
19730
|
+
lines.push("- Use idiomatic constructs for the language");
|
|
19731
|
+
lines.push("");
|
|
19732
|
+
lines.push("## Best Practices");
|
|
19733
|
+
lines.push("- Write clean, readable code");
|
|
19734
|
+
lines.push("- Add comments only for complex logic");
|
|
19735
|
+
lines.push("- Keep functions small and focused");
|
|
19736
|
+
lines.push("- Handle errors appropriately");
|
|
19737
|
+
lines.push("- Write tests for new functionality");
|
|
19738
|
+
return lines.join("\n");
|
|
19725
19739
|
}
|
|
19726
19740
|
function formatForCopilot(ctx, _config) {
|
|
19727
19741
|
const lines = [];
|
|
@@ -19744,35 +19758,40 @@ function formatForCopilot(ctx, _config) {
|
|
|
19744
19758
|
return lines.join("\n");
|
|
19745
19759
|
}
|
|
19746
19760
|
function formatForWindsurf(ctx, _config) {
|
|
19747
|
-
const
|
|
19748
|
-
|
|
19749
|
-
|
|
19750
|
-
|
|
19751
|
-
|
|
19752
|
-
|
|
19753
|
-
|
|
19761
|
+
const lines = [];
|
|
19762
|
+
lines.push("---");
|
|
19763
|
+
lines.push(`description: prjct context for ${ctx.name}`);
|
|
19764
|
+
lines.push("trigger: always_on");
|
|
19765
|
+
lines.push("---");
|
|
19766
|
+
lines.push("");
|
|
19767
|
+
lines.push(`# ${ctx.name}`);
|
|
19768
|
+
lines.push("");
|
|
19769
|
+
lines.push(`${ctx.projectType} project using ${ctx.ecosystem}.`);
|
|
19770
|
+
lines.push("");
|
|
19771
|
+
lines.push("## Stack");
|
|
19772
|
+
lines.push(`- ${ctx.languages.join(", ")}`);
|
|
19754
19773
|
if (ctx.frameworks.length > 0) {
|
|
19755
|
-
|
|
19756
|
-
}
|
|
19757
|
-
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19774
|
-
|
|
19775
|
-
return
|
|
19774
|
+
lines.push(`- ${ctx.frameworks.join(", ")}`);
|
|
19775
|
+
}
|
|
19776
|
+
lines.push("");
|
|
19777
|
+
lines.push("## Commands");
|
|
19778
|
+
lines.push("```bash");
|
|
19779
|
+
lines.push(`# Install`);
|
|
19780
|
+
lines.push(ctx.commands.install);
|
|
19781
|
+
lines.push(`# Dev`);
|
|
19782
|
+
lines.push(ctx.commands.dev);
|
|
19783
|
+
lines.push(`# Test`);
|
|
19784
|
+
lines.push(ctx.commands.test);
|
|
19785
|
+
lines.push(`# Build`);
|
|
19786
|
+
lines.push(ctx.commands.build);
|
|
19787
|
+
lines.push("```");
|
|
19788
|
+
lines.push("");
|
|
19789
|
+
lines.push("## Rules");
|
|
19790
|
+
lines.push(`- Follow ${ctx.ecosystem} conventions`);
|
|
19791
|
+
lines.push("- Match existing project patterns");
|
|
19792
|
+
lines.push("- Clean code, minimal comments");
|
|
19793
|
+
lines.push("- Test new functionality");
|
|
19794
|
+
return lines.join("\n");
|
|
19776
19795
|
}
|
|
19777
19796
|
function formatForContinue(ctx, _config) {
|
|
19778
19797
|
const systemMessage = [
|
|
@@ -19899,7 +19918,7 @@ var init_registry = __esm({
|
|
|
19899
19918
|
cursor: {
|
|
19900
19919
|
id: "cursor",
|
|
19901
19920
|
name: "Cursor",
|
|
19902
|
-
outputFile: ".
|
|
19921
|
+
outputFile: ".cursor/rules/prjct.mdc",
|
|
19903
19922
|
outputPath: "repo",
|
|
19904
19923
|
maxTokens: 2e3,
|
|
19905
19924
|
format: "concise",
|
|
@@ -19917,7 +19936,7 @@ var init_registry = __esm({
|
|
|
19917
19936
|
windsurf: {
|
|
19918
19937
|
id: "windsurf",
|
|
19919
19938
|
name: "Windsurf",
|
|
19920
|
-
outputFile: ".
|
|
19939
|
+
outputFile: ".windsurf/rules/prjct.md",
|
|
19921
19940
|
outputPath: "repo",
|
|
19922
19941
|
maxTokens: 2e3,
|
|
19923
19942
|
format: "concise",
|
|
@@ -20696,7 +20715,10 @@ var init_sync_service = __esm({
|
|
|
20696
20715
|
const startTime = Date.now();
|
|
20697
20716
|
let aiToolIds;
|
|
20698
20717
|
if (!options.aiTools || options.aiTools.length === 0) {
|
|
20699
|
-
|
|
20718
|
+
const detectedIdeTools = detectInstalledTools(projectPath).filter(
|
|
20719
|
+
(id) => !DEFAULT_AI_TOOLS.includes(id)
|
|
20720
|
+
);
|
|
20721
|
+
aiToolIds = [...DEFAULT_AI_TOOLS, ...detectedIdeTools];
|
|
20700
20722
|
} else if (options.aiTools[0] === "auto") {
|
|
20701
20723
|
aiToolIds = detectInstalledTools(projectPath);
|
|
20702
20724
|
if (aiToolIds.length === 0) aiToolIds = ["claude"];
|
|
@@ -26837,7 +26859,7 @@ var require_package = __commonJS({
|
|
|
26837
26859
|
"package.json"(exports, module) {
|
|
26838
26860
|
module.exports = {
|
|
26839
26861
|
name: "prjct-cli",
|
|
26840
|
-
version: "0.
|
|
26862
|
+
version: "0.64.1",
|
|
26841
26863
|
description: "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
|
|
26842
26864
|
main: "core/index.ts",
|
|
26843
26865
|
bin: {
|