@nexalink/carecompass-sdk 0.1.0-beta.1 → 0.1.0-beta.11

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/LICENSE CHANGED
@@ -1,15 +1,16 @@
1
1
  Nexalink Proprietary Software License
2
2
 
3
- Copyright (c) 2026 Nexalink, Inc. All rights reserved.
3
+ Copyright (c) 2026 Nexalink Health, Inc. All rights reserved.
4
4
 
5
- This package and its source code are proprietary to Nexalink, Inc. Access to
6
- this package does not grant any ownership interest, sublicensing right, or right
7
- to redistribute the software except as expressly authorized in a written
8
- agreement with Nexalink.
5
+ This package and its source code are proprietary to Nexalink Health, Inc.
6
+ Access to this package does not grant any ownership interest, sublicensing
7
+ right, or right to redistribute the software except as expressly authorized in a
8
+ written agreement with Nexalink Health, Inc.
9
9
 
10
10
  Authorized Nexalink customers and implementation partners may install and use
11
11
  this package solely to evaluate, integrate, test, and operate CareCompass embed
12
- experiences for payer-approved deployments using Nexalink-issued credentials.
12
+ experiences for customer-approved healthcare deployments using Nexalink-issued
13
+ credentials.
13
14
 
14
15
  You may not copy, modify, publish, distribute, sell, sublicense, reverse
15
16
  engineer, or use this software to provide a competing service except where
package/README.md CHANGED
@@ -1,3 +1,359 @@
1
- # CareCompass SDK
1
+ # CareCompass Healthcare Embed SDK
2
2
 
