I want to add the "user intents" feature to the site. ultrathink about this complex feature and implement it fully and completely. This will introduce a new lexicon type, dashboard settings components, and changes to profile and listing pages.
Lexicon#
This feature uses the user-intents lexicon as defined by:
{
"defs": {
"intention": {
"properties": {
"allow": {
"type": "boolean"
},
"updatedAt": {
"format": "datetime",
"type": "string"
}
},
"required": [
"updatedAt"
],
"type": "object"
},
"main": {
"description": "A declaration of user intent",
"key": "any",
"record": {
"properties": {
"bulkDataset": {
"ref": "#intention",
"type": "ref"
},
"protocolBridging": {
"ref": "#intention",
"type": "ref"
},
"publicAccessArchive": {
"ref": "#intention",
"type": "ref"
},
"syntheticContentGeneration": {
"ref": "#intention",
"type": "ref"
},
"updatedAt": {
"format": "datetime",
"type": "string"
}
},
"type": "object"
},
"type": "record"
}
},
"id": "org.user-intents.declaration",
"lexicon": 1
}
An example record using that lexicon would look like:
{
"$type": "org.user-intents.declaration",
"updatedAt": "2025-02-20T21:37:20.362Z",
"publicAccessArchive": {
"allow": true, // true means "allow"
"updatedAt": "2025-02-20T21:37:20.362Z"
},
"bulkDataset": {
"allow": false, // false means "disallow"
"updatedAt": "2025-02-20T21:37:20.362Z"
},
"protocolBridging": {
// NOTE: missing 'allow' field means "undefined" preference (do not set to 'null')
"updatedAt": "2019-02-20T22:44:20.000Z",
}
}
This lexicon would be created in the @lexicon directory as lexicon/org.user-intents.declaration.json.
An example AT-URI is at://did:plc:cbkjy5n7bk3ax2wplmtjofq2/org.user-intents.declaration/self. Another would be at://did:plc:cbkjy5n7bk3ax2wplmtjofq2/org.user-intents.declaration/did:web:atwork.place referencing use within the https://atwork.place/ website.
Storage#
Create a storage trait and implementations for the user intents structure with the following fields:
aturi(string, primary key) The AT-URI of the user intents recordcid(string) The record's CIDdid(string) The DID from the authority component of the AT-URIpublic_access_archive(bool, default null) The value of thepublicAccessArchiverecord structure'sallowfield.protocol_bridging(bool, default null) The value of theprotocolBridgingrecord structure'sallowfield.synthetic_content_generation(bool, default null) The value of thesyntheticContentGenerationrecord structure'sallowfield.record(JSON) the raw record as it exists in the PDS
The storage trait should support the following operations:
- Insert/Update (upsert) a user-intents record in storage
- Get user-intents record by AT-URI
- Get all user-intents records for a DID
Consumer#
Update the jetstream consumer to also subscribe to the org.user-intents.declaration collection. When a record is encountered, it should discard any that have a record key other than "self" or "did:web:atwork.place".
These records should be inserted / updated (upserted) into storage.
Dashboard Settings#
On the dashboard settings page, create a section for "experimental" features.
In the experimental features section, create a form that allows a user to update their user-intents record for both "self" and "did:web:atwork.place". This will result in two records being created, each with the record key being "self" and "did:web:atwork.place"".
For each of the following value and label pairs, have a radio that lets them be set to "allow", "disallow", or "no preference".
bulkDatasetas "Bulk Datasets" -- Allow data to be included in bulk "snapshot" datasets which are publicly redistributed, even if only for a fixed time period.protocolBridgingas "Protocol Bridging" -- Allow for bridging account data or interactions into distinct social web protocol ecosystems.publicAccessArchiveas "Archiving / Preservation" -- Allow public access to or replay of account data as part of archiving and preservation efforts.
Profile Page#
Update the /u/[subject] page to support this feature. All of the user-intents records are retreived from storage for an identity and intentions aggregated in the order of "self" and then "did:web:atwork.place" values.
If the aggregated publicAccessArchive field is false then add the following content to the <head>...</head> section of the page:
<meta name="robots" content="noarchive">
Job Listing Page#
Update the /u/[subject]/[listing] page to support this feature. All of the user-intents records are retreived from storage for an identity and intentions aggregated in the order of "self" and then "did:web:atwork.place" values.
If the aggregated publicAccessArchive field is false then add the following content to the <head>...</head> section of the page:
<meta name="robots" content="noarchive">
Help Content#
Create a help page at /help/user-intents. Note that this is an experimental feature based on the proposal at https://github.com/bluesky-social/proposals/tree/main/0008-user-intents.
Explain that a user can set these values through the dashboard settings page in the experimental features section.