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.
Files changed (92) hide show
  1. package/README.md +43 -22
  2. package/dist/sat.d.ts.map +1 -1
  3. package/dist/sat.js +58 -38
  4. package/dist/sat.js.map +1 -1
  5. package/dist/src/append.d.ts +9 -9
  6. package/dist/src/append.d.ts.map +1 -1
  7. package/dist/src/append.js +22 -37
  8. package/dist/src/append.js.map +1 -1
  9. package/dist/src/{utils/compare.d.ts → compare.d.ts} +2 -0
  10. package/dist/src/compare.d.ts.map +1 -0
  11. package/dist/src/{utils/compare.js → compare.js} +24 -2
  12. package/dist/src/compare.js.map +1 -0
  13. package/dist/src/discover.d.ts +1 -1
  14. package/dist/src/discover.d.ts.map +1 -1
  15. package/dist/src/discover.js +1 -1
  16. package/dist/src/discover.js.map +1 -1
  17. package/dist/src/format-prompt.d.ts.map +1 -1
  18. package/dist/src/format-prompt.js +39 -30
  19. package/dist/src/format-prompt.js.map +1 -1
  20. package/dist/src/resolve.d.ts +1 -1
  21. package/dist/src/resolve.d.ts.map +1 -1
  22. package/dist/src/rewrite.d.ts +21 -0
  23. package/dist/src/rewrite.d.ts.map +1 -0
  24. package/dist/src/rewrite.js +30 -0
  25. package/dist/src/rewrite.js.map +1 -0
  26. package/dist/src/rule-schema.d.ts +5 -4
  27. package/dist/src/rule-schema.d.ts.map +1 -1
  28. package/dist/src/rule-schema.js +5 -0
  29. package/dist/src/rule-schema.js.map +1 -1
  30. package/dist/src/safe.d.ts.map +1 -0
  31. package/dist/src/safe.js.map +1 -0
  32. package/dist/src/tools/descriptions.d.ts +5 -0
  33. package/dist/src/tools/descriptions.d.ts.map +1 -0
  34. package/dist/src/tools/descriptions.js +40 -0
  35. package/dist/src/tools/descriptions.js.map +1 -0
  36. package/dist/src/tools/prompts.d.ts +26 -0
  37. package/dist/src/tools/prompts.d.ts.map +1 -0
  38. package/dist/src/tools/prompts.js +40 -0
  39. package/dist/src/tools/prompts.js.map +1 -0
  40. package/dist/src/tools/rules.d.ts +78 -0
  41. package/dist/src/tools/rules.d.ts.map +1 -0
  42. package/dist/src/tools/rules.js +148 -0
  43. package/dist/src/tools/rules.js.map +1 -0
  44. package/dist/src/validate.d.ts.map +1 -0
  45. package/dist/src/{utils/validate.js → validate.js} +3 -1
  46. package/dist/src/validate.js.map +1 -0
  47. package/package.json +3 -3
  48. package/dist/src/opencode/notify.d.ts +0 -10
  49. package/dist/src/opencode/notify.d.ts.map +0 -1
  50. package/dist/src/opencode/notify.js +0 -14
  51. package/dist/src/opencode/notify.js.map +0 -1
  52. package/dist/src/process-prompt.d.ts +0 -21
  53. package/dist/src/process-prompt.d.ts.map +0 -1
  54. package/dist/src/process-prompt.js +0 -20
  55. package/dist/src/process-prompt.js.map +0 -1
  56. package/dist/src/process.d.ts +0 -26
  57. package/dist/src/process.d.ts.map +0 -1
  58. package/dist/src/process.js +0 -56
  59. package/dist/src/process.js.map +0 -1
  60. package/dist/src/prompt-prompt.d.ts +0 -3
  61. package/dist/src/prompt-prompt.d.ts.map +0 -1
  62. package/dist/src/prompt-prompt.js +0 -27
  63. package/dist/src/prompt-prompt.js.map +0 -1
  64. package/dist/src/prompt.d.ts +0 -7
  65. package/dist/src/prompt.d.ts.map +0 -1
  66. package/dist/src/prompt.js +0 -71
  67. package/dist/src/prompt.js.map +0 -1
  68. package/dist/src/session.d.ts +0 -23
  69. package/dist/src/session.d.ts.map +0 -1
  70. package/dist/src/session.js +0 -116
  71. package/dist/src/session.js.map +0 -1
  72. package/dist/src/tools.d.ts +0 -59
  73. package/dist/src/tools.d.ts.map +0 -1
  74. package/dist/src/tools.js +0 -221
  75. package/dist/src/tools.js.map +0 -1
  76. package/dist/src/utils/compare.d.ts.map +0 -1
  77. package/dist/src/utils/compare.js.map +0 -1
  78. package/dist/src/utils/extractLlmError.d.ts +0 -13
  79. package/dist/src/utils/extractLlmError.d.ts.map +0 -1
  80. package/dist/src/utils/extractLlmError.js +0 -12
  81. package/dist/src/utils/extractLlmError.js.map +0 -1
  82. package/dist/src/utils/safe.d.ts.map +0 -1
  83. package/dist/src/utils/safe.js.map +0 -1
  84. package/dist/src/utils/stripCodeFences.d.ts +0 -2
  85. package/dist/src/utils/stripCodeFences.d.ts.map +0 -1
  86. package/dist/src/utils/stripCodeFences.js +0 -9
  87. package/dist/src/utils/stripCodeFences.js.map +0 -1
  88. package/dist/src/utils/validate.d.ts.map +0 -1
  89. package/dist/src/utils/validate.js.map +0 -1
  90. /package/dist/src/{utils/safe.d.ts → safe.d.ts} +0 -0
  91. /package/dist/src/{utils/safe.js → safe.js} +0 -0
  92. /package/dist/src/{utils/validate.d.ts → validate.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
1
  import type { InstructionFile } from './discover.ts';
2
- import type { Result } from './utils/safe.ts';
2
+ import type { Result } from './safe.ts';
3
3
  export declare const resolveFiles: (directory: string, filesArg?: string) => Promise<Result<InstructionFile[]>>;
4
4
  //# sourceMappingURL=resolve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAG7C,eAAO,MAAM,YAAY,GAAU,WAAW,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAiB1G,CAAA"}
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGvC,eAAO,MAAM,YAAY,GAAU,WAAW,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAiB1G,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { type ComparisonResult } from './compare.ts';
2
+ import type { InstructionFile } from './discover.ts';
3
+ type FileResultSuccess = {
4
+ status: 'success';
5
+ path: string;
6
+ rulesCount: number;
7
+ comparison: ComparisonResult;
8
+ };
9
+ type FileResultError = {
10
+ status: 'readError' | 'writeError';
11
+ path: string;
12
+ error: string;
13
+ };
14
+ export type FileResult = FileResultSuccess | FileResultError;
15
+ type ProcessFileOptions = {
16
+ file: InstructionFile;
17
+ rules: Array<string>;
18
+ };
19
+ export declare const processFile: (options: ProcessFileOptions) => Promise<FileResult>;
20
+ export {};
21
+ //# sourceMappingURL=rewrite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rewrite.d.ts","sourceRoot":"","sources":["../../src/rewrite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,gBAAgB,CAAA;CAC7B,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,WAAW,GAAG,YAAY,CAAA;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,eAAe,CAAA;AAE5D,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,eAAe,CAAA;IACrB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,WAAW,GAAU,SAAS,kBAAkB,KAAG,OAAO,CAAC,UAAU,CA4BjF,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { writeFile } from 'node:fs/promises';
2
+ import { basename } from 'node:path';
3
+ import { compareBytes } from "./compare.js";
4
+ import { safeAsync } from "./safe.js";
5
+ export const processFile = async (options) => {
6
+ if (options.file.error) {
7
+ return {
8
+ status: 'readError',
9
+ path: options.file.path,
10
+ error: options.file.error,
11
+ };
12
+ }
13
+ const content = options.rules.join('\n\n') + '\n';
14
+ const writeResult = await safeAsync(() => writeFile(options.file.path, content, 'utf-8'));
15
+ if (writeResult.error) {
16
+ return {
17
+ status: 'writeError',
18
+ path: options.file.path,
19
+ error: writeResult.error.message,
20
+ };
21
+ }
22
+ const comparison = compareBytes(basename(options.file.path), options.file.content, content);
23
+ return {
24
+ status: 'success',
25
+ path: options.file.path,
26
+ rulesCount: options.rules.length,
27
+ comparison,
28
+ };
29
+ };
30
+ //# sourceMappingURL=rewrite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rewrite.js","sourceRoot":"","sources":["../../src/rewrite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,YAAY,EAAyB,MAAM,cAAc,CAAA;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAsBrC,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,OAA2B,EAAuB,EAAE;IACpF,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACvB,OAAO;YACL,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI;YACvB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;SAC1B,CAAA;IACH,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;IAEjD,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IACzF,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO;YACL,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI;YACvB,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,OAAO;SACjC,CAAA;IACH,CAAC;IAED,MAAM,UAAU,GAAG,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAE3F,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI;QACvB,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM;QAChC,UAAU;KACX,CAAA;AACH,CAAC,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  export declare const StrengthSchema: z.ZodEnum<{
3
+ optional: "optional";
3
4
  obligatory: "obligatory";
4
5
  permissible: "permissible";
5
6
  forbidden: "forbidden";
6
- optional: "optional";
7
7
  supererogatory: "supererogatory";
8
8
  indifferent: "indifferent";
9
9
  omissible: "omissible";
@@ -14,10 +14,10 @@ export declare const ContextSchema: z.ZodString;
14
14
  export declare const ReasonSchema: z.ZodString;
15
15
  export declare const ParsedRuleSchema: z.ZodObject<{
16
16
  strength: z.ZodEnum<{
17
+ optional: "optional";
17
18
  obligatory: "obligatory";
18
19
  permissible: "permissible";
19
20
  forbidden: "forbidden";
20
- optional: "optional";
21
21
  supererogatory: "supererogatory";
22
22
  indifferent: "indifferent";
23
23
  omissible: "omissible";
@@ -30,10 +30,10 @@ export declare const ParsedRuleSchema: z.ZodObject<{
30
30
  export declare const RuleSchema: z.ZodString;
31
31
  export declare const ParsedSchema: z.ZodArray<z.ZodObject<{
32
32
  strength: z.ZodEnum<{
33
+ optional: "optional";
33
34
  obligatory: "obligatory";
34
35
  permissible: "permissible";
35
36
  forbidden: "forbidden";
36
- optional: "optional";
37
37
  supererogatory: "supererogatory";
38
38
  indifferent: "indifferent";
39
39
  omissible: "omissible";
@@ -46,10 +46,10 @@ export declare const ParsedSchema: z.ZodArray<z.ZodObject<{
46
46
  export declare const ParseResponseSchema: z.ZodObject<{
47
47
  rules: z.ZodArray<z.ZodObject<{
48
48
  strength: z.ZodEnum<{
49
+ optional: "optional";
49
50
  obligatory: "obligatory";
50
51
  permissible: "permissible";
51
52
  forbidden: "forbidden";
52
- optional: "optional";
53
53
  supererogatory: "supererogatory";
54
54
  indifferent: "indifferent";
55
55
  omissible: "omissible";
@@ -66,4 +66,5 @@ export declare const FormatResponseSchema: z.ZodObject<{
66
66
  export type Strength = z.infer<typeof StrengthSchema>;
67
67
  export type ParsedRule = z.infer<typeof ParsedRuleSchema>;
68
68
  export declare const parseSchemaExample: string;
69
+ export declare const formatSchemaExample: string;
69
70
  //# sourceMappingURL=rule-schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rule-schema.d.ts","sourceRoot":"","sources":["../../src/rule-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc;;;;;;;;EASoC,CAAA;AAE/D,eAAO,MAAM,YAAY,aACmC,CAAA;AAE5D,eAAO,MAAM,YAAY,aAC6B,CAAA;AAEtD,eAAO,MAAM,aAAa,aAC4C,CAAA;AAEtE,eAAO,MAAM,YAAY,aAC2B,CAAA;AAEpD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;iBAOuC,CAAA;AAEpE,eAAO,MAAM,UAAU,aAC0C,CAAA;AAEjE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;kBACW,CAAA;AAEpC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;iBAE9B,CAAA;AAEF,eAAO,MAAM,oBAAoB;;iBAE/B,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,kBAAkB,QAQ7B,CAAA"}
1
+ {"version":3,"file":"rule-schema.d.ts","sourceRoot":"","sources":["../../src/rule-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc;;;;;;;;EASoC,CAAA;AAE/D,eAAO,MAAM,YAAY,aACmC,CAAA;AAE5D,eAAO,MAAM,YAAY,aAC6B,CAAA;AAEtD,eAAO,MAAM,aAAa,aAC4C,CAAA;AAEtE,eAAO,MAAM,YAAY,aAC2B,CAAA;AAEpD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;iBAOuC,CAAA;AAEpE,eAAO,MAAM,UAAU,aAC0C,CAAA;AAEjE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;kBACW,CAAA;AAEpC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;iBAE9B,CAAA;AAEF,eAAO,MAAM,oBAAoB;;iBAE/B,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,kBAAkB,QAQ7B,CAAA;AAEF,eAAO,MAAM,mBAAmB,QAI9B,CAAA"}
@@ -44,4 +44,9 @@ export const parseSchemaExample = JSON.stringify({
44
44
  reason: ReasonSchema.description || 'justification',
45
45
  }],
46
46
  });
47
+ export const formatSchemaExample = JSON.stringify({
48
+ rules: [
49
+ 'Rule: verb target context\nReason: justification',
50
+ ],
51
+ });
47
52
  //# sourceM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AAmB,GAAG,IAAI,CAAC,SAAS,CAAC;IAChD,KAAK,EAAE;QACL,kDAAkD;KACnD;CACF,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,CAAC,CAAC,IAAI;IACtB,IAAI,EAAE,CAAC,CAAA;IACP,KAAK,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,KAAK,WAAW,CAAC,CAAC,IAAI;IACpB,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,CAAC,CAAA;CACT,CAAA;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;AAErE,KAAK,UAAU,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAErC,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,IAAI,MAAM,CAAC,KAAG,UAAU,CAAC,CAAC,CAajD,CAAA;AAED,eAAO,MAAM,SAAS,GAAU,CAAC,EAAE,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAa9E,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe.js","sourceRoot":"","sources":["../../src/safe.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,IAAI,GAAG,CAAI,EAAW,EAAiB,EAAE;IACpD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,EAAE,EAAE,CAAA;QACjB,OAAO;YACL,IAAI;YACJ,KAAK,EAAE,IAAI;SACZ,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACjE,CAAA;IACH,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAAK,EAAoB,EAA0B,EAAE;IACjF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,EAAE,CAAA;QACvB,OAAO;YACL,IAAI;YACJ,KAAK,EAAE,IAAI;SACZ,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACjE,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare const PARSE_RULES_DESC: string;
2
+ export declare const MODE_DESC: string;
3
+ export declare const FORMAT_RULES_DESC: string;
4
+ export declare const PARSE_PROMPT_DESC: string;
5
+ //# sourceMappingURL=descriptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptions.d.ts","sourceRoot":"","sources":["../../../src/tools/descriptions.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,QASjB,CAAA;AAEZ,eAAO,MAAM,SAAS,QAKV,CAAA;AAEZ,eAAO,MAAM,iBAAiB,QAUlB,CAAA;AAEZ,eAAO,MAAM,iBAAiB,QASlB,CAAA"}
@@ -0,0 +1,40 @@
1
+ import { promptSchemaExample } from "../prompt-schema.js";
2
+ import { formatSchemaExample, parseSchemaExample } from "../rule-schema.js";
3
+ export const PARSE_RULES_DESC = [
4
+ 'Object with a "rules" array. Each rule: {',
5
+ ' strength: obligatory|permissible|forbidden|optional|supererogatory|indifferent|omissible,',
6
+ ' action: imperative verb describing what to do,',
7
+ ' target: what the action applies to,',
8
+ ' context: (optional) when/where the rule applies,',
9
+ ' reason: why the rule exists',
10
+ '}',
11
+ 'Example: ' + parseSchemaExample,
12
+ ].join('\n');
13
+ export const MODE_DESC = [
14
+ 'Formatting mode: verbose, balanced, or concise.',
15
+ ' verbose: Full Rule/Reason pairs for every rule.',
16
+ ' balanced (default): The LLM decides which rules need reasons.',
17
+ ' concise: Bullet list of directives only, no reasons.',
18
+ ].join('\n');
19
+ export const FORMAT_RULES_DESC = [
20
+ 'Array of human-readable rule strings.',
21
+ 'Each string is a formatted rule derived from parsed components.',
22
+ 'Express the deontic strength naturally in the rule text:',
23
+ ' obligatory -> "use consistent whitespace" (positive imperative)',
24
+ ' forbidden -> "do not use non-null assertions" (negated imperative)',
25
+ ' permissible -> "may use type assertions when necessary"',
26
+ 'For verbose and balanced modes, include "Rule: " prefix and "\\nReason: " suffix.',
27
+ 'For concise mode, use "- " prefix with no reason.',
28
+ 'Example: ' + formatSchemaExample,
29
+ ].join('\n');
30
+ export const PARSE_PROMPT_DESC = [
31
+ 'Parsed prompt with array of tasks. Each task: {',
32
+ ' intent: clear directive of what to do,',
33
+ ' targets: files/systems involved (default []),',
34
+ ' constraints: conditions/requirements (default []),',
35
+ ' context: (optional) background rationale,',
36
+ ' subtasks: nested tasks (default [])',
37
+ '}',
38
+ 'Example: ' + promptSchemaExample,
39
+ ].join('\n');
40
+ //# sourceMappingURL=descriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../../../src/tools/descriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,2CAA2C;IAC3C,6FAA6F;IAC7F,kDAAkD;IAClD,uCAAuC;IACvC,oDAAoD;IACpD,+BAA+B;IAC/B,GAAG;IACH,WAAW,GAAG,kBAAkB;CACjC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iDAAiD;IACjD,mDAAmD;IACnD,iEAAiE;IACjE,wDAAwD;CACzD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,uCAAuC;IACvC,iEAAiE;IACjE,0DAA0D;IAC1D,mEAAmE;IACnE,sEAAsE;IACtE,2DAA2D;IAC3D,mFAAmF;IACnF,mDAAmD;IACnD,WAAW,GAAG,mBAAmB;CAClC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iDAAiD;IACjD,0CAA0C;IAC1C,iDAAiD;IACjD,sDAAsD;IACtD,6CAA6C;IAC7C,uCAAuC;IACvC,GAAG;IACH,WAAW,GAAG,mBAAmB;CAClC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA"}
@@ -0,0 +1,26 @@
1
+ type ParsePromptToolOptions = {
2
+ description: string;
3
+ };
4
+ export declare const createParsePromptTool: (options: ParsePromptToolOptions) => {
5
+ description: string;
6
+ args: {
7
+ tasks: import("zod").ZodString;
8
+ };
9
+ execute(args: {
10
+ tasks: string;
11
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
12
+ };
13
+ type FormatPromptToolOptions = {
14
+ description: string;
15
+ };
16
+ export declare const createFormatPromptTool: (options: FormatPromptToolOptions) => {
17
+ description: string;
18
+ args: {
19
+ tasks: import("zod").ZodString;
20
+ };
21
+ execute(args: {
22
+ tasks: string;
23
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
24
+ };
25
+ export {};
26
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/tools/prompts.ts"],"names":[],"mappings":"AAQA,KAAK,sBAAsB,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,SAAS,sBAAsB;;;;;;;;CAepE,CAAA;AAID,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,SAAS,uBAAuB;;;;;;;;CAqBtE,CAAA"}
@@ -0,0 +1,40 @@
1
+ import { tool } from '@opencode-ai/plugin';
2
+ import { formatPrompt } from "../format-prompt.js";
3
+ import { ParsedPromptSchema } from "../prompt-schema.js";
4
+ import { formatValidationError, validateJson } from "../validate.js";
5
+ import { PARSE_PROMPT_DESC } from "./descriptions.js";
6
+ export const createParsePromptTool = (options) => {
7
+ return tool({
8
+ description: options.description,
9
+ args: {
10
+ tasks: tool.schema.string().describe(PARSE_PROMPT_DESC),
11
+ },
12
+ async execute(args) {
13
+ const validated = validateJson(args.tasks, ParsedPromptSchema);
14
+ if (validated.error !== null) {
15
+ return formatValidationError(validated);
16
+ }
17
+ return JSON.stringify(validated.data, null, 2);
18
+ },
19
+ });
20
+ };
21
+ export const createFormatPromptTool = (options) => {
22
+ return tool({
23
+ description: options.description,
24
+ args: {
25
+ tasks: tool.schema.string().describe(PARSE_PROMPT_DESC),
26
+ },
27
+ async execute(args) {
28
+ const validated = validateJson(args.tasks, ParsedPromptSchema);
29
+ if (validated.error !== null) {
30
+ return formatValidationError(validated);
31
+ }
32
+ const formatted = formatPrompt(validated.data);
33
+ if (formatted.length === 0) {
34
+ return 'No tasks found in the parsed input';
35
+ }
36
+ return formatted;
37
+ },
38
+ });
39
+ };
40
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/tools/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAA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AC,SAAS,CAAC,IAAI,CAAC,CAAA;YAE9C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,OAAO,oCAAoC,CAAA;YAC7C,CAAC;YAED,OAAO,SAAS,CAAA;QAClB,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,78 @@
1
+ type DiscoverToolOptions = {
2
+ description: string;
3
+ directory: string;
4
+ discovered: Set<string>;
5
+ };
6
+ export declare const createDiscoverTool: (options: DiscoverToolOptions) => {
7
+ description: string;
8
+ args: {
9
+ files: import("zod").ZodOptional<import("zod").ZodString>;
10
+ };
11
+ execute(args: {
12
+ files?: string | undefined;
13
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
14
+ };
15
+ type ParseRulesToolOptions = {
16
+ description: string;
17
+ };
18
+ export declare const createParseRulesTool: (options: ParseRulesToolOptions) => {
19
+ description: string;
20
+ args: {
21
+ rules: import("zod").ZodString;
22
+ };
23
+ execute(args: {
24
+ rules: string;
25
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
26
+ };
27
+ type FormatRulesToolOptions = {
28
+ description: string;
29
+ };
30
+ export declare const createFormatRulesTool: (options: FormatRulesToolOptions) => {
31
+ description: string;
32
+ args: {
33
+ rules: import("zod").ZodString;
34
+ mode: import("zod").ZodOptional<import("zod").ZodString>;
35
+ };
36
+ execute(args: {
37
+ rules: string;
38
+ mode?: string | undefined;
39
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
40
+ };
41
+ type RewriteToolOptions = {
42
+ description: string;
43
+ directory: string;
44
+ discovered: Set<string>;
45
+ };
46
+ export declare const createRewriteTool: (options: RewriteToolOptions) => {
47
+ description: string;
48
+ args: {
49
+ rules: import("zod").ZodString;
50
+ files: import("zod").ZodOptional<import("zod").ZodString>;
51
+ mode: import("zod").ZodOptional<import("zod").ZodString>;
52
+ };
53
+ execute(args: {
54
+ rules: string;
55
+ files?: string | undefined;
56
+ mode?: string | undefined;
57
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
58
+ };
59
+ type AddToolOptions = {
60
+ description: string;
61
+ directory: string;
62
+ discovered: Set<string>;
63
+ };
64
+ export declare const createAddTool: (options: AddToolOptions) => {
65
+ description: string;
66
+ args: {
67
+ rules: import("zod").ZodString;
68
+ file: import("zod").ZodOptional<import("zod").ZodString>;
69
+ mode: import("zod").ZodOptional<import("zod").ZodString>;
70
+ };
71
+ execute(args: {
72
+ rules: string;
73
+ file?: string | undefined;
74
+ mode?: string | undefined;
75
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
76
+ };
77
+ export {};
78
+ //# sourceMappingURL=rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/tools/rules.ts"],"names":[],"mappings":"AAWA,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,SAAS,mBAAmB;;;;;;;;CAsC9D,CAAA;AAID,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,SAAS,qBAAqB;;;;;;;;CAelE,CAAA;AAID,KAAK,sBAAsB,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,SAAS,sBAAsB;;;;;;;;;;CAgBpE,CAAA;AAID,KAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,SAAS,kBAAkB;;;;;;;;;;;;CA0C5D,CAAA;AAID,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,cAAc;;;;;;;;;;;;CA+CpD,CAAA"}
@@ -0,0 +1,148 @@
1
+ import { tool } from '@opencode-ai/plugin';
2
+ import { appendRules } from "../append.js";
3
+ import { buildTable, toTableRow } from "../compare.js";
4
+ import { resolveFiles } from "../resolve.js";
5
+ import { processFile } from "../rewrite.js";
6
+ import { FormatResponseSchema, ParseResponseSchema } from "../rule-schema.js";
7
+ import { formatValidationError, validateJson } from "../validate.js";
8
+ import { FORMAT_RULES_DESC, MODE_DESC, PARSE_RULES_DESC } from "./descriptions.js";
9
+ export const createDiscoverTool = (options) => {
10
+ return tool({
11
+ description: options.description,
12
+ args: {
13
+ files: tool.schema
14
+ .string()
15
+ .optional()
16
+ .describe('Comma-separated file paths to read instead of discovering from opencode.json'),
17
+ },
18
+ async execute(args) {
19
+ const resolved = await resolveFiles(options.directory, args.files);
20
+ if (resolved.error !== null) {
21
+ return resolved.error;
22
+ }
23
+ if (resolved.data.length === 0) {
24
+ return 'No instruction files found';
25
+ }
26
+ for (const file of resolved.data) {
27
+ options.discovered.add(file.path);
28
+ }
29
+ const sections = resolved.data.map((file) => {
30
+ if (file.error) {
31
+ return '## ' + file.path + '\n\nError: ' + file.error;
32
+ }
33
+ if (file.content.length === 0) {
34
+ return '## ' + file.path + '\n\n(empty file)';
35
+ }
36
+ return '## ' + file.path + '\n\n' + file.content;
37
+ });
38
+ return sections.join('\n\n---\n\n');
39
+ },
40
+ });
41
+ };
42
+ export const createParseRulesTool = (options) => {
43
+ return tool({
44
+ description: options.description,
45
+ args: {
46
+ rules: tool.schema.string().describe(PARSE_RULES_DESC),
47
+ },
48
+ async execute(args) {
49
+ const validated = validateJson(args.rules, ParseResponseSchema);
50
+ if (validated.error !== null) {
51
+ return formatValidationError(validated);
52
+ }
53
+ return JSON.stringify(validated.data, null, 2);
54
+ },
55
+ });
56
+ };
57
+ export const createFormatRulesTool = (options) => {
58
+ return tool({
59
+ description: options.description,
60
+ args: {
61
+ rules: tool.schema.string().describe(FORMAT_RULES_DESC),
62
+ mode: tool.schema.string().optional().describe(MODE_DESC),
63
+ },
64
+ async execute(args) {
65
+ const validated = validateJson(args.rules, FormatResponseSchema);
66
+ if (validated.error !== null) {
67
+ return formatValidationError(validated);
68
+ }
69
+ return JSON.stringify(validated.data, null, 2);
70
+ },
71
+ });
72
+ };
73
+ export const createRewriteTool = (options) => {
74
+ return tool({
75
+ description: options.description,
76
+ args: {
77
+ rules: tool.schema.string().describe(FORMAT_RULES_DESC),
78
+ files: tool.schema.string().optional()
79
+ .describe('Comma-separated file paths to process instead of discovering from opencode.json'),
80
+ mode: tool.schema.string().optional().describe(MODE_DESC),
81
+ },
82
+ async execute(args, context) {
83
+ if (options.discovered.size === 0) {
84
+ return 'Call discover-rules first to read the instruction files before rewriting.';
85
+ }
86
+ const validated = validateJson(args.rules, FormatResponseSchema);
87
+ if (validated.error !== null) {
88
+ return formatValidationError(validated);
89
+ }
90
+ const resolved = await resolveFiles(options.directory, args.files);
91
+ if (resolved.error !== null) {
92
+ return resolved.error;
93
+ }
94
+ const fileResults = [];
95
+ for (const file of resolved.data) {
96
+ if (context.abort.aborted) {
97
+ break;
98
+ }
99
+ fileResults.push(await processFile({
100
+ file,
101
+ rules: validated.data.rules,
102
+ }));
103
+ }
104
+ return buildTable(fileResults.map(toTableRow));
105
+ },
106
+ });
107
+ };
108
+ export const createAddTool = (options) => {
109
+ return tool({
110
+ description: options.description,
111
+ args: {
112
+ rules: tool.schema.string().describe(FORMAT_RULES_DESC),
113
+ file: tool.schema.string().optional()
114
+ .describe('File path to append to. If omitted, uses the first discovered instruction file.'),
115
+ mode: tool.schema.string().optional().describe(MODE_DESC),
116
+ },
117
+ async execute(args) {
118
+ if (options.discovered.size === 0) {
119
+ return 'Call discover-rules first to read the instruction files before adding.';
120
+ }
121
+ const validated = validateJson(args.rules, FormatResponseSchema);
122
+ if (validated.error !== null) {
123
+ return formatValidationError(validated);
124
+ }
125
+ let filePath = args.file;
126
+ if (!filePath) {
127
+ const resolved = await resolveFiles(options.directory);
128
+ if (resolved.error !== null) {
129
+ return resolved.error;
130
+ }
131
+ const first = resolved.data[0];
132
+ if (!first) {
133
+ return 'No instruction files found in opencode.json';
134
+ }
135
+ filePath = first.path;
136
+ }
137
+ const result = await appendRules({
138
+ filePath,
139
+ rules: validated.data.rules,
140
+ });
141
+ if (result.status !== 'success') {
142
+ return result.status + ': ' + result.error;
143
+ }
144
+ return 'Added ' + result.rulesCount + ' rule(s) to ' + result.path;
145
+ },
146
+ });
147
+ };
148
+ //# sourceMappingURL=rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../src/tools/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAmB,WAAW,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAUlF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAA4B,EAAE,EAAE;IACjE,OAAO,IAAI,CAAC;QACV,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,IAAI,EAAE;YACJ,KAAK,EAAE,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uBAAuB,CAAA;AAEtG,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM,MAAM,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAG,kBAAkB,CAAC,CAAC,CAsBxF,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,QAAQ,sBAAsB,GAAG,uBAAuB,KAAG,MAUhG,CAAA"}
@@ -24,7 +24,9 @@ export const formatValidationError = (result) => {
24
24
  if (result.error === 'parse') {
25
25
  return 'Invalid JSON. Return valid JSON.';
26
26
  }
27
- const issues = result.issues.map((i) => ' - ' + i.path.join('.') + ': ' + i.message).join('\n');
27
+ const issues = result.issues
28
+ .map((i) => ' - ' + i.path.join('.') + ': ' + i.message)
29
+ .join('\n');
28
30
  return 'Schema validation failed:\n' + issues + '\n\nFix the issues and try again.';
29
31
  };
30
32
  //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAoB7B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAI,IAAY,EAAE,MAAoB,EAAyB,EAAE;IAC3F,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAChD,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,OAAO;SACf,CAAA;IACH,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACjD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;SAC5B,CAAA;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI;KACZ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAwD,EAAU,EAAE;IACxG,IAAI,MAAM,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;QAC7B,OAAO,kCAAkC,CAAA;IAC3C,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;SACzB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC;SACxD,IAAI,CAAC,IAAI,CAAC,CAAA;IAEb,OAAO,6BAA6B,GAAG,MAAM,GAAG,mCAAmC,CAAA;AACrF,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sat",
3
- "version": "0.0.15",
3
+ "version": "0.0.16-next.1",
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",
@@ -39,9 +39,9 @@
39
39
  "scripts": {
40
40
  "build": "npm run clean && tsc",
41
41
  "clean": "rm -rf dist",
42
- "test": "bun test",
43
42
  "fmt": "bun run dprint fmt",
44
- "prepublishOnly": "npm run build"
43
+ "prepublishOnly": "npm run build",
44
+ "test": "bun test"
45
45
  },
46
46
  "dependencies": {
47
47
  "cli-table3": "^0.6.5",
@@ -1,10 +0,0 @@
1
- import type { PluginInput } from '@opencode-ai/plugin';
2
- type Client = PluginInput['client'];
3
- type SendResultOptions = {
4
- client: Client;
5
- sessionID: string;
6
- text: string;
7
- };
8
- export declare const sendResult: (options: SendResultOptions) => Promise<void>;
9
- export {};
10
- //# sourceMappingURL=notify.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../../src/opencode/notify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEtD,KAAK,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAA;AAEnC,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,eAAO,MAAM,UAAU,GAAU,SAAS,iBAAiB,KAAG,OAAO,CAAC,IAAI,CAYzE,CAAA"}
@@ -1,14 +0,0 @@
1
- export const sendResult = async (options) => {
2
- await options.client.session.prompt({
3
- path: { id: options.sessionID },
4
- body: {
5
- noReply: true,
6
- parts: [{
7
- type: 'text',
8
- text: options.text,
9
- ignored: true,
10
- }],
11
- },
12
- });
13
- };
14
- //# sourceMappingURL=notify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notify.js","sourceRoot":"","sources":["../../../src/opencode/notify.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,OAA0B,EAAiB,EAAE;IAC5E,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;QAClC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,SAAS,EAAE;QAC/B,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,CAAC;oBACN,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,OAAO,EAAE,IAAI;iBACd,CAAC;SACH;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -1,21 +0,0 @@
1
- import type { z } from 'zod';
2
- import type { Result } from './utils/safe';
3
- import type { ParsedPrompt } from './prompt-schema';
4
- type PromptFn = <T>(prompt: string, schema: z.ZodType<T>) => Promise<Result<T>>;
5
- type ProcessPromptOptions = {
6
- input: string;
7
- prompt: PromptFn;
8
- };
9
- type PromptSuccess = {
10
- status: 'success';
11
- formatted: string;
12
- parsed: ParsedPrompt;
13
- };
14
- type PromptParseError = {
15
- status: 'parseError';
16
- error: string;
17
- };
18
- type PromptResult = PromptSuccess | PromptParseError;
19
- export declare const processPrompt: (options: ProcessPromptOptions) => Promise<PromptResult>;
20
- export {};
21
- //# sourceMappingURL=process-prompt.d.ts.map