@ancha-labs/cli 0.4.10 → 0.4.11

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.
@@ -93841,7 +93841,7 @@ var when = external_exports.string().refine((value4) => {
93841
93841
  } catch {
93842
93842
  return false;
93843
93843
  }
93844
- }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -35m");
93844
+ }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -35m");
93845
93845
  var ref7 = external_exports.string().regex(/^[A-Za-z0-9_-]{1,80}$/);
93846
93846
  var attachment = external_exports.strictObject({
93847
93847
  filename: external_exports.string().min(1).max(255),
@@ -94210,7 +94210,7 @@ var when2 = external_exports.string().refine((value4) => {
94210
94210
  } catch {
94211
94211
  return false;
94212
94212
  }
94213
- }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -2h");
94213
+ }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -2h");
94214
94214
  var zone3 = external_exports.string().max(100).refine((value4) => {
94215
94215
  try {
94216
94216
  new Intl.DateTimeFormat("en", { timeZone: value4 });
@@ -94743,11 +94743,11 @@ var isDuration = (value4) => {
94743
94743
  };
94744
94744
  var past = external_exports.string().refine(
94745
94745
  (value4) => external_exports.iso.datetime({ offset: true }).safeParse(value4).success ? Number.isFinite(Date.parse(value4)) : isDuration(value4) && parseDuration(value4) <= 0,
94746
- "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -720h"
94746
+ "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -720h"
94747
94747
  );
94748
94748
  var moment = external_exports.string().refine(
94749
94749
  (value4) => external_exports.iso.datetime({ offset: true }).safeParse(value4).success ? Number.isFinite(Date.parse(value4)) : isDuration(value4),
94750
- "expected an ISO 8601 time with a timezone, or an offset from the scene start such as 72h or -24h"
94750
+ "expected an ISO 8601 time with a timezone, or an offset from the start of the test such as 72h or -24h"
94751
94751
  );
94752
94752
  var StripeSeedSchema = external_exports.strictObject({
94753
94753
  account: external_exports.strictObject({ name: text8, currency: external_exports.enum(["usd", "eur", "gbp", "cad", "aud"]).default("usd"), statement_descriptor: external_exports.string().regex(/^[A-Za-z0-9 .-]{5,22}$/).optional() }),
@@ -95277,7 +95277,7 @@ var when3 = external_exports.string().refine((value4) => {
95277
95277
  } catch {
95278
95278
  return false;
95279
95279
  }
95280
- }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -8h");
95280
+ }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -8h");
95281
95281
  var day2 = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/);
95282
95282
  var block = external_exports.lazy(() => external_exports.strictObject({
95283
95283
  type: external_exports.enum(NOTION_BLOCK_TYPES),
@@ -95582,7 +95582,7 @@ var when4 = external_exports.string().refine((value4) => {
95582
95582
  } catch {
95583
95583
  return false;
95584
95584
  }
95585
- }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -30h");
95585
+ }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -30h");
95586
95586
  var attribute = external_exports.strictObject({
95587
95587
  api_slug: slug,
95588
95588
  title: external_exports.string().min(1).max(100),
@@ -95844,7 +95844,7 @@ var isDuration2 = (value4) => {
95844
95844
  };
95845
95845
  var past2 = external_exports.string().refine(
95846
95846
  (v) => external_exports.iso.datetime({ offset: true }).safeParse(v).success ? Number.isFinite(Date.parse(v)) : isDuration2(v) && parseDuration(v) <= 0,
95847
- "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -26h"
95847
+ "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -26h"
95848
95848
  );
95849
95849
  var moment2 = external_exports.string().refine((v) => external_exports.iso.datetime({ offset: true }).safeParse(v).success ? Number.isFinite(Date.parse(v)) : isDuration2(v), "expected an ISO 8601 time or an offset such as 24h");
95850
95850
  var ResendSeedSchema = external_exports.strictObject({
@@ -96198,7 +96198,7 @@ var past3 = external_exports.string().refine((value4) => {
96198
96198
  } catch {
96199
96199
  return false;
96200
96200
  }
96201
- }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -30h");
96201
+ }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -30h");
96202
96202
  var address3 = external_exports.strictObject({
96203
96203
  first_name: external_exports.string().max(100).optional(),
96204
96204
  last_name: external_exports.string().max(100).optional(),
@@ -96945,7 +96945,7 @@ var past4 = external_exports.string().refine((value4) => {
96945
96945
  } catch {
96946
96946
  return false;
96947
96947
  }
96948
- }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -30h");
96948
+ }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -30h");
96949
96949
  var person = external_exports.strictObject({ first_name: external_exports.string().min(1).max(140), last_name: external_exports.string().min(1).max(140), email: external_exports.string().regex(EMAIL8) });
96950
96950
  var PayPalSeedSchema = external_exports.strictObject({
96951
96951
  account: external_exports.strictObject({
@@ -97150,7 +97150,7 @@ var time3 = (future = false) => external_exports.string().refine((value4) => {
97150
97150
  } catch {
97151
97151
  return false;
97152
97152
  }
97153
- }, future ? "expected an ISO 8601 time with a timezone, or an offset from the scene start such as 7d" : "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -30h");
97153
+ }, future ? "expected an ISO 8601 time with a timezone, or an offset from the start of the test such as 7d" : "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -30h");
97154
97154
  var past5 = time3();
97155
97155
  var moment3 = time3(true);
97156
97156
  var JiraSeedSchema = external_exports.strictObject({
@@ -97695,7 +97695,7 @@ var time4 = (future = false) => external_exports.string().refine((value4) => {
97695
97695
  } catch {
97696
97696
  return false;
97697
97697
  }
97698
- }, future ? "expected an ISO 8601 time with a timezone, or an offset from the scene start such as 1d" : "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -30h");
97698
+ }, future ? "expected an ISO 8601 time with a timezone, or an offset from the start of the test such as 1d" : "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -30h");
97699
97699
  var past6 = time4();
97700
97700
  var moment4 = time4(true);
97701
97701
  var IntercomSeedSchema = external_exports.strictObject({
@@ -98222,7 +98222,7 @@ var offsetOk = (value4, future) => {
98222
98222
  };
98223
98223
  var time5 = (future) => external_exports.string().refine(
98224
98224
  (v) => external_exports.iso.datetime({ offset: true }).safeParse(v).success ? Number.isFinite(Date.parse(v)) : offsetOk(v, future),
98225
- future ? "expected an ISO 8601 time with an offset, or an offset from the scene start such as 26h" : "expected an ISO 8601 time with an offset, or a nonpositive offset such as -30h"
98225
+ future ? "expected an ISO 8601 time with an offset, or an offset from the start of the test such as 26h" : "expected an ISO 8601 time with an offset, or a nonpositive offset such as -30h"
98226
98226
  );
98227
98227
  var past7 = time5(false);
98228
98228
  var moment5 = time5(true);
@@ -98956,7 +98956,7 @@ var past8 = external_exports.string().refine((value4) => {
98956
98956
  } catch {
98957
98957
  return false;
98958
98958
  }
98959
- }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the scene start such as -30h");
98959
+ }, "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -30h");
98960
98960
  var spacing = external_exports.string().refine((value4) => {
98961
98961
  try {
98962
98962
  return parseDuration(value4) > 0;
@@ -100821,7 +100821,7 @@ var money6 = external_exports.number().finite().refine((value4) => Math.round(va
100821
100821
  var positive = money6.refine((value4) => value4 > 0, "must be more than 0");
100822
100822
  var day5 = external_exports.string().refine(
100823
100823
  (value4) => /^-?\d+d$/.test(value4) || /^\d{4}-\d{2}-\d{2}$/.test(value4) && (/* @__PURE__ */ new Date(`${value4}T00:00:00Z`)).toISOString().slice(0, 10) === value4,
100824
- "expected YYYY-MM-DD or an offset in days from the scene start, e.g. -30d"
100824
+ "expected YYYY-MM-DD or an offset in days from the start of the test, e.g. -30d"
100825
100825
  );
100826
100826
  var external = text11.optional();
100827
100827
  var custom2 = external_exports.record(external_exports.string().regex(/^cust(?:entity|body|col|item)[a-z0-9_]+$/), external_exports.union([external_exports.string().max(4e3), external_exports.number(), external_exports.boolean(), external_exports.null()])).optional();
@@ -101897,7 +101897,7 @@ var ToolExampleSchema = external_exports.strictObject({
101897
101897
  });
101898
101898
  var SceneToolSchema = external_exports.strictObject({
101899
101899
  /** A JSON lines file next to the scene, one recorded call per line (`ancha run` reads it into `recorded`). */
101900
- observations: external_exports.string().regex(/^(?!\/)(?!.*(?:^|\/)\.\.(?:\/|$))[^\0]+$/, "a path relative to the scene file, without ..").optional(),
101900
+ observations: external_exports.string().regex(/^(?!\/)(?!.*(?:^|\/)\.\.(?:\/|$))[^\0]+$/, "a path relative to the test file (scene.yaml), without ..").optional(),
101901
101901
  recorded: external_exports.array(ToolObservationSchema).optional(),
101902
101902
  /** Calls from other traces of this agent, so a simulated answer can follow how the tool behaved there. */
101903
101903
  examples: external_exports.array(ToolExampleSchema).optional(),
@@ -103091,7 +103091,7 @@ function toolIssues(scene2) {
103091
103091
  if (tool.unrecorded === "twin" && tool.twin === void 0) issues.push({ path: `${path4}.unrecorded`, message: "unrecorded: twin needs the twin that answers", hint: `set ${path4}.twin, e.g. twin: slack` });
103092
103092
  if (tool.pure && tool.write) issues.push({ path: `${path4}.pure`, message: "a tool that changes something is not pure", hint: `remove ${path4}.pure, or ${path4}.write if it only computes from its arguments` });
103093
103093
  if (tool.observations !== void 0 && tool.recorded === void 0) {
103094
- issues.push({ path: `${path4}.observations`, message: `${tool.observations} was not read`, hint: "load the scene from its file (ancha run, ancha scene validate), which reads the recorded calls next to it" });
103094
+ issues.push({ path: `${path4}.observations`, message: `${tool.observations} was not read`, hint: "load the test from its file (ancha run, ancha scene validate), which reads the recorded calls next to it" });
103095
103095
  }
103096
103096
  tool.recorded?.forEach((o, i) => {
103097
103097
  if (o.tool !== name5) issues.push({ path: `${path4}.recorded[${i}].tool`, message: `a call to ${o.tool} recorded under ${name5}` });
@@ -103104,7 +103104,7 @@ function toolIssues(scene2) {
103104
103104
  const patterns = check3.trace[key4] === void 0 ? [] : [].concat(check3.trace[key4]);
103105
103105
  patterns.forEach((pattern) => {
103106
103106
  const bare = /^([A-Za-z_][\w.-]{0,127})(?:\s+\{.*\})?$/s.exec(pattern.trim());
103107
- if (bare && !scene2.tools[bare[1]]) issues.push({ path: `checks[${i}].trace.${key4}`, message: `${bare[1]} is not one of this scene's tools`, hint: `the tools are ${Object.keys(scene2.tools).join(", ")}; an API call is "<METHOD> <PATH>"` });
103107
+ if (bare && !scene2.tools[bare[1]]) issues.push({ path: `checks[${i}].trace.${key4}`, message: `${bare[1]} is not one of this test's tools`, hint: `the tools are ${Object.keys(scene2.tools).join(", ")}; an API call is "<METHOD> <PATH>"` });
103108
103108
  });
103109
103109
  }
103110
103110
  });
@@ -103428,7 +103428,7 @@ function ruleIssues(scene2) {
103428
103428
  if (scene2.world === "static" && scene2.world_rules !== void 0) {
103429
103429
  issues.push({
103430
103430
  path: "world_rules",
103431
- message: "static scenes cannot declare world rules",
103431
+ message: "static tests cannot declare world rules",
103432
103432
  hint: "set world: living, or remove world_rules"
103433
103433
  });
103434
103434
  }
@@ -103568,7 +103568,7 @@ function parseSceneYaml(text23) {
103568
103568
  return { path: `line ${line2}, column ${col2}`, message: e.message };
103569
103569
  });
103570
103570
  const atError = doc.errors.findIndex((e) => text23[e.pos[0]] === "@");
103571
- if (atError >= 0) issues[atError].hint = "scene refs use $, e.g. $alice \u2014 YAML reserves @";
103571
+ if (atError >= 0) issues[atError].hint = "refs in a test use $, e.g. $alice \u2014 YAML reserves @";
103572
103572
  throw sceneError(issues, doc.errors[0]);
103573
103573
  }
103574
103574
  const cut = cutProseIssues(doc, text23, lineCounter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancha-labs/cli",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "type": "module",
5
5
  "description": "Simulation playgrounds for agents: run your agent against stateful replicas of Slack, GitHub, Datadog and more, each attempt on a fresh cloud machine in your app.ancha.io workspace, or on your computer.",
6
6
  "bugs": {