@koda-sl/baker-cli 0.34.2 → 0.34.3
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 +59 -28
- package/dist/cli.js +5 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/scheduled-actions/create.d.ts +50 -0
- package/dist/commands/scheduled-actions/create.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/create.js +83 -0
- package/dist/commands/scheduled-actions/create.js.map +1 -0
- package/dist/commands/scheduled-actions/delete.d.ts +13 -0
- package/dist/commands/scheduled-actions/delete.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/delete.js +41 -0
- package/dist/commands/scheduled-actions/delete.js.map +1 -0
- package/dist/commands/scheduled-actions/get.d.ts +13 -0
- package/dist/commands/scheduled-actions/get.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/get.js +50 -0
- package/dist/commands/scheduled-actions/get.js.map +1 -0
- package/dist/commands/scheduled-actions/index.d.ts +2 -0
- package/dist/commands/scheduled-actions/index.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/index.js +32 -0
- package/dist/commands/scheduled-actions/index.js.map +1 -0
- package/dist/commands/scheduled-actions/list.d.ts +2 -0
- package/dist/commands/scheduled-actions/list.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/list.js +32 -0
- package/dist/commands/scheduled-actions/list.js.map +1 -0
- package/dist/commands/scheduled-actions/shared.d.ts +22 -0
- package/dist/commands/scheduled-actions/shared.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/shared.js +90 -0
- package/dist/commands/scheduled-actions/shared.js.map +1 -0
- package/dist/commands/scheduled-actions/shared.test.d.ts +2 -0
- package/dist/commands/scheduled-actions/shared.test.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/shared.test.js +12 -0
- package/dist/commands/scheduled-actions/shared.test.js.map +1 -0
- package/dist/commands/scheduled-actions/trigger.d.ts +13 -0
- package/dist/commands/scheduled-actions/trigger.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/trigger.js +50 -0
- package/dist/commands/scheduled-actions/trigger.js.map +1 -0
- package/dist/commands/scheduled-actions/update.d.ts +58 -0
- package/dist/commands/scheduled-actions/update.d.ts.map +1 -0
- package/dist/commands/scheduled-actions/update.js +108 -0
- package/dist/commands/scheduled-actions/update.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ export BAKER_GSC_SITE_URL="https://example.com/"
|
|
|
30
30
|
# Optional: default X Ads account ID (base36)
|
|
31
31
|
export BAKER_X_ADS_ACCOUNT_ID="18ce53xyz"
|
|
32
32
|
|
|
33
|
-
# Required for `baker actions ...` commands that stage against a chat
|
|
33
|
+
# Required for `baker actions ...` and `baker scheduled-actions create/update/delete` commands that stage against a chat
|
|
34
34
|
export BAKER_CHAT_ID="<chat-id>"
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -40,6 +40,7 @@ export BAKER_CHAT_ID="<chat-id>"
|
|
|
40
40
|
- `BAKER_GA4_PROPERTY_ID` — default GA4 property ID. Used when `--property-id` is not passed. If neither is set and exactly one property is connected, it is auto-selected.
|
|
41
41
|
- `BAKER_GSC_SITE_URL` — default GSC site URL. Used when `--site-url` is not passed. If neither is set and exactly one site is verified, it is auto-selected.
|
|
42
42
|
- `BAKER_X_ADS_ACCOUNT_ID` — default X Ads account ID (base36). Used when `--account-id` is not passed. If neither is set and exactly one X Ads account is connected, it is auto-selected.
|
|
43
|
+
- `BAKER_CHAT_ID` — chat context for staged Work Action commands and staged Scheduled Action create/update/delete. `scheduled-actions trigger` does not require it.
|
|
43
44
|
|
|
44
45
|
## Output Format
|
|
45
46
|
|
|
@@ -1575,27 +1576,27 @@ Research data is cached server-side (shared across all callers). No local cache
|
|
|
1575
1576
|
|
|
1576
1577
|
#### Image sourcing — verb-per-provider overview
|
|
1577
1578
|
|
|
1578
|
-
Each external source is its own subcommand. Pick the verb that matches the source — license
|
|
1579
|
-
|
|
1580
|
-
| Command | Purpose |
|
|
1581
|
-
|
|
1582
|
-
| `baker images library <q>` | Hybrid library search (replaces `search`) |
|
|
1583
|
-
| `baker images find <q>` | Fanout: library + opted-in providers |
|
|
1584
|
-
| `baker images stock <q> [--type photo\|vector\|psd]` | Magnific (Freepik's dev API) — photos, vectors, illustrations, PSDs (~250M assets) |
|
|
1585
|
-
| `baker images google <q>` | Google Images via the official Custom Search JSON API |
|
|
1586
|
-
| `baker images logo <domain>` | Brand logo via Brandfetch CDN |
|
|
1587
|
-
| `baker images icon <name>` | Iconify (200+ icon sets, no API key) |
|
|
1588
|
-
| `baker images gif <q>` | Reaction GIFs / memes via Giphy (paid-social creative) |
|
|
1589
|
-
| `baker images sticker <q>` | Transparent stickers via Giphy (overlay-friendly for ad creative) |
|
|
1590
|
-
| `baker images extract <url>` | Pull every image off a URL via Firecrawl |
|
|
1591
|
-
| `baker images screenshot <url>` | Website screenshot via ScreenshotOne |
|
|
1592
|
-
| `baker images ingest <url>` | Save a remote URL to the library |
|
|
1593
|
-
| `baker images use <url>` | Sugar over `ingest` — waits until `ready` |
|
|
1594
|
-
| `baker images get <id>` | Single record |
|
|
1595
|
-
| `baker images upload <file\|url>` | Upload a local file OR remote URL to the library |
|
|
1596
|
-
| `baker images delete <id>` | Delete a record |
|
|
1597
|
-
|
|
1598
|
-
**Auto-ingest** runs the full `processImage` pipeline (Gemini describe + Voyage multimodal embed + OpenRouter text embed
|
|
1579
|
+
Each external source is its own subcommand. Pick the verb that matches the source — license and result shape are provider-specific.
|
|
1580
|
+
|
|
1581
|
+
| Command | Purpose | Auto-ingest default |
|
|
1582
|
+
|---|---|---|
|
|
1583
|
+
| `baker images library <q>` | Hybrid library search (replaces `search`) | n/a |
|
|
1584
|
+
| `baker images find <q>` | Fanout: library + opted-in providers | off |
|
|
1585
|
+
| `baker images stock <q> [--type photo\|vector\|psd]` | Magnific (Freepik's dev API) — photos, vectors, illustrations, PSDs (~250M assets) | off |
|
|
1586
|
+
| `baker images google <q>` | Google Images via the official Custom Search JSON API | off |
|
|
1587
|
+
| `baker images logo <domain>` | Brand logo via Brandfetch CDN | **on** (top 1) |
|
|
1588
|
+
| `baker images icon <name>` | Iconify (200+ icon sets, no API key) | off (CDN URL is stable) |
|
|
1589
|
+
| `baker images gif <q>` | Reaction GIFs / memes via Giphy (paid-social creative) | off |
|
|
1590
|
+
| `baker images sticker <q>` | Transparent stickers via Giphy (overlay-friendly for ad creative) | off |
|
|
1591
|
+
| `baker images extract <url>` | Pull every image off a URL via Firecrawl | off |
|
|
1592
|
+
| `baker images screenshot <url>` | Website screenshot via ScreenshotOne | **on** |
|
|
1593
|
+
| `baker images ingest <url>` | Save a remote URL to the library | always on |
|
|
1594
|
+
| `baker images use <url>` | Sugar over `ingest` — waits until `ready` | always on |
|
|
1595
|
+
| `baker images get <id>` | Single record | n/a |
|
|
1596
|
+
| `baker images upload <file\|url>` | Upload a local file OR remote URL to the library | always on |
|
|
1597
|
+
| `baker images delete <id>` | Delete a record | n/a |
|
|
1598
|
+
|
|
1599
|
+
**Auto-ingest** runs the full `processImage` pipeline (Gemini describe + Voyage multimodal embed + OpenRouter text embed) on every hit. Override with `--auto-ingest N` (turn on) or `--no-auto-ingest` (turn off where default is on). After auto-ingest the next `baker images library` query for the same concept hits the local row.
|
|
1599
1600
|
|
|
1600
1601
|
**Provider context biases the description.** When a hit carries human-readable text (Giphy `alt_text` / `title`, Magnific `title`, Brandfetch type+theme, etc.) it's surfaced on the hit as `descriptionContext` and forwarded to Gemini during auto-ingest as a hint — Gemini still trusts the pixels (e.g. it'll correct a wrong botanical name) but uses the hint for cultural/brand/scene awareness it can't infer from bytes alone.
|
|
1601
1602
|
|
|
@@ -1676,7 +1677,7 @@ baker images stock "brand pattern" --color "#0a0a0a" --license freemium --auto-i
|
|
|
1676
1677
|
baker images stock "office reaction" --people only
|
|
1677
1678
|
```
|
|
1678
1679
|
|
|
1679
|
-
|
|
1680
|
+
Free tier exists but watermarks previews — pass `--license freemium` to filter to clean free assets explicitly.
|
|
1680
1681
|
|
|
1681
1682
|
**Flags:**
|
|
1682
1683
|
|
|
@@ -1702,7 +1703,7 @@ Google Images via the official Custom Search JSON API. ⚠ Source is unverified
|
|
|
1702
1703
|
baker images google "industrial workshop" --type photo --size large --limit 20
|
|
1703
1704
|
```
|
|
1704
1705
|
|
|
1705
|
-
|
|
1706
|
+
Custom Search caps at 10 results per call — pagination is automatic (`--limit 30` = 3 calls).
|
|
1706
1707
|
|
|
1707
1708
|
Requires both `GOOGLE_CUSTOM_SEARCH_API_KEY` and `GOOGLE_CUSTOM_SEARCH_ENGINE_ID` (Programmable Search Engine `cx`) set on the Convex deployment, with the engine configured to "Search the entire web" + Image search ON.
|
|
1708
1709
|
|
|
@@ -1809,7 +1810,7 @@ Pass a prefixed id (`lucide:check`) to pin both set and name explicitly. Without
|
|
|
1809
1810
|
|
|
1810
1811
|
### `baker images gif <query>`
|
|
1811
1812
|
|
|
1812
|
-
Search **Giphy** for GIFs / reaction memes — built for paid-social creative (Meta, TikTok, LinkedIn, X).
|
|
1813
|
+
Search **Giphy** for GIFs / reaction memes — built for paid-social creative (Meta, TikTok, LinkedIn, X). Replaces the discontinued Tenor integration.
|
|
1813
1814
|
|
|
1814
1815
|
```bash
|
|
1815
1816
|
baker images gif "this is fine" --limit 10
|
|
@@ -1856,8 +1857,6 @@ baker images extract https://example.com --wait-for 1500 --limit 20
|
|
|
1856
1857
|
|
|
1857
1858
|
Every image extracted from a page shares the scraped-page URL as `externalUrl`. Big pages can return 100+ images — cap auto-ingest at 20.
|
|
1858
1859
|
|
|
1859
|
-
Cost: $0.001/scrape. JS-rendered pages with `--wait-for` cost the heavier credit bucket.
|
|
1860
|
-
|
|
1861
1860
|
**Flags:**
|
|
1862
1861
|
|
|
1863
1862
|
| Flag | Description |
|
|
@@ -1879,7 +1878,7 @@ baker images screenshot https://stripe.com --format png
|
|
|
1879
1878
|
|
|
1880
1879
|
Auto-ingests with prefetched bytes (no double-fetch). The screenshot bytes themselves are the artifact — `externalUrl` is the captured URL.
|
|
1881
1880
|
|
|
1882
|
-
|
|
1881
|
+
ScreenshotOne caches captures for 30 days, so re-shotting the same URL within that window returns the cached capture.
|
|
1883
1882
|
|
|
1884
1883
|
**Flags:**
|
|
1885
1884
|
|
|
@@ -2027,6 +2026,38 @@ baker testimonials list --source google --sentiment positive --limit 20
|
|
|
2027
2026
|
|
|
2028
2027
|
---
|
|
2029
2028
|
|
|
2029
|
+
### Scheduled Actions (`baker scheduled-actions`)
|
|
2030
|
+
|
|
2031
|
+
Manage company-scoped scheduled recipes that spawn Work Actions later or on a cadence. `create`, `update`, and `delete` stage draft ops on `BAKER_CHAT_ID` and apply when the chat is published. `list` and `get` include draft state when `BAKER_CHAT_ID` is set. `trigger` runs immediately on a published scheduled action and does not require a chat id. Use a regular Work Action instead when there is no date or cadence.
|
|
2032
|
+
|
|
2033
|
+
```bash
|
|
2034
|
+
baker scheduled-actions list
|
|
2035
|
+
baker scheduled-actions get <id-or-temp_sched_id>
|
|
2036
|
+
|
|
2037
|
+
baker scheduled-actions create --name "Weekly report" --description "Prepare report" --cron "0 9 * * MON" --timezone Europe/Madrid --tag reporting
|
|
2038
|
+
baker scheduled-actions create --name "Launch reminder" --description "Check launch" --run-at "2026-09-01T07:00:00Z" --disabled --no-spawn-agent --prompt "Focus on blockers"
|
|
2039
|
+
|
|
2040
|
+
baker scheduled-actions update <id-or-temp_sched_id> --enabled false
|
|
2041
|
+
baker scheduled-actions update <id-or-temp_sched_id> --run-at "2026-09-02T07:00:00Z" --spawn-agent true --prompt "Use the launch checklist"
|
|
2042
|
+
baker scheduled-actions delete <id-or-temp_sched_id>
|
|
2043
|
+
|
|
2044
|
+
baker scheduled-actions trigger <id>
|
|
2045
|
+
```
|
|
2046
|
+
|
|
2047
|
+
Rules:
|
|
2048
|
+
|
|
2049
|
+
- `--cron` and `--run-at` are mutually exclusive.
|
|
2050
|
+
- `--run-at` must be an ISO UTC timestamp ending in `Z`.
|
|
2051
|
+
- Draft-created ids use `temp_sched_*`; use them with `get`, `update`, or `delete` before publish.
|
|
2052
|
+
- Staged commands require `BAKER_CHAT_ID` to point to an `in_progress` chat.
|
|
2053
|
+
- `trigger` rejects `temp_sched_*` and only accepts published scheduled-action ids.
|
|
2054
|
+
- Company Timezone is the default; `--timezone` is an explicit IANA override.
|
|
2055
|
+
- Scheduled actions spawn agents by default; create with `--no-spawn-agent` or update with `--spawn-agent false` to disable it.
|
|
2056
|
+
- `--prompt` maps to the scheduled action's additional spawned-agent instructions (`agentPrompt`), not a replacement for Baker's automatic spawned Work Action reference.
|
|
2057
|
+
- `--tag` accepts comma-separated Work Action tag slugs; unknown tag slugs conflict on publish.
|
|
2058
|
+
|
|
2059
|
+
---
|
|
2060
|
+
|
|
2030
2061
|
### Action Items (`baker actions`)
|
|
2031
2062
|
|
|
2032
2063
|
Manage action items for the current chat. Most write operations stage on the chat's draft and apply atomically when the chat is published. Claim/release run live so other chats can see who's working on what.
|
package/dist/cli.js
CHANGED
|
@@ -6,23 +6,25 @@ import { ga4Command } from "./commands/ga4/index.js";
|
|
|
6
6
|
import { gscCommand } from "./commands/gsc/index.js";
|
|
7
7
|
import { imagesCommand } from "./commands/images/index.js";
|
|
8
8
|
import { researchCommand } from "./commands/research/index.js";
|
|
9
|
+
import { scheduledActionsCommand } from "./commands/scheduled-actions/index.js";
|
|
9
10
|
import { schemaCommand } from "./commands/schema.js";
|
|
10
11
|
import { testimonialsCommand } from "./commands/testimonials/index.js";
|
|
11
12
|
import { videosCommand } from "./commands/videos/index.js";
|
|
12
13
|
const main = defineCommand({
|
|
13
14
|
meta: {
|
|
14
15
|
name: "baker",
|
|
15
|
-
version: "0.34.
|
|
16
|
-
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, and ad platform data in Baker.
|
|
16
|
+
version: "0.34.3",
|
|
17
|
+
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, and ad platform data in Baker.
|
|
17
18
|
|
|
18
19
|
Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
|
|
19
|
-
Chat: Set BAKER_CHAT_ID for action commands that stage changes against a chat.
|
|
20
|
+
Chat: Set BAKER_CHAT_ID for action and scheduled-action commands that stage changes against a chat.
|
|
20
21
|
Output: All commands return JSON envelopes: { ok: true, data: ... } or { ok: false, error: { code, message } }.
|
|
21
22
|
Formats: Use --output json|csv|jsonl|files|md to control output format. Default: json.
|
|
22
23
|
Introspection: Run 'baker schema <command>' to inspect argument schemas.`,
|
|
23
24
|
},
|
|
24
25
|
subCommands: {
|
|
25
26
|
actions: actionsCommand,
|
|
27
|
+
"scheduled-actions": scheduledActionsCommand,
|
|
26
28
|
ads: adsCommand,
|
|
27
29
|
ga4: ga4Command,
|
|
28
30
|
gsc: gscCommand,
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,IAAI,GAAG,aAAa,CAAC;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,QAAQ;QACjB,WAAW,EAAE;;;;;;yEAM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f,QAAQ,EAAE,eAAe;QACzB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,YAAY,EAAE,mBAAmB;QACjC,MAAM,EAAE,aAAa;KACtB;CACF,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const createCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly name: {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Scheduled action name";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly description: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Description";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly cron: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "5-field cron expression";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
readonly "run-at": {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "ISO UTC timestamp ending in Z";
|
|
20
|
+
readonly required: false;
|
|
21
|
+
};
|
|
22
|
+
readonly timezone: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "IANA timezone override";
|
|
25
|
+
readonly required: false;
|
|
26
|
+
};
|
|
27
|
+
readonly tag: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly description: "Tag slugs (comma-separated)";
|
|
30
|
+
readonly required: false;
|
|
31
|
+
};
|
|
32
|
+
readonly disabled: {
|
|
33
|
+
readonly type: "boolean";
|
|
34
|
+
readonly description: "Create disabled";
|
|
35
|
+
readonly required: false;
|
|
36
|
+
readonly default: false;
|
|
37
|
+
};
|
|
38
|
+
readonly "no-spawn-agent": {
|
|
39
|
+
readonly type: "boolean";
|
|
40
|
+
readonly description: "Disable agent spawning";
|
|
41
|
+
readonly required: false;
|
|
42
|
+
readonly default: false;
|
|
43
|
+
};
|
|
44
|
+
readonly prompt: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly description: "Additional spawned-agent instructions";
|
|
47
|
+
readonly required: false;
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
50
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/create.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDxB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../client.js";
|
|
3
|
+
import { requireChatId } from "../../env.js";
|
|
4
|
+
import { writeJson } from "../../output.js";
|
|
5
|
+
import { registerSchema } from "../../schemas.js";
|
|
6
|
+
import { buildScheduleBody, failApi, failValidation, isNoSpawnAgentFlagSet, parseTags } from "./shared.js";
|
|
7
|
+
registerSchema({
|
|
8
|
+
command: "scheduled-actions.create",
|
|
9
|
+
description: "Stage creation of a scheduled action. Applies when the chat is published and returns a temp_sched_* ID.",
|
|
10
|
+
args: {
|
|
11
|
+
name: { type: "string", description: "Scheduled action name", required: true },
|
|
12
|
+
description: { type: "string", description: "Context-complete spawned work action description", required: true },
|
|
13
|
+
cron: { type: "string", description: "5-field cron expression; mutually exclusive with --run-at", required: false },
|
|
14
|
+
"run-at": {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "ISO UTC timestamp ending in Z; mutually exclusive with --cron",
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
timezone: { type: "string", description: "IANA timezone override; defaults to Company Timezone", required: false },
|
|
20
|
+
tag: { type: "string", description: "Tag slugs (comma-separated)", required: false },
|
|
21
|
+
disabled: { type: "boolean", description: "Create disabled", required: false, default: false },
|
|
22
|
+
"no-spawn-agent": {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
description: "Do not spawn an agent when this scheduled action fires",
|
|
25
|
+
required: false,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false },
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
export const createCommand = defineCommand({
|
|
32
|
+
meta: {
|
|
33
|
+
name: "create",
|
|
34
|
+
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"',
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
name: { type: "string", description: "Scheduled action name", required: false },
|
|
38
|
+
description: { type: "string", description: "Description", required: false },
|
|
39
|
+
cron: { type: "string", description: "5-field cron expression", required: false },
|
|
40
|
+
"run-at": { type: "string", description: "ISO UTC timestamp ending in Z", required: false },
|
|
41
|
+
timezone: { type: "string", description: "IANA timezone override", required: false },
|
|
42
|
+
tag: { type: "string", description: "Tag slugs (comma-separated)", required: false },
|
|
43
|
+
disabled: { type: "boolean", description: "Create disabled", required: false, default: false },
|
|
44
|
+
"no-spawn-agent": { type: "boolean", description: "Disable agent spawning", required: false, default: false },
|
|
45
|
+
prompt: { type: "string", description: "Additional spawned-agent instructions", required: false },
|
|
46
|
+
},
|
|
47
|
+
run: async ({ args }) => {
|
|
48
|
+
try {
|
|
49
|
+
const name = args.name;
|
|
50
|
+
const description = args.description;
|
|
51
|
+
if (!name || name.trim().length === 0) {
|
|
52
|
+
failValidation("--name is required.");
|
|
53
|
+
}
|
|
54
|
+
if (!description || description.trim().length === 0) {
|
|
55
|
+
failValidation("--description is required.");
|
|
56
|
+
}
|
|
57
|
+
const schedule = buildScheduleBody(args, { required: true });
|
|
58
|
+
const chatId = requireChatId();
|
|
59
|
+
const noSpawnAgent = isNoSpawnAgentFlagSet(args);
|
|
60
|
+
const body = {
|
|
61
|
+
chatId,
|
|
62
|
+
name,
|
|
63
|
+
description,
|
|
64
|
+
enabled: !args.disabled,
|
|
65
|
+
spawnAgent: !noSpawnAgent,
|
|
66
|
+
...schedule,
|
|
67
|
+
};
|
|
68
|
+
const tagSlugs = parseTags(args.tag);
|
|
69
|
+
if (tagSlugs) {
|
|
70
|
+
body.tagSlugs = tagSlugs;
|
|
71
|
+
}
|
|
72
|
+
if (typeof args.prompt === "string") {
|
|
73
|
+
body.agentPrompt = args.prompt;
|
|
74
|
+
}
|
|
75
|
+
const response = await apiPost("/api/scheduled-actions/create", body);
|
|
76
|
+
writeJson(response);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
failApi(err);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE3G,cAAc,CAAC;IACb,OAAO,EAAE,0BAA0B;IACnC,WAAW,EACT,yGAAyG;IAC3G,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9E,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kDAAkD,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChH,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2DAA2D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C,CAAC;YACjD,MAAM,IAAI,GAA4B;gBACpC,MAAM;gBACN,IAAI;gBACJ,WAAW;gBACX,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ;gBACvB,UAAU,EAAE,CAAC,YAAY;gBACzB,GAAG,QAAQ;aACZ,CAAC;YACF,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrC,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC3B,CAAC;YACD,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC;YACjC,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAyC,+BAA+B,EAAE,IAAI,CAAC,CAAC;YAC9G,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const deleteCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Scheduled action ID or temp_sched_* draft ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "scheduled-action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Scheduled action ID (alternative to positional)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/delete.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,aAAa;;;;;;;;;;;EA0BxB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../client.js";
|
|
3
|
+
import { requireChatId } from "../../env.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
import { failApi, failValidation, validateScheduledActionRef, writeOk } from "./shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "scheduled-actions.delete",
|
|
8
|
+
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
9
|
+
args: {
|
|
10
|
+
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export const deleteCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: "delete",
|
|
16
|
+
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>",
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
id: { type: "positional", description: "Scheduled action ID or temp_sched_* draft ID", required: false },
|
|
20
|
+
"scheduled-action-id": {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Scheduled action ID (alternative to positional)",
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
run: async ({ args }) => {
|
|
27
|
+
try {
|
|
28
|
+
const id = args.id || args["scheduled-action-id"];
|
|
29
|
+
if (!id) {
|
|
30
|
+
failValidation("Scheduled action ID is required.");
|
|
31
|
+
}
|
|
32
|
+
validateScheduledActionRef(id);
|
|
33
|
+
await apiPost("/api/scheduled-actions/delete", { chatId: requireChatId(), id });
|
|
34
|
+
writeOk();
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
failApi(err);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":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,aAAa,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC9F,OAAO,EAAE,CAAC;QACZ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const getCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Scheduled action ID or temp_sched_* draft ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "scheduled-action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Scheduled action ID (alternative to positional)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/get.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,UAAU;;;;;;;;;;;EAkCrB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../client.js";
|
|
3
|
+
import { getEnv } from "../../env.js";
|
|
4
|
+
import { writeJson } from "../../output.js";
|
|
5
|
+
import { registerSchema } from "../../schemas.js";
|
|
6
|
+
import { failApi, failValidation, isTempScheduledActionId, validateScheduledActionRef } from "./shared.js";
|
|
7
|
+
registerSchema({
|
|
8
|
+
command: "scheduled-actions.get",
|
|
9
|
+
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
10
|
+
args: {
|
|
11
|
+
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const getCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "get",
|
|
17
|
+
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>",
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
id: { type: "positional", description: "Scheduled action ID or temp_sched_* draft ID", required: false },
|
|
21
|
+
"scheduled-action-id": {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Scheduled action ID (alternative to positional)",
|
|
24
|
+
required: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
run: async ({ args }) => {
|
|
28
|
+
try {
|
|
29
|
+
const id = args.id || args["scheduled-action-id"];
|
|
30
|
+
if (!id) {
|
|
31
|
+
failValidation("Scheduled action ID is required.");
|
|
32
|
+
}
|
|
33
|
+
validateScheduledActionRef(id);
|
|
34
|
+
const env = getEnv();
|
|
35
|
+
if (isTempScheduledActionId(id) && !env.BAKER_CHAT_ID) {
|
|
36
|
+
failValidation("BAKER_CHAT_ID is required to get a temp scheduled action ID.");
|
|
37
|
+
}
|
|
38
|
+
const body = { id };
|
|
39
|
+
if (env.BAKER_CHAT_ID) {
|
|
40
|
+
body.chatId = env.BAKER_CHAT_ID;
|
|
41
|
+
}
|
|
42
|
+
const response = await apiPost("/api/scheduled-actions/get", body);
|
|
43
|
+
writeJson(response);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
failApi(err);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,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CAAC;gBACtB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC;YAClC,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAA8B,4BAA4B,EAAE,IAAI,CAAC,CAAC;YAChG,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,uBAAuB,qDAuBlC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { createCommand } from "./create.js";
|
|
3
|
+
import { deleteCommand } from "./delete.js";
|
|
4
|
+
import { getCommand } from "./get.js";
|
|
5
|
+
import { listCommand } from "./list.js";
|
|
6
|
+
import { triggerCommand } from "./trigger.js";
|
|
7
|
+
import { updateCommand } from "./update.js";
|
|
8
|
+
export const scheduledActionsCommand = defineCommand({
|
|
9
|
+
meta: {
|
|
10
|
+
name: "scheduled-actions",
|
|
11
|
+
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
12
|
+
|
|
13
|
+
Drafts: create/update/delete stage changes on BAKER_CHAT_ID and apply when the chat is published. Trigger runs immediately on a published scheduled action.
|
|
14
|
+
|
|
15
|
+
Examples:
|
|
16
|
+
baker scheduled-actions list
|
|
17
|
+
baker scheduled-actions get <id-or-temp_sched_id>
|
|
18
|
+
baker scheduled-actions create --name "Weekly report" --description "Prepare weekly report" --cron "0 9 * * MON"
|
|
19
|
+
baker scheduled-actions update <id-or-temp_sched_id> --enabled false
|
|
20
|
+
baker scheduled-actions delete <id-or-temp_sched_id>
|
|
21
|
+
baker scheduled-actions trigger <id>`,
|
|
22
|
+
},
|
|
23
|
+
subCommands: {
|
|
24
|
+
list: listCommand,
|
|
25
|
+
get: getCommand,
|
|
26
|
+
create: createCommand,
|
|
27
|
+
update: updateCommand,
|
|
28
|
+
delete: deleteCommand,
|
|
29
|
+
trigger: triggerCommand,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC;IACnD,IAAI,EAAE;QACJ,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE;;;;;;;;;;uCAUsB;KACpC;IACD,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE,cAAc;KACxB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/list.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW,qDAkBtB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../client.js";
|
|
3
|
+
import { getEnv } from "../../env.js";
|
|
4
|
+
import { writeJson } from "../../output.js";
|
|
5
|
+
import { registerSchema } from "../../schemas.js";
|
|
6
|
+
import { failApi } from "./shared.js";
|
|
7
|
+
registerSchema({
|
|
8
|
+
command: "scheduled-actions.list",
|
|
9
|
+
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
10
|
+
args: {},
|
|
11
|
+
});
|
|
12
|
+
export const listCommand = defineCommand({
|
|
13
|
+
meta: {
|
|
14
|
+
name: "list",
|
|
15
|
+
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set.",
|
|
16
|
+
},
|
|
17
|
+
run: async () => {
|
|
18
|
+
try {
|
|
19
|
+
const env = getEnv();
|
|
20
|
+
const body = {};
|
|
21
|
+
if (env.BAKER_CHAT_ID) {
|
|
22
|
+
body.chatId = env.BAKER_CHAT_ID;
|
|
23
|
+
}
|
|
24
|
+
const response = await apiPost("/api/scheduled-actions/list", body);
|
|
25
|
+
writeJson(response);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
failApi(err);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,cAAc,CAAC;IACb,OAAO,EAAE,wBAAwB;IACjC,WAAW,EAAE,mFAAmF;IAChG,IAAI,EAAE,EAAE;CACT,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,8EAA8E;KAC5F;IACD,GAAG,EAAE,KAAK,IAAI,EAAE;QACd,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;YACrB,MAAM,IAAI,GAA4B,EAAE,CAAC;YACzC,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;gBACtB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC;YAClC,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAA8B,6BAA6B,EAAE,IAAI,CAAC,CAAC;YACjG,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type ScheduleBody = {
|
|
2
|
+
cron: string;
|
|
3
|
+
timezone?: string;
|
|
4
|
+
} | {
|
|
5
|
+
runAt: string;
|
|
6
|
+
timezone?: string;
|
|
7
|
+
} | {
|
|
8
|
+
timezone: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function writeOk<T = null>(data?: T): void;
|
|
11
|
+
export declare function failValidation(message: string): never;
|
|
12
|
+
export declare function failApi(err: unknown): never;
|
|
13
|
+
export declare function isTempScheduledActionId(id: string): boolean;
|
|
14
|
+
export declare function validateScheduledActionRef(ref: string): void;
|
|
15
|
+
export declare function parseTags(raw: unknown): string[] | undefined;
|
|
16
|
+
export declare function isNoSpawnAgentFlagSet(args: Record<string, unknown>): boolean;
|
|
17
|
+
export declare function parseBooleanFlag(raw: unknown, flagName: string): boolean | undefined;
|
|
18
|
+
export declare function buildScheduleBody(args: Record<string, unknown>, options: {
|
|
19
|
+
required: boolean;
|
|
20
|
+
}): ScheduleBody | undefined;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/shared.ts"],"names":[],"mappings":"AAMA,KAAK,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtH,wBAAgB,OAAO,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAEhD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAGrD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CAW3C;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE3D;AAMD,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAO5D;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAS5D;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAE5E;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAWpF;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAC7B,YAAY,GAAG,SAAS,CA2B1B"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ApiError, validateConvexId } from "../../client.js";
|
|
2
|
+
import { writeJson } from "../../output.js";
|
|
3
|
+
const TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
4
|
+
const TEMP_ID_PREFIX = "temp_";
|
|
5
|
+
export function writeOk(data) {
|
|
6
|
+
writeJson({ ok: true, data: (data ?? null) });
|
|
7
|
+
}
|
|
8
|
+
export function failValidation(message) {
|
|
9
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
export function failApi(err) {
|
|
13
|
+
if (err instanceof ApiError) {
|
|
14
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
if (err instanceof Error) {
|
|
18
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: err.message } });
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
export function isTempScheduledActionId(id) {
|
|
25
|
+
return id.startsWith(TEMP_SCHEDULED_ACTION_PREFIX);
|
|
26
|
+
}
|
|
27
|
+
function isOtherTempId(id) {
|
|
28
|
+
return id.startsWith(TEMP_ID_PREFIX) && !isTempScheduledActionId(id);
|
|
29
|
+
}
|
|
30
|
+
export function validateScheduledActionRef(ref) {
|
|
31
|
+
if (isOtherTempId(ref)) {
|
|
32
|
+
failValidation(`Scheduled action temp IDs must start with ${TEMP_SCHEDULED_ACTION_PREFIX}.`);
|
|
33
|
+
}
|
|
34
|
+
if (!isTempScheduledActionId(ref)) {
|
|
35
|
+
validateConvexId(ref);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function parseTags(raw) {
|
|
39
|
+
if (typeof raw !== "string") {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const tags = raw
|
|
43
|
+
.split(",")
|
|
44
|
+
.map((tag) => tag.trim())
|
|
45
|
+
.filter(Boolean);
|
|
46
|
+
return tags.length > 0 ? tags : undefined;
|
|
47
|
+
}
|
|
48
|
+
export function isNoSpawnAgentFlagSet(args) {
|
|
49
|
+
return args["no-spawn-agent"] === true || args.noSpawnAgent === true || args.spawnAgent === false;
|
|
50
|
+
}
|
|
51
|
+
export function parseBooleanFlag(raw, flagName) {
|
|
52
|
+
if (raw === undefined) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
if (raw === true || raw === "true") {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (raw === false || raw === "false") {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
failValidation(`${flagName} must be true or false.`);
|
|
62
|
+
}
|
|
63
|
+
export function buildScheduleBody(args, options) {
|
|
64
|
+
const cron = args.cron;
|
|
65
|
+
const runAt = args["run-at"];
|
|
66
|
+
const timezone = args.timezone;
|
|
67
|
+
if (cron && runAt) {
|
|
68
|
+
failValidation("--cron and --run-at are mutually exclusive.");
|
|
69
|
+
}
|
|
70
|
+
if (runAt) {
|
|
71
|
+
if (!runAt.endsWith("Z")) {
|
|
72
|
+
failValidation("--run-at must be an ISO UTC timestamp ending in Z.");
|
|
73
|
+
}
|
|
74
|
+
if (!Number.isFinite(Date.parse(runAt))) {
|
|
75
|
+
failValidation("--run-at must be a valid ISO timestamp.");
|
|
76
|
+
}
|
|
77
|
+
return { runAt, ...(timezone ? { timezone } : {}) };
|
|
78
|
+
}
|
|
79
|
+
if (cron) {
|
|
80
|
+
return { cron, ...(timezone ? { timezone } : {}) };
|
|
81
|
+
}
|
|
82
|
+
if (timezone && !options.required) {
|
|
83
|
+
return { timezone };
|
|
84
|
+
}
|
|
85
|
+
if (options.required) {
|
|
86
|
+
failValidation("Provide exactly one of --cron or --run-at.");
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,4BAA4B,GAAG,aAAa,CAAC;AACnD,MAAM,cAAc,GAAG,OAAO,CAAC;AAI/B,MAAM,UAAU,OAAO,CAAW,IAAQ;IACxC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,CAAM,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAY;IAClC,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;QAC5B,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;QACzB,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAA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AE,CAAC,EAAE,CAAC;IACtD,CAAC;IACD,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACrD,CAAC;IACD,IAAI,QAAQ,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAClC,OAAO,EAAE,QAAQ,EAAE,CAAC;IACtB,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,cAAc,CAAC,4CAA4C,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.test.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/shared.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { isNoSpawnAgentFlagSet } from "./shared.js";
|
|
3
|
+
describe("scheduled-actions shared helpers", () => {
|
|
4
|
+
it("detects citty no-spawn-agent flag shapes", () => {
|
|
5
|
+
expect(isNoSpawnAgentFlagSet({})).toBe(false);
|
|
6
|
+
expect(isNoSpawnAgentFlagSet({ "no-spawn-agent": true })).toBe(true);
|
|
7
|
+
expect(isNoSpawnAgentFlagSet({ noSpawnAgent: true })).toBe(true);
|
|
8
|
+
expect(isNoSpawnAgentFlagSet({ spawnAgent: false })).toBe(true);
|
|
9
|
+
expect(isNoSpawnAgentFlagSet({ spawnAgent: true })).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=shared.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.test.js","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/shared.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrE,MAAM,CAAC,qBAAqB,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,MAAM,CAAC,qBAAqB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChE,MAAM,CAAC,qBAAqB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const triggerCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Published scheduled action ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "scheduled-action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Scheduled action ID (alternative to positional)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/trigger.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,cAAc;;;;;;;;;;;EAkCzB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost, validateConvexId } from "../../client.js";
|
|
3
|
+
import { getEnv } from "../../env.js";
|
|
4
|
+
import { writeJson } from "../../output.js";
|
|
5
|
+
import { registerSchema } from "../../schemas.js";
|
|
6
|
+
import { failApi, failValidation, isTempScheduledActionId } from "./shared.js";
|
|
7
|
+
registerSchema({
|
|
8
|
+
command: "scheduled-actions.trigger",
|
|
9
|
+
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
10
|
+
args: {
|
|
11
|
+
id: { type: "string", description: "Published scheduled action ID", required: true },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const triggerCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "trigger",
|
|
17
|
+
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>",
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
id: { type: "positional", description: "Published scheduled action ID", required: false },
|
|
21
|
+
"scheduled-action-id": {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Scheduled action ID (alternative to positional)",
|
|
24
|
+
required: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
run: async ({ args }) => {
|
|
28
|
+
try {
|
|
29
|
+
const id = args.id || args["scheduled-action-id"];
|
|
30
|
+
if (!id) {
|
|
31
|
+
failValidation("Scheduled action ID is required.");
|
|
32
|
+
}
|
|
33
|
+
if (isTempScheduledActionId(id)) {
|
|
34
|
+
failValidation("trigger requires a published scheduled action ID, not temp_sched_*.");
|
|
35
|
+
}
|
|
36
|
+
validateConvexId(id);
|
|
37
|
+
const env = getEnv();
|
|
38
|
+
const body = { id };
|
|
39
|
+
if (env.BAKER_CHAT_ID) {
|
|
40
|
+
body.chatId = env.BAKER_CHAT_ID;
|
|
41
|
+
}
|
|
42
|
+
const response = await apiPost("/api/scheduled-actions/trigger", body);
|
|
43
|
+
writeJson(response);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
failApi(err);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE/E,cAAc,CAAC;IACb,OAAO,EAAE,2BAA2B;IACpC,WAAW,EACT,gHAAgH;IAClH,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE,QAAQ,EAAE,IAAI,EAAE;KACrF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC1C,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,iGAAiG;KAC/G;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,+BAA+B,EAAE,QAAQ,EAAE,KAAK,EAAE;QACzF,qBAAqB,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,GAAI,IAAI,CAAC,EAAyB,IAAK,IAAI,CAAC,qBAAqB,CAAwB,CAAC;YAClG,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,cAAc,CAAC,kCAAkC,CAAC,CAAC;YACrD,CAAC;YACD,IAAI,uBAAuB,CAAC,EAAE,CAAC,EAAE,CAAC;gBAChC,cAAc,CAAC,qEAAqE,CAAC,CAAC;YACxF,CAAC;YACD,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACrB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;YACrB,MAAM,IAAI,GAA4B,EAAE,EAAE,EAAE,CAAC;YAC7C,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;gBACtB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC;YAClC,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAA2C,gCAAgC,EAAE,IAAI,CAAC,CAAC;YACjH,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const updateCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Scheduled action ID or temp_sched_* draft ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "scheduled-action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Scheduled action ID (alternative to positional)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly name: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "New name";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
readonly description: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "New description";
|
|
20
|
+
readonly required: false;
|
|
21
|
+
};
|
|
22
|
+
readonly cron: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "5-field cron expression";
|
|
25
|
+
readonly required: false;
|
|
26
|
+
};
|
|
27
|
+
readonly "run-at": {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly description: "ISO UTC timestamp ending in Z";
|
|
30
|
+
readonly required: false;
|
|
31
|
+
};
|
|
32
|
+
readonly timezone: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "IANA timezone override";
|
|
35
|
+
readonly required: false;
|
|
36
|
+
};
|
|
37
|
+
readonly tag: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
readonly description: "Replacement tag slugs (comma-separated)";
|
|
40
|
+
readonly required: false;
|
|
41
|
+
};
|
|
42
|
+
readonly enabled: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
readonly description: "true|false";
|
|
45
|
+
readonly required: false;
|
|
46
|
+
};
|
|
47
|
+
readonly "spawn-agent": {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly description: "true|false";
|
|
50
|
+
readonly required: false;
|
|
51
|
+
};
|
|
52
|
+
readonly prompt: {
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
readonly description: "Replacement additional spawned-agent instructions";
|
|
55
|
+
readonly required: false;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/update.ts"],"names":[],"mappings":"AAwCA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmFxB,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../client.js";
|
|
3
|
+
import { requireChatId } from "../../env.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
import { buildScheduleBody, failApi, failValidation, parseBooleanFlag, parseTags, validateScheduledActionRef, writeOk, } from "./shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "scheduled-actions.update",
|
|
8
|
+
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
9
|
+
args: {
|
|
10
|
+
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true },
|
|
11
|
+
name: { type: "string", description: "New scheduled action name", required: false },
|
|
12
|
+
description: { type: "string", description: "New spawned work action description", required: false },
|
|
13
|
+
cron: { type: "string", description: "5-field cron expression; mutually exclusive with --run-at", required: false },
|
|
14
|
+
"run-at": {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "ISO UTC timestamp ending in Z; mutually exclusive with --cron",
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
timezone: { type: "string", description: "IANA timezone override", required: false },
|
|
20
|
+
tag: { type: "string", description: "Replacement tag slugs (comma-separated)", required: false },
|
|
21
|
+
enabled: { type: "string", description: "Replacement enabled state", required: false, enum: ["true", "false"] },
|
|
22
|
+
"spawn-agent": {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Replacement spawn-agent state",
|
|
25
|
+
required: false,
|
|
26
|
+
enum: ["true", "false"],
|
|
27
|
+
},
|
|
28
|
+
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false },
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
export const updateCommand = defineCommand({
|
|
32
|
+
meta: {
|
|
33
|
+
name: "update",
|
|
34
|
+
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false",
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
id: { type: "positional", description: "Scheduled action ID or temp_sched_* draft ID", required: false },
|
|
38
|
+
"scheduled-action-id": {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Scheduled action ID (alternative to positional)",
|
|
41
|
+
required: false,
|
|
42
|
+
},
|
|
43
|
+
name: { type: "string", description: "New name", required: false },
|
|
44
|
+
description: { type: "string", description: "New description", required: false },
|
|
45
|
+
cron: { type: "string", description: "5-field cron expression", required: false },
|
|
46
|
+
"run-at": { type: "string", description: "ISO UTC timestamp ending in Z", required: false },
|
|
47
|
+
timezone: { type: "string", description: "IANA timezone override", required: false },
|
|
48
|
+
tag: { type: "string", description: "Replacement tag slugs (comma-separated)", required: false },
|
|
49
|
+
enabled: { type: "string", description: "true|false", required: false },
|
|
50
|
+
"spawn-agent": { type: "string", description: "true|false", required: false },
|
|
51
|
+
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false },
|
|
52
|
+
},
|
|
53
|
+
run: async ({ args }) => {
|
|
54
|
+
try {
|
|
55
|
+
const id = args.id || args["scheduled-action-id"];
|
|
56
|
+
if (!id) {
|
|
57
|
+
failValidation("Scheduled action ID is required.");
|
|
58
|
+
}
|
|
59
|
+
validateScheduledActionRef(id);
|
|
60
|
+
const body = { id };
|
|
61
|
+
let hasPatch = false;
|
|
62
|
+
for (const key of ["name", "description"]) {
|
|
63
|
+
if (typeof args[key] === "string") {
|
|
64
|
+
body[key] = args[key];
|
|
65
|
+
hasPatch = true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const schedule = buildScheduleBody(args, { required: false });
|
|
69
|
+
if (schedule) {
|
|
70
|
+
Object.assign(body, schedule);
|
|
71
|
+
hasPatch = true;
|
|
72
|
+
}
|
|
73
|
+
const tagSlugs = parseTags(args.tag);
|
|
74
|
+
if (tagSlugs) {
|
|
75
|
+
body.tagSlugs = tagSlugs;
|
|
76
|
+
hasPatch = true;
|
|
77
|
+
}
|
|
78
|
+
else if (typeof args.tag === "string") {
|
|
79
|
+
body.tagSlugs = [];
|
|
80
|
+
hasPatch = true;
|
|
81
|
+
}
|
|
82
|
+
const enabled = parseBooleanFlag(args.enabled, "--enabled");
|
|
83
|
+
if (enabled !== undefined) {
|
|
84
|
+
body.enabled = enabled;
|
|
85
|
+
hasPatch = true;
|
|
86
|
+
}
|
|
87
|
+
const spawnAgent = parseBooleanFlag(args["spawn-agent"], "--spawn-agent");
|
|
88
|
+
if (spawnAgent !== undefined) {
|
|
89
|
+
body.spawnAgent = spawnAgent;
|
|
90
|
+
hasPatch = true;
|
|
91
|
+
}
|
|
92
|
+
if (typeof args.prompt === "string") {
|
|
93
|
+
body.agentPrompt = args.prompt;
|
|
94
|
+
hasPatch = true;
|
|
95
|
+
}
|
|
96
|
+
if (!hasPatch) {
|
|
97
|
+
failValidation("Provide at least one of --name, --description, --cron, --run-at, --timezone, --tag, --enabled, --spawn-agent, --prompt.");
|
|
98
|
+
}
|
|
99
|
+
body.chatId = requireChatId();
|
|
100
|
+
await apiPost("/api/scheduled-actions/update", body);
|
|
101
|
+
writeOk();
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
failApi(err);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/scheduled-actions/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,0BAA0B,EAC1B,OAAO,GACR,MAAM,aAAa,CAAC;AAErB,cAAc,CAAC;IACb,OAAO,EAAE,0BAA0B;IACnC,WAAW,EA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