ubq-testing / ask-plugin

0 stars 0 forks source link

onboarding bot QA #2

Open Keyrxng opened 1 month ago

Keyrxng commented 1 month ago

@ubqbot the rpc-handler sounds awesome what is it?

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquity/rpc-handler}", "content_plaintext": "@ubiquity-dao/rpc-handler Why use this package? No more slow RPCs : No more slow RPCs, no more failed requests, no more headaches Fastest RPCs : Returns the fastest RPC for a given network ID Fallback mechanism : Retries failed method calls on the next fastest provider Retries failed method calls : Retries failed method calls on the next fastest provider No more searching for RPCs : No need to for an RPC URL again, just pass the network ID Fully configurable : Configure the number of retries, retry delay, log tier and more Browser and Node.js support : Can be used in both the browser and Node.js Local storage cache : Stores the fastest RPCs for a given network ID in the browser's local storage Drop-in replacement : No changes required to your existing codebase, just replace your current provider with the one returned by RPCHandler.getFastestRpcProvider() No tracking or analytics : No additional tracking, data collection or analytics performed by this package beyond the specific public endpoints that support those features Installation yarn add @ubiquity-dao/rpc-handler Usage Config options with null are optional, but still need to be passed as null import { RPCHandler, HandlerConstructorConfig } from \"@ubiquity-dao/rpc-handler/\"; export function useHandler(networkId: number) { const config: HandlerConstructorConfig = { networkId: 100, // your chosen networkId networkName: null, // will default using the networkRpcs networkRpcs: null, // e.g \"https://mainnet.infura.io/...\" runtimeRpcs: null, // e.g \"__https://mainnet.infura.io/...\" > \"1__https://mainnet.infura.io/...\" autoStorage: true, // browser only, will store in localStorage cacheRefreshCycles: 10, // bad RPCs are excluded if they fail, this is how many cycles before they're re-tested rpcTimeout: 1500, // when the RPCs are tested they are raced, this is the max time to allow for a response tracking: \"yes\", // accepted values: \"yes\" | \"limited\" | \"none\". This is the data tracking status of the RPC, not this package. proxySettings: { retryCount: 3, // how many times we'll loop the list of RPCs retrying the request before failing retryDelay: 100, // (ms) how long we'll wait before moving to the next RPC, best to keep this low logTier: \"ok\", // |\"info\"|\"error\"|\"debug\"|\"fatal\"|\"verbose\"; set to \"none\" for no logs, null will default to \"error\", \"verbose\" will log all logger: null, // null will default to PrettyLogs strictLogs: true, // true, only the specified logTier will be logged and false all wll be logged. moduleName?: \"[UBQ RPC Handler]\", // Can be omitted. this is the prefix for the logs. disabled?: false, // Can be omitted. this will disable the proxy, requiring you to handle retry logic etc yourself. } }; // No RPCs are tested at this point return new RPCHandler(config); } import { useHandler } from \"./rpc-handler\"; const handler = useHandler(networkId); // Now the RPCs are tested app.provider = await handler.getFastestRpcProvider(); Notes The RPCs are not tested on instantiation, but are tested on each call to handler.getFastestRpcProvider() or handler.testRpcPerformance() See the full config object (optionally passed in the constructor) for more options LocalStorage is not enabled by default, but can be enabled by passing autoStorage: true in the config object Use the returned JsonRpcProvider object as you would normally, internally, any call you pass through it will be retried on the next fastest provider if it fails. It should only ever really throw due to user error or a network issue. Testing Build the package: yarn build In terminal A run the following command to start a local Anvil instance: yarn test:anvil In terminal B run the following command to run the tests: yarn test Say goodbye to slow RPCs This packages leverages Chainlist's network RPC list to return the lowest latency provider from the list for any given network ID. Creating a runtime/local storage cache of the fastest RPCs, it can be used in both the browser and Node.js. By default, it performs as an abstraction layer for the Web3 developer by having built-in failed method call retries,bad endpoint exclusion and a cache of the fastest RPCs for a given network ID. It serves as a drop-in replacement for any JsonRpcProvider and can be extended to handle custom RPCs, chains and more. By routing requests through this package, it ensures the lowest latency for your users, while also providing a fallback mechanism for when the fastest provider fails. As even the best of nodes can fail, it retries failed method calls on the next fastest provider and so on until it succeeds or until your custom breakpoints are reached. With the ability to configure the number of retries, retry delay, log tier, breakpoints and more, it can be tailored to your specific needs. There is no additional tracking, data collection or analytics performed by this package beyond the specific public endpoints that support those features. These will be made filterable in the future. Calls are made directly to the RPCs and the only data stored is the Record of RPCs for a given network ID, which can be stored in the browser's local storage for faster retrieval. No changes are required to your existing codebase, simply replace your current provider with the one returned by RPCHandler.getFastestRpcProvider() and you're good to go. While all attempts are made to ensure the fastest provider is always used, it's important to note that the fastest provider can change over time, so it's recommended to call RPCHandler.getFastestRpcProvider() at the start of your app or at regular intervals. Also, it is possible that all providers fail, in which case the package will throw an error. No more slow RPCs, no more failed requests, no more headaches.", "similarity": 0.760056824690918 }, { "source_id": "readme-ubiquity/ubiquibot-config}", "content_plaintext": "ubiquibot-config", "similarity": 0.693140648977835 }, { "source_id": "readme-ubiquibot/ubiquibot-config}", "content_plaintext": "ubiquibot-config", "similarity": 0.693140648977835 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\n@ubiquity-dao/rpc-handler Why use this package? No more slow RPCs : No more slow RPCs, no more failed requests, no more headaches Fastest RPCs : Returns the fastest RPC for a given network ID Fallback mechanism : Retries failed method calls on the next fastest provider Retries failed method calls : Retries failed method calls on the next fastest provider No more searching for RPCs : No need to for an RPC URL again, just pass the network ID Fully configurable : Configure the number of retries, retry delay, log tier and more Browser and Node.js support : Can be used in both the browser and Node.js Local storage cache : Stores the fastest RPCs for a given network ID in the browser's local storage Drop-in replacement : No changes required to your existing codebase, just replace your current provider with the one returned by RPCHandler.getFastestRpcProvider() No tracking or analytics : No additional tracking, data collection or analytics performed by this package beyond the specific public endpoints that support those features Installation yarn add @ubiquity-dao/rpc-handler Usage Config options with null are optional, but still need to be passed as null import { RPCHandler, HandlerConstructorConfig } from \"@ubiquity-dao/rpc-handler/\"; export function useHandler(networkId: number) { const config: HandlerConstructorConfig = { networkId: 100, // your chosen networkId networkName: null, // will default using the networkRpcs networkRpcs: null, // e.g \"https://mainnet.infura.io/...\" runtimeRpcs: null, // e.g \"__https://mainnet.infura.io/...\" > \"1__https://mainnet.infura.io/...\" autoStorage: true, // browser only, will store in localStorage cacheRefreshCycles: 10, // bad RPCs are excluded if they fail, this is how many cycles before they're re-tested rpcTimeout: 1500, // when the RPCs are tested they are raced, this is the max time to allow for a response tracking: \"yes\", // accepted values: \"yes\" | \"limited\" | \"none\". This is the data tracking status of the RPC, not this package. proxySettings: { retryCount: 3, // how many times we'll loop the list of RPCs retrying the request before failing retryDelay: 100, // (ms) how long we'll wait before moving to the next RPC, best to keep this low logTier: \"ok\", // |\"info\"|\"error\"|\"debug\"|\"fatal\"|\"verbose\"; set to \"none\" for no logs, null will default to \"error\", \"verbose\" will log all logger: null, // null will default to PrettyLogs strictLogs: true, // true, only the specified logTier will be logged and false all wll be logged. moduleName?: \"[UBQ RPC Handler]\", // Can be omitted. this is the prefix for the logs. disabled?: false, // Can be omitted. this will disable the proxy, requiring you to handle retry logic etc yourself. } }; // No RPCs are tested at this point return new RPCHandler(config); } import { useHandler } from \"./rpc-handler\"; const handler = useHandler(networkId); // Now the RPCs are tested app.provider = await handler.getFastestRpcProvider(); Notes The RPCs are not tested on instantiation, but are tested on each call to handler.getFastestRpcProvider() or handler.testRpcPerformance() See the full config object (optionally passed in the constructor) for more options LocalStorage is not enabled by default, but can be enabled by passing autoStorage: true in the config object Use the returned JsonRpcProvider object as you would normally, internally, any call you pass through it will be retried on the next fastest provider if it fails. It should only ever really throw due to user error or a network issue. Testing Build the package: yarn build In terminal A run the following command to start a local Anvil instance: yarn test:anvil In terminal B run the following command to run the tests: yarn test Say goodbye to slow RPCs This packages leverages Chainlist's network RPC list to return the lowest latency provider from the list for any given network ID. Creating a runtime/local storage cache of the fastest RPCs, it can be used in both the browser and Node.js. By default, it performs as an abstraction layer for the Web3 developer by having built-in failed method call retries,bad endpoint exclusion and a cache of the fastest RPCs for a given network ID. It serves as a drop-in replacement for any JsonRpcProvider and can be extended to handle custom RPCs, chains and more. By routing requests through this package, it ensures the lowest latency for your users, while also providing a fallback mechanism for when the fastest provider fails. As even the best of nodes can fail, it retries failed method calls on the next fastest provider and so on until it succeeds or until your custom breakpoints are reached. With the ability to configure the number of retries, retry delay, log tier, breakpoints and more, it can be tailored to your specific needs. There is no additional tracking, data collection or analytics performed by this package beyond the specific public endpoints that support those features. These will be made filterable in the future. Calls are made directly to the RPCs and the only data stored is the Record of RPCs for a given network ID, which can be stored in the browser's local storage for faster retrieval. No changes are required to your existing codebase, simply replace your current provider with the one returned by RPCHandler.getFastestRpcProvider() and you're good to go. While all attempts are made to ensure the fastest provider is always used, it's important to note that the fastest provider can change over time, so it's recommended to call RPCHandler.getFastestRpcProvider() at the start of your app or at regular intervals. Also, it is possible that all providers fail, in which case the package will throw an error. No more slow RPCs, no more failed requests, no more headaches.=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

The rpc-handler is a utility designed to optimize RPC (Remote Procedure Call) performance by returning the fastest RPC for a given network. It automatically retries failed requests on the next fastest provider and can store results locally. Its key features include:

You can easily integrate it by calling:

const handler = new RPCHandler(config);
app.provider = await handler.getFastestRpcProvider();

This package ensures your application makes the fastest possible RPC calls with fallback mechanisms in case of provider failure.

Keyrxng commented 1 month ago

