opencode-sat 0.0.14 → 0.0.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-prompt.d.ts","sourceRoot":"","sources":["../../src/prompt-prompt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"prompt-prompt.d.ts","sourceRoot":"","sources":["../../src/prompt-prompt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,KAAG,MAsBtD,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,cAAc,MAAM,KAAG,MAE7D,CAAA"}
|
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
import { promptSchemaExample } from './prompt-schema';
|
|
2
2
|
export const buildPromptParsePrompt = (input) => {
|
|
3
3
|
const instructions = [
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
4
|
+
'Always respond with raw JSON text only.',
|
|
5
|
+
'Never use tools.',
|
|
6
|
+
'Never call functions.',
|
|
7
7
|
'',
|
|
8
|
-
'Decompose the input into
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'- subtasks: recursive array of child tasks (empty if the task is a leaf)',
|
|
14
|
-
'',
|
|
15
|
-
'Guidelines:',
|
|
16
|
-
'- Extract the actual intent behind the words, not the words themselves.',
|
|
17
|
-
'- Separate compound requests into multiple top-level tasks.',
|
|
18
|
-
'- When a task has clear sub-steps, decompose into subtasks.',
|
|
19
|
-
'- Preserve specific file names, variable names, and technical terms exactly as stated.',
|
|
20
|
-
'- Drop filler words, false starts, and verbal noise.',
|
|
21
|
-
'- If the user mentions constraints or preferences, attach them to the relevant task.',
|
|
22
|
-
'- If context or rationale is provided, capture it in the context field.',
|
|
23
|
-
'- Keep intents as imperative directives (start with a verb).',
|
|
8
|
+
'Decompose the user input below into a structured task hierarchy.',
|
|
9
|
+
'Each task has: intent (imperative verb phrase), targets (array), constraints (array), context (optional string), subtasks (recursive array).',
|
|
10
|
+
'Separate compound requests into multiple top-level tasks.',
|
|
11
|
+
'Preserve file names, variable names, and technical terms exactly.',
|
|
12
|
+
'Drop filler words and verbal noise.',
|
|
24
13
|
'',
|
|
25
14
|
'Return JSON matching this schema:',
|
|
26
15
|
promptSchemaExample,
|
|
27
|
-
'',
|
|
28
|
-
'Return ONLY valid JSON.',
|
|
29
|
-
'Do not wrap the response in markdown code fences.',
|
|
30
16
|
];
|
|
31
17
|
return [
|
|
32
18
|
instructions.join('\n'),
|
|
@@ -36,12 +22,6 @@ export const buildPromptParsePrompt = (input) => {
|
|
|
36
22
|
].join('\n');
|
|
37
23
|
};
|
|
38
24
|
export const buildPromptRetryPrompt = (errorMessage) => {
|
|
39
|
-
return
|
|
40
|
-
'The previous response failed validation:',
|
|
41
|
-
errorMessage,
|
|
42
|
-
'',
|
|
43
|
-
'Return ONLY valid JSON matching the schema.',
|
|
44
|
-
'Do not wrap the response in markdown code fences.',
|
|
45
|
-
].join('\n');
|
|
25
|
+
return 'Invalid response: ' + errorMessage + '\n\nAlways respond with raw JSON text only. Never use tools. Never wrap in code fences.';
|
|
46
26
|
};
|
|
47
27
|
//# sourceMappingURL=prompt-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-prompt.js","sourceRoot":"","sources":["../../src/prompt-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9D,MAAM,YAAY,GAAG;QACnB,
|
|
1
|
+
{"version":3,"file":"prompt-prompt.js","sourceRoot":"","sources":["../../src/prompt-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9D,MAAM,YAAY,GAAG;QACnB,yCAAyC;QACzC,kBAAkB;QAClB,uBAAuB;QACvB,EAAE;QACF,kEAAkE;QAClE,8IAA8I;QAC9I,2DAA2D;QAC3D,mEAAmE;QACnE,qCAAqC;QACrC,EAAE;QACF,mCAAmC;QACnC,mBAAmB;KACpB,CAAA;IAED,OAAO;QACL,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;QACvB,KAAK;QACL,aAAa;QACb,KAAK;KACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,YAAoB,EAAU,EAAE;IACrE,OAAO,oBAAoB,GAAG,YAAY,GAAG,yFAAyF,CAAA;AACxI,CAAC,CAAA"}
|
package/dist/src/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAA;AAE3D,eAAO,MAAM,YAAY,EAAE,UAAU,EAAuC,CAAA;AAE5E,eAAO,MAAM,YAAY,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,UACkB,CAAA;AAEjE,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,MAchD,CAAA;
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAA;AAE3D,eAAO,MAAM,YAAY,EAAE,UAAU,EAAuC,CAAA;AAE5E,eAAO,MAAM,YAAY,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,UACkB,CAAA;AAEjE,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,MAchD,CAAA;AAoDD,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,MAAM,EAAE,OAAM,UAAuB,KAAG,MAG1F,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,cAAc,MAAM,KAAG,MAEvD,CAAA"}
|
package/dist/src/prompt.js
CHANGED
|
@@ -3,70 +3,58 @@ export const FORMAT_MODES = ['verbose', 'balanced', 'concise'];
|
|
|
3
3
|
export const isFormatMode = (v) => typeof v === 'string' && FORMAT_MODES.includes(v);
|
|
4
4
|
export const buildParsePrompt = (input) => {
|
|
5
5
|
const instructions = [
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'Focus on extracting the core components without adding extra details.',
|
|
6
|
+
'Always respond with raw JSON text only.',
|
|
7
|
+
'Never use tools.',
|
|
8
|
+
'Never call functions.',
|
|
10
9
|
'',
|
|
11
|
-
'
|
|
12
|
-
|
|
10
|
+
'Parse the instructions below into structured rules.',
|
|
11
|
+
'Each rule has: strength (deontic modality), action (verb), target (object), context (optional scope), reason (justification).',
|
|
13
12
|
'',
|
|
14
|
-
'
|
|
13
|
+
'Return JSON matching this schema:',
|
|
14
|
+
parseSchemaExample,
|
|
15
15
|
].join('\n');
|
|
16
16
|
return [instructions, 'Instructions to parse:', input].join('\n\n');
|
|
17
17
|
};
|
|
18
18
|
const verboseInstructions = [
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'Each rule must follow this exact format:',
|
|
19
|
+
'Always respond with raw JSON text only.',
|
|
20
|
+
'Never use tools.',
|
|
21
|
+
'Never call functions.',
|
|
23
22
|
'',
|
|
24
|
-
'
|
|
25
|
-
'Reason
|
|
23
|
+
'Convert the parsed rules below into human-readable rules.',
|
|
24
|
+
'Always include both a Rule line and a Reason line for every rule.',
|
|
26
25
|
'',
|
|
27
|
-
'
|
|
28
|
-
'
|
|
26
|
+
'Rule: <clear, actionable statement>',
|
|
27
|
+
'Reason: <justification>',
|
|
29
28
|
'',
|
|
30
|
-
'Return
|
|
29
|
+
'Return JSON matching this schema:',
|
|
31
30
|
'{"rules": ["Rule: ...\\nReason: ...", "Rule: ...\\nReason: ..."]}',
|
|
32
|
-
'',
|
|
33
|
-
'Do not include any text outside the JSON object. Do not wrap it in markdown code fences.',
|
|
34
31
|
];
|
|
35
32
|
const balancedInstructions = [
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'- If the rule is non-obvious or counterintuitive, include both the Rule and Reason lines.',
|
|
40
|
-
'- If the rule is self-explanatory, include only the Rule line and omit the Reason.',
|
|
33
|
+
'Always respond with raw JSON text only.',
|
|
34
|
+
'Never use tools.',
|
|
35
|
+
'Never call functions.',
|
|
41
36
|
'',
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'Reason
|
|
37
|
+
'Convert the parsed rules below into human-readable rules.',
|
|
38
|
+
'Include a Reason line only when the rule is non-obvious or counterintuitive.',
|
|
39
|
+
'Omit the Reason line when the rule is self-explanatory.',
|
|
45
40
|
'',
|
|
46
|
-
'
|
|
47
|
-
'
|
|
41
|
+
'Rule: <clear, actionable statement>',
|
|
42
|
+
'Reason: <justification> (only if needed)',
|
|
48
43
|
'',
|
|
49
|
-
'
|
|
50
|
-
'Make the rules clear, concise, and actionable.',
|
|
51
|
-
'',
|
|
52
|
-
'Return ONLY valid JSON matching this exact schema:',
|
|
44
|
+
'Return JSON matching this schema:',
|
|
53
45
|
'{"rules": ["Rule: ...\\nReason: ...", "Rule: ..."]}',
|
|
54
|
-
'',
|
|
55
|
-
'Do not include any text outside the JSON object. Do not wrap it in markdown code fences.',
|
|
56
46
|
];
|
|
57
47
|
const conciseInstructions = [
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'Each rule must be a single line starting with "- " (dash space).',
|
|
48
|
+
'Always respond with raw JSON text only.',
|
|
49
|
+
'Never use tools.',
|
|
50
|
+
'Never call functions.',
|
|
62
51
|
'',
|
|
63
|
-
'
|
|
64
|
-
'
|
|
52
|
+
'Convert the parsed rules below into concise directives.',
|
|
53
|
+
'Never include reasons.',
|
|
54
|
+
'Each rule is a single line starting with "- ".',
|
|
65
55
|
'',
|
|
66
|
-
'Return
|
|
56
|
+
'Return JSON matching this schema:',
|
|
67
57
|
'{"rules": ["- ...", "- ..."]}',
|
|
68
|
-
'',
|
|
69
|
-
'Do not include any text outside the JSON object. Do not wrap it in markdown code fences.',
|
|
70
58
|
];
|
|
71
59
|
const formatInstructions = {
|
|
72
60
|
verbose: verboseInstructions,
|
|
@@ -78,7 +66,6 @@ export const buildFormatPrompt = (parsedRulesJson, mode = 'balanced') => {
|
|
|
78
66
|
return [instructions, 'Parsed rules to convert:', parsedRulesJson].join('\n\n');
|
|
79
67
|
};
|
|
80
68
|
export const buildRetryPrompt = (errorMessage) => {
|
|
81
|
-
return '
|
|
82
|
-
+ '\n\nReturn ONLY valid JSON. Do not include any text outside the JSON object.';
|
|
69
|
+
return 'Invalid response: ' + errorMessage + '\n\nAlways respond with raw JSON text only. Never use tools. Never wrap in code fences.';
|
|
83
70
|
};
|
|
84
71
|
//# sourceMappingURL=prompt.js.map
|
package/dist/src/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAIlD,MAAM,CAAC,MAAM,YAAY,GAAiB,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;AAE5E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAU,EAAmB,EAAE,CAC1D,OAAO,CAAC,KAAK,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAe,CAAC,CAAA;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE;IACxD,MAAM,YAAY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