@codeyam/codeyam-cli 0.1.0-staging.1 → 0.1.0-staging.8aea589
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/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +51 -107
- package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +36 -183
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +34 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +238 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.ts +25 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/index.ts +2 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js +3 -2
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js +3 -2
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/frameworks/getNextRoutePath.ts +6 -2
- package/analyzer-template/project/writeUniversalMocks.ts +6 -2
- package/background/src/lib/virtualized/project/writeUniversalMocks.js +3 -2
- package/background/src/lib/virtualized/project/writeUniversalMocks.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +288 -0
- package/codeyam-cli/scripts/apply-setup.js.map +1 -0
- package/codeyam-cli/scripts/extract-setup.js +130 -0
- package/codeyam-cli/scripts/extract-setup.js.map +1 -0
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +238 -0
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +1 -0
- package/codeyam-cli/src/utils/analysisRunner.js +4 -3
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +25 -5
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/fileWatcher.js +75 -5
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +3 -2
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +13 -0
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +15 -35
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-rqv54FUY.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-Dh-FldQK.js → InteractivePreview-B0oiPem-.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DqXXjAJ7.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-Dp6DC845.js → LogViewer-BKKG1s2B.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-xwuhwsZH.js → SafeScreenshot-DU_jxCPD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-5DY-YIxu.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-M2QuSHKC.js → ScenarioViewer-DmjXUj6m.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/_index-DvSrcxsk.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CsaMd9mb.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/chart-column-VXBS6qOn.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/circle-alert-n5GUC2AS.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/clock-DKqtX8js.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{components-CAx5ONX_.js → components-Dj-Ggnl2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-DGy3zrli.js → dev.empty-BbR3FwNc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-1Z6D0fLM.js → entity._sha._-BHiWkb_W.js} +7 -7
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-ChAdTrrU.js → entity._sha_.create-scenario-L7M9Vr5z.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-D9L7267w.js → entity._sha_.edit._scenarioId-C9w-q7P3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entityVersioning-DO2gCvXv.js → entityVersioning-Bk_YB1jM.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-C6FRgjPr.js → entry.client-CdGoUs8A.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/file-text-B6Er7j5k.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-KcDVw1FY.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-B9uZ8eSJ.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-B0f88RTV.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-v3c6DFp4.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/manifest-fca08d7e.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-Cf8VBqIb.js +16 -0
- package/codeyam-cli/src/webserver/build/client/assets/search-DA14wXpu.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/settings-COJUrwGu.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{settings-Hbf8b7J_.js → settings-NU_ZquhK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CNaMJ-nR.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BBlyqxij.js → useLastLogLine-Lumm1t01.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-BRShB17p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/zap-BvukH0eN.js +1 -0
- package/codeyam-cli/src/webserver/build/client/favicon.svg +13 -0
- package/codeyam-cli/src/webserver/build/server/assets/{index-eAULANMV.js → index-DHr4rT4u.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-Bi1mj14J.js +166 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/public/favicon.svg +13 -0
- package/codeyam-cli/templates/codeyam-setup-skill.md +24 -18
- package/package.json +1 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +51 -107
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateEntityKeyAttributes.js +36 -183
- package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +28 -0
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +191 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js +16 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js.map +1 -0
- package/packages/analyze/src/lib/asts/sourceFiles/index.js +2 -0
- package/packages/analyze/src/lib/asts/sourceFiles/index.js.map +1 -1
- package/packages/utils/src/lib/frameworks/getNextRoutePath.js +3 -2
- package/packages/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-GqWwt5wG.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-p0fuyqGQ.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bl2IRh55.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-CAVtep9Q.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CLmzsLsT.js +0 -10
- package/codeyam-cli/src/webserver/build/client/assets/chart-column-B2I7jQx2.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/circle-alert-GwwOAbhw.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CgyOwWip.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-C3-cQjgv.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-Dp4EB9nv.js +0 -12
- package/codeyam-cli/src/webserver/build/client/assets/globals-Da3jt49-.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-DN7Vr40D.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-172a4629.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-COyVTsPq.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/search-CvyP_1Lo.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-MZc4XdmE.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-BMBi0VzO.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-C_VxoXTh.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/zap-B4gsLUZQ.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-lutv16q5.js +0 -161
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"buildTimestamp": "2025-12-
|
|
3
|
-
"buildTime":
|
|
4
|
-
"gitCommit": "
|
|
2
|
+
"buildTimestamp": "2025-12-09T21:27:34.619Z",
|
|
3
|
+
"buildTime": 1765315654619,
|
|
4
|
+
"gitCommit": "8aea589922b9c184fd5458f522d785af2e348e72",
|
|
5
5
|
"nodeVersion": "v20.19.6",
|
|
6
|
-
"contentHash": "
|
|
7
|
-
"buildNumber":
|
|
8
|
-
"semanticVersion": "0.1.
|
|
9
|
-
"version": "0.1.
|
|
6
|
+
"contentHash": "131ce1b86de761d815eb9d47d321d6959a13627b88b736f0e01a873d6f68e719",
|
|
7
|
+
"buildNumber": 47,
|
|
8
|
+
"semanticVersion": "0.1.47",
|
|
9
|
+
"version": "0.1.47 (2025-12-09T21:27+131ce1b)"
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
[12/
|
|
3
|
-
[12/
|
|
2
|
+
[12/9/2025, 9:27:34 PM] > codeyam-combo@1.0.0 mergeDependencies
|
|
3
|
+
[12/9/2025, 9:27:34 PM] > node ./scripts/mergePackageJsonFiles.cjs
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
[12/
|
|
6
|
+
[12/9/2025, 9:27:34 PM] Merged dependencies into root package.json
|
|
7
7
|
|
|
@@ -138,154 +138,98 @@ export default async function generateChangesEntityKeyAttributes({
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
const FRONTEND_SYSTEM_MESSAGE = `
|
|
141
|
+
const FRONTEND_SYSTEM_MESSAGE = `You are updating the key attributes for a frontend component that was recently changed.
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
This is an INCREMENTAL update. Existing key attributes should be preserved unless the code change clearly invalidates them. Removing and re-adding attributes across changes causes unnecessary churn.
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
## Stability Rules
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
- REMOVE only if the attribute is clearly no longer used (variable deleted, conditional removed, no longer referenced)
|
|
148
|
+
- KEEP marginal attributes—if unsure, preserve rather than remove
|
|
149
|
+
- ADD new attributes freely when warranted
|
|
148
150
|
|
|
149
|
-
|
|
151
|
+
## What Makes a Key Attribute
|
|
150
152
|
|
|
151
|
-
|
|
153
|
+
A key attribute is a data path from "Attributes and Value Types" that dramatically changes how the component renders:
|
|
152
154
|
|
|
153
|
-
|
|
155
|
+
- Controls a conditional that shows/hides significant UI sections
|
|
156
|
+
- Changes the component's primary visual state (not just minor text differences)
|
|
157
|
+
- Determines which branch of rendering logic executes
|
|
154
158
|
|
|
155
|
-
|
|
159
|
+
NOT key attributes:
|
|
160
|
+
- Values that only affect non-visible behavior (hrefs, image srcs)
|
|
161
|
+
- Fallback values that won't be used if primary values exist
|
|
162
|
+
- Values that would cause errors if changed
|
|
156
163
|
|
|
157
|
-
|
|
164
|
+
Note: A conditional that shows a different UI state (e.g., loading screen, redirect message) IS significant—include it. Only exclude guard clauses that render literally nothing.
|
|
158
165
|
|
|
159
|
-
|
|
166
|
+
## Path Format
|
|
160
167
|
|
|
161
|
-
|
|
168
|
+
Only return attributes from the "Attributes and Value Types" list—these are the only values we can control. Use the exact path provided. Use \`functionCallReturnValue\` for function return values. Use \`[]\` for array items (e.g., \`items[]\`).
|
|
162
169
|
|
|
163
|
-
|
|
170
|
+
## Response Format
|
|
164
171
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
- Changing the value of this variable will cause a guard clause to be triggered that results in nothing being displayed.
|
|
168
|
-
|
|
169
|
-
- Changing the value of this variable will cause a minor change in display that is not significant (e.g. slightly different text).
|
|
170
|
-
|
|
171
|
-
- The value is used as a fallback or alternative for another value and won't even be used if the other value is present.
|
|
172
|
-
|
|
173
|
-
- The value changes non-visible behavior (e.g. the href in a link or src in an image - all images sources are mocked out).
|
|
174
|
-
|
|
175
|
-
## Instructions
|
|
176
|
-
|
|
177
|
-
- Read each line of code. Pay particular attention to the return value of the function and how this frontend component will be displayed. What will cause it display distinctly different but functional and robust results to the user?
|
|
178
|
-
- Find the most impactful key attributes that will change how the frontend component is displayed. This should be a limited subset of the "Attributes and Value Types" provided.
|
|
179
|
-
- Reference the list of existing key attributes to determine if any of them are no longer valid or if any new key attributes should be added.
|
|
180
|
-
- Return each key attribute with the following information:
|
|
181
|
-
- \`path\`: The path to the data attribute in the code
|
|
182
|
-
- \`description\`: A short description of the data attribute and how it is used in the code.
|
|
183
|
-
- \`validValueOptions\`: A list of possible values for the data attribute that should be tested. This should include extreme values that could cause different behavior in the code but these values should not cause an error.
|
|
184
|
-
- Each attribute should reference exactly the path of a data attribute provided in the "Attributes and Value Types" section.
|
|
185
|
-
|
|
186
|
-
## Response
|
|
187
|
-
|
|
188
|
-
Please respond by specifying which attributes need to be added or removed. For removed attributes just specify the path that is no longer valid.
|
|
172
|
+
For \`validValueOptions\`, include boundary/extreme values that trigger different behavior—but NOT values that would cause errors.
|
|
189
173
|
|
|
190
174
|
\`\`\`json
|
|
191
175
|
{
|
|
192
176
|
"addedKeyAttributes": [
|
|
193
177
|
{
|
|
194
|
-
"path": "
|
|
195
|
-
|
|
196
|
-
"
|
|
197
|
-
|
|
198
|
-
"true",
|
|
199
|
-
"false"
|
|
200
|
-
],
|
|
201
|
-
"errorValueOptions": []
|
|
202
|
-
},
|
|
178
|
+
"path": "user",
|
|
179
|
+
"description": "Controls whether the main form or redirect screen displays",
|
|
180
|
+
"validValueOptions": ["truthy user object", "null/undefined"]
|
|
181
|
+
}
|
|
203
182
|
],
|
|
204
|
-
"removedKeyAttributes": [
|
|
205
|
-
"notification.message"
|
|
206
|
-
]
|
|
183
|
+
"removedKeyAttributes": ["oldAttribute.path"]
|
|
207
184
|
}
|
|
208
185
|
\`\`\`
|
|
209
186
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
- A key attribute must be an exact attribute path from the "Attributes and Value Types" provided. Do not return any other attribute paths. The only data we can provide to the function comes from these attributes so any other attribute is useless. For internally computed variables trace them back to one of the higher level variables that we can actually impact. Be sure to match the text from the attribute list exactly including spaces, commas, etc.
|
|
187
|
+
Return empty arrays if no changes needed.
|
|
213
188
|
`;
|
|
214
189
|
|
|
215
|
-
const BACKEND_SYSTEM_MESSAGE = `
|
|
216
|
-
|
|
217
|
-
Can you help us identify if any of the key data attributes in the function are no longer valid or if any new key data attributes should be added to the list?
|
|
218
|
-
|
|
219
|
-
We've provided a list of the existing key data attributes, the commit diff, a list of all data attributes that are now valid, and the function code.
|
|
190
|
+
const BACKEND_SYSTEM_MESSAGE = `You are updating the key attributes for a backend function that was recently changed.
|
|
220
191
|
|
|
221
|
-
|
|
192
|
+
This is an INCREMENTAL update. Existing key attributes should be preserved unless the code change clearly invalidates them. Removing and re-adding attributes across changes causes unnecessary churn.
|
|
222
193
|
|
|
223
|
-
|
|
194
|
+
## Stability Rules
|
|
224
195
|
|
|
225
|
-
|
|
196
|
+
- REMOVE only if the attribute is clearly no longer used (variable deleted, conditional removed, no longer referenced)
|
|
197
|
+
- KEEP marginal attributes—if unsure, preserve rather than remove
|
|
198
|
+
- ADD new attributes freely when warranted
|
|
226
199
|
|
|
227
|
-
|
|
200
|
+
## What Makes a Key Attribute
|
|
228
201
|
|
|
229
|
-
|
|
202
|
+
A key attribute is a data path from "Attributes and Value Types" that dramatically changes the function's behavior:
|
|
230
203
|
|
|
231
|
-
|
|
204
|
+
- Controls a conditional that significantly alters execution flow or return value
|
|
205
|
+
- Determines which branch of logic executes
|
|
206
|
+
- For side-effect functions: changes how external systems are called (database, email, etc.)
|
|
232
207
|
|
|
233
|
-
|
|
208
|
+
NOT key attributes:
|
|
209
|
+
- Fallback values that won't be used if primary values exist
|
|
210
|
+
- Values that would cause errors if changed
|
|
211
|
+
- Guard clauses that return nothing/minimal data
|
|
234
212
|
|
|
235
|
-
|
|
213
|
+
## Path Format
|
|
236
214
|
|
|
237
|
-
|
|
215
|
+
Only return attributes from the "Attributes and Value Types" list—these are the only values we can control. Use the exact path provided. Use \`functionCallReturnValue\` for function return values. Use \`[]\` for array items (e.g., \`items[]\`).
|
|
238
216
|
|
|
239
|
-
|
|
217
|
+
## Response Format
|
|
240
218
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
- Note: some functions do not return anything but instead call out to other systems (e.g. send an email, write to a database, etc). In those cases, the key attributes should be those that dramatically change how the function interacts with those other systems.
|
|
244
|
-
|
|
245
|
-
### Should NOT be a key attribute
|
|
246
|
-
|
|
247
|
-
- Changing the value of this variable will cause an error or exception to be thrown.
|
|
248
|
-
|
|
249
|
-
- Changing the value of this variable will cause a guard clause to be triggered that results in nothing or very little being returned.
|
|
250
|
-
|
|
251
|
-
- The value is used as a fallback or alternative for another value and won't even be used if the other value is present.
|
|
252
|
-
|
|
253
|
-
## Instructions
|
|
254
|
-
|
|
255
|
-
- Read each line of code. Pay particular attention to the return value of the function. What data attributes will cause it to return distinctly different but functional and robust results?
|
|
256
|
-
- Find the most impactful key attributes that will impact the return value of the function. This should be a limited subset of the "Attributes and Value Types" provided.
|
|
257
|
-
- Reference the list of existing key attributes to determine if any of them are no longer valid or if any new key attributes should be added.
|
|
258
|
-
- Return each key attribute with the following information:
|
|
259
|
-
- \`path\`: The path to the data attribute in the code
|
|
260
|
-
- \`description\`: A short description of the data attribute and how it is used in the code.
|
|
261
|
-
- \`validValueOptions\`: A list of possible values for the data attribute that should be tested. This should include extreme values that could cause different behavior in the code but these values should not cause an error.
|
|
262
|
-
- Each attribute should reference exactly the path of a data attribute provided in the "Attributes and Value Types" section.
|
|
263
|
-
|
|
264
|
-
## Response
|
|
265
|
-
|
|
266
|
-
Please respond by specifying which attributes need to be added or removed. For removed attributes just specify the path that is no longer valid.
|
|
219
|
+
For \`validValueOptions\`, include boundary/extreme values that trigger different behavior—but NOT values that would cause errors.
|
|
267
220
|
|
|
268
221
|
\`\`\`json
|
|
269
222
|
{
|
|
270
223
|
"addedKeyAttributes": [
|
|
271
224
|
{
|
|
272
|
-
"path": "
|
|
273
|
-
|
|
274
|
-
"
|
|
275
|
-
|
|
276
|
-
"true",
|
|
277
|
-
"false"
|
|
278
|
-
],
|
|
279
|
-
"errorValueOptions": []
|
|
280
|
-
},
|
|
225
|
+
"path": "config.enabled",
|
|
226
|
+
"description": "Controls whether the main processing logic runs",
|
|
227
|
+
"validValueOptions": ["true", "false"]
|
|
228
|
+
}
|
|
281
229
|
],
|
|
282
|
-
"removedKeyAttributes": [
|
|
283
|
-
"notification.message"
|
|
284
|
-
]
|
|
230
|
+
"removedKeyAttributes": ["oldAttribute.path"]
|
|
285
231
|
}
|
|
286
232
|
\`\`\`
|
|
287
233
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
- A key attribute must be an exact attribute path from the "Attributes and Value Types" provided. Do not return any other attribute paths. The only data we can provide to the function comes from these attributes so any other attribute is useless. For internally computed variables trace them back to one of the higher level variables that we can actually impact. Be sure to match the text from the attribute list exactly including spaces, commas, etc.
|
|
234
|
+
Return empty arrays if no changes needed.
|
|
291
235
|
`;
|
|
@@ -151,224 +151,77 @@ export default async function generateEntityKeyAttributes({
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
const FRONTEND_SYSTEM_MESSAGE = `
|
|
154
|
+
const FRONTEND_SYSTEM_MESSAGE = `You analyze frontend components to identify key data attributes that significantly impact rendering.
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
## What Makes a Key Attribute
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
A key attribute is a data path from "Attributes and Value Types" that dramatically changes how the component renders:
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
- Controls a conditional that shows/hides significant UI sections
|
|
161
|
+
- Changes the component's primary visual state (not just minor text differences)
|
|
162
|
+
- Determines which branch of rendering logic executes
|
|
161
163
|
|
|
162
|
-
|
|
164
|
+
NOT key attributes:
|
|
165
|
+
- Values that only affect non-visible behavior (hrefs, image srcs)
|
|
166
|
+
- Fallback values that won't be used if primary values exist
|
|
167
|
+
- Values that would cause errors if changed
|
|
168
|
+
- Guard clauses that render literally nothing
|
|
163
169
|
|
|
164
|
-
|
|
170
|
+
Note: A conditional that shows a different UI state (e.g., loading screen, redirect message) IS significant—include it.
|
|
165
171
|
|
|
166
|
-
|
|
172
|
+
## Path Format
|
|
167
173
|
|
|
168
|
-
|
|
174
|
+
Only return attributes from the "Attributes and Value Types" list—these are the only values we can control. Use the exact \`fullPath\` provided. Use \`functionCallReturnValue\` for function return values. Use \`[]\` for array items (e.g., \`items[]\`).
|
|
169
175
|
|
|
170
|
-
|
|
176
|
+
## Response Format
|
|
171
177
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
- Changing the presence, value, length (e.g. for strings or arrays), etc of this variable will dramatically change how the component displays (the return value of the function).
|
|
175
|
-
|
|
176
|
-
- Is used in a conditional (especially conditionals in the JSX such as \`{varName1 && varName2 && ([JSX])}\` where the absence or presence of both \`varName1\` and \`varName2\` directly impact what the user sees) that alters how the component displays. Capture how the conditional uses the variable. Does it require the variable to be true/false, defined/not defined (e.g. undefined), greater than/less than a certain value, compared with another variable, etc. Really any attribute that is used in a conditional should be a key attribute.
|
|
177
|
-
|
|
178
|
-
### Should NOT be a key attribute
|
|
179
|
-
|
|
180
|
-
- Changing the value of this variable will cause an error or exception to be thrown.
|
|
181
|
-
|
|
182
|
-
- Changing the value of this variable will cause a guard clause around the whole method or function to be triggered that results in nothing at all being displayed.
|
|
183
|
-
|
|
184
|
-
- Changing the value of this variable will cause a minor change in display that is not significant (e.g. slightly different text).
|
|
185
|
-
|
|
186
|
-
- The value is used as a fallback or alternative for another value and won't even be used if the other value is present.
|
|
187
|
-
|
|
188
|
-
- The value changes non-visible behavior (e.g. the href in a link or src in an image - all images sources are mocked out).
|
|
189
|
-
|
|
190
|
-
## Instructions
|
|
191
|
-
|
|
192
|
-
- Read each line of code. Pay particular attention to the return value of the function and how this frontend component will be displayed. What will cause it display distinctly different but functional and robust results to the user?
|
|
193
|
-
- Find the most impactful key attributes that will change how the frontend component is displayed. This should be a limited subset of the "Attributes and Value Types" provided.
|
|
194
|
-
- Return each key attribute with the following information:
|
|
195
|
-
- \`fullPath\`: The fullPath to the data attribute in the code
|
|
196
|
-
- \`description\`: A short description of the data attribute and how it is used in the code.
|
|
197
|
-
- \`validValueOptions\`: A list of possible values for the data attribute that should be tested. This list should be minimal and only include values that the code will handle properly and will clearly make a difference in how the component is displayed. Do not make up arbitrary values without clear evidence that each different value will cause a different display behavior.
|
|
198
|
-
- List the key attributes in the order of importance (most important first, with importance determined by how much changing the attribute will impact how the component is displayed).
|
|
199
|
-
- Each attribute should reference exactly the full fullPath of a data attribute provided in the "Attributes and Value Types" section.
|
|
200
|
-
|
|
201
|
-
## Example
|
|
202
|
-
|
|
203
|
-
Given the following "Attributes and Value Types":
|
|
204
|
-
\`\`\`
|
|
205
|
-
'notification.read': { fullPath: 'signature[0].notification.read', type: 'boolean' }
|
|
206
|
-
'notification.message': { fullPath: 'signature[0].notification.message', type: 'string' }
|
|
207
|
-
\`\`\`
|
|
208
|
-
|
|
209
|
-
and code:
|
|
210
|
-
|
|
211
|
-
\`\`\`typescript
|
|
212
|
-
const NotificationText = (notification) => {
|
|
213
|
-
if (notification.read) {
|
|
214
|
-
return (
|
|
215
|
-
<span onClick={markAsRead(notification.id)}>
|
|
216
|
-
<img src={notification.icon} alt="Notification Icon" />
|
|
217
|
-
{notification.message}
|
|
218
|
-
</span>
|
|
219
|
-
);
|
|
220
|
-
} else {
|
|
221
|
-
return <strong>{notification.message}</strong>;
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
\`\`\`
|
|
225
|
-
|
|
226
|
-
The response might be:
|
|
178
|
+
For \`validValueOptions\`, include boundary/extreme values that trigger different behavior—but NOT values that would cause errors.
|
|
227
179
|
|
|
228
180
|
\`\`\`json
|
|
229
181
|
{
|
|
230
182
|
"keyAttributes": [
|
|
231
183
|
{
|
|
232
|
-
"fullPath": "signature[0].
|
|
233
|
-
"description": "
|
|
234
|
-
"validValueOptions": [
|
|
235
|
-
"true",
|
|
236
|
-
"false"
|
|
237
|
-
]
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"fullPath": "signature[0].notification.message",
|
|
241
|
-
"description": "The message text is displayed and should be tested for various lengths.",
|
|
242
|
-
"validValueOptions": [
|
|
243
|
-
"An empty message (no characters)",
|
|
244
|
-
"A medium message (around 100 characters)",
|
|
245
|
-
"A long message (longer than 200 characters)"
|
|
246
|
-
]
|
|
184
|
+
"fullPath": "signature[0].user",
|
|
185
|
+
"description": "Controls whether the main form or redirect screen displays",
|
|
186
|
+
"validValueOptions": ["truthy user object", "null/undefined"]
|
|
247
187
|
}
|
|
248
188
|
]
|
|
249
189
|
}
|
|
250
190
|
\`\`\`
|
|
251
|
-
|
|
252
|
-
## Important
|
|
253
|
-
|
|
254
|
-
- A key attribute must be an exact attribute fullPath from the "Attributes and Value Types" provided. Do not return any other attribute fullPaths. The only data we can provide to the function comes from these attributes so any other attribute is useless. For internally computed variables trace them back to one of the higher level variables that we can actually impact. Be sure to match the text from the attribute list exactly including spaces, commas, etc.
|
|
255
191
|
`;
|
|
256
192
|
|
|
257
|
-
const BACKEND_SYSTEM_MESSAGE = `
|
|
258
|
-
|
|
259
|
-
Can you help us identify the key data attributes in the code that will cause the function to return distinctly different but functional and robust results?
|
|
260
|
-
|
|
261
|
-
We're not interested in causing errors or in high-level guard clauses that result in nothing being returned. We're interested in always returning a robust result that demonstrates the core intent of the function.
|
|
193
|
+
const BACKEND_SYSTEM_MESSAGE = `You analyze backend functions to identify key data attributes that significantly impact behavior.
|
|
262
194
|
|
|
263
|
-
|
|
195
|
+
## What Makes a Key Attribute
|
|
264
196
|
|
|
265
|
-
|
|
197
|
+
A key attribute is a data path from "Attributes and Value Types" that dramatically changes the function's behavior:
|
|
266
198
|
|
|
267
|
-
|
|
199
|
+
- Controls a conditional that significantly alters execution flow or return value
|
|
200
|
+
- Determines which branch of logic executes
|
|
201
|
+
- For side-effect functions: changes how external systems are called (database, email, etc.)
|
|
268
202
|
|
|
269
|
-
|
|
203
|
+
NOT key attributes:
|
|
204
|
+
- Fallback values that won't be used if primary values exist
|
|
205
|
+
- Values that would cause errors if changed
|
|
206
|
+
- Guard clauses that return nothing/minimal data
|
|
270
207
|
|
|
271
|
-
|
|
208
|
+
## Path Format
|
|
272
209
|
|
|
273
|
-
|
|
210
|
+
Only return attributes from the "Attributes and Value Types" list—these are the only values we can control. Use the exact \`fullPath\` provided. Use \`functionCallReturnValue\` for function return values. Use \`[]\` for array items (e.g., \`items[]\`).
|
|
274
211
|
|
|
275
|
-
|
|
212
|
+
## Response Format
|
|
276
213
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
- Changing the value, length (e.g. for strings or arrays), etc of this variable will dramatically impact the return value of the function.
|
|
280
|
-
|
|
281
|
-
- Is used in a conditional that dramatically the execution flow of the function and as a result the return value of the function (note: if the conditional compares two or more variables, note which variables are involved and how they must be set to cause different behavior).
|
|
282
|
-
|
|
283
|
-
- Note: some functions do not return anything but instead call out to other systems (e.g. send an email, write to a database, etc). In those cases, the key attributes should be those that dramatically change how the function interacts with those other systems.
|
|
284
|
-
|
|
285
|
-
### Should NOT be a key attribute
|
|
286
|
-
|
|
287
|
-
- Changing the value of this variable will cause an error or exception to be thrown.
|
|
288
|
-
|
|
289
|
-
- Changing the value of this variable will cause a guard clause to be triggered that results in nothing or very little being returned.
|
|
290
|
-
|
|
291
|
-
- The value is used as a fallback or alternative for another value and won't even be used if the other value is present.
|
|
292
|
-
|
|
293
|
-
## Instructions
|
|
294
|
-
|
|
295
|
-
- Read each line of code. Pay particular attention to the return value of the function. What data attributes will cause it to return distinctly different but functional and robust results?
|
|
296
|
-
- Find the most impactful key attributes that will impact the return value of the function. This should be a limited subset of the "Attributes and Value Types" provided.
|
|
297
|
-
- Return each key attribute with the following information:
|
|
298
|
-
- \`fullPath\`: The fullPath to the data attribute in the code
|
|
299
|
-
- \`description\`: A short description of the data attribute and how it is used in the code.
|
|
300
|
-
- \`validValueOptions\`: A list of possible values for the data attribute that should be tested. This list should be minimal and only include values that the code will handle properly and will clearly make a difference in the functions's behavior. Do not make up arbitrary values without clear evidence that each different value will clearly result in a different function behavior.
|
|
301
|
-
- List the key attributes in the order of importance (most important first, with importance determined by how much changing the attribute will change the return value of the function).
|
|
302
|
-
- Each attribute should reference exactly the fullPath of a data attribute provided in the "Attributes and Value Types" section.
|
|
303
|
-
|
|
304
|
-
## Example
|
|
305
|
-
|
|
306
|
-
Given the following "Attributes and Value Types":
|
|
307
|
-
\`\`\`
|
|
308
|
-
[
|
|
309
|
-
items[].quantity: { fullPath: 'signature[0][].quantity', type: 'number' },
|
|
310
|
-
items[].price: { fullPath: 'signature[0][].price', type: 'number' },
|
|
311
|
-
discount: { fullPath: 'signature[1]', type: 'number' },
|
|
312
|
-
taxRate: { fullPath: 'signature[2]', type: 'number' },
|
|
313
|
-
]
|
|
314
|
-
\`\`\`
|
|
315
|
-
|
|
316
|
-
and code:
|
|
317
|
-
|
|
318
|
-
\`\`\`typescript
|
|
319
|
-
const calculateTotal = (items, discount, taxRate) => {
|
|
320
|
-
const subtotal = items.reduce((sum, item) => sum + item.quantity * item.price, 0);
|
|
321
|
-
const discountedTotal = subtotal - discount;
|
|
322
|
-
const tax = discountedTotal * taxRate;
|
|
323
|
-
return discountedTotal + tax;
|
|
324
|
-
}
|
|
325
|
-
\`\`\`
|
|
326
|
-
|
|
327
|
-
The response might be:
|
|
214
|
+
For \`validValueOptions\`, include boundary/extreme values that trigger different behavior—but NOT values that would cause errors.
|
|
328
215
|
|
|
329
216
|
\`\`\`json
|
|
330
217
|
{
|
|
331
218
|
"keyAttributes": [
|
|
332
219
|
{
|
|
333
|
-
"fullPath": "signature[0]
|
|
334
|
-
"description": "
|
|
335
|
-
"validValueOptions": [
|
|
336
|
-
"0 (no items)",
|
|
337
|
-
"1 (single item)",
|
|
338
|
-
"5 (multiple items)",
|
|
339
|
-
"100 (large quantity)"
|
|
340
|
-
]
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"fullPath": "signature[0][].price",
|
|
344
|
-
"description": "The price of each item affects the subtotal calculation.",
|
|
345
|
-
"validValueOptions": [
|
|
346
|
-
"0.00 (free item)",
|
|
347
|
-
"19.99 (average price)",
|
|
348
|
-
"999.99 (high price)"
|
|
349
|
-
]
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
"fullPath": "signature[1]",
|
|
353
|
-
"description": "The discount amount directly reduces the subtotal.",
|
|
354
|
-
"validValueOptions": [
|
|
355
|
-
"0 (no discount)",
|
|
356
|
-
"20.00 (discount)"
|
|
357
|
-
]
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
"fullPath": "signature[2]",
|
|
361
|
-
"description": "The tax rate affects the final total calculation.",
|
|
362
|
-
"validValueOptions": [
|
|
363
|
-
"0 (no tax)",
|
|
364
|
-
"0.20 (20% tax)"
|
|
365
|
-
]
|
|
220
|
+
"fullPath": "signature[0].config.enabled",
|
|
221
|
+
"description": "Controls whether the main processing logic runs",
|
|
222
|
+
"validValueOptions": ["true", "false"]
|
|
366
223
|
}
|
|
367
224
|
]
|
|
368
225
|
}
|
|
369
226
|
\`\`\`
|
|
370
|
-
|
|
371
|
-
## Important
|
|
372
|
-
|
|
373
|
-
- A key attribute must be an exact attribute fullPath from the "Attributes and Value Types" provided. Do not return any other attribute fullPaths. The only data we can provide to the function comes from these attributes so any other attribute is useless. For internally computed variables trace them back to one of the higher level variables that we can actually impact. Be sure to match the text from the attribute list exactly including spaces, commas, etc.
|
|
374
227
|
`;
|
|
@@ -84,6 +84,17 @@ export class FileAnalyzer {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Returns only declared entity nodes (not identifier references).
|
|
89
|
+
* Use this when you need to find entities that can be replaced/mocked.
|
|
90
|
+
*/
|
|
91
|
+
getAllDeclaredEntityNodes() {
|
|
92
|
+
if (!this.sourceFile) return {};
|
|
93
|
+
return lib.asts.sourceFiles.getAllDeclaredEntityNodes({
|
|
94
|
+
sourceFile: this.sourceFile,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
87
98
|
getNodeCode(node: ts.Node, removeComments = false) {
|
|
88
99
|
if (!this.sourceFile) return '';
|
|
89
100
|
if (removeComments) {
|
|
@@ -138,6 +149,29 @@ export class FileAnalyzer {
|
|
|
138
149
|
});
|
|
139
150
|
}
|
|
140
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Get the code for a declared entity (not identifier references).
|
|
154
|
+
* Use this when you need to find code that can be replaced/mocked.
|
|
155
|
+
*/
|
|
156
|
+
getDeclaredEntityCode(entityName: string, removeComments = false) {
|
|
157
|
+
if (!this.sourceFile) return '';
|
|
158
|
+
const entityNode = lib.asts.sourceFiles.getDeclaredEntityNode({
|
|
159
|
+
entityName,
|
|
160
|
+
sourceFile: this.sourceFile,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
if (removeComments) {
|
|
164
|
+
const printer = ts.createPrinter({ removeComments: true });
|
|
165
|
+
return printer.printNode(
|
|
166
|
+
ts.EmitHint.Unspecified,
|
|
167
|
+
entityNode,
|
|
168
|
+
this.sourceFile,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return entityNode.getText(this.sourceFile);
|
|
173
|
+
}
|
|
174
|
+
|
|
141
175
|
getAllExports(): Record<string, ExportedFunction> {
|
|
142
176
|
if (!this.sourceFile) return {};
|
|
143
177
|
return lib.asts.sourceFiles.getAllExports(this.sourceFile);
|