3
- See the repository documentation at `docs/carecompass-sdk.md`.
3
+ `@nexalink/carecompass-sdk` helps healthcare organizations embed a branded CareCompass chat experience in their own websites and applications. It includes a React component, a vanilla JavaScript mount helper, shared configuration validation, and a CLI for setup, validation, snippet generation, and local diagnostics.
4
+
5
+ CareCompass lets healthcare teams offer member-facing navigation support while keeping LLM inference behind Nexalink-hosted APIs. The integrating organization controls the placement, branding, theme, labels, support links, allowed origins, and approved prompt configuration. Nexalink controls account validation, API-key enforcement, embed-key authorization, usage tracking, and the hosted model path.
6
+
7
+ This package is publicly installable for developer convenience, but live regulated use requires Nexalink onboarding, BAA coverage where PHI may be involved, and Nexalink-issued API credentials.
8
+
9
+ ## Who This Is For
10
+
11
+ This SDK is for enterprise healthcare teams that want to add CareCompass to their own frontend without building a model gateway, prompt validation layer, key-management flow, or token-metering pipeline.
12
+
13
+ Typical users include:
14
+
15
+ - payer, provider, employer-benefits, care-navigation, and digital-health teams embedding CareCompass in a member or patient site
16
+ - implementation engineers configuring staging and production deployments
17
+ - technical operators validating origins, branding, and prompt policy
18
+ - non-technical customer admins issuing SDK keys from the Nexalink portal
19
+
20
+ ## Account Required
21
+
22
+ You need a Nexalink account with SDK access before using the SDK beyond package installation. For deployments that may involve PHI, a signed BAA and approved credentials are required before live use.
23
+
24
+ The account is required because Nexalink validates:
25
+
26
+ - the customer or payer ID
27
+ - the secret SDK API key
28
+ - the public browser embed key
29
+ - the deployment environment
30
+ - the allowed website origins
31
+ - the approved prompt configuration
32
+ - API usage and token counts for future metered billing
33
+
34
+ API keys are issued in the Nexalink portal under the CareCompass SDK section. The secret API key is shown once and should be stored locally by the developer. It should never be committed to source control or placed in browser code.
35
+
36
+ If you do not have an API key, run:
37
+
38
+ ```bash
39
+ npx @nexalink/carecompass-sdk login
40
+ ```
41
+
42
+ The CLI will direct you to the payer signup path.
43
+
44
+ ## Install And Run
45
+
46
+ Use any common JavaScript package manager. For first-time testing, the simplest
47
+ path is to run each command with `npx`.
48
+
49
+ ```bash
50
+ npx @nexalink/carecompass-sdk login --api-key <nexalink-api-key>
51
+ npx @nexalink/carecompass-sdk init --payer-id acme-health --origin https://members.acme-health.com
52
+ npx @nexalink/carecompass-sdk validate --config carecompass/carecompass.config.json
53
+ npx @nexalink/carecompass-sdk doctor --config carecompass/carecompass.config.json
54
+ ```
55
+
56
+ `npx` does not permanently install a `carecompass` shell command. If you use
57
+ `npx` for login, keep using `npx @nexalink/carecompass-sdk <command>` for init,
58
+ validate, snippet, and doctor.
59
+
60
+ Package-manager equivalents:
61
+
62
+ ```bash
63
+ npm exec --package @nexalink/carecompass-sdk -- carecompass init
64
+ pnpm dlx @nexalink/carecompass-sdk init
65
+ yarn dlx @nexalink/carecompass-sdk init
66
+ bunx @nexalink/carecompass-sdk init
67
+ ```
68
+
69
+ You can also install it in a project and run the binary through your package
70
+ manager:
71
+
72
+ ```bash
73
+ npm install @nexalink/carecompass-sdk
74
+ npm exec carecompass -- init --payer-id acme-health --origin https://members.acme-health.com
75
+ ```
76
+
77
+ Or install it globally if your organization permits global npm tools:
78
+
79
+ ```bash
80
+ npm install -g @nexalink/carecompass-sdk
81
+ carecompass init --payer-id acme-health --origin https://members.acme-health.com
82
+ ```
83
+
84
+ ## CLI Commands
85
+
86
+ ### `login`
87
+
88
+ Stores your secret Nexalink API key locally so the other SDK commands can validate your payer configuration.
89
+
90
+ ```bash
91
+ npx @nexalink/carecompass-sdk login --api-key <nexalink-api-key>
92
+ ```
93
+
94
+ Credentials are stored at `~/.nexalink/carecompass/credentials.json` by default. You can also set `CARECOMPASS_API_KEY` in your shell or CI environment.
95
+
96
+ ### `init`
97
+
98
+ Creates a `carecompass` folder with all generated SDK files in one place:
99
+
100
+ - `carecompass/carecompass.config.json`
101
+ - `carecompass/system-prompt.md`
102
+ - `carecompass/carecompass-embed.html`
103
+ - `carecompass/carecompass-iframe.html`
104
+ - `carecompass/README.md`
105
+
106
+ The CLI prints the setup steps in order: review config, edit the system prompt, serve the generated embed page, place the iframe, then validate. The config file contains payer-facing configuration only. It does not contain the secret API key. The embed HTML and iframe are generated automatically during `init`; you do not need to run a separate snippet command for the first setup.
107
+
108
+ By default, generated HTML is bundler-friendly and imports the package as
109
+ `@nexalink/carecompass-sdk`, which works with Parcel, Vite, Next.js, and similar
110
+ tooling when the package is installed as a dependency. For a raw browser HTML
111
+ demo that is not processed by Parcel or another bundler, add
112
+ `--snippet-mode cdn`.
113
+
114
+ ```bash
115
+ npx @nexalink/carecompass-sdk init --payer-id acme-health --origin https://members.acme-health.com
116
+ npx @nexalink/carecompass-sdk init --snippet-mode cdn --payer-id acme-health --origin https://members.acme-health.com
117
+ ```
118
+
119
+ ### `validate`
120
+
121
+ Checks that the config shape is valid and that credentials are available.
122
+ By default this also calls the hosted Nexalink config-validation endpoint, which
123
+ confirms the API base URL, API key, embed key, environment, and first allowed
124
+ origin are accepted by the server. Use `--local-only` for schema-only checks.
125
+
126
+ ```bash
127
+ npx @nexalink/carecompass-sdk validate --config carecompass/carecompass.config.json
128
+ npx @nexalink/carecompass-sdk validate --local-only --config carecompass/carecompass.config.json
129
+ ```
130
+
131
+ ### `snippet`
132
+
133
+ Regenerates the HTML embed snippet after config, branding, origin, or prompt changes. `init` already runs this once.
134
+
135
+ ```bash
136
+ npx @nexalink/carecompass-sdk snippet --config carecompass/carecompass.config.json
137
+ npx @nexalink/carecompass-sdk snippet --snippet-mode cdn --config carecompass/carecompass.config.json
138
+ ```
139
+
140
+ ### `doctor`
141
+
142
+ Prints a deployment readiness summary for the selected config.
143
+
144
+ ```bash
145
+ npx @nexalink/carecompass-sdk doctor --config carecompass/carecompass.config.json
146
+ ```
147
+
148
+ ## Configuration
149
+
150
+ `carecompass/carecompass.config.json` is safe to commit when it only contains public embed configuration. Do not add the secret API key to this file.
151
+
152
+ ```json
153
+ {
154
+ "payerId": "acme-health",
155
+ "environment": "staging",
156
+ "apiBaseUrl": "https://www.nexalink.care",
157
+ "embedKey": "embed_public_key_from_nexalink",
158
+ "allowedOrigins": ["https://members.acme-health.com"],
159
+ "branding": {
160
+ "displayName": "Acme Health",
161
+ "logoUrl": "https://members.acme-health.com/logo.svg",
162
+ "supportUrl": "https://members.acme-health.com/support"
163
+ },
164
+ "theme": {
165
+ "primaryColor": "#2563eb",
166
+ "backgroundColor": "#ffffff",
167
+ "textColor": "#111827",
168
+ "borderRadius": "8px",
169
+ "fontFamily": "system-ui, sans-serif"
170
+ },
171
+ "labels": {
172
+ "title": "Acme Care Guide",
173
+ "placeholder": "Ask about benefits, care options, or next steps...",
174
+ "sendButton": "Send",
175
+ "disclaimer": "CareCompass provides navigation support, not medical advice.",
176
+ "errorMessage": "CareCompass is unavailable right now."
177
+ },
178
+ "prompt": {
179
+ "systemInstructionFile": "./system-prompt.md",
180
+ "welcomeMessage": "How can I help you navigate your care today?",
181
+ "allowUserContext": false
182
+ },
183
+ "placement": {
184
+ "mode": "inline"
185
+ },
186
+ "deploymentTarget": "web"
187
+ }
188
+ ```
189
+
190
+ ## System Prompt File
191
+
192
+ `carecompass/system-prompt.md` lets the payer define approved context before a member message reaches the LLM. Use it to steer CareCompass toward plan-specific terminology, support boundaries, escalation rules, and benefit-navigation context.
193
+
194
+ The prompt file is resolved by the CLI when it generates `carecompass/carecompass-embed.html`. The browser receives the resolved prompt text, not a local file path. Prompt content is still validated against Nexalink guardrails.
195
+
196
+ ## Iframe Placement
197
+
198
+ `carecompass/carecompass-iframe.html` contains the iframe to place on the integrating page where the CareCompass LLM should appear.
199
+
200
+ ```html
201
+ <iframe
202
+ title="Acme Health CareCompass"
203
+ src="/carecompass/carecompass-embed.html"
204
+ style="width: 100%; min-height: 640px; border: 0; border-radius: 8px;"
205
+ loading="lazy"
206
+ ></iframe>
207
+ ```
208
+
209
+ Serve `carecompass/carecompass-embed.html` from the integrating site at the iframe `src`. For many apps, that means copying the generated `carecompass` folder into the app's public/static assets folder before deployment.
210
+
211
+ ## React Usage
212
+
213
+ ```tsx
214
+ import { CareCompassEmbed } from "@nexalink/carecompass-sdk";
215
+ import config from "./carecompass/carecompass.config.json";
216
+
217
+ export function MemberSupport() {
218
+ return <CareCompassEmbed config={config} />;
219
+ }
220
+ ```
221
+
222
+ ## Vanilla JavaScript Usage
223
+
224
+ ```ts
225
+ import { mountCareCompass } from "@nexalink/carecompass-sdk";
226
+ import config from "./carecompass/carecompass.config.json";
227
+
228
+ mountCareCompass(document.getElementById("carecompass-root"), config);
229
+ ```
230
+
231
+ ## Package Exports
232
+
233
+ ```ts
234
+ import {
235
+ CareCompassEmbed,
236
+ mountCareCompass,
237
+ validateCareCompassConfig,
238
+ createCareCompassClient,
239
+ } from "@nexalink/carecompass-sdk";
240
+
241
+ import type {
242
+ CareCompassConfig,
243
+ CareCompassTheme,
244
+ CareCompassLabels,
245
+ CareCompassPromptConfig,
246
+ } from "@nexalink/carecompass-sdk";
247
+ ```
248
+
249
+ ## Runtime Dependencies
250
+
251
+ The package has a small runtime surface:
252
+
253
+ - `zod` for shared config validation
254
+ - `react` as a peer dependency for the embed component
255
+ - `react-dom` as a peer dependency for mounting
256
+
257
+ Peer dependency range:
258
+
259
+ ```json
260
+ {
261
+ "react": "^18.3.0 || ^19.0.0",
262
+ "react-dom": "^18.3.0 || ^19.0.0"
263
+ }
264
+ ```
265
+
266
+ The CLI requires Node.js 18 or newer.
267
+
268
+ ## What Runs In The Browser
269
+
270
+ The browser receives only public embed configuration:
271
+
272
+ - customer or payer ID
273
+ - environment
274
+ - public `embedKey`
275
+ - branding and theme values
276
+ - labels and support links
277
+ - approved prompt settings
278
+
279
+ The browser does not receive:
280
+
281
+ - the secret SDK API key
282
+ - SageMaker credentials
283
+ - the AppSync signing role
284
+ - private model endpoint details
285
+ - Nexalink server-side allowlists
286
+
287
+ Chat requests are sent to Nexalink-hosted CareCompass API routes. The component does not call the model endpoint directly.
288
+
289
+ ## API Keys And Usage Tracking
290
+
291
+ SDK API keys are issued in the Nexalink portal and stored server-side as hashes. Each key is associated with a customer or payer ID, environment, public embed key, and allowed origins.
292
+
293
+ CareCompass usage under a key is tracked so Nexalink can support future Stripe metered billing. The backend records prompt tokens, completion tokens, total tokens, and last-used timestamps per payer/API key. Hosted routes use MedGemma token counts when they are available and fall back to estimates only when needed.
294
+
295
+ ## Staging And Production
296
+
297
+ Use separate keys and config files for staging and production.
298
+
299
+ ```bash
300
+ npx @nexalink/carecompass-sdk validate --config carecompass.staging.json
301
+ npx @nexalink/carecompass-sdk snippet --config carecompass.staging.json --output carecompass/staging-embed.html
302
+ npx @nexalink/carecompass-sdk doctor --config carecompass.staging.json
303
+ ```
304
+
305
+ Before production, confirm:
306
+
307
+ - production origin is allowlisted exactly
308
+ - production `embedKey` is separate from staging
309
+ - support links route to the payer's approved support surface
310
+ - prompt instructions are approved by Nexalink and the payer
311
+ - no secret API key appears in generated source code
312
+
313
+ ## Troubleshooting
314
+
315
+ `Missing Nexalink API key`
316
+
317
+ Run `npx @nexalink/carecompass-sdk login --api-key <key>` or set `CARECOMPASS_API_KEY`.
318
+
319
+ `zsh: command not found: carecompass`
320
+
321
+ You ran the SDK with `npx`, which does not install a permanent global command.
322
+ Run the next command with `npx @nexalink/carecompass-sdk <command>`, install the
323
+ package in your project, or install it globally.
324
+
325
+ `@parcel/core: Failed to resolve 'https://esm.sh/...'`
326
+
327
+ Regenerate the snippet with the default bundler mode instead of CDN mode:
328
+ `npx @nexalink/carecompass-sdk snippet --config carecompass/carecompass.config.json`.
329
+ Parcel does not allow `https:` imports in HTML. CDN mode is only for raw browser
330
+ HTML that is not bundled.
331
+
332
+ `CareCompass could not reach http://localhost:3000`
333
+
334
+ The browser cannot reach the configured API base URL. If the embed is running in
335
+ a hosted sandbox, `localhost` points at the sandbox/browser environment, not the
336
+ Nexalink server on your machine. Run the Nexalink web app locally and test from
337
+ a local page, or point `apiBaseUrl` at a deployed Nexalink environment that has
338
+ the CareCompass embed API routes deployed. Run `validate` to check this before
339
+ typing into the embed.
340
+
341
+ `Origin is not authorized`
342
+
343
+ Add the exact website origin to the Nexalink portal SDK configuration.
344
+
345
+ `Prompt configuration violates CareCompass guardrails`
346
+
347
+ Remove unsafe or unsupported instructions and re-run validation.
348
+
349
+ `CareCompass embed client is not authorized`
350
+
351
+ Confirm `payerId`, `embedKey`, `environment`, and allowed origins match the key issued in the Nexalink portal.
352
+
353
+ `CareCompass AppSync inference service is not configured`
354
+
355
+ Nexalink server operators should confirm the hosted web environment has `NEXT_PUBLIC_API_URL` or `CARECOMPASS_APPSYNC_URL` configured. The SDK browser embed does not require a payer-provided LLM URL.
356
+
357
+ ## License
358
+
359
+ This SDK is proprietary software owned by Nexalink Health, Inc. See the included `LICENSE` file.
package/dist/cli.js CHANGED
@@ -1,18 +1,36 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, readFileSync, realpathSync, writeFileSync, } from "node:fs";
2
+ import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync, } from "node:fs";
3
+ import { dirname, join, resolve } from "node:path";
3
4
  import { fileURLToPath } from "node:url";