@ubqbot what is conversation rewards I don't understand

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquity-os-marketplace/conversation-rewards}", "content_plaintext": "@ubiquibot/conversation-rewards As of 28 February: test driven development to aggregate all necessary information based on a URL to an issue. pass in closed as complete issue URL and receive all the timeline events and activities of all humans who helped close the issue as complete. most importantly: this can inherit bot authentication and link pull requests to issues in private repositories. Be sure to review all *.test.* files for implementation details. Data structure { \"userName\": { \"total\": 40.5, \"task\": { \"reward\": 37.5, \"multiplier\": 1 }, \"comments\": [ { \"content\": \"comment content\", \"url\": \"https://url-to-item\", \"type\": 18, \"score\": { \"formatting\": { \"content\": { \"p\": { \"count\": 16, \"score\": 1 } }, \"wordValue\": 0.1, \"multiplier\": 1 }, \"reward\": 0.8, \"relevance\": 0.5 } } ] } } Reward formula: \\sum_{i=0}^{n} \\left( \\sum_{j=0}^{n} \\left(\\text{wordCount}^{exponent} \\times \\text{wordValue} \\times \\text{relevance}\\right) + \\left(\\text{score} \\times \\text{elementCount}\\right) \\right) \\times multiplier + \\text{task.reward} = \\text{total} Plugin configuration Here is a possible valid configuration to enable this plugin. See these files for more details. plugin: ubiquibot/conversation-rewards with: logLevel: \"info\" evmNetworkId: 100 evmPrivateEncrypted: \"encrypted-key\" erc20RewardToken: \"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d\" dataCollection: maxAttempts: 10 delayMs: 10000 incentives: requirePriceLabel: true contentEvaluator: openAi: model: \"gpt-4o\" endpoint: \"https://api.openai.com/v1\" multipliers: - role: [ISSUE_SPECIFICATION] relevance: 1 - role: [PULL_AUTHOR] relevance: 1 - role: [PULL_ASSIGNEE] relevance: 1 - role: [PULL_COLLABORATOR] relevance: 1 - role: [PULL_CONTRIBUTOR] relevance: 1 userExtractor: redeemTask: true dataPurge: {} formattingEvaluator: multipliers: - role: [ ISSUE_SPECIFICATION ] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 scores: # Scores can be set for each item differently br: 0 code: 1 p: 1 em: 0 img: 0 strong: 0 blockquote: 0 h1: 1 h2: 1 h3: 1 h4: 1 h5: 1 h6: 1 a: 1 li: 1 ul: 1 td: 1 hr: 0 - role: [ISSUE_AUTHOR] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.2 - role: [ISSUE_ASSIGNEE] multiplier: 0 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0 - role: [ISSUE_COLLABORATOR] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 - role: [ISSUE_CONTRIBUTOR] multiplier: 0.25 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 - role: [PULL_SPECIFICATION] multiplier: 0 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0 - role: [PULL_AUTHOR] multiplier: 2 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.2 - role: [PULL_ASSIGNEE] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 - role: [PULL_COLLABORATOR] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 - role: [PULL_CONTRIBUTOR] multiplier: 0.25 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 permitGeneration: {} githubComment: post: true debug: false How to encrypt the evmPrivateEncrypted parameter Partner private key (evmPrivateEncrypted config param in conversation-rewards plugin) supports 2 formats: PRIVATE_KEY:GITHUB_OWNER_ID PRIVATE_KEY:GITHUB_OWNER_ID:GITHUB_REPOSITORY_ID Here GITHUB_OWNER_ID can be: Github organization id (if ubiquibot is used within an organization) Github user id (if ubiquibot is simply installed in a user's repository) Format PRIVATE_KEY:GITHUB_OWNER_ID restricts in which particular organization (or user related repositories)this private key can be used. It can be set either in the organization wide config either in the repository wide one. Format PRIVATE_KEY:GITHUB_OWNER_ID:GITHUB_REPOSITORY_ID restricts organization (or user related repositories) and a particular repository where private key is allowed to be used. How to encrypt for you local organization for testing purposes: Get your organization (or user) id curl -H \"Accept: application/json\" -H \"Authorization: token GITHUB_PAT_TOKEN\" https://api.github.com/orgs/ubiquity Open https://keygen.ubq.fi/ Click \"Generate\" to create a new x25519_PRIVATE_KEY (which will be used in the conversation-rewards plugin to decrypt encrypted wallet private key) Input a string in the format PRIVATE_KEY:GITHUB_OWNER_ID in the PLAIN_TEXT UI text input where: PRIVATE_KEY: your ethereum wallet private key without the 0x prefix GITHUB_OWNER_ID: your github organization id or user id (which you got from step 1) Click \"Encrypt\" to get an encrypted value in the CIPHER_TEXT field Set the encrypted text (from step 5) in the evmPrivateEncrypted config parameter Set X25519_PRIVATE_KEY environment variable in github secrets of your forked instance of the conversation-rewards plugin", "similarity": 0.741019650758485 }, { "source_id": "readme-ubiquibot/.github}", "content_plaintext": "Repositories: Service Purpose Language External Integration Database Infrastructure org: ubiquibot 1. ubiquibot/conversation-rewards Service: Conversation Reward Module Purpuse: This is intended to be the proper implementation of comment incentives, based on our learnings from the first go-around. Language: TypeScript External Integration: Github Action, Github API Database: None 2. ubiquibot/permit-generation Service: Permit Generation module Purpuse: The purpose of this module is to isolate the bot's payment capabilities. This can be directly invoked from other plugins Language: TypeScript External Integration: ENS Database: Supabase 3. ubiquibot/assistive-pricing Service: Assistive Pricing module Purpose: Assistive pricing is essential for product owners and other managers to instantly set a price for any task. In the current implementation, it is a simple, but fully configurable lookup table between the Priority level and the Time estimate. It also allows for projects to set a “base rate” so that specific projects can have a configurable multiplier to reflect its importance to the organization’s overarching strategic objectives. External Integration: Database: Supabase 4. ubiquibot/comment-incentives Deprecated in favor of @ubiquibot/conversation-rewards Service: Comment Incentives module Purpose: Split reward to the collaborators who wrote some comments Language: Typescript External Integration: Database: None (Supabase, TODO: get the assignee multiplier from the database) 5. ubiquibot/plugins-wishlist Service: not a service Purpose: Wishlist of the future plugins 6. ubiquibot/configuration Service: not a service Purpose: Helpers to parse and merge configuration files for Ubiquibot. 5. ubiquibot/e2e-tests deprecated Service: not a service Purpose: Use this for end-to-end tests. 6. ubiquibot/sandbox Service: Sandbox Environment Purpose: This is a sandbox environment for new users to try out the bot. Try setting one Priority and one Time label to see the assistive pricing capabilities. Try the bot commands as a comment in an issue. 7. ubiquibot/production Service: Production Environment Purpose: ubiquibot production environment Language: Typescript External Integration: Database: None org: ubiquity 1. ubiquity/devpool-directory Service: DevPool - Bounties Directory Purpose: DevPool open bounties. Subscribe to notifications to see new available bounties. Database: None External Integration: 2. ubiquity/pay.ubq.fi Service: Generate and claim spender permits (EIP-2612) Purpose: Tool for generating offline permits for bounty hunters to withdraw their payments. 3. ubiquity/ubiquity-dollar Service: Ubiquity Dollar (uAD) smart contracts and user interface. Purpose: Introducing the flagship product of Ubiquity DAO. The Ubiquity Dollar (uAD) is a collateralized stablecoin. Language: Typescript, Solidity External Integration: Ethereum 4. ubiquity/cloudflare-deploy-action Service: Cloudflare deploy action Purpose: A reusable, and automatic Cloudflare deploy for instant previews across @ubiquity repositories. Language: TypeScript External Integration: Github Action 5. ubiquity/work.ubq.fi Service: User interface Purpose: A user interface for https://github.com/ubiquity/devpool-directory/issues External Integration: cloudflare 6. ubiquity/ubiquibot Will be deprecated soon Service: Ubiquibot Purpose: Ubiquity DAO's GitHub Bot for Automating DevPool Management. Main repo for the bot development. Database: Supabase 7. ubiquity/ts-template Purpose: A template repository for all @ubiquity projects. Language: Typescript 8. ubiquity/rpc-handler Service: RPC Handler NPM Package Purpose: This packages leverages Chainlist's network RPC list to return the lowest latency provider from the list for any given network ID. 9. ubiquity/onboard.ubq.fi Purpose: Generates the configuration for organizations, by creating a default configuration and creating a repository under the given Organization. 10. ubiquity/audit.ubq.fi Purpose: 11. ubiquity/ubiquibot-kernel Purpose: Interface with plugins (GitHub Actions) for longer running processes. Run on Cloudflare Workers. Infrastructure: Cloudflare Workers Database: Cloudflare KV 12. ubiquity/ubiquibot-telegram Purpose: This project allows you to deploy a TelegramXChatGPT auto bounty issue creator using Cloudflare Workers and wrangler. Database: Supabase", "similarity": 0.66087895580044 }, { "source_id": "readme-ubiquity/ubiquibot}", "content_plaintext": "UbiquiBot (deprecated) [!CAUTION]This repository is not used anymore, see instead https://github.com/ubiquity/ubiquibot-kernel Ubiquity DAO's GitHub Bot for Automating DevPool Management. Table of Contents Quickstart Environment Variables Overview How to Use Configuration How to Run Locally Supabase Database Logs Payments Permits in a Local Instance How to QA Additions to the Bot How to Create a New Release Architecture Overview Default Config Notes (ubiquibot-config-default.ts) Quickstart #!/bin/bash git clone https://github.com/ubiquity/ubiquibot.git cd ubiquibot bun bun tsc (to compile your changes) bun tsc --watch (to locally auto compile your changes) bun start:watch ## It's recommended to split terminals in your IDE while running above input Environment Variables Copy .env.example to .env (do not rename .env.example, just make a copy) Update the following fields on .env: SUPABASE_URL: Add your Supabase project URL. SUPABASE_KEY: Add your Supabase project API key. FOLLOWUP_TIME: (optional) Set a custom follow-up time (default: 4 days). DISQUALIFY_TIME: (optional) Set a custom disqualify time (default: 7 days). OPENAI_API_HOST: (optional) Set OpenAI host url (default: https://api.openai.com). OPENAI_API_KEY: Set OpenAI key. CHATGPT_USER_PROMPT_FOR_IMPORTANT_WORDS: (optional) Set a custom user prompt for finding important words(default: \"I need your help to find important words (e.g. unique adjectives) from github issue below and I want to parse them easily so please separate them using #(No other contexts needed). Please separate the words by # so I can parse them easily. Please answer simply as I only need the important words. Here is the issue content.\\n\"). CHATGPT_USER_PROMPT_FOR_MEASURE_SIMILARITY: (optional) Set a custom user prompt for measuring similarity(default: 'I have two github issues and I need to measure the possibility of the 2 issues are the same content (No other contents needed and give me only the number in %).\\n Give me in number format and add % after the number.\\nDo not tell other things since I only need the number (e.g. 85%). Here are two issues:\\n 1. \"%first%\"\\n2. \"%second%\"'). SIMILARITY_THRESHOLD: (optional) Set similarity threshold (default: 80). MEASURE_SIMILARITY_AI_TEMPERATURE: (optional) Set ChatGPT temperature for measuring similarity (default: 0). IMPORTANT_WORDS_AI_TEMPERATURE: (optional) Set ChatGPT temperature for finding important words (default: 0). WEBHOOK_PROXY_URL: (required) should be automatically filled when you install UbiquiBot WEBHOOK_SECRET: (required) should be automatically filled when the app is installed APP_ID and PRIVATE_KEY are here for core team developers to use. If you are an external developer, APP_IDand PRIVATE_KEY are automatically generated when you install the app on your repository. How to run locally Register a new Github App Should output: setup You may proceed to go to http://localhost:3000 and you should see setup1 Click on Register a Github App setup3 Provide the bot a name setup3 setup4 Select a handle where to install the bot Select in which repo the bot shall be available setup6 After following the steps you should see setup7 Restart the server for the installation to take effect setup10 After aforemention steps then installation shall be complete setup11 Seeing this page below after hitting http://localhost:3000 again? trylocal Congratulations! you successfully installed UbiquiBot (new or to an existing app) Update an Existing Github App (bot) After you hit http://localhost:3000 you have the option to edit an existing app (if you think you have already registered a bot and when to reuse that same app) existing on your Github settings hit to: repoaccess hen at the same time hit to \"APP SETTINGS\" Update the WebHook URL by the one auto-provided by the bot's installation page (this is a must) and edit the webhook secret that you'll use at .env secret Update APP_ID at .env accordingly ubiqui In the same page it is super important that you re-generated and save a private key that you'll be using at .env you open the file and paste it logo The Good News it's after you install the bot by using an existing app you'll get success Important things with private keys (.pem) at .env The private key gets automatically filled after the app is installed to a github handle but not as an existing app The private key cannot be separated in spaces The private key is a string into its env var rather than a just opened info without \"\" otherwise it will not be recognized and you'll get unauthorized access Note: When setting up the project, please do not rename the .env.example file to .env as it will delete the environment example from the repository.Instead, it is recommended to make a copy of the .env.example file and replace the values with the appropriate ones. Overview This bot is available as a GitHub Action. The code must be compiled using @vercel/ncc because all the dependencies (e.g. node_modules) must be included and committed on the repository for the GitHub Actions runner to use. How to use Go to the UbiquiBot App Marketplace Choose a plan and install UbiquiBot on your repository Congratulations! You can now use the UbiquiBot to manage your tasks. To test the bot, you can: Create a new issue Add a time label, ex: Time: 20.10.0 && bun Open 2 terminal instances: in one instance run bun tsc --watch (compiles the Typescript code) in another instance run bun start:watch (runs the bot locally) Open http://localhost:3000 and follow instructions to add the bot to one of your repositories. At this point the .env files auto-fill the empty fields (PRIVATE_KEY and APP_ID) if it is not previously filled.Now you can make changes to the repository on GitHub (e.g. add a task) and the bot should react. After adding the bot (as a installed app) to your github you will need to restart the aforementioned bun start:watch`` so CTRL-C to stop the node daemon and bun start:watch` again You can, for example: Create a new issue Add a time label, ex: Time: ├── bin: Binary file and action file compiled by @vercel/ncc├── docs: Documentations├── src : Main source code├── supabase: Supabase migrations and configuration file /src ├── adapters: A set of interaces to interact with 3rd party libraries such as Telegraf, supabase-js. It consists of a set of small functions bulit on top of a specific library. Every adapter needs to be for calling a specific method of the library.|├── bindings: A set of listeners to bind/process requests emitted by GitHub. It also has a function to load a project configuration.|├── configs: Constants and default config values used to create a bot configuration in case we're missing any needed configuration parameters from both .env and config file.|├── handlers: A set of event-based processors. Each handler processes a specific request and it may consist of pre, action and post handlers. A pre handler would be running in prior to the main action which needs to be shorter not to affect the main handler's process. A post handler would be running as soon as the main handler gets completed. It has no limitation on its completion time. For example, it could be an example of pre-handler to create missing price labels because if we don't have necessary labels created already on the repo, labeling non-exists labels would definitely throw.|├── types A set of schema and type definitions. Why do we need schema? because we want to validate the unknown input and throw the error before the main execution.| ├── helpers A set of schema and type definitions. Why do we need schema? because we want to validate the unknown input and throw the error before the main execution. ├── utils A set of utility functions Default Config Notes (ubiquibot-config-default.ts) We can't use a jsonc file due to limitations with Netlify. Here is a snippet of some values with notes next to them. { \"payment-permit-max-price\": 9007199254740991, // Number.MAX_SAFE_INTEGER \"max-concurrent-assigns\": 9007199254740991, // Number.MAX_SAFE_INTEGER \"comment-element-pricing\": { /* https://github.com/syntax-tree/mdast#nodes */ \"strong\": 0 // Also includes italics, unfortunately https://github.com/syntax-tree/mdast#strong /* https://github.com/syntax-tree/mdast#gfm */ } } Supabase Cron Job (logs-cleaner) Dashboard > Project > Database > Extensions Search PG_CRON and Enable it. Dashboard > Project > SQL Editor -- Runs everyday at 03:00 AM to cleanup logs that are older than a week -- Use the cron time format to modify the trigger time if necessary select cron.schedule ( 'logs-cleaner', -- Job name '0 3 * * *', -- Everyday at 03:00 AM $$DELETE FROM logs WHERE timestamp", "similarity": 0.626979425785473 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n2384570894 Keyrxng: @ubqbot what is conversation rewards I don't understand\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\n@ubiquibot/conversation-rewards As of 28 February: test driven development to aggregate all necessary information based on a URL to an issue. pass in closed as complete issue URL and receive all the timeline events and activities of all humans who helped close the issue as complete. most importantly: this can inherit bot authentication and link pull requests to issues in private repositories. Be sure to review all *.test.* files for implementation details. Data structure { \"userName\": { \"total\": 40.5, \"task\": { \"reward\": 37.5, \"multiplier\": 1 }, \"comments\": [ { \"content\": \"comment content\", \"url\": \"https://url-to-item\", \"type\": 18, \"score\": { \"formatting\": { \"content\": { \"p\": { \"count\": 16, \"score\": 1 } }, \"wordValue\": 0.1, \"multiplier\": 1 }, \"reward\": 0.8, \"relevance\": 0.5 } } ] } } Reward formula: \\sum_{i=0}^{n} \\left( \\sum_{j=0}^{n} \\left(\\text{wordCount}^{exponent} \\times \\text{wordValue} \\times \\text{relevance}\\right) + \\left(\\text{score} \\times \\text{elementCount}\\right) \\right) \\times multiplier + \\text{task.reward} = \\text{total} Plugin configuration Here is a possible valid configuration to enable this plugin. See these files for more details. plugin: ubiquibot/conversation-rewards with: logLevel: \"info\" evmNetworkId: 100 evmPrivateEncrypted: \"encrypted-key\" erc20RewardToken: \"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d\" dataCollection: maxAttempts: 10 delayMs: 10000 incentives: requirePriceLabel: true contentEvaluator: openAi: model: \"gpt-4o\" endpoint: \"https://api.openai.com/v1\" multipliers: - role: [ISSUE_SPECIFICATION] relevance: 1 - role: [PULL_AUTHOR] relevance: 1 - role: [PULL_ASSIGNEE] relevance: 1 - role: [PULL_COLLABORATOR] relevance: 1 - role: [PULL_CONTRIBUTOR] relevance: 1 userExtractor: redeemTask: true dataPurge: {} formattingEvaluator: multipliers: - role: [ ISSUE_SPECIFICATION ] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 scores: # Scores can be set for each item differently br: 0 code: 1 p: 1 em: 0 img: 0 strong: 0 blockquote: 0 h1: 1 h2: 1 h3: 1 h4: 1 h5: 1 h6: 1 a: 1 li: 1 ul: 1 td: 1 hr: 0 - role: [ISSUE_AUTHOR] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.2 - role: [ISSUE_ASSIGNEE] multiplier: 0 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0 - role: [ISSUE_COLLABORATOR] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 - role: [ISSUE_CONTRIBUTOR] multiplier: 0.25 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 - role: [PULL_SPECIFICATION] multiplier: 0 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0 - role: [PULL_AUTHOR] multiplier: 2 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.2 - role: [PULL_ASSIGNEE] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 - role: [PULL_COLLABORATOR] multiplier: 1 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 - role: [PULL_CONTRIBUTOR] multiplier: 0.25 rewards: regex: \"\\\\b\\\\w+\\\\b\": 0.1 permitGeneration: {} githubComment: post: true debug: false How to encrypt the evmPrivateEncrypted parameter Partner private key (evmPrivateEncrypted config param in conversation-rewards plugin) supports 2 formats: PRIVATE_KEY:GITHUB_OWNER_ID PRIVATE_KEY:GITHUB_OWNER_ID:GITHUB_REPOSITORY_ID Here GITHUB_OWNER_ID can be: Github organization id (if ubiquibot is used within an organization) Github user id (if ubiquibot is simply installed in a user's repository) Format PRIVATE_KEY:GITHUB_OWNER_ID restricts in which particular organization (or user related repositories)this private key can be used. It can be set either in the organization wide config either in the repository wide one. Format PRIVATE_KEY:GITHUB_OWNER_ID:GITHUB_REPOSITORY_ID restricts organization (or user related repositories) and a particular repository where private key is allowed to be used. How to encrypt for you local organization for testing purposes: Get your organization (or user) id curl -H \"Accept: application/json\" -H \"Authorization: token GITHUB_PAT_TOKEN\" https://api.github.com/orgs/ubiquity Open https://keygen.ubq.fi/ Click \"Generate\" to create a new x25519_PRIVATE_KEY (which will be used in the conversation-rewards plugin to decrypt encrypted wallet private key) Input a string in the format PRIVATE_KEY:GITHUB_OWNER_ID in the PLAIN_TEXT UI text input where: PRIVATE_KEY: your ethereum wallet private key without the 0x prefix GITHUB_OWNER_ID: your github organization id or user id (which you got from step 1) Click \"Encrypt\" to get an encrypted value in the CIPHER_TEXT field Set the encrypted text (from step 5) in the evmPrivateEncrypted config parameter Set X25519_PRIVATE_KEY environment variable in github secrets of your forked instance of the conversation-rewards plugin=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

