@picked/client 0.0.1-dev.1787788898336 → 0.0.1-dev.1789541668638

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 (72) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/{api-DU4j3Qw0.js → api-C7q_7vxn.js} +1 -1
  3. package/dist/{api-9gq3GBPF.cjs → api-Ctvh1qkk.cjs} +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  7. package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
  8. package/dist/cjs/plugins/telemetry/index.js +1 -1
  9. package/dist/cjs/server/index.js +1 -1
  10. package/dist/docs/how-to/invite-and-remove-members.md +3 -2
  11. package/dist/docs/reference/dashboard/fields.mdx +17 -11
  12. package/dist/docs/reference/sdk/features.md +5 -0
  13. package/dist/docs/reference/sdk/fields.md +38 -6
  14. package/dist/docs/reference/sdk/type-generation.md +18 -7
  15. package/dist/docs/reference/tools/mcp.md +3 -1
  16. package/dist/esm/index.js +258 -239
  17. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  18. package/dist/esm/plugins/responses-browser-storage/index.js +50 -16
  19. package/dist/esm/plugins/responses-indexeddb/index.js +1 -1
  20. package/dist/esm/plugins/telemetry/index.js +6 -3
  21. package/dist/esm/server/index.js +13 -13
  22. package/dist/{experience-instance-DGk11d8a.js → experience-instance-B9S6Yf0N.js} +302 -154
  23. package/dist/experience-instance-D8rOg6We.cjs +1 -0
  24. package/dist/{plugin-CYXHEafF.js → plugin-ChafFq6S.js} +3 -2
  25. package/dist/{plugin-rwzR9hVc.cjs → plugin-Dn25Gffy.cjs} +1 -1
  26. package/dist/{provider-BWDd3oaq.js → provider-B8wvmeC8.js} +15 -11
  27. package/dist/provider-BBLlQOjV.cjs +1 -0
  28. package/dist/types/client.d.ts +21 -0
  29. package/dist/types/client.d.ts.map +1 -1
  30. package/dist/types/data-source/provider.d.ts +3 -3
  31. package/dist/types/data-source/provider.d.ts.map +1 -1
  32. package/dist/types/data-source/request-observer.d.ts +23 -19
  33. package/dist/types/data-source/request-observer.d.ts.map +1 -1
  34. package/dist/types/entities/experience/experience.d.ts +8 -0
  35. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  36. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  37. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  38. package/dist/types/entities/field/field.d.ts +26 -7
  39. package/dist/types/entities/field/field.d.ts.map +1 -1
  40. package/dist/types/entities/field/policies.d.ts +35 -0
  41. package/dist/types/entities/field/policies.d.ts.map +1 -0
  42. package/dist/types/index.d.ts +1 -0
  43. package/dist/types/index.d.ts.map +1 -1
  44. package/dist/types/lifecycle/lifecycle.d.ts +1 -1
  45. package/dist/types/lifecycle/lifecycle.d.ts.map +1 -1
  46. package/dist/types/picked.d.ts +4 -13
  47. package/dist/types/picked.d.ts.map +1 -1
  48. package/dist/types/plugins/create-experience/create-experience.d.ts +3 -8
  49. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  50. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +11 -0
  51. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  52. package/dist/types/plugins/telemetry/plugin.d.ts +2 -2
  53. package/dist/types/plugins/telemetry/plugin.d.ts.map +1 -1
  54. package/dist/types/utils/client-telemetry.d.ts +25 -0
  55. package/dist/types/utils/client-telemetry.d.ts.map +1 -0
  56. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +16 -6
  57. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  58. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +18 -7
  59. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  60. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +30 -6
  61. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  62. package/dist/types/utils/node-tree/node-adjacency.d.ts +50 -0
  63. package/dist/types/utils/node-tree/node-adjacency.d.ts.map +1 -0
  64. package/dist/types/utils/node-tree/node-tree-index.d.ts +57 -0
  65. package/dist/types/utils/node-tree/node-tree-index.d.ts.map +1 -0
  66. package/dist/{version-BaI_1eQx.cjs → version-CLjPfmxk.cjs} +1 -1
  67. package/dist/{version-DXDZM7eT.js → version-CPKulHMH.js} +2 -2
  68. package/package.json +5 -5
  69. package/dist/experience-instance-Dej3P1sE.cjs +0 -1
  70. package/dist/provider-lgLyP_0N.cjs +0 -1
  71. package/dist/types/ping.d.ts +0 -11
  72. package/dist/types/ping.d.ts.map +0 -1
@@ -56,6 +56,38 @@ export const communicationMethods = createField({
56
56
  })
