
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@portable-content/typescript-sdk
Advanced tools
A framework-agnostic TypeScript SDK for the Portable Content System, providing intelligent content rendering, payload source selection, and type-safe data models.
npm install @portable-content/typescript-sdk
import {
PayloadSourceSelector,
DefaultContentProcessor,
CapabilityDetector,
MockContentFactory
} from '@portable-content/typescript-sdk';
// Detect client capabilities automatically
const detector = new CapabilityDetector();
const capabilities = detector.detectCapabilities();
// Process content for optimal delivery
const processor = new DefaultContentProcessor();
const manifest = MockContentFactory.createContentManifest(); // Or fetch from your API
const optimizedManifest = await processor.processContent(manifest, capabilities);
// Each block now has the best payload source selected for the client
const selector = new PayloadSourceSelector();
const bestSource = selector.selectBestPayloadSource(optimizedManifest.blocks[0], capabilities);
console.log(bestSource); // Best payload source for this client
import { BaseBlockRenderer } from '@portable-content/typescript-sdk';
class MyMarkdownRenderer extends BaseBlockRenderer {
readonly kind = 'markdown';
readonly priority = 1;
async render(block, props, context) {
const payloadSource = this.selectPayloadSource(block, context);
// Render with your framework (React Native, Vue, etc.)
return {
content: renderMarkdownWithMyFramework(payloadSource),
payloadSource
};
}
}
# Install dependencies
npm install
# Run type checking
npm run type-check
# Run tests
npm test
# Build the package
npm run build
# Run linting
npm run lint
npm run build
- Build the package for distributionnpm run test
- Run the test suitenpm run test:coverage
- Run tests with coverage reportnpm run lint
- Run ESLintnpm run format
- Format code with Prettiernpm run type-check
- Run TypeScript type checkingThis SDK is designed with a modular, framework-agnostic architecture:
๐จ Rendering System: Framework-agnostic rendering foundation
VariantSelector
: Intelligent variant selection with network awarenessRendererRegistry
: Priority-based renderer managementContentProcessor
: Content optimization and representation filtering๐ฑ Capability Detection: Automatic client capability detection
๐ง Core Infrastructure:
๐ฏ Production-Ready Quality: Achieved exceptional test coverage with 87.58% overall coverage and near-perfect coverage for critical components:
โ 439 Tests Passing: All green with comprehensive coverage of error scenarios, edge cases, and critical paths โ Zero Issues: Clean ESLint, perfect TypeScript compilation, production-ready reliability
๐จ Universal Styling System - Framework-agnostic styling with adapter pattern
๐ Initial Release - Complete framework-agnostic rendering system
๐ Complete documentation available in the docs/ directory:
๐ Project Information:
Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
FAQs
Core TypeScript SDK for Portable Content System
The npm package @portable-content/typescript-sdk receives a total of 141 weekly downloads. As such, @portable-content/typescript-sdk popularity was classified as not popular.
We found that @portable-content/typescript-sdk 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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.