@capybara-hq/plugin-model-fake 0.1.0-rc.1 → 0.1.0-rc.3

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.
@@ -1,15 +1,22 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "model-fake",
4
- "version": "0.1.0-rc.1",
4
+ "version": "0.1.0-rc.3",
5
5
  "publisher": "Capybara",
6
- "description": "Deterministic scripted model provider (model-provider@2) for runtime tests, e2e tests and keyless demos",
6
+ "description": {
7
+ "en": "Deterministic scripted model provider (model-provider@2) for runtime tests, e2e tests and keyless demos",
8
+ "zh": "确定性的脚本化模型提供方(model-provider@2),用于运行时测试、端到端测试和无密钥演示"
9
+ },
10
+ "displayName": {
11
+ "zh": "模拟模型",
12
+ "en": "Fake model"
13
+ },
7
14
  "homepage": "https://github.com/capybara-hq/core/tree/main/plugins/model-fake#readme",
8
15
  "extension": {
9
16
  "entry": "./dist/index.mjs",
10
17
  "manifest": {
11
18
  "name": "model-fake",
12
- "version": "0.1.0-rc.1",
19
+ "version": "0.1.0-rc.3",
13
20
  "sdk": "^0.1.0-rc.0",
14
21
  "provides": [
15
22
  "model-provider@2"
@@ -27,6 +34,86 @@
27
34
  ],
28
35
  "org": []
29
36
  }
37
+ },
38
+ "configSchemas": {
39
+ "deployment": {
40
+ "type": "object",
41
+ "properties": {
42
+ "models": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "object",
46
+ "properties": {
47
+ "id": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "x-ui": {
51
+ "label": {
52
+ "zh": "模型 ID",
53
+ "en": "Model ID"
54
+ }
55
+ },
56
+ "title": "Model ID"
57
+ },
58
+ "contextWindow": {
59
+ "type": "integer",
60
+ "exclusiveMinimum": 0,
61
+ "maximum": 9007199254740991,
62
+ "x-ui": {
63
+ "label": {
64
+ "zh": "上下文窗口",
65
+ "en": "Context window"
66
+ }
67
+ },
68
+ "title": "Context window"
69
+ },
70
+ "streamIdleTimeoutMs": {
71
+ "type": "integer",
72
+ "exclusiveMinimum": 0,
73
+ "maximum": 9007199254740991,
74
+ "x-ui": {
75
+ "label": {
76
+ "zh": "流空闲超时(毫秒)",
77
+ "en": "Stream idle timeout (ms)"
78
+ }
79
+ },
80
+ "title": "Stream idle timeout (ms)"
81
+ },
82
+ "vision": {
83
+ "type": "boolean",
84
+ "x-ui": {
85
+ "label": {
86
+ "zh": "图片输入",
87
+ "en": "Image input"
88
+ }
89
+ },
90
+ "title": "Image input"
91
+ },
92
+ "documents": {
93
+ "type": "boolean",
94
+ "x-ui": {
95
+ "label": {
96
+ "zh": "文档输入",
97
+ "en": "Document input"
98
+ }
99
+ },
100
+ "title": "Document input"
101
+ }
102
+ },
103
+ "required": [
104
+ "id"
105
+ ]
106
+ },
107
+ "x-ui": {
108
+ "label": {
109
+ "zh": "模型",
110
+ "en": "Models"
111
+ }
112
+ },
113
+ "title": "Models"
114
+ }
115
+ }
116
+ }
30
117
  }
31
118
  }
32
119
  }
package/dist/index.mjs CHANGED
@@ -6,7 +6,10 @@ const __capybara_filename = __capybaraFileURLToPath(import.meta.url);
6
6
  const __capybara_dirname = __capybaraPathDirname(__capybara_filename);
7
7
 
8
8
  // src/index.ts
9
- import { defineExtension, MODEL_PROVIDER_EXTENSION_POINT_V2 } from "@capybara-hq/plugin-sdk";
9
+ import {
10
+ defineExtension,
11
+ MODEL_PROVIDER_EXTENSION_POINT_V2
12
+ } from "@capybara-hq/plugin-sdk";
10
13
  import { z } from "zod";
11
14
 
12
15
  // src/script.ts
@@ -302,21 +305,22 @@ function createFakeProvider(opts) {
302
305
  }
303
306
 
304
307
  // src/index.ts
308
+ var label = (zh, en) => ({ ui: { label: { zh, en } } });
305
309
  var DeploymentConfig = z.object({
306
310
  models: z.array(
307
311
  z.object({
308
- id: z.string().min(1),
309
- contextWindow: z.number().int().positive().optional(),
310
- streamIdleTimeoutMs: z.number().int().positive().optional(),
311
- /** 声明支持图片 / 文档输入(默认 false)。 */
312
- vision: z.boolean().optional(),
313
- documents: z.boolean().optional()
312
+ id: z.string().min(1).meta(label("模型 ID", "Model ID")),
313
+ contextWindow: z.number().int().positive().optional().meta(label("上下文窗口", "Context window")),
314
+ streamIdleTimeoutMs: z.number().int().positive().optional().meta(label("流空闲超时(毫秒)", "Stream idle timeout (ms)")),
315
+ /** Declares image / document input support (default false). */
316
+ vision: z.boolean().optional().meta(label("图片输入", "Image input")),
317
+ documents: z.boolean().optional().meta(label("文档输入", "Document input"))
314
318
  })
315
- ).optional()
319
+ ).optional().meta(label("模型", "Models"))
316
320
  });
317
321
  var index_default = defineExtension({
318
322
  name: "model-fake",
319
- version: "0.1.0-rc.1",
323
+ version: "0.1.0-rc.3",
320
324
  sdk: "^0.1.0-rc.0",
321
325
  provides: [MODEL_PROVIDER_EXTENSION_POINT_V2],
322
326
  config: { deployment: DeploymentConfig },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-model-fake",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.3",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Deterministic scripted model provider (model-provider@2) for runtime tests, e2e tests and keyless demos",