@devflow-tools/sdk 0.17.5 → 0.17.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +21 -58
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,80 +1,43 @@
1
1
  # @devflow-tools/sdk
2
2
 
3
- DevFlow 共享 SDK — 类型定义、接口、工具函数、API 客户端和插件加载器。
3
+ > DevFlow 公共类型、插件契约、API client、配置/日志工具和 embedding contract。(v0.17.6)
4
4
 
5
- ## Installation
5
+ [![npm version](https://img.shields.io/npm/v/%40devflow-tools%2Fsdk.svg)](https://www.npmjs.com/package/@devflow-tools/sdk)
6
+
7
+ ## 安装
6
8
 
7
9
  ```bash
8
10
  npm install @devflow-tools/sdk
9
11
  ```
10
12
 
11
- ## Usage
13
+ ## 快速开始
12
14
 
13
15
  ```typescript
14
- import { DevFlowApiClient, loadPlugins, countTokens } from '@devflow-tools/sdk';
15
-
16
- // API 客户端
17
- const client = new DevFlowApiClient({
18
- baseUrl: 'http://localhost:13337',
19
- apiKey: process.env.DEVFLOW_API_KEY,
20
- projectRoot: '/path/to/project',
21
- });
16
+ import { countTokens, loadPlugins } from '@devflow-tools/sdk';
22
17
 
23
- // 加载插件
24
- const plugins = await loadPlugins('/path/to/project');
18
+ console.log(countTokens('hello'));
19
+ const plugins = await loadPlugins(process.cwd());
25
20
  ```
26
21
 
27
- ## Exports
22
+ ## 公共 API / 命令
28
23
 
29
- ### Types
24
+ 根入口包含 `DevFlowApiClient`、`DevFlowPlugin`、`EmbeddingProviderContract`、`loadConfig`、`loadPlugins`、`createLogger` 和 token 工具。引擎组合器位于 `@devflow-tools/context-engine`。
30
25
 
31
- | 导出 | 说明 |
32
- |------|------|
33
- | `DevFlowPlugin` | 插件接口(meta、knowledge、memory、tools、hooks) |
34
- | `KnowledgeSource` | 知识源定义(name、urls、pluginName、version、renderJs) |
35
- | `BenchmarkScenario` | 基准测试场景 |
36
- | `BenchmarkRunResult` | 基准测试运行结果 |
37
- | `BenchmarkReport` | 基准测试报告 |
38
- | `BenchmarkTask` | 基准测试任务 |
39
- | `ToolCallEvent` | Tool 调用事件 |
40
- | `WorkflowDefinition` | 工作流定义 |
41
- | `ContextResult` | 上下文检索结果 |
42
26
 
43
- ### Classes & Functions
27
+ ## 配置与运行时
44
28
 
45
- | 导出 | 说明 |
46
- |------|------|
47
- | `DevFlowApiClient` | REST API 客户端,封装所有 Server 端点 |
48
- | `loadPlugins()` | 插件发现和加载 |
49
- | `createEngines(root)` | 初始化所有引擎(context、graph、memory、knowledge、telemetry) |
50
- | `countTokens(text)` | Token 计数工具 |
51
- | `loadConfig(root)` | 加载 `.devflow/config.json` |
52
- | `getProjectRoot()` | 检测项目根目录 |
53
- | `createLogger(name)` | 创建结构化日志器 |
29
+ 可用 subpath:`@devflow-tools/sdk/step-templates`、`/auth`、`/plugin-workflow`、`/capability-rollout`、`/utils/project-scanner`。SDK 只定义跨包契约,不依赖 memory/knowledge 实现。
54
30
 
55
- ### Plugin Interface
31
+ ## 版本与兼容性
56
32
 
57
- ```typescript
58
- interface DevFlowPlugin {
59
- meta: {
60
- name: string;
61
- version: string;
62
- description: string;
63
- icon?: string;
64
- tags?: string[];
65
- };
66
- knowledge?: {
67
- sources: KnowledgeSource[];
68
- };
69
- memory?: {
70
- project?: { stack?: string[]; conventions?: MemoryEntry[] };
71
- global?: MemoryEntry[];
72
- user?: MemoryEntry[];
73
- };
74
- tools?: MCPTool[];
75
- hooks?: Record<string, HookHandler>;
76
- }
77
- ```
33
+ - 当前包版本:`0.17.6`
34
+ - Node.js:未在 package manifest 声明更高版本时,使用 Node.js 18+;原生 SQLite/Playwright 能力请按对应依赖安装
35
+ - workspace 内部包应使用同一 DevFlow minor/patch 版本,避免类型和数据库 schema 不一致
36
+
37
+ ## 相关链接
38
+
39
+ - [DevFlow 仓库](https://github.com/shilongfeicool/dev-flow)
40
+ - [问题反馈](https://github.com/shilongfeicool/dev-flow/issues)
78
41
 
79
42
  ## License
80
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/sdk",
3
- "version": "0.17.5",
3
+ "version": "0.17.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "clean": "rm -rf dist"
38
38
  },
39
39
  "dependencies": {
40
- "@devflow-tools/database": "0.17.4",
40
+ "@devflow-tools/database": "0.17.6",
41
41
  "tiktoken": "^1.0.0"
42
42
  },
43
43
  "devDependencies": {
@@ -47,5 +47,5 @@
47
47
  "files": [
48
48
  "dist"
49
49
  ],
50
- "gitHead": "817b0286c249eed9c2bd27d3974ee3b3d6ded4bb"
50
+ "gitHead": "669fea3aa72aa3fde14ed50d24c1fec4dfac088f"
51
51
  }