4
5
  import { createDefaultCareCompassConfig, validateCareCompassConfig, } from "./schema.js";
5
6
  import { resolveApiKey, resolveCredentialsPath, writeStoredApiKey, } from "./credentials.js";
6
- import { generateCareCompassSnippet } from "./snippet.js";
7
- const DEFAULT_CONFIG_PATH = "carecompass.config.json";
7
+ import { generateCareCompassIframeSnippet, generateCareCompassSnippet, } from "./snippet.js";
8
+ const DEFAULT_OUTPUT_DIR = "carecompass";
9
+ const DEFAULT_CONFIG_PATH = join(DEFAULT_OUTPUT_DIR, "carecompass.config.json");
10
+ const DEFAULT_SNIPPET_PATH = join(DEFAULT_OUTPUT_DIR, "carecompass-embed.html");
11
+ const DEFAULT_IFRAME_PATH = join(DEFAULT_OUTPUT_DIR, "carecompass-iframe.html");
12
+ const DEFAULT_SETUP_GUIDE_PATH = join(DEFAULT_OUTPUT_DIR, "README.md");
13
+ const DEFAULT_PROMPT_PATH = "system-prompt.md";
8
14
  const DEFAULT_SIGNUP_URL = "https://nexalink.care/signup?group=payer";
15
+ const DEFAULT_API_BASE_URL = "https://www.nexalink.care";
16
+ const DEFAULT_SNIPPET_MODE = "bundler";
17
+ const DEFAULT_SYSTEM_PROMPT = `You are CareCompass, a customer-approved healthcare navigation assistant.
18
+
19
+ Help members understand benefits, coverage navigation, in-network care options,
20
+ support resources, and appropriate next steps. Stay out of diagnosis, treatment
21
+ planning, emergency triage, legal advice, and coverage guarantees. When a member
22
+ needs clinical, emergency, plan-specific, or account-specific help that requires
23
+ a human, route them to the customer's approved support resources.`;
9
24
  function parseArgs(argv) {
10
25
  const [command = "help", ...rest] = argv;
11
26
  const flags = {};
27
+ const positionals = [];
12
28
  for (let index = 0; index < rest.length; index += 1) {
13
29
  const token = rest[index];
14
- if (!token.startsWith("--"))
30
+ if (!token.startsWith("--")) {
31
+ positionals.push(token);
15
32
  continue;
33
+ }
16
34
  const key = token.slice(2);
17
35
  const next = rest[index + 1];
18
36
  const value = !next || next.startsWith("--") ? true : next;
@@ -29,19 +47,153 @@ function parseArgs(argv) {
29
47
  }
30
48
  flags[key] = value;
31
49
  }
32
- return { command, flags };
50
+ return { command, flags, positionals };
33
51
  }
