@comty.io/core 0.1.7 → 0.1.8

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 CHANGED
@@ -37,12 +37,15 @@ import { initComty } from '@comty.io/core';
37
37
 
38
38
  await initComty({
39
39
  projectKey: 'YOUR_PROJECT_KEY',
40
- apiUrl: 'https://YOUR_COMTY_API',
41
40
  });
42
41
  ```
43
42
 
44
43
  Call once from your application entry. Server rendering is safe: it does nothing until called in a browser. Repeated calls with the same options reuse the document's instance. Reload the page to change its project or API URL. Register the site's domain in Comty to use shared comments.
45
44
 
45
+ The project key is the only required option for hosted Comty. The SDK connects to `https://api.comty.io` by default, including when your application runs on localhost. You do not need an API URL environment variable or your own Comty server. Set `apiUrl` only when using a different Comty API, such as `http://localhost:4000` for developing Comty itself or the URL of a self-hosted installation.
46
+
47
+ The browser entry also works in production. If Comty should only appear in development or preview, conditionally call `initComty` in your application. To include production, do not guard initialization with a development-only flag. The Vite companion below is a separate development-only integration.
48
+
46
49
  ## Color tokens
47
50
 
48
51
  Element inspection shows a copyable CSS custom-property name above foreground/background colors when the winning declaration can be identified. It handles ordinary selectors, `:where()`, inline styles, inheritance, `!important`, active media/supports rules and named top-level cascade layers. Semantic aliases retain their declared name. No extra line is rendered for literal colors or uncertain provenance (including inaccessible stylesheets, shadow/scoped or nested cascades, and unsupported functional selectors).
@@ -81,7 +84,7 @@ export default defineConfig({
81
84
  });
82
85
  ```
83
86
 
84
- Keep your existing plugins. Run your normal dev command and open `http://localhost:<vite-port>`. The plugin injects the SDK and starts the companion automatically. It is disabled for production builds. Choose the installed coding agent with `agent: 'codex' | 'claude' | 'cursor' | 'gemini' | 'grok'`. The optional `model` setting accepts a model ID from the selected agent; omit it to use that agent's default. A project key is optional in local Agent mode; set `projectKey` and `apiUrl` in the plugin options if you also want shared Comty comments.
87
+ Keep your existing plugins. Run your normal dev command and open `http://localhost:<vite-port>`. The plugin injects the SDK and starts the companion automatically. It is disabled for production builds. Choose the installed coding agent with `agent: 'codex' | 'claude' | 'cursor' | 'gemini' | 'grok'`. The optional `model` setting accepts a model ID from the selected agent; omit it to use that agent's default. A project key is optional in local Agent mode; set `projectKey` in the plugin options if you also want shared Comty comments. Set `apiUrl` only for a local or self-hosted Comty API.
85
88
 
86
89
  ## Other development servers
87
90
 
package/comty-sdk.js CHANGED
@@ -3585,7 +3585,7 @@ function initComty(options = {}) {
3585
3585
  } catch { return Promise.reject(new TypeError("Comty: companion must share the page origin")); }
3586
3586
  }
3587
3587
  const projectKey = options.projectKey || (agent ? "local" : undefined);
3588
- const apiUrl = options.apiUrl || "http://localhost:4000";
3588
+ const apiUrl = options.apiUrl || "https://api.comty.io";
3589
3589
  if (typeof projectKey !== "string" || !projectKey.trim()) {
3590
3590
  return Promise.reject(new TypeError("Comty: projectKey is required"));
3591
3591
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comty.io/core",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Comty visual comments, inspector and local agent tools",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
package/src/browser.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export interface ComtyOptions {
2
2
  /** Project key from your Comty dashboard. */
3
3
  projectKey?: string;
4
- /** Absolute URL of your Comty API. Defaults to http://localhost:4000. */
4
+ /** Defaults to https://api.comty.io. Override for a local or self-hosted Comty API. */
5
5
  apiUrl?: string;
6
6
  /** Set automatically by comty dev; not needed in application code. */
7
7
  agent?: { url: string; token: string };
package/src/browser.js CHANGED
@@ -21,7 +21,7 @@ export function initComty(options = {}) {
21
21
  } catch { return Promise.reject(new TypeError("Comty: companion must share the page origin")); }
22
22
  }
23
23
  const projectKey = options.projectKey || (agent ? "local" : undefined);
24
- const apiUrl = options.apiUrl || "http://localhost:4000";
24
+ const apiUrl = options.apiUrl || "https://api.comty.io";
25
25
  if (typeof projectKey !== "string" || !projectKey.trim()) {
26
26
  return Promise.reject(new TypeError("Comty: projectKey is required"));
27
27
  }