@commonlyai/cli 0.1.147 → 0.1.152

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/cli",
3
- "version": "0.1.147",
3
+ "version": "0.1.152",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -4,7 +4,8 @@
4
4
  * Two thin CAP shims the run loop calls around every spawn cycle:
5
5
  *
6
6
  * readLongTerm(client) — GET /api/agents/runtime/memory,
7
- * returns sections.long_term.content or ''
7
+ * returns sections.long_term.content,
8
+ * falling back to legacy content
8
9
  * syncBack(client, { summary }) — POST /api/agents/runtime/memory/sync
9
10
  * with mode:'patch', sourceRuntime:'local-cli'.
10
11
  * No-op when summary is falsy.
@@ -33,8 +34,8 @@ export const SOURCE_RUNTIME = 'local-cli';
33
34
  * cannot adopt a habit whose surface it has no evidence exists, so the empty
34
35
  * case now says so.
35
36
  *
36
- * It names `long_term` specifically because that is the ONLY section read back
37
- * (`readLongTerm` returns `sections.long_term.content`). A write to `daily` —
37
+ * It names `long_term` specifically because that is the only v2 section read
38
+ * back. Legacy `content` is a fallback for records without that section. A write to `daily` —
38
39
  * the section whose name most invites exactly this use — succeeds, returns 200,
39
40
  * and is never seen again; the write and the silence are indistinguishable from
40
41
  * a correct round trip. Naming the section is the whole point of the cue.
@@ -92,7 +93,7 @@ export const buildMemoryPreamble = (prompt, memoryLongTerm, { freshSession = fal
92
93
  export const readLongTerm = async (client, { onError } = {}) => {
93
94
  try {
94
95
  const body = await client.get('/api/agents/runtime/memory');
95
- return body?.sections?.long_term?.content || '';
96
+ return body?.sections?.long_term?.content ?? body?.content ?? '';
96
97
  } catch (err) {
97
98
  // A 404 is the ONLY error that means what '' means: a fresh agent with no
98
99
  // memory row yet. The kernel upserts on first write, so this is genuine