@sanity/assist 1.2.3 → 1.2.4
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
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- [Setup](#setup)
|
|
11
11
|
- [Add the plugin](#add-the-plugin)
|
|
12
12
|
- [Enabling the AI Assist API](#enabling-the-ai-assist-api)
|
|
13
|
+
- [Permissions](#permissions)
|
|
13
14
|
- [Schema configuration](#schema-configuration)
|
|
14
15
|
- [Disable AI Assist for a schema type](#disable-ai-assist-for-a-schema-type)
|
|
15
16
|
- [Disable for a field](#disable-for-a-field)
|
|
@@ -89,6 +90,18 @@ The plugin will now work for any dataset in your project.
|
|
|
89
90
|
|
|
90
91
|
**Note:** You can revoke this token at any time to disable Sanity AI Assist service. A new token has to be generated via the plugin UI for it to work again.
|
|
91
92
|
|
|
93
|
+
### Permissions
|
|
94
|
+
|
|
95
|
+
If your project is using custom roles (Enterprise), there are some additional considerations.
|
|
96
|
+
|
|
97
|
+
To see AI Assist presence when running instructions, users will need read access to
|
|
98
|
+
documents of `_type=="sanity.assist.task.status"`.
|
|
99
|
+
|
|
100
|
+
To edit instructions, users will need read and write access to documents of `_type=="sanity.assist.schemaType.annotations"`.
|
|
101
|
+
|
|
102
|
+
Note that instructions run using the permissions of the user invoking it, so only fields that the user
|
|
103
|
+
themselves can edit can be changed by the instruction instance.
|
|
104
|
+
|
|
92
105
|
## Schema configuration
|
|
93
106
|
|
|
94
107
|
By default, most object, array, and string field types have AI writing assistance enabled. Your assistant can write to all compatible fields that it detects.
|
|
@@ -224,7 +237,7 @@ defineField({
|
|
|
224
237
|
options: {
|
|
225
238
|
captionField: 'caption',
|
|
226
239
|
},
|
|
227
|
-
})
|
|
240
|
+
})
|
|
228
241
|
```
|
|
229
242
|
This will add a "Generate caption" action to the configured field.
|
|
230
243
|
"Generate caption" action will automatically run whenever the image changes.
|
package/dist/index.esm.js
CHANGED
|
@@ -210,7 +210,7 @@ function getBaseFields(schema, type, typeName, options) {
|
|
|
210
210
|
options: imagePromptField ? {
|
|
211
211
|
imagePromptField
|
|
212
212
|
} : void 0,
|
|
213
|
-
values:
|
|
213
|
+
values: ((_b = type == null ? void 0 : type.options) == null ? void 0 : _b.list) ? (_c = type == null ? void 0 : type.options) == null ? void 0 : _c.list.map(v => {
|
|
214
214
|
var _a2;
|
|
215
215
|
return typeof v === "string" ? v : (_a2 = v.value) != null ? _a2 : "".concat(v.title);
|
|
216
216
|
}) : void 0,
|