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,MAoCtD,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,cAAc,MAAM,KAAG,MAQ7D,CAAA"}
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
- 'You are a prompt structuring system.',
5
- 'Your job is to take raw, unstructured user input and decompose it into a structured task hierarchy.',
6
- 'The input may be messy, from voice transcription, contain filler words, or have multiple requests mixed together.',
4
+ 'Always respond with raw JSON text only.',
5
+ 'Never use tools.',
6
+ 'Never call functions.',
7
7
  '',
8
- 'Decompose the input into tasks. Each task has:',
9
- '- intent: a clear, concise directive (what to do)',
10
- '- targets: files, systems, or things involved (array, can be empty)',
11
- '- constraints: conditions, preferences, or requirements (array, can be empty)',
12
- '- context: optional background info or rationale',
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,sCAAsC;QACtC,qGAAqG;QACrG,mHAAmH;QACnH,EAAE;QACF,gDAAgD;QAChD,mDAAmD;QACnD,qEAAqE;QACrE,+EAA+E;QAC/E,kDAAkD;QAClD,0EAA0E;QAC1E,EAAE;QACF,aAAa;QACb,yEAAyE;QACzE,6DAA6D;QAC7D,6DAA6D;QAC7D,wFAAwF;QACxF,sDAAsD;QACtD,sFAAsF;QACtF,yEAAyE;QACzE,8DAA8D;QAC9D,EAAE;QACF,mCAAmC;QACnC,mBAAmB;QACnB,EAAE;QACF,yBAAyB;QACzB,mDAAmD;KACpD,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;QACL,0CAA0C;QAC1C,YAAY;QACZ,EAAE;QACF,6CAA6C;QAC7C,mDAAmD;KACpD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC,CAAA"}
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"}
@@ -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;AAgED,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,MAAM,EAAE,OAAM,UAAuB,KAAG,MAG1F,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,cAAc,MAAM,KAAG,MAGvD,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"}
@@ -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
- 'You are a rule parser that converts raw instructions into structured parsed rules.',
7
- 'Take the provided instructions and break them down into structured components.',
8
- 'Each rule should have: strength, action (verb), target (object), context (optional condition/scope), and reason (justification).',
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
- 'Return ONLY valid JSON matching this exact schema:',
12
- parseSchemaExample,
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
- 'Do not include any text outside the JSON object. Do not wrap it in markdown code fences.',
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
- 'You are a rule formatter that converts structured parsed rules into human-readable rules.',
20
- 'Take the provided parsed rule components and create natural language versions.',
21
- 'Every rule must include both a Rule line and a Reason line.',
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
- 'Rule: <clear, concise, actionable statement>',
25
- 'Reason: <justification from the parsed rule>',
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
- 'Each human-readable rule should directly correspond to the parsed components without adding extra details.',
28
- 'Make the rules clear, concise, and actionable.',
26
+ 'Rule: <clear, actionable statement>',
27
+ 'Reason: <justification>',
29
28
  '',
30
- 'Return ONLY valid JSON matching this exact schema:',
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
- 'You are a rule formatter that converts structured parsed rules into human-readable rules.',
37
- 'Take the provided parsed rule components and create natural language versions.',
38
- 'Use your judgment for each rule:',
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
- 'Format rules that include a reason:',
43
- 'Rule: <clear, concise, actionable statement>',
44
- 'Reason: <justification from the parsed rule>',
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
- 'Format rules that are self-explanatory:',
47
- 'Rule: <clear, concise, actionable statement>',
41
+ 'Rule: <clear, actionable statement>',
42
+ 'Reason: <justification> (only if needed)',
48
43
  '',
49
- 'Each human-readable rule should directly correspond to the parsed components without adding extra details.',
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
- 'You are a rule formatter that converts structured parsed rules into concise directives.',
59
- 'Take the provided parsed rule components and create a bullet list of clear directives.',
60
- 'Do not include reasons or justifications. Output only the actionable statement.',
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
- 'Each directive should directly correspond to the parsed components without adding extra details.',
64
- 'Make the directives clear, concise, and actionable.',
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 ONLY valid JSON matching this exact schema:',
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 'Your previous response was invalid. ' + errorMessage
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
@@ -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,GAAG;QACnB,oFAAoF;QACpF,gFAAgF;QAChF,kIAAkI;QAClI,uEAAuE;QACvE,EAAE;QACF,oDAAoD;QACpD,kBAAkB;QAClB,EAAE;QACF,0FAA0F;KAC3F,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEZ,OAAO,CAAC,YAAY,EAAE,wBAAwB,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACrE,CAAC,CAAA;AAED,MAAM,mBAAmB,GAAG;IAC1B,2FAA2F;IAC3F,gFAAgF;IAChF,6DAA6D;IAC7D,0CAA0C;IAC1C,EAAE;IACF,8CAA8C;IAC9C,8CAA8C;IAC9C,EAAE;IACF,4GAA4G;IAC5G,gDAAgD;IAChD,EAAE;IACF,oDAAoD;IACpD,mEAAmE;IACnE,EAAE;IACF,0FAA0F;CAC3F,CAAA;AAED,MAAM,oBAAoB,GAAG;IAC3B,2FAA2F;IAC3F,gFAAgF;IAChF,kCAAkC;IAClC,2FAA2F;IAC3F,oFAAo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,EAAU,EAAE;IAClG,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACxD,OAAO,CAAC,YAAY,EAAE,0BAA0B,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACjF,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC/D,OAAO,oBAAoB,GAAG,YAAY,GAAG,yFAAyF,CAAA;AACxI,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sat",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "OpenCode plugin that converts unstructured instructions into structured rules using speech act theory and deontic logic.",
5
5
  "keywords": [
6
6
  "opencode",