@intelli-1113/stratos-sdk 1.3.5 → 1.3.6

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": "@intelli-1113/stratos-sdk",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Stratos AI agent telemetry (OpenLLMetry), Vercel AI auto-spans, LangChain inspect/fix, MCP proxy.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -14,12 +14,12 @@
14
14
  "./config-templates": "./src/config-templates.js"
15
15
  },
16
16
  "bin": {
17
- "stratos": "./src/cli.js",
18
- "stratos-setup": "./src/cli-setup.js",
19
- "stratos-doctor": "./src/cli-doctor.js",
20
- "stratos-otel-bridge": "./src/otel-bridge.js",
21
- "stratos-mcp-proxy": "./src/mcp-proxy.js",
22
- "stratos-inspect": "./src/cli-inspect.js"
17
+ "stratos": "src/cli.js",
18
+ "stratos-setup": "src/cli-setup.js",
19
+ "stratos-doctor": "src/cli-doctor.js",
20
+ "stratos-otel-bridge": "src/otel-bridge.js",
21
+ "stratos-mcp-proxy": "src/mcp-proxy.js",
22
+ "stratos-inspect": "src/cli-inspect.js"
23
23
  },
24
24
  "files": [
25
25
  "src"
@@ -56,5 +56,6 @@
56
56
  "@langchain/core": {
57
57
  "optional": true
58
58
  }
59
- }
59
+ },
60
+ "author": ""
60
61
  }
