golem-call-from-external-moonbit

Generate typed MoonBit client SDKs for calling Golem agents from external applications.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-call-from-external-moonbit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-call-from-external-moonbit
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/moonbit/golem-call-from-external-moonbit
Command: npx skills add https://github.com/golemcloud/golem --skill golem-call-from-external-moonbit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Calling Golem agents from outside the Golem platform normally requires hand-writing REST API calls and manually serializing agent types. This Skill generates fully typed MoonBit bridge SDKs so external MoonBit CLI tools and native applications can invoke agents with compile-time type safety.

Core Features & Use Cases

  • Manifest-Driven SDK Generation: Declare a bridge section in golem.yaml and let golem build produce a self-contained MoonBit module per agent type.
  • Fully Typed Client: Generated constructors and async methods map agent parameters and return types to MoonBit types, including records, variants, multimodal inputs, and unstructured text/binary.
  • Advanced Invocation Patterns: Supports phantom agents, fire-and-forget triggers, scheduled invocations, and per-instance configuration overrides.
  • Use Case: You have a Golem agent deployed and want a standalone MoonBit CLI to call it. Add the bridge config, run golem build, add the generated module as a local path dependency, and invoke typed agent methods from an async fn main.

Quick Start

Generate a MoonBit bridge SDK for my Golem agents and show me how to call an agent from an external MoonBit application.

Frequently Asked Questions about golem-call-from-external-moonbit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call Golem agents from an external MoonBit application?

Add a bridge section to golem.yaml specifying the moonbit target and agents, then run golem build to generate a typed client module. Add the generated module as a local path dependency in moon.mod.json and call its async constructors and methods.

How to generate a MoonBit bridge SDK for Golem agents?

Declare bridge.moonbit.external in golem.yaml with agents set to "*" or a list of agent names, then run golem build --yes. The SDK is emitted per agent type into the configured outputDir or golem-temp/bridge-sdk/moonbit/ by default.

Does the MoonBit bridge work with agents written in other languages?

Yes, the bridge target language is independent of the agent's source language. The generated MoonBit client communicates with the Golem server REST API, so it works for agents written in Rust, TypeScript, Scala, or MoonBit.

What MoonBit target and dependencies does the generated client require?

The generated module builds for the native target and depends only on moonbitlang/async (pinned at 0.21.2) and the MoonBit core library. Your external project should set preferred-target to native and import moonbitlang/async for the async fn main entry point.

Can I schedule or fire-and-forget agent invocations from MoonBit?

Yes, each generated method has trigger_ and schedule_ variants alongside the awaiting call. trigger_ enqueues the invocation without waiting for a result, and schedule_ takes an RFC 3339 timestamp followed by the method parameters.

When should I avoid running golem generate-bridge manually?

Avoid invoking golem generate-bridge directly in normal workflows; it exists only as a low-level escape hatch. The manifest-driven golem build flow keeps bridge configuration reproducible and regenerates the client automatically when agents change.