Plugin id `harbor-forge` mirrors the OpenClaw counterpart's runtime
surface on top of the Plexum SDK:
* eager activation — Monitor bridge + Calendar scheduler boot at
host start, before any agent turn fires
* monitor bridge: HTTP 127.0.0.1:<monitor_port> serving /telemetry
+ /health for HarborForge.Monitor
* calendar scheduler: heartbeats <backendUrl>/calendar/agent/
heartbeat, dispatches returned slots via HostAPI.WakeAgent
(state-aware queue, depth-1 replace-newest), tracks active slot
state in-memory, terminal status pushed back to backend
* 9 harborforge_* tools (status / telemetry / monitor_telemetry /
calendar_{status,complete,abort,pause,resume} / restart_status)
Key differences from OpenClaw equivalent:
* api.spawn → HostAPI.WakeAgent (new SDK primitive)
* api.getAgentStatus → HostAPI.ReadAgentState (existing)
* --install-monitor / --install-cli not included; Monitor + hf CLI
deploy via the HangmanLab.Server.T3 docker compose layer
Initial drop. TODO before v1 ship:
* tool ctx → calling-agent-id: SDK doesn't currently expose; v1
falls back to a single-active-slot heuristic in
main.bestEffortAgentID
* tests for the bridge + scheduler
49 lines
1.4 KiB
Bash
Executable File
49 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# HarborForge.PlexumPlugin installer.
|
|
set -euo pipefail
|
|
|
|
REPO="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
PROFILE_DIR="${HOME}/.plexum"
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--profile) PROFILE_DIR="$2"; shift 2 ;;
|
|
-h|--help) sed -n '2,/^set -euo/p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
|
*) echo "unknown flag: $1" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
|
|
log() { printf '\033[1;34m[hf-install]\033[0m %s\n' "$*"; }
|
|
command -v go >/dev/null || { echo "go not found on PATH" >&2; exit 1; }
|
|
|
|
PLUGIN_DIR="${PROFILE_DIR}/plugins/harbor-forge"
|
|
mkdir -p "${PLUGIN_DIR}"
|
|
|
|
cd "${REPO}"
|
|
VERSION="$(git describe --tags --always 2>/dev/null || echo dev)"
|
|
LDFLAGS="-X main.Version=${VERSION}"
|
|
log "building plexum-harborforge-plugin (v=${VERSION})"
|
|
CGO_ENABLED=0 go build -ldflags="${LDFLAGS}" \
|
|
-o "${PLUGIN_DIR}/plexum-harborforge-plugin" \
|
|
./cmd/plexum-harborforge-plugin
|
|
|
|
cp manifest.json "${PLUGIN_DIR}/manifest.json"
|
|
log "installed binary + manifest to ${PLUGIN_DIR}"
|
|
|
|
cat <<EOF
|
|
|
|
Next steps:
|
|
1. Add to ${PROFILE_DIR}/plexum.json .plugins.allow:
|
|
"harbor-forge"
|
|
2. Write ${PLUGIN_DIR}/config.json — sample:
|
|
{
|
|
"backendUrl": "https://monitor.hangman-lab.top",
|
|
"identifier": "server-t3",
|
|
"apiKey": "g1_xxx",
|
|
"monitor_port": 9100,
|
|
"calendar_enabled": true,
|
|
"calendar_heartbeat_interval_seconds": 30
|
|
}
|
|
3. Restart the host: systemctl --user restart plexum
|
|
EOF
|