@causyne/agent 1.20.8 → 1.20.10
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 +2 -1
- package/src/agentLoop.js +291 -103
- package/src/agentLoop.ts +322 -109
- package/src/browser/causyneBrowser.js +36 -0
- package/src/browser/causyneBrowser.ts +36 -1
- package/src/commands.js +25 -0
- package/src/compiledSkills.js +7330 -319
- package/src/computerUse/types.js +8 -0
- package/src/computerUse/types.ts +121 -0
- package/src/computerUse/visionGrounding.js +87 -29
- package/src/computerUse/visionGrounding.ts +108 -36
- package/src/contextManager.js +16 -0
- package/src/decisionPolicy.js +7 -9
- package/src/decisionPolicy.ts +7 -9
- package/src/documentEngine/antiSlopAuditor.js +13 -43
- package/src/documentEngine/antiSlopAuditor.ts +15 -47
- package/src/documentEngine/documentForge.js +3 -3
- package/src/documentEngine/documentForge.ts +3 -3
- package/src/launchIntent.js +3 -3
- package/src/launchIntent.ts +3 -3
- package/src/planCache.js +4 -14
- package/src/planCache.ts +4 -14
- package/src/providers/acp.js +4 -2
- package/src/providers/acp.ts +4 -2
- package/src/providers/antigravity.js +191 -28
- package/src/providers/antigravity.ts +192 -27
- package/src/providers/base.d.ts +2 -0
- package/src/providers/pi.js +3 -1
- package/src/providers/pi.ts +4 -2
- package/src/provisioning/capabilityProvisioner.js +2 -7
- package/src/provisioning/npmInstall.js +19 -0
- package/src/provisioning/npmInstall.ts +19 -0
- package/src/sandbox.js +7 -10
- package/src/smartToolsUse.js +223 -0
- package/src/smartToolsUse.ts +284 -0
- package/src/stallGuard.js +356 -0
- package/src/stallGuard.ts +432 -0
- package/src/taskShape.js +7 -7
- package/src/taskShape.ts +7 -7
- package/src/toolPacks.js +5 -5
- package/src/tools/blenderAutomator.js +198 -11
- package/src/tools/browserAutomator.js +3 -3
- package/src/tools/browserAutomator.ts +3 -3
- package/src/tools/documentForge.js +1 -1
- package/src/tools/documentForge.ts +1 -1
- package/src/tools/fsRead.js +91 -80
- package/src/tools/fsRead.ts +125 -0
- package/src/tools/peerAgent.js +1 -1
- package/src/tools/peerAgent.ts +1 -1
- package/src/tools/screenshot.js +5 -1
- package/src/tools/screenshot.ts +5 -1
- package/src/tools/toolScanner.js +19 -0
- package/src/tools/toolScanner.ts +17 -0
- package/src/tools/toolSelfRepair.js +63 -1
- package/src/tools/toolSelfRepair.ts +61 -1
- package/src/tools/visionInspector.js +80 -142
- package/src/tools/visionInspector.ts +110 -0
- package/src/tui/chatboxClipboard.js +152 -0
- package/src/tui/chatboxClipboard.ts +201 -0
- package/src/tui/clipboardSync.js +38 -7
- package/src/tui/clipboardSync.ts +39 -7
- package/src/tui/codeProgress.js +89 -18
- package/src/tui/codeProgress.ts +102 -17
- package/src/tui/codeStreamRenderer.js +7 -2
- package/src/tui/codeStreamRenderer.ts +7 -2
- package/src/tui/composerControls.js +9 -0
- package/src/tui/composerControls.ts +9 -0
- package/src/tui/dialogs.js +8 -3
- package/src/tui/diff.d.ts +1 -0
- package/src/tui/lineEditor.js +166 -14
- package/src/tui/mouseHover.js +6 -2
- package/src/tui/mouseHover.ts +7 -2
- package/src/tui/prompt.js +96 -19
- package/src/tui/stageSurface.js +3 -1
|
@@ -6,18 +6,6 @@
|
|
|
6
6
|
* Enforces authentic human cadence, strict hyphenation rules, and zero ungrounded placeholders.
|
|
7
7
|
*/
|
|
8
8
|
const BANNED_LONG_DASHES = /[—–]/g;
|
|
9
|
-
const AI_SLOP_CLICHES_ID = [
|
|
10
|
-
/\bsangatlah\b/i,
|
|
11
|
-
/\btak terbantahkan\b/i,
|
|
12
|
-
/\brevolusioner\b/i,
|
|
13
|
-
/\bgame[- ]?changer\b/i,
|
|
14
|
-
/\bdi era yang serba\b/i,
|
|
15
|
-
/\bmari kita\b/i,
|
|
16
|
-
/\btidak dapat dipungkiri\b/i,
|
|
17
|
-
/\bperlu diingat bahwa\b/i,
|
|
18
|
-
/\bdalam lanskap modern\b/i,
|
|
19
|
-
/\bmerupakan sebuah bukti nyata\b/i
|
|
20
|
-
];
|
|
21
9
|
const AI_SLOP_CLICHES_EN = [
|
|
22
10
|
/\bdelve(?:s|d|ing)?\b/i,
|
|
23
11
|
/\bcrucial(?:ly)?\b/i,
|
|
@@ -36,8 +24,8 @@ const AI_SLOP_CLICHES_EN = [
|
|
|
36
24
|
/\bholistic approach\b/i
|
|
37
25
|
];
|
|
38
26
|
const PLACEHOLDER_BRACKETS = [
|
|
39
|
-
/\[(?:insert|
|
|
40
|
-
/<(?:insert|
|
|
27
|
+
/\[(?:insert|placeholder|tbd|todo|name|date|location)[^\]]*\]/i,
|
|
28
|
+
/<(?:insert|placeholder|tbd|todo)[^>]*>/i
|
|
41
29
|
];
|
|
42
30
|
/**
|
|
43
31
|
* Scan raw text or HTML content for AI slop, long em-dashes, and placeholder tokens.
|
|
@@ -45,7 +33,6 @@ const PLACEHOLDER_BRACKETS = [
|
|
|
45
33
|
export function auditTextContent(content, options = {}) {
|
|
46
34
|
const findings = [];
|
|
47
35
|
const lines = (content || '').split(/\r?\n/);
|
|
48
|
-
const lang = options.language || 'both';
|
|
49
36
|
const strictDashes = options.strictDashes !== false;
|
|
50
37
|
lines.forEach((line, idx) => {
|
|
51
38
|
const lineNum = idx + 1;
|
|
@@ -75,34 +62,17 @@ export function auditTextContent(content, options = {}) {
|
|
|
75
62
|
});
|
|
76
63
|
}
|
|
77
64
|
}
|
|
78
|
-
// 3. AI Slop Cliches (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
// 4. AI Slop Cliches (EN)
|
|
94
|
-
if (lang === 'en' || lang === 'both') {
|
|
95
|
-
for (const pat of AI_SLOP_CLICHES_EN) {
|
|
96
|
-
const m = line.match(pat);
|
|
97
|
-
if (m) {
|
|
98
|
-
findings.push({
|
|
99
|
-
rule: 'anti_ai_slop_phrase_en',
|
|
100
|
-
severity: 'warning',
|
|
101
|
-
match: m[0],
|
|
102
|
-
line: lineNum,
|
|
103
|
-
message: `Found generic AI trope "${m[0]}". Replace with concrete, factual language.`
|
|
104
|
-
});
|
|
105
|
-
}
|
|
65
|
+
// 3. AI Slop Cliches (EN)
|
|
66
|
+
for (const pat of AI_SLOP_CLICHES_EN) {
|
|
67
|
+
const m = line.match(pat);
|
|
68
|
+
if (m) {
|
|
69
|
+
findings.push({
|
|
70
|
+
rule: 'anti_ai_slop_phrase_en',
|
|
71
|
+
severity: 'warning',
|
|
72
|
+
match: m[0],
|
|
73
|
+
line: lineNum,
|
|
74
|
+
message: `Found generic AI trope "${m[0]}". Replace with concrete, factual language.`
|
|
75
|
+
});
|
|
106
76
|
}
|
|
107
77
|
}
|
|
108
78
|
});
|
|
@@ -31,25 +31,12 @@ export interface ArithmeticCategory {
|
|
|
31
31
|
|
|
32
32
|
export interface ArithmeticBudgetSpec {
|
|
33
33
|
categories: ArithmeticCategory[];
|
|
34
|
-
grossUpTaxRate?: number; // e.g. 0.025 for 2.5%
|
|
34
|
+
grossUpTaxRate?: number; // e.g. 0.025 for 2.5% withholding tax
|
|
35
35
|
targetGross?: number;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const BANNED_LONG_DASHES = /[—–]/g;
|
|
39
39
|
|
|
40
|
-
const AI_SLOP_CLICHES_ID = [
|
|
41
|
-
/\bsangatlah\b/i,
|
|
42
|
-
/\btak terbantahkan\b/i,
|
|
43
|
-
/\brevolusioner\b/i,
|
|
44
|
-
/\bgame[- ]?changer\b/i,
|
|
45
|
-
/\bdi era yang serba\b/i,
|
|
46
|
-
/\bmari kita\b/i,
|
|
47
|
-
/\btidak dapat dipungkiri\b/i,
|
|
48
|
-
/\bperlu diingat bahwa\b/i,
|
|
49
|
-
/\bdalam lanskap modern\b/i,
|
|
50
|
-
/\bmerupakan sebuah bukti nyata\b/i
|
|
51
|
-
];
|
|
52
|
-
|
|
53
40
|
const AI_SLOP_CLICHES_EN = [
|
|
54
41
|
/\bdelve(?:s|d|ing)?\b/i,
|
|
55
42
|
/\bcrucial(?:ly)?\b/i,
|
|
@@ -69,20 +56,19 @@ const AI_SLOP_CLICHES_EN = [
|
|
|
69
56
|
];
|
|
70
57
|
|
|
71
58
|
const PLACEHOLDER_BRACKETS = [
|
|
72
|
-
/\[(?:insert|
|
|
73
|
-
/<(?:insert|
|
|
59
|
+
/\[(?:insert|placeholder|tbd|todo|name|date|location)[^\]]*\]/i,
|
|
60
|
+
/<(?:insert|placeholder|tbd|todo)[^>]*>/i
|
|
74
61
|
];
|
|
75
62
|
|
|
76
63
|
/**
|
|
77
64
|
* Scan raw text or HTML content for AI slop, long em-dashes, and placeholder tokens.
|
|
78
65
|
*/
|
|
79
|
-
export function auditTextContent(content: string, options: {
|
|
66
|
+
export function auditTextContent(content: string, options: { strictDashes?: boolean } = {}): {
|
|
80
67
|
clean: boolean;
|
|
81
68
|
findings: SlopAuditFinding[];
|
|
82
69
|
} {
|
|
83
70
|
const findings: SlopAuditFinding[] = [];
|
|
84
71
|
const lines = (content || '').split(/\r?\n/);
|
|
85
|
-
const lang = options.language || 'both';
|
|
86
72
|
const strictDashes = options.strictDashes !== false;
|
|
87
73
|
|
|
88
74
|
lines.forEach((line, idx) => {
|
|
@@ -116,35 +102,17 @@ export function auditTextContent(content: string, options: { language?: 'id' | '
|
|
|
116
102
|
}
|
|
117
103
|
}
|
|
118
104
|
|
|
119
|
-
// 3. AI Slop Cliches (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// 4. AI Slop Cliches (EN)
|
|
136
|
-
if (lang === 'en' || lang === 'both') {
|
|
137
|
-
for (const pat of AI_SLOP_CLICHES_EN) {
|
|
138
|
-
const m = line.match(pat);
|
|
139
|
-
if (m) {
|
|
140
|
-
findings.push({
|
|
141
|
-
rule: 'anti_ai_slop_phrase_en',
|
|
142
|
-
severity: 'warning',
|
|
143
|
-
match: m[0],
|
|
144
|
-
line: lineNum,
|
|
145
|
-
message: `Found generic AI trope "${m[0]}". Replace with concrete, factual language.`
|
|
146
|
-
});
|
|
147
|
-
}
|
|
105
|
+
// 3. AI Slop Cliches (EN)
|
|
106
|
+
for (const pat of AI_SLOP_CLICHES_EN) {
|
|
107
|
+
const m = line.match(pat);
|
|
108
|
+
if (m) {
|
|
109
|
+
findings.push({
|
|
110
|
+
rule: 'anti_ai_slop_phrase_en',
|
|
111
|
+
severity: 'warning',
|
|
112
|
+
match: m[0],
|
|
113
|
+
line: lineNum,
|
|
114
|
+
message: `Found generic AI trope "${m[0]}". Replace with concrete, factual language.`
|
|
115
|
+
});
|
|
148
116
|
}
|
|
149
117
|
}
|
|
150
118
|
});
|
|
@@ -53,7 +53,7 @@ export function compileDocumentHtml(spec) {
|
|
|
53
53
|
size: A4 portrait;
|
|
54
54
|
margin: 20mm 18mm 18mm 18mm;
|
|
55
55
|
@bottom-right {
|
|
56
|
-
content: "
|
|
56
|
+
content: "Page " counter(page);
|
|
57
57
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
58
58
|
font-size: 8.5pt;
|
|
59
59
|
color: #64748b;
|
|
@@ -213,7 +213,7 @@ tr:nth-child(even) td {
|
|
|
213
213
|
<div class="cover-content">
|
|
214
214
|
<div class="cover-title">${escapeHtml(spec.title)}</div>
|
|
215
215
|
${spec.subtitle ? `<div class="cover-subtitle">${escapeHtml(spec.subtitle)}</div>` : ''}
|
|
216
|
-
${spec.authorOrProposer ? `<div class="cover-meta">
|
|
216
|
+
${spec.authorOrProposer ? `<div class="cover-meta">Prepared by: <strong>${escapeHtml(spec.authorOrProposer)}</strong></div>` : ''}
|
|
217
217
|
</div>
|
|
218
218
|
<div class="cover-band-bottom"></div>
|
|
219
219
|
</div>`;
|
|
@@ -251,7 +251,7 @@ tr:nth-child(even) td {
|
|
|
251
251
|
}
|
|
252
252
|
bodyHtml += '\n</div>';
|
|
253
253
|
const html = `<!DOCTYPE html>
|
|
254
|
-
<html lang="
|
|
254
|
+
<html lang="en">
|
|
255
255
|
<head>
|
|
256
256
|
<meta charset="UTF-8">
|
|
257
257
|
<title>${escapeHtml(spec.title)}</title>
|
|
@@ -104,7 +104,7 @@ export function compileDocumentHtml(spec: FormalDocumentSpec): { html: string; c
|
|
|
104
104
|
size: A4 portrait;
|
|
105
105
|
margin: 20mm 18mm 18mm 18mm;
|
|
106
106
|
@bottom-right {
|
|
107
|
-
content: "
|
|
107
|
+
content: "Page " counter(page);
|
|
108
108
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
109
109
|
font-size: 8.5pt;
|
|
110
110
|
color: #64748b;
|
|
@@ -266,7 +266,7 @@ tr:nth-child(even) td {
|
|
|
266
266
|
<div class="cover-content">
|
|
267
267
|
<div class="cover-title">${escapeHtml(spec.title)}</div>
|
|
268
268
|
${spec.subtitle ? `<div class="cover-subtitle">${escapeHtml(spec.subtitle)}</div>` : ''}
|
|
269
|
-
${spec.authorOrProposer ? `<div class="cover-meta">
|
|
269
|
+
${spec.authorOrProposer ? `<div class="cover-meta">Prepared by: <strong>${escapeHtml(spec.authorOrProposer)}</strong></div>` : ''}
|
|
270
270
|
</div>
|
|
271
271
|
<div class="cover-band-bottom"></div>
|
|
272
272
|
</div>`;
|
|
@@ -306,7 +306,7 @@ tr:nth-child(even) td {
|
|
|
306
306
|
bodyHtml += '\n</div>';
|
|
307
307
|
|
|
308
308
|
const html = `<!DOCTYPE html>
|
|
309
|
-
<html lang="
|
|
309
|
+
<html lang="en">
|
|
310
310
|
<head>
|
|
311
311
|
<meta charset="UTF-8">
|
|
312
312
|
<title>${escapeHtml(spec.title)}</title>
|
package/src/launchIntent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const LAUNCH_VERBS = /\b(open|launch|start|run|play|serve|preview
|
|
2
|
-
const CHANGE_VERBS = /\b(create|build|make|write|edit|fix|modify|change|update|implement|generate|refactor|delete|remove|install|deploy
|
|
1
|
+
const LAUNCH_VERBS = /\b(open|launch|start|run|play|serve|preview)\b/i;
|
|
2
|
+
const CHANGE_VERBS = /\b(create|build|make|write|edit|fix|modify|change|update|implement|generate|refactor|delete|remove|install|deploy)\b/i;
|
|
3
3
|
const SERVER_COMMAND = /^\s*(?:python(?:3(?:\.\d+)?)?\s+(?:-u\s+)?(?:\S*\/)?server\.py\b|python(?:3(?:\.\d+)?)?\s+-m\s+http\.server\b|(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?(?:dev|start|serve)\b|(?:npx|bunx)\s+(?:vite|next\s+dev|http-server)\b|uvicorn\b|gunicorn\b|flask\s+run\b)/i;
|
|
4
4
|
const READ_ONLY_COMMAND = /^\s*(?:pwd|ls|rg|grep|cat|head|tail|find|which|where|ps|pgrep|lsof|netstat|ss|git\s+(?:status|diff|log|show)|node\s+(?:-v|--version)|python(?:3(?:\.\d+)?)?\s+(?:-V|--version))\b/i;
|
|
5
5
|
const OPEN_COMMAND = /^\s*(?:open|xdg-open|start)\s+\S+/i;
|
|
@@ -11,7 +11,7 @@ const MUTATION_TOOLS = new Set([
|
|
|
11
11
|
'create_skill', 'manage_local_dependencies'
|
|
12
12
|
]);
|
|
13
13
|
export function isLaunchOnlyPrompt(prompt) {
|
|
14
|
-
if (/\
|
|
14
|
+
if (/\brun\s+(?:the\s+)?(?:tests?|checks?|lint|benchmarks?|scripts?|commands?)\b/i.test(prompt))
|
|
15
15
|
return false;
|
|
16
16
|
return LAUNCH_VERBS.test(prompt) && !CHANGE_VERBS.test(prompt);
|
|
17
17
|
}
|
package/src/launchIntent.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const LAUNCH_VERBS = /\b(open|launch|start|run|play|serve|preview
|
|
2
|
-
const CHANGE_VERBS = /\b(create|build|make|write|edit|fix|modify|change|update|implement|generate|refactor|delete|remove|install|deploy
|
|
1
|
+
const LAUNCH_VERBS = /\b(open|launch|start|run|play|serve|preview)\b/i;
|
|
2
|
+
const CHANGE_VERBS = /\b(create|build|make|write|edit|fix|modify|change|update|implement|generate|refactor|delete|remove|install|deploy)\b/i;
|
|
3
3
|
const SERVER_COMMAND = /^\s*(?:python(?:3(?:\.\d+)?)?\s+(?:-u\s+)?(?:\S*\/)?server\.py\b|python(?:3(?:\.\d+)?)?\s+-m\s+http\.server\b|(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?(?:dev|start|serve)\b|(?:npx|bunx)\s+(?:vite|next\s+dev|http-server)\b|uvicorn\b|gunicorn\b|flask\s+run\b)/i;
|
|
4
4
|
const READ_ONLY_COMMAND = /^\s*(?:pwd|ls|rg|grep|cat|head|tail|find|which|where|ps|pgrep|lsof|netstat|ss|git\s+(?:status|diff|log|show)|node\s+(?:-v|--version)|python(?:3(?:\.\d+)?)?\s+(?:-V|--version))\b/i;
|
|
5
5
|
const OPEN_COMMAND = /^\s*(?:open|xdg-open|start)\s+\S+/i;
|
|
@@ -13,7 +13,7 @@ const MUTATION_TOOLS = new Set([
|
|
|
13
13
|
]);
|
|
14
14
|
|
|
15
15
|
export function isLaunchOnlyPrompt(prompt: string): boolean {
|
|
16
|
-
if (/\
|
|
16
|
+
if (/\brun\s+(?:the\s+)?(?:tests?|checks?|lint|benchmarks?|scripts?|commands?)\b/i.test(prompt)) return false;
|
|
17
17
|
return LAUNCH_VERBS.test(prompt) && !CHANGE_VERBS.test(prompt);
|
|
18
18
|
}
|
|
19
19
|
|
package/src/planCache.js
CHANGED
|
@@ -77,22 +77,12 @@ const STOPWORDS = new Set([
|
|
|
77
77
|
'with', 'from', 'into', 'then', 'this', 'that', 'it', 'its', 'as', 'by',
|
|
78
78
|
'please', 'just', 'now', 'my', 'me', 'you', 'your', 'i',
|
|
79
79
|
// Generic creation verbs. Every task has one, so they inflate the union
|
|
80
|
-
// without discriminating between tasks
|
|
81
|
-
// "buat pena 3D di Blender" and "bikin pulpen 3D di blender" score 0.40
|
|
82
|
-
// when they describe the same job. `build`, `fix`, `debug` and `render` are
|
|
80
|
+
// without discriminating between tasks. `build`, `fix`, `debug` and `render` are
|
|
83
81
|
// deliberately NOT here: those DO separate tasks inside one archetype.
|
|
84
|
-
'make', 'create', 'creating', 'made', 'generate'
|
|
85
|
-
// Indonesian — the owner writes in both, and a mixed-language prompt must
|
|
86
|
-
// key the same way whichever language framed it.
|
|
87
|
-
'dan', 'atau', 'yang', 'untuk', 'dari', 'ke', 'di', 'itu', 'ini', 'dengan',
|
|
88
|
-
'tolong', 'saya', 'aku', 'kamu', 'adalah', 'pada', 'juga', 'agar', 'jadi',
|
|
89
|
-
'buat', 'bikin', 'membuat', 'lalu', 'kemudian', 'terus', 'dulu', 'saja',
|
|
90
|
-
'sekarang', 'harus', 'bisa', 'sudah', 'belum', 'akan', 'mau', 'coba'
|
|
82
|
+
'make', 'create', 'creating', 'made', 'generate'
|
|
91
83
|
]);
|
|
92
|
-
// HONEST LIMIT. Matching is LEXICAL.
|
|
93
|
-
//
|
|
94
|
-
// "pen" and "pena" are the same object. That is a deliberate trade: this path
|
|
95
|
-
// is deterministic, instant, and works on a machine with no embedding model
|
|
84
|
+
// HONEST LIMIT. Matching is LEXICAL.
|
|
85
|
+
// This path is deterministic, instant, and works on a machine with no embedding model
|
|
96
86
|
// provisioned. Cortex is the semantic route and already carries embeddings;
|
|
97
87
|
// these two compose rather than compete.
|
|
98
88
|
/**
|
package/src/planCache.ts
CHANGED
|
@@ -203,23 +203,13 @@ const STOPWORDS: ReadonlySet<string> = new Set([
|
|
|
203
203
|
'with', 'from', 'into', 'then', 'this', 'that', 'it', 'its', 'as', 'by',
|
|
204
204
|
'please', 'just', 'now', 'my', 'me', 'you', 'your', 'i',
|
|
205
205
|
// Generic creation verbs. Every task has one, so they inflate the union
|
|
206
|
-
// without discriminating between tasks
|
|
207
|
-
// "buat pena 3D di Blender" and "bikin pulpen 3D di blender" score 0.40
|
|
208
|
-
// when they describe the same job. `build`, `fix`, `debug` and `render` are
|
|
206
|
+
// without discriminating between tasks. `build`, `fix`, `debug` and `render` are
|
|
209
207
|
// deliberately NOT here: those DO separate tasks inside one archetype.
|
|
210
|
-
'make', 'create', 'creating', 'made', 'generate'
|
|
211
|
-
// Indonesian — the owner writes in both, and a mixed-language prompt must
|
|
212
|
-
// key the same way whichever language framed it.
|
|
213
|
-
'dan', 'atau', 'yang', 'untuk', 'dari', 'ke', 'di', 'itu', 'ini', 'dengan',
|
|
214
|
-
'tolong', 'saya', 'aku', 'kamu', 'adalah', 'pada', 'juga', 'agar', 'jadi',
|
|
215
|
-
'buat', 'bikin', 'membuat', 'lalu', 'kemudian', 'terus', 'dulu', 'saja',
|
|
216
|
-
'sekarang', 'harus', 'bisa', 'sudah', 'belum', 'akan', 'mau', 'coba'
|
|
208
|
+
'make', 'create', 'creating', 'made', 'generate'
|
|
217
209
|
]);
|
|
218
210
|
|
|
219
|
-
// HONEST LIMIT. Matching is LEXICAL.
|
|
220
|
-
//
|
|
221
|
-
// "pen" and "pena" are the same object. That is a deliberate trade: this path
|
|
222
|
-
// is deterministic, instant, and works on a machine with no embedding model
|
|
211
|
+
// HONEST LIMIT. Matching is LEXICAL.
|
|
212
|
+
// This path is deterministic, instant, and works on a machine with no embedding model
|
|
223
213
|
// provisioned. Cortex is the semantic route and already carries embeddings;
|
|
224
214
|
// these two compose rather than compete.
|
|
225
215
|
|
package/src/providers/acp.js
CHANGED
|
@@ -71,7 +71,7 @@ export class AcpProvider extends LLMProvider {
|
|
|
71
71
|
}
|
|
72
72
|
formatConversation(messages, tools = []) {
|
|
73
73
|
const lines = [];
|
|
74
|
-
lines.push('[System Instructions]\nYou are acting as an AI reasoning engine for Causyne Agent over ACP. Do NOT invoke your own internal host CLI tools or execute commands directly. When an action or tool is required, output an explicit tool call in this exact format:\n<tool_call>{"name": "tool_name", "arguments": { ... }}</tool_call>\nCausyne Agent will execute the tool in its secure environment and return the results back to you.\n\n[Language & Communication Directive]\nDynamically reflect and match the exact language used by the user in their prompt.
|
|
74
|
+
lines.push('[System Instructions]\nYou are acting as an AI reasoning engine for Causyne Agent over ACP. Do NOT invoke your own internal host CLI tools or execute commands directly. When an action or tool is required, output an explicit tool call in this exact format:\n<tool_call>{"name": "tool_name", "arguments": { ... }}</tool_call>\nCausyne Agent will execute the tool in its secure environment and return the results back to you.\n\n[Language & Communication Directive]\nDynamically reflect and match the exact language used by the user in their prompt. Respond naturally in that same language.');
|
|
75
75
|
if (tools && tools.length > 0) {
|
|
76
76
|
const toolSummaries = tools.map(t => {
|
|
77
77
|
const name = t.name || t.function?.name || 'unknown';
|
|
@@ -505,7 +505,9 @@ export class AcpProvider extends LLMProvider {
|
|
|
505
505
|
usage: {
|
|
506
506
|
promptTokens: Math.ceil(promptText.length / 4),
|
|
507
507
|
completionTokens: Math.ceil(rawContent.length / 4),
|
|
508
|
-
cachedPromptTokens: 0
|
|
508
|
+
cachedPromptTokens: 0,
|
|
509
|
+
measurement: 'text_estimate',
|
|
510
|
+
cacheMeasurement: 'unavailable'
|
|
509
511
|
}
|
|
510
512
|
};
|
|
511
513
|
if (toolCalls.length > 0) {
|
package/src/providers/acp.ts
CHANGED
|
@@ -73,7 +73,7 @@ export class AcpProvider extends LLMProvider {
|
|
|
73
73
|
|
|
74
74
|
formatConversation(messages: any[], tools: any[] = []): string {
|
|
75
75
|
const lines: string[] = [];
|
|
76
|
-
lines.push('[System Instructions]\nYou are acting as an AI reasoning engine for Causyne Agent over ACP. Do NOT invoke your own internal host CLI tools or execute commands directly. When an action or tool is required, output an explicit tool call in this exact format:\n<tool_call>{"name": "tool_name", "arguments": { ... }}</tool_call>\nCausyne Agent will execute the tool in its secure environment and return the results back to you.\n\n[Language & Communication Directive]\nDynamically reflect and match the exact language used by the user in their prompt.
|
|
76
|
+
lines.push('[System Instructions]\nYou are acting as an AI reasoning engine for Causyne Agent over ACP. Do NOT invoke your own internal host CLI tools or execute commands directly. When an action or tool is required, output an explicit tool call in this exact format:\n<tool_call>{"name": "tool_name", "arguments": { ... }}</tool_call>\nCausyne Agent will execute the tool in its secure environment and return the results back to you.\n\n[Language & Communication Directive]\nDynamically reflect and match the exact language used by the user in their prompt. Respond naturally in that same language.');
|
|
77
77
|
|
|
78
78
|
if (tools && tools.length > 0) {
|
|
79
79
|
const toolSummaries = tools.map(t => {
|
|
@@ -516,7 +516,9 @@ export class AcpProvider extends LLMProvider {
|
|
|
516
516
|
usage: {
|
|
517
517
|
promptTokens: Math.ceil(promptText.length / 4),
|
|
518
518
|
completionTokens: Math.ceil(rawContent.length / 4),
|
|
519
|
-
cachedPromptTokens: 0
|
|
519
|
+
cachedPromptTokens: 0,
|
|
520
|
+
measurement: 'text_estimate',
|
|
521
|
+
cacheMeasurement: 'unavailable'
|
|
520
522
|
}
|
|
521
523
|
};
|
|
522
524
|
if (toolCalls.length > 0) {
|