@deckasoft/waify 0.5.0 → 0.6.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/README.md +4 -4
- package/dist/cli/index.js +19 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ waify send # send your first message
|
|
|
23
23
|
|
|
24
24
|
| Command | Description |
|
|
25
25
|
|---|---|
|
|
26
|
-
| `waify setup` | First-run wizard — starts Docker services, links WhatsApp, configures AI and
|
|
26
|
+
| `waify setup` | First-run wizard — starts Docker services, links WhatsApp, configures AI, recipient, and schedule |
|
|
27
27
|
| `waify send` | Generate a message with Gemini and send it via WhatsApp |
|
|
28
28
|
| `waify preview` | Preview generated messages without sending (`-n 3` for multiple candidates) |
|
|
29
29
|
| `waify tui` | Launch the interactive terminal UI (tabs: Home, History, Settings, Prompt, Schedule) |
|
|
@@ -35,7 +35,7 @@ waify send # send your first message
|
|
|
35
35
|
| `waify prompt edit` | Open the prompt in `$EDITOR` |
|
|
36
36
|
| `waify prompt add-example <text>` | Add a few-shot example to the prompt |
|
|
37
37
|
| `waify schedule list` | List scheduled jobs |
|
|
38
|
-
| `waify schedule add <name> <cron>` | Add a cron job (e.g. `"0 9 * * *"`) |
|
|
38
|
+
| `waify schedule add <name> <cron>` | Add a 6-field cron job (e.g. `"0 0 9 * * *"` — sec min hour dom month dow) |
|
|
39
39
|
| `waify schedule remove <name>` | Remove a scheduled job |
|
|
40
40
|
|
|
41
41
|
## Configuration
|
|
@@ -60,10 +60,10 @@ All config files live in `~/.config/waify/`:
|
|
|
60
60
|
|
|
61
61
|
## Scheduling
|
|
62
62
|
|
|
63
|
-
Use `waify schedule add` to create cron jobs. Changes require restarting the scheduler:
|
|
63
|
+
Use `waify schedule add` to create cron jobs. The cron format is **6 fields** (sec min hour dom month dow). Changes require restarting the scheduler:
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
waify schedule add morning "0 9 * * *"
|
|
66
|
+
waify schedule add morning "0 0 9 * * *"
|
|
67
67
|
docker compose -f ~/.config/waify/docker-compose.yml restart scheduler
|
|
68
68
|
```
|
|
69
69
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1676,6 +1676,19 @@ var registerPrompt = (program2) => {
|
|
|
1676
1676
|
|
|
1677
1677
|
// src/cli/commands/schedule.ts
|
|
1678
1678
|
init_schedule();
|
|
1679
|
+
init_paths();
|
|
1680
|
+
import { spawnSync as spawnSync3 } from "child_process";
|
|
1681
|
+
var restartScheduler = () => {
|
|
1682
|
+
console.warn("restarting scheduler\u2026");
|
|
1683
|
+
const result = spawnSync3("docker", ["compose", "-f", composePath(), "restart", "scheduler"], {
|
|
1684
|
+
stdio: "inherit"
|
|
1685
|
+
});
|
|
1686
|
+
if (result.status !== 0) {
|
|
1687
|
+
console.warn(
|
|
1688
|
+
`warning: scheduler restart failed \u2014 run manually: docker compose -f ${composePath()} restart scheduler`
|
|
1689
|
+
);
|
|
1690
|
+
}
|
|
1691
|
+
};
|
|
1679
1692
|
var registerSchedule = (program2) => {
|
|
1680
1693
|
const schedule = program2.command("schedule").description("Manage Ofelia scheduled jobs");
|
|
1681
1694
|
schedule.command("list").description("List all scheduled jobs").action(() => {
|
|
@@ -1689,14 +1702,16 @@ var registerSchedule = (program2) => {
|
|
|
1689
1702
|
`);
|
|
1690
1703
|
});
|
|
1691
1704
|
});
|
|
1692
|
-
schedule.command("add <name> <cron>").description('Add a new job. <cron> uses
|
|
1705
|
+
schedule.command("add <name> <cron>").description('Add a new job. <cron> uses 6-field syntax (sec min hour dom month dow), e.g. "0 0 9 * * *"').option("-c, --command <cmd>", "command for the sender container to run", "send").option("--no-restart", "skip automatic scheduler restart").action((name, cron, { command, restart }) => {
|
|
1693
1706
|
const job = ScheduledJobSchema.parse({ name, schedule: cron, command });
|
|
1694
1707
|
addJob(job);
|
|
1695
|
-
console.warn(`added job "${name}"
|
|
1708
|
+
console.warn(`added job "${name}"`);
|
|
1709
|
+
if (restart) restartScheduler();
|
|
1696
1710
|
});
|
|
1697
|
-
schedule.command("remove <name>").description("Remove a job by name").action((name) => {
|
|
1711
|
+
schedule.command("remove <name>").description("Remove a job by name").option("--no-restart", "skip automatic scheduler restart").action((name, { restart }) => {
|
|
1698
1712
|
removeJob(name);
|
|
1699
|
-
console.warn(`removed job "${name}"
|
|
1713
|
+
console.warn(`removed job "${name}"`);
|
|
1714
|
+
if (restart) restartScheduler();
|
|
1700
1715
|
});
|
|
1701
1716
|
};
|
|
1702
1717
|
|