@rine-kit/pubg-plugin 0.0.0-stage → 0.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.
- package/LICENSE +21 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +24 -0
- package/package.json +37 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ChristmasFox / Arthur Xu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Plugin } from '@rine-kit/plugin-sdk';
|
|
2
|
+
import type { PubgDomainService } from '@rine-kit/pubg-domain';
|
|
3
|
+
import { type PubgSubjectHost } from '@rine-kit/pubg-tools';
|
|
4
|
+
/** What the host decides for one request from its trusted context. */
|
|
5
|
+
export interface PubgAccess {
|
|
6
|
+
/** The Domain service of the one tenant / team this request may see (its repository is scoped). */
|
|
7
|
+
service: PubgDomainService;
|
|
8
|
+
/** Who is asking, in PUBG terms (the asker's own accounts, the persons the host knows). */
|
|
9
|
+
host: PubgSubjectHost;
|
|
10
|
+
/** Names the conversation so result sets stay private to it. */
|
|
11
|
+
sessionId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PubgPluginOptions<Ctx> {
|
|
14
|
+
access(ctx: Ctx): PubgAccess;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The PUBG tool catalogue (shared with every other host) as a plugin. The tools take whatever the model
|
|
18
|
+
* writes after the shared validation, but the Domain service and the meaning of "me" come from the host.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createPubgPlugin<Ctx>(options: PubgPluginOptions<Ctx>): Plugin<Ctx>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { definePlugin } from '@rine-kit/plugin-sdk';
|
|
2
|
+
import { PUBG_TOOLS, runPubgTool } from '@rine-kit/pubg-tools';
|
|
3
|
+
const INSTRUCTIONS = "You can look up PUBG statistics and match reviews with the pubg_* tools. Every number, match, player, time range and coverage statement in your answer must come from this turn's tool results; never answer PUBG facts from memory or from the chat. Keep the tool's coverage, data time and partial/unknown states in your answer, and say plainly when data is missing. For today / yesterday / this week record requests use pubg_query_stats; use pubg_search_matches first when a match review needs a fresh resultSetId. Name players only by the in-game names or aliases in tool results. Never pass tenant, team or user identifiers: who is asking is decided by the system.";
|
|
4
|
+
/**
|
|
5
|
+
* The PUBG tool catalogue (shared with every other host) as a plugin. The tools take whatever the model
|
|
6
|
+
* writes after the shared validation, but the Domain service and the meaning of "me" come from the host.
|
|
7
|
+
*/
|
|
8
|
+
export function createPubgPlugin(options) {
|
|
9
|
+
const tools = PUBG_TOOLS.map((spec) => ({
|
|
10
|
+
name: spec.name,
|
|
11
|
+
description: spec.description,
|
|
12
|
+
input: spec.input,
|
|
13
|
+
run: (input, ctx, { signal }) => {
|
|
14
|
+
const access = options.access(ctx);
|
|
15
|
+
return runPubgTool(spec, input, {
|
|
16
|
+
service: access.service,
|
|
17
|
+
host: access.host,
|
|
18
|
+
sessionId: access.sessionId,
|
|
19
|
+
...(signal ? { signal } : {}),
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
23
|
+
return definePlugin({ id: 'rine.pubg', instructions: INSTRUCTIONS, tools });
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rine-kit/pubg-plugin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "The PUBG tools as an @rine-kit/plugin-sdk plugin (Vercel AI SDK hosts such as RINE). The OpenClaw host keeps its own thin adapter over the same @rine-kit/pubg-tools catalogue.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@rine-kit/plugin-sdk": "0.1.0",
|
|
16
|
+
"@rine-kit/pubg-domain": "0.1.0",
|
|
17
|
+
"@rine-kit/pubg-tools": "0.1.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^26.6.5",
|
|
21
|
+
"tsx": "^4.23.15",
|
|
22
|
+
"typescript": "^5.9.2"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+ssh://git@github.com/ChristmasFox/rine-kit.git",
|
|
27
|
+
"directory": "packages/pubg-plugin"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
37
|
+
"test": "tsx --test \"tests/**/*.test.ts\"",
|
|
38
|
+
"build": "tsc -p tsconfig.build.json"
|
|
39
|
+
}
|
|
6
40
|
}
|
package/README.md
DELETED