Explanation of "Conversation Rewards"

"Conversation Rewards" refers to a plugin or feature that calculates and allocates rewards based on contributions to a conversation (such as a GitHub issue or pull request). Key contributors to the conversation are rewarded based on the meaningfulness, relevance, and nature of their contributions.

Formula

The reward formula is as follows:

Total Reward = (Σ of (wordCount^exponent × wordValue × relevance) + (score × elementCount)) × multiplier + task.reward

Breakdown of Components:

Configuration

This helps objectively determine who contributed how much and reward them accordingly in projects or discussions.

Keyrxng commented 1 month ago

@ubqbot is the kernel a yarn repo?

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquity-os/ubiquity-os-kernel}", "content_plaintext": "@ubiquity/ubiquibot-kernel The kernel is designed to: Interface with plugins (GitHub Actions) for longer running processes. Run on Cloudflare Workers. Environment Variables APP_PRIVATE_KEY Obtain a private key from your GitHub App settings and convert it to the Public-Key Cryptography Standards #8 (PKCS#8) format. A new private key in PEM format can be generated and downloaded from https://github.com/organizations/{your-organization-name}/settings/apps/{your-github-app-name}. Use the following command to perform PEM to PKCS#8 conversion and append the result to your .dev.vars file: echo \"APP_PRIVATE_KEY=\\\"$(openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in YOUR_APP_PRIVATE_KEY.PEM | awk 'BEGIN{ORS=\"\\\\n\"} 1')\\\"\" >> .dev.vars Note: Replace YOUR_APP_PRIVATE_KEY.PEM with the path to your actual PEM file when running the command. APP_WEBHOOK_SECRET Set this value in both your GitHub App settings and here. APP_ID Retrieve this from your GitHub App settings. WEBHOOK_PROXY_URL (only for development) Obtain a webhook URL at smee.io and set it in your GitHub App settings. Quick Start git clone https://github.com/ubiquity/ubiquibot-kernel cd ubiquibot-kernel bun install bun dev Deploying to Cloudflare Workers Install Dependencies: Execute bun install to install the required dependencies. Create a GitHub App: Generate a GitHub App and configure its settings. Navigate to app settings and click Permissions & events. Ensure the app is subscribed to all events with the following permissions: Repository permissions: Actions: Read & Write Contents: Read & Write Issues: Read & Write Pull Requests: Read & Write Organization permissions: Members: Read only Cloudflare Account Setup: If not done already, create a Cloudflare account. Run npx wrangler login to log in. Create a KV Namespace: Generate a KV namespace using npx wrangler kv:namespace create PLUGIN_CHAIN_STATE. Copy the generated ID and paste it under [env.dev] in wrangler.toml. Manage Secrets: Add (env) secrets using npx wrangler secret put --env dev. For the private key, execute the following (replace YOUR_APP_PRIVATE_KEY.PEM with the actual PEM file path): echo $(openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in YOUR_APP_PRIVATE_KEY.PEM) | npx wrangler secret put APP_PRIVATE_KEY --env dev Deploy the Kernel: Execute bun run deploy-dev to deploy the kernel. Plugin-Kernel Input/Output Interface Input Inputs are received within the workflow, triggered by the workflow_dispatch event. The plugin is designed to handle the following inputs: interface PluginInput { stateId: string; // An identifier used to track the state of plugin chain execution in Cloudflare KV eventName: string; // The complete name of the event (e.g., `issue_comment.created`) eventPayload: any; // The payload associated with the event settings: string; // A string containing JSON with settings specific to your plugin authToken: string; // A JWT token for accessing GitHub's API to the repository where the event occurred ref: string; // A reference (branch, tag, commit SHA) indicating the version of the plugin to be utilized } Example usage: const input: PluginInput = { stateId: \"abc123\", eventName: \"issue_comment.created\", eventPayload: { /* ... */ }, settings: '{ \"key\": \"value\" }', authToken: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\", ref: \"refs/heads/main\", }; Output Data is returned using the repository_dispatch event on the plugin's repository, and the output is structured within the client_payload. The event_type must be set to return_data_to_ubiquibot_kernel. interface PluginOutput { state_id: string; // The state ID passed in the inputs must be included here output: string; // A string containing JSON with custom output, defined by the plugin itself } Example usage: const output: PluginOutput = { state_id: \"abc123\", output: '{ \"result\": \"success\", \"message\": \"Plugin executed successfully\" }', }; Plugin Quick Start The kernel supports 2 types of plugins: GitHub actions (wiki ) Cloudflare Workers (which are simple backend servers with a single API route) How to run a \"hello-world\" plugin the Cloudflare way: Run bun dev to spin up the kernel Run bun plugin:hello-world to spin up a local server for the \"hello-world\" plugin Update the bot's config file in the repository where you use the bot (OWNER/REPOSITORY/.github/.ubiquibot-config.yml): plugins: - skipBotEvents: true uses: # hello-world-plugin - plugin: http://127.0.0.1:9090 runsOn: [ \"issue_comment.created\" ] with: response: world Post a /hello comment in any issue The bot should respond with the world message (example ) How it works: When you post the /hello command the kernel receives the issue_comment.created event The kernel matches the /hello command to the plugin that should be executed (i.e. the API method that should be called) The kernel passes GitHub event payload, bot's access token and plugin settings (from .ubiquibot-config.yml) to the plugin endpoint The plugin performs all the required actions and returns the result Hello world plugin tutorial A screencast tutorial on how to set up and run a hello world plugin is available at wiki . Testing Jest To start Jest tests, run bun test", "similarity": 0.675653219223022 }, { "source_id": "readme-ubiquity/launch-party}", "content_plaintext": "This project was bootstrapped with Create React App . Available Scripts In the project directory, you can run: yarn start Runs the app in the development mode.Open http://localhost:3000 to view it in the browser. The page will reload if you make edits.You will also see any lint errors in the console. yarn test Launches the test runner in the interactive watch mode.See the section about running tests for more information. yarn build Builds the app for production to the build folder.It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.Your app is ready to be deployed! See the section about deployment for more information. yarn eject Note: this is a one-way operation. Once you eject, you can’t go back! If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. Learn More You can learn more in the Create React App documentation . To learn React, check out the React documentation . Code Splitting This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting Analyzing the Bundle Size This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size Making a Progressive Web App This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app Advanced Configuration This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration Deployment This section has moved here: https://facebook.github.io/create-react-app/docs/deployment yarn build fails to minify This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify", "similarity": 0.654156504943061 }, { "source_id": "readme-ubiquity/audit.ubq.fi}", "content_plaintext": "@ubiquity/audit.ubq.fi Install Dependencies yarn Build yarn build Start UI yarn start Test Uses: { \"WALLET\": \"0xrandomwallet\", \"REPO\": \"https://github.com/repo/repo\", \"PAT\": \"YOUR_PAT\" }", "similarity": 0.650791645050049 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n2384570894 Keyrxng: @ubqbot what is conversation rewards I don't understand\n2384571246 Keyrxng: @ubqbot is the kernel a yarn repo?\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\n@ubiquity/ubiquibot-kernel The kernel is designed to: Interface with plugins (GitHub Actions) for longer running processes. Run on Cloudflare Workers. Environment Variables APP_PRIVATE_KEY Obtain a private key from your GitHub App settings and convert it to the Public-Key Cryptography Standards #8 (PKCS#8) format. A new private key in PEM format can be generated and downloaded from https://github.com/organizations/{your-organization-name}/settings/apps/{your-github-app-name}. Use the following command to perform PEM to PKCS#8 conversion and append the result to your .dev.vars file: echo \"APP_PRIVATE_KEY=\\\"$(openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in YOUR_APP_PRIVATE_KEY.PEM | awk 'BEGIN{ORS=\"\\\\n\"} 1')\\\"\" >> .dev.vars Note: Replace YOUR_APP_PRIVATE_KEY.PEM with the path to your actual PEM file when running the command. APP_WEBHOOK_SECRET Set this value in both your GitHub App settings and here. APP_ID Retrieve this from your GitHub App settings. WEBHOOK_PROXY_URL (only for development) Obtain a webhook URL at smee.io and set it in your GitHub App settings. Quick Start git clone https://github.com/ubiquity/ubiquibot-kernel cd ubiquibot-kernel bun install bun dev Deploying to Cloudflare Workers Install Dependencies: Execute bun install to install the required dependencies. Create a GitHub App: Generate a GitHub App and configure its settings. Navigate to app settings and click Permissions & events. Ensure the app is subscribed to all events with the following permissions: Repository permissions: Actions: Read & Write Contents: Read & Write Issues: Read & Write Pull Requests: Read & Write Organization permissions: Members: Read only Cloudflare Account Setup: If not done already, create a Cloudflare account. Run npx wrangler login to log in. Create a KV Namespace: Generate a KV namespace using npx wrangler kv:namespace create PLUGIN_CHAIN_STATE. Copy the generated ID and paste it under [env.dev] in wrangler.toml. Manage Secrets: Add (env) secrets using npx wrangler secret put --env dev. For the private key, execute the following (replace YOUR_APP_PRIVATE_KEY.PEM with the actual PEM file path): echo $(openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in YOUR_APP_PRIVATE_KEY.PEM) | npx wrangler secret put APP_PRIVATE_KEY --env dev Deploy the Kernel: Execute bun run deploy-dev to deploy the kernel. Plugin-Kernel Input/Output Interface Input Inputs are received within the workflow, triggered by the workflow_dispatch event. The plugin is designed to handle the following inputs: interface PluginInput { stateId: string; // An identifier used to track the state of plugin chain execution in Cloudflare KV eventName: string; // The complete name of the event (e.g., `issue_comment.created`) eventPayload: any; // The payload associated with the event settings: string; // A string containing JSON with settings specific to your plugin authToken: string; // A JWT token for accessing GitHub's API to the repository where the event occurred ref: string; // A reference (branch, tag, commit SHA) indicating the version of the plugin to be utilized } Example usage: const input: PluginInput = { stateId: \"abc123\", eventName: \"issue_comment.created\", eventPayload: { /* ... */ }, settings: '{ \"key\": \"value\" }', authToken: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\", ref: \"refs/heads/main\", }; Output Data is returned using the repository_dispatch event on the plugin's repository, and the output is structured within the client_payload. The event_type must be set to return_data_to_ubiquibot_kernel. interface PluginOutput { state_id: string; // The state ID passed in the inputs must be included here output: string; // A string containing JSON with custom output, defined by the plugin itself } Example usage: const output: PluginOutput = { state_id: \"abc123\", output: '{ \"result\": \"success\", \"message\": \"Plugin executed successfully\" }', }; Plugin Quick Start The kernel supports 2 types of plugins: GitHub actions (wiki ) Cloudflare Workers (which are simple backend servers with a single API route) How to run a \"hello-world\" plugin the Cloudflare way: Run bun dev to spin up the kernel Run bun plugin:hello-world to spin up a local server for the \"hello-world\" plugin Update the bot's config file in the repository where you use the bot (OWNER/REPOSITORY/.github/.ubiquibot-config.yml): plugins: - skipBotEvents: true uses: # hello-world-plugin - plugin: http://127.0.0.1:9090 runsOn: [ \"issue_comment.created\" ] with: response: world Post a /hello comment in any issue The bot should respond with the world message (example ) How it works: When you post the /hello command the kernel receives the issue_comment.created event The kernel matches the /hello command to the plugin that should be executed (i.e. the API method that should be called) The kernel passes GitHub event payload, bot's access token and plugin settings (from .ubiquibot-config.yml) to the plugin endpoint The plugin performs all the required actions and returns the result Hello world plugin tutorial A screencast tutorial on how to set up and run a hello world plugin is available at wiki . Testing Jest To start Jest tests, run bun test=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

