@kana-ai/edgar-ext-github 0.0.0-stage → 0.1.0

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 (136) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +469 -2
  3. package/agents/dismiss/agent.toml +4 -0
  4. package/agents/dismiss/instructions.md +25 -0
  5. package/dist/src/api/app.d.ts +16 -0
  6. package/dist/src/api/app.js +32 -0
  7. package/dist/src/api/client.d.ts +26 -0
  8. package/dist/src/api/client.js +103 -0
  9. package/dist/src/api/failures.d.ts +8 -0
  10. package/dist/src/api/failures.js +31 -0
  11. package/dist/src/feed/alerts.d.ts +26 -0
  12. package/dist/src/feed/alerts.js +117 -0
  13. package/dist/src/feed/cards.d.ts +32 -0
  14. package/dist/src/feed/cards.js +164 -0
  15. package/dist/src/feed/service.d.ts +28 -0
  16. package/dist/src/feed/service.js +163 -0
  17. package/dist/src/index.d.ts +490 -0
  18. package/dist/src/index.js +62 -0
  19. package/dist/src/schemas/config.d.ts +57 -0
  20. package/dist/src/schemas/config.js +89 -0
  21. package/dist/src/schemas/github.d.ts +417 -0
  22. package/dist/src/schemas/github.js +216 -0
  23. package/dist/src/schemas/tools.d.ts +620 -0
  24. package/dist/src/schemas/tools.js +501 -0
  25. package/dist/src/tools/alerts.d.ts +45 -0
  26. package/dist/src/tools/alerts.js +100 -0
  27. package/dist/src/tools/branch.d.ts +9 -0
  28. package/dist/src/tools/branch.js +48 -0
  29. package/dist/src/tools/checks.d.ts +118 -0
  30. package/dist/src/tools/checks.js +223 -0
  31. package/dist/src/tools/discussion.d.ts +41 -0
  32. package/dist/src/tools/discussion.js +66 -0
  33. package/dist/src/tools/pull-request.d.ts +195 -0
  34. package/dist/src/tools/pull-request.js +537 -0
  35. package/dist/src/tools/repository.d.ts +53 -0
  36. package/dist/src/tools/repository.js +134 -0
  37. package/dist/src/tools/screenshot.d.ts +21 -0
  38. package/dist/src/tools/screenshot.js +99 -0
  39. package/dist/src/tracker/assignee.d.ts +15 -0
  40. package/dist/src/tracker/assignee.js +65 -0
  41. package/dist/src/tracker/cards.d.ts +41 -0
  42. package/dist/src/tracker/cards.js +361 -0
  43. package/dist/src/tracker/comments.d.ts +9 -0
  44. package/dist/src/tracker/comments.js +68 -0
  45. package/dist/src/tracker/description.d.ts +19 -0
  46. package/dist/src/tracker/description.js +55 -0
  47. package/dist/src/tracker/hand-back.d.ts +8 -0
  48. package/dist/src/tracker/hand-back.js +60 -0
  49. package/dist/src/tracker/port.d.ts +2 -0
  50. package/dist/src/tracker/port.js +42 -0
  51. package/dist/src/tracker/states.d.ts +77 -0
  52. package/dist/src/tracker/states.js +189 -0
  53. package/dist/src/tracker/tools.d.ts +143 -0
  54. package/dist/src/tracker/tools.js +131 -0
  55. package/dist/src/tracker/transitions.d.ts +12 -0
  56. package/dist/src/tracker/transitions.js +101 -0
  57. package/edgar-extension.json +507 -0
  58. package/package.json +43 -3
  59. package/schemas/assign.in.json +15 -0
  60. package/schemas/assign.out.json +14 -0
  61. package/schemas/attach_screenshot.in.json +44 -0
  62. package/schemas/attach_screenshot.out.json +31 -0
  63. package/schemas/batch_cards.in.json +27 -0
  64. package/schemas/batch_cards.out.json +37 -0
  65. package/schemas/branch_protection.in.json +15 -0
  66. package/schemas/branch_protection.out.json +67 -0
  67. package/schemas/ci_run.in.json +12 -0
  68. package/schemas/ci_run.out.json +109 -0
  69. package/schemas/close.in.json +14 -0
  70. package/schemas/close.out.json +10 -0
  71. package/schemas/close_pull_request.in.json +21 -0
  72. package/schemas/close_pull_request.out.json +14 -0
  73. package/schemas/comment.in.json +19 -0
  74. package/schemas/comment.out.json +10 -0
  75. package/schemas/config.json +202 -0
  76. package/schemas/count_sighting.in.json +17 -0
  77. package/schemas/count_sighting.out.json +10 -0
  78. package/schemas/create_card.in.json +108 -0
  79. package/schemas/create_card.out.json +13 -0
  80. package/schemas/dependabot_alerts.in.json +49 -0
  81. package/schemas/dependabot_alerts.out.json +75 -0
  82. package/schemas/dismiss_dependabot_alert.in.json +26 -0
  83. package/schemas/dismiss_dependabot_alert.out.json +27 -0
  84. package/schemas/find_assignee.in.json +15 -0
  85. package/schemas/find_assignee.out.json +10 -0
  86. package/schemas/find_cards.in.json +18 -0
  87. package/schemas/find_cards.out.json +33 -0
  88. package/schemas/find_dependabot_dismissal.in.json +12 -0
  89. package/schemas/find_dependabot_dismissal.out.json +27 -0
  90. package/schemas/find_description.in.json +15 -0
  91. package/schemas/find_description.out.json +10 -0
  92. package/schemas/find_pull_request.in.json +25 -0
  93. package/schemas/find_pull_request.out.json +14 -0
  94. package/schemas/hand_back.in.json +11 -0
  95. package/schemas/hand_back.out.json +18 -0
  96. package/schemas/linked_pull_requests.in.json +15 -0
  97. package/schemas/linked_pull_requests.out.json +44 -0
  98. package/schemas/list_pull_requests.in.json +26 -0
  99. package/schemas/list_pull_requests.out.json +42 -0
  100. package/schemas/merge_pull_request.in.json +22 -0
  101. package/schemas/merge_pull_request.out.json +16 -0
  102. package/schemas/move.in.json +15 -0
  103. package/schemas/move.out.json +10 -0
  104. package/schemas/note_pull_request.in.json +15 -0
  105. package/schemas/note_pull_request.out.json +10 -0
  106. package/schemas/open_pull_request.in.json +113 -0
  107. package/schemas/open_pull_request.out.json +15 -0
  108. package/schemas/pull_request_checks.in.json +11 -0
  109. package/schemas/pull_request_checks.out.json +72 -0
  110. package/schemas/pull_request_discussion.in.json +11 -0
  111. package/schemas/pull_request_discussion.out.json +107 -0
  112. package/schemas/pull_request_state.in.json +11 -0
  113. package/schemas/pull_request_state.out.json +52 -0
  114. package/schemas/push_branch.in.json +21 -0
  115. package/schemas/push_branch.out.json +13 -0
  116. package/schemas/release_follow_ups.in.json +15 -0
  117. package/schemas/release_follow_ups.out.json +13 -0
  118. package/schemas/reopen_dependabot_alert.in.json +33 -0
  119. package/schemas/reopen_dependabot_alert.out.json +22 -0
  120. package/schemas/restore_assignee.in.json +20 -0
  121. package/schemas/restore_assignee.out.json +10 -0
  122. package/schemas/restore_description.in.json +20 -0
  123. package/schemas/restore_description.out.json +10 -0
  124. package/schemas/update_description.in.json +15 -0
  125. package/schemas/update_description.out.json +14 -0
  126. package/schemas/update_pull_request.in.json +81 -0
  127. package/schemas/update_pull_request.out.json +10 -0
  128. package/schemas/wait_for_checks.in.json +11 -0
  129. package/schemas/wait_for_checks.out.json +72 -0
  130. package/schemas/wait_for_merge.in.json +11 -0
  131. package/schemas/wait_for_merge.out.json +17 -0
  132. package/schemas/wait_for_passed_checks.in.json +11 -0
  133. package/schemas/wait_for_passed_checks.out.json +72 -0
  134. package/schemas/wait_for_review.in.json +11 -0
  135. package/schemas/wait_for_review.out.json +52 -0
  136. package/workflows/resume.toml +17 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "id": {
6
+ "type": "string"
7
+ }
8
+ },
9
+ "required": ["id"]
10
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "card": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ },
9
+ "description": {
10
+ "type": "string",
11
+ "description": "the new description; the card's edgar:v0 block is kept"
12
+ }
13
+ },
14
+ "required": ["card", "description"]
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "id": {
6
+ "type": "string"
7
+ },
8
+ "previous": {
9
+ "description": "the description before the write, which restore_description puts back; none when the card already read so",
10
+ "type": "string"
11
+ }
12
+ },
13
+ "required": ["id"]
14
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ },
9
+ "title": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "body": {
14
+ "type": "string"
15
+ },
16
+ "large_diff_lines": {
17
+ "description": "the body says the change is large when it changes more lines than this",
18
+ "type": "integer",
19
+ "exclusiveMinimum": 0,
20
+ "maximum": 9007199254740991
21
+ },
22
+ "path_notices": {
23
+ "description": "a line the body carries when the change touches a file under prefix",
24
+ "type": "array",
25
+ "items": {
26
+ "type": "object",
27
+ "properties": {
28
+ "prefix": {
29
+ "type": "string",
30
+ "minLength": 1
31
+ },
32
+ "notice": {
33
+ "type": "string",
34
+ "minLength": 1
35
+ }
36
+ },
37
+ "required": ["prefix", "notice"]
38
+ }
39
+ },
40
+ "checks": {
41
+ "description": "the output of a check stage: the body lists each check that passed under Verified, and each other check under Not verified",
42
+ "type": "object",
43
+ "properties": {
44
+ "results": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "properties": {
49
+ "check": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ },
53
+ "exit_code": {
54
+ "anyOf": [
55
+ {
56
+ "type": "integer",
57
+ "minimum": -9007199254740991,
58
+ "maximum": 9007199254740991
59
+ },
60
+ {
61
+ "type": "null"
62
+ }
63
+ ]
64
+ }
65
+ },
66
+ "required": ["check", "exit_code"]
67
+ }
68
+ }
69
+ },
70
+ "required": ["results"]
71
+ },
72
+ "not_verified": {
73
+ "description": "what the author of the change did not check, one line each, under Not verified",
74
+ "type": "array",
75
+ "items": {
76
+ "type": "string"
77
+ }
78
+ }
79
+ },
80
+ "required": ["url", "title", "body"]
81
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string"
7
+ }
8
+ },
9
+ "required": ["url"]
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ }
9
+ },
10
+ "required": ["url"]
11
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string"
7
+ },
8
+ "commit": {
9
+ "type": "string"
10
+ },
11
+ "state": {
12
+ "type": "string",
13
+ "enum": ["pending", "passed", "failed", "closed"]
14
+ },
15
+ "merged": {
16
+ "type": "boolean"
17
+ },
18
+ "checks": {
19
+ "type": "integer",
20
+ "minimum": -9007199254740991,
21
+ "maximum": 9007199254740991
22
+ },
23
+ "failed": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "object",
27
+ "properties": {
28
+ "name": {
29
+ "type": "string"
30
+ },
31
+ "url": {
32
+ "type": ["string", "null"]
33
+ }
34
+ },
35
+ "required": ["name", "url"]
36
+ }
37
+ },
38
+ "retry_after_seconds": {
39
+ "anyOf": [
40
+ {
41
+ "type": "integer",
42
+ "minimum": -9007199254740991,
43
+ "maximum": 9007199254740991
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ]
49
+ },
50
+ "summary": {
51
+ "type": "string",
52
+ "description": "one sentence a later stage can post as it is"
53
+ },
54
+ "changed_files": {
55
+ "type": "integer",
56
+ "minimum": -9007199254740991,
57
+ "maximum": 9007199254740991,
58
+ "description": "the files the pull request changes at commit"
59
+ }
60
+ },
61
+ "required": [
62
+ "url",
63
+ "commit",
64
+ "state",
65
+ "merged",
66
+ "checks",
67
+ "failed",
68
+ "retry_after_seconds",
69
+ "summary",
70
+ "changed_files"
71
+ ]
72
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ }
9
+ },
10
+ "required": ["url"]
11
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string"
7
+ },
8
+ "merged": {
9
+ "type": "boolean"
10
+ },
11
+ "sha": {
12
+ "description": "the merge commit, once merged",
13
+ "type": "string"
14
+ }
15
+ },
16
+ "required": ["url", "merged"]
17
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ }
9
+ },
10
+ "required": ["url"]
11
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string"
7
+ },
8
+ "commit": {
9
+ "type": "string"
10
+ },
11
+ "state": {
12
+ "type": "string",
13
+ "enum": ["pending", "passed", "failed", "closed"]
14
+ },
15
+ "merged": {
16
+ "type": "boolean"
17
+ },
18
+ "checks": {
19
+ "type": "integer",
20
+ "minimum": -9007199254740991,
21
+ "maximum": 9007199254740991
22
+ },
23
+ "failed": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "object",
27
+ "properties": {
28
+ "name": {
29
+ "type": "string"
30
+ },
31
+ "url": {
32
+ "type": ["string", "null"]
33
+ }
34
+ },
35
+ "required": ["name", "url"]
36
+ }
37
+ },
38
+ "retry_after_seconds": {
39
+ "anyOf": [
40
+ {
41
+ "type": "integer",
42
+ "minimum": -9007199254740991,
43
+ "maximum": 9007199254740991
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ]
49
+ },
50
+ "summary": {
51
+ "type": "string",
52
+ "description": "one sentence a later stage can post as it is"
53
+ },
54
+ "changed_files": {
55
+ "type": "integer",
56
+ "minimum": -9007199254740991,
57
+ "maximum": 9007199254740991,
58
+ "description": "the files the pull request changes at commit"
59
+ }
60
+ },
61
+ "required": [
62
+ "url",
63
+ "commit",
64
+ "state",
65
+ "merged",
66
+ "checks",
67
+ "failed",
68
+ "retry_after_seconds",
69
+ "summary",
70
+ "changed_files"
71
+ ]
72
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ }
9
+ },
10
+ "required": ["url"]
11
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string"
7
+ },
8
+ "state": {
9
+ "type": "string",
10
+ "enum": ["open", "merged", "closed"]
11
+ },
12
+ "merged": {
13
+ "type": "boolean"
14
+ },
15
+ "review_state": {
16
+ "type": "string",
17
+ "enum": ["pending", "approved", "changes_requested"]
18
+ },
19
+ "approved_by": {
20
+ "type": "array",
21
+ "items": {
22
+ "type": "string"
23
+ },
24
+ "description": "the login of each reviewer whose latest deciding review approves"
25
+ },
26
+ "card": {
27
+ "type": ["string", "null"]
28
+ },
29
+ "commit": {
30
+ "type": "string"
31
+ },
32
+ "branch": {
33
+ "type": "string",
34
+ "description": "the head branch"
35
+ },
36
+ "head_repo": {
37
+ "description": "the repository of the head branch as owner/name, a fork's for a fork; null when it was deleted",
38
+ "type": ["string", "null"]
39
+ }
40
+ },
41
+ "required": [
42
+ "url",
43
+ "state",
44
+ "merged",
45
+ "review_state",
46
+ "approved_by",
47
+ "card",
48
+ "commit",
49
+ "branch",
50
+ "head_repo"
51
+ ]
52
+ }
@@ -0,0 +1,17 @@
1
+ # Onto the built-in `resume`: a person who decides that the Dependabot alerts of a card are not to
2
+ # be fixed gets each one dismissed at GitHub with their reason, and a note on the card that says so.
3
+ version = 1
4
+
5
+ [stages.dismiss]
6
+ needs = ["classify_intent"]
7
+ when = { path = "stages.classify_intent.output.intent", equals = "dismiss" }
8
+ agent = "dismiss"
9
+ input = { card = "trigger.card", comment = "trigger.event" }
10
+ output_schema = "schemas/answer.json"
11
+ timeout_seconds = 900
12
+
13
+ [stages.say_dismissed]
14
+ needs = ["dismiss"]
15
+ when = { path = "stages.dismiss.output.text", exists = true }
16
+ tool = "tracker__comment"
17
+ input = { card = "trigger.card.id", text = "stages.dismiss.output.text" }