@picked/client 0.0.56-next.1 → 0.0.56

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.
Files changed (52) hide show
  1. package/dist/api-BfVRVGAR.cjs +1 -0
  2. package/dist/{api-CNxyQeRM.js → api-CTjJzTQT.js} +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  5. package/dist/docs/actions.md +58 -0
  6. package/dist/docs/api/index.md +32 -0
  7. package/dist/docs/api-keys.md +33 -0
  8. package/dist/docs/conditions.md +52 -0
  9. package/dist/docs/experiences.md +33 -0
  10. package/dist/docs/features.md +51 -0
  11. package/dist/docs/fields.md +70 -0
  12. package/dist/docs/flow-builder/building-flows.md +61 -0
  13. package/dist/docs/flow-builder/condition-builder.md +54 -0
  14. package/dist/docs/flow-builder/keyboard-shortcuts.md +66 -0
  15. package/dist/docs/flow-builder/nodes.md +43 -0
  16. package/dist/docs/flow-builder/overview.md +43 -0
  17. package/dist/docs/index.md +79 -0
  18. package/dist/docs/pickedql/data-sources.md +39 -0
  19. package/dist/docs/pickedql/dimensions.md +23 -0
  20. package/dist/docs/pickedql/examples.md +165 -0
  21. package/dist/docs/pickedql/filtering.md +31 -0
  22. package/dist/docs/pickedql/index.md +34 -0
  23. package/dist/docs/pickedql/schema.md +95 -0
  24. package/dist/docs/pickedql/virtual-functions.md +84 -0
  25. package/dist/docs/projects.md +30 -0
  26. package/dist/docs/reference/index.md +11 -0
  27. package/dist/docs/reports.md +11 -0
  28. package/dist/docs/sdk/actions.md +7 -0
  29. package/dist/docs/sdk/conditions.md +131 -0
  30. package/dist/docs/sdk/content-security-policy.md +31 -0
  31. package/dist/docs/sdk/experiences.md +41 -0
  32. package/dist/docs/sdk/features.md +213 -0
  33. package/dist/docs/sdk/fields.md +263 -0
  34. package/dist/docs/sdk/index.md +74 -0
  35. package/dist/docs/sdk/plugins/create-experience.md +133 -0
  36. package/dist/docs/sdk/plugins/dynamic-experiences.md +59 -0
  37. package/dist/docs/sdk/plugins/index.md +9 -0
  38. package/dist/docs/sdk/plugins/window-object.md +20 -0
  39. package/dist/docs/sdk/predicates.md +113 -0
  40. package/dist/docs/sdk/steps.md +411 -0
  41. package/dist/docs/steps.md +35 -0
  42. package/dist/docs/team-management.md +40 -0
  43. package/dist/docs/tooling/chrome-extension.md +29 -0
  44. package/dist/docs/tooling/gtm-template.md +69 -0
  45. package/dist/docs/tooling/index.md +19 -0
  46. package/dist/docs/tooling/mcp.md +120 -0
  47. package/dist/docs/tooling/vite-plugin.md +82 -0
  48. package/dist/docs/workspaces.md +35 -0
  49. package/dist/esm/index.js +1 -1
  50. package/dist/esm/plugins/dynamic-experiences/index.js +1 -1
  51. package/package.json +2 -2
  52. package/dist/api-CtE-gT1L.cjs +0 -1
