cortico-world-genesis 2.2.1 → 2.2.2
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/world.ts +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 2.2.2
|
|
2
|
+
|
|
3
|
+
- 修:面板温室滑杆拖完又弹回「自动」。面板走到 `install` 时只把 `id` / `serves` 交给工具,`tempC` 与 `site` 被丢掉,引擎收到的就是「不传温度」=回到自动。现在面板参数原样透传。
|
|
4
|
+
- 同一处修复顺带让面板能装带参数的设备(机械臂 `inputs`/`output`/`items`、值班终端 `habitat`/`store`/`sites`、终端的 `target`/`buySpecies`)不再丢参数。
|
|
1
5
|
## 2.2.1
|
|
2
6
|
|
|
3
7
|
- 修:建了温室,面板与作物详情却还显示室外温度(`climateForPlant` 没走温室),看起来像温室没起作用。生长公式本来是对的,只有读出来的数是错的。
|
package/package.json
CHANGED
package/src/world.ts
CHANGED
|
@@ -1393,9 +1393,16 @@ export class GenesisWorld implements World {
|
|
|
1393
1393
|
/** 面板「装/建」:走同一条 genesis_install,人类和模型用一套规则。 */
|
|
1394
1394
|
private async installFromPanel(input: unknown): Promise<{ text: string; state: GenesisPanelState }> {
|
|
1395
1395
|
await this.sync();
|
|
1396
|
-
|
|
1396
|
+
// 面板传什么就原样交给工具:以前只转 id / serves,温室滑杆的 tempC、
|
|
1397
|
+
// 机械臂的 inputs、值班终端的 habitat 全被扔掉,于是「拖了滑杆又变回自动」。
|
|
1398
|
+
const args = { ...((input && typeof input === 'object' ? input : {}) as Record<string, unknown>) };
|
|
1399
|
+
if (typeof args.tempC === 'string') {
|
|
1400
|
+
const value = Number(args.tempC);
|
|
1401
|
+
if (Number.isFinite(value)) args.tempC = value;
|
|
1402
|
+
else delete args.tempC;
|
|
1403
|
+
}
|
|
1397
1404
|
const tool = this.installTool();
|
|
1398
|
-
const result = await tool.handler(
|
|
1405
|
+
const result = await tool.handler(args, {} as never);
|
|
1399
1406
|
const text = typeof result === 'string' ? result : result.text;
|
|
1400
1407
|
if (typeof result !== 'string' && result.failed) throw new Error(text);
|
|
1401
1408
|
return { text, state: await this.panelState() };
|