@data-fair/lib-agents-sim 0.4.0 → 0.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-agents-sim",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Primitives for judged browser simulations of the data-fair agents chat, plus a Claude Code bridge exposing the Agent SDK as an OpenAI-compatible provider.",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/persona.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { SimulationCase } from './types.ts';
2
2
  import type { PagePerception } from './page-perception.ts';
3
3
  export declare const DONE = "DONE";
4
- export declare const PERSONA_MAX_TURNS = 6;
4
+ export declare const PERSONA_MAX_TURNS = 25;
5
5
  export declare const PERCEPTION_INSTRUCTIONS = "You can look at the screen yourself with the look tool, and you can click and type\non the page. Before you say anything about what is or is not on the screen, look.\nNever claim you cannot see something you have not looked for.";
6
6
  export declare function isDone(message: string): boolean;
7
7
  export declare function personaSystemPrompt(c: SimulationCase, perceptionEnabled?: boolean, offLimitsActive?: boolean): string;
package/persona.js CHANGED
@@ -12,11 +12,28 @@ import { MISSING_SDK_MESSAGE, isMissingSdkError } from "./missing-sdk.js";
12
12
  import { MCP_SERVER_NAME } from "./page-perception.js";
13
13
  export const DONE = 'DONE';
14
14
  let neutralCwd;
15
- // The persona now looks and acts before replying, so one turn is not enough:
16
- // look → act → look → reply, with room to spare. Low enough that a confused
17
- // persona cannot spend the run clicking around. A starting point, to be revisited
18
- // from a real run rather than guessed at twice.
19
- export const PERSONA_MAX_TURNS = 6;
15
+ // The persona looks and acts before replying, so one turn is not enough:
16
+ // look → act → look → reply, with room to spare.
17
+ //
18
+ // Tuned from real runs, three times, and the number follows the shape of the
19
+ // work rather than a guess. It is the budget for ONE message: how many tool
20
+ // calls the person may make before answering.
21
+ //
22
+ // 6 was the cost of look/click/look/click/look — the most ordinary thing a
23
+ // person does on a multi-step page — leaving nothing for the reply.
24
+ //
25
+ // 12 was exactly the length of a guided workflow. In a run of the dataset
26
+ // creation case the assistant handed over the whole procedure in one message
27
+ // and the person executed it in one turn: click Create, choose the type, skip
28
+ // the init step, type a title, tick an option, continue — with a look between
29
+ // each, twelve calls of purposeful work and nothing wasted. The reply then had
30
+ // no budget left and the run was discarded.
31
+ //
32
+ // So a guided scenario costs roughly (steps × 2) + 1, and the assistant decides
33
+ // how many steps it hands over at once. 25 covers a full wizard driven in a
34
+ // single message, with the verification looks and the reply, and still stops a
35
+ // genuinely lost persona long before it could wander for minutes.
36
+ export const PERSONA_MAX_TURNS = 25;
20
37
  export const PERCEPTION_INSTRUCTIONS = `You can look at the screen yourself with the look tool, and you can click and type
21
38
  on the page. Before you say anything about what is or is not on the screen, look.
22
39
  Never claim you cannot see something you have not looked for.`;