@huaqiu/dsh-artifacts 0.3.12 → 0.3.13
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/lib/service.d.mts +2 -2
- package/lib/service.mjs +7 -7
- package/package.json +2 -2
- package/src/service.ts +9 -9
package/lib/service.d.mts
CHANGED
|
@@ -56,8 +56,8 @@ interface HuaqiuArtifacts {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Minimal, dependency-free facade every internal call site uses. Delegates to
|
|
59
|
-
* `@
|
|
60
|
-
* (`<
|
|
59
|
+
* the unified `@huaqiu/dsh-plugin-log` so all plugin diagnostics land in one
|
|
60
|
+
* file (`<DSH_HOME>/logs/dsh-plugins.log`) — preserved verbatim across deps
|
|
61
61
|
* for the (test) callers that construct mock services around it.
|
|
62
62
|
*/
|
|
63
63
|
declare function log(level: 'debug' | 'warn', msg: string, extra?: Record<string, unknown>): void;
|
package/lib/service.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import * as path from "node:path";
|
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
|
|
6
|
-
import {
|
|
6
|
+
import { getLogger } from "@huaqiu/dsh-plugin-log";
|
|
7
7
|
//#region src/service.ts
|
|
8
8
|
/**
|
|
9
9
|
* `@huaqiu/dsh-artifacts` — user-wide, flat storage for ECAD preview artifacts
|
|
@@ -57,23 +57,23 @@ function toBytes(content, encoding) {
|
|
|
57
57
|
if (typeof content === "string") return encoding === "base64" ? Buffer.from(content, "base64") : Buffer.from(content, "utf8");
|
|
58
58
|
return content instanceof Uint8Array ? content : new Uint8Array(content);
|
|
59
59
|
}
|
|
60
|
-
/** Unified DSH-plugin logger for the artifacts plugin (
|
|
60
|
+
/** Unified DSH-plugin logger for the artifacts plugin (see dsh-plugin-log).
|
|
61
61
|
* Lazy — see dsh-auth/src/host.ts for the rationale (mocked DSH-home tests). */
|
|
62
62
|
let pluginLog = null;
|
|
63
63
|
function getPluginLog() {
|
|
64
|
-
if (pluginLog === null) pluginLog =
|
|
64
|
+
if (pluginLog === null) pluginLog = getLogger("dsh-artifacts");
|
|
65
65
|
return pluginLog;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Minimal, dependency-free facade every internal call site uses. Delegates to
|
|
69
|
-
* `@
|
|
70
|
-
* (`<
|
|
69
|
+
* the unified `@huaqiu/dsh-plugin-log` so all plugin diagnostics land in one
|
|
70
|
+
* file (`<DSH_HOME>/logs/dsh-plugins.log`) — preserved verbatim across deps
|
|
71
71
|
* for the (test) callers that construct mock services around it.
|
|
72
72
|
*/
|
|
73
73
|
function log(level, msg, extra) {
|
|
74
74
|
const l = getPluginLog();
|
|
75
|
-
if (level === "warn") l.warn(
|
|
76
|
-
else l.debug(
|
|
75
|
+
if (level === "warn") l.warn(msg, extra);
|
|
76
|
+
else l.debug(msg, extra);
|
|
77
77
|
}
|
|
78
78
|
var HuaqiuArtifactService = class {
|
|
79
79
|
baseDir;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/dsh-artifacts",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"types": "./lib/index.d.mts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.0",
|
|
34
|
-
"@
|
|
34
|
+
"@huaqiu/dsh-plugin-log": "0.3.13"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"lib",
|
package/src/service.ts
CHANGED
|
@@ -22,7 +22,7 @@ import * as path from 'node:path'
|
|
|
22
22
|
import { pathToFileURL } from 'node:url'
|
|
23
23
|
import { randomUUID } from 'node:crypto'
|
|
24
24
|
import { dshHomePath } from '@deepseek-ai/dsh-home-paths'
|
|
25
|
-
import {
|
|
25
|
+
import { getLogger, type PluginLogger } from '@huaqiu/dsh-plugin-log'
|
|
26
26
|
|
|
27
27
|
// ── Public types ────────────────────────────────────────────────────────────
|
|
28
28
|
|
|
@@ -123,24 +123,24 @@ function toBytes(content: string | Uint8Array, encoding: 'utf8' | 'base64' | und
|
|
|
123
123
|
return content instanceof Uint8Array ? content : new Uint8Array(content)
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
/** Unified DSH-plugin logger for the artifacts plugin (
|
|
126
|
+
/** Unified DSH-plugin logger for the artifacts plugin (see dsh-plugin-log).
|
|
127
127
|
* Lazy — see dsh-auth/src/host.ts for the rationale (mocked DSH-home tests). */
|
|
128
|
-
let pluginLog:
|
|
129
|
-
function getPluginLog():
|
|
130
|
-
if (pluginLog === null) pluginLog =
|
|
128
|
+
let pluginLog: PluginLogger | null = null
|
|
129
|
+
function getPluginLog(): PluginLogger {
|
|
130
|
+
if (pluginLog === null) pluginLog = getLogger('dsh-artifacts')
|
|
131
131
|
return pluginLog
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
135
|
* Minimal, dependency-free facade every internal call site uses. Delegates to
|
|
136
|
-
* `@
|
|
137
|
-
* (`<
|
|
136
|
+
* the unified `@huaqiu/dsh-plugin-log` so all plugin diagnostics land in one
|
|
137
|
+
* file (`<DSH_HOME>/logs/dsh-plugins.log`) — preserved verbatim across deps
|
|
138
138
|
* for the (test) callers that construct mock services around it.
|
|
139
139
|
*/
|
|
140
140
|
export function log(level: 'debug' | 'warn', msg: string, extra?: Record<string, unknown>): void {
|
|
141
141
|
const l = getPluginLog()
|
|
142
|
-
if (level === 'warn') l.warn(
|
|
143
|
-
else l.debug(
|
|
142
|
+
if (level === 'warn') l.warn(msg, extra)
|
|
143
|
+
else l.debug(msg, extra)
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
// ── Service ─────────────────────────────────────────────────────────────────
|