@huaqiu/component-gen-server 0.3.8 → 0.3.10
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.d.mts +8 -0
- package/lib/index.mjs +2 -1
- package/lib/standalone.mjs +2 -1
- package/package.json +5 -5
- package/src/jobs.ts +4 -1
- package/src/types.ts +8 -0
package/lib/index.d.mts
CHANGED
|
@@ -82,6 +82,14 @@ interface HistoryEntry {
|
|
|
82
82
|
filename: string;
|
|
83
83
|
fileUrl?: string;
|
|
84
84
|
size?: number;
|
|
85
|
+
/**
|
|
86
|
+
* HQ Edge-resolvable URI of the artifact content (`file://`), captured
|
|
87
|
+
* from the generation result so a reopened history entry can still be
|
|
88
|
+
* placed into the editor (the Place action). Absent on entries recorded
|
|
89
|
+
* before the placement channel existed, or when the URI could not be
|
|
90
|
+
* resolved at generation time.
|
|
91
|
+
*/
|
|
92
|
+
uri?: string;
|
|
85
93
|
};
|
|
86
94
|
error?: string;
|
|
87
95
|
}
|
package/lib/index.mjs
CHANGED
|
@@ -396,7 +396,8 @@ async function record(history, meta, req, state) {
|
|
|
396
396
|
artifactId: String(artifact.id),
|
|
397
397
|
filename: typeof artifact.filename === "string" ? artifact.filename : result?.filename ?? `${kind}.kicad_${kind === "symbol" ? "sym" : "mod"}`,
|
|
398
398
|
...typeof result?.fileUrl === "string" ? { fileUrl: result.fileUrl } : {},
|
|
399
|
-
...typeof artifact.size === "number" ? { size: artifact.size } : {}
|
|
399
|
+
...typeof artifact.size === "number" ? { size: artifact.size } : {},
|
|
400
|
+
...typeof artifact.uri === "string" && artifact.uri ? { uri: artifact.uri } : {}
|
|
400
401
|
} } : {},
|
|
401
402
|
...status === "failed" && state.error ? { error: state.error } : {}
|
|
402
403
|
};
|
package/lib/standalone.mjs
CHANGED
|
@@ -402,7 +402,8 @@ async function record(history, meta, req, state) {
|
|
|
402
402
|
artifactId: String(artifact.id),
|
|
403
403
|
filename: typeof artifact.filename === "string" ? artifact.filename : result?.filename ?? `${kind}.kicad_${kind === "symbol" ? "sym" : "mod"}`,
|
|
404
404
|
...typeof result?.fileUrl === "string" ? { fileUrl: result.fileUrl } : {},
|
|
405
|
-
...typeof artifact.size === "number" ? { size: artifact.size } : {}
|
|
405
|
+
...typeof artifact.size === "number" ? { size: artifact.size } : {},
|
|
406
|
+
...typeof artifact.uri === "string" && artifact.uri ? { uri: artifact.uri } : {}
|
|
406
407
|
} } : {},
|
|
407
408
|
...status === "failed" && state.error ? { error: state.error } : {}
|
|
408
409
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/component-gen-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"types": "./lib/index.d.mts",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.0",
|
|
26
|
-
"@huaqiu/dsh-
|
|
27
|
-
"@huaqiu/dsh-
|
|
26
|
+
"@huaqiu/dsh-auth": "0.3.10",
|
|
27
|
+
"@huaqiu/dsh-artifacts": "0.3.10"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.0",
|
|
31
|
-
"@huaqiu/dsh-tool-symbol-footprint": "^0.3.
|
|
31
|
+
"@huaqiu/dsh-tool-symbol-footprint": "^0.3.10"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"tsdown": "^0.22.14",
|
|
35
35
|
"typescript": "^5.9.0",
|
|
36
36
|
"vitest": "^4.1.0",
|
|
37
|
-
"@huaqiu/dsh-tool-symbol-footprint": "0.3.
|
|
37
|
+
"@huaqiu/dsh-tool-symbol-footprint": "0.3.10"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
package/src/jobs.ts
CHANGED
|
@@ -249,7 +249,7 @@ async function record(
|
|
|
249
249
|
const status: HistoryEntry['status'] = state.status === 'completed' ? 'generated' : state.status === 'cancelled' ? 'cancelled' : 'failed'
|
|
250
250
|
const result = state.result as Record<string, unknown> | undefined
|
|
251
251
|
const artifact = result?.artifact && typeof result.artifact === 'object'
|
|
252
|
-
? result.artifact as { id?: unknown; filename?: unknown; size?: unknown }
|
|
252
|
+
? result.artifact as { id?: unknown; filename?: unknown; size?: unknown; uri?: unknown }
|
|
253
253
|
: null
|
|
254
254
|
const entry: HistoryEntry = {
|
|
255
255
|
id: newHistoryId(),
|
|
@@ -270,6 +270,9 @@ async function record(
|
|
|
270
270
|
filename: typeof artifact.filename === 'string' ? artifact.filename : (result?.filename as string | undefined) ?? `${kind}.kicad_${kind === 'symbol' ? 'sym' : 'mod'}`,
|
|
271
271
|
...(typeof result?.fileUrl === 'string' ? { fileUrl: result.fileUrl } : {}),
|
|
272
272
|
...(typeof artifact.size === 'number' ? { size: artifact.size } : {}),
|
|
273
|
+
// Keep the placement channel alive across reopens: the HQ
|
|
274
|
+
// Edge-resolvable URI captured by the generation tail.
|
|
275
|
+
...(typeof artifact.uri === 'string' && artifact.uri ? { uri: artifact.uri } : {}),
|
|
273
276
|
},
|
|
274
277
|
}
|
|
275
278
|
: {}),
|
package/src/types.ts
CHANGED
|
@@ -79,6 +79,14 @@ export interface HistoryEntry {
|
|
|
79
79
|
filename: string
|
|
80
80
|
fileUrl?: string
|
|
81
81
|
size?: number
|
|
82
|
+
/**
|
|
83
|
+
* HQ Edge-resolvable URI of the artifact content (`file://`), captured
|
|
84
|
+
* from the generation result so a reopened history entry can still be
|
|
85
|
+
* placed into the editor (the Place action). Absent on entries recorded
|
|
86
|
+
* before the placement channel existed, or when the URI could not be
|
|
87
|
+
* resolved at generation time.
|
|
88
|
+
*/
|
|
89
|
+
uri?: string
|
|
82
90
|
}
|
|
83
91
|
error?: string
|
|
84
92
|
}
|