-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Devin - new components #18324
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
Merged
Devin - new components #18324
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
61 changes: 61 additions & 0 deletions
61
components/devin/actions/create-knowledge/create-knowledge.mjs
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,61 @@ | ||
| import devin from "../../devin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "devin-create-knowledge", | ||
| name: "Create Knowledge", | ||
| description: "Create a new knowledge object to share information with Devin. [See the documentation](https://docs.devin.ai/api-reference/knowledge/create-knowledge)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| devin, | ||
| body: { | ||
| propDefinition: [ | ||
| devin, | ||
| "body", | ||
| ], | ||
| }, | ||
| name: { | ||
| propDefinition: [ | ||
| devin, | ||
| "name", | ||
| ], | ||
| }, | ||
| triggerDescription: { | ||
| propDefinition: [ | ||
| devin, | ||
| "triggerDescription", | ||
| ], | ||
| }, | ||
| parentFolderId: { | ||
| propDefinition: [ | ||
| devin, | ||
| "folderId", | ||
| ], | ||
| label: "Parent Folder ID", | ||
| description: "The ID of the folder to create the knowledge in", | ||
| optional: true, | ||
| }, | ||
| pinnedRepo: { | ||
| propDefinition: [ | ||
| devin, | ||
| "pinnedRepo", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.devin.createKnowledge({ | ||
| $, | ||
| data: { | ||
| body: this.body, | ||
| name: this.name, | ||
| parent_folder_id: this.parentFolderId, | ||
| trigger_description: this.triggerDescription, | ||
| pinned_repo: this.pinnedRepo, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created knowledge object: ${this.name}`); | ||
| return response; | ||
| }, | ||
| }; |
89 changes: 89 additions & 0 deletions
89
components/devin/actions/create-session/create-session.mjs
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,89 @@ | ||
| import devin from "../../devin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "devin-create-session", | ||
| name: "Create Session", | ||
| description: "Create a new session with Devin. [See the documentation](https://docs.devin.ai/api-reference/sessions/create-a-new-devin-session)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| devin, | ||
| prompt: { | ||
| type: "string", | ||
| label: "Prompt", | ||
| description: "The task description for Devin", | ||
| }, | ||
| snapshotId: { | ||
| type: "string", | ||
| label: "Snapshot ID", | ||
| description: "ID of a machine snapshot to use", | ||
| optional: true, | ||
| }, | ||
| unlisted: { | ||
| type: "boolean", | ||
| label: "Unlisted", | ||
| description: "Whether the session should be unlisted", | ||
| optional: true, | ||
| }, | ||
| idempotent: { | ||
| type: "boolean", | ||
| label: "Idempotent", | ||
| description: "Enable idempotent session creation", | ||
| optional: true, | ||
| }, | ||
| maxAcuLimit: { | ||
| type: "integer", | ||
| label: "Max ACU Limit", | ||
| description: "Maximum ACU limit for the session", | ||
| optional: true, | ||
| }, | ||
| secretIds: { | ||
| propDefinition: [ | ||
| devin, | ||
| "secretIds", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| knowledgeIds: { | ||
| propDefinition: [ | ||
| devin, | ||
| "knowledgeId", | ||
| ], | ||
| type: "string[]", | ||
| label: "Knowledge IDs", | ||
| description: "The IDs of the knowledge objects to use", | ||
| optional: true, | ||
| }, | ||
| tags: { | ||
| type: "string[]", | ||
| label: "Tags", | ||
| description: "List of tags to add to the session", | ||
| optional: true, | ||
| }, | ||
| title: { | ||
| type: "string", | ||
| label: "Title", | ||
| description: "Custom title for the session. If None, a title will be generated automatically", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.devin.createSession({ | ||
| $, | ||
| data: { | ||
| prompt: this.prompt, | ||
| snapshot_id: this.snapshotId, | ||
| unlisted: this.unlisted, | ||
| idempotent: this.idempotent, | ||
| max_acu_limit: this.maxAcuLimit, | ||
| secret_ids: this.secretIds, | ||
| knowledge_ids: this.knowledgeIds, | ||
| tags: this.tags, | ||
| title: this.title, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created session with ID: ${response.session_id}`); | ||
| return response; | ||
| }, | ||
| }; |
27 changes: 27 additions & 0 deletions
27
components/devin/actions/delete-knowledge/delete-knowledge.mjs
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,27 @@ | ||
| import devin from "../../devin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "devin-delete-knowledge", | ||
| name: "Delete Knowledge", | ||
| description: "Delete an existing knowledge object. [See the documentation](https://docs.devin.ai/api-reference/knowledge/delete-knowledge)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| devin, | ||
| knowledgeId: { | ||
| propDefinition: [ | ||
| devin, | ||
| "knowledgeId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.devin.deleteKnowledge({ | ||
| $, | ||
| knowledgeId: this.knowledgeId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully deleted knowledge object: ${this.knowledgeId}`); | ||
| return response; | ||
| }, | ||
| }; |
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,27 @@ | ||
| import devin from "../../devin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "devin-get-session", | ||
| name: "Get Session", | ||
| description: "Retrieve details about an existing session. [See the documentation](https://docs.devin.ai/api-reference/sessions/retrieve-details-about-an-existing-session)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| devin, | ||
| sessionId: { | ||
| propDefinition: [ | ||
| devin, | ||
| "sessionId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.devin.getSession({ | ||
| $, | ||
| sessionId: this.sessionId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved session: ${response.title || this.sessionId}`); | ||
| return response; | ||
| }, | ||
| }; |
20 changes: 20 additions & 0 deletions
20
components/devin/actions/list-knowledge/list-knowledge.mjs
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,20 @@ | ||
| import devin from "../../devin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "devin-list-knowledge", | ||
| name: "List Knowledge", | ||
| description: "Retrieve a list of all knowledge objects. [See the documentation](https://docs.devin.ai/api-reference/knowledge/list-knowledge)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| devin, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.devin.listKnowledge({ | ||
| $, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${response.knowledge?.length || 0} knowledge objects`); | ||
| return response; | ||
| }, | ||
| }; |
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,45 @@ | ||
| import devin from "../../devin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "devin-list-sessions", | ||
| name: "List Sessions", | ||
| description: "Retrieve a list of all sessions. [See the documentation](https://docs.devin.ai/api-reference/sessions/list-sessions)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| devin, | ||
| tags: { | ||
| type: "string[]", | ||
| label: "Tags", | ||
| description: "Filter sessions by specific tags", | ||
| optional: true, | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| label: "Limit", | ||
| description: "Maximum number of sessions to retrieve", | ||
| optional: true, | ||
| default: 100, | ||
| }, | ||
| offset: { | ||
| type: "integer", | ||
| label: "Offset", | ||
| description: "Number of sessions to skip", | ||
| optional: true, | ||
| default: 0, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.devin.listSessions({ | ||
| $, | ||
| params: { | ||
| tags: this.tags, | ||
| limit: this.limit, | ||
| offset: this.offset, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${response.sessions?.length || 0} sessions`); | ||
| return response; | ||
| }, | ||
| }; |
35 changes: 35 additions & 0 deletions
35
components/devin/actions/send-message-to-session/send-message-to-session.mjs
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,35 @@ | ||
| import devin from "../../devin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "devin-send-message-to-session", | ||
| name: "Send Message to Session", | ||
| description: "Send a message to an existing Devin session. [See the documentation](https://docs.devin.ai/api-reference/sessions/send-a-message-to-an-existing-devin-session)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| devin, | ||
| sessionId: { | ||
| propDefinition: [ | ||
| devin, | ||
| "sessionId", | ||
| ], | ||
| }, | ||
| message: { | ||
| type: "string", | ||
| label: "Message", | ||
| description: "The message to send to Devin", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.devin.sendMessageToSession({ | ||
| $, | ||
| sessionId: this.sessionId, | ||
| data: { | ||
| message: this.message, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully sent message to session ${this.sessionId}`); | ||
| return response; | ||
| }, | ||
| }; |
77 changes: 77 additions & 0 deletions
77
components/devin/actions/update-knowledge/update-knowledge.mjs
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,77 @@ | ||
| import devin from "../../devin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "devin-update-knowledge", | ||
| name: "Update Knowledge", | ||
| description: "Update an existing knowledge object. [See the documentation](https://docs.devin.ai/api-reference/knowledge/update-knowledge)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| devin, | ||
| knowledgeId: { | ||
| propDefinition: [ | ||
| devin, | ||
| "knowledgeId", | ||
| ], | ||
| }, | ||
| body: { | ||
| propDefinition: [ | ||
| devin, | ||
| "body", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| name: { | ||
| propDefinition: [ | ||
| devin, | ||
| "name", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| triggerDescription: { | ||
| propDefinition: [ | ||
| devin, | ||
| "triggerDescription", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| parentFolderId: { | ||
| propDefinition: [ | ||
| devin, | ||
| "folderId", | ||
| ], | ||
| label: "Parent Folder ID", | ||
| description: "The ID of the folder to create the knowledge in", | ||
| optional: true, | ||
| }, | ||
| pinnedRepo: { | ||
| propDefinition: [ | ||
| devin, | ||
| "pinnedRepo", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { knowledge } = await this.devin.listKnowledge({ | ||
| $, | ||
| }); | ||
|
|
||
| const current = knowledge.find(({ id }) => id === this.knowledgeId); | ||
|
|
||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const response = await this.devin.updateKnowledge({ | ||
| $, | ||
| knowledgeId: this.knowledgeId, | ||
| data: { | ||
| body: this.body || current.body, | ||
| name: this.name || current.name, | ||
| trigger_description: this.triggerDescription || current.trigger_description, | ||
| parent_folder_id: this.parentFolderId || current.parent_folder_id, | ||
| pinned_repo: this.pinnedRepo || current.pinned_repo, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully updated knowledge object: ${this.knowledgeId}`); | ||
| return response; | ||
| }, | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
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.