@askalf/dario 4.8.30 → 4.8.31
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/dist/cc-template.d.ts +14 -12
- package/dist/cc-template.js +26 -15
- package/package.json +1 -1
package/dist/cc-template.d.ts
CHANGED
|
@@ -55,18 +55,20 @@ export declare const CC_AGENT_IDENTITY: string;
|
|
|
55
55
|
* Modes:
|
|
56
56
|
* - undefined / 'verbatim' — CC's prompt unchanged (default; existing
|
|
57
57
|
* setups don't regress).
|
|
58
|
-
* - 'partial' — strip purely behavioral constraints
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
58
|
+
* - 'partial' — strip purely behavioral constraints, leaving every
|
|
59
|
+
* refusal reminder and tool description intact. On the compact CC
|
|
60
|
+
* prompt (2.1.x+) the lone behavioral constraint is the comment-
|
|
61
|
+
* density / match-surrounding-style line, swapped for a positive
|
|
62
|
+
* "be thorough" instruction; on older verbose prompts the
|
|
63
|
+
* Tone-and-style + Text-output sections and the Doing-tasks bullets
|
|
64
|
+
* are removed as well. Recovers the output capability the
|
|
65
|
+
* constraint-removal research test measured.
|
|
66
|
+
* - 'aggressive' — partial + remove the prompt-level RLHF reminder (the
|
|
67
|
+
* IMPORTANT: line re-stating refusal categories) and the caution
|
|
68
|
+
* guidance about hard-to-reverse / outward-facing actions (the
|
|
69
|
+
* "Executing actions with care" section on older prompts). Adds
|
|
70
|
+
* little practical difference vs partial — alignment is RLHF-trained,
|
|
71
|
+
* not prompt-trained, so refusals survive prompt removal.
|
|
70
72
|
* - any other string — used as the literal system prompt text. The
|
|
71
73
|
* CLI resolves file paths to file contents up-front so this layer
|
|
72
74
|
* stays filesystem-pure.
|
package/dist/cc-template.js
CHANGED
|
@@ -61,18 +61,20 @@ export const CC_AGENT_IDENTITY = TEMPLATE.agent_identity;
|
|
|
61
61
|
* Modes:
|
|
62
62
|
* - undefined / 'verbatim' — CC's prompt unchanged (default; existing
|
|
63
63
|
* setups don't regress).
|
|
64
|
-
* - 'partial' — strip purely behavioral constraints
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
64
|
+
* - 'partial' — strip purely behavioral constraints, leaving every
|
|
65
|
+
* refusal reminder and tool description intact. On the compact CC
|
|
66
|
+
* prompt (2.1.x+) the lone behavioral constraint is the comment-
|
|
67
|
+
* density / match-surrounding-style line, swapped for a positive
|
|
68
|
+
* "be thorough" instruction; on older verbose prompts the
|
|
69
|
+
* Tone-and-style + Text-output sections and the Doing-tasks bullets
|
|
70
|
+
* are removed as well. Recovers the output capability the
|
|
71
|
+
* constraint-removal research test measured.
|
|
72
|
+
* - 'aggressive' — partial + remove the prompt-level RLHF reminder (the
|
|
73
|
+
* IMPORTANT: line re-stating refusal categories) and the caution
|
|
74
|
+
* guidance about hard-to-reverse / outward-facing actions (the
|
|
75
|
+
* "Executing actions with care" section on older prompts). Adds
|
|
76
|
+
* little practical difference vs partial — alignment is RLHF-trained,
|
|
77
|
+
* not prompt-trained, so refusals survive prompt removal.
|
|
76
78
|
* - any other string — used as the literal system prompt text. The
|
|
77
79
|
* CLI resolves file paths to file contents up-front so this layer
|
|
78
80
|
* stays filesystem-pure.
|
|
@@ -88,12 +90,15 @@ export function resolveSystemPrompt(arg) {
|
|
|
88
90
|
}
|
|
89
91
|
/**
|
|
90
92
|
* Port of scripts/research/test-constraint-removal.mjs:stripConstraints. Pure over
|
|
91
|
-
* its input; returns the input unchanged if
|
|
92
|
-
*
|
|
93
|
-
*
|
|
93
|
+
* its input; returns the input unchanged if no target matches (so a CC
|
|
94
|
+
* bump that renames sections degrades to verbatim rather than producing
|
|
95
|
+
* an unpredictable strip). Handles both the verbose pre-2.1 prompt
|
|
96
|
+
* (`# Tone and style` etc.) and the compact 2.1.x+ prompt; the patterns
|
|
97
|
+
* for the era not in play are simply no-ops.
|
|
94
98
|
*/
|
|
95
99
|
function stripBehavioralConstraints(input, level) {
|
|
96
100
|
let s = input;
|
|
101
|
+
// ── Legacy (pre-2.1 verbose prompt): no-ops on the compact prompt ──
|
|
97
102
|
s = s.replace(/# Tone and style[\s\S]*?(?=\n# |\n$|$)/m, '');
|
|
98
103
|
s = s.replace(/# Text output[^\n]*\n[\s\S]*?(?=\n# |\n$|$)/m, '');
|
|
99
104
|
const doingTasksConstraints = [
|
|
@@ -108,10 +113,16 @@ function stripBehavioralConstraints(input, level) {
|
|
|
108
113
|
s = s.replace(re, '');
|
|
109
114
|
}
|
|
110
115
|
s = s.replace(/^# Doing tasks\n/m, '# Doing tasks\n\nBe thorough. Show your reasoning. Provide the context and explanations the user is likely to find useful. Use as many tokens as the task warrants.\n\n');
|
|
116
|
+
// ── Compact prompt (2.1.x+): its one behavioral constraint is the
|
|
117
|
+
// comment-density / match-surrounding-style line. Swap it for the same
|
|
118
|
+
// positive instruction the legacy Doing-tasks rewrite inserts. ──
|
|
119
|
+
s = s.replace(/^Write code that reads like the surrounding code:[^\n]*\n/m, 'Be thorough. Show your reasoning. Provide the context and explanations the user is likely to find useful. Use as many tokens as the task warrants.\n');
|
|
111
120
|
if (level === 'aggressive') {
|
|
112
121
|
s = s.replace(/^IMPORTANT: Assist with authorized security testing[^\n]*\n/m, '');
|
|
113
122
|
s = s.replace(/^IMPORTANT: You must NEVER generate or guess URLs[^\n]*\n/m, '');
|
|
114
123
|
s = s.replace(/# Executing actions with care[\s\S]*?(?=\n# |\n$|$)/m, '');
|
|
124
|
+
// Compact prompt: the caution guidance is a single unheaded paragraph.
|
|
125
|
+
s = s.replace(/^For actions that are hard to reverse or outward-facing,[^\n]*\n/m, '');
|
|
115
126
|
}
|
|
116
127
|
return s;
|
|
117
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.31",
|
|
4
4
|
"description": "Use your Claude Pro/Max subscription in any tool — Cursor, Cline, Aider, the Agent SDK, your scripts — at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|