-
Notifications
You must be signed in to change notification settings - Fork 355
Generate TypeScript definitions for safe outputs JSONL types #764
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
Merged
pelikhan
merged 4 commits into
main
from
copilot/fix-8a81c7fc-b603-4874-93c1-dd2e8a8f383f
Sep 12, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
194589a
Initial plan
Copilot 8369723
Generate comprehensive TypeScript definitions for safe outputs system
Copilot 57b5000
Keep only JSONL types in TypeScript definitions
Copilot fe9f937
Remove SAFE_OUTPUT_INCONSISTENCIES.md file as requested
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,178 @@ | ||
| // TypeScript definitions for GitHub Agentic Workflows Safe Outputs JSONL Types | ||
| // This file provides type definitions for JSONL output items produced by agents | ||
|
|
||
| // === JSONL Output Item Types === | ||
|
|
||
| /** | ||
| * Base interface for all safe output items | ||
| */ | ||
| interface BaseSafeOutputItem { | ||
| /** The type of safe output action */ | ||
| type: string; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for creating a GitHub issue | ||
| */ | ||
| interface CreateIssueItem extends BaseSafeOutputItem { | ||
| type: "create-issue"; | ||
| /** Issue title */ | ||
| title: string; | ||
| /** Issue body content */ | ||
| body: string; | ||
| /** Optional labels to add to the issue */ | ||
| labels?: string[]; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for creating a GitHub discussion | ||
| */ | ||
| interface CreateDiscussionItem extends BaseSafeOutputItem { | ||
| type: "create-discussion"; | ||
| /** Discussion title */ | ||
| title: string; | ||
| /** Discussion body content */ | ||
| body: string; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for adding a comment to an issue or PR | ||
| */ | ||
| interface AddIssueCommentItem extends BaseSafeOutputItem { | ||
| type: "add-issue-comment"; | ||
| /** Comment body content */ | ||
| body: string; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for creating a pull request | ||
| */ | ||
| interface CreatePullRequestItem extends BaseSafeOutputItem { | ||
| type: "create-pull-request"; | ||
| /** Pull request title */ | ||
| title: string; | ||
| /** Pull request body content */ | ||
| body: string; | ||
| /** Optional branch name (will be auto-generated if not provided) */ | ||
| branch?: string; | ||
| /** Optional labels to add to the PR */ | ||
| labels?: string[]; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for creating a pull request review comment | ||
| */ | ||
| interface CreatePullRequestReviewCommentItem extends BaseSafeOutputItem { | ||
| type: "create-pull-request-review-comment"; | ||
| /** File path for the review comment */ | ||
| path: string; | ||
| /** Line number for the comment */ | ||
| line: number | string; | ||
| /** Comment body content */ | ||
| body: string; | ||
| /** Optional start line for multi-line comments */ | ||
| start_line?: number | string; | ||
| /** Optional side of the diff: "LEFT" or "RIGHT" */ | ||
| side?: "LEFT" | "RIGHT"; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for creating a code scanning alert | ||
| */ | ||
| interface CreateCodeScanningAlertItem extends BaseSafeOutputItem { | ||
| type: "create-code-scanning-alert"; | ||
| /** File path where the issue was found */ | ||
| file: string; | ||
| /** Line number where the issue was found */ | ||
| line: number | string; | ||
| /** Severity level: "error", "warning", "info", or "note" */ | ||
| severity: "error" | "warning" | "info" | "note"; | ||
| /** Alert message describing the issue */ | ||
| message: string; | ||
| /** Optional column number */ | ||
| column?: number | string; | ||
| /** Optional rule ID suffix for uniqueness */ | ||
| ruleIdSuffix?: string; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for adding labels to an issue or PR | ||
| */ | ||
| interface AddIssueLabelItem extends BaseSafeOutputItem { | ||
| type: "add-issue-label"; | ||
| /** Array of label names to add */ | ||
| labels: string[]; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for updating an issue | ||
| */ | ||
| interface UpdateIssueItem extends BaseSafeOutputItem { | ||
| type: "update-issue"; | ||
| /** Optional new issue status */ | ||
| status?: "open" | "closed"; | ||
| /** Optional new issue title */ | ||
| title?: string; | ||
| /** Optional new issue body */ | ||
| body?: string; | ||
| /** Optional issue number for target "*" */ | ||
| issue_number?: number | string; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for pushing to a PR branch | ||
| */ | ||
| interface PushToPrBranchItem extends BaseSafeOutputItem { | ||
| type: "push-to-pr-branch"; | ||
| /** Optional commit message */ | ||
| message?: string; | ||
| /** Optional pull request number for target "*" */ | ||
| pull_request_number?: number | string; | ||
| } | ||
|
|
||
| /** | ||
| * JSONL item for reporting missing tools | ||
| */ | ||
| interface MissingToolItem extends BaseSafeOutputItem { | ||
| type: "missing-tool"; | ||
| /** Name of the missing tool */ | ||
| tool: string; | ||
| /** Reason why the tool is needed */ | ||
| reason: string; | ||
| /** Optional alternatives or workarounds */ | ||
| alternatives?: string; | ||
| } | ||
|
|
||
| /** | ||
| * Union type of all possible safe output items | ||
| */ | ||
| type SafeOutputItem = | ||
| | CreateIssueItem | ||
| | CreateDiscussionItem | ||
| | AddIssueCommentItem | ||
| | CreatePullRequestItem | ||
| | CreatePullRequestReviewCommentItem | ||
| | CreateCodeScanningAlertItem | ||
| | AddIssueLabelItem | ||
| | UpdateIssueItem | ||
| | PushToPrBranchItem | ||
| | MissingToolItem; | ||
|
|
||
|
|
||
|
|
||
| // === Export JSONL types === | ||
| export { | ||
| // JSONL item types | ||
| BaseSafeOutputItem, | ||
| CreateIssueItem, | ||
| CreateDiscussionItem, | ||
| AddIssueCommentItem, | ||
| CreatePullRequestItem, | ||
| CreatePullRequestReviewCommentItem, | ||
| CreateCodeScanningAlertItem, | ||
| AddIssueLabelItem, | ||
| UpdateIssueItem, | ||
| PushToPrBranchItem, | ||
| MissingToolItem, | ||
| SafeOutputItem, | ||
| }; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.