mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 22:37:29 +00:00
feat: add c0mpute plugin and hire-us request flow
This commit is contained in:
parent
1a87c2f26d
commit
b1d8fe475a
20 changed files with 1271 additions and 59 deletions
11
plugins/c0mpute/README.md
Normal file
11
plugins/c0mpute/README.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# c0mpute Plugin
|
||||
|
||||
c0mpute is a work-in-progress CommandBoard.run plugin for compute job dispatch, worker pool sync, usage reporting, quote creation, settlement status, and compute-backed reputation events.
|
||||
|
||||
Environment variables:
|
||||
|
||||
```txt
|
||||
C0MPUTE_API_URL
|
||||
C0MPUTE_API_KEY
|
||||
C0MPUTE_WEBHOOK_SECRET
|
||||
```
|
||||
18
plugins/c0mpute/package.json
Normal file
18
plugins/c0mpute/package.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "@logicsrc/plugin-c0mpute",
|
||||
"version": "0.1.0",
|
||||
"description": "CommandBoard.run compute jobs, worker pools, usage, and settlement plugin for c0mpute.",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"test": "vitest run src --passWithNoTests"
|
||||
},
|
||||
"dependencies": {
|
||||
"@logicsrc/plugin-core": "file:../../packages/plugin-core"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitest": "^4.0.8"
|
||||
}
|
||||
}
|
||||
40
plugins/c0mpute/src/index.ts
Normal file
40
plugins/c0mpute/src/index.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import type { PluginDefinition } from "@logicsrc/plugin-core";
|
||||
import { c0mputeManifest } from "./manifest.js";
|
||||
|
||||
export const c0mputePlugin: PluginDefinition = {
|
||||
manifest: c0mputeManifest,
|
||||
configDefaults: {
|
||||
enabled: true,
|
||||
work_in_progress: true,
|
||||
default_compute_provider: true,
|
||||
api_url: "${C0MPUTE_API_URL}",
|
||||
api_key: "${C0MPUTE_API_KEY}",
|
||||
webhook_secret: "${C0MPUTE_WEBHOOK_SECRET}",
|
||||
default_board: "/projects/c0mpute"
|
||||
},
|
||||
routes: [
|
||||
{ method: "GET", path: "/api/plugins/c0mpute/jobs", capability: "compute.jobs.sync" },
|
||||
{ method: "POST", path: "/api/plugins/c0mpute/jobs/dispatch", capability: "compute.jobs.dispatch" },
|
||||
{ method: "GET", path: "/api/plugins/c0mpute/workers", capability: "compute.workers.sync" },
|
||||
{ method: "POST", path: "/api/plugins/c0mpute/quotes", capability: "compute.quotes.create" },
|
||||
{ method: "POST", path: "/api/plugins/c0mpute/webhooks/compute-status", capability: "webhook.compute_status" }
|
||||
],
|
||||
events: [
|
||||
{ event: "task.created", capability: "compute.quotes.create" },
|
||||
{ event: "run.requested", capability: "compute.jobs.dispatch" },
|
||||
{ event: "usage.reported", capability: "compute.usage.report" },
|
||||
{ event: "settlement.completed", capability: "reputation.compute_event" }
|
||||
],
|
||||
permissions: [
|
||||
"compute:jobs:read",
|
||||
"compute:jobs:dispatch",
|
||||
"compute:workers:read",
|
||||
"compute:quotes:create",
|
||||
"compute:usage:report",
|
||||
"compute:settlements:read",
|
||||
"reputation:sync"
|
||||
],
|
||||
tuiPanels: [{ id: "c0mpute-status", title: "c0mpute Jobs" }]
|
||||
};
|
||||
|
||||
export { c0mputeManifest };
|
||||
21
plugins/c0mpute/src/manifest.ts
Normal file
21
plugins/c0mpute/src/manifest.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import type { PluginManifest } from "@logicsrc/plugin-core";
|
||||
|
||||
export const c0mputeManifest: PluginManifest = {
|
||||
id: "c0mpute",
|
||||
name: "c0mpute",
|
||||
version: "0.1.0",
|
||||
type: ["compute", "jobs", "workers", "usage", "settlement"],
|
||||
default: true,
|
||||
capabilities: [
|
||||
"compute.jobs.sync",
|
||||
"compute.jobs.dispatch",
|
||||
"compute.workers.sync",
|
||||
"compute.quotes.create",
|
||||
"compute.usage.report",
|
||||
"compute.settlements.status",
|
||||
"webhook.compute_status",
|
||||
"reputation.compute_event"
|
||||
],
|
||||
commands: ["c0mpute", "compute", "workers", "quotes"],
|
||||
env: ["C0MPUTE_API_URL", "C0MPUTE_API_KEY", "C0MPUTE_WEBHOOK_SECRET"]
|
||||
};
|
||||
8
plugins/c0mpute/tsconfig.json
Normal file
8
plugins/c0mpute/tsconfig.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue