@markjaquith/agency 3.5.2 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -16
- package/cli-main.ts +13 -2
- package/package.json +8 -5
- package/src/act-schema.ts +62 -0
- package/src/cli-parser.ts +13 -3
- package/src/commands/act-actions.ts +734 -0
- package/src/commands/act-prompts.ts +294 -0
- package/src/commands/act.ts +602 -436
- package/src/utils/chooser.ts +7 -0
- package/src/utils/interactive.tsx +528 -87
- package/src/workbase/AGENTS.md +49 -0
- package/src/workbase/work-target.ts +6 -4
package/src/workbase/AGENTS.md
CHANGED
|
@@ -4,6 +4,55 @@ This directory is an Agency workbase. Epics, tasks, and phases are durable
|
|
|
4
4
|
Markdown documents; repository aliases and generated Git worktrees provide code
|
|
5
5
|
access.
|
|
6
6
|
|
|
7
|
+
## Discover Actions First
|
|
8
|
+
|
|
9
|
+
After the `agency context . --json` bootstrap, use `agency act --json` as the
|
|
10
|
+
primary way to discover what Agency can do. Prefer its live action catalog over
|
|
11
|
+
searching command help, reading implementation code, or guessing commands from
|
|
12
|
+
memory. It reports available actions, blocked reasons, required inputs, exact
|
|
13
|
+
argv/templates, document revisions, and explicit follow-up choices.
|
|
14
|
+
|
|
15
|
+
Keep discovery focused on the work at hand:
|
|
16
|
+
|
|
17
|
+
- Current task: `agency act --task <context-task-id> --json`.
|
|
18
|
+
- Current phase: `agency act --task <context-task-id> --phase <context-phase-id> --json`.
|
|
19
|
+
- One operation: add `--action <action-id>` to either selector.
|
|
20
|
+
- Workbase-level creation or repository actions: use
|
|
21
|
+
`agency act --action <action-id> --json` without an item selector.
|
|
22
|
+
- Unsure which action or item applies: `agency act --json`.
|
|
23
|
+
|
|
24
|
+
Use selectors returned by context, not IDs inferred from checkout or branch
|
|
25
|
+
names. Execute an available `command` as argv from the returned workbase root.
|
|
26
|
+
For a `commandTemplate`, substitute required input placeholders; append optional
|
|
27
|
+
inputs using their declared `option`. Preserve multiline input as one argv value.
|
|
28
|
+
Re-discover after mutations because availability and revisions may change.
|
|
29
|
+
|
|
30
|
+
Discovery is read-only and does not grant consent. `followUpCommands` describe
|
|
31
|
+
the action's bookkeeping; `nextActions` require a separate explicit choice.
|
|
32
|
+
Creation never implies starting Work. Respect blocked reasons and the consent
|
|
33
|
+
boundaries below. The command fast paths remain useful when the exact operation
|
|
34
|
+
and arguments are already established; do not rediscover between every known
|
|
35
|
+
step or use help unless discovery does not cover the operation.
|
|
36
|
+
|
|
37
|
+
### Current Work and Branch Context
|
|
38
|
+
|
|
39
|
+
When the request concerns this execution unit, target its context task/phase
|
|
40
|
+
rather than browsing the entire workbase. Use `authority.writable.checkoutPath`
|
|
41
|
+
for repository work and the declared delivery branch for publication.
|
|
42
|
+
|
|
43
|
+
For new work that builds on the current implementation (a follow-up, additional
|
|
44
|
+
phase, or explicitly requested continuation), prefer the current execution's
|
|
45
|
+
declared branch as `--base` when that matches the user's intent. Do not blindly
|
|
46
|
+
copy `main` from examples or accept a wizard default. Confirm the branch from
|
|
47
|
+
Agency context; when checking the live Git branch is necessary, do so in the
|
|
48
|
+
writable checkout, not the workbase root. An explicit user base takes precedence.
|
|
49
|
+
Unrelated new work should use its intended integration base instead.
|
|
50
|
+
|
|
51
|
+
Branch ancestry is not a completion dependency. Choosing the current branch as
|
|
52
|
+
the base does not add `--depends-on`, reuse the current item for explicitly new
|
|
53
|
+
work, switch branches, or expand write authority. Pass the chosen base as the
|
|
54
|
+
discovered `base` input to the native creation/handoff command.
|
|
55
|
+
|
|
7
56
|
## Command Fast Paths
|
|
8
57
|
|
|
9
58
|
When a request clearly matches one of these intents, use the exact recipe without
|
|
@@ -68,7 +68,7 @@ const statuses: Record<
|
|
|
68
68
|
> = {
|
|
69
69
|
open: { icon: "", color: macchiato.overlay1 },
|
|
70
70
|
working: { icon: "", color: macchiato.blue },
|
|
71
|
-
delegated: { icon: "", color: macchiato.
|
|
71
|
+
delegated: { icon: "", color: macchiato.blue },
|
|
72
72
|
done: { icon: "", color: macchiato.green },
|
|
73
73
|
dropped: { icon: "", color: macchiato.red },
|
|
74
74
|
}
|
|
@@ -77,11 +77,13 @@ const kinds: Record<
|
|
|
77
77
|
WorkTarget["kind"],
|
|
78
78
|
{ readonly icon: string; readonly color: string }
|
|
79
79
|
> = {
|
|
80
|
-
epic: { icon: "", color: macchiato.
|
|
81
|
-
task: { icon: "", color: macchiato.
|
|
82
|
-
phase: { icon: "
|
|
80
|
+
epic: { icon: "", color: macchiato.overlay1 },
|
|
81
|
+
task: { icon: "", color: macchiato.overlay1 },
|
|
82
|
+
phase: { icon: "", color: macchiato.overlay1 },
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
export { statuses as workStatusStyle, kinds as workKindStyle }
|
|
86
|
+
|
|
85
87
|
const hexToAnsi = (color: string) => {
|
|
86
88
|
const value = color.slice(1)
|
|
87
89
|
return [0, 2, 4]
|