@openclaw/longcat-provider 0.0.0 → 2026.7.1-beta.5
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.
- package/README.md +11 -3
- package/dist/api.js +5 -0
- package/dist/index.js +47 -0
- package/dist/models.js +13 -0
- package/dist/onboard.js +21 -0
- package/dist/openclaw.plugin-DDv4PTyY.js +34 -0
- package/dist/provider-catalog.js +11 -0
- package/dist/stream.js +10 -0
- package/npm-shrinkwrap.json +12 -0
- package/openclaw.plugin.json +82 -0
- package/package.json +44 -6
package/README.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenClaw LongCat Provider
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official OpenClaw provider plugin for LongCat-2.0 through LongCat's hosted
|
|
4
|
+
OpenAI-compatible API.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Install from OpenClaw:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
openclaw plugins install @openclaw/longcat-provider
|
|
10
|
+
openclaw gateway restart
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Configure `LONGCAT_API_KEY`, then select `longcat/LongCat-2.0`.
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LONGCAT_BASE_URL, LONGCAT_DEFAULT_MODEL_ID, LONGCAT_DEFAULT_MODEL_REF, LONGCAT_MODEL_CATALOG } from "./models.js";
|
|
2
|
+
import { applyLongCatConfig } from "./onboard.js";
|
|
3
|
+
import { buildLongCatProvider } from "./provider-catalog.js";
|
|
4
|
+
import { createLongCatThinkingWrapper } from "./stream.js";
|
|
5
|
+
export { LONGCAT_BASE_URL, LONGCAT_DEFAULT_MODEL_ID, LONGCAT_DEFAULT_MODEL_REF, LONGCAT_MODEL_CATALOG, applyLongCatConfig, buildLongCatProvider, createLongCatThinkingWrapper };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LONGCAT_DEFAULT_MODEL_REF } from "./models.js";
|
|
2
|
+
import { applyLongCatConfig } from "./onboard.js";
|
|
3
|
+
import { buildLongCatProvider } from "./provider-catalog.js";
|
|
4
|
+
import { createLongCatThinkingWrapper } from "./stream.js";
|
|
5
|
+
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
6
|
+
import { buildProviderReplayFamilyHooks } from "openclaw/plugin-sdk/provider-model-shared";
|
|
7
|
+
import { buildProviderToolCompatFamilyHooks } from "openclaw/plugin-sdk/provider-tools";
|
|
8
|
+
var longcat_default = defineSingleProviderPluginEntry({
|
|
9
|
+
id: "longcat",
|
|
10
|
+
name: "LongCat Provider",
|
|
11
|
+
description: "Official LongCat provider plugin",
|
|
12
|
+
provider: {
|
|
13
|
+
label: "LongCat",
|
|
14
|
+
docsPath: "/providers/longcat",
|
|
15
|
+
aliases: ["meituan-longcat"],
|
|
16
|
+
envVars: ["LONGCAT_API_KEY"],
|
|
17
|
+
auth: [{
|
|
18
|
+
methodId: "api-key",
|
|
19
|
+
label: "LongCat API key",
|
|
20
|
+
hint: "API key",
|
|
21
|
+
optionKey: "longcatApiKey",
|
|
22
|
+
flagName: "--longcat-api-key",
|
|
23
|
+
envVar: "LONGCAT_API_KEY",
|
|
24
|
+
promptMessage: "Enter LongCat API key",
|
|
25
|
+
defaultModel: LONGCAT_DEFAULT_MODEL_REF,
|
|
26
|
+
applyConfig: (cfg) => applyLongCatConfig(cfg),
|
|
27
|
+
noteTitle: "LongCat",
|
|
28
|
+
noteMessage: "Manage API keys at https://longcat.chat/platform/api_keys",
|
|
29
|
+
wizard: {
|
|
30
|
+
choiceId: "longcat-api-key",
|
|
31
|
+
choiceLabel: "LongCat API key",
|
|
32
|
+
groupId: "longcat",
|
|
33
|
+
groupLabel: "LongCat",
|
|
34
|
+
groupHint: "API key"
|
|
35
|
+
}
|
|
36
|
+
}],
|
|
37
|
+
catalog: { buildProvider: buildLongCatProvider },
|
|
38
|
+
...buildProviderReplayFamilyHooks({
|
|
39
|
+
family: "openai-compatible",
|
|
40
|
+
dropReasoningFromHistory: false
|
|
41
|
+
}),
|
|
42
|
+
...buildProviderToolCompatFamilyHooks("openai"),
|
|
43
|
+
wrapStreamFn: (ctx) => createLongCatThinkingWrapper(ctx.streamFn, ctx.thinkingLevel)
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { longcat_default as default };
|
package/dist/models.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as modelCatalog } from "./openclaw.plugin-DDv4PTyY.js";
|
|
2
|
+
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
3
|
+
//#region extensions/longcat/models.ts
|
|
4
|
+
const LONGCAT_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
5
|
+
providerId: "longcat",
|
|
6
|
+
catalog: modelCatalog.providers.longcat
|
|
7
|
+
});
|
|
8
|
+
const LONGCAT_BASE_URL = LONGCAT_MANIFEST_PROVIDER.baseUrl;
|
|
9
|
+
const LONGCAT_MODEL_CATALOG = LONGCAT_MANIFEST_PROVIDER.models;
|
|
10
|
+
const LONGCAT_DEFAULT_MODEL_ID = "LongCat-2.0";
|
|
11
|
+
const LONGCAT_DEFAULT_MODEL_REF = `longcat/${LONGCAT_DEFAULT_MODEL_ID}`;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { LONGCAT_BASE_URL, LONGCAT_DEFAULT_MODEL_ID, LONGCAT_DEFAULT_MODEL_REF, LONGCAT_MODEL_CATALOG };
|
package/dist/onboard.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LONGCAT_BASE_URL, LONGCAT_DEFAULT_MODEL_REF, LONGCAT_MODEL_CATALOG } from "./models.js";
|
|
2
|
+
import { createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
3
|
+
//#region extensions/longcat/onboard.ts
|
|
4
|
+
const longCatPresetAppliers = createModelCatalogPresetAppliers({
|
|
5
|
+
primaryModelRef: LONGCAT_DEFAULT_MODEL_REF,
|
|
6
|
+
resolveParams: (_cfg) => ({
|
|
7
|
+
providerId: "longcat",
|
|
8
|
+
api: "openai-completions",
|
|
9
|
+
baseUrl: LONGCAT_BASE_URL,
|
|
10
|
+
catalogModels: LONGCAT_MODEL_CATALOG,
|
|
11
|
+
aliases: [{
|
|
12
|
+
modelRef: LONGCAT_DEFAULT_MODEL_REF,
|
|
13
|
+
alias: "LongCat 2.0"
|
|
14
|
+
}]
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
function applyLongCatConfig(cfg) {
|
|
18
|
+
return longCatPresetAppliers.applyConfig(cfg);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { applyLongCatConfig };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region extensions/longcat/openclaw.plugin.json
|
|
2
|
+
var modelCatalog = {
|
|
3
|
+
"providers": { "longcat": {
|
|
4
|
+
"baseUrl": "https://api.longcat.chat/openai",
|
|
5
|
+
"api": "openai-completions",
|
|
6
|
+
"models": [{
|
|
7
|
+
"id": "LongCat-2.0",
|
|
8
|
+
"name": "LongCat 2.0",
|
|
9
|
+
"reasoning": true,
|
|
10
|
+
"input": ["text"],
|
|
11
|
+
"contextWindow": 1048576,
|
|
12
|
+
"maxTokens": 131072,
|
|
13
|
+
"cost": {
|
|
14
|
+
"input": .75,
|
|
15
|
+
"output": 2.95,
|
|
16
|
+
"cacheRead": .015,
|
|
17
|
+
"cacheWrite": .75
|
|
18
|
+
},
|
|
19
|
+
"compat": {
|
|
20
|
+
"supportsStore": false,
|
|
21
|
+
"supportsDeveloperRole": false,
|
|
22
|
+
"supportsReasoningEffort": false,
|
|
23
|
+
"supportsUsageInStreaming": false,
|
|
24
|
+
"supportsStrictMode": false,
|
|
25
|
+
"maxTokensField": "max_tokens",
|
|
26
|
+
"requiresReasoningContentOnAssistantMessages": true,
|
|
27
|
+
"thinkingFormat": "deepseek"
|
|
28
|
+
}
|
|
29
|
+
}]
|
|
30
|
+
} },
|
|
31
|
+
"discovery": { "longcat": "static" }
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { modelCatalog as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as modelCatalog } from "./openclaw.plugin-DDv4PTyY.js";
|
|
2
|
+
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
3
|
+
//#region extensions/longcat/provider-catalog.ts
|
|
4
|
+
function buildLongCatProvider() {
|
|
5
|
+
return buildManifestModelProviderConfig({
|
|
6
|
+
providerId: "longcat",
|
|
7
|
+
catalog: modelCatalog.providers.longcat
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { buildLongCatProvider };
|
package/dist/stream.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
2
|
+
//#region extensions/longcat/stream.ts
|
|
3
|
+
function createLongCatThinkingWrapper(baseStreamFn, thinkingLevel) {
|
|
4
|
+
return createPayloadPatchStreamWrapper(baseStreamFn, ({ payload }) => {
|
|
5
|
+
payload.thinking = { type: thinkingLevel === "off" ? "disabled" : "enabled" };
|
|
6
|
+
delete payload.reasoning_effort;
|
|
7
|
+
}, { shouldPatch: ({ model }) => model.api === "openai-completions" && model.provider === "longcat" });
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createLongCatThinkingWrapper };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "longcat",
|
|
3
|
+
"name": "LongCat",
|
|
4
|
+
"description": "OpenClaw LongCat provider plugin.",
|
|
5
|
+
"activation": {
|
|
6
|
+
"onStartup": false
|
|
7
|
+
},
|
|
8
|
+
"enabledByDefault": true,
|
|
9
|
+
"providers": ["longcat"],
|
|
10
|
+
"providerRequest": {
|
|
11
|
+
"providers": {
|
|
12
|
+
"longcat": {
|
|
13
|
+
"family": "longcat"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"modelCatalog": {
|
|
18
|
+
"providers": {
|
|
19
|
+
"longcat": {
|
|
20
|
+
"baseUrl": "https://api.longcat.chat/openai",
|
|
21
|
+
"api": "openai-completions",
|
|
22
|
+
"models": [
|
|
23
|
+
{
|
|
24
|
+
"id": "LongCat-2.0",
|
|
25
|
+
"name": "LongCat 2.0",
|
|
26
|
+
"reasoning": true,
|
|
27
|
+
"input": ["text"],
|
|
28
|
+
"contextWindow": 1048576,
|
|
29
|
+
"maxTokens": 131072,
|
|
30
|
+
"cost": {
|
|
31
|
+
"input": 0.75,
|
|
32
|
+
"output": 2.95,
|
|
33
|
+
"cacheRead": 0.015,
|
|
34
|
+
"cacheWrite": 0.75
|
|
35
|
+
},
|
|
36
|
+
"compat": {
|
|
37
|
+
"supportsStore": false,
|
|
38
|
+
"supportsDeveloperRole": false,
|
|
39
|
+
"supportsReasoningEffort": false,
|
|
40
|
+
"supportsUsageInStreaming": false,
|
|
41
|
+
"supportsStrictMode": false,
|
|
42
|
+
"maxTokensField": "max_tokens",
|
|
43
|
+
"requiresReasoningContentOnAssistantMessages": true,
|
|
44
|
+
"thinkingFormat": "deepseek"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"discovery": {
|
|
51
|
+
"longcat": "static"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"setup": {
|
|
55
|
+
"providers": [
|
|
56
|
+
{
|
|
57
|
+
"id": "longcat",
|
|
58
|
+
"envVars": ["LONGCAT_API_KEY"]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"providerAuthChoices": [
|
|
63
|
+
{
|
|
64
|
+
"provider": "longcat",
|
|
65
|
+
"method": "api-key",
|
|
66
|
+
"choiceId": "longcat-api-key",
|
|
67
|
+
"choiceLabel": "LongCat API key",
|
|
68
|
+
"groupId": "longcat",
|
|
69
|
+
"groupLabel": "LongCat",
|
|
70
|
+
"groupHint": "API key",
|
|
71
|
+
"optionKey": "longcatApiKey",
|
|
72
|
+
"cliFlag": "--longcat-api-key",
|
|
73
|
+
"cliOption": "--longcat-api-key <key>",
|
|
74
|
+
"cliDescription": "LongCat API key"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"configSchema": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"properties": {}
|
|
81
|
+
}
|
|
82
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/longcat-provider",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "2026.7.1-beta.5",
|
|
4
|
+
"description": "OpenClaw LongCat provider plugin.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/openclaw/openclaw"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"openclaw": {
|
|
11
|
+
"extensions": [
|
|
12
|
+
"./index.ts"
|
|
13
|
+
],
|
|
14
|
+
"install": {
|
|
15
|
+
"clawhubSpec": "clawhub:@openclaw/longcat-provider",
|
|
16
|
+
"npmSpec": "@openclaw/longcat-provider",
|
|
17
|
+
"defaultChoice": "npm",
|
|
18
|
+
"minHostVersion": ">=2026.6.8"
|
|
19
|
+
},
|
|
20
|
+
"compat": {
|
|
21
|
+
"pluginApi": ">=2026.7.1-beta.5"
|
|
22
|
+
},
|
|
23
|
+
"build": {
|
|
24
|
+
"openclawVersion": "2026.7.1-beta.5",
|
|
25
|
+
"bundledDist": false
|
|
26
|
+
},
|
|
27
|
+
"release": {
|
|
28
|
+
"publishToClawHub": true,
|
|
29
|
+
"publishToNpm": true
|
|
30
|
+
},
|
|
31
|
+
"runtimeExtensions": [
|
|
32
|
+
"./dist/index.js"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
6
35
|
"files": [
|
|
36
|
+
"dist/**",
|
|
37
|
+
"openclaw.plugin.json",
|
|
38
|
+
"npm-shrinkwrap.json",
|
|
7
39
|
"README.md"
|
|
8
40
|
],
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
}
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"openclaw": ">=2026.7.1-beta.5"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"openclaw": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"bundledDependencies": []
|
|
12
50
|
}
|