meetsoma 0.3.3 → 0.3.5

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
@@ -1,215 +1,47 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to Soma (`meetsoma` on npm).
3
+ Notable changes to [meetsoma](https://www.npmjs.com/package/meetsoma) the CLI for [Soma](https://soma.gravicity.ai).
4
4
 
5
- Format follows [Keep a Changelog](https://keepachangelog.com/). Versioning follows [Semantic Versioning](https://semver.org/).
5
+ ## [0.3.4] 2026-04-17
6
6
 
7
- ## [0.3.2] 2026-04-10
7
+ - **Fixed: fresh `npm install -g meetsoma` now actually works.** Previous 0.3.3 shipped a broken tarball (imports from `./lib/` and `./welcome/` that weren't included). Now bundled as a single self-contained file via esbuild.
8
+ - **Added: pre-publish smoke test.** Tarball is extracted and run before allowing publish. Broken tarballs cannot ship.
9
+ - **Changed: `soma init`** no longer updates the runtime — it's for project init only.
10
+ - **Changed: `soma update`** actually performs the runtime update now (was status-only).
11
+ - **Added: `soma check-updates`** preserves the old status-only behavior.
12
+ - **Added: Pi runtime drift check** in `soma status` / `soma doctor`.
13
+ - **Added: periodic update notice** — statusline checks for updates every 30min; next `soma` launch prints one-line notice.
8
14
 
9
- ### Fixed
10
- - **Health check warnings**: now shows "passed (N warnings)" instead of silent "All checks passed" when warnings exist
15
+ ## [0.3.3] — 2026-04-12
11
16
 
12
- ## [0.3.1] 2026-04-10
13
-
14
- Re-release of 0.3.0 (npm doesn't allow republish of unpublished versions).
17
+ - Script discovery: `soma <name>` finds and runs scripts from your project
18
+ - Improved health checks and doctor warnings
19
+ - Extracted modules for faster startup
15
20
 
16
21
  ## [0.3.0] — 2026-04-10
17
22
 
18
- Corresponds to Soma agent v0.9.0+.
19
-
20
- ### Added
21
- - **Script discovery**: `soma <name>` routes to `soma-<name>.sh` scripts via chain (bundled → project → global)
22
- - `soma code`, `soma verify`, `soma refactor` work from any project with scripts installed
23
- - `soma --help scripts` lists all discovered scripts with descriptions
24
-
25
- ### Changed
26
- - Extracted `lib/` and `welcome/` modules from thin-cli.js (1650→902 lines)
27
- - Removed stale agent copies — CLI is a pure thin wrapper now
28
-
29
- ### Fixed
30
- - **CORE_DIR respects `SOMA_CODING_AGENT_DIR`** — thin-cli.js and cli.js no longer hardcode `~/.soma/agent`. Sandbox testing and env overrides now work correctly.
23
+ - `soma code`, `soma verify`, `soma refactor` work from any terminal
24
+ - `soma --help scripts` lists all discovered scripts
25
+ - Cleaner thin-cli architecture
31
26
 
32
27
  ## [0.2.0] — 2026-04-02
33
28
 
34
- Corresponds to Soma agent v0.8.0.
35
-
36
- ### New
37
-
38
- - **`soma doctor`** — check project health, auto-fix stale settings/body/protocols, run migrations.
39
- - **`soma status` / `soma health`** — quick project health check (renamed from old `soma doctor`).
40
- - **`soma --version`** — shows both agent and CLI versions.
41
- - **`soma --help`** — delegates to core agent for full help output.
42
- - **`--scan` / `--all` flags** — doctor multi-project support (delegates to core).
43
-
44
- ### Changed
45
-
46
- - **CLI routing overhaul** — doctor/status/health/update/version all route through thin-cli properly.
47
- - **Stale protocol detection** — doctor identifies outdated bundled protocols and offers to update them.
48
- - **Version-aware pending file** — `_doctor-pending.md` injected on boot when migration is available.
49
-
50
- ### Fixed
51
-
52
- - **Help header** — shows "CLI v0.2.0" instead of bare version number.
53
- - **Orphaned `showStatus()`** — removed dead code from thin-cli.
54
- - **Placeholder text** — replaced thin-cli stubs with real output.
55
-
56
- ---
29
+ - `soma doctor` check project health, auto-fix settings and templates
30
+ - `soma status` — quick health overview
31
+ - `soma --version` — shows agent + CLI versions
57
32
 
58
33
  ## [0.1.4] — 2026-03-28
59
34
 
60
- Corresponds to Soma agent v0.6.5.
61
-
62
- ### New
63
-
64
- - **`soma inhale --list`** — see available preloads with age and staleness markers.
65
- - **`soma inhale <name>`** — load a specific preload by date, session ID, or substring.
66
- - **`soma inhale --load <path>`** — load any file as a preload.
67
- - **`soma map <name>`** — run a MAP with prompt-config and targeted preload.
68
- - **`soma map --list`** — see available MAPs with status and description.
69
- - **`--preload` flag deprecated** — use `soma inhale` or `soma map` instead (still works).
70
-
71
- ### Changed
72
-
73
- - **Settings-driven heat overrides** — per-project AMPS heat control via `settings.heat.overrides`.
74
- - **Statusline** shows preload status. Smart `/exhale` detects edit vs write mode.
75
- - **Restart signal** — auto-detects when extensions change, prompts for restart.
76
-
77
- ### Fixed
78
-
79
- - **Crash on partial settings** — `settings.heat` access now defensive (won't crash with old config files).
80
- - **Breathe grace period** — was 60s, now correctly 30s matching settings default.
81
- - **5 auto-breathe UX gaps** — smarter context warnings, resume awareness.
82
-
83
- ---
84
-
85
- ## [0.1.3] — 2026-03-23
86
-
87
- ### New
88
-
89
- - **Body architecture** — structured identity in `.soma/body/`. Create `soul.md` (who the agent is), `voice.md` (how it communicates), `body.md` (project context). Each file becomes a `{{variable}}` usable in templates.
90
- - **Template engine** — `_mind.md` controls your system prompt structure. Add `{{soul}}`, `{{voice}}`, custom text. 5 modifiers: `|tldr`, `|section:Name`, `|lines:N`, `|last:N`, `|ref`.
91
- - **Smart AMPS loading** — warm protocols and muscles now appear as `<available_skills>` entries (Claude's native format). Agent reads them on demand instead of loading everything into the prompt.
92
- - **`/body` command** — inspect your template system. `check` (health report), `vars` (all variables), `map` (structure), `render` (full compiled prompt).
93
- - **`/exit`** command — save state and quit cleanly.
94
- - **`SOMA.md`** — new canonical identity file name. Replaces `identity.md` (still works as fallback).
95
-
96
- ### Changed
97
-
98
- - **Boot messages** rewritten — "You woke up" instead of "You've booted into a session."
99
- - **Auto-breathe** — agent no longer guesses context percentages. Trusts the system to prompt when it's time.
100
- - **Muscle heat** — muscles gain heat when loaded at boot, not just when explicitly read.
101
-
102
- ### Fixed
103
-
104
- - **Stale conversation injection** — removed scanner that picked up old sessions from wrong runtime.
105
- - **Identity frontmatter** — no longer leaks YAML into the system prompt.
106
-
107
- ---
35
+ - `soma inhale` load session preloads by name, date, or path
36
+ - `soma map` — run workflow templates
37
+ - Per-project settings for AMPS heat
108
38
 
109
39
  ## [0.1.2] — 2026-03-22
110
40
 
111
- ### New
112
-
113
- - **`/hub` command** install, fork, share, find, and browse community content from one command. Replaces `/install` and `/list`.
114
- - **Drop-in commands** — add scripts to `.soma/amps/scripts/commands/` and they become `/soma <name>` commands instantly.
115
- - **Community hub: 40 items** — protocols, muscles, scripts, automations, and templates. Browse at soma.gravicity.ai/hub.
116
- - **Smart sharing** — `/hub share` runs quality checks, auto-fixes private paths, opens a PR to the community.
117
- - **Multiple git emails** — `guard.gitIdentity.email` now accepts an array for multi-account users.
118
- - **Preload improvements** — Weather (session tone) and Warnings (traps for next session) in default template.
119
-
120
- ### Changed
121
-
122
- - `/install` and `/list` now redirect to `/hub install` and `/hub list`.
123
- - Protocols that document built-in behavior no longer load into the prompt (saves ~2000 tokens).
124
-
125
- ### Fixed
126
-
127
- - `/hub list --remote` now works (flag was parsed as type filter).
128
-
129
- ## [0.6.2] — 2026-03-21
130
-
131
- ### New
132
-
133
- - **Muscle heat from natural use.** Running scripts or editing files now bumps related muscles automatically — no `/pin` needed.
134
- - **`soma doctor`** — checks workspace health, auto-fixes stale frontmatter, detects version drift.
135
- - **Community sync on boot.** Missing protocols fetched from community repo automatically. Always current, works offline.
136
-
137
- ### Fixed
138
-
139
- - **No more "Update Available" banner.** Runtime delegation fixed.
140
- - **Fresh installs** now include version tracking in settings.json.
141
- - Welcome flow is honest about being a personality engine, not the agent.
142
-
143
- ### Changed
144
-
145
- - Muscle activation fields simplified — triggers, keywords, topic merged into single list. Old format still works.
146
-
147
- ---
148
-
149
- ## [0.6.1] — 2026-03-20
150
-
151
- ### New
152
-
153
- - **Published to npm.** `npm install -g meetsoma` — lightweight launcher, runtime downloads on first run.
154
- - **Engine updated to Pi 0.61.1** — keybinding stability, session path fixes, suspend/resume.
155
- - AMPS overview doc, migration guide (from CLAUDE.md/.cursorrules), troubleshooting page.
156
- - Docs reorganised into 5 sections. Collapsible sidebar with section icons.
157
- - Known Gaps sections — honest about heat system limitations and planned fixes.
158
-
159
- ### Fixed
160
-
161
- - CLI crash on Pi 0.61.0 (`getEditorKeybindings` renamed upstream).
162
- - `content-cli.js` import removed (moved to main.js in 0.61.0).
163
- - `--help` fixed (`printGumHelp` removed upstream).
164
- - Heat system docs corrected — `.protocol-state.json` → `state.json`.
165
-
166
- ## [0.6.0] — 2026-03-20
167
-
168
- ### New
169
-
170
- - **Soma has a voice.** Run `soma` and it talks to you. Every message is different — same meaning, different words each time. No AI involved. Just clever writing.
171
- - **Ask questions from the CLI.** Press `?` when you run `soma` and ask about memory, heat, protocols, muscles, or anything else. Soma answers — differently every time.
172
- - **No compaction. Ever.** Other agents compress your conversation when context fills up. You wait. Quality degrades. Soma doesn't compact — it breathes. Full context, every session.
173
- - **`soma init`** — Install the Soma runtime. Downloads automatically, no auth needed.
174
- - **`soma doctor`** — Health check. Tells you what's working and what needs attention.
175
- - **`soma update`** — Check for new versions.
176
- - **`soma status`** — See your installation state at a glance.
177
- - **`soma about`** — Learn how Soma works. Identity, protocols, muscles, breath cycle, scripts.
178
- - **`soma focus <keyword>`** — Start a focused session primed for a specific topic.
179
- - **`soma --map <name>`** — Load a workflow template.
180
- - **Typing animation** — Responses type out character by character. Soma feels present.
181
- - **Daily concepts** — The welcome screen shows a different idea each day.
182
- - **23 documentation pages** — Models & providers, keybindings, themes, settings, sessions, prompts, skills, terminal setup, and more.
183
- - **30 automated E2E tests** — Branding, paths, infrastructure, models, identity all verified in sandbox.
184
-
185
- ### Changed
186
-
187
- - Engine updated to Pi 0.61.0.
188
- - License changed to BSL 1.1 (converts to MIT on 2027-09-18).
189
- - The npm package is a lightweight launcher. The runtime installs separately via `soma init`.
190
- - Project paths resolve to `.soma/` (not `.pi/`) — correct config dir delegation.
191
-
192
- ### Fixed
193
-
194
- - Auto-breathe timeout and session log naming bugs resolved.
195
- - Session ID stability on resume — no more orphan logs.
196
- - Edit tool detection in preload generation.
197
-
198
- ## [0.5.1] — 2026-03-12
199
-
200
- - Content management commands.
201
- - 15 in-session slash commands.
202
-
203
- ## [0.3.0] — 2026-03-10
204
-
205
- - Auto-init on first run.
206
- - Session continuation with `/inhale` and `/breathe`.
207
-
208
- ## [0.2.1] — 2026-03-09
209
-
210
- - Core agent modules and built-in protocols.
211
- - Context warnings and auto-exhale at 85%.
41
+ - `/hub` command — install, share, and browse community content
42
+ - Drop-in commands via `.soma/amps/scripts/commands/`
43
+ - Community hub with 40+ items
212
44
 
213
45
  ## [0.1.0] — 2026-03-08
214
46
 
215
- - Initial release on npm.
47
+ - Initial release. `npm install -g meetsoma` — thin launcher that bootstraps the Soma runtime.
@@ -15,11 +15,20 @@
15
15
  * soma.react("success", { action: "installed core" })
16
16
  */
17
17
 
18
+ // ── State (session-scoped, no persistence) ───────────────────────────
19
+ // Keeps the picker from repeating itself within a flow.
20
+ // Reset via soma.reset() for tests.
21
+
22
+ const _state = {
23
+ lru: {}, // { key: [lastN picks] } — recency tracking per slot/intent
24
+ register: null, // 'formal' | 'casual' | null (sticky once a flow starts)
25
+ lastGreetAt: 0, // timestamp — avoid double-greeting in short windows
26
+ };
27
+
18
28
  // ── Deterministic-ish randomness ─────────────────────────────────────
19
- // Seeded by time-of-day so the same minute gives consistent output
20
- // but different minutes feel different.
21
29
 
22
30
  function pick(arr) {
31
+ if (!arr || arr.length === 0) return "";
23
32
  const i = Math.floor(Math.random() * arr.length);
24
33
  return arr[i];
25
34
  }
@@ -34,13 +43,53 @@ function pickWeighted(arr, weights) {
34
43
  return arr[arr.length - 1];
35
44
  }
36
45
 
46
+ /**
47
+ * LRU-aware picker. Biases away from recently-picked options for the same
48
+ * key, so "Got it. Got it. Got it." doesn't happen within a session.
49
+ * When all options are recent, falls back to uniform pick.
50
+ *
51
+ * @param {array} arr — choices
52
+ * @param {string} lruKey — scope for recency tracking (e.g. "ack", "greet")
53
+ * @param {number} depth — how many recent picks to avoid (default 3)
54
+ */
55
+ function pickSmart(arr, lruKey, depth = 3) {
56
+ if (!arr || arr.length === 0) return "";
57
+ if (!lruKey || arr.length <= 1) return pick(arr);
58
+ const recent = _state.lru[lruKey] || [];
59
+ const fresh = arr.filter(x => !recent.includes(x));
60
+ const pool = fresh.length > 0 ? fresh : arr;
61
+ const choice = pick(pool);
62
+ _state.lru[lruKey] = [...recent, choice].slice(-depth);
63
+ return choice;
64
+ }
65
+
66
+ /**
67
+ * Time-of-day bucket. Drives greeting palette.
68
+ * @returns {'late' | 'morning' | 'afternoon' | 'evening'}
69
+ */
70
+ function timeOfDay() {
71
+ const h = new Date().getHours();
72
+ if (h < 6) return "late";
73
+ if (h < 12) return "morning";
74
+ if (h < 18) return "afternoon";
75
+ return "evening";
76
+ }
77
+
37
78
  // ── Slot expansion ───────────────────────────────────────────────────
38
79
 
39
80
  function expand(template, slots = {}) {
40
81
  return template.replace(/\{(\w+)\}/g, (_, key) => {
41
82
  if (slots[key] !== undefined) return slots[key];
42
83
  // Check if there's a vocabulary for this slot
43
- if (VOCAB[key]) return pick(VOCAB[key]);
84
+ if (VOCAB[key]) {
85
+ const v = VOCAB[key];
86
+ // Nested structures (e.g. time_greeting) — resolve by time-of-day
87
+ if (!Array.isArray(v) && typeof v === "object") {
88
+ const bucket = v[timeOfDay()] || v.default || Object.values(v)[0];
89
+ return pickSmart(bucket, key);
90
+ }
91
+ return pickSmart(v, key);
92
+ }
44
93
  return `{${key}}`;
45
94
  });
46
95
  }
@@ -52,6 +101,13 @@ const VOCAB = {
52
101
  greeting: [
53
102
  "Hey", "Hi", "Hello", "Hey there",
54
103
  ],
104
+ // Time-specific greetings
105
+ time_greeting: {
106
+ late: ["Still up?", "Late session", "Hey — still here?"],
107
+ morning: ["Morning", "Good morning", "Hey — morning"],
108
+ afternoon: ["Hey", "Afternoon", "Hi"],
109
+ evening: ["Evening", "Good evening", "Hey"],
110
+ },
55
111
  // Acknowledgements
56
112
  ack: [
57
113
  "Got it", "Understood", "Right", "Noted", "Copy that", "On it",
@@ -76,6 +132,14 @@ const VOCAB = {
76
132
  consider: [
77
133
  "Looks like", "Seems like", "Appears to be", "That's",
78
134
  ],
135
+ // Reassurance (when surfacing drift / problems)
136
+ reassure: [
137
+ "Nothing scary", "Small fix", "Quick one", "Easy one",
138
+ ],
139
+ // Attention (when announcing results)
140
+ attention: [
141
+ "Here's the map", "Here's what I see", "Snapshot", "Current state",
142
+ ],
79
143
  };
80
144
 
81
145
  // ── Skeletons ────────────────────────────────────────────────────────
@@ -176,6 +240,39 @@ const SKELETONS = {
176
240
  "Until next time.",
177
241
  "Exhale complete.",
178
242
  ],
243
+ // Version / update UX
244
+ version_check: [
245
+ "{attention} — three layers:",
246
+ "Checking in on your setup.",
247
+ "{transition} look at the version state.",
248
+ "Version snapshot:",
249
+ ],
250
+ version_aligned: [
251
+ "All three layers are aligned. You're good.",
252
+ "Everything's in sync — CLI, agent, workspace.",
253
+ "{done_word}. All layers on the same page.",
254
+ "Aligned end-to-end.",
255
+ ],
256
+ version_drift: [
257
+ "Found some drift. {reassure}.",
258
+ "A few things out of sync. {reassure}.",
259
+ "Layers don't match. {reassure} — here's the fix.",
260
+ "Drift detected. Walk through below.",
261
+ ],
262
+
263
+ // Doctor UX
264
+ doctor_clean: [
265
+ "Workspace is {quality}. Nothing to fix.",
266
+ "Your .soma checks out.",
267
+ "{done_word}. All checks pass.",
268
+ "Healthy. Moving on.",
269
+ ],
270
+ doctor_found_items: [
271
+ "Found {n} item{plural}. {reassure}.",
272
+ "{n} thing{plural} to tidy. {reassure}.",
273
+ "Spotted {n} item{plural} worth attention.",
274
+ ],
275
+
179
276
  };
180
277
 
181
278
  // ── Topics ───────────────────────────────────────────────────────────
@@ -413,6 +510,31 @@ const soma = {
413
510
  expand(template, slots) {
414
511
  return expand(template, slots);
415
512
  },
513
+
514
+ /**
515
+ * Time-aware intro. Greeting shaded by time of day.
516
+ */
517
+ intro(user) {
518
+ const bucket = VOCAB.time_greeting[timeOfDay()] || VOCAB.greeting;
519
+ const tg = pickSmart(bucket, "time_greeting");
520
+ return user ? `${tg}, ${user}.` : `${tg}.`;
521
+ },
522
+
523
+ /**
524
+ * Reset session state (tests / sandbox isolation).
525
+ */
526
+ reset() {
527
+ _state.lru = {};
528
+ _state.register = null;
529
+ _state.lastGreetAt = 0;
530
+ },
531
+
532
+ /**
533
+ * Current session state (debug / telemetry).
534
+ */
535
+ _debug() {
536
+ return JSON.parse(JSON.stringify(_state));
537
+ },
416
538
  };
417
539
 
418
540
  export { soma, SKELETONS, TOPICS, VOCAB, spin, expand, pick };