Core Concepts
Runtime Adapter
Bridge Allternit governance to the Gizzi Runtime.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Bridge Allternit governance to the Gizzi Runtime.
pnpm add @allternit/runtime
| Adapter | Purpose |
|---|---|
SessionAdapter | Injects WIH governance at session initialization |
PluginAdapter | Governs plugin loading and tool registration |
| Wrapper | Purpose |
|---|---|
ToolWrapper | Intercepts tool execution with routing |
FileWrapper | Governs file operations |
| Hook | Purpose |
|---|---|
HookManager | Lifecycle hooks for session, tool, and file events |
interface RuntimeBridgeConfig {
kernel: AllternitKernel;
enforceWih?: boolean;
defaultToolPolicy?: ToolPolicy;
fileAccessMode?: 'standard' | 'read-only' | 'restricted';
allowedWorkspaces?: string[];
auditLogging?: {
enabled: boolean;
destination?: 'console' | 'file' | 'callback';
filePath?: string;
callback?: (log: AuditLogEntry) => void;
};
}
import { prepareSessionInit, getSessionContext } from '@allternit/runtime';
const result = await prepareSessionInit({
allternitKernel: kernel,
wihId: 'P3-T0300',
workspaceRoot: '/project',
enforceWih: true,
});
const context = getSessionContext(result.sessionId);
import { wrapToolExecution } from '@allternit/runtime';
const result = await wrapToolExecution(
{
kernel,
sessionId: 'sess-xxx',
agentId: 'agent-1',
workspaceRoot: '/project',
wihId: 'P3-T0301',
originalExecutor: runtimeExecutor,
},
'read_file',
{ path: '/project/file.txt' }
);
if (result.decision === 'allow') {
console.log('Result:', result.result);
}
import { createWrappedFileOperations } from '@allternit/runtime';
const fileOps = createWrappedFileOperations({
kernel,
sessionId: 'sess-xxx',
agentId: 'agent-1',
workspaceRoot: '/project',
wihId: 'P3-T0302',
});
const { data } = await fileOps.read('/file.txt', 'utf-8');
import { PluginAdapter } from '@allternit/runtime';
const adapter = new PluginAdapter({
kernel,
allowedPlugins: ['git', 'github'],
requireWih: true,
});
await adapter.loadPlugin(myPlugin, { wihId: 'P3-T0303' });
const tools = adapter.getAllTools();
| Runtime Component | Integration File | Adapter |
|---|---|---|
GatewayClient | src/gateway/client.ts | Session Adapter |
ToolPolicy | src/agents/tool-policy.ts | Tool Wrapper |
FileSafe | src/infra/fs-safe.ts | File Wrapper |
PluginLoader | src/plugins/tools.ts | Plugin Adapter |
| Error | Meaning |
|---|---|
wih_required | A Work-In-Hand identifier is required but missing |
wih_invalid | The provided WIH is invalid or not found |
tool_denied | Tool execution denied by policy |
file_access_denied | File operation denied by policy |
plugin_not_allowed | Plugin is not in the allowlist |