Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ PicoClaw can act as an L1 edge node in a distributed architecture, reporting to
"node_name": "Datacenter Rack A1",
"cloud_endpoint": "http://nanoclaw:8080",
"cloud_token": "...",
"heartbeat_seconds": 30
"heartbeat_seconds": 30,
"status_seconds": 60
}
}
```
Expand All @@ -281,7 +282,12 @@ When enabled, PicoClaw exposes:
- `GET /api/v1/status` — Node status
- `POST /api/v1/command` — Receive commands from fleet

And periodically sends heartbeats (including gene stats) to the configured fleet manager.
And reports to the configured fleet manager:
- `POST /fleet/register` — Register the PicClaw node when the reporter starts
- `POST /fleet/heartbeat` — Send liveness, uptime, and gene stats on `heartbeat_seconds`
- `POST /fleet/status` — Send full node status and high-confidence genes on `status_seconds`
- `POST /fleet/events` — Send synchronous or queued event reports
- `POST /fleet/genes/publish` — Publish high-confidence genes for cross-node sharing

## Skills (6 built-in)

Expand Down
3 changes: 2 additions & 1 deletion cmd/picoclaw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ func gatewayCmd() {
Cloud: edge.CloudConfig{
Endpoint: cfg.Edge.CloudEndpoint,
HeartbeatInterval: time.Duration(cfg.Edge.HeartbeatSeconds) * time.Second,
StatusInterval: time.Duration(cfg.Edge.StatusSeconds) * time.Second,
Token: cfg.Edge.CloudToken,
},
}
Expand Down Expand Up @@ -991,7 +992,7 @@ func cronHelp() {

func cronListCmd(storePath string) {
cs := cron.NewCronService(storePath, nil)
jobs := cs.ListJobs(true) // Show all jobs, including disabled
jobs := cs.ListJobs(true) // Show all jobs, including disabled

if len(jobs) == 0 {
fmt.Println("No scheduled jobs.")
Expand Down
3 changes: 2 additions & 1 deletion config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"node_name": "picclaw-edge",
"cloud_endpoint": "http://localhost:8080",
"cloud_token": "",
"heartbeat_seconds": 30
"heartbeat_seconds": 30,
"status_seconds": 60
},
"gene": {
"strategy": "balanced",
Expand Down
23 changes: 12 additions & 11 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ type Config struct {

// EdgeConfig holds edge API server and fleet reporter settings.
type EdgeConfig struct {
Enabled bool `json:"enabled" env:"PICOCLAW_EDGE_ENABLED"`
Port int `json:"port" env:"PICOCLAW_EDGE_PORT"`
NodeID string `json:"node_id" env:"PICOCLAW_EDGE_NODE_ID"`
NodeName string `json:"node_name" env:"PICOCLAW_EDGE_NODE_NAME"`
CloudEndpoint string `json:"cloud_endpoint" env:"PICOCLAW_EDGE_CLOUD_ENDPOINT"`
CloudToken string `json:"cloud_token" env:"PICOCLAW_EDGE_CLOUD_TOKEN"`
HeartbeatSeconds int `json:"heartbeat_seconds" env:"PICOCLAW_EDGE_HEARTBEAT_SECONDS"`
Enabled bool `json:"enabled" env:"PICOCLAW_EDGE_ENABLED"`
Port int `json:"port" env:"PICOCLAW_EDGE_PORT"`
NodeID string `json:"node_id" env:"PICOCLAW_EDGE_NODE_ID"`
NodeName string `json:"node_name" env:"PICOCLAW_EDGE_NODE_NAME"`
CloudEndpoint string `json:"cloud_endpoint" env:"PICOCLAW_EDGE_CLOUD_ENDPOINT"`
CloudToken string `json:"cloud_token" env:"PICOCLAW_EDGE_CLOUD_TOKEN"`
HeartbeatSeconds int `json:"heartbeat_seconds" env:"PICOCLAW_EDGE_HEARTBEAT_SECONDS"`
StatusSeconds int `json:"status_seconds" env:"PICOCLAW_EDGE_STATUS_SECONDS"`
}

// GeneAppConfig holds Gene Evolution engine settings exposed to the user.
Expand Down Expand Up @@ -103,10 +104,10 @@ type QQConfig struct {
}

type DingTalkConfig struct {
Enabled bool `json:"enabled" env:"PICOCLAW_CHANNELS_DINGTALK_ENABLED"`
ClientID string `json:"client_id" env:"PICOCLAW_CHANNELS_DINGTALK_CLIENT_ID"`
ClientSecret string `json:"client_secret" env:"PICOCLAW_CHANNELS_DINGTALK_CLIENT_SECRET"`
AllowFrom []string `json:"allow_from" env:"PICOCLAW_CHANNELS_DINGTALK_ALLOW_FROM"`
Enabled bool `json:"enabled" env:"PICOCLAW_CHANNELS_DINGTALK_ENABLED"`
ClientID string `json:"client_id" env:"PICOCLAW_CHANNELS_DINGTALK_CLIENT_ID"`
ClientSecret string `json:"client_secret" env:"PICOCLAW_CHANNELS_DINGTALK_CLIENT_SECRET"`
AllowFrom []string `json:"allow_from" env:"PICOCLAW_CHANNELS_DINGTALK_ALLOW_FROM"`
}

type ProvidersConfig struct {
Expand Down
6 changes: 5 additions & 1 deletion pkg/edge/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ type CloudConfig struct {
// HeartbeatInterval is the interval between heartbeat reports.
HeartbeatInterval time.Duration `json:"heartbeat_interval"`

// StatusInterval is the interval between full status reports.
StatusInterval time.Duration `json:"status_interval"`

// Token is the authentication token for the Fleet Manager.
Token string `json:"token,omitempty"`
}
Expand All @@ -45,6 +48,7 @@ func DefaultConfig() Config {
Cloud: CloudConfig{
Endpoint: "http://localhost:8080",
HeartbeatInterval: 30 * time.Second,
StatusInterval: 60 * time.Second,
},
}
}
}
Loading