@llamaventures/cli 2.1.0 → 2.1.2

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/CHANGELOG.md CHANGED
@@ -6,6 +6,23 @@ this project adheres to [Semantic Versioning](https://semver.org).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.1.2] - 2026-09-03
10
+
11
+ ### Fixed
12
+ - Publish the minimal Deal Memory writing contract through CLI and MCP help:
13
+ coherent whole-file rewrites, required frontmatter, read-before-write
14
+ versioning (including placeholders), the no-material-improvement rule, and
15
+ the distinction from structured Deal Information.
16
+
17
+ ## [2.1.1] - 2026-09-03
18
+
19
+ ### Changed
20
+ - `llama help deal` no longer hardcodes the Page field count; the count is
21
+ live in `llama agent bootstrap`.
22
+ - Show `contentBase64` as the primary `artifact.put` example. Core stores the
23
+ bytes in the Deal's Drive folder and derives `byteSize` / `sha256` itself;
24
+ `storageKey` remains only for artifacts that already live elsewhere.
25
+
9
26
  ## [2.1.0] - 2026-09-03
10
27
 
11
28
  ### Added
package/README.md CHANGED
@@ -134,11 +134,19 @@ llama memory write <dealId> --markdown deal-story.md
134
134
  llama memory write <dealId> --markdown deal-story.md --expected-version '"etag-from-read"'
135
135
  ```
136
136
 
137
- The first write omits `--expected-version`. Updating an existing story requires
138
- the opaque `version` returned by `read`; a stale value fails instead of losing a
139
- concurrent edit. This uses the same `llama auth login` identity. CLI calls the
140
- authenticated Command Core adapter only—it has no sidecar URL, service token,
141
- S3 credentials, or direct database access.
137
+ Always read before writing. If `read` returns any Story, including an empty
138
+ placeholder, pass its opaque `version`; only a `404` means creation may omit
139
+ `--expected-version`. A stale value fails instead of losing a concurrent edit.
140
+ Rewrite the complete document as one coherent current understanding rather than
141
+ appending an update log. Do not restate Live Deal Page or Deal Information
142
+ fields, and do not write when the understanding would not materially improve.
143
+
144
+ The Markdown needs a non-empty body and YAML frontmatter with `deal_id`, `uuid`,
145
+ `created`, and `updated`. The first three values never change; `updated` must be
146
+ an ISO 8601 timestamp with an offset and strictly advance on every write. This
147
+ uses the same `llama auth login` identity. CLI calls the authenticated Command
148
+ Core adapter only—it has no sidecar URL, service token, S3 credentials, or
149
+ direct database access.
142
150
 
143
151
  `llama deal read --detail memory` still means structured Deal Information.
144
152
  `llama memory read` means the separate accumulated Markdown Deal Story.
package/README.zh-CN.md CHANGED
@@ -128,10 +128,17 @@ llama memory write <dealId> --markdown deal-story.md
128
128
  llama memory write <dealId> --markdown deal-story.md --expected-version '"read 返回的 etag"'
129
129
  ```
130
130
 
131
- 第一次创建时不传 `--expected-version`;以后更新必须使用前一次 `read` 返回的
132
- 不透明 `version`,旧版本会安全失败,不会覆盖他人的新内容。它复用同一个
133
- `llama auth login` 身份。CLI 只调用经过认证的 Command Core adapter,不持有
134
- sidecar URL、service token、S3 凭证,也不直接访问数据库。
131
+ 每次写入前都先读取。如果 `read` 返回任何 Story(包括空 placeholder),写入时
132
+ 必须传回其不透明 `version`;只有 `404` 才表示创建时可以省略
133
+ `--expected-version`。旧版本会安全失败,不会覆盖他人的新内容。每次写入都要
134
+ 重写一份连贯的当前理解,不要追加更新日志,不要重复 Live Deal Page 或 Deal
135
+ Information 字段;如果理解没有实质改善,就不要写。
136
+
137
+ Markdown 必须有非空正文和 YAML frontmatter,其中包含 `deal_id`、`uuid`、
138
+ `created`、`updated`。前三项不可更改;`updated` 必须是带时区偏移的 ISO 8601
139
+ 时间,并在每次写入时严格递增。它复用同一个 `llama auth login` 身份。CLI
140
+ 只调用经过认证的 Command Core adapter,不持有 sidecar URL、service token、
141
+ S3 凭证,也不直接访问数据库。
135
142
 
136
143
  `llama deal read --detail memory` 仍表示结构化 Deal Information;
137
144
  `llama memory read` 表示独立的 Markdown Deal Story。
package/bin/llama-mcp.mjs CHANGED
@@ -170,7 +170,7 @@ server.registerTool(
170
170
  server.registerTool(
171
171
  "get_deal_memory",
172
172
  {
173
- description: "Read the complete canonical Markdown Deal Story and its opaque concurrency version.",
173
+ description: "Read the complete canonical Markdown Deal Story and its opaque concurrency version. A returned placeholder is an existing Story whose version is required for a write; only 404 means no Story exists.",
174
174
  inputSchema: { dealId: z.string().uuid() },
175
175
  },
176
176
  // @core-api-operation GET /api/deal-memory/{dealId}/story
@@ -180,7 +180,7 @@ server.registerTool(
180
180
  server.registerTool(
181
181
  "update_deal_memory",
182
182
  {
183
- description: "Create or replace the complete Markdown Deal Story. Existing stories require the version returned by get_deal_memory; stale writes fail safely.",
183
+ description: "Replace the complete Markdown Deal Story with one coherent current understanding; never append an update log, restate Live Deal Page/Deal Information fields, or write when understanding would not materially improve. Frontmatter must contain matching deal_id plus stable uuid and created timestamps; updated must strictly advance. Pass the version from get_deal_memory for every returned Story, including a placeholder; only 404 permits creation without expected_version.",
184
184
  inputSchema: {
185
185
  dealId: z.string().uuid(),
186
186
  markdown: z.string().min(1).max(1_048_576),
package/bin/llama.mjs CHANGED
@@ -55,6 +55,8 @@ Deal has exactly four actions:
55
55
  llama deal create --json <file|->
56
56
  llama deal write --json <file|->
57
57
 
58
+ Here --detail memory means structured Deal Information, not Deal Memory.
59
+
58
60
  Deal Memory is a separate sidecar domain through the same login:
59
61
  llama memory read <dealId> [--raw]
60
62
  llama memory write <dealId> --markdown <file|-> [--expected-version <version>]
@@ -85,8 +87,9 @@ Before any Page write:
85
87
 
86
88
  The authenticated bootstrap contains the two-part private Llama Brain:
87
89
  Investment Framework V3 plus the Llama Command operating skill. It also
88
- contains the separate current 61-field Page contract. CLI is the tool, not
89
- Brain. Information never updates Page automatically. page.patch is JSON
90
+ contains the separate current Page field contract; its field count is live,
91
+ so read it there. CLI is the tool, not Brain. Information never updates
92
+ Page automatically. page.patch is JSON
90
93
  Merge Patch: objects merge, null deletes, and arrays replace whole arrays, so
91
94
  read-modify-write complete Page arrays and preserve sibling slots.
92
95
 
@@ -97,7 +100,13 @@ write JSON (CLI derives idempotencyKey when omitted):
97
100
  input.submit: {"operation":"input.submit","dealId":"<uuid>","content":"<original input>","format":"text","source":{},"origin":{"kind":"user","originalUserUtterance":"..."}}
98
101
  information.put:{"operation":"information.put","dealId":"<uuid>","type":"founder_claim","labels":["founder-stated"],"subject":{"topic":"traction"},"value":{"content":"...","source":{"kind":"first_meeting_transcript"}},"origin":{"kind":"user","originalUserUtterance":"..."}}
99
102
  page.patch: {"operation":"page.patch","dealId":"<uuid>","patch":{"description":{"en":"...","zh":"..."}},"origin":{"kind":"agent"}}
100
- artifact.put: {"operation":"artifact.put","dealId":"<uuid>","kind":"deck","title":"deck.pdf","mimeType":"application/pdf","storageKey":"<drive-file-id>","storageUrl":"https://drive.google.com/...","byteSize":123,"sha256":"<64 hex>","origin":{"kind":"user","originalUserUtterance":"..."}}
103
+ artifact.put: {"operation":"artifact.put","dealId":"<uuid>","kind":"deck","title":"deck.pdf","mimeType":"application/pdf","contentBase64":"<file bytes, base64>","origin":{"kind":"user","originalUserUtterance":"..."}}
104
+
105
+ artifact.put sends the bytes as contentBase64; Core stores them in the Deal's
106
+ own Drive folder and derives byteSize and sha256 itself. Do not supply a
107
+ folder, storage key or URL for a file you hold. Write the JSON to a file and
108
+ pass its path. Only an artifact that already lives elsewhere is referenced
109
+ with storageKey (+ optional storageUrl) plus byteSize and sha256 instead.
101
110
 
102
111
  For Information, origin records who caused the write and preserves user words;
103
112
  value.source records where the evidence came from.
@@ -112,9 +121,23 @@ const HELP_MEMORY = `Llama Deal Memory — one canonical Markdown Deal Story
112
121
  llama memory write <dealId> --markdown <file|-> [--expected-version <version>]
113
122
 
114
123
  Read returns the full JSON record, including its opaque version. --raw prints
115
- only the exact Markdown. A first write creates the story without a version.
116
- Every later write must pass the version from the preceding read; stale writes
117
- fail instead of overwriting newer understanding.
124
+ only the exact Markdown. Always read before writing. If read returns a Story,
125
+ including an empty placeholder, pass its version with --expected-version. Only
126
+ a 404 means creation may omit the version; stale writes fail safely.
127
+
128
+ Write one coherent current Story: replace the complete document instead of
129
+ appending an update log. Do not restate Live Deal Page or Deal Information
130
+ fields. If the understanding would not materially improve, do not write.
131
+
132
+ The Markdown must have a non-empty body and YAML frontmatter containing:
133
+ deal_id: the route Deal UUID; never changes
134
+ uuid: the Story UUID; never changes
135
+ created: ISO 8601 with offset; never changes
136
+ updated: ISO 8601 with offset; must strictly advance on every write
137
+
138
+ Use authorized evidence, preserve uncertainty, and never invent information.
139
+ llama deal read --detail memory reads structured Deal Information; it does not
140
+ read this Story.
118
141
 
119
142
  This uses your existing Llama authentication. The CLI talks only to Command
120
143
  Core and never receives Deal Memory service credentials or AWS access.`;
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "format": "llama.cli-build.v1",
3
3
  "packageName": "@llamaventures/cli",
4
- "packageVersion": "2.1.0",
5
- "sourceSha": "0a29fd1ecdfb2064a90d36e323549a0445b3a21e",
4
+ "packageVersion": "2.1.2",
5
+ "sourceSha": "bc642686f5c52df26bd927f7829303e5b10d3ce7",
6
6
  "sourceKind": "github",
7
7
  "sourceDirty": false,
8
8
  "coreApiContract": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llamaventures/cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "CLI + MCP server for the Llama Ventures investment workbench (command.llamaventures.vc).",
5
5
  "type": "module",
6
6
  "scripts": {