opencode-sat 0.0.15 → 0.0.16-next.1
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/README.md +43 -22
- package/dist/sat.d.ts.map +1 -1
- package/dist/sat.js +58 -38
- package/dist/sat.js.map +1 -1
- package/dist/src/append.d.ts +9 -9
- package/dist/src/append.d.ts.map +1 -1
- package/dist/src/append.js +22 -37
- package/dist/src/append.js.map +1 -1
- package/dist/src/{utils/compare.d.ts → compare.d.ts} +2 -0
- package/dist/src/compare.d.ts.map +1 -0
- package/dist/src/{utils/compare.js → compare.js} +24 -2
- package/dist/src/compare.js.map +1 -0
- package/dist/src/discover.d.ts +1 -1
- package/dist/src/discover.d.ts.map +1 -1
- package/dist/src/discover.js +1 -1
- package/dist/src/discover.js.map +1 -1
- package/dist/src/format-prompt.d.ts.map +1 -1
- package/dist/src/format-prompt.js +39 -30
- package/dist/src/format-prompt.js.map +1 -1
- package/dist/src/resolve.d.ts +1 -1
- package/dist/src/resolve.d.ts.map +1 -1
- package/dist/src/rewrite.d.ts +21 -0
- package/dist/src/rewrite.d.ts.map +1 -0
- package/dist/src/rewrite.js +30 -0
- package/dist/src/rewrite.js.map +1 -0
- package/dist/src/rule-schema.d.ts +5 -4
- package/dist/src/rule-schema.d.ts.map +1 -1
- package/dist/src/rule-schema.js +5 -0
- package/dist/src/rule-schema.js.map +1 -1
- package/dist/src/safe.d.ts.map +1 -0
- package/dist/src/safe.js.map +1 -0
- package/dist/src/tools/descriptions.d.ts +5 -0
- package/dist/src/tools/descriptions.d.ts.map +1 -0
- package/dist/src/tools/descriptions.js +40 -0
- package/dist/src/tools/descriptions.js.map +1 -0
- package/dist/src/tools/prompts.d.ts +26 -0
- package/dist/src/tools/prompts.d.ts.map +1 -0
- package/dist/src/tools/prompts.js +40 -0
- package/dist/src/tools/prompts.js.map +1 -0
- package/dist/src/tools/rules.d.ts +78 -0
- package/dist/src/tools/rules.d.ts.map +1 -0
- package/dist/src/tools/rules.js +148 -0
- package/dist/src/tools/rules.js.map +1 -0
- package/dist/src/validate.d.ts.map +1 -0
- package/dist/src/{utils/validate.js → validate.js} +3 -1
- package/dist/src/validate.js.map +1 -0
- package/package.json +3 -3
- package/dist/src/opencode/notify.d.ts +0 -10
- package/dist/src/opencode/notify.d.ts.map +0 -1
- package/dist/src/opencode/notify.js +0 -14
- package/dist/src/opencode/notify.js.map +0 -1
- package/dist/src/process-prompt.d.ts +0 -21
- package/dist/src/process-prompt.d.ts.map +0 -1
- package/dist/src/process-prompt.js +0 -20
- package/dist/src/process-prompt.js.map +0 -1
- package/dist/src/process.d.ts +0 -26
- package/dist/src/process.d.ts.map +0 -1
- package/dist/src/process.js +0 -56
- package/dist/src/process.js.map +0 -1
- package/dist/src/prompt-prompt.d.ts +0 -3
- package/dist/src/prompt-prompt.d.ts.map +0 -1
- package/dist/src/prompt-prompt.js +0 -27
- package/dist/src/prompt-prompt.js.map +0 -1
- package/dist/src/prompt.d.ts +0 -7
- package/dist/src/prompt.d.ts.map +0 -1
- package/dist/src/prompt.js +0 -71
- package/dist/src/prompt.js.map +0 -1
- package/dist/src/session.d.ts +0 -23
- package/dist/src/session.d.ts.map +0 -1
- package/dist/src/session.js +0 -116
- package/dist/src/session.js.map +0 -1
- package/dist/src/tools.d.ts +0 -59
- package/dist/src/tools.d.ts.map +0 -1
- package/dist/src/tools.js +0 -221
- package/dist/src/tools.js.map +0 -1
- package/dist/src/utils/compare.d.ts.map +0 -1
- package/dist/src/utils/compare.js.map +0 -1
- package/dist/src/utils/extractLlmError.d.ts +0 -13
- package/dist/src/utils/extractLlmError.d.ts.map +0 -1
- package/dist/src/utils/extractLlmError.js +0 -12
- package/dist/src/utils/extractLlmError.js.map +0 -1
- package/dist/src/utils/safe.d.ts.map +0 -1
- package/dist/src/utils/safe.js.map +0 -1
- package/dist/src/utils/stripCodeFences.d.ts +0 -2
- package/dist/src/utils/stripCodeFences.d.ts.map +0 -1
- package/dist/src/utils/stripCodeFences.js +0 -9
- package/dist/src/utils/stripCodeFences.js.map +0 -1
- package/dist/src/utils/validate.d.ts.map +0 -1
- package/dist/src/utils/validate.js.map +0 -1
- /package/dist/src/{utils/safe.d.ts → safe.d.ts} +0 -0
- /package/dist/src/{utils/safe.js → safe.js} +0 -0
- /package/dist/src/{utils/validate.d.ts → validate.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -21,21 +21,49 @@ Rewrite my instruction files
|
|
|
21
21
|
Add a rule about using early returns
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Messy or voice-transcribed input can be restructured into a clear task hierarchy using the
|
|
24
|
+
Messy or voice-transcribed input can be restructured into a clear task hierarchy using the prompt tools.
|
|
25
25
|
|
|
26
26
|
## Tools
|
|
27
27
|
|
|
28
28
|
For the theory behind the plugin, see [Theoretical Foundation](#theoretical-foundation).
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
The plugin provides 7 tools organized into two pipelines.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
### Rules Pipeline
|
|
33
|
+
|
|
34
|
+
Discovers, parses, formats, and writes instruction rules. The LLM drives each step.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
discover-rules -> parse-rules -> format-rules -> rewrite-rules
|
|
38
|
+
-> add-rules
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### discover-rules
|
|
42
|
+
|
|
43
|
+
Reads instruction files from your `opencode.json` configuration. Accepts an optional `files` string of comma-separated paths to read specific files instead of running discovery.
|
|
44
|
+
|
|
45
|
+
#### parse-rules
|
|
46
|
+
|
|
47
|
+
Parses instruction file content or unstructured user input into structured rules JSON. Validates the parsed rules against the schema and returns validated JSON. Call after `discover-rules` and before `format-rules`.
|
|
48
|
+
|
|
49
|
+
#### format-rules
|
|
50
|
+
|
|
51
|
+
Converts parsed rules into human-readable formatted rule strings. Accepts an optional `mode` (`verbose`, `balanced`, or `concise`, default `balanced`). Validates the formatted rules and returns validated JSON. Call after `parse-rules` and before `rewrite-rules` or `add-rules`.
|
|
52
|
+
|
|
53
|
+
#### rewrite-rules
|
|
54
|
+
|
|
55
|
+
Writes formatted rule strings to instruction files, replacing existing content. Accepts an optional `mode` and an optional `files` string of comma-separated paths. Call after `format-rules`.
|
|
56
|
+
|
|
57
|
+
#### add-rules
|
|
58
|
+
|
|
59
|
+
Appends formatted rule strings to an instruction file without rewriting existing content. Accepts an optional `mode` and an optional `file` path (defaults to the first discovered instruction file). Call after `format-rules`.
|
|
60
|
+
|
|
61
|
+
### Formatting Modes
|
|
33
62
|
|
|
34
63
|
```
|
|
35
|
-
rewrite-
|
|
36
|
-
rewrite-
|
|
37
|
-
|
|
38
|
-
rewrite-instructions [files=a.md,b.md, mode=verbose]
|
|
64
|
+
rewrite-rules [mode=concise]
|
|
65
|
+
rewrite-rules [files=a.md,b.md, mode=verbose]
|
|
66
|
+
add-rules [mode=concise]
|
|
39
67
|
```
|
|
40
68
|
|
|
41
69
|
**Input:**
|
|
@@ -76,31 +104,24 @@ Reason: Arrow functions provide lexical this binding and a more compact syntax.
|
|
|
76
104
|
- Never use function declarations or function expressions.
|
|
77
105
|
```
|
|
78
106
|
|
|
79
|
-
###
|
|
107
|
+
### Prompt Pipeline
|
|
80
108
|
|
|
81
|
-
|
|
109
|
+
Restructures messy or unstructured user input into a clear task hierarchy.
|
|
82
110
|
|
|
83
111
|
```
|
|
84
|
-
|
|
85
|
-
add-instruction [input=Use early returns, mode=concise]
|
|
86
|
-
add-instruction [input=Use early returns, file=docs/rules.md]
|
|
112
|
+
parse-prompt -> format-prompt
|
|
87
113
|
```
|
|
88
114
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Detects when the user corrects the agent or expresses a coding preference, extracts the implicit rule, and appends it to the instruction file. This tool is invoked automatically by the LLM, not by the user. Takes an `input` string of the user's correction or feedback. Accepts an optional `file` path (defaults to the first discovered instruction file).
|
|
115
|
+
#### parse-prompt
|
|
92
116
|
|
|
93
|
-
|
|
94
|
-
automatic-rule [input=Don't use semicolons in this project]
|
|
95
|
-
automatic-rule [input=I prefer early returns, file=docs/rules.md]
|
|
96
|
-
```
|
|
117
|
+
Decomposes raw text (often from voice transcription) into structured tasks with intent, targets, constraints, context, and recursive subtasks. Validates against the schema and returns validated JSON.
|
|
97
118
|
|
|
98
|
-
|
|
119
|
+
#### format-prompt
|
|
99
120
|
|
|
100
|
-
|
|
121
|
+
Renders validated tasks from `parse-prompt` into a formatted markdown tree view.
|
|
101
122
|
|
|
102
123
|
```
|
|
103
|
-
|
|
124
|
+
parse-prompt [input=refactor the search module add guards to each provider make sure bsky and wiki get validated then run the tests]
|
|
104
125
|
```
|
|
105
126
|
|
|
106
127
|
Output:
|
package/dist/sat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sat.d.ts","sourceRoot":"","sources":["../sat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"sat.d.ts","sourceRoot":"","sources":["../sat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAUjD,QAAA,MAAM,MAAM,EAAE,MAoFb,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/dist/sat.js
CHANGED
|
@@ -1,58 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { createFormatPromptTool, createParsePromptTool } from "./src/tools/prompts.js";
|
|
2
|
+
import { createAddTool, createDiscoverTool, createFormatRulesTool, createParseRulesTool, createRewriteTool, } from "./src/tools/rules.js";
|
|
3
|
+
const plugin = async ({ directory }) => {
|
|
4
|
+
const discovered = new Set();
|
|
4
5
|
return {
|
|
5
6
|
tool: {
|
|
6
|
-
'
|
|
7
|
-
|
|
7
|
+
'discover-rules': createDiscoverTool({
|
|
8
|
+
directory,
|
|
9
|
+
discovered,
|
|
8
10
|
description: [
|
|
9
11
|
'- Discover instruction files from opencode.json configuration.',
|
|
10
|
-
'-
|
|
11
|
-
'-
|
|
12
|
-
|
|
12
|
+
'- Read discovered instruction files and return their paths and contents.',
|
|
13
|
+
'- Optionally accept a files parameter to read specific files instead of running discovery.',
|
|
14
|
+
].join('\n'),
|
|
15
|
+
}),
|
|
16
|
+
'parse-rules': createParseRulesTool({
|
|
17
|
+
description: [
|
|
18
|
+
'- Parse instruction file content or unstructured user input into structured rules JSON.',
|
|
19
|
+
'- The rules parameter is required and must be a JSON string matching the schema described in the parameter.',
|
|
20
|
+
'- Validates the parsed rules against the schema and returns the validated JSON.',
|
|
21
|
+
'- Call this tool AFTER discover-rules and BEFORE format-rules.',
|
|
22
|
+
].join('\n'),
|
|
23
|
+
}),
|
|
24
|
+
'format-rules': createFormatRulesTool({
|
|
25
|
+
description: [
|
|
26
|
+
'- Convert parsed rules from parse-rules into human-readable formatted rule strings.',
|
|
27
|
+
'- Express deontic strength naturally: obligatory as positive imperative, forbidden as negated imperative (do not), permissible as "may".',
|
|
13
28
|
'- Optionally accept a mode parameter (verbose, balanced, or concise) to control formatting.',
|
|
14
29
|
'- Default to balanced mode when no mode is specified.',
|
|
15
|
-
'-
|
|
30
|
+
'- For verbose and balanced modes, each rule string must include "Rule: " prefix and "\\nReason: " suffix.',
|
|
31
|
+
'- For concise mode, use "- " prefix with directive only, no reasons.',
|
|
32
|
+
'- The rules parameter is required and must be a JSON string matching the schema described in the parameter.',
|
|
33
|
+
'- Validates the formatted rules and returns the validated JSON.',
|
|
34
|
+
'- Call this tool AFTER parse-rules and BEFORE rewrite-rules or add-rules.',
|
|
16
35
|
].join('\n'),
|
|
17
36
|
}),
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
sessionTitle: 'SAT Add',
|
|
22
|
-
defaultMode: 'balanced',
|
|
23
|
-
hasMode: true,
|
|
24
|
-
successPrefix: 'Added',
|
|
37
|
+
'rewrite-rules': createRewriteTool({
|
|
38
|
+
directory,
|
|
39
|
+
discovered,
|
|
25
40
|
description: [
|
|
26
|
-
'-
|
|
27
|
-
'-
|
|
28
|
-
'-
|
|
29
|
-
'-
|
|
30
|
-
'-
|
|
41
|
+
'- Write formatted rule strings from format-rules to instruction files, replacing existing content.',
|
|
42
|
+
'- The rules parameter is required and must be a JSON string matching the schema described in the parameter.',
|
|
43
|
+
'- Optionally accept a mode parameter (verbose, balanced, or concise) to control formatting.',
|
|
44
|
+
'- Default to balanced mode when no mode is specified.',
|
|
45
|
+
'- Optionally accept a files parameter to process specific files instead of discovering from opencode.json.',
|
|
46
|
+
'- Call this tool AFTER format-rules.',
|
|
47
|
+
].join('\n'),
|
|
48
|
+
}),
|
|
49
|
+
'add-rules': createAddTool({
|
|
50
|
+
directory,
|
|
51
|
+
discovered,
|
|
52
|
+
description: [
|
|
53
|
+
'- Append formatted rule strings from format-rules to an instruction file without rewriting existing content.',
|
|
54
|
+
'- The rules parameter is required and must be a JSON string matching the schema described in the parameter.',
|
|
55
|
+
'- Optionally accept a mode parameter (verbose, balanced, or concise) to control formatting.',
|
|
56
|
+
'- Default to balanced mode when no mode is specified.',
|
|
31
57
|
'- Optionally accept a file parameter to specify the target instruction file.',
|
|
32
58
|
'- Append to the first discovered instruction file when no file parameter is specified.',
|
|
59
|
+
'- Call this tool AFTER format-rules.',
|
|
33
60
|
].join('\n'),
|
|
34
61
|
}),
|
|
35
|
-
'
|
|
36
|
-
deps,
|
|
37
|
-
toolName: 'automatic-rule',
|
|
38
|
-
sessionTitle: 'SAT Candidate',
|
|
39
|
-
defaultMode: 'balanced',
|
|
40
|
-
hasMode: false,
|
|
41
|
-
successPrefix: 'Learned',
|
|
62
|
+
'parse-prompt': createParsePromptTool({
|
|
42
63
|
description: [
|
|
43
|
-
'-
|
|
44
|
-
'-
|
|
45
|
-
'-
|
|
46
|
-
'-
|
|
64
|
+
'- Decompose messy, ambiguous, or voice-transcribed user input into a structured task hierarchy.',
|
|
65
|
+
'- The tasks parameter is required and must be a JSON string matching the schema described in the parameter.',
|
|
66
|
+
'- Validates the parsed tasks against the schema and returns the validated JSON.',
|
|
67
|
+
'- Call this tool BEFORE format-prompt.',
|
|
47
68
|
].join('\n'),
|
|
48
69
|
}),
|
|
49
|
-
'
|
|
50
|
-
deps,
|
|
70
|
+
'format-prompt': createFormatPromptTool({
|
|
51
71
|
description: [
|
|
52
|
-
'-
|
|
53
|
-
'-
|
|
54
|
-
'-
|
|
55
|
-
'-
|
|
72
|
+
'- Render validated tasks from parse-prompt into a formatted markdown tree view.',
|
|
73
|
+
'- The tasks parameter is required and must be a JSON string matching the schema described in the parameter.',
|
|
74
|
+
'- Return formatted markdown after rendering the task tree.',
|
|
75
|
+
'- Call this tool AFTER parse-prompt.',
|
|
56
76
|
].join('\n'),
|
|
57
77
|
}),
|
|
58
78
|
},
|
package/dist/sat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sat.js","sourceRoot":"","sources":["../sat.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sat.js","sourceRoot":"","sources":["../sat.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACtF,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,MAAM,GAAW,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC7C,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAA;IAEpC,OAAO;QACL,IAAI,EAAE;YACJ,gBAAgB,EAAE,kBAAkB,CAAC;gBACnC,SAAS;gBACT,UAAU;gBACV,WAAW,EAAE;oBACX,gEAAgE;oBAChE,0EAA0E;oBAC1E,4FAA4F;iBAC7F,CAAC,IAAI,CAAC,IAAI,CAAC;aACb,CAAC;YAEF,aAAa,EAAE,oBAAoB,CAAC;gBAClC,WAAW,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 -1,22 +1,22 @@
|
|
|
1
|
-
import type { PromptFn } from './process';
|
|
2
|
-
import { type FormatMode } from './prompt';
|
|
3
1
|
type AppendResultSuccess = {
|
|
4
2
|
status: 'success';
|
|
5
3
|
path: string;
|
|
6
4
|
rulesCount: number;
|
|
7
5
|
};
|
|
8
|
-
type
|
|
9
|
-
status: '
|
|
6
|
+
type AppendResultReadError = {
|
|
7
|
+
status: 'readError';
|
|
10
8
|
path: string;
|
|
11
9
|
error: string;
|
|
12
10
|
};
|
|
13
|
-
type
|
|
11
|
+
type AppendResultWriteError = {
|
|
12
|
+
status: 'writeError';
|
|
13
|
+
path: string;
|
|
14
|
+
error: string;
|
|
15
|
+
};
|
|
16
|
+
export type AppendResult = AppendResultSuccess | AppendResultReadError | AppendResultWriteError;
|
|
14
17
|
type AppendRulesOptions = {
|
|
15
|
-
input: string;
|
|
16
18
|
filePath: string;
|
|
17
|
-
|
|
18
|
-
prompt: PromptFn;
|
|
19
|
-
mode?: FormatMode;
|
|
19
|
+
rules: Array<string>;
|
|
20
20
|
};
|
|
21
21
|
export declare const appendRules: (options: AppendRulesOptions) => Promise<AppendResult>;
|
|
22
22
|
export {};
|
package/dist/src/append.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../../src/append.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../../src/append.ts"],"names":[],"mappings":"AAGA,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,WAAW,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,qBAAqB,GAAG,sBAAsB,CAAA;AAE/F,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CACrB,CAAA;AAkBD,eAAO,MAAM,WAAW,GAAU,SAAS,kBAAkB,KAAG,OAAO,CAAC,YAAY,CA6BnF,CAAA"}
|
package/dist/src/append.js
CHANGED
|
@@ -1,46 +1,31 @@
|
|
|
1
1
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// parse unstructured input, format it, and append to end of file
|
|
7
|
-
export const appendRules = async (options) => {
|
|
8
|
-
const mode = options.mode ?? 'balanced';
|
|
9
|
-
const fullPath = resolve(options.directory, options.filePath);
|
|
10
|
-
// read existing file content
|
|
11
|
-
const existing = await safeAsync(() => readFile(fullPath, 'utf-8'));
|
|
12
|
-
if (existing.error !== null) {
|
|
13
|
-
return {
|
|
14
|
-
status: 'readError',
|
|
15
|
-
path: options.filePath,
|
|
16
|
-
error: existing.error.message,
|
|
17
|
-
};
|
|
2
|
+
import { safeAsync } from "./safe.js";
|
|
3
|
+
const computeSeparator = (existing) => {
|
|
4
|
+
if (existing.length === 0) {
|
|
5
|
+
return '';
|
|
18
6
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
path: options.filePath,
|
|
25
|
-
error: String(parseResult.error),
|
|
26
|
-
};
|
|
7
|
+
if (existing.endsWith('\n\n')) {
|
|
8
|
+
return '';
|
|
9
|
+
}
|
|
10
|
+
if (existing.endsWith('\n')) {
|
|
11
|
+
return '\n';
|
|
27
12
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
return '\n\n';
|
|
14
|
+
};
|
|
15
|
+
export const appendRules = async (options) => {
|
|
16
|
+
const readResult = await safeAsync(() => readFile(options.filePath, 'utf-8'));
|
|
17
|
+
if (readResult.error) {
|
|
32
18
|
return {
|
|
33
|
-
status: '
|
|
19
|
+
status: 'readError',
|
|
34
20
|
path: options.filePath,
|
|
35
|
-
error:
|
|
21
|
+
error: readResult.error.message,
|
|
36
22
|
};
|
|
37
23
|
}
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const writeResult = await safeAsync(() => writeFile(fullPath, content, 'utf-8'));
|
|
24
|
+
const formatted = options.rules.join('\n\n') + '\n';
|
|
25
|
+
const existing = readResult.data;
|
|
26
|
+
const separator = computeSeparator(existing);
|
|
27
|
+
const content = existing + separator + formatted;
|
|
28
|
+
const writeResult = await safeAsync(() => writeFile(options.filePath, content, 'utf-8'));
|
|
44
29
|
if (writeResult.error) {
|
|
45
30
|
return {
|
|
46
31
|
status: 'writeError',
|
|
@@ -51,7 +36,7 @@ export const appendRules = async (options) => {
|
|
|
51
36
|
return {
|
|
52
37
|
status: 'success',
|
|
53
38
|
path: options.filePath,
|
|
54
|
-
rulesCount:
|
|
39
|
+
rulesCount: options.rules.length,
|
|
55
40
|
};
|
|
56
41
|
};
|
|
57
42
|
//# sourceMappingURL=append.js.map
|
package/dist/src/append.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"append.js","sourceRoot":"","sources":["../../src/append.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"append.js","sourceRoot":"","sources":["../../src/append.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,SAA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ACL,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,OAAO,CAAC,QAAQ;YACtB,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,OAAO;SACjC,CAAA;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,OAAO,CAAC,QAAQ;QACtB,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM;KACjC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FileResult } from './rewrite.ts';
|
|
1
2
|
export type ComparisonResult = {
|
|
2
3
|
file: string;
|
|
3
4
|
originalBytes: number;
|
|
@@ -20,4 +21,5 @@ export type TableRow = {
|
|
|
20
21
|
comparison?: ComparisonResult;
|
|
21
22
|
};
|
|
22
23
|
export declare const buildTable: (rows: TableRow[]) => string;
|
|
24
|
+
export declare const toTableRow: (result: FileResult) => TableRow;
|
|
23
25
|
//# sourceMappingURL=compare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../src/compare.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAGD,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,EAAE,WAAW,MAAM,KAAG,gBAahF,CAAA;AAQD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAAA;AAGD,eAAO,MAAM,SAAS,GAAI,SAAS,gBAAgB,EAAE,KAAG,iBAYvD,CAAA;AAqBD,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,CAAA;AAGD,eAAO,MAAM,UAAU,GAAI,MAAM,QAAQ,EAAE,KAAG,MA0E7C,CAAA;AAOD,eAAO,MAAM,UAAU,GAAI,QAAQ,UAAU,KAAG,QAgB/C,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Table from 'cli-table3';
|
|
2
|
+
import { basename } from 'node:path';
|
|
2
3
|
// compare byte sizes of two strings and return diff stats
|
|
3
4
|
export const compareBytes = (file, original, generated) => {
|
|
4
5
|
const originalBytes = new TextEncoder().encode(original).length;
|
|
@@ -109,8 +110,29 @@ export const buildTable = (rows) => {
|
|
|
109
110
|
return lines.join('\n');
|
|
110
111
|
}
|
|
111
112
|
const summary = (totals.totalDifference > 0 ? 'SAVED ' : 'INCREASED ')
|
|
112
|
-
+ Math.abs(totals.totalDifference)
|
|
113
|
-
+
|
|
113
|
+
+ Math.abs(totals.totalDifference)
|
|
114
|
+
+ ' bytes ('
|
|
115
|
+
+ Math.abs(totals.totalPercentChange).toFixed(1)
|
|
116
|
+
+ '%)';
|
|
114
117
|
return lines.join('\n') + '\n\n' + summary;
|
|
115
118
|
};
|
|
119
|
+
const ERROR_LABELS = {
|
|
120
|
+
readError: 'Read failed',
|
|
121
|
+
writeError: 'Write failed',
|
|
122
|
+
};
|
|
123
|
+
export const toTableRow = (result) => {
|
|
124
|
+
if (result.status === 'success') {
|
|
125
|
+
return {
|
|
126
|
+
file: basename(result.path),
|
|
127
|
+
status: 'Success',
|
|
128
|
+
rules: result.rulesCount,
|
|
129
|
+
comparison: result.comparison,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const label = ERROR_LABELS[result.status] || result.status;
|
|
133
|
+
return {
|
|
134
|
+
file: basename(result.path),
|
|
135
|
+
status: label,
|
|
136
|
+
};
|
|
137
|
+
};
|
|
116
138
|
//# sourceMappingURL=compare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/compare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAWpC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,QAAgB,EAAE,SAAiB,EAAoB,EAAE;IAClG,MAAM,aAAa,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAA;IAC/D,MAAM,cAAc,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAA;IACjE,MAAM,UAAU,GAAG,aAAa,GAAG,cAAc,CAAA;IACjD,MAAM,aAAa,GAAG,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,aAAa,CAAC,GAAG,GAAG,CAAA;IAElF,OAAO;QACL,IAAI;QACJ,aAAa;QACb,cAAc;QACd,UAAU;QACV,aAAa;KACd,CAAA;AACH,CAAC,CAAA;AAED,0DAA0D;AAC1D,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAE,aAAqB,EAAU,EAAE;IACzE,MAAM,MAAM,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAA;IAC9C,OAAO,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;AAC1D,CAAC,CAAA;AASD,uDAAuD;AACvD,MAAM,CAA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D,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;YAC3B,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,MAAM,CAAC,UAAU;YACxB,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAA;IACH,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAA;IAE1D,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QAC3B,MAAM,EAAE,KAAK;KACd,CAAA;AACH,CAAC,CAAA"}
|
package/dist/src/discover.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/discover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAmB,MAAM,
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/discover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAmB,MAAM,WAAW,CAAA;AAExD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,cAAc,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC,CAAA;AAoF/C,eAAO,MAAM,aAAa,GAAU,WAAW,MAAM,EAAE,OAAO,MAAM,EAAE,KAAG,OAAO,CAAC,eAAe,EAAE,CAGjG,CAAA;AAED,eAAO,MAAM,QAAQ,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,cAAc,CAsBxE,CAAA"}
|
package/dist/src/discover.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { glob, readFile } from 'node:fs/promises';
|
|
2
2
|
import { join, resolve } from 'node:path';
|
|
3
|
-
import { safe, safeAsync } from
|
|
3
|
+
import { safe, safeAsync } from "./safe.js";
|
|
4
4
|
const readConfig = async (directory) => {
|
|
5
5
|
const configPath = join(directory, 'opencode.json');
|
|
6
6
|
const readResult = await safeAsync(() => readFile(configPath, 'utf-8'));
|
package/dist/src/discover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAe,IAAI,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAe,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAWxD,MAAM,UAAU,GAAG,KAAK,EAAE,SAAiB,EAAyB,EAAE;IACpE,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;IACnD,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;IACvE,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,iBAAiB,GAAG,UAAU,GAAG,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO;SACxE,CAAA;IACH,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,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C3E,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,CAAA;IAC1C,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAA;IACH,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;IAC5B,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACrD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,gDAAgD,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;SAC9E,CAAA;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,MAAM,SAAS,CAAC,KAAK,CAAC;QAC5B,KAAK,EAAE,IAAI;KACZ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-prompt.d.ts","sourceRoot":"","sources":["../../src/format-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"format-prompt.d.ts","sourceRoot":"","sources":["../../src/format-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAA;AAoHlE,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,KAAG,MA8BnD,CAAA"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
const buildNode = (options) => {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
counter.value++;
|
|
2
|
+
const label = String(options.counter.value) + '. ' + options.task.intent;
|
|
3
|
+
options.counter.value++;
|
|
5
4
|
const metaLines = [];
|
|
6
|
-
if (task.targets.length > 0) {
|
|
7
|
-
metaLines.push('> Targets: ' + task.targets.join(', '));
|
|
5
|
+
if (options.task.targets.length > 0) {
|
|
6
|
+
metaLines.push('> Targets: ' + options.task.targets.join(', '));
|
|
8
7
|
}
|
|
9
|
-
if (task.constraints.length > 0) {
|
|
10
|
-
metaLines.push('> Constraints: ' + task.constraints.join(', '));
|
|
8
|
+
if (options.task.constraints.length > 0) {
|
|
9
|
+
metaLines.push('> Constraints: ' + options.task.constraints.join(', '));
|
|
11
10
|
}
|
|
12
|
-
if (task.context) {
|
|
13
|
-
metaLines.push('> Context: ' + task.context);
|
|
11
|
+
if (options.task.context) {
|
|
12
|
+
metaLines.push('> Context: ' + options.task.context);
|
|
14
13
|
}
|
|
15
|
-
const children = task.subtasks.map((subtask) => {
|
|
16
|
-
return buildNode({ task: subtask, counter });
|
|
14
|
+
const children = options.task.subtasks.map((subtask) => {
|
|
15
|
+
return buildNode({ task: subtask, counter: options.counter });
|
|
17
16
|
});
|
|
18
17
|
return { label, metaLines, children };
|
|
19
18
|
};
|
|
@@ -28,37 +27,47 @@ const flatten = (nodes) => {
|
|
|
28
27
|
return result;
|
|
29
28
|
};
|
|
30
29
|
const renderNode = (options) => {
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const firstLine = prefix + node.label;
|
|
30
|
+
const hasChildren = options.node.children.length > 0;
|
|
31
|
+
const firstLine = options.prefix + options.node.label;
|
|
34
32
|
const lines = [firstLine];
|
|
35
|
-
const numEnd = node.label.indexOf('. ') + 2;
|
|
36
|
-
const textStart = prefix.length + numEnd;
|
|
33
|
+
const numEnd = options.node.label.indexOf('. ') + 2;
|
|
34
|
+
const textStart = options.prefix.length + numEnd;
|
|
37
35
|
const pipe = hasChildren ? '│' : ' ';
|
|
38
|
-
const padLen = textStart - childPrefix.length - 1;
|
|
39
|
-
const metaPad = childPrefix + pipe + ' '.repeat(padLen > 0 ? padLen : 0);
|
|
40
|
-
for (const meta of node.metaLines) {
|
|
36
|
+
const padLen = textStart - options.childPrefix.length - 1;
|
|
37
|
+
const metaPad = options.childPrefix + pipe + ' '.repeat(padLen > 0 ? padLen : 0);
|
|
38
|
+
for (const meta of options.node.metaLines) {
|
|
41
39
|
lines.push(metaPad + meta);
|
|
42
40
|
}
|
|
43
41
|
if (hasChildren) {
|
|
44
|
-
lines.push(childPrefix + '│');
|
|
45
|
-
for (let i = 0; i < node.children.length; i++) {
|
|
46
|
-
const child = node.children[i];
|
|
42
|
+
lines.push(options.childPrefix + '│');
|
|
43
|
+
for (let i = 0; i < options.node.children.length; i++) {
|
|
44
|
+
const child = options.node.children[i];
|
|
47
45
|
if (!child)
|
|
48
46
|
continue;
|
|
49
47
|
if (i > 0) {
|
|
50
|
-
lines.push(childPrefix + '│');
|
|
48
|
+
lines.push(options.childPrefix + '│');
|
|
51
49
|
}
|
|
52
|
-
const isLast = i === node.children.length - 1;
|
|
50
|
+
const isLast = i === options.node.children.length - 1;
|
|
53
51
|
const childHasChildren = child.children.length > 0;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
let connector = isLast ? '└──' : '├──';
|
|
53
|
+
connector += childHasChildren ? '┬ ' : '─ ';
|
|
54
|
+
let continuation = '';
|
|
55
|
+
if (isLast && childHasChildren) {
|
|
56
|
+
continuation = ' ';
|
|
57
|
+
}
|
|
58
|
+
else if (isLast) {
|
|
59
|
+
continuation = ' ';
|
|
60
|
+
}
|
|
61
|
+
else if (childHasChildren) {
|
|
62
|
+
continuation = '│ ';
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
continuation = '│ ';
|
|
66
|
+
}
|
|
58
67
|
const childLines = renderNode({
|
|
59
68
|
node: child,
|
|
60
|
-
prefix: childPrefix + connector,
|
|
61
|
-
childPrefix: childPrefix + continuation,
|
|
69
|
+
prefix: options.childPrefix + connector,
|
|
70
|
+
childPrefix: options.childPrefix + continuation,
|
|
62
71
|
});
|
|
63
72
|
lines.push(...childLines);
|
|
64
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-prompt.js","sourceRoot":"","sources":["../../src/format-prompt.ts"],"names":[],"mappings":"AAeA,MAAM,SAAS,GAAG,CAAC,OAAyB,EAAY,EAAE;IACxD,MAAM,
|
|
1
|
+
{"version":3,"file":"format-prompt.js","sourceRoot":"","sources":["../../src/format-prompt.ts"],"names":[],"mappings":"AAeA,MAAM,SAAS,GAAG,CAAC,OAAyB,EAAY,EAAE;IACxD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;IACxE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;IAEvB,MAAM,SAAS,GAAkB,EAAE,CAAA;IAEnC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,SAAS,CAAC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACjE,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxC,SAAS,CAAC,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACzE,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,SAAS,CAAC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACrD,OAAO,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,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