@xiaohhhh1/canvas-agent 0.4.18 → 0.4.19

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.
@@ -50,6 +50,9 @@ export declare class FastMossIntegration {
50
50
  lastCapture?: string;
51
51
  }>;
52
52
  close(): Promise<FastMossStatus>;
53
+ observations(): Promise<{
54
+ rows: Record<string, unknown>[];
55
+ }>;
53
56
  switchAccount(): Promise<FastMossStatus>;
54
57
  private loadRows;
55
58
  private useLatestPage;
@@ -221,6 +221,10 @@ export class FastMossIntegration {
221
221
  : "FastMoss 窗口已关闭;请先登录一次";
222
222
  return this.status();
223
223
  }
224
+ async observations() {
225
+ const rows = await this.loadRows();
226
+ return { rows };
227
+ }
224
228
  async switchAccount() {
225
229
  if (!this.context || !this.page || this.page.isClosed())
226
230
  await this.start();
@@ -131,6 +131,7 @@ export function startHttpServer() {
131
131
  res.json({ ok: true });
132
132
  }));
133
133
  app.get("/agent/integrations/fastmoss/status", route(async (_req, res) => res.json({ ok: true, ...await fastmoss.inspect() })));
134
+ app.get("/agent/integrations/fastmoss/observations", route(async (_req, res) => res.json({ ok: true, ...await fastmoss.observations() })));
134
135
  app.post("/agent/integrations/fastmoss/start", route(async (_req, res) => res.json({ ok: true, ...await fastmoss.start() })));
135
136
  app.post("/agent/integrations/fastmoss/refresh", route(async (_req, res) => res.json({ ok: true, ...await fastmoss.inspect() })));
136
137
  app.post("/agent/integrations/fastmoss/switch-account", route(async (_req, res) => res.json({ ok: true, ...await fastmoss.switchAccount() })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaohhhh1/canvas-agent",
3
- "version": "0.4.18",
3
+ "version": "0.4.19",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",