Skip to content

Commit

Permalink
Auto include hello world mentions (#200)
Browse files Browse the repository at this point in the history
Update the hello world example to auto-include mentions and consume
active editor uri in example
  • Loading branch information
thenamankumar authored Sep 3, 2024
1 parent 50490a4 commit b2f1b82
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/protocol/src/openctx-protocol.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"type": "string"
},
"autoInclude": {
"description": "Whether to automatically include the returned mention items as initial context for new messages.",
"description": "EXPERIMENTAL: Whether to automatically include the returned mention items as initial context for new messages.",
"type": "boolean"
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/protocol/src/openctx-protocol.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface MetaResult {
*/
label?: string
/**
* Whether to automatically include the returned mention items as initial context for new messages.
* EXPERIMENTAL: Whether to automatically include the returned mention items as initial context for new messages.
*/
autoInclude?: boolean
}
Expand Down
1 change: 1 addition & 0 deletions provider/hello-world/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('helloWorld', () => {
name: '✨ Hello World!',
annotations: {},
items: { messageSelectors: [{ pattern: '.*' }] },
mentions: { autoInclude: true },
}))

test('annotations', () =>
Expand Down
5 changes: 4 additions & 1 deletion provider/hello-world/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const helloWorld: Provider = {
return {
name: '✨ Hello World!',
annotations: {},
mentions: {
autoInclude: true,
},
items: {
messageSelectors: [{ pattern: '.*' }],
},
Expand All @@ -30,7 +33,7 @@ const helloWorld: Provider = {
mentions(params: MentionsParams, settings: ProviderSettings): MentionsResult {
return [
{
title: '✨ Hello, world!',
title: `hello_world.${params.uri?.split('/').pop() || 'openctx'}`,
uri: 'https://openctx.org',
description: 'From OpenCtx',
},
Expand Down
2 changes: 1 addition & 1 deletion provider/hello-world/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openctx/provider-hello-world",
"version": "0.0.16",
"version": "0.0.17",
"description": "Hello World (OpenCtx provider)",
"license": "Apache-2.0",
"homepage": "https://openctx.org/docs/providers/hello-world",
Expand Down
2 changes: 1 addition & 1 deletion web/content/docs/protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ interface MetaResult {
*/
label?: string
/**
* Whether to automatically include the returned mention items as initial context for new messages.
* EXPERIMENTAL: Whether to automatically include the returned mention items as initial context for new messages.
*/
autoInclude?: string
}
Expand Down

0 comments on commit b2f1b82

Please sign in to comment.