@koda-sl/baker-cli 0.19.2 → 0.20.0-dev.3ff15ea5
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 +52 -0
- package/dist/cli.js +5 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/actions/claim.d.ts +13 -0
- package/dist/commands/actions/claim.d.ts.map +1 -0
- package/dist/commands/actions/claim.js +38 -0
- package/dist/commands/actions/claim.js.map +1 -0
- package/dist/commands/actions/complete.d.ts +18 -0
- package/dist/commands/actions/complete.d.ts.map +1 -0
- package/dist/commands/actions/complete.js +40 -0
- package/dist/commands/actions/complete.js.map +1 -0
- package/dist/commands/actions/create.d.ts +29 -0
- package/dist/commands/actions/create.d.ts.map +1 -0
- package/dist/commands/actions/create.js +75 -0
- package/dist/commands/actions/create.js.map +1 -0
- package/dist/commands/actions/discard.d.ts +18 -0
- package/dist/commands/actions/discard.d.ts.map +1 -0
- package/dist/commands/actions/discard.js +44 -0
- package/dist/commands/actions/discard.js.map +1 -0
- package/dist/commands/actions/get.d.ts +13 -0
- package/dist/commands/actions/get.d.ts.map +1 -0
- package/dist/commands/actions/get.js +34 -0
- package/dist/commands/actions/get.js.map +1 -0
- package/dist/commands/actions/index.d.ts +2 -0
- package/dist/commands/actions/index.d.ts.map +1 -0
- package/dist/commands/actions/index.js +43 -0
- package/dist/commands/actions/index.js.map +1 -0
- package/dist/commands/actions/link.d.ts +13 -0
- package/dist/commands/actions/link.d.ts.map +1 -0
- package/dist/commands/actions/link.js +43 -0
- package/dist/commands/actions/link.js.map +1 -0
- package/dist/commands/actions/list.d.ts +19 -0
- package/dist/commands/actions/list.d.ts.map +1 -0
- package/dist/commands/actions/list.js +66 -0
- package/dist/commands/actions/list.js.map +1 -0
- package/dist/commands/actions/release.d.ts +13 -0
- package/dist/commands/actions/release.d.ts.map +1 -0
- package/dist/commands/actions/release.js +38 -0
- package/dist/commands/actions/release.js.map +1 -0
- package/dist/commands/actions/shared.d.ts +5 -0
- package/dist/commands/actions/shared.d.ts.map +1 -0
- package/dist/commands/actions/shared.js +25 -0
- package/dist/commands/actions/shared.js.map +1 -0
- package/dist/commands/actions/tag/add.d.ts +18 -0
- package/dist/commands/actions/tag/add.d.ts.map +1 -0
- package/dist/commands/actions/tag/add.js +47 -0
- package/dist/commands/actions/tag/add.js.map +1 -0
- package/dist/commands/actions/tag/create.d.ts +23 -0
- package/dist/commands/actions/tag/create.d.ts.map +1 -0
- package/dist/commands/actions/tag/create.js +50 -0
- package/dist/commands/actions/tag/create.js.map +1 -0
- package/dist/commands/actions/tag/delete.d.ts +13 -0
- package/dist/commands/actions/tag/delete.d.ts.map +1 -0
- package/dist/commands/actions/tag/delete.js +36 -0
- package/dist/commands/actions/tag/delete.js.map +1 -0
- package/dist/commands/actions/tag/index.d.ts +2 -0
- package/dist/commands/actions/tag/index.d.ts.map +1 -0
- package/dist/commands/actions/tag/index.js +32 -0
- package/dist/commands/actions/tag/index.js.map +1 -0
- package/dist/commands/actions/tag/list.d.ts +2 -0
- package/dist/commands/actions/tag/list.d.ts.map +1 -0
- package/dist/commands/actions/tag/list.js +24 -0
- package/dist/commands/actions/tag/list.js.map +1 -0
- package/dist/commands/actions/tag/remove.d.ts +18 -0
- package/dist/commands/actions/tag/remove.d.ts.map +1 -0
- package/dist/commands/actions/tag/remove.js +48 -0
- package/dist/commands/actions/tag/remove.js.map +1 -0
- package/dist/commands/actions/tag/update.d.ts +28 -0
- package/dist/commands/actions/tag/update.d.ts.map +1 -0
- package/dist/commands/actions/tag/update.js +50 -0
- package/dist/commands/actions/tag/update.js.map +1 -0
- package/dist/commands/actions/unlink.d.ts +13 -0
- package/dist/commands/actions/unlink.d.ts.map +1 -0
- package/dist/commands/actions/unlink.js +45 -0
- package/dist/commands/actions/unlink.js.map +1 -0
- package/dist/commands/actions/update.d.ts +28 -0
- package/dist/commands/actions/update.d.ts.map +1 -0
- package/dist/commands/actions/update.js +61 -0
- package/dist/commands/actions/update.js.map +1 -0
- package/dist/env.d.ts +2 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +8 -0
- package/dist/env.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,6 +26,9 @@ export BAKER_GA4_PROPERTY_ID="properties/123456789"
|
|
|
26
26
|
|
|
27
27
|
# Optional: default GSC site URL
|
|
28
28
|
export BAKER_GSC_SITE_URL="https://example.com/"
|
|
29
|
+
|
|
30
|
+
# Required for `baker actions ...` commands that stage against a chat
|
|
31
|
+
export BAKER_CHAT_ID="<chat-id>"
|
|
29
32
|
```
|
|
30
33
|
|
|
31
34
|
- `BAKER_API_KEY` must start with `bk_`
|
|
@@ -1356,6 +1359,55 @@ baker testimonials list --source google --sentiment positive --limit 20
|
|
|
1356
1359
|
|
|
1357
1360
|
---
|
|
1358
1361
|
|
|
1362
|
+
### Action Items (`baker actions`)
|
|
1363
|
+
|
|
1364
|
+
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.
|
|
1365
|
+
|
|
1366
|
+
`BAKER_CHAT_ID` must be set for any command that stages or claims against a chat.
|
|
1367
|
+
|
|
1368
|
+
```bash
|
|
1369
|
+
baker actions list # default: bucketed (claimable, myClaims, blocked, claimedByOthers, completed, discarded)
|
|
1370
|
+
baker actions list --bucketed=false --status pending --tag copy
|
|
1371
|
+
|
|
1372
|
+
baker actions get <action-id>
|
|
1373
|
+
|
|
1374
|
+
baker actions claim <action-id> # live — required before update/complete/discard
|
|
1375
|
+
baker actions release <action-id>
|
|
1376
|
+
|
|
1377
|
+
baker actions create --name "Build hero" --description "..." --executor agent --tag copy,landing
|
|
1378
|
+
baker actions update <action-id> --name "Better name" --executor agent
|
|
1379
|
+
baker actions complete <action-id> --note "What was done" # stages — applies on chat publish
|
|
1380
|
+
baker actions discard <action-id> --reason "obsolete"
|
|
1381
|
+
|
|
1382
|
+
baker actions link --blocker <id-or-tempId> --blocked <id-or-tempId>
|
|
1383
|
+
baker actions unlink --blocker <id> --blocked <id>
|
|
1384
|
+
|
|
1385
|
+
baker actions tag list
|
|
1386
|
+
baker actions tag create --slug copy --label Copy --color "#f59e0b"
|
|
1387
|
+
baker actions tag update <tag-id> --label "Copywriting"
|
|
1388
|
+
baker actions tag delete <tag-id>
|
|
1389
|
+
baker actions tag add <action-id-or-tempId> --slug copy
|
|
1390
|
+
baker actions tag remove <action-id> --slug copy
|
|
1391
|
+
```
|
|
1392
|
+
|
|
1393
|
+
Permissions enforced server-side:
|
|
1394
|
+
|
|
1395
|
+
- Only `claim`/`release` mutate live state.
|
|
1396
|
+
- `update`, `complete`, `discard`, `tag remove`, `unlink` require the action to be claimed by the current chat — otherwise the API returns `FORBIDDEN` with a hint to claim first.
|
|
1397
|
+
- Claiming an action already claimed by another chat returns `CONFLICT` with the other chat's title — pick a different action.
|
|
1398
|
+
- All staged ops are reverted automatically when the chat is discarded.
|
|
1399
|
+
|
|
1400
|
+
`--executor` (required on `create`):
|
|
1401
|
+
|
|
1402
|
+
The rule: **`human` only when the agent contributes literally zero. Anything else is `agent`.**
|
|
1403
|
+
|
|
1404
|
+
- `agent` (default for almost everything) — the agent can produce a deliverable, draft, plan, list, script, page, or config that addresses the action. Final UI clicks, pastes, or uploads done by a human are implicit follow-ups and go in the description as a `Final step (human): …` line. Examples: build a landing page, draft RSA copy, prepare a keyword list, scaffold tracking code, write a CRM mapping spec.
|
|
1405
|
+
- `human` (last resort) — the agent contributes literally zero. Reserved for: sign a contract / DPA, authorize billing or budget, attend in-person / phone meeting, transfer account ownership the agent can't initiate. Surfaces in the `humanOnly` bucket of `baker actions list` — agents must not claim these.
|
|
1406
|
+
|
|
1407
|
+
If you discover after claiming that an action actually needs the other type, run `baker actions update <id> --executor human|agent` and `release` so the right party can pick it up.
|
|
1408
|
+
|
|
1409
|
+
---
|
|
1410
|
+
|
|
1359
1411
|
### `baker schema [command]`
|
|
1360
1412
|
|
|
1361
1413
|
Inspect command argument schemas for AI agent introspection.
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { defineCommand, runMain } from "citty";
|
|
3
|
+
import { actionsCommand } from "./commands/actions/index.js";
|
|
3
4
|
import { adsCommand } from "./commands/ads/index.js";
|
|
4
5
|
import { ga4Command } from "./commands/ga4/index.js";
|
|
5
6
|
import { gscCommand } from "./commands/gsc/index.js";
|
|
@@ -11,15 +12,17 @@ import { videosCommand } from "./commands/videos/index.js";
|
|
|
11
12
|
const main = defineCommand({
|
|
12
13
|
meta: {
|
|
13
14
|
name: "baker",
|
|
14
|
-
version: "0.
|
|
15
|
-
description: `AI-agent CLI for finding and managing images, videos, testimonials, and ad platform data in Baker.
|
|
15
|
+
version: "0.22.0",
|
|
16
|
+
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, and ad platform data in Baker.
|
|
16
17
|
|
|
17
18
|
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.
|
|
18
20
|
Output: All commands return JSON envelopes: { ok: true, data: ... } or { ok: false, error: { code, message } }.
|
|
19
21
|
Formats: Use --output json|csv|jsonl|files|md to control output format. Default: json.
|
|
20
22
|
Introspection: Run 'baker schema <command>' to inspect argument schemas.`,
|
|
21
23
|
},
|
|
22
24
|
subCommands: {
|
|
25
|
+
actions: actionsCommand,
|
|
23
26
|
ads: adsCommand,
|
|
24
27
|
ga4: ga4Command,
|
|
25
28
|
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,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,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;QACf,GAAG,EAAE,UAAU;QACf,GAAG,EAAE,UAAU;QACf,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,13 @@
|
|
|
1
|
+
export declare const claimCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Action ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Action ID";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=claim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/claim.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;;;;;;;;EAwBvB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost, validateConvexId } from "../../client.js";
|
|
3
|
+
import { requireChatId } from "../../env.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
import { failApi, failValidation, writeOk } from "./shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.claim",
|
|
8
|
+
description: "Claim an action for the current chat (live — visible to other chats immediately).",
|
|
9
|
+
args: {
|
|
10
|
+
id: { type: "string", description: "Action ID", required: true },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export const claimCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: "claim",
|
|
16
|
+
description: "Claim an action so other chats see you're working on it. Required before update/complete/discard. Example: baker actions claim <action-id>",
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
id: { type: "positional", description: "Action ID", required: false },
|
|
20
|
+
"action-id": { type: "string", description: "Action ID", required: false },
|
|
21
|
+
},
|
|
22
|
+
run: async ({ args }) => {
|
|
23
|
+
try {
|
|
24
|
+
const id = args.id || args["action-id"];
|
|
25
|
+
if (!id) {
|
|
26
|
+
failValidation("Action ID is required.");
|
|
27
|
+
}
|
|
28
|
+
validateConvexId(id);
|
|
29
|
+
const chatId = requireChatId();
|
|
30
|
+
await apiPost("/api/actions/claim", { actionId: id, chatId });
|
|
31
|
+
writeOk();
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
failApi(err);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=claim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../../src/commands/actions/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/D,cAAc,CAAC;IACb,OAAO,EAAE,eAAe;IACxB,WAAW,EAAE,mFAAmF;IAChG,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;KACjE;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;IACxC,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,WAAW,EACT,4IAA4I;KAC/I;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;QACrE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC3E;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,GAAI,IAAI,CAAC,EAAyB,IAAK,IAAI,CAAC,WAAW,CAAwB,CAAC;YACxF,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,cAAc,CAAC,wBAAwB,CAAC,CAAC;YAC3C,CAAC;YACD,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACrB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;YAC/B,MAAM,OAAO,CAAe,oBAAoB,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;YAC5E,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,18 @@
|
|
|
1
|
+
export declare const completeCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Action ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Action ID";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly note: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "What was done — context for the team and AI";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=complete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/complete.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;EAyB1B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost, validateConvexId } from "../../client.js";
|
|
3
|
+
import { requireChatId } from "../../env.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
import { failApi, failValidation, writeOk } from "./shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.complete",
|
|
8
|
+
description: "Stage completion of a claimed action. The action stays claimed and in_progress until the chat is published — only then does it become completed.",
|
|
9
|
+
args: {
|
|
10
|
+
id: { type: "string", description: "Action ID (must be claimed by current chat)", required: true },
|
|
11
|
+
note: { type: "string", description: "What was done — context for the team and AI", required: false },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const completeCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "complete",
|
|
17
|
+
description: "Stage completion of a claimed action. Real completion happens on chat publish. Example: baker actions complete <id>",
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
id: { type: "positional", description: "Action ID", required: false },
|
|
21
|
+
"action-id": { type: "string", description: "Action ID", required: false },
|
|
22
|
+
note: { type: "string", description: "What was done — context for the team and AI", required: false },
|
|
23
|
+
},
|
|
24
|
+
run: async ({ args }) => {
|
|
25
|
+
try {
|
|
26
|
+
const id = args.id || args["action-id"];
|
|
27
|
+
if (!id) {
|
|
28
|
+
failValidation("Action ID is required.");
|
|
29
|
+
}
|
|
30
|
+
validateConvexId(id);
|
|
31
|
+
const chatId = requireChatId();
|
|
32
|
+
await apiPost("/api/actions/complete", { chatId, actionId: id, note: args.note });
|
|
33
|
+
writeOk();
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
failApi(err);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=complete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete.js","sourceRoot":"","sources":["../../../src/commands/actions/complete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/D,cAAc,CAAC;IACb,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EACT,kJAAkJ;IACpJ,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE,QAAQ,EAAE,KAAK,EAAE;KACtG;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,qHAAqH;KACxH;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;QACrE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC1E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE,QAAQ,EAAE,KAAK,EAAE;KACtG;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,GAAI,IAAI,CAAC,EAAyB,IAAK,IAAI,CAAC,WAAW,CAAwB,CAAC;YACxF,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,cAAc,CAAC,wBAAwB,CAAC,CAAC;YAC3C,CAAC;YACD,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACrB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;YAC/B,MAAM,OAAO,CAAe,uBAAuB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAChG,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,29 @@
|
|
|
1
|
+
export declare const createCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly name: {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Action name";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly description: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Description";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
readonly default: "";
|
|
12
|
+
};
|
|
13
|
+
readonly executor: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "'agent' (default — agent contributes anything: draft, build, scaffold, prepare) or 'human' (last resort — agent contributes literally zero: sign, authorize, attend). Required.";
|
|
16
|
+
readonly required: false;
|
|
17
|
+
};
|
|
18
|
+
readonly tag: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "Tag slugs (comma-separated, repeatable)";
|
|
21
|
+
readonly required: false;
|
|
22
|
+
};
|
|
23
|
+
readonly "temp-id": {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly description: "Optional custom tempId";
|
|
26
|
+
readonly required: false;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/create.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDxB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 { failApi, failValidation, generateTempId } from "./shared.js";
|
|
7
|
+
registerSchema({
|
|
8
|
+
command: "actions.create",
|
|
9
|
+
description: "Stage creation of a new action (applies when the chat is published). Returns a tempId you can use to link/tag in the same draft.",
|
|
10
|
+
args: {
|
|
11
|
+
name: { type: "string", description: "Action name (short, action-verb, ≤6 words)", required: true },
|
|
12
|
+
description: {
|
|
13
|
+
type: "string",
|
|
14
|
+
description: "Context-complete description: what / why / where / done-when",
|
|
15
|
+
required: false,
|
|
16
|
+
},
|
|
17
|
+
executor: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Who executes this. Default 'agent' if the agent contributes anything — drafts copy, builds a page, prepares a list, scaffolds code, proposes options — even when a human does the final UI click (put that in the description as 'Final step (human): ...'). Pick 'human' ONLY when the agent contributes literally zero: sign contract, authorize billing, in-person meeting, account-ownership transfer. Required.",
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
tag: { type: "string", description: "Tag slugs (comma-separated)", required: false },
|
|
23
|
+
"temp-id": { type: "string", description: "Custom tempId (auto-generated if omitted)", required: false },
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
export const createCommand = defineCommand({
|
|
27
|
+
meta: {
|
|
28
|
+
name: "create",
|
|
29
|
+
description: 'Stage a new action. Applies when the chat is published. Example: baker actions create --name "Build hero" --tag copy',
|
|
30
|
+
},
|
|
31
|
+
args: {
|
|
32
|
+
name: { type: "string", description: "Action name", required: false },
|
|
33
|
+
description: { type: "string", description: "Description", required: false, default: "" },
|
|
34
|
+
executor: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "'agent' (default — agent contributes anything: draft, build, scaffold, prepare) or 'human' (last resort — agent contributes literally zero: sign, authorize, attend). Required.",
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
tag: { type: "string", description: "Tag slugs (comma-separated, repeatable)", required: false },
|
|
40
|
+
"temp-id": { type: "string", description: "Optional custom tempId", required: false },
|
|
41
|
+
},
|
|
42
|
+
run: async ({ args }) => {
|
|
43
|
+
try {
|
|
44
|
+
const name = args.name;
|
|
45
|
+
if (!name || name.trim().length === 0) {
|
|
46
|
+
failValidation("--name is required.");
|
|
47
|
+
}
|
|
48
|
+
const executor = args.executor;
|
|
49
|
+
if (executor !== "agent" && executor !== "human") {
|
|
50
|
+
failValidation("--executor is required. Default 'agent' if the agent contributes anything (draft, build, scaffold, prepare) — even when a human does the final UI click. Pick 'human' ONLY when the agent contributes literally zero (sign, authorize, attend, transfer ownership).");
|
|
51
|
+
}
|
|
52
|
+
const chatId = requireChatId();
|
|
53
|
+
const tempId = args["temp-id"] || generateTempId();
|
|
54
|
+
const tagSlugs = args.tag
|
|
55
|
+
? args.tag
|
|
56
|
+
.split(",")
|
|
57
|
+
.map((s) => s.trim())
|
|
58
|
+
.filter(Boolean)
|
|
59
|
+
: undefined;
|
|
60
|
+
const response = await apiPost("/api/actions/create", {
|
|
61
|
+
chatId,
|
|
62
|
+
tempId,
|
|
63
|
+
name,
|
|
64
|
+
description: args.description ?? "",
|
|
65
|
+
requiresHuman: executor === "human",
|
|
66
|
+
tagSlugs,
|
|
67
|
+
});
|
|
68
|
+
writeJson(response);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
failApi(err);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/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,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,cAAc,CAAC;IACb,OAAO,EAAE,gBAAgB;IACzB,WAAW,EACT,kIAAkI;IACpI,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4CAA4C,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnG,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,8DAA8D;YAC3E,QAAQ,EAAE,KAAK;SAChB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,sZAAsZ;YACxZ,QAAQ,EAAE,IAAI;SACf;QACD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE,QAAQ,EAAE,KAAK,EAAE;QACpF,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE,QAAQ,EAAE,KAAK,EAAE;KACzG;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC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IAAI,CAAC,GAAc;qBACjB,KAAK,CAAC,GAAG,CAAC;qBACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;qBACpB,MAAM,CAAC,OAAO,CAAC;gBACpB,CAAC,CAAC,SAAS,CAAC;YACd,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAyC,qBAAqB,EAAE;gBAC5F,MAAM;gBACN,MAAM;gBACN,IAAI;gBACJ,WAAW,EAAG,IAAI,CAAC,WAAsB,IAAI,EAAE;gBAC/C,aAAa,EAAE,QAAQ,KAAK,OAAO;gBACnC,QAAQ;aACT,CAAC,CAAC;YACH,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,18 @@
|
|
|
1
|
+
export declare const discardCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Action ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Action ID";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly reason: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Reason for discarding";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=discard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discard.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/discard.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;EA4BzB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost, validateConvexId } from "../../client.js";
|
|
3
|
+
import { requireChatId } from "../../env.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
import { failApi, failValidation, writeOk } from "./shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.discard",
|
|
8
|
+
description: "Stage discard of a claimed action. Applies on chat publish.",
|
|
9
|
+
args: {
|
|
10
|
+
id: { type: "string", description: "Action ID (must be claimed by current chat)", required: true },
|
|
11
|
+
reason: { type: "string", description: "Optional reason", required: false },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const discardCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "discard",
|
|
17
|
+
description: 'Stage discard of a claimed action. Example: baker actions discard <id> --reason "obsolete"',
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
id: { type: "positional", description: "Action ID", required: false },
|
|
21
|
+
"action-id": { type: "string", description: "Action ID", required: false },
|
|
22
|
+
reason: { type: "string", description: "Reason for discarding", required: false },
|
|
23
|
+
},
|
|
24
|
+
run: async ({ args }) => {
|
|
25
|
+
try {
|
|
26
|
+
const id = args.id || args["action-id"];
|
|
27
|
+
if (!id) {
|
|
28
|
+
failValidation("Action ID is required.");
|
|
29
|
+
}
|
|
30
|
+
validateConvexId(id);
|
|
31
|
+
const chatId = requireChatId();
|
|
32
|
+
await apiPost("/api/actions/discard", {
|
|
33
|
+
chatId,
|
|
34
|
+
actionId: id,
|
|
35
|
+
reason: args.reason,
|
|
36
|
+
});
|
|
37
|
+
writeOk();
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
failApi(err);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=discard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discard.js","sourceRoot":"","sources":["../../../src/commands/actions/discard.ts"],"names":[],"mappings":"AAAA,OAAO,E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R,cAAc,CAAC,wBAAwB,CAAC,CAAC;YAC3C,CAAC;YACD,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACrB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;YAC/B,MAAM,OAAO,CAAe,sBAAsB,EAAE;gBAClD,MAAM;gBACN,QAAQ,EAAE,EAAE;gBACZ,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,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: "Action ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "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/actions/get.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,UAAU;;;;;;;;;;;EAmBrB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost, validateConvexId } from "../../client.js";
|
|
3
|
+
import { writeJson } from "../../output.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
import { failApi, failValidation } from "./shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.get",
|
|
8
|
+
description: "Get a single action with tags, blockers, blocked-by, and active-chat info.",
|
|
9
|
+
args: {
|
|
10
|
+
id: { type: "string", description: "Action ID", required: true },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export const getCommand = defineCommand({
|
|
14
|
+
meta: { name: "get", description: "Get a single action by ID. Example: baker actions get <action-id>" },
|
|
15
|
+
args: {
|
|
16
|
+
id: { type: "positional", description: "Action ID", required: false },
|
|
17
|
+
"action-id": { type: "string", description: "Action ID (alternative to positional)", required: false },
|
|
18
|
+
},
|
|
19
|
+
run: async ({ args }) => {
|
|
20
|
+
try {
|
|
21
|
+
const id = args.id || args["action-id"];
|
|
22
|
+
if (!id) {
|
|
23
|
+
failValidation("Action ID is required.");
|
|
24
|
+
}
|
|
25
|
+
validateConvexId(id);
|
|
26
|
+
const response = await apiPost("/api/actions/get", { actionId: id });
|
|
27
|
+
writeJson(response);
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
failApi(err);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtD,cAAc,CAAC;IACb,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,4EAA4E;IACzF,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;KACjE;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;IACtC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,mEAAmE,EAAE;IACvG,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;QACrE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE,QAAQ,EAAE,KAAK,EAAE;KACvG;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,GAAI,IAAI,CAAC,EAAyB,IAAK,IAAI,CAAC,WAAW,CAAwB,CAAC;YACxF,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,cAAc,CAAC,wBAAwB,CAAC,CAAC;YAC3C,CAAC;YACD,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACrB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAA8B,kBAAkB,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;YAClG,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/actions/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,cAAc,qDA6BzB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { claimCommand } from "./claim.js";
|
|
3
|
+
import { completeCommand } from "./complete.js";
|
|
4
|
+
import { createCommand } from "./create.js";
|
|
5
|
+
import { discardCommand } from "./discard.js";
|
|
6
|
+
import { getCommand } from "./get.js";
|
|
7
|
+
import { linkCommand } from "./link.js";
|
|
8
|
+
import { listCommand } from "./list.js";
|
|
9
|
+
import { releaseCommand } from "./release.js";
|
|
10
|
+
import { tagCommand } from "./tag/index.js";
|
|
11
|
+
import { unlinkCommand } from "./unlink.js";
|
|
12
|
+
import { updateCommand } from "./update.js";
|
|
13
|
+
export const actionsCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: "actions",
|
|
16
|
+
description: `Manage action items for the current chat. Subcommands: list, get, claim, release, create, update, complete, discard, link, unlink, tag.
|
|
17
|
+
|
|
18
|
+
Lifecycle: claim an action before working on it. Stage create/complete/discard via this CLI; they apply when the chat is published. Release if you decide not to work on it after all.
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
baker actions list # bucketed view: claimable, myClaims, blocked, claimedByOthers
|
|
22
|
+
baker actions claim <id>
|
|
23
|
+
baker actions create --name "Build hero" --description "..." --tag copy
|
|
24
|
+
baker actions complete <id>
|
|
25
|
+
baker actions discard <id> --reason "obsolete"
|
|
26
|
+
baker actions tag list
|
|
27
|
+
baker actions tag create --slug copy --label Copy`,
|
|
28
|
+
},
|
|
29
|
+
subCommands: {
|
|
30
|
+
list: listCommand,
|
|
31
|
+
get: getCommand,
|
|
32
|
+
claim: claimCommand,
|
|
33
|
+
release: releaseCommand,
|
|
34
|
+
create: createCommand,
|
|
35
|
+
update: updateCommand,
|
|
36
|
+
complete: completeCommand,
|
|
37
|
+
discard: discardCommand,
|
|
38
|
+
link: linkCommand,
|
|
39
|
+
unlink: unlinkCommand,
|
|
40
|
+
tag: tagCommand,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC1C,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;oDAWmC;KACjD;IACD,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,YAAY;QACnB,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,cAAc;QACvB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,aAAa;QACrB,GAAG,EAAE,UAAU;KAChB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const linkCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly blocker: {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Blocker ref";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly blocked: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Blocked ref";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/link.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,WAAW;;;;;;;;;;;EA2BtB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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, writeOk } from "./shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.link",
|
|
8
|
+
description: "Stage a 'blocker -> blocked' dependency. Refs can be either action IDs or tempIds from create ops in the same draft.",
|
|
9
|
+
args: {
|
|
10
|
+
blocker: { type: "string", description: "Blocker action ID or tempId", required: true },
|
|
11
|
+
blocked: { type: "string", description: "Blocked action ID or tempId", required: true },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const linkCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "link",
|
|
17
|
+
description: "Stage a dependency link. Example: baker actions link --blocker <id> --blocked <id>",
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
blocker: { type: "string", description: "Blocker ref", required: false },
|
|
21
|
+
blocked: { type: "string", description: "Blocked ref", required: false },
|
|
22
|
+
},
|
|
23
|
+
run: async ({ args }) => {
|
|
24
|
+
try {
|
|
25
|
+
const blocker = args.blocker;
|
|
26
|
+
const blocked = args.blocked;
|
|
27
|
+
if (!blocker || !blocked) {
|
|
28
|
+
failValidation("--blocker and --blocked are required.");
|
|
29
|
+
}
|
|
30
|
+
const chatId = requireChatId();
|
|
31
|
+
await apiPost("/api/actions/link", {
|
|
32
|
+
chatId,
|
|
33
|
+
blockerRef: blocker,
|
|
34
|
+
blockedRef: blocked,
|
|
35
|
+
});
|
|
36
|
+
writeOk();
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
failApi(err);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/commands/actions/link.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,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/D,cAAc,CAAC;IACb,OAAO,EAAE,cAAc;IACvB,WAAW,EACT,sHAAsH;IACxH,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAE;QACvF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAE;KACxF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,oFAAoF;KAClG;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE;QACxE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE;KACzE;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAA6B,CAAC;YACnD,MAAM,OAAO,GAAG,IAAI,CAAC,OAA6B,CAAC;YACnD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;gBACzB,cAAc,CAAC,uCAAuC,CAAC,CAAC;YAC1D,CAAC;YACD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;YAC/B,MAAM,OAAO,CAAe,mBAAmB,EAAE;gBAC/C,MAAM;gBACN,UAAU,EAAE,OAAO;gBACnB,UAAU,EAAE,OAAO;aACpB,CAAC,CAAC;YACH,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,19 @@
|
|
|
1
|
+
export declare const listCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly bucketed: {
|
|
3
|
+
readonly type: "boolean";
|
|
4
|
+
readonly description: "Pre-bucket by chat";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
readonly default: true;
|
|
7
|
+
};
|
|
8
|
+
readonly status: {
|
|
9
|
+
readonly type: "string";
|
|
10
|
+
readonly description: "Status filter (raw mode)";
|
|
11
|
+
readonly required: false;
|
|
12
|
+
};
|
|
13
|
+
readonly tag: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "Tag slug filter (raw mode, comma-separated)";
|
|
16
|
+
readonly required: false;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/list.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;EAoCtB,CAAC"}
|