@ancha-labs/cli 0.2.1 → 0.4.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/lib/mcp-entry.mjs CHANGED
@@ -57335,6 +57335,8 @@ var EXECUTION_SUPPORT = {
57335
57335
  "world_rules": sceneOnly,
57336
57336
  "people": sceneOnly,
57337
57337
  "until": sceneOnly,
57338
+ "trigger": sceneOnly,
57339
+ "tools": sceneOnly,
57338
57340
  "deadline": sceneOnly,
57339
57341
  "start.message": sceneOnly,
57340
57342
  "pass": sceneOnly,
@@ -57373,7 +57375,8 @@ var EXECUTION_SUPPORT = {
57373
57375
  "--pass-env": sceneOnly,
57374
57376
  "--inherit-env": sceneOnly,
57375
57377
  "--upload": sceneOnly,
57376
- "--upload-required": sceneOnly
57378
+ "--upload-required": sceneOnly,
57379
+ "--allow-unwrapped": sceneOnly
57377
57380
  };
57378
57381
 
57379
57382
  // packages/core/src/duration.ts
@@ -65418,6 +65421,53 @@ var TraceCheckSchema = external_exports.strictObject({
65418
65421
  message: "status applies to called; not_called always counts every attempt",
65419
65422
  path: ["status"]
65420
65423
  });
65424
+ var TOOL_NAME_PATTERN = /^[A-Za-z_][\w.-]{0,127}$/;
65425
+ var ToolObservationSchema = external_exports.strictObject({
65426
+ tool: external_exports.string().regex(TOOL_NAME_PATTERN),
65427
+ at: duration6("Offset from the start of the production trace, e.g. 3s200ms"),
65428
+ /** When the call returned, as an offset like `at`: a test that reaches this answer has reached that time. */
65429
+ end: duration6("Offset from the start of the production trace when the call returned").optional(),
65430
+ args: external_exports.unknown().optional(),
65431
+ /** What the tool function returned. A recorded failure has `error` instead. */
65432
+ result: external_exports.unknown().optional(),
65433
+ error: external_exports.string().optional(),
65434
+ /** The framework's envelope as the trace held it (an MCP CallToolResult, a LangChain ToolMessage), for replay over MCP. */
65435
+ wrap: external_exports.enum(["mcp", "langchain", "output"]).optional(),
65436
+ raw: external_exports.unknown().optional(),
65437
+ call_id: external_exports.string().optional()
65438
+ }).refine((o) => o.error === void 0 || o.result === void 0, { message: "a recorded call has a result or an error, not both" });
65439
+ var ToolExampleSchema = external_exports.strictObject({
65440
+ trace: external_exports.string().optional(),
65441
+ at: duration6("Offset from the start of that trace"),
65442
+ args: external_exports.unknown().optional(),
65443
+ result: external_exports.unknown().optional(),
65444
+ error: external_exports.string().optional()
65445
+ });
65446
+ var SceneToolSchema = external_exports.strictObject({
65447
+ /** A JSON lines file next to the scene, one recorded call per line (`ancha run` reads it into `recorded`). */
65448
+ observations: external_exports.string().regex(/^(?!\/)(?!.*(?:^|\/)\.\.(?:\/|$))[^\0]+$/, "a path relative to the scene file, without ..").optional(),
65449
+ recorded: external_exports.array(ToolObservationSchema).optional(),
65450
+ /** Calls from other traces of this agent, so a simulated answer can follow how the tool behaved there. */
65451
+ examples: external_exports.array(ToolExampleSchema).optional(),
65452
+ /** A call production never made: simulated (the default for a read), a tool error (the default for a write), or the twin. */
65453
+ unrecorded: external_exports.enum(["simulate", "fail", "twin"]).optional(),
65454
+ /** The twin that answers what production never recorded (TRACE_PLAN_V2 §5.3). */
65455
+ twin: external_exports.string().optional(),
65456
+ /** The agent reaches this tool over MCP: in a test its client points at {{tools.mcp_url}}, so there is nothing to wrap. */
65457
+ mcp: external_exports.literal(true).optional(),
65458
+ /** `ancha run --allow-unwrapped`: the agent may call this tool for real (it does not wrap it), so the test does not stop. */
65459
+ allow_unwrapped: external_exports.literal(true).optional(),
65460
+ /** Changes something (a refund, an email): an unrecorded call is never answered by invention unless set to simulate. */
65461
+ write: external_exports.boolean().optional(),
65462
+ /** Only computes from its arguments (a calculator): a call production never made runs the tool itself, for real. */
65463
+ pure: external_exports.literal(true).optional(),
65464
+ description: external_exports.string().optional(),
65465
+ schema: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
65466
+ });
65467
+ var TriggerSchema = external_exports.strictObject({
65468
+ task: external_exports.string().optional(),
65469
+ input: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
65470
+ });
65421
65471
  var CheckSchema = external_exports.union([
65422
65472
  external_exports.strictObject({ id: external_exports.string(), state: StateCheckSchema }),
65423
65473
  external_exports.strictObject({ id: external_exports.string(), trace: TraceCheckSchema }),
@@ -65439,6 +65489,8 @@ var SceneSchema = external_exports.strictObject({
65439
65489
  skip_idle: external_exports.boolean().optional(),
65440
65490
  timeout: duration6("Per-trial time budget, e.g. 5m").default("5m"),
65441
65491
  task: external_exports.string().optional(),
65492
+ trigger: TriggerSchema.optional(),
65493
+ tools: external_exports.record(external_exports.string().regex(TOOL_NAME_PATTERN, "a tool name as the model saw it"), SceneToolSchema).optional(),
65442
65494
  seed: external_exports.strictObject({ slack: SlackSeedSchema.optional(), github: GitHubSeedSchema.optional(), datadog: DatadogSeedSchema.optional(), pagerduty: PagerDutySeedSchema.optional(), "linkedin-ads": LinkedInAdsSeedSchema.optional(), salesforce: SalesforceSeedSchema.optional(), gong: GongSeedSchema.optional(), hubspot: HubSpotSeedSchema.optional(), ga4: GA4SeedSchema.optional(), "google-ads": GoogleAdsSeedSchema.optional(), "chatgpt-ads": ChatGPTAdsSeedSchema.optional(), "open-meteo": OpenMeteoSeedSchema.optional(), "google-drive": GoogleDriveSeedSchema.optional(), gmail: GmailSeedSchema.optional(), "amazon-s3": AmazonS3SeedSchema.optional(), linear: LinearSeedSchema.optional(), "okta": OktaSeedSchema.optional(), stripe: StripeSeedSchema.optional(), "clerk": ClerkSeedSchema.optional(), "better-stack": BetterStackSeedSchema.optional(), notion: NotionSeedSchema.optional(), attio: AttioSeedSchema.optional(), "dropbox": DropboxSeedSchema.optional(), resend: ResendSeedSchema.optional(), "microsoft-word": MicrosoftWordSeedSchema.optional(), shopify: ShopifySeedSchema.optional(), "lob": LobSeedSchema.optional(), paypal: PayPalSeedSchema.optional(), jira: JiraSeedSchema.optional(), "kalshi": KalshiSeedSchema.optional(), intercom: IntercomSeedSchema.optional(), "zendesk": ZendeskSeedSchema.optional(), "google-calendar": GoogleCalendarSeedSchema.optional(), "twilio": TwilioSeedSchema.optional(), "asana": AsanaSeedSchema.optional(), "discord": DiscordSeedSchema.optional(), sentry: SentrySeedSchema.optional(), "airtable": AirtableSeedSchema.optional() }),
65443
65495
  world_rules: external_exports.strictObject({ actors: external_exports.array(ActorSchema).optional(), app_calls: external_exports.array(AppCallSchema).optional(), pipelines: external_exports.array(PipelineRuleSchema).optional(), faults: external_exports.array(FaultRuleSchema).optional(), metrics: external_exports.array(MetricRuleSchema).optional(), logs: external_exports.array(LogRuleSchema).optional(), monitors: external_exports.array(MonitorRuleSchema).optional(), integrations: external_exports.array(IntegrationSchema).optional() }).optional(),
65444
65496
  people: PeopleSchema.optional(),