@ancha-labs/cli 0.2.1 → 0.3.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/ancha.mjs +4834 -3526
- package/lib/assets/harbor/companion.mjs +697 -273
- package/lib/mcp-entry.mjs +51 -1
- package/lib/worker.mjs +87963 -85514
- package/lib/world-server.mjs +696 -276
- package/package.json +1 -1
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,51 @@ 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
|
+
description: external_exports.string().optional(),
|
|
65463
|
+
schema: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
65464
|
+
});
|
|
65465
|
+
var TriggerSchema = external_exports.strictObject({
|
|
65466
|
+
task: external_exports.string().optional(),
|
|
65467
|
+
input: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
65468
|
+
});
|
|
65421
65469
|
var CheckSchema = external_exports.union([
|
|
65422
65470
|
external_exports.strictObject({ id: external_exports.string(), state: StateCheckSchema }),
|
|
65423
65471
|
external_exports.strictObject({ id: external_exports.string(), trace: TraceCheckSchema }),
|
|
@@ -65439,6 +65487,8 @@ var SceneSchema = external_exports.strictObject({
|
|
|
65439
65487
|
skip_idle: external_exports.boolean().optional(),
|
|
65440
65488
|
timeout: duration6("Per-trial time budget, e.g. 5m").default("5m"),
|
|
65441
65489
|
task: external_exports.string().optional(),
|
|
65490
|
+
trigger: TriggerSchema.optional(),
|
|
65491
|
+
tools: external_exports.record(external_exports.string().regex(TOOL_NAME_PATTERN, "a tool name as the model saw it"), SceneToolSchema).optional(),
|
|
65442
65492
|
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
65493
|
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
65494
|
people: PeopleSchema.optional(),
|