@huaqiu/dsh-tool-schematic-gen 0.3.11 → 0.3.12

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
@@ -3,7 +3,7 @@ import { writeFile } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
5
  import { defineTool } from "@deepseek-ai/dsh-tools";
6
- import { getLogger } from "@huaqiu/dsh-plugin-log";
6
+ import { createLogger } from "@hqedge/logging";
7
7
  //#region src/config.ts
8
8
  /**
9
9
  * `@huaqiu/dsh-tool-schematic-gen` — config, agent identity, run-body and
@@ -710,7 +710,7 @@ async function exportModuleGraphZip(exportZipUrl, moduleGraph, config, account,
710
710
  function asJson(value) {
711
711
  return JSON.parse(JSON.stringify(value));
712
712
  }
713
- const log$1 = getLogger("dsh-schematic-gen");
713
+ const log$1 = createLogger({ component: "dsh-schematic-gen" });
714
714
  /** Agent-facing timeout hints. */
715
715
  const TOOL_TIMEOUT_MS = {
716
716
  generate_schematic_from_description: HTTP_TIMEOUT_MS,
@@ -733,7 +733,7 @@ async function resolveAccount(auth) {
733
733
  };
734
734
  return null;
735
735
  } catch (err) {
736
- log$1.warn("could not resolve the eda.cn account", { error: String(err?.message || err) });
736
+ log$1.warn({ error: String(err?.message || err) }, "could not resolve the eda.cn account");
737
737
  return null;
738
738
  }
739
739
  }
@@ -798,10 +798,10 @@ async function artifactUriOf(env, id) {
798
798
  if (!env.artifacts || typeof env.artifacts.getDownloadUri !== "function") return null;
799
799
  return await env.artifacts.getDownloadUri(id);
800
800
  } catch (err) {
801
- log$1.warn("getDownloadUri failed", {
801
+ log$1.warn({
802
802
  id,
803
803
  error: String(err?.message || err)
804
- });
804
+ }, "getDownloadUri failed");
805
805
  return null;
806
806
  }
807
807
  }
@@ -1405,7 +1405,7 @@ const inject = [
1405
1405
  "huaqiuArtifacts",
1406
1406
  "webServer"
1407
1407
  ];
1408
- const log = getLogger("dsh-schematic-gen");
1408
+ const log = createLogger({ component: "dsh-schematic-gen" });
1409
1409
  /**
1410
1410
  * Host plugin body — register the two generation tools.
1411
1411
  *
@@ -1440,12 +1440,12 @@ function apply(ctx, config = {}) {
1440
1440
  progress,
1441
1441
  deps: {}
1442
1442
  }).map((tool) => ctx.tools.register(tool));
1443
- log.info("registered agent tools", {
1443
+ log.info({
1444
1444
  tools: disposers.length,
1445
1445
  copilotkitUrl: finalConfig.copilotkitUrl,
1446
1446
  exportZipUrl: finalConfig.exportZipUrl,
1447
1447
  auth: "huaqiuAuth"
1448
- });
1448
+ }, "registered agent tools");
1449
1449
  return function dispose() {
1450
1450
  for (const disposeTool of disposers) try {
1451
1451
  disposeTool();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huaqiu/dsh-tool-schematic-gen",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "type": "module",
5
5
  "main": "./lib/index.mjs",
6
6
  "types": "./lib/index.d.mts",
@@ -30,8 +30,8 @@
30
30
  "@deepseek-ai/cordis": "^4.0.1",
31
31
  "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.0",
32
32
  "@deepseek-ai/dsh-tools": "^0.1.0-rc.0",
33
- "@huaqiu/dsh-auth": "^0.3.11",
34
- "@huaqiu/dsh-artifacts": "^0.3.11",
33
+ "@huaqiu/dsh-auth": "^0.3.12",
34
+ "@huaqiu/dsh-artifacts": "^0.3.12",
35
35
  "react": "^18"
36
36
  },
37
37
  "devDependencies": {
@@ -39,9 +39,9 @@
39
39
  "@huaqiu/kicad-sexpr-parser": "^0.1.1",
40
40
  "@types/react": "^18.3.31",
41
41
  "react": "^18.3.1",
42
- "@huaqiu/dsh-auth": "0.3.11",
43
- "@huaqiu/dsh-artifacts": "0.3.11",
44
- "@huaqiu/dsh-tool-uncollapse": "0.3.11"
42
+ "@huaqiu/dsh-artifacts": "0.3.12",
43
+ "@huaqiu/dsh-tool-uncollapse": "0.3.12",
44
+ "@huaqiu/dsh-auth": "0.3.12"
45
45
  },
46
46
  "files": [
47
47
  "lib",
@@ -52,7 +52,7 @@
52
52
  "access": "public"
53
53
  },
54
54
  "dependencies": {
55
- "@huaqiu/dsh-plugin-log": "0.3.11"
55
+ "@hqedge/logging": "^0.2.7"
56
56
  },
57
57
  "scripts": {
58
58
  "typecheck": "tsc --noEmit",
package/src/index.ts CHANGED
@@ -26,7 +26,7 @@ import { resolveConfig } from './config.js'
26
26
  import { HTTP_TIMEOUT_MS } from './sse.js'
27
27
  import { ProgressStore } from './progress.js'
28
28
  import { createProgressHandler, PROGRESS_ROUTE_PREFIX } from './routes.js'
29
- import { getLogger } from '@huaqiu/dsh-plugin-log'
29
+ import { createLogger } from '@hqedge/logging'
30
30
 
31
31
  /** Plugin id — matches package.json. */
