-
Couldn't load subscription status.
- Fork 5.5k
Applying MCP annotations to TS components - batch 2/2 #18668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,14 +1,19 @@ | ||||||||||
| import onfleet from "../../app/onfleet.app"; | ||||||||||
| import { | ||||||||||
| clearObj, prepareData | ||||||||||
| clearObj, prepareData, | ||||||||||
| } from "../common/utils"; | ||||||||||
|
|
||||||||||
| export default { | ||||||||||
| key: "onfleet-create-pickup-dropoff-task", | ||||||||||
| name: "Create Linked Pickup & Dropoff Tasks", | ||||||||||
| description: "Create a pickup task and dropoff task linked with each other. [See the docs here](https://docs.onfleet.com/reference/create-task)", | ||||||||||
| type: "action", | ||||||||||
| version: "0.0.1", | ||||||||||
| version: "0.0.3", | ||||||||||
| annotations: { | ||||||||||
| destructiveHint: false, | ||||||||||
| openWorldHint: true, | ||||||||||
| readOnlyHint: false, | ||||||||||
| }, | ||||||||||
| props: { | ||||||||||
| onfleet, | ||||||||||
| merchant: { | ||||||||||
|
|
@@ -320,8 +325,8 @@ export default { | |||||||||
| address: dropoffAddress, | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| let pickupResponse = <any>{}; | ||||||||||
| let dropoffResponse = <any>{}; | ||||||||||
| let pickupResponse: { id?: string } = {}; | ||||||||||
| let dropoffResponse: { id?: string } = {}; | ||||||||||
|
Comment on lines
+328
to
+329
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional The type annotation Consider either:
- let pickupResponse: { id?: string } = {};
- let dropoffResponse: { id?: string } = {};
+ let pickupResponse: { id: string } = {} as { id: string };
+ let dropoffResponse: { id: string } = {} as { id: string };
summary = `A new pickup task with id ${pickupResponse.id} was successfully created, then a new dropff task with id ${dropoffResponse.id} was successfully created!`;Should handle the case where 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| let response = {}; | ||||||||||
| let summary = ""; | ||||||||||
|
|
||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,12 @@ export default defineAction({ | |
| name: "Create Run", | ||
| description: `Create a run [See docs here](${DOCS.createRun})`, | ||
| key: "practitest-create-run", | ||
| version: "0.0.1", | ||
| version: "0.0.2", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
|
Comment on lines
+13
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chainLGTM! Annotations appropriately describe a create operation. The annotations correctly characterize this action:
To ensure consistency across the PR, consider verifying that similar operations have similar annotation values. Run the following script to check for any inconsistencies: 🏁 Script executed: #!/bin/bash
# Description: Check annotation patterns across all modified action files
# Find all actions with annotations and group by operation type
echo "=== Create/Import actions with annotations ==="
rg -A3 'name:.*"(Create|Import)' --type=ts -g '**/actions/**/*.ts' | rg -A3 'annotations:'
echo -e "\n=== Delete actions with annotations ==="
rg -A3 'name:.*"Delete' --type=ts -g '**/actions/**/*.ts' | rg -A3 'annotations:'
echo -e "\n=== Get/List/Retrieve/Search actions with annotations ==="
rg -A3 'name:.*"(Get|List|Retrieve|Search)' --type=ts -g '**/actions/**/*.ts' | rg -A3 'annotations:'Length of output: 7738 Align annotation usage across actions 🤖 Prompt for AI Agents |
||
| type: "action", | ||
| props: { | ||
| practitest, | ||
|
|
@@ -113,7 +118,9 @@ export default defineAction({ | |
| }; | ||
| } catch (err) { | ||
| throw new ConfigurationError( | ||
| `**JSON parse error** - check if the \`${prop}\` prop is a valid JSON-stringified object`, | ||
| `**JSON parse error** - check if the \`${prop}\` prop is a valid JSON-stringified object | ||
|
|
||
| \`${err.message}\``, | ||
| ); | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.