adr-kit 0.8.0 → 0.10.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 +40 -16
- package/README.zh.md +35 -18
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +48 -18
- package/dist/cli.js.map +1 -1
- package/dist/commands/accept.d.ts +2 -2
- package/dist/commands/accept.d.ts.map +1 -1
- package/dist/commands/accept.js +2 -2
- package/dist/commands/accept.js.map +1 -1
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +13 -8
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/decide.d.ts +2 -2
- package/dist/commands/decide.d.ts.map +1 -1
- package/dist/commands/decide.js +2 -2
- package/dist/commands/decide.js.map +1 -1
- package/dist/commands/graph.d.ts +1 -0
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/commands/graph.js +4 -1
- package/dist/commands/graph.js.map +1 -1
- package/dist/commands/init.js +2 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/instructions.js +6 -6
- package/dist/commands/instructions.js.map +1 -1
- package/dist/commands/list.js +1 -1
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/propose.js +2 -2
- package/dist/commands/propose.js.map +1 -1
- package/dist/commands/tree.d.ts +3 -0
- package/dist/commands/tree.d.ts.map +1 -0
- package/dist/commands/tree.js +18 -0
- package/dist/commands/tree.js.map +1 -0
- package/dist/core/adr.d.ts +19 -1
- package/dist/core/adr.d.ts.map +1 -1
- package/dist/core/adr.js +16 -1
- package/dist/core/adr.js.map +1 -1
- package/dist/core/canvas-view.d.ts +5 -0
- package/dist/core/canvas-view.d.ts.map +1 -0
- package/dist/core/canvas-view.js +121 -0
- package/dist/core/canvas-view.js.map +1 -0
- package/dist/core/deliberation-html.d.ts +4 -0
- package/dist/core/deliberation-html.d.ts.map +1 -0
- package/dist/core/deliberation-html.js +81 -0
- package/dist/core/deliberation-html.js.map +1 -0
- package/dist/core/deliberation-view.d.ts +4 -0
- package/dist/core/deliberation-view.d.ts.map +1 -0
- package/dist/core/deliberation-view.js +508 -0
- package/dist/core/deliberation-view.js.map +1 -0
- package/dist/core/deliberation.d.ts +40 -0
- package/dist/core/deliberation.d.ts.map +1 -0
- package/dist/core/deliberation.js +212 -0
- package/dist/core/deliberation.js.map +1 -0
- package/dist/core/graph-html.d.ts +8 -0
- package/dist/core/graph-html.d.ts.map +1 -0
- package/dist/core/graph-html.js +180 -0
- package/dist/core/graph-html.js.map +1 -0
- package/dist/core/graph-view.d.ts +3 -0
- package/dist/core/graph-view.d.ts.map +1 -0
- package/dist/core/graph-view.js +258 -0
- package/dist/core/graph-view.js.map +1 -0
- package/dist/core/graph.d.ts +4 -1
- package/dist/core/graph.d.ts.map +1 -1
- package/dist/core/graph.js +11 -2
- package/dist/core/graph.js.map +1 -1
- package/dist/core/repository.d.ts.map +1 -1
- package/dist/core/repository.js +27 -12
- package/dist/core/repository.js.map +1 -1
- package/dist/core/templates.d.ts +11 -6
- package/dist/core/templates.d.ts.map +1 -1
- package/dist/core/templates.js +14 -4
- package/dist/core/templates.js.map +1 -1
- package/dist/core/tool-integrations.d.ts.map +1 -1
- package/dist/core/tool-integrations.js +178 -46
- package/dist/core/tool-integrations.js.map +1 -1
- package/dist/core/validate.d.ts.map +1 -1
- package/dist/core/validate.js +37 -1
- package/dist/core/validate.js.map +1 -1
- package/dist/core/view-text.d.ts +14 -0
- package/dist/core/view-text.d.ts.map +1 -0
- package/dist/core/view-text.js +77 -0
- package/dist/core/view-text.js.map +1 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Requires Node.js 20.19 or later.
|
|
|
38
38
|
npm install -g adr-kit
|
|
39
39
|
cd your-project
|
|
40
40
|
adrkit init
|
|
41
|
-
adrkit decide "Use SQLite for session storage" --decided-by human
|
|
41
|
+
adrkit decide "Use SQLite for session storage" --raised-by human --decided-by human
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
`adrkit init` creates an `adr/` directory:
|
|
@@ -51,7 +51,9 @@ adr/
|
|
|
51
51
|
└── decisions/ # decisions, numbered N, immutable history
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
`adrkit decide` is the default path: it records an already-made decision
|
|
55
|
+
directly. Proposals are the exception, used only when a decision still needs
|
|
56
|
+
review. They are ephemeral drafts in `adr/.drafts/`: `adrkit propose` creates
|
|
55
57
|
one, `adrkit accept` promotes it to a numbered decision, and `adrkit reject`
|
|
56
58
|
discards it without leaving a record. Rejection is recorded in a decision's
|
|
57
59
|
`Alternatives considered`, never as a standalone record.
|
|
@@ -68,7 +70,7 @@ adrkit list
|
|
|
68
70
|
Paste this into any AI coding agent to record key decisions automatically:
|
|
69
71
|
|
|
70
72
|
```text
|
|
71
|
-
Use github.com/luochang212/adr-kit in this repository to automatically record key
|
|
73
|
+
Use github.com/luochang212/adr-kit in this repository to automatically record key decisions. Prefer `adrkit decide`; use `adrkit propose` only when a decision still needs review. Every record declares two flags: `--raised-by` (who put the decision on the table) and `--decided-by` (whose judgment settled it). Use `human` when a person determined it, `agent` when it came from your own judgment, even if a person let it through.
|
|
72
74
|
```
|
|
73
75
|
|
|
74
76
|
To use decisions in later coding tasks, add the [reading rule](docs/workflow.md#read-decisions-before-coding)
|
|
@@ -86,10 +88,10 @@ rationale is not apparent from code alone; routine fixes need no ADR. See
|
|
|
86
88
|
```text
|
|
87
89
|
adrkit init [path] [--tools <list>] [--workflows <list>]
|
|
88
90
|
Initialize an ADR Kit repository
|
|
89
|
-
adrkit decide <title> --decided-by <human|agent>
|
|
91
|
+
adrkit decide <title> --raised-by <human|agent> --decided-by <human|agent>
|
|
90
92
|
Record an already-made decision (default path)
|
|
91
|
-
adrkit propose <title> Create an ephemeral proposal draft
|
|
92
|
-
adrkit accept <name> --decided-by <human|agent>
|
|
93
|
+
adrkit propose <title> Create an ephemeral proposal draft (only when review is needed)
|
|
94
|
+
adrkit accept <name> --raised-by <human|agent> --decided-by <human|agent>
|
|
93
95
|
Promote a draft to a decision (assigns N)
|
|
94
96
|
adrkit reject <name> [--reason <text>] Discard a draft (leaves no record)
|
|
95
97
|
adrkit supersede <name> --by <name> Mark an accepted decision as superseded
|
|
@@ -101,8 +103,9 @@ adrkit validate [name] [--all] Validate one record or the repository
|
|
|
101
103
|
adrkit update [--tools <list>] [--workflows <list>]
|
|
102
104
|
Rewrite AI tool integrations
|
|
103
105
|
adrkit config Print the current configuration
|
|
104
|
-
adrkit graph [--mermaid|--dot|--text] [--formal-only] [--tag <tag>]
|
|
106
|
+
adrkit graph [--mermaid|--dot|--text|--html] [--formal-only] [--tag <tag>]
|
|
105
107
|
Emit the decision relationship graph
|
|
108
|
+
adrkit tree <name> [--mermaid|--text|--html] Render a record's deliberation tree
|
|
106
109
|
adrkit completion <bash|zsh|fish> Print a shell completion script
|
|
107
110
|
adrkit version Print the version
|
|
108
111
|
```
|
|
@@ -117,7 +120,7 @@ adrkit version Print the version
|
|
|
117
120
|
> `.claude/` copies; an exception we carry until Anthropic adopts the standard.
|
|
118
121
|
|
|
119
122
|
> [!TIP]
|
|
120
|
-
> Every integration ships all
|
|
123
|
+
> Every integration ships all eight workflow skills by default. A small
|
|
121
124
|
> repository that only records decisions can pass
|
|
122
125
|
> `--workflows init,decide,validate` to install a lean subset; the choice is
|
|
123
126
|
> recorded in `adr/config.yaml`, `adrkit update` keeps it, and
|
|
@@ -142,6 +145,7 @@ Every record is YAML front matter followed by a Markdown body:
|
|
|
142
145
|
---
|
|
143
146
|
status: accepted
|
|
144
147
|
date: 2026-08-19
|
|
148
|
+
raised-by: human
|
|
145
149
|
decided-by: human
|
|
146
150
|
created: 2026-08-17
|
|
147
151
|
commit: abc1234
|
|
@@ -163,14 +167,16 @@ by theme. Decisions are immutable history; the current facts
|
|
|
163
167
|
live in code, not in the record.
|
|
164
168
|
|
|
165
169
|
`accepted` denotes a recorded decision, not proof of human review.
|
|
166
|
-
`decided-by`
|
|
167
|
-
`
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
`raised-by` and `decided-by` are each `human` or `agent`, declared when
|
|
171
|
+
`decide` or `accept` runs: `raised-by` is who put the decision on the table,
|
|
172
|
+
and `decided-by` is whose judgment settled it. For `decided-by`, `human`
|
|
173
|
+
means a person determined the direction (they stated it, changed a proposal into
|
|
174
|
+
what shipped, or you are recording one they made earlier), `agent` when it came
|
|
175
|
+
from the agent's own judgment, including when a person only let it through. The
|
|
176
|
+
CLI records the declarations without inferring or verifying them, so the fields
|
|
177
|
+
do not establish who chose or authorized the decision; when who proposed and who
|
|
178
|
+
approved matters, write it in the body. `supersede` preserves both original
|
|
179
|
+
values. See the
|
|
174
180
|
[record format reference](docs/record-format.md) for limitations. Identity
|
|
175
181
|
stays in git.
|
|
176
182
|
|
|
@@ -193,6 +199,24 @@ stays in git.
|
|
|
193
199
|
owed: `## Proposal` becomes `## Decision`, and `Acceptance criteria` plus
|
|
194
200
|
`Risks` are folded into `## Consequences`.
|
|
195
201
|
|
|
202
|
+
A decision may also carry an optional `## Deliberation` appendix: the design
|
|
203
|
+
tree behind the choice, stored as a nested Markdown list whose nodes may be
|
|
204
|
+
tagged `[settled]`, `[rejected]`, or `[open]`. A follow-up question is
|
|
205
|
+
nested under the node that raised it, so related questions run deeper and
|
|
206
|
+
unrelated ones stay flat. Render it with `adrkit tree <name>` (text by default,
|
|
207
|
+
`--mermaid` for a graph, `--html` for an offline interactive card tree). The
|
|
208
|
+
`adrkit-grill` workflow produces that tree and records every decision the
|
|
209
|
+
session settles. The whole set renders as an interactive offline decision map with
|
|
210
|
+
`adrkit graph --html`, which marks the decisions that carry a tree. Ask your
|
|
211
|
+
agent to visualize a recorded decision when needed;
|
|
212
|
+
it uses the built-in renderer and returns an HTML file link. HTML is not a
|
|
213
|
+
default grilling deliverable, and a browser opens only on an explicit request.
|
|
214
|
+
Run `adrkit update` to refresh installed skills.
|
|
215
|
+
|
|
216
|
+
```sh
|
|
217
|
+
adrkit tree 7 --html > "adr-7.html"
|
|
218
|
+
```
|
|
219
|
+
|
|
196
220
|
## Compatibility with other tools
|
|
197
221
|
|
|
198
222
|
ADR Kit owns one directory, `adr/`, and reads and validates only its own
|
package/README.zh.md
CHANGED
|
@@ -36,7 +36,7 @@ agent 原生代码库的决策记录纪律:每条记录都必须说明它解
|
|
|
36
36
|
npm install -g adr-kit
|
|
37
37
|
cd your-project
|
|
38
38
|
adrkit init
|
|
39
|
-
adrkit decide "使用 SQLite 存储会话" --decided-by human
|
|
39
|
+
adrkit decide "使用 SQLite 存储会话" --raised-by human --decided-by human
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
`adrkit init` 会创建 `adr/` 目录:
|
|
@@ -49,9 +49,10 @@ adr/
|
|
|
49
49
|
└── decisions/ # 决策,按 N 编号,不可变历史
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
`adrkit
|
|
54
|
-
|
|
52
|
+
`adrkit decide` 是默认路径,直接记录已成定局的决策。需要评审时,提案是
|
|
53
|
+
`adr/.drafts/` 里的临时草稿:`adrkit propose` 创建一条,`adrkit accept` 把它
|
|
54
|
+
提升为编号决策,`adrkit reject` 直接丢弃、不留下任何记录。拒绝记录在决策的
|
|
55
|
+
`Alternatives considered` 里,从不是独立记录。
|
|
55
56
|
|
|
56
57
|
填写决策内容后:
|
|
57
58
|
|
|
@@ -65,7 +66,7 @@ adrkit list
|
|
|
65
66
|
把下面这行贴给任意 AI 编码 Agent,它就会自动把关键决策记录成 ADR:
|
|
66
67
|
|
|
67
68
|
```text
|
|
68
|
-
在本仓库用 github.com/luochang212/adr-kit
|
|
69
|
+
在本仓库用 github.com/luochang212/adr-kit 自动记录关键决策。优先用 `adrkit decide`,仅当决策还需评审时才用 `adrkit propose`。每条记录都要声明两个值:`raised-by`(谁把决策提上台面)与 `decided-by`(谁的判断定下它);方向由人决定用 `human`,由你自己的判断得出用 `agent`,即使人只是放行。
|
|
69
70
|
```
|
|
70
71
|
|
|
71
72
|
让后续编码任务也用上决策:在项目 `AGENTS.md`(Claude Code 团队也包括
|
|
@@ -80,10 +81,10 @@ CLI 不会自动修改项目指令文件。只有持续约束后续开发、且
|
|
|
80
81
|
```text
|
|
81
82
|
adrkit init [path] [--tools <list>] [--workflows <list>]
|
|
82
83
|
初始化 ADR Kit 仓库
|
|
83
|
-
adrkit decide <title> --decided-by <human|agent>
|
|
84
|
+
adrkit decide <title> --raised-by <human|agent> --decided-by <human|agent>
|
|
84
85
|
直接记录已做的决策(默认路径)
|
|
85
|
-
adrkit propose <title>
|
|
86
|
-
adrkit accept <name> --decided-by <human|agent>
|
|
86
|
+
adrkit propose <title> 仅当决策还需评审时,创建临时提案草稿
|
|
87
|
+
adrkit accept <name> --raised-by <human|agent> --decided-by <human|agent>
|
|
87
88
|
把草稿提升为决策(分配 N 编号)
|
|
88
89
|
adrkit reject <name> [--reason <text>] 丢弃草稿(不留记录)
|
|
89
90
|
adrkit supersede <name> --by <name> 标记已接受决策被新决策取代
|
|
@@ -95,8 +96,9 @@ adrkit validate [name] [--all] 校验单条记录或整个仓库
|
|
|
95
96
|
adrkit update [--tools <list>] [--workflows <list>]
|
|
96
97
|
重写 AI 工具集成文件
|
|
97
98
|
adrkit config 查看当前配置
|
|
98
|
-
adrkit graph [--mermaid|--dot|--text] [--formal-only] [--tag <tag>]
|
|
99
|
+
adrkit graph [--mermaid|--dot|--text|--html] [--formal-only] [--tag <tag>]
|
|
99
100
|
输出决策关系图
|
|
101
|
+
adrkit tree <name> [--mermaid|--text|--html] 渲染记录的 deliberation 树
|
|
100
102
|
adrkit completion <bash|zsh|fish> 打印 shell 补全脚本
|
|
101
103
|
adrkit version 查看版本
|
|
102
104
|
```
|
|
@@ -110,7 +112,7 @@ adrkit version 查看版本
|
|
|
110
112
|
> 副本;这个例外我们一直背到 Anthropic 采纳标准为止。
|
|
111
113
|
|
|
112
114
|
> [!TIP]
|
|
113
|
-
>
|
|
115
|
+
> 集成默认安装全部八个工作流技能。只记录决策的小仓库可传
|
|
114
116
|
> `--workflows init,decide,validate` 装精简子集;选择会写入
|
|
115
117
|
> `adr/config.yaml`,`adrkit update` 会保持,`--workflows all` 恢复全套。
|
|
116
118
|
|
|
@@ -133,6 +135,7 @@ adrkit version 查看版本
|
|
|
133
135
|
---
|
|
134
136
|
status: accepted
|
|
135
137
|
date: 2026-08-19
|
|
138
|
+
raised-by: human
|
|
136
139
|
decided-by: human
|
|
137
140
|
created: 2026-08-17
|
|
138
141
|
commit: abc1234
|
|
@@ -151,14 +154,14 @@ tags: [frontend]
|
|
|
151
154
|
关键词)让 `adrkit graph` 按主题分组和过滤决策。决策是不可变历史;当前
|
|
152
155
|
事实以代码为准,不在记录里。
|
|
153
156
|
|
|
154
|
-
`accepted` 表示正式记录的决定,不代表人已审阅批准。`decided-by`
|
|
155
|
-
`human` 或 `agent`,在 `decide` 或 `accept`
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
`accepted` 表示正式记录的决定,不代表人已审阅批准。`raised-by` 与 `decided-by`
|
|
158
|
+
取值都是 `human` 或 `agent`,在 `decide` 或 `accept` 时声明:`raised-by` 是
|
|
159
|
+
谁把决策提上台面,`decided-by` 是谁的判断定下了它。`decided-by` 取 `human`
|
|
160
|
+
表示方向由人决定(人说出的、人把 agent 的提案改成最终落地方案的、或人此前定过
|
|
161
|
+
而现在只是补记的),取 `agent` 表示由 AI 自主判断得出,包括人只是放行的情况。
|
|
162
|
+
CLI 既不推断也不校验,只记录声明,所以它不能证明是谁自主拍板或授权;谁改写、
|
|
163
|
+
谁批准写进正文。`supersede` 保留两个原值。局限见
|
|
164
|
+
[记录格式参考](docs/zh/record-format.md)。身份留在 git 里。
|
|
162
165
|
|
|
163
166
|
- **决策**(`adr/decisions/N-slug.md`)是 `accepted` 或 `superseded`,
|
|
164
167
|
需要 `Problem`、`Decision`、`Alternatives considered`、`Consequences`;
|
|
@@ -177,6 +180,20 @@ tags: [frontend]
|
|
|
177
180
|
`adrkit accept` 会自动完成生命周期迁移所要求的改写:`## Proposal` 改为
|
|
178
181
|
`## Decision`,`Acceptance criteria` 与 `Risks` 合并进 `## Consequences`。
|
|
179
182
|
|
|
183
|
+
决策还可以携带可选的 `## Deliberation` 附录:记录选择背后的 design tree,
|
|
184
|
+
用嵌套 Markdown 列表存储,节点可标注 `[settled]`、`[rejected]`、`[open]`。
|
|
185
|
+
后续问题嵌在提出它的节点之下,因此相关问题更深、无关问题平铺。用 `adrkit tree
|
|
186
|
+
<name>` 渲染(默认文本,加 `--mermaid` 输出图形,加 `--html` 输出离线交互卡片树)。这
|
|
187
|
+
棵树通常来自 `adrkit-grill` 工作流,它记录会话定下的每个决策。
|
|
188
|
+
需要时让 AI 可视化指定决策,它会调用内置渲染器并提供 HTML 文件链接。
|
|
189
|
+
HTML 不是 grilling 的默认交付,只有明确要求时才打开浏览器。
|
|
190
|
+
整套决策可用 `adrkit graph --html` 渲染为可交互的离线决策地图,并标出带 deliberation 树的决策。
|
|
191
|
+
用 `adrkit update` 更新已安装的技能。
|
|
192
|
+
|
|
193
|
+
```sh
|
|
194
|
+
adrkit tree 7 --html > "adr-7.html"
|
|
195
|
+
```
|
|
196
|
+
|
|
180
197
|
## 工具兼容性
|
|
181
198
|
|
|
182
199
|
ADR Kit 只拥有 `adr/` 这一个目录,并且只读取和校验自己的文件,因此可以
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAsEA,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAmLzC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseArgs } from 'node:util';
|
|
2
2
|
import { pathToFileURL } from 'node:url';
|
|
3
3
|
import { VERSION } from './version.js';
|
|
4
|
-
import { isDecidedBy } from './core/adr.js';
|
|
4
|
+
import { isDecidedBy, isRaisedBy } from './core/adr.js';
|
|
5
5
|
import { acceptCommand } from './commands/accept.js';
|
|
6
6
|
import { completionCommand } from './commands/completion.js';
|
|
7
7
|
import { configCommand } from './commands/config.js';
|
|
@@ -15,25 +15,27 @@ import { rejectCommand } from './commands/reject.js';
|
|
|
15
15
|
import { showCommand } from './commands/show.js';
|
|
16
16
|
import { statusCommand } from './commands/status.js';
|
|
17
17
|
import { supersedeCommand } from './commands/supersede.js';
|
|
18
|
+
import { treeCommand } from './commands/tree.js';
|
|
18
19
|
import { updateCommand } from './commands/update.js';
|
|
19
20
|
import { validateCommand } from './commands/validate.js';
|
|
20
21
|
const HELP = `adrkit ${VERSION} - A lightweight ADR workflow for humans and agents
|
|
21
22
|
|
|
22
23
|
Decisions are durable records in adr/decisions/. Proposals are ephemeral drafts
|
|
23
24
|
in adr/.drafts/ that are promoted by accept or discarded by reject. decide and
|
|
24
|
-
accept require --
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
accept require two declarations. --raised-by records who put the decision on
|
|
26
|
+
the table; --decided-by records whose judgment settled it: human when a person
|
|
27
|
+
determined the direction (they stated it, changed a proposal into what shipped,
|
|
28
|
+
or you are recording one they made earlier), agent when it came from the
|
|
29
|
+
agent's own judgment. Either axis may be human or agent, and the CLI neither
|
|
30
|
+
infers nor verifies either.
|
|
29
31
|
|
|
30
32
|
Usage:
|
|
31
33
|
adrkit init [path] [--tools <list>] [--workflows <list>]
|
|
32
34
|
Initialize an ADR Kit repository
|
|
33
|
-
adrkit decide <title> --decided-by <human|agent>
|
|
35
|
+
adrkit decide <title> --raised-by <human|agent> --decided-by <human|agent>
|
|
34
36
|
Record a decision (default path)
|
|
35
37
|
adrkit propose <title> Create an ephemeral proposal draft
|
|
36
|
-
adrkit accept <name> --decided-by <human|agent>
|
|
38
|
+
adrkit accept <name> --raised-by <human|agent> --decided-by <human|agent>
|
|
37
39
|
Promote a draft to a decision (assigns the next number)
|
|
38
40
|
adrkit reject <name> [--reason <reason>] Discard a draft (leaves no record)
|
|
39
41
|
adrkit supersede <name> --by <name> Mark an accepted decision as superseded
|
|
@@ -45,8 +47,9 @@ Usage:
|
|
|
45
47
|
adrkit update [--tools <list>] [--workflows <list>]
|
|
46
48
|
Rewrite AI tool integrations
|
|
47
49
|
adrkit config Print the current configuration
|
|
48
|
-
adrkit graph [--mermaid|--dot|--text] [--formal-only] [--tag <tag>]
|
|
50
|
+
adrkit graph [--mermaid|--dot|--text|--html] [--formal-only] [--tag <tag>]
|
|
49
51
|
Emit the decision relationship graph
|
|
52
|
+
adrkit tree <name> [--mermaid|--text|--html] Render the record's deliberation tree
|
|
50
53
|
adrkit completion <bash|zsh|fish> Print a shell completion script
|
|
51
54
|
adrkit version Print the version
|
|
52
55
|
adrkit -h, --help Print this help
|
|
@@ -56,8 +59,9 @@ adrkit graph visualizes the decision history: solid edges are formal
|
|
|
56
59
|
superseded-by links, dashed edges are ADR-N references mined from record
|
|
57
60
|
bodies, and nodes group by their created date. --mermaid pastes into any
|
|
58
61
|
Markdown and renders natively on GitHub (nodes are tinted by their tags),
|
|
59
|
-
--dot feeds Graphviz (dot -Tpng), --text prints a terminal-friendly tree
|
|
60
|
-
--
|
|
62
|
+
--dot feeds Graphviz (dot -Tpng), --text prints a terminal-friendly tree,
|
|
63
|
+
--html emits an offline self-contained decision map; --tag <tag> filters to
|
|
64
|
+
one theme, --formal-only drops the mined edges.
|
|
61
65
|
|
|
62
66
|
Run from anywhere inside the project; commands discover the nearest adr/ directory.
|
|
63
67
|
`;
|
|
@@ -69,9 +73,11 @@ export function main(argv) {
|
|
|
69
73
|
all: { type: 'boolean', default: false },
|
|
70
74
|
by: { type: 'string' },
|
|
71
75
|
'decided-by': { type: 'string' },
|
|
76
|
+
'raised-by': { type: 'string' },
|
|
72
77
|
dot: { type: 'boolean', default: false },
|
|
73
78
|
'formal-only': { type: 'boolean', default: false },
|
|
74
79
|
mermaid: { type: 'boolean', default: false },
|
|
80
|
+
html: { type: 'boolean', default: false },
|
|
75
81
|
text: { type: 'boolean', default: false },
|
|
76
82
|
tag: { type: 'string' },
|
|
77
83
|
reason: { type: 'string' },
|
|
@@ -92,13 +98,13 @@ export function main(argv) {
|
|
|
92
98
|
const command = positionals[0] ?? '';
|
|
93
99
|
const rest = positionals.slice(1);
|
|
94
100
|
try {
|
|
95
|
-
// Only decide and accept record a decision. Anywhere else the
|
|
101
|
+
// Only decide and accept record a decision. Anywhere else the flags are a
|
|
96
102
|
// mistake, not something to ignore, and this has to run before the switch
|
|
97
103
|
// so a non-recording command never reaches the required-declaration check.
|
|
98
|
-
|
|
99
|
-
command !== 'decide' &&
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
for (const flag of ['decided-by', 'raised-by']) {
|
|
105
|
+
if (values[flag] !== undefined && command !== 'decide' && command !== 'accept') {
|
|
106
|
+
throw new Error(`adrkit ${command.length > 0 ? command : '(no command)'} does not take --${flag}`);
|
|
107
|
+
}
|
|
102
108
|
}
|
|
103
109
|
switch (command) {
|
|
104
110
|
case '': {
|
|
@@ -126,12 +132,12 @@ export function main(argv) {
|
|
|
126
132
|
}
|
|
127
133
|
case 'decide': {
|
|
128
134
|
requireTitle(rest, 'decide');
|
|
129
|
-
console.log(decideCommand(rest[0], process.cwd(), requireDecidedBy(values['decided-by'])));
|
|
135
|
+
console.log(decideCommand(rest[0], process.cwd(), requireDecidedBy(values['decided-by']), requireRaisedBy(values['raised-by'])));
|
|
130
136
|
return;
|
|
131
137
|
}
|
|
132
138
|
case 'accept': {
|
|
133
139
|
requireTitle(rest, 'accept');
|
|
134
|
-
console.log(acceptCommand(rest[0], process.cwd(), requireDecidedBy(values['decided-by'])));
|
|
140
|
+
console.log(acceptCommand(rest[0], process.cwd(), requireDecidedBy(values['decided-by']), requireRaisedBy(values['raised-by'])));
|
|
135
141
|
return;
|
|
136
142
|
}
|
|
137
143
|
case 'reject': {
|
|
@@ -181,11 +187,23 @@ export function main(argv) {
|
|
|
181
187
|
mermaid: values.mermaid,
|
|
182
188
|
dot: values.dot,
|
|
183
189
|
text: values.text,
|
|
190
|
+
html: values.html,
|
|
184
191
|
formalOnly: values['formal-only'],
|
|
185
192
|
tag: values.tag,
|
|
186
193
|
}));
|
|
187
194
|
return;
|
|
188
195
|
}
|
|
196
|
+
case 'tree': {
|
|
197
|
+
requireTitle(rest, 'tree');
|
|
198
|
+
// Mirror `graph`: a second format flag is a mistake, not a hint to
|
|
199
|
+
// pick one for the caller.
|
|
200
|
+
const formats = ['mermaid', 'text', 'html'].filter((format) => values[format]);
|
|
201
|
+
if (formats.length > 1) {
|
|
202
|
+
throw new Error(`--${formats.join(' and --')} are mutually exclusive; pick one output format`);
|
|
203
|
+
}
|
|
204
|
+
console.log(treeCommand(rest[0], process.cwd(), formats[0] ?? 'text'));
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
189
207
|
case 'completion': {
|
|
190
208
|
const shell = rest[0] ?? '';
|
|
191
209
|
console.log(completionCommand(shell));
|
|
@@ -229,6 +247,18 @@ function requireDecidedBy(value) {
|
|
|
229
247
|
' agent the choice came from the agent\'s own judgment, not a person\'s;\n' +
|
|
230
248
|
' a person merely letting it through does not make it human');
|
|
231
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* `raised-by` is the other provenance axis: who put the decision on the table,
|
|
252
|
+
* which is not the same as whose judgment settled it. Declared, never inferred.
|
|
253
|
+
*/
|
|
254
|
+
function requireRaisedBy(value) {
|
|
255
|
+
if (isRaisedBy(value))
|
|
256
|
+
return value;
|
|
257
|
+
const problem = value === undefined ? 'is required' : `must be "human" or "agent", got "${value}"`;
|
|
258
|
+
throw new Error(`--raised-by ${problem}:\n` +
|
|
259
|
+
' human a person put the decision on the table\n' +
|
|
260
|
+
' agent the agent raised it, even if a person later settled the direction');
|
|
261
|
+
}
|
|
232
262
|
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
233
263
|
main(process.argv.slice(2));
|
|
234
264
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAA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AC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { DecidedBy } from '../core/adr.js';
|
|
1
|
+
import type { DecidedBy, RaisedBy } from '../core/adr.js';
|
|
2
2
|
/**
|
|
3
3
|
* `decidedBy` is the declaration the caller made for the promoted decision:
|
|
4
4
|
* the CLI cannot observe who chose, so the value travels in rather than being
|
|
5
5
|
* inferred. Promotion is also where the value enters the durable record.
|
|
6
6
|
*/
|
|
7
|
-
export declare function acceptCommand(query: string, cwd: string, decidedBy: DecidedBy): string;
|
|
7
|
+
export declare function acceptCommand(query: string, cwd: string, decidedBy: DecidedBy, raisedBy: RaisedBy): string;
|
|
8
8
|
//# sourceMappingURL=accept.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../../src/commands/accept.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../../src/commands/accept.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO1D;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,GACjB,MAAM,CA+BR"}
|
package/dist/commands/accept.js
CHANGED
|
@@ -10,7 +10,7 @@ import { formatIssues, validateDraft } from '../core/validate.js';
|
|
|
10
10
|
* the CLI cannot observe who chose, so the value travels in rather than being
|
|
11
11
|
* inferred. Promotion is also where the value enters the durable record.
|
|
12
12
|
*/
|
|
13
|
-
export function acceptCommand(query, cwd, decidedBy) {
|
|
13
|
+
export function acceptCommand(query, cwd, decidedBy, raisedBy) {
|
|
14
14
|
const root = requireRoot(cwd);
|
|
15
15
|
const draft = resolveDraft(root, query);
|
|
16
16
|
if (/^\d+\s+/.test(draft.title)) {
|
|
@@ -27,7 +27,7 @@ export function acceptCommand(query, cwd, decidedBy) {
|
|
|
27
27
|
if (existsSync(path)) {
|
|
28
28
|
throw new Error(`decision already exists: adr/decisions/${fileName}`);
|
|
29
29
|
}
|
|
30
|
-
const content = proposalToDecision(draft, number, gitHead(root), decidedBy);
|
|
30
|
+
const content = proposalToDecision(draft, number, gitHead(root), decidedBy, raisedBy);
|
|
31
31
|
writeRecord(root, 'decisions', fileName, content);
|
|
32
32
|
removeRecord(draft);
|
|
33
33
|
let output = `accepted adr/.drafts/${draft.fileName} as adr/decisions/${fileName}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../../src/commands/accept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAChH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElE;;;;GAIG;AACH,MAAM,UAAU,aAAa,
|
|
1
|
+
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../../src/commands/accept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC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,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACtF,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClD,YAAY,CAAC,KAAK,CAAC,CAAC;IACpB,IAAI,MAAM,GAAG,wBAAwB,KAAK,CAAC,QAAQ,qBAAqB,QAAQ,EAAE,CAAC;IACnF,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,wEAAwE,OAAO;aACtF,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,OAAO,EAAE,CAAC;aACjC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAClB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAuFA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiGvD"}
|
|
@@ -14,6 +14,7 @@ const COMMANDS = [
|
|
|
14
14
|
'update',
|
|
15
15
|
'config',
|
|
16
16
|
'graph',
|
|
17
|
+
'tree',
|
|
17
18
|
'completion',
|
|
18
19
|
'version',
|
|
19
20
|
'help',
|
|
@@ -27,8 +28,8 @@ const COMMANDS = [
|
|
|
27
28
|
const COMMAND_OPTIONS = {
|
|
28
29
|
init: ['--tools', '--workflows', '--help'],
|
|
29
30
|
propose: ['--help'],
|
|
30
|
-
decide: ['--decided-by', '--help'],
|
|
31
|
-
accept: ['--decided-by', '--help'],
|
|
31
|
+
decide: ['--raised-by', '--decided-by', '--help'],
|
|
32
|
+
accept: ['--raised-by', '--decided-by', '--help'],
|
|
32
33
|
reject: ['--reason', '--help'],
|
|
33
34
|
supersede: ['--by', '--help'],
|
|
34
35
|
list: ['--help'],
|
|
@@ -38,7 +39,8 @@ const COMMAND_OPTIONS = {
|
|
|
38
39
|
validate: ['--all', '--help'],
|
|
39
40
|
update: ['--tools', '--workflows', '--help'],
|
|
40
41
|
config: ['--help'],
|
|
41
|
-
graph: ['--mermaid', '--dot', '--text', '--formal-only', '--tag', '--help'],
|
|
42
|
+
graph: ['--mermaid', '--dot', '--text', '--html', '--formal-only', '--tag', '--help'],
|
|
43
|
+
tree: ['--mermaid', '--text', '--html', '--help'],
|
|
42
44
|
completion: ['--help'],
|
|
43
45
|
version: ['--help'],
|
|
44
46
|
help: ['--help'],
|
|
@@ -52,7 +54,8 @@ const VALUE_OPTIONS = ['--by', '--reason', '--tag', '--tools', '--workflows'];
|
|
|
52
54
|
/** Short descriptions for the shells that show one next to an option. */
|
|
53
55
|
const OPTION_DESCRIPTIONS = {
|
|
54
56
|
'--by': 'the decision that replaces this one',
|
|
55
|
-
'--decided-by': '
|
|
57
|
+
'--decided-by': 'whose judgment settled the decision',
|
|
58
|
+
'--raised-by': 'who raised the decision',
|
|
56
59
|
'--reason': 'why the draft is discarded',
|
|
57
60
|
'--tag': 'filter to one theme',
|
|
58
61
|
'--tools': 'AI tools to install integrations for',
|
|
@@ -67,8 +70,8 @@ function takesValue(option) {
|
|
|
67
70
|
* caller is left typing a value with the option list still on screen.
|
|
68
71
|
*/
|
|
69
72
|
function zshSpec(option) {
|
|
70
|
-
if (option === '--decided-by') {
|
|
71
|
-
return `'
|
|
73
|
+
if (option === '--decided-by' || option === '--raised-by') {
|
|
74
|
+
return `'${option}=[${OPTION_DESCRIPTIONS[option]}]:declared by:(${DECIDED_BY_VALUES.join(' ')})'`;
|
|
72
75
|
}
|
|
73
76
|
if (takesValue(option)) {
|
|
74
77
|
return `'${option}=[${OPTION_DESCRIPTIONS[option]}]:${option.slice(2)}:'`;
|
|
@@ -86,7 +89,7 @@ export function completionCommand(shell) {
|
|
|
86
89
|
command="\${COMP_WORDS[1]}"
|
|
87
90
|
|
|
88
91
|
case "$prev" in
|
|
89
|
-
--decided-by)
|
|
92
|
+
--decided-by|--raised-by)
|
|
90
93
|
if [[ "$command" == "decide" || "$command" == "accept" ]]; then
|
|
91
94
|
COMPREPLY=( $(compgen -W "${DECIDED_BY_VALUES.join(' ')}" -- "$cur") )
|
|
92
95
|
else
|
|
@@ -149,12 +152,14 @@ _adrkit "$@"
|
|
|
149
152
|
'\n' +
|
|
150
153
|
Object.entries(COMMAND_OPTIONS)
|
|
151
154
|
.flatMap(([command, options]) => options
|
|
152
|
-
.filter((option) => option !== '--decided-by')
|
|
155
|
+
.filter((option) => option !== '--decided-by' && option !== '--raised-by')
|
|
153
156
|
.map((option) => `complete -c adrkit -n "__fish_seen_subcommand_from ${command}" -l ${option.slice(2)}${takesValue(option) ? ' -x' : ''}`))
|
|
154
157
|
.join('\n') +
|
|
155
158
|
'\n' +
|
|
156
159
|
// `-x` requires the value and suppresses file candidates; both
|
|
157
160
|
// declarations live on one line with the two values as `-a`.
|
|
161
|
+
`complete -c adrkit -n "__fish_seen_subcommand_from decide accept" -l raised-by -x -a "${DECIDED_BY_VALUES.join(' ')}"` +
|
|
162
|
+
'\n' +
|
|
158
163
|
`complete -c adrkit -n "__fish_seen_subcommand_from decide accept" -l decided-by -x -a "${DECIDED_BY_VALUES.join(' ')}"` +
|
|
159
164
|
'\n');
|
|
160
165
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,QAAQ,GAAG;IACf,MAAM;IACN,SAAS;IACT,QAAQ;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AAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,CAC9B,OAAO;qBACJ,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,cAAc,IAAI,MAAM,KAAK,aAAa,CAAC;qBACzE,GAAG,CACF,CAAC,MAAM,EAAE,EAAE,CACT,sDAAsD,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAC3H,CACJ;qBACA,IAAI,CAAC,IAAI,CAAC;gBACb,IAAI;gBACJ,+DAA+D;gBAC/D,6DAA6D;gBAC7D,yFAAyF,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;gBACvH,IAAI;gBACJ,0FAA0F,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;gBACxH,IAAI,CACL,CAAC;QACJ;YACE,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,+BAA+B,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { DecidedBy } from '../core/adr.js';
|
|
1
|
+
import type { DecidedBy, RaisedBy } from '../core/adr.js';
|
|
2
2
|
/**
|
|
3
3
|
* `decidedBy` is the declaration the caller made for this decision: the CLI
|
|
4
4
|
* cannot observe who chose, so the value travels in rather than being inferred.
|
|
5
5
|
*/
|
|
6
|
-
export declare function decideCommand(title: string, cwd: string, decidedBy: DecidedBy): string;
|
|
6
|
+
export declare function decideCommand(title: string, cwd: string, decidedBy: DecidedBy, raisedBy: RaisedBy): string;
|
|
7
7
|
//# sourceMappingURL=decide.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decide.d.ts","sourceRoot":"","sources":["../../src/commands/decide.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"decide.d.ts","sourceRoot":"","sources":["../../src/commands/decide.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO1D;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,GACjB,MAAM,CAyBR"}
|
package/dist/commands/decide.js
CHANGED
|
@@ -9,7 +9,7 @@ import { slugify } from '../core/slug.js';
|
|
|
9
9
|
* `decidedBy` is the declaration the caller made for this decision: the CLI
|
|
10
10
|
* cannot observe who chose, so the value travels in rather than being inferred.
|
|
11
11
|
*/
|
|
12
|
-
export function decideCommand(title, cwd, decidedBy) {
|
|
12
|
+
export function decideCommand(title, cwd, decidedBy, raisedBy) {
|
|
13
13
|
const trimmed = title.trim();
|
|
14
14
|
if (trimmed.length === 0) {
|
|
15
15
|
throw new Error('title must not be empty');
|
|
@@ -24,7 +24,7 @@ export function decideCommand(title, cwd, decidedBy) {
|
|
|
24
24
|
if (existsSync(path)) {
|
|
25
25
|
throw new Error(`decision already exists: adr/decisions/${fileName}`);
|
|
26
26
|
}
|
|
27
|
-
const content = decisionTemplate(number, trimmed, readConfig(root).context, gitHead(root), decidedBy);
|
|
27
|
+
const content = decisionTemplate(number, trimmed, readConfig(root).context, gitHead(root), decidedBy, raisedBy);
|
|
28
28
|
writeRecord(root, 'decisions', fileName, content);
|
|
29
29
|
return `created adr/decisions/${fileName}\n\nfill in the decision and validate it with:\n adrkit validate ${number}`;
|
|
30
30
|
}
|