32
32
  export const name = '@huaqiu/dsh-tool-schematic-gen'
@@ -42,7 +42,7 @@ export const inject = ['tools', 'huaqiuAuth', 'huaqiuArtifacts', 'webServer'] as
42
42
 
43
43
  /** Shared component name for the unified DSH-plugin log. */
44
44
  const COMPONENT = 'dsh-schematic-gen'
45
- const log = getLogger(COMPONENT)
45
+ const log = createLogger({ component: COMPONENT })
46
46
 
47
47
  export interface SchematicGenPluginConfig {
48
48
  /** Endpoint overrides, env-backed. */
@@ -107,12 +107,7 @@ export function apply(ctx: Context, config: SchematicGenPluginConfig = {}): () =
107
107
 
108
108
  const disposers = createSchematicGenTools(env).map((tool) => ctx.tools.register(tool))
109
109
 
110
- log.info('registered agent tools', {
111
- tools: disposers.length,
112
- copilotkitUrl: finalConfig.copilotkitUrl,
113
- exportZipUrl: finalConfig.exportZipUrl,
114
- auth: 'huaqiuAuth',
115
- })
110
+ log.info({ tools: disposers.length, copilotkitUrl: finalConfig.copilotkitUrl, exportZipUrl: finalConfig.exportZipUrl, auth: 'huaqiuAuth' }, 'registered agent tools')
116
111
 
117
112
  return function dispose() {
118
113
  for (const disposeTool of disposers) {
package/src/tools.ts CHANGED
@@ -23,7 +23,7 @@ import { join } from 'node:path'
23
23
  import { defineTool } from '@deepseek-ai/dsh-tools'
24
24
  import type { HuaqiuAuthService } from '@huaqiu/dsh-auth'
25
25
  import type { CreateArtifactResult, HuaqiuArtifacts } from '@huaqiu/dsh-artifacts'
26
- import { getLogger } from '@huaqiu/dsh-plugin-log'
26
+ import { createLogger } from '@hqedge/logging'
27
27
  import {
28
28
  agentIds,
29
29
  buildHeaders,
@@ -47,7 +47,7 @@ function asJson<T>(value: T): Json {
47
47
 
48
48
  /** Shared component name for the unified DSH-plugin log. */
49
49
  const COMPONENT = 'dsh-schematic-gen'
50
- const log = getLogger(COMPONENT)
50
+ const log = createLogger({ component: COMPONENT })
51
51
 
52
52
  /** Agent-facing timeout hints. */
53
53
  export const TOOL_TIMEOUT_MS = {
@@ -98,7 +98,7 @@ async function resolveAccount(auth: HuaqiuAuthService['auth']): Promise<EdaAccou
98
98
  }
99
99
  return null
100
100
  } catch (err) {
101
- log.warn('could not resolve the eda.cn account', { error: String((err as Error)?.message || err) })
101
+ log.warn({ error: String((err as Error)?.message || err) }, 'could not resolve the eda.cn account')
102
102
  return null
103
103
  }
104
104
  }
@@ -180,7 +180,7 @@ async function artifactUriOf(env: SchematicGenEnv, id: string): Promise<string |
180
180
  if (!env.artifacts || typeof env.artifacts.getDownloadUri !== 'function') return null
181
181
  return await env.artifacts.getDownloadUri(id)
182
182
  } catch (err) {
183
- log.warn('getDownloadUri failed', { id, error: String((err as Error)?.message || err) })
183
+ log.warn({ id, error: String((err as Error)?.message || err) }, 'getDownloadUri failed')
184
184
  return null
185
185
  }
186
186
  }