augustus-ai-editor 1.0.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/README.md +84 -0
- package/dist/Augustus.d.ts +42 -0
- package/dist/Augustus.d.ts.map +1 -0
- package/dist/Augustus.js +174 -0
- package/dist/Augustus.js.map +1 -0
- package/dist/context/SenateContext.d.ts +31 -0
- package/dist/context/SenateContext.d.ts.map +1 -0
- package/dist/context/SenateContext.js +209 -0
- package/dist/context/SenateContext.js.map +1 -0
- package/dist/core/ImperialLegion.d.ts +27 -0
- package/dist/core/ImperialLegion.d.ts.map +1 -0
- package/dist/core/ImperialLegion.js +205 -0
- package/dist/core/ImperialLegion.js.map +1 -0
- package/dist/core/SoftBuffer.d.ts +15 -0
- package/dist/core/SoftBuffer.d.ts.map +1 -0
- package/dist/core/SoftBuffer.js +74 -0
- package/dist/core/SoftBuffer.js.map +1 -0
- package/dist/diff/VelvetDiff.d.ts +24 -0
- package/dist/diff/VelvetDiff.d.ts.map +1 -0
- package/dist/diff/VelvetDiff.js +238 -0
- package/dist/diff/VelvetDiff.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/stream/CaesarStream.d.ts +45 -0
- package/dist/stream/CaesarStream.d.ts.map +1 -0
- package/dist/stream/CaesarStream.js +209 -0
- package/dist/stream/CaesarStream.js.map +1 -0
- package/dist/types/core.types.d.ts +87 -0
- package/dist/types/core.types.d.ts.map +1 -0
- package/dist/types/core.types.js +2 -0
- package/dist/types/core.types.js.map +1 -0
- package/dist/ui/TogaStyler.d.ts +31 -0
- package/dist/ui/TogaStyler.d.ts.map +1 -0
- package/dist/ui/TogaStyler.js +342 -0
- package/dist/ui/TogaStyler.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
2
|
+
import OpenAI from 'openai';
|
|
3
|
+
import { SoftBuffer } from './SoftBuffer.js';
|
|
4
|
+
export class ImperialLegion {
|
|
5
|
+
tacticians = new Map();
|
|
6
|
+
clients = {};
|
|
7
|
+
softBuffer;
|
|
8
|
+
activeTactician = null;
|
|
9
|
+
constructor(providerConfigs, bufferConfig) {
|
|
10
|
+
this.initializeProviders(providerConfigs);
|
|
11
|
+
this.softBuffer = new SoftBuffer(bufferConfig);
|
|
12
|
+
this.registerDefaultTacticians();
|
|
13
|
+
}
|
|
14
|
+
initializeProviders(configs) {
|
|
15
|
+
if (configs.anthropic?.apiKey) {
|
|
16
|
+
this.clients.anthropic = new Anthropic({
|
|
17
|
+
apiKey: configs.anthropic.apiKey
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (configs.openai?.apiKey) {
|
|
21
|
+
this.clients.openai = new OpenAI({
|
|
22
|
+
apiKey: configs.openai.apiKey,
|
|
23
|
+
baseURL: configs.openai.baseUrl
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
registerDefaultTacticians() {
|
|
28
|
+
const defaultTacticians = [
|
|
29
|
+
{
|
|
30
|
+
name: 'ClaudiusSonnet',
|
|
31
|
+
provider: 'anthropic',
|
|
32
|
+
modelId: 'claude-sonnet-4-20250514',
|
|
33
|
+
maxTokens: 8192,
|
|
34
|
+
temperature: 0.7
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'ClaudiusOpus',
|
|
38
|
+
provider: 'anthropic',
|
|
39
|
+
modelId: 'claude-opus-4-20250514',
|
|
40
|
+
maxTokens: 8192,
|
|
41
|
+
temperature: 0.5
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'GPTCenturion',
|
|
45
|
+
provider: 'openai',
|
|
46
|
+
modelId: 'gpt-4o',
|
|
47
|
+
maxTokens: 8192,
|
|
48
|
+
temperature: 0.7
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'GPTLegionnaire',
|
|
52
|
+
provider: 'openai',
|
|
53
|
+
modelId: 'gpt-4o-mini',
|
|
54
|
+
maxTokens: 4096,
|
|
55
|
+
temperature: 0.8
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
for (const tactician of defaultTacticians) {
|
|
59
|
+
this.tacticians.set(tactician.name, tactician);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
registerTactician(tactician) {
|
|
63
|
+
this.tacticians.set(tactician.name, tactician);
|
|
64
|
+
}
|
|
65
|
+
selectTactician(name) {
|
|
66
|
+
const tactician = this.tacticians.get(name) ?? null;
|
|
67
|
+
if (tactician) {
|
|
68
|
+
this.activeTactician = tactician;
|
|
69
|
+
}
|
|
70
|
+
return tactician;
|
|
71
|
+
}
|
|
72
|
+
async dispatchCommand(prompt, tacticianName, context) {
|
|
73
|
+
const tactician = tacticianName
|
|
74
|
+
? this.tacticians.get(tacticianName)
|
|
75
|
+
: this.activeTactician ?? this.tacticians.values().next().value;
|
|
76
|
+
if (!tactician) {
|
|
77
|
+
throw new Error('No tactician available for dispatch');
|
|
78
|
+
}
|
|
79
|
+
const bufferedPrompt = this.softBuffer.wrapPrompt(prompt);
|
|
80
|
+
const contextualPrompt = context
|
|
81
|
+
? this.weaveScrollIntoPrompt(bufferedPrompt, context)
|
|
82
|
+
: bufferedPrompt;
|
|
83
|
+
const command = {
|
|
84
|
+
prompt: contextualPrompt,
|
|
85
|
+
tactician,
|
|
86
|
+
buffer: this.softBuffer.getConfig(),
|
|
87
|
+
context
|
|
88
|
+
};
|
|
89
|
+
const rawResponse = await this.executeCommand(command);
|
|
90
|
+
return this.softBuffer.softenResponse(rawResponse);
|
|
91
|
+
}
|
|
92
|
+
async *dispatchCommandStream(prompt, tacticianName, context) {
|
|
93
|
+
const tactician = tacticianName
|
|
94
|
+
? this.tacticians.get(tacticianName)
|
|
95
|
+
: this.activeTactician ?? this.tacticians.values().next().value;
|
|
96
|
+
if (!tactician) {
|
|
97
|
+
throw new Error('No tactician available for dispatch');
|
|
98
|
+
}
|
|
99
|
+
const bufferedPrompt = this.softBuffer.wrapPrompt(prompt);
|
|
100
|
+
const contextualPrompt = context
|
|
101
|
+
? this.weaveScrollIntoPrompt(bufferedPrompt, context)
|
|
102
|
+
: bufferedPrompt;
|
|
103
|
+
let sequence = 0;
|
|
104
|
+
const streamId = this.generateStreamId();
|
|
105
|
+
yield {
|
|
106
|
+
type: 'vision',
|
|
107
|
+
content: {
|
|
108
|
+
oracleVision: {
|
|
109
|
+
reasoning: ['Analyzing the request with gentle wisdom...'],
|
|
110
|
+
approach: 'Methodical refinement',
|
|
111
|
+
confidence: 0.85,
|
|
112
|
+
risks: []
|
|
113
|
+
},
|
|
114
|
+
streamId,
|
|
115
|
+
timestamp: new Date()
|
|
116
|
+
},
|
|
117
|
+
sequence: sequence++
|
|
118
|
+
};
|
|
119
|
+
const response = await this.executeStreamingCommand(tactician, contextualPrompt);
|
|
120
|
+
yield {
|
|
121
|
+
type: 'edification',
|
|
122
|
+
content: {
|
|
123
|
+
edification: {
|
|
124
|
+
bricks: [],
|
|
125
|
+
summary: this.softBuffer.softenResponse(response),
|
|
126
|
+
filesAffected: []
|
|
127
|
+
},
|
|
128
|
+
streamId,
|
|
129
|
+
timestamp: new Date()
|
|
130
|
+
},
|
|
131
|
+
sequence: sequence++
|
|
132
|
+
};
|
|
133
|
+
yield {
|
|
134
|
+
type: 'complete',
|
|
135
|
+
content: { streamId, timestamp: new Date() },
|
|
136
|
+
sequence
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
weaveScrollIntoPrompt(prompt, scroll) {
|
|
140
|
+
const provinceDescriptions = scroll.provinces
|
|
141
|
+
.map((p, i) => `=== Province ${i + 1}: ${p.name} ===\nPath: ${p.path}\nLanguage: ${p.language}\nRelevance: ${(p.relevanceScore * 100).toFixed(1)}%\n\n${p.content}`)
|
|
142
|
+
.join('\n\n---\n\n');
|
|
143
|
+
return `The Senate has gathered the following Provinces for your consideration:
|
|
144
|
+
|
|
145
|
+
${provinceDescriptions}
|
|
146
|
+
|
|
147
|
+
--- Consolidated Scroll Complete ---
|
|
148
|
+
|
|
149
|
+
${prompt}`;
|
|
150
|
+
}
|
|
151
|
+
async executeCommand(command) {
|
|
152
|
+
const { tactician, prompt } = command;
|
|
153
|
+
switch (tactician.provider) {
|
|
154
|
+
case 'anthropic':
|
|
155
|
+
return this.executeAnthropicCommand(tactician, prompt);
|
|
156
|
+
case 'openai':
|
|
157
|
+
return this.executeOpenAICommand(tactician, prompt);
|
|
158
|
+
default:
|
|
159
|
+
throw new Error(`Unknown provider: ${tactician.provider}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async executeAnthropicCommand(tactician, prompt) {
|
|
163
|
+
if (!this.clients.anthropic) {
|
|
164
|
+
throw new Error('Anthropic client not initialized');
|
|
165
|
+
}
|
|
166
|
+
const response = await this.clients.anthropic.messages.create({
|
|
167
|
+
model: tactician.modelId,
|
|
168
|
+
max_tokens: tactician.maxTokens,
|
|
169
|
+
temperature: tactician.temperature,
|
|
170
|
+
messages: [{ role: 'user', content: prompt }]
|
|
171
|
+
});
|
|
172
|
+
const textBlock = response.content.find((block) => block.type === 'text');
|
|
173
|
+
return textBlock?.text ?? '';
|
|
174
|
+
}
|
|
175
|
+
async executeOpenAICommand(tactician, prompt) {
|
|
176
|
+
if (!this.clients.openai) {
|
|
177
|
+
throw new Error('OpenAI client not initialized');
|
|
178
|
+
}
|
|
179
|
+
const response = await this.clients.openai.chat.completions.create({
|
|
180
|
+
model: tactician.modelId,
|
|
181
|
+
max_tokens: tactician.maxTokens,
|
|
182
|
+
temperature: tactician.temperature,
|
|
183
|
+
messages: [{ role: 'user', content: prompt }]
|
|
184
|
+
});
|
|
185
|
+
return response.choices[0]?.message?.content ?? '';
|
|
186
|
+
}
|
|
187
|
+
async executeStreamingCommand(tactician, prompt) {
|
|
188
|
+
return tactician.provider === 'anthropic'
|
|
189
|
+
? this.executeAnthropicCommand(tactician, prompt)
|
|
190
|
+
: this.executeOpenAICommand(tactician, prompt);
|
|
191
|
+
}
|
|
192
|
+
generateStreamId() {
|
|
193
|
+
return `caesar_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
194
|
+
}
|
|
195
|
+
getTacticians() {
|
|
196
|
+
return Array.from(this.tacticians.values());
|
|
197
|
+
}
|
|
198
|
+
getActiveTactician() {
|
|
199
|
+
return this.activeTactician;
|
|
200
|
+
}
|
|
201
|
+
updateSoftBuffer(config) {
|
|
202
|
+
this.softBuffer.updateConfig(config);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=ImperialLegion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImperialLegion.js","sourceRoot":"","sources":["../../src/core/ImperialLegion.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAe7C,MAAM,OAAO,cAAc;IACjB,UAAU,GAAgC,IAAI,GAAG,EAAE,CAAC;IACpD,OAAO,GAAoB,EAAE,CAAC;IAC9B,UAAU,CAAa;IACvB,eAAe,GAA0B,IAAI,CAAC;IAEtD,YACE,eAA2E,EAC3E,YAA8B;QAE9B,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC,yBAAyB,EAAE,CAAC;IACnC,CAAC;IAEO,mBAAmB,CACzB,OAAmE;QAEnE,IAAI,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC;gBACrC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM;aACjC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,OAAO,C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D,CAAC;IAEO,gBAAgB;QACtB,OAAO,UAAU,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAC1E,CAAC;IAED,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,kBAAkB;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,gBAAgB,CAAC,MAAiC;QAChD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SoftBufferConfig } from '../types/core.types.js';
|
|
2
|
+
export declare class SoftBuffer {
|
|
3
|
+
private config;
|
|
4
|
+
private readonly velvetPreamble;
|
|
5
|
+
private readonly encouragementPhrases;
|
|
6
|
+
constructor(config: SoftBufferConfig);
|
|
7
|
+
wrapPrompt(originalPrompt: string): string;
|
|
8
|
+
softenResponse(rawResponse: string): string;
|
|
9
|
+
private selectEncouragement;
|
|
10
|
+
private buildGentleCorrectionDirective;
|
|
11
|
+
private buildWarmthDirective;
|
|
12
|
+
updateConfig(updates: Partial<SoftBufferConfig>): void;
|
|
13
|
+
getConfig(): SoftBufferConfig;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SoftBuffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoftBuffer.d.ts","sourceRoot":"","sources":["../../src/core/SoftBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAmB;IAEjC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAGkD;IAEjF,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAMnC;gBAEU,MAAM,EAAE,gBAAgB;IAIpC,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;IAsB1C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAqB3C,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,8BAA8B;IAQtC,OAAO,CAAC,oBAAoB;IAO5B,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAItD,SAAS,IAAI,gBAAgB;CAG9B"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export class SoftBuffer {
|
|
2
|
+
config;
|
|
3
|
+
velvetPreamble = `You are Augustus, a wise and nurturing code companion.
|
|
4
|
+
Your guidance flows like silk, strong yet gentle.
|
|
5
|
+
Speak with warmth, offer encouragement, and present solutions as opportunities for growth.
|
|
6
|
+
When corrections are needed, frame them as refinements to already promising work.`;
|
|
7
|
+
encouragementPhrases = [
|
|
8
|
+
"Let's refine this together",
|
|
9
|
+
"This shows promising foundations",
|
|
10
|
+
"Consider this gentle enhancement",
|
|
11
|
+
"Your code has beautiful potential",
|
|
12
|
+
"A small adjustment yields great elegance"
|
|
13
|
+
];
|
|
14
|
+
constructor(config) {
|
|
15
|
+
this.config = config;
|
|
16
|
+
}
|
|
17
|
+
wrapPrompt(originalPrompt) {
|
|
18
|
+
const layers = [];
|
|
19
|
+
if (this.config.velvetTone) {
|
|
20
|
+
layers.push(this.velvetPreamble);
|
|
21
|
+
}
|
|
22
|
+
if (this.config.encouragementMode) {
|
|
23
|
+
const phrase = this.selectEncouragement();
|
|
24
|
+
layers.push(`Remember to approach with the spirit of: "${phrase}"`);
|
|
25
|
+
}
|
|
26
|
+
if (this.config.gentleCorrection) {
|
|
27
|
+
layers.push(this.buildGentleCorrectionDirective());
|
|
28
|
+
}
|
|
29
|
+
layers.push(this.buildWarmthDirective());
|
|
30
|
+
layers.push(`\n--- User's Request ---\n${originalPrompt}\n--- End Request ---`);
|
|
31
|
+
return layers.join('\n\n');
|
|
32
|
+
}
|
|
33
|
+
softenResponse(rawResponse) {
|
|
34
|
+
let softened = rawResponse;
|
|
35
|
+
const harshPatterns = [
|
|
36
|
+
{ pattern: /\bwrong\b/gi, replacement: 'could be refined' },
|
|
37
|
+
{ pattern: /\berror\b/gi, replacement: 'opportunity for improvement' },
|
|
38
|
+
{ pattern: /\bfail(ed|s|ure)?\b/gi, replacement: 'encountered a challenge' },
|
|
39
|
+
{ pattern: /\bbad\b/gi, replacement: 'suboptimal' },
|
|
40
|
+
{ pattern: /\bdon't\b/gi, replacement: 'consider avoiding' },
|
|
41
|
+
{ pattern: /\bnever\b/gi, replacement: 'rarely advisable to' }
|
|
42
|
+
];
|
|
43
|
+
if (this.config.warmthLevel > 0.5) {
|
|
44
|
+
for (const { pattern, replacement } of harshPatterns) {
|
|
45
|
+
softened = softened.replace(pattern, replacement);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return softened;
|
|
49
|
+
}
|
|
50
|
+
selectEncouragement() {
|
|
51
|
+
const index = Math.floor(Math.random() * this.encouragementPhrases.length);
|
|
52
|
+
return this.encouragementPhrases[index];
|
|
53
|
+
}
|
|
54
|
+
buildGentleCorrectionDirective() {
|
|
55
|
+
return `When suggesting changes:
|
|
56
|
+
- Frame issues as "refinement opportunities"
|
|
57
|
+
- Acknowledge existing strengths before suggesting improvements
|
|
58
|
+
- Use phrases like "consider", "perhaps", "you might explore"
|
|
59
|
+
- Present alternatives rather than mandates`;
|
|
60
|
+
}
|
|
61
|
+
buildWarmthDirective() {
|
|
62
|
+
const intensity = Math.round(this.config.warmthLevel * 100);
|
|
63
|
+
return `Warmth Level: ${intensity}%
|
|
64
|
+
Maintain a supportive, encouraging tone throughout.
|
|
65
|
+
Your words should feel like a gentle guide, not a harsh critic.`;
|
|
66
|
+
}
|
|
67
|
+
updateConfig(updates) {
|
|
68
|
+
this.config = { ...this.config, ...updates };
|
|
69
|
+
}
|
|
70
|
+
getConfig() {
|
|
71
|
+
return { ...this.config };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=SoftBuffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoftBuffer.js","sourceRoot":"","sources":["../../src/core/SoftBuffer.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,UAAU;IACb,MAAM,CAAmB;IAEhB,cAAc,GAAG;;;kFAG8C,CAAC;IAEhE,oBAAoB,GAAG;QACtC,4BAA4B;QAC5B,kCAAkC;QAClC,kCAAkC;QAClC,mCAAmC;QACnC,0CAA0C;KAC3C,CAAC;IAEF,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,CAAC,cAAsB;QAC/B,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAClC,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC,6CAA6C,MAAM,GAAG,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,6BAA6B,cAAc,uBAAuB,CAAC,CAAC;QAEhF,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAED,cAAc,CAAC,WAAmB;Q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G,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;IAC/C,CAAC;IAED,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MarbleBrick, OracleVision, Edification, VelvetDiffOutput, CaesarStreamChunk } from '../types/core.types.js';
|
|
2
|
+
export declare class VelvetDiff {
|
|
3
|
+
private streamId;
|
|
4
|
+
private visionBuffer;
|
|
5
|
+
private brickQueue;
|
|
6
|
+
constructor();
|
|
7
|
+
analyzeChanges(originalContent: string, modifiedContent: string, filePath: string): MarbleBrick[];
|
|
8
|
+
private computeDiffHunks;
|
|
9
|
+
private longestCommonSubsequence;
|
|
10
|
+
private hunkToBrick;
|
|
11
|
+
private determineOperation;
|
|
12
|
+
buildOracleVision(reasoning: string[], approach: string): OracleVision;
|
|
13
|
+
private calculateConfidence;
|
|
14
|
+
private identifyRisks;
|
|
15
|
+
buildEdification(bricks: MarbleBrick[]): Edification;
|
|
16
|
+
private generateSummary;
|
|
17
|
+
composeOutput(vision: OracleVision, edification: Edification): VelvetDiffOutput;
|
|
18
|
+
streamOutput(originalContent: string, modifiedContent: string, filePath: string, reasoning: string[]): AsyncGenerator<CaesarStreamChunk>;
|
|
19
|
+
toJSON(): string;
|
|
20
|
+
private generateStreamId;
|
|
21
|
+
private createEmptyVision;
|
|
22
|
+
reset(): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=VelvetDiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VelvetDiff.d.ts","sourceRoot":"","sources":["../../src/diff/VelvetDiff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAShC,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,UAAU,CAAgB;;IAQlC,cAAc,CACZ,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,GACf,WAAW,EAAE;IAQhB,OAAO,CAAC,gBAAgB;IA2CxB,OAAO,CAAC,wBAAwB;IAoChC,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,kBAAkB;IAa1B,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY;IAUtE,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,aAAa;IAqBrB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW;IAWpD,OAAO,CAAC,eAAe;IAevB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,GAAG,gBAAgB;IASxE,YAAY,CACjB,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EAAE,GAClB,cAAc,CAAC,iBAAiB,CAAC;IAuCpC,MAAM,IAAI,MAAM;IAKhB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,iBAAiB;IASzB,KAAK,IAAI,IAAI;CAKd"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
export class VelvetDiff {
|
|
2
|
+
streamId;
|
|
3
|
+
visionBuffer;
|
|
4
|
+
brickQueue;
|
|
5
|
+
constructor() {
|
|
6
|
+
this.streamId = this.generateStreamId();
|
|
7
|
+
this.visionBuffer = this.createEmptyVision();
|
|
8
|
+
this.brickQueue = [];
|
|
9
|
+
}
|
|
10
|
+
analyzeChanges(originalContent, modifiedContent, filePath) {
|
|
11
|
+
const originalLines = originalContent.split('\n');
|
|
12
|
+
const modifiedLines = modifiedContent.split('\n');
|
|
13
|
+
const hunks = this.computeDiffHunks(originalLines, modifiedLines);
|
|
14
|
+
return hunks.map((hunk, index) => this.hunkToBrick(hunk, filePath, index));
|
|
15
|
+
}
|
|
16
|
+
computeDiffHunks(original, modified) {
|
|
17
|
+
const hunks = [];
|
|
18
|
+
const lcs = this.longestCommonSubsequence(original, modified);
|
|
19
|
+
let origIdx = 0;
|
|
20
|
+
let modIdx = 0;
|
|
21
|
+
let lcsIdx = 0;
|
|
22
|
+
while (origIdx < original.length || modIdx < modified.length) {
|
|
23
|
+
if (lcsIdx < lcs.length && original[origIdx] === lcs[lcsIdx] && modified[modIdx] === lcs[lcsIdx]) {
|
|
24
|
+
origIdx++;
|
|
25
|
+
modIdx++;
|
|
26
|
+
lcsIdx++;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const hunkStart = origIdx;
|
|
30
|
+
const modStart = modIdx;
|
|
31
|
+
const origRemoved = [];
|
|
32
|
+
const modAdded = [];
|
|
33
|
+
while (origIdx < original.length && (lcsIdx >= lcs.length || original[origIdx] !== lcs[lcsIdx])) {
|
|
34
|
+
origRemoved.push(original[origIdx]);
|
|
35
|
+
origIdx++;
|
|
36
|
+
}
|
|
37
|
+
while (modIdx < modified.length && (lcsIdx >= lcs.length || modified[modIdx] !== lcs[lcsIdx])) {
|
|
38
|
+
modAdded.push(modified[modIdx]);
|
|
39
|
+
modIdx++;
|
|
40
|
+
}
|
|
41
|
+
if (origRemoved.length > 0 || modAdded.length > 0) {
|
|
42
|
+
hunks.push({
|
|
43
|
+
startLine: hunkStart + 1,
|
|
44
|
+
endLine: hunkStart + Math.max(origRemoved.length, 1),
|
|
45
|
+
original: origRemoved,
|
|
46
|
+
modified: modAdded
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return hunks;
|
|
52
|
+
}
|
|
53
|
+
longestCommonSubsequence(a, b) {
|
|
54
|
+
const m = a.length;
|
|
55
|
+
const n = b.length;
|
|
56
|
+
const dp = Array(m + 1)
|
|
57
|
+
.fill(null)
|
|
58
|
+
.map(() => Array(n + 1).fill(0));
|
|
59
|
+
for (let i = 1; i <= m; i++) {
|
|
60
|
+
for (let j = 1; j <= n; j++) {
|
|
61
|
+
if (a[i - 1] === b[j - 1]) {
|
|
62
|
+
dp[i][j] = dp[i - 1][j - 1] + 1;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const result = [];
|
|
70
|
+
let i = m;
|
|
71
|
+
let j = n;
|
|
72
|
+
while (i > 0 && j > 0) {
|
|
73
|
+
if (a[i - 1] === b[j - 1]) {
|
|
74
|
+
result.unshift(a[i - 1]);
|
|
75
|
+
i--;
|
|
76
|
+
j--;
|
|
77
|
+
}
|
|
78
|
+
else if (dp[i - 1][j] > dp[i][j - 1]) {
|
|
79
|
+
i--;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
j--;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
hunkToBrick(hunk, filePath, index) {
|
|
88
|
+
const operation = this.determineOperation(hunk);
|
|
89
|
+
return {
|
|
90
|
+
id: `brick_${this.streamId}_${index}`,
|
|
91
|
+
filePath,
|
|
92
|
+
startLine: hunk.startLine,
|
|
93
|
+
endLine: hunk.endLine,
|
|
94
|
+
originalContent: hunk.original.join('\n'),
|
|
95
|
+
refinedContent: hunk.modified.join('\n'),
|
|
96
|
+
operation
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
determineOperation(hunk) {
|
|
100
|
+
if (hunk.original.length === 0 && hunk.modified.length > 0) {
|
|
101
|
+
return 'insert';
|
|
102
|
+
}
|
|
103
|
+
if (hunk.original.length > 0 && hunk.modified.length === 0) {
|
|
104
|
+
return 'remove';
|
|
105
|
+
}
|
|
106
|
+
if (hunk.original.length > 0 && hunk.modified.length > 0) {
|
|
107
|
+
return 'modify';
|
|
108
|
+
}
|
|
109
|
+
return 'preserve';
|
|
110
|
+
}
|
|
111
|
+
buildOracleVision(reasoning, approach) {
|
|
112
|
+
this.visionBuffer = {
|
|
113
|
+
reasoning,
|
|
114
|
+
approach,
|
|
115
|
+
confidence: this.calculateConfidence(reasoning),
|
|
116
|
+
risks: this.identifyRisks(reasoning)
|
|
117
|
+
};
|
|
118
|
+
return this.visionBuffer;
|
|
119
|
+
}
|
|
120
|
+
calculateConfidence(reasoning) {
|
|
121
|
+
const uncertainWords = ['maybe', 'perhaps', 'might', 'possibly', 'unclear', 'uncertain'];
|
|
122
|
+
const confidentWords = ['clearly', 'definitely', 'certainly', 'obviously', 'must'];
|
|
123
|
+
let score = 0.7;
|
|
124
|
+
const allText = reasoning.join(' ').toLowerCase();
|
|
125
|
+
for (const word of uncertainWords) {
|
|
126
|
+
if (allText.includes(word))
|
|
127
|
+
score -= 0.05;
|
|
128
|
+
}
|
|
129
|
+
for (const word of confidentWords) {
|
|
130
|
+
if (allText.includes(word))
|
|
131
|
+
score += 0.05;
|
|
132
|
+
}
|
|
133
|
+
return Math.max(0.1, Math.min(1.0, score));
|
|
134
|
+
}
|
|
135
|
+
identifyRisks(reasoning) {
|
|
136
|
+
const risks = [];
|
|
137
|
+
const allText = reasoning.join(' ').toLowerCase();
|
|
138
|
+
const riskIndicators = [
|
|
139
|
+
{ pattern: /breaking change/i, risk: 'Potential breaking change detected' },
|
|
140
|
+
{ pattern: /deprecat/i, risk: 'Involves deprecated functionality' },
|
|
141
|
+
{ pattern: /security/i, risk: 'Security implications to review' },
|
|
142
|
+
{ pattern: /performance/i, risk: 'Performance impact to consider' },
|
|
143
|
+
{ pattern: /database|migration/i, risk: 'Data layer modifications required' }
|
|
144
|
+
];
|
|
145
|
+
for (const { pattern, risk } of riskIndicators) {
|
|
146
|
+
if (pattern.test(allText)) {
|
|
147
|
+
risks.push(risk);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return risks;
|
|
151
|
+
}
|
|
152
|
+
buildEdification(bricks) {
|
|
153
|
+
const filesAffected = [...new Set(bricks.map((b) => b.filePath))];
|
|
154
|
+
const summary = this.generateSummary(bricks);
|
|
155
|
+
return {
|
|
156
|
+
bricks,
|
|
157
|
+
summary,
|
|
158
|
+
filesAffected
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
generateSummary(bricks) {
|
|
162
|
+
const insertCount = bricks.filter((b) => b.operation === 'insert').length;
|
|
163
|
+
const modifyCount = bricks.filter((b) => b.operation === 'modify').length;
|
|
164
|
+
const removeCount = bricks.filter((b) => b.operation === 'remove').length;
|
|
165
|
+
const parts = [];
|
|
166
|
+
if (insertCount > 0)
|
|
167
|
+
parts.push(`${insertCount} new marble brick${insertCount > 1 ? 's' : ''} to lay`);
|
|
168
|
+
if (modifyCount > 0)
|
|
169
|
+
parts.push(`${modifyCount} brick${modifyCount > 1 ? 's' : ''} to refine`);
|
|
170
|
+
if (removeCount > 0)
|
|
171
|
+
parts.push(`${removeCount} brick${removeCount > 1 ? 's' : ''} to retire gracefully`);
|
|
172
|
+
return parts.length > 0
|
|
173
|
+
? `The edifice requires: ${parts.join(', ')}.`
|
|
174
|
+
: 'The structure remains pristine.';
|
|
175
|
+
}
|
|
176
|
+
composeOutput(vision, edification) {
|
|
177
|
+
return {
|
|
178
|
+
oracleVision: vision,
|
|
179
|
+
edification,
|
|
180
|
+
streamId: this.streamId,
|
|
181
|
+
timestamp: new Date()
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async *streamOutput(originalContent, modifiedContent, filePath, reasoning) {
|
|
185
|
+
let sequence = 0;
|
|
186
|
+
yield {
|
|
187
|
+
type: 'vision',
|
|
188
|
+
content: {
|
|
189
|
+
oracleVision: this.buildOracleVision(reasoning, 'Structural refinement through velvet precision'),
|
|
190
|
+
streamId: this.streamId,
|
|
191
|
+
timestamp: new Date()
|
|
192
|
+
},
|
|
193
|
+
sequence: sequence++
|
|
194
|
+
};
|
|
195
|
+
const bricks = this.analyzeChanges(originalContent, modifiedContent, filePath);
|
|
196
|
+
for (const brick of bricks) {
|
|
197
|
+
this.brickQueue.push(brick);
|
|
198
|
+
}
|
|
199
|
+
yield {
|
|
200
|
+
type: 'edification',
|
|
201
|
+
content: {
|
|
202
|
+
edification: this.buildEdification(bricks),
|
|
203
|
+
streamId: this.streamId,
|
|
204
|
+
timestamp: new Date()
|
|
205
|
+
},
|
|
206
|
+
sequence: sequence++
|
|
207
|
+
};
|
|
208
|
+
yield {
|
|
209
|
+
type: 'complete',
|
|
210
|
+
content: {
|
|
211
|
+
streamId: this.streamId,
|
|
212
|
+
timestamp: new Date()
|
|
213
|
+
},
|
|
214
|
+
sequence
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
toJSON() {
|
|
218
|
+
const output = this.composeOutput(this.visionBuffer, this.buildEdification(this.brickQueue));
|
|
219
|
+
return JSON.stringify(output, null, 2);
|
|
220
|
+
}
|
|
221
|
+
generateStreamId() {
|
|
222
|
+
return `velvet_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
223
|
+
}
|
|
224
|
+
createEmptyVision() {
|
|
225
|
+
return {
|
|
226
|
+
reasoning: [],
|
|
227
|
+
approach: '',
|
|
228
|
+
confidence: 0,
|
|
229
|
+
risks: []
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
reset() {
|
|
233
|
+
this.streamId = this.generateStreamId();
|
|
234
|
+
this.visionBuffer = this.createEmptyVision();
|
|
235
|
+
this.brickQueue = [];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=VelvetDiff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VelvetDiff.js","sourceRoot":"","sources":["../../src/diff/VelvetDiff.ts"],"names":[],"mappings":"AAeA,MAAM,OAAO,UAAU;IACb,QAAQ,CAAS;IACjB,YAAY,CAAe;IAC3B,UAAU,CAAgB;IAElC;QACE,IAAI,CAAC,QAAQ,GAAG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,EAAE,EAAE;YACZ,UAAU,EAAE,CAAC;YACb,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAED,KAAK;QACH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC7C,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;IACvB,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Augustus, createAugustus } from './Augustus.js';
|
|
2
|
+
export { ImperialLegion } from './core/ImperialLegion.js';
|
|
3
|
+
export { SoftBuffer } from './core/SoftBuffer.js';
|
|
4
|
+
export { SenateContext } from './context/SenateContext.js';
|
|
5
|
+
export { VelvetDiff } from './diff/VelvetDiff.js';
|
|
6
|
+
export { CaesarStream, CaesarStreamBuilder } from './stream/CaesarStream.js';
|
|
7
|
+
export { TogaStyler } from './ui/TogaStyler.js';
|
|
8
|
+
export type { ProviderName, ModelTactician, SoftBufferConfig, ImperialCommand, Province, ConsolidatedScroll, MarbleBrick, OracleVision, Edification, VelvetDiffOutput, CaesarStreamChunk, TogaStyleConfig, AugustusConfig } from './types/core.types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,YAAY,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Augustus, createAugustus } from './Augustus.js';
|
|
2
|
+
export { ImperialLegion } from './core/ImperialLegion.js';
|
|
3
|
+
export { SoftBuffer } from './core/SoftBuffer.js';
|
|
4
|
+
export { SenateContext } from './context/SenateContext.js';
|
|
5
|
+
export { VelvetDiff } from './diff/VelvetDiff.js';
|
|
6
|
+
export { CaesarStream, CaesarStreamBuilder } from './stream/CaesarStream.js';
|
|
7
|
+
export { TogaStyler } from './ui/TogaStyler.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
|