Sessions that pick up where you left off
Create, run, resume, and close a session with explicit ownership, workspace boundaries, and predictable process cleanup.
sessions · history · lifecycleSDK · 0.8.0
Bring the agent loop into what you build. A Python SDK for applications that work with people, and automations that work while you’re away. TypeScript is in the same repository.
pip install dgc-sdk · npm install @vibedgc/sdk · protocol v14 · CLI 0.50.0+
Get started / SDK + agents
Choose Python or TypeScript for your integration. Give your coding agent the documentation to help you build it.
Install the current DGC CLIpython3 -m pip install dgc-sdknpm install https://github.com/OpenPeach-ai/dgc/releases/download/sdk-v0.8.0/vibedgc-sdk-0.8.0.tgzpip install dgc-sdk is this product (import dgc_sdk). Do not run pip install dgc — that PyPI name is a different project. You also need the DGC CLI, 0.50.0 or newer (curl -fsSL https://vibedgc.com/install.sh | bash); the SDK finds it. Set inherit_user_state=False in production.
Python in your environment. TypeScript in your Node project.
Use the verified DGC version supported by the SDK release.
Set your workspace, model, and permission policy.
curl -fsSL https://docs.vibedgc.com/llms.txtRead https://docs.vibedgc.com/sdk and https://docs.vibedgc.com/llms.txt. Help me embed DGC SDK 0.8.0 in this project. Install with pip install dgc-sdk (import dgc_sdk). Do not pip install dgc. Set inherit_user_state=False. Pair with CLI 0.50.0 or newer / protocol v14. Run untrusted input under a RuntimePolicy with the sandbox required.
The docs index covers CLI, editor, and the SDK. A docs MCP connector is not required to install or run dgc-sdk.
DGC connects to MCP servers to use their tools, resources, and prompts.
Your coding agent searches DGC reference material, then writes integration code. A docs connector does not run DGC tasks.
A separate adapter could let another agent delegate a bounded task to DGC, with permissions, progress, and cancellation.
01 / The developer experience
Choose a use case. Follow an agent turn from intent to result, with task progress and the permission decision in view.
Stream progress into your interface. Let a person decide when the agent can change a file.
import { DGC } from "@vibedgc/sdk"; // from the GitHub release
const dgc = new DGC({
stateDir: "/var/lib/myapp/dgc",
inheritUserState: false,
});
try {
const session = await dgc.session({
cwd: "./checkout-app",
permissions: { mode: "default", unhandled: "deny" },
onPermission: request => askPerson(request),
});
const run = session.stream("Fix the empty-cart checkout error");
for await (const event of run) render(event);
showResult(await run.result());
} finally {
await dgc.close();
}The agent wants to update src/checkout.ts inside the selected workspace.
Scripted illustration. No model calls or file changes.
02 / Integration recipes
Start with your workspace. Add progress, decisions, or a job. Explore the code in either language, then select a note to see what each piece does.
import { DGC } from "@vibedgc/sdk"; // from the GitHub release
const dgc = new DGC({
stateDir: "/var/lib/myapp/dgc",
inheritUserState: false,
});
try {
const session = await dgc.session({
cwd: "./checkout-app",
permissions: { mode: "default", unhandled: "deny" },
});
const result = await session.run(
"Explain the checkout flow. Do not edit files."
);
console.log(result.finalText);
} finally {
await dgc.close();
}The working directory scopes the session to your project. Permission rules still govern tool access; the prompt is not a security boundary.
session → ./checkout-app result → checkout flow explained runtime → closed by the application
SDK 0.8.0. Python snippets belong inside an async function when using AsyncDGC. The workbench output is scripted.
03 / The shape of the system
The SDK should expose the harness DGC already uses. A managed local process connects your code to sessions, tools, and your configured model.
Application server
CI or background worker
Python / TypeScript
Sessions, events, results
Context, tools, permissions
Your configured model
A browser UI talks to your application server. The DGC process and provider credentials stay on the server or your machine.
04 / In 0.8.0
Applications and automation share the same session lifecycle, policy, and event model.
What is releasedCreate, run, resume, and close a session with explicit ownership, workspace boundaries, and predictable process cleanup.
sessions · history · lifecycleTyped messages, tool activity, task updates, approvals, usage, and a final result. Task IDs keep completed work checked off.
events · progress · resultsAsk a person inside an app. Apply an explicit policy in a job. Missing decisions fail closed, with cancellation and time limits.
approvals · policy · cancellationValidated structured results, typed errors, exit outcomes, and usage records make an agent run easier to integrate and test.
schemas · errors · observabilityCreate, read, edit, compare, restore and export artifacts through Python or TypeScript. Dashboard sources wait for explicit consent.
session.artifacts · versions · exportsBuild a mod in Python or TypeScript, declare the capabilities it needs and run it through the SDK. Guards can hold an action; they cannot grant permission.
dgc_sdk.mods · @vibedgc/sdk/mods06 / Pips for your app
Your app gives its Pips its own tools, decides what they may change, wakes them when something happens, and keeps them in code. One company, your own profile: a Pip reads freely, and a change waits for a person unless one already said Always allow.
Read the guideDeclare each tool as a read or a change. DGC calls your app at its own web address, every call signed; a handler in the SDK checks it and runs your function.
define_pip_tool · register_app · AppToolHandlerWhen a Pip wants to change something, your app hears about it and a person decides there, or in DGC. Whichever answers first wins, once. A tool that moves money always asks.
pips.pending · pips.decide“When the shop sends order.created.” What your app sends reaches the Pip as data, never instructions, and the same event never runs twice.
pips.triggerPips run with no desktop, under systemd or in Docker, with a health check for your probes. On a server they use API keys or your own models, never a personal plan.
dgc pips serve --server · dgc pips healthEach deploy makes your Pips match their templates. What narrows a Pip applies at once; what widens it waits for a person. A change you made in DGC is kept and reported.
PipTemplate · pips.ensure_all07 / Released
SDK 0.8.0 pairs with CLI 0.50.0 or newer (protocol v14). A workspace cannot grant itself permissions, and the provider key never enters the agent’s environment. The SDK 0.8.0 release dry run passed on Linux, macOS 26.5.1 (Apple silicon), and Windows 11 through WSL 2 (Ubuntu 24.04).
Python 0.8.0 on PyPI. Isolation, a RuntimePolicy that holds in auto mode, streaming, cancel, denials, audit, real usage, custom tools.
npm i @vibedgc/sdk — 0.8.0 on the npm registry for Node 22+, published from the release tag through npm Trusted Publishing. Same policy and protocol v14.
The SDK 0.8.0 release dry run passed on macOS 26.5.1 (Apple silicon) and Windows 11 through WSL 2 (Ubuntu 24.04), alongside Linux. Native Windows remains experimental; focused SDK checks passed there, while the full suite ran in WSL.
Do not pip install dgc. That PyPI name is a different project.
08 / A few details
Yes. python3 -m pip install dgc-sdk from PyPI (version 0.8.0). That is import dgc_sdk. Do not pip install dgc — that name is a different project. The Node package is npm i @vibedgc/sdk from the npm registry. You also need the DGC CLI, 0.50.0 or newer; the SDK finds an installed dgc.
No. Python or Node on your server or machine. A browser UI talks to your backend, which owns the DGC process, workspace, and provider credentials.
The same native local and API routes as the CLI. Set model and base_url on the client. Subscription routes keep vendor-CLI tool ownership; do not assume they behave like native mode.
Yes for Python 0.8.0: DGC(inherit_user_state=False), session.run / session.stream, RuntimePolicy. The workbench animation is scripted and does not call a model. TypeScript uses stateDir and inheritUserState, from npm i @vibedgc/sdk.
Same harness. More places to build.