@eum-agent/llm-provider-custom 0.0.0-stage → 1.1.0

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 (3) hide show
  1. package/dist/index.js +82 -0
  2. package/package.json +34 -3
  3. package/README.md +0 -3
package/dist/index.js ADDED
@@ -0,0 +1,82 @@
1
+ //#region src/type.ts
2
+ /** Declares the registered hand-written API styles without registering either implementation. */
3
+ function customProviderType() {
4
+ return {
5
+ type: "custom",
6
+ label: "Custom",
7
+ fields: [{
8
+ key: "apiKey",
9
+ kind: "secret",
10
+ label: "API Key",
11
+ required: true
12
+ }],
13
+ endpoints: [{
14
+ id: "custom",
15
+ label: "Custom",
16
+ capabilities: {
17
+ chat: {
18
+ protocolIds: [
19
+ "anthropic",
20
+ "openai",
21
+ "openai-responses",
22
+ "gemini-interactions"
23
+ ],
24
+ defaultProtocolId: "anthropic"
25
+ },
26
+ image: {
27
+ protocolIds: ["openai-images", "gemini-interactions"],
28
+ defaultProtocolId: "openai-images"
29
+ }
30
+ },
31
+ defaults: { baseUrl: "" }
32
+ }],
33
+ catalog: {
34
+ vendors: [{
35
+ kind: "custom",
36
+ id: "custom",
37
+ name: "Custom",
38
+ region: null,
39
+ market: "domestic",
40
+ catalogKey: "custom",
41
+ canListModels: true,
42
+ endpoints: [{
43
+ type: "custom",
44
+ endpointId: "custom",
45
+ protocolIds: [
46
+ "anthropic",
47
+ "openai",
48
+ "openai-responses",
49
+ "gemini-interactions"
50
+ ],
51
+ baseUrl: ""
52
+ }]
53
+ }],
54
+ snapshot: {},
55
+ snapshotAt: 0
56
+ },
57
+ describeModel({ model, catalog }) {
58
+ let found;
59
+ for (const row of catalog().vendors) {
60
+ if (row.kind !== "vendor") continue;
61
+ const key = Object.keys(row.models).find((id) => id.toLowerCase() === model.toLowerCase());
62
+ if (key !== void 0) found = row.models[key];
63
+ }
64
+ return found === void 0 ? void 0 : {
65
+ ...found,
66
+ id: model
67
+ };
68
+ }
69
+ };
70
+ }
71
+ //#endregion
72
+ //#region src/index.ts
73
+ /** Custom connections contribute no agent tools. */
74
+ const TOOL_NAMES = [];
75
+ const plugin = {
76
+ name: "@eum-agent/llm-provider-custom",
77
+ apply(ctx) {
78
+ ctx.modelProviders.register(customProviderType());
79
+ }
80
+ };
81
+ //#endregion
82
+ export { TOOL_NAMES, plugin as default };
package/package.json CHANGED
@@ -1,6 +1,37 @@
1
1
  {
2
2
  "name": "@eum-agent/llm-provider-custom",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "displayName": {
4
+ "en-US": "Custom Model Connection",
5
+ "zh-CN": "模型接入 · 自定义"
6
+ },
7
+ "version": "1.1.0",
8
+ "type": "module",
9
+ "description": "User-configured model endpoints using registered API protocols",
10
+ "license": "MIT",
11
+ "exports": {
12
+ ".": {
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "devDependencies": {
20
+ "@eum-agent/plugin": "1.1.0"
21
+ },
22
+ "yaoguang": {
23
+ "description": {
24
+ "en-US": "User-configured model endpoints using registered API protocols",
25
+ "zh-CN": "使用已注册 API 协议配置自定义模型端点"
26
+ },
27
+ "dependencies": {
28
+ "@eum-agent/llm-management": "1.1.0"
29
+ },
30
+ "kind": "extension"
31
+ },
32
+ "scripts": {
33
+ "build": "tsdown",
34
+ "test": "vitest run",
35
+ "typecheck": "tsc --noEmit"
36
+ }
6
37
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.