57
57
  ```
58
58
 
59
+ ## Register fields on the client
60
+
61
+ Register fields when you create the Picked client. Pass a `fields` object. The key of an
62
+ entry becomes the field `key` when the definition does not set one. A definition with its
63
+ own `key` keeps it. Pass a function to build a definition once during the client setup:
64
+
65
+ ```ts
66
+ import { createClient } from 'picked'
67
+
68
+ const client = createClient({
69
+ projectId: 'your-project-id',
70
+ fields: {
71
+ email: {
72
+ id: 'email',
73
+ name: 'email',
74
+ label: 'Email Address',
75
+ type: 'text',
76
+ multiple: false,
77
+ required: true,
78
+ },
79
+ age: () => ({
80
+ id: 'age',
81
+ name: 'age',
82
+ label: 'Age',
83
+ type: 'number',
84
+ multiple: false,
85
+ required: false,
86
+ }),
87
+ },
88
+ })
89
+ ```
90
+
59
91
  ## Field types
60
92
 
61
93
  A field has one of four basic types: `text`, `number`, `boolean`, or `object`.
@@ -136,18 +168,18 @@ const colourField = createField({
136
168
  multiple: false,
137
169
  required: true,
138
170
  policies: {
139
- doNotTrackValue: false, // Send the value to analytics.
140
- doNotStoreValue: false, // Keep the value in browser storage.
171
+ trackValue: true, // Send the value to analytics.
172
+ storeValue: true, // Keep the value in browser storage.
141
173
  },
142
174
  })
143
175
  ```
144
176
 
145
177
  **Privacy policies**:
146
178
 
147
- - `doNotTrackValue`: set it to `false` to put the value of the field in your analytics
148
- events. At `true`, and when the policy is absent, the events carry the field ID only.
149
- - `doNotStoreValue`: set it to `false` to let the SDK put the value in browser storage.
150
- At `true`, and when the policy is absent, the SDK keeps the value out of storage.
179
+ - `trackValue`: set it to `true` to put the value of the field in your analytics events.
180
+ At `false`, and when the policy is absent, the events carry the field ID only.
181
+ - `storeValue`: set it to `true` to let the SDK put the value in browser storage. At
182
+ `false`, and when the policy is absent, the SDK keeps the value out of storage.
151
183
 
152
184
  Both policies keep the value in the browser by default. A field with no `policies`
153
185
  object sends no value to your analytics and writes no value to browser storage. Keep
@@ -119,20 +119,31 @@ The generated `picked-env.d.ts` file looks like:
119
119
 
120
120
  ```typescript
121
121
  // GENERATED by `@picked/typegen` — do not edit by hand.
122
- // source: published `x-picked-version-id`: `ver_456`
123
122
  // Reference: `https://docs.picked.app/reference/sdk/type-generation`
124
123
 
125
- export interface WelcomePage { /* ... */ }
126
- export interface FieldValues { /* ... */ }
127
- export type FeatureKey = 'default' | 'hero' | 'winter-sale'
124
+ export type WelcomePage = { /* ... */ }
125
+ export type FieldValues = { /* ... */ }
126
+ export type FeatureKey =
127
+ | 'default'
128
+ | 'hero'
129
+ | 'winter-sale'
128
130
 
129
131
  declare module '@picked/client' {
130
132
  interface PickedSchemaRegistry {
131
- contentModels: { 'welcome-page': WelcomePage }
132
- stepContentModels: { intro: 'welcome-page' }
133
+ contentModels: {
134
+ 'welcome-page': WelcomePage
135
+ }
136
+ stepContentModels: {
137
+ 'intro': 'welcome-page'
138
+ }
139
+ featureValues: {
140
+ 'hero':
141
+ | false
142
+ | 'hero-a'
143
+ | 'hero-b'
144
+ }
133
145
  fieldValues: FieldValues
134
146
  featureKeys: FeatureKey
135
- featureValues: { hero: false | 'hero-a' | 'hero-b' }
136
147
  }
137
148
  }
138
149
  ```
@@ -15,9 +15,11 @@ Context Protocol (MCP).
15
15
  | Tool | Description |
16
16
  | ------------------------ | ------------------------------------------------------------ |
17
17
  | `list_projects` | Lists your organizations and projects |
18
+ | `list_workspaces` | Lists the workspaces in a project |
18
19
  | `get_workspace_overview` | Reads the full workspace state |
19
20
  | `get_schema_info` | Reads the documentation for Picked concepts and the data model |
20
- | `get_picked_docs` | Reads the complete Picked documentation, as text for an agent |
21
+ | `list_picked_docs` | Lists every Picked documentation page with its URL |
22
+ | `read_picked_doc` | Reads one documentation page, or one section of it |
21
23
 
22
24
  ### Experiences
23
25