@@ -0,0 +1,120 @@
1
+ ---
2
+ layout: docs
3
+ ---
4
+
5
+ # MCP server
6
+
7
+ Manage your Picked workspace from AI coding tools using the Model Context Protocol (MCP).
8
+
9
+ ## Connecting
10
+
11
+ The server URL is `https://api.picked.app/mcp`.
12
+
13
+ ### Claude Desktop
14
+
15
+ 1. Open **Settings > Connectors > Add custom connector**
16
+ 2. Set **Name** to `Picked` and **URL** to `https://api.picked.app/mcp`
17
+ 3. Click **Connect** and complete the authorization prompt
18
+
19
+ ### Project configuration (.mcp.json)
20
+
21
+ Add to your repository root. Works with Claude Code, Cursor, Windsurf, and other MCP-compatible tools.
22
+
23
+ :::code-group
24
+
25
+ ```json [.mcp.json]
26
+ {
27
+ "mcpServers": {
28
+ "picked": {
29
+ "type": "http",
30
+ "url": "https://api.picked.app/mcp"
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ :::
37
+
38
+ ### Cursor
39
+
40
+ Add to `.cursor/mcp.json` in your project root:
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "picked": {
46
+ "type": "http",
47
+ "url": "https://api.picked.app/mcp"
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ ## Available tools
54
+
55
+ ### Discovery
56
+
57
+ | Tool | Description |
58
+ | ------------------------ | ------------------------------------------------------------ |
59
+ | `list_projects` | List organizations and projects |
60
+ | `get_workspace_overview` | Full workspace state |
61
+ | `get_schema_info` | Documentation for Picked concepts and data model |
62
+ | `get_picked_docs` | Fetch the complete Picked documentation (LLM-optimized text) |
63
+
64
+ ### Experiences
65
+
66
+ | Tool | Description |
67
+ | ------------------------ | ----------------------------------------------------------------------------------------- |
68
+ | `create_experience` | Create an experience |
69
+ | `get_experience` | Get experience details including flow graph |
70
+ | `list_experiences` | List experiences |
71
+ | `update_experience_flow` | Atomically create, update, or delete steps, conditions, actions, fields, nodes, and edges |
72
+
73
+ ### Steps, fields, conditions, and actions
74
+
75
+ | Tool | Description |
76
+ | ----------------------------------- | --------------- |
77
+ | `get_step` / `list_steps` | Read steps |
78
+ | `get_field` / `list_fields` | Read fields |
79
+ | `get_condition` / `list_conditions` | Read conditions |
80
+ | `get_action` / `list_actions` | Read actions |
81
+
82
+ ### Features
83
+
84
+ | Tool | Description |
85
+ | ---------------- | -------------------------------------------------- |
86
+ | `create_feature` | Create a feature |
87
+ | `get_feature` | Get feature details |
88
+ | `list_features` | List features |
89
+ | `update_feature` | Update name, description, enabled state, or weight |
90
+
91
+ ### Analytics
92
+
93
+ | Tool | Description |
94
+ | ---------------- | ---------------------------------------------------------------- |
95
+ | `query_pickedql` | Execute a PickedQL analytics query and return results as a table |
96
+
97
+ Use `get_schema_info` with topic `pickedql` to see available tables, virtual functions, and dimension columns before writing queries.
98
+
99
+ ### Publishing
100
+
101
+ | Tool | Description |
102
+ | ------------------- | ---------------------------------------------- |
103
+ | `get_preview_url` | Generate a preview URL for unpublished changes |
104
+ | `publish_workspace` | Publish the workspace |
105
+
106
+ ## Example prompts
107
+
108
+ - "List my Picked projects and show me what's configured"
109
+ - "Create a feature flag called 'new-checkout' enabled at 50% traffic"
110
+ - "Create an experience with a step that collects email addresses"
111
+ - "Show me control vs variant users by device for the last 30 days"
112
+ - "Generate a preview URL for my workspace on https://example.com"
113
+
114
+ ## Tips
115
+
116
+ - Ask your agent to list your projects first, then explore your workspace to see what's configured.
117
+ - When building complex experiences, ask your agent about flow graphs and JSON Logic — it can look up the documentation for you.
118
+ - Experience flow updates are atomic — your agent can create steps, fields, nodes, and edges in a single operation.
119
+ - Preview your changes on your site before publishing to verify everything looks right.
120
+ - Ask your agent to query analytics data with PickedQL — it can look up the schema, write the SQL, and explain the results.
@@ -0,0 +1,82 @@
1
+ ---
2
+ layout: docs
3
+ ---
4
+
5
+ # Vite Plugin
6
+
7
+ `@picked/vite-plugin-picked` integrates Picked into your Vite project. It fetches your project configuration at build time and injects it via Vite's `define`, eliminating the runtime API request. During development it also serves a launcher page for previewing experiences with feature overrides.
8
+
9
+ ## Installation
10
+
11
+ :::code-group
12
+
13
+ ```bash [npm]
14
+ npm install @picked/vite-plugin-picked
15
+ ```
16
+
17
+ ```bash [pnpm]
18
+ pnpm add @picked/vite-plugin-picked
19
+ ```
20
+
21
+ ```bash [yarn]
22
+ yarn add @picked/vite-plugin-picked
23
+ ```
24
+
25
+ :::
26
+
27
+ ## Setup
28
+
29
+ Add the plugin to your `vite.config.ts`:
30
+
31
+ ```typescript
32
+ import { defineConfig } from 'vite'
33
+ import { picked } from '@picked/vite-plugin-picked'
34
+
35
+ export default defineConfig({
36
+ plugins: [
37
+ picked({
38
+ projectId: 'your-project-id',
39
+ }),
40
+ ],
41
+ })
42
+ ```
43
+
44
+ ## How It Works
45
+
46
+ ### Build-Time Config Injection
47
+
48
+ When Vite starts (both `dev` and `build`), the plugin:
49
+
50
+ 1. Fetches your project configuration from the Picked API
51
+ 2. Embeds the config directly into your bundle
52
+ 3. The SDK reads the embedded config at runtime, skipping the network request
53
+
54
+ When a preview token is present at runtime, the SDK ignores the build-time config and fetches fresh data from the API.
55
+
56
+ ### Dev Launcher
57
+
58
+ During development, the plugin serves an HTML page at `/` that lets you:
59
+
60
+ - See all features in your project with their current status
61
+ - Toggle features on/off for local testing
62
+ - Preview experiences with specific feature overrides
63
+
64
+ After the dev server starts, the launcher URL appears alongside Vite's native output:
65
+
66
+ ```
67
+ ➜ Picked: http://localhost:5173/
68
+ ➜ Local: http://localhost:5173/
69
+ ➜ Network: use --host to expose
70
+ ```
71
+
72
+ ## Options
73
+
74
+ | Option | Type | Default | Description |
75
+ | ---------------- | --------- | ---------------------------- | -------------------------------------------------------- |
76
+ | `projectId` | `string` | — | **Required.** Your Picked project ID. |
77
+ | `apiUrl` | `string` | `https://api.picked.app` | Custom API URL for self-hosted or local API instances. |
78
+ | `disableLauncher`| `boolean` | `false` | Disable the launcher page in both dev and build output. |
79
+
80
+ ## Build Output
81
+
82
+ When building for production (`vite build`), the plugin emits an `index.html` file containing the launcher page (unless `disableLauncher` is set). This lets you deploy the launcher alongside your application for stakeholder previews.
@@ -0,0 +1,35 @@
1
+ ---
2
+ layout: docs
3
+ ---
4
+
5
+ # Workspaces
6
+
7
+ A workspace is a version of your project's configuration. Use workspaces to stage changes, preview them, and publish when ready.
8
+
9
+ ## How workspaces work
10
+
11
+ Each project has a workspace that holds your experiences, features, and entity configurations. When you make changes in the dashboard — editing a flow, updating a feature, or modifying an entity — those changes exist in the workspace until you publish.
12
+
13
+ ## Preview
14
+
15
+ Preview your workspace to see how changes look before publishing.
16
+
17
+ 1. Click **Preview** in the workspace toolbar.
18
+ 2. Enter the URL of your site.
19
+ 3. Optionally override individual features — set each to **Default**, **On**, or **Off**.
20
+ 4. Click **Open Preview**.
21
+
22
+ Your site opens in a new tab with the unpublished workspace applied. Preview uses query parameters to pass the workspace state to the SDK, so visitors on your live site are unaffected.
23
+
24
+ ## Publish
25
+
26
+ Publishing creates an immutable snapshot of your workspace. Once published, the SDK serves the new configuration to visitors.
27
+
28
+ 1. Click **Publish** in the workspace toolbar.
29
+ 2. Confirm in the publish dialog.
30
+
31
+ The publish button is only enabled when there are unpublished changes. A status badge in the toolbar shows whether the workspace has unpublished changes or is up to date.
32
+
33
+ ## Unpublished changes
34
+
35
+ The workspace tracks whether any changes have been made since the last publish. If you create or update an experience, feature, or entity after the last publish, the toolbar shows a warning badge indicating unpublished changes.
package/dist/esm/index.js CHANGED
@@ -4,7 +4,7 @@ import { t as r } from "../logger-6z_gb4rA.js";
4
4
  import { a as i, c as a, d as o, i as s, l as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h } from "../supports-0XIfd4-R.js";
