@jhytabest/plashboard 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/openclaw.plugin.json +52 -0
- package/package.json +39 -0
- package/schema/fill-response.schema.json +14 -0
- package/schema/template.schema.json +124 -0
- package/scripts/dashboard_write.py +543 -0
- package/skills/plashboard-admin/SKILL.md +46 -0
- package/src/config.ts +73 -0
- package/src/fill-runner.ts +122 -0
- package/src/index.ts +7 -0
- package/src/json-pointer.ts +102 -0
- package/src/merge.test.ts +65 -0
- package/src/merge.ts +108 -0
- package/src/plugin.ts +272 -0
- package/src/publisher.ts +98 -0
- package/src/runtime.test.ts +163 -0
- package/src/runtime.ts +622 -0
- package/src/schema-validation.ts +35 -0
- package/src/stores.ts +127 -0
- package/src/types.ts +139 -0
- package/src/utils.ts +46 -0
- package/tsconfig.json +13 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "plashboard",
|
|
3
|
+
"name": "Plashboard",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Template-driven dashboard runtime with scheduled OpenClaw fills and safe publish.",
|
|
6
|
+
"entry": "./src/index.ts",
|
|
7
|
+
"skills": ["./skills/plashboard-admin"],
|
|
8
|
+
"configSchema": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"data_dir": { "type": "string", "default": "/var/lib/openclaw/plash-data" },
|
|
12
|
+
"timezone": { "type": "string" },
|
|
13
|
+
"scheduler_tick_seconds": { "type": "integer", "minimum": 5, "default": 30 },
|
|
14
|
+
"max_parallel_runs": { "type": "integer", "minimum": 1, "maximum": 8, "default": 1 },
|
|
15
|
+
"default_retry_count": { "type": "integer", "minimum": 0, "maximum": 5, "default": 1 },
|
|
16
|
+
"retry_backoff_seconds": { "type": "integer", "minimum": 1, "maximum": 300, "default": 20 },
|
|
17
|
+
"session_timeout_seconds": { "type": "integer", "minimum": 10, "maximum": 600, "default": 90 },
|
|
18
|
+
"fill_provider": { "type": "string", "enum": ["command", "mock"], "default": "mock" },
|
|
19
|
+
"fill_command": { "type": "string" },
|
|
20
|
+
"python_bin": { "type": "string", "default": "python3" },
|
|
21
|
+
"writer_script_path": { "type": "string" },
|
|
22
|
+
"dashboard_output_path": { "type": "string" },
|
|
23
|
+
"layout_overflow_tolerance_px": { "type": "integer", "minimum": 0, "maximum": 200, "default": 40 },
|
|
24
|
+
"display_profile": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"properties": {
|
|
27
|
+
"width_px": { "type": "integer", "minimum": 320, "default": 1920 },
|
|
28
|
+
"height_px": { "type": "integer", "minimum": 240, "default": 1080 },
|
|
29
|
+
"safe_top_px": { "type": "integer", "minimum": 0, "default": 96 },
|
|
30
|
+
"safe_bottom_px": { "type": "integer", "minimum": 0, "default": 106 },
|
|
31
|
+
"safe_side_px": { "type": "integer", "minimum": 0, "default": 28 },
|
|
32
|
+
"layout_safety_margin_px": { "type": "integer", "minimum": 0, "default": 24 }
|
|
33
|
+
},
|
|
34
|
+
"additionalProperties": false
|
|
35
|
+
},
|
|
36
|
+
"model_defaults": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"model": { "type": "string" },
|
|
40
|
+
"temperature": { "type": "number", "minimum": 0, "maximum": 2 },
|
|
41
|
+
"max_tokens": { "type": "integer", "minimum": 64, "maximum": 8192 }
|
|
42
|
+
},
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
},
|
|
48
|
+
"uiHints": {
|
|
49
|
+
"displayName": "Plashboard",
|
|
50
|
+
"category": "automation"
|
|
51
|
+
}
|
|
52
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jhytabest/plashboard",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Plashboard OpenClaw plugin runtime",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "src/index.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"openclaw.plugin.json",
|
|
11
|
+
"schema",
|
|
12
|
+
"scripts",
|
|
13
|
+
"skills",
|
|
14
|
+
"src",
|
|
15
|
+
"tsconfig.json",
|
|
16
|
+
"vitest.config.ts"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"typecheck": "tsc --noEmit"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"ajv": "^8.17.1"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^22.15.30",
|
|
31
|
+
"typescript": "^5.8.3",
|
|
32
|
+
"vitest": "^4.0.18"
|
|
33
|
+
},
|
|
34
|
+
"openclaw": {
|
|
35
|
+
"extensions": [
|
|
36
|
+
"./src/index.ts"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://example.local/plash-fill-response.schema.json",
|
|
4
|
+
"title": "Plashboard Fill Response v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["values"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"values": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"additionalProperties": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"additionalProperties": false
|
|
14
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://example.local/plash-template.schema.json",
|
|
4
|
+
"title": "Plashboard Template v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["id", "name", "enabled", "schedule", "base_dashboard", "fields"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
|
|
11
|
+
},
|
|
12
|
+
"name": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"maxLength": 120
|
|
16
|
+
},
|
|
17
|
+
"enabled": {
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
"schedule": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"required": ["mode", "every_minutes", "timezone"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"mode": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"const": "interval"
|
|
27
|
+
},
|
|
28
|
+
"every_minutes": {
|
|
29
|
+
"type": "integer",
|
|
30
|
+
"minimum": 1
|
|
31
|
+
},
|
|
32
|
+
"timezone": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"additionalProperties": false
|
|
38
|
+
},
|
|
39
|
+
"base_dashboard": {
|
|
40
|
+
"type": "object"
|
|
41
|
+
},
|
|
42
|
+
"fields": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"minItems": 0,
|
|
45
|
+
"items": {
|
|
46
|
+
"$ref": "#/$defs/field"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"context": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"properties": {
|
|
52
|
+
"dashboard_prompt": { "type": "string" },
|
|
53
|
+
"section_prompts": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": { "type": "string" }
|
|
56
|
+
},
|
|
57
|
+
"card_prompts": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": { "type": "string" }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"additionalProperties": false
|
|
63
|
+
},
|
|
64
|
+
"run": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"properties": {
|
|
67
|
+
"retry_count": { "type": "integer", "minimum": 0, "maximum": 5 },
|
|
68
|
+
"repair_attempts": { "type": "integer", "minimum": 0, "maximum": 3 },
|
|
69
|
+
"model": { "type": "string" },
|
|
70
|
+
"temperature": { "type": "number", "minimum": 0, "maximum": 2 },
|
|
71
|
+
"max_tokens": { "type": "integer", "minimum": 64, "maximum": 8192 }
|
|
72
|
+
},
|
|
73
|
+
"additionalProperties": false
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"$defs": {
|
|
78
|
+
"field": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"required": ["id", "pointer", "type", "prompt"],
|
|
81
|
+
"properties": {
|
|
82
|
+
"id": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
|
|
85
|
+
},
|
|
86
|
+
"pointer": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"pattern": "^/.*"
|
|
89
|
+
},
|
|
90
|
+
"type": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"enum": ["string", "number", "boolean", "array"]
|
|
93
|
+
},
|
|
94
|
+
"prompt": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"minLength": 1,
|
|
97
|
+
"maxLength": 1200
|
|
98
|
+
},
|
|
99
|
+
"required": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"default": true
|
|
102
|
+
},
|
|
103
|
+
"constraints": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"properties": {
|
|
106
|
+
"max_len": { "type": "integer", "minimum": 1, "maximum": 4000 },
|
|
107
|
+
"min": { "type": "number" },
|
|
108
|
+
"max": { "type": "number" },
|
|
109
|
+
"enum": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": {
|
|
112
|
+
"type": ["string", "number", "boolean"]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"min_items": { "type": "integer", "minimum": 0 },
|
|
116
|
+
"max_items": { "type": "integer", "minimum": 0 }
|
|
117
|
+
},
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"additionalProperties": false
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|