34
52
  const flagString = (flags, key) => {
35
53
  const value = flags[key];
36
54
  return typeof value === "string" ? value : undefined;
37
55
  };
56
+ const snippetMode = (flags) => {
57
+ const mode = flagString(flags, "snippet-mode");
58
+ if (!mode)
59
+ return DEFAULT_SNIPPET_MODE;
60
+ if (mode === "bundler" || mode === "cdn")
61
+ return mode;
62
+ throw new Error("--snippet-mode must be either bundler or cdn.");
63
+ };
38
64
  function requireApiKey(flags, io) {
39
65
  const credentialsPath = resolveCredentialsPath(io.env);
40
66
  const credentials = resolveApiKey(flagString(flags, "api-key"), io.env, credentialsPath);
41
67
  if (!credentials.apiKey) {
42
- throw new Error("Missing Nexalink API key. Run `carecompass login --api-key <key>` or set CARECOMPASS_API_KEY.");
68
+ throw new Error("Missing Nexalink API key. Run `npx @nexalink/carecompass-sdk login --api-key <key>` or set CARECOMPASS_API_KEY.");
69
+ }
70
+ return { ...credentials, apiKey: credentials.apiKey };
71
+ }
72
+ function resolvePromptFile(config, configPath) {
73
+ const promptFile = config.prompt.systemInstructionFile;
74
+ if (!promptFile)
75
+ return config;
76
+ const resolvedPath = resolve(dirname(configPath), promptFile);
77
+ const systemInstruction = readFileSync(resolvedPath, "utf8").trim();
78
+ const validation = validateCareCompassConfig({
79
+ ...config,
80
+ prompt: {
81
+ ...config.prompt,
82
+ systemInstruction,
83
+ },
84
+ });
85
+ if (!validation.ok) {
86
+ throw new Error(`Invalid CareCompass prompt file:\n${validation.errors.join("\n")}`);
87
+ }
88
+ return validation.config;
89
+ }
90
+ function runtimeConfig(config) {
91
+ if (!config.prompt.systemInstructionFile)
92
+ return config;
93
+ const prompt = { ...config.prompt };
94
+ delete prompt.systemInstructionFile;
95
+ return {
96
+ ...config,
97
+ prompt,
98
+ };
99
+ }
100
+ const configHeaders = (config, apiKey, origin) => ({
101
+ authorization: `Bearer ${apiKey}`,
102
+ "content-type": "application/json",
103
+ "x-carecompass-payer-id": config.payerId,
104
+ "x-carecompass-embed-key": config.embedKey,
105
+ "x-carecompass-environment": config.environment,
106
+ ...(origin ? { origin } : {}),
107
+ });
108
+ const endpointUrl = (baseUrl, path) => `${baseUrl.replace(/\/+$/, "")}${path}`;
109
+ const setupGuide = (params) => `# CareCompass SDK Setup
110
+
111
+ This folder contains the CareCompass embed setup for your healthcare website or app. The generated iframe is the easiest way to place the CareCompass LLM experience where members or patients already seek help.
112
+
113
+ ## Step 1: Confirm Credentials
114
+
115
+ You need a Nexalink account with SDK access before validation or runtime use. Live regulated deployments require BAA coverage where PHI may be involved. If you do not have a key, create or request SDK access at https://nexalink.care/signup?group=payer.
116
+
117
+ \`\`\`bash
118
+ npx @nexalink/carecompass-sdk login --api-key <key>
119
+ \`\`\`
120
+
121
+ ## Step 2: Review Config
122
+
123
+ Open \`${params.configPath}\` and confirm:
124
+
125
+ - \`payerId\`: ${params.config.payerId}
126
+ - \`environment\`: ${params.config.environment}
127
+ - \`apiBaseUrl\`: ${params.config.apiBaseUrl}
128
+ - \`allowedOrigins\`: ${params.config.allowedOrigins.join(", ")}
129
+ - \`embedKey\`: public embed key issued in the Nexalink portal
130
+
131
+ The config file is safe to commit because it does not contain the secret API key.
132
+
133
+ ## Step 3: Edit System Prompt
134
+
135
+ Open \`${params.promptPath}\` and replace the starter text with customer-approved instructions. Use it for plan or program context, support boundaries, escalation rules, and member or patient navigation tone.
136
+
137
+ Do not put secrets, raw PHI, diagnosis instructions, treatment instructions, or attempts to bypass Nexalink safety rules in this file.
138
+
139
+ ## Step 4: Validate
140
+
141
+ \`\`\`bash
142
+ npx @nexalink/carecompass-sdk validate --config ${params.configPath}
143
+ \`\`\`
144
+
145
+ This checks local schema rules and verifies the config against Nexalink-hosted API routes.
146
+
147
+ ## Step 5: Place The Iframe
148
+
149
+ Copy the iframe from \`${params.iframePath}\` into the page where the CareCompass LLM should appear.
150
+
151
+ The iframe points at:
152
+
153
+ \`\`\`text
154
+ ${params.iframeSrc}
155
+ \`\`\`
156
+
157
+ Make sure \`${params.embedPath}\` is served by your site at that URL. For many apps, that means copying the \`${params.outputDir}\` folder into the app's public/static assets folder before deployment.
158
+
159
+ ## Step 6: Test
160
+
161
+ Load the page from an allowed origin and send a non-PHI test message. If the embed cannot connect, run:
162
+
163
+ \`\`\`bash
164
+ npx @nexalink/carecompass-sdk doctor --config ${params.configPath}
165
+ \`\`\`
166
+ `;
167
+ async function assertHostedConfig(config, apiKey) {
168
+ const origin = config.allowedOrigins[0];
169
+ const url = endpointUrl(config.apiBaseUrl, "/api/carecompass/embed/config/validate");
170
+ let response;
171
+ try {
172
+ response = await globalThis.fetch(url, {
173
+ method: "POST",
174
+ headers: configHeaders(config, apiKey, origin),
175
+ body: JSON.stringify({ config: runtimeConfig(config) }),
176
+ });
177
+ }
178
+ catch (error) {
179
+ const message = error instanceof Error ? error.message : "Network request failed";
180
+ throw new Error(`Could not reach CareCompass API at ${url}. If apiBaseUrl is localhost, make sure the Nexalink Next.js app and integrating page are both running locally. Hosted sandboxes cannot reach your machine's localhost. ${message}`);
181
+ }
182
+ const text = await response.text();
183
+ let payload = {};
184
+ try {
185
+ payload = text ? JSON.parse(text) : {};
186
+ }
187
+ catch {
188
+ payload = {};
189
+ }
190
+ if (!response.ok || payload.ok === false) {
191
+ const detail = payload.error ??
192
+ (response.status === 404
193
+ ? "The CareCompass embed API route was not found at this apiBaseUrl. Deploy the web app routes or point apiBaseUrl at an environment that includes them."
194
+ : text.slice(0, 240) || "CareCompass API validation failed.");
195
+ throw new Error(`Hosted CareCompass API validation failed (${response.status}) for ${url}: ${detail}`);
43
196
  }
44
- return credentials;
45
197
  }
