Pak-LLM Sovereign Coder SDK
Programmatically lease autonomous AI coding agents, stream AST-safe code, and integrate sovereign pair-programming intelligence into your TypeScript, Node.js, and Python microservices.
agent.ts and execute with npx tsx agent.ts.import { Agent } statements directly into your PowerShell terminal prompt (causes ParserError).node -e "const s=require('@pak-llm/sdk');console.log('SDK Ready!')"// 1. Install via terminal:
// npm install https://coder.pak-llm.com/downloads/packages/pak-llm-sdk-1.2.0.tgz
//
// 2. Save this file as 'agent.ts' and run:
// npx tsx agent.ts (or compile with tsc && node agent.js)
// Note: Do not paste raw import code directly into PowerShell prompt.
import { Agent, LocalAgentConfig, CapabilitiesConfig, extractMultilingualOcr } from '@pak-llm/sdk';
async function main() {
const config: LocalAgentConfig = {
system_instructions: 'You are an autonomous senior software engineer.',
capabilities: {
allowBashExecution: true,
allowFileWrite: true,
sandboxMode: 'isolated',
humanApprovalRequired: true,
},
};
// Sovereign autonomous agent lifecycle with multi-lingual OCR
await Agent.run(config, async (agent) => {
// Optional: Extract multi-lingual OCR from an image / wireframe (Urdu, English, Arabic)
// const ocr = await extractMultilingualOcr('./design_mockup.png');
// console.log("[OCR Extracted]: " + ocr.text + " (Lang: " + ocr.detectedLanguage + ")");
const stream = await agent.chat('Refactor auth middleware to verify HMAC tokens.');
// Stream reasoning thoughts
for await (const thought of stream.thoughts()) {
console.log("[Thinking] " + thought);
}
// Stream generated code tokens
for await (const token of stream) {
process.stdout.write(token);
}
// ── Antigravity Autonomous Workflow ─────────────────────────────
// 1. Research requirements & generate 5-10 clarification questions
const { questions } = await agent.clarify('Build responsive full-stack analytics dashboard');
console.log("[Antigravity Research]: " + questions.length + " questions generated");
// 2. Synthesize structured implementation plan
const plan = await agent.plan({ answers: { q1_arch: 'Next.js 15 App Router', q2_ui: 'Tailwind CSS (White Canvas #FFFFFF)' } });
// 3. Enforce Human-in-the-Loop approval gate before execution
if (plan.requiresApproval) {
const execution = await agent.executePlan(plan.id);
console.log("[Executed]: " + execution.filesCreated.length + " files synthesized");
}
// ── Workspace Diagnostics & Autonomous Error Resolution ─────────
// Scan workspace files for AST syntax errors, broken imports, and secret leaks
const problems = await agent.workspace.diagnose();
console.log("[Diagnostics]: Found " + problems.length + " workspace problems");
if (problems.length > 0) {
// Formulate context-relevant clarifying questions before touching files
const { questions: fixQuestions } = await agent.clarifyFix(problems);
console.log("[Diagnostic Questions]: Formulated " + fixQuestions.length + " clarifying questions");
// Synthesize repair plan with non-bypassable human approval gate
const fixPlan = await agent.planFix(problems, { strategy: 'synthesize_stubs' });
if (fixPlan.requiresApproval) {
const repairResult = await agent.executePlan(fixPlan.id);
console.log("[Repairs Executed]: " + repairResult.filesPatched + " files fixed, 0 errors remaining.");
}
}
});
}
main();Live In-Browser SDK Playground
Test SDK methods against the sovereign runtime directly in your browser. Tokens are metered in real-time.
SDK Pricing Packages & Boost Top-Ups
Identical sovereign pricing tiers apply to the SDK. Metered with automated 50%, 75%, 90%, and 100% exhaustion alerts.
Awam / Free
Community- 1 Active SDK API Key
- 15 Requests / min rate limit
- 1 Concurrent autonomous loop
- Emergency Tranche: +8,333 tokens
Freelancer Pro
Production- 5 Active SDK API Keys
- 60 Requests / min rate limit
- 4 Concurrent autonomous loops
- Emergency Tranche: +500,000 tokens
Agency Enterprise
Enterprise- 25 Active SDK API Keys
- 240 Requests / min rate limit
- 16 Concurrent autonomous loops
- Emergency Tranche: +2,000,000 tokens
Sprint Boost (5M Tokens)
Pro Scale (15M Tokens)
Studio Fortress (50M Tokens)
Sovereign Autonomous Agent Pattern
Programmatic leasing through async context managers with real-time thought streams, tool execution dispatchers, and stateful CodeAct iteration loops.
Islamic Shariah Compliance
Prohibits Riba, gambling, fraud, and obscenity by design. Every prompt is verified by the Sovereign Security Sentinel with automated incident segregation.
Zero Remote Code Retention
In-flight AST secret redaction strips API tokens and passwords. User proprietary code is strictly never retained or utilized for upstream model training.
Pak-LLM Coder SDK — Frequently Asked Questions
Essential information on programmatic integration, Islamic ethics, and telemetry.
The Pak-LLM Coder SDK (@pak-llm/sdk for Node.js/TypeScript and pakllm-coder for Python) is a sovereign developer toolkit built on advanced autonomous agent loops. It enables programmatic leasing of autonomous software engineering agents, real-time thought/token streaming, AST safety validation, and automated CodeAct tool execution within your pipelines.