Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openapi/calle.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,8 @@ components:

This is useful for batch calls where each recipient needs their own outcome, such as `can_attend`, `confirmed`, `requested_callback`, or `interest_level`.

Supported schema features are `type`, `properties`, `required`, `enum`, nested `object` fields, simple `array.items`, `description`, and `additionalProperties: false`. Unsupported features include `$ref`, `oneOf`, `anyOf`, `allOf`, recursive schemas, complex format validation, and `additionalProperties: true`.

Do not use reserved recipient response field names such as `summary`, `status`, `transcript`, `call_id`, or timing fields as custom result fields. Use names such as `customer_summary`, `notes`, or `reason` instead.

Field `description` values are passed to the extraction model and should explain how enum values should be selected. Descriptions guide extraction but are not hard validation rules. Hard validation comes from `type`, `required`, `enum`, and `additionalProperties`.
Expand Down
3 changes: 1 addition & 2 deletions src/regions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ export function extractRegions(readme) {
!section ||
!rows ||
rows.length < 3 ||
rows[0] !==
"| Country | Country Code | Calling Code | Languages | Default Line |" ||
!/^\| Country \| Country Code \| Calling Code \| Languages \| (?:Default Line|Line Region) \|$/.test(rows[0]) ||
!/^\|(?:[ \t]*:?-+:?[ \t]*\|){5}$/.test(rows[1]) ||
rows.some((row) => row.split("|").length !== 7) ||
rows.slice(2).some((row) =>
Expand Down
15 changes: 12 additions & 3 deletions tests/docs-site.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Unrelated examples.`;
test("extracts only valid region coverage from the source README", () => {
expect(extractRegions(regionsReadme)).toBe(regionSection);
expect(extractRegions(regionsReadme.replaceAll("\n", "\r\n"))).toBe(regionSection);
expect(extractRegions(regionsReadme.replace("Default Line", "Line Region")))
.toBe(regionSection.replace("Default Line", "Line Region"));
for (const invalid of [
regionsReadme.replace("Supported Regions and Languages", "Removed section"),
regionsReadme.replace("| Languages |", "| Renamed column |"),
Expand All @@ -100,6 +102,13 @@ test("refreshes region coverage without rebuilding the docs", async ({ page }) =
await expect(page.getByRole("cell", { name: "Test language" })).toBeVisible();
await expect(page.getByText("Unrelated examples.")).toHaveCount(0);

await page.route(REGIONS_README_URL, (route) => route.fulfill({
contentType: "text/plain",
body: regionsReadme.replace("Default Line", "Line Region"),
}));
await page.reload();
await expect(page.getByRole("columnheader", { name: "Line Region" })).toBeVisible();

await page.setViewportSize({ width: 390, height: 844 });
expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(390);
await page.setViewportSize({ width: 1280, height: 720 });
Expand All @@ -113,13 +122,13 @@ test("refreshes region coverage without rebuilding the docs", async ({ page }) =

test("retains a readable region snapshot when refresh fails", async ({ page, request }) => {
await page.setViewportSize({ width: 390, height: 844 });
const tableHeader = "| Country | Country Code | Calling Code | Languages | Default Line |";
const tableHeader = /\| Country \| Country Code \| Calling Code \| Languages \| (?:Default Line|Line Region) \|/;
const html = await request.get("/regions");
expect(await html.text()).toContain("<table");
const markdown = await request.get("/regions.md");
expect(await markdown.text()).toContain(tableHeader);
expect(await markdown.text()).toMatch(tableHeader);
const llmsFull = await request.get("/llms-full.txt");
expect(await llmsFull.text()).toContain(tableHeader);
expect(await llmsFull.text()).toMatch(tableHeader);

for (const response of [
{ status: 503, body: "Unavailable" },
Expand Down