To address the last question in the conversation:

@ubqbot is the kernel a yarn repo?

No, the kernel is not a Yarn repo. Instead, it is designed to be run using Bun. You can use the following commands for setup:

  1. Clone the repository:

    git clone https://github.com/ubiquity/ubiquibot-kernel
  2. Navigate into the directory:

    cd ubiquibot-kernel
  3. Install dependencies:

    bun install
  4. Start the kernel:

    bun dev
Keyrxng commented 1 month ago

@ubqbot anvil is causing me issues in pay.ubq.fi

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquity/pay.ubq.fi}", "content_plaintext": "pay.ubq.fi A vanilla Typescript dApp for claiming Ubiquity Rewards. It also includes tools for generating and invalidating permits and can be used to claim both ERC20 and ERC721 tokens. Setup Local Testing Environment Install Foundry . Create a .env file in the project root with the following settings: These are the suggested default test environment variables that allow for local setup using the supplied yarn commands. If you want to produce or invalidate real on-chain permits you must change the below values to reflect the real permit information such as address, chain ID, private key and so on. # Common variables CHAIN_ID=\"31337\" FRONTEND_URL=\"http://localhost:8080\" UBIQUIBOT_PRIVATE_KEY=\"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d\" RPC_PROVIDER_URL=\"http://127.0.0.1:8545\" PAYMENT_TOKEN_ADDRESS=\"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d\" # Storing tx data is not required to test locally although you do need to fill these with valid values # unless working on this feature specifically you won't need to build a supabase instance SUPABASE_URL=https://.supabase.co # used for storing permit tx data SUPABASE_ANON_KEY=\"....\" # used for storing permit tx data # Variables depending on spender (bounty hunter) AMOUNT_IN_ETH=\"1\" BENEFICIARY_ADDRESS=\"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\" # Legacy env vars (only used when invalidating **REAL** permits via /scripts/solidity/getInvalidateNonceParams.ts) NONCE=\"0\" NONCE_SIGNER_ADDRESS=\"0x\" Local Testing Set .env variables. Run yarn test:anvil in terminal A and yarn test:fund in terminal B. In terminal B, run yarn start. A permit URL for both ERC20 and ERC721 will be generated. Open the generated permit URL from the console. Connect your wallet (import anvil accounts [0] & [1] into your wallet). Depending on your connected account, either the claim or invalidate button will be visible. To test ERC721 permits, deploy the nft-rewards contract from the repository . Importing Anvil Accounts Open your wallet provider and select import wallet or import account. Obtain the private keys by running anvil or using the yarn command. Copy and paste the private keys into your wallet provider. Expected Behavior Setup A local blockchain instance will be created for testing. The permit URL will be generated in the console. Ensure your console has enough space for the full URL. Imported anvil accounts [0] & [1] can claim and invalidate permits. Claiming Uses chain id 31337 and RPC provider http://localhost:8545. Claiming involves transferring tokens from the signer's account to the beneficiary's account. Signer must have signed a permit and have enough balance approved for the permit2 contract. Invalidating Only the permit signer can invalidate it. Invalidating calls invalidateUnorderedNonces on the Permit2 smart contract. Considerations MetaMask is considered the default wallet provider. Ensure correct network selection in your wallet (http://localhost:8545 with chain id 31337). Use MetaMask Mobile Wallet Browser for mobile testing. Errors Clear transaction history in MetaMask if transactions hang after restarting the Anvil instance. The test suite may show error toasts due to MetaMask spoofing. Ensure .env is correctly configured and wallet provider network is correct if Allowance or Balance is 0.00. Always start the Anvil instance before using yarn start as permit generation requires an on-chain call to token.decimals(). How to generate a permit2 URL using the script Admin sets env.AMOUNT_IN_ETH and env.BENEFICIARY_ADDRESS depending on a bounty hunter's reward and address Admin generates an offline permit URL via npx tsx generate-permit2-url.ts. Permit URL example: http://localhost:8080?claim=eyJwZXJtaXQiOnsicGVybWl0dGVkIjp7InRva2VuIjoiMHgxMWZFNEI2QUUxM2QyYTYwNTVDOEQ5Y0Y2NWM1NWJhYzMyQjVkODQ0IiwiYW1vdW50IjoiMTAwMDAwMDAwMDAwMDAwMDAwMCJ9LCJub25jZSI6IjQ0NTUxMjc4NTQwNTU0MzM1MDQ2NzU2NDQ3MzM2MjI1ODg5OTE4OTY5MTczODQwNTU0Nzk2NzQ3MzQzMzAwOTg0NzU4MDIyMzY1ODczIiwiZGVhZGxpbmUiOiIxMTU3OTIwODkyMzczMTYxOTU0MjM1NzA5ODUwMDg2ODc5MDc4NTMyNjk5ODQ2NjU2NDA1NjQwMzk0NTc1ODQwMDc5MTMxMjk2Mzk5MzUifSwidHJhbnNmZXJEZXRhaWxzIjp7InRvIjoiMHhjODZhMDU5NzgwMThlMDRkNmVGMmFhNzNFNjlhNzMzQzA2ZDFmODllIiwicmVxdWVzdGVkQW1vdW50IjoiMTAwMDAwMDAwMDAwMDAwMDAwMCJ9LCJvd25lciI6IjB4NTRmNGEzNjQyMkRjOTZkMDg0OTY3NWMxZjBkZDJCOTZEMjc1NThFMiIsInNpZ25hdHVyZSI6IjB4NWI0OTE5MjhmYzI4MzBlMjZiNTViMWUxOWQ3YzVhMmVjNGE2ZmRhYWI1OGFiYjgyOWMwNmYzYzlkNGE4YTc5YjAzYmE2NjlkMDM4YjFmYzg5NjgzYzMyYjBiYTA5MzU2MDRjMGU1MDNjYWE3ZmY2ZWM2MDg2ZWZlYjY2MTY5MjQxYyJ9 Admin posts offline permit URL in issue comments (with the payment portal domain name) Bounty hunter opens permit URL, connects wallet and clicks a \"withdraw\" button to get a payment How to invalidate a permit2 nonce using the script This section describes how to invalidate the following permit (i.e. invalidate a permit2 nonce) Setup .env file with the required env variables: NONCE (nonce number), NONCE_SIGNER_ADDRESS (i.e. the bot's wallet) and RPC_PROVIDER_URL. For this permit URL the .env file will look like this: NONCE=\"9867970486646789738815952475601005014850694197864057371518032581271992954680\" NONCE_SIGNER_ADDRESS=\"0xf87ca4583C792212e52720d127E7E0A38B818aD1\" RPC_PROVIDER_URL=\"https://rpc.ankr.com/gnosis\" Run yarn nonce:get-invalidate-params. You will get this output: == Logs == Is nonce used: false -------------------- Params for nonce invalidation via invalidateUnorderedNonces() wordPos: 38546759713464022417249814357816425839260524210406474107492314770593722479 mask: 72057594037927936 Open https://gnosisscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3#writeContract and connect your wallet Call invalidateUnorderedNonces() with the wordPos and mask params you got on step 2 Notice that this examples uses gnosis chain for nonce invalidation. If you need to invalidate nonce on some other chain then: Set RPC_PROVIDER_URL on step 1 to the desired RPC chain provider On step 3 open UI for the desired chain", "similarity": 0.718347864249477 }, { "source_id": "readme-ubiquity-os/permit-generation}", "content_plaintext": "@ubiquibot/permit-generation The purpose of this module is to isolate the bot's payment capabilities. This can be directly invoked from other plugins [^1^]. V1 Technical Specification Input The input should be an array of permit descriptors: type PermitGenerationInput { username: string; amount: string; address: string; task: GitHubIssue | null; transfer: boolean; evmPrivateKeyEncrypted: string; }[] Remarks Mixed feelings on the following: task - Payments can possibly be for any reason from any plugin developer in our ecosystem, but in the foreseeable future (for V1) I think that they should be associated with a GitHub issue, or nothing. transfer - For automatically transferring the funds vs generating a permit. If we have access to the private key, we have the ability to make a transfer on their behalf. General remarks: evmPrivateKeyEncrypted - I researched GitHub App permissions and its a boolean for all organization secrets or none; or all repository secrets or none. I think that partners may be weary to share ALL secrets so perhaps it makes sense to proceed with the X25519 evmPrivateKeyEncrypted system. Processing Data validation Look up the GitHub global user ID (number) that corresponds with the username. Check if a user ID exists (does the user exist?), otherwise log an error and proceed. [^2^] Look up the registered wallet address of the user from our database. [^3^] Parse the amount and see if its a valid number. Look up the address on chain to see if a token exists there. If not, throw an error. Verify that the task.id exists on GitHub. If not, throw an error. If it is null then skip this validation. Record all the results in our database. public.permits Return Return value should just be an array of generated permits. A separate module can convert them into URLs for pay.ubq.fi. [^1^]: I put a lot of thought into this and unless the plugins can hack X25519 encryption I think its fine for them to attempt brute forcing etc. In exchange its simpler infrastructure vs only accepting requests from the kernel (which seems more secure, but for V1 perhaps unnecessary.) [^2^]: We pass in the username for enhanced developer experience for plugin development. I believe it will be much easier to use GitHub usernames and let the system do the lookup. [^3^]: Mixed feelings on this lookup because it does not self encapsulate this module well. We already have an optional database write for the permit record, but this plugin WILL break if there is a database issue for reading the user's registered wallet, which can make testing and development more difficult here. The alternative is to pass in the user's wallet here, but then the kernel (or another plugin) needs to look up their wallet address (this seems like the better approach.)", "similarity": 0.655612468719487 }, { "source_id": "readme-ubiquity/ubiquibot}", "content_plaintext": "UbiquiBot (deprecated) [!CAUTION]This repository is not used anymore, see instead https://github.com/ubiquity/ubiquibot-kernel Ubiquity DAO's GitHub Bot for Automating DevPool Management. Table of Contents Quickstart Environment Variables Overview How to Use Configuration How to Run Locally Supabase Database Logs Payments Permits in a Local Instance How to QA Additions to the Bot How to Create a New Release Architecture Overview Default Config Notes (ubiquibot-config-default.ts) Quickstart #!/bin/bash git clone https://github.com/ubiquity/ubiquibot.git cd ubiquibot bun bun tsc (to compile your changes) bun tsc --watch (to locally auto compile your changes) bun start:watch ## It's recommended to split terminals in your IDE while running above input Environment Variables Copy .env.example to .env (do not rename .env.example, just make a copy) Update the following fields on .env: SUPABASE_URL: Add your Supabase project URL. SUPABASE_KEY: Add your Supabase project API key. FOLLOWUP_TIME: (optional) Set a custom follow-up time (default: 4 days). DISQUALIFY_TIME: (optional) Set a custom disqualify time (default: 7 days). OPENAI_API_HOST: (optional) Set OpenAI host url (default: https://api.openai.com). OPENAI_API_KEY: Set OpenAI key. CHATGPT_USER_PROMPT_FOR_IMPORTANT_WORDS: (optional) Set a custom user prompt for finding important words(default: \"I need your help to find important words (e.g. unique adjectives) from github issue below and I want to parse them easily so please separate them using #(No other contexts needed). Please separate the words by # so I can parse them easily. Please answer simply as I only need the important words. Here is the issue content.\\n\"). CHATGPT_USER_PROMPT_FOR_MEASURE_SIMILARITY: (optional) Set a custom user prompt for measuring similarity(default: 'I have two github issues and I need to measure the possibility of the 2 issues are the same content (No other contents needed and give me only the number in %).\\n Give me in number format and add % after the number.\\nDo not tell other things since I only need the number (e.g. 85%). Here are two issues:\\n 1. \"%first%\"\\n2. \"%second%\"'). SIMILARITY_THRESHOLD: (optional) Set similarity threshold (default: 80). MEASURE_SIMILARITY_AI_TEMPERATURE: (optional) Set ChatGPT temperature for measuring similarity (default: 0). IMPORTANT_WORDS_AI_TEMPERATURE: (optional) Set ChatGPT temperature for finding important words (default: 0). WEBHOOK_PROXY_URL: (required) should be automatically filled when you install UbiquiBot WEBHOOK_SECRET: (required) should be automatically filled when the app is installed APP_ID and PRIVATE_KEY are here for core team developers to use. If you are an external developer, APP_IDand PRIVATE_KEY are automatically generated when you install the app on your repository. How to run locally Register a new Github App Should output: setup You may proceed to go to http://localhost:3000 and you should see setup1 Click on Register a Github App setup3 Provide the bot a name setup3 setup4 Select a handle where to install the bot Select in which repo the bot shall be available setup6 After following the steps you should see setup7 Restart the server for the installation to take effect setup10 After aforemention steps then installation shall be complete setup11 Seeing this page below after hitting http://localhost:3000 again? trylocal Congratulations! you successfully installed UbiquiBot (new or to an existing app) Update an Existing Github App (bot) After you hit http://localhost:3000 you have the option to edit an existing app (if you think you have already registered a bot and when to reuse that same app) existing on your Github settings hit to: repoaccess hen at the same time hit to \"APP SETTINGS\" Update the WebHook URL by the one auto-provided by the bot's installation page (this is a must) and edit the webhook secret that you'll use at .env secret Update APP_ID at .env accordingly ubiqui In the same page it is super important that you re-generated and save a private key that you'll be using at .env you open the file and paste it logo The Good News it's after you install the bot by using an existing app you'll get success Important things with private keys (.pem) at .env The private key gets automatically filled after the app is installed to a github handle but not as an existing app The private key cannot be separated in spaces The private key is a string into its env var rather than a just opened info without \"\" otherwise it will not be recognized and you'll get unauthorized access Note: When setting up the project, please do not rename the .env.example file to .env as it will delete the environment example from the repository.Instead, it is recommended to make a copy of the .env.example file and replace the values with the appropriate ones. Overview This bot is available as a GitHub Action. The code must be compiled using @vercel/ncc because all the dependencies (e.g. node_modules) must be included and committed on the repository for the GitHub Actions runner to use. How to use Go to the UbiquiBot App Marketplace Choose a plan and install UbiquiBot on your repository Congratulations! You can now use the UbiquiBot to manage your tasks. To test the bot, you can: Create a new issue Add a time label, ex: Time: 20.10.0 && bun Open 2 terminal instances: in one instance run bun tsc --watch (compiles the Typescript code) in another instance run bun start:watch (runs the bot locally) Open http://localhost:3000 and follow instructions to add the bot to one of your repositories. At this point the .env files auto-fill the empty fields (PRIVATE_KEY and APP_ID) if it is not previously filled.Now you can make changes to the repository on GitHub (e.g. add a task) and the bot should react. After adding the bot (as a installed app) to your github you will need to restart the aforementioned bun start:watch`` so CTRL-C to stop the node daemon and bun start:watch` again You can, for example: Create a new issue Add a time label, ex: Time: ├── bin: Binary file and action file compiled by @vercel/ncc├── docs: Documentations├── src : Main source code├── supabase: Supabase migrations and configuration file /src ├── adapters: A set of interaces to interact with 3rd party libraries such as Telegraf, supabase-js. It consists of a set of small functions bulit on top of a specific library. Every adapter needs to be for calling a specific method of the library.|├── bindings: A set of listeners to bind/process requests emitted by GitHub. It also has a function to load a project configuration.|├── configs: Constants and default config values used to create a bot configuration in case we're missing any needed configuration parameters from both .env and config file.|├── handlers: A set of event-based processors. Each handler processes a specific request and it may consist of pre, action and post handlers. A pre handler would be running in prior to the main action which needs to be shorter not to affect the main handler's process. A post handler would be running as soon as the main handler gets completed. It has no limitation on its completion time. For example, it could be an example of pre-handler to create missing price labels because if we don't have necessary labels created already on the repo, labeling non-exists labels would definitely throw.|├── types A set of schema and type definitions. Why do we need schema? because we want to validate the unknown input and throw the error before the main execution.| ├── helpers A set of schema and type definitions. Why do we need schema? because we want to validate the unknown input and throw the error before the main execution. ├── utils A set of utility functions Default Config Notes (ubiquibot-config-default.ts) We can't use a jsonc file due to limitations with Netlify. Here is a snippet of some values with notes next to them. { \"payment-permit-max-price\": 9007199254740991, // Number.MAX_SAFE_INTEGER \"max-concurrent-assigns\": 9007199254740991, // Number.MAX_SAFE_INTEGER \"comment-element-pricing\": { /* https://github.com/syntax-tree/mdast#nodes */ \"strong\": 0 // Also includes italics, unfortunately https://github.com/syntax-tree/mdast#strong /* https://github.com/syntax-tree/mdast#gfm */ } } Supabase Cron Job (logs-cleaner) Dashboard > Project > Database > Extensions Search PG_CRON and Enable it. Dashboard > Project > SQL Editor -- Runs everyday at 03:00 AM to cleanup logs that are older than a week -- Use the cron time format to modify the trigger time if necessary select cron.schedule ( 'logs-cleaner', -- Job name '0 3 * * *', -- Everyday at 03:00 AM $$DELETE FROM logs WHERE timestamp", "similarity": 0.635284066200261 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n2384570894 Keyrxng: @ubqbot what is conversation rewards I don't understand\n2384571246 Keyrxng: @ubqbot is the kernel a yarn repo?\n2384571773 Keyrxng: @ubqbot anvil is causing me issues in pay.ubq.fi\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\npay.ubq.fi A vanilla Typescript dApp for claiming Ubiquity Rewards. It also includes tools for generating and invalidating permits and can be used to claim both ERC20 and ERC721 tokens. Setup Local Testing Environment Install Foundry . Create a .env file in the project root with the following settings: These are the suggested default test environment variables that allow for local setup using the supplied yarn commands. If you want to produce or invalidate real on-chain permits you must change the below values to reflect the real permit information such as address, chain ID, private key and so on. # Common variables CHAIN_ID=\"31337\" FRONTEND_URL=\"http://localhost:8080\" UBIQUIBOT_PRIVATE_KEY=\"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d\" RPC_PROVIDER_URL=\"http://127.0.0.1:8545\" PAYMENT_TOKEN_ADDRESS=\"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d\" # Storing tx data is not required to test locally although you do need to fill these with valid values # unless working on this feature specifically you won't need to build a supabase instance SUPABASE_URL=https://.supabase.co # used for storing permit tx data SUPABASE_ANON_KEY=\"....\" # used for storing permit tx data # Variables depending on spender (bounty hunter) AMOUNT_IN_ETH=\"1\" BENEFICIARY_ADDRESS=\"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\" # Legacy env vars (only used when invalidating **REAL** permits via /scripts/solidity/getInvalidateNonceParams.ts) NONCE=\"0\" NONCE_SIGNER_ADDRESS=\"0x\" Local Testing Set .env variables. Run yarn test:anvil in terminal A and yarn test:fund in terminal B. In terminal B, run yarn start. A permit URL for both ERC20 and ERC721 will be generated. Open the generated permit URL from the console. Connect your wallet (import anvil accounts [0] & [1] into your wallet). Depending on your connected account, either the claim or invalidate button will be visible. To test ERC721 permits, deploy the nft-rewards contract from the repository . Importing Anvil Accounts Open your wallet provider and select import wallet or import account. Obtain the private keys by running anvil or using the yarn command. Copy and paste the private keys into your wallet provider. Expected Behavior Setup A local blockchain instance will be created for testing. The permit URL will be generated in the console. Ensure your console has enough space for the full URL. Imported anvil accounts [0] & [1] can claim and invalidate permits. Claiming Uses chain id 31337 and RPC provider http://localhost:8545. Claiming involves transferring tokens from the signer's account to the beneficiary's account. Signer must have signed a permit and have enough balance approved for the permit2 contract. Invalidating Only the permit signer can invalidate it. Invalidating calls invalidateUnorderedNonces on the Permit2 smart contract. Considerations MetaMask is considered the default wallet provider. Ensure correct network selection in your wallet (http://localhost:8545 with chain id 31337). Use MetaMask Mobile Wallet Browser for mobile testing. Errors Clear transaction history in MetaMask if transactions hang after restarting the Anvil instance. The test suite may show error toasts due to MetaMask spoofing. Ensure .env is correctly configured and wallet provider network is correct if Allowance or Balance is 0.00. Always start the Anvil instance before using yarn start as permit generation requires an on-chain call to token.decimals(). How to generate a permit2 URL using the script Admin sets env.AMOUNT_IN_ETH and env.BENEFICIARY_ADDRESS depending on a bounty hunter's reward and address Admin generates an offline permit URL via npx tsx generate-permit2-url.ts. Permit URL example: http://localhost:8080?claim=eyJwZXJtaXQiOnsicGVybWl0dGVkIjp7InRva2VuIjoiMHgxMWZFNEI2QUUxM2QyYTYwNTVDOEQ5Y0Y2NWM1NWJhYzMyQjVkODQ0IiwiYW1vdW50IjoiMTAwMDAwMDAwMDAwMDAwMDAwMCJ9LCJub25jZSI6IjQ0NTUxMjc4NTQwNTU0MzM1MDQ2NzU2NDQ3MzM2MjI1ODg5OTE4OTY5MTczODQwNTU0Nzk2NzQ3MzQzMzAwOTg0NzU4MDIyMzY1ODczIiwiZGVhZGxpbmUiOiIxMTU3OTIwODkyMzczMTYxOTU0MjM1NzA5ODUwMDg2ODc5MDc4NTMyNjk5ODQ2NjU2NDA1NjQwMzk0NTc1ODQwMDc5MTMxMjk2Mzk5MzUifSwidHJhbnNmZXJEZXRhaWxzIjp7InRvIjoiMHhjODZhMDU5NzgwMThlMDRkNmVGMmFhNzNFNjlhNzMzQzA2ZDFmODllIiwicmVxdWVzdGVkQW1vdW50IjoiMTAwMDAwMDAwMDAwMDAwMDAwMCJ9LCJvd25lciI6IjB4NTRmNGEzNjQyMkRjOTZkMDg0OTY3NWMxZjBkZDJCOTZEMjc1NThFMiIsInNpZ25hdHVyZSI6IjB4NWI0OTE5MjhmYzI4MzBlMjZiNTViMWUxOWQ3YzVhMmVjNGE2ZmRhYWI1OGFiYjgyOWMwNmYzYzlkNGE4YTc5YjAzYmE2NjlkMDM4YjFmYzg5NjgzYzMyYjBiYTA5MzU2MDRjMGU1MDNjYWE3ZmY2ZWM2MDg2ZWZlYjY2MTY5MjQxYyJ9 Admin posts offline permit URL in issue comments (with the payment portal domain name) Bounty hunter opens permit URL, connects wallet and clicks a \"withdraw\" button to get a payment How to invalidate a permit2 nonce using the script This section describes how to invalidate the following permit (i.e. invalidate a permit2 nonce) Setup .env file with the required env variables: NONCE (nonce number), NONCE_SIGNER_ADDRESS (i.e. the bot's wallet) and RPC_PROVIDER_URL. For this permit URL the .env file will look like this: NONCE=\"9867970486646789738815952475601005014850694197864057371518032581271992954680\" NONCE_SIGNER_ADDRESS=\"0xf87ca4583C792212e52720d127E7E0A38B818aD1\" RPC_PROVIDER_URL=\"https://rpc.ankr.com/gnosis\" Run yarn nonce:get-invalidate-params. You will get this output: == Logs == Is nonce used: false -------------------- Params for nonce invalidation via invalidateUnorderedNonces() wordPos: 38546759713464022417249814357816425839260524210406474107492314770593722479 mask: 72057594037927936 Open https://gnosisscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3#writeContract and connect your wallet Call invalidateUnorderedNonces() with the wordPos and mask params you got on step 2 Notice that this examples uses gnosis chain for nonce invalidation. If you need to invalidate nonce on some other chain then: Set RPC_PROVIDER_URL on step 1 to the desired RPC chain provider On step 3 open UI for the desired chain=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

