用途:面向 Osiris(LLM 优先的 ETL 平台)组件开发,帮助从零创建 extractor、writer、processor,使其与 Osiris 生态集成。
主要能力:按需生成组件结构(spec.yaml、init.py 的 load_spec()、driver.py、requirements.txt、tests/、README.md);声明 discover、adHocAnalytics、inMemoryMove、streaming、bulkOperations、transactions、partitioning、customTransforms 等布尔能力;实现 run、discover、doctor 方法;编写测试并对照 60 条规则清单校验;打包为 Python 包或 tarball 分发。
必要用法:driver 的 run 必须使用仅关键字参数签名 run(self, , step_id, config, inputs=None, ctx=None),返回 {"df": df};连接信息从 config["resolved_connection"] 读取,禁止直接读 os.environ;日志使用 logging.getLogger(name),ctx 仅提供 log_metric 与 output_dir,不存在 ctx.log();inputs 需同时接受 E2B 的 df 与 LOCAL 的 df_<step_id> 键。示例命令:mkdir 与 touch 创建骨架;osiris component validate ./spec.yaml;osiris run pipeline.yaml;osiris run pipeline.yaml --e2b --e2b-install-deps;osiris discover your.component @connection.alias;osiris doctor your.component @connection.alias;python -m build 后 twine upload dist/。
适用场景:构建连接 API/数据库的提取器、写库组件与转换组件,并对接 E2B 云沙箱运行。
限制:E2B 下禁止 Path.home() 或硬编码路径、系统级依赖,须统一使用 ctx.base_path 与带版本的 requirements.txt;错误消息不得泄露密钥,须在 spec.yaml 声明 secrets 与 x-connection-fields 策略;discover 结果需排序并生成确定性指纹;具体 API 支持范围、收费与平台细节暂未提供。