46
198
  function readConfig(path) {
47
199
  const parsed = JSON.parse(readFileSync(path, "utf8"));
@@ -49,7 +201,7 @@ function readConfig(path) {
49
201
  if (!validation.ok) {
50
202
  throw new Error(`Invalid CareCompass config:\n${validation.errors.join("\n")}`);
51
203
  }
52
- return validation.config;
204
+ return resolvePromptFile(validation.config, path);
53
205
  }
54
206
  function buildInitConfig(flags) {
55
207
  const origins = flags.origin;
@@ -62,7 +214,7 @@ function buildInitConfig(flags) {
62
214
  payerId: flagString(flags, "payer-id") ?? "payer-demo",
63
215
  environment: flagString(flags, "environment") ??
64
216
  "staging",
65
- apiBaseUrl: flagString(flags, "api-base-url") ?? "https://api.nexalink.care",
217
+ apiBaseUrl: flagString(flags, "api-base-url") ?? DEFAULT_API_BASE_URL,
66
218
  embedKey: flagString(flags, "embed-key") ?? "embed_demo_1234567890",
67
219
  allowedOrigins,
68
220
  branding: {
@@ -70,6 +222,12 @@ function buildInitConfig(flags) {
70
222
  logoUrl: flagString(flags, "logo-url"),
71
223
  supportUrl: flagString(flags, "support-url") ?? "https://example-payer.com/support",
72
224
  },
225
+ prompt: {
226
+ systemInstructionFile: flagString(flags, "system-prompt-file") ?? `./${DEFAULT_PROMPT_PATH}`,
227
+ welcomeMessage: flagString(flags, "welcome-message") ??
228
+ "How can I help you navigate your care today?",
229
+ allowUserContext: flags["allow-user-context"] === true,
230
+ },
73
231
  theme: {
74
232
  primaryColor: flagString(flags, "primary-color") ?? "#2563eb",
75
233
  backgroundColor: flagString(flags, "background-color") ?? "#ffffff",
@@ -83,12 +241,23 @@ function buildInitConfig(flags) {
83
241
  function printHelp(io) {
84
242
  io.stdout.write(`CareCompass SDK CLI
85
243
 
86
- Commands:
244
+ Run one-off commands with npx:
245
+ npx @nexalink/carecompass-sdk login --api-key <key>
246
+ npx @nexalink/carecompass-sdk init --payer-id <id> --origin <url>
247
+ npx @nexalink/carecompass-sdk validate --config carecompass/carecompass.config.json
248
+ npx @nexalink/carecompass-sdk snippet --config carecompass.config.json
249
+ npx @nexalink/carecompass-sdk doctor --config carecompass.config.json
250
+
251
+ If installed globally or run from a package script:
87
252
  carecompass login --api-key <key>
88
253
  carecompass init [--payer-id <id>] [--origin <url>]
89
- carecompass validate --config carecompass.config.json
90
- carecompass snippet --config carecompass.config.json [--output embed.html]
91
- carecompass doctor --config carecompass.config.json
254
+
255
+ Commands:
256
+ login --api-key <key>
257
+ init [--payer-id <id>] [--origin <url>] [--output-dir carecompass]
258
+ validate --config carecompass.config.json [--local-only]
259
+ snippet --config carecompass.config.json [--output embed.html] [--snippet-mode bundler|cdn]
260
+ doctor --config carecompass.config.json
92
261
  `);
93
262
  }
94
263
  export async function runCareCompassCli(argv = process.argv.slice(2), io = {
@@ -97,16 +266,16 @@ export async function runCareCompassCli(argv = process.argv.slice(2), io = {
97
266
  env: process.env,
98
267
  }) {
99
268
  try {
100
- const { command, flags } = parseArgs(argv);
269
+ const { command, flags, positionals } = parseArgs(argv);
101
270
  if (command === "help" || command === "--help" || command === "-h") {
102
271
  printHelp(io);
103
272
  return 0;
104
273
  }
105
274
  if (command === "login") {
106
- const apiKey = flagString(flags, "api-key");
275
+ const apiKey = flagString(flags, "api-key") ?? positionals[0];
107
276
  if (!apiKey) {
108
277
  const signupUrl = flagString(flags, "signup-url") ?? DEFAULT_SIGNUP_URL;
109
- io.stderr.write(`Missing --api-key. Create a Nexalink payer account or request SDK access at ${signupUrl}\n`);
278
+ io.stderr.write(`Missing --api-key. Create a Nexalink account or request SDK access at ${signupUrl}\n`);
110
279
  return 1;
111
280
  }
112
281
  const credentialsPath = resolveCredentialsPath(io.env);
@@ -116,27 +285,88 @@ export async function runCareCompassCli(argv = process.argv.slice(2), io = {
116
285
  }
117
286
  if (command === "init") {
118
287
  requireApiKey(flags, io);
119
- const output = flagString(flags, "output") ?? DEFAULT_CONFIG_PATH;
120
- if (existsSync(output) && flags.force !== true) {
121
- throw new Error(`${output} already exists. Re-run with --force to overwrite.`);
288
+ const outputDir = flagString(flags, "output-dir") ?? DEFAULT_OUTPUT_DIR;
289
+ const output = flagString(flags, "output") ??
290
+ join(outputDir, "carecompass.config.json");
291
+ const snippetOutput = flagString(flags, "snippet-output") ??
292
+ join(outputDir, "carecompass-embed.html");
293
+ const iframeOutput = flagString(flags, "iframe-output") ??
294
+ join(outputDir, "carecompass-iframe.html");
295
+ const setupGuideOutput = flagString(flags, "setup-guide-output") ?? join(outputDir, "README.md");
296
+ const promptOutput = join(outputDir, DEFAULT_PROMPT_PATH);
297
+ const iframeSrc = flagString(flags, "iframe-src") ??
298
+ `/${outputDir.replace(/^\/+|\/+$/g, "")}/carecompass-embed.html`;
299
+ for (const path of [
300
+ output,
301
+ snippetOutput,
302
+ iframeOutput,
303
+ setupGuideOutput,
304
+ promptOutput,
305
+ ]) {
306
+ if (existsSync(path) && flags.force !== true) {
307
+ throw new Error(`${path} already exists. Re-run with --force to overwrite.`);
308
+ }
122
309
  }
310
+ mkdirSync(outputDir, { recursive: true });
123
311
  const config = buildInitConfig(flags);
124
312
  writeFileSync(output, `${JSON.stringify(config, null, 2)}\n`);
125
- io.stdout.write(`Wrote ${output}\n`);
313
+ writeFileSync(promptOutput, `${DEFAULT_SYSTEM_PROMPT}\n`);
314
+ const resolvedConfig = readConfig(output);
315
+ writeFileSync(snippetOutput, `${generateCareCompassSnippet(runtimeConfig(resolvedConfig), {
316
+ mode: snippetMode(flags),
317
+ })}\n`);
318
+ writeFileSync(iframeOutput, `${generateCareCompassIframeSnippet(runtimeConfig(resolvedConfig), {
319
+ src: iframeSrc,
320
+ })}\n`);
321
+ writeFileSync(setupGuideOutput, setupGuide({
322
+ config,
323
+ outputDir,
324
+ configPath: output,
325
+ promptPath: promptOutput,
326
+ embedPath: snippetOutput,
327
+ iframePath: iframeOutput,
328
+ iframeSrc,
329
+ }));
330
+ io.stdout.write(`CareCompass setup kit created in ${outputDir}/
331
+
332
+ Step 1: Review config
333
+ ${output}
334
+
335
+ Step 2: Edit the customer-approved system prompt
336
+ ${promptOutput}
337
+
338
+ Step 3: Serve the generated embed page from your site
339
+ ${snippetOutput}
340
+
341
+ Step 4: Place this iframe where the CareCompass LLM should appear
342
+ ${iframeOutput}
343
+
344
+ Step 5: Follow the generated setup guide
345
+ ${setupGuideOutput}
346
+
347
+ Next command:
348
+ npx @nexalink/carecompass-sdk validate --config ${output}
349
+ `);
126
350
  return 0;
127
351
  }
128
352
  if (command === "validate") {
129
353
  const credentials = requireApiKey(flags, io);
130
354
  const config = readConfig(flagString(flags, "config") ?? DEFAULT_CONFIG_PATH);
355
+ if (flags["local-only"] !== true) {
356
+ await assertHostedConfig(config, credentials.apiKey);
357
+ }
131
358
  io.stdout.write(`CareCompass config is valid for ${config.payerId}. Credentials loaded from ${credentials.source}.\n`);
132
359
  return 0;
133
360
  }
134
361
  if (command === "snippet") {
135
362
  requireApiKey(flags, io);
136
363
  const config = readConfig(flagString(flags, "config") ?? DEFAULT_CONFIG_PATH);
137
- const snippet = generateCareCompassSnippet(config);
138
- const output = flagString(flags, "output");
364
+ const snippet = generateCareCompassSnippet(runtimeConfig(config), {
365
+ mode: snippetMode(flags),
366
+ });
367
+ const output = flagString(flags, "output") ?? DEFAULT_SNIPPET_PATH;
139
368
  if (output) {
369
+ mkdirSync(dirname(output), { recursive: true });
140
370
  writeFileSync(output, `${snippet}\n`);
141
371
  io.stdout.write(`Wrote ${output}\n`);
142
372
  }
@@ -148,6 +378,14 @@ export async function runCareCompassCli(argv = process.argv.slice(2), io = {
148
378
  if (command === "doctor") {
149
379
  const credentials = requireApiKey(flags, io);
150
380
  const config = readConfig(flagString(flags, "config") ?? DEFAULT_CONFIG_PATH);
381
+ let hostedStatus = "not checked";
382
+ try {
383
+ await assertHostedConfig(config, credentials.apiKey);
384
+ hostedStatus = "reachable and authorized";
385
+ }
386
+ catch (error) {
387
+ hostedStatus = error.message;
388
+ }
151
389
  io.stdout.write(`CareCompass SDK doctor
152
390
  Package manager: npm/npx, pnpm, Yarn, and Bun compatible
153
391
  Payer: ${config.payerId}
@@ -155,6 +393,7 @@ Environment: ${config.environment}
155
393
  API base URL: ${config.apiBaseUrl}
156
394
  Allowed origins: ${config.allowedOrigins.join(", ")}
157
395
  Credentials: ${credentials.source}
396
+ Hosted API: ${hostedStatus}
158
397
  Status: ready for staging verification
159
398
  `);
160
399
  return 0;
@@ -167,7 +406,8 @@ Status: ready for staging verification
167
406
  }
168
407
  }
169
408
  const isMainModule = () => Boolean(process.argv[1]) &&
170
- realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
409
+ realpathSync(fileURLToPath(import.meta.url)) ===
410
+ realpathSync(process.argv[1]);
171
411
  if (isMainModule()) {
172
412
  void runCareCompassCli().then((code) => {
173
413
  process.exitCode = code;
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,GAE1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAa1D,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AACtD,MAAM,kBAAkB,GAAG,0CAA0C,CAAC;AAEtE,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,CAAC,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACzC,MAAM,KAAK,GAAwB,EAAE,CAAC;IAEtC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QA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= new URL(value);
5
+ return url.hostname === "localhost" || url.hostname === "127.0.0.1";
6
+ }
7
+ catch {
8
+ return false;
9
+ }
10
+ };
11
+ const isBrowserHostedAwayFromLocalhost = (apiBaseUrl) => {
12
+ if (typeof window === "undefined")
13
+ return false;
14
+ if (!isLocalhostUrl(apiBaseUrl))
15
+ return false;
16
+ return (window.location.hostname !== "localhost" &&
17
+ window.location.hostname !== "127.0.0.1");
18
+ };
2
19
  export function createCareCompassClient(config, options = {}) {
3
20
  const fetcher = options.fetcher ?? fetch;
4
21
  const headers = {
@@ -7,6 +24,18 @@ export function createCareCompassClient(config, options = {}) {
7
24
  "x-carecompass-embed-key": config.embedKey,
8
25
  "x-carecompass-environment": config.environment,
9
26
  };
27
+ async function send(input, init) {
28
+ if (isBrowserHostedAwayFromLocalhost(config.apiBaseUrl)) {
29
+ throw new Error(`CareCompass apiBaseUrl is ${config.apiBaseUrl}, but this page is running at ${window.location.origin}. A hosted sandbox or remote site cannot reach your local Next.js server. Use a deployed Nexalink API base URL, or run both the integrating page and Nexalink web app locally on the same machine.`);
30
+ }
31
+ try {
32
+ return await fetcher(input, init);
33
+ }
34
+ catch (error) {
35
+ const message = error instanceof Error ? error.message : "Network request failed";
36
+ throw new Error(`CareCompass could not reach ${config.apiBaseUrl}. Confirm apiBaseUrl, CORS, allowedOrigins, and Nexalink hosted API configuration. ${message}`);
37
+ }
38
+ }
10
39
  async function parseJson(response) {
11
40
  const body = (await response.json().catch(() => ({})));
12
41
  if (!response.ok) {
@@ -16,7 +45,7 @@ export function createCareCompassClient(config, options = {}) {
16
45
  }
17
46
  return {
18
47
  validateConfig: async () => {
19
- const response = await fetcher(joinUrl(config.apiBaseUrl, "/api/carecompass/embed/config/validate"), {
48
+ const response = await send(joinUrl(config.apiBaseUrl, "/api/carecompass/embed/config/validate"), {
20
49
  method: "POST",
21
50
  headers,
22
51
  body: JSON.stringify({ config }),
@@ -24,7 +53,7 @@ export function createCareCompassClient(config, options = {}) {
24
53
  return parseJson(response);
25
54
  },
26
55
  ask: async (request) => {
27
- const response = await fetcher(joinUrl(config.apiBaseUrl, "/api/carecompass/embed/ask"), {
56
+ const response = await send(joinUrl(config.apiBaseUrl, "/api/carecompass/embed/ask"), {
28
57
  method: "POST",
29
58
  headers,
30
59
  body: JSON.stringify({
@@ -37,7 +66,7 @@ export function createCareCompassClient(config, options = {}) {
37
66
  return parseJson(response);
38
67
  },
39
68
  status: async (jobId) => {
40
- const response = await fetcher(joinUrl(config.apiBaseUrl, `/api/carecompass/embed/status/${encodeURIComponent(jobId)}`), { headers });
69
+ const response = await send(joinUrl(config.apiBaseUrl, `/api/carecompass/embed/status/${encodeURIComponent(jobId)}`), { headers });
41
70
  return parseJson(response);
42
71
  },
43
72
  };
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,IAAY,EAAE,EAAE,CAChD,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC;AAE1C,MAAM,UAAU,uBAAuB,CACrC,MAAyB,EACzB,UAAiC,EAAE;IAEnC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC;IACzC,MAAM,OAAO,GAAG;QACd,cAAc,EAAE,kBAAkB;QAClC,wBAAwB,EAAE,MAAM,CAAC,OAAO;QACxC,yBAAyB,EAAE,MAAM,CAAC,QAAQ;QAC1C,2BAA2B,EAAE,MAAM,CAAC,WAAW;KAChD,CAAC;IAEF,KAAK,UAAU,SAAS,CAAI,QAAkB;QAC5C,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAEpD,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC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,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,SAAS,EAAE,OAAO,CAAC,SAAS;oBAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;oBAChC,YAAY,EAAE,MAAM,CAAC,MAAM;iBAC5B,CAAC;aACH,CACF,CAAC;YACF,OAAO,SAAS,CAAyB,QAAQ,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CACzB,OAAO,CACL,MAAM,CAAC,UAAU,EACjB,iCAAiC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAC7D,EACD,EAAE,OAAO,EAAE,CACZ,CAAC;YACF,OAAO,SAAS,CAA4B,QAAQ,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,6 @@ export { createCareCompassClient } from "./client.js";
2
2
  export type { CareCompassAskRequest, CareCompassAskResponse, CareCompassStatusResponse, } from "./client.js";
3
3
  export { CareCompassEmbed } from "./component.js";
4
4
  export { mountCareCompass } from "./mount.js";
5
- export { generateCareCompassSnippet } from "./snippet.js";
5
+ export { generateCareCompassIframeSnippet, generateCareCompassSnippet, } from "./snippet.js";
6
6
  export { careCompassConfigSchema, createDefaultCareCompassConfig, validateCareCompassConfig, } from "./schema.js";
7
7
  export type { CareCompassConfig, CareCompassLabels, CareCompassPromptConfig, CareCompassTheme, CareCompassValidationResult, } from "./schema.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { createCareCompassClient } from "./client.js";
2
2
  export { CareCompassEmbed } from "./component.js";
3
3
  export { mountCareCompass } from "./mount.js";
4
- export { generateCareCompassSnippet } from "./snippet.js";
4
+ export { generateCareCompassIframeSnippet, generateCareCompassSnippet, } from "./snippet.js";
5
5
  export { careCompassConfigSchema, createDefaultCareCompassConfig, validateCareCompassConfig, } from "./schema.js";
6
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,yBAAyB,GAC1B,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,gCAAgC,EAChC,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,yBAAyB,GAC1B,MAAM,aAAa,CAAC"}
package/dist/schema.d.ts CHANGED
@@ -16,6 +16,7 @@ export declare const careCompassLabelsSchema: z.ZodObject<{
16
16
  }, z.core.$strip>;
17
17
  export declare const careCompassPromptConfigSchema: z.ZodObject<{
18
18
  systemInstruction: z.ZodOptional<z.ZodString>;
19
+ systemInstructionFile: z.ZodOptional<z.ZodString>;
19
20
  welcomeMessage: z.ZodDefault<z.ZodString>;
20
21
  allowUserContext: z.ZodDefault<z.ZodBoolean>;
21
22
  }, z.core.$strip>;
@@ -63,6 +64,7 @@ export declare const careCompassConfigSchema: z.ZodObject<{
63
64
  }, z.core.$strip>>;
64
65
  prompt: z.ZodDefault<z.ZodObject<{
65
66
  systemInstruction: z.ZodOptional<z.ZodString>;
67
+ systemInstructionFile: z.ZodOptional<z.ZodString>;
66
68
  welcomeMessage: z.ZodDefault<z.ZodString>;
67
69
  allowUserContext: z.ZodDefault<z.ZodBoolean>;
68
70
  }, z.core.$strip>>;
package/dist/schema.js CHANGED
@@ -51,6 +51,7 @@ export const careCompassLabelsSchema = z.object({
51
51
  export const careCompassPromptConfigSchema = z
52
52
  .object({
53
53
  systemInstruction: z.string().min(20).max(4000).optional(),
54
+ systemInstructionFile: z.string().min(1).max(240).optional(),
54
55
  welcomeMessage: z
55
56
  .string()
56
57
  .min(1)
@@ -120,7 +121,7 @@ export function createDefaultCareCompassConfig(overrides = {}) {
120
121
  return careCompassConfigSchema.parse({
121
122
  payerId: "payer-demo",
122
123
  environment: "staging",
123
- apiBaseUrl: "https://api.nexalink.care",
124
+ apiBaseUrl: "https://www.nexalink.care",
124
125
  embedKey: "embed_demo_1234567890",
125
126
  allowedOrigins: ["https://example-payer.com"],
126
127
  branding: {
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,YAAY,GAAG,sCAAsC,CAAC;AAC5D,MAAM,WAAW,GAAG,kCAAkC,CAAC;AACvD,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAEhD,MAAM,oBAAoB,GAAG;IAC3B,sDAAsD;IACtD,wCAAwC;IACxC,yCAAyC;IACzC,0CAA0C;IAC1C,8CAA8C;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,EAAE;KACR,GAAG,CAAC,qCAAqC,CAAC;KAC1C,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;KAC3C,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;IAChB,MAAM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2B;QACvC,QAAQ,EAAE,uBAAuB;QACjC,cAAc,EAAE,CAAC,2BAA2B,CAAC;QAC7C,QAAQ,EAAE;YACR,WAAW,EAAE,qBAAqB;YAClC,UAAU,EAAE,mCAAmC;SAChD;QACD,KAAK,EAAE;YACL,YAAY,EAAE,SAAS;YACvB,eAAe,EAAE,SAAS;YAC1B,SAAS,EAAE,SAAS;YACpB,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,uBAAuB;SACpC;QACD,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,EAAE;QACV,SAAS,EAAE,EAAE;QACb,gBAAgB,EAAE,KAAK;QACvB,GAAG,SAAS;KACb,CAAC,CAAC;AACL,CAAC"}
package/dist/snippet.d.ts CHANGED
@@ -1,2 +1,8 @@
1
1
  import type { CareCompassConfig } from "./schema.js";
2
- export declare function generateCareCompassSnippet(config: CareCompassConfig): string;
2
+ export type CareCompassSnippetMode = "bundler" | "cdn";
3
+ export declare function generateCareCompassIframeSnippet(config: CareCompassConfig, options?: {
4
+ src?: string;
5
+ }): string;
6
+ export declare function generateCareCompassSnippet(config: CareCompassConfig, options?: {
7
+ mode?: CareCompassSnippetMode;
8
+ }): string;
package/dist/snippet.js CHANGED
@@ -1,8 +1,21 @@
1
- export function generateCareCompassSnippet(config) {
1
+ export function generateCareCompassIframeSnippet(config, options = {}) {
2
+ const src = options.src ?? "/carecompass/carecompass-embed.html";
3
+ const title = `${config.branding.displayName} CareCompass`;
4
+ return `<iframe
5
+ title="${title.replaceAll('"', "&quot;")}"
6
+ src="${src.replaceAll('"', "&quot;")}"
7
+ style="width: 100%; min-height: 640px; border: 0; border-radius: ${config.theme.borderRadius};"
8
+ loading="lazy"
9
+ ></iframe>`;
10
+ }
11
+ export function generateCareCompassSnippet(config, options = {}) {
2
12
  const targetId = "carecompass-root";
13
+ const moduleUrl = options.mode === "cdn"
14
+ ? "https://esm.sh/@nexalink/carecompass-sdk"
15
+ : "@nexalink/carecompass-sdk";
3
16
  return `<div id="${targetId}"></div>
4
17
  <script type="module">
5
- import { mountCareCompass } from "@nexalink/carecompass-sdk";
18
+ import { mountCareCompass } from "${moduleUrl}";
6
19
 
7
20
  const config = ${JSON.stringify(config, null, 2)};
8
21
  mountCareCompass(document.getElementById("${targetId}"), config);
@@ -1 +1 @@
1
- {"version":3,"file":"snippet.js","sourceRoot":"","sources":["../src/snippet.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,0BAA0B,CAAC,MAAyB;IAClE,MAAM,QAAQ,GAAG,kBAAkB,CAAC;IACpC,OAAO,YAAY,QAAQ;;;;mBAIV,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;8CACJ,QAAQ;UAC5C,CAAC;AACX,CAAC"}
1
+ {"version":3,"file":"snippet.js","sourceRoot":"","sources":["../src/snippet.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,gCAAgC,CAC9C,MAAyB,EACzB,UAA4B,EAAE;IAE9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,qCAAqC,CAAC;IACjE,MAAM,KAAK,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAc,CAAC;IAC3D,OAAO;WACE,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC;SACjC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC;qEAC+B,MAAM,CAAC,KAAK,CAAC,YAAY;;WAEnF,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,MAAyB,EACzB,UAA6C,EAAE;IAE/C,MAAM,QAAQ,GAAG,kBAAkB,CAAC;IACpC,MAAM,SAAS,GACb,OAAO,CAAC,IAAI,KAAK,KAAK;QACpB,CAAC,CAAC,0CAA0C;QAC5C,CAAC,CAAC,2BAA2B,CAAC;IAClC,OAAO,YAAY,QAAQ;;sCAES,SAAS;;mBAE5B,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;8CACJ,QAAQ;UAC5C,CAAC;AACX,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,23 @@
1
1
  {
2
2
  "name": "@nexalink/carecompass-sdk",
3
- "version": "0.1.0-beta.1",
4
- "description": "Embeddable CareCompass SDK and CLI for payer-whitelabeled deployments.",
3
+ "version": "0.1.0-beta.11",
4
+ "description": "Embeddable CareCompass SDK and CLI for healthcare ecosystem integrations with Nexalink onboarding, BAA coverage, and API keys.",
5
5
  "type": "module",
6
+ "homepage": "https://nexalink.care",
7
+ "keywords": [
8
+ "carecompass",
9
+ "nexalink",
10
+ "payer",
11
+ "healthcare",
12
+ "embed",
13
+ "sdk",
14
+ "react",
15
+ "cli",
16
+ "llm"
17
+ ],
18
+ "sideEffects": false,
6
19
  "bin": {
7
- "carecompass": "./dist/cli.js"
20
+ "carecompass": "dist/cli.js"
8
21
  },
9
22
  "main": "./dist/index.js",
10
23
  "types": "./dist/index.d.ts",
@@ -24,8 +37,12 @@
24
37
  },
25
38
  "files": [
26
39
  "dist",
27
- "README.md"
40
+ "README.md",
41
+ "LICENSE"
28
42
  ],
43
+ "engines": {
44
+ "node": ">=18"
45
+ },
29
46
  "scripts": {
30
47
  "build": "tsc -p tsconfig.json"
31
48
  },