@teo_dev/keen-sdk-types
v1.0.4
Published
Unified type definitions for Keen Engine SDK modules
Readme
@teo_dev/keen-sdk-types
Unified TypeScript type definitions for all Keen Engine SDK modules.
Installation
npm install @teo_dev/keen-sdk-typesIncluded SDKs
| Module | Type File | Description |
|---|---|---|
| system/files | SDK_Files.d.ts | File management, processing, and factory |
| system/chat | SDK_Chat.d.ts | Real-time chat output and sub-agent streaming |
| system/log | SDK_Logs.d.ts | Logging (error, warning, info, debug) |
| system/flow | SDK_Flow.d.ts | Flow pipeline execution |
Usage
Once installed, import directly from the system modules inside your sandbox:
Files
import { FilesManager, FilesProcessor, FilesFactory } from 'system/files';
const file = await FilesManager.uploadBuffer(buffer, 'report.pdf');
const info = await FilesProcessor.pdf.getInfo(file.data.id);Chat
import Chat from 'system/chat';
Chat.writeOut('Hello from the agent!');
Chat.writeThinking('Processing your request...');
Chat.writeError('Something went wrong');
// Sub-agent streaming
Chat.writeAgentStart(mainSessionId, subSessionId, 'DataAgent');
Chat.writeAgentStream(subSessionId, 'partial response...');
Chat.writeAgentEnd(subSessionId, 'completed');Log
import Log from 'system/log';
Log.info('Processing started');
Log.warning('Rate limit approaching');
Log.error('Connection failed');
Log.debug('Payload received: ...');Flow
import Flow from 'system/flow';
const result = await Flow.run('Main-Start', { key: 'value' });
if ('error' in result) {
console.error(result.message);
} else {
console.log(result); // dictionary returned from pipeline
}Project Structure
keen-sdk-types/
├── package.json
├── index.d.ts <- references all SDK type files
└── types/
├── SDK_Files.d.ts <- system/files
├── SDK_Chat.d.ts <- system/chat
├── SDK_Logs.d.ts <- system/log
└── SDK_Flow.d.ts <- system/flowAdding a New SDK
- Create a new type file in
types/(e.g.SDK_Storage.d.ts) - Add a
/// <reference path="./types/SDK_Storage.d.ts" />line inindex.d.ts - Bump the version and publish
Publishing
npm login
npm publish --access public