@user-mrz/dsh-system-prompt-studio 0.0.0-stage → 0.1.7

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/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "System prompt",
4
+ "description": "Inspect and override the system prompt a conversation actually sends: append, replace one section, or replace everything."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "系统提示词",
4
+ "description": "按对话查看并覆盖模型实际收到的系统提示词:追加、替换指定段,或完全替换。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
- {
2
- "name": "@user-mrz/dsh-system-prompt-studio",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@user-mrz/dsh-system-prompt-studio",
3
+ "displayName": "System prompt studio",
4
+ "description": "Per-conversation system prompt control for DeepSeek Harness: append a section, shadow-replace one named section, or replace the whole prompt. Applies on the next model request, persists per session, and inherits along fork lineage.",
5
+ "version": "0.1.7",
6
+ "type": "module",
7
+ "main": "lib/index.js",
8
+ "exports": {
9
+ ".": "./lib/index.js",
10
+ "./client": "./lib/client.js",
11
+ "./package.json": "./package.json",
12
+ "./icon": "./icon.svg",
13
+ "./locale/*.json": "./locale/*.json"
14
+ },
15
+ "files": [
16
+ "lib",
17
+ "locale",
18
+ "scripts",
19
+ "cordis.patch.yml",
20
+ "icon.svg",
21
+ "README.md",
22
+ "CHANGELOG.md",
23
+ "LICENSE"
24
+ ],
25
+ "dsh": {
26
+ "engines": {
27
+ "dsh": ">=0.2.2-0 <0.3.0-0"
28
+ },
29
+ "bundle": {
30
+ "patch": "./cordis.patch.yml"
31
+ },
32
+ "client": {
33
+ "platform": "web",
34
+ "inject": []
35
+ }
36
+ },
37
+ "scripts": {
38
+ "prepare": "node scripts/verify-entry.mjs",
39
+ "check": "node --check lib/index.js && node --check lib/client.js && node test/host-check.mjs && node test/client-check.mjs"
40
+ },
41
+ "keywords": [
42
+ "dsh-plugin",
43
+ "deepseek-harness",
44
+ "system-prompt",
45
+ "prompt-engineering"
46
+ ],
47
+ "publishConfig": {
48
+ "access": "public",
49
+ "registry": "https://registry.npmjs.org"
50
+ },
51
+ "author": "user-Mrz",
52
+ "license": "MIT",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/user-Mrz/dsh-system-prompt-studio.git"
56
+ },
57
+ "homepage": "https://github.com/user-Mrz/dsh-system-prompt-studio#readme",
58
+ "bugs": {
59
+ "url": "https://github.com/user-Mrz/dsh-system-prompt-studio/issues"
60
+ }
61
+ }
@@ -0,0 +1,39 @@
1
+ // 安装期自检(prepare 脚本)。
2
+ //
3
+ // 本插件是**纯 JavaScript**、`lib/` 已随仓库提交,因此这里不做任何编译,只
4
+ // 确认入口与清单文件在安装后的目录里确实存在。这样在 GitHub 源码安装时,
5
+ // 一旦 `files`/`exports` 写错或产物缺失,会在安装阶段就报错,而不是等到用户
6
+ // 启动 DSH 才发现 `entry file missing`。
7
+ //
8
+ // 注意:pnpm 默认会拦截 Git 依赖的构建脚本。如果它被拦下了也不要紧——本脚本
9
+ // 只做校验、不产出文件,跳过它不会影响安装结果的可用性。
10
+
11
+ import { existsSync, readFileSync } from 'node:fs'
12
+ import { dirname, join } from 'node:path'
13
+ import { fileURLToPath } from 'node:url'
14
+
15
+ const root = dirname(dirname(fileURLToPath(import.meta.url)))
16
+ const missing = []
17
+
18
+ for (const relative of ['lib/index.js', 'lib/client.js', 'cordis.patch.yml', 'locale/zh.json', 'locale/en.json']) {
19
+ if (!existsSync(join(root, relative))) missing.push(relative)
20
+ }
21
+
22
+ let manifest
23
+ try {
24
+ manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'))
25
+ } catch (error) {
26
+ console.error(`[dsh-system-prompt-studio] package.json 不可读:${error.message}`)
27
+ process.exitCode = 1
28
+ }
29
+
30
+ if (manifest !== undefined) {
31
+ if (manifest.dsh?.bundle?.patch === undefined) missing.push('package.json: dsh.bundle.patch')
32
+ if (manifest.dsh?.client === undefined) missing.push('package.json: dsh.client')
33
+ }
34
+
35
+ if (missing.length > 0) {
36
+ console.error('[dsh-system-prompt-studio] 安装不完整,缺少:')
37
+ for (const item of missing) console.error(` - ${item}`)
38
+ process.exitCode = 1
39
+ }