@causyne/agent 1.20.14 → 1.20.15
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/package.json
CHANGED
|
@@ -16,6 +16,8 @@ export function actionLimitFor(archetype) {
|
|
|
16
16
|
return 25;
|
|
17
17
|
if (archetype === 'game_development' || archetype === 'game')
|
|
18
18
|
return 250;
|
|
19
|
+
if (archetype === 'software_engineering' || archetype === 'backend_engineering')
|
|
20
|
+
return 200;
|
|
19
21
|
if (archetype === 'web_engineering')
|
|
20
22
|
return 120;
|
|
21
23
|
return 35;
|
|
@@ -25,6 +27,8 @@ export function tokenLimitFor(archetype) {
|
|
|
25
27
|
return 150_000;
|
|
26
28
|
if (archetype === 'game_development' || archetype === 'game')
|
|
27
29
|
return 3_000_000;
|
|
30
|
+
if (archetype === 'software_engineering' || archetype === 'backend_engineering')
|
|
31
|
+
return 2_500_000;
|
|
28
32
|
if (archetype === 'media_3d_generation')
|
|
29
33
|
return 400_000;
|
|
30
34
|
if (archetype === 'web_engineering' || archetype === 'web_fullstack')
|
|
@@ -34,6 +38,8 @@ export function tokenLimitFor(archetype) {
|
|
|
34
38
|
export function turnTokenLimitFor(archetype) {
|
|
35
39
|
if (archetype === 'game_development' || archetype === 'game')
|
|
36
40
|
return 1_000_000;
|
|
41
|
+
if (archetype === 'software_engineering' || archetype === 'backend_engineering')
|
|
42
|
+
return 1_000_000;
|
|
37
43
|
if (archetype === 'web_engineering' || archetype === 'web_fullstack')
|
|
38
44
|
return 250_000;
|
|
39
45
|
if (archetype === 'media_3d_generation')
|
|
@@ -50,8 +56,10 @@ export class EfficiencyCheckpoint extends Error {
|
|
|
50
56
|
scope;
|
|
51
57
|
constructor(reason, used, limit, scope = 'task') {
|
|
52
58
|
const scopeLabel = scope === 'turn' ? 'single-turn' : 'task';
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
const guidance = scope === 'turn'
|
|
60
|
+
? 'Auto-compacting context and continuing task execution.'
|
|
61
|
+
: 'Session history is retained; continue from this checkpoint without repeating completed actions.';
|
|
62
|
+
super(`Efficiency checkpoint: ${used.toLocaleString()} ${reason} reached the ${limit.toLocaleString()} ${scopeLabel} limit. ${guidance}`);
|
|
55
63
|
this.name = 'EfficiencyCheckpoint';
|
|
56
64
|
this.reason = reason;
|
|
57
65
|
this.used = used;
|
|
@@ -23,6 +23,7 @@ export function actionLimitFor(archetype: string): number {
|
|
|
23
23
|
if (archetype === 'desktop_personalization') return 12;
|
|
24
24
|
if (archetype === 'media_3d_generation') return 25;
|
|
25
25
|
if (archetype === 'game_development' || archetype === 'game') return 250;
|
|
26
|
+
if (archetype === 'software_engineering' || archetype === 'backend_engineering') return 200;
|
|
26
27
|
if (archetype === 'web_engineering') return 120;
|
|
27
28
|
return 35;
|
|
28
29
|
}
|
|
@@ -30,6 +31,7 @@ export function actionLimitFor(archetype: string): number {
|
|
|
30
31
|
export function tokenLimitFor(archetype: string): number {
|
|
31
32
|
if (archetype === 'desktop_personalization') return 150_000;
|
|
32
33
|
if (archetype === 'game_development' || archetype === 'game') return 3_000_000;
|
|
34
|
+
if (archetype === 'software_engineering' || archetype === 'backend_engineering') return 2_500_000;
|
|
33
35
|
if (archetype === 'media_3d_generation') return 400_000;
|
|
34
36
|
if (archetype === 'web_engineering' || archetype === 'web_fullstack') return 500_000;
|
|
35
37
|
return 100_000;
|
|
@@ -37,6 +39,7 @@ export function tokenLimitFor(archetype: string): number {
|
|
|
37
39
|
|
|
38
40
|
export function turnTokenLimitFor(archetype: string): number {
|
|
39
41
|
if (archetype === 'game_development' || archetype === 'game') return 1_000_000;
|
|
42
|
+
if (archetype === 'software_engineering' || archetype === 'backend_engineering') return 1_000_000;
|
|
40
43
|
if (archetype === 'web_engineering' || archetype === 'web_fullstack') return 250_000;
|
|
41
44
|
if (archetype === 'media_3d_generation') return 200_000;
|
|
42
45
|
if (archetype === 'desktop_personalization') return 100_000;
|
|
@@ -52,8 +55,10 @@ export class EfficiencyCheckpoint extends Error {
|
|
|
52
55
|
|
|
53
56
|
constructor(reason: 'tokens' | 'actions', used: number, limit: number, scope: 'turn' | 'task' = 'task') {
|
|
54
57
|
const scopeLabel = scope === 'turn' ? 'single-turn' : 'task';
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
const guidance = scope === 'turn'
|
|
59
|
+
? 'Auto-compacting context and continuing task execution.'
|
|
60
|
+
: 'Session history is retained; continue from this checkpoint without repeating completed actions.';
|
|
61
|
+
super(`Efficiency checkpoint: ${used.toLocaleString()} ${reason} reached the ${limit.toLocaleString()} ${scopeLabel} limit. ${guidance}`);
|
|
57
62
|
this.name = 'EfficiencyCheckpoint';
|
|
58
63
|
this.reason = reason;
|
|
59
64
|
this.used = used;
|
package/src/smartToolsUse.js
CHANGED
|
@@ -122,14 +122,16 @@ const PURE_WEB_SEARCH_PATTERN = /\b(search(ing)? (the )?web|web search|look up o
|
|
|
122
122
|
const WEB_CONSTRUCTION_EXCLUSION = /\b(build|create|make|design|develop|scaffold|code|program|css|html|tailwind|component|frontend|front-end|landing page|website|webpage|dashboard)\b/i;
|
|
123
123
|
// System admin / process & terminal operations
|
|
124
124
|
const SYSTEM_ADMIN_PATTERN = /\b(kill process|kill port|check port|port \d+|lsof|ps aux|terminate process|zip folder|unzip file|extract archive|compress folder)\b/i;
|
|
125
|
-
// Simple file management operations
|
|
126
|
-
const SIMPLE_FILE_OP_PATTERN = /\b(list (the )?files|show files|count files|rename file(s)?|delete file(s)?|move file(s)?|clean (up )?folder)\b/i;
|
|
125
|
+
// Simple file management operations (reading small notes, listing/deleting/moving files)
|
|
126
|
+
const SIMPLE_FILE_OP_PATTERN = /\b(list (the )?files|show files|count files|rename file(s)?|delete file(s)?|move file(s)?|clean (up )?folder|read (the )?(?:note|file)|summarize (?:its )?content)\b/i;
|
|
127
127
|
// Media generation intent (explicit creation of 3D, video, audio, or synthesized speech)
|
|
128
128
|
const EXPLICIT_MEDIA_GENERATION_PATTERN = /\b(blender|3d model|render 3d|render frame|render animation|da vinci|resolve|audio synth|synthesizer|text to speech|tts|voiceover|dubbing)\b|\.blend\d*\b/i;
|
|
129
129
|
// Explicit web engineering intent
|
|
130
130
|
const EXPLICIT_WEB_ENGINEERING_PATTERN = /\b(build|create|make|design|develop|implement|redesign|buat\w*)\b[\s\S]*\b(web|website|webpage|webapp|landing page|dashboard|ui|frontend|threejs|three\.js|thre\.?js|3js|webgl|canvas)\b/i;
|
|
131
131
|
// Explicit game development intent
|
|
132
|
-
const EXPLICIT_GAME_DEV_PATTERN = /(?:\b(build
|
|
132
|
+
const EXPLICIT_GAME_DEV_PATTERN = /(?:\b(?:build|create|make|design|develop|scaffold|render|animate|code|program|buat\w*|bikin\w*)[\s\S]*(?:game|simulation|simulator|simulasi|interactive|3d|three\.?js|threejs|webgl|canvas3d|babylonjs|godot|unity|unreal|platformer|rpg|arcade)\b|\b(?:game|gamedev|godot|unity|unreal|platformer|rpg|arcade|simulator|simulation|simulasi|interactive)\b|\b3d\s*(?:game|app|simulator|simulation|scene|city|world|view|body|human|anatomy|model|mesh|character|rendering|visualization|experience|space|environment)\b|\bin 3d\b|[-_]3d\b|\b3d[-_]|\b(?:threejs|three\.js|webgl|canvas3d|babylonjs)\b)/i;
|
|
133
|
+
// Explicit software and systems engineering intent (backend, APIs, refactoring, algorithms, testing, architecture, CLI tools)
|
|
134
|
+
const EXPLICIT_SOFTWARE_ENGINEERING_PATTERN = /(?:\b(?:build|create|code|program|develop|refactor|debug|fix|implement|test|optimize|write|add|modify|migrate|architect|engineer|benchmark|profile|audit)\b[\s\S]*\b(?:api|backend|service|microservice|server|database|schema|endpoint|controller|auth|test|spec|algorithm|function|module|class|feature|script|pipeline|codebase|repo|repository|bug|issue|engine|tool|cli|library|sdk|migration|handler|worker|queue|stream)\b|\b(?:python|rust|golang|c\+\+|cpp|java|typescript|javascript|ruby|php|sql|bash|shell|docker|k8s|kubernetes)\b)/i;
|
|
133
135
|
/**
|
|
134
136
|
* Select tools to preload based on prompt intent. This is never an allowlist:
|
|
135
137
|
* tool_search can add capabilities as the task develops.
|
|
@@ -196,7 +198,7 @@ export function determineToolScope(prompt, _taskShape) {
|
|
|
196
198
|
};
|
|
197
199
|
}
|
|
198
200
|
// 4. Simple local file manipulation
|
|
199
|
-
if (SIMPLE_FILE_OP_PATTERN.test(text) && !EXPLICIT_WEB_ENGINEERING_PATTERN.test(text) && !EXPLICIT_GAME_DEV_PATTERN.test(text)) {
|
|
201
|
+
if (SIMPLE_FILE_OP_PATTERN.test(text) && !EXPLICIT_WEB_ENGINEERING_PATTERN.test(text) && !EXPLICIT_GAME_DEV_PATTERN.test(text) && !EXPLICIT_SOFTWARE_ENGINEERING_PATTERN.test(text)) {
|
|
200
202
|
const tools = new Set([
|
|
201
203
|
'fs_read',
|
|
202
204
|
'fs_write',
|
|
@@ -276,6 +278,28 @@ export function determineToolScope(prompt, _taskShape) {
|
|
|
276
278
|
reason: 'Game development and simulation intent focuses on game code, assets, terminal execution, and browser/screen verification.'
|
|
277
279
|
};
|
|
278
280
|
}
|
|
281
|
+
// 8. Software and systems engineering intent (backend, APIs, refactoring, algorithms, testing, architecture, CLI tools)
|
|
282
|
+
if (EXPLICIT_SOFTWARE_ENGINEERING_PATTERN.test(text)) {
|
|
283
|
+
const tools = new Set([
|
|
284
|
+
'fs_write',
|
|
285
|
+
'fs_edit',
|
|
286
|
+
'fs_read',
|
|
287
|
+
'fs_list',
|
|
288
|
+
'fs_search',
|
|
289
|
+
'sysRun',
|
|
290
|
+
'browser_act',
|
|
291
|
+
'screenshot',
|
|
292
|
+
'vision_inspect_ui',
|
|
293
|
+
'update_plan',
|
|
294
|
+
'tool_search'
|
|
295
|
+
]);
|
|
296
|
+
return {
|
|
297
|
+
toolScope: tools,
|
|
298
|
+
archetype: 'software_engineering',
|
|
299
|
+
suppressedPacks: ['media', 'game'],
|
|
300
|
+
reason: 'Software engineering intent focuses on code authoring, search, terminal execution, and verification; suppresses creative media and game packs.'
|
|
301
|
+
};
|
|
302
|
+
}
|
|
279
303
|
// Default: unconstrained (standard progressive disclosure and packs apply)
|
|
280
304
|
return {
|
|
281
305
|
toolScope: null,
|
package/src/smartToolsUse.ts
CHANGED
|
@@ -160,9 +160,9 @@ const WEB_CONSTRUCTION_EXCLUSION =
|
|
|
160
160
|
const SYSTEM_ADMIN_PATTERN =
|
|
161
161
|
/\b(kill process|kill port|check port|port \d+|lsof|ps aux|terminate process|zip folder|unzip file|extract archive|compress folder)\b/i;
|
|
162
162
|
|
|
163
|
-
// Simple file management operations
|
|
163
|
+
// Simple file management operations (reading small notes, listing/deleting/moving files)
|
|
164
164
|
const SIMPLE_FILE_OP_PATTERN =
|
|
165
|
-
/\b(list (the )?files|show files|count files|rename file(s)?|delete file(s)?|move file(s)?|clean (up )?folder)\b/i;
|
|
165
|
+
/\b(list (the )?files|show files|count files|rename file(s)?|delete file(s)?|move file(s)?|clean (up )?folder|read (the )?(?:note|file)|summarize (?:its )?content)\b/i;
|
|
166
166
|
|
|
167
167
|
// Media generation intent (explicit creation of 3D, video, audio, or synthesized speech)
|
|
168
168
|
const EXPLICIT_MEDIA_GENERATION_PATTERN =
|
|
@@ -174,7 +174,11 @@ const EXPLICIT_WEB_ENGINEERING_PATTERN =
|
|
|
174
174
|
|
|
175
175
|
// Explicit game development intent
|
|
176
176
|
const EXPLICIT_GAME_DEV_PATTERN =
|
|
177
|
-
/(?:\b(build
|
|
177
|
+
/(?:\b(?:build|create|make|design|develop|scaffold|render|animate|code|program|buat\w*|bikin\w*)[\s\S]*(?:game|simulation|simulator|simulasi|interactive|3d|three\.?js|threejs|webgl|canvas3d|babylonjs|godot|unity|unreal|platformer|rpg|arcade)\b|\b(?:game|gamedev|godot|unity|unreal|platformer|rpg|arcade|simulator|simulation|simulasi|interactive)\b|\b3d\s*(?:game|app|simulator|simulation|scene|city|world|view|body|human|anatomy|model|mesh|character|rendering|visualization|experience|space|environment)\b|\bin 3d\b|[-_]3d\b|\b3d[-_]|\b(?:threejs|three\.js|webgl|canvas3d|babylonjs)\b)/i;
|
|
178
|
+
|
|
179
|
+
// Explicit software and systems engineering intent (backend, APIs, refactoring, algorithms, testing, architecture, CLI tools)
|
|
180
|
+
const EXPLICIT_SOFTWARE_ENGINEERING_PATTERN =
|
|
181
|
+
/(?:\b(?:build|create|code|program|develop|refactor|debug|fix|implement|test|optimize|write|add|modify|migrate|architect|engineer|benchmark|profile|audit)\b[\s\S]*\b(?:api|backend|service|microservice|server|database|schema|endpoint|controller|auth|test|spec|algorithm|function|module|class|feature|script|pipeline|codebase|repo|repository|bug|issue|engine|tool|cli|library|sdk|migration|handler|worker|queue|stream)\b|\b(?:python|rust|golang|c\+\+|cpp|java|typescript|javascript|ruby|php|sql|bash|shell|docker|k8s|kubernetes)\b)/i;
|
|
178
182
|
|
|
179
183
|
/**
|
|
180
184
|
* Select tools to preload based on prompt intent. This is never an allowlist:
|
|
@@ -249,7 +253,7 @@ export function determineToolScope(
|
|
|
249
253
|
}
|
|
250
254
|
|
|
251
255
|
// 4. Simple local file manipulation
|
|
252
|
-
if (SIMPLE_FILE_OP_PATTERN.test(text) && !EXPLICIT_WEB_ENGINEERING_PATTERN.test(text) && !EXPLICIT_GAME_DEV_PATTERN.test(text)) {
|
|
256
|
+
if (SIMPLE_FILE_OP_PATTERN.test(text) && !EXPLICIT_WEB_ENGINEERING_PATTERN.test(text) && !EXPLICIT_GAME_DEV_PATTERN.test(text) && !EXPLICIT_SOFTWARE_ENGINEERING_PATTERN.test(text)) {
|
|
253
257
|
const tools = new Set([
|
|
254
258
|
'fs_read',
|
|
255
259
|
'fs_write',
|
|
@@ -333,6 +337,29 @@ export function determineToolScope(
|
|
|
333
337
|
};
|
|
334
338
|
}
|
|
335
339
|
|
|
340
|
+
// 8. Software and systems engineering intent (backend, APIs, refactoring, algorithms, testing, architecture, CLI tools)
|
|
341
|
+
if (EXPLICIT_SOFTWARE_ENGINEERING_PATTERN.test(text)) {
|
|
342
|
+
const tools = new Set([
|
|
343
|
+
'fs_write',
|
|
344
|
+
'fs_edit',
|
|
345
|
+
'fs_read',
|
|
346
|
+
'fs_list',
|
|
347
|
+
'fs_search',
|
|
348
|
+
'sysRun',
|
|
349
|
+
'browser_act',
|
|
350
|
+
'screenshot',
|
|
351
|
+
'vision_inspect_ui',
|
|
352
|
+
'update_plan',
|
|
353
|
+
'tool_search'
|
|
354
|
+
]);
|
|
355
|
+
return {
|
|
356
|
+
toolScope: tools,
|
|
357
|
+
archetype: 'software_engineering',
|
|
358
|
+
suppressedPacks: ['media', 'game'],
|
|
359
|
+
reason: 'Software engineering intent focuses on code authoring, search, terminal execution, and verification; suppresses creative media and game packs.'
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
336
363
|
// Default: unconstrained (standard progressive disclosure and packs apply)
|
|
337
364
|
return {
|
|
338
365
|
toolScope: null,
|