gz-research-assistant 0.1.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.
- package/README.md +43 -0
- package/dist/AssistantAvatar.d.ts +1 -0
- package/dist/FloatingPanel.d.ts +9 -0
- package/dist/PerformancePanel.d.ts +8 -0
- package/dist/ResearchAssistant-DAsgcwcG.js +1757 -0
- package/dist/ResearchAssistant-DAsgcwcG.js.map +1 -0
- package/dist/ResearchAssistant.d.ts +6 -0
- package/dist/TimelinePanel.d.ts +5 -0
- package/dist/automation/AssertionEditor.d.ts +9 -0
- package/dist/automation/AutomationPanel.d.ts +4 -0
- package/dist/automation/StepSupplement.d.ts +6 -0
- package/dist/automation/recorder.d.ts +18 -0
- package/dist/automation/schema.d.ts +1 -0
- package/dist/automation/timeline-case.d.ts +5 -0
- package/dist/core.d.ts +5 -0
- package/dist/core.js +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/knowledge.d.ts +15 -0
- package/dist/performance.d.ts +25 -0
- package/dist/privacy.d.ts +5 -0
- package/dist/recorder-Da1VSLid.js +709 -0
- package/dist/recorder-Da1VSLid.js.map +1 -0
- package/dist/runtime.d.ts +110 -0
- package/dist/sdk.d.ts +4 -0
- package/dist/sdk.js +15 -0
- package/dist/sdk.js.map +1 -0
- package/dist/snapshot.d.ts +4 -0
- package/dist/style.css +11 -0
- package/dist/useOverlayScrollbars.d.ts +4 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# gz-research-assistant
|
|
2
|
+
|
|
3
|
+
Installable research assistant with gz-ui components, diagnostics, recording, assertions and local replay integration. Requires React 19 and gz-ui's peer dependencies.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install gz-research-assistant @chenhui996/gg-ui @ant-design/icons antd react react-dom
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { useEffect } from 'react';
|
|
11
|
+
import {
|
|
12
|
+
ResearchAssistant,
|
|
13
|
+
startAssistant,
|
|
14
|
+
assistantRuntime,
|
|
15
|
+
recorder,
|
|
16
|
+
} from 'gz-research-assistant';
|
|
17
|
+
import '@chenhui996/gg-ui/gg-ui.css';
|
|
18
|
+
import 'gz-research-assistant/style.css';
|
|
19
|
+
|
|
20
|
+
export function AssistantForSession() {
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const stop = startAssistant();
|
|
23
|
+
return () => {
|
|
24
|
+
stop();
|
|
25
|
+
assistantRuntime.clear();
|
|
26
|
+
recorder.clear();
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
return <ResearchAssistant developer bridgeUrl="/__laya-pilot" />;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Mount one instance per page after login. Remount with a user/session key and clear on logout. The package never imports your store or reads your token. `startAssistant({isBusinessFailure, ignoreRequest})` lets the host define response-code semantics and excluded requests. Hooks are installed once and restored by the returned cleanup. Keep a single lifecycle owner.
|
|
34
|
+
|
|
35
|
+
For imperative SDK integration, import `mountAssistant` from `gz-research-assistant/sdk`, call it with a container, props and runtime options, then invoke the returned disposer on logout/unmount. For diagnostics without React UI use `gz-research-assistant/core`. Import the same CSS for SDK use.
|
|
36
|
+
|
|
37
|
+
Browser automation uses `gz-laya-pilot` as a dependency. The browser imports only its schema and semantic targets. To execute, the host provides a same-origin bridge to a Node process calling `runCase`; 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.
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
Timeline data stays in memory (300 events / 60 requests / 15 minutes), with private inputs excluded and JSON previews redacted. Timeline text is presentation only. Passive history never reconstructs input values or runnable selectors. Active recordings store structured targets and actions; add `data-testid`, proper labels or `data-assistant-label` to improve semantics. Closed Shadow DOM and cross-origin frames require host adapters.
|
|
42
|
+
|
|
43
|
+
OverlayScrollbars handles scroll visibility/dragging. Performance warnings are bounded heuristics, not proof of a memory leak. rrweb visual replay and OpenTelemetry trace correlation are optional future integrations, not silently enabled collection.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AssistantAvatar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type PerformanceEvidence } from './performance';
|
|
2
|
+
export default function PerformancePanel({ metrics, data, now, paused, offline, }: {
|
|
3
|
+
metrics: Record<string, number>;
|
|
4
|
+
data: PerformanceEvidence;
|
|
5
|
+
now: number;
|
|
6
|
+
paused: boolean;
|
|
7
|
+
offline: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|