Set up an SDK project

Create a minimal TypeScript package that the managed builder can validate, reproduce, and deploy.

Before you begin

Choose one package kind and obtain a deployment key. The archive contains source and immutable configuration only—never Credentials, .env, node_modules, generated output, or lifecycle scripts.

Steps

  1. Install the SDK. The package manager records the resolved dependency in your lockfile:
sh
npm install @constal/sdk
  1. Add one root manifest:
constal.agent.json
{
  "schemaVersion": 2,
  "kind": "agent",
  "id": "support-agent",
  "namespace": "default",
  "version": "1.0.0",
  "entry": "src/index.ts",
  "mode": "script",
  "bindings": {
    "model": "crn:constal:production:acme:default:model/support"
  },
  "policies": [],
  "tools": [],
  "limits": { "maxRunMicroUsd": 100000, "maxTurns": 8 },
  "expectedCurrentDeploymentRevision": null
}
  1. Export the matching definition:
src/index.ts
import { agent } from "@constal/sdk";

export default agent({
  id: "support-agent", version: "1.0.0", model: "model",
  async onMessage(message, ctx) {
    const turn = await ctx.turn({ system: "Help the caller.", objective: message });
    return turn.message.content;
  },
});

Other root manifests are constal.channel.json, constal.auth-provider.json, constal.policy.json, and constal.credential-provider.json. Identity, entrypoint, Resource bindings, and Policy attachments must agree with the exported definition.

  1. Package and upload:
sh
zip -r support-agent.zip constal.agent.json package.json src
curl https://platform.constal.ai/v1/deployments \
  -H "Authorization: Bearer $CONSTAL_DEPLOYMENT_KEY" \
  -H "Idempotency-Key: support-agent-1.0.0" \
  -H "Content-Type: application/zip" \
  --data-binary @support-agent.zip

Verify

Poll GET /v1/deployments/:deploymentId. Success records the Resource identity, immutable deployment revision, executable artifact, code digest, and probe outcome. Confirm that version, bindings, and Policies match the archive. A public Git repository pinned to a full commit enters the same build path through the Console.

Next steps

Follow Build an Agent, Build a Channel and Auth Provider, or Build a Credential Provider. Use Deploy an Agent for the complete archive and release workflow.