sunholo Packages
37 packages published by sunholo.
Pure API key validation (SHA-256 hash comparison, constant-time) and bearer token extraction
Load and validate config from environment variables with required/optional/default patterns
Exchange GCP ADC refresh tokens for access tokens, detect default project from gcloud config
Build HTTP requests with auth headers, parse JSON responses, standard error handling
Structured JSON logging (info/warn/err/trace/withFields) via Debug ghost effect. No IO cascade, no effect declarations needed. Zero-cost in release mode. Host filters by --log-level. Cloud Run and log aggregator friendly.
Validate AILANG packages: parse manifest, check exports, compute hashes, generate metadata. Written in AILANG.
Pure assertion helpers for testing: assertEqual, assertContains, assertOk, assertErr
Pure billing policy: plan catalog lookup, entitlement resolution from subscription state, quota checks, usage delta computation. No side effects.
Firestore REST API client for AILANG. CRUD operations (get, set, delete), structured queries, field value encoding/decoding. Uses GCP ADC auth. Designed for Cloud Run services.
Stripe API adapter: create checkout sessions, customer portal sessions, verify webhooks, map events to internal subscription state. Uses Stripe REST API.
Create and manage payment proposals — AI agents propose plan changes, humans approve. Pure state machine for proposal lifecycle.
Firestore CRUD for billing records: customers, subscriptions, entitlements, usage, proposals, events. Built on sunholo/firestore package.
HTTP handlers for billing Cloud Run service. Deploy with 'ailang serve-api'. Checkout, portal, proposals, webhooks, entitlements endpoints.
Minimal test package — used by coordinator integration tests to verify the autonomous publish pipeline
Build A2UI component trees and serialize to flat adjacency-list JSON. Apps define domain-specific mappings; this package provides the primitives and JSON renderer.
WebSocket protocol helpers for Gemini Live API — build setup/text/audio messages, parse responses, configure proactive audio/affective dialog/thinking/VAD. Supports both Vertex AI (2.5) and Google AI Studio (3.1) protocols.
Firebase ID token verification via REST API or local JWT/RSA signature validation
Universal document parsing for Office, PDF, and image formats
Upload large files (PDF, images) for Gemini AI calls. Auto-detects backend: GCS for Vertex AI (ADC), or AI Studio Files API (API key). Returns file URI for use in multimodal AI requests.
Generic GCS operations for AILANG services. Download objects to temp files, initiate resumable uploads (returns pre-authenticated URL for direct client upload), validate and parse gs:// URIs.
Smoke-test dependent of sunholo/test_pkg — exists solely to be bumped by the autonomous cascade in M-PKG-AUTONOMOUS-CASCADE-SAFE smoke tests. Not for production use.
Pure AILANG DuckDB client using std/process. Execute SQL queries against a local .db file, parse JSON results into typed Row maps. No FFI — shells out to the duckdb CLI binary.
Stable ABI contract for motoko_agent extensions. Provides ExtensionHooks record, ExtCtx, BudgetPlan, ToolPolicyDecision, ToolHandleDecision, ResponseInterceptDecision, FinalizeDecision, and VerificationConfig types. All motoko-ext-* packages depend on this package. Bumping ExtensionHooks is a major version bump.
Minimal echo extension for motoko_agent. Passes through all hooks with NoOpinion/Delegate/NoIntercept/NoDecision defaults. Used to validate the generate-extension-registry pipeline.
No description
No description
No description
No description
No description
No description
No description
Prompt-patch extension that injects the four-decision ladder (extension-vs-script, modify-vs-create, publish-where, cascade-aware-self-publish) into motoko's system prompt CONDITIONALLY — only when ctx.task references extension authoring / publishing / motoko self-modification. Pure substring keyword check; no FS, no LLM call, no per-step cost beyond a strcmp. Saves ~700 tokens per step on irrelevant tasks. Canonical example of the context-aware extension pattern (hooks fire every step with full ExtCtx; cheap pure checks gate the patch). Companion to planned motoko-ext-precreate-lint and motoko-ext-publish-guard.
Auto-injects AILANG knowledge retrieval into WriteFile tool results when the model writes a .ail file. The model doesn't call any tool — the ext intercepts WriteFile via on_tool_handle, performs the actual write, runs `ailang micro-rag context` on the content, and returns a combined result so the retrieval is in the model's next-turn history. Non-.ail writes are Delegated to motoko's default handler. Eliminates the weak-model failure mode where the model would have to remember to call a microrag_lookup tool.
AI-powered conversation compaction extension. Uses a cheap model to summarize old turns when context fills up. Implements on_pre_step hook to compact message history.
LinkedIn REST API client. Publish text + image posts on a company page (Net @limit=1, requires text length 1..3000). Read threaded comments (per-post @limit=1, sweep @limit=50). Derive stable pseudonymous personas from actor URNs via SHA-256 — initials + 6-hex avatar seed, IFC-Declassify-typed so the raw URN cannot leak. Credentials live in ~/.ailang/linkedin/credentials.json with automatic OAuth2 refresh.
Wraps the public AILANG docs MCP server (mcp.ailang.sunholo.com/mcp/) as 23 motoko tools: stdlib_search/module/modules, docs_search/nav, examples_*, design_doc(s)_*, benchmarks_*, install/onboarding guides, effects/limitations catalogs, prompt_get, ailang_versions, changelog, roadmap, submit_feedback. Workdir-gated on ailang.toml. Conditional prompt patch encourages lookup-on-demand for the common hallucinated-stdlib-name failure modes. Direct successor to motoko_ext_ailang_hints@0.1.2.
Generic wrapper around std/process.exec for JSON-on-stdout backends (PDF parsers, OCR, embedders, classifiers). Returns Result[Json, BackendError] with ExecFailed/NonZeroExit/InvalidJson variants carrying exit code + stderr. Pure formatError helper for logging. Confines the Process effect so callers stay effect-thin.