Skip to content

Instantly share code, notes, and snippets.

@thenamankumar
Last active October 15, 2024 15:50
Show Gist options
  • Save thenamankumar/3708f084fb2abd57adafe7f14620bdf7 to your computer and use it in GitHub Desktop.
Save thenamankumar/3708f084fb2abd57adafe7f14620bdf7 to your computer and use it in GitHub Desktop.
export default {
meta() {
return {
name: 'Local Test',
annotations: {},
mentions: {
autoInclude: true
}
};
},
mentions({ uri, autoInclude, codebase }) {
console.log('called', autoInclude, uri, codebase)
if(autoInclude) {
return [
{
title: `Intial Context v2 ${uri?.split('/').pop()}`,
uri: 'https://example.com/local-test.txt',
description: 'From OpenCtx'
}
];
}
return [
{
title: `Mentioned Context 1 ${uri?.split('/').pop()}`,
uri: 'https://example.com/local-test1.txt',
description: 'From OpenCtx'
},
{
title: `Mentioned Context 2 ${uri?.split('/').pop()}`,
uri: 'https://example.com/local-test2.txt',
description: 'From OpenCtx'
},
{
title: `Mentioned Context 3 ${uri?.split('/').pop()}`,
uri: 'https://example.com/local-test3.txt',
description: 'From OpenCtx'
}
];
},
items({ mention }) {
if (mention) {
return [
{
...mention,
url: mention.uri.replace('3','2'),
ai: {
content: 'hello'
}
},
];
}
return [];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment