@jnrs/lingshu-smart 2.2.46 → 3.0.0

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.
Files changed (65) hide show
  1. package/AGENTS.md +281 -348
  2. package/dist/components/debug/DataLogPanel.vue.d.ts +29 -3
  3. package/dist/components/debug/PerformanceStats.vue.d.ts +1 -1
  4. package/dist/components/debug/ScriptRunner/ConfigPanel.vue.d.ts +1 -2
  5. package/dist/components/debug/ScriptRunner/StepsPanel.vue.d.ts +4 -2
  6. package/dist/components/debug/ScriptRunner/index.vue.d.ts +11 -0
  7. package/dist/components/debug/ScriptRunner/script.d.ts +140 -41
  8. package/dist/components/debug/ScriptRunner/scriptFile.d.ts +92 -0
  9. package/dist/components/debug/WsProxy/index.vue.d.ts +10 -8
  10. package/dist/components/debug/WsProxy/proxy.d.ts +114 -53
  11. package/dist/components/editor/ControlBar/CaseManger.vue.d.ts +18 -2
  12. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +2 -2
  13. package/dist/components/editor/ControlBar/PersistDialog.vue.d.ts +9 -0
  14. package/dist/components/index.js +8419 -6045
  15. package/dist/components/preview/index.vue.d.ts +6852 -4876
  16. package/dist/controller/AppController.d.ts +75 -4
  17. package/dist/controller/SocketDispatcher.d.ts +59 -0
  18. package/dist/fullscreen-BA3oea8O.js +53 -0
  19. package/dist/index-C6Liz-8o.js +1238 -0
  20. package/dist/index.js +36 -27
  21. package/dist/lingshu-smart/cases.json +5890 -14828
  22. package/dist/lingshu-smart/mockSocket.json +263 -0
  23. package/dist/lingshu-smart/wsProxyConfig.json +343 -720
  24. package/dist/playground/ViewPageDemo.vue.d.ts +14412 -10438
  25. package/dist/stores/index.js +1 -1
  26. package/dist/stores/useAppStore.d.ts +20570 -14641
  27. package/dist/stores/useDataStore.d.ts +21139 -14587
  28. package/dist/stores/useDebugStore.d.ts +14 -2
  29. package/dist/stores/useEditorStore.d.ts +3 -3
  30. package/dist/types/app.types.d.ts +1 -1
  31. package/dist/types/components/config.types.d.ts +16 -0
  32. package/dist/types/components/operating.types.d.ts +28 -19
  33. package/dist/types/enums.d.ts +22 -2
  34. package/dist/types/guards.d.ts +4 -1
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/models/config.types.d.ts +41 -9
  37. package/dist/types/models/operating.types.d.ts +64 -74
  38. package/dist/types/socket.types.d.ts +275 -0
  39. package/dist/ui/abstract/ModelAbs.d.ts +42 -2
  40. package/dist/ui/components/Resource.d.ts +0 -1
  41. package/dist/ui/components/StationSlot.d.ts +8 -2
  42. package/dist/ui/components/StationSlotGroup.d.ts +28 -3
  43. package/dist/ui/models/DoubleJointRobot.d.ts +16 -4
  44. package/dist/ui/models/MachineTool.d.ts +6 -2
  45. package/dist/ui/models/MaterialTrack.d.ts +14 -2
  46. package/dist/ui/models/Pallet.d.ts +29 -9
  47. package/dist/ui/models/Rail.d.ts +9 -2
  48. package/dist/ui/models/ResourceOperationWindow.d.ts +2 -1
  49. package/dist/ui/models/ResourceStore.d.ts +7 -5
  50. package/dist/ui/models/Rgv.d.ts +6 -6
  51. package/dist/ui/models/ShuttleStation.d.ts +14 -4
  52. package/dist/ui/models/SingleJointRobot.d.ts +14 -4
  53. package/dist/ui/utils/resolveStationSlotLayers.d.ts +20 -0
  54. package/dist/ui/utils/resolveTypeStyle.d.ts +13 -0
  55. package/dist/useAppStore-DASwAOBy.js +7223 -0
  56. package/dist/utils/fullscreen.d.ts +9 -0
  57. package/dist/utils/index.d.ts +1 -0
  58. package/dist/vite.d.ts +15 -0
  59. package/dist/vite.js +39 -0
  60. package/package.json +6 -2
  61. package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupBoth.vue.d.ts +0 -2
  62. package/dist/guards-aLOXCeCF.js +0 -35
  63. package/dist/index-Dsgrnpn0.js +0 -1186
  64. package/dist/useAppStore-CVyLAMtL.js +0 -6125
  65. /package/dist/components/editor/OptionCard/Equipment/{stationSlot/StationSlotGroup.vue.d.ts → models/ResourceStore.vue.d.ts} +0 -0
