dsh-cwtools 0.1.0 → 0.3.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/README.md +17 -13
- package/lib/client.js +13933 -193
- package/lib/index.js +265 -94
- package/lib/types/client/cwtools-controller.d.ts +6 -4
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/config.d.ts +46 -4
- package/lib/types/contract/configTypes.d.ts +23 -5
- package/lib/types/contract/toolCatalog.d.ts +43 -18
- package/lib/types/host/activeBackend.d.ts +2 -1
- package/lib/types/host/nativeTools.d.ts +10 -1
- package/lib/types/host/runtime.d.ts +10 -0
- package/lib/types/index.d.ts +8 -3
- package/package.json +42 -15
|
@@ -1,19 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export type
|
|
1
|
+
/**
|
|
2
|
+
* How the settings page groups the shared tool catalog.
|
|
3
|
+
*
|
|
4
|
+
* The catalog itself is owned by `cwtools-shared`: this module never keeps a
|
|
5
|
+
* copy of tool names. It only records which group a shared tool is presented
|
|
6
|
+
* under, so a tool added upstream appears in the page — and in the Host — on its
|
|
7
|
+
* own, with no edit here.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CWTOOLS_READ_GROUPS: readonly ["project", "localisation", "semantic", "navigation", "diagnostics", "shader", "ide"];
|
|
10
|
+
export type CwtoolsReadGroup = typeof CWTOOLS_READ_GROUPS[number];
|
|
11
|
+
/** Groups in the order the settings page renders them. */
|
|
11
12
|
export declare const CWTOOLS_READ_GROUP_ORDER: readonly CwtoolsReadGroup[];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
interface CatalogEntry {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly inputSchema: Record<string, unknown>;
|
|
17
|
+
readonly isWrite: boolean;
|
|
18
|
+
readonly group: CwtoolsReadGroup;
|
|
19
|
+
}
|
|
20
|
+
/** Every tool the shared catalog publishes, read once at load. */
|
|
21
|
+
export declare const CWTOOLS_CATALOG: readonly CatalogEntry[];
|
|
22
|
+
/** Read-only tools in rendering order: group order, then shared catalog order. */
|
|
23
|
+
export declare const CWTOOLS_READ_TOOL_NAMES: readonly string[];
|
|
24
|
+
/** Tools per group, in rendering order. */
|
|
25
|
+
export declare const CWTOOLS_READ_TOOL_GROUPS: Readonly<Record<CwtoolsReadGroup, readonly string[]>>;
|
|
26
|
+
/** Write tools the shared catalog publishes. Every one needs an explicit grant. */
|
|
27
|
+
export declare const CWTOOLS_WRITE_TOOL_NAMES: readonly string[];
|
|
28
|
+
/** @returns the catalog entry of one tool, or undefined when the shared catalog has no such tool. */
|
|
29
|
+
export declare function cwtoolsCatalogEntry(name: string): CatalogEntry | undefined;
|
|
30
|
+
/** @returns whether the shared catalog publishes this tool as read-only. */
|
|
31
|
+
export declare function isCwtoolsReadToolName(name: string): boolean;
|
|
32
|
+
/** @returns whether the shared catalog publishes this tool as a write. */
|
|
33
|
+
export declare function isCwtoolsWriteToolName(name: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The catalog group a read tool is presented under.
|
|
36
|
+
* @throws when the shared catalog has no such read tool.
|
|
37
|
+
*/
|
|
38
|
+
export declare function cwtoolsReadGroupFor(name: string): CwtoolsReadGroup;
|
|
39
|
+
/**
|
|
40
|
+
* The game model a tool needs, when it only answers against a full game workspace.
|
|
41
|
+
* @returns the game identifier, or undefined when the tool works anywhere.
|
|
42
|
+
*/
|
|
43
|
+
export declare function cwtoolsGameModelFor(name: string): string | undefined;
|
|
44
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type LspHost } from 'cwtools-node';
|
|
1
|
+
import { type IdeHost, type LspHost } from 'cwtools-node';
|
|
2
2
|
import type { Config } from '../config.ts';
|
|
3
3
|
export interface ActiveBackend {
|
|
4
4
|
lspHost: LspHost;
|
|
5
|
+
ideHost: IdeHost;
|
|
5
6
|
readyAtMs?: number;
|
|
6
7
|
}
|
|
7
8
|
/** Resolve a healthy active host only for the exact current mod root. */
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type
|
|
2
|
+
import { type Config } from '../config.ts';
|
|
3
3
|
import type { CwtoolsRuntimePool } from './runtime.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Register one native DSH tool per shared-catalog entry.
|
|
6
|
+
*
|
|
7
|
+
* Every published tool is registered; whether it is exposed to a session is
|
|
8
|
+
* decided at call time by `runtime.canExpose`, which applies the configuration
|
|
9
|
+
* gate, the project shape and the host capability check. Registration therefore
|
|
10
|
+
* never encodes the catalog — a tool added upstream is registered by this loop
|
|
11
|
+
* with no change here.
|
|
12
|
+
*/
|
|
4
13
|
export declare function registerNativeCwtoolsTools(ctx: Context, config: Config, runtime: CwtoolsRuntimePool): () => void;
|
|
@@ -8,8 +8,18 @@ export declare class CwtoolsRuntimePool {
|
|
|
8
8
|
constructor(config: Config);
|
|
9
9
|
get workspaceCount(): number;
|
|
10
10
|
canExpose(name: string, workspaceRoot: string): boolean;
|
|
11
|
+
canExposeWithHost(name: string, workspaceRoot: string, signal: AbortSignal): Promise<boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* Why a tool may not run in this workspace, or undefined when it may.
|
|
14
|
+
*
|
|
15
|
+
* The shared catalog, not this package, owns the tool set: a name the catalog
|
|
16
|
+
* does not publish is refused here, and a published one is filtered by its
|
|
17
|
+
* group grant, the write allowlist and the host capability check instead of by
|
|
18
|
+
* a compiled list of first-release names.
|
|
19
|
+
*/
|
|
11
20
|
exposureReason(name: string, workspaceRoot: string): string | undefined;
|
|
12
21
|
execute(name: string, args: Record<string, unknown>, workspaceRoot: string, signal: AbortSignal): Promise<SharedToolResult>;
|
|
22
|
+
private invoke;
|
|
13
23
|
dispose(): void;
|
|
14
24
|
private resolveProject;
|
|
15
25
|
private entryFor;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type
|
|
2
|
+
import { type CwtoolsLiveConfig } from './config.ts';
|
|
3
3
|
export { Config } from './config.ts';
|
|
4
4
|
export declare const name = "cwtools";
|
|
5
5
|
export declare const inject: string[];
|
|
6
|
-
/** Register native CWTools tools and own every runtime resource in one effect.
|
|
7
|
-
|
|
6
|
+
/** Register native CWTools tools and own every runtime resource in one effect.
|
|
7
|
+
* A settings save commits volatile values into this running instance, so the
|
|
8
|
+
* resources that capture them are rebuilt instead of waiting for a restart.
|
|
9
|
+
* @param ctx - the Host plugin context.
|
|
10
|
+
* @param config - the live configuration sections this entry owns.
|
|
11
|
+
*/
|
|
12
|
+
export declare function apply(ctx: Context, config: CwtoolsLiveConfig): void;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cwtools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Native DeepSeek Harness tools and settings for CWTools Paradox modding",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"types": "lib/types/index.d.ts",
|
|
9
|
+
"packageManager": "pnpm@11.24.0",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
12
|
"types": "./lib/types/index.d.ts",
|
|
@@ -30,9 +31,7 @@
|
|
|
30
31
|
"LICENSE"
|
|
31
32
|
],
|
|
32
33
|
"dsh": {
|
|
33
|
-
"bundle": {
|
|
34
|
-
"patch": "./cordis.patch.yml"
|
|
35
|
-
},
|
|
34
|
+
"bundle": { "patch": "./cordis.patch.yml" },
|
|
36
35
|
"client": {
|
|
37
36
|
"platform": "web",
|
|
38
37
|
"inject": [
|
|
@@ -42,14 +41,24 @@
|
|
|
42
41
|
]
|
|
43
42
|
}
|
|
44
43
|
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "pnpm run typecheck && pnpm run build:types && tsdown",
|
|
46
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
47
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"test:host": "vitest run tests/host",
|
|
50
|
+
"test:client": "vitest run tests/client",
|
|
51
|
+
"prepack": "pnpm run build",
|
|
52
|
+
"prepare": "tsdown"
|
|
53
|
+
},
|
|
45
54
|
"engines": {
|
|
46
55
|
"node": ">=24.9.0",
|
|
47
56
|
"dsh": ">=0.2.2-rc.1 <0.3.0"
|
|
48
57
|
},
|
|
49
58
|
"dependencies": {
|
|
50
59
|
"@deepseek-ai/schemastery": "^3.19.0",
|
|
51
|
-
"cwtools-node": "0.
|
|
52
|
-
"cwtools-shared": "0.
|
|
60
|
+
"cwtools-node": "0.3.0",
|
|
61
|
+
"cwtools-shared": "0.4.0"
|
|
53
62
|
},
|
|
54
63
|
"peerDependencies": {
|
|
55
64
|
"@deepseek-ai/cordis": "^4.1.0",
|
|
@@ -59,6 +68,7 @@
|
|
|
59
68
|
},
|
|
60
69
|
"devDependencies": {
|
|
61
70
|
"@deepseek-ai/cordis": "^4.1.0",
|
|
71
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.1.0",
|
|
62
72
|
"@deepseek-ai/dsh-api-remotes": ">=0.2.2-rc.1 <0.3.0",
|
|
63
73
|
"@deepseek-ai/dsh-client-locale": ">=0.2.2-rc.1 <0.3.0",
|
|
64
74
|
"@deepseek-ai/dsh-client-store": ">=0.2.2-rc.1 <0.3.0",
|
|
@@ -69,26 +79,43 @@
|
|
|
69
79
|
"@deepseek-ai/dsh-client-ui-slots": ">=0.2.2-rc.1 <0.3.0",
|
|
70
80
|
"@deepseek-ai/dsh-system-prompt": ">=0.2.2-rc.1 <0.3.0",
|
|
71
81
|
"@deepseek-ai/dsh-tools": ">=0.2.2-rc.1 <0.3.0",
|
|
82
|
+
"@deepseek-ai/dsh-util-code-language": "0.1.7-rc.2",
|
|
83
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.1.2-alpha.2",
|
|
72
84
|
"@deepseek-ai/dsh-working-directory": ">=0.2.2-rc.1 <0.3.0",
|
|
85
|
+
"@shikijs/langs": "^4.6.0",
|
|
73
86
|
"@testing-library/react": "^16.3.0",
|
|
87
|
+
"@types/mdast": "^4.0.4",
|
|
74
88
|
"@types/node": "^24.0.0",
|
|
75
89
|
"@types/react": "^18.3.0",
|
|
76
90
|
"@types/react-dom": "^18.3.0",
|
|
91
|
+
"anser": "^2.3.5",
|
|
92
|
+
"clsx": "^2.1.1",
|
|
93
|
+
"diff": "^9.0.0",
|
|
94
|
+
"immer": "^10.2.0",
|
|
77
95
|
"jsdom": "^26.1.0",
|
|
96
|
+
"katex": "^0.19.1",
|
|
78
97
|
"lightningcss": "^1.30.0",
|
|
98
|
+
"mdast-util-from-markdown": "^2.1.0",
|
|
99
|
+
"mdast-util-gfm": "^3.1.0",
|
|
100
|
+
"mdast-util-math": "^3.0.0",
|
|
101
|
+
"micromark-core-commonmark": "^2.0.4",
|
|
102
|
+
"micromark-extension-gfm": "^3.0.0",
|
|
103
|
+
"micromark-extension-math": "^3.1.0",
|
|
104
|
+
"micromark-factory-space": "^2.1.0",
|
|
105
|
+
"micromark-util-character": "^2.1.1",
|
|
106
|
+
"micromark-util-classify-character": "^2.0.1",
|
|
107
|
+
"micromark-util-decode-string": "^2.0.1",
|
|
108
|
+
"micromark-util-sanitize-uri": "^2.0.1",
|
|
109
|
+
"micromark-util-symbol": "^2.0.1",
|
|
110
|
+
"micromark-util-types": "^2.0.3",
|
|
79
111
|
"playwright-core": "^1.56.0",
|
|
80
112
|
"react": "^18.2.0",
|
|
81
113
|
"react-dom": "^18.2.0",
|
|
114
|
+
"shiki": "^4.6.0",
|
|
115
|
+
"simple-icons": "^16.37.0",
|
|
82
116
|
"tsdown": "^0.22.2",
|
|
83
117
|
"typescript": "^5.8.3",
|
|
84
|
-
"vitest": "^4.0.0"
|
|
85
|
-
|
|
86
|
-
"scripts": {
|
|
87
|
-
"build": "pnpm run typecheck && pnpm run build:types && tsdown",
|
|
88
|
-
"build:types": "tsc -p tsconfig.build.json",
|
|
89
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
90
|
-
"test": "vitest run",
|
|
91
|
-
"test:host": "vitest run tests/host",
|
|
92
|
-
"test:client": "vitest run tests/client"
|
|
118
|
+
"vitest": "^4.0.0",
|
|
119
|
+
"zustand": "~4.5.7"
|
|
93
120
|
}
|
|
94
121
|
}
|