openclaw-brokerkit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +197 -0
- package/dist/index.js +113 -0
- package/dist/src/client.js +152 -0
- package/dist/src/commands.js +101 -0
- package/dist/src/config.js +108 -0
- package/dist/src/errors.js +15 -0
- package/dist/src/generated/operator-v1.js +57 -0
- package/dist/src/http.js +279 -0
- package/dist/src/operator-v1.js +92 -0
- package/dist/src/runtime.js +312 -0
- package/dist/src/store.js +235 -0
- package/dist/src/types.js +1 -0
- package/dist/ui/assets/index-8w0_bcoC.js +143 -0
- package/dist/ui/assets/index-D8Ypbs3j.css +1 -0
- package/dist/ui/index.html +13 -0
- package/openclaw.plugin.json +98 -0
- package/package.json +77 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components,utilities;:root{color:#18211c;font-synthesis:none;background:#f4f6f4;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}body{letter-spacing:0;margin:0}.launcher{text-align:center;place-content:center;justify-items:center;gap:.9rem;min-height:100vh;padding:2rem;display:grid}.launcher p{max-width:32rem}button{font:inherit;letter-spacing:0}main{width:min(760px,100%);margin:0 auto;padding:28px 20px 60px}header{border-bottom:1px solid #d8ded9;justify-content:space-between;align-items:flex-start;padding-bottom:18px;display:flex}h1{letter-spacing:0;margin:3px 0 4px;font-size:26px;line-height:1.15}h2{letter-spacing:0;margin:8px 0 0;font-size:16px;line-height:1.3}.eyebrow{color:#27633e;text-transform:uppercase;align-items:center;gap:6px;margin:0;font-size:12px;font-weight:700;display:flex}.subtle{color:#657168;margin:0;font-size:13px}.icon{color:#34483a;background:#fff;border:1px solid #ccd4ce;border-radius:6px;place-items:center;width:38px;height:38px;display:grid}.error{color:#8c2f20;background:#fff4f1;border:1px solid #e2b5ad;border-radius:6px;align-items:center;gap:9px;margin-top:16px;padding:10px 12px;font-size:13px;display:flex}.error span{flex:1}.warning{color:#705400;background:#fff8e6;border:1px solid #d8bd72;border-radius:6px;align-items:center;gap:9px;margin-top:16px;padding:10px 12px;font-size:13px;display:flex}.error button{color:inherit;background:0 0;border:0}.sources{border-bottom:1px solid #d8ded9;gap:18px;padding:16px 0;display:flex;overflow:auto}.source{grid-template-columns:8px auto;align-items:center;column-gap:7px;min-width:max-content;font-size:13px;display:grid}.source small{color:#748077;grid-column:2;font-size:11px}.dot{background:#b74332;border-radius:50%;width:8px;height:8px}.dot.healthy{background:#3c8b55}.requests{gap:12px;padding-top:18px;display:grid}.requests article{background:#fff;border:1px solid #d5dbd6;border-radius:7px;padding:16px;box-shadow:0 1px 2px #16261b0a}.request-head{justify-content:space-between;gap:16px;display:flex}.request-head code{color:#718077;background:#f1f4f1;border-radius:4px;height:max-content;padding:4px 6px;font-size:11px}.risk{text-transform:uppercase;color:#4e5b52;background:#edf0ed;border-radius:4px;padding:3px 5px;font-size:10px;font-weight:700}.risk.high,.risk.critical{color:#a53a29;background:#fff0ed}.risk.medium{color:#805c00;background:#fff7df}.source-label{color:#68766c;margin-left:8px;font-size:11px}.requests article>p{color:#4f5d53;margin:8px 0 12px;font-size:13px;line-height:1.5}dl{grid-template-columns:minmax(90px,130px) 1fr;gap:5px 12px;margin:0;font-size:12px;display:grid}dt{color:#718077}dd{overflow-wrap:anywhere;margin:0}.meta{color:#68766c;gap:8px;margin-top:14px;font-size:11px;display:flex}.meta span+span:before{content:"·";margin-right:8px}.actions{justify-content:flex-end;gap:8px;margin-top:16px;display:flex}.actions button{border-radius:6px;justify-content:center;align-items:center;gap:6px;min-height:36px;padding:0 12px;font-size:13px;font-weight:650;display:inline-flex}.primary{color:#fff;background:#27633e;border:1px solid #27633e}.secondary{color:#39473d;background:#fff;border:1px solid #cbd3cd}.actions button:disabled{opacity:.55}.dialog-overlay{background:#1219147a;position:fixed;inset:0}.dialog-content{background:#fff;border:1px solid #cbd3cd;border-radius:7px;width:min(440px,100vw - 28px);max-height:calc(100vh - 28px);padding:20px;position:fixed;top:50%;left:50%;overflow:auto;transform:translate(-50%,-50%);box-shadow:0 18px 48px #12191438}.dialog-content h2{margin:0;font-size:18px}.dialog-content>p{color:#5c685f;overflow-wrap:anywhere;margin:6px 0 18px;font-size:13px}.decision-bounds{grid-template-columns:1fr 1fr;gap:12px;display:grid}.dialog-content label{color:#455249;gap:6px;font-size:12px;font-weight:650;display:grid}.dialog-content input,.dialog-content textarea{color:#18211c;width:100%;font:inherit;background:#fff;border:1px solid #bcc6be;border-radius:5px;padding:9px 10px;font-weight:400}.reason{margin-top:14px}.dialog-actions{justify-content:flex-end;gap:8px;margin-top:18px;display:flex}.dialog-actions button{border-radius:6px;min-height:36px;padding:0 14px;font-weight:650}.danger{color:#fff;background:#9e382b;border:1px solid #9e382b}.dialog-actions button:disabled{opacity:.55}.empty{text-align:center;color:#68766c;padding:60px 20px}.empty svg{color:#3c8b55}.empty h2{color:#27342b}.empty p{font-size:13px}@media(max-width:520px){main{padding:20px 14px 40px}.request-head{align-items:flex-start}.actions button{flex:1}.meta{flex-wrap:wrap}dl,.decision-bounds{grid-template-columns:1fr}dd{margin-bottom:5px}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
6
|
+
<title>BrokerKit Approvals</title>
|
|
7
|
+
<script type="module" crossorigin src="/plugins/brokerkit/ui/assets/index-8w0_bcoC.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/plugins/brokerkit/ui/assets/index-D8Ypbs3j.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "brokerkit",
|
|
3
|
+
"activation": { "onStartup": true },
|
|
4
|
+
"name": "BrokerKit",
|
|
5
|
+
"description": "Provider-neutral approval inbox for BrokerKit sources.",
|
|
6
|
+
"configSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"$defs": {
|
|
9
|
+
"secretRef": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"properties": {
|
|
13
|
+
"source": { "enum": ["env", "file", "exec"] },
|
|
14
|
+
"provider": { "type": "string", "minLength": 1, "maxLength": 64 },
|
|
15
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 512 }
|
|
16
|
+
},
|
|
17
|
+
"required": ["source", "provider", "id"]
|
|
18
|
+
},
|
|
19
|
+
"broker": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"properties": {
|
|
23
|
+
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,63}$" },
|
|
24
|
+
"label": { "type": "string", "minLength": 1, "maxLength": 80 },
|
|
25
|
+
"endpoint": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"format": "uri",
|
|
28
|
+
"pattern": "^https?://",
|
|
29
|
+
"not": { "pattern": "[?#]" }
|
|
30
|
+
},
|
|
31
|
+
"operatorCredential": { "$ref": "#/$defs/secretRef" },
|
|
32
|
+
"requestTimeoutMs": {
|
|
33
|
+
"type": "integer",
|
|
34
|
+
"minimum": 1000,
|
|
35
|
+
"maximum": 60000
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": ["id", "label", "endpoint", "operatorCredential"]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"oneOf": [
|
|
42
|
+
{
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"properties": {
|
|
45
|
+
"mode": { "const": "direct" },
|
|
46
|
+
"brokers": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"minItems": 1,
|
|
49
|
+
"maxItems": 32,
|
|
50
|
+
"items": { "$ref": "#/$defs/broker" }
|
|
51
|
+
},
|
|
52
|
+
"pollIntervalMs": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"minimum": 5000,
|
|
55
|
+
"maximum": 300000
|
|
56
|
+
},
|
|
57
|
+
"notificationConcurrency": {
|
|
58
|
+
"type": "integer",
|
|
59
|
+
"minimum": 1,
|
|
60
|
+
"maximum": 16
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"required": ["mode", "brokers"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"properties": {
|
|
68
|
+
"mode": { "const": "delegated-web" },
|
|
69
|
+
"delegatedWeb": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"additionalProperties": false,
|
|
72
|
+
"properties": {
|
|
73
|
+
"basePath": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"minLength": 2,
|
|
76
|
+
"maxLength": 256,
|
|
77
|
+
"pattern": "^/[A-Za-z0-9._~-]+(?:/[A-Za-z0-9._~-]+)*$"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"required": ["basePath"]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"required": ["mode", "delegatedWeb"]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"configContracts": {
|
|
88
|
+
"secretInputs": {
|
|
89
|
+
"bundledDefaultEnabled": false,
|
|
90
|
+
"paths": [
|
|
91
|
+
{
|
|
92
|
+
"path": "brokers.*.operatorCredential",
|
|
93
|
+
"expected": "string"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openclaw-brokerkit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Provider-neutral BrokerKit approvals for OpenClaw",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"openclaw.plugin.json",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "pnpm run clean && vite build && tsc -p tsconfig.build.json",
|
|
16
|
+
"check": "pnpm run generate:check && pnpm run typecheck && pnpm run lint && pnpm run format:check",
|
|
17
|
+
"clean": "rm -rf dist",
|
|
18
|
+
"test": "vitest run --config vitest.config.ts",
|
|
19
|
+
"test:browser": "playwright test",
|
|
20
|
+
"test:package": "node scripts/test-packed-install.mjs",
|
|
21
|
+
"generate": "node scripts/generate-operator-v1.mjs",
|
|
22
|
+
"generate:check": "node scripts/generate-operator-v1.mjs --check",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"lint": "eslint .",
|
|
25
|
+
"format:check": "prettier --check ."
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"openclaw": ">=2026.7.1-beta.5"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@eslint/js": "9.31.0",
|
|
32
|
+
"@playwright/test": "1.61.1",
|
|
33
|
+
"@tailwindcss/vite": "4.1.11",
|
|
34
|
+
"@types/node": "24.0.13",
|
|
35
|
+
"@types/react": "19.1.8",
|
|
36
|
+
"@types/react-dom": "19.1.6",
|
|
37
|
+
"@vitejs/plugin-react": "4.6.0",
|
|
38
|
+
"eslint": "9.31.0",
|
|
39
|
+
"eslint-plugin-react-hooks": "5.2.0",
|
|
40
|
+
"eslint-plugin-react-refresh": "0.4.20",
|
|
41
|
+
"globals": "16.3.0",
|
|
42
|
+
"openclaw": "2026.7.1-beta.5",
|
|
43
|
+
"prettier": "3.6.2",
|
|
44
|
+
"tailwindcss": "4.1.11",
|
|
45
|
+
"typescript": "5.8.3",
|
|
46
|
+
"typescript-eslint": "8.37.0",
|
|
47
|
+
"vite": "7.0.4",
|
|
48
|
+
"vitest": "3.2.4"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@radix-ui/react-dialog": "1.1.14",
|
|
52
|
+
"class-variance-authority": "0.7.1",
|
|
53
|
+
"clsx": "2.1.1",
|
|
54
|
+
"lucide-react": "0.525.0",
|
|
55
|
+
"react": "19.1.0",
|
|
56
|
+
"react-dom": "19.1.0",
|
|
57
|
+
"tailwind-merge": "3.3.0",
|
|
58
|
+
"zod": "4.0.5"
|
|
59
|
+
},
|
|
60
|
+
"openclaw": {
|
|
61
|
+
"extensions": [
|
|
62
|
+
"./dist/index.js"
|
|
63
|
+
],
|
|
64
|
+
"install": {
|
|
65
|
+
"npmSpec": "openclaw-brokerkit",
|
|
66
|
+
"defaultChoice": "npm",
|
|
67
|
+
"minHostVersion": ">=2026.7.1-beta.5"
|
|
68
|
+
},
|
|
69
|
+
"compat": {
|
|
70
|
+
"pluginApi": ">=2026.7.1-beta.5"
|
|
71
|
+
},
|
|
72
|
+
"release": {
|
|
73
|
+
"publishToClawHub": true,
|
|
74
|
+
"publishToNpm": true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|