
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@plasius/ai
Advanced tools
Plasius AI functions providing chatbot, text-to-speech, speech-to-text, and AI-generated images and videos
AI capability contracts, completion schemas, and agentic foundation contracts for Plasius applications.
This package currently provides:
AICapability, AIPlatform)ChatCompletion, ImageCompletion, ModelCompletion, etc.)Provider wiring and runtime adapters are documented in docs/providers.md.
npm install @plasius/ai
This package publishes dual ESM and CJS artifacts.
When CJS output is emitted under dist-cjs/*.js with type: module, dist-cjs/package.json is generated with { "type": "commonjs" } to ensure Node require(...) compatibility.
import {
AICapability,
type AIPlatform,
completionSchema,
chatCompletionSchema,
} from "@plasius/ai";
const capabilities = [AICapability.Chat, AICapability.Image];
void capabilities;
void completionSchema;
void chatCompletionSchema;
// Host apps provide the concrete runtime implementation.
const platform: AIPlatform = {
chatWithAI: async () => ({
id: crypto.randomUUID(),
partitionKey: "user-1",
type: "chat",
model: "gpt-4.1-mini",
durationMs: 42,
createdAt: new Date().toISOString(),
message: "Hello world",
outputUser: "assistant",
}),
synthesizeSpeech: async () => {
throw new Error("Not implemented");
},
transcribeSpeech: async () => {
throw new Error("Not implemented");
},
generateImage: async () => {
throw new Error("Not implemented");
},
produceVideo: async () => {
throw new Error("Not implemented");
},
generateModel: async () => {
throw new Error("Not implemented");
},
checkBalance: async () => ({
id: crypto.randomUUID(),
partitionKey: "user-1",
type: "balance",
model: "",
durationMs: 0,
createdAt: new Date().toISOString(),
balance: 0,
}),
currentBalance: 0,
};
void platform;
AICapability: enum describing logical capability routing.AIPlatform: interface your runtime adapter must implement.AI_FEATURE_FLAGSAI_AGENTIC_FOUNDATION_ROLLOUTcreateAITaskKindcreateAIRequestEnveloperesolveAIRolloutDecisionAIProviderDescriptorAIModelCatalogEntryAIUsageMetricsAICostEstimateAIConfidenceScoreAICapabilityAdapterAdapterPlatformPropsHttpClientPolicycreateAdapterPlatformcreateOpenAIAdaptercreateGeminiAdaptercreateGrokAdaptercreateMetaAIAdaptercreatePixelverseAdapterVideoProviderAdapterVideoGenerationRequestcreateHttpVideoProviderAdapterVideoProviderPlatformcreateVideoProviderPlatform
platform.repo-hardening-sweep.enabledpixelverseEnGbTranslationspixelverseTranslationKeystranslatePixelverseTextCompletion + typed completion variants:
ChatCompletionTextCompletionImageCompletionSpeechCompletionVideoCompletionModelCompletionBalanceCompletioncompletionSchemachatCompletionSchematextCompletionSchemaimageCompletionSchemaspeechCompletionSchemavideoCompletionSchemamodelCompletionSchemabalanceCompletionSchemaCompletion schemas validate persisted records, including the internal partitionKey used to associate requests with a user or system actor. When returning completion payloads to clients, prefer completionSchema.serialize(...) so internal fields stay out of the default response shape.
docs/architecture.mddocs/api-reference.mddocs/providers.mdsrc/index.ts; internal src/** files remain implementation details unless they are explicitly re-exported.@plasius/ai-* packages.import {
AICapability,
createAdapterPlatform,
createGeminiAdapter,
createGrokAdapter,
createMetaAIAdapter,
createOpenAIAdapter,
createPixelverseAdapter,
} from "@plasius/ai";
const openAIAdapter = createOpenAIAdapter({
id: "openai",
httpPolicy: {
maxAttempts: 3,
timeoutMs: 30000,
baseDelayMs: 250,
maxDelayMs: 4000,
jitterRatio: 0.2,
},
defaultModels: {
chat: "gpt-4.1-mini",
speech: "gpt-4o-mini-tts",
transcription: "gpt-4o-mini-transcribe",
image: "gpt-image-1",
model: "gpt-4.1-mini",
},
});
const geminiAdapter = createGeminiAdapter({
id: "gemini",
httpPolicy: {
maxAttempts: 3,
timeoutMs: 30000,
},
defaultModels: {
chat: "gemini-2.0-flash",
image: "imagen-3.0-generate-002",
model: "gemini-2.0-flash",
},
});
const grokAdapter = createGrokAdapter();
const metaAdapter = createMetaAIAdapter();
const pixelverseAdapter = createPixelverseAdapter();
const platform = await createAdapterPlatform("user-1", {
adapters: [openAIAdapter, geminiAdapter, grokAdapter, metaAdapter, pixelverseAdapter],
apiKeys: {
openai: process.env.OPENAI_API_KEY ?? "",
gemini: process.env.GEMINI_API_KEY ?? "",
grok: process.env.XAI_API_KEY ?? "",
"meta-ai": process.env.META_AI_API_KEY ?? "",
pixelverse: process.env.PIXELVERSE_API_KEY ?? "",
},
defaultAdapterByCapability: {
[AICapability.Chat]: "grok",
[AICapability.Speech]: "openai",
[AICapability.Image]: "gemini",
[AICapability.Model]: "gemini",
[AICapability.Video]: "pixelverse",
[AICapability.Balance]: "pixelverse",
},
});
void platform;
import { completionSchema } from "@plasius/ai";
const persistedCompletion = {
id: "completion-1",
type: "chat",
model: "gpt-4.1-mini",
durationMs: 42,
createdAt: new Date().toISOString(),
partitionKey: "user-1",
};
const publicPayload = completionSchema.serialize(persistedCompletion);
// partitionKey is omitted by default.
void publicPayload;
import {
AI_FEATURE_FLAGS,
createAIRequestEnvelope,
createAITaskKind,
resolveAIRolloutDecision,
} from "@plasius/ai";
const rollout = resolveAIRolloutDecision(
{
featureFlag: AI_FEATURE_FLAGS.agenticFoundation,
evaluator: "remote-flag-service",
defaultEnabled: false,
fallbackMode: "fail-closed",
},
{
[AI_FEATURE_FLAGS.agenticFoundation]: true,
}
);
const envelope = createAIRequestEnvelope({
requestId: "req-1",
taskKind: createAITaskKind({
domain: "routing",
action: "select",
}),
actor: {
actorId: "user-1",
actorType: "user",
},
input: {
prompt: "Choose the cheapest safe model.",
},
});
void rollout;
void envelope;
import {
createHttpVideoProviderAdapter,
createVideoProviderPlatform,
} from "@plasius/ai";
const videoAdapter = createHttpVideoProviderAdapter({
uploadImagePath: "/provider/image/upload",
generateVideoPath: "/provider/video/generate",
getVideoResultPath: (videoId) => `/provider/video/result/${videoId}`,
getBalancePath: "/provider/account/balance",
});
const platform = await createVideoProviderPlatform("user-1", {
apiKey: process.env.PROVIDER_API_KEY ?? "",
adapter: videoAdapter,
});
void platform;
Pixelverse editor components keep their display text in the package-owned en-GB
dictionary and resolve defaults through @plasius/translations. Host
applications can pass a translate function to VideoGenerationEditor or
Balance when they need a different locale while preserving the package
fallbacks.
import type { PixelverseTranslate } from "@plasius/ai";
const translate: PixelverseTranslate = (key, args) => i18n.t(key, args);
<VideoGenerationEditor
apiKey={apiKey}
adapter={videoAdapter}
translate={translate}
/>;
npm install
npm run build
npm test
npm run test:coverage
npm run demo:run
npm run demo:run
This package is published via GitHub CD only.
production with secret NPM_TOKEN..github/workflows/cd.yml via Actions -> CD (Publish to npm) -> Run workflow.patch, minor, major, or none) and optional pre-release id.dist/dist-cjs/dist/*.d.tsMIT
FAQs
Plasius AI functions providing chatbot, text-to-speech, speech-to-text, and AI-generated images and videos
The npm package @plasius/ai receives a total of 190 weekly downloads. As such, @plasius/ai popularity was classified as not popular.
We found that @plasius/ai demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.