@polarityinc/polarity 0.3.1

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,48 @@
1
+ # @polarityinc/polarity
2
+
3
+ TypeScript / JavaScript SDK for [Polarity](https://plr.sh) — agent evaluation, sandboxed execution, and LLM observability.
4
+
5
+ This is the **canonical install name**. It's a thin alias that re-exports
6
+ the API surface from `@polarityinc/polarity-keystone`. Both names refer
7
+ to the same package; use whichever feels right.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @polarityinc/polarity
13
+ # or: bun add @polarityinc/polarity
14
+ ```
15
+
16
+ ## Quickstart
17
+
18
+ ```ts
19
+ import { Polarity, traced } from '@polarityinc/polarity';
20
+ import OpenAI from 'openai';
21
+
22
+ const plr = new Polarity();
23
+ const client = plr.wrap(new OpenAI());
24
+
25
+ const run = traced('workflow', async (prompt: string) => {
26
+ return client.chat.completions.create({
27
+ model: 'gpt-4o-mini',
28
+ messages: [{ role: 'user', content: prompt }],
29
+ });
30
+ });
31
+
32
+ await run('hello world');
33
+ ```
34
+
35
+ Traces appear at https://app.polarity.so.
36
+
37
+ ## Configuration
38
+
39
+ | Env var | Purpose |
40
+ | --- | --- |
41
+ | `POLARITY_API_KEY` | Required. Get one at https://app.polarity.so |
42
+ | `POLARITY_BASE_URL` | Optional. Defaults to `https://api.plr.sh` |
43
+
44
+ Legacy `KEYSTONE_*` env vars continue to work indefinitely.
45
+
46
+ ## More
47
+
48
+ Full docs at https://docs.polarity.so.
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ // @polarityinc/polarity — alias for @polarityinc/polarity-keystone.
2
+ // All exports come from the canonical package; this file just
3
+ // re-exports them so editors and type-checkers see the same surface.
4
+
5
+ export * from "@polarityinc/polarity-keystone";
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ // @polarityinc/polarity — alias for @polarityinc/polarity-keystone.
2
+ // Re-exports the entire API surface so consumers can write:
3
+ //
4
+ // import { Polarity } from '@polarityinc/polarity';
5
+ //
6
+ // instead of the longer legacy name. The legacy package continues to
7
+ // work indefinitely; both share the same source on PyPI/npm.
8
+
9
+ module.exports = require("@polarityinc/polarity-keystone");
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@polarityinc/polarity",
3
+ "version": "0.3.1",
4
+ "description": "TypeScript/JavaScript SDK for Polarity — install alias for @polarityinc/polarity-keystone (same package, new name).",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "files": [
8
+ "index.js",
9
+ "index.d.ts",
10
+ "README.md"
11
+ ],
12
+ "scripts": {
13
+ "build": "echo 'metapackage — no build step needed'"
14
+ },
15
+ "keywords": [
16
+ "polarity",
17
+ "llm",
18
+ "observability",
19
+ "tracing",
20
+ "evals",
21
+ "agents"
22
+ ],
23
+ "author": "Polarity <support@polarity.cc>",
24
+ "license": "MIT",
25
+ "homepage": "https://plr.sh",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/Polarityinc/polarity.git",
29
+ "directory": "apps/keystone/sdks/polarity-meta"
30
+ },
31
+ "dependencies": {
32
+ "@polarityinc/polarity-keystone": "^0.3.1"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ }
37
+ }