package/src/README.md ADDED
@@ -0,0 +1,583 @@
1
+ ## Change version in package.json
2
+ ## npm login
3
+ ## npm publish --access public
4
+
5
+ # @intelli-1113/stratos-sdk
6
+
7
+ > **New here?** [USAGE.md](USAGE.md) is a step-by-step guide for agent teams, developers using Claude Code or MCP tools, and people working on this SDK. This README is the full reference.
8
+
9
+ **One install** for [Stratos AI](https://github.com) agent observability:
10
+
11
+ 1. **OpenLLMetry / Traceloop** — LLM traces (model, tokens, prompts, tools, latency)
12
+ 2. **OTLP JSON → Stratos** — export to your dashboard (`/api/ingest`)
13
+ 3. **Heartbeat** — agent stays “online” between calls (`/api/heartbeat`)
14
+ 4. **Vercel AI auto-telemetry** — no `experimental_telemetry` in client code
15
+ 5. **`stratos-mcp-proxy`** — tool-call metering for host MCP servers
16
+
17
+ | | |
18
+ |---|---|
19
+ | **Package** | `@intelli-1113/stratos-sdk` |
20
+ | **Version** | `1.3.1` |
21
+ | **Runtime** | Node.js **≥ 18** (ESM; **≥ 20** recommended for LangChain instrumentation) |
22
+ | **Default Stratos URL** | `http://localhost:4000` |
23
+
24
+ ---
25
+
26
+ ## Table of contents
27
+
28
+ - [What you get](#what-you-get)
29
+ - [Install](#install)
30
+ - [Configure](#configure)
31
+ - [How to use](#how-to-use)
32
+ - [What is supported](#what-is-supported)
33
+ - [LangChain version inspect & fix](#langchain-version-inspect--fix)
34
+ - [Vercel AI SDK (important)](#vercel-ai-sdk-important)
35
+ - [Environment reference](#environment-reference)
36
+ - [Auto-detected metadata](#auto-detected-metadata)
37
+ - [MCP proxy](#mcp-proxy)
38
+ - [How it works](#how-it-works)
39
+ - [Troubleshooting](#troubleshooting)
40
+ - [Security & privacy](#security--privacy)
41
+ - [API](#api)
42
+
43
+ ---
44
+
45
+ ## What you get
46
+
47
+ | Feature | Description |
48
+ |--------|-------------|
49
+ | **Liveness** | Heartbeat so the agent shows online in Stratos |
50
+ | **LLM spans** | Model name, token usage, latency, prompts/outputs (when enabled) |
51
+ | **Tool spans** | Tool name, args, results (from instrumented frameworks / MCP proxy) |
52
+ | **Zero agent logic changes** | Prefer `node --import …/register` — no instrumentation in business code |
53
+ | **`.env` load** | On `--import`, loads `./.env` from `cwd` so `STRATOS_TOKEN` is available early |
54
+ | **MCP host tools** | `stratos-mcp-proxy` wraps Claude Desktop / Cursor / VS Code MCP servers |
55
+ | **LangChain inspect** | `stratos-inspect` checks core version; optional uninstall old + install 1.x |
56
+
57
+ Traces go to:
58
+
59
+ ```http
60
+ POST {STRATOS_URL}/api/ingest
61
+ Header: x-stratos-token: <STRATOS_TOKEN>
62
+ Body: OTLP/JSON
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Install
68
+
69
+ ```bash
70
+ npm i @intelli-1113/stratos-sdk
71
+ ```
72
+
73
+ For MCP proxy use from a host app (global CLI):
74
+
75
+ ```bash
76
+ npm i -g @intelli-1113/stratos-sdk
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Configure
82
+
83
+ 1. Open **Stratos AI** → **Add agent** → copy the enrollment **token**.
84
+ 2. Set environment variables (shell or `.env` in the project root):
85
+
86
+ ```env
87
+ # Required
88
+ STRATOS_TOKEN=your_enrollment_token_here
89
+
90
+ # Optional (defaults shown)
91
+ STRATOS_URL=http://localhost:4000
92
+ STRATOS_APP_NAME=my-agent
93
+ ```
94
+
95
+ Production example:
96
+
97
+ ```env
98
+ STRATOS_TOKEN=...
99
+ STRATOS_URL=https://stratos.example.com
100
+ STRATOS_APP_NAME=checkout-agent
101
+ ```
102
+
103
+ > Change token/URL anytime and **restart** the process. No code change required.
104
+
105
+ ---
106
+
107
+ ## How to use
108
+
109
+ ### Option A — Zero app-code changes (**recommended**)
110
+
111
+ Preload the SDK before your app. This is the **required** style for **Vercel AI SDK**.
112
+
113
+ ```bash
114
+ node --import @intelli-1113/stratos-sdk/register server.js
115
+ ```
116
+
117
+ `package.json`:
118
+
119
+ ```json
120
+ {
121
+ "scripts": {
122
+ "start": "node --import @intelli-1113/stratos-sdk/register server.js",
123
+ "dev": "node --import @intelli-1113/stratos-sdk/register --watch server.js"
124
+ }
125
+ }
126
+ ```
127
+
128
+ Windows PowerShell (same idea):
129
+
130
+ ```powershell
131
+ node --import @intelli-1113/stratos-sdk/register .\server.js
132
+ ```
133
+
134
+ Your application code stays normal (no Stratos APIs required):
135
+
136
+ ```js
137
+ // server.js — business logic only
138
+ import { generateText } from "ai";
139
+ import { mistral } from "@ai-sdk/mistral";
140
+ // or: ChatMistralAI from @langchain/mistralai, OpenAI SDK, etc.
141
+
142
+ const { text } = await generateText({
143
+ model: mistral("mistral-large-latest"),
144
+ prompt: "Hello",
145
+ });
146
+ ```
147
+
148
+ ### Option B — First import in the entrypoint
149
+
150
+ Works well for **LangChain**, **OpenAI**, **Anthropic**, **Google GenAI**, etc. (Traceloop auto-patches these **if** this import runs before those libraries load).
151
+
152
+ ```js
153
+ import "@intelli-1113/stratos-sdk/register"; // must be first
154
+ import { ChatOpenAI } from "@langchain/openai";
155
+ // ... rest of app
156
+ ```
157
+
158
+ > **Vercel AI note:** a normal `import "@intelli-1113/stratos-sdk/register"` in the **same file** as `import { generateText } from "ai"` is often **too late** (ESM links the whole graph before evaluation). Use **Option A (`--import`)** for Vercel AI.
159
+
160
+ ### Option C — Programmatic `start()`
161
+
162
+ ```js
163
+ import { start } from "@intelli-1113/stratos-sdk";
164
+
165
+ start({
166
+ token: process.env.STRATOS_TOKEN,
167
+ url: process.env.STRATOS_URL, // optional
168
+ appName: "my-agent", // optional
169
+ model: "mistral-large-latest", // optional heartbeat metadata
170
+ tools: ["web_search"], // optional heartbeat metadata
171
+ framework: "vercel-ai", // optional override
172
+ heartbeatMs: 30000, // optional
173
+ });
174
+ ```
175
+
176
+ For Vercel AI with Option C, still prefer launching with `--import @intelli-1113/stratos-sdk/register` so the ESM loader is active, **or** call `start()` only after registering the loader yourself (Option A is simpler).
177
+
178
+ ---
179
+
180
+ ## What is supported
181
+
182
+ ### Auto-instrumented stacks (OpenLLMetry / Traceloop)
183
+
184
+ These emit rich LLM/tool spans **without** client telemetry flags, when the SDK loads **before** the library:
185
+
186
+ | Stack | Node support via this SDK | Notes |
187
+ |-------|---------------------------|--------|
188
+ | **LangChain.js** | Yes | Agents, tools, chat models |
189
+ | **LangGraph.js** | Yes | Same family as LangChain |
190
+ | **LlamaIndex.TS** | Yes | When package is present |
191
+ | **OpenAI SDK** (`openai`) | Yes | Chat/completions |
192
+ | **Anthropic SDK** | Yes | Messages API |
193
+ | **Google Generative AI / GenAI** | Yes | Direct Google SDKs |
194
+ | **AWS Bedrock** (SDK path) | Yes | Via Traceloop instrumentation |
195
+ | **Together AI** | Yes | Via Traceloop |
196
+ | **Vertex AI** | Yes | Via Traceloop |
197
+ | **Vercel AI SDK** (`ai`) | Yes (**Stratos-specific**) | See [below](#vercel-ai-sdk-important) — needs `--import` |
198
+
199
+ ### Model providers (examples)
200
+
201
+ Model choice is independent of framework. These are common pairs:
202
+
203
+ | Provider | Typical packages | Observed when |
204
+ |----------|------------------|---------------|
205
+ | OpenAI | `openai`, `@ai-sdk/openai`, LangChain OpenAI | Instrumented path or Vercel AI + Stratos loader |
206
+ | Anthropic | `@anthropic-ai/sdk`, `@ai-sdk/anthropic` | Same |
207
+ | Google / Gemini | `@google/generative-ai`, `@google/genai`, `@ai-sdk/google` | Same |
208
+ | Mistral | `@ai-sdk/mistral`, `@langchain/mistralai` | Same |
209
+ | Azure OpenAI / Bedrock | respective SDKs or LangChain | Via instrumented SDKs / LangChain |
210
+
211
+ ### Not automatic (needs extra work or different product path)
212
+
213
+ | Approach | Why |
214
+ |----------|-----|
215
+ | Raw `fetch` to LLM HTTP APIs | Nothing to patch |
216
+ | Custom agent runtimes with no OTel | No spans unless you emit OTLP yourself |
217
+ | Python agents | Use the **Python** Stratos / OpenLLMetry package if provided (this package is **Node**) |
218
+ | Frameworks without OpenLLMetry support | May only show heartbeat until support is added |
219
+
220
+ ### Heartbeat-only vs full traces
221
+
222
+ | You see in Stratos | Meaning |
223
+ |--------------------|---------|
224
+ | Agent **online**, little detail | Heartbeat works; few/no LLM spans |
225
+ | Model, tokens, tools, prompts | Spans reached `/api/ingest` |
226
+
227
+ ---
228
+
229
+ ## LangChain version inspect & fix
230
+
231
+ Stratos LangChain **metrics** need:
232
+
233
+ ```text
234
+ @langchain/core >= 1.0.0 and < 2.0.0
235
+ ```
236
+
237
+ (from `@traceloop/instrumentation-langchain`, e.g. `^1.2.4` works).
238
+
239
+ Installing the SDK **does not** auto-upgrade the client’s LangChain 0.x app.
240
+ Use **`stratos-inspect`** in the **client project** to check and optionally fix.
241
+
242
+ ### Inspect only
243
+
244
+ ```bash
245
+ cd /path/to/client-agent
246
+ npx stratos-inspect
247
+ ```
248
+
249
+ JSON:
250
+
251
+ ```bash
252
+ npx stratos-inspect --json
253
+ ```
254
+
255
+ ### Uninstall old LangChain (&lt;1.0) and install 1.x
256
+
257
+ Interactive (asks y/N):
258
+
259
+ ```bash
260
+ npx stratos-inspect --fix
261
+ ```
262
+
263
+ Non-interactive (CI / scripts):
264
+
265
+ ```bash
266
+ npx stratos-inspect --fix --yes
267
+ ```
268
+
269
+ Dry run (show plan only):
270
+
271
+ ```bash
272
+ npx stratos-inspect --fix --dry-run
273
+ ```
274
+
275
+ What `--fix` does:
276
+
277
+ 1. Detects LangChain family packages in the project
278
+ 2. If `@langchain/core` is **&lt; 1.0** → uninstalls those packages
279
+ 3. Installs recommended **1.x** set (`@langchain/core@^1.2.4`, `langchain@^1.5.4`, plus any previous `@langchain/*` providers at `^1`)
280
+ 4. Uses npm / pnpm / yarn / bun based on lockfile
281
+
282
+ It will **not** auto-downgrade core **≥ 2.0**.
283
+
284
+ ### After install of Stratos
285
+
286
+ `postinstall` prints a warning if LangChain is present but incompatible (does **not** change deps).
287
+
288
+ At runtime, `start()` / `register` also warns and suggests `npx stratos-inspect --fix`.
289
+
290
+ Hard-fail on start if desired:
291
+
292
+ ---
293
+
294
+
295
+ ### What the SDK does for Vercel AI
296
+
297
+ 1. Registers a Node **custom module loader** on `register`
298
+ 2. Intercepts bare imports of `"ai"`
299
+ 3. Re-exports the real package
300
+ 4. Wraps `generateText`, `streamText`, `generateObject`, `streamObject`, `embed`, `embedMany`, and related helpers
301
+ 5. Injects telemetry defaults (`experimental_telemetry` / `telemetry`)
302
+
303
+ ### Client code (unchanged)
304
+
305
+ ```js
306
+ import { generateText, stepCountIs } from "ai";
307
+ import { openai } from "@ai-sdk/openai";
308
+ // import { mistral } from "@ai-sdk/mistral";
309
+ // import { google } from "@ai-sdk/google";
310
+
311
+ await generateText({
312
+ model: openai("gpt-4o"),
313
+ prompt: "Summarize today's agenda",
314
+ tools: { /* ... */ },
315
+ stopWhen: stepCountIs(5),
316
+ });
317
+ ```
318
+
319
+ ### How the client starts the process
320
+
321
+ ```bash
322
+ node --import @intelli-1113/stratos-sdk/register app.js
323
+ ```
324
+
325
+ ### Opt-out
326
+
327
+ | Goal | Setting |
328
+ |------|---------|
329
+ | Disable Vercel AI wrapping entirely | `STRATOS_VERCEL_AI=0` |
330
+ | Do not record prompts | `STRATOS_RECORD_INPUTS=0` |
331
+ | Do not record completions | `STRATOS_RECORD_OUTPUTS=0` |
332
+ | Disable one call only | Pass `experimental_telemetry: { isEnabled: false }` (or `telemetry: { isEnabled: false }` on AI SDK v7) |
333
+
334
+ ### AI SDK v7
335
+
336
+ If the app also installs `@ai-sdk/otel`, the SDK will try `registerTelemetry(new OpenTelemetry())` when available. The loader-based wrap still covers v5/v6-style `experimental_telemetry`.
337
+
338
+ ---
339
+
340
+ ## Environment reference
341
+
342
+ ### Core
343
+
344
+ | Variable | Required | Default | Description |
345
+ |----------|----------|---------|-------------|
346
+ | `STRATOS_TOKEN` | **Yes** | — | Enrollment token from Stratos → Add agent |
347
+ | `STRATOS_URL` | No | `http://localhost:4000` | Stratos origin (no trailing slash required) |
348
+ | `STRATOS_APP_NAME` | No | `npm_package_name` or `"agent"` | Display name / `service.name` |
349
+ | `STRATOS_HEARTBEAT_MS` | No | `30000` | Heartbeat interval (ms). `0` disables interval |
350
+
351
+ ### Metadata overrides
352
+
353
+ | Variable | Description |
354
+ |----------|-------------|
355
+ | `STRATOS_FRAMEWORK` | Force framework label (`langchain`, `vercel-ai`, `langgraph`, …) |
356
+ | `STRATOS_MODEL` | Preferred model label for heartbeat |
357
+ | `NVIDIA_MODEL` / `OPENAI_MODEL` / `ANTHROPIC_MODEL` / `GEMINI_MODEL` / `GOOGLE_MODEL` / `LLM_MODEL` / `MODEL` | Fallback model detection for heartbeat |
358
+ | `STRATOS_TOOLS` | Comma-separated tool names for heartbeat (`web_search,retriever`) |
359
+ | `STRATOS_FUNCTION_ID` | Default `functionId` on injected Vercel AI telemetry |
360
+ | `STRATOS_STRICT_LANGCHAIN` | Set `1` to throw on start if LangChain core is &lt; 1.0 |
361
+ | `STRATOS_SKIP_POSTINSTALL` | Set `1` to skip postinstall LangChain warning |
362
+
363
+ ### Vercel AI controls
364
+
365
+ | Variable | Default | Description |
366
+ |----------|---------|-------------|
367
+ | `STRATOS_VERCEL_AI` | on | Set `0` / `false` / `off` to disable auto wrap |
368
+ | `STRATOS_RECORD_INPUTS` | on | Set `0` to skip recording prompts |
369
+ | `STRATOS_RECORD_OUTPUTS` | on | Set `0` to skip recording outputs |
370
+
371
+ ---
372
+
373
+ ## Auto-detected metadata
374
+
375
+ On each heartbeat the SDK POSTs JSON to `{STRATOS_URL}/api/heartbeat` with:
376
+
377
+ | Field | Source |
378
+ |-------|--------|
379
+ | **framework** | `package.json` deps / resolution, or `STRATOS_FRAMEWORK` |
380
+ | **model** | Env vars above or `start({ model })` |
381
+ | **tools** | `STRATOS_TOOLS` or `start({ tools })` (spans refine tools over time) |
382
+
383
+ Detection order for framework (first match wins, unless overridden):
384
+
385
+ 1. Google ADK
386
+ 2. OpenAI Agents
387
+ 3. LlamaIndex
388
+ 4. CrewAI
389
+ 5. LangGraph
390
+ 6. LangChain
391
+ 7. Vercel AI (`ai`)
392
+ 8. Google GenAI SDKs
393
+ 9. Anthropic SDK
394
+ 10. OpenAI SDK
395
+
396
+ > If a project installs **both** LangChain and Vercel AI, framework detection may prefer LangChain. Set `STRATOS_FRAMEWORK=vercel-ai` (or use separate apps/tokens) when needed.
397
+
398
+ ---
399
+
400
+ ## Claude Code
401
+
402
+ Claude Code is a compiled app, so the Node SDK cannot run inside it. Instead, `stratos setup` adds four short-lived **hooks** to `~/.claude/settings.json`. When a turn ends they read the session transcript and post the new usage to Stratos: model, input/output/cache tokens per API call, every tool and MCP call, and subagents. Nothing runs in the background, so there is nothing to restart after a reboot.
403
+
404
+ ```bash
405
+ npm i -g @intelli-1113/stratos-sdk
406
+ stratos setup claude-code --token <your-token> --url https://stratos.example.com
407
+ stratos doctor
408
+ ```
409
+
410
+ | | |
411
+ |---|---|
412
+ | Hooks added | `SessionStart` (heartbeat), `Stop` + `SubagentStop` (async, send new usage), `SessionEnd` (final flush) |
413
+ | Token | Stored in `~/.stratos/config.json`, **not** in `settings.json` (which every command Claude runs can see) |
414
+ | Prompt / answer text | Not sent by default. Opt in with `--record-prompts` |
415
+ | Offline | Undelivered batches wait in `~/.stratos/outbox/` and are sent by the next hook |
416
+ | Cost | Not in the transcript. Stratos computes it from the model and token counts |
417
+ | Requires | `node` on PATH (Node ≥ 20.12) |
418
+ | Undo | `stratos setup claude-code --remove` |
419
+ | Org rollout | `stratos setup claude-code --print-managed` prints a `managed-settings.json` hook block |
420
+
421
+ Problems are logged to `~/.stratos/hook.log`. A hook never blocks or slows Claude Code: it always exits 0 and prints nothing.
422
+
423
+ > Older setup versions wrote `NODE_OPTIONS=--import …/register` into `settings.json`. That breaks Node commands Claude runs, so re-running `stratos setup claude-code` removes it.
424
+
425
+ ## MCP proxy
426
+
427
+ Host-launched MCP servers (Claude Desktop, Cursor, VS Code, …) do not run your Node agent process. Use the bundled CLI to proxy **tool calls**:
428
+
429
+ ```bash
430
+ npm i -g @intelli-1113/stratos-sdk
431
+ ```
432
+
433
+ Host config example:
434
+
435
+ ```json
436
+ {
437
+ "mcpServers": {
438
+ "weather": {
439
+ "command": "stratos-mcp-proxy",
440
+ "args": ["--", "npx", "-y", "@scope/weather-mcp@latest"],
441
+ "env": {
442
+ "STRATOS_TOKEN": "<token>",
443
+ "STRATOS_URL": "http://localhost:4000",
444
+ "STRATOS_APP_NAME": "weather"
445
+ }
446
+ }
447
+ }
448
+ }
449
+ ```
450
+
451
+ | Behavior | Detail |
452
+ |----------|--------|
453
+ | Protocol | Forwards JSON-RPC stdio **verbatim** |
454
+ | Telemetry | Each `tools/call` → OTLP-like span on `/api/ingest` |
455
+ | Liveness | Heartbeat on `/api/heartbeat` |
456
+ | Logging | **stderr only** (stdout is reserved for MCP) |
457
+ | LLM tokens | **Not** captured (MCP servers usually don’t call the LLM) |
458
+
459
+ Usage:
460
+
461
+ ```bash
462
+ stratos-mcp-proxy -- <command> [args...]
463
+ ```
464
+
465
+ ---
466
+
467
+ ## How it works
468
+
469
+ ```text
470
+ ┌─────────────────────┐
471
+ │ Your agent process │
472
+ │ (Node.js) │
473
+ └──────────┬──────────┘
474
+ │ 1. --import register
475
+ ▼
476
+ ┌─────────────────────┐
477
+ │ stratos-sdk │
478
+ │ • load .env │
479
+ │ • Vercel AI loader │
480
+ │ • Traceloop init │
481
+ │ • OTLP JSON export │
482
+ │ • heartbeat loop │
483
+ └──────────┬──────────┘
484
+ │
485
+ ├─ POST /api/ingest (spans: LLM + tools)
486
+ └─ POST /api/heartbeat (online + metadata)
487
+ │
488
+ ▼
489
+ ┌───────────────┐
490
+ │ Stratos AI │
491
+ │ :4000 UI │
492
+ └───────────────┘
493
+ ```
494
+
495
+ - **LangChain / OpenAI / …** → Traceloop instrumentations create spans.
496
+ - **Vercel AI** → Stratos loader injects telemetry so the `ai` package creates OTel spans; Traceloop exports them.
497
+ - **MCP** → `stratos-mcp-proxy` synthesizes tool spans.
498
+
499
+ ---
500
+
501
+ ## Troubleshooting
502
+
503
+ | Symptom | Likely cause | Fix |
504
+ |---------|--------------|-----|
505
+ | `[stratos] STRATOS_TOKEN not set` | Token missing at process start | Set `STRATOS_TOKEN` or put it in `.env` in `cwd` |
506
+ | Agent online, no tokens/tools | Framework not instrumented or Vercel AI without `--import` | Use `--import …/register`; confirm stack is supported |
507
+ | Vercel AI still no spans | Started without `--import` | `node --import @intelli-1113/stratos-sdk/register app.js` |
508
+ | Wrong framework label | Mixed deps in one `package.json` | Set `STRATOS_FRAMEWORK=vercel-ai` (or `langchain`) |
509
+ | Spans lost on short CLI scripts | Process exited before flush | SDK flushes on `beforeExit` / signals; keep process alive until request finishes |
510
+ | MCP tools not showing | Proxy not wrapping command / no token | Use `stratos-mcp-proxy -- …` and set env on the host config |
511
+ | Local Stratos empty | Wrong URL | Default is `http://localhost:4000`; ensure Stratos is running |
512
+
513
+ Verify the SDK loaded:
514
+
515
+ ```text
516
+ [stratos] telemetry → http://localhost:4000/api/ingest (heartbeat 30000ms, framework=…)
517
+ [stratos] vercel-ai auto-telemetry: esm-loader-shim # when Vercel path is active
518
+ ```
519
+
520
+ ---
521
+
522
+ ## Security & privacy
523
+
524
+ - **Token** — treat `STRATOS_TOKEN` like a secret; do not commit it.
525
+ - **Prompts/outputs** — may be sent in spans. Disable with:
526
+ - `STRATOS_RECORD_INPUTS=0`
527
+ - `STRATOS_RECORD_OUTPUTS=0`
528
+ - **Network** — telemetry is sent to `STRATOS_URL` only.
529
+ - **MCP proxy** — tool args/results are reported; avoid secrets in tool arguments when possible.
530
+
531
+ ---
532
+
533
+ ### Entry points
534
+
535
+ | Import | Purpose |
536
+ |--------|---------|
537
+ | `@intelli-1113/stratos-sdk/register` | Side-effect: env + Vercel loader + `start()` |
538
+ | `@intelli-1113/stratos-sdk` | `{ start }` for programmatic use |
539
+
540
+ ### CLI
541
+
542
+ | Command | Purpose |
543
+ |---------|---------|
544
+ | `stratos-inspect` | Check LangChain compatibility in current project |
545
+ | `stratos-inspect --fix [--yes]` | Uninstall old LangChain and install 1.x |
546
+ | `stratos-mcp-proxy -- <cmd> [args…]` | MCP stdio proxy with tool telemetry |
547
+
548
+ ### `inspectLangChain()` / `fixLangChain()`
549
+
550
+ See [LangChain version inspect & fix](#langchain-version-inspect--fix).
551
+
552
+ ---
553
+
554
+ ## Requirements
555
+
556
+ - **Node.js** 18+ (20+ recommended; `.env` via `process.loadEnvFile` when available)
557
+ - Network reachability to Stratos (`STRATOS_URL`)
558
+ - Valid **STRATOS_TOKEN** from the Stratos UI
559
+
560
+ ---
561
+
562
+ ## License
563
+
564
+ MIT
565
+
566
+ ---
567
+
568
+ ## Changelog (recent)
569
+
570
+ ### 1.3.1
571
+
572
+ - **`stratos-inspect`** CLI: check LangChain core version; optional `--fix` uninstall old + install 1.x
573
+ - **postinstall** warning if LangChain &lt; 1.0
574
+ - Runtime warning on `start()`; optional `STRATOS_STRICT_LANGCHAIN=1`
575
+ - Exports: `inspectLangChain`, `fixLangChain`
576
+
577
+ ### 1.3.0
578
+
579
+ - Auto Vercel AI SDK telemetry via ESM module loader (no client `experimental_telemetry`)
580
+ - Load `.env` from `cwd` when using `--import`
581
+ - Document `--import` as the recommended zero-code entry
582
+ - Framework / model / tools heartbeat metadata retained
583
+ - MCP proxy unchanged in purpose (`stratos-mcp-proxy`)