@huaqiu/dsh-tool-part-search 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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createLogger } from "@hqedge/logging";
1
+ import { getLogger } from "@huaqiu/dsh-plugin-log";
2
2
  import { createPartSearchService } from "@huaqiu/part-search";
3
3
  import { defineTool } from "@deepseek-ai/dsh-tools";
4
4
  //#region src/service.ts
@@ -257,8 +257,7 @@ const name = "@huaqiu/dsh-tool-part-search";
257
257
  /** Cordis services this half depends on: the DSH node tool registry. */
258
258
  const inject = ["tools"];
259
259
  /**
260
- * Lazy: a module-level `const log = createLogger(...)` would create the file
261
- * stream at import time (before DSH home is mockable in tests).
260
+ * Lazy: a module-level `const log = getLogger(...)` would call `getLogger()` at
262
261
  * import time, which on bootstrap touches `dshHomePath('logs')` (transitively
263
262
  * via the unified-sink directory resolution). Tests that
264
263
  * `vi.mock('@deepseek-ai/dsh-home-paths', …)` get their TMP constant in scope
@@ -266,7 +265,7 @@ const inject = ["tools"];
266
265
  */
267
266
  let _log = null;
268
267
  function log() {
269
- if (_log === null) _log = createLogger({ component: "dsh-part-search" });
268
+ if (_log === null) _log = getLogger("dsh-part-search");
270
269
  return _log;
271
270
  }
272
271
  /**
@@ -282,7 +281,7 @@ function log() {
282
281
  function apply(ctx) {
283
282
  if (!ctx.tools || typeof ctx.tools.register !== "function") throw new Error("@huaqiu/dsh-tool-part-search requires the DSH `tools` service (ctx.tools.register).");
284
283
  const disposers = createPartSearchTools(createPartSearch()).map((tool) => ctx.tools.register(tool));
285
- log().info({ tools: disposers.length }, "registered agent tools");
284
+ log().info("registered agent tools", { tools: disposers.length });
286
285
  return function dispose() {
287
286
  for (const disposeTool of disposers) try {
288
287
  disposeTool();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huaqiu/dsh-tool-part-search",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "type": "module",
5
5
  "main": "./lib/index.mjs",
6
6
  "types": "./lib/index.d.mts",
@@ -22,8 +22,8 @@
22
22
  "@deepseek-ai/dsh-tools": "^0.1.0-rc.0"
23
23
  },
24
24
  "dependencies": {
25
- "@hqedge/logging": "^0.2.7",
26
- "@huaqiu/part-search": "^0.2.0"
25
+ "@huaqiu/part-search": "^0.2.0",
26
+ "@huaqiu/dsh-plugin-log": "0.3.13"
27
27
  },
28
28
  "files": [
29
29
  "lib",
package/src/index.ts CHANGED
@@ -24,7 +24,7 @@
24
24
  */
25
25
 
26
26
  import type { Context } from '@deepseek-ai/cordis'
27
- import { createLogger, type Logger } from '@hqedge/logging'
27
+ import { getLogger, type PluginLogger } from '@huaqiu/dsh-plugin-log'
28
28
  import { createPartSearch } from './service.js'
29
29
  import { createPartSearchTools } from './tools.js'
30
30
 
@@ -35,16 +35,15 @@ export const name = '@huaqiu/dsh-tool-part-search'
35
35
  export const inject = ['tools'] as const
36
36
 
37
37
  /**
38
- * Lazy: a module-level `const log = createLogger(...)` would create the file
39
- * stream at import time (before DSH home is mockable in tests).
38
+ * Lazy: a module-level `const log = getLogger(...)` would call `getLogger()` at
40
39
  * import time, which on bootstrap touches `dshHomePath('logs')` (transitively
41
40
  * via the unified-sink directory resolution). Tests that
42
41
  * `vi.mock('@deepseek-ai/dsh-home-paths', …)` get their TMP constant in scope
43
42
  * only after the mock factory, so defer the call until `apply()` runs.
44
43
  */
45
- let _log: Logger | null = null
46
- function log(): Logger {
47
- if (_log === null) _log = createLogger({ component: 'dsh-part-search' })
44
+ let _log: PluginLogger | null = null
45
+ function log(): PluginLogger {
46
+ if (_log === null) _log = getLogger('dsh-part-search')
48
47
  return _log
49
48
  }
50
49
 
@@ -66,7 +65,7 @@ export function apply(ctx: Context): () => void {
66
65
  const service = createPartSearch()
67
66
  const disposers = createPartSearchTools(service).map((tool) => ctx.tools.register(tool))
68
67
 
69
- log().info({ tools: disposers.length }, 'registered agent tools')
68
+ log().info('registered agent tools', { tools: disposers.length })
70
69
 
71
70
  return function dispose() {
72
71
  for (const disposeTool of disposers) {