
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
intelli-buddy
Advanced tools
This package provides helpers for working with code and documentation.
To understand why it is needed and what problems it can solve, please see the examples folder.
Files *.input.[ext] - templates that are received as input.
Files *.output.[ext] - corresponding processed files.
npm i intelli-buddy
Make an .ai-config.json
in the root of your project.
You can connect the json schema. It should help you to make a valid config:
{
"$schema": "node_modules/intelli-buddy/ai-config.schema.json"
}
Then you should fill the config. You can look at the ai-config.example.json and at the config structure for more explanations
Function accepts a path to the template file as input. Optionally, as a second argument, you can specify whether to display diffs or immediately overwrite the file.
To be able to highlight areas that need processing when working with files, it was decided to support the tag {{#ai}}any content{{/ai}}.
For example, tag without any attrivutes will correct grammar errors in the text:
{{#ai}}Inside the tags is the content that needs processing{{/ai}}
The tag supports attributes for specifying prompts.
Attribute for translating text. E.g. this content will be translated into the Russian language:
{{#ai lang="ru"}}Text for translation{{/ai}}
Custom language support is implemented through the configuration file:
// .ai-config.json
{
"langs": {
"pt": "portuguese"
}
}
The content will be translated into the Portuguese language:
// **/[fileName].[ext]
{{#ai lang="pt"}}Text for improvement{{/ai}}
An attribute in which you can write your own prompt. For example, this content will be translated into the Portuguese language:
{{#ai prompt="translate text to portuguese"}}Text for translation{{/ai}}
Support for fully custom attributes through the configuration file
// .ai-config.json
{
"prompts": {
"func": "return js function by description:"
}
}
Returns a function that adds up numbers in JavaScript:
// **/your-file.ext
{{#ai func="true"}}summarize numbers{{/ai}}
The function takes content and returns the parsed response from the specified endpoint in the config without support for tag syntax
.ai-config.json
structureConfig provides 4 top-level fields:
{
"request": {},
"response": {},
"prompts": {},
"langs": {}
}
request
field structureProvides 4 fields for a request building
{
"url": "string",
"method": "post",
"headers": {
"Auth": "token"
},
"body": {
"foo": "{{prompt}}",
}
}
{{prompt}}
response
field structureProvides 4 fields with information for response parsing
{
"contentPath": "path.to.content",
"errorPath": "path.to.error",
"statusCodePath": "path.tp.statusCode",
"successStatus": [200, 201]
}
prompts
field structureDictionary where both key and value are strings
{
"func": "Generate js function by description:"
}
After adding entries, you have the ability to use custom attributes in the tag:
{{#ai func="true"}}Summation of numbers{{/ai}}
A function for summing numbers in JavaScript will be generated, as specified in our prompt.
langs
field structureDictionary where both key and value are strings
{
"pt": "portuguese"
}
After adding a custom language, you have the ability to specify its key in the lang
attribute
{{#ai lang="pt"}}Text for translation{{/ai}}
Text will be translated into portuguese
FAQs
Your Smart Coding Friend
We found that intelli-buddy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.