It looks like you're experiencing issues with Anvil in pay.ubq.fi.

To assist you more effectively, please double-check these common troubleshooting steps:

  1. Network Configuration:

    • Ensure you are using the correct RPC provider and chain ID. For local testing, it should be:
      RPC_PROVIDER_URL="http://127.0.0.1:8545"
      CHAIN_ID="31337"
  2. Seed Data with yarn test:fund:

    • Run yarn test:anvil in one terminal and yarn test:fund in another to ensure accounts have the necessary funds.
  3. Wallet Configuration:

    • Ensure that Anvil accounts [0] and [1] are correctly imported into your wallet. You can fetch private keys by running anvil or the respective Yarn command.
  4. Permits:

    • If working with permits, confirm you are generating them correctly according to the permit2 standards as specified.

After verifying these steps, try restarting Anvil and your local blockchain instance. If the issue persists, please provide more details about the specific error you're encountering!

Keyrxng commented 1 month ago

@ubqbot how do I setup the kernel from scratch?

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquibot/production}", "content_plaintext": "ubiquibot production environment test", "similarity": 0.639429671832362 }, { "source_id": "readme-ubiquity/ubiquibot-config}", "content_plaintext": "ubiquibot-config", "similarity": 0.633230190478858 }, { "source_id": "readme-ubiquibot/ubiquibot-config}", "content_plaintext": "ubiquibot-config", "similarity": 0.633230190478858 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n2384570894 Keyrxng: @ubqbot what is conversation rewards I don't understand\n2384571246 Keyrxng: @ubqbot is the kernel a yarn repo?\n2384571773 Keyrxng: @ubqbot anvil is causing me issues in pay.ubq.fi\n2384572147 Keyrxng: @ubqbot how do I setup the kernel from scratch?\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\nubiquibot production environment test=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

To set up the kernel from scratch, you can follow these general steps based on typical project setups, especially if the project uses Yarn:

1. Clone the repository

git clone <repository-url>
cd <repository-directory>

2. Install dependencies

If the kernel is using Yarn, you can handle the project dependencies with:

yarn install

3. Configure environment variables

Make sure any required environment-specific configurations are set. Often, these are stored in an .env file, or you'll be guided by the documentation or setup scripts.

4. Setup the database (if applicable)

Depending on the project, you might need to configure a local or remote database.

# Example for setting up with a migration tool
yarn run migrate

5. Start the kernel

Finally, run the kernel locally:

yarn run start

Make sure to check any project-specific documentation for additional setup steps related to the kernel.

Keyrxng commented 1 month ago

@ubqbot what is the devpool?

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquity/devpool-directory-bounties}", "content_plaintext": "Bounties for the DevPool Directory This repository hosts bounties for the devpool-directory repository , herein referred to as the \"Directory.\" The Directory aggregates all of the open bounties from the global DevPool network comprised of the registered partners . We can not store the bounties on the Directory itself because: We don't want to mix partners' bounties with Directory specific bounties. We disable github notifications for the Directory because it produces too many notifications.", "similarity": 0.710202847695016 }, { "source_id": "readme-ubiquity/devpool-directory-private}", "content_plaintext": "DevPool - Bounties Directory User Interface New (December 2023) use our custom UI here . For Bounty Hunters All available bounties are viewable in the issues section . You can subscribe to notifications for this repository to automatically see new available bounties. You can not assign yourself to the issues inside of this repository. Instead, you must navigate to the linked issue, and write /start there in order to take a bounty. For Partners You can add your repository automatically by adding our UbiquiBot to your public repository. The bot will automatically open up a pull request, requesting to be added. When the pull request is merged your bounties will appear here . Maintaining This Repository When maintaining this repository (e.g. when working on its bounties ) please do not enable the issues tab on your fork, or else all of our partner issues will have spam from your fork (e.g. \"x user mentioned this issue x days ago\") on all of the issues of every repository in this directory.", "similarity": 0.707733206558251 }, { "source_id": "readme-ubiquity/devpool-directory}", "content_plaintext": "DevPool - Bounties Directory User Interface New (December 2023) use our custom UI here . For Bounty Hunters All available bounties are viewable in the issues section . You can subscribe to notifications for this repository to automatically see new available bounties. You can not assign yourself to the issues inside of this repository. Instead, you must navigate to the linked issue, and write /start there in order to take a bounty. For Partners You can add your repository automatically by adding our UbiquiBot to your public repository. The bot will automatically open up a pull request, requesting to be added. When the pull request is merged your bounties will appear here . Maintaining This Repository When maintaining this repository (e.g. when working on its bounties ) please do not enable the issues tab on your fork, or else all of our partner issues will have spam from your fork (e.g. \"x user mentioned this issue x days ago\") on all of the issues of every repository in this directory.", "similarity": 0.705993789077187 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n2384570894 Keyrxng: @ubqbot what is conversation rewards I don't understand\n2384571246 Keyrxng: @ubqbot is the kernel a yarn repo?\n2384571773 Keyrxng: @ubqbot anvil is causing me issues in pay.ubq.fi\n2384572147 Keyrxng: @ubqbot how do I setup the kernel from scratch?\n2384572696 Keyrxng: @ubqbot what is the devpool?\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\nBounties for the DevPool Directory This repository hosts bounties for the devpool-directory repository , herein referred to as the \"Directory.\" The Directory aggregates all of the open bounties from the global DevPool network comprised of the registered partners . We can not store the bounties on the Directory itself because: We don't want to mix partners' bounties with Directory specific bounties. We disable github notifications for the Directory because it produces too many notifications.=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

The DevPool is a network that aggregates open bounties from registered partners in the global DevPool network. The directory stores information related to those bounties but does not directly mix them with specific partner bounties.

Here are a few key points:

In short, the DevPool helps manage and aggregate bounties across a network of partners for easy access and collaboration.

Keyrxng commented 1 month ago

@ubqbot I need to generate a keypair, which project should I use?

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquity/keygen.ubq.fi}", "content_plaintext": "@ubiquity/keygen.ubq.fi Generate a New Encrypted EVM Private Key Visit the Key Generation Tool Navigate to the permit key generation tool on the web. Generate a Key Click on the \"Generate\" button on the webpage to initiate the key generation process. Input Your EVM Private Key In the provided plain text field, paste your EVM Private Key. Ensure that it is 32 bytes in length. Encrypt Your Private Key Once you've pasted your private key, click on the \"Encrypt\" button. This action will encrypt your private key, enhancing its security. Update GitHub Secrets Copy the newly generated private key and update it on your GitHub Actions secret. Find the field labeled x25519_PRIVATE_KEY and replace its content with your generated x25519 private key. Update Configuration File Next, take the cipher text, which is the encrypted version of your private key, and paste it into your ubiquibot-config.yaml file. Look for the field labeled evmEncryptedPrivate and replace its content with the cipher text. Double Check Ensure that you've updated the GitHub Actions secret field x25519_PRIVATE_KEY with your already generated x25519 private key. This double check ensures that all components are aligned and your system remains secure.", "similarity": 0.706522170292336 }, { "source_id": "readme-ubiquity/onboard.ubq.fi}", "content_plaintext": "@ubiquity/onboard.ubq.fi Generates the configuration for organizations, by creating a default configuration and creating a repository under thegiven Organization. Requirements Copy the env.example to .env and fill the required variables. Run yarn start Should make the front-end page available at http://localhost:8080 . Required fields CHAIN_ID: the id of the network you want to use for the transactions WALLET_PRIVATE_KEY: the 64 digits crypto wallet key that will be used for transactions GITHUB_PAT: a GitHub Personal Access Token ORG_NAME: the name of the organization where you want to add the bot Testing To test with Cypress Studio UI, run yarn cy:open Otherwise to simply run the tests through the console, run yarn cy:run To test in a real-world scenario, you will need to create an Organization under your GitHub account, and use it as adummy. If the operation is successful, you will see a new repository appear with the Ubiquibot configuration.", "similarity": 0.696815511489384 }, { "source_id": "readme-ubiquity/uad-ui-archived}", "content_plaintext": "uad-ui Personal fork being updated because Vercel offers personal plans for free https://github.com/pavlovcik/uad-ui-launch Getting Started Cloning etc.. after git clone the project make sure to run git submodule update --init --recursive --remote You need to create .env file inside the contracts folder with at least the ALCHEMY_API_KEY and the MNEMONIC filled. Indeed MNEMONIC will be used to deploy locally and the first account will be the admin on all the smart contracts. DEV ONLY Running a local node that forks the mainnet yarn start:dev copy paste contracts/artifact/types inside frontend/contracts // run the faucet task see below we have to find the address of the ubiquitydollar copy paste the address inside frontend/pages/index.tsx cd frontend yarn && yarn build && yarn start Running a local node that forks the mainnet then run yarn install && yarn start it will create a file inside frontend/src called uad-contracts-deployment.json where you can find all the address of the deployed contracts it will launch a local node on port 8545 you can check the log in the root file local.node.logafter the node is launched it will build and run the front on port 3000 Configure metamask make sure to switch to the hardhat network on metamask chain ID: 31337 RPC URL: http://127.0.0.1:8545 then run the faucet to get some token on your address. You will need the UAD_MANAGER_ADDRESS that you can find in the output of the yarn start cd contracts npx hardhat --network localhost faucet --receiver YOUR_ETH_ADDRESS --manager UAD_MANAGER_ADDRESS Coding with typed object that represents the smart contract to get the types from the smart contracts you can import from contracts/artifacts/types import {UbiquityAlgorithmicDollar} from \"../artifacts/types/UbiquityAlgorithmicDollar\"; const token = (await ethers.getContractAt( \"UbiquityAlgorithmicDollar\", uAD.address )) as UbiquityAlgorithmicDollar; const [sender] = await ethers.getSigners(); const tx = await token.transfer(\"0x000000000\", 100);", "similarity": 0.658990601927336 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n2384570894 Keyrxng: @ubqbot what is conversation rewards I don't understand\n2384571246 Keyrxng: @ubqbot is the kernel a yarn repo?\n2384571773 Keyrxng: @ubqbot anvil is causing me issues in pay.ubq.fi\n2384572147 Keyrxng: @ubqbot how do I setup the kernel from scratch?\n2384572696 Keyrxng: @ubqbot what is the devpool?\n2384573379 Keyrxng: @ubqbot I need to generate a keypair, which project should I use?\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\n@ubiquity/keygen.ubq.fi Generate a New Encrypted EVM Private Key Visit the Key Generation Tool Navigate to the permit key generation tool on the web. Generate a Key Click on the \"Generate\" button on the webpage to initiate the key generation process. Input Your EVM Private Key In the provided plain text field, paste your EVM Private Key. Ensure that it is 32 bytes in length. Encrypt Your Private Key Once you've pasted your private key, click on the \"Encrypt\" button. This action will encrypt your private key, enhancing its security. Update GitHub Secrets Copy the newly generated private key and update it on your GitHub Actions secret. Find the field labeled x25519_PRIVATE_KEY and replace its content with your generated x25519 private key. Update Configuration File Next, take the cipher text, which is the encrypted version of your private key, and paste it into your ubiquibot-config.yaml file. Look for the field labeled evmEncryptedPrivate and replace its content with the cipher text. Double Check Ensure that you've updated the GitHub Actions secret field x25519_PRIVATE_KEY with your already generated x25519 private key. This double check ensures that all components are aligned and your system remains secure.=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

To generate a keypair, you can use the project under @ubiquity/keygen.ubq.fi. Here's a simple guide to help you:

  1. Navigate to the Key Generation Tool:

  2. Generate a Key:

    • Click the "Generate" button on the webpage to initiate the keypair generation process.
  3. Follow Encryption Steps (if needed):

    • You can encrypt your private key on the same site and follow the other steps mentioned in the guide you are referencing.

Refer to the embedding context above for more detailed instructions.

Keyrxng commented 1 month ago

@ubqbot How do I use the start stop command?

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquity-os-marketplace/command-start-stop}", "content_plaintext": "@ubiquibot/command-start-stop This plugin allows a hunter to begin a task as well as gracefully stop a task without incurring a negative impact on the hunter's XP or karma. Usage Start a task To start a task, a hunter should use the /start command. This will assign them to the issue so long as the following is true: Price labels are set on the issue The issue is not already assigned The hunter has not reached the maximum number of concurrent tasks The command is not disabled at the repository or organization level TODO: If the hunter meets the required XP requirements Stop a task To stop a task, a hunter should use the /stop command. This will unassign them from the issue so long as the following is true: The hunter is assigned to the issue The command is not disabled at the repository or organization level The command is called on the issue, not the associated pull request Configuration Note: The command name is \"start\" when configuring your .ubiquibot-config.yml file. To configure your Ubiquibot to run this plugin, add the following to the .ubiquibot-config.yml file in your organization configuration repository. - plugin: http://localhost:4000 # or the URL where the plugin is hosted name: start-stop id: start-stop-command description: \"Allows a user to start/stop a task without negative XP impact\" command: \"\\/start|\\/stop\" example: \"/start\" # or \"/stop\" with: reviewDelayTolerance: \"3 Days\" taskStaleTimeoutDuration: \"30 Days\" maxConcurrentTasks: # Default concurrent task limits per role. member: 5 contributor: 3 startRequiresWallet: true # default is true emptyWalletText: \"Please set your wallet address with the /wallet command first and try again.\" rolesWithReviewAuthority: [\"MEMBER\", \"OWNER\"] Testing Jest To run the Jest test suite, run the following command: yarn test", "similarity": 0.783023463667839 }, { "source_id": "readme-ubiquibot/production}", "content_plaintext": "ubiquibot production environment test", "similarity": 0.709162312199933 }, { "source_id": "readme-ubiquity-os-marketplace/command-wallet}", "content_plaintext": "@ubiquibot/command-wallet Allows users to register their wallets to collect rewards. Prerequisites A good understanding of how the kernel works and how to interact with it. A basic understanding of the Ubiquibot configuration and how to define your plugin's settings. Getting Started Install the dependencies preferably using yarn or bun. Copy .dev.vars.example to .dev.vars and fill the variables Generate Supabase types by running yarn prebuild Run the project with yarn wrangler Example configuration - plugin: ubiquibot/command-wallet name: command-wallet id: command-wallet description: \"Allows users to register their wallets to collect rewards.\" command: \"/wallet\" example: \"/wallet ubiquibot.eth\" At this stage, your plugin will fire on your defined events with the required settings passed in from the kernel. You can now start writing your plugin's logic. Start building your plugin by adding your logic to the plugin.ts file. Testing a plugin Worker Plugins yarn/bun worker - to run the worker locally. To trigger the worker, POST requests to http://localhost:4000/ with an event payload similar to: await fetch(\"http://localhost:4000/\", { method: \"POST\", headers: { \"Content-Type\": \"application/json\", }, body: JSON.stringify({ stateId: \"\", eventName: \"\", eventPayload: \"\", settings: \"\", ref: \"\", authToken: \"\", }), }); A full example can be found here . Action Plugins Ensure the kernel is running and listening for events. Fire an event in/to the repo where the kernel is installed. This can be done in a number of ways, the easiest being via the GitHub UI or using the GitHub API, such as posting a comment, opening an issue, etc in the org/repo where the kernel is installed. The kernel will process the event and dispatch it using the settings defined in your .ubiquibot-config.yml. The compute.yml workflow will run and execute your plugin's logic. You can view the logs in the Actions tab of your repo. Nektos Act - a tool for running GitHub Actions locally. More information Full Ubiquibot Configuration - helpful for defining your plugin's settings as they are strongly typed and will be validated by the kernel. Ubiquibot V1 - helpful for porting V1 functionality to V2, helper/utility functions, types, etc. Everything is based on the V1 codebase but with a more modular approach. When using V1 code, keep in mind that most all code will need refactored to work with the new V2 architecture. Examples Start/Stop Slash Command - simple Assistive Pricing Plugin - complex Conversation Rewards - really complex", "similarity": 0.673345963558315 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n2384570894 Keyrxng: @ubqbot what is conversation rewards I don't understand\n2384571246 Keyrxng: @ubqbot is the kernel a yarn repo?\n2384571773 Keyrxng: @ubqbot anvil is causing me issues in pay.ubq.fi\n2384572147 Keyrxng: @ubqbot how do I setup the kernel from scratch?\n2384572696 Keyrxng: @ubqbot what is the devpool?\n2384573379 Keyrxng: @ubqbot I need to generate a keypair, which project should I use?\n2384574294 Keyrxng: @ubqbot How do I use the start stop command?\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\n@ubiquibot/command-start-stop This plugin allows a hunter to begin a task as well as gracefully stop a task without incurring a negative impact on the hunter's XP or karma. Usage Start a task To start a task, a hunter should use the /start command. This will assign them to the issue so long as the following is true: Price labels are set on the issue The issue is not already assigned The hunter has not reached the maximum number of concurrent tasks The command is not disabled at the repository or organization level TODO: If the hunter meets the required XP requirements Stop a task To stop a task, a hunter should use the /stop command. This will unassign them from the issue so long as the following is true: The hunter is assigned to the issue The command is not disabled at the repository or organization level The command is called on the issue, not the associated pull request Configuration Note: The command name is \"start\" when configuring your .ubiquibot-config.yml file. To configure your Ubiquibot to run this plugin, add the following to the .ubiquibot-config.yml file in your organization configuration repository. - plugin: http://localhost:4000 # or the URL where the plugin is hosted name: start-stop id: start-stop-command description: \"Allows a user to start/stop a task without negative XP impact\" command: \"\\/start|\\/stop\" example: \"/start\" # or \"/stop\" with: reviewDelayTolerance: \"3 Days\" taskStaleTimeoutDuration: \"30 Days\" maxConcurrentTasks: # Default concurrent task limits per role. member: 5 contributor: 3 startRequiresWallet: true # default is true emptyWalletText: \"Please set your wallet address with the /wallet command first and try again.\" rolesWithReviewAuthority: [\"MEMBER\", \"OWNER\"] Testing Jest To run the Jest test suite, run the following command: yarn test=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

