-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
channels: custom extension, configuration and post types #4109
base: release-channels-updates
Are you sure you want to change the base?
Changes from 1 commit
4cb5c2c
2c7f207
722eadc
610b741
798afdf
0bea522
64c21c2
d94a427
24835d0
3eae578
840cfb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,14 +172,23 @@ export type KindDataChat = { | |
chat: null | { notice: null }; | ||
}; | ||
|
||
export type KindData = KindDataDiary | KindDataChat | KindDataHeap; | ||
export type Kind = 'heap' | 'diary' | 'chat'; | ||
export type KindDataCustom = { | ||
custom: string; | ||
}; | ||
|
||
export type KindData = | ||
| KindDataDiary | ||
| KindDataChat | ||
| KindDataHeap | ||
| KindDataCustom; | ||
export type Kind = 'heap' | 'diary' | 'chat' | 'custom'; | ||
|
||
export interface PostEssay { | ||
content: Story; | ||
author: Ship; | ||
sent: number; | ||
'kind-data': KindData; | ||
blob: PostMetadataSchemaV1 | null; | ||
} | ||
|
||
export type Post = { | ||
|
@@ -336,6 +345,11 @@ export interface Channel { | |
order: string[]; | ||
sort: SortMode; | ||
pending: PendingMessages; | ||
hooks: Hooks; | ||
metadata: { | ||
data: ChannelMetadataSchema | null; | ||
revision: number; | ||
}; | ||
} | ||
|
||
export interface Channels { | ||
|
@@ -357,6 +371,53 @@ export interface Perm { | |
group: Flag; | ||
} | ||
|
||
interface Bot { | ||
nickname?: string; | ||
avatar?: string; | ||
origin?: string; | ||
agent: string; | ||
} | ||
|
||
interface PostMetadataSchemaV1 { | ||
type: string; | ||
bot?: Bot; | ||
rendererOverride?: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we have an immediate use for this? i think it'll definitely be nice to have, but maybe we should defer until we need it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't I just remember us talking about it, we can remove |
||
} | ||
|
||
interface MessageInput { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my fault – can we change this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep |
||
type: string; | ||
postType: string; | ||
configuration: Record<string, string>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you see in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right yeah, what would the hoon snippets do here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. example: button input, snippet calls out to an LLM API, which gives back a fortune cookie response, which is used as the post body There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another one: audio message, hoon applies a user-defined audio effect over the wavetable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (tbc, i think this means client-side hoon execution to have a decent UX...) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ftr, I changed my mind on this – I still think that Hoon snippets would be great here, but user configuration through parameters seems pretty important. (Is there any chance that JSON values look enough like Hoon expressions? like, if we accept values like |
||
} | ||
|
||
interface ContentRenderer { | ||
render: string; | ||
using: string; | ||
} | ||
|
||
interface ChannelMetadataSchemaV1 { | ||
version: 1; | ||
messageInputs: MessageInput[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thinking out loud: considering array vs dictionary (mapping ID -> if we did a dictionary keyed on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have a strong opinion here because I don't know what the "multiple inputs" UX is going to be. I guess the no-duplicates enforcement isn't that important because we can just do a runtime check. |
||
defaultContentRenderers?: ContentRenderer[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this would be better as a map of post-filter -> renderer; i.e. change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a strong opinion though |
||
defaultPostCollectionRenderer?: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is my fault, but I think we should probably drop the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I don't think we'll have multiple |
||
} | ||
|
||
type ChannelMetadataSchema = ChannelMetadataSchemaV1; | ||
|
||
interface Hook { | ||
version: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: why use a version number instead of a created timestamp? seems like potentially one less thing to keep track of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would think that you'd want to know which iteration of this particular hook is running |
||
name: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: it sounds like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah this is good feedback will change |
||
src: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any point in naming this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's probably going to require other changes to the API anyway so I'd put it off until we get to the point of multiple languages |
||
compiled: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this mean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking we might need some indicator of whether this source code actually compiles or not so we could surface an error that something is wrong with your code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems useful - i read this as "is this code precompiled" - maybe "valid" would be more intuitive? |
||
} | ||
|
||
interface Hooks { | ||
allowed: Hook[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed |
||
transform: Hook[]; | ||
sort: Hook[]; | ||
effect: Hook[]; | ||
} | ||
|
||
export interface ReplyReferenceResponse { | ||
reply: { | ||
'id-post': string; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: in an extreme of the custom channels world, everything will end up with kind
custom
– aesthetically, I wonder if there's another term that we could use to support that. ("user"?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at that point we'd just change our API so that kind-data goes away and we just have a post-type field or w/e.