@gyomu/ai-compiler 0.2.4-beta.5

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 (67) hide show
  1. package/dist/pipelines/jsdoc-update/__sit__/documentable-child-members.d.ts +2 -0
  2. package/dist/pipelines/jsdoc-update/__sit__/documentable-child-members.d.ts.map +1 -0
  3. package/dist/pipelines/jsdoc-update/__sit__/documentable-child-members.js +67 -0
  4. package/dist/pipelines/jsdoc-update/__sit__/documentable-child-members.js.map +1 -0
  5. package/dist/pipelines/jsdoc-update/__sit__/documentable-child-members.test.d.ts +2 -0
  6. package/dist/pipelines/jsdoc-update/__sit__/documentable-child-members.test.d.ts.map +1 -0
  7. package/dist/pipelines/jsdoc-update/__sit__/documentable-child-members.test.js +60 -0
  8. package/dist/pipelines/jsdoc-update/__sit__/documentable-child-members.test.js.map +1 -0
  9. package/dist/pipelines/jsdoc-update/__sit__/existing-jsdoc.test.d.ts +2 -0
  10. package/dist/pipelines/jsdoc-update/__sit__/existing-jsdoc.test.d.ts.map +1 -0
  11. package/dist/pipelines/jsdoc-update/__sit__/existing-jsdoc.test.js +175 -0
  12. package/dist/pipelines/jsdoc-update/__sit__/existing-jsdoc.test.js.map +1 -0
  13. package/dist/pipelines/jsdoc-update/__sit__/simple-function.test.d.ts +2 -0
  14. package/dist/pipelines/jsdoc-update/__sit__/simple-function.test.d.ts.map +1 -0
  15. package/dist/pipelines/jsdoc-update/__sit__/simple-function.test.js +108 -0
  16. package/dist/pipelines/jsdoc-update/__sit__/simple-function.test.js.map +1 -0
  17. package/dist/pipelines/jsdoc-update/context/JsDocUpdateContext.d.ts +156 -0
  18. package/dist/pipelines/jsdoc-update/context/JsDocUpdateContext.d.ts.map +1 -0
  19. package/dist/pipelines/jsdoc-update/context/JsDocUpdateContext.js +2 -0
  20. package/dist/pipelines/jsdoc-update/context/JsDocUpdateContext.js.map +1 -0
  21. package/dist/pipelines/jsdoc-update/context/TsDocFileContext.d.ts +16 -0
  22. package/dist/pipelines/jsdoc-update/context/TsDocFileContext.d.ts.map +1 -0
  23. package/dist/pipelines/jsdoc-update/context/TsDocFileContext.js +2 -0
  24. package/dist/pipelines/jsdoc-update/context/TsDocFileContext.js.map +1 -0
  25. package/dist/pipelines/jsdoc-update/context/TsDocSymbolContext.d.ts +164 -0
  26. package/dist/pipelines/jsdoc-update/context/TsDocSymbolContext.d.ts.map +1 -0
  27. package/dist/pipelines/jsdoc-update/context/TsDocSymbolContext.js +2 -0
  28. package/dist/pipelines/jsdoc-update/context/TsDocSymbolContext.js.map +1 -0
  29. package/dist/pipelines/jsdoc-update/executor/__tests__/executeJsDocUpdatePlan.test.d.ts +2 -0
  30. package/dist/pipelines/jsdoc-update/executor/__tests__/executeJsDocUpdatePlan.test.d.ts.map +1 -0
  31. package/dist/pipelines/jsdoc-update/executor/__tests__/executeJsDocUpdatePlan.test.js +47 -0
  32. package/dist/pipelines/jsdoc-update/executor/__tests__/executeJsDocUpdatePlan.test.js.map +1 -0
  33. package/dist/pipelines/jsdoc-update/executor/executeJsDocUpdatePlan.d.ts +9 -0
  34. package/dist/pipelines/jsdoc-update/executor/executeJsDocUpdatePlan.d.ts.map +1 -0
  35. package/dist/pipelines/jsdoc-update/executor/executeJsDocUpdatePlan.js +30 -0
  36. package/dist/pipelines/jsdoc-update/executor/executeJsDocUpdatePlan.js.map +1 -0
  37. package/dist/pipelines/jsdoc-update/index.d.ts +6 -0
  38. package/dist/pipelines/jsdoc-update/index.d.ts.map +1 -0
  39. package/dist/pipelines/jsdoc-update/index.js +3 -0
  40. package/dist/pipelines/jsdoc-update/index.js.map +1 -0
  41. package/dist/pipelines/jsdoc-update/mode/ComplexityStrategy.d.ts +6 -0
  42. package/dist/pipelines/jsdoc-update/mode/ComplexityStrategy.d.ts.map +1 -0
  43. package/dist/pipelines/jsdoc-update/mode/ComplexityStrategy.js +4 -0
  44. package/dist/pipelines/jsdoc-update/mode/ComplexityStrategy.js.map +1 -0
  45. package/dist/pipelines/jsdoc-update/mode/ModeContext.d.ts +15 -0
  46. package/dist/pipelines/jsdoc-update/mode/ModeContext.d.ts.map +1 -0
  47. package/dist/pipelines/jsdoc-update/mode/ModeContext.js +2 -0
  48. package/dist/pipelines/jsdoc-update/mode/ModeContext.js.map +1 -0
  49. package/dist/pipelines/jsdoc-update/mode/index.d.ts +4 -0
  50. package/dist/pipelines/jsdoc-update/mode/index.d.ts.map +1 -0
  51. package/dist/pipelines/jsdoc-update/mode/index.js +4 -0
  52. package/dist/pipelines/jsdoc-update/mode/index.js.map +1 -0
  53. package/dist/pipelines/jsdoc-update/mode/modeResolver.d.ts +4 -0
  54. package/dist/pipelines/jsdoc-update/mode/modeResolver.d.ts.map +1 -0
  55. package/dist/pipelines/jsdoc-update/mode/modeResolver.js +12 -0
  56. package/dist/pipelines/jsdoc-update/mode/modeResolver.js.map +1 -0
  57. package/dist/pipelines/jsdoc-update/prompt/loadPrompt.d.ts +4 -0
  58. package/dist/pipelines/jsdoc-update/prompt/loadPrompt.d.ts.map +1 -0
  59. package/dist/pipelines/jsdoc-update/prompt/loadPrompt.js +7 -0
  60. package/dist/pipelines/jsdoc-update/prompt/loadPrompt.js.map +1 -0
  61. package/dist/pipelines/jsdoc-update/prompt/tsdoc-update-base.md +174 -0
  62. package/dist/pipelines/jsdoc-update/prompt/tsdoc-update-deep.md +13 -0
  63. package/dist/pipelines/jsdoc-update/schema/JsDocUpdatePlan.d.ts +254 -0
  64. package/dist/pipelines/jsdoc-update/schema/JsDocUpdatePlan.d.ts.map +1 -0
  65. package/dist/pipelines/jsdoc-update/schema/JsDocUpdatePlan.js +151 -0
  66. package/dist/pipelines/jsdoc-update/schema/JsDocUpdatePlan.js.map +1 -0
  67. package/package.json +42 -0