To use the start/stop commands, follow these steps:

For more detailed configurations, like task limits, or setting up XP requirements, you can refer back to the .ubiquibot-config.yml mentioned in the context.

Keyrxng commented 1 month ago

@ubqbot can I use yarn with the kernel?

ubqbot[bot] commented 1 month ago
top ranked embeddings ```json [ { "source_id": "readme-ubiquity/launch-party}", "content_plaintext": "This project was bootstrapped with Create React App . Available Scripts In the project directory, you can run: yarn start Runs the app in the development mode.Open http://localhost:3000 to view it in the browser. The page will reload if you make edits.You will also see any lint errors in the console. yarn test Launches the test runner in the interactive watch mode.See the section about running tests for more information. yarn build Builds the app for production to the build folder.It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.Your app is ready to be deployed! See the section about deployment for more information. yarn eject Note: this is a one-way operation. Once you eject, you can’t go back! If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. Learn More You can learn more in the Create React App documentation . To learn React, check out the React documentation . Code Splitting This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting Analyzing the Bundle Size This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size Making a Progressive Web App This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app Advanced Configuration This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration Deployment This section has moved here: https://facebook.github.io/create-react-app/docs/deployment yarn build fails to minify This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify", "similarity": 0.651959954377411 }, { "source_id": "readme-ubiquity-os/ubiquity-os-kernel}", "content_plaintext": "@ubiquity/ubiquibot-kernel The kernel is designed to: Interface with plugins (GitHub Actions) for longer running processes. Run on Cloudflare Workers. Environment Variables APP_PRIVATE_KEY Obtain a private key from your GitHub App settings and convert it to the Public-Key Cryptography Standards #8 (PKCS#8) format. A new private key in PEM format can be generated and downloaded from https://github.com/organizations/{your-organization-name}/settings/apps/{your-github-app-name}. Use the following command to perform PEM to PKCS#8 conversion and append the result to your .dev.vars file: echo \"APP_PRIVATE_KEY=\\\"$(openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in YOUR_APP_PRIVATE_KEY.PEM | awk 'BEGIN{ORS=\"\\\\n\"} 1')\\\"\" >> .dev.vars Note: Replace YOUR_APP_PRIVATE_KEY.PEM with the path to your actual PEM file when running the command. APP_WEBHOOK_SECRET Set this value in both your GitHub App settings and here. APP_ID Retrieve this from your GitHub App settings. WEBHOOK_PROXY_URL (only for development) Obtain a webhook URL at smee.io and set it in your GitHub App settings. Quick Start git clone https://github.com/ubiquity/ubiquibot-kernel cd ubiquibot-kernel bun install bun dev Deploying to Cloudflare Workers Install Dependencies: Execute bun install to install the required dependencies. Create a GitHub App: Generate a GitHub App and configure its settings. Navigate to app settings and click Permissions & events. Ensure the app is subscribed to all events with the following permissions: Repository permissions: Actions: Read & Write Contents: Read & Write Issues: Read & Write Pull Requests: Read & Write Organization permissions: Members: Read only Cloudflare Account Setup: If not done already, create a Cloudflare account. Run npx wrangler login to log in. Create a KV Namespace: Generate a KV namespace using npx wrangler kv:namespace create PLUGIN_CHAIN_STATE. Copy the generated ID and paste it under [env.dev] in wrangler.toml. Manage Secrets: Add (env) secrets using npx wrangler secret put --env dev. For the private key, execute the following (replace YOUR_APP_PRIVATE_KEY.PEM with the actual PEM file path): echo $(openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in YOUR_APP_PRIVATE_KEY.PEM) | npx wrangler secret put APP_PRIVATE_KEY --env dev Deploy the Kernel: Execute bun run deploy-dev to deploy the kernel. Plugin-Kernel Input/Output Interface Input Inputs are received within the workflow, triggered by the workflow_dispatch event. The plugin is designed to handle the following inputs: interface PluginInput { stateId: string; // An identifier used to track the state of plugin chain execution in Cloudflare KV eventName: string; // The complete name of the event (e.g., `issue_comment.created`) eventPayload: any; // The payload associated with the event settings: string; // A string containing JSON with settings specific to your plugin authToken: string; // A JWT token for accessing GitHub's API to the repository where the event occurred ref: string; // A reference (branch, tag, commit SHA) indicating the version of the plugin to be utilized } Example usage: const input: PluginInput = { stateId: \"abc123\", eventName: \"issue_comment.created\", eventPayload: { /* ... */ }, settings: '{ \"key\": \"value\" }', authToken: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\", ref: \"refs/heads/main\", }; Output Data is returned using the repository_dispatch event on the plugin's repository, and the output is structured within the client_payload. The event_type must be set to return_data_to_ubiquibot_kernel. interface PluginOutput { state_id: string; // The state ID passed in the inputs must be included here output: string; // A string containing JSON with custom output, defined by the plugin itself } Example usage: const output: PluginOutput = { state_id: \"abc123\", output: '{ \"result\": \"success\", \"message\": \"Plugin executed successfully\" }', }; Plugin Quick Start The kernel supports 2 types of plugins: GitHub actions (wiki ) Cloudflare Workers (which are simple backend servers with a single API route) How to run a \"hello-world\" plugin the Cloudflare way: Run bun dev to spin up the kernel Run bun plugin:hello-world to spin up a local server for the \"hello-world\" plugin Update the bot's config file in the repository where you use the bot (OWNER/REPOSITORY/.github/.ubiquibot-config.yml): plugins: - skipBotEvents: true uses: # hello-world-plugin - plugin: http://127.0.0.1:9090 runsOn: [ \"issue_comment.created\" ] with: response: world Post a /hello comment in any issue The bot should respond with the world message (example ) How it works: When you post the /hello command the kernel receives the issue_comment.created event The kernel matches the /hello command to the plugin that should be executed (i.e. the API method that should be called) The kernel passes GitHub event payload, bot's access token and plugin settings (from .ubiquibot-config.yml) to the plugin endpoint The plugin performs all the required actions and returns the result Hello world plugin tutorial A screencast tutorial on how to set up and run a hello world plugin is available at wiki . Testing Jest To start Jest tests, run bun test", "similarity": 0.649282932281494 }, { "source_id": "readme-ubiquity/audit.ubq.fi}", "content_plaintext": "@ubiquity/audit.ubq.fi Install Dependencies yarn Build yarn build Start UI yarn start Test Uses: { \"WALLET\": \"0xrandomwallet\", \"REPO\": \"https://github.com/repo/repo\", \"PAT\": \"YOUR_PAT\" }", "similarity": 0.620377600193024 } ] ```
ubqbot[bot] commented 1 month ago
chat history ```json "=== Current Issue #2 Specification === ubq-testing/ask-plugin/2 ===\n\nNo specification or body available\n=== End Current Issue #2 Specification ===\n\n=== Current Issue #2 Conversation === ubq-testing/ask-plugin #2 ===\n\n2384570407 Keyrxng: @ubqbot the rpc-handler sounds awesome what is it?\n2384570894 Keyrxng: @ubqbot what is conversation rewards I don't understand\n2384571246 Keyrxng: @ubqbot is the kernel a yarn repo?\n2384571773 Keyrxng: @ubqbot anvil is causing me issues in pay.ubq.fi\n2384572147 Keyrxng: @ubqbot how do I setup the kernel from scratch?\n2384572696 Keyrxng: @ubqbot what is the devpool?\n2384573379 Keyrxng: @ubqbot I need to generate a keypair, which project should I use?\n2384574294 Keyrxng: @ubqbot How do I use the start stop command?\n2384574660 Keyrxng: @ubqbot can I use yarn with the kernel?\n=== End Current Issue #2 Conversation ===\n\n=== Embedding Context === Embedding Context ===\n\nThis project was bootstrapped with Create React App . Available Scripts In the project directory, you can run: yarn start Runs the app in the development mode.Open http://localhost:3000 to view it in the browser. The page will reload if you make edits.You will also see any lint errors in the console. yarn test Launches the test runner in the interactive watch mode.See the section about running tests for more information. yarn build Builds the app for production to the build folder.It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.Your app is ready to be deployed! See the section about deployment for more information. yarn eject Note: this is a one-way operation. Once you eject, you can’t go back! If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. Learn More You can learn more in the Create React App documentation . To learn React, check out the React documentation . Code Splitting This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting Analyzing the Bundle Size This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size Making a Progressive Web App This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app Advanced Configuration This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration Deployment This section has moved here: https://facebook.github.io/create-react-app/docs/deployment yarn build fails to minify This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify=== End Embedding Context ===\n\n" ```
ubqbot[bot] commented 1 month ago

To address your last question:

@ubqbot can I use yarn with the kernel?

Yes, you can use yarn with the kernel if it has been set up as a JavaScript or TypeScript project that recognizes yarn as the package manager. Based on the embedding context provided, it seems like the project uses Create React App, which supports yarn for tasks like building, testing, and running the application. Ensure that the kernel repo has a package.json file to take advantage of yarn.

Common commands when using yarn in a project: