gz-research-assistant 0.1.1 → 0.1.3

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 (38) hide show
  1. package/README.md +52 -2
  2. package/dist/App-B12hd4tM.js +2524 -0
  3. package/dist/App-B12hd4tM.js.map +1 -0
  4. package/dist/{Assistant.d.ts → App.d.ts} +2 -2
  5. package/dist/api/automation.d.ts +12 -0
  6. package/dist/{knowledge.d.ts → api/knowledge.d.ts} +1 -1
  7. package/dist/components/AssistantAvatar/index.d.ts +3 -0
  8. package/dist/core.d.ts +4 -4
  9. package/dist/core.js +1 -1
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.js +2 -2
  12. package/dist/pages/assistant/components/AgentPanel/index.d.ts +5 -0
  13. package/dist/{automation/AssertionEditor.d.ts → pages/assistant/components/AssertionEditor/index.d.ts} +1 -1
  14. package/dist/{PerformancePanel.d.ts → pages/assistant/components/PerformancePanel/index.d.ts} +1 -1
  15. package/dist/{automation/StepSupplement.d.ts → pages/assistant/components/StepSupplement/index.d.ts} +1 -1
  16. package/dist/{TimelinePanel.d.ts → pages/assistant/components/TimelinePanel/index.d.ts} +1 -1
  17. package/dist/{ResearchAssistant.d.ts → pages/assistant/index.d.ts} +0 -1
  18. package/dist/{recorder-B_wXzg3N.js → recorder-ClSMnnGL.js} +6 -6
  19. package/dist/recorder-ClSMnnGL.js.map +1 -0
  20. package/dist/sdk.d.ts +3 -3
  21. package/dist/sdk.js +1 -1
  22. package/dist/sdk.js.map +1 -1
  23. package/dist/style.css +1 -10
  24. package/dist/{automation → utils/automation}/timeline-case.d.ts +1 -1
  25. package/package.json +2 -2
  26. package/dist/Assistant-DEhy-idh.js +0 -1876
  27. package/dist/Assistant-DEhy-idh.js.map +0 -1
  28. package/dist/AssistantAvatar.d.ts +0 -1
  29. package/dist/recorder-B_wXzg3N.js.map +0 -1
  30. /package/dist/{FloatingPanel.d.ts → layouts/FloatingPanel/index.d.ts} +0 -0
  31. /package/dist/{useOverlayScrollbars.d.ts → layouts/FloatingPanel/useOverlayScrollbars.d.ts} +0 -0
  32. /package/dist/{automation/AutomationPanel.d.ts → pages/assistant/components/AutomationPanel/index.d.ts} +0 -0
  33. /package/dist/{automation → utils/automation}/recorder.d.ts +0 -0
  34. /package/dist/{automation → utils/automation}/schema.d.ts +0 -0
  35. /package/dist/{performance.d.ts → utils/diagnostics/performance.d.ts} +0 -0
  36. /package/dist/{privacy.d.ts → utils/diagnostics/privacy.d.ts} +0 -0
  37. /package/dist/{runtime.d.ts → utils/diagnostics/runtime.d.ts} +0 -0
  38. /package/dist/{snapshot.d.ts → utils/diagnostics/snapshot.d.ts} +0 -0
package/README.md CHANGED
@@ -50,7 +50,9 @@ The SDK mounts the exact public React component in its own React root. Both entr
50
50
 
51
51
  `sessionKey` changes reset the entire assistant, including open tabs, drafts, imported/frozen snapshots and paused collection. Changing `themeMode` or `developer` retains data. Changing the bridge URL or runtime callbacks restarts collection and discards diagnostics and recorded cases. The host controls authentication and business response semantics; the package does not import a host store or read auth tokens. Bridge polling is excluded from Fetch and XHR collection automatically, including custom bridge URLs. Additional `ignoreRequest` filters apply to both APIs.
52
52
 
53
- Theme defaults to `gold-dark`; pass the same `themeMode` to both integration styles to follow your application. Assistant styles use scoped `--ra-color-*` variables, independent of host `--app-*` variables. Both require the CSS imports and the same React/gz-ui peer dependencies. This SDK is an ESM npm entrypoint, not a dependency-free CDN script.
53
+ Theme defaults to `gold-dark`; pass the same `themeMode` to both integration styles to follow your application. The assistant uses gg-ui's `getDesignTokenCssVariables({ themeMode, includeCustom: false })` on its own container. CSS Modules consume the library's `--gz-*` tokens directly, independent of host `--app-*` variables; there is no private color-token mapping. Both require the CSS imports and the same React/gz-ui peer dependencies. This SDK is an ESM npm entrypoint, not a dependency-free CDN script.
54
+
55
+ UI controls come from `@chenhui996/gg-ui`, including file selection (`Upload`, local parsing only), `Select`, `InputNumber`, `Checkbox`, `Collapse` and automation cards. Component configuration is isolated from the host provider. Preserve the existing flex layout, spacing, typography, timeline/JSON presentation and memory chart when adopting library components; replacing a control must not redesign the panel. The robot SVG and launcher appearance are intentionally unchanged.
54
56
 
55
57
  ### Migrating from 0.1.0
56
58
 
@@ -58,6 +60,8 @@ React now starts/stops the collector automatically. **Remove the old `startAssis
58
60
 
59
61
  ## Shared automation dependency
60
62
 
63
+ Version 0.1.3 keeps the existing **自主探索** interface and upgrades its shared engine to `gz-laya-pilot@0.1.2`. Select a host-authorized page, allow test-data writes if needed, explore, download the upstream Excel workbook, then import it for fresh-session replay. The Node host uses `createAgentBridge()` → `runAgent()` → the pinned upstream `runWorkflow`; generation and replay both use local Laya, with real Playwright assertions and evidence. The engine adds continuous microfrontend execution, semantic record trees, search/detail checks and related-record transactions. Real-model acceptance on 2026-10-07 generated and replayed 12 cases on the securities fixture and 11 on an independent English tree/relationship fixture. These results cover supported flows, not arbitrary backends or every page feature. See the engine's [package documentation](https://www.npmjs.com/package/gz-laya-pilot) for dependencies, integration requirements and support boundaries.
64
+
61
65
  ```text
62
66
  React <ResearchAssistant> ─┐
63
67
  ├→ shared Assistant → recorder / assertion UI
@@ -66,7 +70,7 @@ SDK mountAssistant ───────┘ ├→ gz-la
66
70
  └→ HTTP bridge → Node gz-laya-pilot.runCase