@@ -1,4 +1,5 @@
1
- import { IScene, ILayer, IContainer, ILayerOperating } from '../types';
1
+ import { IScene, ILayer, IContainer, ILayerOperating, EnumResourceType } from '../types';
2
+ import { ModelAbs } from '../ui/abstract/ModelAbs';
2
3
  import { App } from 'leafer';
3
4
  export declare class AppController {
4
5
  app: App;
@@ -8,11 +9,16 @@ export declare class AppController {
8
9
  private palletLinks;
9
10
  private pendingPalletLinks;
10
11
  private syncingPallets;
12
+ private followRafId;
13
+ private followingSet;
14
+ private followDeadlines;
11
15
  private appEditable;
12
16
  private actions;
13
17
  private hideSceneFill;
14
18
  private shadowsEnabled;
15
19
  private animationsEnabled;
20
+ private alarmHighlights;
21
+ private hostExtensions;
16
22
  constructor(options?: IContainer);
17
23
  start(): void;
18
24
  destroy(): void;
@@ -29,14 +35,79 @@ export declare class AppController {
29
35
  * @returns 实际复位的模型数量
30
36
  */
31
37
  resetAllModels(): number;
32
- removeModelById(uuid: string): void;
38
+ /**
39
+ * 复位单个业务设备(device_init 全量覆盖语义:缺省字段重置为默认值,见文档第七章)
40
+ * @param className 设备类型(EnumModel 值)
41
+ * @param id 业务设备 ID
42
+ * @param stationIndex 同设备多实例时指定目标实例;缺省复位该设备全部实例
43
+ * @returns 是否至少复位了一个模型
44
+ */
45
+ resetModel(className: string, id: string, stationIndex?: number): boolean;
46
+ /** 复位单个模型实例:重建 UI、回插原位置、重新注册交互事件与调试状态 */
47
+ private resetSingleModel;
48
+ removeModelById(id: string): void;
33
49
  addModel(modelConfig: ILayer): void;
34
50
  private registerPalletLink;
35
51
  rerenderModel(modelConfig: ILayer): void;
36
- operating(data: ILayerOperating): void;
37
- private syncLinkedPallets;
52
+ operating(data: ILayerOperating): boolean;
53
+ /**
54
+ * 托盘/拖链逐帧跟随:
55
+ * 机器人等设备移动时,读取设备实时位置直接驱动绑定托盘与轨道拖链,
56
+ * 避免各自独立动画(时长/缓动/中断时机不一致)导致移动不同步。
57
+ * 连续移动(多步操作)时每次刷新截止时间,跟随持续到设备动画结束。
58
+ */
59
+ private startLinkedFollow;
38
60
  private globalHandle;
39
61
  private batchRemove;
62
+ /** 是否存在匹配的业务设备模型(command_ack 404 判断) */
63
+ hasDevice(className: string, id: string): boolean;
64
+ /** 判断设备是否存在指定序号的工位(任一工位组;多层设备按 layer 定位层) */
65
+ hasStation(className: string, id: string, stationIndex: number, layer?: number): boolean;
66
+ /** 判断指定工位是否可放置该资源类型(运行期类型强校验,见文档 4.3) */
67
+ acceptsResourceType(className: string, id: string, stationIndex: number, resourceType: EnumResourceType, layer?: number): boolean;
68
+ /** 查找第一个可放置指定资源类型的工位序号(device_station 缺省语义,见文档 3.3) */
69
+ findFirstStationIndex(className: string, id: string, resourceType: EnumResourceType): number | undefined;
70
+ /**
71
+ * 统一工位寻址(宿主 + 扩展托盘合并编号):
72
+ * 1. stationIndex 缺省:宿主内找第一个可放置工位;未命中时按绑定顺序在扩展托盘上继续找(允许落到扩展工位)
73
+ * 2. stationIndex 明确:宿主工位组优先;未命中时按合并编号偏移(宿主工位总数 + 前序扩展托盘工位总数)
74
+ * 换算扩展托盘局部工位号(局部 = 合并编号 - 偏移,局部 < 1 时该托盘不承接)
75
+ * @returns 命中目标(模型实例 + 局部工位号 + 合并编号);宿主与扩展均未命中返回 undefined(调用方回执 404)
76
+ */
77
+ resolveStationTarget(className: string, id: string, resourceType: EnumResourceType, stationIndex?: number, layer?: number): {
78
+ model: ModelAbs;
79
+ stationIndex: number;
80
+ mergedIndex: number;
81
+ } | undefined;
82
+ /** 在扩展托盘上按合并编号定位工位(偏移量 = 宿主工位总数 + 前序扩展托盘工位总数,逐盘顺延) */
83
+ private resolveExtensionStation;
84
+ /** 在扩展托盘上查找第一个可放置指定资源类型的工位(device_station 缺省且宿主无可用工位时顺延) */
85
+ private findFirstExtensionStation;
86
+ /**
87
+ * 扩展工位点击视图:绑定 extendHostId 的托盘工位被点击时,
88
+ * 返回宿主设备 config(layer 参数替换为宿主)与合并编号(data.index 改写值)
89
+ */
90
+ getExtensionTapView(pallet: ModelAbs, localIndex: number): {
91
+ hostConfig: ILayer;
92
+ mergedIndex: number;
93
+ localIndex: number;
94
+ } | undefined;
95
+ /** 查找扩展工位宿主模型:优先非托盘设备(托盘与宿主共用 id 时排除托盘自身与其余托盘) */
96
+ private findExtensionHostModel;
97
+ /** 获取指定工位槽中心的场景坐标(世界坐标系,供 transfer 搬运动画规划路径) */
98
+ getStationSlotPoint(className: string, id: string, stationIndex: number, layer?: number): {
99
+ x: number;
100
+ y: number;
101
+ } | undefined;
102
+ /** 按 className + id(多实例时按工位号消歧)定位模型实例 */
103
+ private findStationModel;
104
+ /**
105
+ * 设备告警高亮联动:告警产生时在设备外围显示旋转虚线高亮环;
106
+ * 告警解除(同一 alarm_id 以 status: 'resolved' 重推)时移除
107
+ */
108
+ setAlarmHighlight(className: string, id: string, on: boolean, level?: 'critical' | 'warning' | 'info'): void;
109
+ /** 移除全部告警高亮(scene_reset 场景复位时调用) */
110
+ clearAlarmHighlights(): void;
40
111
  worldToLocalPoint(worldX: number, worldY: number): {
41
112
  x: number;
42
113
  y: number;
@@ -0,0 +1,59 @@
1
+ import { SocketMessage, CommandAckPayload, IScene } from '../types';
2
+ import { AppController } from './AppController';
3
+ /** 分发器选项 */
4
+ export interface SocketDispatcherOptions {
5
+ /** 画布控制器(内部 operating 引擎) */
6
+ appController: AppController;
7
+ /** 获取场景配置(用于 position 比例值 → 像素换算) */
8
+ getScene: () => IScene | null;
9
+ /** 回执回调(画布 → 后端 command_ack) */
10
+ onAck?: (ack: SocketMessage<CommandAckPayload>) => void;
11
+ /** 画布无模型的透传消息(alarm_push / runtime_status_push 等) */
12
+ onRaw?: (msg: SocketMessage<any>) => void;
13
+ }
14
+ export declare class SocketDispatcher {
15
+ private appController;
16
+ private getScene;
17
+ private onAck?;
18
+ private onRaw?;
19
+ private pool;
20
+ /** envelope.id 去重缓存(重复 ID 丢弃,warn 日志) */
21
+ private seenIds;
22
+ private seenQueue;
23
+ constructor(options: SocketDispatcherOptions);
24
+ /** 场景复位 / 画布复位时清空资源池(全部资源实体离场) */
25
+ reset(): void;
26
+ /**
27
+ * 分发一条完整业务消息(envelope + payload)
28
+ * @param msg 原始消息
29
+ */
30
+ dispatch(msg: unknown): void;
31
+ private handleDeviceCommand;
32
+ /** 将 device_command payload 转换为内部 operating(position 比例值 → 像素) */
33
+ private buildDeviceOperating;
34
+ /** 协议 position(比例值)→ 内部 operating position(位移像素 / 角度原值);仅保留显式传入的字段 */
35
+ private toPixelPosition;
36
+ private handleDeviceInit;
37
+ private handleResourceCommand;
38
+ /**
39
+ * 资源落位校验(静态强校验,不做业务时序约束,见文档 4.3 / 8.2):
40
+ * - 位置结构 / device_type 无效 → 400
41
+ * - 目标设备未找到 / 工位未找到(含扩展工位)/ 无可用工位 → 404
42
+ * - 资源类型与目标工位声明类型不匹配 → 409
43
+ * - device_station 缺省时解析「第一个可用工位」(宿主优先,允许顺延到扩展托盘,见文档 3.3)
44
+ * 扩展工位寻址:宿主(如机床)工位组未命中时,按合并编号偏移顺延到绑定的扩展托盘(extendHostId),
45
+ * 返回的 target 为实际承接设备(可能是托盘),资源池与 placeResource 均以其为准
46
+ */
47
+ private resolvePlacement;
48
+ /** 由落位结果构建实际承接位置的 ResourceLocation(扩展工位时为托盘自身寻址,后续 remove/transfer 直接按实际位置寻址) */
49
+ private toResolvedLocation;
50
+ /**
51
+ * 解析「来源位置」到实际承接设备(transfer.from 的扩展工位合并编号寻址;
52
+ * 未命中时保持原位置,由后续工位移除逻辑自然失败)
53
+ */
54
+ private resolveSourceLocation;
55
+ /** 将资源实体放置/移除到目标工位(device_type + device_id + layer + device_station 定位) */
56
+ private placeResource;
57
+ private handleAlarmPush;
58
+ private ack;
59
+ }
@@ -0,0 +1,53 @@
1
+ import { b as e } from "./index-C6Liz-8o.js";
2
+ import { ref as c, onMounted as t, onUnmounted as N } from "vue";
3
+ function O(s) {
4
+ return s?.className === e.MACHINE_TOOL;
5
+ }
6
+ function l(s) {
7
+ return s?.className === e.MACHINE_TOOL || s?.className === e.MARKING_MACHINE || s?.className === e.CLEANING_MACHINE || s?.className === e.LOADING_STATION || s?.className === e.RESOURCE_OPERATION_WINDOW;
8
+ }
9
+ function m(s) {
10
+ return s?.className === e.RESOURCE_STORE || s?.className === e.SINGLE_JOINT_ROBOT || s?.className === e.DOUBLE_JOINT_ROBOT || s?.className === e.RGV;
11
+ }
12
+ function E(s) {
13
+ return s?.className === e.SHUTTLE_STATION || s?.className === e.MATERIAL_TRACK || s?.className === e.PALLET || s?.className === e.MACHINE_TOOL || s?.className === e.LOADING_STATION || s?.className === e.MARKING_MACHINE || s?.className === e.CLEANING_MACHINE || s?.className === e.SINGLE_JOINT_ROBOT || s?.className === e.DOUBLE_JOINT_ROBOT || s?.className === e.RGV || s?.className === e.RESOURCE_STORE || s?.className === e.RESOURCE_OPERATION_WINDOW;
14
+ }
15
+ function T(s) {
16
+ return s?.className === e.RESOURCE_STORE;
17
+ }
18
+ function I(s) {
19
+ return s?.className === e.SINGLE_JOINT_ROBOT || s?.className === e.DOUBLE_JOINT_ROBOT;
20
+ }
21
+ function _(s) {
22
+ return s?.className === e.RAIL;
23
+ }
24
+ function i(s) {
25
+ return s?.className === e.SHUTTLE_STATION;
26
+ }
27
+ function R(s) {
28
+ return s?.className === e.PALLET;
29
+ }
30
+ const r = () => {
31
+ const s = c(!1), n = () => {
32
+ s.value = !!document.fullscreenElement;
33
+ }, a = () => {
34
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
35
+ };
36
+ return t(() => {
37
+ document.addEventListener("fullscreenchange", n);
38
+ }), N(() => {
39
+ document.removeEventListener("fullscreenchange", n);
40
+ }), { isFullscreen: s, toggleFullscreen: a };
41
+ };
42
+ export {
43
+ m as a,
44
+ E as b,
45
+ T as c,
46
+ I as d,
47
+ _ as e,
48
+ i as f,
49
+ R as g,
50
+ l as h,
51
+ O as i,
52
+ r as u
53
+ };