소스 정보
- 저장소
- speakeasy-api/gram
- 최근 소스 활동
- 2026년 2월 12일 23:57
- 감지된 SKILL.md 언어
- 영어
- 스타
- 267
- 포크
- 31
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/speakeasy-api/gram --skill gram-functions명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | gram-functions |
| description | A walkthrough of the Gram Functions feature in this codebase |
| metadata | {"relevant_files":["server/internal/functions/**/*.go","server/internal/background/activities/deploy_function_runners.go","server/internal/background/activities/reap_functions.go","functions/**/*"]} |
Gram Functions is a serverless code execution feature that allows users to deploy custom JavaScript/TypeScript or Python code as callable tools within Gram deployments. Functions can be invoked by AI agents during conversations.
| Package | Purpose |
|---|---|
server/internal/functions/ | Core functions service - deployment, execution, auth |
server/internal/background/activities/ | Temporal activities for deploying/reaping function runners |
server/design/functions/ | Goa API design for functions endpoints |
server/internal/functions/)impl.go - API service, handles signed asset URL requests from runnersdeploy.go - Core interfaces: Deployer, ToolCaller, Orchestratordeploy_fly.go - Fly.io integration via Machines APImanifest.go - Manifest format (ManifestV0) describing exported tools/resourcesruntimes.go - Supported runtime definitions (JS, TS, Python)auth.go - JWT authentication for function runnersqueries.sql - SQL queries for fly_apps table managementserver/internal/background/)activities/deploy_function_runners.go - Deploys runners during deployment processingactivities/reap_functions.go - Cleans up old Fly.io appsactivities/provision_functions_access.go - Creates access credentials for runnersfunctions_reaper.go - Temporal workflow for cleanup (triggered per-project after deployments)functions/)The functions/ directory contains the source code and build configuration for the OCI images that run user functions on Fly.io. These images are built using melange and apko for reproducible, minimal container images.
| File | Purpose |
|---|---|
melange.yaml | Builds the gram-runner Go binary as an APK package |
images/nodejs22-alpine3.22.yaml | apko config for Node.js 22 runtime image |
images/python3.12-alpine3.22.yaml | apko config for Python 3.12 runtime image |
Each runtime image contains:
ca-certificates-bundle, su-exec)nodejs or python3)gram-runner binary (built from cmd/runner/main.go)Entrypoint behavior:
gram-runner -init -language <lang> - Initializes filesystem, unzips user codesu-exec gram - Drops privileges to non-root gram user (UID 10000)gram-runner -language <lang> - Starts HTTP server on port 8888cmd/runner/main.go)The gram-runner binary is an HTTP server that:
:8888 for tool call and resource requestsfunctions/internal/)| Package | Purpose |
|---|---|
auth/ | JWT authentication and request authorization middleware |
bootstrap/ | Machine initialization: unzip code, prepare entrypoints, lazy asset loading |
encryption/ | AES-GCM encryption for secure communication |
guardian/ | Process execution with resource limits |
ipc/ | Named pipe (FIFO) creation for subprocess communication |
javascript/ | JavaScript/TypeScript entrypoint script (gram-start.js) |
python/ | Python entrypoint script (gram_start.py) |
runner/ | HTTP handlers for /tool-call and /resource-request endpoints |
svc/ | Service utilities (idle tracking, secrets, errors) |
o11y/ | Observability setup (OpenTelemetry, logging) |
middleware/ | HTTP middleware (recovery, version header) |
attr/ | Structured logging attribute helpers |
POST /tool-call with JSON payload:
{"name": "tool_name", "input": {...}, "environment": {...}}
node --experimental-strip-types gram-start.js or python gram_start.pyFor large function bundles (>700KiB), the code isn't embedded in the Fly machine config. Instead:
.lazy file is written containing the asset IDbootstrap.resolveLazyFile() detects the .lazy file| Table | Purpose |
|---|---|
deployments_functions | Links functions to deployments, stores runtime/slug |
functions_access | Encryption keys and bearer token formats for auth |
fly_apps | Tracks deployed Fly.io apps (status, region, URL, reap state) |
function_tool_definitions | Tool metadata (name, description, input schema, variables) |
function_resource_definitions | Resource metadata (URI, mime type) |
manifest.jsonDeployFunctionRunners activityFlyRunner.ToolCall() sends authenticated HTTP request/tool-call endpointnode/python) with user codeserver/internal/deployments/impl.go)reaped_at in databaseFunctionsReaperScopeGlobal scope exists in the code but is not currently used/scheduled