67
71
  ```
68
72
 
69
- `gz-laya-pilot@0.1.0` is a declared runtime dependency for **both** entrypoints. The browser imports only its schema and semantic targets. To execute, the host provides the same-origin bridge to a Node process importing `runCase` from `gz-laya-pilot`; no copied runner or SDK-specific replay path exists. Never bundle Node execution or model keys into the browser. This repository's `vite/laya-pilot.plugin.ts` and `tools/laya-pilot-recorded-runner.mjs` are a restricted localhost mock adapter, not a production test service.
73
+ `gz-laya-pilot@0.1.2` is a declared runtime dependency for **both** entrypoints. The browser imports only its schema and semantic targets. To execute, the host provides the same-origin bridge to a Node process importing `runCase` or `createAgentBridge` from `gz-laya-pilot`; no copied runner or SDK-specific replay path exists. Never bundle Node execution or model keys into the browser. This repository's `vite/laya-pilot.plugin.ts` and `tools/laya-pilot-recorded-runner.mjs` provide localhost integration, not a production test service.
70
74
 
71
75
  Bridge: `GET /status` returns RunStatus + available; `POST /run` accepts `{testCase, delay, headed}` and returns 202 + status; `POST /stop` stops the run. POST uses JSON and `X-Laya-Pilot: recorded-case-v1`. The host must authenticate, validate input, restrict test targets and serialize runs. Server results use idle/running/passed/completed/failed/stopped and assertion evidence.
72
76
 
@@ -77,3 +81,49 @@ OverlayScrollbars handles scroll visibility/dragging. Performance warnings are b
77
81
  ## Verifying parity in this repository
78
82
 
79
83
  Run `npm run assistant:build`, `npm run assistant:test` and `npm run assistant:parity` (system Chrome required). The browser suite mounts each public entrypoint on the same fixture, records trusted form actions, adds an assertion through the editor, exports/imports JSON, and executes passing and failing cases through the real `gz-laya-pilot` Node package. It compares case JSON, replay results and theme styles, and checks window controls, narrow layouts, diagnostics, session reset and cleanup. It starts and closes its own local server; results are saved under `test-results/entry-parity/`.
84
+
85
+ ## 源码组织约定
86
+
87
+ 遵循本仓库的 [项目目录结构规范](https://github.com/chenhui996/gz-zd-web/blob/codex/research-assistant/docs/项目目录结构规范.md),按职责和业务模块组织。小蜜是嵌入式组件,`pages/assistant` 表示浮窗内的功能视图,不另外引入路由,也不建立没有实际用途的空目录。
88
+
89
+ ```text
90
+ src/
91
+ ├─ index.ts / sdk.tsx / core.ts # npm、SDK、无 UI 能力的稳定公开入口
92
+ ├─ App.tsx / App.module.less # 会话与 gg-ui 主题 token,样式就近存放
93
+ ├─ App.test.tsx # 入口一致性测试
94
+ ├─ api/ # 回放服务通信、知识问答适配协议
95
+ ├─ components/
96
+ │ └─ AssistantAvatar/ # 复用的小机器人组件
97
+ │ ├─ index.tsx
98
+ │ └─ index.module.less
99
+ ├─ layouts/
100
+ │ └─ FloatingPanel/ # 浮窗布局、滚动条 Hook、就近测试
101
+ │ ├─ index.tsx
102
+ │ └─ index.module.less
103
+ ├─ pages/
104
+ │ └─ assistant/
105
+ │ ├─ index.tsx # 主界面与页签装配
106
+ │ ├─ index.module.less # 当前页面样式及页面内复用的布局样式
107
+ │ └─ components/ # 页面私有组件,每个目录均有 TSX + module.less
108
+ │ ├─ AutomationPanel/
109
+ │ ├─ AgentPanel/
110
+ │ ├─ AssertionEditor/
111
+ │ ├─ StepSupplement/
112
+ │ ├─ TimelinePanel/
113
+ │ └─ PerformancePanel/
114
+ └─ utils/
115
+ ├─ diagnostics/ # 采集、脱敏、快照、性能规则及就近测试
116
+ └─ automation/ # 录制、用例协议、时间线转换及就近测试
117
+ ```
118
+
119
+ - `pages` 负责视图,页面专用组件放在该页面的 `components` 下;`layouts` 负责浮窗容器,`components` 存放复用组件,`api` 负责通信,`utils` 负责非 UI 能力。工具逻辑不依赖 React 或视图,测试与实现就近存放。
120
+ - 宿主只能从包的公开入口导入;包内按实际依赖直接引用文件,避免为每层增加重复转发的 `index.ts`。跨业务复用限于模型和协议,不让面板相互嵌套依赖。
121
+ - 有自有样式的组件使用同目录的 `index.tsx` 和 `index.module.less`,TSX 统一通过 `import styles from './index.module.less'` 导入。禁止把组件样式集中到远处的 `shared/styles`,也不使用普通 `.less` 的副作用导入。
122
+ - 组件的专属样式及响应式规则放在自己的 module 中;页面内共用的间距、字段、按钮行等通过 CSS Modules 的 `composes` 显式复用页面样式,避免复制声明。不要通过 Less 汇总导入所有组件样式。
123
+ - `:global(...)` 仅用于 gg-ui/OverlayScrollbars 内部类名,必须受本地类名约束。滚动逻辑和浏览器检查使用 `data-assistant-part`、`data-expanded` 等稳定标记,不依赖生成的 CSS 类名。
124
+ - 目录或样式迁移不得改变小机器人 SVG、界面布局、行为及公开 API。新增功能沿用所属模块,不再堆回源码根目录。
125
+ - 当前 UI 已冻结:未经用户明确授权,不修改任何样式、布局、图标或其他视觉表现相关代码;功能优化沿用现有界面。
126
+
127
+ 自主探索的操作类型、断言与证据保存在 Excel 中,尚未验证的入口记录在工作簿“探索范围”及运行结果元数据中;“用例通过”不表示页面功能全覆盖。0.1.3 保留原有结果区 UI,React 与 SDK 仍使用同一 AgentPanel 和同一 `gz-laya-pilot` 工作流。
128
+
129
+ 关联列表测试在本轮新建父记录中选择现有数据、确认添加、独立会话核对,再移除关联并独立确认恢复。该事务与断言保存进 Excel,由相同引擎回放;不能将只打开详情页签计为关联业务测试通过。