generated from ubiquity-os/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from sshivaditya2019/development
- Loading branch information
Showing
14 changed files
with
277 additions
and
102 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,52 @@ | ||
name: "@ubiquity-os-marketplace/command-ask" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
stateId: | ||
description: "State Id" | ||
eventName: | ||
description: "Event Name" | ||
eventPayload: | ||
description: "Event Payload" | ||
settings: | ||
description: "Settings" | ||
authToken: | ||
description: "Auth Token" | ||
ref: | ||
description: "Ref" | ||
signature: | ||
description: "Signature sent from the Kernel" | ||
|
||
jobs: | ||
compute: | ||
name: "LLM Reply" | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
env: | ||
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | ||
VOYAGEAI_API_KEY: ${{ secrets.VOYAGEAI_API_KEY }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
UBIQUITY_OS_APP_NAME: ${{ secrets.UBIQUITY_OS_APP_NAME }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.10.0" | ||
|
||
- name: install dependencies | ||
run: yarn | ||
|
||
- name: execute directive | ||
run: yarn tsx ./src/main.ts | ||
id: command-ask | ||
env: | ||
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | ||
VOYAGEAI_API_KEY: ${{ secrets.VOYAGEAI_API_KEY }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
UBIQUITY_OS_APP_NAME: ${{ secrets.UBIQUITY_OS_APP_NAME }} |
This file contains 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,21 @@ | ||
name: Update Manifest and Commit Changes | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
update-manifest: | ||
name: "Update Manifest and Commit Changes" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Update Manifest and Commit Changes | ||
uses: ubiquity-os/action-deploy-plugin@main | ||
with: | ||
manifestPath: ${{ github.workspace }}/manifest.json | ||
schemaPath: ${{ github.workspace }}/src/types/plugin-input.ts | ||
pluginEntry: ${{ github.workspace }}/src/plugin.ts | ||
commitMessage: "chore: updated manifest.json and dist build" | ||
nodeVersion: "20.10.0" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,39 @@ | ||
import * as core from "@actions/core"; | ||
import * as github from "@actions/github"; | ||
import { Value } from "@sinclair/typebox/value"; | ||
import { envSchema } from "./types/env"; | ||
import { pluginSettingsSchema, PluginInputs, pluginSettingsValidator } from "./types"; | ||
import { plugin } from "./plugin"; | ||
|
||
/** | ||
* How a GitHub action executes the plugin. | ||
*/ | ||
export async function run() { | ||
const payload = github.context.payload.inputs; | ||
const env = Value.Decode(envSchema, process.env); | ||
const settings = Value.Decode(pluginSettingsSchema, Value.Default(pluginSettingsSchema, JSON.parse(payload.settings))); | ||
|
||
if (!pluginSettingsValidator.test(settings)) { | ||
throw new Error("Invalid settings provided"); | ||
} | ||
|
||
const inputs: PluginInputs = { | ||
stateId: payload.stateId, | ||
eventName: payload.eventName, | ||
eventPayload: JSON.parse(payload.eventPayload), | ||
settings, | ||
authToken: payload.authToken, | ||
ref: payload.ref, | ||
}; | ||
|
||
await plugin(inputs, env); | ||
} | ||
|
||
run() | ||
.then((result) => { | ||
core.setOutput("result", result); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
core.setFailed(error); | ||
}); |
This file contains 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
This file contains 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
Oops, something went wrong.