5
5
  import { a as g, c as _, i as v, l as ee, n as te, o as ne, r as re, s as y } from "../experience-instance-DffMstSs.js";
6
6
  import { i as ie, n as b, r as x, t as S } from "../storage-6Xk0uAxB.js";
7
- import { n as ae, r as oe } from "../api-CNxyQeRM.js";
7
+ import { n as ae, r as oe } from "../api-CTjJzTQT.js";
8
8
  import { t as se } from "../id-CRqy981z.js";
9
9
  import { attach as C, combine as w, createApi as T, createDomain as E, createEffect as D, createEvent as O, createStore as k, sample as A } from "effector";
10
10
  import { createFactory as j, invoke as M } from "@withease/factories";
@@ -1,5 +1,5 @@
1
1
  import "../../../logger-6z_gb4rA.js";
2
- import { i as e, t } from "../../../api-CNxyQeRM.js";
2
+ import { i as e, t } from "../../../api-CTjJzTQT.js";
3
3
  //#region src/plugins/dynamic-experiences/hash.ts
4
4
  function n(e) {
5
5
  let t = 2166136261;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/client",
3
- "version": "0.0.56-next.1",
3
+ "version": "0.0.56",
4
4
  "dependencies": {
5
5
  "@withease/factories": "^1.0.5"
6
6
  },
@@ -140,7 +140,7 @@
140
140
  },
141
141
  "private": false,
142
142
  "scripts": {
143
- "build": "vite build",
143
+ "build": "vite build && node scripts/copy-docs.js",
144
144
  "build:docs": "pnpm typedoc",
145
145
  "check": "pnpm type-check && pnpm lint && pnpm knip && pnpm jscpd",
146
146
  "dev": "vite build --watch",
@@ -1 +0,0 @@
1
- var e=`Picked-Client`,t=`Picked-Version`;function n(n,r){return{[e]:n,[t]:r}}var r=()=>`0.0.56-next.1`,i=`v1`;function a(e,t){return new URL(`/api/${i}/${t}`,e).toString()}function o(e){return{...n(`sdk`,r()),...e}}async function s(e,t,n){let r=a(e,t);return fetch(r,{headers:o(n)})}async function c(e,t,n,r){let i=a(e,t);return fetch(i,{method:`POST`,headers:{"Content-Type":`application/json`,...o(r)},body:JSON.stringify(n)})}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});