
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
@ixo/common
Advanced tools
The @ixo/common package serves as a foundational library for the ixo-oracles ecosystem, providing shared utilities, AI capabilities, and core services. It integrates with Matrix for communication and state management, OpenAI for AI capabilities, and provides various tools for document processing and semantic analysis.
# Install using pnpm (recommended)
pnpm install @ixo/common
# Or using npm
npm install @ixo/common
# Or using yarn
yarn add @ixo/common
The package requires several environment variables:
# OpenAI Configuration
OPENAI_API_KEY=your_openai_key
# Matrix Configuration
MATRIX_ORACLE_ADMIN_ACCESS_TOKEN=your_matrix_token
# Optional Tools Configuration
TAVILY_API_KEY=your_tavily_key # For web search capabilities
// Services for Matrix room and session management
import {
RoomManagerService,
SessionManagerService,
} from '@ixo/common/services';
// Initialize services
const sessionManager = new SessionManagerService();
const roomManager = new RoomManagerService();
// Create or get a Matrix room
const roomId = await roomManager.getOrCreateRoom({
did: 'user-did',
oracleName: 'oracle-name',
userAccessToken: 'matrix-token',
});
// Manage chat sessions
const session = await sessionManager.createSession({
did: 'user-did',
oracleName: 'oracle-name',
matrixAccessToken: 'matrix-token',
});
// AI utilities
import {
docSplitter,
checkDocRelevance,
createSemanticRouter,
webSearchTool,
} from '@ixo/common/ai';
// Process documents
const chunks = await docSplitter('Long text content...');
// Check document relevance
const isRelevant = await checkDocRelevance({
doc: 'document content',
query: 'search query',
});
// Create semantic routes
const router = createSemanticRouter({
routes: {
generateBlog: 'if the intent is blog',
generatePost: 'if the intent is post',
},
basedOn: ['intent'],
});
The AI module provides a comprehensive suite of AI-powered tools and utilities:
Document Processing
Semantic Routing
Search and Retrieval
Utility Functions
Core services for Matrix integration and state management:
Room Manager
Session Manager
Environment Service
The Environment Service provides a type-safe way to manage and access environment variables in your application. Here's the recommended way to structure and use it:
// src/services/env/schema.ts
import z from 'zod';
export const envSchema = z.object({
NODE_ENV: z.enum(['development', 'production', 'test']),
PORT: z.string().transform(Number),
API_KEY: z.string().min(1),
// Add more environment variables as needed
});
// Export the schema type for type-safety
export type Schema = typeof envSchema;
// src/services/env/env.ts
import { type Schema } from 'zod/v3';
import { EnvService } from './env.service';
const envService = EnvService.getInstance<Schema>();
export default envService;
// src/main.ts or src/app.ts
import { EnvService } from '@ixo/common/services/env';
import { envSchema } from './services/env/schema';
async function bootstrap() {
// Initialize environment service first
EnvService.initialize(envSchema);
// Now you can start your application
const app = express();
// ... rest of your application setup
}
bootstrap();
// Any file where you need env variables - use the singleton instance you created in your app
import env from './services/env/env';
// Type-safe environment usage
const port = env.get('PORT'); // TypeScript knows this is a number
const apiKey = env.get('API_KEY'); // TypeScript knows this is a string
// Example usage in a service
export class DatabaseService {
constructor() {
this.connect({
port: env.get('PORT'),
apiKey: env.get('API_KEY'),
});
}
}
This pattern provides several benefits:
Detailed documentation is available in the docs directory:
Internal package - All rights reserved.
FAQs
Unknown package
We found that @ixo/common 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.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.