
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
@workflowai/workflowai
Advanced tools
npm install --save @workflowai/workflowai
import { WorkflowAI } from '@workflowai/workflowai'
const workflowAI = new WorkflowAI({
apiKey: '...', // optional, defaults to process.env.WORKFLOWAI_API_KEY
})
import { z } from '@workflowai/workflowai'
const checkTextFollowInstructions = await workflowAI.compileTask(
{
taskId: 'CheckTextFollowInstructions',
schema: {
id: 5,
input: z.object({
text: z
.string()
.describe(
'The text to check if it follows the instructions in "instructions"',
),
instructions: z
.string()
.describe('The instructions to check if the text follows'),
}),
output: z.object({
isFollowingInstructions: z
.bool()
.describe('Whether the "text" follows all the instructions or not'),
reason: z
.string()
.describe('The reason why the text follows or not the instructions'),
}),
},
},
{
// Default run configuration is optional if passed when runs are created
group: {
id: '...', // Find group IDs in the playground
},
},
)
Use the TaskInput
TypeScript helper to infer the type of a task input.
Another helper, TaskOutput
, can infer the type of what you can expect as result of a task run.
import { TaskInput } from '@workflowai/workflowai'
const input: TaskInput<typeof checkTextFollowInstructions> = {
text: 'The capital of France is Barcelona',
instructions: 'The text must be written in English',
}
const output = await checkTextFollowInstructions(input, {
// Run configuration is optional if defaults were given at task compilation
group: {
id: '2',
},
})
// `output` is of type `TaskOutput<typeof checkTextFollowInstructions>`
console.log(output.isFollowingInstructions) // Boolean, true
console.log(output.reason) // String, "The text is written in English"
FAQs
WorkflowAI JS SDK
The npm package @workflowai/workflowai receives a total of 342 weekly downloads. As such, @workflowai/workflowai popularity was classified as not popular.
We found that @workflowai/workflowai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.