@jhytabest/plashboard 0.1.9 → 0.1.10
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 +4 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/plashboard-admin/SKILL.md +2 -0
- package/src/plugin.ts +90 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ No manual config is required for first use. Defaults are safe:
|
|
|
30
30
|
In chat, run:
|
|
31
31
|
|
|
32
32
|
```text
|
|
33
|
-
/plashboard
|
|
33
|
+
/plashboard onboard <what this dashboard should focus on>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## Optional Config
|
|
@@ -74,6 +74,7 @@ Use `fill_provider: "command"` only if you need a custom external runner.
|
|
|
74
74
|
## Runtime Command
|
|
75
75
|
|
|
76
76
|
```text
|
|
77
|
+
/plashboard onboard <description> [local_url] [https_port] [repo_dir]
|
|
77
78
|
/plashboard setup [openclaw [agent_id]|mock|command <fill_command>]
|
|
78
79
|
/plashboard quickstart <description>
|
|
79
80
|
/plashboard doctor [local_url] [https_port] [repo_dir]
|
|
@@ -93,10 +94,10 @@ Use `fill_provider: "command"` only if you need a custom external runner.
|
|
|
93
94
|
Recommended first run:
|
|
94
95
|
|
|
95
96
|
```text
|
|
96
|
-
/plashboard
|
|
97
|
+
/plashboard onboard "Focus on service health, priorities, blockers, and next actions."
|
|
97
98
|
```
|
|
98
99
|
|
|
99
|
-
If `
|
|
100
|
+
If `onboard` returns web/exposure warnings:
|
|
100
101
|
|
|
101
102
|
```text
|
|
102
103
|
/plashboard web-guide
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "plashboard",
|
|
3
3
|
"name": "Plashboard",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.10",
|
|
5
5
|
"description": "Template-driven dashboard runtime with scheduled OpenClaw fills and safe publish.",
|
|
6
6
|
"entry": "./src/index.ts",
|
|
7
7
|
"skills": ["./skills/plashboard-admin"],
|
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ Use this skill for plashboard runtime administration.
|
|
|
17
17
|
|
|
18
18
|
## Required Tooling
|
|
19
19
|
Always use plugin tools:
|
|
20
|
+
- `plashboard_onboard`
|
|
20
21
|
- `plashboard_setup`
|
|
21
22
|
- `plashboard_exposure_guide`
|
|
22
23
|
- `plashboard_exposure_check`
|
|
@@ -42,6 +43,7 @@ Always use plugin tools:
|
|
|
42
43
|
- Never ask the model to generate full dashboard structure when filling values.
|
|
43
44
|
|
|
44
45
|
## Command Shortcuts
|
|
46
|
+
- `/plashboard onboard <description> [local_url] [https_port] [repo_dir]`
|
|
45
47
|
- `/plashboard quickstart <description>`
|
|
46
48
|
- `/plashboard setup [openclaw [agent_id]|mock|command <fill_command>]`
|
|
47
49
|
- `/plashboard doctor [local_url] [https_port] [repo_dir]`
|
package/src/plugin.ts
CHANGED
|
@@ -126,6 +126,10 @@ type DoctorParams = ExposureParams & {
|
|
|
126
126
|
repo_dir?: string;
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
+
type OnboardParams = DoctorParams & QuickstartParams & {
|
|
130
|
+
force_quickstart?: boolean;
|
|
131
|
+
};
|
|
132
|
+
|
|
129
133
|
type CommandExecResult = {
|
|
130
134
|
ok: boolean;
|
|
131
135
|
stdout: string;
|
|
@@ -607,6 +611,51 @@ async function runDoctor(
|
|
|
607
611
|
};
|
|
608
612
|
}
|
|
609
613
|
|
|
614
|
+
async function runOnboard(
|
|
615
|
+
runtime: PlashboardRuntime,
|
|
616
|
+
resolvedConfig: ReturnType<typeof resolveConfig>,
|
|
617
|
+
params: OnboardParams = {}
|
|
618
|
+
): Promise<ToolResponse<Record<string, unknown>>> {
|
|
619
|
+
const initResult = await runtime.init();
|
|
620
|
+
if (!initResult.ok) return initResult;
|
|
621
|
+
|
|
622
|
+
const beforeStatus = await runtime.status();
|
|
623
|
+
const beforeTemplateCount = Number(beforeStatus.data?.template_count ?? 0);
|
|
624
|
+
const shouldQuickstart = params.force_quickstart === true || beforeTemplateCount === 0;
|
|
625
|
+
|
|
626
|
+
let quickstartResult: ToolResponse<Record<string, unknown>> | null = null;
|
|
627
|
+
if (shouldQuickstart) {
|
|
628
|
+
quickstartResult = await runQuickstart(runtime, resolvedConfig, {
|
|
629
|
+
description: params.description,
|
|
630
|
+
template_id: params.template_id,
|
|
631
|
+
template_name: params.template_name,
|
|
632
|
+
every_minutes: params.every_minutes,
|
|
633
|
+
activate: params.activate,
|
|
634
|
+
run_now: params.run_now
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
const doctorResult = await runDoctor(runtime, resolvedConfig, {
|
|
639
|
+
local_url: params.local_url,
|
|
640
|
+
tailscale_https_port: params.tailscale_https_port,
|
|
641
|
+
dashboard_output_path: params.dashboard_output_path,
|
|
642
|
+
repo_dir: params.repo_dir
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
return {
|
|
646
|
+
ok: doctorResult.ok,
|
|
647
|
+
errors: doctorResult.errors,
|
|
648
|
+
data: {
|
|
649
|
+
workflow: 'onboard',
|
|
650
|
+
init: initResult.data,
|
|
651
|
+
quickstart_ran: shouldQuickstart,
|
|
652
|
+
quickstart: quickstartResult?.data,
|
|
653
|
+
doctor: doctorResult.data,
|
|
654
|
+
next_steps: doctorResult.data?.next_steps ?? []
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
|
|
610
659
|
export function registerPlashboardPlugin(api: UnknownApi): void {
|
|
611
660
|
const config = resolveConfig(api);
|
|
612
661
|
const runtimeCommand = api.runtime?.system?.runCommandWithTimeout;
|
|
@@ -651,6 +700,31 @@ export function registerPlashboardPlugin(api: UnknownApi): void {
|
|
|
651
700
|
}
|
|
652
701
|
});
|
|
653
702
|
|
|
703
|
+
api.registerTool?.({
|
|
704
|
+
name: 'plashboard_onboard',
|
|
705
|
+
description: 'Run complete onboarding flow: init, first template (if needed), and readiness doctor.',
|
|
706
|
+
optional: true,
|
|
707
|
+
parameters: {
|
|
708
|
+
type: 'object',
|
|
709
|
+
properties: {
|
|
710
|
+
description: { type: 'string' },
|
|
711
|
+
template_id: { type: 'string' },
|
|
712
|
+
template_name: { type: 'string' },
|
|
713
|
+
every_minutes: { type: 'number' },
|
|
714
|
+
activate: { type: 'boolean' },
|
|
715
|
+
run_now: { type: 'boolean' },
|
|
716
|
+
local_url: { type: 'string' },
|
|
717
|
+
tailscale_https_port: { type: 'number' },
|
|
718
|
+
dashboard_output_path: { type: 'string' },
|
|
719
|
+
repo_dir: { type: 'string' },
|
|
720
|
+
force_quickstart: { type: 'boolean' }
|
|
721
|
+
},
|
|
722
|
+
additionalProperties: false
|
|
723
|
+
},
|
|
724
|
+
execute: async (_toolCallId: unknown, params: OnboardParams = {}) =>
|
|
725
|
+
toToolResult(await runOnboard(runtime, config, params))
|
|
726
|
+
});
|
|
727
|
+
|
|
654
728
|
api.registerTool?.({
|
|
655
729
|
name: 'plashboard_exposure_guide',
|
|
656
730
|
description: 'Return copy-paste commands to expose dashboard UI over existing Tailscale.',
|
|
@@ -1003,6 +1077,21 @@ export function registerPlashboardPlugin(api: UnknownApi): void {
|
|
|
1003
1077
|
})
|
|
1004
1078
|
);
|
|
1005
1079
|
}
|
|
1080
|
+
if (cmd === 'onboard') {
|
|
1081
|
+
const localUrl = rest.find((token) => token.startsWith('http://') || token.startsWith('https://'));
|
|
1082
|
+
const portToken = rest.find((token) => /^[0-9]+$/.test(token));
|
|
1083
|
+
const repoDir = rest.find((token) => token.startsWith('/'));
|
|
1084
|
+
const descriptionTokens = rest.filter((token) => token !== localUrl && token !== portToken && token !== repoDir);
|
|
1085
|
+
const description = descriptionTokens.join(' ').trim() || undefined;
|
|
1086
|
+
return toCommandResult(
|
|
1087
|
+
await runOnboard(runtime, config, {
|
|
1088
|
+
description,
|
|
1089
|
+
local_url: localUrl,
|
|
1090
|
+
tailscale_https_port: portToken ? Number(portToken) : undefined,
|
|
1091
|
+
repo_dir: repoDir
|
|
1092
|
+
})
|
|
1093
|
+
);
|
|
1094
|
+
}
|
|
1006
1095
|
if (cmd === 'setup') {
|
|
1007
1096
|
const mode = asString(rest[0]).toLowerCase();
|
|
1008
1097
|
const fillProvider = mode === 'command' || mode === 'mock' || mode === 'openclaw' ? mode : undefined;
|
|
@@ -1044,7 +1133,7 @@ export function registerPlashboardPlugin(api: UnknownApi): void {
|
|
|
1044
1133
|
return toCommandResult({
|
|
1045
1134
|
ok: false,
|
|
1046
1135
|
errors: [
|
|
1047
|
-
'unknown command. supported: setup [openclaw [agent_id]|mock|command <fill_command>], quickstart <description>, doctor [local_url] [https_port] [repo_dir], web-guide [local_url] [repo_dir], expose-guide [local_url] [https_port], expose-check [local_url] [https_port], init, status, list, activate <id>, delete <id>, copy <src> <new-id> [new-name] [activate], run <id>, set-display <width> <height> <top> <bottom>'
|
|
1136
|
+
'unknown command. supported: onboard <description> [local_url] [https_port] [repo_dir], setup [openclaw [agent_id]|mock|command <fill_command>], quickstart <description>, doctor [local_url] [https_port] [repo_dir], web-guide [local_url] [repo_dir], expose-guide [local_url] [https_port], expose-check [local_url] [https_port], init, status, list, activate <id>, delete <id>, copy <src> <new-id> [new-name] [activate], run <id>, set-display <width> <height> <top> <bottom>'
|
|
1048
1137
|
]
|
|
1049
1138
|
});
|
|
1050
1139
|
}
|