@@ -0,0 +1,13 @@
1
+ # Additional Deep Analysis
2
+
3
+ - consider design intent
4
+ - consider protected sections
5
+ - consider generatedBy
6
+ - higher quality explanations
7
+
8
+ # Before generating JSDoc:
9
+
10
+ 1. Determine the symbol's purpose.
11
+ 2. Determine the role of each parameter.
12
+ 3. Determine the meaning of the return value.
13
+ 4. Generate documentation.
@@ -0,0 +1,254 @@
1
+ import { Schema } from 'effect';
2
+ export declare const MergeActionSchema: Schema.Union<readonly [Schema.Struct<{
3
+ readonly type: Schema.Literal<"replace">;
4
+ readonly value: Schema.String;
5
+ }>, Schema.Struct<{
6
+ readonly type: Schema.Literal<"preserve">;
7
+ }>, Schema.Struct<{
8
+ readonly type: Schema.Literal<"delete">;
9
+ }>]>;
10
+ export declare const SummaryPlan: Schema.Struct<{
11
+ readonly action: Schema.Union<readonly [Schema.Struct<{
12
+ readonly type: Schema.Literal<"replace">;
13
+ readonly value: Schema.String;
14
+ }>, Schema.Struct<{
15
+ readonly type: Schema.Literal<"preserve">;
16
+ }>, Schema.Struct<{
17
+ readonly type: Schema.Literal<"delete">;
18
+ }>]>;
19
+ readonly confidence: Schema.Number;
20
+ }>;
21
+ export declare const JsDocTargetSchema: Schema.Struct<{
22
+ readonly kind: Schema.Literals<readonly ["summary", "param", "return", "template", "throws"]>;
23
+ readonly key: Schema.NullOr<Schema.String>;
24
+ }>;
25
+ declare const ParamActionValueSchema: Schema.Struct<{
26
+ readonly type: Schema.NullOr<Schema.String>;
27
+ readonly description: Schema.NullOr<Schema.String>;
28
+ }>;
29
+ export declare const ParamMergeActionSchema: Schema.Union<readonly [Schema.Struct<{
30
+ readonly type: Schema.Literal<"replace">;
31
+ readonly value: Schema.Struct<{
32
+ readonly type: Schema.NullOr<Schema.String>;
33
+ readonly description: Schema.NullOr<Schema.String>;
34
+ }>;
35
+ }>, Schema.Struct<{
36
+ readonly type: Schema.Literal<"preserve">;
37
+ }>, Schema.Struct<{
38
+ readonly type: Schema.Literal<"delete">;
39
+ }>]>;
40
+ export declare const ParamPlan: Schema.Struct<{
41
+ readonly target: Schema.Struct<{
42
+ readonly kind: Schema.Literals<readonly ["summary", "param", "return", "template", "throws"]>;
43
+ readonly key: Schema.NullOr<Schema.String>;
44
+ }>;
45
+ readonly name: Schema.String;
46
+ readonly sortOrder: Schema.Number;
47
+ readonly action: Schema.Union<readonly [Schema.Struct<{
48
+ readonly type: Schema.Literal<"replace">;
49
+ readonly value: Schema.Struct<{
50
+ readonly type: Schema.NullOr<Schema.String>;
51
+ readonly description: Schema.NullOr<Schema.String>;
52
+ }>;
53
+ }>, Schema.Struct<{
54
+ readonly type: Schema.Literal<"preserve">;
55
+ }>, Schema.Struct<{
56
+ readonly type: Schema.Literal<"delete">;
57
+ }>]>;
58
+ readonly confidence: Schema.Number;
59
+ }>;
60
+ export declare const ReturnPlan: Schema.Struct<{
61
+ readonly action: Schema.Union<readonly [Schema.Struct<{
62
+ readonly type: Schema.Literal<"replace">;
63
+ readonly value: Schema.String;
64
+ }>, Schema.Struct<{
65
+ readonly type: Schema.Literal<"preserve">;
66
+ }>, Schema.Struct<{
67
+ readonly type: Schema.Literal<"delete">;
68
+ }>]>;
69
+ readonly confidence: Schema.Number;
70
+ }>;
71
+ export declare const TagPlan: Schema.Struct<{
72
+ readonly target: Schema.Struct<{
73
+ readonly kind: Schema.Literals<readonly ["summary", "param", "return", "template", "throws"]>;
74
+ readonly key: Schema.NullOr<Schema.String>;
75
+ }>;
76
+ readonly tag: Schema.String;
77
+ readonly sortOrder: Schema.Number;
78
+ readonly action: Schema.Union<readonly [Schema.Struct<{
79
+ readonly type: Schema.Literal<"replace">;
80
+ readonly value: Schema.String;
81
+ }>, Schema.Struct<{
82
+ readonly type: Schema.Literal<"preserve">;
83
+ }>, Schema.Struct<{
84
+ readonly type: Schema.Literal<"delete">;
85
+ }>]>;
86
+ readonly confidence: Schema.Number;
87
+ }>;
88
+ export declare const Reasoning: Schema.Struct<{
89
+ readonly summary: Schema.String;
90
+ readonly paramMapping: Schema.String;
91
+ readonly returnMapping: Schema.String;
92
+ }>;
93
+ export declare const Risk: Schema.Struct<{
94
+ readonly hasHumanConflict: Schema.Boolean;
95
+ readonly riskLevel: Schema.Literals<readonly ["low", "medium", "high"]>;
96
+ }>;
97
+ export declare const JsDocUpdateEntrySchema: Schema.Struct<{
98
+ readonly identity: Schema.Struct<{
99
+ readonly symbolId: Schema.String;
100
+ readonly signatureId: Schema.String;
101
+ }>;
102
+ readonly summary: Schema.Struct<{
103
+ readonly action: Schema.Union<readonly [Schema.Struct<{
104
+ readonly type: Schema.Literal<"replace">;
105
+ readonly value: Schema.String;
106
+ }>, Schema.Struct<{
107
+ readonly type: Schema.Literal<"preserve">;
108
+ }>, Schema.Struct<{
109
+ readonly type: Schema.Literal<"delete">;
110
+ }>]>;
111
+ readonly confidence: Schema.Number;
112
+ }>;
113
+ readonly params: Schema.$Array<Schema.Struct<{
114
+ readonly target: Schema.Struct<{
115
+ readonly kind: Schema.Literals<readonly ["summary", "param", "return", "template", "throws"]>;
116
+ readonly key: Schema.NullOr<Schema.String>;
117
+ }>;
118
+ readonly name: Schema.String;
119
+ readonly sortOrder: Schema.Number;
120
+ readonly action: Schema.Union<readonly [Schema.Struct<{
121
+ readonly type: Schema.Literal<"replace">;
122
+ readonly value: Schema.Struct<{
123
+ readonly type: Schema.NullOr<Schema.String>;
124
+ readonly description: Schema.NullOr<Schema.String>;
125
+ }>;
126
+ }>, Schema.Struct<{
127
+ readonly type: Schema.Literal<"preserve">;
128
+ }>, Schema.Struct<{
129
+ readonly type: Schema.Literal<"delete">;
130
+ }>]>;
131
+ readonly confidence: Schema.Number;
132
+ }>>;
133
+ readonly returns: Schema.Struct<{
134
+ readonly action: Schema.Union<readonly [Schema.Struct<{
135
+ readonly type: Schema.Literal<"replace">;
136
+ readonly value: Schema.String;
137
+ }>, Schema.Struct<{
138
+ readonly type: Schema.Literal<"preserve">;
139
+ }>, Schema.Struct<{
140
+ readonly type: Schema.Literal<"delete">;
141
+ }>]>;
142
+ readonly confidence: Schema.Number;
143
+ }>;
144
+ readonly tags: Schema.$Array<Schema.Struct<{
145
+ readonly target: Schema.Struct<{
146
+ readonly kind: Schema.Literals<readonly ["summary", "param", "return", "template", "throws"]>;
147
+ readonly key: Schema.NullOr<Schema.String>;
148
+ }>;
149
+ readonly tag: Schema.String;
150
+ readonly sortOrder: Schema.Number;
151
+ readonly action: Schema.Union<readonly [Schema.Struct<{
152
+ readonly type: Schema.Literal<"replace">;
153
+ readonly value: Schema.String;
154
+ }>, Schema.Struct<{
155
+ readonly type: Schema.Literal<"preserve">;
156
+ }>, Schema.Struct<{
157
+ readonly type: Schema.Literal<"delete">;
158
+ }>]>;
159
+ readonly confidence: Schema.Number;
160
+ }>>;
161
+ readonly order: Schema.optional<Schema.$Array<Schema.Literals<readonly ["summary", "params", "returns", "tags"]>>>;
162
+ readonly reasoning: Schema.Struct<{
163
+ readonly summary: Schema.String;
164
+ readonly paramMapping: Schema.String;
165
+ readonly returnMapping: Schema.String;
166
+ }>;
167
+ readonly risk: Schema.Struct<{
168
+ readonly hasHumanConflict: Schema.Boolean;
169
+ readonly riskLevel: Schema.Literals<readonly ["low", "medium", "high"]>;
170
+ }>;
171
+ }>;
172
+ export declare const JsDocUpdatePlanSchema: Schema.$Array<Schema.Struct<{
173
+ readonly identity: Schema.Struct<{
174
+ readonly symbolId: Schema.String;
175
+ readonly signatureId: Schema.String;
176
+ }>;
177
+ readonly summary: Schema.Struct<{
178
+ readonly action: Schema.Union<readonly [Schema.Struct<{
179
+ readonly type: Schema.Literal<"replace">;
180
+ readonly value: Schema.String;
181
+ }>, Schema.Struct<{
182
+ readonly type: Schema.Literal<"preserve">;
183
+ }>, Schema.Struct<{
184
+ readonly type: Schema.Literal<"delete">;
185
+ }>]>;
186
+ readonly confidence: Schema.Number;
187
+ }>;
188
+ readonly params: Schema.$Array<Schema.Struct<{
189
+ readonly target: Schema.Struct<{
190
+ readonly kind: Schema.Literals<readonly ["summary", "param", "return", "template", "throws"]>;
191
+ readonly key: Schema.NullOr<Schema.String>;
192
+ }>;
193
+ readonly name: Schema.String;
194
+ readonly sortOrder: Schema.Number;
195
+ readonly action: Schema.Union<readonly [Schema.Struct<{
196
+ readonly type: Schema.Literal<"replace">;
197
+ readonly value: Schema.Struct<{
198
+ readonly type: Schema.NullOr<Schema.String>;
199
+ readonly description: Schema.NullOr<Schema.String>;
200
+ }>;
201
+ }>, Schema.Struct<{
202
+ readonly type: Schema.Literal<"preserve">;
203
+ }>, Schema.Struct<{
204
+ readonly type: Schema.Literal<"delete">;
205
+ }>]>;
206
+ readonly confidence: Schema.Number;
207
+ }>>;
208
+ readonly returns: Schema.Struct<{
209
+ readonly action: Schema.Union<readonly [Schema.Struct<{
210
+ readonly type: Schema.Literal<"replace">;
211
+ readonly value: Schema.String;
212
+ }>, Schema.Struct<{
213
+ readonly type: Schema.Literal<"preserve">;
214
+ }>, Schema.Struct<{
215
+ readonly type: Schema.Literal<"delete">;
216
+ }>]>;
217
+ readonly confidence: Schema.Number;
218
+ }>;
219
+ readonly tags: Schema.$Array<Schema.Struct<{
220
+ readonly target: Schema.Struct<{
221
+ readonly kind: Schema.Literals<readonly ["summary", "param", "return", "template", "throws"]>;
222
+ readonly key: Schema.NullOr<Schema.String>;
223
+ }>;
224
+ readonly tag: Schema.String;
225
+ readonly sortOrder: Schema.Number;
226
+ readonly action: Schema.Union<readonly [Schema.Struct<{
227
+ readonly type: Schema.Literal<"replace">;
228
+ readonly value: Schema.String;
229
+ }>, Schema.Struct<{
230
+ readonly type: Schema.Literal<"preserve">;
231
+ }>, Schema.Struct<{
232
+ readonly type: Schema.Literal<"delete">;
233
+ }>]>;
234
+ readonly confidence: Schema.Number;
235
+ }>>;
236
+ readonly order: Schema.optional<Schema.$Array<Schema.Literals<readonly ["summary", "params", "returns", "tags"]>>>;
237
+ readonly reasoning: Schema.Struct<{
238
+ readonly summary: Schema.String;
239
+ readonly paramMapping: Schema.String;
240
+ readonly returnMapping: Schema.String;
241
+ }>;
242
+ readonly risk: Schema.Struct<{
243
+ readonly hasHumanConflict: Schema.Boolean;
244
+ readonly riskLevel: Schema.Literals<readonly ["low", "medium", "high"]>;
245
+ }>;
246
+ }>>;
247
+ export type ParamMergeAction = Schema.Schema.Type<typeof ParamMergeActionSchema>;
248
+ export type MergeAction = Schema.Schema.Type<typeof MergeActionSchema>;
249
+ export type JsDocUpdatePlan = Schema.Schema.Type<typeof JsDocUpdatePlanSchema>;
250
+ export type JsDocUpdateEntryPlan = Schema.Schema.Type<typeof JsDocUpdateEntrySchema>;
251
+ export type JsDocTarget = Schema.Schema.Type<typeof JsDocTargetSchema>;
252
+ export type ParamActionValue = Schema.Schema.Type<typeof ParamActionValueSchema>;
253
+ export {};
254
+ //# sourceMappingURL=JsDocUpdatePlan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsDocUpdatePlan.d.ts","sourceRoot":"","sources":["../../../../src/pipelines/jsdoc-update/schema/JsDocUpdatePlan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,eAAO,MAAM,iBAAiB;;;;;;;IAyB5B,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;EAMtB,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;EAO5B,CAAA;AAEF,QAAA,MAAM,sBAAsB;;;EAS1B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;IAyBjC,CAAA;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;EAkBpB,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;EAOrB,CAAA;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;EAkBlB,CAAA;AAEF,eAAO,MAAM,SAAS;;;;EAcpB,CAAA;AAEF,eAAO,MAAM,IAAI;;;EAUf,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBjC,CAAA;AACF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAShC,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAChF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAA;AACtE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAC9E,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAA;AACpF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAA;AACtE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -0,0 +1,151 @@
1
+ import { Confidence } from '@gyomu/schema/schemas/Confidence';
2
+ import { SymbolIdentity } from '@gyomu/schema/schemas/typescript/SymbolIdentity';
3
+ import { Schema } from 'effect';
4
+ export const MergeActionSchema = Schema.Union([
5
+ Schema.Struct({
6
+ type: Schema.Literal('replace'),
7
+ value: Schema.String,
8
+ }).annotate({
9
+ description: 'Replace the existing content with the provided value. The value must contain the final content to apply.',
10
+ }),
11
+ Schema.Struct({
12
+ type: Schema.Literal('preserve'),
13
+ }).annotate({
14
+ description: 'Keep the existing content unchanged. Use when the current documentation is already adequate or uncertainty is high.',
15
+ }),
16
+ Schema.Struct({
17
+ type: Schema.Literal('delete'),
18
+ }).annotate({
19
+ description: 'Delete the existing content. Use only when the documented element no longer exists or the documentation is clearly invalid.',
20
+ }),
21
+ ]).annotate({
22
+ description: 'Deterministic JSDoc update action. All replacement content must be embedded directly in the action so that application does not require additional context.',
23
+ });
24
+ export const SummaryPlan = Schema.Struct({
25
+ action: MergeActionSchema,
26
+ confidence: Confidence,
27
+ }).annotate({
28
+ description: 'Update plan for the summary section. Prefer preserve. Use replace only when the summary is missing or clearly incorrect.',
29
+ });
30
+ export const JsDocTargetSchema = Schema.Struct({
31
+ kind: Schema.Literals(['summary', 'param', 'return', 'template', 'throws']),
32
+ // param/tagの追加識別子
33
+ key: Schema.NullOr(Schema.String),
34
+ }).annotate({
35
+ description: 'Stable target reference for deterministic JsDoc application',
36
+ });
37
+ const ParamActionValueSchema = Schema.Struct({
38
+ type: Schema.NullOr(Schema.String).annotate({
39
+ description: 'Type hint of parameter',
40
+ }),
41
+ description: Schema.NullOr(Schema.String).annotate({
42
+ description: 'Complete replacement parameter metadata. When using replace, provide the final parameter documentation to be written.',
43
+ }),
44
+ });
45
+ export const ParamMergeActionSchema = Schema.Union([
46
+ Schema.Struct({
47
+ type: Schema.Literal('replace'),
48
+ value: ParamActionValueSchema,
49
+ }).annotate({
50
+ description: 'Replace the existing content with the provided value. The value must contain the final content to apply.',
51
+ }),
52
+ Schema.Struct({
53
+ type: Schema.Literal('preserve'),
54
+ }).annotate({
55
+ description: 'Keep the existing content unchanged. Use when the current documentation is already adequate or uncertainty is high.',
56
+ }),
57
+ Schema.Struct({
58
+ type: Schema.Literal('delete'),
59
+ }).annotate({
60
+ description: 'Delete the existing content. Use only when the documented element no longer exists or the documentation is clearly invalid.',
61
+ }),
62
+ ]).annotate({
63
+ description: 'Deterministic JSDoc update action. All replacement content must be embedded directly in the action so that application does not require additional context.',
64
+ });
65
+ export const ParamPlan = Schema.Struct({
66
+ target: JsDocTargetSchema,
67
+ name: Schema.String.annotate({
68
+ description: 'Parameter name from function signature',
69
+ }),
70
+ sortOrder: Schema.Number.annotate({
71
+ description: 'Parameter position in the function signature. The first parameter should have the lowest sortOrder. Preserve signature order when generating update plans.',
72
+ }),
73
+ action: ParamMergeActionSchema,
74
+ confidence: Confidence,
75
+ }).annotate({
76
+ description: 'Parameter update plan. Delete only when the parameter no longer exists in the function signature. Preserve when unsure.',
77
+ });
78
+ export const ReturnPlan = Schema.Struct({
79
+ action: MergeActionSchema,
80
+ confidence: Confidence,
81
+ }).annotate({
82
+ description: 'Return documentation update plan. Delete only when the function no longer returns a meaningful value.',
83
+ });
84
+ export const TagPlan = Schema.Struct({
85
+ target: JsDocTargetSchema,
86
+ tag: Schema.String.annotate({
87
+ description: 'JSDoc tag name (e.g. @throws, @template)',
88
+ }),
89
+ sortOrder: Schema.Number.annotate({
90
+ description: 'Stable ordering index for JSDoc tags. Preserve existing tag order whenever possible. New tags should be assigned a deterministic position relative to existing tags.',
91
+ }),
92
+ action: MergeActionSchema,
93
+ confidence: Confidence,
94
+ }).annotate({
95
+ description: 'Generic JSDoc tag update plan. Existing tags should normally be preserved. Delete only when the tag is clearly obsolete or invalid.',
96
+ });
97
+ export const Reasoning = Schema.Struct({
98
+ summary: Schema.String.annotate({
99
+ description: 'Why this update strategy was chosen',
100
+ }),
101
+ paramMapping: Schema.String.annotate({
102
+ description: 'How parameters were interpreted and mapped',
103
+ }),
104
+ returnMapping: Schema.String.annotate({
105
+ description: 'How return type was interpreted',
106
+ }),
107
+ }).annotate({
108
+ description: 'AI reasoning trace for debugging and validation',
109
+ });
110
+ export const Risk = Schema.Struct({
111
+ hasHumanConflict: Schema.Boolean.annotate({
112
+ description: 'Whether AI detected conflict with human-edited content',
113
+ }),
114
+ riskLevel: Schema.Literals(['low', 'medium', 'high']).annotate({
115
+ description: 'Risk level of applying this update plan',
116
+ }),
117
+ }).annotate({
118
+ description: 'Safety risk assessment for merge operation',
119
+ });
120
+ export const JsDocUpdateEntrySchema = Schema.Struct({
121
+ identity: SymbolIdentity,
122
+ summary: SummaryPlan,
123
+ params: Schema.Array(ParamPlan),
124
+ returns: ReturnPlan,
125
+ tags: Schema.Array(TagPlan),
126
+ order: Schema.optional(Schema.Array(Schema.Literals(['summary', 'params', 'returns', 'tags']))),
127
+ reasoning: Reasoning,
128
+ risk: Risk,
129
+ }).annotate({
130
+ description: `
131
+ AI-generated structured plan for safely updating JSDoc.
132
+
133
+ Prefer preserve over replace.
134
+ Prefer replace over delete.
135
+
136
+ Delete actions should be rare and only used when the documented target no longer exists or the documentation is clearly invalid.
137
+
138
+ All replacement content must be included directly in the plan so that application can be performed without access to the original update context.
139
+ `,
140
+ });
141
+ export const JsDocUpdatePlanSchema = Schema.Array(JsDocUpdateEntrySchema).annotate({
142
+ description: `
143
+ Collection of JSDoc update plans.
144
+
145
+ The first entry typically represents the requested target symbol.
146
+ Additional entries may represent documentable child members or nested symbols.
147
+
148
+ Each entry is applied independently using its identity.
149
+ `,
150
+ });
151
+ //# sourceMappingURL=JsDocUpdatePlan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsDocUpdatePlan.js","sourceRoot":"","sources":["../../../../src/pipelines/jsdoc-update/schema/JsDocUpdatePlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,KAAK,CAAC;IAC5C,MAAM,CAAC,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;QAC/B,KAAK,EAAE,MAAM,CAAC,MAAM;KACrB,CAAC,CAAC,QAAQ,CAAC;QACV,WAAW,EACT,0GAA0G;KAC7G,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;KACjC,CAAC,CAAC,QAAQ,CAAC;QACV,WAAW,EACT,qHAAqH;KACxH,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;KAC/B,CAAC,CAAC,QAAQ,CAAC;QACV,WAAW,EACT,6HAA6H;KAChI,CAAC;CACH,CAAC,CAAC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MAAM,CAAC,CAAC,CAAC,CAAC;IAC/F,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,IAAI;CACX,CAAC,CAAC,QAAQ,CAAC;IACV,WAAW,EAAE;;;;;;;;;CASd;CACA,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,QAAQ,CAAC;IACjF,WAAW,EAAE;;;;;;;CAOd;CACA,CAAC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@gyomu/ai-compiler",
3
+ "version": "0.2.4-beta.5",
4
+ "description": "",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "exports": {
10
+ "./jsdoc-update": {
11
+ "import": "./dist/pipelines/jsdoc-update/index.js",
12
+ "types": "./dist/pipelines/jsdoc-update/index.d.ts"
13
+ }
14
+ },
15
+ "keywords": [],
16
+ "author": "",
17
+ "license": "ISC",
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "dependencies": {
22
+ "effect": "4.0.0-beta.57",
23
+ "@gyomu/ai": "^0.2.4-beta.6",
24
+ "@gyomu/schema": "^0.2.4-beta.6",
25
+ "@gyomu/infra": "^0.2.4-beta.6"
26
+ },
27
+ "devDependencies": {
28
+ "dotenv": "^17.4.2"
29
+ },
30
+ "scripts": {
31
+ "preinstall": "npx only-allow pnpm",
32
+ "clean": "rimraf ./dist ./coverage ./.turbo ./.tsbuildinfo",
33
+ "test": "bunx vitest --config vitest.config.ts --typecheck.tsconfig ./tsconfig.vitest.json ",
34
+ "@test:coverage": "vitest --config vitest.coverage.config.ts --typecheck.tsconfig ./tsconfig.vitest.json --coverage",
35
+ "@test:ci:coverage": "vitest --config vitest.config.ts --typecheck.tsconfig ./tsconfig.vitest.json --coverage",
36
+ "start": "pnpm run build:live",
37
+ "watch": "tsc -w",
38
+ "build": "tsc && tsx scripts/copy-prompts.ts",
39
+ "build:ci": "pnpm run clean && pnpm run build",
40
+ "sit": "dotenv -e .env -- vitest --config=./vitest.sit.config.ts --typecheck.tsconfig=./tsconfig.vitest.json"
41
+ }
42
+ }