@mmmnt/flmnt 1.8.0 → 1.9.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/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # @mmmnt/flmnt
2
+
3
+ The developer CLI for the [flmnt](https://flmnt.ai) event-stream memory platform — authentication, workspace management, and the MCP auth helper that wires clients like Claude Code to a live, authenticated flmnt MCP.
4
+
5
+ This package is a thin installer: on `postinstall` it downloads the platform-native `flmnt` binary for your OS/architecture from the matching [GitHub release](https://github.com/mmmnt/flmnt-cli/releases), verifies it against the release checksums, and exposes it as the `flmnt` command. No Go toolchain required.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install -g @mmmnt/flmnt
11
+ ```
12
+
13
+ Requires Node.js ≥ 18. Supported platforms: macOS, Linux, and Windows on x64 and arm64.
14
+
15
+ Prefer a native package manager? The same CLI ships through several channels:
16
+
17
+ ```sh
18
+ brew install mmmnt/tap/flmnt # Homebrew (macOS/Linux)
19
+ scoop install flmnt # Scoop (Windows)
20
+ go install github.com/mmmnt/flmnt-cli@latest # Go
21
+ ```
22
+
23
+ ## Quickstart
24
+
25
+ Authenticate, pick a workspace, and wire Claude Code to your flmnt MCP:
26
+
27
+ ```sh
28
+ flmnt login # OAuth2 — browser PKCE (or --device for headless)
29
+ flmnt workspace use <name|id> # set the active workspace
30
+ flmnt setup --server-url <flmnt-url> # write .mcp.json + the automation kit
31
+ ```
32
+
33
+ `flmnt setup` writes a project-local `.mcp.json` pointing at the local proxy plus a `.claude/` hook map and slash commands; `flmnt proxy` then injects your bearer token on outbound MCP requests — so Claude Code talks to a live, authenticated flmnt MCP without you handling tokens by hand. `setup` is idempotent.
34
+
35
+ ## Commands
36
+
37
+ ```sh
38
+ flmnt help # list all commands
39
+ flmnt <command> -h # detailed help for a command
40
+
41
+ # Authentication
42
+ flmnt login # authenticate via OAuth2 (browser PKCE, or --device for headless)
43
+ flmnt logout # sign out and revoke local credentials
44
+ flmnt whoami # show the active identity and workspace
45
+
46
+ # Workspaces
47
+ flmnt workspace list # list workspaces you own or are a member of
48
+ flmnt workspace create <name> # create a workspace and make it active
49
+ flmnt workspace use <name|id> # set the active workspace
50
+ flmnt workspace members # list members of a workspace
51
+ flmnt workspace add-member # add a member to a workspace you own
52
+ flmnt workspace remove-member # remove a member from a workspace you own
53
+
54
+ # MCP / Claude Code integration
55
+ flmnt setup --server-url <url> # install the automation kit: .mcp.json + lifecycle hooks
56
+ # + .claude/commands/flmnt-* slash commands (idempotent)
57
+ flmnt proxy # run the local MCP proxy (injects Authorization: Bearer)
58
+ flmnt mcp auth-header # print MCP auth headers as JSON for .mcp.json
59
+
60
+ # Data
61
+ flmnt sync push # sync local Quorum data up to the remote workspace
62
+ flmnt sync pull # sync remote workspace data down to local
63
+
64
+ # Memory (continuity loop + deterministic writes for hooks / CI)
65
+ flmnt brief # SessionStart: inject latest keyframe + recent decisions + mistakes
66
+ flmnt derive --hook # Stop: derive decisions/keyframes/mistakes from transcript + git
67
+ flmnt record-metric --name <n> --value <v> # write an operational metric
68
+ flmnt record-plan --content <p> # write a multi-step plan
69
+ flmnt record-supersession --content <c> --supersedes <id> # replace a decision
70
+
71
+ # Utilities
72
+ flmnt health # check health of Core, Engine, and proxy services
73
+ flmnt gate # keyframe-recency check for the UserPromptSubmit hook
74
+ flmnt dashboard # open the dashboard in a browser
75
+ flmnt version # print the version
76
+ ```
77
+
78
+ ## License
79
+
80
+ [Apache-2.0](./LICENSE). The flmnt CLI is open source; the flmnt platform is proprietary.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmmnt/flmnt",
3
- "version": "1.8.0",
3
+ "version": "1.9.2",
4
4
  "description": "flmnt CLI — installs the platform-native flmnt binary.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -1,4 +1,5 @@
1
1
  import { spawnSync } from 'node:child_process';
2
+ import { createHash } from 'node:crypto';
2
3
  import {
3
4
  chmodSync,
4
5
  mkdirSync,
@@ -11,7 +12,7 @@ import {
11
12
  import os from 'node:os';
12
13
  import path from 'node:path';
13
14
  import { fileURLToPath } from 'node:url';
14
- import { assetName, binaryName, downloadURL, shouldInstall, target } from '../src/platform.js';
15
+ import { assetName, binaryName, checksumsURL, downloadURL, expectedChecksum, shouldInstall, target } from '../src/platform.js';
15
16
 
16
17
  const REPO = 'mmmnt/flmnt-cli';
17
18
 
@@ -34,6 +35,20 @@ async function main() {
34
35
  }
35
36
  const buf = Buffer.from(await res.arrayBuffer());
36
37
 
38
+ // Verify the download against the published release checksums before trusting the binary.
39
+ const sumsRes = await fetch(checksumsURL(REPO, pkg.version), { redirect: 'follow' });
40
+ if (!sumsRes.ok) {
41
+ throw new Error(`checksum download failed: HTTP ${sumsRes.status}`);
42
+ }
43
+ const expected = expectedChecksum(await sumsRes.text(), asset);
44
+ if (!expected) {
45
+ throw new Error(`no published checksum for ${asset}`);
46
+ }
47
+ const actual = createHash('sha256').update(buf).digest('hex');
48
+ if (actual !== expected) {
49
+ throw new Error(`checksum mismatch for ${asset}: expected ${expected}, got ${actual}`);
50
+ }
51
+
37
52
  const tmp = mkdtempSync(path.join(os.tmpdir(), 'flmnt-'));
38
53
  try {
39
54
  const archivePath = path.join(tmp, asset);
package/src/platform.js CHANGED
@@ -33,6 +33,21 @@ export function downloadURL(repo, version, asset) {
33
33
  return `https://github.com/${repo}/releases/download/v${version}/${asset}`;
34
34
  }
35
35
 
36
+ export function checksumsURL(repo, version) {
37
+ return `https://github.com/${repo}/releases/download/v${version}/flmnt_${version}_checksums.txt`;
38
+ }
39
+
40
+ // Extract the expected sha256 for `asset` from a goreleaser checksums.txt (lines: "<hash> <asset>").
41
+ export function expectedChecksum(checksumsText, asset) {
42
+ for (const line of checksumsText.split('\n')) {
43
+ const [hash, name] = line.trim().split(/\s+/);
44
+ if (name === asset) {
45
+ return hash;
46
+ }
47
+ }
48
+ return null;
49
+ }
50
+
36
51
  export function shouldInstall(version, env) {
37
52
  if (env.FLMNT_SKIP_DOWNLOAD) {
38
53
  return false;