@dev.sail.money/sailor 1.1.0-64 → 1.1.0-65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev.sail.money/sailor",
3
- "version": "1.1.0-64",
3
+ "version": "1.1.0-65",
4
4
  "description": "Operator toolkit for Sail Protocol",
5
5
  "bin": {
6
6
  "sailor": "packages/cli/dist/index.cjs"
@@ -5,7 +5,7 @@
5
5
  * Do not edit manually — run `pnpm build` to regenerate.
6
6
  *
7
7
  * Spec version : 1.2.0
8
- * Generated at : 2026-06-15T18:00:42.970Z
8
+ * Generated at : 2026-06-15T18:44:48.167Z
9
9
  */
10
10
  export declare const SAIL_INTELLIGENCE_BASE_URL = "https://api.sail.money";
11
11
  export declare const SAIL_INTELLIGENCE_DOCS_URL = "https://api.sail.money/docs";
@@ -5,7 +5,7 @@
5
5
  * Do not edit manually — run `pnpm build` to regenerate.
6
6
  *
7
7
  * Spec version : 1.2.0
8
- * Generated at : 2026-06-15T18:00:42.970Z
8
+ * Generated at : 2026-06-15T18:44:48.167Z
9
9
  */
10
10
  export const SAIL_INTELLIGENCE_BASE_URL = "https://api.sail.money";
11
11
  export const SAIL_INTELLIGENCE_DOCS_URL = "https://api.sail.money/docs";
@@ -1,66 +1,63 @@
1
1
  ---
2
2
  name: sail-ci
3
- description: Automate the agent on a schedule with GitHub Actions exporting the encrypted keystore, committing the right files, configuring secrets, and driving the workflow with the gh CLI. Use when the user wants the agent to run on a schedule, in CI, or unattended after sailor run --once has been confirmed working.
3
+ description: Run the agent unattended cloud (GitHub Actions cron + workflow_dispatch), a local OS service (sailor service install), or on-demand via the trigger seam (sailor trigger github) with cadence guidance and the committed-keystore trust model. Use after sailor run --once works.
4
4
  ---
5
5
 
6
- # Sail CI — GitHub Actions automation
6
+ # Sail CI — automating the agent
7
7
 
8
- The scaffolded workflow at `.github/workflows/agent-tick.yml` runs `npx sailor run --once` on a cron schedule (default: every Monday 09:00 UTC — edit the `cron` line to the user's cadence; `workflow_dispatch` allows manual runs). It uses `npm ci`, copies `ci-keystore.json` to `.sail/keys/manager.json`, and unlocks it with `SAIL_PASSPHRASE`. `CHAIN_ID` comes from the repository variable `CHAIN_ID` (default `8453`). No private key ever appears in the workflow or in secrets.
8
+ Confirm `sailor run --once` works first. Three hosts run the same loop; pick by latency, privacy, and ops:
9
9
 
10
- Confirm `sailor run --once` works locally before automating.
10
+ - **Cloud** GitHub Actions cron + `workflow_dispatch`. Zero infra; cron drifts (see Cadence).
11
+ - **Local daemon** — `sailor service install`. Private, no committed keys, lower latency, no GitHub — you run the host.
12
+ - **Event-driven** — an external system fires a run via the trigger seam (a keeper/watcher on a price move or deposit). The direction, not yet built; today the seam is `sailor trigger github`.
11
13
 
12
- ## 1. Export the keystore
14
+ ## Cadence
13
15
 
14
- ```bash
15
- sailor keys export-ci
16
- ```
16
+ Match the interval to volatility: **LP / perp → minutes; DCA / rebalance → daily; treasury → hourly–daily.** Actions cron is a *heartbeat/backstop* that drifts and skips under load — not low-latency; for that, use an external trigger or the local daemon.
17
17
 
18
- Copies the encrypted agent wallet to `ci-keystore.json` in the project root and adds a `!ci-keystore.json` allowlist entry to `.gitignore`. The keystore is geth v3 encrypted (scrypt + aes-128-ctr); the raw private key is never exposed — safe to commit.
18
+ ## Cloud: GitHub Actions
19
19
 
20
- ## 2. Commit the required files
20
+ `.github/workflows/agent-tick.yml` runs `npx sailor run --once` on cron (default hourly `0 * * * *`, a generic placeholder — tune `cron` to your strategy per Cadence above; `workflow_dispatch` enables manual/external runs), via `npm ci`. `CHAIN_ID` comes from the repo variable (default `8453`).
21
21
 
22
- CI needs these non-secret files in the repo:
22
+ 1. **Export** `sailor keys export-ci` writes the geth-v3 encrypted `ci-keystore.json` (raw key never exposed) and allowlists it in `.gitignore`.
23
+ 2. **Commit** the non-secret files (`npm install` first for the lockfile):
23
24
 
24
25
  ```bash
25
- npm install # generate package-lock.json if it doesn't exist
26
26
  git add ci-keystore.json package-lock.json .sail/account.json .sail/config.json .sail/mandate.json
27
27
  git commit -m "chore: add CI keystore and sail state" && git push
28
28
  ```
29
29
 
30
- `package-lock.json` is required by `npm ci`. `.sail/account.json`, `.sail/config.json`, and `.sail/mandate.json` contain only public addresses and flags no secrets. The `.gitignore` already has `!` exceptions for all of these.
31
-
32
- ## 3. Add the two repository secrets
30
+ 3. **Secrets** (Settings Secrets and variables Actions): `SAIL_PASSPHRASE`, `RPC_URL`. If not Base, set the repo **variable** `CHAIN_ID`.
31
+ 4. **Drive with `gh`** (needs the `workflow` scope — `gh auth login --scopes workflow`):
33
32
 
34
- GitHub → Settings → Secrets and variables → Actions:
35
-
36
- - `SAIL_PASSPHRASE` the passphrase that encrypts the agent wallet
37
- - `RPC_URL` the RPC endpoint
38
-
39
- (If the chain is not Base, also set the repository **variable** `CHAIN_ID` to the right chain id.)
33
+ ```bash
34
+ gh secret set SAIL_PASSPHRASE && gh secret set RPC_URL
35
+ gh workflow run agent-tick.yml # manual run
36
+ gh run list --workflow agent-tick.yml # history
37
+ gh run view --log # latest logs
38
+ ```
40
39
 
41
- ## 4. Install and authenticate the gh CLI
40
+ ## On-demand / external trigger
42
41
 
43
- Required to manage the workflow from the terminal (trigger runs, check logs, add secrets without the browser):
42
+ ```bash
43
+ sailor trigger github # fire workflow_dispatch — the same job cron runs
44
+ # --reason <text> --ref <branch> --workflow <file> --repo <owner/repo> --json
45
+ ```
44
46
 
45
- - macOS: `brew install gh`
46
- - Windows: `winget install --id GitHub.cli` or `scoop install gh`
47
- - Linux: https://github.com/cli/cli/blob/trunk/docs/install_linux.md
47
+ Wakes the agent between cron ticks — the seam keepers, watchers, or your backend call.
48
48
 
49
- Authenticate with the `workflow` scope — without it, `gh` cannot trigger or inspect Actions runs:
49
+ ## Local daemon
50
50
 
51
51
  ```bash
52
- gh auth login --scopes workflow
53
- gh auth status # confirm workflow scope is listed
52
+ sailor service install --interval 300 # launchd/systemd/Task Scheduler; restarts on crash
53
+ sailor service status | stop | uninstall
54
+ sailor service logs -f # .sail/agent.log
54
55
  ```
55
56
 
56
- ## 5. Drive it
57
+ `--project`/`--chain` scope it; `--force` overrides a TCC path or unresolved passphrase.
57
58
 
58
- ```bash
59
- gh secret set SAIL_PASSPHRASE # prompts for the value
60
- gh secret set RPC_URL
61
- gh workflow run agent-tick.yml # manual trigger
62
- gh run list --workflow agent-tick.yml # run history
63
- gh run view --log # logs of the latest run
64
- ```
59
+ ## Keys & trust
60
+
61
+ Cloud commits only the **encrypted** keystore; `SAIL_PASSPHRASE` is a secret, never committed (the same value the dashboard stores locally at `0600`). Whoever triggers or submits, the on-chain **mandate is the backstop**, bounding the manager regardless of host — choose cloud vs local with that in mind.
65
62
 
66
- A failing run's logs show the same stderr the local runner produces (`reverted: <txHash>`, `skipped: no registered permission…`) — debug with the sail-transactions skill.
63
+ A failing run's logs show the same stderr as the local runner (`reverted: <txHash>`, `skipped: no registered permission…`) — debug with the sail-transactions skill.